From 2fb29ae4d8be4689d178e43778e0d0d4eb91b40a Mon Sep 17 00:00:00 2001 From: Valay Dave Date: Fri, 10 Jan 2025 19:45:24 +0530 Subject: [PATCH] [cards] `PythonCode` component (#2196) --- docs/cards.md | 6 +- metaflow/cards.py | 1 + metaflow/plugins/cards/card_cli.py | 9 ++- metaflow/plugins/cards/card_modules/basic.py | 61 ++++++++++++-- metaflow/plugins/cards/card_modules/card.py | 17 +++- .../plugins/cards/card_modules/components.py | 80 +++++++++++++++---- metaflow/plugins/cards/card_modules/main.js | 52 ++++++------ .../plugins/cards/card_modules/test_cards.py | 8 +- .../plugins/cards/component_serializer.py | 2 +- .../components/card-component-renderer.svelte | 2 + .../ui/src/components/python-code.svelte | 19 +++++ .../src/components/table-data-renderer.svelte | 2 + metaflow/plugins/cards/ui/src/types.ts | 12 ++- .../plugins/cards/simplecard/__init__.py | 2 +- 14 files changed, 213 insertions(+), 60 deletions(-) create mode 100644 metaflow/plugins/cards/ui/src/components/python-code.svelte diff --git a/docs/cards.md b/docs/cards.md index 5bddab2b72..900384861c 100644 --- a/docs/cards.md +++ b/docs/cards.md @@ -121,7 +121,7 @@ PATH_TO_CUSTOM_HTML = 'myhtml.html' class CustomCard(MetaflowCard): type = "custom_card" - def __init__(self, options={"no_header": True}, graph=None,components=[]): + def __init__(self, options={"no_header": True}, graph=None, components=[], flow=None, **kwargs): super().__init__() self._no_header = True self._graph = graph @@ -177,7 +177,7 @@ class CustomCard(MetaflowCard): HTML = "{data}" - def __init__(self, options={"no_header": True}, graph=None,components=[]): + def __init__(self, options={"no_header": True}, graph=None, components=[], flow=None, **kwargs): super().__init__() self._no_header = True self._graph = graph @@ -276,7 +276,7 @@ class YCard(MetaflowCard): ALLOW_USER_COMPONENTS = True - def __init__(self, options={}, components=[], graph=None): + def __init__(self, options={}, components=[], graph=None, flow=None, **kwargs): self._components = components def render(self, task): diff --git a/metaflow/cards.py b/metaflow/cards.py index 8a8556fb83..2497d4dd89 100644 --- a/metaflow/cards.py +++ b/metaflow/cards.py @@ -8,6 +8,7 @@ Markdown, VegaChart, ProgressBar, + PythonCode, ) from metaflow.plugins.cards.card_modules.basic import ( DefaultCard, diff --git a/metaflow/plugins/cards/card_cli.py b/metaflow/plugins/cards/card_cli.py index 15f15f430f..42a82fc478 100644 --- a/metaflow/plugins/cards/card_cli.py +++ b/metaflow/plugins/cards/card_cli.py @@ -691,10 +691,15 @@ def create( try: if options is not None: mf_card = filtered_card( - options=options, components=component_arr, graph=graph_dict + options=options, + components=component_arr, + graph=graph_dict, + flow=ctx.obj.flow, ) else: - mf_card = filtered_card(components=component_arr, graph=graph_dict) + mf_card = filtered_card( + components=component_arr, graph=graph_dict, flow=ctx.obj.flow + ) except TypeError as e: if render_error_card: mf_card = None diff --git a/metaflow/plugins/cards/card_modules/basic.py b/metaflow/plugins/cards/card_modules/basic.py index f3cd4b688d..256375509f 100644 --- a/metaflow/plugins/cards/card_modules/basic.py +++ b/metaflow/plugins/cards/card_modules/basic.py @@ -1,9 +1,10 @@ import base64 import json import os -from .card import MetaflowCard, MetaflowCardComponent +from .card import MetaflowCard, MetaflowCardComponent, with_default_component_id from .convert_to_native_type import TaskToDict import uuid +import inspect ABS_DIR_PATH = os.path.dirname(os.path.abspath(__file__)) RENDER_TEMPLATE_PATH = os.path.join(ABS_DIR_PATH, "base.html") @@ -236,9 +237,28 @@ def __init__(self, data=None): super().__init__(title=None, subtitle=None) self._data = data + @with_default_component_id def render(self): datadict = super().render() datadict["data"] = self._data + if self.component_id is not None: + datadict["id"] = self.component_id + return datadict + + +class PythonCodeComponent(DefaultComponent): + + type = "pythonCode" + + def __init__(self, data=None): + super().__init__(title=None, subtitle=None) + self._data = data + + def render(self): + datadict = super().render() + datadict["data"] = self._data + if self.component_id is not None: + datadict["id"] = self.component_id return datadict @@ -343,6 +363,7 @@ def __init__( graph=None, components=[], runtime=False, + flow=None, ): self._task = task self._only_repr = only_repr @@ -352,6 +373,7 @@ def __init__( self.final_component = None self.page_component = None self.runtime = runtime + self.flow = flow def render(self): """ @@ -475,6 +497,16 @@ def render(self): contents=[param_component], ).render() + step_func = getattr(self.flow, self._task.parent.id) + code_table = SectionComponent( + title="Task Code", + contents=[ + TableComponent( + data=[[PythonCodeComponent(inspect.getsource(step_func)).render()]] + ) + ], + ).render() + # Don't include parameter ids + "name" in the task artifacts artifactlist = [ task_data_dict["data"][k] @@ -500,6 +532,7 @@ def render(self): page_contents.extend( [ metadata_table, + code_table, parameter_table, artifact_section, ] @@ -546,7 +579,7 @@ class ErrorCard(MetaflowCard): RELOAD_POLICY = MetaflowCard.RELOAD_POLICY_ONCHANGE - def __init__(self, options={}, components=[], graph=None): + def __init__(self, options={}, components=[], graph=None, **kwargs): self._only_repr = True self._graph = None if graph is None else transform_flow_graph(graph) self._components = components @@ -602,9 +635,17 @@ class DefaultCardJSON(MetaflowCard): type = "default_json" - def __init__(self, options=dict(only_repr=True), components=[], graph=None): + def __init__( + self, + options=dict(only_repr=True), + components=[], + graph=None, + flow=None, + **kwargs + ): self._only_repr = True self._graph = None if graph is None else transform_flow_graph(graph) + self._flow = flow if "only_repr" in options: self._only_repr = options["only_repr"] self._components = components @@ -615,6 +656,7 @@ def render(self, task): only_repr=self._only_repr, graph=self._graph, components=self._components, + flow=self._flow, ).render() return json.dumps(final_component_dict) @@ -629,9 +671,17 @@ class DefaultCard(MetaflowCard): type = "default" - def __init__(self, options=dict(only_repr=True), components=[], graph=None): + def __init__( + self, + options=dict(only_repr=True), + components=[], + graph=None, + flow=None, + **kwargs + ): self._only_repr = True self._graph = None if graph is None else transform_flow_graph(graph) + self._flow = flow if "only_repr" in options: self._only_repr = options["only_repr"] self._components = components @@ -646,6 +696,7 @@ def render(self, task, runtime=False): graph=self._graph, components=self._components, runtime=runtime, + flow=self._flow, ).render() pt = self._get_mustache() data_dict = dict( @@ -688,7 +739,7 @@ class BlankCard(MetaflowCard): type = "blank" - def __init__(self, options=dict(title=""), components=[], graph=None): + def __init__(self, options=dict(title=""), components=[], graph=None, **kwargs): self._graph = None if graph is None else transform_flow_graph(graph) self._title = "" if "title" in options: diff --git a/metaflow/plugins/cards/card_modules/card.py b/metaflow/plugins/cards/card_modules/card.py index e42e6f47ad..2f9d257e0c 100644 --- a/metaflow/plugins/cards/card_modules/card.py +++ b/metaflow/plugins/cards/card_modules/card.py @@ -1,4 +1,5 @@ from typing import TYPE_CHECKING +import uuid if TYPE_CHECKING: import metaflow @@ -66,7 +67,7 @@ class MetaflowCard(object): # FIXME document runtime_data runtime_data = None - def __init__(self, options={}, components=[], graph=None): + def __init__(self, options={}, components=[], graph=None, flow=None): pass def _get_mustache(self): @@ -140,3 +141,17 @@ def render(self): `render` returns a string or dictionary. This class can be called on the client side to dynamically add components to the `MetaflowCard` """ raise NotImplementedError() + + +def create_component_id(component): + uuid_bit = "".join(uuid.uuid4().hex.split("-"))[:6] + return type(component).__name__.lower() + "_" + uuid_bit + + +def with_default_component_id(func): + def ret_func(self, *args, **kwargs): + if self.component_id is None: + self.component_id = create_component_id(self) + return func(self, *args, **kwargs) + + return ret_func diff --git a/metaflow/plugins/cards/card_modules/components.py b/metaflow/plugins/cards/card_modules/components.py index 9a0b5b3799..65685cc889 100644 --- a/metaflow/plugins/cards/card_modules/components.py +++ b/metaflow/plugins/cards/card_modules/components.py @@ -1,4 +1,4 @@ -from typing import Any, List, Optional, Union +from typing import Any, List, Optional, Union, Callable from .basic import ( LogComponent, ErrorComponent, @@ -7,25 +7,13 @@ ImageComponent, SectionComponent, MarkdownComponent, + PythonCodeComponent, ) -from .card import MetaflowCardComponent +from .card import MetaflowCardComponent, with_default_component_id from .convert_to_native_type import TaskToDict, _full_classname from .renderer_tools import render_safely import uuid - - -def create_component_id(component): - uuid_bit = "".join(uuid.uuid4().hex.split("-"))[:6] - return type(component).__name__.lower() + "_" + uuid_bit - - -def with_default_component_id(func): - def ret_func(self, *args, **kwargs): - if self.component_id is None: - self.component_id = create_component_id(self) - return func(self, *args, **kwargs) - - return ret_func +import inspect def _warning_with_component(component, msg): @@ -823,3 +811,63 @@ def render(self): if self._chart_inside_table and "autosize" not in self._spec: data["spec"]["autosize"] = "fit-x" return data + + +class PythonCode(UserComponent): + """ + A component to display Python code with syntax highlighting. + + Example: + ```python + @card + @step + def my_step(self): + # Using code_func + def my_function(): + x = 1 + y = 2 + return x + y + current.card.append( + PythonCode(my_function) + ) + + # Using code_string + code = ''' + def another_function(): + return "Hello World" + ''' + current.card.append( + PythonCode(code_string=code) + ) + ``` + + Parameters + ---------- + code_func : Callable[..., Any], optional, default None + The function whose source code should be displayed. + code_string : str, optional, default None + A string containing Python code to display. + Either code_func or code_string must be provided. + """ + + def __init__( + self, + code_func: Optional[Callable[..., Any]] = None, + code_string: Optional[str] = None, + ): + if code_func is not None: + self._code_string = inspect.getsource(code_func) + else: + self._code_string = code_string + + @with_default_component_id + @render_safely + def render(self): + if self._code_string is None: + return ErrorComponent( + "`PythonCode` component requires a `code_func` or `code_string` argument. ", + "None provided for both", + ).render() + _code_component = PythonCodeComponent(self._code_string) + _code_component.component_id = self.component_id + return _code_component.render() diff --git a/metaflow/plugins/cards/card_modules/main.js b/metaflow/plugins/cards/card_modules/main.js index f06c7c53ff..8d938d0ac3 100644 --- a/metaflow/plugins/cards/card_modules/main.js +++ b/metaflow/plugins/cards/card_modules/main.js @@ -1,11 +1,11 @@ -(function(re,Ge){typeof exports=="object"&&typeof module<"u"?module.exports=Ge():typeof define=="function"&&define.amd?define(Ge):(re=typeof globalThis<"u"?globalThis:re||self,re["Outerbounds Cards"]=Ge())})(this,function(){"use strict";var Z3e=Object.defineProperty;var K3e=(re,Ge,Gn)=>Ge in re?Z3e(re,Ge,{enumerable:!0,configurable:!0,writable:!0,value:Gn}):re[Ge]=Gn;var Tt=(re,Ge,Gn)=>(K3e(re,typeof Ge!="symbol"?Ge+"":Ge,Gn),Gn),J3e=(re,Ge,Gn)=>{if(!Ge.has(re))throw TypeError("Cannot "+Gn)};var w5=(re,Ge,Gn)=>{if(Ge.has(re))throw TypeError("Cannot add the same private member more than once");Ge instanceof WeakSet?Ge.add(re):Ge.set(re,Gn)};var zm=(re,Ge,Gn)=>(J3e(re,Ge,"access private method"),Gn);var bh,k5,Im,lz,sz,oz;function re(){}function Ge(e,t){for(const n in t)e[n]=t[n];return e}function Gn(e){return e()}function $5(){return Object.create(null)}function Ll(e){e.forEach(Gn)}function E5(e){return typeof e=="function"}function he(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let vh;function xh(e,t){return e===t?!0:(vh||(vh=document.createElement("a")),vh.href=t,e===vh.href)}function uz(e){return Object.keys(e).length===0}function cz(e,...t){if(e==null){for(const i of t)i(void 0);return re}const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function _h(e,t,n){e.$$.on_destroy.push(cz(t,n))}function ct(e,t,n,i){if(e){const r=C5(e,t,n,i);return e[0](r)}}function C5(e,t,n,i){return e[1]&&i?Ge(n.ctx.slice(),e[1](i(t))):n.ctx}function ft(e,t,n,i){if(e[2]&&i){const r=e[2](i(n));if(t.dirty===void 0)return r;if(typeof r=="object"){const s=[],o=Math.max(t.dirty.length,r.length);for(let a=0;a32){const t=[],n=e.ctx.length/32;for(let i=0;ie.removeEventListener(t,n,i)}function D(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}const dz=["width","height"];function A5(e,t){const n=Object.getOwnPropertyDescriptors(e.__proto__);for(const i in t)t[i]==null?e.removeAttribute(i):i==="style"?e.style.cssText=t[i]:i==="__value"?e.value=e[i]=t[i]:n[i]&&n[i].set&&dz.indexOf(i)===-1?e[i]=t[i]:D(e,i,t[i])}function T5(e,t){for(const n in t)D(e,n,t[n])}function hz(e){return Array.from(e.childNodes)}function pt(e,t){t=""+t,e.data!==t&&(e.data=t)}function ci(e,t,n,i){n==null?e.style.removeProperty(t):e.style.setProperty(t,n,i?"important":"")}function Vn(e,t,n){e.classList.toggle(t,!!n)}function pz(e,t,{bubbles:n=!1,cancelable:i=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:i})}class gz{constructor(t=!1){Tt(this,"is_svg",!1);Tt(this,"e");Tt(this,"n");Tt(this,"t");Tt(this,"a");this.is_svg=t,this.e=this.n=null}c(t){this.h(t)}m(t,n,i=null){this.e||(this.is_svg?this.e=Si(n.nodeName):this.e=H(n.nodeType===11?"TEMPLATE":n.nodeName),this.t=n.tagName!=="TEMPLATE"?n:n.content,this.c(t)),this.i(i)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(t){for(let n=0;n{const r=e.$$.callbacks[t];if(r){const s=pz(t,n,{cancelable:i});return r.slice().forEach(o=>{o.call(e,s)}),!s.defaultPrevented}return!0}}function F5(e,t){return Tc().$$.context.set(e,t),t}function D5(e){return Tc().$$.context.get(e)}function N5(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach(i=>i.call(this,t))}const zl=[],Xi=[];let Pl=[];const jm=[],mz=Promise.resolve();let Um=!1;function yz(){Um||(Um=!0,mz.then(O5))}function qm(e){Pl.push(e)}function Wm(e){jm.push(e)}const Hm=new Set;let Bl=0;function O5(){if(Bl!==0)return;const e=Sc;do{try{for(;Ble.indexOf(i)===-1?t.push(i):n.push(i)),n.forEach(i=>i()),Pl=t}const wh=new Set;let la;function $e(){la={r:0,c:[],p:la}}function Ee(){la.r||Ll(la.c),la=la.p}function F(e,t){e&&e.i&&(wh.delete(e),e.i(t))}function N(e,t,n,i){if(e&&e.o){if(wh.has(e))return;wh.add(e),la.c.push(()=>{wh.delete(e),i&&(n&&e.d(1),i())}),e.o(t)}else i&&i()}function Oe(e){return(e==null?void 0:e.length)!==void 0?e:Array.from(e)}function fi(e,t){const n={},i={},r={$$scope:1};let s=e.length;for(;s--;){const o=e[s],a=t[s];if(a){for(const l in o)l in a||(i[l]=1);for(const l in a)r[l]||(n[l]=a[l],r[l]=1);e[s]=a}else for(const l in o)r[l]=1}for(const o in i)o in n||(n[o]=void 0);return n}function Yi(e){return typeof e=="object"&&e!==null?e:{}}function Gm(e,t,n){const i=e.$$.props[t];i!==void 0&&(e.$$.bound[i]=n,n(e.$$.ctx[i]))}function ce(e){e&&e.c()}function le(e,t,n){const{fragment:i,after_update:r}=e.$$;i&&i.m(t,n),qm(()=>{const s=e.$$.on_mount.map(Gn).filter(E5);e.$$.on_destroy?e.$$.on_destroy.push(...s):Ll(s),e.$$.on_mount=[]}),r.forEach(qm)}function ue(e,t){const n=e.$$;n.fragment!==null&&(vz(n.after_update),Ll(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function xz(e,t){e.$$.dirty[0]===-1&&(zl.push(e),yz(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const p=h.length?h[0]:d;return u.ctx&&r(u.ctx[f],u.ctx[f]=p)&&(!u.skip_bound&&u.bound[f]&&u.bound[f](p),c&&xz(e,f)),d}):[],u.update(),c=!0,Ll(u.before_update),u.fragment=i?i(u.ctx):!1,t.target){if(t.hydrate){const f=hz(t.target);u.fragment&&u.fragment.l(f),f.forEach(L)}else u.fragment&&u.fragment.c();t.intro&&F(e.$$.fragment),le(e,t.target,t.anchor),O5()}Ac(l)}class ve{constructor(){Tt(this,"$$");Tt(this,"$$set")}$destroy(){ue(this,1),this.$destroy=re}$on(t,n){if(!E5(n))return re;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const r=i.indexOf(n);r!==-1&&i.splice(r,1)}}$set(t){this.$$set&&!uz(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const _z="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(_z);var wz=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{},Fr=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,i={},r={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function h(p){return p instanceof s?new s(p.type,h(p.content),p.alias):Array.isArray(p)?p.map(h):p.replace(/&/g,"&").replace(/"u")return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(m){var h=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(m.stack)||[])[1];if(h){var p=document.getElementsByTagName("script");for(var g in p)if(p[g].src==h)return p[g]}return null}},isActive:function(h,p,g){for(var m="no-"+p;h;){var y=h.classList;if(y.contains(p))return!0;if(y.contains(m))return!1;h=h.parentElement}return!!g}},languages:{plain:i,plaintext:i,text:i,txt:i,extend:function(h,p){var g=r.util.clone(r.languages[h]);for(var m in p)g[m]=p[m];return g},insertBefore:function(h,p,g,m){var y=(m=m||r.languages)[h],b={};for(var v in y)if(y.hasOwnProperty(v)){if(v==p)for(var x in g)g.hasOwnProperty(x)&&(b[x]=g[x]);g.hasOwnProperty(v)||(b[v]=y[v])}var _=m[h];return m[h]=b,r.languages.DFS(r.languages,function(k,w){w===_&&k!=h&&(this[k]=b)}),b},DFS:function h(p,g,m,y){y=y||{};var b=r.util.objId;for(var v in p)if(p.hasOwnProperty(v)){g.call(p,v,p[v],m||v);var x=p[v],_=r.util.type(x);_!=="Object"||y[b(x)]?_!=="Array"||y[b(x)]||(y[b(x)]=!0,h(x,g,v,y)):(y[b(x)]=!0,h(x,g,null,y))}}},plugins:{},highlightAll:function(h,p){r.highlightAllUnder(document,h,p)},highlightAllUnder:function(h,p,g){var m={callback:g,container:h,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",m),m.elements=Array.prototype.slice.apply(m.container.querySelectorAll(m.selector)),r.hooks.run("before-all-elements-highlight",m);for(var y,b=0;y=m.elements[b++];)r.highlightElement(y,p===!0,m.callback)},highlightElement:function(h,p,g){var m=r.util.getLanguage(h),y=r.languages[m];r.util.setLanguage(h,m);var b=h.parentElement;b&&b.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(b,m);var v={element:h,language:m,grammar:y,code:h.textContent};function x(k){v.highlightedCode=k,r.hooks.run("before-insert",v),v.element.innerHTML=v.highlightedCode,r.hooks.run("after-highlight",v),r.hooks.run("complete",v),g&&g.call(v.element)}if(r.hooks.run("before-sanity-check",v),(b=v.element.parentElement)&&b.nodeName.toLowerCase()==="pre"&&!b.hasAttribute("tabindex")&&b.setAttribute("tabindex","0"),!v.code)return r.hooks.run("complete",v),void(g&&g.call(v.element));if(r.hooks.run("before-highlight",v),v.grammar)if(p&&e.Worker){var _=new Worker(r.filename);_.onmessage=function(k){x(k.data)},_.postMessage(JSON.stringify({language:v.language,code:v.code,immediateClose:!0}))}else x(r.highlight(v.code,v.grammar,v.language));else x(r.util.encode(v.code))},highlight:function(h,p,g){var m={code:h,grammar:p,language:g};return r.hooks.run("before-tokenize",m),m.tokens=r.tokenize(m.code,m.grammar),r.hooks.run("after-tokenize",m),s.stringify(r.util.encode(m.tokens),m.language)},tokenize:function(h,p){var g=p.rest;if(g){for(var m in g)p[m]=g[m];delete p.rest}var y=new a;return l(y,y.head,h),function b(v,x,_,k,w,$){for(var S in _)if(_.hasOwnProperty(S)&&_[S]){var E=_[S];E=Array.isArray(E)?E:[E];for(var A=0;A=$.reach);ne+=W.value.length,W=W.next){var ae=W.value;if(x.length>v.length)return;if(!(ae instanceof s)){var ke,Ie=1;if(T){if(!(ke=o(j,ne,v,M))||ke.index>=v.length)break;var Mr=ke.index,Le=ke.index+ke[0].length,We=ne;for(We+=W.value.length;We<=Mr;)W=W.next,We+=W.value.length;if(We-=W.value.length,ne=We,W.value instanceof s)continue;for(var Wn=W;Wn!==x.tail&&(We$.reach&&($.reach=De);var V=W.prev;se&&(V=l(x,V,se),ne+=se.length),u(x,V,Ie);var qt=new s(S,C?r.tokenize(Vi,C):Vi,O,Vi);if(W=l(x,V,qt),Te&&l(x,W,Te),1$.reach&&($.reach=He.reach)}}}}}}(h,y,p,y.head,0),function(b){for(var v=[],x=b.head.next;x!==b.tail;)v.push(x.value),x=x.next;return v}(y)},hooks:{all:{},add:function(h,p){var g=r.hooks.all;g[h]=g[h]||[],g[h].push(p)},run:function(h,p){var g=r.hooks.all[h];if(g&&g.length)for(var m,y=0;m=g[y++];)m(p)}},Token:s};function s(h,p,g,m){this.type=h,this.content=p,this.alias=g,this.length=0|(m||"").length}function o(h,p,g,m){h.lastIndex=p;var y=h.exec(g);if(y&&m&&y[1]){var b=y[1].length;y.index+=b,y[0]=y[0].slice(b)}return y}function a(){var h={value:null,prev:null,next:null},p={value:null,prev:h,next:null};h.next=p,this.head=h,this.tail=p,this.length=0}function l(h,p,g){var m=p.next,y={value:g,prev:p,next:m};return p.next=y,m.prev=y,h.length++,y}function u(h,p,g){for(var m=p.next,y=0;y"+y.content+""},!e.document)return e.addEventListener&&(r.disableWorkerMessageHandler||e.addEventListener("message",function(h){var p=JSON.parse(h.data),g=p.language,m=p.code,y=p.immediateClose;e.postMessage(r.highlight(m,r.languages[g],g)),y&&e.close()},!1)),r;var c=r.util.currentScript();function f(){r.manual||r.highlightAll()}if(c&&(r.filename=c.src,c.hasAttribute("data-manual")&&(r.manual=!0)),!r.manual){var d=document.readyState;d==="loading"||d==="interactive"&&c&&c.defer?document.addEventListener("DOMContentLoaded",f):window.requestAnimationFrame?window.requestAnimationFrame(f):window.setTimeout(f,16)}return r}(wz);typeof module<"u"&&module.exports&&(module.exports=Fr),typeof global<"u"&&(global.Prism=Fr),Fr.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},Fr.languages.log={string:{pattern:/"(?:[^"\\\r\n]|\\.)*"|'(?![st] | \w)(?:[^'\\\r\n]|\\.)*'/,greedy:!0},exception:{pattern:/(^|[^\w.])[a-z][\w.]*(?:Error|Exception):.*(?:(?:\r\n?|\n)[ \t]*(?:at[ \t].+|\.{3}.*|Caused by:.*))+(?:(?:\r\n?|\n)[ \t]*\.\.\. .*)?/,lookbehind:!0,greedy:!0,alias:["javastacktrace","language-javastacktrace"],inside:Fr.languages.javastacktrace||{keyword:/\bat\b/,function:/[a-z_][\w$]*(?=\()/,punctuation:/[.:()]/}},level:[{pattern:/\b(?:ALERT|CRIT|CRITICAL|EMERG|EMERGENCY|ERR|ERROR|FAILURE|FATAL|SEVERE)\b/,alias:["error","important"]},{pattern:/\b(?:WARN|WARNING|WRN)\b/,alias:["warning","important"]},{pattern:/\b(?:DISPLAY|INF|INFO|NOTICE|STATUS)\b/,alias:["info","keyword"]},{pattern:/\b(?:DBG|DEBUG|FINE)\b/,alias:["debug","keyword"]},{pattern:/\b(?:FINER|FINEST|TRACE|TRC|VERBOSE|VRB)\b/,alias:["trace","comment"]}],property:{pattern:/((?:^|[\]|])[ \t]*)[a-z_](?:[\w-]|\b\/\b)*(?:[. ]\(?\w(?:[\w-]|\b\/\b)*\)?)*:(?=\s)/im,lookbehind:!0},separator:{pattern:/(^|[^-+])-{3,}|={3,}|\*{3,}|- - /m,lookbehind:!0,alias:"comment"},url:/\b(?:file|ftp|https?):\/\/[^\s|,;'"]*[^\s|,;'">.]/,email:{pattern:/(^|\s)[-\w+.]+@[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)+(?=\s)/,lookbehind:!0,alias:"url"},"ip-address":{pattern:/\b(?:\d{1,3}(?:\.\d{1,3}){3})\b/,alias:"constant"},"mac-address":{pattern:/\b[a-f0-9]{2}(?::[a-f0-9]{2}){5}\b/i,alias:"constant"},domain:{pattern:/(^|\s)[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*\.[a-z][a-z0-9-]+(?=\s)/,lookbehind:!0,alias:"constant"},uuid:{pattern:/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/i,alias:"constant"},hash:{pattern:/\b(?:[a-f0-9]{32}){1,2}\b/i,alias:"constant"},"file-path":{pattern:/\b[a-z]:[\\/][^\s|,;:(){}\[\]"']+|(^|[\s:\[\](>|])\.{0,2}\/\w[^\s|,;:(){}\[\]"']*/i,lookbehind:!0,greedy:!0,alias:"string"},date:{pattern:RegExp("\\b\\d{4}[-/]\\d{2}[-/]\\d{2}(?:T(?=\\d{1,2}:)|(?=\\s\\d{1,2}:))|\\b\\d{1,4}[-/ ](?:\\d{1,2}|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)[-/ ]\\d{2,4}T?\\b|\\b(?:(?:Fri|Mon|Sat|Sun|Thu|Tue|Wed)(?:\\s{1,2}(?:Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep))?|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)\\s{1,2}\\d{1,2}\\b","i"),alias:"number"},time:{pattern:/\b\d{1,2}:\d{1,2}:\d{1,2}(?:[.,:]\d+)?(?:\s?[+-]\d{2}:?\d{2}|Z)?\b/,alias:"number"},boolean:/\b(?:false|null|true)\b/i,number:{pattern:/(^|[^.\w])(?:0x[a-f0-9]+|0o[0-7]+|0b[01]+|v?\d[\da-f]*(?:\.\d+)*(?:e[+-]?\d+)?[a-z]{0,3}\b)\b(?!\.\w)/i,lookbehind:!0},operator:/[;:?<=>~/@!$%&+\-|^(){}*#]/,punctuation:/[\[\].,]/},Fr.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Fr.languages.python["string-interpolation"].inside.interpolation.inside.rest=Fr.languages.python,Fr.languages.py=Fr.languages.python;const jl=[];function R5(e,t=re){let n;const i=new Set;function r(a){if(he(e,a)&&(e=a,n)){const l=!jl.length;for(const u of i)u[1](),jl.push(u,e);if(l){for(let u=0;u{i.delete(u),i.size===0&&n&&(n(),n=null)}}return{set:r,update:s,subscribe:o}}const ua=R5(void 0);window.metaflow_card_update=e=>(ua==null||ua.update(t=>{const n={...t};return Object.values(e).forEach(i=>(n==null?void 0:n.components)&&L5(n.components,i)),n}),!0);const kz=(e,t)=>{e.data&&(e.data=JSON.parse(JSON.stringify(t.data))),JSON.stringify(t.spec)===JSON.stringify(e.spec)||(e.spec=JSON.parse(JSON.stringify(t.spec)))},L5=(e,t)=>{const n=e.findIndex(i=>t.id===(i==null?void 0:i.id));n>-1?e[n].type=="vegaChart"?kz(e[n],t):Object.assign(e[n],t):e.forEach(i=>{var r;(i.type==="section"||i.type==="page")&&((r=i==null?void 0:i.contents)!=null&&r.length)&&L5(i.contents,t)})},$z=e=>{try{const t=JSON.parse(atob(window.__MF_DATA__[e]));ua.set(t)}catch{fetch("/card-example.json").then(n=>n.json()).then(n=>{ua.set(n)}).catch(console.error)}},Fc=R5(void 0),I5=e=>{const t={};if(!e)return t;function n(i,r=[]){var s;if(i.type==="page"){const o=[];t[i.title]=o,(s=i==null?void 0:i.contents)==null||s.forEach(a=>n(a,o))}i.type==="section"&&i.title&&r.push(i.title)}return e==null||e.forEach(i=>n(i)),t},eo=(e,t)=>{const n=t?parseFloat(getComputedStyle(document.documentElement).fontSize.replace("px","")):16;return e/n},Ez=e=>{const t=e.split("/");return{flowname:t[0],runid:t[1],stepname:t==null?void 0:t[2],taskid:t==null?void 0:t[3]}},Cz=(e,t)=>{var n;if(!(!e||!t))return(n=Ez(e))==null?void 0:n[t]},Sz=e=>e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth;function Az(e){let t,n,i,r,s,o,a,l;return{c(){t=Si("svg"),n=Si("title"),i=Be("metaflow_logo_horizontal"),r=Si("g"),s=Si("g"),o=Si("g"),a=Si("path"),l=Si("path"),D(a,"d","M223.990273,66.33 C223.515273,61.851 222.686273,57.512 221.505273,53.33 C220.325273,49.148 218.795273,45.122 216.916273,41.271 C212.845273,32.921 207.254273,25.587 200.268273,19.422 C199.270273,18.541 198.243273,17.684 197.189273,16.851 C191.255273,12.166 184.481273,8.355 177.253273,5.55 C174.156273,4.347 170.975273,3.33 167.741273,2.508 C161.273273,0.863 154.593273,0 147.943273,0 C141.755273,0 135.332273,0.576 128.687273,1.722 C127.025273,2.01 125.350273,2.332 123.661273,2.69 C120.283273,3.406 116.851273,4.265 113.365273,5.267 C104.650273,7.769 95.6022727,11.161 86.2442727,15.433 C78.7592727,18.851 71.0762727,22.832 63.2072727,27.373 C47.9762727,36.162 35.7372727,44.969 29.3592727,49.791 C29.0692727,50.01 28.7922727,50.221 28.5262727,50.423 C26.1382727,52.244 24.7522727,53.367 24.5662727,53.519 L0.549272727,73.065 C0.191272727,73.356 0.00727272727,73.773 0,74.194 C-0.00372727273,74.403 0.0362727273,74.614 0.120272727,74.811 C0.205272727,75.008 0.334272727,75.189 0.508272727,75.341 L11.7612727,85.195 C12.1692727,85.552 12.7252727,85.651 13.2162727,85.487 C13.3792727,85.432 13.5362727,85.348 13.6762727,85.234 L35.8492727,67.382 C36.0422727,67.224 37.6152727,65.949 40.3252727,63.903 C44.1192727,61.036 50.1422727,56.656 57.7292727,51.711 C62.0642727,48.884 66.9102727,45.873 72.1412727,42.854 C100.864273,26.278 126.367273,17.874 147.943273,17.874 C148.366273,17.874 148.790273,17.892 149.213273,17.902 C149.655273,17.911 150.096273,17.911 150.538273,17.93 C153.769273,18.068 156.995273,18.463 160.170273,19.097 C164.931273,20.049 169.577273,21.542 173.953273,23.524 C178.328273,25.505 182.433273,27.975 186.112273,30.88 C186.771273,31.4 187.406273,31.94 188.035273,32.485 C188.913273,33.245 189.771273,34.023 190.591273,34.83 C191.998273,36.217 193.317273,37.673 194.548273,39.195 C196.395273,41.479 198.042273,43.912 199.480273,46.485 C199.960273,47.342 200.417273,48.216 200.850273,49.105 C201.112273,49.642 201.343273,50.196 201.587273,50.743 C202.231273,52.185 202.834273,53.649 203.354273,55.158 C203.712273,56.198 204.041273,57.255 204.340273,58.326 C205.836273,63.683 206.590273,69.417 206.590273,75.469 C206.590273,81.221 205.892273,86.677 204.541273,91.804 C203.617273,95.308 202.397273,98.662 200.850273,101.833 C200.417273,102.722 199.960273,103.595 199.480273,104.453 C197.562273,107.884 195.275273,111.066 192.636273,113.976 C190.657273,116.159 188.480273,118.189 186.113273,120.058 C184.553273,121.29 182.909273,122.432 181.208273,123.503 C180.313273,124.067 179.400273,124.609 178.470273,125.126 C177.462273,125.688 176.442273,126.232 175.398273,126.737 C166.961273,130.823 157.423273,133.064 147.943273,133.064 C126.367273,133.064 100.864273,124.659 72.1412727,108.084 C70.5382727,107.159 68.4382727,105.886 66.3072727,104.575 C65.0292727,103.788 63.7402727,102.986 62.5412727,102.237 C59.3442727,100.238 56.7882727,98.61 56.7882727,98.61 C61.8362727,93.901 69.3232727,87.465 78.6472727,81.047 C80.0092727,80.11 81.4192727,79.174 82.8572727,78.243 C84.1052727,77.436 85.3712727,76.63 86.6732727,75.835 C88.2042727,74.9 89.7802727,73.981 91.3822727,73.074 C93.0482727,72.131 94.7512727,71.207 96.4902727,70.307 C111.473273,62.55 129.094273,56.602 147.943273,56.602 C151.750273,56.602 157.745273,57.825 162.114273,61.276 C162.300273,61.422 162.489273,61.578 162.677273,61.74 C163.337273,62.305 164.006273,62.966 164.634273,63.78 C164.957273,64.198 165.269273,64.657 165.564273,65.162 C166.006273,65.92 166.409273,66.782 166.750273,67.775 C166.891273,68.185 167.016273,68.627 167.134273,69.083 C167.586273,70.833 167.863273,72.924 167.863273,75.469 C167.863273,78.552 167.460273,80.974 166.824273,82.92 C166.578273,83.674 166.300273,84.363 165.992273,84.983 C165.855273,85.259 165.711273,85.524 165.564273,85.776 C165.376273,86.099 165.178273,86.396 164.977273,86.682 C164.631273,87.175 164.269273,87.618 163.900273,88.018 C163.730273,88.202 163.559273,88.379 163.387273,88.546 C162.962273,88.96 162.534273,89.331 162.114273,89.662 C157.745273,93.112 151.750273,94.337 147.943273,94.337 C144.485273,94.337 140.682273,93.926 136.589273,93.121 C133.860273,92.584 131.003273,91.871 128.033273,90.987 C123.579273,89.662 118.873273,87.952 113.970273,85.872 C113.768273,85.786 113.552273,85.747 113.336273,85.753 C113.122273,85.76 112.908273,85.813 112.713273,85.912 C106.990273,88.816 101.641273,91.995 96.7462727,95.223 C96.6232727,95.304 96.5182727,95.397 96.4302727,95.5 C95.8122727,96.22 96.0172727,97.397 96.9492727,97.822 L102.445273,100.328 C104.606273,101.314 106.737273,102.238 108.835273,103.102 C110.934273,103.966 113.001273,104.77 115.035273,105.511 C118.086273,106.624 121.064273,107.599 123.965273,108.436 C127.834273,109.551 131.567273,110.421 135.157273,111.043 C139.646273,111.82 143.912273,112.211 147.943273,112.211 C148.367273,112.211 148.923273,112.201 149.591273,112.169 C149.925273,112.153 150.287273,112.131 150.674273,112.102 C155.712273,111.724 165.055273,110.114 173.190273,103.691 C173.547273,103.41 173.869273,103.105 174.210273,102.813 C175.324273,101.86 176.381273,100.866 177.333273,99.8 C177.470273,99.648 177.590273,99.485 177.724273,99.331 C181.300273,95.167 183.699273,90.185 184.875273,84.406 C185.444273,81.609 185.737273,78.631 185.737273,75.469 C185.737273,63.315 181.516273,53.82 173.190273,47.247 C167.050273,42.399 160.228273,40.299 155.083273,39.395 C153.892273,39.186 152.790273,39.037 151.809273,38.938 C150.116273,38.766 148.774273,38.727 147.943273,38.727 C133.456273,38.727 118.519273,41.679 103.545273,47.5 C99.1222727,49.22 94.6912727,51.191 90.2702727,53.403 C88.7972727,54.141 87.3242727,54.905 85.8542727,55.696 C83.5092727,56.957 81.1722727,58.303 78.8382727,59.697 C77.3922727,60.562 75.9492727,61.451 74.5082727,62.366 C72.4422727,63.678 70.3802727,65.023 68.3302727,66.437 C63.8372727,69.535 59.7422727,72.63 56.0902727,75.567 C54.8732727,76.547 53.7052727,77.508 52.5882727,78.446 C48.1222727,82.2 44.4752727,85.581 41.7602727,88.226 C38.3032727,91.593 36.3592727,93.766 36.1632727,93.986 L35.8282727,94.362 L32.0332727,98.61 L30.6432727,100.164 C30.4962727,100.329 30.3932727,100.517 30.3312727,100.715 C30.1482727,101.307 30.3472727,101.981 30.8882727,102.368 L37.2812727,106.938 L37.4862727,107.083 L37.6922727,107.228 C39.8732727,108.766 42.0702727,110.277 44.2792727,111.758 C45.8422727,112.807 47.4102727,113.84 48.9832727,114.858 C51.5302727,116.508 54.0902727,118.103 56.6542727,119.665 C57.8412727,120.388 59.0282727,121.101 60.2162727,121.804 C61.2142727,122.394 62.2102727,122.989 63.2072727,123.565 C76.9772727,131.512 90.1802727,137.744 102.748273,142.242 C104.544273,142.884 106.326273,143.491 108.096273,144.063 C111.635273,145.206 115.121273,146.207 118.553273,147.067 C121.986273,147.925 125.364273,148.642 128.687273,149.215 C135.332273,150.362 141.755273,150.938 147.943273,150.938 C154.593273,150.938 161.273273,150.074 167.741273,148.43 C174.209273,146.786 180.465273,144.361 186.265273,141.238 C190.133273,139.156 193.798273,136.764 197.189273,134.087 C200.352273,131.589 203.264273,128.872 205.911273,125.949 C207.677273,124 209.325273,121.96 210.854273,119.831 C211.618273,118.766 212.353273,117.68 213.057273,116.571 C214.466273,114.356 215.753273,112.053 216.916273,109.667 C220.701273,101.906 223.073273,93.439 224.008273,84.406 C224.310273,81.485 224.465273,78.505 224.465273,75.469 C224.465273,72.364 224.306273,69.316 223.990273,66.33"),D(a,"id","Fill-1"),D(a,"fill","#146EE6"),D(l,"d","M758.389273,75.346 C752.632273,111.56 742.681273,122.23 712.102273,122.23 C710.847273,122.23 709.640273,122.207 708.464273,122.17 C708.321273,122.191 708.191273,122.23 708.028273,122.23 L637.994273,122.23 C636.795273,122.23 636.315273,121.632 636.435273,120.311 L650.585273,31.22 C650.704273,30.016 651.424273,29.417 652.623273,29.417 L667.852273,29.417 C669.050273,29.417 669.530273,30.016 669.410273,31.22 L657.659273,105.802 L714.249273,105.802 L714.249273,105.787 C714.410273,105.794 714.568273,105.802 714.741273,105.802 C718.878273,105.802 722.250273,105.351 725.040273,104.313 C726.434273,103.794 727.684273,103.129 728.810273,102.298 C729.373273,101.884 729.905273,101.426 730.410273,100.927 C734.951273,96.431 737.231273,88.43 739.322273,75.346 C739.328273,75.312 739.331273,75.282 739.337273,75.25 C739.642273,73.311 739.896273,71.474 740.130273,69.679 C740.203273,69.116 740.272273,68.557 740.338273,68.008 C740.412273,67.392 740.461273,66.821 740.525273,66.222 C742.136273,49.927 738.622273,44.525 724.454273,44.525 C723.419273,44.525 722.433273,44.554 721.490273,44.613 C708.297273,45.444 703.831273,52.303 700.461273,71.126 C700.220273,72.472 699.984273,73.877 699.752273,75.346 C699.483273,77.027 699.255273,78.6 699.052273,80.115 C698.993273,80.545 698.948273,80.946 698.895273,81.361 C698.757273,82.465 698.638273,83.528 698.540273,84.544 C698.502273,84.943 698.466273,85.334 698.434273,85.72 C698.344273,86.815 698.281273,87.856 698.246273,88.847 C698.238273,89.049 698.224273,89.269 698.219273,89.469 C698.161273,91.88 698.289273,93.972 698.621273,95.782 C698.649273,95.941 698.686273,96.089 698.717273,96.246 C698.874273,96.992 699.067273,97.689 699.301273,98.337 C699.346273,98.464 699.390273,98.594 699.439273,98.718 C700.039273,100.231 700.864273,101.478 701.963273,102.469 C702.263273,102.738 702.586273,102.987 702.925273,103.22 L679.436273,103.22 C679.393273,102.969 679.343273,102.727 679.305273,102.471 L679.304273,102.471 C679.304273,102.467 679.304273,102.462 679.303273,102.459 C679.259273,102.17 679.236273,101.854 679.198273,101.558 C679.083273,100.634 678.995273,99.671 678.934273,98.674 C678.908273,98.258 678.879273,97.845 678.862273,97.419 C678.816273,96.174 678.804273,94.876 678.832273,93.518 C678.840273,93.114 678.861273,92.69 678.876273,92.276 C678.920273,91.042 678.991273,89.765 679.092273,88.441 C679.117273,88.109 679.134273,87.79 679.162273,87.452 C679.299273,85.836 679.483273,84.137 679.698273,82.382 C679.750273,81.957 679.807273,81.518 679.863273,81.084 C680.104273,79.238 680.369273,77.344 680.687273,75.346 C681.046273,73.067 681.423273,70.889 681.819273,68.808 C687.040273,41.397 695.809273,30.748 717.267273,28.554 C720.250273,28.25 723.472273,28.103 726.971273,28.103 C726.972273,28.103 726.972273,28.103 726.972273,28.103 C747.994273,28.103 757.680273,33.202 759.811273,48.236 C760.779273,55.067 760.187273,63.953 758.389273,75.346 Z M894.023273,31.336 L866.923273,108.56 C863.472273,118.182 861.113273,121.41 854.499273,122.41 C852.379273,122.733 849.831273,122.828 846.659273,122.828 C831.670273,122.828 830.350273,121.267 829.392273,108.56 L825.794273,63.232 L825.794273,63.231 L807.928273,108.56 C804.255273,117.613 802.201273,120.996 795.961273,122.202 C793.442273,122.687 790.260273,122.829 785.985273,122.829 C772.914273,122.829 770.756273,121.267 770.396273,108.56 L767.638273,31.337 C767.638273,29.899 768.238273,29.417 769.557273,29.417 L785.385273,29.417 C786.464273,29.417 786.704273,29.899 786.824273,31.337 L788.895273,100.572 L788.895273,100.571 C789.054273,103.091 789.563273,103.641 791.021273,103.641 C792.939273,103.641 793.419273,103.042 794.618273,100.043 L820.758273,34.576 C821.358273,33.132 822.437273,32.657 823.516273,32.657 L837.665273,32.657 C838.519273,32.657 839.279273,32.977 839.626273,33.817 C839.718273,34.038 839.799273,34.274 839.824273,34.576 L845.220273,100.043 C845.460273,103.042 845.819273,103.641 847.738273,103.641 C849.297273,103.641 849.896273,103.042 850.976273,100.043 L874.838273,31.336 C875.317273,29.898 875.677273,29.417 876.756273,29.417 L892.584273,29.417 C893.903273,29.417 894.383273,29.898 894.023273,31.336 Z M362.708273,31.219 L357.192273,120.311 C357.192273,121.632 356.353273,122.23 355.154273,122.23 L339.926273,122.23 C338.726273,122.23 338.366273,121.632 338.366273,120.311 L342.324273,62.756 L311.986273,117.551 C311.386273,118.749 310.428273,119.348 309.229273,119.348 L297.837273,119.348 C296.758273,119.348 296.038273,118.749 295.560273,117.551 L282.851273,62.767 L282.848273,62.755 L268.339273,120.31 C268.212273,121.009 267.974273,121.492 267.612273,121.807 C267.288273,122.085 266.865273,122.23 266.301273,122.23 L251.073273,122.23 C249.874273,122.23 249.273273,121.632 249.514273,120.31 L272.296273,31.336 C272.537273,30.138 272.897273,29.417 274.095273,29.417 L288.605273,29.417 C291.236273,29.417 292.726273,29.895 293.682273,31.379 C294.120273,32.059 294.457273,32.928 294.720273,34.095 L307.790273,92.489 L339.326273,34.095 C341.485273,30.256 343.043273,29.299 346.880273,29.299 L361.389273,29.299 C362.376273,29.299 362.682273,30.684 362.682273,30.684 C362.682273,30.684 362.708273,31.029 362.708273,31.219 Z M501.706273,31.219 L499.667273,44.049 C499.547273,45.246 498.708273,45.845 497.509273,45.845 L472.448273,45.845 L460.696273,120.31 C460.457273,121.632 459.738273,122.23 458.538273,122.23 L443.309273,122.23 C442.111273,122.23 441.631273,121.632 441.870273,120.31 L453.622273,45.845 L394.820273,45.845 L391.224273,68.507 L391.224273,68.508 L430.555273,68.508 C431.754273,68.508 432.353273,69.106 432.234273,70.31 L430.196273,82.542 C430.076273,83.738 429.236273,84.338 428.038273,84.338 L388.706273,84.338 L385.349273,105.801 L428.397273,105.801 C429.596273,105.801 430.076273,106.4 429.955273,107.597 L427.797273,120.428 C427.676273,121.632 426.958273,122.23 425.759273,122.23 L365.683273,122.23 C364.484273,122.23 364.004273,121.632 364.124273,120.31 L378.273273,31.219 C378.393273,30.015 379.112273,29.417 380.313273,29.417 L500.147273,29.417 C501.346273,29.417 501.826273,30.015 501.706273,31.219 Z M629.471273,70.426 L627.433273,82.659 C627.313273,83.856 626.473273,84.454 625.275273,84.454 L588.223273,84.454 L582.466273,120.311 C582.347273,121.632 581.627273,122.23 580.428273,122.23 L565.200273,122.23 C564.001273,122.23 563.522273,121.632 563.640273,120.311 L577.790273,31.219 C577.910273,30.016 578.629273,29.417 579.828273,29.417 L643.004273,29.417 C644.202273,29.417 644.802273,30.016 644.682273,31.219 L642.644273,44.05 C642.403273,45.247 641.685273,45.846 640.486273,45.846 L594.337273,45.846 L590.741273,68.631 L627.793273,68.631 C628.991273,68.631 629.592273,69.23 629.471273,70.426 Z M388.706273,84.338 L388.712273,84.338 L388.309273,86.876 L388.706273,84.338 Z M510.726273,79.783 L524.396273,48.006 C525.036273,46.466 525.443273,45.589 525.990273,45.096 C526.465273,44.667 527.044273,44.525 527.993273,44.525 C530.391273,44.525 530.391273,45.124 530.751273,48.006 L534.348273,79.783 L510.726273,79.783 Z M542.334273,29.886 C539.756273,28.905 536.043273,28.702 530.511273,28.702 C516.601273,28.702 513.963273,30.016 508.208273,43.087 L474.633273,120.311 C474.154273,121.749 474.513273,122.23 475.832273,122.23 L491.060273,122.23 C492.259273,122.23 492.500273,121.749 493.099273,120.311 L504.011273,95.372 L536.026273,95.372 L539.024273,120.311 C539.144273,121.749 539.144273,122.23 540.344273,122.23 L555.572273,122.23 C556.891273,122.23 557.490273,121.749 557.490273,120.311 L548.617273,43.087 C547.658273,35.042 546.460273,31.458 542.334273,29.886 L542.334273,29.886 Z"),D(l,"id","Fill-2"),D(l,"fill","#333333"),D(o,"id","metaflow_logo_horizontal"),D(o,"transform","translate(92.930727, 93.190000)"),D(s,"id","Metaflow_Logo_Horizontal_TwoColor_Dark_RGB"),D(s,"transform","translate(-92.000000, -93.000000)"),D(r,"id","Page-1"),D(r,"stroke","none"),D(r,"stroke-width","1"),D(r,"fill","none"),D(r,"fill-rule","evenodd"),D(t,"xmlns","http://www.w3.org/2000/svg"),D(t,"xmlns:xlink","http://www.w3.org/1999/xlink"),D(t,"width","896px"),D(t,"height","152px"),D(t,"viewBox","0 0 896 152"),D(t,"version","1.1")},m(u,c){z(u,t,c),X(t,n),X(n,i),X(t,r),X(r,s),X(s,o),X(o,a),X(o,l)},d(u){u&&L(t)}}}function Tz(e){let t,n,i;return{c(){t=Si("svg"),n=Si("path"),i=Si("path"),D(n,"fill-rule","evenodd"),D(n,"clip-rule","evenodd"),D(n,"d","M223.991 66.33C223.516 61.851 222.687 57.512 221.506 53.33C220.326 49.148 218.796 45.122 216.917 41.271C212.846 32.921 207.255 25.587 200.269 19.422C199.271 18.541 198.244 17.684 197.19 16.851C191.256 12.166 184.482 8.355 177.254 5.55C174.157 4.347 170.976 3.33 167.742 2.508C161.274 0.863 154.594 0 147.944 0C141.756 0 135.333 0.576 128.688 1.722C127.026 2.01 125.351 2.332 123.662 2.69C120.284 3.406 116.852 4.265 113.366 5.267C104.651 7.769 95.6025 11.161 86.2445 15.433C78.7595 18.851 71.0765 22.832 63.2075 27.373C47.9765 36.162 35.7375 44.969 29.3595 49.791C29.0695 50.01 28.7925 50.221 28.5265 50.423C26.1385 52.244 24.7525 53.367 24.5665 53.519L0.549511 73.065C0.191511 73.356 0.00751099 73.773 0.000238261 74.194C-0.00348901 74.403 0.036511 74.614 0.120511 74.811C0.205511 75.008 0.334511 75.189 0.508511 75.341L11.7615 85.195C12.1695 85.552 12.7255 85.651 13.2165 85.487C13.3795 85.432 13.5365 85.348 13.6765 85.234L35.8495 67.382C36.0425 67.224 37.6155 65.949 40.3255 63.903C44.1195 61.036 50.1425 56.656 57.7295 51.711C62.0645 48.884 66.9105 45.873 72.1415 42.854C100.865 26.278 126.368 17.874 147.944 17.874C148.367 17.874 148.791 17.892 149.214 17.902C149.656 17.911 150.097 17.911 150.539 17.93C153.77 18.068 156.996 18.463 160.171 19.097C164.932 20.049 169.578 21.542 173.954 23.524C178.329 25.505 182.434 27.975 186.113 30.88C186.772 31.4 187.407 31.94 188.036 32.485C188.914 33.245 189.772 34.023 190.592 34.83C191.999 36.217 193.318 37.673 194.549 39.195C196.396 41.479 198.043 43.912 199.481 46.485C199.961 47.342 200.418 48.216 200.851 49.105C201.113 49.642 201.344 50.196 201.588 50.743C202.232 52.185 202.835 53.649 203.355 55.158C203.713 56.198 204.042 57.255 204.341 58.326C205.837 63.683 206.591 69.417 206.591 75.469C206.591 81.221 205.893 86.677 204.542 91.804C203.618 95.308 202.398 98.662 200.851 101.833C200.418 102.722 199.961 103.595 199.481 104.453C197.563 107.884 195.276 111.066 192.637 113.976C190.658 116.159 188.481 118.189 186.114 120.058C184.554 121.29 182.91 122.432 181.209 123.503C180.314 124.067 179.401 124.609 178.471 125.126C177.463 125.688 176.443 126.232 175.399 126.737C166.962 130.823 157.424 133.064 147.944 133.064C126.368 133.064 100.865 124.659 72.1415 108.084C70.5385 107.159 68.4385 105.886 66.3075 104.575C65.0295 103.788 63.7405 102.986 62.5415 102.237C59.3445 100.238 56.7885 98.61 56.7885 98.61C61.8365 93.901 69.3235 87.465 78.6475 81.047C80.0095 80.11 81.4195 79.174 82.8575 78.243C84.1055 77.436 85.3715 76.63 86.6735 75.835C88.2045 74.9 89.7805 73.981 91.3825 73.074C93.0485 72.131 94.7515 71.207 96.4905 70.307C111.474 62.55 129.095 56.602 147.944 56.602C151.751 56.602 157.746 57.825 162.115 61.276C162.301 61.422 162.49 61.578 162.678 61.74C163.338 62.305 164.007 62.966 164.635 63.78C164.958 64.198 165.27 64.657 165.565 65.162C166.007 65.92 166.41 66.782 166.751 67.775C166.892 68.185 167.017 68.627 167.135 69.083C167.587 70.833 167.864 72.924 167.864 75.469C167.864 78.552 167.461 80.974 166.825 82.92C166.579 83.674 166.301 84.363 165.993 84.983C165.856 85.259 165.712 85.524 165.565 85.776C165.377 86.099 165.179 86.396 164.978 86.682C164.632 87.175 164.27 87.618 163.901 88.018C163.731 88.202 163.56 88.379 163.388 88.546C162.963 88.96 162.535 89.331 162.115 89.662C157.746 93.112 151.751 94.337 147.944 94.337C144.486 94.337 140.683 93.926 136.59 93.121C133.861 92.584 131.004 91.871 128.034 90.987C123.58 89.662 118.874 87.952 113.971 85.872C113.769 85.786 113.553 85.747 113.337 85.753C113.123 85.76 112.909 85.813 112.714 85.912C106.991 88.816 101.642 91.995 96.7465 95.223C96.6235 95.304 96.5185 95.397 96.4305 95.5C95.8125 96.22 96.0175 97.397 96.9495 97.822L102.446 100.328C104.607 101.314 106.738 102.238 108.836 103.102C110.935 103.966 113.002 104.77 115.036 105.511C118.087 106.624 121.065 107.599 123.966 108.436C127.835 109.551 131.568 110.421 135.158 111.043C139.647 111.82 143.913 112.211 147.944 112.211C148.368 112.211 148.924 112.201 149.592 112.169C149.926 112.153 150.288 112.131 150.675 112.102C155.713 111.724 165.056 110.114 173.191 103.691C173.548 103.41 173.87 103.105 174.211 102.813C175.325 101.86 176.382 100.866 177.334 99.8C177.471 99.648 177.591 99.485 177.725 99.331C181.301 95.167 183.7 90.185 184.876 84.406C185.445 81.609 185.738 78.631 185.738 75.469C185.738 63.315 181.517 53.82 173.191 47.247C167.051 42.399 160.229 40.299 155.084 39.395C153.893 39.186 152.791 39.037 151.81 38.938C150.117 38.766 148.775 38.727 147.944 38.727C133.457 38.727 118.52 41.679 103.546 47.5C99.1225 49.22 94.6915 51.191 90.2705 53.403C88.7975 54.141 87.3245 54.905 85.8545 55.696C83.5095 56.957 81.1725 58.303 78.8385 59.697C77.3925 60.562 75.9495 61.451 74.5085 62.366C72.4425 63.678 70.3805 65.023 68.3305 66.437C63.8375 69.535 59.7425 72.63 56.0905 75.567C54.8735 76.547 53.7055 77.508 52.5885 78.446C48.1225 82.2 44.4755 85.581 41.7605 88.226C38.3035 91.593 36.3595 93.766 36.1635 93.986L35.8285 94.362L32.0335 98.61L30.6435 100.164C30.4965 100.329 30.3935 100.517 30.3315 100.715C30.1485 101.307 30.3475 101.981 30.8885 102.368L37.2815 106.938L37.4865 107.083L37.6925 107.228C39.8735 108.766 42.0705 110.277 44.2795 111.758C45.8425 112.807 47.4105 113.84 48.9835 114.858C51.5305 116.508 54.0905 118.103 56.6545 119.665C57.8415 120.388 59.0285 121.101 60.2165 121.804C61.2145 122.394 62.2105 122.989 63.2075 123.565C76.9775 131.512 90.1805 137.744 102.749 142.242C104.545 142.884 106.327 143.491 108.097 144.063C111.636 145.206 115.122 146.207 118.554 147.067C121.987 147.925 125.365 148.642 128.688 149.215C135.333 150.362 141.756 150.938 147.944 150.938C154.594 150.938 161.274 150.074 167.742 148.43C174.21 146.786 180.466 144.361 186.266 141.238C190.134 139.156 193.799 136.764 197.19 134.087C200.353 131.589 203.265 128.872 205.912 125.949C207.678 124 209.326 121.96 210.855 119.831C211.619 118.766 212.354 117.68 213.058 116.571C214.467 114.356 215.754 112.053 216.917 109.667C220.702 101.906 223.074 93.439 224.009 84.406C224.311 81.485 224.466 78.505 224.466 75.469C224.466 72.364 224.307 69.316 223.991 66.33Z"),D(n,"fill","#146EE6"),D(i,"fill-rule","evenodd"),D(i,"clip-rule","evenodd"),D(i,"d","M758.39 75.346C752.633 111.56 742.682 122.23 712.103 122.23C710.848 122.23 709.641 122.207 708.465 122.17C708.322 122.191 708.192 122.23 708.029 122.23H637.995C636.796 122.23 636.316 121.632 636.436 120.311L650.586 31.22C650.705 30.016 651.425 29.417 652.624 29.417H667.853C669.051 29.417 669.531 30.016 669.411 31.22L657.66 105.802H714.25V105.787C714.411 105.794 714.569 105.802 714.742 105.802C718.879 105.802 722.251 105.351 725.041 104.313C726.435 103.794 727.685 103.129 728.811 102.298C729.374 101.884 729.906 101.426 730.411 100.927C734.952 96.431 737.232 88.43 739.323 75.346C739.329 75.312 739.332 75.282 739.338 75.25C739.643 73.311 739.896 71.474 740.13 69.679C740.203 69.116 740.273 68.557 740.339 68.008C740.413 67.392 740.462 66.821 740.526 66.222C742.137 49.927 738.623 44.525 724.455 44.525C723.42 44.525 722.434 44.554 721.491 44.613C708.298 45.444 703.831 52.303 700.461 71.126C700.22 72.472 699.985 73.877 699.753 75.346C699.484 77.027 699.255 78.6 699.052 80.115C698.993 80.545 698.949 80.946 698.896 81.361C698.758 82.465 698.639 83.528 698.541 84.544C698.503 84.943 698.467 85.334 698.435 85.72C698.345 86.815 698.282 87.856 698.247 88.847C698.239 89.049 698.225 89.269 698.22 89.469C698.162 91.88 698.29 93.972 698.622 95.782C698.65 95.941 698.687 96.089 698.718 96.246C698.875 96.992 699.068 97.689 699.302 98.337C699.347 98.464 699.391 98.594 699.44 98.718C700.04 100.231 700.865 101.478 701.964 102.469C702.264 102.738 702.587 102.987 702.926 103.22H679.437C679.394 102.969 679.344 102.727 679.306 102.471H679.305C679.305 102.467 679.305 102.462 679.304 102.459C679.26 102.17 679.237 101.854 679.199 101.558C679.084 100.634 678.996 99.671 678.935 98.674C678.909 98.258 678.879 97.845 678.862 97.419C678.816 96.174 678.805 94.876 678.833 93.518C678.841 93.114 678.862 92.69 678.877 92.276C678.921 91.042 678.992 89.765 679.093 88.441C679.118 88.109 679.135 87.79 679.163 87.452C679.3 85.836 679.484 84.137 679.699 82.382C679.751 81.957 679.808 81.518 679.864 81.084C680.105 79.238 680.37 77.344 680.688 75.346C681.046 73.067 681.424 70.889 681.82 68.808C687.041 41.397 695.81 30.748 717.268 28.554C720.251 28.25 723.472 28.103 726.971 28.103C726.972 28.103 726.973 28.103 726.973 28.103C747.995 28.103 757.681 33.202 759.812 48.236C760.78 55.067 760.188 63.953 758.39 75.346ZM894.023 31.336L866.924 108.56C863.473 118.182 861.114 121.41 854.5 122.41C852.38 122.733 849.832 122.828 846.66 122.828C831.671 122.828 830.351 121.267 829.393 108.56L825.794 63.232V63.231L807.929 108.56C804.256 117.613 802.201 120.996 795.961 122.202C793.442 122.687 790.261 122.829 785.986 122.829C772.915 122.829 770.757 121.267 770.397 108.56L767.638 31.337C767.638 29.899 768.238 29.417 769.557 29.417H785.385C786.464 29.417 786.705 29.899 786.825 31.337L788.896 100.572V100.571C789.055 103.091 789.564 103.641 791.022 103.641C792.94 103.641 793.42 103.042 794.619 100.043L820.759 34.576C821.359 33.132 822.438 32.657 823.517 32.657H837.666C838.52 32.657 839.28 32.977 839.627 33.817C839.719 34.038 839.8 34.274 839.825 34.576L845.221 100.043C845.461 103.042 845.82 103.641 847.739 103.641C849.298 103.641 849.897 103.042 850.977 100.043L874.839 31.336C875.318 29.898 875.678 29.417 876.757 29.417H892.585C893.904 29.417 894.383 29.898 894.023 31.336ZM362.709 31.219L357.193 120.311C357.193 121.632 356.354 122.23 355.155 122.23H339.927C338.727 122.23 338.367 121.632 338.367 120.311L342.325 62.756L311.987 117.551C311.387 118.749 310.429 119.348 309.23 119.348H297.838C296.759 119.348 296.039 118.749 295.561 117.551L282.852 62.767L282.849 62.755L268.34 120.31C268.213 121.009 267.975 121.492 267.613 121.807C267.289 122.085 266.866 122.23 266.302 122.23H251.074C249.875 122.23 249.274 121.632 249.515 120.31L272.297 31.336C272.538 30.138 272.898 29.417 274.096 29.417H288.606C291.237 29.417 292.727 29.895 293.683 31.379C294.121 32.059 294.458 32.928 294.721 34.095L307.791 92.489L339.327 34.095C341.486 30.256 343.044 29.299 346.881 29.299H361.39C362.377 29.299 362.683 30.684 362.683 30.684C362.683 30.684 362.709 31.029 362.709 31.219ZM501.707 31.219L499.668 44.049C499.548 45.246 498.709 45.845 497.51 45.845H472.449L460.697 120.31C460.458 121.632 459.739 122.23 458.539 122.23H443.31C442.112 122.23 441.632 121.632 441.871 120.31L453.623 45.845H394.821L391.225 68.507V68.508H430.556C431.755 68.508 432.354 69.106 432.235 70.31L430.197 82.542C430.077 83.738 429.237 84.338 428.039 84.338H388.707L385.35 105.801H428.398C429.597 105.801 430.077 106.4 429.956 107.597L427.798 120.428C427.677 121.632 426.959 122.23 425.76 122.23H365.684C364.485 122.23 364.005 121.632 364.125 120.31L378.274 31.219C378.394 30.015 379.113 29.417 380.314 29.417H500.148C501.347 29.417 501.827 30.015 501.707 31.219ZM629.471 70.426L627.434 82.659C627.314 83.856 626.474 84.454 625.276 84.454H588.224L582.466 120.311C582.347 121.632 581.628 122.23 580.429 122.23H565.201C564.002 122.23 563.523 121.632 563.641 120.311L577.791 31.219C577.911 30.016 578.629 29.417 579.828 29.417H643.005C644.203 29.417 644.802 30.016 644.682 31.219L642.645 44.05C642.404 45.247 641.686 45.846 640.487 45.846H594.338L590.742 68.631H627.794C628.992 68.631 629.592 69.23 629.471 70.426ZM388.707 84.338H388.713L388.31 86.876L388.707 84.338ZM510.727 79.783L524.397 48.006C525.037 46.466 525.444 45.589 525.991 45.096C526.466 44.667 527.045 44.525 527.994 44.525C530.392 44.525 530.392 45.124 530.752 48.006L534.349 79.783H510.727ZM542.335 29.886C539.757 28.905 536.044 28.702 530.512 28.702C516.602 28.702 513.964 30.016 508.209 43.087L474.634 120.311C474.155 121.749 474.514 122.23 475.833 122.23H491.061C492.26 122.23 492.501 121.749 493.1 120.311L504.012 95.372H536.026L539.025 120.311C539.145 121.749 539.145 122.23 540.345 122.23H555.573C556.892 122.23 557.491 121.749 557.491 120.311L548.617 43.087C547.658 35.042 546.461 31.458 542.335 29.886Z"),D(i,"fill","white"),D(t,"width","895"),D(t,"height","151"),D(t,"viewBox","0 0 895 151"),D(t,"fill","none"),D(t,"xmlns","http://www.w3.org/2000/svg")},m(r,s){z(r,t,s),X(t,n),X(t,i)},d(r){r&&L(t)}}}function Mz(e){let t;function n(s,o){return s[0]?Tz:Az}let i=n(e),r=i(e);return{c(){r.c(),t=Ae()},m(s,o){r.m(s,o),z(s,t,o)},p(s,[o]){i!==(i=n(s))&&(r.d(1),r=i(s),r&&(r.c(),r.m(t.parentNode,t)))},i:re,o:re,d(s){s&&L(t),r.d(s)}}}function Fz(e,t,n){let{light:i=!1}=t;return e.$$set=r=>{"light"in r&&n(0,i=r.light)},[i]}class Dz extends ve{constructor(t){super(),be(this,t,Fz,Mz,he,{light:0})}}function Nz(e){let t,n,i,r,s,o;r=new Dz({});const a=e[1].default,l=ct(a,e,e[0],null);return{c(){t=H("aside"),n=H("div"),i=H("div"),ce(r.$$.fragment),s=je(),l&&l.c(),D(i,"class","logoContainer"),D(t,"class","svelte-1okdv0e")},m(u,c){z(u,t,c),X(t,n),X(n,i),le(r,i,null),X(n,s),l&&l.m(n,null),o=!0},p(u,[c]){l&&l.p&&(!o||c&1)&&dt(l,a,u,u[0],o?ft(a,u[0],c,null):ht(u[0]),null)},i(u){o||(F(r.$$.fragment,u),F(l,u),o=!0)},o(u){N(r.$$.fragment,u),N(l,u),o=!1},d(u){u&&L(t),ue(r),l&&l.d(u)}}}function Oz(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class Rz extends ve{constructor(t){super(),be(this,t,Oz,Nz,he,{})}}function z5(e){let t,n;return{c(){t=H("td"),n=Be(e[0]),D(t,"class","idCell svelte-pt8vzv"),D(t,"data-component","artifact-row")},m(i,r){z(i,t,r),X(t,n)},p(i,r){r&1&&pt(n,i[0])},d(i){i&&L(t)}}}function Lz(e){let t,n,i,r,s=e[1].data+"",o,a,l=e[0]!==null&&z5(e);return{c(){t=H("tr"),l&&l.c(),n=je(),i=H("td"),r=H("code"),o=Be(s),D(r,"class","mono"),D(i,"class","codeCell svelte-pt8vzv"),D(i,"colspan",a=e[0]===null?2:1),D(i,"data-component","artifact-row")},m(u,c){z(u,t,c),l&&l.m(t,null),X(t,n),X(t,i),X(i,r),X(r,o),e[3](r)},p(u,[c]){u[0]!==null?l?l.p(u,c):(l=z5(u),l.c(),l.m(t,n)):l&&(l.d(1),l=null),c&2&&s!==(s=u[1].data+"")&&pt(o,s),c&1&&a!==(a=u[0]===null?2:1)&&D(i,"colspan",a)},i:re,o:re,d(u){u&&L(t),l&&l.d(),e[3](null)}}}function Iz(e,t,n){let{id:i}=t,{artifact:r}=t,s;function o(){var l;s&&!s.classList.contains("language-python")&&typeof window<"u"&&((l=window==null?void 0:window.Prism)==null||l.highlightElement(s))}function a(l){Xi[l?"unshift":"push"](()=>{s=l,n(2,s)})}return e.$$set=l=>{"id"in l&&n(0,i=l.id),"artifact"in l&&n(1,r=l.artifact)},e.$$.update=()=>{e.$$.dirty&4&&s&&o()},[i,r,s,a]}class zz extends ve{constructor(t){super(),be(this,t,Iz,Lz,he,{id:0,artifact:1})}}function P5(e,t,n){const i=e.slice();return i[2]=t[n],i}function B5(e){let t,n;return t=new zz({props:{id:e[2].name,artifact:e[2]}}),{c(){ce(t.$$.fragment)},m(i,r){le(t,i,r),n=!0},p:re,i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){ue(t,i)}}}function Pz(e){let t,n,i,r=Oe(e[0]),s=[];for(let a=0;aN(s[a],1,1,()=>{s[a]=null});return{c(){t=H("div"),n=H("table");for(let a=0;a{if(s.name&&o.name){if(s.name>o.name)return 1;if(s.name{"componentData"in s&&n(1,i=s.componentData)},[r,i]}class j5 extends ve{constructor(t){super(),be(this,t,Bz,Pz,he,{componentData:1})}}function jz(e){let t,n,i;return{c(){t=H("div"),n=je(),i=H("div"),D(t,"class","path topLeft svelte-1hyaq5f"),D(i,"class","path bottomRight svelte-1hyaq5f")},m(r,s){z(r,t,s),z(r,n,s),z(r,i,s)},d(r){r&&(L(t),L(n),L(i))}}}function Uz(e){let t;return{c(){t=H("div"),D(t,"class","path straightLine svelte-1hyaq5f")},m(n,i){z(n,t,i)},d(n){n&&L(t)}}}function qz(e){let t;function n(s,o){return s[5]?Uz:jz}let i=n(e),r=i(e);return{c(){t=H("div"),r.c(),D(t,"class","connectorwrapper svelte-1hyaq5f"),ci(t,"top",e[1]+"rem"),ci(t,"left",e[0]+"rem"),ci(t,"width",e[3]+"rem"),ci(t,"height",e[4]+"rem"),Vn(t,"flip",e[2])},m(s,o){z(s,t,o),r.m(t,null)},p(s,[o]){i!==(i=n(s))&&(r.d(1),r=i(s),r&&(r.c(),r.m(t,null))),o&2&&ci(t,"top",s[1]+"rem"),o&1&&ci(t,"left",s[0]+"rem"),o&8&&ci(t,"width",s[3]+"rem"),o&16&&ci(t,"height",s[4]+"rem"),o&4&&Vn(t,"flip",s[2])},i:re,o:re,d(s){s&&L(t),r.d()}}}const ca=.5;function Wz(e,t,n){let{top:i=0}=t,{left:r=0}=t,{bottom:s=0}=t,{right:o=0}=t,a,l,u,c=!1;return e.$$set=f=>{"top"in f&&n(1,i=f.top),"left"in f&&n(0,r=f.left),"bottom"in f&&n(7,s=f.bottom),"right"in f&&n(6,o=f.right)},e.$$.update=()=>{e.$$.dirty&207&&(n(2,a=o-r<0),n(3,l=Math.abs(o-r)),l<=ca?(n(3,l=ca),n(5,c=!0),n(0,r-=ca/2)):(a?(n(0,r+=ca/2),n(6,o-=ca/2)):(n(0,r-=ca/2),n(6,o+=ca/2)),n(3,l=Math.abs(o-r))),n(4,u=s-i))},[r,i,a,l,u,c,o,s]}class Hz extends ve{constructor(t){super(),be(this,t,Wz,qz,he,{top:1,left:0,bottom:7,right:6})}}function U5(e,t,n){const i=e.slice();return i[4]=t[n],i}function q5(e){let t,n;return t=new Hz({props:{top:eo(e[4].top),left:eo(e[4].left),bottom:eo(e[4].bottom),right:eo(e[4].right)}}),{c(){ce(t.$$.fragment)},m(i,r){le(t,i,r),n=!0},p(i,r){const s={};r&1&&(s.top=eo(i[4].top)),r&1&&(s.left=eo(i[4].left)),r&1&&(s.bottom=eo(i[4].bottom)),r&1&&(s.right=eo(i[4].right)),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){ue(t,i)}}}function Gz(e){let t,n,i=Oe(e[0]),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{"steps"in a&&n(1,i=a.steps),"boxes"in a&&n(2,r=a.boxes),"container"in a&&n(3,s=a.container)},e.$$.update=()=>{if(e.$$.dirty&15){n(0,o=[]);const a=s.getBoundingClientRect(),l=a.top,u=a.left;r&&Object.keys(i).forEach(c=>{var h;const f=i[c],d=r[c].getBoundingClientRect();(h=f.next)==null||h.forEach(p=>{const g=r[p].getBoundingClientRect(),m={top:d.bottom-l,left:d.left-u+d.width/2,bottom:g.top-l,right:g.left-u+g.width/2};n(0,o=[...o,m])})})}},[o,i,r,s]}class Xz extends ve{constructor(t){super(),be(this,t,Vz,Gz,he,{steps:1,boxes:2,container:3})}}const W5="currentStep";function H5(e,t,n){const i=e.slice();return i[16]=t[n],i[18]=n,i}function G5(e){let t,n,i;return{c(){t=H("div"),n=Be("x"),i=Be(e[6]),D(t,"class","levelstoshow svelte-117ceti")},m(r,s){z(r,t,s),X(t,n),X(t,i)},p(r,s){s&64&&pt(i,r[6])},d(r){r&&L(t)}}}function V5(e){let t,n;return{c(){t=H("div"),D(t,"class",n="level rectangle "+e[16]+" svelte-117ceti"),ci(t,"z-index",(e[18]+1)*-1),ci(t,"top",(e[18]+1)*X5+"px"),ci(t,"left",(e[18]+1)*X5+"px")},m(i,r){z(i,t,r)},p(i,r){r&128&&n!==(n="level rectangle "+i[16]+" svelte-117ceti")&&D(t,"class",n)},d(i){i&&L(t)}}}function Yz(e){let t,n,i,r,s,o,a,l,u=e[2].doc+"",c,f,d,h=e[6]&&G5(e),p=Oe(e[7]),g=[];for(let m=0;m1&&(c=new Intl.NumberFormat().format(r.num_possible_tasks)),s=r.num_possible_tasks-1,Object.keys(f).forEach(v=>{const x=Number.parseInt(v);r.num_possible_tasks&&r.num_possible_tasks>x&&n(11,s=f[x])})):s*=Zz,s>0&&(d=new Array(s).fill("")),d=d.map((v,x)=>{if(r.num_possible_tasks){const _=r.num_failed??0,k=r.successful_tasks??0;return(_-1)/r.num_possible_tasks>=(x+1)/d.length?"error":(_+k)/r.num_possible_tasks>=(x+1)/d.length?"success":"running"}return""});const h=D5(W5),p=i===h;r.failed||r.num_failed?l=!0:(r.num_possible_tasks??0)>(r.successful_tasks??0)?u=!0:r.num_possible_tasks&&r.num_possible_tasks===r.successful_tasks&&(a=!0);let g,m=!1;Mc(()=>{n(9,m=Sz(g))});function y(v){Xi[v?"unshift":"push"](()=>{g=v,n(8,g)})}function b(v){Xi[v?"unshift":"push"](()=>{o=v,n(0,o)})}return e.$$set=v=>{"name"in v&&n(1,i=v.name),"step"in v&&n(2,r=v.step),"numLevels"in v&&n(11,s=v.numLevels),"el"in v&&n(0,o=v.el)},[o,i,r,a,l,u,c,d,g,m,p,s,y,b]}let Jz=class extends ve{constructor(t){super(),be(this,t,Kz,Yz,he,{name:1,step:2,numLevels:11,el:0})}};function Y5(e,t,n){const i=e.slice();return i[10]=t[n],i}function Qz(e){let t,n,i,r,s,o;function a(f){e[8](f)}let l={name:e[2],numLevels:e[3],step:e[5]};e[4]!==void 0&&(l.el=e[4]),n=new Jz({props:l}),Xi.push(()=>Gm(n,"el",a));let u=e[7]&&eP(e),c=e[5].box_ends&&tP(e);return{c(){t=H("div"),ce(n.$$.fragment),r=je(),u&&u.c(),s=je(),c&&c.c(),D(t,"class","stepwrapper svelte-18aex7a")},m(f,d){z(f,t,d),le(n,t,null),X(t,r),u&&u.m(t,null),X(t,s),c&&c.m(t,null),o=!0},p(f,d){const h={};d&4&&(h.name=f[2]),d&8&&(h.numLevels=f[3]),!i&&d&16&&(i=!0,h.el=f[4],Wm(()=>i=!1)),n.$set(h),f[7]&&u.p(f,d),f[5].box_ends&&c.p(f,d)},i(f){o||(F(n.$$.fragment,f),F(u),F(c),o=!0)},o(f){N(n.$$.fragment,f),N(u),N(c),o=!1},d(f){f&&L(t),ue(n),u&&u.d(),c&&c.d()}}}function eP(e){let t,n,i,r,s=Oe(e[5].next),o=[];for(let l=0;lN(o[l],1,1,()=>{o[l]=null});return{c(){t=H("div"),n=je(),i=H("div");for(let l=0;l{a&&n(0,o[r]=a,o)});let u=i[r];u||console.warn("step ",r," not found");const c=(u==null?void 0:u.type)==="foreach"?s+1:(u==null?void 0:u.type)==="join"?s-1:s;let f=(h=u==null?void 0:u.next)==null?void 0:h.find(p=>{var g;return((g=i[p])==null?void 0:g.type)!=="join"});function d(p){a=p,n(4,a)}return e.$$set=p=>{"steps"in p&&n(1,i=p.steps),"stepName"in p&&n(2,r=p.stepName),"levels"in p&&n(3,s=p.levels),"boxes"in p&&n(0,o=p.boxes)},[o,i,r,s,a,u,c,f,d]}class Vm extends ve{constructor(t){super(),be(this,t,iP,nP,he,{steps:1,stepName:2,levels:3,boxes:0})}}function rP(e){let t;return{c(){t=H("p"),t.textContent="No start step"},m(n,i){z(n,t,i)},p:re,i:re,o:re,d(n){n&&L(t)}}}function sP(e){let t,n,i;function r(o){e[6](o)}let s={steps:e[3],stepName:"start"};return e[0]!==void 0&&(s.boxes=e[0]),t=new Vm({props:s}),Xi.push(()=>Gm(t,"boxes",r)),{c(){ce(t.$$.fragment)},m(o,a){le(t,o,a),i=!0},p(o,a){const l={};!n&&a&1&&(n=!0,l.boxes=o[0],Wm(()=>n=!1)),t.$set(l)},i(o){i||(F(t.$$.fragment,o),i=!0)},o(o){N(t.$$.fragment,o),i=!1},d(o){ue(t,o)}}}function K5(e){let t,n;return t=new Xz({props:{boxes:e[0],steps:e[3],container:e[1]}}),{c(){ce(t.$$.fragment)},m(i,r){le(t,i,r),n=!0},p(i,r){const s={};r&1&&(s.boxes=i[0]),r&2&&(s.container=i[1]),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){ue(t,i)}}}function oP(e){let t,n,i,r,s=!e[2]&&Object.keys(e[0]).length,o,a,l;const u=[sP,rP],c=[];function f(h,p){var g;return(g=h[3])!=null&&g.start?0:1}n=f(e),i=c[n]=u[n](e);let d=s&&K5(e);return{c(){t=H("div"),i.c(),r=je(),d&&d.c(),ci(t,"position","relative"),ci(t,"line-height","1"),D(t,"data-component","dag")},m(h,p){z(h,t,p),c[n].m(t,null),X(t,r),d&&d.m(t,null),e[7](t),o=!0,a||(l=Il(window,"resize",e[4]),a=!0)},p(h,[p]){i.p(h,p),p&5&&(s=!h[2]&&Object.keys(h[0]).length),s?d?(d.p(h,p),p&5&&F(d,1)):(d=K5(h),d.c(),F(d,1),d.m(t,null)):d&&($e(),N(d,1,1,()=>{d=null}),Ee())},i(h){o||(F(i),F(d),o=!0)},o(h){N(i),N(d),o=!1},d(h){h&&L(t),c[n].d(),d&&d.d(),e[7](null),a=!1,l()}}}const aP=100;function lP(e,t,n){var h;let i;_h(e,ua,p=>n(9,i=p));let{componentData:r}=t;const{data:s}=r;let o={},a;F5(W5,Cz((h=i==null?void 0:i.metadata)==null?void 0:h.pathspec,"stepname"));let l,u=!1;const c=()=>{n(2,u=!0),clearTimeout(l),l=setTimeout(()=>{n(2,u=!1)},aP)};function f(p){o=p,n(0,o)}function d(p){Xi[p?"unshift":"push"](()=>{a=p,n(1,a)})}return e.$$set=p=>{"componentData"in p&&n(5,r=p.componentData)},[o,a,u,s,c,r,f,d]}class J5 extends ve{constructor(t){super(),be(this,t,lP,oP,he,{componentData:5})}}function uP(e){var r;let t,n=(((r=e[0])==null?void 0:r.text)||"")+"",i;return{c(){t=H("h2"),i=Be(n),D(t,"class","title svelte-117s0ws"),D(t,"data-component","title")},m(s,o){z(s,t,o),X(t,i)},p(s,[o]){var a;o&1&&n!==(n=(((a=s[0])==null?void 0:a.text)||"")+"")&&pt(i,n)},i:re,o:re,d(s){s&&L(t)}}}function cP(e,t,n){let{componentData:i}=t;return e.$$set=r=>{"componentData"in r&&n(0,i=r.componentData)},[i]}class Q5 extends ve{constructor(t){super(),be(this,t,cP,uP,he,{componentData:0})}}function fP(e){var r;let t,n=(((r=e[0])==null?void 0:r.text)||"")+"",i;return{c(){t=H("p"),i=Be(n),D(t,"class","subtitle svelte-lu9pnn"),D(t,"data-component","subtitle")},m(s,o){z(s,t,o),X(t,i)},p(s,[o]){var a;o&1&&n!==(n=(((a=s[0])==null?void 0:a.text)||"")+"")&&pt(i,n)},i:re,o:re,d(s){s&&L(t)}}}function dP(e,t,n){let{componentData:i}=t;return e.$$set=r=>{"componentData"in r&&n(0,i=r.componentData)},[i]}class e6 extends ve{constructor(t){super(),be(this,t,dP,fP,he,{componentData:0})}}function t6(e){let t,n;return t=new Q5({props:{componentData:{type:"title",text:e[1]}}}),{c(){ce(t.$$.fragment)},m(i,r){le(t,i,r),n=!0},p(i,r){const s={};r&2&&(s.componentData={type:"title",text:i[1]}),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){ue(t,i)}}}function n6(e){let t,n;return t=new e6({props:{componentData:{type:"subtitle",text:e[0]}}}),{c(){ce(t.$$.fragment)},m(i,r){le(t,i,r),n=!0},p(i,r){const s={};r&1&&(s.componentData={type:"subtitle",text:i[0]}),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){ue(t,i)}}}function hP(e){let t,n,i,r=e[1]&&t6(e),s=e[0]&&n6(e);return{c(){t=H("header"),r&&r.c(),n=je(),s&&s.c(),D(t,"class","container svelte-1ugmt5d"),D(t,"data-component","heading")},m(o,a){z(o,t,a),r&&r.m(t,null),X(t,n),s&&s.m(t,null),i=!0},p(o,[a]){o[1]?r?(r.p(o,a),a&2&&F(r,1)):(r=t6(o),r.c(),F(r,1),r.m(t,n)):r&&($e(),N(r,1,1,()=>{r=null}),Ee()),o[0]?s?(s.p(o,a),a&1&&F(s,1)):(s=n6(o),s.c(),F(s,1),s.m(t,null)):s&&($e(),N(s,1,1,()=>{s=null}),Ee())},i(o){i||(F(r),F(s),i=!0)},o(o){N(r),N(s),i=!1},d(o){o&&L(t),r&&r.d(),s&&s.d()}}}function pP(e,t,n){let i,r,{componentData:s}=t;return e.$$set=o=>{"componentData"in o&&n(2,s=o.componentData)},e.$$.update=()=>{e.$$.dirty&4&&n(1,{title:i,subtitle:r}=s,i,(n(0,r),n(2,s)))},[r,i,s]}let i6=class extends ve{constructor(t){super(),be(this,t,pP,hP,he,{componentData:2})}};function r6(e){let t,n;return{c(){t=H("div"),n=Be(e[2]),D(t,"class","label svelte-1x96yvr")},m(i,r){z(i,t,r),X(t,n)},p(i,r){r&4&&pt(n,i[2])},d(i){i&&L(t)}}}function s6(e){let t,n;return{c(){t=H("figcaption"),n=Be(e[1]),D(t,"class","description svelte-1x96yvr")},m(i,r){z(i,t,r),X(t,n)},p(i,r){r&2&&pt(n,i[1])},d(i){i&&L(t)}}}function gP(e){let t,n,i,r,s,o,a,l,u,c=e[2]&&r6(e),f=e[1]&&s6(e);return{c(){t=H("figure"),n=H("div"),i=H("img"),o=je(),c&&c.c(),a=je(),f&&f.c(),xh(i.src,r=e[3])||D(i,"src",r),D(i,"alt",s=e[2]||"image"),D(i,"class","svelte-1x96yvr"),D(n,"class","imageContainer"),D(t,"data-component","image"),D(t,"class","svelte-1x96yvr")},m(d,h){z(d,t,h),X(t,n),X(n,i),X(t,o),c&&c.m(t,null),X(t,a),f&&f.m(t,null),l||(u=Il(t,"click",e[4]),l=!0)},p(d,[h]){h&8&&!xh(i.src,r=d[3])&&D(i,"src",r),h&4&&s!==(s=d[2]||"image")&&D(i,"alt",s),d[2]?c?c.p(d,h):(c=r6(d),c.c(),c.m(t,a)):c&&(c.d(1),c=null),d[1]?f?f.p(d,h):(f=s6(d),f.c(),f.m(t,null)):f&&(f.d(1),f=null)},i:re,o:re,d(d){d&&L(t),c&&c.d(),f&&f.d(),l=!1,u()}}}function mP(e,t,n){let i,r,s,{componentData:o}=t;const a=()=>Fc.set(o);return e.$$set=l=>{"componentData"in l&&n(0,o=l.componentData)},e.$$.update=()=>{e.$$.dirty&1&&n(3,{src:i,label:r,description:s}=o,i,(n(2,r),n(0,o)),(n(1,s),n(0,o)))},[o,s,r,i,a]}let o6=class extends ve{constructor(t){super(),be(this,t,mP,gP,he,{componentData:0})}};function yP(e){let t,n,i,r,s=e[0].data+"",o,a,l;return{c(){t=H("pre"),n=Be(` - `),i=H("code"),r=Be(` - `),o=Be(s),a=Be(` - `),l=Be(` -`),D(i,"class","mono language-log"),D(t,"class","log svelte-1jhmsu"),D(t,"data-component","log")},m(u,c){z(u,t,c),X(t,n),X(t,i),X(i,r),X(i,o),X(i,a),e[2](i),X(t,l)},p(u,[c]){c&1&&s!==(s=u[0].data+"")&&pt(o,s)},i:re,o:re,d(u){u&&L(t),e[2](null)}}}function bP(e,t,n){let{componentData:i}=t,r;function s(){var a;r&&((a=window==null?void 0:window.Prism)==null||a.highlightElement(r))}function o(a){Xi[a?"unshift":"push"](()=>{r=a,n(1,r)})}return e.$$set=a=>{"componentData"in a&&n(0,i=a.componentData)},e.$$.update=()=>{e.$$.dirty&2&&r&&s()},[i,r,o]}let a6=class extends ve{constructor(t){super(),be(this,t,bP,yP,he,{componentData:0})}};function vP(){const e=console.warn;console.warn=t=>{t.includes("unknown prop")||t.includes("unexpected slot")||e(t)},Mc(()=>{console.warn=e})}function l6(e,t,n){const i=e.slice();return i[18]=t[n],i}function u6(e,t,n){const i=e.slice();return i[18]=t[n],i}function c6(e,t,n){const i=e.slice();return i[10]=t[n],i}function f6(e,t,n){const i=e.slice();return i[13]=t[n],i[15]=n,i}function d6(e,t,n){const i=e.slice();return i[16]=t[n],i[15]=n,i}function h6(e,t,n){const i=e.slice();return i[7]=t[n],i}function xP(e){let t,n,i,r;const s=[$P,kP,wP],o=[];function a(l,u){return l[0]==="table"?0:l[0]==="list"?1:2}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Ae()},m(l,u){o[t].m(l,u),z(l,i,u),r=!0},p(l,u){let c=t;t=a(l),t===c?o[t].p(l,u):($e(),N(o[c],1,1,()=>{o[c]=null}),Ee(),n=o[t],n?n.p(l,u):(n=o[t]=s[t](l),n.c()),F(n,1),n.m(i.parentNode,i))},i(l){r||(F(n),r=!0)},o(l){N(n),r=!1},d(l){l&&L(i),o[t].d(l)}}}function _P(e){let t,n,i=Oe(e[1]),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{ue(u,1)}),Ee()}s?(t=Ye(s,o(a,l)),ce(t.$$.fragment),F(t.$$.fragment,1),le(t,n.parentNode,n)):t=null}else if(s){const u=l&64?fi(r,[Yi(a[6])]):{};l&8388706&&(u.$$scope={dirty:l,ctx:a}),t.$set(u)}},i(a){i||(t&&F(t.$$.fragment,a),i=!0)},o(a){t&&N(t.$$.fragment,a),i=!1},d(a){a&&L(n),t&&ue(t,a)}}}function kP(e){let t,n,i,r;const s=[TP,AP],o=[];function a(l,u){return l[4]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Ae()},m(l,u){o[t].m(l,u),z(l,i,u),r=!0},p(l,u){let c=t;t=a(l),t===c?o[t].p(l,u):($e(),N(o[c],1,1,()=>{o[c]=null}),Ee(),n=o[t],n?n.p(l,u):(n=o[t]=s[t](l),n.c()),F(n,1),n.m(i.parentNode,i))},i(l){r||(F(n),r=!0)},o(l){N(n),r=!1},d(l){l&&L(i),o[t].d(l)}}}function $P(e){let t,n,i;var r=e[5].table;function s(o,a){return{props:{$$slots:{default:[BP]},$$scope:{ctx:o}}}}return r&&(t=Ye(r,s(e))),{c(){t&&ce(t.$$.fragment),n=Ae()},m(o,a){t&&le(t,o,a),z(o,n,a),i=!0},p(o,a){if(a&32&&r!==(r=o[5].table)){if(t){$e();const l=t;N(l.$$.fragment,1,0,()=>{ue(l,1)}),Ee()}r?(t=Ye(r,s(o)),ce(t.$$.fragment),F(t.$$.fragment,1),le(t,n.parentNode,n)):t=null}else if(r){const l={};a&8388716&&(l.$$scope={dirty:a,ctx:o}),t.$set(l)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&ue(t,o)}}}function EP(e){let t=e[6].raw+"",n;return{c(){n=Be(t)},m(i,r){z(i,n,r)},p(i,r){r&64&&t!==(t=i[6].raw+"")&&pt(n,t)},i:re,o:re,d(i){i&&L(n)}}}function CP(e){let t,n;return t=new fa({props:{tokens:e[1],renderers:e[5]}}),{c(){ce(t.$$.fragment)},m(i,r){le(t,i,r),n=!0},p(i,r){const s={};r&2&&(s.tokens=i[1]),r&32&&(s.renderers=i[5]),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){ue(t,i)}}}function SP(e){let t,n,i,r;const s=[CP,EP],o=[];function a(l,u){return l[1]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Ae()},m(l,u){o[t].m(l,u),z(l,i,u),r=!0},p(l,u){let c=t;t=a(l),t===c?o[t].p(l,u):($e(),N(o[c],1,1,()=>{o[c]=null}),Ee(),n=o[t],n?n.p(l,u):(n=o[t]=s[t](l),n.c()),F(n,1),n.m(i.parentNode,i))},i(l){r||(F(n),r=!0)},o(l){N(n),r=!1},d(l){l&&L(i),o[t].d(l)}}}function AP(e){let t,n,i;const r=[{ordered:e[4]},e[6]];var s=e[5].list;function o(a,l){let u={$$slots:{default:[FP]},$$scope:{ctx:a}};if(l!==void 0&&l&80)u=fi(r,[l&16&&{ordered:a[4]},l&64&&Yi(a[6])]);else for(let c=0;c{ue(u,1)}),Ee()}s?(t=Ye(s,o(a,l)),ce(t.$$.fragment),F(t.$$.fragment,1),le(t,n.parentNode,n)):t=null}else if(s){const u=l&80?fi(r,[l&16&&{ordered:a[4]},l&64&&Yi(a[6])]):{};l&8388704&&(u.$$scope={dirty:l,ctx:a}),t.$set(u)}},i(a){i||(t&&F(t.$$.fragment,a),i=!0)},o(a){t&&N(t.$$.fragment,a),i=!1},d(a){a&&L(n),t&&ue(t,a)}}}function TP(e){let t,n,i;const r=[{ordered:e[4]},e[6]];var s=e[5].list;function o(a,l){let u={$$slots:{default:[NP]},$$scope:{ctx:a}};if(l!==void 0&&l&80)u=fi(r,[l&16&&{ordered:a[4]},l&64&&Yi(a[6])]);else for(let c=0;c{ue(u,1)}),Ee()}s?(t=Ye(s,o(a,l)),ce(t.$$.fragment),F(t.$$.fragment,1),le(t,n.parentNode,n)):t=null}else if(s){const u=l&80?fi(r,[l&16&&{ordered:a[4]},l&64&&Yi(a[6])]):{};l&8388704&&(u.$$scope={dirty:l,ctx:a}),t.$set(u)}},i(a){i||(t&&F(t.$$.fragment,a),i=!0)},o(a){t&&N(t.$$.fragment,a),i=!1},d(a){a&&L(n),t&&ue(t,a)}}}function MP(e){let t,n,i;return t=new fa({props:{tokens:e[18].tokens,renderers:e[5]}}),{c(){ce(t.$$.fragment),n=je()},m(r,s){le(t,r,s),z(r,n,s),i=!0},p(r,s){const o={};s&64&&(o.tokens=r[18].tokens),s&32&&(o.renderers=r[5]),t.$set(o)},i(r){i||(F(t.$$.fragment,r),i=!0)},o(r){N(t.$$.fragment,r),i=!1},d(r){r&&L(n),ue(t,r)}}}function p6(e){let t,n,i;const r=[e[18]];var s=e[5].unorderedlistitem||e[5].listitem;function o(a,l){let u={$$slots:{default:[MP]},$$scope:{ctx:a}};if(l!==void 0&&l&64)u=fi(r,[Yi(a[18])]);else for(let c=0;c{ue(u,1)}),Ee()}s?(t=Ye(s,o(a,l)),ce(t.$$.fragment),F(t.$$.fragment,1),le(t,n.parentNode,n)):t=null}else if(s){const u=l&64?fi(r,[Yi(a[18])]):{};l&8388704&&(u.$$scope={dirty:l,ctx:a}),t.$set(u)}},i(a){i||(t&&F(t.$$.fragment,a),i=!0)},o(a){t&&N(t.$$.fragment,a),i=!1},d(a){a&&L(n),t&&ue(t,a)}}}function FP(e){let t,n,i=Oe(e[6].items),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{ue(u,1)}),Ee()}s?(t=Ye(s,o(a,l)),ce(t.$$.fragment),F(t.$$.fragment,1),le(t,n.parentNode,n)):t=null}else if(s){const u=l&64?fi(r,[Yi(a[18])]):{};l&8388704&&(u.$$scope={dirty:l,ctx:a}),t.$set(u)}},i(a){i||(t&&F(t.$$.fragment,a),i=!0)},o(a){t&&N(t.$$.fragment,a),i=!1},d(a){a&&L(n),t&&ue(t,a)}}}function NP(e){let t,n,i=Oe(e[6].items),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{ue(l,1)}),Ee()}r?(t=Ye(r,s(o)),ce(t.$$.fragment),F(t.$$.fragment,1),le(t,n.parentNode,n)):t=null}else if(r){const l={};a&64&&(l.align=o[6].align[o[15]]||"center"),a&8388644&&(l.$$scope={dirty:a,ctx:o}),t.$set(l)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&ue(t,o)}}}function RP(e){let t,n,i=Oe(e[2]),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{ue(l,1)}),Ee()}r?(t=Ye(r,s(o)),ce(t.$$.fragment),F(t.$$.fragment,1),le(t,n.parentNode,n)):t=null}else if(r){const l={};a&8388708&&(l.$$scope={dirty:a,ctx:o}),t.$set(l)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&ue(t,o)}}}function IP(e){let t,n;return t=new fa({props:{tokens:e[13].tokens,renderers:e[5]}}),{c(){ce(t.$$.fragment)},m(i,r){le(t,i,r),n=!0},p(i,r){const s={};r&8&&(s.tokens=i[13].tokens),r&32&&(s.renderers=i[5]),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){ue(t,i)}}}function y6(e){let t,n,i;var r=e[5].tablecell;function s(o,a){return{props:{header:!1,align:o[6].align[o[15]]||"center",$$slots:{default:[IP]},$$scope:{ctx:o}}}}return r&&(t=Ye(r,s(e))),{c(){t&&ce(t.$$.fragment),n=Ae()},m(o,a){t&&le(t,o,a),z(o,n,a),i=!0},p(o,a){if(a&32&&r!==(r=o[5].tablecell)){if(t){$e();const l=t;N(l.$$.fragment,1,0,()=>{ue(l,1)}),Ee()}r?(t=Ye(r,s(o)),ce(t.$$.fragment),F(t.$$.fragment,1),le(t,n.parentNode,n)):t=null}else if(r){const l={};a&64&&(l.align=o[6].align[o[15]]||"center"),a&8388648&&(l.$$scope={dirty:a,ctx:o}),t.$set(l)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&ue(t,o)}}}function zP(e){let t,n,i=Oe(e[10]),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{ue(l,1)}),Ee()}r?(t=Ye(r,s(o)),ce(t.$$.fragment),F(t.$$.fragment,1),le(t,n.parentNode,n)):t=null}else if(r){const l={};a&8388712&&(l.$$scope={dirty:a,ctx:o}),t.$set(l)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&ue(t,o)}}}function PP(e){let t,n,i=Oe(e[3]),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{ue(d,1)}),Ee()}o?(t=Ye(o,a(c)),ce(t.$$.fragment),F(t.$$.fragment,1),le(t,n.parentNode,n)):t=null}else if(o){const d={};f&8388708&&(d.$$scope={dirty:f,ctx:c}),t.$set(d)}if(f&32&&l!==(l=c[5].tablebody)){if(i){$e();const d=i;N(d.$$.fragment,1,0,()=>{ue(d,1)}),Ee()}l?(i=Ye(l,u(c)),ce(i.$$.fragment),F(i.$$.fragment,1),le(i,r.parentNode,r)):i=null}else if(l){const d={};f&8388712&&(d.$$scope={dirty:f,ctx:c}),i.$set(d)}},i(c){s||(t&&F(t.$$.fragment,c),i&&F(i.$$.fragment,c),s=!0)},o(c){t&&N(t.$$.fragment,c),i&&N(i.$$.fragment,c),s=!1},d(c){c&&(L(n),L(r)),t&&ue(t,c),i&&ue(i,c)}}}function v6(e){let t,n;const i=[e[7],{renderers:e[5]}];let r={};for(let s=0;s{o[c]=null}),Ee()),~t?(n=o[t],n?n.p(l,u):(n=o[t]=s[t](l),n.c()),F(n,1),n.m(i.parentNode,i)):n=null)},i(l){r||(F(n),r=!0)},o(l){N(n),r=!1},d(l){l&&L(i),~t&&o[t].d(l)}}}function UP(e,t,n){const i=["type","tokens","header","rows","ordered","renderers"];let r=S5(t,i),{type:s=void 0}=t,{tokens:o=void 0}=t,{header:a=void 0}=t,{rows:l=void 0}=t,{ordered:u=!1}=t,{renderers:c}=t;return vP(),e.$$set=f=>{t=Ge(Ge({},t),Pm(f)),n(6,r=S5(t,i)),"type"in f&&n(0,s=f.type),"tokens"in f&&n(1,o=f.tokens),"header"in f&&n(2,a=f.header),"rows"in f&&n(3,l=f.rows),"ordered"in f&&n(4,u=f.ordered),"renderers"in f&&n(5,c=f.renderers)},[s,o,a,l,u,c,r]}let fa=class extends ve{constructor(t){super(),be(this,t,UP,jP,he,{type:0,tokens:1,header:2,rows:3,ordered:4,renderers:5})}};function Xm(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let to=Xm();function x6(e){to=e}const _6=/[&<>"']/,qP=new RegExp(_6.source,"g"),w6=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,WP=new RegExp(w6.source,"g"),HP={"&":"&","<":"<",">":">",'"':""","'":"'"},k6=e=>HP[e];function cn(e,t){if(t){if(_6.test(e))return e.replace(qP,k6)}else if(w6.test(e))return e.replace(WP,k6);return e}const GP=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function $6(e){return e.replace(GP,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const VP=/(^|[^\[])\^/g;function tt(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(i,r)=>(r=r.source||r,r=r.replace(VP,"$1"),e=e.replace(i,r),n),getRegex:()=>new RegExp(e,t)};return n}const XP=/[^\w:]/g,YP=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function E6(e,t,n){if(e){let i;try{i=decodeURIComponent($6(n)).replace(XP,"").toLowerCase()}catch{return null}if(i.indexOf("javascript:")===0||i.indexOf("vbscript:")===0||i.indexOf("data:")===0)return null}t&&!YP.test(n)&&(n=QP(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const kh={},ZP=/^[^:]+:\/*[^/]*$/,KP=/^([^:]+:)[\s\S]*$/,JP=/^([^:]+:\/*[^/]*)[\s\S]*$/;function QP(e,t){kh[" "+e]||(ZP.test(e)?kh[" "+e]=e+"/":kh[" "+e]=Eh(e,"/",!0)),e=kh[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(KP,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(JP,"$1")+t:e+t}const $h={exec:function(){}};function C6(e,t){const n=e.replace(/\|/g,(s,o,a)=>{let l=!1,u=o;for(;--u>=0&&a[u]==="\\";)l=!l;return l?"|":" |"}),i=n.split(/ \|/);let r=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),i.length>t)i.splice(t);else for(;i.lengthGe in ie?Q3e(ie,Ge,{enumerable:!0,configurable:!0,writable:!0,value:Gn}):ie[Ge]=Gn;var Tt=(ie,Ge,Gn)=>(eve(ie,typeof Ge!="symbol"?Ge+"":Ge,Gn),Gn),tve=(ie,Ge,Gn)=>{if(!Ge.has(ie))throw TypeError("Cannot "+Gn)};var w5=(ie,Ge,Gn)=>{if(Ge.has(ie))throw TypeError("Cannot add the same private member more than once");Ge instanceof WeakSet?Ge.add(ie):Ge.set(ie,Gn)};var zm=(ie,Ge,Gn)=>(tve(ie,Ge,"access private method"),Gn);var bh,k5,Im,uz,oz,az;function ie(){}function Ge(e,t){for(const n in t)e[n]=t[n];return e}function Gn(e){return e()}function $5(){return Object.create(null)}function Ll(e){e.forEach(Gn)}function E5(e){return typeof e=="function"}function he(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let vh;function xh(e,t){return e===t?!0:(vh||(vh=document.createElement("a")),vh.href=t,e===vh.href)}function cz(e){return Object.keys(e).length===0}function fz(e,...t){if(e==null){for(const i of t)i(void 0);return ie}const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function _h(e,t,n){e.$$.on_destroy.push(fz(t,n))}function ft(e,t,n,i){if(e){const r=C5(e,t,n,i);return e[0](r)}}function C5(e,t,n,i){return e[1]&&i?Ge(n.ctx.slice(),e[1](i(t))):n.ctx}function dt(e,t,n,i){if(e[2]&&i){const r=e[2](i(n));if(t.dirty===void 0)return r;if(typeof r=="object"){const s=[],o=Math.max(t.dirty.length,r.length);for(let a=0;a32){const t=[],n=e.ctx.length/32;for(let i=0;ie.removeEventListener(t,n,i)}function D(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}const hz=["width","height"];function A5(e,t){const n=Object.getOwnPropertyDescriptors(e.__proto__);for(const i in t)t[i]==null?e.removeAttribute(i):i==="style"?e.style.cssText=t[i]:i==="__value"?e.value=e[i]=t[i]:n[i]&&n[i].set&&hz.indexOf(i)===-1?e[i]=t[i]:D(e,i,t[i])}function T5(e,t){for(const n in t)D(e,n,t[n])}function pz(e){return Array.from(e.childNodes)}function at(e,t){t=""+t,e.data!==t&&(e.data=t)}function ci(e,t,n,i){n==null?e.style.removeProperty(t):e.style.setProperty(t,n,i?"important":"")}function Vn(e,t,n){e.classList.toggle(t,!!n)}function gz(e,t,{bubbles:n=!1,cancelable:i=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:i})}class mz{constructor(t=!1){Tt(this,"is_svg",!1);Tt(this,"e");Tt(this,"n");Tt(this,"t");Tt(this,"a");this.is_svg=t,this.e=this.n=null}c(t){this.h(t)}m(t,n,i=null){this.e||(this.is_svg?this.e=Si(n.nodeName):this.e=H(n.nodeType===11?"TEMPLATE":n.nodeName),this.t=n.tagName!=="TEMPLATE"?n:n.content,this.c(t)),this.i(i)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(t){for(let n=0;n{const r=e.$$.callbacks[t];if(r){const s=gz(t,n,{cancelable:i});return r.slice().forEach(o=>{o.call(e,s)}),!s.defaultPrevented}return!0}}function F5(e,t){return Tc().$$.context.set(e,t),t}function D5(e){return Tc().$$.context.get(e)}function N5(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach(i=>i.call(this,t))}const zl=[],Ai=[];let Pl=[];const jm=[],yz=Promise.resolve();let Um=!1;function bz(){Um||(Um=!0,yz.then(O5))}function qm(e){Pl.push(e)}function Wm(e){jm.push(e)}const Hm=new Set;let Bl=0;function O5(){if(Bl!==0)return;const e=Sc;do{try{for(;Ble.indexOf(i)===-1?t.push(i):n.push(i)),n.forEach(i=>i()),Pl=t}const wh=new Set;let la;function $e(){la={r:0,c:[],p:la}}function Ee(){la.r||Ll(la.c),la=la.p}function F(e,t){e&&e.i&&(wh.delete(e),e.i(t))}function N(e,t,n,i){if(e&&e.o){if(wh.has(e))return;wh.add(e),la.c.push(()=>{wh.delete(e),i&&(n&&e.d(1),i())}),e.o(t)}else i&&i()}function Re(e){return(e==null?void 0:e.length)!==void 0?e:Array.from(e)}function fi(e,t){const n={},i={},r={$$scope:1};let s=e.length;for(;s--;){const o=e[s],a=t[s];if(a){for(const l in o)l in a||(i[l]=1);for(const l in a)r[l]||(n[l]=a[l],r[l]=1);e[s]=a}else for(const l in o)r[l]=1}for(const o in i)o in n||(n[o]=void 0);return n}function Yi(e){return typeof e=="object"&&e!==null?e:{}}function Gm(e,t,n){const i=e.$$.props[t];i!==void 0&&(e.$$.bound[i]=n,n(e.$$.ctx[i]))}function ce(e){e&&e.c()}function le(e,t,n){const{fragment:i,after_update:r}=e.$$;i&&i.m(t,n),qm(()=>{const s=e.$$.on_mount.map(Gn).filter(E5);e.$$.on_destroy?e.$$.on_destroy.push(...s):Ll(s),e.$$.on_mount=[]}),r.forEach(qm)}function ue(e,t){const n=e.$$;n.fragment!==null&&(xz(n.after_update),Ll(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function _z(e,t){e.$$.dirty[0]===-1&&(zl.push(e),bz(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const p=h.length?h[0]:d;return u.ctx&&r(u.ctx[f],u.ctx[f]=p)&&(!u.skip_bound&&u.bound[f]&&u.bound[f](p),c&&_z(e,f)),d}):[],u.update(),c=!0,Ll(u.before_update),u.fragment=i?i(u.ctx):!1,t.target){if(t.hydrate){const f=pz(t.target);u.fragment&&u.fragment.l(f),f.forEach(L)}else u.fragment&&u.fragment.c();t.intro&&F(e.$$.fragment),le(e,t.target,t.anchor),O5()}Ac(l)}class ge{constructor(){Tt(this,"$$");Tt(this,"$$set")}$destroy(){ue(this,1),this.$destroy=ie}$on(t,n){if(!E5(n))return ie;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const r=i.indexOf(n);r!==-1&&i.splice(r,1)}}$set(t){this.$$set&&!cz(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const wz="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(wz);var kz=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{},Fr=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,i={},r={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function h(p){return p instanceof s?new s(p.type,h(p.content),p.alias):Array.isArray(p)?p.map(h):p.replace(/&/g,"&").replace(/"u")return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(m){var h=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(m.stack)||[])[1];if(h){var p=document.getElementsByTagName("script");for(var g in p)if(p[g].src==h)return p[g]}return null}},isActive:function(h,p,g){for(var m="no-"+p;h;){var y=h.classList;if(y.contains(p))return!0;if(y.contains(m))return!1;h=h.parentElement}return!!g}},languages:{plain:i,plaintext:i,text:i,txt:i,extend:function(h,p){var g=r.util.clone(r.languages[h]);for(var m in p)g[m]=p[m];return g},insertBefore:function(h,p,g,m){var y=(m=m||r.languages)[h],b={};for(var v in y)if(y.hasOwnProperty(v)){if(v==p)for(var x in g)g.hasOwnProperty(x)&&(b[x]=g[x]);g.hasOwnProperty(v)||(b[v]=y[v])}var _=m[h];return m[h]=b,r.languages.DFS(r.languages,function(k,w){w===_&&k!=h&&(this[k]=b)}),b},DFS:function h(p,g,m,y){y=y||{};var b=r.util.objId;for(var v in p)if(p.hasOwnProperty(v)){g.call(p,v,p[v],m||v);var x=p[v],_=r.util.type(x);_!=="Object"||y[b(x)]?_!=="Array"||y[b(x)]||(y[b(x)]=!0,h(x,g,v,y)):(y[b(x)]=!0,h(x,g,null,y))}}},plugins:{},highlightAll:function(h,p){r.highlightAllUnder(document,h,p)},highlightAllUnder:function(h,p,g){var m={callback:g,container:h,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",m),m.elements=Array.prototype.slice.apply(m.container.querySelectorAll(m.selector)),r.hooks.run("before-all-elements-highlight",m);for(var y,b=0;y=m.elements[b++];)r.highlightElement(y,p===!0,m.callback)},highlightElement:function(h,p,g){var m=r.util.getLanguage(h),y=r.languages[m];r.util.setLanguage(h,m);var b=h.parentElement;b&&b.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(b,m);var v={element:h,language:m,grammar:y,code:h.textContent};function x(k){v.highlightedCode=k,r.hooks.run("before-insert",v),v.element.innerHTML=v.highlightedCode,r.hooks.run("after-highlight",v),r.hooks.run("complete",v),g&&g.call(v.element)}if(r.hooks.run("before-sanity-check",v),(b=v.element.parentElement)&&b.nodeName.toLowerCase()==="pre"&&!b.hasAttribute("tabindex")&&b.setAttribute("tabindex","0"),!v.code)return r.hooks.run("complete",v),void(g&&g.call(v.element));if(r.hooks.run("before-highlight",v),v.grammar)if(p&&e.Worker){var _=new Worker(r.filename);_.onmessage=function(k){x(k.data)},_.postMessage(JSON.stringify({language:v.language,code:v.code,immediateClose:!0}))}else x(r.highlight(v.code,v.grammar,v.language));else x(r.util.encode(v.code))},highlight:function(h,p,g){var m={code:h,grammar:p,language:g};return r.hooks.run("before-tokenize",m),m.tokens=r.tokenize(m.code,m.grammar),r.hooks.run("after-tokenize",m),s.stringify(r.util.encode(m.tokens),m.language)},tokenize:function(h,p){var g=p.rest;if(g){for(var m in g)p[m]=g[m];delete p.rest}var y=new a;return l(y,y.head,h),function b(v,x,_,k,w,$){for(var S in _)if(_.hasOwnProperty(S)&&_[S]){var E=_[S];E=Array.isArray(E)?E:[E];for(var A=0;A=$.reach);ne+=W.value.length,W=W.next){var ae=W.value;if(x.length>v.length)return;if(!(ae instanceof s)){var ke,ze=1;if(T){if(!(ke=o(j,ne,v,M))||ke.index>=v.length)break;var Mr=ke.index,Ie=ke.index+ke[0].length,We=ne;for(We+=W.value.length;We<=Mr;)W=W.next,We+=W.value.length;if(We-=W.value.length,ne=We,W.value instanceof s)continue;for(var Wn=W;Wn!==x.tail&&(We$.reach&&($.reach=De);var X=W.prev;se&&(X=l(x,X,se),ne+=se.length),u(x,X,ze);var qt=new s(S,C?r.tokenize(Xi,C):Xi,O,Xi);if(W=l(x,X,qt),Te&&l(x,W,Te),1$.reach&&($.reach=He.reach)}}}}}}(h,y,p,y.head,0),function(b){for(var v=[],x=b.head.next;x!==b.tail;)v.push(x.value),x=x.next;return v}(y)},hooks:{all:{},add:function(h,p){var g=r.hooks.all;g[h]=g[h]||[],g[h].push(p)},run:function(h,p){var g=r.hooks.all[h];if(g&&g.length)for(var m,y=0;m=g[y++];)m(p)}},Token:s};function s(h,p,g,m){this.type=h,this.content=p,this.alias=g,this.length=0|(m||"").length}function o(h,p,g,m){h.lastIndex=p;var y=h.exec(g);if(y&&m&&y[1]){var b=y[1].length;y.index+=b,y[0]=y[0].slice(b)}return y}function a(){var h={value:null,prev:null,next:null},p={value:null,prev:h,next:null};h.next=p,this.head=h,this.tail=p,this.length=0}function l(h,p,g){var m=p.next,y={value:g,prev:p,next:m};return p.next=y,m.prev=y,h.length++,y}function u(h,p,g){for(var m=p.next,y=0;y"+y.content+""},!e.document)return e.addEventListener&&(r.disableWorkerMessageHandler||e.addEventListener("message",function(h){var p=JSON.parse(h.data),g=p.language,m=p.code,y=p.immediateClose;e.postMessage(r.highlight(m,r.languages[g],g)),y&&e.close()},!1)),r;var c=r.util.currentScript();function f(){r.manual||r.highlightAll()}if(c&&(r.filename=c.src,c.hasAttribute("data-manual")&&(r.manual=!0)),!r.manual){var d=document.readyState;d==="loading"||d==="interactive"&&c&&c.defer?document.addEventListener("DOMContentLoaded",f):window.requestAnimationFrame?window.requestAnimationFrame(f):window.setTimeout(f,16)}return r}(kz);typeof module<"u"&&module.exports&&(module.exports=Fr),typeof global<"u"&&(global.Prism=Fr),Fr.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},Fr.languages.log={string:{pattern:/"(?:[^"\\\r\n]|\\.)*"|'(?![st] | \w)(?:[^'\\\r\n]|\\.)*'/,greedy:!0},exception:{pattern:/(^|[^\w.])[a-z][\w.]*(?:Error|Exception):.*(?:(?:\r\n?|\n)[ \t]*(?:at[ \t].+|\.{3}.*|Caused by:.*))+(?:(?:\r\n?|\n)[ \t]*\.\.\. .*)?/,lookbehind:!0,greedy:!0,alias:["javastacktrace","language-javastacktrace"],inside:Fr.languages.javastacktrace||{keyword:/\bat\b/,function:/[a-z_][\w$]*(?=\()/,punctuation:/[.:()]/}},level:[{pattern:/\b(?:ALERT|CRIT|CRITICAL|EMERG|EMERGENCY|ERR|ERROR|FAILURE|FATAL|SEVERE)\b/,alias:["error","important"]},{pattern:/\b(?:WARN|WARNING|WRN)\b/,alias:["warning","important"]},{pattern:/\b(?:DISPLAY|INF|INFO|NOTICE|STATUS)\b/,alias:["info","keyword"]},{pattern:/\b(?:DBG|DEBUG|FINE)\b/,alias:["debug","keyword"]},{pattern:/\b(?:FINER|FINEST|TRACE|TRC|VERBOSE|VRB)\b/,alias:["trace","comment"]}],property:{pattern:/((?:^|[\]|])[ \t]*)[a-z_](?:[\w-]|\b\/\b)*(?:[. ]\(?\w(?:[\w-]|\b\/\b)*\)?)*:(?=\s)/im,lookbehind:!0},separator:{pattern:/(^|[^-+])-{3,}|={3,}|\*{3,}|- - /m,lookbehind:!0,alias:"comment"},url:/\b(?:file|ftp|https?):\/\/[^\s|,;'"]*[^\s|,;'">.]/,email:{pattern:/(^|\s)[-\w+.]+@[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)+(?=\s)/,lookbehind:!0,alias:"url"},"ip-address":{pattern:/\b(?:\d{1,3}(?:\.\d{1,3}){3})\b/,alias:"constant"},"mac-address":{pattern:/\b[a-f0-9]{2}(?::[a-f0-9]{2}){5}\b/i,alias:"constant"},domain:{pattern:/(^|\s)[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*\.[a-z][a-z0-9-]+(?=\s)/,lookbehind:!0,alias:"constant"},uuid:{pattern:/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/i,alias:"constant"},hash:{pattern:/\b(?:[a-f0-9]{32}){1,2}\b/i,alias:"constant"},"file-path":{pattern:/\b[a-z]:[\\/][^\s|,;:(){}\[\]"']+|(^|[\s:\[\](>|])\.{0,2}\/\w[^\s|,;:(){}\[\]"']*/i,lookbehind:!0,greedy:!0,alias:"string"},date:{pattern:RegExp("\\b\\d{4}[-/]\\d{2}[-/]\\d{2}(?:T(?=\\d{1,2}:)|(?=\\s\\d{1,2}:))|\\b\\d{1,4}[-/ ](?:\\d{1,2}|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)[-/ ]\\d{2,4}T?\\b|\\b(?:(?:Fri|Mon|Sat|Sun|Thu|Tue|Wed)(?:\\s{1,2}(?:Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep))?|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)\\s{1,2}\\d{1,2}\\b","i"),alias:"number"},time:{pattern:/\b\d{1,2}:\d{1,2}:\d{1,2}(?:[.,:]\d+)?(?:\s?[+-]\d{2}:?\d{2}|Z)?\b/,alias:"number"},boolean:/\b(?:false|null|true)\b/i,number:{pattern:/(^|[^.\w])(?:0x[a-f0-9]+|0o[0-7]+|0b[01]+|v?\d[\da-f]*(?:\.\d+)*(?:e[+-]?\d+)?[a-z]{0,3}\b)\b(?!\.\w)/i,lookbehind:!0},operator:/[;:?<=>~/@!$%&+\-|^(){}*#]/,punctuation:/[\[\].,]/},Fr.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Fr.languages.python["string-interpolation"].inside.interpolation.inside.rest=Fr.languages.python,Fr.languages.py=Fr.languages.python;const jl=[];function R5(e,t=ie){let n;const i=new Set;function r(a){if(he(e,a)&&(e=a,n)){const l=!jl.length;for(const u of i)u[1](),jl.push(u,e);if(l){for(let u=0;u{i.delete(u),i.size===0&&n&&(n(),n=null)}}return{set:r,update:s,subscribe:o}}const ua=R5(void 0);window.metaflow_card_update=e=>(ua==null||ua.update(t=>{const n={...t};return Object.values(e).forEach(i=>(n==null?void 0:n.components)&&L5(n.components,i)),n}),!0);const $z=(e,t)=>{e.data&&(e.data=JSON.parse(JSON.stringify(t.data))),JSON.stringify(t.spec)===JSON.stringify(e.spec)||(e.spec=JSON.parse(JSON.stringify(t.spec)))},L5=(e,t)=>{const n=e.findIndex(i=>t.id===(i==null?void 0:i.id));n>-1?e[n].type=="vegaChart"?$z(e[n],t):Object.assign(e[n],t):e.forEach(i=>{var r;(i.type==="section"||i.type==="page")&&((r=i==null?void 0:i.contents)!=null&&r.length)&&L5(i.contents,t)})},Ez=e=>{try{const t=JSON.parse(atob(window.__MF_DATA__[e]));ua.set(t)}catch{fetch("/card-example.json").then(n=>n.json()).then(n=>{ua.set(n)}).catch(console.error)}},Fc=R5(void 0),I5=e=>{const t={};if(!e)return t;function n(i,r=[]){var s;if(i.type==="page"){const o=[];t[i.title]=o,(s=i==null?void 0:i.contents)==null||s.forEach(a=>n(a,o))}i.type==="section"&&i.title&&r.push(i.title)}return e==null||e.forEach(i=>n(i)),t},eo=(e,t)=>{const n=t?parseFloat(getComputedStyle(document.documentElement).fontSize.replace("px","")):16;return e/n},Cz=e=>{const t=e.split("/");return{flowname:t[0],runid:t[1],stepname:t==null?void 0:t[2],taskid:t==null?void 0:t[3]}},Sz=(e,t)=>{var n;if(!(!e||!t))return(n=Cz(e))==null?void 0:n[t]},Az=e=>e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth;function Tz(e){let t,n,i,r,s,o,a,l;return{c(){t=Si("svg"),n=Si("title"),i=Oe("metaflow_logo_horizontal"),r=Si("g"),s=Si("g"),o=Si("g"),a=Si("path"),l=Si("path"),D(a,"d","M223.990273,66.33 C223.515273,61.851 222.686273,57.512 221.505273,53.33 C220.325273,49.148 218.795273,45.122 216.916273,41.271 C212.845273,32.921 207.254273,25.587 200.268273,19.422 C199.270273,18.541 198.243273,17.684 197.189273,16.851 C191.255273,12.166 184.481273,8.355 177.253273,5.55 C174.156273,4.347 170.975273,3.33 167.741273,2.508 C161.273273,0.863 154.593273,0 147.943273,0 C141.755273,0 135.332273,0.576 128.687273,1.722 C127.025273,2.01 125.350273,2.332 123.661273,2.69 C120.283273,3.406 116.851273,4.265 113.365273,5.267 C104.650273,7.769 95.6022727,11.161 86.2442727,15.433 C78.7592727,18.851 71.0762727,22.832 63.2072727,27.373 C47.9762727,36.162 35.7372727,44.969 29.3592727,49.791 C29.0692727,50.01 28.7922727,50.221 28.5262727,50.423 C26.1382727,52.244 24.7522727,53.367 24.5662727,53.519 L0.549272727,73.065 C0.191272727,73.356 0.00727272727,73.773 0,74.194 C-0.00372727273,74.403 0.0362727273,74.614 0.120272727,74.811 C0.205272727,75.008 0.334272727,75.189 0.508272727,75.341 L11.7612727,85.195 C12.1692727,85.552 12.7252727,85.651 13.2162727,85.487 C13.3792727,85.432 13.5362727,85.348 13.6762727,85.234 L35.8492727,67.382 C36.0422727,67.224 37.6152727,65.949 40.3252727,63.903 C44.1192727,61.036 50.1422727,56.656 57.7292727,51.711 C62.0642727,48.884 66.9102727,45.873 72.1412727,42.854 C100.864273,26.278 126.367273,17.874 147.943273,17.874 C148.366273,17.874 148.790273,17.892 149.213273,17.902 C149.655273,17.911 150.096273,17.911 150.538273,17.93 C153.769273,18.068 156.995273,18.463 160.170273,19.097 C164.931273,20.049 169.577273,21.542 173.953273,23.524 C178.328273,25.505 182.433273,27.975 186.112273,30.88 C186.771273,31.4 187.406273,31.94 188.035273,32.485 C188.913273,33.245 189.771273,34.023 190.591273,34.83 C191.998273,36.217 193.317273,37.673 194.548273,39.195 C196.395273,41.479 198.042273,43.912 199.480273,46.485 C199.960273,47.342 200.417273,48.216 200.850273,49.105 C201.112273,49.642 201.343273,50.196 201.587273,50.743 C202.231273,52.185 202.834273,53.649 203.354273,55.158 C203.712273,56.198 204.041273,57.255 204.340273,58.326 C205.836273,63.683 206.590273,69.417 206.590273,75.469 C206.590273,81.221 205.892273,86.677 204.541273,91.804 C203.617273,95.308 202.397273,98.662 200.850273,101.833 C200.417273,102.722 199.960273,103.595 199.480273,104.453 C197.562273,107.884 195.275273,111.066 192.636273,113.976 C190.657273,116.159 188.480273,118.189 186.113273,120.058 C184.553273,121.29 182.909273,122.432 181.208273,123.503 C180.313273,124.067 179.400273,124.609 178.470273,125.126 C177.462273,125.688 176.442273,126.232 175.398273,126.737 C166.961273,130.823 157.423273,133.064 147.943273,133.064 C126.367273,133.064 100.864273,124.659 72.1412727,108.084 C70.5382727,107.159 68.4382727,105.886 66.3072727,104.575 C65.0292727,103.788 63.7402727,102.986 62.5412727,102.237 C59.3442727,100.238 56.7882727,98.61 56.7882727,98.61 C61.8362727,93.901 69.3232727,87.465 78.6472727,81.047 C80.0092727,80.11 81.4192727,79.174 82.8572727,78.243 C84.1052727,77.436 85.3712727,76.63 86.6732727,75.835 C88.2042727,74.9 89.7802727,73.981 91.3822727,73.074 C93.0482727,72.131 94.7512727,71.207 96.4902727,70.307 C111.473273,62.55 129.094273,56.602 147.943273,56.602 C151.750273,56.602 157.745273,57.825 162.114273,61.276 C162.300273,61.422 162.489273,61.578 162.677273,61.74 C163.337273,62.305 164.006273,62.966 164.634273,63.78 C164.957273,64.198 165.269273,64.657 165.564273,65.162 C166.006273,65.92 166.409273,66.782 166.750273,67.775 C166.891273,68.185 167.016273,68.627 167.134273,69.083 C167.586273,70.833 167.863273,72.924 167.863273,75.469 C167.863273,78.552 167.460273,80.974 166.824273,82.92 C166.578273,83.674 166.300273,84.363 165.992273,84.983 C165.855273,85.259 165.711273,85.524 165.564273,85.776 C165.376273,86.099 165.178273,86.396 164.977273,86.682 C164.631273,87.175 164.269273,87.618 163.900273,88.018 C163.730273,88.202 163.559273,88.379 163.387273,88.546 C162.962273,88.96 162.534273,89.331 162.114273,89.662 C157.745273,93.112 151.750273,94.337 147.943273,94.337 C144.485273,94.337 140.682273,93.926 136.589273,93.121 C133.860273,92.584 131.003273,91.871 128.033273,90.987 C123.579273,89.662 118.873273,87.952 113.970273,85.872 C113.768273,85.786 113.552273,85.747 113.336273,85.753 C113.122273,85.76 112.908273,85.813 112.713273,85.912 C106.990273,88.816 101.641273,91.995 96.7462727,95.223 C96.6232727,95.304 96.5182727,95.397 96.4302727,95.5 C95.8122727,96.22 96.0172727,97.397 96.9492727,97.822 L102.445273,100.328 C104.606273,101.314 106.737273,102.238 108.835273,103.102 C110.934273,103.966 113.001273,104.77 115.035273,105.511 C118.086273,106.624 121.064273,107.599 123.965273,108.436 C127.834273,109.551 131.567273,110.421 135.157273,111.043 C139.646273,111.82 143.912273,112.211 147.943273,112.211 C148.367273,112.211 148.923273,112.201 149.591273,112.169 C149.925273,112.153 150.287273,112.131 150.674273,112.102 C155.712273,111.724 165.055273,110.114 173.190273,103.691 C173.547273,103.41 173.869273,103.105 174.210273,102.813 C175.324273,101.86 176.381273,100.866 177.333273,99.8 C177.470273,99.648 177.590273,99.485 177.724273,99.331 C181.300273,95.167 183.699273,90.185 184.875273,84.406 C185.444273,81.609 185.737273,78.631 185.737273,75.469 C185.737273,63.315 181.516273,53.82 173.190273,47.247 C167.050273,42.399 160.228273,40.299 155.083273,39.395 C153.892273,39.186 152.790273,39.037 151.809273,38.938 C150.116273,38.766 148.774273,38.727 147.943273,38.727 C133.456273,38.727 118.519273,41.679 103.545273,47.5 C99.1222727,49.22 94.6912727,51.191 90.2702727,53.403 C88.7972727,54.141 87.3242727,54.905 85.8542727,55.696 C83.5092727,56.957 81.1722727,58.303 78.8382727,59.697 C77.3922727,60.562 75.9492727,61.451 74.5082727,62.366 C72.4422727,63.678 70.3802727,65.023 68.3302727,66.437 C63.8372727,69.535 59.7422727,72.63 56.0902727,75.567 C54.8732727,76.547 53.7052727,77.508 52.5882727,78.446 C48.1222727,82.2 44.4752727,85.581 41.7602727,88.226 C38.3032727,91.593 36.3592727,93.766 36.1632727,93.986 L35.8282727,94.362 L32.0332727,98.61 L30.6432727,100.164 C30.4962727,100.329 30.3932727,100.517 30.3312727,100.715 C30.1482727,101.307 30.3472727,101.981 30.8882727,102.368 L37.2812727,106.938 L37.4862727,107.083 L37.6922727,107.228 C39.8732727,108.766 42.0702727,110.277 44.2792727,111.758 C45.8422727,112.807 47.4102727,113.84 48.9832727,114.858 C51.5302727,116.508 54.0902727,118.103 56.6542727,119.665 C57.8412727,120.388 59.0282727,121.101 60.2162727,121.804 C61.2142727,122.394 62.2102727,122.989 63.2072727,123.565 C76.9772727,131.512 90.1802727,137.744 102.748273,142.242 C104.544273,142.884 106.326273,143.491 108.096273,144.063 C111.635273,145.206 115.121273,146.207 118.553273,147.067 C121.986273,147.925 125.364273,148.642 128.687273,149.215 C135.332273,150.362 141.755273,150.938 147.943273,150.938 C154.593273,150.938 161.273273,150.074 167.741273,148.43 C174.209273,146.786 180.465273,144.361 186.265273,141.238 C190.133273,139.156 193.798273,136.764 197.189273,134.087 C200.352273,131.589 203.264273,128.872 205.911273,125.949 C207.677273,124 209.325273,121.96 210.854273,119.831 C211.618273,118.766 212.353273,117.68 213.057273,116.571 C214.466273,114.356 215.753273,112.053 216.916273,109.667 C220.701273,101.906 223.073273,93.439 224.008273,84.406 C224.310273,81.485 224.465273,78.505 224.465273,75.469 C224.465273,72.364 224.306273,69.316 223.990273,66.33"),D(a,"id","Fill-1"),D(a,"fill","#146EE6"),D(l,"d","M758.389273,75.346 C752.632273,111.56 742.681273,122.23 712.102273,122.23 C710.847273,122.23 709.640273,122.207 708.464273,122.17 C708.321273,122.191 708.191273,122.23 708.028273,122.23 L637.994273,122.23 C636.795273,122.23 636.315273,121.632 636.435273,120.311 L650.585273,31.22 C650.704273,30.016 651.424273,29.417 652.623273,29.417 L667.852273,29.417 C669.050273,29.417 669.530273,30.016 669.410273,31.22 L657.659273,105.802 L714.249273,105.802 L714.249273,105.787 C714.410273,105.794 714.568273,105.802 714.741273,105.802 C718.878273,105.802 722.250273,105.351 725.040273,104.313 C726.434273,103.794 727.684273,103.129 728.810273,102.298 C729.373273,101.884 729.905273,101.426 730.410273,100.927 C734.951273,96.431 737.231273,88.43 739.322273,75.346 C739.328273,75.312 739.331273,75.282 739.337273,75.25 C739.642273,73.311 739.896273,71.474 740.130273,69.679 C740.203273,69.116 740.272273,68.557 740.338273,68.008 C740.412273,67.392 740.461273,66.821 740.525273,66.222 C742.136273,49.927 738.622273,44.525 724.454273,44.525 C723.419273,44.525 722.433273,44.554 721.490273,44.613 C708.297273,45.444 703.831273,52.303 700.461273,71.126 C700.220273,72.472 699.984273,73.877 699.752273,75.346 C699.483273,77.027 699.255273,78.6 699.052273,80.115 C698.993273,80.545 698.948273,80.946 698.895273,81.361 C698.757273,82.465 698.638273,83.528 698.540273,84.544 C698.502273,84.943 698.466273,85.334 698.434273,85.72 C698.344273,86.815 698.281273,87.856 698.246273,88.847 C698.238273,89.049 698.224273,89.269 698.219273,89.469 C698.161273,91.88 698.289273,93.972 698.621273,95.782 C698.649273,95.941 698.686273,96.089 698.717273,96.246 C698.874273,96.992 699.067273,97.689 699.301273,98.337 C699.346273,98.464 699.390273,98.594 699.439273,98.718 C700.039273,100.231 700.864273,101.478 701.963273,102.469 C702.263273,102.738 702.586273,102.987 702.925273,103.22 L679.436273,103.22 C679.393273,102.969 679.343273,102.727 679.305273,102.471 L679.304273,102.471 C679.304273,102.467 679.304273,102.462 679.303273,102.459 C679.259273,102.17 679.236273,101.854 679.198273,101.558 C679.083273,100.634 678.995273,99.671 678.934273,98.674 C678.908273,98.258 678.879273,97.845 678.862273,97.419 C678.816273,96.174 678.804273,94.876 678.832273,93.518 C678.840273,93.114 678.861273,92.69 678.876273,92.276 C678.920273,91.042 678.991273,89.765 679.092273,88.441 C679.117273,88.109 679.134273,87.79 679.162273,87.452 C679.299273,85.836 679.483273,84.137 679.698273,82.382 C679.750273,81.957 679.807273,81.518 679.863273,81.084 C680.104273,79.238 680.369273,77.344 680.687273,75.346 C681.046273,73.067 681.423273,70.889 681.819273,68.808 C687.040273,41.397 695.809273,30.748 717.267273,28.554 C720.250273,28.25 723.472273,28.103 726.971273,28.103 C726.972273,28.103 726.972273,28.103 726.972273,28.103 C747.994273,28.103 757.680273,33.202 759.811273,48.236 C760.779273,55.067 760.187273,63.953 758.389273,75.346 Z M894.023273,31.336 L866.923273,108.56 C863.472273,118.182 861.113273,121.41 854.499273,122.41 C852.379273,122.733 849.831273,122.828 846.659273,122.828 C831.670273,122.828 830.350273,121.267 829.392273,108.56 L825.794273,63.232 L825.794273,63.231 L807.928273,108.56 C804.255273,117.613 802.201273,120.996 795.961273,122.202 C793.442273,122.687 790.260273,122.829 785.985273,122.829 C772.914273,122.829 770.756273,121.267 770.396273,108.56 L767.638273,31.337 C767.638273,29.899 768.238273,29.417 769.557273,29.417 L785.385273,29.417 C786.464273,29.417 786.704273,29.899 786.824273,31.337 L788.895273,100.572 L788.895273,100.571 C789.054273,103.091 789.563273,103.641 791.021273,103.641 C792.939273,103.641 793.419273,103.042 794.618273,100.043 L820.758273,34.576 C821.358273,33.132 822.437273,32.657 823.516273,32.657 L837.665273,32.657 C838.519273,32.657 839.279273,32.977 839.626273,33.817 C839.718273,34.038 839.799273,34.274 839.824273,34.576 L845.220273,100.043 C845.460273,103.042 845.819273,103.641 847.738273,103.641 C849.297273,103.641 849.896273,103.042 850.976273,100.043 L874.838273,31.336 C875.317273,29.898 875.677273,29.417 876.756273,29.417 L892.584273,29.417 C893.903273,29.417 894.383273,29.898 894.023273,31.336 Z M362.708273,31.219 L357.192273,120.311 C357.192273,121.632 356.353273,122.23 355.154273,122.23 L339.926273,122.23 C338.726273,122.23 338.366273,121.632 338.366273,120.311 L342.324273,62.756 L311.986273,117.551 C311.386273,118.749 310.428273,119.348 309.229273,119.348 L297.837273,119.348 C296.758273,119.348 296.038273,118.749 295.560273,117.551 L282.851273,62.767 L282.848273,62.755 L268.339273,120.31 C268.212273,121.009 267.974273,121.492 267.612273,121.807 C267.288273,122.085 266.865273,122.23 266.301273,122.23 L251.073273,122.23 C249.874273,122.23 249.273273,121.632 249.514273,120.31 L272.296273,31.336 C272.537273,30.138 272.897273,29.417 274.095273,29.417 L288.605273,29.417 C291.236273,29.417 292.726273,29.895 293.682273,31.379 C294.120273,32.059 294.457273,32.928 294.720273,34.095 L307.790273,92.489 L339.326273,34.095 C341.485273,30.256 343.043273,29.299 346.880273,29.299 L361.389273,29.299 C362.376273,29.299 362.682273,30.684 362.682273,30.684 C362.682273,30.684 362.708273,31.029 362.708273,31.219 Z M501.706273,31.219 L499.667273,44.049 C499.547273,45.246 498.708273,45.845 497.509273,45.845 L472.448273,45.845 L460.696273,120.31 C460.457273,121.632 459.738273,122.23 458.538273,122.23 L443.309273,122.23 C442.111273,122.23 441.631273,121.632 441.870273,120.31 L453.622273,45.845 L394.820273,45.845 L391.224273,68.507 L391.224273,68.508 L430.555273,68.508 C431.754273,68.508 432.353273,69.106 432.234273,70.31 L430.196273,82.542 C430.076273,83.738 429.236273,84.338 428.038273,84.338 L388.706273,84.338 L385.349273,105.801 L428.397273,105.801 C429.596273,105.801 430.076273,106.4 429.955273,107.597 L427.797273,120.428 C427.676273,121.632 426.958273,122.23 425.759273,122.23 L365.683273,122.23 C364.484273,122.23 364.004273,121.632 364.124273,120.31 L378.273273,31.219 C378.393273,30.015 379.112273,29.417 380.313273,29.417 L500.147273,29.417 C501.346273,29.417 501.826273,30.015 501.706273,31.219 Z M629.471273,70.426 L627.433273,82.659 C627.313273,83.856 626.473273,84.454 625.275273,84.454 L588.223273,84.454 L582.466273,120.311 C582.347273,121.632 581.627273,122.23 580.428273,122.23 L565.200273,122.23 C564.001273,122.23 563.522273,121.632 563.640273,120.311 L577.790273,31.219 C577.910273,30.016 578.629273,29.417 579.828273,29.417 L643.004273,29.417 C644.202273,29.417 644.802273,30.016 644.682273,31.219 L642.644273,44.05 C642.403273,45.247 641.685273,45.846 640.486273,45.846 L594.337273,45.846 L590.741273,68.631 L627.793273,68.631 C628.991273,68.631 629.592273,69.23 629.471273,70.426 Z M388.706273,84.338 L388.712273,84.338 L388.309273,86.876 L388.706273,84.338 Z M510.726273,79.783 L524.396273,48.006 C525.036273,46.466 525.443273,45.589 525.990273,45.096 C526.465273,44.667 527.044273,44.525 527.993273,44.525 C530.391273,44.525 530.391273,45.124 530.751273,48.006 L534.348273,79.783 L510.726273,79.783 Z M542.334273,29.886 C539.756273,28.905 536.043273,28.702 530.511273,28.702 C516.601273,28.702 513.963273,30.016 508.208273,43.087 L474.633273,120.311 C474.154273,121.749 474.513273,122.23 475.832273,122.23 L491.060273,122.23 C492.259273,122.23 492.500273,121.749 493.099273,120.311 L504.011273,95.372 L536.026273,95.372 L539.024273,120.311 C539.144273,121.749 539.144273,122.23 540.344273,122.23 L555.572273,122.23 C556.891273,122.23 557.490273,121.749 557.490273,120.311 L548.617273,43.087 C547.658273,35.042 546.460273,31.458 542.334273,29.886 L542.334273,29.886 Z"),D(l,"id","Fill-2"),D(l,"fill","#333333"),D(o,"id","metaflow_logo_horizontal"),D(o,"transform","translate(92.930727, 93.190000)"),D(s,"id","Metaflow_Logo_Horizontal_TwoColor_Dark_RGB"),D(s,"transform","translate(-92.000000, -93.000000)"),D(r,"id","Page-1"),D(r,"stroke","none"),D(r,"stroke-width","1"),D(r,"fill","none"),D(r,"fill-rule","evenodd"),D(t,"xmlns","http://www.w3.org/2000/svg"),D(t,"xmlns:xlink","http://www.w3.org/1999/xlink"),D(t,"width","896px"),D(t,"height","152px"),D(t,"viewBox","0 0 896 152"),D(t,"version","1.1")},m(u,c){I(u,t,c),V(t,n),V(n,i),V(t,r),V(r,s),V(s,o),V(o,a),V(o,l)},d(u){u&&L(t)}}}function Mz(e){let t,n,i;return{c(){t=Si("svg"),n=Si("path"),i=Si("path"),D(n,"fill-rule","evenodd"),D(n,"clip-rule","evenodd"),D(n,"d","M223.991 66.33C223.516 61.851 222.687 57.512 221.506 53.33C220.326 49.148 218.796 45.122 216.917 41.271C212.846 32.921 207.255 25.587 200.269 19.422C199.271 18.541 198.244 17.684 197.19 16.851C191.256 12.166 184.482 8.355 177.254 5.55C174.157 4.347 170.976 3.33 167.742 2.508C161.274 0.863 154.594 0 147.944 0C141.756 0 135.333 0.576 128.688 1.722C127.026 2.01 125.351 2.332 123.662 2.69C120.284 3.406 116.852 4.265 113.366 5.267C104.651 7.769 95.6025 11.161 86.2445 15.433C78.7595 18.851 71.0765 22.832 63.2075 27.373C47.9765 36.162 35.7375 44.969 29.3595 49.791C29.0695 50.01 28.7925 50.221 28.5265 50.423C26.1385 52.244 24.7525 53.367 24.5665 53.519L0.549511 73.065C0.191511 73.356 0.00751099 73.773 0.000238261 74.194C-0.00348901 74.403 0.036511 74.614 0.120511 74.811C0.205511 75.008 0.334511 75.189 0.508511 75.341L11.7615 85.195C12.1695 85.552 12.7255 85.651 13.2165 85.487C13.3795 85.432 13.5365 85.348 13.6765 85.234L35.8495 67.382C36.0425 67.224 37.6155 65.949 40.3255 63.903C44.1195 61.036 50.1425 56.656 57.7295 51.711C62.0645 48.884 66.9105 45.873 72.1415 42.854C100.865 26.278 126.368 17.874 147.944 17.874C148.367 17.874 148.791 17.892 149.214 17.902C149.656 17.911 150.097 17.911 150.539 17.93C153.77 18.068 156.996 18.463 160.171 19.097C164.932 20.049 169.578 21.542 173.954 23.524C178.329 25.505 182.434 27.975 186.113 30.88C186.772 31.4 187.407 31.94 188.036 32.485C188.914 33.245 189.772 34.023 190.592 34.83C191.999 36.217 193.318 37.673 194.549 39.195C196.396 41.479 198.043 43.912 199.481 46.485C199.961 47.342 200.418 48.216 200.851 49.105C201.113 49.642 201.344 50.196 201.588 50.743C202.232 52.185 202.835 53.649 203.355 55.158C203.713 56.198 204.042 57.255 204.341 58.326C205.837 63.683 206.591 69.417 206.591 75.469C206.591 81.221 205.893 86.677 204.542 91.804C203.618 95.308 202.398 98.662 200.851 101.833C200.418 102.722 199.961 103.595 199.481 104.453C197.563 107.884 195.276 111.066 192.637 113.976C190.658 116.159 188.481 118.189 186.114 120.058C184.554 121.29 182.91 122.432 181.209 123.503C180.314 124.067 179.401 124.609 178.471 125.126C177.463 125.688 176.443 126.232 175.399 126.737C166.962 130.823 157.424 133.064 147.944 133.064C126.368 133.064 100.865 124.659 72.1415 108.084C70.5385 107.159 68.4385 105.886 66.3075 104.575C65.0295 103.788 63.7405 102.986 62.5415 102.237C59.3445 100.238 56.7885 98.61 56.7885 98.61C61.8365 93.901 69.3235 87.465 78.6475 81.047C80.0095 80.11 81.4195 79.174 82.8575 78.243C84.1055 77.436 85.3715 76.63 86.6735 75.835C88.2045 74.9 89.7805 73.981 91.3825 73.074C93.0485 72.131 94.7515 71.207 96.4905 70.307C111.474 62.55 129.095 56.602 147.944 56.602C151.751 56.602 157.746 57.825 162.115 61.276C162.301 61.422 162.49 61.578 162.678 61.74C163.338 62.305 164.007 62.966 164.635 63.78C164.958 64.198 165.27 64.657 165.565 65.162C166.007 65.92 166.41 66.782 166.751 67.775C166.892 68.185 167.017 68.627 167.135 69.083C167.587 70.833 167.864 72.924 167.864 75.469C167.864 78.552 167.461 80.974 166.825 82.92C166.579 83.674 166.301 84.363 165.993 84.983C165.856 85.259 165.712 85.524 165.565 85.776C165.377 86.099 165.179 86.396 164.978 86.682C164.632 87.175 164.27 87.618 163.901 88.018C163.731 88.202 163.56 88.379 163.388 88.546C162.963 88.96 162.535 89.331 162.115 89.662C157.746 93.112 151.751 94.337 147.944 94.337C144.486 94.337 140.683 93.926 136.59 93.121C133.861 92.584 131.004 91.871 128.034 90.987C123.58 89.662 118.874 87.952 113.971 85.872C113.769 85.786 113.553 85.747 113.337 85.753C113.123 85.76 112.909 85.813 112.714 85.912C106.991 88.816 101.642 91.995 96.7465 95.223C96.6235 95.304 96.5185 95.397 96.4305 95.5C95.8125 96.22 96.0175 97.397 96.9495 97.822L102.446 100.328C104.607 101.314 106.738 102.238 108.836 103.102C110.935 103.966 113.002 104.77 115.036 105.511C118.087 106.624 121.065 107.599 123.966 108.436C127.835 109.551 131.568 110.421 135.158 111.043C139.647 111.82 143.913 112.211 147.944 112.211C148.368 112.211 148.924 112.201 149.592 112.169C149.926 112.153 150.288 112.131 150.675 112.102C155.713 111.724 165.056 110.114 173.191 103.691C173.548 103.41 173.87 103.105 174.211 102.813C175.325 101.86 176.382 100.866 177.334 99.8C177.471 99.648 177.591 99.485 177.725 99.331C181.301 95.167 183.7 90.185 184.876 84.406C185.445 81.609 185.738 78.631 185.738 75.469C185.738 63.315 181.517 53.82 173.191 47.247C167.051 42.399 160.229 40.299 155.084 39.395C153.893 39.186 152.791 39.037 151.81 38.938C150.117 38.766 148.775 38.727 147.944 38.727C133.457 38.727 118.52 41.679 103.546 47.5C99.1225 49.22 94.6915 51.191 90.2705 53.403C88.7975 54.141 87.3245 54.905 85.8545 55.696C83.5095 56.957 81.1725 58.303 78.8385 59.697C77.3925 60.562 75.9495 61.451 74.5085 62.366C72.4425 63.678 70.3805 65.023 68.3305 66.437C63.8375 69.535 59.7425 72.63 56.0905 75.567C54.8735 76.547 53.7055 77.508 52.5885 78.446C48.1225 82.2 44.4755 85.581 41.7605 88.226C38.3035 91.593 36.3595 93.766 36.1635 93.986L35.8285 94.362L32.0335 98.61L30.6435 100.164C30.4965 100.329 30.3935 100.517 30.3315 100.715C30.1485 101.307 30.3475 101.981 30.8885 102.368L37.2815 106.938L37.4865 107.083L37.6925 107.228C39.8735 108.766 42.0705 110.277 44.2795 111.758C45.8425 112.807 47.4105 113.84 48.9835 114.858C51.5305 116.508 54.0905 118.103 56.6545 119.665C57.8415 120.388 59.0285 121.101 60.2165 121.804C61.2145 122.394 62.2105 122.989 63.2075 123.565C76.9775 131.512 90.1805 137.744 102.749 142.242C104.545 142.884 106.327 143.491 108.097 144.063C111.636 145.206 115.122 146.207 118.554 147.067C121.987 147.925 125.365 148.642 128.688 149.215C135.333 150.362 141.756 150.938 147.944 150.938C154.594 150.938 161.274 150.074 167.742 148.43C174.21 146.786 180.466 144.361 186.266 141.238C190.134 139.156 193.799 136.764 197.19 134.087C200.353 131.589 203.265 128.872 205.912 125.949C207.678 124 209.326 121.96 210.855 119.831C211.619 118.766 212.354 117.68 213.058 116.571C214.467 114.356 215.754 112.053 216.917 109.667C220.702 101.906 223.074 93.439 224.009 84.406C224.311 81.485 224.466 78.505 224.466 75.469C224.466 72.364 224.307 69.316 223.991 66.33Z"),D(n,"fill","#146EE6"),D(i,"fill-rule","evenodd"),D(i,"clip-rule","evenodd"),D(i,"d","M758.39 75.346C752.633 111.56 742.682 122.23 712.103 122.23C710.848 122.23 709.641 122.207 708.465 122.17C708.322 122.191 708.192 122.23 708.029 122.23H637.995C636.796 122.23 636.316 121.632 636.436 120.311L650.586 31.22C650.705 30.016 651.425 29.417 652.624 29.417H667.853C669.051 29.417 669.531 30.016 669.411 31.22L657.66 105.802H714.25V105.787C714.411 105.794 714.569 105.802 714.742 105.802C718.879 105.802 722.251 105.351 725.041 104.313C726.435 103.794 727.685 103.129 728.811 102.298C729.374 101.884 729.906 101.426 730.411 100.927C734.952 96.431 737.232 88.43 739.323 75.346C739.329 75.312 739.332 75.282 739.338 75.25C739.643 73.311 739.896 71.474 740.13 69.679C740.203 69.116 740.273 68.557 740.339 68.008C740.413 67.392 740.462 66.821 740.526 66.222C742.137 49.927 738.623 44.525 724.455 44.525C723.42 44.525 722.434 44.554 721.491 44.613C708.298 45.444 703.831 52.303 700.461 71.126C700.22 72.472 699.985 73.877 699.753 75.346C699.484 77.027 699.255 78.6 699.052 80.115C698.993 80.545 698.949 80.946 698.896 81.361C698.758 82.465 698.639 83.528 698.541 84.544C698.503 84.943 698.467 85.334 698.435 85.72C698.345 86.815 698.282 87.856 698.247 88.847C698.239 89.049 698.225 89.269 698.22 89.469C698.162 91.88 698.29 93.972 698.622 95.782C698.65 95.941 698.687 96.089 698.718 96.246C698.875 96.992 699.068 97.689 699.302 98.337C699.347 98.464 699.391 98.594 699.44 98.718C700.04 100.231 700.865 101.478 701.964 102.469C702.264 102.738 702.587 102.987 702.926 103.22H679.437C679.394 102.969 679.344 102.727 679.306 102.471H679.305C679.305 102.467 679.305 102.462 679.304 102.459C679.26 102.17 679.237 101.854 679.199 101.558C679.084 100.634 678.996 99.671 678.935 98.674C678.909 98.258 678.879 97.845 678.862 97.419C678.816 96.174 678.805 94.876 678.833 93.518C678.841 93.114 678.862 92.69 678.877 92.276C678.921 91.042 678.992 89.765 679.093 88.441C679.118 88.109 679.135 87.79 679.163 87.452C679.3 85.836 679.484 84.137 679.699 82.382C679.751 81.957 679.808 81.518 679.864 81.084C680.105 79.238 680.37 77.344 680.688 75.346C681.046 73.067 681.424 70.889 681.82 68.808C687.041 41.397 695.81 30.748 717.268 28.554C720.251 28.25 723.472 28.103 726.971 28.103C726.972 28.103 726.973 28.103 726.973 28.103C747.995 28.103 757.681 33.202 759.812 48.236C760.78 55.067 760.188 63.953 758.39 75.346ZM894.023 31.336L866.924 108.56C863.473 118.182 861.114 121.41 854.5 122.41C852.38 122.733 849.832 122.828 846.66 122.828C831.671 122.828 830.351 121.267 829.393 108.56L825.794 63.232V63.231L807.929 108.56C804.256 117.613 802.201 120.996 795.961 122.202C793.442 122.687 790.261 122.829 785.986 122.829C772.915 122.829 770.757 121.267 770.397 108.56L767.638 31.337C767.638 29.899 768.238 29.417 769.557 29.417H785.385C786.464 29.417 786.705 29.899 786.825 31.337L788.896 100.572V100.571C789.055 103.091 789.564 103.641 791.022 103.641C792.94 103.641 793.42 103.042 794.619 100.043L820.759 34.576C821.359 33.132 822.438 32.657 823.517 32.657H837.666C838.52 32.657 839.28 32.977 839.627 33.817C839.719 34.038 839.8 34.274 839.825 34.576L845.221 100.043C845.461 103.042 845.82 103.641 847.739 103.641C849.298 103.641 849.897 103.042 850.977 100.043L874.839 31.336C875.318 29.898 875.678 29.417 876.757 29.417H892.585C893.904 29.417 894.383 29.898 894.023 31.336ZM362.709 31.219L357.193 120.311C357.193 121.632 356.354 122.23 355.155 122.23H339.927C338.727 122.23 338.367 121.632 338.367 120.311L342.325 62.756L311.987 117.551C311.387 118.749 310.429 119.348 309.23 119.348H297.838C296.759 119.348 296.039 118.749 295.561 117.551L282.852 62.767L282.849 62.755L268.34 120.31C268.213 121.009 267.975 121.492 267.613 121.807C267.289 122.085 266.866 122.23 266.302 122.23H251.074C249.875 122.23 249.274 121.632 249.515 120.31L272.297 31.336C272.538 30.138 272.898 29.417 274.096 29.417H288.606C291.237 29.417 292.727 29.895 293.683 31.379C294.121 32.059 294.458 32.928 294.721 34.095L307.791 92.489L339.327 34.095C341.486 30.256 343.044 29.299 346.881 29.299H361.39C362.377 29.299 362.683 30.684 362.683 30.684C362.683 30.684 362.709 31.029 362.709 31.219ZM501.707 31.219L499.668 44.049C499.548 45.246 498.709 45.845 497.51 45.845H472.449L460.697 120.31C460.458 121.632 459.739 122.23 458.539 122.23H443.31C442.112 122.23 441.632 121.632 441.871 120.31L453.623 45.845H394.821L391.225 68.507V68.508H430.556C431.755 68.508 432.354 69.106 432.235 70.31L430.197 82.542C430.077 83.738 429.237 84.338 428.039 84.338H388.707L385.35 105.801H428.398C429.597 105.801 430.077 106.4 429.956 107.597L427.798 120.428C427.677 121.632 426.959 122.23 425.76 122.23H365.684C364.485 122.23 364.005 121.632 364.125 120.31L378.274 31.219C378.394 30.015 379.113 29.417 380.314 29.417H500.148C501.347 29.417 501.827 30.015 501.707 31.219ZM629.471 70.426L627.434 82.659C627.314 83.856 626.474 84.454 625.276 84.454H588.224L582.466 120.311C582.347 121.632 581.628 122.23 580.429 122.23H565.201C564.002 122.23 563.523 121.632 563.641 120.311L577.791 31.219C577.911 30.016 578.629 29.417 579.828 29.417H643.005C644.203 29.417 644.802 30.016 644.682 31.219L642.645 44.05C642.404 45.247 641.686 45.846 640.487 45.846H594.338L590.742 68.631H627.794C628.992 68.631 629.592 69.23 629.471 70.426ZM388.707 84.338H388.713L388.31 86.876L388.707 84.338ZM510.727 79.783L524.397 48.006C525.037 46.466 525.444 45.589 525.991 45.096C526.466 44.667 527.045 44.525 527.994 44.525C530.392 44.525 530.392 45.124 530.752 48.006L534.349 79.783H510.727ZM542.335 29.886C539.757 28.905 536.044 28.702 530.512 28.702C516.602 28.702 513.964 30.016 508.209 43.087L474.634 120.311C474.155 121.749 474.514 122.23 475.833 122.23H491.061C492.26 122.23 492.501 121.749 493.1 120.311L504.012 95.372H536.026L539.025 120.311C539.145 121.749 539.145 122.23 540.345 122.23H555.573C556.892 122.23 557.491 121.749 557.491 120.311L548.617 43.087C547.658 35.042 546.461 31.458 542.335 29.886Z"),D(i,"fill","white"),D(t,"width","895"),D(t,"height","151"),D(t,"viewBox","0 0 895 151"),D(t,"fill","none"),D(t,"xmlns","http://www.w3.org/2000/svg")},m(r,s){I(r,t,s),V(t,n),V(t,i)},d(r){r&&L(t)}}}function Fz(e){let t;function n(s,o){return s[0]?Mz:Tz}let i=n(e),r=i(e);return{c(){r.c(),t=Ae()},m(s,o){r.m(s,o),I(s,t,o)},p(s,[o]){i!==(i=n(s))&&(r.d(1),r=i(s),r&&(r.c(),r.m(t.parentNode,t)))},i:ie,o:ie,d(s){s&&L(t),r.d(s)}}}function Dz(e,t,n){let{light:i=!1}=t;return e.$$set=r=>{"light"in r&&n(0,i=r.light)},[i]}class Nz extends ge{constructor(t){super(),pe(this,t,Dz,Fz,he,{light:0})}}function Oz(e){let t,n,i,r,s,o;r=new Nz({});const a=e[1].default,l=ft(a,e,e[0],null);return{c(){t=H("aside"),n=H("div"),i=H("div"),ce(r.$$.fragment),s=je(),l&&l.c(),D(i,"class","logoContainer"),D(t,"class","svelte-1okdv0e")},m(u,c){I(u,t,c),V(t,n),V(n,i),le(r,i,null),V(n,s),l&&l.m(n,null),o=!0},p(u,[c]){l&&l.p&&(!o||c&1)&&ht(l,a,u,u[0],o?dt(a,u[0],c,null):pt(u[0]),null)},i(u){o||(F(r.$$.fragment,u),F(l,u),o=!0)},o(u){N(r.$$.fragment,u),N(l,u),o=!1},d(u){u&&L(t),ue(r),l&&l.d(u)}}}function Rz(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class Lz extends ge{constructor(t){super(),pe(this,t,Rz,Oz,he,{})}}function z5(e){let t,n;return{c(){t=H("td"),n=Oe(e[0]),D(t,"class","idCell svelte-pt8vzv"),D(t,"data-component","artifact-row")},m(i,r){I(i,t,r),V(t,n)},p(i,r){r&1&&at(n,i[0])},d(i){i&&L(t)}}}function Iz(e){let t,n,i,r,s=e[1].data+"",o,a,l=e[0]!==null&&z5(e);return{c(){t=H("tr"),l&&l.c(),n=je(),i=H("td"),r=H("code"),o=Oe(s),D(r,"class","mono"),D(i,"class","codeCell svelte-pt8vzv"),D(i,"colspan",a=e[0]===null?2:1),D(i,"data-component","artifact-row")},m(u,c){I(u,t,c),l&&l.m(t,null),V(t,n),V(t,i),V(i,r),V(r,o),e[3](r)},p(u,[c]){u[0]!==null?l?l.p(u,c):(l=z5(u),l.c(),l.m(t,n)):l&&(l.d(1),l=null),c&2&&s!==(s=u[1].data+"")&&at(o,s),c&1&&a!==(a=u[0]===null?2:1)&&D(i,"colspan",a)},i:ie,o:ie,d(u){u&&L(t),l&&l.d(),e[3](null)}}}function zz(e,t,n){let{id:i}=t,{artifact:r}=t,s;function o(){var l;s&&!s.classList.contains("language-python")&&typeof window<"u"&&((l=window==null?void 0:window.Prism)==null||l.highlightElement(s))}function a(l){Ai[l?"unshift":"push"](()=>{s=l,n(2,s)})}return e.$$set=l=>{"id"in l&&n(0,i=l.id),"artifact"in l&&n(1,r=l.artifact)},e.$$.update=()=>{e.$$.dirty&4&&s&&o()},[i,r,s,a]}class Pz extends ge{constructor(t){super(),pe(this,t,zz,Iz,he,{id:0,artifact:1})}}function P5(e,t,n){const i=e.slice();return i[2]=t[n],i}function B5(e){let t,n;return t=new Pz({props:{id:e[2].name,artifact:e[2]}}),{c(){ce(t.$$.fragment)},m(i,r){le(t,i,r),n=!0},p:ie,i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){ue(t,i)}}}function Bz(e){let t,n,i,r=Re(e[0]),s=[];for(let a=0;aN(s[a],1,1,()=>{s[a]=null});return{c(){t=H("div"),n=H("table");for(let a=0;a{if(s.name&&o.name){if(s.name>o.name)return 1;if(s.name{"componentData"in s&&n(1,i=s.componentData)},[r,i]}class j5 extends ge{constructor(t){super(),pe(this,t,jz,Bz,he,{componentData:1})}}function Uz(e){let t,n,i;return{c(){t=H("div"),n=je(),i=H("div"),D(t,"class","path topLeft svelte-1hyaq5f"),D(i,"class","path bottomRight svelte-1hyaq5f")},m(r,s){I(r,t,s),I(r,n,s),I(r,i,s)},d(r){r&&(L(t),L(n),L(i))}}}function qz(e){let t;return{c(){t=H("div"),D(t,"class","path straightLine svelte-1hyaq5f")},m(n,i){I(n,t,i)},d(n){n&&L(t)}}}function Wz(e){let t;function n(s,o){return s[5]?qz:Uz}let i=n(e),r=i(e);return{c(){t=H("div"),r.c(),D(t,"class","connectorwrapper svelte-1hyaq5f"),ci(t,"top",e[1]+"rem"),ci(t,"left",e[0]+"rem"),ci(t,"width",e[3]+"rem"),ci(t,"height",e[4]+"rem"),Vn(t,"flip",e[2])},m(s,o){I(s,t,o),r.m(t,null)},p(s,[o]){i!==(i=n(s))&&(r.d(1),r=i(s),r&&(r.c(),r.m(t,null))),o&2&&ci(t,"top",s[1]+"rem"),o&1&&ci(t,"left",s[0]+"rem"),o&8&&ci(t,"width",s[3]+"rem"),o&16&&ci(t,"height",s[4]+"rem"),o&4&&Vn(t,"flip",s[2])},i:ie,o:ie,d(s){s&&L(t),r.d()}}}const ca=.5;function Hz(e,t,n){let{top:i=0}=t,{left:r=0}=t,{bottom:s=0}=t,{right:o=0}=t,a,l,u,c=!1;return e.$$set=f=>{"top"in f&&n(1,i=f.top),"left"in f&&n(0,r=f.left),"bottom"in f&&n(7,s=f.bottom),"right"in f&&n(6,o=f.right)},e.$$.update=()=>{e.$$.dirty&207&&(n(2,a=o-r<0),n(3,l=Math.abs(o-r)),l<=ca?(n(3,l=ca),n(5,c=!0),n(0,r-=ca/2)):(a?(n(0,r+=ca/2),n(6,o-=ca/2)):(n(0,r-=ca/2),n(6,o+=ca/2)),n(3,l=Math.abs(o-r))),n(4,u=s-i))},[r,i,a,l,u,c,o,s]}class Gz extends ge{constructor(t){super(),pe(this,t,Hz,Wz,he,{top:1,left:0,bottom:7,right:6})}}function U5(e,t,n){const i=e.slice();return i[4]=t[n],i}function q5(e){let t,n;return t=new Gz({props:{top:eo(e[4].top),left:eo(e[4].left),bottom:eo(e[4].bottom),right:eo(e[4].right)}}),{c(){ce(t.$$.fragment)},m(i,r){le(t,i,r),n=!0},p(i,r){const s={};r&1&&(s.top=eo(i[4].top)),r&1&&(s.left=eo(i[4].left)),r&1&&(s.bottom=eo(i[4].bottom)),r&1&&(s.right=eo(i[4].right)),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){ue(t,i)}}}function Vz(e){let t,n,i=Re(e[0]),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{"steps"in a&&n(1,i=a.steps),"boxes"in a&&n(2,r=a.boxes),"container"in a&&n(3,s=a.container)},e.$$.update=()=>{if(e.$$.dirty&15){n(0,o=[]);const a=s.getBoundingClientRect(),l=a.top,u=a.left;r&&Object.keys(i).forEach(c=>{var h;const f=i[c],d=r[c].getBoundingClientRect();(h=f.next)==null||h.forEach(p=>{const g=r[p].getBoundingClientRect(),m={top:d.bottom-l,left:d.left-u+d.width/2,bottom:g.top-l,right:g.left-u+g.width/2};n(0,o=[...o,m])})})}},[o,i,r,s]}class Yz extends ge{constructor(t){super(),pe(this,t,Xz,Vz,he,{steps:1,boxes:2,container:3})}}const W5="currentStep";function H5(e,t,n){const i=e.slice();return i[16]=t[n],i[18]=n,i}function G5(e){let t,n,i;return{c(){t=H("div"),n=Oe("x"),i=Oe(e[6]),D(t,"class","levelstoshow svelte-117ceti")},m(r,s){I(r,t,s),V(t,n),V(t,i)},p(r,s){s&64&&at(i,r[6])},d(r){r&&L(t)}}}function V5(e){let t,n;return{c(){t=H("div"),D(t,"class",n="level rectangle "+e[16]+" svelte-117ceti"),ci(t,"z-index",(e[18]+1)*-1),ci(t,"top",(e[18]+1)*X5+"px"),ci(t,"left",(e[18]+1)*X5+"px")},m(i,r){I(i,t,r)},p(i,r){r&128&&n!==(n="level rectangle "+i[16]+" svelte-117ceti")&&D(t,"class",n)},d(i){i&&L(t)}}}function Zz(e){let t,n,i,r,s,o,a,l,u=e[2].doc+"",c,f,d,h=e[6]&&G5(e),p=Re(e[7]),g=[];for(let m=0;m1&&(c=new Intl.NumberFormat().format(r.num_possible_tasks)),s=r.num_possible_tasks-1,Object.keys(f).forEach(v=>{const x=Number.parseInt(v);r.num_possible_tasks&&r.num_possible_tasks>x&&n(11,s=f[x])})):s*=Kz,s>0&&(d=new Array(s).fill("")),d=d.map((v,x)=>{if(r.num_possible_tasks){const _=r.num_failed??0,k=r.successful_tasks??0;return(_-1)/r.num_possible_tasks>=(x+1)/d.length?"error":(_+k)/r.num_possible_tasks>=(x+1)/d.length?"success":"running"}return""});const h=D5(W5),p=i===h;r.failed||r.num_failed?l=!0:(r.num_possible_tasks??0)>(r.successful_tasks??0)?u=!0:r.num_possible_tasks&&r.num_possible_tasks===r.successful_tasks&&(a=!0);let g,m=!1;Mc(()=>{n(9,m=Az(g))});function y(v){Ai[v?"unshift":"push"](()=>{g=v,n(8,g)})}function b(v){Ai[v?"unshift":"push"](()=>{o=v,n(0,o)})}return e.$$set=v=>{"name"in v&&n(1,i=v.name),"step"in v&&n(2,r=v.step),"numLevels"in v&&n(11,s=v.numLevels),"el"in v&&n(0,o=v.el)},[o,i,r,a,l,u,c,d,g,m,p,s,y,b]}let Qz=class extends ge{constructor(t){super(),pe(this,t,Jz,Zz,he,{name:1,step:2,numLevels:11,el:0})}};function Y5(e,t,n){const i=e.slice();return i[10]=t[n],i}function eP(e){let t,n,i,r,s,o;function a(f){e[8](f)}let l={name:e[2],numLevels:e[3],step:e[5]};e[4]!==void 0&&(l.el=e[4]),n=new Qz({props:l}),Ai.push(()=>Gm(n,"el",a));let u=e[7]&&tP(e),c=e[5].box_ends&&nP(e);return{c(){t=H("div"),ce(n.$$.fragment),r=je(),u&&u.c(),s=je(),c&&c.c(),D(t,"class","stepwrapper svelte-18aex7a")},m(f,d){I(f,t,d),le(n,t,null),V(t,r),u&&u.m(t,null),V(t,s),c&&c.m(t,null),o=!0},p(f,d){const h={};d&4&&(h.name=f[2]),d&8&&(h.numLevels=f[3]),!i&&d&16&&(i=!0,h.el=f[4],Wm(()=>i=!1)),n.$set(h),f[7]&&u.p(f,d),f[5].box_ends&&c.p(f,d)},i(f){o||(F(n.$$.fragment,f),F(u),F(c),o=!0)},o(f){N(n.$$.fragment,f),N(u),N(c),o=!1},d(f){f&&L(t),ue(n),u&&u.d(),c&&c.d()}}}function tP(e){let t,n,i,r,s=Re(e[5].next),o=[];for(let l=0;lN(o[l],1,1,()=>{o[l]=null});return{c(){t=H("div"),n=je(),i=H("div");for(let l=0;l{a&&n(0,o[r]=a,o)});let u=i[r];u||console.warn("step ",r," not found");const c=(u==null?void 0:u.type)==="foreach"?s+1:(u==null?void 0:u.type)==="join"?s-1:s;let f=(h=u==null?void 0:u.next)==null?void 0:h.find(p=>{var g;return((g=i[p])==null?void 0:g.type)!=="join"});function d(p){a=p,n(4,a)}return e.$$set=p=>{"steps"in p&&n(1,i=p.steps),"stepName"in p&&n(2,r=p.stepName),"levels"in p&&n(3,s=p.levels),"boxes"in p&&n(0,o=p.boxes)},[o,i,r,s,a,u,c,f,d]}class Vm extends ge{constructor(t){super(),pe(this,t,rP,iP,he,{steps:1,stepName:2,levels:3,boxes:0})}}function sP(e){let t;return{c(){t=H("p"),t.textContent="No start step"},m(n,i){I(n,t,i)},p:ie,i:ie,o:ie,d(n){n&&L(t)}}}function oP(e){let t,n,i;function r(o){e[6](o)}let s={steps:e[3],stepName:"start"};return e[0]!==void 0&&(s.boxes=e[0]),t=new Vm({props:s}),Ai.push(()=>Gm(t,"boxes",r)),{c(){ce(t.$$.fragment)},m(o,a){le(t,o,a),i=!0},p(o,a){const l={};!n&&a&1&&(n=!0,l.boxes=o[0],Wm(()=>n=!1)),t.$set(l)},i(o){i||(F(t.$$.fragment,o),i=!0)},o(o){N(t.$$.fragment,o),i=!1},d(o){ue(t,o)}}}function K5(e){let t,n;return t=new Yz({props:{boxes:e[0],steps:e[3],container:e[1]}}),{c(){ce(t.$$.fragment)},m(i,r){le(t,i,r),n=!0},p(i,r){const s={};r&1&&(s.boxes=i[0]),r&2&&(s.container=i[1]),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){ue(t,i)}}}function aP(e){let t,n,i,r,s=!e[2]&&Object.keys(e[0]).length,o,a,l;const u=[oP,sP],c=[];function f(h,p){var g;return(g=h[3])!=null&&g.start?0:1}n=f(e),i=c[n]=u[n](e);let d=s&&K5(e);return{c(){t=H("div"),i.c(),r=je(),d&&d.c(),ci(t,"position","relative"),ci(t,"line-height","1"),D(t,"data-component","dag")},m(h,p){I(h,t,p),c[n].m(t,null),V(t,r),d&&d.m(t,null),e[7](t),o=!0,a||(l=Il(window,"resize",e[4]),a=!0)},p(h,[p]){i.p(h,p),p&5&&(s=!h[2]&&Object.keys(h[0]).length),s?d?(d.p(h,p),p&5&&F(d,1)):(d=K5(h),d.c(),F(d,1),d.m(t,null)):d&&($e(),N(d,1,1,()=>{d=null}),Ee())},i(h){o||(F(i),F(d),o=!0)},o(h){N(i),N(d),o=!1},d(h){h&&L(t),c[n].d(),d&&d.d(),e[7](null),a=!1,l()}}}const lP=100;function uP(e,t,n){var h;let i;_h(e,ua,p=>n(9,i=p));let{componentData:r}=t;const{data:s}=r;let o={},a;F5(W5,Sz((h=i==null?void 0:i.metadata)==null?void 0:h.pathspec,"stepname"));let l,u=!1;const c=()=>{n(2,u=!0),clearTimeout(l),l=setTimeout(()=>{n(2,u=!1)},lP)};function f(p){o=p,n(0,o)}function d(p){Ai[p?"unshift":"push"](()=>{a=p,n(1,a)})}return e.$$set=p=>{"componentData"in p&&n(5,r=p.componentData)},[o,a,u,s,c,r,f,d]}class J5 extends ge{constructor(t){super(),pe(this,t,uP,aP,he,{componentData:5})}}function cP(e){var r;let t,n=(((r=e[0])==null?void 0:r.text)||"")+"",i;return{c(){t=H("h2"),i=Oe(n),D(t,"class","title svelte-117s0ws"),D(t,"data-component","title")},m(s,o){I(s,t,o),V(t,i)},p(s,[o]){var a;o&1&&n!==(n=(((a=s[0])==null?void 0:a.text)||"")+"")&&at(i,n)},i:ie,o:ie,d(s){s&&L(t)}}}function fP(e,t,n){let{componentData:i}=t;return e.$$set=r=>{"componentData"in r&&n(0,i=r.componentData)},[i]}class Q5 extends ge{constructor(t){super(),pe(this,t,fP,cP,he,{componentData:0})}}function dP(e){var r;let t,n=(((r=e[0])==null?void 0:r.text)||"")+"",i;return{c(){t=H("p"),i=Oe(n),D(t,"class","subtitle svelte-lu9pnn"),D(t,"data-component","subtitle")},m(s,o){I(s,t,o),V(t,i)},p(s,[o]){var a;o&1&&n!==(n=(((a=s[0])==null?void 0:a.text)||"")+"")&&at(i,n)},i:ie,o:ie,d(s){s&&L(t)}}}function hP(e,t,n){let{componentData:i}=t;return e.$$set=r=>{"componentData"in r&&n(0,i=r.componentData)},[i]}class e6 extends ge{constructor(t){super(),pe(this,t,hP,dP,he,{componentData:0})}}function t6(e){let t,n;return t=new Q5({props:{componentData:{type:"title",text:e[1]}}}),{c(){ce(t.$$.fragment)},m(i,r){le(t,i,r),n=!0},p(i,r){const s={};r&2&&(s.componentData={type:"title",text:i[1]}),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){ue(t,i)}}}function n6(e){let t,n;return t=new e6({props:{componentData:{type:"subtitle",text:e[0]}}}),{c(){ce(t.$$.fragment)},m(i,r){le(t,i,r),n=!0},p(i,r){const s={};r&1&&(s.componentData={type:"subtitle",text:i[0]}),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){ue(t,i)}}}function pP(e){let t,n,i,r=e[1]&&t6(e),s=e[0]&&n6(e);return{c(){t=H("header"),r&&r.c(),n=je(),s&&s.c(),D(t,"class","container svelte-1ugmt5d"),D(t,"data-component","heading")},m(o,a){I(o,t,a),r&&r.m(t,null),V(t,n),s&&s.m(t,null),i=!0},p(o,[a]){o[1]?r?(r.p(o,a),a&2&&F(r,1)):(r=t6(o),r.c(),F(r,1),r.m(t,n)):r&&($e(),N(r,1,1,()=>{r=null}),Ee()),o[0]?s?(s.p(o,a),a&1&&F(s,1)):(s=n6(o),s.c(),F(s,1),s.m(t,null)):s&&($e(),N(s,1,1,()=>{s=null}),Ee())},i(o){i||(F(r),F(s),i=!0)},o(o){N(r),N(s),i=!1},d(o){o&&L(t),r&&r.d(),s&&s.d()}}}function gP(e,t,n){let i,r,{componentData:s}=t;return e.$$set=o=>{"componentData"in o&&n(2,s=o.componentData)},e.$$.update=()=>{e.$$.dirty&4&&n(1,{title:i,subtitle:r}=s,i,(n(0,r),n(2,s)))},[r,i,s]}let i6=class extends ge{constructor(t){super(),pe(this,t,gP,pP,he,{componentData:2})}};function r6(e){let t,n;return{c(){t=H("div"),n=Oe(e[2]),D(t,"class","label svelte-1x96yvr")},m(i,r){I(i,t,r),V(t,n)},p(i,r){r&4&&at(n,i[2])},d(i){i&&L(t)}}}function s6(e){let t,n;return{c(){t=H("figcaption"),n=Oe(e[1]),D(t,"class","description svelte-1x96yvr")},m(i,r){I(i,t,r),V(t,n)},p(i,r){r&2&&at(n,i[1])},d(i){i&&L(t)}}}function mP(e){let t,n,i,r,s,o,a,l,u,c=e[2]&&r6(e),f=e[1]&&s6(e);return{c(){t=H("figure"),n=H("div"),i=H("img"),o=je(),c&&c.c(),a=je(),f&&f.c(),xh(i.src,r=e[3])||D(i,"src",r),D(i,"alt",s=e[2]||"image"),D(i,"class","svelte-1x96yvr"),D(n,"class","imageContainer"),D(t,"data-component","image"),D(t,"class","svelte-1x96yvr")},m(d,h){I(d,t,h),V(t,n),V(n,i),V(t,o),c&&c.m(t,null),V(t,a),f&&f.m(t,null),l||(u=Il(t,"click",e[4]),l=!0)},p(d,[h]){h&8&&!xh(i.src,r=d[3])&&D(i,"src",r),h&4&&s!==(s=d[2]||"image")&&D(i,"alt",s),d[2]?c?c.p(d,h):(c=r6(d),c.c(),c.m(t,a)):c&&(c.d(1),c=null),d[1]?f?f.p(d,h):(f=s6(d),f.c(),f.m(t,null)):f&&(f.d(1),f=null)},i:ie,o:ie,d(d){d&&L(t),c&&c.d(),f&&f.d(),l=!1,u()}}}function yP(e,t,n){let i,r,s,{componentData:o}=t;const a=()=>Fc.set(o);return e.$$set=l=>{"componentData"in l&&n(0,o=l.componentData)},e.$$.update=()=>{e.$$.dirty&1&&n(3,{src:i,label:r,description:s}=o,i,(n(2,r),n(0,o)),(n(1,s),n(0,o)))},[o,s,r,i,a]}let o6=class extends ge{constructor(t){super(),pe(this,t,yP,mP,he,{componentData:0})}};function bP(e){let t,n,i,r,s=e[0].data+"",o,a,l;return{c(){t=H("pre"),n=Oe(` + `),i=H("code"),r=Oe(` + `),o=Oe(s),a=Oe(` + `),l=Oe(` +`),D(i,"class","mono language-log"),D(t,"class","log svelte-1jhmsu"),D(t,"data-component","log")},m(u,c){I(u,t,c),V(t,n),V(t,i),V(i,r),V(i,o),V(i,a),e[2](i),V(t,l)},p(u,[c]){c&1&&s!==(s=u[0].data+"")&&at(o,s)},i:ie,o:ie,d(u){u&&L(t),e[2](null)}}}function vP(e,t,n){let{componentData:i}=t,r;function s(){var a;r&&((a=window==null?void 0:window.Prism)==null||a.highlightElement(r))}function o(a){Ai[a?"unshift":"push"](()=>{r=a,n(1,r)})}return e.$$set=a=>{"componentData"in a&&n(0,i=a.componentData)},e.$$.update=()=>{e.$$.dirty&2&&r&&s()},[i,r,o]}let a6=class extends ge{constructor(t){super(),pe(this,t,vP,bP,he,{componentData:0})}};function xP(){const e=console.warn;console.warn=t=>{t.includes("unknown prop")||t.includes("unexpected slot")||e(t)},Mc(()=>{console.warn=e})}function l6(e,t,n){const i=e.slice();return i[18]=t[n],i}function u6(e,t,n){const i=e.slice();return i[18]=t[n],i}function c6(e,t,n){const i=e.slice();return i[10]=t[n],i}function f6(e,t,n){const i=e.slice();return i[13]=t[n],i[15]=n,i}function d6(e,t,n){const i=e.slice();return i[16]=t[n],i[15]=n,i}function h6(e,t,n){const i=e.slice();return i[7]=t[n],i}function _P(e){let t,n,i,r;const s=[EP,$P,kP],o=[];function a(l,u){return l[0]==="table"?0:l[0]==="list"?1:2}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Ae()},m(l,u){o[t].m(l,u),I(l,i,u),r=!0},p(l,u){let c=t;t=a(l),t===c?o[t].p(l,u):($e(),N(o[c],1,1,()=>{o[c]=null}),Ee(),n=o[t],n?n.p(l,u):(n=o[t]=s[t](l),n.c()),F(n,1),n.m(i.parentNode,i))},i(l){r||(F(n),r=!0)},o(l){N(n),r=!1},d(l){l&&L(i),o[t].d(l)}}}function wP(e){let t,n,i=Re(e[1]),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{ue(u,1)}),Ee()}s?(t=Ye(s,o(a,l)),ce(t.$$.fragment),F(t.$$.fragment,1),le(t,n.parentNode,n)):t=null}else if(s){const u=l&64?fi(r,[Yi(a[6])]):{};l&8388706&&(u.$$scope={dirty:l,ctx:a}),t.$set(u)}},i(a){i||(t&&F(t.$$.fragment,a),i=!0)},o(a){t&&N(t.$$.fragment,a),i=!1},d(a){a&&L(n),t&&ue(t,a)}}}function $P(e){let t,n,i,r;const s=[MP,TP],o=[];function a(l,u){return l[4]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Ae()},m(l,u){o[t].m(l,u),I(l,i,u),r=!0},p(l,u){let c=t;t=a(l),t===c?o[t].p(l,u):($e(),N(o[c],1,1,()=>{o[c]=null}),Ee(),n=o[t],n?n.p(l,u):(n=o[t]=s[t](l),n.c()),F(n,1),n.m(i.parentNode,i))},i(l){r||(F(n),r=!0)},o(l){N(n),r=!1},d(l){l&&L(i),o[t].d(l)}}}function EP(e){let t,n,i;var r=e[5].table;function s(o,a){return{props:{$$slots:{default:[jP]},$$scope:{ctx:o}}}}return r&&(t=Ye(r,s(e))),{c(){t&&ce(t.$$.fragment),n=Ae()},m(o,a){t&&le(t,o,a),I(o,n,a),i=!0},p(o,a){if(a&32&&r!==(r=o[5].table)){if(t){$e();const l=t;N(l.$$.fragment,1,0,()=>{ue(l,1)}),Ee()}r?(t=Ye(r,s(o)),ce(t.$$.fragment),F(t.$$.fragment,1),le(t,n.parentNode,n)):t=null}else if(r){const l={};a&8388716&&(l.$$scope={dirty:a,ctx:o}),t.$set(l)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&ue(t,o)}}}function CP(e){let t=e[6].raw+"",n;return{c(){n=Oe(t)},m(i,r){I(i,n,r)},p(i,r){r&64&&t!==(t=i[6].raw+"")&&at(n,t)},i:ie,o:ie,d(i){i&&L(n)}}}function SP(e){let t,n;return t=new fa({props:{tokens:e[1],renderers:e[5]}}),{c(){ce(t.$$.fragment)},m(i,r){le(t,i,r),n=!0},p(i,r){const s={};r&2&&(s.tokens=i[1]),r&32&&(s.renderers=i[5]),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){ue(t,i)}}}function AP(e){let t,n,i,r;const s=[SP,CP],o=[];function a(l,u){return l[1]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Ae()},m(l,u){o[t].m(l,u),I(l,i,u),r=!0},p(l,u){let c=t;t=a(l),t===c?o[t].p(l,u):($e(),N(o[c],1,1,()=>{o[c]=null}),Ee(),n=o[t],n?n.p(l,u):(n=o[t]=s[t](l),n.c()),F(n,1),n.m(i.parentNode,i))},i(l){r||(F(n),r=!0)},o(l){N(n),r=!1},d(l){l&&L(i),o[t].d(l)}}}function TP(e){let t,n,i;const r=[{ordered:e[4]},e[6]];var s=e[5].list;function o(a,l){let u={$$slots:{default:[DP]},$$scope:{ctx:a}};if(l!==void 0&&l&80)u=fi(r,[l&16&&{ordered:a[4]},l&64&&Yi(a[6])]);else for(let c=0;c{ue(u,1)}),Ee()}s?(t=Ye(s,o(a,l)),ce(t.$$.fragment),F(t.$$.fragment,1),le(t,n.parentNode,n)):t=null}else if(s){const u=l&80?fi(r,[l&16&&{ordered:a[4]},l&64&&Yi(a[6])]):{};l&8388704&&(u.$$scope={dirty:l,ctx:a}),t.$set(u)}},i(a){i||(t&&F(t.$$.fragment,a),i=!0)},o(a){t&&N(t.$$.fragment,a),i=!1},d(a){a&&L(n),t&&ue(t,a)}}}function MP(e){let t,n,i;const r=[{ordered:e[4]},e[6]];var s=e[5].list;function o(a,l){let u={$$slots:{default:[OP]},$$scope:{ctx:a}};if(l!==void 0&&l&80)u=fi(r,[l&16&&{ordered:a[4]},l&64&&Yi(a[6])]);else for(let c=0;c{ue(u,1)}),Ee()}s?(t=Ye(s,o(a,l)),ce(t.$$.fragment),F(t.$$.fragment,1),le(t,n.parentNode,n)):t=null}else if(s){const u=l&80?fi(r,[l&16&&{ordered:a[4]},l&64&&Yi(a[6])]):{};l&8388704&&(u.$$scope={dirty:l,ctx:a}),t.$set(u)}},i(a){i||(t&&F(t.$$.fragment,a),i=!0)},o(a){t&&N(t.$$.fragment,a),i=!1},d(a){a&&L(n),t&&ue(t,a)}}}function FP(e){let t,n,i;return t=new fa({props:{tokens:e[18].tokens,renderers:e[5]}}),{c(){ce(t.$$.fragment),n=je()},m(r,s){le(t,r,s),I(r,n,s),i=!0},p(r,s){const o={};s&64&&(o.tokens=r[18].tokens),s&32&&(o.renderers=r[5]),t.$set(o)},i(r){i||(F(t.$$.fragment,r),i=!0)},o(r){N(t.$$.fragment,r),i=!1},d(r){r&&L(n),ue(t,r)}}}function p6(e){let t,n,i;const r=[e[18]];var s=e[5].unorderedlistitem||e[5].listitem;function o(a,l){let u={$$slots:{default:[FP]},$$scope:{ctx:a}};if(l!==void 0&&l&64)u=fi(r,[Yi(a[18])]);else for(let c=0;c{ue(u,1)}),Ee()}s?(t=Ye(s,o(a,l)),ce(t.$$.fragment),F(t.$$.fragment,1),le(t,n.parentNode,n)):t=null}else if(s){const u=l&64?fi(r,[Yi(a[18])]):{};l&8388704&&(u.$$scope={dirty:l,ctx:a}),t.$set(u)}},i(a){i||(t&&F(t.$$.fragment,a),i=!0)},o(a){t&&N(t.$$.fragment,a),i=!1},d(a){a&&L(n),t&&ue(t,a)}}}function DP(e){let t,n,i=Re(e[6].items),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{ue(u,1)}),Ee()}s?(t=Ye(s,o(a,l)),ce(t.$$.fragment),F(t.$$.fragment,1),le(t,n.parentNode,n)):t=null}else if(s){const u=l&64?fi(r,[Yi(a[18])]):{};l&8388704&&(u.$$scope={dirty:l,ctx:a}),t.$set(u)}},i(a){i||(t&&F(t.$$.fragment,a),i=!0)},o(a){t&&N(t.$$.fragment,a),i=!1},d(a){a&&L(n),t&&ue(t,a)}}}function OP(e){let t,n,i=Re(e[6].items),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{ue(l,1)}),Ee()}r?(t=Ye(r,s(o)),ce(t.$$.fragment),F(t.$$.fragment,1),le(t,n.parentNode,n)):t=null}else if(r){const l={};a&64&&(l.align=o[6].align[o[15]]||"center"),a&8388644&&(l.$$scope={dirty:a,ctx:o}),t.$set(l)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&ue(t,o)}}}function LP(e){let t,n,i=Re(e[2]),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{ue(l,1)}),Ee()}r?(t=Ye(r,s(o)),ce(t.$$.fragment),F(t.$$.fragment,1),le(t,n.parentNode,n)):t=null}else if(r){const l={};a&8388708&&(l.$$scope={dirty:a,ctx:o}),t.$set(l)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&ue(t,o)}}}function zP(e){let t,n;return t=new fa({props:{tokens:e[13].tokens,renderers:e[5]}}),{c(){ce(t.$$.fragment)},m(i,r){le(t,i,r),n=!0},p(i,r){const s={};r&8&&(s.tokens=i[13].tokens),r&32&&(s.renderers=i[5]),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){ue(t,i)}}}function y6(e){let t,n,i;var r=e[5].tablecell;function s(o,a){return{props:{header:!1,align:o[6].align[o[15]]||"center",$$slots:{default:[zP]},$$scope:{ctx:o}}}}return r&&(t=Ye(r,s(e))),{c(){t&&ce(t.$$.fragment),n=Ae()},m(o,a){t&&le(t,o,a),I(o,n,a),i=!0},p(o,a){if(a&32&&r!==(r=o[5].tablecell)){if(t){$e();const l=t;N(l.$$.fragment,1,0,()=>{ue(l,1)}),Ee()}r?(t=Ye(r,s(o)),ce(t.$$.fragment),F(t.$$.fragment,1),le(t,n.parentNode,n)):t=null}else if(r){const l={};a&64&&(l.align=o[6].align[o[15]]||"center"),a&8388648&&(l.$$scope={dirty:a,ctx:o}),t.$set(l)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&ue(t,o)}}}function PP(e){let t,n,i=Re(e[10]),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{ue(l,1)}),Ee()}r?(t=Ye(r,s(o)),ce(t.$$.fragment),F(t.$$.fragment,1),le(t,n.parentNode,n)):t=null}else if(r){const l={};a&8388712&&(l.$$scope={dirty:a,ctx:o}),t.$set(l)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&ue(t,o)}}}function BP(e){let t,n,i=Re(e[3]),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{ue(d,1)}),Ee()}o?(t=Ye(o,a(c)),ce(t.$$.fragment),F(t.$$.fragment,1),le(t,n.parentNode,n)):t=null}else if(o){const d={};f&8388708&&(d.$$scope={dirty:f,ctx:c}),t.$set(d)}if(f&32&&l!==(l=c[5].tablebody)){if(i){$e();const d=i;N(d.$$.fragment,1,0,()=>{ue(d,1)}),Ee()}l?(i=Ye(l,u(c)),ce(i.$$.fragment),F(i.$$.fragment,1),le(i,r.parentNode,r)):i=null}else if(l){const d={};f&8388712&&(d.$$scope={dirty:f,ctx:c}),i.$set(d)}},i(c){s||(t&&F(t.$$.fragment,c),i&&F(i.$$.fragment,c),s=!0)},o(c){t&&N(t.$$.fragment,c),i&&N(i.$$.fragment,c),s=!1},d(c){c&&(L(n),L(r)),t&&ue(t,c),i&&ue(i,c)}}}function v6(e){let t,n;const i=[e[7],{renderers:e[5]}];let r={};for(let s=0;s{o[c]=null}),Ee()),~t?(n=o[t],n?n.p(l,u):(n=o[t]=s[t](l),n.c()),F(n,1),n.m(i.parentNode,i)):n=null)},i(l){r||(F(n),r=!0)},o(l){N(n),r=!1},d(l){l&&L(i),~t&&o[t].d(l)}}}function qP(e,t,n){const i=["type","tokens","header","rows","ordered","renderers"];let r=S5(t,i),{type:s=void 0}=t,{tokens:o=void 0}=t,{header:a=void 0}=t,{rows:l=void 0}=t,{ordered:u=!1}=t,{renderers:c}=t;return xP(),e.$$set=f=>{t=Ge(Ge({},t),Pm(f)),n(6,r=S5(t,i)),"type"in f&&n(0,s=f.type),"tokens"in f&&n(1,o=f.tokens),"header"in f&&n(2,a=f.header),"rows"in f&&n(3,l=f.rows),"ordered"in f&&n(4,u=f.ordered),"renderers"in f&&n(5,c=f.renderers)},[s,o,a,l,u,c,r]}let fa=class extends ge{constructor(t){super(),pe(this,t,qP,UP,he,{type:0,tokens:1,header:2,rows:3,ordered:4,renderers:5})}};function Xm(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let to=Xm();function x6(e){to=e}const _6=/[&<>"']/,WP=new RegExp(_6.source,"g"),w6=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,HP=new RegExp(w6.source,"g"),GP={"&":"&","<":"<",">":">",'"':""","'":"'"},k6=e=>GP[e];function cn(e,t){if(t){if(_6.test(e))return e.replace(WP,k6)}else if(w6.test(e))return e.replace(HP,k6);return e}const VP=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function $6(e){return e.replace(VP,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const XP=/(^|[^\[])\^/g;function tt(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(i,r)=>(r=r.source||r,r=r.replace(XP,"$1"),e=e.replace(i,r),n),getRegex:()=>new RegExp(e,t)};return n}const YP=/[^\w:]/g,ZP=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function E6(e,t,n){if(e){let i;try{i=decodeURIComponent($6(n)).replace(YP,"").toLowerCase()}catch{return null}if(i.indexOf("javascript:")===0||i.indexOf("vbscript:")===0||i.indexOf("data:")===0)return null}t&&!ZP.test(n)&&(n=eB(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const kh={},KP=/^[^:]+:\/*[^/]*$/,JP=/^([^:]+:)[\s\S]*$/,QP=/^([^:]+:\/*[^/]*)[\s\S]*$/;function eB(e,t){kh[" "+e]||(KP.test(e)?kh[" "+e]=e+"/":kh[" "+e]=Eh(e,"/",!0)),e=kh[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(JP,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(QP,"$1")+t:e+t}const $h={exec:function(){}};function C6(e,t){const n=e.replace(/\|/g,(s,o,a)=>{let l=!1,u=o;for(;--u>=0&&a[u]==="\\";)l=!l;return l?"|":" |"}),i=n.split(/ \|/);let r=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),i.length>t)i.splice(t);else for(;i.length{const s=r.match(/^\s+/);if(s===null)return r;const[o]=s;return o.length>=i.length?r.slice(i.length):r}).join(` `)}class Ch{constructor(t){this.options=t||to}space(t){const n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){const n=this.rules.block.code.exec(t);if(n){const i=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?i:Eh(i,` -`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const i=n[0],r=nB(i,n[3]||"");return{type:"code",raw:i,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:r}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let i=n[2].trim();if(/#$/.test(i)){const r=Eh(i,"#");(this.options.pedantic||!r||/ $/.test(r))&&(i=r.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:n[0]}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){const i=n[0].replace(/^ *>[ \t]?/gm,""),r=this.lexer.state.top;this.lexer.state.top=!0;const s=this.lexer.blockTokens(i);return this.lexer.state.top=r,{type:"blockquote",raw:n[0],tokens:s,text:i}}}list(t){let n=this.rules.block.list.exec(t);if(n){let i,r,s,o,a,l,u,c,f,d,h,p,g=n[1].trim();const m=g.length>1,y={type:"list",raw:"",ordered:m,start:m?+g.slice(0,-1):"",loose:!1,items:[]};g=m?`\\d{1,9}\\${g.slice(-1)}`:`\\${g}`,this.options.pedantic&&(g=m?g:"[*+-]");const b=new RegExp(`^( {0,3}${g})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(p=!1,!(!(n=b.exec(t))||this.rules.block.hr.test(t)));){if(i=n[0],t=t.substring(i.length),c=n[2].split(` +`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const i=n[0],r=iB(i,n[3]||"");return{type:"code",raw:i,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:r}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let i=n[2].trim();if(/#$/.test(i)){const r=Eh(i,"#");(this.options.pedantic||!r||/ $/.test(r))&&(i=r.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:n[0]}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){const i=n[0].replace(/^ *>[ \t]?/gm,""),r=this.lexer.state.top;this.lexer.state.top=!0;const s=this.lexer.blockTokens(i);return this.lexer.state.top=r,{type:"blockquote",raw:n[0],tokens:s,text:i}}}list(t){let n=this.rules.block.list.exec(t);if(n){let i,r,s,o,a,l,u,c,f,d,h,p,g=n[1].trim();const m=g.length>1,y={type:"list",raw:"",ordered:m,start:m?+g.slice(0,-1):"",loose:!1,items:[]};g=m?`\\d{1,9}\\${g.slice(-1)}`:`\\${g}`,this.options.pedantic&&(g=m?g:"[*+-]");const b=new RegExp(`^( {0,3}${g})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(p=!1,!(!(n=b.exec(t))||this.rules.block.hr.test(t)));){if(i=n[0],t=t.substring(i.length),c=n[2].split(` `,1)[0].replace(/^\t+/,x=>" ".repeat(3*x.length)),f=t.split(` `,1)[0],this.options.pedantic?(o=2,h=c.trimLeft()):(o=n[2].search(/[^ ]/),o=o>4?1:o,h=c.slice(o),o+=n[1].length),l=!1,!c&&/^ *$/.test(f)&&(i+=f+` `,t=t.substring(f.length+1),p=!0),!p){const x=new RegExp(`^ {0,${Math.min(3,o-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),_=new RegExp(`^ {0,${Math.min(3,o-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),k=new RegExp(`^ {0,${Math.min(3,o-1)}}(?:\`\`\`|~~~)`),w=new RegExp(`^ {0,${Math.min(3,o-1)}}#`);for(;t&&(d=t.split(` @@ -14,8 +14,8 @@ `+f}!l&&!f.trim()&&(l=!0),i+=d+` `,t=t.substring(d.length+1),c=f.slice(o)}}y.loose||(u?y.loose=!0:/\n *\n *$/.test(i)&&(u=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(h),r&&(s=r[0]!=="[ ] ",h=h.replace(/^\[[ xX]\] +/,""))),y.items.push({type:"list_item",raw:i,task:!!r,checked:s,loose:!1,text:h}),y.raw+=i}y.items[y.items.length-1].raw=i.trimRight(),y.items[y.items.length-1].text=h.trimRight(),y.raw=y.raw.trimRight();const v=y.items.length;for(a=0;ak.type==="space"),_=x.length>0&&x.some(k=>/\n.*\n/.test(k.raw));y.loose=_}if(y.loose)for(a=0;a$/,"$1").replace(this.rules.inline._escapes,"$1"):"",s=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline._escapes,"$1"):n[3];return{type:"def",tag:i,raw:n[0],href:r,title:s}}}table(t){const n=this.rules.block.table.exec(t);if(n){const i={type:"table",header:C6(n[1]).map(r=>({text:r})),align:n[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:n[3]&&n[3].trim()?n[3].replace(/\n[ \t]*$/,"").split(` `):[]};if(i.header.length===i.align.length){i.raw=n[0];let r=i.align.length,s,o,a,l;for(s=0;s({text:u}));for(r=i.header.length,o=0;o/i.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):cn(n[0]):n[0]}}link(t){const n=this.rules.inline.link.exec(t);if(n){const i=n[2].trim();if(!this.options.pedantic&&/^$/.test(i))return;const o=Eh(i.slice(0,-1),"\\");if((i.length-o.length)%2===0)return}else{const o=eB(n[2],"()");if(o>-1){const l=(n[0].indexOf("!")===0?5:4)+n[1].length+o;n[2]=n[2].substring(0,o),n[0]=n[0].substring(0,l).trim(),n[3]=""}}let r=n[2],s="";if(this.options.pedantic){const o=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);o&&(r=o[1],s=o[3])}else s=n[3]?n[3].slice(1,-1):"";return r=r.trim(),/^$/.test(i)?r=r.slice(1):r=r.slice(1,-1)),S6(n,{href:r&&r.replace(this.rules.inline._escapes,"$1"),title:s&&s.replace(this.rules.inline._escapes,"$1")},n[0],this.lexer)}}reflink(t,n){let i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){let r=(i[2]||i[1]).replace(/\s+/g," ");if(r=n[r.toLowerCase()],!r){const s=i[0].charAt(0);return{type:"text",raw:s,text:s}}return S6(i,r,i[0],this.lexer)}}emStrong(t,n,i=""){let r=this.rules.inline.emStrong.lDelim.exec(t);if(!r||r[3]&&i.match(/[\p{L}\p{N}]/u))return;if(!(r[1]||r[2]||"")||!i||this.rules.inline.punctuation.exec(i)){const o=r[0].length-1;let a,l,u=o,c=0;const f=r[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(f.lastIndex=0,n=n.slice(-1*t.length+o);(r=f.exec(n))!=null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(l=a.length,r[3]||r[4]){u+=l;continue}else if((r[5]||r[6])&&o%3&&!((o+l)%3)){c+=l;continue}if(u-=l,u>0)continue;l=Math.min(l,l+u+c);const d=t.slice(0,o+r.index+l+1);if(Math.min(o,l)%2){const p=d.slice(1,-1);return{type:"em",raw:d,text:p,tokens:this.lexer.inlineTokens(p)}}const h=d.slice(2,-2);return{type:"strong",raw:d,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(t){const n=this.rules.inline.code.exec(t);if(n){let i=n[2].replace(/\n/g," ");const r=/[^ ]/.test(i),s=/^ /.test(i)&&/ $/.test(i);return r&&s&&(i=i.substring(1,i.length-1)),i=cn(i,!0),{type:"codespan",raw:n[0],text:i}}}br(t){const n=this.rules.inline.br.exec(t);if(n)return{type:"br",raw:n[0]}}del(t){const n=this.rules.inline.del.exec(t);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(t,n){const i=this.rules.inline.autolink.exec(t);if(i){let r,s;return i[2]==="@"?(r=cn(this.options.mangle?n(i[1]):i[1]),s="mailto:"+r):(r=cn(i[1]),s=r),{type:"link",raw:i[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}url(t,n){let i;if(i=this.rules.inline.url.exec(t)){let r,s;if(i[2]==="@")r=cn(this.options.mangle?n(i[0]):i[0]),s="mailto:"+r;else{let o;do o=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0];while(o!==i[0]);r=cn(i[0]),i[1]==="www."?s="http://"+i[0]:s=i[0]}return{type:"link",raw:i[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t,n){const i=this.rules.inline.text.exec(t);if(i){let r;return this.lexer.state.inRawBlock?r=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):cn(i[0]):i[0]:r=cn(this.options.smartypants?n(i[0]):i[0]),{type:"text",raw:i[0],text:r}}}}const xe={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:$h,lheading:/^((?:(?!^bull ).|\n(?!\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};xe._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/,xe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,xe.def=tt(xe.def).replace("label",xe._label).replace("title",xe._title).getRegex(),xe.bullet=/(?:[*+-]|\d{1,9}[.)])/,xe.listItemStart=tt(/^( *)(bull) */).replace("bull",xe.bullet).getRegex(),xe.list=tt(xe.list).replace(/bull/g,xe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+xe.def.source+")").getRegex(),xe._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",xe._comment=/|$)/,xe.html=tt(xe.html,"i").replace("comment",xe._comment).replace("tag",xe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),xe.lheading=tt(xe.lheading).replace(/bull/g,xe.bullet).getRegex(),xe.paragraph=tt(xe._paragraph).replace("hr",xe.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",xe._tag).getRegex(),xe.blockquote=tt(xe.blockquote).replace("paragraph",xe.paragraph).getRegex(),xe.normal={...xe},xe.gfm={...xe.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},xe.gfm.table=tt(xe.gfm.table).replace("hr",xe.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",xe._tag).getRegex(),xe.gfm.paragraph=tt(xe._paragraph).replace("hr",xe.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",xe.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",xe._tag).getRegex(),xe.pedantic={...xe.normal,html:tt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",xe._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:$h,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:tt(xe.normal._paragraph).replace("hr",xe.hr).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",xe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const oe={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:$h,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,rDelimAst:/^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:$h,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`^|~",oe.punctuation=tt(oe.punctuation,"u").replace(/punctuation/g,oe._punctuation).getRegex(),oe.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,oe.anyPunctuation=/\\[punct]/g,oe._escapes=/\\([punct])/g,oe._comment=tt(xe._comment).replace("(?:-->|$)","-->").getRegex(),oe.emStrong.lDelim=tt(oe.emStrong.lDelim,"u").replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimAst=tt(oe.emStrong.rDelimAst,"gu").replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimUnd=tt(oe.emStrong.rDelimUnd,"gu").replace(/punct/g,oe._punctuation).getRegex(),oe.anyPunctuation=tt(oe.anyPunctuation,"gu").replace(/punct/g,oe._punctuation).getRegex(),oe._escapes=tt(oe._escapes,"gu").replace(/punct/g,oe._punctuation).getRegex(),oe._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,oe._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,oe.autolink=tt(oe.autolink).replace("scheme",oe._scheme).replace("email",oe._email).getRegex(),oe._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,oe.tag=tt(oe.tag).replace("comment",oe._comment).replace("attribute",oe._attribute).getRegex(),oe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,oe._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,oe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,oe.link=tt(oe.link).replace("label",oe._label).replace("href",oe._href).replace("title",oe._title).getRegex(),oe.reflink=tt(oe.reflink).replace("label",oe._label).replace("ref",xe._label).getRegex(),oe.nolink=tt(oe.nolink).replace("ref",xe._label).getRegex(),oe.reflinkSearch=tt(oe.reflinkSearch,"g").replace("reflink",oe.reflink).replace("nolink",oe.nolink).getRegex(),oe.normal={...oe},oe.pedantic={...oe.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:tt(/^!?\[(label)\]\((.*?)\)/).replace("label",oe._label).getRegex(),reflink:tt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",oe._label).getRegex()},oe.gfm={...oe.normal,escape:tt(oe.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(i="x"+i.toString(16)),t+="&#"+i+";";return t}class Zi{constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||to,this.options.tokenizer=this.options.tokenizer||new Ch,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={block:xe.normal,inline:oe.normal};this.options.pedantic?(n.block=xe.pedantic,n.inline=oe.pedantic):this.options.gfm&&(n.block=xe.gfm,this.options.breaks?n.inline=oe.breaks:n.inline=oe.gfm),this.tokenizer.rules=n}static get rules(){return{block:xe,inline:oe}}static lex(t,n){return new Zi(n).lex(t)}static lexInline(t,n){return new Zi(n).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,` +`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:i,tokens:this.lexer.inline(i)}}}text(t){const n=this.rules.block.text.exec(t);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(t){const n=this.rules.inline.escape.exec(t);if(n)return{type:"escape",raw:n[0],text:cn(n[1])}}tag(t){const n=this.rules.inline.tag.exec(t);if(n)return!this.lexer.state.inLink&&/^/i.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):cn(n[0]):n[0]}}link(t){const n=this.rules.inline.link.exec(t);if(n){const i=n[2].trim();if(!this.options.pedantic&&/^$/.test(i))return;const o=Eh(i.slice(0,-1),"\\");if((i.length-o.length)%2===0)return}else{const o=tB(n[2],"()");if(o>-1){const l=(n[0].indexOf("!")===0?5:4)+n[1].length+o;n[2]=n[2].substring(0,o),n[0]=n[0].substring(0,l).trim(),n[3]=""}}let r=n[2],s="";if(this.options.pedantic){const o=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);o&&(r=o[1],s=o[3])}else s=n[3]?n[3].slice(1,-1):"";return r=r.trim(),/^$/.test(i)?r=r.slice(1):r=r.slice(1,-1)),S6(n,{href:r&&r.replace(this.rules.inline._escapes,"$1"),title:s&&s.replace(this.rules.inline._escapes,"$1")},n[0],this.lexer)}}reflink(t,n){let i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){let r=(i[2]||i[1]).replace(/\s+/g," ");if(r=n[r.toLowerCase()],!r){const s=i[0].charAt(0);return{type:"text",raw:s,text:s}}return S6(i,r,i[0],this.lexer)}}emStrong(t,n,i=""){let r=this.rules.inline.emStrong.lDelim.exec(t);if(!r||r[3]&&i.match(/[\p{L}\p{N}]/u))return;if(!(r[1]||r[2]||"")||!i||this.rules.inline.punctuation.exec(i)){const o=r[0].length-1;let a,l,u=o,c=0;const f=r[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(f.lastIndex=0,n=n.slice(-1*t.length+o);(r=f.exec(n))!=null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(l=a.length,r[3]||r[4]){u+=l;continue}else if((r[5]||r[6])&&o%3&&!((o+l)%3)){c+=l;continue}if(u-=l,u>0)continue;l=Math.min(l,l+u+c);const d=t.slice(0,o+r.index+l+1);if(Math.min(o,l)%2){const p=d.slice(1,-1);return{type:"em",raw:d,text:p,tokens:this.lexer.inlineTokens(p)}}const h=d.slice(2,-2);return{type:"strong",raw:d,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(t){const n=this.rules.inline.code.exec(t);if(n){let i=n[2].replace(/\n/g," ");const r=/[^ ]/.test(i),s=/^ /.test(i)&&/ $/.test(i);return r&&s&&(i=i.substring(1,i.length-1)),i=cn(i,!0),{type:"codespan",raw:n[0],text:i}}}br(t){const n=this.rules.inline.br.exec(t);if(n)return{type:"br",raw:n[0]}}del(t){const n=this.rules.inline.del.exec(t);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(t,n){const i=this.rules.inline.autolink.exec(t);if(i){let r,s;return i[2]==="@"?(r=cn(this.options.mangle?n(i[1]):i[1]),s="mailto:"+r):(r=cn(i[1]),s=r),{type:"link",raw:i[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}url(t,n){let i;if(i=this.rules.inline.url.exec(t)){let r,s;if(i[2]==="@")r=cn(this.options.mangle?n(i[0]):i[0]),s="mailto:"+r;else{let o;do o=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0];while(o!==i[0]);r=cn(i[0]),i[1]==="www."?s="http://"+i[0]:s=i[0]}return{type:"link",raw:i[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t,n){const i=this.rules.inline.text.exec(t);if(i){let r;return this.lexer.state.inRawBlock?r=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):cn(i[0]):i[0]:r=cn(this.options.smartypants?n(i[0]):i[0]),{type:"text",raw:i[0],text:r}}}}const xe={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:$h,lheading:/^((?:(?!^bull ).|\n(?!\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};xe._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/,xe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,xe.def=tt(xe.def).replace("label",xe._label).replace("title",xe._title).getRegex(),xe.bullet=/(?:[*+-]|\d{1,9}[.)])/,xe.listItemStart=tt(/^( *)(bull) */).replace("bull",xe.bullet).getRegex(),xe.list=tt(xe.list).replace(/bull/g,xe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+xe.def.source+")").getRegex(),xe._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",xe._comment=/|$)/,xe.html=tt(xe.html,"i").replace("comment",xe._comment).replace("tag",xe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),xe.lheading=tt(xe.lheading).replace(/bull/g,xe.bullet).getRegex(),xe.paragraph=tt(xe._paragraph).replace("hr",xe.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",xe._tag).getRegex(),xe.blockquote=tt(xe.blockquote).replace("paragraph",xe.paragraph).getRegex(),xe.normal={...xe},xe.gfm={...xe.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},xe.gfm.table=tt(xe.gfm.table).replace("hr",xe.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",xe._tag).getRegex(),xe.gfm.paragraph=tt(xe._paragraph).replace("hr",xe.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",xe.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",xe._tag).getRegex(),xe.pedantic={...xe.normal,html:tt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",xe._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:$h,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:tt(xe.normal._paragraph).replace("hr",xe.hr).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",xe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const oe={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:$h,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,rDelimAst:/^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:$h,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`^|~",oe.punctuation=tt(oe.punctuation,"u").replace(/punctuation/g,oe._punctuation).getRegex(),oe.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,oe.anyPunctuation=/\\[punct]/g,oe._escapes=/\\([punct])/g,oe._comment=tt(xe._comment).replace("(?:-->|$)","-->").getRegex(),oe.emStrong.lDelim=tt(oe.emStrong.lDelim,"u").replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimAst=tt(oe.emStrong.rDelimAst,"gu").replace(/punct/g,oe._punctuation).getRegex(),oe.emStrong.rDelimUnd=tt(oe.emStrong.rDelimUnd,"gu").replace(/punct/g,oe._punctuation).getRegex(),oe.anyPunctuation=tt(oe.anyPunctuation,"gu").replace(/punct/g,oe._punctuation).getRegex(),oe._escapes=tt(oe._escapes,"gu").replace(/punct/g,oe._punctuation).getRegex(),oe._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,oe._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,oe.autolink=tt(oe.autolink).replace("scheme",oe._scheme).replace("email",oe._email).getRegex(),oe._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,oe.tag=tt(oe.tag).replace("comment",oe._comment).replace("attribute",oe._attribute).getRegex(),oe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,oe._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,oe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,oe.link=tt(oe.link).replace("label",oe._label).replace("href",oe._href).replace("title",oe._title).getRegex(),oe.reflink=tt(oe.reflink).replace("label",oe._label).replace("ref",xe._label).getRegex(),oe.nolink=tt(oe.nolink).replace("ref",xe._label).getRegex(),oe.reflinkSearch=tt(oe.reflinkSearch,"g").replace("reflink",oe.reflink).replace("nolink",oe.nolink).getRegex(),oe.normal={...oe},oe.pedantic={...oe.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:tt(/^!?\[(label)\]\((.*?)\)/).replace("label",oe._label).getRegex(),reflink:tt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",oe._label).getRegex()},oe.gfm={...oe.normal,escape:tt(oe.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(i="x"+i.toString(16)),t+="&#"+i+";";return t}class Zi{constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||to,this.options.tokenizer=this.options.tokenizer||new Ch,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={block:xe.normal,inline:oe.normal};this.options.pedantic?(n.block=xe.pedantic,n.inline=oe.pedantic):this.options.gfm&&(n.block=xe.gfm,this.options.breaks?n.inline=oe.breaks:n.inline=oe.gfm),this.tokenizer.rules=n}static get rules(){return{block:xe,inline:oe}}static lex(t,n){return new Zi(n).lex(t)}static lexInline(t,n){return new Zi(n).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,` `),this.blockTokens(t,this.tokens);let n;for(;n=this.inlineQueue.shift();)this.inlineTokens(n.src,n.tokens);return this.tokens}blockTokens(t,n=[]){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(a,l,u)=>l+" ".repeat(u.length));let i,r,s,o;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(i=a.call({lexer:this},t,n))?(t=t.substring(i.raw.length),n.push(i),!0):!1))){if(i=this.tokenizer.space(t)){t=t.substring(i.raw.length),i.raw.length===1&&n.length>0?n[n.length-1].raw+=` `:n.push(i);continue}if(i=this.tokenizer.code(t)){t=t.substring(i.raw.length),r=n[n.length-1],r&&(r.type==="paragraph"||r.type==="text")?(r.raw+=` `+i.raw,r.text+=` @@ -25,7 +25,7 @@ `+i.raw,r.text+=` `+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):n.push(i),o=s.length!==t.length,t=t.substring(i.raw.length);continue}if(i=this.tokenizer.text(t)){t=t.substring(i.raw.length),r=n[n.length-1],r&&r.type==="text"?(r.raw+=` `+i.raw,r.text+=` -`+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):n.push(i);continue}if(t){const a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let i,r,s,o=t,a,l,u;if(this.tokens.links){const c=Object.keys(this.tokens.links);if(c.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)c.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)o=o.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,a.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;t;)if(l||(u=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(c=>(i=c.call({lexer:this},t,n))?(t=t.substring(i.raw.length),n.push(i),!0):!1))){if(i=this.tokenizer.escape(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.tag(t)){t=t.substring(i.raw.length),r=n[n.length-1],r&&i.type==="text"&&r.type==="text"?(r.raw+=i.raw,r.text+=i.text):n.push(i);continue}if(i=this.tokenizer.link(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(i.raw.length),r=n[n.length-1],r&&i.type==="text"&&r.type==="text"?(r.raw+=i.raw,r.text+=i.text):n.push(i);continue}if(i=this.tokenizer.emStrong(t,o,u)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.codespan(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.br(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.del(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.autolink(t,A6)){t=t.substring(i.raw.length),n.push(i);continue}if(!this.state.inLink&&(i=this.tokenizer.url(t,A6))){t=t.substring(i.raw.length),n.push(i);continue}if(s=t,this.options.extensions&&this.options.extensions.startInline){let c=1/0;const f=t.slice(1);let d;this.options.extensions.startInline.forEach(function(h){d=h.call({lexer:this},f),typeof d=="number"&&d>=0&&(c=Math.min(c,d))}),c<1/0&&c>=0&&(s=t.substring(0,c+1))}if(i=this.tokenizer.inlineText(s,iB)){t=t.substring(i.raw.length),i.raw.slice(-1)!=="_"&&(u=i.raw.slice(-1)),l=!0,r=n[n.length-1],r&&r.type==="text"?(r.raw+=i.raw,r.text+=i.text):n.push(i);continue}if(t){const c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return n}}let Sh=class{constructor(t){this.options=t||to}code(t,n,i){const r=(n||"").match(/\S*/)[0];if(this.options.highlight){const s=this.options.highlight(t,r);s!=null&&s!==t&&(i=!0,t=s)}return t=t.replace(/\n$/,"")+` +`+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):n.push(i);continue}if(t){const a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let i,r,s,o=t,a,l,u;if(this.tokens.links){const c=Object.keys(this.tokens.links);if(c.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)c.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)o=o.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,a.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;t;)if(l||(u=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(c=>(i=c.call({lexer:this},t,n))?(t=t.substring(i.raw.length),n.push(i),!0):!1))){if(i=this.tokenizer.escape(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.tag(t)){t=t.substring(i.raw.length),r=n[n.length-1],r&&i.type==="text"&&r.type==="text"?(r.raw+=i.raw,r.text+=i.text):n.push(i);continue}if(i=this.tokenizer.link(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(i.raw.length),r=n[n.length-1],r&&i.type==="text"&&r.type==="text"?(r.raw+=i.raw,r.text+=i.text):n.push(i);continue}if(i=this.tokenizer.emStrong(t,o,u)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.codespan(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.br(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.del(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.autolink(t,A6)){t=t.substring(i.raw.length),n.push(i);continue}if(!this.state.inLink&&(i=this.tokenizer.url(t,A6))){t=t.substring(i.raw.length),n.push(i);continue}if(s=t,this.options.extensions&&this.options.extensions.startInline){let c=1/0;const f=t.slice(1);let d;this.options.extensions.startInline.forEach(function(h){d=h.call({lexer:this},f),typeof d=="number"&&d>=0&&(c=Math.min(c,d))}),c<1/0&&c>=0&&(s=t.substring(0,c+1))}if(i=this.tokenizer.inlineText(s,rB)){t=t.substring(i.raw.length),i.raw.slice(-1)!=="_"&&(u=i.raw.slice(-1)),l=!0,r=n[n.length-1],r&&r.type==="text"?(r.raw+=i.raw,r.text+=i.text):n.push(i);continue}if(t){const c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return n}}let Sh=class{constructor(t){this.options=t||to}code(t,n,i){const r=(n||"").match(/\S*/)[0];if(this.options.highlight){const s=this.options.highlight(t,r);s!=null&&s!==t&&(i=!0,t=s)}return t=t.replace(/\n$/,"")+` `,r?'
'+(i?t:cn(t,!0))+`
`:"
"+(i?t:cn(t,!0))+`
`}blockquote(t){return`
@@ -46,31 +46,31 @@ ${t}
${t} `}tablecell(t,n){const i=n.header?"th":"td";return(n.align?`<${i} align="${n.align}">`:`<${i}>`)+t+` `}strong(t){return`${t}`}em(t){return`${t}`}codespan(t){return`${t}`}br(){return this.options.xhtml?"
":"
"}del(t){return`${t}`}link(t,n,i){if(t=E6(this.options.sanitize,this.options.baseUrl,t),t===null)return i;let r='
",r}image(t,n,i){if(t=E6(this.options.sanitize,this.options.baseUrl,t),t===null)return i;let r=`${i}":">",r}text(t){return t}};class Ym{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,n,i){return""+i}image(t,n,i){return""+i}br(){return""}}class Ah{constructor(){this.seen={}}serialize(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(t,n){let i=t,r=0;if(this.seen.hasOwnProperty(i)){r=this.seen[t];do r++,i=t+"-"+r;while(this.seen.hasOwnProperty(i))}return n||(this.seen[t]=r,this.seen[i]=0),i}slug(t,n={}){const i=this.serialize(t);return this.getNextSafeSlug(i,n.dryrun)}}class Dr{constructor(t){this.options=t||to,this.options.renderer=this.options.renderer||new Sh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ym,this.slugger=new Ah}static parse(t,n){return new Dr(n).parse(t)}static parseInline(t,n){return new Dr(n).parseInline(t)}parse(t,n=!0){let i="",r,s,o,a,l,u,c,f,d,h,p,g,m,y,b,v,x,_,k;const w=t.length;for(r=0;r0&&b.tokens[0].type==="paragraph"?(b.tokens[0].text=_+" "+b.tokens[0].text,b.tokens[0].tokens&&b.tokens[0].tokens.length>0&&b.tokens[0].tokens[0].type==="text"&&(b.tokens[0].tokens[0].text=_+" "+b.tokens[0].tokens[0].text)):b.tokens.unshift({type:"text",text:_}):y+=_),y+=this.parse(b.tokens,m),d+=this.renderer.listitem(y,x,v);i+=this.renderer.list(d,p,g);continue}case"html":{i+=this.renderer.html(h.text,h.block);continue}case"paragraph":{i+=this.renderer.paragraph(this.parseInline(h.tokens));continue}case"text":{for(d=h.tokens?this.parseInline(h.tokens):h.text;r+1{i=i.concat(this.walkTokens(r[s],n))}):r.tokens&&(i=i.concat(this.walkTokens(r.tokens,n)))}return i}use(...t){const n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(i=>{const r={...i};if(r.async=this.defaults.async||r.async||!1,i.extensions&&(i.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if(s.renderer){const o=n.renderers[s.name];o?n.renderers[s.name]=function(...a){let l=s.renderer.apply(this,a);return l===!1&&(l=o.apply(this,a)),l}:n.renderers[s.name]=s.renderer}if(s.tokenizer){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");n[s.level]?n[s.level].unshift(s.tokenizer):n[s.level]=[s.tokenizer],s.start&&(s.level==="block"?n.startBlock?n.startBlock.push(s.start):n.startBlock=[s.start]:s.level==="inline"&&(n.startInline?n.startInline.push(s.start):n.startInline=[s.start]))}s.childTokens&&(n.childTokens[s.name]=s.childTokens)}),r.extensions=n),i.renderer){const s=this.defaults.renderer||new Sh(this.defaults);for(const o in i.renderer){const a=s[o];s[o]=(...l)=>{let u=i.renderer[o].apply(s,l);return u===!1&&(u=a.apply(s,l)),u}}r.renderer=s}if(i.tokenizer){const s=this.defaults.tokenizer||new Ch(this.defaults);for(const o in i.tokenizer){const a=s[o];s[o]=(...l)=>{let u=i.tokenizer[o].apply(s,l);return u===!1&&(u=a.apply(s,l)),u}}r.tokenizer=s}if(i.hooks){const s=this.defaults.hooks||new Dc;for(const o in i.hooks){const a=s[o];Dc.passThroughHooks.has(o)?s[o]=l=>{if(this.defaults.async)return Promise.resolve(i.hooks[o].call(s,l)).then(c=>a.call(s,c));const u=i.hooks[o].call(s,l);return a.call(s,u)}:s[o]=(...l)=>{let u=i.hooks[o].apply(s,l);return u===!1&&(u=a.apply(s,l)),u}}r.hooks=s}if(i.walkTokens){const s=this.defaults.walkTokens;r.walkTokens=function(o){let a=[];return a.push(i.walkTokens.call(this,o)),s&&(a=a.concat(s.call(this,o))),a}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}}bh=new WeakSet,k5=function(t,n){return(i,r,s)=>{typeof r=="function"&&(s=r,r=null);const o={...r};r={...this.defaults,...o};const a=zm(this,Im,lz).call(this,r.silent,r.async,s);if(typeof i>"u"||i===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof i!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(i)+", string expected"));if(tB(r,s),r.hooks&&(r.hooks.options=r),s){const l=r.highlight;let u;try{r.hooks&&(i=r.hooks.preprocess(i)),u=t(i,r)}catch(d){return a(d)}const c=d=>{let h;if(!d)try{r.walkTokens&&this.walkTokens(u,r.walkTokens),h=n(u,r),r.hooks&&(h=r.hooks.postprocess(h))}catch(p){d=p}return r.highlight=l,d?a(d):s(null,h)};if(!l||l.length<3||(delete r.highlight,!u.length))return c();let f=0;this.walkTokens(u,d=>{d.type==="code"&&(f++,setTimeout(()=>{l(d.text,d.lang,(h,p)=>{if(h)return c(h);p!=null&&p!==d.text&&(d.text=p,d.escaped=!0),f--,f===0&&c()})},0))}),f===0&&c();return}if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(i):i).then(l=>t(l,r)).then(l=>r.walkTokens?Promise.all(this.walkTokens(l,r.walkTokens)).then(()=>l):l).then(l=>n(l,r)).then(l=>r.hooks?r.hooks.postprocess(l):l).catch(a);try{r.hooks&&(i=r.hooks.preprocess(i));const l=t(i,r);r.walkTokens&&this.walkTokens(l,r.walkTokens);let u=n(l,r);return r.hooks&&(u=r.hooks.postprocess(u)),u}catch(l){return a(l)}}},Im=new WeakSet,lz=function(t,n,i){return r=>{if(r.message+=` -Please report this to https://github.com/markedjs/marked.`,t){const s="

An error occurred:

"+cn(r.message+"",!0)+"
";if(n)return Promise.resolve(s);if(i){i(null,s);return}return s}if(n)return Promise.reject(r);if(i){i(r);return}throw r}};const da=new rB(to);function rt(e,t,n){return da.parse(e,t,n)}rt.options=rt.setOptions=function(e){return da.setOptions(e),rt.defaults=da.defaults,x6(rt.defaults),rt},rt.getDefaults=Xm,rt.defaults=to,rt.use=function(...e){return da.use(...e),rt.defaults=da.defaults,x6(rt.defaults),rt},rt.walkTokens=function(e,t){return da.walkTokens(e,t)},rt.parseInline=da.parseInline,rt.Parser=Dr,rt.parser=Dr.parse,rt.Renderer=Sh,rt.TextRenderer=Ym,rt.Lexer=Zi,rt.lexer=Zi.lex,rt.Tokenizer=Ch,rt.Slugger=Ah,rt.Hooks=Dc,rt.parse=rt,rt.options,rt.setOptions,rt.use,rt.walkTokens,rt.parseInline,Dr.parse,Zi.lex;const T6={};function sB(e){let t;return{c(){t=Be(e[1])},m(n,i){z(n,t,i)},p(n,i){i&2&&pt(t,n[1])},i:re,o:re,d(n){n&&L(t)}}}function oB(e){let t,n;const i=e[5].default,r=ct(i,e,e[4],null);return{c(){t=H("h6"),r&&r.c(),D(t,"id",e[2])},m(s,o){z(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&&dt(r,i,s,s[4],n?ft(i,s[4],o,null):ht(s[4]),null),(!n||o&4)&&D(t,"id",s[2])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function aB(e){let t,n;const i=e[5].default,r=ct(i,e,e[4],null);return{c(){t=H("h5"),r&&r.c(),D(t,"id",e[2])},m(s,o){z(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&&dt(r,i,s,s[4],n?ft(i,s[4],o,null):ht(s[4]),null),(!n||o&4)&&D(t,"id",s[2])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function lB(e){let t,n;const i=e[5].default,r=ct(i,e,e[4],null);return{c(){t=H("h4"),r&&r.c(),D(t,"id",e[2])},m(s,o){z(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&&dt(r,i,s,s[4],n?ft(i,s[4],o,null):ht(s[4]),null),(!n||o&4)&&D(t,"id",s[2])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function uB(e){let t,n;const i=e[5].default,r=ct(i,e,e[4],null);return{c(){t=H("h3"),r&&r.c(),D(t,"id",e[2])},m(s,o){z(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&&dt(r,i,s,s[4],n?ft(i,s[4],o,null):ht(s[4]),null),(!n||o&4)&&D(t,"id",s[2])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function cB(e){let t,n;const i=e[5].default,r=ct(i,e,e[4],null);return{c(){t=H("h2"),r&&r.c(),D(t,"id",e[2])},m(s,o){z(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&&dt(r,i,s,s[4],n?ft(i,s[4],o,null):ht(s[4]),null),(!n||o&4)&&D(t,"id",s[2])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function fB(e){let t,n;const i=e[5].default,r=ct(i,e,e[4],null);return{c(){t=H("h1"),r&&r.c(),D(t,"id",e[2])},m(s,o){z(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&&dt(r,i,s,s[4],n?ft(i,s[4],o,null):ht(s[4]),null),(!n||o&4)&&D(t,"id",s[2])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function dB(e){let t,n,i,r;const s=[fB,cB,uB,lB,aB,oB,sB],o=[];function a(l,u){return l[0]===1?0:l[0]===2?1:l[0]===3?2:l[0]===4?3:l[0]===5?4:l[0]===6?5:6}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Ae()},m(l,u){o[t].m(l,u),z(l,i,u),r=!0},p(l,[u]){let c=t;t=a(l),t===c?o[t].p(l,u):($e(),N(o[c],1,1,()=>{o[c]=null}),Ee(),n=o[t],n?n.p(l,u):(n=o[t]=s[t](l),n.c()),F(n,1),n.m(i.parentNode,i))},i(l){r||(F(n),r=!0)},o(l){N(n),r=!1},d(l){l&&L(i),o[t].d(l)}}}function hB(e,t,n){let i,{$$slots:r={},$$scope:s}=t,{depth:o}=t,{raw:a}=t,{text:l}=t;const{slug:u,getOptions:c}=D5(T6),f=c();return e.$$set=d=>{"depth"in d&&n(0,o=d.depth),"raw"in d&&n(1,a=d.raw),"text"in d&&n(3,l=d.text),"$$scope"in d&&n(4,s=d.$$scope)},e.$$.update=()=>{e.$$.dirty&8&&n(2,i=f.headerIds?f.headerPrefix+u(l):void 0)},[o,a,i,l,s,r]}class pB extends ve{constructor(t){super(),be(this,t,hB,dB,he,{depth:0,raw:1,text:3})}}function gB(e){let t,n;const i=e[1].default,r=ct(i,e,e[0],null);return{c(){t=H("p"),r&&r.c()},m(s,o){z(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&dt(r,i,s,s[0],n?ft(i,s[0],o,null):ht(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function mB(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class yB extends ve{constructor(t){super(),be(this,t,mB,gB,he,{})}}function bB(e){let t;const n=e[3].default,i=ct(n,e,e[2],null);return{c(){i&&i.c()},m(r,s){i&&i.m(r,s),t=!0},p(r,[s]){i&&i.p&&(!t||s&4)&&dt(i,n,r,r[2],t?ft(n,r[2],s,null):ht(r[2]),null)},i(r){t||(F(i,r),t=!0)},o(r){N(i,r),t=!1},d(r){i&&i.d(r)}}}function vB(e,t,n){let{$$slots:i={},$$scope:r}=t,{text:s}=t,{raw:o}=t;return e.$$set=a=>{"text"in a&&n(0,s=a.text),"raw"in a&&n(1,o=a.raw),"$$scope"in a&&n(2,r=a.$$scope)},[s,o,r,i]}let xB=class extends ve{constructor(t){super(),be(this,t,vB,bB,he,{text:0,raw:1})}};function _B(e){let t,n;return{c(){t=H("img"),xh(t.src,n=e[0])||D(t,"src",n),D(t,"title",e[1]),D(t,"alt",e[2])},m(i,r){z(i,t,r)},p(i,[r]){r&1&&!xh(t.src,n=i[0])&&D(t,"src",n),r&2&&D(t,"title",i[1]),r&4&&D(t,"alt",i[2])},i:re,o:re,d(i){i&&L(t)}}}function wB(e,t,n){let{href:i=""}=t,{title:r=void 0}=t,{text:s=""}=t;return e.$$set=o=>{"href"in o&&n(0,i=o.href),"title"in o&&n(1,r=o.title),"text"in o&&n(2,s=o.text)},[i,r,s]}let kB=class extends ve{constructor(t){super(),be(this,t,wB,_B,he,{href:0,title:1,text:2})}};function $B(e){let t,n;const i=e[3].default,r=ct(i,e,e[2],null);return{c(){t=H("a"),r&&r.c(),D(t,"href",e[0]),D(t,"title",e[1])},m(s,o){z(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&4)&&dt(r,i,s,s[2],n?ft(i,s[2],o,null):ht(s[2]),null),(!n||o&1)&&D(t,"href",s[0]),(!n||o&2)&&D(t,"title",s[1])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function EB(e,t,n){let{$$slots:i={},$$scope:r}=t,{href:s=""}=t,{title:o=void 0}=t;return e.$$set=a=>{"href"in a&&n(0,s=a.href),"title"in a&&n(1,o=a.title),"$$scope"in a&&n(2,r=a.$$scope)},[s,o,r,i]}class CB extends ve{constructor(t){super(),be(this,t,EB,$B,he,{href:0,title:1})}}function SB(e){let t,n;const i=e[1].default,r=ct(i,e,e[0],null);return{c(){t=H("em"),r&&r.c()},m(s,o){z(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&dt(r,i,s,s[0],n?ft(i,s[0],o,null):ht(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function AB(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class TB extends ve{constructor(t){super(),be(this,t,AB,SB,he,{})}}function MB(e){let t,n;const i=e[1].default,r=ct(i,e,e[0],null);return{c(){t=H("del"),r&&r.c()},m(s,o){z(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&dt(r,i,s,s[0],n?ft(i,s[0],o,null):ht(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function FB(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class DB extends ve{constructor(t){super(),be(this,t,FB,MB,he,{})}}function NB(e){let t,n=e[0].replace(/`/g,"")+"",i;return{c(){t=H("code"),i=Be(n)},m(r,s){z(r,t,s),X(t,i)},p(r,[s]){s&1&&n!==(n=r[0].replace(/`/g,"")+"")&&pt(i,n)},i:re,o:re,d(r){r&&L(t)}}}function OB(e,t,n){let{raw:i}=t;return e.$$set=r=>{"raw"in r&&n(0,i=r.raw)},[i]}class RB extends ve{constructor(t){super(),be(this,t,OB,NB,he,{raw:0})}}function LB(e){let t,n;const i=e[1].default,r=ct(i,e,e[0],null);return{c(){t=H("strong"),r&&r.c()},m(s,o){z(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&dt(r,i,s,s[0],n?ft(i,s[0],o,null):ht(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function IB(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class zB extends ve{constructor(t){super(),be(this,t,IB,LB,he,{})}}function PB(e){let t,n;const i=e[1].default,r=ct(i,e,e[0],null);return{c(){t=H("table"),r&&r.c()},m(s,o){z(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&dt(r,i,s,s[0],n?ft(i,s[0],o,null):ht(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function BB(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}let jB=class extends ve{constructor(t){super(),be(this,t,BB,PB,he,{})}};function UB(e){let t,n;const i=e[1].default,r=ct(i,e,e[0],null);return{c(){t=H("thead"),r&&r.c()},m(s,o){z(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&dt(r,i,s,s[0],n?ft(i,s[0],o,null):ht(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function qB(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class WB extends ve{constructor(t){super(),be(this,t,qB,UB,he,{})}}function HB(e){let t,n;const i=e[1].default,r=ct(i,e,e[0],null);return{c(){t=H("tbody"),r&&r.c()},m(s,o){z(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&dt(r,i,s,s[0],n?ft(i,s[0],o,null):ht(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function GB(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class VB extends ve{constructor(t){super(),be(this,t,GB,HB,he,{})}}function XB(e){let t,n;const i=e[1].default,r=ct(i,e,e[0],null);return{c(){t=H("tr"),r&&r.c()},m(s,o){z(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&dt(r,i,s,s[0],n?ft(i,s[0],o,null):ht(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function YB(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class ZB extends ve{constructor(t){super(),be(this,t,YB,XB,he,{})}}function KB(e){let t,n;const i=e[3].default,r=ct(i,e,e[2],null);return{c(){t=H("td"),r&&r.c(),D(t,"align",e[1])},m(s,o){z(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&4)&&dt(r,i,s,s[2],n?ft(i,s[2],o,null):ht(s[2]),null),(!n||o&2)&&D(t,"align",s[1])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function JB(e){let t,n;const i=e[3].default,r=ct(i,e,e[2],null);return{c(){t=H("th"),r&&r.c(),D(t,"align",e[1])},m(s,o){z(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&4)&&dt(r,i,s,s[2],n?ft(i,s[2],o,null):ht(s[2]),null),(!n||o&2)&&D(t,"align",s[1])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function QB(e){let t,n,i,r;const s=[JB,KB],o=[];function a(l,u){return l[0]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Ae()},m(l,u){o[t].m(l,u),z(l,i,u),r=!0},p(l,[u]){let c=t;t=a(l),t===c?o[t].p(l,u):($e(),N(o[c],1,1,()=>{o[c]=null}),Ee(),n=o[t],n?n.p(l,u):(n=o[t]=s[t](l),n.c()),F(n,1),n.m(i.parentNode,i))},i(l){r||(F(n),r=!0)},o(l){N(n),r=!1},d(l){l&&L(i),o[t].d(l)}}}function ej(e,t,n){let{$$slots:i={},$$scope:r}=t,{header:s}=t,{align:o}=t;return e.$$set=a=>{"header"in a&&n(0,s=a.header),"align"in a&&n(1,o=a.align),"$$scope"in a&&n(2,r=a.$$scope)},[s,o,r,i]}class tj extends ve{constructor(t){super(),be(this,t,ej,QB,he,{header:0,align:1})}}function nj(e){let t,n;const i=e[3].default,r=ct(i,e,e[2],null);return{c(){t=H("ul"),r&&r.c()},m(s,o){z(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&4)&&dt(r,i,s,s[2],n?ft(i,s[2],o,null):ht(s[2]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function ij(e){let t,n;const i=e[3].default,r=ct(i,e,e[2],null);return{c(){t=H("ol"),r&&r.c(),D(t,"start",e[1])},m(s,o){z(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&4)&&dt(r,i,s,s[2],n?ft(i,s[2],o,null):ht(s[2]),null),(!n||o&2)&&D(t,"start",s[1])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function rj(e){let t,n,i,r;const s=[ij,nj],o=[];function a(l,u){return l[0]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Ae()},m(l,u){o[t].m(l,u),z(l,i,u),r=!0},p(l,[u]){let c=t;t=a(l),t===c?o[t].p(l,u):($e(),N(o[c],1,1,()=>{o[c]=null}),Ee(),n=o[t],n?n.p(l,u):(n=o[t]=s[t](l),n.c()),F(n,1),n.m(i.parentNode,i))},i(l){r||(F(n),r=!0)},o(l){N(n),r=!1},d(l){l&&L(i),o[t].d(l)}}}function sj(e,t,n){let{$$slots:i={},$$scope:r}=t,{ordered:s}=t,{start:o}=t;return e.$$set=a=>{"ordered"in a&&n(0,s=a.ordered),"start"in a&&n(1,o=a.start),"$$scope"in a&&n(2,r=a.$$scope)},[s,o,r,i]}class oj extends ve{constructor(t){super(),be(this,t,sj,rj,he,{ordered:0,start:1})}}function aj(e){let t,n;const i=e[1].default,r=ct(i,e,e[0],null);return{c(){t=H("li"),r&&r.c()},m(s,o){z(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&dt(r,i,s,s[0],n?ft(i,s[0],o,null):ht(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function lj(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class uj extends ve{constructor(t){super(),be(this,t,lj,aj,he,{})}}function cj(e){let t;return{c(){t=H("hr")},m(n,i){z(n,t,i)},p:re,i:re,o:re,d(n){n&&L(t)}}}class fj extends ve{constructor(t){super(),be(this,t,null,cj,he,{})}}function dj(e){let t,n;return{c(){t=new gz(!1),n=Ae(),t.a=n},m(i,r){t.m(e[0],i,r),z(i,n,r)},p(i,[r]){r&1&&t.p(i[0])},i:re,o:re,d(i){i&&(L(n),t.d())}}}function hj(e,t,n){let{text:i}=t;return e.$$set=r=>{"text"in r&&n(0,i=r.text)},[i]}class pj extends ve{constructor(t){super(),be(this,t,hj,dj,he,{text:0})}}function gj(e){let t,n;const i=e[1].default,r=ct(i,e,e[0],null);return{c(){t=H("blockquote"),r&&r.c()},m(s,o){z(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&dt(r,i,s,s[0],n?ft(i,s[0],o,null):ht(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function mj(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class yj extends ve{constructor(t){super(),be(this,t,mj,gj,he,{})}}function bj(e){let t,n,i;return{c(){t=H("pre"),n=H("code"),i=Be(e[1]),D(t,"class",e[0])},m(r,s){z(r,t,s),X(t,n),X(n,i)},p(r,[s]){s&2&&pt(i,r[1]),s&1&&D(t,"class",r[0])},i:re,o:re,d(r){r&&L(t)}}}function vj(e,t,n){let{lang:i}=t,{text:r}=t;return e.$$set=s=>{"lang"in s&&n(0,i=s.lang),"text"in s&&n(1,r=s.text)},[i,r]}class xj extends ve{constructor(t){super(),be(this,t,vj,bj,he,{lang:0,text:1})}}function _j(e){let t,n;const i=e[1].default,r=ct(i,e,e[0],null);return{c(){t=H("br"),r&&r.c()},m(s,o){z(s,t,o),r&&r.m(s,o),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&dt(r,i,s,s[0],n?ft(i,s[0],o,null):ht(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function wj(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class kj extends ve{constructor(t){super(),be(this,t,wj,_j,he,{})}}const $j={heading:pB,paragraph:yB,text:xB,image:kB,link:CB,em:TB,strong:zB,codespan:RB,del:DB,table:jB,tablehead:WB,tablebody:VB,tablerow:ZB,tablecell:tj,list:oj,orderedlistitem:null,unorderedlistitem:null,listitem:uj,hr:fj,html:pj,blockquote:yj,code:xj,br:kj},Ej={baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,xhtml:!1};function Cj(e){let t,n;return t=new fa({props:{tokens:e[0],renderers:e[1]}}),{c(){ce(t.$$.fragment)},m(i,r){le(t,i,r),n=!0},p(i,[r]){const s={};r&1&&(s.tokens=i[0]),r&2&&(s.renderers=i[1]),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){ue(t,i)}}}function Sj(e,t,n){let i,r,s,o,{source:a=[]}=t,{renderers:l={}}=t,{options:u={}}=t,{isInline:c=!1}=t;const f=Bm();let d,h,p;return F5(T6,{slug:g=>r?r.slug(g):"",getOptions:()=>s}),Mc(()=>{n(7,p=!0)}),e.$$set=g=>{"source"in g&&n(2,a=g.source),"renderers"in g&&n(3,l=g.renderers),"options"in g&&n(4,u=g.options),"isInline"in g&&n(5,c=g.isInline)},e.$$.update=()=>{e.$$.dirty&4&&n(8,i=Array.isArray(a)),e.$$.dirty&4&&(r=a?new Ah:void 0),e.$$.dirty&16&&n(9,s={...Ej,...u}),e.$$.dirty&869&&(i?n(0,d=a):(n(6,h=new Zi(s)),n(0,d=c?h.inlineTokens(a):h.lex(a)),f("parsed",{tokens:d}))),e.$$.dirty&8&&n(1,o={...$j,...l}),e.$$.dirty&385&&p&&!i&&f("parsed",{tokens:d})},[d,o,a,l,u,c,h,p,i,s]}class Aj extends ve{constructor(t){super(),be(this,t,Sj,Cj,he,{source:2,renderers:3,options:4,isInline:5})}}function Tj(e){let t,n;return t=new Aj({props:{source:e[0].source}}),{c(){ce(t.$$.fragment)},m(i,r){le(t,i,r),n=!0},p(i,[r]){const s={};r&1&&(s.source=i[0].source),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){ue(t,i)}}}function Mj(e,t,n){let{componentData:i}=t;return e.$$set=r=>{"componentData"in r&&n(0,i=r.componentData)},[i]}class M6 extends ve{constructor(t){super(),be(this,t,Mj,Tj,he,{componentData:0})}}function Fj(e){let t,n,i;const r=e[2].default,s=ct(r,e,e[1],null);return{c(){var o;t=H("div"),s&&s.c(),D(t,"id",n=`page-${((o=e[0])==null?void 0:o.title)||"No Title"}`),D(t,"class","page svelte-v7ihqd"),D(t,"data-component","page")},m(o,a){z(o,t,a),s&&s.m(t,null),i=!0},p(o,[a]){var l;s&&s.p&&(!i||a&2)&&dt(s,r,o,o[1],i?ft(r,o[1],a,null):ht(o[1]),null),(!i||a&1&&n!==(n=`page-${((l=o[0])==null?void 0:l.title)||"No Title"}`))&&D(t,"id",n)},i(o){i||(F(s,o),i=!0)},o(o){N(s,o),i=!1},d(o){o&&L(t),s&&s.d(o)}}}function Dj(e,t,n){let{$$slots:i={},$$scope:r}=t,{componentData:s}=t;return e.$$set=o=>{"componentData"in o&&n(0,s=o.componentData),"$$scope"in o&&n(1,r=o.$$scope)},[s,r,i]}class Nj extends ve{constructor(t){super(),be(this,t,Dj,Fj,he,{componentData:0})}}function F6(e){let t,n,i=e[5]&&D6(e),r=e[4]&&N6(e);return{c(){t=H("div"),i&&i.c(),n=je(),r&&r.c(),D(t,"class","info svelte-ljrmzp")},m(s,o){z(s,t,o),i&&i.m(t,null),X(t,n),r&&r.m(t,null)},p(s,o){s[5]?i?i.p(s,o):(i=D6(s),i.c(),i.m(t,n)):i&&(i.d(1),i=null),s[4]?r?r.p(s,o):(r=N6(s),r.c(),r.m(t,null)):r&&(r.d(1),r=null)},d(s){s&&L(t),i&&i.d(),r&&r.d()}}}function D6(e){let t,n,i,r,s;return{c(){t=H("label"),n=Be(e[5]),i=je(),r=H("span"),s=Be(e[3]),D(r,"class","labelValue svelte-ljrmzp"),D(t,"for",e[6]),D(t,"class","svelte-ljrmzp")},m(o,a){z(o,t,a),X(t,n),X(t,i),X(t,r),X(r,s)},p(o,a){a&32&&pt(n,o[5]),a&8&&pt(s,o[3]),a&64&&D(t,"for",o[6])},d(o){o&&L(t)}}}function N6(e){let t,n;return{c(){t=H("span"),n=Be(e[4]),D(t,"title",e[4]),D(t,"class","details svelte-ljrmzp")},m(i,r){z(i,t,r),X(t,n)},p(i,r){r&16&&pt(n,i[4]),r&16&&D(t,"title",i[4])},d(i){i&&L(t)}}}function Oj(e){let t,n,i,r,s,o=(e[0]||"")+"",a,l=(e[5]||e[4])&&F6(e);return{c(){t=H("div"),n=H("div"),l&&l.c(),i=je(),r=H("progress"),s=Be(e[1]),a=Be(o),D(r,"id",e[6]),D(r,"max",e[2]),r.value=e[1],D(r,"style","color: red !important"),D(r,"class","svelte-ljrmzp"),D(n,"class","inner svelte-ljrmzp"),D(t,"class","container svelte-ljrmzp")},m(u,c){z(u,t,c),X(t,n),l&&l.m(n,null),X(n,i),X(n,r),X(r,s),X(r,a)},p(u,[c]){u[5]||u[4]?l?l.p(u,c):(l=F6(u),l.c(),l.m(n,i)):l&&(l.d(1),l=null),c&2&&pt(s,u[1]),c&1&&o!==(o=(u[0]||"")+"")&&pt(a,o),c&64&&D(r,"id",u[6]),c&4&&D(r,"max",u[2]),c&2&&(r.value=u[1])},i:re,o:re,d(u){u&&L(t),l&&l.d()}}}function Rj(e,t,n){let i,r,s,o,a,l,{componentData:u}=t;s==null&&(s=0);let c=s.toString();return e.$$set=f=>{"componentData"in f&&n(7,u=f.componentData)},e.$$.update=()=>{e.$$.dirty&128&&n(2,{max:i,id:r,value:s,label:o,unit:a,details:l}=u,i,(n(6,r),n(7,u)),(n(1,s),n(7,u)),(n(5,o),n(7,u)),(n(0,a),n(7,u)),(n(4,l),n(7,u))),e.$$.dirty&7&&(i?n(3,c=`${s}/${i}`):a&&n(3,c=`${s} ${a}`))},[a,s,i,c,l,o,r,u]}class O6 extends ve{constructor(t){super(),be(this,t,Rj,Oj,he,{componentData:7})}}function R6(e){let t,n;return{c(){t=H("h3"),n=Be(e[3])},m(i,r){z(i,t,r),X(t,n)},p(i,r){r&8&&pt(n,i[3])},d(i){i&&L(t)}}}function L6(e){let t,n;return{c(){t=H("p"),n=Be(e[2]),D(t,"class","description")},m(i,r){z(i,t,r),X(t,n)},p(i,r){r&4&&pt(n,i[2])},d(i){i&&L(t)}}}function Lj(e){let t,n,i,r,s,o,a,l,u=e[3]&&R6(e),c=e[2]&&L6(e);const f=e[6].default,d=ct(f,e,e[5],null);return{c(){t=H("section"),n=H("div"),u&&u.c(),i=je(),c&&c.c(),r=je(),s=H("div"),d&&d.c(),o=je(),a=H("hr"),D(n,"class","heading svelte-17n0qr8"),D(s,"class","sectionItems svelte-17n0qr8"),D(s,"style",e[0]),D(a,"class","svelte-17n0qr8"),D(t,"class","container svelte-17n0qr8"),D(t,"data-component","section"),D(t,"data-section-id",e[3]),Vn(t,"columns",e[1])},m(h,p){z(h,t,p),X(t,n),u&&u.m(n,null),X(n,i),c&&c.m(n,null),X(t,r),X(t,s),d&&d.m(s,null),X(t,o),X(t,a),l=!0},p(h,[p]){h[3]?u?u.p(h,p):(u=R6(h),u.c(),u.m(n,i)):u&&(u.d(1),u=null),h[2]?c?c.p(h,p):(c=L6(h),c.c(),c.m(n,null)):c&&(c.d(1),c=null),d&&d.p&&(!l||p&32)&&dt(d,f,h,h[5],l?ft(f,h[5],p,null):ht(h[5]),null),(!l||p&1)&&D(s,"style",h[0]),(!l||p&8)&&D(t,"data-section-id",h[3]),(!l||p&2)&&Vn(t,"columns",h[1])},i(h){l||(F(d,h),l=!0)},o(h){N(d,h),l=!1},d(h){h&&L(t),u&&u.d(),c&&c.d(),d&&d.d(h)}}}function Ij(e,t,n){let i,r,s,{$$slots:o={},$$scope:a}=t,{componentData:l}=t,u;return s&&(u=`grid-template-columns: repeat(${s||1}, 1fr);`),e.$$set=c=>{"componentData"in c&&n(4,l=c.componentData),"$$scope"in c&&n(5,a=c.$$scope)},e.$$.update=()=>{e.$$.dirty&16&&n(3,{title:i,subtitle:r,columns:s}=l,i,(n(2,r),n(4,l)),(n(1,s),n(4,l)))},[u,s,r,i,l,a,o]}class zj extends ve{constructor(t){super(),be(this,t,Ij,Lj,he,{componentData:4})}}/*! +`+(h.tokens?this.parseInline(h.tokens):h.text);i+=n?this.renderer.paragraph(d):d;continue}default:{const $='Token with "'+h.type+'" type was not found.';if(this.options.silent){console.error($);return}else throw new Error($)}}}return i}parseInline(t,n){n=n||this.renderer;let i="",r,s,o;const a=t.length;for(r=0;r{i=i.concat(this.walkTokens(r[s],n))}):r.tokens&&(i=i.concat(this.walkTokens(r.tokens,n)))}return i}use(...t){const n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(i=>{const r={...i};if(r.async=this.defaults.async||r.async||!1,i.extensions&&(i.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if(s.renderer){const o=n.renderers[s.name];o?n.renderers[s.name]=function(...a){let l=s.renderer.apply(this,a);return l===!1&&(l=o.apply(this,a)),l}:n.renderers[s.name]=s.renderer}if(s.tokenizer){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");n[s.level]?n[s.level].unshift(s.tokenizer):n[s.level]=[s.tokenizer],s.start&&(s.level==="block"?n.startBlock?n.startBlock.push(s.start):n.startBlock=[s.start]:s.level==="inline"&&(n.startInline?n.startInline.push(s.start):n.startInline=[s.start]))}s.childTokens&&(n.childTokens[s.name]=s.childTokens)}),r.extensions=n),i.renderer){const s=this.defaults.renderer||new Sh(this.defaults);for(const o in i.renderer){const a=s[o];s[o]=(...l)=>{let u=i.renderer[o].apply(s,l);return u===!1&&(u=a.apply(s,l)),u}}r.renderer=s}if(i.tokenizer){const s=this.defaults.tokenizer||new Ch(this.defaults);for(const o in i.tokenizer){const a=s[o];s[o]=(...l)=>{let u=i.tokenizer[o].apply(s,l);return u===!1&&(u=a.apply(s,l)),u}}r.tokenizer=s}if(i.hooks){const s=this.defaults.hooks||new Dc;for(const o in i.hooks){const a=s[o];Dc.passThroughHooks.has(o)?s[o]=l=>{if(this.defaults.async)return Promise.resolve(i.hooks[o].call(s,l)).then(c=>a.call(s,c));const u=i.hooks[o].call(s,l);return a.call(s,u)}:s[o]=(...l)=>{let u=i.hooks[o].apply(s,l);return u===!1&&(u=a.apply(s,l)),u}}r.hooks=s}if(i.walkTokens){const s=this.defaults.walkTokens;r.walkTokens=function(o){let a=[];return a.push(i.walkTokens.call(this,o)),s&&(a=a.concat(s.call(this,o))),a}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}}bh=new WeakSet,k5=function(t,n){return(i,r,s)=>{typeof r=="function"&&(s=r,r=null);const o={...r};r={...this.defaults,...o};const a=zm(this,Im,uz).call(this,r.silent,r.async,s);if(typeof i>"u"||i===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof i!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(i)+", string expected"));if(nB(r,s),r.hooks&&(r.hooks.options=r),s){const l=r.highlight;let u;try{r.hooks&&(i=r.hooks.preprocess(i)),u=t(i,r)}catch(d){return a(d)}const c=d=>{let h;if(!d)try{r.walkTokens&&this.walkTokens(u,r.walkTokens),h=n(u,r),r.hooks&&(h=r.hooks.postprocess(h))}catch(p){d=p}return r.highlight=l,d?a(d):s(null,h)};if(!l||l.length<3||(delete r.highlight,!u.length))return c();let f=0;this.walkTokens(u,d=>{d.type==="code"&&(f++,setTimeout(()=>{l(d.text,d.lang,(h,p)=>{if(h)return c(h);p!=null&&p!==d.text&&(d.text=p,d.escaped=!0),f--,f===0&&c()})},0))}),f===0&&c();return}if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(i):i).then(l=>t(l,r)).then(l=>r.walkTokens?Promise.all(this.walkTokens(l,r.walkTokens)).then(()=>l):l).then(l=>n(l,r)).then(l=>r.hooks?r.hooks.postprocess(l):l).catch(a);try{r.hooks&&(i=r.hooks.preprocess(i));const l=t(i,r);r.walkTokens&&this.walkTokens(l,r.walkTokens);let u=n(l,r);return r.hooks&&(u=r.hooks.postprocess(u)),u}catch(l){return a(l)}}},Im=new WeakSet,uz=function(t,n,i){return r=>{if(r.message+=` +Please report this to https://github.com/markedjs/marked.`,t){const s="

An error occurred:

"+cn(r.message+"",!0)+"
";if(n)return Promise.resolve(s);if(i){i(null,s);return}return s}if(n)return Promise.reject(r);if(i){i(r);return}throw r}};const da=new sB(to);function rt(e,t,n){return da.parse(e,t,n)}rt.options=rt.setOptions=function(e){return da.setOptions(e),rt.defaults=da.defaults,x6(rt.defaults),rt},rt.getDefaults=Xm,rt.defaults=to,rt.use=function(...e){return da.use(...e),rt.defaults=da.defaults,x6(rt.defaults),rt},rt.walkTokens=function(e,t){return da.walkTokens(e,t)},rt.parseInline=da.parseInline,rt.Parser=Dr,rt.parser=Dr.parse,rt.Renderer=Sh,rt.TextRenderer=Ym,rt.Lexer=Zi,rt.lexer=Zi.lex,rt.Tokenizer=Ch,rt.Slugger=Ah,rt.Hooks=Dc,rt.parse=rt,rt.options,rt.setOptions,rt.use,rt.walkTokens,rt.parseInline,Dr.parse,Zi.lex;const T6={};function oB(e){let t;return{c(){t=Oe(e[1])},m(n,i){I(n,t,i)},p(n,i){i&2&&at(t,n[1])},i:ie,o:ie,d(n){n&&L(t)}}}function aB(e){let t,n;const i=e[5].default,r=ft(i,e,e[4],null);return{c(){t=H("h6"),r&&r.c(),D(t,"id",e[2])},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&&ht(r,i,s,s[4],n?dt(i,s[4],o,null):pt(s[4]),null),(!n||o&4)&&D(t,"id",s[2])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function lB(e){let t,n;const i=e[5].default,r=ft(i,e,e[4],null);return{c(){t=H("h5"),r&&r.c(),D(t,"id",e[2])},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&&ht(r,i,s,s[4],n?dt(i,s[4],o,null):pt(s[4]),null),(!n||o&4)&&D(t,"id",s[2])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function uB(e){let t,n;const i=e[5].default,r=ft(i,e,e[4],null);return{c(){t=H("h4"),r&&r.c(),D(t,"id",e[2])},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&&ht(r,i,s,s[4],n?dt(i,s[4],o,null):pt(s[4]),null),(!n||o&4)&&D(t,"id",s[2])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function cB(e){let t,n;const i=e[5].default,r=ft(i,e,e[4],null);return{c(){t=H("h3"),r&&r.c(),D(t,"id",e[2])},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&&ht(r,i,s,s[4],n?dt(i,s[4],o,null):pt(s[4]),null),(!n||o&4)&&D(t,"id",s[2])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function fB(e){let t,n;const i=e[5].default,r=ft(i,e,e[4],null);return{c(){t=H("h2"),r&&r.c(),D(t,"id",e[2])},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&&ht(r,i,s,s[4],n?dt(i,s[4],o,null):pt(s[4]),null),(!n||o&4)&&D(t,"id",s[2])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function dB(e){let t,n;const i=e[5].default,r=ft(i,e,e[4],null);return{c(){t=H("h1"),r&&r.c(),D(t,"id",e[2])},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&&ht(r,i,s,s[4],n?dt(i,s[4],o,null):pt(s[4]),null),(!n||o&4)&&D(t,"id",s[2])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function hB(e){let t,n,i,r;const s=[dB,fB,cB,uB,lB,aB,oB],o=[];function a(l,u){return l[0]===1?0:l[0]===2?1:l[0]===3?2:l[0]===4?3:l[0]===5?4:l[0]===6?5:6}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Ae()},m(l,u){o[t].m(l,u),I(l,i,u),r=!0},p(l,[u]){let c=t;t=a(l),t===c?o[t].p(l,u):($e(),N(o[c],1,1,()=>{o[c]=null}),Ee(),n=o[t],n?n.p(l,u):(n=o[t]=s[t](l),n.c()),F(n,1),n.m(i.parentNode,i))},i(l){r||(F(n),r=!0)},o(l){N(n),r=!1},d(l){l&&L(i),o[t].d(l)}}}function pB(e,t,n){let i,{$$slots:r={},$$scope:s}=t,{depth:o}=t,{raw:a}=t,{text:l}=t;const{slug:u,getOptions:c}=D5(T6),f=c();return e.$$set=d=>{"depth"in d&&n(0,o=d.depth),"raw"in d&&n(1,a=d.raw),"text"in d&&n(3,l=d.text),"$$scope"in d&&n(4,s=d.$$scope)},e.$$.update=()=>{e.$$.dirty&8&&n(2,i=f.headerIds?f.headerPrefix+u(l):void 0)},[o,a,i,l,s,r]}class gB extends ge{constructor(t){super(),pe(this,t,pB,hB,he,{depth:0,raw:1,text:3})}}function mB(e){let t,n;const i=e[1].default,r=ft(i,e,e[0],null);return{c(){t=H("p"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&ht(r,i,s,s[0],n?dt(i,s[0],o,null):pt(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function yB(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class bB extends ge{constructor(t){super(),pe(this,t,yB,mB,he,{})}}function vB(e){let t;const n=e[3].default,i=ft(n,e,e[2],null);return{c(){i&&i.c()},m(r,s){i&&i.m(r,s),t=!0},p(r,[s]){i&&i.p&&(!t||s&4)&&ht(i,n,r,r[2],t?dt(n,r[2],s,null):pt(r[2]),null)},i(r){t||(F(i,r),t=!0)},o(r){N(i,r),t=!1},d(r){i&&i.d(r)}}}function xB(e,t,n){let{$$slots:i={},$$scope:r}=t,{text:s}=t,{raw:o}=t;return e.$$set=a=>{"text"in a&&n(0,s=a.text),"raw"in a&&n(1,o=a.raw),"$$scope"in a&&n(2,r=a.$$scope)},[s,o,r,i]}let _B=class extends ge{constructor(t){super(),pe(this,t,xB,vB,he,{text:0,raw:1})}};function wB(e){let t,n;return{c(){t=H("img"),xh(t.src,n=e[0])||D(t,"src",n),D(t,"title",e[1]),D(t,"alt",e[2])},m(i,r){I(i,t,r)},p(i,[r]){r&1&&!xh(t.src,n=i[0])&&D(t,"src",n),r&2&&D(t,"title",i[1]),r&4&&D(t,"alt",i[2])},i:ie,o:ie,d(i){i&&L(t)}}}function kB(e,t,n){let{href:i=""}=t,{title:r=void 0}=t,{text:s=""}=t;return e.$$set=o=>{"href"in o&&n(0,i=o.href),"title"in o&&n(1,r=o.title),"text"in o&&n(2,s=o.text)},[i,r,s]}let $B=class extends ge{constructor(t){super(),pe(this,t,kB,wB,he,{href:0,title:1,text:2})}};function EB(e){let t,n;const i=e[3].default,r=ft(i,e,e[2],null);return{c(){t=H("a"),r&&r.c(),D(t,"href",e[0]),D(t,"title",e[1])},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&4)&&ht(r,i,s,s[2],n?dt(i,s[2],o,null):pt(s[2]),null),(!n||o&1)&&D(t,"href",s[0]),(!n||o&2)&&D(t,"title",s[1])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function CB(e,t,n){let{$$slots:i={},$$scope:r}=t,{href:s=""}=t,{title:o=void 0}=t;return e.$$set=a=>{"href"in a&&n(0,s=a.href),"title"in a&&n(1,o=a.title),"$$scope"in a&&n(2,r=a.$$scope)},[s,o,r,i]}class SB extends ge{constructor(t){super(),pe(this,t,CB,EB,he,{href:0,title:1})}}function AB(e){let t,n;const i=e[1].default,r=ft(i,e,e[0],null);return{c(){t=H("em"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&ht(r,i,s,s[0],n?dt(i,s[0],o,null):pt(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function TB(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class MB extends ge{constructor(t){super(),pe(this,t,TB,AB,he,{})}}function FB(e){let t,n;const i=e[1].default,r=ft(i,e,e[0],null);return{c(){t=H("del"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&ht(r,i,s,s[0],n?dt(i,s[0],o,null):pt(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function DB(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class NB extends ge{constructor(t){super(),pe(this,t,DB,FB,he,{})}}function OB(e){let t,n=e[0].replace(/`/g,"")+"",i;return{c(){t=H("code"),i=Oe(n)},m(r,s){I(r,t,s),V(t,i)},p(r,[s]){s&1&&n!==(n=r[0].replace(/`/g,"")+"")&&at(i,n)},i:ie,o:ie,d(r){r&&L(t)}}}function RB(e,t,n){let{raw:i}=t;return e.$$set=r=>{"raw"in r&&n(0,i=r.raw)},[i]}class LB extends ge{constructor(t){super(),pe(this,t,RB,OB,he,{raw:0})}}function IB(e){let t,n;const i=e[1].default,r=ft(i,e,e[0],null);return{c(){t=H("strong"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&ht(r,i,s,s[0],n?dt(i,s[0],o,null):pt(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function zB(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class PB extends ge{constructor(t){super(),pe(this,t,zB,IB,he,{})}}function BB(e){let t,n;const i=e[1].default,r=ft(i,e,e[0],null);return{c(){t=H("table"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&ht(r,i,s,s[0],n?dt(i,s[0],o,null):pt(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function jB(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}let UB=class extends ge{constructor(t){super(),pe(this,t,jB,BB,he,{})}};function qB(e){let t,n;const i=e[1].default,r=ft(i,e,e[0],null);return{c(){t=H("thead"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&ht(r,i,s,s[0],n?dt(i,s[0],o,null):pt(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function WB(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class HB extends ge{constructor(t){super(),pe(this,t,WB,qB,he,{})}}function GB(e){let t,n;const i=e[1].default,r=ft(i,e,e[0],null);return{c(){t=H("tbody"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&ht(r,i,s,s[0],n?dt(i,s[0],o,null):pt(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function VB(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class XB extends ge{constructor(t){super(),pe(this,t,VB,GB,he,{})}}function YB(e){let t,n;const i=e[1].default,r=ft(i,e,e[0],null);return{c(){t=H("tr"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&ht(r,i,s,s[0],n?dt(i,s[0],o,null):pt(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function ZB(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class KB extends ge{constructor(t){super(),pe(this,t,ZB,YB,he,{})}}function JB(e){let t,n;const i=e[3].default,r=ft(i,e,e[2],null);return{c(){t=H("td"),r&&r.c(),D(t,"align",e[1])},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&4)&&ht(r,i,s,s[2],n?dt(i,s[2],o,null):pt(s[2]),null),(!n||o&2)&&D(t,"align",s[1])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function QB(e){let t,n;const i=e[3].default,r=ft(i,e,e[2],null);return{c(){t=H("th"),r&&r.c(),D(t,"align",e[1])},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&4)&&ht(r,i,s,s[2],n?dt(i,s[2],o,null):pt(s[2]),null),(!n||o&2)&&D(t,"align",s[1])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function ej(e){let t,n,i,r;const s=[QB,JB],o=[];function a(l,u){return l[0]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Ae()},m(l,u){o[t].m(l,u),I(l,i,u),r=!0},p(l,[u]){let c=t;t=a(l),t===c?o[t].p(l,u):($e(),N(o[c],1,1,()=>{o[c]=null}),Ee(),n=o[t],n?n.p(l,u):(n=o[t]=s[t](l),n.c()),F(n,1),n.m(i.parentNode,i))},i(l){r||(F(n),r=!0)},o(l){N(n),r=!1},d(l){l&&L(i),o[t].d(l)}}}function tj(e,t,n){let{$$slots:i={},$$scope:r}=t,{header:s}=t,{align:o}=t;return e.$$set=a=>{"header"in a&&n(0,s=a.header),"align"in a&&n(1,o=a.align),"$$scope"in a&&n(2,r=a.$$scope)},[s,o,r,i]}class nj extends ge{constructor(t){super(),pe(this,t,tj,ej,he,{header:0,align:1})}}function ij(e){let t,n;const i=e[3].default,r=ft(i,e,e[2],null);return{c(){t=H("ul"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&4)&&ht(r,i,s,s[2],n?dt(i,s[2],o,null):pt(s[2]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function rj(e){let t,n;const i=e[3].default,r=ft(i,e,e[2],null);return{c(){t=H("ol"),r&&r.c(),D(t,"start",e[1])},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&4)&&ht(r,i,s,s[2],n?dt(i,s[2],o,null):pt(s[2]),null),(!n||o&2)&&D(t,"start",s[1])},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function sj(e){let t,n,i,r;const s=[rj,ij],o=[];function a(l,u){return l[0]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Ae()},m(l,u){o[t].m(l,u),I(l,i,u),r=!0},p(l,[u]){let c=t;t=a(l),t===c?o[t].p(l,u):($e(),N(o[c],1,1,()=>{o[c]=null}),Ee(),n=o[t],n?n.p(l,u):(n=o[t]=s[t](l),n.c()),F(n,1),n.m(i.parentNode,i))},i(l){r||(F(n),r=!0)},o(l){N(n),r=!1},d(l){l&&L(i),o[t].d(l)}}}function oj(e,t,n){let{$$slots:i={},$$scope:r}=t,{ordered:s}=t,{start:o}=t;return e.$$set=a=>{"ordered"in a&&n(0,s=a.ordered),"start"in a&&n(1,o=a.start),"$$scope"in a&&n(2,r=a.$$scope)},[s,o,r,i]}class aj extends ge{constructor(t){super(),pe(this,t,oj,sj,he,{ordered:0,start:1})}}function lj(e){let t,n;const i=e[1].default,r=ft(i,e,e[0],null);return{c(){t=H("li"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&ht(r,i,s,s[0],n?dt(i,s[0],o,null):pt(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function uj(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class cj extends ge{constructor(t){super(),pe(this,t,uj,lj,he,{})}}function fj(e){let t;return{c(){t=H("hr")},m(n,i){I(n,t,i)},p:ie,i:ie,o:ie,d(n){n&&L(t)}}}class dj extends ge{constructor(t){super(),pe(this,t,null,fj,he,{})}}function hj(e){let t,n;return{c(){t=new mz(!1),n=Ae(),t.a=n},m(i,r){t.m(e[0],i,r),I(i,n,r)},p(i,[r]){r&1&&t.p(i[0])},i:ie,o:ie,d(i){i&&(L(n),t.d())}}}function pj(e,t,n){let{text:i}=t;return e.$$set=r=>{"text"in r&&n(0,i=r.text)},[i]}class gj extends ge{constructor(t){super(),pe(this,t,pj,hj,he,{text:0})}}function mj(e){let t,n;const i=e[1].default,r=ft(i,e,e[0],null);return{c(){t=H("blockquote"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&ht(r,i,s,s[0],n?dt(i,s[0],o,null):pt(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function yj(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class bj extends ge{constructor(t){super(),pe(this,t,yj,mj,he,{})}}function vj(e){let t,n,i;return{c(){t=H("pre"),n=H("code"),i=Oe(e[1]),D(t,"class",e[0])},m(r,s){I(r,t,s),V(t,n),V(n,i)},p(r,[s]){s&2&&at(i,r[1]),s&1&&D(t,"class",r[0])},i:ie,o:ie,d(r){r&&L(t)}}}function xj(e,t,n){let{lang:i}=t,{text:r}=t;return e.$$set=s=>{"lang"in s&&n(0,i=s.lang),"text"in s&&n(1,r=s.text)},[i,r]}class _j extends ge{constructor(t){super(),pe(this,t,xj,vj,he,{lang:0,text:1})}}function wj(e){let t,n;const i=e[1].default,r=ft(i,e,e[0],null);return{c(){t=H("br"),r&&r.c()},m(s,o){I(s,t,o),r&&r.m(s,o),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&ht(r,i,s,s[0],n?dt(i,s[0],o,null):pt(s[0]),null)},i(s){n||(F(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&L(t),r&&r.d(s)}}}function kj(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class $j extends ge{constructor(t){super(),pe(this,t,kj,wj,he,{})}}const Ej={heading:gB,paragraph:bB,text:_B,image:$B,link:SB,em:MB,strong:PB,codespan:LB,del:NB,table:UB,tablehead:HB,tablebody:XB,tablerow:KB,tablecell:nj,list:aj,orderedlistitem:null,unorderedlistitem:null,listitem:cj,hr:dj,html:gj,blockquote:bj,code:_j,br:$j},Cj={baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,xhtml:!1};function Sj(e){let t,n;return t=new fa({props:{tokens:e[0],renderers:e[1]}}),{c(){ce(t.$$.fragment)},m(i,r){le(t,i,r),n=!0},p(i,[r]){const s={};r&1&&(s.tokens=i[0]),r&2&&(s.renderers=i[1]),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){ue(t,i)}}}function Aj(e,t,n){let i,r,s,o,{source:a=[]}=t,{renderers:l={}}=t,{options:u={}}=t,{isInline:c=!1}=t;const f=Bm();let d,h,p;return F5(T6,{slug:g=>r?r.slug(g):"",getOptions:()=>s}),Mc(()=>{n(7,p=!0)}),e.$$set=g=>{"source"in g&&n(2,a=g.source),"renderers"in g&&n(3,l=g.renderers),"options"in g&&n(4,u=g.options),"isInline"in g&&n(5,c=g.isInline)},e.$$.update=()=>{e.$$.dirty&4&&n(8,i=Array.isArray(a)),e.$$.dirty&4&&(r=a?new Ah:void 0),e.$$.dirty&16&&n(9,s={...Cj,...u}),e.$$.dirty&869&&(i?n(0,d=a):(n(6,h=new Zi(s)),n(0,d=c?h.inlineTokens(a):h.lex(a)),f("parsed",{tokens:d}))),e.$$.dirty&8&&n(1,o={...Ej,...l}),e.$$.dirty&385&&p&&!i&&f("parsed",{tokens:d})},[d,o,a,l,u,c,h,p,i,s]}class Tj extends ge{constructor(t){super(),pe(this,t,Aj,Sj,he,{source:2,renderers:3,options:4,isInline:5})}}function Mj(e){let t,n;return t=new Tj({props:{source:e[0].source}}),{c(){ce(t.$$.fragment)},m(i,r){le(t,i,r),n=!0},p(i,[r]){const s={};r&1&&(s.source=i[0].source),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){ue(t,i)}}}function Fj(e,t,n){let{componentData:i}=t;return e.$$set=r=>{"componentData"in r&&n(0,i=r.componentData)},[i]}class M6 extends ge{constructor(t){super(),pe(this,t,Fj,Mj,he,{componentData:0})}}function Dj(e){let t,n,i;const r=e[2].default,s=ft(r,e,e[1],null);return{c(){var o;t=H("div"),s&&s.c(),D(t,"id",n=`page-${((o=e[0])==null?void 0:o.title)||"No Title"}`),D(t,"class","page svelte-v7ihqd"),D(t,"data-component","page")},m(o,a){I(o,t,a),s&&s.m(t,null),i=!0},p(o,[a]){var l;s&&s.p&&(!i||a&2)&&ht(s,r,o,o[1],i?dt(r,o[1],a,null):pt(o[1]),null),(!i||a&1&&n!==(n=`page-${((l=o[0])==null?void 0:l.title)||"No Title"}`))&&D(t,"id",n)},i(o){i||(F(s,o),i=!0)},o(o){N(s,o),i=!1},d(o){o&&L(t),s&&s.d(o)}}}function Nj(e,t,n){let{$$slots:i={},$$scope:r}=t,{componentData:s}=t;return e.$$set=o=>{"componentData"in o&&n(0,s=o.componentData),"$$scope"in o&&n(1,r=o.$$scope)},[s,r,i]}class Oj extends ge{constructor(t){super(),pe(this,t,Nj,Dj,he,{componentData:0})}}function F6(e){let t,n,i=e[5]&&D6(e),r=e[4]&&N6(e);return{c(){t=H("div"),i&&i.c(),n=je(),r&&r.c(),D(t,"class","info svelte-ljrmzp")},m(s,o){I(s,t,o),i&&i.m(t,null),V(t,n),r&&r.m(t,null)},p(s,o){s[5]?i?i.p(s,o):(i=D6(s),i.c(),i.m(t,n)):i&&(i.d(1),i=null),s[4]?r?r.p(s,o):(r=N6(s),r.c(),r.m(t,null)):r&&(r.d(1),r=null)},d(s){s&&L(t),i&&i.d(),r&&r.d()}}}function D6(e){let t,n,i,r,s;return{c(){t=H("label"),n=Oe(e[5]),i=je(),r=H("span"),s=Oe(e[3]),D(r,"class","labelValue svelte-ljrmzp"),D(t,"for",e[6]),D(t,"class","svelte-ljrmzp")},m(o,a){I(o,t,a),V(t,n),V(t,i),V(t,r),V(r,s)},p(o,a){a&32&&at(n,o[5]),a&8&&at(s,o[3]),a&64&&D(t,"for",o[6])},d(o){o&&L(t)}}}function N6(e){let t,n;return{c(){t=H("span"),n=Oe(e[4]),D(t,"title",e[4]),D(t,"class","details svelte-ljrmzp")},m(i,r){I(i,t,r),V(t,n)},p(i,r){r&16&&at(n,i[4]),r&16&&D(t,"title",i[4])},d(i){i&&L(t)}}}function Rj(e){let t,n,i,r,s,o=(e[0]||"")+"",a,l=(e[5]||e[4])&&F6(e);return{c(){t=H("div"),n=H("div"),l&&l.c(),i=je(),r=H("progress"),s=Oe(e[1]),a=Oe(o),D(r,"id",e[6]),D(r,"max",e[2]),r.value=e[1],D(r,"style","color: red !important"),D(r,"class","svelte-ljrmzp"),D(n,"class","inner svelte-ljrmzp"),D(t,"class","container svelte-ljrmzp")},m(u,c){I(u,t,c),V(t,n),l&&l.m(n,null),V(n,i),V(n,r),V(r,s),V(r,a)},p(u,[c]){u[5]||u[4]?l?l.p(u,c):(l=F6(u),l.c(),l.m(n,i)):l&&(l.d(1),l=null),c&2&&at(s,u[1]),c&1&&o!==(o=(u[0]||"")+"")&&at(a,o),c&64&&D(r,"id",u[6]),c&4&&D(r,"max",u[2]),c&2&&(r.value=u[1])},i:ie,o:ie,d(u){u&&L(t),l&&l.d()}}}function Lj(e,t,n){let i,r,s,o,a,l,{componentData:u}=t;s==null&&(s=0);let c=s.toString();return e.$$set=f=>{"componentData"in f&&n(7,u=f.componentData)},e.$$.update=()=>{e.$$.dirty&128&&n(2,{max:i,id:r,value:s,label:o,unit:a,details:l}=u,i,(n(6,r),n(7,u)),(n(1,s),n(7,u)),(n(5,o),n(7,u)),(n(0,a),n(7,u)),(n(4,l),n(7,u))),e.$$.dirty&7&&(i?n(3,c=`${s}/${i}`):a&&n(3,c=`${s} ${a}`))},[a,s,i,c,l,o,r,u]}class O6 extends ge{constructor(t){super(),pe(this,t,Lj,Rj,he,{componentData:7})}}function R6(e){let t,n;return{c(){t=H("h3"),n=Oe(e[3])},m(i,r){I(i,t,r),V(t,n)},p(i,r){r&8&&at(n,i[3])},d(i){i&&L(t)}}}function L6(e){let t,n;return{c(){t=H("p"),n=Oe(e[2]),D(t,"class","description")},m(i,r){I(i,t,r),V(t,n)},p(i,r){r&4&&at(n,i[2])},d(i){i&&L(t)}}}function Ij(e){let t,n,i,r,s,o,a,l,u=e[3]&&R6(e),c=e[2]&&L6(e);const f=e[6].default,d=ft(f,e,e[5],null);return{c(){t=H("section"),n=H("div"),u&&u.c(),i=je(),c&&c.c(),r=je(),s=H("div"),d&&d.c(),o=je(),a=H("hr"),D(n,"class","heading svelte-17n0qr8"),D(s,"class","sectionItems svelte-17n0qr8"),D(s,"style",e[0]),D(a,"class","svelte-17n0qr8"),D(t,"class","container svelte-17n0qr8"),D(t,"data-component","section"),D(t,"data-section-id",e[3]),Vn(t,"columns",e[1])},m(h,p){I(h,t,p),V(t,n),u&&u.m(n,null),V(n,i),c&&c.m(n,null),V(t,r),V(t,s),d&&d.m(s,null),V(t,o),V(t,a),l=!0},p(h,[p]){h[3]?u?u.p(h,p):(u=R6(h),u.c(),u.m(n,i)):u&&(u.d(1),u=null),h[2]?c?c.p(h,p):(c=L6(h),c.c(),c.m(n,null)):c&&(c.d(1),c=null),d&&d.p&&(!l||p&32)&&ht(d,f,h,h[5],l?dt(f,h[5],p,null):pt(h[5]),null),(!l||p&1)&&D(s,"style",h[0]),(!l||p&8)&&D(t,"data-section-id",h[3]),(!l||p&2)&&Vn(t,"columns",h[1])},i(h){l||(F(d,h),l=!0)},o(h){N(d,h),l=!1},d(h){h&&L(t),u&&u.d(),c&&c.d(),d&&d.d(h)}}}function zj(e,t,n){let i,r,s,{$$slots:o={},$$scope:a}=t,{componentData:l}=t,u;return s&&(u=`grid-template-columns: repeat(${s||1}, 1fr);`),e.$$set=c=>{"componentData"in c&&n(4,l=c.componentData),"$$scope"in c&&n(5,a=c.$$scope)},e.$$.update=()=>{e.$$.dirty&16&&n(3,{title:i,subtitle:r,columns:s}=l,i,(n(2,r),n(4,l)),(n(1,s),n(4,l)))},[u,s,r,i,l,a,o]}class Pj extends ge{constructor(t){super(),pe(this,t,zj,Ij,he,{componentData:4})}}/*! * https://github.com/Starcounter-Jack/JSON-Patch * (c) 2017-2022 Joachim Wester * MIT licensed - */var Pj=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)r.hasOwnProperty(s)&&(i[s]=r[s])},e(t,n)};return function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Bj=Object.prototype.hasOwnProperty;function Zm(e,t){return Bj.call(e,t)}function Km(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n=48&&i<=57){t++;continue}return!1}return!0}function ha(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function I6(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Qm(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t0&&l[c-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&d===void 0&&(u[h]===void 0?d=l.slice(0,c).join("/"):c==f-1&&(d=t.path),d!==void 0&&p(t,0,e,d)),c++,Array.isArray(u)){if(h==="-")h=u.length;else{if(n&&!Jm(h))throw new $t("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",s,t,e);Jm(h)&&(h=~~h)}if(c>=f){if(n&&t.op==="add"&&h>u.length)throw new $t("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",s,t,e);var o=Uj[t.op].call(t,u,h,e);if(o.test===!1)throw new $t("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o}}else if(c>=f){var o=Ul[t.op].call(t,u,h,e);if(o.test===!1)throw new $t("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o}if(u=u[h],n&&c0)throw new $t('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new $t("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new $t("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&Qm(e.value))throw new $t("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n){if(e.op=="add"){var r=e.path.split("/").length,s=i.split("/").length;if(r!==s+1&&r!==s)throw new $t("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==i)throw new $t("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if(e.op==="move"||e.op==="copy"){var o={op:"_get",path:e.from,value:void 0},a=B6([o],n);if(a&&a.name==="OPERATION_PATH_UNRESOLVABLE")throw new $t("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}}else throw new $t("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n)}function B6(e,t,n){try{if(!Array.isArray(e))throw new $t("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Mh(di(t),di(e),n||!0);else{n=n||Fh;for(var i=0;i=48&&i<=57){t++;continue}return!1}return!0}function ha(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function I6(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Qm(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t0&&l[c-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&d===void 0&&(u[h]===void 0?d=l.slice(0,c).join("/"):c==f-1&&(d=t.path),d!==void 0&&p(t,0,e,d)),c++,Array.isArray(u)){if(h==="-")h=u.length;else{if(n&&!Jm(h))throw new $t("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",s,t,e);Jm(h)&&(h=~~h)}if(c>=f){if(n&&t.op==="add"&&h>u.length)throw new $t("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",s,t,e);var o=qj[t.op].call(t,u,h,e);if(o.test===!1)throw new $t("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o}}else if(c>=f){var o=Ul[t.op].call(t,u,h,e);if(o.test===!1)throw new $t("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o}if(u=u[h],n&&c0)throw new $t('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new $t("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new $t("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&Qm(e.value))throw new $t("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n){if(e.op=="add"){var r=e.path.split("/").length,s=i.split("/").length;if(r!==s+1&&r!==s)throw new $t("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==i)throw new $t("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if(e.op==="move"||e.op==="copy"){var o={op:"_get",path:e.from,value:void 0},a=B6([o],n);if(a&&a.name==="OPERATION_PATH_UNRESOLVABLE")throw new $t("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}}else throw new $t("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n)}function B6(e,t,n){try{if(!Array.isArray(e))throw new $t("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Mh(di(t),di(e),n||!0);else{n=n||Fh;for(var i=0;i0&&(e.patches=[],e.callback&&e.callback(i)),i}function n2(e,t,n,i,r){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var s=Km(t),o=Km(e),a=!1,l=o.length-1;l>=0;l--){var u=o[l],c=e[u];if(Zm(t,u)&&!(t[u]===void 0&&c!==void 0&&Array.isArray(t)===!1)){var f=t[u];typeof c=="object"&&c!=null&&typeof f=="object"&&f!=null&&Array.isArray(c)===Array.isArray(f)?n2(c,f,n,i+"/"+ha(u),r):c!==f&&(r&&n.push({op:"test",path:i+"/"+ha(u),value:di(c)}),n.push({op:"replace",path:i+"/"+ha(u),value:di(f)}))}else Array.isArray(e)===Array.isArray(t)?(r&&n.push({op:"test",path:i+"/"+ha(u),value:di(c)}),n.push({op:"remove",path:i+"/"+ha(u)}),a=!0):(r&&n.push({op:"test",path:i,value:e}),n.push({op:"replace",path:i,value:t}))}if(!(!a&&s.length==o.length))for(var l=0;l0)return[v,i+d.join(`, + */var e2=new WeakMap,Gj=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),Vj=function(){function e(t,n){this.callback=t,this.observer=n}return e}();function Xj(e){return e2.get(e)}function Yj(e,t){return e.observers.get(t)}function Zj(e,t){e.observers.delete(t.callback)}function Kj(e,t){t.unobserve()}function Jj(e,t){var n=[],i,r=Xj(e);if(!r)r=new Gj(e),e2.set(e,r);else{var s=Yj(r,t);i=s&&s.observer}if(i)return i;if(i={},r.value=di(e),t){i.callback=t,i.next=null;var o=function(){t2(i)},a=function(){clearTimeout(i.next),i.next=setTimeout(o)};typeof window<"u"&&(window.addEventListener("mouseup",a),window.addEventListener("keyup",a),window.addEventListener("mousedown",a),window.addEventListener("keydown",a),window.addEventListener("change",a))}return i.patches=n,i.object=e,i.unobserve=function(){t2(i),clearTimeout(i.next),Zj(r,i),typeof window<"u"&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},r.observers.set(t,new Vj(t,i)),i}function t2(e,t){t===void 0&&(t=!1);var n=e2.get(e.object);n2(n.value,e.object,e.patches,"",t),e.patches.length&&Mh(n.value,e.patches);var i=e.patches;return i.length>0&&(e.patches=[],e.callback&&e.callback(i)),i}function n2(e,t,n,i,r){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var s=Km(t),o=Km(e),a=!1,l=o.length-1;l>=0;l--){var u=o[l],c=e[u];if(Zm(t,u)&&!(t[u]===void 0&&c!==void 0&&Array.isArray(t)===!1)){var f=t[u];typeof c=="object"&&c!=null&&typeof f=="object"&&f!=null&&Array.isArray(c)===Array.isArray(f)?n2(c,f,n,i+"/"+ha(u),r):c!==f&&(r&&n.push({op:"test",path:i+"/"+ha(u),value:di(c)}),n.push({op:"replace",path:i+"/"+ha(u),value:di(f)}))}else Array.isArray(e)===Array.isArray(t)?(r&&n.push({op:"test",path:i+"/"+ha(u),value:di(c)}),n.push({op:"remove",path:i+"/"+ha(u)}),a=!0):(r&&n.push({op:"test",path:i,value:e}),n.push({op:"replace",path:i,value:t}))}if(!(!a&&s.length==o.length))for(var l=0;l0)return[v,i+d.join(`, `+y),c].join(` -`+l)}return x}(t,"",0)};const i2=j6(eU);function Xn(e,t,n){return e.fields=t||[],e.fname=n,e}function Et(e){return e==null?null:e.fname}function fn(e){return e==null?null:e.fields}function U6(e){return e.length===1?tU(e[0]):nU(e)}const tU=e=>function(t){return t[e]},nU=e=>{const t=e.length;return function(n){for(let i=0;io?u():o=a+1:l==="["?(a>o&&u(),r=o=a+1):l==="]"&&(r||U("Access path missing open bracket: "+e),r>0&&u(),r=0,o=a+1)}return r&&U("Access path missing closing bracket: "+e),i&&U("Access path missing closing quote: "+e),a>o&&(a++,u()),t}function Ai(e,t,n){const i=Nr(e);return e=i.length===1?i[0]:e,Xn((n&&n.get||U6)(i),[e],t||e)}const Oc=Ai("id"),dn=Xn(e=>e,[],"identity"),no=Xn(()=>0,[],"zero"),ql=Xn(()=>1,[],"one"),Ti=Xn(()=>!0,[],"true"),io=Xn(()=>!1,[],"false");function iU(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const q6=0,r2=1,s2=2,W6=3,H6=4;function o2(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:iU,i=e||q6;return{level(r){return arguments.length?(i=+r,this):i},error(){return i>=r2&&n(t||"error","ERROR",arguments),this},warn(){return i>=s2&&n(t||"warn","WARN",arguments),this},info(){return i>=W6&&n(t||"log","INFO",arguments),this},debug(){return i>=H6&&n(t||"log","DEBUG",arguments),this}}}var q=Array.isArray;function ie(e){return e===Object(e)}const G6=e=>e!=="__proto__";function Wl(){for(var e=arguments.length,t=new Array(e),n=0;n{for(const s in r)if(s==="signals")i.signals=rU(i.signals,r.signals);else{const o=s==="legend"?{layout:1}:s==="style"?!0:null;Hl(i,s,r[s],o)}return i},{})}function Hl(e,t,n,i){if(!G6(t))return;let r,s;if(ie(n)&&!q(n)){s=ie(e[t])?e[t]:e[t]={};for(r in n)i&&(i===!0||i[r])?Hl(s,r,n[r]):G6(r)&&(s[r]=n[r])}else e[t]=n}function rU(e,t){if(e==null)return t;const n={},i=[];function r(s){n[s.name]||(n[s.name]=1,i.push(s))}return t.forEach(r),e.forEach(r),i}function Ue(e){return e[e.length-1]}function hn(e){return e==null||e===""?null:+e}const V6=e=>t=>e*Math.exp(t),X6=e=>t=>Math.log(e*t),Y6=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),Z6=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,Dh=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function Nh(e,t,n,i){const r=n(e[0]),s=n(Ue(e)),o=(s-r)*t;return[i(r-o),i(s-o)]}function K6(e,t){return Nh(e,t,hn,dn)}function J6(e,t){var n=Math.sign(e[0]);return Nh(e,t,X6(n),V6(n))}function Q6(e,t,n){return Nh(e,t,Dh(n),Dh(1/n))}function e4(e,t,n){return Nh(e,t,Y6(n),Z6(n))}function Oh(e,t,n,i,r){const s=i(e[0]),o=i(Ue(e)),a=t!=null?i(t):(s+o)/2;return[r(a+(s-a)*n),r(a+(o-a)*n)]}function a2(e,t,n){return Oh(e,t,n,hn,dn)}function l2(e,t,n){const i=Math.sign(e[0]);return Oh(e,t,n,X6(i),V6(i))}function Rh(e,t,n,i){return Oh(e,t,n,Dh(i),Dh(1/i))}function u2(e,t,n,i){return Oh(e,t,n,Y6(i),Z6(i))}function t4(e){return 1+~~(new Date(e).getMonth()/3)}function n4(e){return 1+~~(new Date(e).getUTCMonth()/3)}function ee(e){return e!=null?q(e)?e:[e]:[]}function i4(e,t,n){let i=e[0],r=e[1],s;return r=n-t?[t,n]:[i=Math.min(Math.max(i,t),n-s),i+s]}function Me(e){return typeof e=="function"}const sU="descending";function c2(e,t,n){n=n||{},t=ee(t)||[];const i=[],r=[],s={},o=n.comparator||oU;return ee(e).forEach((a,l)=>{a!=null&&(i.push(t[l]===sU?-1:1),r.push(a=Me(a)?a:Ai(a,null,n)),(fn(a)||[]).forEach(u=>s[u]=1))}),r.length===0?null:Xn(o(r,i),Object.keys(s))}const Lh=(e,t)=>(et||t==null)&&e!=null?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t===t?-1:t!==t&&e===e?1:0),oU=(e,t)=>e.length===1?aU(e[0],t[0]):lU(e,t,e.length),aU=(e,t)=>function(n,i){return Lh(e(n),e(i))*t},lU=(e,t,n)=>(t.push(0),function(i,r){let s,o=0,a=-1;for(;o===0&&++ae}function f2(e,t){let n;return i=>{n&&clearTimeout(n),n=setTimeout(()=>(t(i),n=null),e)}}function Fe(e){for(let t,n,i=1,r=arguments.length;io&&(o=r))}else{for(r=t(e[n]);no&&(o=r))}return[s,o]}function r4(e,t){const n=e.length;let i=-1,r,s,o,a,l;if(t==null){for(;++i=s){r=o=s;break}if(i===n)return[-1,-1];for(a=l=i;++is&&(r=s,a=i),o=s){r=o=s;break}if(i===n)return[-1,-1];for(a=l=i;++is&&(r=s,a=i),o{r.set(s,e[s])}),r}function s4(e,t,n,i,r,s){if(!n&&n!==0)return s;const o=+n;let a=e[0],l=Ue(e),u;ls&&(o=r,r=s,s=o),n=n===void 0||n,i=i===void 0||i,(n?r<=e:ra.replace(/\\(.)/g,"$1")):ee(e));const i=e&&e.length,r=n&&n.get||U6,s=a=>r(t?[a]:Nr(a));let o;if(!i)o=function(){return""};else if(i===1){const a=s(e[0]);o=function(l){return""+a(l)}}else{const a=e.map(s);o=function(l){let u=""+a[0](l),c=0;for(;++c{t={},n={},i=0},s=(o,a)=>(++i>e&&(n=t,t={},i=1),t[o]=a);return r(),{clear:r,has:o=>pe(t,o)||pe(n,o),get:o=>pe(t,o)?t[o]:pe(n,o)?s(o,n[o]):void 0,set:(o,a)=>pe(t,o)?t[o]=a:s(o,a)}}function c4(e,t,n,i){const r=t.length,s=n.length;if(!s)return t;if(!r)return n;const o=i||new t.constructor(r+s);let a=0,l=0,u=0;for(;a0?n[l++]:t[a++];for(;a=0;)n+=e;return n}function f4(e,t,n,i){const r=n||" ",s=e+"",o=t-s.length;return o<=0?s:i==="left"?Rc(r,o)+s:i==="center"?Rc(r,~~(o/2))+s+Rc(r,Math.ceil(o/2)):s+Rc(r,o)}function Lc(e){return e&&Ue(e)-e[0]||0}function J(e){return q(e)?"["+e.map(J)+"]":ie(e)||te(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function h2(e){return e==null||e===""?null:!e||e==="false"||e==="0"?!1:!!e}const fU=e=>Xe(e)||so(e)?e:Date.parse(e);function p2(e,t){return t=t||fU,e==null||e===""?null:t(e)}function g2(e){return e==null||e===""?null:e+""}function Ki(e){const t={},n=e.length;for(let i=0;i9999?"+"+Yn(e,6):Yn(e,4)}function pU(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),i=e.getUTCSeconds(),r=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":hU(e.getUTCFullYear())+"-"+Yn(e.getUTCMonth()+1,2)+"-"+Yn(e.getUTCDate(),2)+(r?"T"+Yn(t,2)+":"+Yn(n,2)+":"+Yn(i,2)+"."+Yn(r,3)+"Z":i?"T"+Yn(t,2)+":"+Yn(n,2)+":"+Yn(i,2)+"Z":n||t?"T"+Yn(t,2)+":"+Yn(n,2)+"Z":"")}function gU(e){var t=new RegExp('["'+e+` -\r]`),n=e.charCodeAt(0);function i(f,d){var h,p,g=r(f,function(m,y){if(h)return h(m,y-1);p=m,h=d?dU(m,d):p4(m)});return g.columns=p||[],g}function r(f,d){var h=[],p=f.length,g=0,m=0,y,b=p<=0,v=!1;f.charCodeAt(p-1)===Ic&&--p,f.charCodeAt(p-1)===b2&&--p;function x(){if(b)return m2;if(v)return v=!1,h4;var k,w=g,$;if(f.charCodeAt(w)===y2){for(;g++=p?b=!0:($=f.charCodeAt(g++))===Ic?v=!0:$===b2&&(v=!0,f.charCodeAt(g)===Ic&&++g),f.slice(w+1,k-1).replace(/""/g,'"')}for(;gfunction(t){return t[e]},iU=e=>{const t=e.length;return function(n){for(let i=0;io?u():o=a+1:l==="["?(a>o&&u(),r=o=a+1):l==="]"&&(r||U("Access path missing open bracket: "+e),r>0&&u(),r=0,o=a+1)}return r&&U("Access path missing closing bracket: "+e),i&&U("Access path missing closing quote: "+e),a>o&&(a++,u()),t}function Ti(e,t,n){const i=Nr(e);return e=i.length===1?i[0]:e,Xn((n&&n.get||U6)(i),[e],t||e)}const Oc=Ti("id"),dn=Xn(e=>e,[],"identity"),no=Xn(()=>0,[],"zero"),ql=Xn(()=>1,[],"one"),Mi=Xn(()=>!0,[],"true"),io=Xn(()=>!1,[],"false");function rU(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const q6=0,r2=1,s2=2,W6=3,H6=4;function o2(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:rU,i=e||q6;return{level(r){return arguments.length?(i=+r,this):i},error(){return i>=r2&&n(t||"error","ERROR",arguments),this},warn(){return i>=s2&&n(t||"warn","WARN",arguments),this},info(){return i>=W6&&n(t||"log","INFO",arguments),this},debug(){return i>=H6&&n(t||"log","DEBUG",arguments),this}}}var q=Array.isArray;function re(e){return e===Object(e)}const G6=e=>e!=="__proto__";function Wl(){for(var e=arguments.length,t=new Array(e),n=0;n{for(const s in r)if(s==="signals")i.signals=sU(i.signals,r.signals);else{const o=s==="legend"?{layout:1}:s==="style"?!0:null;Hl(i,s,r[s],o)}return i},{})}function Hl(e,t,n,i){if(!G6(t))return;let r,s;if(re(n)&&!q(n)){s=re(e[t])?e[t]:e[t]={};for(r in n)i&&(i===!0||i[r])?Hl(s,r,n[r]):G6(r)&&(s[r]=n[r])}else e[t]=n}function sU(e,t){if(e==null)return t;const n={},i=[];function r(s){n[s.name]||(n[s.name]=1,i.push(s))}return t.forEach(r),e.forEach(r),i}function Ue(e){return e[e.length-1]}function hn(e){return e==null||e===""?null:+e}const V6=e=>t=>e*Math.exp(t),X6=e=>t=>Math.log(e*t),Y6=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),Z6=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,Dh=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function Nh(e,t,n,i){const r=n(e[0]),s=n(Ue(e)),o=(s-r)*t;return[i(r-o),i(s-o)]}function K6(e,t){return Nh(e,t,hn,dn)}function J6(e,t){var n=Math.sign(e[0]);return Nh(e,t,X6(n),V6(n))}function Q6(e,t,n){return Nh(e,t,Dh(n),Dh(1/n))}function e4(e,t,n){return Nh(e,t,Y6(n),Z6(n))}function Oh(e,t,n,i,r){const s=i(e[0]),o=i(Ue(e)),a=t!=null?i(t):(s+o)/2;return[r(a+(s-a)*n),r(a+(o-a)*n)]}function a2(e,t,n){return Oh(e,t,n,hn,dn)}function l2(e,t,n){const i=Math.sign(e[0]);return Oh(e,t,n,X6(i),V6(i))}function Rh(e,t,n,i){return Oh(e,t,n,Dh(i),Dh(1/i))}function u2(e,t,n,i){return Oh(e,t,n,Y6(i),Z6(i))}function t4(e){return 1+~~(new Date(e).getMonth()/3)}function n4(e){return 1+~~(new Date(e).getUTCMonth()/3)}function ee(e){return e!=null?q(e)?e:[e]:[]}function i4(e,t,n){let i=e[0],r=e[1],s;return r=n-t?[t,n]:[i=Math.min(Math.max(i,t),n-s),i+s]}function Me(e){return typeof e=="function"}const oU="descending";function c2(e,t,n){n=n||{},t=ee(t)||[];const i=[],r=[],s={},o=n.comparator||aU;return ee(e).forEach((a,l)=>{a!=null&&(i.push(t[l]===oU?-1:1),r.push(a=Me(a)?a:Ti(a,null,n)),(fn(a)||[]).forEach(u=>s[u]=1))}),r.length===0?null:Xn(o(r,i),Object.keys(s))}const Lh=(e,t)=>(et||t==null)&&e!=null?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t===t?-1:t!==t&&e===e?1:0),aU=(e,t)=>e.length===1?lU(e[0],t[0]):uU(e,t,e.length),lU=(e,t)=>function(n,i){return Lh(e(n),e(i))*t},uU=(e,t,n)=>(t.push(0),function(i,r){let s,o=0,a=-1;for(;o===0&&++ae}function f2(e,t){let n;return i=>{n&&clearTimeout(n),n=setTimeout(()=>(t(i),n=null),e)}}function Fe(e){for(let t,n,i=1,r=arguments.length;io&&(o=r))}else{for(r=t(e[n]);no&&(o=r))}return[s,o]}function r4(e,t){const n=e.length;let i=-1,r,s,o,a,l;if(t==null){for(;++i=s){r=o=s;break}if(i===n)return[-1,-1];for(a=l=i;++is&&(r=s,a=i),o=s){r=o=s;break}if(i===n)return[-1,-1];for(a=l=i;++is&&(r=s,a=i),o{r.set(s,e[s])}),r}function s4(e,t,n,i,r,s){if(!n&&n!==0)return s;const o=+n;let a=e[0],l=Ue(e),u;ls&&(o=r,r=s,s=o),n=n===void 0||n,i=i===void 0||i,(n?r<=e:ra.replace(/\\(.)/g,"$1")):ee(e));const i=e&&e.length,r=n&&n.get||U6,s=a=>r(t?[a]:Nr(a));let o;if(!i)o=function(){return""};else if(i===1){const a=s(e[0]);o=function(l){return""+a(l)}}else{const a=e.map(s);o=function(l){let u=""+a[0](l),c=0;for(;++c{t={},n={},i=0},s=(o,a)=>(++i>e&&(n=t,t={},i=1),t[o]=a);return r(),{clear:r,has:o=>me(t,o)||me(n,o),get:o=>me(t,o)?t[o]:me(n,o)?s(o,n[o]):void 0,set:(o,a)=>me(t,o)?t[o]=a:s(o,a)}}function c4(e,t,n,i){const r=t.length,s=n.length;if(!s)return t;if(!r)return n;const o=i||new t.constructor(r+s);let a=0,l=0,u=0;for(;a0?n[l++]:t[a++];for(;a=0;)n+=e;return n}function f4(e,t,n,i){const r=n||" ",s=e+"",o=t-s.length;return o<=0?s:i==="left"?Rc(r,o)+s:i==="center"?Rc(r,~~(o/2))+s+Rc(r,Math.ceil(o/2)):s+Rc(r,o)}function Lc(e){return e&&Ue(e)-e[0]||0}function J(e){return q(e)?"["+e.map(J)+"]":re(e)||te(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function h2(e){return e==null||e===""?null:!e||e==="false"||e==="0"?!1:!!e}const dU=e=>Xe(e)||so(e)?e:Date.parse(e);function p2(e,t){return t=t||dU,e==null||e===""?null:t(e)}function g2(e){return e==null||e===""?null:e+""}function Ki(e){const t={},n=e.length;for(let i=0;i9999?"+"+Yn(e,6):Yn(e,4)}function gU(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),i=e.getUTCSeconds(),r=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":pU(e.getUTCFullYear())+"-"+Yn(e.getUTCMonth()+1,2)+"-"+Yn(e.getUTCDate(),2)+(r?"T"+Yn(t,2)+":"+Yn(n,2)+":"+Yn(i,2)+"."+Yn(r,3)+"Z":i?"T"+Yn(t,2)+":"+Yn(n,2)+":"+Yn(i,2)+"Z":n||t?"T"+Yn(t,2)+":"+Yn(n,2)+"Z":"")}function mU(e){var t=new RegExp('["'+e+` +\r]`),n=e.charCodeAt(0);function i(f,d){var h,p,g=r(f,function(m,y){if(h)return h(m,y-1);p=m,h=d?hU(m,d):p4(m)});return g.columns=p||[],g}function r(f,d){var h=[],p=f.length,g=0,m=0,y,b=p<=0,v=!1;f.charCodeAt(p-1)===Ic&&--p,f.charCodeAt(p-1)===b2&&--p;function x(){if(b)return m2;if(v)return v=!1,h4;var k,w=g,$;if(f.charCodeAt(w)===y2){for(;g++=p?b=!0:($=f.charCodeAt(g++))===Ic?v=!0:$===b2&&(v=!0,f.charCodeAt(g)===Ic&&++g),f.slice(w+1,k-1).replace(/""/g,'"')}for(;g1)i=kU(e,t,n);else for(r=0,i=new Array(s=e.arcs.length);rt?1:e>=t?0:NaN}function $U(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Xl(e){let t,n,i;e.length!==2?(t=ys,n=(a,l)=>ys(e(a),l),i=(a,l)=>e(a)-l):(t=e===ys||e===$U?e:EU,n=e,i=e);function r(a,l,u=0,c=a.length){if(u>>1;n(a[f],l)<0?u=f+1:c=f}while(u>>1;n(a[f],l)<=0?u=f+1:c=f}while(uu&&i(a[f-1],l)>-i(a[f],l)?f-1:f}return{left:r,center:o,right:s}}function EU(){return 0}function b4(e){return e===null?NaN:+e}function*CU(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of e)(i=t(i,++n,e))!=null&&(i=+i)>=i&&(yield i)}}const v4=Xl(ys),zh=v4.right,SU=v4.left;Xl(b4).center;const zc=zh;function AU(e,t){let n=0,i,r=0,s=0;if(t===void 0)for(let o of e)o!=null&&(o=+o)>=o&&(i=o-r,r+=i/++n,s+=i*(o-r));else{let o=-1;for(let a of e)(a=t(a,++o,e))!=null&&(a=+a)>=a&&(i=a-r,r+=i/++n,s+=i*(a-r))}if(n>1)return s/(n-1)}function TU(e,t){const n=AU(e,t);return n&&Math.sqrt(n)}class Sn{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let i=0;for(let r=0;r0){for(o=t[--n];n>0&&(i=o,r=t[--n],o=i+r,s=r-(o-i),!s););n>0&&(s<0&&t[n-1]<0||s>0&&t[n-1]>0)&&(r=s*2,i=o+r,r==i-o&&(o=i))}return o}}class x4 extends Map{constructor(t,n=k4){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[i,r]of t)this.set(i,r)}get(t){return super.get(v2(this,t))}has(t){return super.has(v2(this,t))}set(t,n){return super.set(_4(this,t),n)}delete(t){return super.delete(w4(this,t))}}class Ph extends Set{constructor(t,n=k4){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const i of t)this.add(i)}has(t){return super.has(v2(this,t))}add(t){return super.add(_4(this,t))}delete(t){return super.delete(w4(this,t))}}function v2({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function _4({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}function w4({_intern:e,_key:t},n){const i=t(n);return e.has(i)&&(n=e.get(i),e.delete(i)),n}function k4(e){return e!==null&&typeof e=="object"?e.valueOf():e}function MU(e,t){return Array.from(t,n=>e[n])}function FU(e=ys){if(e===ys)return $4;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const i=e(t,n);return i||i===0?i:(e(n,n)===0)-(e(t,t)===0)}}function $4(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const DU=Math.sqrt(50),NU=Math.sqrt(10),OU=Math.sqrt(2);function Bh(e,t,n){const i=(t-e)/Math.max(0,n),r=Math.floor(Math.log10(i)),s=i/Math.pow(10,r),o=s>=DU?10:s>=NU?5:s>=OU?2:1;let a,l,u;return r<0?(u=Math.pow(10,-r)/o,a=Math.round(e*u),l=Math.round(t*u),a/ut&&--l,u=-u):(u=Math.pow(10,r)*o,a=Math.round(e/u),l=Math.round(t/u),a*ut&&--l),l0))return[];if(e===t)return[e];const i=t=r))return[];const a=s-r+1,l=new Array(a);if(i)if(o<0)for(let u=0;u=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n=r)&&(n=r)}return n}function w2(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n>i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n>r||n===void 0&&r>=r)&&(n=r)}return n}function E4(e,t,n=0,i=1/0,r){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),i=Math.floor(Math.min(e.length-1,i)),!(n<=t&&t<=i))return e;for(r=r===void 0?$4:FU(r);i>n;){if(i-n>600){const l=i-n+1,u=t-n+1,c=Math.log(l),f=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*f*(l-f)/l)*(u-l/2<0?-1:1),h=Math.max(n,Math.floor(t-u*f/l+d)),p=Math.min(i,Math.floor(t+(l-u)*f/l+d));E4(e,t,h,p,r)}const s=e[t];let o=n,a=i;for(Pc(e,n,t),r(e[i],s)>0&&Pc(e,n,i);o0;)--a}r(e[n],s)===0?Pc(e,n,a):(++a,Pc(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}return e}function Pc(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function k2(e,t,n){if(e=Float64Array.from(CU(e,n)),!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return w2(e);if(t>=1)return ga(e);var i,r=(i-1)*t,s=Math.floor(r),o=ga(E4(e,s).subarray(0,s+1)),a=w2(e.subarray(s+1));return o+(a-o)*(r-s)}}function C4(e,t,n=b4){if(!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return+n(e[0],0,e);if(t>=1)return+n(e[i-1],i-1,e);var i,r=(i-1)*t,s=Math.floor(r),o=+n(e[s],s,e),a=+n(e[s+1],s+1,e);return o+(a-o)*(r-s)}}function RU(e,t){let n=0,i=0;if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&(++n,i+=r);else{let r=-1;for(let s of e)(s=t(s,++r,e))!=null&&(s=+s)>=s&&(++n,i+=s)}if(n)return i/n}function S4(e,t){return k2(e,.5,t)}function*LU(e){for(const t of e)yield*t}function A4(e){return Array.from(LU(e))}function hi(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(r);++i=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function jh(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,i=e.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+e.slice(n+1)]}function Yl(e){return e=jh(Math.abs(e)),e?e[1]:NaN}function jU(e,t){return function(n,i){for(var r=n.length,s=[],o=0,a=e[0],l=0;r>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),s.push(n.substring(r-=a,r+a)),!((l+=a+1)>i));)a=e[o=(o+1)%e.length];return s.reverse().join(t)}}function UU(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var qU=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ma(e){if(!(t=qU.exec(e)))throw new Error("invalid format: "+e);var t;return new $2({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}ma.prototype=$2.prototype;function $2(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}$2.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function WU(e){e:for(var t=e.length,n=1,i=-1,r;n0&&(i=0);break}return i>0?e.slice(0,i)+e.slice(r+1):e}var M4;function HU(e,t){var n=jh(e,t);if(!n)return e+"";var i=n[0],r=n[1],s=r-(M4=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,o=i.length;return s===o?i:s>o?i+new Array(s-o+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+jh(e,Math.max(0,t+s-1))[0]}function F4(e,t){var n=jh(e,t);if(!n)return e+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}const D4={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:BU,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>F4(e*100,t),r:F4,s:HU,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function N4(e){return e}var O4=Array.prototype.map,R4=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function L4(e){var t=e.grouping===void 0||e.thousands===void 0?N4:jU(O4.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",i=e.currency===void 0?"":e.currency[1]+"",r=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?N4:UU(O4.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",a=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(f){f=ma(f);var d=f.fill,h=f.align,p=f.sign,g=f.symbol,m=f.zero,y=f.width,b=f.comma,v=f.precision,x=f.trim,_=f.type;_==="n"?(b=!0,_="g"):D4[_]||(v===void 0&&(v=12),x=!0,_="g"),(m||d==="0"&&h==="=")&&(m=!0,d="0",h="=");var k=g==="$"?n:g==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",w=g==="$"?i:/[%p]/.test(_)?o:"",$=D4[_],S=/[defgprs%]/.test(_);v=v===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v));function E(A){var R=k,C=w,M,T,O;if(_==="c")C=$(A)+C,A="";else{A=+A;var P=A<0||1/A<0;if(A=isNaN(A)?l:$(Math.abs(A),v),x&&(A=WU(A)),P&&+A==0&&p!=="+"&&(P=!1),R=(P?p==="("?p:a:p==="-"||p==="("?"":p)+R,C=(_==="s"?R4[8+M4/3]:"")+C+(P&&p==="("?")":""),S){for(M=-1,T=A.length;++MO||O>57){C=(O===46?r+A.slice(M+1):A.slice(M))+C,A=A.slice(0,M);break}}}b&&!m&&(A=t(A,1/0));var j=R.length+A.length+C.length,W=j>1)+R+A+C+W.slice(j);break;default:A=W+R+A+C;break}return s(A)}return E.toString=function(){return f+""},E}function c(f,d){var h=u((f=ma(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(Yl(d)/3)))*3,g=Math.pow(10,-p),m=R4[8+p/3];return function(y){return h(g*y)+m}}return{format:u,formatPrefix:c}}var Uh,qh,E2;GU({thousands:",",grouping:[3],currency:["$",""]});function GU(e){return Uh=L4(e),qh=Uh.format,E2=Uh.formatPrefix,Uh}function I4(e){return Math.max(0,-Yl(Math.abs(e)))}function z4(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Yl(t)/3)))*3-Yl(Math.abs(e)))}function P4(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Yl(t)-Yl(e))+1}const C2=new Date,S2=new Date;function Lt(e,t,n,i){function r(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return r.floor=s=>(e(s=new Date(+s)),s),r.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),r.round=s=>{const o=r(s),a=r.ceil(s);return s-o(t(s=new Date(+s),o==null?1:Math.floor(o)),s),r.range=(s,o,a)=>{const l=[];if(s=r.ceil(s),a=a==null?1:Math.floor(a),!(s0))return l;let u;do l.push(u=new Date(+s)),t(s,a),e(s);while(uLt(o=>{if(o>=o)for(;e(o),!s(o);)o.setTime(o-1)},(o,a)=>{if(o>=o)if(a<0)for(;++a<=0;)for(;t(o,-1),!s(o););else for(;--a>=0;)for(;t(o,1),!s(o););}),n&&(r.count=(s,o)=>(C2.setTime(+s),S2.setTime(+o),e(C2),e(S2),Math.floor(n(C2,S2))),r.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?r.filter(i?o=>i(o)%s===0:o=>r.count(0,o)%s===0):r)),r}const Zl=Lt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Zl.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Lt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Zl),Zl.range;const bs=1e3,Mi=bs*60,vs=Mi*60,xs=vs*24,A2=xs*7,B4=xs*30,T2=xs*365,_s=Lt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*bs)},(e,t)=>(t-e)/bs,e=>e.getUTCSeconds());_s.range;const Wh=Lt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*bs)},(e,t)=>{e.setTime(+e+t*Mi)},(e,t)=>(t-e)/Mi,e=>e.getMinutes());Wh.range;const Hh=Lt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Mi)},(e,t)=>(t-e)/Mi,e=>e.getUTCMinutes());Hh.range;const Gh=Lt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*bs-e.getMinutes()*Mi)},(e,t)=>{e.setTime(+e+t*vs)},(e,t)=>(t-e)/vs,e=>e.getHours());Gh.range;const Vh=Lt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*vs)},(e,t)=>(t-e)/vs,e=>e.getUTCHours());Vh.range;const ws=Lt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Mi)/xs,e=>e.getDate()-1);ws.range;const lo=Lt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/xs,e=>e.getUTCDate()-1);lo.range;const j4=Lt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/xs,e=>Math.floor(e/xs));j4.range;function ya(e){return Lt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Mi)/A2)}const Kl=ya(0),Xh=ya(1),VU=ya(2),XU=ya(3),Jl=ya(4),YU=ya(5),ZU=ya(6);Kl.range,Xh.range,VU.range,XU.range,Jl.range,YU.range,ZU.range;function ba(e){return Lt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/A2)}const Ql=ba(0),Yh=ba(1),KU=ba(2),JU=ba(3),eu=ba(4),QU=ba(5),eq=ba(6);Ql.range,Yh.range,KU.range,JU.range,eu.range,QU.range,eq.range;const Bc=Lt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Bc.range;const jc=Lt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());jc.range;const Rr=Lt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Rr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Lt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),Rr.range;const Lr=Lt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Lr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Lt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),Lr.range;function U4(e,t,n,i,r,s){const o=[[_s,1,bs],[_s,5,5*bs],[_s,15,15*bs],[_s,30,30*bs],[s,1,Mi],[s,5,5*Mi],[s,15,15*Mi],[s,30,30*Mi],[r,1,vs],[r,3,3*vs],[r,6,6*vs],[r,12,12*vs],[i,1,xs],[i,2,2*xs],[n,1,A2],[t,1,B4],[t,3,3*B4],[e,1,T2]];function a(u,c,f){const d=cm).right(o,d);if(h===o.length)return e.every(ao(u/T2,c/T2,f));if(h===0)return Zl.every(Math.max(ao(u,c,f),1));const[p,g]=o[d/o[h-1][2](e[t]=1+n,e),{});function D2(e){const t=ee(e).slice(),n={};return t.length||U("Missing time unit."),t.forEach(r=>{pe(F2,r)?n[r]=1:U(`Invalid time unit: ${r}.`)}),(n[It]||n[mn]?1:0)+(n[Zn]||n[gn]||n[Kn]?1:0)+(n[Ir]?1:0)>1&&U(`Incompatible time units: ${e}`),t.sort((r,s)=>F2[r]-F2[s]),t}const sq={[nn]:"%Y ",[Zn]:"Q%q ",[gn]:"%b ",[Kn]:"%d ",[It]:"W%U ",[mn]:"%a ",[Ir]:"%j ",[pi]:"%H:00",[gi]:"00:%M",[Fi]:":%S",[Ji]:".%L",[`${nn}-${gn}`]:"%Y-%m ",[`${nn}-${gn}-${Kn}`]:"%Y-%m-%d ",[`${pi}-${gi}`]:"%H:%M"};function q4(e,t){const n=Fe({},sq,t),i=D2(e),r=i.length;let s="",o=0,a,l;for(o=0;oo;--a)if(l=i.slice(o,a).join("-"),n[l]!=null){s+=n[l],o=a;break}return s.trim()}const va=new Date;function N2(e){return va.setFullYear(e),va.setMonth(0),va.setDate(1),va.setHours(0,0,0,0),va}function W4(e){return G4(new Date(e))}function H4(e){return O2(new Date(e))}function G4(e){return ws.count(N2(e.getFullYear())-1,e)}function O2(e){return Kl.count(N2(e.getFullYear())-1,e)}function R2(e){return N2(e).getDay()}function oq(e,t,n,i,r,s,o){if(0<=e&&e<100){const a=new Date(-1,t,n,i,r,s,o);return a.setFullYear(e),a}return new Date(e,t,n,i,r,s,o)}function V4(e){return Y4(new Date(e))}function X4(e){return L2(new Date(e))}function Y4(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return lo.count(t-1,e)}function L2(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Ql.count(t-1,e)}function I2(e){return va.setTime(Date.UTC(e,0,1)),va.getUTCDay()}function aq(e,t,n,i,r,s,o){if(0<=e&&e<100){const a=new Date(Date.UTC(-1,t,n,i,r,s,o));return a.setUTCFullYear(n.y),a}return new Date(Date.UTC(e,t,n,i,r,s,o))}function Z4(e,t,n,i,r){const s=t||1,o=Ue(e),a=(y,b,v)=>(v=v||y,lq(n[v],i[v],y===o&&s,b)),l=new Date,u=Ki(e),c=u[nn]?a(nn):pn(2012),f=u[gn]?a(gn):u[Zn]?a(Zn):no,d=u[It]&&u[mn]?a(mn,1,It+mn):u[It]?a(It,1):u[mn]?a(mn,1):u[Kn]?a(Kn,1):u[Ir]?a(Ir,1):ql,h=u[pi]?a(pi):no,p=u[gi]?a(gi):no,g=u[Fi]?a(Fi):no,m=u[Ji]?a(Ji):no;return function(y){l.setTime(+y);const b=c(l);return r(b,f(l),d(l,b),h(l),p(l),g(l),m(l))}}function lq(e,t,n,i){const r=n<=1?e:i?(s,o)=>i+n*Math.floor((e(s,o)-i)/n):(s,o)=>n*Math.floor(e(s,o)/n);return t?(s,o)=>t(r(s,o),o):r}function tu(e,t,n){return t+e*7-(n+6)%7}const uq={[nn]:e=>e.getFullYear(),[Zn]:e=>Math.floor(e.getMonth()/3),[gn]:e=>e.getMonth(),[Kn]:e=>e.getDate(),[pi]:e=>e.getHours(),[gi]:e=>e.getMinutes(),[Fi]:e=>e.getSeconds(),[Ji]:e=>e.getMilliseconds(),[Ir]:e=>G4(e),[It]:e=>O2(e),[It+mn]:(e,t)=>tu(O2(e),e.getDay(),R2(t)),[mn]:(e,t)=>tu(1,e.getDay(),R2(t))},cq={[Zn]:e=>3*e,[It]:(e,t)=>tu(e,0,R2(t))};function K4(e,t){return Z4(e,t||1,uq,cq,oq)}const fq={[nn]:e=>e.getUTCFullYear(),[Zn]:e=>Math.floor(e.getUTCMonth()/3),[gn]:e=>e.getUTCMonth(),[Kn]:e=>e.getUTCDate(),[pi]:e=>e.getUTCHours(),[gi]:e=>e.getUTCMinutes(),[Fi]:e=>e.getUTCSeconds(),[Ji]:e=>e.getUTCMilliseconds(),[Ir]:e=>Y4(e),[It]:e=>L2(e),[mn]:(e,t)=>tu(1,e.getUTCDay(),I2(t)),[It+mn]:(e,t)=>tu(L2(e),e.getUTCDay(),I2(t))},dq={[Zn]:e=>3*e,[It]:(e,t)=>tu(e,0,I2(t))};function J4(e,t){return Z4(e,t||1,fq,dq,aq)}const hq={[nn]:Rr,[Zn]:Bc.every(3),[gn]:Bc,[It]:Kl,[Kn]:ws,[mn]:ws,[Ir]:ws,[pi]:Gh,[gi]:Wh,[Fi]:_s,[Ji]:Zl},pq={[nn]:Lr,[Zn]:jc.every(3),[gn]:jc,[It]:Ql,[Kn]:lo,[mn]:lo,[Ir]:lo,[pi]:Vh,[gi]:Hh,[Fi]:_s,[Ji]:Zl};function nu(e){return hq[e]}function iu(e){return pq[e]}function Q4(e,t,n){return e?e.offset(t,n):void 0}function e8(e,t,n){return Q4(nu(e),t,n)}function t8(e,t,n){return Q4(iu(e),t,n)}function n8(e,t,n,i){return e?e.range(t,n,i):void 0}function i8(e,t,n,i){return n8(nu(e),t,n,i)}function r8(e,t,n,i){return n8(iu(e),t,n,i)}const Uc=1e3,qc=Uc*60,Wc=qc*60,Zh=Wc*24,gq=Zh*7,s8=Zh*30,z2=Zh*365,o8=[nn,gn,Kn,pi,gi,Fi,Ji],Hc=o8.slice(0,-1),Gc=Hc.slice(0,-1),Vc=Gc.slice(0,-1),mq=Vc.slice(0,-1),yq=[nn,It],a8=[nn,gn],l8=[nn],Xc=[[Hc,1,Uc],[Hc,5,5*Uc],[Hc,15,15*Uc],[Hc,30,30*Uc],[Gc,1,qc],[Gc,5,5*qc],[Gc,15,15*qc],[Gc,30,30*qc],[Vc,1,Wc],[Vc,3,3*Wc],[Vc,6,6*Wc],[Vc,12,12*Wc],[mq,1,Zh],[yq,1,gq],[a8,1,s8],[a8,3,3*s8],[l8,1,z2]];function u8(e){const t=e.extent,n=e.maxbins||40,i=Math.abs(Lc(t))/n;let r=Xl(a=>a[2]).right(Xc,i),s,o;return r===Xc.length?(s=l8,o=ao(t[0]/z2,t[1]/z2,n)):r?(r=Xc[i/Xc[r-1][2]53)return null;"w"in V||(V.w=1),"Z"in V?(He=B2(Yc(V.y,0,1)),Cn=He.getUTCDay(),He=Cn>4||Cn===0?Yh.ceil(He):Yh(He),He=lo.offset(He,(V.V-1)*7),V.y=He.getUTCFullYear(),V.m=He.getUTCMonth(),V.d=He.getUTCDate()+(V.w+6)%7):(He=P2(Yc(V.y,0,1)),Cn=He.getDay(),He=Cn>4||Cn===0?Xh.ceil(He):Xh(He),He=ws.offset(He,(V.V-1)*7),V.y=He.getFullYear(),V.m=He.getMonth(),V.d=He.getDate()+(V.w+6)%7)}else("W"in V||"U"in V)&&("w"in V||(V.w="u"in V?V.u%7:"W"in V?1:0),Cn="Z"in V?B2(Yc(V.y,0,1)).getUTCDay():P2(Yc(V.y,0,1)).getDay(),V.m=0,V.d="W"in V?(V.w+6)%7+V.W*7-(Cn+5)%7:V.w+V.U*7-(Cn+6)%7);return"Z"in V?(V.H+=V.Z/100|0,V.M+=V.Z%100,B2(V)):P2(V)}}function $(se,Te,De,V){for(var qt=0,He=Te.length,Cn=De.length,Hn,Rl;qt=Cn)return-1;if(Hn=Te.charCodeAt(qt++),Hn===37){if(Hn=Te.charAt(qt++),Rl=_[Hn in f8?Te.charAt(qt++):Hn],!Rl||(V=Rl(se,De,V))<0)return-1}else if(Hn!=De.charCodeAt(V++))return-1}return V}function S(se,Te,De){var V=u.exec(Te.slice(De));return V?(se.p=c.get(V[0].toLowerCase()),De+V[0].length):-1}function E(se,Te,De){var V=h.exec(Te.slice(De));return V?(se.w=p.get(V[0].toLowerCase()),De+V[0].length):-1}function A(se,Te,De){var V=f.exec(Te.slice(De));return V?(se.w=d.get(V[0].toLowerCase()),De+V[0].length):-1}function R(se,Te,De){var V=y.exec(Te.slice(De));return V?(se.m=b.get(V[0].toLowerCase()),De+V[0].length):-1}function C(se,Te,De){var V=g.exec(Te.slice(De));return V?(se.m=m.get(V[0].toLowerCase()),De+V[0].length):-1}function M(se,Te,De){return $(se,t,Te,De)}function T(se,Te,De){return $(se,n,Te,De)}function O(se,Te,De){return $(se,i,Te,De)}function P(se){return o[se.getDay()]}function j(se){return s[se.getDay()]}function W(se){return l[se.getMonth()]}function ne(se){return a[se.getMonth()]}function ae(se){return r[+(se.getHours()>=12)]}function ke(se){return 1+~~(se.getMonth()/3)}function Ie(se){return o[se.getUTCDay()]}function Le(se){return s[se.getUTCDay()]}function We(se){return l[se.getUTCMonth()]}function Wn(se){return a[se.getUTCMonth()]}function Mr(se){return r[+(se.getUTCHours()>=12)]}function Vi(se){return 1+~~(se.getUTCMonth()/3)}return{format:function(se){var Te=k(se+="",v);return Te.toString=function(){return se},Te},parse:function(se){var Te=w(se+="",!1);return Te.toString=function(){return se},Te},utcFormat:function(se){var Te=k(se+="",x);return Te.toString=function(){return se},Te},utcParse:function(se){var Te=w(se+="",!0);return Te.toString=function(){return se},Te}}}var f8={"-":"",_:" ",0:"0"},Wt=/^\s*\d+/,bq=/^%/,vq=/[\\^$*+?|[\]().{}]/g;function Ze(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",s=r.length;return i+(s[t.toLowerCase(),n]))}function _q(e,t,n){var i=Wt.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function wq(e,t,n){var i=Wt.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function kq(e,t,n){var i=Wt.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function $q(e,t,n){var i=Wt.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function Eq(e,t,n){var i=Wt.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function d8(e,t,n){var i=Wt.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function h8(e,t,n){var i=Wt.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function Cq(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function Sq(e,t,n){var i=Wt.exec(t.slice(n,n+1));return i?(e.q=i[0]*3-3,n+i[0].length):-1}function Aq(e,t,n){var i=Wt.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function p8(e,t,n){var i=Wt.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function Tq(e,t,n){var i=Wt.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function g8(e,t,n){var i=Wt.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function Mq(e,t,n){var i=Wt.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function Fq(e,t,n){var i=Wt.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function Dq(e,t,n){var i=Wt.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function Nq(e,t,n){var i=Wt.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function Oq(e,t,n){var i=bq.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function Rq(e,t,n){var i=Wt.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function Lq(e,t,n){var i=Wt.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function m8(e,t){return Ze(e.getDate(),t,2)}function Iq(e,t){return Ze(e.getHours(),t,2)}function zq(e,t){return Ze(e.getHours()%12||12,t,2)}function Pq(e,t){return Ze(1+ws.count(Rr(e),e),t,3)}function y8(e,t){return Ze(e.getMilliseconds(),t,3)}function Bq(e,t){return y8(e,t)+"000"}function jq(e,t){return Ze(e.getMonth()+1,t,2)}function Uq(e,t){return Ze(e.getMinutes(),t,2)}function qq(e,t){return Ze(e.getSeconds(),t,2)}function Wq(e){var t=e.getDay();return t===0?7:t}function Hq(e,t){return Ze(Kl.count(Rr(e)-1,e),t,2)}function b8(e){var t=e.getDay();return t>=4||t===0?Jl(e):Jl.ceil(e)}function Gq(e,t){return e=b8(e),Ze(Jl.count(Rr(e),e)+(Rr(e).getDay()===4),t,2)}function Vq(e){return e.getDay()}function Xq(e,t){return Ze(Xh.count(Rr(e)-1,e),t,2)}function Yq(e,t){return Ze(e.getFullYear()%100,t,2)}function Zq(e,t){return e=b8(e),Ze(e.getFullYear()%100,t,2)}function Kq(e,t){return Ze(e.getFullYear()%1e4,t,4)}function Jq(e,t){var n=e.getDay();return e=n>=4||n===0?Jl(e):Jl.ceil(e),Ze(e.getFullYear()%1e4,t,4)}function Qq(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ze(t/60|0,"0",2)+Ze(t%60,"0",2)}function v8(e,t){return Ze(e.getUTCDate(),t,2)}function eW(e,t){return Ze(e.getUTCHours(),t,2)}function tW(e,t){return Ze(e.getUTCHours()%12||12,t,2)}function nW(e,t){return Ze(1+lo.count(Lr(e),e),t,3)}function x8(e,t){return Ze(e.getUTCMilliseconds(),t,3)}function iW(e,t){return x8(e,t)+"000"}function rW(e,t){return Ze(e.getUTCMonth()+1,t,2)}function sW(e,t){return Ze(e.getUTCMinutes(),t,2)}function oW(e,t){return Ze(e.getUTCSeconds(),t,2)}function aW(e){var t=e.getUTCDay();return t===0?7:t}function lW(e,t){return Ze(Ql.count(Lr(e)-1,e),t,2)}function _8(e){var t=e.getUTCDay();return t>=4||t===0?eu(e):eu.ceil(e)}function uW(e,t){return e=_8(e),Ze(eu.count(Lr(e),e)+(Lr(e).getUTCDay()===4),t,2)}function cW(e){return e.getUTCDay()}function fW(e,t){return Ze(Yh.count(Lr(e)-1,e),t,2)}function dW(e,t){return Ze(e.getUTCFullYear()%100,t,2)}function hW(e,t){return e=_8(e),Ze(e.getUTCFullYear()%100,t,2)}function pW(e,t){return Ze(e.getUTCFullYear()%1e4,t,4)}function gW(e,t){var n=e.getUTCDay();return e=n>=4||n===0?eu(e):eu.ceil(e),Ze(e.getUTCFullYear()%1e4,t,4)}function mW(){return"+0000"}function w8(){return"%"}function k8(e){return+e}function $8(e){return Math.floor(+e/1e3)}var ru,j2,E8,U2,C8;yW({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function yW(e){return ru=c8(e),j2=ru.format,E8=ru.parse,U2=ru.utcFormat,C8=ru.utcParse,ru}function Jc(e){const t={};return n=>t[n]||(t[n]=e(n))}function bW(e,t){return n=>{const i=e(n),r=i.indexOf(t);if(r<0)return i;let s=vW(i,r);const o=sr;)if(i[s]!=="0"){++s;break}return i.slice(0,s)+o}}function vW(e,t){let n=e.lastIndexOf("e"),i;if(n>0)return n;for(n=e.length;--n>t;)if(i=e.charCodeAt(n),i>=48&&i<=57)return n+1}function S8(e){const t=Jc(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(i){const r=ma(i||",");if(r.precision==null){switch(r.precision=12,r.type){case"%":r.precision-=2;break;case"e":r.precision-=1;break}return bW(t(r),t(".1f")(1)[1])}else return t(r)},formatSpan(i,r,s,o){o=ma(o??",f");const a=ao(i,r,s),l=Math.max(Math.abs(i),Math.abs(r));let u;if(o.precision==null)switch(o.type){case"s":return isNaN(u=z4(a,l))||(o.precision=u),n(o,l);case"":case"e":case"g":case"p":case"r":{isNaN(u=P4(a,l))||(o.precision=u-(o.type==="e"));break}case"f":case"%":{isNaN(u=I4(a))||(o.precision=u-(o.type==="%")*2);break}}return t(o)}}}let q2;A8();function A8(){return q2=S8({format:qh,formatPrefix:E2})}function T8(e){return S8(L4(e))}function Kh(e){return arguments.length?q2=T8(e):q2}function M8(e,t,n){n=n||{},ie(n)||U(`Invalid time multi-format specifier: ${n}`);const i=t(Fi),r=t(gi),s=t(pi),o=t(Kn),a=t(It),l=t(gn),u=t(Zn),c=t(nn),f=e(n[Ji]||".%L"),d=e(n[Fi]||":%S"),h=e(n[gi]||"%I:%M"),p=e(n[pi]||"%I %p"),g=e(n[Kn]||n[mn]||"%a %d"),m=e(n[It]||"%b %d"),y=e(n[gn]||"%B"),b=e(n[Zn]||"%B"),v=e(n[nn]||"%Y");return x=>(i(x)te(i)?t(i):M8(t,nu,i),utcFormat:i=>te(i)?n(i):M8(n,iu,i),timeParse:Jc(e.parse),utcParse:Jc(e.utcParse)}}let W2;D8();function D8(){return W2=F8({format:j2,parse:E8,utcFormat:U2,utcParse:C8})}function N8(e){return F8(c8(e))}function Qc(e){return arguments.length?W2=N8(e):W2}const H2=(e,t)=>Fe({},e,t);function O8(e,t){const n=e?T8(e):Kh(),i=t?N8(t):Qc();return H2(n,i)}function G2(e,t){const n=arguments.length;return n&&n!==2&&U("defaultLocale expects either zero or two arguments."),n?H2(Kh(e),Qc(t)):H2(Kh(),Qc())}function xW(){return A8(),D8(),G2()}const _W=/^(data:|([A-Za-z]+:)?\/\/)/,wW=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,kW=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,R8="file://";function $W(e,t){return n=>({options:n||{},sanitize:CW,load:EW,fileAccess:!!t,file:SW(t),http:TW(e)})}async function EW(e,t){const n=await this.sanitize(e,t),i=n.href;return n.localFile?this.file(i):this.http(i,t)}async function CW(e,t){t=Fe({},this.options,t);const n=this.fileAccess,i={href:null};let r,s,o;const a=wW.test(e.replace(kW,""));(e==null||typeof e!="string"||!a)&&U("Sanitize failure, invalid URI: "+J(e));const l=_W.test(e);return(o=t.baseURL)&&!l&&(!e.startsWith("/")&&!o.endsWith("/")&&(e="/"+e),e=o+e),s=(r=e.startsWith(R8))||t.mode==="file"||t.mode!=="http"&&!l&&n,r?e=e.slice(R8.length):e.startsWith("//")&&(t.defaultProtocol==="file"?(e=e.slice(2),s=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(i,"localFile",{value:!!s}),i.href=e,t.target&&(i.target=t.target+""),t.rel&&(i.rel=t.rel+""),t.context==="image"&&t.crossOrigin&&(i.crossOrigin=t.crossOrigin+""),i}function SW(e){return e?t=>new Promise((n,i)=>{e.readFile(t,(r,s)=>{r?i(r):n(s)})}):AW}async function AW(){U("No file system access.")}function TW(e){return e?async function(t,n){const i=Fe({},this.options.http,n),r=n&&n.response,s=await e(t,i);return s.ok?Me(s[r])?s[r]():s.text():U(s.status+""+s.statusText)}:MW}async function MW(){U("No HTTP fetch method available.")}const FW=e=>e!=null&&e===e,DW=e=>e==="true"||e==="false"||e===!0||e===!1,NW=e=>!Number.isNaN(Date.parse(e)),L8=e=>!Number.isNaN(+e)&&!(e instanceof Date),OW=e=>L8(e)&&Number.isInteger(+e),V2={boolean:h2,integer:hn,number:hn,date:p2,string:g2,unknown:dn},Jh=[DW,OW,L8,NW],RW=["boolean","integer","number","date"];function I8(e,t){if(!e||!e.length)return"unknown";const n=e.length,i=Jh.length,r=Jh.map((s,o)=>o+1);for(let s=0,o=0,a,l;ss===0?o:s,0)-1]}function z8(e,t){return t.reduce((n,i)=>(n[i]=I8(e,i),n),{})}function P8(e){const t=function(n,i){const r={delimiter:e};return X2(n,i?Fe(i,r):r)};return t.responseType="text",t}function X2(e,t){return t.header&&(e=t.header.map(J).join(t.delimiter)+` -`+e),gU(t.delimiter).parse(e+"")}X2.responseType="text";function LW(e){return typeof Buffer=="function"&&Me(Buffer.isBuffer)?Buffer.isBuffer(e):!1}function Y2(e,t){const n=t&&t.property?Ai(t.property):dn;return ie(e)&&!LW(e)?IW(n(e),t):n(JSON.parse(e))}Y2.responseType="json";function IW(e,t){return!q(e)&&o4(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}const zW={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function B8(e,t){let n,i,r,s;return e=Y2(e,t),t&&t.feature?(n=vU,r=t.feature):t&&t.mesh?(n=_U,r=t.mesh,s=zW[t.filter]):U("Missing TopoJSON feature or mesh parameter."),i=(i=e.objects[r])?n(e,i,s):U("Invalid TopoJSON object: "+r),i&&i.features||[i]}B8.responseType="json";const Qh={dsv:X2,csv:P8(","),tsv:P8(" "),json:Y2,topojson:B8};function Z2(e,t){return arguments.length>1?(Qh[e]=t,this):pe(Qh,e)?Qh[e]:null}function j8(e){const t=Z2(e);return t&&t.responseType||"text"}function U8(e,t,n,i){t=t||{};const r=Z2(t.type||"json");return r||U("Unknown data format type: "+t.type),e=r(e,t),t.parse&&PW(e,t.parse,n,i),pe(e,"columns")&&delete e.columns,e}function PW(e,t,n,i){if(!e.length)return;const r=Qc();n=n||r.timeParse,i=i||r.utcParse;let s=e.columns||Object.keys(e[0]),o,a,l,u,c,f;t==="auto"&&(t=z8(e,s)),s=Object.keys(t);const d=s.map(h=>{const p=t[h];let g,m;if(p&&(p.startsWith("date:")||p.startsWith("utc:")))return g=p.split(/:(.+)?/,2),m=g[1],(m[0]==="'"&&m[m.length-1]==="'"||m[0]==='"'&&m[m.length-1]==='"')&&(m=m.slice(1,-1)),(g[0]==="utc"?i:n)(m);if(!V2[p])throw Error("Illegal format pattern: "+h+":"+p);return V2[p]});for(l=0,c=e.length,f=s.length;l{const s=t(r);return i[s]||(i[s]=1,n.push(r)),n},n.remove=r=>{const s=t(r);if(i[s]){i[s]=0;const o=n.indexOf(r);o>=0&&n.splice(o,1)}return n},n}async function np(e,t){try{await t(e)}catch(n){e.error(n)}}const q8=Symbol("vega_id");let BW=1;function ip(e){return!!(e&&ge(e))}function ge(e){return e[q8]}function W8(e,t){return e[q8]=t,e}function et(e){const t=e===Object(e)?e:{data:e};return ge(t)?t:W8(t,BW++)}function K2(e){return rp(e,et({}))}function rp(e,t){for(const n in e)t[n]=e[n];return t}function H8(e,t){return W8(t,ge(e))}function xa(e,t){return e?t?(n,i)=>e(n,i)||ge(t(n))-ge(t(i)):(n,i)=>e(n,i)||ge(n)-ge(i):null}function G8(e){return e&&e.constructor===_a}function _a(){const e=[],t=[],n=[],i=[],r=[];let s=null,o=!1;return{constructor:_a,insert(a){const l=ee(a),u=l.length;for(let c=0;c{p(b)&&(u[ge(b)]=-1)});for(f=0,d=e.length;f0&&(y(g,p,h.value),a.modifies(p));for(f=0,d=r.length;f{p(b)&&u[ge(b)]>0&&y(b,h.field,h.value)}),a.modifies(h.field);if(o)a.mod=t.length||i.length?l.filter(b=>u[ge(b)]>0):l.slice();else for(m in c)a.mod.push(c[m]);return(s||s==null&&(t.length||i.length))&&a.clean(!0),a}}}const sp="_:mod:_";function op(){Object.defineProperty(this,sp,{writable:!0,value:{}})}op.prototype={set(e,t,n,i){const r=this,s=r[e],o=r[sp];return t!=null&&t>=0?(s[t]!==n||i)&&(s[t]=n,o[t+":"+e]=-1,o[e]=-1):(s!==n||i)&&(r[e]=n,o[e]=q(n)?1+n.length:-1),r},modified(e,t){const n=this[sp];if(arguments.length){if(q(e)){for(let i=0;i=0?t+1{h instanceof gt?(h!==this&&(t&&h.targets().add(this),s.push(h)),r.push({op:h,name:f,index:d})):i.set(f,d,h)};for(o in e)if(a=e[o],o===UW)ee(a).forEach(f=>{f instanceof gt?f!==this&&(f.targets().add(this),s.push(f)):U("Pulse parameters must be operator instances.")}),this.source=a;else if(q(a))for(i.set(o,-1,Array(l=a.length)),u=0;u{const n=Date.now();return n-t>e?(t=n,1):0})},debounce(e){const t=uo();return this.targets().add(uo(null,null,f2(e,n=>{const i=n.dataflow;t.receive(n),i&&i.run&&i.run()}))),t},between(e,t){let n=!1;return e.targets().add(uo(null,null,()=>n=!0)),t.targets().add(uo(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=Ti,this._targets=null}};function YW(e,t,n,i){const r=this,s=uo(n,i),o=function(u){u.dataflow=r;try{s.receive(u)}catch(c){r.error(c)}finally{r.run()}};let a;typeof e=="string"&&typeof document<"u"?a=document.querySelectorAll(e):a=ee(e);const l=a.length;for(let u=0;ut=i);return n.requests=0,n.done=()=>{--n.requests===0&&(e._pending=null,t(e))},e._pending=n}const tH={skip:!0};function nH(e,t,n,i,r){return(e instanceof gt?rH:iH)(this,e,t,n,i,r),this}function iH(e,t,n,i,r,s){const o=Fe({},s,tH);let a,l;Me(n)||(n=pn(n)),i===void 0?a=u=>e.touch(n(u)):Me(i)?(l=new gt(null,i,r,!1),a=u=>{l.evaluate(u);const c=n(u),f=l.value;G8(f)?e.pulse(c,f,s):e.update(c,f,o)}):a=u=>e.update(n(u),i,o),t.apply(a)}function rH(e,t,n,i,r,s){if(i===void 0)t.targets().add(n);else{const o=s||{},a=new gt(null,sH(n,i),r,!1);a.modified(o.force),a.rank=t.rank,t.targets().add(a),n&&(a.skip(!0),a.value=n.value,a.targets().add(n),e.connect(n,[a]))}}function sH(e,t){return t=Me(t)?t:pn(t),e?function(n,i){const r=t(n,i);return e.skip()||(e.skip(r!==this.value).value=r),r}:t}function oH(e){e.rank=++this._rank}function aH(e){const t=[e];let n,i,r;for(;t.length;)if(this.rank(n=t.pop()),i=n._targets)for(r=i.length;--r>=0;)t.push(n=i[r]),n===e&&U("Cycle detected in dataflow graph.")}const lp={},zr=1,co=2,ks=4,lH=zr|co,X8=zr|ks,su=zr|co|ks,Y8=8,ef=16,Z8=32,K8=64;function fo(e,t,n){this.dataflow=e,this.stamp=t??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function J2(e,t){const n=[];return oo(e,t,i=>n.push(i)),n}function J8(e,t){const n={};return e.visit(t,i=>{n[ge(i)]=1}),i=>n[ge(i)]?null:i}function up(e,t){return e?(n,i)=>e(n,i)&&t(n,i):t}fo.prototype={StopPropagation:lp,ADD:zr,REM:co,MOD:ks,ADD_REM:lH,ADD_MOD:X8,ALL:su,REFLOW:Y8,SOURCE:ef,NO_SOURCE:Z8,NO_FIELDS:K8,fork(e){return new fo(this.dataflow).init(this,e)},clone(){const e=this.fork(su);return e.add=e.add.slice(),e.rem=e.rem.slice(),e.mod=e.mod.slice(),e.source&&(e.source=e.source.slice()),e.materialize(su|ef)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new fo(this.dataflow).init(this),e.add=e.source,e.rem=[]),e},init(e,t){const n=this;return n.stamp=e.stamp,n.encode=e.encode,e.fields&&!(t&K8)&&(n.fields=e.fields),t&zr?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),t&co?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),t&ks?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),t&Z8?(n.srcF=null,n.source=null):(n.srcF=e.srcF,n.source=e.source,e.cleans&&(n.cleans=e.cleans)),n},runAfter(e){this.dataflow.runAfter(e)},changed(e){const t=e||su;return t&zr&&this.add.length||t&co&&this.rem.length||t&ks&&this.mod.length},reflow(e){if(e)return this.fork(su).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(ks,J8(this,zr))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return q(e)?e.forEach(n=>t[n]=!0):t[e]=!0,this},modified(e,t){const n=this.fields;return(t||this.mod.length)&&n?arguments.length?q(e)?e.some(i=>n[i]):n[e]:!!n:!1},filter(e,t){const n=this;return e&zr&&(n.addF=up(n.addF,t)),e&co&&(n.remF=up(n.remF,t)),e&ks&&(n.modF=up(n.modF,t)),e&ef&&(n.srcF=up(n.srcF,t)),n},materialize(e){e=e||su;const t=this;return e&zr&&t.addF&&(t.add=J2(t.add,t.addF),t.addF=null),e&co&&t.remF&&(t.rem=J2(t.rem,t.remF),t.remF=null),e&ks&&t.modF&&(t.mod=J2(t.mod,t.modF),t.modF=null),e&ef&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,i=t;if(e&ef)return oo(n.source,n.srcF,i),n;e&zr&&oo(n.add,n.addF,i),e&co&&oo(n.rem,n.remF,i),e&ks&&oo(n.mod,n.modF,i);const r=n.source;if(e&Y8&&r){const s=n.add.length+n.mod.length;s===r.length||(s?oo(r,J8(n,X8),i):oo(r,n.srcF,i))}return n}};function Q2(e,t,n,i){const r=this;let s=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=i||null,this.pulses=n;for(const o of n)if(o.stamp===t){if(o.fields){const a=r.fields||(r.fields={});for(const l in o.fields)a[l]=1}o.changed(r.ADD)&&(s|=r.ADD),o.changed(r.REM)&&(s|=r.REM),o.changed(r.MOD)&&(s|=r.MOD)}this.changes=s}K(Q2,fo,{fork(e){const t=new fo(this.dataflow).init(this,e&this.NO_FIELDS);return e!==void 0&&(e&t.ADD&&this.visit(t.ADD,n=>t.add.push(n)),e&t.REM&&this.visit(t.REM,n=>t.rem.push(n)),e&t.MOD&&this.visit(t.MOD,n=>t.mod.push(n))),t},changed(e){return this.changes&e},modified(e){const t=this,n=t.fields;return n&&t.changes&t.MOD?q(e)?e.some(i=>n[i]):n[e]:0},filter(){U("MultiPulse does not support filtering.")},materialize(){U("MultiPulse does not support materialization.")},visit(e,t){const n=this,i=n.pulses,r=i.length;let s=0;if(e&n.SOURCE)for(;si._enqueue(c,!0)),i._touched=tp(Oc);let o=0,a,l,u;try{for(;i._heap.size()>0;){if(a=i._heap.pop(),a.rank!==a.qrank){i._enqueue(a,!0);continue}l=a.run(i._getPulse(a,e)),l.then?l=await l:l.async&&(r.push(l.async),l=lp),l!==lp&&a._targets&&a._targets.forEach(c=>i._enqueue(c)),++o}}catch(c){i._heap.clear(),u=c}if(i._input={},i._pulse=null,i.debug(`Pulse ${s}: ${o} operators`),u&&(i._postrun=[],i.error(u)),i._postrun.length){const c=i._postrun.sort((f,d)=>d.priority-f.priority);i._postrun=[];for(let f=0;fi.runAsync(null,()=>{c.forEach(f=>{try{f(i)}catch(d){i.error(d)}})})),i}async function cH(e,t,n){for(;this._running;)await this._running;const i=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(i,i),this._running}function fH(e,t,n){return this._pulse?Q8(this):(this.evaluate(e,t,n),this)}function dH(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(i){this.error(i)}}function Q8(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}function hH(e,t){const n=e.stampr.pulse),t):this._input[e.id]||gH(this._pulse,n&&n.pulse)}function gH(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==lp&&(e.source=t.source),e)}const ey={skip:!1,force:!1};function mH(e,t){const n=t||ey;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this}function yH(e,t,n){const i=n||ey;return(e.set(t)||i.force)&&this.touch(e,i),this}function bH(e,t,n){this.touch(e,n||ey);const i=new fo(this,this._clock+(this._pulse?0:1)),r=e.pulse&&e.pulse.source||[];return i.target=e,this._input[e.id]=t.pulse(i,r),this}function vH(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),ek(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let i;return t.length?(i=t[0],t[0]=n,xH(t,0,e)):i=n,i}}}function ek(e,t,n,i){let r,s;const o=e[n];for(;n>t;){if(s=n-1>>1,r=e[s],i(o,r)<0){e[n]=r,n=s;continue}break}return e[n]=o}function xH(e,t,n){const i=t,r=e.length,s=e[t];let o=(t<<1)+1,a;for(;o=0&&(o=a),e[t]=e[o],t=o,o=(t<<1)+1;return e[t]=s,ek(e,i,t,n)}function ou(){this.logger(o2()),this.logLevel(r2),this._clock=0,this._rank=0,this._locale=G2();try{this._loader=ep()}catch{}this._touched=tp(Oc),this._input={},this._pulse=null,this._heap=vH((e,t)=>e.qrank-t.qrank),this._postrun=[]}function tf(e){return function(){return this._log[e].apply(this,arguments)}}ou.prototype={stamp(){return this._clock},loader(e){return arguments.length?(this._loader=e,this):this._loader},locale(e){return arguments.length?(this._locale=e,this):this._locale},logger(e){return arguments.length?(this._log=e,this):this._log},error:tf("error"),warn:tf("warn"),info:tf("info"),debug:tf("debug"),logLevel:tf("level"),cleanThreshold:1e4,add:GW,connect:VW,rank:oH,rerank:aH,pulse:bH,touch:mH,update:yH,changeset:_a,ingest:KW,parse:ZW,preload:QW,request:JW,events:YW,on:nH,evaluate:uH,run:fH,runAsync:cH,runAfter:dH,_enqueue:hH,_getPulse:pH};function I(e,t){gt.call(this,e,null,t)}K(I,gt,{run(e){if(e.stampthis.pulse=n):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){const t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}});const au={};function tk(e){const t=nk(e);return t&&t.Definition||null}function nk(e){return e=e&&e.toLowerCase(),pe(au,e)?au[e]:null}function*ik(e,t){if(t==null)for(let n of e)n!=null&&n!==""&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of e)i=t(i,++n,e),i!=null&&i!==""&&(i=+i)>=i&&(yield i)}}function ty(e,t,n){const i=Float64Array.from(ik(e,n));return i.sort(ys),t.map(r=>C4(i,r))}function ny(e,t){return ty(e,[.25,.5,.75],t)}function iy(e,t){const n=e.length,i=TU(e,t),r=ny(e,t),s=(r[2]-r[0])/1.34;return 1.06*(Math.min(i,s)||i||Math.abs(r[0])||1)*Math.pow(n,-.2)}function rk(e){const t=e.maxbins||20,n=e.base||10,i=Math.log(n),r=e.divide||[5,2];let s=e.extent[0],o=e.extent[1],a,l,u,c,f,d;const h=e.span||o-s||Math.abs(s)||1;if(e.step)a=e.step;else if(e.steps){for(c=h/t,f=0,d=e.steps.length;ft;)a*=n;for(f=0,d=r.length;f=u&&h/c<=t&&(a=c)}c=Math.log(a);const p=c>=0?0:~~(-c/i)+1,g=Math.pow(n,-p-1);return(e.nice||e.nice===void 0)&&(c=Math.floor(s/a+g)*a,s=sd);const r=e.length,s=new Float64Array(r);let o=0,a=1,l=i(e[0]),u=l,c=l+t,f;for(;a=c){for(u=(l+u)/2;o>1);or;)e[o--]=e[i]}i=r,r=s}return e}function kH(e){return function(){return e=(1103515245*e+12345)%2147483647,e/2147483647}}function $H(e,t){t==null&&(t=e,e=0);let n,i,r;const s={min(o){return arguments.length?(n=o||0,r=i-n,s):n},max(o){return arguments.length?(i=o||0,r=i-n,s):i},sample(){return n+Math.floor(r*Di())},pdf(o){return o===Math.floor(o)&&o>=n&&o=i?1:(a-n+1)/r},icdf(o){return o>=0&&o<=1?n-1+Math.floor(o*r):NaN}};return s.min(e).max(t)}const ak=Math.sqrt(2*Math.PI),EH=Math.SQRT2;let nf=NaN;function cp(e,t){e=e||0,t=t??1;let n=0,i=0,r,s;if(nf===nf)n=nf,nf=NaN;else{do n=Di()*2-1,i=Di()*2-1,r=n*n+i*i;while(r===0||r>1);s=Math.sqrt(-2*Math.log(r)/r),n*=s,nf=i*s}return e+n*t}function ry(e,t,n){n=n??1;const i=(e-(t||0))/n;return Math.exp(-.5*i*i)/(n*ak)}function fp(e,t,n){t=t||0,n=n??1;const i=(e-t)/n,r=Math.abs(i);let s;if(r>37)s=0;else{const o=Math.exp(-r*r/2);let a;r<7.07106781186547?(a=.0352624965998911*r+.700383064443688,a=a*r+6.37396220353165,a=a*r+33.912866078383,a=a*r+112.079291497871,a=a*r+221.213596169931,a=a*r+220.206867912376,s=o*a,a=.0883883476483184*r+1.75566716318264,a=a*r+16.064177579207,a=a*r+86.7807322029461,a=a*r+296.564248779674,a=a*r+637.333633378831,a=a*r+793.826512519948,a=a*r+440.413735824752,s=s/a):(a=r+.65,a=r+4/a,a=r+3/a,a=r+2/a,a=r+1/a,s=o/a/2.506628274631)}return i>0?1-s:s}function dp(e,t,n){return e<0||e>1?NaN:(t||0)+(n??1)*EH*CH(2*e-1)}function CH(e){let t=-Math.log((1-e)*(1+e)),n;return t<6.25?(t-=3.125,n=-364441206401782e-35,n=-16850591381820166e-35+n*t,n=128584807152564e-32+n*t,n=11157877678025181e-33+n*t,n=-1333171662854621e-31+n*t,n=20972767875968562e-33+n*t,n=6637638134358324e-30+n*t,n=-4054566272975207e-29+n*t,n=-8151934197605472e-29+n*t,n=26335093153082323e-28+n*t,n=-12975133253453532e-27+n*t,n=-5415412054294628e-26+n*t,n=10512122733215323e-25+n*t,n=-4112633980346984e-24+n*t,n=-29070369957882005e-24+n*t,n=42347877827932404e-23+n*t,n=-13654692000834679e-22+n*t,n=-13882523362786469e-21+n*t,n=.00018673420803405714+n*t,n=-.000740702534166267+n*t,n=-.006033670871430149+n*t,n=.24015818242558962+n*t,n=1.6536545626831027+n*t):t<16?(t=Math.sqrt(t)-3.25,n=22137376921775787e-25,n=9075656193888539e-23+n*t,n=-27517406297064545e-23+n*t,n=18239629214389228e-24+n*t,n=15027403968909828e-22+n*t,n=-4013867526981546e-21+n*t,n=29234449089955446e-22+n*t,n=12475304481671779e-21+n*t,n=-47318229009055734e-21+n*t,n=6828485145957318e-20+n*t,n=24031110387097894e-21+n*t,n=-.0003550375203628475+n*t,n=.0009532893797373805+n*t,n=-.0016882755560235047+n*t,n=.002491442096107851+n*t,n=-.003751208507569241+n*t,n=.005370914553590064+n*t,n=1.0052589676941592+n*t,n=3.0838856104922208+n*t):Number.isFinite(t)?(t=Math.sqrt(t)-5,n=-27109920616438573e-27,n=-2555641816996525e-25+n*t,n=15076572693500548e-25+n*t,n=-3789465440126737e-24+n*t,n=761570120807834e-23+n*t,n=-1496002662714924e-23+n*t,n=2914795345090108e-23+n*t,n=-6771199775845234e-23+n*t,n=22900482228026655e-23+n*t,n=-99298272942317e-20+n*t,n=4526062597223154e-21+n*t,n=-1968177810553167e-20+n*t,n=7599527703001776e-20+n*t,n=-.00021503011930044477+n*t,n=-.00013871931833623122+n*t,n=1.0103004648645344+n*t,n=4.849906401408584+n*t):n=1/0,n*e}function sy(e,t){let n,i;const r={mean(s){return arguments.length?(n=s||0,r):n},stdev(s){return arguments.length?(i=s??1,r):i},sample:()=>cp(n,i),pdf:s=>ry(s,n,i),cdf:s=>fp(s,n,i),icdf:s=>dp(s,n,i)};return r.mean(e).stdev(t)}function oy(e,t){const n=sy();let i=0;const r={data(s){return arguments.length?(e=s,i=s?s.length:0,r.bandwidth(t)):e},bandwidth(s){return arguments.length?(t=s,!t&&e&&(t=iy(e)),r):t},sample(){return e[~~(Di()*i)]+t*n.sample()},pdf(s){let o=0,a=0;for(;aay(n,i),pdf:s=>ly(s,n,i),cdf:s=>uy(s,n,i),icdf:s=>cy(s,n,i)};return r.mean(e).stdev(t)}function uk(e,t){let n=0,i;function r(o){const a=[];let l=0,u;for(u=0;u=t&&e<=n?1/(n-t):0}function hy(e,t,n){return n==null&&(n=t??1,t=0),en?1:(e-t)/(n-t)}function py(e,t,n){return n==null&&(n=t??1,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function ck(e,t){let n,i;const r={min(s){return arguments.length?(n=s||0,r):n},max(s){return arguments.length?(i=s??1,r):i},sample:()=>fy(n,i),pdf:s=>dy(s,n,i),cdf:s=>hy(s,n,i),icdf:s=>py(s,n,i)};return t==null&&(t=e??1,e=0),r.min(e).max(t)}function gy(e,t,n){let i=0,r=0;for(const s of e){const o=n(s);t(s)==null||o==null||isNaN(o)||(i+=(o-i)/++r)}return{coef:[i],predict:()=>i,rSquared:0}}function rf(e,t,n,i){const r=i-e*e,s=Math.abs(r)<1e-24?0:(n-e*t)/r;return[t-s*e,s]}function hp(e,t,n,i){e=e.filter(h=>{let p=t(h),g=n(h);return p!=null&&(p=+p)>=p&&g!=null&&(g=+g)>=g}),i&&e.sort((h,p)=>t(h)-t(p));const r=e.length,s=new Float64Array(r),o=new Float64Array(r);let a=0,l=0,u=0,c,f,d;for(d of e)s[a]=c=+t(d),o[a]=f=+n(d),++a,l+=(c-l)/a,u+=(f-u)/a;for(a=0;a=s&&o!=null&&(o=+o)>=o&&i(s,o,++r)}function lu(e,t,n,i,r){let s=0,o=0;return sf(e,t,n,(a,l)=>{const u=l-r(a),c=l-i;s+=u*u,o+=c*c}),1-s/o}function my(e,t,n){let i=0,r=0,s=0,o=0,a=0;sf(e,t,n,(c,f)=>{++a,i+=(c-i)/a,r+=(f-r)/a,s+=(c*f-s)/a,o+=(c*c-o)/a});const l=rf(i,r,s,o),u=c=>l[0]+l[1]*c;return{coef:l,predict:u,rSquared:lu(e,t,n,r,u)}}function fk(e,t,n){let i=0,r=0,s=0,o=0,a=0;sf(e,t,n,(c,f)=>{++a,c=Math.log(c),i+=(c-i)/a,r+=(f-r)/a,s+=(c*f-s)/a,o+=(c*c-o)/a});const l=rf(i,r,s,o),u=c=>l[0]+l[1]*Math.log(c);return{coef:l,predict:u,rSquared:lu(e,t,n,r,u)}}function dk(e,t,n){const[i,r,s,o]=hp(e,t,n);let a=0,l=0,u=0,c=0,f=0,d,h,p;sf(e,t,n,(b,v)=>{d=i[f++],h=Math.log(v),p=d*v,a+=(v*h-a)/f,l+=(p-l)/f,u+=(p*h-u)/f,c+=(d*p-c)/f});const[g,m]=rf(l/o,a/o,u/o,c/o),y=b=>Math.exp(g+m*(b-s));return{coef:[Math.exp(g-m*s),m],predict:y,rSquared:lu(e,t,n,o,y)}}function hk(e,t,n){let i=0,r=0,s=0,o=0,a=0,l=0;sf(e,t,n,(f,d)=>{const h=Math.log(f),p=Math.log(d);++l,i+=(h-i)/l,r+=(p-r)/l,s+=(h*p-s)/l,o+=(h*h-o)/l,a+=(d-a)/l});const u=rf(i,r,s,o),c=f=>u[0]*Math.pow(f,u[1]);return u[0]=Math.exp(u[0]),{coef:u,predict:c,rSquared:lu(e,t,n,a,c)}}function yy(e,t,n){const[i,r,s,o]=hp(e,t,n),a=i.length;let l=0,u=0,c=0,f=0,d=0,h,p,g,m;for(h=0;h(w=w-s,v*w*w+x*w+_+o);return{coef:[_-x*s+v*s*s+o,x-2*v*s,v],predict:k,rSquared:lu(e,t,n,o,k)}}function pk(e,t,n,i){if(i===0)return gy(e,t,n);if(i===1)return my(e,t,n);if(i===2)return yy(e,t,n);const[r,s,o,a]=hp(e,t,n),l=r.length,u=[],c=[],f=i+1;let d,h,p,g,m;for(d=0;d{v-=o;let x=a+y[0]+y[1]*v+y[2]*v*v;for(d=3;d=0;--s)for(a=t[s],l=1,r[s]+=a,o=1;o<=s;++o)l*=(s+1-o)/o,r[s-o]+=a*Math.pow(n,o)*l;return r[0]+=i,r}function AH(e){const t=e.length-1,n=[];let i,r,s,o,a;for(i=0;iMath.abs(e[i][o])&&(o=r);for(s=i;s=i;s--)e[s][r]-=e[s][i]*e[i][r]/e[i][i]}for(r=t-1;r>=0;--r){for(a=0,s=r+1;sr[v]-y?b:v;let _=0,k=0,w=0,$=0,S=0;const E=1/Math.abs(r[x]-y||1);for(let C=b;C<=v;++C){const M=r[C],T=s[C],O=TH(Math.abs(y-M)*E)*d[C],P=M*O;_+=O,k+=P,w+=T*O,$+=T*P,S+=M*P}const[A,R]=rf(k/_,w/_,$/_,S/_);c[m]=A+R*y,f[m]=Math.abs(s[m]-c[m]),MH(r,m+1,p)}if(h===gk)break;const g=S4(f);if(Math.abs(g)=1?mk:(b=1-y*y)*b}return FH(r,c,o,a)}function TH(e){return(e=1-e*e*e)*e*e}function MH(e,t,n){const i=e[t];let r=n[0],s=n[1]+1;if(!(s>=e.length))for(;t>r&&e[s]-i<=i-e[r];)n[0]=++r,n[1]=s,++s}function FH(e,t,n,i){const r=e.length,s=[];let o=0,a=0,l=[],u;for(;o[g,e(g)],s=t[0],o=t[1],a=o-s,l=a/i,u=[r(s)],c=[];if(n===i){for(let g=1;g0;)c.push(r(s+g/n*a))}let f=u[0],d=c[c.length-1];const h=1/a,p=NH(f[1],c);for(;d;){const g=r((f[0]+d[0])/2);g[0]-f[0]>=l&&OH(f,g,d,h,p)>DH?c.push(g):(f=d,u.push(d),c.pop()),d=c[c.length-1]}return u}function NH(e,t){let n=e,i=e;const r=t.length;for(let s=0;si&&(i=o)}return 1/(i-n)}function OH(e,t,n,i,r){const s=Math.atan2(r*(n[1]-e[1]),i*(n[0]-e[0])),o=Math.atan2(r*(t[1]-e[1]),i*(t[0]-e[0]));return Math.abs(s-o)}function RH(e){return t=>{const n=e.length;let i=1,r=String(e[0](t));for(;i{},LH={init:vy,add:vy,rem:vy,idx:0},of={values:{init:e=>e.cell.store=!0,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.sum,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:void 0,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:void 0,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:void 0,req:["mean"],idx:1},variance:{init:e=>e.dev=0,value:e=>e.valid>1?e.dev/(e.valid-1):void 0,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:["mean"],idx:1},variancep:{value:e=>e.valid>1?e.dev/e.valid:void 0,req:["variance"],idx:2},stdev:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:e=>e.valid>1?Math.sqrt(e.dev/e.valid):void 0,req:["variance"],idx:2},stderr:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid*(e.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:e=>e.cell.data.distinct(e.get),req:["values"],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:["values"],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:["values"],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:["values"],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:["values"],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:["values"],idx:3},min:{init:e=>e.min=void 0,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{(t{t<=e.min&&(e.min=NaN)},req:["values"],idx:4},max:{init:e=>e.max=void 0,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{(t>e.max||e.max===void 0)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)},req:["values"],idx:4},argmin:{init:e=>e.argmin=void 0,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{t{t<=e.min&&(e.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:e=>e.argmax=void 0,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{t>e.max&&(e.argmax=n)},rem:(e,t)=>{t>=e.max&&(e.argmax=void 0)},req:["max","values"],idx:3},exponential:{init:(e,t)=>{e.exp=0,e.exp_r=t},value:e=>e.valid?e.exp*(1-e.exp_r)/(1-e.exp_r**e.valid):void 0,add:(e,t)=>e.exp=e.exp_r*e.exp+t,rem:(e,t)=>e.exp=(e.exp-t/e.exp_r**(e.valid-1))/e.exp_r},exponentialb:{value:e=>e.valid?e.exp*(1-e.exp_r):void 0,req:["exponential"],idx:1}},af=Object.keys(of).filter(e=>e!=="__count__");function IH(e,t){return(n,i)=>Fe({name:e,aggregate_param:i,out:n||e},LH,t)}[...af,"__count__"].forEach(e=>{of[e]=IH(e,of[e])});function vk(e,t,n){return of[e](n,t)}function xk(e,t){return e.idx-t.idx}function zH(e){const t={};e.forEach(i=>t[i.name]=i);const n=i=>{i.req&&i.req.forEach(r=>{t[r]||n(t[r]=of[r]())})};return e.forEach(n),Object.values(t).sort(xk)}function PH(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.aggregate_param==null?e.init(this):e.init(this,e.aggregate_param))}function BH(e,t){if(e==null||e===""){++this.missing;return}e===e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t)))}function jH(e,t){if(e==null||e===""){--this.missing;return}e===e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t)))}function UH(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function _k(e,t){const n=t||dn,i=zH(e),r=e.slice().sort(xk);function s(o){this._ops=i,this._out=r,this.cell=o,this.init()}return s.prototype.init=PH,s.prototype.add=BH,s.prototype.rem=jH,s.prototype.set=UH,s.prototype.get=n,s.fields=e.map(o=>o.out),s}function xy(e){this._key=e?Ai(e):ge,this.reset()}const rn=xy.prototype;rn.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},rn.add=function(e){this._add.push(e)},rn.rem=function(e){this._rem.push(e)},rn.values=function(){if(this._get=null,this._rem.length===0)return this._add;const e=this._add,t=this._rem,n=this._key,i=e.length,r=t.length,s=Array(i-r),o={};let a,l,u;for(a=0;a=0;)s=e(t[i])+"",pe(n,s)||(n[s]=1,++r);return r},rn.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=r4(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext},rn.argmin=function(e){return this.extent(e)[0]||{}},rn.argmax=function(e){return this.extent(e)[1]||{}},rn.min=function(e){const t=this.extent(e)[0];return t!=null?e(t):void 0},rn.max=function(e){const t=this.extent(e)[1];return t!=null?e(t):void 0},rn.quartile=function(e){return(this._get!==e||!this._q)&&(this._q=ny(this.values(),e),this._get=e),this._q},rn.q1=function(e){return this.quartile(e)[0]},rn.q2=function(e){return this.quartile(e)[1]},rn.q3=function(e){return this.quartile(e)[2]},rn.ci=function(e){return(this._get!==e||!this._ci)&&(this._ci=sk(this.values(),1e3,.05,e),this._get=e),this._ci},rn.ci0=function(e){return this.ci(e)[0]},rn.ci1=function(e){return this.ci(e)[1]};function ho(e){I.call(this,null,e),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}ho.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:af},{name:"aggregate_params",type:"field",null:!0,array:!0,default:[null]},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]},K(ho,I,{transform(e,t){const n=this,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.modified();return n.stamp=i.stamp,n.value&&(r||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=r?n.init(e):Object.create(null),t.visit(t.SOURCE,s=>n.add(s))):(n.value=n.value||n.init(e),t.visit(t.REM,s=>n.rem(s)),t.visit(t.ADD,s=>n.add(s))),i.modifies(n._outputs),n._drop=e.drop!==!1,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&i.clean(!0).runAfter(()=>this.clean()),n.changes(i)},cross(){const e=this,t=e.value,n=e._dnames,i=n.map(()=>({})),r=n.length;function s(a){let l,u,c,f;for(l in a)for(c=a[l].tuple,u=0;u{const v=Et(b);return r(b),n.push(v),v}),this.cellkey=e.key?e.key:by(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const s=e.fields||[null],o=e.ops||["count"],a=e.aggregate_params||[null],l=e.as||[],u=s.length,c={};let f,d,h,p,g,m,y;for(u!==o.length&&U("Unmatched number of fields and aggregate ops."),y=0;y_k(b,b.field)),Object.create(null)},cellkey:by(),cell(e,t){let n=this.value[e];return n?n.num===0&&this._drop&&n.stamp{const f=i(c);c[a]=f,c[l]=f==null?null:r+s*(1+(f-r)/s)}:c=>c[a]=i(c)),t.modifies(n?o:a)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=rk(e),i=n.step;let r=n.start,s=r+Math.ceil((n.stop-r)/i)*i,o,a;(o=e.anchor)!=null&&(a=o-(r+i*Math.floor((o-r)/i)),r+=a,s+=a);const l=function(u){let c=hn(t(u));return c==null?null:cs?1/0:(c=Math.max(r,Math.min(c,s-i)),r+i*Math.floor(qH+(c-r)/i))};return l.start=r,l.stop=n.stop,l.step=i,this.value=Xn(l,fn(t),e.name||"bin_"+Et(t))}});function wk(e,t,n){const i=e;let r=t||[],s=n||[],o={},a=0;return{add:l=>s.push(l),remove:l=>o[i(l)]=++a,size:()=>r.length,data:(l,u)=>(a&&(r=r.filter(c=>!o[i(c)]),o={},a=0),u&&l&&r.sort(l),s.length&&(r=l?c4(l,r,s.sort(l)):r.concat(s),s=[]),r)}}function wy(e){I.call(this,[],e)}wy.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},K(wy,I,{transform(e,t){const n=t.fork(t.ALL),i=wk(ge,this.value,n.materialize(n.ADD).add),r=e.sort,s=t.changed()||r&&(e.modified("sort")||t.modified(r.fields));return n.visit(n.REM,i.remove),this.modified(s),this.value=n.source=i.data(xa(r),s),t.source&&t.source.root&&(this.value.root=t.source.root),n}});function kk(e){gt.call(this,null,WH,e)}K(kk,gt);function WH(e){return this.value&&!e.modified()?this.value:c2(e.fields,e.orders)}function ky(e){I.call(this,null,e)}ky.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]};function HH(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase();break}return e.match(n)}K(ky,I,{transform(e,t){const n=f=>d=>{for(var h=HH(a(d),e.case,s)||[],p,g=0,m=h.length;gr[f]=1+(r[f]||0)),c=n(f=>r[f]-=1);return i?t.visit(t.SOURCE,u):(t.visit(t.ADD,u),t.visit(t.REM,c)),this._finish(t,l)},_parameterCheck(e,t){let n=!1;return(e.modified("stopwords")||!this._stop)&&(this._stop=new RegExp("^"+(e.stopwords||"")+"$","i"),n=!0),(e.modified("pattern")||!this._match)&&(this._match=new RegExp(e.pattern||"[\\w']+","g"),n=!0),(e.modified("field")||t.modified(e.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(e,t){const n=this._counts,i=this._tuples||(this._tuples={}),r=t[0],s=t[1],o=e.fork(e.NO_SOURCE|e.NO_FIELDS);let a,l,u;for(a in n)l=i[a],u=n[a]||0,!l&&u?(i[a]=l=et({}),l[r]=a,l[s]=u,o.add.push(l)):u===0?(l&&o.rem.push(l),n[a]=null,i[a]=null):l[s]!==u&&(l[s]=u,o.mod.push(l));return o.modifies(t)}});function $y(e){I.call(this,null,e)}$y.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},K($y,I,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.as||["a","b"],r=i[0],s=i[1],o=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let a=this.value;return o?(a&&(n.rem=a),a=t.materialize(t.SOURCE).source,n.add=this.value=GH(a,r,s,e.filter||Ti)):n.mod=a,n.source=this.value,n.modifies(i)}});function GH(e,t,n,i){for(var r=[],s={},o=e.length,a=0,l,u;aCk(s,t))):typeof i[r]===Ek&&i[r](e[r]);return i}function Ey(e){I.call(this,null,e)}const Sk=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],YH={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:Sk},{name:"weights",type:"number",array:!0}]};Ey.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:Sk.concat(YH)},{name:"as",type:"string",array:!0,default:["value","density"]}]},K(Ey,I,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=Ck(e.distribution,ZH(t)),r=e.steps||e.minsteps||25,s=e.steps||e.maxsteps||200;let o=e.method||"pdf";o!=="pdf"&&o!=="cdf"&&U("Invalid density method: "+o),!e.extent&&!i.data&&U("Missing density extent parameter."),o=i[o];const a=e.as||["value","density"],l=e.extent||Or(i.data()),u=pp(o,l,r,s).map(c=>{const f={};return f[a[0]]=c[0],f[a[1]]=c[1],et(f)});this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}});function ZH(e){return()=>e.materialize(e.SOURCE).source}function Ak(e,t){return e?e.map((n,i)=>t[i]||Et(n)):null}function Cy(e,t,n){const i=[],r=f=>f(l);let s,o,a,l,u,c;if(t==null)i.push(e.map(n));else for(s={},o=0,a=e.length;oLc(Or(e,t))/30;K(Sy,I,{transform(e,t){if(this.value&&!(e.modified()||t.changed()))return t;const n=t.materialize(t.SOURCE).source,i=Cy(t.source,e.groupby,dn),r=e.smooth||!1,s=e.field,o=e.step||KH(n,s),a=xa((p,g)=>s(p)-s(g)),l=e.as||Tk,u=i.length;let c=1/0,f=-1/0,d=0,h;for(;df&&(f=g),p[++h][l]=g}return this.value={start:c,stop:f,step:o},t.reflow(!0).modifies(l)}});function Mk(e){gt.call(this,null,JH,e),this.modified(!0)}K(Mk,gt);function JH(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:Xn(n=>t(n,e),fn(t),Et(t))}function Ay(e){I.call(this,[void 0,void 0],e)}Ay.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},K(Ay,I,{transform(e,t){const n=this.value,i=e.field,r=t.changed()||t.modified(i.fields)||e.modified("field");let s=n[0],o=n[1];if((r||s==null)&&(s=1/0,o=-1/0),t.visit(r?t.SOURCE:t.ADD,a=>{const l=hn(i(a));l!=null&&(lo&&(o=l))}),!Number.isFinite(s)||!Number.isFinite(o)){let a=Et(i);a&&(a=` for field "${a}"`),t.dataflow.warn(`Infinite extent${a}: [${s}, ${o}]`),s=o=void 0}this.value=[s,o]}});function Ty(e,t){gt.call(this,e),this.parent=t,this.count=0}K(Ty,gt,{connect(e){return this.detachSubflow=e.detachSubflow,this.targets().add(e),e.source=this},add(e){this.count+=1,this.value.add.push(e)},rem(e){this.count-=1,this.value.rem.push(e)},mod(e){this.value.mod.push(e)},init(e){this.value.init(e,e.NO_SOURCE)},evaluate(){return this.value}});function gp(e){I.call(this,{},e),this._keys=Gl();const t=this._targets=[];t.active=0,t.forEach=n=>{for(let i=0,r=t.active;ii&&i.count>0);this.initTargets(n)}},initTargets(e){const t=this._targets,n=t.length,i=e?e.length:0;let r=0;for(;rthis.subflow(l,r,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,l=>{const u=ge(l),c=s.get(u);c!==void 0&&(s.delete(u),a(c).rem(l))}),t.visit(t.ADD,l=>{const u=i(l);s.set(ge(l),u),a(u).add(l)}),o||t.modified(i.fields)?t.visit(t.MOD,l=>{const u=ge(l),c=s.get(u),f=i(l);c===f?a(f).mod(l):(s.set(u,f),a(c).rem(l),a(f).add(l))}):t.changed(t.MOD)&&t.visit(t.MOD,l=>{a(s.get(ge(l))).mod(l)}),o&&t.visit(t.REFLOW,l=>{const u=ge(l),c=s.get(u),f=i(l);c!==f&&(s.set(u,f),a(c).rem(l),a(f).add(l))}),t.clean()?n.runAfter(()=>{this.clean(),s.clean()}):s.empty>n.cleanThreshold&&n.runAfter(s.clean),t}});function Fk(e){gt.call(this,null,QH,e)}K(Fk,gt);function QH(e){return this.value&&!e.modified()?this.value:q(e.name)?ee(e.name).map(t=>Ai(t)):Ai(e.name,e.as)}function My(e){I.call(this,Gl(),e)}My.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},K(My,I,{transform(e,t){const n=t.dataflow,i=this.value,r=t.fork(),s=r.add,o=r.rem,a=r.mod,l=e.expr;let u=!0;t.visit(t.REM,f=>{const d=ge(f);i.has(d)?i.delete(d):o.push(f)}),t.visit(t.ADD,f=>{l(f,e)?s.push(f):i.set(ge(f),1)});function c(f){const d=ge(f),h=l(f,e),p=i.get(d);h&&p?(i.delete(d),s.push(f)):!h&&!p?(i.set(d,1),o.push(f)):u&&h&&!p&&a.push(f)}return t.visit(t.MOD,c),e.modified()&&(u=!1,t.visit(t.REFLOW,c)),i.empty>n.cleanThreshold&&n.runAfter(i.clean),r}});function Fy(e){I.call(this,[],e)}Fy.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]},K(Fy,I,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=Ak(i,e.as||[]),s=e.index||null,o=r.length;return n.rem=this.value,t.visit(t.SOURCE,a=>{const l=i.map(p=>p(a)),u=l.reduce((p,g)=>Math.max(p,g.length),0);let c=0,f,d,h;for(;c{for(let c=0,f;co[i]=n(o,e))}});function Dk(e){I.call(this,[],e)}K(Dk,I,{transform(e,t){const n=t.fork(t.ALL),i=e.generator;let r=this.value,s=e.size-r.length,o,a,l;if(s>0){for(o=[];--s>=0;)o.push(l=et(i(e))),r.push(l);n.add=n.add.length?n.materialize(n.ADD).add.concat(o):o}else a=r.slice(0,-s),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(a):a,r=r.slice(-s);return n.source=this.value=r,n}});const mp={value:"value",median:S4,mean:RU,min:w2,max:ga},eG=[];function Oy(e){I.call(this,[],e)}Oy.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]};function tG(e){var t=e.method||mp.value,n;if(mp[t]==null)U("Unrecognized imputation method: "+t);else return t===mp.value?(n=e.value!==void 0?e.value:0,()=>n):mp[t]}function nG(e){const t=e.field;return n=>n?t(n):NaN}K(Oy,I,{transform(e,t){var n=t.fork(t.ALL),i=tG(e),r=nG(e),s=Et(e.field),o=Et(e.key),a=(e.groupby||[]).map(Et),l=iG(t.source,e.groupby,e.key,e.keyvals),u=[],c=this.value,f=l.domain.length,d,h,p,g,m,y,b,v,x,_;for(m=0,v=l.length;my(m),s=[],o=i?i.slice():[],a={},l={},u,c,f,d,h,p,g,m;for(o.forEach((y,b)=>a[y]=b+1),d=0,g=e.length;dn.add(s))):(r=n.value=n.value||this.init(e),t.visit(t.REM,s=>n.rem(s)),t.visit(t.ADD,s=>n.add(s))),n.changes(),t.visit(t.SOURCE,s=>{Fe(s,r[n.cellkey(s)].tuple)}),t.reflow(i).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,i;for(n=0,i=this._alen;n{const p=oy(h,o)[a],g=e.counts?h.length:1,m=c||Or(h);pp(p,m,f,d).forEach(y=>{const b={};for(let v=0;v(this._pending=ee(r.data),s=>s.touch(this)))}:n.request(e.url,e.format).then(i=>Iy(this,t,ee(i.data)))}});function sG(e){return e.modified("async")&&!(e.modified("values")||e.modified("url")||e.modified("format"))}function Iy(e,t,n){n.forEach(et);const i=t.fork(t.NO_FIELDS&t.NO_SOURCE);return i.rem=e.value,e.value=i.source=i.add=n,e._pending=null,i.rem.length&&i.clean(!0),i}function zy(e){I.call(this,{},e)}zy.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]},K(zy,I,{transform(e,t){const n=e.fields,i=e.index,r=e.values,s=e.default==null?null:e.default,o=e.modified(),a=n.length;let l=o?t.SOURCE:t.ADD,u=t,c=e.as,f,d,h;return r?(d=r.length,a>1&&!c&&U('Multi-field lookup requires explicit "as" parameter.'),c&&c.length!==a*d&&U('The "as" parameter has too few output field names.'),c=c||r.map(Et),f=function(p){for(var g=0,m=0,y,b;gt.modified(p.fields)),l|=h?t.MOD:0),t.visit(l,f),u.modifies(c)}});function Rk(e){gt.call(this,null,oG,e)}K(Rk,gt);function oG(e){if(this.value&&!e.modified())return this.value;const t=e.extents,n=t.length;let i=1/0,r=-1/0,s,o;for(s=0;sr&&(r=o[1]);return[i,r]}function Lk(e){gt.call(this,null,aG,e)}K(Lk,gt);function aG(e){return this.value&&!e.modified()?this.value:e.values.reduce((t,n)=>t.concat(n),[])}function Ik(e){I.call(this,null,e)}K(Ik,I,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function Py(e){ho.call(this,e)}Py.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:af,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]},K(Py,ho,{_transform:ho.prototype.transform,transform(e,t){return this._transform(lG(e,t),t)}});function lG(e,t){const n=e.field,i=e.value,r=(e.op==="count"?"__count__":e.op)||"sum",s=fn(n).concat(fn(i)),o=cG(n,e.limit||0,t);return t.changed()&&e.set("__pivot__",null,null,!0),{key:e.key,groupby:e.groupby,ops:o.map(()=>r),fields:o.map(a=>uG(a,n,i,s)),as:o.map(a=>a+""),modified:e.modified.bind(e)}}function uG(e,t,n,i){return Xn(r=>t(r)===e?n(r):NaN,i,e+"")}function cG(e,t,n){const i={},r=[];return n.visit(n.SOURCE,s=>{const o=e(s);i[o]||(i[o]=1,r.push(o))}),r.sort(Lh),t?r.slice(0,t):r}function zk(e){gp.call(this,e)}K(zk,gp,{transform(e,t){const n=e.subflow,i=e.field,r=s=>this.subflow(ge(s),n,t,s);return(e.modified("field")||i&&t.modified(fn(i)))&&U("PreFacet does not support field modification."),this.initTargets(),i?(t.visit(t.MOD,s=>{const o=r(s);i(s).forEach(a=>o.mod(a))}),t.visit(t.ADD,s=>{const o=r(s);i(s).forEach(a=>o.add(et(a)))}),t.visit(t.REM,s=>{const o=r(s);i(s).forEach(a=>o.rem(a))})):(t.visit(t.MOD,s=>r(s).mod(s)),t.visit(t.ADD,s=>r(s).add(s)),t.visit(t.REM,s=>r(s).rem(s))),t.clean()&&t.runAfter(()=>this.clean()),t}});function By(e){I.call(this,null,e)}By.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},K(By,I,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=Ak(e.fields,e.as||[]),s=i?(a,l)=>fG(a,l,i,r):rp;let o;return this.value?o=this.value:(t=t.addAll(),o=this.value={}),t.visit(t.REM,a=>{const l=ge(a);n.rem.push(o[l]),o[l]=null}),t.visit(t.ADD,a=>{const l=s(a,et({}));o[ge(a)]=l,n.add.push(l)}),t.visit(t.MOD,a=>{n.mod.push(s(a,o[ge(a)]))}),n}});function fG(e,t,n,i){for(let r=0,s=n.length;r{const d=ty(f,u);for(let h=0;h{const s=ge(r);n.rem.push(i[s]),i[s]=null}),t.visit(t.ADD,r=>{const s=K2(r);i[ge(r)]=s,n.add.push(s)}),t.visit(t.MOD,r=>{const s=i[ge(r)];for(const o in r)s[o]=r[o],n.modifies(o);n.mod.push(s)})),n}});function Uy(e){I.call(this,[],e),this.count=0}Uy.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},K(Uy,I,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.modified("size"),r=e.size,s=this.value.reduce((c,f)=>(c[ge(f)]=1,c),{});let o=this.value,a=this.count,l=0;function u(c){let f,d;o.length=l&&(f=o[d],s[ge(f)]&&n.rem.push(f),o[d]=c)),++a}if(t.rem.length&&(t.visit(t.REM,c=>{const f=ge(c);s[f]&&(s[f]=-1,n.rem.push(c)),--a}),o=o.filter(c=>s[ge(c)]!==-1)),(t.rem.length||i)&&o.length{s[ge(c)]||u(c)}),l=-1),i&&o.length>r){const c=o.length-r;for(let f=0;f{s[ge(c)]&&n.mod.push(c)}),t.add.length&&t.visit(t.ADD,u),(t.add.length||l<0)&&(n.add=o.filter(c=>!s[ge(c)])),this.count=a,this.value=n.source=o,n}});function qy(e){I.call(this,null,e)}qy.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]},K(qy,I,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),i=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=hi(e.start,e.stop,e.step||1).map(r=>{const s={};return s[i]=r,et(s)}),n.add=t.add.concat(this.value),n}});function jk(e){I.call(this,null,e),this.modified(!0)}K(jk,I,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function Wy(e){I.call(this,null,e)}const Uk=["unit0","unit1"];Wy.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:M2,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:Uk}]},K(Wy,I,{transform(e,t){const n=e.field,i=e.interval!==!1,r=e.timezone==="utc",s=this._floor(e,t),o=(r?iu:nu)(s.unit).offset,a=e.as||Uk,l=a[0],u=a[1],c=s.step;let f=s.start||1/0,d=s.stop||-1/0,h=t.ADD;return(e.modified()||t.changed(t.REM)||t.modified(fn(n)))&&(t=t.reflow(!0),h=t.SOURCE,f=1/0,d=-1/0),t.visit(h,p=>{const g=n(p);let m,y;g==null?(p[l]=null,i&&(p[u]=null)):(p[l]=m=y=s(g),i&&(p[u]=y=o(m,c)),md&&(d=y))}),s.start=f,s.stop=d,t.modifies(i?a:l)},_floor(e,t){const n=e.timezone==="utc",{units:i,step:r}=e.units?{units:e.units,step:e.step||1}:u8({extent:e.extent||Or(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),s=D2(i),o=this.value||{},a=(n?J4:K4)(s,r);return a.unit=Ue(s),a.units=s,a.step=r,a.start=o.start,a.stop=o.stop,this.value=a}});function qk(e){I.call(this,Gl(),e)}K(qk,I,{transform(e,t){const n=t.dataflow,i=e.field,r=this.value,s=a=>r.set(i(a),a);let o=!0;return e.modified("field")||t.modified(i.fields)?(r.clear(),t.visit(t.SOURCE,s)):t.changed()?(t.visit(t.REM,a=>r.delete(i(a))),t.visit(t.ADD,s)):o=!1,this.modified(o),r.empty>n.cleanThreshold&&n.runAfter(r.clean),t.fork()}});function Wk(e){I.call(this,null,e)}K(Wk,I,{transform(e,t){(!this.value||e.modified("field")||e.modified("sort")||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(xa(e.sort)):t.source).map(e.field))}});function hG(e,t,n,i){const r=lf[e](t,n);return{init:r.init||no,update:function(s,o){o[i]=r.next(s)}}}const lf={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?++e:e}}},percent_rank:function(){const e=lf.rank(),t=e.next;return{init:e.init,next:n=>(t(n)-1)/(n.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{const n=t.data,i=t.compare;let r=t.index;if(e0||U("ntile num must be greater than zero.");const n=lf.cume_dist(),i=n.next;return{init:n.init,next:r=>Math.ceil(t*i(r))}},lag:function(e,t){return t=+t||1,{next:n=>{const i=n.index-t;return i>=0?e(n.data[i]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{const i=n.index+t,r=n.data;return ie(t.data[t.i0])}},last_value:function(e){return{next:t=>e(t.data[t.i1-1])}},nth_value:function(e,t){return t=+t,t>0||U("nth_value nth must be greater than zero."),{next:n=>{const i=n.i0+(t-1);return it=null,next:n=>{const i=e(n.data[n.index]);return i!=null?t=i:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:i=>{const r=i.data;return i.index<=n?t:(n=pG(e,r,i.index))<0?(n=r.length,t=null):t=e(r[n])}}}};function pG(e,t,n){for(let i=t.length;nl[g]=1)}h(e.sort),t.forEach((p,g)=>{const m=n[g],y=i[g],b=r[g]||null,v=Et(m),x=bk(p,v,s[g]);if(h(m),o.push(x),pe(lf,p))a.push(hG(p,m,y,x));else{if(m==null&&p!=="count"&&U("Null aggregate field specified."),p==="count"){c.push(x);return}d=!1;let _=u[v];_||(_=u[v]=[],_.field=m,f.push(_)),_.push(vk(p,b,x))}}),(c.length||f.length)&&(this.cell=mG(f,c,d)),this.inputs=Object.keys(l)}const Gk=Hk.prototype;Gk.init=function(){this.windows.forEach(e=>e.init()),this.cell&&this.cell.init()},Gk.update=function(e,t){const n=this.cell,i=this.windows,r=e.data,s=i&&i.length;let o;if(n){for(o=e.p0;o_k(l,l.field));const i={num:0,agg:null,store:!1,count:t};if(!n)for(var r=e.length,s=i.agg=Array(r),o=0;othis.group(r(a));let o=this.state;(!o||n)&&(o=this.state=new Hk(e)),n||t.modified(o.inputs)?(this.value={},t.visit(t.SOURCE,a=>s(a).add(a))):(t.visit(t.REM,a=>s(a).remove(a)),t.visit(t.ADD,a=>s(a).add(a)));for(let a=0,l=this._mlen;a0&&!r(s[n],s[n-1])&&(e.i0=t.left(s,s[n])),i1?0:e<-1?uu:Math.acos(e)}function Yk(e){return e>=1?yp:e<=-1?-yp:Math.asin(e)}const Vy=Math.PI,Xy=2*Vy,$a=1e-6,kG=Xy-$a;function Zk(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Zk;const n=10**t;return function(i){this._+=i[0];for(let r=1,s=i.length;r$a)if(!(Math.abs(f*l-u*c)>$a)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let h=i-o,p=r-a,g=l*l+u*u,m=h*h+p*p,y=Math.sqrt(g),b=Math.sqrt(d),v=s*Math.tan((Vy-Math.acos((g+d-m)/(2*y*b)))/2),x=v/b,_=v/y;Math.abs(x-1)>$a&&this._append`L${t+x*c},${n+x*f}`,this._append`A${s},${s},0,0,${+(f*h>c*p)},${this._x1=t+_*l},${this._y1=n+_*u}`}}arc(t,n,i,r,s,o){if(t=+t,n=+n,i=+i,o=!!o,i<0)throw new Error(`negative radius: ${i}`);let a=i*Math.cos(r),l=i*Math.sin(r),u=t+a,c=n+l,f=1^o,d=o?r-s:s-r;this._x1===null?this._append`M${u},${c}`:(Math.abs(this._x1-u)>$a||Math.abs(this._y1-c)>$a)&&this._append`L${u},${c}`,i&&(d<0&&(d=d%Xy+Xy),d>kG?this._append`A${i},${i},0,1,${f},${t-a},${n-l}A${i},${i},0,1,${f},${this._x1=u},${this._y1=c}`:d>$a&&this._append`A${i},${i},0,${+(d>=Vy)},${f},${this._x1=t+i*Math.cos(s)},${this._y1=n+i*Math.sin(s)}`)}rect(t,n,i,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${i=+i}v${+r}h${-i}Z`}toString(){return this._}};function bp(){return new Yy}bp.prototype=Yy.prototype;function vp(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const i=Math.floor(n);if(!(i>=0))throw new RangeError(`invalid digits: ${n}`);t=i}return e},()=>new Yy(t)}function EG(e){return e.innerRadius}function CG(e){return e.outerRadius}function SG(e){return e.startAngle}function AG(e){return e.endAngle}function TG(e){return e&&e.padAngle}function MG(e,t,n,i,r,s,o,a){var l=n-e,u=i-t,c=o-r,f=a-s,d=f*l-c*u;if(!(d*dM*M+T*T&&($=E,S=A),{cx:$,cy:S,x01:-c,y01:-f,x11:$*(r/_-1),y11:S*(r/_-1)}}function FG(){var e=EG,t=CG,n=nt(0),i=null,r=SG,s=AG,o=TG,a=null,l=vp(u);function u(){var c,f,d=+e.apply(this,arguments),h=+t.apply(this,arguments),p=r.apply(this,arguments)-yp,g=s.apply(this,arguments)-yp,m=Vk(g-p),y=g>p;if(a||(a=c=l()),hbn))a.moveTo(0,0);else if(m>Xk-bn)a.moveTo(h*wa(p),h*Pr(p)),a.arc(0,0,h,p,g,!y),d>bn&&(a.moveTo(d*wa(g),d*Pr(g)),a.arc(0,0,d,g,p,y));else{var b=p,v=g,x=p,_=g,k=m,w=m,$=o.apply(this,arguments)/2,S=$>bn&&(i?+i.apply(this,arguments):ka(d*d+h*h)),E=Gy(Vk(h-d)/2,+n.apply(this,arguments)),A=E,R=E,C,M;if(S>bn){var T=Yk(S/d*Pr($)),O=Yk(S/h*Pr($));(k-=T*2)>bn?(T*=y?1:-1,x+=T,_-=T):(k=0,x=_=(p+g)/2),(w-=O*2)>bn?(O*=y?1:-1,b+=O,v-=O):(w=0,b=v=(p+g)/2)}var P=h*wa(b),j=h*Pr(b),W=d*wa(_),ne=d*Pr(_);if(E>bn){var ae=h*wa(v),ke=h*Pr(v),Ie=d*wa(x),Le=d*Pr(x),We;if(mbn?R>bn?(C=xp(Ie,Le,P,j,h,R,y),M=xp(ae,ke,W,ne,h,R,y),a.moveTo(C.cx+C.x01,C.cy+C.y01),Rbn)||!(k>bn)?a.lineTo(W,ne):A>bn?(C=xp(W,ne,ae,ke,d,-A,y),M=xp(P,j,Ie,Le,d,-A,y),a.lineTo(C.cx+C.x01,C.cy+C.y01),A=h;--p)a.point(v[p],x[p]);a.lineEnd(),a.areaEnd()}y&&(v[d]=+e(m,d,f),x[d]=+t(m,d,f),a.point(i?+i(m,d,f):v[d],n?+n(m,d,f):x[d]))}if(b)return a=null,b+""||null}function c(){return t9().defined(r).curve(o).context(s)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:nt(+f),i=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:nt(+f),u):e},u.x1=function(f){return arguments.length?(i=f==null?null:typeof f=="function"?f:nt(+f),u):i},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:nt(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:nt(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:nt(+f),u):n},u.lineX0=u.lineY0=function(){return c().x(e).y(t)},u.lineY1=function(){return c().x(e).y(n)},u.lineX1=function(){return c().x(i).y(t)},u.defined=function(f){return arguments.length?(r=typeof f=="function"?f:nt(!!f),u):r},u.curve=function(f){return arguments.length?(o=f,s!=null&&(a=o(s)),u):o},u.context=function(f){return arguments.length?(f==null?s=a=null:a=o(s=f),u):s},u}const DG={draw(e,t){const n=ka(t/uu);e.moveTo(n,0),e.arc(0,0,n,0,Xk)}};function NG(e,t){let n=null,i=vp(r);e=typeof e=="function"?e:nt(e||DG),t=typeof t=="function"?t:nt(t===void 0?64:+t);function r(){let s;if(n||(n=s=i()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),s)return n=null,s+""||null}return r.type=function(s){return arguments.length?(e=typeof s=="function"?s:nt(s),r):e},r.size=function(s){return arguments.length?(t=typeof s=="function"?s:nt(+s),r):t},r.context=function(s){return arguments.length?(n=s??null,r):n},r}function po(){}function _p(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function wp(e){this._context=e}wp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:_p(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:_p(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function OG(e){return new wp(e)}function i9(e){this._context=e}i9.prototype={areaStart:po,areaEnd:po,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:_p(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function RG(e){return new i9(e)}function r9(e){this._context=e}r9.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:_p(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function LG(e){return new r9(e)}function s9(e,t){this._basis=new wp(e),this._beta=t}s9.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var i=e[0],r=t[0],s=e[n]-i,o=t[n]-r,a=-1,l;++a<=n;)l=a/n,this._basis.point(this._beta*e[a]+(1-this._beta)*(i+l*s),this._beta*t[a]+(1-this._beta)*(r+l*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const IG=function e(t){function n(i){return t===1?new wp(i):new s9(i,t)}return n.beta=function(i){return e(+i)},n}(.85);function kp(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function Ky(e,t){this._context=e,this._k=(1-t)/6}Ky.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:kp(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:kp(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const zG=function e(t){function n(i){return new Ky(i,t)}return n.tension=function(i){return e(+i)},n}(0);function Jy(e,t){this._context=e,this._k=(1-t)/6}Jy.prototype={areaStart:po,areaEnd:po,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:kp(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const PG=function e(t){function n(i){return new Jy(i,t)}return n.tension=function(i){return e(+i)},n}(0);function Qy(e,t){this._context=e,this._k=(1-t)/6}Qy.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:kp(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const BG=function e(t){function n(i){return new Qy(i,t)}return n.tension=function(i){return e(+i)},n}(0);function eb(e,t,n){var i=e._x1,r=e._y1,s=e._x2,o=e._y2;if(e._l01_a>bn){var a=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,r=(r*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>bn){var u=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*u+e._x1*e._l23_2a-t*e._l12_2a)/c,o=(o*u+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(i,r,s,o,e._x2,e._y2)}function o9(e,t){this._context=e,this._alpha=t}o9.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:eb(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const jG=function e(t){function n(i){return t?new o9(i,t):new Ky(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function a9(e,t){this._context=e,this._alpha=t}a9.prototype={areaStart:po,areaEnd:po,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:eb(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const UG=function e(t){function n(i){return t?new a9(i,t):new Jy(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function l9(e,t){this._context=e,this._alpha=t}l9.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:eb(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const qG=function e(t){function n(i){return t?new l9(i,t):new Qy(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function u9(e){this._context=e}u9.prototype={areaStart:po,areaEnd:po,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function WG(e){return new u9(e)}function c9(e){return e<0?-1:1}function f9(e,t,n){var i=e._x1-e._x0,r=t-e._x1,s=(e._y1-e._y0)/(i||r<0&&-0),o=(n-e._y1)/(r||i<0&&-0),a=(s*r+o*i)/(i+r);return(c9(s)+c9(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(a))||0}function d9(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function tb(e,t,n){var i=e._x0,r=e._y0,s=e._x1,o=e._y1,a=(s-i)/3;e._context.bezierCurveTo(i+a,r+a*t,s-a,o-a*n,s,o)}function $p(e){this._context=e}$p.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:tb(this,this._t0,d9(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,tb(this,d9(this,n=f9(this,e,t)),n);break;default:tb(this,this._t0,n=f9(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function h9(e){this._context=new p9(e)}(h9.prototype=Object.create($p.prototype)).point=function(e,t){$p.prototype.point.call(this,t,e)};function p9(e){this._context=e}p9.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,i,r,s){this._context.bezierCurveTo(t,e,i,n,s,r)}};function HG(e){return new $p(e)}function GG(e){return new h9(e)}function g9(e){this._context=e}g9.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var i=m9(e),r=m9(t),s=0,o=1;o=0;--t)r[t]=(o[t]-r[t+1])/s[t];for(s[n-1]=(e[n]+r[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function XG(e){return new Ep(e,.5)}function YG(e){return new Ep(e,0)}function ZG(e){return new Ep(e,1)}function go(e,t){if(typeof document<"u"&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext)return n.width=e,n.height=t,n}return null}const KG=()=>typeof Image<"u"?Image:null;function Br(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function mo(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const nb=Symbol("implicit");function ib(){var e=new x4,t=[],n=[],i=nb;function r(s){let o=e.get(s);if(o===void 0){if(i!==nb)return i;e.set(s,o=t.push(s)-1)}return n[o%n.length]}return r.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new x4;for(const o of s)e.has(o)||e.set(o,t.push(o)-1);return r},r.range=function(s){return arguments.length?(n=Array.from(s),r):n.slice()},r.unknown=function(s){return arguments.length?(i=s,r):i},r.copy=function(){return ib(t,n).unknown(i)},Br.apply(r,arguments),r}function cu(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function uf(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function yo(){}var Ea=.7,fu=1/Ea,du="\\s*([+-]?\\d+)\\s*",cf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",jr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",JG=/^#([0-9a-f]{3,8})$/,QG=new RegExp(`^rgb\\(${du},${du},${du}\\)$`),eV=new RegExp(`^rgb\\(${jr},${jr},${jr}\\)$`),tV=new RegExp(`^rgba\\(${du},${du},${du},${cf}\\)$`),nV=new RegExp(`^rgba\\(${jr},${jr},${jr},${cf}\\)$`),iV=new RegExp(`^hsl\\(${cf},${jr},${jr}\\)$`),rV=new RegExp(`^hsla\\(${cf},${jr},${jr},${cf}\\)$`),y9={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};cu(yo,ff,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:b9,formatHex:b9,formatHex8:sV,formatHsl:oV,formatRgb:v9,toString:v9});function b9(){return this.rgb().formatHex()}function sV(){return this.rgb().formatHex8()}function oV(){return $9(this).formatHsl()}function v9(){return this.rgb().formatRgb()}function ff(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=JG.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?x9(t):n===3?new Ht(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Cp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Cp(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=QG.exec(e))?new Ht(t[1],t[2],t[3],1):(t=eV.exec(e))?new Ht(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=tV.exec(e))?Cp(t[1],t[2],t[3],t[4]):(t=nV.exec(e))?Cp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=iV.exec(e))?k9(t[1],t[2]/100,t[3]/100,1):(t=rV.exec(e))?k9(t[1],t[2]/100,t[3]/100,t[4]):y9.hasOwnProperty(e)?x9(y9[e]):e==="transparent"?new Ht(NaN,NaN,NaN,0):null}function x9(e){return new Ht(e>>16&255,e>>8&255,e&255,1)}function Cp(e,t,n,i){return i<=0&&(e=t=n=NaN),new Ht(e,t,n,i)}function rb(e){return e instanceof yo||(e=ff(e)),e?(e=e.rgb(),new Ht(e.r,e.g,e.b,e.opacity)):new Ht}function bo(e,t,n,i){return arguments.length===1?rb(e):new Ht(e,t,n,i??1)}function Ht(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}cu(Ht,bo,uf(yo,{brighter(e){return e=e==null?fu:Math.pow(fu,e),new Ht(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ea:Math.pow(Ea,e),new Ht(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ht(Ca(this.r),Ca(this.g),Ca(this.b),Sp(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:_9,formatHex:_9,formatHex8:aV,formatRgb:w9,toString:w9}));function _9(){return`#${Sa(this.r)}${Sa(this.g)}${Sa(this.b)}`}function aV(){return`#${Sa(this.r)}${Sa(this.g)}${Sa(this.b)}${Sa((isNaN(this.opacity)?1:this.opacity)*255)}`}function w9(){const e=Sp(this.opacity);return`${e===1?"rgb(":"rgba("}${Ca(this.r)}, ${Ca(this.g)}, ${Ca(this.b)}${e===1?")":`, ${e})`}`}function Sp(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ca(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Sa(e){return e=Ca(e),(e<16?"0":"")+e.toString(16)}function k9(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Qi(e,t,n,i)}function $9(e){if(e instanceof Qi)return new Qi(e.h,e.s,e.l,e.opacity);if(e instanceof yo||(e=ff(e)),!e)return new Qi;if(e instanceof Qi)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),s=Math.max(t,n,i),o=NaN,a=s-r,l=(s+r)/2;return a?(t===s?o=(n-i)/a+(n0&&l<1?0:o,new Qi(o,a,l,e.opacity)}function Ap(e,t,n,i){return arguments.length===1?$9(e):new Qi(e,t,n,i??1)}function Qi(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}cu(Qi,Ap,uf(yo,{brighter(e){return e=e==null?fu:Math.pow(fu,e),new Qi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ea:Math.pow(Ea,e),new Qi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new Ht(sb(e>=240?e-240:e+120,r,i),sb(e,r,i),sb(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new Qi(E9(this.h),Tp(this.s),Tp(this.l),Sp(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Sp(this.opacity);return`${e===1?"hsl(":"hsla("}${E9(this.h)}, ${Tp(this.s)*100}%, ${Tp(this.l)*100}%${e===1?")":`, ${e})`}`}}));function E9(e){return e=(e||0)%360,e<0?e+360:e}function Tp(e){return Math.max(0,Math.min(1,e||0))}function sb(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const C9=Math.PI/180,S9=180/Math.PI,Mp=18,A9=.96422,T9=1,M9=.82521,F9=4/29,hu=6/29,D9=3*hu*hu,lV=hu*hu*hu;function N9(e){if(e instanceof Ur)return new Ur(e.l,e.a,e.b,e.opacity);if(e instanceof $s)return O9(e);e instanceof Ht||(e=rb(e));var t=ub(e.r),n=ub(e.g),i=ub(e.b),r=ob((.2225045*t+.7168786*n+.0606169*i)/T9),s,o;return t===n&&n===i?s=o=r:(s=ob((.4360747*t+.3850649*n+.1430804*i)/A9),o=ob((.0139322*t+.0971045*n+.7141733*i)/M9)),new Ur(116*r-16,500*(s-r),200*(r-o),e.opacity)}function Fp(e,t,n,i){return arguments.length===1?N9(e):new Ur(e,t,n,i??1)}function Ur(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}cu(Ur,Fp,uf(yo,{brighter(e){return new Ur(this.l+Mp*(e??1),this.a,this.b,this.opacity)},darker(e){return new Ur(this.l-Mp*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=A9*ab(t),e=T9*ab(e),n=M9*ab(n),new Ht(lb(3.1338561*t-1.6168667*e-.4906146*n),lb(-.9787684*t+1.9161415*e+.033454*n),lb(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function ob(e){return e>lV?Math.pow(e,1/3):e/D9+F9}function ab(e){return e>hu?e*e*e:D9*(e-F9)}function lb(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function ub(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function uV(e){if(e instanceof $s)return new $s(e.h,e.c,e.l,e.opacity);if(e instanceof Ur||(e=N9(e)),e.a===0&&e.b===0)return new $s(NaN,0=1?(n=1,t-1):Math.floor(n*t),r=e[i],s=e[i+1],o=i>0?e[i-1]:2*r-s,a=i()=>e;function U9(e,t){return function(n){return e+n*t}}function fV(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function Rp(e,t){var n=t-e;return n?U9(e,n>180||n<-180?n-360*Math.round(n/360):n):Op(isNaN(e)?t:e)}function dV(e){return(e=+e)==1?Gt:function(t,n){return n-t?fV(t,n,e):Op(isNaN(t)?n:t)}}function Gt(e,t){var n=t-e;return n?U9(e,n):Op(isNaN(e)?t:e)}const hb=function e(t){var n=dV(t);function i(r,s){var o=n((r=bo(r)).r,(s=bo(s)).r),a=n(r.g,s.g),l=n(r.b,s.b),u=Gt(r.opacity,s.opacity);return function(c){return r.r=o(c),r.g=a(c),r.b=l(c),r.opacity=u(c),r+""}}return i.gamma=e,i}(1);function q9(e){return function(t){var n=t.length,i=new Array(n),r=new Array(n),s=new Array(n),o,a;for(o=0;on&&(s=t.slice(n,s),a[o]?a[o]+=s:a[++o]=s),(i=i[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,l.push({i:o,x:er(i,r)})),n=mb.lastIndex;return n180?c+=360:c-u>180&&(u+=360),d.push({i:f.push(r(f)+"rotate(",null,i)-2,x:er(u,c)})):c&&f.push(r(f)+"rotate("+c+i)}function a(u,c,f,d){u!==c?d.push({i:f.push(r(f)+"skewX(",null,i)-2,x:er(u,c)}):c&&f.push(r(f)+"skewX("+c+i)}function l(u,c,f,d,h,p){if(u!==f||c!==d){var g=h.push(r(h)+"scale(",null,",",null,")");p.push({i:g-4,x:er(u,f)},{i:g-2,x:er(c,d)})}else(f!==1||d!==1)&&h.push(r(h)+"scale("+f+","+d+")")}return function(u,c){var f=[],d=[];return u=e(u),c=e(c),s(u.translateX,u.translateY,c.translateX,c.translateY,f,d),o(u.rotate,c.rotate,f,d),a(u.skewX,c.skewX,f,d),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,f,d),u=c=null,function(h){for(var p=-1,g=d.length,m;++pt&&(n=e,e=t,t=n),function(i){return Math.max(e,Math.min(t,i))}}function PV(e,t,n){var i=e[0],r=e[1],s=t[0],o=t[1];return r2?BV:PV,l=u=null,f}function f(d){return d==null||isNaN(d=+d)?s:(l||(l=a(e.map(i),t,n)))(i(o(d)))}return f.invert=function(d){return o(r((u||(u=a(t,e.map(i),er)))(d)))},f.domain=function(d){return arguments.length?(e=Array.from(d,vb),c()):e.slice()},f.range=function(d){return arguments.length?(t=Array.from(d),c()):t.slice()},f.rangeRound=function(d){return t=Array.from(d),n=hf,c()},f.clamp=function(d){return arguments.length?(o=d?!0:Jn,c()):o!==Jn},f.interpolate=function(d){return arguments.length?(n=d,c()):n},f.unknown=function(d){return arguments.length?(s=d,f):s},function(d,h){return i=d,r=h,c()}}function i$(){return Ip()(Jn,Jn)}function r$(e,t,n,i){var r=ao(e,t,n),s;switch(i=ma(i??",f"),i.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return i.precision==null&&!isNaN(s=z4(r,o))&&(i.precision=s),E2(i,o)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(s=P4(r,Math.max(Math.abs(e),Math.abs(t))))&&(i.precision=s-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(s=I4(r))&&(i.precision=s-(i.type==="%")*2);break}}return qh(i)}function Ta(e){var t=e.domain;return e.ticks=function(n){var i=t();return x2(i[0],i[i.length-1],n??10)},e.tickFormat=function(n,i){var r=t();return r$(r[0],r[r.length-1],n??10,i)},e.nice=function(n){n==null&&(n=10);var i=t(),r=0,s=i.length-1,o=i[r],a=i[s],l,u,c=10;for(a0;){if(u=_2(o,a,n),u===l)return i[r]=o,i[s]=a,t(i);if(u>0)o=Math.floor(o/u)*u,a=Math.ceil(a/u)*u;else if(u<0)o=Math.ceil(o*u)/u,a=Math.floor(a*u)/u;else break;l=u}return e},e}function s$(){var e=i$();return e.copy=function(){return pf(e,s$())},Br.apply(e,arguments),Ta(e)}function o$(e){var t;function n(i){return i==null||isNaN(i=+i)?t:i}return n.invert=n,n.domain=n.range=function(i){return arguments.length?(e=Array.from(i,vb),n):e.slice()},n.unknown=function(i){return arguments.length?(t=i,n):t},n.copy=function(){return o$(e).unknown(t)},e=arguments.length?Array.from(e,vb):[0,1],Ta(n)}function a$(e,t){e=e.slice();var n=0,i=e.length-1,r=e[n],s=e[i],o;return sMath.pow(e,t)}function HV(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function c$(e){return(t,n)=>-e(-t,n)}function _b(e){const t=e(l$,u$),n=t.domain;let i=10,r,s;function o(){return r=HV(i),s=WV(i),n()[0]<0?(r=c$(r),s=c$(s),e(jV,UV)):e(l$,u$),t}return t.base=function(a){return arguments.length?(i=+a,o()):i},t.domain=function(a){return arguments.length?(n(a),o()):n()},t.ticks=a=>{const l=n();let u=l[0],c=l[l.length-1];const f=c0){for(;d<=h;++d)for(p=1;pc)break;y.push(g)}}else for(;d<=h;++d)for(p=i-1;p>=1;--p)if(g=d>0?p/s(-d):p*s(d),!(gc)break;y.push(g)}y.length*2{if(a==null&&(a=10),l==null&&(l=i===10?"s":","),typeof l!="function"&&(!(i%1)&&(l=ma(l)).precision==null&&(l.trim=!0),l=qh(l)),a===1/0)return l;const u=Math.max(1,i*a/t.ticks().length);return c=>{let f=c/s(Math.round(r(c)));return f*in(a$(n(),{floor:a=>s(Math.floor(r(a))),ceil:a=>s(Math.ceil(r(a)))})),t}function f$(){const e=_b(Ip()).domain([1,10]);return e.copy=()=>pf(e,f$()).base(e.base()),Br.apply(e,arguments),e}function d$(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function h$(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function wb(e){var t=1,n=e(d$(t),h$(t));return n.constant=function(i){return arguments.length?e(d$(t=+i),h$(t)):t},Ta(n)}function p$(){var e=wb(Ip());return e.copy=function(){return pf(e,p$()).constant(e.constant())},Br.apply(e,arguments)}function g$(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function GV(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function VV(e){return e<0?-e*e:e*e}function kb(e){var t=e(Jn,Jn),n=1;function i(){return n===1?e(Jn,Jn):n===.5?e(GV,VV):e(g$(n),g$(1/n))}return t.exponent=function(r){return arguments.length?(n=+r,i()):n},Ta(t)}function $b(){var e=kb(Ip());return e.copy=function(){return pf(e,$b()).exponent(e.exponent())},Br.apply(e,arguments),e}function XV(){return $b.apply(null,arguments).exponent(.5)}function m$(){var e=[],t=[],n=[],i;function r(){var o=0,a=Math.max(1,t.length);for(n=new Array(a-1);++o0?n[a-1]:e[0],a=n?[i[n-1],t]:[i[u-1],i[u]]},o.unknown=function(l){return arguments.length&&(s=l),o},o.thresholds=function(){return i.slice()},o.copy=function(){return y$().domain([e,t]).range(r).unknown(s)},Br.apply(Ta(o),arguments)}function b$(){var e=[.5],t=[0,1],n,i=1;function r(s){return s!=null&&s<=s?t[zc(e,s,0,i)]:n}return r.domain=function(s){return arguments.length?(e=Array.from(s),i=Math.min(e.length,t.length-1),r):e.slice()},r.range=function(s){return arguments.length?(t=Array.from(s),i=Math.min(e.length,t.length-1),r):t.slice()},r.invertExtent=function(s){var o=t.indexOf(s);return[e[o-1],e[o]]},r.unknown=function(s){return arguments.length?(n=s,r):n},r.copy=function(){return b$().domain(e).range(t).unknown(n)},Br.apply(r,arguments)}function YV(e){return new Date(e)}function ZV(e){return e instanceof Date?+e:+new Date(+e)}function Eb(e,t,n,i,r,s,o,a,l,u){var c=i$(),f=c.invert,d=c.domain,h=u(".%L"),p=u(":%S"),g=u("%I:%M"),m=u("%I %p"),y=u("%a %d"),b=u("%b %d"),v=u("%B"),x=u("%Y");function _(k){return(l(k)0?i:1:0}const tX="identity",pu="linear",Es="log",gf="pow",mf="sqrt",Bp="symlog",Ma="time",Fa="utc",qr="sequential",gu="diverging",mu="quantile",jp="quantize",Up="threshold",Mb="ordinal",Fb="point",$$="band",Db="bin-ordinal",zt="continuous",yf="discrete",bf="discretizing",Ni="interpolating",Nb="temporal";function nX(e){return function(t){let n=t[0],i=t[1],r;return i=i&&n[l]<=r&&(s<0&&(s=l),o=l);if(!(s<0))return i=e.invertExtent(n[s]),r=e.invertExtent(n[o]),[i[0]===void 0?i[1]:i[0],r[1]===void 0?r[0]:r[1]]}}function Ob(){const e=ib().unknown(void 0),t=e.domain,n=e.range;let i=[0,1],r,s,o=!1,a=0,l=0,u=.5;delete e.unknown;function c(){const f=t().length,d=i[1]g+r*y);return n(d?m.reverse():m)}return e.domain=function(f){return arguments.length?(t(f),c()):t()},e.range=function(f){return arguments.length?(i=[+f[0],+f[1]],c()):i.slice()},e.rangeRound=function(f){return i=[+f[0],+f[1]],o=!0,c()},e.bandwidth=function(){return s},e.step=function(){return r},e.round=function(f){return arguments.length?(o=!!f,c()):o},e.padding=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),a=l,c()):a},e.paddingInner=function(f){return arguments.length?(a=Math.max(0,Math.min(1,f)),c()):a},e.paddingOuter=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),c()):l},e.align=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),c()):u},e.invertRange=function(f){if(f[0]==null||f[1]==null)return;const d=i[1]i[1-d])))return y=Math.max(0,zh(h,g)-1),b=g===m?y:zh(h,m)-1,g-h[y]>s+1e-10&&++y,d&&(v=y,y=p-b,b=p-v),y>b?void 0:t().slice(y,b+1)},e.invert=function(f){const d=e.invertRange([f,f]);return d&&d[0]},e.copy=function(){return Ob().domain(t()).range(i).round(o).paddingInner(a).paddingOuter(l).align(u)},c()}function E$(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return E$(t())},e}function rX(){return E$(Ob().paddingInner(1))}var sX=Array.prototype.map;function oX(e){return sX.call(e,hn)}const aX=Array.prototype.slice;function C$(){let e=[],t=[];function n(i){return i==null||i!==i?void 0:t[(zc(e,i)-1)%t.length]}return n.domain=function(i){return arguments.length?(e=oX(i),n):e.slice()},n.range=function(i){return arguments.length?(t=aX.call(i),n):t.slice()},n.tickFormat=function(i,r){return r$(e[0],Ue(e),i??10,r)},n.copy=function(){return C$().domain(n.domain()).range(n.range())},n}const qp=new Map,S$=Symbol("vega_scale");function A$(e){return e[S$]=!0,e}function lX(e){return e&&e[S$]===!0}function uX(e,t,n){const i=function(){const s=t();return s.invertRange||(s.invertRange=s.invert?nX(s):s.invertExtent?iX(s):void 0),s.type=e,A$(s)};return i.metadata=Ki(ee(n)),i}function Ke(e,t,n){return arguments.length>1?(qp.set(e,uX(e,t,n)),this):T$(e)?qp.get(e):void 0}Ke(tX,o$),Ke(pu,s$,zt),Ke(Es,f$,[zt,Es]),Ke(gf,$b,zt),Ke(mf,XV,zt),Ke(Bp,p$,zt),Ke(Ma,KV,[zt,Nb]),Ke(Fa,JV,[zt,Nb]),Ke(qr,Cb,[zt,Ni]),Ke(`${qr}-${pu}`,Cb,[zt,Ni]),Ke(`${qr}-${Es}`,v$,[zt,Ni,Es]),Ke(`${qr}-${gf}`,Sb,[zt,Ni]),Ke(`${qr}-${mf}`,QV,[zt,Ni]),Ke(`${qr}-${Bp}`,x$,[zt,Ni]),Ke(`${gu}-${pu}`,_$,[zt,Ni]),Ke(`${gu}-${Es}`,w$,[zt,Ni,Es]),Ke(`${gu}-${gf}`,Ab,[zt,Ni]),Ke(`${gu}-${mf}`,eX,[zt,Ni]),Ke(`${gu}-${Bp}`,k$,[zt,Ni]),Ke(mu,m$,[bf,mu]),Ke(jp,y$,bf),Ke(Up,b$,bf),Ke(Db,C$,[yf,bf]),Ke(Mb,ib,yf),Ke($$,Ob,yf),Ke(Fb,rX,yf);function T$(e){return qp.has(e)}function Da(e,t){const n=qp.get(e);return n&&n.metadata[t]}function Rb(e){return Da(e,zt)}function yu(e){return Da(e,yf)}function Lb(e){return Da(e,bf)}function M$(e){return Da(e,Es)}function cX(e){return Da(e,Nb)}function F$(e){return Da(e,Ni)}function D$(e){return Da(e,mu)}const fX=["clamp","base","constant","exponent"];function N$(e,t){const n=t[0],i=Ue(t)-n;return function(r){return e(n+r*i)}}function Wp(e,t,n){return bb(Ib(t||"rgb",n),e)}function O$(e,t){const n=new Array(t),i=t+1;for(let r=0;re[a]?o[a](e[a]()):0),o)}function Ib(e,t){const n=LV[dX(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function dX(e){return"interpolate"+e.toLowerCase().split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}const hX={blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},pX={category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"};function L$(e){const t=e.length/6|0,n=new Array(t);for(let i=0;iWp(L$(e)));function zb(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(z$[e]=t,this):z$[e]}const Hp="symbol",gX="discrete",mX="gradient",yX=e=>q(e)?e.map(t=>String(t)):String(e),bX=(e,t)=>e[1]-t[1],vX=(e,t)=>t[1]-e[1];function Pb(e,t,n){let i;return Xe(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),n!=null&&(t=Math.min(t,Math.floor(Lc(e.domain())/n||1)+1))),ie(t)&&(i=t.step,t=t.interval),te(t)&&(t=e.type===Ma?nu(t):e.type==Fa?iu(t):U("Only time and utc scales accept interval strings."),i&&(t=t.every(i))),t}function P$(e,t,n){let i=e.range(),r=i[0],s=Ue(i),o=bX;if(r>s&&(i=s,s=r,r=i,o=vX),r=Math.floor(r),s=Math.ceil(s),t=t.map(a=>[a,e(a)]).filter(a=>r<=a[1]&&a[1]<=s).sort(o).map(a=>a[0]),n>0&&t.length>1){const a=[t[0],Ue(t)];for(;t.length>n&&t.length>=3;)t=t.filter((l,u)=>!(u%2));t.length<3&&(t=a)}return t}function Bb(e,t){return e.bins?P$(e,e.bins):e.ticks?e.ticks(t):e.domain()}function B$(e,t,n,i,r,s){const o=t.type;let a=yX;if(o===Ma||r===Ma)a=e.timeFormat(i);else if(o===Fa||r===Fa)a=e.utcFormat(i);else if(M$(o)){const l=e.formatFloat(i);if(s||t.bins)a=l;else{const u=j$(t,n,!1);a=c=>u(c)?l(c):""}}else if(t.tickFormat){const l=t.domain();a=e.formatSpan(l[0],l[l.length-1],n,i)}else i&&(a=e.format(i));return a}function j$(e,t,n){const i=Bb(e,t),r=e.base(),s=Math.log(r),o=Math.max(1,r*t/i.length),a=l=>{let u=l/Math.pow(r,Math.round(Math.log(l)/s));return u*r1?i[1]-i[0]:i[0],o;for(o=1;ojb[e.type]||e.bins;function W$(e,t,n,i,r,s,o){const a=U$[t.type]&&s!==Ma&&s!==Fa?xX(e,t,r):B$(e,t,n,r,s,o);return i===Hp&&kX(t)?$X(a):i===gX?EX(a):CX(a)}const $X=e=>(t,n,i)=>{const r=H$(i[n+1],H$(i.max,1/0)),s=G$(t,e),o=G$(r,e);return s&&o?s+" – "+o:o?"< "+o:"≥ "+s},H$=(e,t)=>e??t,EX=e=>(t,n)=>n?e(t):null,CX=e=>t=>e(t),G$=(e,t)=>Number.isFinite(e)?t(e):null;function SX(e){const t=e.domain(),n=t.length-1;let i=+t[0],r=+Ue(t),s=r-i;if(e.type===Up){const o=n?s/n:.1;i-=o,r+=o,s=r-i}return o=>(o-i)/s}function AX(e,t,n,i){const r=i||t.type;return te(n)&&cX(r)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),!n&&r===Ma?e.timeFormat("%A, %d %B %Y, %X"):!n&&r===Fa?e.utcFormat("%A, %d %B %Y, %X UTC"):W$(e,t,5,null,n,i,!0)}function V$(e,t,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=AX(e,t,n.format,n.formatType);if(Lb(t.type)){const s=q$(t).slice(1).map(r),o=s.length;return`${o} boundar${o===1?"y":"ies"}: ${s.join(", ")}`}else if(yu(t.type)){const s=t.domain(),o=s.length,a=o>i?s.slice(0,i-2).map(r).join(", ")+", ending with "+s.slice(-1).map(r):s.map(r).join(", ");return`${o} value${o===1?"":"s"}: ${a}`}else{const s=t.domain();return`values from ${r(s[0])} to ${r(Ue(s))}`}}let X$=0;function TX(){X$=0}const Gp="p_";function Ub(e){return e&&e.gradient}function Y$(e,t,n){const i=e.gradient;let r=e.id,s=i==="radial"?Gp:"";return r||(r=e.id="gradient_"+X$++,i==="radial"?(e.x1=Wr(e.x1,.5),e.y1=Wr(e.y1,.5),e.r1=Wr(e.r1,0),e.x2=Wr(e.x2,.5),e.y2=Wr(e.y2,.5),e.r2=Wr(e.r2,.5),s=Gp):(e.x1=Wr(e.x1,0),e.y1=Wr(e.y1,0),e.x2=Wr(e.x2,1),e.y2=Wr(e.y2,0))),t[r]=e,"url("+(n||"")+"#"+s+r+")"}function Wr(e,t){return e??t}function Z$(e,t){var n=[],i;return i={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:n,stop:function(r,s){return n.push({offset:r,color:s}),i}}}const K$={basis:{curve:OG},"basis-closed":{curve:RG},"basis-open":{curve:LG},bundle:{curve:IG,tension:"beta",value:.85},cardinal:{curve:zG,tension:"tension",value:0},"cardinal-open":{curve:BG,tension:"tension",value:0},"cardinal-closed":{curve:PG,tension:"tension",value:0},"catmull-rom":{curve:jG,tension:"alpha",value:.5},"catmull-rom-closed":{curve:UG,tension:"alpha",value:.5},"catmull-rom-open":{curve:qG,tension:"alpha",value:.5},linear:{curve:Zy},"linear-closed":{curve:WG},monotone:{horizontal:GG,vertical:HG},natural:{curve:VG},step:{curve:XG},"step-after":{curve:ZG},"step-before":{curve:YG}};function qb(e,t,n){var i=pe(K$,e)&&K$[e],r=null;return i&&(r=i.curve||i[t||"vertical"],i.tension&&n!=null&&(r=r[i.tension](n))),r}const MX={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},FX=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,DX=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,NX=/^((\s+,?\s*)|(,\s*))/,OX=/^[01]/;function bu(e){const t=[];return(e.match(FX)||[]).forEach(i=>{let r=i[0];const s=r.toLowerCase(),o=MX[s],a=RX(s,o,i.slice(1).trim()),l=a.length;if(l1&&(g=Math.sqrt(g),n*=g,i*=g);const m=d/n,y=f/n,b=-f/i,v=d/i,x=m*a+y*l,_=b*a+v*l,k=m*e+y*t,w=b*e+v*t;let S=1/((k-x)*(k-x)+(w-_)*(w-_))-.25;S<0&&(S=0);let E=Math.sqrt(S);s==r&&(E=-E);const A=.5*(x+k)-E*(w-_),R=.5*(_+w)+E*(k-x),C=Math.atan2(_-R,x-A);let T=Math.atan2(w-R,k-A)-C;T<0&&s===1?T+=Hr:T>0&&s===0&&(T-=Hr);const O=Math.ceil(Math.abs(T/(Na+.001))),P=[];for(let j=0;j+e}function Vp(e,t,n){return Math.max(t,Math.min(e,n))}function iE(){var e=jX,t=UX,n=qX,i=WX,r=Cs(0),s=r,o=r,a=r,l=null;function u(c,f,d){var h,p=f??+e.call(this,c),g=d??+t.call(this,c),m=+n.call(this,c),y=+i.call(this,c),b=Math.min(m,y)/2,v=Vp(+r.call(this,c),0,b),x=Vp(+s.call(this,c),0,b),_=Vp(+o.call(this,c),0,b),k=Vp(+a.call(this,c),0,b);if(l||(l=h=bp()),v<=0&&x<=0&&_<=0&&k<=0)l.rect(p,g,m,y);else{var w=p+m,$=g+y;l.moveTo(p+v,g),l.lineTo(w-x,g),l.bezierCurveTo(w-wo*x,g,w,g+wo*x,w,g+x),l.lineTo(w,$-k),l.bezierCurveTo(w,$-wo*k,w-wo*k,$,w-k,$),l.lineTo(p+_,$),l.bezierCurveTo(p+wo*_,$,p,$-wo*_,p,$-_),l.lineTo(p,g+v),l.bezierCurveTo(p,g+wo*v,p+wo*v,g,p+v,g),l.closePath()}if(h)return l=null,h+""||null}return u.x=function(c){return arguments.length?(e=Cs(c),u):e},u.y=function(c){return arguments.length?(t=Cs(c),u):t},u.width=function(c){return arguments.length?(n=Cs(c),u):n},u.height=function(c){return arguments.length?(i=Cs(c),u):i},u.cornerRadius=function(c,f,d,h){return arguments.length?(r=Cs(c),s=f!=null?Cs(f):r,a=d!=null?Cs(d):r,o=h!=null?Cs(h):s,u):r},u.context=function(c){return arguments.length?(l=c??null,u):l},u}function rE(){var e,t,n,i,r=null,s,o,a,l;function u(f,d,h){const p=h/2;if(s){var g=a-d,m=f-o;if(g||m){var y=Math.hypot(g,m),b=(g/=y)*l,v=(m/=y)*l,x=Math.atan2(m,g);r.moveTo(o-b,a-v),r.lineTo(f-g*p,d-m*p),r.arc(f,d,p,x-Math.PI,x),r.lineTo(o+b,a+v),r.arc(o,a,l,x,x+Math.PI)}else r.arc(f,d,p,0,Hr);r.closePath()}else s=1;o=f,a=d,l=p}function c(f){var d,h=f.length,p,g=!1,m;for(r==null&&(r=m=bp()),d=0;d<=h;++d)!(de.x||0,wf=e=>e.y||0,HX=e=>e.width||0,GX=e=>e.height||0,VX=e=>(e.x||0)+(e.width||0),XX=e=>(e.y||0)+(e.height||0),YX=e=>e.startAngle||0,ZX=e=>e.endAngle||0,KX=e=>e.padAngle||0,JX=e=>e.innerRadius||0,QX=e=>e.outerRadius||0,eY=e=>e.cornerRadius||0,tY=e=>xf(e.cornerRadiusTopLeft,e.cornerRadius)||0,nY=e=>xf(e.cornerRadiusTopRight,e.cornerRadius)||0,iY=e=>xf(e.cornerRadiusBottomRight,e.cornerRadius)||0,rY=e=>xf(e.cornerRadiusBottomLeft,e.cornerRadius)||0,sY=e=>xf(e.size,64),oY=e=>e.size||1,Xp=e=>e.defined!==!1,aY=e=>nE(e.shape||"circle"),lY=FG().startAngle(YX).endAngle(ZX).padAngle(KX).innerRadius(JX).outerRadius(QX).cornerRadius(eY),uY=n9().x(_f).y1(wf).y0(XX).defined(Xp),cY=n9().y(wf).x1(_f).x0(VX).defined(Xp),fY=t9().x(_f).y(wf).defined(Xp),dY=iE().x(_f).y(wf).width(HX).height(GX).cornerRadius(tY,nY,iY,rY),hY=NG().type(aY).size(sY),pY=rE().x(_f).y(wf).defined(Xp).size(oY);function Vb(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function gY(e,t){return lY.context(e)(t)}function mY(e,t){const n=t[0],i=n.interpolate||"linear";return(n.orient==="horizontal"?cY:uY).curve(qb(i,n.orient,n.tension)).context(e)(t)}function yY(e,t){const n=t[0],i=n.interpolate||"linear";return fY.curve(qb(i,n.orient,n.tension)).context(e)(t)}function xu(e,t,n,i){return dY.context(e)(t,n,i)}function bY(e,t){return(t.mark.shape||t.shape).context(e)(t)}function vY(e,t){return hY.context(e)(t)}function xY(e,t){return pY.context(e)(t)}var sE=1;function oE(){sE=1}function Xb(e,t,n){var i=t.clip,r=e._defs,s=t.clip_id||(t.clip_id="clip"+sE++),o=r.clipping[s]||(r.clipping[s]={id:s});return Me(i)?o.path=i(null):Vb(n)?o.path=xu(null,n,0,0):(o.width=n.width||0,o.height=n.height||0),"url(#"+s+")"}function Ot(e){this.clear(),e&&this.union(e)}Ot.prototype={clone(){return new Ot(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},set(e,t,n,i){return nthis.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){const i=this.rotatedPoints(e,t,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])},rotatedPoints(e,t,n){var{x1:i,y1:r,x2:s,y2:o}=this,a=Math.cos(e),l=Math.sin(e),u=t-t*a+n*l,c=n-t*l-n*a;return[a*i-l*r+u,l*i+a*r+c,a*i-l*o+u,l*i+a*o+c,a*s-l*r+u,l*s+a*r+c,a*s-l*o+u,l*s+a*o+c]},union(e){return e.x1this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2e.x2||this.y2e.y2)},contains(e,t){return!(ethis.x2||tthis.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function Yp(e){this.mark=e,this.bounds=this.bounds||new Ot}function Zp(e){Yp.call(this,e),this.items=this.items||[]}K(Zp,Yp);function Yb(e){this._pending=0,this._loader=e||ep()}function aE(e){e._pending+=1}function kf(e){e._pending-=1}Yb.prototype={pending(){return this._pending},sanitizeURL(e){const t=this;return aE(t),t._loader.sanitize(e,{context:"href"}).then(n=>(kf(t),n)).catch(()=>(kf(t),null))},loadImage(e){const t=this,n=KG();return aE(t),t._loader.sanitize(e,{context:"image"}).then(i=>{const r=i.href;if(!r||!n)throw{url:r};const s=new n,o=pe(i,"crossOrigin")?i.crossOrigin:"anonymous";return o!=null&&(s.crossOrigin=o),s.onload=()=>kf(t),s.onerror=()=>kf(t),s.src=r,s}).catch(i=>(kf(t),{complete:!1,width:0,height:0,src:i&&i.url||""}))},ready(){const e=this;return new Promise(t=>{function n(i){e.pending()?setTimeout(()=>{n(!0)},10):t(i)}n(!1)})}};function Ss(e,t,n){if(t.stroke&&t.opacity!==0&&t.strokeOpacity!==0){const i=t.strokeWidth!=null?+t.strokeWidth:1;e.expand(i+(n?_Y(t,i):0))}return e}function _Y(e,t){return e.strokeJoin&&e.strokeJoin!=="miter"?0:t}const wY=Hr-1e-8;let Kp,Jp,Qp,Oa,Zb,eg,Kb,Jb;const ko=(e,t)=>Kp.add(e,t),tg=(e,t)=>ko(Jp=e,Qp=t),lE=e=>ko(e,Kp.y1),uE=e=>ko(Kp.x1,e),Ra=(e,t)=>Zb*e+Kb*t,La=(e,t)=>eg*e+Jb*t,Qb=(e,t)=>ko(Ra(e,t),La(e,t)),e3=(e,t)=>tg(Ra(e,t),La(e,t));function $f(e,t){return Kp=e,t?(Oa=t*_o,Zb=Jb=Math.cos(Oa),eg=Math.sin(Oa),Kb=-eg):(Zb=Jb=1,Oa=eg=Kb=0),kY}const kY={beginPath(){},closePath(){},moveTo:e3,lineTo:e3,rect(e,t,n,i){Oa?(Qb(e+n,t),Qb(e+n,t+i),Qb(e,t+i),e3(e,t)):(ko(e+n,t+i),tg(e,t))},quadraticCurveTo(e,t,n,i){const r=Ra(e,t),s=La(e,t),o=Ra(n,i),a=La(n,i);cE(Jp,r,o,lE),cE(Qp,s,a,uE),tg(o,a)},bezierCurveTo(e,t,n,i,r,s){const o=Ra(e,t),a=La(e,t),l=Ra(n,i),u=La(n,i),c=Ra(r,s),f=La(r,s);fE(Jp,o,l,c,lE),fE(Qp,a,u,f,uE),tg(c,f)},arc(e,t,n,i,r,s){if(i+=Oa,r+=Oa,Jp=n*Math.cos(r)+e,Qp=n*Math.sin(r)+t,Math.abs(r-i)>wY)ko(e-n,t-n),ko(e+n,t+n);else{const o=u=>ko(n*Math.cos(u)+e,n*Math.sin(u)+t);let a,l;if(o(i),o(r),r!==i)if(i=i%Hr,i<0&&(i+=Hr),r=r%Hr,r<0&&(r+=Hr),rr;++l,a-=Na)o(a);else for(a=i-i%Na+Na,l=0;l<4&&aLX?(c=o*o+a*s,c>=0&&(c=Math.sqrt(c),l=(-o+c)/s,u=(-o-c)/s)):l=.5*a/o,0d)return!1;g>f&&(f=g)}else if(h>0){if(g0?(e.globalAlpha=n,e.fillStyle=mE(e,t,t.fill),!0):!1}var EY=[];function ku(e,t,n){var i=(i=t.strokeWidth)!=null?i:1;return i<=0?!1:(n*=t.strokeOpacity==null?1:t.strokeOpacity,n>0?(e.globalAlpha=n,e.strokeStyle=mE(e,t,t.stroke),e.lineWidth=i,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||EY),e.lineDashOffset=t.strokeDashOffset||0),!0):!1)}function CY(e,t){return e.zindex-t.zindex||e.index-t.index}function r3(e){if(!e.zdirty)return e.zitems;var t=e.items,n=[],i,r,s;for(r=0,s=t.length;r=0;)if(i=t(n[r]))return i;if(n===s){for(n=e.items,r=n.length;--r>=0;)if(!n[r].zindex&&(i=t(n[r])))return i}return null}function s3(e){return function(t,n,i){nr(n,r=>{(!i||i.intersects(r.bounds))&&yE(e,t,r,r)})}}function SY(e){return function(t,n,i){n.items.length&&(!i||i.intersects(n.bounds))&&yE(e,t,n.items[0],n.items)}}function yE(e,t,n,i){var r=n.opacity==null?1:n.opacity;r!==0&&(e(t,i)||(wu(t,n),n.fill&&ng(t,n,r)&&t.fill(),n.stroke&&ku(t,n,r)&&t.stroke()))}function rg(e){return e=e||Ti,function(t,n,i,r,s,o){return i*=t.pixelRatio,r*=t.pixelRatio,ig(n,a=>{const l=a.bounds;if(!(l&&!l.contains(s,o)||!l)&&e(t,a,i,r,s,o))return a})}}function Ef(e,t){return function(n,i,r,s){var o=Array.isArray(i)?i[0]:i,a=t??o.fill,l=o.stroke&&n.isPointInStroke,u,c;return l&&(u=o.strokeWidth,c=o.strokeCap,n.lineWidth=u??1,n.lineCap=c??"butt"),e(n,i)?!1:a&&n.isPointInPath(r,s)||l&&n.isPointInStroke(r,s)}}function o3(e){return rg(Ef(e))}function Ia(e,t){return"translate("+e+","+t+")"}function a3(e){return"rotate("+e+")"}function AY(e,t){return"scale("+e+","+t+")"}function bE(e){return Ia(e.x||0,e.y||0)}function TY(e){return Ia(e.x||0,e.y||0)+(e.angle?" "+a3(e.angle):"")}function MY(e){return Ia(e.x||0,e.y||0)+(e.angle?" "+a3(e.angle):"")+(e.scaleX||e.scaleY?" "+AY(e.scaleX||1,e.scaleY||1):"")}function l3(e,t,n){function i(o,a){o("transform",TY(a)),o("d",t(null,a))}function r(o,a){return t($f(o,a.angle),a),Ss(o,a).translate(a.x||0,a.y||0)}function s(o,a){var l=a.x||0,u=a.y||0,c=a.angle||0;o.translate(l,u),c&&o.rotate(c*=_o),o.beginPath(),t(o,a),c&&o.rotate(-c),o.translate(-l,-u)}return{type:e,tag:"path",nested:!1,attr:i,bound:r,draw:s3(s),pick:o3(s),isect:n||n3(s)}}var FY=l3("arc",gY);function DY(e,t){for(var n=e[0].orient==="horizontal"?t[1]:t[0],i=e[0].orient==="horizontal"?"y":"x",r=e.length,s=1/0,o,a;--r>=0;)e[r].defined!==!1&&(a=Math.abs(e[r][i]-n),a=0;)if(e[i].defined!==!1&&(r=e[i].x-t[0],s=e[i].y-t[1],o=r*r+s*s,o=0;)if(e[n].defined!==!1&&(i=e[n].x-t[0],r=e[n].y-t[1],s=i*i+r*r,i=e[n].size||1,s.5&&t<1.5?.5-Math.abs(t-1):0}function IY(e,t){e("transform",bE(t))}function _E(e,t){const n=xE(t);e("d",xu(null,t,n,n))}function zY(e,t){e("class","background"),e("aria-hidden",!0),_E(e,t)}function PY(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?_E(e,t):e("d","")}function BY(e,t,n){const i=t.clip?Xb(n,t,t):null;e("clip-path",i)}function jY(e,t){if(!t.clip&&t.items){const n=t.items,i=n.length;for(let r=0;r{const s=r.x||0,o=r.y||0,a=r.strokeForeground,l=r.opacity==null?1:r.opacity;(r.stroke||r.fill)&&l&&(Cf(e,r,s,o),wu(e,r),r.fill&&ng(e,r,l)&&e.fill(),r.stroke&&!a&&ku(e,r,l)&&e.stroke()),e.save(),e.translate(s,o),r.clip&&vE(e,r),n&&n.translate(-s,-o),nr(r,u=>{(u.marktype==="group"||i==null||i.includes(u.marktype))&&this.draw(e,u,n,i)}),n&&n.translate(s,o),e.restore(),a&&r.stroke&&l&&(Cf(e,r,s,o),wu(e,r),ku(e,r,l)&&e.stroke())})}function GY(e,t,n,i,r,s){if(t.bounds&&!t.bounds.contains(r,s)||!t.items)return null;const o=n*e.pixelRatio,a=i*e.pixelRatio;return ig(t,l=>{let u,c,f;const d=l.bounds;if(d&&!d.contains(r,s))return;c=l.x||0,f=l.y||0;const h=c+(l.width||0),p=f+(l.height||0),g=l.clip;if(g&&(rh||sp))return;if(e.save(),e.translate(c,f),c=r-c,f=s-f,g&&Vb(l)&&!WY(e,l,o,a))return e.restore(),null;const m=l.strokeForeground,y=t.interactive!==!1;return y&&m&&l.stroke&&qY(e,l,o,a)?(e.restore(),l):(u=ig(l,b=>VY(b,c,f)?this.pick(b,n,i,c,f):null),!u&&y&&(l.fill||!m&&l.stroke)&&UY(e,l,o,a)&&(u=l),e.restore(),u||null)})}function VY(e,t,n){return(e.interactive!==!1||e.marktype==="group")&&e.bounds&&e.bounds.contains(t,n)}var XY={type:"group",tag:"g",nested:!1,attr:IY,bound:jY,draw:HY,pick:GY,isect:hE,content:BY,background:zY,foreground:PY},Sf={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function c3(e,t){var n=e.image;return(!n||e.url&&e.url!==n.url)&&(n={complete:!1,width:0,height:0},t.loadImage(e.url).then(i=>{e.image=i,e.image.url=e.url})),n}function f3(e,t){return e.width!=null?e.width:!t||!t.width?0:e.aspect!==!1&&e.height?e.height*t.width/t.height:t.width}function d3(e,t){return e.height!=null?e.height:!t||!t.height?0:e.aspect!==!1&&e.width?e.width*t.height/t.width:t.height}function sg(e,t){return e==="center"?t/2:e==="right"?t:0}function og(e,t){return e==="middle"?t/2:e==="bottom"?t:0}function YY(e,t,n){const i=c3(t,n),r=f3(t,i),s=d3(t,i),o=(t.x||0)-sg(t.align,r),a=(t.y||0)-og(t.baseline,s),l=!i.src&&i.toDataURL?i.toDataURL():i.src||"";e("href",l,Sf["xmlns:xlink"],"xlink:href"),e("transform",Ia(o,a)),e("width",r),e("height",s),e("preserveAspectRatio",t.aspect===!1?"none":"xMidYMid")}function ZY(e,t){const n=t.image,i=f3(t,n),r=d3(t,n),s=(t.x||0)-sg(t.align,i),o=(t.y||0)-og(t.baseline,r);return e.set(s,o,s+i,o+r)}function KY(e,t,n){nr(t,i=>{if(n&&!n.intersects(i.bounds))return;const r=c3(i,this);let s=f3(i,r),o=d3(i,r);if(s===0||o===0)return;let a=(i.x||0)-sg(i.align,s),l=(i.y||0)-og(i.baseline,o),u,c,f,d;i.aspect!==!1&&(c=r.width/r.height,f=i.width/i.height,c===c&&f===f&&c!==f&&(f{if(!(n&&!n.intersects(i.bounds))){var r=i.opacity==null?1:i.opacity;r&&kE(e,i,r)&&(wu(e,i),e.stroke())}})}function uZ(e,t,n,i){return e.isPointInStroke?kE(e,t,1)&&e.isPointInStroke(n,i):!1}var cZ={type:"rule",tag:"line",nested:!1,attr:oZ,bound:aZ,draw:lZ,pick:rg(uZ),isect:pE},fZ=l3("shape",bY),dZ=l3("symbol",vY,i3);const $E=u4();var mi={height:Gr,measureWidth:h3,estimateWidth:lg,width:lg,canvas:EE};EE(!0);function EE(e){mi.width=e&&$o?h3:lg}function lg(e,t){return CE(Co(e,t),Gr(e))}function CE(e,t){return~~(.8*e.length*t)}function h3(e,t){return Gr(e)<=0||!(t=Co(e,t))?0:SE(t,ug(e))}function SE(e,t){const n=`(${t}) ${e}`;let i=$E.get(n);return i===void 0&&($o.font=t,i=$o.measureText(e).width,$E.set(n,i)),i}function Gr(e){return e.fontSize!=null?+e.fontSize||0:11}function Eo(e){return e.lineHeight!=null?e.lineHeight:Gr(e)+2}function hZ(e){return q(e)?e.length>1?e:e[0]:e}function Af(e){return hZ(e.lineBreak&&e.text&&!q(e.text)?e.text.split(e.lineBreak):e.text)}function p3(e){const t=Af(e);return(q(t)?t.length-1:0)*Eo(e)}function Co(e,t){const n=t==null?"":(t+"").trim();return e.limit>0&&n.length?gZ(e,n):n}function pZ(e){if(mi.width===h3){const t=ug(e);return n=>SE(n,t)}else if(mi.width===lg){const t=Gr(e);return n=>CE(n,t)}else return t=>mi.width(e,t)}function gZ(e,t){var n=+e.limit,i=pZ(e);if(i(t)>>1,i(t.slice(l))>n?o=l+1:a=l;return r+t.slice(o)}else{for(;o>>1),i(t.slice(0,l))Math.max(d,mi.width(t,h)),0)):f=mi.width(t,c),r==="center"?l-=f/2:r==="right"&&(l-=f),e.set(l+=o,u+=a,l+f,u+i),t.angle&&!n)e.rotate(t.angle*_o,o,a);else if(n===2)return e.rotatedPoints(t.angle*_o,o,a);return e}function bZ(e,t,n){nr(t,i=>{var r=i.opacity==null?1:i.opacity,s,o,a,l,u,c,f;if(!(n&&!n.intersects(i.bounds)||r===0||i.fontSize<=0||i.text==null||i.text.length===0)){if(e.font=ug(i),e.textAlign=i.align||"left",s=cg(i),o=s.x1,a=s.y1,i.angle&&(e.save(),e.translate(o,a),e.rotate(i.angle*_o),o=a=0),o+=i.dx||0,a+=(i.dy||0)+g3(i),c=Af(i),wu(e,i),q(c))for(u=Eo(i),l=0;lt;)e.removeChild(n[--i]);return e}function OE(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function fg(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function $Z(e,t,n,i){var r=e&&e.mark,s,o;if(r&&(s=yi[r.marktype]).tip){for(o=fg(t,n),o[0]-=i[0],o[1]-=i[1];e=e.mark.group;)o[0]-=e.x||0,o[1]-=e.y||0;e=s.tip(r.items,o)}return e}function Ao(e,t){this._active=null,this._handlers={},this._loader=e||ep(),this._tooltip=t||EZ}function EZ(e,t,n,i){e.element().setAttribute("title",i||"")}Ao.prototype={initialize(e,t,n){return this._el=e,this._obj=n||null,this.origin(t)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},origin(e){return arguments.length?(this._origin=e||[0,0],this):this._origin.slice()},scene(e){return arguments.length?(this._scene=e,this):this._scene},on(){},off(){},_handlerIndex(e,t,n){for(let i=e?e.length:0;--i>=0;)if(e[i].type===t&&(!n||e[i].handler===n))return i;return-1},handlers(e){const t=this._handlers,n=[];if(e)n.push(...t[this.eventName(e)]);else for(const i in t)n.push(...t[i]);return n},eventName(e){const t=e.indexOf(".");return t<0?e:e.slice(0,t)},handleHref(e,t,n){this._loader.sanitize(n,{context:"href"}).then(i=>{const r=new MouseEvent(e.type,e),s=So(null,"a");for(const o in i)s.setAttribute(o,i[o]);s.dispatchEvent(r)}).catch(()=>{})},handleTooltip(e,t,n){if(t&&t.tooltip!=null){t=$Z(t,e,this.canvas(),this._origin);const i=n&&t&&t.tooltip||null;this._tooltip.call(this._obj,this,e,t,i)}},getItemBoundingClientRect(e){const t=this.canvas();if(!t)return;const n=t.getBoundingClientRect(),i=this._origin,r=e.bounds,s=r.width(),o=r.height();let a=r.x1+i[0]+n.left,l=r.y1+i[1]+n.top;for(;e.mark&&(e=e.mark.group);)a+=e.x||0,l+=e.y||0;return{x:a,y:l,width:s,height:o,left:a,top:l,right:a+s,bottom:l+o}}};function bi(e){this._el=null,this._bgcolor=null,this._loader=new Yb(e)}bi.prototype={initialize(e,t,n,i,r){return this._el=e,this.resize(t,n,i,r)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},background(e){return arguments.length===0?this._bgcolor:(this._bgcolor=e,this)},resize(e,t,n,i){return this._width=e,this._height=t,this._origin=n||[0,0],this._scale=i||1,this},dirty(){},render(e,t){const n=this;return n._call=function(){n._render(e,t)},n._call(),n._call=null,n},_render(){},renderAsync(e,t){const n=this.render(e,t);return this._ready?this._ready.then(()=>n):Promise.resolve(n)},_load(e,t){var n=this,i=n._loader[e](t);if(!n._ready){const r=n._call;n._ready=n._loader.ready().then(s=>{s&&r(),n._ready=null})}return i},sanitizeURL(e){return this._load("sanitizeURL",e)},loadImage(e){return this._load("loadImage",e)}};const CZ="keydown",SZ="keypress",AZ="keyup",RE="dragenter",dg="dragleave",LE="dragover",x3="pointerdown",TZ="pointerup",hg="pointermove",Ff="pointerout",IE="pointerover",_3="mousedown",MZ="mouseup",zE="mousemove",w3="mouseout",PE="mouseover",pg="click",FZ="dblclick",DZ="wheel",BE="mousewheel",gg="touchstart",mg="touchmove",yg="touchend",NZ=[CZ,SZ,AZ,RE,dg,LE,x3,TZ,hg,Ff,IE,_3,MZ,zE,w3,PE,pg,FZ,DZ,BE,gg,mg,yg],k3=hg,Df=Ff,$3=pg;function To(e,t){Ao.call(this,e,t),this._down=null,this._touch=null,this._first=!0,this._events={}}const OZ=e=>e===gg||e===mg||e===yg?[gg,mg,yg]:[e];function jE(e,t){OZ(t).forEach(n=>RZ(e,n))}function RZ(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?i=>e[t](i):i=>e.fire(t,i)))}function Nf(e,t,n){t.forEach(i=>e.fire(i,n))}function UE(e,t,n){return function(i){const r=this._active,s=this.pickEvent(i);s===r?Nf(this,e,i):((!r||!r.exit)&&Nf(this,n,i),this._active=s,Nf(this,t,i),Nf(this,e,i))}}function qE(e){return function(t){Nf(this,e,t),this._active=null}}K(To,Ao,{initialize(e,t,n){return this._canvas=e&&v3(e,"canvas"),[pg,_3,x3,hg,Ff,dg].forEach(i=>jE(this,i)),Ao.prototype.initialize.call(this,e,t,n)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:NZ,DOMMouseScroll(e){this.fire(BE,e)},pointermove:UE([hg,zE],[IE,PE],[Ff,w3]),dragover:UE([LE],[RE],[dg]),pointerout:qE([Ff,w3]),dragleave:qE([dg]),pointerdown(e){this._down=this._active,this.fire(x3,e)},mousedown(e){this._down=this._active,this.fire(_3,e)},click(e){this._down===this._active&&(this.fire(pg,e),this._down=null)},touchstart(e){this._touch=this.pickEvent(e.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(gg,e,!0)},touchmove(e){this.fire(mg,e,!0)},touchend(e){this.fire(yg,e,!0),this._touch=null},fire(e,t,n){const i=n?this._touch:this._active,r=this._handlers[e];if(t.vegaType=e,e===$3&&i&&i.href?this.handleHref(t,i,i.href):(e===k3||e===Df)&&this.handleTooltip(t,i,e!==Df),r)for(let s=0,o=r.length;s=0&&i.splice(r,1),this},pickEvent(e){const t=fg(e,this._canvas),n=this._origin;return this.pick(this._scene,t[0],t[1],t[0]-n[0],t[1]-n[1])},pick(e,t,n,i,r){const s=this.context();return yi[e.marktype].pick.call(this,s,e,t,n,i,r)}});function LZ(){return typeof window<"u"&&window.devicePixelRatio||1}var IZ=LZ();function zZ(e,t,n,i,r,s){const o=typeof HTMLElement<"u"&&e instanceof HTMLElement&&e.parentNode!=null,a=e.getContext("2d"),l=o?IZ:r;e.width=t*l,e.height=n*l;for(const u in s)a[u]=s[u];return o&&l!==1&&(e.style.width=t+"px",e.style.height=n+"px"),a.pixelRatio=l,a.setTransform(l,0,0,l,l*i[0],l*i[1]),e}function Of(e){bi.call(this,e),this._options={},this._redraw=!1,this._dirty=new Ot,this._tempb=new Ot}const WE=bi.prototype,PZ=(e,t,n)=>new Ot().set(0,0,t,n).translate(-e[0],-e[1]);function BZ(e,t,n){return t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio),t.translate(-(n[0]%1),-(n[1]%1)),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}K(Of,bi,{initialize(e,t,n,i,r,s){return this._options=s||{},this._canvas=this._options.externalContext?null:go(1,1,this._options.type),e&&this._canvas&&(Ri(e,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),WE.initialize.call(this,e,t,n,i,r)},resize(e,t,n,i){if(WE.resize.call(this,e,t,n,i),this._canvas)zZ(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const r=this._options.externalContext;r||U("CanvasRenderer is missing a valid canvas or context"),r.scale(this._scale,this._scale),r.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this},canvas(){return this._canvas},context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)},dirty(e){const t=this._tempb.clear().union(e.bounds);let n=e.mark.group;for(;n;)t.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(t)},_render(e,t){const n=this.context(),i=this._origin,r=this._width,s=this._height,o=this._dirty,a=PZ(i,r,s);n.save();const l=this._redraw||o.empty()?(this._redraw=!1,a.expand(1)):BZ(n,a.intersect(o),i);return this.clear(-i[0],-i[1],r,s),this.draw(n,e,l,t),n.restore(),o.clear(),this},draw(e,t,n,i){if(t.marktype!=="group"&&i!=null&&!i.includes(t.marktype))return;const r=yi[t.marktype];t.clip&&LY(e,t),r.draw.call(this,e,t,n,i),t.clip&&e.restore()},clear(e,t,n,i){const r=this._options,s=this.context();r.type!=="pdf"&&!r.externalContext&&s.clearRect(e,t,n,i),this._bgcolor!=null&&(s.fillStyle=this._bgcolor,s.fillRect(e,t,n,i))}});function E3(e,t){Ao.call(this,e,t);const n=this;n._hrefHandler=C3(n,(i,r)=>{r&&r.href&&n.handleHref(i,r,r.href)}),n._tooltipHandler=C3(n,(i,r)=>{n.handleTooltip(i,r,i.type!==Df)})}const C3=(e,t)=>n=>{let i=n.target.__data__;i=Array.isArray(i)?i[0]:i,n.vegaType=n.type,t.call(e._obj,n,i)};K(E3,Ao,{initialize(e,t,n){let i=this._svg;return i&&(i.removeEventListener($3,this._hrefHandler),i.removeEventListener(k3,this._tooltipHandler),i.removeEventListener(Df,this._tooltipHandler)),this._svg=i=e&&v3(e,"svg"),i&&(i.addEventListener($3,this._hrefHandler),i.addEventListener(k3,this._tooltipHandler),i.addEventListener(Df,this._tooltipHandler)),Ao.prototype.initialize.call(this,e,t,n)},canvas(){return this._svg},on(e,t){const n=this.eventName(e),i=this._handlers;if(this._handlerIndex(i[n],e,t)<0){const s={type:e,handler:t,listener:C3(this,t)};(i[n]||(i[n]=[])).push(s),this._svg&&this._svg.addEventListener(n,s.listener)}return this},off(e,t){const n=this.eventName(e),i=this._handlers[n],r=this._handlerIndex(i,e,t);return r>=0&&(this._svg&&this._svg.removeEventListener(n,i[r].listener),i.splice(r,1)),this}});const HE="aria-hidden",S3="aria-label",A3="role",T3="aria-roledescription",GE="graphics-object",M3="graphics-symbol",VE=(e,t,n)=>({[A3]:e,[T3]:t,[S3]:n||void 0}),jZ=Ki(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),XE={axis:{desc:"axis",caption:WZ},legend:{desc:"legend",caption:HZ},"title-text":{desc:"title",caption:e=>`Title text '${JE(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${JE(e)}'`}},YE={ariaRole:A3,ariaRoleDescription:T3,description:S3};function ZE(e,t){const n=t.aria===!1;if(e(HE,n||void 0),n||t.description==null)for(const i in YE)e(YE[i],void 0);else{const i=t.mark.marktype;e(S3,t.description),e(A3,t.ariaRole||(i==="group"?GE:M3)),e(T3,t.ariaRoleDescription||`${i} mark`)}}function KE(e){return e.aria===!1?{[HE]:!0}:jZ[e.role]?null:XE[e.role]?qZ(e,XE[e.role]):UZ(e)}function UZ(e){const t=e.marktype,n=t==="group"||t==="text"||e.items.some(i=>i.description!=null&&i.aria!==!1);return VE(n?GE:M3,`${t} mark container`,e.description)}function qZ(e,t){try{const n=e.items[0],i=t.caption||(()=>"");return VE(t.role||M3,t.desc,n.description||i(n))}catch{return null}}function JE(e){return ee(e.text).join(" ")}function WZ(e){const t=e.datum,n=e.orient,i=t.title?QE(e):null,r=e.context,s=r.scales[t.scale].value,o=r.dataflow.locale(),a=s.type;return`${n==="left"||n==="right"?"Y":"X"}-axis`+(i?` titled '${i}'`:"")+` for a ${yu(a)?"discrete":a} scale with ${V$(o,s,e)}`}function HZ(e){const t=e.datum,n=t.title?QE(e):null,i=`${t.type||""} legend`.trim(),r=t.scales,s=Object.keys(r),o=e.context,a=o.scales[r[s[0]]].value,l=o.dataflow.locale();return VZ(i)+(n?` titled '${n}'`:"")+` for ${GZ(s)} with ${V$(l,a,e)}`}function QE(e){try{return ee(Ue(e.items).items[0].text).join(" ")}catch{return null}}function GZ(e){return e=e.map(t=>t+(t==="fill"||t==="stroke"?" color":"")),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+Ue(e)}function VZ(e){return e.length?e[0].toUpperCase()+e.slice(1):e}const eC=e=>(e+"").replace(/&/g,"&").replace(//g,">"),XZ=e=>eC(e).replace(/"/g,""").replace(/\t/g," ").replace(/\n/g," ").replace(/\r/g," ");function F3(){let e="",t="",n="";const i=[],r=()=>t=n="",s=l=>{t&&(e+=`${t}>${n}`,r()),i.push(l)},o=(l,u)=>(u!=null&&(t+=` ${l}="${XZ(u)}"`),a),a={open(l){s(l),t="<"+l;for(var u=arguments.length,c=new Array(u>1?u-1:0),f=1;f${n}`:"/>"):e+=``,r(),a},attr:o,text:l=>(n+=eC(l),a),toString:()=>e};return a}const tC=e=>nC(F3(),e)+"";function nC(e,t){if(e.open(t.tagName),t.hasAttributes()){const n=t.attributes,i=n.length;for(let r=0;r{u.dirty=t})),!i.zdirty){if(n.exit){s.nested&&i.items.length?(l=i.items[0],l._svg&&this._update(s,l._svg,l)):n._svg&&(l=n._svg.parentNode,l&&l.removeChild(n._svg)),n._svg=null;continue}n=s.nested?i.items[0]:n,n._update!==t&&(!n._svg||!n._svg.ownerSVGElement?(this._dirtyAll=!1,sC(n,t)):this._update(s,n._svg,n),n._update=t)}return!this._dirtyAll},mark(e,t,n,i){if(!this.isDirty(t))return t._svg;const r=this._svg,s=t.marktype,o=yi[s],a=t.interactive===!1?"none":null,l=o.tag==="g",u=oC(t,e,n,"g",r);if(s!=="group"&&i!=null&&!i.includes(s))return Ri(u,0),t._svg;u.setAttribute("class",OE(t));const c=KE(t);for(const p in c)An(u,p,c[p]);l||An(u,"pointer-events",a),An(u,"clip-path",t.clip?Xb(this,t,t.group):null);let f=null,d=0;const h=p=>{const g=this.isDirty(p),m=oC(p,u,f,o.tag,r);g&&(this._update(o,m,p),l&&KZ(this,m,p,i)),f=m,++d};return o.nested?t.items.length&&h(t.items[0]):nr(t,h),Ri(u,d),u},_update(e,t,n){As=t,vn=t.__values__,ZE(Lf,n),e.attr(Lf,n,this);const i=QZ[e.type];i&&i.call(this,e,t,n),As&&this.style(As,n)},style(e,t){if(t!=null){for(const n in bg){let i=n==="font"?Tf(t):t[n];if(i===vn[n])continue;const r=bg[n];i==null?e.removeAttribute(r):(Ub(i)&&(i=Y$(i,this._defs.gradient,aC())),e.setAttribute(r,i+"")),vn[n]=i}for(const n in vg)_g(e,vg[n],t[n])}},defs(){const e=this._svg,t=this._defs;let n=t.el,i=0;for(const r in t.gradient)n||(t.el=n=Pt(e,Rf+1,"defs",Bt)),i=YZ(n,t.gradient[r],i);for(const r in t.clipping)n||(t.el=n=Pt(e,Rf+1,"defs",Bt)),i=ZZ(n,t.clipping[r],i);n&&(i===0?(e.removeChild(n),t.el=null):Ri(n,i))},_clearDefs(){const e=this._defs;e.gradient={},e.clipping={}}});function sC(e,t){for(;e&&e.dirty!==t;e=e.mark.group)if(e.dirty=t,e.mark&&e.mark.dirty!==t)e.mark.dirty=t;else return}function YZ(e,t,n){let i,r,s;if(t.gradient==="radial"){let o=Pt(e,n++,"pattern",Bt);Mo(o,{id:Gp+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),o=Pt(o,0,"rect",Bt),Mo(o,{width:1,height:1,fill:`url(${aC()}#${t.id})`}),e=Pt(e,n++,"radialGradient",Bt),Mo(e,{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else e=Pt(e,n++,"linearGradient",Bt),Mo(e,{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2});for(i=0,r=t.stops.length;i{r=e.mark(t,o,r,i),++s}),Ri(t,1+s)}function oC(e,t,n,i,r){let s=e._svg,o;if(!s&&(o=t.ownerDocument,s=So(o,i,Bt),e._svg=s,e.mark&&(s.__data__=e,s.__values__={fill:"default"},i==="g"))){const a=So(o,"path",Bt);s.appendChild(a),a.__data__=e;const l=So(o,"g",Bt);s.appendChild(l),l.__data__=e;const u=So(o,"path",Bt);s.appendChild(u),u.__data__=e,u.__values__={fill:"default"}}return(s.ownerSVGElement!==r||JZ(s,n))&&t.insertBefore(s,n?n.nextSibling:t.firstChild),s}function JZ(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}let As=null,vn=null;const QZ={group(e,t,n){const i=As=t.childNodes[2];vn=i.__values__,e.foreground(Lf,n,this),vn=t.__values__,As=t.childNodes[1],e.content(Lf,n,this);const r=As=t.childNodes[0];e.background(Lf,n,this);const s=n.mark.interactive===!1?"none":null;if(s!==vn.events&&(An(i,"pointer-events",s),An(r,"pointer-events",s),vn.events=s),n.strokeForeground&&n.stroke){const o=n.fill;An(i,"display",null),this.style(r,n),An(r,"stroke",null),o&&(n.fill=null),vn=i.__values__,this.style(i,n),o&&(n.fill=o),As=null}else An(i,"display","none")},image(e,t,n){n.smooth===!1?(_g(t,"image-rendering","optimizeSpeed"),_g(t,"image-rendering","pixelated")):_g(t,"image-rendering",null)},text(e,t,n){const i=Af(n);let r,s,o,a;q(i)?(s=i.map(l=>Co(n,l)),r=s.join(` -`),r!==vn.text&&(Ri(t,0),o=t.ownerDocument,a=Eo(n),s.forEach((l,u)=>{const c=So(o,"tspan",Bt);c.__data__=n,c.textContent=l,u&&(c.setAttribute("x",0),c.setAttribute("dy",a)),t.appendChild(c)}),vn.text=r)):(s=Co(n,i),s!==vn.text&&(t.textContent=s,vn.text=s)),An(t,"font-family",Tf(n)),An(t,"font-size",Gr(n)+"px"),An(t,"font-style",n.fontStyle),An(t,"font-variant",n.fontVariant),An(t,"font-weight",n.fontWeight)}};function Lf(e,t,n){t!==vn[e]&&(n?eK(As,e,t,n):An(As,e,t),vn[e]=t)}function _g(e,t,n){n!==vn[t]&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n+""),vn[t]=n)}function Mo(e,t){for(const n in t)An(e,n,t[n])}function An(e,t,n){n!=null?e.setAttribute(t,n):e.removeAttribute(t)}function eK(e,t,n,i){n!=null?e.setAttributeNS(i,t,n):e.removeAttributeNS(i,t)}function aC(){let e;return typeof window>"u"?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}function N3(e){bi.call(this,e),this._text=null,this._defs={gradient:{},clipping:{}}}K(N3,bi,{svg(){return this._text},_render(e){const t=F3();t.open("svg",Fe({},Sf,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const n=this._bgcolor;return n&&n!=="transparent"&&n!=="none"&&t.open("rect",{width:this._width,height:this._height,fill:n}).close(),t.open("g",iC,{transform:"translate("+this._origin+")"}),this.mark(t,e),t.close(),this.defs(t),this._text=t.close()+"",this},mark(e,t){const n=yi[t.marktype],i=n.tag,r=[ZE,n.attr];e.open("g",{class:OE(t),"clip-path":t.clip?Xb(this,t,t.group):null},KE(t),{"pointer-events":i!=="g"&&t.interactive===!1?"none":null});const s=o=>{const a=this.href(o);if(a&&e.open("a",a),e.open(i,this.attr(t,o,r,i!=="g"?i:null)),i==="text"){const l=Af(o);if(q(l)){const u={x:0,dy:Eo(o)};for(let c=0;cthis.mark(e,f)),e.close(),l&&c?(u&&(o.fill=null),o.stroke=c,e.open("path",this.attr(t,o,n.foreground,"bgrect")).close(),u&&(o.fill=u)):e.open("path",this.attr(t,o,n.foreground,"bgfore")).close()}e.close(),a&&e.close()};return n.nested?t.items&&t.items.length&&s(t.items[0]):nr(t,s),e.close()},href(e){const t=e.href;let n;if(t){if(n=this._hrefs&&this._hrefs[t])return n;this.sanitizeURL(t).then(i=>{i["xlink:href"]=i.href,i.href=null,(this._hrefs||(this._hrefs={}))[t]=i})}return null},attr(e,t,n,i){const r={},s=(o,a,l,u)=>{r[u||o]=a};return Array.isArray(n)?n.forEach(o=>o(s,t,this)):n(s,t,this),i&&tK(r,t,e,i,this._defs),r},defs(e){const t=this._defs.gradient,n=this._defs.clipping;if(Object.keys(t).length+Object.keys(n).length!==0){e.open("defs");for(const r in t){const s=t[r],o=s.stops;s.gradient==="radial"?(e.open("pattern",{id:Gp+r,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),e.open("rect",{width:"1",height:"1",fill:"url(#"+r+")"}).close(),e.close(),e.open("radialGradient",{id:r,fx:s.x1,fy:s.y1,fr:s.r1,cx:s.x2,cy:s.y2,r:s.r2})):e.open("linearGradient",{id:r,x1:s.x1,x2:s.x2,y1:s.y1,y2:s.y2});for(let a=0;a!ir.svgMarkTypes.includes(r));this._svgRenderer.render(e,ir.svgMarkTypes),this._canvasRenderer.render(e,i)},resize(e,t,n,i){return lC.resize.call(this,e,t,n,i),this._svgRenderer.resize(e,t,n,i),this._canvasRenderer.resize(e,t,n,i),this},background(e){return ir.svgOnTop?this._canvasRenderer.background(e):this._svgRenderer.background(e),this}});function O3(e,t){To.call(this,e,t)}K(O3,To,{initialize(e,t,n){const i=Pt(Pt(e,0,"div"),ir.svgOnTop?0:1,"div");return To.prototype.initialize.call(this,i,t,n)}});const uC="canvas",cC="hybrid",fC="png",dC="svg",hC="none",Fo={Canvas:uC,PNG:fC,SVG:dC,Hybrid:cC,None:hC},za={};za[uC]=za[fC]={renderer:Of,headless:Of,handler:To},za[dC]={renderer:xg,headless:N3,handler:E3},za[cC]={renderer:wg,headless:wg,handler:O3},za[hC]={};function kg(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(za[e]=t,this):za[e]}function pC(e,t,n){const i=[],r=new Ot().union(t),s=e.marktype;return s?gC(e,r,n,i):s==="group"?mC(e,r,n,i):U("Intersect scene must be mark node or group item.")}function gC(e,t,n,i){if(iK(e,t,n)){const r=e.items,s=e.marktype,o=r.length;let a=0;if(s==="group")for(;a=0;s--)if(n[s]!=i[s])return!1;for(s=n.length-1;s>=0;s--)if(r=n[s],!L3(e[r],t[r],r))return!1;return typeof e==typeof t}function oK(){oE(),TX()}const $u="top",rr="left",sr="right",Do="bottom",aK="top-left",lK="top-right",uK="bottom-left",cK="bottom-right",I3="start",z3="middle",Tn="end",fK="x",dK="y",$g="group",P3="axis",B3="title",hK="frame",pK="scope",j3="legend",xC="row-header",_C="row-footer",wC="row-title",kC="column-header",$C="column-footer",EC="column-title",gK="padding",mK="symbol",CC="fit",SC="fit-x",AC="fit-y",yK="pad",U3="none",Eg="all",q3="each",W3="flush",No="column",Oo="row";function TC(e){I.call(this,null,e)}K(TC,I,{transform(e,t){const n=t.dataflow,i=e.mark,r=i.marktype,s=yi[r],o=s.bound;let a=i.bounds,l;if(s.nested)i.items.length&&n.dirty(i.items[0]),a=Cg(i,o),i.items.forEach(u=>{u.bounds.clear().union(a)});else if(r===$g||e.modified())switch(t.visit(t.MOD,u=>n.dirty(u)),a.clear(),i.items.forEach(u=>a.union(Cg(u,o))),i.role){case P3:case j3:case B3:t.reflow()}else l=t.changed(t.REM),t.visit(t.ADD,u=>{a.union(Cg(u,o))}),t.visit(t.MOD,u=>{l=l||a.alignsWith(u.bounds),n.dirty(u),a.union(Cg(u,o))}),l&&(a.clear(),i.items.forEach(u=>a.union(u.bounds)));return bC(i),t.modifies("bounds")}});function Cg(e,t,n){return t(e.bounds.clear(),e,n)}const MC=":vega_identifier:";function H3(e){I.call(this,0,e)}H3.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},K(H3,I,{transform(e,t){const n=bK(t.dataflow),i=e.as;let r=n.value;return t.visit(t.ADD,s=>s[i]=s[i]||++r),n.set(this.value=r),t}});function bK(e){return e._signals[MC]||(e._signals[MC]=e.add(0))}function FC(e){I.call(this,null,e)}K(FC,I,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,vK(e),e.index),n.group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);const i=n.marktype===$g?Zp:Yp;return t.visit(t.ADD,r=>i.call(r,n)),(e.modified("clip")||e.modified("interactive"))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}});function vK(e){const t=e.groups,n=e.parent;return t&&t.size===1?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}function DC(e){I.call(this,null,e)}const NC={parity:e=>e.filter((t,n)=>n%2?t.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((i,r)=>!r||!OC(n.bounds,i.bounds,t)?(n=i,1):i.opacity=0)}},OC=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),RC=(e,t)=>{for(var n=1,i=e.length,r=e[0].bounds,s;n{const t=e.bounds;return t.width()>1&&t.height()>1},_K=(e,t,n)=>{var i=e.range(),r=new Ot;return t===$u||t===Do?r.set(i[0],-1/0,i[1],1/0):r.set(-1/0,i[0],1/0,i[1]),r.expand(n||1),s=>r.encloses(s.bounds)},LC=e=>(e.forEach(t=>t.opacity=1),e),IC=(e,t)=>e.reflow(t.modified()).modifies("opacity");K(DC,I,{transform(e,t){const n=NC[e.method]||NC.parity,i=e.separation||0;let r=t.materialize(t.SOURCE).source,s,o;if(!r||!r.length)return;if(!e.method)return e.modified("method")&&(LC(r),t=IC(t,e)),t;if(r=r.filter(xK),!r.length)return;if(e.sort&&(r=r.slice().sort(e.sort)),s=LC(r),t=IC(t,e),s.length>=3&&RC(s,i)){do s=n(s,i);while(s.length>=3&&RC(s,i));s.length<3&&!Ue(r).opacity&&(s.length>1&&(Ue(s).opacity=0),Ue(r).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(o=_K(e.boundScale,e.boundOrient,+e.boundTolerance),r.forEach(l=>{o(l)||(l.opacity=0)}));const a=s[0].mark.bounds.clear();return r.forEach(l=>{l.opacity&&a.union(l.bounds)}),t}});function zC(e){I.call(this,null,e)}K(zC,I,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,i=>n.dirty(i)),t.fields&&t.fields.zindex){const i=t.source&&t.source[0];i&&(i.mark.zdirty=!0)}}});const xn=new Ot;function Eu(e,t,n){return e[t]===n?0:(e[t]=n,1)}function wK(e){var t=e.items[0].orient;return t===rr||t===sr}function kK(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}function $K(e,t,n,i){var r=t.items[0],s=r.datum,o=r.translate!=null?r.translate:.5,a=r.orient,l=kK(s),u=r.range,c=r.offset,f=r.position,d=r.minExtent,h=r.maxExtent,p=s.title&&r.items[l[2]].items[0],g=r.titlePadding,m=r.bounds,y=p&&p3(p),b=0,v=0,x,_;switch(xn.clear().union(m),m.clear(),(x=l[0])>-1&&m.union(r.items[x].bounds),(x=l[1])>-1&&m.union(r.items[x].bounds),a){case $u:b=f||0,v=-c,_=Math.max(d,Math.min(h,-m.y1)),m.add(0,-_).add(u,0),p&&Sg(e,p,_,g,y,0,-1,m);break;case rr:b=-c,v=f||0,_=Math.max(d,Math.min(h,-m.x1)),m.add(-_,0).add(0,u),p&&Sg(e,p,_,g,y,1,-1,m);break;case sr:b=n+c,v=f||0,_=Math.max(d,Math.min(h,m.x2)),m.add(0,0).add(_,u),p&&Sg(e,p,_,g,y,1,1,m);break;case Do:b=f||0,v=i+c,_=Math.max(d,Math.min(h,m.y2)),m.add(0,0).add(u,_),p&&Sg(e,p,_,g,0,0,1,m);break;default:b=r.x,v=r.y}return Ss(m.translate(b,v),r),Eu(r,"x",b+o)|Eu(r,"y",v+o)&&(r.bounds=xn,e.dirty(r),r.bounds=m,e.dirty(r)),r.mark.bounds.clear().union(m)}function Sg(e,t,n,i,r,s,o,a){const l=t.bounds;if(t.auto){const u=o*(n+r+i);let c=0,f=0;e.dirty(t),s?c=(t.x||0)-(t.x=u):f=(t.y||0)-(t.y=u),t.mark.bounds.clear().union(l.translate(-c,-f)),e.dirty(t)}a.union(l)}const PC=(e,t)=>Math.floor(Math.min(e,t)),BC=(e,t)=>Math.ceil(Math.max(e,t));function EK(e){var t=e.items,n=t.length,i=0,r,s;const o={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;i1)for(w=0;w0&&(v[w]+=M/2);if(a&&xt(n.center,Oo)&&c!==1)for(w=0;w0&&(x[w]+=T/2);for(w=0;wr&&(e.warn("Grid headers exceed limit: "+r),t=t.slice(0,r)),g+=s,b=0,x=t.length;b=0&&(w=n[v])==null;v-=d);a?($=h==null?w.x:Math.round(w.bounds.x1+h*w.bounds.width()),S=g):($=g,S=h==null?w.y:Math.round(w.bounds.y1+h*w.bounds.height())),_.union(k.bounds.translate($-(k.x||0),S-(k.y||0))),k.x=$,k.y=S,e.dirty(k),m=o(m,_[u])}return m}function qC(e,t,n,i,r,s){if(t){e.dirty(t);var o=n,a=n;i?o=Math.round(r.x1+s*r.width()):a=Math.round(r.y1+s*r.height()),t.bounds.translate(o-(t.x||0),a-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=o,t.y=a,e.dirty(t)}}function FK(e,t){const n=e[t]||{};return(i,r)=>n[i]!=null?n[i]:e[i]!=null?e[i]:r}function DK(e,t){let n=-1/0;return e.forEach(i=>{i.offset!=null&&(n=Math.max(n,i.offset))}),n>-1/0?n:t}function NK(e,t,n,i,r,s,o){const a=FK(n,t),l=DK(e,a("offset",0)),u=a("anchor",I3),c=u===Tn?1:u===z3?.5:0,f={align:q3,bounds:a("bounds",W3),columns:a("direction")==="vertical"?1:e.length,padding:a("margin",8),center:a("center"),nodirty:!0};switch(t){case rr:f.anchor={x:Math.floor(i.x1)-l,column:Tn,y:c*(o||i.height()+2*i.y1),row:u};break;case sr:f.anchor={x:Math.ceil(i.x2)+l,y:c*(o||i.height()+2*i.y1),row:u};break;case $u:f.anchor={y:Math.floor(r.y1)-l,row:Tn,x:c*(s||r.width()+2*r.x1),column:u};break;case Do:f.anchor={y:Math.ceil(r.y2)+l,x:c*(s||r.width()+2*r.x1),column:u};break;case aK:f.anchor={x:l,y:l};break;case lK:f.anchor={x:s-l,y:l,column:Tn};break;case uK:f.anchor={x:l,y:o-l,row:Tn};break;case cK:f.anchor={x:s-l,y:o-l,column:Tn,row:Tn};break}return f}function OK(e,t){var n=t.items[0],i=n.datum,r=n.orient,s=n.bounds,o=n.x,a=n.y,l,u;return n._bounds?n._bounds.clear().union(s):n._bounds=s.clone(),s.clear(),LK(e,n,n.items[0].items[0]),s=RK(n,s),l=2*n.padding,u=2*n.padding,s.empty()||(l=Math.ceil(s.width()+l),u=Math.ceil(s.height()+u)),i.type===mK&&IK(n.items[0].items[0].items[0].items),r!==U3&&(n.x=o=0,n.y=a=0),n.width=l,n.height=u,Ss(s.set(o,a,o+l,a+u),n),n.mark.bounds.clear().union(s),n}function RK(e,t){return e.items.forEach(n=>t.union(n.bounds)),t.x1=e.padding,t.y1=e.padding,t}function LK(e,t,n){var i=t.padding,r=i-n.x,s=i-n.y;if(!t.datum.title)(r||s)&&If(e,n,r,s);else{var o=t.items[1].items[0],a=o.anchor,l=t.titlePadding||0,u=i-o.x,c=i-o.y;switch(o.orient){case rr:r+=Math.ceil(o.bounds.width())+l;break;case sr:case Do:break;default:s+=o.bounds.height()+l}switch((r||s)&&If(e,n,r,s),o.orient){case rr:c+=Cu(t,n,o,a,1,1);break;case sr:u+=Cu(t,n,o,Tn,0,0)+l,c+=Cu(t,n,o,a,1,1);break;case Do:u+=Cu(t,n,o,a,0,0),c+=Cu(t,n,o,Tn,-1,0,1)+l;break;default:u+=Cu(t,n,o,a,0,0)}(u||c)&&If(e,o,u,c),(u=Math.round(o.bounds.x1-i))<0&&(If(e,n,-u,0),If(e,o,-u,0))}}function Cu(e,t,n,i,r,s,o){const a=e.datum.type!=="symbol",l=n.datum.vgrad,u=a&&(s||!l)&&!o?t.items[0]:t,c=u.bounds[r?"y2":"x2"]-e.padding,f=l&&s?c:0,d=l&&s?0:c,h=r<=0?0:p3(n);return Math.round(i===I3?f:i===Tn?d-h:.5*(c-h))}function If(e,t,n,i){t.x+=n,t.y+=i,t.bounds.translate(n,i),t.mark.bounds.translate(n,i),e.dirty(t)}function IK(e){const t=e.reduce((n,i)=>(n[i.column]=Math.max(i.bounds.x2-i.x,n[i.column]||0),n),{});e.forEach(n=>{n.width=t[n.column],n.height=n.bounds.y2-n.y})}function zK(e,t,n,i,r){var s=t.items[0],o=s.frame,a=s.orient,l=s.anchor,u=s.offset,c=s.padding,f=s.items[0].items[0],d=s.items[1]&&s.items[1].items[0],h=a===rr||a===sr?i:n,p=0,g=0,m=0,y=0,b=0,v;if(o!==$g?a===rr?(p=r.y2,h=r.y1):a===sr?(p=r.y1,h=r.y2):(p=r.x1,h=r.x2):a===rr&&(p=i,h=0),v=l===I3?p:l===Tn?h:(p+h)/2,d&&d.text){switch(a){case $u:case Do:b=f.bounds.height()+c;break;case rr:y=f.bounds.width()+c;break;case sr:y=-f.bounds.width()-c;break}xn.clear().union(d.bounds),xn.translate(y-(d.x||0),b-(d.y||0)),Eu(d,"x",y)|Eu(d,"y",b)&&(e.dirty(d),d.bounds.clear().union(xn),d.mark.bounds.clear().union(xn),e.dirty(d)),xn.clear().union(d.bounds)}else xn.clear();switch(xn.union(f.bounds),a){case $u:g=v,m=r.y1-xn.height()-u;break;case rr:g=r.x1-xn.width()-u,m=v;break;case sr:g=r.x2+xn.width()+u,m=v;break;case Do:g=v,m=r.y2+u;break;default:g=s.x,m=s.y}return Eu(s,"x",g)|Eu(s,"y",m)&&(xn.translate(g,m),e.dirty(s),s.bounds.clear().union(xn),t.bounds.clear().union(xn),e.dirty(s)),s.bounds}function WC(e){I.call(this,null,e)}K(WC,I,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach(i=>{e.layout&&AK(n,i,e.layout),BK(n,i,e)}),PK(e.mark.group)?t.reflow():t}});function PK(e){return e&&e.mark.role!=="legend-entry"}function BK(e,t,n){var i=t.items,r=Math.max(0,t.width||0),s=Math.max(0,t.height||0),o=new Ot().set(0,0,r,s),a=o.clone(),l=o.clone(),u=[],c,f,d,h,p,g;for(p=0,g=i.length;p{d=y.orient||sr,d!==U3&&(m[d]||(m[d]=[])).push(y)});for(const y in m){const b=m[y];UC(e,b,NK(b,y,n.legends,a,l,r,s))}u.forEach(y=>{const b=y.bounds;if(b.equals(y._bounds)||(y.bounds=y._bounds,e.dirty(y),y.bounds=b,e.dirty(y)),n.autosize&&(n.autosize.type===CC||n.autosize.type===SC||n.autosize.type===AC))switch(y.orient){case rr:case sr:o.add(b.x1,0).add(b.x2,0);break;case $u:case Do:o.add(0,b.y1).add(0,b.y2)}else o.union(b)})}o.union(a).union(l),c&&o.union(zK(e,c,r,s,o)),t.clip&&o.set(0,0,t.width||0,t.height||0),jK(e,t,o,n)}function jK(e,t,n,i){const r=i.autosize||{},s=r.type;if(e._autosize<1||!s)return;let o=e._width,a=e._height,l=Math.max(0,t.width||0),u=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,t.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-l)),h=Math.max(0,Math.ceil(n.y2-c));if(r.contains===gK){const p=e.padding();o-=p.left+p.right,a-=p.top+p.bottom}s===U3?(u=0,f=0,l=o,c=a):s===CC?(l=Math.max(0,o-u-d),c=Math.max(0,a-f-h)):s===SC?(l=Math.max(0,o-u-d),a=c+f+h):s===AC?(o=l+u+d,c=Math.max(0,a-f-h)):s===yK&&(o=l+u+d,a=c+f+h),e._resizeView(o,a,l,c,[u,f],r.resize)}const UK=Object.freeze(Object.defineProperty({__proto__:null,bound:TC,identifier:H3,mark:FC,overlap:DC,render:zC,viewlayout:WC},Symbol.toStringTag,{value:"Module"}));function HC(e){I.call(this,null,e)}K(HC,I,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,s=e.scale,o=e.count==null?e.values?e.values.length:10:e.count,a=Pb(s,o,e.minstep),l=e.format||B$(n,s,a,e.formatSpecifier,e.formatType,!!e.values),u=e.values?P$(s,e.values,a):Bb(s,a);return r&&(i.rem=r),r=u.map((c,f)=>et({index:f/(u.length-1||1),value:c,label:l(c)})),e.extra&&r.length&&r.push(et({index:-1,extra:{value:r[0].value},label:""})),i.source=r,i.add=r,this.value=r,i}});function GC(e){I.call(this,null,e)}function qK(){return et({})}function WK(e){const t=Gl().test(n=>n.exit);return t.lookup=n=>t.get(e(n)),t}K(GC,I,{transform(e,t){var n=t.dataflow,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.item||qK,s=e.key||ge,o=this.value;return q(i.encode)&&(i.encode=null),o&&(e.modified("key")||t.modified(s))&&U("DataJoin does not support modified key function or fields."),o||(t=t.addAll(),this.value=o=WK(s)),t.visit(t.ADD,a=>{const l=s(a);let u=o.get(l);u?u.exit?(o.empty--,i.add.push(u)):i.mod.push(u):(u=r(a),o.set(l,u),i.add.push(u)),u.datum=a,u.exit=!1}),t.visit(t.MOD,a=>{const l=s(a),u=o.get(l);u&&(u.datum=a,i.mod.push(u))}),t.visit(t.REM,a=>{const l=s(a),u=o.get(l);a===u.datum&&!u.exit&&(i.rem.push(u),u.exit=!0,++o.empty)}),t.changed(t.ADD_MOD)&&i.modifies("datum"),(t.clean()||e.clean&&o.empty>n.cleanThreshold)&&n.runAfter(o.clean),i}});function VC(e){I.call(this,null,e)}K(VC,I,{transform(e,t){var n=t.fork(t.ADD_REM),i=e.mod||!1,r=e.encoders,s=t.encode;if(q(s))if(n.changed()||s.every(f=>r[f]))s=s[0],n.encode=null;else return t.StopPropagation;var o=s==="enter",a=r.update||io,l=r.enter||io,u=r.exit||io,c=(s&&!o?r[s]:a)||io;if(t.changed(t.ADD)&&(t.visit(t.ADD,f=>{l(f,e),a(f,e)}),n.modifies(l.output),n.modifies(a.output),c!==io&&c!==a&&(t.visit(t.ADD,f=>{c(f,e)}),n.modifies(c.output))),t.changed(t.REM)&&u!==io&&(t.visit(t.REM,f=>{u(f,e)}),n.modifies(u.output)),o||c!==io){const f=t.MOD|(e.modified()?t.REFLOW:0);o?(t.visit(f,d=>{const h=l(d,e)||i;(c(d,e)||h)&&n.mod.push(d)}),n.mod.length&&n.modifies(l.output)):t.visit(f,d=>{(c(d,e)||i)&&n.mod.push(d)}),n.mod.length&&n.modifies(c.output)}return n.changed()?n:t.StopPropagation}});function XC(e){I.call(this,[],e)}K(XC,I,{transform(e,t){if(this.value!=null&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,s=e.type||Hp,o=e.scale,a=+e.limit,l=Pb(o,e.count==null?5:e.count,e.minstep),u=!!e.values||s===Hp,c=e.format||W$(n,o,l,s,e.formatSpecifier,e.formatType,u),f=e.values||q$(o,l),d,h,p,g,m;return r&&(i.rem=r),s===Hp?(a&&f.length>a?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),r=f.slice(0,a-1),m=!0):r=f,Me(p=e.size)?(!e.values&&o(r[0])===0&&(r=r.slice(1)),g=r.reduce((y,b)=>Math.max(y,p(b,e)),0)):p=pn(g=p||8),r=r.map((y,b)=>et({index:b,label:c(y,b,r),value:y,offset:g,size:p(y,e)})),m&&(m=f[r.length],r.push(et({index:r.length,label:`…${f.length-r.length} entries`,value:m,offset:g,size:p(m,e)})))):s===mX?(d=o.domain(),h=R$(o,d[0],Ue(d)),f.length<3&&!e.values&&d[0]!==Ue(d)&&(f=[d[0],Ue(d)]),r=f.map((y,b)=>et({index:b,label:c(y,b,f),value:y,perc:h(y)}))):(p=f.length-1,h=SX(o),r=f.map((y,b)=>et({index:b,label:c(y,b,f),value:y,perc:b?h(y):0,perc2:b===p?1:h(f[b+1])}))),i.source=r,i.add=r,this.value=r,i}});const HK=e=>e.source.x,GK=e=>e.source.y,VK=e=>e.target.x,XK=e=>e.target.y;function G3(e){I.call(this,{},e)}G3.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]},K(G3,I,{transform(e,t){var n=e.sourceX||HK,i=e.sourceY||GK,r=e.targetX||VK,s=e.targetY||XK,o=e.as||"path",a=e.orient||"vertical",l=e.shape||"line",u=JC.get(l+"-"+a)||JC.get(l);return u||U("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,c=>{c[o]=u(n(c),i(c),r(c),s(c))}),t.reflow(e.modified()).modifies(o)}});const YC=(e,t,n,i)=>"M"+e+","+t+"L"+n+","+i,YK=(e,t,n,i)=>YC(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),ZC=(e,t,n,i)=>{var r=n-e,s=i-t,o=Math.hypot(r,s)/2,a=180*Math.atan2(s,r)/Math.PI;return"M"+e+","+t+"A"+o+","+o+" "+a+" 0 1 "+n+","+i},ZK=(e,t,n,i)=>ZC(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),KC=(e,t,n,i)=>{const r=n-e,s=i-t,o=.2*(r+s),a=.2*(s-r);return"M"+e+","+t+"C"+(e+o)+","+(t+a)+" "+(n+a)+","+(i-o)+" "+n+","+i},JC=Gl({line:YC,"line-radial":YK,arc:ZC,"arc-radial":ZK,curve:KC,"curve-radial":(e,t,n,i)=>KC(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),"orthogonal-horizontal":(e,t,n,i)=>"M"+e+","+t+"V"+i+"H"+n,"orthogonal-vertical":(e,t,n,i)=>"M"+e+","+t+"H"+n+"V"+i,"orthogonal-radial":(e,t,n,i)=>{const r=Math.cos(e),s=Math.sin(e),o=Math.cos(n),a=Math.sin(n),l=Math.abs(n-e)>Math.PI?n<=e:n>e;return"M"+t*r+","+t*s+"A"+t+","+t+" 0 0,"+(l?1:0)+" "+t*o+","+t*a+"L"+i*o+","+i*a},"diagonal-horizontal":(e,t,n,i)=>{const r=(e+n)/2;return"M"+e+","+t+"C"+r+","+t+" "+r+","+i+" "+n+","+i},"diagonal-vertical":(e,t,n,i)=>{const r=(t+i)/2;return"M"+e+","+t+"C"+e+","+r+" "+n+","+r+" "+n+","+i},"diagonal-radial":(e,t,n,i)=>{const r=Math.cos(e),s=Math.sin(e),o=Math.cos(n),a=Math.sin(n),l=(t+i)/2;return"M"+t*r+","+t*s+"C"+l*r+","+l*s+" "+l*o+","+l*a+" "+i*o+","+i*a}});function V3(e){I.call(this,null,e)}V3.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]},K(V3,I,{transform(e,t){var n=e.as||["startAngle","endAngle"],i=n[0],r=n[1],s=e.field||ql,o=e.startAngle||0,a=e.endAngle!=null?e.endAngle:2*Math.PI,l=t.source,u=l.map(s),c=u.length,f=o,d=(a-o)/T4(u),h=hi(c),p,g,m;for(e.sort&&h.sort((y,b)=>u[y]-u[b]),p=0;p-1)return i;var r=t.domain,s=e.type,o=t.zero||t.zero===void 0&&JK(e),a,l;if(!r)return 0;if(QC(s)&&t.padding&&r[0]!==Ue(r)&&(r=rJ(s,r,t.range,t.padding,t.exponent,t.constant)),(o||t.domainMin!=null||t.domainMax!=null||t.domainMid!=null)&&(a=(r=r.slice()).length-1||1,o&&(r[0]>0&&(r[0]=0),r[a]<0&&(r[a]=0)),t.domainMin!=null&&(r[0]=t.domainMin),t.domainMax!=null&&(r[a]=t.domainMax),t.domainMid!=null)){l=t.domainMid;const u=l>r[a]?a+1:lr+(s<0?-1:s>0?1:0),0));i!==t.length&&n.warn("Log scale domain includes zero: "+J(t))}return t}function sJ(e,t,n){let i=t.bins;if(i&&!q(i)){const r=e.domain(),s=r[0],o=Ue(r),a=i.step;let l=i.start==null?s:i.start,u=i.stop==null?o:i.stop;a||U("Scale bins parameter missing step property."),lo&&(u=a*Math.floor(o/a)),i=hi(l,u+a/2,a)}return i?e.bins=i:e.bins&&delete e.bins,e.type===Db&&(i?!t.domain&&!t.domainRaw&&(e.domain(i),n=i.length):e.bins=e.domain()),n}function oJ(e,t,n){var i=e.type,r=t.round||!1,s=t.range;if(t.rangeStep!=null)s=aJ(i,t,n);else if(t.scheme&&(s=lJ(i,t,n),Me(s))){if(e.interpolator)return e.interpolator(s);U(`Scale type ${i} does not support interpolating color schemes.`)}if(s&&F$(i))return e.interpolator(Wp(X3(s,t.reverse),t.interpolate,t.interpolateGamma));s&&t.interpolate&&e.interpolate?e.interpolate(Ib(t.interpolate,t.interpolateGamma)):Me(e.round)?e.round(r):Me(e.rangeRound)&&e.interpolate(r?hf:vo),s&&e.range(X3(s,t.reverse))}function aJ(e,t,n){e!==$$&&e!==Fb&&U("Only band and point scales support rangeStep.");var i=(t.paddingOuter!=null?t.paddingOuter:t.padding)||0,r=e===Fb?1:(t.paddingInner!=null?t.paddingInner:t.padding)||0;return[0,t.rangeStep*Tb(n,r,i)]}function lJ(e,t,n){var i=t.schemeExtent,r,s;return q(t.scheme)?s=Wp(t.scheme,t.interpolate,t.interpolateGamma):(r=t.scheme.toLowerCase(),s=zb(r),s||U(`Unrecognized scheme name: ${t.scheme}`)),n=e===Up?n+1:e===Db?n-1:e===mu||e===jp?+t.schemeCount||KK:n,F$(e)?nS(s,i,t.reverse):Me(s)?O$(nS(s,i),n):e===Mb?s:s.slice(0,n)}function nS(e,t,n){return Me(e)&&(t||n)?N$(e,X3(t||[0,1],n)):e}function X3(e,t){return t?e.slice().reverse():e}function iS(e){I.call(this,null,e)}K(iS,I,{transform(e,t){const n=e.modified("sort")||t.changed(t.ADD)||t.modified(e.sort.fields)||t.modified("datum");return n&&t.source.sort(xa(e.sort)),this.modified(n),t}});const rS="zero",sS="center",oS="normalize",aS=["y0","y1"];function Y3(e){I.call(this,null,e)}Y3.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:rS,values:[rS,sS,oS]},{name:"as",type:"string",array:!0,length:2,default:aS}]},K(Y3,I,{transform(e,t){var n=e.as||aS,i=n[0],r=n[1],s=xa(e.sort),o=e.field||ql,a=e.offset===sS?uJ:e.offset===oS?cJ:fJ,l,u,c,f;for(l=dJ(t.source,e.groupby,s,o),u=0,c=l.length,f=l.max;ug(c),o,a,l,u,c,f,d,h,p;if(t==null)r.push(e.slice());else for(o={},a=0,l=e.length;ap&&(p=h),n&&d.sort(n)}return r.max=p,r}const hJ=Object.freeze(Object.defineProperty({__proto__:null,axisticks:HC,datajoin:GC,encode:VC,legendentries:XC,linkpath:G3,pie:V3,scale:eS,sortitems:iS,stack:Y3},Symbol.toStringTag,{value:"Module"}));var _e=1e-6,Tg=1e-12,Re=Math.PI,Ct=Re/2,Mg=Re/4,Mn=Re*2,Mt=180/Re,Ne=Re/180,qe=Math.abs,Su=Math.atan,Li=Math.atan2,we=Math.cos,Fg=Math.ceil,lS=Math.exp,Z3=Math.hypot,Dg=Math.log,K3=Math.pow,me=Math.sin,Ii=Math.sign||function(e){return e>0?1:e<0?-1:0},Fn=Math.sqrt,J3=Math.tan;function uS(e){return e>1?0:e<-1?Re:Math.acos(e)}function Qn(e){return e>1?Ct:e<-1?-Ct:Math.asin(e)}function sn(){}function Ng(e,t){e&&fS.hasOwnProperty(e.type)&&fS[e.type](e,t)}var cS={Feature:function(e,t){Ng(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,i=-1,r=n.length;++i=0?1:-1,r=i*n,s=we(t),o=me(t),a=nv*o,l=tv*s+a*we(r),u=a*i*me(r);Og.add(Li(u,l)),ev=e,tv=s,nv=o}function yJ(e){return Rg=new Sn,Ts(e,Vr),Rg*2}function Lg(e){return[Li(e[1],e[0]),Qn(e[2])]}function Pa(e){var t=e[0],n=e[1],i=we(n);return[i*we(t),i*me(t),me(n)]}function Ig(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Au(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function iv(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function zg(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Pg(e){var t=Fn(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var kt,ei,St,vi,Ba,mS,yS,Tu,zf,Ro,Ms,Fs={point:rv,lineStart:vS,lineEnd:xS,polygonStart:function(){Fs.point=_S,Fs.lineStart=bJ,Fs.lineEnd=vJ,zf=new Sn,Vr.polygonStart()},polygonEnd:function(){Vr.polygonEnd(),Fs.point=rv,Fs.lineStart=vS,Fs.lineEnd=xS,Og<0?(kt=-(St=180),ei=-(vi=90)):zf>_e?vi=90:zf<-_e&&(ei=-90),Ms[0]=kt,Ms[1]=St},sphere:function(){kt=-(St=180),ei=-(vi=90)}};function rv(e,t){Ro.push(Ms=[kt=e,St=e]),tvi&&(vi=t)}function bS(e,t){var n=Pa([e*Ne,t*Ne]);if(Tu){var i=Au(Tu,n),r=[i[1],-i[0],0],s=Au(r,i);Pg(s),s=Lg(s);var o=e-Ba,a=o>0?1:-1,l=s[0]*Mt*a,u,c=qe(o)>180;c^(a*Bavi&&(vi=u)):(l=(l+360)%360-180,c^(a*Bavi&&(vi=t))),c?exi(kt,St)&&(St=e):xi(e,St)>xi(kt,St)&&(kt=e):St>=kt?(eSt&&(St=e)):e>Ba?xi(kt,e)>xi(kt,St)&&(St=e):xi(e,St)>xi(kt,St)&&(kt=e)}else Ro.push(Ms=[kt=e,St=e]);tvi&&(vi=t),Tu=n,Ba=e}function vS(){Fs.point=bS}function xS(){Ms[0]=kt,Ms[1]=St,Fs.point=rv,Tu=null}function _S(e,t){if(Tu){var n=e-Ba;zf.add(qe(n)>180?n+(n>0?360:-360):n)}else mS=e,yS=t;Vr.point(e,t),bS(e,t)}function bJ(){Vr.lineStart()}function vJ(){_S(mS,yS),Vr.lineEnd(),qe(zf)>_e&&(kt=-(St=180)),Ms[0]=kt,Ms[1]=St,Tu=null}function xi(e,t){return(t-=e)<0?t+360:t}function xJ(e,t){return e[0]-t[0]}function wS(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:txi(i[0],i[1])&&(i[1]=r[1]),xi(r[0],i[1])>xi(i[0],i[1])&&(i[0]=r[0])):s.push(i=r);for(o=-1/0,n=s.length-1,t=0,i=s[n];t<=n;i=r,++t)r=s[t],(a=xi(i[1],r[0]))>o&&(o=a,kt=r[0],St=i[1])}return Ro=Ms=null,kt===1/0||ei===1/0?[[NaN,NaN],[NaN,NaN]]:[[kt,ei],[St,vi]]}var Pf,Bg,jg,Ug,qg,Wg,Hg,Gg,sv,ov,av,kS,$S,Dn,Nn,On,or={sphere:sn,point:lv,lineStart:ES,lineEnd:CS,polygonStart:function(){or.lineStart=$J,or.lineEnd=EJ},polygonEnd:function(){or.lineStart=ES,or.lineEnd=CS}};function lv(e,t){e*=Ne,t*=Ne;var n=we(t);Bf(n*we(e),n*me(e),me(t))}function Bf(e,t,n){++Pf,jg+=(e-jg)/Pf,Ug+=(t-Ug)/Pf,qg+=(n-qg)/Pf}function ES(){or.point=wJ}function wJ(e,t){e*=Ne,t*=Ne;var n=we(t);Dn=n*we(e),Nn=n*me(e),On=me(t),or.point=kJ,Bf(Dn,Nn,On)}function kJ(e,t){e*=Ne,t*=Ne;var n=we(t),i=n*we(e),r=n*me(e),s=me(t),o=Li(Fn((o=Nn*s-On*r)*o+(o=On*i-Dn*s)*o+(o=Dn*r-Nn*i)*o),Dn*i+Nn*r+On*s);Bg+=o,Wg+=o*(Dn+(Dn=i)),Hg+=o*(Nn+(Nn=r)),Gg+=o*(On+(On=s)),Bf(Dn,Nn,On)}function CS(){or.point=lv}function $J(){or.point=CJ}function EJ(){SS(kS,$S),or.point=lv}function CJ(e,t){kS=e,$S=t,e*=Ne,t*=Ne,or.point=SS;var n=we(t);Dn=n*we(e),Nn=n*me(e),On=me(t),Bf(Dn,Nn,On)}function SS(e,t){e*=Ne,t*=Ne;var n=we(t),i=n*we(e),r=n*me(e),s=me(t),o=Nn*s-On*r,a=On*i-Dn*s,l=Dn*r-Nn*i,u=Z3(o,a,l),c=Qn(u),f=u&&-c/u;sv.add(f*o),ov.add(f*a),av.add(f*l),Bg+=c,Wg+=c*(Dn+(Dn=i)),Hg+=c*(Nn+(Nn=r)),Gg+=c*(On+(On=s)),Bf(Dn,Nn,On)}function SJ(e){Pf=Bg=jg=Ug=qg=Wg=Hg=Gg=0,sv=new Sn,ov=new Sn,av=new Sn,Ts(e,or);var t=+sv,n=+ov,i=+av,r=Z3(t,n,i);return rRe&&(e-=Math.round(e/Mn)*Mn),[e,t]}cv.invert=cv;function AS(e,t,n){return(e%=Mn)?t||n?uv(MS(e),FS(t,n)):MS(e):t||n?FS(t,n):cv}function TS(e){return function(t,n){return t+=e,qe(t)>Re&&(t-=Math.round(t/Mn)*Mn),[t,n]}}function MS(e){var t=TS(e);return t.invert=TS(-e),t}function FS(e,t){var n=we(e),i=me(e),r=we(t),s=me(t);function o(a,l){var u=we(l),c=we(a)*u,f=me(a)*u,d=me(l),h=d*n+c*i;return[Li(f*r-h*s,c*n-d*i),Qn(h*r+f*s)]}return o.invert=function(a,l){var u=we(l),c=we(a)*u,f=me(a)*u,d=me(l),h=d*r-f*s;return[Li(f*r+d*s,c*n+h*i),Qn(h*n-c*i)]},o}function AJ(e){e=AS(e[0]*Ne,e[1]*Ne,e.length>2?e[2]*Ne:0);function t(n){return n=e(n[0]*Ne,n[1]*Ne),n[0]*=Mt,n[1]*=Mt,n}return t.invert=function(n){return n=e.invert(n[0]*Ne,n[1]*Ne),n[0]*=Mt,n[1]*=Mt,n},t}function TJ(e,t,n,i,r,s){if(n){var o=we(t),a=me(t),l=i*n;r==null?(r=t+i*Mn,s=t-l/2):(r=DS(o,r),s=DS(o,s),(i>0?rs)&&(r+=i*Mn));for(var u,c=r;i>0?c>s:c1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Vg(e,t){return qe(e[0]-t[0])<_e&&qe(e[1]-t[1])<_e}function Xg(e,t,n,i){this.x=e,this.z=t,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function OS(e,t,n,i,r){var s=[],o=[],a,l;if(e.forEach(function(p){if(!((g=p.length-1)<=0)){var g,m=p[0],y=p[g],b;if(Vg(m,y)){if(!m[2]&&!y[2]){for(r.lineStart(),a=0;a=0;--a)r.point((f=c[a])[0],f[1]);else i(d.x,d.p.x,-1,r);d=d.p}d=d.o,c=d.z,h=!h}while(!d.v);r.lineEnd()}}}function RS(e){if(t=e.length){for(var t,n=0,i=e[0],r;++n=0?1:-1,E=S*$,A=E>Re,R=m*k;if(l.add(Li(R*S*me(E),y*w+R*we(E))),o+=A?$+S*Mn:$,A^p>=n^x>=n){var C=Au(Pa(h),Pa(v));Pg(C);var M=Au(s,C);Pg(M);var T=(A^$>=0?-1:1)*Qn(M[2]);(i>T||i===T&&(C[0]||C[1]))&&(a+=A^$>=0?1:-1)}}return(o<-_e||o<_e&&l<-Tg)^a&1}function LS(e,t,n,i){return function(r){var s=t(r),o=NS(),a=t(o),l=!1,u,c,f,d={point:h,lineStart:g,lineEnd:m,polygonStart:function(){d.point=y,d.lineStart=b,d.lineEnd=v,c=[],u=[]},polygonEnd:function(){d.point=h,d.lineStart=g,d.lineEnd=m,c=A4(c);var x=MJ(u,i);c.length?(l||(r.polygonStart(),l=!0),OS(c,DJ,x,n,r)):x&&(l||(r.polygonStart(),l=!0),r.lineStart(),n(null,null,1,r),r.lineEnd()),l&&(r.polygonEnd(),l=!1),c=u=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}};function h(x,_){e(x,_)&&r.point(x,_)}function p(x,_){s.point(x,_)}function g(){d.point=p,s.lineStart()}function m(){d.point=h,s.lineEnd()}function y(x,_){f.push([x,_]),a.point(x,_)}function b(){a.lineStart(),f=[]}function v(){y(f[0][0],f[0][1]),a.lineEnd();var x=a.clean(),_=o.result(),k,w=_.length,$,S,E;if(f.pop(),u.push(f),f=null,!!w){if(x&1){if(S=_[0],($=S.length-1)>0){for(l||(r.polygonStart(),l=!0),r.lineStart(),k=0;k<$;++k)r.point((E=S[k])[0],E[1]);r.lineEnd()}return}w>1&&x&2&&_.push(_.pop().concat(_.shift())),c.push(_.filter(FJ))}}return d}}function FJ(e){return e.length>1}function DJ(e,t){return((e=e.x)[0]<0?e[1]-Ct-_e:Ct-e[1])-((t=t.x)[0]<0?t[1]-Ct-_e:Ct-t[1])}const IS=LS(function(){return!0},NJ,RJ,[-Re,-Ct]);function NJ(e){var t=NaN,n=NaN,i=NaN,r;return{lineStart:function(){e.lineStart(),r=1},point:function(s,o){var a=s>0?Re:-Re,l=qe(s-t);qe(l-Re)<_e?(e.point(t,n=(n+o)/2>0?Ct:-Ct),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(s,n),r=0):i!==a&&l>=Re&&(qe(t-i)<_e&&(t-=i*_e),qe(s-a)<_e&&(s-=a*_e),n=OJ(t,n,s,o),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(a,n),r=0),e.point(t=s,n=o),i=a},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-r}}}function OJ(e,t,n,i){var r,s,o=me(e-n);return qe(o)>_e?Su((me(t)*(s=we(i))*me(n)-me(i)*(r=we(t))*me(e))/(r*s*o)):(t+i)/2}function RJ(e,t,n,i){var r;if(e==null)r=n*Ct,i.point(-Re,r),i.point(0,r),i.point(Re,r),i.point(Re,0),i.point(Re,-r),i.point(0,-r),i.point(-Re,-r),i.point(-Re,0),i.point(-Re,r);else if(qe(e[0]-t[0])>_e){var s=e[0]0,r=qe(t)>_e;function s(c,f,d,h){TJ(h,e,n,d,c,f)}function o(c,f){return we(c)*we(f)>t}function a(c){var f,d,h,p,g;return{lineStart:function(){p=h=!1,g=1},point:function(m,y){var b=[m,y],v,x=o(m,y),_=i?x?0:u(m,y):x?u(m+(m<0?Re:-Re),y):0;if(!f&&(p=h=x)&&c.lineStart(),x!==h&&(v=l(f,b),(!v||Vg(f,v)||Vg(b,v))&&(b[2]=1)),x!==h)g=0,x?(c.lineStart(),v=l(b,f),c.point(v[0],v[1])):(v=l(f,b),c.point(v[0],v[1],2),c.lineEnd()),f=v;else if(r&&f&&i^x){var k;!(_&d)&&(k=l(b,f,!0))&&(g=0,i?(c.lineStart(),c.point(k[0][0],k[0][1]),c.point(k[1][0],k[1][1]),c.lineEnd()):(c.point(k[1][0],k[1][1]),c.lineEnd(),c.lineStart(),c.point(k[0][0],k[0][1],3)))}x&&(!f||!Vg(f,b))&&c.point(b[0],b[1]),f=b,h=x,d=_},lineEnd:function(){h&&c.lineEnd(),f=null},clean:function(){return g|(p&&h)<<1}}}function l(c,f,d){var h=Pa(c),p=Pa(f),g=[1,0,0],m=Au(h,p),y=Ig(m,m),b=m[0],v=y-b*b;if(!v)return!d&&c;var x=t*y/v,_=-t*b/v,k=Au(g,m),w=zg(g,x),$=zg(m,_);iv(w,$);var S=k,E=Ig(w,S),A=Ig(S,S),R=E*E-A*(Ig(w,w)-1);if(!(R<0)){var C=Fn(R),M=zg(S,(-E-C)/A);if(iv(M,w),M=Lg(M),!d)return M;var T=c[0],O=f[0],P=c[1],j=f[1],W;O0^M[1]<(qe(M[0]-T)<_e?P:j):P<=M[1]&&M[1]<=j:ne>Re^(T<=M[0]&&M[0]<=O)){var Ie=zg(S,(-E+C)/A);return iv(Ie,w),[M,Lg(Ie)]}}}function u(c,f){var d=i?e:Re-e,h=0;return c<-d?h|=1:c>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return LS(o,a,s,i?[0,-e]:[-Re,e-Re])}function IJ(e,t,n,i,r,s){var o=e[0],a=e[1],l=t[0],u=t[1],c=0,f=1,d=l-o,h=u-a,p;if(p=n-o,!(!d&&p>0)){if(p/=d,d<0){if(p0){if(p>f)return;p>c&&(c=p)}if(p=r-o,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>c&&(c=p)}else if(d>0){if(p0)){if(p/=h,h<0){if(p0){if(p>f)return;p>c&&(c=p)}if(p=s-a,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>c&&(c=p)}else if(h>0){if(p0&&(e[0]=o+c*d,e[1]=a+c*h),f<1&&(t[0]=o+f*d,t[1]=a+f*h),!0}}}}}var jf=1e9,Yg=-jf;function zS(e,t,n,i){function r(u,c){return e<=u&&u<=n&&t<=c&&c<=i}function s(u,c,f,d){var h=0,p=0;if(u==null||(h=o(u,f))!==(p=o(c,f))||l(u,c)<0^f>0)do d.point(h===0||h===3?e:n,h>1?i:t);while((h=(h+f+4)%4)!==p);else d.point(c[0],c[1])}function o(u,c){return qe(u[0]-e)<_e?c>0?0:3:qe(u[0]-n)<_e?c>0?2:1:qe(u[1]-t)<_e?c>0?1:0:c>0?3:2}function a(u,c){return l(u.x,c.x)}function l(u,c){var f=o(u,1),d=o(c,1);return f!==d?f-d:f===0?c[1]-u[1]:f===1?u[0]-c[0]:f===2?u[1]-c[1]:c[0]-u[0]}return function(u){var c=u,f=NS(),d,h,p,g,m,y,b,v,x,_,k,w={point:$,lineStart:R,lineEnd:C,polygonStart:E,polygonEnd:A};function $(T,O){r(T,O)&&c.point(T,O)}function S(){for(var T=0,O=0,P=h.length;Oi&&(Le-ke)*(i-Ie)>(We-Ie)*(e-ke)&&++T:We<=i&&(Le-ke)*(i-Ie)<(We-Ie)*(e-ke)&&--T;return T}function E(){c=f,d=[],h=[],k=!0}function A(){var T=S(),O=k&&T,P=(d=A4(d)).length;(O||P)&&(u.polygonStart(),O&&(u.lineStart(),s(null,null,1,u),u.lineEnd()),P&&OS(d,a,T,s,u),u.polygonEnd()),c=u,d=h=p=null}function R(){w.point=M,h&&h.push(p=[]),_=!0,x=!1,b=v=NaN}function C(){d&&(M(g,m),y&&x&&f.rejoin(),d.push(f.result())),w.point=$,x&&c.lineEnd()}function M(T,O){var P=r(T,O);if(h&&p.push([T,O]),_)g=T,m=O,y=P,_=!1,P&&(c.lineStart(),c.point(T,O));else if(P&&x)c.point(T,O);else{var j=[b=Math.max(Yg,Math.min(jf,b)),v=Math.max(Yg,Math.min(jf,v))],W=[T=Math.max(Yg,Math.min(jf,T)),O=Math.max(Yg,Math.min(jf,O))];IJ(j,W,e,t,n,i)?(x||(c.lineStart(),c.point(j[0],j[1])),c.point(W[0],W[1]),P||c.lineEnd(),k=!1):P&&(c.lineStart(),c.point(T,O),k=!1)}b=T,v=O,x=P}return w}}function PS(e,t,n){var i=hi(e,t-_e,n).concat(t);return function(r){return i.map(function(s){return[r,s]})}}function BS(e,t,n){var i=hi(e,t-_e,n).concat(t);return function(r){return i.map(function(s){return[s,r]})}}function zJ(){var e,t,n,i,r,s,o,a,l=10,u=l,c=90,f=360,d,h,p,g,m=2.5;function y(){return{type:"MultiLineString",coordinates:b()}}function b(){return hi(Fg(i/c)*c,n,c).map(p).concat(hi(Fg(a/f)*f,o,f).map(g)).concat(hi(Fg(t/l)*l,e,l).filter(function(v){return qe(v%c)>_e}).map(d)).concat(hi(Fg(s/u)*u,r,u).filter(function(v){return qe(v%f)>_e}).map(h))}return y.lines=function(){return b().map(function(v){return{type:"LineString",coordinates:v}})},y.outline=function(){return{type:"Polygon",coordinates:[p(i).concat(g(o).slice(1),p(n).reverse().slice(1),g(a).reverse().slice(1))]}},y.extent=function(v){return arguments.length?y.extentMajor(v).extentMinor(v):y.extentMinor()},y.extentMajor=function(v){return arguments.length?(i=+v[0][0],n=+v[1][0],a=+v[0][1],o=+v[1][1],i>n&&(v=i,i=n,n=v),a>o&&(v=a,a=o,o=v),y.precision(m)):[[i,a],[n,o]]},y.extentMinor=function(v){return arguments.length?(t=+v[0][0],e=+v[1][0],s=+v[0][1],r=+v[1][1],t>e&&(v=t,t=e,e=v),s>r&&(v=s,s=r,r=v),y.precision(m)):[[t,s],[e,r]]},y.step=function(v){return arguments.length?y.stepMajor(v).stepMinor(v):y.stepMinor()},y.stepMajor=function(v){return arguments.length?(c=+v[0],f=+v[1],y):[c,f]},y.stepMinor=function(v){return arguments.length?(l=+v[0],u=+v[1],y):[l,u]},y.precision=function(v){return arguments.length?(m=+v,d=PS(s,r,90),h=BS(t,e,m),p=PS(a,o,90),g=BS(i,n,m),y):m},y.extentMajor([[-180,-90+_e],[180,90-_e]]).extentMinor([[-180,-80-_e],[180,80+_e]])}const Uf=e=>e;var dv=new Sn,hv=new Sn,jS,US,pv,gv,Lo={point:sn,lineStart:sn,lineEnd:sn,polygonStart:function(){Lo.lineStart=PJ,Lo.lineEnd=jJ},polygonEnd:function(){Lo.lineStart=Lo.lineEnd=Lo.point=sn,dv.add(qe(hv)),hv=new Sn},result:function(){var e=dv/2;return dv=new Sn,e}};function PJ(){Lo.point=BJ}function BJ(e,t){Lo.point=qS,jS=pv=e,US=gv=t}function qS(e,t){hv.add(gv*e-pv*t),pv=e,gv=t}function jJ(){qS(jS,US)}const WS=Lo;var Mu=1/0,Zg=Mu,qf=-Mu,Kg=qf,UJ={point:qJ,lineStart:sn,lineEnd:sn,polygonStart:sn,polygonEnd:sn,result:function(){var e=[[Mu,Zg],[qf,Kg]];return qf=Kg=-(Zg=Mu=1/0),e}};function qJ(e,t){eqf&&(qf=e),tKg&&(Kg=t)}const Jg=UJ;var mv=0,yv=0,Wf=0,Qg=0,e0=0,Fu=0,bv=0,vv=0,Hf=0,HS,GS,Xr,Yr,ar={point:ja,lineStart:VS,lineEnd:XS,polygonStart:function(){ar.lineStart=GJ,ar.lineEnd=VJ},polygonEnd:function(){ar.point=ja,ar.lineStart=VS,ar.lineEnd=XS},result:function(){var e=Hf?[bv/Hf,vv/Hf]:Fu?[Qg/Fu,e0/Fu]:Wf?[mv/Wf,yv/Wf]:[NaN,NaN];return mv=yv=Wf=Qg=e0=Fu=bv=vv=Hf=0,e}};function ja(e,t){mv+=e,yv+=t,++Wf}function VS(){ar.point=WJ}function WJ(e,t){ar.point=HJ,ja(Xr=e,Yr=t)}function HJ(e,t){var n=e-Xr,i=t-Yr,r=Fn(n*n+i*i);Qg+=r*(Xr+e)/2,e0+=r*(Yr+t)/2,Fu+=r,ja(Xr=e,Yr=t)}function XS(){ar.point=ja}function GJ(){ar.point=XJ}function VJ(){YS(HS,GS)}function XJ(e,t){ar.point=YS,ja(HS=Xr=e,GS=Yr=t)}function YS(e,t){var n=e-Xr,i=t-Yr,r=Fn(n*n+i*i);Qg+=r*(Xr+e)/2,e0+=r*(Yr+t)/2,Fu+=r,r=Yr*e-Xr*t,bv+=r*(Xr+e),vv+=r*(Yr+t),Hf+=r*3,ja(Xr=e,Yr=t)}const ZS=ar;function KS(e){this._context=e}KS.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,Mn);break}}},result:sn};var xv=new Sn,_v,JS,QS,Gf,Vf,t0={point:sn,lineStart:function(){t0.point=YJ},lineEnd:function(){_v&&eA(JS,QS),t0.point=sn},polygonStart:function(){_v=!0},polygonEnd:function(){_v=null},result:function(){var e=+xv;return xv=new Sn,e}};function YJ(e,t){t0.point=eA,JS=Gf=e,QS=Vf=t}function eA(e,t){Gf-=e,Vf-=t,xv.add(Fn(Gf*Gf+Vf*Vf)),Gf=e,Vf=t}const tA=t0;let nA,n0,iA,rA;class sA{constructor(t){this._append=t==null?oA:ZJ(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==iA||this._append!==n0){const i=this._radius,r=this._;this._="",this._append`m0,${i}a${i},${i} 0 1,1 0,${-2*i}a${i},${i} 0 1,1 0,${2*i}z`,iA=i,n0=this._append,rA=this._,this._=r}this._+=rA;break}}}result(){const t=this._;return this._="",t.length?t:null}}function oA(e){let t=1;this._+=e[0];for(const n=e.length;t=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return oA;if(t!==nA){const n=10**t;nA=t,n0=function(r){let s=1;this._+=r[0];for(const o=r.length;s=0))throw new RangeError(`invalid digits: ${a}`);n=l}return t===null&&(s=new sA(n)),o},o.projection(e).digits(n).context(t)}function i0(e){return function(t){var n=new wv;for(var i in e)n[i]=e[i];return n.stream=t,n}}function wv(){}wv.prototype={constructor:wv,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function kv(e,t,n){var i=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),i!=null&&e.clipExtent(null),Ts(n,e.stream(Jg)),t(Jg.result()),i!=null&&e.clipExtent(i),e}function r0(e,t,n){return kv(e,function(i){var r=t[1][0]-t[0][0],s=t[1][1]-t[0][1],o=Math.min(r/(i[1][0]-i[0][0]),s/(i[1][1]-i[0][1])),a=+t[0][0]+(r-o*(i[1][0]+i[0][0]))/2,l=+t[0][1]+(s-o*(i[1][1]+i[0][1]))/2;e.scale(150*o).translate([a,l])},n)}function $v(e,t,n){return r0(e,[[0,0],t],n)}function Ev(e,t,n){return kv(e,function(i){var r=+t,s=r/(i[1][0]-i[0][0]),o=(r-s*(i[1][0]+i[0][0]))/2,a=-s*i[0][1];e.scale(150*s).translate([o,a])},n)}function Cv(e,t,n){return kv(e,function(i){var r=+t,s=r/(i[1][1]-i[0][1]),o=-s*i[0][0],a=(r-s*(i[1][1]+i[0][1]))/2;e.scale(150*s).translate([o,a])},n)}var lA=16,KJ=we(30*Ne);function uA(e,t){return+t?QJ(e,t):JJ(e)}function JJ(e){return i0({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function QJ(e,t){function n(i,r,s,o,a,l,u,c,f,d,h,p,g,m){var y=u-i,b=c-r,v=y*y+b*b;if(v>4*t&&g--){var x=o+d,_=a+h,k=l+p,w=Fn(x*x+_*_+k*k),$=Qn(k/=w),S=qe(qe(k)-1)<_e||qe(s-f)<_e?(s+f)/2:Li(_,x),E=e(S,$),A=E[0],R=E[1],C=A-i,M=R-r,T=b*C-y*M;(T*T/v>t||qe((y*C+b*M)/v-.5)>.3||o*d+a*h+l*p2?T[2]%360*Ne:0,C()):[a*Mt,l*Mt,u*Mt]},A.angle=function(T){return arguments.length?(f=T%360*Ne,C()):f*Mt},A.reflectX=function(T){return arguments.length?(d=T?-1:1,C()):d<0},A.reflectY=function(T){return arguments.length?(h=T?-1:1,C()):h<0},A.precision=function(T){return arguments.length?(k=uA(w,_=T*T),M()):Fn(_)},A.fitExtent=function(T,O){return r0(A,T,O)},A.fitSize=function(T,O){return $v(A,T,O)},A.fitWidth=function(T,O){return Ev(A,T,O)},A.fitHeight=function(T,O){return Cv(A,T,O)};function C(){var T=cA(n,0,0,d,h,f).apply(null,t(s,o)),O=cA(n,i-T[0],r-T[1],d,h,f);return c=AS(a,l,u),w=uv(t,O),$=uv(c,w),k=uA(w,_),M()}function M(){return S=E=null,A}return function(){return t=e.apply(this,arguments),A.invert=t.invert&&R,C()}}function Sv(e){var t=0,n=Re/3,i=fA(e),r=i(t,n);return r.parallels=function(s){return arguments.length?i(t=s[0]*Ne,n=s[1]*Ne):[t*Mt,n*Mt]},r}function iQ(e){var t=we(e);function n(i,r){return[i*t,me(r)/t]}return n.invert=function(i,r){return[i/t,Qn(r*t)]},n}function rQ(e,t){var n=me(e),i=(n+me(t))/2;if(qe(i)<_e)return iQ(e);var r=1+n*(2*i-n),s=Fn(r)/i;function o(a,l){var u=Fn(r-2*i*me(l))/i;return[u*me(a*=i),s-u*we(a)]}return o.invert=function(a,l){var u=s-l,c=Li(a,qe(u))*Ii(u);return u*i<0&&(c-=Re*Ii(a)*Ii(u)),[c/i,Qn((r-(a*a+u*u)*i*i)/(2*i))]},o}function s0(){return Sv(rQ).scale(155.424).center([0,33.6442])}function dA(){return s0().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function sQ(e){var t=e.length;return{point:function(n,i){for(var r=-1;++r=.12&&m<.234&&g>=-.425&&g<-.214?r:m>=.166&&m<.234&&g>=-.214&&g<-.115?o:n).invert(d)},c.stream=function(d){return e&&t===d?e:e=sQ([n.stream(t=d),r.stream(d),o.stream(d)])},c.precision=function(d){return arguments.length?(n.precision(d),r.precision(d),o.precision(d),f()):n.precision()},c.scale=function(d){return arguments.length?(n.scale(d),r.scale(d*.35),o.scale(d),c.translate(n.translate())):n.scale()},c.translate=function(d){if(!arguments.length)return n.translate();var h=n.scale(),p=+d[0],g=+d[1];return i=n.translate(d).clipExtent([[p-.455*h,g-.238*h],[p+.455*h,g+.238*h]]).stream(u),s=r.translate([p-.307*h,g+.201*h]).clipExtent([[p-.425*h+_e,g+.12*h+_e],[p-.214*h-_e,g+.234*h-_e]]).stream(u),a=o.translate([p-.205*h,g+.212*h]).clipExtent([[p-.214*h+_e,g+.166*h+_e],[p-.115*h-_e,g+.234*h-_e]]).stream(u),f()},c.fitExtent=function(d,h){return r0(c,d,h)},c.fitSize=function(d,h){return $v(c,d,h)},c.fitWidth=function(d,h){return Ev(c,d,h)},c.fitHeight=function(d,h){return Cv(c,d,h)};function f(){return e=t=null,c}return c.scale(1070)}function hA(e){return function(t,n){var i=we(t),r=we(n),s=e(i*r);return s===1/0?[2,0]:[s*r*me(t),s*me(n)]}}function Xf(e){return function(t,n){var i=Fn(t*t+n*n),r=e(i),s=me(r),o=we(r);return[Li(t*s,i*o),Qn(i&&n*s/i)]}}var pA=hA(function(e){return Fn(2/(1+e))});pA.invert=Xf(function(e){return 2*Qn(e/2)});function aQ(){return Zr(pA).scale(124.75).clipAngle(180-.001)}var gA=hA(function(e){return(e=uS(e))&&e/me(e)});gA.invert=Xf(function(e){return e});function lQ(){return Zr(gA).scale(79.4188).clipAngle(180-.001)}function o0(e,t){return[e,Dg(J3((Ct+t)/2))]}o0.invert=function(e,t){return[e,2*Su(lS(t))-Ct]};function uQ(){return mA(o0).scale(961/Mn)}function mA(e){var t=Zr(e),n=t.center,i=t.scale,r=t.translate,s=t.clipExtent,o=null,a,l,u;t.scale=function(f){return arguments.length?(i(f),c()):i()},t.translate=function(f){return arguments.length?(r(f),c()):r()},t.center=function(f){return arguments.length?(n(f),c()):n()},t.clipExtent=function(f){return arguments.length?(f==null?o=a=l=u=null:(o=+f[0][0],a=+f[0][1],l=+f[1][0],u=+f[1][1]),c()):o==null?null:[[o,a],[l,u]]};function c(){var f=Re*i(),d=t(AJ(t.rotate()).invert([0,0]));return s(o==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:e===o0?[[Math.max(d[0]-f,o),a],[Math.min(d[0]+f,l),u]]:[[o,Math.max(d[1]-f,a)],[l,Math.min(d[1]+f,u)]])}return c()}function a0(e){return J3((Ct+e)/2)}function cQ(e,t){var n=we(e),i=e===t?me(e):Dg(n/we(t))/Dg(a0(t)/a0(e)),r=n*K3(a0(e),i)/i;if(!i)return o0;function s(o,a){r>0?a<-Ct+_e&&(a=-Ct+_e):a>Ct-_e&&(a=Ct-_e);var l=r/K3(a0(a),i);return[l*me(i*o),r-l*we(i*o)]}return s.invert=function(o,a){var l=r-a,u=Ii(i)*Fn(o*o+l*l),c=Li(o,qe(l))*Ii(l);return l*i<0&&(c-=Re*Ii(o)*Ii(l)),[c/i,2*Su(K3(r/u,1/i))-Ct]},s}function fQ(){return Sv(cQ).scale(109.5).parallels([30,30])}function l0(e,t){return[e,t]}l0.invert=l0;function dQ(){return Zr(l0).scale(152.63)}function hQ(e,t){var n=we(e),i=e===t?me(e):(n-we(t))/(t-e),r=n/i+e;if(qe(i)<_e)return l0;function s(o,a){var l=r-a,u=i*o;return[l*me(u),r-l*we(u)]}return s.invert=function(o,a){var l=r-a,u=Li(o,qe(l))*Ii(l);return l*i<0&&(u-=Re*Ii(o)*Ii(l)),[u/i,r-Ii(i)*Fn(o*o+l*l)]},s}function pQ(){return Sv(hQ).scale(131.154).center([0,13.9389])}var Yf=1.340264,Zf=-.081106,Kf=893e-6,Jf=.003796,u0=Fn(3)/2,gQ=12;function yA(e,t){var n=Qn(u0*me(t)),i=n*n,r=i*i*i;return[e*we(n)/(u0*(Yf+3*Zf*i+r*(7*Kf+9*Jf*i))),n*(Yf+Zf*i+r*(Kf+Jf*i))]}yA.invert=function(e,t){for(var n=t,i=n*n,r=i*i*i,s=0,o,a,l;s_e&&--i>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function vQ(){return Zr(vA).scale(175.295)}function xA(e,t){return[we(t)*me(e),me(t)]}xA.invert=Xf(Qn);function xQ(){return Zr(xA).scale(249.5).clipAngle(90+_e)}function _A(e,t){var n=we(t),i=1+we(e)*n;return[n*me(e)/i,me(t)/i]}_A.invert=Xf(function(e){return 2*Su(e)});function _Q(){return Zr(_A).scale(250).clipAngle(142)}function wA(e,t){return[Dg(J3((Ct+t)/2)),-e]}wA.invert=function(e,t){return[-t,2*Su(lS(e))-Ct]};function wQ(){var e=mA(wA),t=e.center,n=e.rotate;return e.center=function(i){return arguments.length?t([-i[1],i[0]]):(i=t(),[i[1],-i[0]])},e.rotate=function(i){return arguments.length?n([i[0],i[1],i.length>2?i[2]+90:90]):(i=n(),[i[0],i[1],i[2]-90])},n([0,0,90]).scale(159.155)}var kQ=Math.abs,Av=Math.cos,c0=Math.sin,$Q=1e-6,kA=Math.PI,Tv=kA/2,$A=EQ(2);function EA(e){return e>1?Tv:e<-1?-Tv:Math.asin(e)}function EQ(e){return e>0?Math.sqrt(e):0}function CQ(e,t){var n=e*c0(t),i=30,r;do t-=r=(t+c0(t)-n)/(1+Av(t));while(kQ(r)>$Q&&--i>0);return t/2}function SQ(e,t,n){function i(r,s){return[e*r*Av(s=CQ(n,s)),t*c0(s)]}return i.invert=function(r,s){return s=EA(s/t),[r/(e*Av(s)),EA((2*s+c0(2*s))/n)]},i}var AQ=SQ($A/Tv,$A,kA);function TQ(){return Zr(AQ).scale(169.529)}const MQ=aA(),Mv=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function FQ(e,t){return function n(){const i=t();return i.type=e,i.path=aA().projection(i),i.copy=i.copy||function(){const r=n();return Mv.forEach(s=>{i[s]&&r[s](i[s]())}),r.path.pointRadius(i.path.pointRadius()),r},A$(i)}}function Fv(e,t){if(!e||typeof e!="string")throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(f0[e]=FQ(e,t),this):f0[e]||null}function CA(e){return e&&e.path||MQ}const f0={albers:dA,albersusa:oQ,azimuthalequalarea:aQ,azimuthalequidistant:lQ,conicconformal:fQ,conicequalarea:s0,conicequidistant:pQ,equalEarth:mQ,equirectangular:dQ,gnomonic:yQ,identity:bQ,mercator:uQ,mollweide:TQ,naturalEarth1:vQ,orthographic:xQ,stereographic:_Q,transversemercator:wQ};for(const e in f0)Fv(e,f0[e]);function DQ(){}const Ds=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function SA(){var e=1,t=1,n=a;function i(l,u){return u.map(c=>r(l,c))}function r(l,u){var c=[],f=[];return s(l,u,d=>{n(d,l,u),NQ(d)>0?c.push([d]):f.push(d)}),f.forEach(d=>{for(var h=0,p=c.length,g;h=u,Ds[m<<1].forEach(v);++h=u,Ds[g|m<<1].forEach(v);for(Ds[m<<0].forEach(v);++p=u,y=l[p*e]>=u,Ds[m<<1|y<<2].forEach(v);++h=u,b=y,y=l[p*e+h+1]>=u,Ds[g|m<<1|y<<2|b<<3].forEach(v);Ds[m|y<<3].forEach(v)}for(h=-1,y=l[p*e]>=u,Ds[y<<2].forEach(v);++h=u,Ds[y<<2|b<<3].forEach(v);Ds[y<<3].forEach(v);function v(x){var _=[x[0][0]+h,x[0][1]+p],k=[x[1][0]+h,x[1][1]+p],w=o(_),$=o(k),S,E;(S=d[w])?(E=f[$])?(delete d[S.end],delete f[E.start],S===E?(S.ring.push(k),c(S.ring)):f[S.start]=d[E.end]={start:S.start,end:E.end,ring:S.ring.concat(E.ring)}):(delete d[S.end],S.ring.push(k),d[S.end=$]=S):(S=f[$])?(E=d[w])?(delete f[S.start],delete d[E.end],S===E?(S.ring.push(k),c(S.ring)):f[E.start]=d[S.end]={start:E.start,end:S.end,ring:E.ring.concat(S.ring)}):(delete f[S.start],S.ring.unshift(_),f[S.start=w]=S):f[w]=d[$]={start:w,end:$,ring:[_,k]}}}function o(l){return l[0]*2+l[1]*(e+1)*4}function a(l,u,c){l.forEach(f=>{var d=f[0],h=f[1],p=d|0,g=h|0,m,y=u[g*e+p];d>0&&d0&&h=0&&c>=0||U("invalid size"),e=u,t=c,i},i.smooth=function(l){return arguments.length?(n=l?a:DQ,i):n===a},i}function NQ(e){for(var t=0,n=e.length,i=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++ti!=h>i&&n<(d-u)*(i-c)/(h-c)+u&&(r=-r)}return r}function LQ(e,t,n){var i;return IQ(e,t,n)&&zQ(e[i=+(e[0]===t[0])],n[i],t[i])}function IQ(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function zQ(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function AA(e,t,n){return function(i){var r=Or(i),s=n?Math.min(r[0],0):r[0],o=r[1],a=o-s,l=t?ao(s,o,e):a/(e+1);return hi(s+l,o,l)}}function Dv(e){I.call(this,null,e)}Dv.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]},K(Dv,I,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=e.field||dn,s=SA().smooth(e.smooth!==!1),o=e.thresholds||PQ(i,r,e),a=e.as===null?null:e.as||"contour",l=[];return i.forEach(u=>{const c=r(u),f=s.size([c.width,c.height])(c.values,q(o)?o:o(c.values));BQ(f,c,u,e),f.forEach(d=>{l.push(rp(u,et(a!=null?{[a]:d}:d)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=l,n}});function PQ(e,t,n){const i=AA(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?i:i(e.map(r=>ga(t(r).values)))}function BQ(e,t,n,i){let r=i.scale||t.scale,s=i.translate||t.translate;if(Me(r)&&(r=r(n,i)),Me(s)&&(s=s(n,i)),(r===1||r==null)&&!s)return;const o=(Xe(r)?r:r[0])||1,a=(Xe(r)?r:r[1])||1,l=s&&s[0]||0,u=s&&s[1]||0;e.forEach(TA(t,o,a,l,u))}function TA(e,t,n,i,r){const s=e.x1||0,o=e.y1||0,a=t*n<0;function l(f){f.forEach(u)}function u(f){a&&f.reverse(),f.forEach(c)}function c(f){f[0]=(f[0]-s)*t+i,f[1]=(f[1]-o)*n+r}return function(f){return f.coordinates.forEach(l),f}}function MA(e,t,n){const i=e>=0?e:iy(t,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function Nv(e){return Me(e)?e:pn(+e)}function FA(){var e=l=>l[0],t=l=>l[1],n=ql,i=[-1,-1],r=960,s=500,o=2;function a(l,u){const c=MA(i[0],l,e)>>o,f=MA(i[1],l,t)>>o,d=c?c+2:0,h=f?f+2:0,p=2*d+(r>>o),g=2*h+(s>>o),m=new Float32Array(p*g),y=new Float32Array(p*g);let b=m;l.forEach(x=>{const _=d+(+e(x)>>o),k=h+(+t(x)>>o);_>=0&&_=0&&k0&&f>0?(Du(p,g,m,y,c),Nu(p,g,y,m,f),Du(p,g,m,y,c),Nu(p,g,y,m,f),Du(p,g,m,y,c),Nu(p,g,y,m,f)):c>0?(Du(p,g,m,y,c),Du(p,g,y,m,c),Du(p,g,m,y,c),b=y):f>0&&(Nu(p,g,m,y,f),Nu(p,g,y,m,f),Nu(p,g,m,y,f),b=y);const v=u?Math.pow(2,-2*o):1/T4(b);for(let x=0,_=p*g;x<_;++x)b[x]*=v;return{values:b,scale:1<>o),y2:h+(s>>o)}}return a.x=function(l){return arguments.length?(e=Nv(l),a):e},a.y=function(l){return arguments.length?(t=Nv(l),a):t},a.weight=function(l){return arguments.length?(n=Nv(l),a):n},a.size=function(l){if(!arguments.length)return[r,s];var u=+l[0],c=+l[1];return u>=0&&c>=0||U("invalid size"),r=u,s=c,a},a.cellSize=function(l){return arguments.length?((l=+l)>=1||U("invalid cell size"),o=Math.floor(Math.log(l)/Math.LN2),a):1<=r&&(a>=s&&(l-=n[a-s+o*e]),i[a-r+o*e]=l/Math.min(a+1,e-1+s-a,s))}function Nu(e,t,n,i,r){const s=(r<<1)+1;for(let o=0;o=r&&(a>=s&&(l-=n[o+(a-s)*e]),i[o+(a-r)*e]=l/Math.min(a+1,t-1+s-a,s))}function Ov(e){I.call(this,null,e)}Ov.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const jQ=["x","y","weight","size","cellSize","bandwidth"];function DA(e,t){return jQ.forEach(n=>t[n]!=null?e[n](t[n]):0),e}K(Ov,I,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=UQ(i,e.groupby),s=(e.groupby||[]).map(Et),o=DA(FA(),e),a=e.as||"grid",l=[];function u(c,f){for(let d=0;det(u({[a]:o(c,e.counts)},c.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=l,n}});function UQ(e,t){var n=[],i=c=>c(a),r,s,o,a,l,u;if(t==null)n.push(e);else for(r={},s=0,o=e.length;sn.push(a(c))),s&&o&&(t.visit(l,c=>{var f=s(c),d=o(c);f!=null&&d!=null&&(f=+f)===f&&(d=+d)===d&&i.push([f,d])}),n=n.concat({type:Lv,geometry:{type:qQ,coordinates:i}})),this.value={type:Iv,features:n}}});function Pv(e){I.call(this,null,e)}Pv.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]},K(Pv,I,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.field||dn,s=e.as||"path",o=n.SOURCE;!i||e.modified()?(this.value=i=CA(e.projection),n.materialize().reflow()):o=r===dn||t.modified(r.fields)?n.ADD_MOD:n.ADD;const a=WQ(i,e.pointRadius);return n.visit(o,l=>l[s]=i(r(l))),i.pointRadius(a),n.modifies(s)}});function WQ(e,t){const n=e.pointRadius();return e.context(null),t!=null&&e.pointRadius(t),n}function Bv(e){I.call(this,null,e)}Bv.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]},K(Bv,I,{transform(e,t){var n=e.projection,i=e.fields[0],r=e.fields[1],s=e.as||["x","y"],o=s[0],a=s[1],l;function u(c){const f=n([i(c),r(c)]);f?(c[o]=f[0],c[a]=f[1]):(c[o]=void 0,c[a]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,u):(l=t.modified(i.fields)||t.modified(r.fields),t.visit(l?t.ADD_MOD:t.ADD,u)),t.modifies(s)}});function jv(e){I.call(this,null,e)}jv.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]},K(jv,I,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.as||"shape",s=n.ADD;return(!i||e.modified())&&(this.value=i=HQ(CA(e.projection),e.field||Ai("datum"),e.pointRadius),n.materialize().reflow(),s=n.SOURCE),n.visit(s,o=>o[r]=i),n.modifies(r)}});function HQ(e,t,n){const i=n==null?r=>e(t(r)):r=>{var s=e.pointRadius(),o=e.pointRadius(n)(t(r));return e.pointRadius(s),o};return i.context=r=>(e.context(r),i),i}function Uv(e){I.call(this,[],e),this.generator=zJ()}Uv.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]},K(Uv,I,{transform(e,t){var n=this.value,i=this.generator,r;if(!n.length||e.modified())for(const s in e)Me(i[s])&&i[s](e[s]);return r=i(),n.length?t.mod.push(H8(n[0],r)):t.add.push(et(r)),n[0]=r,t}});function qv(e){I.call(this,null,e)}qv.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]},K(qv,I,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,i=e.resolve==="shared",r=e.field||dn,s=VQ(e.opacity,e),o=GQ(e.color,e),a=e.as||"image",l={$x:0,$y:0,$value:0,$max:i?ga(n.map(u=>ga(r(u).values))):0};return n.forEach(u=>{const c=r(u),f=Fe({},u,l);i||(f.$max=ga(c.values||[])),u[a]=XQ(c,f,o.dep?o:pn(o(f)),s.dep?s:pn(s(f)))}),t.reflow(!0).modifies(a)}});function GQ(e,t){let n;return Me(e)?(n=i=>bo(e(i,t)),n.dep=NA(e)):n=pn(bo(e||"#888")),n}function VQ(e,t){let n;return Me(e)?(n=i=>e(i,t),n.dep=NA(e)):e?n=pn(e):(n=i=>i.$value/i.$max||0,n.dep=!0),n}function NA(e){if(!Me(e))return!1;const t=Ki(fn(e));return t.$x||t.$y||t.$value||t.$max}function XQ(e,t,n,i){const r=e.width,s=e.height,o=e.x1||0,a=e.y1||0,l=e.x2||r,u=e.y2||s,c=e.values,f=c?m=>c[m]:no,d=go(l-o,u-a),h=d.getContext("2d"),p=h.getImageData(0,0,l-o,u-a),g=p.data;for(let m=a,y=0;m{e[i]!=null&&RA(n,i,e[i])})):Mv.forEach(i=>{e.modified(i)&&RA(n,i,e[i])}),e.pointRadius!=null&&n.path.pointRadius(e.pointRadius),e.fit&&YQ(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function YQ(e,t){const n=KQ(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}function ZQ(e){const t=Fv((e||"mercator").toLowerCase());return t||U("Unrecognized projection type: "+e),t()}function RA(e,t,n){Me(e[t])&&e[t](n)}function KQ(e){return e=ee(e),e.length===1?e[0]:{type:Iv,features:e.reduce((t,n)=>t.concat(JQ(n)),[])}}function JQ(e){return e.type===Iv?e.features:ee(e).filter(t=>t!=null).map(t=>t.type===Lv?t:{type:Lv,geometry:t})}const QQ=Object.freeze(Object.defineProperty({__proto__:null,contour:Rv,geojson:zv,geopath:Pv,geopoint:Bv,geoshape:jv,graticule:Uv,heatmap:qv,isocontour:Dv,kde2d:Ov,projection:OA},Symbol.toStringTag,{value:"Module"}));function eee(e,t){var n,i=1;e==null&&(e=0),t==null&&(t=0);function r(){var s,o=n.length,a,l=0,u=0;for(s=0;s=(f=(a+u)/2))?a=f:u=f,(m=n>=(d=(l+c)/2))?l=d:c=d,r=s,!(s=s[y=m<<1|g]))return r[y]=o,e;if(h=+e._x.call(null,s.data),p=+e._y.call(null,s.data),t===h&&n===p)return o.next=s,r?r[y]=o:e._root=o,e;do r=r?r[y]=new Array(4):e._root=new Array(4),(g=t>=(f=(a+u)/2))?a=f:u=f,(m=n>=(d=(l+c)/2))?l=d:c=d;while((y=m<<1|g)===(b=(p>=d)<<1|h>=f));return r[b]=s,r[y]=o,e}function nee(e){var t,n,i=e.length,r,s,o=new Array(i),a=new Array(i),l=1/0,u=1/0,c=-1/0,f=-1/0;for(n=0;nc&&(c=r),sf&&(f=s));if(l>c||u>f)return this;for(this.cover(l,u).cover(c,f),n=0;ne||e>=r||i>t||t>=s;)switch(u=(tc||(a=p.y0)>f||(l=p.x1)=y)<<1|e>=m)&&(p=d[d.length-1],d[d.length-1]=d[d.length-1-g],d[d.length-1-g]=p)}else{var b=e-+this._x.call(null,h.data),v=t-+this._y.call(null,h.data),x=b*b+v*v;if(x=(d=(o+l)/2))?o=d:l=d,(g=f>=(h=(a+u)/2))?a=h:u=h,t=n,!(n=n[m=g<<1|p]))return this;if(!n.length)break;(t[m+1&3]||t[m+2&3]||t[m+3&3])&&(i=t,y=m)}for(;n.data!==e;)if(r=n,!(n=n.next))return this;return(s=n.next)&&delete n.next,r?(s?r.next=s:delete r.next,this):t?(s?t[m]=s:delete t[m],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(i?i[y]=n:this._root=n),this):(this._root=s,this)}function lee(e){for(var t=0,n=e.length;td.index){var A=h-$.x-$.vx,R=p-$.y-$.vy,C=A*A+R*R;Ch+E||kp+E||wu.r&&(u.r=u[c].r)}function l(){if(t){var u,c=t.length,f;for(n=new Array(c),u=0;u[t(_,k,o),_])),x;for(m=0,a=new Array(y);m{}};function PA(){for(var e=0,t=arguments.length,n={},i;e=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}d0.prototype=PA.prototype={constructor:d0,on:function(e,t){var n=this._,i=kee(e+"",n),r,s=-1,o=i.length;if(arguments.length<2){for(;++s0)for(var n=new Array(r),i=0,r,s;i=0&&e._call.call(void 0,t),e=e._next;--Ou}function WA(){Ua=(p0=nd.now())+g0,Ou=Qf=0;try{Cee()}finally{Ou=0,Aee(),Ua=0}}function See(){var e=nd.now(),t=e-p0;t>jA&&(g0-=t,p0=e)}function Aee(){for(var e,t=h0,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:h0=n);td=e,Vv(i)}function Vv(e){if(!Ou){Qf&&(Qf=clearTimeout(Qf));var t=e-Ua;t>24?(e<1/0&&(Qf=setTimeout(WA,e-nd.now()-g0)),ed&&(ed=clearInterval(ed))):(ed||(p0=nd.now(),ed=setInterval(See,jA)),Ou=1,UA(WA))}}function Tee(e,t,n){var i=new m0,r=t;return t==null?(i.restart(e,t,n),i):(i._restart=i.restart,i.restart=function(s,o,a){o=+o,a=a==null?Gv():+a,i._restart(function l(u){u+=r,i._restart(l,r+=o,a),s(u)},o,a)},i.restart(e,t,n),i)}const Mee=1664525,Fee=1013904223,HA=4294967296;function Dee(){let e=1;return()=>(e=(Mee*e+Fee)%HA)/HA}function Nee(e){return e.x}function Oee(e){return e.y}var Ree=10,Lee=Math.PI*(3-Math.sqrt(5));function Iee(e){var t,n=1,i=.001,r=1-Math.pow(i,1/300),s=0,o=.6,a=new Map,l=qA(f),u=PA("tick","end"),c=Dee();e==null&&(e=[]);function f(){d(),u.call("tick",t),n1?(m==null?a.delete(g):a.set(g,p(m)),t):a.get(g)},find:function(g,m,y){var b=0,v=e.length,x,_,k,w,$;for(y==null?y=1/0:y*=y,b=0;b1?(u.on(g,m),t):u.on(g)}}}function zee(){var e,t,n,i,r=In(-30),s,o=1,a=1/0,l=.81;function u(h){var p,g=e.length,m=Wv(e,Nee,Oee).visitAfter(f);for(i=h,p=0;p=a)return;(h.data!==t||h.next)&&(y===0&&(y=Io(n),x+=y*y),b===0&&(b=Io(n),x+=b*b),x=0;)n.tick();else if(n.stopped()&&n.restart(),!i)return t.StopPropagation}return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let a=this._argops,l=0,u=a.length,c;le.touch(t).run()}function qee(e,t){const n=Iee(e),i=n.stop,r=n.restart;let s=!1;return n.stopped=()=>s,n.restart=()=>(s=!1,r()),n.stop=()=>(s=!0,i()),XA(n,t,!0).on("end",()=>s=!0)}function XA(e,t,n,i){var r=ee(t.forces),s,o,a,l;for(s=0,o=Xv.length;st(i,n):t)}const Vee=Object.freeze(Object.defineProperty({__proto__:null,force:Yv},Symbol.toStringTag,{value:"Module"}));function Xee(e,t){return e.parent===t.parent?1:2}function Yee(e){return e.reduce(Zee,0)/e.length}function Zee(e,t){return e+t.x}function Kee(e){return 1+e.reduce(Jee,0)}function Jee(e,t){return Math.max(e,t.y)}function Qee(e){for(var t;t=e.children;)e=t[0];return e}function ete(e){for(var t;t=e.children;)e=t[t.length-1];return e}function tte(){var e=Xee,t=1,n=1,i=!1;function r(s){var o,a=0;s.eachAfter(function(d){var h=d.children;h?(d.x=Yee(h),d.y=Kee(h)):(d.x=o?a+=e(d,o):0,d.y=0,o=d)});var l=Qee(s),u=ete(s),c=l.x-e(l,u)/2,f=u.x+e(u,l)/2;return s.eachAfter(i?function(d){d.x=(d.x-s.x)*t,d.y=(s.y-d.y)*n}:function(d){d.x=(d.x-c)/(f-c)*t,d.y=(1-(s.y?d.y/s.y:1))*n})}return r.separation=function(s){return arguments.length?(e=s,r):e},r.size=function(s){return arguments.length?(i=!1,t=+s[0],n=+s[1],r):i?null:[t,n]},r.nodeSize=function(s){return arguments.length?(i=!0,t=+s[0],n=+s[1],r):i?[t,n]:null},r}function nte(e){var t=0,n=e.children,i=n&&n.length;if(!i)t=1;else for(;--i>=0;)t+=n[i].value;e.value=t}function ite(){return this.eachAfter(nte)}function rte(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this}function ste(e,t){for(var n=this,i=[n],r,s,o=-1;n=i.pop();)if(e.call(t,n,++o,this),r=n.children)for(s=r.length-1;s>=0;--s)i.push(r[s]);return this}function ote(e,t){for(var n=this,i=[n],r=[],s,o,a,l=-1;n=i.pop();)if(r.push(n),s=n.children)for(o=0,a=s.length;o=0;)n+=i[r].value;t.value=n})}function ute(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function cte(e){for(var t=this,n=fte(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i}function fte(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}function dte(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function hte(){return Array.from(this)}function pte(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function gte(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*mte(){var e=this,t,n=[e],i,r,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,i=e.children)for(r=0,s=i.length;r=0;--a)r.push(s=o[a]=new Ru(o[a])),s.parent=i,s.depth=i.depth+1;return n.eachBefore(YA)}function yte(){return Zv(this).eachBefore(xte)}function bte(e){return e.children}function vte(e){return Array.isArray(e)?e[1]:null}function xte(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function YA(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Ru(e){this.data=e,this.depth=this.height=0,this.parent=null}Ru.prototype=Zv.prototype={constructor:Ru,count:ite,each:rte,eachAfter:ote,eachBefore:ste,find:ate,sum:lte,sort:ute,path:cte,ancestors:dte,descendants:hte,leaves:pte,links:gte,copy:yte,[Symbol.iterator]:mte};function y0(e){return e==null?null:ZA(e)}function ZA(e){if(typeof e!="function")throw new Error;return e}function qa(){return 0}function Lu(e){return function(){return e}}const _te=1664525,wte=1013904223,KA=4294967296;function kte(){let e=1;return()=>(e=(_te*e+wte)%KA)/KA}function $te(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ete(e,t){let n=e.length,i,r;for(;n;)r=t()*n--|0,i=e[n],e[n]=e[r],e[r]=i;return e}function Cte(e,t){for(var n=0,i=(e=Ete(Array.from(e),t)).length,r=[],s,o;n0&&n*n>i*i+r*r}function Kv(e,t){for(var n=0;n1e-6?(A+Math.sqrt(A*A-4*E*R))/(2*E):R/A);return{x:i+k+w*C,y:r+$+S*C,r:C}}function eT(e,t,n){var i=e.x-t.x,r,s,o=e.y-t.y,a,l,u=i*i+o*o;u?(s=t.r+n.r,s*=s,l=e.r+n.r,l*=l,s>l?(r=(u+l-s)/(2*u),a=Math.sqrt(Math.max(0,l/u-r*r)),n.x=e.x-r*i-a*o,n.y=e.y-r*o+a*i):(r=(u+s-l)/(2*u),a=Math.sqrt(Math.max(0,s/u-r*r)),n.x=t.x+r*i-a*o,n.y=t.y+r*o+a*i)):(n.x=t.x+n.r,n.y=t.y)}function tT(e,t){var n=e.r+t.r-1e-6,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function nT(e){var t=e._,n=e.next._,i=t.r+n.r,r=(t.x*n.r+n.x*t.r)/i,s=(t.y*n.r+n.y*t.r)/i;return r*r+s*s}function v0(e){this._=e,this.next=null,this.previous=null}function Mte(e,t){if(!(s=(e=$te(e)).length))return 0;var n,i,r,s,o,a,l,u,c,f,d;if(n=e[0],n.x=0,n.y=0,!(s>1))return n.r;if(i=e[1],n.x=-i.r,i.x=n.r,i.y=0,!(s>2))return n.r+i.r;eT(i,n,r=e[2]),n=new v0(n),i=new v0(i),r=new v0(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;e:for(l=3;lIte(n(x,_,r))),b=y.map(lT),v=new Set(y).add("");for(const x of b)v.has(x)||(v.add(x),y.push(x),b.push(lT(x)),s.push(Qv));o=(x,_)=>y[_],a=(x,_)=>b[_]}for(c=0,l=s.length;c=0&&(h=s[y],h.data===Qv);--y)h.data=null}if(f.parent=Ote,f.eachBefore(function(y){y.depth=y.parent.depth+1,--l}).eachBefore(YA),f.parent=null,l>0)throw new Error("cycle");return f}return i.id=function(r){return arguments.length?(e=y0(r),i):e},i.parentId=function(r){return arguments.length?(t=y0(r),i):t},i.path=function(r){return arguments.length?(n=y0(r),i):n},i}function Ite(e){e=`${e}`;let t=e.length;return ex(e,t-1)&&!ex(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function lT(e){let t=e.length;if(t<2)return"";for(;--t>1&&!ex(e,t););return e.slice(0,t)}function ex(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}function zte(e,t){return e.parent===t.parent?1:2}function tx(e){var t=e.children;return t?t[0]:e.t}function nx(e){var t=e.children;return t?t[t.length-1]:e.t}function Pte(e,t,n){var i=n/(t.i-e.i);t.c-=i,t.s+=n,e.c+=i,t.z+=n,t.m+=n}function Bte(e){for(var t=0,n=0,i=e.children,r=i.length,s;--r>=0;)s=i[r],s.z+=t,s.m+=t,t+=s.s+(n+=s.c)}function jte(e,t,n){return e.a.parent===t.parent?e.a:n}function x0(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}x0.prototype=Object.create(Ru.prototype);function Ute(e){for(var t=new x0(e,0),n,i=[t],r,s,o,a;n=i.pop();)if(s=n._.children)for(n.children=new Array(a=s.length),o=a-1;o>=0;--o)i.push(r=n.children[o]=new x0(s[o],o)),r.parent=n;return(t.parent=new x0(null,0)).children=[t],t}function qte(){var e=zte,t=1,n=1,i=null;function r(u){var c=Ute(u);if(c.eachAfter(s),c.parent.m=-c.z,c.eachBefore(o),i)u.eachBefore(l);else{var f=u,d=u,h=u;u.eachBefore(function(b){b.xd.x&&(d=b),b.depth>h.depth&&(h=b)});var p=f===d?1:e(f,d)/2,g=p-f.x,m=t/(d.x+p+g),y=n/(h.depth||1);u.eachBefore(function(b){b.x=(b.x+g)*m,b.y=b.depth*y})}return u}function s(u){var c=u.children,f=u.parent.children,d=u.i?f[u.i-1]:null;if(c){Bte(u);var h=(c[0].z+c[c.length-1].z)/2;d?(u.z=d.z+e(u._,d._),u.m=u.z-h):u.z=h}else d&&(u.z=d.z+e(u._,d._));u.parent.A=a(u,d,u.parent.A||f[0])}function o(u){u._.x=u.z+u.parent.m,u.m+=u.parent.m}function a(u,c,f){if(c){for(var d=u,h=u,p=c,g=d.parent.children[0],m=d.m,y=h.m,b=p.m,v=g.m,x;p=nx(p),d=tx(d),p&&d;)g=tx(g),h=nx(h),h.a=u,x=p.z+b-d.z-m+e(p._,d._),x>0&&(Pte(jte(p,u,f),u,x),m+=x,y+=x),b+=p.m,m+=d.m,v+=g.m,y+=h.m;p&&!nx(h)&&(h.t=p,h.m+=b-y),d&&!tx(g)&&(g.t=d,g.m+=m-v,f=u)}return f}function l(u){u.x*=t,u.y=u.depth*n}return r.separation=function(u){return arguments.length?(e=u,r):e},r.size=function(u){return arguments.length?(i=!1,t=+u[0],n=+u[1],r):i?null:[t,n]},r.nodeSize=function(u){return arguments.length?(i=!0,t=+u[0],n=+u[1],r):i?[t,n]:null},r}function _0(e,t,n,i,r){for(var s=e.children,o,a=-1,l=s.length,u=e.value&&(r-n)/e.value;++ab&&(b=u),k=m*m*_,v=Math.max(b/k,k/y),v>x){m-=u;break}x=v}o.push(l={value:m,dice:h1?i:1)},n}(uT);function Wte(){var e=fT,t=!1,n=1,i=1,r=[0],s=qa,o=qa,a=qa,l=qa,u=qa;function c(d){return d.x0=d.y0=0,d.x1=n,d.y1=i,d.eachBefore(f),r=[0],t&&d.eachBefore(sT),d}function f(d){var h=r[d.depth],p=d.x0+h,g=d.y0+h,m=d.x1-h,y=d.y1-h;m=d-1){var b=s[f];b.x0=p,b.y0=g,b.x1=m,b.y1=y;return}for(var v=u[f],x=h/2+v,_=f+1,k=d-1;_>>1;u[w]y-g){var E=h?(p*S+m*$)/h:m;c(f,_,$,p,g,E,y),c(_,d,S,E,g,m,y)}else{var A=h?(g*S+y*$)/h:y;c(f,_,$,p,g,m,A),c(_,d,S,p,A,m,y)}}}function Gte(e,t,n,i,r){(e.depth&1?_0:sd)(e,t,n,i,r)}const Vte=function e(t){function n(i,r,s,o,a){if((l=i._squarify)&&l.ratio===t)for(var l,u,c,f,d=-1,h,p=l.length,g=i.value;++d1?i:1)},n}(uT);function ix(e,t,n){const i={};return e.each(r=>{const s=r.data;n(s)&&(i[t(s)]=r)}),e.lookup=i,e}function rx(e){I.call(this,null,e)}rx.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const Xte=e=>e.values;K(rx,I,{transform(e,t){t.source||U("Nest transform requires an upstream data source.");var n=e.generate,i=e.modified(),r=t.clone(),s=this.value;return(!s||i||t.changed())&&(s&&s.each(o=>{o.children&&ip(o.data)&&r.rem.push(o.data)}),this.value=s=Zv({values:ee(e.keys).reduce((o,a)=>(o.key(a),o),Yte()).entries(r.source)},Xte),n&&s.each(o=>{o.children&&(o=et(o.data),r.add.push(o),r.source.push(o))}),ix(s,ge,ge)),r.source.root=s,r}});function Yte(){const e=[],t={entries:r=>i(n(r,0),0),key:r=>(e.push(r),t)};function n(r,s){if(s>=e.length)return r;const o=r.length,a=e[s++],l={},u={};let c=-1,f,d,h;for(;++ce.length)return r;const o=[];for(const a in r)o.push({key:a,values:i(r[a],s)});return o}return t}function Ns(e){I.call(this,null,e)}const Zte=(e,t)=>e.parent===t.parent?1:2;K(Ns,I,{transform(e,t){(!t.source||!t.source.root)&&U(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),i=this.fields,r=t.source.root,s=e.as||i;e.field?r.sum(e.field):r.count(),e.sort&&r.sort(xa(e.sort,o=>o.data)),Kte(n,this.params,e),n.separation&&n.separation(e.separation!==!1?Zte:ql);try{this.value=n(r)}catch(o){U(o)}return r.each(o=>Jte(o,i,s)),t.reflow(e.modified()).modifies(s).modifies("leaf")}});function Kte(e,t,n){for(let i,r=0,s=t.length;rs[ge(o)]=1),i.each(o=>{const a=o.data,l=o.parent&&o.parent.data;l&&s[ge(a)]&&s[ge(l)]&&r.add.push(et({source:l,target:a}))}),this.value=r.add):t.changed(t.MOD)&&(t.visit(t.MOD,o=>s[ge(o)]=1),n.forEach(o=>{(s[ge(o.source)]||s[ge(o.target)])&&r.mod.push(o)})),r}});const hT={binary:Hte,dice:sd,slice:_0,slicedice:Gte,squarify:fT,resquarify:Vte},hx=["x0","y0","x1","y1","depth","children"];function px(e){Ns.call(this,e)}px.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:hx.length,default:hx}]},K(px,Ns,{layout(){const e=Wte();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{pe(hT,t)?e.tile(hT[t]):U("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:hx});const Qte=Object.freeze(Object.defineProperty({__proto__:null,nest:rx,pack:ox,partition:lx,stratify:ux,tree:fx,treelinks:dx,treemap:px},Symbol.toStringTag,{value:"Module"})),gx=4278190080;function ene(e,t){const n=e.bitmap();return(t||[]).forEach(i=>n.set(e(i.boundary[0]),e(i.boundary[3]))),[n,void 0]}function tne(e,t,n,i,r){const s=e.width,o=e.height,a=i||r,l=go(s,o).getContext("2d"),u=go(s,o).getContext("2d"),c=a&&go(s,o).getContext("2d");n.forEach($=>w0(l,$,!1)),w0(u,t,!1),a&&w0(c,t,!0);const f=mx(l,s,o),d=mx(u,s,o),h=a&&mx(c,s,o),p=e.bitmap(),g=a&&e.bitmap();let m,y,b,v,x,_,k,w;for(y=0;y{r.items.forEach(s=>w0(e,s.items,n))}):yi[i].draw(e,{items:n?t.map(nne):t})}function nne(e){const t=rp(e,{});return t.stroke&&t.strokeOpacity!==0||t.fill&&t.fillOpacity!==0?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const Os=5,zn=31,od=32,zo=new Uint32Array(od+1),lr=new Uint32Array(od+1);lr[0]=0,zo[0]=~lr[0];for(let e=1;e<=od;++e)lr[e]=lr[e-1]<<1|1,zo[e]=~lr[e];function ine(e,t){const n=new Uint32Array(~~((e*t+od)/od));function i(s,o){n[s]|=o}function r(s,o){n[s]&=o}return{array:n,get:(s,o)=>{const a=o*e+s;return n[a>>>Os]&1<<(a&zn)},set:(s,o)=>{const a=o*e+s;i(a>>>Os,1<<(a&zn))},clear:(s,o)=>{const a=o*e+s;r(a>>>Os,~(1<<(a&zn)))},getRange:(s,o,a,l)=>{let u=l,c,f,d,h;for(;u>=o;--u)if(c=u*e+s,f=u*e+a,d=c>>>Os,h=f>>>Os,d===h){if(n[d]&zo[c&zn]&lr[(f&zn)+1])return!0}else{if(n[d]&zo[c&zn]||n[h]&lr[(f&zn)+1])return!0;for(let p=d+1;p{let u,c,f,d,h;for(;o<=l;++o)if(u=o*e+s,c=o*e+a,f=u>>>Os,d=c>>>Os,f===d)i(f,zo[u&zn]&lr[(c&zn)+1]);else for(i(f,zo[u&zn]),i(d,lr[(c&zn)+1]),h=f+1;h{let u,c,f,d,h;for(;o<=l;++o)if(u=o*e+s,c=o*e+a,f=u>>>Os,d=c>>>Os,f===d)r(f,lr[u&zn]|zo[(c&zn)+1]);else for(r(f,lr[u&zn]),r(d,zo[(c&zn)+1]),h=f+1;hs<0||o<0||l>=t||a>=e}}function rne(e,t,n){const i=Math.max(1,Math.sqrt(e*t/1e6)),r=~~((e+2*n+i)/i),s=~~((t+2*n+i)/i),o=a=>~~((a+n)/i);return o.invert=a=>a*i-n,o.bitmap=()=>ine(r,s),o.ratio=i,o.padding=n,o.width=e,o.height=t,o}function sne(e,t,n,i){const r=e.width,s=e.height;return function(o){const a=o.datum.datum.items[i].items,l=a.length,u=o.datum.fontSize,c=mi.width(o.datum,o.datum.text);let f=0,d,h,p,g,m,y,b;for(let v=0;v=f&&(f=b,o.x=m,o.y=y);return m=c/2,y=u/2,d=o.x-m,h=o.x+m,p=o.y-y,g=o.y+y,o.align="center",d<0&&h<=r?o.align="left":0<=d&&rr||t-(o=i/2)<0||t+o>s}function Po(e,t,n,i,r,s,o,a){const l=r*s/(i*2),u=e(t-l),c=e(t+l),f=e(n-(s=s/2)),d=e(n+s);return o.outOfBounds(u,f,c,d)||o.getRange(u,f,c,d)||a&&a.getRange(u,f,c,d)}function one(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1];function l(u,c,f,d,h){const p=e.invert(u),g=e.invert(c);let m=f,y=s,b;if(!k0(p,g,d,h,r,s)&&!Po(e,p,g,h,d,m,o,a)&&!Po(e,p,g,h,d,h,o,null)){for(;y-m>=1;)b=(m+y)/2,Po(e,p,g,h,d,b,o,a)?y=b:m=b;if(m>f)return[p,g,m,!0]}}return function(u){const c=u.datum.datum.items[i].items,f=c.length,d=u.datum.fontSize,h=mi.width(u.datum,u.datum.text);let p=n?d:0,g=!1,m=!1,y=0,b,v,x,_,k,w,$,S,E,A,R,C,M,T,O,P,j;for(let W=0;Wv&&(j=b,b=v,v=j),x>_&&(j=x,x=_,_=j),E=e(b),R=e(v),A=~~((E+R)/2),C=e(x),T=e(_),M=~~((C+T)/2),$=A;$>=E;--$)for(S=M;S>=C;--S)P=l($,S,p,h,d),P&&([u.x,u.y,p,g]=P);for($=A;$<=R;++$)for(S=M;S<=T;++S)P=l($,S,p,h,d),P&&([u.x,u.y,p,g]=P);!g&&!n&&(O=Math.abs(v-b+_-x),k=(b+v)/2,w=(x+_)/2,O>=y&&!k0(k,w,h,d,r,s)&&!Po(e,k,w,d,h,d,o,null)&&(y=O,u.x=k,u.y=w,m=!0))}return g||m?(k=h/2,w=d/2,o.setRange(e(u.x-k),e(u.y-w),e(u.x+k),e(u.y+w)),u.align="center",u.baseline="middle",!0):!1}}const ane=[-1,-1,1,1],lne=[-1,1,-1,1];function une(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1],l=e.bitmap();return function(u){const c=u.datum.datum.items[i].items,f=c.length,d=u.datum.fontSize,h=mi.width(u.datum,u.datum.text),p=[];let g=n?d:0,m=!1,y=!1,b=0,v,x,_,k,w,$,S,E,A,R,C,M;for(let T=0;T=1;)C=(A+R)/2,Po(e,w,$,d,h,C,o,a)?R=C:A=C;A>g&&(u.x=w,u.y=$,g=A,m=!0)}}!m&&!n&&(M=Math.abs(x-v+k-_),w=(v+x)/2,$=(_+k)/2,M>=b&&!k0(w,$,h,d,r,s)&&!Po(e,w,$,d,h,d,o,null)&&(b=M,u.x=w,u.y=$,y=!0))}return m||y?(w=h/2,$=d/2,o.setRange(e(u.x-w),e(u.y-$),e(u.x+w),e(u.y+$)),u.align="center",u.baseline="middle",!0):!1}}const cne=["right","center","left"],fne=["bottom","middle","top"];function dne(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1],l=i.length;return function(u){const c=u.boundary,f=u.datum.fontSize;if(c[2]<0||c[5]<0||c[0]>r||c[3]>s)return!1;let d=u.textWidth??0,h,p,g,m,y,b,v,x,_,k,w,$,S,E,A;for(let R=0;R>>2&3)-1,g=h===0&&p===0||i[R]<0,m=h&&p?Math.SQRT1_2:1,y=i[R]<0?-1:1,b=c[1+h]+i[R]*h*m,w=c[4+p]+y*f*p/2+i[R]*p*m,x=w-f/2,_=w+f/2,$=e(b),E=e(x),A=e(_),!d)if(pT($,$,E,A,o,a,b,b,x,_,c,g))d=mi.width(u.datum,u.datum.text);else continue;if(k=b+y*d*h/2,b=k-d/2,v=k+d/2,$=e(b),S=e(v),pT($,S,E,A,o,a,b,v,x,_,c,g))return u.x=h?h*y<0?v:b:k,u.y=p?p*y<0?_:x:w,u.align=cne[h*y+1],u.baseline=fne[p*y+1],o.setRange($,E,S,A),!0}return!1}}function pT(e,t,n,i,r,s,o,a,l,u,c,f){return!(r.outOfBounds(e,n,t,i)||(f&&s||r).getRange(e,n,t,i))}const yx=0,bx=4,vx=8,xx=0,_x=1,wx=2,hne={"top-left":yx+xx,top:yx+_x,"top-right":yx+wx,left:bx+xx,middle:bx+_x,right:bx+wx,"bottom-left":vx+xx,bottom:vx+_x,"bottom-right":vx+wx},pne={naive:sne,"reduced-search":one,floodfill:une};function gne(e,t,n,i,r,s,o,a,l,u,c){if(!e.length)return e;const f=Math.max(i.length,r.length),d=mne(i,f),h=yne(r,f),p=bne(e[0].datum),g=p==="group"&&e[0].datum.items[l].marktype,m=g==="area",y=vne(p,g,a,l),b=u===null||u===1/0,v=m&&c==="naive";let x=-1,_=-1;const k=e.map(E=>{const A=b?mi.width(E,E.text):void 0;return x=Math.max(x,A),_=Math.max(_,E.fontSize),{datum:E,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(E),textWidth:A}});u=u===null||u===1/0?Math.max(x,_)+Math.max(...i):u;const w=rne(t[0],t[1],u);let $;if(!v){n&&k.sort((R,C)=>n(R.datum,C.datum));let E=!1;for(let R=0;RR.datum);$=s.length||A?tne(w,A||[],s,E,m):ene(w,o&&k)}const S=m?pne[c](w,$,o,l):dne(w,$,h,d);return k.forEach(E=>E.opacity=+S(E)),k}function mne(e,t){const n=new Float64Array(t),i=e.length;for(let r=0;r[s.x,s.x,s.x,s.y,s.y,s.y];return e?e==="line"||e==="area"?s=>r(s.datum):t==="line"?s=>{const o=s.datum.items[i].items;return r(o.length?o[n==="start"?0:o.length-1]:{x:NaN,y:NaN})}:s=>{const o=s.datum.bounds;return[o.x1,(o.x1+o.x2)/2,o.x2,o.y1,(o.y1+o.y2)/2,o.y2]}:r}const kx=["x","y","opacity","align","baseline"],gT=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function $x(e){I.call(this,null,e)}$x.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:gT},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0,null:!0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:kx.length,default:kx}]},K($x,I,{transform(e,t){function n(s){const o=e[s];return Me(o)&&t.modified(o.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||n("sort")))return;(!e.size||e.size.length!==2)&&U("Size parameter should be specified as a [width, height] array.");const r=e.as||kx;return gne(t.materialize(t.SOURCE).source||[],e.size,e.sort,ee(e.offset==null?1:e.offset),ee(e.anchor||gT),e.avoidMarks||[],e.avoidBaseMark!==!1,e.lineAnchor||"end",e.markIndex||0,e.padding===void 0?0:e.padding,e.method||"naive").forEach(s=>{const o=s.datum;o[r[0]]=s.x,o[r[1]]=s.y,o[r[2]]=s.opacity,o[r[3]]=s.align,o[r[4]]=s.baseline}),t.reflow(i).modifies(r)}});const xne=Object.freeze(Object.defineProperty({__proto__:null,label:$x},Symbol.toStringTag,{value:"Module"}));function mT(e,t){var n=[],i=function(c){return c(a)},r,s,o,a,l,u;if(t==null)n.push(e);else for(r={},s=0,o=e.length;s{yk(u,e.x,e.y,e.bandwidth||.3).forEach(c=>{const f={};for(let d=0;de==="poly"?t:e==="quad"?2:1;function Sx(e){I.call(this,null,e)}Sx.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(Cx)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]},K(Sx,I,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=mT(i,e.groupby),s=(e.groupby||[]).map(Et),o=e.method||"linear",a=e.order==null?3:e.order,l=_ne(o,a),u=e.as||[Et(e.x),Et(e.y)],c=Cx[o],f=[];let d=e.extent;pe(Cx,o)||U("Invalid regression method: "+o),d!=null&&o==="log"&&d[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),r.forEach(h=>{if(h.length<=l){t.dataflow.warn("Skipping regression with more parameters than data points.");return}const g=c(h,e.x,e.y,a);if(e.params){f.push(et({keys:h.dims,coef:g.coef,rSquared:g.rSquared}));return}const m=d||Or(h,e.x),y=b=>{const v={};for(let x=0;xy([b,g.predict(b)])):pp(g.predict,m,25,200).forEach(y)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n}});const wne=Object.freeze(Object.defineProperty({__proto__:null,loess:Ex,regression:Sx},Symbol.toStringTag,{value:"Module"})),Rs=11102230246251565e-32,_n=134217729,kne=(3+8*Rs)*Rs;function Ax(e,t,n,i,r){let s,o,a,l,u=t[0],c=i[0],f=0,d=0;c>u==c>-u?(s=u,u=t[++f]):(s=c,c=i[++d]);let h=0;if(fu==c>-u?(o=u+s,a=s-(o-u),u=t[++f]):(o=c+s,a=s-(o-c),c=i[++d]),s=o,a!==0&&(r[h++]=a);fu==c>-u?(o=s+u,l=o-s,a=s-(o-l)+(u-l),u=t[++f]):(o=s+c,l=o-s,a=s-(o-l)+(c-l),c=i[++d]),s=o,a!==0&&(r[h++]=a);for(;f=M||-C>=M||(f=e-S,a=e-(S+f)+(f-r),f=n-E,u=n-(E+f)+(f-r),f=t-A,l=t-(A+f)+(f-s),f=i-R,c=i-(R+f)+(f-s),a===0&&l===0&&u===0&&c===0)||(M=Sne*o+kne*Math.abs(C),C+=S*c+R*a-(A*u+E*l),C>=M||-C>=M))return C;x=a*R,d=_n*a,h=d-(d-a),p=a-h,d=_n*R,g=d-(d-R),m=R-g,_=p*m-(x-h*g-p*g-h*m),k=l*E,d=_n*l,h=d-(d-l),p=l-h,d=_n*E,g=d-(d-E),m=E-g,w=p*m-(k-h*g-p*g-h*m),y=_-w,f=_-y,Pn[0]=_-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-k,f=v-y,Pn[1]=v-(y+f)+(f-k),$=b+y,f=$-b,Pn[2]=b-($-f)+(y-f),Pn[3]=$;const T=Ax(4,Iu,4,Pn,yT);x=S*c,d=_n*S,h=d-(d-S),p=S-h,d=_n*c,g=d-(d-c),m=c-g,_=p*m-(x-h*g-p*g-h*m),k=A*u,d=_n*A,h=d-(d-A),p=A-h,d=_n*u,g=d-(d-u),m=u-g,w=p*m-(k-h*g-p*g-h*m),y=_-w,f=_-y,Pn[0]=_-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-k,f=v-y,Pn[1]=v-(y+f)+(f-k),$=b+y,f=$-b,Pn[2]=b-($-f)+(y-f),Pn[3]=$;const O=Ax(T,yT,4,Pn,bT);x=a*c,d=_n*a,h=d-(d-a),p=a-h,d=_n*c,g=d-(d-c),m=c-g,_=p*m-(x-h*g-p*g-h*m),k=l*u,d=_n*l,h=d-(d-l),p=l-h,d=_n*u,g=d-(d-u),m=u-g,w=p*m-(k-h*g-p*g-h*m),y=_-w,f=_-y,Pn[0]=_-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-k,f=v-y,Pn[1]=v-(y+f)+(f-k),$=b+y,f=$-b,Pn[2]=b-($-f)+(y-f),Pn[3]=$;const P=Ax(O,bT,4,Pn,vT);return vT[P-1]}function $0(e,t,n,i,r,s){const o=(t-s)*(n-r),a=(e-r)*(i-s),l=o-a,u=Math.abs(o+a);return Math.abs(l)>=Ene*u?l:-Ane(e,t,n,i,r,s,u)}const xT=Math.pow(2,-52),E0=new Uint32Array(512);class C0{static from(t,n=Nne,i=One){const r=t.length,s=new Float64Array(r*2);for(let o=0;o>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const i=Math.max(2*n-5,0);this._triangles=new Uint32Array(i*3),this._halfedges=new Int32Array(i*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:i,_hullTri:r,_hullHash:s}=this,o=t.length>>1;let a=1/0,l=1/0,u=-1/0,c=-1/0;for(let E=0;Eu&&(u=A),R>c&&(c=R),this._ids[E]=E}const f=(a+u)/2,d=(l+c)/2;let h=1/0,p,g,m;for(let E=0;E0&&(g=E,h=A)}let v=t[2*g],x=t[2*g+1],_=1/0;for(let E=0;EC&&(E[A++]=M,C=this._dists[M])}this.hull=E.subarray(0,A),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if($0(y,b,v,x,k,w)<0){const E=g,A=v,R=x;g=m,v=k,x=w,m=E,k=A,w=R}const $=Dne(y,b,v,x,k,w);this._cx=$.x,this._cy=$.y;for(let E=0;E0&&Math.abs(M-A)<=xT&&Math.abs(T-R)<=xT||(A=M,R=T,C===p||C===g||C===m))continue;let O=0;for(let ae=0,ke=this._hashKey(M,T);ae=0;)if(P=j,P===O){P=-1;break}if(P===-1)continue;let W=this._addTriangle(P,C,i[P],-1,-1,r[P]);r[C]=this._legalize(W+2),r[P]=W,S++;let ne=i[P];for(;j=i[ne],$0(M,T,t[2*ne],t[2*ne+1],t[2*j],t[2*j+1])<0;)W=this._addTriangle(ne,C,j,r[C],-1,r[ne]),r[C]=this._legalize(W+2),i[ne]=ne,S--,ne=j;if(P===O)for(;j=n[P],$0(M,T,t[2*j],t[2*j+1],t[2*P],t[2*P+1])<0;)W=this._addTriangle(j,C,P,-1,r[P],r[j]),this._legalize(W+2),r[j]=W,i[P]=P,S--,P=j;this._hullStart=n[C]=P,i[P]=n[ne]=C,i[C]=ne,s[this._hashKey(M,T)]=C,s[this._hashKey(t[2*P],t[2*P+1])]=P}this.hull=new Uint32Array(S);for(let E=0,A=this._hullStart;E0?3-n:1+n)/4}function Tx(e,t,n,i){const r=e-n,s=t-i;return r*r+s*s}function Mne(e,t,n,i,r,s,o,a){const l=e-o,u=t-a,c=n-o,f=i-a,d=r-o,h=s-a,p=l*l+u*u,g=c*c+f*f,m=d*d+h*h;return l*(f*m-g*h)-u*(c*m-g*d)+p*(c*h-f*d)<0}function Fne(e,t,n,i,r,s){const o=n-e,a=i-t,l=r-e,u=s-t,c=o*o+a*a,f=l*l+u*u,d=.5/(o*u-a*l),h=(u*c-a*f)*d,p=(o*f-l*c)*d;return h*h+p*p}function Dne(e,t,n,i,r,s){const o=n-e,a=i-t,l=r-e,u=s-t,c=o*o+a*a,f=l*l+u*u,d=.5/(o*u-a*l),h=e+(u*c-a*f)*d,p=t+(o*f-l*c)*d;return{x:h,y:p}}function zu(e,t,n,i){if(i-n<=20)for(let r=n+1;r<=i;r++){const s=e[r],o=t[s];let a=r-1;for(;a>=n&&t[e[a]]>o;)e[a+1]=e[a--];e[a+1]=s}else{const r=n+i>>1;let s=n+1,o=i;ld(e,r,s),t[e[n]]>t[e[i]]&&ld(e,n,i),t[e[s]]>t[e[i]]&&ld(e,s,i),t[e[n]]>t[e[s]]&&ld(e,n,s);const a=e[s],l=t[a];for(;;){do s++;while(t[e[s]]l);if(o=o-n?(zu(e,t,s,i),zu(e,t,n,o-1)):(zu(e,t,n,o-1),zu(e,t,s,i))}}function ld(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function Nne(e){return e[0]}function One(e){return e[1]}const _T=1e-6;class Wa{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,i){t=+t,n=+n,i=+i;const r=t+i,s=n;if(i<0)throw new Error("negative radius");this._x1===null?this._+=`M${r},${s}`:(Math.abs(this._x1-r)>_T||Math.abs(this._y1-s)>_T)&&(this._+="L"+r+","+s),i&&(this._+=`A${i},${i},0,1,1,${t-i},${n}A${i},${i},0,1,1,${this._x1=r},${this._y1=s}`)}rect(t,n,i,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+i}v${+r}h${-i}Z`}value(){return this._||null}}class Mx{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}}let Rne=class{constructor(t,[n,i,r,s]=[0,0,960,500]){if(!((r=+r)>=(n=+n))||!((s=+s)>=(i=+i)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=r,this.xmin=n,this.ymax=s,this.ymin=i,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:i},vectors:r}=this;let s,o;const a=this.circumcenters=this._circumcenters.subarray(0,i.length/3*2);for(let g=0,m=0,y=i.length,b,v;g1;)s-=2;for(let o=2;o0){if(n>=this.ymax)return null;(o=(this.ymax-n)/r)0){if(t>=this.xmax)return null;(o=(this.xmax-t)/i)this.xmax?2:0)|(nthis.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let n=0;n1e-10)return!1}return!0}function Bne(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class Fx{static from(t,n=Ine,i=zne,r){return new Fx("length"in t?jne(t,n,i,r):Float64Array.from(Une(t,n,i,r)))}constructor(t){this._delaunator=new C0(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,n=this.points;if(t.hull&&t.hull.length>2&&Pne(t)){this.collinear=Int32Array.from({length:n.length/2},(d,h)=>h).sort((d,h)=>n[2*d]-n[2*h]||n[2*d+1]-n[2*h+1]);const l=this.collinear[0],u=this.collinear[this.collinear.length-1],c=[n[2*l],n[2*l+1],n[2*u],n[2*u+1]],f=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let d=0,h=n.length/2;d0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,r.length===2&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new Rne(this,t)}*neighbors(t){const{inedges:n,hull:i,_hullIndex:r,halfedges:s,triangles:o,collinear:a}=this;if(a){const f=a.indexOf(t);f>0&&(yield a[f-1]),f=0&&s!==i&&s!==r;)i=s;return s}_step(t,n,i){const{inedges:r,hull:s,_hullIndex:o,halfedges:a,triangles:l,points:u}=this;if(r[t]===-1||!u.length)return(t+1)%(u.length>>1);let c=t,f=Pu(n-u[t*2],2)+Pu(i-u[t*2+1],2);const d=r[t];let h=d;do{let p=l[h];const g=Pu(n-u[p*2],2)+Pu(i-u[p*2+1],2);if(g>5)*e[1]),m=null,y=u.length,b=-1,v=[],x=u.map(k=>({text:t(k),font:n(k),style:r(k),weight:s(k),rotate:o(k),size:~~(i(k)+1e-14),padding:a(k),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:k})).sort((k,w)=>w.size-k.size);++b>1,_.y=e[1]*(c()+.5)>>1,Xne(p,_,x,b),_.hasText&&h(g,_,m)&&(v.push(_),m?Zne(m,_):m=[{x:_.x+_.x0,y:_.y+_.y0},{x:_.x+_.x1,y:_.y+_.y1}],_.x-=e[0]>>1,_.y-=e[1]>>1)}return v};function d(p){p.width=p.height=1;var g=Math.sqrt(p.getContext("2d").getImageData(0,0,1,1).data.length>>2);p.width=(ud<<5)/g,p.height=S0/g;var m=p.getContext("2d");return m.fillStyle=m.strokeStyle="red",m.textAlign="center",{context:m,ratio:g}}function h(p,g,m){for(var y=g.x,b=g.y,v=Math.sqrt(e[0]*e[0]+e[1]*e[1]),x=l(e),_=c()<.5?1:-1,k=-_,w,$,S;(w=x(k+=_))&&($=~~w[0],S=~~w[1],!(Math.min(Math.abs($),Math.abs(S))>=v));)if(g.x=y+$,g.y=b+S,!(g.x+g.x0<0||g.y+g.y0<0||g.x+g.x1>e[0]||g.y+g.y1>e[1])&&(!m||!Yne(g,p,e[0]))&&(!m||Kne(g,m))){for(var E=g.sprite,A=g.width>>5,R=e[0]>>5,C=g.x-(A<<4),M=C&127,T=32-M,O=g.y1-g.y0,P=(g.y+g.y0)*R+(C>>5),j,W=0;W>>M:0);P+=R}return g.sprite=null,!0}return!1}return f.words=function(p){return arguments.length?(u=p,f):u},f.size=function(p){return arguments.length?(e=[+p[0],+p[1]],f):e},f.font=function(p){return arguments.length?(n=Ha(p),f):n},f.fontStyle=function(p){return arguments.length?(r=Ha(p),f):r},f.fontWeight=function(p){return arguments.length?(s=Ha(p),f):s},f.rotate=function(p){return arguments.length?(o=Ha(p),f):o},f.text=function(p){return arguments.length?(t=Ha(p),f):t},f.spiral=function(p){return arguments.length?(l=eie[p]||p,f):l},f.fontSize=function(p){return arguments.length?(i=Ha(p),f):i},f.padding=function(p){return arguments.length?(a=Ha(p),f):a},f.random=function(p){return arguments.length?(c=p,f):c},f}function Xne(e,t,n,i){if(!t.sprite){var r=e.context,s=e.ratio;r.clearRect(0,0,(ud<<5)/s,S0/s);var o=0,a=0,l=0,u=n.length,c,f,d,h,p;for(--i;++i>5<<5,d=~~Math.max(Math.abs(b+v),Math.abs(b-v))}else c=c+31>>5<<5;if(d>l&&(l=d),o+c>=ud<<5&&(o=0,a+=l,l=0),a+d>=S0)break;r.translate((o+(c>>1))/s,(a+(d>>1))/s),t.rotate&&r.rotate(t.rotate*Nx),r.fillText(t.text,0,0),t.padding&&(r.lineWidth=2*t.padding,r.strokeText(t.text,0,0)),r.restore(),t.width=c,t.height=d,t.xoff=o,t.yoff=a,t.x1=c>>1,t.y1=d>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,o+=c}for(var _=r.getImageData(0,0,(ud<<5)/s,S0/s).data,k=[];--i>=0;)if(t=n[i],!!t.hasText){for(c=t.width,f=c>>5,d=t.y1-t.y0,h=0;h>5),E=_[(a+p)*(ud<<5)+(o+h)<<2]?1<<31-h%32:0;k[S]|=E,w|=E}w?$=p:(t.y0++,d--,p--,a++)}t.y1=t.y0+$,t.sprite=k.slice(0,(t.y1-t.y0)*f)}}}function Yne(e,t,n){n>>=5;for(var i=e.sprite,r=e.width>>5,s=e.x-(r<<4),o=s&127,a=32-o,l=e.y1-e.y0,u=(e.y+e.y0)*n+(s>>5),c,f=0;f>>o:0))&t[u+d])return!0;u+=n}return!1}function Zne(e,t){var n=e[0],i=e[1];t.x+t.x0i.x&&(i.x=t.x+t.x1),t.y+t.y1>i.y&&(i.y=t.y+t.y1)}function Kne(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0t[0].y&&e.y+e.y0g(p(m))}r.forEach(p=>{p[o[0]]=NaN,p[o[1]]=NaN,p[o[3]]=0});const u=s.words(r).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(a).random(Di).layout(),c=s.size(),f=c[0]>>1,d=c[1]>>1,h=u.length;for(let p=0,g,m;pnew Uint8Array(e),rie=e=>new Uint16Array(e),cd=e=>new Uint32Array(e);function sie(){let e=8,t=[],n=cd(0),i=A0(0,e),r=A0(0,e);return{data:()=>t,seen:()=>n=oie(n,t.length),add(s){for(let o=0,a=t.length,l=s.length,u;ot.length,curr:()=>i,prev:()=>r,reset:s=>r[s]=i[s],all:()=>e<257?255:e<65537?65535:4294967295,set(s,o){i[s]|=o},clear(s,o){i[s]&=~o},resize(s,o){const a=i.length;(s>a||o>e)&&(e=Math.max(o,e),i=A0(s,e,i),r=A0(s,e))}}}function oie(e,t,n){return e.length>=t?e:(n=n||new e.constructor(t),n.set(e),n)}function A0(e,t,n){const i=(t<257?iie:t<65537?rie:cd)(e);return n&&i.set(n),i}function $T(e,t,n){const i=1<0)for(m=0;me,size:()=>n}}function aie(e,t){return e.sort.call(t,(n,i)=>{const r=e[n],s=e[i];return rs?1:0}),MU(e,t)}function lie(e,t,n,i,r,s,o,a,l){let u=0,c=0,f;for(f=0;ut.modified(i.fields));return n?this.reinit(e,t):this.eval(e,t)}else return this.init(e,t)},init(e,t){const n=e.fields,i=e.query,r=this._indices={},s=this._dims=[],o=i.length;let a=0,l,u;for(;a{const s=r.remove(t,n);for(const o in i)i[o].reindex(s)})},update(e,t,n){const i=this._dims,r=e.query,s=t.stamp,o=i.length;let a=0,l,u;for(n.filters=0,u=0;uh)for(m=h,y=Math.min(f,p);mp)for(m=Math.max(f,p),y=d;mf)for(p=f,g=Math.min(u,d);pd)for(p=Math.max(u,d),g=c;pa[c]&n?null:o[c];return s.filter(s.MOD,u),r&r-1?(s.filter(s.ADD,c=>{const f=a[c]&n;return!f&&f^l[c]&n?o[c]:null}),s.filter(s.REM,c=>{const f=a[c]&n;return f&&!(f^(f^l[c]&n))?o[c]:null})):(s.filter(s.ADD,u),s.filter(s.REM,c=>(a[c]&n)===r?o[c]:null)),s.filter(s.SOURCE,c=>u(c._index))}});const uie=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:Rx,resolvefilter:Lx},Symbol.toStringTag,{value:"Module"})),cie="RawCode",Ga="Literal",fie="Property",die="Identifier",hie="ArrayExpression",pie="BinaryExpression",CT="CallExpression",gie="ConditionalExpression",mie="LogicalExpression",yie="MemberExpression",bie="ObjectExpression",vie="UnaryExpression";function ur(e){this.type=e}ur.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=xie(this),n=0,i=t.length;n",Kr[Va]="Identifier",Kr[Bo]="Keyword",Kr[M0]="Null",Kr[Xa]="Numeric",Kr[ti]="Punctuator",Kr[dd]="String",Kr[_ie]="RegularExpression";var wie="ArrayExpression",kie="BinaryExpression",$ie="CallExpression",Eie="ConditionalExpression",ST="Identifier",Cie="Literal",Sie="LogicalExpression",Aie="MemberExpression",Tie="ObjectExpression",Mie="Property",Fie="UnaryExpression",Vt="Unexpected token %0",Die="Unexpected number",Nie="Unexpected string",Oie="Unexpected identifier",Rie="Unexpected reserved word",Lie="Unexpected end of input",Ix="Invalid regular expression",zx="Invalid regular expression: missing /",AT="Octal literals are not allowed in strict mode.",Iie="Duplicate data property in object literal not allowed in strict mode",on="ILLEGAL",hd="Disabled.",zie=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),Pie=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function F0(e,t){if(!e)throw new Error("ASSERT: "+t)}function Ls(e){return e>=48&&e<=57}function Px(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function pd(e){return"01234567".indexOf(e)>=0}function Bie(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function gd(e){return e===10||e===13||e===8232||e===8233}function md(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&zie.test(String.fromCharCode(e))}function D0(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&Pie.test(String.fromCharCode(e))}const jie={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function TT(){for(;B1114111||e!=="}")&&Je({},Vt,on),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function MT(){var e,t;for(e=fe.charCodeAt(B++),t=String.fromCharCode(e),e===92&&(fe.charCodeAt(B)!==117&&Je({},Vt,on),++B,e=Bx("u"),(!e||e==="\\"||!md(e.charCodeAt(0)))&&Je({},Vt,on),t=e);B>>=")return B+=4,{type:ti,value:o,start:e,end:B};if(s=o.substr(0,3),s===">>>"||s==="<<="||s===">>=")return B+=3,{type:ti,value:s,start:e,end:B};if(r=s.substr(0,2),i===r[1]&&"+-<>&|".indexOf(i)>=0||r==="=>")return B+=2,{type:ti,value:r,start:e,end:B};if(r==="//"&&Je({},Vt,on),"<>=!+-*%&|^/".indexOf(i)>=0)return++B,{type:ti,value:i,start:e,end:B};Je({},Vt,on)}function Hie(e){let t="";for(;B1)i=$U(e,t,n);else for(r=0,i=new Array(s=e.arcs.length);rt?1:e>=t?0:NaN}function EU(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Xl(e){let t,n,i;e.length!==2?(t=ys,n=(a,l)=>ys(e(a),l),i=(a,l)=>e(a)-l):(t=e===ys||e===EU?e:CU,n=e,i=e);function r(a,l,u=0,c=a.length){if(u>>1;n(a[f],l)<0?u=f+1:c=f}while(u>>1;n(a[f],l)<=0?u=f+1:c=f}while(uu&&i(a[f-1],l)>-i(a[f],l)?f-1:f}return{left:r,center:o,right:s}}function CU(){return 0}function b4(e){return e===null?NaN:+e}function*SU(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of e)(i=t(i,++n,e))!=null&&(i=+i)>=i&&(yield i)}}const v4=Xl(ys),zh=v4.right,AU=v4.left;Xl(b4).center;const zc=zh;function TU(e,t){let n=0,i,r=0,s=0;if(t===void 0)for(let o of e)o!=null&&(o=+o)>=o&&(i=o-r,r+=i/++n,s+=i*(o-r));else{let o=-1;for(let a of e)(a=t(a,++o,e))!=null&&(a=+a)>=a&&(i=a-r,r+=i/++n,s+=i*(a-r))}if(n>1)return s/(n-1)}function MU(e,t){const n=TU(e,t);return n&&Math.sqrt(n)}class Sn{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let i=0;for(let r=0;r0){for(o=t[--n];n>0&&(i=o,r=t[--n],o=i+r,s=r-(o-i),!s););n>0&&(s<0&&t[n-1]<0||s>0&&t[n-1]>0)&&(r=s*2,i=o+r,r==i-o&&(o=i))}return o}}class x4 extends Map{constructor(t,n=k4){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[i,r]of t)this.set(i,r)}get(t){return super.get(v2(this,t))}has(t){return super.has(v2(this,t))}set(t,n){return super.set(_4(this,t),n)}delete(t){return super.delete(w4(this,t))}}class Ph extends Set{constructor(t,n=k4){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const i of t)this.add(i)}has(t){return super.has(v2(this,t))}add(t){return super.add(_4(this,t))}delete(t){return super.delete(w4(this,t))}}function v2({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function _4({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}function w4({_intern:e,_key:t},n){const i=t(n);return e.has(i)&&(n=e.get(i),e.delete(i)),n}function k4(e){return e!==null&&typeof e=="object"?e.valueOf():e}function FU(e,t){return Array.from(t,n=>e[n])}function DU(e=ys){if(e===ys)return $4;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const i=e(t,n);return i||i===0?i:(e(n,n)===0)-(e(t,t)===0)}}function $4(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const NU=Math.sqrt(50),OU=Math.sqrt(10),RU=Math.sqrt(2);function Bh(e,t,n){const i=(t-e)/Math.max(0,n),r=Math.floor(Math.log10(i)),s=i/Math.pow(10,r),o=s>=NU?10:s>=OU?5:s>=RU?2:1;let a,l,u;return r<0?(u=Math.pow(10,-r)/o,a=Math.round(e*u),l=Math.round(t*u),a/ut&&--l,u=-u):(u=Math.pow(10,r)*o,a=Math.round(e/u),l=Math.round(t/u),a*ut&&--l),l0))return[];if(e===t)return[e];const i=t=r))return[];const a=s-r+1,l=new Array(a);if(i)if(o<0)for(let u=0;u=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n=r)&&(n=r)}return n}function w2(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n>i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n>r||n===void 0&&r>=r)&&(n=r)}return n}function E4(e,t,n=0,i=1/0,r){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),i=Math.floor(Math.min(e.length-1,i)),!(n<=t&&t<=i))return e;for(r=r===void 0?$4:DU(r);i>n;){if(i-n>600){const l=i-n+1,u=t-n+1,c=Math.log(l),f=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*f*(l-f)/l)*(u-l/2<0?-1:1),h=Math.max(n,Math.floor(t-u*f/l+d)),p=Math.min(i,Math.floor(t+(l-u)*f/l+d));E4(e,t,h,p,r)}const s=e[t];let o=n,a=i;for(Pc(e,n,t),r(e[i],s)>0&&Pc(e,n,i);o0;)--a}r(e[n],s)===0?Pc(e,n,a):(++a,Pc(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}return e}function Pc(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function k2(e,t,n){if(e=Float64Array.from(SU(e,n)),!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return w2(e);if(t>=1)return ga(e);var i,r=(i-1)*t,s=Math.floor(r),o=ga(E4(e,s).subarray(0,s+1)),a=w2(e.subarray(s+1));return o+(a-o)*(r-s)}}function C4(e,t,n=b4){if(!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return+n(e[0],0,e);if(t>=1)return+n(e[i-1],i-1,e);var i,r=(i-1)*t,s=Math.floor(r),o=+n(e[s],s,e),a=+n(e[s+1],s+1,e);return o+(a-o)*(r-s)}}function LU(e,t){let n=0,i=0;if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&(++n,i+=r);else{let r=-1;for(let s of e)(s=t(s,++r,e))!=null&&(s=+s)>=s&&(++n,i+=s)}if(n)return i/n}function S4(e,t){return k2(e,.5,t)}function*IU(e){for(const t of e)yield*t}function A4(e){return Array.from(IU(e))}function hi(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(r);++i=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function jh(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,i=e.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+e.slice(n+1)]}function Yl(e){return e=jh(Math.abs(e)),e?e[1]:NaN}function UU(e,t){return function(n,i){for(var r=n.length,s=[],o=0,a=e[0],l=0;r>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),s.push(n.substring(r-=a,r+a)),!((l+=a+1)>i));)a=e[o=(o+1)%e.length];return s.reverse().join(t)}}function qU(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var WU=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ma(e){if(!(t=WU.exec(e)))throw new Error("invalid format: "+e);var t;return new $2({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}ma.prototype=$2.prototype;function $2(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}$2.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function HU(e){e:for(var t=e.length,n=1,i=-1,r;n0&&(i=0);break}return i>0?e.slice(0,i)+e.slice(r+1):e}var M4;function GU(e,t){var n=jh(e,t);if(!n)return e+"";var i=n[0],r=n[1],s=r-(M4=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,o=i.length;return s===o?i:s>o?i+new Array(s-o+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+jh(e,Math.max(0,t+s-1))[0]}function F4(e,t){var n=jh(e,t);if(!n)return e+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}const D4={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:jU,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>F4(e*100,t),r:F4,s:GU,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function N4(e){return e}var O4=Array.prototype.map,R4=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function L4(e){var t=e.grouping===void 0||e.thousands===void 0?N4:UU(O4.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",i=e.currency===void 0?"":e.currency[1]+"",r=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?N4:qU(O4.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",a=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(f){f=ma(f);var d=f.fill,h=f.align,p=f.sign,g=f.symbol,m=f.zero,y=f.width,b=f.comma,v=f.precision,x=f.trim,_=f.type;_==="n"?(b=!0,_="g"):D4[_]||(v===void 0&&(v=12),x=!0,_="g"),(m||d==="0"&&h==="=")&&(m=!0,d="0",h="=");var k=g==="$"?n:g==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",w=g==="$"?i:/[%p]/.test(_)?o:"",$=D4[_],S=/[defgprs%]/.test(_);v=v===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v));function E(A){var R=k,C=w,M,T,O;if(_==="c")C=$(A)+C,A="";else{A=+A;var P=A<0||1/A<0;if(A=isNaN(A)?l:$(Math.abs(A),v),x&&(A=HU(A)),P&&+A==0&&p!=="+"&&(P=!1),R=(P?p==="("?p:a:p==="-"||p==="("?"":p)+R,C=(_==="s"?R4[8+M4/3]:"")+C+(P&&p==="("?")":""),S){for(M=-1,T=A.length;++MO||O>57){C=(O===46?r+A.slice(M+1):A.slice(M))+C,A=A.slice(0,M);break}}}b&&!m&&(A=t(A,1/0));var j=R.length+A.length+C.length,W=j>1)+R+A+C+W.slice(j);break;default:A=W+R+A+C;break}return s(A)}return E.toString=function(){return f+""},E}function c(f,d){var h=u((f=ma(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(Yl(d)/3)))*3,g=Math.pow(10,-p),m=R4[8+p/3];return function(y){return h(g*y)+m}}return{format:u,formatPrefix:c}}var Uh,qh,E2;VU({thousands:",",grouping:[3],currency:["$",""]});function VU(e){return Uh=L4(e),qh=Uh.format,E2=Uh.formatPrefix,Uh}function I4(e){return Math.max(0,-Yl(Math.abs(e)))}function z4(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Yl(t)/3)))*3-Yl(Math.abs(e)))}function P4(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Yl(t)-Yl(e))+1}const C2=new Date,S2=new Date;function Lt(e,t,n,i){function r(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return r.floor=s=>(e(s=new Date(+s)),s),r.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),r.round=s=>{const o=r(s),a=r.ceil(s);return s-o(t(s=new Date(+s),o==null?1:Math.floor(o)),s),r.range=(s,o,a)=>{const l=[];if(s=r.ceil(s),a=a==null?1:Math.floor(a),!(s0))return l;let u;do l.push(u=new Date(+s)),t(s,a),e(s);while(uLt(o=>{if(o>=o)for(;e(o),!s(o);)o.setTime(o-1)},(o,a)=>{if(o>=o)if(a<0)for(;++a<=0;)for(;t(o,-1),!s(o););else for(;--a>=0;)for(;t(o,1),!s(o););}),n&&(r.count=(s,o)=>(C2.setTime(+s),S2.setTime(+o),e(C2),e(S2),Math.floor(n(C2,S2))),r.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?r.filter(i?o=>i(o)%s===0:o=>r.count(0,o)%s===0):r)),r}const Zl=Lt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Zl.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Lt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Zl),Zl.range;const bs=1e3,Fi=bs*60,vs=Fi*60,xs=vs*24,A2=xs*7,B4=xs*30,T2=xs*365,_s=Lt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*bs)},(e,t)=>(t-e)/bs,e=>e.getUTCSeconds());_s.range;const Wh=Lt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*bs)},(e,t)=>{e.setTime(+e+t*Fi)},(e,t)=>(t-e)/Fi,e=>e.getMinutes());Wh.range;const Hh=Lt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Fi)},(e,t)=>(t-e)/Fi,e=>e.getUTCMinutes());Hh.range;const Gh=Lt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*bs-e.getMinutes()*Fi)},(e,t)=>{e.setTime(+e+t*vs)},(e,t)=>(t-e)/vs,e=>e.getHours());Gh.range;const Vh=Lt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*vs)},(e,t)=>(t-e)/vs,e=>e.getUTCHours());Vh.range;const ws=Lt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Fi)/xs,e=>e.getDate()-1);ws.range;const lo=Lt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/xs,e=>e.getUTCDate()-1);lo.range;const j4=Lt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/xs,e=>Math.floor(e/xs));j4.range;function ya(e){return Lt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Fi)/A2)}const Kl=ya(0),Xh=ya(1),XU=ya(2),YU=ya(3),Jl=ya(4),ZU=ya(5),KU=ya(6);Kl.range,Xh.range,XU.range,YU.range,Jl.range,ZU.range,KU.range;function ba(e){return Lt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/A2)}const Ql=ba(0),Yh=ba(1),JU=ba(2),QU=ba(3),eu=ba(4),eq=ba(5),tq=ba(6);Ql.range,Yh.range,JU.range,QU.range,eu.range,eq.range,tq.range;const Bc=Lt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Bc.range;const jc=Lt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());jc.range;const Rr=Lt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Rr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Lt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),Rr.range;const Lr=Lt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Lr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Lt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),Lr.range;function U4(e,t,n,i,r,s){const o=[[_s,1,bs],[_s,5,5*bs],[_s,15,15*bs],[_s,30,30*bs],[s,1,Fi],[s,5,5*Fi],[s,15,15*Fi],[s,30,30*Fi],[r,1,vs],[r,3,3*vs],[r,6,6*vs],[r,12,12*vs],[i,1,xs],[i,2,2*xs],[n,1,A2],[t,1,B4],[t,3,3*B4],[e,1,T2]];function a(u,c,f){const d=cm).right(o,d);if(h===o.length)return e.every(ao(u/T2,c/T2,f));if(h===0)return Zl.every(Math.max(ao(u,c,f),1));const[p,g]=o[d/o[h-1][2](e[t]=1+n,e),{});function D2(e){const t=ee(e).slice(),n={};return t.length||U("Missing time unit."),t.forEach(r=>{me(F2,r)?n[r]=1:U(`Invalid time unit: ${r}.`)}),(n[It]||n[mn]?1:0)+(n[Zn]||n[gn]||n[Kn]?1:0)+(n[Ir]?1:0)>1&&U(`Incompatible time units: ${e}`),t.sort((r,s)=>F2[r]-F2[s]),t}const oq={[nn]:"%Y ",[Zn]:"Q%q ",[gn]:"%b ",[Kn]:"%d ",[It]:"W%U ",[mn]:"%a ",[Ir]:"%j ",[pi]:"%H:00",[gi]:"00:%M",[Di]:":%S",[Ji]:".%L",[`${nn}-${gn}`]:"%Y-%m ",[`${nn}-${gn}-${Kn}`]:"%Y-%m-%d ",[`${pi}-${gi}`]:"%H:%M"};function q4(e,t){const n=Fe({},oq,t),i=D2(e),r=i.length;let s="",o=0,a,l;for(o=0;oo;--a)if(l=i.slice(o,a).join("-"),n[l]!=null){s+=n[l],o=a;break}return s.trim()}const va=new Date;function N2(e){return va.setFullYear(e),va.setMonth(0),va.setDate(1),va.setHours(0,0,0,0),va}function W4(e){return G4(new Date(e))}function H4(e){return O2(new Date(e))}function G4(e){return ws.count(N2(e.getFullYear())-1,e)}function O2(e){return Kl.count(N2(e.getFullYear())-1,e)}function R2(e){return N2(e).getDay()}function aq(e,t,n,i,r,s,o){if(0<=e&&e<100){const a=new Date(-1,t,n,i,r,s,o);return a.setFullYear(e),a}return new Date(e,t,n,i,r,s,o)}function V4(e){return Y4(new Date(e))}function X4(e){return L2(new Date(e))}function Y4(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return lo.count(t-1,e)}function L2(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Ql.count(t-1,e)}function I2(e){return va.setTime(Date.UTC(e,0,1)),va.getUTCDay()}function lq(e,t,n,i,r,s,o){if(0<=e&&e<100){const a=new Date(Date.UTC(-1,t,n,i,r,s,o));return a.setUTCFullYear(n.y),a}return new Date(Date.UTC(e,t,n,i,r,s,o))}function Z4(e,t,n,i,r){const s=t||1,o=Ue(e),a=(y,b,v)=>(v=v||y,uq(n[v],i[v],y===o&&s,b)),l=new Date,u=Ki(e),c=u[nn]?a(nn):pn(2012),f=u[gn]?a(gn):u[Zn]?a(Zn):no,d=u[It]&&u[mn]?a(mn,1,It+mn):u[It]?a(It,1):u[mn]?a(mn,1):u[Kn]?a(Kn,1):u[Ir]?a(Ir,1):ql,h=u[pi]?a(pi):no,p=u[gi]?a(gi):no,g=u[Di]?a(Di):no,m=u[Ji]?a(Ji):no;return function(y){l.setTime(+y);const b=c(l);return r(b,f(l),d(l,b),h(l),p(l),g(l),m(l))}}function uq(e,t,n,i){const r=n<=1?e:i?(s,o)=>i+n*Math.floor((e(s,o)-i)/n):(s,o)=>n*Math.floor(e(s,o)/n);return t?(s,o)=>t(r(s,o),o):r}function tu(e,t,n){return t+e*7-(n+6)%7}const cq={[nn]:e=>e.getFullYear(),[Zn]:e=>Math.floor(e.getMonth()/3),[gn]:e=>e.getMonth(),[Kn]:e=>e.getDate(),[pi]:e=>e.getHours(),[gi]:e=>e.getMinutes(),[Di]:e=>e.getSeconds(),[Ji]:e=>e.getMilliseconds(),[Ir]:e=>G4(e),[It]:e=>O2(e),[It+mn]:(e,t)=>tu(O2(e),e.getDay(),R2(t)),[mn]:(e,t)=>tu(1,e.getDay(),R2(t))},fq={[Zn]:e=>3*e,[It]:(e,t)=>tu(e,0,R2(t))};function K4(e,t){return Z4(e,t||1,cq,fq,aq)}const dq={[nn]:e=>e.getUTCFullYear(),[Zn]:e=>Math.floor(e.getUTCMonth()/3),[gn]:e=>e.getUTCMonth(),[Kn]:e=>e.getUTCDate(),[pi]:e=>e.getUTCHours(),[gi]:e=>e.getUTCMinutes(),[Di]:e=>e.getUTCSeconds(),[Ji]:e=>e.getUTCMilliseconds(),[Ir]:e=>Y4(e),[It]:e=>L2(e),[mn]:(e,t)=>tu(1,e.getUTCDay(),I2(t)),[It+mn]:(e,t)=>tu(L2(e),e.getUTCDay(),I2(t))},hq={[Zn]:e=>3*e,[It]:(e,t)=>tu(e,0,I2(t))};function J4(e,t){return Z4(e,t||1,dq,hq,lq)}const pq={[nn]:Rr,[Zn]:Bc.every(3),[gn]:Bc,[It]:Kl,[Kn]:ws,[mn]:ws,[Ir]:ws,[pi]:Gh,[gi]:Wh,[Di]:_s,[Ji]:Zl},gq={[nn]:Lr,[Zn]:jc.every(3),[gn]:jc,[It]:Ql,[Kn]:lo,[mn]:lo,[Ir]:lo,[pi]:Vh,[gi]:Hh,[Di]:_s,[Ji]:Zl};function nu(e){return pq[e]}function iu(e){return gq[e]}function Q4(e,t,n){return e?e.offset(t,n):void 0}function e8(e,t,n){return Q4(nu(e),t,n)}function t8(e,t,n){return Q4(iu(e),t,n)}function n8(e,t,n,i){return e?e.range(t,n,i):void 0}function i8(e,t,n,i){return n8(nu(e),t,n,i)}function r8(e,t,n,i){return n8(iu(e),t,n,i)}const Uc=1e3,qc=Uc*60,Wc=qc*60,Zh=Wc*24,mq=Zh*7,s8=Zh*30,z2=Zh*365,o8=[nn,gn,Kn,pi,gi,Di,Ji],Hc=o8.slice(0,-1),Gc=Hc.slice(0,-1),Vc=Gc.slice(0,-1),yq=Vc.slice(0,-1),bq=[nn,It],a8=[nn,gn],l8=[nn],Xc=[[Hc,1,Uc],[Hc,5,5*Uc],[Hc,15,15*Uc],[Hc,30,30*Uc],[Gc,1,qc],[Gc,5,5*qc],[Gc,15,15*qc],[Gc,30,30*qc],[Vc,1,Wc],[Vc,3,3*Wc],[Vc,6,6*Wc],[Vc,12,12*Wc],[yq,1,Zh],[bq,1,mq],[a8,1,s8],[a8,3,3*s8],[l8,1,z2]];function u8(e){const t=e.extent,n=e.maxbins||40,i=Math.abs(Lc(t))/n;let r=Xl(a=>a[2]).right(Xc,i),s,o;return r===Xc.length?(s=l8,o=ao(t[0]/z2,t[1]/z2,n)):r?(r=Xc[i/Xc[r-1][2]53)return null;"w"in X||(X.w=1),"Z"in X?(He=B2(Yc(X.y,0,1)),Cn=He.getUTCDay(),He=Cn>4||Cn===0?Yh.ceil(He):Yh(He),He=lo.offset(He,(X.V-1)*7),X.y=He.getUTCFullYear(),X.m=He.getUTCMonth(),X.d=He.getUTCDate()+(X.w+6)%7):(He=P2(Yc(X.y,0,1)),Cn=He.getDay(),He=Cn>4||Cn===0?Xh.ceil(He):Xh(He),He=ws.offset(He,(X.V-1)*7),X.y=He.getFullYear(),X.m=He.getMonth(),X.d=He.getDate()+(X.w+6)%7)}else("W"in X||"U"in X)&&("w"in X||(X.w="u"in X?X.u%7:"W"in X?1:0),Cn="Z"in X?B2(Yc(X.y,0,1)).getUTCDay():P2(Yc(X.y,0,1)).getDay(),X.m=0,X.d="W"in X?(X.w+6)%7+X.W*7-(Cn+5)%7:X.w+X.U*7-(Cn+6)%7);return"Z"in X?(X.H+=X.Z/100|0,X.M+=X.Z%100,B2(X)):P2(X)}}function $(se,Te,De,X){for(var qt=0,He=Te.length,Cn=De.length,Hn,Rl;qt=Cn)return-1;if(Hn=Te.charCodeAt(qt++),Hn===37){if(Hn=Te.charAt(qt++),Rl=_[Hn in f8?Te.charAt(qt++):Hn],!Rl||(X=Rl(se,De,X))<0)return-1}else if(Hn!=De.charCodeAt(X++))return-1}return X}function S(se,Te,De){var X=u.exec(Te.slice(De));return X?(se.p=c.get(X[0].toLowerCase()),De+X[0].length):-1}function E(se,Te,De){var X=h.exec(Te.slice(De));return X?(se.w=p.get(X[0].toLowerCase()),De+X[0].length):-1}function A(se,Te,De){var X=f.exec(Te.slice(De));return X?(se.w=d.get(X[0].toLowerCase()),De+X[0].length):-1}function R(se,Te,De){var X=y.exec(Te.slice(De));return X?(se.m=b.get(X[0].toLowerCase()),De+X[0].length):-1}function C(se,Te,De){var X=g.exec(Te.slice(De));return X?(se.m=m.get(X[0].toLowerCase()),De+X[0].length):-1}function M(se,Te,De){return $(se,t,Te,De)}function T(se,Te,De){return $(se,n,Te,De)}function O(se,Te,De){return $(se,i,Te,De)}function P(se){return o[se.getDay()]}function j(se){return s[se.getDay()]}function W(se){return l[se.getMonth()]}function ne(se){return a[se.getMonth()]}function ae(se){return r[+(se.getHours()>=12)]}function ke(se){return 1+~~(se.getMonth()/3)}function ze(se){return o[se.getUTCDay()]}function Ie(se){return s[se.getUTCDay()]}function We(se){return l[se.getUTCMonth()]}function Wn(se){return a[se.getUTCMonth()]}function Mr(se){return r[+(se.getUTCHours()>=12)]}function Xi(se){return 1+~~(se.getUTCMonth()/3)}return{format:function(se){var Te=k(se+="",v);return Te.toString=function(){return se},Te},parse:function(se){var Te=w(se+="",!1);return Te.toString=function(){return se},Te},utcFormat:function(se){var Te=k(se+="",x);return Te.toString=function(){return se},Te},utcParse:function(se){var Te=w(se+="",!0);return Te.toString=function(){return se},Te}}}var f8={"-":"",_:" ",0:"0"},Wt=/^\s*\d+/,vq=/^%/,xq=/[\\^$*+?|[\]().{}]/g;function Ze(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",s=r.length;return i+(s[t.toLowerCase(),n]))}function wq(e,t,n){var i=Wt.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function kq(e,t,n){var i=Wt.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function $q(e,t,n){var i=Wt.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function Eq(e,t,n){var i=Wt.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function Cq(e,t,n){var i=Wt.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function d8(e,t,n){var i=Wt.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function h8(e,t,n){var i=Wt.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function Sq(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function Aq(e,t,n){var i=Wt.exec(t.slice(n,n+1));return i?(e.q=i[0]*3-3,n+i[0].length):-1}function Tq(e,t,n){var i=Wt.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function p8(e,t,n){var i=Wt.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function Mq(e,t,n){var i=Wt.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function g8(e,t,n){var i=Wt.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function Fq(e,t,n){var i=Wt.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function Dq(e,t,n){var i=Wt.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function Nq(e,t,n){var i=Wt.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function Oq(e,t,n){var i=Wt.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function Rq(e,t,n){var i=vq.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function Lq(e,t,n){var i=Wt.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function Iq(e,t,n){var i=Wt.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function m8(e,t){return Ze(e.getDate(),t,2)}function zq(e,t){return Ze(e.getHours(),t,2)}function Pq(e,t){return Ze(e.getHours()%12||12,t,2)}function Bq(e,t){return Ze(1+ws.count(Rr(e),e),t,3)}function y8(e,t){return Ze(e.getMilliseconds(),t,3)}function jq(e,t){return y8(e,t)+"000"}function Uq(e,t){return Ze(e.getMonth()+1,t,2)}function qq(e,t){return Ze(e.getMinutes(),t,2)}function Wq(e,t){return Ze(e.getSeconds(),t,2)}function Hq(e){var t=e.getDay();return t===0?7:t}function Gq(e,t){return Ze(Kl.count(Rr(e)-1,e),t,2)}function b8(e){var t=e.getDay();return t>=4||t===0?Jl(e):Jl.ceil(e)}function Vq(e,t){return e=b8(e),Ze(Jl.count(Rr(e),e)+(Rr(e).getDay()===4),t,2)}function Xq(e){return e.getDay()}function Yq(e,t){return Ze(Xh.count(Rr(e)-1,e),t,2)}function Zq(e,t){return Ze(e.getFullYear()%100,t,2)}function Kq(e,t){return e=b8(e),Ze(e.getFullYear()%100,t,2)}function Jq(e,t){return Ze(e.getFullYear()%1e4,t,4)}function Qq(e,t){var n=e.getDay();return e=n>=4||n===0?Jl(e):Jl.ceil(e),Ze(e.getFullYear()%1e4,t,4)}function eW(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ze(t/60|0,"0",2)+Ze(t%60,"0",2)}function v8(e,t){return Ze(e.getUTCDate(),t,2)}function tW(e,t){return Ze(e.getUTCHours(),t,2)}function nW(e,t){return Ze(e.getUTCHours()%12||12,t,2)}function iW(e,t){return Ze(1+lo.count(Lr(e),e),t,3)}function x8(e,t){return Ze(e.getUTCMilliseconds(),t,3)}function rW(e,t){return x8(e,t)+"000"}function sW(e,t){return Ze(e.getUTCMonth()+1,t,2)}function oW(e,t){return Ze(e.getUTCMinutes(),t,2)}function aW(e,t){return Ze(e.getUTCSeconds(),t,2)}function lW(e){var t=e.getUTCDay();return t===0?7:t}function uW(e,t){return Ze(Ql.count(Lr(e)-1,e),t,2)}function _8(e){var t=e.getUTCDay();return t>=4||t===0?eu(e):eu.ceil(e)}function cW(e,t){return e=_8(e),Ze(eu.count(Lr(e),e)+(Lr(e).getUTCDay()===4),t,2)}function fW(e){return e.getUTCDay()}function dW(e,t){return Ze(Yh.count(Lr(e)-1,e),t,2)}function hW(e,t){return Ze(e.getUTCFullYear()%100,t,2)}function pW(e,t){return e=_8(e),Ze(e.getUTCFullYear()%100,t,2)}function gW(e,t){return Ze(e.getUTCFullYear()%1e4,t,4)}function mW(e,t){var n=e.getUTCDay();return e=n>=4||n===0?eu(e):eu.ceil(e),Ze(e.getUTCFullYear()%1e4,t,4)}function yW(){return"+0000"}function w8(){return"%"}function k8(e){return+e}function $8(e){return Math.floor(+e/1e3)}var ru,j2,E8,U2,C8;bW({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function bW(e){return ru=c8(e),j2=ru.format,E8=ru.parse,U2=ru.utcFormat,C8=ru.utcParse,ru}function Jc(e){const t={};return n=>t[n]||(t[n]=e(n))}function vW(e,t){return n=>{const i=e(n),r=i.indexOf(t);if(r<0)return i;let s=xW(i,r);const o=sr;)if(i[s]!=="0"){++s;break}return i.slice(0,s)+o}}function xW(e,t){let n=e.lastIndexOf("e"),i;if(n>0)return n;for(n=e.length;--n>t;)if(i=e.charCodeAt(n),i>=48&&i<=57)return n+1}function S8(e){const t=Jc(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(i){const r=ma(i||",");if(r.precision==null){switch(r.precision=12,r.type){case"%":r.precision-=2;break;case"e":r.precision-=1;break}return vW(t(r),t(".1f")(1)[1])}else return t(r)},formatSpan(i,r,s,o){o=ma(o??",f");const a=ao(i,r,s),l=Math.max(Math.abs(i),Math.abs(r));let u;if(o.precision==null)switch(o.type){case"s":return isNaN(u=z4(a,l))||(o.precision=u),n(o,l);case"":case"e":case"g":case"p":case"r":{isNaN(u=P4(a,l))||(o.precision=u-(o.type==="e"));break}case"f":case"%":{isNaN(u=I4(a))||(o.precision=u-(o.type==="%")*2);break}}return t(o)}}}let q2;A8();function A8(){return q2=S8({format:qh,formatPrefix:E2})}function T8(e){return S8(L4(e))}function Kh(e){return arguments.length?q2=T8(e):q2}function M8(e,t,n){n=n||{},re(n)||U(`Invalid time multi-format specifier: ${n}`);const i=t(Di),r=t(gi),s=t(pi),o=t(Kn),a=t(It),l=t(gn),u=t(Zn),c=t(nn),f=e(n[Ji]||".%L"),d=e(n[Di]||":%S"),h=e(n[gi]||"%I:%M"),p=e(n[pi]||"%I %p"),g=e(n[Kn]||n[mn]||"%a %d"),m=e(n[It]||"%b %d"),y=e(n[gn]||"%B"),b=e(n[Zn]||"%B"),v=e(n[nn]||"%Y");return x=>(i(x)te(i)?t(i):M8(t,nu,i),utcFormat:i=>te(i)?n(i):M8(n,iu,i),timeParse:Jc(e.parse),utcParse:Jc(e.utcParse)}}let W2;D8();function D8(){return W2=F8({format:j2,parse:E8,utcFormat:U2,utcParse:C8})}function N8(e){return F8(c8(e))}function Qc(e){return arguments.length?W2=N8(e):W2}const H2=(e,t)=>Fe({},e,t);function O8(e,t){const n=e?T8(e):Kh(),i=t?N8(t):Qc();return H2(n,i)}function G2(e,t){const n=arguments.length;return n&&n!==2&&U("defaultLocale expects either zero or two arguments."),n?H2(Kh(e),Qc(t)):H2(Kh(),Qc())}function _W(){return A8(),D8(),G2()}const wW=/^(data:|([A-Za-z]+:)?\/\/)/,kW=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,$W=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,R8="file://";function EW(e,t){return n=>({options:n||{},sanitize:SW,load:CW,fileAccess:!!t,file:AW(t),http:MW(e)})}async function CW(e,t){const n=await this.sanitize(e,t),i=n.href;return n.localFile?this.file(i):this.http(i,t)}async function SW(e,t){t=Fe({},this.options,t);const n=this.fileAccess,i={href:null};let r,s,o;const a=kW.test(e.replace($W,""));(e==null||typeof e!="string"||!a)&&U("Sanitize failure, invalid URI: "+J(e));const l=wW.test(e);return(o=t.baseURL)&&!l&&(!e.startsWith("/")&&!o.endsWith("/")&&(e="/"+e),e=o+e),s=(r=e.startsWith(R8))||t.mode==="file"||t.mode!=="http"&&!l&&n,r?e=e.slice(R8.length):e.startsWith("//")&&(t.defaultProtocol==="file"?(e=e.slice(2),s=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(i,"localFile",{value:!!s}),i.href=e,t.target&&(i.target=t.target+""),t.rel&&(i.rel=t.rel+""),t.context==="image"&&t.crossOrigin&&(i.crossOrigin=t.crossOrigin+""),i}function AW(e){return e?t=>new Promise((n,i)=>{e.readFile(t,(r,s)=>{r?i(r):n(s)})}):TW}async function TW(){U("No file system access.")}function MW(e){return e?async function(t,n){const i=Fe({},this.options.http,n),r=n&&n.response,s=await e(t,i);return s.ok?Me(s[r])?s[r]():s.text():U(s.status+""+s.statusText)}:FW}async function FW(){U("No HTTP fetch method available.")}const DW=e=>e!=null&&e===e,NW=e=>e==="true"||e==="false"||e===!0||e===!1,OW=e=>!Number.isNaN(Date.parse(e)),L8=e=>!Number.isNaN(+e)&&!(e instanceof Date),RW=e=>L8(e)&&Number.isInteger(+e),V2={boolean:h2,integer:hn,number:hn,date:p2,string:g2,unknown:dn},Jh=[NW,RW,L8,OW],LW=["boolean","integer","number","date"];function I8(e,t){if(!e||!e.length)return"unknown";const n=e.length,i=Jh.length,r=Jh.map((s,o)=>o+1);for(let s=0,o=0,a,l;ss===0?o:s,0)-1]}function z8(e,t){return t.reduce((n,i)=>(n[i]=I8(e,i),n),{})}function P8(e){const t=function(n,i){const r={delimiter:e};return X2(n,i?Fe(i,r):r)};return t.responseType="text",t}function X2(e,t){return t.header&&(e=t.header.map(J).join(t.delimiter)+` +`+e),mU(t.delimiter).parse(e+"")}X2.responseType="text";function IW(e){return typeof Buffer=="function"&&Me(Buffer.isBuffer)?Buffer.isBuffer(e):!1}function Y2(e,t){const n=t&&t.property?Ti(t.property):dn;return re(e)&&!IW(e)?zW(n(e),t):n(JSON.parse(e))}Y2.responseType="json";function zW(e,t){return!q(e)&&o4(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}const PW={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function B8(e,t){let n,i,r,s;return e=Y2(e,t),t&&t.feature?(n=xU,r=t.feature):t&&t.mesh?(n=wU,r=t.mesh,s=PW[t.filter]):U("Missing TopoJSON feature or mesh parameter."),i=(i=e.objects[r])?n(e,i,s):U("Invalid TopoJSON object: "+r),i&&i.features||[i]}B8.responseType="json";const Qh={dsv:X2,csv:P8(","),tsv:P8(" "),json:Y2,topojson:B8};function Z2(e,t){return arguments.length>1?(Qh[e]=t,this):me(Qh,e)?Qh[e]:null}function j8(e){const t=Z2(e);return t&&t.responseType||"text"}function U8(e,t,n,i){t=t||{};const r=Z2(t.type||"json");return r||U("Unknown data format type: "+t.type),e=r(e,t),t.parse&&BW(e,t.parse,n,i),me(e,"columns")&&delete e.columns,e}function BW(e,t,n,i){if(!e.length)return;const r=Qc();n=n||r.timeParse,i=i||r.utcParse;let s=e.columns||Object.keys(e[0]),o,a,l,u,c,f;t==="auto"&&(t=z8(e,s)),s=Object.keys(t);const d=s.map(h=>{const p=t[h];let g,m;if(p&&(p.startsWith("date:")||p.startsWith("utc:")))return g=p.split(/:(.+)?/,2),m=g[1],(m[0]==="'"&&m[m.length-1]==="'"||m[0]==='"'&&m[m.length-1]==='"')&&(m=m.slice(1,-1)),(g[0]==="utc"?i:n)(m);if(!V2[p])throw Error("Illegal format pattern: "+h+":"+p);return V2[p]});for(l=0,c=e.length,f=s.length;l{const s=t(r);return i[s]||(i[s]=1,n.push(r)),n},n.remove=r=>{const s=t(r);if(i[s]){i[s]=0;const o=n.indexOf(r);o>=0&&n.splice(o,1)}return n},n}async function np(e,t){try{await t(e)}catch(n){e.error(n)}}const q8=Symbol("vega_id");let jW=1;function ip(e){return!!(e&&ye(e))}function ye(e){return e[q8]}function W8(e,t){return e[q8]=t,e}function et(e){const t=e===Object(e)?e:{data:e};return ye(t)?t:W8(t,jW++)}function K2(e){return rp(e,et({}))}function rp(e,t){for(const n in e)t[n]=e[n];return t}function H8(e,t){return W8(t,ye(e))}function xa(e,t){return e?t?(n,i)=>e(n,i)||ye(t(n))-ye(t(i)):(n,i)=>e(n,i)||ye(n)-ye(i):null}function G8(e){return e&&e.constructor===_a}function _a(){const e=[],t=[],n=[],i=[],r=[];let s=null,o=!1;return{constructor:_a,insert(a){const l=ee(a),u=l.length;for(let c=0;c{p(b)&&(u[ye(b)]=-1)});for(f=0,d=e.length;f0&&(y(g,p,h.value),a.modifies(p));for(f=0,d=r.length;f{p(b)&&u[ye(b)]>0&&y(b,h.field,h.value)}),a.modifies(h.field);if(o)a.mod=t.length||i.length?l.filter(b=>u[ye(b)]>0):l.slice();else for(m in c)a.mod.push(c[m]);return(s||s==null&&(t.length||i.length))&&a.clean(!0),a}}}const sp="_:mod:_";function op(){Object.defineProperty(this,sp,{writable:!0,value:{}})}op.prototype={set(e,t,n,i){const r=this,s=r[e],o=r[sp];return t!=null&&t>=0?(s[t]!==n||i)&&(s[t]=n,o[t+":"+e]=-1,o[e]=-1):(s!==n||i)&&(r[e]=n,o[e]=q(n)?1+n.length:-1),r},modified(e,t){const n=this[sp];if(arguments.length){if(q(e)){for(let i=0;i=0?t+1{h instanceof gt?(h!==this&&(t&&h.targets().add(this),s.push(h)),r.push({op:h,name:f,index:d})):i.set(f,d,h)};for(o in e)if(a=e[o],o===qW)ee(a).forEach(f=>{f instanceof gt?f!==this&&(f.targets().add(this),s.push(f)):U("Pulse parameters must be operator instances.")}),this.source=a;else if(q(a))for(i.set(o,-1,Array(l=a.length)),u=0;u{const n=Date.now();return n-t>e?(t=n,1):0})},debounce(e){const t=uo();return this.targets().add(uo(null,null,f2(e,n=>{const i=n.dataflow;t.receive(n),i&&i.run&&i.run()}))),t},between(e,t){let n=!1;return e.targets().add(uo(null,null,()=>n=!0)),t.targets().add(uo(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=Mi,this._targets=null}};function ZW(e,t,n,i){const r=this,s=uo(n,i),o=function(u){u.dataflow=r;try{s.receive(u)}catch(c){r.error(c)}finally{r.run()}};let a;typeof e=="string"&&typeof document<"u"?a=document.querySelectorAll(e):a=ee(e);const l=a.length;for(let u=0;ut=i);return n.requests=0,n.done=()=>{--n.requests===0&&(e._pending=null,t(e))},e._pending=n}const nH={skip:!0};function iH(e,t,n,i,r){return(e instanceof gt?sH:rH)(this,e,t,n,i,r),this}function rH(e,t,n,i,r,s){const o=Fe({},s,nH);let a,l;Me(n)||(n=pn(n)),i===void 0?a=u=>e.touch(n(u)):Me(i)?(l=new gt(null,i,r,!1),a=u=>{l.evaluate(u);const c=n(u),f=l.value;G8(f)?e.pulse(c,f,s):e.update(c,f,o)}):a=u=>e.update(n(u),i,o),t.apply(a)}function sH(e,t,n,i,r,s){if(i===void 0)t.targets().add(n);else{const o=s||{},a=new gt(null,oH(n,i),r,!1);a.modified(o.force),a.rank=t.rank,t.targets().add(a),n&&(a.skip(!0),a.value=n.value,a.targets().add(n),e.connect(n,[a]))}}function oH(e,t){return t=Me(t)?t:pn(t),e?function(n,i){const r=t(n,i);return e.skip()||(e.skip(r!==this.value).value=r),r}:t}function aH(e){e.rank=++this._rank}function lH(e){const t=[e];let n,i,r;for(;t.length;)if(this.rank(n=t.pop()),i=n._targets)for(r=i.length;--r>=0;)t.push(n=i[r]),n===e&&U("Cycle detected in dataflow graph.")}const lp={},zr=1,co=2,ks=4,uH=zr|co,X8=zr|ks,su=zr|co|ks,Y8=8,ef=16,Z8=32,K8=64;function fo(e,t,n){this.dataflow=e,this.stamp=t??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function J2(e,t){const n=[];return oo(e,t,i=>n.push(i)),n}function J8(e,t){const n={};return e.visit(t,i=>{n[ye(i)]=1}),i=>n[ye(i)]?null:i}function up(e,t){return e?(n,i)=>e(n,i)&&t(n,i):t}fo.prototype={StopPropagation:lp,ADD:zr,REM:co,MOD:ks,ADD_REM:uH,ADD_MOD:X8,ALL:su,REFLOW:Y8,SOURCE:ef,NO_SOURCE:Z8,NO_FIELDS:K8,fork(e){return new fo(this.dataflow).init(this,e)},clone(){const e=this.fork(su);return e.add=e.add.slice(),e.rem=e.rem.slice(),e.mod=e.mod.slice(),e.source&&(e.source=e.source.slice()),e.materialize(su|ef)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new fo(this.dataflow).init(this),e.add=e.source,e.rem=[]),e},init(e,t){const n=this;return n.stamp=e.stamp,n.encode=e.encode,e.fields&&!(t&K8)&&(n.fields=e.fields),t&zr?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),t&co?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),t&ks?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),t&Z8?(n.srcF=null,n.source=null):(n.srcF=e.srcF,n.source=e.source,e.cleans&&(n.cleans=e.cleans)),n},runAfter(e){this.dataflow.runAfter(e)},changed(e){const t=e||su;return t&zr&&this.add.length||t&co&&this.rem.length||t&ks&&this.mod.length},reflow(e){if(e)return this.fork(su).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(ks,J8(this,zr))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return q(e)?e.forEach(n=>t[n]=!0):t[e]=!0,this},modified(e,t){const n=this.fields;return(t||this.mod.length)&&n?arguments.length?q(e)?e.some(i=>n[i]):n[e]:!!n:!1},filter(e,t){const n=this;return e&zr&&(n.addF=up(n.addF,t)),e&co&&(n.remF=up(n.remF,t)),e&ks&&(n.modF=up(n.modF,t)),e&ef&&(n.srcF=up(n.srcF,t)),n},materialize(e){e=e||su;const t=this;return e&zr&&t.addF&&(t.add=J2(t.add,t.addF),t.addF=null),e&co&&t.remF&&(t.rem=J2(t.rem,t.remF),t.remF=null),e&ks&&t.modF&&(t.mod=J2(t.mod,t.modF),t.modF=null),e&ef&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,i=t;if(e&ef)return oo(n.source,n.srcF,i),n;e&zr&&oo(n.add,n.addF,i),e&co&&oo(n.rem,n.remF,i),e&ks&&oo(n.mod,n.modF,i);const r=n.source;if(e&Y8&&r){const s=n.add.length+n.mod.length;s===r.length||(s?oo(r,J8(n,X8),i):oo(r,n.srcF,i))}return n}};function Q2(e,t,n,i){const r=this;let s=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=i||null,this.pulses=n;for(const o of n)if(o.stamp===t){if(o.fields){const a=r.fields||(r.fields={});for(const l in o.fields)a[l]=1}o.changed(r.ADD)&&(s|=r.ADD),o.changed(r.REM)&&(s|=r.REM),o.changed(r.MOD)&&(s|=r.MOD)}this.changes=s}K(Q2,fo,{fork(e){const t=new fo(this.dataflow).init(this,e&this.NO_FIELDS);return e!==void 0&&(e&t.ADD&&this.visit(t.ADD,n=>t.add.push(n)),e&t.REM&&this.visit(t.REM,n=>t.rem.push(n)),e&t.MOD&&this.visit(t.MOD,n=>t.mod.push(n))),t},changed(e){return this.changes&e},modified(e){const t=this,n=t.fields;return n&&t.changes&t.MOD?q(e)?e.some(i=>n[i]):n[e]:0},filter(){U("MultiPulse does not support filtering.")},materialize(){U("MultiPulse does not support materialization.")},visit(e,t){const n=this,i=n.pulses,r=i.length;let s=0;if(e&n.SOURCE)for(;si._enqueue(c,!0)),i._touched=tp(Oc);let o=0,a,l,u;try{for(;i._heap.size()>0;){if(a=i._heap.pop(),a.rank!==a.qrank){i._enqueue(a,!0);continue}l=a.run(i._getPulse(a,e)),l.then?l=await l:l.async&&(r.push(l.async),l=lp),l!==lp&&a._targets&&a._targets.forEach(c=>i._enqueue(c)),++o}}catch(c){i._heap.clear(),u=c}if(i._input={},i._pulse=null,i.debug(`Pulse ${s}: ${o} operators`),u&&(i._postrun=[],i.error(u)),i._postrun.length){const c=i._postrun.sort((f,d)=>d.priority-f.priority);i._postrun=[];for(let f=0;fi.runAsync(null,()=>{c.forEach(f=>{try{f(i)}catch(d){i.error(d)}})})),i}async function fH(e,t,n){for(;this._running;)await this._running;const i=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(i,i),this._running}function dH(e,t,n){return this._pulse?Q8(this):(this.evaluate(e,t,n),this)}function hH(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(i){this.error(i)}}function Q8(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}function pH(e,t){const n=e.stampr.pulse),t):this._input[e.id]||mH(this._pulse,n&&n.pulse)}function mH(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==lp&&(e.source=t.source),e)}const ey={skip:!1,force:!1};function yH(e,t){const n=t||ey;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this}function bH(e,t,n){const i=n||ey;return(e.set(t)||i.force)&&this.touch(e,i),this}function vH(e,t,n){this.touch(e,n||ey);const i=new fo(this,this._clock+(this._pulse?0:1)),r=e.pulse&&e.pulse.source||[];return i.target=e,this._input[e.id]=t.pulse(i,r),this}function xH(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),ek(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let i;return t.length?(i=t[0],t[0]=n,_H(t,0,e)):i=n,i}}}function ek(e,t,n,i){let r,s;const o=e[n];for(;n>t;){if(s=n-1>>1,r=e[s],i(o,r)<0){e[n]=r,n=s;continue}break}return e[n]=o}function _H(e,t,n){const i=t,r=e.length,s=e[t];let o=(t<<1)+1,a;for(;o=0&&(o=a),e[t]=e[o],t=o,o=(t<<1)+1;return e[t]=s,ek(e,i,t,n)}function ou(){this.logger(o2()),this.logLevel(r2),this._clock=0,this._rank=0,this._locale=G2();try{this._loader=ep()}catch{}this._touched=tp(Oc),this._input={},this._pulse=null,this._heap=xH((e,t)=>e.qrank-t.qrank),this._postrun=[]}function tf(e){return function(){return this._log[e].apply(this,arguments)}}ou.prototype={stamp(){return this._clock},loader(e){return arguments.length?(this._loader=e,this):this._loader},locale(e){return arguments.length?(this._locale=e,this):this._locale},logger(e){return arguments.length?(this._log=e,this):this._log},error:tf("error"),warn:tf("warn"),info:tf("info"),debug:tf("debug"),logLevel:tf("level"),cleanThreshold:1e4,add:VW,connect:XW,rank:aH,rerank:lH,pulse:vH,touch:yH,update:bH,changeset:_a,ingest:JW,parse:KW,preload:eH,request:QW,events:ZW,on:iH,evaluate:cH,run:dH,runAsync:fH,runAfter:hH,_enqueue:pH,_getPulse:gH};function z(e,t){gt.call(this,e,null,t)}K(z,gt,{run(e){if(e.stampthis.pulse=n):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){const t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}});const au={};function tk(e){const t=nk(e);return t&&t.Definition||null}function nk(e){return e=e&&e.toLowerCase(),me(au,e)?au[e]:null}function*ik(e,t){if(t==null)for(let n of e)n!=null&&n!==""&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of e)i=t(i,++n,e),i!=null&&i!==""&&(i=+i)>=i&&(yield i)}}function ty(e,t,n){const i=Float64Array.from(ik(e,n));return i.sort(ys),t.map(r=>C4(i,r))}function ny(e,t){return ty(e,[.25,.5,.75],t)}function iy(e,t){const n=e.length,i=MU(e,t),r=ny(e,t),s=(r[2]-r[0])/1.34;return 1.06*(Math.min(i,s)||i||Math.abs(r[0])||1)*Math.pow(n,-.2)}function rk(e){const t=e.maxbins||20,n=e.base||10,i=Math.log(n),r=e.divide||[5,2];let s=e.extent[0],o=e.extent[1],a,l,u,c,f,d;const h=e.span||o-s||Math.abs(s)||1;if(e.step)a=e.step;else if(e.steps){for(c=h/t,f=0,d=e.steps.length;ft;)a*=n;for(f=0,d=r.length;f=u&&h/c<=t&&(a=c)}c=Math.log(a);const p=c>=0?0:~~(-c/i)+1,g=Math.pow(n,-p-1);return(e.nice||e.nice===void 0)&&(c=Math.floor(s/a+g)*a,s=sd);const r=e.length,s=new Float64Array(r);let o=0,a=1,l=i(e[0]),u=l,c=l+t,f;for(;a=c){for(u=(l+u)/2;o>1);or;)e[o--]=e[i]}i=r,r=s}return e}function $H(e){return function(){return e=(1103515245*e+12345)%2147483647,e/2147483647}}function EH(e,t){t==null&&(t=e,e=0);let n,i,r;const s={min(o){return arguments.length?(n=o||0,r=i-n,s):n},max(o){return arguments.length?(i=o||0,r=i-n,s):i},sample(){return n+Math.floor(r*Ni())},pdf(o){return o===Math.floor(o)&&o>=n&&o=i?1:(a-n+1)/r},icdf(o){return o>=0&&o<=1?n-1+Math.floor(o*r):NaN}};return s.min(e).max(t)}const ak=Math.sqrt(2*Math.PI),CH=Math.SQRT2;let nf=NaN;function cp(e,t){e=e||0,t=t??1;let n=0,i=0,r,s;if(nf===nf)n=nf,nf=NaN;else{do n=Ni()*2-1,i=Ni()*2-1,r=n*n+i*i;while(r===0||r>1);s=Math.sqrt(-2*Math.log(r)/r),n*=s,nf=i*s}return e+n*t}function ry(e,t,n){n=n??1;const i=(e-(t||0))/n;return Math.exp(-.5*i*i)/(n*ak)}function fp(e,t,n){t=t||0,n=n??1;const i=(e-t)/n,r=Math.abs(i);let s;if(r>37)s=0;else{const o=Math.exp(-r*r/2);let a;r<7.07106781186547?(a=.0352624965998911*r+.700383064443688,a=a*r+6.37396220353165,a=a*r+33.912866078383,a=a*r+112.079291497871,a=a*r+221.213596169931,a=a*r+220.206867912376,s=o*a,a=.0883883476483184*r+1.75566716318264,a=a*r+16.064177579207,a=a*r+86.7807322029461,a=a*r+296.564248779674,a=a*r+637.333633378831,a=a*r+793.826512519948,a=a*r+440.413735824752,s=s/a):(a=r+.65,a=r+4/a,a=r+3/a,a=r+2/a,a=r+1/a,s=o/a/2.506628274631)}return i>0?1-s:s}function dp(e,t,n){return e<0||e>1?NaN:(t||0)+(n??1)*CH*SH(2*e-1)}function SH(e){let t=-Math.log((1-e)*(1+e)),n;return t<6.25?(t-=3.125,n=-364441206401782e-35,n=-16850591381820166e-35+n*t,n=128584807152564e-32+n*t,n=11157877678025181e-33+n*t,n=-1333171662854621e-31+n*t,n=20972767875968562e-33+n*t,n=6637638134358324e-30+n*t,n=-4054566272975207e-29+n*t,n=-8151934197605472e-29+n*t,n=26335093153082323e-28+n*t,n=-12975133253453532e-27+n*t,n=-5415412054294628e-26+n*t,n=10512122733215323e-25+n*t,n=-4112633980346984e-24+n*t,n=-29070369957882005e-24+n*t,n=42347877827932404e-23+n*t,n=-13654692000834679e-22+n*t,n=-13882523362786469e-21+n*t,n=.00018673420803405714+n*t,n=-.000740702534166267+n*t,n=-.006033670871430149+n*t,n=.24015818242558962+n*t,n=1.6536545626831027+n*t):t<16?(t=Math.sqrt(t)-3.25,n=22137376921775787e-25,n=9075656193888539e-23+n*t,n=-27517406297064545e-23+n*t,n=18239629214389228e-24+n*t,n=15027403968909828e-22+n*t,n=-4013867526981546e-21+n*t,n=29234449089955446e-22+n*t,n=12475304481671779e-21+n*t,n=-47318229009055734e-21+n*t,n=6828485145957318e-20+n*t,n=24031110387097894e-21+n*t,n=-.0003550375203628475+n*t,n=.0009532893797373805+n*t,n=-.0016882755560235047+n*t,n=.002491442096107851+n*t,n=-.003751208507569241+n*t,n=.005370914553590064+n*t,n=1.0052589676941592+n*t,n=3.0838856104922208+n*t):Number.isFinite(t)?(t=Math.sqrt(t)-5,n=-27109920616438573e-27,n=-2555641816996525e-25+n*t,n=15076572693500548e-25+n*t,n=-3789465440126737e-24+n*t,n=761570120807834e-23+n*t,n=-1496002662714924e-23+n*t,n=2914795345090108e-23+n*t,n=-6771199775845234e-23+n*t,n=22900482228026655e-23+n*t,n=-99298272942317e-20+n*t,n=4526062597223154e-21+n*t,n=-1968177810553167e-20+n*t,n=7599527703001776e-20+n*t,n=-.00021503011930044477+n*t,n=-.00013871931833623122+n*t,n=1.0103004648645344+n*t,n=4.849906401408584+n*t):n=1/0,n*e}function sy(e,t){let n,i;const r={mean(s){return arguments.length?(n=s||0,r):n},stdev(s){return arguments.length?(i=s??1,r):i},sample:()=>cp(n,i),pdf:s=>ry(s,n,i),cdf:s=>fp(s,n,i),icdf:s=>dp(s,n,i)};return r.mean(e).stdev(t)}function oy(e,t){const n=sy();let i=0;const r={data(s){return arguments.length?(e=s,i=s?s.length:0,r.bandwidth(t)):e},bandwidth(s){return arguments.length?(t=s,!t&&e&&(t=iy(e)),r):t},sample(){return e[~~(Ni()*i)]+t*n.sample()},pdf(s){let o=0,a=0;for(;aay(n,i),pdf:s=>ly(s,n,i),cdf:s=>uy(s,n,i),icdf:s=>cy(s,n,i)};return r.mean(e).stdev(t)}function uk(e,t){let n=0,i;function r(o){const a=[];let l=0,u;for(u=0;u=t&&e<=n?1/(n-t):0}function hy(e,t,n){return n==null&&(n=t??1,t=0),en?1:(e-t)/(n-t)}function py(e,t,n){return n==null&&(n=t??1,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function ck(e,t){let n,i;const r={min(s){return arguments.length?(n=s||0,r):n},max(s){return arguments.length?(i=s??1,r):i},sample:()=>fy(n,i),pdf:s=>dy(s,n,i),cdf:s=>hy(s,n,i),icdf:s=>py(s,n,i)};return t==null&&(t=e??1,e=0),r.min(e).max(t)}function gy(e,t,n){let i=0,r=0;for(const s of e){const o=n(s);t(s)==null||o==null||isNaN(o)||(i+=(o-i)/++r)}return{coef:[i],predict:()=>i,rSquared:0}}function rf(e,t,n,i){const r=i-e*e,s=Math.abs(r)<1e-24?0:(n-e*t)/r;return[t-s*e,s]}function hp(e,t,n,i){e=e.filter(h=>{let p=t(h),g=n(h);return p!=null&&(p=+p)>=p&&g!=null&&(g=+g)>=g}),i&&e.sort((h,p)=>t(h)-t(p));const r=e.length,s=new Float64Array(r),o=new Float64Array(r);let a=0,l=0,u=0,c,f,d;for(d of e)s[a]=c=+t(d),o[a]=f=+n(d),++a,l+=(c-l)/a,u+=(f-u)/a;for(a=0;a=s&&o!=null&&(o=+o)>=o&&i(s,o,++r)}function lu(e,t,n,i,r){let s=0,o=0;return sf(e,t,n,(a,l)=>{const u=l-r(a),c=l-i;s+=u*u,o+=c*c}),1-s/o}function my(e,t,n){let i=0,r=0,s=0,o=0,a=0;sf(e,t,n,(c,f)=>{++a,i+=(c-i)/a,r+=(f-r)/a,s+=(c*f-s)/a,o+=(c*c-o)/a});const l=rf(i,r,s,o),u=c=>l[0]+l[1]*c;return{coef:l,predict:u,rSquared:lu(e,t,n,r,u)}}function fk(e,t,n){let i=0,r=0,s=0,o=0,a=0;sf(e,t,n,(c,f)=>{++a,c=Math.log(c),i+=(c-i)/a,r+=(f-r)/a,s+=(c*f-s)/a,o+=(c*c-o)/a});const l=rf(i,r,s,o),u=c=>l[0]+l[1]*Math.log(c);return{coef:l,predict:u,rSquared:lu(e,t,n,r,u)}}function dk(e,t,n){const[i,r,s,o]=hp(e,t,n);let a=0,l=0,u=0,c=0,f=0,d,h,p;sf(e,t,n,(b,v)=>{d=i[f++],h=Math.log(v),p=d*v,a+=(v*h-a)/f,l+=(p-l)/f,u+=(p*h-u)/f,c+=(d*p-c)/f});const[g,m]=rf(l/o,a/o,u/o,c/o),y=b=>Math.exp(g+m*(b-s));return{coef:[Math.exp(g-m*s),m],predict:y,rSquared:lu(e,t,n,o,y)}}function hk(e,t,n){let i=0,r=0,s=0,o=0,a=0,l=0;sf(e,t,n,(f,d)=>{const h=Math.log(f),p=Math.log(d);++l,i+=(h-i)/l,r+=(p-r)/l,s+=(h*p-s)/l,o+=(h*h-o)/l,a+=(d-a)/l});const u=rf(i,r,s,o),c=f=>u[0]*Math.pow(f,u[1]);return u[0]=Math.exp(u[0]),{coef:u,predict:c,rSquared:lu(e,t,n,a,c)}}function yy(e,t,n){const[i,r,s,o]=hp(e,t,n),a=i.length;let l=0,u=0,c=0,f=0,d=0,h,p,g,m;for(h=0;h(w=w-s,v*w*w+x*w+_+o);return{coef:[_-x*s+v*s*s+o,x-2*v*s,v],predict:k,rSquared:lu(e,t,n,o,k)}}function pk(e,t,n,i){if(i===0)return gy(e,t,n);if(i===1)return my(e,t,n);if(i===2)return yy(e,t,n);const[r,s,o,a]=hp(e,t,n),l=r.length,u=[],c=[],f=i+1;let d,h,p,g,m;for(d=0;d{v-=o;let x=a+y[0]+y[1]*v+y[2]*v*v;for(d=3;d=0;--s)for(a=t[s],l=1,r[s]+=a,o=1;o<=s;++o)l*=(s+1-o)/o,r[s-o]+=a*Math.pow(n,o)*l;return r[0]+=i,r}function TH(e){const t=e.length-1,n=[];let i,r,s,o,a;for(i=0;iMath.abs(e[i][o])&&(o=r);for(s=i;s=i;s--)e[s][r]-=e[s][i]*e[i][r]/e[i][i]}for(r=t-1;r>=0;--r){for(a=0,s=r+1;sr[v]-y?b:v;let _=0,k=0,w=0,$=0,S=0;const E=1/Math.abs(r[x]-y||1);for(let C=b;C<=v;++C){const M=r[C],T=s[C],O=MH(Math.abs(y-M)*E)*d[C],P=M*O;_+=O,k+=P,w+=T*O,$+=T*P,S+=M*P}const[A,R]=rf(k/_,w/_,$/_,S/_);c[m]=A+R*y,f[m]=Math.abs(s[m]-c[m]),FH(r,m+1,p)}if(h===gk)break;const g=S4(f);if(Math.abs(g)=1?mk:(b=1-y*y)*b}return DH(r,c,o,a)}function MH(e){return(e=1-e*e*e)*e*e}function FH(e,t,n){const i=e[t];let r=n[0],s=n[1]+1;if(!(s>=e.length))for(;t>r&&e[s]-i<=i-e[r];)n[0]=++r,n[1]=s,++s}function DH(e,t,n,i){const r=e.length,s=[];let o=0,a=0,l=[],u;for(;o[g,e(g)],s=t[0],o=t[1],a=o-s,l=a/i,u=[r(s)],c=[];if(n===i){for(let g=1;g0;)c.push(r(s+g/n*a))}let f=u[0],d=c[c.length-1];const h=1/a,p=OH(f[1],c);for(;d;){const g=r((f[0]+d[0])/2);g[0]-f[0]>=l&&RH(f,g,d,h,p)>NH?c.push(g):(f=d,u.push(d),c.pop()),d=c[c.length-1]}return u}function OH(e,t){let n=e,i=e;const r=t.length;for(let s=0;si&&(i=o)}return 1/(i-n)}function RH(e,t,n,i,r){const s=Math.atan2(r*(n[1]-e[1]),i*(n[0]-e[0])),o=Math.atan2(r*(t[1]-e[1]),i*(t[0]-e[0]));return Math.abs(s-o)}function LH(e){return t=>{const n=e.length;let i=1,r=String(e[0](t));for(;i{},IH={init:vy,add:vy,rem:vy,idx:0},of={values:{init:e=>e.cell.store=!0,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.sum,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:void 0,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:void 0,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:void 0,req:["mean"],idx:1},variance:{init:e=>e.dev=0,value:e=>e.valid>1?e.dev/(e.valid-1):void 0,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:["mean"],idx:1},variancep:{value:e=>e.valid>1?e.dev/e.valid:void 0,req:["variance"],idx:2},stdev:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:e=>e.valid>1?Math.sqrt(e.dev/e.valid):void 0,req:["variance"],idx:2},stderr:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid*(e.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:e=>e.cell.data.distinct(e.get),req:["values"],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:["values"],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:["values"],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:["values"],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:["values"],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:["values"],idx:3},min:{init:e=>e.min=void 0,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{(t{t<=e.min&&(e.min=NaN)},req:["values"],idx:4},max:{init:e=>e.max=void 0,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{(t>e.max||e.max===void 0)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)},req:["values"],idx:4},argmin:{init:e=>e.argmin=void 0,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{t{t<=e.min&&(e.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:e=>e.argmax=void 0,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{t>e.max&&(e.argmax=n)},rem:(e,t)=>{t>=e.max&&(e.argmax=void 0)},req:["max","values"],idx:3},exponential:{init:(e,t)=>{e.exp=0,e.exp_r=t},value:e=>e.valid?e.exp*(1-e.exp_r)/(1-e.exp_r**e.valid):void 0,add:(e,t)=>e.exp=e.exp_r*e.exp+t,rem:(e,t)=>e.exp=(e.exp-t/e.exp_r**(e.valid-1))/e.exp_r},exponentialb:{value:e=>e.valid?e.exp*(1-e.exp_r):void 0,req:["exponential"],idx:1}},af=Object.keys(of).filter(e=>e!=="__count__");function zH(e,t){return(n,i)=>Fe({name:e,aggregate_param:i,out:n||e},IH,t)}[...af,"__count__"].forEach(e=>{of[e]=zH(e,of[e])});function vk(e,t,n){return of[e](n,t)}function xk(e,t){return e.idx-t.idx}function PH(e){const t={};e.forEach(i=>t[i.name]=i);const n=i=>{i.req&&i.req.forEach(r=>{t[r]||n(t[r]=of[r]())})};return e.forEach(n),Object.values(t).sort(xk)}function BH(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.aggregate_param==null?e.init(this):e.init(this,e.aggregate_param))}function jH(e,t){if(e==null||e===""){++this.missing;return}e===e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t)))}function UH(e,t){if(e==null||e===""){--this.missing;return}e===e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t)))}function qH(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function _k(e,t){const n=t||dn,i=PH(e),r=e.slice().sort(xk);function s(o){this._ops=i,this._out=r,this.cell=o,this.init()}return s.prototype.init=BH,s.prototype.add=jH,s.prototype.rem=UH,s.prototype.set=qH,s.prototype.get=n,s.fields=e.map(o=>o.out),s}function xy(e){this._key=e?Ti(e):ye,this.reset()}const rn=xy.prototype;rn.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},rn.add=function(e){this._add.push(e)},rn.rem=function(e){this._rem.push(e)},rn.values=function(){if(this._get=null,this._rem.length===0)return this._add;const e=this._add,t=this._rem,n=this._key,i=e.length,r=t.length,s=Array(i-r),o={};let a,l,u;for(a=0;a=0;)s=e(t[i])+"",me(n,s)||(n[s]=1,++r);return r},rn.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=r4(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext},rn.argmin=function(e){return this.extent(e)[0]||{}},rn.argmax=function(e){return this.extent(e)[1]||{}},rn.min=function(e){const t=this.extent(e)[0];return t!=null?e(t):void 0},rn.max=function(e){const t=this.extent(e)[1];return t!=null?e(t):void 0},rn.quartile=function(e){return(this._get!==e||!this._q)&&(this._q=ny(this.values(),e),this._get=e),this._q},rn.q1=function(e){return this.quartile(e)[0]},rn.q2=function(e){return this.quartile(e)[1]},rn.q3=function(e){return this.quartile(e)[2]},rn.ci=function(e){return(this._get!==e||!this._ci)&&(this._ci=sk(this.values(),1e3,.05,e),this._get=e),this._ci},rn.ci0=function(e){return this.ci(e)[0]},rn.ci1=function(e){return this.ci(e)[1]};function ho(e){z.call(this,null,e),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}ho.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:af},{name:"aggregate_params",type:"field",null:!0,array:!0,default:[null]},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]},K(ho,z,{transform(e,t){const n=this,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.modified();return n.stamp=i.stamp,n.value&&(r||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=r?n.init(e):Object.create(null),t.visit(t.SOURCE,s=>n.add(s))):(n.value=n.value||n.init(e),t.visit(t.REM,s=>n.rem(s)),t.visit(t.ADD,s=>n.add(s))),i.modifies(n._outputs),n._drop=e.drop!==!1,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&i.clean(!0).runAfter(()=>this.clean()),n.changes(i)},cross(){const e=this,t=e.value,n=e._dnames,i=n.map(()=>({})),r=n.length;function s(a){let l,u,c,f;for(l in a)for(c=a[l].tuple,u=0;u{const v=Et(b);return r(b),n.push(v),v}),this.cellkey=e.key?e.key:by(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const s=e.fields||[null],o=e.ops||["count"],a=e.aggregate_params||[null],l=e.as||[],u=s.length,c={};let f,d,h,p,g,m,y;for(u!==o.length&&U("Unmatched number of fields and aggregate ops."),y=0;y_k(b,b.field)),Object.create(null)},cellkey:by(),cell(e,t){let n=this.value[e];return n?n.num===0&&this._drop&&n.stamp{const f=i(c);c[a]=f,c[l]=f==null?null:r+s*(1+(f-r)/s)}:c=>c[a]=i(c)),t.modifies(n?o:a)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=rk(e),i=n.step;let r=n.start,s=r+Math.ceil((n.stop-r)/i)*i,o,a;(o=e.anchor)!=null&&(a=o-(r+i*Math.floor((o-r)/i)),r+=a,s+=a);const l=function(u){let c=hn(t(u));return c==null?null:cs?1/0:(c=Math.max(r,Math.min(c,s-i)),r+i*Math.floor(WH+(c-r)/i))};return l.start=r,l.stop=n.stop,l.step=i,this.value=Xn(l,fn(t),e.name||"bin_"+Et(t))}});function wk(e,t,n){const i=e;let r=t||[],s=n||[],o={},a=0;return{add:l=>s.push(l),remove:l=>o[i(l)]=++a,size:()=>r.length,data:(l,u)=>(a&&(r=r.filter(c=>!o[i(c)]),o={},a=0),u&&l&&r.sort(l),s.length&&(r=l?c4(l,r,s.sort(l)):r.concat(s),s=[]),r)}}function wy(e){z.call(this,[],e)}wy.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},K(wy,z,{transform(e,t){const n=t.fork(t.ALL),i=wk(ye,this.value,n.materialize(n.ADD).add),r=e.sort,s=t.changed()||r&&(e.modified("sort")||t.modified(r.fields));return n.visit(n.REM,i.remove),this.modified(s),this.value=n.source=i.data(xa(r),s),t.source&&t.source.root&&(this.value.root=t.source.root),n}});function kk(e){gt.call(this,null,HH,e)}K(kk,gt);function HH(e){return this.value&&!e.modified()?this.value:c2(e.fields,e.orders)}function ky(e){z.call(this,null,e)}ky.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]};function GH(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase();break}return e.match(n)}K(ky,z,{transform(e,t){const n=f=>d=>{for(var h=GH(a(d),e.case,s)||[],p,g=0,m=h.length;gr[f]=1+(r[f]||0)),c=n(f=>r[f]-=1);return i?t.visit(t.SOURCE,u):(t.visit(t.ADD,u),t.visit(t.REM,c)),this._finish(t,l)},_parameterCheck(e,t){let n=!1;return(e.modified("stopwords")||!this._stop)&&(this._stop=new RegExp("^"+(e.stopwords||"")+"$","i"),n=!0),(e.modified("pattern")||!this._match)&&(this._match=new RegExp(e.pattern||"[\\w']+","g"),n=!0),(e.modified("field")||t.modified(e.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(e,t){const n=this._counts,i=this._tuples||(this._tuples={}),r=t[0],s=t[1],o=e.fork(e.NO_SOURCE|e.NO_FIELDS);let a,l,u;for(a in n)l=i[a],u=n[a]||0,!l&&u?(i[a]=l=et({}),l[r]=a,l[s]=u,o.add.push(l)):u===0?(l&&o.rem.push(l),n[a]=null,i[a]=null):l[s]!==u&&(l[s]=u,o.mod.push(l));return o.modifies(t)}});function $y(e){z.call(this,null,e)}$y.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},K($y,z,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.as||["a","b"],r=i[0],s=i[1],o=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let a=this.value;return o?(a&&(n.rem=a),a=t.materialize(t.SOURCE).source,n.add=this.value=VH(a,r,s,e.filter||Mi)):n.mod=a,n.source=this.value,n.modifies(i)}});function VH(e,t,n,i){for(var r=[],s={},o=e.length,a=0,l,u;aCk(s,t))):typeof i[r]===Ek&&i[r](e[r]);return i}function Ey(e){z.call(this,null,e)}const Sk=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],ZH={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:Sk},{name:"weights",type:"number",array:!0}]};Ey.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:Sk.concat(ZH)},{name:"as",type:"string",array:!0,default:["value","density"]}]},K(Ey,z,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=Ck(e.distribution,KH(t)),r=e.steps||e.minsteps||25,s=e.steps||e.maxsteps||200;let o=e.method||"pdf";o!=="pdf"&&o!=="cdf"&&U("Invalid density method: "+o),!e.extent&&!i.data&&U("Missing density extent parameter."),o=i[o];const a=e.as||["value","density"],l=e.extent||Or(i.data()),u=pp(o,l,r,s).map(c=>{const f={};return f[a[0]]=c[0],f[a[1]]=c[1],et(f)});this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}});function KH(e){return()=>e.materialize(e.SOURCE).source}function Ak(e,t){return e?e.map((n,i)=>t[i]||Et(n)):null}function Cy(e,t,n){const i=[],r=f=>f(l);let s,o,a,l,u,c;if(t==null)i.push(e.map(n));else for(s={},o=0,a=e.length;oLc(Or(e,t))/30;K(Sy,z,{transform(e,t){if(this.value&&!(e.modified()||t.changed()))return t;const n=t.materialize(t.SOURCE).source,i=Cy(t.source,e.groupby,dn),r=e.smooth||!1,s=e.field,o=e.step||JH(n,s),a=xa((p,g)=>s(p)-s(g)),l=e.as||Tk,u=i.length;let c=1/0,f=-1/0,d=0,h;for(;df&&(f=g),p[++h][l]=g}return this.value={start:c,stop:f,step:o},t.reflow(!0).modifies(l)}});function Mk(e){gt.call(this,null,QH,e),this.modified(!0)}K(Mk,gt);function QH(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:Xn(n=>t(n,e),fn(t),Et(t))}function Ay(e){z.call(this,[void 0,void 0],e)}Ay.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},K(Ay,z,{transform(e,t){const n=this.value,i=e.field,r=t.changed()||t.modified(i.fields)||e.modified("field");let s=n[0],o=n[1];if((r||s==null)&&(s=1/0,o=-1/0),t.visit(r?t.SOURCE:t.ADD,a=>{const l=hn(i(a));l!=null&&(lo&&(o=l))}),!Number.isFinite(s)||!Number.isFinite(o)){let a=Et(i);a&&(a=` for field "${a}"`),t.dataflow.warn(`Infinite extent${a}: [${s}, ${o}]`),s=o=void 0}this.value=[s,o]}});function Ty(e,t){gt.call(this,e),this.parent=t,this.count=0}K(Ty,gt,{connect(e){return this.detachSubflow=e.detachSubflow,this.targets().add(e),e.source=this},add(e){this.count+=1,this.value.add.push(e)},rem(e){this.count-=1,this.value.rem.push(e)},mod(e){this.value.mod.push(e)},init(e){this.value.init(e,e.NO_SOURCE)},evaluate(){return this.value}});function gp(e){z.call(this,{},e),this._keys=Gl();const t=this._targets=[];t.active=0,t.forEach=n=>{for(let i=0,r=t.active;ii&&i.count>0);this.initTargets(n)}},initTargets(e){const t=this._targets,n=t.length,i=e?e.length:0;let r=0;for(;rthis.subflow(l,r,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,l=>{const u=ye(l),c=s.get(u);c!==void 0&&(s.delete(u),a(c).rem(l))}),t.visit(t.ADD,l=>{const u=i(l);s.set(ye(l),u),a(u).add(l)}),o||t.modified(i.fields)?t.visit(t.MOD,l=>{const u=ye(l),c=s.get(u),f=i(l);c===f?a(f).mod(l):(s.set(u,f),a(c).rem(l),a(f).add(l))}):t.changed(t.MOD)&&t.visit(t.MOD,l=>{a(s.get(ye(l))).mod(l)}),o&&t.visit(t.REFLOW,l=>{const u=ye(l),c=s.get(u),f=i(l);c!==f&&(s.set(u,f),a(c).rem(l),a(f).add(l))}),t.clean()?n.runAfter(()=>{this.clean(),s.clean()}):s.empty>n.cleanThreshold&&n.runAfter(s.clean),t}});function Fk(e){gt.call(this,null,eG,e)}K(Fk,gt);function eG(e){return this.value&&!e.modified()?this.value:q(e.name)?ee(e.name).map(t=>Ti(t)):Ti(e.name,e.as)}function My(e){z.call(this,Gl(),e)}My.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},K(My,z,{transform(e,t){const n=t.dataflow,i=this.value,r=t.fork(),s=r.add,o=r.rem,a=r.mod,l=e.expr;let u=!0;t.visit(t.REM,f=>{const d=ye(f);i.has(d)?i.delete(d):o.push(f)}),t.visit(t.ADD,f=>{l(f,e)?s.push(f):i.set(ye(f),1)});function c(f){const d=ye(f),h=l(f,e),p=i.get(d);h&&p?(i.delete(d),s.push(f)):!h&&!p?(i.set(d,1),o.push(f)):u&&h&&!p&&a.push(f)}return t.visit(t.MOD,c),e.modified()&&(u=!1,t.visit(t.REFLOW,c)),i.empty>n.cleanThreshold&&n.runAfter(i.clean),r}});function Fy(e){z.call(this,[],e)}Fy.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]},K(Fy,z,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=Ak(i,e.as||[]),s=e.index||null,o=r.length;return n.rem=this.value,t.visit(t.SOURCE,a=>{const l=i.map(p=>p(a)),u=l.reduce((p,g)=>Math.max(p,g.length),0);let c=0,f,d,h;for(;c{for(let c=0,f;co[i]=n(o,e))}});function Dk(e){z.call(this,[],e)}K(Dk,z,{transform(e,t){const n=t.fork(t.ALL),i=e.generator;let r=this.value,s=e.size-r.length,o,a,l;if(s>0){for(o=[];--s>=0;)o.push(l=et(i(e))),r.push(l);n.add=n.add.length?n.materialize(n.ADD).add.concat(o):o}else a=r.slice(0,-s),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(a):a,r=r.slice(-s);return n.source=this.value=r,n}});const mp={value:"value",median:S4,mean:LU,min:w2,max:ga},tG=[];function Oy(e){z.call(this,[],e)}Oy.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]};function nG(e){var t=e.method||mp.value,n;if(mp[t]==null)U("Unrecognized imputation method: "+t);else return t===mp.value?(n=e.value!==void 0?e.value:0,()=>n):mp[t]}function iG(e){const t=e.field;return n=>n?t(n):NaN}K(Oy,z,{transform(e,t){var n=t.fork(t.ALL),i=nG(e),r=iG(e),s=Et(e.field),o=Et(e.key),a=(e.groupby||[]).map(Et),l=rG(t.source,e.groupby,e.key,e.keyvals),u=[],c=this.value,f=l.domain.length,d,h,p,g,m,y,b,v,x,_;for(m=0,v=l.length;my(m),s=[],o=i?i.slice():[],a={},l={},u,c,f,d,h,p,g,m;for(o.forEach((y,b)=>a[y]=b+1),d=0,g=e.length;dn.add(s))):(r=n.value=n.value||this.init(e),t.visit(t.REM,s=>n.rem(s)),t.visit(t.ADD,s=>n.add(s))),n.changes(),t.visit(t.SOURCE,s=>{Fe(s,r[n.cellkey(s)].tuple)}),t.reflow(i).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,i;for(n=0,i=this._alen;n{const p=oy(h,o)[a],g=e.counts?h.length:1,m=c||Or(h);pp(p,m,f,d).forEach(y=>{const b={};for(let v=0;v(this._pending=ee(r.data),s=>s.touch(this)))}:n.request(e.url,e.format).then(i=>Iy(this,t,ee(i.data)))}});function oG(e){return e.modified("async")&&!(e.modified("values")||e.modified("url")||e.modified("format"))}function Iy(e,t,n){n.forEach(et);const i=t.fork(t.NO_FIELDS&t.NO_SOURCE);return i.rem=e.value,e.value=i.source=i.add=n,e._pending=null,i.rem.length&&i.clean(!0),i}function zy(e){z.call(this,{},e)}zy.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]},K(zy,z,{transform(e,t){const n=e.fields,i=e.index,r=e.values,s=e.default==null?null:e.default,o=e.modified(),a=n.length;let l=o?t.SOURCE:t.ADD,u=t,c=e.as,f,d,h;return r?(d=r.length,a>1&&!c&&U('Multi-field lookup requires explicit "as" parameter.'),c&&c.length!==a*d&&U('The "as" parameter has too few output field names.'),c=c||r.map(Et),f=function(p){for(var g=0,m=0,y,b;gt.modified(p.fields)),l|=h?t.MOD:0),t.visit(l,f),u.modifies(c)}});function Rk(e){gt.call(this,null,aG,e)}K(Rk,gt);function aG(e){if(this.value&&!e.modified())return this.value;const t=e.extents,n=t.length;let i=1/0,r=-1/0,s,o;for(s=0;sr&&(r=o[1]);return[i,r]}function Lk(e){gt.call(this,null,lG,e)}K(Lk,gt);function lG(e){return this.value&&!e.modified()?this.value:e.values.reduce((t,n)=>t.concat(n),[])}function Ik(e){z.call(this,null,e)}K(Ik,z,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function Py(e){ho.call(this,e)}Py.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:af,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]},K(Py,ho,{_transform:ho.prototype.transform,transform(e,t){return this._transform(uG(e,t),t)}});function uG(e,t){const n=e.field,i=e.value,r=(e.op==="count"?"__count__":e.op)||"sum",s=fn(n).concat(fn(i)),o=fG(n,e.limit||0,t);return t.changed()&&e.set("__pivot__",null,null,!0),{key:e.key,groupby:e.groupby,ops:o.map(()=>r),fields:o.map(a=>cG(a,n,i,s)),as:o.map(a=>a+""),modified:e.modified.bind(e)}}function cG(e,t,n,i){return Xn(r=>t(r)===e?n(r):NaN,i,e+"")}function fG(e,t,n){const i={},r=[];return n.visit(n.SOURCE,s=>{const o=e(s);i[o]||(i[o]=1,r.push(o))}),r.sort(Lh),t?r.slice(0,t):r}function zk(e){gp.call(this,e)}K(zk,gp,{transform(e,t){const n=e.subflow,i=e.field,r=s=>this.subflow(ye(s),n,t,s);return(e.modified("field")||i&&t.modified(fn(i)))&&U("PreFacet does not support field modification."),this.initTargets(),i?(t.visit(t.MOD,s=>{const o=r(s);i(s).forEach(a=>o.mod(a))}),t.visit(t.ADD,s=>{const o=r(s);i(s).forEach(a=>o.add(et(a)))}),t.visit(t.REM,s=>{const o=r(s);i(s).forEach(a=>o.rem(a))})):(t.visit(t.MOD,s=>r(s).mod(s)),t.visit(t.ADD,s=>r(s).add(s)),t.visit(t.REM,s=>r(s).rem(s))),t.clean()&&t.runAfter(()=>this.clean()),t}});function By(e){z.call(this,null,e)}By.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},K(By,z,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=Ak(e.fields,e.as||[]),s=i?(a,l)=>dG(a,l,i,r):rp;let o;return this.value?o=this.value:(t=t.addAll(),o=this.value={}),t.visit(t.REM,a=>{const l=ye(a);n.rem.push(o[l]),o[l]=null}),t.visit(t.ADD,a=>{const l=s(a,et({}));o[ye(a)]=l,n.add.push(l)}),t.visit(t.MOD,a=>{n.mod.push(s(a,o[ye(a)]))}),n}});function dG(e,t,n,i){for(let r=0,s=n.length;r{const d=ty(f,u);for(let h=0;h{const s=ye(r);n.rem.push(i[s]),i[s]=null}),t.visit(t.ADD,r=>{const s=K2(r);i[ye(r)]=s,n.add.push(s)}),t.visit(t.MOD,r=>{const s=i[ye(r)];for(const o in r)s[o]=r[o],n.modifies(o);n.mod.push(s)})),n}});function Uy(e){z.call(this,[],e),this.count=0}Uy.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},K(Uy,z,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.modified("size"),r=e.size,s=this.value.reduce((c,f)=>(c[ye(f)]=1,c),{});let o=this.value,a=this.count,l=0;function u(c){let f,d;o.length=l&&(f=o[d],s[ye(f)]&&n.rem.push(f),o[d]=c)),++a}if(t.rem.length&&(t.visit(t.REM,c=>{const f=ye(c);s[f]&&(s[f]=-1,n.rem.push(c)),--a}),o=o.filter(c=>s[ye(c)]!==-1)),(t.rem.length||i)&&o.length{s[ye(c)]||u(c)}),l=-1),i&&o.length>r){const c=o.length-r;for(let f=0;f{s[ye(c)]&&n.mod.push(c)}),t.add.length&&t.visit(t.ADD,u),(t.add.length||l<0)&&(n.add=o.filter(c=>!s[ye(c)])),this.count=a,this.value=n.source=o,n}});function qy(e){z.call(this,null,e)}qy.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]},K(qy,z,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),i=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=hi(e.start,e.stop,e.step||1).map(r=>{const s={};return s[i]=r,et(s)}),n.add=t.add.concat(this.value),n}});function jk(e){z.call(this,null,e),this.modified(!0)}K(jk,z,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function Wy(e){z.call(this,null,e)}const Uk=["unit0","unit1"];Wy.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:M2,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:Uk}]},K(Wy,z,{transform(e,t){const n=e.field,i=e.interval!==!1,r=e.timezone==="utc",s=this._floor(e,t),o=(r?iu:nu)(s.unit).offset,a=e.as||Uk,l=a[0],u=a[1],c=s.step;let f=s.start||1/0,d=s.stop||-1/0,h=t.ADD;return(e.modified()||t.changed(t.REM)||t.modified(fn(n)))&&(t=t.reflow(!0),h=t.SOURCE,f=1/0,d=-1/0),t.visit(h,p=>{const g=n(p);let m,y;g==null?(p[l]=null,i&&(p[u]=null)):(p[l]=m=y=s(g),i&&(p[u]=y=o(m,c)),md&&(d=y))}),s.start=f,s.stop=d,t.modifies(i?a:l)},_floor(e,t){const n=e.timezone==="utc",{units:i,step:r}=e.units?{units:e.units,step:e.step||1}:u8({extent:e.extent||Or(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),s=D2(i),o=this.value||{},a=(n?J4:K4)(s,r);return a.unit=Ue(s),a.units=s,a.step=r,a.start=o.start,a.stop=o.stop,this.value=a}});function qk(e){z.call(this,Gl(),e)}K(qk,z,{transform(e,t){const n=t.dataflow,i=e.field,r=this.value,s=a=>r.set(i(a),a);let o=!0;return e.modified("field")||t.modified(i.fields)?(r.clear(),t.visit(t.SOURCE,s)):t.changed()?(t.visit(t.REM,a=>r.delete(i(a))),t.visit(t.ADD,s)):o=!1,this.modified(o),r.empty>n.cleanThreshold&&n.runAfter(r.clean),t.fork()}});function Wk(e){z.call(this,null,e)}K(Wk,z,{transform(e,t){(!this.value||e.modified("field")||e.modified("sort")||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(xa(e.sort)):t.source).map(e.field))}});function pG(e,t,n,i){const r=lf[e](t,n);return{init:r.init||no,update:function(s,o){o[i]=r.next(s)}}}const lf={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?++e:e}}},percent_rank:function(){const e=lf.rank(),t=e.next;return{init:e.init,next:n=>(t(n)-1)/(n.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{const n=t.data,i=t.compare;let r=t.index;if(e0||U("ntile num must be greater than zero.");const n=lf.cume_dist(),i=n.next;return{init:n.init,next:r=>Math.ceil(t*i(r))}},lag:function(e,t){return t=+t||1,{next:n=>{const i=n.index-t;return i>=0?e(n.data[i]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{const i=n.index+t,r=n.data;return ie(t.data[t.i0])}},last_value:function(e){return{next:t=>e(t.data[t.i1-1])}},nth_value:function(e,t){return t=+t,t>0||U("nth_value nth must be greater than zero."),{next:n=>{const i=n.i0+(t-1);return it=null,next:n=>{const i=e(n.data[n.index]);return i!=null?t=i:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:i=>{const r=i.data;return i.index<=n?t:(n=gG(e,r,i.index))<0?(n=r.length,t=null):t=e(r[n])}}}};function gG(e,t,n){for(let i=t.length;nl[g]=1)}h(e.sort),t.forEach((p,g)=>{const m=n[g],y=i[g],b=r[g]||null,v=Et(m),x=bk(p,v,s[g]);if(h(m),o.push(x),me(lf,p))a.push(pG(p,m,y,x));else{if(m==null&&p!=="count"&&U("Null aggregate field specified."),p==="count"){c.push(x);return}d=!1;let _=u[v];_||(_=u[v]=[],_.field=m,f.push(_)),_.push(vk(p,b,x))}}),(c.length||f.length)&&(this.cell=yG(f,c,d)),this.inputs=Object.keys(l)}const Gk=Hk.prototype;Gk.init=function(){this.windows.forEach(e=>e.init()),this.cell&&this.cell.init()},Gk.update=function(e,t){const n=this.cell,i=this.windows,r=e.data,s=i&&i.length;let o;if(n){for(o=e.p0;o_k(l,l.field));const i={num:0,agg:null,store:!1,count:t};if(!n)for(var r=e.length,s=i.agg=Array(r),o=0;othis.group(r(a));let o=this.state;(!o||n)&&(o=this.state=new Hk(e)),n||t.modified(o.inputs)?(this.value={},t.visit(t.SOURCE,a=>s(a).add(a))):(t.visit(t.REM,a=>s(a).remove(a)),t.visit(t.ADD,a=>s(a).add(a)));for(let a=0,l=this._mlen;a0&&!r(s[n],s[n-1])&&(e.i0=t.left(s,s[n])),i1?0:e<-1?uu:Math.acos(e)}function Yk(e){return e>=1?yp:e<=-1?-yp:Math.asin(e)}const Vy=Math.PI,Xy=2*Vy,$a=1e-6,$G=Xy-$a;function Zk(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Zk;const n=10**t;return function(i){this._+=i[0];for(let r=1,s=i.length;r$a)if(!(Math.abs(f*l-u*c)>$a)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let h=i-o,p=r-a,g=l*l+u*u,m=h*h+p*p,y=Math.sqrt(g),b=Math.sqrt(d),v=s*Math.tan((Vy-Math.acos((g+d-m)/(2*y*b)))/2),x=v/b,_=v/y;Math.abs(x-1)>$a&&this._append`L${t+x*c},${n+x*f}`,this._append`A${s},${s},0,0,${+(f*h>c*p)},${this._x1=t+_*l},${this._y1=n+_*u}`}}arc(t,n,i,r,s,o){if(t=+t,n=+n,i=+i,o=!!o,i<0)throw new Error(`negative radius: ${i}`);let a=i*Math.cos(r),l=i*Math.sin(r),u=t+a,c=n+l,f=1^o,d=o?r-s:s-r;this._x1===null?this._append`M${u},${c}`:(Math.abs(this._x1-u)>$a||Math.abs(this._y1-c)>$a)&&this._append`L${u},${c}`,i&&(d<0&&(d=d%Xy+Xy),d>$G?this._append`A${i},${i},0,1,${f},${t-a},${n-l}A${i},${i},0,1,${f},${this._x1=u},${this._y1=c}`:d>$a&&this._append`A${i},${i},0,${+(d>=Vy)},${f},${this._x1=t+i*Math.cos(s)},${this._y1=n+i*Math.sin(s)}`)}rect(t,n,i,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${i=+i}v${+r}h${-i}Z`}toString(){return this._}};function bp(){return new Yy}bp.prototype=Yy.prototype;function vp(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const i=Math.floor(n);if(!(i>=0))throw new RangeError(`invalid digits: ${n}`);t=i}return e},()=>new Yy(t)}function CG(e){return e.innerRadius}function SG(e){return e.outerRadius}function AG(e){return e.startAngle}function TG(e){return e.endAngle}function MG(e){return e&&e.padAngle}function FG(e,t,n,i,r,s,o,a){var l=n-e,u=i-t,c=o-r,f=a-s,d=f*l-c*u;if(!(d*dM*M+T*T&&($=E,S=A),{cx:$,cy:S,x01:-c,y01:-f,x11:$*(r/_-1),y11:S*(r/_-1)}}function DG(){var e=CG,t=SG,n=nt(0),i=null,r=AG,s=TG,o=MG,a=null,l=vp(u);function u(){var c,f,d=+e.apply(this,arguments),h=+t.apply(this,arguments),p=r.apply(this,arguments)-yp,g=s.apply(this,arguments)-yp,m=Vk(g-p),y=g>p;if(a||(a=c=l()),hbn))a.moveTo(0,0);else if(m>Xk-bn)a.moveTo(h*wa(p),h*Pr(p)),a.arc(0,0,h,p,g,!y),d>bn&&(a.moveTo(d*wa(g),d*Pr(g)),a.arc(0,0,d,g,p,y));else{var b=p,v=g,x=p,_=g,k=m,w=m,$=o.apply(this,arguments)/2,S=$>bn&&(i?+i.apply(this,arguments):ka(d*d+h*h)),E=Gy(Vk(h-d)/2,+n.apply(this,arguments)),A=E,R=E,C,M;if(S>bn){var T=Yk(S/d*Pr($)),O=Yk(S/h*Pr($));(k-=T*2)>bn?(T*=y?1:-1,x+=T,_-=T):(k=0,x=_=(p+g)/2),(w-=O*2)>bn?(O*=y?1:-1,b+=O,v-=O):(w=0,b=v=(p+g)/2)}var P=h*wa(b),j=h*Pr(b),W=d*wa(_),ne=d*Pr(_);if(E>bn){var ae=h*wa(v),ke=h*Pr(v),ze=d*wa(x),Ie=d*Pr(x),We;if(mbn?R>bn?(C=xp(ze,Ie,P,j,h,R,y),M=xp(ae,ke,W,ne,h,R,y),a.moveTo(C.cx+C.x01,C.cy+C.y01),Rbn)||!(k>bn)?a.lineTo(W,ne):A>bn?(C=xp(W,ne,ae,ke,d,-A,y),M=xp(P,j,ze,Ie,d,-A,y),a.lineTo(C.cx+C.x01,C.cy+C.y01),A=h;--p)a.point(v[p],x[p]);a.lineEnd(),a.areaEnd()}y&&(v[d]=+e(m,d,f),x[d]=+t(m,d,f),a.point(i?+i(m,d,f):v[d],n?+n(m,d,f):x[d]))}if(b)return a=null,b+""||null}function c(){return t9().defined(r).curve(o).context(s)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:nt(+f),i=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:nt(+f),u):e},u.x1=function(f){return arguments.length?(i=f==null?null:typeof f=="function"?f:nt(+f),u):i},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:nt(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:nt(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:nt(+f),u):n},u.lineX0=u.lineY0=function(){return c().x(e).y(t)},u.lineY1=function(){return c().x(e).y(n)},u.lineX1=function(){return c().x(i).y(t)},u.defined=function(f){return arguments.length?(r=typeof f=="function"?f:nt(!!f),u):r},u.curve=function(f){return arguments.length?(o=f,s!=null&&(a=o(s)),u):o},u.context=function(f){return arguments.length?(f==null?s=a=null:a=o(s=f),u):s},u}const NG={draw(e,t){const n=ka(t/uu);e.moveTo(n,0),e.arc(0,0,n,0,Xk)}};function OG(e,t){let n=null,i=vp(r);e=typeof e=="function"?e:nt(e||NG),t=typeof t=="function"?t:nt(t===void 0?64:+t);function r(){let s;if(n||(n=s=i()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),s)return n=null,s+""||null}return r.type=function(s){return arguments.length?(e=typeof s=="function"?s:nt(s),r):e},r.size=function(s){return arguments.length?(t=typeof s=="function"?s:nt(+s),r):t},r.context=function(s){return arguments.length?(n=s??null,r):n},r}function po(){}function _p(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function wp(e){this._context=e}wp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:_p(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:_p(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function RG(e){return new wp(e)}function i9(e){this._context=e}i9.prototype={areaStart:po,areaEnd:po,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:_p(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function LG(e){return new i9(e)}function r9(e){this._context=e}r9.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:_p(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function IG(e){return new r9(e)}function s9(e,t){this._basis=new wp(e),this._beta=t}s9.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var i=e[0],r=t[0],s=e[n]-i,o=t[n]-r,a=-1,l;++a<=n;)l=a/n,this._basis.point(this._beta*e[a]+(1-this._beta)*(i+l*s),this._beta*t[a]+(1-this._beta)*(r+l*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const zG=function e(t){function n(i){return t===1?new wp(i):new s9(i,t)}return n.beta=function(i){return e(+i)},n}(.85);function kp(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function Ky(e,t){this._context=e,this._k=(1-t)/6}Ky.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:kp(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:kp(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const PG=function e(t){function n(i){return new Ky(i,t)}return n.tension=function(i){return e(+i)},n}(0);function Jy(e,t){this._context=e,this._k=(1-t)/6}Jy.prototype={areaStart:po,areaEnd:po,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:kp(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const BG=function e(t){function n(i){return new Jy(i,t)}return n.tension=function(i){return e(+i)},n}(0);function Qy(e,t){this._context=e,this._k=(1-t)/6}Qy.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:kp(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const jG=function e(t){function n(i){return new Qy(i,t)}return n.tension=function(i){return e(+i)},n}(0);function eb(e,t,n){var i=e._x1,r=e._y1,s=e._x2,o=e._y2;if(e._l01_a>bn){var a=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,r=(r*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>bn){var u=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*u+e._x1*e._l23_2a-t*e._l12_2a)/c,o=(o*u+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(i,r,s,o,e._x2,e._y2)}function o9(e,t){this._context=e,this._alpha=t}o9.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:eb(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const UG=function e(t){function n(i){return t?new o9(i,t):new Ky(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function a9(e,t){this._context=e,this._alpha=t}a9.prototype={areaStart:po,areaEnd:po,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:eb(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const qG=function e(t){function n(i){return t?new a9(i,t):new Jy(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function l9(e,t){this._context=e,this._alpha=t}l9.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:eb(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const WG=function e(t){function n(i){return t?new l9(i,t):new Qy(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function u9(e){this._context=e}u9.prototype={areaStart:po,areaEnd:po,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function HG(e){return new u9(e)}function c9(e){return e<0?-1:1}function f9(e,t,n){var i=e._x1-e._x0,r=t-e._x1,s=(e._y1-e._y0)/(i||r<0&&-0),o=(n-e._y1)/(r||i<0&&-0),a=(s*r+o*i)/(i+r);return(c9(s)+c9(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(a))||0}function d9(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function tb(e,t,n){var i=e._x0,r=e._y0,s=e._x1,o=e._y1,a=(s-i)/3;e._context.bezierCurveTo(i+a,r+a*t,s-a,o-a*n,s,o)}function $p(e){this._context=e}$p.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:tb(this,this._t0,d9(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,tb(this,d9(this,n=f9(this,e,t)),n);break;default:tb(this,this._t0,n=f9(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function h9(e){this._context=new p9(e)}(h9.prototype=Object.create($p.prototype)).point=function(e,t){$p.prototype.point.call(this,t,e)};function p9(e){this._context=e}p9.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,i,r,s){this._context.bezierCurveTo(t,e,i,n,s,r)}};function GG(e){return new $p(e)}function VG(e){return new h9(e)}function g9(e){this._context=e}g9.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var i=m9(e),r=m9(t),s=0,o=1;o=0;--t)r[t]=(o[t]-r[t+1])/s[t];for(s[n-1]=(e[n]+r[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function YG(e){return new Ep(e,.5)}function ZG(e){return new Ep(e,0)}function KG(e){return new Ep(e,1)}function go(e,t){if(typeof document<"u"&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext)return n.width=e,n.height=t,n}return null}const JG=()=>typeof Image<"u"?Image:null;function Br(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function mo(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const nb=Symbol("implicit");function ib(){var e=new x4,t=[],n=[],i=nb;function r(s){let o=e.get(s);if(o===void 0){if(i!==nb)return i;e.set(s,o=t.push(s)-1)}return n[o%n.length]}return r.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new x4;for(const o of s)e.has(o)||e.set(o,t.push(o)-1);return r},r.range=function(s){return arguments.length?(n=Array.from(s),r):n.slice()},r.unknown=function(s){return arguments.length?(i=s,r):i},r.copy=function(){return ib(t,n).unknown(i)},Br.apply(r,arguments),r}function cu(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function uf(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function yo(){}var Ea=.7,fu=1/Ea,du="\\s*([+-]?\\d+)\\s*",cf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",jr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",QG=/^#([0-9a-f]{3,8})$/,eV=new RegExp(`^rgb\\(${du},${du},${du}\\)$`),tV=new RegExp(`^rgb\\(${jr},${jr},${jr}\\)$`),nV=new RegExp(`^rgba\\(${du},${du},${du},${cf}\\)$`),iV=new RegExp(`^rgba\\(${jr},${jr},${jr},${cf}\\)$`),rV=new RegExp(`^hsl\\(${cf},${jr},${jr}\\)$`),sV=new RegExp(`^hsla\\(${cf},${jr},${jr},${cf}\\)$`),y9={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};cu(yo,ff,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:b9,formatHex:b9,formatHex8:oV,formatHsl:aV,formatRgb:v9,toString:v9});function b9(){return this.rgb().formatHex()}function oV(){return this.rgb().formatHex8()}function aV(){return $9(this).formatHsl()}function v9(){return this.rgb().formatRgb()}function ff(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=QG.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?x9(t):n===3?new Ht(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Cp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Cp(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=eV.exec(e))?new Ht(t[1],t[2],t[3],1):(t=tV.exec(e))?new Ht(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=nV.exec(e))?Cp(t[1],t[2],t[3],t[4]):(t=iV.exec(e))?Cp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=rV.exec(e))?k9(t[1],t[2]/100,t[3]/100,1):(t=sV.exec(e))?k9(t[1],t[2]/100,t[3]/100,t[4]):y9.hasOwnProperty(e)?x9(y9[e]):e==="transparent"?new Ht(NaN,NaN,NaN,0):null}function x9(e){return new Ht(e>>16&255,e>>8&255,e&255,1)}function Cp(e,t,n,i){return i<=0&&(e=t=n=NaN),new Ht(e,t,n,i)}function rb(e){return e instanceof yo||(e=ff(e)),e?(e=e.rgb(),new Ht(e.r,e.g,e.b,e.opacity)):new Ht}function bo(e,t,n,i){return arguments.length===1?rb(e):new Ht(e,t,n,i??1)}function Ht(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}cu(Ht,bo,uf(yo,{brighter(e){return e=e==null?fu:Math.pow(fu,e),new Ht(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ea:Math.pow(Ea,e),new Ht(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ht(Ca(this.r),Ca(this.g),Ca(this.b),Sp(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:_9,formatHex:_9,formatHex8:lV,formatRgb:w9,toString:w9}));function _9(){return`#${Sa(this.r)}${Sa(this.g)}${Sa(this.b)}`}function lV(){return`#${Sa(this.r)}${Sa(this.g)}${Sa(this.b)}${Sa((isNaN(this.opacity)?1:this.opacity)*255)}`}function w9(){const e=Sp(this.opacity);return`${e===1?"rgb(":"rgba("}${Ca(this.r)}, ${Ca(this.g)}, ${Ca(this.b)}${e===1?")":`, ${e})`}`}function Sp(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ca(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Sa(e){return e=Ca(e),(e<16?"0":"")+e.toString(16)}function k9(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Qi(e,t,n,i)}function $9(e){if(e instanceof Qi)return new Qi(e.h,e.s,e.l,e.opacity);if(e instanceof yo||(e=ff(e)),!e)return new Qi;if(e instanceof Qi)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),s=Math.max(t,n,i),o=NaN,a=s-r,l=(s+r)/2;return a?(t===s?o=(n-i)/a+(n0&&l<1?0:o,new Qi(o,a,l,e.opacity)}function Ap(e,t,n,i){return arguments.length===1?$9(e):new Qi(e,t,n,i??1)}function Qi(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}cu(Qi,Ap,uf(yo,{brighter(e){return e=e==null?fu:Math.pow(fu,e),new Qi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ea:Math.pow(Ea,e),new Qi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new Ht(sb(e>=240?e-240:e+120,r,i),sb(e,r,i),sb(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new Qi(E9(this.h),Tp(this.s),Tp(this.l),Sp(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Sp(this.opacity);return`${e===1?"hsl(":"hsla("}${E9(this.h)}, ${Tp(this.s)*100}%, ${Tp(this.l)*100}%${e===1?")":`, ${e})`}`}}));function E9(e){return e=(e||0)%360,e<0?e+360:e}function Tp(e){return Math.max(0,Math.min(1,e||0))}function sb(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const C9=Math.PI/180,S9=180/Math.PI,Mp=18,A9=.96422,T9=1,M9=.82521,F9=4/29,hu=6/29,D9=3*hu*hu,uV=hu*hu*hu;function N9(e){if(e instanceof Ur)return new Ur(e.l,e.a,e.b,e.opacity);if(e instanceof $s)return O9(e);e instanceof Ht||(e=rb(e));var t=ub(e.r),n=ub(e.g),i=ub(e.b),r=ob((.2225045*t+.7168786*n+.0606169*i)/T9),s,o;return t===n&&n===i?s=o=r:(s=ob((.4360747*t+.3850649*n+.1430804*i)/A9),o=ob((.0139322*t+.0971045*n+.7141733*i)/M9)),new Ur(116*r-16,500*(s-r),200*(r-o),e.opacity)}function Fp(e,t,n,i){return arguments.length===1?N9(e):new Ur(e,t,n,i??1)}function Ur(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}cu(Ur,Fp,uf(yo,{brighter(e){return new Ur(this.l+Mp*(e??1),this.a,this.b,this.opacity)},darker(e){return new Ur(this.l-Mp*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=A9*ab(t),e=T9*ab(e),n=M9*ab(n),new Ht(lb(3.1338561*t-1.6168667*e-.4906146*n),lb(-.9787684*t+1.9161415*e+.033454*n),lb(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function ob(e){return e>uV?Math.pow(e,1/3):e/D9+F9}function ab(e){return e>hu?e*e*e:D9*(e-F9)}function lb(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function ub(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function cV(e){if(e instanceof $s)return new $s(e.h,e.c,e.l,e.opacity);if(e instanceof Ur||(e=N9(e)),e.a===0&&e.b===0)return new $s(NaN,0=1?(n=1,t-1):Math.floor(n*t),r=e[i],s=e[i+1],o=i>0?e[i-1]:2*r-s,a=i()=>e;function U9(e,t){return function(n){return e+n*t}}function dV(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function Rp(e,t){var n=t-e;return n?U9(e,n>180||n<-180?n-360*Math.round(n/360):n):Op(isNaN(e)?t:e)}function hV(e){return(e=+e)==1?Gt:function(t,n){return n-t?dV(t,n,e):Op(isNaN(t)?n:t)}}function Gt(e,t){var n=t-e;return n?U9(e,n):Op(isNaN(e)?t:e)}const hb=function e(t){var n=hV(t);function i(r,s){var o=n((r=bo(r)).r,(s=bo(s)).r),a=n(r.g,s.g),l=n(r.b,s.b),u=Gt(r.opacity,s.opacity);return function(c){return r.r=o(c),r.g=a(c),r.b=l(c),r.opacity=u(c),r+""}}return i.gamma=e,i}(1);function q9(e){return function(t){var n=t.length,i=new Array(n),r=new Array(n),s=new Array(n),o,a;for(o=0;on&&(s=t.slice(n,s),a[o]?a[o]+=s:a[++o]=s),(i=i[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,l.push({i:o,x:er(i,r)})),n=mb.lastIndex;return n180?c+=360:c-u>180&&(u+=360),d.push({i:f.push(r(f)+"rotate(",null,i)-2,x:er(u,c)})):c&&f.push(r(f)+"rotate("+c+i)}function a(u,c,f,d){u!==c?d.push({i:f.push(r(f)+"skewX(",null,i)-2,x:er(u,c)}):c&&f.push(r(f)+"skewX("+c+i)}function l(u,c,f,d,h,p){if(u!==f||c!==d){var g=h.push(r(h)+"scale(",null,",",null,")");p.push({i:g-4,x:er(u,f)},{i:g-2,x:er(c,d)})}else(f!==1||d!==1)&&h.push(r(h)+"scale("+f+","+d+")")}return function(u,c){var f=[],d=[];return u=e(u),c=e(c),s(u.translateX,u.translateY,c.translateX,c.translateY,f,d),o(u.rotate,c.rotate,f,d),a(u.skewX,c.skewX,f,d),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,f,d),u=c=null,function(h){for(var p=-1,g=d.length,m;++pt&&(n=e,e=t,t=n),function(i){return Math.max(e,Math.min(t,i))}}function BV(e,t,n){var i=e[0],r=e[1],s=t[0],o=t[1];return r2?jV:BV,l=u=null,f}function f(d){return d==null||isNaN(d=+d)?s:(l||(l=a(e.map(i),t,n)))(i(o(d)))}return f.invert=function(d){return o(r((u||(u=a(t,e.map(i),er)))(d)))},f.domain=function(d){return arguments.length?(e=Array.from(d,vb),c()):e.slice()},f.range=function(d){return arguments.length?(t=Array.from(d),c()):t.slice()},f.rangeRound=function(d){return t=Array.from(d),n=hf,c()},f.clamp=function(d){return arguments.length?(o=d?!0:Jn,c()):o!==Jn},f.interpolate=function(d){return arguments.length?(n=d,c()):n},f.unknown=function(d){return arguments.length?(s=d,f):s},function(d,h){return i=d,r=h,c()}}function i$(){return Ip()(Jn,Jn)}function r$(e,t,n,i){var r=ao(e,t,n),s;switch(i=ma(i??",f"),i.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return i.precision==null&&!isNaN(s=z4(r,o))&&(i.precision=s),E2(i,o)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(s=P4(r,Math.max(Math.abs(e),Math.abs(t))))&&(i.precision=s-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(s=I4(r))&&(i.precision=s-(i.type==="%")*2);break}}return qh(i)}function Ta(e){var t=e.domain;return e.ticks=function(n){var i=t();return x2(i[0],i[i.length-1],n??10)},e.tickFormat=function(n,i){var r=t();return r$(r[0],r[r.length-1],n??10,i)},e.nice=function(n){n==null&&(n=10);var i=t(),r=0,s=i.length-1,o=i[r],a=i[s],l,u,c=10;for(a0;){if(u=_2(o,a,n),u===l)return i[r]=o,i[s]=a,t(i);if(u>0)o=Math.floor(o/u)*u,a=Math.ceil(a/u)*u;else if(u<0)o=Math.ceil(o*u)/u,a=Math.floor(a*u)/u;else break;l=u}return e},e}function s$(){var e=i$();return e.copy=function(){return pf(e,s$())},Br.apply(e,arguments),Ta(e)}function o$(e){var t;function n(i){return i==null||isNaN(i=+i)?t:i}return n.invert=n,n.domain=n.range=function(i){return arguments.length?(e=Array.from(i,vb),n):e.slice()},n.unknown=function(i){return arguments.length?(t=i,n):t},n.copy=function(){return o$(e).unknown(t)},e=arguments.length?Array.from(e,vb):[0,1],Ta(n)}function a$(e,t){e=e.slice();var n=0,i=e.length-1,r=e[n],s=e[i],o;return sMath.pow(e,t)}function GV(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function c$(e){return(t,n)=>-e(-t,n)}function _b(e){const t=e(l$,u$),n=t.domain;let i=10,r,s;function o(){return r=GV(i),s=HV(i),n()[0]<0?(r=c$(r),s=c$(s),e(UV,qV)):e(l$,u$),t}return t.base=function(a){return arguments.length?(i=+a,o()):i},t.domain=function(a){return arguments.length?(n(a),o()):n()},t.ticks=a=>{const l=n();let u=l[0],c=l[l.length-1];const f=c0){for(;d<=h;++d)for(p=1;pc)break;y.push(g)}}else for(;d<=h;++d)for(p=i-1;p>=1;--p)if(g=d>0?p/s(-d):p*s(d),!(gc)break;y.push(g)}y.length*2{if(a==null&&(a=10),l==null&&(l=i===10?"s":","),typeof l!="function"&&(!(i%1)&&(l=ma(l)).precision==null&&(l.trim=!0),l=qh(l)),a===1/0)return l;const u=Math.max(1,i*a/t.ticks().length);return c=>{let f=c/s(Math.round(r(c)));return f*in(a$(n(),{floor:a=>s(Math.floor(r(a))),ceil:a=>s(Math.ceil(r(a)))})),t}function f$(){const e=_b(Ip()).domain([1,10]);return e.copy=()=>pf(e,f$()).base(e.base()),Br.apply(e,arguments),e}function d$(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function h$(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function wb(e){var t=1,n=e(d$(t),h$(t));return n.constant=function(i){return arguments.length?e(d$(t=+i),h$(t)):t},Ta(n)}function p$(){var e=wb(Ip());return e.copy=function(){return pf(e,p$()).constant(e.constant())},Br.apply(e,arguments)}function g$(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function VV(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function XV(e){return e<0?-e*e:e*e}function kb(e){var t=e(Jn,Jn),n=1;function i(){return n===1?e(Jn,Jn):n===.5?e(VV,XV):e(g$(n),g$(1/n))}return t.exponent=function(r){return arguments.length?(n=+r,i()):n},Ta(t)}function $b(){var e=kb(Ip());return e.copy=function(){return pf(e,$b()).exponent(e.exponent())},Br.apply(e,arguments),e}function YV(){return $b.apply(null,arguments).exponent(.5)}function m$(){var e=[],t=[],n=[],i;function r(){var o=0,a=Math.max(1,t.length);for(n=new Array(a-1);++o0?n[a-1]:e[0],a=n?[i[n-1],t]:[i[u-1],i[u]]},o.unknown=function(l){return arguments.length&&(s=l),o},o.thresholds=function(){return i.slice()},o.copy=function(){return y$().domain([e,t]).range(r).unknown(s)},Br.apply(Ta(o),arguments)}function b$(){var e=[.5],t=[0,1],n,i=1;function r(s){return s!=null&&s<=s?t[zc(e,s,0,i)]:n}return r.domain=function(s){return arguments.length?(e=Array.from(s),i=Math.min(e.length,t.length-1),r):e.slice()},r.range=function(s){return arguments.length?(t=Array.from(s),i=Math.min(e.length,t.length-1),r):t.slice()},r.invertExtent=function(s){var o=t.indexOf(s);return[e[o-1],e[o]]},r.unknown=function(s){return arguments.length?(n=s,r):n},r.copy=function(){return b$().domain(e).range(t).unknown(n)},Br.apply(r,arguments)}function ZV(e){return new Date(e)}function KV(e){return e instanceof Date?+e:+new Date(+e)}function Eb(e,t,n,i,r,s,o,a,l,u){var c=i$(),f=c.invert,d=c.domain,h=u(".%L"),p=u(":%S"),g=u("%I:%M"),m=u("%I %p"),y=u("%a %d"),b=u("%b %d"),v=u("%B"),x=u("%Y");function _(k){return(l(k)0?i:1:0}const nX="identity",pu="linear",Es="log",gf="pow",mf="sqrt",Bp="symlog",Ma="time",Fa="utc",qr="sequential",gu="diverging",mu="quantile",jp="quantize",Up="threshold",Mb="ordinal",Fb="point",$$="band",Db="bin-ordinal",zt="continuous",yf="discrete",bf="discretizing",Oi="interpolating",Nb="temporal";function iX(e){return function(t){let n=t[0],i=t[1],r;return i=i&&n[l]<=r&&(s<0&&(s=l),o=l);if(!(s<0))return i=e.invertExtent(n[s]),r=e.invertExtent(n[o]),[i[0]===void 0?i[1]:i[0],r[1]===void 0?r[0]:r[1]]}}function Ob(){const e=ib().unknown(void 0),t=e.domain,n=e.range;let i=[0,1],r,s,o=!1,a=0,l=0,u=.5;delete e.unknown;function c(){const f=t().length,d=i[1]g+r*y);return n(d?m.reverse():m)}return e.domain=function(f){return arguments.length?(t(f),c()):t()},e.range=function(f){return arguments.length?(i=[+f[0],+f[1]],c()):i.slice()},e.rangeRound=function(f){return i=[+f[0],+f[1]],o=!0,c()},e.bandwidth=function(){return s},e.step=function(){return r},e.round=function(f){return arguments.length?(o=!!f,c()):o},e.padding=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),a=l,c()):a},e.paddingInner=function(f){return arguments.length?(a=Math.max(0,Math.min(1,f)),c()):a},e.paddingOuter=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),c()):l},e.align=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),c()):u},e.invertRange=function(f){if(f[0]==null||f[1]==null)return;const d=i[1]i[1-d])))return y=Math.max(0,zh(h,g)-1),b=g===m?y:zh(h,m)-1,g-h[y]>s+1e-10&&++y,d&&(v=y,y=p-b,b=p-v),y>b?void 0:t().slice(y,b+1)},e.invert=function(f){const d=e.invertRange([f,f]);return d&&d[0]},e.copy=function(){return Ob().domain(t()).range(i).round(o).paddingInner(a).paddingOuter(l).align(u)},c()}function E$(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return E$(t())},e}function sX(){return E$(Ob().paddingInner(1))}var oX=Array.prototype.map;function aX(e){return oX.call(e,hn)}const lX=Array.prototype.slice;function C$(){let e=[],t=[];function n(i){return i==null||i!==i?void 0:t[(zc(e,i)-1)%t.length]}return n.domain=function(i){return arguments.length?(e=aX(i),n):e.slice()},n.range=function(i){return arguments.length?(t=lX.call(i),n):t.slice()},n.tickFormat=function(i,r){return r$(e[0],Ue(e),i??10,r)},n.copy=function(){return C$().domain(n.domain()).range(n.range())},n}const qp=new Map,S$=Symbol("vega_scale");function A$(e){return e[S$]=!0,e}function uX(e){return e&&e[S$]===!0}function cX(e,t,n){const i=function(){const s=t();return s.invertRange||(s.invertRange=s.invert?iX(s):s.invertExtent?rX(s):void 0),s.type=e,A$(s)};return i.metadata=Ki(ee(n)),i}function Ke(e,t,n){return arguments.length>1?(qp.set(e,cX(e,t,n)),this):T$(e)?qp.get(e):void 0}Ke(nX,o$),Ke(pu,s$,zt),Ke(Es,f$,[zt,Es]),Ke(gf,$b,zt),Ke(mf,YV,zt),Ke(Bp,p$,zt),Ke(Ma,JV,[zt,Nb]),Ke(Fa,QV,[zt,Nb]),Ke(qr,Cb,[zt,Oi]),Ke(`${qr}-${pu}`,Cb,[zt,Oi]),Ke(`${qr}-${Es}`,v$,[zt,Oi,Es]),Ke(`${qr}-${gf}`,Sb,[zt,Oi]),Ke(`${qr}-${mf}`,eX,[zt,Oi]),Ke(`${qr}-${Bp}`,x$,[zt,Oi]),Ke(`${gu}-${pu}`,_$,[zt,Oi]),Ke(`${gu}-${Es}`,w$,[zt,Oi,Es]),Ke(`${gu}-${gf}`,Ab,[zt,Oi]),Ke(`${gu}-${mf}`,tX,[zt,Oi]),Ke(`${gu}-${Bp}`,k$,[zt,Oi]),Ke(mu,m$,[bf,mu]),Ke(jp,y$,bf),Ke(Up,b$,bf),Ke(Db,C$,[yf,bf]),Ke(Mb,ib,yf),Ke($$,Ob,yf),Ke(Fb,sX,yf);function T$(e){return qp.has(e)}function Da(e,t){const n=qp.get(e);return n&&n.metadata[t]}function Rb(e){return Da(e,zt)}function yu(e){return Da(e,yf)}function Lb(e){return Da(e,bf)}function M$(e){return Da(e,Es)}function fX(e){return Da(e,Nb)}function F$(e){return Da(e,Oi)}function D$(e){return Da(e,mu)}const dX=["clamp","base","constant","exponent"];function N$(e,t){const n=t[0],i=Ue(t)-n;return function(r){return e(n+r*i)}}function Wp(e,t,n){return bb(Ib(t||"rgb",n),e)}function O$(e,t){const n=new Array(t),i=t+1;for(let r=0;re[a]?o[a](e[a]()):0),o)}function Ib(e,t){const n=IV[hX(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function hX(e){return"interpolate"+e.toLowerCase().split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}const pX={blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},gX={category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"};function L$(e){const t=e.length/6|0,n=new Array(t);for(let i=0;iWp(L$(e)));function zb(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(z$[e]=t,this):z$[e]}const Hp="symbol",mX="discrete",yX="gradient",bX=e=>q(e)?e.map(t=>String(t)):String(e),vX=(e,t)=>e[1]-t[1],xX=(e,t)=>t[1]-e[1];function Pb(e,t,n){let i;return Xe(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),n!=null&&(t=Math.min(t,Math.floor(Lc(e.domain())/n||1)+1))),re(t)&&(i=t.step,t=t.interval),te(t)&&(t=e.type===Ma?nu(t):e.type==Fa?iu(t):U("Only time and utc scales accept interval strings."),i&&(t=t.every(i))),t}function P$(e,t,n){let i=e.range(),r=i[0],s=Ue(i),o=vX;if(r>s&&(i=s,s=r,r=i,o=xX),r=Math.floor(r),s=Math.ceil(s),t=t.map(a=>[a,e(a)]).filter(a=>r<=a[1]&&a[1]<=s).sort(o).map(a=>a[0]),n>0&&t.length>1){const a=[t[0],Ue(t)];for(;t.length>n&&t.length>=3;)t=t.filter((l,u)=>!(u%2));t.length<3&&(t=a)}return t}function Bb(e,t){return e.bins?P$(e,e.bins):e.ticks?e.ticks(t):e.domain()}function B$(e,t,n,i,r,s){const o=t.type;let a=bX;if(o===Ma||r===Ma)a=e.timeFormat(i);else if(o===Fa||r===Fa)a=e.utcFormat(i);else if(M$(o)){const l=e.formatFloat(i);if(s||t.bins)a=l;else{const u=j$(t,n,!1);a=c=>u(c)?l(c):""}}else if(t.tickFormat){const l=t.domain();a=e.formatSpan(l[0],l[l.length-1],n,i)}else i&&(a=e.format(i));return a}function j$(e,t,n){const i=Bb(e,t),r=e.base(),s=Math.log(r),o=Math.max(1,r*t/i.length),a=l=>{let u=l/Math.pow(r,Math.round(Math.log(l)/s));return u*r1?i[1]-i[0]:i[0],o;for(o=1;ojb[e.type]||e.bins;function W$(e,t,n,i,r,s,o){const a=U$[t.type]&&s!==Ma&&s!==Fa?_X(e,t,r):B$(e,t,n,r,s,o);return i===Hp&&$X(t)?EX(a):i===mX?CX(a):SX(a)}const EX=e=>(t,n,i)=>{const r=H$(i[n+1],H$(i.max,1/0)),s=G$(t,e),o=G$(r,e);return s&&o?s+" – "+o:o?"< "+o:"≥ "+s},H$=(e,t)=>e??t,CX=e=>(t,n)=>n?e(t):null,SX=e=>t=>e(t),G$=(e,t)=>Number.isFinite(e)?t(e):null;function AX(e){const t=e.domain(),n=t.length-1;let i=+t[0],r=+Ue(t),s=r-i;if(e.type===Up){const o=n?s/n:.1;i-=o,r+=o,s=r-i}return o=>(o-i)/s}function TX(e,t,n,i){const r=i||t.type;return te(n)&&fX(r)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),!n&&r===Ma?e.timeFormat("%A, %d %B %Y, %X"):!n&&r===Fa?e.utcFormat("%A, %d %B %Y, %X UTC"):W$(e,t,5,null,n,i,!0)}function V$(e,t,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=TX(e,t,n.format,n.formatType);if(Lb(t.type)){const s=q$(t).slice(1).map(r),o=s.length;return`${o} boundar${o===1?"y":"ies"}: ${s.join(", ")}`}else if(yu(t.type)){const s=t.domain(),o=s.length,a=o>i?s.slice(0,i-2).map(r).join(", ")+", ending with "+s.slice(-1).map(r):s.map(r).join(", ");return`${o} value${o===1?"":"s"}: ${a}`}else{const s=t.domain();return`values from ${r(s[0])} to ${r(Ue(s))}`}}let X$=0;function MX(){X$=0}const Gp="p_";function Ub(e){return e&&e.gradient}function Y$(e,t,n){const i=e.gradient;let r=e.id,s=i==="radial"?Gp:"";return r||(r=e.id="gradient_"+X$++,i==="radial"?(e.x1=Wr(e.x1,.5),e.y1=Wr(e.y1,.5),e.r1=Wr(e.r1,0),e.x2=Wr(e.x2,.5),e.y2=Wr(e.y2,.5),e.r2=Wr(e.r2,.5),s=Gp):(e.x1=Wr(e.x1,0),e.y1=Wr(e.y1,0),e.x2=Wr(e.x2,1),e.y2=Wr(e.y2,0))),t[r]=e,"url("+(n||"")+"#"+s+r+")"}function Wr(e,t){return e??t}function Z$(e,t){var n=[],i;return i={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:n,stop:function(r,s){return n.push({offset:r,color:s}),i}}}const K$={basis:{curve:RG},"basis-closed":{curve:LG},"basis-open":{curve:IG},bundle:{curve:zG,tension:"beta",value:.85},cardinal:{curve:PG,tension:"tension",value:0},"cardinal-open":{curve:jG,tension:"tension",value:0},"cardinal-closed":{curve:BG,tension:"tension",value:0},"catmull-rom":{curve:UG,tension:"alpha",value:.5},"catmull-rom-closed":{curve:qG,tension:"alpha",value:.5},"catmull-rom-open":{curve:WG,tension:"alpha",value:.5},linear:{curve:Zy},"linear-closed":{curve:HG},monotone:{horizontal:VG,vertical:GG},natural:{curve:XG},step:{curve:YG},"step-after":{curve:KG},"step-before":{curve:ZG}};function qb(e,t,n){var i=me(K$,e)&&K$[e],r=null;return i&&(r=i.curve||i[t||"vertical"],i.tension&&n!=null&&(r=r[i.tension](n))),r}const FX={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},DX=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,NX=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,OX=/^((\s+,?\s*)|(,\s*))/,RX=/^[01]/;function bu(e){const t=[];return(e.match(DX)||[]).forEach(i=>{let r=i[0];const s=r.toLowerCase(),o=FX[s],a=LX(s,o,i.slice(1).trim()),l=a.length;if(l1&&(g=Math.sqrt(g),n*=g,i*=g);const m=d/n,y=f/n,b=-f/i,v=d/i,x=m*a+y*l,_=b*a+v*l,k=m*e+y*t,w=b*e+v*t;let S=1/((k-x)*(k-x)+(w-_)*(w-_))-.25;S<0&&(S=0);let E=Math.sqrt(S);s==r&&(E=-E);const A=.5*(x+k)-E*(w-_),R=.5*(_+w)+E*(k-x),C=Math.atan2(_-R,x-A);let T=Math.atan2(w-R,k-A)-C;T<0&&s===1?T+=Hr:T>0&&s===0&&(T-=Hr);const O=Math.ceil(Math.abs(T/(Na+.001))),P=[];for(let j=0;j+e}function Vp(e,t,n){return Math.max(t,Math.min(e,n))}function iE(){var e=UX,t=qX,n=WX,i=HX,r=Cs(0),s=r,o=r,a=r,l=null;function u(c,f,d){var h,p=f??+e.call(this,c),g=d??+t.call(this,c),m=+n.call(this,c),y=+i.call(this,c),b=Math.min(m,y)/2,v=Vp(+r.call(this,c),0,b),x=Vp(+s.call(this,c),0,b),_=Vp(+o.call(this,c),0,b),k=Vp(+a.call(this,c),0,b);if(l||(l=h=bp()),v<=0&&x<=0&&_<=0&&k<=0)l.rect(p,g,m,y);else{var w=p+m,$=g+y;l.moveTo(p+v,g),l.lineTo(w-x,g),l.bezierCurveTo(w-wo*x,g,w,g+wo*x,w,g+x),l.lineTo(w,$-k),l.bezierCurveTo(w,$-wo*k,w-wo*k,$,w-k,$),l.lineTo(p+_,$),l.bezierCurveTo(p+wo*_,$,p,$-wo*_,p,$-_),l.lineTo(p,g+v),l.bezierCurveTo(p,g+wo*v,p+wo*v,g,p+v,g),l.closePath()}if(h)return l=null,h+""||null}return u.x=function(c){return arguments.length?(e=Cs(c),u):e},u.y=function(c){return arguments.length?(t=Cs(c),u):t},u.width=function(c){return arguments.length?(n=Cs(c),u):n},u.height=function(c){return arguments.length?(i=Cs(c),u):i},u.cornerRadius=function(c,f,d,h){return arguments.length?(r=Cs(c),s=f!=null?Cs(f):r,a=d!=null?Cs(d):r,o=h!=null?Cs(h):s,u):r},u.context=function(c){return arguments.length?(l=c??null,u):l},u}function rE(){var e,t,n,i,r=null,s,o,a,l;function u(f,d,h){const p=h/2;if(s){var g=a-d,m=f-o;if(g||m){var y=Math.hypot(g,m),b=(g/=y)*l,v=(m/=y)*l,x=Math.atan2(m,g);r.moveTo(o-b,a-v),r.lineTo(f-g*p,d-m*p),r.arc(f,d,p,x-Math.PI,x),r.lineTo(o+b,a+v),r.arc(o,a,l,x,x+Math.PI)}else r.arc(f,d,p,0,Hr);r.closePath()}else s=1;o=f,a=d,l=p}function c(f){var d,h=f.length,p,g=!1,m;for(r==null&&(r=m=bp()),d=0;d<=h;++d)!(de.x||0,wf=e=>e.y||0,GX=e=>e.width||0,VX=e=>e.height||0,XX=e=>(e.x||0)+(e.width||0),YX=e=>(e.y||0)+(e.height||0),ZX=e=>e.startAngle||0,KX=e=>e.endAngle||0,JX=e=>e.padAngle||0,QX=e=>e.innerRadius||0,eY=e=>e.outerRadius||0,tY=e=>e.cornerRadius||0,nY=e=>xf(e.cornerRadiusTopLeft,e.cornerRadius)||0,iY=e=>xf(e.cornerRadiusTopRight,e.cornerRadius)||0,rY=e=>xf(e.cornerRadiusBottomRight,e.cornerRadius)||0,sY=e=>xf(e.cornerRadiusBottomLeft,e.cornerRadius)||0,oY=e=>xf(e.size,64),aY=e=>e.size||1,Xp=e=>e.defined!==!1,lY=e=>nE(e.shape||"circle"),uY=DG().startAngle(ZX).endAngle(KX).padAngle(JX).innerRadius(QX).outerRadius(eY).cornerRadius(tY),cY=n9().x(_f).y1(wf).y0(YX).defined(Xp),fY=n9().y(wf).x1(_f).x0(XX).defined(Xp),dY=t9().x(_f).y(wf).defined(Xp),hY=iE().x(_f).y(wf).width(GX).height(VX).cornerRadius(nY,iY,rY,sY),pY=OG().type(lY).size(oY),gY=rE().x(_f).y(wf).defined(Xp).size(aY);function Vb(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function mY(e,t){return uY.context(e)(t)}function yY(e,t){const n=t[0],i=n.interpolate||"linear";return(n.orient==="horizontal"?fY:cY).curve(qb(i,n.orient,n.tension)).context(e)(t)}function bY(e,t){const n=t[0],i=n.interpolate||"linear";return dY.curve(qb(i,n.orient,n.tension)).context(e)(t)}function xu(e,t,n,i){return hY.context(e)(t,n,i)}function vY(e,t){return(t.mark.shape||t.shape).context(e)(t)}function xY(e,t){return pY.context(e)(t)}function _Y(e,t){return gY.context(e)(t)}var sE=1;function oE(){sE=1}function Xb(e,t,n){var i=t.clip,r=e._defs,s=t.clip_id||(t.clip_id="clip"+sE++),o=r.clipping[s]||(r.clipping[s]={id:s});return Me(i)?o.path=i(null):Vb(n)?o.path=xu(null,n,0,0):(o.width=n.width||0,o.height=n.height||0),"url(#"+s+")"}function Ot(e){this.clear(),e&&this.union(e)}Ot.prototype={clone(){return new Ot(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},set(e,t,n,i){return nthis.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){const i=this.rotatedPoints(e,t,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])},rotatedPoints(e,t,n){var{x1:i,y1:r,x2:s,y2:o}=this,a=Math.cos(e),l=Math.sin(e),u=t-t*a+n*l,c=n-t*l-n*a;return[a*i-l*r+u,l*i+a*r+c,a*i-l*o+u,l*i+a*o+c,a*s-l*r+u,l*s+a*r+c,a*s-l*o+u,l*s+a*o+c]},union(e){return e.x1this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2e.x2||this.y2e.y2)},contains(e,t){return!(ethis.x2||tthis.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function Yp(e){this.mark=e,this.bounds=this.bounds||new Ot}function Zp(e){Yp.call(this,e),this.items=this.items||[]}K(Zp,Yp);function Yb(e){this._pending=0,this._loader=e||ep()}function aE(e){e._pending+=1}function kf(e){e._pending-=1}Yb.prototype={pending(){return this._pending},sanitizeURL(e){const t=this;return aE(t),t._loader.sanitize(e,{context:"href"}).then(n=>(kf(t),n)).catch(()=>(kf(t),null))},loadImage(e){const t=this,n=JG();return aE(t),t._loader.sanitize(e,{context:"image"}).then(i=>{const r=i.href;if(!r||!n)throw{url:r};const s=new n,o=me(i,"crossOrigin")?i.crossOrigin:"anonymous";return o!=null&&(s.crossOrigin=o),s.onload=()=>kf(t),s.onerror=()=>kf(t),s.src=r,s}).catch(i=>(kf(t),{complete:!1,width:0,height:0,src:i&&i.url||""}))},ready(){const e=this;return new Promise(t=>{function n(i){e.pending()?setTimeout(()=>{n(!0)},10):t(i)}n(!1)})}};function Ss(e,t,n){if(t.stroke&&t.opacity!==0&&t.strokeOpacity!==0){const i=t.strokeWidth!=null?+t.strokeWidth:1;e.expand(i+(n?wY(t,i):0))}return e}function wY(e,t){return e.strokeJoin&&e.strokeJoin!=="miter"?0:t}const kY=Hr-1e-8;let Kp,Jp,Qp,Oa,Zb,eg,Kb,Jb;const ko=(e,t)=>Kp.add(e,t),tg=(e,t)=>ko(Jp=e,Qp=t),lE=e=>ko(e,Kp.y1),uE=e=>ko(Kp.x1,e),Ra=(e,t)=>Zb*e+Kb*t,La=(e,t)=>eg*e+Jb*t,Qb=(e,t)=>ko(Ra(e,t),La(e,t)),e3=(e,t)=>tg(Ra(e,t),La(e,t));function $f(e,t){return Kp=e,t?(Oa=t*_o,Zb=Jb=Math.cos(Oa),eg=Math.sin(Oa),Kb=-eg):(Zb=Jb=1,Oa=eg=Kb=0),$Y}const $Y={beginPath(){},closePath(){},moveTo:e3,lineTo:e3,rect(e,t,n,i){Oa?(Qb(e+n,t),Qb(e+n,t+i),Qb(e,t+i),e3(e,t)):(ko(e+n,t+i),tg(e,t))},quadraticCurveTo(e,t,n,i){const r=Ra(e,t),s=La(e,t),o=Ra(n,i),a=La(n,i);cE(Jp,r,o,lE),cE(Qp,s,a,uE),tg(o,a)},bezierCurveTo(e,t,n,i,r,s){const o=Ra(e,t),a=La(e,t),l=Ra(n,i),u=La(n,i),c=Ra(r,s),f=La(r,s);fE(Jp,o,l,c,lE),fE(Qp,a,u,f,uE),tg(c,f)},arc(e,t,n,i,r,s){if(i+=Oa,r+=Oa,Jp=n*Math.cos(r)+e,Qp=n*Math.sin(r)+t,Math.abs(r-i)>kY)ko(e-n,t-n),ko(e+n,t+n);else{const o=u=>ko(n*Math.cos(u)+e,n*Math.sin(u)+t);let a,l;if(o(i),o(r),r!==i)if(i=i%Hr,i<0&&(i+=Hr),r=r%Hr,r<0&&(r+=Hr),rr;++l,a-=Na)o(a);else for(a=i-i%Na+Na,l=0;l<4&&aIX?(c=o*o+a*s,c>=0&&(c=Math.sqrt(c),l=(-o+c)/s,u=(-o-c)/s)):l=.5*a/o,0d)return!1;g>f&&(f=g)}else if(h>0){if(g0?(e.globalAlpha=n,e.fillStyle=mE(e,t,t.fill),!0):!1}var CY=[];function ku(e,t,n){var i=(i=t.strokeWidth)!=null?i:1;return i<=0?!1:(n*=t.strokeOpacity==null?1:t.strokeOpacity,n>0?(e.globalAlpha=n,e.strokeStyle=mE(e,t,t.stroke),e.lineWidth=i,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||CY),e.lineDashOffset=t.strokeDashOffset||0),!0):!1)}function SY(e,t){return e.zindex-t.zindex||e.index-t.index}function r3(e){if(!e.zdirty)return e.zitems;var t=e.items,n=[],i,r,s;for(r=0,s=t.length;r=0;)if(i=t(n[r]))return i;if(n===s){for(n=e.items,r=n.length;--r>=0;)if(!n[r].zindex&&(i=t(n[r])))return i}return null}function s3(e){return function(t,n,i){nr(n,r=>{(!i||i.intersects(r.bounds))&&yE(e,t,r,r)})}}function AY(e){return function(t,n,i){n.items.length&&(!i||i.intersects(n.bounds))&&yE(e,t,n.items[0],n.items)}}function yE(e,t,n,i){var r=n.opacity==null?1:n.opacity;r!==0&&(e(t,i)||(wu(t,n),n.fill&&ng(t,n,r)&&t.fill(),n.stroke&&ku(t,n,r)&&t.stroke()))}function rg(e){return e=e||Mi,function(t,n,i,r,s,o){return i*=t.pixelRatio,r*=t.pixelRatio,ig(n,a=>{const l=a.bounds;if(!(l&&!l.contains(s,o)||!l)&&e(t,a,i,r,s,o))return a})}}function Ef(e,t){return function(n,i,r,s){var o=Array.isArray(i)?i[0]:i,a=t??o.fill,l=o.stroke&&n.isPointInStroke,u,c;return l&&(u=o.strokeWidth,c=o.strokeCap,n.lineWidth=u??1,n.lineCap=c??"butt"),e(n,i)?!1:a&&n.isPointInPath(r,s)||l&&n.isPointInStroke(r,s)}}function o3(e){return rg(Ef(e))}function Ia(e,t){return"translate("+e+","+t+")"}function a3(e){return"rotate("+e+")"}function TY(e,t){return"scale("+e+","+t+")"}function bE(e){return Ia(e.x||0,e.y||0)}function MY(e){return Ia(e.x||0,e.y||0)+(e.angle?" "+a3(e.angle):"")}function FY(e){return Ia(e.x||0,e.y||0)+(e.angle?" "+a3(e.angle):"")+(e.scaleX||e.scaleY?" "+TY(e.scaleX||1,e.scaleY||1):"")}function l3(e,t,n){function i(o,a){o("transform",MY(a)),o("d",t(null,a))}function r(o,a){return t($f(o,a.angle),a),Ss(o,a).translate(a.x||0,a.y||0)}function s(o,a){var l=a.x||0,u=a.y||0,c=a.angle||0;o.translate(l,u),c&&o.rotate(c*=_o),o.beginPath(),t(o,a),c&&o.rotate(-c),o.translate(-l,-u)}return{type:e,tag:"path",nested:!1,attr:i,bound:r,draw:s3(s),pick:o3(s),isect:n||n3(s)}}var DY=l3("arc",mY);function NY(e,t){for(var n=e[0].orient==="horizontal"?t[1]:t[0],i=e[0].orient==="horizontal"?"y":"x",r=e.length,s=1/0,o,a;--r>=0;)e[r].defined!==!1&&(a=Math.abs(e[r][i]-n),a=0;)if(e[i].defined!==!1&&(r=e[i].x-t[0],s=e[i].y-t[1],o=r*r+s*s,o=0;)if(e[n].defined!==!1&&(i=e[n].x-t[0],r=e[n].y-t[1],s=i*i+r*r,i=e[n].size||1,s.5&&t<1.5?.5-Math.abs(t-1):0}function zY(e,t){e("transform",bE(t))}function _E(e,t){const n=xE(t);e("d",xu(null,t,n,n))}function PY(e,t){e("class","background"),e("aria-hidden",!0),_E(e,t)}function BY(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?_E(e,t):e("d","")}function jY(e,t,n){const i=t.clip?Xb(n,t,t):null;e("clip-path",i)}function UY(e,t){if(!t.clip&&t.items){const n=t.items,i=n.length;for(let r=0;r{const s=r.x||0,o=r.y||0,a=r.strokeForeground,l=r.opacity==null?1:r.opacity;(r.stroke||r.fill)&&l&&(Cf(e,r,s,o),wu(e,r),r.fill&&ng(e,r,l)&&e.fill(),r.stroke&&!a&&ku(e,r,l)&&e.stroke()),e.save(),e.translate(s,o),r.clip&&vE(e,r),n&&n.translate(-s,-o),nr(r,u=>{(u.marktype==="group"||i==null||i.includes(u.marktype))&&this.draw(e,u,n,i)}),n&&n.translate(s,o),e.restore(),a&&r.stroke&&l&&(Cf(e,r,s,o),wu(e,r),ku(e,r,l)&&e.stroke())})}function VY(e,t,n,i,r,s){if(t.bounds&&!t.bounds.contains(r,s)||!t.items)return null;const o=n*e.pixelRatio,a=i*e.pixelRatio;return ig(t,l=>{let u,c,f;const d=l.bounds;if(d&&!d.contains(r,s))return;c=l.x||0,f=l.y||0;const h=c+(l.width||0),p=f+(l.height||0),g=l.clip;if(g&&(rh||sp))return;if(e.save(),e.translate(c,f),c=r-c,f=s-f,g&&Vb(l)&&!HY(e,l,o,a))return e.restore(),null;const m=l.strokeForeground,y=t.interactive!==!1;return y&&m&&l.stroke&&WY(e,l,o,a)?(e.restore(),l):(u=ig(l,b=>XY(b,c,f)?this.pick(b,n,i,c,f):null),!u&&y&&(l.fill||!m&&l.stroke)&&qY(e,l,o,a)&&(u=l),e.restore(),u||null)})}function XY(e,t,n){return(e.interactive!==!1||e.marktype==="group")&&e.bounds&&e.bounds.contains(t,n)}var YY={type:"group",tag:"g",nested:!1,attr:zY,bound:UY,draw:GY,pick:VY,isect:hE,content:jY,background:PY,foreground:BY},Sf={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function c3(e,t){var n=e.image;return(!n||e.url&&e.url!==n.url)&&(n={complete:!1,width:0,height:0},t.loadImage(e.url).then(i=>{e.image=i,e.image.url=e.url})),n}function f3(e,t){return e.width!=null?e.width:!t||!t.width?0:e.aspect!==!1&&e.height?e.height*t.width/t.height:t.width}function d3(e,t){return e.height!=null?e.height:!t||!t.height?0:e.aspect!==!1&&e.width?e.width*t.height/t.width:t.height}function sg(e,t){return e==="center"?t/2:e==="right"?t:0}function og(e,t){return e==="middle"?t/2:e==="bottom"?t:0}function ZY(e,t,n){const i=c3(t,n),r=f3(t,i),s=d3(t,i),o=(t.x||0)-sg(t.align,r),a=(t.y||0)-og(t.baseline,s),l=!i.src&&i.toDataURL?i.toDataURL():i.src||"";e("href",l,Sf["xmlns:xlink"],"xlink:href"),e("transform",Ia(o,a)),e("width",r),e("height",s),e("preserveAspectRatio",t.aspect===!1?"none":"xMidYMid")}function KY(e,t){const n=t.image,i=f3(t,n),r=d3(t,n),s=(t.x||0)-sg(t.align,i),o=(t.y||0)-og(t.baseline,r);return e.set(s,o,s+i,o+r)}function JY(e,t,n){nr(t,i=>{if(n&&!n.intersects(i.bounds))return;const r=c3(i,this);let s=f3(i,r),o=d3(i,r);if(s===0||o===0)return;let a=(i.x||0)-sg(i.align,s),l=(i.y||0)-og(i.baseline,o),u,c,f,d;i.aspect!==!1&&(c=r.width/r.height,f=i.width/i.height,c===c&&f===f&&c!==f&&(f{if(!(n&&!n.intersects(i.bounds))){var r=i.opacity==null?1:i.opacity;r&&kE(e,i,r)&&(wu(e,i),e.stroke())}})}function cZ(e,t,n,i){return e.isPointInStroke?kE(e,t,1)&&e.isPointInStroke(n,i):!1}var fZ={type:"rule",tag:"line",nested:!1,attr:aZ,bound:lZ,draw:uZ,pick:rg(cZ),isect:pE},dZ=l3("shape",vY),hZ=l3("symbol",xY,i3);const $E=u4();var mi={height:Gr,measureWidth:h3,estimateWidth:lg,width:lg,canvas:EE};EE(!0);function EE(e){mi.width=e&&$o?h3:lg}function lg(e,t){return CE(Co(e,t),Gr(e))}function CE(e,t){return~~(.8*e.length*t)}function h3(e,t){return Gr(e)<=0||!(t=Co(e,t))?0:SE(t,ug(e))}function SE(e,t){const n=`(${t}) ${e}`;let i=$E.get(n);return i===void 0&&($o.font=t,i=$o.measureText(e).width,$E.set(n,i)),i}function Gr(e){return e.fontSize!=null?+e.fontSize||0:11}function Eo(e){return e.lineHeight!=null?e.lineHeight:Gr(e)+2}function pZ(e){return q(e)?e.length>1?e:e[0]:e}function Af(e){return pZ(e.lineBreak&&e.text&&!q(e.text)?e.text.split(e.lineBreak):e.text)}function p3(e){const t=Af(e);return(q(t)?t.length-1:0)*Eo(e)}function Co(e,t){const n=t==null?"":(t+"").trim();return e.limit>0&&n.length?mZ(e,n):n}function gZ(e){if(mi.width===h3){const t=ug(e);return n=>SE(n,t)}else if(mi.width===lg){const t=Gr(e);return n=>CE(n,t)}else return t=>mi.width(e,t)}function mZ(e,t){var n=+e.limit,i=gZ(e);if(i(t)>>1,i(t.slice(l))>n?o=l+1:a=l;return r+t.slice(o)}else{for(;o>>1),i(t.slice(0,l))Math.max(d,mi.width(t,h)),0)):f=mi.width(t,c),r==="center"?l-=f/2:r==="right"&&(l-=f),e.set(l+=o,u+=a,l+f,u+i),t.angle&&!n)e.rotate(t.angle*_o,o,a);else if(n===2)return e.rotatedPoints(t.angle*_o,o,a);return e}function vZ(e,t,n){nr(t,i=>{var r=i.opacity==null?1:i.opacity,s,o,a,l,u,c,f;if(!(n&&!n.intersects(i.bounds)||r===0||i.fontSize<=0||i.text==null||i.text.length===0)){if(e.font=ug(i),e.textAlign=i.align||"left",s=cg(i),o=s.x1,a=s.y1,i.angle&&(e.save(),e.translate(o,a),e.rotate(i.angle*_o),o=a=0),o+=i.dx||0,a+=(i.dy||0)+g3(i),c=Af(i),wu(e,i),q(c))for(u=Eo(i),l=0;lt;)e.removeChild(n[--i]);return e}function OE(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function fg(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function EZ(e,t,n,i){var r=e&&e.mark,s,o;if(r&&(s=yi[r.marktype]).tip){for(o=fg(t,n),o[0]-=i[0],o[1]-=i[1];e=e.mark.group;)o[0]-=e.x||0,o[1]-=e.y||0;e=s.tip(r.items,o)}return e}function Ao(e,t){this._active=null,this._handlers={},this._loader=e||ep(),this._tooltip=t||CZ}function CZ(e,t,n,i){e.element().setAttribute("title",i||"")}Ao.prototype={initialize(e,t,n){return this._el=e,this._obj=n||null,this.origin(t)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},origin(e){return arguments.length?(this._origin=e||[0,0],this):this._origin.slice()},scene(e){return arguments.length?(this._scene=e,this):this._scene},on(){},off(){},_handlerIndex(e,t,n){for(let i=e?e.length:0;--i>=0;)if(e[i].type===t&&(!n||e[i].handler===n))return i;return-1},handlers(e){const t=this._handlers,n=[];if(e)n.push(...t[this.eventName(e)]);else for(const i in t)n.push(...t[i]);return n},eventName(e){const t=e.indexOf(".");return t<0?e:e.slice(0,t)},handleHref(e,t,n){this._loader.sanitize(n,{context:"href"}).then(i=>{const r=new MouseEvent(e.type,e),s=So(null,"a");for(const o in i)s.setAttribute(o,i[o]);s.dispatchEvent(r)}).catch(()=>{})},handleTooltip(e,t,n){if(t&&t.tooltip!=null){t=EZ(t,e,this.canvas(),this._origin);const i=n&&t&&t.tooltip||null;this._tooltip.call(this._obj,this,e,t,i)}},getItemBoundingClientRect(e){const t=this.canvas();if(!t)return;const n=t.getBoundingClientRect(),i=this._origin,r=e.bounds,s=r.width(),o=r.height();let a=r.x1+i[0]+n.left,l=r.y1+i[1]+n.top;for(;e.mark&&(e=e.mark.group);)a+=e.x||0,l+=e.y||0;return{x:a,y:l,width:s,height:o,left:a,top:l,right:a+s,bottom:l+o}}};function bi(e){this._el=null,this._bgcolor=null,this._loader=new Yb(e)}bi.prototype={initialize(e,t,n,i,r){return this._el=e,this.resize(t,n,i,r)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},background(e){return arguments.length===0?this._bgcolor:(this._bgcolor=e,this)},resize(e,t,n,i){return this._width=e,this._height=t,this._origin=n||[0,0],this._scale=i||1,this},dirty(){},render(e,t){const n=this;return n._call=function(){n._render(e,t)},n._call(),n._call=null,n},_render(){},renderAsync(e,t){const n=this.render(e,t);return this._ready?this._ready.then(()=>n):Promise.resolve(n)},_load(e,t){var n=this,i=n._loader[e](t);if(!n._ready){const r=n._call;n._ready=n._loader.ready().then(s=>{s&&r(),n._ready=null})}return i},sanitizeURL(e){return this._load("sanitizeURL",e)},loadImage(e){return this._load("loadImage",e)}};const SZ="keydown",AZ="keypress",TZ="keyup",RE="dragenter",dg="dragleave",LE="dragover",x3="pointerdown",MZ="pointerup",hg="pointermove",Ff="pointerout",IE="pointerover",_3="mousedown",FZ="mouseup",zE="mousemove",w3="mouseout",PE="mouseover",pg="click",DZ="dblclick",NZ="wheel",BE="mousewheel",gg="touchstart",mg="touchmove",yg="touchend",OZ=[SZ,AZ,TZ,RE,dg,LE,x3,MZ,hg,Ff,IE,_3,FZ,zE,w3,PE,pg,DZ,NZ,BE,gg,mg,yg],k3=hg,Df=Ff,$3=pg;function To(e,t){Ao.call(this,e,t),this._down=null,this._touch=null,this._first=!0,this._events={}}const RZ=e=>e===gg||e===mg||e===yg?[gg,mg,yg]:[e];function jE(e,t){RZ(t).forEach(n=>LZ(e,n))}function LZ(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?i=>e[t](i):i=>e.fire(t,i)))}function Nf(e,t,n){t.forEach(i=>e.fire(i,n))}function UE(e,t,n){return function(i){const r=this._active,s=this.pickEvent(i);s===r?Nf(this,e,i):((!r||!r.exit)&&Nf(this,n,i),this._active=s,Nf(this,t,i),Nf(this,e,i))}}function qE(e){return function(t){Nf(this,e,t),this._active=null}}K(To,Ao,{initialize(e,t,n){return this._canvas=e&&v3(e,"canvas"),[pg,_3,x3,hg,Ff,dg].forEach(i=>jE(this,i)),Ao.prototype.initialize.call(this,e,t,n)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:OZ,DOMMouseScroll(e){this.fire(BE,e)},pointermove:UE([hg,zE],[IE,PE],[Ff,w3]),dragover:UE([LE],[RE],[dg]),pointerout:qE([Ff,w3]),dragleave:qE([dg]),pointerdown(e){this._down=this._active,this.fire(x3,e)},mousedown(e){this._down=this._active,this.fire(_3,e)},click(e){this._down===this._active&&(this.fire(pg,e),this._down=null)},touchstart(e){this._touch=this.pickEvent(e.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(gg,e,!0)},touchmove(e){this.fire(mg,e,!0)},touchend(e){this.fire(yg,e,!0),this._touch=null},fire(e,t,n){const i=n?this._touch:this._active,r=this._handlers[e];if(t.vegaType=e,e===$3&&i&&i.href?this.handleHref(t,i,i.href):(e===k3||e===Df)&&this.handleTooltip(t,i,e!==Df),r)for(let s=0,o=r.length;s=0&&i.splice(r,1),this},pickEvent(e){const t=fg(e,this._canvas),n=this._origin;return this.pick(this._scene,t[0],t[1],t[0]-n[0],t[1]-n[1])},pick(e,t,n,i,r){const s=this.context();return yi[e.marktype].pick.call(this,s,e,t,n,i,r)}});function IZ(){return typeof window<"u"&&window.devicePixelRatio||1}var zZ=IZ();function PZ(e,t,n,i,r,s){const o=typeof HTMLElement<"u"&&e instanceof HTMLElement&&e.parentNode!=null,a=e.getContext("2d"),l=o?zZ:r;e.width=t*l,e.height=n*l;for(const u in s)a[u]=s[u];return o&&l!==1&&(e.style.width=t+"px",e.style.height=n+"px"),a.pixelRatio=l,a.setTransform(l,0,0,l,l*i[0],l*i[1]),e}function Of(e){bi.call(this,e),this._options={},this._redraw=!1,this._dirty=new Ot,this._tempb=new Ot}const WE=bi.prototype,BZ=(e,t,n)=>new Ot().set(0,0,t,n).translate(-e[0],-e[1]);function jZ(e,t,n){return t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio),t.translate(-(n[0]%1),-(n[1]%1)),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}K(Of,bi,{initialize(e,t,n,i,r,s){return this._options=s||{},this._canvas=this._options.externalContext?null:go(1,1,this._options.type),e&&this._canvas&&(Li(e,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),WE.initialize.call(this,e,t,n,i,r)},resize(e,t,n,i){if(WE.resize.call(this,e,t,n,i),this._canvas)PZ(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const r=this._options.externalContext;r||U("CanvasRenderer is missing a valid canvas or context"),r.scale(this._scale,this._scale),r.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this},canvas(){return this._canvas},context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)},dirty(e){const t=this._tempb.clear().union(e.bounds);let n=e.mark.group;for(;n;)t.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(t)},_render(e,t){const n=this.context(),i=this._origin,r=this._width,s=this._height,o=this._dirty,a=BZ(i,r,s);n.save();const l=this._redraw||o.empty()?(this._redraw=!1,a.expand(1)):jZ(n,a.intersect(o),i);return this.clear(-i[0],-i[1],r,s),this.draw(n,e,l,t),n.restore(),o.clear(),this},draw(e,t,n,i){if(t.marktype!=="group"&&i!=null&&!i.includes(t.marktype))return;const r=yi[t.marktype];t.clip&&IY(e,t),r.draw.call(this,e,t,n,i),t.clip&&e.restore()},clear(e,t,n,i){const r=this._options,s=this.context();r.type!=="pdf"&&!r.externalContext&&s.clearRect(e,t,n,i),this._bgcolor!=null&&(s.fillStyle=this._bgcolor,s.fillRect(e,t,n,i))}});function E3(e,t){Ao.call(this,e,t);const n=this;n._hrefHandler=C3(n,(i,r)=>{r&&r.href&&n.handleHref(i,r,r.href)}),n._tooltipHandler=C3(n,(i,r)=>{n.handleTooltip(i,r,i.type!==Df)})}const C3=(e,t)=>n=>{let i=n.target.__data__;i=Array.isArray(i)?i[0]:i,n.vegaType=n.type,t.call(e._obj,n,i)};K(E3,Ao,{initialize(e,t,n){let i=this._svg;return i&&(i.removeEventListener($3,this._hrefHandler),i.removeEventListener(k3,this._tooltipHandler),i.removeEventListener(Df,this._tooltipHandler)),this._svg=i=e&&v3(e,"svg"),i&&(i.addEventListener($3,this._hrefHandler),i.addEventListener(k3,this._tooltipHandler),i.addEventListener(Df,this._tooltipHandler)),Ao.prototype.initialize.call(this,e,t,n)},canvas(){return this._svg},on(e,t){const n=this.eventName(e),i=this._handlers;if(this._handlerIndex(i[n],e,t)<0){const s={type:e,handler:t,listener:C3(this,t)};(i[n]||(i[n]=[])).push(s),this._svg&&this._svg.addEventListener(n,s.listener)}return this},off(e,t){const n=this.eventName(e),i=this._handlers[n],r=this._handlerIndex(i,e,t);return r>=0&&(this._svg&&this._svg.removeEventListener(n,i[r].listener),i.splice(r,1)),this}});const HE="aria-hidden",S3="aria-label",A3="role",T3="aria-roledescription",GE="graphics-object",M3="graphics-symbol",VE=(e,t,n)=>({[A3]:e,[T3]:t,[S3]:n||void 0}),UZ=Ki(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),XE={axis:{desc:"axis",caption:HZ},legend:{desc:"legend",caption:GZ},"title-text":{desc:"title",caption:e=>`Title text '${JE(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${JE(e)}'`}},YE={ariaRole:A3,ariaRoleDescription:T3,description:S3};function ZE(e,t){const n=t.aria===!1;if(e(HE,n||void 0),n||t.description==null)for(const i in YE)e(YE[i],void 0);else{const i=t.mark.marktype;e(S3,t.description),e(A3,t.ariaRole||(i==="group"?GE:M3)),e(T3,t.ariaRoleDescription||`${i} mark`)}}function KE(e){return e.aria===!1?{[HE]:!0}:UZ[e.role]?null:XE[e.role]?WZ(e,XE[e.role]):qZ(e)}function qZ(e){const t=e.marktype,n=t==="group"||t==="text"||e.items.some(i=>i.description!=null&&i.aria!==!1);return VE(n?GE:M3,`${t} mark container`,e.description)}function WZ(e,t){try{const n=e.items[0],i=t.caption||(()=>"");return VE(t.role||M3,t.desc,n.description||i(n))}catch{return null}}function JE(e){return ee(e.text).join(" ")}function HZ(e){const t=e.datum,n=e.orient,i=t.title?QE(e):null,r=e.context,s=r.scales[t.scale].value,o=r.dataflow.locale(),a=s.type;return`${n==="left"||n==="right"?"Y":"X"}-axis`+(i?` titled '${i}'`:"")+` for a ${yu(a)?"discrete":a} scale with ${V$(o,s,e)}`}function GZ(e){const t=e.datum,n=t.title?QE(e):null,i=`${t.type||""} legend`.trim(),r=t.scales,s=Object.keys(r),o=e.context,a=o.scales[r[s[0]]].value,l=o.dataflow.locale();return XZ(i)+(n?` titled '${n}'`:"")+` for ${VZ(s)} with ${V$(l,a,e)}`}function QE(e){try{return ee(Ue(e.items).items[0].text).join(" ")}catch{return null}}function VZ(e){return e=e.map(t=>t+(t==="fill"||t==="stroke"?" color":"")),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+Ue(e)}function XZ(e){return e.length?e[0].toUpperCase()+e.slice(1):e}const eC=e=>(e+"").replace(/&/g,"&").replace(//g,">"),YZ=e=>eC(e).replace(/"/g,""").replace(/\t/g," ").replace(/\n/g," ").replace(/\r/g," ");function F3(){let e="",t="",n="";const i=[],r=()=>t=n="",s=l=>{t&&(e+=`${t}>${n}`,r()),i.push(l)},o=(l,u)=>(u!=null&&(t+=` ${l}="${YZ(u)}"`),a),a={open(l){s(l),t="<"+l;for(var u=arguments.length,c=new Array(u>1?u-1:0),f=1;f${n}`:"/>"):e+=``,r(),a},attr:o,text:l=>(n+=eC(l),a),toString:()=>e};return a}const tC=e=>nC(F3(),e)+"";function nC(e,t){if(e.open(t.tagName),t.hasAttributes()){const n=t.attributes,i=n.length;for(let r=0;r{u.dirty=t})),!i.zdirty){if(n.exit){s.nested&&i.items.length?(l=i.items[0],l._svg&&this._update(s,l._svg,l)):n._svg&&(l=n._svg.parentNode,l&&l.removeChild(n._svg)),n._svg=null;continue}n=s.nested?i.items[0]:n,n._update!==t&&(!n._svg||!n._svg.ownerSVGElement?(this._dirtyAll=!1,sC(n,t)):this._update(s,n._svg,n),n._update=t)}return!this._dirtyAll},mark(e,t,n,i){if(!this.isDirty(t))return t._svg;const r=this._svg,s=t.marktype,o=yi[s],a=t.interactive===!1?"none":null,l=o.tag==="g",u=oC(t,e,n,"g",r);if(s!=="group"&&i!=null&&!i.includes(s))return Li(u,0),t._svg;u.setAttribute("class",OE(t));const c=KE(t);for(const p in c)An(u,p,c[p]);l||An(u,"pointer-events",a),An(u,"clip-path",t.clip?Xb(this,t,t.group):null);let f=null,d=0;const h=p=>{const g=this.isDirty(p),m=oC(p,u,f,o.tag,r);g&&(this._update(o,m,p),l&&JZ(this,m,p,i)),f=m,++d};return o.nested?t.items.length&&h(t.items[0]):nr(t,h),Li(u,d),u},_update(e,t,n){As=t,vn=t.__values__,ZE(Lf,n),e.attr(Lf,n,this);const i=eK[e.type];i&&i.call(this,e,t,n),As&&this.style(As,n)},style(e,t){if(t!=null){for(const n in bg){let i=n==="font"?Tf(t):t[n];if(i===vn[n])continue;const r=bg[n];i==null?e.removeAttribute(r):(Ub(i)&&(i=Y$(i,this._defs.gradient,aC())),e.setAttribute(r,i+"")),vn[n]=i}for(const n in vg)_g(e,vg[n],t[n])}},defs(){const e=this._svg,t=this._defs;let n=t.el,i=0;for(const r in t.gradient)n||(t.el=n=Pt(e,Rf+1,"defs",Bt)),i=ZZ(n,t.gradient[r],i);for(const r in t.clipping)n||(t.el=n=Pt(e,Rf+1,"defs",Bt)),i=KZ(n,t.clipping[r],i);n&&(i===0?(e.removeChild(n),t.el=null):Li(n,i))},_clearDefs(){const e=this._defs;e.gradient={},e.clipping={}}});function sC(e,t){for(;e&&e.dirty!==t;e=e.mark.group)if(e.dirty=t,e.mark&&e.mark.dirty!==t)e.mark.dirty=t;else return}function ZZ(e,t,n){let i,r,s;if(t.gradient==="radial"){let o=Pt(e,n++,"pattern",Bt);Mo(o,{id:Gp+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),o=Pt(o,0,"rect",Bt),Mo(o,{width:1,height:1,fill:`url(${aC()}#${t.id})`}),e=Pt(e,n++,"radialGradient",Bt),Mo(e,{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else e=Pt(e,n++,"linearGradient",Bt),Mo(e,{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2});for(i=0,r=t.stops.length;i{r=e.mark(t,o,r,i),++s}),Li(t,1+s)}function oC(e,t,n,i,r){let s=e._svg,o;if(!s&&(o=t.ownerDocument,s=So(o,i,Bt),e._svg=s,e.mark&&(s.__data__=e,s.__values__={fill:"default"},i==="g"))){const a=So(o,"path",Bt);s.appendChild(a),a.__data__=e;const l=So(o,"g",Bt);s.appendChild(l),l.__data__=e;const u=So(o,"path",Bt);s.appendChild(u),u.__data__=e,u.__values__={fill:"default"}}return(s.ownerSVGElement!==r||QZ(s,n))&&t.insertBefore(s,n?n.nextSibling:t.firstChild),s}function QZ(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}let As=null,vn=null;const eK={group(e,t,n){const i=As=t.childNodes[2];vn=i.__values__,e.foreground(Lf,n,this),vn=t.__values__,As=t.childNodes[1],e.content(Lf,n,this);const r=As=t.childNodes[0];e.background(Lf,n,this);const s=n.mark.interactive===!1?"none":null;if(s!==vn.events&&(An(i,"pointer-events",s),An(r,"pointer-events",s),vn.events=s),n.strokeForeground&&n.stroke){const o=n.fill;An(i,"display",null),this.style(r,n),An(r,"stroke",null),o&&(n.fill=null),vn=i.__values__,this.style(i,n),o&&(n.fill=o),As=null}else An(i,"display","none")},image(e,t,n){n.smooth===!1?(_g(t,"image-rendering","optimizeSpeed"),_g(t,"image-rendering","pixelated")):_g(t,"image-rendering",null)},text(e,t,n){const i=Af(n);let r,s,o,a;q(i)?(s=i.map(l=>Co(n,l)),r=s.join(` +`),r!==vn.text&&(Li(t,0),o=t.ownerDocument,a=Eo(n),s.forEach((l,u)=>{const c=So(o,"tspan",Bt);c.__data__=n,c.textContent=l,u&&(c.setAttribute("x",0),c.setAttribute("dy",a)),t.appendChild(c)}),vn.text=r)):(s=Co(n,i),s!==vn.text&&(t.textContent=s,vn.text=s)),An(t,"font-family",Tf(n)),An(t,"font-size",Gr(n)+"px"),An(t,"font-style",n.fontStyle),An(t,"font-variant",n.fontVariant),An(t,"font-weight",n.fontWeight)}};function Lf(e,t,n){t!==vn[e]&&(n?tK(As,e,t,n):An(As,e,t),vn[e]=t)}function _g(e,t,n){n!==vn[t]&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n+""),vn[t]=n)}function Mo(e,t){for(const n in t)An(e,n,t[n])}function An(e,t,n){n!=null?e.setAttribute(t,n):e.removeAttribute(t)}function tK(e,t,n,i){n!=null?e.setAttributeNS(i,t,n):e.removeAttributeNS(i,t)}function aC(){let e;return typeof window>"u"?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}function N3(e){bi.call(this,e),this._text=null,this._defs={gradient:{},clipping:{}}}K(N3,bi,{svg(){return this._text},_render(e){const t=F3();t.open("svg",Fe({},Sf,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const n=this._bgcolor;return n&&n!=="transparent"&&n!=="none"&&t.open("rect",{width:this._width,height:this._height,fill:n}).close(),t.open("g",iC,{transform:"translate("+this._origin+")"}),this.mark(t,e),t.close(),this.defs(t),this._text=t.close()+"",this},mark(e,t){const n=yi[t.marktype],i=n.tag,r=[ZE,n.attr];e.open("g",{class:OE(t),"clip-path":t.clip?Xb(this,t,t.group):null},KE(t),{"pointer-events":i!=="g"&&t.interactive===!1?"none":null});const s=o=>{const a=this.href(o);if(a&&e.open("a",a),e.open(i,this.attr(t,o,r,i!=="g"?i:null)),i==="text"){const l=Af(o);if(q(l)){const u={x:0,dy:Eo(o)};for(let c=0;cthis.mark(e,f)),e.close(),l&&c?(u&&(o.fill=null),o.stroke=c,e.open("path",this.attr(t,o,n.foreground,"bgrect")).close(),u&&(o.fill=u)):e.open("path",this.attr(t,o,n.foreground,"bgfore")).close()}e.close(),a&&e.close()};return n.nested?t.items&&t.items.length&&s(t.items[0]):nr(t,s),e.close()},href(e){const t=e.href;let n;if(t){if(n=this._hrefs&&this._hrefs[t])return n;this.sanitizeURL(t).then(i=>{i["xlink:href"]=i.href,i.href=null,(this._hrefs||(this._hrefs={}))[t]=i})}return null},attr(e,t,n,i){const r={},s=(o,a,l,u)=>{r[u||o]=a};return Array.isArray(n)?n.forEach(o=>o(s,t,this)):n(s,t,this),i&&nK(r,t,e,i,this._defs),r},defs(e){const t=this._defs.gradient,n=this._defs.clipping;if(Object.keys(t).length+Object.keys(n).length!==0){e.open("defs");for(const r in t){const s=t[r],o=s.stops;s.gradient==="radial"?(e.open("pattern",{id:Gp+r,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),e.open("rect",{width:"1",height:"1",fill:"url(#"+r+")"}).close(),e.close(),e.open("radialGradient",{id:r,fx:s.x1,fy:s.y1,fr:s.r1,cx:s.x2,cy:s.y2,r:s.r2})):e.open("linearGradient",{id:r,x1:s.x1,x2:s.x2,y1:s.y1,y2:s.y2});for(let a=0;a!ir.svgMarkTypes.includes(r));this._svgRenderer.render(e,ir.svgMarkTypes),this._canvasRenderer.render(e,i)},resize(e,t,n,i){return lC.resize.call(this,e,t,n,i),this._svgRenderer.resize(e,t,n,i),this._canvasRenderer.resize(e,t,n,i),this},background(e){return ir.svgOnTop?this._canvasRenderer.background(e):this._svgRenderer.background(e),this}});function O3(e,t){To.call(this,e,t)}K(O3,To,{initialize(e,t,n){const i=Pt(Pt(e,0,"div"),ir.svgOnTop?0:1,"div");return To.prototype.initialize.call(this,i,t,n)}});const uC="canvas",cC="hybrid",fC="png",dC="svg",hC="none",Fo={Canvas:uC,PNG:fC,SVG:dC,Hybrid:cC,None:hC},za={};za[uC]=za[fC]={renderer:Of,headless:Of,handler:To},za[dC]={renderer:xg,headless:N3,handler:E3},za[cC]={renderer:wg,headless:wg,handler:O3},za[hC]={};function kg(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(za[e]=t,this):za[e]}function pC(e,t,n){const i=[],r=new Ot().union(t),s=e.marktype;return s?gC(e,r,n,i):s==="group"?mC(e,r,n,i):U("Intersect scene must be mark node or group item.")}function gC(e,t,n,i){if(rK(e,t,n)){const r=e.items,s=e.marktype,o=r.length;let a=0;if(s==="group")for(;a=0;s--)if(n[s]!=i[s])return!1;for(s=n.length-1;s>=0;s--)if(r=n[s],!L3(e[r],t[r],r))return!1;return typeof e==typeof t}function aK(){oE(),MX()}const $u="top",rr="left",sr="right",Do="bottom",lK="top-left",uK="top-right",cK="bottom-left",fK="bottom-right",I3="start",z3="middle",Tn="end",dK="x",hK="y",$g="group",P3="axis",B3="title",pK="frame",gK="scope",j3="legend",xC="row-header",_C="row-footer",wC="row-title",kC="column-header",$C="column-footer",EC="column-title",mK="padding",yK="symbol",CC="fit",SC="fit-x",AC="fit-y",bK="pad",U3="none",Eg="all",q3="each",W3="flush",No="column",Oo="row";function TC(e){z.call(this,null,e)}K(TC,z,{transform(e,t){const n=t.dataflow,i=e.mark,r=i.marktype,s=yi[r],o=s.bound;let a=i.bounds,l;if(s.nested)i.items.length&&n.dirty(i.items[0]),a=Cg(i,o),i.items.forEach(u=>{u.bounds.clear().union(a)});else if(r===$g||e.modified())switch(t.visit(t.MOD,u=>n.dirty(u)),a.clear(),i.items.forEach(u=>a.union(Cg(u,o))),i.role){case P3:case j3:case B3:t.reflow()}else l=t.changed(t.REM),t.visit(t.ADD,u=>{a.union(Cg(u,o))}),t.visit(t.MOD,u=>{l=l||a.alignsWith(u.bounds),n.dirty(u),a.union(Cg(u,o))}),l&&(a.clear(),i.items.forEach(u=>a.union(u.bounds)));return bC(i),t.modifies("bounds")}});function Cg(e,t,n){return t(e.bounds.clear(),e,n)}const MC=":vega_identifier:";function H3(e){z.call(this,0,e)}H3.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},K(H3,z,{transform(e,t){const n=vK(t.dataflow),i=e.as;let r=n.value;return t.visit(t.ADD,s=>s[i]=s[i]||++r),n.set(this.value=r),t}});function vK(e){return e._signals[MC]||(e._signals[MC]=e.add(0))}function FC(e){z.call(this,null,e)}K(FC,z,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,xK(e),e.index),n.group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);const i=n.marktype===$g?Zp:Yp;return t.visit(t.ADD,r=>i.call(r,n)),(e.modified("clip")||e.modified("interactive"))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}});function xK(e){const t=e.groups,n=e.parent;return t&&t.size===1?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}function DC(e){z.call(this,null,e)}const NC={parity:e=>e.filter((t,n)=>n%2?t.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((i,r)=>!r||!OC(n.bounds,i.bounds,t)?(n=i,1):i.opacity=0)}},OC=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),RC=(e,t)=>{for(var n=1,i=e.length,r=e[0].bounds,s;n{const t=e.bounds;return t.width()>1&&t.height()>1},wK=(e,t,n)=>{var i=e.range(),r=new Ot;return t===$u||t===Do?r.set(i[0],-1/0,i[1],1/0):r.set(-1/0,i[0],1/0,i[1]),r.expand(n||1),s=>r.encloses(s.bounds)},LC=e=>(e.forEach(t=>t.opacity=1),e),IC=(e,t)=>e.reflow(t.modified()).modifies("opacity");K(DC,z,{transform(e,t){const n=NC[e.method]||NC.parity,i=e.separation||0;let r=t.materialize(t.SOURCE).source,s,o;if(!r||!r.length)return;if(!e.method)return e.modified("method")&&(LC(r),t=IC(t,e)),t;if(r=r.filter(_K),!r.length)return;if(e.sort&&(r=r.slice().sort(e.sort)),s=LC(r),t=IC(t,e),s.length>=3&&RC(s,i)){do s=n(s,i);while(s.length>=3&&RC(s,i));s.length<3&&!Ue(r).opacity&&(s.length>1&&(Ue(s).opacity=0),Ue(r).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(o=wK(e.boundScale,e.boundOrient,+e.boundTolerance),r.forEach(l=>{o(l)||(l.opacity=0)}));const a=s[0].mark.bounds.clear();return r.forEach(l=>{l.opacity&&a.union(l.bounds)}),t}});function zC(e){z.call(this,null,e)}K(zC,z,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,i=>n.dirty(i)),t.fields&&t.fields.zindex){const i=t.source&&t.source[0];i&&(i.mark.zdirty=!0)}}});const xn=new Ot;function Eu(e,t,n){return e[t]===n?0:(e[t]=n,1)}function kK(e){var t=e.items[0].orient;return t===rr||t===sr}function $K(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}function EK(e,t,n,i){var r=t.items[0],s=r.datum,o=r.translate!=null?r.translate:.5,a=r.orient,l=$K(s),u=r.range,c=r.offset,f=r.position,d=r.minExtent,h=r.maxExtent,p=s.title&&r.items[l[2]].items[0],g=r.titlePadding,m=r.bounds,y=p&&p3(p),b=0,v=0,x,_;switch(xn.clear().union(m),m.clear(),(x=l[0])>-1&&m.union(r.items[x].bounds),(x=l[1])>-1&&m.union(r.items[x].bounds),a){case $u:b=f||0,v=-c,_=Math.max(d,Math.min(h,-m.y1)),m.add(0,-_).add(u,0),p&&Sg(e,p,_,g,y,0,-1,m);break;case rr:b=-c,v=f||0,_=Math.max(d,Math.min(h,-m.x1)),m.add(-_,0).add(0,u),p&&Sg(e,p,_,g,y,1,-1,m);break;case sr:b=n+c,v=f||0,_=Math.max(d,Math.min(h,m.x2)),m.add(0,0).add(_,u),p&&Sg(e,p,_,g,y,1,1,m);break;case Do:b=f||0,v=i+c,_=Math.max(d,Math.min(h,m.y2)),m.add(0,0).add(u,_),p&&Sg(e,p,_,g,0,0,1,m);break;default:b=r.x,v=r.y}return Ss(m.translate(b,v),r),Eu(r,"x",b+o)|Eu(r,"y",v+o)&&(r.bounds=xn,e.dirty(r),r.bounds=m,e.dirty(r)),r.mark.bounds.clear().union(m)}function Sg(e,t,n,i,r,s,o,a){const l=t.bounds;if(t.auto){const u=o*(n+r+i);let c=0,f=0;e.dirty(t),s?c=(t.x||0)-(t.x=u):f=(t.y||0)-(t.y=u),t.mark.bounds.clear().union(l.translate(-c,-f)),e.dirty(t)}a.union(l)}const PC=(e,t)=>Math.floor(Math.min(e,t)),BC=(e,t)=>Math.ceil(Math.max(e,t));function CK(e){var t=e.items,n=t.length,i=0,r,s;const o={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;i1)for(w=0;w0&&(v[w]+=M/2);if(a&&xt(n.center,Oo)&&c!==1)for(w=0;w0&&(x[w]+=T/2);for(w=0;wr&&(e.warn("Grid headers exceed limit: "+r),t=t.slice(0,r)),g+=s,b=0,x=t.length;b=0&&(w=n[v])==null;v-=d);a?($=h==null?w.x:Math.round(w.bounds.x1+h*w.bounds.width()),S=g):($=g,S=h==null?w.y:Math.round(w.bounds.y1+h*w.bounds.height())),_.union(k.bounds.translate($-(k.x||0),S-(k.y||0))),k.x=$,k.y=S,e.dirty(k),m=o(m,_[u])}return m}function qC(e,t,n,i,r,s){if(t){e.dirty(t);var o=n,a=n;i?o=Math.round(r.x1+s*r.width()):a=Math.round(r.y1+s*r.height()),t.bounds.translate(o-(t.x||0),a-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=o,t.y=a,e.dirty(t)}}function DK(e,t){const n=e[t]||{};return(i,r)=>n[i]!=null?n[i]:e[i]!=null?e[i]:r}function NK(e,t){let n=-1/0;return e.forEach(i=>{i.offset!=null&&(n=Math.max(n,i.offset))}),n>-1/0?n:t}function OK(e,t,n,i,r,s,o){const a=DK(n,t),l=NK(e,a("offset",0)),u=a("anchor",I3),c=u===Tn?1:u===z3?.5:0,f={align:q3,bounds:a("bounds",W3),columns:a("direction")==="vertical"?1:e.length,padding:a("margin",8),center:a("center"),nodirty:!0};switch(t){case rr:f.anchor={x:Math.floor(i.x1)-l,column:Tn,y:c*(o||i.height()+2*i.y1),row:u};break;case sr:f.anchor={x:Math.ceil(i.x2)+l,y:c*(o||i.height()+2*i.y1),row:u};break;case $u:f.anchor={y:Math.floor(r.y1)-l,row:Tn,x:c*(s||r.width()+2*r.x1),column:u};break;case Do:f.anchor={y:Math.ceil(r.y2)+l,x:c*(s||r.width()+2*r.x1),column:u};break;case lK:f.anchor={x:l,y:l};break;case uK:f.anchor={x:s-l,y:l,column:Tn};break;case cK:f.anchor={x:l,y:o-l,row:Tn};break;case fK:f.anchor={x:s-l,y:o-l,column:Tn,row:Tn};break}return f}function RK(e,t){var n=t.items[0],i=n.datum,r=n.orient,s=n.bounds,o=n.x,a=n.y,l,u;return n._bounds?n._bounds.clear().union(s):n._bounds=s.clone(),s.clear(),IK(e,n,n.items[0].items[0]),s=LK(n,s),l=2*n.padding,u=2*n.padding,s.empty()||(l=Math.ceil(s.width()+l),u=Math.ceil(s.height()+u)),i.type===yK&&zK(n.items[0].items[0].items[0].items),r!==U3&&(n.x=o=0,n.y=a=0),n.width=l,n.height=u,Ss(s.set(o,a,o+l,a+u),n),n.mark.bounds.clear().union(s),n}function LK(e,t){return e.items.forEach(n=>t.union(n.bounds)),t.x1=e.padding,t.y1=e.padding,t}function IK(e,t,n){var i=t.padding,r=i-n.x,s=i-n.y;if(!t.datum.title)(r||s)&&If(e,n,r,s);else{var o=t.items[1].items[0],a=o.anchor,l=t.titlePadding||0,u=i-o.x,c=i-o.y;switch(o.orient){case rr:r+=Math.ceil(o.bounds.width())+l;break;case sr:case Do:break;default:s+=o.bounds.height()+l}switch((r||s)&&If(e,n,r,s),o.orient){case rr:c+=Cu(t,n,o,a,1,1);break;case sr:u+=Cu(t,n,o,Tn,0,0)+l,c+=Cu(t,n,o,a,1,1);break;case Do:u+=Cu(t,n,o,a,0,0),c+=Cu(t,n,o,Tn,-1,0,1)+l;break;default:u+=Cu(t,n,o,a,0,0)}(u||c)&&If(e,o,u,c),(u=Math.round(o.bounds.x1-i))<0&&(If(e,n,-u,0),If(e,o,-u,0))}}function Cu(e,t,n,i,r,s,o){const a=e.datum.type!=="symbol",l=n.datum.vgrad,u=a&&(s||!l)&&!o?t.items[0]:t,c=u.bounds[r?"y2":"x2"]-e.padding,f=l&&s?c:0,d=l&&s?0:c,h=r<=0?0:p3(n);return Math.round(i===I3?f:i===Tn?d-h:.5*(c-h))}function If(e,t,n,i){t.x+=n,t.y+=i,t.bounds.translate(n,i),t.mark.bounds.translate(n,i),e.dirty(t)}function zK(e){const t=e.reduce((n,i)=>(n[i.column]=Math.max(i.bounds.x2-i.x,n[i.column]||0),n),{});e.forEach(n=>{n.width=t[n.column],n.height=n.bounds.y2-n.y})}function PK(e,t,n,i,r){var s=t.items[0],o=s.frame,a=s.orient,l=s.anchor,u=s.offset,c=s.padding,f=s.items[0].items[0],d=s.items[1]&&s.items[1].items[0],h=a===rr||a===sr?i:n,p=0,g=0,m=0,y=0,b=0,v;if(o!==$g?a===rr?(p=r.y2,h=r.y1):a===sr?(p=r.y1,h=r.y2):(p=r.x1,h=r.x2):a===rr&&(p=i,h=0),v=l===I3?p:l===Tn?h:(p+h)/2,d&&d.text){switch(a){case $u:case Do:b=f.bounds.height()+c;break;case rr:y=f.bounds.width()+c;break;case sr:y=-f.bounds.width()-c;break}xn.clear().union(d.bounds),xn.translate(y-(d.x||0),b-(d.y||0)),Eu(d,"x",y)|Eu(d,"y",b)&&(e.dirty(d),d.bounds.clear().union(xn),d.mark.bounds.clear().union(xn),e.dirty(d)),xn.clear().union(d.bounds)}else xn.clear();switch(xn.union(f.bounds),a){case $u:g=v,m=r.y1-xn.height()-u;break;case rr:g=r.x1-xn.width()-u,m=v;break;case sr:g=r.x2+xn.width()+u,m=v;break;case Do:g=v,m=r.y2+u;break;default:g=s.x,m=s.y}return Eu(s,"x",g)|Eu(s,"y",m)&&(xn.translate(g,m),e.dirty(s),s.bounds.clear().union(xn),t.bounds.clear().union(xn),e.dirty(s)),s.bounds}function WC(e){z.call(this,null,e)}K(WC,z,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach(i=>{e.layout&&TK(n,i,e.layout),jK(n,i,e)}),BK(e.mark.group)?t.reflow():t}});function BK(e){return e&&e.mark.role!=="legend-entry"}function jK(e,t,n){var i=t.items,r=Math.max(0,t.width||0),s=Math.max(0,t.height||0),o=new Ot().set(0,0,r,s),a=o.clone(),l=o.clone(),u=[],c,f,d,h,p,g;for(p=0,g=i.length;p{d=y.orient||sr,d!==U3&&(m[d]||(m[d]=[])).push(y)});for(const y in m){const b=m[y];UC(e,b,OK(b,y,n.legends,a,l,r,s))}u.forEach(y=>{const b=y.bounds;if(b.equals(y._bounds)||(y.bounds=y._bounds,e.dirty(y),y.bounds=b,e.dirty(y)),n.autosize&&(n.autosize.type===CC||n.autosize.type===SC||n.autosize.type===AC))switch(y.orient){case rr:case sr:o.add(b.x1,0).add(b.x2,0);break;case $u:case Do:o.add(0,b.y1).add(0,b.y2)}else o.union(b)})}o.union(a).union(l),c&&o.union(PK(e,c,r,s,o)),t.clip&&o.set(0,0,t.width||0,t.height||0),UK(e,t,o,n)}function UK(e,t,n,i){const r=i.autosize||{},s=r.type;if(e._autosize<1||!s)return;let o=e._width,a=e._height,l=Math.max(0,t.width||0),u=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,t.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-l)),h=Math.max(0,Math.ceil(n.y2-c));if(r.contains===mK){const p=e.padding();o-=p.left+p.right,a-=p.top+p.bottom}s===U3?(u=0,f=0,l=o,c=a):s===CC?(l=Math.max(0,o-u-d),c=Math.max(0,a-f-h)):s===SC?(l=Math.max(0,o-u-d),a=c+f+h):s===AC?(o=l+u+d,c=Math.max(0,a-f-h)):s===bK&&(o=l+u+d,a=c+f+h),e._resizeView(o,a,l,c,[u,f],r.resize)}const qK=Object.freeze(Object.defineProperty({__proto__:null,bound:TC,identifier:H3,mark:FC,overlap:DC,render:zC,viewlayout:WC},Symbol.toStringTag,{value:"Module"}));function HC(e){z.call(this,null,e)}K(HC,z,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,s=e.scale,o=e.count==null?e.values?e.values.length:10:e.count,a=Pb(s,o,e.minstep),l=e.format||B$(n,s,a,e.formatSpecifier,e.formatType,!!e.values),u=e.values?P$(s,e.values,a):Bb(s,a);return r&&(i.rem=r),r=u.map((c,f)=>et({index:f/(u.length-1||1),value:c,label:l(c)})),e.extra&&r.length&&r.push(et({index:-1,extra:{value:r[0].value},label:""})),i.source=r,i.add=r,this.value=r,i}});function GC(e){z.call(this,null,e)}function WK(){return et({})}function HK(e){const t=Gl().test(n=>n.exit);return t.lookup=n=>t.get(e(n)),t}K(GC,z,{transform(e,t){var n=t.dataflow,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.item||WK,s=e.key||ye,o=this.value;return q(i.encode)&&(i.encode=null),o&&(e.modified("key")||t.modified(s))&&U("DataJoin does not support modified key function or fields."),o||(t=t.addAll(),this.value=o=HK(s)),t.visit(t.ADD,a=>{const l=s(a);let u=o.get(l);u?u.exit?(o.empty--,i.add.push(u)):i.mod.push(u):(u=r(a),o.set(l,u),i.add.push(u)),u.datum=a,u.exit=!1}),t.visit(t.MOD,a=>{const l=s(a),u=o.get(l);u&&(u.datum=a,i.mod.push(u))}),t.visit(t.REM,a=>{const l=s(a),u=o.get(l);a===u.datum&&!u.exit&&(i.rem.push(u),u.exit=!0,++o.empty)}),t.changed(t.ADD_MOD)&&i.modifies("datum"),(t.clean()||e.clean&&o.empty>n.cleanThreshold)&&n.runAfter(o.clean),i}});function VC(e){z.call(this,null,e)}K(VC,z,{transform(e,t){var n=t.fork(t.ADD_REM),i=e.mod||!1,r=e.encoders,s=t.encode;if(q(s))if(n.changed()||s.every(f=>r[f]))s=s[0],n.encode=null;else return t.StopPropagation;var o=s==="enter",a=r.update||io,l=r.enter||io,u=r.exit||io,c=(s&&!o?r[s]:a)||io;if(t.changed(t.ADD)&&(t.visit(t.ADD,f=>{l(f,e),a(f,e)}),n.modifies(l.output),n.modifies(a.output),c!==io&&c!==a&&(t.visit(t.ADD,f=>{c(f,e)}),n.modifies(c.output))),t.changed(t.REM)&&u!==io&&(t.visit(t.REM,f=>{u(f,e)}),n.modifies(u.output)),o||c!==io){const f=t.MOD|(e.modified()?t.REFLOW:0);o?(t.visit(f,d=>{const h=l(d,e)||i;(c(d,e)||h)&&n.mod.push(d)}),n.mod.length&&n.modifies(l.output)):t.visit(f,d=>{(c(d,e)||i)&&n.mod.push(d)}),n.mod.length&&n.modifies(c.output)}return n.changed()?n:t.StopPropagation}});function XC(e){z.call(this,[],e)}K(XC,z,{transform(e,t){if(this.value!=null&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,s=e.type||Hp,o=e.scale,a=+e.limit,l=Pb(o,e.count==null?5:e.count,e.minstep),u=!!e.values||s===Hp,c=e.format||W$(n,o,l,s,e.formatSpecifier,e.formatType,u),f=e.values||q$(o,l),d,h,p,g,m;return r&&(i.rem=r),s===Hp?(a&&f.length>a?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),r=f.slice(0,a-1),m=!0):r=f,Me(p=e.size)?(!e.values&&o(r[0])===0&&(r=r.slice(1)),g=r.reduce((y,b)=>Math.max(y,p(b,e)),0)):p=pn(g=p||8),r=r.map((y,b)=>et({index:b,label:c(y,b,r),value:y,offset:g,size:p(y,e)})),m&&(m=f[r.length],r.push(et({index:r.length,label:`…${f.length-r.length} entries`,value:m,offset:g,size:p(m,e)})))):s===yX?(d=o.domain(),h=R$(o,d[0],Ue(d)),f.length<3&&!e.values&&d[0]!==Ue(d)&&(f=[d[0],Ue(d)]),r=f.map((y,b)=>et({index:b,label:c(y,b,f),value:y,perc:h(y)}))):(p=f.length-1,h=AX(o),r=f.map((y,b)=>et({index:b,label:c(y,b,f),value:y,perc:b?h(y):0,perc2:b===p?1:h(f[b+1])}))),i.source=r,i.add=r,this.value=r,i}});const GK=e=>e.source.x,VK=e=>e.source.y,XK=e=>e.target.x,YK=e=>e.target.y;function G3(e){z.call(this,{},e)}G3.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]},K(G3,z,{transform(e,t){var n=e.sourceX||GK,i=e.sourceY||VK,r=e.targetX||XK,s=e.targetY||YK,o=e.as||"path",a=e.orient||"vertical",l=e.shape||"line",u=JC.get(l+"-"+a)||JC.get(l);return u||U("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,c=>{c[o]=u(n(c),i(c),r(c),s(c))}),t.reflow(e.modified()).modifies(o)}});const YC=(e,t,n,i)=>"M"+e+","+t+"L"+n+","+i,ZK=(e,t,n,i)=>YC(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),ZC=(e,t,n,i)=>{var r=n-e,s=i-t,o=Math.hypot(r,s)/2,a=180*Math.atan2(s,r)/Math.PI;return"M"+e+","+t+"A"+o+","+o+" "+a+" 0 1 "+n+","+i},KK=(e,t,n,i)=>ZC(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),KC=(e,t,n,i)=>{const r=n-e,s=i-t,o=.2*(r+s),a=.2*(s-r);return"M"+e+","+t+"C"+(e+o)+","+(t+a)+" "+(n+a)+","+(i-o)+" "+n+","+i},JC=Gl({line:YC,"line-radial":ZK,arc:ZC,"arc-radial":KK,curve:KC,"curve-radial":(e,t,n,i)=>KC(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),"orthogonal-horizontal":(e,t,n,i)=>"M"+e+","+t+"V"+i+"H"+n,"orthogonal-vertical":(e,t,n,i)=>"M"+e+","+t+"H"+n+"V"+i,"orthogonal-radial":(e,t,n,i)=>{const r=Math.cos(e),s=Math.sin(e),o=Math.cos(n),a=Math.sin(n),l=Math.abs(n-e)>Math.PI?n<=e:n>e;return"M"+t*r+","+t*s+"A"+t+","+t+" 0 0,"+(l?1:0)+" "+t*o+","+t*a+"L"+i*o+","+i*a},"diagonal-horizontal":(e,t,n,i)=>{const r=(e+n)/2;return"M"+e+","+t+"C"+r+","+t+" "+r+","+i+" "+n+","+i},"diagonal-vertical":(e,t,n,i)=>{const r=(t+i)/2;return"M"+e+","+t+"C"+e+","+r+" "+n+","+r+" "+n+","+i},"diagonal-radial":(e,t,n,i)=>{const r=Math.cos(e),s=Math.sin(e),o=Math.cos(n),a=Math.sin(n),l=(t+i)/2;return"M"+t*r+","+t*s+"C"+l*r+","+l*s+" "+l*o+","+l*a+" "+i*o+","+i*a}});function V3(e){z.call(this,null,e)}V3.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]},K(V3,z,{transform(e,t){var n=e.as||["startAngle","endAngle"],i=n[0],r=n[1],s=e.field||ql,o=e.startAngle||0,a=e.endAngle!=null?e.endAngle:2*Math.PI,l=t.source,u=l.map(s),c=u.length,f=o,d=(a-o)/T4(u),h=hi(c),p,g,m;for(e.sort&&h.sort((y,b)=>u[y]-u[b]),p=0;p-1)return i;var r=t.domain,s=e.type,o=t.zero||t.zero===void 0&&QK(e),a,l;if(!r)return 0;if(QC(s)&&t.padding&&r[0]!==Ue(r)&&(r=sJ(s,r,t.range,t.padding,t.exponent,t.constant)),(o||t.domainMin!=null||t.domainMax!=null||t.domainMid!=null)&&(a=(r=r.slice()).length-1||1,o&&(r[0]>0&&(r[0]=0),r[a]<0&&(r[a]=0)),t.domainMin!=null&&(r[0]=t.domainMin),t.domainMax!=null&&(r[a]=t.domainMax),t.domainMid!=null)){l=t.domainMid;const u=l>r[a]?a+1:lr+(s<0?-1:s>0?1:0),0));i!==t.length&&n.warn("Log scale domain includes zero: "+J(t))}return t}function oJ(e,t,n){let i=t.bins;if(i&&!q(i)){const r=e.domain(),s=r[0],o=Ue(r),a=i.step;let l=i.start==null?s:i.start,u=i.stop==null?o:i.stop;a||U("Scale bins parameter missing step property."),lo&&(u=a*Math.floor(o/a)),i=hi(l,u+a/2,a)}return i?e.bins=i:e.bins&&delete e.bins,e.type===Db&&(i?!t.domain&&!t.domainRaw&&(e.domain(i),n=i.length):e.bins=e.domain()),n}function aJ(e,t,n){var i=e.type,r=t.round||!1,s=t.range;if(t.rangeStep!=null)s=lJ(i,t,n);else if(t.scheme&&(s=uJ(i,t,n),Me(s))){if(e.interpolator)return e.interpolator(s);U(`Scale type ${i} does not support interpolating color schemes.`)}if(s&&F$(i))return e.interpolator(Wp(X3(s,t.reverse),t.interpolate,t.interpolateGamma));s&&t.interpolate&&e.interpolate?e.interpolate(Ib(t.interpolate,t.interpolateGamma)):Me(e.round)?e.round(r):Me(e.rangeRound)&&e.interpolate(r?hf:vo),s&&e.range(X3(s,t.reverse))}function lJ(e,t,n){e!==$$&&e!==Fb&&U("Only band and point scales support rangeStep.");var i=(t.paddingOuter!=null?t.paddingOuter:t.padding)||0,r=e===Fb?1:(t.paddingInner!=null?t.paddingInner:t.padding)||0;return[0,t.rangeStep*Tb(n,r,i)]}function uJ(e,t,n){var i=t.schemeExtent,r,s;return q(t.scheme)?s=Wp(t.scheme,t.interpolate,t.interpolateGamma):(r=t.scheme.toLowerCase(),s=zb(r),s||U(`Unrecognized scheme name: ${t.scheme}`)),n=e===Up?n+1:e===Db?n-1:e===mu||e===jp?+t.schemeCount||JK:n,F$(e)?nS(s,i,t.reverse):Me(s)?O$(nS(s,i),n):e===Mb?s:s.slice(0,n)}function nS(e,t,n){return Me(e)&&(t||n)?N$(e,X3(t||[0,1],n)):e}function X3(e,t){return t?e.slice().reverse():e}function iS(e){z.call(this,null,e)}K(iS,z,{transform(e,t){const n=e.modified("sort")||t.changed(t.ADD)||t.modified(e.sort.fields)||t.modified("datum");return n&&t.source.sort(xa(e.sort)),this.modified(n),t}});const rS="zero",sS="center",oS="normalize",aS=["y0","y1"];function Y3(e){z.call(this,null,e)}Y3.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:rS,values:[rS,sS,oS]},{name:"as",type:"string",array:!0,length:2,default:aS}]},K(Y3,z,{transform(e,t){var n=e.as||aS,i=n[0],r=n[1],s=xa(e.sort),o=e.field||ql,a=e.offset===sS?cJ:e.offset===oS?fJ:dJ,l,u,c,f;for(l=hJ(t.source,e.groupby,s,o),u=0,c=l.length,f=l.max;ug(c),o,a,l,u,c,f,d,h,p;if(t==null)r.push(e.slice());else for(o={},a=0,l=e.length;ap&&(p=h),n&&d.sort(n)}return r.max=p,r}const pJ=Object.freeze(Object.defineProperty({__proto__:null,axisticks:HC,datajoin:GC,encode:VC,legendentries:XC,linkpath:G3,pie:V3,scale:eS,sortitems:iS,stack:Y3},Symbol.toStringTag,{value:"Module"}));var _e=1e-6,Tg=1e-12,Le=Math.PI,Ct=Le/2,Mg=Le/4,Mn=Le*2,Mt=180/Le,Ne=Le/180,qe=Math.abs,Su=Math.atan,Ii=Math.atan2,we=Math.cos,Fg=Math.ceil,lS=Math.exp,Z3=Math.hypot,Dg=Math.log,K3=Math.pow,be=Math.sin,zi=Math.sign||function(e){return e>0?1:e<0?-1:0},Fn=Math.sqrt,J3=Math.tan;function uS(e){return e>1?0:e<-1?Le:Math.acos(e)}function Qn(e){return e>1?Ct:e<-1?-Ct:Math.asin(e)}function sn(){}function Ng(e,t){e&&fS.hasOwnProperty(e.type)&&fS[e.type](e,t)}var cS={Feature:function(e,t){Ng(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,i=-1,r=n.length;++i=0?1:-1,r=i*n,s=we(t),o=be(t),a=nv*o,l=tv*s+a*we(r),u=a*i*be(r);Og.add(Ii(u,l)),ev=e,tv=s,nv=o}function bJ(e){return Rg=new Sn,Ts(e,Vr),Rg*2}function Lg(e){return[Ii(e[1],e[0]),Qn(e[2])]}function Pa(e){var t=e[0],n=e[1],i=we(n);return[i*we(t),i*be(t),be(n)]}function Ig(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Au(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function iv(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function zg(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Pg(e){var t=Fn(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var kt,ei,St,vi,Ba,mS,yS,Tu,zf,Ro,Ms,Fs={point:rv,lineStart:vS,lineEnd:xS,polygonStart:function(){Fs.point=_S,Fs.lineStart=vJ,Fs.lineEnd=xJ,zf=new Sn,Vr.polygonStart()},polygonEnd:function(){Vr.polygonEnd(),Fs.point=rv,Fs.lineStart=vS,Fs.lineEnd=xS,Og<0?(kt=-(St=180),ei=-(vi=90)):zf>_e?vi=90:zf<-_e&&(ei=-90),Ms[0]=kt,Ms[1]=St},sphere:function(){kt=-(St=180),ei=-(vi=90)}};function rv(e,t){Ro.push(Ms=[kt=e,St=e]),tvi&&(vi=t)}function bS(e,t){var n=Pa([e*Ne,t*Ne]);if(Tu){var i=Au(Tu,n),r=[i[1],-i[0],0],s=Au(r,i);Pg(s),s=Lg(s);var o=e-Ba,a=o>0?1:-1,l=s[0]*Mt*a,u,c=qe(o)>180;c^(a*Bavi&&(vi=u)):(l=(l+360)%360-180,c^(a*Bavi&&(vi=t))),c?exi(kt,St)&&(St=e):xi(e,St)>xi(kt,St)&&(kt=e):St>=kt?(eSt&&(St=e)):e>Ba?xi(kt,e)>xi(kt,St)&&(St=e):xi(e,St)>xi(kt,St)&&(kt=e)}else Ro.push(Ms=[kt=e,St=e]);tvi&&(vi=t),Tu=n,Ba=e}function vS(){Fs.point=bS}function xS(){Ms[0]=kt,Ms[1]=St,Fs.point=rv,Tu=null}function _S(e,t){if(Tu){var n=e-Ba;zf.add(qe(n)>180?n+(n>0?360:-360):n)}else mS=e,yS=t;Vr.point(e,t),bS(e,t)}function vJ(){Vr.lineStart()}function xJ(){_S(mS,yS),Vr.lineEnd(),qe(zf)>_e&&(kt=-(St=180)),Ms[0]=kt,Ms[1]=St,Tu=null}function xi(e,t){return(t-=e)<0?t+360:t}function _J(e,t){return e[0]-t[0]}function wS(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:txi(i[0],i[1])&&(i[1]=r[1]),xi(r[0],i[1])>xi(i[0],i[1])&&(i[0]=r[0])):s.push(i=r);for(o=-1/0,n=s.length-1,t=0,i=s[n];t<=n;i=r,++t)r=s[t],(a=xi(i[1],r[0]))>o&&(o=a,kt=r[0],St=i[1])}return Ro=Ms=null,kt===1/0||ei===1/0?[[NaN,NaN],[NaN,NaN]]:[[kt,ei],[St,vi]]}var Pf,Bg,jg,Ug,qg,Wg,Hg,Gg,sv,ov,av,kS,$S,Dn,Nn,On,or={sphere:sn,point:lv,lineStart:ES,lineEnd:CS,polygonStart:function(){or.lineStart=EJ,or.lineEnd=CJ},polygonEnd:function(){or.lineStart=ES,or.lineEnd=CS}};function lv(e,t){e*=Ne,t*=Ne;var n=we(t);Bf(n*we(e),n*be(e),be(t))}function Bf(e,t,n){++Pf,jg+=(e-jg)/Pf,Ug+=(t-Ug)/Pf,qg+=(n-qg)/Pf}function ES(){or.point=kJ}function kJ(e,t){e*=Ne,t*=Ne;var n=we(t);Dn=n*we(e),Nn=n*be(e),On=be(t),or.point=$J,Bf(Dn,Nn,On)}function $J(e,t){e*=Ne,t*=Ne;var n=we(t),i=n*we(e),r=n*be(e),s=be(t),o=Ii(Fn((o=Nn*s-On*r)*o+(o=On*i-Dn*s)*o+(o=Dn*r-Nn*i)*o),Dn*i+Nn*r+On*s);Bg+=o,Wg+=o*(Dn+(Dn=i)),Hg+=o*(Nn+(Nn=r)),Gg+=o*(On+(On=s)),Bf(Dn,Nn,On)}function CS(){or.point=lv}function EJ(){or.point=SJ}function CJ(){SS(kS,$S),or.point=lv}function SJ(e,t){kS=e,$S=t,e*=Ne,t*=Ne,or.point=SS;var n=we(t);Dn=n*we(e),Nn=n*be(e),On=be(t),Bf(Dn,Nn,On)}function SS(e,t){e*=Ne,t*=Ne;var n=we(t),i=n*we(e),r=n*be(e),s=be(t),o=Nn*s-On*r,a=On*i-Dn*s,l=Dn*r-Nn*i,u=Z3(o,a,l),c=Qn(u),f=u&&-c/u;sv.add(f*o),ov.add(f*a),av.add(f*l),Bg+=c,Wg+=c*(Dn+(Dn=i)),Hg+=c*(Nn+(Nn=r)),Gg+=c*(On+(On=s)),Bf(Dn,Nn,On)}function AJ(e){Pf=Bg=jg=Ug=qg=Wg=Hg=Gg=0,sv=new Sn,ov=new Sn,av=new Sn,Ts(e,or);var t=+sv,n=+ov,i=+av,r=Z3(t,n,i);return rLe&&(e-=Math.round(e/Mn)*Mn),[e,t]}cv.invert=cv;function AS(e,t,n){return(e%=Mn)?t||n?uv(MS(e),FS(t,n)):MS(e):t||n?FS(t,n):cv}function TS(e){return function(t,n){return t+=e,qe(t)>Le&&(t-=Math.round(t/Mn)*Mn),[t,n]}}function MS(e){var t=TS(e);return t.invert=TS(-e),t}function FS(e,t){var n=we(e),i=be(e),r=we(t),s=be(t);function o(a,l){var u=we(l),c=we(a)*u,f=be(a)*u,d=be(l),h=d*n+c*i;return[Ii(f*r-h*s,c*n-d*i),Qn(h*r+f*s)]}return o.invert=function(a,l){var u=we(l),c=we(a)*u,f=be(a)*u,d=be(l),h=d*r-f*s;return[Ii(f*r+d*s,c*n+h*i),Qn(h*n-c*i)]},o}function TJ(e){e=AS(e[0]*Ne,e[1]*Ne,e.length>2?e[2]*Ne:0);function t(n){return n=e(n[0]*Ne,n[1]*Ne),n[0]*=Mt,n[1]*=Mt,n}return t.invert=function(n){return n=e.invert(n[0]*Ne,n[1]*Ne),n[0]*=Mt,n[1]*=Mt,n},t}function MJ(e,t,n,i,r,s){if(n){var o=we(t),a=be(t),l=i*n;r==null?(r=t+i*Mn,s=t-l/2):(r=DS(o,r),s=DS(o,s),(i>0?rs)&&(r+=i*Mn));for(var u,c=r;i>0?c>s:c1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Vg(e,t){return qe(e[0]-t[0])<_e&&qe(e[1]-t[1])<_e}function Xg(e,t,n,i){this.x=e,this.z=t,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function OS(e,t,n,i,r){var s=[],o=[],a,l;if(e.forEach(function(p){if(!((g=p.length-1)<=0)){var g,m=p[0],y=p[g],b;if(Vg(m,y)){if(!m[2]&&!y[2]){for(r.lineStart(),a=0;a=0;--a)r.point((f=c[a])[0],f[1]);else i(d.x,d.p.x,-1,r);d=d.p}d=d.o,c=d.z,h=!h}while(!d.v);r.lineEnd()}}}function RS(e){if(t=e.length){for(var t,n=0,i=e[0],r;++n=0?1:-1,E=S*$,A=E>Le,R=m*k;if(l.add(Ii(R*S*be(E),y*w+R*we(E))),o+=A?$+S*Mn:$,A^p>=n^x>=n){var C=Au(Pa(h),Pa(v));Pg(C);var M=Au(s,C);Pg(M);var T=(A^$>=0?-1:1)*Qn(M[2]);(i>T||i===T&&(C[0]||C[1]))&&(a+=A^$>=0?1:-1)}}return(o<-_e||o<_e&&l<-Tg)^a&1}function LS(e,t,n,i){return function(r){var s=t(r),o=NS(),a=t(o),l=!1,u,c,f,d={point:h,lineStart:g,lineEnd:m,polygonStart:function(){d.point=y,d.lineStart=b,d.lineEnd=v,c=[],u=[]},polygonEnd:function(){d.point=h,d.lineStart=g,d.lineEnd=m,c=A4(c);var x=FJ(u,i);c.length?(l||(r.polygonStart(),l=!0),OS(c,NJ,x,n,r)):x&&(l||(r.polygonStart(),l=!0),r.lineStart(),n(null,null,1,r),r.lineEnd()),l&&(r.polygonEnd(),l=!1),c=u=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}};function h(x,_){e(x,_)&&r.point(x,_)}function p(x,_){s.point(x,_)}function g(){d.point=p,s.lineStart()}function m(){d.point=h,s.lineEnd()}function y(x,_){f.push([x,_]),a.point(x,_)}function b(){a.lineStart(),f=[]}function v(){y(f[0][0],f[0][1]),a.lineEnd();var x=a.clean(),_=o.result(),k,w=_.length,$,S,E;if(f.pop(),u.push(f),f=null,!!w){if(x&1){if(S=_[0],($=S.length-1)>0){for(l||(r.polygonStart(),l=!0),r.lineStart(),k=0;k<$;++k)r.point((E=S[k])[0],E[1]);r.lineEnd()}return}w>1&&x&2&&_.push(_.pop().concat(_.shift())),c.push(_.filter(DJ))}}return d}}function DJ(e){return e.length>1}function NJ(e,t){return((e=e.x)[0]<0?e[1]-Ct-_e:Ct-e[1])-((t=t.x)[0]<0?t[1]-Ct-_e:Ct-t[1])}const IS=LS(function(){return!0},OJ,LJ,[-Le,-Ct]);function OJ(e){var t=NaN,n=NaN,i=NaN,r;return{lineStart:function(){e.lineStart(),r=1},point:function(s,o){var a=s>0?Le:-Le,l=qe(s-t);qe(l-Le)<_e?(e.point(t,n=(n+o)/2>0?Ct:-Ct),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(s,n),r=0):i!==a&&l>=Le&&(qe(t-i)<_e&&(t-=i*_e),qe(s-a)<_e&&(s-=a*_e),n=RJ(t,n,s,o),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(a,n),r=0),e.point(t=s,n=o),i=a},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-r}}}function RJ(e,t,n,i){var r,s,o=be(e-n);return qe(o)>_e?Su((be(t)*(s=we(i))*be(n)-be(i)*(r=we(t))*be(e))/(r*s*o)):(t+i)/2}function LJ(e,t,n,i){var r;if(e==null)r=n*Ct,i.point(-Le,r),i.point(0,r),i.point(Le,r),i.point(Le,0),i.point(Le,-r),i.point(0,-r),i.point(-Le,-r),i.point(-Le,0),i.point(-Le,r);else if(qe(e[0]-t[0])>_e){var s=e[0]0,r=qe(t)>_e;function s(c,f,d,h){MJ(h,e,n,d,c,f)}function o(c,f){return we(c)*we(f)>t}function a(c){var f,d,h,p,g;return{lineStart:function(){p=h=!1,g=1},point:function(m,y){var b=[m,y],v,x=o(m,y),_=i?x?0:u(m,y):x?u(m+(m<0?Le:-Le),y):0;if(!f&&(p=h=x)&&c.lineStart(),x!==h&&(v=l(f,b),(!v||Vg(f,v)||Vg(b,v))&&(b[2]=1)),x!==h)g=0,x?(c.lineStart(),v=l(b,f),c.point(v[0],v[1])):(v=l(f,b),c.point(v[0],v[1],2),c.lineEnd()),f=v;else if(r&&f&&i^x){var k;!(_&d)&&(k=l(b,f,!0))&&(g=0,i?(c.lineStart(),c.point(k[0][0],k[0][1]),c.point(k[1][0],k[1][1]),c.lineEnd()):(c.point(k[1][0],k[1][1]),c.lineEnd(),c.lineStart(),c.point(k[0][0],k[0][1],3)))}x&&(!f||!Vg(f,b))&&c.point(b[0],b[1]),f=b,h=x,d=_},lineEnd:function(){h&&c.lineEnd(),f=null},clean:function(){return g|(p&&h)<<1}}}function l(c,f,d){var h=Pa(c),p=Pa(f),g=[1,0,0],m=Au(h,p),y=Ig(m,m),b=m[0],v=y-b*b;if(!v)return!d&&c;var x=t*y/v,_=-t*b/v,k=Au(g,m),w=zg(g,x),$=zg(m,_);iv(w,$);var S=k,E=Ig(w,S),A=Ig(S,S),R=E*E-A*(Ig(w,w)-1);if(!(R<0)){var C=Fn(R),M=zg(S,(-E-C)/A);if(iv(M,w),M=Lg(M),!d)return M;var T=c[0],O=f[0],P=c[1],j=f[1],W;O0^M[1]<(qe(M[0]-T)<_e?P:j):P<=M[1]&&M[1]<=j:ne>Le^(T<=M[0]&&M[0]<=O)){var ze=zg(S,(-E+C)/A);return iv(ze,w),[M,Lg(ze)]}}}function u(c,f){var d=i?e:Le-e,h=0;return c<-d?h|=1:c>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return LS(o,a,s,i?[0,-e]:[-Le,e-Le])}function zJ(e,t,n,i,r,s){var o=e[0],a=e[1],l=t[0],u=t[1],c=0,f=1,d=l-o,h=u-a,p;if(p=n-o,!(!d&&p>0)){if(p/=d,d<0){if(p0){if(p>f)return;p>c&&(c=p)}if(p=r-o,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>c&&(c=p)}else if(d>0){if(p0)){if(p/=h,h<0){if(p0){if(p>f)return;p>c&&(c=p)}if(p=s-a,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>c&&(c=p)}else if(h>0){if(p0&&(e[0]=o+c*d,e[1]=a+c*h),f<1&&(t[0]=o+f*d,t[1]=a+f*h),!0}}}}}var jf=1e9,Yg=-jf;function zS(e,t,n,i){function r(u,c){return e<=u&&u<=n&&t<=c&&c<=i}function s(u,c,f,d){var h=0,p=0;if(u==null||(h=o(u,f))!==(p=o(c,f))||l(u,c)<0^f>0)do d.point(h===0||h===3?e:n,h>1?i:t);while((h=(h+f+4)%4)!==p);else d.point(c[0],c[1])}function o(u,c){return qe(u[0]-e)<_e?c>0?0:3:qe(u[0]-n)<_e?c>0?2:1:qe(u[1]-t)<_e?c>0?1:0:c>0?3:2}function a(u,c){return l(u.x,c.x)}function l(u,c){var f=o(u,1),d=o(c,1);return f!==d?f-d:f===0?c[1]-u[1]:f===1?u[0]-c[0]:f===2?u[1]-c[1]:c[0]-u[0]}return function(u){var c=u,f=NS(),d,h,p,g,m,y,b,v,x,_,k,w={point:$,lineStart:R,lineEnd:C,polygonStart:E,polygonEnd:A};function $(T,O){r(T,O)&&c.point(T,O)}function S(){for(var T=0,O=0,P=h.length;Oi&&(Ie-ke)*(i-ze)>(We-ze)*(e-ke)&&++T:We<=i&&(Ie-ke)*(i-ze)<(We-ze)*(e-ke)&&--T;return T}function E(){c=f,d=[],h=[],k=!0}function A(){var T=S(),O=k&&T,P=(d=A4(d)).length;(O||P)&&(u.polygonStart(),O&&(u.lineStart(),s(null,null,1,u),u.lineEnd()),P&&OS(d,a,T,s,u),u.polygonEnd()),c=u,d=h=p=null}function R(){w.point=M,h&&h.push(p=[]),_=!0,x=!1,b=v=NaN}function C(){d&&(M(g,m),y&&x&&f.rejoin(),d.push(f.result())),w.point=$,x&&c.lineEnd()}function M(T,O){var P=r(T,O);if(h&&p.push([T,O]),_)g=T,m=O,y=P,_=!1,P&&(c.lineStart(),c.point(T,O));else if(P&&x)c.point(T,O);else{var j=[b=Math.max(Yg,Math.min(jf,b)),v=Math.max(Yg,Math.min(jf,v))],W=[T=Math.max(Yg,Math.min(jf,T)),O=Math.max(Yg,Math.min(jf,O))];zJ(j,W,e,t,n,i)?(x||(c.lineStart(),c.point(j[0],j[1])),c.point(W[0],W[1]),P||c.lineEnd(),k=!1):P&&(c.lineStart(),c.point(T,O),k=!1)}b=T,v=O,x=P}return w}}function PS(e,t,n){var i=hi(e,t-_e,n).concat(t);return function(r){return i.map(function(s){return[r,s]})}}function BS(e,t,n){var i=hi(e,t-_e,n).concat(t);return function(r){return i.map(function(s){return[s,r]})}}function PJ(){var e,t,n,i,r,s,o,a,l=10,u=l,c=90,f=360,d,h,p,g,m=2.5;function y(){return{type:"MultiLineString",coordinates:b()}}function b(){return hi(Fg(i/c)*c,n,c).map(p).concat(hi(Fg(a/f)*f,o,f).map(g)).concat(hi(Fg(t/l)*l,e,l).filter(function(v){return qe(v%c)>_e}).map(d)).concat(hi(Fg(s/u)*u,r,u).filter(function(v){return qe(v%f)>_e}).map(h))}return y.lines=function(){return b().map(function(v){return{type:"LineString",coordinates:v}})},y.outline=function(){return{type:"Polygon",coordinates:[p(i).concat(g(o).slice(1),p(n).reverse().slice(1),g(a).reverse().slice(1))]}},y.extent=function(v){return arguments.length?y.extentMajor(v).extentMinor(v):y.extentMinor()},y.extentMajor=function(v){return arguments.length?(i=+v[0][0],n=+v[1][0],a=+v[0][1],o=+v[1][1],i>n&&(v=i,i=n,n=v),a>o&&(v=a,a=o,o=v),y.precision(m)):[[i,a],[n,o]]},y.extentMinor=function(v){return arguments.length?(t=+v[0][0],e=+v[1][0],s=+v[0][1],r=+v[1][1],t>e&&(v=t,t=e,e=v),s>r&&(v=s,s=r,r=v),y.precision(m)):[[t,s],[e,r]]},y.step=function(v){return arguments.length?y.stepMajor(v).stepMinor(v):y.stepMinor()},y.stepMajor=function(v){return arguments.length?(c=+v[0],f=+v[1],y):[c,f]},y.stepMinor=function(v){return arguments.length?(l=+v[0],u=+v[1],y):[l,u]},y.precision=function(v){return arguments.length?(m=+v,d=PS(s,r,90),h=BS(t,e,m),p=PS(a,o,90),g=BS(i,n,m),y):m},y.extentMajor([[-180,-90+_e],[180,90-_e]]).extentMinor([[-180,-80-_e],[180,80+_e]])}const Uf=e=>e;var dv=new Sn,hv=new Sn,jS,US,pv,gv,Lo={point:sn,lineStart:sn,lineEnd:sn,polygonStart:function(){Lo.lineStart=BJ,Lo.lineEnd=UJ},polygonEnd:function(){Lo.lineStart=Lo.lineEnd=Lo.point=sn,dv.add(qe(hv)),hv=new Sn},result:function(){var e=dv/2;return dv=new Sn,e}};function BJ(){Lo.point=jJ}function jJ(e,t){Lo.point=qS,jS=pv=e,US=gv=t}function qS(e,t){hv.add(gv*e-pv*t),pv=e,gv=t}function UJ(){qS(jS,US)}const WS=Lo;var Mu=1/0,Zg=Mu,qf=-Mu,Kg=qf,qJ={point:WJ,lineStart:sn,lineEnd:sn,polygonStart:sn,polygonEnd:sn,result:function(){var e=[[Mu,Zg],[qf,Kg]];return qf=Kg=-(Zg=Mu=1/0),e}};function WJ(e,t){eqf&&(qf=e),tKg&&(Kg=t)}const Jg=qJ;var mv=0,yv=0,Wf=0,Qg=0,e0=0,Fu=0,bv=0,vv=0,Hf=0,HS,GS,Xr,Yr,ar={point:ja,lineStart:VS,lineEnd:XS,polygonStart:function(){ar.lineStart=VJ,ar.lineEnd=XJ},polygonEnd:function(){ar.point=ja,ar.lineStart=VS,ar.lineEnd=XS},result:function(){var e=Hf?[bv/Hf,vv/Hf]:Fu?[Qg/Fu,e0/Fu]:Wf?[mv/Wf,yv/Wf]:[NaN,NaN];return mv=yv=Wf=Qg=e0=Fu=bv=vv=Hf=0,e}};function ja(e,t){mv+=e,yv+=t,++Wf}function VS(){ar.point=HJ}function HJ(e,t){ar.point=GJ,ja(Xr=e,Yr=t)}function GJ(e,t){var n=e-Xr,i=t-Yr,r=Fn(n*n+i*i);Qg+=r*(Xr+e)/2,e0+=r*(Yr+t)/2,Fu+=r,ja(Xr=e,Yr=t)}function XS(){ar.point=ja}function VJ(){ar.point=YJ}function XJ(){YS(HS,GS)}function YJ(e,t){ar.point=YS,ja(HS=Xr=e,GS=Yr=t)}function YS(e,t){var n=e-Xr,i=t-Yr,r=Fn(n*n+i*i);Qg+=r*(Xr+e)/2,e0+=r*(Yr+t)/2,Fu+=r,r=Yr*e-Xr*t,bv+=r*(Xr+e),vv+=r*(Yr+t),Hf+=r*3,ja(Xr=e,Yr=t)}const ZS=ar;function KS(e){this._context=e}KS.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,Mn);break}}},result:sn};var xv=new Sn,_v,JS,QS,Gf,Vf,t0={point:sn,lineStart:function(){t0.point=ZJ},lineEnd:function(){_v&&eA(JS,QS),t0.point=sn},polygonStart:function(){_v=!0},polygonEnd:function(){_v=null},result:function(){var e=+xv;return xv=new Sn,e}};function ZJ(e,t){t0.point=eA,JS=Gf=e,QS=Vf=t}function eA(e,t){Gf-=e,Vf-=t,xv.add(Fn(Gf*Gf+Vf*Vf)),Gf=e,Vf=t}const tA=t0;let nA,n0,iA,rA;class sA{constructor(t){this._append=t==null?oA:KJ(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==iA||this._append!==n0){const i=this._radius,r=this._;this._="",this._append`m0,${i}a${i},${i} 0 1,1 0,${-2*i}a${i},${i} 0 1,1 0,${2*i}z`,iA=i,n0=this._append,rA=this._,this._=r}this._+=rA;break}}}result(){const t=this._;return this._="",t.length?t:null}}function oA(e){let t=1;this._+=e[0];for(const n=e.length;t=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return oA;if(t!==nA){const n=10**t;nA=t,n0=function(r){let s=1;this._+=r[0];for(const o=r.length;s=0))throw new RangeError(`invalid digits: ${a}`);n=l}return t===null&&(s=new sA(n)),o},o.projection(e).digits(n).context(t)}function i0(e){return function(t){var n=new wv;for(var i in e)n[i]=e[i];return n.stream=t,n}}function wv(){}wv.prototype={constructor:wv,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function kv(e,t,n){var i=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),i!=null&&e.clipExtent(null),Ts(n,e.stream(Jg)),t(Jg.result()),i!=null&&e.clipExtent(i),e}function r0(e,t,n){return kv(e,function(i){var r=t[1][0]-t[0][0],s=t[1][1]-t[0][1],o=Math.min(r/(i[1][0]-i[0][0]),s/(i[1][1]-i[0][1])),a=+t[0][0]+(r-o*(i[1][0]+i[0][0]))/2,l=+t[0][1]+(s-o*(i[1][1]+i[0][1]))/2;e.scale(150*o).translate([a,l])},n)}function $v(e,t,n){return r0(e,[[0,0],t],n)}function Ev(e,t,n){return kv(e,function(i){var r=+t,s=r/(i[1][0]-i[0][0]),o=(r-s*(i[1][0]+i[0][0]))/2,a=-s*i[0][1];e.scale(150*s).translate([o,a])},n)}function Cv(e,t,n){return kv(e,function(i){var r=+t,s=r/(i[1][1]-i[0][1]),o=-s*i[0][0],a=(r-s*(i[1][1]+i[0][1]))/2;e.scale(150*s).translate([o,a])},n)}var lA=16,JJ=we(30*Ne);function uA(e,t){return+t?eQ(e,t):QJ(e)}function QJ(e){return i0({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function eQ(e,t){function n(i,r,s,o,a,l,u,c,f,d,h,p,g,m){var y=u-i,b=c-r,v=y*y+b*b;if(v>4*t&&g--){var x=o+d,_=a+h,k=l+p,w=Fn(x*x+_*_+k*k),$=Qn(k/=w),S=qe(qe(k)-1)<_e||qe(s-f)<_e?(s+f)/2:Ii(_,x),E=e(S,$),A=E[0],R=E[1],C=A-i,M=R-r,T=b*C-y*M;(T*T/v>t||qe((y*C+b*M)/v-.5)>.3||o*d+a*h+l*p2?T[2]%360*Ne:0,C()):[a*Mt,l*Mt,u*Mt]},A.angle=function(T){return arguments.length?(f=T%360*Ne,C()):f*Mt},A.reflectX=function(T){return arguments.length?(d=T?-1:1,C()):d<0},A.reflectY=function(T){return arguments.length?(h=T?-1:1,C()):h<0},A.precision=function(T){return arguments.length?(k=uA(w,_=T*T),M()):Fn(_)},A.fitExtent=function(T,O){return r0(A,T,O)},A.fitSize=function(T,O){return $v(A,T,O)},A.fitWidth=function(T,O){return Ev(A,T,O)},A.fitHeight=function(T,O){return Cv(A,T,O)};function C(){var T=cA(n,0,0,d,h,f).apply(null,t(s,o)),O=cA(n,i-T[0],r-T[1],d,h,f);return c=AS(a,l,u),w=uv(t,O),$=uv(c,w),k=uA(w,_),M()}function M(){return S=E=null,A}return function(){return t=e.apply(this,arguments),A.invert=t.invert&&R,C()}}function Sv(e){var t=0,n=Le/3,i=fA(e),r=i(t,n);return r.parallels=function(s){return arguments.length?i(t=s[0]*Ne,n=s[1]*Ne):[t*Mt,n*Mt]},r}function rQ(e){var t=we(e);function n(i,r){return[i*t,be(r)/t]}return n.invert=function(i,r){return[i/t,Qn(r*t)]},n}function sQ(e,t){var n=be(e),i=(n+be(t))/2;if(qe(i)<_e)return rQ(e);var r=1+n*(2*i-n),s=Fn(r)/i;function o(a,l){var u=Fn(r-2*i*be(l))/i;return[u*be(a*=i),s-u*we(a)]}return o.invert=function(a,l){var u=s-l,c=Ii(a,qe(u))*zi(u);return u*i<0&&(c-=Le*zi(a)*zi(u)),[c/i,Qn((r-(a*a+u*u)*i*i)/(2*i))]},o}function s0(){return Sv(sQ).scale(155.424).center([0,33.6442])}function dA(){return s0().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function oQ(e){var t=e.length;return{point:function(n,i){for(var r=-1;++r=.12&&m<.234&&g>=-.425&&g<-.214?r:m>=.166&&m<.234&&g>=-.214&&g<-.115?o:n).invert(d)},c.stream=function(d){return e&&t===d?e:e=oQ([n.stream(t=d),r.stream(d),o.stream(d)])},c.precision=function(d){return arguments.length?(n.precision(d),r.precision(d),o.precision(d),f()):n.precision()},c.scale=function(d){return arguments.length?(n.scale(d),r.scale(d*.35),o.scale(d),c.translate(n.translate())):n.scale()},c.translate=function(d){if(!arguments.length)return n.translate();var h=n.scale(),p=+d[0],g=+d[1];return i=n.translate(d).clipExtent([[p-.455*h,g-.238*h],[p+.455*h,g+.238*h]]).stream(u),s=r.translate([p-.307*h,g+.201*h]).clipExtent([[p-.425*h+_e,g+.12*h+_e],[p-.214*h-_e,g+.234*h-_e]]).stream(u),a=o.translate([p-.205*h,g+.212*h]).clipExtent([[p-.214*h+_e,g+.166*h+_e],[p-.115*h-_e,g+.234*h-_e]]).stream(u),f()},c.fitExtent=function(d,h){return r0(c,d,h)},c.fitSize=function(d,h){return $v(c,d,h)},c.fitWidth=function(d,h){return Ev(c,d,h)},c.fitHeight=function(d,h){return Cv(c,d,h)};function f(){return e=t=null,c}return c.scale(1070)}function hA(e){return function(t,n){var i=we(t),r=we(n),s=e(i*r);return s===1/0?[2,0]:[s*r*be(t),s*be(n)]}}function Xf(e){return function(t,n){var i=Fn(t*t+n*n),r=e(i),s=be(r),o=we(r);return[Ii(t*s,i*o),Qn(i&&n*s/i)]}}var pA=hA(function(e){return Fn(2/(1+e))});pA.invert=Xf(function(e){return 2*Qn(e/2)});function lQ(){return Zr(pA).scale(124.75).clipAngle(180-.001)}var gA=hA(function(e){return(e=uS(e))&&e/be(e)});gA.invert=Xf(function(e){return e});function uQ(){return Zr(gA).scale(79.4188).clipAngle(180-.001)}function o0(e,t){return[e,Dg(J3((Ct+t)/2))]}o0.invert=function(e,t){return[e,2*Su(lS(t))-Ct]};function cQ(){return mA(o0).scale(961/Mn)}function mA(e){var t=Zr(e),n=t.center,i=t.scale,r=t.translate,s=t.clipExtent,o=null,a,l,u;t.scale=function(f){return arguments.length?(i(f),c()):i()},t.translate=function(f){return arguments.length?(r(f),c()):r()},t.center=function(f){return arguments.length?(n(f),c()):n()},t.clipExtent=function(f){return arguments.length?(f==null?o=a=l=u=null:(o=+f[0][0],a=+f[0][1],l=+f[1][0],u=+f[1][1]),c()):o==null?null:[[o,a],[l,u]]};function c(){var f=Le*i(),d=t(TJ(t.rotate()).invert([0,0]));return s(o==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:e===o0?[[Math.max(d[0]-f,o),a],[Math.min(d[0]+f,l),u]]:[[o,Math.max(d[1]-f,a)],[l,Math.min(d[1]+f,u)]])}return c()}function a0(e){return J3((Ct+e)/2)}function fQ(e,t){var n=we(e),i=e===t?be(e):Dg(n/we(t))/Dg(a0(t)/a0(e)),r=n*K3(a0(e),i)/i;if(!i)return o0;function s(o,a){r>0?a<-Ct+_e&&(a=-Ct+_e):a>Ct-_e&&(a=Ct-_e);var l=r/K3(a0(a),i);return[l*be(i*o),r-l*we(i*o)]}return s.invert=function(o,a){var l=r-a,u=zi(i)*Fn(o*o+l*l),c=Ii(o,qe(l))*zi(l);return l*i<0&&(c-=Le*zi(o)*zi(l)),[c/i,2*Su(K3(r/u,1/i))-Ct]},s}function dQ(){return Sv(fQ).scale(109.5).parallels([30,30])}function l0(e,t){return[e,t]}l0.invert=l0;function hQ(){return Zr(l0).scale(152.63)}function pQ(e,t){var n=we(e),i=e===t?be(e):(n-we(t))/(t-e),r=n/i+e;if(qe(i)<_e)return l0;function s(o,a){var l=r-a,u=i*o;return[l*be(u),r-l*we(u)]}return s.invert=function(o,a){var l=r-a,u=Ii(o,qe(l))*zi(l);return l*i<0&&(u-=Le*zi(o)*zi(l)),[u/i,r-zi(i)*Fn(o*o+l*l)]},s}function gQ(){return Sv(pQ).scale(131.154).center([0,13.9389])}var Yf=1.340264,Zf=-.081106,Kf=893e-6,Jf=.003796,u0=Fn(3)/2,mQ=12;function yA(e,t){var n=Qn(u0*be(t)),i=n*n,r=i*i*i;return[e*we(n)/(u0*(Yf+3*Zf*i+r*(7*Kf+9*Jf*i))),n*(Yf+Zf*i+r*(Kf+Jf*i))]}yA.invert=function(e,t){for(var n=t,i=n*n,r=i*i*i,s=0,o,a,l;s_e&&--i>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function xQ(){return Zr(vA).scale(175.295)}function xA(e,t){return[we(t)*be(e),be(t)]}xA.invert=Xf(Qn);function _Q(){return Zr(xA).scale(249.5).clipAngle(90+_e)}function _A(e,t){var n=we(t),i=1+we(e)*n;return[n*be(e)/i,be(t)/i]}_A.invert=Xf(function(e){return 2*Su(e)});function wQ(){return Zr(_A).scale(250).clipAngle(142)}function wA(e,t){return[Dg(J3((Ct+t)/2)),-e]}wA.invert=function(e,t){return[-t,2*Su(lS(e))-Ct]};function kQ(){var e=mA(wA),t=e.center,n=e.rotate;return e.center=function(i){return arguments.length?t([-i[1],i[0]]):(i=t(),[i[1],-i[0]])},e.rotate=function(i){return arguments.length?n([i[0],i[1],i.length>2?i[2]+90:90]):(i=n(),[i[0],i[1],i[2]-90])},n([0,0,90]).scale(159.155)}var $Q=Math.abs,Av=Math.cos,c0=Math.sin,EQ=1e-6,kA=Math.PI,Tv=kA/2,$A=CQ(2);function EA(e){return e>1?Tv:e<-1?-Tv:Math.asin(e)}function CQ(e){return e>0?Math.sqrt(e):0}function SQ(e,t){var n=e*c0(t),i=30,r;do t-=r=(t+c0(t)-n)/(1+Av(t));while($Q(r)>EQ&&--i>0);return t/2}function AQ(e,t,n){function i(r,s){return[e*r*Av(s=SQ(n,s)),t*c0(s)]}return i.invert=function(r,s){return s=EA(s/t),[r/(e*Av(s)),EA((2*s+c0(2*s))/n)]},i}var TQ=AQ($A/Tv,$A,kA);function MQ(){return Zr(TQ).scale(169.529)}const FQ=aA(),Mv=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function DQ(e,t){return function n(){const i=t();return i.type=e,i.path=aA().projection(i),i.copy=i.copy||function(){const r=n();return Mv.forEach(s=>{i[s]&&r[s](i[s]())}),r.path.pointRadius(i.path.pointRadius()),r},A$(i)}}function Fv(e,t){if(!e||typeof e!="string")throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(f0[e]=DQ(e,t),this):f0[e]||null}function CA(e){return e&&e.path||FQ}const f0={albers:dA,albersusa:aQ,azimuthalequalarea:lQ,azimuthalequidistant:uQ,conicconformal:dQ,conicequalarea:s0,conicequidistant:gQ,equalEarth:yQ,equirectangular:hQ,gnomonic:bQ,identity:vQ,mercator:cQ,mollweide:MQ,naturalEarth1:xQ,orthographic:_Q,stereographic:wQ,transversemercator:kQ};for(const e in f0)Fv(e,f0[e]);function NQ(){}const Ds=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function SA(){var e=1,t=1,n=a;function i(l,u){return u.map(c=>r(l,c))}function r(l,u){var c=[],f=[];return s(l,u,d=>{n(d,l,u),OQ(d)>0?c.push([d]):f.push(d)}),f.forEach(d=>{for(var h=0,p=c.length,g;h=u,Ds[m<<1].forEach(v);++h=u,Ds[g|m<<1].forEach(v);for(Ds[m<<0].forEach(v);++p=u,y=l[p*e]>=u,Ds[m<<1|y<<2].forEach(v);++h=u,b=y,y=l[p*e+h+1]>=u,Ds[g|m<<1|y<<2|b<<3].forEach(v);Ds[m|y<<3].forEach(v)}for(h=-1,y=l[p*e]>=u,Ds[y<<2].forEach(v);++h=u,Ds[y<<2|b<<3].forEach(v);Ds[y<<3].forEach(v);function v(x){var _=[x[0][0]+h,x[0][1]+p],k=[x[1][0]+h,x[1][1]+p],w=o(_),$=o(k),S,E;(S=d[w])?(E=f[$])?(delete d[S.end],delete f[E.start],S===E?(S.ring.push(k),c(S.ring)):f[S.start]=d[E.end]={start:S.start,end:E.end,ring:S.ring.concat(E.ring)}):(delete d[S.end],S.ring.push(k),d[S.end=$]=S):(S=f[$])?(E=d[w])?(delete f[S.start],delete d[E.end],S===E?(S.ring.push(k),c(S.ring)):f[E.start]=d[S.end]={start:E.start,end:S.end,ring:E.ring.concat(S.ring)}):(delete f[S.start],S.ring.unshift(_),f[S.start=w]=S):f[w]=d[$]={start:w,end:$,ring:[_,k]}}}function o(l){return l[0]*2+l[1]*(e+1)*4}function a(l,u,c){l.forEach(f=>{var d=f[0],h=f[1],p=d|0,g=h|0,m,y=u[g*e+p];d>0&&d0&&h=0&&c>=0||U("invalid size"),e=u,t=c,i},i.smooth=function(l){return arguments.length?(n=l?a:NQ,i):n===a},i}function OQ(e){for(var t=0,n=e.length,i=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++ti!=h>i&&n<(d-u)*(i-c)/(h-c)+u&&(r=-r)}return r}function IQ(e,t,n){var i;return zQ(e,t,n)&&PQ(e[i=+(e[0]===t[0])],n[i],t[i])}function zQ(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function PQ(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function AA(e,t,n){return function(i){var r=Or(i),s=n?Math.min(r[0],0):r[0],o=r[1],a=o-s,l=t?ao(s,o,e):a/(e+1);return hi(s+l,o,l)}}function Dv(e){z.call(this,null,e)}Dv.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]},K(Dv,z,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=e.field||dn,s=SA().smooth(e.smooth!==!1),o=e.thresholds||BQ(i,r,e),a=e.as===null?null:e.as||"contour",l=[];return i.forEach(u=>{const c=r(u),f=s.size([c.width,c.height])(c.values,q(o)?o:o(c.values));jQ(f,c,u,e),f.forEach(d=>{l.push(rp(u,et(a!=null?{[a]:d}:d)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=l,n}});function BQ(e,t,n){const i=AA(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?i:i(e.map(r=>ga(t(r).values)))}function jQ(e,t,n,i){let r=i.scale||t.scale,s=i.translate||t.translate;if(Me(r)&&(r=r(n,i)),Me(s)&&(s=s(n,i)),(r===1||r==null)&&!s)return;const o=(Xe(r)?r:r[0])||1,a=(Xe(r)?r:r[1])||1,l=s&&s[0]||0,u=s&&s[1]||0;e.forEach(TA(t,o,a,l,u))}function TA(e,t,n,i,r){const s=e.x1||0,o=e.y1||0,a=t*n<0;function l(f){f.forEach(u)}function u(f){a&&f.reverse(),f.forEach(c)}function c(f){f[0]=(f[0]-s)*t+i,f[1]=(f[1]-o)*n+r}return function(f){return f.coordinates.forEach(l),f}}function MA(e,t,n){const i=e>=0?e:iy(t,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function Nv(e){return Me(e)?e:pn(+e)}function FA(){var e=l=>l[0],t=l=>l[1],n=ql,i=[-1,-1],r=960,s=500,o=2;function a(l,u){const c=MA(i[0],l,e)>>o,f=MA(i[1],l,t)>>o,d=c?c+2:0,h=f?f+2:0,p=2*d+(r>>o),g=2*h+(s>>o),m=new Float32Array(p*g),y=new Float32Array(p*g);let b=m;l.forEach(x=>{const _=d+(+e(x)>>o),k=h+(+t(x)>>o);_>=0&&_=0&&k0&&f>0?(Du(p,g,m,y,c),Nu(p,g,y,m,f),Du(p,g,m,y,c),Nu(p,g,y,m,f),Du(p,g,m,y,c),Nu(p,g,y,m,f)):c>0?(Du(p,g,m,y,c),Du(p,g,y,m,c),Du(p,g,m,y,c),b=y):f>0&&(Nu(p,g,m,y,f),Nu(p,g,y,m,f),Nu(p,g,m,y,f),b=y);const v=u?Math.pow(2,-2*o):1/T4(b);for(let x=0,_=p*g;x<_;++x)b[x]*=v;return{values:b,scale:1<>o),y2:h+(s>>o)}}return a.x=function(l){return arguments.length?(e=Nv(l),a):e},a.y=function(l){return arguments.length?(t=Nv(l),a):t},a.weight=function(l){return arguments.length?(n=Nv(l),a):n},a.size=function(l){if(!arguments.length)return[r,s];var u=+l[0],c=+l[1];return u>=0&&c>=0||U("invalid size"),r=u,s=c,a},a.cellSize=function(l){return arguments.length?((l=+l)>=1||U("invalid cell size"),o=Math.floor(Math.log(l)/Math.LN2),a):1<=r&&(a>=s&&(l-=n[a-s+o*e]),i[a-r+o*e]=l/Math.min(a+1,e-1+s-a,s))}function Nu(e,t,n,i,r){const s=(r<<1)+1;for(let o=0;o=r&&(a>=s&&(l-=n[o+(a-s)*e]),i[o+(a-r)*e]=l/Math.min(a+1,t-1+s-a,s))}function Ov(e){z.call(this,null,e)}Ov.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const UQ=["x","y","weight","size","cellSize","bandwidth"];function DA(e,t){return UQ.forEach(n=>t[n]!=null?e[n](t[n]):0),e}K(Ov,z,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=qQ(i,e.groupby),s=(e.groupby||[]).map(Et),o=DA(FA(),e),a=e.as||"grid",l=[];function u(c,f){for(let d=0;det(u({[a]:o(c,e.counts)},c.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=l,n}});function qQ(e,t){var n=[],i=c=>c(a),r,s,o,a,l,u;if(t==null)n.push(e);else for(r={},s=0,o=e.length;sn.push(a(c))),s&&o&&(t.visit(l,c=>{var f=s(c),d=o(c);f!=null&&d!=null&&(f=+f)===f&&(d=+d)===d&&i.push([f,d])}),n=n.concat({type:Lv,geometry:{type:WQ,coordinates:i}})),this.value={type:Iv,features:n}}});function Pv(e){z.call(this,null,e)}Pv.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]},K(Pv,z,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.field||dn,s=e.as||"path",o=n.SOURCE;!i||e.modified()?(this.value=i=CA(e.projection),n.materialize().reflow()):o=r===dn||t.modified(r.fields)?n.ADD_MOD:n.ADD;const a=HQ(i,e.pointRadius);return n.visit(o,l=>l[s]=i(r(l))),i.pointRadius(a),n.modifies(s)}});function HQ(e,t){const n=e.pointRadius();return e.context(null),t!=null&&e.pointRadius(t),n}function Bv(e){z.call(this,null,e)}Bv.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]},K(Bv,z,{transform(e,t){var n=e.projection,i=e.fields[0],r=e.fields[1],s=e.as||["x","y"],o=s[0],a=s[1],l;function u(c){const f=n([i(c),r(c)]);f?(c[o]=f[0],c[a]=f[1]):(c[o]=void 0,c[a]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,u):(l=t.modified(i.fields)||t.modified(r.fields),t.visit(l?t.ADD_MOD:t.ADD,u)),t.modifies(s)}});function jv(e){z.call(this,null,e)}jv.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]},K(jv,z,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.as||"shape",s=n.ADD;return(!i||e.modified())&&(this.value=i=GQ(CA(e.projection),e.field||Ti("datum"),e.pointRadius),n.materialize().reflow(),s=n.SOURCE),n.visit(s,o=>o[r]=i),n.modifies(r)}});function GQ(e,t,n){const i=n==null?r=>e(t(r)):r=>{var s=e.pointRadius(),o=e.pointRadius(n)(t(r));return e.pointRadius(s),o};return i.context=r=>(e.context(r),i),i}function Uv(e){z.call(this,[],e),this.generator=PJ()}Uv.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]},K(Uv,z,{transform(e,t){var n=this.value,i=this.generator,r;if(!n.length||e.modified())for(const s in e)Me(i[s])&&i[s](e[s]);return r=i(),n.length?t.mod.push(H8(n[0],r)):t.add.push(et(r)),n[0]=r,t}});function qv(e){z.call(this,null,e)}qv.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]},K(qv,z,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,i=e.resolve==="shared",r=e.field||dn,s=XQ(e.opacity,e),o=VQ(e.color,e),a=e.as||"image",l={$x:0,$y:0,$value:0,$max:i?ga(n.map(u=>ga(r(u).values))):0};return n.forEach(u=>{const c=r(u),f=Fe({},u,l);i||(f.$max=ga(c.values||[])),u[a]=YQ(c,f,o.dep?o:pn(o(f)),s.dep?s:pn(s(f)))}),t.reflow(!0).modifies(a)}});function VQ(e,t){let n;return Me(e)?(n=i=>bo(e(i,t)),n.dep=NA(e)):n=pn(bo(e||"#888")),n}function XQ(e,t){let n;return Me(e)?(n=i=>e(i,t),n.dep=NA(e)):e?n=pn(e):(n=i=>i.$value/i.$max||0,n.dep=!0),n}function NA(e){if(!Me(e))return!1;const t=Ki(fn(e));return t.$x||t.$y||t.$value||t.$max}function YQ(e,t,n,i){const r=e.width,s=e.height,o=e.x1||0,a=e.y1||0,l=e.x2||r,u=e.y2||s,c=e.values,f=c?m=>c[m]:no,d=go(l-o,u-a),h=d.getContext("2d"),p=h.getImageData(0,0,l-o,u-a),g=p.data;for(let m=a,y=0;m{e[i]!=null&&RA(n,i,e[i])})):Mv.forEach(i=>{e.modified(i)&&RA(n,i,e[i])}),e.pointRadius!=null&&n.path.pointRadius(e.pointRadius),e.fit&&ZQ(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function ZQ(e,t){const n=JQ(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}function KQ(e){const t=Fv((e||"mercator").toLowerCase());return t||U("Unrecognized projection type: "+e),t()}function RA(e,t,n){Me(e[t])&&e[t](n)}function JQ(e){return e=ee(e),e.length===1?e[0]:{type:Iv,features:e.reduce((t,n)=>t.concat(QQ(n)),[])}}function QQ(e){return e.type===Iv?e.features:ee(e).filter(t=>t!=null).map(t=>t.type===Lv?t:{type:Lv,geometry:t})}const eee=Object.freeze(Object.defineProperty({__proto__:null,contour:Rv,geojson:zv,geopath:Pv,geopoint:Bv,geoshape:jv,graticule:Uv,heatmap:qv,isocontour:Dv,kde2d:Ov,projection:OA},Symbol.toStringTag,{value:"Module"}));function tee(e,t){var n,i=1;e==null&&(e=0),t==null&&(t=0);function r(){var s,o=n.length,a,l=0,u=0;for(s=0;s=(f=(a+u)/2))?a=f:u=f,(m=n>=(d=(l+c)/2))?l=d:c=d,r=s,!(s=s[y=m<<1|g]))return r[y]=o,e;if(h=+e._x.call(null,s.data),p=+e._y.call(null,s.data),t===h&&n===p)return o.next=s,r?r[y]=o:e._root=o,e;do r=r?r[y]=new Array(4):e._root=new Array(4),(g=t>=(f=(a+u)/2))?a=f:u=f,(m=n>=(d=(l+c)/2))?l=d:c=d;while((y=m<<1|g)===(b=(p>=d)<<1|h>=f));return r[b]=s,r[y]=o,e}function iee(e){var t,n,i=e.length,r,s,o=new Array(i),a=new Array(i),l=1/0,u=1/0,c=-1/0,f=-1/0;for(n=0;nc&&(c=r),sf&&(f=s));if(l>c||u>f)return this;for(this.cover(l,u).cover(c,f),n=0;ne||e>=r||i>t||t>=s;)switch(u=(tc||(a=p.y0)>f||(l=p.x1)=y)<<1|e>=m)&&(p=d[d.length-1],d[d.length-1]=d[d.length-1-g],d[d.length-1-g]=p)}else{var b=e-+this._x.call(null,h.data),v=t-+this._y.call(null,h.data),x=b*b+v*v;if(x=(d=(o+l)/2))?o=d:l=d,(g=f>=(h=(a+u)/2))?a=h:u=h,t=n,!(n=n[m=g<<1|p]))return this;if(!n.length)break;(t[m+1&3]||t[m+2&3]||t[m+3&3])&&(i=t,y=m)}for(;n.data!==e;)if(r=n,!(n=n.next))return this;return(s=n.next)&&delete n.next,r?(s?r.next=s:delete r.next,this):t?(s?t[m]=s:delete t[m],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(i?i[y]=n:this._root=n),this):(this._root=s,this)}function uee(e){for(var t=0,n=e.length;td.index){var A=h-$.x-$.vx,R=p-$.y-$.vy,C=A*A+R*R;Ch+E||kp+E||wu.r&&(u.r=u[c].r)}function l(){if(t){var u,c=t.length,f;for(n=new Array(c),u=0;u[t(_,k,o),_])),x;for(m=0,a=new Array(y);m{}};function PA(){for(var e=0,t=arguments.length,n={},i;e=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}d0.prototype=PA.prototype={constructor:d0,on:function(e,t){var n=this._,i=$ee(e+"",n),r,s=-1,o=i.length;if(arguments.length<2){for(;++s0)for(var n=new Array(r),i=0,r,s;i=0&&e._call.call(void 0,t),e=e._next;--Ou}function WA(){Ua=(p0=nd.now())+g0,Ou=Qf=0;try{See()}finally{Ou=0,Tee(),Ua=0}}function Aee(){var e=nd.now(),t=e-p0;t>jA&&(g0-=t,p0=e)}function Tee(){for(var e,t=h0,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:h0=n);td=e,Vv(i)}function Vv(e){if(!Ou){Qf&&(Qf=clearTimeout(Qf));var t=e-Ua;t>24?(e<1/0&&(Qf=setTimeout(WA,e-nd.now()-g0)),ed&&(ed=clearInterval(ed))):(ed||(p0=nd.now(),ed=setInterval(Aee,jA)),Ou=1,UA(WA))}}function Mee(e,t,n){var i=new m0,r=t;return t==null?(i.restart(e,t,n),i):(i._restart=i.restart,i.restart=function(s,o,a){o=+o,a=a==null?Gv():+a,i._restart(function l(u){u+=r,i._restart(l,r+=o,a),s(u)},o,a)},i.restart(e,t,n),i)}const Fee=1664525,Dee=1013904223,HA=4294967296;function Nee(){let e=1;return()=>(e=(Fee*e+Dee)%HA)/HA}function Oee(e){return e.x}function Ree(e){return e.y}var Lee=10,Iee=Math.PI*(3-Math.sqrt(5));function zee(e){var t,n=1,i=.001,r=1-Math.pow(i,1/300),s=0,o=.6,a=new Map,l=qA(f),u=PA("tick","end"),c=Nee();e==null&&(e=[]);function f(){d(),u.call("tick",t),n1?(m==null?a.delete(g):a.set(g,p(m)),t):a.get(g)},find:function(g,m,y){var b=0,v=e.length,x,_,k,w,$;for(y==null?y=1/0:y*=y,b=0;b1?(u.on(g,m),t):u.on(g)}}}function Pee(){var e,t,n,i,r=In(-30),s,o=1,a=1/0,l=.81;function u(h){var p,g=e.length,m=Wv(e,Oee,Ree).visitAfter(f);for(i=h,p=0;p=a)return;(h.data!==t||h.next)&&(y===0&&(y=Io(n),x+=y*y),b===0&&(b=Io(n),x+=b*b),x=0;)n.tick();else if(n.stopped()&&n.restart(),!i)return t.StopPropagation}return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let a=this._argops,l=0,u=a.length,c;le.touch(t).run()}function Wee(e,t){const n=zee(e),i=n.stop,r=n.restart;let s=!1;return n.stopped=()=>s,n.restart=()=>(s=!1,r()),n.stop=()=>(s=!0,i()),XA(n,t,!0).on("end",()=>s=!0)}function XA(e,t,n,i){var r=ee(t.forces),s,o,a,l;for(s=0,o=Xv.length;st(i,n):t)}const Xee=Object.freeze(Object.defineProperty({__proto__:null,force:Yv},Symbol.toStringTag,{value:"Module"}));function Yee(e,t){return e.parent===t.parent?1:2}function Zee(e){return e.reduce(Kee,0)/e.length}function Kee(e,t){return e+t.x}function Jee(e){return 1+e.reduce(Qee,0)}function Qee(e,t){return Math.max(e,t.y)}function ete(e){for(var t;t=e.children;)e=t[0];return e}function tte(e){for(var t;t=e.children;)e=t[t.length-1];return e}function nte(){var e=Yee,t=1,n=1,i=!1;function r(s){var o,a=0;s.eachAfter(function(d){var h=d.children;h?(d.x=Zee(h),d.y=Jee(h)):(d.x=o?a+=e(d,o):0,d.y=0,o=d)});var l=ete(s),u=tte(s),c=l.x-e(l,u)/2,f=u.x+e(u,l)/2;return s.eachAfter(i?function(d){d.x=(d.x-s.x)*t,d.y=(s.y-d.y)*n}:function(d){d.x=(d.x-c)/(f-c)*t,d.y=(1-(s.y?d.y/s.y:1))*n})}return r.separation=function(s){return arguments.length?(e=s,r):e},r.size=function(s){return arguments.length?(i=!1,t=+s[0],n=+s[1],r):i?null:[t,n]},r.nodeSize=function(s){return arguments.length?(i=!0,t=+s[0],n=+s[1],r):i?[t,n]:null},r}function ite(e){var t=0,n=e.children,i=n&&n.length;if(!i)t=1;else for(;--i>=0;)t+=n[i].value;e.value=t}function rte(){return this.eachAfter(ite)}function ste(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this}function ote(e,t){for(var n=this,i=[n],r,s,o=-1;n=i.pop();)if(e.call(t,n,++o,this),r=n.children)for(s=r.length-1;s>=0;--s)i.push(r[s]);return this}function ate(e,t){for(var n=this,i=[n],r=[],s,o,a,l=-1;n=i.pop();)if(r.push(n),s=n.children)for(o=0,a=s.length;o=0;)n+=i[r].value;t.value=n})}function cte(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function fte(e){for(var t=this,n=dte(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i}function dte(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}function hte(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function pte(){return Array.from(this)}function gte(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function mte(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*yte(){var e=this,t,n=[e],i,r,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,i=e.children)for(r=0,s=i.length;r=0;--a)r.push(s=o[a]=new Ru(o[a])),s.parent=i,s.depth=i.depth+1;return n.eachBefore(YA)}function bte(){return Zv(this).eachBefore(_te)}function vte(e){return e.children}function xte(e){return Array.isArray(e)?e[1]:null}function _te(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function YA(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Ru(e){this.data=e,this.depth=this.height=0,this.parent=null}Ru.prototype=Zv.prototype={constructor:Ru,count:rte,each:ste,eachAfter:ate,eachBefore:ote,find:lte,sum:ute,sort:cte,path:fte,ancestors:hte,descendants:pte,leaves:gte,links:mte,copy:bte,[Symbol.iterator]:yte};function y0(e){return e==null?null:ZA(e)}function ZA(e){if(typeof e!="function")throw new Error;return e}function qa(){return 0}function Lu(e){return function(){return e}}const wte=1664525,kte=1013904223,KA=4294967296;function $te(){let e=1;return()=>(e=(wte*e+kte)%KA)/KA}function Ete(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Cte(e,t){let n=e.length,i,r;for(;n;)r=t()*n--|0,i=e[n],e[n]=e[r],e[r]=i;return e}function Ste(e,t){for(var n=0,i=(e=Cte(Array.from(e),t)).length,r=[],s,o;n0&&n*n>i*i+r*r}function Kv(e,t){for(var n=0;n1e-6?(A+Math.sqrt(A*A-4*E*R))/(2*E):R/A);return{x:i+k+w*C,y:r+$+S*C,r:C}}function eT(e,t,n){var i=e.x-t.x,r,s,o=e.y-t.y,a,l,u=i*i+o*o;u?(s=t.r+n.r,s*=s,l=e.r+n.r,l*=l,s>l?(r=(u+l-s)/(2*u),a=Math.sqrt(Math.max(0,l/u-r*r)),n.x=e.x-r*i-a*o,n.y=e.y-r*o+a*i):(r=(u+s-l)/(2*u),a=Math.sqrt(Math.max(0,s/u-r*r)),n.x=t.x+r*i-a*o,n.y=t.y+r*o+a*i)):(n.x=t.x+n.r,n.y=t.y)}function tT(e,t){var n=e.r+t.r-1e-6,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function nT(e){var t=e._,n=e.next._,i=t.r+n.r,r=(t.x*n.r+n.x*t.r)/i,s=(t.y*n.r+n.y*t.r)/i;return r*r+s*s}function v0(e){this._=e,this.next=null,this.previous=null}function Fte(e,t){if(!(s=(e=Ete(e)).length))return 0;var n,i,r,s,o,a,l,u,c,f,d;if(n=e[0],n.x=0,n.y=0,!(s>1))return n.r;if(i=e[1],n.x=-i.r,i.x=n.r,i.y=0,!(s>2))return n.r+i.r;eT(i,n,r=e[2]),n=new v0(n),i=new v0(i),r=new v0(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;e:for(l=3;lzte(n(x,_,r))),b=y.map(lT),v=new Set(y).add("");for(const x of b)v.has(x)||(v.add(x),y.push(x),b.push(lT(x)),s.push(Qv));o=(x,_)=>y[_],a=(x,_)=>b[_]}for(c=0,l=s.length;c=0&&(h=s[y],h.data===Qv);--y)h.data=null}if(f.parent=Rte,f.eachBefore(function(y){y.depth=y.parent.depth+1,--l}).eachBefore(YA),f.parent=null,l>0)throw new Error("cycle");return f}return i.id=function(r){return arguments.length?(e=y0(r),i):e},i.parentId=function(r){return arguments.length?(t=y0(r),i):t},i.path=function(r){return arguments.length?(n=y0(r),i):n},i}function zte(e){e=`${e}`;let t=e.length;return ex(e,t-1)&&!ex(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function lT(e){let t=e.length;if(t<2)return"";for(;--t>1&&!ex(e,t););return e.slice(0,t)}function ex(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}function Pte(e,t){return e.parent===t.parent?1:2}function tx(e){var t=e.children;return t?t[0]:e.t}function nx(e){var t=e.children;return t?t[t.length-1]:e.t}function Bte(e,t,n){var i=n/(t.i-e.i);t.c-=i,t.s+=n,e.c+=i,t.z+=n,t.m+=n}function jte(e){for(var t=0,n=0,i=e.children,r=i.length,s;--r>=0;)s=i[r],s.z+=t,s.m+=t,t+=s.s+(n+=s.c)}function Ute(e,t,n){return e.a.parent===t.parent?e.a:n}function x0(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}x0.prototype=Object.create(Ru.prototype);function qte(e){for(var t=new x0(e,0),n,i=[t],r,s,o,a;n=i.pop();)if(s=n._.children)for(n.children=new Array(a=s.length),o=a-1;o>=0;--o)i.push(r=n.children[o]=new x0(s[o],o)),r.parent=n;return(t.parent=new x0(null,0)).children=[t],t}function Wte(){var e=Pte,t=1,n=1,i=null;function r(u){var c=qte(u);if(c.eachAfter(s),c.parent.m=-c.z,c.eachBefore(o),i)u.eachBefore(l);else{var f=u,d=u,h=u;u.eachBefore(function(b){b.xd.x&&(d=b),b.depth>h.depth&&(h=b)});var p=f===d?1:e(f,d)/2,g=p-f.x,m=t/(d.x+p+g),y=n/(h.depth||1);u.eachBefore(function(b){b.x=(b.x+g)*m,b.y=b.depth*y})}return u}function s(u){var c=u.children,f=u.parent.children,d=u.i?f[u.i-1]:null;if(c){jte(u);var h=(c[0].z+c[c.length-1].z)/2;d?(u.z=d.z+e(u._,d._),u.m=u.z-h):u.z=h}else d&&(u.z=d.z+e(u._,d._));u.parent.A=a(u,d,u.parent.A||f[0])}function o(u){u._.x=u.z+u.parent.m,u.m+=u.parent.m}function a(u,c,f){if(c){for(var d=u,h=u,p=c,g=d.parent.children[0],m=d.m,y=h.m,b=p.m,v=g.m,x;p=nx(p),d=tx(d),p&&d;)g=tx(g),h=nx(h),h.a=u,x=p.z+b-d.z-m+e(p._,d._),x>0&&(Bte(Ute(p,u,f),u,x),m+=x,y+=x),b+=p.m,m+=d.m,v+=g.m,y+=h.m;p&&!nx(h)&&(h.t=p,h.m+=b-y),d&&!tx(g)&&(g.t=d,g.m+=m-v,f=u)}return f}function l(u){u.x*=t,u.y=u.depth*n}return r.separation=function(u){return arguments.length?(e=u,r):e},r.size=function(u){return arguments.length?(i=!1,t=+u[0],n=+u[1],r):i?null:[t,n]},r.nodeSize=function(u){return arguments.length?(i=!0,t=+u[0],n=+u[1],r):i?[t,n]:null},r}function _0(e,t,n,i,r){for(var s=e.children,o,a=-1,l=s.length,u=e.value&&(r-n)/e.value;++ab&&(b=u),k=m*m*_,v=Math.max(b/k,k/y),v>x){m-=u;break}x=v}o.push(l={value:m,dice:h1?i:1)},n}(uT);function Hte(){var e=fT,t=!1,n=1,i=1,r=[0],s=qa,o=qa,a=qa,l=qa,u=qa;function c(d){return d.x0=d.y0=0,d.x1=n,d.y1=i,d.eachBefore(f),r=[0],t&&d.eachBefore(sT),d}function f(d){var h=r[d.depth],p=d.x0+h,g=d.y0+h,m=d.x1-h,y=d.y1-h;m=d-1){var b=s[f];b.x0=p,b.y0=g,b.x1=m,b.y1=y;return}for(var v=u[f],x=h/2+v,_=f+1,k=d-1;_>>1;u[w]y-g){var E=h?(p*S+m*$)/h:m;c(f,_,$,p,g,E,y),c(_,d,S,E,g,m,y)}else{var A=h?(g*S+y*$)/h:y;c(f,_,$,p,g,m,A),c(_,d,S,p,A,m,y)}}}function Vte(e,t,n,i,r){(e.depth&1?_0:sd)(e,t,n,i,r)}const Xte=function e(t){function n(i,r,s,o,a){if((l=i._squarify)&&l.ratio===t)for(var l,u,c,f,d=-1,h,p=l.length,g=i.value;++d1?i:1)},n}(uT);function ix(e,t,n){const i={};return e.each(r=>{const s=r.data;n(s)&&(i[t(s)]=r)}),e.lookup=i,e}function rx(e){z.call(this,null,e)}rx.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const Yte=e=>e.values;K(rx,z,{transform(e,t){t.source||U("Nest transform requires an upstream data source.");var n=e.generate,i=e.modified(),r=t.clone(),s=this.value;return(!s||i||t.changed())&&(s&&s.each(o=>{o.children&&ip(o.data)&&r.rem.push(o.data)}),this.value=s=Zv({values:ee(e.keys).reduce((o,a)=>(o.key(a),o),Zte()).entries(r.source)},Yte),n&&s.each(o=>{o.children&&(o=et(o.data),r.add.push(o),r.source.push(o))}),ix(s,ye,ye)),r.source.root=s,r}});function Zte(){const e=[],t={entries:r=>i(n(r,0),0),key:r=>(e.push(r),t)};function n(r,s){if(s>=e.length)return r;const o=r.length,a=e[s++],l={},u={};let c=-1,f,d,h;for(;++ce.length)return r;const o=[];for(const a in r)o.push({key:a,values:i(r[a],s)});return o}return t}function Ns(e){z.call(this,null,e)}const Kte=(e,t)=>e.parent===t.parent?1:2;K(Ns,z,{transform(e,t){(!t.source||!t.source.root)&&U(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),i=this.fields,r=t.source.root,s=e.as||i;e.field?r.sum(e.field):r.count(),e.sort&&r.sort(xa(e.sort,o=>o.data)),Jte(n,this.params,e),n.separation&&n.separation(e.separation!==!1?Kte:ql);try{this.value=n(r)}catch(o){U(o)}return r.each(o=>Qte(o,i,s)),t.reflow(e.modified()).modifies(s).modifies("leaf")}});function Jte(e,t,n){for(let i,r=0,s=t.length;rs[ye(o)]=1),i.each(o=>{const a=o.data,l=o.parent&&o.parent.data;l&&s[ye(a)]&&s[ye(l)]&&r.add.push(et({source:l,target:a}))}),this.value=r.add):t.changed(t.MOD)&&(t.visit(t.MOD,o=>s[ye(o)]=1),n.forEach(o=>{(s[ye(o.source)]||s[ye(o.target)])&&r.mod.push(o)})),r}});const hT={binary:Gte,dice:sd,slice:_0,slicedice:Vte,squarify:fT,resquarify:Xte},hx=["x0","y0","x1","y1","depth","children"];function px(e){Ns.call(this,e)}px.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:hx.length,default:hx}]},K(px,Ns,{layout(){const e=Hte();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{me(hT,t)?e.tile(hT[t]):U("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:hx});const ene=Object.freeze(Object.defineProperty({__proto__:null,nest:rx,pack:ox,partition:lx,stratify:ux,tree:fx,treelinks:dx,treemap:px},Symbol.toStringTag,{value:"Module"})),gx=4278190080;function tne(e,t){const n=e.bitmap();return(t||[]).forEach(i=>n.set(e(i.boundary[0]),e(i.boundary[3]))),[n,void 0]}function nne(e,t,n,i,r){const s=e.width,o=e.height,a=i||r,l=go(s,o).getContext("2d"),u=go(s,o).getContext("2d"),c=a&&go(s,o).getContext("2d");n.forEach($=>w0(l,$,!1)),w0(u,t,!1),a&&w0(c,t,!0);const f=mx(l,s,o),d=mx(u,s,o),h=a&&mx(c,s,o),p=e.bitmap(),g=a&&e.bitmap();let m,y,b,v,x,_,k,w;for(y=0;y{r.items.forEach(s=>w0(e,s.items,n))}):yi[i].draw(e,{items:n?t.map(ine):t})}function ine(e){const t=rp(e,{});return t.stroke&&t.strokeOpacity!==0||t.fill&&t.fillOpacity!==0?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const Os=5,zn=31,od=32,zo=new Uint32Array(od+1),lr=new Uint32Array(od+1);lr[0]=0,zo[0]=~lr[0];for(let e=1;e<=od;++e)lr[e]=lr[e-1]<<1|1,zo[e]=~lr[e];function rne(e,t){const n=new Uint32Array(~~((e*t+od)/od));function i(s,o){n[s]|=o}function r(s,o){n[s]&=o}return{array:n,get:(s,o)=>{const a=o*e+s;return n[a>>>Os]&1<<(a&zn)},set:(s,o)=>{const a=o*e+s;i(a>>>Os,1<<(a&zn))},clear:(s,o)=>{const a=o*e+s;r(a>>>Os,~(1<<(a&zn)))},getRange:(s,o,a,l)=>{let u=l,c,f,d,h;for(;u>=o;--u)if(c=u*e+s,f=u*e+a,d=c>>>Os,h=f>>>Os,d===h){if(n[d]&zo[c&zn]&lr[(f&zn)+1])return!0}else{if(n[d]&zo[c&zn]||n[h]&lr[(f&zn)+1])return!0;for(let p=d+1;p{let u,c,f,d,h;for(;o<=l;++o)if(u=o*e+s,c=o*e+a,f=u>>>Os,d=c>>>Os,f===d)i(f,zo[u&zn]&lr[(c&zn)+1]);else for(i(f,zo[u&zn]),i(d,lr[(c&zn)+1]),h=f+1;h{let u,c,f,d,h;for(;o<=l;++o)if(u=o*e+s,c=o*e+a,f=u>>>Os,d=c>>>Os,f===d)r(f,lr[u&zn]|zo[(c&zn)+1]);else for(r(f,lr[u&zn]),r(d,zo[(c&zn)+1]),h=f+1;hs<0||o<0||l>=t||a>=e}}function sne(e,t,n){const i=Math.max(1,Math.sqrt(e*t/1e6)),r=~~((e+2*n+i)/i),s=~~((t+2*n+i)/i),o=a=>~~((a+n)/i);return o.invert=a=>a*i-n,o.bitmap=()=>rne(r,s),o.ratio=i,o.padding=n,o.width=e,o.height=t,o}function one(e,t,n,i){const r=e.width,s=e.height;return function(o){const a=o.datum.datum.items[i].items,l=a.length,u=o.datum.fontSize,c=mi.width(o.datum,o.datum.text);let f=0,d,h,p,g,m,y,b;for(let v=0;v=f&&(f=b,o.x=m,o.y=y);return m=c/2,y=u/2,d=o.x-m,h=o.x+m,p=o.y-y,g=o.y+y,o.align="center",d<0&&h<=r?o.align="left":0<=d&&rr||t-(o=i/2)<0||t+o>s}function Po(e,t,n,i,r,s,o,a){const l=r*s/(i*2),u=e(t-l),c=e(t+l),f=e(n-(s=s/2)),d=e(n+s);return o.outOfBounds(u,f,c,d)||o.getRange(u,f,c,d)||a&&a.getRange(u,f,c,d)}function ane(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1];function l(u,c,f,d,h){const p=e.invert(u),g=e.invert(c);let m=f,y=s,b;if(!k0(p,g,d,h,r,s)&&!Po(e,p,g,h,d,m,o,a)&&!Po(e,p,g,h,d,h,o,null)){for(;y-m>=1;)b=(m+y)/2,Po(e,p,g,h,d,b,o,a)?y=b:m=b;if(m>f)return[p,g,m,!0]}}return function(u){const c=u.datum.datum.items[i].items,f=c.length,d=u.datum.fontSize,h=mi.width(u.datum,u.datum.text);let p=n?d:0,g=!1,m=!1,y=0,b,v,x,_,k,w,$,S,E,A,R,C,M,T,O,P,j;for(let W=0;Wv&&(j=b,b=v,v=j),x>_&&(j=x,x=_,_=j),E=e(b),R=e(v),A=~~((E+R)/2),C=e(x),T=e(_),M=~~((C+T)/2),$=A;$>=E;--$)for(S=M;S>=C;--S)P=l($,S,p,h,d),P&&([u.x,u.y,p,g]=P);for($=A;$<=R;++$)for(S=M;S<=T;++S)P=l($,S,p,h,d),P&&([u.x,u.y,p,g]=P);!g&&!n&&(O=Math.abs(v-b+_-x),k=(b+v)/2,w=(x+_)/2,O>=y&&!k0(k,w,h,d,r,s)&&!Po(e,k,w,d,h,d,o,null)&&(y=O,u.x=k,u.y=w,m=!0))}return g||m?(k=h/2,w=d/2,o.setRange(e(u.x-k),e(u.y-w),e(u.x+k),e(u.y+w)),u.align="center",u.baseline="middle",!0):!1}}const lne=[-1,-1,1,1],une=[-1,1,-1,1];function cne(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1],l=e.bitmap();return function(u){const c=u.datum.datum.items[i].items,f=c.length,d=u.datum.fontSize,h=mi.width(u.datum,u.datum.text),p=[];let g=n?d:0,m=!1,y=!1,b=0,v,x,_,k,w,$,S,E,A,R,C,M;for(let T=0;T=1;)C=(A+R)/2,Po(e,w,$,d,h,C,o,a)?R=C:A=C;A>g&&(u.x=w,u.y=$,g=A,m=!0)}}!m&&!n&&(M=Math.abs(x-v+k-_),w=(v+x)/2,$=(_+k)/2,M>=b&&!k0(w,$,h,d,r,s)&&!Po(e,w,$,d,h,d,o,null)&&(b=M,u.x=w,u.y=$,y=!0))}return m||y?(w=h/2,$=d/2,o.setRange(e(u.x-w),e(u.y-$),e(u.x+w),e(u.y+$)),u.align="center",u.baseline="middle",!0):!1}}const fne=["right","center","left"],dne=["bottom","middle","top"];function hne(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1],l=i.length;return function(u){const c=u.boundary,f=u.datum.fontSize;if(c[2]<0||c[5]<0||c[0]>r||c[3]>s)return!1;let d=u.textWidth??0,h,p,g,m,y,b,v,x,_,k,w,$,S,E,A;for(let R=0;R>>2&3)-1,g=h===0&&p===0||i[R]<0,m=h&&p?Math.SQRT1_2:1,y=i[R]<0?-1:1,b=c[1+h]+i[R]*h*m,w=c[4+p]+y*f*p/2+i[R]*p*m,x=w-f/2,_=w+f/2,$=e(b),E=e(x),A=e(_),!d)if(pT($,$,E,A,o,a,b,b,x,_,c,g))d=mi.width(u.datum,u.datum.text);else continue;if(k=b+y*d*h/2,b=k-d/2,v=k+d/2,$=e(b),S=e(v),pT($,S,E,A,o,a,b,v,x,_,c,g))return u.x=h?h*y<0?v:b:k,u.y=p?p*y<0?_:x:w,u.align=fne[h*y+1],u.baseline=dne[p*y+1],o.setRange($,E,S,A),!0}return!1}}function pT(e,t,n,i,r,s,o,a,l,u,c,f){return!(r.outOfBounds(e,n,t,i)||(f&&s||r).getRange(e,n,t,i))}const yx=0,bx=4,vx=8,xx=0,_x=1,wx=2,pne={"top-left":yx+xx,top:yx+_x,"top-right":yx+wx,left:bx+xx,middle:bx+_x,right:bx+wx,"bottom-left":vx+xx,bottom:vx+_x,"bottom-right":vx+wx},gne={naive:one,"reduced-search":ane,floodfill:cne};function mne(e,t,n,i,r,s,o,a,l,u,c){if(!e.length)return e;const f=Math.max(i.length,r.length),d=yne(i,f),h=bne(r,f),p=vne(e[0].datum),g=p==="group"&&e[0].datum.items[l].marktype,m=g==="area",y=xne(p,g,a,l),b=u===null||u===1/0,v=m&&c==="naive";let x=-1,_=-1;const k=e.map(E=>{const A=b?mi.width(E,E.text):void 0;return x=Math.max(x,A),_=Math.max(_,E.fontSize),{datum:E,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(E),textWidth:A}});u=u===null||u===1/0?Math.max(x,_)+Math.max(...i):u;const w=sne(t[0],t[1],u);let $;if(!v){n&&k.sort((R,C)=>n(R.datum,C.datum));let E=!1;for(let R=0;RR.datum);$=s.length||A?nne(w,A||[],s,E,m):tne(w,o&&k)}const S=m?gne[c](w,$,o,l):hne(w,$,h,d);return k.forEach(E=>E.opacity=+S(E)),k}function yne(e,t){const n=new Float64Array(t),i=e.length;for(let r=0;r[s.x,s.x,s.x,s.y,s.y,s.y];return e?e==="line"||e==="area"?s=>r(s.datum):t==="line"?s=>{const o=s.datum.items[i].items;return r(o.length?o[n==="start"?0:o.length-1]:{x:NaN,y:NaN})}:s=>{const o=s.datum.bounds;return[o.x1,(o.x1+o.x2)/2,o.x2,o.y1,(o.y1+o.y2)/2,o.y2]}:r}const kx=["x","y","opacity","align","baseline"],gT=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function $x(e){z.call(this,null,e)}$x.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:gT},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0,null:!0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:kx.length,default:kx}]},K($x,z,{transform(e,t){function n(s){const o=e[s];return Me(o)&&t.modified(o.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||n("sort")))return;(!e.size||e.size.length!==2)&&U("Size parameter should be specified as a [width, height] array.");const r=e.as||kx;return mne(t.materialize(t.SOURCE).source||[],e.size,e.sort,ee(e.offset==null?1:e.offset),ee(e.anchor||gT),e.avoidMarks||[],e.avoidBaseMark!==!1,e.lineAnchor||"end",e.markIndex||0,e.padding===void 0?0:e.padding,e.method||"naive").forEach(s=>{const o=s.datum;o[r[0]]=s.x,o[r[1]]=s.y,o[r[2]]=s.opacity,o[r[3]]=s.align,o[r[4]]=s.baseline}),t.reflow(i).modifies(r)}});const _ne=Object.freeze(Object.defineProperty({__proto__:null,label:$x},Symbol.toStringTag,{value:"Module"}));function mT(e,t){var n=[],i=function(c){return c(a)},r,s,o,a,l,u;if(t==null)n.push(e);else for(r={},s=0,o=e.length;s{yk(u,e.x,e.y,e.bandwidth||.3).forEach(c=>{const f={};for(let d=0;de==="poly"?t:e==="quad"?2:1;function Sx(e){z.call(this,null,e)}Sx.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(Cx)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]},K(Sx,z,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=mT(i,e.groupby),s=(e.groupby||[]).map(Et),o=e.method||"linear",a=e.order==null?3:e.order,l=wne(o,a),u=e.as||[Et(e.x),Et(e.y)],c=Cx[o],f=[];let d=e.extent;me(Cx,o)||U("Invalid regression method: "+o),d!=null&&o==="log"&&d[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),r.forEach(h=>{if(h.length<=l){t.dataflow.warn("Skipping regression with more parameters than data points.");return}const g=c(h,e.x,e.y,a);if(e.params){f.push(et({keys:h.dims,coef:g.coef,rSquared:g.rSquared}));return}const m=d||Or(h,e.x),y=b=>{const v={};for(let x=0;xy([b,g.predict(b)])):pp(g.predict,m,25,200).forEach(y)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n}});const kne=Object.freeze(Object.defineProperty({__proto__:null,loess:Ex,regression:Sx},Symbol.toStringTag,{value:"Module"})),Rs=11102230246251565e-32,_n=134217729,$ne=(3+8*Rs)*Rs;function Ax(e,t,n,i,r){let s,o,a,l,u=t[0],c=i[0],f=0,d=0;c>u==c>-u?(s=u,u=t[++f]):(s=c,c=i[++d]);let h=0;if(fu==c>-u?(o=u+s,a=s-(o-u),u=t[++f]):(o=c+s,a=s-(o-c),c=i[++d]),s=o,a!==0&&(r[h++]=a);fu==c>-u?(o=s+u,l=o-s,a=s-(o-l)+(u-l),u=t[++f]):(o=s+c,l=o-s,a=s-(o-l)+(c-l),c=i[++d]),s=o,a!==0&&(r[h++]=a);for(;f=M||-C>=M||(f=e-S,a=e-(S+f)+(f-r),f=n-E,u=n-(E+f)+(f-r),f=t-A,l=t-(A+f)+(f-s),f=i-R,c=i-(R+f)+(f-s),a===0&&l===0&&u===0&&c===0)||(M=Ane*o+$ne*Math.abs(C),C+=S*c+R*a-(A*u+E*l),C>=M||-C>=M))return C;x=a*R,d=_n*a,h=d-(d-a),p=a-h,d=_n*R,g=d-(d-R),m=R-g,_=p*m-(x-h*g-p*g-h*m),k=l*E,d=_n*l,h=d-(d-l),p=l-h,d=_n*E,g=d-(d-E),m=E-g,w=p*m-(k-h*g-p*g-h*m),y=_-w,f=_-y,Pn[0]=_-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-k,f=v-y,Pn[1]=v-(y+f)+(f-k),$=b+y,f=$-b,Pn[2]=b-($-f)+(y-f),Pn[3]=$;const T=Ax(4,Iu,4,Pn,yT);x=S*c,d=_n*S,h=d-(d-S),p=S-h,d=_n*c,g=d-(d-c),m=c-g,_=p*m-(x-h*g-p*g-h*m),k=A*u,d=_n*A,h=d-(d-A),p=A-h,d=_n*u,g=d-(d-u),m=u-g,w=p*m-(k-h*g-p*g-h*m),y=_-w,f=_-y,Pn[0]=_-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-k,f=v-y,Pn[1]=v-(y+f)+(f-k),$=b+y,f=$-b,Pn[2]=b-($-f)+(y-f),Pn[3]=$;const O=Ax(T,yT,4,Pn,bT);x=a*c,d=_n*a,h=d-(d-a),p=a-h,d=_n*c,g=d-(d-c),m=c-g,_=p*m-(x-h*g-p*g-h*m),k=l*u,d=_n*l,h=d-(d-l),p=l-h,d=_n*u,g=d-(d-u),m=u-g,w=p*m-(k-h*g-p*g-h*m),y=_-w,f=_-y,Pn[0]=_-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-k,f=v-y,Pn[1]=v-(y+f)+(f-k),$=b+y,f=$-b,Pn[2]=b-($-f)+(y-f),Pn[3]=$;const P=Ax(O,bT,4,Pn,vT);return vT[P-1]}function $0(e,t,n,i,r,s){const o=(t-s)*(n-r),a=(e-r)*(i-s),l=o-a,u=Math.abs(o+a);return Math.abs(l)>=Cne*u?l:-Tne(e,t,n,i,r,s,u)}const xT=Math.pow(2,-52),E0=new Uint32Array(512);class C0{static from(t,n=One,i=Rne){const r=t.length,s=new Float64Array(r*2);for(let o=0;o>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const i=Math.max(2*n-5,0);this._triangles=new Uint32Array(i*3),this._halfedges=new Int32Array(i*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:i,_hullTri:r,_hullHash:s}=this,o=t.length>>1;let a=1/0,l=1/0,u=-1/0,c=-1/0;for(let E=0;Eu&&(u=A),R>c&&(c=R),this._ids[E]=E}const f=(a+u)/2,d=(l+c)/2;let h=1/0,p,g,m;for(let E=0;E0&&(g=E,h=A)}let v=t[2*g],x=t[2*g+1],_=1/0;for(let E=0;EC&&(E[A++]=M,C=this._dists[M])}this.hull=E.subarray(0,A),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if($0(y,b,v,x,k,w)<0){const E=g,A=v,R=x;g=m,v=k,x=w,m=E,k=A,w=R}const $=Nne(y,b,v,x,k,w);this._cx=$.x,this._cy=$.y;for(let E=0;E0&&Math.abs(M-A)<=xT&&Math.abs(T-R)<=xT||(A=M,R=T,C===p||C===g||C===m))continue;let O=0;for(let ae=0,ke=this._hashKey(M,T);ae=0;)if(P=j,P===O){P=-1;break}if(P===-1)continue;let W=this._addTriangle(P,C,i[P],-1,-1,r[P]);r[C]=this._legalize(W+2),r[P]=W,S++;let ne=i[P];for(;j=i[ne],$0(M,T,t[2*ne],t[2*ne+1],t[2*j],t[2*j+1])<0;)W=this._addTriangle(ne,C,j,r[C],-1,r[ne]),r[C]=this._legalize(W+2),i[ne]=ne,S--,ne=j;if(P===O)for(;j=n[P],$0(M,T,t[2*j],t[2*j+1],t[2*P],t[2*P+1])<0;)W=this._addTriangle(j,C,P,-1,r[P],r[j]),this._legalize(W+2),r[j]=W,i[P]=P,S--,P=j;this._hullStart=n[C]=P,i[P]=n[ne]=C,i[C]=ne,s[this._hashKey(M,T)]=C,s[this._hashKey(t[2*P],t[2*P+1])]=P}this.hull=new Uint32Array(S);for(let E=0,A=this._hullStart;E0?3-n:1+n)/4}function Tx(e,t,n,i){const r=e-n,s=t-i;return r*r+s*s}function Fne(e,t,n,i,r,s,o,a){const l=e-o,u=t-a,c=n-o,f=i-a,d=r-o,h=s-a,p=l*l+u*u,g=c*c+f*f,m=d*d+h*h;return l*(f*m-g*h)-u*(c*m-g*d)+p*(c*h-f*d)<0}function Dne(e,t,n,i,r,s){const o=n-e,a=i-t,l=r-e,u=s-t,c=o*o+a*a,f=l*l+u*u,d=.5/(o*u-a*l),h=(u*c-a*f)*d,p=(o*f-l*c)*d;return h*h+p*p}function Nne(e,t,n,i,r,s){const o=n-e,a=i-t,l=r-e,u=s-t,c=o*o+a*a,f=l*l+u*u,d=.5/(o*u-a*l),h=e+(u*c-a*f)*d,p=t+(o*f-l*c)*d;return{x:h,y:p}}function zu(e,t,n,i){if(i-n<=20)for(let r=n+1;r<=i;r++){const s=e[r],o=t[s];let a=r-1;for(;a>=n&&t[e[a]]>o;)e[a+1]=e[a--];e[a+1]=s}else{const r=n+i>>1;let s=n+1,o=i;ld(e,r,s),t[e[n]]>t[e[i]]&&ld(e,n,i),t[e[s]]>t[e[i]]&&ld(e,s,i),t[e[n]]>t[e[s]]&&ld(e,n,s);const a=e[s],l=t[a];for(;;){do s++;while(t[e[s]]l);if(o=o-n?(zu(e,t,s,i),zu(e,t,n,o-1)):(zu(e,t,n,o-1),zu(e,t,s,i))}}function ld(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function One(e){return e[0]}function Rne(e){return e[1]}const _T=1e-6;class Wa{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,i){t=+t,n=+n,i=+i;const r=t+i,s=n;if(i<0)throw new Error("negative radius");this._x1===null?this._+=`M${r},${s}`:(Math.abs(this._x1-r)>_T||Math.abs(this._y1-s)>_T)&&(this._+="L"+r+","+s),i&&(this._+=`A${i},${i},0,1,1,${t-i},${n}A${i},${i},0,1,1,${this._x1=r},${this._y1=s}`)}rect(t,n,i,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+i}v${+r}h${-i}Z`}value(){return this._||null}}class Mx{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}}let Lne=class{constructor(t,[n,i,r,s]=[0,0,960,500]){if(!((r=+r)>=(n=+n))||!((s=+s)>=(i=+i)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=r,this.xmin=n,this.ymax=s,this.ymin=i,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:i},vectors:r}=this;let s,o;const a=this.circumcenters=this._circumcenters.subarray(0,i.length/3*2);for(let g=0,m=0,y=i.length,b,v;g1;)s-=2;for(let o=2;o0){if(n>=this.ymax)return null;(o=(this.ymax-n)/r)0){if(t>=this.xmax)return null;(o=(this.xmax-t)/i)this.xmax?2:0)|(nthis.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let n=0;n1e-10)return!1}return!0}function jne(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class Fx{static from(t,n=zne,i=Pne,r){return new Fx("length"in t?Une(t,n,i,r):Float64Array.from(qne(t,n,i,r)))}constructor(t){this._delaunator=new C0(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,n=this.points;if(t.hull&&t.hull.length>2&&Bne(t)){this.collinear=Int32Array.from({length:n.length/2},(d,h)=>h).sort((d,h)=>n[2*d]-n[2*h]||n[2*d+1]-n[2*h+1]);const l=this.collinear[0],u=this.collinear[this.collinear.length-1],c=[n[2*l],n[2*l+1],n[2*u],n[2*u+1]],f=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let d=0,h=n.length/2;d0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,r.length===2&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new Lne(this,t)}*neighbors(t){const{inedges:n,hull:i,_hullIndex:r,halfedges:s,triangles:o,collinear:a}=this;if(a){const f=a.indexOf(t);f>0&&(yield a[f-1]),f=0&&s!==i&&s!==r;)i=s;return s}_step(t,n,i){const{inedges:r,hull:s,_hullIndex:o,halfedges:a,triangles:l,points:u}=this;if(r[t]===-1||!u.length)return(t+1)%(u.length>>1);let c=t,f=Pu(n-u[t*2],2)+Pu(i-u[t*2+1],2);const d=r[t];let h=d;do{let p=l[h];const g=Pu(n-u[p*2],2)+Pu(i-u[p*2+1],2);if(g>5)*e[1]),m=null,y=u.length,b=-1,v=[],x=u.map(k=>({text:t(k),font:n(k),style:r(k),weight:s(k),rotate:o(k),size:~~(i(k)+1e-14),padding:a(k),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:k})).sort((k,w)=>w.size-k.size);++b>1,_.y=e[1]*(c()+.5)>>1,Yne(p,_,x,b),_.hasText&&h(g,_,m)&&(v.push(_),m?Kne(m,_):m=[{x:_.x+_.x0,y:_.y+_.y0},{x:_.x+_.x1,y:_.y+_.y1}],_.x-=e[0]>>1,_.y-=e[1]>>1)}return v};function d(p){p.width=p.height=1;var g=Math.sqrt(p.getContext("2d").getImageData(0,0,1,1).data.length>>2);p.width=(ud<<5)/g,p.height=S0/g;var m=p.getContext("2d");return m.fillStyle=m.strokeStyle="red",m.textAlign="center",{context:m,ratio:g}}function h(p,g,m){for(var y=g.x,b=g.y,v=Math.sqrt(e[0]*e[0]+e[1]*e[1]),x=l(e),_=c()<.5?1:-1,k=-_,w,$,S;(w=x(k+=_))&&($=~~w[0],S=~~w[1],!(Math.min(Math.abs($),Math.abs(S))>=v));)if(g.x=y+$,g.y=b+S,!(g.x+g.x0<0||g.y+g.y0<0||g.x+g.x1>e[0]||g.y+g.y1>e[1])&&(!m||!Zne(g,p,e[0]))&&(!m||Jne(g,m))){for(var E=g.sprite,A=g.width>>5,R=e[0]>>5,C=g.x-(A<<4),M=C&127,T=32-M,O=g.y1-g.y0,P=(g.y+g.y0)*R+(C>>5),j,W=0;W>>M:0);P+=R}return g.sprite=null,!0}return!1}return f.words=function(p){return arguments.length?(u=p,f):u},f.size=function(p){return arguments.length?(e=[+p[0],+p[1]],f):e},f.font=function(p){return arguments.length?(n=Ha(p),f):n},f.fontStyle=function(p){return arguments.length?(r=Ha(p),f):r},f.fontWeight=function(p){return arguments.length?(s=Ha(p),f):s},f.rotate=function(p){return arguments.length?(o=Ha(p),f):o},f.text=function(p){return arguments.length?(t=Ha(p),f):t},f.spiral=function(p){return arguments.length?(l=tie[p]||p,f):l},f.fontSize=function(p){return arguments.length?(i=Ha(p),f):i},f.padding=function(p){return arguments.length?(a=Ha(p),f):a},f.random=function(p){return arguments.length?(c=p,f):c},f}function Yne(e,t,n,i){if(!t.sprite){var r=e.context,s=e.ratio;r.clearRect(0,0,(ud<<5)/s,S0/s);var o=0,a=0,l=0,u=n.length,c,f,d,h,p;for(--i;++i>5<<5,d=~~Math.max(Math.abs(b+v),Math.abs(b-v))}else c=c+31>>5<<5;if(d>l&&(l=d),o+c>=ud<<5&&(o=0,a+=l,l=0),a+d>=S0)break;r.translate((o+(c>>1))/s,(a+(d>>1))/s),t.rotate&&r.rotate(t.rotate*Nx),r.fillText(t.text,0,0),t.padding&&(r.lineWidth=2*t.padding,r.strokeText(t.text,0,0)),r.restore(),t.width=c,t.height=d,t.xoff=o,t.yoff=a,t.x1=c>>1,t.y1=d>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,o+=c}for(var _=r.getImageData(0,0,(ud<<5)/s,S0/s).data,k=[];--i>=0;)if(t=n[i],!!t.hasText){for(c=t.width,f=c>>5,d=t.y1-t.y0,h=0;h>5),E=_[(a+p)*(ud<<5)+(o+h)<<2]?1<<31-h%32:0;k[S]|=E,w|=E}w?$=p:(t.y0++,d--,p--,a++)}t.y1=t.y0+$,t.sprite=k.slice(0,(t.y1-t.y0)*f)}}}function Zne(e,t,n){n>>=5;for(var i=e.sprite,r=e.width>>5,s=e.x-(r<<4),o=s&127,a=32-o,l=e.y1-e.y0,u=(e.y+e.y0)*n+(s>>5),c,f=0;f>>o:0))&t[u+d])return!0;u+=n}return!1}function Kne(e,t){var n=e[0],i=e[1];t.x+t.x0i.x&&(i.x=t.x+t.x1),t.y+t.y1>i.y&&(i.y=t.y+t.y1)}function Jne(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0t[0].y&&e.y+e.y0g(p(m))}r.forEach(p=>{p[o[0]]=NaN,p[o[1]]=NaN,p[o[3]]=0});const u=s.words(r).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(a).random(Ni).layout(),c=s.size(),f=c[0]>>1,d=c[1]>>1,h=u.length;for(let p=0,g,m;pnew Uint8Array(e),sie=e=>new Uint16Array(e),cd=e=>new Uint32Array(e);function oie(){let e=8,t=[],n=cd(0),i=A0(0,e),r=A0(0,e);return{data:()=>t,seen:()=>n=aie(n,t.length),add(s){for(let o=0,a=t.length,l=s.length,u;ot.length,curr:()=>i,prev:()=>r,reset:s=>r[s]=i[s],all:()=>e<257?255:e<65537?65535:4294967295,set(s,o){i[s]|=o},clear(s,o){i[s]&=~o},resize(s,o){const a=i.length;(s>a||o>e)&&(e=Math.max(o,e),i=A0(s,e,i),r=A0(s,e))}}}function aie(e,t,n){return e.length>=t?e:(n=n||new e.constructor(t),n.set(e),n)}function A0(e,t,n){const i=(t<257?rie:t<65537?sie:cd)(e);return n&&i.set(n),i}function $T(e,t,n){const i=1<0)for(m=0;me,size:()=>n}}function lie(e,t){return e.sort.call(t,(n,i)=>{const r=e[n],s=e[i];return rs?1:0}),FU(e,t)}function uie(e,t,n,i,r,s,o,a,l){let u=0,c=0,f;for(f=0;ut.modified(i.fields));return n?this.reinit(e,t):this.eval(e,t)}else return this.init(e,t)},init(e,t){const n=e.fields,i=e.query,r=this._indices={},s=this._dims=[],o=i.length;let a=0,l,u;for(;a{const s=r.remove(t,n);for(const o in i)i[o].reindex(s)})},update(e,t,n){const i=this._dims,r=e.query,s=t.stamp,o=i.length;let a=0,l,u;for(n.filters=0,u=0;uh)for(m=h,y=Math.min(f,p);mp)for(m=Math.max(f,p),y=d;mf)for(p=f,g=Math.min(u,d);pd)for(p=Math.max(u,d),g=c;pa[c]&n?null:o[c];return s.filter(s.MOD,u),r&r-1?(s.filter(s.ADD,c=>{const f=a[c]&n;return!f&&f^l[c]&n?o[c]:null}),s.filter(s.REM,c=>{const f=a[c]&n;return f&&!(f^(f^l[c]&n))?o[c]:null})):(s.filter(s.ADD,u),s.filter(s.REM,c=>(a[c]&n)===r?o[c]:null)),s.filter(s.SOURCE,c=>u(c._index))}});const cie=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:Rx,resolvefilter:Lx},Symbol.toStringTag,{value:"Module"})),fie="RawCode",Ga="Literal",die="Property",hie="Identifier",pie="ArrayExpression",gie="BinaryExpression",CT="CallExpression",mie="ConditionalExpression",yie="LogicalExpression",bie="MemberExpression",vie="ObjectExpression",xie="UnaryExpression";function ur(e){this.type=e}ur.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=_ie(this),n=0,i=t.length;n",Kr[Va]="Identifier",Kr[Bo]="Keyword",Kr[M0]="Null",Kr[Xa]="Numeric",Kr[ti]="Punctuator",Kr[dd]="String",Kr[wie]="RegularExpression";var kie="ArrayExpression",$ie="BinaryExpression",Eie="CallExpression",Cie="ConditionalExpression",ST="Identifier",Sie="Literal",Aie="LogicalExpression",Tie="MemberExpression",Mie="ObjectExpression",Fie="Property",Die="UnaryExpression",Vt="Unexpected token %0",Nie="Unexpected number",Oie="Unexpected string",Rie="Unexpected identifier",Lie="Unexpected reserved word",Iie="Unexpected end of input",Ix="Invalid regular expression",zx="Invalid regular expression: missing /",AT="Octal literals are not allowed in strict mode.",zie="Duplicate data property in object literal not allowed in strict mode",on="ILLEGAL",hd="Disabled.",Pie=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),Bie=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function F0(e,t){if(!e)throw new Error("ASSERT: "+t)}function Ls(e){return e>=48&&e<=57}function Px(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function pd(e){return"01234567".indexOf(e)>=0}function jie(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function gd(e){return e===10||e===13||e===8232||e===8233}function md(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&Pie.test(String.fromCharCode(e))}function D0(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&Bie.test(String.fromCharCode(e))}const Uie={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function TT(){for(;B1114111||e!=="}")&&Je({},Vt,on),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function MT(){var e,t;for(e=fe.charCodeAt(B++),t=String.fromCharCode(e),e===92&&(fe.charCodeAt(B)!==117&&Je({},Vt,on),++B,e=Bx("u"),(!e||e==="\\"||!md(e.charCodeAt(0)))&&Je({},Vt,on),t=e);B>>=")return B+=4,{type:ti,value:o,start:e,end:B};if(s=o.substr(0,3),s===">>>"||s==="<<="||s===">>=")return B+=3,{type:ti,value:s,start:e,end:B};if(r=s.substr(0,2),i===r[1]&&"+-<>&|".indexOf(i)>=0||r==="=>")return B+=2,{type:ti,value:r,start:e,end:B};if(r==="//"&&Je({},Vt,on),"<>=!+-*%&|^/".indexOf(i)>=0)return++B,{type:ti,value:i,start:e,end:B};Je({},Vt,on)}function Gie(e){let t="";for(;B=0&&B=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(i,r)=>{if(parseInt(r,16)<=1114111)return"x";Je({},Ix)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{Je({},Ix)}try{return new RegExp(e,t)}catch{return null}}function Yie(){var e,t,n,i,r;for(e=fe[B],F0(e==="/","Regular expression literal must start with a slash"),t=fe[B++],n=!1,i=!1;B=0&&Je({},Ix,n),{value:n,literal:t}}function Kie(){var e,t,n,i;return st=null,TT(),e=B,t=Yie(),n=Zie(),i=Xie(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:B}}function Jie(e){return e.type===Va||e.type===Bo||e.type===T0||e.type===M0}function DT(){if(TT(),B>=wn)return{type:fd,start:B,end:B};const e=fe.charCodeAt(B);return md(e)?Wie():e===40||e===41||e===59?jx():e===39||e===34?Vie():e===46?Ls(fe.charCodeAt(B+1))?FT():jx():Ls(e)?FT():jx()}function ni(){const e=st;return B=e.end,st=DT(),B=e.end,e}function NT(){const e=B;st=DT(),B=e}function Qie(e){const t=new ur(wie);return t.elements=e,t}function OT(e,t,n){const i=new ur(e==="||"||e==="&&"?Sie:kie);return i.operator=e,i.left=t,i.right=n,i}function ere(e,t){const n=new ur($ie);return n.callee=e,n.arguments=t,n}function tre(e,t,n){const i=new ur(Eie);return i.test=e,i.consequent=t,i.alternate=n,i}function Ux(e){const t=new ur(ST);return t.name=e,t}function yd(e){const t=new ur(Cie);return t.value=e.value,t.raw=fe.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function RT(e,t,n){const i=new ur(Aie);return i.computed=e==="[",i.object=t,i.property=n,i.computed||(n.member=!0),i}function nre(e){const t=new ur(Tie);return t.properties=e,t}function LT(e,t,n){const i=new ur(Mie);return i.key=t,i.value=n,i.kind=e,i}function ire(e,t){const n=new ur(Fie);return n.operator=e,n.argument=t,n.prefix=!0,n}function Je(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,(s,o)=>(F0(o":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11;break}return t}function gre(){var e,t,n,i,r,s,o,a,l,u;if(e=st,l=O0(),i=st,r=PT(i),r===0)return l;for(i.prec=r,ni(),t=[e,st],o=O0(),s=[l,i,o];(r=PT(st))>0;){for(;s.length>2&&r<=s[s.length-2].prec;)o=s.pop(),a=s.pop().value,l=s.pop(),t.pop(),n=OT(a,l,o),s.push(n);i=ni(),i.prec=r,s.push(i),t.push(st),n=O0(),s.push(n)}for(u=s.length-1,n=s[u],t.pop();u>1;)t.pop(),n=OT(s[u-1].value,s[u-2],n),u-=2;return n}function Ya(){var e,t,n;return e=gre(),bt("?")&&(ni(),t=Ya(),kn(":"),n=Ya(),e=tre(e,t,n)),e}function Wx(){const e=Ya();if(bt(","))throw new Error(hd);return e}function Hx(e){fe=e,B=0,wn=fe.length,st=null,NT();const t=Wx();if(st.type!==fd)throw new Error("Unexpect token after expression.");return t}var BT={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function jT(e){function t(o,a,l,u){let c=e(a[0]);return l&&(c=l+"("+c+")",l.lastIndexOf("new ",0)===0&&(c="("+c+")")),c+"."+o+(u<0?"":u===0?"()":"("+a.slice(1).map(e).join(",")+")")}function n(o,a,l){return u=>t(o,u,a,l)}const i="new Date",r="String",s="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",hypot:"Math.hypot",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(o){o.length<3&&U("Missing arguments to clamp function."),o.length>3&&U("Too many arguments to clamp function.");const a=o.map(e);return"Math.max("+a[1]+", Math.min("+a[2]+","+a[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:i,date:n("getDate",i,0),day:n("getDay",i,0),year:n("getFullYear",i,0),month:n("getMonth",i,0),hours:n("getHours",i,0),minutes:n("getMinutes",i,0),seconds:n("getSeconds",i,0),milliseconds:n("getMilliseconds",i,0),time:n("getTime",i,0),timezoneoffset:n("getTimezoneOffset",i,0),utcdate:n("getUTCDate",i,0),utcday:n("getUTCDay",i,0),utcyear:n("getUTCFullYear",i,0),utcmonth:n("getUTCMonth",i,0),utchours:n("getUTCHours",i,0),utcminutes:n("getUTCMinutes",i,0),utcseconds:n("getUTCSeconds",i,0),utcmilliseconds:n("getUTCMilliseconds",i,0),length:n("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:n("toUpperCase",r,0),lower:n("toLowerCase",r,0),substring:n("substring",r),split:n("split",r),trim:n("trim",r,0),regexp:s,test:n("test",s),if:function(o){o.length<3&&U("Missing arguments to if function."),o.length>3&&U("Too many arguments to if function.");const a=o.map(e);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function mre(e){const t=e&&e.length-1;return t&&(e[0]==='"'&&e[t]==='"'||e[0]==="'"&&e[t]==="'")?e.slice(1,-1):e}function UT(e){e=e||{};const t=e.allowed?Ki(e.allowed):{},n=e.forbidden?Ki(e.forbidden):{},i=e.constants||BT,r=(e.functions||jT)(f),s=e.globalvar,o=e.fieldvar,a=Me(s)?s:p=>`${s}["${p}"]`;let l={},u={},c=0;function f(p){if(te(p))return p;const g=d[p.type];return g==null&&U("Unsupported type: "+p.type),g(p)}const d={Literal:p=>p.raw,Identifier:p=>{const g=p.name;return c>0?g:pe(n,g)?U("Illegal identifier: "+g):pe(i,g)?i[g]:pe(t,g)?g:(l[g]=1,a(g))},MemberExpression:p=>{const g=!p.computed,m=f(p.object);g&&(c+=1);const y=f(p.property);return m===o&&(u[mre(y)]=1),g&&(c-=1),m+(g?"."+y:"["+y+"]")},CallExpression:p=>{p.callee.type!=="Identifier"&&U("Illegal callee type: "+p.callee.type);const g=p.callee.name,m=p.arguments,y=pe(r,g)&&r[g];return y||U("Unrecognized function: "+g),Me(y)?y(m):y+"("+m.map(f).join(",")+")"},ArrayExpression:p=>"["+p.elements.map(f).join(",")+"]",BinaryExpression:p=>"("+f(p.left)+" "+p.operator+" "+f(p.right)+")",UnaryExpression:p=>"("+p.operator+f(p.argument)+")",ConditionalExpression:p=>"("+f(p.test)+"?"+f(p.consequent)+":"+f(p.alternate)+")",LogicalExpression:p=>"("+f(p.left)+p.operator+f(p.right)+")",ObjectExpression:p=>"{"+p.properties.map(f).join(",")+"}",Property:p=>{c+=1;const g=f(p.key);return c-=1,g+":"+f(p.value)}};function h(p){const g={code:f(p),globals:Object.keys(l),fields:Object.keys(u)};return l={},u={},g}return h.functions=r,h.constants=i,h}const qT=Symbol("vega_selection_getter");function WT(e){return(!e.getter||!e.getter[qT])&&(e.getter=Ai(e.field),e.getter[qT]=!0),e.getter}const Gx="intersect",HT="union",yre="vlMulti",bre="vlPoint",GT="or",vre="and",Jr="_vgsid_",bd=Ai(Jr),xre="E",_re="R",wre="R-E",kre="R-LE",$re="R-RE",R0="index:unit";function VT(e,t){for(var n=t.fields,i=t.values,r=n.length,s=0,o,a;sFe(t.fields?{values:t.fields.map(i=>WT(i)(n.datum))}:{[Jr]:bd(n.datum)},t))}function Mre(e,t,n,i){for(var r=this.context.data[e],s=r?r.values.value:[],o={},a={},l={},u,c,f,d,h,p,g,m,y,b,v=s.length,x=0,_,k;x(w[c[S].field]=$,w),{})))}else h=Jr,p=bd(u),g=o[h]||(o[h]={}),m=g[d]||(g[d]=[]),m.push(p),n&&(m=a[d]||(a[d]=[]),m.push({[Jr]:p}));if(t=t||HT,o[Jr]?o[Jr]=Vx[`${Jr}_${t}`](...Object.values(o[Jr])):Object.keys(o).forEach(w=>{o[w]=Object.keys(o[w]).map($=>o[w][$]).reduce(($,S)=>$===void 0?S:Vx[`${l[w]}_${t}`]($,S))}),s=Object.keys(a),n&&s.length){const w=i?bre:yre;o[w]=t===HT?{[GT]:s.reduce(($,S)=>($.push(...a[S]),$),[])}:{[vre]:s.map($=>({[GT]:a[$]}))}}return o}var Vx={[`${Jr}_union`]:PU,[`${Jr}_intersect`]:IU,E_union:function(e,t){if(!e.length)return t;for(var n=0,i=t.length;nt.indexOf(n)>=0):t},R_union:function(e,t){var n=hn(t[0]),i=hn(t[1]);return n>i&&(n=t[1],i=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]i&&(n=t[1],i=t[0]),e.length?ii&&(e[1]=i),e):[n,i]}};const Fre=":",Dre="@";function Xx(e,t,n,i){t[0].type!==Ga&&U("First argument to selection functions must be a string literal.");const r=t[0].value,s=t.length>=2&&Ue(t).value,o="unit",a=Dre+o,l=Fre+r;s===Gx&&!pe(i,a)&&(i[a]=n.getData(r).indataRef(n,o)),pe(i,l)||(i[l]=n.getData(r).tuplesRef())}function YT(e){const t=this.context.data[e];return t?t.values.value:[]}function Nre(e,t,n){const i=this.context.data[e]["index:"+t],r=i?i.value.get(n):void 0;return r&&r.count}function Ore(e,t){const n=this.context.dataflow,i=this.context.data[e],r=i.input;return n.pulse(r,n.changeset().remove(Ti).insert(t)),1}function Rre(e,t,n){if(e){const i=this.context.dataflow,r=e.mark.source;i.pulse(r,i.changeset().encode(e,t))}return n!==void 0?n:e}const vd=e=>function(t,n){return this.context.dataflow.locale()[e](n)(t)},Lre=vd("format"),ZT=vd("timeFormat"),Ire=vd("utcFormat"),zre=vd("timeParse"),Pre=vd("utcParse"),L0=new Date(2e3,0,1);function I0(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)?"":(L0.setYear(2e3),L0.setMonth(e),L0.setDate(t),ZT.call(this,L0,n))}function Bre(e){return I0.call(this,e,1,"%B")}function jre(e){return I0.call(this,e,1,"%b")}function Ure(e){return I0.call(this,0,2+e,"%A")}function qre(e){return I0.call(this,0,2+e,"%a")}const Wre=":",Hre="@",Yx="%",KT="$";function Zx(e,t,n,i){t[0].type!==Ga&&U("First argument to data functions must be a string literal.");const r=t[0].value,s=Wre+r;if(!pe(s,i))try{i[s]=n.getData(r).tuplesRef()}catch{}}function Gre(e,t,n,i){t[0].type!==Ga&&U("First argument to indata must be a string literal."),t[1].type!==Ga&&U("Second argument to indata must be a string literal.");const r=t[0].value,s=t[1].value,o=Hre+s;pe(o,i)||(i[o]=n.getData(r).indataRef(n,s))}function Bn(e,t,n,i){if(t[0].type===Ga)JT(n,i,t[0].value);else for(e in n.scales)JT(n,i,e)}function JT(e,t,n){const i=Yx+n;if(!pe(t,i))try{t[i]=e.scaleRef(n)}catch{}}function Qr(e,t){if(Me(e))return e;if(te(e)){const n=t.scales[e];return n&&lX(n.value)?n.value:void 0}}function Vre(e,t,n){t.__bandwidth=r=>r&&r.bandwidth?r.bandwidth():0,n._bandwidth=Bn,n._range=Bn,n._scale=Bn;const i=r=>"_["+(r.type===Ga?J(Yx+r.value):J(Yx)+"+"+e(r))+"]";return{_bandwidth:r=>`this.__bandwidth(${i(r[0])})`,_range:r=>`${i(r[0])}.range()`,_scale:r=>`${i(r[0])}(${e(r[1])})`}}function Kx(e,t){return function(n,i,r){if(n){const s=Qr(n,(r||this).context);return s&&s.path[e](i)}else return t(i)}}const Xre=Kx("area",yJ),Yre=Kx("bounds",_J),Zre=Kx("centroid",SJ);function Kre(e,t){const n=Qr(e,(t||this).context);return n&&n.scale()}function Jre(e){const t=this.context.group;let n=!1;if(t)for(;e;){if(e===t){n=!0;break}e=e.mark.group}return n}function Jx(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(i){e.warn(i)}return n[n.length-1]}function Qre(){return Jx(this.context.dataflow,"warn",arguments)}function ese(){return Jx(this.context.dataflow,"info",arguments)}function tse(){return Jx(this.context.dataflow,"debug",arguments)}function Qx(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function e7(e){const t=bo(e),n=Qx(t.r),i=Qx(t.g),r=Qx(t.b);return .2126*n+.7152*i+.0722*r}function nse(e,t){const n=e7(e),i=e7(t),r=Math.max(n,i),s=Math.min(n,i);return(r+.05)/(s+.05)}function ise(){const e=[].slice.call(arguments);return e.unshift({}),Fe(...e)}function QT(e,t){return e===t||e!==e&&t!==t?!0:q(e)?q(t)&&e.length===t.length?rse(e,t):!1:ie(e)&&ie(t)?eM(e,t):!1}function rse(e,t){for(let n=0,i=e.length;neM(e,t)}function sse(e,t,n,i,r,s){const o=this.context.dataflow,a=this.context.data[e],l=a.input,u=o.stamp();let c=a.changes,f,d;if(o._trigger===!1||!(l.value.length||t||i))return 0;if((!c||c.stamp{a.modified=!0,o.pulse(l,c).run()},!0,1)),n&&(f=n===!0?Ti:q(n)||ip(n)?n:tM(n),c.remove(f)),t&&c.insert(t),i&&(f=tM(i),l.value.some(f)?c.remove(f):c.insert(i)),r)for(d in s)c.modify(r,d,s[d]);return 1}function ose(e){const t=e.touches,n=t[0].clientX-t[1].clientX,i=t[0].clientY-t[1].clientY;return Math.hypot(n,i)}function ase(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)}const nM={};function lse(e,t){const n=nM[t]||(nM[t]=Ai(t));return q(e)?e.map(n):n(e)}function t7(e){return q(e)||ArrayBuffer.isView(e)?e:null}function n7(e){return t7(e)||(te(e)?e:null)}function use(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1?t-1:0),i=1;i1?t-1:0),i=1;i1?t-1:0),i=1;is.stop(u(c),e(c))),s}function kse(e,t,n){const i=Qr(e,(n||this).context);return function(r){return i?i.path.context(r)(t):""}}function $se(e){let t=null;return function(n){return n?vf(n,t=t||bu(e)):e}}const iM=e=>e.data;function rM(e,t){const n=YT.call(t,e);return n.root&&n.root.lookup||{}}function Ese(e,t,n){const i=rM(e,this),r=i[t],s=i[n];return r&&s?r.path(s).map(iM):void 0}function Cse(e,t){const n=rM(e,this)[t];return n?n.ancestors().map(iM):void 0}const sM=()=>typeof window<"u"&&window||null;function Sse(){const e=sM();return e?e.screen:{}}function Ase(){const e=sM();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]}function Tse(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]}function oM(e,t,n){if(!e)return[];const[i,r]=e,s=new Ot().set(i[0],i[1],r[0],r[1]),o=n||this.context.dataflow.scenegraph().root;return pC(o,s,Mse(t))}function Mse(e){let t=null;if(e){const n=ee(e.marktype),i=ee(e.markname);t=r=>(!n.length||n.some(s=>r.marktype===s))&&(!i.length||i.some(s=>r.name===s))}return t}function Fse(e,t,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5;e=ee(e);const r=e[e.length-1];return r===void 0||Math.hypot(r[0]-t,r[1]-n)>i?[...e,[t,n]]:e}function Dse(e){return ee(e).reduce((t,n,i)=>{let[r,s]=n;return t+=i==0?`M ${r},${s} `:i===e.length-1?" Z":`L ${r},${s} `},"")}function Nse(e,t,n){const{x:i,y:r,mark:s}=n,o=new Ot().set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[l,u]of t)lo.x2&&(o.x2=l),uo.y2&&(o.y2=u);return o.translate(i,r),oM([[o.x1,o.y1],[o.x2,o.y2]],e,s).filter(l=>Ose(l.x,l.y,t))}function Ose(e,t,n){let i=0;for(let r=0,s=n.length-1;rt!=a>t&&e<(o-l)*(t-u)/(a-u)+l&&i++}return i&1}const xd={random(){return Di()},cumulativeNormal:fp,cumulativeLogNormal:uy,cumulativeUniform:hy,densityNormal:ry,densityLogNormal:ly,densityUniform:dy,quantileNormal:dp,quantileLogNormal:cy,quantileUniform:py,sampleNormal:cp,sampleLogNormal:ay,sampleUniform:fy,isArray:q,isBoolean:ro,isDate:so,isDefined(e){return e!==void 0},isNumber:Xe,isObject:ie,isRegExp:a4,isString:te,isTuple:ip,isValid(e){return e!=null&&e===e},toBoolean:h2,toDate(e){return p2(e)},toNumber:hn,toString:g2,indexof:cse,join:use,lastindexof:fse,replace:hse,reverse:pse,slice:dse,flush:s4,lerp:l4,merge:ise,pad:f4,peek:Ue,pluck:lse,span:Lc,inrange:Vl,truncate:d4,rgb:bo,lab:Fp,hcl:Dp,hsl:Ap,luminance:e7,contrast:nse,sequence:hi,format:Lre,utcFormat:Ire,utcParse:Pre,utcOffset:t8,utcSequence:r8,timeFormat:ZT,timeParse:zre,timeOffset:e8,timeSequence:i8,timeUnitSpecifier:q4,monthFormat:Bre,monthAbbrevFormat:jre,dayFormat:Ure,dayAbbrevFormat:qre,quarter:t4,utcquarter:n4,week:H4,utcweek:X4,dayofyear:W4,utcdayofyear:V4,warn:Qre,info:ese,debug:tse,extent(e){return Or(e)},inScope:Jre,intersect:oM,clampRange:i4,pinchDistance:ose,pinchAngle:ase,screen:Sse,containerSize:Tse,windowSize:Ase,bandspace:gse,setdata:Ore,pathShape:$se,panLinear:K6,panLog:J6,panPow:Q6,panSymlog:e4,zoomLinear:a2,zoomLog:l2,zoomPow:Rh,zoomSymlog:u2,encode:Rre,modify:sse,lassoAppend:Fse,lassoPath:Dse,intersectLasso:Nse},Rse=["view","item","group","xy","x","y"],Lse="event.vega.",aM="this.",i7={},lM={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${J(KT+e)}]`,functions:Ise,constants:BT,visitors:i7},r7=UT(lM);function Ise(e){const t=jT(e);Rse.forEach(n=>t[n]=Lse+n);for(const n in xd)t[n]=aM+n;return Fe(t,Vre(e,xd,i7)),t}function Ft(e,t,n){return arguments.length===1?xd[e]:(xd[e]=t,n&&(i7[e]=n),r7&&(r7.functions[e]=aM+e),this)}Ft("bandwidth",mse,Bn),Ft("copy",yse,Bn),Ft("domain",bse,Bn),Ft("range",xse,Bn),Ft("invert",vse,Bn),Ft("scale",_se,Bn),Ft("gradient",wse,Bn),Ft("geoArea",Xre,Bn),Ft("geoBounds",Yre,Bn),Ft("geoCentroid",Zre,Bn),Ft("geoShape",kse,Bn),Ft("geoScale",Kre,Bn),Ft("indata",Nre,Gre),Ft("data",YT,Zx),Ft("treePath",Ese,Zx),Ft("treeAncestors",Cse,Zx),Ft("vlSelectionTest",Ere,Xx),Ft("vlSelectionIdTest",Are,Xx),Ft("vlSelectionResolve",Mre,Xx),Ft("vlSelectionTuples",Tre);function es(e,t){const n={};let i;try{e=te(e)?e:J(e)+"",i=Hx(e)}catch{U("Expression parse error: "+e)}i.visit(s=>{if(s.type!==CT)return;const o=s.callee.name,a=lM.visitors[o];a&&a(o,s.arguments,t,n)});const r=r7(i);return r.globals.forEach(s=>{const o=KT+s;!pe(n,o)&&t.getSignal(s)&&(n[o]=t.signalRef(s))}),{$expr:Fe({code:r.code},t.options.ast?{ast:i}:null),$fields:r.fields,$params:n}}function zse(e){const t=this,n=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),e.locale&&(t.locale=e.locale),n.forEach(i=>t.parseOperator(i)),n.forEach(i=>t.parseOperatorParameters(i)),(e.streams||[]).forEach(i=>t.parseStream(i)),(e.updates||[]).forEach(i=>t.parseUpdate(i)),t.resolve()}const Pse=Ki(["rule"]),uM=Ki(["group","image","rect"]);function Bse(e,t){let n="";return Pse[t]||(e.x2&&(e.x?(uM[t]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),e.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),e.y2&&(e.y?(uM[t]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),e.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}function s7(e){return(e+"").toLowerCase()}function jse(e){return s7(e)==="operator"}function Use(e){return s7(e)==="collect"}function _d(e,t,n){n.endsWith(";")||(n="return("+n+");");const i=Function(...t.concat(n));return e&&e.functions?i.bind(e.functions):i}function qse(e,t,n,i){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n} +`&&++B;else{if(gd(i.charCodeAt(0)))break;e+=i}return t!==""&&Je({},Vt,on),{type:dd,value:e,octal:s,start:n,end:B}}function Yie(e,t){let n=e;t.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(i,r)=>{if(parseInt(r,16)<=1114111)return"x";Je({},Ix)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{Je({},Ix)}try{return new RegExp(e,t)}catch{return null}}function Zie(){var e,t,n,i,r;for(e=fe[B],F0(e==="/","Regular expression literal must start with a slash"),t=fe[B++],n=!1,i=!1;B=0&&Je({},Ix,n),{value:n,literal:t}}function Jie(){var e,t,n,i;return st=null,TT(),e=B,t=Zie(),n=Kie(),i=Yie(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:B}}function Qie(e){return e.type===Va||e.type===Bo||e.type===T0||e.type===M0}function DT(){if(TT(),B>=wn)return{type:fd,start:B,end:B};const e=fe.charCodeAt(B);return md(e)?Hie():e===40||e===41||e===59?jx():e===39||e===34?Xie():e===46?Ls(fe.charCodeAt(B+1))?FT():jx():Ls(e)?FT():jx()}function ni(){const e=st;return B=e.end,st=DT(),B=e.end,e}function NT(){const e=B;st=DT(),B=e}function ere(e){const t=new ur(kie);return t.elements=e,t}function OT(e,t,n){const i=new ur(e==="||"||e==="&&"?Aie:$ie);return i.operator=e,i.left=t,i.right=n,i}function tre(e,t){const n=new ur(Eie);return n.callee=e,n.arguments=t,n}function nre(e,t,n){const i=new ur(Cie);return i.test=e,i.consequent=t,i.alternate=n,i}function Ux(e){const t=new ur(ST);return t.name=e,t}function yd(e){const t=new ur(Sie);return t.value=e.value,t.raw=fe.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function RT(e,t,n){const i=new ur(Tie);return i.computed=e==="[",i.object=t,i.property=n,i.computed||(n.member=!0),i}function ire(e){const t=new ur(Mie);return t.properties=e,t}function LT(e,t,n){const i=new ur(Fie);return i.key=t,i.value=n,i.kind=e,i}function rre(e,t){const n=new ur(Die);return n.operator=e,n.argument=t,n.prefix=!0,n}function Je(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,(s,o)=>(F0(o":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11;break}return t}function mre(){var e,t,n,i,r,s,o,a,l,u;if(e=st,l=O0(),i=st,r=PT(i),r===0)return l;for(i.prec=r,ni(),t=[e,st],o=O0(),s=[l,i,o];(r=PT(st))>0;){for(;s.length>2&&r<=s[s.length-2].prec;)o=s.pop(),a=s.pop().value,l=s.pop(),t.pop(),n=OT(a,l,o),s.push(n);i=ni(),i.prec=r,s.push(i),t.push(st),n=O0(),s.push(n)}for(u=s.length-1,n=s[u],t.pop();u>1;)t.pop(),n=OT(s[u-1].value,s[u-2],n),u-=2;return n}function Ya(){var e,t,n;return e=mre(),bt("?")&&(ni(),t=Ya(),kn(":"),n=Ya(),e=nre(e,t,n)),e}function Wx(){const e=Ya();if(bt(","))throw new Error(hd);return e}function Hx(e){fe=e,B=0,wn=fe.length,st=null,NT();const t=Wx();if(st.type!==fd)throw new Error("Unexpect token after expression.");return t}var BT={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function jT(e){function t(o,a,l,u){let c=e(a[0]);return l&&(c=l+"("+c+")",l.lastIndexOf("new ",0)===0&&(c="("+c+")")),c+"."+o+(u<0?"":u===0?"()":"("+a.slice(1).map(e).join(",")+")")}function n(o,a,l){return u=>t(o,u,a,l)}const i="new Date",r="String",s="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",hypot:"Math.hypot",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(o){o.length<3&&U("Missing arguments to clamp function."),o.length>3&&U("Too many arguments to clamp function.");const a=o.map(e);return"Math.max("+a[1]+", Math.min("+a[2]+","+a[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:i,date:n("getDate",i,0),day:n("getDay",i,0),year:n("getFullYear",i,0),month:n("getMonth",i,0),hours:n("getHours",i,0),minutes:n("getMinutes",i,0),seconds:n("getSeconds",i,0),milliseconds:n("getMilliseconds",i,0),time:n("getTime",i,0),timezoneoffset:n("getTimezoneOffset",i,0),utcdate:n("getUTCDate",i,0),utcday:n("getUTCDay",i,0),utcyear:n("getUTCFullYear",i,0),utcmonth:n("getUTCMonth",i,0),utchours:n("getUTCHours",i,0),utcminutes:n("getUTCMinutes",i,0),utcseconds:n("getUTCSeconds",i,0),utcmilliseconds:n("getUTCMilliseconds",i,0),length:n("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:n("toUpperCase",r,0),lower:n("toLowerCase",r,0),substring:n("substring",r),split:n("split",r),trim:n("trim",r,0),regexp:s,test:n("test",s),if:function(o){o.length<3&&U("Missing arguments to if function."),o.length>3&&U("Too many arguments to if function.");const a=o.map(e);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function yre(e){const t=e&&e.length-1;return t&&(e[0]==='"'&&e[t]==='"'||e[0]==="'"&&e[t]==="'")?e.slice(1,-1):e}function UT(e){e=e||{};const t=e.allowed?Ki(e.allowed):{},n=e.forbidden?Ki(e.forbidden):{},i=e.constants||BT,r=(e.functions||jT)(f),s=e.globalvar,o=e.fieldvar,a=Me(s)?s:p=>`${s}["${p}"]`;let l={},u={},c=0;function f(p){if(te(p))return p;const g=d[p.type];return g==null&&U("Unsupported type: "+p.type),g(p)}const d={Literal:p=>p.raw,Identifier:p=>{const g=p.name;return c>0?g:me(n,g)?U("Illegal identifier: "+g):me(i,g)?i[g]:me(t,g)?g:(l[g]=1,a(g))},MemberExpression:p=>{const g=!p.computed,m=f(p.object);g&&(c+=1);const y=f(p.property);return m===o&&(u[yre(y)]=1),g&&(c-=1),m+(g?"."+y:"["+y+"]")},CallExpression:p=>{p.callee.type!=="Identifier"&&U("Illegal callee type: "+p.callee.type);const g=p.callee.name,m=p.arguments,y=me(r,g)&&r[g];return y||U("Unrecognized function: "+g),Me(y)?y(m):y+"("+m.map(f).join(",")+")"},ArrayExpression:p=>"["+p.elements.map(f).join(",")+"]",BinaryExpression:p=>"("+f(p.left)+" "+p.operator+" "+f(p.right)+")",UnaryExpression:p=>"("+p.operator+f(p.argument)+")",ConditionalExpression:p=>"("+f(p.test)+"?"+f(p.consequent)+":"+f(p.alternate)+")",LogicalExpression:p=>"("+f(p.left)+p.operator+f(p.right)+")",ObjectExpression:p=>"{"+p.properties.map(f).join(",")+"}",Property:p=>{c+=1;const g=f(p.key);return c-=1,g+":"+f(p.value)}};function h(p){const g={code:f(p),globals:Object.keys(l),fields:Object.keys(u)};return l={},u={},g}return h.functions=r,h.constants=i,h}const qT=Symbol("vega_selection_getter");function WT(e){return(!e.getter||!e.getter[qT])&&(e.getter=Ti(e.field),e.getter[qT]=!0),e.getter}const Gx="intersect",HT="union",bre="vlMulti",vre="vlPoint",GT="or",xre="and",Jr="_vgsid_",bd=Ti(Jr),_re="E",wre="R",kre="R-E",$re="R-LE",Ere="R-RE",R0="index:unit";function VT(e,t){for(var n=t.fields,i=t.values,r=n.length,s=0,o,a;sFe(t.fields?{values:t.fields.map(i=>WT(i)(n.datum))}:{[Jr]:bd(n.datum)},t))}function Fre(e,t,n,i){for(var r=this.context.data[e],s=r?r.values.value:[],o={},a={},l={},u,c,f,d,h,p,g,m,y,b,v=s.length,x=0,_,k;x(w[c[S].field]=$,w),{})))}else h=Jr,p=bd(u),g=o[h]||(o[h]={}),m=g[d]||(g[d]=[]),m.push(p),n&&(m=a[d]||(a[d]=[]),m.push({[Jr]:p}));if(t=t||HT,o[Jr]?o[Jr]=Vx[`${Jr}_${t}`](...Object.values(o[Jr])):Object.keys(o).forEach(w=>{o[w]=Object.keys(o[w]).map($=>o[w][$]).reduce(($,S)=>$===void 0?S:Vx[`${l[w]}_${t}`]($,S))}),s=Object.keys(a),n&&s.length){const w=i?vre:bre;o[w]=t===HT?{[GT]:s.reduce(($,S)=>($.push(...a[S]),$),[])}:{[xre]:s.map($=>({[GT]:a[$]}))}}return o}var Vx={[`${Jr}_union`]:BU,[`${Jr}_intersect`]:zU,E_union:function(e,t){if(!e.length)return t;for(var n=0,i=t.length;nt.indexOf(n)>=0):t},R_union:function(e,t){var n=hn(t[0]),i=hn(t[1]);return n>i&&(n=t[1],i=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]i&&(n=t[1],i=t[0]),e.length?ii&&(e[1]=i),e):[n,i]}};const Dre=":",Nre="@";function Xx(e,t,n,i){t[0].type!==Ga&&U("First argument to selection functions must be a string literal.");const r=t[0].value,s=t.length>=2&&Ue(t).value,o="unit",a=Nre+o,l=Dre+r;s===Gx&&!me(i,a)&&(i[a]=n.getData(r).indataRef(n,o)),me(i,l)||(i[l]=n.getData(r).tuplesRef())}function YT(e){const t=this.context.data[e];return t?t.values.value:[]}function Ore(e,t,n){const i=this.context.data[e]["index:"+t],r=i?i.value.get(n):void 0;return r&&r.count}function Rre(e,t){const n=this.context.dataflow,i=this.context.data[e],r=i.input;return n.pulse(r,n.changeset().remove(Mi).insert(t)),1}function Lre(e,t,n){if(e){const i=this.context.dataflow,r=e.mark.source;i.pulse(r,i.changeset().encode(e,t))}return n!==void 0?n:e}const vd=e=>function(t,n){return this.context.dataflow.locale()[e](n)(t)},Ire=vd("format"),ZT=vd("timeFormat"),zre=vd("utcFormat"),Pre=vd("timeParse"),Bre=vd("utcParse"),L0=new Date(2e3,0,1);function I0(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)?"":(L0.setYear(2e3),L0.setMonth(e),L0.setDate(t),ZT.call(this,L0,n))}function jre(e){return I0.call(this,e,1,"%B")}function Ure(e){return I0.call(this,e,1,"%b")}function qre(e){return I0.call(this,0,2+e,"%A")}function Wre(e){return I0.call(this,0,2+e,"%a")}const Hre=":",Gre="@",Yx="%",KT="$";function Zx(e,t,n,i){t[0].type!==Ga&&U("First argument to data functions must be a string literal.");const r=t[0].value,s=Hre+r;if(!me(s,i))try{i[s]=n.getData(r).tuplesRef()}catch{}}function Vre(e,t,n,i){t[0].type!==Ga&&U("First argument to indata must be a string literal."),t[1].type!==Ga&&U("Second argument to indata must be a string literal.");const r=t[0].value,s=t[1].value,o=Gre+s;me(o,i)||(i[o]=n.getData(r).indataRef(n,s))}function Bn(e,t,n,i){if(t[0].type===Ga)JT(n,i,t[0].value);else for(e in n.scales)JT(n,i,e)}function JT(e,t,n){const i=Yx+n;if(!me(t,i))try{t[i]=e.scaleRef(n)}catch{}}function Qr(e,t){if(Me(e))return e;if(te(e)){const n=t.scales[e];return n&&uX(n.value)?n.value:void 0}}function Xre(e,t,n){t.__bandwidth=r=>r&&r.bandwidth?r.bandwidth():0,n._bandwidth=Bn,n._range=Bn,n._scale=Bn;const i=r=>"_["+(r.type===Ga?J(Yx+r.value):J(Yx)+"+"+e(r))+"]";return{_bandwidth:r=>`this.__bandwidth(${i(r[0])})`,_range:r=>`${i(r[0])}.range()`,_scale:r=>`${i(r[0])}(${e(r[1])})`}}function Kx(e,t){return function(n,i,r){if(n){const s=Qr(n,(r||this).context);return s&&s.path[e](i)}else return t(i)}}const Yre=Kx("area",bJ),Zre=Kx("bounds",wJ),Kre=Kx("centroid",AJ);function Jre(e,t){const n=Qr(e,(t||this).context);return n&&n.scale()}function Qre(e){const t=this.context.group;let n=!1;if(t)for(;e;){if(e===t){n=!0;break}e=e.mark.group}return n}function Jx(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(i){e.warn(i)}return n[n.length-1]}function ese(){return Jx(this.context.dataflow,"warn",arguments)}function tse(){return Jx(this.context.dataflow,"info",arguments)}function nse(){return Jx(this.context.dataflow,"debug",arguments)}function Qx(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function e7(e){const t=bo(e),n=Qx(t.r),i=Qx(t.g),r=Qx(t.b);return .2126*n+.7152*i+.0722*r}function ise(e,t){const n=e7(e),i=e7(t),r=Math.max(n,i),s=Math.min(n,i);return(r+.05)/(s+.05)}function rse(){const e=[].slice.call(arguments);return e.unshift({}),Fe(...e)}function QT(e,t){return e===t||e!==e&&t!==t?!0:q(e)?q(t)&&e.length===t.length?sse(e,t):!1:re(e)&&re(t)?eM(e,t):!1}function sse(e,t){for(let n=0,i=e.length;neM(e,t)}function ose(e,t,n,i,r,s){const o=this.context.dataflow,a=this.context.data[e],l=a.input,u=o.stamp();let c=a.changes,f,d;if(o._trigger===!1||!(l.value.length||t||i))return 0;if((!c||c.stamp{a.modified=!0,o.pulse(l,c).run()},!0,1)),n&&(f=n===!0?Mi:q(n)||ip(n)?n:tM(n),c.remove(f)),t&&c.insert(t),i&&(f=tM(i),l.value.some(f)?c.remove(f):c.insert(i)),r)for(d in s)c.modify(r,d,s[d]);return 1}function ase(e){const t=e.touches,n=t[0].clientX-t[1].clientX,i=t[0].clientY-t[1].clientY;return Math.hypot(n,i)}function lse(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)}const nM={};function use(e,t){const n=nM[t]||(nM[t]=Ti(t));return q(e)?e.map(n):n(e)}function t7(e){return q(e)||ArrayBuffer.isView(e)?e:null}function n7(e){return t7(e)||(te(e)?e:null)}function cse(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1?t-1:0),i=1;i1?t-1:0),i=1;i1?t-1:0),i=1;is.stop(u(c),e(c))),s}function $se(e,t,n){const i=Qr(e,(n||this).context);return function(r){return i?i.path.context(r)(t):""}}function Ese(e){let t=null;return function(n){return n?vf(n,t=t||bu(e)):e}}const iM=e=>e.data;function rM(e,t){const n=YT.call(t,e);return n.root&&n.root.lookup||{}}function Cse(e,t,n){const i=rM(e,this),r=i[t],s=i[n];return r&&s?r.path(s).map(iM):void 0}function Sse(e,t){const n=rM(e,this)[t];return n?n.ancestors().map(iM):void 0}const sM=()=>typeof window<"u"&&window||null;function Ase(){const e=sM();return e?e.screen:{}}function Tse(){const e=sM();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]}function Mse(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]}function oM(e,t,n){if(!e)return[];const[i,r]=e,s=new Ot().set(i[0],i[1],r[0],r[1]),o=n||this.context.dataflow.scenegraph().root;return pC(o,s,Fse(t))}function Fse(e){let t=null;if(e){const n=ee(e.marktype),i=ee(e.markname);t=r=>(!n.length||n.some(s=>r.marktype===s))&&(!i.length||i.some(s=>r.name===s))}return t}function Dse(e,t,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5;e=ee(e);const r=e[e.length-1];return r===void 0||Math.hypot(r[0]-t,r[1]-n)>i?[...e,[t,n]]:e}function Nse(e){return ee(e).reduce((t,n,i)=>{let[r,s]=n;return t+=i==0?`M ${r},${s} `:i===e.length-1?" Z":`L ${r},${s} `},"")}function Ose(e,t,n){const{x:i,y:r,mark:s}=n,o=new Ot().set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[l,u]of t)lo.x2&&(o.x2=l),uo.y2&&(o.y2=u);return o.translate(i,r),oM([[o.x1,o.y1],[o.x2,o.y2]],e,s).filter(l=>Rse(l.x,l.y,t))}function Rse(e,t,n){let i=0;for(let r=0,s=n.length-1;rt!=a>t&&e<(o-l)*(t-u)/(a-u)+l&&i++}return i&1}const xd={random(){return Ni()},cumulativeNormal:fp,cumulativeLogNormal:uy,cumulativeUniform:hy,densityNormal:ry,densityLogNormal:ly,densityUniform:dy,quantileNormal:dp,quantileLogNormal:cy,quantileUniform:py,sampleNormal:cp,sampleLogNormal:ay,sampleUniform:fy,isArray:q,isBoolean:ro,isDate:so,isDefined(e){return e!==void 0},isNumber:Xe,isObject:re,isRegExp:a4,isString:te,isTuple:ip,isValid(e){return e!=null&&e===e},toBoolean:h2,toDate(e){return p2(e)},toNumber:hn,toString:g2,indexof:fse,join:cse,lastindexof:dse,replace:pse,reverse:gse,slice:hse,flush:s4,lerp:l4,merge:rse,pad:f4,peek:Ue,pluck:use,span:Lc,inrange:Vl,truncate:d4,rgb:bo,lab:Fp,hcl:Dp,hsl:Ap,luminance:e7,contrast:ise,sequence:hi,format:Ire,utcFormat:zre,utcParse:Bre,utcOffset:t8,utcSequence:r8,timeFormat:ZT,timeParse:Pre,timeOffset:e8,timeSequence:i8,timeUnitSpecifier:q4,monthFormat:jre,monthAbbrevFormat:Ure,dayFormat:qre,dayAbbrevFormat:Wre,quarter:t4,utcquarter:n4,week:H4,utcweek:X4,dayofyear:W4,utcdayofyear:V4,warn:ese,info:tse,debug:nse,extent(e){return Or(e)},inScope:Qre,intersect:oM,clampRange:i4,pinchDistance:ase,pinchAngle:lse,screen:Ase,containerSize:Mse,windowSize:Tse,bandspace:mse,setdata:Rre,pathShape:Ese,panLinear:K6,panLog:J6,panPow:Q6,panSymlog:e4,zoomLinear:a2,zoomLog:l2,zoomPow:Rh,zoomSymlog:u2,encode:Lre,modify:ose,lassoAppend:Dse,lassoPath:Nse,intersectLasso:Ose},Lse=["view","item","group","xy","x","y"],Ise="event.vega.",aM="this.",i7={},lM={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${J(KT+e)}]`,functions:zse,constants:BT,visitors:i7},r7=UT(lM);function zse(e){const t=jT(e);Lse.forEach(n=>t[n]=Ise+n);for(const n in xd)t[n]=aM+n;return Fe(t,Xre(e,xd,i7)),t}function Ft(e,t,n){return arguments.length===1?xd[e]:(xd[e]=t,n&&(i7[e]=n),r7&&(r7.functions[e]=aM+e),this)}Ft("bandwidth",yse,Bn),Ft("copy",bse,Bn),Ft("domain",vse,Bn),Ft("range",_se,Bn),Ft("invert",xse,Bn),Ft("scale",wse,Bn),Ft("gradient",kse,Bn),Ft("geoArea",Yre,Bn),Ft("geoBounds",Zre,Bn),Ft("geoCentroid",Kre,Bn),Ft("geoShape",$se,Bn),Ft("geoScale",Jre,Bn),Ft("indata",Ore,Vre),Ft("data",YT,Zx),Ft("treePath",Cse,Zx),Ft("treeAncestors",Sse,Zx),Ft("vlSelectionTest",Cre,Xx),Ft("vlSelectionIdTest",Tre,Xx),Ft("vlSelectionResolve",Fre,Xx),Ft("vlSelectionTuples",Mre);function es(e,t){const n={};let i;try{e=te(e)?e:J(e)+"",i=Hx(e)}catch{U("Expression parse error: "+e)}i.visit(s=>{if(s.type!==CT)return;const o=s.callee.name,a=lM.visitors[o];a&&a(o,s.arguments,t,n)});const r=r7(i);return r.globals.forEach(s=>{const o=KT+s;!me(n,o)&&t.getSignal(s)&&(n[o]=t.signalRef(s))}),{$expr:Fe({code:r.code},t.options.ast?{ast:i}:null),$fields:r.fields,$params:n}}function Pse(e){const t=this,n=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),e.locale&&(t.locale=e.locale),n.forEach(i=>t.parseOperator(i)),n.forEach(i=>t.parseOperatorParameters(i)),(e.streams||[]).forEach(i=>t.parseStream(i)),(e.updates||[]).forEach(i=>t.parseUpdate(i)),t.resolve()}const Bse=Ki(["rule"]),uM=Ki(["group","image","rect"]);function jse(e,t){let n="";return Bse[t]||(e.x2&&(e.x?(uM[t]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),e.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),e.y2&&(e.y?(uM[t]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),e.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}function s7(e){return(e+"").toLowerCase()}function Use(e){return s7(e)==="operator"}function qse(e){return s7(e)==="collect"}function _d(e,t,n){n.endsWith(";")||(n="return("+n+");");const i=Function(...t.concat(n));return e&&e.functions?i.bind(e.functions):i}function Wse(e,t,n,i){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n} : (u > v || v == null) && u != null ? ${i} : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n} - : v !== v && u === u ? ${i} : `}var Wse={operator:(e,t)=>_d(e,["_"],t.code),parameter:(e,t)=>_d(e,["datum","_"],t.code),event:(e,t)=>_d(e,["event"],t.code),handler:(e,t)=>{const n=`var datum=event.item&&event.item.datum;return ${t.code};`;return _d(e,["_","event"],n)},encode:(e,t)=>{const{marktype:n,channels:i}=t;let r="var o=item,datum=o.datum,m=0,$;";for(const s in i){const o="o["+J(s)+"]";r+=`$=${i[s].code};if(${o}!==$)${o}=$,m=1;`}return r+=Bse(i,n),r+="return m;",_d(e,["item","_"],r)},codegen:{get(e){const t=`[${e.map(J).join("][")}]`,n=Function("_",`return _${t};`);return n.path=t,n},comparator(e,t){let n;const i=(s,o)=>{const a=t[o];let l,u;return s.path?(l=`a${s.path}`,u=`b${s.path}`):((n=n||{})["f"+o]=s,l=`this.f${o}(a)`,u=`this.f${o}(b)`),qse(l,u,-a,a)},r=Function("a","b","var u, v; return "+e.map(i).join("")+"0;");return n?r.bind(n):r}}};function Hse(e){const t=this;jse(e.type)||!e.type?t.operator(e,e.update?t.operatorExpression(e.update):null):t.transform(e,e.type)}function Gse(e){const t=this;if(e.params){const n=t.get(e.id);n||U("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}}function Vse(e,t){t=t||{};const n=this;for(const i in e){const r=e[i];t[i]=q(r)?r.map(s=>cM(s,n,t)):cM(r,n,t)}return t}function cM(e,t,n){if(!e||!ie(e))return e;for(let i=0,r=fM.length,s;ir&&r.$tupleid?ge:r);return t.fn[n]||(t.fn[n]=c2(i,e.$order,t.expr.codegen))}function Qse(e,t){const n=e.$encode,i={};for(const r in n){const s=n[r];i[r]=Xn(t.encodeExpression(s.$expr),s.$fields),i[r].output=s.$output}return i}function eoe(e,t){return t}function toe(e,t){const n=e.$subflow;return function(i,r,s){const o=t.fork().parse(n),a=o.get(n.operators[0].id),l=o.signals.parent;return l&&l.set(s),a.detachSubflow=()=>t.detach(o),a}}function noe(){return ge}function ioe(e){var t=this,n=e.filter!=null?t.eventExpression(e.filter):void 0,i=e.stream!=null?t.get(e.stream):void 0,r;e.source?i=t.events(e.source,e.type,n):e.merge&&(r=e.merge.map(s=>t.get(s)),i=r[0].merge.apply(r[0],r.slice(1))),e.between&&(r=e.between.map(s=>t.get(s)),i=i.between(r[0],r[1])),e.filter&&(i=i.filter(n)),e.throttle!=null&&(i=i.throttle(+e.throttle)),e.debounce!=null&&(i=i.debounce(+e.debounce)),i==null&&U("Invalid stream definition: "+JSON.stringify(e)),e.consume&&i.consume(!0),t.stream(e,i)}function roe(e){var t=this,n=ie(n=e.source)?n.$ref:n,i=t.get(n),r=null,s=e.update,o=void 0;i||U("Source not defined: "+e.source),r=e.target&&e.target.$expr?t.eventExpression(e.target.$expr):t.get(e.target),s&&s.$expr&&(s.$params&&(o=t.parseParameters(s.$params)),s=t.handlerExpression(s.$expr)),t.update(e,i,r,s,o)}const soe={skip:!0};function ooe(e){var t=this,n={};if(e.signals){var i=n.signals={};Object.keys(t.signals).forEach(s=>{const o=t.signals[s];e.signals(s,o)&&(i[s]=o.value)})}if(e.data){var r=n.data={};Object.keys(t.data).forEach(s=>{const o=t.data[s];e.data(s,o)&&(r[s]=o.input.value)})}return t.subcontext&&e.recurse!==!1&&(n.subcontext=t.subcontext.map(s=>s.getState(e))),n}function aoe(e){var t=this,n=t.dataflow,i=e.data,r=e.signals;Object.keys(r||{}).forEach(s=>{n.update(t.signals[s],r[s],soe)}),Object.keys(i||{}).forEach(s=>{n.pulse(t.data[s].input,n.changeset().remove(Ti).insert(i[s]))}),(e.subcontext||[]).forEach((s,o)=>{const a=t.subcontext[o];a&&a.setState(s)})}function dM(e,t,n,i){return new hM(e,t,n,i)}function hM(e,t,n,i){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=i||Wse,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function pM(e){this.dataflow=e.dataflow,this.transforms=e.transforms,this.events=e.events,this.expr=e.expr,this.signals=Object.create(e.signals),this.scales=Object.create(e.scales),this.nodes=Object.create(e.nodes),this.data=Object.create(e.data),this.fn=Object.create(e.fn),e.functions&&(this.functions=Object.create(e.functions),this.functions.context=this)}hM.prototype=pM.prototype={fork(){const e=new pM(this);return(this.subcontext||(this.subcontext=[])).push(e),e},detach(e){this.subcontext=this.subcontext.filter(n=>n!==e);const t=Object.keys(e.nodes);for(const n of t)e.nodes[n]._targets=null;for(const n of t)e.nodes[n].detach();e.nodes=null},get(e){return this.nodes[e]},set(e,t){return this.nodes[e]=t},add(e,t){const n=this,i=n.dataflow,r=e.value;if(n.set(e.id,t),Use(e.type)&&r&&(r.$ingest?i.ingest(t,r.$ingest,r.$format):r.$request?i.preload(t,r.$request,r.$format):i.pulse(t,i.changeset().insert(r))),e.root&&(n.root=t),e.parent){let s=n.get(e.parent.$ref);s?(i.connect(s,[t]),t.targets().add(s)):(n.unresolved=n.unresolved||[]).push(()=>{s=n.get(e.parent.$ref),i.connect(s,[t]),t.targets().add(s)})}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(const s in e.data){const o=n.data[s]||(n.data[s]={});e.data[s].forEach(a=>o[a]=t)}},resolve(){return(this.unresolved||[]).forEach(e=>e()),delete this.unresolved,this},operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform(e,t){this.add(e,this.dataflow.add(this.transforms[s7(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,i,r){this.dataflow.on(t,n,i,r,e.options)},operatorExpression(e){return this.expr.operator(this,e)},parameterExpression(e){return this.expr.parameter(this,e)},eventExpression(e){return this.expr.event(this,e)},handlerExpression(e){return this.expr.handler(this,e)},encodeExpression(e){return this.expr.encode(this,e)},parse:zse,parseOperator:Hse,parseOperatorParameters:Gse,parseParameters:Vse,parseStream:ioe,parseUpdate:roe,getState:ooe,setState:aoe};function loe(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),gM(t,e.description()))}function gM(e,t){e&&(t==null?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}function uoe(e){e.add(null,t=>(e._background=t.bg,e._resize=1,t.bg),{bg:e._signals.background})}const o7="default";function coe(e){const t=e._signals.cursor||(e._signals.cursor=e.add({user:o7,item:null}));e.on(e.events("view","mousemove"),t,(n,i)=>{const r=t.value,s=r?te(r)?r:r.user:o7,o=i.item&&i.item.cursor||null;return r&&s===r.user&&o==r.item?r:{user:s,item:o}}),e.add(null,function(n){let i=n.cursor,r=this.value;return te(i)||(r=i.item,i=i.user),a7(e,i&&i!==o7?i:r||i),r},{cursor:t})}function a7(e,t){const n=e.globalCursor()?typeof document<"u"&&document.body:e.container();if(n)return t==null?n.style.removeProperty("cursor"):n.style.cursor=t}function z0(e,t){var n=e._runtime.data;return pe(n,t)||U("Unrecognized data set: "+t),n[t]}function foe(e,t){return arguments.length<2?z0(this,e).values.value:P0.call(this,e,_a().remove(Ti).insert(t))}function P0(e,t){G8(t)||U("Second argument to changes must be a changeset.");const n=z0(this,e);return n.modified=!0,this.pulse(n.input,t)}function doe(e,t){return P0.call(this,e,_a().insert(t))}function hoe(e,t){return P0.call(this,e,_a().remove(t))}function mM(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function yM(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function B0(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function poe(e){var t=B0(e),n=mM(e),i=yM(e);e._renderer.background(e.background()),e._renderer.resize(n,i,t),e._handler.origin(t),e._resizeListeners.forEach(r=>{try{r(n,i)}catch(s){e.error(s)}})}function goe(e,t,n){var i=e._renderer,r=i&&i.canvas(),s,o,a;return r&&(a=B0(e),o=t.changedTouches?t.changedTouches[0]:t,s=fg(o,r),s[0]-=a[0],s[1]-=a[1]),t.dataflow=e,t.item=n,t.vega=moe(e,n,s),t}function moe(e,t,n){const i=t?t.mark.marktype==="group"?t:t.mark.group:null;function r(o){var a=i,l;if(o){for(l=t;l;l=l.mark.group)if(l.mark.name===o){a=l;break}}return a&&a.mark&&a.mark.interactive?a:{}}function s(o){if(!o)return n;te(o)&&(o=r(o));const a=n.slice();for(;o;)a[0]-=o.x||0,a[1]-=o.y||0,o=o.mark&&o.mark.group;return a}return{view:pn(e),item:pn(t||{}),group:r,xy:s,x:o=>s(o)[0],y:o=>s(o)[1]}}const bM="view",yoe="timer",boe="window",voe={trap:!1};function xoe(e){const t=Fe({defaults:{}},e),n=(i,r)=>{r.forEach(s=>{q(i[s])&&(i[s]=Ki(i[s]))})};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector"]),t}function vM(e,t,n,i){e._eventListeners.push({type:n,sources:ee(t),handler:i})}function _oe(e,t){var n=e._eventConfig.defaults,i=n.prevent,r=n.allow;return i===!1||r===!0?!1:i===!0||r===!1?!0:i?i[t]:r?!r[t]:e.preventDefault()}function j0(e,t,n){const i=e._eventConfig&&e._eventConfig[t];return i===!1||ie(i)&&!i[n]?(e.warn(`Blocked ${t} ${n} event listener.`),!1):!0}function woe(e,t,n){var i=this,r=new ap(n),s=function(u,c){i.runAsync(null,()=>{e===bM&&_oe(i,t)&&u.preventDefault(),r.receive(goe(i,u,c))})},o;if(e===yoe)j0(i,"timer",t)&&i.timer(s,t);else if(e===bM)j0(i,"view",t)&&i.addEventListener(t,s,voe);else if(e===boe?j0(i,"window",t)&&typeof window<"u"&&(o=[window]):typeof document<"u"&&j0(i,"selector",t)&&(o=Array.from(document.querySelectorAll(e))),!o)i.warn("Can not resolve event source: "+e);else{for(var a=0,l=o.length;a=0;)t[i].stop();for(i=n.length;--i>=0;)for(s=n[i],r=s.sources.length;--r>=0;)s.sources[r].removeEventListener(s.type,s.handler);return e&&e.call(this,this._handler,null,null,null),this}function _i(e,t,n){const i=document.createElement(e);for(const r in t)i.setAttribute(r,t[r]);return n!=null&&(i.textContent=n),i}const Eoe="vega-bind",Coe="vega-bind-name",Soe="vega-bind-radio";function Aoe(e,t,n){if(!t)return;const i=n.param;let r=n.state;return r||(r=n.state={elements:null,active:!1,set:null,update:o=>{o!=e.signal(i.signal)&&e.runAsync(null,()=>{r.source=!0,e.signal(i.signal,o)})}},i.debounce&&(r.update=f2(i.debounce,r.update))),(i.input==null&&i.element?Toe:Foe)(r,t,i,e),r.active||(e.on(e._signals[i.signal],null,()=>{r.source?r.source=!1:r.set(e.signal(i.signal))}),r.active=!0),r}function Toe(e,t,n,i){const r=n.event||"input",s=()=>e.update(t.value);i.signal(n.signal,t.value),t.addEventListener(r,s),vM(i,t,r,s),e.set=o=>{t.value=o,t.dispatchEvent(Moe(r))}}function Moe(e){return typeof Event<"u"?new Event(e):{type:e}}function Foe(e,t,n,i){const r=i.signal(n.signal),s=_i("div",{class:Eoe}),o=n.input==="radio"?s:s.appendChild(_i("label"));o.appendChild(_i("span",{class:Coe},n.name||n.signal)),t.appendChild(s);let a=Doe;switch(n.input){case"checkbox":a=Noe;break;case"select":a=Ooe;break;case"radio":a=Roe;break;case"range":a=Loe;break}a(e,o,n,r)}function Doe(e,t,n,i){const r=_i("input");for(const s in n)s!=="signal"&&s!=="element"&&r.setAttribute(s==="input"?"type":s,n[s]);r.setAttribute("name",n.signal),r.value=i,t.appendChild(r),r.addEventListener("input",()=>e.update(r.value)),e.elements=[r],e.set=s=>r.value=s}function Noe(e,t,n,i){const r={type:"checkbox",name:n.signal};i&&(r.checked=!0);const s=_i("input",r);t.appendChild(s),s.addEventListener("change",()=>e.update(s.checked)),e.elements=[s],e.set=o=>s.checked=!!o||null}function Ooe(e,t,n,i){const r=_i("select",{name:n.signal}),s=n.labels||[];n.options.forEach((o,a)=>{const l={value:o};U0(o,i)&&(l.selected=!0),r.appendChild(_i("option",l,(s[a]||o)+""))}),t.appendChild(r),r.addEventListener("change",()=>{e.update(n.options[r.selectedIndex])}),e.elements=[r],e.set=o=>{for(let a=0,l=n.options.length;a{const l={type:"radio",name:n.signal,value:o};U0(o,i)&&(l.checked=!0);const u=_i("input",l);u.addEventListener("change",()=>e.update(o));const c=_i("label",{},(s[a]||o)+"");return c.prepend(u),r.appendChild(c),u}),e.set=o=>{const a=e.elements,l=a.length;for(let u=0;u{l.textContent=a.value,e.update(+a.value)};a.addEventListener("input",u),a.addEventListener("change",u),e.elements=[a],e.set=c=>{a.value=c,l.textContent=c}}function U0(e,t){return e===t||e+""==t+""}function kM(e,t,n,i,r,s){return t=t||new i(e.loader()),t.initialize(n,mM(e),yM(e),B0(e),r,s).background(e.background())}function l7(e,t){return t?function(){try{t.apply(this,arguments)}catch(n){e.error(n)}}:null}function Ioe(e,t,n,i){const r=new i(e.loader(),l7(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,B0(e),e);return t&&t.handlers().forEach(s=>{r.on(s.type,s.handler)}),r}function zoe(e,t){const n=this,i=n._renderType,r=n._eventConfig.bind,s=kg(i);e=n._el=e?u7(n,e,!0):null,loe(n),s||n.error("Unrecognized renderer type: "+i);const o=s.handler||To,a=e?s.renderer:s.headless;return n._renderer=a?kM(n,n._renderer,e,a):null,n._handler=Ioe(n,n._handler,e,o),n._redraw=!0,e&&r!=="none"&&(t=t?n._elBind=u7(n,t,!0):e.appendChild(_i("form",{class:"vega-bindings"})),n._bind.forEach(l=>{l.param.element&&r!=="container"&&(l.element=u7(n,l.param.element,!!l.param.input))}),n._bind.forEach(l=>{Aoe(n,l.element||t,l)})),n}function u7(e,t,n){if(typeof t=="string")if(typeof document<"u"){if(t=document.querySelector(t),!t)return e.error("Signal bind element not found: "+t),null}else return e.error("DOM document instance not found."),null;if(t&&n)try{t.textContent=""}catch(i){t=null,e.error(i)}return t}const wd=e=>+e||0,Poe=e=>({top:e,bottom:e,left:e,right:e});function $M(e){return ie(e)?{top:wd(e.top),bottom:wd(e.bottom),left:wd(e.left),right:wd(e.right)}:Poe(wd(e))}async function c7(e,t,n,i){const r=kg(t),s=r&&r.headless;return s||U("Unrecognized renderer type: "+t),await e.runAsync(),kM(e,null,null,s,n,i).renderAsync(e._scenegraph.root)}async function Boe(e,t){e!==Fo.Canvas&&e!==Fo.SVG&&e!==Fo.PNG&&U("Unrecognized image type: "+e);const n=await c7(this,e,t);return e===Fo.SVG?joe(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")}function joe(e,t){const n=new Blob([e],{type:t});return window.URL.createObjectURL(n)}async function Uoe(e,t){return(await c7(this,Fo.Canvas,e,t)).canvas()}async function qoe(e){return(await c7(this,Fo.SVG,e)).svg()}function Woe(e,t,n){return dM(e,au,xd,n).parse(t)}function Hoe(e){var t=this._runtime.scales;return pe(t,e)||U("Unrecognized scale or projection: "+e),t[e].value}var EM="width",CM="height",f7="padding",SM={skip:!0};function AM(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===f7?i.left+i.right:0)}function TM(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===f7?i.top+i.bottom:0)}function Goe(e){var t=e._signals,n=t[EM],i=t[CM],r=t[f7];function s(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,a=>{e._width=a.size,e._viewWidth=AM(e,a.size),s()},{size:n}),e._resizeHeight=e.add(null,a=>{e._height=a.size,e._viewHeight=TM(e,a.size),s()},{size:i});const o=e.add(null,s,{pad:r});e._resizeWidth.rank=n.rank+1,e._resizeHeight.rank=i.rank+1,o.rank=r.rank+1}function Voe(e,t,n,i,r,s){this.runAfter(o=>{let a=0;o._autosize=0,o.width()!==n&&(a=1,o.signal(EM,n,SM),o._resizeWidth.skip(!0)),o.height()!==i&&(a=1,o.signal(CM,i,SM),o._resizeHeight.skip(!0)),o._viewWidth!==e&&(o._resize=1,o._viewWidth=e),o._viewHeight!==t&&(o._resize=1,o._viewHeight=t),(o._origin[0]!==r[0]||o._origin[1]!==r[1])&&(o._resize=1,o._origin=r),a&&o.run("enter"),s&&o.runAfter(l=>l.resize())},!1,1)}function Xoe(e){return this._runtime.getState(e||{data:Yoe,signals:Zoe,recurse:!0})}function Yoe(e,t){return t.modified&&q(t.input.value)&&e.indexOf("_:vega:_")}function Zoe(e,t){return!(e==="parent"||t instanceof au.proxy)}function Koe(e){return this.runAsync(null,t=>{t._trigger=!1,t._runtime.setState(e)},t=>{t._trigger=!0}),this}function Joe(e,t){function n(i){e({timestamp:Date.now(),elapsed:i})}this._timers.push(Tee(n,t))}function Qoe(e,t,n,i){const r=e.element();r&&r.setAttribute("title",eae(i))}function eae(e){return e==null?"":q(e)?MM(e):ie(e)&&!so(e)?tae(e):e+""}function tae(e){return Object.keys(e).map(t=>{const n=e[t];return t+": "+(q(n)?MM(n):FM(n))}).join(` -`)}function MM(e){return"["+e.map(FM).join(", ")+"]"}function FM(e){return q(e)?"[…]":ie(e)&&!so(e)?"{…}":e}function DM(e,t){const n=this;if(t=t||{},ou.call(n),t.loader&&n.loader(t.loader),t.logger&&n.logger(t.logger),t.logLevel!=null&&n.logLevel(t.logLevel),t.locale||e.locale){const s=Fe({},e.locale,t.locale);n.locale(O8(s.number,s.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||Fo.Canvas,n._scenegraph=new b3;const i=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||Qoe,n._redraw=!0,n._handler=new To().scene(i),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=xoe(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const r=Woe(n,e,t.expr);n._runtime=r,n._signals=r.signals,n._bind=(e.bindings||[]).map(s=>({state:null,param:Fe({},s)})),r.root&&r.root.set(i),i.source=r.data.root.input,n.pulse(r.data.root.input,n.changeset().insert(i.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=AM(n,n._width),n._viewHeight=TM(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,Goe(n),uoe(n),coe(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind)}function q0(e,t){return pe(e._signals,t)?e._signals[t]:U("Unrecognized signal name: "+J(t))}function NM(e,t){const n=(e._targets||[]).filter(i=>i._update&&i._update.handler===t);return n.length?n[0]:null}function OM(e,t,n,i){let r=NM(n,i);return r||(r=l7(e,()=>i(t,n.value)),r.handler=i,e.on(n,null,r)),e}function RM(e,t,n){const i=NM(t,n);return i&&t._targets.remove(i),e}K(DM,ou,{async evaluate(e,t,n){if(await ou.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,poe(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(i){this.error(i)}return n&&np(this,n),this},dirty(e){this._redraw=!0,this._renderer&&this._renderer.dirty(e)},description(e){if(arguments.length){const t=e!=null?e+"":null;return t!==this._desc&&gM(this._el,this._desc=t),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(e,t,n){const i=q0(this,e);return arguments.length===1?i.value:this.update(i,t,n)},width(e){return arguments.length?this.signal("width",e):this.signal("width")},height(e){return arguments.length?this.signal("height",e):this.signal("height")},padding(e){return arguments.length?this.signal("padding",$M(e)):$M(this.signal("padding"))},autosize(e){return arguments.length?this.signal("autosize",e):this.signal("autosize")},background(e){return arguments.length?this.signal("background",e):this.signal("background")},renderer(e){return arguments.length?(kg(e)||U("Unrecognized renderer type: "+e),e!==this._renderType&&(this._renderType=e,this._resetRenderer()),this):this._renderType},tooltip(e){return arguments.length?(e!==this._tooltip&&(this._tooltip=e,this._resetRenderer()),this):this._tooltip},loader(e){return arguments.length?(e!==this._loader&&(ou.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(q0(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:Voe,addEventListener(e,t,n){let i=t;return n&&n.trap===!1||(i=l7(this,t),i.raw=t),this._handler.on(e,i),this},removeEventListener(e,t){for(var n=this._handler.handlers(e),i=n.length,r,s;--i>=0;)if(s=n[i].type,r=n[i].handler,e===s&&(t===r||t===r.raw)){this._handler.off(s,r);break}return this},addResizeListener(e){const t=this._resizeListeners;return t.indexOf(e)<0&&t.push(e),this},removeResizeListener(e){var t=this._resizeListeners,n=t.indexOf(e);return n>=0&&t.splice(n,1),this},addSignalListener(e,t){return OM(this,e,q0(this,e),t)},removeSignalListener(e,t){return RM(this,q0(this,e),t)},addDataListener(e,t){return OM(this,e,z0(this,e).values,t)},removeDataListener(e,t){return RM(this,z0(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=a7(this,null);this._globalCursor=!!e,t&&a7(this,t)}return this}else return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:Joe,events:woe,finalize:$oe,hover:koe,data:foe,change:P0,insert:doe,remove:hoe,scale:Hoe,initialize:zoe,toImageURL:Boe,toCanvas:Uoe,toSVG:qoe,getState:Xoe,setState:Koe});const nae="view",W0="[",H0="]",LM="{",IM="}",iae=":",zM=",",rae="@",sae=">",oae=/[[\]{}]/,aae={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let PM,BM;function jo(e,t,n){return PM=t||nae,BM=n||aae,jM(e.trim()).map(d7)}function lae(e){return BM[e]}function kd(e,t,n,i,r){const s=e.length;let o=0,a;for(;t=0?--o:i&&i.indexOf(a)>=0&&++o}return t}function jM(e){const t=[],n=e.length;let i=0,r=0;for(;r' after between selector: "+e;i=i.map(d7);const r=d7(e.slice(1).trim());return r.between?{between:i,stream:r}:(r.between=i,r)}function cae(e){const t={source:PM},n=[];let i=[0,0],r=0,s=0,o=e.length,a=0,l,u;if(e[o-1]===IM){if(a=e.lastIndexOf(LM),a>=0){try{i=fae(e.substring(a+1,o-1))}catch{throw"Invalid throttle specification: "+e}e=e.slice(0,a).trim(),o=e.length}else throw"Unmatched right brace: "+e;a=0}if(!o)throw e;if(e[0]===rae&&(r=++a),l=kd(e,a,iae),l1?(t.type=n[1],r?t.markname=n[0].slice(1):lae(n[0])?t.marktype=n[0]:t.source=n[0]):t.type=n[0],t.type.slice(-1)==="!"&&(t.consume=!0,t.type=t.type.slice(0,-1)),u!=null&&(t.filter=u),i[0]&&(t.throttle=i[0]),i[1]&&(t.debounce=i[1]),t}function fae(e){const t=e.split(zM);if(!e.length||t.length>2)throw e;return t.map(n=>{const i=+n;if(i!==i)throw e;return i})}function dae(e){return ie(e)?e:{type:e||"pad"}}const $d=e=>+e||0,hae=e=>({top:e,bottom:e,left:e,right:e});function pae(e){return ie(e)?e.signal?e:{top:$d(e.top),bottom:$d(e.bottom),left:$d(e.left),right:$d(e.right)}:hae($d(e))}const Xt=e=>ie(e)&&!q(e)?Fe({},e):{value:e};function UM(e,t,n,i){return n!=null?(ie(n)&&!q(n)||q(n)&&n.length&&ie(n[0])?e.update[t]=n:e[i||"enter"][t]={value:n},1):0}function an(e,t,n){for(const i in t)UM(e,i,t[i]);for(const i in n)UM(e,i,n[i],"update")}function Bu(e,t,n){for(const i in t)n&&pe(n,i)||(e[i]=Fe(e[i]||{},t[i]));return e}function ju(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const h7="mark",p7="frame",g7="scope",gae="axis",mae="axis-domain",yae="axis-grid",bae="axis-label",vae="axis-tick",xae="axis-title",_ae="legend",wae="legend-band",kae="legend-entry",$ae="legend-gradient",qM="legend-label",Eae="legend-symbol",Cae="legend-title",Sae="title",Aae="title-text",Tae="title-subtitle";function Mae(e,t,n,i,r){const s={},o={};let a,l,u,c;l="lineBreak",t==="text"&&r[l]!=null&&!ju(l,e)&&m7(s,l,r[l]),(n=="legend"||String(n).startsWith("axis"))&&(n=null),c=n===p7?r.group:n===h7?Fe({},r.mark,r[t]):null;for(l in c)u=ju(l,e)||(l==="fill"||l==="stroke")&&(ju("fill",e)||ju("stroke",e)),u||m7(s,l,c[l]);ee(i).forEach(f=>{const d=r.style&&r.style[f];for(const h in d)ju(h,e)||m7(s,h,d[h])}),e=Fe({},e);for(l in s)c=s[l],c.signal?(a=a||{})[l]=c:o[l]=c;return e.enter=Fe(o,e.enter),a&&(e.update=Fe(a,e.update)),e}function m7(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const WM=e=>te(e)?J(e):e.signal?`(${e.signal})`:HM(e);function G0(e){if(e.gradient!=null)return Dae(e);let t=e.signal?`(${e.signal})`:e.color?Fae(e.color):e.field!=null?HM(e.field):e.value!==void 0?J(e.value):void 0;return e.scale!=null&&(t=Nae(e,t)),t===void 0&&(t=null),e.exponent!=null&&(t=`pow(${t},${X0(e.exponent)})`),e.mult!=null&&(t+=`*${X0(e.mult)}`),e.offset!=null&&(t+=`+${X0(e.offset)}`),e.round&&(t=`round(${t})`),t}const V0=(e,t,n,i)=>`(${e}(${[t,n,i].map(G0).join(",")})+'')`;function Fae(e){return e.c?V0("hcl",e.h,e.c,e.l):e.h||e.s?V0("hsl",e.h,e.s,e.l):e.l||e.a?V0("lab",e.l,e.a,e.b):e.r||e.g||e.b?V0("rgb",e.r,e.g,e.b):null}function Dae(e){const t=[e.start,e.stop,e.count].map(n=>n==null?null:J(n));for(;t.length&&Ue(t)==null;)t.pop();return t.unshift(WM(e.gradient)),`gradient(${t.join(",")})`}function X0(e){return ie(e)?"("+G0(e)+")":e}function HM(e){return GM(ie(e)?e:{datum:e})}function GM(e){let t,n,i;if(e.signal)t="datum",i=e.signal;else if(e.group||e.parent){for(n=Math.max(1,e.level||1),t="item";n-- >0;)t+=".mark.group";e.parent?(i=e.parent,t+=".datum"):i=e.group}else e.datum?(t="datum",i=e.datum):U("Invalid field reference: "+J(e));return e.signal||(i=te(i)?Nr(i).map(J).join("]["):GM(i)),t+"["+i+"]"}function Nae(e,t){const n=WM(e.scale);return e.range!=null?t=`lerp(_range(${n}), ${+e.range})`:(t!==void 0&&(t=`_scale(${n}, ${t})`),e.band&&(t=(t?t+"+":"")+`_bandwidth(${n})`+(+e.band==1?"":"*"+X0(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),t==null&&(t="0")),t}function Oae(e){let t="";return e.forEach(n=>{const i=G0(n);t+=n.test?`(${n.test})?${i}:`:i}),Ue(t)===":"&&(t+="null"),t}function VM(e,t,n,i,r,s){const o={};s=s||{},s.encoders={$encode:o},e=Mae(e,t,n,i,r.config);for(const a in e)o[a]=Rae(e[a],t,s,r);return s}function Rae(e,t,n,i){const r={},s={};for(const o in e)e[o]!=null&&(r[o]=Iae(Lae(e[o]),i,n,s));return{$expr:{marktype:t,channels:r},$fields:Object.keys(s),$output:Object.keys(e)}}function Lae(e){return q(e)?Oae(e):G0(e)}function Iae(e,t,n,i){const r=es(e,t);return r.$fields.forEach(s=>i[s]=1),Fe(n,r.$params),r.$expr}const zae="outer",Pae=["value","update","init","react","bind"];function XM(e,t){U(e+' for "outer" push: '+J(t))}function YM(e,t){const n=e.name;if(e.push===zae)t.signals[n]||XM("No prior signal definition",n),Pae.forEach(i=>{e[i]!==void 0&&XM("Invalid property ",i)});else{const i=t.addSignal(n,e.value);e.react===!1&&(i.react=!1),e.bind&&t.addBinding(n,e.bind)}}function y7(e,t,n,i){this.id=-1,this.type=e,this.value=t,this.params=n,i&&(this.parent=i)}function Y0(e,t,n,i){return new y7(e,t,n,i)}function Z0(e,t){return Y0("operator",e,t)}function ye(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function Ed(e,t){return t?{$field:e,$name:t}:{$field:e}}const b7=Ed("key");function ZM(e,t){return{$compare:e,$order:t}}function Bae(e,t){const n={$key:e};return t&&(n.$flat=!0),n}const jae="ascending",Uae="descending";function qae(e){return ie(e)?(e.order===Uae?"-":"+")+K0(e.op,e.field):""}function K0(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const v7="scope",x7="view";function jt(e){return e&&e.signal}function Wae(e){return e&&e.expr}function J0(e){if(jt(e))return!0;if(ie(e)){for(const t in e)if(J0(e[t]))return!0}return!1}function cr(e,t){return e??t}function Za(e){return e&&e.signal||e}const KM="timer";function Cd(e,t){return(e.merge?Gae:e.stream?Vae:e.type?Xae:U("Invalid stream specification: "+J(e)))(e,t)}function Hae(e){return e===v7?x7:e||x7}function Gae(e,t){const n=e.merge.map(r=>Cd(r,t)),i=_7({merge:n},e,t);return t.addStream(i).id}function Vae(e,t){const n=Cd(e.stream,t),i=_7({stream:n},e,t);return t.addStream(i).id}function Xae(e,t){let n;e.type===KM?(n=t.event(KM,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(Hae(e.source),e.type);const i=_7({stream:n},e,t);return Object.keys(i).length===1?n:t.addStream(i).id}function _7(e,t,n){let i=t.between;return i&&(i.length!==2&&U('Stream "between" parameter must have 2 entries: '+J(t)),e.between=[Cd(i[0],n),Cd(i[1],n)]),i=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&i.push(Yae(t.marktype,t.markname,t.markrole)),t.source===v7&&i.push("inScope(event.item)"),i.length&&(e.filter=es("("+i.join(")&&(")+")",n).$expr),(i=t.throttle)!=null&&(e.throttle=+i),(i=t.debounce)!=null&&(e.debounce=+i),t.consume&&(e.consume=!0),e}function Yae(e,t,n){const i="event.item";return i+(e&&e!=="*"?"&&"+i+".mark.marktype==='"+e+"'":"")+(n?"&&"+i+".mark.role==='"+n+"'":"")+(t?"&&"+i+".mark.name==='"+t+"'":"")}const Zae={code:"_.$value",ast:{type:"Identifier",value:"value"}};function Kae(e,t,n){const i=e.encode,r={target:n};let s=e.events,o=e.update,a=[];s||U("Signal update missing events specification."),te(s)&&(s=jo(s,t.isSubscope()?v7:x7)),s=ee(s).filter(l=>l.signal||l.scale?(a.push(l),0):1),a.length>1&&(a=[Qae(a)]),s.length&&a.push(s.length>1?{merge:s}:s[0]),i!=null&&(o&&U("Signal encode and update are mutually exclusive."),o="encode(item(),"+J(i)+")"),r.update=te(o)?es(o,t):o.expr!=null?es(o.expr,t):o.value!=null?o.value:o.signal!=null?{$expr:Zae,$params:{$value:t.signalRef(o.signal)}}:U("Invalid signal update specification."),e.force&&(r.options={force:!0}),a.forEach(l=>t.addUpdate(Fe(Jae(l,t),r)))}function Jae(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):Cd(e,t)}}function Qae(e){return{signal:"["+e.map(t=>t.scale?'scale("'+t.scale+'")':t.signal)+"]"}}function ele(e,t){const n=t.getSignal(e.name);let i=e.update;e.init&&(i?U("Signals can not include both init and update expressions."):(i=e.init,n.initonly=!0)),i&&(i=es(i,t),n.update=i.$expr,n.params=i.$params),e.on&&e.on.forEach(r=>Kae(r,t,n.id))}const at=e=>(t,n,i)=>Y0(e,n,t||void 0,i),JM=at("aggregate"),tle=at("axisticks"),QM=at("bound"),fr=at("collect"),eF=at("compare"),nle=at("datajoin"),tF=at("encode"),ile=at("expression"),rle=at("facet"),sle=at("field"),ole=at("key"),ale=at("legendentries"),lle=at("load"),ule=at("mark"),cle=at("multiextent"),fle=at("multivalues"),dle=at("overlap"),hle=at("params"),nF=at("prefacet"),ple=at("projection"),gle=at("proxy"),mle=at("relay"),iF=at("render"),yle=at("scale"),Ka=at("sieve"),ble=at("sortitems"),rF=at("viewlayout"),vle=at("values");let xle=0;const sF={min:"min",max:"max",count:"sum"};function _le(e,t){const n=e.type||"linear";T$(n)||U("Unrecognized scale type: "+J(n)),t.addScale(e.name,{type:n,domain:void 0})}function wle(e,t){const n=t.getScale(e.name).params;let i;n.domain=oF(e.domain,e,t),e.range!=null&&(n.range=lF(e,t,n)),e.interpolate!=null&&Dle(e.interpolate,n),e.nice!=null&&(n.nice=Fle(e.nice)),e.bins!=null&&(n.bins=Mle(e.bins,t));for(i in e)pe(n,i)||i==="name"||(n[i]=zi(e[i],t))}function zi(e,t){return ie(e)?e.signal?t.signalRef(e.signal):U("Unsupported object: "+J(e)):e}function Q0(e,t){return e.signal?t.signalRef(e.signal):e.map(n=>zi(n,t))}function e1(e){U("Can not find data set: "+J(e))}function oF(e,t,n){if(!e){(t.domainMin!=null||t.domainMax!=null)&&U("No scale domain defined for domainMin/domainMax to override.");return}return e.signal?n.signalRef(e.signal):(q(e)?kle:e.fields?Ele:$le)(e,t,n)}function kle(e,t,n){return e.map(i=>zi(i,n))}function $le(e,t,n){const i=n.getData(e.data);return i||e1(e.data),yu(t.type)?i.valuesRef(n,e.field,aF(e.sort,!1)):D$(t.type)?i.domainRef(n,e.field):i.extentRef(n,e.field)}function Ele(e,t,n){const i=e.data,r=e.fields.reduce((s,o)=>(o=te(o)?{data:i,field:o}:q(o)||o.signal?Cle(o,n):o,s.push(o),s),[]);return(yu(t.type)?Sle:D$(t.type)?Ale:Tle)(e,n,r)}function Cle(e,t){const n="_:vega:_"+xle++,i=fr({});if(q(e))i.value={$ingest:e};else if(e.signal){const r="setdata("+J(n)+","+e.signal+")";i.params.input=t.signalRef(r)}return t.addDataPipeline(n,[i,Ka({})]),{data:n,field:"data"}}function Sle(e,t,n){const i=aF(e.sort,!0);let r,s;const o=n.map(u=>{const c=t.getData(u.data);return c||e1(u.data),c.countsRef(t,u.field,i)}),a={groupby:b7,pulse:o};i&&(r=i.op||"count",s=i.field?K0(r,i.field):"count",a.ops=[sF[r]],a.fields=[t.fieldRef(s)],a.as=[s]),r=t.add(JM(a));const l=t.add(fr({pulse:ye(r)}));return s=t.add(vle({field:b7,sort:t.sortRef(i),pulse:ye(l)})),ye(s)}function aF(e,t){return e&&(!e.field&&!e.op?ie(e)?e.field="key":e={field:"key"}:!e.field&&e.op!=="count"?U("No field provided for sort aggregate op: "+e.op):t&&e.field&&e.op&&!sF[e.op]&&U("Multiple domain scales can not be sorted using "+e.op)),e}function Ale(e,t,n){const i=n.map(r=>{const s=t.getData(r.data);return s||e1(r.data),s.domainRef(t,r.field)});return ye(t.add(fle({values:i})))}function Tle(e,t,n){const i=n.map(r=>{const s=t.getData(r.data);return s||e1(r.data),s.extentRef(t,r.field)});return ye(t.add(cle({extents:i})))}function Mle(e,t){return e.signal||q(e)?Q0(e,t):t.objectProperty(e)}function Fle(e){return ie(e)?{interval:zi(e.interval),step:zi(e.step)}:zi(e)}function Dle(e,t){t.interpolate=zi(e.type||e),e.gamma!=null&&(t.interpolateGamma=zi(e.gamma))}function lF(e,t,n){const i=t.config.range;let r=e.range;if(r.signal)return t.signalRef(r.signal);if(te(r)){if(i&&pe(i,r))return e=Fe({},e,{range:i[r]}),lF(e,t,n);r==="width"?r=[0,{signal:"width"}]:r==="height"?r=yu(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:U("Unrecognized scale range value: "+J(r))}else if(r.scheme){n.scheme=q(r.scheme)?Q0(r.scheme,t):zi(r.scheme,t),r.extent&&(n.schemeExtent=Q0(r.extent,t)),r.count&&(n.schemeCount=zi(r.count,t));return}else if(r.step){n.rangeStep=zi(r.step,t);return}else{if(yu(e.type)&&!q(r))return oF(r,e,t);q(r)||U("Unsupported range type: "+J(r))}return r.map(s=>(q(s)?Q0:zi)(s,t))}function Nle(e,t){const n=t.config.projection||{},i={};for(const r in e)r!=="name"&&(i[r]=w7(e[r],r,t));for(const r in n)i[r]==null&&(i[r]=w7(n[r],r,t));t.addProjection(e.name,i)}function w7(e,t,n){return q(e)?e.map(i=>w7(i,t,n)):ie(e)?e.signal?n.signalRef(e.signal):t==="fit"?e:U("Unsupported parameter object: "+J(e)):e}const dr="top",Uu="left",qu="right",Uo="bottom",uF="center",Ole="vertical",Rle="start",Lle="middle",Ile="end",k7="index",$7="label",zle="offset",Wu="perc",Ple="perc2",Pi="value",Sd="guide-label",E7="guide-title",Ble="group-title",jle="group-subtitle",cF="symbol",t1="gradient",C7="discrete",S7="size",A7=[S7,"shape","fill","stroke","strokeWidth","strokeDash","opacity"],Ad={name:1,style:1,interactive:1},Ve={value:0},Bi={value:1},n1="group",fF="rect",T7="rule",Ule="symbol",Ja="text";function Td(e){return e.type=n1,e.interactive=e.interactive||!1,e}function ii(e,t){const n=(i,r)=>cr(e[i],cr(t[i],r));return n.isVertical=i=>Ole===cr(e.direction,t.direction||(i?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>cr(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>cr(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>cr(e.columns,cr(t.columns,+n.isVertical(!0))),n}function dF(e,t){const n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}function qle(e,t,n){const i=t.config.style[n];return i&&i[e]}function i1(e,t,n){return`item.anchor === '${Rle}' ? ${e} : item.anchor === '${Ile}' ? ${t} : ${n}`}const M7=i1(J(Uu),J(qu),J(uF));function Wle(e){const t=e("tickBand");let n=e("tickOffset"),i,r;return t?t.signal?(i={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`},r={signal:`(${t.signal}) === 'extent'`},ie(n)||(n={signal:`(${t.signal}) === 'extent' ? 0 : ${n}`})):t==="extent"?(i=1,r=!0,n=0):(i=.5,r=!1):(i=e("bandPosition"),r=e("tickExtra")),{extra:r,band:i,offset:n}}function hF(e,t){return t?e?ie(e)?Object.assign({},e,{offset:hF(e.offset,t)}):{value:e,offset:t}:t:e}function wi(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=Bu(e.encode,t,Ad)):e.interactive=!1,e}function Hle(e,t,n,i){const r=ii(e,n),s=r.isVertical(),o=r.gradientThickness(),a=r.gradientLength();let l,u,c,f,d;s?(u=[0,1],c=[0,0],f=o,d=a):(u=[0,0],c=[1,0],f=a,d=o);const h={enter:l={opacity:Ve,x:Ve,y:Ve,width:Xt(f),height:Xt(d)},update:Fe({},l,{opacity:Bi,fill:{gradient:t,start:u,stop:c}}),exit:{opacity:Ve}};return an(h,{stroke:r("gradientStrokeColor"),strokeWidth:r("gradientStrokeWidth")},{opacity:r("gradientOpacity")}),wi({type:fF,role:$ae,encode:h},i)}function Gle(e,t,n,i,r){const s=ii(e,n),o=s.isVertical(),a=s.gradientThickness(),l=s.gradientLength();let u,c,f,d,h="";o?(u="y",f="y2",c="x",d="width",h="1-"):(u="x",f="x2",c="y",d="height");const p={opacity:Ve,fill:{scale:t,field:Pi}};p[u]={signal:h+"datum."+Wu,mult:l},p[c]=Ve,p[f]={signal:h+"datum."+Ple,mult:l},p[d]=Xt(a);const g={enter:p,update:Fe({},p,{opacity:Bi}),exit:{opacity:Ve}};return an(g,{stroke:s("gradientStrokeColor"),strokeWidth:s("gradientStrokeWidth")},{opacity:s("gradientOpacity")}),wi({type:fF,role:wae,key:Pi,from:r,encode:g},i)}const Vle=`datum.${Wu}<=0?"${Uu}":datum.${Wu}>=1?"${qu}":"${uF}"`,Xle=`datum.${Wu}<=0?"${Uo}":datum.${Wu}>=1?"${dr}":"${Lle}"`;function pF(e,t,n,i){const r=ii(e,t),s=r.isVertical(),o=Xt(r.gradientThickness()),a=r.gradientLength();let l=r("labelOverlap"),u,c,f,d,h="";const p={enter:u={opacity:Ve},update:c={opacity:Bi,text:{field:$7}},exit:{opacity:Ve}};return an(p,{fill:r("labelColor"),fillOpacity:r("labelOpacity"),font:r("labelFont"),fontSize:r("labelFontSize"),fontStyle:r("labelFontStyle"),fontWeight:r("labelFontWeight"),limit:cr(e.labelLimit,t.gradientLabelLimit)}),s?(u.align={value:"left"},u.baseline=c.baseline={signal:Xle},f="y",d="x",h="1-"):(u.align=c.align={signal:Vle},u.baseline={value:"top"},f="x",d="y"),u[f]=c[f]={signal:h+"datum."+Wu,mult:a},u[d]=c[d]=o,o.offset=cr(e.labelOffset,t.gradientLabelOffset)||0,l=l?{separation:r("labelSeparation"),method:l,order:"datum."+k7}:void 0,wi({type:Ja,role:qM,style:Sd,key:Pi,from:i,encode:p,overlap:l},n)}function Yle(e,t,n,i,r){const s=ii(e,t),o=n.entries,a=!!(o&&o.interactive),l=o?o.name:void 0,u=s("clipHeight"),c=s("symbolOffset"),f={data:"value"},d=`(${r}) ? datum.${zle} : datum.${S7}`,h=u?Xt(u):{field:S7},p=`datum.${k7}`,g=`max(1, ${r})`;let m,y,b,v,x;h.mult=.5,m={enter:y={opacity:Ve,x:{signal:d,mult:.5,offset:c},y:h},update:b={opacity:Bi,x:y.x,y:y.y},exit:{opacity:Ve}};let _=null,k=null;e.fill||(_=t.symbolBaseFillColor,k=t.symbolBaseStrokeColor),an(m,{fill:s("symbolFillColor",_),shape:s("symbolType"),size:s("symbolSize"),stroke:s("symbolStrokeColor",k),strokeDash:s("symbolDash"),strokeDashOffset:s("symbolDashOffset"),strokeWidth:s("symbolStrokeWidth")},{opacity:s("symbolOpacity")}),A7.forEach(E=>{e[E]&&(b[E]=y[E]={scale:e[E],field:Pi})});const w=wi({type:Ule,role:Eae,key:Pi,from:f,clip:u?!0:void 0,encode:m},n.symbols),$=Xt(c);$.offset=s("labelOffset"),m={enter:y={opacity:Ve,x:{signal:d,offset:$},y:h},update:b={opacity:Bi,text:{field:$7},x:y.x,y:y.y},exit:{opacity:Ve}},an(m,{align:s("labelAlign"),baseline:s("labelBaseline"),fill:s("labelColor"),fillOpacity:s("labelOpacity"),font:s("labelFont"),fontSize:s("labelFontSize"),fontStyle:s("labelFontStyle"),fontWeight:s("labelFontWeight"),limit:s("labelLimit")});const S=wi({type:Ja,role:qM,style:Sd,key:Pi,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!u},width:Ve,height:u?Xt(u):Ve,opacity:Ve},exit:{opacity:Ve},update:b={opacity:Bi,row:{signal:null},column:{signal:null}}},s.isVertical(!0)?(v=`ceil(item.mark.items.length / ${g})`,b.row.signal=`${p}%${v}`,b.column.signal=`floor(${p} / ${v})`,x={field:["row",p]}):(b.row.signal=`floor(${p} / ${g})`,b.column.signal=`${p} % ${g}`,x={field:p}),b.column.signal=`(${r})?${b.column.signal}:${p}`,i={facet:{data:i,name:"value",groupby:k7}},Td({role:g7,from:i,encode:Bu(m,o,Ad),marks:[w,S],name:l,interactive:a,sort:x})}function Zle(e,t){const n=ii(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}const F7='item.orient === "left"',D7='item.orient === "right"',r1=`(${F7} || ${D7})`,Kle=`datum.vgrad && ${r1}`,Jle=i1('"top"','"bottom"','"middle"'),Qle=i1('"right"','"left"','"center"'),eue=`datum.vgrad && ${D7} ? (${Qle}) : (${r1} && !(datum.vgrad && ${F7})) ? "left" : ${M7}`,tue=`item._anchor || (${r1} ? "middle" : "start")`,nue=`${Kle} ? (${F7} ? -90 : 90) : 0`,iue=`${r1} ? (datum.vgrad ? (${D7} ? "bottom" : "top") : ${Jle}) : "top"`;function rue(e,t,n,i){const r=ii(e,t),s={enter:{opacity:Ve},update:{opacity:Bi,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:Ve}};return an(s,{orient:r("titleOrient"),_anchor:r("titleAnchor"),anchor:{signal:tue},angle:{signal:nue},align:{signal:eue},baseline:{signal:iue},text:e.title,fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),baseline:r("titleBaseline")}),wi({type:Ja,role:Cae,style:E7,from:i,encode:s},n)}function sue(e,t){let n;return ie(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+gF(e.path)+")":e.sphere&&(n="geoShape("+gF(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function gF(e){return ie(e)&&e.signal?e.signal:J(e)}function mF(e){const t=e.role||"";return!t.indexOf("axis")||!t.indexOf("legend")||!t.indexOf("title")?t:e.type===n1?g7:t||h7}function oue(e){return{marktype:e.type,name:e.name||void 0,role:e.role||mF(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function aue(e,t){return e&&e.signal?t.signalRef(e.signal):e!==!1}function N7(e,t){const n=tk(e.type);n||U("Unrecognized transform type: "+J(e.type));const i=Y0(n.type.toLowerCase(),null,yF(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(i)),i.metadata=n.metadata||{},i}function yF(e,t,n){const i={},r=e.params.length;for(let s=0;sbF(e,s,n)):bF(e,r,n)}function bF(e,t,n){const i=e.type;if(jt(t))return xF(i)?U("Expression references can not be signals."):O7(i)?n.fieldRef(t):_F(i)?n.compareRef(t):n.signalRef(t.signal);{const r=e.expr||O7(i);return r&&fue(t)?n.exprRef(t.expr,t.as):r&&due(t)?Ed(t.field,t.as):xF(i)?es(t,n):hue(i)?ye(n.getData(t).values):O7(i)?Ed(t):_F(i)?n.compareRef(t):t}}function uue(e,t,n){return te(t.from)||U('Lookup "from" parameter must be a string literal.'),n.getData(t.from).lookupRef(n,t.key)}function cue(e,t,n){const i=t[e.name];return e.array?(q(i)||U("Expected an array of sub-parameters. Instead: "+J(i)),i.map(r=>vF(e,r,n))):vF(e,i,n)}function vF(e,t,n){const i=e.params.length;let r;for(let o=0;oe&&e.expr,due=e=>e&&e.field,hue=e=>e==="data",xF=e=>e==="expr",O7=e=>e==="field",_F=e=>e==="compare";function pue(e,t,n){let i,r,s,o,a;return e?(i=e.facet)&&(t||U("Only group marks can be faceted."),i.field!=null?o=a=s1(i,n):(e.data?a=ye(n.getData(e.data).aggregate):(s=N7(Fe({type:"aggregate",groupby:ee(i.groupby)},i.aggregate),n),s.params.key=n.keyRef(i.groupby),s.params.pulse=s1(i,n),o=a=ye(n.add(s))),r=n.keyRef(i.groupby,!0))):o=ye(n.add(fr(null,[{}]))),o||(o=s1(e,n)),{key:r,pulse:o,parent:a}}function s1(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:ye(t.getData(e.data).output)}function Qa(e,t,n,i,r){this.scope=e,this.input=t,this.output=n,this.values=i,this.aggregate=r,this.index={}}Qa.fromEntries=function(e,t){const n=t.length,i=t[n-1],r=t[n-2];let s=t[0],o=null,a=1;for(s&&s.type==="load"&&(s=t[1]),e.add(t[0]);af??"null").join(",")+"),0)",c=es(u,t);l.update=c.$expr,l.params=c.$params}function o1(e,t){const n=mF(e),i=e.type===n1,r=e.from&&e.from.facet,s=e.overlap;let o=e.layout||n===g7||n===p7,a,l,u,c,f,d,h;const p=n===h7||o||r,g=pue(e.from,i,t);l=t.add(nle({key:g.key||(e.key?Ed(e.key):void 0),pulse:g.pulse,clean:!i}));const m=ye(l);l=u=t.add(fr({pulse:m})),l=t.add(ule({markdef:oue(e),interactive:aue(e.interactive,t),clip:sue(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:ye(l)}));const y=ye(l);l=c=t.add(tF(VM(e.encode,e.type,n,e.style,t,{mod:!1,pulse:y}))),l.params.parent=t.encode(),e.transform&&e.transform.forEach(k=>{const w=N7(k,t),$=w.metadata;($.generates||$.changes)&&U("Mark transforms should not generate new data."),$.nomod||(c.params.mod=!0),w.params.pulse=ye(l),t.add(l=w)}),e.sort&&(l=t.add(ble({sort:t.compareRef(e.sort),pulse:ye(l)})));const b=ye(l);(r||o)&&(o=t.add(rF({layout:t.objectProperty(e.layout),legends:t.legends,mark:y,pulse:b})),d=ye(o));const v=t.add(QM({mark:y,pulse:d||b}));h=ye(v),i&&(p&&(a=t.operators,a.pop(),o&&a.pop()),t.pushState(b,d||h,m),r?gue(e,t,g):p?mue(e,t,g):t.parse(e),t.popState(),p&&(o&&a.push(o),a.push(v))),s&&(h=yue(s,h,t));const x=t.add(iF({pulse:h})),_=t.add(Ka({pulse:ye(x)},void 0,t.parent()));e.name!=null&&(f=e.name,t.addData(f,new Qa(t,u,x,_)),e.on&&e.on.forEach(k=>{(k.insert||k.remove||k.toggle)&&U("Marks only support modify triggers."),$F(k,t,f)}))}function yue(e,t,n){const i=e.method,r=e.bound,s=e.separation,o={separation:jt(s)?n.signalRef(s.signal):s,method:jt(i)?n.signalRef(i.signal):i,pulse:t};if(e.order&&(o.sort=n.compareRef({field:e.order})),r){const a=r.tolerance;o.boundTolerance=jt(a)?n.signalRef(a.signal):+a,o.boundScale=n.scaleRef(r.scale),o.boundOrient=r.orient}return ye(n.add(dle(o)))}function bue(e,t){const n=t.config.legend,i=e.encode||{},r=ii(e,n),s=i.legend||{},o=s.name||void 0,a=s.interactive,l=s.style,u={};let c=0,f,d,h;A7.forEach(v=>e[v]?(u[v]=e[v],c=c||e[v]):0),c||U("Missing valid scale for legend.");const p=vue(e,t.scaleType(c)),g={title:e.title!=null,scales:u,type:p,vgrad:p!=="symbol"&&r.isVertical()},m=ye(t.add(fr(null,[g]))),y={enter:{x:{value:0},y:{value:0}}},b=ye(t.add(ale(d={type:p,scale:t.scaleRef(c),count:t.objectProperty(r("tickCount")),limit:t.property(r("symbolLimit")),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));return p===t1?(h=[Hle(e,c,n,i.gradient),pF(e,n,i.labels,b)],d.count=d.count||t.signalRef(`max(2,2*floor((${Za(r.gradientLength())})/100))`)):p===C7?h=[Gle(e,c,n,i.gradient,b),pF(e,n,i.labels,b)]:(f=Zle(e,n),h=[Yle(e,n,i,b,Za(f.columns))],d.size=wue(e,t,h[0].marks)),h=[Td({role:kae,from:m,encode:y,marks:h,layout:f,interactive:a})],g.title&&h.push(rue(e,n,i.title,m)),o1(Td({role:_ae,from:m,encode:Bu(_ue(r,e,n),s,Ad),marks:h,aria:r("aria"),description:r("description"),zindex:r("zindex"),name:o,interactive:a,style:l}),t)}function vue(e,t){let n=e.type||cF;return!e.type&&xue(e)===1&&(e.fill||e.stroke)&&(n=Rb(t)?t1:Lb(t)?C7:cF),n!==t1?n:Lb(t)?C7:t1}function xue(e){return A7.reduce((t,n)=>t+(e[n]?1:0),0)}function _ue(e,t,n){const i={enter:{},update:{}};return an(i,{orient:e("orient"),offset:e("offset"),padding:e("padding"),titlePadding:e("titlePadding"),cornerRadius:e("cornerRadius"),fill:e("fillColor"),stroke:e("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:e("legendX"),y:e("legendY"),format:t.format,formatType:t.formatType}),i}function wue(e,t,n){const i=Za(EF("size",e,n)),r=Za(EF("strokeWidth",e,n)),s=Za(kue(n[1].encode,t,Sd));return es(`max(ceil(sqrt(${i})+${r}),${s})`,t)}function EF(e,t,n){return t[e]?`scale("${t[e]}",datum)`:dF(e,n[0].encode)}function kue(e,t,n){return dF("fontSize",e)||qle("fontSize",t,n)}const $ue=`item.orient==="${Uu}"?-90:item.orient==="${qu}"?90:0`;function Eue(e,t){e=te(e)?{text:e}:e;const n=ii(e,t.config.title),i=e.encode||{},r=i.group||{},s=r.name||void 0,o=r.interactive,a=r.style,l=[],u={},c=ye(t.add(fr(null,[u])));return l.push(Aue(e,n,Cue(e),c)),e.subtitle&&l.push(Tue(e,n,i.subtitle,c)),o1(Td({role:Sae,from:c,encode:Sue(n,r),marks:l,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:s,interactive:o,style:a}),t)}function Cue(e){const t=e.encode;return t&&t.title||Fe({name:e.name,interactive:e.interactive,style:e.style},t)}function Sue(e,t){const n={enter:{},update:{}};return an(n,{orient:e("orient"),anchor:e("anchor"),align:{signal:M7},angle:{signal:$ue},limit:e("limit"),frame:e("frame"),offset:e("offset")||0,padding:e("subtitlePadding")}),Bu(n,t,Ad)}function Aue(e,t,n,i){const r={value:0},s=e.text,o={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return an(o,{text:s,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("color"),font:t("font"),fontSize:t("fontSize"),fontStyle:t("fontStyle"),fontWeight:t("fontWeight"),lineHeight:t("lineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),wi({type:Ja,role:Aae,style:Ble,from:i,encode:o},n)}function Tue(e,t,n,i){const r={value:0},s=e.subtitle,o={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return an(o,{text:s,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("subtitleColor"),font:t("subtitleFont"),fontSize:t("subtitleFontSize"),fontStyle:t("subtitleFontStyle"),fontWeight:t("subtitleFontWeight"),lineHeight:t("subtitleLineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),wi({type:Ja,role:Tae,style:jle,from:i,encode:o},n)}function Mue(e,t){const n=[];e.transform&&e.transform.forEach(i=>{n.push(N7(i,t))}),e.on&&e.on.forEach(i=>{$F(i,t,e.name)}),t.addDataPipeline(e.name,Fue(e,t,n))}function Fue(e,t,n){const i=[];let r=null,s=!1,o=!1,a,l,u,c,f;for(e.values?jt(e.values)||J0(e.format)?(i.push(CF(t,e)),i.push(r=el())):i.push(r=el({$ingest:e.values,$format:e.format})):e.url?J0(e.url)||J0(e.format)?(i.push(CF(t,e)),i.push(r=el())):i.push(r=el({$request:e.url,$format:e.format})):e.source&&(r=a=ee(e.source).map(d=>ye(t.getData(d).output)),i.push(null)),l=0,u=n.length;le===Uo||e===dr,a1=(e,t,n)=>jt(e)?Rue(e.signal,t,n):e===Uu||e===dr?t:n,Yt=(e,t,n)=>jt(e)?Nue(e.signal,t,n):SF(e)?t:n,hr=(e,t,n)=>jt(e)?Oue(e.signal,t,n):SF(e)?n:t,AF=(e,t,n)=>jt(e)?Lue(e.signal,t,n):e===dr?{value:t}:{value:n},Due=(e,t,n)=>jt(e)?Iue(e.signal,t,n):e===qu?{value:t}:{value:n},Nue=(e,t,n)=>TF(`${e} === '${dr}' || ${e} === '${Uo}'`,t,n),Oue=(e,t,n)=>TF(`${e} !== '${dr}' && ${e} !== '${Uo}'`,t,n),Rue=(e,t,n)=>R7(`${e} === '${Uu}' || ${e} === '${dr}'`,t,n),Lue=(e,t,n)=>R7(`${e} === '${dr}'`,t,n),Iue=(e,t,n)=>R7(`${e} === '${qu}'`,t,n),TF=(e,t,n)=>(t=t!=null?Xt(t):t,n=n!=null?Xt(n):n,MF(t)&&MF(n)?(t=t?t.signal||J(t.value):null,n=n?n.signal||J(n.value):null,{signal:`${e} ? (${t}) : (${n})`}):[Fe({test:e},t)].concat(n||[])),MF=e=>e==null||Object.keys(e).length===1,R7=(e,t,n)=>({signal:`${e} ? (${Hu(t)}) : (${Hu(n)})`}),zue=(e,t,n,i,r)=>({signal:(i!=null?`${e} === '${Uu}' ? (${Hu(i)}) : `:"")+(n!=null?`${e} === '${Uo}' ? (${Hu(n)}) : `:"")+(r!=null?`${e} === '${qu}' ? (${Hu(r)}) : `:"")+(t!=null?`${e} === '${dr}' ? (${Hu(t)}) : `:"")+"(null)"}),Hu=e=>jt(e)?e.signal:e==null?null:J(e),Pue=(e,t)=>t===0?0:jt(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},Gu=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function Vu(e,t,n,i){let r;if(t&&pe(t,e))return t[e];if(pe(n,e))return n[e];if(e.startsWith("title")){switch(e){case"titleColor":r="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":r=e[5].toLowerCase()+e.slice(6)}return i[E7][r]}else if(e.startsWith("label")){switch(e){case"labelColor":r="fill";break;case"labelFont":case"labelFontSize":r=e[5].toLowerCase()+e.slice(6)}return i[Sd][r]}return null}function FF(e){const t={};for(const n of e)if(n)for(const i in n)t[i]=1;return Object.keys(t)}function Bue(e,t){var n=t.config,i=n.style,r=n.axis,s=t.scaleType(e.scale)==="band"&&n.axisBand,o=e.orient,a,l,u;if(jt(o)){const f=FF([n.axisX,n.axisY]),d=FF([n.axisTop,n.axisBottom,n.axisLeft,n.axisRight]);a={};for(u of f)a[u]=Yt(o,Vu(u,n.axisX,r,i),Vu(u,n.axisY,r,i));l={};for(u of d)l[u]=zue(o.signal,Vu(u,n.axisTop,r,i),Vu(u,n.axisBottom,r,i),Vu(u,n.axisLeft,r,i),Vu(u,n.axisRight,r,i))}else a=o===dr||o===Uo?n.axisX:n.axisY,l=n["axis"+o[0].toUpperCase()+o.slice(1)];return a||l||s?Fe({},r,a,l,s):r}function jue(e,t,n,i){const r=ii(e,t),s=e.orient;let o,a;const l={enter:o={opacity:Ve},update:a={opacity:Bi},exit:{opacity:Ve}};an(l,{stroke:r("domainColor"),strokeCap:r("domainCap"),strokeDash:r("domainDash"),strokeDashOffset:r("domainDashOffset"),strokeWidth:r("domainWidth"),strokeOpacity:r("domainOpacity")});const u=DF(e,0),c=DF(e,1);return o.x=a.x=Yt(s,u,Ve),o.x2=a.x2=Yt(s,c),o.y=a.y=hr(s,u,Ve),o.y2=a.y2=hr(s,c),wi({type:T7,role:mae,from:i,encode:l},n)}function DF(e,t){return{scale:e.scale,range:t}}function Uue(e,t,n,i,r){const s=ii(e,t),o=e.orient,a=e.gridScale,l=a1(o,1,-1),u=que(e.offset,l);let c,f,d;const h={enter:c={opacity:Ve},update:d={opacity:Bi},exit:f={opacity:Ve}};an(h,{stroke:s("gridColor"),strokeCap:s("gridCap"),strokeDash:s("gridDash"),strokeDashOffset:s("gridDashOffset"),strokeOpacity:s("gridOpacity"),strokeWidth:s("gridWidth")});const p={scale:e.scale,field:Pi,band:r.band,extra:r.extra,offset:r.offset,round:s("tickRound")},g=Yt(o,{signal:"height"},{signal:"width"}),m=a?{scale:a,range:0,mult:l,offset:u}:{value:0,offset:u},y=a?{scale:a,range:1,mult:l,offset:u}:Fe(g,{mult:l,offset:u});return c.x=d.x=Yt(o,p,m),c.y=d.y=hr(o,p,m),c.x2=d.x2=hr(o,y),c.y2=d.y2=Yt(o,y),f.x=Yt(o,p),f.y=hr(o,p),wi({type:T7,role:yae,key:Pi,from:i,encode:h},n)}function que(e,t){if(t!==1)if(!ie(e))e=jt(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);else{let n=e=Fe({},e);for(;n.mult!=null;)if(ie(n.mult))n=n.mult=Fe({},n.mult);else return n.mult=jt(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n.mult=t}return e}function Wue(e,t,n,i,r,s){const o=ii(e,t),a=e.orient,l=a1(a,-1,1);let u,c,f;const d={enter:u={opacity:Ve},update:f={opacity:Bi},exit:c={opacity:Ve}};an(d,{stroke:o("tickColor"),strokeCap:o("tickCap"),strokeDash:o("tickDash"),strokeDashOffset:o("tickDashOffset"),strokeOpacity:o("tickOpacity"),strokeWidth:o("tickWidth")});const h=Xt(r);h.mult=l;const p={scale:e.scale,field:Pi,band:s.band,extra:s.extra,offset:s.offset,round:o("tickRound")};return f.y=u.y=Yt(a,Ve,p),f.y2=u.y2=Yt(a,h),c.x=Yt(a,p),f.x=u.x=hr(a,Ve,p),f.x2=u.x2=hr(a,h),c.y=hr(a,p),wi({type:T7,role:vae,key:Pi,from:i,encode:d},n)}function L7(e,t,n,i,r){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+i+","+r+")"}}function Hue(e,t,n,i,r,s){const o=ii(e,t),a=e.orient,l=e.scale,u=a1(a,-1,1),c=Za(o("labelFlush")),f=Za(o("labelFlushOffset")),d=o("labelAlign"),h=o("labelBaseline");let p=c===0||!!c,g;const m=Xt(r);m.mult=u,m.offset=Xt(o("labelPadding")||0),m.offset.mult=u;const y={scale:l,field:Pi,band:.5,offset:hF(s.offset,o("labelOffset"))},b=Yt(a,p?L7(l,c,'"left"','"right"','"center"'):{value:"center"},Due(a,"left","right")),v=Yt(a,AF(a,"bottom","top"),p?L7(l,c,'"top"','"bottom"','"middle"'):{value:"middle"}),x=L7(l,c,`-(${f})`,f,0);p=p&&f;const _={opacity:Ve,x:Yt(a,y,m),y:hr(a,y,m)},k={enter:_,update:g={opacity:Bi,text:{field:$7},x:_.x,y:_.y,align:b,baseline:v},exit:{opacity:Ve,x:_.x,y:_.y}};an(k,{dx:!d&&p?Yt(a,x):null,dy:!h&&p?hr(a,x):null}),an(k,{angle:o("labelAngle"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontWeight:o("labelFontWeight"),fontStyle:o("labelFontStyle"),limit:o("labelLimit"),lineHeight:o("labelLineHeight")},{align:d,baseline:h});const w=o("labelBound");let $=o("labelOverlap");return $=$||w?{separation:o("labelSeparation"),method:$,order:"datum.index",bound:w?{scale:l,orient:a,tolerance:w}:null}:void 0,g.align!==b&&(g.align=Gu(g.align,b)),g.baseline!==v&&(g.baseline=Gu(g.baseline,v)),wi({type:Ja,role:bae,style:Sd,key:Pi,from:i,encode:k,overlap:$},n)}function Gue(e,t,n,i){const r=ii(e,t),s=e.orient,o=a1(s,-1,1);let a,l;const u={enter:a={opacity:Ve,anchor:Xt(r("titleAnchor",null)),align:{signal:M7}},update:l=Fe({},a,{opacity:Bi,text:Xt(e.title)}),exit:{opacity:Ve}},c={signal:`lerp(range("${e.scale}"), ${i1(0,1,.5)})`};return l.x=Yt(s,c),l.y=hr(s,c),a.angle=Yt(s,Ve,Pue(o,90)),a.baseline=Yt(s,AF(s,Uo,dr),{value:Uo}),l.angle=a.angle,l.baseline=a.baseline,an(u,{fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),angle:r("titleAngle"),baseline:r("titleBaseline")}),Vue(r,s,u,n),u.update.align=Gu(u.update.align,a.align),u.update.angle=Gu(u.update.angle,a.angle),u.update.baseline=Gu(u.update.baseline,a.baseline),wi({type:Ja,role:xae,style:E7,from:i,encode:u},n)}function Vue(e,t,n,i){const r=(a,l)=>a!=null?(n.update[l]=Gu(Xt(a),n.update[l]),!1):!ju(l,i),s=r(e("titleX"),"x"),o=r(e("titleY"),"y");n.enter.auto=o===s?Xt(o):Yt(t,Xt(o),Xt(s))}function Xue(e,t){const n=Bue(e,t),i=e.encode||{},r=i.axis||{},s=r.name||void 0,o=r.interactive,a=r.style,l=ii(e,n),u=Wle(l),c={scale:e.scale,ticks:!!l("ticks"),labels:!!l("labels"),grid:!!l("grid"),domain:!!l("domain"),title:e.title!=null},f=ye(t.add(fr({},[c]))),d=ye(t.add(tle({scale:t.scaleRef(e.scale),extra:t.property(u.extra),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)}))),h=[];let p;return c.grid&&h.push(Uue(e,n,i.grid,d,u)),c.ticks&&(p=l("tickSize"),h.push(Wue(e,n,i.ticks,d,p,u))),c.labels&&(p=c.ticks?p:0,h.push(Hue(e,n,i.labels,d,p,u))),c.domain&&h.push(jue(e,n,i.domain,f)),c.title&&h.push(Gue(e,n,i.title,f)),o1(Td({role:gae,from:f,encode:Bu(Yue(l,e),r,Ad),marks:h,aria:l("aria"),description:l("description"),zindex:l("zindex"),name:s,interactive:o,style:a}),t)}function Yue(e,t){const n={enter:{},update:{}};return an(n,{orient:e("orient"),offset:e("offset")||0,position:cr(t.position,0),titlePadding:e("titlePadding"),minExtent:e("minExtent"),maxExtent:e("maxExtent"),range:{signal:`abs(span(range("${t.scale}")))`},translate:e("translate"),format:t.format,formatType:t.formatType}),n}function NF(e,t,n){const i=ee(e.signals),r=ee(e.scales);return n||i.forEach(s=>YM(s,t)),ee(e.projections).forEach(s=>Nle(s,t)),r.forEach(s=>_le(s,t)),ee(e.data).forEach(s=>Mue(s,t)),r.forEach(s=>wle(s,t)),(n||i).forEach(s=>ele(s,t)),ee(e.axes).forEach(s=>Xue(s,t)),ee(e.marks).forEach(s=>o1(s,t)),ee(e.legends).forEach(s=>bue(s,t)),e.title&&Eue(e.title,t),t.parseLambdas(),t}const Zue=e=>Bu({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function Kue(e,t){const n=t.config,i=ye(t.root=t.add(Z0())),r=Jue(e,n);r.forEach(u=>YM(u,t)),t.description=e.description||n.description,t.eventConfig=n.events,t.legends=t.objectProperty(n.legend&&n.legend.layout),t.locale=n.locale;const s=t.add(fr()),o=t.add(tF(VM(Zue(e.encode),n1,p7,e.style,t,{pulse:ye(s)}))),a=t.add(rF({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:i,pulse:ye(o)}));t.operators.pop(),t.pushState(ye(o),ye(a),null),NF(e,t,r),t.operators.push(a);let l=t.add(QM({mark:i,pulse:ye(a)}));return l=t.add(iF({pulse:ye(l)})),l=t.add(Ka({pulse:ye(l)})),t.addData("root",new Qa(t,s,s,l)),t}function Fd(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function Jue(e,t){const n=o=>cr(e[o],t[o]),i=[Fd("background",n("background")),Fd("autosize",dae(n("autosize"))),Fd("padding",pae(n("padding"))),Fd("width",n("width")||0),Fd("height",n("height")||0)],r=i.reduce((o,a)=>(o[a.name]=a,o),{}),s={};return ee(e.signals).forEach(o=>{pe(r,o.name)?o=Fe(r[o.name],o):i.push(o),s[o.name]=o}),ee(t.signals).forEach(o=>{!pe(s,o.name)&&!pe(r,o.name)&&i.push(o)}),i}function OF(e,t){this.config=e||{},this.options=t||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function RF(e){this.config=e.config,this.options=e.options,this.legends=e.legends,this.field=Object.create(e.field),this.signals=Object.create(e.signals),this.lambdas=Object.create(e.lambdas),this.scales=Object.create(e.scales),this.events=Object.create(e.events),this.data=Object.create(e.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++e._nextsub[0],this._nextsub=e._nextsub,this._parent=e._parent.slice(),this._encode=e._encode.slice(),this._lookup=e._lookup.slice(),this._markpath=e._markpath}OF.prototype=RF.prototype={parse(e){return NF(e,this)},fork(){return new RF(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(e){return this.operators.push(e),e.id=this.id(),e.refs&&(e.refs.forEach(t=>{t.$ref=e.id}),e.refs=null),e},proxy(e){const t=e instanceof y7?ye(e):e;return this.add(gle({value:t}))},addStream(e){return this.streams.push(e),e.id=this.id(),e},addUpdate(e){return this.updates.push(e),e},finish(){let e,t;this.root&&(this.root.root=!0);for(e in this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function n(i,r,s){let o,a;i&&(o=i.data||(i.data={}),a=o[r]||(o[r]=[]),a.push(s))}for(e in this.data){t=this.data[e],n(t.input,e,"input"),n(t.output,e,"output"),n(t.values,e,"values");for(const i in t.index)n(t.index[i],e,"index:"+i)}return this},pushState(e,t,n){this._encode.push(ye(this.add(Ka({pulse:e})))),this._parent.push(t),this._lookup.push(n?ye(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return Ue(this._parent)},encode(){return Ue(this._encode)},lookup(){return Ue(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(te(e))return Ed(e,t);e.signal||U("Unsupported field reference: "+J(e));const n=e.signal;let i=this.field[n];if(!i){const r={name:this.signalRef(n)};t&&(r.as=t),this.field[n]=i=ye(this.add(sle(r)))}return i},compareRef(e){let t=!1;const n=s=>jt(s)?(t=!0,this.signalRef(s.signal)):Wae(s)?(t=!0,this.exprRef(s.expr)):s,i=ee(e.field).map(n),r=ee(e.order).map(n);return t?ye(this.add(eF({fields:i,orders:r}))):ZM(i,r)},keyRef(e,t){let n=!1;const i=s=>jt(s)?(n=!0,ye(r[s.signal])):s,r=this.signals;return e=ee(e).map(i),n?ye(this.add(ole({fields:e,flat:t}))):Bae(e,t)},sortRef(e){if(!e)return e;const t=K0(e.op,e.field),n=e.order||jae;return n.signal?ye(this.add(eF({fields:t,orders:this.signalRef(n.signal)}))):ZM(t,n)},event(e,t){const n=e+":"+t;if(!this.events[n]){const i=this.id();this.streams.push({id:i,source:e,type:t}),this.events[n]=i}return this.events[n]},hasOwnSignal(e){return pe(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&U("Duplicate signal name: "+J(e));const n=t instanceof y7?t:this.add(Z0(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||U("Unrecognized signal name: "+J(e)),this.signals[e]},signalRef(e){return this.signals[e]?ye(this.signals[e]):(pe(this.lambdas,e)||(this.lambdas[e]=this.add(Z0(null))),ye(this.lambdas[e]))},parseLambdas(){const e=Object.keys(this.lambdas);for(let t=0,n=e.length;t0?",":"")+(ie(r)?r.signal||I7(r):J(r))}return n+"]"}function ece(e){let t="{",n=0,i,r;for(i in e)r=e[i],t+=(++n>1?",":"")+J(i)+":"+(ie(r)?r.signal||I7(r):J(r));return t+"}"}function tce(){const e="sans-serif",i="#4c78a8",r="#000",s="#888",o="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:i},area:{fill:i},image:null,line:{stroke:i,strokeWidth:2},path:{stroke:i},rect:{fill:i},rule:{stroke:r},shape:{stroke:i},symbol:{fill:i,size:64},text:{fill:r,font:e,fontSize:11},trail:{fill:i,size:2},style:{"guide-label":{fill:r,font:e,fontSize:10},"guide-title":{fill:r,font:e,fontSize:11,fontWeight:"bold"},"group-title":{fill:r,font:e,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:r,font:e,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:o},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:s,grid:!1,gridWidth:1,gridColor:o,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:s,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:o,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:s,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}function nce(e,t,n){return ie(e)||U("Input Vega specification must be an object."),t=Wl(tce(),t,e.config),Kue(e,new OF(t,n)).toRuntime()}var ice="5.26.1";Fe(au,xG,UK,hJ,QQ,Vee,xne,Qte,wne,Gne,nie,uie);const rce=Object.freeze(Object.defineProperty({__proto__:null,Bounds:Ot,CanvasHandler:To,CanvasRenderer:Of,DATE:Kn,DAY:mn,DAYOFYEAR:Ir,Dataflow:ou,Debug:H6,Error:r2,EventStream:ap,Gradient:Z$,GroupItem:Zp,HOURS:pi,Handler:Ao,HybridHandler:O3,HybridRenderer:wg,Info:W6,Item:Yp,MILLISECONDS:Ji,MINUTES:gi,MONTH:gn,Marks:yi,MultiPulse:Q2,None:q6,Operator:gt,Parameters:op,Pulse:fo,QUARTER:Zn,RenderType:Fo,Renderer:bi,ResourceLoader:Yb,SECONDS:Fi,SVGHandler:E3,SVGRenderer:xg,SVGStringRenderer:N3,Scenegraph:b3,TIME_UNITS:M2,Transform:I,View:DM,WEEK:It,Warn:s2,YEAR:nn,accessor:Xn,accessorFields:fn,accessorName:Et,array:ee,ascending:Lh,bandwidthNRD:iy,bin:rk,bootstrapCI:sk,boundClip:bC,boundContext:$f,boundItem:y3,boundMark:TE,boundStroke:Ss,changeset:_a,clampRange:i4,codegenExpression:UT,compare:c2,constant:pn,cumulativeLogNormal:uy,cumulativeNormal:fp,cumulativeUniform:hy,dayofyear:W4,debounce:f2,defaultLocale:G2,definition:tk,densityLogNormal:ly,densityNormal:ry,densityUniform:dy,domChild:Pt,domClear:Ri,domCreate:So,domFind:v3,dotbin:ok,error:U,expressionFunction:Ft,extend:Fe,extent:Or,extentIndex:r4,falsy:io,fastmap:Gl,field:Ai,flush:s4,font:ug,fontFamily:Tf,fontSize:Gr,format:Qh,formatLocale:Kh,formats:Z2,hasOwnProperty:pe,id:Oc,identity:dn,inferType:I8,inferTypes:z8,ingest:et,inherits:K,inrange:Vl,interpolate:Ib,interpolateColors:Wp,interpolateRange:N$,intersect:pC,intersectBoxLine:_u,intersectPath:n3,intersectPoint:i3,intersectRule:pE,isArray:q,isBoolean:ro,isDate:so,isFunction:Me,isIterable:o4,isNumber:Xe,isObject:ie,isRegExp:a4,isString:te,isTuple:ip,key:d2,lerp:l4,lineHeight:Eo,loader:ep,locale:O8,logger:o2,lruCache:u4,markup:F3,merge:c4,mergeConfig:Wl,multiLineOffset:p3,one:ql,pad:f4,panLinear:K6,panLog:J6,panPow:Q6,panSymlog:e4,parse:nce,parseExpression:Hx,parseSelector:jo,path:bp,pathCurves:qb,pathEqual:vC,pathParse:bu,pathRectangle:iE,pathRender:vf,pathSymbols:nE,pathTrail:rE,peek:Ue,point:fg,projection:Fv,quantileLogNormal:cy,quantileNormal:dp,quantileUniform:py,quantiles:ty,quantizeInterpolator:O$,quarter:t4,quartiles:ny,get random(){return Di},randomInteger:$H,randomKDE:oy,randomLCG:kH,randomLogNormal:lk,randomMixture:uk,randomNormal:sy,randomUniform:ck,read:U8,regressionConstant:gy,regressionExp:dk,regressionLinear:my,regressionLoess:yk,regressionLog:fk,regressionPoly:pk,regressionPow:hk,regressionQuad:yy,renderModule:kg,repeat:Rc,resetDefaultLocale:xW,resetSVGClipId:oE,resetSVGDefIds:oK,responseType:j8,runtimeContext:dM,sampleCurve:pp,sampleLogNormal:ay,sampleNormal:cp,sampleUniform:fy,scale:Ke,sceneEqual:L3,sceneFromJSON:FE,scenePickVisit:ig,sceneToJSON:ME,sceneVisit:nr,sceneZOrder:r3,scheme:zb,serializeXML:tC,setHybridRendererOptions:nK,setRandom:_H,span:Lc,splitAccessPath:Nr,stringValue:J,textMetrics:mi,timeBin:u8,timeFloor:K4,timeFormatLocale:Qc,timeInterval:nu,timeOffset:e8,timeSequence:i8,timeUnitSpecifier:q4,timeUnits:D2,toBoolean:h2,toDate:p2,toNumber:hn,toSet:Ki,toString:g2,transform:nk,transforms:au,truncate:d4,truthy:Ti,tupleid:ge,typeParsers:V2,utcFloor:J4,utcInterval:iu,utcOffset:t8,utcSequence:r8,utcdayofyear:V4,utcquarter:n4,utcweek:X4,version:ice,visitArray:oo,week:H4,writeConfig:Hl,zero:no,zoomLinear:a2,zoomLog:l2,zoomPow:Rh,zoomSymlog:u2},Symbol.toStringTag,{value:"Module"}));function sce(e,t,n){let i;t.x2&&(t.x?(n&&e.x>e.x2&&(i=e.x,e.x=e.x2,e.x2=i),e.width=e.x2-e.x):e.x=e.x2-(e.width||0)),t.xc&&(e.x=e.xc-(e.width||0)/2),t.y2&&(t.y?(n&&e.y>e.y2&&(i=e.y,e.y=e.y2,e.y2=i),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.height||0)/2)}var oce={NaN:NaN,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,PI:Math.PI,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2,MIN_VALUE:Number.MIN_VALUE,MAX_VALUE:Number.MAX_VALUE},ace={"*":(e,t)=>e*t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,">":(e,t)=>e>t,"<":(e,t)=>ee<=t,">=":(e,t)=>e>=t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,"&":(e,t)=>e&t,"|":(e,t)=>e|t,"^":(e,t)=>e^t,"<<":(e,t)=>e<>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t},lce={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const uce=Array.prototype.slice,tl=(e,t,n)=>{const i=n?n(t[0]):t[0];return i[e].apply(i,uce.call(t,1))},cce=(e,t,n,i,r,s,o)=>new Date(e,t||0,n??1,i||0,r||0,s||0,o||0);var fce={isNaN:Number.isNaN,isFinite:Number.isFinite,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,clamp:(e,t,n)=>Math.max(t,Math.min(n,e)),now:Date.now,utc:Date.UTC,datetime:cce,date:e=>new Date(e).getDate(),day:e=>new Date(e).getDay(),year:e=>new Date(e).getFullYear(),month:e=>new Date(e).getMonth(),hours:e=>new Date(e).getHours(),minutes:e=>new Date(e).getMinutes(),seconds:e=>new Date(e).getSeconds(),milliseconds:e=>new Date(e).getMilliseconds(),time:e=>new Date(e).getTime(),timezoneoffset:e=>new Date(e).getTimezoneOffset(),utcdate:e=>new Date(e).getUTCDate(),utcday:e=>new Date(e).getUTCDay(),utcyear:e=>new Date(e).getUTCFullYear(),utcmonth:e=>new Date(e).getUTCMonth(),utchours:e=>new Date(e).getUTCHours(),utcminutes:e=>new Date(e).getUTCMinutes(),utcseconds:e=>new Date(e).getUTCSeconds(),utcmilliseconds:e=>new Date(e).getUTCMilliseconds(),length:e=>e.length,join:function(){return tl("join",arguments)},indexof:function(){return tl("indexOf",arguments)},lastindexof:function(){return tl("lastIndexOf",arguments)},slice:function(){return tl("slice",arguments)},reverse:e=>e.slice().reverse(),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return tl("substring",arguments,String)},split:function(){return tl("split",arguments,String)},replace:function(){return tl("replace",arguments,String)},trim:e=>String(e).trim(),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const dce=["view","item","group","xy","x","y"],z7=new Set([Function,eval,setTimeout,setInterval]);typeof setImmediate=="function"&&z7.add(setImmediate);const hce={Literal:(e,t)=>t.value,Identifier:(e,t)=>{const n=t.name;return e.memberDepth>0?n:n==="datum"?e.datum:n==="event"?e.event:n==="item"?e.item:oce[n]||e.params["$"+n]},MemberExpression:(e,t)=>{const n=!t.computed,i=e(t.object);n&&(e.memberDepth+=1);const r=e(t.property);if(n&&(e.memberDepth-=1),z7.has(i[r])){console.error(`Prevented interpretation of member "${r}" which could lead to insecure code execution`);return}return i[r]},CallExpression:(e,t)=>{const n=t.arguments;let i=t.callee.name;return i.startsWith("_")&&(i=i.slice(1)),i==="if"?e(n[0])?e(n[1]):e(n[2]):(e.fn[i]||fce[i]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>ace[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>lce[t.operator](e(t.argument)),ConditionalExpression:(e,t)=>e(t.test)?e(t.consequent):e(t.alternate),LogicalExpression:(e,t)=>t.operator==="&&"?e(t.left)&&e(t.right):e(t.left)||e(t.right),ObjectExpression:(e,t)=>t.properties.reduce((n,i)=>{e.memberDepth+=1;const r=e(i.key);return e.memberDepth-=1,z7.has(e(i.value))?console.error(`Prevented interpretation of property "${r}" which could lead to insecure code execution`):n[r]=e(i.value),n},{})};function Dd(e,t,n,i,r,s){const o=a=>hce[a.type](o,a);return o.memberDepth=0,o.fn=Object.create(t),o.params=n,o.datum=i,o.event=r,o.item=s,dce.forEach(a=>o.fn[a]=function(){return r.vega[a](...arguments)}),o(e)}var pce={operator(e,t){const n=t.ast,i=e.functions;return r=>Dd(n,i,r)},parameter(e,t){const n=t.ast,i=e.functions;return(r,s)=>Dd(n,i,s,r)},event(e,t){const n=t.ast,i=e.functions;return r=>Dd(n,i,void 0,void 0,r)},handler(e,t){const n=t.ast,i=e.functions;return(r,s)=>{const o=s.item&&s.item.datum;return Dd(n,i,r,o,s)}},encode(e,t){const{marktype:n,channels:i}=t,r=e.functions,s=n==="group"||n==="image"||n==="rect";return(o,a)=>{const l=o.datum;let u=0,c;for(const f in i)c=Dd(i[f].ast,r,a,l,void 0,o),o[f]!==c&&(o[f]=c,u=1);return n!=="rule"&&sce(o,i,s),u}}};const gce={name:"vega-lite",author:'Dominik Moritz, Kanit "Ham" Wongsuphasawat, Arvind Satyanarayan, Jeffrey Heer',version:"5.16.3",collaborators:["Kanit Wongsuphasawat (http://kanitw.yellowpigz.com)","Dominik Moritz (https://www.domoritz.de)","Arvind Satyanarayan (https://arvindsatya.com)","Jeffrey Heer (https://jheer.org)"],homepage:"https://vega.github.io/vega-lite/",description:"Vega-Lite is a concise high-level language for interactive visualization.",keywords:["vega","chart","visualization"],main:"build/vega-lite.js",unpkg:"build/vega-lite.min.js",jsdelivr:"build/vega-lite.min.js",module:"build/src/index",types:"build/src/index.d.ts",bin:{vl2pdf:"./bin/vl2pdf",vl2png:"./bin/vl2png",vl2svg:"./bin/vl2svg",vl2vg:"./bin/vl2vg"},files:["bin","build","src","vega-lite*","tsconfig.json"],scripts:{changelog:"conventional-changelog -p angular -r 2",prebuild:"yarn clean:build",build:"yarn build:only","build:only":"tsc -p tsconfig.build.json && rollup -c","prebuild:examples":"yarn build:only","build:examples":"yarn data && TZ=America/Los_Angeles scripts/build-examples.sh","prebuild:examples-full":"yarn build:only","build:examples-full":"TZ=America/Los_Angeles scripts/build-examples.sh 1","build:example":"TZ=America/Los_Angeles scripts/build-example.sh","build:toc":"yarn build:jekyll && scripts/generate-toc","build:site":"rollup -c site/rollup.config.mjs","build:jekyll":"pushd site && bundle exec jekyll build -q && popd","build:versions":"scripts/update-version.sh",clean:"yarn clean:build && del-cli 'site/data/*' 'examples/compiled/*.png' && find site/examples ! -name 'index.md' ! -name 'data' -type f -delete","clean:build":"del-cli 'build/*' !build/vega-lite-schema.json",data:"rsync -r node_modules/vega-datasets/data/* site/data",schema:"mkdir -p build && ts-json-schema-generator -f tsconfig.json -p src/index.ts -t TopLevelSpec --no-type-check --no-ref-encode > build/vega-lite-schema.json && yarn renameschema && cp build/vega-lite-schema.json site/_data/",renameschema:"scripts/rename-schema.sh",presite:"yarn data && yarn schema && yarn build:site && yarn build:versions && scripts/create-example-pages.sh",site:"yarn site:only","site:only":"pushd site && bundle exec jekyll serve -I -l && popd",prettierbase:"prettier '**/*.{md,css,yml}'",format:"eslint . --fix && yarn prettierbase --write",lint:"eslint . && yarn prettierbase --check",jest:"NODE_OPTIONS=--experimental-vm-modules npx jest",test:"yarn jest test/ && yarn lint && yarn schema && yarn jest examples/ && yarn test:runtime","test:cover":"yarn jest --collectCoverage test/","test:inspect":"node --inspect-brk --experimental-vm-modules ./node_modules/.bin/jest --runInBand test","test:runtime":"NODE_OPTIONS=--experimental-vm-modules TZ=America/Los_Angeles npx jest test-runtime/ --config test-runtime/jest-config.json","test:runtime:generate":"yarn build:only && del-cli test-runtime/resources && VL_GENERATE_TESTS=true yarn test:runtime",watch:"tsc -p tsconfig.build.json -w","watch:site":"yarn build:site -w","watch:test":"yarn jest --watch test/","watch:test:runtime":"NODE_OPTIONS=--experimental-vm-modules TZ=America/Los_Angeles npx jest --watch test-runtime/ --config test-runtime/jest-config.json",release:"release-it"},repository:{type:"git",url:"https://github.com/vega/vega-lite.git"},license:"BSD-3-Clause",bugs:{url:"https://github.com/vega/vega-lite/issues"},devDependencies:{"@babel/core":"^7.22.10","@babel/plugin-proposal-class-properties":"^7.18.6","@babel/preset-env":"^7.22.10","@babel/preset-typescript":"^7.22.5","@release-it/conventional-changelog":"^7.0.0","@rollup/plugin-alias":"^5.0.0","@rollup/plugin-babel":"^6.0.3","@rollup/plugin-commonjs":"^25.0.4","@rollup/plugin-json":"^6.0.0","@rollup/plugin-node-resolve":"^15.2.1","@rollup/plugin-terser":"^0.4.3","@types/chai":"^4.3.5","@types/d3":"^7.4.0","@types/jest":"^29.5.4","@types/pako":"^2.0.0","@typescript-eslint/eslint-plugin":"^6.4.1","@typescript-eslint/parser":"^6.4.1",ajv:"^8.12.0","ajv-formats":"^2.1.1",chai:"^4.3.7",cheerio:"^1.0.0-rc.12","conventional-changelog-cli":"^4.0.0",d3:"^7.8.5","del-cli":"^5.0.0",eslint:"^8.47.0","eslint-config-prettier":"^9.0.0","eslint-plugin-jest":"^27.2.3","eslint-plugin-prettier":"^5.0.0","fast-json-stable-stringify":"~2.1.0","highlight.js":"^11.8.0",jest:"^29.6.3","jest-dev-server":"^9.0.0",mkdirp:"^3.0.1",pako:"^2.1.0",prettier:"^3.0.2",puppeteer:"^15.0.0","release-it":"^16.1.5",rollup:"^3.28.1","rollup-plugin-bundle-size":"^1.0.3","rollup-plugin-sourcemaps":"^0.6.3",serve:"^14.2.1",terser:"^5.19.2","ts-jest":"^29.1.1","ts-json-schema-generator":"^1.3.0",typescript:"~5.2.2","vega-cli":"^5.25.0","vega-datasets":"^2.7.0","vega-embed":"^6.22.2","vega-tooltip":"^0.33.0","yaml-front-matter":"^4.1.1"},dependencies:{"json-stringify-pretty-compact":"~3.0.0",tslib:"~2.6.2","vega-event-selector":"~3.0.1","vega-expression":"~5.1.0","vega-util":"~1.17.2",yargs:"~17.7.2"},peerDependencies:{vega:"^5.24.0"},engines:{node:">=18"}};function P7(e){return!!e.or}function B7(e){return!!e.and}function j7(e){return!!e.not}function l1(e,t){if(j7(e))l1(e.not,t);else if(B7(e))for(const n of e.and)l1(n,t);else if(P7(e))for(const n of e.or)l1(n,t);else t(e)}function Xu(e,t){return j7(e)?{not:Xu(e.not,t)}:B7(e)?{and:e.and.map(n=>Xu(n,t))}:P7(e)?{or:e.or.map(n=>Xu(n,t))}:t(e)}const Ce=structuredClone;function LF(e){throw new Error(e)}function Yu(e,t){const n={};for(const i of t)pe(e,i)&&(n[i]=e[i]);return n}function ri(e,t){const n={...e};for(const i of t)delete n[i];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>ut(e)).join(",")})`};function ze(e){if(Xe(e))return e;const t=te(e)?e:ut(e);if(t.length<250)return t;let n=0;for(let i=0;ia===0?o:`[${o}]`),s=r.map((o,a)=>r.slice(0,a+1).join(""));for(const o of s)t.add(o)}return t}function G7(e,t){return e===void 0||t===void 0?!0:W7(H7(e),H7(t))}function lt(e){return G(e).length===0}const G=Object.keys,ln=Object.values,qo=Object.entries;function Nd(e){return e===!0||e===!1}function _t(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function Od(e,t){return j7(e)?`!(${Od(e.not,t)})`:B7(e)?`(${e.and.map(n=>Od(n,t)).join(") && (")})`:P7(e)?`(${e.or.map(n=>Od(n,t)).join(") || (")})`:t(e)}function u1(e,t){if(t.length===0)return!0;const n=t.shift();return n in e&&u1(e[n],t)&&delete e[n],lt(e)}function Rd(e){return e.charAt(0).toUpperCase()+e.substr(1)}function V7(e,t="datum"){const n=Nr(e),i=[];for(let r=1;r<=n.length;r++){const s=`[${n.slice(0,r).map(J).join("][")}]`;i.push(`${t}${s}`)}return i.join(" && ")}function PF(e,t="datum"){return`${t}[${J(Nr(e).join("."))}]`}function bce(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function ji(e){return`${Nr(e).map(bce).join("\\.")}`}function il(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function X7(e){return`${Nr(e).join(".")}`}function Zu(e){return e?Nr(e).length:0}function Dt(...e){for(const t of e)if(t!==void 0)return t}let BF=42;function jF(e){const t=++BF;return e?String(e)+t:t}function vce(){BF=42}function UF(e){return qF(e)?e:`__${e}`}function qF(e){return e.startsWith("__")}function Ld(e){if(e!==void 0)return(e%360+360)%360}function c1(e){return Xe(e)?!0:!isNaN(e)&&!isNaN(parseFloat(e))}const WF=Object.getPrototypeOf(structuredClone({}));function ki(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor.name!==t.constructor.name)return!1;let n,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(!ki(e[i],t[i]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i of e.entries())if(!t.has(i[0]))return!1;for(i of e.entries())if(!ki(i[1],t.get(i[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i of e.entries())if(!t.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(e[i]!==t[i])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf!==WF.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString!==WF.toString)return e.toString()===t.toString();const r=Object.keys(e);if(n=r.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,r[i]))return!1;for(i=n;i--!==0;){const s=r[i];if(!ki(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function ut(e){const t=[];return function n(i){if(i&&i.toJSON&&typeof i.toJSON=="function"&&(i=i.toJSON()),i===void 0)return;if(typeof i=="number")return isFinite(i)?""+i:"null";if(typeof i!="object")return JSON.stringify(i);let r,s;if(Array.isArray(i)){for(s="[",r=0;rb1(e[t])?_t(`_${t}_${qo(e[t])}`):_t(`_${t}_${e[t]}`)).join("")}function mt(e){return e===!0||al(e)&&!e.binned}function un(e){return e==="binned"||al(e)&&e.binned===!0}function al(e){return ie(e)}function b1(e){return e==null?void 0:e.param}function sD(e){switch(e){case Is:case zs:case js:case si:case is:case rs:case Vo:case Us:case Ho:case Go:case oi:return 6;case Xo:return 4;default:return 10}}function Bd(e){return!!(e!=null&&e.expr)}function li(e){const t=G(e||{}),n={};for(const i of t)n[i]=$i(e[i]);return n}function oD(e){const{anchor:t,frame:n,offset:i,orient:r,angle:s,limit:o,color:a,subtitleColor:l,subtitleFont:u,subtitleFontSize:c,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:h,subtitlePadding:p,...g}=e,m={...g,...a?{fill:a}:{}},y={...t?{anchor:t}:{},...n?{frame:n}:{},...i?{offset:i}:{},...r?{orient:r}:{},...s!==void 0?{angle:s}:{},...o!==void 0?{limit:o}:{}},b={...l?{subtitleColor:l}:{},...u?{subtitleFont:u}:{},...c?{subtitleFontSize:c}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...h?{subtitleLineHeight:h}:{},...p?{subtitlePadding:p}:{}},v=Yu(e,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:m,subtitleMarkConfig:v,nonMarkTitleProperties:y,subtitle:b}}function Ko(e){return te(e)||q(e)&&te(e[0])}function de(e){return!!(e!=null&&e.signal)}function Jo(e){return!!e.step}function qce(e){return q(e)?!1:"fields"in e&&!("data"in e)}function Wce(e){return q(e)?!1:"fields"in e&&"data"in e}function Hs(e){return q(e)?!1:"field"in e&&"data"in e}const Hce=G({aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1}),Gce={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},r_=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function aD(e){const t=q(e.condition)?e.condition.map(lD):lD(e.condition);return{...$i(e),condition:t}}function $i(e){if(Bd(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function lD(e){if(Bd(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function vt(e){if(Bd(e)){const{expr:t,...n}=e;return{signal:t,...n}}return de(e)?e:e!==void 0?{value:e}:void 0}function Vce(e){return de(e)?e.signal:J(e)}function uD(e){return de(e)?e.signal:J(e.value)}function vr(e){return de(e)?e.signal:e==null?null:J(e)}function Xce(e,t,n){for(const i of n){const r=Gs(i,t.markDef,t.config);r!==void 0&&(e[i]=vt(r))}return e}function cD(e){return[].concat(e.type,e.style??[])}function it(e,t,n,i={}){const{vgChannel:r,ignoreVgConfig:s}=i;return r&&t[r]!==void 0?t[r]:t[e]!==void 0?t[e]:s&&(!r||r===e)?void 0:Gs(e,t,n,i)}function Gs(e,t,n,{vgChannel:i}={}){return Dt(i?v1(e,t,n.style):void 0,v1(e,t,n.style),i?n[t.type][i]:void 0,n[t.type][e],i?n.mark[i]:n.mark[e])}function v1(e,t,n){return fD(e,cD(t),n)}function fD(e,t,n){t=ee(t);let i;for(const r of t){const s=n[r];s&&s[e]!==void 0&&(i=s[e])}return i}function dD(e,t){return ee(e).reduce((n,i)=>(n.field.push(Q(i,t)),n.order.push(i.sort??"ascending"),n),{field:[],order:[]})}function hD(e,t){const n=[...e];return t.forEach(i=>{for(const r of n)if(ki(r,i))return;n.push(i)}),n}function pD(e,t){return ki(e,t)||!t?e:e?[...ee(e),...ee(t)].join(", "):t}function gD(e,t){const n=e.value,i=t.value;if(n==null||i===null)return{explicit:e.explicit,value:null};if((Ko(n)||de(n))&&(Ko(i)||de(i)))return{explicit:e.explicit,value:pD(n,i)};if(Ko(n)||de(n))return{explicit:e.explicit,value:n};if(Ko(i)||de(i))return{explicit:e.explicit,value:i};if(!Ko(n)&&!de(n)&&!Ko(i)&&!de(i))return{explicit:e.explicit,value:hD(n,i)};throw new Error("It should never reach here")}function s_(e){return`Invalid specification ${ut(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const Yce='Autosize "fit" only works for single views and layered views.';function mD(e){return`${e=="width"?"Width":"Height"} "container" only works for single views and layered views.`}function yD(e){const t=e=="width"?"Width":"Height",n=e=="width"?"x":"y";return`${t} "container" only works well with autosize "fit" or "fit-${n}".`}function bD(e){return e?`Dropping "fit-${e}" because spec has discrete ${ai(e)}.`:'Dropping "fit" because spec has discrete size.'}function o_(e){return`Unknown field for ${e}. Cannot calculate view size.`}function vD(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function Zce(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function Kce(e){return`The "nearest" transform is not supported for ${e} marks.`}function xD(e){return`Selection not supported for ${e} yet.`}function Jce(e){return`Cannot find a selection named "${e}".`}const Qce="Scale bindings are currently only supported for scales with unbinned, continuous domains.",efe="Legend bindings are only supported for selections over an individual field or encoding channel.";function tfe(e){return`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`}function nfe(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}const ife="The same selection must be used to override scale domains in a layered view.",rfe='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function sfe(e){return`Unknown repeated value "${e}".`}function _D(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const ofe="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function afe(e){return`Unrecognized parse "${e}".`}function wD(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}const lfe="Attempt to add the same child twice.";function ufe(e){return`Ignoring an invalid transform: ${ut(e)}.`}const cfe='If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.';function kD(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function ffe(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${ut(t)} is overridden by a child projection ${ut(n)}.`}const dfe="Arc marks uses theta channel rather than angle, replacing angle with theta.";function hfe(e){return`${e}Offset dropped because ${e} is continuous`}function pfe(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${ut(n)}}.`}function $D(e){return`Invalid field type "${e}".`}function gfe(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function mfe(e){return`Invalid aggregation operator "${e}".`}function ED(e,t){const{fill:n,stroke:i}=t;return`Dropping color ${e} as the plot also has ${n&&i?"fill and stroke":n?"fill":"stroke"}.`}function yfe(e){return`Position range does not support relative band size for ${e}.`}function a_(e,t){return`Dropping ${ut(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}const bfe="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function x1(e,t,n){return`${e} dropped as it is incompatible with "${t}"${n?` when ${n}`:""}.`}function vfe(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function xfe(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function _fe(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function wfe(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function l_(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t==="ordinal"?"order":"magnitude"}.`}function kfe(e){return`The ${e} for range marks cannot be an expression`}function $fe(e,t){return`Line mark is for continuous lines and thus cannot be used with ${e&&t?"x2 and y2":e?"x2":"y2"}. We will use the rule mark (line segments) instead.`}function Efe(e,t){return`Specified orient "${e}" overridden with "${t}".`}function Cfe(e){return`Cannot use the scale property "${e}" with non-color channel.`}function Sfe(e){return`Cannot use the relative band size with ${e} scale.`}function Afe(e){return`Using unaggregated domain with raw field has no effect (${ut(e)}).`}function Tfe(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function Mfe(e){return`Unaggregated domain is currently unsupported for log scale (${ut(e)}).`}function Ffe(e){return`Cannot apply size to non-oriented mark "${e}".`}function Dfe(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function Nfe(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function CD(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function SD(e){return`The step for "${e}" is dropped because the ${e==="width"?"x":"y"} is continuous.`}function Ofe(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${ut(n)} and ${ut(i)}). Using ${ut(n)}.`}function Rfe(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${ut(n)} and ${ut(i)}). Using the union of the two domains.`}function Lfe(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}function Ife(e){return`Dropping sort property ${ut(e)} as unioned domains only support boolean or op "count", "min", and "max".`}const AD="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",zfe="Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.",Pfe="Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect.",Bfe="Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.";function jfe(e){return`Cannot stack "${e}" if there is already "${e}2".`}function Ufe(e){return`Cannot stack non-linear scale (${e}).`}function qfe(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function _1(e,t){return`Invalid ${e}: ${ut(t)}.`}function Wfe(e){return`Dropping day from datetime ${ut(e)} as day cannot be combined with other units.`}function Hfe(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function Gfe(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function Vfe(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function TD(e){return`1D error band does not support ${e}.`}function MD(e){return`Channel ${e} is required for "binned" bin.`}function Xfe(e){return`Channel ${e} should not be used with "binned" bin.`}function Yfe(e){return`Domain for ${e} is required for threshold scale.`}const FD=o2(s2);let ec=FD;function Zfe(e){return ec=e,ec}function Kfe(){return ec=FD,ec}function Y(...e){ec.warn(...e)}function Jfe(...e){ec.debug(...e)}function ll(e){if(e&&ie(e)){for(const t of c_)if(t in e)return!0}return!1}const DD=["january","february","march","april","may","june","july","august","september","october","november","december"],Qfe=DD.map(e=>e.substr(0,3)),ND=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],ede=ND.map(e=>e.substr(0,3));function tde(e){if(c1(e)&&(e=+e),Xe(e))return e>4&&Y(_1("quarter",e)),e-1;throw new Error(_1("quarter",e))}function nde(e){if(c1(e)&&(e=+e),Xe(e))return e-1;{const t=e.toLowerCase(),n=DD.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=Qfe.indexOf(i);if(r!==-1)return r;throw new Error(_1("month",e))}}function ide(e){if(c1(e)&&(e=+e),Xe(e))return e%7;{const t=e.toLowerCase(),n=ND.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=ede.indexOf(i);if(r!==-1)return r;throw new Error(_1("day",e))}}function u_(e,t){const n=[];if(t&&e.day!==void 0&&G(e).length>1&&(Y(Wfe(e)),e=Ce(e),delete e.day),e.year!==void 0?n.push(e.year):n.push(2012),e.month!==void 0){const i=t?nde(e.month):e.month;n.push(i)}else if(e.quarter!==void 0){const i=t?tde(e.quarter):e.quarter;n.push(Xe(i)?i*3:`${i}*3`)}else n.push(0);if(e.date!==void 0)n.push(e.date);else if(e.day!==void 0){const i=t?ide(e.day):e.day;n.push(Xe(i)?i+1:`${i}+1`)}else n.push(1);for(const i of["hours","minutes","seconds","milliseconds"]){const r=e[i];n.push(typeof r>"u"?0:r)}return n}function ul(e){const n=u_(e,!0).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function rde(e){const n=u_(e,!1).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function sde(e){const t=u_(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}const OD={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},c_=G(OD);function ode(e){return!!OD[e]}function cl(e){return ie(e)?e.binned:RD(e)}function RD(e){return e&&e.startsWith("binned")}function f_(e){return e.startsWith("utc")}function ade(e){return e.substring(3)}const lde={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function w1(e){return c_.filter(t=>ID(e,t))}function LD(e){const t=w1(e);return t[t.length-1]}function ID(e,t){const n=e.indexOf(t);return!(n<0||n>0&&t==="seconds"&&e.charAt(n-1)==="i"||e.length>n+3&&t==="day"&&e.charAt(n+3)==="o"||n>0&&t==="year"&&e.charAt(n-1)==="f")}function ude(e,t,{end:n}={end:!1}){const i=V7(t),r=f_(e)?"utc":"";function s(l){return l==="quarter"?`(${r}quarter(${i})-1)`:`${r}${l}(${i})`}let o;const a={};for(const l of c_)ID(e,l)&&(a[l]=s(l),o=l);return n&&(a[o]+="+1"),rde(a)}function zD(e){if(!e)return;const t=w1(e);return`timeUnitSpecifier(${ut(t)}, ${ut(lde)})`}function cde(e,t,n){if(!e)return;const i=zD(e);return`${n||f_(e)?"utc":"time"}Format(${t}, ${i})`}function Kt(e){if(!e)return;let t;return te(e)?RD(e)?t={unit:e.substring(6),binned:!0}:t={unit:e}:ie(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),f_(t.unit)&&(t.utc=!0,t.unit=ade(t.unit)),t}function fde(e){const{utc:t,...n}=Kt(e);return n.unit?(t?"utc":"")+G(n).map(i=>_t(`${i==="unit"?"":`_${i}_`}${n[i]}`)).join(""):(t?"utc":"")+"timeunit"+G(n).map(i=>_t(`_${i}_${n[i]}`)).join("")}function PD(e,t=n=>n){const n=Kt(e),i=LD(n.unit);if(i&&i!=="day"){const r={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:s,part:o}=BD(i,n.step),a={...r,[o]:+r[o]+s};return`${t(ul(a))} - ${t(ul(r))}`}}const dde={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function hde(e){return!!dde[e]}function BD(e,t=1){if(hde(e))return{part:e,step:t};switch(e){case"day":case"dayofyear":return{part:"date",step:t};case"quarter":return{part:"month",step:t*3};case"week":return{part:"date",step:t*7}}}function pde(e){return e==null?void 0:e.param}function d_(e){return!!(e!=null&&e.field)&&e.equal!==void 0}function h_(e){return!!(e!=null&&e.field)&&e.lt!==void 0}function p_(e){return!!(e!=null&&e.field)&&e.lte!==void 0}function g_(e){return!!(e!=null&&e.field)&&e.gt!==void 0}function m_(e){return!!(e!=null&&e.field)&&e.gte!==void 0}function y_(e){if(e!=null&&e.field){if(q(e.range)&&e.range.length===2)return!0;if(de(e.range))return!0}return!1}function b_(e){return!!(e!=null&&e.field)&&(q(e.oneOf)||q(e.in))}function gde(e){return!!(e!=null&&e.field)&&e.valid!==void 0}function jD(e){return b_(e)||d_(e)||y_(e)||h_(e)||g_(e)||p_(e)||m_(e)}function as(e,t){return z1(e,{timeUnit:t,wrapTime:!0})}function mde(e,t){return e.map(n=>as(n,t))}function UD(e,t=!0){const{field:n}=e,i=Kt(e.timeUnit),{unit:r,binned:s}=i||{},o=Q(e,{expr:"datum"}),a=r?`time(${s?o:ude(r,n)})`:o;if(d_(e))return`${a}===${as(e.equal,r)}`;if(h_(e)){const l=e.lt;return`${a}<${as(l,r)}`}else if(g_(e)){const l=e.gt;return`${a}>${as(l,r)}`}else if(p_(e)){const l=e.lte;return`${a}<=${as(l,r)}`}else if(m_(e)){const l=e.gte;return`${a}>=${as(l,r)}`}else{if(b_(e))return`indexof([${mde(e.oneOf,r).join(",")}], ${a}) !== -1`;if(gde(e))return v_(a,e.valid);if(y_(e)){const{range:l}=e,u=de(l)?{signal:`${l.signal}[0]`}:l[0],c=de(l)?{signal:`${l.signal}[1]`}:l[1];if(u!==null&&c!==null&&t)return"inrange("+a+", ["+as(u,r)+", "+as(c,r)+"])";const f=[];return u!==null&&f.push(`${a} >= ${as(u,r)}`),c!==null&&f.push(`${a} <= ${as(c,r)}`),f.length>0?f.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${ut(e)}`)}function v_(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function yde(e){return jD(e)&&e.timeUnit?{...e,timeUnit:Kt(e.timeUnit)}:e}const jd={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function bde(e){return e==="quantitative"||e==="temporal"}function qD(e){return e==="ordinal"||e==="nominal"}const fl=jd.quantitative,x_=jd.ordinal,tc=jd.temporal,__=jd.nominal,nc=jd.geojson;function vde(e){if(e)switch(e=e.toLowerCase(),e){case"q":case fl:return"quantitative";case"t":case tc:return"temporal";case"o":case x_:return"ordinal";case"n":case __:return"nominal";case nc:return"geojson"}}const ui={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",SYMLOG:"symlog",IDENTITY:"identity",SEQUENTIAL:"sequential",TIME:"time",UTC:"utc",QUANTILE:"quantile",QUANTIZE:"quantize",THRESHOLD:"threshold",BIN_ORDINAL:"bin-ordinal",ORDINAL:"ordinal",POINT:"point",BAND:"band"},w_={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function xde(e,t){const n=w_[e],i=w_[t];return n===i||n==="ordinal-position"&&i==="time"||i==="ordinal-position"&&n==="time"}const _de={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function WD(e){return _de[e]}const HD=new Set(["linear","log","pow","sqrt","symlog"]),GD=new Set([...HD,"time","utc"]);function VD(e){return HD.has(e)}const XD=new Set(["quantile","quantize","threshold"]),wde=new Set([...GD,...XD,"sequential","identity"]),kde=new Set(["ordinal","bin-ordinal","point","band"]);function Jt(e){return kde.has(e)}function Ei(e){return wde.has(e)}function xr(e){return GD.has(e)}function ic(e){return XD.has(e)}const $de={pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:9,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0};function Ede(e){return!te(e)&&!!e.name}function YD(e){return e==null?void 0:e.param}function Cde(e){return e==null?void 0:e.unionWith}function Sde(e){return ie(e)&&"field"in e}const Ade={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,domainRaw:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},{type:fxe,domain:dxe,range:hxe,rangeMax:pxe,rangeMin:gxe,scheme:mxe,...Tde}=Ade,Mde=G(Tde);function k_(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!["point","band","identity"].includes(e);case"bins":return!["point","band","identity","ordinal"].includes(e);case"round":return xr(e)||e==="band"||e==="point";case"padding":case"rangeMin":case"rangeMax":return xr(e)||["point","band"].includes(e);case"paddingOuter":case"align":return["point","band"].includes(e);case"paddingInner":return e==="band";case"domainMax":case"domainMid":case"domainMin":case"domainRaw":case"clamp":return xr(e);case"nice":return xr(e)||e==="quantize"||e==="threshold";case"exponent":return e==="pow";case"base":return e==="log";case"constant":return e==="symlog";case"zero":return Ei(e)&&!Pe(["log","time","utc","threshold","quantile"],e)}}function ZD(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return Qu(e)?void 0:Cfe(t);case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"domainRaw":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeMax":case"rangeMin":case"reverse":case"round":case"clamp":case"zero":return}}function Fde(e,t){return Pe([x_,__],t)?e===void 0||Jt(e):t===tc?Pe([ui.TIME,ui.UTC,void 0],e):t===fl?VD(e)||ic(e)||e===void 0:!0}function Dde(e,t,n=!1){if(!qs(e))return!1;switch(e){case wt:case Zt:case Wo:case Ku:case Ui:case gr:return xr(t)||t==="band"?!0:t==="point"?!n:!1;case js:case Vo:case Us:case Ho:case Go:case rl:return xr(t)||ic(t)||Pe(["band","point","ordinal"],t);case si:case is:case rs:return t!=="band";case Xo:case oi:return t==="ordinal"||ic(t)}}const jn={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},KD=jn.arc,k1=jn.area,$1=jn.bar,Nde=jn.image,E1=jn.line,C1=jn.point,Ode=jn.rect,S1=jn.rule,JD=jn.text,$_=jn.tick,Rde=jn.trail,E_=jn.circle,C_=jn.square,QD=jn.geoshape;function Qo(e){return["line","area","trail"].includes(e)}function Ud(e){return["rect","bar","image","arc"].includes(e)}const Lde=new Set(G(jn));function ls(e){return e.type}const Ide=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],zde=["fill","fillOpacity"],Pde=[...Ide,...zde],eN=G({color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1}),Bde={area:["line","point"],bar:["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],rect:["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],line:["point"],tick:["bandSize","thickness"]},jde={color:"#4c78a8",invalid:"filter",timeUnitBandSize:1},tN=G({mark:1,arc:1,area:1,bar:1,circle:1,image:1,line:1,point:1,rect:1,rule:1,square:1,text:1,tick:1,trail:1,geoshape:1});function dl(e){return e&&e.band!=null}const Ude={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},nN=5,qde={binSpacing:1,continuousBandSize:nN,minBandSize:.25,timeUnitBandPosition:.5},Wde={binSpacing:0,continuousBandSize:nN,minBandSize:.25,timeUnitBandPosition:.5},Hde={thickness:1};function Gde(e){return ls(e)?e.type:e}function S_(e){const{channel:t,channelDef:n,markDef:i,scale:r,config:s}=e,o=T_(e);return Z(n)&&!iD(n.aggregate)&&r&&xr(r.get("type"))?Vde({fieldDef:n,channel:t,markDef:i,ref:o,config:s}):o}function Vde({fieldDef:e,channel:t,markDef:n,ref:i,config:r}){return Qo(n.type)?i:it("invalid",n,r)===null?[Xde(e,t),i]:i}function Xde(e,t){const n=A_(e,!0),r=ol(t)==="y"?{field:{group:"height"}}:{value:0};return{test:n,...r}}function A_(e,t=!0){return v_(te(e)?e:Q(e,{expr:"datum"}),!t)}function Yde(e){const{datum:t}=e;return ll(t)?ul(t):`${ut(t)}`}function hl(e,t,n,i){const r={};if(t&&(r.scale=t),cs(e)){const{datum:s}=e;ll(s)?r.signal=ul(s):de(s)?r.signal=s.signal:Bd(s)?r.signal=s.expr:r.value=s}else r.field=Q(e,n);if(i){const{offset:s,band:o}=i;s&&(r.offset=s),o&&(r.band=o)}return r}function A1({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:i,startSuffix:r,endSuffix:s="end",bandPosition:o=.5}){const a=!de(o)&&0{switch(t.fieldTitle){case"plain":return e.field;case"functional":return uhe(e);default:return lhe(e,t)}};let xN=vN;function _N(e){xN=e}function che(){_N(vN)}function oc(e,t,{allowDisabling:n,includeDefault:i=!0}){var a;const r=(a=O_(e))==null?void 0:a.title;if(!Z(e))return r??e.title;const s=e,o=i?R_(s,t):void 0;return n?Dt(r,s.title,o):r??s.title??o}function O_(e){if(sc(e)&&e.axis)return e.axis;if(yN(e)&&e.legend)return e.legend;if(D_(e)&&e.header)return e.header}function R_(e,t){return xN(e,t)}function R1(e){if(bN(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}else{const t=O_(e)??{},{format:n,formatType:i}=t;return{format:n,formatType:i}}}function fhe(e,t){var s;switch(t){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(N_(e)&&q(e.sort))return"ordinal";const{aggregate:n,bin:i,timeUnit:r}=e;if(r)return"temporal";if(i||n&&!Zo(n)&&!Ws(n))return"quantitative";if(gl(e)&&((s=e.scale)!=null&&s.type))switch(w_[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function fs(e){if(Z(e))return e;if(D1(e))return e.condition}function Ut(e){if(Se(e))return e;if(Gd(e))return e.condition}function wN(e,t,n,i={}){if(te(e)||Xe(e)||ro(e)){const r=te(e)?"string":Xe(e)?"number":"boolean";return Y(pfe(t,r,e)),{value:e}}return Se(e)?L1(e,t,n,i):Gd(e)?{...e,condition:L1(e.condition,t,n,i)}:e}function L1(e,t,n,i){if(bN(e)){const{format:r,formatType:s,...o}=e;if(pl(s)&&!n.customFormatTypes)return Y(kD(t)),L1(o,t,n,i)}else{const r=sc(e)?"axis":yN(e)?"legend":D_(e)?"header":null;if(r&&e[r]){const{format:s,formatType:o,...a}=e[r];if(pl(o)&&!n.customFormatTypes)return Y(kD(t)),L1({...e,[r]:a},t,n,i)}}return Z(e)?L_(e,t,i):dhe(e)}function dhe(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=Xe(n)?"quantitative":te(n)?"nominal":ll(n)?"temporal":void 0,{...e,type:t}}function L_(e,t,{compositeMark:n=!1}={}){const{aggregate:i,timeUnit:r,bin:s,field:o}=e,a={...e};if(!n&&i&&!i_(i)&&!Zo(i)&&!Ws(i)&&(Y(mfe(i)),delete a.aggregate),r&&(a.timeUnit=Kt(r)),o&&(a.field=`${o}`),mt(s)&&(a.bin=I1(s,t)),un(s)&&!Nt(t)&&Y(Xfe(t)),Un(a)){const{type:l}=a,u=vde(l);l!==u&&(a.type=u),l!=="quantitative"&&iD(i)&&(Y(gfe(l,i)),a.type="quantitative")}else if(!KF(t)){const l=fhe(a,t);a.type=l}if(Un(a)){const{compatible:l,warning:u}=hhe(a,t)||{};l===!1&&Y(u)}if(N_(a)&&te(a.sort)){const{sort:l}=a;if(uN(l))return{...a,sort:{encoding:l}};const u=l.substr(1);if(l.charAt(0)==="-"&&uN(u))return{...a,sort:{encoding:u,order:"descending"}}}if(D_(a)){const{header:l}=a;if(l){const{orient:u,...c}=l;if(u)return{...a,header:{...c,labelOrient:l.labelOrient||u,titleOrient:l.titleOrient||u}}}}return a}function I1(e,t){return ro(e)?{maxbins:sD(t)}:e==="binned"?{binned:!0}:!e.maxbins&&!e.step?{...e,maxbins:sD(t)}:e}const ac={compatible:!0};function hhe(e,t){const n=e.type;if(n==="geojson"&&t!=="shape")return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case Is:case zs:case f1:return O1(e)?ac:{compatible:!1,warning:xfe(t)};case wt:case Zt:case Wo:case Ku:case si:case is:case rs:case Id:case zd:case d1:case sl:case h1:case p1:case rl:case Ui:case gr:case g1:return ac;case yr:case qi:case mr:case br:return n!==fl?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:ac;case Us:case Ho:case Go:case Vo:case js:case Bs:case Ps:case pr:case ns:return n==="nominal"&&!e.sort?{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`}:ac;case oi:case Xo:return!O1(e)&&!ohe(e)?{compatible:!1,warning:_fe(t)}:ac;case Ju:return e.type==="nominal"&&!("sort"in e)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:ac}}function lc(e){const{formatType:t}=R1(e);return t==="time"||!t&&phe(e)}function phe(e){return e&&(e.type==="temporal"||Z(e)&&!!e.timeUnit)}function z1(e,{timeUnit:t,type:n,wrapTime:i,undefinedIfExprNotRequired:r}){var l;const s=t&&((l=Kt(t))==null?void 0:l.unit);let o=s||n==="temporal",a;return Bd(e)?a=e.expr:de(e)?a=e.signal:ll(e)?(o=!0,a=ul(e)):(te(e)||Xe(e))&&o&&(a=`datetime(${ut(e)})`,ode(s)&&(Xe(e)&&e<1e4||te(e)&&isNaN(Date.parse(e)))&&(a=ul({[s]:e}))),a?i&&o?`time(${a})`:a:r?void 0:ut(e)}function kN(e,t){const{type:n}=e;return t.map(i=>{const r=Z(e)&&!cl(e.timeUnit)?e.timeUnit:void 0,s=z1(i,{timeUnit:r,type:n,undefinedIfExprNotRequired:!0});return s!==void 0?{signal:s}:i})}function Vd(e,t){return mt(e.bin)?qs(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}const $N={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function Xd(e){return e==null?void 0:e.condition}const EN=["domain","grid","labels","ticks","title"],ghe={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"both",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},CN={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},mhe={...CN,style:1,labelExpr:1,encoding:1};function SN(e){return!!mhe[e]}const AN=G({axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1});function Vs(e){return"mark"in e}class P1{constructor(t,n){this.name=t,this.run=n}hasMatchingType(t){return Vs(t)?Gde(t.mark)===this.name:!1}}function ml(e,t){const n=e&&e[t];return n?q(n)?nl(n,i=>!!i.field):Z(n)||D1(n):!1}function TN(e,t){const n=e&&e[t];return n?q(n)?nl(n,i=>!!i.field):Z(n)||cs(n)||Gd(n):!1}function MN(e,t){if(Nt(t)){const n=e[t];if((Z(n)||cs(n))&&(qD(n.type)||Z(n)&&n.timeUnit)){const i=J7(t);return TN(e,i)}}return!1}function I_(e){return nl(wce,t=>{if(ml(e,t)){const n=e[t];if(q(n))return nl(n,i=>!!i.aggregate);{const i=fs(n);return i&&!!i.aggregate}}return!1})}function FN(e,t){const n=[],i=[],r=[],s=[],o={};return z_(e,(a,l)=>{if(Z(a)){const{field:u,aggregate:c,bin:f,timeUnit:d,...h}=a;if(c||d||f){const p=O_(a),g=p==null?void 0:p.title;let m=Q(a,{forAs:!0});const y={...g?[]:{title:oc(a,t,{allowDisabling:!0})},...h,field:m};if(c){let b;if(Zo(c)?(b="argmax",m=Q({op:"argmax",field:c.argmax},{forAs:!0}),y.field=`${m}.${u}`):Ws(c)?(b="argmin",m=Q({op:"argmin",field:c.argmin},{forAs:!0}),y.field=`${m}.${u}`):c!=="boxplot"&&c!=="errorbar"&&c!=="errorband"&&(b=c),b){const v={op:b,as:m};u&&(v.field=u),s.push(v)}}else if(n.push(m),Un(a)&&mt(f)){if(i.push({bin:f,field:u,as:m}),n.push(Q(a,{binSuffix:"end"})),Vd(a,l)&&n.push(Q(a,{binSuffix:"range"})),Nt(l)){const b={field:`${m}_end`};o[`${l}2`]=b}y.bin="binned",KF(l)||(y.type=fl)}else if(d&&!cl(d)){r.push({timeUnit:d,field:u,as:m});const b=Un(a)&&a.type!==tc&&"time";b&&(l===Id||l===sl?y.formatType=b:Dce(l)?y.legend={formatType:b,...y.legend}:Nt(l)&&(y.axis={formatType:b,...y.axis}))}o[l]=y}else n.push(u),o[l]=e[l]}else o[l]=e[l]}),{bins:i,timeUnits:r,aggregate:s,groupby:n,encoding:o}}function yhe(e,t,n){const i=Oce(t,n);if(i){if(i==="binned"){const r=e[t===pr?wt:Zt];return!!(Z(r)&&Z(e[t])&&un(r.bin))}}else return!1;return!0}function bhe(e,t,n,i){const r={};for(const s of G(e))ZF(s)||Y(vfe(s));for(let s of Ace){if(!e[s])continue;const o=e[s];if(Pd(s)){const a=Sce(s),l=r[a];if(Z(l)&&bde(l.type)&&Z(o)&&!l.timeUnit){Y(hfe(a));continue}}if(s==="angle"&&t==="arc"&&!e.theta&&(Y(dfe),s=Ui),!yhe(e,s,t)){Y(x1(s,t));continue}if(s===js&&t==="line"){const a=fs(e[s]);if(a!=null&&a.aggregate){Y(bfe);continue}}if(s===si&&(n?"fill"in e:"stroke"in e)){Y(ED("encoding",{fill:"fill"in e,stroke:"stroke"in e}));continue}if(s===zd||s===Ju&&!q(o)&&!wr(o)||s===sl&&q(o)){if(o){if(s===Ju){const a=e[s];if(gN(a)){r[s]=a;continue}}r[s]=ee(o).reduce((a,l)=>(Z(l)?a.push(L_(l,s)):Y(a_(l,s)),a),[])}}else{if(s===sl&&o===null)r[s]=null;else if(!Z(o)&&!cs(o)&&!wr(o)&&!F1(o)&&!de(o)){Y(a_(o,s));continue}r[s]=wN(o,s,i)}}return r}function B1(e,t){const n={};for(const i of G(e)){const r=wN(e[i],i,t,{compositeMark:!0});n[i]=r}return n}function vhe(e){const t=[];for(const n of G(e))if(ml(e,n)){const i=e[n],r=ee(i);for(const s of r)Z(s)?t.push(s):D1(s)&&t.push(s.condition)}return t}function z_(e,t,n){if(e)for(const i of G(e)){const r=e[i];if(q(r))for(const s of r)t.call(n,s,i);else t.call(n,r,i)}}function xhe(e,t,n,i){return e?G(e).reduce((r,s)=>{const o=e[s];return q(o)?o.reduce((a,l)=>t.call(i,a,l,s),r):t.call(i,r,o,s)},n):n}function DN(e,t){return G(t).reduce((n,i)=>{switch(i){case wt:case Zt:case h1:case g1:case p1:case pr:case ns:case Wo:case Ku:case Ui:case Bs:case gr:case Ps:case mr:case yr:case br:case qi:case Id:case oi:case rl:case sl:return n;case Ju:if(e==="line"||e==="trail")return n;case zd:case d1:{const r=t[i];if(q(r)||Z(r))for(const s of ee(r))s.aggregate||n.push(Q(s,{}));return n}case js:if(e==="trail")return n;case si:case is:case rs:case Us:case Ho:case Go:case Xo:case Vo:{const r=fs(t[i]);return r&&!r.aggregate&&n.push(Q(r,{})),n}}},[])}function _he(e){const{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let i,r;if(q(t)){for(const s of t)s.aggregate?(i||(i=[]),i.push(s)):(r||(r=[]),r.push(s));i&&(n.tooltip=i)}else t.aggregate?n.tooltip=t:r=t;return q(r)&&r.length===1&&(r=r[0]),{customTooltipWithoutAggregatedField:r,filteredEncoding:n}}function P_(e,t,n,i=!0){if("tooltip"in n)return{tooltip:n.tooltip};const r=e.map(({fieldPrefix:o,titlePrefix:a})=>{const l=i?` of ${B_(t)}`:"";return{field:o+t.field,type:t.type,title:de(a)?{signal:`${a}"${escape(l)}"`}:a+l}}),s=vhe(n).map(rhe);return{tooltip:[...r,...ts(s,ze)]}}function B_(e){const{title:t,field:n}=e;return Dt(t,n)}function j_(e,t,n,i,r){const{scale:s,axis:o}=n;return({partName:a,mark:l,positionPrefix:u,endPositionPrefix:c=void 0,extraEncoding:f={}})=>{const d=B_(n);return NN(e,a,r,{mark:l,encoding:{[t]:{field:`${u}_${n.field}`,type:n.type,...d!==void 0?{title:d}:{},...s!==void 0?{scale:s}:{},...o!==void 0?{axis:o}:{}},...te(c)?{[`${t}2`]:{field:`${c}_${n.field}`}}:{},...i,...f}})}}function NN(e,t,n,i){const{clip:r,color:s,opacity:o}=e,a=e.type;return e[t]||e[t]===void 0&&n[t]?[{...i,mark:{...n[t],...r?{clip:r}:{},...s?{color:s}:{},...o?{opacity:o}:{},...ls(i.mark)?i.mark:{type:i.mark},style:`${a}-${String(t)}`,...ro(e[t])?{}:e[t]}}]:[]}function ON(e,t,n){const{encoding:i}=e,r=t==="vertical"?"y":"x",s=i[r],o=i[`${r}2`],a=i[`${r}Error`],l=i[`${r}Error2`];return{continuousAxisChannelDef:j1(s,n),continuousAxisChannelDef2:j1(o,n),continuousAxisChannelDefError:j1(a,n),continuousAxisChannelDefError2:j1(l,n),continuousAxis:r}}function j1(e,t){if(e!=null&&e.aggregate){const{aggregate:n,...i}=e;return n!==t&&Y(Vfe(n,t)),i}else return e}function RN(e,t){const{mark:n,encoding:i}=e,{x:r,y:s}=i;if(ls(n)&&n.orient)return n.orient;if(ta(r)){if(ta(s)){const o=Z(r)&&r.aggregate,a=Z(s)&&s.aggregate;if(!o&&a===t)return"vertical";if(!a&&o===t)return"horizontal";if(o===t&&a===t)throw new Error("Both x and y cannot have aggregate");return lc(s)&&!lc(r)?"horizontal":"vertical"}return"horizontal"}else{if(ta(s))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}}const U1="boxplot",whe=["box","median","outliers","rule","ticks"],khe=new P1(U1,IN);function LN(e){return Xe(e)?"tukey":e}function IN(e,{config:t}){e={...e,encoding:B1(e.encoding,t)};const{mark:n,encoding:i,params:r,projection:s,...o}=e,a=ls(n)?n:{type:n};r&&Y(xD("boxplot"));const l=a.extent??t.boxplot.extent,u=it("size",a,t),c=a.invalid,f=LN(l),{bins:d,timeUnits:h,transform:p,continuousAxisChannelDef:g,continuousAxis:m,groupby:y,aggregate:b,encodingWithoutContinuousAxis:v,ticksOrient:x,boxOrient:_,customTooltipWithoutAggregatedField:k}=$he(e,l,t),{color:w,size:$,...S}=v,E=Hn=>j_(a,m,g,Hn,t.boxplot),A=E(S),R=E(v),C=E({...S,...$?{size:$}:{}}),M=P_([{fieldPrefix:f==="min-max"?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:f==="min-max"?"lower_whisker_":"min_",titlePrefix:"Min"}],g,v),T={type:"tick",color:"black",opacity:1,orient:x,invalid:c,aria:!1},O=f==="min-max"?M:P_([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],g,v),P=[...A({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:O}),...A({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:O}),...A({partName:"ticks",mark:T,positionPrefix:"lower_whisker",extraEncoding:O}),...A({partName:"ticks",mark:T,positionPrefix:"upper_whisker",extraEncoding:O})],j=[...f!=="tukey"?P:[],...R({partName:"box",mark:{type:"bar",...u?{size:u}:{},orient:_,invalid:c,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:M}),...C({partName:"median",mark:{type:"tick",invalid:c,...ie(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{},...u?{size:u}:{},orient:x,aria:!1},positionPrefix:"mid_box",extraEncoding:M})];if(f==="min-max")return{...o,transform:(o.transform??[]).concat(p),layer:j};const W=`datum["lower_box_${g.field}"]`,ne=`datum["upper_box_${g.field}"]`,ae=`(${ne} - ${W})`,ke=`${W} - ${l} * ${ae}`,Ie=`${ne} + ${l} * ${ae}`,Le=`datum["${g.field}"]`,We={joinaggregate:zN(g.field),groupby:y},Wn={transform:[{filter:`(${ke} <= ${Le}) && (${Le} <= ${Ie})`},{aggregate:[{op:"min",field:g.field,as:`lower_whisker_${g.field}`},{op:"max",field:g.field,as:`upper_whisker_${g.field}`},{op:"min",field:`lower_box_${g.field}`,as:`lower_box_${g.field}`},{op:"max",field:`upper_box_${g.field}`,as:`upper_box_${g.field}`},...b],groupby:y}],layer:P},{tooltip:Mr,...Vi}=S,{scale:se,axis:Te}=g,De=B_(g),V=ri(Te,["title"]),qt=NN(a,"outliers",t.boxplot,{transform:[{filter:`(${Le} < ${ke}) || (${Le} > ${Ie})`}],mark:"point",encoding:{[m]:{field:g.field,type:g.type,...De!==void 0?{title:De}:{},...se!==void 0?{scale:se}:{},...lt(V)?{}:{axis:V}},...Vi,...w?{color:w}:{},...k?{tooltip:k}:{}}})[0];let He;const Cn=[...d,...h,We];return qt?He={transform:Cn,layer:[qt,Wn]}:(He=Wn,He.transform.unshift(...Cn)),{...o,layer:[He,{transform:p,layer:j}]}}function zN(e){return[{op:"q1",field:e,as:`lower_box_${e}`},{op:"q3",field:e,as:`upper_box_${e}`}]}function $he(e,t,n){const i=RN(e,U1),{continuousAxisChannelDef:r,continuousAxis:s}=ON(e,i,U1),o=r.field,a=LN(t),l=[...zN(o),{op:"median",field:o,as:`mid_box_${o}`},{op:"min",field:o,as:(a==="min-max"?"lower_whisker_":"min_")+o},{op:"max",field:o,as:(a==="min-max"?"upper_whisker_":"max_")+o}],u=a==="min-max"||a==="tukey"?[]:[{calculate:`datum["upper_box_${o}"] - datum["lower_box_${o}"]`,as:`iqr_${o}`},{calculate:`min(datum["upper_box_${o}"] + datum["iqr_${o}"] * ${t}, datum["max_${o}"])`,as:`upper_whisker_${o}`},{calculate:`max(datum["lower_box_${o}"] - datum["iqr_${o}"] * ${t}, datum["min_${o}"])`,as:`lower_whisker_${o}`}],{[s]:c,...f}=e.encoding,{customTooltipWithoutAggregatedField:d,filteredEncoding:h}=_he(f),{bins:p,timeUnits:g,aggregate:m,groupby:y,encoding:b}=FN(h,n),v=i==="vertical"?"horizontal":"vertical",x=i,_=[...p,...g,{aggregate:[...m,...l],groupby:y},...u];return{bins:p,timeUnits:g,transform:_,groupby:y,aggregate:m,continuousAxisChannelDef:r,continuousAxis:s,encodingWithoutContinuousAxis:b,ticksOrient:v,boxOrient:x,customTooltipWithoutAggregatedField:d}}const U_="errorbar",Ehe=["ticks","rule"],Che=new P1(U_,PN);function PN(e,{config:t}){e={...e,encoding:B1(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,ticksOrient:o,markDef:a,outerSpec:l,tooltipEncoding:u}=BN(e,U_,t);delete s.size;const c=j_(a,r,i,s,t.errorbar),f=a.thickness,d=a.size,h={type:"tick",orient:o,aria:!1,...f!==void 0?{thickness:f}:{},...d!==void 0?{size:d}:{}},p=[...c({partName:"ticks",mark:h,positionPrefix:"lower",extraEncoding:u}),...c({partName:"ticks",mark:h,positionPrefix:"upper",extraEncoding:u}),...c({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...f!==void 0?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u})];return{...l,transform:n,...p.length>1?{layer:p}:{...p[0]}}}function She(e,t){const{encoding:n}=e;if(Ahe(n))return{orient:RN(e,t),inputType:"raw"};const i=The(n),r=Mhe(n),s=n.x,o=n.y;if(i){if(r)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const a=n.x2,l=n.y2;if(Se(a)&&Se(l))throw new Error(`${t} cannot have both x2 and y2`);if(Se(a)){if(ta(s))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}else if(Se(l)){if(ta(o))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${t}`)}throw new Error("No ranged axis")}else{const a=n.xError,l=n.xError2,u=n.yError,c=n.yError2;if(Se(l)&&!Se(a))throw new Error(`${t} cannot have xError2 without xError`);if(Se(c)&&!Se(u))throw new Error(`${t} cannot have yError2 without yError`);if(Se(a)&&Se(u))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(Se(a)){if(ta(s))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(Se(u)){if(ta(o))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function Ahe(e){return(Se(e.x)||Se(e.y))&&!Se(e.x2)&&!Se(e.y2)&&!Se(e.xError)&&!Se(e.xError2)&&!Se(e.yError)&&!Se(e.yError2)}function The(e){return Se(e.x2)||Se(e.y2)}function Mhe(e){return Se(e.xError)||Se(e.xError2)||Se(e.yError)||Se(e.yError2)}function BN(e,t,n){const{mark:i,encoding:r,params:s,projection:o,...a}=e,l=ls(i)?i:{type:i};s&&Y(xD(t));const{orient:u,inputType:c}=She(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:h,continuousAxisChannelDefError2:p,continuousAxis:g}=ON(e,u,t),{errorBarSpecificAggregate:m,postAggregateCalculates:y,tooltipSummary:b,tooltipTitleWithFieldName:v}=Fhe(l,f,d,h,p,c,t,n),{[g]:x,[g==="x"?"x2":"y2"]:_,[g==="x"?"xError":"yError"]:k,[g==="x"?"xError2":"yError2"]:w,...$}=r,{bins:S,timeUnits:E,aggregate:A,groupby:R,encoding:C}=FN($,n),M=[...A,...m],T=c!=="raw"?[]:R,O=P_(b,f,C,v);return{transform:[...a.transform??[],...S,...E,...M.length===0?[]:[{aggregate:M,groupby:T}],...y],groupby:T,continuousAxisChannelDef:f,continuousAxis:g,encodingWithoutContinuousAxis:C,ticksOrient:u==="vertical"?"horizontal":"vertical",markDef:l,outerSpec:a,tooltipEncoding:O}}function Fhe(e,t,n,i,r,s,o,a){let l=[],u=[];const c=t.field;let f,d=!1;if(s==="raw"){const h=e.center?e.center:e.extent?e.extent==="iqr"?"median":"mean":a.errorbar.center,p=e.extent?e.extent:h==="mean"?"stderr":"iqr";if(h==="median"!=(p==="iqr")&&Y(Gfe(h,p,o)),p==="stderr"||p==="stdev")l=[{op:p,field:c,as:`extent_${c}`},{op:h,field:c,as:`center_${c}`}],u=[{calculate:`datum["center_${c}"] + datum["extent_${c}"]`,as:`upper_${c}`},{calculate:`datum["center_${c}"] - datum["extent_${c}"]`,as:`lower_${c}`}],f=[{fieldPrefix:"center_",titlePrefix:Rd(h)},{fieldPrefix:"upper_",titlePrefix:jN(h,p,"+")},{fieldPrefix:"lower_",titlePrefix:jN(h,p,"-")}],d=!0;else{let g,m,y;p==="ci"?(g="mean",m="ci0",y="ci1"):(g="median",m="q1",y="q3"),l=[{op:m,field:c,as:`lower_${c}`},{op:y,field:c,as:`upper_${c}`},{op:g,field:c,as:`center_${c}`}],f=[{fieldPrefix:"upper_",titlePrefix:oc({field:c,aggregate:y,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:oc({field:c,aggregate:m,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:oc({field:c,aggregate:g,type:"quantitative"},a,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&Y(Hfe(e.center,e.extent)),s==="aggregated-upper-lower"?(f=[],u=[{calculate:`datum["${n.field}"]`,as:`upper_${c}`},{calculate:`datum["${c}"]`,as:`lower_${c}`}]):s==="aggregated-error"&&(f=[{fieldPrefix:"",titlePrefix:c}],u=[{calculate:`datum["${c}"] + datum["${i.field}"]`,as:`upper_${c}`}],r?u.push({calculate:`datum["${c}"] + datum["${r.field}"]`,as:`lower_${c}`}):u.push({calculate:`datum["${c}"] - datum["${i.field}"]`,as:`lower_${c}`}));for(const h of u)f.push({fieldPrefix:h.as.substring(0,6),titlePrefix:il(il(h.calculate,'datum["',""),'"]',"")})}return{postAggregateCalculates:u,errorBarSpecificAggregate:l,tooltipSummary:f,tooltipTitleWithFieldName:d}}function jN(e,t,n){return`${Rd(e)} ${n} ${t}`}const q_="errorband",Dhe=["band","borders"],Nhe=new P1(q_,UN);function UN(e,{config:t}){e={...e,encoding:B1(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,markDef:o,outerSpec:a,tooltipEncoding:l}=BN(e,q_,t),u=o,c=j_(u,r,i,s,t.errorband),f=e.encoding.x!==void 0&&e.encoding.y!==void 0;let d={type:f?"area":"rect"},h={type:f?"line":"rule"};const p={...u.interpolate?{interpolate:u.interpolate}:{},...u.tension&&u.interpolate?{tension:u.tension}:{}};return f?(d={...d,...p,ariaRoleDescription:"errorband"},h={...h,...p,aria:!1}):u.interpolate?Y(TD("interpolate")):u.tension&&Y(TD("tension")),{...a,transform:n,layer:[...c({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l}),...c({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:l}),...c({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:l})]}}const qN={};function W_(e,t,n){const i=new P1(e,t);qN[e]={normalizer:i,parts:n}}function Ohe(){return G(qN)}W_(U1,IN,whe),W_(U_,PN,Ehe),W_(q_,UN,Dhe);const Rhe=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],WN={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},HN={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},Lhe=G(WN),Ihe=G(HN),GN=G({header:1,headerRow:1,headerColumn:1,headerFacet:1}),VN=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],zhe={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},Phe={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1},kr="_vgsid_",Bhe={point:{on:"click",fields:[kr],toggle:"event.shiftKey",resolve:"global",clear:"dblclick"},interval:{on:"[pointerdown, window:pointerup] > window:pointermove!",encodings:["x","y"],translate:"[pointerdown, window:pointerup] > window:pointermove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function H_(e){return e==="legend"||!!(e!=null&&e.legend)}function G_(e){return H_(e)&&ie(e)}function V_(e){return!!(e!=null&&e.select)}function XN(e){const t=[];for(const n of e||[]){if(V_(n))continue;const{expr:i,bind:r,...s}=n;if(r&&i){const o={...s,bind:r,init:i};t.push(o)}else{const o={...s,...i?{update:i}:{},...r?{bind:r}:{}};t.push(o)}}return t}function jhe(e){return q1(e)||Y_(e)||X_(e)}function X_(e){return"concat"in e}function q1(e){return"vconcat"in e}function Y_(e){return"hconcat"in e}function YN({step:e,offsetIsDiscrete:t}){return t?e.for??"offset":"position"}function ds(e){return ie(e)&&e.step!==void 0}function ZN(e){return e.view||e.width||e.height}const KN=20,Uhe=G({align:1,bounds:1,center:1,columns:1,spacing:1});function qhe(e,t,n){const i=n[t],r={},{spacing:s,columns:o}=i;s!==void 0&&(r.spacing=s),o!==void 0&&(M1(e)&&!Hd(e.facet)||X_(e))&&(r.columns=o),q1(e)&&(r.columns=1);for(const a of Uhe)if(e[a]!==void 0)if(a==="spacing"){const l=e[a];r[a]=Xe(l)?l:{row:l.row??s,column:l.column??s}}else r[a]=e[a];return r}function Z_(e,t){return e[t]??e[t==="width"?"continuousWidth":"continuousHeight"]}function W1(e,t){const n=H1(e,t);return ds(n)?n.step:JN}function H1(e,t){const n=e[t]??e[t==="width"?"discreteWidth":"discreteHeight"];return Dt(n,{step:e.step})}const JN=20,Whe={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:{continuousWidth:200,continuousHeight:200,step:JN},mark:jde,arc:{},area:{},bar:qde,circle:{},geoshape:{},image:{},line:{},point:{},rect:Wde,rule:{color:"black"},square:{},text:{color:"black"},tick:Hde,trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:$de,projection:{},legend:zhe,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:Bhe,style:{},title:{},facet:{spacing:KN},concat:{spacing:KN},normalizedNumberFormat:".0%"},Xs=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],QN={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},eO={blue:Xs[0],orange:Xs[1],red:Xs[2],teal:Xs[3],green:Xs[4],yellow:Xs[5],purple:Xs[6],pink:Xs[7],brown:Xs[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function Hhe(e={}){return{signals:[{name:"color",value:ie(e)?{...eO,...e}:eO}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}function Ghe(e){return{signals:[{name:"fontSize",value:ie(e)?{...QN,...e}:QN}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}function Vhe(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}function tO(e){const t=G(e||{}),n={};for(const i of t){const r=e[i];n[i]=Xd(r)?aD(r):$i(r)}return n}function Xhe(e){const t=G(e),n={};for(const i of t)n[i]=tO(e[i]);return n}const Yhe=[...tN,...AN,...GN,"background","padding","legend","lineBreak","scale","style","title","view"];function nO(e={}){const{color:t,font:n,fontSize:i,selection:r,...s}=e,o=Wl({},Ce(Whe),n?Vhe(n):{},t?Hhe(t):{},i?Ghe(i):{},s||{});r&&Hl(o,"selection",r,!0);const a=ri(o,Yhe);for(const l of["background","lineBreak","padding"])o[l]&&(a[l]=$i(o[l]));for(const l of tN)o[l]&&(a[l]=li(o[l]));for(const l of AN)o[l]&&(a[l]=tO(o[l]));for(const l of GN)o[l]&&(a[l]=li(o[l]));return o.legend&&(a.legend=li(o.legend)),o.scale&&(a.scale=li(o.scale)),o.style&&(a.style=Xhe(o.style)),o.title&&(a.title=li(o.title)),o.view&&(a.view=li(o.view)),a}const Zhe=new Set(["view",...Lde]),Khe=["color","fontSize","background","padding","facet","concat","numberFormat","numberFormatType","normalizedNumberFormat","normalizedNumberFormatType","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],Jhe={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...Bde};function Qhe(e){e=Ce(e);for(const t of Khe)delete e[t];if(e.axis)for(const t in e.axis)Xd(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of Rhe)delete e.legend[t];if(e.mark){for(const t of eN)delete e.mark[t];e.mark.tooltip&&ie(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(XN(e.params)),delete e.params);for(const t of Zhe){for(const i of eN)delete e[t][i];const n=Jhe[t];if(n)for(const i of n)delete e[t][i];tpe(e,t)}for(const t of Ohe())delete e[t];epe(e);for(const t in e)ie(e[t])&<(e[t])&&delete e[t];return lt(e)?void 0:e}function epe(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:i}=oD(e.title);lt(t)||(e.style["group-title"]={...e.style["group-title"],...t}),lt(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n}),lt(i)?delete e.title:e.title=i}function tpe(e,t,n,i){const r=i?e[t][i]:e[t];t==="view"&&(n="cell");const s={...r,...e.style[n??t]};lt(s)||(e.style[n??t]=s),i||delete e[t]}function G1(e){return"layer"in e}function npe(e){return"repeat"in e}function ipe(e){return!q(e.repeat)&&e.repeat.layer}class K_{map(t,n){return M1(t)?this.mapFacet(t,n):npe(t)?this.mapRepeat(t,n):Y_(t)?this.mapHConcat(t,n):q1(t)?this.mapVConcat(t,n):X_(t)?this.mapConcat(t,n):this.mapLayerOrUnit(t,n)}mapLayerOrUnit(t,n){if(G1(t))return this.mapLayer(t,n);if(Vs(t))return this.mapUnit(t,n);throw new Error(s_(t))}mapLayer(t,n){return{...t,layer:t.layer.map(i=>this.mapLayerOrUnit(i,n))}}mapHConcat(t,n){return{...t,hconcat:t.hconcat.map(i=>this.map(i,n))}}mapVConcat(t,n){return{...t,vconcat:t.vconcat.map(i=>this.map(i,n))}}mapConcat(t,n){const{concat:i,...r}=t;return{...r,concat:i.map(s=>this.map(s,n))}}mapFacet(t,n){return{...t,spec:this.map(t.spec,n)}}mapRepeat(t,n){return{...t,spec:this.map(t.spec,n)}}}const rpe={zero:1,center:1,normalize:1};function spe(e){return e in rpe}const ope=new Set([KD,$1,k1,S1,C1,E_,C_,E1,JD,$_]),ape=new Set([$1,k1,KD]);function uc(e){return Z(e)&&rc(e)==="quantitative"&&!e.bin}function iO(e,t,{orient:n,type:i}){const r=t==="x"?"y":"radius",s=t==="x"&&["bar","area"].includes(i),o=e[t],a=e[r];if(Z(o)&&Z(a))if(uc(o)&&uc(a)){if(o.stack)return t;if(a.stack)return r;const l=Z(o)&&!!o.aggregate,u=Z(a)&&!!a.aggregate;if(l!==u)return l?t:r;if(s){if(n==="vertical")return r;if(n==="horizontal")return t}}else{if(uc(o))return t;if(uc(a))return r}else{if(uc(o))return s&&n==="vertical"?void 0:t;if(uc(a))return s&&n==="horizontal"?void 0:r}}function lpe(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function rO(e,t){var g,m;const n=ls(e)?e:{type:e},i=n.type;if(!ope.has(i))return null;const r=iO(t,"x",n)||iO(t,"theta",n);if(!r)return null;const s=t[r],o=Z(s)?Q(s,{}):void 0,a=lpe(r),l=[],u=new Set;if(t[a]){const y=t[a],b=Z(y)?Q(y,{}):void 0;b&&b!==o&&(l.push(a),u.add(b))}const c=a==="x"?"xOffset":"yOffset",f=t[c],d=Z(f)?Q(f,{}):void 0;d&&d!==o&&(l.push(c),u.add(d));const h=Tce.reduce((y,b)=>{if(b!=="tooltip"&&ml(t,b)){const v=t[b];for(const x of ee(v)){const _=fs(x);if(_.aggregate)continue;const k=Q(_,{});(!k||!u.has(k))&&y.push({channel:b,fieldDef:_})}}return y},[]);let p;return s.stack!==void 0?ro(s.stack)?p=s.stack?"zero":null:p=s.stack:ape.has(i)&&(p="zero"),!p||!spe(p)||I_(t)&&h.length===0?null:(g=s==null?void 0:s.scale)!=null&&g.type&&((m=s==null?void 0:s.scale)==null?void 0:m.type)!==ui.LINEAR?(s!=null&&s.stack&&Y(Ufe(s.scale.type)),null):Se(t[ss(r)])?(s.stack!==void 0&&Y(jfe(r)),null):(Z(s)&&s.aggregate&&!jce.has(s.aggregate)&&Y(qfe(s.aggregate)),{groupbyChannels:l,groupbyFields:u,fieldChannel:r,impute:s.impute===null?!1:Qo(i),stackBy:h,offset:p})}function sO(e,t,n){const i=li(e),r=it("orient",i,n);if(i.orient=dpe(i.type,t,r),r!==void 0&&r!==i.orient&&Y(Efe(i.orient,r)),i.type==="bar"&&i.orient){const a=it("cornerRadiusEnd",i,n);if(a!==void 0){const l=i.orient==="horizontal"&&t.x2||i.orient==="vertical"&&t.y2?["cornerRadius"]:Ude[i.orient];for(const u of l)i[u]=a;i.cornerRadiusEnd!==void 0&&delete i.cornerRadiusEnd}}return it("opacity",i,n)===void 0&&(i.opacity=cpe(i.type,t)),it("cursor",i,n)===void 0&&(i.cursor=upe(i,t,n)),i}function upe(e,t,n){return t.href||e.href||it("href",e,n)?"pointer":e.cursor}function cpe(e,t){if(Pe([C1,$_,E_,C_],e)&&!I_(t))return .7}function fpe(e,t,{graticule:n}){if(n)return!1;const i=Gs("filled",e,t),r=e.type;return Dt(i,r!==C1&&r!==E1&&r!==S1)}function dpe(e,t,n){switch(e){case C1:case E_:case C_:case JD:case Ode:case Nde:return}const{x:i,y:r,x2:s,y2:o}=t;switch(e){case $1:if(Z(i)&&(un(i.bin)||Z(r)&&r.aggregate&&!i.aggregate))return"vertical";if(Z(r)&&(un(r.bin)||Z(i)&&i.aggregate&&!r.aggregate))return"horizontal";if(o||s){if(n)return n;if(!s)return(Z(i)&&i.type===fl&&!mt(i.bin)||N1(i))&&Z(r)&&un(r.bin)?"horizontal":"vertical";if(!o)return(Z(r)&&r.type===fl&&!mt(r.bin)||N1(r))&&Z(i)&&un(i.bin)?"vertical":"horizontal"}case S1:if(s&&!(Z(i)&&un(i.bin))&&o&&!(Z(r)&&un(r.bin)))return;case k1:if(o)return Z(r)&&un(r.bin)?"horizontal":"vertical";if(s)return Z(i)&&un(i.bin)?"vertical":"horizontal";if(e===S1){if(i&&!r)return"vertical";if(r&&!i)return"horizontal"}case E1:case $_:{const a=mN(i),l=mN(r);if(n)return n;if(a&&!l)return e!=="tick"?"horizontal":"vertical";if(!a&&l)return e!=="tick"?"vertical":"horizontal";if(a&&l)return"vertical";{const u=Un(i)&&i.type===tc,c=Un(r)&&r.type===tc;if(u&&!c)return"vertical";if(!u&&c)return"horizontal"}return}}return"vertical"}function hpe(e){const{point:t,line:n,...i}=e;return G(i).length>1?i:i.type}function ppe(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:ri(e[t],["point","line"])});return e}function J_(e,t={},n){return e.point==="transparent"?{opacity:0}:e.point?ie(e.point)?e.point:{}:e.point!==void 0?null:t.point||n.shape?ie(t.point)?t.point:{}:void 0}function oO(e,t={}){return e.line?e.line===!0?{}:e.line:e.line!==void 0?null:t.line?t.line===!0?{}:t.line:void 0}class gpe{constructor(){this.name="path-overlay"}hasMatchingType(t,n){if(Vs(t)){const{mark:i,encoding:r}=t,s=ls(i)?i:{type:i};switch(s.type){case"line":case"rule":case"trail":return!!J_(s,n[s.type],r);case"area":return!!J_(s,n[s.type],r)||!!oO(s,n[s.type])}}return!1}run(t,n,i){const{config:r}=n,{params:s,projection:o,mark:a,name:l,encoding:u,...c}=t,f=B1(u,r),d=ls(a)?a:{type:a},h=J_(d,r[d.type],f),p=d.type==="area"&&oO(d,r[d.type]),g=[{name:l,...s?{params:s}:{},mark:hpe({...d.type==="area"&&d.opacity===void 0&&d.fillOpacity===void 0?{opacity:.7}:{},...d}),encoding:ri(f,["shape"])}],m=rO(sO(d,f,r),f);let y=f;if(m){const{fieldChannel:b,offset:v}=m;y={...f,[b]:{...f[b],...v?{stack:v}:{}}}}return y=ri(y,["y2","x2"]),p&&g.push({...o?{projection:o}:{},mark:{type:"line",...Yu(d,["clip","interpolate","tension","tooltip"]),...p},encoding:y}),h&&g.push({...o?{projection:o}:{},mark:{type:"point",opacity:1,filled:!0,...Yu(d,["clip","tooltip"]),...h},encoding:y}),i({...c,layer:g},{...n,config:ppe(r)})}}function mpe(e,t){return t?Hd(e)?cO(e,t):aO(e,t):e}function Q_(e,t){return t?cO(e,t):e}function ew(e,t,n){const i=t[e];if(nhe(i)){if(i.repeat in n)return{...t,[e]:n[i.repeat]};Y(sfe(i.repeat));return}return t}function aO(e,t){if(e=ew("field",e,t),e!==void 0){if(e===null)return null;if(N_(e)&&us(e.sort)){const n=ew("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function lO(e,t){if(Z(e))return aO(e,t);{const n=ew("datum",e,t);return n!==e&&!n.type&&(n.type="nominal"),n}}function uO(e,t){if(Se(e)){const n=lO(e,t);if(n)return n;if(F1(e))return{condition:e.condition}}else{if(Gd(e)){const n=lO(e.condition,t);if(n)return{...e,condition:n};{const{condition:i,...r}=e;return r}}return e}}function cO(e,t){const n={};for(const i in e)if(pe(e,i)){const r=e[i];if(q(r))n[i]=r.map(s=>uO(s,t)).filter(s=>s);else{const s=uO(r,t);s!==void 0&&(n[i]=s)}}return n}class ype{constructor(){this.name="RuleForRangedLine"}hasMatchingType(t){if(Vs(t)){const{encoding:n,mark:i}=t;if(i==="line"||ls(i)&&i.type==="line")for(const r of Cce){const s=ol(r),o=n[s];if(n[r]&&(Z(o)&&!un(o.bin)||cs(o)))return!0}}return!1}run(t,n,i){const{encoding:r,mark:s}=t;return Y($fe(!!r.x2,!!r.y2)),i({...t,mark:ie(s)?{...s,type:"rule"}:"rule"},n)}}class bpe extends K_{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[khe,Che,Nhe,new gpe,new ype]}map(t,n){if(Vs(t)){const i=ml(t.encoding,Is),r=ml(t.encoding,zs),s=ml(t.encoding,f1);if(i||r||s)return this.mapFacetedUnit(t,n)}return super.map(t,n)}mapUnit(t,n){const{parentEncoding:i,parentProjection:r}=n,s=Q_(t.encoding,n.repeater),o={...t,...t.name?{name:[n.repeaterPrefix,t.name].filter(l=>l).join("_")}:{},...s?{encoding:s}:{}};if(i||r)return this.mapUnitWithParentEncodingOrProjection(o,n);const a=this.mapLayerOrUnit.bind(this);for(const l of this.nonFacetUnitNormalizers)if(l.hasMatchingType(o,n.config))return l.run(o,n,a);return o}mapRepeat(t,n){return ipe(t)?this.mapLayerRepeat(t,n):this.mapNonLayerRepeat(t,n)}mapLayerRepeat(t,n){const{repeat:i,spec:r,...s}=t,{row:o,column:a,layer:l}=i,{repeater:u={},repeaterPrefix:c=""}=n;return o||a?this.mapRepeat({...t,repeat:{...o?{row:o}:{},...a?{column:a}:{}},spec:{repeat:{layer:l},spec:r}},n):{...s,layer:l.map(f=>{const d={...u,layer:f},h=`${(r.name?`${r.name}_`:"")+c}child__layer_${_t(f)}`,p=this.mapLayerOrUnit(r,{...n,repeater:d,repeaterPrefix:h});return p.name=h,p})}}mapNonLayerRepeat(t,n){const{repeat:i,spec:r,data:s,...o}=t;!q(i)&&t.columns&&(t=ri(t,["columns"]),Y(_D("repeat")));const a=[],{repeater:l={},repeaterPrefix:u=""}=n,c=!q(i)&&i.row||[l?l.row:null],f=!q(i)&&i.column||[l?l.column:null],d=q(i)&&i||[l?l.repeat:null];for(const p of d)for(const g of c)for(const m of f){const y={repeat:p,row:g,column:m,layer:l.layer},b=(r.name?`${r.name}_`:"")+u+"child__"+(q(i)?`${_t(p)}`:(i.row?`row_${_t(g)}`:"")+(i.column?`column_${_t(m)}`:"")),v=this.map(r,{...n,repeater:y,repeaterPrefix:b});v.name=b,a.push(ri(v,["data"]))}const h=q(i)?t.columns:i.column?i.column.length:1;return{data:r.data??s,align:"all",...o,columns:h,concat:a}}mapFacet(t,n){const{facet:i}=t;return Hd(i)&&t.columns&&(t=ri(t,["columns"]),Y(_D("facet"))),super.mapFacet(t,n)}mapUnitWithParentEncodingOrProjection(t,n){const{encoding:i,projection:r}=t,{parentEncoding:s,parentProjection:o,config:a}=n,l=dO({parentProjection:o,projection:r}),u=fO({parentEncoding:s,encoding:Q_(i,n.repeater)});return this.mapUnit({...t,...l?{projection:l}:{},...u?{encoding:u}:{}},{config:a})}mapFacetedUnit(t,n){const{row:i,column:r,facet:s,...o}=t.encoding,{mark:a,width:l,projection:u,height:c,view:f,params:d,encoding:h,...p}=t,{facetMapping:g,layout:m}=this.getFacetMappingAndLayout({row:i,column:r,facet:s},n),y=Q_(o,n.repeater);return this.mapFacet({...p,...m,facet:g,spec:{...l?{width:l}:{},...c?{height:c}:{},...f?{view:f}:{},...u?{projection:u}:{},mark:a,encoding:y,...d?{params:d}:{}}},n)}getFacetMappingAndLayout(t,n){const{row:i,column:r,facet:s}=t;if(i||r){s&&Y(wfe([...i?[Is]:[],...r?[zs]:[]]));const o={},a={};for(const l of[Is,zs]){const u=t[l];if(u){const{align:c,center:f,spacing:d,columns:h,...p}=u;o[l]=p;for(const g of["align","center","spacing"])u[g]!==void 0&&(a[g]??(a[g]={}),a[g][l]=u[g])}}return{facetMapping:o,layout:a}}else{const{align:o,center:a,spacing:l,columns:u,...c}=s;return{facetMapping:mpe(c,n.repeater),layout:{...o?{align:o}:{},...a?{center:a}:{},...l?{spacing:l}:{},...u?{columns:u}:{}}}}}mapLayer(t,{parentEncoding:n,parentProjection:i,...r}){const{encoding:s,projection:o,...a}=t,l={...r,parentEncoding:fO({parentEncoding:n,encoding:s,layer:!0}),parentProjection:dO({parentProjection:i,projection:o})};return super.mapLayer({...a,...t.name?{name:[l.repeaterPrefix,t.name].filter(u=>u).join("_")}:{}},l)}}function fO({parentEncoding:e,encoding:t={},layer:n}){let i={};if(e){const r=new Set([...G(e),...G(t)]);for(const s of r){const o=t[s],a=e[s];if(Se(o)){const l={...a,...o};i[s]=l}else Gd(o)?i[s]={...o,condition:{...a,...o.condition}}:o||o===null?i[s]=o:(n||wr(a)||de(a)||Se(a)||q(a))&&(i[s]=a)}}else i=t;return!i||lt(i)?void 0:i}function dO(e){const{parentProjection:t,projection:n}=e;return t&&n&&Y(ffe({parentProjection:t,projection:n})),n??t}function tw(e){return"filter"in e}function vpe(e){return(e==null?void 0:e.stop)!==void 0}function hO(e){return"lookup"in e}function xpe(e){return"data"in e}function _pe(e){return"param"in e}function wpe(e){return"pivot"in e}function kpe(e){return"density"in e}function $pe(e){return"quantile"in e}function Epe(e){return"regression"in e}function Cpe(e){return"loess"in e}function Spe(e){return"sample"in e}function Ape(e){return"window"in e}function Tpe(e){return"joinaggregate"in e}function Mpe(e){return"flatten"in e}function Fpe(e){return"calculate"in e}function pO(e){return"bin"in e}function Dpe(e){return"impute"in e}function Npe(e){return"timeUnit"in e}function Ope(e){return"aggregate"in e}function Rpe(e){return"stack"in e}function Lpe(e){return"fold"in e}function Ipe(e){return"extent"in e&&!("density"in e)}function zpe(e){return e.map(t=>tw(t)?{filter:Xu(t.filter,yde)}:t)}class Ppe extends K_{map(t,n){return n.emptySelections??(n.emptySelections={}),n.selectionPredicates??(n.selectionPredicates={}),t=gO(t,n),super.map(t,n)}mapLayerOrUnit(t,n){if(t=gO(t,n),t.encoding){const i={};for(const[r,s]of qo(t.encoding))i[r]=mO(s,n);t={...t,encoding:i}}return super.mapLayerOrUnit(t,n)}mapUnit(t,n){const{selection:i,...r}=t;return i?{...r,params:qo(i).map(([s,o])=>{const{init:a,bind:l,empty:u,...c}=o;c.type==="single"?(c.type="point",c.toggle=!1):c.type==="multi"&&(c.type="point"),n.emptySelections[s]=u!=="none";for(const f of ln(n.selectionPredicates[s]??{}))f.empty=u!=="none";return{name:s,value:a,select:c,bind:l}})}:t}}function gO(e,t){const{transform:n,...i}=e;if(n){const r=n.map(s=>{if(tw(s))return{filter:nw(s,t)};if(pO(s)&&al(s.bin))return{...s,bin:yO(s.bin)};if(hO(s)){const{selection:o,...a}=s.from;return o?{...s,from:{param:o,...a}}:s}return s});return{...i,transform:r}}return e}function mO(e,t){var i,r;const n=Ce(e);if(Z(n)&&al(n.bin)&&(n.bin=yO(n.bin)),gl(n)&&((r=(i=n.scale)==null?void 0:i.domain)!=null&&r.selection)){const{selection:s,...o}=n.scale.domain;n.scale.domain={...o,...s?{param:s}:{}}}if(F1(n))if(q(n.condition))n.condition=n.condition.map(s=>{const{selection:o,param:a,test:l,...u}=s;return a?s:{...u,test:nw(s,t)}});else{const{selection:s,param:o,test:a,...l}=mO(n.condition,t);n.condition=o?n.condition:{...l,test:nw(n.condition,t)}}return n}function yO(e){const t=e.extent;if(t!=null&&t.selection){const{selection:n,...i}=t;return{...e,extent:{...i,param:n}}}return e}function nw(e,t){const n=i=>Xu(i,r=>{var s;const o=t.emptySelections[r]??!0,a={param:r,empty:o};return(s=t.selectionPredicates)[r]??(s[r]=[]),t.selectionPredicates[r].push(a),a});return e.selection?n(e.selection):Xu(e.test||e.filter,i=>i.selection?n(i.selection):i)}class iw extends K_{map(t,n){const i=n.selections??[];if(t.params&&!Vs(t)){const r=[];for(const s of t.params)V_(s)?i.push(s):r.push(s);t.params=r}return n.selections=i,super.map(t,n)}mapUnit(t,n){const i=n.selections;if(!i||!i.length)return t;const r=(n.path??[]).concat(t.name),s=[];for(const o of i)if(!o.views||!o.views.length)s.push(o);else for(const a of o.views)(te(a)&&(a===t.name||r.includes(a))||q(a)&&a.map(l=>r.indexOf(l)).every((l,u,c)=>l!==-1&&(u===0||l>c[u-1])))&&s.push(o);return s.length&&(t.params=s),t}}for(const e of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const t=iw.prototype[e];iw.prototype[e]=function(n,i){return t.call(this,n,Bpe(n,i))}}function Bpe(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}function bO(e,t){t===void 0&&(t=nO(e.config));const n=Wpe(e,t),{width:i,height:r}=e,s=Hpe(n,{width:i,height:r,autosize:e.autosize},t);return{...n,...s?{autosize:s}:{}}}const jpe=new bpe,Upe=new Ppe,qpe=new iw;function Wpe(e,t={}){const n={config:t};return qpe.map(jpe.map(Upe.map(e,n),n),n)}function vO(e){return te(e)?{type:e}:e??{}}function Hpe(e,t,n){let{width:i,height:r}=t;const s=Vs(e)||G1(e),o={};s?i=="container"&&r=="container"?(o.type="fit",o.contains="padding"):i=="container"?(o.type="fit-x",o.contains="padding"):r=="container"&&(o.type="fit-y",o.contains="padding"):(i=="container"&&(Y(mD("width")),i=void 0),r=="container"&&(Y(mD("height")),r=void 0));const a={type:"pad",...o,...n?vO(n.autosize):{},...vO(e.autosize)};if(a.type==="fit"&&!s&&(Y(Yce),a.type="pad"),i=="container"&&!(a.type=="fit"||a.type=="fit-x")&&Y(yD("width")),r=="container"&&!(a.type=="fit"||a.type=="fit-y")&&Y(yD("height")),!ki(a,{type:"pad"}))return a}function Gpe(e){return e==="fit"||e==="fit-x"||e==="fit-y"}function Vpe(e){return e?`fit-${m1(e)}`:"fit"}const Xpe=["background","padding"];function xO(e,t){const n={};for(const i of Xpe)e&&e[i]!==void 0&&(n[i]=$i(e[i]));return t&&(n.params=e.params),n}class Ys{constructor(t={},n={}){this.explicit=t,this.implicit=n}clone(){return new Ys(Ce(this.explicit),Ce(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(t){return Dt(this.explicit[t],this.implicit[t])}getWithExplicit(t){return this.explicit[t]!==void 0?{explicit:!0,value:this.explicit[t]}:this.implicit[t]!==void 0?{explicit:!1,value:this.implicit[t]}:{explicit:!1,value:void 0}}setWithExplicit(t,{value:n,explicit:i}){n!==void 0&&this.set(t,n,i)}set(t,n,i){return delete this[i?"implicit":"explicit"][t],this[i?"explicit":"implicit"][t]=n,this}copyKeyFromSplit(t,{explicit:n,implicit:i}){n[t]!==void 0?this.set(t,n[t],!0):i[t]!==void 0&&this.set(t,i[t],!1)}copyKeyFromObject(t,n){n[t]!==void 0&&this.set(t,n[t],!0)}copyAll(t){for(const n of G(t.combine())){const i=t.getWithExplicit(n);this.setWithExplicit(n,i)}}}function hs(e){return{explicit:!0,value:e}}function Ci(e){return{explicit:!1,value:e}}function _O(e){return(t,n,i,r)=>{const s=e(t.value,n.value);return s>0?t:s<0?n:V1(t,n,i,r)}}function V1(e,t,n,i){return e.explicit&&t.explicit&&Y(Ofe(n,i,e.value,t.value)),e}function na(e,t,n,i,r=V1){return e===void 0||e.value===void 0?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:ki(e.value,t.value)?e:r(e,t,n,i)}class Ype extends Ys{constructor(t={},n={},i=!1){super(t,n),this.explicit=t,this.implicit=n,this.parseNothing=i}clone(){const t=super.clone();return t.parseNothing=this.parseNothing,t}}function cc(e){return"url"in e}function Yd(e){return"values"in e}function wO(e){return"name"in e&&!cc(e)&&!Yd(e)&&!ia(e)}function ia(e){return e&&(kO(e)||$O(e)||rw(e))}function kO(e){return"sequence"in e}function $O(e){return"sphere"in e}function rw(e){return"graticule"in e}var yt;(function(e){e[e.Raw=0]="Raw",e[e.Main=1]="Main",e[e.Row=2]="Row",e[e.Column=3]="Column",e[e.Lookup=4]="Lookup"})(yt||(yt={}));function EO(e){const{signals:t,hasLegend:n,index:i,...r}=e;return r.field=ji(r.field),r}function yl(e,t=!0,n=dn){if(q(e)){const i=e.map(r=>yl(r,t,n));return t?`[${i.join(", ")}]`:i}else if(ll(e))return n(t?ul(e):sde(e));return t?n(ut(e)):e}function Zpe(e,t){for(const n of ln(e.component.selection??{})){const i=n.name;let r=`${i}${sa}, ${n.resolve==="global"?"true":`{unit: ${vl(e)}}`}`;for(const s of em)s.defined(n)&&(s.signals&&(t=s.signals(e,n,t)),s.modifyExpr&&(r=s.modifyExpr(e,n,r)));t.push({name:i+Age,on:[{events:{signal:n.name+sa},update:`modify(${J(n.name+bl)}, ${r})`}]})}return sw(t)}function Kpe(e,t){if(e.component.selection&&G(e.component.selection).length){const n=J(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:jo("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return sw(t)}function Jpe(e,t){let n=!1;for(const i of ln(e.component.selection??{})){const r=i.name,s=J(r+bl);if(t.filter(a=>a.name===r).length===0){const a=i.resolve==="global"?"union":i.resolve,l=i.type==="point"?", true, true)":")";t.push({name:i.name,update:`${eR}(${s}, ${J(a)}${l}`})}n=!0;for(const a of em)a.defined(i)&&a.topLevelSignals&&(t=a.topLevelSignals(e,i,t))}return n&&t.filter(r=>r.name==="unit").length===0&&t.unshift({name:"unit",value:{},on:[{events:"pointermove",update:"isTuple(group()) ? group() : unit"}]}),sw(t)}function Qpe(e,t){const n=[...t],i=vl(e,{escape:!1});for(const r of ln(e.component.selection??{})){const s={name:r.name+bl};if(r.project.hasSelectionId&&(s.transform=[{type:"collect",sort:{field:kr}}]),r.init){const a=r.project.items.map(EO);s.values=r.project.hasSelectionId?r.init.map(l=>({unit:i,[kr]:yl(l,!1)[0]})):r.init.map(l=>({unit:i,fields:a,values:yl(l,!1)}))}n.filter(a=>a.name===r.name+bl).length||n.push(s)}return n}function CO(e,t){for(const n of ln(e.component.selection??{}))for(const i of em)i.defined(n)&&i.marks&&(t=i.marks(e,n,t));return t}function ege(e,t){for(const n of e.children)At(n)&&(t=CO(n,t));return t}function tge(e,t,n,i){const r=sR(e,t.param,t);return{signal:Ei(n.get("type"))&&q(i)&&i[0]>i[1]?`isValid(${r}) && reverse(${r})`:r}}function sw(e){return e.map(t=>(t.on&&!t.on.length&&delete t.on,t))}class ot{constructor(t,n){this.debugName=n,this._children=[],this._parent=null,t&&(this.parent=t)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(t){this._parent=t,t&&t.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(t,n){if(this._children.includes(t)){Y(lfe);return}n!==void 0?this._children.splice(n,0,t):this._children.push(t)}removeChild(t){const n=this._children.indexOf(t);return this._children.splice(n,1),n}remove(){let t=this._parent.removeChild(this);for(const n of this._children)n._parent=this._parent,this._parent.addChild(n,t++)}insertAsParentOf(t){const n=t.parent;n.removeChild(this),this.parent=n,t.parent=this}swapWithParent(){const t=this._parent,n=t.parent;for(const r of this._children)r.parent=t;this._children=[],t.removeChild(this);const i=t.parent.removeChild(t);this._parent=n,n.addChild(this,i),t.parent=this}}class qn extends ot{clone(){const t=new this.constructor;return t.debugName=`clone_${this.debugName}`,t._source=this._source,t._name=`clone_${this._name}`,t.type=this.type,t.refCounts=this.refCounts,t.refCounts[t._name]=0,t}constructor(t,n,i,r){super(t,n),this.type=i,this.refCounts=r,this._source=this._name=n,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}dependentFields(){return new Set}producedFields(){return new Set}hash(){return this._hash===void 0&&(this._hash=`Output ${jF()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}}function ow(e){return e.as!==void 0}function SO(e){return`${e}_end`}class ps extends ot{clone(){return new ps(null,Ce(this.timeUnits))}constructor(t,n){super(t),this.timeUnits=n}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,s,o)=>{const{field:a,timeUnit:l}=s;if(l){let u;if(cl(l)){if(At(n)){const{mark:c,markDef:f,config:d}=n,h=ea({fieldDef:s,markDef:f,config:d});(Ud(c)||h)&&(u={timeUnit:Kt(l),field:a})}}else u={as:Q(s,{forAs:!0}),field:a,timeUnit:l};if(At(n)){const{mark:c,markDef:f,config:d}=n,h=ea({fieldDef:s,markDef:f,config:d});Ud(c)&&Nt(o)&&h!==.5&&(u.rectBandPosition=h)}u&&(r[ze(u)]=u)}return r},{});return lt(i)?null:new ps(t,i)}static makeFromTransform(t,n){const{timeUnit:i,...r}={...n},s=Kt(i),o={...r,timeUnit:s};return new ps(t,{[ze(o)]:o})}merge(t){this.timeUnits={...this.timeUnits};for(const n in t.timeUnits)this.timeUnits[n]||(this.timeUnits[n]=t.timeUnits[n]);for(const n of t.children)t.removeChild(n),n.parent=this;t.remove()}removeFormulas(t){const n={};for(const[i,r]of qo(this.timeUnits)){const s=ow(r)?r.as:`${r.field}_end`;t.has(s)||(n[i]=r)}this.timeUnits=n}producedFields(){return new Set(ln(this.timeUnits).map(t=>ow(t)?t.as:SO(t.field)))}dependentFields(){return new Set(ln(this.timeUnits).map(t=>t.field))}hash(){return`TimeUnit ${ze(this.timeUnits)}`}assemble(){const t=[];for(const n of ln(this.timeUnits)){const{rectBandPosition:i}=n,r=Kt(n.timeUnit);if(ow(n)){const{field:s,as:o}=n,{unit:a,utc:l,...u}=r,c=[o,`${o}_end`];t.push({field:ji(s),type:"timeunit",...a?{units:w1(a)}:{},...l?{timezone:"utc"}:{},...u,as:c}),t.push(...TO(c,i,r))}else if(n){const{field:s}=n,o=s.replaceAll("\\.","."),a=AO({timeUnit:r,field:o}),l=SO(o);t.push({type:"formula",expr:a,as:l}),t.push(...TO([o,l],i,r))}}return t}}const X1="offsetted_rect_start",Y1="offsetted_rect_end";function AO({timeUnit:e,field:t,reverse:n}){const{unit:i,utc:r}=e,s=LD(i),{part:o,step:a}=BD(s,e.step);return`${r?"utcOffset":"timeOffset"}('${o}', datum['${t}'], ${n?-a:a})`}function TO([e,t],n,i){if(n!==void 0&&n!==.5){const r=`datum['${e}']`,s=`datum['${t}']`;return[{type:"formula",expr:MO([AO({timeUnit:i,field:e,reverse:!0}),r],n+.5),as:`${e}_${X1}`},{type:"formula",expr:MO([r,s],n+.5),as:`${e}_${Y1}`}]}return[]}function MO([e,t],n){return`${1-n} * ${e} + ${n} * ${t}`}const Zd="_tuple_fields";class nge{constructor(...t){this.items=t,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const ige={defined:()=>!0,parse:(e,t,n)=>{const i=t.name,r=t.project??(t.project=new nge),s={},o={},a=new Set,l=(p,g)=>{const m=g==="visual"?p.channel:p.field;let y=_t(`${i}_${m}`);for(let b=1;a.has(y);b++)y=_t(`${i}_${m}_${b}`);return a.add(y),{[g]:y}},u=t.type,c=e.config.selection[u],f=n.value!==void 0?ee(n.value):null;let{fields:d,encodings:h}=ie(n.select)?n.select:{};if(!d&&!h&&f){for(const p of f)if(ie(p))for(const g of G(p))Ece(g)?(h||(h=[])).push(g):u==="interval"?(Y(rfe),h=c.encodings):(d??(d=[])).push(g)}!d&&!h&&(h=c.encodings,"fields"in c&&(d=c.fields));for(const p of h??[]){const g=e.fieldDef(p);if(g){let m=g.field;if(g.aggregate){Y(Zce(p,g.aggregate));continue}else if(!m){Y(vD(p));continue}if(g.timeUnit&&!cl(g.timeUnit)){m=e.vgField(p);const y={timeUnit:g.timeUnit,as:m,field:g.field};o[ze(y)]=y}if(!s[m]){const y=u==="interval"&&qs(p)&&Ei(e.getScaleComponent(p).get("type"))?"R":g.bin?"R-RE":"E",b={field:m,channel:p,type:y,index:r.items.length};b.signals={...l(b,"data"),...l(b,"visual")},r.items.push(s[m]=b),r.hasField[m]=s[m],r.hasSelectionId=r.hasSelectionId||m===kr,XF(p)?(b.geoChannel=p,b.channel=VF(p),r.hasChannel[b.channel]=s[m]):r.hasChannel[p]=s[m]}}else Y(vD(p))}for(const p of d??[]){if(r.hasField[p])continue;const g={type:"E",field:p,index:r.items.length};g.signals={...l(g,"data")},r.items.push(g),r.hasField[p]=g,r.hasSelectionId=r.hasSelectionId||p===kr}f&&(t.init=f.map(p=>r.items.map(g=>ie(p)?p[g.geoChannel||g.channel]!==void 0?p[g.geoChannel||g.channel]:p[g.field]:p))),lt(o)||(r.timeUnit=new ps(null,o))},signals:(e,t,n)=>{const i=t.name+Zd;return n.filter(s=>s.name===i).length>0||t.project.hasSelectionId?n:n.concat({name:i,value:t.project.items.map(EO)})}},Zs={defined:e=>e.type==="interval"&&e.resolve==="global"&&e.bind&&e.bind==="scales",parse:(e,t)=>{const n=t.scales=[];for(const i of t.project.items){const r=i.channel;if(!qs(r))continue;const s=e.getScaleComponent(r),o=s?s.get("type"):void 0;if(!s||!Ei(o)){Y(Qce);continue}s.set("selectionExtent",{param:t.name,field:i.field},!0),n.push(i)}},topLevelSignals:(e,t,n)=>{const i=t.scales.filter(o=>n.filter(a=>a.name===o.signals.data).length===0);if(!e.parent||FO(e)||i.length===0)return n;const r=n.filter(o=>o.name===t.name)[0];let s=r.update;if(s.indexOf(eR)>=0)r.update=`{${i.map(o=>`${J(ji(o.field))}: ${o.signals.data}`).join(", ")}}`;else{for(const o of i){const a=`${J(ji(o.field))}: ${o.signals.data}`;s.includes(a)||(s=`${s.substring(0,s.length-1)}, ${a}}`)}r.update=s}return n.concat(i.map(o=>({name:o.signals.data})))},signals:(e,t,n)=>{if(e.parent&&!FO(e))for(const i of t.scales){const r=n.filter(s=>s.name===i.signals.data)[0];r.push="outer",delete r.value,delete r.update}return n}};function aw(e,t){return`domain(${J(e.scaleName(t))})`}function FO(e){return e.parent&&xc(e.parent)&&!e.parent.parent}const fc="_brush",DO="_scale_trigger",Kd="geo_interval_init_tick",NO="_init",rge="_center",sge={defined:e=>e.type==="interval",parse:(e,t,n)=>{var i;if(e.hasProjection){const r={...ie(n.select)?n.select:{}};r.fields=[kr],r.encodings||(r.encodings=n.value?G(n.value):[yr,mr]),n.select={type:"interval",...r}}if(t.translate&&!Zs.defined(t)){const r=`!event.item || event.item.mark.name !== ${J(t.name+fc)}`;for(const s of t.events){if(!s.between){Y(`${s} is not an ordered event stream for interval selections.`);continue}const o=ee((i=s.between[0]).filter??(i.filter=[]));o.indexOf(r)<0&&o.push(r)}}},signals:(e,t,n)=>{const i=t.name,r=i+sa,s=ln(t.project.hasChannel).filter(a=>a.channel===wt||a.channel===Zt),o=t.init?t.init[0]:null;if(n.push(...s.reduce((a,l)=>a.concat(oge(e,t,l,o&&o[l.index])),[])),e.hasProjection){const a=J(e.projectionName()),l=e.projectionName()+rge,{x:u,y:c}=t.project.hasChannel,f=u&&u.signals.visual,d=c&&c.signals.visual,h=u?o&&o[u.index]:`${l}[0]`,p=c?o&&o[c.index]:`${l}[1]`,g=_=>e.getSizeSignalRef(_).signal,m=`[[${f?f+"[0]":"0"}, ${d?d+"[0]":"0"}],[${f?f+"[1]":g("width")}, ${d?d+"[1]":g("height")}]]`;o&&(n.unshift({name:i+NO,init:`[scale(${a}, [${u?h[0]:h}, ${c?p[0]:p}]), scale(${a}, [${u?h[1]:h}, ${c?p[1]:p}])]`}),(!u||!c)&&(n.find(k=>k.name===l)||n.unshift({name:l,update:`invert(${a}, [${g("width")}/2, ${g("height")}/2])`})));const y=`intersect(${m}, {markname: ${J(e.getName("marks"))}}, unit.mark)`,b=`{unit: ${vl(e)}}`,v=`vlSelectionTuples(${y}, ${b})`,x=s.map(_=>_.signals.visual);return n.concat({name:r,on:[{events:[...x.length?[{signal:x.join(" || ")}]:[],...o?[{signal:Kd}]:[]],update:v}]})}else{if(!Zs.defined(t)){const u=i+DO,c=s.map(f=>{const d=f.channel,{data:h,visual:p}=f.signals,g=J(e.scaleName(d)),m=e.getScaleComponent(d).get("type"),y=Ei(m)?"+":"";return`(!isArray(${h}) || (${y}invert(${g}, ${p})[0] === ${y}${h}[0] && ${y}invert(${g}, ${p})[1] === ${y}${h}[1]))`});c.length&&n.push({name:u,value:{},on:[{events:s.map(f=>({scale:e.scaleName(f.channel)})),update:c.join(" && ")+` ? ${u} : {}`}]})}const a=s.map(u=>u.signals.data),l=`unit: ${vl(e)}, fields: ${i+Zd}, values`;return n.concat({name:r,...o?{init:`{${l}: ${yl(o)}}`}:{},...a.length?{on:[{events:[{signal:a.join(" || ")}],update:`${a.join(" && ")} ? {${l}: [${a}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>(At(e)&&e.hasProjection&&t.init&&(n.filter(r=>r.name===Kd).length||n.unshift({name:Kd,value:null,on:[{events:"timer{1}",update:`${Kd} === null ? {} : ${Kd}`}]})),n),marks:(e,t,n)=>{const i=t.name,{x:r,y:s}=t.project.hasChannel,o=r==null?void 0:r.signals.visual,a=s==null?void 0:s.signals.visual,l=`data(${J(t.name+bl)})`;if(Zs.defined(t)||!r&&!s)return n;const u={x:r!==void 0?{signal:`${o}[0]`}:{value:0},y:s!==void 0?{signal:`${a}[0]`}:{value:0},x2:r!==void 0?{signal:`${o}[1]`}:{field:{group:"width"}},y2:s!==void 0?{signal:`${a}[1]`}:{field:{group:"height"}}};if(t.resolve==="global")for(const g of G(u))u[g]=[{test:`${l}.length && ${l}[0].unit === ${vl(e)}`,...u[g]},{value:0}];const{fill:c,fillOpacity:f,cursor:d,...h}=t.mark,p=G(h).reduce((g,m)=>(g[m]=[{test:[r!==void 0&&`${o}[0] !== ${o}[1]`,s!==void 0&&`${a}[0] !== ${a}[1]`].filter(y=>y).join(" && "),value:h[m]},{value:null}],g),{});return[{name:`${i+fc}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:c},fillOpacity:{value:f}},update:u}},...n,{name:i+fc,type:"rect",clip:!0,encode:{enter:{...d?{cursor:{value:d}}:{},fill:{value:"transparent"}},update:{...u,...p}}}]}};function oge(e,t,n,i){const r=!e.hasProjection,s=n.channel,o=n.signals.visual,a=J(r?e.scaleName(s):e.projectionName()),l=d=>`scale(${a}, ${d})`,u=e.getSizeSignalRef(s===wt?"width":"height").signal,c=`${s}(unit)`,f=t.events.reduce((d,h)=>[...d,{events:h.between[0],update:`[${c}, ${c}]`},{events:h,update:`[${o}[0], clamp(${c}, 0, ${u})]`}],[]);if(r){const d=n.signals.data,h=Zs.defined(t),p=e.getScaleComponent(s),g=p?p.get("type"):void 0,m=i?{init:yl(i,!0,l)}:{value:[]};return f.push({events:{signal:t.name+DO},update:Ei(g)?`[${l(`${d}[0]`)}, ${l(`${d}[1]`)}]`:"[0, 0]"}),h?[{name:d,on:[]}]:[{name:o,...m,on:f},{name:d,...i?{init:yl(i)}:{},on:[{events:{signal:o},update:`${o}[0] === ${o}[1] ? null : invert(${a}, ${o})`}]}]}else{const d=s===wt?0:1,h=t.name+NO,p=i?{init:`[${h}[0][${d}], ${h}[1][${d}]]`}:{value:[]};return[{name:o,...p,on:f}]}}const age={defined:e=>e.type==="point",signals:(e,t,n)=>{const i=t.name,r=i+Zd,s=t.project,o="(item().isVoronoi ? datum.datum : datum)",a=ln(e.component.selection??{}).reduce((f,d)=>d.type==="interval"?f.concat(d.name+fc):f,[]).map(f=>`indexof(item().mark.name, '${f}') < 0`).join(" && "),l=`datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${a?` && ${a}`:""}`;let u=`unit: ${vl(e)}, `;if(t.project.hasSelectionId)u+=`${kr}: ${o}[${J(kr)}]`;else{const f=s.items.map(d=>{const h=e.fieldDef(d.channel);return h!=null&&h.bin?`[${o}[${J(e.vgField(d.channel,{}))}], ${o}[${J(e.vgField(d.channel,{binSuffix:"end"}))}]]`:`${o}[${J(d.field)}]`}).join(", ");u+=`fields: ${r}, values: [${f}]`}const c=t.events;return n.concat([{name:i+sa,on:c?[{events:c,update:`${l} ? {${u}} : null`,force:!0}]:[]}])}};function dc(e,t,n,i){const r=F1(t)&&t.condition,s=i(t);if(r){const a=ee(r).map(l=>{const u=i(l);if(the(l)){const{param:c,empty:f}=l;return{test:rR(e,{param:c,empty:f}),...u}}else return{test:tm(e,l.test),...u}});return{[n]:[...a,...s!==void 0?[s]:[]]}}else return s!==void 0?{[n]:s}:{}}function lw(e,t="text"){const n=e.encoding[t];return dc(e,n,t,i=>Z1(i,e.config))}function Z1(e,t,n="datum"){if(e){if(wr(e))return vt(e.value);if(Se(e)){const{format:i,formatType:r}=R1(e);return M_({fieldOrDatumDef:e,format:i,formatType:r,expr:n,config:t})}}}function OO(e,t={}){const{encoding:n,markDef:i,config:r,stack:s}=e,o=n.tooltip;if(q(o))return{tooltip:LO({tooltip:o},s,r,t)};{const a=t.reactiveGeom?"datum.datum":"datum";return dc(e,o,"tooltip",l=>{const u=Z1(l,r,a);if(u)return u;if(l===null)return;let c=it("tooltip",i,r);if(c===!0&&(c={content:"encoding"}),te(c))return{value:c};if(ie(c))return de(c)?c:c.content==="encoding"?LO(n,s,r,t):{signal:a}})}}function RO(e,t,n,{reactiveGeom:i}={}){const r={...n,...n.tooltipFormat},s={},o=i?"datum.datum":"datum",a=[];function l(c,f){const d=ol(f),h=Un(c)?c:{...c,type:e[d].type},p=h.title||R_(h,r),g=ee(p).join(", ").replaceAll(/"/g,'\\"');let m;if(Nt(f)){const y=f==="x"?"x2":"y2",b=fs(e[y]);if(un(h.bin)&&b){const v=Q(h,{expr:o}),x=Q(b,{expr:o}),{format:_,formatType:k}=R1(h);m=Wd(v,x,_,k,r),s[y]=!0}}if((Nt(f)||f===Ui||f===gr)&&t&&t.fieldChannel===f&&t.offset==="normalize"){const{format:y,formatType:b}=R1(h);m=M_({fieldOrDatumDef:h,format:y,formatType:b,expr:o,config:r,normalizeStack:!0}).signal}m??(m=Z1(h,r,o).signal),a.push({channel:f,key:g,value:m})}z_(e,(c,f)=>{Z(c)?l(c,f):D1(c)&&l(c.condition,f)});const u={};for(const{channel:c,key:f,value:d}of a)!s[c]&&!u[f]&&(u[f]=d);return u}function LO(e,t,n,{reactiveGeom:i}={}){const r=RO(e,t,n,{reactiveGeom:i}),s=qo(r).map(([o,a])=>`"${o}": ${a}`);return s.length>0?{signal:`{${s.join(", ")}}`}:void 0}function lge(e){const{markDef:t,config:n}=e,i=it("aria",t,n);return i===!1?{}:{...i?{aria:i}:{},...uge(e),...cge(e)}}function uge(e){const{mark:t,markDef:n,config:i}=e;if(i.aria===!1)return{};const r=it("ariaRoleDescription",n,i);return r!=null?{ariaRoleDescription:{value:r}}:t in Gce?{}:{ariaRoleDescription:{value:t}}}function cge(e){const{encoding:t,markDef:n,config:i,stack:r}=e,s=t.description;if(s)return dc(e,s,"description",l=>Z1(l,e.config));const o=it("description",n,i);if(o!=null)return{description:vt(o)};if(i.aria===!1)return{};const a=RO(t,r,i);if(!lt(a))return{description:{signal:qo(a).map(([l,u],c)=>`"${c>0?"; ":""}${l}: " + (${u})`).join(" + ")}}}function Qt(e,t,n={}){const{markDef:i,encoding:r,config:s}=t,{vgChannel:o}=n;let{defaultRef:a,defaultValue:l}=n;a===void 0&&(l??(l=it(e,i,s,{vgChannel:o,ignoreVgConfig:!0})),l!==void 0&&(a=vt(l)));const u=r[e];return dc(t,u,o??e,c=>T_({channel:e,channelDef:c,markDef:i,config:s,scaleName:t.scaleName(e),scale:t.getScaleComponent(e),stack:null,defaultRef:a}))}function IO(e,t={filled:void 0}){const{markDef:n,encoding:i,config:r}=e,{type:s}=n,o=t.filled??it("filled",n,r),a=Pe(["bar","point","circle","square","geoshape"],s)?"transparent":void 0,l=it(o===!0?"color":void 0,n,r,{vgChannel:"fill"})??r.mark[o===!0&&"color"]??a,u=it(o===!1?"color":void 0,n,r,{vgChannel:"stroke"})??r.mark[o===!1&&"color"],c=o?"fill":"stroke",f={...l?{fill:vt(l)}:{},...u?{stroke:vt(u)}:{}};return n.color&&(o?n.fill:n.stroke)&&Y(ED("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,...Qt("color",e,{vgChannel:c,defaultValue:o?l:u}),...Qt("fill",e,{defaultValue:i.fill?l:void 0}),...Qt("stroke",e,{defaultValue:i.stroke?u:void 0})}}function fge(e){const{encoding:t,mark:n}=e,i=t.order;return!Qo(n)&&wr(i)?dc(e,i,"zindex",r=>vt(r.value)):{}}function hc({channel:e,markDef:t,encoding:n={},model:i,bandPosition:r}){const s=`${e}Offset`,o=t[s],a=n[s];if((s==="xOffset"||s==="yOffset")&&a)return{offsetType:"encoding",offset:T_({channel:s,channelDef:a,markDef:t,config:i==null?void 0:i.config,scaleName:i.scaleName(s),scale:i.getScaleComponent(s),stack:null,defaultRef:vt(o),bandPosition:r})};const l=t[s];return l?{offsetType:"visual",offset:l}:{}}function $n(e,t,{defaultPos:n,vgChannel:i}){const{encoding:r,markDef:s,config:o,stack:a}=t,l=r[e],u=r[ss(e)],c=t.scaleName(e),f=t.getScaleComponent(e),{offset:d,offsetType:h}=hc({channel:e,markDef:s,encoding:r,model:t,bandPosition:.5}),p=uw({model:t,defaultPos:n,channel:e,scaleName:c,scale:f}),g=!l&&Nt(e)&&(r.latitude||r.longitude)?{field:t.getName(e)}:dge({channel:e,channelDef:l,channel2Def:u,markDef:s,config:o,scaleName:c,scale:f,stack:a,offset:d,defaultRef:p,bandPosition:h==="encoding"?0:void 0});return g?{[i||e]:g}:void 0}function dge(e){const{channel:t,channelDef:n,scaleName:i,stack:r,offset:s,markDef:o}=e;if(Se(n)&&r&&t===r.fieldChannel){if(Z(n)){let a=n.bandPosition;if(a===void 0&&o.type==="text"&&(t==="radius"||t==="theta")&&(a=.5),a!==void 0)return A1({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",bandPosition:a,offset:s})}return hl(n,i,{suffix:"end"},{offset:s})}return S_(e)}function uw({model:e,defaultPos:t,channel:n,scaleName:i,scale:r}){const{markDef:s,config:o}=e;return()=>{const a=ol(n),l=Yo(n),u=it(n,s,o,{vgChannel:l});if(u!==void 0)return qd(n,u);switch(t){case"zeroOrMin":case"zeroOrMax":if(i){const c=r.get("type");if(!Pe([ui.LOG,ui.TIME,ui.UTC],c)){if(r.domainDefinitelyIncludesZero())return{scale:i,value:0}}}if(t==="zeroOrMin")return a==="y"?{field:{group:"height"}}:{value:0};switch(a){case"radius":return{signal:`min(${e.width.signal},${e.height.signal})/2`};case"theta":return{signal:"2*PI"};case"x":return{field:{group:"width"}};case"y":return{value:0}}break;case"mid":return{...e[ai(n)],mult:.5}}}}const hge={left:"x",center:"xc",right:"x2"},pge={top:"y",middle:"yc",bottom:"y2"};function zO(e,t,n,i="middle"){if(e==="radius"||e==="theta")return Yo(e);const r=e==="x"?"align":"baseline",s=it(r,t,n);let o;return de(s)?(Y(kfe(r)),o=void 0):o=s,e==="x"?hge[o||(i==="top"?"left":"center")]:pge[o||i]}function K1(e,t,{defaultPos:n,defaultPos2:i,range:r}){return r?PO(e,t,{defaultPos:n,defaultPos2:i}):$n(e,t,{defaultPos:n})}function PO(e,t,{defaultPos:n,defaultPos2:i}){const{markDef:r,config:s}=t,o=ss(e),a=ai(e),l=gge(t,i,o),u=l[a]?zO(e,r,s):Yo(e);return{...$n(e,t,{defaultPos:n,vgChannel:u}),...l}}function gge(e,t,n){const{encoding:i,mark:r,markDef:s,stack:o,config:a}=e,l=ol(n),u=ai(n),c=Yo(n),f=i[l],d=e.scaleName(l),h=e.getScaleComponent(l),{offset:p}=n in i||n in s?hc({channel:n,markDef:s,encoding:i,model:e}):hc({channel:l,markDef:s,encoding:i,model:e});if(!f&&(n==="x2"||n==="y2")&&(i.latitude||i.longitude)){const m=ai(n),y=e.markDef[m];return y!=null?{[m]:{value:y}}:{[c]:{field:e.getName(n)}}}const g=mge({channel:n,channelDef:f,channel2Def:i[n],markDef:s,config:a,scaleName:d,scale:h,stack:o,offset:p,defaultRef:void 0});return g!==void 0?{[c]:g}:J1(n,s)||J1(n,{[n]:v1(n,s,a.style),[u]:v1(u,s,a.style)})||J1(n,a[r])||J1(n,a.mark)||{[c]:uw({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}function mge({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:s,scale:o,stack:a,offset:l,defaultRef:u}){return Se(t)&&a&&e.charAt(0)===a.fieldChannel.charAt(0)?hl(t,s,{suffix:"start"},{offset:l}):S_({channel:e,channelDef:n,scaleName:s,scale:o,stack:a,markDef:i,config:r,offset:l,defaultRef:u})}function J1(e,t){const n=ai(e),i=Yo(e);if(t[i]!==void 0)return{[i]:qd(e,t[i])};if(t[e]!==void 0)return{[i]:qd(e,t[e])};if(t[n]){const r=t[n];if(dl(r))Y(yfe(n));else return{[n]:qd(e,r)}}}function ra(e,t){const{config:n,encoding:i,markDef:r}=e,s=r.type,o=ss(t),a=ai(t),l=i[t],u=i[o],c=e.getScaleComponent(t),f=c?c.get("type"):void 0,d=r.orient,h=i[a]??i.size??it("size",r,n,{vgChannel:a}),p=JF(t),g=s==="bar"&&(t==="x"?d==="vertical":d==="horizontal");return Z(l)&&(mt(l.bin)||un(l.bin)||l.timeUnit&&!u)&&!(h&&!dl(h))&&!i[p]&&!Jt(f)?vge({fieldDef:l,fieldDef2:u,channel:t,model:e}):(Se(l)&&Jt(f)||g)&&!u?bge(l,t,e):PO(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function yge(e,t,n,i,r,s,o){if(dl(r))if(n){const l=n.get("type");if(l==="band"){let u=`bandwidth('${t}')`;r.band!==1&&(u=`${r.band} * ${u}`);const c=Gs("minBandSize",{type:o},i);return{signal:c?`max(${vr(c)}, ${u})`:u}}else r.band!==1&&(Y(Sfe(l)),r=void 0)}else return{mult:r.band,field:{group:e}};else{if(de(r))return r;if(r)return{value:r}}if(n){const l=n.get("range");if(Jo(l)&&Xe(l.step))return{value:l.step-2}}if(!s){const{bandPaddingInner:l,barBandPaddingInner:u,rectBandPaddingInner:c}=i.scale,f=Dt(l,o==="bar"?u:c);if(de(f))return{signal:`(1 - (${f.signal})) * ${e}`};if(Xe(f))return{signal:`${1-f} * ${e}`}}return{value:W1(i.view,e)-2}}function bge(e,t,n){var S,E;const{markDef:i,encoding:r,config:s,stack:o}=n,a=i.orient,l=n.scaleName(t),u=n.getScaleComponent(t),c=ai(t),f=ss(t),d=JF(t),h=n.scaleName(d),p=n.getScaleComponent(J7(t)),g=a==="horizontal"&&t==="y"||a==="vertical"&&t==="x";let m;(r.size||i.size)&&(g?m=Qt("size",n,{vgChannel:c,defaultRef:vt(i.size)}):Y(Ffe(i.type)));const y=!!m,b=hN({channel:t,fieldDef:e,markDef:i,config:s,scaleType:(S=u||p)==null?void 0:S.get("type"),useVlSizeChannel:g});m=m||{[c]:yge(c,h||l,p||u,s,b,!!e,i.type)};const v=((E=u||p)==null?void 0:E.get("type"))==="band"&&dl(b)&&!y?"top":"middle",x=zO(t,i,s,v),_=x==="xc"||x==="yc",{offset:k,offsetType:w}=hc({channel:t,markDef:i,encoding:r,model:n,bandPosition:_?.5:0}),$=S_({channel:t,channelDef:e,markDef:i,config:s,scaleName:l,scale:u,stack:o,offset:k,defaultRef:uw({model:n,defaultPos:"mid",channel:t,scaleName:l,scale:u}),bandPosition:_?w==="encoding"?0:.5:de(b)?{signal:`(1-${b})/2`}:dl(b)?(1-b.band)/2:0});if(c)return{[x]:$,...m};{const A=Yo(f),R=m[c],C=k?{...R,offset:k}:R;return{[x]:$,[A]:q($)?[$[0],{...$[1],offset:C}]:{...$,offset:C}}}}function BO(e,t,n,i,r,s,o){if(GF(e))return 0;const a=e==="x"||e==="y2",l=a?-t/2:t/2;if(de(n)||de(r)||de(i)||s){const u=vr(n),c=vr(r),f=vr(i),d=vr(s),p=s?`(${o} < ${d} ? ${a?"":"-"}0.5 * (${d} - (${o})) : ${l})`:l,g=f?`${f} + `:"",m=u?`(${u} ? -1 : 1) * `:"",y=c?`(${c} + ${p})`:p;return{signal:g+m+y}}else return r=r||0,i+(n?-r-l:+r+l)}function vge({fieldDef:e,fieldDef2:t,channel:n,model:i}){var E;const{config:r,markDef:s,encoding:o}=i,a=i.getScaleComponent(n),l=i.scaleName(n),u=a?a.get("type"):void 0,c=a.get("reverse"),f=hN({channel:n,fieldDef:e,markDef:s,config:r,scaleType:u}),d=(E=i.component.axes[n])==null?void 0:E[0],h=(d==null?void 0:d.get("translate"))??.5,p=Nt(n)?it("binSpacing",s,r)??0:0,g=ss(n),m=Yo(n),y=Yo(g),b=Gs("minBandSize",s,r),{offset:v}=hc({channel:n,markDef:s,encoding:o,model:i,bandPosition:0}),{offset:x}=hc({channel:g,markDef:s,encoding:o,model:i,bandPosition:0}),_=Zde({fieldDef:e,scaleName:l}),k=BO(n,p,c,h,v,b,_),w=BO(g,p,c,h,x??v,b,_),$=de(f)?{signal:`(1-${f.signal})/2`}:dl(f)?(1-f.band)/2:.5,S=ea({fieldDef:e,fieldDef2:t,markDef:s,config:r});if(mt(e.bin)||e.timeUnit){const A=e.timeUnit&&S!==.5;return{[y]:jO({fieldDef:e,scaleName:l,bandPosition:$,offset:w,useRectOffsetField:A}),[m]:jO({fieldDef:e,scaleName:l,bandPosition:de($)?{signal:`1-${$.signal}`}:1-$,offset:k,useRectOffsetField:A})}}else if(un(e.bin)){const A=hl(e,l,{},{offset:w});if(Z(t))return{[y]:A,[m]:hl(t,l,{},{offset:k})};if(al(e.bin)&&e.bin.step)return{[y]:A,[m]:{signal:`scale("${l}", ${Q(e,{expr:"datum"})} + ${e.bin.step})`,offset:k}}}Y(MD(g))}function jO({fieldDef:e,scaleName:t,bandPosition:n,offset:i,useRectOffsetField:r}){return A1({scaleName:t,fieldOrDatumDef:e,bandPosition:n,offset:i,...r?{startSuffix:X1,endSuffix:Y1}:{}})}const xge=new Set(["aria","width","height"]);function Hi(e,t){const{fill:n=void 0,stroke:i=void 0}=t.color==="include"?IO(e):{};return{..._ge(e.markDef,t),...UO(e,"fill",n),...UO(e,"stroke",i),...Qt("opacity",e),...Qt("fillOpacity",e),...Qt("strokeOpacity",e),...Qt("strokeWidth",e),...Qt("strokeDash",e),...fge(e),...OO(e),...lw(e,"href"),...lge(e)}}function UO(e,t,n){const{config:i,mark:r,markDef:s}=e;if(it("invalid",s,i)==="hide"&&n&&!Qo(r)){const a=wge(e,{invalid:!0,channels:y1});if(a)return{[t]:[{test:a,value:null},...ee(n)]}}return n?{[t]:n}:{}}function _ge(e,t){return Hce.reduce((n,i)=>(!xge.has(i)&&e[i]!==void 0&&t[i]!=="ignore"&&(n[i]=vt(e[i])),n),{})}function wge(e,{invalid:t=!1,channels:n}){const i=n.reduce((s,o)=>{const a=e.getScaleComponent(o);if(a){const l=a.get("type"),u=e.vgField(o,{expr:"datum"});u&&Ei(l)&&(s[u]=!0)}return s},{}),r=G(i);if(r.length>0){const s=t?"||":"&&";return r.map(o=>A_(o,t)).join(` ${s} `)}}function cw(e){const{config:t,markDef:n}=e;if(it("invalid",n,t)){const r=kge(e,{channels:os});if(r)return{defined:{signal:r}}}return{}}function kge(e,{invalid:t=!1,channels:n}){const i=n.reduce((s,o)=>{var l;const a=e.getScaleComponent(o);if(a){const u=a.get("type"),c=e.vgField(o,{expr:"datum",binSuffix:(l=e.stack)!=null&&l.impute?"mid":void 0});c&&Ei(u)&&(s[c]=!0)}return s},{}),r=G(i);if(r.length>0){const s=t?"||":"&&";return r.map(o=>A_(o,t)).join(` ${s} `)}}function qO(e,t){if(t!==void 0)return{[e]:vt(t)}}const fw="voronoi",WO={defined:e=>e.type==="point"&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(fw)},marks:(e,t,n)=>{const{x:i,y:r}=t.project.hasChannel,s=e.mark;if(Qo(s))return Y(Kce(s)),n;const o={name:e.getName(fw),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...OO(e,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:i||!r?"datum.datum.x || 0":"0"},y:{expr:r||!i?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let a=0,l=!1;return n.forEach((u,c)=>{const f=u.name??"";f===e.component.mark[0].name?a=c:f.indexOf(fw)>=0&&(l=!0)}),l||n.splice(a+1,0,o),n}},HO={defined:e=>e.type==="point"&&e.resolve==="global"&&e.bind&&e.bind!=="scales"&&!H_(e.bind),parse:(e,t,n)=>tR(t,n),topLevelSignals:(e,t,n)=>{const i=t.name,r=t.project,s=t.bind,o=t.init&&t.init[0],a=WO.defined(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return r.items.forEach((l,u)=>{const c=_t(`${i}_${l.field}`);n.filter(d=>d.name===c).length||n.unshift({name:c,...o?{init:yl(o[u])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${a}[${J(l.field)}] : null`}]:[],bind:s[l.field]??s[l.channel]??s})}),n},signals:(e,t,n)=>{const i=t.name,r=t.project,s=n.filter(u=>u.name===i+sa)[0],o=i+Zd,a=r.items.map(u=>_t(`${i}_${u.field}`)),l=a.map(u=>`${u} !== null`).join(" && ");return a.length&&(s.update=`${l} ? {fields: ${o}, values: [${a.join(", ")}]} : null`),delete s.value,delete s.on,n}},Q1="_toggle",GO={defined:e=>e.type==="point"&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+Q1,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+sa,i=t.name+Q1;return`${i} ? null : ${n}, `+(t.resolve==="global"?`${i} ? null : true, `:`${i} ? null : {unit: ${vl(e)}}, `)+`${i} ? ${n} : null`}},$ge={defined:e=>e.clear!==void 0&&e.clear!==!1,parse:(e,t)=>{t.clear&&(t.clear=te(t.clear)?jo(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(HO.defined(t))for(const i of t.project.items){const r=n.findIndex(s=>s.name===_t(`${t.name}_${i.field}`));r!==-1&&n[r].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function i(r,s){r!==-1&&n[r].on&&n[r].on.push({events:t.clear,update:s})}if(t.type==="interval")for(const r of t.project.items){const s=n.findIndex(o=>o.name===r.signals.visual);if(i(s,"[0, 0]"),s===-1){const o=n.findIndex(a=>a.name===r.signals.data);i(o,"null")}}else{let r=n.findIndex(s=>s.name===t.name+sa);i(r,"null"),GO.defined(t)&&(r=n.findIndex(s=>s.name===t.name+Q1),i(r,"false"))}return n}},VO={defined:e=>{const t=e.resolve==="global"&&e.bind&&H_(e.bind),n=e.project.items.length===1&&e.project.items[0].field!==kr;return t&&!n&&Y(efe),t&&n},parse:(e,t,n)=>{const i=Ce(n);if(i.select=te(i.select)?{type:i.select,toggle:t.toggle}:{...i.select,toggle:t.toggle},tR(t,i),ie(n.select)&&(n.select.on||n.select.clear)){const o='event.item && indexof(event.item.mark.role, "legend") < 0';for(const a of t.events)a.filter=ee(a.filter??[]),a.filter.includes(o)||a.filter.push(o)}const r=G_(t.bind)?t.bind.legend:"click",s=te(r)?jo(r,"view"):ee(r);t.bind={legend:{merge:s}}},topLevelSignals:(e,t,n)=>{const i=t.name,r=G_(t.bind)&&t.bind.legend,s=o=>a=>{const l=Ce(a);return l.markname=o,l};for(const o of t.project.items){if(!o.hasLegend)continue;const a=`${_t(o.field)}_legend`,l=`${i}_${a}`;if(n.filter(c=>c.name===l).length===0){const c=r.merge.map(s(`${a}_symbols`)).concat(r.merge.map(s(`${a}_labels`))).concat(r.merge.map(s(`${a}_entries`)));n.unshift({name:l,...t.init?{}:{value:null},on:[{events:c,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:r.merge,update:`!event.item || !datum ? null : ${l}`,force:!0}]})}}return n},signals:(e,t,n)=>{const i=t.name,r=t.project,s=n.find(d=>d.name===i+sa),o=i+Zd,a=r.items.filter(d=>d.hasLegend).map(d=>_t(`${i}_${_t(d.field)}_legend`)),u=`${a.map(d=>`${d} !== null`).join(" && ")} ? {fields: ${o}, values: [${a.join(", ")}]} : null`;t.events&&a.length>0?s.on.push({events:a.map(d=>({signal:d})),update:u}):a.length>0&&(s.update=u,delete s.value,delete s.on);const c=n.find(d=>d.name===i+Q1),f=G_(t.bind)&&t.bind.legend;return c&&(t.events?c.on.push({...c.on[0],events:f}):c.on[0].events=f),n}};function Ege(e,t,n){var r;const i=(r=e.fieldDef(t))==null?void 0:r.field;for(const s of ln(e.component.selection??{})){const o=s.project.hasField[i]??s.project.hasChannel[t];if(o&&VO.defined(s)){const a=n.get("selections")??[];a.push(s.name),n.set("selections",a,!1),o.hasLegend=!0}}}const XO="_translate_anchor",YO="_translate_delta",Cge={defined:e=>e.type==="interval"&&e.translate,signals:(e,t,n)=>{const i=t.name,r=Zs.defined(t),s=i+XO,{x:o,y:a}=t.project.hasChannel;let l=jo(t.translate,"scope");return r||(l=l.map(u=>(u.between[0].markname=i+fc,u))),n.push({name:s,value:{},on:[{events:l.map(u=>u.between[0]),update:"{x: x(unit), y: y(unit)"+(o!==void 0?`, extent_x: ${r?aw(e,wt):`slice(${o.signals.visual})`}`:"")+(a!==void 0?`, extent_y: ${r?aw(e,Zt):`slice(${a.signals.visual})`}`:"")+"}"}]},{name:i+YO,value:{},on:[{events:l,update:`{x: ${s}.x - x(unit), y: ${s}.y - y(unit)}`}]}),o!==void 0&&ZO(e,t,o,"width",n),a!==void 0&&ZO(e,t,a,"height",n),n}};function ZO(e,t,n,i,r){const s=t.name,o=s+XO,a=s+YO,l=n.channel,u=Zs.defined(t),c=r.filter(_=>_.name===n.signals[u?"data":"visual"])[0],f=e.getSizeSignalRef(i).signal,d=e.getScaleComponent(l),h=d&&d.get("type"),p=d&&d.get("reverse"),g=u?l===wt?p?"":"-":p?"-":"":"",m=`${o}.extent_${l}`,y=`${g}${a}.${l} / ${u?`${f}`:`span(${m})`}`,b=!u||!d?"panLinear":h==="log"?"panLog":h==="symlog"?"panSymlog":h==="pow"?"panPow":"panLinear",v=u?h==="pow"?`, ${d.get("exponent")??1}`:h==="symlog"?`, ${d.get("constant")??1}`:"":"",x=`${b}(${m}, ${y}${v})`;c.on.push({events:{signal:a},update:u?x:`clampRange(${x}, 0, ${f})`})}const KO="_zoom_anchor",JO="_zoom_delta",Sge={defined:e=>e.type==="interval"&&e.zoom,signals:(e,t,n)=>{const i=t.name,r=Zs.defined(t),s=i+JO,{x:o,y:a}=t.project.hasChannel,l=J(e.scaleName(wt)),u=J(e.scaleName(Zt));let c=jo(t.zoom,"scope");return r||(c=c.map(f=>(f.markname=i+fc,f))),n.push({name:i+KO,on:[{events:c,update:r?"{"+[l?`x: invert(${l}, x(unit))`:"",u?`y: invert(${u}, y(unit))`:""].filter(f=>f).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:s,on:[{events:c,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),o!==void 0&&QO(e,t,o,"width",n),a!==void 0&&QO(e,t,a,"height",n),n}};function QO(e,t,n,i,r){const s=t.name,o=n.channel,a=Zs.defined(t),l=r.filter(b=>b.name===n.signals[a?"data":"visual"])[0],u=e.getSizeSignalRef(i).signal,c=e.getScaleComponent(o),f=c&&c.get("type"),d=a?aw(e,o):l.name,h=s+JO,p=`${s}${KO}.${o}`,g=!a||!c?"zoomLinear":f==="log"?"zoomLog":f==="symlog"?"zoomSymlog":f==="pow"?"zoomPow":"zoomLinear",m=a?f==="pow"?`, ${c.get("exponent")??1}`:f==="symlog"?`, ${c.get("constant")??1}`:"":"",y=`${g}(${d}, ${p}, ${h}${m})`;l.on.push({events:{signal:h},update:a?y:`clampRange(${y}, 0, ${u})`})}const bl="_store",sa="_tuple",Age="_modify",eR="vlSelectionResolve",em=[age,sge,ige,GO,HO,Zs,VO,$ge,Cge,Sge,WO];function Tge(e){let t=e.parent;for(;t&&!Cr(t);)t=t.parent;return t}function vl(e,{escape:t}={escape:!0}){let n=t?J(e.name):e.name;const i=Tge(e);if(i){const{facet:r}=i;for(const s of Wi)r[s]&&(n+=` + '__facet_${s}_' + (facet[${J(i.vgField(s))}])`)}return n}function dw(e){return ln(e.component.selection??{}).reduce((t,n)=>t||n.project.hasSelectionId,!1)}function tR(e,t){(te(t.select)||!t.select.on)&&delete e.events,(te(t.select)||!t.select.clear)&&delete e.clear,(te(t.select)||!t.select.toggle)&&delete e.toggle}function hw(e){const t=[];return e.type==="Identifier"?[e.name]:e.type==="Literal"?[e.value]:(e.type==="MemberExpression"&&(t.push(...hw(e.object)),t.push(...hw(e.property))),t)}function nR(e){return e.object.type==="MemberExpression"?nR(e.object):e.object.name==="datum"}function iR(e){const t=Hx(e),n=new Set;return t.visit(i=>{i.type==="MemberExpression"&&nR(i)&&n.add(hw(i).slice(1).join("."))}),n}class pc extends ot{clone(){return new pc(null,this.model,Ce(this.filter))}constructor(t,n,i){super(t),this.model=n,this.filter=i,this.expr=tm(this.model,this.filter,this),this._dependentFields=iR(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function Mge(e,t){const n={},i=e.config.selection;if(!t||!t.length)return n;for(const r of t){const s=_t(r.name),o=r.select,a=te(o)?o:o.type,l=ie(o)?Ce(o):{type:a},u=i[a];for(const d in u)d==="fields"||d==="encodings"||(d==="mark"&&(l[d]={...u[d],...l[d]}),(l[d]===void 0||l[d]===!0)&&(l[d]=Ce(u[d]??l[d])));const c=n[s]={...l,name:s,type:a,init:r.value,bind:r.bind,events:te(l.on)?jo(l.on,"scope"):ee(Ce(l.on))},f=Ce(r);for(const d of em)d.defined(c)&&d.parse&&d.parse(e,c,f)}return n}function rR(e,t,n,i="datum"){const r=te(t)?t:t.param,s=_t(r),o=J(s+bl);let a;try{a=e.getSelectionComponent(s,r)}catch{return`!!${s}`}if(a.project.timeUnit){const d=n??e.component.data.raw,h=a.project.timeUnit.clone();d.parent?h.insertAsParentOf(d):d.parent=h}const l=a.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",u=a.resolve==="global"?")":`, ${J(a.resolve)})`,c=`${l}${o}, ${i}${u}`,f=`length(data(${o}))`;return t.empty===!1?`${f} && ${c}`:`!${f} || ${c}`}function sR(e,t,n){const i=_t(t),r=n.encoding;let s=n.field,o;try{o=e.getSelectionComponent(i,t)}catch{return i}if(!r&&!s)s=o.project.items[0].field,o.project.items.length>1&&Y(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${J(s)}.`);else if(r&&!s){const a=o.project.items.filter(l=>l.channel===r);!a.length||a.length>1?(s=o.project.items[0].field,Y((a.length?"Multiple ":"No ")+`matching ${J(r)} encoding found for selection ${J(n.param)}. Using "field": ${J(s)}.`)):s=a[0].field}return`${o.name}[${J(ji(s))}]`}function Fge(e,t){for(const[n,i]of qo(e.component.selection??{})){const r=e.getName(`lookup_${n}`);e.component.data.outputNodes[r]=i.materialized=new qn(new pc(t,e,{param:n}),r,yt.Lookup,e.component.data.outputNodeRefCounts)}}function tm(e,t,n){return Od(t,i=>te(i)?i:pde(i)?rR(e,i,n):UD(i))}function Dge(e,t){if(e)return q(e)&&!Ko(e)?e.map(n=>R_(n,t)).join(", "):e}function pw(e,t,n,i){var r,s;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(s=e.encode[t]).update??(s.update={}),e.encode[t].update[n]=i}function Jd(e,t,n,i={header:!1}){var f,d;const{disable:r,orient:s,scale:o,labelExpr:a,title:l,zindex:u,...c}=e.combine();if(!r){for(const h in c){const p=ghe[h],g=c[h];if(p&&p!==t&&p!=="both")delete c[h];else if(Xd(g)){const{condition:m,...y}=g,b=ee(m),v=$N[h];if(v){const{vgProp:x,part:_}=v,k=[...b.map(w=>{const{test:$,...S}=w;return{test:tm(null,$),...S}}),y];pw(c,_,x,k),delete c[h]}else if(v===null){const x={signal:b.map(_=>{const{test:k,...w}=_;return`${tm(null,k)} ? ${uD(w)} : `}).join("")+uD(y)};c[h]=x}}else if(de(g)){const m=$N[h];if(m){const{vgProp:y,part:b}=m;pw(c,b,y,g),delete c[h]}}Pe(["labelAlign","labelBaseline"],h)&&c[h]===null&&delete c[h]}if(t==="grid"){if(!c.grid)return;if(c.encode){const{grid:h}=c.encode;c.encode={...h?{grid:h}:{}},lt(c.encode)&&delete c.encode}return{scale:o,orient:s,...c,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:Dt(u,0)}}else{if(!i.header&&e.mainExtracted)return;if(a!==void 0){let p=a;(d=(f=c.encode)==null?void 0:f.labels)!=null&&d.update&&de(c.encode.labels.update.text)&&(p=il(a,"datum.label",c.encode.labels.update.text.signal)),pw(c,"labels","text",{signal:p})}if(c.labelAlign===null&&delete c.labelAlign,c.encode){for(const p of EN)e.hasAxisPart(p)||delete c.encode[p];lt(c.encode)&&delete c.encode}const h=Dge(l,n);return{scale:o,orient:s,grid:!1,...h?{title:h}:{},...c,...n.aria===!1?{aria:!1}:{},zindex:Dt(u,0)}}}}function oR(e){const{axes:t}=e.component,n=[];for(const i of os)if(t[i]){for(const r of t[i])if(!r.get("disable")&&!r.get("gridScale")){const s=i==="x"?"height":"width",o=e.getSizeSignalRef(s).signal;s!==o&&n.push({name:s,update:o})}}return n}function Nge(e,t){const{x:n=[],y:i=[]}=e;return[...n.map(r=>Jd(r,"grid",t)),...i.map(r=>Jd(r,"grid",t)),...n.map(r=>Jd(r,"main",t)),...i.map(r=>Jd(r,"main",t))].filter(r=>r)}function aR(e,t,n,i){return Object.assign.apply(null,[{},...e.map(r=>{if(r==="axisOrient"){const s=n==="x"?"bottom":"left",o=t[n==="x"?"axisBottom":"axisLeft"]||{},a=t[n==="x"?"axisTop":"axisRight"]||{},l=new Set([...G(o),...G(a)]),u={};for(const c of l.values())u[c]={signal:`${i.signal} === "${s}" ? ${vr(o[c])} : ${vr(a[c])}`};return u}return t[r]})])}function Oge(e,t,n,i){const r=t==="band"?["axisDiscrete","axisBand"]:t==="point"?["axisDiscrete","axisPoint"]:VD(t)?["axisQuantitative"]:t==="time"||t==="utc"?["axisTemporal"]:[],s=e==="x"?"axisX":"axisY",o=de(n)?"axisOrient":`axis${Rd(n)}`,a=[...r,...r.map(u=>s+u.substr(4))],l=["axis",o,s];return{vlOnlyAxisConfig:aR(a,i,e,n),vgAxisConfig:aR(l,i,e,n),axisConfigStyle:Rge([...l,...a],i)}}function Rge(e,t){var i;const n=[{}];for(const r of e){let s=(i=t[r])==null?void 0:i.style;if(s){s=ee(s);for(const o of s)n.push(t.style[o])}}return Object.assign.apply(null,n)}function gw(e,t,n,i={}){var s;const r=fD(e,n,t);if(r!==void 0)return{configFrom:"style",configValue:r};for(const o of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(((s=i[o])==null?void 0:s[e])!==void 0)return{configFrom:o,configValue:i[o][e]};return{}}const lR={scale:({model:e,channel:t})=>e.scaleName(t),format:({format:e})=>e,formatType:({formatType:e})=>e,grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>t.grid??Lge(n,e),gridScale:({model:e,channel:t})=>Ige(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelAlign||cR(t,n,i),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelBaseline||uR(t,n,i),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??Pge(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??Bge(t.type,n,Z(t)&&!!t.timeUnit,Z(t)?t.sort:void 0),orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:i,scaleType:r})=>{const s=e==="x"?"width":e==="y"?"height":void 0,o=s?t.getSizeSignalRef(s):void 0;return n.tickCount??Uge({fieldOrDatumDef:i,scaleType:r,size:o,values:n.values})},tickMinStep:qge,title:({axis:e,model:t,channel:n})=>{if(e.title!==void 0)return e.title;const i=fR(t,n);if(i!==void 0)return i;const r=t.typedFieldDef(n),s=n==="x"?"x2":"y2",o=t.fieldDef(s);return hD(r?[dN(r)]:[],Z(o)?[dN(o)]:[])},values:({axis:e,fieldOrDatumDef:t})=>Wge(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??Hge(n,t)};function Lge(e,t){return!Jt(e)&&Z(t)&&!mt(t==null?void 0:t.bin)&&!un(t==null?void 0:t.bin)}function Ige(e,t){const n=t==="x"?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}function zge(e,t,n,i,r){const s=t==null?void 0:t.labelAngle;if(s!==void 0)return de(s)?s:Ld(s);{const{configValue:o}=gw("labelAngle",i,t==null?void 0:t.style,r);return o!==void 0?Ld(o):n===wt&&Pe([__,x_],e.type)&&!(Z(e)&&e.timeUnit)?270:void 0}}function mw(e){return`(((${e.signal} % 360) + 360) % 360)`}function uR(e,t,n,i){if(e!==void 0)if(n==="x"){if(de(e)){const r=mw(e),s=de(t)?`(${t.signal} === "top")`:t==="top";return{signal:`(45 < ${r} && ${r} < 135) || (225 < ${r} && ${r} < 315) ? "middle" :(${r} <= 45 || 315 <= ${r}) === ${s} ? "bottom" : "top"`}}if(45{if(gl(i)&&fN(i.sort)){const{field:s,timeUnit:o}=i,a=i.sort,l=a.map((u,c)=>`${UD({field:s,timeUnit:o,equal:u})} ? ${c} : `).join("")+a.length;t=new gc(t,{calculate:l,as:mc(i,r,{forAs:!0})})}}),t}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${ze(this.transform)}`}}function mc(e,t,n){return Q(e,{prefix:t,suffix:"sort_index",...n??{}})}function nm(e,t){return Pe(["top","bottom"],t)?"column":Pe(["left","right"],t)||e==="row"?"row":"column"}function yc(e,t,n,i){const r=i==="row"?n.headerRow:i==="column"?n.headerColumn:n.headerFacet;return Dt((t||{})[e],r[e],n.header[e])}function im(e,t,n,i){const r={};for(const s of e){const o=yc(s,t||{},n,i);o!==void 0&&(r[s]=o)}return r}const yw=["row","column"],bw=["header","footer"];function Gge(e,t){const n=e.component.layoutHeaders[t].title,i=e.config?e.config:void 0,r=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:s,titleAngle:o,titleOrient:a}=im(["titleAnchor","titleAngle","titleOrient"],r.header,i,t),l=nm(t,a),u=Ld(o);return{name:`${t}-title`,type:"group",role:`${l}-title`,title:{text:n,...t==="row"?{orient:"left"}:{},style:"guide-title",...hR(u,l),...dR(l,u,s),...pR(i,r,t,Lhe,WN)}}}function dR(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const i=cR(t,e==="row"?"left":"top",e==="row"?"y":"x");return i?{align:i}:{}}function hR(e,t){const n=uR(e,t==="row"?"left":"top",t==="row"?"y":"x",!0);return n?{baseline:n}:{}}function Vge(e,t){const n=e.component.layoutHeaders[t],i=[];for(const r of bw)if(n[r])for(const s of n[r]){const o=Yge(e,t,r,n,s);o!=null&&i.push(o)}return i}function Xge(e,t){const{sort:n}=e;return us(n)?{field:Q(n,{expr:"datum"}),order:n.order??"ascending"}:q(n)?{field:mc(e,t,{expr:"datum"}),order:"ascending"}:{field:Q(e,{expr:"datum"}),order:n??"ascending"}}function vw(e,t,n){const{format:i,formatType:r,labelAngle:s,labelAnchor:o,labelOrient:a,labelExpr:l}=im(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),u=M_({fieldOrDatumDef:e,format:i,formatType:r,expr:"parent",config:n}).signal,c=nm(t,a);return{text:{signal:l?il(il(l,"datum.label",u),"datum.value",Q(e,{expr:"parent"})):u},...t==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",...hR(s,c),...dR(c,s,o),...pR(n,e,t,Ihe,HN)}}function Yge(e,t,n,i,r){if(r){let s=null;const{facetFieldDef:o}=i,a=e.config?e.config:void 0;if(o&&r.labels){const{labelOrient:f}=im(["labelOrient"],o.header,a,t);(t==="row"&&!Pe(["top","bottom"],f)||t==="column"&&!Pe(["left","right"],f))&&(s=vw(o,t,a))}const l=Cr(e)&&!Hd(e.facet),u=r.axes,c=(u==null?void 0:u.length)>0;if(s||c){const f=t==="row"?"height":"width";return{name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`,...i.facetFieldDef?{from:{data:e.getName(`${t}_domain`)},sort:Xge(o,t)}:{},...c&&l?{from:{data:e.getName(`facet_domain_${t}`)}}:{},...s?{title:s}:{},...r.sizeSignal?{encode:{update:{[f]:r.sizeSignal}}}:{},...c?{axes:u}:{}}}}return null}const Zge={column:{start:0,end:1},row:{start:1,end:0}};function Kge(e,t){return Zge[t][e]}function Jge(e,t){const n={};for(const i of Wi){const r=e[i];if(r!=null&&r.facetFieldDef){const{titleAnchor:s,titleOrient:o}=im(["titleAnchor","titleOrient"],r.facetFieldDef.header,t,i),a=nm(i,o),l=Kge(s,a);l!==void 0&&(n[a]=l)}}return lt(n)?void 0:n}function pR(e,t,n,i,r){const s={};for(const o of i){if(!r[o])continue;const a=yc(o,t==null?void 0:t.header,e,n);a!==void 0&&(s[r[o]]=a)}return s}function xw(e){return[...rm(e,"width"),...rm(e,"height"),...rm(e,"childWidth"),...rm(e,"childHeight")]}function rm(e,t){const n=t==="width"?"x":"y",i=e.component.layoutSize.get(t);if(!i||i==="merged")return[];const r=e.getSizeSignalRef(t).signal;if(i==="step"){const s=e.getScaleComponent(n);if(s){const o=s.get("type"),a=s.get("range");if(Jt(o)&&Jo(a)){const l=e.scaleName(n);return Cr(e.parent)&&e.parent.component.resolve.scale[n]==="independent"?[gR(l,a)]:[gR(l,a),{name:r,update:mR(l,s,`domain('${l}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}else if(i=="container"){const s=r.endsWith("width"),o=s?"containerSize()[0]":"containerSize()[1]",a=Z_(e.config.view,s?"width":"height"),l=`isFinite(${o}) ? ${o} : ${a}`;return[{name:r,init:l,on:[{update:l,events:"window:resize"}]}]}else return[{name:r,value:i}]}function gR(e,t){const n=`${e}_step`;return de(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function mR(e,t,n){const i=t.get("type"),r=t.get("padding"),s=Dt(t.get("paddingOuter"),r);let o=t.get("paddingInner");return o=i==="band"?o!==void 0?o:r:1,`bandspace(${n}, ${vr(o)}, ${vr(s)}) * ${e}_step`}function yR(e){return e==="childWidth"?"width":e==="childHeight"?"height":e}function bR(e,t){return G(e).reduce((n,i)=>{const r=e[i];return{...n,...dc(t,r,i,s=>vt(s.value))}},{})}function vR(e,t){if(Cr(t))return e==="theta"?"independent":"shared";if(xc(t))return"shared";if(Rw(t))return Nt(e)||e==="theta"||e==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function _w(e,t){const n=e.scale[t],i=Nt(t)?"axis":"legend";return n==="independent"?(e[i][t]==="shared"&&Y(Lfe(t)),"independent"):e[i][t]||"shared"}const Qge={...Phe,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},xR=G(Qge);class e0e extends Ys{}const _R={symbols:t0e,gradient:n0e,labels:i0e,entries:r0e};function t0e(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r,legendType:s}){if(s!=="symbol")return;const{markDef:o,encoding:a,config:l,mark:u}=n,c=o.filled&&u!=="trail";let f={...Xce({},n,Pde),...IO(n,{filled:c})};const d=r.get("symbolOpacity")??l.legend.symbolOpacity,h=r.get("symbolFillColor")??l.legend.symbolFillColor,p=r.get("symbolStrokeColor")??l.legend.symbolStrokeColor,g=d===void 0?wR(a.opacity)??o.opacity:void 0;if(f.fill){if(i==="fill"||c&&i===si)delete f.fill;else if(f.fill.field)h?delete f.fill:(f.fill=vt(l.legend.symbolBaseFillColor??"black"),f.fillOpacity=vt(g??1));else if(q(f.fill)){const m=ww(a.fill??a.color)??o.fill??(c&&o.color);m&&(f.fill=vt(m))}}if(f.stroke){if(i==="stroke"||!c&&i===si)delete f.stroke;else if(f.stroke.field||p)delete f.stroke;else if(q(f.stroke)){const m=Dt(ww(a.stroke||a.color),o.stroke,c?o.color:void 0);m&&(f.stroke={value:m})}}if(i!==Us){const m=Z(t)&&$R(n,r,t);m?f.opacity=[{test:m,...vt(g??1)},vt(l.legend.unselectedOpacity)]:g&&(f.opacity=vt(g))}return f={...f,...e},lt(f)?void 0:f}function n0e(e,{model:t,legendType:n,legendCmpt:i}){if(n!=="gradient")return;const{config:r,markDef:s,encoding:o}=t;let a={};const u=(i.get("gradientOpacity")??r.legend.gradientOpacity)===void 0?wR(o.opacity)||s.opacity:void 0;return u&&(a.opacity=vt(u)),a={...a,...e},lt(a)?void 0:a}function i0e(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r}){const s=n.legend(i)||{},o=n.config,a=Z(t)?$R(n,r,t):void 0,l=a?[{test:a,value:1},{value:o.legend.unselectedOpacity}]:void 0,{format:u,formatType:c}=s;let f;pl(c)?f=_r({fieldOrDatumDef:t,field:"datum.value",format:u,formatType:c,config:o}):u===void 0&&c===void 0&&o.customFormatTypes&&(t.type==="quantitative"&&o.numberFormatType?f=_r({fieldOrDatumDef:t,field:"datum.value",format:o.numberFormat,formatType:o.numberFormatType,config:o}):t.type==="temporal"&&o.timeFormatType&&Z(t)&&t.timeUnit===void 0&&(f=_r({fieldOrDatumDef:t,field:"datum.value",format:o.timeFormat,formatType:o.timeFormatType,config:o})));const d={...l?{opacity:l}:{},...f?{text:f}:{},...e};return lt(d)?void 0:d}function r0e(e,{legendCmpt:t}){const n=t.get("selections");return n!=null&&n.length?{...e,fill:{value:"transparent"}}:e}function wR(e){return kR(e,(t,n)=>Math.max(t,n.value))}function ww(e){return kR(e,(t,n)=>Dt(t,n.value))}function kR(e,t){if(ihe(e))return ee(e.condition).reduce(t,e.value);if(wr(e))return e.value}function $R(e,t,n){const i=t.get("selections");if(!(i!=null&&i.length))return;const r=J(n.field);return i.map(s=>`(!length(data(${J(_t(s)+bl)})) || (${s}[${r}] && indexof(${s}[${r}], datum.value) >= 0))`).join(" || ")}const ER={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:i,formatType:r}=t;return sN(e,e.type,i,r,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:i}=e;return oN(i,t,n)},gradientLength:e=>{const{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??f0e(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??d0e(n),symbolType:({legend:e,markDef:t,channel:n,encoding:i})=>e.symbolType??o0e(t.type,n,i.shape,t.shape),title:({fieldOrDatumDef:e,config:t})=>oc(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(Qu(n)&&xr(t)){if(e==="gradient")return}else if(e==="symbol")return;return e},values:({fieldOrDatumDef:e,legend:t})=>s0e(t,e)};function s0e(e,t){const n=e.values;if(q(n))return kN(t,n);if(de(n))return n}function o0e(e,t,n,i){if(t!=="shape"){const r=ww(n)??i;if(r)return r}switch(e){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}function a0e(e){const{legend:t}=e;return Dt(t.type,l0e(e))}function l0e({channel:e,timeUnit:t,scaleType:n}){if(Qu(e)){if(Pe(["quarter","month","day"],t))return"symbol";if(xr(n))return"gradient"}return"symbol"}function u0e({legendConfig:e,legendType:t,orient:n,legend:i}){return i.direction??e[t?"gradientDirection":"symbolDirection"]??c0e(n,t)}function c0e(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return t==="gradient"?"horizontal":void 0}}function f0e({legendConfig:e,model:t,direction:n,orient:i,scaleType:r}){const{gradientHorizontalMaxLength:s,gradientHorizontalMinLength:o,gradientVerticalMaxLength:a,gradientVerticalMinLength:l}=e;if(xr(r))return n==="horizontal"?i==="top"||i==="bottom"?CR(t,"width",o,s):o:CR(t,"height",l,a)}function CR(e,t,n,i){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${i})`}}function d0e(e){if(Pe(["quantile","threshold","log","symlog"],e))return"greedy"}function SR(e){const t=At(e)?h0e(e):y0e(e);return e.component.legends=t,t}function h0e(e){const{encoding:t}=e,n={};for(const i of[si,...VN]){const r=Ut(t[i]);!r||!e.getScaleComponent(i)||i===oi&&Z(r)&&r.type===nc||(n[i]=m0e(e,i))}return n}function p0e(e,t){const n=e.scaleName(t);if(e.mark==="trail"){if(t==="color")return{stroke:n};if(t==="size")return{strokeWidth:n}}return t==="color"?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}function g0e(e,t,n,i){switch(t){case"disable":return n!==void 0;case"values":return!!(n!=null&&n.values);case"title":if(t==="title"&&e===(i==null?void 0:i.title))return!0}return e===(n||{})[t]}function m0e(e,t){var x;let n=e.legend(t);const{markDef:i,encoding:r,config:s}=e,o=s.legend,a=new e0e({},p0e(e,t));Ege(e,t,a);const l=n!==void 0?!n:o.disable;if(a.set("disable",l,n!==void 0),l)return a;n=n||{};const u=e.getScaleComponent(t).get("type"),c=Ut(r[t]),f=Z(c)?(x=Kt(c.timeUnit))==null?void 0:x.unit:void 0,d=n.orient||s.legend.orient||"right",h=a0e({legend:n,channel:t,timeUnit:f,scaleType:u}),p=u0e({legend:n,legendType:h,orient:d,legendConfig:o}),g={legend:n,channel:t,model:e,markDef:i,encoding:r,fieldOrDatumDef:c,legendConfig:o,config:s,scaleType:u,orient:d,legendType:h,direction:p};for(const _ of xR){if(h==="gradient"&&_.startsWith("symbol")||h==="symbol"&&_.startsWith("gradient"))continue;const k=_ in ER?ER[_](g):n[_];if(k!==void 0){const w=g0e(k,_,n,e.fieldDef(t));(w||s.legend[_]===void 0)&&a.set(_,k,w)}}const m=(n==null?void 0:n.encoding)??{},y=a.get("selections"),b={},v={fieldOrDatumDef:c,model:e,channel:t,legendCmpt:a,legendType:h};for(const _ of["labels","legend","title","symbols","gradient","entries"]){const k=bR(m[_]??{},e),w=_ in _R?_R[_](k,v):k;w!==void 0&&!lt(w)&&(b[_]={...y!=null&&y.length&&Z(c)?{name:`${_t(c.field)}_legend_${_}`}:{},...y!=null&&y.length?{interactive:!!y}:{},update:w})}return lt(b)||a.set("encode",b,!!(n!=null&&n.encoding)),a}function y0e(e){const{legends:t,resolve:n}=e.component;for(const i of e.children){SR(i);for(const r of G(i.component.legends))n.legend[r]=_w(e.component.resolve,r),n.legend[r]==="shared"&&(t[r]=AR(t[r],i.component.legends[r]),t[r]||(n.legend[r]="independent",delete t[r]))}for(const i of G(t))for(const r of e.children)r.component.legends[i]&&n.legend[i]==="shared"&&delete r.component.legends[i];return t}function AR(e,t){var s,o,a,l;if(!e)return t.clone();const n=e.getWithExplicit("orient"),i=t.getWithExplicit("orient");if(n.explicit&&i.explicit&&n.value!==i.value)return;let r=!1;for(const u of xR){const c=na(e.getWithExplicit(u),t.getWithExplicit(u),u,"legend",(f,d)=>{switch(u){case"symbolType":return b0e(f,d);case"title":return gD(f,d);case"type":return r=!0,Ci("symbol")}return V1(f,d,u,"legend")});e.setWithExplicit(u,c)}return r&&((o=(s=e.implicit)==null?void 0:s.encode)!=null&&o.gradient&&u1(e.implicit,["encode","gradient"]),(l=(a=e.explicit)==null?void 0:a.encode)!=null&&l.gradient&&u1(e.explicit,["encode","gradient"])),e}function b0e(e,t){return t.value==="circle"?t:e}function v0e(e,t,n,i){var r,s;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(s=e.encode[t]).update??(s.update={}),e.encode[t].update[n]=i}function TR(e){const t=e.component.legends,n={};for(const r of G(t)){const s=e.getScaleComponent(r),o=ut(s.get("domains"));if(n[o])for(const a of n[o])AR(a,t[r])||n[o].push(t[r]);else n[o]=[t[r].clone()]}return ln(n).flat().map(r=>x0e(r,e.config)).filter(r=>r!==void 0)}function x0e(e,t){var o,a,l;const{disable:n,labelExpr:i,selections:r,...s}=e.combine();if(!n){if(t.aria===!1&&s.aria==null&&(s.aria=!1),(o=s.encode)!=null&&o.symbols){const u=s.encode.symbols.update;u.fill&&u.fill.value!=="transparent"&&!u.stroke&&!s.stroke&&(u.stroke={value:"transparent"});for(const c of VN)s[c]&&delete u[c]}if(s.title||delete s.title,i!==void 0){let u=i;(l=(a=s.encode)==null?void 0:a.labels)!=null&&l.update&&de(s.encode.labels.update.text)&&(u=il(i,"datum.label",s.encode.labels.update.text.signal)),v0e(s,"labels","text",{signal:u})}return s}}function _0e(e){return xc(e)||Rw(e)?w0e(e):MR(e)}function w0e(e){return e.children.reduce((t,n)=>t.concat(n.assembleProjections()),MR(e))}function MR(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:i}=n;if(t.data){const r={signal:`[${t.size.map(o=>o.signal).join(", ")}]`},s=t.data.reduce((o,a)=>{const l=de(a)?a.signal:`data('${e.lookupDataSource(a)}')`;return Pe(o,l)||o.push(l),o},[]);if(s.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:i,size:r,fit:{signal:s.length>1?`[${s.join(", ")}]`:s[0]},...n}]}else return[{name:i,translate:{signal:"[width / 2, height / 2]"},...n}]}const k0e=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class FR extends Ys{constructor(t,n,i,r){super({...n},{name:t}),this.specifiedProjection=n,this.size=i,this.data=r,this.merged=!1}get isFit(){return!!this.data}}function DR(e){e.component.projection=At(e)?$0e(e):S0e(e)}function $0e(e){if(e.hasProjection){const t=li(e.specifiedProjection),n=!(t&&(t.scale!=null||t.translate!=null)),i=n?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,r=n?E0e(e):void 0,s=new FR(e.projectionName(!0),{...li(e.config.projection)??{},...t??{}},i,r);return s.get("type")||s.set("type","equalEarth",!1),s}}function E0e(e){const t=[],{encoding:n}=e;for(const i of[[yr,mr],[qi,br]])(Ut(n[i[0]])||Ut(n[i[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(oi)&&e.typedFieldDef(oi).type===nc&&t.push({signal:e.getName(`geojson_${t.length}`)}),t.length===0&&t.push(e.requestDataName(yt.Main)),t}function C0e(e,t){const n=q7(k0e,r=>!!(!pe(e.explicit,r)&&!pe(t.explicit,r)||pe(e.explicit,r)&&pe(t.explicit,r)&&ki(e.get(r),t.get(r))));if(ki(e.size,t.size)){if(n)return e;if(ki(e.explicit,{}))return t;if(ki(t.explicit,{}))return e}return null}function S0e(e){if(e.children.length===0)return;let t;for(const i of e.children)DR(i);const n=q7(e.children,i=>{const r=i.component.projection;if(r)if(t){const s=C0e(t,r);return s&&(t=s),!!s}else return t=r,!0;else return!0});if(t&&n){const i=e.projectionName(!0),r=new FR(i,t.specifiedProjection,t.size,Ce(t.data));for(const s of e.children){const o=s.component.projection;o&&(o.isFit&&r.data.push(...s.component.projection.data),s.renameProjection(o.get("name"),i),o.merged=!0)}return r}}function A0e(e,t,n,i){if(Vd(t,n)){const r=At(e)?e.axis(n)??e.legend(n)??{}:{},s=Q(t,{expr:"datum"}),o=Q(t,{expr:"datum",binSuffix:"end"});return{formulaAs:Q(t,{binSuffix:"range",forAs:!0}),formula:Wd(s,o,r.format,r.formatType,i)}}return{}}function NR(e,t){return`${rD(e)}_${t}`}function T0e(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}function kw(e,t,n){const i=I1(n,void 0)??{},r=NR(i,t);return e.getName(`${r}_bins`)}function M0e(e){return"as"in e}function OR(e,t,n){let i,r;M0e(e)?i=te(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:i=[Q(e,{forAs:!0}),Q(e,{binSuffix:"end",forAs:!0})];const s={...I1(t,void 0)},o=NR(s,e.field),{signal:a,extentSignal:l}=T0e(n,o);if(b1(s.extent)){const c=s.extent;r=sR(n,c.param,c),delete s.extent}const u={bin:s,field:e.field,as:[i],...a?{signal:a}:{},...l?{extentSignal:l}:{},...r?{span:r}:{}};return{key:o,binComponent:u}}class gs extends ot{clone(){return new gs(null,Ce(this.bins))}constructor(t,n){super(t),this.bins=n}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,s,o)=>{if(Un(s)&&mt(s.bin)){const{key:a,binComponent:l}=OR(s,s.bin,n);r[a]={...l,...r[a],...A0e(n,s,o,n.config)}}return r},{});return lt(i)?null:new gs(t,i)}static makeFromTransform(t,n,i){const{key:r,binComponent:s}=OR(n,n.bin,i);return new gs(t,{[r]:s})}merge(t,n){for(const i of G(t.bins))i in this.bins?(n(t.bins[i].signal,this.bins[i].signal),this.bins[i].as=ts([...this.bins[i].as,...t.bins[i].as],ze)):this.bins[i]=t.bins[i];for(const i of t.children)t.removeChild(i),i.parent=this;t.remove()}producedFields(){return new Set(ln(this.bins).map(t=>t.as).flat(2))}dependentFields(){return new Set(ln(this.bins).map(t=>t.field))}hash(){return`Bin ${ze(this.bins)}`}assemble(){return ln(this.bins).flatMap(t=>{const n=[],[i,...r]=t.as,{extent:s,...o}=t.bin,a={type:"bin",field:ji(t.field),as:i,signal:t.signal,...b1(s)?{extent:null}:{extent:s},...t.span?{span:{signal:`span(${t.span})`}}:{},...o};!s&&t.extentSignal&&(n.push({type:"extent",field:ji(t.field),signal:t.extentSignal}),a.extent={signal:t.extentSignal}),n.push(a);for(const l of r)for(let u=0;u<2;u++)n.push({type:"formula",expr:Q({field:i[u]},{expr:"datum"}),as:l[u]});return t.formula&&n.push({type:"formula",expr:t.formula,as:t.formulaAs}),n})}}function F0e(e,t,n,i){var s;const r=At(i)?i.encoding[ss(t)]:void 0;if(Un(n)&&At(i)&&pN(n,r,i.markDef,i.config)){e.add(Q(n,{})),e.add(Q(n,{suffix:"end"}));const{mark:o,markDef:a,config:l}=i,u=ea({fieldDef:n,markDef:a,config:l});Ud(o)&&u!==.5&&Nt(t)&&(e.add(Q(n,{suffix:X1})),e.add(Q(n,{suffix:Y1}))),n.bin&&Vd(n,t)&&e.add(Q(n,{binSuffix:"range"}))}else if(XF(t)){const o=VF(t);e.add(i.getName(o))}else e.add(Q(n));return gl(n)&&Sde((s=n.scale)==null?void 0:s.range)&&e.add(n.scale.range.field),e}function D0e(e,t){for(const n of G(t)){const i=t[n];for(const r of G(i))n in e?e[n][r]=new Set([...e[n][r]??[],...i[r]]):e[n]={[r]:i[r]}}}class $r extends ot{clone(){return new $r(null,new Set(this.dimensions),Ce(this.measures))}constructor(t,n,i){super(t),this.dimensions=n,this.measures=i}get groupBy(){return this.dimensions}static makeFromEncoding(t,n){let i=!1;n.forEachFieldDef(o=>{o.aggregate&&(i=!0)});const r={},s=new Set;return!i||(n.forEachFieldDef((o,a)=>{const{aggregate:l,field:u}=o;if(l)if(l==="count")r["*"]??(r["*"]={}),r["*"].count=new Set([Q(o,{forAs:!0})]);else{if(Ws(l)||Zo(l)){const c=Ws(l)?"argmin":"argmax",f=l[c];r[f]??(r[f]={}),r[f][c]=new Set([Q({op:c,field:f},{forAs:!0})])}else r[u]??(r[u]={}),r[u][l]=new Set([Q(o,{forAs:!0})]);qs(a)&&n.scaleDomain(a)==="unaggregated"&&(r[u]??(r[u]={}),r[u].min=new Set([Q({field:u,aggregate:"min"},{forAs:!0})]),r[u].max=new Set([Q({field:u,aggregate:"max"},{forAs:!0})]))}else F0e(s,a,o,n)}),s.size+G(r).length===0)?null:new $r(t,s,r)}static makeFromTransform(t,n){const i=new Set,r={};for(const s of n.aggregate){const{op:o,field:a,as:l}=s;o&&(o==="count"?(r["*"]??(r["*"]={}),r["*"].count=new Set([l||Q(s,{forAs:!0})])):(r[a]??(r[a]={}),r[a][o]=new Set([l||Q(s,{forAs:!0})])))}for(const s of n.groupby??[])i.add(s);return i.size+G(r).length===0?null:new $r(t,i,r)}merge(t){return zF(this.dimensions,t.dimensions)?(D0e(this.measures,t.measures),!0):(Jfe("different dimensions, cannot merge"),!1)}addDimensions(t){t.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...G(this.measures)])}producedFields(){const t=new Set;for(const n of G(this.measures))for(const i of G(this.measures[n])){const r=this.measures[n][i];r.size===0?t.add(`${i}_${n}`):r.forEach(t.add,t)}return t}hash(){return`Aggregate ${ze({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const t=[],n=[],i=[];for(const s of G(this.measures))for(const o of G(this.measures[s]))for(const a of this.measures[s][o])i.push(a),t.push(o),n.push(s==="*"?null:ji(s));return{type:"aggregate",groupby:[...this.dimensions].map(ji),ops:t,fields:n,as:i}}}class bc extends ot{constructor(t,n,i,r){super(t),this.model=n,this.name=i,this.data=r;for(const s of Wi){const o=n.facet[s];if(o){const{bin:a,sort:l}=o;this[s]={name:n.getName(`${s}_domain`),fields:[Q(o),...mt(a)?[Q(o,{binSuffix:"end"})]:[]],...us(l)?{sortField:l}:q(l)?{sortIndexField:mc(o,s)}:{}}}}this.childModel=n.child}hash(){let t="Facet";for(const n of Wi)this[n]&&(t+=` ${n.charAt(0)}:${ze(this[n])}`);return t}get fields(){var n;const t=[];for(const i of Wi)(n=this[i])!=null&&n.fields&&t.push(...this[i].fields);return t}dependentFields(){const t=new Set(this.fields);for(const n of Wi)this[n]&&(this[n].sortField&&t.add(this[n].sortField.field),this[n].sortIndexField&&t.add(this[n].sortIndexField));return t}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const t={};for(const n of os){const i=this.childModel.component.scales[n];if(i&&!i.merged){const r=i.get("type"),s=i.get("range");if(Jt(r)&&Jo(s)){const o=om(this.childModel,n),a=Nw(o);a?t[n]=a:Y(o_(n))}}}return t}assembleRowColumnHeaderData(t,n,i){const r={row:"y",column:"x",facet:void 0}[t],s=[],o=[],a=[];r&&i&&i[r]&&(n?(s.push(`distinct_${i[r]}`),o.push("max")):(s.push(i[r]),o.push("distinct")),a.push(`distinct_${i[r]}`));const{sortField:l,sortIndexField:u}=this[t];if(l){const{op:c=T1,field:f}=l;s.push(f),o.push(c),a.push(Q(l,{forAs:!0}))}else u&&(s.push(u),o.push("max"),a.push(u));return{name:this[t].name,source:n??this.data,transform:[{type:"aggregate",groupby:this[t].fields,...s.length?{fields:s,ops:o,as:a}:{}}]}}assembleFacetHeaderData(t){var l;const{columns:n}=this.model.layout,{layoutHeaders:i}=this.model.component,r=[],s={};for(const u of yw){for(const c of bw){const f=(i[u]&&i[u][c])??[];for(const d of f)if(((l=d.axes)==null?void 0:l.length)>0){s[u]=!0;break}}if(s[u]){const c=`length(data("${this.facet.name}"))`,f=u==="row"?n?{signal:`ceil(${c} / ${n})`}:1:n?{signal:`min(${c}, ${n})`}:{signal:c};r.push({name:`${this.facet.name}_${u}`,transform:[{type:"sequence",start:0,stop:f}]})}}const{row:o,column:a}=s;return(o||a)&&r.unshift(this.assembleRowColumnHeaderData("facet",null,t)),r}assemble(){const t=[];let n=null;const i=this.getChildIndependentFieldsWithStep(),{column:r,row:s,facet:o}=this;if(r&&s&&(i.x||i.y)){n=`cross_${this.column.name}_${this.row.name}`;const a=[].concat(i.x??[],i.y??[]),l=a.map(()=>"distinct");t.push({name:n,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:a,ops:l}]})}for(const a of[zs,Is])this[a]&&t.push(this.assembleRowColumnHeaderData(a,n,i));if(o){const a=this.assembleFacetHeaderData(i);a&&t.push(...a)}return t}}function RR(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function N0e(e,t){const n=V7(e);if(t==="number")return`toNumber(${n})`;if(t==="boolean")return`toBoolean(${n})`;if(t==="string")return`toString(${n})`;if(t==="date")return`toDate(${n})`;if(t==="flatten")return n;if(t.startsWith("date:")){const i=RR(t.slice(5,t.length));return`timeParse(${n},'${i}')`}else if(t.startsWith("utc:")){const i=RR(t.slice(4,t.length));return`utcParse(${n},'${i}')`}else return Y(afe(t)),null}function O0e(e){const t={};return l1(e.filter,n=>{if(jD(n)){let i=null;d_(n)?i=$i(n.equal):p_(n)?i=$i(n.lte):h_(n)?i=$i(n.lt):g_(n)?i=$i(n.gt):m_(n)?i=$i(n.gte):y_(n)?i=n.range[0]:b_(n)&&(i=(n.oneOf??n.in)[0]),i&&(ll(i)?t[n.field]="date":Xe(i)?t[n.field]="number":te(i)&&(t[n.field]="string")),n.timeUnit&&(t[n.field]="date")}}),t}function R0e(e){const t={};function n(i){lc(i)?t[i.field]="date":i.type==="quantitative"&&Bce(i.aggregate)?t[i.field]="number":Zu(i.field)>1?i.field in t||(t[i.field]="flatten"):gl(i)&&us(i.sort)&&Zu(i.sort.field)>1&&(i.sort.field in t||(t[i.sort.field]="flatten"))}if((At(e)||Cr(e))&&e.forEachFieldDef((i,r)=>{if(Un(i))n(i);else{const s=ol(r),o=e.fieldDef(s);n({...i,type:o.type})}}),At(e)){const{mark:i,markDef:r,encoding:s}=e;if(Qo(i)&&!e.encoding.order){const o=r.orient==="horizontal"?"y":"x",a=s[o];Z(a)&&a.type==="quantitative"&&!(a.field in t)&&(t[a.field]="number")}}return t}function L0e(e){const t={};if(At(e)&&e.component.selection)for(const n of G(e.component.selection)){const i=e.component.selection[n];for(const r of i.project.items)!r.channel&&Zu(r.field)>1&&(t[r.field]="flatten")}return t}class En extends ot{clone(){return new En(null,Ce(this._parse))}constructor(t,n){super(t),this._parse=n}hash(){return`Parse ${ze(this._parse)}`}static makeExplicit(t,n,i){var o;let r={};const s=n.data;return!ia(s)&&((o=s==null?void 0:s.format)!=null&&o.parse)&&(r=s.format.parse),this.makeWithAncestors(t,r,{},i)}static makeWithAncestors(t,n,i,r){for(const a of G(i)){const l=r.getWithExplicit(a);l.value!==void 0&&(l.explicit||l.value===i[a]||l.value==="derived"||i[a]==="flatten"?delete i[a]:Y(wD(a,i[a],l.value)))}for(const a of G(n)){const l=r.get(a);l!==void 0&&(l===n[a]?delete n[a]:Y(wD(a,n[a],l)))}const s=new Ys(n,i);r.copyAll(s);const o={};for(const a of G(s.combine())){const l=s.get(a);l!==null&&(o[a]=l)}return G(o).length===0||r.parseNothing?null:new En(t,o)}get parse(){return this._parse}merge(t){this._parse={...this._parse,...t.parse},t.remove()}assembleFormatParse(){const t={};for(const n of G(this._parse)){const i=this._parse[n];Zu(n)===1&&(t[n]=i)}return t}producedFields(){return new Set(G(this._parse))}dependentFields(){return new Set(G(this._parse))}assembleTransforms(t=!1){return G(this._parse).filter(n=>t?Zu(n)>1:!0).map(n=>{const i=N0e(n,this._parse[n]);return i?{type:"formula",expr:i,as:X7(n)}:null}).filter(n=>n!==null)}}class oa extends ot{clone(){return new oa(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([kr])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:kr}}}class Qd extends ot{clone(){return new Qd(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${ze(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}}class eh extends ot{clone(){return new eh(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${ze(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class xl extends ot{constructor(t){super(null),t??(t={name:"source"});let n;if(ia(t)||(n=t.format?{...ri(t.format,["parse"])}:{}),Yd(t))this._data={values:t.values};else if(cc(t)){if(this._data={url:t.url},!n.type){let i=/(?:\.([^.]+))?$/.exec(t.url)[1];Pe(["json","csv","tsv","dsv","topojson"],i)||(i="json"),n.type=i}}else $O(t)?this._data={values:[{type:"Sphere"}]}:(wO(t)||ia(t))&&(this._data={});this._generator=ia(t),t.name&&(this._name=t.name),n&&!lt(n)&&(this._data.format=n)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(t){this._name=t}set parent(t){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return{name:this._name,...this._data,transform:[]}}}var LR=function(e,t,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n},I0e=function(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)},th;function $w(e){return e instanceof xl||e instanceof Qd||e instanceof eh}class Ew{constructor(){th.set(this,void 0),LR(this,th,!1,"f")}setModified(){LR(this,th,!0,"f")}get modifiedFlag(){return I0e(this,th,"f")}}th=new WeakMap;class _l extends Ew{getNodeDepths(t,n,i){i.set(t,n);for(const r of t.children)this.getNodeDepths(r,n+1,i);return i}optimize(t){const i=[...this.getNodeDepths(t,0,new Map).entries()].sort((r,s)=>s[1]-r[1]);for(const r of i)this.run(r[0]);return this.modifiedFlag}}class Cw extends Ew{optimize(t){this.run(t);for(const n of t.children)this.optimize(n);return this.modifiedFlag}}class z0e extends Cw{mergeNodes(t,n){const i=n.shift();for(const r of n)t.removeChild(r),r.parent=i,r.remove()}run(t){const n=t.children.map(r=>r.hash()),i={};for(let r=0;r1&&(this.setModified(),this.mergeNodes(t,i[r]))}}class P0e extends Cw{constructor(t){super(),this.requiresSelectionId=t&&dw(t)}run(t){t instanceof oa&&(this.requiresSelectionId&&($w(t.parent)||t.parent instanceof $r||t.parent instanceof En)||(this.setModified(),t.remove()))}}class B0e extends Ew{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,n){let i=new Set;t instanceof ps&&(i=t.producedFields(),W7(i,n)&&(this.setModified(),t.removeFormulas(n),t.producedFields.length===0&&t.remove()));for(const r of t.children)this.run(r,new Set([...n,...i]))}}class j0e extends Cw{constructor(){super()}run(t){t instanceof qn&&!t.isRequired()&&(this.setModified(),t.remove())}}class U0e extends _l{run(t){if(!$w(t)&&!(t.numChildren()>1)){for(const n of t.children)if(n instanceof En)if(t instanceof En)this.setModified(),t.merge(n);else{if(G7(t.producedFields(),n.dependentFields()))continue;this.setModified(),n.swapWithParent()}}}}class q0e extends _l{run(t){const n=[...t.children],i=t.children.filter(r=>r instanceof En);if(t.numChildren()>1&&i.length>=1){const r={},s=new Set;for(const o of i){const a=o.parse;for(const l of G(a))l in r?r[l]!==a[l]&&s.add(l):r[l]=a[l]}for(const o of s)delete r[o];if(!lt(r)){this.setModified();const o=new En(t,r);for(const a of n){if(a instanceof En)for(const l of G(r))delete a.parse[l];t.removeChild(a),a.parent=o,a instanceof En&&G(a.parse).length===0&&a.remove()}}}}}class W0e extends _l{run(t){t instanceof qn||t.numChildren()>0||t instanceof bc||t instanceof xl||(this.setModified(),t.remove())}}class H0e extends _l{run(t){const n=t.children.filter(r=>r instanceof ps),i=n.pop();for(const r of n)this.setModified(),i.merge(r)}}class G0e extends _l{run(t){const n=t.children.filter(r=>r instanceof $r),i={};for(const r of n){const s=ze(r.groupBy);s in i||(i[s]=[]),i[s].push(r)}for(const r of G(i)){const s=i[r];if(s.length>1){const o=s.pop();for(const a of s)o.merge(a)&&(t.removeChild(a),a.parent=o,a.remove(),this.setModified())}}}}class V0e extends _l{constructor(t){super(),this.model=t}run(t){const n=!($w(t)||t instanceof pc||t instanceof En||t instanceof oa),i=[],r=[];for(const s of t.children)s instanceof gs&&(n&&!G7(t.producedFields(),s.dependentFields())?i.push(s):r.push(s));if(i.length>0){const s=i.pop();for(const o of i)s.merge(o,this.model.renameSignal.bind(this.model));this.setModified(),t instanceof gs?t.merge(s,this.model.renameSignal.bind(this.model)):s.swapWithParent()}if(r.length>1){const s=r.pop();for(const o of r)s.merge(o,this.model.renameSignal.bind(this.model));this.setModified()}}}class X0e extends _l{run(t){const n=[...t.children];if(!nl(n,o=>o instanceof qn)||t.numChildren()<=1)return;const r=[];let s;for(const o of n)if(o instanceof qn){let a=o;for(;a.numChildren()===1;){const[l]=a.children;if(l instanceof qn)a=l;else break}r.push(...a.children),s?(t.removeChild(o),o.parent=s.parent,s.parent.removeChild(s),s.parent=a,this.setModified()):s=a}else r.push(o);if(r.length){this.setModified();for(const o of r)o.parent.removeChild(o),o.parent=s}}}class wl extends ot{clone(){return new wl(null,Ce(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=ts(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return this.transform.groupby&&this.transform.groupby.forEach(t.add,t),this.transform.joinaggregate.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(t){return t.as??Q(t)}hash(){return`JoinAggregateTransform ${ze(this.transform)}`}assemble(){const t=[],n=[],i=[];for(const s of this.transform.joinaggregate)n.push(s.op),i.push(this.getDefaultName(s)),t.push(s.field===void 0?null:s.field);const r=this.transform.groupby;return{type:"joinaggregate",as:i,ops:n,fields:t,...r!==void 0?{groupby:r}:{}}}}function Y0e(e){return e.stack.stackBy.reduce((t,n)=>{const i=n.fieldDef,r=Q(i);return r&&t.push(r),t},[])}function Z0e(e){return q(e)&&e.every(t=>te(t))&&e.length>1}class Ks extends ot{clone(){return new Ks(null,Ce(this._stack))}constructor(t,n){super(t),this._stack=n}static makeFromTransform(t,n){const{stack:i,groupby:r,as:s,offset:o="zero"}=n,a=[],l=[];if(n.sort!==void 0)for(const f of n.sort)a.push(f.field),l.push(Dt(f.order,"ascending"));const u={field:a,order:l};let c;return Z0e(s)?c=s:te(s)?c=[s,`${s}_end`]:c=[`${n.stack}_start`,`${n.stack}_end`],new Ks(t,{dimensionFieldDefs:[],stackField:i,groupby:r,offset:o,sort:u,facetby:[],as:c})}static makeFromEncoding(t,n){const i=n.stack,{encoding:r}=n;if(!i)return null;const{groupbyChannels:s,fieldChannel:o,offset:a,impute:l}=i,u=s.map(h=>{const p=r[h];return fs(p)}).filter(h=>!!h),c=Y0e(n),f=n.encoding.order;let d;if(q(f)||Z(f))d=dD(f);else{const h=gN(f)?f.sort:o==="y"?"descending":"ascending";d=c.reduce((p,g)=>(p.field.push(g),p.order.push(h),p),{field:[],order:[]})}return new Ks(t,{dimensionFieldDefs:u,stackField:n.vgField(o),facetby:[],stackby:c,sort:d,offset:a,impute:l,as:[n.vgField(o,{suffix:"start",forAs:!0}),n.vgField(o,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(t){this._stack.facetby.push(...t)}dependentFields(){const t=new Set;return t.add(this._stack.stackField),this.getGroupbyFields().forEach(t.add,t),this._stack.facetby.forEach(t.add,t),this._stack.sort.field.forEach(t.add,t),t}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${ze(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:t,impute:n,groupby:i}=this._stack;return t.length>0?t.map(r=>r.bin?n?[Q(r,{binSuffix:"mid"})]:[Q(r,{}),Q(r,{binSuffix:"end"})]:[Q(r)]).flat():i??[]}assemble(){const t=[],{facetby:n,dimensionFieldDefs:i,stackField:r,stackby:s,sort:o,offset:a,impute:l,as:u}=this._stack;if(l)for(const c of i){const{bandPosition:f=.5,bin:d}=c;if(d){const h=Q(c,{expr:"datum"}),p=Q(c,{expr:"datum",binSuffix:"end"});t.push({type:"formula",expr:`${f}*${h}+${1-f}*${p}`,as:Q(c,{binSuffix:"mid",forAs:!0})})}t.push({type:"impute",field:r,groupby:[...s,...n],key:Q(c,{binSuffix:"mid"}),method:"value",value:0})}return t.push({type:"stack",groupby:[...this.getGroupbyFields(),...n],field:r,sort:o,as:u,offset:a}),t}}class vc extends ot{clone(){return new vc(null,Ce(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=ts(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return(this.transform.groupby??[]).forEach(t.add,t),(this.transform.sort??[]).forEach(n=>t.add(n.field)),this.transform.window.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(t){return t.as??Q(t)}hash(){return`WindowTransform ${ze(this.transform)}`}assemble(){const t=[],n=[],i=[],r=[];for(const f of this.transform.window)n.push(f.op),i.push(this.getDefaultName(f)),r.push(f.param===void 0?null:f.param),t.push(f.field===void 0?null:f.field);const s=this.transform.frame,o=this.transform.groupby;if(s&&s[0]===null&&s[1]===null&&n.every(f=>i_(f)))return{type:"joinaggregate",as:i,ops:n,fields:t,...o!==void 0?{groupby:o}:{}};const a=[],l=[];if(this.transform.sort!==void 0)for(const f of this.transform.sort)a.push(f.field),l.push(f.order??"ascending");const u={field:a,order:l},c=this.transform.ignorePeers;return{type:"window",params:r,as:i,ops:n,fields:t,sort:u,...c!==void 0?{ignorePeers:c}:{},...o!==void 0?{groupby:o}:{},...s!==void 0?{frame:s}:{}}}}function K0e(e){function t(n){if(!(n instanceof bc)){const i=n.clone();if(i instanceof qn){const r=Aw+i.getSource();i.setSource(r),e.model.component.data.outputNodes[r]=i}else(i instanceof $r||i instanceof Ks||i instanceof vc||i instanceof wl)&&i.addDimensions(e.fields);for(const r of n.children.flatMap(t))r.parent=i;return[i]}return n.children.flatMap(t)}return t}function Sw(e){if(e instanceof bc)if(e.numChildren()===1&&!(e.children[0]instanceof qn)){const t=e.children[0];(t instanceof $r||t instanceof Ks||t instanceof vc||t instanceof wl)&&t.addDimensions(e.fields),t.swapWithParent(),Sw(e)}else{const t=e.model.component.data.main;IR(t);const n=K0e(e),i=e.children.map(n).flat();for(const r of i)r.parent=t}else e.children.map(Sw)}function IR(e){if(e instanceof qn&&e.type===yt.Main&&e.numChildren()===1){const t=e.children[0];t instanceof bc||(t.swapWithParent(),IR(e))}}const Aw="scale_",sm=5;function Tw(e){for(const t of e){for(const n of t.children)if(n.parent!==t)return!1;if(!Tw(t.children))return!1}return!0}function Er(e,t){let n=!1;for(const i of t)n=e.optimize(i)||n;return n}function zR(e,t,n){let i=e.sources,r=!1;return r=Er(new j0e,i)||r,r=Er(new P0e(t),i)||r,i=i.filter(s=>s.numChildren()>0),r=Er(new W0e,i)||r,i=i.filter(s=>s.numChildren()>0),n||(r=Er(new U0e,i)||r,r=Er(new V0e(t),i)||r,r=Er(new B0e,i)||r,r=Er(new q0e,i)||r,r=Er(new G0e,i)||r,r=Er(new H0e,i)||r,r=Er(new z0e,i)||r,r=Er(new X0e,i)||r),e.sources=i,r}function J0e(e,t){Tw(e.sources);let n=0,i=0;for(let r=0;rt(n))}}function PR(e){At(e)?Q0e(e):e1e(e)}function Q0e(e){const t=e.component.scales;for(const n of G(t)){const i=n1e(e,n);if(t[n].setWithExplicit("domains",i),r1e(e,n),e.component.data.isFaceted){let s=e;for(;!Cr(s)&&s.parent;)s=s.parent;if(s.component.resolve.scale[n]==="shared")for(const a of i.value)Hs(a)&&(a.data=Aw+a.data.replace(Aw,""))}}}function e1e(e){for(const n of e.children)PR(n);const t=e.component.scales;for(const n of G(t)){let i,r=null;for(const s of e.children){const o=s.component.scales[n];if(o){i===void 0?i=o.getWithExplicit("domains"):i=na(i,o.getWithExplicit("domains"),"domains","scale",Dw);const a=o.get("selectionExtent");r&&a&&r.param!==a.param&&Y(ife),r=a}}t[n].setWithExplicit("domains",i),r&&t[n].set("selectionExtent",r,!0)}}function t1e(e,t,n,i){if(e==="unaggregated"){const{valid:r,reason:s}=BR(t,n);if(!r){Y(s);return}}else if(e===void 0&&i.useUnaggregatedDomain){const{valid:r}=BR(t,n);if(r)return"unaggregated"}return e}function n1e(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:i}=e,r=t1e(e.scaleDomain(t),e.typedFieldDef(t),n,e.config.scale);return r!==e.scaleDomain(t)&&(e.specifiedScales[t]={...e.specifiedScales[t],domain:r}),t==="x"&&Ut(i.x2)?Ut(i.x)?na(aa(n,r,e,"x"),aa(n,r,e,"x2"),"domain","scale",Dw):aa(n,r,e,"x2"):t==="y"&&Ut(i.y2)?Ut(i.y)?na(aa(n,r,e,"y"),aa(n,r,e,"y2"),"domain","scale",Dw):aa(n,r,e,"y2"):aa(n,r,e,t)}function i1e(e,t,n){return e.map(i=>({signal:`{data: ${z1(i,{timeUnit:n,type:t})}}`}))}function Mw(e,t,n){var r;const i=(r=Kt(n))==null?void 0:r.unit;return t==="temporal"||i?i1e(e,t,i):[e]}function aa(e,t,n,i){const{encoding:r,markDef:s,mark:o,config:a,stack:l}=n,u=Ut(r[i]),{type:c}=u,f=u.timeUnit;if(Cde(t)){const p=aa(e,void 0,n,i),g=Mw(t.unionWith,c,f);return hs([...g,...p.value])}else{if(de(t))return hs([t]);if(t&&t!=="unaggregated"&&!YD(t))return hs(Mw(t,c,f))}if(l&&i===l.fieldChannel){if(l.offset==="normalize")return Ci([[0,1]]);const p=n.requestDataName(yt.Main);return Ci([{data:p,field:n.vgField(i,{suffix:"start"})},{data:p,field:n.vgField(i,{suffix:"end"})}])}const d=qs(i)&&Z(u)?s1e(n,i,e):void 0;if(cs(u)){const p=Mw([u.datum],c,f);return Ci(p)}const h=u;if(t==="unaggregated"){const p=n.requestDataName(yt.Main),{field:g}=u;return Ci([{data:p,field:Q({field:g,aggregate:"min"})},{data:p,field:Q({field:g,aggregate:"max"})}])}else if(mt(h.bin)){if(Jt(e))return Ci(e==="bin-ordinal"?[]:[{data:Nd(d)?n.requestDataName(yt.Main):n.requestDataName(yt.Raw),field:n.vgField(i,Vd(h,i)?{binSuffix:"range"}:{}),sort:d===!0||!ie(d)?{field:n.vgField(i,{}),op:"min"}:d}]);{const{bin:p}=h;if(mt(p)){const g=kw(n,h.field,p);return Ci([new en(()=>{const m=n.getSignalName(g);return`[${m}.start, ${m}.stop]`})])}else return Ci([{data:n.requestDataName(yt.Main),field:n.vgField(i,{})}])}}else if(h.timeUnit&&Pe(["time","utc"],e)){const p=r[ss(i)];if(pN(h,p,s,a)){const g=n.requestDataName(yt.Main),m=ea({fieldDef:h,fieldDef2:p,markDef:s,config:a}),y=Ud(o)&&m!==.5&&Nt(i);return Ci([{data:g,field:n.vgField(i,y?{suffix:X1}:{})},{data:g,field:n.vgField(i,{suffix:y?Y1:"end"})}])}}return Ci(d?[{data:Nd(d)?n.requestDataName(yt.Main):n.requestDataName(yt.Raw),field:n.vgField(i),sort:d}]:[{data:n.requestDataName(yt.Main),field:n.vgField(i)}])}function Fw(e,t){const{op:n,field:i,order:r}=e;return{op:n??(t?"sum":T1),...i?{field:ji(i)}:{},...r?{order:r}:{}}}function r1e(e,t){var a;const n=e.component.scales[t],i=e.specifiedScales[t].domain,r=(a=e.fieldDef(t))==null?void 0:a.bin,s=YD(i)&&i,o=al(r)&&b1(r.extent)&&r.extent;(s||o)&&n.set("selectionExtent",s??o,!0)}function s1e(e,t,n){if(!Jt(n))return;const i=e.fieldDef(t),r=i.sort;if(fN(r))return{op:"min",field:mc(i,t),order:"ascending"};const{stack:s}=e,o=s?new Set([...s.groupbyFields,...s.stackBy.map(a=>a.fieldDef.field)]):void 0;if(us(r)){const a=s&&!o.has(r.field);return Fw(r,a)}else if(cN(r)){const{encoding:a,order:l}=r,u=e.fieldDef(a),{aggregate:c,field:f}=u,d=s&&!o.has(f);if(Ws(c)||Zo(c))return Fw({field:Q(u),order:l},d);if(i_(c)||!c)return Fw({op:c,field:f,order:l},d)}else{if(r==="descending")return{op:"min",field:e.vgField(t),order:"descending"};if(Pe(["ascending",void 0],r))return!0}}function BR(e,t){const{aggregate:n,type:i}=e;return n?te(n)&&!Uce.has(n)?{valid:!1,reason:Tfe(n)}:i==="quantitative"&&t==="log"?{valid:!1,reason:Mfe(e)}:{valid:!0}:{valid:!1,reason:Afe(e)}}function Dw(e,t,n,i){return e.explicit&&t.explicit&&Y(Rfe(n,i,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function o1e(e){const t=ts(e.map(o=>{if(Hs(o)){const{sort:a,...l}=o;return l}return o}),ze),n=ts(e.map(o=>{if(Hs(o)){const a=o.sort;return a!==void 0&&!Nd(a)&&("op"in a&&a.op==="count"&&delete a.field,a.order==="ascending"&&delete a.order),a}}).filter(o=>o!==void 0),ze);if(t.length===0)return;if(t.length===1){const o=e[0];if(Hs(o)&&n.length>0){let a=n[0];if(n.length>1){Y(AD);const l=n.filter(u=>ie(u)&&"op"in u&&u.op!=="min");n.every(u=>ie(u)&&"op"in u)&&l.length===1?a=l[0]:a=!0}else if(ie(a)&&"field"in a){const l=a.field;o.field===l&&(a=a.order?{order:a.order}:!0)}return{...o,sort:a}}return o}const i=ts(n.map(o=>Nd(o)||!("op"in o)||te(o.op)&&o.op in zce?o:(Y(Ife(o)),!0)),ze);let r;i.length===1?r=i[0]:i.length>1&&(Y(AD),r=!0);const s=ts(e.map(o=>Hs(o)?o.data:null),o=>o);return s.length===1&&s[0]!==null?{data:s[0],fields:t.map(a=>a.field),...r?{sort:r}:{}}:{fields:t,...r?{sort:r}:{}}}function Nw(e){if(Hs(e)&&te(e.field))return e.field;if(qce(e)){let t;for(const n of e.fields)if(Hs(n)&&te(n.field)){if(!t)t=n.field;else if(t!==n.field)return Y(zfe),t}return Y(Pfe),t}else if(Wce(e)){Y(Bfe);const t=e.fields[0];return te(t)?t:void 0}}function om(e,t){const i=e.component.scales[t].get("domains").map(r=>(Hs(r)&&(r.data=e.lookupDataSource(r.data)),r));return o1e(i)}function jR(e){return xc(e)||Rw(e)?e.children.reduce((t,n)=>t.concat(jR(n)),UR(e)):UR(e)}function UR(e){return G(e.component.scales).reduce((t,n)=>{const i=e.component.scales[n];if(i.merged)return t;const r=i.combine(),{name:s,type:o,selectionExtent:a,domains:l,range:u,reverse:c,...f}=r,d=a1e(r.range,s,n,e),h=om(e,n),p=a?tge(e,a,i,h):null;return t.push({name:s,type:o,...h?{domain:h}:{},...p?{domainRaw:p}:{},range:d,...c!==void 0?{reverse:c}:{},...f}),t},[])}function a1e(e,t,n,i){if(Nt(n)){if(Jo(e))return{step:{signal:`${t}_step`}}}else if(ie(e)&&Hs(e))return{...e,data:i.lookupDataSource(e.data)};return e}class qR extends Ys{constructor(t,n){super({},{name:t}),this.merged=!1,this.setWithExplicit("type",n)}domainDefinitelyIncludesZero(){return this.get("zero")!==!1?!0:nl(this.get("domains"),t=>q(t)&&t.length===2&&Xe(t[0])&&t[0]<=0&&Xe(t[1])&&t[1]>=0)}}const l1e=["range","scheme"];function u1e(e){const t=e.component.scales;for(const n of y1){const i=t[n];if(!i)continue;const r=c1e(n,e);i.setWithExplicit("range",r)}}function WR(e,t){const n=e.fieldDef(t);if(n!=null&&n.bin){const{bin:i,field:r}=n,s=ai(t),o=e.getName(s);if(ie(i)&&i.binned&&i.step!==void 0)return new en(()=>{const a=e.scaleName(t),l=`(domain("${a}")[1] - domain("${a}")[0]) / ${i.step}`;return`${e.getSignalName(o)} / (${l})`});if(mt(i)){const a=kw(e,r,i);return new en(()=>{const l=e.getSignalName(a),u=`(${l}.stop - ${l}.start) / ${l}.step`;return`${e.getSignalName(o)} / (${u})`})}}}function c1e(e,t){const n=t.specifiedScales[e],{size:i}=t,s=t.getScaleComponent(e).get("type");for(const f of l1e)if(n[f]!==void 0){const d=k_(s,f),h=ZD(e,f);if(!d)Y(CD(s,f,e));else if(h)Y(h);else switch(f){case"range":{const p=n.range;if(q(p)){if(Nt(e))return hs(p.map(g=>{if(g==="width"||g==="height"){const m=t.getName(g),y=t.getSignalName.bind(t);return en.fromName(y,m)}return g}))}else if(ie(p))return hs({data:t.requestDataName(yt.Main),field:p.field,sort:{op:"min",field:t.vgField(e)}});return hs(p)}case"scheme":return hs(f1e(n[f]))}}const o=e===wt||e==="xOffset"?"width":"height",a=i[o];if(ds(a)){if(Nt(e))if(Jt(s)){const f=GR(a,t,e);if(f)return hs({step:f})}else Y(SD(o));else if(Pd(e)){const f=e===Wo?"x":"y";if(t.getScaleComponent(f).get("type")==="band"){const p=VR(a,s);if(p)return hs(p)}}}const{rangeMin:l,rangeMax:u}=n,c=d1e(e,t);return(l!==void 0||u!==void 0)&&k_(s,"rangeMin")&&q(c)&&c.length===2?hs([l??c[0],u??c[1]]):Ci(c)}function f1e(e){return Ede(e)?{scheme:e.name,...ri(e,["name"])}:{scheme:e}}function HR(e,t,n,{center:i}={}){const r=ai(e),s=t.getName(r),o=t.getSignalName.bind(t);return e===Zt&&Ei(n)?i?[en.fromName(a=>`${o(a)}/2`,s),en.fromName(a=>`-${o(a)}/2`,s)]:[en.fromName(o,s),0]:i?[en.fromName(a=>`-${o(a)}/2`,s),en.fromName(a=>`${o(a)}/2`,s)]:[0,en.fromName(o,s)]}function d1e(e,t){const{size:n,config:i,mark:r,encoding:s}=t,{type:o}=Ut(s[e]),l=t.getScaleComponent(e).get("type"),{domain:u,domainMid:c}=t.specifiedScales[e];switch(e){case wt:case Zt:{if(Pe(["point","band"],l)){const f=XR(e,n,i.view);if(ds(f))return{step:GR(f,t,e)}}return HR(e,t,l)}case Wo:case Ku:return h1e(e,t,l);case js:{const f=t.component.scales[e].get("zero"),d=YR(r,f,i),h=m1e(r,n,t,i);return ic(l)?g1e(d,h,p1e(l,i,u,e)):[d,h]}case Ui:return[0,Math.PI*2];case rl:return[0,360];case gr:return[0,new en(()=>{const f=t.getSignalName("width"),d=t.getSignalName("height");return`min(${f},${d})/2`})];case Vo:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case Xo:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case oi:return"symbol";case si:case is:case rs:return l==="ordinal"?o==="nominal"?"category":"ordinal":c!==void 0?"diverging":r==="rect"||r==="geoshape"?"heatmap":"ramp";case Us:case Ho:case Go:return[i.scale.minOpacity,i.scale.maxOpacity]}}function GR(e,t,n){const{encoding:i}=t,r=t.getScaleComponent(n),s=J7(n),o=i[s];if(YN({step:e,offsetIsDiscrete:Se(o)&&qD(o.type)})==="offset"&&TN(i,s)){const l=t.getScaleComponent(s);let c=`domain('${t.scaleName(s)}').length`;if(l.get("type")==="band"){const d=l.get("paddingInner")??l.get("padding")??0,h=l.get("paddingOuter")??l.get("padding")??0;c=`bandspace(${c}, ${d}, ${h})`}const f=r.get("paddingInner")??r.get("padding");return{signal:`${e.step} * ${c} / (1-${Vce(f)})`}}else return e.step}function VR(e,t){if(YN({step:e,offsetIsDiscrete:Jt(t)})==="offset")return{step:e.step}}function h1e(e,t,n){const i=e===Wo?"x":"y",r=t.getScaleComponent(i);if(!r)return HR(i,t,n,{center:!0});const s=r.get("type"),o=t.scaleName(i),{markDef:a,config:l}=t;if(s==="band"){const u=XR(i,t.size,t.config.view);if(ds(u)){const c=VR(u,n);if(c)return c}return[0,{signal:`bandwidth('${o}')`}]}else{const u=t.encoding[i];if(Z(u)&&u.timeUnit){const c=PD(u.timeUnit,p=>`scale('${o}', ${p})`),f=t.config.scale.bandWithNestedOffsetPaddingInner,d=ea({fieldDef:u,markDef:a,config:l})-.5,h=d!==0?` + ${d}`:"";if(f){const p=de(f)?`${f.signal}/2`+h:`${f/2+d}`,g=de(f)?`(1 - ${f.signal}/2)`+h:`${1-f/2+d}`;return[{signal:`${p} * (${c})`},{signal:`${g} * (${c})`}]}return[0,{signal:c}]}return LF(`Cannot use ${e} scale if ${i} scale is not discrete.`)}}function XR(e,t,n){const i=e===wt?"width":"height",r=t[i];return r||H1(n,i)}function p1e(e,t,n,i){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return n!==void 0&&q(n)?n.length+1:(Y(Yfe(i)),3)}}function g1e(e,t,n){const i=()=>{const r=vr(t),s=vr(e),o=`(${r} - ${s}) / (${n} - 1)`;return`sequence(${s}, ${r} + ${o}, ${o})`};return de(t)?new en(i):{signal:i()}}function YR(e,t,n){if(t)return de(t)?{signal:`${t.signal} ? 0 : ${YR(e,!1,n)}`}:0;switch(e){case"bar":case"tick":return n.scale.minBandSize;case"line":case"trail":case"rule":return n.scale.minStrokeWidth;case"text":return n.scale.minFontSize;case"point":case"square":case"circle":return n.scale.minSize}throw new Error(x1("size",e))}const ZR=.95;function m1e(e,t,n,i){const r={x:WR(n,"x"),y:WR(n,"y")};switch(e){case"bar":case"tick":{if(i.scale.maxBandSize!==void 0)return i.scale.maxBandSize;const s=KR(t,r,i.view);return Xe(s)?s-1:new en(()=>`${s.signal} - 1`)}case"line":case"trail":case"rule":return i.scale.maxStrokeWidth;case"text":return i.scale.maxFontSize;case"point":case"square":case"circle":{if(i.scale.maxSize)return i.scale.maxSize;const s=KR(t,r,i.view);return Xe(s)?Math.pow(ZR*s,2):new en(()=>`pow(${ZR} * ${s.signal}, 2)`)}}throw new Error(x1("size",e))}function KR(e,t,n){const i=ds(e.width)?e.width.step:W1(n,"width"),r=ds(e.height)?e.height.step:W1(n,"height");return t.x||t.y?new en(()=>`min(${[t.x?t.x.signal:i,t.y?t.y.signal:r].join(", ")})`):Math.min(i,r)}function JR(e,t){At(e)?y1e(e,t):tL(e,t)}function y1e(e,t){const n=e.component.scales,{config:i,encoding:r,markDef:s,specifiedScales:o}=e;for(const a of G(n)){const l=o[a],u=n[a],c=e.getScaleComponent(a),f=Ut(r[a]),d=l[t],h=c.get("type"),p=c.get("padding"),g=c.get("paddingInner"),m=k_(h,t),y=ZD(a,t);if(d!==void 0&&(m?y&&Y(y):Y(CD(h,t,a))),m&&y===void 0)if(d!==void 0){const b=f.timeUnit,v=f.type;switch(t){case"domainMax":case"domainMin":ll(l[t])||v==="temporal"||b?u.set(t,{signal:z1(l[t],{type:v,timeUnit:b})},!0):u.set(t,l[t],!0);break;default:u.copyKeyFromObject(t,l)}}else{const b=t in QR?QR[t]({model:e,channel:a,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:g,domain:l.domain,domainMin:l.domainMin,domainMax:l.domainMax,markDef:s,config:i,hasNestedOffsetScale:MN(r,a),hasSecondaryRangeChannel:!!r[ss(a)]}):i.scale[t];b!==void 0&&u.set(t,b,!1)}}}const QR={bins:({model:e,fieldOrDatumDef:t})=>Z(t)?b1e(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>v1e(e,t.type),nice:({scaleType:e,channel:t,domain:n,domainMin:i,domainMax:r,fieldOrDatumDef:s})=>x1e(e,t,n,i,r,s),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:i,config:r})=>_1e(e,t,r.scale,n,i,r.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,scaleType:i,config:r,hasNestedOffsetScale:s})=>w1e(e,t,n.type,i,r.scale,s),paddingOuter:({scalePadding:e,channel:t,scaleType:n,scalePaddingInner:i,config:r,hasNestedOffsetScale:s})=>k1e(e,t,n,i,r.scale,s),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:i})=>{const r=Z(e)?e.sort:void 0;return $1e(t,r,n,i.scale)},zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:i,scaleType:r,config:s,hasSecondaryRangeChannel:o})=>E1e(e,t,n,i,r,s.scale,o)};function eL(e){At(e)?u1e(e):tL(e,"range")}function tL(e,t){const n=e.component.scales;for(const i of e.children)t==="range"?eL(i):JR(i,t);for(const i of G(n)){let r;for(const s of e.children){const o=s.component.scales[i];if(o){const a=o.getWithExplicit(t);r=na(r,a,t,"scale",_O((l,u)=>{switch(t){case"range":return l.step&&u.step?l.step-u.step:0}return 0}))}}n[i].setWithExplicit(t,r)}}function b1e(e,t){const n=t.bin;if(mt(n)){const i=kw(e,t.field,n);return new en(()=>e.getSignalName(i))}else if(un(n)&&al(n)&&n.step!==void 0)return{step:n.step}}function v1e(e,t){if(Pe([si,is,rs],e)&&t!=="nominal")return"hcl"}function x1e(e,t,n,i,r,s){var o;if(!((o=fs(s))!=null&&o.bin||q(n)||r!=null||i!=null||Pe([ui.TIME,ui.UTC],e)))return Nt(t)?!0:void 0}function _1e(e,t,n,i,r,s){if(Nt(e)){if(xr(t)){if(n.continuousPadding!==void 0)return n.continuousPadding;const{type:o,orient:a}=r;if(o==="bar"&&!(Z(i)&&(i.bin||i.timeUnit))&&(a==="vertical"&&e==="x"||a==="horizontal"&&e==="y"))return s.continuousBandSize}if(t===ui.POINT)return n.pointPadding}}function w1e(e,t,n,i,r,s=!1){if(e===void 0){if(Nt(t)){const{bandPaddingInner:o,barBandPaddingInner:a,rectBandPaddingInner:l,bandWithNestedOffsetPaddingInner:u}=r;return s?u:Dt(o,n==="bar"?a:l)}else if(Pd(t)&&i===ui.BAND)return r.offsetBandPaddingInner}}function k1e(e,t,n,i,r,s=!1){if(e===void 0){if(Nt(t)){const{bandPaddingOuter:o,bandWithNestedOffsetPaddingOuter:a}=r;if(s)return a;if(n===ui.BAND)return Dt(o,de(i)?{signal:`${i.signal}/2`}:i/2)}else if(Pd(t)){if(n===ui.POINT)return .5;if(n===ui.BAND)return r.offsetBandPaddingOuter}}}function $1e(e,t,n,i){if(n==="x"&&i.xReverse!==void 0)return Ei(e)&&t==="descending"?de(i.xReverse)?{signal:`!${i.xReverse.signal}`}:!i.xReverse:i.xReverse;if(Ei(e)&&t==="descending")return!0}function E1e(e,t,n,i,r,s,o){if(!!n&&n!=="unaggregated"&&Ei(r)){if(q(n)){const l=n[0],u=n[n.length-1];if(Xe(l)&&l<=0&&Xe(u)&&u>=0)return!0}return!1}if(e==="size"&&t.type==="quantitative"&&!ic(r))return!0;if(!(Z(t)&&t.bin)&&Pe([...os,...Mce],e)){const{orient:l,type:u}=i;return Pe(["bar","area","line","trail"],u)&&(l==="horizontal"&&e==="y"||l==="vertical"&&e==="x")?!1:Pe(["bar","area"],u)&&!o?!0:s==null?void 0:s.zero}return!1}function C1e(e,t,n,i,r=!1){const s=S1e(t,n,i,r),{type:o}=e;return qs(t)?o!==void 0?Dde(t,o)?Z(n)&&!Fde(o,n.type)?(Y(Nfe(o,s)),s):o:(Y(Dfe(t,o,s)),s):s:null}function S1e(e,t,n,i){var r;switch(t.type){case"nominal":case"ordinal":{if(Qu(e)||n_(e)==="discrete")return e==="shape"&&t.type==="ordinal"&&Y(l_(e,"ordinal")),"ordinal";if(Nt(e)||Pd(e)){if(Pe(["rect","bar","image","rule"],n.type)||i)return"band"}else if(n.type==="arc"&&e in t_)return"band";const s=n[ai(e)];return dl(s)||sc(t)&&((r=t.axis)!=null&&r.tickBand)?"band":"point"}case"temporal":return Qu(e)?"time":n_(e)==="discrete"?(Y(l_(e,"temporal")),"ordinal"):Z(t)&&t.timeUnit&&Kt(t.timeUnit).utc?"utc":"time";case"quantitative":return Qu(e)?Z(t)&&mt(t.bin)?"bin-ordinal":"linear":n_(e)==="discrete"?(Y(l_(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error($D(t.type))}function A1e(e,{ignoreRange:t}={}){nL(e),PR(e);for(const n of Mde)JR(e,n);t||eL(e)}function nL(e){At(e)?e.component.scales=T1e(e):e.component.scales=F1e(e)}function T1e(e){const{encoding:t,mark:n,markDef:i}=e,r={};for(const s of y1){const o=Ut(t[s]);if(o&&n===QD&&s===oi&&o.type===nc)continue;let a=o&&o.scale;if(o&&a!==null&&a!==!1){a??(a={});const l=MN(t,s),u=C1e(a,s,o,i,l);r[s]=new qR(e.scaleName(`${s}`,!0),{value:u,explicit:a.type===u})}}return r}const M1e=_O((e,t)=>WD(e)-WD(t));function F1e(e){var t;const n=e.component.scales={},i={},r=e.component.resolve;for(const s of e.children){nL(s);for(const o of G(s.component.scales))if((t=r.scale)[o]??(t[o]=vR(o,e)),r.scale[o]==="shared"){const a=i[o],l=s.component.scales[o].getWithExplicit("type");a?xde(a.value,l.value)?i[o]=na(a,l,"type","scale",M1e):(r.scale[o]="independent",delete i[o]):i[o]=l}}for(const s of G(i)){const o=e.scaleName(s,!0),a=i[s];n[s]=new qR(o,a);for(const l of e.children){const u=l.component.scales[s];u&&(l.renameScale(u.get("name"),o),u.merged=!0)}}return n}class Ow{constructor(){this.nameMap={}}rename(t,n){this.nameMap[t]=n}has(t){return this.nameMap[t]!==void 0}get(t){for(;this.nameMap[t]&&t!==this.nameMap[t];)t=this.nameMap[t];return t}}function At(e){return(e==null?void 0:e.type)==="unit"}function Cr(e){return(e==null?void 0:e.type)==="facet"}function Rw(e){return(e==null?void 0:e.type)==="concat"}function xc(e){return(e==null?void 0:e.type)==="layer"}class Lw{constructor(t,n,i,r,s,o,a){this.type=n,this.parent=i,this.config=s,this.correctDataNames=l=>{var u,c,f;return(u=l.from)!=null&&u.data&&(l.from.data=this.lookupDataSource(l.from.data)),(f=(c=l.from)==null?void 0:c.facet)!=null&&f.data&&(l.from.facet.data=this.lookupDataSource(l.from.facet.data)),l},this.parent=i,this.config=s,this.view=li(a),this.name=t.name??r,this.title=Ko(t.title)?{text:t.title}:t.title?li(t.title):void 0,this.scaleNameMap=i?i.scaleNameMap:new Ow,this.projectionNameMap=i?i.projectionNameMap:new Ow,this.signalNameMap=i?i.signalNameMap:new Ow,this.data=t.data,this.description=t.description,this.transforms=zpe(t.transform??[]),this.layout=n==="layer"||n==="unit"?{}:qhe(t,n,s),this.component={data:{sources:i?i.component.data.sources:[],outputNodes:i?i.component.data.outputNodes:{},outputNodeRefCounts:i?i.component.data.outputNodeRefCounts:{},isFaceted:M1(t)||(i==null?void 0:i.component.data.isFaceted)&&t.data===void 0},layoutSize:new Ys,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...o?Ce(o):{}},selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){A1e(this)}parseProjection(){DR(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){SR(this)}assembleEncodeFromView(t){const{style:n,...i}=t,r={};for(const s of G(i)){const o=i[s];o!==void 0&&(r[s]=vt(o))}return r}assembleGroupEncodeEntry(t){let n={};return this.view&&(n=this.assembleEncodeFromView(this.view)),!t&&(this.description&&(n.description=vt(this.description)),this.type==="unit"||this.type==="layer")?{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...n??{}}:lt(n)?void 0:n}assembleLayout(){if(!this.layout)return;const{spacing:t,...n}=this.layout,{component:i,config:r}=this,s=Jge(i.layoutHeaders,r);return{padding:t,...this.assembleDefaultLayout(),...n,...s?{titleBand:s}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:t}=this.component;let n=[];for(const i of Wi)t[i].title&&n.push(Gge(this,i));for(const i of yw)n=n.concat(Vge(this,i));return n}assembleAxes(){return Nge(this.component.axes,this.config)}assembleLegends(){return TR(this)}assembleProjections(){return _0e(this)}assembleTitle(){const{encoding:t,...n}=this.title??{},i={...oD(this.config.title).nonMarkTitleProperties,...n,...t?{encode:{update:t}}:{}};if(i.text)return Pe(["unit","layer"],this.type)?Pe(["middle",void 0],i.anchor)&&(i.frame??(i.frame="group")):i.anchor??(i.anchor="start"),lt(i)?void 0:i}assembleGroup(t=[]){const n={};t=t.concat(this.assembleSignals()),t.length>0&&(n.signals=t);const i=this.assembleLayout();i&&(n.layout=i),n.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const r=!this.parent||Cr(this.parent)?jR(this):[];r.length>0&&(n.scales=r);const s=this.assembleAxes();s.length>0&&(n.axes=s);const o=this.assembleLegends();return o.length>0&&(n.legends=o),n}getName(t){return _t((this.name?`${this.name}_`:"")+t)}getDataName(t){return this.getName(yt[t].toLowerCase())}requestDataName(t){const n=this.getDataName(t),i=this.component.data.outputNodeRefCounts;return i[n]=(i[n]||0)+1,n}getSizeSignalRef(t){if(Cr(this.parent)){const n=yR(t),i=m1(n),r=this.component.scales[i];if(r&&!r.merged){const s=r.get("type"),o=r.get("range");if(Jt(s)&&Jo(o)){const a=r.get("name"),l=om(this,i),u=Nw(l);if(u){const c=Q({aggregate:"distinct",field:u},{expr:"datum"});return{signal:mR(a,r,c)}}else return Y(o_(i)),null}}}return{signal:this.signalNameMap.get(this.getName(t))}}lookupDataSource(t){const n=this.component.data.outputNodes[t];return n?n.getSource():t}getSignalName(t){return this.signalNameMap.get(t)}renameSignal(t,n){this.signalNameMap.rename(t,n)}renameScale(t,n){this.scaleNameMap.rename(t,n)}renameProjection(t,n){this.projectionNameMap.rename(t,n)}scaleName(t,n){if(n)return this.getName(t);if(ZF(t)&&qs(t)&&this.component.scales[t]||this.scaleNameMap.has(this.getName(t)))return this.scaleNameMap.get(this.getName(t))}projectionName(t){if(t)return this.getName("projection");if(this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection")))return this.projectionNameMap.get(this.getName("projection"))}getScaleComponent(t){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const n=this.component.scales[t];return n&&!n.merged?n:this.parent?this.parent.getScaleComponent(t):void 0}getSelectionComponent(t,n){let i=this.component.selection[t];if(!i&&this.parent&&(i=this.parent.getSelectionComponent(t,n)),!i)throw new Error(Jce(n));return i}hasAxisOrientSignalRef(){var t,n;return((t=this.component.axes.x)==null?void 0:t.some(i=>i.hasOrientSignalRef()))||((n=this.component.axes.y)==null?void 0:n.some(i=>i.hasOrientSignalRef()))}}class iL extends Lw{vgField(t,n={}){const i=this.fieldDef(t);if(i)return Q(i,n)}reduceFieldDef(t,n){return xhe(this.getMapping(),(i,r,s)=>{const o=fs(r);return o?t(i,o,s):i},n)}forEachFieldDef(t,n){z_(this.getMapping(),(i,r)=>{const s=fs(i);s&&t(s,r)},n)}}class am extends ot{clone(){return new am(null,Ce(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Ce(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"value",i[1]??"density"]}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${ze(this.transform)}`}assemble(){const{density:t,...n}=this.transform,i={type:"kde",field:t,...n};return this.transform.groupby&&(i.resolve="shared"),i}}class lm extends ot{clone(){return new lm(null,Ce(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Ce(n)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${ze(this.transform)}`}assemble(){const{extent:t,param:n}=this.transform;return{type:"extent",field:t,signal:n}}}class nh extends ot{clone(){return new nh(null,{...this.filter})}constructor(t,n){super(t),this.filter=n}static make(t,n){const{config:i,mark:r,markDef:s}=n;if(it("invalid",s,i)!=="filter")return null;const a=n.reduceFieldDef((l,u,c)=>{const f=qs(c)&&n.getScaleComponent(c);if(f){const d=f.get("type");Ei(d)&&u.aggregate!=="count"&&!Qo(r)&&(l[u.field]=u)}return l},{});return G(a).length?new nh(t,a):null}dependentFields(){return new Set(G(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${ze(this.filter)}`}assemble(){const t=G(this.filter).reduce((n,i)=>{const r=this.filter[i],s=Q(r,{expr:"datum"});return r!==null&&(r.type==="temporal"?n.push(`(isDate(${s}) || (isValid(${s}) && isFinite(+${s})))`):r.type==="quantitative"&&(n.push(`isValid(${s})`),n.push(`isFinite(+${s})`))),n},[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}class um extends ot{clone(){return new um(this.parent,Ce(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Ce(n);const{flatten:i,as:r=[]}=this.transform;this.transform.as=i.map((s,o)=>r[o]??s)}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${ze(this.transform)}`}assemble(){const{flatten:t,as:n}=this.transform;return{type:"flatten",fields:t,as:n}}}class cm extends ot{clone(){return new cm(null,Ce(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Ce(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"key",i[1]??"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${ze(this.transform)}`}assemble(){const{fold:t,as:n}=this.transform;return{type:"fold",fields:t,as:n}}}class _c extends ot{clone(){return new _c(null,Ce(this.fields),this.geojson,this.signal)}static parseAll(t,n){if(n.component.projection&&!n.component.projection.isFit)return t;let i=0;for(const r of[[yr,mr],[qi,br]]){const s=r.map(o=>{const a=Ut(n.encoding[o]);return Z(a)?a.field:cs(a)?{expr:`${a.datum}`}:wr(a)?{expr:`${a.value}`}:void 0});(s[0]||s[1])&&(t=new _c(t,s,null,n.getName(`geojson_${i++}`)))}if(n.channelHasField(oi)){const r=n.typedFieldDef(oi);r.type===nc&&(t=new _c(t,null,r.field,n.getName(`geojson_${i++}`)))}return t}constructor(t,n,i,r){super(t),this.fields=n,this.geojson=i,this.signal=r}dependentFields(){const t=(this.fields??[]).filter(te);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${ze(this.fields)}`}assemble(){return[...this.geojson?[{type:"filter",expr:`isValid(datum["${this.geojson}"])`}]:[],{type:"geojson",...this.fields?{fields:this.fields}:{},...this.geojson?{geojson:this.geojson}:{},signal:this.signal}]}}class ih extends ot{clone(){return new ih(null,this.projection,Ce(this.fields),Ce(this.as))}constructor(t,n,i,r){super(t),this.projection=n,this.fields=i,this.as=r}static parseAll(t,n){if(!n.projectionName())return t;for(const i of[[yr,mr],[qi,br]]){const r=i.map(o=>{const a=Ut(n.encoding[o]);return Z(a)?a.field:cs(a)?{expr:`${a.datum}`}:wr(a)?{expr:`${a.value}`}:void 0}),s=i[0]===qi?"2":"";(r[0]||r[1])&&(t=new ih(t,n.projectionName(),r,[n.getName(`x${s}`),n.getName(`y${s}`)]))}return t}dependentFields(){return new Set(this.fields.filter(te))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${ze(this.fields)} ${ze(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class kl extends ot{clone(){return new kl(null,Ce(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(t){const{start:n=0,stop:i,step:r}=t;return{signal:`sequence(${[n,i,...r?[r]:[]].join(",")})`}}static makeFromTransform(t,n){return new kl(t,n)}static makeFromEncoding(t,n){const i=n.encoding,r=i.x,s=i.y;if(Z(r)&&Z(s)){const o=r.impute?r:s.impute?s:void 0;if(o===void 0)return;const a=r.impute?s:s.impute?r:void 0,{method:l,value:u,frame:c,keyvals:f}=o.impute,d=DN(n.mark,i);return new kl(t,{impute:o.field,key:a.field,...l?{method:l}:{},...u!==void 0?{value:u}:{},...c?{frame:c}:{},...f!==void 0?{keyvals:f}:{},...d.length?{groupby:d}:{}})}return null}hash(){return`Impute ${ze(this.transform)}`}assemble(){const{impute:t,key:n,keyvals:i,method:r,groupby:s,value:o,frame:a=[null,null]}=this.transform,l={type:"impute",field:t,key:n,...i?{keyvals:vpe(i)?this.processSequence(i):i}:{},method:"value",...s?{groupby:s}:{},value:!r||r==="value"?o:null};if(r&&r!=="value"){const u={type:"window",as:[`imputed_${t}_value`],ops:[r],fields:[t],frame:a,ignorePeers:!1,...s?{groupby:s}:{}},c={type:"formula",expr:`datum.${t} === null ? datum.imputed_${t}_value : datum.${t}`,as:t};return[l,u,c]}else return[l]}}class fm extends ot{clone(){return new fm(null,Ce(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Ce(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??n.on,i[1]??n.loess]}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${ze(this.transform)}`}assemble(){const{loess:t,on:n,...i}=this.transform;return{type:"loess",x:n,y:t,...i}}}class rh extends ot{clone(){return new rh(null,Ce(this.transform),this.secondary)}constructor(t,n,i){super(t),this.transform=n,this.secondary=i}static make(t,n,i,r){const s=n.component.data.sources,{from:o}=i;let a=null;if(xpe(o)){let l=aL(o.data,s);l||(l=new xl(o.data),s.push(l));const u=n.getName(`lookup_${r}`);a=new qn(l,u,yt.Lookup,n.component.data.outputNodeRefCounts),n.component.data.outputNodes[u]=a}else if(_pe(o)){const l=o.param;i={as:l,...i};let u;try{u=n.getSelectionComponent(_t(l),l)}catch{throw new Error(tfe(l))}if(a=u.materialized,!a)throw new Error(nfe(l))}return new rh(t,i,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?ee(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${ze({transform:this.transform,secondary:this.secondary})}`}assemble(){let t;if(this.transform.from.fields)t={values:this.transform.from.fields,...this.transform.as?{as:ee(this.transform.as)}:{}};else{let n=this.transform.as;te(n)||(Y(cfe),n="_lookup"),t={as:[n]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...t,...this.transform.default?{default:this.transform.default}:{}}}}class dm extends ot{clone(){return new dm(null,Ce(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Ce(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"prob",i[1]??"value"]}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${ze(this.transform)}`}assemble(){const{quantile:t,...n}=this.transform;return{type:"quantile",field:t,...n}}}class hm extends ot{clone(){return new hm(null,Ce(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Ce(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??n.on,i[1]??n.regression]}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${ze(this.transform)}`}assemble(){const{regression:t,on:n,...i}=this.transform;return{type:"regression",x:n,y:t,...i}}}class pm extends ot{clone(){return new pm(null,Ce(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=ts((this.transform.groupby??[]).concat(t),n=>n)}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${ze(this.transform)}`}assemble(){const{pivot:t,value:n,groupby:i,limit:r,op:s}=this.transform;return{type:"pivot",field:t,value:n,...r!==void 0?{limit:r}:{},...s!==void 0?{op:s}:{},...i!==void 0?{groupby:i}:{}}}}class gm extends ot{clone(){return new gm(null,Ce(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${ze(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function rL(e){let t=0;function n(i,r){if(i instanceof xl&&!i.isGenerator&&!cc(i.data)&&(e.push(r),r={name:null,source:r.name,transform:[]}),i instanceof En&&(i.parent instanceof xl&&!r.source?(r.format={...r.format??{},parse:i.assembleFormatParse()},r.transform.push(...i.assembleTransforms(!0))):r.transform.push(...i.assembleTransforms())),i instanceof bc){r.name||(r.name=`data_${t++}`),!r.source||r.transform.length>0?(e.push(r),i.data=r.name):i.data=r.source,e.push(...i.assemble());return}switch((i instanceof Qd||i instanceof eh||i instanceof nh||i instanceof pc||i instanceof gc||i instanceof ih||i instanceof $r||i instanceof rh||i instanceof vc||i instanceof wl||i instanceof cm||i instanceof um||i instanceof am||i instanceof fm||i instanceof dm||i instanceof hm||i instanceof oa||i instanceof gm||i instanceof pm||i instanceof lm)&&r.transform.push(i.assemble()),(i instanceof gs||i instanceof ps||i instanceof kl||i instanceof Ks||i instanceof _c)&&r.transform.push(...i.assemble()),i instanceof qn&&(r.source&&r.transform.length===0?i.setSource(r.source):i.parent instanceof qn?i.setSource(r.name):(r.name||(r.name=`data_${t++}`),i.setSource(r.name),i.numChildren()===1&&(e.push(r),r={name:null,source:r.name,transform:[]}))),i.numChildren()){case 0:i instanceof qn&&(!r.source||r.transform.length>0)&&e.push(r);break;case 1:n(i.children[0],r);break;default:{r.name||(r.name=`data_${t++}`);let s=r.name;!r.source||r.transform.length>0?e.push(r):s=r.source;for(const o of i.children)n(o,{name:null,source:s,transform:[]});break}}}return n}function D1e(e){const t=[],n=rL(t);for(const i of e.children)n(i,{source:e.name,name:null,transform:[]});return t}function N1e(e,t){const n=[],i=rL(n);let r=0;for(const o of e.sources){o.hasName()||(o.dataName=`source_${r++}`);const a=o.assemble();i(o,a)}for(const o of n)o.transform.length===0&&delete o.transform;let s=0;for(const[o,a]of n.entries())(a.transform??[]).length===0&&!a.source&&n.splice(s++,0,n.splice(o,1)[0]);for(const o of n)for(const a of o.transform??[])a.type==="lookup"&&(a.from=e.outputNodes[a.from].getSource());for(const o of n)o.name in t&&(o.values=t[o.name]);return n}function O1e(e){return e==="top"||e==="left"||de(e)?"header":"footer"}function R1e(e){for(const t of Wi)L1e(e,t);oL(e,"x"),oL(e,"y")}function L1e(e,t){var o;const{facet:n,config:i,child:r,component:s}=e;if(e.channelHasField(t)){const a=n[t],l=yc("title",null,i,t);let u=oc(a,i,{allowDisabling:!0,includeDefault:l===void 0||!!l});r.component.layoutHeaders[t].title&&(u=q(u)?u.join(", "):u,u+=` / ${r.component.layoutHeaders[t].title}`,r.component.layoutHeaders[t].title=null);const c=yc("labelOrient",a.header,i,t),f=a.header!==null?Dt((o=a.header)==null?void 0:o.labels,i.header.labels,!0):!1,d=Pe(["bottom","right"],c)?"footer":"header";s.layoutHeaders[t]={title:a.header!==null?u:null,facetFieldDef:a,[d]:t==="facet"?[]:[sL(e,t,f)]}}}function sL(e,t,n){const i=t==="row"?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(i)?e.child.getSizeSignalRef(i):void 0,axes:[]}}function oL(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:i,resolve:r}=e.component;if(r.axis[t]=_w(r,t),r.axis[t]==="shared"){const s=t==="x"?"column":"row",o=i[s];for(const a of n.component.axes[t]){const l=O1e(a.get("orient"));o[l]??(o[l]=[sL(e,s,!1)]);const u=Jd(a,"main",e.config,{header:!0});u&&o[l][0].axes.push(u),a.mainExtracted=!0}}}}function I1e(e){Iw(e),mm(e,"width"),mm(e,"height")}function z1e(e){Iw(e);const t=e.layout.columns===1?"width":"childWidth",n=e.layout.columns===void 0?"height":"childHeight";mm(e,t),mm(e,n)}function Iw(e){for(const t of e.children)t.parseLayoutSize()}function mm(e,t){const n=yR(t),i=m1(n),r=e.component.resolve,s=e.component.layoutSize;let o;for(const a of e.children){const l=a.component.layoutSize.getWithExplicit(n),u=r.scale[i]??vR(i,e);if(u==="independent"&&l.value==="step"){o=void 0;break}if(o){if(u==="independent"&&o.value!==l.value){o=void 0;break}o=na(o,l,n,"")}else o=l}if(o){for(const a of e.children)e.renameSignal(a.getName(n),e.getName(t)),a.component.layoutSize.set(n,"merged",!1);s.setWithExplicit(t,o)}else s.setWithExplicit(t,{explicit:!1,value:void 0})}function P1e(e){const{size:t,component:n}=e;for(const i of os){const r=ai(i);if(t[r]){const s=t[r];n.layoutSize.set(r,ds(s)?"step":s,!0)}else{const s=B1e(e,r);n.layoutSize.set(r,s,!1)}}}function B1e(e,t){const n=t==="width"?"x":"y",i=e.config,r=e.getScaleComponent(n);if(r){const s=r.get("type"),o=r.get("range");if(Jt(s)){const a=H1(i.view,t);return Jo(o)||ds(a)?"step":a}else return Z_(i.view,t)}else{if(e.hasProjection||e.mark==="arc")return Z_(i.view,t);{const s=H1(i.view,t);return ds(s)?s.step:s}}}function zw(e,t,n){return Q(t,{suffix:`by_${Q(e)}`,...n??{}})}class sh extends iL{constructor(t,n,i,r){super(t,"facet",n,i,r,t.resolve),this.child=qw(t.spec,this,this.getName("child"),void 0,r),this.children=[this.child],this.facet=this.initFacet(t.facet)}initFacet(t){if(!Hd(t))return{facet:this.initFacetFieldDef(t,"facet")};const n=G(t),i={};for(const r of n){if(![Is,zs].includes(r)){Y(x1(r,"facet"));break}const s=t[r];if(s.field===void 0){Y(a_(s,r));break}i[r]=this.initFacetFieldDef(s,r)}return i}initFacetFieldDef(t,n){const i=L_(t,n);return i.header?i.header=li(i.header):i.header===null&&(i.header=null),i}channelHasField(t){return!!this.facet[t]}fieldDef(t){return this.facet[t]}parseData(){this.component.data=ym(this),this.child.parseData()}parseLayoutSize(){Iw(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),R1e(this)}assembleSelectionTopLevelSignals(t){return this.child.assembleSelectionTopLevelSignals(t)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(t){return this.child.assembleSelectionData(t)}getHeaderLayoutMixins(){const t={};for(const n of Wi)for(const i of bw){const r=this.component.layoutHeaders[n],s=r[i],{facetFieldDef:o}=r;if(o){const a=yc("titleOrient",o.header,this.config,n);if(["right","bottom"].includes(a)){const l=nm(n,a);t.titleAnchor??(t.titleAnchor={}),t.titleAnchor[l]="end"}}if(s!=null&&s[0]){const a=n==="row"?"height":"width",l=i==="header"?"headerBand":"footerBand";n!=="facet"&&!this.child.component.layoutSize.get(a)&&(t[l]??(t[l]={}),t[l][n]=.5),r.title&&(t.offset??(t.offset={}),t.offset[n==="row"?"rowTitle":"columnTitle"]=10)}}return t}assembleDefaultLayout(){const{column:t,row:n}=this.facet,i=t?this.columnDistinctSignal():n?1:void 0;let r="all";return(!n&&this.component.resolve.scale.x==="independent"||!t&&this.component.resolve.scale.y==="independent")&&(r="none"),{...this.getHeaderLayoutMixins(),...i?{columns:i}:{},bounds:"full",align:r}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof sh))return{signal:`length(data('${this.getName("column_domain")}'))`}}assembleGroupStyle(){}assembleGroup(t){return this.parent&&this.parent instanceof sh?{...this.channelHasField("column")?{encode:{update:{columns:{field:Q(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(t)}:super.assembleGroup(t)}getCardinalityAggregateForChild(){const t=[],n=[],i=[];if(this.child instanceof sh){if(this.child.channelHasField("column")){const r=Q(this.child.facet.column);t.push(r),n.push("distinct"),i.push(`distinct_${r}`)}}else for(const r of os){const s=this.child.component.scales[r];if(s&&!s.merged){const o=s.get("type"),a=s.get("range");if(Jt(o)&&Jo(a)){const l=om(this.child,r),u=Nw(l);u?(t.push(u),n.push("distinct"),i.push(`distinct_${u}`)):Y(o_(r))}}}return{fields:t,ops:n,as:i}}assembleFacet(){const{name:t,data:n}=this.component.data.facetRoot,{row:i,column:r}=this.facet,{fields:s,ops:o,as:a}=this.getCardinalityAggregateForChild(),l=[];for(const c of Wi){const f=this.facet[c];if(f){l.push(Q(f));const{bin:d,sort:h}=f;if(mt(d)&&l.push(Q(f,{binSuffix:"end"})),us(h)){const{field:p,op:g=T1}=h,m=zw(f,h);i&&r?(s.push(m),o.push("max"),a.push(m)):(s.push(p),o.push(g),a.push(m))}else if(q(h)){const p=mc(f,c);s.push(p),o.push("max"),a.push(p)}}}const u=!!i&&!!r;return{name:t,data:n,groupby:l,...u||s.length>0?{aggregate:{...u?{cross:u}:{},...s.length?{fields:s,ops:o,as:a}:{}}}:{}}}facetSortFields(t){const{facet:n}=this,i=n[t];return i?us(i.sort)?[zw(i,i.sort,{expr:"datum"})]:q(i.sort)?[mc(i,t,{expr:"datum"})]:[Q(i,{expr:"datum"})]:[]}facetSortOrder(t){const{facet:n}=this,i=n[t];if(i){const{sort:r}=i;return[(us(r)?r.order:!q(r)&&r)||"ascending"]}return[]}assembleLabelTitle(){var r;const{facet:t,config:n}=this;if(t.facet)return vw(t.facet,"facet",n);const i={row:["top","bottom"],column:["left","right"]};for(const s of yw)if(t[s]){const o=yc("labelOrient",(r=t[s])==null?void 0:r.header,n,s);if(i[s].includes(o))return vw(t[s],s,n)}}assembleMarks(){const{child:t}=this,n=this.component.data.facetRoot,i=D1e(n),r=t.assembleGroupEncodeEntry(!1),s=this.assembleLabelTitle()||t.assembleTitle(),o=t.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...s?{title:s}:{},...o?{style:o}:{},from:{facet:this.assembleFacet()},sort:{field:Wi.map(l=>this.facetSortFields(l)).flat(),order:Wi.map(l=>this.facetSortOrder(l)).flat()},...i.length>0?{data:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup(Kpe(this,[]))}]}getMapping(){return this.facet}}function j1e(e,t){const{row:n,column:i}=t;if(n&&i){let r=null;for(const s of[n,i])if(us(s.sort)){const{field:o,op:a=T1}=s.sort;e=r=new wl(e,{joinaggregate:[{op:a,field:o,as:zw(s,s.sort,{forAs:!0})}],groupby:[Q(s)]})}return r}return null}function aL(e,t){var n,i,r,s;for(const o of t){const a=o.data;if(e.name&&o.hasName()&&e.name!==o.dataName)continue;const l=(n=e.format)==null?void 0:n.mesh,u=(i=a.format)==null?void 0:i.feature;if(l&&u)continue;const c=(r=e.format)==null?void 0:r.feature;if((c||u)&&c!==u)continue;const f=(s=a.format)==null?void 0:s.mesh;if(!((l||f)&&l!==f)){if(Yd(e)&&Yd(a)){if(ki(e.values,a.values))return o}else if(cc(e)&&cc(a)){if(e.url===a.url)return o}else if(wO(e)&&e.name===o.dataName)return o}}return null}function U1e(e,t){if(e.data||!e.parent){if(e.data===null){const i=new xl({values:[]});return t.push(i),i}const n=aL(e.data,t);if(n)return ia(e.data)||(n.data.format=IF({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const i=new xl(e.data);return t.push(i),i}}else return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}function q1e(e,t,n){let i=0;for(const r of t.transforms){let s,o;if(Fpe(r))o=e=new gc(e,r),s="derived";else if(tw(r)){const a=O0e(r);o=e=En.makeWithAncestors(e,{},a,n)??e,e=new pc(e,t,r.filter)}else if(pO(r))o=e=gs.makeFromTransform(e,r,t),s="number";else if(Npe(r))s="date",n.getWithExplicit(r.field).value===void 0&&(e=new En(e,{[r.field]:s}),n.set(r.field,s,!1)),o=e=ps.makeFromTransform(e,r);else if(Ope(r))o=e=$r.makeFromTransform(e,r),s="number",dw(t)&&(e=new oa(e));else if(hO(r))o=e=rh.make(e,t,r,i++),s="derived";else if(Ape(r))o=e=new vc(e,r),s="number";else if(Tpe(r))o=e=new wl(e,r),s="number";else if(Rpe(r))o=e=Ks.makeFromTransform(e,r),s="derived";else if(Lpe(r))o=e=new cm(e,r),s="derived";else if(Ipe(r))o=e=new lm(e,r),s="derived";else if(Mpe(r))o=e=new um(e,r),s="derived";else if(wpe(r))o=e=new pm(e,r),s="derived";else if(Spe(r))e=new gm(e,r);else if(Dpe(r))o=e=kl.makeFromTransform(e,r),s="derived";else if(kpe(r))o=e=new am(e,r),s="derived";else if($pe(r))o=e=new dm(e,r),s="derived";else if(Epe(r))o=e=new hm(e,r),s="derived";else if(Cpe(r))o=e=new fm(e,r),s="derived";else{Y(ufe(r));continue}if(o&&s!==void 0)for(const a of o.producedFields()??[])n.set(a,s,!1)}return e}function ym(e){var g;let t=U1e(e,e.component.data.sources);const{outputNodes:n,outputNodeRefCounts:i}=e.component.data,r=e.data,o=!(r&&(ia(r)||cc(r)||Yd(r)))&&e.parent?e.parent.component.data.ancestorParse.clone():new Ype;ia(r)?(kO(r)?t=new eh(t,r.sequence):rw(r)&&(t=new Qd(t,r.graticule)),o.parseNothing=!0):((g=r==null?void 0:r.format)==null?void 0:g.parse)===null&&(o.parseNothing=!0),t=En.makeExplicit(t,e,o)??t,t=new oa(t);const a=e.parent&&xc(e.parent);(At(e)||Cr(e))&&a&&(t=gs.makeFromEncoding(t,e)??t),e.transforms.length>0&&(t=q1e(t,e,o));const l=L0e(e),u=R0e(e);t=En.makeWithAncestors(t,{},{...l,...u},o)??t,At(e)&&(t=_c.parseAll(t,e),t=ih.parseAll(t,e)),(At(e)||Cr(e))&&(a||(t=gs.makeFromEncoding(t,e)??t),t=ps.makeFromEncoding(t,e)??t,t=gc.parseAllForSortIndex(t,e));const c=e.getDataName(yt.Raw),f=new qn(t,c,yt.Raw,i);if(n[c]=f,t=f,At(e)){const m=$r.makeFromEncoding(t,e);m&&(t=m,dw(e)&&(t=new oa(t))),t=kl.makeFromEncoding(t,e)??t,t=Ks.makeFromEncoding(t,e)??t}At(e)&&(t=nh.make(t,e)??t);const d=e.getDataName(yt.Main),h=new qn(t,d,yt.Main,i);n[d]=h,t=h,At(e)&&Fge(e,h);let p=null;if(Cr(e)){const m=e.getName("facet");t=j1e(t,e.facet)??t,p=new bc(t,e,m,h.getSource()),n[m]=p}return{...e.component.data,outputNodes:n,outputNodeRefCounts:i,raw:f,main:h,facetRoot:p,ancestorParse:o}}class W1e extends Lw{constructor(t,n,i,r){var s,o,a,l;super(t,"concat",n,i,r,t.resolve),(((o=(s=t.resolve)==null?void 0:s.axis)==null?void 0:o.x)==="shared"||((l=(a=t.resolve)==null?void 0:a.axis)==null?void 0:l.y)==="shared")&&Y(ofe),this.children=this.getChildren(t).map((u,c)=>qw(u,this,this.getName(`concat_${c}`),void 0,r))}parseData(){this.component.data=ym(this);for(const t of this.children)t.parseData()}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of G(t.component.selection))this.component.selection[n]=t.component.selection[n]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){for(const t of this.children)t.parseAxesAndHeaders()}getChildren(t){return q1(t)?t.vconcat:Y_(t)?t.hconcat:t.concat}parseLayoutSize(){z1e(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.forEach(t=>t.assembleSignals()),[]}assembleLayoutSignals(){const t=xw(this);for(const n of this.children)t.push(...n.assembleLayoutSignals());return t}assembleSelectionData(t){return this.children.reduce((n,i)=>i.assembleSelectionData(n),t)}assembleMarks(){return this.children.map(t=>{const n=t.assembleTitle(),i=t.assembleGroupStyle(),r=t.assembleGroupEncodeEntry(!1);return{type:"group",name:t.getName("group"),...n?{title:n}:{},...i?{style:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup()}})}assembleGroupStyle(){}assembleDefaultLayout(){const t=this.layout.columns;return{...t!=null?{columns:t}:{},bounds:"full",align:"each"}}}function H1e(e){return e===!1||e===null}const G1e={disable:1,gridScale:1,scale:1,...CN,labelExpr:1,encode:1},lL=G(G1e);class Pw extends Ys{constructor(t={},n={},i=!1){super(),this.explicit=t,this.implicit=n,this.mainExtracted=i}clone(){return new Pw(Ce(this.explicit),Ce(this.implicit),this.mainExtracted)}hasAxisPart(t){return t==="axis"?!0:t==="grid"||t==="title"?!!this.get(t):!H1e(this.get(t))}hasOrientSignalRef(){return de(this.explicit.orient)}}function V1e(e,t,n){const{encoding:i,config:r}=e,s=Ut(i[t])??Ut(i[ss(t)]),o=e.axis(t)||{},{format:a,formatType:l}=o;if(pl(l))return{text:_r({fieldOrDatumDef:s,field:"datum.value",format:a,formatType:l,config:r}),...n};if(a===void 0&&l===void 0&&r.customFormatTypes){if(rc(s)==="quantitative"){if(sc(s)&&s.stack==="normalize"&&r.normalizedNumberFormatType)return{text:_r({fieldOrDatumDef:s,field:"datum.value",format:r.normalizedNumberFormat,formatType:r.normalizedNumberFormatType,config:r}),...n};if(r.numberFormatType)return{text:_r({fieldOrDatumDef:s,field:"datum.value",format:r.numberFormat,formatType:r.numberFormatType,config:r}),...n}}if(rc(s)==="temporal"&&r.timeFormatType&&Z(s)&&!s.timeUnit)return{text:_r({fieldOrDatumDef:s,field:"datum.value",format:r.timeFormat,formatType:r.timeFormatType,config:r}),...n}}return n}function X1e(e){return os.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[tme(n,e)]),t),{})}const Y1e={bottom:"top",top:"bottom",left:"right",right:"left"};function Z1e(e){const{axes:t,resolve:n}=e.component,i={top:0,bottom:0,right:0,left:0};for(const r of e.children){r.parseAxesAndHeaders();for(const s of G(r.component.axes))n.axis[s]=_w(e.component.resolve,s),n.axis[s]==="shared"&&(t[s]=K1e(t[s],r.component.axes[s]),t[s]||(n.axis[s]="independent",delete t[s]))}for(const r of os){for(const s of e.children)if(s.component.axes[r]){if(n.axis[r]==="independent"){t[r]=(t[r]??[]).concat(s.component.axes[r]);for(const o of s.component.axes[r]){const{value:a,explicit:l}=o.getWithExplicit("orient");if(!de(a)){if(i[a]>0&&!l){const u=Y1e[a];i[a]>i[u]&&o.set("orient",u,!1)}i[a]++}}}delete s.component.axes[r]}if(n.axis[r]==="independent"&&t[r]&&t[r].length>1)for(const[s,o]of(t[r]||[]).entries())s>0&&o.get("grid")&&!o.explicit.grid&&(o.implicit.grid=!1)}}function K1e(e,t){if(e){if(e.length!==t.length)return;const n=e.length;for(let i=0;in.clone());return e}function J1e(e,t){for(const n of lL){const i=na(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",(r,s)=>{switch(n){case"title":return gD(r,s);case"gridScale":return{explicit:r.explicit,value:Dt(r.value,s.value)}}return V1(r,s,n,"axis")});e.setWithExplicit(n,i)}return e}function Q1e(e,t,n,i,r){if(t==="disable")return n!==void 0;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(de(n.labelAngle)?n.labelAngle:Ld(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===fR(i,r))return!0}return e===n[t]}const eme=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function tme(e,t){var y,b;let n=t.axis(e);const i=new Pw,r=Ut(t.encoding[e]),{mark:s,config:o}=t,a=(n==null?void 0:n.orient)||((y=o[e==="x"?"axisX":"axisY"])==null?void 0:y.orient)||((b=o.axis)==null?void 0:b.orient)||jge(e),l=t.getScaleComponent(e).get("type"),u=Oge(e,l,a,t.config),c=n!==void 0?!n:gw("disable",o.style,n==null?void 0:n.style,u).configValue;if(i.set("disable",c,n!==void 0),c)return i;n=n||{};const f=zge(r,n,e,o.style,u),d=oN(n.formatType,r,l),h=sN(r,r.type,n.format,n.formatType,o,!0),p={fieldOrDatumDef:r,axis:n,channel:e,model:t,scaleType:l,orient:a,labelAngle:f,format:h,formatType:d,mark:s,config:o};for(const v of lL){const x=v in lR?lR[v](p):SN(v)?n[v]:void 0,_=x!==void 0,k=Q1e(x,v,n,t,e);if(_&&k)i.set(v,x,k);else{const{configValue:w=void 0,configFrom:$=void 0}=SN(v)&&v!=="values"?gw(v,o.style,n.style,u):{},S=w!==void 0;_&&!S?i.set(v,x,k):($!=="vgAxisConfig"||eme.has(v)&&S||Xd(w)||de(w))&&i.set(v,w,!1)}}const g=n.encoding??{},m=EN.reduce((v,x)=>{if(!i.hasAxisPart(x))return v;const _=bR(g[x]??{},t),k=x==="labels"?V1e(t,e,_):_;return k!==void 0&&!lt(k)&&(v[x]={update:k}),v},{});return lt(m)||i.set("encode",m,!!n.encoding||n.labelAngle!==void 0),i}function nme({encoding:e,size:t}){for(const n of os){const i=ai(n);ds(t[i])&&ta(e[n])&&(delete t[i],Y(SD(i)))}return t}const ime={vgMark:"arc",encodeEntry:e=>({...Hi(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...$n("x",e,{defaultPos:"mid"}),...$n("y",e,{defaultPos:"mid"}),...ra(e,"radius"),...ra(e,"theta")})},rme={vgMark:"area",encodeEntry:e=>({...Hi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...K1("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="horizontal"}),...K1("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="vertical"}),...cw(e)})},sme={vgMark:"rect",encodeEntry:e=>({...Hi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...ra(e,"x"),...ra(e,"y")})},ome={vgMark:"shape",encodeEntry:e=>({...Hi(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:e=>{const{encoding:t}=e,n=t.shape;return[{type:"geoshape",projection:e.projectionName(),...n&&Z(n)&&n.type===nc?{field:Q(n,{expr:"datum"})}:{}}]}},ame={vgMark:"image",encodeEntry:e=>({...Hi(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...ra(e,"x"),...ra(e,"y"),...lw(e,"url")})},lme={vgMark:"line",encodeEntry:e=>({...Hi(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...$n("x",e,{defaultPos:"mid"}),...$n("y",e,{defaultPos:"mid"}),...Qt("size",e,{vgChannel:"strokeWidth"}),...cw(e)})},ume={vgMark:"trail",encodeEntry:e=>({...Hi(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...$n("x",e,{defaultPos:"mid"}),...$n("y",e,{defaultPos:"mid"}),...Qt("size",e),...cw(e)})};function Bw(e,t){const{config:n}=e;return{...Hi(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...$n("x",e,{defaultPos:"mid"}),...$n("y",e,{defaultPos:"mid"}),...Qt("size",e),...Qt("angle",e),...cme(e,n,t)}}function cme(e,t,n){return n?{shape:{value:n}}:Qt("shape",e)}const fme={vgMark:"symbol",encodeEntry:e=>Bw(e)},dme={vgMark:"symbol",encodeEntry:e=>Bw(e,"circle")},hme={vgMark:"symbol",encodeEntry:e=>Bw(e,"square")},pme={vgMark:"rect",encodeEntry:e=>({...Hi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...ra(e,"x"),...ra(e,"y")})},gme={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return!e.encoding.x&&!e.encoding.y&&!e.encoding.latitude&&!e.encoding.longitude?{}:{...Hi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...K1("x",e,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"}),...K1("y",e,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"}),...Qt("size",e,{vgChannel:"strokeWidth"})}}},mme={vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return{...Hi(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...$n("x",e,{defaultPos:"mid"}),...$n("y",e,{defaultPos:"mid"}),...lw(e),...Qt("size",e,{vgChannel:"fontSize"}),...Qt("angle",e),...qO("align",yme(e.markDef,n,t)),...qO("baseline",bme(e.markDef,n,t)),...$n("radius",e,{defaultPos:null}),...$n("theta",e,{defaultPos:null})}}};function yme(e,t,n){if(it("align",e,n)===void 0)return"center"}function bme(e,t,n){if(it("baseline",e,n)===void 0)return"middle"}const vme={vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,i=n.orient,r=i==="horizontal"?"width":"height",s=i==="horizontal"?"height":"width";return{...Hi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...$n("x",e,{defaultPos:"mid",vgChannel:"xc"}),...$n("y",e,{defaultPos:"mid",vgChannel:"yc"}),...Qt("size",e,{defaultValue:xme(e),vgChannel:r}),[s]:vt(it("thickness",n,t))}}};function xme(e){const{config:t,markDef:n}=e,{orient:i}=n,r=i==="horizontal"?"width":"height",s=e.getScaleComponent(i==="horizontal"?"x":"y"),o=it("size",n,t,{vgChannel:r})??t.tick.bandSize;if(o!==void 0)return o;{const a=s?s.get("range"):void 0;return a&&Jo(a)&&Xe(a.step)?a.step*3/4:W1(t.view,r)*3/4}}const bm={arc:ime,area:rme,bar:sme,circle:dme,geoshape:ome,image:ame,line:lme,point:fme,rect:pme,rule:gme,square:hme,text:mme,tick:vme,trail:ume};function _me(e){if(Pe([E1,k1,Rde],e.mark)){const t=DN(e.mark,e.encoding);if(t.length>0)return wme(e,t)}else if(e.mark===$1){const t=r_.some(n=>it(n,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t)return kme(e)}return jw(e)}const uL="faceted_path_";function wme(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:uL+e.requestDataName(yt.Main),data:e.requestDataName(yt.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:jw(e,{fromPrefix:uL})}]}const cL="stack_group_";function kme(e){var u;const[t]=jw(e,{fromPrefix:cL}),n=e.scaleName(e.stack.fieldChannel),i=(c={})=>e.vgField(e.stack.fieldChannel,c),r=(c,f)=>{const d=[i({prefix:"min",suffix:"start",expr:f}),i({prefix:"max",suffix:"start",expr:f}),i({prefix:"min",suffix:"end",expr:f}),i({prefix:"max",suffix:"end",expr:f})];return`${c}(${d.map(h=>`scale('${n}',${h})`).join(",")})`};let s,o;e.stack.fieldChannel==="x"?(s={...Yu(t.encode.update,["y","yc","y2","height",...r_]),x:{signal:r("min","datum")},x2:{signal:r("max","datum")},clip:{value:!0}},o={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update={...ri(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(s={...Yu(t.encode.update,["x","xc","x2","width"]),y:{signal:r("min","datum")},y2:{signal:r("max","datum")},clip:{value:!0}},o={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update={...ri(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const c of r_){const f=Gs(c,e.markDef,e.config);t.encode.update[c]?(s[c]=t.encode.update[c],delete t.encode.update[c]):f&&(s[c]=vt(f)),f&&(t.encode.update[c]={value:0})}const a=[];if(((u=e.stack.groupbyChannels)==null?void 0:u.length)>0)for(const c of e.stack.groupbyChannels){const f=e.fieldDef(c),d=Q(f);d&&a.push(d),(f!=null&&f.bin||f!=null&&f.timeUnit)&&a.push(Q(f,{binSuffix:"end"}))}return s=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((c,f)=>{if(t.encode.update[f])return{...c,[f]:t.encode.update[f]};{const d=Gs(f,e.markDef,e.config);return d!==void 0?{...c,[f]:vt(d)}:c}},s),s.stroke&&(s.strokeForeground={value:!0},s.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(yt.Main),name:cL+e.requestDataName(yt.Main),groupby:a,aggregate:{fields:[i({suffix:"start"}),i({suffix:"start"}),i({suffix:"end"}),i({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:s},marks:[{type:"group",encode:{update:o},marks:[t]}]}]}function $me(e){var a;const{encoding:t,stack:n,mark:i,markDef:r,config:s}=e,o=t.order;if(!(!q(o)&&wr(o)&&U7(o.value)||!o&&U7(it("order",r,s)))){if((q(o)||Z(o))&&!n)return dD(o,{expr:"datum"});if(Qo(i)){const l=r.orient==="horizontal"?"y":"x",u=t[l];if(Z(u)){const c=u.sort;if(q(c))return{field:Q(u,{prefix:l,suffix:"sort_index",expr:"datum"})};if(us(c))return{field:Q({aggregate:I_(e.encoding)?c.op:void 0,field:c.field},{expr:"datum"})};if(cN(c)){const f=e.fieldDef(c.encoding);return{field:Q(f,{expr:"datum"}),order:c.order}}else return c===null?void 0:{field:Q(u,{binSuffix:(a=e.stack)!=null&&a.impute?"mid":void 0,expr:"datum"})}}return}}}function jw(e,t={fromPrefix:""}){const{mark:n,markDef:i,encoding:r,config:s}=e,o=Dt(i.clip,Eme(e),Cme(e)),a=cD(i),l=r.key,u=$me(e),c=Sme(e),f=it("aria",i,s),d=bm[n].postEncodingTransform?bm[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:bm[n].vgMark,...o?{clip:!0}:{},...a?{style:a}:{},...l?{key:l.field}:{},...u?{sort:u}:{},...c||{},...f===!1?{aria:f}:{},from:{data:t.fromPrefix+e.requestDataName(yt.Main)},encode:{update:bm[n].encodeEntry(e)},...d?{transform:d}:{}}]}function Eme(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return t!=null&&t.get("selectionExtent")||n!=null&&n.get("selectionExtent")?!0:void 0}function Cme(e){const t=e.component.projection;return t&&!t.isFit?!0:void 0}function Sme(e){if(!e.component.selection)return null;const t=G(e.component.selection).length;let n=t,i=e.parent;for(;i&&n===0;)n=G(i.component.selection).length,i=i.parent;return n?{interactive:t>0||e.mark==="geoshape"||!!e.encoding.tooltip}:null}class fL extends iL{constructor(t,n,i,r={},s){super(t,"unit",n,i,s,void 0,ZN(t)?t.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[];const o=ls(t.mark)?{...t.mark}:{type:t.mark},a=o.type;o.filled===void 0&&(o.filled=fpe(o,s,{graticule:t.data&&rw(t.data)}));const l=this.encoding=bhe(t.encoding||{},a,o.filled,s);this.markDef=sO(o,l,s),this.size=nme({encoding:l,size:ZN(t)?{...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}}:r}),this.stack=rO(this.markDef,l),this.specifiedScales=this.initScales(a,l),this.specifiedAxes=this.initAxes(l),this.specifiedLegends=this.initLegends(l),this.specifiedProjection=t.projection,this.selection=(t.params??[]).filter(u=>V_(u))}get hasProjection(){const{encoding:t}=this,n=this.mark===QD,i=t&&_ce.some(r=>Se(t[r]));return n||i}scaleDomain(t){const n=this.specifiedScales[t];return n?n.domain:void 0}axis(t){return this.specifiedAxes[t]}legend(t){return this.specifiedLegends[t]}initScales(t,n){return y1.reduce((i,r)=>{const s=Ut(n[r]);return s&&(i[r]=this.initScale(s.scale??{})),i},{})}initScale(t){const{domain:n,range:i}=t,r=li(t);return q(n)&&(r.domain=n.map($i)),q(i)&&(r.range=i.map($i)),r}initAxes(t){return os.reduce((n,i)=>{const r=t[i];if(Se(r)||i===wt&&Se(t.x2)||i===Zt&&Se(t.y2)){const s=Se(r)?r.axis:void 0;n[i]=s&&this.initAxis({...s})}return n},{})}initAxis(t){const n=G(t),i={};for(const r of n){const s=t[r];i[r]=Xd(s)?aD(s):$i(s)}return i}initLegends(t){return Fce.reduce((n,i)=>{const r=Ut(t[i]);if(r&&Nce(i)){const s=r.legend;n[i]=s&&li(s)}return n},{})}parseData(){this.component.data=ym(this)}parseLayoutSize(){P1e(this)}parseSelections(){this.component.selection=Mge(this,this.selection)}parseMarkGroup(){this.component.mark=_me(this)}parseAxesAndHeaders(){this.component.axes=X1e(this)}assembleSelectionTopLevelSignals(t){return Jpe(this,t)}assembleSignals(){return[...oR(this),...Zpe(this,[])]}assembleSelectionData(t){return Qpe(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return xw(this)}assembleMarks(){let t=this.component.mark??[];return(!this.parent||!xc(this.parent))&&(t=CO(this,t)),t.map(this.correctDataNames)}assembleGroupStyle(){const{style:t}=this.view||{};return t!==void 0?t:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(t){return ml(this.encoding,t)}fieldDef(t){const n=this.encoding[t];return fs(n)}typedFieldDef(t){const n=this.fieldDef(t);return Un(n)?n:null}}class Uw extends Lw{constructor(t,n,i,r,s){super(t,"layer",n,i,s,t.resolve,t.view);const o={...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}};this.children=t.layer.map((a,l)=>{if(G1(a))return new Uw(a,this,this.getName(`layer_${l}`),o,s);if(Vs(a))return new fL(a,this,this.getName(`layer_${l}`),o,s);throw new Error(s_(a))})}parseData(){this.component.data=ym(this);for(const t of this.children)t.parseData()}parseLayoutSize(){I1e(this)}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of G(t.component.selection))this.component.selection[n]=t.component.selection[n]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){Z1e(this)}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleSignals()),oR(this))}assembleLayoutSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleLayoutSignals()),xw(this))}assembleSelectionData(t){return this.children.reduce((n,i)=>i.assembleSelectionData(n),t)}assembleGroupStyle(){const t=new Set;for(const i of this.children)for(const r of ee(i.assembleGroupStyle()))t.add(r);const n=Array.from(t);return n.length>1?n:n.length===1?n[0]:void 0}assembleTitle(){let t=super.assembleTitle();if(t)return t;for(const n of this.children)if(t=n.assembleTitle(),t)return t}assembleLayout(){return null}assembleMarks(){return ege(this,this.children.flatMap(t=>t.assembleMarks()))}assembleLegends(){return this.children.reduce((t,n)=>t.concat(n.assembleLegends()),TR(this))}}function qw(e,t,n,i,r){if(M1(e))return new sh(e,t,n,r);if(G1(e))return new Uw(e,t,n,i,r);if(Vs(e))return new fL(e,t,n,i,r);if(jhe(e))return new W1e(e,t,n,r);throw new Error(s_(e))}function Ame(e,t={}){t.logger&&Zfe(t.logger),t.fieldTitle&&_N(t.fieldTitle);try{const n=nO(Wl(t.config,e.config)),i=bO(e,n),r=qw(i,null,"",void 0,n);return r.parse(),J0e(r.component.data,r),{spec:Mme(r,Tme(e,i.autosize,n,r),e.datasets,e.usermeta),normalized:i}}finally{t.logger&&Kfe(),t.fieldTitle&&che()}}function Tme(e,t,n,i){const r=i.component.layoutSize.get("width"),s=i.component.layoutSize.get("height");if(t===void 0?(t={type:"pad"},i.hasAxisOrientSignalRef()&&(t.resize=!0)):te(t)&&(t={type:t}),r&&s&&Gpe(t.type)){if(r==="step"&&s==="step")Y(bD()),t.type="pad";else if(r==="step"||s==="step"){const o=r==="step"?"width":"height";Y(bD(m1(o)));const a=o==="width"?"height":"width";t.type=Vpe(a)}}return{...G(t).length===1&&t.type?t.type==="pad"?{}:{autosize:t.type}:{autosize:t},...xO(n,!1),...xO(e,!0)}}function Mme(e,t,n={},i){const r=e.config?Qhe(e.config):void 0,s=[].concat(e.assembleSelectionData([]),N1e(e.component.data,n)),o=e.assembleProjections(),a=e.assembleTitle(),l=e.assembleGroupStyle(),u=e.assembleGroupEncodeEntry(!0);let c=e.assembleLayoutSignals();c=c.filter(h=>(h.name==="width"||h.name==="height")&&h.value!==void 0?(t[h.name]=+h.value,!1):!0);const{params:f,...d}=t;return{$schema:"https://vega.github.io/schema/vega/v5.json",...e.description?{description:e.description}:{},...d,...a?{title:a}:{},...l?{style:l}:{},...u?{encode:{update:u}}:{},data:s,...o.length>0?{projections:o}:{},...e.assembleGroup([...c,...e.assembleSelectionTopLevelSignals([]),...XN(f)]),...r?{config:r}:{},...i?{usermeta:i}:{}}}const Fme=gce.version,Dme=Object.freeze(Object.defineProperty({__proto__:null,accessPathDepth:Zu,accessPathWithDatum:V7,compile:Ame,contains:Pe,deepEqual:ki,deleteNestedProperty:u1,duplicate:Ce,entries:qo,every:q7,fieldIntersection:G7,flatAccessWithDatum:PF,getFirstDefined:Dt,hasIntersection:W7,hash:ze,internalField:UF,isBoolean:Nd,isEmpty:lt,isEqual:yce,isInternalField:qF,isNullOrFalse:U7,isNumeric:c1,keys:G,logicalExpr:Od,mergeDeep:IF,never:LF,normalize:bO,normalizeAngle:Ld,omit:ri,pick:Yu,prefixGenerator:H7,removePathFromField:X7,replaceAll:il,replacePathInField:ji,resetIdCounter:vce,setEqual:zF,some:nl,stringify:ut,titleCase:Rd,unique:ts,uniqueId:jF,vals:ln,varName:_t,version:Fme},Symbol.toStringTag,{value:"Module"}));function dL(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}}var Nme="vega-themes",Ome="2.14.0",Rme="Themes for stylized Vega and Vega-Lite visualizations.",Lme=["vega","vega-lite","themes","style"],Ime="BSD-3-Clause",zme={name:"UW Interactive Data Lab",url:"https://idl.cs.washington.edu"},Pme=[{name:"Emily Gu",url:"https://github.com/emilygu"},{name:"Arvind Satyanarayan",url:"http://arvindsatya.com"},{name:"Jeffrey Heer",url:"https://idl.cs.washington.edu"},{name:"Dominik Moritz",url:"https://www.domoritz.de"}],Bme="build/vega-themes.js",jme="build/vega-themes.module.js",Ume="build/vega-themes.min.js",qme="build/vega-themes.min.js",Wme="build/vega-themes.module.d.ts",Hme={type:"git",url:"https://github.com/vega/vega-themes.git"},Gme=["src","build"],Vme={prebuild:"yarn clean",build:"rollup -c",clean:"rimraf build && rimraf examples/build","copy:data":"rsync -r node_modules/vega-datasets/data/* examples/data","copy:build":"rsync -r build/* examples/build","deploy:gh":"yarn build && mkdir -p examples/build && rsync -r build/* examples/build && gh-pages -d examples",preversion:"yarn lint",serve:"browser-sync start -s -f build examples --serveStatic examples",start:"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'",format:"eslint . --fix",lint:"eslint .",release:"release-it"},Xme={"@babel/core":"^7.22.9","@babel/plugin-proposal-async-generator-functions":"^7.20.7","@babel/plugin-proposal-json-strings":"^7.18.6","@babel/plugin-proposal-object-rest-spread":"^7.20.7","@babel/plugin-proposal-optional-catch-binding":"^7.18.6","@babel/plugin-transform-runtime":"^7.22.9","@babel/preset-env":"^7.22.9","@babel/preset-typescript":"^7.22.5","@release-it/conventional-changelog":"^7.0.0","@rollup/plugin-json":"^6.0.0","@rollup/plugin-node-resolve":"^15.1.0","@rollup/plugin-terser":"^0.4.3","@typescript-eslint/eslint-plugin":"^6.0.0","@typescript-eslint/parser":"^6.0.0","browser-sync":"^2.29.3",concurrently:"^8.2.0",eslint:"^8.45.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^5.0.0","gh-pages":"^5.0.0",prettier:"^3.0.0","release-it":"^16.1.0",rollup:"^3.26.2","rollup-plugin-bundle-size":"^1.0.3","rollup-plugin-ts":"^3.2.0",typescript:"^5.1.6",vega:"^5.25.0","vega-lite":"^5.9.3"},Yme={vega:"*","vega-lite":"*"},Zme={},Kme={name:Nme,version:Ome,description:Rme,keywords:Lme,license:Ime,author:zme,contributors:Pme,main:Bme,module:jme,unpkg:Ume,jsdelivr:qme,types:Wme,repository:Hme,files:Gme,scripts:Vme,devDependencies:Xme,peerDependencies:Yme,dependencies:Zme};const wc="#fff",hL="#888",Jme={background:"#333",view:{stroke:hL},title:{color:wc,subtitleColor:wc},style:{"guide-label":{fill:wc},"guide-title":{fill:wc}},axis:{domainColor:wc,gridColor:hL,tickColor:wc}},$l="#4572a7",Qme={background:"#fff",arc:{fill:$l},area:{fill:$l},line:{stroke:$l,strokeWidth:2},path:{stroke:$l},rect:{fill:$l},shape:{stroke:$l},symbol:{fill:$l,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},El="#30a2da",Ww="#cbcbcb",e2e="#999",t2e="#333",pL="#f0f0f0",gL="#333",n2e={arc:{fill:El},area:{fill:El},axis:{domainColor:Ww,grid:!0,gridColor:Ww,gridWidth:1,labelColor:e2e,labelFontSize:10,titleColor:t2e,tickColor:Ww,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:pL,group:{fill:pL},legend:{labelColor:gL,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:gL,titleFontSize:14,titlePadding:10},line:{stroke:El,strokeWidth:2},path:{stroke:El,strokeWidth:.5},rect:{fill:El},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:El},bar:{binSpacing:2,fill:El,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},Cl="#000",i2e={group:{fill:"#e5e5e5"},arc:{fill:Cl},area:{fill:Cl},line:{stroke:Cl},path:{stroke:Cl},rect:{fill:Cl},shape:{stroke:Cl},symbol:{fill:Cl,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},r2e=22,s2e="normal",mL="Benton Gothic, sans-serif",yL=11.5,o2e="normal",Sl="#82c6df",Hw="Benton Gothic Bold, sans-serif",bL="normal",vL=13,oh={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]},a2e={background:"#ffffff",title:{anchor:"start",color:"#000000",font:Hw,fontSize:r2e,fontWeight:s2e},arc:{fill:Sl},area:{fill:Sl},line:{stroke:Sl,strokeWidth:2},path:{stroke:Sl},rect:{fill:Sl},shape:{stroke:Sl},symbol:{fill:Sl,size:30},axis:{labelFont:mL,labelFontSize:yL,labelFontWeight:o2e,titleFont:Hw,titleFontSize:vL,titleFontWeight:bL},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:mL,labelFontSize:yL,symbolType:"square",titleFont:Hw,titleFontSize:vL,titleFontWeight:bL},range:{category:oh["category-6"],diverging:oh["fireandice-6"],heatmap:oh["fire-7"],ordinal:oh["fire-7"],ramp:oh["fire-7"]}},Al="#ab5787",vm="#979797",l2e={background:"#f9f9f9",arc:{fill:Al},area:{fill:Al},line:{stroke:Al},path:{stroke:Al},rect:{fill:Al},shape:{stroke:Al},symbol:{fill:Al,size:30},axis:{domainColor:vm,domainWidth:.5,gridWidth:.2,labelColor:vm,tickColor:vm,tickWidth:.2,titleColor:vm},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},Tl="#3e5c69",u2e={background:"#fff",arc:{fill:Tl},area:{fill:Tl},line:{stroke:Tl},path:{stroke:Tl},rect:{fill:Tl},shape:{stroke:Tl},symbol:{fill:Tl},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},Gi="#1696d2",xL="#000000",c2e="#FFFFFF",xm="Lato",Gw="Lato",f2e="Lato",d2e="#DEDDDD",h2e=18,ah={"main-colors":["#1696d2","#d2d2d2","#000000","#fdbf11","#ec008b","#55b748","#5c5859","#db2b27"],"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"shades-gray":["#F5F5F5","#ECECEC","#E3E3E3","#DCDBDB","#D2D2D2","#9D9D9D","#696969","#353535"],"shades-yellow":["#FFF2CF","#FCE39E","#FDD870","#FCCB41","#FDBF11","#E88E2D","#CA5800","#843215"],"shades-magenta":["#F5CBDF","#EB99C2","#E46AA7","#E54096","#EC008B","#AF1F6B","#761548","#351123"],"shades-green":["#DCEDD9","#BCDEB4","#98CF90","#78C26D","#55B748","#408941","#2C5C2D","#1A2E19"],"shades-black":["#D5D5D4","#ADABAC","#848081","#5C5859","#332D2F","#262223","#1A1717","#0E0C0D"],"shades-red":["#F8D5D4","#F1AAA9","#E9807D","#E25552","#DB2B27","#A4201D","#6E1614","#370B0A"],"one-group":["#1696d2","#000000"],"two-groups-cat-1":["#1696d2","#000000"],"two-groups-cat-2":["#1696d2","#fdbf11"],"two-groups-cat-3":["#1696d2","#db2b27"],"two-groups-seq":["#a2d4ec","#1696d2"],"three-groups-cat":["#1696d2","#fdbf11","#000000"],"three-groups-seq":["#a2d4ec","#1696d2","#0a4c6a"],"four-groups-cat-1":["#000000","#d2d2d2","#fdbf11","#1696d2"],"four-groups-cat-2":["#1696d2","#ec0008b","#fdbf11","#5c5859"],"four-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a"],"five-groups-cat-1":["#1696d2","#fdbf11","#d2d2d2","#ec008b","#000000"],"five-groups-cat-2":["#1696d2","#0a4c6a","#d2d2d2","#fdbf11","#332d2f"],"five-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a","#000000"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-cat-2":["#1696d2","#d2d2d2","#ec008b","#fdbf11","#332d2f","#0a4c6a"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},p2e={background:c2e,title:{anchor:"start",fontSize:h2e,font:xm},axisX:{domain:!0,domainColor:xL,domainWidth:1,grid:!1,labelFontSize:12,labelFont:Gw,labelAngle:0,tickColor:xL,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:xm},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:d2e,gridWidth:1,labelFontSize:12,labelFont:Gw,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:xm,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:Gw,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:xm,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:ah["six-groups-cat-1"],diverging:ah["diverging-colors"],heatmap:ah["diverging-colors"],ordinal:ah["six-groups-seq"],ramp:ah["shades-blue"]},area:{fill:Gi},rect:{fill:Gi},line:{color:Gi,stroke:Gi,strokeWidth:5},trail:{color:Gi,stroke:Gi,strokeWidth:0,size:1},path:{stroke:Gi,strokeWidth:.5},point:{filled:!0},text:{font:f2e,color:Gi,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:Gi,stroke:null}},arc:{fill:Gi},shape:{stroke:Gi},symbol:{fill:Gi,size:30}},Ml="#3366CC",_L="#ccc",_m="Arial, sans-serif",g2e={arc:{fill:Ml},area:{fill:Ml},path:{stroke:Ml},rect:{fill:Ml},shape:{stroke:Ml},symbol:{stroke:Ml},circle:{fill:Ml},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:_m,fontSize:12},"guide-title":{font:_m,fontSize:12},"group-title":{font:_m,fontSize:12}},title:{font:_m,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:_L,tickColor:_L,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},Vw=e=>e*(1/3+1),wL=Vw(9),kL=Vw(10),$L=Vw(12),lh="Segoe UI",EL="wf_standard-font, helvetica, arial, sans-serif",CL="#252423",uh="#605E5C",SL="transparent",m2e="#C8C6C4",Sr="#118DFF",y2e="#12239E",b2e="#E66C37",v2e="#6B007B",x2e="#E044A7",_2e="#744EC2",w2e="#D9B300",k2e="#D64550",AL=Sr,TL="#DEEFFF",ML=[TL,AL],$2e={view:{stroke:SL},background:SL,font:lh,header:{titleFont:EL,titleFontSize:$L,titleColor:CL,labelFont:lh,labelFontSize:kL,labelColor:uh},axis:{ticks:!1,grid:!1,domain:!1,labelColor:uh,labelFontSize:wL,titleFont:EL,titleColor:CL,titleFontSize:$L,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:m2e,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:Sr},line:{stroke:Sr,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:lh,fontSize:wL,fill:uh},arc:{fill:Sr},area:{fill:Sr,line:!0,opacity:.6},path:{stroke:Sr},rect:{fill:Sr},point:{fill:Sr,filled:!0,size:75},shape:{stroke:Sr},symbol:{fill:Sr,strokeWidth:1.5,size:50},legend:{titleFont:lh,titleFontWeight:"bold",titleColor:uh,labelFont:lh,labelFontSize:kL,labelColor:uh,symbolType:"circle",symbolSize:75},range:{category:[Sr,y2e,b2e,v2e,x2e,_2e,w2e,k2e],diverging:ML,heatmap:ML,ordinal:[TL,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",AL]}},Xw='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',FL=400,E2e=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],C2e=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function wm({type:e,background:t}){const n=e==="dark"?"#161616":"#ffffff",i=e==="dark"?"#f4f4f4":"#161616",r=e==="dark"?E2e:C2e,s=e==="dark"?"#d4bbff":"#6929c4";return{background:t,arc:{fill:s},area:{fill:s},path:{stroke:s},rect:{fill:s},shape:{stroke:s},symbol:{stroke:s},circle:{fill:s},view:{fill:n,stroke:n},group:{fill:n},title:{color:i,anchor:"start",dy:-15,fontSize:16,font:Xw,fontWeight:600},axis:{labelColor:i,labelFontSize:12,grid:!0,gridColor:"#525252",titleColor:i,labelAngle:0},style:{"guide-label":{font:Xw,fill:i,fontWeight:FL},"guide-title":{font:Xw,fill:i,fontWeight:FL}},range:{category:r,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd7d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}const S2e=wm({type:"light",background:"#ffffff"}),A2e=wm({type:"light",background:"#f4f4f4"}),T2e=wm({type:"dark",background:"#262626"}),M2e=wm({type:"dark",background:"#161616"}),F2e=Kme.version,D2e=Object.freeze(Object.defineProperty({__proto__:null,carbong10:A2e,carbong100:M2e,carbong90:T2e,carbonwhite:S2e,dark:Jme,excel:Qme,fivethirtyeight:n2e,ggplot2:i2e,googlecharts:g2e,latimes:a2e,powerbi:$2e,quartz:l2e,urbaninstitute:p2e,version:F2e,vox:u2e},Symbol.toStringTag,{value:"Module"}));function N2e(e,t,n,i){if(q(e))return`[${e.map(r=>t(te(r)?r:DL(r,n))).join(", ")}]`;if(ie(e)){let r="";const{title:s,image:o,...a}=e;s&&(r+=`

${t(s)}

`),o&&(r+=``);const l=Object.keys(a);if(l.length>0){r+="";for(const u of l){let c=a[u];c!==void 0&&(ie(c)&&(c=DL(c,n)),r+=``)}r+="
${t(u)}${t(c)}
"}return r||"{}"}return t(e)}function O2e(e){const t=[];return function(n,i){if(typeof i!="object"||i===null)return i;const r=t.indexOf(this)+1;return t.length=r,t.length>e?"[Object]":t.indexOf(i)>=0?"[Circular]":(t.push(i),i)}}function DL(e,t){return JSON.stringify(e,O2e(t))}var R2e=`#vg-tooltip-element { + : v !== v && u === u ? ${i} : `}var Hse={operator:(e,t)=>_d(e,["_"],t.code),parameter:(e,t)=>_d(e,["datum","_"],t.code),event:(e,t)=>_d(e,["event"],t.code),handler:(e,t)=>{const n=`var datum=event.item&&event.item.datum;return ${t.code};`;return _d(e,["_","event"],n)},encode:(e,t)=>{const{marktype:n,channels:i}=t;let r="var o=item,datum=o.datum,m=0,$;";for(const s in i){const o="o["+J(s)+"]";r+=`$=${i[s].code};if(${o}!==$)${o}=$,m=1;`}return r+=jse(i,n),r+="return m;",_d(e,["item","_"],r)},codegen:{get(e){const t=`[${e.map(J).join("][")}]`,n=Function("_",`return _${t};`);return n.path=t,n},comparator(e,t){let n;const i=(s,o)=>{const a=t[o];let l,u;return s.path?(l=`a${s.path}`,u=`b${s.path}`):((n=n||{})["f"+o]=s,l=`this.f${o}(a)`,u=`this.f${o}(b)`),Wse(l,u,-a,a)},r=Function("a","b","var u, v; return "+e.map(i).join("")+"0;");return n?r.bind(n):r}}};function Gse(e){const t=this;Use(e.type)||!e.type?t.operator(e,e.update?t.operatorExpression(e.update):null):t.transform(e,e.type)}function Vse(e){const t=this;if(e.params){const n=t.get(e.id);n||U("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}}function Xse(e,t){t=t||{};const n=this;for(const i in e){const r=e[i];t[i]=q(r)?r.map(s=>cM(s,n,t)):cM(r,n,t)}return t}function cM(e,t,n){if(!e||!re(e))return e;for(let i=0,r=fM.length,s;ir&&r.$tupleid?ye:r);return t.fn[n]||(t.fn[n]=c2(i,e.$order,t.expr.codegen))}function eoe(e,t){const n=e.$encode,i={};for(const r in n){const s=n[r];i[r]=Xn(t.encodeExpression(s.$expr),s.$fields),i[r].output=s.$output}return i}function toe(e,t){return t}function noe(e,t){const n=e.$subflow;return function(i,r,s){const o=t.fork().parse(n),a=o.get(n.operators[0].id),l=o.signals.parent;return l&&l.set(s),a.detachSubflow=()=>t.detach(o),a}}function ioe(){return ye}function roe(e){var t=this,n=e.filter!=null?t.eventExpression(e.filter):void 0,i=e.stream!=null?t.get(e.stream):void 0,r;e.source?i=t.events(e.source,e.type,n):e.merge&&(r=e.merge.map(s=>t.get(s)),i=r[0].merge.apply(r[0],r.slice(1))),e.between&&(r=e.between.map(s=>t.get(s)),i=i.between(r[0],r[1])),e.filter&&(i=i.filter(n)),e.throttle!=null&&(i=i.throttle(+e.throttle)),e.debounce!=null&&(i=i.debounce(+e.debounce)),i==null&&U("Invalid stream definition: "+JSON.stringify(e)),e.consume&&i.consume(!0),t.stream(e,i)}function soe(e){var t=this,n=re(n=e.source)?n.$ref:n,i=t.get(n),r=null,s=e.update,o=void 0;i||U("Source not defined: "+e.source),r=e.target&&e.target.$expr?t.eventExpression(e.target.$expr):t.get(e.target),s&&s.$expr&&(s.$params&&(o=t.parseParameters(s.$params)),s=t.handlerExpression(s.$expr)),t.update(e,i,r,s,o)}const ooe={skip:!0};function aoe(e){var t=this,n={};if(e.signals){var i=n.signals={};Object.keys(t.signals).forEach(s=>{const o=t.signals[s];e.signals(s,o)&&(i[s]=o.value)})}if(e.data){var r=n.data={};Object.keys(t.data).forEach(s=>{const o=t.data[s];e.data(s,o)&&(r[s]=o.input.value)})}return t.subcontext&&e.recurse!==!1&&(n.subcontext=t.subcontext.map(s=>s.getState(e))),n}function loe(e){var t=this,n=t.dataflow,i=e.data,r=e.signals;Object.keys(r||{}).forEach(s=>{n.update(t.signals[s],r[s],ooe)}),Object.keys(i||{}).forEach(s=>{n.pulse(t.data[s].input,n.changeset().remove(Mi).insert(i[s]))}),(e.subcontext||[]).forEach((s,o)=>{const a=t.subcontext[o];a&&a.setState(s)})}function dM(e,t,n,i){return new hM(e,t,n,i)}function hM(e,t,n,i){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=i||Hse,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function pM(e){this.dataflow=e.dataflow,this.transforms=e.transforms,this.events=e.events,this.expr=e.expr,this.signals=Object.create(e.signals),this.scales=Object.create(e.scales),this.nodes=Object.create(e.nodes),this.data=Object.create(e.data),this.fn=Object.create(e.fn),e.functions&&(this.functions=Object.create(e.functions),this.functions.context=this)}hM.prototype=pM.prototype={fork(){const e=new pM(this);return(this.subcontext||(this.subcontext=[])).push(e),e},detach(e){this.subcontext=this.subcontext.filter(n=>n!==e);const t=Object.keys(e.nodes);for(const n of t)e.nodes[n]._targets=null;for(const n of t)e.nodes[n].detach();e.nodes=null},get(e){return this.nodes[e]},set(e,t){return this.nodes[e]=t},add(e,t){const n=this,i=n.dataflow,r=e.value;if(n.set(e.id,t),qse(e.type)&&r&&(r.$ingest?i.ingest(t,r.$ingest,r.$format):r.$request?i.preload(t,r.$request,r.$format):i.pulse(t,i.changeset().insert(r))),e.root&&(n.root=t),e.parent){let s=n.get(e.parent.$ref);s?(i.connect(s,[t]),t.targets().add(s)):(n.unresolved=n.unresolved||[]).push(()=>{s=n.get(e.parent.$ref),i.connect(s,[t]),t.targets().add(s)})}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(const s in e.data){const o=n.data[s]||(n.data[s]={});e.data[s].forEach(a=>o[a]=t)}},resolve(){return(this.unresolved||[]).forEach(e=>e()),delete this.unresolved,this},operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform(e,t){this.add(e,this.dataflow.add(this.transforms[s7(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,i,r){this.dataflow.on(t,n,i,r,e.options)},operatorExpression(e){return this.expr.operator(this,e)},parameterExpression(e){return this.expr.parameter(this,e)},eventExpression(e){return this.expr.event(this,e)},handlerExpression(e){return this.expr.handler(this,e)},encodeExpression(e){return this.expr.encode(this,e)},parse:Pse,parseOperator:Gse,parseOperatorParameters:Vse,parseParameters:Xse,parseStream:roe,parseUpdate:soe,getState:aoe,setState:loe};function uoe(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),gM(t,e.description()))}function gM(e,t){e&&(t==null?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}function coe(e){e.add(null,t=>(e._background=t.bg,e._resize=1,t.bg),{bg:e._signals.background})}const o7="default";function foe(e){const t=e._signals.cursor||(e._signals.cursor=e.add({user:o7,item:null}));e.on(e.events("view","mousemove"),t,(n,i)=>{const r=t.value,s=r?te(r)?r:r.user:o7,o=i.item&&i.item.cursor||null;return r&&s===r.user&&o==r.item?r:{user:s,item:o}}),e.add(null,function(n){let i=n.cursor,r=this.value;return te(i)||(r=i.item,i=i.user),a7(e,i&&i!==o7?i:r||i),r},{cursor:t})}function a7(e,t){const n=e.globalCursor()?typeof document<"u"&&document.body:e.container();if(n)return t==null?n.style.removeProperty("cursor"):n.style.cursor=t}function z0(e,t){var n=e._runtime.data;return me(n,t)||U("Unrecognized data set: "+t),n[t]}function doe(e,t){return arguments.length<2?z0(this,e).values.value:P0.call(this,e,_a().remove(Mi).insert(t))}function P0(e,t){G8(t)||U("Second argument to changes must be a changeset.");const n=z0(this,e);return n.modified=!0,this.pulse(n.input,t)}function hoe(e,t){return P0.call(this,e,_a().insert(t))}function poe(e,t){return P0.call(this,e,_a().remove(t))}function mM(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function yM(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function B0(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function goe(e){var t=B0(e),n=mM(e),i=yM(e);e._renderer.background(e.background()),e._renderer.resize(n,i,t),e._handler.origin(t),e._resizeListeners.forEach(r=>{try{r(n,i)}catch(s){e.error(s)}})}function moe(e,t,n){var i=e._renderer,r=i&&i.canvas(),s,o,a;return r&&(a=B0(e),o=t.changedTouches?t.changedTouches[0]:t,s=fg(o,r),s[0]-=a[0],s[1]-=a[1]),t.dataflow=e,t.item=n,t.vega=yoe(e,n,s),t}function yoe(e,t,n){const i=t?t.mark.marktype==="group"?t:t.mark.group:null;function r(o){var a=i,l;if(o){for(l=t;l;l=l.mark.group)if(l.mark.name===o){a=l;break}}return a&&a.mark&&a.mark.interactive?a:{}}function s(o){if(!o)return n;te(o)&&(o=r(o));const a=n.slice();for(;o;)a[0]-=o.x||0,a[1]-=o.y||0,o=o.mark&&o.mark.group;return a}return{view:pn(e),item:pn(t||{}),group:r,xy:s,x:o=>s(o)[0],y:o=>s(o)[1]}}const bM="view",boe="timer",voe="window",xoe={trap:!1};function _oe(e){const t=Fe({defaults:{}},e),n=(i,r)=>{r.forEach(s=>{q(i[s])&&(i[s]=Ki(i[s]))})};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector"]),t}function vM(e,t,n,i){e._eventListeners.push({type:n,sources:ee(t),handler:i})}function woe(e,t){var n=e._eventConfig.defaults,i=n.prevent,r=n.allow;return i===!1||r===!0?!1:i===!0||r===!1?!0:i?i[t]:r?!r[t]:e.preventDefault()}function j0(e,t,n){const i=e._eventConfig&&e._eventConfig[t];return i===!1||re(i)&&!i[n]?(e.warn(`Blocked ${t} ${n} event listener.`),!1):!0}function koe(e,t,n){var i=this,r=new ap(n),s=function(u,c){i.runAsync(null,()=>{e===bM&&woe(i,t)&&u.preventDefault(),r.receive(moe(i,u,c))})},o;if(e===boe)j0(i,"timer",t)&&i.timer(s,t);else if(e===bM)j0(i,"view",t)&&i.addEventListener(t,s,xoe);else if(e===voe?j0(i,"window",t)&&typeof window<"u"&&(o=[window]):typeof document<"u"&&j0(i,"selector",t)&&(o=Array.from(document.querySelectorAll(e))),!o)i.warn("Can not resolve event source: "+e);else{for(var a=0,l=o.length;a=0;)t[i].stop();for(i=n.length;--i>=0;)for(s=n[i],r=s.sources.length;--r>=0;)s.sources[r].removeEventListener(s.type,s.handler);return e&&e.call(this,this._handler,null,null,null),this}function _i(e,t,n){const i=document.createElement(e);for(const r in t)i.setAttribute(r,t[r]);return n!=null&&(i.textContent=n),i}const Coe="vega-bind",Soe="vega-bind-name",Aoe="vega-bind-radio";function Toe(e,t,n){if(!t)return;const i=n.param;let r=n.state;return r||(r=n.state={elements:null,active:!1,set:null,update:o=>{o!=e.signal(i.signal)&&e.runAsync(null,()=>{r.source=!0,e.signal(i.signal,o)})}},i.debounce&&(r.update=f2(i.debounce,r.update))),(i.input==null&&i.element?Moe:Doe)(r,t,i,e),r.active||(e.on(e._signals[i.signal],null,()=>{r.source?r.source=!1:r.set(e.signal(i.signal))}),r.active=!0),r}function Moe(e,t,n,i){const r=n.event||"input",s=()=>e.update(t.value);i.signal(n.signal,t.value),t.addEventListener(r,s),vM(i,t,r,s),e.set=o=>{t.value=o,t.dispatchEvent(Foe(r))}}function Foe(e){return typeof Event<"u"?new Event(e):{type:e}}function Doe(e,t,n,i){const r=i.signal(n.signal),s=_i("div",{class:Coe}),o=n.input==="radio"?s:s.appendChild(_i("label"));o.appendChild(_i("span",{class:Soe},n.name||n.signal)),t.appendChild(s);let a=Noe;switch(n.input){case"checkbox":a=Ooe;break;case"select":a=Roe;break;case"radio":a=Loe;break;case"range":a=Ioe;break}a(e,o,n,r)}function Noe(e,t,n,i){const r=_i("input");for(const s in n)s!=="signal"&&s!=="element"&&r.setAttribute(s==="input"?"type":s,n[s]);r.setAttribute("name",n.signal),r.value=i,t.appendChild(r),r.addEventListener("input",()=>e.update(r.value)),e.elements=[r],e.set=s=>r.value=s}function Ooe(e,t,n,i){const r={type:"checkbox",name:n.signal};i&&(r.checked=!0);const s=_i("input",r);t.appendChild(s),s.addEventListener("change",()=>e.update(s.checked)),e.elements=[s],e.set=o=>s.checked=!!o||null}function Roe(e,t,n,i){const r=_i("select",{name:n.signal}),s=n.labels||[];n.options.forEach((o,a)=>{const l={value:o};U0(o,i)&&(l.selected=!0),r.appendChild(_i("option",l,(s[a]||o)+""))}),t.appendChild(r),r.addEventListener("change",()=>{e.update(n.options[r.selectedIndex])}),e.elements=[r],e.set=o=>{for(let a=0,l=n.options.length;a{const l={type:"radio",name:n.signal,value:o};U0(o,i)&&(l.checked=!0);const u=_i("input",l);u.addEventListener("change",()=>e.update(o));const c=_i("label",{},(s[a]||o)+"");return c.prepend(u),r.appendChild(c),u}),e.set=o=>{const a=e.elements,l=a.length;for(let u=0;u{l.textContent=a.value,e.update(+a.value)};a.addEventListener("input",u),a.addEventListener("change",u),e.elements=[a],e.set=c=>{a.value=c,l.textContent=c}}function U0(e,t){return e===t||e+""==t+""}function kM(e,t,n,i,r,s){return t=t||new i(e.loader()),t.initialize(n,mM(e),yM(e),B0(e),r,s).background(e.background())}function l7(e,t){return t?function(){try{t.apply(this,arguments)}catch(n){e.error(n)}}:null}function zoe(e,t,n,i){const r=new i(e.loader(),l7(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,B0(e),e);return t&&t.handlers().forEach(s=>{r.on(s.type,s.handler)}),r}function Poe(e,t){const n=this,i=n._renderType,r=n._eventConfig.bind,s=kg(i);e=n._el=e?u7(n,e,!0):null,uoe(n),s||n.error("Unrecognized renderer type: "+i);const o=s.handler||To,a=e?s.renderer:s.headless;return n._renderer=a?kM(n,n._renderer,e,a):null,n._handler=zoe(n,n._handler,e,o),n._redraw=!0,e&&r!=="none"&&(t=t?n._elBind=u7(n,t,!0):e.appendChild(_i("form",{class:"vega-bindings"})),n._bind.forEach(l=>{l.param.element&&r!=="container"&&(l.element=u7(n,l.param.element,!!l.param.input))}),n._bind.forEach(l=>{Toe(n,l.element||t,l)})),n}function u7(e,t,n){if(typeof t=="string")if(typeof document<"u"){if(t=document.querySelector(t),!t)return e.error("Signal bind element not found: "+t),null}else return e.error("DOM document instance not found."),null;if(t&&n)try{t.textContent=""}catch(i){t=null,e.error(i)}return t}const wd=e=>+e||0,Boe=e=>({top:e,bottom:e,left:e,right:e});function $M(e){return re(e)?{top:wd(e.top),bottom:wd(e.bottom),left:wd(e.left),right:wd(e.right)}:Boe(wd(e))}async function c7(e,t,n,i){const r=kg(t),s=r&&r.headless;return s||U("Unrecognized renderer type: "+t),await e.runAsync(),kM(e,null,null,s,n,i).renderAsync(e._scenegraph.root)}async function joe(e,t){e!==Fo.Canvas&&e!==Fo.SVG&&e!==Fo.PNG&&U("Unrecognized image type: "+e);const n=await c7(this,e,t);return e===Fo.SVG?Uoe(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")}function Uoe(e,t){const n=new Blob([e],{type:t});return window.URL.createObjectURL(n)}async function qoe(e,t){return(await c7(this,Fo.Canvas,e,t)).canvas()}async function Woe(e){return(await c7(this,Fo.SVG,e)).svg()}function Hoe(e,t,n){return dM(e,au,xd,n).parse(t)}function Goe(e){var t=this._runtime.scales;return me(t,e)||U("Unrecognized scale or projection: "+e),t[e].value}var EM="width",CM="height",f7="padding",SM={skip:!0};function AM(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===f7?i.left+i.right:0)}function TM(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===f7?i.top+i.bottom:0)}function Voe(e){var t=e._signals,n=t[EM],i=t[CM],r=t[f7];function s(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,a=>{e._width=a.size,e._viewWidth=AM(e,a.size),s()},{size:n}),e._resizeHeight=e.add(null,a=>{e._height=a.size,e._viewHeight=TM(e,a.size),s()},{size:i});const o=e.add(null,s,{pad:r});e._resizeWidth.rank=n.rank+1,e._resizeHeight.rank=i.rank+1,o.rank=r.rank+1}function Xoe(e,t,n,i,r,s){this.runAfter(o=>{let a=0;o._autosize=0,o.width()!==n&&(a=1,o.signal(EM,n,SM),o._resizeWidth.skip(!0)),o.height()!==i&&(a=1,o.signal(CM,i,SM),o._resizeHeight.skip(!0)),o._viewWidth!==e&&(o._resize=1,o._viewWidth=e),o._viewHeight!==t&&(o._resize=1,o._viewHeight=t),(o._origin[0]!==r[0]||o._origin[1]!==r[1])&&(o._resize=1,o._origin=r),a&&o.run("enter"),s&&o.runAfter(l=>l.resize())},!1,1)}function Yoe(e){return this._runtime.getState(e||{data:Zoe,signals:Koe,recurse:!0})}function Zoe(e,t){return t.modified&&q(t.input.value)&&e.indexOf("_:vega:_")}function Koe(e,t){return!(e==="parent"||t instanceof au.proxy)}function Joe(e){return this.runAsync(null,t=>{t._trigger=!1,t._runtime.setState(e)},t=>{t._trigger=!0}),this}function Qoe(e,t){function n(i){e({timestamp:Date.now(),elapsed:i})}this._timers.push(Mee(n,t))}function eae(e,t,n,i){const r=e.element();r&&r.setAttribute("title",tae(i))}function tae(e){return e==null?"":q(e)?MM(e):re(e)&&!so(e)?nae(e):e+""}function nae(e){return Object.keys(e).map(t=>{const n=e[t];return t+": "+(q(n)?MM(n):FM(n))}).join(` +`)}function MM(e){return"["+e.map(FM).join(", ")+"]"}function FM(e){return q(e)?"[…]":re(e)&&!so(e)?"{…}":e}function DM(e,t){const n=this;if(t=t||{},ou.call(n),t.loader&&n.loader(t.loader),t.logger&&n.logger(t.logger),t.logLevel!=null&&n.logLevel(t.logLevel),t.locale||e.locale){const s=Fe({},e.locale,t.locale);n.locale(O8(s.number,s.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||Fo.Canvas,n._scenegraph=new b3;const i=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||eae,n._redraw=!0,n._handler=new To().scene(i),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=_oe(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const r=Hoe(n,e,t.expr);n._runtime=r,n._signals=r.signals,n._bind=(e.bindings||[]).map(s=>({state:null,param:Fe({},s)})),r.root&&r.root.set(i),i.source=r.data.root.input,n.pulse(r.data.root.input,n.changeset().insert(i.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=AM(n,n._width),n._viewHeight=TM(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,Voe(n),coe(n),foe(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind)}function q0(e,t){return me(e._signals,t)?e._signals[t]:U("Unrecognized signal name: "+J(t))}function NM(e,t){const n=(e._targets||[]).filter(i=>i._update&&i._update.handler===t);return n.length?n[0]:null}function OM(e,t,n,i){let r=NM(n,i);return r||(r=l7(e,()=>i(t,n.value)),r.handler=i,e.on(n,null,r)),e}function RM(e,t,n){const i=NM(t,n);return i&&t._targets.remove(i),e}K(DM,ou,{async evaluate(e,t,n){if(await ou.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,goe(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(i){this.error(i)}return n&&np(this,n),this},dirty(e){this._redraw=!0,this._renderer&&this._renderer.dirty(e)},description(e){if(arguments.length){const t=e!=null?e+"":null;return t!==this._desc&&gM(this._el,this._desc=t),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(e,t,n){const i=q0(this,e);return arguments.length===1?i.value:this.update(i,t,n)},width(e){return arguments.length?this.signal("width",e):this.signal("width")},height(e){return arguments.length?this.signal("height",e):this.signal("height")},padding(e){return arguments.length?this.signal("padding",$M(e)):$M(this.signal("padding"))},autosize(e){return arguments.length?this.signal("autosize",e):this.signal("autosize")},background(e){return arguments.length?this.signal("background",e):this.signal("background")},renderer(e){return arguments.length?(kg(e)||U("Unrecognized renderer type: "+e),e!==this._renderType&&(this._renderType=e,this._resetRenderer()),this):this._renderType},tooltip(e){return arguments.length?(e!==this._tooltip&&(this._tooltip=e,this._resetRenderer()),this):this._tooltip},loader(e){return arguments.length?(e!==this._loader&&(ou.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(q0(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:Xoe,addEventListener(e,t,n){let i=t;return n&&n.trap===!1||(i=l7(this,t),i.raw=t),this._handler.on(e,i),this},removeEventListener(e,t){for(var n=this._handler.handlers(e),i=n.length,r,s;--i>=0;)if(s=n[i].type,r=n[i].handler,e===s&&(t===r||t===r.raw)){this._handler.off(s,r);break}return this},addResizeListener(e){const t=this._resizeListeners;return t.indexOf(e)<0&&t.push(e),this},removeResizeListener(e){var t=this._resizeListeners,n=t.indexOf(e);return n>=0&&t.splice(n,1),this},addSignalListener(e,t){return OM(this,e,q0(this,e),t)},removeSignalListener(e,t){return RM(this,q0(this,e),t)},addDataListener(e,t){return OM(this,e,z0(this,e).values,t)},removeDataListener(e,t){return RM(this,z0(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=a7(this,null);this._globalCursor=!!e,t&&a7(this,t)}return this}else return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:Qoe,events:koe,finalize:Eoe,hover:$oe,data:doe,change:P0,insert:hoe,remove:poe,scale:Goe,initialize:Poe,toImageURL:joe,toCanvas:qoe,toSVG:Woe,getState:Yoe,setState:Joe});const iae="view",W0="[",H0="]",LM="{",IM="}",rae=":",zM=",",sae="@",oae=">",aae=/[[\]{}]/,lae={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let PM,BM;function jo(e,t,n){return PM=t||iae,BM=n||lae,jM(e.trim()).map(d7)}function uae(e){return BM[e]}function kd(e,t,n,i,r){const s=e.length;let o=0,a;for(;t=0?--o:i&&i.indexOf(a)>=0&&++o}return t}function jM(e){const t=[],n=e.length;let i=0,r=0;for(;r' after between selector: "+e;i=i.map(d7);const r=d7(e.slice(1).trim());return r.between?{between:i,stream:r}:(r.between=i,r)}function fae(e){const t={source:PM},n=[];let i=[0,0],r=0,s=0,o=e.length,a=0,l,u;if(e[o-1]===IM){if(a=e.lastIndexOf(LM),a>=0){try{i=dae(e.substring(a+1,o-1))}catch{throw"Invalid throttle specification: "+e}e=e.slice(0,a).trim(),o=e.length}else throw"Unmatched right brace: "+e;a=0}if(!o)throw e;if(e[0]===sae&&(r=++a),l=kd(e,a,rae),l1?(t.type=n[1],r?t.markname=n[0].slice(1):uae(n[0])?t.marktype=n[0]:t.source=n[0]):t.type=n[0],t.type.slice(-1)==="!"&&(t.consume=!0,t.type=t.type.slice(0,-1)),u!=null&&(t.filter=u),i[0]&&(t.throttle=i[0]),i[1]&&(t.debounce=i[1]),t}function dae(e){const t=e.split(zM);if(!e.length||t.length>2)throw e;return t.map(n=>{const i=+n;if(i!==i)throw e;return i})}function hae(e){return re(e)?e:{type:e||"pad"}}const $d=e=>+e||0,pae=e=>({top:e,bottom:e,left:e,right:e});function gae(e){return re(e)?e.signal?e:{top:$d(e.top),bottom:$d(e.bottom),left:$d(e.left),right:$d(e.right)}:pae($d(e))}const Xt=e=>re(e)&&!q(e)?Fe({},e):{value:e};function UM(e,t,n,i){return n!=null?(re(n)&&!q(n)||q(n)&&n.length&&re(n[0])?e.update[t]=n:e[i||"enter"][t]={value:n},1):0}function an(e,t,n){for(const i in t)UM(e,i,t[i]);for(const i in n)UM(e,i,n[i],"update")}function Bu(e,t,n){for(const i in t)n&&me(n,i)||(e[i]=Fe(e[i]||{},t[i]));return e}function ju(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const h7="mark",p7="frame",g7="scope",mae="axis",yae="axis-domain",bae="axis-grid",vae="axis-label",xae="axis-tick",_ae="axis-title",wae="legend",kae="legend-band",$ae="legend-entry",Eae="legend-gradient",qM="legend-label",Cae="legend-symbol",Sae="legend-title",Aae="title",Tae="title-text",Mae="title-subtitle";function Fae(e,t,n,i,r){const s={},o={};let a,l,u,c;l="lineBreak",t==="text"&&r[l]!=null&&!ju(l,e)&&m7(s,l,r[l]),(n=="legend"||String(n).startsWith("axis"))&&(n=null),c=n===p7?r.group:n===h7?Fe({},r.mark,r[t]):null;for(l in c)u=ju(l,e)||(l==="fill"||l==="stroke")&&(ju("fill",e)||ju("stroke",e)),u||m7(s,l,c[l]);ee(i).forEach(f=>{const d=r.style&&r.style[f];for(const h in d)ju(h,e)||m7(s,h,d[h])}),e=Fe({},e);for(l in s)c=s[l],c.signal?(a=a||{})[l]=c:o[l]=c;return e.enter=Fe(o,e.enter),a&&(e.update=Fe(a,e.update)),e}function m7(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const WM=e=>te(e)?J(e):e.signal?`(${e.signal})`:HM(e);function G0(e){if(e.gradient!=null)return Nae(e);let t=e.signal?`(${e.signal})`:e.color?Dae(e.color):e.field!=null?HM(e.field):e.value!==void 0?J(e.value):void 0;return e.scale!=null&&(t=Oae(e,t)),t===void 0&&(t=null),e.exponent!=null&&(t=`pow(${t},${X0(e.exponent)})`),e.mult!=null&&(t+=`*${X0(e.mult)}`),e.offset!=null&&(t+=`+${X0(e.offset)}`),e.round&&(t=`round(${t})`),t}const V0=(e,t,n,i)=>`(${e}(${[t,n,i].map(G0).join(",")})+'')`;function Dae(e){return e.c?V0("hcl",e.h,e.c,e.l):e.h||e.s?V0("hsl",e.h,e.s,e.l):e.l||e.a?V0("lab",e.l,e.a,e.b):e.r||e.g||e.b?V0("rgb",e.r,e.g,e.b):null}function Nae(e){const t=[e.start,e.stop,e.count].map(n=>n==null?null:J(n));for(;t.length&&Ue(t)==null;)t.pop();return t.unshift(WM(e.gradient)),`gradient(${t.join(",")})`}function X0(e){return re(e)?"("+G0(e)+")":e}function HM(e){return GM(re(e)?e:{datum:e})}function GM(e){let t,n,i;if(e.signal)t="datum",i=e.signal;else if(e.group||e.parent){for(n=Math.max(1,e.level||1),t="item";n-- >0;)t+=".mark.group";e.parent?(i=e.parent,t+=".datum"):i=e.group}else e.datum?(t="datum",i=e.datum):U("Invalid field reference: "+J(e));return e.signal||(i=te(i)?Nr(i).map(J).join("]["):GM(i)),t+"["+i+"]"}function Oae(e,t){const n=WM(e.scale);return e.range!=null?t=`lerp(_range(${n}), ${+e.range})`:(t!==void 0&&(t=`_scale(${n}, ${t})`),e.band&&(t=(t?t+"+":"")+`_bandwidth(${n})`+(+e.band==1?"":"*"+X0(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),t==null&&(t="0")),t}function Rae(e){let t="";return e.forEach(n=>{const i=G0(n);t+=n.test?`(${n.test})?${i}:`:i}),Ue(t)===":"&&(t+="null"),t}function VM(e,t,n,i,r,s){const o={};s=s||{},s.encoders={$encode:o},e=Fae(e,t,n,i,r.config);for(const a in e)o[a]=Lae(e[a],t,s,r);return s}function Lae(e,t,n,i){const r={},s={};for(const o in e)e[o]!=null&&(r[o]=zae(Iae(e[o]),i,n,s));return{$expr:{marktype:t,channels:r},$fields:Object.keys(s),$output:Object.keys(e)}}function Iae(e){return q(e)?Rae(e):G0(e)}function zae(e,t,n,i){const r=es(e,t);return r.$fields.forEach(s=>i[s]=1),Fe(n,r.$params),r.$expr}const Pae="outer",Bae=["value","update","init","react","bind"];function XM(e,t){U(e+' for "outer" push: '+J(t))}function YM(e,t){const n=e.name;if(e.push===Pae)t.signals[n]||XM("No prior signal definition",n),Bae.forEach(i=>{e[i]!==void 0&&XM("Invalid property ",i)});else{const i=t.addSignal(n,e.value);e.react===!1&&(i.react=!1),e.bind&&t.addBinding(n,e.bind)}}function y7(e,t,n,i){this.id=-1,this.type=e,this.value=t,this.params=n,i&&(this.parent=i)}function Y0(e,t,n,i){return new y7(e,t,n,i)}function Z0(e,t){return Y0("operator",e,t)}function ve(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function Ed(e,t){return t?{$field:e,$name:t}:{$field:e}}const b7=Ed("key");function ZM(e,t){return{$compare:e,$order:t}}function jae(e,t){const n={$key:e};return t&&(n.$flat=!0),n}const Uae="ascending",qae="descending";function Wae(e){return re(e)?(e.order===qae?"-":"+")+K0(e.op,e.field):""}function K0(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const v7="scope",x7="view";function jt(e){return e&&e.signal}function Hae(e){return e&&e.expr}function J0(e){if(jt(e))return!0;if(re(e)){for(const t in e)if(J0(e[t]))return!0}return!1}function cr(e,t){return e??t}function Za(e){return e&&e.signal||e}const KM="timer";function Cd(e,t){return(e.merge?Vae:e.stream?Xae:e.type?Yae:U("Invalid stream specification: "+J(e)))(e,t)}function Gae(e){return e===v7?x7:e||x7}function Vae(e,t){const n=e.merge.map(r=>Cd(r,t)),i=_7({merge:n},e,t);return t.addStream(i).id}function Xae(e,t){const n=Cd(e.stream,t),i=_7({stream:n},e,t);return t.addStream(i).id}function Yae(e,t){let n;e.type===KM?(n=t.event(KM,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(Gae(e.source),e.type);const i=_7({stream:n},e,t);return Object.keys(i).length===1?n:t.addStream(i).id}function _7(e,t,n){let i=t.between;return i&&(i.length!==2&&U('Stream "between" parameter must have 2 entries: '+J(t)),e.between=[Cd(i[0],n),Cd(i[1],n)]),i=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&i.push(Zae(t.marktype,t.markname,t.markrole)),t.source===v7&&i.push("inScope(event.item)"),i.length&&(e.filter=es("("+i.join(")&&(")+")",n).$expr),(i=t.throttle)!=null&&(e.throttle=+i),(i=t.debounce)!=null&&(e.debounce=+i),t.consume&&(e.consume=!0),e}function Zae(e,t,n){const i="event.item";return i+(e&&e!=="*"?"&&"+i+".mark.marktype==='"+e+"'":"")+(n?"&&"+i+".mark.role==='"+n+"'":"")+(t?"&&"+i+".mark.name==='"+t+"'":"")}const Kae={code:"_.$value",ast:{type:"Identifier",value:"value"}};function Jae(e,t,n){const i=e.encode,r={target:n};let s=e.events,o=e.update,a=[];s||U("Signal update missing events specification."),te(s)&&(s=jo(s,t.isSubscope()?v7:x7)),s=ee(s).filter(l=>l.signal||l.scale?(a.push(l),0):1),a.length>1&&(a=[ele(a)]),s.length&&a.push(s.length>1?{merge:s}:s[0]),i!=null&&(o&&U("Signal encode and update are mutually exclusive."),o="encode(item(),"+J(i)+")"),r.update=te(o)?es(o,t):o.expr!=null?es(o.expr,t):o.value!=null?o.value:o.signal!=null?{$expr:Kae,$params:{$value:t.signalRef(o.signal)}}:U("Invalid signal update specification."),e.force&&(r.options={force:!0}),a.forEach(l=>t.addUpdate(Fe(Qae(l,t),r)))}function Qae(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):Cd(e,t)}}function ele(e){return{signal:"["+e.map(t=>t.scale?'scale("'+t.scale+'")':t.signal)+"]"}}function tle(e,t){const n=t.getSignal(e.name);let i=e.update;e.init&&(i?U("Signals can not include both init and update expressions."):(i=e.init,n.initonly=!0)),i&&(i=es(i,t),n.update=i.$expr,n.params=i.$params),e.on&&e.on.forEach(r=>Jae(r,t,n.id))}const lt=e=>(t,n,i)=>Y0(e,n,t||void 0,i),JM=lt("aggregate"),nle=lt("axisticks"),QM=lt("bound"),fr=lt("collect"),eF=lt("compare"),ile=lt("datajoin"),tF=lt("encode"),rle=lt("expression"),sle=lt("facet"),ole=lt("field"),ale=lt("key"),lle=lt("legendentries"),ule=lt("load"),cle=lt("mark"),fle=lt("multiextent"),dle=lt("multivalues"),hle=lt("overlap"),ple=lt("params"),nF=lt("prefacet"),gle=lt("projection"),mle=lt("proxy"),yle=lt("relay"),iF=lt("render"),ble=lt("scale"),Ka=lt("sieve"),vle=lt("sortitems"),rF=lt("viewlayout"),xle=lt("values");let _le=0;const sF={min:"min",max:"max",count:"sum"};function wle(e,t){const n=e.type||"linear";T$(n)||U("Unrecognized scale type: "+J(n)),t.addScale(e.name,{type:n,domain:void 0})}function kle(e,t){const n=t.getScale(e.name).params;let i;n.domain=oF(e.domain,e,t),e.range!=null&&(n.range=lF(e,t,n)),e.interpolate!=null&&Nle(e.interpolate,n),e.nice!=null&&(n.nice=Dle(e.nice)),e.bins!=null&&(n.bins=Fle(e.bins,t));for(i in e)me(n,i)||i==="name"||(n[i]=Pi(e[i],t))}function Pi(e,t){return re(e)?e.signal?t.signalRef(e.signal):U("Unsupported object: "+J(e)):e}function Q0(e,t){return e.signal?t.signalRef(e.signal):e.map(n=>Pi(n,t))}function e1(e){U("Can not find data set: "+J(e))}function oF(e,t,n){if(!e){(t.domainMin!=null||t.domainMax!=null)&&U("No scale domain defined for domainMin/domainMax to override.");return}return e.signal?n.signalRef(e.signal):(q(e)?$le:e.fields?Cle:Ele)(e,t,n)}function $le(e,t,n){return e.map(i=>Pi(i,n))}function Ele(e,t,n){const i=n.getData(e.data);return i||e1(e.data),yu(t.type)?i.valuesRef(n,e.field,aF(e.sort,!1)):D$(t.type)?i.domainRef(n,e.field):i.extentRef(n,e.field)}function Cle(e,t,n){const i=e.data,r=e.fields.reduce((s,o)=>(o=te(o)?{data:i,field:o}:q(o)||o.signal?Sle(o,n):o,s.push(o),s),[]);return(yu(t.type)?Ale:D$(t.type)?Tle:Mle)(e,n,r)}function Sle(e,t){const n="_:vega:_"+_le++,i=fr({});if(q(e))i.value={$ingest:e};else if(e.signal){const r="setdata("+J(n)+","+e.signal+")";i.params.input=t.signalRef(r)}return t.addDataPipeline(n,[i,Ka({})]),{data:n,field:"data"}}function Ale(e,t,n){const i=aF(e.sort,!0);let r,s;const o=n.map(u=>{const c=t.getData(u.data);return c||e1(u.data),c.countsRef(t,u.field,i)}),a={groupby:b7,pulse:o};i&&(r=i.op||"count",s=i.field?K0(r,i.field):"count",a.ops=[sF[r]],a.fields=[t.fieldRef(s)],a.as=[s]),r=t.add(JM(a));const l=t.add(fr({pulse:ve(r)}));return s=t.add(xle({field:b7,sort:t.sortRef(i),pulse:ve(l)})),ve(s)}function aF(e,t){return e&&(!e.field&&!e.op?re(e)?e.field="key":e={field:"key"}:!e.field&&e.op!=="count"?U("No field provided for sort aggregate op: "+e.op):t&&e.field&&e.op&&!sF[e.op]&&U("Multiple domain scales can not be sorted using "+e.op)),e}function Tle(e,t,n){const i=n.map(r=>{const s=t.getData(r.data);return s||e1(r.data),s.domainRef(t,r.field)});return ve(t.add(dle({values:i})))}function Mle(e,t,n){const i=n.map(r=>{const s=t.getData(r.data);return s||e1(r.data),s.extentRef(t,r.field)});return ve(t.add(fle({extents:i})))}function Fle(e,t){return e.signal||q(e)?Q0(e,t):t.objectProperty(e)}function Dle(e){return re(e)?{interval:Pi(e.interval),step:Pi(e.step)}:Pi(e)}function Nle(e,t){t.interpolate=Pi(e.type||e),e.gamma!=null&&(t.interpolateGamma=Pi(e.gamma))}function lF(e,t,n){const i=t.config.range;let r=e.range;if(r.signal)return t.signalRef(r.signal);if(te(r)){if(i&&me(i,r))return e=Fe({},e,{range:i[r]}),lF(e,t,n);r==="width"?r=[0,{signal:"width"}]:r==="height"?r=yu(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:U("Unrecognized scale range value: "+J(r))}else if(r.scheme){n.scheme=q(r.scheme)?Q0(r.scheme,t):Pi(r.scheme,t),r.extent&&(n.schemeExtent=Q0(r.extent,t)),r.count&&(n.schemeCount=Pi(r.count,t));return}else if(r.step){n.rangeStep=Pi(r.step,t);return}else{if(yu(e.type)&&!q(r))return oF(r,e,t);q(r)||U("Unsupported range type: "+J(r))}return r.map(s=>(q(s)?Q0:Pi)(s,t))}function Ole(e,t){const n=t.config.projection||{},i={};for(const r in e)r!=="name"&&(i[r]=w7(e[r],r,t));for(const r in n)i[r]==null&&(i[r]=w7(n[r],r,t));t.addProjection(e.name,i)}function w7(e,t,n){return q(e)?e.map(i=>w7(i,t,n)):re(e)?e.signal?n.signalRef(e.signal):t==="fit"?e:U("Unsupported parameter object: "+J(e)):e}const dr="top",Uu="left",qu="right",Uo="bottom",uF="center",Rle="vertical",Lle="start",Ile="middle",zle="end",k7="index",$7="label",Ple="offset",Wu="perc",Ble="perc2",Bi="value",Sd="guide-label",E7="guide-title",jle="group-title",Ule="group-subtitle",cF="symbol",t1="gradient",C7="discrete",S7="size",A7=[S7,"shape","fill","stroke","strokeWidth","strokeDash","opacity"],Ad={name:1,style:1,interactive:1},Ve={value:0},ji={value:1},n1="group",fF="rect",T7="rule",qle="symbol",Ja="text";function Td(e){return e.type=n1,e.interactive=e.interactive||!1,e}function ii(e,t){const n=(i,r)=>cr(e[i],cr(t[i],r));return n.isVertical=i=>Rle===cr(e.direction,t.direction||(i?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>cr(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>cr(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>cr(e.columns,cr(t.columns,+n.isVertical(!0))),n}function dF(e,t){const n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}function Wle(e,t,n){const i=t.config.style[n];return i&&i[e]}function i1(e,t,n){return`item.anchor === '${Lle}' ? ${e} : item.anchor === '${zle}' ? ${t} : ${n}`}const M7=i1(J(Uu),J(qu),J(uF));function Hle(e){const t=e("tickBand");let n=e("tickOffset"),i,r;return t?t.signal?(i={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`},r={signal:`(${t.signal}) === 'extent'`},re(n)||(n={signal:`(${t.signal}) === 'extent' ? 0 : ${n}`})):t==="extent"?(i=1,r=!0,n=0):(i=.5,r=!1):(i=e("bandPosition"),r=e("tickExtra")),{extra:r,band:i,offset:n}}function hF(e,t){return t?e?re(e)?Object.assign({},e,{offset:hF(e.offset,t)}):{value:e,offset:t}:t:e}function wi(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=Bu(e.encode,t,Ad)):e.interactive=!1,e}function Gle(e,t,n,i){const r=ii(e,n),s=r.isVertical(),o=r.gradientThickness(),a=r.gradientLength();let l,u,c,f,d;s?(u=[0,1],c=[0,0],f=o,d=a):(u=[0,0],c=[1,0],f=a,d=o);const h={enter:l={opacity:Ve,x:Ve,y:Ve,width:Xt(f),height:Xt(d)},update:Fe({},l,{opacity:ji,fill:{gradient:t,start:u,stop:c}}),exit:{opacity:Ve}};return an(h,{stroke:r("gradientStrokeColor"),strokeWidth:r("gradientStrokeWidth")},{opacity:r("gradientOpacity")}),wi({type:fF,role:Eae,encode:h},i)}function Vle(e,t,n,i,r){const s=ii(e,n),o=s.isVertical(),a=s.gradientThickness(),l=s.gradientLength();let u,c,f,d,h="";o?(u="y",f="y2",c="x",d="width",h="1-"):(u="x",f="x2",c="y",d="height");const p={opacity:Ve,fill:{scale:t,field:Bi}};p[u]={signal:h+"datum."+Wu,mult:l},p[c]=Ve,p[f]={signal:h+"datum."+Ble,mult:l},p[d]=Xt(a);const g={enter:p,update:Fe({},p,{opacity:ji}),exit:{opacity:Ve}};return an(g,{stroke:s("gradientStrokeColor"),strokeWidth:s("gradientStrokeWidth")},{opacity:s("gradientOpacity")}),wi({type:fF,role:kae,key:Bi,from:r,encode:g},i)}const Xle=`datum.${Wu}<=0?"${Uu}":datum.${Wu}>=1?"${qu}":"${uF}"`,Yle=`datum.${Wu}<=0?"${Uo}":datum.${Wu}>=1?"${dr}":"${Ile}"`;function pF(e,t,n,i){const r=ii(e,t),s=r.isVertical(),o=Xt(r.gradientThickness()),a=r.gradientLength();let l=r("labelOverlap"),u,c,f,d,h="";const p={enter:u={opacity:Ve},update:c={opacity:ji,text:{field:$7}},exit:{opacity:Ve}};return an(p,{fill:r("labelColor"),fillOpacity:r("labelOpacity"),font:r("labelFont"),fontSize:r("labelFontSize"),fontStyle:r("labelFontStyle"),fontWeight:r("labelFontWeight"),limit:cr(e.labelLimit,t.gradientLabelLimit)}),s?(u.align={value:"left"},u.baseline=c.baseline={signal:Yle},f="y",d="x",h="1-"):(u.align=c.align={signal:Xle},u.baseline={value:"top"},f="x",d="y"),u[f]=c[f]={signal:h+"datum."+Wu,mult:a},u[d]=c[d]=o,o.offset=cr(e.labelOffset,t.gradientLabelOffset)||0,l=l?{separation:r("labelSeparation"),method:l,order:"datum."+k7}:void 0,wi({type:Ja,role:qM,style:Sd,key:Bi,from:i,encode:p,overlap:l},n)}function Zle(e,t,n,i,r){const s=ii(e,t),o=n.entries,a=!!(o&&o.interactive),l=o?o.name:void 0,u=s("clipHeight"),c=s("symbolOffset"),f={data:"value"},d=`(${r}) ? datum.${Ple} : datum.${S7}`,h=u?Xt(u):{field:S7},p=`datum.${k7}`,g=`max(1, ${r})`;let m,y,b,v,x;h.mult=.5,m={enter:y={opacity:Ve,x:{signal:d,mult:.5,offset:c},y:h},update:b={opacity:ji,x:y.x,y:y.y},exit:{opacity:Ve}};let _=null,k=null;e.fill||(_=t.symbolBaseFillColor,k=t.symbolBaseStrokeColor),an(m,{fill:s("symbolFillColor",_),shape:s("symbolType"),size:s("symbolSize"),stroke:s("symbolStrokeColor",k),strokeDash:s("symbolDash"),strokeDashOffset:s("symbolDashOffset"),strokeWidth:s("symbolStrokeWidth")},{opacity:s("symbolOpacity")}),A7.forEach(E=>{e[E]&&(b[E]=y[E]={scale:e[E],field:Bi})});const w=wi({type:qle,role:Cae,key:Bi,from:f,clip:u?!0:void 0,encode:m},n.symbols),$=Xt(c);$.offset=s("labelOffset"),m={enter:y={opacity:Ve,x:{signal:d,offset:$},y:h},update:b={opacity:ji,text:{field:$7},x:y.x,y:y.y},exit:{opacity:Ve}},an(m,{align:s("labelAlign"),baseline:s("labelBaseline"),fill:s("labelColor"),fillOpacity:s("labelOpacity"),font:s("labelFont"),fontSize:s("labelFontSize"),fontStyle:s("labelFontStyle"),fontWeight:s("labelFontWeight"),limit:s("labelLimit")});const S=wi({type:Ja,role:qM,style:Sd,key:Bi,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!u},width:Ve,height:u?Xt(u):Ve,opacity:Ve},exit:{opacity:Ve},update:b={opacity:ji,row:{signal:null},column:{signal:null}}},s.isVertical(!0)?(v=`ceil(item.mark.items.length / ${g})`,b.row.signal=`${p}%${v}`,b.column.signal=`floor(${p} / ${v})`,x={field:["row",p]}):(b.row.signal=`floor(${p} / ${g})`,b.column.signal=`${p} % ${g}`,x={field:p}),b.column.signal=`(${r})?${b.column.signal}:${p}`,i={facet:{data:i,name:"value",groupby:k7}},Td({role:g7,from:i,encode:Bu(m,o,Ad),marks:[w,S],name:l,interactive:a,sort:x})}function Kle(e,t){const n=ii(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}const F7='item.orient === "left"',D7='item.orient === "right"',r1=`(${F7} || ${D7})`,Jle=`datum.vgrad && ${r1}`,Qle=i1('"top"','"bottom"','"middle"'),eue=i1('"right"','"left"','"center"'),tue=`datum.vgrad && ${D7} ? (${eue}) : (${r1} && !(datum.vgrad && ${F7})) ? "left" : ${M7}`,nue=`item._anchor || (${r1} ? "middle" : "start")`,iue=`${Jle} ? (${F7} ? -90 : 90) : 0`,rue=`${r1} ? (datum.vgrad ? (${D7} ? "bottom" : "top") : ${Qle}) : "top"`;function sue(e,t,n,i){const r=ii(e,t),s={enter:{opacity:Ve},update:{opacity:ji,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:Ve}};return an(s,{orient:r("titleOrient"),_anchor:r("titleAnchor"),anchor:{signal:nue},angle:{signal:iue},align:{signal:tue},baseline:{signal:rue},text:e.title,fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),baseline:r("titleBaseline")}),wi({type:Ja,role:Sae,style:E7,from:i,encode:s},n)}function oue(e,t){let n;return re(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+gF(e.path)+")":e.sphere&&(n="geoShape("+gF(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function gF(e){return re(e)&&e.signal?e.signal:J(e)}function mF(e){const t=e.role||"";return!t.indexOf("axis")||!t.indexOf("legend")||!t.indexOf("title")?t:e.type===n1?g7:t||h7}function aue(e){return{marktype:e.type,name:e.name||void 0,role:e.role||mF(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function lue(e,t){return e&&e.signal?t.signalRef(e.signal):e!==!1}function N7(e,t){const n=tk(e.type);n||U("Unrecognized transform type: "+J(e.type));const i=Y0(n.type.toLowerCase(),null,yF(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(i)),i.metadata=n.metadata||{},i}function yF(e,t,n){const i={},r=e.params.length;for(let s=0;sbF(e,s,n)):bF(e,r,n)}function bF(e,t,n){const i=e.type;if(jt(t))return xF(i)?U("Expression references can not be signals."):O7(i)?n.fieldRef(t):_F(i)?n.compareRef(t):n.signalRef(t.signal);{const r=e.expr||O7(i);return r&&due(t)?n.exprRef(t.expr,t.as):r&&hue(t)?Ed(t.field,t.as):xF(i)?es(t,n):pue(i)?ve(n.getData(t).values):O7(i)?Ed(t):_F(i)?n.compareRef(t):t}}function cue(e,t,n){return te(t.from)||U('Lookup "from" parameter must be a string literal.'),n.getData(t.from).lookupRef(n,t.key)}function fue(e,t,n){const i=t[e.name];return e.array?(q(i)||U("Expected an array of sub-parameters. Instead: "+J(i)),i.map(r=>vF(e,r,n))):vF(e,i,n)}function vF(e,t,n){const i=e.params.length;let r;for(let o=0;oe&&e.expr,hue=e=>e&&e.field,pue=e=>e==="data",xF=e=>e==="expr",O7=e=>e==="field",_F=e=>e==="compare";function gue(e,t,n){let i,r,s,o,a;return e?(i=e.facet)&&(t||U("Only group marks can be faceted."),i.field!=null?o=a=s1(i,n):(e.data?a=ve(n.getData(e.data).aggregate):(s=N7(Fe({type:"aggregate",groupby:ee(i.groupby)},i.aggregate),n),s.params.key=n.keyRef(i.groupby),s.params.pulse=s1(i,n),o=a=ve(n.add(s))),r=n.keyRef(i.groupby,!0))):o=ve(n.add(fr(null,[{}]))),o||(o=s1(e,n)),{key:r,pulse:o,parent:a}}function s1(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:ve(t.getData(e.data).output)}function Qa(e,t,n,i,r){this.scope=e,this.input=t,this.output=n,this.values=i,this.aggregate=r,this.index={}}Qa.fromEntries=function(e,t){const n=t.length,i=t[n-1],r=t[n-2];let s=t[0],o=null,a=1;for(s&&s.type==="load"&&(s=t[1]),e.add(t[0]);af??"null").join(",")+"),0)",c=es(u,t);l.update=c.$expr,l.params=c.$params}function o1(e,t){const n=mF(e),i=e.type===n1,r=e.from&&e.from.facet,s=e.overlap;let o=e.layout||n===g7||n===p7,a,l,u,c,f,d,h;const p=n===h7||o||r,g=gue(e.from,i,t);l=t.add(ile({key:g.key||(e.key?Ed(e.key):void 0),pulse:g.pulse,clean:!i}));const m=ve(l);l=u=t.add(fr({pulse:m})),l=t.add(cle({markdef:aue(e),interactive:lue(e.interactive,t),clip:oue(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:ve(l)}));const y=ve(l);l=c=t.add(tF(VM(e.encode,e.type,n,e.style,t,{mod:!1,pulse:y}))),l.params.parent=t.encode(),e.transform&&e.transform.forEach(k=>{const w=N7(k,t),$=w.metadata;($.generates||$.changes)&&U("Mark transforms should not generate new data."),$.nomod||(c.params.mod=!0),w.params.pulse=ve(l),t.add(l=w)}),e.sort&&(l=t.add(vle({sort:t.compareRef(e.sort),pulse:ve(l)})));const b=ve(l);(r||o)&&(o=t.add(rF({layout:t.objectProperty(e.layout),legends:t.legends,mark:y,pulse:b})),d=ve(o));const v=t.add(QM({mark:y,pulse:d||b}));h=ve(v),i&&(p&&(a=t.operators,a.pop(),o&&a.pop()),t.pushState(b,d||h,m),r?mue(e,t,g):p?yue(e,t,g):t.parse(e),t.popState(),p&&(o&&a.push(o),a.push(v))),s&&(h=bue(s,h,t));const x=t.add(iF({pulse:h})),_=t.add(Ka({pulse:ve(x)},void 0,t.parent()));e.name!=null&&(f=e.name,t.addData(f,new Qa(t,u,x,_)),e.on&&e.on.forEach(k=>{(k.insert||k.remove||k.toggle)&&U("Marks only support modify triggers."),$F(k,t,f)}))}function bue(e,t,n){const i=e.method,r=e.bound,s=e.separation,o={separation:jt(s)?n.signalRef(s.signal):s,method:jt(i)?n.signalRef(i.signal):i,pulse:t};if(e.order&&(o.sort=n.compareRef({field:e.order})),r){const a=r.tolerance;o.boundTolerance=jt(a)?n.signalRef(a.signal):+a,o.boundScale=n.scaleRef(r.scale),o.boundOrient=r.orient}return ve(n.add(hle(o)))}function vue(e,t){const n=t.config.legend,i=e.encode||{},r=ii(e,n),s=i.legend||{},o=s.name||void 0,a=s.interactive,l=s.style,u={};let c=0,f,d,h;A7.forEach(v=>e[v]?(u[v]=e[v],c=c||e[v]):0),c||U("Missing valid scale for legend.");const p=xue(e,t.scaleType(c)),g={title:e.title!=null,scales:u,type:p,vgrad:p!=="symbol"&&r.isVertical()},m=ve(t.add(fr(null,[g]))),y={enter:{x:{value:0},y:{value:0}}},b=ve(t.add(lle(d={type:p,scale:t.scaleRef(c),count:t.objectProperty(r("tickCount")),limit:t.property(r("symbolLimit")),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));return p===t1?(h=[Gle(e,c,n,i.gradient),pF(e,n,i.labels,b)],d.count=d.count||t.signalRef(`max(2,2*floor((${Za(r.gradientLength())})/100))`)):p===C7?h=[Vle(e,c,n,i.gradient,b),pF(e,n,i.labels,b)]:(f=Kle(e,n),h=[Zle(e,n,i,b,Za(f.columns))],d.size=kue(e,t,h[0].marks)),h=[Td({role:$ae,from:m,encode:y,marks:h,layout:f,interactive:a})],g.title&&h.push(sue(e,n,i.title,m)),o1(Td({role:wae,from:m,encode:Bu(wue(r,e,n),s,Ad),marks:h,aria:r("aria"),description:r("description"),zindex:r("zindex"),name:o,interactive:a,style:l}),t)}function xue(e,t){let n=e.type||cF;return!e.type&&_ue(e)===1&&(e.fill||e.stroke)&&(n=Rb(t)?t1:Lb(t)?C7:cF),n!==t1?n:Lb(t)?C7:t1}function _ue(e){return A7.reduce((t,n)=>t+(e[n]?1:0),0)}function wue(e,t,n){const i={enter:{},update:{}};return an(i,{orient:e("orient"),offset:e("offset"),padding:e("padding"),titlePadding:e("titlePadding"),cornerRadius:e("cornerRadius"),fill:e("fillColor"),stroke:e("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:e("legendX"),y:e("legendY"),format:t.format,formatType:t.formatType}),i}function kue(e,t,n){const i=Za(EF("size",e,n)),r=Za(EF("strokeWidth",e,n)),s=Za($ue(n[1].encode,t,Sd));return es(`max(ceil(sqrt(${i})+${r}),${s})`,t)}function EF(e,t,n){return t[e]?`scale("${t[e]}",datum)`:dF(e,n[0].encode)}function $ue(e,t,n){return dF("fontSize",e)||Wle("fontSize",t,n)}const Eue=`item.orient==="${Uu}"?-90:item.orient==="${qu}"?90:0`;function Cue(e,t){e=te(e)?{text:e}:e;const n=ii(e,t.config.title),i=e.encode||{},r=i.group||{},s=r.name||void 0,o=r.interactive,a=r.style,l=[],u={},c=ve(t.add(fr(null,[u])));return l.push(Tue(e,n,Sue(e),c)),e.subtitle&&l.push(Mue(e,n,i.subtitle,c)),o1(Td({role:Aae,from:c,encode:Aue(n,r),marks:l,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:s,interactive:o,style:a}),t)}function Sue(e){const t=e.encode;return t&&t.title||Fe({name:e.name,interactive:e.interactive,style:e.style},t)}function Aue(e,t){const n={enter:{},update:{}};return an(n,{orient:e("orient"),anchor:e("anchor"),align:{signal:M7},angle:{signal:Eue},limit:e("limit"),frame:e("frame"),offset:e("offset")||0,padding:e("subtitlePadding")}),Bu(n,t,Ad)}function Tue(e,t,n,i){const r={value:0},s=e.text,o={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return an(o,{text:s,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("color"),font:t("font"),fontSize:t("fontSize"),fontStyle:t("fontStyle"),fontWeight:t("fontWeight"),lineHeight:t("lineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),wi({type:Ja,role:Tae,style:jle,from:i,encode:o},n)}function Mue(e,t,n,i){const r={value:0},s=e.subtitle,o={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return an(o,{text:s,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("subtitleColor"),font:t("subtitleFont"),fontSize:t("subtitleFontSize"),fontStyle:t("subtitleFontStyle"),fontWeight:t("subtitleFontWeight"),lineHeight:t("subtitleLineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),wi({type:Ja,role:Mae,style:Ule,from:i,encode:o},n)}function Fue(e,t){const n=[];e.transform&&e.transform.forEach(i=>{n.push(N7(i,t))}),e.on&&e.on.forEach(i=>{$F(i,t,e.name)}),t.addDataPipeline(e.name,Due(e,t,n))}function Due(e,t,n){const i=[];let r=null,s=!1,o=!1,a,l,u,c,f;for(e.values?jt(e.values)||J0(e.format)?(i.push(CF(t,e)),i.push(r=el())):i.push(r=el({$ingest:e.values,$format:e.format})):e.url?J0(e.url)||J0(e.format)?(i.push(CF(t,e)),i.push(r=el())):i.push(r=el({$request:e.url,$format:e.format})):e.source&&(r=a=ee(e.source).map(d=>ve(t.getData(d).output)),i.push(null)),l=0,u=n.length;le===Uo||e===dr,a1=(e,t,n)=>jt(e)?Lue(e.signal,t,n):e===Uu||e===dr?t:n,Yt=(e,t,n)=>jt(e)?Oue(e.signal,t,n):SF(e)?t:n,hr=(e,t,n)=>jt(e)?Rue(e.signal,t,n):SF(e)?n:t,AF=(e,t,n)=>jt(e)?Iue(e.signal,t,n):e===dr?{value:t}:{value:n},Nue=(e,t,n)=>jt(e)?zue(e.signal,t,n):e===qu?{value:t}:{value:n},Oue=(e,t,n)=>TF(`${e} === '${dr}' || ${e} === '${Uo}'`,t,n),Rue=(e,t,n)=>TF(`${e} !== '${dr}' && ${e} !== '${Uo}'`,t,n),Lue=(e,t,n)=>R7(`${e} === '${Uu}' || ${e} === '${dr}'`,t,n),Iue=(e,t,n)=>R7(`${e} === '${dr}'`,t,n),zue=(e,t,n)=>R7(`${e} === '${qu}'`,t,n),TF=(e,t,n)=>(t=t!=null?Xt(t):t,n=n!=null?Xt(n):n,MF(t)&&MF(n)?(t=t?t.signal||J(t.value):null,n=n?n.signal||J(n.value):null,{signal:`${e} ? (${t}) : (${n})`}):[Fe({test:e},t)].concat(n||[])),MF=e=>e==null||Object.keys(e).length===1,R7=(e,t,n)=>({signal:`${e} ? (${Hu(t)}) : (${Hu(n)})`}),Pue=(e,t,n,i,r)=>({signal:(i!=null?`${e} === '${Uu}' ? (${Hu(i)}) : `:"")+(n!=null?`${e} === '${Uo}' ? (${Hu(n)}) : `:"")+(r!=null?`${e} === '${qu}' ? (${Hu(r)}) : `:"")+(t!=null?`${e} === '${dr}' ? (${Hu(t)}) : `:"")+"(null)"}),Hu=e=>jt(e)?e.signal:e==null?null:J(e),Bue=(e,t)=>t===0?0:jt(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},Gu=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function Vu(e,t,n,i){let r;if(t&&me(t,e))return t[e];if(me(n,e))return n[e];if(e.startsWith("title")){switch(e){case"titleColor":r="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":r=e[5].toLowerCase()+e.slice(6)}return i[E7][r]}else if(e.startsWith("label")){switch(e){case"labelColor":r="fill";break;case"labelFont":case"labelFontSize":r=e[5].toLowerCase()+e.slice(6)}return i[Sd][r]}return null}function FF(e){const t={};for(const n of e)if(n)for(const i in n)t[i]=1;return Object.keys(t)}function jue(e,t){var n=t.config,i=n.style,r=n.axis,s=t.scaleType(e.scale)==="band"&&n.axisBand,o=e.orient,a,l,u;if(jt(o)){const f=FF([n.axisX,n.axisY]),d=FF([n.axisTop,n.axisBottom,n.axisLeft,n.axisRight]);a={};for(u of f)a[u]=Yt(o,Vu(u,n.axisX,r,i),Vu(u,n.axisY,r,i));l={};for(u of d)l[u]=Pue(o.signal,Vu(u,n.axisTop,r,i),Vu(u,n.axisBottom,r,i),Vu(u,n.axisLeft,r,i),Vu(u,n.axisRight,r,i))}else a=o===dr||o===Uo?n.axisX:n.axisY,l=n["axis"+o[0].toUpperCase()+o.slice(1)];return a||l||s?Fe({},r,a,l,s):r}function Uue(e,t,n,i){const r=ii(e,t),s=e.orient;let o,a;const l={enter:o={opacity:Ve},update:a={opacity:ji},exit:{opacity:Ve}};an(l,{stroke:r("domainColor"),strokeCap:r("domainCap"),strokeDash:r("domainDash"),strokeDashOffset:r("domainDashOffset"),strokeWidth:r("domainWidth"),strokeOpacity:r("domainOpacity")});const u=DF(e,0),c=DF(e,1);return o.x=a.x=Yt(s,u,Ve),o.x2=a.x2=Yt(s,c),o.y=a.y=hr(s,u,Ve),o.y2=a.y2=hr(s,c),wi({type:T7,role:yae,from:i,encode:l},n)}function DF(e,t){return{scale:e.scale,range:t}}function que(e,t,n,i,r){const s=ii(e,t),o=e.orient,a=e.gridScale,l=a1(o,1,-1),u=Wue(e.offset,l);let c,f,d;const h={enter:c={opacity:Ve},update:d={opacity:ji},exit:f={opacity:Ve}};an(h,{stroke:s("gridColor"),strokeCap:s("gridCap"),strokeDash:s("gridDash"),strokeDashOffset:s("gridDashOffset"),strokeOpacity:s("gridOpacity"),strokeWidth:s("gridWidth")});const p={scale:e.scale,field:Bi,band:r.band,extra:r.extra,offset:r.offset,round:s("tickRound")},g=Yt(o,{signal:"height"},{signal:"width"}),m=a?{scale:a,range:0,mult:l,offset:u}:{value:0,offset:u},y=a?{scale:a,range:1,mult:l,offset:u}:Fe(g,{mult:l,offset:u});return c.x=d.x=Yt(o,p,m),c.y=d.y=hr(o,p,m),c.x2=d.x2=hr(o,y),c.y2=d.y2=Yt(o,y),f.x=Yt(o,p),f.y=hr(o,p),wi({type:T7,role:bae,key:Bi,from:i,encode:h},n)}function Wue(e,t){if(t!==1)if(!re(e))e=jt(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);else{let n=e=Fe({},e);for(;n.mult!=null;)if(re(n.mult))n=n.mult=Fe({},n.mult);else return n.mult=jt(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n.mult=t}return e}function Hue(e,t,n,i,r,s){const o=ii(e,t),a=e.orient,l=a1(a,-1,1);let u,c,f;const d={enter:u={opacity:Ve},update:f={opacity:ji},exit:c={opacity:Ve}};an(d,{stroke:o("tickColor"),strokeCap:o("tickCap"),strokeDash:o("tickDash"),strokeDashOffset:o("tickDashOffset"),strokeOpacity:o("tickOpacity"),strokeWidth:o("tickWidth")});const h=Xt(r);h.mult=l;const p={scale:e.scale,field:Bi,band:s.band,extra:s.extra,offset:s.offset,round:o("tickRound")};return f.y=u.y=Yt(a,Ve,p),f.y2=u.y2=Yt(a,h),c.x=Yt(a,p),f.x=u.x=hr(a,Ve,p),f.x2=u.x2=hr(a,h),c.y=hr(a,p),wi({type:T7,role:xae,key:Bi,from:i,encode:d},n)}function L7(e,t,n,i,r){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+i+","+r+")"}}function Gue(e,t,n,i,r,s){const o=ii(e,t),a=e.orient,l=e.scale,u=a1(a,-1,1),c=Za(o("labelFlush")),f=Za(o("labelFlushOffset")),d=o("labelAlign"),h=o("labelBaseline");let p=c===0||!!c,g;const m=Xt(r);m.mult=u,m.offset=Xt(o("labelPadding")||0),m.offset.mult=u;const y={scale:l,field:Bi,band:.5,offset:hF(s.offset,o("labelOffset"))},b=Yt(a,p?L7(l,c,'"left"','"right"','"center"'):{value:"center"},Nue(a,"left","right")),v=Yt(a,AF(a,"bottom","top"),p?L7(l,c,'"top"','"bottom"','"middle"'):{value:"middle"}),x=L7(l,c,`-(${f})`,f,0);p=p&&f;const _={opacity:Ve,x:Yt(a,y,m),y:hr(a,y,m)},k={enter:_,update:g={opacity:ji,text:{field:$7},x:_.x,y:_.y,align:b,baseline:v},exit:{opacity:Ve,x:_.x,y:_.y}};an(k,{dx:!d&&p?Yt(a,x):null,dy:!h&&p?hr(a,x):null}),an(k,{angle:o("labelAngle"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontWeight:o("labelFontWeight"),fontStyle:o("labelFontStyle"),limit:o("labelLimit"),lineHeight:o("labelLineHeight")},{align:d,baseline:h});const w=o("labelBound");let $=o("labelOverlap");return $=$||w?{separation:o("labelSeparation"),method:$,order:"datum.index",bound:w?{scale:l,orient:a,tolerance:w}:null}:void 0,g.align!==b&&(g.align=Gu(g.align,b)),g.baseline!==v&&(g.baseline=Gu(g.baseline,v)),wi({type:Ja,role:vae,style:Sd,key:Bi,from:i,encode:k,overlap:$},n)}function Vue(e,t,n,i){const r=ii(e,t),s=e.orient,o=a1(s,-1,1);let a,l;const u={enter:a={opacity:Ve,anchor:Xt(r("titleAnchor",null)),align:{signal:M7}},update:l=Fe({},a,{opacity:ji,text:Xt(e.title)}),exit:{opacity:Ve}},c={signal:`lerp(range("${e.scale}"), ${i1(0,1,.5)})`};return l.x=Yt(s,c),l.y=hr(s,c),a.angle=Yt(s,Ve,Bue(o,90)),a.baseline=Yt(s,AF(s,Uo,dr),{value:Uo}),l.angle=a.angle,l.baseline=a.baseline,an(u,{fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),angle:r("titleAngle"),baseline:r("titleBaseline")}),Xue(r,s,u,n),u.update.align=Gu(u.update.align,a.align),u.update.angle=Gu(u.update.angle,a.angle),u.update.baseline=Gu(u.update.baseline,a.baseline),wi({type:Ja,role:_ae,style:E7,from:i,encode:u},n)}function Xue(e,t,n,i){const r=(a,l)=>a!=null?(n.update[l]=Gu(Xt(a),n.update[l]),!1):!ju(l,i),s=r(e("titleX"),"x"),o=r(e("titleY"),"y");n.enter.auto=o===s?Xt(o):Yt(t,Xt(o),Xt(s))}function Yue(e,t){const n=jue(e,t),i=e.encode||{},r=i.axis||{},s=r.name||void 0,o=r.interactive,a=r.style,l=ii(e,n),u=Hle(l),c={scale:e.scale,ticks:!!l("ticks"),labels:!!l("labels"),grid:!!l("grid"),domain:!!l("domain"),title:e.title!=null},f=ve(t.add(fr({},[c]))),d=ve(t.add(nle({scale:t.scaleRef(e.scale),extra:t.property(u.extra),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)}))),h=[];let p;return c.grid&&h.push(que(e,n,i.grid,d,u)),c.ticks&&(p=l("tickSize"),h.push(Hue(e,n,i.ticks,d,p,u))),c.labels&&(p=c.ticks?p:0,h.push(Gue(e,n,i.labels,d,p,u))),c.domain&&h.push(Uue(e,n,i.domain,f)),c.title&&h.push(Vue(e,n,i.title,f)),o1(Td({role:mae,from:f,encode:Bu(Zue(l,e),r,Ad),marks:h,aria:l("aria"),description:l("description"),zindex:l("zindex"),name:s,interactive:o,style:a}),t)}function Zue(e,t){const n={enter:{},update:{}};return an(n,{orient:e("orient"),offset:e("offset")||0,position:cr(t.position,0),titlePadding:e("titlePadding"),minExtent:e("minExtent"),maxExtent:e("maxExtent"),range:{signal:`abs(span(range("${t.scale}")))`},translate:e("translate"),format:t.format,formatType:t.formatType}),n}function NF(e,t,n){const i=ee(e.signals),r=ee(e.scales);return n||i.forEach(s=>YM(s,t)),ee(e.projections).forEach(s=>Ole(s,t)),r.forEach(s=>wle(s,t)),ee(e.data).forEach(s=>Fue(s,t)),r.forEach(s=>kle(s,t)),(n||i).forEach(s=>tle(s,t)),ee(e.axes).forEach(s=>Yue(s,t)),ee(e.marks).forEach(s=>o1(s,t)),ee(e.legends).forEach(s=>vue(s,t)),e.title&&Cue(e.title,t),t.parseLambdas(),t}const Kue=e=>Bu({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function Jue(e,t){const n=t.config,i=ve(t.root=t.add(Z0())),r=Que(e,n);r.forEach(u=>YM(u,t)),t.description=e.description||n.description,t.eventConfig=n.events,t.legends=t.objectProperty(n.legend&&n.legend.layout),t.locale=n.locale;const s=t.add(fr()),o=t.add(tF(VM(Kue(e.encode),n1,p7,e.style,t,{pulse:ve(s)}))),a=t.add(rF({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:i,pulse:ve(o)}));t.operators.pop(),t.pushState(ve(o),ve(a),null),NF(e,t,r),t.operators.push(a);let l=t.add(QM({mark:i,pulse:ve(a)}));return l=t.add(iF({pulse:ve(l)})),l=t.add(Ka({pulse:ve(l)})),t.addData("root",new Qa(t,s,s,l)),t}function Fd(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function Que(e,t){const n=o=>cr(e[o],t[o]),i=[Fd("background",n("background")),Fd("autosize",hae(n("autosize"))),Fd("padding",gae(n("padding"))),Fd("width",n("width")||0),Fd("height",n("height")||0)],r=i.reduce((o,a)=>(o[a.name]=a,o),{}),s={};return ee(e.signals).forEach(o=>{me(r,o.name)?o=Fe(r[o.name],o):i.push(o),s[o.name]=o}),ee(t.signals).forEach(o=>{!me(s,o.name)&&!me(r,o.name)&&i.push(o)}),i}function OF(e,t){this.config=e||{},this.options=t||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function RF(e){this.config=e.config,this.options=e.options,this.legends=e.legends,this.field=Object.create(e.field),this.signals=Object.create(e.signals),this.lambdas=Object.create(e.lambdas),this.scales=Object.create(e.scales),this.events=Object.create(e.events),this.data=Object.create(e.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++e._nextsub[0],this._nextsub=e._nextsub,this._parent=e._parent.slice(),this._encode=e._encode.slice(),this._lookup=e._lookup.slice(),this._markpath=e._markpath}OF.prototype=RF.prototype={parse(e){return NF(e,this)},fork(){return new RF(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(e){return this.operators.push(e),e.id=this.id(),e.refs&&(e.refs.forEach(t=>{t.$ref=e.id}),e.refs=null),e},proxy(e){const t=e instanceof y7?ve(e):e;return this.add(mle({value:t}))},addStream(e){return this.streams.push(e),e.id=this.id(),e},addUpdate(e){return this.updates.push(e),e},finish(){let e,t;this.root&&(this.root.root=!0);for(e in this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function n(i,r,s){let o,a;i&&(o=i.data||(i.data={}),a=o[r]||(o[r]=[]),a.push(s))}for(e in this.data){t=this.data[e],n(t.input,e,"input"),n(t.output,e,"output"),n(t.values,e,"values");for(const i in t.index)n(t.index[i],e,"index:"+i)}return this},pushState(e,t,n){this._encode.push(ve(this.add(Ka({pulse:e})))),this._parent.push(t),this._lookup.push(n?ve(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return Ue(this._parent)},encode(){return Ue(this._encode)},lookup(){return Ue(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(te(e))return Ed(e,t);e.signal||U("Unsupported field reference: "+J(e));const n=e.signal;let i=this.field[n];if(!i){const r={name:this.signalRef(n)};t&&(r.as=t),this.field[n]=i=ve(this.add(ole(r)))}return i},compareRef(e){let t=!1;const n=s=>jt(s)?(t=!0,this.signalRef(s.signal)):Hae(s)?(t=!0,this.exprRef(s.expr)):s,i=ee(e.field).map(n),r=ee(e.order).map(n);return t?ve(this.add(eF({fields:i,orders:r}))):ZM(i,r)},keyRef(e,t){let n=!1;const i=s=>jt(s)?(n=!0,ve(r[s.signal])):s,r=this.signals;return e=ee(e).map(i),n?ve(this.add(ale({fields:e,flat:t}))):jae(e,t)},sortRef(e){if(!e)return e;const t=K0(e.op,e.field),n=e.order||Uae;return n.signal?ve(this.add(eF({fields:t,orders:this.signalRef(n.signal)}))):ZM(t,n)},event(e,t){const n=e+":"+t;if(!this.events[n]){const i=this.id();this.streams.push({id:i,source:e,type:t}),this.events[n]=i}return this.events[n]},hasOwnSignal(e){return me(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&U("Duplicate signal name: "+J(e));const n=t instanceof y7?t:this.add(Z0(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||U("Unrecognized signal name: "+J(e)),this.signals[e]},signalRef(e){return this.signals[e]?ve(this.signals[e]):(me(this.lambdas,e)||(this.lambdas[e]=this.add(Z0(null))),ve(this.lambdas[e]))},parseLambdas(){const e=Object.keys(this.lambdas);for(let t=0,n=e.length;t0?",":"")+(re(r)?r.signal||I7(r):J(r))}return n+"]"}function tce(e){let t="{",n=0,i,r;for(i in e)r=e[i],t+=(++n>1?",":"")+J(i)+":"+(re(r)?r.signal||I7(r):J(r));return t+"}"}function nce(){const e="sans-serif",i="#4c78a8",r="#000",s="#888",o="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:i},area:{fill:i},image:null,line:{stroke:i,strokeWidth:2},path:{stroke:i},rect:{fill:i},rule:{stroke:r},shape:{stroke:i},symbol:{fill:i,size:64},text:{fill:r,font:e,fontSize:11},trail:{fill:i,size:2},style:{"guide-label":{fill:r,font:e,fontSize:10},"guide-title":{fill:r,font:e,fontSize:11,fontWeight:"bold"},"group-title":{fill:r,font:e,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:r,font:e,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:o},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:s,grid:!1,gridWidth:1,gridColor:o,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:s,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:o,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:s,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}function ice(e,t,n){return re(e)||U("Input Vega specification must be an object."),t=Wl(nce(),t,e.config),Jue(e,new OF(t,n)).toRuntime()}var rce="5.26.1";Fe(au,_G,qK,pJ,eee,Xee,_ne,ene,kne,Vne,iie,cie);const sce=Object.freeze(Object.defineProperty({__proto__:null,Bounds:Ot,CanvasHandler:To,CanvasRenderer:Of,DATE:Kn,DAY:mn,DAYOFYEAR:Ir,Dataflow:ou,Debug:H6,Error:r2,EventStream:ap,Gradient:Z$,GroupItem:Zp,HOURS:pi,Handler:Ao,HybridHandler:O3,HybridRenderer:wg,Info:W6,Item:Yp,MILLISECONDS:Ji,MINUTES:gi,MONTH:gn,Marks:yi,MultiPulse:Q2,None:q6,Operator:gt,Parameters:op,Pulse:fo,QUARTER:Zn,RenderType:Fo,Renderer:bi,ResourceLoader:Yb,SECONDS:Di,SVGHandler:E3,SVGRenderer:xg,SVGStringRenderer:N3,Scenegraph:b3,TIME_UNITS:M2,Transform:z,View:DM,WEEK:It,Warn:s2,YEAR:nn,accessor:Xn,accessorFields:fn,accessorName:Et,array:ee,ascending:Lh,bandwidthNRD:iy,bin:rk,bootstrapCI:sk,boundClip:bC,boundContext:$f,boundItem:y3,boundMark:TE,boundStroke:Ss,changeset:_a,clampRange:i4,codegenExpression:UT,compare:c2,constant:pn,cumulativeLogNormal:uy,cumulativeNormal:fp,cumulativeUniform:hy,dayofyear:W4,debounce:f2,defaultLocale:G2,definition:tk,densityLogNormal:ly,densityNormal:ry,densityUniform:dy,domChild:Pt,domClear:Li,domCreate:So,domFind:v3,dotbin:ok,error:U,expressionFunction:Ft,extend:Fe,extent:Or,extentIndex:r4,falsy:io,fastmap:Gl,field:Ti,flush:s4,font:ug,fontFamily:Tf,fontSize:Gr,format:Qh,formatLocale:Kh,formats:Z2,hasOwnProperty:me,id:Oc,identity:dn,inferType:I8,inferTypes:z8,ingest:et,inherits:K,inrange:Vl,interpolate:Ib,interpolateColors:Wp,interpolateRange:N$,intersect:pC,intersectBoxLine:_u,intersectPath:n3,intersectPoint:i3,intersectRule:pE,isArray:q,isBoolean:ro,isDate:so,isFunction:Me,isIterable:o4,isNumber:Xe,isObject:re,isRegExp:a4,isString:te,isTuple:ip,key:d2,lerp:l4,lineHeight:Eo,loader:ep,locale:O8,logger:o2,lruCache:u4,markup:F3,merge:c4,mergeConfig:Wl,multiLineOffset:p3,one:ql,pad:f4,panLinear:K6,panLog:J6,panPow:Q6,panSymlog:e4,parse:ice,parseExpression:Hx,parseSelector:jo,path:bp,pathCurves:qb,pathEqual:vC,pathParse:bu,pathRectangle:iE,pathRender:vf,pathSymbols:nE,pathTrail:rE,peek:Ue,point:fg,projection:Fv,quantileLogNormal:cy,quantileNormal:dp,quantileUniform:py,quantiles:ty,quantizeInterpolator:O$,quarter:t4,quartiles:ny,get random(){return Ni},randomInteger:EH,randomKDE:oy,randomLCG:$H,randomLogNormal:lk,randomMixture:uk,randomNormal:sy,randomUniform:ck,read:U8,regressionConstant:gy,regressionExp:dk,regressionLinear:my,regressionLoess:yk,regressionLog:fk,regressionPoly:pk,regressionPow:hk,regressionQuad:yy,renderModule:kg,repeat:Rc,resetDefaultLocale:_W,resetSVGClipId:oE,resetSVGDefIds:aK,responseType:j8,runtimeContext:dM,sampleCurve:pp,sampleLogNormal:ay,sampleNormal:cp,sampleUniform:fy,scale:Ke,sceneEqual:L3,sceneFromJSON:FE,scenePickVisit:ig,sceneToJSON:ME,sceneVisit:nr,sceneZOrder:r3,scheme:zb,serializeXML:tC,setHybridRendererOptions:iK,setRandom:wH,span:Lc,splitAccessPath:Nr,stringValue:J,textMetrics:mi,timeBin:u8,timeFloor:K4,timeFormatLocale:Qc,timeInterval:nu,timeOffset:e8,timeSequence:i8,timeUnitSpecifier:q4,timeUnits:D2,toBoolean:h2,toDate:p2,toNumber:hn,toSet:Ki,toString:g2,transform:nk,transforms:au,truncate:d4,truthy:Mi,tupleid:ye,typeParsers:V2,utcFloor:J4,utcInterval:iu,utcOffset:t8,utcSequence:r8,utcdayofyear:V4,utcquarter:n4,utcweek:X4,version:rce,visitArray:oo,week:H4,writeConfig:Hl,zero:no,zoomLinear:a2,zoomLog:l2,zoomPow:Rh,zoomSymlog:u2},Symbol.toStringTag,{value:"Module"}));function oce(e,t,n){let i;t.x2&&(t.x?(n&&e.x>e.x2&&(i=e.x,e.x=e.x2,e.x2=i),e.width=e.x2-e.x):e.x=e.x2-(e.width||0)),t.xc&&(e.x=e.xc-(e.width||0)/2),t.y2&&(t.y?(n&&e.y>e.y2&&(i=e.y,e.y=e.y2,e.y2=i),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.height||0)/2)}var ace={NaN:NaN,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,PI:Math.PI,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2,MIN_VALUE:Number.MIN_VALUE,MAX_VALUE:Number.MAX_VALUE},lce={"*":(e,t)=>e*t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,">":(e,t)=>e>t,"<":(e,t)=>ee<=t,">=":(e,t)=>e>=t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,"&":(e,t)=>e&t,"|":(e,t)=>e|t,"^":(e,t)=>e^t,"<<":(e,t)=>e<>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t},uce={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const cce=Array.prototype.slice,tl=(e,t,n)=>{const i=n?n(t[0]):t[0];return i[e].apply(i,cce.call(t,1))},fce=(e,t,n,i,r,s,o)=>new Date(e,t||0,n??1,i||0,r||0,s||0,o||0);var dce={isNaN:Number.isNaN,isFinite:Number.isFinite,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,clamp:(e,t,n)=>Math.max(t,Math.min(n,e)),now:Date.now,utc:Date.UTC,datetime:fce,date:e=>new Date(e).getDate(),day:e=>new Date(e).getDay(),year:e=>new Date(e).getFullYear(),month:e=>new Date(e).getMonth(),hours:e=>new Date(e).getHours(),minutes:e=>new Date(e).getMinutes(),seconds:e=>new Date(e).getSeconds(),milliseconds:e=>new Date(e).getMilliseconds(),time:e=>new Date(e).getTime(),timezoneoffset:e=>new Date(e).getTimezoneOffset(),utcdate:e=>new Date(e).getUTCDate(),utcday:e=>new Date(e).getUTCDay(),utcyear:e=>new Date(e).getUTCFullYear(),utcmonth:e=>new Date(e).getUTCMonth(),utchours:e=>new Date(e).getUTCHours(),utcminutes:e=>new Date(e).getUTCMinutes(),utcseconds:e=>new Date(e).getUTCSeconds(),utcmilliseconds:e=>new Date(e).getUTCMilliseconds(),length:e=>e.length,join:function(){return tl("join",arguments)},indexof:function(){return tl("indexOf",arguments)},lastindexof:function(){return tl("lastIndexOf",arguments)},slice:function(){return tl("slice",arguments)},reverse:e=>e.slice().reverse(),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return tl("substring",arguments,String)},split:function(){return tl("split",arguments,String)},replace:function(){return tl("replace",arguments,String)},trim:e=>String(e).trim(),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const hce=["view","item","group","xy","x","y"],z7=new Set([Function,eval,setTimeout,setInterval]);typeof setImmediate=="function"&&z7.add(setImmediate);const pce={Literal:(e,t)=>t.value,Identifier:(e,t)=>{const n=t.name;return e.memberDepth>0?n:n==="datum"?e.datum:n==="event"?e.event:n==="item"?e.item:ace[n]||e.params["$"+n]},MemberExpression:(e,t)=>{const n=!t.computed,i=e(t.object);n&&(e.memberDepth+=1);const r=e(t.property);if(n&&(e.memberDepth-=1),z7.has(i[r])){console.error(`Prevented interpretation of member "${r}" which could lead to insecure code execution`);return}return i[r]},CallExpression:(e,t)=>{const n=t.arguments;let i=t.callee.name;return i.startsWith("_")&&(i=i.slice(1)),i==="if"?e(n[0])?e(n[1]):e(n[2]):(e.fn[i]||dce[i]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>lce[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>uce[t.operator](e(t.argument)),ConditionalExpression:(e,t)=>e(t.test)?e(t.consequent):e(t.alternate),LogicalExpression:(e,t)=>t.operator==="&&"?e(t.left)&&e(t.right):e(t.left)||e(t.right),ObjectExpression:(e,t)=>t.properties.reduce((n,i)=>{e.memberDepth+=1;const r=e(i.key);return e.memberDepth-=1,z7.has(e(i.value))?console.error(`Prevented interpretation of property "${r}" which could lead to insecure code execution`):n[r]=e(i.value),n},{})};function Dd(e,t,n,i,r,s){const o=a=>pce[a.type](o,a);return o.memberDepth=0,o.fn=Object.create(t),o.params=n,o.datum=i,o.event=r,o.item=s,hce.forEach(a=>o.fn[a]=function(){return r.vega[a](...arguments)}),o(e)}var gce={operator(e,t){const n=t.ast,i=e.functions;return r=>Dd(n,i,r)},parameter(e,t){const n=t.ast,i=e.functions;return(r,s)=>Dd(n,i,s,r)},event(e,t){const n=t.ast,i=e.functions;return r=>Dd(n,i,void 0,void 0,r)},handler(e,t){const n=t.ast,i=e.functions;return(r,s)=>{const o=s.item&&s.item.datum;return Dd(n,i,r,o,s)}},encode(e,t){const{marktype:n,channels:i}=t,r=e.functions,s=n==="group"||n==="image"||n==="rect";return(o,a)=>{const l=o.datum;let u=0,c;for(const f in i)c=Dd(i[f].ast,r,a,l,void 0,o),o[f]!==c&&(o[f]=c,u=1);return n!=="rule"&&oce(o,i,s),u}}};const mce={name:"vega-lite",author:'Dominik Moritz, Kanit "Ham" Wongsuphasawat, Arvind Satyanarayan, Jeffrey Heer',version:"5.16.3",collaborators:["Kanit Wongsuphasawat (http://kanitw.yellowpigz.com)","Dominik Moritz (https://www.domoritz.de)","Arvind Satyanarayan (https://arvindsatya.com)","Jeffrey Heer (https://jheer.org)"],homepage:"https://vega.github.io/vega-lite/",description:"Vega-Lite is a concise high-level language for interactive visualization.",keywords:["vega","chart","visualization"],main:"build/vega-lite.js",unpkg:"build/vega-lite.min.js",jsdelivr:"build/vega-lite.min.js",module:"build/src/index",types:"build/src/index.d.ts",bin:{vl2pdf:"./bin/vl2pdf",vl2png:"./bin/vl2png",vl2svg:"./bin/vl2svg",vl2vg:"./bin/vl2vg"},files:["bin","build","src","vega-lite*","tsconfig.json"],scripts:{changelog:"conventional-changelog -p angular -r 2",prebuild:"yarn clean:build",build:"yarn build:only","build:only":"tsc -p tsconfig.build.json && rollup -c","prebuild:examples":"yarn build:only","build:examples":"yarn data && TZ=America/Los_Angeles scripts/build-examples.sh","prebuild:examples-full":"yarn build:only","build:examples-full":"TZ=America/Los_Angeles scripts/build-examples.sh 1","build:example":"TZ=America/Los_Angeles scripts/build-example.sh","build:toc":"yarn build:jekyll && scripts/generate-toc","build:site":"rollup -c site/rollup.config.mjs","build:jekyll":"pushd site && bundle exec jekyll build -q && popd","build:versions":"scripts/update-version.sh",clean:"yarn clean:build && del-cli 'site/data/*' 'examples/compiled/*.png' && find site/examples ! -name 'index.md' ! -name 'data' -type f -delete","clean:build":"del-cli 'build/*' !build/vega-lite-schema.json",data:"rsync -r node_modules/vega-datasets/data/* site/data",schema:"mkdir -p build && ts-json-schema-generator -f tsconfig.json -p src/index.ts -t TopLevelSpec --no-type-check --no-ref-encode > build/vega-lite-schema.json && yarn renameschema && cp build/vega-lite-schema.json site/_data/",renameschema:"scripts/rename-schema.sh",presite:"yarn data && yarn schema && yarn build:site && yarn build:versions && scripts/create-example-pages.sh",site:"yarn site:only","site:only":"pushd site && bundle exec jekyll serve -I -l && popd",prettierbase:"prettier '**/*.{md,css,yml}'",format:"eslint . --fix && yarn prettierbase --write",lint:"eslint . && yarn prettierbase --check",jest:"NODE_OPTIONS=--experimental-vm-modules npx jest",test:"yarn jest test/ && yarn lint && yarn schema && yarn jest examples/ && yarn test:runtime","test:cover":"yarn jest --collectCoverage test/","test:inspect":"node --inspect-brk --experimental-vm-modules ./node_modules/.bin/jest --runInBand test","test:runtime":"NODE_OPTIONS=--experimental-vm-modules TZ=America/Los_Angeles npx jest test-runtime/ --config test-runtime/jest-config.json","test:runtime:generate":"yarn build:only && del-cli test-runtime/resources && VL_GENERATE_TESTS=true yarn test:runtime",watch:"tsc -p tsconfig.build.json -w","watch:site":"yarn build:site -w","watch:test":"yarn jest --watch test/","watch:test:runtime":"NODE_OPTIONS=--experimental-vm-modules TZ=America/Los_Angeles npx jest --watch test-runtime/ --config test-runtime/jest-config.json",release:"release-it"},repository:{type:"git",url:"https://github.com/vega/vega-lite.git"},license:"BSD-3-Clause",bugs:{url:"https://github.com/vega/vega-lite/issues"},devDependencies:{"@babel/core":"^7.22.10","@babel/plugin-proposal-class-properties":"^7.18.6","@babel/preset-env":"^7.22.10","@babel/preset-typescript":"^7.22.5","@release-it/conventional-changelog":"^7.0.0","@rollup/plugin-alias":"^5.0.0","@rollup/plugin-babel":"^6.0.3","@rollup/plugin-commonjs":"^25.0.4","@rollup/plugin-json":"^6.0.0","@rollup/plugin-node-resolve":"^15.2.1","@rollup/plugin-terser":"^0.4.3","@types/chai":"^4.3.5","@types/d3":"^7.4.0","@types/jest":"^29.5.4","@types/pako":"^2.0.0","@typescript-eslint/eslint-plugin":"^6.4.1","@typescript-eslint/parser":"^6.4.1",ajv:"^8.12.0","ajv-formats":"^2.1.1",chai:"^4.3.7",cheerio:"^1.0.0-rc.12","conventional-changelog-cli":"^4.0.0",d3:"^7.8.5","del-cli":"^5.0.0",eslint:"^8.47.0","eslint-config-prettier":"^9.0.0","eslint-plugin-jest":"^27.2.3","eslint-plugin-prettier":"^5.0.0","fast-json-stable-stringify":"~2.1.0","highlight.js":"^11.8.0",jest:"^29.6.3","jest-dev-server":"^9.0.0",mkdirp:"^3.0.1",pako:"^2.1.0",prettier:"^3.0.2",puppeteer:"^15.0.0","release-it":"^16.1.5",rollup:"^3.28.1","rollup-plugin-bundle-size":"^1.0.3","rollup-plugin-sourcemaps":"^0.6.3",serve:"^14.2.1",terser:"^5.19.2","ts-jest":"^29.1.1","ts-json-schema-generator":"^1.3.0",typescript:"~5.2.2","vega-cli":"^5.25.0","vega-datasets":"^2.7.0","vega-embed":"^6.22.2","vega-tooltip":"^0.33.0","yaml-front-matter":"^4.1.1"},dependencies:{"json-stringify-pretty-compact":"~3.0.0",tslib:"~2.6.2","vega-event-selector":"~3.0.1","vega-expression":"~5.1.0","vega-util":"~1.17.2",yargs:"~17.7.2"},peerDependencies:{vega:"^5.24.0"},engines:{node:">=18"}};function P7(e){return!!e.or}function B7(e){return!!e.and}function j7(e){return!!e.not}function l1(e,t){if(j7(e))l1(e.not,t);else if(B7(e))for(const n of e.and)l1(n,t);else if(P7(e))for(const n of e.or)l1(n,t);else t(e)}function Xu(e,t){return j7(e)?{not:Xu(e.not,t)}:B7(e)?{and:e.and.map(n=>Xu(n,t))}:P7(e)?{or:e.or.map(n=>Xu(n,t))}:t(e)}const Ce=structuredClone;function LF(e){throw new Error(e)}function Yu(e,t){const n={};for(const i of t)me(e,i)&&(n[i]=e[i]);return n}function ri(e,t){const n={...e};for(const i of t)delete n[i];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>ct(e)).join(",")})`};function Pe(e){if(Xe(e))return e;const t=te(e)?e:ct(e);if(t.length<250)return t;let n=0;for(let i=0;ia===0?o:`[${o}]`),s=r.map((o,a)=>r.slice(0,a+1).join(""));for(const o of s)t.add(o)}return t}function G7(e,t){return e===void 0||t===void 0?!0:W7(H7(e),H7(t))}function ut(e){return G(e).length===0}const G=Object.keys,ln=Object.values,qo=Object.entries;function Nd(e){return e===!0||e===!1}function _t(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function Od(e,t){return j7(e)?`!(${Od(e.not,t)})`:B7(e)?`(${e.and.map(n=>Od(n,t)).join(") && (")})`:P7(e)?`(${e.or.map(n=>Od(n,t)).join(") || (")})`:t(e)}function u1(e,t){if(t.length===0)return!0;const n=t.shift();return n in e&&u1(e[n],t)&&delete e[n],ut(e)}function Rd(e){return e.charAt(0).toUpperCase()+e.substr(1)}function V7(e,t="datum"){const n=Nr(e),i=[];for(let r=1;r<=n.length;r++){const s=`[${n.slice(0,r).map(J).join("][")}]`;i.push(`${t}${s}`)}return i.join(" && ")}function PF(e,t="datum"){return`${t}[${J(Nr(e).join("."))}]`}function vce(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function Ui(e){return`${Nr(e).map(vce).join("\\.")}`}function il(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function X7(e){return`${Nr(e).join(".")}`}function Zu(e){return e?Nr(e).length:0}function Dt(...e){for(const t of e)if(t!==void 0)return t}let BF=42;function jF(e){const t=++BF;return e?String(e)+t:t}function xce(){BF=42}function UF(e){return qF(e)?e:`__${e}`}function qF(e){return e.startsWith("__")}function Ld(e){if(e!==void 0)return(e%360+360)%360}function c1(e){return Xe(e)?!0:!isNaN(e)&&!isNaN(parseFloat(e))}const WF=Object.getPrototypeOf(structuredClone({}));function ki(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor.name!==t.constructor.name)return!1;let n,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(!ki(e[i],t[i]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i of e.entries())if(!t.has(i[0]))return!1;for(i of e.entries())if(!ki(i[1],t.get(i[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i of e.entries())if(!t.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(e[i]!==t[i])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf!==WF.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString!==WF.toString)return e.toString()===t.toString();const r=Object.keys(e);if(n=r.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,r[i]))return!1;for(i=n;i--!==0;){const s=r[i];if(!ki(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function ct(e){const t=[];return function n(i){if(i&&i.toJSON&&typeof i.toJSON=="function"&&(i=i.toJSON()),i===void 0)return;if(typeof i=="number")return isFinite(i)?""+i:"null";if(typeof i!="object")return JSON.stringify(i);let r,s;if(Array.isArray(i)){for(s="[",r=0;rb1(e[t])?_t(`_${t}_${qo(e[t])}`):_t(`_${t}_${e[t]}`)).join("")}function mt(e){return e===!0||al(e)&&!e.binned}function un(e){return e==="binned"||al(e)&&e.binned===!0}function al(e){return re(e)}function b1(e){return e==null?void 0:e.param}function sD(e){switch(e){case Is:case zs:case js:case si:case is:case rs:case Vo:case Us:case Ho:case Go:case oi:return 6;case Xo:return 4;default:return 10}}function Bd(e){return!!(e!=null&&e.expr)}function li(e){const t=G(e||{}),n={};for(const i of t)n[i]=$i(e[i]);return n}function oD(e){const{anchor:t,frame:n,offset:i,orient:r,angle:s,limit:o,color:a,subtitleColor:l,subtitleFont:u,subtitleFontSize:c,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:h,subtitlePadding:p,...g}=e,m={...g,...a?{fill:a}:{}},y={...t?{anchor:t}:{},...n?{frame:n}:{},...i?{offset:i}:{},...r?{orient:r}:{},...s!==void 0?{angle:s}:{},...o!==void 0?{limit:o}:{}},b={...l?{subtitleColor:l}:{},...u?{subtitleFont:u}:{},...c?{subtitleFontSize:c}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...h?{subtitleLineHeight:h}:{},...p?{subtitlePadding:p}:{}},v=Yu(e,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:m,subtitleMarkConfig:v,nonMarkTitleProperties:y,subtitle:b}}function Ko(e){return te(e)||q(e)&&te(e[0])}function de(e){return!!(e!=null&&e.signal)}function Jo(e){return!!e.step}function Wce(e){return q(e)?!1:"fields"in e&&!("data"in e)}function Hce(e){return q(e)?!1:"fields"in e&&"data"in e}function Hs(e){return q(e)?!1:"field"in e&&"data"in e}const Gce=G({aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1}),Vce={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},r_=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function aD(e){const t=q(e.condition)?e.condition.map(lD):lD(e.condition);return{...$i(e),condition:t}}function $i(e){if(Bd(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function lD(e){if(Bd(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function vt(e){if(Bd(e)){const{expr:t,...n}=e;return{signal:t,...n}}return de(e)?e:e!==void 0?{value:e}:void 0}function Xce(e){return de(e)?e.signal:J(e)}function uD(e){return de(e)?e.signal:J(e.value)}function vr(e){return de(e)?e.signal:e==null?null:J(e)}function Yce(e,t,n){for(const i of n){const r=Gs(i,t.markDef,t.config);r!==void 0&&(e[i]=vt(r))}return e}function cD(e){return[].concat(e.type,e.style??[])}function it(e,t,n,i={}){const{vgChannel:r,ignoreVgConfig:s}=i;return r&&t[r]!==void 0?t[r]:t[e]!==void 0?t[e]:s&&(!r||r===e)?void 0:Gs(e,t,n,i)}function Gs(e,t,n,{vgChannel:i}={}){return Dt(i?v1(e,t,n.style):void 0,v1(e,t,n.style),i?n[t.type][i]:void 0,n[t.type][e],i?n.mark[i]:n.mark[e])}function v1(e,t,n){return fD(e,cD(t),n)}function fD(e,t,n){t=ee(t);let i;for(const r of t){const s=n[r];s&&s[e]!==void 0&&(i=s[e])}return i}function dD(e,t){return ee(e).reduce((n,i)=>(n.field.push(Q(i,t)),n.order.push(i.sort??"ascending"),n),{field:[],order:[]})}function hD(e,t){const n=[...e];return t.forEach(i=>{for(const r of n)if(ki(r,i))return;n.push(i)}),n}function pD(e,t){return ki(e,t)||!t?e:e?[...ee(e),...ee(t)].join(", "):t}function gD(e,t){const n=e.value,i=t.value;if(n==null||i===null)return{explicit:e.explicit,value:null};if((Ko(n)||de(n))&&(Ko(i)||de(i)))return{explicit:e.explicit,value:pD(n,i)};if(Ko(n)||de(n))return{explicit:e.explicit,value:n};if(Ko(i)||de(i))return{explicit:e.explicit,value:i};if(!Ko(n)&&!de(n)&&!Ko(i)&&!de(i))return{explicit:e.explicit,value:hD(n,i)};throw new Error("It should never reach here")}function s_(e){return`Invalid specification ${ct(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const Zce='Autosize "fit" only works for single views and layered views.';function mD(e){return`${e=="width"?"Width":"Height"} "container" only works for single views and layered views.`}function yD(e){const t=e=="width"?"Width":"Height",n=e=="width"?"x":"y";return`${t} "container" only works well with autosize "fit" or "fit-${n}".`}function bD(e){return e?`Dropping "fit-${e}" because spec has discrete ${ai(e)}.`:'Dropping "fit" because spec has discrete size.'}function o_(e){return`Unknown field for ${e}. Cannot calculate view size.`}function vD(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function Kce(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function Jce(e){return`The "nearest" transform is not supported for ${e} marks.`}function xD(e){return`Selection not supported for ${e} yet.`}function Qce(e){return`Cannot find a selection named "${e}".`}const efe="Scale bindings are currently only supported for scales with unbinned, continuous domains.",tfe="Legend bindings are only supported for selections over an individual field or encoding channel.";function nfe(e){return`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`}function ife(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}const rfe="The same selection must be used to override scale domains in a layered view.",sfe='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function ofe(e){return`Unknown repeated value "${e}".`}function _D(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const afe="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function lfe(e){return`Unrecognized parse "${e}".`}function wD(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}const ufe="Attempt to add the same child twice.";function cfe(e){return`Ignoring an invalid transform: ${ct(e)}.`}const ffe='If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.';function kD(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function dfe(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${ct(t)} is overridden by a child projection ${ct(n)}.`}const hfe="Arc marks uses theta channel rather than angle, replacing angle with theta.";function pfe(e){return`${e}Offset dropped because ${e} is continuous`}function gfe(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${ct(n)}}.`}function $D(e){return`Invalid field type "${e}".`}function mfe(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function yfe(e){return`Invalid aggregation operator "${e}".`}function ED(e,t){const{fill:n,stroke:i}=t;return`Dropping color ${e} as the plot also has ${n&&i?"fill and stroke":n?"fill":"stroke"}.`}function bfe(e){return`Position range does not support relative band size for ${e}.`}function a_(e,t){return`Dropping ${ct(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}const vfe="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function x1(e,t,n){return`${e} dropped as it is incompatible with "${t}"${n?` when ${n}`:""}.`}function xfe(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function _fe(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function wfe(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function kfe(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function l_(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t==="ordinal"?"order":"magnitude"}.`}function $fe(e){return`The ${e} for range marks cannot be an expression`}function Efe(e,t){return`Line mark is for continuous lines and thus cannot be used with ${e&&t?"x2 and y2":e?"x2":"y2"}. We will use the rule mark (line segments) instead.`}function Cfe(e,t){return`Specified orient "${e}" overridden with "${t}".`}function Sfe(e){return`Cannot use the scale property "${e}" with non-color channel.`}function Afe(e){return`Cannot use the relative band size with ${e} scale.`}function Tfe(e){return`Using unaggregated domain with raw field has no effect (${ct(e)}).`}function Mfe(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function Ffe(e){return`Unaggregated domain is currently unsupported for log scale (${ct(e)}).`}function Dfe(e){return`Cannot apply size to non-oriented mark "${e}".`}function Nfe(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function Ofe(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function CD(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function SD(e){return`The step for "${e}" is dropped because the ${e==="width"?"x":"y"} is continuous.`}function Rfe(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${ct(n)} and ${ct(i)}). Using ${ct(n)}.`}function Lfe(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${ct(n)} and ${ct(i)}). Using the union of the two domains.`}function Ife(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}function zfe(e){return`Dropping sort property ${ct(e)} as unioned domains only support boolean or op "count", "min", and "max".`}const AD="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",Pfe="Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.",Bfe="Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect.",jfe="Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.";function Ufe(e){return`Cannot stack "${e}" if there is already "${e}2".`}function qfe(e){return`Cannot stack non-linear scale (${e}).`}function Wfe(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function _1(e,t){return`Invalid ${e}: ${ct(t)}.`}function Hfe(e){return`Dropping day from datetime ${ct(e)} as day cannot be combined with other units.`}function Gfe(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function Vfe(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function Xfe(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function TD(e){return`1D error band does not support ${e}.`}function MD(e){return`Channel ${e} is required for "binned" bin.`}function Yfe(e){return`Channel ${e} should not be used with "binned" bin.`}function Zfe(e){return`Domain for ${e} is required for threshold scale.`}const FD=o2(s2);let ec=FD;function Kfe(e){return ec=e,ec}function Jfe(){return ec=FD,ec}function Y(...e){ec.warn(...e)}function Qfe(...e){ec.debug(...e)}function ll(e){if(e&&re(e)){for(const t of c_)if(t in e)return!0}return!1}const DD=["january","february","march","april","may","june","july","august","september","october","november","december"],ede=DD.map(e=>e.substr(0,3)),ND=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],tde=ND.map(e=>e.substr(0,3));function nde(e){if(c1(e)&&(e=+e),Xe(e))return e>4&&Y(_1("quarter",e)),e-1;throw new Error(_1("quarter",e))}function ide(e){if(c1(e)&&(e=+e),Xe(e))return e-1;{const t=e.toLowerCase(),n=DD.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=ede.indexOf(i);if(r!==-1)return r;throw new Error(_1("month",e))}}function rde(e){if(c1(e)&&(e=+e),Xe(e))return e%7;{const t=e.toLowerCase(),n=ND.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=tde.indexOf(i);if(r!==-1)return r;throw new Error(_1("day",e))}}function u_(e,t){const n=[];if(t&&e.day!==void 0&&G(e).length>1&&(Y(Hfe(e)),e=Ce(e),delete e.day),e.year!==void 0?n.push(e.year):n.push(2012),e.month!==void 0){const i=t?ide(e.month):e.month;n.push(i)}else if(e.quarter!==void 0){const i=t?nde(e.quarter):e.quarter;n.push(Xe(i)?i*3:`${i}*3`)}else n.push(0);if(e.date!==void 0)n.push(e.date);else if(e.day!==void 0){const i=t?rde(e.day):e.day;n.push(Xe(i)?i+1:`${i}+1`)}else n.push(1);for(const i of["hours","minutes","seconds","milliseconds"]){const r=e[i];n.push(typeof r>"u"?0:r)}return n}function ul(e){const n=u_(e,!0).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function sde(e){const n=u_(e,!1).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function ode(e){const t=u_(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}const OD={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},c_=G(OD);function ade(e){return!!OD[e]}function cl(e){return re(e)?e.binned:RD(e)}function RD(e){return e&&e.startsWith("binned")}function f_(e){return e.startsWith("utc")}function lde(e){return e.substring(3)}const ude={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function w1(e){return c_.filter(t=>ID(e,t))}function LD(e){const t=w1(e);return t[t.length-1]}function ID(e,t){const n=e.indexOf(t);return!(n<0||n>0&&t==="seconds"&&e.charAt(n-1)==="i"||e.length>n+3&&t==="day"&&e.charAt(n+3)==="o"||n>0&&t==="year"&&e.charAt(n-1)==="f")}function cde(e,t,{end:n}={end:!1}){const i=V7(t),r=f_(e)?"utc":"";function s(l){return l==="quarter"?`(${r}quarter(${i})-1)`:`${r}${l}(${i})`}let o;const a={};for(const l of c_)ID(e,l)&&(a[l]=s(l),o=l);return n&&(a[o]+="+1"),sde(a)}function zD(e){if(!e)return;const t=w1(e);return`timeUnitSpecifier(${ct(t)}, ${ct(ude)})`}function fde(e,t,n){if(!e)return;const i=zD(e);return`${n||f_(e)?"utc":"time"}Format(${t}, ${i})`}function Kt(e){if(!e)return;let t;return te(e)?RD(e)?t={unit:e.substring(6),binned:!0}:t={unit:e}:re(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),f_(t.unit)&&(t.utc=!0,t.unit=lde(t.unit)),t}function dde(e){const{utc:t,...n}=Kt(e);return n.unit?(t?"utc":"")+G(n).map(i=>_t(`${i==="unit"?"":`_${i}_`}${n[i]}`)).join(""):(t?"utc":"")+"timeunit"+G(n).map(i=>_t(`_${i}_${n[i]}`)).join("")}function PD(e,t=n=>n){const n=Kt(e),i=LD(n.unit);if(i&&i!=="day"){const r={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:s,part:o}=BD(i,n.step),a={...r,[o]:+r[o]+s};return`${t(ul(a))} - ${t(ul(r))}`}}const hde={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function pde(e){return!!hde[e]}function BD(e,t=1){if(pde(e))return{part:e,step:t};switch(e){case"day":case"dayofyear":return{part:"date",step:t};case"quarter":return{part:"month",step:t*3};case"week":return{part:"date",step:t*7}}}function gde(e){return e==null?void 0:e.param}function d_(e){return!!(e!=null&&e.field)&&e.equal!==void 0}function h_(e){return!!(e!=null&&e.field)&&e.lt!==void 0}function p_(e){return!!(e!=null&&e.field)&&e.lte!==void 0}function g_(e){return!!(e!=null&&e.field)&&e.gt!==void 0}function m_(e){return!!(e!=null&&e.field)&&e.gte!==void 0}function y_(e){if(e!=null&&e.field){if(q(e.range)&&e.range.length===2)return!0;if(de(e.range))return!0}return!1}function b_(e){return!!(e!=null&&e.field)&&(q(e.oneOf)||q(e.in))}function mde(e){return!!(e!=null&&e.field)&&e.valid!==void 0}function jD(e){return b_(e)||d_(e)||y_(e)||h_(e)||g_(e)||p_(e)||m_(e)}function as(e,t){return z1(e,{timeUnit:t,wrapTime:!0})}function yde(e,t){return e.map(n=>as(n,t))}function UD(e,t=!0){const{field:n}=e,i=Kt(e.timeUnit),{unit:r,binned:s}=i||{},o=Q(e,{expr:"datum"}),a=r?`time(${s?o:cde(r,n)})`:o;if(d_(e))return`${a}===${as(e.equal,r)}`;if(h_(e)){const l=e.lt;return`${a}<${as(l,r)}`}else if(g_(e)){const l=e.gt;return`${a}>${as(l,r)}`}else if(p_(e)){const l=e.lte;return`${a}<=${as(l,r)}`}else if(m_(e)){const l=e.gte;return`${a}>=${as(l,r)}`}else{if(b_(e))return`indexof([${yde(e.oneOf,r).join(",")}], ${a}) !== -1`;if(mde(e))return v_(a,e.valid);if(y_(e)){const{range:l}=e,u=de(l)?{signal:`${l.signal}[0]`}:l[0],c=de(l)?{signal:`${l.signal}[1]`}:l[1];if(u!==null&&c!==null&&t)return"inrange("+a+", ["+as(u,r)+", "+as(c,r)+"])";const f=[];return u!==null&&f.push(`${a} >= ${as(u,r)}`),c!==null&&f.push(`${a} <= ${as(c,r)}`),f.length>0?f.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${ct(e)}`)}function v_(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function bde(e){return jD(e)&&e.timeUnit?{...e,timeUnit:Kt(e.timeUnit)}:e}const jd={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function vde(e){return e==="quantitative"||e==="temporal"}function qD(e){return e==="ordinal"||e==="nominal"}const fl=jd.quantitative,x_=jd.ordinal,tc=jd.temporal,__=jd.nominal,nc=jd.geojson;function xde(e){if(e)switch(e=e.toLowerCase(),e){case"q":case fl:return"quantitative";case"t":case tc:return"temporal";case"o":case x_:return"ordinal";case"n":case __:return"nominal";case nc:return"geojson"}}const ui={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",SYMLOG:"symlog",IDENTITY:"identity",SEQUENTIAL:"sequential",TIME:"time",UTC:"utc",QUANTILE:"quantile",QUANTIZE:"quantize",THRESHOLD:"threshold",BIN_ORDINAL:"bin-ordinal",ORDINAL:"ordinal",POINT:"point",BAND:"band"},w_={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function _de(e,t){const n=w_[e],i=w_[t];return n===i||n==="ordinal-position"&&i==="time"||i==="ordinal-position"&&n==="time"}const wde={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function WD(e){return wde[e]}const HD=new Set(["linear","log","pow","sqrt","symlog"]),GD=new Set([...HD,"time","utc"]);function VD(e){return HD.has(e)}const XD=new Set(["quantile","quantize","threshold"]),kde=new Set([...GD,...XD,"sequential","identity"]),$de=new Set(["ordinal","bin-ordinal","point","band"]);function Jt(e){return $de.has(e)}function Ei(e){return kde.has(e)}function xr(e){return GD.has(e)}function ic(e){return XD.has(e)}const Ede={pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:9,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0};function Cde(e){return!te(e)&&!!e.name}function YD(e){return e==null?void 0:e.param}function Sde(e){return e==null?void 0:e.unionWith}function Ade(e){return re(e)&&"field"in e}const Tde={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,domainRaw:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},{type:pxe,domain:gxe,range:mxe,rangeMax:yxe,rangeMin:bxe,scheme:vxe,...Mde}=Tde,Fde=G(Mde);function k_(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!["point","band","identity"].includes(e);case"bins":return!["point","band","identity","ordinal"].includes(e);case"round":return xr(e)||e==="band"||e==="point";case"padding":case"rangeMin":case"rangeMax":return xr(e)||["point","band"].includes(e);case"paddingOuter":case"align":return["point","band"].includes(e);case"paddingInner":return e==="band";case"domainMax":case"domainMid":case"domainMin":case"domainRaw":case"clamp":return xr(e);case"nice":return xr(e)||e==="quantize"||e==="threshold";case"exponent":return e==="pow";case"base":return e==="log";case"constant":return e==="symlog";case"zero":return Ei(e)&&!Be(["log","time","utc","threshold","quantile"],e)}}function ZD(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return Qu(e)?void 0:Sfe(t);case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"domainRaw":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeMax":case"rangeMin":case"reverse":case"round":case"clamp":case"zero":return}}function Dde(e,t){return Be([x_,__],t)?e===void 0||Jt(e):t===tc?Be([ui.TIME,ui.UTC,void 0],e):t===fl?VD(e)||ic(e)||e===void 0:!0}function Nde(e,t,n=!1){if(!qs(e))return!1;switch(e){case wt:case Zt:case Wo:case Ku:case qi:case gr:return xr(t)||t==="band"?!0:t==="point"?!n:!1;case js:case Vo:case Us:case Ho:case Go:case rl:return xr(t)||ic(t)||Be(["band","point","ordinal"],t);case si:case is:case rs:return t!=="band";case Xo:case oi:return t==="ordinal"||ic(t)}}const jn={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},KD=jn.arc,k1=jn.area,$1=jn.bar,Ode=jn.image,E1=jn.line,C1=jn.point,Rde=jn.rect,S1=jn.rule,JD=jn.text,$_=jn.tick,Lde=jn.trail,E_=jn.circle,C_=jn.square,QD=jn.geoshape;function Qo(e){return["line","area","trail"].includes(e)}function Ud(e){return["rect","bar","image","arc"].includes(e)}const Ide=new Set(G(jn));function ls(e){return e.type}const zde=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],Pde=["fill","fillOpacity"],Bde=[...zde,...Pde],eN=G({color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1}),jde={area:["line","point"],bar:["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],rect:["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],line:["point"],tick:["bandSize","thickness"]},Ude={color:"#4c78a8",invalid:"filter",timeUnitBandSize:1},tN=G({mark:1,arc:1,area:1,bar:1,circle:1,image:1,line:1,point:1,rect:1,rule:1,square:1,text:1,tick:1,trail:1,geoshape:1});function dl(e){return e&&e.band!=null}const qde={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},nN=5,Wde={binSpacing:1,continuousBandSize:nN,minBandSize:.25,timeUnitBandPosition:.5},Hde={binSpacing:0,continuousBandSize:nN,minBandSize:.25,timeUnitBandPosition:.5},Gde={thickness:1};function Vde(e){return ls(e)?e.type:e}function S_(e){const{channel:t,channelDef:n,markDef:i,scale:r,config:s}=e,o=T_(e);return Z(n)&&!iD(n.aggregate)&&r&&xr(r.get("type"))?Xde({fieldDef:n,channel:t,markDef:i,ref:o,config:s}):o}function Xde({fieldDef:e,channel:t,markDef:n,ref:i,config:r}){return Qo(n.type)?i:it("invalid",n,r)===null?[Yde(e,t),i]:i}function Yde(e,t){const n=A_(e,!0),r=ol(t)==="y"?{field:{group:"height"}}:{value:0};return{test:n,...r}}function A_(e,t=!0){return v_(te(e)?e:Q(e,{expr:"datum"}),!t)}function Zde(e){const{datum:t}=e;return ll(t)?ul(t):`${ct(t)}`}function hl(e,t,n,i){const r={};if(t&&(r.scale=t),cs(e)){const{datum:s}=e;ll(s)?r.signal=ul(s):de(s)?r.signal=s.signal:Bd(s)?r.signal=s.expr:r.value=s}else r.field=Q(e,n);if(i){const{offset:s,band:o}=i;s&&(r.offset=s),o&&(r.band=o)}return r}function A1({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:i,startSuffix:r,endSuffix:s="end",bandPosition:o=.5}){const a=!de(o)&&0{switch(t.fieldTitle){case"plain":return e.field;case"functional":return che(e);default:return uhe(e,t)}};let xN=vN;function _N(e){xN=e}function fhe(){_N(vN)}function oc(e,t,{allowDisabling:n,includeDefault:i=!0}){var a;const r=(a=O_(e))==null?void 0:a.title;if(!Z(e))return r??e.title;const s=e,o=i?R_(s,t):void 0;return n?Dt(r,s.title,o):r??s.title??o}function O_(e){if(sc(e)&&e.axis)return e.axis;if(yN(e)&&e.legend)return e.legend;if(D_(e)&&e.header)return e.header}function R_(e,t){return xN(e,t)}function R1(e){if(bN(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}else{const t=O_(e)??{},{format:n,formatType:i}=t;return{format:n,formatType:i}}}function dhe(e,t){var s;switch(t){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(N_(e)&&q(e.sort))return"ordinal";const{aggregate:n,bin:i,timeUnit:r}=e;if(r)return"temporal";if(i||n&&!Zo(n)&&!Ws(n))return"quantitative";if(gl(e)&&((s=e.scale)!=null&&s.type))switch(w_[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function fs(e){if(Z(e))return e;if(D1(e))return e.condition}function Ut(e){if(Se(e))return e;if(Gd(e))return e.condition}function wN(e,t,n,i={}){if(te(e)||Xe(e)||ro(e)){const r=te(e)?"string":Xe(e)?"number":"boolean";return Y(gfe(t,r,e)),{value:e}}return Se(e)?L1(e,t,n,i):Gd(e)?{...e,condition:L1(e.condition,t,n,i)}:e}function L1(e,t,n,i){if(bN(e)){const{format:r,formatType:s,...o}=e;if(pl(s)&&!n.customFormatTypes)return Y(kD(t)),L1(o,t,n,i)}else{const r=sc(e)?"axis":yN(e)?"legend":D_(e)?"header":null;if(r&&e[r]){const{format:s,formatType:o,...a}=e[r];if(pl(o)&&!n.customFormatTypes)return Y(kD(t)),L1({...e,[r]:a},t,n,i)}}return Z(e)?L_(e,t,i):hhe(e)}function hhe(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=Xe(n)?"quantitative":te(n)?"nominal":ll(n)?"temporal":void 0,{...e,type:t}}function L_(e,t,{compositeMark:n=!1}={}){const{aggregate:i,timeUnit:r,bin:s,field:o}=e,a={...e};if(!n&&i&&!i_(i)&&!Zo(i)&&!Ws(i)&&(Y(yfe(i)),delete a.aggregate),r&&(a.timeUnit=Kt(r)),o&&(a.field=`${o}`),mt(s)&&(a.bin=I1(s,t)),un(s)&&!Nt(t)&&Y(Yfe(t)),Un(a)){const{type:l}=a,u=xde(l);l!==u&&(a.type=u),l!=="quantitative"&&iD(i)&&(Y(mfe(l,i)),a.type="quantitative")}else if(!KF(t)){const l=dhe(a,t);a.type=l}if(Un(a)){const{compatible:l,warning:u}=phe(a,t)||{};l===!1&&Y(u)}if(N_(a)&&te(a.sort)){const{sort:l}=a;if(uN(l))return{...a,sort:{encoding:l}};const u=l.substr(1);if(l.charAt(0)==="-"&&uN(u))return{...a,sort:{encoding:u,order:"descending"}}}if(D_(a)){const{header:l}=a;if(l){const{orient:u,...c}=l;if(u)return{...a,header:{...c,labelOrient:l.labelOrient||u,titleOrient:l.titleOrient||u}}}}return a}function I1(e,t){return ro(e)?{maxbins:sD(t)}:e==="binned"?{binned:!0}:!e.maxbins&&!e.step?{...e,maxbins:sD(t)}:e}const ac={compatible:!0};function phe(e,t){const n=e.type;if(n==="geojson"&&t!=="shape")return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case Is:case zs:case f1:return O1(e)?ac:{compatible:!1,warning:_fe(t)};case wt:case Zt:case Wo:case Ku:case si:case is:case rs:case Id:case zd:case d1:case sl:case h1:case p1:case rl:case qi:case gr:case g1:return ac;case yr:case Wi:case mr:case br:return n!==fl?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:ac;case Us:case Ho:case Go:case Vo:case js:case Bs:case Ps:case pr:case ns:return n==="nominal"&&!e.sort?{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`}:ac;case oi:case Xo:return!O1(e)&&!ahe(e)?{compatible:!1,warning:wfe(t)}:ac;case Ju:return e.type==="nominal"&&!("sort"in e)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:ac}}function lc(e){const{formatType:t}=R1(e);return t==="time"||!t&&ghe(e)}function ghe(e){return e&&(e.type==="temporal"||Z(e)&&!!e.timeUnit)}function z1(e,{timeUnit:t,type:n,wrapTime:i,undefinedIfExprNotRequired:r}){var l;const s=t&&((l=Kt(t))==null?void 0:l.unit);let o=s||n==="temporal",a;return Bd(e)?a=e.expr:de(e)?a=e.signal:ll(e)?(o=!0,a=ul(e)):(te(e)||Xe(e))&&o&&(a=`datetime(${ct(e)})`,ade(s)&&(Xe(e)&&e<1e4||te(e)&&isNaN(Date.parse(e)))&&(a=ul({[s]:e}))),a?i&&o?`time(${a})`:a:r?void 0:ct(e)}function kN(e,t){const{type:n}=e;return t.map(i=>{const r=Z(e)&&!cl(e.timeUnit)?e.timeUnit:void 0,s=z1(i,{timeUnit:r,type:n,undefinedIfExprNotRequired:!0});return s!==void 0?{signal:s}:i})}function Vd(e,t){return mt(e.bin)?qs(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}const $N={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function Xd(e){return e==null?void 0:e.condition}const EN=["domain","grid","labels","ticks","title"],mhe={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"both",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},CN={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},yhe={...CN,style:1,labelExpr:1,encoding:1};function SN(e){return!!yhe[e]}const AN=G({axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1});function Vs(e){return"mark"in e}class P1{constructor(t,n){this.name=t,this.run=n}hasMatchingType(t){return Vs(t)?Vde(t.mark)===this.name:!1}}function ml(e,t){const n=e&&e[t];return n?q(n)?nl(n,i=>!!i.field):Z(n)||D1(n):!1}function TN(e,t){const n=e&&e[t];return n?q(n)?nl(n,i=>!!i.field):Z(n)||cs(n)||Gd(n):!1}function MN(e,t){if(Nt(t)){const n=e[t];if((Z(n)||cs(n))&&(qD(n.type)||Z(n)&&n.timeUnit)){const i=J7(t);return TN(e,i)}}return!1}function I_(e){return nl(kce,t=>{if(ml(e,t)){const n=e[t];if(q(n))return nl(n,i=>!!i.aggregate);{const i=fs(n);return i&&!!i.aggregate}}return!1})}function FN(e,t){const n=[],i=[],r=[],s=[],o={};return z_(e,(a,l)=>{if(Z(a)){const{field:u,aggregate:c,bin:f,timeUnit:d,...h}=a;if(c||d||f){const p=O_(a),g=p==null?void 0:p.title;let m=Q(a,{forAs:!0});const y={...g?[]:{title:oc(a,t,{allowDisabling:!0})},...h,field:m};if(c){let b;if(Zo(c)?(b="argmax",m=Q({op:"argmax",field:c.argmax},{forAs:!0}),y.field=`${m}.${u}`):Ws(c)?(b="argmin",m=Q({op:"argmin",field:c.argmin},{forAs:!0}),y.field=`${m}.${u}`):c!=="boxplot"&&c!=="errorbar"&&c!=="errorband"&&(b=c),b){const v={op:b,as:m};u&&(v.field=u),s.push(v)}}else if(n.push(m),Un(a)&&mt(f)){if(i.push({bin:f,field:u,as:m}),n.push(Q(a,{binSuffix:"end"})),Vd(a,l)&&n.push(Q(a,{binSuffix:"range"})),Nt(l)){const b={field:`${m}_end`};o[`${l}2`]=b}y.bin="binned",KF(l)||(y.type=fl)}else if(d&&!cl(d)){r.push({timeUnit:d,field:u,as:m});const b=Un(a)&&a.type!==tc&&"time";b&&(l===Id||l===sl?y.formatType=b:Nce(l)?y.legend={formatType:b,...y.legend}:Nt(l)&&(y.axis={formatType:b,...y.axis}))}o[l]=y}else n.push(u),o[l]=e[l]}else o[l]=e[l]}),{bins:i,timeUnits:r,aggregate:s,groupby:n,encoding:o}}function bhe(e,t,n){const i=Rce(t,n);if(i){if(i==="binned"){const r=e[t===pr?wt:Zt];return!!(Z(r)&&Z(e[t])&&un(r.bin))}}else return!1;return!0}function vhe(e,t,n,i){const r={};for(const s of G(e))ZF(s)||Y(xfe(s));for(let s of Tce){if(!e[s])continue;const o=e[s];if(Pd(s)){const a=Ace(s),l=r[a];if(Z(l)&&vde(l.type)&&Z(o)&&!l.timeUnit){Y(pfe(a));continue}}if(s==="angle"&&t==="arc"&&!e.theta&&(Y(hfe),s=qi),!bhe(e,s,t)){Y(x1(s,t));continue}if(s===js&&t==="line"){const a=fs(e[s]);if(a!=null&&a.aggregate){Y(vfe);continue}}if(s===si&&(n?"fill"in e:"stroke"in e)){Y(ED("encoding",{fill:"fill"in e,stroke:"stroke"in e}));continue}if(s===zd||s===Ju&&!q(o)&&!wr(o)||s===sl&&q(o)){if(o){if(s===Ju){const a=e[s];if(gN(a)){r[s]=a;continue}}r[s]=ee(o).reduce((a,l)=>(Z(l)?a.push(L_(l,s)):Y(a_(l,s)),a),[])}}else{if(s===sl&&o===null)r[s]=null;else if(!Z(o)&&!cs(o)&&!wr(o)&&!F1(o)&&!de(o)){Y(a_(o,s));continue}r[s]=wN(o,s,i)}}return r}function B1(e,t){const n={};for(const i of G(e)){const r=wN(e[i],i,t,{compositeMark:!0});n[i]=r}return n}function xhe(e){const t=[];for(const n of G(e))if(ml(e,n)){const i=e[n],r=ee(i);for(const s of r)Z(s)?t.push(s):D1(s)&&t.push(s.condition)}return t}function z_(e,t,n){if(e)for(const i of G(e)){const r=e[i];if(q(r))for(const s of r)t.call(n,s,i);else t.call(n,r,i)}}function _he(e,t,n,i){return e?G(e).reduce((r,s)=>{const o=e[s];return q(o)?o.reduce((a,l)=>t.call(i,a,l,s),r):t.call(i,r,o,s)},n):n}function DN(e,t){return G(t).reduce((n,i)=>{switch(i){case wt:case Zt:case h1:case g1:case p1:case pr:case ns:case Wo:case Ku:case qi:case Bs:case gr:case Ps:case mr:case yr:case br:case Wi:case Id:case oi:case rl:case sl:return n;case Ju:if(e==="line"||e==="trail")return n;case zd:case d1:{const r=t[i];if(q(r)||Z(r))for(const s of ee(r))s.aggregate||n.push(Q(s,{}));return n}case js:if(e==="trail")return n;case si:case is:case rs:case Us:case Ho:case Go:case Xo:case Vo:{const r=fs(t[i]);return r&&!r.aggregate&&n.push(Q(r,{})),n}}},[])}function whe(e){const{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let i,r;if(q(t)){for(const s of t)s.aggregate?(i||(i=[]),i.push(s)):(r||(r=[]),r.push(s));i&&(n.tooltip=i)}else t.aggregate?n.tooltip=t:r=t;return q(r)&&r.length===1&&(r=r[0]),{customTooltipWithoutAggregatedField:r,filteredEncoding:n}}function P_(e,t,n,i=!0){if("tooltip"in n)return{tooltip:n.tooltip};const r=e.map(({fieldPrefix:o,titlePrefix:a})=>{const l=i?` of ${B_(t)}`:"";return{field:o+t.field,type:t.type,title:de(a)?{signal:`${a}"${escape(l)}"`}:a+l}}),s=xhe(n).map(she);return{tooltip:[...r,...ts(s,Pe)]}}function B_(e){const{title:t,field:n}=e;return Dt(t,n)}function j_(e,t,n,i,r){const{scale:s,axis:o}=n;return({partName:a,mark:l,positionPrefix:u,endPositionPrefix:c=void 0,extraEncoding:f={}})=>{const d=B_(n);return NN(e,a,r,{mark:l,encoding:{[t]:{field:`${u}_${n.field}`,type:n.type,...d!==void 0?{title:d}:{},...s!==void 0?{scale:s}:{},...o!==void 0?{axis:o}:{}},...te(c)?{[`${t}2`]:{field:`${c}_${n.field}`}}:{},...i,...f}})}}function NN(e,t,n,i){const{clip:r,color:s,opacity:o}=e,a=e.type;return e[t]||e[t]===void 0&&n[t]?[{...i,mark:{...n[t],...r?{clip:r}:{},...s?{color:s}:{},...o?{opacity:o}:{},...ls(i.mark)?i.mark:{type:i.mark},style:`${a}-${String(t)}`,...ro(e[t])?{}:e[t]}}]:[]}function ON(e,t,n){const{encoding:i}=e,r=t==="vertical"?"y":"x",s=i[r],o=i[`${r}2`],a=i[`${r}Error`],l=i[`${r}Error2`];return{continuousAxisChannelDef:j1(s,n),continuousAxisChannelDef2:j1(o,n),continuousAxisChannelDefError:j1(a,n),continuousAxisChannelDefError2:j1(l,n),continuousAxis:r}}function j1(e,t){if(e!=null&&e.aggregate){const{aggregate:n,...i}=e;return n!==t&&Y(Xfe(n,t)),i}else return e}function RN(e,t){const{mark:n,encoding:i}=e,{x:r,y:s}=i;if(ls(n)&&n.orient)return n.orient;if(ta(r)){if(ta(s)){const o=Z(r)&&r.aggregate,a=Z(s)&&s.aggregate;if(!o&&a===t)return"vertical";if(!a&&o===t)return"horizontal";if(o===t&&a===t)throw new Error("Both x and y cannot have aggregate");return lc(s)&&!lc(r)?"horizontal":"vertical"}return"horizontal"}else{if(ta(s))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}}const U1="boxplot",khe=["box","median","outliers","rule","ticks"],$he=new P1(U1,IN);function LN(e){return Xe(e)?"tukey":e}function IN(e,{config:t}){e={...e,encoding:B1(e.encoding,t)};const{mark:n,encoding:i,params:r,projection:s,...o}=e,a=ls(n)?n:{type:n};r&&Y(xD("boxplot"));const l=a.extent??t.boxplot.extent,u=it("size",a,t),c=a.invalid,f=LN(l),{bins:d,timeUnits:h,transform:p,continuousAxisChannelDef:g,continuousAxis:m,groupby:y,aggregate:b,encodingWithoutContinuousAxis:v,ticksOrient:x,boxOrient:_,customTooltipWithoutAggregatedField:k}=Ehe(e,l,t),{color:w,size:$,...S}=v,E=Hn=>j_(a,m,g,Hn,t.boxplot),A=E(S),R=E(v),C=E({...S,...$?{size:$}:{}}),M=P_([{fieldPrefix:f==="min-max"?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:f==="min-max"?"lower_whisker_":"min_",titlePrefix:"Min"}],g,v),T={type:"tick",color:"black",opacity:1,orient:x,invalid:c,aria:!1},O=f==="min-max"?M:P_([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],g,v),P=[...A({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:O}),...A({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:O}),...A({partName:"ticks",mark:T,positionPrefix:"lower_whisker",extraEncoding:O}),...A({partName:"ticks",mark:T,positionPrefix:"upper_whisker",extraEncoding:O})],j=[...f!=="tukey"?P:[],...R({partName:"box",mark:{type:"bar",...u?{size:u}:{},orient:_,invalid:c,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:M}),...C({partName:"median",mark:{type:"tick",invalid:c,...re(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{},...u?{size:u}:{},orient:x,aria:!1},positionPrefix:"mid_box",extraEncoding:M})];if(f==="min-max")return{...o,transform:(o.transform??[]).concat(p),layer:j};const W=`datum["lower_box_${g.field}"]`,ne=`datum["upper_box_${g.field}"]`,ae=`(${ne} - ${W})`,ke=`${W} - ${l} * ${ae}`,ze=`${ne} + ${l} * ${ae}`,Ie=`datum["${g.field}"]`,We={joinaggregate:zN(g.field),groupby:y},Wn={transform:[{filter:`(${ke} <= ${Ie}) && (${Ie} <= ${ze})`},{aggregate:[{op:"min",field:g.field,as:`lower_whisker_${g.field}`},{op:"max",field:g.field,as:`upper_whisker_${g.field}`},{op:"min",field:`lower_box_${g.field}`,as:`lower_box_${g.field}`},{op:"max",field:`upper_box_${g.field}`,as:`upper_box_${g.field}`},...b],groupby:y}],layer:P},{tooltip:Mr,...Xi}=S,{scale:se,axis:Te}=g,De=B_(g),X=ri(Te,["title"]),qt=NN(a,"outliers",t.boxplot,{transform:[{filter:`(${Ie} < ${ke}) || (${Ie} > ${ze})`}],mark:"point",encoding:{[m]:{field:g.field,type:g.type,...De!==void 0?{title:De}:{},...se!==void 0?{scale:se}:{},...ut(X)?{}:{axis:X}},...Xi,...w?{color:w}:{},...k?{tooltip:k}:{}}})[0];let He;const Cn=[...d,...h,We];return qt?He={transform:Cn,layer:[qt,Wn]}:(He=Wn,He.transform.unshift(...Cn)),{...o,layer:[He,{transform:p,layer:j}]}}function zN(e){return[{op:"q1",field:e,as:`lower_box_${e}`},{op:"q3",field:e,as:`upper_box_${e}`}]}function Ehe(e,t,n){const i=RN(e,U1),{continuousAxisChannelDef:r,continuousAxis:s}=ON(e,i,U1),o=r.field,a=LN(t),l=[...zN(o),{op:"median",field:o,as:`mid_box_${o}`},{op:"min",field:o,as:(a==="min-max"?"lower_whisker_":"min_")+o},{op:"max",field:o,as:(a==="min-max"?"upper_whisker_":"max_")+o}],u=a==="min-max"||a==="tukey"?[]:[{calculate:`datum["upper_box_${o}"] - datum["lower_box_${o}"]`,as:`iqr_${o}`},{calculate:`min(datum["upper_box_${o}"] + datum["iqr_${o}"] * ${t}, datum["max_${o}"])`,as:`upper_whisker_${o}`},{calculate:`max(datum["lower_box_${o}"] - datum["iqr_${o}"] * ${t}, datum["min_${o}"])`,as:`lower_whisker_${o}`}],{[s]:c,...f}=e.encoding,{customTooltipWithoutAggregatedField:d,filteredEncoding:h}=whe(f),{bins:p,timeUnits:g,aggregate:m,groupby:y,encoding:b}=FN(h,n),v=i==="vertical"?"horizontal":"vertical",x=i,_=[...p,...g,{aggregate:[...m,...l],groupby:y},...u];return{bins:p,timeUnits:g,transform:_,groupby:y,aggregate:m,continuousAxisChannelDef:r,continuousAxis:s,encodingWithoutContinuousAxis:b,ticksOrient:v,boxOrient:x,customTooltipWithoutAggregatedField:d}}const U_="errorbar",Che=["ticks","rule"],She=new P1(U_,PN);function PN(e,{config:t}){e={...e,encoding:B1(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,ticksOrient:o,markDef:a,outerSpec:l,tooltipEncoding:u}=BN(e,U_,t);delete s.size;const c=j_(a,r,i,s,t.errorbar),f=a.thickness,d=a.size,h={type:"tick",orient:o,aria:!1,...f!==void 0?{thickness:f}:{},...d!==void 0?{size:d}:{}},p=[...c({partName:"ticks",mark:h,positionPrefix:"lower",extraEncoding:u}),...c({partName:"ticks",mark:h,positionPrefix:"upper",extraEncoding:u}),...c({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...f!==void 0?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u})];return{...l,transform:n,...p.length>1?{layer:p}:{...p[0]}}}function Ahe(e,t){const{encoding:n}=e;if(The(n))return{orient:RN(e,t),inputType:"raw"};const i=Mhe(n),r=Fhe(n),s=n.x,o=n.y;if(i){if(r)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const a=n.x2,l=n.y2;if(Se(a)&&Se(l))throw new Error(`${t} cannot have both x2 and y2`);if(Se(a)){if(ta(s))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}else if(Se(l)){if(ta(o))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${t}`)}throw new Error("No ranged axis")}else{const a=n.xError,l=n.xError2,u=n.yError,c=n.yError2;if(Se(l)&&!Se(a))throw new Error(`${t} cannot have xError2 without xError`);if(Se(c)&&!Se(u))throw new Error(`${t} cannot have yError2 without yError`);if(Se(a)&&Se(u))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(Se(a)){if(ta(s))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(Se(u)){if(ta(o))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function The(e){return(Se(e.x)||Se(e.y))&&!Se(e.x2)&&!Se(e.y2)&&!Se(e.xError)&&!Se(e.xError2)&&!Se(e.yError)&&!Se(e.yError2)}function Mhe(e){return Se(e.x2)||Se(e.y2)}function Fhe(e){return Se(e.xError)||Se(e.xError2)||Se(e.yError)||Se(e.yError2)}function BN(e,t,n){const{mark:i,encoding:r,params:s,projection:o,...a}=e,l=ls(i)?i:{type:i};s&&Y(xD(t));const{orient:u,inputType:c}=Ahe(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:h,continuousAxisChannelDefError2:p,continuousAxis:g}=ON(e,u,t),{errorBarSpecificAggregate:m,postAggregateCalculates:y,tooltipSummary:b,tooltipTitleWithFieldName:v}=Dhe(l,f,d,h,p,c,t,n),{[g]:x,[g==="x"?"x2":"y2"]:_,[g==="x"?"xError":"yError"]:k,[g==="x"?"xError2":"yError2"]:w,...$}=r,{bins:S,timeUnits:E,aggregate:A,groupby:R,encoding:C}=FN($,n),M=[...A,...m],T=c!=="raw"?[]:R,O=P_(b,f,C,v);return{transform:[...a.transform??[],...S,...E,...M.length===0?[]:[{aggregate:M,groupby:T}],...y],groupby:T,continuousAxisChannelDef:f,continuousAxis:g,encodingWithoutContinuousAxis:C,ticksOrient:u==="vertical"?"horizontal":"vertical",markDef:l,outerSpec:a,tooltipEncoding:O}}function Dhe(e,t,n,i,r,s,o,a){let l=[],u=[];const c=t.field;let f,d=!1;if(s==="raw"){const h=e.center?e.center:e.extent?e.extent==="iqr"?"median":"mean":a.errorbar.center,p=e.extent?e.extent:h==="mean"?"stderr":"iqr";if(h==="median"!=(p==="iqr")&&Y(Vfe(h,p,o)),p==="stderr"||p==="stdev")l=[{op:p,field:c,as:`extent_${c}`},{op:h,field:c,as:`center_${c}`}],u=[{calculate:`datum["center_${c}"] + datum["extent_${c}"]`,as:`upper_${c}`},{calculate:`datum["center_${c}"] - datum["extent_${c}"]`,as:`lower_${c}`}],f=[{fieldPrefix:"center_",titlePrefix:Rd(h)},{fieldPrefix:"upper_",titlePrefix:jN(h,p,"+")},{fieldPrefix:"lower_",titlePrefix:jN(h,p,"-")}],d=!0;else{let g,m,y;p==="ci"?(g="mean",m="ci0",y="ci1"):(g="median",m="q1",y="q3"),l=[{op:m,field:c,as:`lower_${c}`},{op:y,field:c,as:`upper_${c}`},{op:g,field:c,as:`center_${c}`}],f=[{fieldPrefix:"upper_",titlePrefix:oc({field:c,aggregate:y,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:oc({field:c,aggregate:m,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:oc({field:c,aggregate:g,type:"quantitative"},a,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&Y(Gfe(e.center,e.extent)),s==="aggregated-upper-lower"?(f=[],u=[{calculate:`datum["${n.field}"]`,as:`upper_${c}`},{calculate:`datum["${c}"]`,as:`lower_${c}`}]):s==="aggregated-error"&&(f=[{fieldPrefix:"",titlePrefix:c}],u=[{calculate:`datum["${c}"] + datum["${i.field}"]`,as:`upper_${c}`}],r?u.push({calculate:`datum["${c}"] + datum["${r.field}"]`,as:`lower_${c}`}):u.push({calculate:`datum["${c}"] - datum["${i.field}"]`,as:`lower_${c}`}));for(const h of u)f.push({fieldPrefix:h.as.substring(0,6),titlePrefix:il(il(h.calculate,'datum["',""),'"]',"")})}return{postAggregateCalculates:u,errorBarSpecificAggregate:l,tooltipSummary:f,tooltipTitleWithFieldName:d}}function jN(e,t,n){return`${Rd(e)} ${n} ${t}`}const q_="errorband",Nhe=["band","borders"],Ohe=new P1(q_,UN);function UN(e,{config:t}){e={...e,encoding:B1(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,markDef:o,outerSpec:a,tooltipEncoding:l}=BN(e,q_,t),u=o,c=j_(u,r,i,s,t.errorband),f=e.encoding.x!==void 0&&e.encoding.y!==void 0;let d={type:f?"area":"rect"},h={type:f?"line":"rule"};const p={...u.interpolate?{interpolate:u.interpolate}:{},...u.tension&&u.interpolate?{tension:u.tension}:{}};return f?(d={...d,...p,ariaRoleDescription:"errorband"},h={...h,...p,aria:!1}):u.interpolate?Y(TD("interpolate")):u.tension&&Y(TD("tension")),{...a,transform:n,layer:[...c({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l}),...c({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:l}),...c({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:l})]}}const qN={};function W_(e,t,n){const i=new P1(e,t);qN[e]={normalizer:i,parts:n}}function Rhe(){return G(qN)}W_(U1,IN,khe),W_(U_,PN,Che),W_(q_,UN,Nhe);const Lhe=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],WN={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},HN={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},Ihe=G(WN),zhe=G(HN),GN=G({header:1,headerRow:1,headerColumn:1,headerFacet:1}),VN=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],Phe={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},Bhe={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1},kr="_vgsid_",jhe={point:{on:"click",fields:[kr],toggle:"event.shiftKey",resolve:"global",clear:"dblclick"},interval:{on:"[pointerdown, window:pointerup] > window:pointermove!",encodings:["x","y"],translate:"[pointerdown, window:pointerup] > window:pointermove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function H_(e){return e==="legend"||!!(e!=null&&e.legend)}function G_(e){return H_(e)&&re(e)}function V_(e){return!!(e!=null&&e.select)}function XN(e){const t=[];for(const n of e||[]){if(V_(n))continue;const{expr:i,bind:r,...s}=n;if(r&&i){const o={...s,bind:r,init:i};t.push(o)}else{const o={...s,...i?{update:i}:{},...r?{bind:r}:{}};t.push(o)}}return t}function Uhe(e){return q1(e)||Y_(e)||X_(e)}function X_(e){return"concat"in e}function q1(e){return"vconcat"in e}function Y_(e){return"hconcat"in e}function YN({step:e,offsetIsDiscrete:t}){return t?e.for??"offset":"position"}function ds(e){return re(e)&&e.step!==void 0}function ZN(e){return e.view||e.width||e.height}const KN=20,qhe=G({align:1,bounds:1,center:1,columns:1,spacing:1});function Whe(e,t,n){const i=n[t],r={},{spacing:s,columns:o}=i;s!==void 0&&(r.spacing=s),o!==void 0&&(M1(e)&&!Hd(e.facet)||X_(e))&&(r.columns=o),q1(e)&&(r.columns=1);for(const a of qhe)if(e[a]!==void 0)if(a==="spacing"){const l=e[a];r[a]=Xe(l)?l:{row:l.row??s,column:l.column??s}}else r[a]=e[a];return r}function Z_(e,t){return e[t]??e[t==="width"?"continuousWidth":"continuousHeight"]}function W1(e,t){const n=H1(e,t);return ds(n)?n.step:JN}function H1(e,t){const n=e[t]??e[t==="width"?"discreteWidth":"discreteHeight"];return Dt(n,{step:e.step})}const JN=20,Hhe={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:{continuousWidth:200,continuousHeight:200,step:JN},mark:Ude,arc:{},area:{},bar:Wde,circle:{},geoshape:{},image:{},line:{},point:{},rect:Hde,rule:{color:"black"},square:{},text:{color:"black"},tick:Gde,trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:Ede,projection:{},legend:Phe,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:jhe,style:{},title:{},facet:{spacing:KN},concat:{spacing:KN},normalizedNumberFormat:".0%"},Xs=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],QN={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},eO={blue:Xs[0],orange:Xs[1],red:Xs[2],teal:Xs[3],green:Xs[4],yellow:Xs[5],purple:Xs[6],pink:Xs[7],brown:Xs[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function Ghe(e={}){return{signals:[{name:"color",value:re(e)?{...eO,...e}:eO}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}function Vhe(e){return{signals:[{name:"fontSize",value:re(e)?{...QN,...e}:QN}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}function Xhe(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}function tO(e){const t=G(e||{}),n={};for(const i of t){const r=e[i];n[i]=Xd(r)?aD(r):$i(r)}return n}function Yhe(e){const t=G(e),n={};for(const i of t)n[i]=tO(e[i]);return n}const Zhe=[...tN,...AN,...GN,"background","padding","legend","lineBreak","scale","style","title","view"];function nO(e={}){const{color:t,font:n,fontSize:i,selection:r,...s}=e,o=Wl({},Ce(Hhe),n?Xhe(n):{},t?Ghe(t):{},i?Vhe(i):{},s||{});r&&Hl(o,"selection",r,!0);const a=ri(o,Zhe);for(const l of["background","lineBreak","padding"])o[l]&&(a[l]=$i(o[l]));for(const l of tN)o[l]&&(a[l]=li(o[l]));for(const l of AN)o[l]&&(a[l]=tO(o[l]));for(const l of GN)o[l]&&(a[l]=li(o[l]));return o.legend&&(a.legend=li(o.legend)),o.scale&&(a.scale=li(o.scale)),o.style&&(a.style=Yhe(o.style)),o.title&&(a.title=li(o.title)),o.view&&(a.view=li(o.view)),a}const Khe=new Set(["view",...Ide]),Jhe=["color","fontSize","background","padding","facet","concat","numberFormat","numberFormatType","normalizedNumberFormat","normalizedNumberFormatType","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],Qhe={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...jde};function epe(e){e=Ce(e);for(const t of Jhe)delete e[t];if(e.axis)for(const t in e.axis)Xd(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of Lhe)delete e.legend[t];if(e.mark){for(const t of eN)delete e.mark[t];e.mark.tooltip&&re(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(XN(e.params)),delete e.params);for(const t of Khe){for(const i of eN)delete e[t][i];const n=Qhe[t];if(n)for(const i of n)delete e[t][i];npe(e,t)}for(const t of Rhe())delete e[t];tpe(e);for(const t in e)re(e[t])&&ut(e[t])&&delete e[t];return ut(e)?void 0:e}function tpe(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:i}=oD(e.title);ut(t)||(e.style["group-title"]={...e.style["group-title"],...t}),ut(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n}),ut(i)?delete e.title:e.title=i}function npe(e,t,n,i){const r=i?e[t][i]:e[t];t==="view"&&(n="cell");const s={...r,...e.style[n??t]};ut(s)||(e.style[n??t]=s),i||delete e[t]}function G1(e){return"layer"in e}function ipe(e){return"repeat"in e}function rpe(e){return!q(e.repeat)&&e.repeat.layer}class K_{map(t,n){return M1(t)?this.mapFacet(t,n):ipe(t)?this.mapRepeat(t,n):Y_(t)?this.mapHConcat(t,n):q1(t)?this.mapVConcat(t,n):X_(t)?this.mapConcat(t,n):this.mapLayerOrUnit(t,n)}mapLayerOrUnit(t,n){if(G1(t))return this.mapLayer(t,n);if(Vs(t))return this.mapUnit(t,n);throw new Error(s_(t))}mapLayer(t,n){return{...t,layer:t.layer.map(i=>this.mapLayerOrUnit(i,n))}}mapHConcat(t,n){return{...t,hconcat:t.hconcat.map(i=>this.map(i,n))}}mapVConcat(t,n){return{...t,vconcat:t.vconcat.map(i=>this.map(i,n))}}mapConcat(t,n){const{concat:i,...r}=t;return{...r,concat:i.map(s=>this.map(s,n))}}mapFacet(t,n){return{...t,spec:this.map(t.spec,n)}}mapRepeat(t,n){return{...t,spec:this.map(t.spec,n)}}}const spe={zero:1,center:1,normalize:1};function ope(e){return e in spe}const ape=new Set([KD,$1,k1,S1,C1,E_,C_,E1,JD,$_]),lpe=new Set([$1,k1,KD]);function uc(e){return Z(e)&&rc(e)==="quantitative"&&!e.bin}function iO(e,t,{orient:n,type:i}){const r=t==="x"?"y":"radius",s=t==="x"&&["bar","area"].includes(i),o=e[t],a=e[r];if(Z(o)&&Z(a))if(uc(o)&&uc(a)){if(o.stack)return t;if(a.stack)return r;const l=Z(o)&&!!o.aggregate,u=Z(a)&&!!a.aggregate;if(l!==u)return l?t:r;if(s){if(n==="vertical")return r;if(n==="horizontal")return t}}else{if(uc(o))return t;if(uc(a))return r}else{if(uc(o))return s&&n==="vertical"?void 0:t;if(uc(a))return s&&n==="horizontal"?void 0:r}}function upe(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function rO(e,t){var g,m;const n=ls(e)?e:{type:e},i=n.type;if(!ape.has(i))return null;const r=iO(t,"x",n)||iO(t,"theta",n);if(!r)return null;const s=t[r],o=Z(s)?Q(s,{}):void 0,a=upe(r),l=[],u=new Set;if(t[a]){const y=t[a],b=Z(y)?Q(y,{}):void 0;b&&b!==o&&(l.push(a),u.add(b))}const c=a==="x"?"xOffset":"yOffset",f=t[c],d=Z(f)?Q(f,{}):void 0;d&&d!==o&&(l.push(c),u.add(d));const h=Mce.reduce((y,b)=>{if(b!=="tooltip"&&ml(t,b)){const v=t[b];for(const x of ee(v)){const _=fs(x);if(_.aggregate)continue;const k=Q(_,{});(!k||!u.has(k))&&y.push({channel:b,fieldDef:_})}}return y},[]);let p;return s.stack!==void 0?ro(s.stack)?p=s.stack?"zero":null:p=s.stack:lpe.has(i)&&(p="zero"),!p||!ope(p)||I_(t)&&h.length===0?null:(g=s==null?void 0:s.scale)!=null&&g.type&&((m=s==null?void 0:s.scale)==null?void 0:m.type)!==ui.LINEAR?(s!=null&&s.stack&&Y(qfe(s.scale.type)),null):Se(t[ss(r)])?(s.stack!==void 0&&Y(Ufe(r)),null):(Z(s)&&s.aggregate&&!Uce.has(s.aggregate)&&Y(Wfe(s.aggregate)),{groupbyChannels:l,groupbyFields:u,fieldChannel:r,impute:s.impute===null?!1:Qo(i),stackBy:h,offset:p})}function sO(e,t,n){const i=li(e),r=it("orient",i,n);if(i.orient=hpe(i.type,t,r),r!==void 0&&r!==i.orient&&Y(Cfe(i.orient,r)),i.type==="bar"&&i.orient){const a=it("cornerRadiusEnd",i,n);if(a!==void 0){const l=i.orient==="horizontal"&&t.x2||i.orient==="vertical"&&t.y2?["cornerRadius"]:qde[i.orient];for(const u of l)i[u]=a;i.cornerRadiusEnd!==void 0&&delete i.cornerRadiusEnd}}return it("opacity",i,n)===void 0&&(i.opacity=fpe(i.type,t)),it("cursor",i,n)===void 0&&(i.cursor=cpe(i,t,n)),i}function cpe(e,t,n){return t.href||e.href||it("href",e,n)?"pointer":e.cursor}function fpe(e,t){if(Be([C1,$_,E_,C_],e)&&!I_(t))return .7}function dpe(e,t,{graticule:n}){if(n)return!1;const i=Gs("filled",e,t),r=e.type;return Dt(i,r!==C1&&r!==E1&&r!==S1)}function hpe(e,t,n){switch(e){case C1:case E_:case C_:case JD:case Rde:case Ode:return}const{x:i,y:r,x2:s,y2:o}=t;switch(e){case $1:if(Z(i)&&(un(i.bin)||Z(r)&&r.aggregate&&!i.aggregate))return"vertical";if(Z(r)&&(un(r.bin)||Z(i)&&i.aggregate&&!r.aggregate))return"horizontal";if(o||s){if(n)return n;if(!s)return(Z(i)&&i.type===fl&&!mt(i.bin)||N1(i))&&Z(r)&&un(r.bin)?"horizontal":"vertical";if(!o)return(Z(r)&&r.type===fl&&!mt(r.bin)||N1(r))&&Z(i)&&un(i.bin)?"vertical":"horizontal"}case S1:if(s&&!(Z(i)&&un(i.bin))&&o&&!(Z(r)&&un(r.bin)))return;case k1:if(o)return Z(r)&&un(r.bin)?"horizontal":"vertical";if(s)return Z(i)&&un(i.bin)?"vertical":"horizontal";if(e===S1){if(i&&!r)return"vertical";if(r&&!i)return"horizontal"}case E1:case $_:{const a=mN(i),l=mN(r);if(n)return n;if(a&&!l)return e!=="tick"?"horizontal":"vertical";if(!a&&l)return e!=="tick"?"vertical":"horizontal";if(a&&l)return"vertical";{const u=Un(i)&&i.type===tc,c=Un(r)&&r.type===tc;if(u&&!c)return"vertical";if(!u&&c)return"horizontal"}return}}return"vertical"}function ppe(e){const{point:t,line:n,...i}=e;return G(i).length>1?i:i.type}function gpe(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:ri(e[t],["point","line"])});return e}function J_(e,t={},n){return e.point==="transparent"?{opacity:0}:e.point?re(e.point)?e.point:{}:e.point!==void 0?null:t.point||n.shape?re(t.point)?t.point:{}:void 0}function oO(e,t={}){return e.line?e.line===!0?{}:e.line:e.line!==void 0?null:t.line?t.line===!0?{}:t.line:void 0}class mpe{constructor(){this.name="path-overlay"}hasMatchingType(t,n){if(Vs(t)){const{mark:i,encoding:r}=t,s=ls(i)?i:{type:i};switch(s.type){case"line":case"rule":case"trail":return!!J_(s,n[s.type],r);case"area":return!!J_(s,n[s.type],r)||!!oO(s,n[s.type])}}return!1}run(t,n,i){const{config:r}=n,{params:s,projection:o,mark:a,name:l,encoding:u,...c}=t,f=B1(u,r),d=ls(a)?a:{type:a},h=J_(d,r[d.type],f),p=d.type==="area"&&oO(d,r[d.type]),g=[{name:l,...s?{params:s}:{},mark:ppe({...d.type==="area"&&d.opacity===void 0&&d.fillOpacity===void 0?{opacity:.7}:{},...d}),encoding:ri(f,["shape"])}],m=rO(sO(d,f,r),f);let y=f;if(m){const{fieldChannel:b,offset:v}=m;y={...f,[b]:{...f[b],...v?{stack:v}:{}}}}return y=ri(y,["y2","x2"]),p&&g.push({...o?{projection:o}:{},mark:{type:"line",...Yu(d,["clip","interpolate","tension","tooltip"]),...p},encoding:y}),h&&g.push({...o?{projection:o}:{},mark:{type:"point",opacity:1,filled:!0,...Yu(d,["clip","tooltip"]),...h},encoding:y}),i({...c,layer:g},{...n,config:gpe(r)})}}function ype(e,t){return t?Hd(e)?cO(e,t):aO(e,t):e}function Q_(e,t){return t?cO(e,t):e}function ew(e,t,n){const i=t[e];if(ihe(i)){if(i.repeat in n)return{...t,[e]:n[i.repeat]};Y(ofe(i.repeat));return}return t}function aO(e,t){if(e=ew("field",e,t),e!==void 0){if(e===null)return null;if(N_(e)&&us(e.sort)){const n=ew("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function lO(e,t){if(Z(e))return aO(e,t);{const n=ew("datum",e,t);return n!==e&&!n.type&&(n.type="nominal"),n}}function uO(e,t){if(Se(e)){const n=lO(e,t);if(n)return n;if(F1(e))return{condition:e.condition}}else{if(Gd(e)){const n=lO(e.condition,t);if(n)return{...e,condition:n};{const{condition:i,...r}=e;return r}}return e}}function cO(e,t){const n={};for(const i in e)if(me(e,i)){const r=e[i];if(q(r))n[i]=r.map(s=>uO(s,t)).filter(s=>s);else{const s=uO(r,t);s!==void 0&&(n[i]=s)}}return n}class bpe{constructor(){this.name="RuleForRangedLine"}hasMatchingType(t){if(Vs(t)){const{encoding:n,mark:i}=t;if(i==="line"||ls(i)&&i.type==="line")for(const r of Sce){const s=ol(r),o=n[s];if(n[r]&&(Z(o)&&!un(o.bin)||cs(o)))return!0}}return!1}run(t,n,i){const{encoding:r,mark:s}=t;return Y(Efe(!!r.x2,!!r.y2)),i({...t,mark:re(s)?{...s,type:"rule"}:"rule"},n)}}class vpe extends K_{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[$he,She,Ohe,new mpe,new bpe]}map(t,n){if(Vs(t)){const i=ml(t.encoding,Is),r=ml(t.encoding,zs),s=ml(t.encoding,f1);if(i||r||s)return this.mapFacetedUnit(t,n)}return super.map(t,n)}mapUnit(t,n){const{parentEncoding:i,parentProjection:r}=n,s=Q_(t.encoding,n.repeater),o={...t,...t.name?{name:[n.repeaterPrefix,t.name].filter(l=>l).join("_")}:{},...s?{encoding:s}:{}};if(i||r)return this.mapUnitWithParentEncodingOrProjection(o,n);const a=this.mapLayerOrUnit.bind(this);for(const l of this.nonFacetUnitNormalizers)if(l.hasMatchingType(o,n.config))return l.run(o,n,a);return o}mapRepeat(t,n){return rpe(t)?this.mapLayerRepeat(t,n):this.mapNonLayerRepeat(t,n)}mapLayerRepeat(t,n){const{repeat:i,spec:r,...s}=t,{row:o,column:a,layer:l}=i,{repeater:u={},repeaterPrefix:c=""}=n;return o||a?this.mapRepeat({...t,repeat:{...o?{row:o}:{},...a?{column:a}:{}},spec:{repeat:{layer:l},spec:r}},n):{...s,layer:l.map(f=>{const d={...u,layer:f},h=`${(r.name?`${r.name}_`:"")+c}child__layer_${_t(f)}`,p=this.mapLayerOrUnit(r,{...n,repeater:d,repeaterPrefix:h});return p.name=h,p})}}mapNonLayerRepeat(t,n){const{repeat:i,spec:r,data:s,...o}=t;!q(i)&&t.columns&&(t=ri(t,["columns"]),Y(_D("repeat")));const a=[],{repeater:l={},repeaterPrefix:u=""}=n,c=!q(i)&&i.row||[l?l.row:null],f=!q(i)&&i.column||[l?l.column:null],d=q(i)&&i||[l?l.repeat:null];for(const p of d)for(const g of c)for(const m of f){const y={repeat:p,row:g,column:m,layer:l.layer},b=(r.name?`${r.name}_`:"")+u+"child__"+(q(i)?`${_t(p)}`:(i.row?`row_${_t(g)}`:"")+(i.column?`column_${_t(m)}`:"")),v=this.map(r,{...n,repeater:y,repeaterPrefix:b});v.name=b,a.push(ri(v,["data"]))}const h=q(i)?t.columns:i.column?i.column.length:1;return{data:r.data??s,align:"all",...o,columns:h,concat:a}}mapFacet(t,n){const{facet:i}=t;return Hd(i)&&t.columns&&(t=ri(t,["columns"]),Y(_D("facet"))),super.mapFacet(t,n)}mapUnitWithParentEncodingOrProjection(t,n){const{encoding:i,projection:r}=t,{parentEncoding:s,parentProjection:o,config:a}=n,l=dO({parentProjection:o,projection:r}),u=fO({parentEncoding:s,encoding:Q_(i,n.repeater)});return this.mapUnit({...t,...l?{projection:l}:{},...u?{encoding:u}:{}},{config:a})}mapFacetedUnit(t,n){const{row:i,column:r,facet:s,...o}=t.encoding,{mark:a,width:l,projection:u,height:c,view:f,params:d,encoding:h,...p}=t,{facetMapping:g,layout:m}=this.getFacetMappingAndLayout({row:i,column:r,facet:s},n),y=Q_(o,n.repeater);return this.mapFacet({...p,...m,facet:g,spec:{...l?{width:l}:{},...c?{height:c}:{},...f?{view:f}:{},...u?{projection:u}:{},mark:a,encoding:y,...d?{params:d}:{}}},n)}getFacetMappingAndLayout(t,n){const{row:i,column:r,facet:s}=t;if(i||r){s&&Y(kfe([...i?[Is]:[],...r?[zs]:[]]));const o={},a={};for(const l of[Is,zs]){const u=t[l];if(u){const{align:c,center:f,spacing:d,columns:h,...p}=u;o[l]=p;for(const g of["align","center","spacing"])u[g]!==void 0&&(a[g]??(a[g]={}),a[g][l]=u[g])}}return{facetMapping:o,layout:a}}else{const{align:o,center:a,spacing:l,columns:u,...c}=s;return{facetMapping:ype(c,n.repeater),layout:{...o?{align:o}:{},...a?{center:a}:{},...l?{spacing:l}:{},...u?{columns:u}:{}}}}}mapLayer(t,{parentEncoding:n,parentProjection:i,...r}){const{encoding:s,projection:o,...a}=t,l={...r,parentEncoding:fO({parentEncoding:n,encoding:s,layer:!0}),parentProjection:dO({parentProjection:i,projection:o})};return super.mapLayer({...a,...t.name?{name:[l.repeaterPrefix,t.name].filter(u=>u).join("_")}:{}},l)}}function fO({parentEncoding:e,encoding:t={},layer:n}){let i={};if(e){const r=new Set([...G(e),...G(t)]);for(const s of r){const o=t[s],a=e[s];if(Se(o)){const l={...a,...o};i[s]=l}else Gd(o)?i[s]={...o,condition:{...a,...o.condition}}:o||o===null?i[s]=o:(n||wr(a)||de(a)||Se(a)||q(a))&&(i[s]=a)}}else i=t;return!i||ut(i)?void 0:i}function dO(e){const{parentProjection:t,projection:n}=e;return t&&n&&Y(dfe({parentProjection:t,projection:n})),n??t}function tw(e){return"filter"in e}function xpe(e){return(e==null?void 0:e.stop)!==void 0}function hO(e){return"lookup"in e}function _pe(e){return"data"in e}function wpe(e){return"param"in e}function kpe(e){return"pivot"in e}function $pe(e){return"density"in e}function Epe(e){return"quantile"in e}function Cpe(e){return"regression"in e}function Spe(e){return"loess"in e}function Ape(e){return"sample"in e}function Tpe(e){return"window"in e}function Mpe(e){return"joinaggregate"in e}function Fpe(e){return"flatten"in e}function Dpe(e){return"calculate"in e}function pO(e){return"bin"in e}function Npe(e){return"impute"in e}function Ope(e){return"timeUnit"in e}function Rpe(e){return"aggregate"in e}function Lpe(e){return"stack"in e}function Ipe(e){return"fold"in e}function zpe(e){return"extent"in e&&!("density"in e)}function Ppe(e){return e.map(t=>tw(t)?{filter:Xu(t.filter,bde)}:t)}class Bpe extends K_{map(t,n){return n.emptySelections??(n.emptySelections={}),n.selectionPredicates??(n.selectionPredicates={}),t=gO(t,n),super.map(t,n)}mapLayerOrUnit(t,n){if(t=gO(t,n),t.encoding){const i={};for(const[r,s]of qo(t.encoding))i[r]=mO(s,n);t={...t,encoding:i}}return super.mapLayerOrUnit(t,n)}mapUnit(t,n){const{selection:i,...r}=t;return i?{...r,params:qo(i).map(([s,o])=>{const{init:a,bind:l,empty:u,...c}=o;c.type==="single"?(c.type="point",c.toggle=!1):c.type==="multi"&&(c.type="point"),n.emptySelections[s]=u!=="none";for(const f of ln(n.selectionPredicates[s]??{}))f.empty=u!=="none";return{name:s,value:a,select:c,bind:l}})}:t}}function gO(e,t){const{transform:n,...i}=e;if(n){const r=n.map(s=>{if(tw(s))return{filter:nw(s,t)};if(pO(s)&&al(s.bin))return{...s,bin:yO(s.bin)};if(hO(s)){const{selection:o,...a}=s.from;return o?{...s,from:{param:o,...a}}:s}return s});return{...i,transform:r}}return e}function mO(e,t){var i,r;const n=Ce(e);if(Z(n)&&al(n.bin)&&(n.bin=yO(n.bin)),gl(n)&&((r=(i=n.scale)==null?void 0:i.domain)!=null&&r.selection)){const{selection:s,...o}=n.scale.domain;n.scale.domain={...o,...s?{param:s}:{}}}if(F1(n))if(q(n.condition))n.condition=n.condition.map(s=>{const{selection:o,param:a,test:l,...u}=s;return a?s:{...u,test:nw(s,t)}});else{const{selection:s,param:o,test:a,...l}=mO(n.condition,t);n.condition=o?n.condition:{...l,test:nw(n.condition,t)}}return n}function yO(e){const t=e.extent;if(t!=null&&t.selection){const{selection:n,...i}=t;return{...e,extent:{...i,param:n}}}return e}function nw(e,t){const n=i=>Xu(i,r=>{var s;const o=t.emptySelections[r]??!0,a={param:r,empty:o};return(s=t.selectionPredicates)[r]??(s[r]=[]),t.selectionPredicates[r].push(a),a});return e.selection?n(e.selection):Xu(e.test||e.filter,i=>i.selection?n(i.selection):i)}class iw extends K_{map(t,n){const i=n.selections??[];if(t.params&&!Vs(t)){const r=[];for(const s of t.params)V_(s)?i.push(s):r.push(s);t.params=r}return n.selections=i,super.map(t,n)}mapUnit(t,n){const i=n.selections;if(!i||!i.length)return t;const r=(n.path??[]).concat(t.name),s=[];for(const o of i)if(!o.views||!o.views.length)s.push(o);else for(const a of o.views)(te(a)&&(a===t.name||r.includes(a))||q(a)&&a.map(l=>r.indexOf(l)).every((l,u,c)=>l!==-1&&(u===0||l>c[u-1])))&&s.push(o);return s.length&&(t.params=s),t}}for(const e of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const t=iw.prototype[e];iw.prototype[e]=function(n,i){return t.call(this,n,jpe(n,i))}}function jpe(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}function bO(e,t){t===void 0&&(t=nO(e.config));const n=Hpe(e,t),{width:i,height:r}=e,s=Gpe(n,{width:i,height:r,autosize:e.autosize},t);return{...n,...s?{autosize:s}:{}}}const Upe=new vpe,qpe=new Bpe,Wpe=new iw;function Hpe(e,t={}){const n={config:t};return Wpe.map(Upe.map(qpe.map(e,n),n),n)}function vO(e){return te(e)?{type:e}:e??{}}function Gpe(e,t,n){let{width:i,height:r}=t;const s=Vs(e)||G1(e),o={};s?i=="container"&&r=="container"?(o.type="fit",o.contains="padding"):i=="container"?(o.type="fit-x",o.contains="padding"):r=="container"&&(o.type="fit-y",o.contains="padding"):(i=="container"&&(Y(mD("width")),i=void 0),r=="container"&&(Y(mD("height")),r=void 0));const a={type:"pad",...o,...n?vO(n.autosize):{},...vO(e.autosize)};if(a.type==="fit"&&!s&&(Y(Zce),a.type="pad"),i=="container"&&!(a.type=="fit"||a.type=="fit-x")&&Y(yD("width")),r=="container"&&!(a.type=="fit"||a.type=="fit-y")&&Y(yD("height")),!ki(a,{type:"pad"}))return a}function Vpe(e){return e==="fit"||e==="fit-x"||e==="fit-y"}function Xpe(e){return e?`fit-${m1(e)}`:"fit"}const Ype=["background","padding"];function xO(e,t){const n={};for(const i of Ype)e&&e[i]!==void 0&&(n[i]=$i(e[i]));return t&&(n.params=e.params),n}class Ys{constructor(t={},n={}){this.explicit=t,this.implicit=n}clone(){return new Ys(Ce(this.explicit),Ce(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(t){return Dt(this.explicit[t],this.implicit[t])}getWithExplicit(t){return this.explicit[t]!==void 0?{explicit:!0,value:this.explicit[t]}:this.implicit[t]!==void 0?{explicit:!1,value:this.implicit[t]}:{explicit:!1,value:void 0}}setWithExplicit(t,{value:n,explicit:i}){n!==void 0&&this.set(t,n,i)}set(t,n,i){return delete this[i?"implicit":"explicit"][t],this[i?"explicit":"implicit"][t]=n,this}copyKeyFromSplit(t,{explicit:n,implicit:i}){n[t]!==void 0?this.set(t,n[t],!0):i[t]!==void 0&&this.set(t,i[t],!1)}copyKeyFromObject(t,n){n[t]!==void 0&&this.set(t,n[t],!0)}copyAll(t){for(const n of G(t.combine())){const i=t.getWithExplicit(n);this.setWithExplicit(n,i)}}}function hs(e){return{explicit:!0,value:e}}function Ci(e){return{explicit:!1,value:e}}function _O(e){return(t,n,i,r)=>{const s=e(t.value,n.value);return s>0?t:s<0?n:V1(t,n,i,r)}}function V1(e,t,n,i){return e.explicit&&t.explicit&&Y(Rfe(n,i,e.value,t.value)),e}function na(e,t,n,i,r=V1){return e===void 0||e.value===void 0?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:ki(e.value,t.value)?e:r(e,t,n,i)}class Zpe extends Ys{constructor(t={},n={},i=!1){super(t,n),this.explicit=t,this.implicit=n,this.parseNothing=i}clone(){const t=super.clone();return t.parseNothing=this.parseNothing,t}}function cc(e){return"url"in e}function Yd(e){return"values"in e}function wO(e){return"name"in e&&!cc(e)&&!Yd(e)&&!ia(e)}function ia(e){return e&&(kO(e)||$O(e)||rw(e))}function kO(e){return"sequence"in e}function $O(e){return"sphere"in e}function rw(e){return"graticule"in e}var yt;(function(e){e[e.Raw=0]="Raw",e[e.Main=1]="Main",e[e.Row=2]="Row",e[e.Column=3]="Column",e[e.Lookup=4]="Lookup"})(yt||(yt={}));function EO(e){const{signals:t,hasLegend:n,index:i,...r}=e;return r.field=Ui(r.field),r}function yl(e,t=!0,n=dn){if(q(e)){const i=e.map(r=>yl(r,t,n));return t?`[${i.join(", ")}]`:i}else if(ll(e))return n(t?ul(e):ode(e));return t?n(ct(e)):e}function Kpe(e,t){for(const n of ln(e.component.selection??{})){const i=n.name;let r=`${i}${sa}, ${n.resolve==="global"?"true":`{unit: ${vl(e)}}`}`;for(const s of em)s.defined(n)&&(s.signals&&(t=s.signals(e,n,t)),s.modifyExpr&&(r=s.modifyExpr(e,n,r)));t.push({name:i+Tge,on:[{events:{signal:n.name+sa},update:`modify(${J(n.name+bl)}, ${r})`}]})}return sw(t)}function Jpe(e,t){if(e.component.selection&&G(e.component.selection).length){const n=J(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:jo("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return sw(t)}function Qpe(e,t){let n=!1;for(const i of ln(e.component.selection??{})){const r=i.name,s=J(r+bl);if(t.filter(a=>a.name===r).length===0){const a=i.resolve==="global"?"union":i.resolve,l=i.type==="point"?", true, true)":")";t.push({name:i.name,update:`${eR}(${s}, ${J(a)}${l}`})}n=!0;for(const a of em)a.defined(i)&&a.topLevelSignals&&(t=a.topLevelSignals(e,i,t))}return n&&t.filter(r=>r.name==="unit").length===0&&t.unshift({name:"unit",value:{},on:[{events:"pointermove",update:"isTuple(group()) ? group() : unit"}]}),sw(t)}function ege(e,t){const n=[...t],i=vl(e,{escape:!1});for(const r of ln(e.component.selection??{})){const s={name:r.name+bl};if(r.project.hasSelectionId&&(s.transform=[{type:"collect",sort:{field:kr}}]),r.init){const a=r.project.items.map(EO);s.values=r.project.hasSelectionId?r.init.map(l=>({unit:i,[kr]:yl(l,!1)[0]})):r.init.map(l=>({unit:i,fields:a,values:yl(l,!1)}))}n.filter(a=>a.name===r.name+bl).length||n.push(s)}return n}function CO(e,t){for(const n of ln(e.component.selection??{}))for(const i of em)i.defined(n)&&i.marks&&(t=i.marks(e,n,t));return t}function tge(e,t){for(const n of e.children)At(n)&&(t=CO(n,t));return t}function nge(e,t,n,i){const r=sR(e,t.param,t);return{signal:Ei(n.get("type"))&&q(i)&&i[0]>i[1]?`isValid(${r}) && reverse(${r})`:r}}function sw(e){return e.map(t=>(t.on&&!t.on.length&&delete t.on,t))}class ot{constructor(t,n){this.debugName=n,this._children=[],this._parent=null,t&&(this.parent=t)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(t){this._parent=t,t&&t.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(t,n){if(this._children.includes(t)){Y(ufe);return}n!==void 0?this._children.splice(n,0,t):this._children.push(t)}removeChild(t){const n=this._children.indexOf(t);return this._children.splice(n,1),n}remove(){let t=this._parent.removeChild(this);for(const n of this._children)n._parent=this._parent,this._parent.addChild(n,t++)}insertAsParentOf(t){const n=t.parent;n.removeChild(this),this.parent=n,t.parent=this}swapWithParent(){const t=this._parent,n=t.parent;for(const r of this._children)r.parent=t;this._children=[],t.removeChild(this);const i=t.parent.removeChild(t);this._parent=n,n.addChild(this,i),t.parent=this}}class qn extends ot{clone(){const t=new this.constructor;return t.debugName=`clone_${this.debugName}`,t._source=this._source,t._name=`clone_${this._name}`,t.type=this.type,t.refCounts=this.refCounts,t.refCounts[t._name]=0,t}constructor(t,n,i,r){super(t,n),this.type=i,this.refCounts=r,this._source=this._name=n,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}dependentFields(){return new Set}producedFields(){return new Set}hash(){return this._hash===void 0&&(this._hash=`Output ${jF()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}}function ow(e){return e.as!==void 0}function SO(e){return`${e}_end`}class ps extends ot{clone(){return new ps(null,Ce(this.timeUnits))}constructor(t,n){super(t),this.timeUnits=n}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,s,o)=>{const{field:a,timeUnit:l}=s;if(l){let u;if(cl(l)){if(At(n)){const{mark:c,markDef:f,config:d}=n,h=ea({fieldDef:s,markDef:f,config:d});(Ud(c)||h)&&(u={timeUnit:Kt(l),field:a})}}else u={as:Q(s,{forAs:!0}),field:a,timeUnit:l};if(At(n)){const{mark:c,markDef:f,config:d}=n,h=ea({fieldDef:s,markDef:f,config:d});Ud(c)&&Nt(o)&&h!==.5&&(u.rectBandPosition=h)}u&&(r[Pe(u)]=u)}return r},{});return ut(i)?null:new ps(t,i)}static makeFromTransform(t,n){const{timeUnit:i,...r}={...n},s=Kt(i),o={...r,timeUnit:s};return new ps(t,{[Pe(o)]:o})}merge(t){this.timeUnits={...this.timeUnits};for(const n in t.timeUnits)this.timeUnits[n]||(this.timeUnits[n]=t.timeUnits[n]);for(const n of t.children)t.removeChild(n),n.parent=this;t.remove()}removeFormulas(t){const n={};for(const[i,r]of qo(this.timeUnits)){const s=ow(r)?r.as:`${r.field}_end`;t.has(s)||(n[i]=r)}this.timeUnits=n}producedFields(){return new Set(ln(this.timeUnits).map(t=>ow(t)?t.as:SO(t.field)))}dependentFields(){return new Set(ln(this.timeUnits).map(t=>t.field))}hash(){return`TimeUnit ${Pe(this.timeUnits)}`}assemble(){const t=[];for(const n of ln(this.timeUnits)){const{rectBandPosition:i}=n,r=Kt(n.timeUnit);if(ow(n)){const{field:s,as:o}=n,{unit:a,utc:l,...u}=r,c=[o,`${o}_end`];t.push({field:Ui(s),type:"timeunit",...a?{units:w1(a)}:{},...l?{timezone:"utc"}:{},...u,as:c}),t.push(...TO(c,i,r))}else if(n){const{field:s}=n,o=s.replaceAll("\\.","."),a=AO({timeUnit:r,field:o}),l=SO(o);t.push({type:"formula",expr:a,as:l}),t.push(...TO([o,l],i,r))}}return t}}const X1="offsetted_rect_start",Y1="offsetted_rect_end";function AO({timeUnit:e,field:t,reverse:n}){const{unit:i,utc:r}=e,s=LD(i),{part:o,step:a}=BD(s,e.step);return`${r?"utcOffset":"timeOffset"}('${o}', datum['${t}'], ${n?-a:a})`}function TO([e,t],n,i){if(n!==void 0&&n!==.5){const r=`datum['${e}']`,s=`datum['${t}']`;return[{type:"formula",expr:MO([AO({timeUnit:i,field:e,reverse:!0}),r],n+.5),as:`${e}_${X1}`},{type:"formula",expr:MO([r,s],n+.5),as:`${e}_${Y1}`}]}return[]}function MO([e,t],n){return`${1-n} * ${e} + ${n} * ${t}`}const Zd="_tuple_fields";class ige{constructor(...t){this.items=t,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const rge={defined:()=>!0,parse:(e,t,n)=>{const i=t.name,r=t.project??(t.project=new ige),s={},o={},a=new Set,l=(p,g)=>{const m=g==="visual"?p.channel:p.field;let y=_t(`${i}_${m}`);for(let b=1;a.has(y);b++)y=_t(`${i}_${m}_${b}`);return a.add(y),{[g]:y}},u=t.type,c=e.config.selection[u],f=n.value!==void 0?ee(n.value):null;let{fields:d,encodings:h}=re(n.select)?n.select:{};if(!d&&!h&&f){for(const p of f)if(re(p))for(const g of G(p))Cce(g)?(h||(h=[])).push(g):u==="interval"?(Y(sfe),h=c.encodings):(d??(d=[])).push(g)}!d&&!h&&(h=c.encodings,"fields"in c&&(d=c.fields));for(const p of h??[]){const g=e.fieldDef(p);if(g){let m=g.field;if(g.aggregate){Y(Kce(p,g.aggregate));continue}else if(!m){Y(vD(p));continue}if(g.timeUnit&&!cl(g.timeUnit)){m=e.vgField(p);const y={timeUnit:g.timeUnit,as:m,field:g.field};o[Pe(y)]=y}if(!s[m]){const y=u==="interval"&&qs(p)&&Ei(e.getScaleComponent(p).get("type"))?"R":g.bin?"R-RE":"E",b={field:m,channel:p,type:y,index:r.items.length};b.signals={...l(b,"data"),...l(b,"visual")},r.items.push(s[m]=b),r.hasField[m]=s[m],r.hasSelectionId=r.hasSelectionId||m===kr,XF(p)?(b.geoChannel=p,b.channel=VF(p),r.hasChannel[b.channel]=s[m]):r.hasChannel[p]=s[m]}}else Y(vD(p))}for(const p of d??[]){if(r.hasField[p])continue;const g={type:"E",field:p,index:r.items.length};g.signals={...l(g,"data")},r.items.push(g),r.hasField[p]=g,r.hasSelectionId=r.hasSelectionId||p===kr}f&&(t.init=f.map(p=>r.items.map(g=>re(p)?p[g.geoChannel||g.channel]!==void 0?p[g.geoChannel||g.channel]:p[g.field]:p))),ut(o)||(r.timeUnit=new ps(null,o))},signals:(e,t,n)=>{const i=t.name+Zd;return n.filter(s=>s.name===i).length>0||t.project.hasSelectionId?n:n.concat({name:i,value:t.project.items.map(EO)})}},Zs={defined:e=>e.type==="interval"&&e.resolve==="global"&&e.bind&&e.bind==="scales",parse:(e,t)=>{const n=t.scales=[];for(const i of t.project.items){const r=i.channel;if(!qs(r))continue;const s=e.getScaleComponent(r),o=s?s.get("type"):void 0;if(!s||!Ei(o)){Y(efe);continue}s.set("selectionExtent",{param:t.name,field:i.field},!0),n.push(i)}},topLevelSignals:(e,t,n)=>{const i=t.scales.filter(o=>n.filter(a=>a.name===o.signals.data).length===0);if(!e.parent||FO(e)||i.length===0)return n;const r=n.filter(o=>o.name===t.name)[0];let s=r.update;if(s.indexOf(eR)>=0)r.update=`{${i.map(o=>`${J(Ui(o.field))}: ${o.signals.data}`).join(", ")}}`;else{for(const o of i){const a=`${J(Ui(o.field))}: ${o.signals.data}`;s.includes(a)||(s=`${s.substring(0,s.length-1)}, ${a}}`)}r.update=s}return n.concat(i.map(o=>({name:o.signals.data})))},signals:(e,t,n)=>{if(e.parent&&!FO(e))for(const i of t.scales){const r=n.filter(s=>s.name===i.signals.data)[0];r.push="outer",delete r.value,delete r.update}return n}};function aw(e,t){return`domain(${J(e.scaleName(t))})`}function FO(e){return e.parent&&xc(e.parent)&&!e.parent.parent}const fc="_brush",DO="_scale_trigger",Kd="geo_interval_init_tick",NO="_init",sge="_center",oge={defined:e=>e.type==="interval",parse:(e,t,n)=>{var i;if(e.hasProjection){const r={...re(n.select)?n.select:{}};r.fields=[kr],r.encodings||(r.encodings=n.value?G(n.value):[yr,mr]),n.select={type:"interval",...r}}if(t.translate&&!Zs.defined(t)){const r=`!event.item || event.item.mark.name !== ${J(t.name+fc)}`;for(const s of t.events){if(!s.between){Y(`${s} is not an ordered event stream for interval selections.`);continue}const o=ee((i=s.between[0]).filter??(i.filter=[]));o.indexOf(r)<0&&o.push(r)}}},signals:(e,t,n)=>{const i=t.name,r=i+sa,s=ln(t.project.hasChannel).filter(a=>a.channel===wt||a.channel===Zt),o=t.init?t.init[0]:null;if(n.push(...s.reduce((a,l)=>a.concat(age(e,t,l,o&&o[l.index])),[])),e.hasProjection){const a=J(e.projectionName()),l=e.projectionName()+sge,{x:u,y:c}=t.project.hasChannel,f=u&&u.signals.visual,d=c&&c.signals.visual,h=u?o&&o[u.index]:`${l}[0]`,p=c?o&&o[c.index]:`${l}[1]`,g=_=>e.getSizeSignalRef(_).signal,m=`[[${f?f+"[0]":"0"}, ${d?d+"[0]":"0"}],[${f?f+"[1]":g("width")}, ${d?d+"[1]":g("height")}]]`;o&&(n.unshift({name:i+NO,init:`[scale(${a}, [${u?h[0]:h}, ${c?p[0]:p}]), scale(${a}, [${u?h[1]:h}, ${c?p[1]:p}])]`}),(!u||!c)&&(n.find(k=>k.name===l)||n.unshift({name:l,update:`invert(${a}, [${g("width")}/2, ${g("height")}/2])`})));const y=`intersect(${m}, {markname: ${J(e.getName("marks"))}}, unit.mark)`,b=`{unit: ${vl(e)}}`,v=`vlSelectionTuples(${y}, ${b})`,x=s.map(_=>_.signals.visual);return n.concat({name:r,on:[{events:[...x.length?[{signal:x.join(" || ")}]:[],...o?[{signal:Kd}]:[]],update:v}]})}else{if(!Zs.defined(t)){const u=i+DO,c=s.map(f=>{const d=f.channel,{data:h,visual:p}=f.signals,g=J(e.scaleName(d)),m=e.getScaleComponent(d).get("type"),y=Ei(m)?"+":"";return`(!isArray(${h}) || (${y}invert(${g}, ${p})[0] === ${y}${h}[0] && ${y}invert(${g}, ${p})[1] === ${y}${h}[1]))`});c.length&&n.push({name:u,value:{},on:[{events:s.map(f=>({scale:e.scaleName(f.channel)})),update:c.join(" && ")+` ? ${u} : {}`}]})}const a=s.map(u=>u.signals.data),l=`unit: ${vl(e)}, fields: ${i+Zd}, values`;return n.concat({name:r,...o?{init:`{${l}: ${yl(o)}}`}:{},...a.length?{on:[{events:[{signal:a.join(" || ")}],update:`${a.join(" && ")} ? {${l}: [${a}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>(At(e)&&e.hasProjection&&t.init&&(n.filter(r=>r.name===Kd).length||n.unshift({name:Kd,value:null,on:[{events:"timer{1}",update:`${Kd} === null ? {} : ${Kd}`}]})),n),marks:(e,t,n)=>{const i=t.name,{x:r,y:s}=t.project.hasChannel,o=r==null?void 0:r.signals.visual,a=s==null?void 0:s.signals.visual,l=`data(${J(t.name+bl)})`;if(Zs.defined(t)||!r&&!s)return n;const u={x:r!==void 0?{signal:`${o}[0]`}:{value:0},y:s!==void 0?{signal:`${a}[0]`}:{value:0},x2:r!==void 0?{signal:`${o}[1]`}:{field:{group:"width"}},y2:s!==void 0?{signal:`${a}[1]`}:{field:{group:"height"}}};if(t.resolve==="global")for(const g of G(u))u[g]=[{test:`${l}.length && ${l}[0].unit === ${vl(e)}`,...u[g]},{value:0}];const{fill:c,fillOpacity:f,cursor:d,...h}=t.mark,p=G(h).reduce((g,m)=>(g[m]=[{test:[r!==void 0&&`${o}[0] !== ${o}[1]`,s!==void 0&&`${a}[0] !== ${a}[1]`].filter(y=>y).join(" && "),value:h[m]},{value:null}],g),{});return[{name:`${i+fc}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:c},fillOpacity:{value:f}},update:u}},...n,{name:i+fc,type:"rect",clip:!0,encode:{enter:{...d?{cursor:{value:d}}:{},fill:{value:"transparent"}},update:{...u,...p}}}]}};function age(e,t,n,i){const r=!e.hasProjection,s=n.channel,o=n.signals.visual,a=J(r?e.scaleName(s):e.projectionName()),l=d=>`scale(${a}, ${d})`,u=e.getSizeSignalRef(s===wt?"width":"height").signal,c=`${s}(unit)`,f=t.events.reduce((d,h)=>[...d,{events:h.between[0],update:`[${c}, ${c}]`},{events:h,update:`[${o}[0], clamp(${c}, 0, ${u})]`}],[]);if(r){const d=n.signals.data,h=Zs.defined(t),p=e.getScaleComponent(s),g=p?p.get("type"):void 0,m=i?{init:yl(i,!0,l)}:{value:[]};return f.push({events:{signal:t.name+DO},update:Ei(g)?`[${l(`${d}[0]`)}, ${l(`${d}[1]`)}]`:"[0, 0]"}),h?[{name:d,on:[]}]:[{name:o,...m,on:f},{name:d,...i?{init:yl(i)}:{},on:[{events:{signal:o},update:`${o}[0] === ${o}[1] ? null : invert(${a}, ${o})`}]}]}else{const d=s===wt?0:1,h=t.name+NO,p=i?{init:`[${h}[0][${d}], ${h}[1][${d}]]`}:{value:[]};return[{name:o,...p,on:f}]}}const lge={defined:e=>e.type==="point",signals:(e,t,n)=>{const i=t.name,r=i+Zd,s=t.project,o="(item().isVoronoi ? datum.datum : datum)",a=ln(e.component.selection??{}).reduce((f,d)=>d.type==="interval"?f.concat(d.name+fc):f,[]).map(f=>`indexof(item().mark.name, '${f}') < 0`).join(" && "),l=`datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${a?` && ${a}`:""}`;let u=`unit: ${vl(e)}, `;if(t.project.hasSelectionId)u+=`${kr}: ${o}[${J(kr)}]`;else{const f=s.items.map(d=>{const h=e.fieldDef(d.channel);return h!=null&&h.bin?`[${o}[${J(e.vgField(d.channel,{}))}], ${o}[${J(e.vgField(d.channel,{binSuffix:"end"}))}]]`:`${o}[${J(d.field)}]`}).join(", ");u+=`fields: ${r}, values: [${f}]`}const c=t.events;return n.concat([{name:i+sa,on:c?[{events:c,update:`${l} ? {${u}} : null`,force:!0}]:[]}])}};function dc(e,t,n,i){const r=F1(t)&&t.condition,s=i(t);if(r){const a=ee(r).map(l=>{const u=i(l);if(nhe(l)){const{param:c,empty:f}=l;return{test:rR(e,{param:c,empty:f}),...u}}else return{test:tm(e,l.test),...u}});return{[n]:[...a,...s!==void 0?[s]:[]]}}else return s!==void 0?{[n]:s}:{}}function lw(e,t="text"){const n=e.encoding[t];return dc(e,n,t,i=>Z1(i,e.config))}function Z1(e,t,n="datum"){if(e){if(wr(e))return vt(e.value);if(Se(e)){const{format:i,formatType:r}=R1(e);return M_({fieldOrDatumDef:e,format:i,formatType:r,expr:n,config:t})}}}function OO(e,t={}){const{encoding:n,markDef:i,config:r,stack:s}=e,o=n.tooltip;if(q(o))return{tooltip:LO({tooltip:o},s,r,t)};{const a=t.reactiveGeom?"datum.datum":"datum";return dc(e,o,"tooltip",l=>{const u=Z1(l,r,a);if(u)return u;if(l===null)return;let c=it("tooltip",i,r);if(c===!0&&(c={content:"encoding"}),te(c))return{value:c};if(re(c))return de(c)?c:c.content==="encoding"?LO(n,s,r,t):{signal:a}})}}function RO(e,t,n,{reactiveGeom:i}={}){const r={...n,...n.tooltipFormat},s={},o=i?"datum.datum":"datum",a=[];function l(c,f){const d=ol(f),h=Un(c)?c:{...c,type:e[d].type},p=h.title||R_(h,r),g=ee(p).join(", ").replaceAll(/"/g,'\\"');let m;if(Nt(f)){const y=f==="x"?"x2":"y2",b=fs(e[y]);if(un(h.bin)&&b){const v=Q(h,{expr:o}),x=Q(b,{expr:o}),{format:_,formatType:k}=R1(h);m=Wd(v,x,_,k,r),s[y]=!0}}if((Nt(f)||f===qi||f===gr)&&t&&t.fieldChannel===f&&t.offset==="normalize"){const{format:y,formatType:b}=R1(h);m=M_({fieldOrDatumDef:h,format:y,formatType:b,expr:o,config:r,normalizeStack:!0}).signal}m??(m=Z1(h,r,o).signal),a.push({channel:f,key:g,value:m})}z_(e,(c,f)=>{Z(c)?l(c,f):D1(c)&&l(c.condition,f)});const u={};for(const{channel:c,key:f,value:d}of a)!s[c]&&!u[f]&&(u[f]=d);return u}function LO(e,t,n,{reactiveGeom:i}={}){const r=RO(e,t,n,{reactiveGeom:i}),s=qo(r).map(([o,a])=>`"${o}": ${a}`);return s.length>0?{signal:`{${s.join(", ")}}`}:void 0}function uge(e){const{markDef:t,config:n}=e,i=it("aria",t,n);return i===!1?{}:{...i?{aria:i}:{},...cge(e),...fge(e)}}function cge(e){const{mark:t,markDef:n,config:i}=e;if(i.aria===!1)return{};const r=it("ariaRoleDescription",n,i);return r!=null?{ariaRoleDescription:{value:r}}:t in Vce?{}:{ariaRoleDescription:{value:t}}}function fge(e){const{encoding:t,markDef:n,config:i,stack:r}=e,s=t.description;if(s)return dc(e,s,"description",l=>Z1(l,e.config));const o=it("description",n,i);if(o!=null)return{description:vt(o)};if(i.aria===!1)return{};const a=RO(t,r,i);if(!ut(a))return{description:{signal:qo(a).map(([l,u],c)=>`"${c>0?"; ":""}${l}: " + (${u})`).join(" + ")}}}function Qt(e,t,n={}){const{markDef:i,encoding:r,config:s}=t,{vgChannel:o}=n;let{defaultRef:a,defaultValue:l}=n;a===void 0&&(l??(l=it(e,i,s,{vgChannel:o,ignoreVgConfig:!0})),l!==void 0&&(a=vt(l)));const u=r[e];return dc(t,u,o??e,c=>T_({channel:e,channelDef:c,markDef:i,config:s,scaleName:t.scaleName(e),scale:t.getScaleComponent(e),stack:null,defaultRef:a}))}function IO(e,t={filled:void 0}){const{markDef:n,encoding:i,config:r}=e,{type:s}=n,o=t.filled??it("filled",n,r),a=Be(["bar","point","circle","square","geoshape"],s)?"transparent":void 0,l=it(o===!0?"color":void 0,n,r,{vgChannel:"fill"})??r.mark[o===!0&&"color"]??a,u=it(o===!1?"color":void 0,n,r,{vgChannel:"stroke"})??r.mark[o===!1&&"color"],c=o?"fill":"stroke",f={...l?{fill:vt(l)}:{},...u?{stroke:vt(u)}:{}};return n.color&&(o?n.fill:n.stroke)&&Y(ED("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,...Qt("color",e,{vgChannel:c,defaultValue:o?l:u}),...Qt("fill",e,{defaultValue:i.fill?l:void 0}),...Qt("stroke",e,{defaultValue:i.stroke?u:void 0})}}function dge(e){const{encoding:t,mark:n}=e,i=t.order;return!Qo(n)&&wr(i)?dc(e,i,"zindex",r=>vt(r.value)):{}}function hc({channel:e,markDef:t,encoding:n={},model:i,bandPosition:r}){const s=`${e}Offset`,o=t[s],a=n[s];if((s==="xOffset"||s==="yOffset")&&a)return{offsetType:"encoding",offset:T_({channel:s,channelDef:a,markDef:t,config:i==null?void 0:i.config,scaleName:i.scaleName(s),scale:i.getScaleComponent(s),stack:null,defaultRef:vt(o),bandPosition:r})};const l=t[s];return l?{offsetType:"visual",offset:l}:{}}function $n(e,t,{defaultPos:n,vgChannel:i}){const{encoding:r,markDef:s,config:o,stack:a}=t,l=r[e],u=r[ss(e)],c=t.scaleName(e),f=t.getScaleComponent(e),{offset:d,offsetType:h}=hc({channel:e,markDef:s,encoding:r,model:t,bandPosition:.5}),p=uw({model:t,defaultPos:n,channel:e,scaleName:c,scale:f}),g=!l&&Nt(e)&&(r.latitude||r.longitude)?{field:t.getName(e)}:hge({channel:e,channelDef:l,channel2Def:u,markDef:s,config:o,scaleName:c,scale:f,stack:a,offset:d,defaultRef:p,bandPosition:h==="encoding"?0:void 0});return g?{[i||e]:g}:void 0}function hge(e){const{channel:t,channelDef:n,scaleName:i,stack:r,offset:s,markDef:o}=e;if(Se(n)&&r&&t===r.fieldChannel){if(Z(n)){let a=n.bandPosition;if(a===void 0&&o.type==="text"&&(t==="radius"||t==="theta")&&(a=.5),a!==void 0)return A1({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",bandPosition:a,offset:s})}return hl(n,i,{suffix:"end"},{offset:s})}return S_(e)}function uw({model:e,defaultPos:t,channel:n,scaleName:i,scale:r}){const{markDef:s,config:o}=e;return()=>{const a=ol(n),l=Yo(n),u=it(n,s,o,{vgChannel:l});if(u!==void 0)return qd(n,u);switch(t){case"zeroOrMin":case"zeroOrMax":if(i){const c=r.get("type");if(!Be([ui.LOG,ui.TIME,ui.UTC],c)){if(r.domainDefinitelyIncludesZero())return{scale:i,value:0}}}if(t==="zeroOrMin")return a==="y"?{field:{group:"height"}}:{value:0};switch(a){case"radius":return{signal:`min(${e.width.signal},${e.height.signal})/2`};case"theta":return{signal:"2*PI"};case"x":return{field:{group:"width"}};case"y":return{value:0}}break;case"mid":return{...e[ai(n)],mult:.5}}}}const pge={left:"x",center:"xc",right:"x2"},gge={top:"y",middle:"yc",bottom:"y2"};function zO(e,t,n,i="middle"){if(e==="radius"||e==="theta")return Yo(e);const r=e==="x"?"align":"baseline",s=it(r,t,n);let o;return de(s)?(Y($fe(r)),o=void 0):o=s,e==="x"?pge[o||(i==="top"?"left":"center")]:gge[o||i]}function K1(e,t,{defaultPos:n,defaultPos2:i,range:r}){return r?PO(e,t,{defaultPos:n,defaultPos2:i}):$n(e,t,{defaultPos:n})}function PO(e,t,{defaultPos:n,defaultPos2:i}){const{markDef:r,config:s}=t,o=ss(e),a=ai(e),l=mge(t,i,o),u=l[a]?zO(e,r,s):Yo(e);return{...$n(e,t,{defaultPos:n,vgChannel:u}),...l}}function mge(e,t,n){const{encoding:i,mark:r,markDef:s,stack:o,config:a}=e,l=ol(n),u=ai(n),c=Yo(n),f=i[l],d=e.scaleName(l),h=e.getScaleComponent(l),{offset:p}=n in i||n in s?hc({channel:n,markDef:s,encoding:i,model:e}):hc({channel:l,markDef:s,encoding:i,model:e});if(!f&&(n==="x2"||n==="y2")&&(i.latitude||i.longitude)){const m=ai(n),y=e.markDef[m];return y!=null?{[m]:{value:y}}:{[c]:{field:e.getName(n)}}}const g=yge({channel:n,channelDef:f,channel2Def:i[n],markDef:s,config:a,scaleName:d,scale:h,stack:o,offset:p,defaultRef:void 0});return g!==void 0?{[c]:g}:J1(n,s)||J1(n,{[n]:v1(n,s,a.style),[u]:v1(u,s,a.style)})||J1(n,a[r])||J1(n,a.mark)||{[c]:uw({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}function yge({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:s,scale:o,stack:a,offset:l,defaultRef:u}){return Se(t)&&a&&e.charAt(0)===a.fieldChannel.charAt(0)?hl(t,s,{suffix:"start"},{offset:l}):S_({channel:e,channelDef:n,scaleName:s,scale:o,stack:a,markDef:i,config:r,offset:l,defaultRef:u})}function J1(e,t){const n=ai(e),i=Yo(e);if(t[i]!==void 0)return{[i]:qd(e,t[i])};if(t[e]!==void 0)return{[i]:qd(e,t[e])};if(t[n]){const r=t[n];if(dl(r))Y(bfe(n));else return{[n]:qd(e,r)}}}function ra(e,t){const{config:n,encoding:i,markDef:r}=e,s=r.type,o=ss(t),a=ai(t),l=i[t],u=i[o],c=e.getScaleComponent(t),f=c?c.get("type"):void 0,d=r.orient,h=i[a]??i.size??it("size",r,n,{vgChannel:a}),p=JF(t),g=s==="bar"&&(t==="x"?d==="vertical":d==="horizontal");return Z(l)&&(mt(l.bin)||un(l.bin)||l.timeUnit&&!u)&&!(h&&!dl(h))&&!i[p]&&!Jt(f)?xge({fieldDef:l,fieldDef2:u,channel:t,model:e}):(Se(l)&&Jt(f)||g)&&!u?vge(l,t,e):PO(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function bge(e,t,n,i,r,s,o){if(dl(r))if(n){const l=n.get("type");if(l==="band"){let u=`bandwidth('${t}')`;r.band!==1&&(u=`${r.band} * ${u}`);const c=Gs("minBandSize",{type:o},i);return{signal:c?`max(${vr(c)}, ${u})`:u}}else r.band!==1&&(Y(Afe(l)),r=void 0)}else return{mult:r.band,field:{group:e}};else{if(de(r))return r;if(r)return{value:r}}if(n){const l=n.get("range");if(Jo(l)&&Xe(l.step))return{value:l.step-2}}if(!s){const{bandPaddingInner:l,barBandPaddingInner:u,rectBandPaddingInner:c}=i.scale,f=Dt(l,o==="bar"?u:c);if(de(f))return{signal:`(1 - (${f.signal})) * ${e}`};if(Xe(f))return{signal:`${1-f} * ${e}`}}return{value:W1(i.view,e)-2}}function vge(e,t,n){var S,E;const{markDef:i,encoding:r,config:s,stack:o}=n,a=i.orient,l=n.scaleName(t),u=n.getScaleComponent(t),c=ai(t),f=ss(t),d=JF(t),h=n.scaleName(d),p=n.getScaleComponent(J7(t)),g=a==="horizontal"&&t==="y"||a==="vertical"&&t==="x";let m;(r.size||i.size)&&(g?m=Qt("size",n,{vgChannel:c,defaultRef:vt(i.size)}):Y(Dfe(i.type)));const y=!!m,b=hN({channel:t,fieldDef:e,markDef:i,config:s,scaleType:(S=u||p)==null?void 0:S.get("type"),useVlSizeChannel:g});m=m||{[c]:bge(c,h||l,p||u,s,b,!!e,i.type)};const v=((E=u||p)==null?void 0:E.get("type"))==="band"&&dl(b)&&!y?"top":"middle",x=zO(t,i,s,v),_=x==="xc"||x==="yc",{offset:k,offsetType:w}=hc({channel:t,markDef:i,encoding:r,model:n,bandPosition:_?.5:0}),$=S_({channel:t,channelDef:e,markDef:i,config:s,scaleName:l,scale:u,stack:o,offset:k,defaultRef:uw({model:n,defaultPos:"mid",channel:t,scaleName:l,scale:u}),bandPosition:_?w==="encoding"?0:.5:de(b)?{signal:`(1-${b})/2`}:dl(b)?(1-b.band)/2:0});if(c)return{[x]:$,...m};{const A=Yo(f),R=m[c],C=k?{...R,offset:k}:R;return{[x]:$,[A]:q($)?[$[0],{...$[1],offset:C}]:{...$,offset:C}}}}function BO(e,t,n,i,r,s,o){if(GF(e))return 0;const a=e==="x"||e==="y2",l=a?-t/2:t/2;if(de(n)||de(r)||de(i)||s){const u=vr(n),c=vr(r),f=vr(i),d=vr(s),p=s?`(${o} < ${d} ? ${a?"":"-"}0.5 * (${d} - (${o})) : ${l})`:l,g=f?`${f} + `:"",m=u?`(${u} ? -1 : 1) * `:"",y=c?`(${c} + ${p})`:p;return{signal:g+m+y}}else return r=r||0,i+(n?-r-l:+r+l)}function xge({fieldDef:e,fieldDef2:t,channel:n,model:i}){var E;const{config:r,markDef:s,encoding:o}=i,a=i.getScaleComponent(n),l=i.scaleName(n),u=a?a.get("type"):void 0,c=a.get("reverse"),f=hN({channel:n,fieldDef:e,markDef:s,config:r,scaleType:u}),d=(E=i.component.axes[n])==null?void 0:E[0],h=(d==null?void 0:d.get("translate"))??.5,p=Nt(n)?it("binSpacing",s,r)??0:0,g=ss(n),m=Yo(n),y=Yo(g),b=Gs("minBandSize",s,r),{offset:v}=hc({channel:n,markDef:s,encoding:o,model:i,bandPosition:0}),{offset:x}=hc({channel:g,markDef:s,encoding:o,model:i,bandPosition:0}),_=Kde({fieldDef:e,scaleName:l}),k=BO(n,p,c,h,v,b,_),w=BO(g,p,c,h,x??v,b,_),$=de(f)?{signal:`(1-${f.signal})/2`}:dl(f)?(1-f.band)/2:.5,S=ea({fieldDef:e,fieldDef2:t,markDef:s,config:r});if(mt(e.bin)||e.timeUnit){const A=e.timeUnit&&S!==.5;return{[y]:jO({fieldDef:e,scaleName:l,bandPosition:$,offset:w,useRectOffsetField:A}),[m]:jO({fieldDef:e,scaleName:l,bandPosition:de($)?{signal:`1-${$.signal}`}:1-$,offset:k,useRectOffsetField:A})}}else if(un(e.bin)){const A=hl(e,l,{},{offset:w});if(Z(t))return{[y]:A,[m]:hl(t,l,{},{offset:k})};if(al(e.bin)&&e.bin.step)return{[y]:A,[m]:{signal:`scale("${l}", ${Q(e,{expr:"datum"})} + ${e.bin.step})`,offset:k}}}Y(MD(g))}function jO({fieldDef:e,scaleName:t,bandPosition:n,offset:i,useRectOffsetField:r}){return A1({scaleName:t,fieldOrDatumDef:e,bandPosition:n,offset:i,...r?{startSuffix:X1,endSuffix:Y1}:{}})}const _ge=new Set(["aria","width","height"]);function Gi(e,t){const{fill:n=void 0,stroke:i=void 0}=t.color==="include"?IO(e):{};return{...wge(e.markDef,t),...UO(e,"fill",n),...UO(e,"stroke",i),...Qt("opacity",e),...Qt("fillOpacity",e),...Qt("strokeOpacity",e),...Qt("strokeWidth",e),...Qt("strokeDash",e),...dge(e),...OO(e),...lw(e,"href"),...uge(e)}}function UO(e,t,n){const{config:i,mark:r,markDef:s}=e;if(it("invalid",s,i)==="hide"&&n&&!Qo(r)){const a=kge(e,{invalid:!0,channels:y1});if(a)return{[t]:[{test:a,value:null},...ee(n)]}}return n?{[t]:n}:{}}function wge(e,t){return Gce.reduce((n,i)=>(!_ge.has(i)&&e[i]!==void 0&&t[i]!=="ignore"&&(n[i]=vt(e[i])),n),{})}function kge(e,{invalid:t=!1,channels:n}){const i=n.reduce((s,o)=>{const a=e.getScaleComponent(o);if(a){const l=a.get("type"),u=e.vgField(o,{expr:"datum"});u&&Ei(l)&&(s[u]=!0)}return s},{}),r=G(i);if(r.length>0){const s=t?"||":"&&";return r.map(o=>A_(o,t)).join(` ${s} `)}}function cw(e){const{config:t,markDef:n}=e;if(it("invalid",n,t)){const r=$ge(e,{channels:os});if(r)return{defined:{signal:r}}}return{}}function $ge(e,{invalid:t=!1,channels:n}){const i=n.reduce((s,o)=>{var l;const a=e.getScaleComponent(o);if(a){const u=a.get("type"),c=e.vgField(o,{expr:"datum",binSuffix:(l=e.stack)!=null&&l.impute?"mid":void 0});c&&Ei(u)&&(s[c]=!0)}return s},{}),r=G(i);if(r.length>0){const s=t?"||":"&&";return r.map(o=>A_(o,t)).join(` ${s} `)}}function qO(e,t){if(t!==void 0)return{[e]:vt(t)}}const fw="voronoi",WO={defined:e=>e.type==="point"&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(fw)},marks:(e,t,n)=>{const{x:i,y:r}=t.project.hasChannel,s=e.mark;if(Qo(s))return Y(Jce(s)),n;const o={name:e.getName(fw),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...OO(e,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:i||!r?"datum.datum.x || 0":"0"},y:{expr:r||!i?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let a=0,l=!1;return n.forEach((u,c)=>{const f=u.name??"";f===e.component.mark[0].name?a=c:f.indexOf(fw)>=0&&(l=!0)}),l||n.splice(a+1,0,o),n}},HO={defined:e=>e.type==="point"&&e.resolve==="global"&&e.bind&&e.bind!=="scales"&&!H_(e.bind),parse:(e,t,n)=>tR(t,n),topLevelSignals:(e,t,n)=>{const i=t.name,r=t.project,s=t.bind,o=t.init&&t.init[0],a=WO.defined(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return r.items.forEach((l,u)=>{const c=_t(`${i}_${l.field}`);n.filter(d=>d.name===c).length||n.unshift({name:c,...o?{init:yl(o[u])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${a}[${J(l.field)}] : null`}]:[],bind:s[l.field]??s[l.channel]??s})}),n},signals:(e,t,n)=>{const i=t.name,r=t.project,s=n.filter(u=>u.name===i+sa)[0],o=i+Zd,a=r.items.map(u=>_t(`${i}_${u.field}`)),l=a.map(u=>`${u} !== null`).join(" && ");return a.length&&(s.update=`${l} ? {fields: ${o}, values: [${a.join(", ")}]} : null`),delete s.value,delete s.on,n}},Q1="_toggle",GO={defined:e=>e.type==="point"&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+Q1,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+sa,i=t.name+Q1;return`${i} ? null : ${n}, `+(t.resolve==="global"?`${i} ? null : true, `:`${i} ? null : {unit: ${vl(e)}}, `)+`${i} ? ${n} : null`}},Ege={defined:e=>e.clear!==void 0&&e.clear!==!1,parse:(e,t)=>{t.clear&&(t.clear=te(t.clear)?jo(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(HO.defined(t))for(const i of t.project.items){const r=n.findIndex(s=>s.name===_t(`${t.name}_${i.field}`));r!==-1&&n[r].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function i(r,s){r!==-1&&n[r].on&&n[r].on.push({events:t.clear,update:s})}if(t.type==="interval")for(const r of t.project.items){const s=n.findIndex(o=>o.name===r.signals.visual);if(i(s,"[0, 0]"),s===-1){const o=n.findIndex(a=>a.name===r.signals.data);i(o,"null")}}else{let r=n.findIndex(s=>s.name===t.name+sa);i(r,"null"),GO.defined(t)&&(r=n.findIndex(s=>s.name===t.name+Q1),i(r,"false"))}return n}},VO={defined:e=>{const t=e.resolve==="global"&&e.bind&&H_(e.bind),n=e.project.items.length===1&&e.project.items[0].field!==kr;return t&&!n&&Y(tfe),t&&n},parse:(e,t,n)=>{const i=Ce(n);if(i.select=te(i.select)?{type:i.select,toggle:t.toggle}:{...i.select,toggle:t.toggle},tR(t,i),re(n.select)&&(n.select.on||n.select.clear)){const o='event.item && indexof(event.item.mark.role, "legend") < 0';for(const a of t.events)a.filter=ee(a.filter??[]),a.filter.includes(o)||a.filter.push(o)}const r=G_(t.bind)?t.bind.legend:"click",s=te(r)?jo(r,"view"):ee(r);t.bind={legend:{merge:s}}},topLevelSignals:(e,t,n)=>{const i=t.name,r=G_(t.bind)&&t.bind.legend,s=o=>a=>{const l=Ce(a);return l.markname=o,l};for(const o of t.project.items){if(!o.hasLegend)continue;const a=`${_t(o.field)}_legend`,l=`${i}_${a}`;if(n.filter(c=>c.name===l).length===0){const c=r.merge.map(s(`${a}_symbols`)).concat(r.merge.map(s(`${a}_labels`))).concat(r.merge.map(s(`${a}_entries`)));n.unshift({name:l,...t.init?{}:{value:null},on:[{events:c,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:r.merge,update:`!event.item || !datum ? null : ${l}`,force:!0}]})}}return n},signals:(e,t,n)=>{const i=t.name,r=t.project,s=n.find(d=>d.name===i+sa),o=i+Zd,a=r.items.filter(d=>d.hasLegend).map(d=>_t(`${i}_${_t(d.field)}_legend`)),u=`${a.map(d=>`${d} !== null`).join(" && ")} ? {fields: ${o}, values: [${a.join(", ")}]} : null`;t.events&&a.length>0?s.on.push({events:a.map(d=>({signal:d})),update:u}):a.length>0&&(s.update=u,delete s.value,delete s.on);const c=n.find(d=>d.name===i+Q1),f=G_(t.bind)&&t.bind.legend;return c&&(t.events?c.on.push({...c.on[0],events:f}):c.on[0].events=f),n}};function Cge(e,t,n){var r;const i=(r=e.fieldDef(t))==null?void 0:r.field;for(const s of ln(e.component.selection??{})){const o=s.project.hasField[i]??s.project.hasChannel[t];if(o&&VO.defined(s)){const a=n.get("selections")??[];a.push(s.name),n.set("selections",a,!1),o.hasLegend=!0}}}const XO="_translate_anchor",YO="_translate_delta",Sge={defined:e=>e.type==="interval"&&e.translate,signals:(e,t,n)=>{const i=t.name,r=Zs.defined(t),s=i+XO,{x:o,y:a}=t.project.hasChannel;let l=jo(t.translate,"scope");return r||(l=l.map(u=>(u.between[0].markname=i+fc,u))),n.push({name:s,value:{},on:[{events:l.map(u=>u.between[0]),update:"{x: x(unit), y: y(unit)"+(o!==void 0?`, extent_x: ${r?aw(e,wt):`slice(${o.signals.visual})`}`:"")+(a!==void 0?`, extent_y: ${r?aw(e,Zt):`slice(${a.signals.visual})`}`:"")+"}"}]},{name:i+YO,value:{},on:[{events:l,update:`{x: ${s}.x - x(unit), y: ${s}.y - y(unit)}`}]}),o!==void 0&&ZO(e,t,o,"width",n),a!==void 0&&ZO(e,t,a,"height",n),n}};function ZO(e,t,n,i,r){const s=t.name,o=s+XO,a=s+YO,l=n.channel,u=Zs.defined(t),c=r.filter(_=>_.name===n.signals[u?"data":"visual"])[0],f=e.getSizeSignalRef(i).signal,d=e.getScaleComponent(l),h=d&&d.get("type"),p=d&&d.get("reverse"),g=u?l===wt?p?"":"-":p?"-":"":"",m=`${o}.extent_${l}`,y=`${g}${a}.${l} / ${u?`${f}`:`span(${m})`}`,b=!u||!d?"panLinear":h==="log"?"panLog":h==="symlog"?"panSymlog":h==="pow"?"panPow":"panLinear",v=u?h==="pow"?`, ${d.get("exponent")??1}`:h==="symlog"?`, ${d.get("constant")??1}`:"":"",x=`${b}(${m}, ${y}${v})`;c.on.push({events:{signal:a},update:u?x:`clampRange(${x}, 0, ${f})`})}const KO="_zoom_anchor",JO="_zoom_delta",Age={defined:e=>e.type==="interval"&&e.zoom,signals:(e,t,n)=>{const i=t.name,r=Zs.defined(t),s=i+JO,{x:o,y:a}=t.project.hasChannel,l=J(e.scaleName(wt)),u=J(e.scaleName(Zt));let c=jo(t.zoom,"scope");return r||(c=c.map(f=>(f.markname=i+fc,f))),n.push({name:i+KO,on:[{events:c,update:r?"{"+[l?`x: invert(${l}, x(unit))`:"",u?`y: invert(${u}, y(unit))`:""].filter(f=>f).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:s,on:[{events:c,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),o!==void 0&&QO(e,t,o,"width",n),a!==void 0&&QO(e,t,a,"height",n),n}};function QO(e,t,n,i,r){const s=t.name,o=n.channel,a=Zs.defined(t),l=r.filter(b=>b.name===n.signals[a?"data":"visual"])[0],u=e.getSizeSignalRef(i).signal,c=e.getScaleComponent(o),f=c&&c.get("type"),d=a?aw(e,o):l.name,h=s+JO,p=`${s}${KO}.${o}`,g=!a||!c?"zoomLinear":f==="log"?"zoomLog":f==="symlog"?"zoomSymlog":f==="pow"?"zoomPow":"zoomLinear",m=a?f==="pow"?`, ${c.get("exponent")??1}`:f==="symlog"?`, ${c.get("constant")??1}`:"":"",y=`${g}(${d}, ${p}, ${h}${m})`;l.on.push({events:{signal:h},update:a?y:`clampRange(${y}, 0, ${u})`})}const bl="_store",sa="_tuple",Tge="_modify",eR="vlSelectionResolve",em=[lge,oge,rge,GO,HO,Zs,VO,Ege,Sge,Age,WO];function Mge(e){let t=e.parent;for(;t&&!Cr(t);)t=t.parent;return t}function vl(e,{escape:t}={escape:!0}){let n=t?J(e.name):e.name;const i=Mge(e);if(i){const{facet:r}=i;for(const s of Hi)r[s]&&(n+=` + '__facet_${s}_' + (facet[${J(i.vgField(s))}])`)}return n}function dw(e){return ln(e.component.selection??{}).reduce((t,n)=>t||n.project.hasSelectionId,!1)}function tR(e,t){(te(t.select)||!t.select.on)&&delete e.events,(te(t.select)||!t.select.clear)&&delete e.clear,(te(t.select)||!t.select.toggle)&&delete e.toggle}function hw(e){const t=[];return e.type==="Identifier"?[e.name]:e.type==="Literal"?[e.value]:(e.type==="MemberExpression"&&(t.push(...hw(e.object)),t.push(...hw(e.property))),t)}function nR(e){return e.object.type==="MemberExpression"?nR(e.object):e.object.name==="datum"}function iR(e){const t=Hx(e),n=new Set;return t.visit(i=>{i.type==="MemberExpression"&&nR(i)&&n.add(hw(i).slice(1).join("."))}),n}class pc extends ot{clone(){return new pc(null,this.model,Ce(this.filter))}constructor(t,n,i){super(t),this.model=n,this.filter=i,this.expr=tm(this.model,this.filter,this),this._dependentFields=iR(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function Fge(e,t){const n={},i=e.config.selection;if(!t||!t.length)return n;for(const r of t){const s=_t(r.name),o=r.select,a=te(o)?o:o.type,l=re(o)?Ce(o):{type:a},u=i[a];for(const d in u)d==="fields"||d==="encodings"||(d==="mark"&&(l[d]={...u[d],...l[d]}),(l[d]===void 0||l[d]===!0)&&(l[d]=Ce(u[d]??l[d])));const c=n[s]={...l,name:s,type:a,init:r.value,bind:r.bind,events:te(l.on)?jo(l.on,"scope"):ee(Ce(l.on))},f=Ce(r);for(const d of em)d.defined(c)&&d.parse&&d.parse(e,c,f)}return n}function rR(e,t,n,i="datum"){const r=te(t)?t:t.param,s=_t(r),o=J(s+bl);let a;try{a=e.getSelectionComponent(s,r)}catch{return`!!${s}`}if(a.project.timeUnit){const d=n??e.component.data.raw,h=a.project.timeUnit.clone();d.parent?h.insertAsParentOf(d):d.parent=h}const l=a.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",u=a.resolve==="global"?")":`, ${J(a.resolve)})`,c=`${l}${o}, ${i}${u}`,f=`length(data(${o}))`;return t.empty===!1?`${f} && ${c}`:`!${f} || ${c}`}function sR(e,t,n){const i=_t(t),r=n.encoding;let s=n.field,o;try{o=e.getSelectionComponent(i,t)}catch{return i}if(!r&&!s)s=o.project.items[0].field,o.project.items.length>1&&Y(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${J(s)}.`);else if(r&&!s){const a=o.project.items.filter(l=>l.channel===r);!a.length||a.length>1?(s=o.project.items[0].field,Y((a.length?"Multiple ":"No ")+`matching ${J(r)} encoding found for selection ${J(n.param)}. Using "field": ${J(s)}.`)):s=a[0].field}return`${o.name}[${J(Ui(s))}]`}function Dge(e,t){for(const[n,i]of qo(e.component.selection??{})){const r=e.getName(`lookup_${n}`);e.component.data.outputNodes[r]=i.materialized=new qn(new pc(t,e,{param:n}),r,yt.Lookup,e.component.data.outputNodeRefCounts)}}function tm(e,t,n){return Od(t,i=>te(i)?i:gde(i)?rR(e,i,n):UD(i))}function Nge(e,t){if(e)return q(e)&&!Ko(e)?e.map(n=>R_(n,t)).join(", "):e}function pw(e,t,n,i){var r,s;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(s=e.encode[t]).update??(s.update={}),e.encode[t].update[n]=i}function Jd(e,t,n,i={header:!1}){var f,d;const{disable:r,orient:s,scale:o,labelExpr:a,title:l,zindex:u,...c}=e.combine();if(!r){for(const h in c){const p=mhe[h],g=c[h];if(p&&p!==t&&p!=="both")delete c[h];else if(Xd(g)){const{condition:m,...y}=g,b=ee(m),v=$N[h];if(v){const{vgProp:x,part:_}=v,k=[...b.map(w=>{const{test:$,...S}=w;return{test:tm(null,$),...S}}),y];pw(c,_,x,k),delete c[h]}else if(v===null){const x={signal:b.map(_=>{const{test:k,...w}=_;return`${tm(null,k)} ? ${uD(w)} : `}).join("")+uD(y)};c[h]=x}}else if(de(g)){const m=$N[h];if(m){const{vgProp:y,part:b}=m;pw(c,b,y,g),delete c[h]}}Be(["labelAlign","labelBaseline"],h)&&c[h]===null&&delete c[h]}if(t==="grid"){if(!c.grid)return;if(c.encode){const{grid:h}=c.encode;c.encode={...h?{grid:h}:{}},ut(c.encode)&&delete c.encode}return{scale:o,orient:s,...c,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:Dt(u,0)}}else{if(!i.header&&e.mainExtracted)return;if(a!==void 0){let p=a;(d=(f=c.encode)==null?void 0:f.labels)!=null&&d.update&&de(c.encode.labels.update.text)&&(p=il(a,"datum.label",c.encode.labels.update.text.signal)),pw(c,"labels","text",{signal:p})}if(c.labelAlign===null&&delete c.labelAlign,c.encode){for(const p of EN)e.hasAxisPart(p)||delete c.encode[p];ut(c.encode)&&delete c.encode}const h=Nge(l,n);return{scale:o,orient:s,grid:!1,...h?{title:h}:{},...c,...n.aria===!1?{aria:!1}:{},zindex:Dt(u,0)}}}}function oR(e){const{axes:t}=e.component,n=[];for(const i of os)if(t[i]){for(const r of t[i])if(!r.get("disable")&&!r.get("gridScale")){const s=i==="x"?"height":"width",o=e.getSizeSignalRef(s).signal;s!==o&&n.push({name:s,update:o})}}return n}function Oge(e,t){const{x:n=[],y:i=[]}=e;return[...n.map(r=>Jd(r,"grid",t)),...i.map(r=>Jd(r,"grid",t)),...n.map(r=>Jd(r,"main",t)),...i.map(r=>Jd(r,"main",t))].filter(r=>r)}function aR(e,t,n,i){return Object.assign.apply(null,[{},...e.map(r=>{if(r==="axisOrient"){const s=n==="x"?"bottom":"left",o=t[n==="x"?"axisBottom":"axisLeft"]||{},a=t[n==="x"?"axisTop":"axisRight"]||{},l=new Set([...G(o),...G(a)]),u={};for(const c of l.values())u[c]={signal:`${i.signal} === "${s}" ? ${vr(o[c])} : ${vr(a[c])}`};return u}return t[r]})])}function Rge(e,t,n,i){const r=t==="band"?["axisDiscrete","axisBand"]:t==="point"?["axisDiscrete","axisPoint"]:VD(t)?["axisQuantitative"]:t==="time"||t==="utc"?["axisTemporal"]:[],s=e==="x"?"axisX":"axisY",o=de(n)?"axisOrient":`axis${Rd(n)}`,a=[...r,...r.map(u=>s+u.substr(4))],l=["axis",o,s];return{vlOnlyAxisConfig:aR(a,i,e,n),vgAxisConfig:aR(l,i,e,n),axisConfigStyle:Lge([...l,...a],i)}}function Lge(e,t){var i;const n=[{}];for(const r of e){let s=(i=t[r])==null?void 0:i.style;if(s){s=ee(s);for(const o of s)n.push(t.style[o])}}return Object.assign.apply(null,n)}function gw(e,t,n,i={}){var s;const r=fD(e,n,t);if(r!==void 0)return{configFrom:"style",configValue:r};for(const o of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(((s=i[o])==null?void 0:s[e])!==void 0)return{configFrom:o,configValue:i[o][e]};return{}}const lR={scale:({model:e,channel:t})=>e.scaleName(t),format:({format:e})=>e,formatType:({formatType:e})=>e,grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>t.grid??Ige(n,e),gridScale:({model:e,channel:t})=>zge(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelAlign||cR(t,n,i),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelBaseline||uR(t,n,i),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??Bge(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??jge(t.type,n,Z(t)&&!!t.timeUnit,Z(t)?t.sort:void 0),orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:i,scaleType:r})=>{const s=e==="x"?"width":e==="y"?"height":void 0,o=s?t.getSizeSignalRef(s):void 0;return n.tickCount??qge({fieldOrDatumDef:i,scaleType:r,size:o,values:n.values})},tickMinStep:Wge,title:({axis:e,model:t,channel:n})=>{if(e.title!==void 0)return e.title;const i=fR(t,n);if(i!==void 0)return i;const r=t.typedFieldDef(n),s=n==="x"?"x2":"y2",o=t.fieldDef(s);return hD(r?[dN(r)]:[],Z(o)?[dN(o)]:[])},values:({axis:e,fieldOrDatumDef:t})=>Hge(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??Gge(n,t)};function Ige(e,t){return!Jt(e)&&Z(t)&&!mt(t==null?void 0:t.bin)&&!un(t==null?void 0:t.bin)}function zge(e,t){const n=t==="x"?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}function Pge(e,t,n,i,r){const s=t==null?void 0:t.labelAngle;if(s!==void 0)return de(s)?s:Ld(s);{const{configValue:o}=gw("labelAngle",i,t==null?void 0:t.style,r);return o!==void 0?Ld(o):n===wt&&Be([__,x_],e.type)&&!(Z(e)&&e.timeUnit)?270:void 0}}function mw(e){return`(((${e.signal} % 360) + 360) % 360)`}function uR(e,t,n,i){if(e!==void 0)if(n==="x"){if(de(e)){const r=mw(e),s=de(t)?`(${t.signal} === "top")`:t==="top";return{signal:`(45 < ${r} && ${r} < 135) || (225 < ${r} && ${r} < 315) ? "middle" :(${r} <= 45 || 315 <= ${r}) === ${s} ? "bottom" : "top"`}}if(45{if(gl(i)&&fN(i.sort)){const{field:s,timeUnit:o}=i,a=i.sort,l=a.map((u,c)=>`${UD({field:s,timeUnit:o,equal:u})} ? ${c} : `).join("")+a.length;t=new gc(t,{calculate:l,as:mc(i,r,{forAs:!0})})}}),t}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${Pe(this.transform)}`}}function mc(e,t,n){return Q(e,{prefix:t,suffix:"sort_index",...n??{}})}function nm(e,t){return Be(["top","bottom"],t)?"column":Be(["left","right"],t)||e==="row"?"row":"column"}function yc(e,t,n,i){const r=i==="row"?n.headerRow:i==="column"?n.headerColumn:n.headerFacet;return Dt((t||{})[e],r[e],n.header[e])}function im(e,t,n,i){const r={};for(const s of e){const o=yc(s,t||{},n,i);o!==void 0&&(r[s]=o)}return r}const yw=["row","column"],bw=["header","footer"];function Vge(e,t){const n=e.component.layoutHeaders[t].title,i=e.config?e.config:void 0,r=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:s,titleAngle:o,titleOrient:a}=im(["titleAnchor","titleAngle","titleOrient"],r.header,i,t),l=nm(t,a),u=Ld(o);return{name:`${t}-title`,type:"group",role:`${l}-title`,title:{text:n,...t==="row"?{orient:"left"}:{},style:"guide-title",...hR(u,l),...dR(l,u,s),...pR(i,r,t,Ihe,WN)}}}function dR(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const i=cR(t,e==="row"?"left":"top",e==="row"?"y":"x");return i?{align:i}:{}}function hR(e,t){const n=uR(e,t==="row"?"left":"top",t==="row"?"y":"x",!0);return n?{baseline:n}:{}}function Xge(e,t){const n=e.component.layoutHeaders[t],i=[];for(const r of bw)if(n[r])for(const s of n[r]){const o=Zge(e,t,r,n,s);o!=null&&i.push(o)}return i}function Yge(e,t){const{sort:n}=e;return us(n)?{field:Q(n,{expr:"datum"}),order:n.order??"ascending"}:q(n)?{field:mc(e,t,{expr:"datum"}),order:"ascending"}:{field:Q(e,{expr:"datum"}),order:n??"ascending"}}function vw(e,t,n){const{format:i,formatType:r,labelAngle:s,labelAnchor:o,labelOrient:a,labelExpr:l}=im(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),u=M_({fieldOrDatumDef:e,format:i,formatType:r,expr:"parent",config:n}).signal,c=nm(t,a);return{text:{signal:l?il(il(l,"datum.label",u),"datum.value",Q(e,{expr:"parent"})):u},...t==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",...hR(s,c),...dR(c,s,o),...pR(n,e,t,zhe,HN)}}function Zge(e,t,n,i,r){if(r){let s=null;const{facetFieldDef:o}=i,a=e.config?e.config:void 0;if(o&&r.labels){const{labelOrient:f}=im(["labelOrient"],o.header,a,t);(t==="row"&&!Be(["top","bottom"],f)||t==="column"&&!Be(["left","right"],f))&&(s=vw(o,t,a))}const l=Cr(e)&&!Hd(e.facet),u=r.axes,c=(u==null?void 0:u.length)>0;if(s||c){const f=t==="row"?"height":"width";return{name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`,...i.facetFieldDef?{from:{data:e.getName(`${t}_domain`)},sort:Yge(o,t)}:{},...c&&l?{from:{data:e.getName(`facet_domain_${t}`)}}:{},...s?{title:s}:{},...r.sizeSignal?{encode:{update:{[f]:r.sizeSignal}}}:{},...c?{axes:u}:{}}}}return null}const Kge={column:{start:0,end:1},row:{start:1,end:0}};function Jge(e,t){return Kge[t][e]}function Qge(e,t){const n={};for(const i of Hi){const r=e[i];if(r!=null&&r.facetFieldDef){const{titleAnchor:s,titleOrient:o}=im(["titleAnchor","titleOrient"],r.facetFieldDef.header,t,i),a=nm(i,o),l=Jge(s,a);l!==void 0&&(n[a]=l)}}return ut(n)?void 0:n}function pR(e,t,n,i,r){const s={};for(const o of i){if(!r[o])continue;const a=yc(o,t==null?void 0:t.header,e,n);a!==void 0&&(s[r[o]]=a)}return s}function xw(e){return[...rm(e,"width"),...rm(e,"height"),...rm(e,"childWidth"),...rm(e,"childHeight")]}function rm(e,t){const n=t==="width"?"x":"y",i=e.component.layoutSize.get(t);if(!i||i==="merged")return[];const r=e.getSizeSignalRef(t).signal;if(i==="step"){const s=e.getScaleComponent(n);if(s){const o=s.get("type"),a=s.get("range");if(Jt(o)&&Jo(a)){const l=e.scaleName(n);return Cr(e.parent)&&e.parent.component.resolve.scale[n]==="independent"?[gR(l,a)]:[gR(l,a),{name:r,update:mR(l,s,`domain('${l}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}else if(i=="container"){const s=r.endsWith("width"),o=s?"containerSize()[0]":"containerSize()[1]",a=Z_(e.config.view,s?"width":"height"),l=`isFinite(${o}) ? ${o} : ${a}`;return[{name:r,init:l,on:[{update:l,events:"window:resize"}]}]}else return[{name:r,value:i}]}function gR(e,t){const n=`${e}_step`;return de(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function mR(e,t,n){const i=t.get("type"),r=t.get("padding"),s=Dt(t.get("paddingOuter"),r);let o=t.get("paddingInner");return o=i==="band"?o!==void 0?o:r:1,`bandspace(${n}, ${vr(o)}, ${vr(s)}) * ${e}_step`}function yR(e){return e==="childWidth"?"width":e==="childHeight"?"height":e}function bR(e,t){return G(e).reduce((n,i)=>{const r=e[i];return{...n,...dc(t,r,i,s=>vt(s.value))}},{})}function vR(e,t){if(Cr(t))return e==="theta"?"independent":"shared";if(xc(t))return"shared";if(Rw(t))return Nt(e)||e==="theta"||e==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function _w(e,t){const n=e.scale[t],i=Nt(t)?"axis":"legend";return n==="independent"?(e[i][t]==="shared"&&Y(Ife(t)),"independent"):e[i][t]||"shared"}const e0e={...Bhe,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},xR=G(e0e);class t0e extends Ys{}const _R={symbols:n0e,gradient:i0e,labels:r0e,entries:s0e};function n0e(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r,legendType:s}){if(s!=="symbol")return;const{markDef:o,encoding:a,config:l,mark:u}=n,c=o.filled&&u!=="trail";let f={...Yce({},n,Bde),...IO(n,{filled:c})};const d=r.get("symbolOpacity")??l.legend.symbolOpacity,h=r.get("symbolFillColor")??l.legend.symbolFillColor,p=r.get("symbolStrokeColor")??l.legend.symbolStrokeColor,g=d===void 0?wR(a.opacity)??o.opacity:void 0;if(f.fill){if(i==="fill"||c&&i===si)delete f.fill;else if(f.fill.field)h?delete f.fill:(f.fill=vt(l.legend.symbolBaseFillColor??"black"),f.fillOpacity=vt(g??1));else if(q(f.fill)){const m=ww(a.fill??a.color)??o.fill??(c&&o.color);m&&(f.fill=vt(m))}}if(f.stroke){if(i==="stroke"||!c&&i===si)delete f.stroke;else if(f.stroke.field||p)delete f.stroke;else if(q(f.stroke)){const m=Dt(ww(a.stroke||a.color),o.stroke,c?o.color:void 0);m&&(f.stroke={value:m})}}if(i!==Us){const m=Z(t)&&$R(n,r,t);m?f.opacity=[{test:m,...vt(g??1)},vt(l.legend.unselectedOpacity)]:g&&(f.opacity=vt(g))}return f={...f,...e},ut(f)?void 0:f}function i0e(e,{model:t,legendType:n,legendCmpt:i}){if(n!=="gradient")return;const{config:r,markDef:s,encoding:o}=t;let a={};const u=(i.get("gradientOpacity")??r.legend.gradientOpacity)===void 0?wR(o.opacity)||s.opacity:void 0;return u&&(a.opacity=vt(u)),a={...a,...e},ut(a)?void 0:a}function r0e(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r}){const s=n.legend(i)||{},o=n.config,a=Z(t)?$R(n,r,t):void 0,l=a?[{test:a,value:1},{value:o.legend.unselectedOpacity}]:void 0,{format:u,formatType:c}=s;let f;pl(c)?f=_r({fieldOrDatumDef:t,field:"datum.value",format:u,formatType:c,config:o}):u===void 0&&c===void 0&&o.customFormatTypes&&(t.type==="quantitative"&&o.numberFormatType?f=_r({fieldOrDatumDef:t,field:"datum.value",format:o.numberFormat,formatType:o.numberFormatType,config:o}):t.type==="temporal"&&o.timeFormatType&&Z(t)&&t.timeUnit===void 0&&(f=_r({fieldOrDatumDef:t,field:"datum.value",format:o.timeFormat,formatType:o.timeFormatType,config:o})));const d={...l?{opacity:l}:{},...f?{text:f}:{},...e};return ut(d)?void 0:d}function s0e(e,{legendCmpt:t}){const n=t.get("selections");return n!=null&&n.length?{...e,fill:{value:"transparent"}}:e}function wR(e){return kR(e,(t,n)=>Math.max(t,n.value))}function ww(e){return kR(e,(t,n)=>Dt(t,n.value))}function kR(e,t){if(rhe(e))return ee(e.condition).reduce(t,e.value);if(wr(e))return e.value}function $R(e,t,n){const i=t.get("selections");if(!(i!=null&&i.length))return;const r=J(n.field);return i.map(s=>`(!length(data(${J(_t(s)+bl)})) || (${s}[${r}] && indexof(${s}[${r}], datum.value) >= 0))`).join(" || ")}const ER={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:i,formatType:r}=t;return sN(e,e.type,i,r,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:i}=e;return oN(i,t,n)},gradientLength:e=>{const{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??d0e(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??h0e(n),symbolType:({legend:e,markDef:t,channel:n,encoding:i})=>e.symbolType??a0e(t.type,n,i.shape,t.shape),title:({fieldOrDatumDef:e,config:t})=>oc(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(Qu(n)&&xr(t)){if(e==="gradient")return}else if(e==="symbol")return;return e},values:({fieldOrDatumDef:e,legend:t})=>o0e(t,e)};function o0e(e,t){const n=e.values;if(q(n))return kN(t,n);if(de(n))return n}function a0e(e,t,n,i){if(t!=="shape"){const r=ww(n)??i;if(r)return r}switch(e){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}function l0e(e){const{legend:t}=e;return Dt(t.type,u0e(e))}function u0e({channel:e,timeUnit:t,scaleType:n}){if(Qu(e)){if(Be(["quarter","month","day"],t))return"symbol";if(xr(n))return"gradient"}return"symbol"}function c0e({legendConfig:e,legendType:t,orient:n,legend:i}){return i.direction??e[t?"gradientDirection":"symbolDirection"]??f0e(n,t)}function f0e(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return t==="gradient"?"horizontal":void 0}}function d0e({legendConfig:e,model:t,direction:n,orient:i,scaleType:r}){const{gradientHorizontalMaxLength:s,gradientHorizontalMinLength:o,gradientVerticalMaxLength:a,gradientVerticalMinLength:l}=e;if(xr(r))return n==="horizontal"?i==="top"||i==="bottom"?CR(t,"width",o,s):o:CR(t,"height",l,a)}function CR(e,t,n,i){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${i})`}}function h0e(e){if(Be(["quantile","threshold","log","symlog"],e))return"greedy"}function SR(e){const t=At(e)?p0e(e):b0e(e);return e.component.legends=t,t}function p0e(e){const{encoding:t}=e,n={};for(const i of[si,...VN]){const r=Ut(t[i]);!r||!e.getScaleComponent(i)||i===oi&&Z(r)&&r.type===nc||(n[i]=y0e(e,i))}return n}function g0e(e,t){const n=e.scaleName(t);if(e.mark==="trail"){if(t==="color")return{stroke:n};if(t==="size")return{strokeWidth:n}}return t==="color"?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}function m0e(e,t,n,i){switch(t){case"disable":return n!==void 0;case"values":return!!(n!=null&&n.values);case"title":if(t==="title"&&e===(i==null?void 0:i.title))return!0}return e===(n||{})[t]}function y0e(e,t){var x;let n=e.legend(t);const{markDef:i,encoding:r,config:s}=e,o=s.legend,a=new t0e({},g0e(e,t));Cge(e,t,a);const l=n!==void 0?!n:o.disable;if(a.set("disable",l,n!==void 0),l)return a;n=n||{};const u=e.getScaleComponent(t).get("type"),c=Ut(r[t]),f=Z(c)?(x=Kt(c.timeUnit))==null?void 0:x.unit:void 0,d=n.orient||s.legend.orient||"right",h=l0e({legend:n,channel:t,timeUnit:f,scaleType:u}),p=c0e({legend:n,legendType:h,orient:d,legendConfig:o}),g={legend:n,channel:t,model:e,markDef:i,encoding:r,fieldOrDatumDef:c,legendConfig:o,config:s,scaleType:u,orient:d,legendType:h,direction:p};for(const _ of xR){if(h==="gradient"&&_.startsWith("symbol")||h==="symbol"&&_.startsWith("gradient"))continue;const k=_ in ER?ER[_](g):n[_];if(k!==void 0){const w=m0e(k,_,n,e.fieldDef(t));(w||s.legend[_]===void 0)&&a.set(_,k,w)}}const m=(n==null?void 0:n.encoding)??{},y=a.get("selections"),b={},v={fieldOrDatumDef:c,model:e,channel:t,legendCmpt:a,legendType:h};for(const _ of["labels","legend","title","symbols","gradient","entries"]){const k=bR(m[_]??{},e),w=_ in _R?_R[_](k,v):k;w!==void 0&&!ut(w)&&(b[_]={...y!=null&&y.length&&Z(c)?{name:`${_t(c.field)}_legend_${_}`}:{},...y!=null&&y.length?{interactive:!!y}:{},update:w})}return ut(b)||a.set("encode",b,!!(n!=null&&n.encoding)),a}function b0e(e){const{legends:t,resolve:n}=e.component;for(const i of e.children){SR(i);for(const r of G(i.component.legends))n.legend[r]=_w(e.component.resolve,r),n.legend[r]==="shared"&&(t[r]=AR(t[r],i.component.legends[r]),t[r]||(n.legend[r]="independent",delete t[r]))}for(const i of G(t))for(const r of e.children)r.component.legends[i]&&n.legend[i]==="shared"&&delete r.component.legends[i];return t}function AR(e,t){var s,o,a,l;if(!e)return t.clone();const n=e.getWithExplicit("orient"),i=t.getWithExplicit("orient");if(n.explicit&&i.explicit&&n.value!==i.value)return;let r=!1;for(const u of xR){const c=na(e.getWithExplicit(u),t.getWithExplicit(u),u,"legend",(f,d)=>{switch(u){case"symbolType":return v0e(f,d);case"title":return gD(f,d);case"type":return r=!0,Ci("symbol")}return V1(f,d,u,"legend")});e.setWithExplicit(u,c)}return r&&((o=(s=e.implicit)==null?void 0:s.encode)!=null&&o.gradient&&u1(e.implicit,["encode","gradient"]),(l=(a=e.explicit)==null?void 0:a.encode)!=null&&l.gradient&&u1(e.explicit,["encode","gradient"])),e}function v0e(e,t){return t.value==="circle"?t:e}function x0e(e,t,n,i){var r,s;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(s=e.encode[t]).update??(s.update={}),e.encode[t].update[n]=i}function TR(e){const t=e.component.legends,n={};for(const r of G(t)){const s=e.getScaleComponent(r),o=ct(s.get("domains"));if(n[o])for(const a of n[o])AR(a,t[r])||n[o].push(t[r]);else n[o]=[t[r].clone()]}return ln(n).flat().map(r=>_0e(r,e.config)).filter(r=>r!==void 0)}function _0e(e,t){var o,a,l;const{disable:n,labelExpr:i,selections:r,...s}=e.combine();if(!n){if(t.aria===!1&&s.aria==null&&(s.aria=!1),(o=s.encode)!=null&&o.symbols){const u=s.encode.symbols.update;u.fill&&u.fill.value!=="transparent"&&!u.stroke&&!s.stroke&&(u.stroke={value:"transparent"});for(const c of VN)s[c]&&delete u[c]}if(s.title||delete s.title,i!==void 0){let u=i;(l=(a=s.encode)==null?void 0:a.labels)!=null&&l.update&&de(s.encode.labels.update.text)&&(u=il(i,"datum.label",s.encode.labels.update.text.signal)),x0e(s,"labels","text",{signal:u})}return s}}function w0e(e){return xc(e)||Rw(e)?k0e(e):MR(e)}function k0e(e){return e.children.reduce((t,n)=>t.concat(n.assembleProjections()),MR(e))}function MR(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:i}=n;if(t.data){const r={signal:`[${t.size.map(o=>o.signal).join(", ")}]`},s=t.data.reduce((o,a)=>{const l=de(a)?a.signal:`data('${e.lookupDataSource(a)}')`;return Be(o,l)||o.push(l),o},[]);if(s.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:i,size:r,fit:{signal:s.length>1?`[${s.join(", ")}]`:s[0]},...n}]}else return[{name:i,translate:{signal:"[width / 2, height / 2]"},...n}]}const $0e=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class FR extends Ys{constructor(t,n,i,r){super({...n},{name:t}),this.specifiedProjection=n,this.size=i,this.data=r,this.merged=!1}get isFit(){return!!this.data}}function DR(e){e.component.projection=At(e)?E0e(e):A0e(e)}function E0e(e){if(e.hasProjection){const t=li(e.specifiedProjection),n=!(t&&(t.scale!=null||t.translate!=null)),i=n?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,r=n?C0e(e):void 0,s=new FR(e.projectionName(!0),{...li(e.config.projection)??{},...t??{}},i,r);return s.get("type")||s.set("type","equalEarth",!1),s}}function C0e(e){const t=[],{encoding:n}=e;for(const i of[[yr,mr],[Wi,br]])(Ut(n[i[0]])||Ut(n[i[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(oi)&&e.typedFieldDef(oi).type===nc&&t.push({signal:e.getName(`geojson_${t.length}`)}),t.length===0&&t.push(e.requestDataName(yt.Main)),t}function S0e(e,t){const n=q7($0e,r=>!!(!me(e.explicit,r)&&!me(t.explicit,r)||me(e.explicit,r)&&me(t.explicit,r)&&ki(e.get(r),t.get(r))));if(ki(e.size,t.size)){if(n)return e;if(ki(e.explicit,{}))return t;if(ki(t.explicit,{}))return e}return null}function A0e(e){if(e.children.length===0)return;let t;for(const i of e.children)DR(i);const n=q7(e.children,i=>{const r=i.component.projection;if(r)if(t){const s=S0e(t,r);return s&&(t=s),!!s}else return t=r,!0;else return!0});if(t&&n){const i=e.projectionName(!0),r=new FR(i,t.specifiedProjection,t.size,Ce(t.data));for(const s of e.children){const o=s.component.projection;o&&(o.isFit&&r.data.push(...s.component.projection.data),s.renameProjection(o.get("name"),i),o.merged=!0)}return r}}function T0e(e,t,n,i){if(Vd(t,n)){const r=At(e)?e.axis(n)??e.legend(n)??{}:{},s=Q(t,{expr:"datum"}),o=Q(t,{expr:"datum",binSuffix:"end"});return{formulaAs:Q(t,{binSuffix:"range",forAs:!0}),formula:Wd(s,o,r.format,r.formatType,i)}}return{}}function NR(e,t){return`${rD(e)}_${t}`}function M0e(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}function kw(e,t,n){const i=I1(n,void 0)??{},r=NR(i,t);return e.getName(`${r}_bins`)}function F0e(e){return"as"in e}function OR(e,t,n){let i,r;F0e(e)?i=te(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:i=[Q(e,{forAs:!0}),Q(e,{binSuffix:"end",forAs:!0})];const s={...I1(t,void 0)},o=NR(s,e.field),{signal:a,extentSignal:l}=M0e(n,o);if(b1(s.extent)){const c=s.extent;r=sR(n,c.param,c),delete s.extent}const u={bin:s,field:e.field,as:[i],...a?{signal:a}:{},...l?{extentSignal:l}:{},...r?{span:r}:{}};return{key:o,binComponent:u}}class gs extends ot{clone(){return new gs(null,Ce(this.bins))}constructor(t,n){super(t),this.bins=n}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,s,o)=>{if(Un(s)&&mt(s.bin)){const{key:a,binComponent:l}=OR(s,s.bin,n);r[a]={...l,...r[a],...T0e(n,s,o,n.config)}}return r},{});return ut(i)?null:new gs(t,i)}static makeFromTransform(t,n,i){const{key:r,binComponent:s}=OR(n,n.bin,i);return new gs(t,{[r]:s})}merge(t,n){for(const i of G(t.bins))i in this.bins?(n(t.bins[i].signal,this.bins[i].signal),this.bins[i].as=ts([...this.bins[i].as,...t.bins[i].as],Pe)):this.bins[i]=t.bins[i];for(const i of t.children)t.removeChild(i),i.parent=this;t.remove()}producedFields(){return new Set(ln(this.bins).map(t=>t.as).flat(2))}dependentFields(){return new Set(ln(this.bins).map(t=>t.field))}hash(){return`Bin ${Pe(this.bins)}`}assemble(){return ln(this.bins).flatMap(t=>{const n=[],[i,...r]=t.as,{extent:s,...o}=t.bin,a={type:"bin",field:Ui(t.field),as:i,signal:t.signal,...b1(s)?{extent:null}:{extent:s},...t.span?{span:{signal:`span(${t.span})`}}:{},...o};!s&&t.extentSignal&&(n.push({type:"extent",field:Ui(t.field),signal:t.extentSignal}),a.extent={signal:t.extentSignal}),n.push(a);for(const l of r)for(let u=0;u<2;u++)n.push({type:"formula",expr:Q({field:i[u]},{expr:"datum"}),as:l[u]});return t.formula&&n.push({type:"formula",expr:t.formula,as:t.formulaAs}),n})}}function D0e(e,t,n,i){var s;const r=At(i)?i.encoding[ss(t)]:void 0;if(Un(n)&&At(i)&&pN(n,r,i.markDef,i.config)){e.add(Q(n,{})),e.add(Q(n,{suffix:"end"}));const{mark:o,markDef:a,config:l}=i,u=ea({fieldDef:n,markDef:a,config:l});Ud(o)&&u!==.5&&Nt(t)&&(e.add(Q(n,{suffix:X1})),e.add(Q(n,{suffix:Y1}))),n.bin&&Vd(n,t)&&e.add(Q(n,{binSuffix:"range"}))}else if(XF(t)){const o=VF(t);e.add(i.getName(o))}else e.add(Q(n));return gl(n)&&Ade((s=n.scale)==null?void 0:s.range)&&e.add(n.scale.range.field),e}function N0e(e,t){for(const n of G(t)){const i=t[n];for(const r of G(i))n in e?e[n][r]=new Set([...e[n][r]??[],...i[r]]):e[n]={[r]:i[r]}}}class $r extends ot{clone(){return new $r(null,new Set(this.dimensions),Ce(this.measures))}constructor(t,n,i){super(t),this.dimensions=n,this.measures=i}get groupBy(){return this.dimensions}static makeFromEncoding(t,n){let i=!1;n.forEachFieldDef(o=>{o.aggregate&&(i=!0)});const r={},s=new Set;return!i||(n.forEachFieldDef((o,a)=>{const{aggregate:l,field:u}=o;if(l)if(l==="count")r["*"]??(r["*"]={}),r["*"].count=new Set([Q(o,{forAs:!0})]);else{if(Ws(l)||Zo(l)){const c=Ws(l)?"argmin":"argmax",f=l[c];r[f]??(r[f]={}),r[f][c]=new Set([Q({op:c,field:f},{forAs:!0})])}else r[u]??(r[u]={}),r[u][l]=new Set([Q(o,{forAs:!0})]);qs(a)&&n.scaleDomain(a)==="unaggregated"&&(r[u]??(r[u]={}),r[u].min=new Set([Q({field:u,aggregate:"min"},{forAs:!0})]),r[u].max=new Set([Q({field:u,aggregate:"max"},{forAs:!0})]))}else D0e(s,a,o,n)}),s.size+G(r).length===0)?null:new $r(t,s,r)}static makeFromTransform(t,n){const i=new Set,r={};for(const s of n.aggregate){const{op:o,field:a,as:l}=s;o&&(o==="count"?(r["*"]??(r["*"]={}),r["*"].count=new Set([l||Q(s,{forAs:!0})])):(r[a]??(r[a]={}),r[a][o]=new Set([l||Q(s,{forAs:!0})])))}for(const s of n.groupby??[])i.add(s);return i.size+G(r).length===0?null:new $r(t,i,r)}merge(t){return zF(this.dimensions,t.dimensions)?(N0e(this.measures,t.measures),!0):(Qfe("different dimensions, cannot merge"),!1)}addDimensions(t){t.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...G(this.measures)])}producedFields(){const t=new Set;for(const n of G(this.measures))for(const i of G(this.measures[n])){const r=this.measures[n][i];r.size===0?t.add(`${i}_${n}`):r.forEach(t.add,t)}return t}hash(){return`Aggregate ${Pe({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const t=[],n=[],i=[];for(const s of G(this.measures))for(const o of G(this.measures[s]))for(const a of this.measures[s][o])i.push(a),t.push(o),n.push(s==="*"?null:Ui(s));return{type:"aggregate",groupby:[...this.dimensions].map(Ui),ops:t,fields:n,as:i}}}class bc extends ot{constructor(t,n,i,r){super(t),this.model=n,this.name=i,this.data=r;for(const s of Hi){const o=n.facet[s];if(o){const{bin:a,sort:l}=o;this[s]={name:n.getName(`${s}_domain`),fields:[Q(o),...mt(a)?[Q(o,{binSuffix:"end"})]:[]],...us(l)?{sortField:l}:q(l)?{sortIndexField:mc(o,s)}:{}}}}this.childModel=n.child}hash(){let t="Facet";for(const n of Hi)this[n]&&(t+=` ${n.charAt(0)}:${Pe(this[n])}`);return t}get fields(){var n;const t=[];for(const i of Hi)(n=this[i])!=null&&n.fields&&t.push(...this[i].fields);return t}dependentFields(){const t=new Set(this.fields);for(const n of Hi)this[n]&&(this[n].sortField&&t.add(this[n].sortField.field),this[n].sortIndexField&&t.add(this[n].sortIndexField));return t}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const t={};for(const n of os){const i=this.childModel.component.scales[n];if(i&&!i.merged){const r=i.get("type"),s=i.get("range");if(Jt(r)&&Jo(s)){const o=om(this.childModel,n),a=Nw(o);a?t[n]=a:Y(o_(n))}}}return t}assembleRowColumnHeaderData(t,n,i){const r={row:"y",column:"x",facet:void 0}[t],s=[],o=[],a=[];r&&i&&i[r]&&(n?(s.push(`distinct_${i[r]}`),o.push("max")):(s.push(i[r]),o.push("distinct")),a.push(`distinct_${i[r]}`));const{sortField:l,sortIndexField:u}=this[t];if(l){const{op:c=T1,field:f}=l;s.push(f),o.push(c),a.push(Q(l,{forAs:!0}))}else u&&(s.push(u),o.push("max"),a.push(u));return{name:this[t].name,source:n??this.data,transform:[{type:"aggregate",groupby:this[t].fields,...s.length?{fields:s,ops:o,as:a}:{}}]}}assembleFacetHeaderData(t){var l;const{columns:n}=this.model.layout,{layoutHeaders:i}=this.model.component,r=[],s={};for(const u of yw){for(const c of bw){const f=(i[u]&&i[u][c])??[];for(const d of f)if(((l=d.axes)==null?void 0:l.length)>0){s[u]=!0;break}}if(s[u]){const c=`length(data("${this.facet.name}"))`,f=u==="row"?n?{signal:`ceil(${c} / ${n})`}:1:n?{signal:`min(${c}, ${n})`}:{signal:c};r.push({name:`${this.facet.name}_${u}`,transform:[{type:"sequence",start:0,stop:f}]})}}const{row:o,column:a}=s;return(o||a)&&r.unshift(this.assembleRowColumnHeaderData("facet",null,t)),r}assemble(){const t=[];let n=null;const i=this.getChildIndependentFieldsWithStep(),{column:r,row:s,facet:o}=this;if(r&&s&&(i.x||i.y)){n=`cross_${this.column.name}_${this.row.name}`;const a=[].concat(i.x??[],i.y??[]),l=a.map(()=>"distinct");t.push({name:n,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:a,ops:l}]})}for(const a of[zs,Is])this[a]&&t.push(this.assembleRowColumnHeaderData(a,n,i));if(o){const a=this.assembleFacetHeaderData(i);a&&t.push(...a)}return t}}function RR(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function O0e(e,t){const n=V7(e);if(t==="number")return`toNumber(${n})`;if(t==="boolean")return`toBoolean(${n})`;if(t==="string")return`toString(${n})`;if(t==="date")return`toDate(${n})`;if(t==="flatten")return n;if(t.startsWith("date:")){const i=RR(t.slice(5,t.length));return`timeParse(${n},'${i}')`}else if(t.startsWith("utc:")){const i=RR(t.slice(4,t.length));return`utcParse(${n},'${i}')`}else return Y(lfe(t)),null}function R0e(e){const t={};return l1(e.filter,n=>{if(jD(n)){let i=null;d_(n)?i=$i(n.equal):p_(n)?i=$i(n.lte):h_(n)?i=$i(n.lt):g_(n)?i=$i(n.gt):m_(n)?i=$i(n.gte):y_(n)?i=n.range[0]:b_(n)&&(i=(n.oneOf??n.in)[0]),i&&(ll(i)?t[n.field]="date":Xe(i)?t[n.field]="number":te(i)&&(t[n.field]="string")),n.timeUnit&&(t[n.field]="date")}}),t}function L0e(e){const t={};function n(i){lc(i)?t[i.field]="date":i.type==="quantitative"&&jce(i.aggregate)?t[i.field]="number":Zu(i.field)>1?i.field in t||(t[i.field]="flatten"):gl(i)&&us(i.sort)&&Zu(i.sort.field)>1&&(i.sort.field in t||(t[i.sort.field]="flatten"))}if((At(e)||Cr(e))&&e.forEachFieldDef((i,r)=>{if(Un(i))n(i);else{const s=ol(r),o=e.fieldDef(s);n({...i,type:o.type})}}),At(e)){const{mark:i,markDef:r,encoding:s}=e;if(Qo(i)&&!e.encoding.order){const o=r.orient==="horizontal"?"y":"x",a=s[o];Z(a)&&a.type==="quantitative"&&!(a.field in t)&&(t[a.field]="number")}}return t}function I0e(e){const t={};if(At(e)&&e.component.selection)for(const n of G(e.component.selection)){const i=e.component.selection[n];for(const r of i.project.items)!r.channel&&Zu(r.field)>1&&(t[r.field]="flatten")}return t}class En extends ot{clone(){return new En(null,Ce(this._parse))}constructor(t,n){super(t),this._parse=n}hash(){return`Parse ${Pe(this._parse)}`}static makeExplicit(t,n,i){var o;let r={};const s=n.data;return!ia(s)&&((o=s==null?void 0:s.format)!=null&&o.parse)&&(r=s.format.parse),this.makeWithAncestors(t,r,{},i)}static makeWithAncestors(t,n,i,r){for(const a of G(i)){const l=r.getWithExplicit(a);l.value!==void 0&&(l.explicit||l.value===i[a]||l.value==="derived"||i[a]==="flatten"?delete i[a]:Y(wD(a,i[a],l.value)))}for(const a of G(n)){const l=r.get(a);l!==void 0&&(l===n[a]?delete n[a]:Y(wD(a,n[a],l)))}const s=new Ys(n,i);r.copyAll(s);const o={};for(const a of G(s.combine())){const l=s.get(a);l!==null&&(o[a]=l)}return G(o).length===0||r.parseNothing?null:new En(t,o)}get parse(){return this._parse}merge(t){this._parse={...this._parse,...t.parse},t.remove()}assembleFormatParse(){const t={};for(const n of G(this._parse)){const i=this._parse[n];Zu(n)===1&&(t[n]=i)}return t}producedFields(){return new Set(G(this._parse))}dependentFields(){return new Set(G(this._parse))}assembleTransforms(t=!1){return G(this._parse).filter(n=>t?Zu(n)>1:!0).map(n=>{const i=O0e(n,this._parse[n]);return i?{type:"formula",expr:i,as:X7(n)}:null}).filter(n=>n!==null)}}class oa extends ot{clone(){return new oa(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([kr])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:kr}}}class Qd extends ot{clone(){return new Qd(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${Pe(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}}class eh extends ot{clone(){return new eh(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${Pe(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class xl extends ot{constructor(t){super(null),t??(t={name:"source"});let n;if(ia(t)||(n=t.format?{...ri(t.format,["parse"])}:{}),Yd(t))this._data={values:t.values};else if(cc(t)){if(this._data={url:t.url},!n.type){let i=/(?:\.([^.]+))?$/.exec(t.url)[1];Be(["json","csv","tsv","dsv","topojson"],i)||(i="json"),n.type=i}}else $O(t)?this._data={values:[{type:"Sphere"}]}:(wO(t)||ia(t))&&(this._data={});this._generator=ia(t),t.name&&(this._name=t.name),n&&!ut(n)&&(this._data.format=n)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(t){this._name=t}set parent(t){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return{name:this._name,...this._data,transform:[]}}}var LR=function(e,t,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n},z0e=function(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)},th;function $w(e){return e instanceof xl||e instanceof Qd||e instanceof eh}class Ew{constructor(){th.set(this,void 0),LR(this,th,!1,"f")}setModified(){LR(this,th,!0,"f")}get modifiedFlag(){return z0e(this,th,"f")}}th=new WeakMap;class _l extends Ew{getNodeDepths(t,n,i){i.set(t,n);for(const r of t.children)this.getNodeDepths(r,n+1,i);return i}optimize(t){const i=[...this.getNodeDepths(t,0,new Map).entries()].sort((r,s)=>s[1]-r[1]);for(const r of i)this.run(r[0]);return this.modifiedFlag}}class Cw extends Ew{optimize(t){this.run(t);for(const n of t.children)this.optimize(n);return this.modifiedFlag}}class P0e extends Cw{mergeNodes(t,n){const i=n.shift();for(const r of n)t.removeChild(r),r.parent=i,r.remove()}run(t){const n=t.children.map(r=>r.hash()),i={};for(let r=0;r1&&(this.setModified(),this.mergeNodes(t,i[r]))}}class B0e extends Cw{constructor(t){super(),this.requiresSelectionId=t&&dw(t)}run(t){t instanceof oa&&(this.requiresSelectionId&&($w(t.parent)||t.parent instanceof $r||t.parent instanceof En)||(this.setModified(),t.remove()))}}class j0e extends Ew{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,n){let i=new Set;t instanceof ps&&(i=t.producedFields(),W7(i,n)&&(this.setModified(),t.removeFormulas(n),t.producedFields.length===0&&t.remove()));for(const r of t.children)this.run(r,new Set([...n,...i]))}}class U0e extends Cw{constructor(){super()}run(t){t instanceof qn&&!t.isRequired()&&(this.setModified(),t.remove())}}class q0e extends _l{run(t){if(!$w(t)&&!(t.numChildren()>1)){for(const n of t.children)if(n instanceof En)if(t instanceof En)this.setModified(),t.merge(n);else{if(G7(t.producedFields(),n.dependentFields()))continue;this.setModified(),n.swapWithParent()}}}}class W0e extends _l{run(t){const n=[...t.children],i=t.children.filter(r=>r instanceof En);if(t.numChildren()>1&&i.length>=1){const r={},s=new Set;for(const o of i){const a=o.parse;for(const l of G(a))l in r?r[l]!==a[l]&&s.add(l):r[l]=a[l]}for(const o of s)delete r[o];if(!ut(r)){this.setModified();const o=new En(t,r);for(const a of n){if(a instanceof En)for(const l of G(r))delete a.parse[l];t.removeChild(a),a.parent=o,a instanceof En&&G(a.parse).length===0&&a.remove()}}}}}class H0e extends _l{run(t){t instanceof qn||t.numChildren()>0||t instanceof bc||t instanceof xl||(this.setModified(),t.remove())}}class G0e extends _l{run(t){const n=t.children.filter(r=>r instanceof ps),i=n.pop();for(const r of n)this.setModified(),i.merge(r)}}class V0e extends _l{run(t){const n=t.children.filter(r=>r instanceof $r),i={};for(const r of n){const s=Pe(r.groupBy);s in i||(i[s]=[]),i[s].push(r)}for(const r of G(i)){const s=i[r];if(s.length>1){const o=s.pop();for(const a of s)o.merge(a)&&(t.removeChild(a),a.parent=o,a.remove(),this.setModified())}}}}class X0e extends _l{constructor(t){super(),this.model=t}run(t){const n=!($w(t)||t instanceof pc||t instanceof En||t instanceof oa),i=[],r=[];for(const s of t.children)s instanceof gs&&(n&&!G7(t.producedFields(),s.dependentFields())?i.push(s):r.push(s));if(i.length>0){const s=i.pop();for(const o of i)s.merge(o,this.model.renameSignal.bind(this.model));this.setModified(),t instanceof gs?t.merge(s,this.model.renameSignal.bind(this.model)):s.swapWithParent()}if(r.length>1){const s=r.pop();for(const o of r)s.merge(o,this.model.renameSignal.bind(this.model));this.setModified()}}}class Y0e extends _l{run(t){const n=[...t.children];if(!nl(n,o=>o instanceof qn)||t.numChildren()<=1)return;const r=[];let s;for(const o of n)if(o instanceof qn){let a=o;for(;a.numChildren()===1;){const[l]=a.children;if(l instanceof qn)a=l;else break}r.push(...a.children),s?(t.removeChild(o),o.parent=s.parent,s.parent.removeChild(s),s.parent=a,this.setModified()):s=a}else r.push(o);if(r.length){this.setModified();for(const o of r)o.parent.removeChild(o),o.parent=s}}}class wl extends ot{clone(){return new wl(null,Ce(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=ts(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return this.transform.groupby&&this.transform.groupby.forEach(t.add,t),this.transform.joinaggregate.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(t){return t.as??Q(t)}hash(){return`JoinAggregateTransform ${Pe(this.transform)}`}assemble(){const t=[],n=[],i=[];for(const s of this.transform.joinaggregate)n.push(s.op),i.push(this.getDefaultName(s)),t.push(s.field===void 0?null:s.field);const r=this.transform.groupby;return{type:"joinaggregate",as:i,ops:n,fields:t,...r!==void 0?{groupby:r}:{}}}}function Z0e(e){return e.stack.stackBy.reduce((t,n)=>{const i=n.fieldDef,r=Q(i);return r&&t.push(r),t},[])}function K0e(e){return q(e)&&e.every(t=>te(t))&&e.length>1}class Ks extends ot{clone(){return new Ks(null,Ce(this._stack))}constructor(t,n){super(t),this._stack=n}static makeFromTransform(t,n){const{stack:i,groupby:r,as:s,offset:o="zero"}=n,a=[],l=[];if(n.sort!==void 0)for(const f of n.sort)a.push(f.field),l.push(Dt(f.order,"ascending"));const u={field:a,order:l};let c;return K0e(s)?c=s:te(s)?c=[s,`${s}_end`]:c=[`${n.stack}_start`,`${n.stack}_end`],new Ks(t,{dimensionFieldDefs:[],stackField:i,groupby:r,offset:o,sort:u,facetby:[],as:c})}static makeFromEncoding(t,n){const i=n.stack,{encoding:r}=n;if(!i)return null;const{groupbyChannels:s,fieldChannel:o,offset:a,impute:l}=i,u=s.map(h=>{const p=r[h];return fs(p)}).filter(h=>!!h),c=Z0e(n),f=n.encoding.order;let d;if(q(f)||Z(f))d=dD(f);else{const h=gN(f)?f.sort:o==="y"?"descending":"ascending";d=c.reduce((p,g)=>(p.field.push(g),p.order.push(h),p),{field:[],order:[]})}return new Ks(t,{dimensionFieldDefs:u,stackField:n.vgField(o),facetby:[],stackby:c,sort:d,offset:a,impute:l,as:[n.vgField(o,{suffix:"start",forAs:!0}),n.vgField(o,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(t){this._stack.facetby.push(...t)}dependentFields(){const t=new Set;return t.add(this._stack.stackField),this.getGroupbyFields().forEach(t.add,t),this._stack.facetby.forEach(t.add,t),this._stack.sort.field.forEach(t.add,t),t}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${Pe(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:t,impute:n,groupby:i}=this._stack;return t.length>0?t.map(r=>r.bin?n?[Q(r,{binSuffix:"mid"})]:[Q(r,{}),Q(r,{binSuffix:"end"})]:[Q(r)]).flat():i??[]}assemble(){const t=[],{facetby:n,dimensionFieldDefs:i,stackField:r,stackby:s,sort:o,offset:a,impute:l,as:u}=this._stack;if(l)for(const c of i){const{bandPosition:f=.5,bin:d}=c;if(d){const h=Q(c,{expr:"datum"}),p=Q(c,{expr:"datum",binSuffix:"end"});t.push({type:"formula",expr:`${f}*${h}+${1-f}*${p}`,as:Q(c,{binSuffix:"mid",forAs:!0})})}t.push({type:"impute",field:r,groupby:[...s,...n],key:Q(c,{binSuffix:"mid"}),method:"value",value:0})}return t.push({type:"stack",groupby:[...this.getGroupbyFields(),...n],field:r,sort:o,as:u,offset:a}),t}}class vc extends ot{clone(){return new vc(null,Ce(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=ts(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return(this.transform.groupby??[]).forEach(t.add,t),(this.transform.sort??[]).forEach(n=>t.add(n.field)),this.transform.window.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(t){return t.as??Q(t)}hash(){return`WindowTransform ${Pe(this.transform)}`}assemble(){const t=[],n=[],i=[],r=[];for(const f of this.transform.window)n.push(f.op),i.push(this.getDefaultName(f)),r.push(f.param===void 0?null:f.param),t.push(f.field===void 0?null:f.field);const s=this.transform.frame,o=this.transform.groupby;if(s&&s[0]===null&&s[1]===null&&n.every(f=>i_(f)))return{type:"joinaggregate",as:i,ops:n,fields:t,...o!==void 0?{groupby:o}:{}};const a=[],l=[];if(this.transform.sort!==void 0)for(const f of this.transform.sort)a.push(f.field),l.push(f.order??"ascending");const u={field:a,order:l},c=this.transform.ignorePeers;return{type:"window",params:r,as:i,ops:n,fields:t,sort:u,...c!==void 0?{ignorePeers:c}:{},...o!==void 0?{groupby:o}:{},...s!==void 0?{frame:s}:{}}}}function J0e(e){function t(n){if(!(n instanceof bc)){const i=n.clone();if(i instanceof qn){const r=Aw+i.getSource();i.setSource(r),e.model.component.data.outputNodes[r]=i}else(i instanceof $r||i instanceof Ks||i instanceof vc||i instanceof wl)&&i.addDimensions(e.fields);for(const r of n.children.flatMap(t))r.parent=i;return[i]}return n.children.flatMap(t)}return t}function Sw(e){if(e instanceof bc)if(e.numChildren()===1&&!(e.children[0]instanceof qn)){const t=e.children[0];(t instanceof $r||t instanceof Ks||t instanceof vc||t instanceof wl)&&t.addDimensions(e.fields),t.swapWithParent(),Sw(e)}else{const t=e.model.component.data.main;IR(t);const n=J0e(e),i=e.children.map(n).flat();for(const r of i)r.parent=t}else e.children.map(Sw)}function IR(e){if(e instanceof qn&&e.type===yt.Main&&e.numChildren()===1){const t=e.children[0];t instanceof bc||(t.swapWithParent(),IR(e))}}const Aw="scale_",sm=5;function Tw(e){for(const t of e){for(const n of t.children)if(n.parent!==t)return!1;if(!Tw(t.children))return!1}return!0}function Er(e,t){let n=!1;for(const i of t)n=e.optimize(i)||n;return n}function zR(e,t,n){let i=e.sources,r=!1;return r=Er(new U0e,i)||r,r=Er(new B0e(t),i)||r,i=i.filter(s=>s.numChildren()>0),r=Er(new H0e,i)||r,i=i.filter(s=>s.numChildren()>0),n||(r=Er(new q0e,i)||r,r=Er(new X0e(t),i)||r,r=Er(new j0e,i)||r,r=Er(new W0e,i)||r,r=Er(new V0e,i)||r,r=Er(new G0e,i)||r,r=Er(new P0e,i)||r,r=Er(new Y0e,i)||r),e.sources=i,r}function Q0e(e,t){Tw(e.sources);let n=0,i=0;for(let r=0;rt(n))}}function PR(e){At(e)?e1e(e):t1e(e)}function e1e(e){const t=e.component.scales;for(const n of G(t)){const i=i1e(e,n);if(t[n].setWithExplicit("domains",i),s1e(e,n),e.component.data.isFaceted){let s=e;for(;!Cr(s)&&s.parent;)s=s.parent;if(s.component.resolve.scale[n]==="shared")for(const a of i.value)Hs(a)&&(a.data=Aw+a.data.replace(Aw,""))}}}function t1e(e){for(const n of e.children)PR(n);const t=e.component.scales;for(const n of G(t)){let i,r=null;for(const s of e.children){const o=s.component.scales[n];if(o){i===void 0?i=o.getWithExplicit("domains"):i=na(i,o.getWithExplicit("domains"),"domains","scale",Dw);const a=o.get("selectionExtent");r&&a&&r.param!==a.param&&Y(rfe),r=a}}t[n].setWithExplicit("domains",i),r&&t[n].set("selectionExtent",r,!0)}}function n1e(e,t,n,i){if(e==="unaggregated"){const{valid:r,reason:s}=BR(t,n);if(!r){Y(s);return}}else if(e===void 0&&i.useUnaggregatedDomain){const{valid:r}=BR(t,n);if(r)return"unaggregated"}return e}function i1e(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:i}=e,r=n1e(e.scaleDomain(t),e.typedFieldDef(t),n,e.config.scale);return r!==e.scaleDomain(t)&&(e.specifiedScales[t]={...e.specifiedScales[t],domain:r}),t==="x"&&Ut(i.x2)?Ut(i.x)?na(aa(n,r,e,"x"),aa(n,r,e,"x2"),"domain","scale",Dw):aa(n,r,e,"x2"):t==="y"&&Ut(i.y2)?Ut(i.y)?na(aa(n,r,e,"y"),aa(n,r,e,"y2"),"domain","scale",Dw):aa(n,r,e,"y2"):aa(n,r,e,t)}function r1e(e,t,n){return e.map(i=>({signal:`{data: ${z1(i,{timeUnit:n,type:t})}}`}))}function Mw(e,t,n){var r;const i=(r=Kt(n))==null?void 0:r.unit;return t==="temporal"||i?r1e(e,t,i):[e]}function aa(e,t,n,i){const{encoding:r,markDef:s,mark:o,config:a,stack:l}=n,u=Ut(r[i]),{type:c}=u,f=u.timeUnit;if(Sde(t)){const p=aa(e,void 0,n,i),g=Mw(t.unionWith,c,f);return hs([...g,...p.value])}else{if(de(t))return hs([t]);if(t&&t!=="unaggregated"&&!YD(t))return hs(Mw(t,c,f))}if(l&&i===l.fieldChannel){if(l.offset==="normalize")return Ci([[0,1]]);const p=n.requestDataName(yt.Main);return Ci([{data:p,field:n.vgField(i,{suffix:"start"})},{data:p,field:n.vgField(i,{suffix:"end"})}])}const d=qs(i)&&Z(u)?o1e(n,i,e):void 0;if(cs(u)){const p=Mw([u.datum],c,f);return Ci(p)}const h=u;if(t==="unaggregated"){const p=n.requestDataName(yt.Main),{field:g}=u;return Ci([{data:p,field:Q({field:g,aggregate:"min"})},{data:p,field:Q({field:g,aggregate:"max"})}])}else if(mt(h.bin)){if(Jt(e))return Ci(e==="bin-ordinal"?[]:[{data:Nd(d)?n.requestDataName(yt.Main):n.requestDataName(yt.Raw),field:n.vgField(i,Vd(h,i)?{binSuffix:"range"}:{}),sort:d===!0||!re(d)?{field:n.vgField(i,{}),op:"min"}:d}]);{const{bin:p}=h;if(mt(p)){const g=kw(n,h.field,p);return Ci([new en(()=>{const m=n.getSignalName(g);return`[${m}.start, ${m}.stop]`})])}else return Ci([{data:n.requestDataName(yt.Main),field:n.vgField(i,{})}])}}else if(h.timeUnit&&Be(["time","utc"],e)){const p=r[ss(i)];if(pN(h,p,s,a)){const g=n.requestDataName(yt.Main),m=ea({fieldDef:h,fieldDef2:p,markDef:s,config:a}),y=Ud(o)&&m!==.5&&Nt(i);return Ci([{data:g,field:n.vgField(i,y?{suffix:X1}:{})},{data:g,field:n.vgField(i,{suffix:y?Y1:"end"})}])}}return Ci(d?[{data:Nd(d)?n.requestDataName(yt.Main):n.requestDataName(yt.Raw),field:n.vgField(i),sort:d}]:[{data:n.requestDataName(yt.Main),field:n.vgField(i)}])}function Fw(e,t){const{op:n,field:i,order:r}=e;return{op:n??(t?"sum":T1),...i?{field:Ui(i)}:{},...r?{order:r}:{}}}function s1e(e,t){var a;const n=e.component.scales[t],i=e.specifiedScales[t].domain,r=(a=e.fieldDef(t))==null?void 0:a.bin,s=YD(i)&&i,o=al(r)&&b1(r.extent)&&r.extent;(s||o)&&n.set("selectionExtent",s??o,!0)}function o1e(e,t,n){if(!Jt(n))return;const i=e.fieldDef(t),r=i.sort;if(fN(r))return{op:"min",field:mc(i,t),order:"ascending"};const{stack:s}=e,o=s?new Set([...s.groupbyFields,...s.stackBy.map(a=>a.fieldDef.field)]):void 0;if(us(r)){const a=s&&!o.has(r.field);return Fw(r,a)}else if(cN(r)){const{encoding:a,order:l}=r,u=e.fieldDef(a),{aggregate:c,field:f}=u,d=s&&!o.has(f);if(Ws(c)||Zo(c))return Fw({field:Q(u),order:l},d);if(i_(c)||!c)return Fw({op:c,field:f,order:l},d)}else{if(r==="descending")return{op:"min",field:e.vgField(t),order:"descending"};if(Be(["ascending",void 0],r))return!0}}function BR(e,t){const{aggregate:n,type:i}=e;return n?te(n)&&!qce.has(n)?{valid:!1,reason:Mfe(n)}:i==="quantitative"&&t==="log"?{valid:!1,reason:Ffe(e)}:{valid:!0}:{valid:!1,reason:Tfe(e)}}function Dw(e,t,n,i){return e.explicit&&t.explicit&&Y(Lfe(n,i,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function a1e(e){const t=ts(e.map(o=>{if(Hs(o)){const{sort:a,...l}=o;return l}return o}),Pe),n=ts(e.map(o=>{if(Hs(o)){const a=o.sort;return a!==void 0&&!Nd(a)&&("op"in a&&a.op==="count"&&delete a.field,a.order==="ascending"&&delete a.order),a}}).filter(o=>o!==void 0),Pe);if(t.length===0)return;if(t.length===1){const o=e[0];if(Hs(o)&&n.length>0){let a=n[0];if(n.length>1){Y(AD);const l=n.filter(u=>re(u)&&"op"in u&&u.op!=="min");n.every(u=>re(u)&&"op"in u)&&l.length===1?a=l[0]:a=!0}else if(re(a)&&"field"in a){const l=a.field;o.field===l&&(a=a.order?{order:a.order}:!0)}return{...o,sort:a}}return o}const i=ts(n.map(o=>Nd(o)||!("op"in o)||te(o.op)&&o.op in Pce?o:(Y(zfe(o)),!0)),Pe);let r;i.length===1?r=i[0]:i.length>1&&(Y(AD),r=!0);const s=ts(e.map(o=>Hs(o)?o.data:null),o=>o);return s.length===1&&s[0]!==null?{data:s[0],fields:t.map(a=>a.field),...r?{sort:r}:{}}:{fields:t,...r?{sort:r}:{}}}function Nw(e){if(Hs(e)&&te(e.field))return e.field;if(Wce(e)){let t;for(const n of e.fields)if(Hs(n)&&te(n.field)){if(!t)t=n.field;else if(t!==n.field)return Y(Pfe),t}return Y(Bfe),t}else if(Hce(e)){Y(jfe);const t=e.fields[0];return te(t)?t:void 0}}function om(e,t){const i=e.component.scales[t].get("domains").map(r=>(Hs(r)&&(r.data=e.lookupDataSource(r.data)),r));return a1e(i)}function jR(e){return xc(e)||Rw(e)?e.children.reduce((t,n)=>t.concat(jR(n)),UR(e)):UR(e)}function UR(e){return G(e.component.scales).reduce((t,n)=>{const i=e.component.scales[n];if(i.merged)return t;const r=i.combine(),{name:s,type:o,selectionExtent:a,domains:l,range:u,reverse:c,...f}=r,d=l1e(r.range,s,n,e),h=om(e,n),p=a?nge(e,a,i,h):null;return t.push({name:s,type:o,...h?{domain:h}:{},...p?{domainRaw:p}:{},range:d,...c!==void 0?{reverse:c}:{},...f}),t},[])}function l1e(e,t,n,i){if(Nt(n)){if(Jo(e))return{step:{signal:`${t}_step`}}}else if(re(e)&&Hs(e))return{...e,data:i.lookupDataSource(e.data)};return e}class qR extends Ys{constructor(t,n){super({},{name:t}),this.merged=!1,this.setWithExplicit("type",n)}domainDefinitelyIncludesZero(){return this.get("zero")!==!1?!0:nl(this.get("domains"),t=>q(t)&&t.length===2&&Xe(t[0])&&t[0]<=0&&Xe(t[1])&&t[1]>=0)}}const u1e=["range","scheme"];function c1e(e){const t=e.component.scales;for(const n of y1){const i=t[n];if(!i)continue;const r=f1e(n,e);i.setWithExplicit("range",r)}}function WR(e,t){const n=e.fieldDef(t);if(n!=null&&n.bin){const{bin:i,field:r}=n,s=ai(t),o=e.getName(s);if(re(i)&&i.binned&&i.step!==void 0)return new en(()=>{const a=e.scaleName(t),l=`(domain("${a}")[1] - domain("${a}")[0]) / ${i.step}`;return`${e.getSignalName(o)} / (${l})`});if(mt(i)){const a=kw(e,r,i);return new en(()=>{const l=e.getSignalName(a),u=`(${l}.stop - ${l}.start) / ${l}.step`;return`${e.getSignalName(o)} / (${u})`})}}}function f1e(e,t){const n=t.specifiedScales[e],{size:i}=t,s=t.getScaleComponent(e).get("type");for(const f of u1e)if(n[f]!==void 0){const d=k_(s,f),h=ZD(e,f);if(!d)Y(CD(s,f,e));else if(h)Y(h);else switch(f){case"range":{const p=n.range;if(q(p)){if(Nt(e))return hs(p.map(g=>{if(g==="width"||g==="height"){const m=t.getName(g),y=t.getSignalName.bind(t);return en.fromName(y,m)}return g}))}else if(re(p))return hs({data:t.requestDataName(yt.Main),field:p.field,sort:{op:"min",field:t.vgField(e)}});return hs(p)}case"scheme":return hs(d1e(n[f]))}}const o=e===wt||e==="xOffset"?"width":"height",a=i[o];if(ds(a)){if(Nt(e))if(Jt(s)){const f=GR(a,t,e);if(f)return hs({step:f})}else Y(SD(o));else if(Pd(e)){const f=e===Wo?"x":"y";if(t.getScaleComponent(f).get("type")==="band"){const p=VR(a,s);if(p)return hs(p)}}}const{rangeMin:l,rangeMax:u}=n,c=h1e(e,t);return(l!==void 0||u!==void 0)&&k_(s,"rangeMin")&&q(c)&&c.length===2?hs([l??c[0],u??c[1]]):Ci(c)}function d1e(e){return Cde(e)?{scheme:e.name,...ri(e,["name"])}:{scheme:e}}function HR(e,t,n,{center:i}={}){const r=ai(e),s=t.getName(r),o=t.getSignalName.bind(t);return e===Zt&&Ei(n)?i?[en.fromName(a=>`${o(a)}/2`,s),en.fromName(a=>`-${o(a)}/2`,s)]:[en.fromName(o,s),0]:i?[en.fromName(a=>`-${o(a)}/2`,s),en.fromName(a=>`${o(a)}/2`,s)]:[0,en.fromName(o,s)]}function h1e(e,t){const{size:n,config:i,mark:r,encoding:s}=t,{type:o}=Ut(s[e]),l=t.getScaleComponent(e).get("type"),{domain:u,domainMid:c}=t.specifiedScales[e];switch(e){case wt:case Zt:{if(Be(["point","band"],l)){const f=XR(e,n,i.view);if(ds(f))return{step:GR(f,t,e)}}return HR(e,t,l)}case Wo:case Ku:return p1e(e,t,l);case js:{const f=t.component.scales[e].get("zero"),d=YR(r,f,i),h=y1e(r,n,t,i);return ic(l)?m1e(d,h,g1e(l,i,u,e)):[d,h]}case qi:return[0,Math.PI*2];case rl:return[0,360];case gr:return[0,new en(()=>{const f=t.getSignalName("width"),d=t.getSignalName("height");return`min(${f},${d})/2`})];case Vo:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case Xo:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case oi:return"symbol";case si:case is:case rs:return l==="ordinal"?o==="nominal"?"category":"ordinal":c!==void 0?"diverging":r==="rect"||r==="geoshape"?"heatmap":"ramp";case Us:case Ho:case Go:return[i.scale.minOpacity,i.scale.maxOpacity]}}function GR(e,t,n){const{encoding:i}=t,r=t.getScaleComponent(n),s=J7(n),o=i[s];if(YN({step:e,offsetIsDiscrete:Se(o)&&qD(o.type)})==="offset"&&TN(i,s)){const l=t.getScaleComponent(s);let c=`domain('${t.scaleName(s)}').length`;if(l.get("type")==="band"){const d=l.get("paddingInner")??l.get("padding")??0,h=l.get("paddingOuter")??l.get("padding")??0;c=`bandspace(${c}, ${d}, ${h})`}const f=r.get("paddingInner")??r.get("padding");return{signal:`${e.step} * ${c} / (1-${Xce(f)})`}}else return e.step}function VR(e,t){if(YN({step:e,offsetIsDiscrete:Jt(t)})==="offset")return{step:e.step}}function p1e(e,t,n){const i=e===Wo?"x":"y",r=t.getScaleComponent(i);if(!r)return HR(i,t,n,{center:!0});const s=r.get("type"),o=t.scaleName(i),{markDef:a,config:l}=t;if(s==="band"){const u=XR(i,t.size,t.config.view);if(ds(u)){const c=VR(u,n);if(c)return c}return[0,{signal:`bandwidth('${o}')`}]}else{const u=t.encoding[i];if(Z(u)&&u.timeUnit){const c=PD(u.timeUnit,p=>`scale('${o}', ${p})`),f=t.config.scale.bandWithNestedOffsetPaddingInner,d=ea({fieldDef:u,markDef:a,config:l})-.5,h=d!==0?` + ${d}`:"";if(f){const p=de(f)?`${f.signal}/2`+h:`${f/2+d}`,g=de(f)?`(1 - ${f.signal}/2)`+h:`${1-f/2+d}`;return[{signal:`${p} * (${c})`},{signal:`${g} * (${c})`}]}return[0,{signal:c}]}return LF(`Cannot use ${e} scale if ${i} scale is not discrete.`)}}function XR(e,t,n){const i=e===wt?"width":"height",r=t[i];return r||H1(n,i)}function g1e(e,t,n,i){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return n!==void 0&&q(n)?n.length+1:(Y(Zfe(i)),3)}}function m1e(e,t,n){const i=()=>{const r=vr(t),s=vr(e),o=`(${r} - ${s}) / (${n} - 1)`;return`sequence(${s}, ${r} + ${o}, ${o})`};return de(t)?new en(i):{signal:i()}}function YR(e,t,n){if(t)return de(t)?{signal:`${t.signal} ? 0 : ${YR(e,!1,n)}`}:0;switch(e){case"bar":case"tick":return n.scale.minBandSize;case"line":case"trail":case"rule":return n.scale.minStrokeWidth;case"text":return n.scale.minFontSize;case"point":case"square":case"circle":return n.scale.minSize}throw new Error(x1("size",e))}const ZR=.95;function y1e(e,t,n,i){const r={x:WR(n,"x"),y:WR(n,"y")};switch(e){case"bar":case"tick":{if(i.scale.maxBandSize!==void 0)return i.scale.maxBandSize;const s=KR(t,r,i.view);return Xe(s)?s-1:new en(()=>`${s.signal} - 1`)}case"line":case"trail":case"rule":return i.scale.maxStrokeWidth;case"text":return i.scale.maxFontSize;case"point":case"square":case"circle":{if(i.scale.maxSize)return i.scale.maxSize;const s=KR(t,r,i.view);return Xe(s)?Math.pow(ZR*s,2):new en(()=>`pow(${ZR} * ${s.signal}, 2)`)}}throw new Error(x1("size",e))}function KR(e,t,n){const i=ds(e.width)?e.width.step:W1(n,"width"),r=ds(e.height)?e.height.step:W1(n,"height");return t.x||t.y?new en(()=>`min(${[t.x?t.x.signal:i,t.y?t.y.signal:r].join(", ")})`):Math.min(i,r)}function JR(e,t){At(e)?b1e(e,t):tL(e,t)}function b1e(e,t){const n=e.component.scales,{config:i,encoding:r,markDef:s,specifiedScales:o}=e;for(const a of G(n)){const l=o[a],u=n[a],c=e.getScaleComponent(a),f=Ut(r[a]),d=l[t],h=c.get("type"),p=c.get("padding"),g=c.get("paddingInner"),m=k_(h,t),y=ZD(a,t);if(d!==void 0&&(m?y&&Y(y):Y(CD(h,t,a))),m&&y===void 0)if(d!==void 0){const b=f.timeUnit,v=f.type;switch(t){case"domainMax":case"domainMin":ll(l[t])||v==="temporal"||b?u.set(t,{signal:z1(l[t],{type:v,timeUnit:b})},!0):u.set(t,l[t],!0);break;default:u.copyKeyFromObject(t,l)}}else{const b=t in QR?QR[t]({model:e,channel:a,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:g,domain:l.domain,domainMin:l.domainMin,domainMax:l.domainMax,markDef:s,config:i,hasNestedOffsetScale:MN(r,a),hasSecondaryRangeChannel:!!r[ss(a)]}):i.scale[t];b!==void 0&&u.set(t,b,!1)}}}const QR={bins:({model:e,fieldOrDatumDef:t})=>Z(t)?v1e(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>x1e(e,t.type),nice:({scaleType:e,channel:t,domain:n,domainMin:i,domainMax:r,fieldOrDatumDef:s})=>_1e(e,t,n,i,r,s),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:i,config:r})=>w1e(e,t,r.scale,n,i,r.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,scaleType:i,config:r,hasNestedOffsetScale:s})=>k1e(e,t,n.type,i,r.scale,s),paddingOuter:({scalePadding:e,channel:t,scaleType:n,scalePaddingInner:i,config:r,hasNestedOffsetScale:s})=>$1e(e,t,n,i,r.scale,s),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:i})=>{const r=Z(e)?e.sort:void 0;return E1e(t,r,n,i.scale)},zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:i,scaleType:r,config:s,hasSecondaryRangeChannel:o})=>C1e(e,t,n,i,r,s.scale,o)};function eL(e){At(e)?c1e(e):tL(e,"range")}function tL(e,t){const n=e.component.scales;for(const i of e.children)t==="range"?eL(i):JR(i,t);for(const i of G(n)){let r;for(const s of e.children){const o=s.component.scales[i];if(o){const a=o.getWithExplicit(t);r=na(r,a,t,"scale",_O((l,u)=>{switch(t){case"range":return l.step&&u.step?l.step-u.step:0}return 0}))}}n[i].setWithExplicit(t,r)}}function v1e(e,t){const n=t.bin;if(mt(n)){const i=kw(e,t.field,n);return new en(()=>e.getSignalName(i))}else if(un(n)&&al(n)&&n.step!==void 0)return{step:n.step}}function x1e(e,t){if(Be([si,is,rs],e)&&t!=="nominal")return"hcl"}function _1e(e,t,n,i,r,s){var o;if(!((o=fs(s))!=null&&o.bin||q(n)||r!=null||i!=null||Be([ui.TIME,ui.UTC],e)))return Nt(t)?!0:void 0}function w1e(e,t,n,i,r,s){if(Nt(e)){if(xr(t)){if(n.continuousPadding!==void 0)return n.continuousPadding;const{type:o,orient:a}=r;if(o==="bar"&&!(Z(i)&&(i.bin||i.timeUnit))&&(a==="vertical"&&e==="x"||a==="horizontal"&&e==="y"))return s.continuousBandSize}if(t===ui.POINT)return n.pointPadding}}function k1e(e,t,n,i,r,s=!1){if(e===void 0){if(Nt(t)){const{bandPaddingInner:o,barBandPaddingInner:a,rectBandPaddingInner:l,bandWithNestedOffsetPaddingInner:u}=r;return s?u:Dt(o,n==="bar"?a:l)}else if(Pd(t)&&i===ui.BAND)return r.offsetBandPaddingInner}}function $1e(e,t,n,i,r,s=!1){if(e===void 0){if(Nt(t)){const{bandPaddingOuter:o,bandWithNestedOffsetPaddingOuter:a}=r;if(s)return a;if(n===ui.BAND)return Dt(o,de(i)?{signal:`${i.signal}/2`}:i/2)}else if(Pd(t)){if(n===ui.POINT)return .5;if(n===ui.BAND)return r.offsetBandPaddingOuter}}}function E1e(e,t,n,i){if(n==="x"&&i.xReverse!==void 0)return Ei(e)&&t==="descending"?de(i.xReverse)?{signal:`!${i.xReverse.signal}`}:!i.xReverse:i.xReverse;if(Ei(e)&&t==="descending")return!0}function C1e(e,t,n,i,r,s,o){if(!!n&&n!=="unaggregated"&&Ei(r)){if(q(n)){const l=n[0],u=n[n.length-1];if(Xe(l)&&l<=0&&Xe(u)&&u>=0)return!0}return!1}if(e==="size"&&t.type==="quantitative"&&!ic(r))return!0;if(!(Z(t)&&t.bin)&&Be([...os,...Fce],e)){const{orient:l,type:u}=i;return Be(["bar","area","line","trail"],u)&&(l==="horizontal"&&e==="y"||l==="vertical"&&e==="x")?!1:Be(["bar","area"],u)&&!o?!0:s==null?void 0:s.zero}return!1}function S1e(e,t,n,i,r=!1){const s=A1e(t,n,i,r),{type:o}=e;return qs(t)?o!==void 0?Nde(t,o)?Z(n)&&!Dde(o,n.type)?(Y(Ofe(o,s)),s):o:(Y(Nfe(t,o,s)),s):s:null}function A1e(e,t,n,i){var r;switch(t.type){case"nominal":case"ordinal":{if(Qu(e)||n_(e)==="discrete")return e==="shape"&&t.type==="ordinal"&&Y(l_(e,"ordinal")),"ordinal";if(Nt(e)||Pd(e)){if(Be(["rect","bar","image","rule"],n.type)||i)return"band"}else if(n.type==="arc"&&e in t_)return"band";const s=n[ai(e)];return dl(s)||sc(t)&&((r=t.axis)!=null&&r.tickBand)?"band":"point"}case"temporal":return Qu(e)?"time":n_(e)==="discrete"?(Y(l_(e,"temporal")),"ordinal"):Z(t)&&t.timeUnit&&Kt(t.timeUnit).utc?"utc":"time";case"quantitative":return Qu(e)?Z(t)&&mt(t.bin)?"bin-ordinal":"linear":n_(e)==="discrete"?(Y(l_(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error($D(t.type))}function T1e(e,{ignoreRange:t}={}){nL(e),PR(e);for(const n of Fde)JR(e,n);t||eL(e)}function nL(e){At(e)?e.component.scales=M1e(e):e.component.scales=D1e(e)}function M1e(e){const{encoding:t,mark:n,markDef:i}=e,r={};for(const s of y1){const o=Ut(t[s]);if(o&&n===QD&&s===oi&&o.type===nc)continue;let a=o&&o.scale;if(o&&a!==null&&a!==!1){a??(a={});const l=MN(t,s),u=S1e(a,s,o,i,l);r[s]=new qR(e.scaleName(`${s}`,!0),{value:u,explicit:a.type===u})}}return r}const F1e=_O((e,t)=>WD(e)-WD(t));function D1e(e){var t;const n=e.component.scales={},i={},r=e.component.resolve;for(const s of e.children){nL(s);for(const o of G(s.component.scales))if((t=r.scale)[o]??(t[o]=vR(o,e)),r.scale[o]==="shared"){const a=i[o],l=s.component.scales[o].getWithExplicit("type");a?_de(a.value,l.value)?i[o]=na(a,l,"type","scale",F1e):(r.scale[o]="independent",delete i[o]):i[o]=l}}for(const s of G(i)){const o=e.scaleName(s,!0),a=i[s];n[s]=new qR(o,a);for(const l of e.children){const u=l.component.scales[s];u&&(l.renameScale(u.get("name"),o),u.merged=!0)}}return n}class Ow{constructor(){this.nameMap={}}rename(t,n){this.nameMap[t]=n}has(t){return this.nameMap[t]!==void 0}get(t){for(;this.nameMap[t]&&t!==this.nameMap[t];)t=this.nameMap[t];return t}}function At(e){return(e==null?void 0:e.type)==="unit"}function Cr(e){return(e==null?void 0:e.type)==="facet"}function Rw(e){return(e==null?void 0:e.type)==="concat"}function xc(e){return(e==null?void 0:e.type)==="layer"}class Lw{constructor(t,n,i,r,s,o,a){this.type=n,this.parent=i,this.config=s,this.correctDataNames=l=>{var u,c,f;return(u=l.from)!=null&&u.data&&(l.from.data=this.lookupDataSource(l.from.data)),(f=(c=l.from)==null?void 0:c.facet)!=null&&f.data&&(l.from.facet.data=this.lookupDataSource(l.from.facet.data)),l},this.parent=i,this.config=s,this.view=li(a),this.name=t.name??r,this.title=Ko(t.title)?{text:t.title}:t.title?li(t.title):void 0,this.scaleNameMap=i?i.scaleNameMap:new Ow,this.projectionNameMap=i?i.projectionNameMap:new Ow,this.signalNameMap=i?i.signalNameMap:new Ow,this.data=t.data,this.description=t.description,this.transforms=Ppe(t.transform??[]),this.layout=n==="layer"||n==="unit"?{}:Whe(t,n,s),this.component={data:{sources:i?i.component.data.sources:[],outputNodes:i?i.component.data.outputNodes:{},outputNodeRefCounts:i?i.component.data.outputNodeRefCounts:{},isFaceted:M1(t)||(i==null?void 0:i.component.data.isFaceted)&&t.data===void 0},layoutSize:new Ys,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...o?Ce(o):{}},selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){T1e(this)}parseProjection(){DR(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){SR(this)}assembleEncodeFromView(t){const{style:n,...i}=t,r={};for(const s of G(i)){const o=i[s];o!==void 0&&(r[s]=vt(o))}return r}assembleGroupEncodeEntry(t){let n={};return this.view&&(n=this.assembleEncodeFromView(this.view)),!t&&(this.description&&(n.description=vt(this.description)),this.type==="unit"||this.type==="layer")?{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...n??{}}:ut(n)?void 0:n}assembleLayout(){if(!this.layout)return;const{spacing:t,...n}=this.layout,{component:i,config:r}=this,s=Qge(i.layoutHeaders,r);return{padding:t,...this.assembleDefaultLayout(),...n,...s?{titleBand:s}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:t}=this.component;let n=[];for(const i of Hi)t[i].title&&n.push(Vge(this,i));for(const i of yw)n=n.concat(Xge(this,i));return n}assembleAxes(){return Oge(this.component.axes,this.config)}assembleLegends(){return TR(this)}assembleProjections(){return w0e(this)}assembleTitle(){const{encoding:t,...n}=this.title??{},i={...oD(this.config.title).nonMarkTitleProperties,...n,...t?{encode:{update:t}}:{}};if(i.text)return Be(["unit","layer"],this.type)?Be(["middle",void 0],i.anchor)&&(i.frame??(i.frame="group")):i.anchor??(i.anchor="start"),ut(i)?void 0:i}assembleGroup(t=[]){const n={};t=t.concat(this.assembleSignals()),t.length>0&&(n.signals=t);const i=this.assembleLayout();i&&(n.layout=i),n.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const r=!this.parent||Cr(this.parent)?jR(this):[];r.length>0&&(n.scales=r);const s=this.assembleAxes();s.length>0&&(n.axes=s);const o=this.assembleLegends();return o.length>0&&(n.legends=o),n}getName(t){return _t((this.name?`${this.name}_`:"")+t)}getDataName(t){return this.getName(yt[t].toLowerCase())}requestDataName(t){const n=this.getDataName(t),i=this.component.data.outputNodeRefCounts;return i[n]=(i[n]||0)+1,n}getSizeSignalRef(t){if(Cr(this.parent)){const n=yR(t),i=m1(n),r=this.component.scales[i];if(r&&!r.merged){const s=r.get("type"),o=r.get("range");if(Jt(s)&&Jo(o)){const a=r.get("name"),l=om(this,i),u=Nw(l);if(u){const c=Q({aggregate:"distinct",field:u},{expr:"datum"});return{signal:mR(a,r,c)}}else return Y(o_(i)),null}}}return{signal:this.signalNameMap.get(this.getName(t))}}lookupDataSource(t){const n=this.component.data.outputNodes[t];return n?n.getSource():t}getSignalName(t){return this.signalNameMap.get(t)}renameSignal(t,n){this.signalNameMap.rename(t,n)}renameScale(t,n){this.scaleNameMap.rename(t,n)}renameProjection(t,n){this.projectionNameMap.rename(t,n)}scaleName(t,n){if(n)return this.getName(t);if(ZF(t)&&qs(t)&&this.component.scales[t]||this.scaleNameMap.has(this.getName(t)))return this.scaleNameMap.get(this.getName(t))}projectionName(t){if(t)return this.getName("projection");if(this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection")))return this.projectionNameMap.get(this.getName("projection"))}getScaleComponent(t){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const n=this.component.scales[t];return n&&!n.merged?n:this.parent?this.parent.getScaleComponent(t):void 0}getSelectionComponent(t,n){let i=this.component.selection[t];if(!i&&this.parent&&(i=this.parent.getSelectionComponent(t,n)),!i)throw new Error(Qce(n));return i}hasAxisOrientSignalRef(){var t,n;return((t=this.component.axes.x)==null?void 0:t.some(i=>i.hasOrientSignalRef()))||((n=this.component.axes.y)==null?void 0:n.some(i=>i.hasOrientSignalRef()))}}class iL extends Lw{vgField(t,n={}){const i=this.fieldDef(t);if(i)return Q(i,n)}reduceFieldDef(t,n){return _he(this.getMapping(),(i,r,s)=>{const o=fs(r);return o?t(i,o,s):i},n)}forEachFieldDef(t,n){z_(this.getMapping(),(i,r)=>{const s=fs(i);s&&t(s,r)},n)}}class am extends ot{clone(){return new am(null,Ce(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Ce(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"value",i[1]??"density"]}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${Pe(this.transform)}`}assemble(){const{density:t,...n}=this.transform,i={type:"kde",field:t,...n};return this.transform.groupby&&(i.resolve="shared"),i}}class lm extends ot{clone(){return new lm(null,Ce(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Ce(n)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${Pe(this.transform)}`}assemble(){const{extent:t,param:n}=this.transform;return{type:"extent",field:t,signal:n}}}class nh extends ot{clone(){return new nh(null,{...this.filter})}constructor(t,n){super(t),this.filter=n}static make(t,n){const{config:i,mark:r,markDef:s}=n;if(it("invalid",s,i)!=="filter")return null;const a=n.reduceFieldDef((l,u,c)=>{const f=qs(c)&&n.getScaleComponent(c);if(f){const d=f.get("type");Ei(d)&&u.aggregate!=="count"&&!Qo(r)&&(l[u.field]=u)}return l},{});return G(a).length?new nh(t,a):null}dependentFields(){return new Set(G(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${Pe(this.filter)}`}assemble(){const t=G(this.filter).reduce((n,i)=>{const r=this.filter[i],s=Q(r,{expr:"datum"});return r!==null&&(r.type==="temporal"?n.push(`(isDate(${s}) || (isValid(${s}) && isFinite(+${s})))`):r.type==="quantitative"&&(n.push(`isValid(${s})`),n.push(`isFinite(+${s})`))),n},[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}class um extends ot{clone(){return new um(this.parent,Ce(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Ce(n);const{flatten:i,as:r=[]}=this.transform;this.transform.as=i.map((s,o)=>r[o]??s)}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${Pe(this.transform)}`}assemble(){const{flatten:t,as:n}=this.transform;return{type:"flatten",fields:t,as:n}}}class cm extends ot{clone(){return new cm(null,Ce(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Ce(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"key",i[1]??"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${Pe(this.transform)}`}assemble(){const{fold:t,as:n}=this.transform;return{type:"fold",fields:t,as:n}}}class _c extends ot{clone(){return new _c(null,Ce(this.fields),this.geojson,this.signal)}static parseAll(t,n){if(n.component.projection&&!n.component.projection.isFit)return t;let i=0;for(const r of[[yr,mr],[Wi,br]]){const s=r.map(o=>{const a=Ut(n.encoding[o]);return Z(a)?a.field:cs(a)?{expr:`${a.datum}`}:wr(a)?{expr:`${a.value}`}:void 0});(s[0]||s[1])&&(t=new _c(t,s,null,n.getName(`geojson_${i++}`)))}if(n.channelHasField(oi)){const r=n.typedFieldDef(oi);r.type===nc&&(t=new _c(t,null,r.field,n.getName(`geojson_${i++}`)))}return t}constructor(t,n,i,r){super(t),this.fields=n,this.geojson=i,this.signal=r}dependentFields(){const t=(this.fields??[]).filter(te);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${Pe(this.fields)}`}assemble(){return[...this.geojson?[{type:"filter",expr:`isValid(datum["${this.geojson}"])`}]:[],{type:"geojson",...this.fields?{fields:this.fields}:{},...this.geojson?{geojson:this.geojson}:{},signal:this.signal}]}}class ih extends ot{clone(){return new ih(null,this.projection,Ce(this.fields),Ce(this.as))}constructor(t,n,i,r){super(t),this.projection=n,this.fields=i,this.as=r}static parseAll(t,n){if(!n.projectionName())return t;for(const i of[[yr,mr],[Wi,br]]){const r=i.map(o=>{const a=Ut(n.encoding[o]);return Z(a)?a.field:cs(a)?{expr:`${a.datum}`}:wr(a)?{expr:`${a.value}`}:void 0}),s=i[0]===Wi?"2":"";(r[0]||r[1])&&(t=new ih(t,n.projectionName(),r,[n.getName(`x${s}`),n.getName(`y${s}`)]))}return t}dependentFields(){return new Set(this.fields.filter(te))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${Pe(this.fields)} ${Pe(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class kl extends ot{clone(){return new kl(null,Ce(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(t){const{start:n=0,stop:i,step:r}=t;return{signal:`sequence(${[n,i,...r?[r]:[]].join(",")})`}}static makeFromTransform(t,n){return new kl(t,n)}static makeFromEncoding(t,n){const i=n.encoding,r=i.x,s=i.y;if(Z(r)&&Z(s)){const o=r.impute?r:s.impute?s:void 0;if(o===void 0)return;const a=r.impute?s:s.impute?r:void 0,{method:l,value:u,frame:c,keyvals:f}=o.impute,d=DN(n.mark,i);return new kl(t,{impute:o.field,key:a.field,...l?{method:l}:{},...u!==void 0?{value:u}:{},...c?{frame:c}:{},...f!==void 0?{keyvals:f}:{},...d.length?{groupby:d}:{}})}return null}hash(){return`Impute ${Pe(this.transform)}`}assemble(){const{impute:t,key:n,keyvals:i,method:r,groupby:s,value:o,frame:a=[null,null]}=this.transform,l={type:"impute",field:t,key:n,...i?{keyvals:xpe(i)?this.processSequence(i):i}:{},method:"value",...s?{groupby:s}:{},value:!r||r==="value"?o:null};if(r&&r!=="value"){const u={type:"window",as:[`imputed_${t}_value`],ops:[r],fields:[t],frame:a,ignorePeers:!1,...s?{groupby:s}:{}},c={type:"formula",expr:`datum.${t} === null ? datum.imputed_${t}_value : datum.${t}`,as:t};return[l,u,c]}else return[l]}}class fm extends ot{clone(){return new fm(null,Ce(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Ce(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??n.on,i[1]??n.loess]}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${Pe(this.transform)}`}assemble(){const{loess:t,on:n,...i}=this.transform;return{type:"loess",x:n,y:t,...i}}}class rh extends ot{clone(){return new rh(null,Ce(this.transform),this.secondary)}constructor(t,n,i){super(t),this.transform=n,this.secondary=i}static make(t,n,i,r){const s=n.component.data.sources,{from:o}=i;let a=null;if(_pe(o)){let l=aL(o.data,s);l||(l=new xl(o.data),s.push(l));const u=n.getName(`lookup_${r}`);a=new qn(l,u,yt.Lookup,n.component.data.outputNodeRefCounts),n.component.data.outputNodes[u]=a}else if(wpe(o)){const l=o.param;i={as:l,...i};let u;try{u=n.getSelectionComponent(_t(l),l)}catch{throw new Error(nfe(l))}if(a=u.materialized,!a)throw new Error(ife(l))}return new rh(t,i,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?ee(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${Pe({transform:this.transform,secondary:this.secondary})}`}assemble(){let t;if(this.transform.from.fields)t={values:this.transform.from.fields,...this.transform.as?{as:ee(this.transform.as)}:{}};else{let n=this.transform.as;te(n)||(Y(ffe),n="_lookup"),t={as:[n]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...t,...this.transform.default?{default:this.transform.default}:{}}}}class dm extends ot{clone(){return new dm(null,Ce(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Ce(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"prob",i[1]??"value"]}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${Pe(this.transform)}`}assemble(){const{quantile:t,...n}=this.transform;return{type:"quantile",field:t,...n}}}class hm extends ot{clone(){return new hm(null,Ce(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Ce(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??n.on,i[1]??n.regression]}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${Pe(this.transform)}`}assemble(){const{regression:t,on:n,...i}=this.transform;return{type:"regression",x:n,y:t,...i}}}class pm extends ot{clone(){return new pm(null,Ce(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=ts((this.transform.groupby??[]).concat(t),n=>n)}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${Pe(this.transform)}`}assemble(){const{pivot:t,value:n,groupby:i,limit:r,op:s}=this.transform;return{type:"pivot",field:t,value:n,...r!==void 0?{limit:r}:{},...s!==void 0?{op:s}:{},...i!==void 0?{groupby:i}:{}}}}class gm extends ot{clone(){return new gm(null,Ce(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${Pe(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function rL(e){let t=0;function n(i,r){if(i instanceof xl&&!i.isGenerator&&!cc(i.data)&&(e.push(r),r={name:null,source:r.name,transform:[]}),i instanceof En&&(i.parent instanceof xl&&!r.source?(r.format={...r.format??{},parse:i.assembleFormatParse()},r.transform.push(...i.assembleTransforms(!0))):r.transform.push(...i.assembleTransforms())),i instanceof bc){r.name||(r.name=`data_${t++}`),!r.source||r.transform.length>0?(e.push(r),i.data=r.name):i.data=r.source,e.push(...i.assemble());return}switch((i instanceof Qd||i instanceof eh||i instanceof nh||i instanceof pc||i instanceof gc||i instanceof ih||i instanceof $r||i instanceof rh||i instanceof vc||i instanceof wl||i instanceof cm||i instanceof um||i instanceof am||i instanceof fm||i instanceof dm||i instanceof hm||i instanceof oa||i instanceof gm||i instanceof pm||i instanceof lm)&&r.transform.push(i.assemble()),(i instanceof gs||i instanceof ps||i instanceof kl||i instanceof Ks||i instanceof _c)&&r.transform.push(...i.assemble()),i instanceof qn&&(r.source&&r.transform.length===0?i.setSource(r.source):i.parent instanceof qn?i.setSource(r.name):(r.name||(r.name=`data_${t++}`),i.setSource(r.name),i.numChildren()===1&&(e.push(r),r={name:null,source:r.name,transform:[]}))),i.numChildren()){case 0:i instanceof qn&&(!r.source||r.transform.length>0)&&e.push(r);break;case 1:n(i.children[0],r);break;default:{r.name||(r.name=`data_${t++}`);let s=r.name;!r.source||r.transform.length>0?e.push(r):s=r.source;for(const o of i.children)n(o,{name:null,source:s,transform:[]});break}}}return n}function N1e(e){const t=[],n=rL(t);for(const i of e.children)n(i,{source:e.name,name:null,transform:[]});return t}function O1e(e,t){const n=[],i=rL(n);let r=0;for(const o of e.sources){o.hasName()||(o.dataName=`source_${r++}`);const a=o.assemble();i(o,a)}for(const o of n)o.transform.length===0&&delete o.transform;let s=0;for(const[o,a]of n.entries())(a.transform??[]).length===0&&!a.source&&n.splice(s++,0,n.splice(o,1)[0]);for(const o of n)for(const a of o.transform??[])a.type==="lookup"&&(a.from=e.outputNodes[a.from].getSource());for(const o of n)o.name in t&&(o.values=t[o.name]);return n}function R1e(e){return e==="top"||e==="left"||de(e)?"header":"footer"}function L1e(e){for(const t of Hi)I1e(e,t);oL(e,"x"),oL(e,"y")}function I1e(e,t){var o;const{facet:n,config:i,child:r,component:s}=e;if(e.channelHasField(t)){const a=n[t],l=yc("title",null,i,t);let u=oc(a,i,{allowDisabling:!0,includeDefault:l===void 0||!!l});r.component.layoutHeaders[t].title&&(u=q(u)?u.join(", "):u,u+=` / ${r.component.layoutHeaders[t].title}`,r.component.layoutHeaders[t].title=null);const c=yc("labelOrient",a.header,i,t),f=a.header!==null?Dt((o=a.header)==null?void 0:o.labels,i.header.labels,!0):!1,d=Be(["bottom","right"],c)?"footer":"header";s.layoutHeaders[t]={title:a.header!==null?u:null,facetFieldDef:a,[d]:t==="facet"?[]:[sL(e,t,f)]}}}function sL(e,t,n){const i=t==="row"?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(i)?e.child.getSizeSignalRef(i):void 0,axes:[]}}function oL(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:i,resolve:r}=e.component;if(r.axis[t]=_w(r,t),r.axis[t]==="shared"){const s=t==="x"?"column":"row",o=i[s];for(const a of n.component.axes[t]){const l=R1e(a.get("orient"));o[l]??(o[l]=[sL(e,s,!1)]);const u=Jd(a,"main",e.config,{header:!0});u&&o[l][0].axes.push(u),a.mainExtracted=!0}}}}function z1e(e){Iw(e),mm(e,"width"),mm(e,"height")}function P1e(e){Iw(e);const t=e.layout.columns===1?"width":"childWidth",n=e.layout.columns===void 0?"height":"childHeight";mm(e,t),mm(e,n)}function Iw(e){for(const t of e.children)t.parseLayoutSize()}function mm(e,t){const n=yR(t),i=m1(n),r=e.component.resolve,s=e.component.layoutSize;let o;for(const a of e.children){const l=a.component.layoutSize.getWithExplicit(n),u=r.scale[i]??vR(i,e);if(u==="independent"&&l.value==="step"){o=void 0;break}if(o){if(u==="independent"&&o.value!==l.value){o=void 0;break}o=na(o,l,n,"")}else o=l}if(o){for(const a of e.children)e.renameSignal(a.getName(n),e.getName(t)),a.component.layoutSize.set(n,"merged",!1);s.setWithExplicit(t,o)}else s.setWithExplicit(t,{explicit:!1,value:void 0})}function B1e(e){const{size:t,component:n}=e;for(const i of os){const r=ai(i);if(t[r]){const s=t[r];n.layoutSize.set(r,ds(s)?"step":s,!0)}else{const s=j1e(e,r);n.layoutSize.set(r,s,!1)}}}function j1e(e,t){const n=t==="width"?"x":"y",i=e.config,r=e.getScaleComponent(n);if(r){const s=r.get("type"),o=r.get("range");if(Jt(s)){const a=H1(i.view,t);return Jo(o)||ds(a)?"step":a}else return Z_(i.view,t)}else{if(e.hasProjection||e.mark==="arc")return Z_(i.view,t);{const s=H1(i.view,t);return ds(s)?s.step:s}}}function zw(e,t,n){return Q(t,{suffix:`by_${Q(e)}`,...n??{}})}class sh extends iL{constructor(t,n,i,r){super(t,"facet",n,i,r,t.resolve),this.child=qw(t.spec,this,this.getName("child"),void 0,r),this.children=[this.child],this.facet=this.initFacet(t.facet)}initFacet(t){if(!Hd(t))return{facet:this.initFacetFieldDef(t,"facet")};const n=G(t),i={};for(const r of n){if(![Is,zs].includes(r)){Y(x1(r,"facet"));break}const s=t[r];if(s.field===void 0){Y(a_(s,r));break}i[r]=this.initFacetFieldDef(s,r)}return i}initFacetFieldDef(t,n){const i=L_(t,n);return i.header?i.header=li(i.header):i.header===null&&(i.header=null),i}channelHasField(t){return!!this.facet[t]}fieldDef(t){return this.facet[t]}parseData(){this.component.data=ym(this),this.child.parseData()}parseLayoutSize(){Iw(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),L1e(this)}assembleSelectionTopLevelSignals(t){return this.child.assembleSelectionTopLevelSignals(t)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(t){return this.child.assembleSelectionData(t)}getHeaderLayoutMixins(){const t={};for(const n of Hi)for(const i of bw){const r=this.component.layoutHeaders[n],s=r[i],{facetFieldDef:o}=r;if(o){const a=yc("titleOrient",o.header,this.config,n);if(["right","bottom"].includes(a)){const l=nm(n,a);t.titleAnchor??(t.titleAnchor={}),t.titleAnchor[l]="end"}}if(s!=null&&s[0]){const a=n==="row"?"height":"width",l=i==="header"?"headerBand":"footerBand";n!=="facet"&&!this.child.component.layoutSize.get(a)&&(t[l]??(t[l]={}),t[l][n]=.5),r.title&&(t.offset??(t.offset={}),t.offset[n==="row"?"rowTitle":"columnTitle"]=10)}}return t}assembleDefaultLayout(){const{column:t,row:n}=this.facet,i=t?this.columnDistinctSignal():n?1:void 0;let r="all";return(!n&&this.component.resolve.scale.x==="independent"||!t&&this.component.resolve.scale.y==="independent")&&(r="none"),{...this.getHeaderLayoutMixins(),...i?{columns:i}:{},bounds:"full",align:r}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof sh))return{signal:`length(data('${this.getName("column_domain")}'))`}}assembleGroupStyle(){}assembleGroup(t){return this.parent&&this.parent instanceof sh?{...this.channelHasField("column")?{encode:{update:{columns:{field:Q(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(t)}:super.assembleGroup(t)}getCardinalityAggregateForChild(){const t=[],n=[],i=[];if(this.child instanceof sh){if(this.child.channelHasField("column")){const r=Q(this.child.facet.column);t.push(r),n.push("distinct"),i.push(`distinct_${r}`)}}else for(const r of os){const s=this.child.component.scales[r];if(s&&!s.merged){const o=s.get("type"),a=s.get("range");if(Jt(o)&&Jo(a)){const l=om(this.child,r),u=Nw(l);u?(t.push(u),n.push("distinct"),i.push(`distinct_${u}`)):Y(o_(r))}}}return{fields:t,ops:n,as:i}}assembleFacet(){const{name:t,data:n}=this.component.data.facetRoot,{row:i,column:r}=this.facet,{fields:s,ops:o,as:a}=this.getCardinalityAggregateForChild(),l=[];for(const c of Hi){const f=this.facet[c];if(f){l.push(Q(f));const{bin:d,sort:h}=f;if(mt(d)&&l.push(Q(f,{binSuffix:"end"})),us(h)){const{field:p,op:g=T1}=h,m=zw(f,h);i&&r?(s.push(m),o.push("max"),a.push(m)):(s.push(p),o.push(g),a.push(m))}else if(q(h)){const p=mc(f,c);s.push(p),o.push("max"),a.push(p)}}}const u=!!i&&!!r;return{name:t,data:n,groupby:l,...u||s.length>0?{aggregate:{...u?{cross:u}:{},...s.length?{fields:s,ops:o,as:a}:{}}}:{}}}facetSortFields(t){const{facet:n}=this,i=n[t];return i?us(i.sort)?[zw(i,i.sort,{expr:"datum"})]:q(i.sort)?[mc(i,t,{expr:"datum"})]:[Q(i,{expr:"datum"})]:[]}facetSortOrder(t){const{facet:n}=this,i=n[t];if(i){const{sort:r}=i;return[(us(r)?r.order:!q(r)&&r)||"ascending"]}return[]}assembleLabelTitle(){var r;const{facet:t,config:n}=this;if(t.facet)return vw(t.facet,"facet",n);const i={row:["top","bottom"],column:["left","right"]};for(const s of yw)if(t[s]){const o=yc("labelOrient",(r=t[s])==null?void 0:r.header,n,s);if(i[s].includes(o))return vw(t[s],s,n)}}assembleMarks(){const{child:t}=this,n=this.component.data.facetRoot,i=N1e(n),r=t.assembleGroupEncodeEntry(!1),s=this.assembleLabelTitle()||t.assembleTitle(),o=t.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...s?{title:s}:{},...o?{style:o}:{},from:{facet:this.assembleFacet()},sort:{field:Hi.map(l=>this.facetSortFields(l)).flat(),order:Hi.map(l=>this.facetSortOrder(l)).flat()},...i.length>0?{data:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup(Jpe(this,[]))}]}getMapping(){return this.facet}}function U1e(e,t){const{row:n,column:i}=t;if(n&&i){let r=null;for(const s of[n,i])if(us(s.sort)){const{field:o,op:a=T1}=s.sort;e=r=new wl(e,{joinaggregate:[{op:a,field:o,as:zw(s,s.sort,{forAs:!0})}],groupby:[Q(s)]})}return r}return null}function aL(e,t){var n,i,r,s;for(const o of t){const a=o.data;if(e.name&&o.hasName()&&e.name!==o.dataName)continue;const l=(n=e.format)==null?void 0:n.mesh,u=(i=a.format)==null?void 0:i.feature;if(l&&u)continue;const c=(r=e.format)==null?void 0:r.feature;if((c||u)&&c!==u)continue;const f=(s=a.format)==null?void 0:s.mesh;if(!((l||f)&&l!==f)){if(Yd(e)&&Yd(a)){if(ki(e.values,a.values))return o}else if(cc(e)&&cc(a)){if(e.url===a.url)return o}else if(wO(e)&&e.name===o.dataName)return o}}return null}function q1e(e,t){if(e.data||!e.parent){if(e.data===null){const i=new xl({values:[]});return t.push(i),i}const n=aL(e.data,t);if(n)return ia(e.data)||(n.data.format=IF({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const i=new xl(e.data);return t.push(i),i}}else return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}function W1e(e,t,n){let i=0;for(const r of t.transforms){let s,o;if(Dpe(r))o=e=new gc(e,r),s="derived";else if(tw(r)){const a=R0e(r);o=e=En.makeWithAncestors(e,{},a,n)??e,e=new pc(e,t,r.filter)}else if(pO(r))o=e=gs.makeFromTransform(e,r,t),s="number";else if(Ope(r))s="date",n.getWithExplicit(r.field).value===void 0&&(e=new En(e,{[r.field]:s}),n.set(r.field,s,!1)),o=e=ps.makeFromTransform(e,r);else if(Rpe(r))o=e=$r.makeFromTransform(e,r),s="number",dw(t)&&(e=new oa(e));else if(hO(r))o=e=rh.make(e,t,r,i++),s="derived";else if(Tpe(r))o=e=new vc(e,r),s="number";else if(Mpe(r))o=e=new wl(e,r),s="number";else if(Lpe(r))o=e=Ks.makeFromTransform(e,r),s="derived";else if(Ipe(r))o=e=new cm(e,r),s="derived";else if(zpe(r))o=e=new lm(e,r),s="derived";else if(Fpe(r))o=e=new um(e,r),s="derived";else if(kpe(r))o=e=new pm(e,r),s="derived";else if(Ape(r))e=new gm(e,r);else if(Npe(r))o=e=kl.makeFromTransform(e,r),s="derived";else if($pe(r))o=e=new am(e,r),s="derived";else if(Epe(r))o=e=new dm(e,r),s="derived";else if(Cpe(r))o=e=new hm(e,r),s="derived";else if(Spe(r))o=e=new fm(e,r),s="derived";else{Y(cfe(r));continue}if(o&&s!==void 0)for(const a of o.producedFields()??[])n.set(a,s,!1)}return e}function ym(e){var g;let t=q1e(e,e.component.data.sources);const{outputNodes:n,outputNodeRefCounts:i}=e.component.data,r=e.data,o=!(r&&(ia(r)||cc(r)||Yd(r)))&&e.parent?e.parent.component.data.ancestorParse.clone():new Zpe;ia(r)?(kO(r)?t=new eh(t,r.sequence):rw(r)&&(t=new Qd(t,r.graticule)),o.parseNothing=!0):((g=r==null?void 0:r.format)==null?void 0:g.parse)===null&&(o.parseNothing=!0),t=En.makeExplicit(t,e,o)??t,t=new oa(t);const a=e.parent&&xc(e.parent);(At(e)||Cr(e))&&a&&(t=gs.makeFromEncoding(t,e)??t),e.transforms.length>0&&(t=W1e(t,e,o));const l=I0e(e),u=L0e(e);t=En.makeWithAncestors(t,{},{...l,...u},o)??t,At(e)&&(t=_c.parseAll(t,e),t=ih.parseAll(t,e)),(At(e)||Cr(e))&&(a||(t=gs.makeFromEncoding(t,e)??t),t=ps.makeFromEncoding(t,e)??t,t=gc.parseAllForSortIndex(t,e));const c=e.getDataName(yt.Raw),f=new qn(t,c,yt.Raw,i);if(n[c]=f,t=f,At(e)){const m=$r.makeFromEncoding(t,e);m&&(t=m,dw(e)&&(t=new oa(t))),t=kl.makeFromEncoding(t,e)??t,t=Ks.makeFromEncoding(t,e)??t}At(e)&&(t=nh.make(t,e)??t);const d=e.getDataName(yt.Main),h=new qn(t,d,yt.Main,i);n[d]=h,t=h,At(e)&&Dge(e,h);let p=null;if(Cr(e)){const m=e.getName("facet");t=U1e(t,e.facet)??t,p=new bc(t,e,m,h.getSource()),n[m]=p}return{...e.component.data,outputNodes:n,outputNodeRefCounts:i,raw:f,main:h,facetRoot:p,ancestorParse:o}}class H1e extends Lw{constructor(t,n,i,r){var s,o,a,l;super(t,"concat",n,i,r,t.resolve),(((o=(s=t.resolve)==null?void 0:s.axis)==null?void 0:o.x)==="shared"||((l=(a=t.resolve)==null?void 0:a.axis)==null?void 0:l.y)==="shared")&&Y(afe),this.children=this.getChildren(t).map((u,c)=>qw(u,this,this.getName(`concat_${c}`),void 0,r))}parseData(){this.component.data=ym(this);for(const t of this.children)t.parseData()}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of G(t.component.selection))this.component.selection[n]=t.component.selection[n]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){for(const t of this.children)t.parseAxesAndHeaders()}getChildren(t){return q1(t)?t.vconcat:Y_(t)?t.hconcat:t.concat}parseLayoutSize(){P1e(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.forEach(t=>t.assembleSignals()),[]}assembleLayoutSignals(){const t=xw(this);for(const n of this.children)t.push(...n.assembleLayoutSignals());return t}assembleSelectionData(t){return this.children.reduce((n,i)=>i.assembleSelectionData(n),t)}assembleMarks(){return this.children.map(t=>{const n=t.assembleTitle(),i=t.assembleGroupStyle(),r=t.assembleGroupEncodeEntry(!1);return{type:"group",name:t.getName("group"),...n?{title:n}:{},...i?{style:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup()}})}assembleGroupStyle(){}assembleDefaultLayout(){const t=this.layout.columns;return{...t!=null?{columns:t}:{},bounds:"full",align:"each"}}}function G1e(e){return e===!1||e===null}const V1e={disable:1,gridScale:1,scale:1,...CN,labelExpr:1,encode:1},lL=G(V1e);class Pw extends Ys{constructor(t={},n={},i=!1){super(),this.explicit=t,this.implicit=n,this.mainExtracted=i}clone(){return new Pw(Ce(this.explicit),Ce(this.implicit),this.mainExtracted)}hasAxisPart(t){return t==="axis"?!0:t==="grid"||t==="title"?!!this.get(t):!G1e(this.get(t))}hasOrientSignalRef(){return de(this.explicit.orient)}}function X1e(e,t,n){const{encoding:i,config:r}=e,s=Ut(i[t])??Ut(i[ss(t)]),o=e.axis(t)||{},{format:a,formatType:l}=o;if(pl(l))return{text:_r({fieldOrDatumDef:s,field:"datum.value",format:a,formatType:l,config:r}),...n};if(a===void 0&&l===void 0&&r.customFormatTypes){if(rc(s)==="quantitative"){if(sc(s)&&s.stack==="normalize"&&r.normalizedNumberFormatType)return{text:_r({fieldOrDatumDef:s,field:"datum.value",format:r.normalizedNumberFormat,formatType:r.normalizedNumberFormatType,config:r}),...n};if(r.numberFormatType)return{text:_r({fieldOrDatumDef:s,field:"datum.value",format:r.numberFormat,formatType:r.numberFormatType,config:r}),...n}}if(rc(s)==="temporal"&&r.timeFormatType&&Z(s)&&!s.timeUnit)return{text:_r({fieldOrDatumDef:s,field:"datum.value",format:r.timeFormat,formatType:r.timeFormatType,config:r}),...n}}return n}function Y1e(e){return os.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[nme(n,e)]),t),{})}const Z1e={bottom:"top",top:"bottom",left:"right",right:"left"};function K1e(e){const{axes:t,resolve:n}=e.component,i={top:0,bottom:0,right:0,left:0};for(const r of e.children){r.parseAxesAndHeaders();for(const s of G(r.component.axes))n.axis[s]=_w(e.component.resolve,s),n.axis[s]==="shared"&&(t[s]=J1e(t[s],r.component.axes[s]),t[s]||(n.axis[s]="independent",delete t[s]))}for(const r of os){for(const s of e.children)if(s.component.axes[r]){if(n.axis[r]==="independent"){t[r]=(t[r]??[]).concat(s.component.axes[r]);for(const o of s.component.axes[r]){const{value:a,explicit:l}=o.getWithExplicit("orient");if(!de(a)){if(i[a]>0&&!l){const u=Z1e[a];i[a]>i[u]&&o.set("orient",u,!1)}i[a]++}}}delete s.component.axes[r]}if(n.axis[r]==="independent"&&t[r]&&t[r].length>1)for(const[s,o]of(t[r]||[]).entries())s>0&&o.get("grid")&&!o.explicit.grid&&(o.implicit.grid=!1)}}function J1e(e,t){if(e){if(e.length!==t.length)return;const n=e.length;for(let i=0;in.clone());return e}function Q1e(e,t){for(const n of lL){const i=na(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",(r,s)=>{switch(n){case"title":return gD(r,s);case"gridScale":return{explicit:r.explicit,value:Dt(r.value,s.value)}}return V1(r,s,n,"axis")});e.setWithExplicit(n,i)}return e}function eme(e,t,n,i,r){if(t==="disable")return n!==void 0;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(de(n.labelAngle)?n.labelAngle:Ld(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===fR(i,r))return!0}return e===n[t]}const tme=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function nme(e,t){var y,b;let n=t.axis(e);const i=new Pw,r=Ut(t.encoding[e]),{mark:s,config:o}=t,a=(n==null?void 0:n.orient)||((y=o[e==="x"?"axisX":"axisY"])==null?void 0:y.orient)||((b=o.axis)==null?void 0:b.orient)||Uge(e),l=t.getScaleComponent(e).get("type"),u=Rge(e,l,a,t.config),c=n!==void 0?!n:gw("disable",o.style,n==null?void 0:n.style,u).configValue;if(i.set("disable",c,n!==void 0),c)return i;n=n||{};const f=Pge(r,n,e,o.style,u),d=oN(n.formatType,r,l),h=sN(r,r.type,n.format,n.formatType,o,!0),p={fieldOrDatumDef:r,axis:n,channel:e,model:t,scaleType:l,orient:a,labelAngle:f,format:h,formatType:d,mark:s,config:o};for(const v of lL){const x=v in lR?lR[v](p):SN(v)?n[v]:void 0,_=x!==void 0,k=eme(x,v,n,t,e);if(_&&k)i.set(v,x,k);else{const{configValue:w=void 0,configFrom:$=void 0}=SN(v)&&v!=="values"?gw(v,o.style,n.style,u):{},S=w!==void 0;_&&!S?i.set(v,x,k):($!=="vgAxisConfig"||tme.has(v)&&S||Xd(w)||de(w))&&i.set(v,w,!1)}}const g=n.encoding??{},m=EN.reduce((v,x)=>{if(!i.hasAxisPart(x))return v;const _=bR(g[x]??{},t),k=x==="labels"?X1e(t,e,_):_;return k!==void 0&&!ut(k)&&(v[x]={update:k}),v},{});return ut(m)||i.set("encode",m,!!n.encoding||n.labelAngle!==void 0),i}function ime({encoding:e,size:t}){for(const n of os){const i=ai(n);ds(t[i])&&ta(e[n])&&(delete t[i],Y(SD(i)))}return t}const rme={vgMark:"arc",encodeEntry:e=>({...Gi(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...$n("x",e,{defaultPos:"mid"}),...$n("y",e,{defaultPos:"mid"}),...ra(e,"radius"),...ra(e,"theta")})},sme={vgMark:"area",encodeEntry:e=>({...Gi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...K1("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="horizontal"}),...K1("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="vertical"}),...cw(e)})},ome={vgMark:"rect",encodeEntry:e=>({...Gi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...ra(e,"x"),...ra(e,"y")})},ame={vgMark:"shape",encodeEntry:e=>({...Gi(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:e=>{const{encoding:t}=e,n=t.shape;return[{type:"geoshape",projection:e.projectionName(),...n&&Z(n)&&n.type===nc?{field:Q(n,{expr:"datum"})}:{}}]}},lme={vgMark:"image",encodeEntry:e=>({...Gi(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...ra(e,"x"),...ra(e,"y"),...lw(e,"url")})},ume={vgMark:"line",encodeEntry:e=>({...Gi(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...$n("x",e,{defaultPos:"mid"}),...$n("y",e,{defaultPos:"mid"}),...Qt("size",e,{vgChannel:"strokeWidth"}),...cw(e)})},cme={vgMark:"trail",encodeEntry:e=>({...Gi(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...$n("x",e,{defaultPos:"mid"}),...$n("y",e,{defaultPos:"mid"}),...Qt("size",e),...cw(e)})};function Bw(e,t){const{config:n}=e;return{...Gi(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...$n("x",e,{defaultPos:"mid"}),...$n("y",e,{defaultPos:"mid"}),...Qt("size",e),...Qt("angle",e),...fme(e,n,t)}}function fme(e,t,n){return n?{shape:{value:n}}:Qt("shape",e)}const dme={vgMark:"symbol",encodeEntry:e=>Bw(e)},hme={vgMark:"symbol",encodeEntry:e=>Bw(e,"circle")},pme={vgMark:"symbol",encodeEntry:e=>Bw(e,"square")},gme={vgMark:"rect",encodeEntry:e=>({...Gi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...ra(e,"x"),...ra(e,"y")})},mme={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return!e.encoding.x&&!e.encoding.y&&!e.encoding.latitude&&!e.encoding.longitude?{}:{...Gi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...K1("x",e,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"}),...K1("y",e,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"}),...Qt("size",e,{vgChannel:"strokeWidth"})}}},yme={vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return{...Gi(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...$n("x",e,{defaultPos:"mid"}),...$n("y",e,{defaultPos:"mid"}),...lw(e),...Qt("size",e,{vgChannel:"fontSize"}),...Qt("angle",e),...qO("align",bme(e.markDef,n,t)),...qO("baseline",vme(e.markDef,n,t)),...$n("radius",e,{defaultPos:null}),...$n("theta",e,{defaultPos:null})}}};function bme(e,t,n){if(it("align",e,n)===void 0)return"center"}function vme(e,t,n){if(it("baseline",e,n)===void 0)return"middle"}const xme={vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,i=n.orient,r=i==="horizontal"?"width":"height",s=i==="horizontal"?"height":"width";return{...Gi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...$n("x",e,{defaultPos:"mid",vgChannel:"xc"}),...$n("y",e,{defaultPos:"mid",vgChannel:"yc"}),...Qt("size",e,{defaultValue:_me(e),vgChannel:r}),[s]:vt(it("thickness",n,t))}}};function _me(e){const{config:t,markDef:n}=e,{orient:i}=n,r=i==="horizontal"?"width":"height",s=e.getScaleComponent(i==="horizontal"?"x":"y"),o=it("size",n,t,{vgChannel:r})??t.tick.bandSize;if(o!==void 0)return o;{const a=s?s.get("range"):void 0;return a&&Jo(a)&&Xe(a.step)?a.step*3/4:W1(t.view,r)*3/4}}const bm={arc:rme,area:sme,bar:ome,circle:hme,geoshape:ame,image:lme,line:ume,point:dme,rect:gme,rule:mme,square:pme,text:yme,tick:xme,trail:cme};function wme(e){if(Be([E1,k1,Lde],e.mark)){const t=DN(e.mark,e.encoding);if(t.length>0)return kme(e,t)}else if(e.mark===$1){const t=r_.some(n=>it(n,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t)return $me(e)}return jw(e)}const uL="faceted_path_";function kme(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:uL+e.requestDataName(yt.Main),data:e.requestDataName(yt.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:jw(e,{fromPrefix:uL})}]}const cL="stack_group_";function $me(e){var u;const[t]=jw(e,{fromPrefix:cL}),n=e.scaleName(e.stack.fieldChannel),i=(c={})=>e.vgField(e.stack.fieldChannel,c),r=(c,f)=>{const d=[i({prefix:"min",suffix:"start",expr:f}),i({prefix:"max",suffix:"start",expr:f}),i({prefix:"min",suffix:"end",expr:f}),i({prefix:"max",suffix:"end",expr:f})];return`${c}(${d.map(h=>`scale('${n}',${h})`).join(",")})`};let s,o;e.stack.fieldChannel==="x"?(s={...Yu(t.encode.update,["y","yc","y2","height",...r_]),x:{signal:r("min","datum")},x2:{signal:r("max","datum")},clip:{value:!0}},o={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update={...ri(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(s={...Yu(t.encode.update,["x","xc","x2","width"]),y:{signal:r("min","datum")},y2:{signal:r("max","datum")},clip:{value:!0}},o={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update={...ri(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const c of r_){const f=Gs(c,e.markDef,e.config);t.encode.update[c]?(s[c]=t.encode.update[c],delete t.encode.update[c]):f&&(s[c]=vt(f)),f&&(t.encode.update[c]={value:0})}const a=[];if(((u=e.stack.groupbyChannels)==null?void 0:u.length)>0)for(const c of e.stack.groupbyChannels){const f=e.fieldDef(c),d=Q(f);d&&a.push(d),(f!=null&&f.bin||f!=null&&f.timeUnit)&&a.push(Q(f,{binSuffix:"end"}))}return s=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((c,f)=>{if(t.encode.update[f])return{...c,[f]:t.encode.update[f]};{const d=Gs(f,e.markDef,e.config);return d!==void 0?{...c,[f]:vt(d)}:c}},s),s.stroke&&(s.strokeForeground={value:!0},s.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(yt.Main),name:cL+e.requestDataName(yt.Main),groupby:a,aggregate:{fields:[i({suffix:"start"}),i({suffix:"start"}),i({suffix:"end"}),i({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:s},marks:[{type:"group",encode:{update:o},marks:[t]}]}]}function Eme(e){var a;const{encoding:t,stack:n,mark:i,markDef:r,config:s}=e,o=t.order;if(!(!q(o)&&wr(o)&&U7(o.value)||!o&&U7(it("order",r,s)))){if((q(o)||Z(o))&&!n)return dD(o,{expr:"datum"});if(Qo(i)){const l=r.orient==="horizontal"?"y":"x",u=t[l];if(Z(u)){const c=u.sort;if(q(c))return{field:Q(u,{prefix:l,suffix:"sort_index",expr:"datum"})};if(us(c))return{field:Q({aggregate:I_(e.encoding)?c.op:void 0,field:c.field},{expr:"datum"})};if(cN(c)){const f=e.fieldDef(c.encoding);return{field:Q(f,{expr:"datum"}),order:c.order}}else return c===null?void 0:{field:Q(u,{binSuffix:(a=e.stack)!=null&&a.impute?"mid":void 0,expr:"datum"})}}return}}}function jw(e,t={fromPrefix:""}){const{mark:n,markDef:i,encoding:r,config:s}=e,o=Dt(i.clip,Cme(e),Sme(e)),a=cD(i),l=r.key,u=Eme(e),c=Ame(e),f=it("aria",i,s),d=bm[n].postEncodingTransform?bm[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:bm[n].vgMark,...o?{clip:!0}:{},...a?{style:a}:{},...l?{key:l.field}:{},...u?{sort:u}:{},...c||{},...f===!1?{aria:f}:{},from:{data:t.fromPrefix+e.requestDataName(yt.Main)},encode:{update:bm[n].encodeEntry(e)},...d?{transform:d}:{}}]}function Cme(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return t!=null&&t.get("selectionExtent")||n!=null&&n.get("selectionExtent")?!0:void 0}function Sme(e){const t=e.component.projection;return t&&!t.isFit?!0:void 0}function Ame(e){if(!e.component.selection)return null;const t=G(e.component.selection).length;let n=t,i=e.parent;for(;i&&n===0;)n=G(i.component.selection).length,i=i.parent;return n?{interactive:t>0||e.mark==="geoshape"||!!e.encoding.tooltip}:null}class fL extends iL{constructor(t,n,i,r={},s){super(t,"unit",n,i,s,void 0,ZN(t)?t.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[];const o=ls(t.mark)?{...t.mark}:{type:t.mark},a=o.type;o.filled===void 0&&(o.filled=dpe(o,s,{graticule:t.data&&rw(t.data)}));const l=this.encoding=vhe(t.encoding||{},a,o.filled,s);this.markDef=sO(o,l,s),this.size=ime({encoding:l,size:ZN(t)?{...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}}:r}),this.stack=rO(this.markDef,l),this.specifiedScales=this.initScales(a,l),this.specifiedAxes=this.initAxes(l),this.specifiedLegends=this.initLegends(l),this.specifiedProjection=t.projection,this.selection=(t.params??[]).filter(u=>V_(u))}get hasProjection(){const{encoding:t}=this,n=this.mark===QD,i=t&&wce.some(r=>Se(t[r]));return n||i}scaleDomain(t){const n=this.specifiedScales[t];return n?n.domain:void 0}axis(t){return this.specifiedAxes[t]}legend(t){return this.specifiedLegends[t]}initScales(t,n){return y1.reduce((i,r)=>{const s=Ut(n[r]);return s&&(i[r]=this.initScale(s.scale??{})),i},{})}initScale(t){const{domain:n,range:i}=t,r=li(t);return q(n)&&(r.domain=n.map($i)),q(i)&&(r.range=i.map($i)),r}initAxes(t){return os.reduce((n,i)=>{const r=t[i];if(Se(r)||i===wt&&Se(t.x2)||i===Zt&&Se(t.y2)){const s=Se(r)?r.axis:void 0;n[i]=s&&this.initAxis({...s})}return n},{})}initAxis(t){const n=G(t),i={};for(const r of n){const s=t[r];i[r]=Xd(s)?aD(s):$i(s)}return i}initLegends(t){return Dce.reduce((n,i)=>{const r=Ut(t[i]);if(r&&Oce(i)){const s=r.legend;n[i]=s&&li(s)}return n},{})}parseData(){this.component.data=ym(this)}parseLayoutSize(){B1e(this)}parseSelections(){this.component.selection=Fge(this,this.selection)}parseMarkGroup(){this.component.mark=wme(this)}parseAxesAndHeaders(){this.component.axes=Y1e(this)}assembleSelectionTopLevelSignals(t){return Qpe(this,t)}assembleSignals(){return[...oR(this),...Kpe(this,[])]}assembleSelectionData(t){return ege(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return xw(this)}assembleMarks(){let t=this.component.mark??[];return(!this.parent||!xc(this.parent))&&(t=CO(this,t)),t.map(this.correctDataNames)}assembleGroupStyle(){const{style:t}=this.view||{};return t!==void 0?t:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(t){return ml(this.encoding,t)}fieldDef(t){const n=this.encoding[t];return fs(n)}typedFieldDef(t){const n=this.fieldDef(t);return Un(n)?n:null}}class Uw extends Lw{constructor(t,n,i,r,s){super(t,"layer",n,i,s,t.resolve,t.view);const o={...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}};this.children=t.layer.map((a,l)=>{if(G1(a))return new Uw(a,this,this.getName(`layer_${l}`),o,s);if(Vs(a))return new fL(a,this,this.getName(`layer_${l}`),o,s);throw new Error(s_(a))})}parseData(){this.component.data=ym(this);for(const t of this.children)t.parseData()}parseLayoutSize(){z1e(this)}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of G(t.component.selection))this.component.selection[n]=t.component.selection[n]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){K1e(this)}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleSignals()),oR(this))}assembleLayoutSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleLayoutSignals()),xw(this))}assembleSelectionData(t){return this.children.reduce((n,i)=>i.assembleSelectionData(n),t)}assembleGroupStyle(){const t=new Set;for(const i of this.children)for(const r of ee(i.assembleGroupStyle()))t.add(r);const n=Array.from(t);return n.length>1?n:n.length===1?n[0]:void 0}assembleTitle(){let t=super.assembleTitle();if(t)return t;for(const n of this.children)if(t=n.assembleTitle(),t)return t}assembleLayout(){return null}assembleMarks(){return tge(this,this.children.flatMap(t=>t.assembleMarks()))}assembleLegends(){return this.children.reduce((t,n)=>t.concat(n.assembleLegends()),TR(this))}}function qw(e,t,n,i,r){if(M1(e))return new sh(e,t,n,r);if(G1(e))return new Uw(e,t,n,i,r);if(Vs(e))return new fL(e,t,n,i,r);if(Uhe(e))return new H1e(e,t,n,r);throw new Error(s_(e))}function Tme(e,t={}){t.logger&&Kfe(t.logger),t.fieldTitle&&_N(t.fieldTitle);try{const n=nO(Wl(t.config,e.config)),i=bO(e,n),r=qw(i,null,"",void 0,n);return r.parse(),Q0e(r.component.data,r),{spec:Fme(r,Mme(e,i.autosize,n,r),e.datasets,e.usermeta),normalized:i}}finally{t.logger&&Jfe(),t.fieldTitle&&fhe()}}function Mme(e,t,n,i){const r=i.component.layoutSize.get("width"),s=i.component.layoutSize.get("height");if(t===void 0?(t={type:"pad"},i.hasAxisOrientSignalRef()&&(t.resize=!0)):te(t)&&(t={type:t}),r&&s&&Vpe(t.type)){if(r==="step"&&s==="step")Y(bD()),t.type="pad";else if(r==="step"||s==="step"){const o=r==="step"?"width":"height";Y(bD(m1(o)));const a=o==="width"?"height":"width";t.type=Xpe(a)}}return{...G(t).length===1&&t.type?t.type==="pad"?{}:{autosize:t.type}:{autosize:t},...xO(n,!1),...xO(e,!0)}}function Fme(e,t,n={},i){const r=e.config?epe(e.config):void 0,s=[].concat(e.assembleSelectionData([]),O1e(e.component.data,n)),o=e.assembleProjections(),a=e.assembleTitle(),l=e.assembleGroupStyle(),u=e.assembleGroupEncodeEntry(!0);let c=e.assembleLayoutSignals();c=c.filter(h=>(h.name==="width"||h.name==="height")&&h.value!==void 0?(t[h.name]=+h.value,!1):!0);const{params:f,...d}=t;return{$schema:"https://vega.github.io/schema/vega/v5.json",...e.description?{description:e.description}:{},...d,...a?{title:a}:{},...l?{style:l}:{},...u?{encode:{update:u}}:{},data:s,...o.length>0?{projections:o}:{},...e.assembleGroup([...c,...e.assembleSelectionTopLevelSignals([]),...XN(f)]),...r?{config:r}:{},...i?{usermeta:i}:{}}}const Dme=mce.version,Nme=Object.freeze(Object.defineProperty({__proto__:null,accessPathDepth:Zu,accessPathWithDatum:V7,compile:Tme,contains:Be,deepEqual:ki,deleteNestedProperty:u1,duplicate:Ce,entries:qo,every:q7,fieldIntersection:G7,flatAccessWithDatum:PF,getFirstDefined:Dt,hasIntersection:W7,hash:Pe,internalField:UF,isBoolean:Nd,isEmpty:ut,isEqual:bce,isInternalField:qF,isNullOrFalse:U7,isNumeric:c1,keys:G,logicalExpr:Od,mergeDeep:IF,never:LF,normalize:bO,normalizeAngle:Ld,omit:ri,pick:Yu,prefixGenerator:H7,removePathFromField:X7,replaceAll:il,replacePathInField:Ui,resetIdCounter:xce,setEqual:zF,some:nl,stringify:ct,titleCase:Rd,unique:ts,uniqueId:jF,vals:ln,varName:_t,version:Dme},Symbol.toStringTag,{value:"Module"}));function dL(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}}var Ome="vega-themes",Rme="2.14.0",Lme="Themes for stylized Vega and Vega-Lite visualizations.",Ime=["vega","vega-lite","themes","style"],zme="BSD-3-Clause",Pme={name:"UW Interactive Data Lab",url:"https://idl.cs.washington.edu"},Bme=[{name:"Emily Gu",url:"https://github.com/emilygu"},{name:"Arvind Satyanarayan",url:"http://arvindsatya.com"},{name:"Jeffrey Heer",url:"https://idl.cs.washington.edu"},{name:"Dominik Moritz",url:"https://www.domoritz.de"}],jme="build/vega-themes.js",Ume="build/vega-themes.module.js",qme="build/vega-themes.min.js",Wme="build/vega-themes.min.js",Hme="build/vega-themes.module.d.ts",Gme={type:"git",url:"https://github.com/vega/vega-themes.git"},Vme=["src","build"],Xme={prebuild:"yarn clean",build:"rollup -c",clean:"rimraf build && rimraf examples/build","copy:data":"rsync -r node_modules/vega-datasets/data/* examples/data","copy:build":"rsync -r build/* examples/build","deploy:gh":"yarn build && mkdir -p examples/build && rsync -r build/* examples/build && gh-pages -d examples",preversion:"yarn lint",serve:"browser-sync start -s -f build examples --serveStatic examples",start:"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'",format:"eslint . --fix",lint:"eslint .",release:"release-it"},Yme={"@babel/core":"^7.22.9","@babel/plugin-proposal-async-generator-functions":"^7.20.7","@babel/plugin-proposal-json-strings":"^7.18.6","@babel/plugin-proposal-object-rest-spread":"^7.20.7","@babel/plugin-proposal-optional-catch-binding":"^7.18.6","@babel/plugin-transform-runtime":"^7.22.9","@babel/preset-env":"^7.22.9","@babel/preset-typescript":"^7.22.5","@release-it/conventional-changelog":"^7.0.0","@rollup/plugin-json":"^6.0.0","@rollup/plugin-node-resolve":"^15.1.0","@rollup/plugin-terser":"^0.4.3","@typescript-eslint/eslint-plugin":"^6.0.0","@typescript-eslint/parser":"^6.0.0","browser-sync":"^2.29.3",concurrently:"^8.2.0",eslint:"^8.45.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^5.0.0","gh-pages":"^5.0.0",prettier:"^3.0.0","release-it":"^16.1.0",rollup:"^3.26.2","rollup-plugin-bundle-size":"^1.0.3","rollup-plugin-ts":"^3.2.0",typescript:"^5.1.6",vega:"^5.25.0","vega-lite":"^5.9.3"},Zme={vega:"*","vega-lite":"*"},Kme={},Jme={name:Ome,version:Rme,description:Lme,keywords:Ime,license:zme,author:Pme,contributors:Bme,main:jme,module:Ume,unpkg:qme,jsdelivr:Wme,types:Hme,repository:Gme,files:Vme,scripts:Xme,devDependencies:Yme,peerDependencies:Zme,dependencies:Kme};const wc="#fff",hL="#888",Qme={background:"#333",view:{stroke:hL},title:{color:wc,subtitleColor:wc},style:{"guide-label":{fill:wc},"guide-title":{fill:wc}},axis:{domainColor:wc,gridColor:hL,tickColor:wc}},$l="#4572a7",e2e={background:"#fff",arc:{fill:$l},area:{fill:$l},line:{stroke:$l,strokeWidth:2},path:{stroke:$l},rect:{fill:$l},shape:{stroke:$l},symbol:{fill:$l,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},El="#30a2da",Ww="#cbcbcb",t2e="#999",n2e="#333",pL="#f0f0f0",gL="#333",i2e={arc:{fill:El},area:{fill:El},axis:{domainColor:Ww,grid:!0,gridColor:Ww,gridWidth:1,labelColor:t2e,labelFontSize:10,titleColor:n2e,tickColor:Ww,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:pL,group:{fill:pL},legend:{labelColor:gL,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:gL,titleFontSize:14,titlePadding:10},line:{stroke:El,strokeWidth:2},path:{stroke:El,strokeWidth:.5},rect:{fill:El},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:El},bar:{binSpacing:2,fill:El,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},Cl="#000",r2e={group:{fill:"#e5e5e5"},arc:{fill:Cl},area:{fill:Cl},line:{stroke:Cl},path:{stroke:Cl},rect:{fill:Cl},shape:{stroke:Cl},symbol:{fill:Cl,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},s2e=22,o2e="normal",mL="Benton Gothic, sans-serif",yL=11.5,a2e="normal",Sl="#82c6df",Hw="Benton Gothic Bold, sans-serif",bL="normal",vL=13,oh={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]},l2e={background:"#ffffff",title:{anchor:"start",color:"#000000",font:Hw,fontSize:s2e,fontWeight:o2e},arc:{fill:Sl},area:{fill:Sl},line:{stroke:Sl,strokeWidth:2},path:{stroke:Sl},rect:{fill:Sl},shape:{stroke:Sl},symbol:{fill:Sl,size:30},axis:{labelFont:mL,labelFontSize:yL,labelFontWeight:a2e,titleFont:Hw,titleFontSize:vL,titleFontWeight:bL},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:mL,labelFontSize:yL,symbolType:"square",titleFont:Hw,titleFontSize:vL,titleFontWeight:bL},range:{category:oh["category-6"],diverging:oh["fireandice-6"],heatmap:oh["fire-7"],ordinal:oh["fire-7"],ramp:oh["fire-7"]}},Al="#ab5787",vm="#979797",u2e={background:"#f9f9f9",arc:{fill:Al},area:{fill:Al},line:{stroke:Al},path:{stroke:Al},rect:{fill:Al},shape:{stroke:Al},symbol:{fill:Al,size:30},axis:{domainColor:vm,domainWidth:.5,gridWidth:.2,labelColor:vm,tickColor:vm,tickWidth:.2,titleColor:vm},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},Tl="#3e5c69",c2e={background:"#fff",arc:{fill:Tl},area:{fill:Tl},line:{stroke:Tl},path:{stroke:Tl},rect:{fill:Tl},shape:{stroke:Tl},symbol:{fill:Tl},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},Vi="#1696d2",xL="#000000",f2e="#FFFFFF",xm="Lato",Gw="Lato",d2e="Lato",h2e="#DEDDDD",p2e=18,ah={"main-colors":["#1696d2","#d2d2d2","#000000","#fdbf11","#ec008b","#55b748","#5c5859","#db2b27"],"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"shades-gray":["#F5F5F5","#ECECEC","#E3E3E3","#DCDBDB","#D2D2D2","#9D9D9D","#696969","#353535"],"shades-yellow":["#FFF2CF","#FCE39E","#FDD870","#FCCB41","#FDBF11","#E88E2D","#CA5800","#843215"],"shades-magenta":["#F5CBDF","#EB99C2","#E46AA7","#E54096","#EC008B","#AF1F6B","#761548","#351123"],"shades-green":["#DCEDD9","#BCDEB4","#98CF90","#78C26D","#55B748","#408941","#2C5C2D","#1A2E19"],"shades-black":["#D5D5D4","#ADABAC","#848081","#5C5859","#332D2F","#262223","#1A1717","#0E0C0D"],"shades-red":["#F8D5D4","#F1AAA9","#E9807D","#E25552","#DB2B27","#A4201D","#6E1614","#370B0A"],"one-group":["#1696d2","#000000"],"two-groups-cat-1":["#1696d2","#000000"],"two-groups-cat-2":["#1696d2","#fdbf11"],"two-groups-cat-3":["#1696d2","#db2b27"],"two-groups-seq":["#a2d4ec","#1696d2"],"three-groups-cat":["#1696d2","#fdbf11","#000000"],"three-groups-seq":["#a2d4ec","#1696d2","#0a4c6a"],"four-groups-cat-1":["#000000","#d2d2d2","#fdbf11","#1696d2"],"four-groups-cat-2":["#1696d2","#ec0008b","#fdbf11","#5c5859"],"four-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a"],"five-groups-cat-1":["#1696d2","#fdbf11","#d2d2d2","#ec008b","#000000"],"five-groups-cat-2":["#1696d2","#0a4c6a","#d2d2d2","#fdbf11","#332d2f"],"five-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a","#000000"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-cat-2":["#1696d2","#d2d2d2","#ec008b","#fdbf11","#332d2f","#0a4c6a"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},g2e={background:f2e,title:{anchor:"start",fontSize:p2e,font:xm},axisX:{domain:!0,domainColor:xL,domainWidth:1,grid:!1,labelFontSize:12,labelFont:Gw,labelAngle:0,tickColor:xL,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:xm},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:h2e,gridWidth:1,labelFontSize:12,labelFont:Gw,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:xm,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:Gw,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:xm,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:ah["six-groups-cat-1"],diverging:ah["diverging-colors"],heatmap:ah["diverging-colors"],ordinal:ah["six-groups-seq"],ramp:ah["shades-blue"]},area:{fill:Vi},rect:{fill:Vi},line:{color:Vi,stroke:Vi,strokeWidth:5},trail:{color:Vi,stroke:Vi,strokeWidth:0,size:1},path:{stroke:Vi,strokeWidth:.5},point:{filled:!0},text:{font:d2e,color:Vi,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:Vi,stroke:null}},arc:{fill:Vi},shape:{stroke:Vi},symbol:{fill:Vi,size:30}},Ml="#3366CC",_L="#ccc",_m="Arial, sans-serif",m2e={arc:{fill:Ml},area:{fill:Ml},path:{stroke:Ml},rect:{fill:Ml},shape:{stroke:Ml},symbol:{stroke:Ml},circle:{fill:Ml},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:_m,fontSize:12},"guide-title":{font:_m,fontSize:12},"group-title":{font:_m,fontSize:12}},title:{font:_m,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:_L,tickColor:_L,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},Vw=e=>e*(1/3+1),wL=Vw(9),kL=Vw(10),$L=Vw(12),lh="Segoe UI",EL="wf_standard-font, helvetica, arial, sans-serif",CL="#252423",uh="#605E5C",SL="transparent",y2e="#C8C6C4",Sr="#118DFF",b2e="#12239E",v2e="#E66C37",x2e="#6B007B",_2e="#E044A7",w2e="#744EC2",k2e="#D9B300",$2e="#D64550",AL=Sr,TL="#DEEFFF",ML=[TL,AL],E2e={view:{stroke:SL},background:SL,font:lh,header:{titleFont:EL,titleFontSize:$L,titleColor:CL,labelFont:lh,labelFontSize:kL,labelColor:uh},axis:{ticks:!1,grid:!1,domain:!1,labelColor:uh,labelFontSize:wL,titleFont:EL,titleColor:CL,titleFontSize:$L,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:y2e,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:Sr},line:{stroke:Sr,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:lh,fontSize:wL,fill:uh},arc:{fill:Sr},area:{fill:Sr,line:!0,opacity:.6},path:{stroke:Sr},rect:{fill:Sr},point:{fill:Sr,filled:!0,size:75},shape:{stroke:Sr},symbol:{fill:Sr,strokeWidth:1.5,size:50},legend:{titleFont:lh,titleFontWeight:"bold",titleColor:uh,labelFont:lh,labelFontSize:kL,labelColor:uh,symbolType:"circle",symbolSize:75},range:{category:[Sr,b2e,v2e,x2e,_2e,w2e,k2e,$2e],diverging:ML,heatmap:ML,ordinal:[TL,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",AL]}},Xw='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',FL=400,C2e=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],S2e=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function wm({type:e,background:t}){const n=e==="dark"?"#161616":"#ffffff",i=e==="dark"?"#f4f4f4":"#161616",r=e==="dark"?C2e:S2e,s=e==="dark"?"#d4bbff":"#6929c4";return{background:t,arc:{fill:s},area:{fill:s},path:{stroke:s},rect:{fill:s},shape:{stroke:s},symbol:{stroke:s},circle:{fill:s},view:{fill:n,stroke:n},group:{fill:n},title:{color:i,anchor:"start",dy:-15,fontSize:16,font:Xw,fontWeight:600},axis:{labelColor:i,labelFontSize:12,grid:!0,gridColor:"#525252",titleColor:i,labelAngle:0},style:{"guide-label":{font:Xw,fill:i,fontWeight:FL},"guide-title":{font:Xw,fill:i,fontWeight:FL}},range:{category:r,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd7d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}const A2e=wm({type:"light",background:"#ffffff"}),T2e=wm({type:"light",background:"#f4f4f4"}),M2e=wm({type:"dark",background:"#262626"}),F2e=wm({type:"dark",background:"#161616"}),D2e=Jme.version,N2e=Object.freeze(Object.defineProperty({__proto__:null,carbong10:T2e,carbong100:F2e,carbong90:M2e,carbonwhite:A2e,dark:Qme,excel:e2e,fivethirtyeight:i2e,ggplot2:r2e,googlecharts:m2e,latimes:l2e,powerbi:E2e,quartz:u2e,urbaninstitute:g2e,version:D2e,vox:c2e},Symbol.toStringTag,{value:"Module"}));function O2e(e,t,n,i){if(q(e))return`[${e.map(r=>t(te(r)?r:DL(r,n))).join(", ")}]`;if(re(e)){let r="";const{title:s,image:o,...a}=e;s&&(r+=`

${t(s)}

`),o&&(r+=``);const l=Object.keys(a);if(l.length>0){r+="";for(const u of l){let c=a[u];c!==void 0&&(re(c)&&(c=DL(c,n)),r+=``)}r+="
${t(u)}${t(c)}
"}return r||"{}"}return t(e)}function R2e(e){const t=[];return function(n,i){if(typeof i!="object"||i===null)return i;const r=t.indexOf(this)+1;return t.length=r,t.length>e?"[Object]":t.indexOf(i)>=0?"[Circular]":(t.push(i),i)}}function DL(e,t){return JSON.stringify(e,R2e(t))}var L2e=`#vg-tooltip-element { visibility: hidden; padding: 8px; position: fixed; @@ -124,7 +124,7 @@ Please report this to https://github.com/markedjs/marked.`,t){const s="

An err #vg-tooltip-element.dark-theme td.key { color: #bfbfbf; } -`;const NL="vg-tooltip-element",L2e={offsetX:10,offsetY:10,id:NL,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:I2e,maxDepth:2,formatTooltip:N2e,baseURL:""};function I2e(e){return String(e).replace(/&/g,"&").replace(/window.innerWidth&&(r=+e.clientX-n-t.width);let s=e.clientY+i;return s+t.height>window.innerHeight&&(s=+e.clientY-i-t.height),{x:r,y:s}}class B2e{constructor(t){this.options={...L2e,...t};const n=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const i=document.createElement("style");i.setAttribute("id",this.options.styleId),i.innerHTML=z2e(n);const r=document.head;r.childNodes.length>0?r.insertBefore(i,r.childNodes[0]):r.appendChild(i)}}tooltipHandler(t,n,i,r){if(this.el=document.getElementById(this.options.id),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip"),(document.fullscreenElement??document.body).appendChild(this.el)),r==null||r===""){this.el.classList.remove("visible",`${this.options.theme}-theme`);return}this.el.innerHTML=this.options.formatTooltip(r,this.options.sanitize,this.options.maxDepth,this.options.baseURL),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:s,y:o}=P2e(n,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.style.top=`${o}px`,this.el.style.left=`${s}px`}}function j2e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yw,OL;function U2e(){return OL||(OL=1,Yw=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),Yw}var q2e=Qe;Qe.Node=Fl,Qe.create=Qe;function Qe(e){var t=this;if(t instanceof Qe||(t=new Qe),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach=="function")e.forEach(function(r){t.push(r)});else if(arguments.length>0)for(var n=0,i=arguments.length;n1)n=t;else if(this.head)i=this.head.next,n=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var r=0;i!==null;r++)n=e(n,i.value,r),i=i.next;return n},Qe.prototype.reduceReverse=function(e,t){var n,i=this.tail;if(arguments.length>1)n=t;else if(this.tail)i=this.tail.prev,n=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var r=this.length-1;i!==null;r--)n=e(n,i.value,r),i=i.prev;return n},Qe.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;n!==null;t++)e[t]=n.value,n=n.next;return e},Qe.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;n!==null;t++)e[t]=n.value,n=n.prev;return e},Qe.prototype.slice=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var n=new Qe;if(tthis.length&&(t=this.length);for(var i=0,r=this.head;r!==null&&ithis.length&&(t=this.length);for(var i=this.length,r=this.tail;r!==null&&i>t;i--)r=r.prev;for(;r!==null&&i>e;i--,r=r.prev)n.push(r.value);return n},Qe.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var i=0,r=this.head;r!==null&&i1;class X2e{constructor(t){if(typeof t=="number"&&(t={max:t}),t||(t={}),t.max&&(typeof t.max!="number"||t.max<0))throw new TypeError("max must be a non-negative number");this[Dl]=t.max||1/0;const n=t.length||Zw;if(this[kc]=typeof n!="function"?Zw:n,this[ch]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[Nl]=t.maxAge||0,this[Qs]=t.dispose,this[RL]=t.noDisposeOnSet||!1,this[LL]=t.updateAgeOnGet||!1,this.reset()}set max(t){if(typeof t!="number"||t<0)throw new TypeError("max must be a non-negative number");this[Dl]=t||1/0,fh(this)}get max(){return this[Dl]}set allowStale(t){this[ch]=!!t}get allowStale(){return this[ch]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[Nl]=t,fh(this)}get maxAge(){return this[Nl]}set lengthCalculator(t){typeof t!="function"&&(t=Zw),t!==this[kc]&&(this[kc]=t,this[Js]=0,this[tn].forEach(n=>{n.length=this[kc](n.value,n.key),this[Js]+=n.length})),fh(this)}get lengthCalculator(){return this[kc]}get length(){return this[Js]}get itemCount(){return this[tn].length}rforEach(t,n){n=n||this;for(let i=this[tn].tail;i!==null;){const r=i.prev;IL(this,t,i,n),i=r}}forEach(t,n){n=n||this;for(let i=this[tn].head;i!==null;){const r=i.next;IL(this,t,i,n),i=r}}keys(){return this[tn].toArray().map(t=>t.key)}values(){return this[tn].toArray().map(t=>t.value)}reset(){this[Qs]&&this[tn]&&this[tn].length&&this[tn].forEach(t=>this[Qs](t.key,t.value)),this[Ar]=new Map,this[tn]=new V2e,this[Js]=0}dump(){return this[tn].map(t=>km(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[tn]}set(t,n,i){if(i=i||this[Nl],i&&typeof i!="number")throw new TypeError("maxAge must be a number");const r=i?Date.now():0,s=this[kc](n,t);if(this[Ar].has(t)){if(s>this[Dl])return $c(this,this[Ar].get(t)),!1;const l=this[Ar].get(t).value;return this[Qs]&&(this[RL]||this[Qs](t,l.value)),l.now=r,l.maxAge=i,l.value=n,this[Js]+=s-l.length,l.length=s,this.get(t),fh(this),!0}const o=new Y2e(t,n,s,r,i);return o.length>this[Dl]?(this[Qs]&&this[Qs](t,n),!1):(this[Js]+=o.length,this[tn].unshift(o),this[Ar].set(t,this[tn].head),fh(this),!0)}has(t){if(!this[Ar].has(t))return!1;const n=this[Ar].get(t).value;return!km(this,n)}get(t){return Kw(this,t,!0)}peek(t){return Kw(this,t,!1)}pop(){const t=this[tn].tail;return t?($c(this,t),t.value):null}del(t){$c(this,this[Ar].get(t))}load(t){this.reset();const n=Date.now();for(let i=t.length-1;i>=0;i--){const r=t[i],s=r.e||0;if(s===0)this.set(r.k,r.v);else{const o=s-n;o>0&&this.set(r.k,r.v,o)}}}prune(){this[Ar].forEach((t,n)=>Kw(this,n,!1))}}const Kw=(e,t,n)=>{const i=e[Ar].get(t);if(i){const r=i.value;if(km(e,r)){if($c(e,i),!e[ch])return}else n&&(e[LL]&&(i.value.now=Date.now()),e[tn].unshiftNode(i));return r.value}},km=(e,t)=>{if(!t||!t.maxAge&&!e[Nl])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[Nl]&&n>e[Nl]},fh=e=>{if(e[Js]>e[Dl])for(let t=e[tn].tail;e[Js]>e[Dl]&&t!==null;){const n=t.prev;$c(e,t),t=n}},$c=(e,t)=>{if(t){const n=t.value;e[Qs]&&e[Qs](n.key,n.value),e[Js]-=n.length,e[Ar].delete(n.key),e[tn].removeNode(t)}};class Y2e{constructor(t,n,i,r,s){this.key=t,this.value=n,this.length=i,this.now=r,this.maxAge=s||0}}const IL=(e,t,n,i)=>{let r=n.value;km(e,r)&&($c(e,n),e[ch]||(r=void 0)),r&&t.call(i,r.value,r.key,e)};var Z2e=X2e;const K2e=Object.freeze({loose:!0}),J2e=Object.freeze({});var Jw=e=>e?typeof e!="object"?K2e:e:J2e,Qw={exports:{}};const Q2e="2.0.0",zL=256,eye=Number.MAX_SAFE_INTEGER||9007199254740991,tye=16,nye=zL-6;var e5={MAX_LENGTH:zL,MAX_SAFE_COMPONENT_LENGTH:tye,MAX_SAFE_BUILD_LENGTH:nye,MAX_SAFE_INTEGER:eye,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:Q2e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},$m=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:r}=e5,s=$m;t=e.exports={};const o=t.re=[],a=t.safeRe=[],l=t.src=[],u=t.t={};let c=0;const f="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",r],[f,i]],h=g=>{for(const[m,y]of d)g=g.split(`${m}*`).join(`${m}{0,${y}}`).split(`${m}+`).join(`${m}{1,${y}}`);return g},p=(g,m,y)=>{const b=h(m),v=c++;s(g,v,m),u[g]=v,l[v]=m,o[v]=new RegExp(m,y?"g":void 0),a[v]=new RegExp(b,y?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),p("MAINVERSION",`(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${l[u.NUMERICIDENTIFIER]}|${l[u.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${l[u.NUMERICIDENTIFIERLOOSE]}|${l[u.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${l[u.PRERELEASEIDENTIFIER]}(?:\\.${l[u.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${l[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[u.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${f}+`),p("BUILD",`(?:\\+(${l[u.BUILDIDENTIFIER]}(?:\\.${l[u.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${l[u.MAINVERSION]}${l[u.PRERELEASE]}?${l[u.BUILD]}?`),p("FULL",`^${l[u.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${l[u.MAINVERSIONLOOSE]}${l[u.PRERELEASELOOSE]}?${l[u.BUILD]}?`),p("LOOSE",`^${l[u.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${l[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${l[u.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:${l[u.PRERELEASE]})?${l[u.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:${l[u.PRERELEASELOOSE]})?${l[u.BUILD]}?)?)?`),p("XRANGE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAINLOOSE]}$`),p("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),p("COERCERTL",l[u.COERCE],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${l[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${l[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${l[u.LONECARET]}${l[u.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${l[u.LONECARET]}${l[u.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${l[u.GTLT]}\\s*(${l[u.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]}|${l[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${l[u.XRANGEPLAIN]})\\s+-\\s+(${l[u.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${l[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[u.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Qw,Qw.exports);var t5=Qw.exports;const PL=/^[0-9]+$/,BL=(e,t)=>{const n=PL.test(e),i=PL.test(t);return n&&i&&(e=+e,t=+t),e===t?0:n&&!i?-1:i&&!n?1:eBL(t,e)};const Em=$m,{MAX_LENGTH:jL,MAX_SAFE_INTEGER:Cm}=e5,{safeRe:UL,t:qL}=t5,rye=Jw,{compareIdentifiers:Ec}=iye;var n5=class ms{constructor(t,n){if(n=rye(n),t instanceof ms){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>jL)throw new TypeError(`version is longer than ${jL} characters`);Em("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const i=t.trim().match(n.loose?UL[qL.LOOSE]:UL[qL.FULL]);if(!i)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>Cm||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Cm||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Cm||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(r=>{if(/^[0-9]+$/.test(r)){const s=+r;if(s>=0&&s=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(n===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(r)}}if(n){let s=[n,r];i===!1&&(s=[n]),Ec(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};const WL=n5;var Cc=(e,t,n)=>new WL(e,n).compare(new WL(t,n));const sye=Cc;var oye=(e,t,n)=>sye(e,t,n)===0;const aye=Cc;var lye=(e,t,n)=>aye(e,t,n)!==0;const uye=Cc;var cye=(e,t,n)=>uye(e,t,n)>0;const fye=Cc;var dye=(e,t,n)=>fye(e,t,n)>=0;const hye=Cc;var pye=(e,t,n)=>hye(e,t,n)<0;const gye=Cc;var mye=(e,t,n)=>gye(e,t,n)<=0;const yye=oye,bye=lye,vye=cye,xye=dye,_ye=pye,wye=mye;var kye=(e,t,n,i)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e===n;case"!==":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e!==n;case"":case"=":case"==":return yye(e,n,i);case"!=":return bye(e,n,i);case">":return vye(e,n,i);case">=":return xye(e,n,i);case"<":return _ye(e,n,i);case"<=":return wye(e,n,i);default:throw new TypeError(`Invalid operator: ${t}`)}},i5,HL;function $ye(){if(HL)return i5;HL=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(c,f){if(f=n(f),c instanceof t){if(c.loose===!!f.loose)return c;c=c.value}c=c.trim().split(/\s+/).join(" "),o("comparator",c,f),this.options=f,this.loose=!!f.loose,this.parse(c),this.semver===e?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(c){const f=this.options.loose?i[r.COMPARATORLOOSE]:i[r.COMPARATOR],d=c.match(f);if(!d)throw new TypeError(`Invalid comparator: ${c}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new a(d[2],this.options.loose):this.semver=e}toString(){return this.value}test(c){if(o("Comparator.test",c,this.options.loose),this.semver===e||c===e)return!0;if(typeof c=="string")try{c=new a(c,this.options)}catch{return!1}return s(c,this.operator,this.semver,this.options)}intersects(c,f){if(!(c instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new l(c.value,f).test(this.value):c.operator===""?c.value===""?!0:new l(this.value,f).test(c.semver):(f=n(f),f.includePrerelease&&(this.value==="<0.0.0-0"||c.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||c.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&c.operator.startsWith(">")||this.operator.startsWith("<")&&c.operator.startsWith("<")||this.semver.version===c.semver.version&&this.operator.includes("=")&&c.operator.includes("=")||s(this.semver,"<",c.semver,f)&&this.operator.startsWith(">")&&c.operator.startsWith("<")||s(this.semver,">",c.semver,f)&&this.operator.startsWith("<")&&c.operator.startsWith(">")))}}i5=t;const n=Jw,{safeRe:i,t:r}=t5,s=kye,o=$m,a=n5,l=VL();return i5}var r5,GL;function VL(){if(GL)return r5;GL=1;class e{constructor(M,T){if(T=i(T),M instanceof e)return M.loose===!!T.loose&&M.includePrerelease===!!T.includePrerelease?M:new e(M.raw,T);if(M instanceof r)return this.raw=M.value,this.set=[[M]],this.format(),this;if(this.options=T,this.loose=!!T.loose,this.includePrerelease=!!T.includePrerelease,this.raw=M.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(O=>this.parseRange(O.trim())).filter(O=>O.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const O=this.set[0];if(this.set=this.set.filter(P=>!p(P[0])),this.set.length===0)this.set=[O];else if(this.set.length>1){for(const P of this.set)if(P.length===1&&g(P[0])){this.set=[P];break}}}this.format()}format(){return this.range=this.set.map(M=>M.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(M){const O=((this.options.includePrerelease&&d)|(this.options.loose&&h))+":"+M,P=n.get(O);if(P)return P;const j=this.options.loose,W=j?a[l.HYPHENRANGELOOSE]:a[l.HYPHENRANGE];M=M.replace(W,A(this.options.includePrerelease)),s("hyphen replace",M),M=M.replace(a[l.COMPARATORTRIM],u),s("comparator trim",M),M=M.replace(a[l.TILDETRIM],c),s("tilde trim",M),M=M.replace(a[l.CARETTRIM],f),s("caret trim",M);let ne=M.split(" ").map(Le=>y(Le,this.options)).join(" ").split(/\s+/).map(Le=>E(Le,this.options));j&&(ne=ne.filter(Le=>(s("loose invalid filter",Le,this.options),!!Le.match(a[l.COMPARATORLOOSE])))),s("range list",ne);const ae=new Map,ke=ne.map(Le=>new r(Le,this.options));for(const Le of ke){if(p(Le))return[Le];ae.set(Le.value,Le)}ae.size>1&&ae.has("")&&ae.delete("");const Ie=[...ae.values()];return n.set(O,Ie),Ie}intersects(M,T){if(!(M instanceof e))throw new TypeError("a Range is required");return this.set.some(O=>m(O,T)&&M.set.some(P=>m(P,T)&&O.every(j=>P.every(W=>j.intersects(W,T)))))}test(M){if(!M)return!1;if(typeof M=="string")try{M=new o(M,this.options)}catch{return!1}for(let T=0;TC.value==="<0.0.0-0",g=C=>C.value==="",m=(C,M)=>{let T=!0;const O=C.slice();let P=O.pop();for(;T&&O.length;)T=O.every(j=>P.intersects(j,M)),P=O.pop();return T},y=(C,M)=>(s("comp",C,M),C=_(C,M),s("caret",C),C=v(C,M),s("tildes",C),C=w(C,M),s("xrange",C),C=S(C,M),s("stars",C),C),b=C=>!C||C.toLowerCase()==="x"||C==="*",v=(C,M)=>C.trim().split(/\s+/).map(T=>x(T,M)).join(" "),x=(C,M)=>{const T=M.loose?a[l.TILDELOOSE]:a[l.TILDE];return C.replace(T,(O,P,j,W,ne)=>{s("tilde",C,O,P,j,W,ne);let ae;return b(P)?ae="":b(j)?ae=`>=${P}.0.0 <${+P+1}.0.0-0`:b(W)?ae=`>=${P}.${j}.0 <${P}.${+j+1}.0-0`:ne?(s("replaceTilde pr",ne),ae=`>=${P}.${j}.${W}-${ne} <${P}.${+j+1}.0-0`):ae=`>=${P}.${j}.${W} <${P}.${+j+1}.0-0`,s("tilde return",ae),ae})},_=(C,M)=>C.trim().split(/\s+/).map(T=>k(T,M)).join(" "),k=(C,M)=>{s("caret",C,M);const T=M.loose?a[l.CARETLOOSE]:a[l.CARET],O=M.includePrerelease?"-0":"";return C.replace(T,(P,j,W,ne,ae)=>{s("caret",C,P,j,W,ne,ae);let ke;return b(j)?ke="":b(W)?ke=`>=${j}.0.0${O} <${+j+1}.0.0-0`:b(ne)?j==="0"?ke=`>=${j}.${W}.0${O} <${j}.${+W+1}.0-0`:ke=`>=${j}.${W}.0${O} <${+j+1}.0.0-0`:ae?(s("replaceCaret pr",ae),j==="0"?W==="0"?ke=`>=${j}.${W}.${ne}-${ae} <${j}.${W}.${+ne+1}-0`:ke=`>=${j}.${W}.${ne}-${ae} <${j}.${+W+1}.0-0`:ke=`>=${j}.${W}.${ne}-${ae} <${+j+1}.0.0-0`):(s("no pr"),j==="0"?W==="0"?ke=`>=${j}.${W}.${ne}${O} <${j}.${W}.${+ne+1}-0`:ke=`>=${j}.${W}.${ne}${O} <${j}.${+W+1}.0-0`:ke=`>=${j}.${W}.${ne} <${+j+1}.0.0-0`),s("caret return",ke),ke})},w=(C,M)=>(s("replaceXRanges",C,M),C.split(/\s+/).map(T=>$(T,M)).join(" ")),$=(C,M)=>{C=C.trim();const T=M.loose?a[l.XRANGELOOSE]:a[l.XRANGE];return C.replace(T,(O,P,j,W,ne,ae)=>{s("xRange",C,O,P,j,W,ne,ae);const ke=b(j),Ie=ke||b(W),Le=Ie||b(ne),We=Le;return P==="="&&We&&(P=""),ae=M.includePrerelease?"-0":"",ke?P===">"||P==="<"?O="<0.0.0-0":O="*":P&&We?(Ie&&(W=0),ne=0,P===">"?(P=">=",Ie?(j=+j+1,W=0,ne=0):(W=+W+1,ne=0)):P==="<="&&(P="<",Ie?j=+j+1:W=+W+1),P==="<"&&(ae="-0"),O=`${P+j}.${W}.${ne}${ae}`):Ie?O=`>=${j}.0.0${ae} <${+j+1}.0.0-0`:Le&&(O=`>=${j}.${W}.0${ae} <${j}.${+W+1}.0-0`),s("xRange return",O),O})},S=(C,M)=>(s("replaceStars",C,M),C.trim().replace(a[l.STAR],"")),E=(C,M)=>(s("replaceGTE0",C,M),C.trim().replace(a[M.includePrerelease?l.GTE0PRE:l.GTE0],"")),A=C=>(M,T,O,P,j,W,ne,ae,ke,Ie,Le,We,Wn)=>(b(O)?T="":b(P)?T=`>=${O}.0.0${C?"-0":""}`:b(j)?T=`>=${O}.${P}.0${C?"-0":""}`:W?T=`>=${T}`:T=`>=${T}${C?"-0":""}`,b(ke)?ae="":b(Ie)?ae=`<${+ke+1}.0.0-0`:b(Le)?ae=`<${ke}.${+Ie+1}.0-0`:We?ae=`<=${ke}.${Ie}.${Le}-${We}`:C?ae=`<${ke}.${Ie}.${+Le+1}-0`:ae=`<=${ae}`,`${T} ${ae}`.trim()),R=(C,M,T)=>{for(let O=0;O0){const P=C[O].semver;if(P.major===M.major&&P.minor===M.minor&&P.patch===M.patch)return!0}return!1}return!0};return r5}const Eye=VL();var Cye=(e,t,n)=>{try{t=new Eye(t,n)}catch{return!1}return t.test(e)},XL=j2e(Cye);function Sye(e,t,n){const i=e.open(t),r=1e4,s=250,{origin:o}=new URL(t);let a=~~(r/s);function l(c){c.source===i&&(a=0,e.removeEventListener("message",l,!1))}e.addEventListener("message",l,!1);function u(){a<=0||(i.postMessage(n,o),setTimeout(u,s),a-=1)}setTimeout(u,s)}var Aye=`.vega-embed { +`;const NL="vg-tooltip-element",I2e={offsetX:10,offsetY:10,id:NL,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:z2e,maxDepth:2,formatTooltip:O2e,baseURL:""};function z2e(e){return String(e).replace(/&/g,"&").replace(/window.innerWidth&&(r=+e.clientX-n-t.width);let s=e.clientY+i;return s+t.height>window.innerHeight&&(s=+e.clientY-i-t.height),{x:r,y:s}}class j2e{constructor(t){this.options={...I2e,...t};const n=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const i=document.createElement("style");i.setAttribute("id",this.options.styleId),i.innerHTML=P2e(n);const r=document.head;r.childNodes.length>0?r.insertBefore(i,r.childNodes[0]):r.appendChild(i)}}tooltipHandler(t,n,i,r){if(this.el=document.getElementById(this.options.id),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip"),(document.fullscreenElement??document.body).appendChild(this.el)),r==null||r===""){this.el.classList.remove("visible",`${this.options.theme}-theme`);return}this.el.innerHTML=this.options.formatTooltip(r,this.options.sanitize,this.options.maxDepth,this.options.baseURL),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:s,y:o}=B2e(n,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.style.top=`${o}px`,this.el.style.left=`${s}px`}}function U2e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yw,OL;function q2e(){return OL||(OL=1,Yw=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),Yw}var W2e=Qe;Qe.Node=Fl,Qe.create=Qe;function Qe(e){var t=this;if(t instanceof Qe||(t=new Qe),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach=="function")e.forEach(function(r){t.push(r)});else if(arguments.length>0)for(var n=0,i=arguments.length;n1)n=t;else if(this.head)i=this.head.next,n=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var r=0;i!==null;r++)n=e(n,i.value,r),i=i.next;return n},Qe.prototype.reduceReverse=function(e,t){var n,i=this.tail;if(arguments.length>1)n=t;else if(this.tail)i=this.tail.prev,n=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var r=this.length-1;i!==null;r--)n=e(n,i.value,r),i=i.prev;return n},Qe.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;n!==null;t++)e[t]=n.value,n=n.next;return e},Qe.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;n!==null;t++)e[t]=n.value,n=n.prev;return e},Qe.prototype.slice=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var n=new Qe;if(tthis.length&&(t=this.length);for(var i=0,r=this.head;r!==null&&ithis.length&&(t=this.length);for(var i=this.length,r=this.tail;r!==null&&i>t;i--)r=r.prev;for(;r!==null&&i>e;i--,r=r.prev)n.push(r.value);return n},Qe.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var i=0,r=this.head;r!==null&&i1;class Y2e{constructor(t){if(typeof t=="number"&&(t={max:t}),t||(t={}),t.max&&(typeof t.max!="number"||t.max<0))throw new TypeError("max must be a non-negative number");this[Dl]=t.max||1/0;const n=t.length||Zw;if(this[kc]=typeof n!="function"?Zw:n,this[ch]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[Nl]=t.maxAge||0,this[Qs]=t.dispose,this[RL]=t.noDisposeOnSet||!1,this[LL]=t.updateAgeOnGet||!1,this.reset()}set max(t){if(typeof t!="number"||t<0)throw new TypeError("max must be a non-negative number");this[Dl]=t||1/0,fh(this)}get max(){return this[Dl]}set allowStale(t){this[ch]=!!t}get allowStale(){return this[ch]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[Nl]=t,fh(this)}get maxAge(){return this[Nl]}set lengthCalculator(t){typeof t!="function"&&(t=Zw),t!==this[kc]&&(this[kc]=t,this[Js]=0,this[tn].forEach(n=>{n.length=this[kc](n.value,n.key),this[Js]+=n.length})),fh(this)}get lengthCalculator(){return this[kc]}get length(){return this[Js]}get itemCount(){return this[tn].length}rforEach(t,n){n=n||this;for(let i=this[tn].tail;i!==null;){const r=i.prev;IL(this,t,i,n),i=r}}forEach(t,n){n=n||this;for(let i=this[tn].head;i!==null;){const r=i.next;IL(this,t,i,n),i=r}}keys(){return this[tn].toArray().map(t=>t.key)}values(){return this[tn].toArray().map(t=>t.value)}reset(){this[Qs]&&this[tn]&&this[tn].length&&this[tn].forEach(t=>this[Qs](t.key,t.value)),this[Ar]=new Map,this[tn]=new X2e,this[Js]=0}dump(){return this[tn].map(t=>km(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[tn]}set(t,n,i){if(i=i||this[Nl],i&&typeof i!="number")throw new TypeError("maxAge must be a number");const r=i?Date.now():0,s=this[kc](n,t);if(this[Ar].has(t)){if(s>this[Dl])return $c(this,this[Ar].get(t)),!1;const l=this[Ar].get(t).value;return this[Qs]&&(this[RL]||this[Qs](t,l.value)),l.now=r,l.maxAge=i,l.value=n,this[Js]+=s-l.length,l.length=s,this.get(t),fh(this),!0}const o=new Z2e(t,n,s,r,i);return o.length>this[Dl]?(this[Qs]&&this[Qs](t,n),!1):(this[Js]+=o.length,this[tn].unshift(o),this[Ar].set(t,this[tn].head),fh(this),!0)}has(t){if(!this[Ar].has(t))return!1;const n=this[Ar].get(t).value;return!km(this,n)}get(t){return Kw(this,t,!0)}peek(t){return Kw(this,t,!1)}pop(){const t=this[tn].tail;return t?($c(this,t),t.value):null}del(t){$c(this,this[Ar].get(t))}load(t){this.reset();const n=Date.now();for(let i=t.length-1;i>=0;i--){const r=t[i],s=r.e||0;if(s===0)this.set(r.k,r.v);else{const o=s-n;o>0&&this.set(r.k,r.v,o)}}}prune(){this[Ar].forEach((t,n)=>Kw(this,n,!1))}}const Kw=(e,t,n)=>{const i=e[Ar].get(t);if(i){const r=i.value;if(km(e,r)){if($c(e,i),!e[ch])return}else n&&(e[LL]&&(i.value.now=Date.now()),e[tn].unshiftNode(i));return r.value}},km=(e,t)=>{if(!t||!t.maxAge&&!e[Nl])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[Nl]&&n>e[Nl]},fh=e=>{if(e[Js]>e[Dl])for(let t=e[tn].tail;e[Js]>e[Dl]&&t!==null;){const n=t.prev;$c(e,t),t=n}},$c=(e,t)=>{if(t){const n=t.value;e[Qs]&&e[Qs](n.key,n.value),e[Js]-=n.length,e[Ar].delete(n.key),e[tn].removeNode(t)}};class Z2e{constructor(t,n,i,r,s){this.key=t,this.value=n,this.length=i,this.now=r,this.maxAge=s||0}}const IL=(e,t,n,i)=>{let r=n.value;km(e,r)&&($c(e,n),e[ch]||(r=void 0)),r&&t.call(i,r.value,r.key,e)};var K2e=Y2e;const J2e=Object.freeze({loose:!0}),Q2e=Object.freeze({});var Jw=e=>e?typeof e!="object"?J2e:e:Q2e,Qw={exports:{}};const eye="2.0.0",zL=256,tye=Number.MAX_SAFE_INTEGER||9007199254740991,nye=16,iye=zL-6;var e5={MAX_LENGTH:zL,MAX_SAFE_COMPONENT_LENGTH:nye,MAX_SAFE_BUILD_LENGTH:iye,MAX_SAFE_INTEGER:tye,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:eye,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},$m=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:r}=e5,s=$m;t=e.exports={};const o=t.re=[],a=t.safeRe=[],l=t.src=[],u=t.t={};let c=0;const f="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",r],[f,i]],h=g=>{for(const[m,y]of d)g=g.split(`${m}*`).join(`${m}{0,${y}}`).split(`${m}+`).join(`${m}{1,${y}}`);return g},p=(g,m,y)=>{const b=h(m),v=c++;s(g,v,m),u[g]=v,l[v]=m,o[v]=new RegExp(m,y?"g":void 0),a[v]=new RegExp(b,y?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),p("MAINVERSION",`(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${l[u.NUMERICIDENTIFIER]}|${l[u.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${l[u.NUMERICIDENTIFIERLOOSE]}|${l[u.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${l[u.PRERELEASEIDENTIFIER]}(?:\\.${l[u.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${l[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[u.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${f}+`),p("BUILD",`(?:\\+(${l[u.BUILDIDENTIFIER]}(?:\\.${l[u.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${l[u.MAINVERSION]}${l[u.PRERELEASE]}?${l[u.BUILD]}?`),p("FULL",`^${l[u.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${l[u.MAINVERSIONLOOSE]}${l[u.PRERELEASELOOSE]}?${l[u.BUILD]}?`),p("LOOSE",`^${l[u.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${l[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${l[u.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:${l[u.PRERELEASE]})?${l[u.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:${l[u.PRERELEASELOOSE]})?${l[u.BUILD]}?)?)?`),p("XRANGE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAINLOOSE]}$`),p("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),p("COERCERTL",l[u.COERCE],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${l[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${l[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${l[u.LONECARET]}${l[u.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${l[u.LONECARET]}${l[u.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${l[u.GTLT]}\\s*(${l[u.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]}|${l[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${l[u.XRANGEPLAIN]})\\s+-\\s+(${l[u.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${l[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[u.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Qw,Qw.exports);var t5=Qw.exports;const PL=/^[0-9]+$/,BL=(e,t)=>{const n=PL.test(e),i=PL.test(t);return n&&i&&(e=+e,t=+t),e===t?0:n&&!i?-1:i&&!n?1:eBL(t,e)};const Em=$m,{MAX_LENGTH:jL,MAX_SAFE_INTEGER:Cm}=e5,{safeRe:UL,t:qL}=t5,sye=Jw,{compareIdentifiers:Ec}=rye;var n5=class ms{constructor(t,n){if(n=sye(n),t instanceof ms){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>jL)throw new TypeError(`version is longer than ${jL} characters`);Em("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const i=t.trim().match(n.loose?UL[qL.LOOSE]:UL[qL.FULL]);if(!i)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>Cm||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Cm||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Cm||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(r=>{if(/^[0-9]+$/.test(r)){const s=+r;if(s>=0&&s=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(n===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(r)}}if(n){let s=[n,r];i===!1&&(s=[n]),Ec(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};const WL=n5;var Cc=(e,t,n)=>new WL(e,n).compare(new WL(t,n));const oye=Cc;var aye=(e,t,n)=>oye(e,t,n)===0;const lye=Cc;var uye=(e,t,n)=>lye(e,t,n)!==0;const cye=Cc;var fye=(e,t,n)=>cye(e,t,n)>0;const dye=Cc;var hye=(e,t,n)=>dye(e,t,n)>=0;const pye=Cc;var gye=(e,t,n)=>pye(e,t,n)<0;const mye=Cc;var yye=(e,t,n)=>mye(e,t,n)<=0;const bye=aye,vye=uye,xye=fye,_ye=hye,wye=gye,kye=yye;var $ye=(e,t,n,i)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e===n;case"!==":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e!==n;case"":case"=":case"==":return bye(e,n,i);case"!=":return vye(e,n,i);case">":return xye(e,n,i);case">=":return _ye(e,n,i);case"<":return wye(e,n,i);case"<=":return kye(e,n,i);default:throw new TypeError(`Invalid operator: ${t}`)}},i5,HL;function Eye(){if(HL)return i5;HL=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(c,f){if(f=n(f),c instanceof t){if(c.loose===!!f.loose)return c;c=c.value}c=c.trim().split(/\s+/).join(" "),o("comparator",c,f),this.options=f,this.loose=!!f.loose,this.parse(c),this.semver===e?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(c){const f=this.options.loose?i[r.COMPARATORLOOSE]:i[r.COMPARATOR],d=c.match(f);if(!d)throw new TypeError(`Invalid comparator: ${c}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new a(d[2],this.options.loose):this.semver=e}toString(){return this.value}test(c){if(o("Comparator.test",c,this.options.loose),this.semver===e||c===e)return!0;if(typeof c=="string")try{c=new a(c,this.options)}catch{return!1}return s(c,this.operator,this.semver,this.options)}intersects(c,f){if(!(c instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new l(c.value,f).test(this.value):c.operator===""?c.value===""?!0:new l(this.value,f).test(c.semver):(f=n(f),f.includePrerelease&&(this.value==="<0.0.0-0"||c.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||c.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&c.operator.startsWith(">")||this.operator.startsWith("<")&&c.operator.startsWith("<")||this.semver.version===c.semver.version&&this.operator.includes("=")&&c.operator.includes("=")||s(this.semver,"<",c.semver,f)&&this.operator.startsWith(">")&&c.operator.startsWith("<")||s(this.semver,">",c.semver,f)&&this.operator.startsWith("<")&&c.operator.startsWith(">")))}}i5=t;const n=Jw,{safeRe:i,t:r}=t5,s=$ye,o=$m,a=n5,l=VL();return i5}var r5,GL;function VL(){if(GL)return r5;GL=1;class e{constructor(M,T){if(T=i(T),M instanceof e)return M.loose===!!T.loose&&M.includePrerelease===!!T.includePrerelease?M:new e(M.raw,T);if(M instanceof r)return this.raw=M.value,this.set=[[M]],this.format(),this;if(this.options=T,this.loose=!!T.loose,this.includePrerelease=!!T.includePrerelease,this.raw=M.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(O=>this.parseRange(O.trim())).filter(O=>O.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const O=this.set[0];if(this.set=this.set.filter(P=>!p(P[0])),this.set.length===0)this.set=[O];else if(this.set.length>1){for(const P of this.set)if(P.length===1&&g(P[0])){this.set=[P];break}}}this.format()}format(){return this.range=this.set.map(M=>M.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(M){const O=((this.options.includePrerelease&&d)|(this.options.loose&&h))+":"+M,P=n.get(O);if(P)return P;const j=this.options.loose,W=j?a[l.HYPHENRANGELOOSE]:a[l.HYPHENRANGE];M=M.replace(W,A(this.options.includePrerelease)),s("hyphen replace",M),M=M.replace(a[l.COMPARATORTRIM],u),s("comparator trim",M),M=M.replace(a[l.TILDETRIM],c),s("tilde trim",M),M=M.replace(a[l.CARETTRIM],f),s("caret trim",M);let ne=M.split(" ").map(Ie=>y(Ie,this.options)).join(" ").split(/\s+/).map(Ie=>E(Ie,this.options));j&&(ne=ne.filter(Ie=>(s("loose invalid filter",Ie,this.options),!!Ie.match(a[l.COMPARATORLOOSE])))),s("range list",ne);const ae=new Map,ke=ne.map(Ie=>new r(Ie,this.options));for(const Ie of ke){if(p(Ie))return[Ie];ae.set(Ie.value,Ie)}ae.size>1&&ae.has("")&&ae.delete("");const ze=[...ae.values()];return n.set(O,ze),ze}intersects(M,T){if(!(M instanceof e))throw new TypeError("a Range is required");return this.set.some(O=>m(O,T)&&M.set.some(P=>m(P,T)&&O.every(j=>P.every(W=>j.intersects(W,T)))))}test(M){if(!M)return!1;if(typeof M=="string")try{M=new o(M,this.options)}catch{return!1}for(let T=0;TC.value==="<0.0.0-0",g=C=>C.value==="",m=(C,M)=>{let T=!0;const O=C.slice();let P=O.pop();for(;T&&O.length;)T=O.every(j=>P.intersects(j,M)),P=O.pop();return T},y=(C,M)=>(s("comp",C,M),C=_(C,M),s("caret",C),C=v(C,M),s("tildes",C),C=w(C,M),s("xrange",C),C=S(C,M),s("stars",C),C),b=C=>!C||C.toLowerCase()==="x"||C==="*",v=(C,M)=>C.trim().split(/\s+/).map(T=>x(T,M)).join(" "),x=(C,M)=>{const T=M.loose?a[l.TILDELOOSE]:a[l.TILDE];return C.replace(T,(O,P,j,W,ne)=>{s("tilde",C,O,P,j,W,ne);let ae;return b(P)?ae="":b(j)?ae=`>=${P}.0.0 <${+P+1}.0.0-0`:b(W)?ae=`>=${P}.${j}.0 <${P}.${+j+1}.0-0`:ne?(s("replaceTilde pr",ne),ae=`>=${P}.${j}.${W}-${ne} <${P}.${+j+1}.0-0`):ae=`>=${P}.${j}.${W} <${P}.${+j+1}.0-0`,s("tilde return",ae),ae})},_=(C,M)=>C.trim().split(/\s+/).map(T=>k(T,M)).join(" "),k=(C,M)=>{s("caret",C,M);const T=M.loose?a[l.CARETLOOSE]:a[l.CARET],O=M.includePrerelease?"-0":"";return C.replace(T,(P,j,W,ne,ae)=>{s("caret",C,P,j,W,ne,ae);let ke;return b(j)?ke="":b(W)?ke=`>=${j}.0.0${O} <${+j+1}.0.0-0`:b(ne)?j==="0"?ke=`>=${j}.${W}.0${O} <${j}.${+W+1}.0-0`:ke=`>=${j}.${W}.0${O} <${+j+1}.0.0-0`:ae?(s("replaceCaret pr",ae),j==="0"?W==="0"?ke=`>=${j}.${W}.${ne}-${ae} <${j}.${W}.${+ne+1}-0`:ke=`>=${j}.${W}.${ne}-${ae} <${j}.${+W+1}.0-0`:ke=`>=${j}.${W}.${ne}-${ae} <${+j+1}.0.0-0`):(s("no pr"),j==="0"?W==="0"?ke=`>=${j}.${W}.${ne}${O} <${j}.${W}.${+ne+1}-0`:ke=`>=${j}.${W}.${ne}${O} <${j}.${+W+1}.0-0`:ke=`>=${j}.${W}.${ne} <${+j+1}.0.0-0`),s("caret return",ke),ke})},w=(C,M)=>(s("replaceXRanges",C,M),C.split(/\s+/).map(T=>$(T,M)).join(" ")),$=(C,M)=>{C=C.trim();const T=M.loose?a[l.XRANGELOOSE]:a[l.XRANGE];return C.replace(T,(O,P,j,W,ne,ae)=>{s("xRange",C,O,P,j,W,ne,ae);const ke=b(j),ze=ke||b(W),Ie=ze||b(ne),We=Ie;return P==="="&&We&&(P=""),ae=M.includePrerelease?"-0":"",ke?P===">"||P==="<"?O="<0.0.0-0":O="*":P&&We?(ze&&(W=0),ne=0,P===">"?(P=">=",ze?(j=+j+1,W=0,ne=0):(W=+W+1,ne=0)):P==="<="&&(P="<",ze?j=+j+1:W=+W+1),P==="<"&&(ae="-0"),O=`${P+j}.${W}.${ne}${ae}`):ze?O=`>=${j}.0.0${ae} <${+j+1}.0.0-0`:Ie&&(O=`>=${j}.${W}.0${ae} <${j}.${+W+1}.0-0`),s("xRange return",O),O})},S=(C,M)=>(s("replaceStars",C,M),C.trim().replace(a[l.STAR],"")),E=(C,M)=>(s("replaceGTE0",C,M),C.trim().replace(a[M.includePrerelease?l.GTE0PRE:l.GTE0],"")),A=C=>(M,T,O,P,j,W,ne,ae,ke,ze,Ie,We,Wn)=>(b(O)?T="":b(P)?T=`>=${O}.0.0${C?"-0":""}`:b(j)?T=`>=${O}.${P}.0${C?"-0":""}`:W?T=`>=${T}`:T=`>=${T}${C?"-0":""}`,b(ke)?ae="":b(ze)?ae=`<${+ke+1}.0.0-0`:b(Ie)?ae=`<${ke}.${+ze+1}.0-0`:We?ae=`<=${ke}.${ze}.${Ie}-${We}`:C?ae=`<${ke}.${ze}.${+Ie+1}-0`:ae=`<=${ae}`,`${T} ${ae}`.trim()),R=(C,M,T)=>{for(let O=0;O0){const P=C[O].semver;if(P.major===M.major&&P.minor===M.minor&&P.patch===M.patch)return!0}return!1}return!0};return r5}const Cye=VL();var Sye=(e,t,n)=>{try{t=new Cye(t,n)}catch{return!1}return t.test(e)},XL=U2e(Sye);function Aye(e,t,n){const i=e.open(t),r=1e4,s=250,{origin:o}=new URL(t);let a=~~(r/s);function l(c){c.source===i&&(a=0,e.removeEventListener("message",l,!1))}e.addEventListener("message",l,!1);function u(){a<=0||(i.postMessage(n,o),setTimeout(u,s),a-=1)}setTimeout(u,s)}var Tye=`.vega-embed { position: relative; display: inline-block; box-sizing: border-box; @@ -242,9 +242,11 @@ Please report this to https://github.com/markedjs/marked.`,t){const s="

An err transform: scale(1); } } -`;function YL(e,...t){for(const n of t)Tye(e,n);return e}function Tye(e,t){for(const n of Object.keys(t))Hl(e,n,t[n],!0)}const Tr=rce;let dh=Dme;const Sm=typeof window<"u"?window:void 0;dh===void 0&&((sz=Sm==null?void 0:Sm.vl)!=null&&sz.compile)&&(dh=Sm.vl);const Mye={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},Fye={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},hh={vega:"Vega","vega-lite":"Vega-Lite"},Am={vega:Tr.version,"vega-lite":dh?dh.version:"not available"},Dye={vega:e=>e,"vega-lite":(e,t)=>dh.compile(e,{config:t}).spec},Nye=` +`;function YL(e,...t){for(const n of t)Mye(e,n);return e}function Mye(e,t){for(const n of Object.keys(t))Hl(e,n,t[n],!0)}const Tr=sce;let dh=Nme;const Sm=typeof window<"u"?window:void 0;dh===void 0&&((oz=Sm==null?void 0:Sm.vl)!=null&&oz.compile)&&(dh=Sm.vl);const Fye={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},Dye={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},hh={vega:"Vega","vega-lite":"Vega-Lite"},Am={vega:Tr.version,"vega-lite":dh?dh.version:"not available"},Nye={vega:e=>e,"vega-lite":(e,t)=>dh.compile(e,{config:t}).spec},Oye=` -`,Oye="chart-wrapper";function Rye(e){return typeof e=="function"}function ZL(e,t,n,i){const r=`${t}

`,s=`
${n}`,o=window.open("");o.document.write(r+e+s),o.document.title=`${hh[i]} JSON Source`}function Lye(e,t){if(e.$schema){const n=dL(e.$schema);t&&t!==n.library&&console.warn(`The given visualization spec is written in ${hh[n.library]}, but mode argument sets ${hh[t]??t}.`);const i=n.library;return XL(Am[i],`^${n.version.slice(1)}`)||console.warn(`The input spec uses ${hh[i]} ${n.version}, but the current version of ${hh[i]} is v${Am[i]}.`),i}return"mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e?"vega-lite":"marks"in e||"signals"in e||"scales"in e||"axes"in e?"vega":t??"vega"}function KL(e){return!!(e&&"load"in e)}function JL(e){return KL(e)?e:Tr.loader(e)}function Iye(e){var n;const t=((n=e.usermeta)==null?void 0:n.embedOptions)??{};return te(t.defaultStyle)&&(t.defaultStyle=!1),t}async function zye(e,t,n={}){let i,r;te(t)?(r=JL(n.loader),i=JSON.parse(await r.load(t))):i=t;const s=Iye(i),o=s.loader;(!r||o)&&(r=JL(n.loader??o));const a=await QL(s,r),l=await QL(n,r),u={...YL(l,a),config:Wl(l.config??{},a.config??{})};return await Bye(e,i,u,r)}async function QL(e,t){const n=te(e.config)?JSON.parse(await t.load(e.config)):e.config??{},i=te(e.patch)?JSON.parse(await t.load(e.patch)):e.patch;return{...e,...i?{patch:i}:{},...n?{config:n}:{}}}function Pye(e){const t=e.getRootNode?e.getRootNode():document;return t instanceof ShadowRoot?{root:t,rootContainer:t}:{root:document,rootContainer:document.head??document.body}}async function Bye(e,t,n={},i){const r=n.theme?Wl(D2e[n.theme],n.config??{}):n.config,s=ro(n.actions)?n.actions:YL({},Mye,n.actions??{}),o={...Fye,...n.i18n},a=n.renderer??"canvas",l=n.logLevel??Tr.Warn,u=n.downloadFileName??"visualization",c=typeof e=="string"?document.querySelector(e):e;if(!c)throw new Error(`${e} does not exist`);if(n.defaultStyle!==!1){const _="vega-embed-style",{root:k,rootContainer:w}=Pye(c);if(!k.getElementById(_)){const $=document.createElement("style");$.id=_,$.innerHTML=n.defaultStyle===void 0||n.defaultStyle===!0?Aye.toString():n.defaultStyle,w.appendChild($)}}const f=Lye(t,n.mode);let d=Dye[f](t,r);if(f==="vega-lite"&&d.$schema){const _=dL(d.$schema);XL(Am.vega,`^${_.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${_.version}, but current version is v${Am.vega}.`)}c.classList.add("vega-embed"),s&&c.classList.add("has-actions"),c.innerHTML="";let h=c;if(s){const _=document.createElement("div");_.classList.add(Oye),c.appendChild(_),h=_}const p=n.patch;if(p&&(d=p instanceof Function?p(d):Mh(d,p,!0,!1).newDocument),n.formatLocale&&Tr.formatLocale(n.formatLocale),n.timeFormatLocale&&Tr.timeFormatLocale(n.timeFormatLocale),n.expressionFunctions)for(const _ in n.expressionFunctions){const k=n.expressionFunctions[_];"fn"in k?Tr.expressionFunction(_,k.fn,k.visitor):k instanceof Function&&Tr.expressionFunction(_,k)}const{ast:g}=n,m=Tr.parse(d,f==="vega-lite"?{}:r,{ast:g}),y=new(n.viewClass||Tr.View)(m,{loader:i,logLevel:l,renderer:a,...g?{expr:Tr.expressionInterpreter??n.expr??pce}:{}});if(y.addSignalListener("autosize",(_,k)=>{const{type:w}=k;w=="fit-x"?(h.classList.add("fit-x"),h.classList.remove("fit-y")):w=="fit-y"?(h.classList.remove("fit-x"),h.classList.add("fit-y")):w=="fit"?h.classList.add("fit-x","fit-y"):h.classList.remove("fit-x","fit-y")}),n.tooltip!==!1){const{loader:_,tooltip:k}=n,w=_&&!KL(_)?_==null?void 0:_.baseURL:void 0,$=Rye(k)?k:new B2e({baseURL:w,...k===!0?{}:k}).call;y.tooltip($)}let{hover:b}=n;if(b===void 0&&(b=f==="vega"),b){const{hoverSet:_,updateSet:k}=typeof b=="boolean"?{}:b;y.hover(_,k)}n&&(n.width!=null&&y.width(n.width),n.height!=null&&y.height(n.height),n.padding!=null&&y.padding(n.padding)),await y.initialize(h,n.bind).runAsync();let v;if(s!==!1){let _=c;if(n.defaultStyle!==!1||n.forceActionsMenu){const w=document.createElement("details");w.title=o.CLICK_TO_VIEW_ACTIONS,c.append(w),_=w;const $=document.createElement("summary");$.innerHTML=Nye,w.append($),v=S=>{w.contains(S.target)||w.removeAttribute("open")},document.addEventListener("click",v)}const k=document.createElement("div");if(_.append(k),k.classList.add("vega-actions"),s===!0||s.export!==!1){for(const w of["svg","png"])if(s===!0||s.export===!0||s.export[w]){const $=o[`${w.toUpperCase()}_ACTION`],S=document.createElement("a"),E=ie(n.scaleFactor)?n.scaleFactor[w]:n.scaleFactor;S.text=$,S.href="#",S.target="_blank",S.download=`${u}.${w}`,S.addEventListener("mousedown",async function(A){A.preventDefault();const R=await y.toImageURL(w,E);this.href=R}),k.append(S)}}if(s===!0||s.source!==!1){const w=document.createElement("a");w.text=o.SOURCE_ACTION,w.href="#",w.addEventListener("click",function($){ZL(i2(t),n.sourceHeader??"",n.sourceFooter??"",f),$.preventDefault()}),k.append(w)}if(f==="vega-lite"&&(s===!0||s.compiled!==!1)){const w=document.createElement("a");w.text=o.COMPILED_ACTION,w.href="#",w.addEventListener("click",function($){ZL(i2(d),n.sourceHeader??"",n.sourceFooter??"","vega"),$.preventDefault()}),k.append(w)}if(s===!0||s.editor!==!1){const w=n.editorUrl??"https://vega.github.io/editor/",$=document.createElement("a");$.text=o.EDITOR_ACTION,$.href="#",$.addEventListener("click",function(S){Sye(window,w,{config:r,mode:f,renderer:a,spec:i2(t)}),S.preventDefault()}),k.append($)}}function x(){v&&document.removeEventListener("click",v),y.finalize()}return{view:y,spec:t,vgSpec:d,finalize:x,embedOptions:n}}const jye=new Set(["width","height"]);var Uye=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var i,r,s;if(Array.isArray(t)){if(i=t.length,i!=n.length)return!1;for(r=i;r--!==0;)if(!e(t[r],n[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),i=s.length,i!==Object.keys(n).length)return!1;for(r=i;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[r]))return!1;for(r=i;r--!==0;){var o=s[r];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n};const qye=j6(Uye);function Wye(e,t){for(const[n,i]of Object.entries(t))i&&(i&&{}.toString.call(i)==="[object Function]"?i(e.data(n)):e.change(n,Tr.changeset().remove(()=>!0).insert(i)))}function Tm(e={},t={},n=new Set){const i=Object.keys(e),r=Object.keys(t);return e===t||i.length===r.length&&i.filter(s=>!n.has(s)).every(s=>e[s]===t[s])}function eI(e,t){const n=Object.keys(t);for(const i of n)try{e.removeSignalListener(i,t[i])}catch(r){console.warn("Cannot remove invalid signal listener.",r)}return n.length>0}function s5(e,t){const n=Object.keys(t);for(const i of n)try{e.addSignalListener(i,t[i])}catch(r){console.warn("Cannot add invalid signal listener.",r)}return n.length>0}function Hye(e){return new Set(e.flatMap(t=>Object.keys(t)))}function Gye(e,t){if(e===t)return!1;const n={width:!1,height:!1,isExpensive:!1},i="width"in e||"width"in t,r="height"in e||"height"in t;return i&&(!("width"in e)||!("width"in t)||e.width!==t.width)&&("width"in e&&typeof e.width=="number"?n.width=e.width:n.isExpensive=!0),r&&(!("height"in e)||!("height"in t)||e.height!==t.height)&&("height"in e&&typeof e.height=="number"?n.height=e.height:n.isExpensive=!0),[...Hye([e,t])].filter(o=>o!=="width"&&o!=="height").some(o=>!(o in e)||!(o in t)||!qye(e[o],t[o]))&&(n.isExpensive=!0),n.width!==!1||n.height!==!1||n.isExpensive?n:!1}function tI(e,t){const{width:n,height:i}=t;return typeof n<"u"&&typeof i<"u"?{...e,width:n,height:i}:typeof n<"u"?{...e,width:n}:typeof i<"u"?{...e,height:i}:e}function Vye(e){let t;return{c(){t=H("div")},m(n,i){z(n,t,i),e[11](t)},p:re,i:re,o:re,d(n){n&&L(t),e[11](null)}}}function Xye(e,t,n){let{options:i}=t,{spec:r}=t,{view:s}=t,{signalListeners:o={}}=t,{data:a={}}=t;const l=Bm();let u,c={},f={},d={},h={},p;M5(()=>{m()});async function g(){m();try{n(6,u=await zye(p,r,i)),n(1,s=u.view),s5(s,o)&&s.runAsync(),b(s)}catch(_){y(_)}}function m(){u&&(u.finalize(),n(6,u=void 0),n(1,s=void 0))}function y(_){l("onError",{error:_}),console.warn(_)}function b(_){v(),l("onNewView",{view:_})}async function v(){a&&Object.keys(a).length>0&&u!==void 0&&(n(1,s=u.view),Wye(s,a),await s.resize().runAsync())}function x(_){Xi[_?"unshift":"push"](()=>{p=_,n(0,p)})}return e.$$set=_=>{"options"in _&&n(2,i=_.options),"spec"in _&&n(3,r=_.spec),"view"in _&&n(1,s=_.view),"signalListeners"in _&&n(4,o=_.signalListeners),"data"in _&&n(5,a=_.data)},e.$$.update=()=>{if(e.$$.dirty&1056&&(Tm(a,h)||v(),n(10,h=a)),e.$$.dirty&991&&p!==void 0){if(!Tm(i,c,jye))g();else{const _=Gye(tI(r,i),tI(d,c)),k=o,w=f;if(_){if(_.isExpensive)g();else if(u!==void 0){const $=!Tm(k,w);n(1,s=u.view),_.width!==!1&&s.width(_.width),_.height!==!1&&s.height(_.height),$&&(w&&eI(s,w),k&&s5(s,k)),s.runAsync()}}else!Tm(k,w)&&u!==void 0&&(n(1,s=u.view),w&&eI(s,w),k&&s5(s,k),s.runAsync())}n(7,c=i),n(8,f=o),n(9,d=r)}},[p,s,i,r,o,a,u,c,f,d,h,x]}class Yye extends ve{constructor(t){super(),be(this,t,Xye,Vye,he,{options:2,spec:3,view:1,signalListeners:4,data:5})}}function Zye(e){let t,n,i;function r(o){e[6](o)}let s={spec:e[1],data:e[2],signalListeners:e[3],options:e[4]};return e[0]!==void 0&&(s.view=e[0]),t=new Yye({props:s}),Xi.push(()=>Gm(t,"view",r)),t.$on("onNewView",e[7]),t.$on("onError",e[8]),{c(){ce(t.$$.fragment)},m(o,a){le(t,o,a),i=!0},p(o,[a]){const l={};a&2&&(l.spec=o[1]),a&4&&(l.data=o[2]),a&8&&(l.signalListeners=o[3]),a&16&&(l.options=o[4]),!n&&a&1&&(n=!0,l.view=o[0],Wm(()=>n=!1)),t.$set(l)},i(o){i||(F(t.$$.fragment,o),i=!0)},o(o){N(t.$$.fragment,o),i=!1},d(o){ue(t,o)}}}const Kye="vega";function Jye(e,t,n){let i,{spec:r}=t,{options:s={}}=t,{data:o={}}=t,{signalListeners:a={}}=t,{view:l=void 0}=t;function u(d){l=d,n(0,l)}function c(d){N5.call(this,e,d)}function f(d){N5.call(this,e,d)}return e.$$set=d=>{"spec"in d&&n(1,r=d.spec),"options"in d&&n(5,s=d.options),"data"in d&&n(2,o=d.data),"signalListeners"in d&&n(3,a=d.signalListeners),"view"in d&&n(0,l=d.view)},e.$$.update=()=>{e.$$.dirty&32&&n(4,i={...s,mode:Kye})},[l,r,o,a,i,s,u,c,f]}class nI extends ve{constructor(t){super(),be(this,t,Jye,Zye,he,{spec:1,options:5,data:2,signalListeners:3,view:0})}}function Qye(e){let t,n;return t=new nI({props:{spec:e[1],options:e[0]}}),{c(){ce(t.$$.fragment)},m(i,r){le(t,i,r),n=!0},p(i,r){const s={};r&2&&(s.spec=i[1]),r&1&&(s.options=i[0]),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){ue(t,i)}}}function ebe(e){let t,n;return t=new nI({props:{data:e[2],spec:e[1],options:e[0]}}),{c(){ce(t.$$.fragment)},m(i,r){le(t,i,r),n=!0},p(i,r){const s={};r&4&&(s.data=i[2]),r&2&&(s.spec=i[1]),r&1&&(s.options=i[0]),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){ue(t,i)}}}function tbe(e){let t,n,i,r;const s=[ebe,Qye],o=[];function a(l,u){return l[2]&&l[1]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Ae()},m(l,u){o[t].m(l,u),z(l,i,u),r=!0},p(l,[u]){let c=t;t=a(l),t===c?o[t].p(l,u):($e(),N(o[c],1,1,()=>{o[c]=null}),Ee(),n=o[t],n?n.p(l,u):(n=o[t]=s[t](l),n.c()),F(n,1),n.m(i.parentNode,i))},i(l){r||(F(n),r=!0)},o(l){N(n),r=!1},d(l){l&&L(i),o[t].d(l)}}}function nbe(e,t,n){let i,r,s,{componentData:o}=t;return e.$$set=a=>{"componentData"in a&&n(3,o=a.componentData)},e.$$.update=()=>{e.$$.dirty&8&&n(2,{data:i,spec:r,options:s}=o,i,(n(1,r),n(3,o)),(n(0,s),n(3,o)))},[s,r,i,o]}class iI extends ve{constructor(t){super(),be(this,t,nbe,tbe,he,{componentData:3})}}function ibe(e){var r;let t,n=(((r=e[0])==null?void 0:r.text)||"")+"",i;return{c(){t=H("p"),i=Be(n),D(t,"data-component","text")},m(s,o){z(s,t,o),X(t,i)},p(s,[o]){var a;o&1&&n!==(n=(((a=s[0])==null?void 0:a.text)||"")+"")&&pt(i,n)},i:re,o:re,d(s){s&&L(t)}}}function rbe(e,t,n){let{componentData:i}=t;return e.$$set=r=>{"componentData"in r&&n(0,i=r.componentData)},[i]}class rI extends ve{constructor(t){super(),be(this,t,rbe,ibe,he,{componentData:0})}}function sbe(e){let t;return{c(){t=Be(e[0])},m(n,i){z(n,t,i)},p(n,i){i&1&&pt(t,n[0])},i:re,o:re,d(n){n&&L(t)}}}function obe(e){let t,n,i;var r=e[1];function s(o,a){return{props:{componentData:o[0]}}}return r&&(t=Ye(r,s(e))),{c(){t&&ce(t.$$.fragment),n=Ae()},m(o,a){t&&le(t,o,a),z(o,n,a),i=!0},p(o,a){if(a&2&&r!==(r=o[1])){if(t){$e();const l=t;N(l.$$.fragment,1,0,()=>{ue(l,1)}),Ee()}r?(t=Ye(r,s(o)),ce(t.$$.fragment),F(t.$$.fragment,1),le(t,n.parentNode,n)):t=null}else if(r){const l={};a&1&&(l.componentData=o[0]),t.$set(l)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&ue(t,o)}}}function abe(e){let t,n,i,r;const s=[obe,sbe],o=[];function a(l,u){return l[1]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Ae()},m(l,u){o[t].m(l,u),z(l,i,u),r=!0},p(l,[u]){let c=t;t=a(l),t===c?o[t].p(l,u):($e(),N(o[c],1,1,()=>{o[c]=null}),Ee(),n=o[t],n?n.p(l,u):(n=o[t]=s[t](l),n.c()),F(n,1),n.m(i.parentNode,i))},i(l){r||(F(n),r=!0)},o(l){N(n),r=!1},d(l){l&&L(i),o[t].d(l)}}}function lbe(e,t,n){let{componentData:i}=t,r;const s={artifacts:j5,dag:J5,heading:i6,image:o6,log:a6,markdown:M6,progressBar:O6,text:rI,vegaChart:iI},o=i==null?void 0:i.type;return o&&(r=s==null?void 0:s[o],r||console.error("Unknown component type: ",o)),e.$$set=a=>{"componentData"in a&&n(0,i=a.componentData)},[i,r]}class sI extends ve{constructor(t){super(),be(this,t,lbe,abe,he,{componentData:0})}}function oI(e,t,n){const i=e.slice();return i[3]=t[n],i[5]=n,i}function aI(e,t,n){const i=e.slice();return i[6]=t[n],i}function lI(e){let t,n,i,r,s=Oe(e[1]),o=[];for(let l=0;lN(o[l],1,1,()=>{o[l]=null});return{c(){t=H("div"),n=H("table"),i=H("tbody");for(let l=0;lN(u[f],1,1,()=>{u[f]=null});return{c(){t=H("tr"),n=H("td"),r=Be(i),s=je();for(let f=0;f{i=null}),Ee())},i(r){n||(F(i),n=!0)},o(r){N(i),n=!1},d(r){r&&L(t),i&&i.d(r)}}}function cbe(e,t,n){let i,r,{componentData:s}=t;return e.$$set=o=>{"componentData"in o&&n(2,s=o.componentData)},e.$$.update=()=>{e.$$.dirty&4&&n(1,{columns:i,data:r}=s,i,(n(0,r),n(2,s)))},[r,i,s]}class fbe extends ve{constructor(t){super(),be(this,t,cbe,ube,he,{componentData:2})}}function fI(e,t,n){const i=e.slice();return i[3]=t[n],i}function dI(e,t,n){const i=e.slice();return i[6]=t[n],i}function hI(e,t,n){const i=e.slice();return i[9]=t[n],i}function pI(e){let t,n,i,r,s,o,a,l=Oe(e[1]),u=[];for(let h=0;hN(f[h],1,1,()=>{f[h]=null});return{c(){t=H("div"),n=H("table"),i=H("thead"),r=H("tr");for(let h=0;hN(s[a],1,1,()=>{s[a]=null});return{c(){t=H("tr");for(let a=0;a{i=null}),Ee())},i(r){n||(F(i),n=!0)},o(r){N(i),n=!1},d(r){r&&L(t),i&&i.d(r)}}}function hbe(e,t,n){let i,r,{componentData:s}=t;return e.$$set=o=>{"componentData"in o&&n(2,s=o.componentData)},e.$$.update=()=>{e.$$.dirty&4&&n(1,{columns:i,data:r}=s,i,(n(0,r),n(2,s)))},[r,i,s]}class pbe extends ve{constructor(t){super(),be(this,t,hbe,dbe,he,{componentData:2})}}function bI(e){let t,n,i;var r=e[3];function s(o,a){return{props:{componentData:o[0]}}}return r&&(t=Ye(r,s(e))),{c(){t&&ce(t.$$.fragment),n=Ae()},m(o,a){t&&le(t,o,a),z(o,n,a),i=!0},p(o,a){if(r!==(r=o[3])){if(t){$e();const l=t;N(l.$$.fragment,1,0,()=>{ue(l,1)}),Ee()}r?(t=Ye(r,s(o)),ce(t.$$.fragment),F(t.$$.fragment,1),le(t,n.parentNode,n)):t=null}else if(r){const l={};a&1&&(l.componentData=o[0]),t.$set(l)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&ue(t,o)}}}function gbe(e){let t,n,i=e[2]&&e[1]&&bI(e);return{c(){i&&i.c(),t=Ae()},m(r,s){i&&i.m(r,s),z(r,t,s),n=!0},p(r,[s]){r[2]&&r[1]?i?(i.p(r,s),s&6&&F(i,1)):(i=bI(r),i.c(),F(i,1),i.m(t.parentNode,t)):i&&($e(),N(i,1,1,()=>{i=null}),Ee())},i(r){n||(F(i),n=!0)},o(r){N(i),n=!1},d(r){r&&L(t),i&&i.d(r)}}}function mbe(e,t,n){let i,r,s,{componentData:o}=t;const a=s?fbe:pbe;return e.$$set=l=>{"componentData"in l&&n(0,o=l.componentData)},e.$$.update=()=>{e.$$.dirty&1&&n(2,{columns:i,data:r,vertical:s}=o,i,(n(1,r),n(0,o)))},[o,r,i,a]}class ybe extends ve{constructor(t){super(),be(this,t,mbe,gbe,he,{componentData:0})}}function vI(e,t,n){const i=e.slice();return i[3]=t[n],i}function bbe(e){let t,n,i,r;const s=[xbe,vbe],o=[];function a(l,u){var c;return(l[0].type==="page"||l[0].type==="section")&&((c=l[0])!=null&&c.contents)?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Ae()},m(l,u){o[t].m(l,u),z(l,i,u),r=!0},p(l,u){let c=t;t=a(l),t===c?o[t].p(l,u):($e(),N(o[c],1,1,()=>{o[c]=null}),Ee(),n=o[t],n?n.p(l,u):(n=o[t]=s[t](l),n.c()),F(n,1),n.m(i.parentNode,i))},i(l){r||(F(n),r=!0)},o(l){N(n),r=!1},d(l){l&&L(i),o[t].d(l)}}}function vbe(e){let t,n,i;var r=e[1];function s(o,a){return{props:{componentData:o[0]}}}return r&&(t=Ye(r,s(e))),{c(){t&&ce(t.$$.fragment),n=Ae()},m(o,a){t&&le(t,o,a),z(o,n,a),i=!0},p(o,a){if(r!==(r=o[1])){if(t){$e();const l=t;N(l.$$.fragment,1,0,()=>{ue(l,1)}),Ee()}r?(t=Ye(r,s(o)),ce(t.$$.fragment),F(t.$$.fragment,1),le(t,n.parentNode,n)):t=null}else if(r){const l={};a&1&&(l.componentData=o[0]),t.$set(l)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&ue(t,o)}}}function xbe(e){let t,n,i;var r=e[1];function s(o,a){return{props:{componentData:o[0],$$slots:{default:[_be]},$$scope:{ctx:o}}}}return r&&(t=Ye(r,s(e))),{c(){t&&ce(t.$$.fragment),n=Ae()},m(o,a){t&&le(t,o,a),z(o,n,a),i=!0},p(o,a){if(r!==(r=o[1])){if(t){$e();const l=t;N(l.$$.fragment,1,0,()=>{ue(l,1)}),Ee()}r?(t=Ye(r,s(o)),ce(t.$$.fragment),F(t.$$.fragment,1),le(t,n.parentNode,n)):t=null}else if(r){const l={};a&1&&(l.componentData=o[0]),a&65&&(l.$$scope={dirty:a,ctx:o}),t.$set(l)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&ue(t,o)}}}function xI(e){let t,n;return t=new o5({props:{componentData:e[3]}}),{c(){ce(t.$$.fragment)},m(i,r){le(t,i,r),n=!0},p(i,r){const s={};r&1&&(s.componentData=i[3]),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){ue(t,i)}}}function _be(e){let t,n,i=Oe(e[0].contents),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{"componentData"in o&&n(0,i=o.componentData)},[i,s]}class o5 extends ve{constructor(t){super(),be(this,t,kbe,wbe,he,{componentData:0})}}function $be(e){let t,n,i;const r=e[1].default,s=ct(r,e,e[0],null);return{c(){t=H("main"),n=H("div"),s&&s.c(),D(n,"class","mainContainer svelte-mqeomk"),D(t,"class","svelte-mqeomk")},m(o,a){z(o,t,a),X(t,n),s&&s.m(n,null),i=!0},p(o,[a]){s&&s.p&&(!i||a&1)&&dt(s,r,o,o[0],i?ft(r,o[0],a,null):ht(o[0]),null)},i(o){i||(F(s,o),i=!0)},o(o){N(s,o),i=!1},d(o){o&&L(t),s&&s.d(o)}}}function Ebe(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class Cbe extends ve{constructor(t){super(),be(this,t,Ebe,$be,he,{})}}const ph=/^[a-z0-9]+(-[a-z0-9]+)*$/,Mm=(e,t,n,i="")=>{const r=e.split(":");if(e.slice(0,1)==="@"){if(r.length<2||r.length>3)return null;i=r.shift().slice(1)}if(r.length>3||!r.length)return null;if(r.length>1){const a=r.pop(),l=r.pop(),u={provider:r.length>0?r[0]:i,prefix:l,name:a};return t&&!Fm(u)?null:u}const s=r[0],o=s.split("-");if(o.length>1){const a={provider:i,prefix:o.shift(),name:o.join("-")};return t&&!Fm(a)?null:a}if(n&&i===""){const a={provider:i,prefix:"",name:s};return t&&!Fm(a,n)?null:a}return null},Fm=(e,t)=>e?!!((e.provider===""||e.provider.match(ph))&&(t&&e.prefix===""||e.prefix.match(ph))&&e.name.match(ph)):!1,_I=Object.freeze({left:0,top:0,width:16,height:16}),Dm=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Nm=Object.freeze({..._I,...Dm}),a5=Object.freeze({...Nm,body:"",hidden:!1});function Sbe(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const i=((e.rotate||0)+(t.rotate||0))%4;return i&&(n.rotate=i),n}function wI(e,t){const n=Sbe(e,t);for(const i in a5)i in Dm?i in e&&!(i in n)&&(n[i]=Dm[i]):i in t?n[i]=t[i]:i in e&&(n[i]=e[i]);return n}function Abe(e,t){const n=e.icons,i=e.aliases||Object.create(null),r=Object.create(null);function s(o){if(n[o])return r[o]=[];if(!(o in r)){r[o]=null;const a=i[o]&&i[o].parent,l=a&&s(a);l&&(r[o]=[a].concat(l))}return r[o]}return(t||Object.keys(n).concat(Object.keys(i))).forEach(s),r}function Tbe(e,t,n){const i=e.icons,r=e.aliases||Object.create(null);let s={};function o(a){s=wI(i[a]||r[a],s)}return o(t),n.forEach(o),wI(e,s)}function kI(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(r=>{t(r,null),n.push(r)});const i=Abe(e);for(const r in i){const s=i[r];s&&(t(r,Tbe(e,r,s)),n.push(r))}return n}const Mbe={provider:"",aliases:{},not_found:{},..._I};function l5(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function $I(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!l5(e,Mbe))return null;const n=t.icons;for(const r in n){const s=n[r];if(!r.match(ph)||typeof s.body!="string"||!l5(s,a5))return null}const i=t.aliases||Object.create(null);for(const r in i){const s=i[r],o=s.parent;if(!r.match(ph)||typeof o!="string"||!n[o]&&!i[o]||!l5(s,a5))return null}return t}const EI=Object.create(null);function Fbe(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function Ol(e,t){const n=EI[e]||(EI[e]=Object.create(null));return n[t]||(n[t]=Fbe(e,t))}function u5(e,t){return $I(t)?kI(t,(n,i)=>{i?e.icons[n]=i:e.missing.add(n)}):[]}function Dbe(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}let gh=!1;function CI(e){return typeof e=="boolean"&&(gh=e),gh}function Nbe(e){const t=typeof e=="string"?Mm(e,!0,gh):e;if(t){const n=Ol(t.provider,t.prefix),i=t.name;return n.icons[i]||(n.missing.has(i)?null:void 0)}}function Obe(e,t){const n=Mm(e,!0,gh);if(!n)return!1;const i=Ol(n.provider,n.prefix);return Dbe(i,n.name,t)}function Rbe(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),gh&&!t&&!e.prefix){let r=!1;return $I(e)&&(e.prefix="",kI(e,(s,o)=>{o&&Obe(s,o)&&(r=!0)})),r}const n=e.prefix;if(!Fm({provider:t,prefix:n,name:"a"}))return!1;const i=Ol(t,n);return!!u5(i,e)}const SI=Object.freeze({width:null,height:null}),AI=Object.freeze({...SI,...Dm}),Lbe=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Ibe=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function TI(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const i=e.split(Lbe);if(i===null||!i.length)return e;const r=[];let s=i.shift(),o=Ibe.test(s);for(;;){if(o){const a=parseFloat(s);isNaN(a)?r.push(s):r.push(Math.ceil(a*t*n)/n)}else r.push(s);if(s=i.shift(),s===void 0)return r.join("");o=!o}}function zbe(e,t="defs"){let n="";const i=e.indexOf("<"+t);for(;i>=0;){const r=e.indexOf(">",i),s=e.indexOf("",s);if(o===-1)break;n+=e.slice(r+1,s).trim(),e=e.slice(0,i).trim()+e.slice(o+1)}return{defs:n,content:e}}function Pbe(e,t){return e?""+e+""+t:t}function Bbe(e,t,n){const i=zbe(e);return Pbe(i.defs,t+i.content+n)}const jbe=e=>e==="unset"||e==="undefined"||e==="none";function Ube(e,t){const n={...Nm,...e},i={...AI,...t},r={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,i].forEach(g=>{const m=[],y=g.hFlip,b=g.vFlip;let v=g.rotate;y?b?v+=2:(m.push("translate("+(r.width+r.left).toString()+" "+(0-r.top).toString()+")"),m.push("scale(-1 1)"),r.top=r.left=0):b&&(m.push("translate("+(0-r.left).toString()+" "+(r.height+r.top).toString()+")"),m.push("scale(1 -1)"),r.top=r.left=0);let x;switch(v<0&&(v-=Math.floor(v/4)*4),v=v%4,v){case 1:x=r.height/2+r.top,m.unshift("rotate(90 "+x.toString()+" "+x.toString()+")");break;case 2:m.unshift("rotate(180 "+(r.width/2+r.left).toString()+" "+(r.height/2+r.top).toString()+")");break;case 3:x=r.width/2+r.left,m.unshift("rotate(-90 "+x.toString()+" "+x.toString()+")");break}v%2===1&&(r.left!==r.top&&(x=r.left,r.left=r.top,r.top=x),r.width!==r.height&&(x=r.width,r.width=r.height,r.height=x)),m.length&&(s=Bbe(s,'',""))});const o=i.width,a=i.height,l=r.width,u=r.height;let c,f;o===null?(f=a===null?"1em":a==="auto"?u:a,c=TI(f,l/u)):(c=o==="auto"?l:o,f=a===null?TI(c,u/l):a==="auto"?u:a);const d={},h=(g,m)=>{jbe(m)||(d[g]=m.toString())};h("width",c),h("height",f);const p=[r.left,r.top,l,u];return d.viewBox=p.join(" "),{attributes:d,viewBox:p,body:s}}const qbe=/\sid="(\S+)"/g,Wbe="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Hbe=0;function Gbe(e,t=Wbe){const n=[];let i;for(;i=qbe.exec(e);)n.push(i[1]);if(!n.length)return e;const r="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(s=>{const o=typeof t=="function"?t(s):t+(Hbe++).toString(),a=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+o+r+"$3")}),e=e.replace(new RegExp(r,"g"),""),e}const c5=Object.create(null);function Vbe(e,t){c5[e]=t}function f5(e){return c5[e]||c5[""]}function d5(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const h5=Object.create(null),mh=["https://api.simplesvg.com","https://api.unisvg.com"],Om=[];for(;mh.length>0;)mh.length===1||Math.random()>.5?Om.push(mh.shift()):Om.push(mh.pop());h5[""]=d5({resources:["https://api.iconify.design"].concat(Om)});function Xbe(e,t){const n=d5(t);return n===null?!1:(h5[e]=n,!0)}function p5(e){return h5[e]}let MI=(()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}})();function Ybe(e,t){const n=p5(e);if(!n)return 0;let i;if(!n.maxURL)i=0;else{let r=0;n.resources.forEach(o=>{r=Math.max(r,o.length)});const s=t+".json?icons=";i=n.maxURL-r-n.path.length-s.length}return i}function Zbe(e){return e===404}const Kbe=(e,t,n)=>{const i=[],r=Ybe(e,t),s="icons";let o={type:s,provider:e,prefix:t,icons:[]},a=0;return n.forEach((l,u)=>{a+=l.length+1,a>=r&&u>0&&(i.push(o),o={type:s,provider:e,prefix:t,icons:[]},a=l.length),o.icons.push(l)}),i.push(o),i};function Jbe(e){if(typeof e=="string"){const t=p5(e);if(t)return t.path}return"/"}const Qbe={prepare:Kbe,send:(e,t,n)=>{if(!MI){n("abort",424);return}let i=Jbe(t.provider);switch(t.type){case"icons":{const s=t.prefix,a=t.icons.join(","),l=new URLSearchParams({icons:a});i+=s+".json?"+l.toString();break}case"custom":{const s=t.uri;i+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let r=503;MI(e+i).then(s=>{const o=s.status;if(o!==200){setTimeout(()=>{n(Zbe(o)?"abort":"next",o)});return}return r=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",r)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",r)})}};function e3e(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((r,s)=>r.provider!==s.provider?r.provider.localeCompare(s.provider):r.prefix!==s.prefix?r.prefix.localeCompare(s.prefix):r.name.localeCompare(s.name));let i={provider:"",prefix:"",name:""};return e.forEach(r=>{if(i.name===r.name&&i.prefix===r.prefix&&i.provider===r.provider)return;i=r;const s=r.provider,o=r.prefix,a=r.name,l=n[s]||(n[s]=Object.create(null)),u=l[o]||(l[o]=Ol(s,o));let c;a in u.icons?c=t.loaded:o===""||u.missing.has(a)?c=t.missing:c=t.pending;const f={provider:s,prefix:o,name:a};c.push(f)}),t}function FI(e,t){e.forEach(n=>{const i=n.loaderCallbacks;i&&(n.loaderCallbacks=i.filter(r=>r.id!==t))})}function t3e(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const i=e.provider,r=e.prefix;t.forEach(s=>{const o=s.icons,a=o.pending.length;o.pending=o.pending.filter(l=>{if(l.prefix!==r)return!0;const u=l.name;if(e.icons[u])o.loaded.push({provider:i,prefix:r,name:u});else if(e.missing.has(u))o.missing.push({provider:i,prefix:r,name:u});else return n=!0,!0;return!1}),o.pending.length!==a&&(n||FI([e],s.id),s.callback(o.loaded.slice(0),o.missing.slice(0),o.pending.slice(0),s.abort))})}))}let n3e=0;function i3e(e,t,n){const i=n3e++,r=FI.bind(null,n,i);if(!t.pending.length)return r;const s={id:i,icons:t,callback:e,abort:r};return n.forEach(o=>{(o.loaderCallbacks||(o.loaderCallbacks=[])).push(s)}),r}function r3e(e,t=!0,n=!1){const i=[];return e.forEach(r=>{const s=typeof r=="string"?Mm(r,t,n):r;s&&i.push(s)}),i}var s3e={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function o3e(e,t,n,i){const r=e.resources.length,s=e.random?Math.floor(Math.random()*r):e.index;let o;if(e.random){let k=e.resources.slice(0);for(o=[];k.length>1;){const w=Math.floor(Math.random()*k.length);o.push(k[w]),k=k.slice(0,w).concat(k.slice(w+1))}o=o.concat(k)}else o=e.resources.slice(s).concat(e.resources.slice(0,s));const a=Date.now();let l="pending",u=0,c,f=null,d=[],h=[];typeof i=="function"&&h.push(i);function p(){f&&(clearTimeout(f),f=null)}function g(){l==="pending"&&(l="aborted"),p(),d.forEach(k=>{k.status==="pending"&&(k.status="aborted")}),d=[]}function m(k,w){w&&(h=[]),typeof k=="function"&&h.push(k)}function y(){return{startTime:a,payload:t,status:l,queriesSent:u,queriesPending:d.length,subscribe:m,abort:g}}function b(){l="failed",h.forEach(k=>{k(void 0,c)})}function v(){d.forEach(k=>{k.status==="pending"&&(k.status="aborted")}),d=[]}function x(k,w,$){const S=w!=="success";switch(d=d.filter(E=>E!==k),l){case"pending":break;case"failed":if(S||!e.dataAfterTimeout)return;break;default:return}if(w==="abort"){c=$,b();return}if(S){c=$,d.length||(o.length?_():b());return}if(p(),v(),!e.random){const E=e.resources.indexOf(k.resource);E!==-1&&E!==e.index&&(e.index=E)}l="completed",h.forEach(E=>{E($)})}function _(){if(l!=="pending")return;p();const k=o.shift();if(k===void 0){if(d.length){f=setTimeout(()=>{p(),l==="pending"&&(v(),b())},e.timeout);return}b();return}const w={status:"pending",resource:k,callback:($,S)=>{x(w,$,S)}};d.push(w),u++,f=setTimeout(_,e.rotate),n(k,t,w.callback)}return setTimeout(_),y}function DI(e){const t={...s3e,...e};let n=[];function i(){n=n.filter(a=>a().status==="pending")}function r(a,l,u){const c=o3e(t,a,l,(f,d)=>{i(),u&&u(f,d)});return n.push(c),c}function s(a){return n.find(l=>a(l))||null}return{query:r,find:s,setIndex:a=>{t.index=a},getIndex:()=>t.index,cleanup:i}}function NI(){}const g5=Object.create(null);function a3e(e){if(!g5[e]){const t=p5(e);if(!t)return;const n=DI(t),i={config:t,redundancy:n};g5[e]=i}return g5[e]}function l3e(e,t,n){let i,r;if(typeof e=="string"){const s=f5(e);if(!s)return n(void 0,424),NI;r=s.send;const o=a3e(e);o&&(i=o.redundancy)}else{const s=d5(e);if(s){i=DI(s);const o=e.resources?e.resources[0]:"",a=f5(o);a&&(r=a.send)}}return!i||!r?(n(void 0,424),NI):i.query(t,r,n)().abort}const OI="iconify2",yh="iconify",RI=yh+"-count",LI=yh+"-version",II=36e5,u3e=168,c3e=50;function m5(e,t){try{return e.getItem(t)}catch{}}function y5(e,t,n){try{return e.setItem(t,n),!0}catch{}}function zI(e,t){try{e.removeItem(t)}catch{}}function b5(e,t){return y5(e,RI,t.toString())}function v5(e){return parseInt(m5(e,RI))||0}const Rm={local:!0,session:!0},PI={local:new Set,session:new Set};let x5=!1;function f3e(e){x5=e}let Lm=typeof window>"u"?{}:window;function BI(e){const t=e+"Storage";try{if(Lm&&Lm[t]&&typeof Lm[t].length=="number")return Lm[t]}catch{}Rm[e]=!1}function jI(e,t){const n=BI(e);if(!n)return;const i=m5(n,LI);if(i!==OI){if(i){const a=v5(n);for(let l=0;l{const l=yh+a.toString(),u=m5(n,l);if(typeof u=="string"){try{const c=JSON.parse(u);if(typeof c=="object"&&typeof c.cached=="number"&&c.cached>r&&typeof c.provider=="string"&&typeof c.data=="object"&&typeof c.data.prefix=="string"&&t(c,a))return!0}catch{}zI(n,l)}};let o=v5(n);for(let a=o-1;a>=0;a--)s(a)||(a===o-1?(o--,b5(n,o)):PI[e].add(a))}function UI(){if(!x5){f3e(!0);for(const e in Rm)jI(e,t=>{const n=t.data,i=t.provider,r=n.prefix,s=Ol(i,r);if(!u5(s,n).length)return!1;const o=n.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,o):o,!0})}}function d3e(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const i in Rm)jI(i,r=>{const s=r.data;return r.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function h3e(e,t){x5||UI();function n(i){let r;if(!Rm[i]||!(r=BI(i)))return;const s=PI[i];let o;if(s.size)s.delete(o=Array.from(s).shift());else if(o=v5(r),o>=c3e||!b5(r,o+1))return;const a={cached:Math.floor(Date.now()/II),provider:e.provider,data:t};return y5(r,yh+o.toString(),JSON.stringify(a))}t.lastModified&&!d3e(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function qI(){}function p3e(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,t3e(e)}))}function g3e(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:i}=e,r=e.iconsToLoad;delete e.iconsToLoad;let s;if(!r||!(s=f5(n)))return;s.prepare(n,i,r).forEach(a=>{l3e(n,a,l=>{if(typeof l!="object")a.icons.forEach(u=>{e.missing.add(u)});else try{const u=u5(e,l);if(!u.length)return;const c=e.pendingIcons;c&&u.forEach(f=>{c.delete(f)}),h3e(e,l)}catch(u){console.error(u)}p3e(e)})})}))}const m3e=(e,t)=>{const n=r3e(e,!0,CI()),i=e3e(n);if(!i.pending.length){let l=!0;return t&&setTimeout(()=>{l&&t(i.loaded,i.missing,i.pending,qI)}),()=>{l=!1}}const r=Object.create(null),s=[];let o,a;return i.pending.forEach(l=>{const{provider:u,prefix:c}=l;if(c===a&&u===o)return;o=u,a=c,s.push(Ol(u,c));const f=r[u]||(r[u]=Object.create(null));f[c]||(f[c]=[])}),i.pending.forEach(l=>{const{provider:u,prefix:c,name:f}=l,d=Ol(u,c),h=d.pendingIcons||(d.pendingIcons=new Set);h.has(f)||(h.add(f),r[u][c].push(f))}),s.forEach(l=>{const{provider:u,prefix:c}=l;r[u][c].length&&g3e(l,r[u][c])}),t?i3e(t,i,s):qI};function y3e(e,t){const n={...e};for(const i in t){const r=t[i],s=typeof r;i in SI?(r===null||r&&(s==="string"||s==="number"))&&(n[i]=r):s===typeof n[i]&&(n[i]=i==="rotate"?r%4:r)}return n}const b3e=/[\s,]+/;function v3e(e,t){t.split(b3e).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function x3e(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function i(r){for(;r<0;)r+=4;return r%4}if(n===""){const r=parseInt(e);return isNaN(r)?0:i(r)}else if(n!==e){let r=0;switch(n){case"%":r=25;break;case"deg":r=90}if(r){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/r,s%1===0?i(s):0)}}return t}function _3e(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in t)n+=" "+i+'="'+t[i]+'"';return'"+e+""}function w3e(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(//g,"%3E").replace(/\s+/g," ")}function k3e(e){return"data:image/svg+xml,"+w3e(e)}function $3e(e){return'url("'+k3e(e)+'")'}const WI={...AI,inline:!1},E3e={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},C3e={display:"inline-block"},_5={"background-color":"currentColor"},HI={"background-color":"transparent"},GI={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},VI={"-webkit-mask":_5,mask:_5,background:HI};for(const e in VI){const t=VI[e];for(const n in GI)t[e+"-"+n]=GI[n]}function S3e(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}function A3e(e,t){const n=y3e(WI,t),i=t.mode||"svg",r=i==="svg"?{...E3e}:{};e.body.indexOf("xlink:")===-1&&delete r["xmlns:xlink"];let s=typeof t.style=="string"?t.style:"";for(let y in t){const b=t[y];if(b!==void 0)switch(y){case"icon":case"style":case"onLoad":case"mode":break;case"inline":case"hFlip":case"vFlip":n[y]=b===!0||b==="true"||b===1;break;case"flip":typeof b=="string"&&v3e(n,b);break;case"color":s=s+(s.length>0&&s.trim().slice(-1)!==";"?";":"")+"color: "+b+"; ";break;case"rotate":typeof b=="string"?n[y]=x3e(b):typeof b=="number"&&(n[y]=b);break;case"ariaHidden":case"aria-hidden":b!==!0&&b!=="true"&&delete r["aria-hidden"];break;default:if(y.slice(0,3)==="on:")break;WI[y]===void 0&&(r[y]=b)}}const o=Ube(e,n),a=o.attributes;if(n.inline&&(s="vertical-align: -0.125em; "+s),i==="svg"){Object.assign(r,a),s!==""&&(r.style=s);let y=0,b=t.id;return typeof b=="string"&&(b=b.replace(/-/g,"_")),{svg:!0,attributes:r,body:Gbe(o.body,b?()=>b+"ID"+y++:"iconifySvelte")}}const{body:l,width:u,height:c}=e,f=i==="mask"||(i==="bg"?!1:l.indexOf("currentColor")!==-1),d=_3e(l,{...a,width:u+"",height:c+""}),p={"--svg":$3e(d)},g=y=>{const b=a[y];b&&(p[y]=S3e(b))};g("width"),g("height"),Object.assign(p,C3e,f?_5:HI);let m="";for(const y in p)m+=y+": "+p[y]+";";return r.style=m+s,{svg:!1,attributes:r}}if(CI(!0),Vbe("",Qbe),typeof document<"u"&&typeof window<"u"){UI();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(i=>{try{(typeof i!="object"||i===null||i instanceof Array||typeof i.icons!="object"||typeof i.prefix!="string"||!Rbe(i))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const i="IconifyProviders["+n+"] is invalid.";try{const r=t[n];if(typeof r!="object"||!r||r.resources===void 0)continue;Xbe(n,r)||console.error(i)}catch{console.error(i)}}}}function T3e(e,t,n,i,r){function s(){t.loading&&(t.loading.abort(),t.loading=null)}if(typeof e=="object"&&e!==null&&typeof e.body=="string")return t.name="",s(),{data:{...Nm,...e}};let o;if(typeof e!="string"||(o=Mm(e,!1,!0))===null)return s(),null;const a=Nbe(o);if(!a)return n&&(!t.loading||t.loading.name!==e)&&(s(),t.name="",t.loading={name:e,abort:m3e([o],i)}),null;s(),t.name!==e&&(t.name=e,r&&!t.destroyed&&r(e));const l=["iconify"];return o.prefix!==""&&l.push("iconify--"+o.prefix),o.provider!==""&&l.push("iconify--"+o.provider),{data:a,classes:l}}function M3e(e,t){return e?A3e({...Nm,...e},t):null}function XI(e){let t;function n(s,o){return s[0].svg?D3e:F3e}let i=n(e),r=i(e);return{c(){r.c(),t=Ae()},m(s,o){r.m(s,o),z(s,t,o)},p(s,o){i===(i=n(s))&&r?r.p(s,o):(r.d(1),r=i(s),r&&(r.c(),r.m(t.parentNode,t)))},d(s){s&&L(t),r.d(s)}}}function F3e(e){let t,n=[e[0].attributes],i={};for(let r=0;r{typeof t.onLoad=="function"&&t.onLoad(u),Bm()("load",{icon:u})};function l(){n(3,s++,s)}return Mc(()=>{n(2,r=!0)}),M5(()=>{n(1,i.destroyed=!0,i),i.loading&&(i.loading.abort(),n(1,i.loading=null,i))}),e.$$set=u=>{n(6,t=Ge(Ge({},t),Pm(u)))},e.$$.update=()=>{{const u=T3e(t.icon,i,r,l,a);n(0,o=u?M3e(u.data,t):null),o&&u.classes&&n(0,o.attributes.class=(typeof t.class=="string"?t.class+" ":"")+u.classes.join(" "),o)}},t=Pm(t),[o,i,r,s]}class R3e extends ve{constructor(t){super(),be(this,t,O3e,N3e,he,{})}}function YI(e){let t,n,i,r,s,o,a,l,u;return i=new R3e({props:{icon:"mdi:close"}}),o=new o5({props:{componentData:e[1]}}),{c(){t=H("div"),n=H("span"),ce(i.$$.fragment),r=je(),s=H("div"),ce(o.$$.fragment),D(n,"class","cancelButton svelte-1hhf5ym"),D(s,"class","modalContainer"),D(t,"class","modal svelte-1hhf5ym"),D(t,"data-component","modal")},m(c,f){z(c,t,f),X(t,n),le(i,n,null),X(t,r),X(t,s),le(o,s,null),a=!0,l||(u=[Il(s,"click",I3e),Il(t,"click",e[3])],l=!0)},p(c,f){const d={};f&2&&(d.componentData=c[1]),o.$set(d)},i(c){a||(F(i.$$.fragment,c),F(o.$$.fragment,c),a=!0)},o(c){N(i.$$.fragment,c),N(o.$$.fragment,c),a=!1},d(c){c&&L(t),ue(i),ue(o),l=!1,Ll(u)}}}function L3e(e){let t,n,i,r,s=e[0]&&e[1]&&YI(e);return{c(){s&&s.c(),t=Ae()},m(o,a){s&&s.m(o,a),z(o,t,a),n=!0,i||(r=Il(window,"keyup",e[2]),i=!0)},p(o,[a]){o[0]&&o[1]?s?(s.p(o,a),a&3&&F(s,1)):(s=YI(o),s.c(),F(s,1),s.m(t.parentNode,t)):s&&($e(),N(s,1,1,()=>{s=null}),Ee())},i(o){n||(F(s),n=!0)},o(o){N(s),n=!1},d(o){o&&L(t),s&&s.d(o),i=!1,r()}}}const I3e=e=>{e==null||e.stopImmediatePropagation()};function z3e(e,t,n){let i;_h(e,Fc,a=>n(1,i=a));let{componentData:r}=t;function s(a){a.code==="Escape"&&Fc.set(void 0)}function o(a){a.stopImmediatePropagation(),Fc.set(void 0)}return e.$$set=a=>{"componentData"in a&&n(0,r=a.componentData)},[r,i,s,o]}class P3e extends ve{constructor(t){super(),be(this,t,z3e,L3e,he,{componentData:0})}}function ZI(e,t,n){const i=e.slice();return i[2]=t[n][0],i[3]=t[n][1],i}function KI(e,t,n){const i=e.slice();return i[6]=t[n],i}function JI(e){let t,n=e[2]+"",i;return{c(){t=H("span"),i=Be(n),D(t,"class","pageId svelte-1kdpgko")},m(r,s){z(r,t,s),X(t,i)},p(r,s){s&1&&n!==(n=r[2]+"")&&pt(i,n)},d(r){r&&L(t)}}}function QI(e){let t,n,i=e[6]+"",r,s,o,a;function l(){return e[1](e[6])}return{c(){t=H("li"),n=H("button"),r=Be(i),s=je(),D(n,"class","textButton"),D(t,"class","sectionLink svelte-1kdpgko")},m(u,c){z(u,t,c),X(t,n),X(n,r),X(t,s),o||(a=Il(n,"click",l),o=!0)},p(u,c){e=u,c&1&&i!==(i=e[6]+"")&&pt(r,i)},d(u){u&&L(t),o=!1,a()}}}function ez(e){let t,n,i,r,s=e[2]&&JI(e),o=Oe(e[3]||[]),a=[];for(let l=0;lj3e(s);return e.$$set=s=>{"pageHierarchy"in s&&n(0,i=s.pageHierarchy)},[i,r]}class q3e extends ve{constructor(t){super(),be(this,t,U3e,B3e,he,{pageHierarchy:0})}}const{Boolean:W3e}=fz;function tz(e,t,n){const i=e.slice();return i[5]=t[n],i}function H3e(e){var i;let t,n;return t=new q3e({props:{pageHierarchy:I5((i=e[0])==null?void 0:i.components)}}),{c(){ce(t.$$.fragment)},m(r,s){le(t,r,s),n=!0},p(r,s){var a;const o={};s&1&&(o.pageHierarchy=I5((a=r[0])==null?void 0:a.components)),t.$set(o)},i(r){n||(F(t.$$.fragment,r),n=!0)},o(r){N(t.$$.fragment,r),n=!1},d(r){ue(t,r)}}}function nz(e){let t,n;return t=new o5({props:{componentData:e[5]}}),{c(){ce(t.$$.fragment)},m(i,r){le(t,i,r),n=!0},p(i,r){const s={};r&1&&(s.componentData=i[5]),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){ue(t,i)}}}function G3e(e){var o;let t,n,i=Oe(((o=e[0])==null?void 0:o.components)||[]),r=[];for(let a=0;aN(r[a],1,1,()=>{r[a]=null});return{c(){for(let a=0;a{l=null}),Ee())},i(u){a||(F(n.$$.fragment,u),F(r.$$.fragment,u),F(l),a=!0)},o(u){N(n.$$.fragment,u),N(r.$$.fragment,u),N(l),a=!1},d(u){u&&(L(t),L(s),L(o)),ue(n),ue(r),l&&l.d(u)}}}function X3e(e,t,n){let i,r;_h(e,ua,l=>n(0,i=l)),_h(e,Fc,l=>n(1,r=l));let{cardDataId:s}=t;$z(s);let a=!!new URLSearchParams(window==null?void 0:window.location.search).get("embed");return e.$$set=l=>{"cardDataId"in l&&n(3,s=l.cardDataId)},[i,r,a,s]}class Y3e extends ve{constructor(t){super(),be(this,t,X3e,V3e,he,{cardDataId:3})}}let rz;try{const e=window.mfCardDataId,t=window.mfContainerId,n=(oz=document.querySelector(`[data-container="${t}"]`))==null?void 0:oz.querySelector(".card_app");rz=new Y3e({target:n??document.querySelector(".card_app"),props:{cardDataId:e}})}catch(e){throw new Error(e)}return rz}); +`,Rye="chart-wrapper";function Lye(e){return typeof e=="function"}function ZL(e,t,n,i){const r=`${t}
`,s=`
${n}`,o=window.open("");o.document.write(r+e+s),o.document.title=`${hh[i]} JSON Source`}function Iye(e,t){if(e.$schema){const n=dL(e.$schema);t&&t!==n.library&&console.warn(`The given visualization spec is written in ${hh[n.library]}, but mode argument sets ${hh[t]??t}.`);const i=n.library;return XL(Am[i],`^${n.version.slice(1)}`)||console.warn(`The input spec uses ${hh[i]} ${n.version}, but the current version of ${hh[i]} is v${Am[i]}.`),i}return"mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e?"vega-lite":"marks"in e||"signals"in e||"scales"in e||"axes"in e?"vega":t??"vega"}function KL(e){return!!(e&&"load"in e)}function JL(e){return KL(e)?e:Tr.loader(e)}function zye(e){var n;const t=((n=e.usermeta)==null?void 0:n.embedOptions)??{};return te(t.defaultStyle)&&(t.defaultStyle=!1),t}async function Pye(e,t,n={}){let i,r;te(t)?(r=JL(n.loader),i=JSON.parse(await r.load(t))):i=t;const s=zye(i),o=s.loader;(!r||o)&&(r=JL(n.loader??o));const a=await QL(s,r),l=await QL(n,r),u={...YL(l,a),config:Wl(l.config??{},a.config??{})};return await jye(e,i,u,r)}async function QL(e,t){const n=te(e.config)?JSON.parse(await t.load(e.config)):e.config??{},i=te(e.patch)?JSON.parse(await t.load(e.patch)):e.patch;return{...e,...i?{patch:i}:{},...n?{config:n}:{}}}function Bye(e){const t=e.getRootNode?e.getRootNode():document;return t instanceof ShadowRoot?{root:t,rootContainer:t}:{root:document,rootContainer:document.head??document.body}}async function jye(e,t,n={},i){const r=n.theme?Wl(N2e[n.theme],n.config??{}):n.config,s=ro(n.actions)?n.actions:YL({},Fye,n.actions??{}),o={...Dye,...n.i18n},a=n.renderer??"canvas",l=n.logLevel??Tr.Warn,u=n.downloadFileName??"visualization",c=typeof e=="string"?document.querySelector(e):e;if(!c)throw new Error(`${e} does not exist`);if(n.defaultStyle!==!1){const _="vega-embed-style",{root:k,rootContainer:w}=Bye(c);if(!k.getElementById(_)){const $=document.createElement("style");$.id=_,$.innerHTML=n.defaultStyle===void 0||n.defaultStyle===!0?Tye.toString():n.defaultStyle,w.appendChild($)}}const f=Iye(t,n.mode);let d=Nye[f](t,r);if(f==="vega-lite"&&d.$schema){const _=dL(d.$schema);XL(Am.vega,`^${_.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${_.version}, but current version is v${Am.vega}.`)}c.classList.add("vega-embed"),s&&c.classList.add("has-actions"),c.innerHTML="";let h=c;if(s){const _=document.createElement("div");_.classList.add(Rye),c.appendChild(_),h=_}const p=n.patch;if(p&&(d=p instanceof Function?p(d):Mh(d,p,!0,!1).newDocument),n.formatLocale&&Tr.formatLocale(n.formatLocale),n.timeFormatLocale&&Tr.timeFormatLocale(n.timeFormatLocale),n.expressionFunctions)for(const _ in n.expressionFunctions){const k=n.expressionFunctions[_];"fn"in k?Tr.expressionFunction(_,k.fn,k.visitor):k instanceof Function&&Tr.expressionFunction(_,k)}const{ast:g}=n,m=Tr.parse(d,f==="vega-lite"?{}:r,{ast:g}),y=new(n.viewClass||Tr.View)(m,{loader:i,logLevel:l,renderer:a,...g?{expr:Tr.expressionInterpreter??n.expr??gce}:{}});if(y.addSignalListener("autosize",(_,k)=>{const{type:w}=k;w=="fit-x"?(h.classList.add("fit-x"),h.classList.remove("fit-y")):w=="fit-y"?(h.classList.remove("fit-x"),h.classList.add("fit-y")):w=="fit"?h.classList.add("fit-x","fit-y"):h.classList.remove("fit-x","fit-y")}),n.tooltip!==!1){const{loader:_,tooltip:k}=n,w=_&&!KL(_)?_==null?void 0:_.baseURL:void 0,$=Lye(k)?k:new j2e({baseURL:w,...k===!0?{}:k}).call;y.tooltip($)}let{hover:b}=n;if(b===void 0&&(b=f==="vega"),b){const{hoverSet:_,updateSet:k}=typeof b=="boolean"?{}:b;y.hover(_,k)}n&&(n.width!=null&&y.width(n.width),n.height!=null&&y.height(n.height),n.padding!=null&&y.padding(n.padding)),await y.initialize(h,n.bind).runAsync();let v;if(s!==!1){let _=c;if(n.defaultStyle!==!1||n.forceActionsMenu){const w=document.createElement("details");w.title=o.CLICK_TO_VIEW_ACTIONS,c.append(w),_=w;const $=document.createElement("summary");$.innerHTML=Oye,w.append($),v=S=>{w.contains(S.target)||w.removeAttribute("open")},document.addEventListener("click",v)}const k=document.createElement("div");if(_.append(k),k.classList.add("vega-actions"),s===!0||s.export!==!1){for(const w of["svg","png"])if(s===!0||s.export===!0||s.export[w]){const $=o[`${w.toUpperCase()}_ACTION`],S=document.createElement("a"),E=re(n.scaleFactor)?n.scaleFactor[w]:n.scaleFactor;S.text=$,S.href="#",S.target="_blank",S.download=`${u}.${w}`,S.addEventListener("mousedown",async function(A){A.preventDefault();const R=await y.toImageURL(w,E);this.href=R}),k.append(S)}}if(s===!0||s.source!==!1){const w=document.createElement("a");w.text=o.SOURCE_ACTION,w.href="#",w.addEventListener("click",function($){ZL(i2(t),n.sourceHeader??"",n.sourceFooter??"",f),$.preventDefault()}),k.append(w)}if(f==="vega-lite"&&(s===!0||s.compiled!==!1)){const w=document.createElement("a");w.text=o.COMPILED_ACTION,w.href="#",w.addEventListener("click",function($){ZL(i2(d),n.sourceHeader??"",n.sourceFooter??"","vega"),$.preventDefault()}),k.append(w)}if(s===!0||s.editor!==!1){const w=n.editorUrl??"https://vega.github.io/editor/",$=document.createElement("a");$.text=o.EDITOR_ACTION,$.href="#",$.addEventListener("click",function(S){Aye(window,w,{config:r,mode:f,renderer:a,spec:i2(t)}),S.preventDefault()}),k.append($)}}function x(){v&&document.removeEventListener("click",v),y.finalize()}return{view:y,spec:t,vgSpec:d,finalize:x,embedOptions:n}}const Uye=new Set(["width","height"]);var qye=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var i,r,s;if(Array.isArray(t)){if(i=t.length,i!=n.length)return!1;for(r=i;r--!==0;)if(!e(t[r],n[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),i=s.length,i!==Object.keys(n).length)return!1;for(r=i;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[r]))return!1;for(r=i;r--!==0;){var o=s[r];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n};const Wye=j6(qye);function Hye(e,t){for(const[n,i]of Object.entries(t))i&&(i&&{}.toString.call(i)==="[object Function]"?i(e.data(n)):e.change(n,Tr.changeset().remove(()=>!0).insert(i)))}function Tm(e={},t={},n=new Set){const i=Object.keys(e),r=Object.keys(t);return e===t||i.length===r.length&&i.filter(s=>!n.has(s)).every(s=>e[s]===t[s])}function eI(e,t){const n=Object.keys(t);for(const i of n)try{e.removeSignalListener(i,t[i])}catch(r){console.warn("Cannot remove invalid signal listener.",r)}return n.length>0}function s5(e,t){const n=Object.keys(t);for(const i of n)try{e.addSignalListener(i,t[i])}catch(r){console.warn("Cannot add invalid signal listener.",r)}return n.length>0}function Gye(e){return new Set(e.flatMap(t=>Object.keys(t)))}function Vye(e,t){if(e===t)return!1;const n={width:!1,height:!1,isExpensive:!1},i="width"in e||"width"in t,r="height"in e||"height"in t;return i&&(!("width"in e)||!("width"in t)||e.width!==t.width)&&("width"in e&&typeof e.width=="number"?n.width=e.width:n.isExpensive=!0),r&&(!("height"in e)||!("height"in t)||e.height!==t.height)&&("height"in e&&typeof e.height=="number"?n.height=e.height:n.isExpensive=!0),[...Gye([e,t])].filter(o=>o!=="width"&&o!=="height").some(o=>!(o in e)||!(o in t)||!Wye(e[o],t[o]))&&(n.isExpensive=!0),n.width!==!1||n.height!==!1||n.isExpensive?n:!1}function tI(e,t){const{width:n,height:i}=t;return typeof n<"u"&&typeof i<"u"?{...e,width:n,height:i}:typeof n<"u"?{...e,width:n}:typeof i<"u"?{...e,height:i}:e}function Xye(e){let t;return{c(){t=H("div")},m(n,i){I(n,t,i),e[11](t)},p:ie,i:ie,o:ie,d(n){n&&L(t),e[11](null)}}}function Yye(e,t,n){let{options:i}=t,{spec:r}=t,{view:s}=t,{signalListeners:o={}}=t,{data:a={}}=t;const l=Bm();let u,c={},f={},d={},h={},p;M5(()=>{m()});async function g(){m();try{n(6,u=await Pye(p,r,i)),n(1,s=u.view),s5(s,o)&&s.runAsync(),b(s)}catch(_){y(_)}}function m(){u&&(u.finalize(),n(6,u=void 0),n(1,s=void 0))}function y(_){l("onError",{error:_}),console.warn(_)}function b(_){v(),l("onNewView",{view:_})}async function v(){a&&Object.keys(a).length>0&&u!==void 0&&(n(1,s=u.view),Hye(s,a),await s.resize().runAsync())}function x(_){Ai[_?"unshift":"push"](()=>{p=_,n(0,p)})}return e.$$set=_=>{"options"in _&&n(2,i=_.options),"spec"in _&&n(3,r=_.spec),"view"in _&&n(1,s=_.view),"signalListeners"in _&&n(4,o=_.signalListeners),"data"in _&&n(5,a=_.data)},e.$$.update=()=>{if(e.$$.dirty&1056&&(Tm(a,h)||v(),n(10,h=a)),e.$$.dirty&991&&p!==void 0){if(!Tm(i,c,Uye))g();else{const _=Vye(tI(r,i),tI(d,c)),k=o,w=f;if(_){if(_.isExpensive)g();else if(u!==void 0){const $=!Tm(k,w);n(1,s=u.view),_.width!==!1&&s.width(_.width),_.height!==!1&&s.height(_.height),$&&(w&&eI(s,w),k&&s5(s,k)),s.runAsync()}}else!Tm(k,w)&&u!==void 0&&(n(1,s=u.view),w&&eI(s,w),k&&s5(s,k),s.runAsync())}n(7,c=i),n(8,f=o),n(9,d=r)}},[p,s,i,r,o,a,u,c,f,d,h,x]}class Zye extends ge{constructor(t){super(),pe(this,t,Yye,Xye,he,{options:2,spec:3,view:1,signalListeners:4,data:5})}}function Kye(e){let t,n,i;function r(o){e[6](o)}let s={spec:e[1],data:e[2],signalListeners:e[3],options:e[4]};return e[0]!==void 0&&(s.view=e[0]),t=new Zye({props:s}),Ai.push(()=>Gm(t,"view",r)),t.$on("onNewView",e[7]),t.$on("onError",e[8]),{c(){ce(t.$$.fragment)},m(o,a){le(t,o,a),i=!0},p(o,[a]){const l={};a&2&&(l.spec=o[1]),a&4&&(l.data=o[2]),a&8&&(l.signalListeners=o[3]),a&16&&(l.options=o[4]),!n&&a&1&&(n=!0,l.view=o[0],Wm(()=>n=!1)),t.$set(l)},i(o){i||(F(t.$$.fragment,o),i=!0)},o(o){N(t.$$.fragment,o),i=!1},d(o){ue(t,o)}}}const Jye="vega";function Qye(e,t,n){let i,{spec:r}=t,{options:s={}}=t,{data:o={}}=t,{signalListeners:a={}}=t,{view:l=void 0}=t;function u(d){l=d,n(0,l)}function c(d){N5.call(this,e,d)}function f(d){N5.call(this,e,d)}return e.$$set=d=>{"spec"in d&&n(1,r=d.spec),"options"in d&&n(5,s=d.options),"data"in d&&n(2,o=d.data),"signalListeners"in d&&n(3,a=d.signalListeners),"view"in d&&n(0,l=d.view)},e.$$.update=()=>{e.$$.dirty&32&&n(4,i={...s,mode:Jye})},[l,r,o,a,i,s,u,c,f]}class nI extends ge{constructor(t){super(),pe(this,t,Qye,Kye,he,{spec:1,options:5,data:2,signalListeners:3,view:0})}}function ebe(e){let t,n;return t=new nI({props:{spec:e[1],options:e[0]}}),{c(){ce(t.$$.fragment)},m(i,r){le(t,i,r),n=!0},p(i,r){const s={};r&2&&(s.spec=i[1]),r&1&&(s.options=i[0]),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){ue(t,i)}}}function tbe(e){let t,n;return t=new nI({props:{data:e[2],spec:e[1],options:e[0]}}),{c(){ce(t.$$.fragment)},m(i,r){le(t,i,r),n=!0},p(i,r){const s={};r&4&&(s.data=i[2]),r&2&&(s.spec=i[1]),r&1&&(s.options=i[0]),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){ue(t,i)}}}function nbe(e){let t,n,i,r;const s=[tbe,ebe],o=[];function a(l,u){return l[2]&&l[1]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Ae()},m(l,u){o[t].m(l,u),I(l,i,u),r=!0},p(l,[u]){let c=t;t=a(l),t===c?o[t].p(l,u):($e(),N(o[c],1,1,()=>{o[c]=null}),Ee(),n=o[t],n?n.p(l,u):(n=o[t]=s[t](l),n.c()),F(n,1),n.m(i.parentNode,i))},i(l){r||(F(n),r=!0)},o(l){N(n),r=!1},d(l){l&&L(i),o[t].d(l)}}}function ibe(e,t,n){let i,r,s,{componentData:o}=t;return e.$$set=a=>{"componentData"in a&&n(3,o=a.componentData)},e.$$.update=()=>{e.$$.dirty&8&&n(2,{data:i,spec:r,options:s}=o,i,(n(1,r),n(3,o)),(n(0,s),n(3,o)))},[s,r,i,o]}class iI extends ge{constructor(t){super(),pe(this,t,ibe,nbe,he,{componentData:3})}}function rbe(e){var r;let t,n=(((r=e[0])==null?void 0:r.text)||"")+"",i;return{c(){t=H("p"),i=Oe(n),D(t,"data-component","text")},m(s,o){I(s,t,o),V(t,i)},p(s,[o]){var a;o&1&&n!==(n=(((a=s[0])==null?void 0:a.text)||"")+"")&&at(i,n)},i:ie,o:ie,d(s){s&&L(t)}}}function sbe(e,t,n){let{componentData:i}=t;return e.$$set=r=>{"componentData"in r&&n(0,i=r.componentData)},[i]}class rI extends ge{constructor(t){super(),pe(this,t,sbe,rbe,he,{componentData:0})}}function obe(e){let t,n,i=e[0].data+"",r,s,o;return{c(){t=H("pre"),n=H("code"),r=Oe(i),s=Oe(` + `),o=Oe(` +`),D(n,"class","language-python"),D(t,"data-component","pythonCode")},m(a,l){I(a,t,l),V(t,n),V(n,r),V(n,s),e[2](n),V(t,o)},p(a,[l]){l&1&&i!==(i=a[0].data+"")&&at(r,i)},i:ie,o:ie,d(a){a&&L(t),e[2](null)}}}function abe(e,t,n){let{componentData:i}=t,r;function s(){var a;r&&((a=window==null?void 0:window.Prism)==null||a.highlightElement(r))}function o(a){Ai[a?"unshift":"push"](()=>{r=a,n(1,r)})}return e.$$set=a=>{"componentData"in a&&n(0,i=a.componentData)},e.$$.update=()=>{e.$$.dirty&2&&r&&s()},[i,r,o]}class sI extends ge{constructor(t){super(),pe(this,t,abe,obe,he,{componentData:0})}}function lbe(e){let t;return{c(){t=Oe(e[0])},m(n,i){I(n,t,i)},p(n,i){i&1&&at(t,n[0])},i:ie,o:ie,d(n){n&&L(t)}}}function ube(e){let t,n,i;var r=e[1];function s(o,a){return{props:{componentData:o[0]}}}return r&&(t=Ye(r,s(e))),{c(){t&&ce(t.$$.fragment),n=Ae()},m(o,a){t&&le(t,o,a),I(o,n,a),i=!0},p(o,a){if(a&2&&r!==(r=o[1])){if(t){$e();const l=t;N(l.$$.fragment,1,0,()=>{ue(l,1)}),Ee()}r?(t=Ye(r,s(o)),ce(t.$$.fragment),F(t.$$.fragment,1),le(t,n.parentNode,n)):t=null}else if(r){const l={};a&1&&(l.componentData=o[0]),t.$set(l)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&ue(t,o)}}}function cbe(e){let t,n,i,r;const s=[ube,lbe],o=[];function a(l,u){return l[1]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Ae()},m(l,u){o[t].m(l,u),I(l,i,u),r=!0},p(l,[u]){let c=t;t=a(l),t===c?o[t].p(l,u):($e(),N(o[c],1,1,()=>{o[c]=null}),Ee(),n=o[t],n?n.p(l,u):(n=o[t]=s[t](l),n.c()),F(n,1),n.m(i.parentNode,i))},i(l){r||(F(n),r=!0)},o(l){N(n),r=!1},d(l){l&&L(i),o[t].d(l)}}}function fbe(e,t,n){let{componentData:i}=t,r;const s={artifacts:j5,dag:J5,heading:i6,image:o6,log:a6,markdown:M6,progressBar:O6,text:rI,vegaChart:iI,pythonCode:sI},o=i==null?void 0:i.type;return o&&(r=s==null?void 0:s[o],r||console.error("Unknown component type: ",o)),e.$$set=a=>{"componentData"in a&&n(0,i=a.componentData)},[i,r]}class oI extends ge{constructor(t){super(),pe(this,t,fbe,cbe,he,{componentData:0})}}function aI(e,t,n){const i=e.slice();return i[3]=t[n],i[5]=n,i}function lI(e,t,n){const i=e.slice();return i[6]=t[n],i}function uI(e){let t,n,i,r,s=Re(e[1]),o=[];for(let l=0;lN(o[l],1,1,()=>{o[l]=null});return{c(){t=H("div"),n=H("table"),i=H("tbody");for(let l=0;lN(u[f],1,1,()=>{u[f]=null});return{c(){t=H("tr"),n=H("td"),r=Oe(i),s=je();for(let f=0;f{i=null}),Ee())},i(r){n||(F(i),n=!0)},o(r){N(i),n=!1},d(r){r&&L(t),i&&i.d(r)}}}function hbe(e,t,n){let i,r,{componentData:s}=t;return e.$$set=o=>{"componentData"in o&&n(2,s=o.componentData)},e.$$.update=()=>{e.$$.dirty&4&&n(1,{columns:i,data:r}=s,i,(n(0,r),n(2,s)))},[r,i,s]}class pbe extends ge{constructor(t){super(),pe(this,t,hbe,dbe,he,{componentData:2})}}function dI(e,t,n){const i=e.slice();return i[3]=t[n],i}function hI(e,t,n){const i=e.slice();return i[6]=t[n],i}function pI(e,t,n){const i=e.slice();return i[9]=t[n],i}function gI(e){let t,n,i,r,s,o,a,l=Re(e[1]),u=[];for(let h=0;hN(f[h],1,1,()=>{f[h]=null});return{c(){t=H("div"),n=H("table"),i=H("thead"),r=H("tr");for(let h=0;hN(s[a],1,1,()=>{s[a]=null});return{c(){t=H("tr");for(let a=0;a{i=null}),Ee())},i(r){n||(F(i),n=!0)},o(r){N(i),n=!1},d(r){r&&L(t),i&&i.d(r)}}}function mbe(e,t,n){let i,r,{componentData:s}=t;return e.$$set=o=>{"componentData"in o&&n(2,s=o.componentData)},e.$$.update=()=>{e.$$.dirty&4&&n(1,{columns:i,data:r}=s,i,(n(0,r),n(2,s)))},[r,i,s]}class ybe extends ge{constructor(t){super(),pe(this,t,mbe,gbe,he,{componentData:2})}}function vI(e){let t,n,i;var r=e[3];function s(o,a){return{props:{componentData:o[0]}}}return r&&(t=Ye(r,s(e))),{c(){t&&ce(t.$$.fragment),n=Ae()},m(o,a){t&&le(t,o,a),I(o,n,a),i=!0},p(o,a){if(r!==(r=o[3])){if(t){$e();const l=t;N(l.$$.fragment,1,0,()=>{ue(l,1)}),Ee()}r?(t=Ye(r,s(o)),ce(t.$$.fragment),F(t.$$.fragment,1),le(t,n.parentNode,n)):t=null}else if(r){const l={};a&1&&(l.componentData=o[0]),t.$set(l)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&ue(t,o)}}}function bbe(e){let t,n,i=e[2]&&e[1]&&vI(e);return{c(){i&&i.c(),t=Ae()},m(r,s){i&&i.m(r,s),I(r,t,s),n=!0},p(r,[s]){r[2]&&r[1]?i?(i.p(r,s),s&6&&F(i,1)):(i=vI(r),i.c(),F(i,1),i.m(t.parentNode,t)):i&&($e(),N(i,1,1,()=>{i=null}),Ee())},i(r){n||(F(i),n=!0)},o(r){N(i),n=!1},d(r){r&&L(t),i&&i.d(r)}}}function vbe(e,t,n){let i,r,s,{componentData:o}=t;const a=s?pbe:ybe;return e.$$set=l=>{"componentData"in l&&n(0,o=l.componentData)},e.$$.update=()=>{e.$$.dirty&1&&n(2,{columns:i,data:r,vertical:s}=o,i,(n(1,r),n(0,o)))},[o,r,i,a]}class xbe extends ge{constructor(t){super(),pe(this,t,vbe,bbe,he,{componentData:0})}}function xI(e,t,n){const i=e.slice();return i[3]=t[n],i}function _be(e){let t,n,i,r;const s=[kbe,wbe],o=[];function a(l,u){var c;return(l[0].type==="page"||l[0].type==="section")&&((c=l[0])!=null&&c.contents)?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Ae()},m(l,u){o[t].m(l,u),I(l,i,u),r=!0},p(l,u){let c=t;t=a(l),t===c?o[t].p(l,u):($e(),N(o[c],1,1,()=>{o[c]=null}),Ee(),n=o[t],n?n.p(l,u):(n=o[t]=s[t](l),n.c()),F(n,1),n.m(i.parentNode,i))},i(l){r||(F(n),r=!0)},o(l){N(n),r=!1},d(l){l&&L(i),o[t].d(l)}}}function wbe(e){let t,n,i;var r=e[1];function s(o,a){return{props:{componentData:o[0]}}}return r&&(t=Ye(r,s(e))),{c(){t&&ce(t.$$.fragment),n=Ae()},m(o,a){t&&le(t,o,a),I(o,n,a),i=!0},p(o,a){if(r!==(r=o[1])){if(t){$e();const l=t;N(l.$$.fragment,1,0,()=>{ue(l,1)}),Ee()}r?(t=Ye(r,s(o)),ce(t.$$.fragment),F(t.$$.fragment,1),le(t,n.parentNode,n)):t=null}else if(r){const l={};a&1&&(l.componentData=o[0]),t.$set(l)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&ue(t,o)}}}function kbe(e){let t,n,i;var r=e[1];function s(o,a){return{props:{componentData:o[0],$$slots:{default:[$be]},$$scope:{ctx:o}}}}return r&&(t=Ye(r,s(e))),{c(){t&&ce(t.$$.fragment),n=Ae()},m(o,a){t&&le(t,o,a),I(o,n,a),i=!0},p(o,a){if(r!==(r=o[1])){if(t){$e();const l=t;N(l.$$.fragment,1,0,()=>{ue(l,1)}),Ee()}r?(t=Ye(r,s(o)),ce(t.$$.fragment),F(t.$$.fragment,1),le(t,n.parentNode,n)):t=null}else if(r){const l={};a&1&&(l.componentData=o[0]),a&65&&(l.$$scope={dirty:a,ctx:o}),t.$set(l)}},i(o){i||(t&&F(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&L(n),t&&ue(t,o)}}}function _I(e){let t,n;return t=new o5({props:{componentData:e[3]}}),{c(){ce(t.$$.fragment)},m(i,r){le(t,i,r),n=!0},p(i,r){const s={};r&1&&(s.componentData=i[3]),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){ue(t,i)}}}function $be(e){let t,n,i=Re(e[0].contents),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{"componentData"in o&&n(0,i=o.componentData)},[i,s]}class o5 extends ge{constructor(t){super(),pe(this,t,Cbe,Ebe,he,{componentData:0})}}function Sbe(e){let t,n,i;const r=e[1].default,s=ft(r,e,e[0],null);return{c(){t=H("main"),n=H("div"),s&&s.c(),D(n,"class","mainContainer svelte-mqeomk"),D(t,"class","svelte-mqeomk")},m(o,a){I(o,t,a),V(t,n),s&&s.m(n,null),i=!0},p(o,[a]){s&&s.p&&(!i||a&1)&&ht(s,r,o,o[0],i?dt(r,o[0],a,null):pt(o[0]),null)},i(o){i||(F(s,o),i=!0)},o(o){N(s,o),i=!1},d(o){o&&L(t),s&&s.d(o)}}}function Abe(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class Tbe extends ge{constructor(t){super(),pe(this,t,Abe,Sbe,he,{})}}const ph=/^[a-z0-9]+(-[a-z0-9]+)*$/,Mm=(e,t,n,i="")=>{const r=e.split(":");if(e.slice(0,1)==="@"){if(r.length<2||r.length>3)return null;i=r.shift().slice(1)}if(r.length>3||!r.length)return null;if(r.length>1){const a=r.pop(),l=r.pop(),u={provider:r.length>0?r[0]:i,prefix:l,name:a};return t&&!Fm(u)?null:u}const s=r[0],o=s.split("-");if(o.length>1){const a={provider:i,prefix:o.shift(),name:o.join("-")};return t&&!Fm(a)?null:a}if(n&&i===""){const a={provider:i,prefix:"",name:s};return t&&!Fm(a,n)?null:a}return null},Fm=(e,t)=>e?!!((e.provider===""||e.provider.match(ph))&&(t&&e.prefix===""||e.prefix.match(ph))&&e.name.match(ph)):!1,wI=Object.freeze({left:0,top:0,width:16,height:16}),Dm=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Nm=Object.freeze({...wI,...Dm}),a5=Object.freeze({...Nm,body:"",hidden:!1});function Mbe(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const i=((e.rotate||0)+(t.rotate||0))%4;return i&&(n.rotate=i),n}function kI(e,t){const n=Mbe(e,t);for(const i in a5)i in Dm?i in e&&!(i in n)&&(n[i]=Dm[i]):i in t?n[i]=t[i]:i in e&&(n[i]=e[i]);return n}function Fbe(e,t){const n=e.icons,i=e.aliases||Object.create(null),r=Object.create(null);function s(o){if(n[o])return r[o]=[];if(!(o in r)){r[o]=null;const a=i[o]&&i[o].parent,l=a&&s(a);l&&(r[o]=[a].concat(l))}return r[o]}return(t||Object.keys(n).concat(Object.keys(i))).forEach(s),r}function Dbe(e,t,n){const i=e.icons,r=e.aliases||Object.create(null);let s={};function o(a){s=kI(i[a]||r[a],s)}return o(t),n.forEach(o),kI(e,s)}function $I(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(r=>{t(r,null),n.push(r)});const i=Fbe(e);for(const r in i){const s=i[r];s&&(t(r,Dbe(e,r,s)),n.push(r))}return n}const Nbe={provider:"",aliases:{},not_found:{},...wI};function l5(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function EI(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!l5(e,Nbe))return null;const n=t.icons;for(const r in n){const s=n[r];if(!r.match(ph)||typeof s.body!="string"||!l5(s,a5))return null}const i=t.aliases||Object.create(null);for(const r in i){const s=i[r],o=s.parent;if(!r.match(ph)||typeof o!="string"||!n[o]&&!i[o]||!l5(s,a5))return null}return t}const CI=Object.create(null);function Obe(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function Ol(e,t){const n=CI[e]||(CI[e]=Object.create(null));return n[t]||(n[t]=Obe(e,t))}function u5(e,t){return EI(t)?$I(t,(n,i)=>{i?e.icons[n]=i:e.missing.add(n)}):[]}function Rbe(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}let gh=!1;function SI(e){return typeof e=="boolean"&&(gh=e),gh}function Lbe(e){const t=typeof e=="string"?Mm(e,!0,gh):e;if(t){const n=Ol(t.provider,t.prefix),i=t.name;return n.icons[i]||(n.missing.has(i)?null:void 0)}}function Ibe(e,t){const n=Mm(e,!0,gh);if(!n)return!1;const i=Ol(n.provider,n.prefix);return Rbe(i,n.name,t)}function zbe(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),gh&&!t&&!e.prefix){let r=!1;return EI(e)&&(e.prefix="",$I(e,(s,o)=>{o&&Ibe(s,o)&&(r=!0)})),r}const n=e.prefix;if(!Fm({provider:t,prefix:n,name:"a"}))return!1;const i=Ol(t,n);return!!u5(i,e)}const AI=Object.freeze({width:null,height:null}),TI=Object.freeze({...AI,...Dm}),Pbe=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Bbe=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function MI(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const i=e.split(Pbe);if(i===null||!i.length)return e;const r=[];let s=i.shift(),o=Bbe.test(s);for(;;){if(o){const a=parseFloat(s);isNaN(a)?r.push(s):r.push(Math.ceil(a*t*n)/n)}else r.push(s);if(s=i.shift(),s===void 0)return r.join("");o=!o}}function jbe(e,t="defs"){let n="";const i=e.indexOf("<"+t);for(;i>=0;){const r=e.indexOf(">",i),s=e.indexOf("",s);if(o===-1)break;n+=e.slice(r+1,s).trim(),e=e.slice(0,i).trim()+e.slice(o+1)}return{defs:n,content:e}}function Ube(e,t){return e?""+e+""+t:t}function qbe(e,t,n){const i=jbe(e);return Ube(i.defs,t+i.content+n)}const Wbe=e=>e==="unset"||e==="undefined"||e==="none";function Hbe(e,t){const n={...Nm,...e},i={...TI,...t},r={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,i].forEach(g=>{const m=[],y=g.hFlip,b=g.vFlip;let v=g.rotate;y?b?v+=2:(m.push("translate("+(r.width+r.left).toString()+" "+(0-r.top).toString()+")"),m.push("scale(-1 1)"),r.top=r.left=0):b&&(m.push("translate("+(0-r.left).toString()+" "+(r.height+r.top).toString()+")"),m.push("scale(1 -1)"),r.top=r.left=0);let x;switch(v<0&&(v-=Math.floor(v/4)*4),v=v%4,v){case 1:x=r.height/2+r.top,m.unshift("rotate(90 "+x.toString()+" "+x.toString()+")");break;case 2:m.unshift("rotate(180 "+(r.width/2+r.left).toString()+" "+(r.height/2+r.top).toString()+")");break;case 3:x=r.width/2+r.left,m.unshift("rotate(-90 "+x.toString()+" "+x.toString()+")");break}v%2===1&&(r.left!==r.top&&(x=r.left,r.left=r.top,r.top=x),r.width!==r.height&&(x=r.width,r.width=r.height,r.height=x)),m.length&&(s=qbe(s,'',""))});const o=i.width,a=i.height,l=r.width,u=r.height;let c,f;o===null?(f=a===null?"1em":a==="auto"?u:a,c=MI(f,l/u)):(c=o==="auto"?l:o,f=a===null?MI(c,u/l):a==="auto"?u:a);const d={},h=(g,m)=>{Wbe(m)||(d[g]=m.toString())};h("width",c),h("height",f);const p=[r.left,r.top,l,u];return d.viewBox=p.join(" "),{attributes:d,viewBox:p,body:s}}const Gbe=/\sid="(\S+)"/g,Vbe="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Xbe=0;function Ybe(e,t=Vbe){const n=[];let i;for(;i=Gbe.exec(e);)n.push(i[1]);if(!n.length)return e;const r="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(s=>{const o=typeof t=="function"?t(s):t+(Xbe++).toString(),a=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+o+r+"$3")}),e=e.replace(new RegExp(r,"g"),""),e}const c5=Object.create(null);function Zbe(e,t){c5[e]=t}function f5(e){return c5[e]||c5[""]}function d5(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const h5=Object.create(null),mh=["https://api.simplesvg.com","https://api.unisvg.com"],Om=[];for(;mh.length>0;)mh.length===1||Math.random()>.5?Om.push(mh.shift()):Om.push(mh.pop());h5[""]=d5({resources:["https://api.iconify.design"].concat(Om)});function Kbe(e,t){const n=d5(t);return n===null?!1:(h5[e]=n,!0)}function p5(e){return h5[e]}let FI=(()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}})();function Jbe(e,t){const n=p5(e);if(!n)return 0;let i;if(!n.maxURL)i=0;else{let r=0;n.resources.forEach(o=>{r=Math.max(r,o.length)});const s=t+".json?icons=";i=n.maxURL-r-n.path.length-s.length}return i}function Qbe(e){return e===404}const e3e=(e,t,n)=>{const i=[],r=Jbe(e,t),s="icons";let o={type:s,provider:e,prefix:t,icons:[]},a=0;return n.forEach((l,u)=>{a+=l.length+1,a>=r&&u>0&&(i.push(o),o={type:s,provider:e,prefix:t,icons:[]},a=l.length),o.icons.push(l)}),i.push(o),i};function t3e(e){if(typeof e=="string"){const t=p5(e);if(t)return t.path}return"/"}const n3e={prepare:e3e,send:(e,t,n)=>{if(!FI){n("abort",424);return}let i=t3e(t.provider);switch(t.type){case"icons":{const s=t.prefix,a=t.icons.join(","),l=new URLSearchParams({icons:a});i+=s+".json?"+l.toString();break}case"custom":{const s=t.uri;i+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let r=503;FI(e+i).then(s=>{const o=s.status;if(o!==200){setTimeout(()=>{n(Qbe(o)?"abort":"next",o)});return}return r=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",r)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",r)})}};function i3e(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((r,s)=>r.provider!==s.provider?r.provider.localeCompare(s.provider):r.prefix!==s.prefix?r.prefix.localeCompare(s.prefix):r.name.localeCompare(s.name));let i={provider:"",prefix:"",name:""};return e.forEach(r=>{if(i.name===r.name&&i.prefix===r.prefix&&i.provider===r.provider)return;i=r;const s=r.provider,o=r.prefix,a=r.name,l=n[s]||(n[s]=Object.create(null)),u=l[o]||(l[o]=Ol(s,o));let c;a in u.icons?c=t.loaded:o===""||u.missing.has(a)?c=t.missing:c=t.pending;const f={provider:s,prefix:o,name:a};c.push(f)}),t}function DI(e,t){e.forEach(n=>{const i=n.loaderCallbacks;i&&(n.loaderCallbacks=i.filter(r=>r.id!==t))})}function r3e(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const i=e.provider,r=e.prefix;t.forEach(s=>{const o=s.icons,a=o.pending.length;o.pending=o.pending.filter(l=>{if(l.prefix!==r)return!0;const u=l.name;if(e.icons[u])o.loaded.push({provider:i,prefix:r,name:u});else if(e.missing.has(u))o.missing.push({provider:i,prefix:r,name:u});else return n=!0,!0;return!1}),o.pending.length!==a&&(n||DI([e],s.id),s.callback(o.loaded.slice(0),o.missing.slice(0),o.pending.slice(0),s.abort))})}))}let s3e=0;function o3e(e,t,n){const i=s3e++,r=DI.bind(null,n,i);if(!t.pending.length)return r;const s={id:i,icons:t,callback:e,abort:r};return n.forEach(o=>{(o.loaderCallbacks||(o.loaderCallbacks=[])).push(s)}),r}function a3e(e,t=!0,n=!1){const i=[];return e.forEach(r=>{const s=typeof r=="string"?Mm(r,t,n):r;s&&i.push(s)}),i}var l3e={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function u3e(e,t,n,i){const r=e.resources.length,s=e.random?Math.floor(Math.random()*r):e.index;let o;if(e.random){let k=e.resources.slice(0);for(o=[];k.length>1;){const w=Math.floor(Math.random()*k.length);o.push(k[w]),k=k.slice(0,w).concat(k.slice(w+1))}o=o.concat(k)}else o=e.resources.slice(s).concat(e.resources.slice(0,s));const a=Date.now();let l="pending",u=0,c,f=null,d=[],h=[];typeof i=="function"&&h.push(i);function p(){f&&(clearTimeout(f),f=null)}function g(){l==="pending"&&(l="aborted"),p(),d.forEach(k=>{k.status==="pending"&&(k.status="aborted")}),d=[]}function m(k,w){w&&(h=[]),typeof k=="function"&&h.push(k)}function y(){return{startTime:a,payload:t,status:l,queriesSent:u,queriesPending:d.length,subscribe:m,abort:g}}function b(){l="failed",h.forEach(k=>{k(void 0,c)})}function v(){d.forEach(k=>{k.status==="pending"&&(k.status="aborted")}),d=[]}function x(k,w,$){const S=w!=="success";switch(d=d.filter(E=>E!==k),l){case"pending":break;case"failed":if(S||!e.dataAfterTimeout)return;break;default:return}if(w==="abort"){c=$,b();return}if(S){c=$,d.length||(o.length?_():b());return}if(p(),v(),!e.random){const E=e.resources.indexOf(k.resource);E!==-1&&E!==e.index&&(e.index=E)}l="completed",h.forEach(E=>{E($)})}function _(){if(l!=="pending")return;p();const k=o.shift();if(k===void 0){if(d.length){f=setTimeout(()=>{p(),l==="pending"&&(v(),b())},e.timeout);return}b();return}const w={status:"pending",resource:k,callback:($,S)=>{x(w,$,S)}};d.push(w),u++,f=setTimeout(_,e.rotate),n(k,t,w.callback)}return setTimeout(_),y}function NI(e){const t={...l3e,...e};let n=[];function i(){n=n.filter(a=>a().status==="pending")}function r(a,l,u){const c=u3e(t,a,l,(f,d)=>{i(),u&&u(f,d)});return n.push(c),c}function s(a){return n.find(l=>a(l))||null}return{query:r,find:s,setIndex:a=>{t.index=a},getIndex:()=>t.index,cleanup:i}}function OI(){}const g5=Object.create(null);function c3e(e){if(!g5[e]){const t=p5(e);if(!t)return;const n=NI(t),i={config:t,redundancy:n};g5[e]=i}return g5[e]}function f3e(e,t,n){let i,r;if(typeof e=="string"){const s=f5(e);if(!s)return n(void 0,424),OI;r=s.send;const o=c3e(e);o&&(i=o.redundancy)}else{const s=d5(e);if(s){i=NI(s);const o=e.resources?e.resources[0]:"",a=f5(o);a&&(r=a.send)}}return!i||!r?(n(void 0,424),OI):i.query(t,r,n)().abort}const RI="iconify2",yh="iconify",LI=yh+"-count",II=yh+"-version",zI=36e5,d3e=168,h3e=50;function m5(e,t){try{return e.getItem(t)}catch{}}function y5(e,t,n){try{return e.setItem(t,n),!0}catch{}}function PI(e,t){try{e.removeItem(t)}catch{}}function b5(e,t){return y5(e,LI,t.toString())}function v5(e){return parseInt(m5(e,LI))||0}const Rm={local:!0,session:!0},BI={local:new Set,session:new Set};let x5=!1;function p3e(e){x5=e}let Lm=typeof window>"u"?{}:window;function jI(e){const t=e+"Storage";try{if(Lm&&Lm[t]&&typeof Lm[t].length=="number")return Lm[t]}catch{}Rm[e]=!1}function UI(e,t){const n=jI(e);if(!n)return;const i=m5(n,II);if(i!==RI){if(i){const a=v5(n);for(let l=0;l{const l=yh+a.toString(),u=m5(n,l);if(typeof u=="string"){try{const c=JSON.parse(u);if(typeof c=="object"&&typeof c.cached=="number"&&c.cached>r&&typeof c.provider=="string"&&typeof c.data=="object"&&typeof c.data.prefix=="string"&&t(c,a))return!0}catch{}PI(n,l)}};let o=v5(n);for(let a=o-1;a>=0;a--)s(a)||(a===o-1?(o--,b5(n,o)):BI[e].add(a))}function qI(){if(!x5){p3e(!0);for(const e in Rm)UI(e,t=>{const n=t.data,i=t.provider,r=n.prefix,s=Ol(i,r);if(!u5(s,n).length)return!1;const o=n.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,o):o,!0})}}function g3e(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const i in Rm)UI(i,r=>{const s=r.data;return r.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function m3e(e,t){x5||qI();function n(i){let r;if(!Rm[i]||!(r=jI(i)))return;const s=BI[i];let o;if(s.size)s.delete(o=Array.from(s).shift());else if(o=v5(r),o>=h3e||!b5(r,o+1))return;const a={cached:Math.floor(Date.now()/zI),provider:e.provider,data:t};return y5(r,yh+o.toString(),JSON.stringify(a))}t.lastModified&&!g3e(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function WI(){}function y3e(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,r3e(e)}))}function b3e(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:i}=e,r=e.iconsToLoad;delete e.iconsToLoad;let s;if(!r||!(s=f5(n)))return;s.prepare(n,i,r).forEach(a=>{f3e(n,a,l=>{if(typeof l!="object")a.icons.forEach(u=>{e.missing.add(u)});else try{const u=u5(e,l);if(!u.length)return;const c=e.pendingIcons;c&&u.forEach(f=>{c.delete(f)}),m3e(e,l)}catch(u){console.error(u)}y3e(e)})})}))}const v3e=(e,t)=>{const n=a3e(e,!0,SI()),i=i3e(n);if(!i.pending.length){let l=!0;return t&&setTimeout(()=>{l&&t(i.loaded,i.missing,i.pending,WI)}),()=>{l=!1}}const r=Object.create(null),s=[];let o,a;return i.pending.forEach(l=>{const{provider:u,prefix:c}=l;if(c===a&&u===o)return;o=u,a=c,s.push(Ol(u,c));const f=r[u]||(r[u]=Object.create(null));f[c]||(f[c]=[])}),i.pending.forEach(l=>{const{provider:u,prefix:c,name:f}=l,d=Ol(u,c),h=d.pendingIcons||(d.pendingIcons=new Set);h.has(f)||(h.add(f),r[u][c].push(f))}),s.forEach(l=>{const{provider:u,prefix:c}=l;r[u][c].length&&b3e(l,r[u][c])}),t?o3e(t,i,s):WI};function x3e(e,t){const n={...e};for(const i in t){const r=t[i],s=typeof r;i in AI?(r===null||r&&(s==="string"||s==="number"))&&(n[i]=r):s===typeof n[i]&&(n[i]=i==="rotate"?r%4:r)}return n}const _3e=/[\s,]+/;function w3e(e,t){t.split(_3e).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function k3e(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function i(r){for(;r<0;)r+=4;return r%4}if(n===""){const r=parseInt(e);return isNaN(r)?0:i(r)}else if(n!==e){let r=0;switch(n){case"%":r=25;break;case"deg":r=90}if(r){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/r,s%1===0?i(s):0)}}return t}function $3e(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in t)n+=" "+i+'="'+t[i]+'"';return'"+e+""}function E3e(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(//g,"%3E").replace(/\s+/g," ")}function C3e(e){return"data:image/svg+xml,"+E3e(e)}function S3e(e){return'url("'+C3e(e)+'")'}const HI={...TI,inline:!1},A3e={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},T3e={display:"inline-block"},_5={"background-color":"currentColor"},GI={"background-color":"transparent"},VI={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},XI={"-webkit-mask":_5,mask:_5,background:GI};for(const e in XI){const t=XI[e];for(const n in VI)t[e+"-"+n]=VI[n]}function M3e(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}function F3e(e,t){const n=x3e(HI,t),i=t.mode||"svg",r=i==="svg"?{...A3e}:{};e.body.indexOf("xlink:")===-1&&delete r["xmlns:xlink"];let s=typeof t.style=="string"?t.style:"";for(let y in t){const b=t[y];if(b!==void 0)switch(y){case"icon":case"style":case"onLoad":case"mode":break;case"inline":case"hFlip":case"vFlip":n[y]=b===!0||b==="true"||b===1;break;case"flip":typeof b=="string"&&w3e(n,b);break;case"color":s=s+(s.length>0&&s.trim().slice(-1)!==";"?";":"")+"color: "+b+"; ";break;case"rotate":typeof b=="string"?n[y]=k3e(b):typeof b=="number"&&(n[y]=b);break;case"ariaHidden":case"aria-hidden":b!==!0&&b!=="true"&&delete r["aria-hidden"];break;default:if(y.slice(0,3)==="on:")break;HI[y]===void 0&&(r[y]=b)}}const o=Hbe(e,n),a=o.attributes;if(n.inline&&(s="vertical-align: -0.125em; "+s),i==="svg"){Object.assign(r,a),s!==""&&(r.style=s);let y=0,b=t.id;return typeof b=="string"&&(b=b.replace(/-/g,"_")),{svg:!0,attributes:r,body:Ybe(o.body,b?()=>b+"ID"+y++:"iconifySvelte")}}const{body:l,width:u,height:c}=e,f=i==="mask"||(i==="bg"?!1:l.indexOf("currentColor")!==-1),d=$3e(l,{...a,width:u+"",height:c+""}),p={"--svg":S3e(d)},g=y=>{const b=a[y];b&&(p[y]=M3e(b))};g("width"),g("height"),Object.assign(p,T3e,f?_5:GI);let m="";for(const y in p)m+=y+": "+p[y]+";";return r.style=m+s,{svg:!1,attributes:r}}if(SI(!0),Zbe("",n3e),typeof document<"u"&&typeof window<"u"){qI();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(i=>{try{(typeof i!="object"||i===null||i instanceof Array||typeof i.icons!="object"||typeof i.prefix!="string"||!zbe(i))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const i="IconifyProviders["+n+"] is invalid.";try{const r=t[n];if(typeof r!="object"||!r||r.resources===void 0)continue;Kbe(n,r)||console.error(i)}catch{console.error(i)}}}}function D3e(e,t,n,i,r){function s(){t.loading&&(t.loading.abort(),t.loading=null)}if(typeof e=="object"&&e!==null&&typeof e.body=="string")return t.name="",s(),{data:{...Nm,...e}};let o;if(typeof e!="string"||(o=Mm(e,!1,!0))===null)return s(),null;const a=Lbe(o);if(!a)return n&&(!t.loading||t.loading.name!==e)&&(s(),t.name="",t.loading={name:e,abort:v3e([o],i)}),null;s(),t.name!==e&&(t.name=e,r&&!t.destroyed&&r(e));const l=["iconify"];return o.prefix!==""&&l.push("iconify--"+o.prefix),o.provider!==""&&l.push("iconify--"+o.provider),{data:a,classes:l}}function N3e(e,t){return e?F3e({...Nm,...e},t):null}function YI(e){let t;function n(s,o){return s[0].svg?R3e:O3e}let i=n(e),r=i(e);return{c(){r.c(),t=Ae()},m(s,o){r.m(s,o),I(s,t,o)},p(s,o){i===(i=n(s))&&r?r.p(s,o):(r.d(1),r=i(s),r&&(r.c(),r.m(t.parentNode,t)))},d(s){s&&L(t),r.d(s)}}}function O3e(e){let t,n=[e[0].attributes],i={};for(let r=0;r{typeof t.onLoad=="function"&&t.onLoad(u),Bm()("load",{icon:u})};function l(){n(3,s++,s)}return Mc(()=>{n(2,r=!0)}),M5(()=>{n(1,i.destroyed=!0,i),i.loading&&(i.loading.abort(),n(1,i.loading=null,i))}),e.$$set=u=>{n(6,t=Ge(Ge({},t),Pm(u)))},e.$$.update=()=>{{const u=D3e(t.icon,i,r,l,a);n(0,o=u?N3e(u.data,t):null),o&&u.classes&&n(0,o.attributes.class=(typeof t.class=="string"?t.class+" ":"")+u.classes.join(" "),o)}},t=Pm(t),[o,i,r,s]}class z3e extends ge{constructor(t){super(),pe(this,t,I3e,L3e,he,{})}}function ZI(e){let t,n,i,r,s,o,a,l,u;return i=new z3e({props:{icon:"mdi:close"}}),o=new o5({props:{componentData:e[1]}}),{c(){t=H("div"),n=H("span"),ce(i.$$.fragment),r=je(),s=H("div"),ce(o.$$.fragment),D(n,"class","cancelButton svelte-1hhf5ym"),D(s,"class","modalContainer"),D(t,"class","modal svelte-1hhf5ym"),D(t,"data-component","modal")},m(c,f){I(c,t,f),V(t,n),le(i,n,null),V(t,r),V(t,s),le(o,s,null),a=!0,l||(u=[Il(s,"click",B3e),Il(t,"click",e[3])],l=!0)},p(c,f){const d={};f&2&&(d.componentData=c[1]),o.$set(d)},i(c){a||(F(i.$$.fragment,c),F(o.$$.fragment,c),a=!0)},o(c){N(i.$$.fragment,c),N(o.$$.fragment,c),a=!1},d(c){c&&L(t),ue(i),ue(o),l=!1,Ll(u)}}}function P3e(e){let t,n,i,r,s=e[0]&&e[1]&&ZI(e);return{c(){s&&s.c(),t=Ae()},m(o,a){s&&s.m(o,a),I(o,t,a),n=!0,i||(r=Il(window,"keyup",e[2]),i=!0)},p(o,[a]){o[0]&&o[1]?s?(s.p(o,a),a&3&&F(s,1)):(s=ZI(o),s.c(),F(s,1),s.m(t.parentNode,t)):s&&($e(),N(s,1,1,()=>{s=null}),Ee())},i(o){n||(F(s),n=!0)},o(o){N(s),n=!1},d(o){o&&L(t),s&&s.d(o),i=!1,r()}}}const B3e=e=>{e==null||e.stopImmediatePropagation()};function j3e(e,t,n){let i;_h(e,Fc,a=>n(1,i=a));let{componentData:r}=t;function s(a){a.code==="Escape"&&Fc.set(void 0)}function o(a){a.stopImmediatePropagation(),Fc.set(void 0)}return e.$$set=a=>{"componentData"in a&&n(0,r=a.componentData)},[r,i,s,o]}class U3e extends ge{constructor(t){super(),pe(this,t,j3e,P3e,he,{componentData:0})}}function KI(e,t,n){const i=e.slice();return i[2]=t[n][0],i[3]=t[n][1],i}function JI(e,t,n){const i=e.slice();return i[6]=t[n],i}function QI(e){let t,n=e[2]+"",i;return{c(){t=H("span"),i=Oe(n),D(t,"class","pageId svelte-1kdpgko")},m(r,s){I(r,t,s),V(t,i)},p(r,s){s&1&&n!==(n=r[2]+"")&&at(i,n)},d(r){r&&L(t)}}}function ez(e){let t,n,i=e[6]+"",r,s,o,a;function l(){return e[1](e[6])}return{c(){t=H("li"),n=H("button"),r=Oe(i),s=je(),D(n,"class","textButton"),D(t,"class","sectionLink svelte-1kdpgko")},m(u,c){I(u,t,c),V(t,n),V(n,r),V(t,s),o||(a=Il(n,"click",l),o=!0)},p(u,c){e=u,c&1&&i!==(i=e[6]+"")&&at(r,i)},d(u){u&&L(t),o=!1,a()}}}function tz(e){let t,n,i,r,s=e[2]&&QI(e),o=Re(e[3]||[]),a=[];for(let l=0;lW3e(s);return e.$$set=s=>{"pageHierarchy"in s&&n(0,i=s.pageHierarchy)},[i,r]}class G3e extends ge{constructor(t){super(),pe(this,t,H3e,q3e,he,{pageHierarchy:0})}}const{Boolean:V3e}=dz;function nz(e,t,n){const i=e.slice();return i[5]=t[n],i}function X3e(e){var i;let t,n;return t=new G3e({props:{pageHierarchy:I5((i=e[0])==null?void 0:i.components)}}),{c(){ce(t.$$.fragment)},m(r,s){le(t,r,s),n=!0},p(r,s){var a;const o={};s&1&&(o.pageHierarchy=I5((a=r[0])==null?void 0:a.components)),t.$set(o)},i(r){n||(F(t.$$.fragment,r),n=!0)},o(r){N(t.$$.fragment,r),n=!1},d(r){ue(t,r)}}}function iz(e){let t,n;return t=new o5({props:{componentData:e[5]}}),{c(){ce(t.$$.fragment)},m(i,r){le(t,i,r),n=!0},p(i,r){const s={};r&1&&(s.componentData=i[5]),t.$set(s)},i(i){n||(F(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){ue(t,i)}}}function Y3e(e){var o;let t,n,i=Re(((o=e[0])==null?void 0:o.components)||[]),r=[];for(let a=0;aN(r[a],1,1,()=>{r[a]=null});return{c(){for(let a=0;a{l=null}),Ee())},i(u){a||(F(n.$$.fragment,u),F(r.$$.fragment,u),F(l),a=!0)},o(u){N(n.$$.fragment,u),N(r.$$.fragment,u),N(l),a=!1},d(u){u&&(L(t),L(s),L(o)),ue(n),ue(r),l&&l.d(u)}}}function K3e(e,t,n){let i,r;_h(e,ua,l=>n(0,i=l)),_h(e,Fc,l=>n(1,r=l));let{cardDataId:s}=t;Ez(s);let a=!!new URLSearchParams(window==null?void 0:window.location.search).get("embed");return e.$$set=l=>{"cardDataId"in l&&n(3,s=l.cardDataId)},[i,r,a,s]}class J3e extends ge{constructor(t){super(),pe(this,t,K3e,Z3e,he,{cardDataId:3})}}let sz;try{const e=window.mfCardDataId,t=window.mfContainerId,n=(az=document.querySelector(`[data-container="${t}"]`))==null?void 0:az.querySelector(".card_app");sz=new J3e({target:n??document.querySelector(".card_app"),props:{cardDataId:e}})}catch(e){throw new Error(e)}return sz}); diff --git a/metaflow/plugins/cards/card_modules/test_cards.py b/metaflow/plugins/cards/card_modules/test_cards.py index 7b485b2f52..c15230b232 100644 --- a/metaflow/plugins/cards/card_modules/test_cards.py +++ b/metaflow/plugins/cards/card_modules/test_cards.py @@ -38,7 +38,7 @@ class TestEditableCard(MetaflowCard): ALLOW_USER_COMPONENTS = True - def __init__(self, options={}, components=[], graph=None): + def __init__(self, components=[], **kwargs): self._components = components def render(self, task): @@ -52,7 +52,7 @@ class TestEditableCard2(MetaflowCard): ALLOW_USER_COMPONENTS = True - def __init__(self, options={}, components=[], graph=None): + def __init__(self, components=[], **kwargs): self._components = components def render(self, task): @@ -64,7 +64,7 @@ class TestNonEditableCard(MetaflowCard): seperator = "$&#!!@*" - def __init__(self, options={}, components=[], graph=None): + def __init__(self, components=[], **kwargs): self._components = components def render(self, task): @@ -193,7 +193,7 @@ class TestRefreshComponentCard(MetaflowCard): type = "test_component_refresh_card" - def __init__(self, options={}, components=[], graph=None): + def __init__(self, components=[], **kwargs): self._components = components def render(self, task) -> str: diff --git a/metaflow/plugins/cards/component_serializer.py b/metaflow/plugins/cards/component_serializer.py index 66f0b62ba1..13dc59949d 100644 --- a/metaflow/plugins/cards/component_serializer.py +++ b/metaflow/plugins/cards/component_serializer.py @@ -1,8 +1,8 @@ from .card_modules import MetaflowCardComponent +from .card_modules.card import create_component_id from .card_modules.basic import ErrorComponent, SectionComponent from .card_modules.components import ( UserComponent, - create_component_id, StubComponent, ) from .exception import ComponentOverwriteNotSupportedException diff --git a/metaflow/plugins/cards/ui/src/components/card-component-renderer.svelte b/metaflow/plugins/cards/ui/src/components/card-component-renderer.svelte index aabb4365a0..dbeb3026f8 100644 --- a/metaflow/plugins/cards/ui/src/components/card-component-renderer.svelte +++ b/metaflow/plugins/cards/ui/src/components/card-component-renderer.svelte @@ -15,6 +15,7 @@ import Text from "./text.svelte"; import Title from "./title.svelte"; import VegaChart from "./vega-chart.svelte"; + import PythonCode from "./python-code.svelte"; export let componentData: types.CardComponent; @@ -33,6 +34,7 @@ text: Text, title: Title, vegaChart: VegaChart, + pythonCode: PythonCode, }; let component = typesMap?.[componentData.type]; diff --git a/metaflow/plugins/cards/ui/src/components/python-code.svelte b/metaflow/plugins/cards/ui/src/components/python-code.svelte new file mode 100644 index 0000000000..ec3f5265c6 --- /dev/null +++ b/metaflow/plugins/cards/ui/src/components/python-code.svelte @@ -0,0 +1,19 @@ + + + + + + +
{componentData.data}
+  
+
diff --git a/metaflow/plugins/cards/ui/src/components/table-data-renderer.svelte b/metaflow/plugins/cards/ui/src/components/table-data-renderer.svelte index bca6525ec6..d1df599623 100644 --- a/metaflow/plugins/cards/ui/src/components/table-data-renderer.svelte +++ b/metaflow/plugins/cards/ui/src/components/table-data-renderer.svelte @@ -11,6 +11,7 @@ import Markdown from "./markdown.svelte"; import Text from "./text.svelte"; import ProgressBar from "./progress-bar.svelte"; + import PythonCode from "./python-code.svelte"; export let componentData: types.TableDataCell; let component: ComponentType; @@ -25,6 +26,7 @@ progressBar: ProgressBar, text: Text, vegaChart: VegaChart, + pythonCode: PythonCode, }; const type = (componentData as types.CardComponent)?.type; diff --git a/metaflow/plugins/cards/ui/src/types.ts b/metaflow/plugins/cards/ui/src/types.ts index e0e139ba61..94edfd3c09 100644 --- a/metaflow/plugins/cards/ui/src/types.ts +++ b/metaflow/plugins/cards/ui/src/types.ts @@ -34,7 +34,8 @@ export type TableDataCell = | MarkdownComponent | ProgressBarComponent | TextComponent - | VegaChartComponent; + | VegaChartComponent + | PythonCodeComponent; export type TableColumns = string[]; export type TableData = TableDataCell[][]; @@ -179,6 +180,12 @@ export interface LogComponent { data: string; } +export interface PythonCodeComponent { + type: "pythonCode"; + id?: string; + data: string; +} + export interface MarkdownComponent { type: "markdown"; id?: string; @@ -207,4 +214,5 @@ export type CardComponent = | TableComponent | TextComponent | TitleComponent - | VegaChartComponent; + | VegaChartComponent + | PythonCodeComponent; diff --git a/test/core/metaflow_extensions/test_org/plugins/cards/simplecard/__init__.py b/test/core/metaflow_extensions/test_org/plugins/cards/simplecard/__init__.py index d94b0642a9..994dc80ab8 100644 --- a/test/core/metaflow_extensions/test_org/plugins/cards/simplecard/__init__.py +++ b/test/core/metaflow_extensions/test_org/plugins/cards/simplecard/__init__.py @@ -7,7 +7,7 @@ class TestNonEditableImportCard(MetaflowCard): ALLOW_USER_COMPONENTS = False - def __init__(self, options={}, components=[], graph=None): + def __init__(self, options={}, components=[], graph=None, flow=None, **kwargs): self._options, self._components, self._graph = options, components, graph def render(self, task):