@nocobase/plugin-data-visualization 0.21.0-alpha.11 → 0.21.0-alpha.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(ct,z){typeof exports=="object"&&typeof module!="undefined"?z(exports,require("@nocobase/client"),require("react/jsx-runtime"),require("react"),require("@ant-design/icons"),require("@formily/antd-v5"),require("@formily/core"),require("@formily/react"),require("antd"),require("lodash"),require("react-i18next"),require("dayjs"),require("@formily/shared"),require("ahooks"),require("@nocobase/utils/client"),require("@emotion/css")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","react/jsx-runtime","react","@ant-design/icons","@formily/antd-v5","@formily/core","@formily/react","antd","lodash","react-i18next","dayjs","@formily/shared","ahooks","@nocobase/utils/client","@emotion/css"],z):(ct=typeof globalThis!="undefined"?globalThis:ct||self,z(ct["@nocobase/plugin-data-visualization"]={},ct["@nocobase/client"],ct.jsxRuntime,ct.react,ct["@ant-design/icons"],ct["@formily/antd-v5"],ct["@formily/core"],ct["@formily/react"],ct.antd,ct.lodash,ct["react-i18next"],ct.dayjs,ct["@formily/shared"],ct.ahooks,ct["@nocobase/utils"],ct["@emotion/css"]))})(this,function(ct,z,Y,q,Nn,ae,wn,dt,wt,rn,Ey,Ve,Fo,Ei,My,Ga){"use strict";var TMt=Object.defineProperty,kMt=Object.defineProperties;var LMt=Object.getOwnPropertyDescriptors;var Sy=Object.getOwnPropertySymbols;var eB=Object.prototype.hasOwnProperty,nB=Object.prototype.propertyIsEnumerable;var CS=(ct,z)=>(z=Symbol[ct])?z:Symbol.for("Symbol."+ct),Ce=Math.pow,TS=(ct,z,Y)=>z in ct?TMt(ct,z,{enumerable:!0,configurable:!0,writable:!0,value:Y}):ct[z]=Y,tt=(ct,z)=>{for(var Y in z||(z={}))eB.call(z,Y)&&TS(ct,Y,z[Y]);if(Sy)for(var Y of Sy(z))nB.call(z,Y)&&TS(ct,Y,z[Y]);return ct},vt=(ct,z)=>kMt(ct,LMt(z));var rB=(ct,z)=>{var Y={};for(var q in ct)eB.call(ct,q)&&z.indexOf(q)<0&&(Y[q]=ct[q]);if(ct!=null&&Sy)for(var q of Sy(ct))z.indexOf(q)<0&&nB.call(ct,q)&&(Y[q]=ct[q]);return Y};var ni=(ct,z,Y)=>(TS(ct,typeof z!="symbol"?z+"":z,Y),Y);var Cr=(ct,z,Y)=>new Promise((q,Nn)=>{var ae=wt=>{try{dt(Y.next(wt))}catch(rn){Nn(rn)}},wn=wt=>{try{dt(Y.throw(wt))}catch(rn){Nn(rn)}},dt=wt=>wt.done?q(wt.value):Promise.resolve(wt.value).then(ae,wn);dt((Y=Y.apply(ct,z)).next())}),NMt=function(ct,z){this[0]=ct,this[1]=z};var iB=ct=>{var z=ct[CS("asyncIterator")],Y=!1,q,Nn={};return z==null?(z=ct[CS("iterator")](),q=ae=>Nn[ae]=wn=>z[ae](wn)):(z=z.call(ct),q=ae=>Nn[ae]=wn=>{if(Y){if(Y=!1,ae==="throw")throw wn;return wn}return Y=!0,{done:!1,value:new NMt(new Promise(dt=>{var wt=z[ae](wn);if(!(wt instanceof Object))throw TypeError("Object expected");dt(wt)}),1)}}),Nn[CS("iterator")]=()=>Nn,q("next"),"throw"in z?q("throw"):Nn.throw=ae=>{throw ae},"return"in z&&q("return"),Nn};function wB(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const kS="data-visualization";function At(t){return z.i18n.t(t,{ns:[kS,"client"]})}function se(){return Ey.useTranslation([kS,"client"],{nsMode:"fallback"})}const Py={datetime:[{label:At("YYYY"),value:"YYYY"},{label:At("MM"),value:"MM"},{label:At("DD"),value:"DD"},{label:At("YYYY-MM"),value:"YYYY-MM"},{label:At("YYYY-MM-DD"),value:"YYYY-MM-DD"},{label:At("YYYY-MM-DD hh:mm"),value:"YYYY-MM-DD hh:mm"},{label:At("YYYY-MM-DD hh:mm:ss"),value:"YYYY-MM-DD hh:mm:ss"}],date:[{label:At("YYYY"),value:"YYYY"},{label:At("MM"),value:"MM"},{label:At("DD"),value:"DD"},{label:At("YYYY-MM"),value:"YYYY-MM"},{label:At("YYYY-MM-DD"),value:"YYYY-MM-DD"}],time:[{label:At("hh:mm:ss"),value:"hh:mm:ss"},{label:At("hh:mm"),value:"hh:mm"},{label:At("hh"),value:"hh"}]},OB=q.createContext(null),Ay={didCatch:!1,error:null};let LS=class extends q.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Ay}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(e!==null){for(var n,r,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:o,reason:"imperative-api"}),this.setState(Ay)}}componentDidCatch(e,n){var r,i;(r=(i=this.props).onError)===null||r===void 0||r.call(i,e,n)}componentDidUpdate(e,n){const{didCatch:r}=this.state,{resetKeys:i}=this.props;if(r&&n.error!==null&&_B(e.resetKeys,i)){var o,a;(o=(a=this.props).onReset)===null||o===void 0||o.call(a,{next:i,prev:e.resetKeys,reason:"keys"}),this.setState(Ay)}}render(){const{children:e,fallbackRender:n,FallbackComponent:r,fallback:i}=this.props,{didCatch:o,error:a}=this.state;let s=e;if(o){const l={error:a,resetErrorBoundary:this.resetErrorBoundary};if(q.isValidElement(i))s=i;else if(typeof n=="function")s=n(l);else if(r)s=q.createElement(r,l);else throw a}return q.createElement(OB.Provider,{value:{didCatch:o,error:a,resetErrorBoundary:this.resetErrorBoundary}},s)}};function _B(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return t.length!==e.length||t.some((n,r)=>!Object.is(n,e[r]))}const NS=(t,e={})=>{const{collection:n,config:r}=t,{title:i,bordered:o}=r||{};return{type:"void","x-decorator":"ChartRendererProvider","x-decorator-props":t,"x-acl-action":`${n}:list`,"x-designer":"ChartRenderer.Designer","x-component":"CardItem","x-component-props":{size:"small",title:i,bordered:o},"x-initializer":"charts:addBlock",properties:{[Fo.uid()]:{type:"void","x-component":"ChartRenderer","x-component-props":e}}}},au=t=>{let e,n;return Array.isArray(t)?t.length===1?n=t[0]:t.length>1&&([e,n]=t):n=t,{target:e,name:n,alias:e?`${e}.${n}`:n}},dh=(t,e)=>{var o,a;const{target:n,name:r}=au(e);return n?(a=(o=t.find(s=>s.name===n))==null?void 0:o.targetFields)==null?void 0:a.find(s=>s.name===r):t.find(s=>s.name===r)},il=(t,e)=>{const n=s=>s.map(l=>{const c=dh(t,l.field);return vt(tt({},c),{key:l.alias||(c==null?void 0:c.key),label:l.alias||(c==null?void 0:c.label),value:l.alias||(c==null?void 0:c.value)})}),r=e.measures||[],i=e.dimensions||[];return[...new Map([...n(r),...n(i)].map(s=>[s.value,s])).values()]},SB=(t,e,n)=>{const r=(i,o)=>{var l;const a=(l=i.uiSchema)==null?void 0:l.enum;if(!a||!Array.isArray(a))return o;const s=a.find(c=>c.value===o);return dt.Schema.compile((s==null?void 0:s.label)||o,n)};return e.map(i=>{const o={};return Object.entries(i).forEach(([a,s])=>{const l=t.find(c=>c.value===a);if(!l){o[a]=s;return}switch(l.interface){case"select":case"radioGroup":o[a]=r(l,s);break;default:o[a]=s}}),o})},Cy=t=>{if(typeof t=="object"&&t!==null)if(Array.isArray(t)){const e=t.map(n=>Cy(n)).filter(Boolean);return e.length>0?e:null}else{const e={};for(const n in t){const r=Cy(t[n]);r!=null&&!(typeof r=="object"&&Object.keys(r).length===0)&&(e[n]=r)}return Object.keys(e).length>0?e:null}else if(typeof t=="string"&&t.startsWith("{{$nFilter.")&&t.endsWith("}}"))return null;return t},EB=(t,e)=>{const n=e.split(".");let r=rn.get(t,n.slice(0,-1).join("."));return Array.isArray(r)?r=r.map(i=>rn.get(i,n.slice(-1)[0])):r=rn.get(r,n.slice(-1)[0]),r},MB=t=>({boolean:"Checkbox",integer:"InputNumber",bigInt:"InputNumber",double:"InputNumber",decimal:"InputNumber",date:"DatePicker",string:"Input"})[t],PB=t=>({boolean:"boolean",integer:"integer",bigInt:"integer",double:"number",decimal:"number",date:"datetime",string:"input"})[t],ol=q.createContext({});ol.displayName="ChartDataContext";const AB=t=>{const[e,n]=q.useState({}),r=Ei.useMemoizedFn((o,{dataSource:a,collection:s,service:l,query:c})=>{n(u=>vt(tt({},u),{[o]:{dataSource:a,collection:s,service:l,query:c}}))}),i=Ei.useMemoizedFn(o=>{n(a=>vt(tt({},a),{[o]:void 0}))});return Y.jsx(ol.Provider,{value:{charts:e,addChart:r,removeChart:i},children:t.children})},Tr=q.createContext({});Tr.displayName="ChartFilterContext";const CB=t=>{const[e,n]=q.useState(!1),[r,i]=q.useState(!1),[o,a]=q.useState({}),[s,l]=q.useState({collapsed:!1,row:1}),[c,u]=q.useState(),f=Ei.useMemoizedFn((g,y)=>{a(m=>vt(tt({},m),{[g]:tt(tt({},m[g]||{}),y)}))}),d=Ei.useMemoizedFn(g=>{a(y=>{const m=tt({},y);return m[g]=void 0,m})}),h=Ei.useMemoizedFn(u),p=Ei.useMemoizedFn(i),v=({collapsed:g,row:y})=>{l(m=>({collapsed:g!==void 0?g:m.collapsed,row:y!==void 0?y:m.row}))};return q.useEffect(()=>n(!0),[]),Y.jsx(Tr.Provider,{value:{ready:e,enabled:r,setEnabled:p,fields:o,setField:f,removeField:d,collapse:s,setCollapse:v,form:c,setForm:h},children:t.children})},ri=q.createContext({});ri.displayName="ChartRendererContext";const IS=t=>{const{query:e,config:n,collection:r,transform:i,dataSource:o=z.DEFAULT_DATA_SOURCE_KEY}=t,{addChart:a}=q.useContext(ol),{ready:s,form:l,enabled:c}=q.useContext(Tr),{getFilter:u,hasFilter:f,appendFilter:d}=sl(),h=dt.useFieldSchema(),p=z.useAPIClient(),v=z.useRequest((g,y,m,b)=>new Promise((x,w)=>{var S;if(!(y&&((S=m==null?void 0:m.measures)!=null&&S.length))||c&&!l)return x(void 0);const O=u(),_=!b&&f({dataSource:g,collection:y,query:m},O)?d({dataSource:g,collection:y,query:m},O):m;p.request({url:"charts:query",method:"POST",data:vt(tt({uid:h==null?void 0:h["x-uid"],dataSource:g,collection:y},_),{filter:Cy(_.filter),dimensions:((m==null?void 0:m.dimensions)||[]).map(E=>{const M=tt({},E);if(E.format&&!E.alias){const{alias:P}=au(E.field);M.alias=P}return M}),measures:((m==null?void 0:m.measures)||[]).map(E=>{const M=tt({},E);if(E.aggregation&&!E.alias){const{alias:P}=au(E.field);M.alias=P}return M})})}).then(E=>{var M;x((M=E==null?void 0:E.data)==null?void 0:M.data)}).finally(()=>{!b&&(h!=null&&h["x-uid"])&&a(h==null?void 0:h["x-uid"],{dataSource:g,collection:y,service:v,query:m})}).catch(w)}),{defaultParams:[o,r,e],ready:s&&(!c||!!l)});return Y.jsx(z.CollectionManagerProvider,{dataSource:o,children:Y.jsx(z.MaybeCollectionProvider,{collection:r,children:Y.jsx(wt.ConfigProvider,{card:{style:{boxShadow:"none"}},children:Y.jsx(ri.Provider,{value:{dataSource:o,collection:r,config:n,transform:i,service:v,query:e},children:t.children})})})})};class TB{constructor(){ni(this,"charts",new Map)}setGroup(e,n){this.charts.set(e,n)}addGroup(e,n){if(this.charts.has(e))throw new Error(`[data-visualization] Chart group "${e}" already exists`);this.setGroup(e,n)}add(e,n){var r;this.charts.has(e)||this.setGroup(e,[]),(r=this.charts.get(e))==null||r.push(n)}getChartTypes(){const e=[];this.charts.forEach((r,i)=>{const o=r.map(a=>({key:`${i}.${a.name}`,label:At(a.title),value:`${i}.${a.name}`}));e.push({label:At(i),children:o})});const n=e.findIndex(r=>r.label===At("Built-in"));if(n>-1){const[r]=e.splice(n,1);e.unshift(r)}return e}getCharts(){const e={};return this.charts.forEach((n,r)=>{n.forEach(i=>{e[`${r}.${i.name}`]=i})}),e}getChart(e){return this.getCharts()[e]}}const jS=()=>z.usePlugin(_y).charts.getChartTypes(),kB=()=>{var e,n,r;return(r=(n=(e=jS()[0])==null?void 0:e.children)==null?void 0:n[0])==null?void 0:r.value},DS=()=>z.usePlugin(_y).charts.getCharts(),LB=t=>z.usePlugin(_y).charts.getChart(t),{Paragraph:NB,Text:IB}=wt.Typography,Ty=t=>{const{t:e}=se(),n=q.useContext(ri),{config:r,transform:i,dataSource:o,collection:a,service:s,data:l}=n,c=Ha(o,a),u=FS(l,o,a),f=(r==null?void 0:r.general)||{},d=(r==null?void 0:r.advanced)||{},h=z.useAPIClient(),p=LB(r==null?void 0:r.chartType),v=h.auth.getLocale(),g=XB(i,v),y=p==null?void 0:p.getProps({data:u,general:f,advanced:d,fieldProps:Object.keys(u[0]||{}).reduce((x,w)=>{if(!x[w]){const O=dh(c,w.split(".")),_=g[w];x[w]={label:(O==null?void 0:O.label)||w,transformer:_,interface:O==null?void 0:O.interface}}return x},{})}),m=dt.Schema.compile(y),b=p==null?void 0:p.Component;return p?!(u&&u.length)&&!s.loading?Y.jsx(wt.Empty,{image:wt.Empty.PRESENTED_IMAGE_SIMPLE,description:e("No data")}):Y.jsx(wt.Spin,{spinning:s.loading,children:Y.jsx(LS,{onError:x=>{console.error(x)},FallbackComponent:jB,children:Y.jsx(b,tt({},m))})}):Y.jsx(wt.Empty,{image:wt.Empty.PRESENTED_IMAGE_SIMPLE,description:e("Please configure chart")})};Ty.Designer=function(){const{t:e}=se(),{setVisible:n,setCurrent:r}=q.useContext(Mi),{removeChart:i}=q.useContext(ol),{service:o}=q.useContext(ri),a=dt.useField(),s=dt.useFieldSchema(),{insertAdjacent:l}=z.useDesignable(),c=z.useDataSource(),{name:u,title:f}=z.useCollection_deprecated();return Y.jsxs(z.GeneralSchemaDesigner,{disableInitializer:!0,title:f||u,children:[Y.jsx(z.SchemaSettingsItem,{title:"Configure",onClick:()=>Cr(this,null,function*(){r({schema:s,field:a,dataSource:c.key,collection:u,service:o,data:o.data}),n(!0)}),children:e("Configure")},"configure"),Y.jsx(z.SchemaSettingsItem,{title:"Duplicate",onClick:()=>l("afterEnd",z.gridRowColWrap(NS(s==null?void 0:s["x-decorator-props"]))),children:e("Duplicate")},"duplicate"),Y.jsx(z.SchemaSettingsDivider,{}),Y.jsx(z.SchemaSettingsRemove,{breakRemoveOn:{"x-component":"ChartV2Block"},confirm:{onOk:()=>{i(s["x-uid"])}}})]})};const jB=({error:t})=>{const{t:e}=se();return Y.jsx("div",{style:{backgroundColor:"white"},children:Y.jsx(wt.Result,{status:"error",title:e("Render Failed"),subTitle:e("Please check the configuration."),children:Y.jsx(NB,{copyable:!0,children:Y.jsx(IB,{type:"danger",style:{whiteSpace:"pre-line",textAlign:"center"},children:t.message})})})})},su=t=>{const{current:e}=q.useContext(Mi),{dataSource:n=t||z.DEFAULT_DATA_SOURCE_KEY,collection:r}=e||{},i=z.useDataSourceManager(),o=i.getDataSource(n),a=i.collectionFieldInterfaceManager;return{cm:o==null?void 0:o.collectionManager,fim:a,collection:r}},DB=t=>(t||[]).filter(n=>n.interface).map(n=>{var r;return vt(tt({},n),{key:n.name,label:((r=n.uiSchema)==null?void 0:r.title)||n.name,value:n.name})}),Ha=(t,e)=>{const{t:n}=Ey.useTranslation(),{cm:r,fim:i,collection:o}=su(t),a=r.getCollectionFields(e||o),s=DB(a);return q.useMemo(()=>s.map(l=>{var d,h,p,v;const c=(d=i.getFieldInterface(l.interface))==null?void 0:d.filterable,u=dt.Schema.compile(((h=l.uiSchema)==null?void 0:h.title)||l.name,{t:n});if(!(c&&(c!=null&&c.nested||(p=c==null?void 0:c.children)!=null&&p.length)))return vt(tt({},l),{label:u});let f=[];if(c!=null&&c.nested){const g=(r.getCollectionFields(l.target)||[]).filter(y=>y.interface).map(y=>{var m;return vt(tt({},y),{key:`${l.name}.${y.name}`,label:`${u} / ${dt.Schema.compile(((m=y.uiSchema)==null?void 0:m.title)||y.name,{t:n})}`,value:`${l.name}.${y.name}`})});f=[...f,...g]}if((v=c==null?void 0:c.children)!=null&&v.length){const g=c.children.map(y=>{var m;return vt(tt({},y),{key:`${l.name}.${y.name}`,label:`${u} / ${dt.Schema.compile(((m=y.schema)==null?void 0:m.title)||y.title||y.name,{t:n})}`,value:`${l.name}.${y.name}`})});f=[...f,...g]}return vt(tt({},l),{label:u,targetFields:f})}),[s])},$S=t=>e=>{const n=e.query("query").get("value")||{},r=il(t,n);e.dataSource=r},$B=t=>e=>{var o;const n=e.query(".field").get("value");if(!n){e.dataSource=[];return}let r=[];switch((o=dh(t,n))==null?void 0:o.interface){case"datetime":case"createdAt":case"updatedAt":r=Py.datetime;break;case"date":r=Py.date;break;case"time":r=Py.time;break;default:r=[]}e.dataSource=r},FB=()=>{const{t}=Ey.useTranslation(),e=z.useDataSourceManager(),{parseAction:n}=z.useACLRoleContext(),i=e.getAllCollections({filterCollection:o=>n(`${o.name}:list`)}).filter(({key:o,isDBInstance:a})=>o===z.DEFAULT_DATA_SOURCE_KEY||a).map(({key:o,displayName:a,collections:s})=>({value:o,label:a,children:s.map(l=>({value:l.name,label:l.title}))}));return q.useMemo(()=>dt.Schema.compile(i,{t}),[i])},RB=(t,e)=>n=>{const r=n.query("query").get("value")||{},{measures:i=[]}=r;if(!i.some(s=>s.aggregation)){n.componentProps.fieldNames={label:"title",value:"name",children:"children"},n.dataSource=t;return}const a=il(e,r);n.componentProps.fieldNames={},n.dataSource=a},BB=(t,e)=>n=>{const r=n.query("query").get("value")||{},{measures:i=[]}=r,o=i.some(u=>u.aggregation);let a=t;const s=[];o?(a=il(e,r),a.forEach(u=>{s.push(u.value)})):a.forEach(u=>{const f=u.children||[];f.length||s.push(u.value||u.name),f.forEach(d=>{s.push(`${u.name}.${d.name}`)})});const c=(n.value||[]).reduce((u,f)=>{const{alias:d}=au(f.field);return(!f.field||s.includes(d))&&u.push(f),u},[]);n.setValue(c)},FS=(t,e,n)=>{var c;const{t:r}=se(),{service:i,query:o}=q.useContext(ri),a=Ha(e,n),s=dt.useForm(),l=il(a,((c=s==null?void 0:s.values)==null?void 0:c.query)||o);return SB(l,(i==null?void 0:i.data)||t||[],{t:r})},zB=(t,e,n=2,r=[])=>{const{cm:i,fim:o,collection:a}=su(t),l=i.getCollectionFields(e||a).filter(d=>!r.includes(d.interface)),c=(d,h,p)=>{var x;if(!d.interface||d.isForeignKey)return;const v=o.getFieldInterface(d.interface);if(!(v!=null&&v.filterable))return;const{nested:g,children:y}=v.filterable,m=p?`${p}.${d.name}`:d.name,b=vt(tt({},d),{name:d.name,title:((x=d==null?void 0:d.uiSchema)==null?void 0:x.title)||d.name,schema:d==null?void 0:d.uiSchema,key:m});if(!(d.target&&h>n)){if(h>n)return b;if(y!=null&&y.length&&(b.children=y.map(w=>vt(tt({},w),{key:`${d.name}.${w.name}`}))),g){const w=i.getCollectionFields(d.target).filter(_=>!r.includes(_.interface)),O=u(w,h+1,d.name).filter(Boolean);b.children=b.children||[],b.children.push(...O)}return b}},u=(d,h,p)=>{const v=[];return d.forEach(g=>{const y=c(g,h,p);y&&v.push(y)}),v};return u(l,1)},YB=(t,e)=>{const{cm:n,fim:r,collection:i}=su(t);return q.useMemo(()=>{const o=n.getCollectionFields(e||i),a=(c,u)=>{var g,y;if(!c.interface||c.isForeignKey)return;const f=r.getFieldInterface(c.interface);if(!(f!=null&&f.filterable))return;const{nested:d,children:h,operators:p}=f.filterable,v={name:c.name,title:((g=c==null?void 0:c.uiSchema)==null?void 0:g.title)||c.name,schema:c==null?void 0:c.uiSchema,operators:((y=p==null?void 0:p.filter)==null?void 0:y.call(p,m=>!(m!=null&&m.visible)||m.visible(c)))||[],interface:c.interface};if(!(c.target&&u>2)){if(u>2)return v;if(h!=null&&h.length&&(v.children=h),d){const m=n.getCollectionFields(c.target),b=s(m,u+1).filter(Boolean);v.children=v.children||[],v.children.push(...b)}return v}},s=(c,u)=>{const f=[];return c.forEach(d=>{const h=a(d,u);h&&f.push(h)}),f};return s(o,1)},[e,n,r])},Ro={general:{Prefix:{schema:{"x-component":"Input"},fn:(t,e)=>e?`${e}${t}`:t},Suffix:{schema:{"x-component":"Input"},fn:(t,e)=>e?`${t}${e}`:t}},datetime:{Format:{schema:{"x-component":"AutoComplete","x-component-props":{allowClear:!0,style:{minWidth:200}},enum:[{label:"YYYY",value:"YYYY"},{label:"YYYY-MM",value:"YYYY-MM"},{label:"YYYY-MM-DD",value:"YYYY-MM-DD"},{label:"YYYY-MM-DD hh:mm",value:"YYYY-MM-DD hh:mm"},{label:"YYYY-MM-DD hh:mm:ss",value:"YYYY-MM-DD hh:mm:ss"}]},fn:(t,e)=>Ve(t).format(e)},YYYY:{label:"YYYY (Deprecated, use Format instead)",fn:t=>Ve(t).format("YYYY")},MM:{label:"MM (Deprecated, use Format instead)",fn:t=>Ve(t).format("MM")},DD:{label:"DD (Deprecated, use Format instead)",fn:t=>Ve(t).format("DD")},"YYYY-MM":{label:"YYYY-MM (Deprecated, use Format instead)",fn:t=>Ve(t).format("YYYY-MM")},"YYYY-MM-DD":{label:"YYYY-MM-DD (Deprecated, use Format instead)",fn:t=>Ve(t).format("YYYY-MM-DD")},"YYYY-MM-DD hh:mm":{label:"YYYY-MM-DD hh:mm (Deprecated, use Format instead)",fn:t=>Ve(t).format("YYYY-MM-DD hh:mm")},"YYYY-MM-DD hh:mm:ss":{label:"YYYY-MM-DD hh:mm:ss (Deprecated, use Format instead)",fn:t=>Ve(t).format("YYYY-MM-DD hh:mm:ss")}},date:{Format:{schema:{"x-component":"AutoComplete","x-component-props":{allowClear:!0,style:{minWidth:200}},enum:[{label:"YYYY",value:"YYYY"},{label:"MM",value:"MM"},{label:"DD",value:"DD"},{label:"YYYY-MM",value:"YYYY-MM"},{label:"YYYY-MM-DD",value:"YYYY-MM-DD"}]},fn:(t,e)=>Ve(t).format(e)},YYYY:{label:"YYYY (Deprecated, use Format instead)",fn:t=>Ve(t).format("YYYY")},MM:{label:"MM (Deprecated, use Format instead)",fn:t=>Ve(t).format("MM")},DD:{label:"DD (Deprecated, use Format instead)",fn:t=>Ve(t).format("DD")},"YYYY-MM":{label:"YYYY-MM (Deprecated, use Format instead)",fn:t=>Ve(t).format("YYYY-MM")},"YYYY-MM-DD":{label:"YYYY-MM-DD (Deprecated, use Format instead)",fn:t=>Ve(t).format("YYYY-MM-DD")}},time:{Format:{schema:{"x-component":"AutoComplete","x-component-props":{allowClear:!0,style:{minWidth:200}},enum:[{label:"hh:mm:ss",value:"hh:mm:ss"},{label:"hh:mm",value:"hh:mm"},{label:"hh",value:"hh"}]},fn:(t,e)=>Ve(t).format(e)},"hh:mm:ss":{label:"hh:mm:ss (Deprecated, use Format instead)",fn:t=>Ve(t).format("hh:mm:ss")},"hh:mm":{label:"hh:mm (Deprecated, use Format instead)",fn:t=>Ve(t).format("hh:mm")},hh:{label:"hh (Deprecated, use Format instead)",fn:t=>Ve(t).format("hh")}},number:{Precision:{schema:{"x-component":"Select",enum:[{label:"1",value:0},{label:"1.0",value:1},{label:"1.00",value:2},{label:"1.000",value:3}]},fn:(t,e)=>t.toFixed(e)},Separator:{schema:{"x-component":"Select",enum:[{label:"100,000.00",value:"en-US"},{label:"100.000,00",value:"de-DE"},{label:"100 000.00",value:"ru-RU"}]},fn:(t,e)=>{switch(e){case"en-US":return t.toLocaleString("en-US",{maximumFractionDigits:2});case"de-DE":return t.toLocaleString("de-DE",{maximumFractionDigits:2});case"ru-RU":return t.toLocaleString("ru-RU",{maximumFractionDigits:2});default:return t}}},Percent:t=>new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2}).format(t),Currency:{label:"Currency (Deprecated, use Separator & Prefix instead)",fn:(t,e="en-US")=>{const n={"zh-CN":"CNY","en-US":"USD","ja-JP":"JPY","ko-KR":"KRW","pt-BR":"BRL","ru-RU":"RUB","tr-TR":"TRY","es-ES":"EUR"}[e]||"USD";return new Intl.NumberFormat(e,{style:"currency",currency:n}).format(t)}},Exponential:t=>(+t).toExponential(),Abbreviation:(t,e="en-US")=>new Intl.NumberFormat(e,{notation:"compact"}).format(t)},string:{"Type conversion":{schema:{"x-component":"Select",enum:[{label:"Number",value:"Number"},{label:"Date",value:"Date"}]},fn:(t,e)=>{try{return new Function(`return ${e}(${t})`)()}catch(n){return console.log(n),t}}}}},WB=t=>function(){const n=dt.useField(),r=n.query("query").get("value")||{},i=il(t,r),o=Object.keys(Ro).filter(a=>a!=="general");return{onChange:a=>{n.value=a;const s=n.query(".type").take();a||s.setState({value:null,disabled:!0});const l=i.find(h=>h.value===a);s.dataSource=o.map(h=>({label:At(h),value:h}));const c={createdAt:"datetime",updatedAt:"datetime",double:"number",integer:"number",percent:"number"},u=l==null?void 0:l.interface,f=l==null?void 0:l.type,d=c[u]||c[f]||f;if(o.includes(d)){s.setState({value:d,disabled:!0});return}s.setState({value:null,disabled:!1})}}},GB=()=>{const t=dt.useField();return{options:Object.keys(Ro).filter(r=>r!=="general").map(r=>({label:At(r),value:r})),onChange:r=>{t.value=r,t.query(".format").take().setValue(null)}}},HB=()=>{const t=dt.useField();return{onChange:e=>{t.value=e,t.query(".argument").take().setValue(null)}}},UB=t=>{const e=t.query(".type").get("value");if(!e){t.dataSource=[];return}const n=Object.entries(tt(tt({},Ro.general),Ro[e]||{})).map(([r,i])=>{const o=typeof i=="function"?r:i.label||r;return{label:At(o),value:r}});t.dataSource=n},VB=t=>{const e=t.query(".type").get("value"),n=t.query(".format").get("value");if(!n||!e){t.setComponentProps({schema:null});return}const r=Ro[e][n]||Ro.general[n];if(!r||typeof r=="function"){t.setComponentProps({schema:null});return}const i=Fo.uid();t.setComponentProps({schema:tt({name:i},r.schema)})},XB=(t,e="en-US")=>{const n=(t||[]).filter(i=>i.field&&i.type&&i.format).reduce((i,o)=>{const a=Ro[o.type][o.format]||Ro.general[o.format];return a&&(i[o.field]=[...i[o.field]||[],{transformer:a,argument:o.argument}]),i},{}),r={};return Object.entries(n).forEach(([i,o])=>{r[i]=o.reduce((a,s)=>{const{transformer:l}=s;let{argument:c}=s;return u=>{try{return typeof l=="function"?l(a(u),c):(!c&&!l.schema&&(c=e),l.fn(a(u),c))}catch(f){return console.log(f),u}}},a=>a)}),r};function lu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var qB=function(e){return KB(e)&&!ZB(e)};function KB(t){return!!t&&typeof t=="object"}function ZB(t){var e=Object.prototype.toString.call(t);return e==="[object RegExp]"||e==="[object Date]"||t7(t)}var QB=typeof Symbol=="function"&&Symbol.for,JB=QB?Symbol.for("react.element"):60103;function t7(t){return t.$$typeof===JB}function e7(t){return Array.isArray(t)?[]:{}}function cu(t,e){return e.clone!==!1&&e.isMergeableObject(t)?al(e7(t),t,e):t}function n7(t,e,n){return t.concat(e).map(function(r){return cu(r,n)})}function r7(t,e){if(!e.customMerge)return al;var n=e.customMerge(t);return typeof n=="function"?n:al}function i7(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[]}function RS(t){return Object.keys(t).concat(i7(t))}function BS(t,e){try{return e in t}catch(n){return!1}}function o7(t,e){return BS(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))}function a7(t,e,n){var r={};return n.isMergeableObject(t)&&RS(t).forEach(function(i){r[i]=cu(t[i],n)}),RS(e).forEach(function(i){o7(t,i)||(BS(t,i)&&n.isMergeableObject(e[i])?r[i]=r7(i,n)(t[i],e[i],n):r[i]=cu(e[i],n))}),r}function al(t,e,n){n=n||{},n.arrayMerge=n.arrayMerge||n7,n.isMergeableObject=n.isMergeableObject||qB,n.cloneUnlessOtherwiseSpecified=cu;var r=Array.isArray(e),i=Array.isArray(t),o=r===i;return o?r?n.arrayMerge(t,e,n):a7(t,e,n):cu(e,n)}al.all=function(e,n){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(r,i){return al(r,i,n)},{})};var s7=al,l7=s7;const c7=lu(l7),u7=()=>({title:'{{t("Options")}}',type:"array","x-decorator":"FormItem","x-component":"ArrayItems",items:{type:"object","x-decorator":"ArrayItems.Item",properties:{space:{type:"void","x-component":"Space",properties:{label:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Option label")}}'},required:!0},value:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Option value")}}'},required:!0},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:"Add","x-component":"ArrayItems.Addition"}}}),ky=t=>{const e={type:"boolean","x-content":'{{ t("Show time") }}',"x-decorator":"FormItem","x-component":"Checkbox"},n={type:"string",title:'{{t("Date format")}}',"x-component":"Radio.Group","x-decorator":"FormItem",default:"YYYY-MM-DD",enum:[{label:'{{t("Year/Month/Day")}}',value:"YYYY/MM/DD"},{label:'{{t("Year-Month-Day")}}',value:"YYYY-MM-DD"},{label:'{{t("Day/Month/Year")}}',value:"DD/MM/YYYY"}]},r=u7();return{DatePicker:{type:"object",properties:{dateFormat:n,showTime:e}},"DatePicker.RangePicker":{type:"object",properties:{dateFormat:n,showTime:e}},Select:{type:"object",properties:{mode:{type:"string",enum:[{label:'{{ t("Single select") }}',value:""},{label:'{{ t("Multiple select") }}',value:"multiple"}],"x-decorator":"FormItem","x-component":"Radio.Group","x-component-props":{defaultValue:""}},options:r}},"Checkbox.Group":{type:"object",properties:{options:r}},"Radio.Group":{type:"object",properties:{options:r}}}[t]},f7=(t,e)=>{if(!t)return t;if(Ve.isDayjs(t))return e.showTime||(t=t.startOf("day")),My.moment2str(t,e);if(Array.isArray(t)&&t.length&&Ve.isDayjs(t[0])){let n=t[0],r=t[1];return e.showTime&&(n=n.startOf("day"),r=r.endOf("day")),[n.toISOString(),r.toISOString()]}return t},zS=(t,e)=>Cr(this,null,function*(){const n=t.initialValue;if(!(typeof n=="string"&&(n==null?void 0:n.startsWith("{{$"))&&(n==null?void 0:n.endsWith("}}")))||!e)t.setValue(n),t.setInitialValue(n);else{t.loading=!0;const i=yield e.parseVariable(n),o=f7(i,t.componentProps);t.setValue(o),t.setInitialValue(o),t.loading=!1}}),hh="-",uu=(t,e)=>t?`${t}${hh}${e}`:e,YS=t=>{const[e,n]=t.split(hh);return n?{dataSource:e,fieldName:n}:{dataSource:z.DEFAULT_DATA_SOURCE_KEY,fieldName:e}},Ly=(t,e,n)=>dt.Schema.isSchemaInstance(t)?t.reduceProperties((r,i)=>{let o=i[e];if(o.includes(hh)||(o=`${z.DEFAULT_DATA_SOURCE_KEY}${hh}${o}`),o===n)return i;if(i["x-component"]!=="Action.Container"&&i["x-component"]!=="AssociationField.Viewer"){const a=Ly(i,e,n);if(a)return a}return r}):null,Ny=()=>{const{charts:t}=q.useContext(ol),e=q.useMemo(()=>Object.values(t).filter(i=>i).reduce((i,o)=>{var l;const{dataSource:a,collection:s}=o;return(l=i[a])!=null&&l.includes(s)||(i[a]=[...i[a]||[],s]),i},{}),[t]),n=q.useMemo(()=>Object.keys(e).length>1,[e]),r=q.useCallback((i,o)=>{var a;return((a=e[i])==null?void 0:a.includes(o))||!1},[e]);return{chartCollections:e,showDataSource:n,getIsChartCollectionExists:r}},sl=()=>{const t=z.useDataSourceManager(),{charts:e}=q.useContext(ol),{fieldSchema:n}=z.useActionContext(),r=n==null?void 0:n["x-action"],{fields:i,form:o}=q.useContext(Tr),a=({dataSource:h,collection:p,cm:v,fim:g})=>{const y=v.getCollectionFields(p.name),m=(_,S,E,M)=>{var j,L,I,$,F;const P=((j=_.uiSchema)==null?void 0:j.title)||_.name,C=g.getFieldInterface(_.interface),A=(I=(L=C==null?void 0:C.filterable)==null?void 0:L.operators)==null?void 0:I[0],T=v.getCollection(_.target);S=S?`${S} / ${P}`:P;let k={type:"string",title:S,name:`${E}.${_.name}`,required:!1,"x-designer":"ChartFilterItemDesigner","x-component":"CollectionField","x-decorator":"ChartFilterFormItem","x-data-source":h,"x-collection-field":`${M}.${_.name}`,"x-component-props":vt(tt({},($=_.uiSchema)==null?void 0:$["x-component-props"]),{"filter-operator":A})};if(_.interface==="formula"){const R=MB(_.dataType)||"Input";k=vt(tt({},k),{"x-component":R})}return["oho","o2m"].includes(_.interface)&&rn.set(k,"x-component-props.useOriginalFilter",!0),{key:`${E}.${_.name}`,name:_.name,type:"item",title:((F=_==null?void 0:_.uiSchema)==null?void 0:F.title)||_.name,Component:"CollectionFieldInitializer",find:Ly,remove:(R,B)=>{B(R,{breakRemoveOn:{"x-component":"Grid"}})},schemaInitialize:R=>{var B;(B=C==null?void 0:C.schemaInitialize)==null||B.call(C,R,{field:_,block:"FilterForm",readPretty:o.readPretty,action:r,targetCollection:T})},schema:k}},b=(_,S,E,M)=>{var k;const P=((k=_.uiSchema)==null?void 0:k.title)||_.name;S=S?`${S} / ${P}`:P;const C=_.operators[0];let A=vt(tt({type:"string",name:`${E}.${_.name}`,required:!1,"x-designer":"ChartFilterItemDesigner","x-decorator":"ChartFilterFormItem","x-data-source":h,"x-collection-field":`${M}.${_.name}`},_.schema),{title:S,"x-component-props":{"filter-operator":C}});return C!=null&&C.noValue&&(A=vt(tt({},A),{"x-component":"ChartFilterCheckbox","x-component-props":vt(tt({},A["x-component-props"]),{content:dt.Schema.compile(C.label,{t:z.i18n.t})})})),{key:`${E}.${_.name}`,name:_.name,type:"item",title:_.title||_.name,Component:"CollectionFieldInitializer",find:Ly,remove:(N,j)=>{j(N,{breakRemoveOn:{"x-component":"Grid"}})},schema:A}},x=(_,S,E,M,P)=>{var j,L,I;if(!_.interface||_.isForeignKey)return;const C=g.getFieldInterface(_.interface);if(!(C!=null&&C.filterable))return;const{nested:A,children:T}=C.filterable,k=((j=_.uiSchema)==null?void 0:j.title)||_.name,N=m(_,E,M,P);if(!(_.target&&S>2)){if(E=E?`${E} / ${k}`:k,T!=null&&T.length&&!["chinaRegion","createdBy","updatedBy","attachment"].includes(_.interface)){const $=T.map(F=>b(F,E,`${M}.${_.name}`,`${P}.${_.name}`));return{key:`${M}.${_.name}`,name:_.name,type:"subMenu",title:((L=_==null?void 0:_.uiSchema)==null?void 0:L.title)||_.name,children:$}}if(!S||S>2)return N;if(A){const F=v.getCollectionFields(_.target).map(R=>x(R,S+1,"",`${M}.${_.name}`,`${P}.${_.name}`));return{key:`${M}.${_.name}`,name:_.name,type:"subMenu",title:((I=_==null?void 0:_.uiSchema)==null?void 0:I.title)||_.name,children:F.filter(Boolean)}}return N}},w=[],O=[];return y.forEach(_=>{const S=_.interface,E=x(_,0,"",uu(h,p.name),p.name);if(E&&w.push(E),["m2o"].includes(S)){const M=x(_,1,"",uu(h,p.name),p.name);M&&O.push(M)}}),O.length&&w.push({name:"divider",type:"divider"},{name:"displayAssociationFields",type:"itemGroup",title:z.i18n.t("Display association fields"),children:O}),w},s=()=>{const h=(o==null?void 0:o.values)||{},p={};return Object.entries(i).filter(([v,g])=>g).forEach(([v,g])=>{const{operator:y}=g||{},{dataSource:m,fieldName:b}=YS(v);let x=b;const _=t.getDataSource(m).collectionManager.getCollectionField(x);if(_!=null&&_.target){const C=_.targetKey||"id";x=`${x}.${C}`,v=`${v}.${C}`}const[S,...E]=x.split("."),M=EB(h,v),P=(y==null?void 0:y.value)||"$eq";if(S!=="custom"){const C=uu(m,S);p[C]=p[C]||{$and:[]};const A={};rn.set(A,E.join("."),{[P]:M}),p[C].$and.push(A)}else p[S]=p[S]||{},p[S][`$nFilter.${E.join(".")}`]=M}),p},l=(h,p)=>{if(!h)return!1;const{dataSource:v,collection:g,query:y}=h,{parameters:m}=My.parse(y.filter||"");return p[uu(v,g)]||p.custom&&(m==null?void 0:m.find(({key:b})=>rn.has(p.custom,b)))},c=(h,p)=>{const{dataSource:v,collection:g,query:y}=h;let m=tt({},y);const b=tt({},m.filter||{});let x={};const w=My.parse(b),{parameters:O}=w;return p.custom&&(O!=null&&O.find(_=>p.custom[_.key]))&&(x=w(p.custom)),x=c7(b,x),m=vt(tt({},m),{filter:{$and:[x,p[uu(v,g)]]}}),m},u=()=>Cr(this,null,function*(){const h=s(),p=Object.values(e).filter(v=>l(v,h)).map(v=>()=>Cr(this,null,function*(){const{dataSource:g,service:y,collection:m}=v;yield y.runAsync(g,m,c(v,h),!0)}));yield Promise.all(p.map(v=>v()))}),f=()=>Cr(this,null,function*(){const h=Object.values(e).filter(p=>p).map(p=>()=>Cr(this,null,function*(){const{service:v,dataSource:g,collection:y,query:m}=p;yield v.runAsync(g,y,m,!0)}));yield Promise.all(h.map(p=>p()))}),d=Ei.useMemoizedFn(h=>h.split(" / ").map(p=>z.i18n.t(dt.Schema.compile(p,{t:z.i18n.t}))).join(" / "));return{filter:u,refresh:f,getChartFilterFields:a,getFilter:s,hasFilter:l,appendFilter:c,getTranslatedTitle:d}},d7=()=>{const{t}=se(),e=Ei.useMemoizedFn(t),{enabled:n,fields:r}=q.useContext(Tr),i=Object.entries(r).filter(([a,s])=>a.startsWith("custom.")&&s).map(([a,{title:s}])=>{const l=a.replace(/^custom\./,"");return{key:l,value:l,label:s}}),o=q.useMemo(()=>({label:e("Current filter"),value:"$nFilter",key:"$nFilter",children:i}),[i,e]);return!n||!i.length?null:o},WS=()=>{const{t}=se(),{chartCollections:e}=Ny(),n=z.useDataSourceManager(),r=n.collectionFieldInterfaceManager,{values:i}=GS(),o=(a,s,l)=>{var d,h,p;if(!s.interface)return;const c=r.getFieldInterface(s.interface);if(!(c!=null&&c.filterable))return;const{nested:u}=c.filterable,f={value:s.name,label:t(((d=s==null?void 0:s.uiSchema)==null?void 0:d.title)||s.name)};if(!(s.target&&l>2)){if(l>2)return f;if(u){const g=a.getCollectionFields(s.target).map(y=>o(a,y,l+1));return{value:s.name,label:t(((h=s==null?void 0:s.uiSchema)==null?void 0:h.title)||s.name),children:g.filter(y=>y)}}if(!(!i.includes((p=s.uiSchema)==null?void 0:p["x-component"])&&!i.includes(s.interface)))return f}};return q.useMemo(()=>Object.entries(e).map(([s,l])=>{const c=n.getDataSource(s);return{value:s,label:dt.Schema.compile(c.displayName,{t}),children:l.map(u=>{const f=c.collectionManager,d=f.getCollection(u),p=f.getCollectionFields(u).map(v=>o(f,v,1)).filter(v=>v);return{value:u,label:dt.Schema.compile(d.title,{t}),children:p}})}}),[e])},GS=()=>{const{t}=se(),e=[{label:t("Input"),value:"Input"},{label:t("Number"),value:"InputNumber"},{label:t("Date"),value:"DatePicker"},{label:t("Date range"),value:"DatePicker.RangePicker"},{label:t("Time"),value:"TimePicker"},{label:t("Time range"),value:"TimePicker.RangePicker"},{label:t("Select"),value:"Select"},{label:t("Radio group"),value:"Radio.Group"},{label:t("Checkbox group"),value:"Checkbox.Group"}];return{options:e,values:e.map(n=>n.value)}},h7=(t,e)=>{const{t:n}=se(),r=z.useDataSourceManager(),{showDataSource:i}=Ny();return q.useMemo(()=>{var p;const o=r.getDataSource(t);if(!o)return;const a=o.collectionManager;if(!e)return;const{fieldName:s}=YS(e),[l,...c]=s.split(".");if(!(c!=null&&c.length))return;const u=a.getCollection(l);let f=l,d,h=dt.Schema.compile(u==null?void 0:u.title,{t:n});for(;f&&c.length>0;){const v=c.shift();d=a.getCollectionField(`${f}.${v}`);const g=((p=d==null?void 0:d.uiSchema)==null?void 0:p.title)||(d==null?void 0:d.name);g&&(h+=` / ${dt.Schema.compile(g,{t:n})}`),d!=null&&d.target?f=d.target:f=null}return i?`${dt.Schema.compile(o.displayName,{t:n})} > ${h}`:h},[e,t,i])},p7=()=>{const t=dt.useField(),{operator:e,schema:n}=t.data||{},{currentUserSettings:r}=z.useCurrentUserVariable({collectionField:{uiSchema:n},uiSchema:n}),{datetimeSettings:i}=z.useDatetimeVariable({operator:e,schema:n}),o=d7(),a=q.useMemo(()=>[r,i,o].filter(Boolean),[i,r,o]);return!e||!n?[]:a},Iy=(t={},e={})=>vt(tt({type:"array","x-decorator":"FormItem","x-component":"ArrayItems"},e),{items:{type:"object",properties:{space:{type:"void","x-component":"Space",properties:vt(tt({sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"}},t),{remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}})}}},properties:{add:{type:"void",title:'{{t("Add field")}}',"x-component":"ArrayItems.Addition"}}}),v7=t=>({type:"void",properties:{config:{type:"object",properties:{collapse:{type:"void","x-component":"FormCollapse","x-component-props":{formCollapse:"{{formCollapse}}",size:"small",style:{border:"none",boxShadow:"none"}},properties:{pane1:{type:"void","x-component":"FormCollapse.CollapsePanel","x-component-props":{header:At("Container"),key:"card"},properties:{title:{type:"string",title:'{{t("Title")}}',"x-decorator":"FormItem","x-component":"Input"},bordered:{type:"boolean","x-content":At("Show border"),"x-decorator":"FormItem","x-component":"Checkbox",default:!1}}},pane2:{type:"void","x-component":"FormCollapse.CollapsePanel","x-component-props":{header:At("Chart"),key:"basic",style:{border:"none"}},properties:{chartType:{type:"string",title:'{{t("Chart type")}}',"x-decorator":"FormItem","x-component":"Select","x-component-props":{placeholder:'{{t("Please select a chart type.")}}'},enum:"{{ chartTypes }}"},[Fo.uid()]:{type:"void",properties:{general:t}},[Fo.uid()]:{type:"void",properties:{advanced:{type:"json",title:'{{t("JSON config")}}',"x-decorator":"FormItem","x-decorator-props":{extra:At("Same properties set in the form above will be overwritten by this JSON config.")},"x-component":"Input.JSON","x-component-props":{autoSize:{minRows:3}}}}},reference:{type:"string","x-reactions":{dependencies:[".chartType"],fulfill:{schema:{"x-content":"{{ getReference($deps[0]) }}"}}}}}}}}}}}}),g7={type:"void",properties:{settings:{type:"void",properties:{collection:{title:'{{t("Collection")}}',type:"string","x-decorator":"FormItem","x-component":"Cascader",enum:"{{ collectionOptions }}","x-component-props":{onChange:"{{ onCollectionChange }}",placeholder:'{{t("Collection")}}'}}}},query:{type:"object",properties:{builder:{type:"void",properties:{collapse:{type:"void","x-decorator":"FormItem","x-component":"FormCollapse","x-component-props":{formCollapse:"{{formCollapse}}",size:"small",style:{border:"none",boxShadow:"none"}},properties:{pane1:{type:"void","x-component":"FormCollapse.CollapsePanel","x-component-props":{header:At("Measures"),key:"measures"},properties:{measures:Iy({field:{type:"string","x-decorator":"FormItem","x-component":"Cascader","x-component-props":{placeholder:'{{t("Field")}}',fieldNames:{label:"title",value:"name",children:"children"}},enum:"{{ fieldOptions }}",required:!0},aggregation:{type:"string","x-decorator":"FormItem","x-component":"Select","x-component-props":{placeholder:'{{t("Aggregation")}}'},enum:[{label:'{{t("Sum")}}',value:"sum"},{label:'{{t("Count")}}',value:"count"},{label:'{{t("Avg")}}',value:"avg"},{label:'{{t("Max")}}',value:"max"},{label:'{{t("Min")}}',value:"min"}]},alias:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Alias")}}',style:{minWidth:"100px"}}}},{required:!0,"x-component-props":{style:{overflow:"auto"}}})}},pane2:{type:"void","x-component":"FormCollapse.CollapsePanel","x-component-props":{header:At("Dimensions"),key:"dimensions"},properties:{dimensions:Iy({field:{type:"string","x-decorator":"FormItem","x-component":"Cascader","x-component-props":{placeholder:'{{t("Field")}}',fieldNames:{label:"title",value:"name",children:"children"}},enum:"{{ fieldOptions }}",required:!0},format:{type:"string","x-decorator":"FormItem","x-component":"Select","x-component-props":{placeholder:'{{t("Format")}}',style:{maxWidth:"120px"}},"x-reactions":"{{ useFormatterOptions }}","x-visible":"{{ $self.dataSource && $self.dataSource.length }}"},alias:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Alias")}}',style:{minWidth:"100px"}}}},{"x-component-props":{style:{overflow:"auto"}}})}},pane3:{type:"void","x-component":"FormCollapse.CollapsePanel","x-component-props":{header:At("Filter"),key:"filter"},properties:{filter:{type:"object","x-decorator":"FormItem","x-decorator-props":{style:{overflow:"auto"}},enum:"{{ filterOptions }}","x-component":"Filter","x-component-props":{dynamicComponent:"FilterDynamicComponent"}}}},pane4:{type:"void","x-component":"FormCollapse.CollapsePanel","x-component-props":{header:At("Sort"),key:"sort",style:{border:"none"}},properties:{orders:Iy({field:{type:"string","x-decorator":"FormItem","x-component":"Cascader","x-component-props":{placeholder:'{{t("Field")}}'},"x-reactions":"{{ useOrderOptions }}",required:!0},order:{type:"string","x-decorator":"FormItem","x-component":"Radio.Group","x-component-props":{defaultValue:"ASC",optionType:"button",style:{width:"128px"}},enum:["ASC","DESC"]}},{"x-reactions":"{{ useOrderReaction }}","x-component-props":{style:{overflow:"auto"}}})}}}},limit:{title:'{{t("Limit")}}',type:"number","x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{defaultValue:2e3,min:1,style:{width:"100px"}}}}},cache:{type:"object",properties:{enabled:{type:"boolean",title:'{{t("Enable cache")}}',"x-decorator":"FormItem","x-component":"Switch"},ttl:{type:"number",title:'{{t("TTL (second)")}}',"x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{defaultValue:60,min:1,style:{width:"100px"}}}}}}}}},y7={type:"void",properties:{transform:{type:"array","x-decorator":"FormItem","x-component":"ArrayItems",items:{type:"object",properties:{space:{type:"void","x-component":"Space","x-component-props":{wrap:!0},properties:{sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"},field:{type:"string","x-decorator":"FormItem","x-component":"Select","x-component-props":{placeholder:'{{t("Field")}}'},"x-use-component-props":"useFieldSelectProps","x-reactions":"{{ useChartFields }}"},type:{type:"string","x-decorator":"FormItem","x-component":"Select","x-component-props":{placeholder:'{{t("Type")}}'},"x-use-component-props":"useFieldTypeSelectProps"},format:{type:"string","x-decorator":"FormItem","x-component":"Select","x-component-props":{placeholder:'{{t("Transformer")}}',style:{maxWidth:"200px"}},"x-use-component-props":"useTransformerSelectProps","x-reactions":"{{ useTransformers }}","x-visible":"{{ $self.dataSource && $self.dataSource.length }}"},argument:{type:"string","x-decorator":"FormItem","x-component":"TransformerDynamicComponent","x-reactions":"{{ useArgument }}"},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:'{{t("Add transformation")}}',"x-component":"ArrayItems.Addition"}}}}};function m7(t){const{value:e,onChange:n,renderSchemaComponent:r}=t,i=p7();return Y.jsx(z.Variable.Input,{value:e,onChange:n,scope:i,children:r()})}const Mi=q.createContext({visible:!0});Mi.displayName="ChartConfigContext";const b7=t=>{var a;const{insertAdjacent:e}=z.useDesignable(),[n,r]=q.useState(!1),[i,o]=q.useState({});return Y.jsxs(Mi.Provider,{value:{visible:n,setVisible:r,current:i,setCurrent:o},children:[t.children,Y.jsx(IS,vt(tt({},(a=i.field)==null?void 0:a.decoratorProps),{children:Y.jsx(ii,{insert:(s,l)=>e("beforeEnd",s,l)})}))]})},x7=t=>{const{schema:e}=t,n=dt.useField();return e?Y.jsx(z.SchemaComponent,{schema:{type:"void",properties:{[e.name]:vt(tt({type:"void"},e),{value:n.value,"x-component-props":vt(tt({},e["x-component-props"]),{defaultValue:n.value,onChange:r=>{if(typeof r=="object"&&(r!=null&&r.target)){n.value=r.target.value;return}n.value=r}})})}}}):null},{Paragraph:IMt,Text:w7}=wt.Typography,ii=t=>{const{t:e}=se(),{service:n}=q.useContext(ri),{visible:r,setVisible:i,current:o}=q.useContext(Mi),{schema:a,field:s,dataSource:l,collection:c,initialValues:u}=o||{},{dn:f}=z.useDesignable(),{modal:d}=wt.App.useApp(),{insert:h}=t,p=DS(),v=Ha(l,c),g=(P=!1)=>{var I;if(!_.modified)return;const C=(I=_.values.config)==null?void 0:I.chartType;if(!C)return;const A=p[C];if(!(A==null?void 0:A.init)){P&&(_.values.config.general={},_.values.config.advanced={});return}const k=_.values.query,N=il(v,k),{general:j,advanced:L}=A.init(N,k);(j||P)&&(_.values.config.general=j),(L||P)&&(_.values.config.advanced=L||{})},[y,m]=q.useState([]),[b,x]=q.useState([]),w=(P,C)=>{var k,N;const A=((k=P.values.query)==null?void 0:k.measures.filter(j=>j.field))||[],T=((N=P.values.query)==null?void 0:N.dimensions.filter(j=>j.field))||[];rn.isEqual(A,y)&&rn.isEqual(T,b)||(C==null||C(),m(rn.cloneDeep(A)),x(rn.cloneDeep(T)))},O=kB(),_=q.useMemo(()=>{var A;const P=u||(s==null?void 0:s.decoratorProps),C=(P==null?void 0:P.config)||{};return wn.createForm({values:vt(tt({},P),{config:vt(tt({chartType:O},C),{title:C.title||((A=s==null?void 0:s.componentProps)==null?void 0:A.title)}),collection:[l,c]}),effects:T=>{wn.onFieldChange("config.chartType",()=>g(!0)),wn.onFormInit(()=>w(T))}})},[s,r,l,c]),S=()=>Y.jsx(wt.Button,{type:"link",loading:n==null?void 0:n.loading,icon:Y.jsx(Nn.RightSquareOutlined,{}),onClick:()=>Cr(this,null,function*(){const P=_.query("query").take();try{yield P==null?void 0:P.validate()}catch(C){return}try{yield n.runAsync(l,c,_.values.query,!0)}catch(C){console.log(C)}w(_,g)}),children:e("Run query")}),E=q.useRef(null),M=q.useRef(null);return q.useEffect(()=>{var P;r&&n.run(c,(P=s==null?void 0:s.decoratorProps)==null?void 0:P.query,"configure")},[r]),Y.jsx(wt.Modal,{title:e("Configure chart"),open:r,onOk:()=>{const{query:P,config:C,transform:A,mode:T}=_.values,{title:k,bordered:N}=C||{},j=()=>{var I;i(!1),(I=o.service)==null||I.run(l,c,P),E.current.scrollTop=0,M.current.scrollTop=0,n.mutate(void 0)},L={query:P,config:C,dataSource:l,collection:c,transform:A,mode:T||"builder"};if(a&&a["x-uid"]){a["x-component-props"]=vt(tt({},a["x-component-props"]),{title:k,bordered:N}),a["x-decorator-props"]=L,s.decoratorProps=L,s.componentProps=vt(tt({},s.componentProps),{title:k,bordered:N}),s["x-acl-action"]=`${c}:list`,f.emit("patch",{schema:a}),j();return}h(z.gridRowColWrap(NS(L)),{onSuccess:j})},onCancel:()=>{d.confirm({title:e("Are you sure to cancel?"),content:e("You changes are not saved. If you click OK, your changes will be lost."),okButtonProps:{danger:!0},onOk:()=>{i(!1),E.current.scrollTop=0,M.current.scrollTop=0,n.mutate(void 0)}})},width:"95%",className:Ga.css`
1
+ (function(ct,z){typeof exports=="object"&&typeof module!="undefined"?z(exports,require("@nocobase/client"),require("react/jsx-runtime"),require("react"),require("@ant-design/icons"),require("@formily/antd-v5"),require("@formily/core"),require("@formily/react"),require("antd"),require("lodash"),require("react-i18next"),require("dayjs"),require("@formily/shared"),require("ahooks"),require("@nocobase/utils/client"),require("@emotion/css")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","react/jsx-runtime","react","@ant-design/icons","@formily/antd-v5","@formily/core","@formily/react","antd","lodash","react-i18next","dayjs","@formily/shared","ahooks","@nocobase/utils/client","@emotion/css"],z):(ct=typeof globalThis!="undefined"?globalThis:ct||self,z(ct["@nocobase/plugin-data-visualization"]={},ct["@nocobase/client"],ct.jsxRuntime,ct.react,ct["@ant-design/icons"],ct["@formily/antd-v5"],ct["@formily/core"],ct["@formily/react"],ct.antd,ct.lodash,ct["react-i18next"],ct.dayjs,ct["@formily/shared"],ct.ahooks,ct["@nocobase/utils"],ct["@emotion/css"]))})(this,function(ct,z,Y,q,Nn,ae,wn,dt,wt,rn,Ey,Ve,Fo,Ei,My,Ga){"use strict";var TMt=Object.defineProperty,kMt=Object.defineProperties;var LMt=Object.getOwnPropertyDescriptors;var Sy=Object.getOwnPropertySymbols;var eB=Object.prototype.hasOwnProperty,nB=Object.prototype.propertyIsEnumerable;var CS=(ct,z)=>(z=Symbol[ct])?z:Symbol.for("Symbol."+ct),Ce=Math.pow,TS=(ct,z,Y)=>z in ct?TMt(ct,z,{enumerable:!0,configurable:!0,writable:!0,value:Y}):ct[z]=Y,tt=(ct,z)=>{for(var Y in z||(z={}))eB.call(z,Y)&&TS(ct,Y,z[Y]);if(Sy)for(var Y of Sy(z))nB.call(z,Y)&&TS(ct,Y,z[Y]);return ct},pt=(ct,z)=>kMt(ct,LMt(z));var rB=(ct,z)=>{var Y={};for(var q in ct)eB.call(ct,q)&&z.indexOf(q)<0&&(Y[q]=ct[q]);if(ct!=null&&Sy)for(var q of Sy(ct))z.indexOf(q)<0&&nB.call(ct,q)&&(Y[q]=ct[q]);return Y};var ni=(ct,z,Y)=>(TS(ct,typeof z!="symbol"?z+"":z,Y),Y);var Cr=(ct,z,Y)=>new Promise((q,Nn)=>{var ae=wt=>{try{dt(Y.next(wt))}catch(rn){Nn(rn)}},wn=wt=>{try{dt(Y.throw(wt))}catch(rn){Nn(rn)}},dt=wt=>wt.done?q(wt.value):Promise.resolve(wt.value).then(ae,wn);dt((Y=Y.apply(ct,z)).next())}),NMt=function(ct,z){this[0]=ct,this[1]=z};var iB=ct=>{var z=ct[CS("asyncIterator")],Y=!1,q,Nn={};return z==null?(z=ct[CS("iterator")](),q=ae=>Nn[ae]=wn=>z[ae](wn)):(z=z.call(ct),q=ae=>Nn[ae]=wn=>{if(Y){if(Y=!1,ae==="throw")throw wn;return wn}return Y=!0,{done:!1,value:new NMt(new Promise(dt=>{var wt=z[ae](wn);if(!(wt instanceof Object))throw TypeError("Object expected");dt(wt)}),1)}}),Nn[CS("iterator")]=()=>Nn,q("next"),"throw"in z?q("throw"):Nn.throw=ae=>{throw ae},"return"in z&&q("return"),Nn};function wB(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const kS="data-visualization";function At(t){return z.i18n.t(t,{ns:[kS,"client"]})}function se(){return Ey.useTranslation([kS,"client"],{nsMode:"fallback"})}const Py={datetime:[{label:At("YYYY"),value:"YYYY"},{label:At("MM"),value:"MM"},{label:At("DD"),value:"DD"},{label:At("YYYY-MM"),value:"YYYY-MM"},{label:At("YYYY-MM-DD"),value:"YYYY-MM-DD"},{label:At("YYYY-MM-DD hh:mm"),value:"YYYY-MM-DD hh:mm"},{label:At("YYYY-MM-DD hh:mm:ss"),value:"YYYY-MM-DD hh:mm:ss"}],date:[{label:At("YYYY"),value:"YYYY"},{label:At("MM"),value:"MM"},{label:At("DD"),value:"DD"},{label:At("YYYY-MM"),value:"YYYY-MM"},{label:At("YYYY-MM-DD"),value:"YYYY-MM-DD"}],time:[{label:At("hh:mm:ss"),value:"hh:mm:ss"},{label:At("hh:mm"),value:"hh:mm"},{label:At("hh"),value:"hh"}]},OB=q.createContext(null),Ay={didCatch:!1,error:null};let LS=class extends q.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Ay}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(e!==null){for(var n,r,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:o,reason:"imperative-api"}),this.setState(Ay)}}componentDidCatch(e,n){var r,i;(r=(i=this.props).onError)===null||r===void 0||r.call(i,e,n)}componentDidUpdate(e,n){const{didCatch:r}=this.state,{resetKeys:i}=this.props;if(r&&n.error!==null&&_B(e.resetKeys,i)){var o,a;(o=(a=this.props).onReset)===null||o===void 0||o.call(a,{next:i,prev:e.resetKeys,reason:"keys"}),this.setState(Ay)}}render(){const{children:e,fallbackRender:n,FallbackComponent:r,fallback:i}=this.props,{didCatch:o,error:a}=this.state;let s=e;if(o){const l={error:a,resetErrorBoundary:this.resetErrorBoundary};if(q.isValidElement(i))s=i;else if(typeof n=="function")s=n(l);else if(r)s=q.createElement(r,l);else throw a}return q.createElement(OB.Provider,{value:{didCatch:o,error:a,resetErrorBoundary:this.resetErrorBoundary}},s)}};function _B(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return t.length!==e.length||t.some((n,r)=>!Object.is(n,e[r]))}const NS=(t,e={})=>{const{collection:n,config:r}=t,{title:i,bordered:o}=r||{};return{type:"void","x-decorator":"ChartRendererProvider","x-decorator-props":t,"x-acl-action":`${n}:list`,"x-designer":"ChartRenderer.Designer","x-component":"CardItem","x-component-props":{size:"small",title:i,bordered:o},"x-initializer":"charts:addBlock",properties:{[Fo.uid()]:{type:"void","x-component":"ChartRenderer","x-component-props":e}}}},au=t=>{let e,n;return Array.isArray(t)?t.length===1?n=t[0]:t.length>1&&([e,n]=t):n=t,{target:e,name:n,alias:e?`${e}.${n}`:n}},dh=(t,e)=>{var o,a;const{target:n,name:r}=au(e);return n?(a=(o=t.find(s=>s.name===n))==null?void 0:o.targetFields)==null?void 0:a.find(s=>s.name===r):t.find(s=>s.name===r)},il=(t,e)=>{const n=s=>s.map(l=>{const c=dh(t,l.field);return pt(tt({},c),{key:l.alias||(c==null?void 0:c.key),label:l.alias||(c==null?void 0:c.label),value:l.alias||(c==null?void 0:c.value)})}),r=e.measures||[],i=e.dimensions||[];return[...new Map([...n(r),...n(i)].map(s=>[s.value,s])).values()]},SB=(t,e,n)=>{const r=(i,o)=>{var l;const a=(l=i.uiSchema)==null?void 0:l.enum;if(!a||!Array.isArray(a))return o;const s=a.find(c=>c.value===o);return dt.Schema.compile((s==null?void 0:s.label)||o,n)};return e.map(i=>{const o={};return Object.entries(i).forEach(([a,s])=>{const l=t.find(c=>c.value===a);if(!l){o[a]=s;return}switch(l.interface){case"select":case"radioGroup":o[a]=r(l,s);break;default:o[a]=s}}),o})},Cy=t=>{if(typeof t=="object"&&t!==null)if(Array.isArray(t)){const e=t.map(n=>Cy(n)).filter(Boolean);return e.length>0?e:null}else{const e={};for(const n in t){const r=Cy(t[n]);r!=null&&!(typeof r=="object"&&Object.keys(r).length===0)&&(e[n]=r)}return Object.keys(e).length>0?e:null}else if(typeof t=="string"&&t.startsWith("{{$nFilter.")&&t.endsWith("}}"))return null;return t},EB=(t,e)=>{const n=e.split(".");let r=rn.get(t,n.slice(0,-1).join("."));return Array.isArray(r)?r=r.map(i=>rn.get(i,n.slice(-1)[0])):r=rn.get(r,n.slice(-1)[0]),r},MB=t=>({boolean:"Checkbox",integer:"InputNumber",bigInt:"InputNumber",double:"InputNumber",decimal:"InputNumber",date:"DatePicker",string:"Input"})[t],PB=t=>({boolean:"boolean",integer:"integer",bigInt:"integer",double:"number",decimal:"number",date:"datetime",string:"input"})[t],ol=q.createContext({});ol.displayName="ChartDataContext";const AB=t=>{const[e,n]=q.useState({}),r=Ei.useMemoizedFn((o,{dataSource:a,collection:s,service:l,query:c})=>{n(u=>pt(tt({},u),{[o]:{dataSource:a,collection:s,service:l,query:c}}))}),i=Ei.useMemoizedFn(o=>{n(a=>pt(tt({},a),{[o]:void 0}))});return Y.jsx(ol.Provider,{value:{charts:e,addChart:r,removeChart:i},children:t.children})},Tr=q.createContext({});Tr.displayName="ChartFilterContext";const CB=t=>{const[e,n]=q.useState(!1),[r,i]=q.useState(!1),[o,a]=q.useState({}),[s,l]=q.useState({collapsed:!1,row:1}),[c,u]=q.useState(),f=Ei.useMemoizedFn((g,y)=>{a(m=>pt(tt({},m),{[g]:tt(tt({},m[g]||{}),y)}))}),d=Ei.useMemoizedFn(g=>{a(y=>{const m=tt({},y);return m[g]=void 0,m})}),h=Ei.useMemoizedFn(u),p=Ei.useMemoizedFn(i),v=({collapsed:g,row:y})=>{l(m=>({collapsed:g!==void 0?g:m.collapsed,row:y!==void 0?y:m.row}))};return q.useEffect(()=>n(!0),[]),Y.jsx(Tr.Provider,{value:{ready:e,enabled:r,setEnabled:p,fields:o,setField:f,removeField:d,collapse:s,setCollapse:v,form:c,setForm:h},children:t.children})},ri=q.createContext({});ri.displayName="ChartRendererContext";const IS=t=>{const{query:e,config:n,collection:r,transform:i,dataSource:o=z.DEFAULT_DATA_SOURCE_KEY}=t,{addChart:a}=q.useContext(ol),{ready:s,form:l,enabled:c}=q.useContext(Tr),{getFilter:u,hasFilter:f,appendFilter:d}=sl(),h=dt.useFieldSchema(),p=z.useAPIClient(),v=z.useRequest((g,y,m,b)=>new Promise((x,w)=>{var S;if(!(y&&((S=m==null?void 0:m.measures)!=null&&S.length))||c&&!l)return x(void 0);const O=u(),_=!b&&f({dataSource:g,collection:y,query:m},O)?d({dataSource:g,collection:y,query:m},O):m;p.request({url:"charts:query",method:"POST",data:pt(tt({uid:h==null?void 0:h["x-uid"],dataSource:g,collection:y},_),{filter:Cy(_.filter),dimensions:((m==null?void 0:m.dimensions)||[]).map(E=>{const M=tt({},E);if(E.format&&!E.alias){const{alias:P}=au(E.field);M.alias=P}return M}),measures:((m==null?void 0:m.measures)||[]).map(E=>{const M=tt({},E);if(E.aggregation&&!E.alias){const{alias:P}=au(E.field);M.alias=P}return M})})}).then(E=>{var M;x((M=E==null?void 0:E.data)==null?void 0:M.data)}).finally(()=>{!b&&(h!=null&&h["x-uid"])&&a(h==null?void 0:h["x-uid"],{dataSource:g,collection:y,service:v,query:m})}).catch(w)}),{defaultParams:[o,r,e],ready:s&&(!c||!!l)});return Y.jsx(z.CollectionManagerProvider,{dataSource:o,children:Y.jsx(z.MaybeCollectionProvider,{collection:r,children:Y.jsx(wt.ConfigProvider,{card:{style:{boxShadow:"none"}},children:Y.jsx(ri.Provider,{value:{dataSource:o,collection:r,config:n,transform:i,service:v,query:e},children:t.children})})})})};class TB{constructor(){ni(this,"charts",new Map)}setGroup(e,n){this.charts.set(e,n)}addGroup(e,n){if(this.charts.has(e))throw new Error(`[data-visualization] Chart group "${e}" already exists`);this.setGroup(e,n)}add(e,n){var r;this.charts.has(e)||this.setGroup(e,[]),(r=this.charts.get(e))==null||r.push(n)}getChartTypes(){const e=[];this.charts.forEach((r,i)=>{const o=r.map(a=>({key:`${i}.${a.name}`,label:At(a.title),value:`${i}.${a.name}`}));e.push({label:At(i),children:o})});const n=e.findIndex(r=>r.label===At("Built-in"));if(n>-1){const[r]=e.splice(n,1);e.unshift(r)}return e}getCharts(){const e={};return this.charts.forEach((n,r)=>{n.forEach(i=>{e[`${r}.${i.name}`]=i})}),e}getChart(e){return this.getCharts()[e]}}const jS=()=>z.usePlugin(_y).charts.getChartTypes(),kB=()=>{var e,n,r;return(r=(n=(e=jS()[0])==null?void 0:e.children)==null?void 0:n[0])==null?void 0:r.value},DS=()=>z.usePlugin(_y).charts.getCharts(),LB=t=>z.usePlugin(_y).charts.getChart(t),{Paragraph:NB,Text:IB}=wt.Typography,Ty=t=>{const{t:e}=se(),n=q.useContext(ri),{config:r,transform:i,dataSource:o,collection:a,service:s,data:l}=n,c=Ha(o,a),u=FS(l,o,a),f=(r==null?void 0:r.general)||{},d=(r==null?void 0:r.advanced)||{},h=z.useAPIClient(),p=LB(r==null?void 0:r.chartType),v=h.auth.getLocale(),g=XB(i,v),y=p==null?void 0:p.getProps({data:u,general:f,advanced:d,fieldProps:Object.keys(u[0]||{}).reduce((x,w)=>{if(!x[w]){const O=dh(c,w.split(".")),_=g[w];x[w]={label:(O==null?void 0:O.label)||w,transformer:_,interface:O==null?void 0:O.interface}}return x},{})}),m=dt.Schema.compile(y),b=p==null?void 0:p.Component;return p?!(u&&u.length)&&!s.loading?Y.jsx(wt.Empty,{image:wt.Empty.PRESENTED_IMAGE_SIMPLE,description:e("No data")}):Y.jsx(wt.Spin,{spinning:s.loading,children:Y.jsx(LS,{onError:x=>{console.error(x)},FallbackComponent:jB,children:Y.jsx(b,tt({},m))})}):Y.jsx(wt.Empty,{image:wt.Empty.PRESENTED_IMAGE_SIMPLE,description:e("Please configure chart")})};Ty.Designer=function(){const{t:e}=se(),{setVisible:n,setCurrent:r}=q.useContext(Mi),{removeChart:i}=q.useContext(ol),{service:o}=q.useContext(ri),a=dt.useField(),s=dt.useFieldSchema(),{insertAdjacent:l}=z.useDesignable(),c=z.useDataSource(),{name:u,title:f}=z.useCollection_deprecated();return Y.jsxs(z.GeneralSchemaDesigner,{disableInitializer:!0,title:f||u,children:[Y.jsx(z.SchemaSettingsItem,{title:"Configure",onClick:()=>Cr(this,null,function*(){r({schema:s,field:a,dataSource:c.key,collection:u,service:o,data:o.data}),n(!0)}),children:e("Configure")},"configure"),Y.jsx(z.SchemaSettingsItem,{title:"Duplicate",onClick:()=>l("afterEnd",z.gridRowColWrap(NS(s==null?void 0:s["x-decorator-props"]))),children:e("Duplicate")},"duplicate"),Y.jsx(z.SchemaSettingsDivider,{}),Y.jsx(z.SchemaSettingsRemove,{breakRemoveOn:{"x-component":"ChartV2Block"},confirm:{onOk:()=>{i(s["x-uid"])}}})]})};const jB=({error:t})=>{const{t:e}=se();return Y.jsx("div",{style:{backgroundColor:"white"},children:Y.jsx(wt.Result,{status:"error",title:e("Render Failed"),subTitle:e("Please check the configuration."),children:Y.jsx(NB,{copyable:!0,children:Y.jsx(IB,{type:"danger",style:{whiteSpace:"pre-line",textAlign:"center"},children:t.message})})})})},su=t=>{const{current:e}=q.useContext(Mi),{dataSource:n=t||z.DEFAULT_DATA_SOURCE_KEY,collection:r}=e||{},i=z.useDataSourceManager(),o=i.getDataSource(n),a=i.collectionFieldInterfaceManager;return{cm:o==null?void 0:o.collectionManager,fim:a,collection:r}},DB=t=>(t||[]).filter(n=>n.interface).map(n=>{var r;return pt(tt({},n),{key:n.name,label:((r=n.uiSchema)==null?void 0:r.title)||n.name,value:n.name})}),Ha=(t,e)=>{const{t:n}=Ey.useTranslation(),{cm:r,fim:i,collection:o}=su(t),a=r.getCollectionFields(e||o),s=DB(a);return q.useMemo(()=>s.map(l=>{var d,h,p,v;const c=(d=i.getFieldInterface(l.interface))==null?void 0:d.filterable,u=dt.Schema.compile(((h=l.uiSchema)==null?void 0:h.title)||l.name,{t:n});if(!(c&&(c!=null&&c.nested||(p=c==null?void 0:c.children)!=null&&p.length)))return pt(tt({},l),{label:u});let f=[];if(c!=null&&c.nested){const g=(r.getCollectionFields(l.target)||[]).filter(y=>y.interface).map(y=>{var m;return pt(tt({},y),{key:`${l.name}.${y.name}`,label:`${u} / ${dt.Schema.compile(((m=y.uiSchema)==null?void 0:m.title)||y.name,{t:n})}`,value:`${l.name}.${y.name}`})});f=[...f,...g]}if((v=c==null?void 0:c.children)!=null&&v.length){const g=c.children.map(y=>{var m;return pt(tt({},y),{key:`${l.name}.${y.name}`,label:`${u} / ${dt.Schema.compile(((m=y.schema)==null?void 0:m.title)||y.title||y.name,{t:n})}`,value:`${l.name}.${y.name}`})});f=[...f,...g]}return pt(tt({},l),{label:u,targetFields:f})}),[s])},$S=t=>e=>{const n=e.query("query").get("value")||{},r=il(t,n);e.dataSource=r},$B=t=>e=>{var o;const n=e.query(".field").get("value");if(!n){e.dataSource=[];return}let r=[];switch((o=dh(t,n))==null?void 0:o.interface){case"datetime":case"createdAt":case"updatedAt":r=Py.datetime;break;case"date":r=Py.date;break;case"time":r=Py.time;break;default:r=[]}e.dataSource=r},FB=()=>{const{t}=Ey.useTranslation(),e=z.useDataSourceManager(),{parseAction:n}=z.useACLRoleContext(),i=e.getAllCollections({filterCollection:o=>n(`${o.name}:list`)}).filter(({key:o,isDBInstance:a})=>o===z.DEFAULT_DATA_SOURCE_KEY||a).map(({key:o,displayName:a,collections:s})=>({value:o,label:a,children:s.map(l=>({value:l.name,label:l.title}))}));return q.useMemo(()=>dt.Schema.compile(i,{t}),[i])},RB=(t,e)=>n=>{const r=n.query("query").get("value")||{},{measures:i=[]}=r;if(!i.some(s=>s.aggregation)){n.componentProps.fieldNames={label:"title",value:"name",children:"children"},n.dataSource=t;return}const a=il(e,r);n.componentProps.fieldNames={},n.dataSource=a},BB=(t,e)=>n=>{const r=n.query("query").get("value")||{},{measures:i=[]}=r,o=i.some(u=>u.aggregation);let a=t;const s=[];o?(a=il(e,r),a.forEach(u=>{s.push(u.value)})):a.forEach(u=>{const f=u.children||[];f.length||s.push(u.value||u.name),f.forEach(d=>{s.push(`${u.name}.${d.name}`)})});const c=(n.value||[]).reduce((u,f)=>{const{alias:d}=au(f.field);return(!f.field||s.includes(d))&&u.push(f),u},[]);n.setValue(c)},FS=(t,e,n)=>{var c;const{t:r}=se(),{service:i,query:o}=q.useContext(ri),a=Ha(e,n),s=dt.useForm(),l=il(a,((c=s==null?void 0:s.values)==null?void 0:c.query)||o);return SB(l,(i==null?void 0:i.data)||t||[],{t:r})},zB=(t,e,n=2,r=[])=>{const{cm:i,fim:o,collection:a}=su(t),l=i.getCollectionFields(e||a).filter(d=>!r.includes(d.interface)),c=(d,h,p)=>{var x;if(!d.interface||d.isForeignKey)return;const v=o.getFieldInterface(d.interface);if(!(v!=null&&v.filterable))return;const{nested:g,children:y}=v.filterable,m=p?`${p}.${d.name}`:d.name,b=pt(tt({},d),{name:d.name,title:((x=d==null?void 0:d.uiSchema)==null?void 0:x.title)||d.name,schema:d==null?void 0:d.uiSchema,key:m});if(!(d.target&&h>n)){if(h>n)return b;if(y!=null&&y.length&&(b.children=y.map(w=>pt(tt({},w),{key:`${d.name}.${w.name}`}))),g){const w=i.getCollectionFields(d.target).filter(_=>!r.includes(_.interface)),O=u(w,h+1,d.name).filter(Boolean);b.children=b.children||[],b.children.push(...O)}return b}},u=(d,h,p)=>{const v=[];return d.forEach(g=>{const y=c(g,h,p);y&&v.push(y)}),v};return u(l,1)},YB=(t,e)=>{const{cm:n,fim:r,collection:i}=su(t);return q.useMemo(()=>{const o=n.getCollectionFields(e||i),a=(c,u)=>{var g,y;if(!c.interface||c.isForeignKey)return;const f=r.getFieldInterface(c.interface);if(!(f!=null&&f.filterable))return;const{nested:d,children:h,operators:p}=f.filterable,v={name:c.name,title:((g=c==null?void 0:c.uiSchema)==null?void 0:g.title)||c.name,schema:c==null?void 0:c.uiSchema,operators:((y=p==null?void 0:p.filter)==null?void 0:y.call(p,m=>!(m!=null&&m.visible)||m.visible(c)))||[],interface:c.interface};if(!(c.target&&u>2)){if(u>2)return v;if(h!=null&&h.length&&(v.children=h),d){const m=n.getCollectionFields(c.target),b=s(m,u+1).filter(Boolean);v.children=v.children||[],v.children.push(...b)}return v}},s=(c,u)=>{const f=[];return c.forEach(d=>{const h=a(d,u);h&&f.push(h)}),f};return s(o,1)},[e,n,r])},Ro={general:{Prefix:{schema:{"x-component":"Input"},fn:(t,e)=>e?`${e}${t}`:t},Suffix:{schema:{"x-component":"Input"},fn:(t,e)=>e?`${t}${e}`:t}},datetime:{Format:{schema:{"x-component":"AutoComplete","x-component-props":{allowClear:!0,style:{minWidth:200}},enum:[{label:"YYYY",value:"YYYY"},{label:"YYYY-MM",value:"YYYY-MM"},{label:"YYYY-MM-DD",value:"YYYY-MM-DD"},{label:"YYYY-MM-DD hh:mm",value:"YYYY-MM-DD hh:mm"},{label:"YYYY-MM-DD hh:mm:ss",value:"YYYY-MM-DD hh:mm:ss"}]},fn:(t,e)=>Ve(t).format(e)},YYYY:{label:"YYYY (Deprecated, use Format instead)",fn:t=>Ve(t).format("YYYY")},MM:{label:"MM (Deprecated, use Format instead)",fn:t=>Ve(t).format("MM")},DD:{label:"DD (Deprecated, use Format instead)",fn:t=>Ve(t).format("DD")},"YYYY-MM":{label:"YYYY-MM (Deprecated, use Format instead)",fn:t=>Ve(t).format("YYYY-MM")},"YYYY-MM-DD":{label:"YYYY-MM-DD (Deprecated, use Format instead)",fn:t=>Ve(t).format("YYYY-MM-DD")},"YYYY-MM-DD hh:mm":{label:"YYYY-MM-DD hh:mm (Deprecated, use Format instead)",fn:t=>Ve(t).format("YYYY-MM-DD hh:mm")},"YYYY-MM-DD hh:mm:ss":{label:"YYYY-MM-DD hh:mm:ss (Deprecated, use Format instead)",fn:t=>Ve(t).format("YYYY-MM-DD hh:mm:ss")}},date:{Format:{schema:{"x-component":"AutoComplete","x-component-props":{allowClear:!0,style:{minWidth:200}},enum:[{label:"YYYY",value:"YYYY"},{label:"MM",value:"MM"},{label:"DD",value:"DD"},{label:"YYYY-MM",value:"YYYY-MM"},{label:"YYYY-MM-DD",value:"YYYY-MM-DD"}]},fn:(t,e)=>Ve(t).format(e)},YYYY:{label:"YYYY (Deprecated, use Format instead)",fn:t=>Ve(t).format("YYYY")},MM:{label:"MM (Deprecated, use Format instead)",fn:t=>Ve(t).format("MM")},DD:{label:"DD (Deprecated, use Format instead)",fn:t=>Ve(t).format("DD")},"YYYY-MM":{label:"YYYY-MM (Deprecated, use Format instead)",fn:t=>Ve(t).format("YYYY-MM")},"YYYY-MM-DD":{label:"YYYY-MM-DD (Deprecated, use Format instead)",fn:t=>Ve(t).format("YYYY-MM-DD")}},time:{Format:{schema:{"x-component":"AutoComplete","x-component-props":{allowClear:!0,style:{minWidth:200}},enum:[{label:"hh:mm:ss",value:"hh:mm:ss"},{label:"hh:mm",value:"hh:mm"},{label:"hh",value:"hh"}]},fn:(t,e)=>Ve(t).format(e)},"hh:mm:ss":{label:"hh:mm:ss (Deprecated, use Format instead)",fn:t=>Ve(t).format("hh:mm:ss")},"hh:mm":{label:"hh:mm (Deprecated, use Format instead)",fn:t=>Ve(t).format("hh:mm")},hh:{label:"hh (Deprecated, use Format instead)",fn:t=>Ve(t).format("hh")}},number:{Precision:{schema:{"x-component":"Select",enum:[{label:"1",value:0},{label:"1.0",value:1},{label:"1.00",value:2},{label:"1.000",value:3}]},fn:(t,e)=>Number(t.toFixed(e))},Separator:{schema:{"x-component":"Select",enum:[{label:"100,000.00",value:"en-US"},{label:"100.000,00",value:"de-DE"},{label:"100 000.00",value:"ru-RU"}]},fn:(t,e)=>{switch(e){case"en-US":return t.toLocaleString("en-US",{minimumFractionDigits:2});case"de-DE":return t.toLocaleString("de-DE",{minimumFractionDigits:2});case"ru-RU":return t.toLocaleString("ru-RU",{minimumFractionDigits:2});default:return t}}},Percent:t=>new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2}).format(t),Currency:{label:"Currency (Deprecated, use Separator & Prefix instead)",fn:(t,e="en-US")=>{const n={"zh-CN":"CNY","en-US":"USD","ja-JP":"JPY","ko-KR":"KRW","pt-BR":"BRL","ru-RU":"RUB","tr-TR":"TRY","es-ES":"EUR"}[e]||"USD";return new Intl.NumberFormat(e,{style:"currency",currency:n}).format(t)}},Exponential:t=>(+t).toExponential(),Abbreviation:(t,e="en-US")=>new Intl.NumberFormat(e,{notation:"compact"}).format(t)},string:{"Type conversion":{schema:{"x-component":"Select",enum:[{label:"Number",value:"Number"},{label:"Date",value:"Date"}]},fn:(t,e)=>{try{return new Function(`return ${e}(${t})`)()}catch(n){return console.log(n),t}}}}},WB=t=>function(){const n=dt.useField(),r=n.query("query").get("value")||{},i=il(t,r),o=Object.keys(Ro).filter(a=>a!=="general");return{onChange:a=>{n.value=a;const s=n.query(".type").take();a||s.setState({value:null});const l=i.find(h=>h.value===a);s.dataSource=o.map(h=>({label:At(h),value:h}));const c={createdAt:"datetime",updatedAt:"datetime",double:"number",integer:"number",percent:"number"},u=l==null?void 0:l.interface,f=l==null?void 0:l.type,d=c[u]||c[f]||f;if(o.includes(d)){s.setState({value:d});return}s.setState({value:null})}}},GB=()=>{const t=dt.useField();return{options:Object.keys(Ro).filter(r=>r!=="general").map(r=>({label:At(r),value:r})),onChange:r=>{t.value=r,t.query(".format").take().setValue(null)}}},HB=()=>{const t=dt.useField();return{onChange:e=>{t.value=e,t.query(".argument").take().setValue(null)}}},UB=t=>{const e=t.query(".type").get("value");if(!e){t.dataSource=[];return}const n=Object.entries(tt(tt({},Ro.general),Ro[e]||{})).map(([r,i])=>{const o=typeof i=="function"?r:i.label||r;return{label:At(o),value:r}});t.dataSource=n},VB=t=>{const e=t.query(".type").get("value"),n=t.query(".format").get("value");if(!n||!e){t.setComponentProps({schema:null});return}const r=Ro[e][n]||Ro.general[n];if(!r||typeof r=="function"){t.setComponentProps({schema:null});return}const i=Fo.uid();t.setComponentProps({schema:tt({name:i},r.schema)})},XB=(t,e="en-US")=>{const n=(t||[]).filter(i=>i.field&&i.type&&i.format).reduce((i,o)=>{const a=Ro[o.type][o.format]||Ro.general[o.format];return a&&(i[o.field]=[...i[o.field]||[],{transformer:a,argument:o.argument}]),i},{}),r={};return Object.entries(n).forEach(([i,o])=>{r[i]=o.reduce((a,s)=>{const{transformer:l}=s;let{argument:c}=s;return u=>{try{return typeof l=="function"?l(a(u),c):(!c&&!l.schema&&(c=e),l.fn(a(u),c))}catch(f){return console.log(f),u}}},a=>a)}),r};function lu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var qB=function(e){return KB(e)&&!ZB(e)};function KB(t){return!!t&&typeof t=="object"}function ZB(t){var e=Object.prototype.toString.call(t);return e==="[object RegExp]"||e==="[object Date]"||t7(t)}var QB=typeof Symbol=="function"&&Symbol.for,JB=QB?Symbol.for("react.element"):60103;function t7(t){return t.$$typeof===JB}function e7(t){return Array.isArray(t)?[]:{}}function cu(t,e){return e.clone!==!1&&e.isMergeableObject(t)?al(e7(t),t,e):t}function n7(t,e,n){return t.concat(e).map(function(r){return cu(r,n)})}function r7(t,e){if(!e.customMerge)return al;var n=e.customMerge(t);return typeof n=="function"?n:al}function i7(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[]}function RS(t){return Object.keys(t).concat(i7(t))}function BS(t,e){try{return e in t}catch(n){return!1}}function o7(t,e){return BS(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))}function a7(t,e,n){var r={};return n.isMergeableObject(t)&&RS(t).forEach(function(i){r[i]=cu(t[i],n)}),RS(e).forEach(function(i){o7(t,i)||(BS(t,i)&&n.isMergeableObject(e[i])?r[i]=r7(i,n)(t[i],e[i],n):r[i]=cu(e[i],n))}),r}function al(t,e,n){n=n||{},n.arrayMerge=n.arrayMerge||n7,n.isMergeableObject=n.isMergeableObject||qB,n.cloneUnlessOtherwiseSpecified=cu;var r=Array.isArray(e),i=Array.isArray(t),o=r===i;return o?r?n.arrayMerge(t,e,n):a7(t,e,n):cu(e,n)}al.all=function(e,n){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(r,i){return al(r,i,n)},{})};var s7=al,l7=s7;const c7=lu(l7),u7=()=>({title:'{{t("Options")}}',type:"array","x-decorator":"FormItem","x-component":"ArrayItems",items:{type:"object","x-decorator":"ArrayItems.Item",properties:{space:{type:"void","x-component":"Space",properties:{label:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Option label")}}'},required:!0},value:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Option value")}}'},required:!0},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:"Add","x-component":"ArrayItems.Addition"}}}),ky=t=>{const e={type:"boolean","x-content":'{{ t("Show time") }}',"x-decorator":"FormItem","x-component":"Checkbox"},n={type:"string",title:'{{t("Date format")}}',"x-component":"Radio.Group","x-decorator":"FormItem",default:"YYYY-MM-DD",enum:[{label:'{{t("Year/Month/Day")}}',value:"YYYY/MM/DD"},{label:'{{t("Year-Month-Day")}}',value:"YYYY-MM-DD"},{label:'{{t("Day/Month/Year")}}',value:"DD/MM/YYYY"}]},r=u7();return{DatePicker:{type:"object",properties:{dateFormat:n,showTime:e}},"DatePicker.RangePicker":{type:"object",properties:{dateFormat:n,showTime:e}},Select:{type:"object",properties:{mode:{type:"string",enum:[{label:'{{ t("Single select") }}',value:""},{label:'{{ t("Multiple select") }}',value:"multiple"}],"x-decorator":"FormItem","x-component":"Radio.Group","x-component-props":{defaultValue:""}},options:r}},"Checkbox.Group":{type:"object",properties:{options:r}},"Radio.Group":{type:"object",properties:{options:r}}}[t]},f7=(t,e)=>{if(!t)return t;if(Ve.isDayjs(t))return e.showTime||(t=t.startOf("day")),My.moment2str(t,e);if(Array.isArray(t)&&t.length&&Ve.isDayjs(t[0])){let n=t[0],r=t[1];return e.showTime&&(n=n.startOf("day"),r=r.endOf("day")),[n.toISOString(),r.toISOString()]}return t},zS=(t,e)=>Cr(this,null,function*(){const n=t.initialValue;if(!(typeof n=="string"&&(n==null?void 0:n.startsWith("{{$"))&&(n==null?void 0:n.endsWith("}}")))||!e)t.setValue(n),t.setInitialValue(n);else{t.loading=!0;const i=yield e.parseVariable(n),o=f7(i,t.componentProps);t.setValue(o),t.setInitialValue(o),t.loading=!1}}),hh="-",uu=(t,e)=>t?`${t}${hh}${e}`:e,YS=t=>{const[e,n]=t.split(hh);return n?{dataSource:e,fieldName:n}:{dataSource:z.DEFAULT_DATA_SOURCE_KEY,fieldName:e}},Ly=(t,e,n)=>dt.Schema.isSchemaInstance(t)?t.reduceProperties((r,i)=>{let o=i[e];if(o.includes(hh)||(o=`${z.DEFAULT_DATA_SOURCE_KEY}${hh}${o}`),o===n)return i;if(i["x-component"]!=="Action.Container"&&i["x-component"]!=="AssociationField.Viewer"){const a=Ly(i,e,n);if(a)return a}return r}):null,Ny=()=>{const{charts:t}=q.useContext(ol),e=q.useMemo(()=>Object.values(t).filter(i=>i).reduce((i,o)=>{var l;const{dataSource:a,collection:s}=o;return(l=i[a])!=null&&l.includes(s)||(i[a]=[...i[a]||[],s]),i},{}),[t]),n=q.useMemo(()=>Object.keys(e).length>1,[e]),r=q.useCallback((i,o)=>{var a;return((a=e[i])==null?void 0:a.includes(o))||!1},[e]);return{chartCollections:e,showDataSource:n,getIsChartCollectionExists:r}},sl=()=>{const t=z.useDataSourceManager(),{charts:e}=q.useContext(ol),{fieldSchema:n}=z.useActionContext(),r=n==null?void 0:n["x-action"],{fields:i,form:o}=q.useContext(Tr),a=({dataSource:h,collection:p,cm:v,fim:g})=>{const y=v.getCollectionFields(p.name),m=(_,S,E,M)=>{var j,L,I,$,F;const P=((j=_.uiSchema)==null?void 0:j.title)||_.name,C=g.getFieldInterface(_.interface),A=(I=(L=C==null?void 0:C.filterable)==null?void 0:L.operators)==null?void 0:I[0],T=v.getCollection(_.target);S=S?`${S} / ${P}`:P;let k={type:"string",title:S,name:`${E}.${_.name}`,required:!1,"x-designer":"ChartFilterItemDesigner","x-component":"CollectionField","x-decorator":"ChartFilterFormItem","x-data-source":h,"x-collection-field":`${M}.${_.name}`,"x-component-props":pt(tt({},($=_.uiSchema)==null?void 0:$["x-component-props"]),{"filter-operator":A})};if(_.interface==="formula"){const R=MB(_.dataType)||"Input";k=pt(tt({},k),{"x-component":R})}return["oho","o2m"].includes(_.interface)&&rn.set(k,"x-component-props.useOriginalFilter",!0),{key:`${E}.${_.name}`,name:_.name,type:"item",title:((F=_==null?void 0:_.uiSchema)==null?void 0:F.title)||_.name,Component:"CollectionFieldInitializer",find:Ly,remove:(R,B)=>{B(R,{breakRemoveOn:{"x-component":"Grid"}})},schemaInitialize:R=>{var B;(B=C==null?void 0:C.schemaInitialize)==null||B.call(C,R,{field:_,block:"FilterForm",readPretty:o.readPretty,action:r,targetCollection:T})},schema:k}},b=(_,S,E,M)=>{var k;const P=((k=_.uiSchema)==null?void 0:k.title)||_.name;S=S?`${S} / ${P}`:P;const C=_.operators[0];let A=pt(tt({type:"string",name:`${E}.${_.name}`,required:!1,"x-designer":"ChartFilterItemDesigner","x-decorator":"ChartFilterFormItem","x-data-source":h,"x-collection-field":`${M}.${_.name}`},_.schema),{title:S,"x-component-props":{"filter-operator":C}});return C!=null&&C.noValue&&(A=pt(tt({},A),{"x-component":"ChartFilterCheckbox","x-component-props":pt(tt({},A["x-component-props"]),{content:dt.Schema.compile(C.label,{t:z.i18n.t})})})),{key:`${E}.${_.name}`,name:_.name,type:"item",title:_.title||_.name,Component:"CollectionFieldInitializer",find:Ly,remove:(N,j)=>{j(N,{breakRemoveOn:{"x-component":"Grid"}})},schema:A}},x=(_,S,E,M,P)=>{var j,L,I;if(!_.interface||_.isForeignKey)return;const C=g.getFieldInterface(_.interface);if(!(C!=null&&C.filterable))return;const{nested:A,children:T}=C.filterable,k=((j=_.uiSchema)==null?void 0:j.title)||_.name,N=m(_,E,M,P);if(!(_.target&&S>2)){if(E=E?`${E} / ${k}`:k,T!=null&&T.length&&!["chinaRegion","createdBy","updatedBy","attachment"].includes(_.interface)){const $=T.map(F=>b(F,E,`${M}.${_.name}`,`${P}.${_.name}`));return{key:`${M}.${_.name}`,name:_.name,type:"subMenu",title:((L=_==null?void 0:_.uiSchema)==null?void 0:L.title)||_.name,children:$}}if(!S||S>2)return N;if(A){const F=v.getCollectionFields(_.target).map(R=>x(R,S+1,"",`${M}.${_.name}`,`${P}.${_.name}`));return{key:`${M}.${_.name}`,name:_.name,type:"subMenu",title:((I=_==null?void 0:_.uiSchema)==null?void 0:I.title)||_.name,children:F.filter(Boolean)}}return N}},w=[],O=[];return y.forEach(_=>{const S=_.interface,E=x(_,0,"",uu(h,p.name),p.name);if(E&&w.push(E),["m2o"].includes(S)){const M=x(_,1,"",uu(h,p.name),p.name);M&&O.push(M)}}),O.length&&w.push({name:"divider",type:"divider"},{name:"displayAssociationFields",type:"itemGroup",title:z.i18n.t("Display association fields"),children:O}),w},s=()=>{const h=(o==null?void 0:o.values)||{},p={};return Object.entries(i).filter(([v,g])=>g).forEach(([v,g])=>{const{operator:y}=g||{},{dataSource:m,fieldName:b}=YS(v);let x=b;const _=t.getDataSource(m).collectionManager.getCollectionField(x);if(_!=null&&_.target){const C=_.targetKey||"id";x=`${x}.${C}`,v=`${v}.${C}`}const[S,...E]=x.split("."),M=EB(h,v),P=(y==null?void 0:y.value)||"$eq";if(S!=="custom"){const C=uu(m,S);p[C]=p[C]||{$and:[]};const A={};rn.set(A,E.join("."),{[P]:M}),p[C].$and.push(A)}else p[S]=p[S]||{},p[S][`$nFilter.${E.join(".")}`]=M}),p},l=(h,p)=>{if(!h)return!1;const{dataSource:v,collection:g,query:y}=h,{parameters:m}=My.parse(y.filter||"");return p[uu(v,g)]||p.custom&&(m==null?void 0:m.find(({key:b})=>rn.has(p.custom,b)))},c=(h,p)=>{const{dataSource:v,collection:g,query:y}=h;let m=tt({},y);const b=tt({},m.filter||{});let x={};const w=My.parse(b),{parameters:O}=w;return p.custom&&(O!=null&&O.find(_=>p.custom[_.key]))&&(x=w(p.custom)),x=c7(b,x),m=pt(tt({},m),{filter:{$and:[x,p[uu(v,g)]]}}),m},u=()=>Cr(this,null,function*(){const h=s(),p=Object.values(e).filter(v=>l(v,h)).map(v=>()=>Cr(this,null,function*(){const{dataSource:g,service:y,collection:m}=v;yield y.runAsync(g,m,c(v,h),!0)}));yield Promise.all(p.map(v=>v()))}),f=()=>Cr(this,null,function*(){const h=Object.values(e).filter(p=>p).map(p=>()=>Cr(this,null,function*(){const{service:v,dataSource:g,collection:y,query:m}=p;yield v.runAsync(g,y,m,!0)}));yield Promise.all(h.map(p=>p()))}),d=Ei.useMemoizedFn(h=>h.split(" / ").map(p=>z.i18n.t(dt.Schema.compile(p,{t:z.i18n.t}))).join(" / "));return{filter:u,refresh:f,getChartFilterFields:a,getFilter:s,hasFilter:l,appendFilter:c,getTranslatedTitle:d}},d7=()=>{const{t}=se(),e=Ei.useMemoizedFn(t),{enabled:n,fields:r}=q.useContext(Tr),i=Object.entries(r).filter(([a,s])=>a.startsWith("custom.")&&s).map(([a,{title:s}])=>{const l=a.replace(/^custom\./,"");return{key:l,value:l,label:s}}),o=q.useMemo(()=>({label:e("Current filter"),value:"$nFilter",key:"$nFilter",children:i}),[i,e]);return!n||!i.length?null:o},WS=()=>{const{t}=se(),{chartCollections:e}=Ny(),n=z.useDataSourceManager(),r=n.collectionFieldInterfaceManager,{values:i}=GS(),o=(a,s,l)=>{var d,h,p;if(!s.interface)return;const c=r.getFieldInterface(s.interface);if(!(c!=null&&c.filterable))return;const{nested:u}=c.filterable,f={value:s.name,label:t(((d=s==null?void 0:s.uiSchema)==null?void 0:d.title)||s.name)};if(!(s.target&&l>2)){if(l>2)return f;if(u){const g=a.getCollectionFields(s.target).map(y=>o(a,y,l+1));return{value:s.name,label:t(((h=s==null?void 0:s.uiSchema)==null?void 0:h.title)||s.name),children:g.filter(y=>y)}}if(!(!i.includes((p=s.uiSchema)==null?void 0:p["x-component"])&&!i.includes(s.interface)))return f}};return q.useMemo(()=>Object.entries(e).map(([s,l])=>{const c=n.getDataSource(s);return{value:s,label:dt.Schema.compile(c.displayName,{t}),children:l.map(u=>{const f=c.collectionManager,d=f.getCollection(u),p=f.getCollectionFields(u).map(v=>o(f,v,1)).filter(v=>v);return{value:u,label:dt.Schema.compile(d.title,{t}),children:p}})}}),[e])},GS=()=>{const{t}=se(),e=[{label:t("Input"),value:"Input"},{label:t("Number"),value:"InputNumber"},{label:t("Date"),value:"DatePicker"},{label:t("Date range"),value:"DatePicker.RangePicker"},{label:t("Time"),value:"TimePicker"},{label:t("Time range"),value:"TimePicker.RangePicker"},{label:t("Select"),value:"Select"},{label:t("Radio group"),value:"Radio.Group"},{label:t("Checkbox group"),value:"Checkbox.Group"}];return{options:e,values:e.map(n=>n.value)}},h7=(t,e)=>{const{t:n}=se(),r=z.useDataSourceManager(),{showDataSource:i}=Ny();return q.useMemo(()=>{var p;const o=r.getDataSource(t);if(!o)return;const a=o.collectionManager;if(!e)return;const{fieldName:s}=YS(e),[l,...c]=s.split(".");if(!(c!=null&&c.length))return;const u=a.getCollection(l);let f=l,d,h=dt.Schema.compile(u==null?void 0:u.title,{t:n});for(;f&&c.length>0;){const v=c.shift();d=a.getCollectionField(`${f}.${v}`);const g=((p=d==null?void 0:d.uiSchema)==null?void 0:p.title)||(d==null?void 0:d.name);g&&(h+=` / ${dt.Schema.compile(g,{t:n})}`),d!=null&&d.target?f=d.target:f=null}return i?`${dt.Schema.compile(o.displayName,{t:n})} > ${h}`:h},[e,t,i])},p7=()=>{const t=dt.useField(),{operator:e,schema:n}=t.data||{},{currentUserSettings:r}=z.useCurrentUserVariable({collectionField:{uiSchema:n},uiSchema:n}),{datetimeSettings:i}=z.useDatetimeVariable({operator:e,schema:n}),o=d7(),a=q.useMemo(()=>[r,i,o].filter(Boolean),[i,r,o]);return!e||!n?[]:a},Iy=(t={},e={})=>pt(tt({type:"array","x-decorator":"FormItem","x-component":"ArrayItems"},e),{items:{type:"object",properties:{space:{type:"void","x-component":"Space",properties:pt(tt({sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"}},t),{remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}})}}},properties:{add:{type:"void",title:'{{t("Add field")}}',"x-component":"ArrayItems.Addition"}}}),v7=t=>({type:"void",properties:{config:{type:"object",properties:{collapse:{type:"void","x-component":"FormCollapse","x-component-props":{formCollapse:"{{formCollapse}}",size:"small",style:{border:"none",boxShadow:"none"}},properties:{pane1:{type:"void","x-component":"FormCollapse.CollapsePanel","x-component-props":{header:At("Container"),key:"card"},properties:{title:{type:"string",title:'{{t("Title")}}',"x-decorator":"FormItem","x-component":"Input"},bordered:{type:"boolean","x-content":At("Show border"),"x-decorator":"FormItem","x-component":"Checkbox",default:!1}}},pane2:{type:"void","x-component":"FormCollapse.CollapsePanel","x-component-props":{header:At("Chart"),key:"basic",style:{border:"none"}},properties:{chartType:{type:"string",title:'{{t("Chart type")}}',"x-decorator":"FormItem","x-component":"Select","x-component-props":{placeholder:'{{t("Please select a chart type.")}}'},enum:"{{ chartTypes }}"},[Fo.uid()]:{type:"void",properties:{general:t}},[Fo.uid()]:{type:"void",properties:{advanced:{type:"json",title:'{{t("JSON config")}}',"x-decorator":"FormItem","x-decorator-props":{extra:At("Same properties set in the form above will be overwritten by this JSON config.")},"x-component":"Input.JSON","x-component-props":{autoSize:{minRows:3}}}}},reference:{type:"string","x-reactions":{dependencies:[".chartType"],fulfill:{schema:{"x-content":"{{ getReference($deps[0]) }}"}}}}}}}}}}}}),g7={type:"void",properties:{settings:{type:"void",properties:{collection:{title:'{{t("Collection")}}',type:"string","x-decorator":"FormItem","x-component":"Cascader",enum:"{{ collectionOptions }}","x-component-props":{onChange:"{{ onCollectionChange }}",placeholder:'{{t("Collection")}}'}}}},query:{type:"object",properties:{builder:{type:"void",properties:{collapse:{type:"void","x-decorator":"FormItem","x-component":"FormCollapse","x-component-props":{formCollapse:"{{formCollapse}}",size:"small",style:{border:"none",boxShadow:"none"}},properties:{pane1:{type:"void","x-component":"FormCollapse.CollapsePanel","x-component-props":{header:At("Measures"),key:"measures"},properties:{measures:Iy({field:{type:"string","x-decorator":"FormItem","x-component":"Cascader","x-component-props":{placeholder:'{{t("Field")}}',fieldNames:{label:"title",value:"name",children:"children"}},enum:"{{ fieldOptions }}",required:!0},aggregation:{type:"string","x-decorator":"FormItem","x-component":"Select","x-component-props":{placeholder:'{{t("Aggregation")}}'},enum:[{label:'{{t("Sum")}}',value:"sum"},{label:'{{t("Count")}}',value:"count"},{label:'{{t("Avg")}}',value:"avg"},{label:'{{t("Max")}}',value:"max"},{label:'{{t("Min")}}',value:"min"}]},alias:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Alias")}}',style:{minWidth:"100px"}}}},{required:!0,"x-component-props":{style:{overflow:"auto"}}})}},pane2:{type:"void","x-component":"FormCollapse.CollapsePanel","x-component-props":{header:At("Dimensions"),key:"dimensions"},properties:{dimensions:Iy({field:{type:"string","x-decorator":"FormItem","x-component":"Cascader","x-component-props":{placeholder:'{{t("Field")}}',fieldNames:{label:"title",value:"name",children:"children"}},enum:"{{ fieldOptions }}",required:!0},format:{type:"string","x-decorator":"FormItem","x-component":"Select","x-component-props":{placeholder:'{{t("Format")}}',style:{maxWidth:"120px"}},"x-reactions":"{{ useFormatterOptions }}","x-visible":"{{ $self.dataSource && $self.dataSource.length }}"},alias:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Alias")}}',style:{minWidth:"100px"}}}},{"x-component-props":{style:{overflow:"auto"}}})}},pane3:{type:"void","x-component":"FormCollapse.CollapsePanel","x-component-props":{header:At("Filter"),key:"filter"},properties:{filter:{type:"object","x-decorator":"FormItem","x-decorator-props":{style:{overflow:"auto"}},enum:"{{ filterOptions }}","x-component":"Filter","x-component-props":{dynamicComponent:"FilterDynamicComponent"}}}},pane4:{type:"void","x-component":"FormCollapse.CollapsePanel","x-component-props":{header:At("Sort"),key:"sort",style:{border:"none"}},properties:{orders:Iy({field:{type:"string","x-decorator":"FormItem","x-component":"Cascader","x-component-props":{placeholder:'{{t("Field")}}'},"x-reactions":"{{ useOrderOptions }}",required:!0},order:{type:"string","x-decorator":"FormItem","x-component":"Radio.Group","x-component-props":{defaultValue:"ASC",optionType:"button",style:{width:"128px"}},enum:["ASC","DESC"]}},{"x-reactions":"{{ useOrderReaction }}","x-component-props":{style:{overflow:"auto"}}})}}}},limit:{title:'{{t("Limit")}}',type:"number","x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{defaultValue:2e3,min:1,style:{width:"100px"}}}}},cache:{type:"object",properties:{enabled:{type:"boolean",title:'{{t("Enable cache")}}',"x-decorator":"FormItem","x-component":"Switch"},ttl:{type:"number",title:'{{t("TTL (second)")}}',"x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{defaultValue:60,min:1,style:{width:"100px"}}}}}}}}},y7={type:"void",properties:{transform:{type:"array","x-decorator":"FormItem","x-component":"ArrayItems",items:{type:"object",properties:{space:{type:"void","x-component":"Space","x-component-props":{wrap:!0},properties:{sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"},field:{type:"string","x-decorator":"FormItem","x-component":"Select","x-component-props":{placeholder:'{{t("Field")}}'},"x-use-component-props":"useFieldSelectProps","x-reactions":"{{ useChartFields }}"},type:{type:"string","x-decorator":"FormItem","x-component":"Select","x-component-props":{placeholder:'{{t("Type")}}'},"x-use-component-props":"useFieldTypeSelectProps"},format:{type:"string","x-decorator":"FormItem","x-component":"Select","x-component-props":{placeholder:'{{t("Transformer")}}',style:{maxWidth:"200px"}},"x-use-component-props":"useTransformerSelectProps","x-reactions":"{{ useTransformers }}","x-visible":"{{ $self.dataSource && $self.dataSource.length }}"},argument:{type:"string","x-decorator":"FormItem","x-component":"TransformerDynamicComponent","x-reactions":"{{ useArgument }}"},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:'{{t("Add transformation")}}',"x-component":"ArrayItems.Addition"}}}}};function m7(t){const{value:e,onChange:n,renderSchemaComponent:r}=t,i=p7();return Y.jsx(z.Variable.Input,{value:e,onChange:n,scope:i,children:r()})}const Mi=q.createContext({visible:!0});Mi.displayName="ChartConfigContext";const b7=t=>{var a;const{insertAdjacent:e}=z.useDesignable(),[n,r]=q.useState(!1),[i,o]=q.useState({});return Y.jsxs(Mi.Provider,{value:{visible:n,setVisible:r,current:i,setCurrent:o},children:[t.children,Y.jsx(IS,pt(tt({},(a=i.field)==null?void 0:a.decoratorProps),{children:Y.jsx(ii,{insert:(s,l)=>e("beforeEnd",s,l)})}))]})},x7=t=>{const{schema:e}=t,n=dt.useField();return e?Y.jsx(z.SchemaComponent,{schema:{type:"void",properties:{[e.name]:pt(tt({type:"void"},e),{value:n.value,"x-component-props":pt(tt({},e["x-component-props"]),{defaultValue:n.value,onChange:r=>{if(typeof r=="object"&&(r!=null&&r.target)){n.value=r.target.value;return}n.value=r}})})}}}):null},{Paragraph:IMt,Text:w7}=wt.Typography,ii=t=>{const{t:e}=se(),{service:n}=q.useContext(ri),{visible:r,setVisible:i,current:o}=q.useContext(Mi),{schema:a,field:s,dataSource:l,collection:c,initialValues:u}=o||{},{dn:f}=z.useDesignable(),{modal:d}=wt.App.useApp(),{insert:h}=t,p=DS(),v=Ha(l,c),g=(P=!1)=>{var I;if(!_.modified)return;const C=(I=_.values.config)==null?void 0:I.chartType;if(!C)return;const A=p[C];if(!(A==null?void 0:A.init)){P&&(_.values.config.general={},_.values.config.advanced={});return}const k=_.values.query,N=il(v,k),{general:j,advanced:L}=A.init(N,k);(j||P)&&(_.values.config.general=j),(L||P)&&(_.values.config.advanced=L||{})},[y,m]=q.useState([]),[b,x]=q.useState([]),w=(P,C)=>{var k,N;const A=((k=P.values.query)==null?void 0:k.measures.filter(j=>j.field))||[],T=((N=P.values.query)==null?void 0:N.dimensions.filter(j=>j.field))||[];rn.isEqual(A,y)&&rn.isEqual(T,b)||(C==null||C(),m(rn.cloneDeep(A)),x(rn.cloneDeep(T)))},O=kB(),_=q.useMemo(()=>{var A;const P=u||(s==null?void 0:s.decoratorProps),C=(P==null?void 0:P.config)||{};return wn.createForm({values:pt(tt({},P),{config:pt(tt({chartType:O},C),{title:C.title||((A=s==null?void 0:s.componentProps)==null?void 0:A.title)}),collection:[l,c]}),effects:T=>{wn.onFieldChange("config.chartType",()=>g(!0)),wn.onFormInit(()=>w(T))}})},[s,r,l,c]),S=()=>Y.jsx(wt.Button,{type:"link",loading:n==null?void 0:n.loading,icon:Y.jsx(Nn.RightSquareOutlined,{}),onClick:()=>Cr(this,null,function*(){const P=_.query("query").take();try{yield P==null?void 0:P.validate()}catch(C){return}try{yield n.runAsync(l,c,_.values.query,!0)}catch(C){console.log(C)}w(_,g)}),children:e("Run query")}),E=q.useRef(null),M=q.useRef(null);return q.useEffect(()=>{var P;r&&n.run(c,(P=s==null?void 0:s.decoratorProps)==null?void 0:P.query,"configure")},[r]),Y.jsx(wt.Modal,{title:e("Configure chart"),open:r,onOk:()=>{const{query:P,config:C,transform:A,mode:T}=_.values,{title:k,bordered:N}=C||{},j=()=>{var I;i(!1),(I=o.service)==null||I.run(l,c,P),E.current.scrollTop=0,M.current.scrollTop=0,n.mutate(void 0)},L={query:P,config:C,dataSource:l,collection:c,transform:A,mode:T||"builder"};if(a&&a["x-uid"]){a["x-component-props"]=pt(tt({},a["x-component-props"]),{title:k,bordered:N}),a["x-decorator-props"]=L,s.decoratorProps=L,s.componentProps=pt(tt({},s.componentProps),{title:k,bordered:N}),s["x-acl-action"]=`${c}:list`,f.emit("patch",{schema:a}),j();return}h(z.gridRowColWrap(NS(L)),{onSuccess:j})},onCancel:()=>{d.confirm({title:e("Are you sure to cancel?"),content:e("You changes are not saved. If you click OK, your changes will be lost."),okButtonProps:{danger:!0},onOk:()=>{i(!1),E.current.scrollTop=0,M.current.scrollTop=0,n.mutate(void 0)}})},width:"95%",className:Ga.css`
2
2
  .ant-modal-content {
3
3
  padding: 0;
4
4
  }
@@ -10,12 +10,12 @@
10
10
  margin-bottom: 15px;
11
11
  }
12
12
  `,children:Y.jsx(z.SchemaComponent,{schema:y7,components:{FormItem:ae.FormItem,ArrayItems:ae.ArrayItems,Space:wt.Space,TransformerDynamicComponent:x7,Select:z.withDynamicSchemaProps(z.Select)},scope:{useChartFields:r,useTransformers:UB,useTransformerSelectProps:HB,useFieldSelectProps:WB(n),useFieldTypeSelectProps:GB,useArgument:VB,t:e}})})]})},ii.Data=function(){var a,s,l,c;const{service:e}=q.useContext(ri),{current:n}=q.useContext(Mi),r=Ha(),i=FS(n==null?void 0:n.data),o=e==null?void 0:e.error;return o?Y.jsx(wt.Alert,{message:"Error",type:"error",description:((c=(l=(s=(a=o==null?void 0:o.response)==null?void 0:a.data)==null?void 0:s.errors)==null?void 0:l.map)==null?void 0:c.call(l,u=>u.message).join(`
13
- `))||o.message,showIcon:!0}):Y.jsx(wt.Table,{dataSource:i.map((u,f)=>vt(tt({},u),{_key:f})),rowKey:"_key",scroll:{x:"max-content"},columns:Object.keys(i[0]||{}).map(u=>{const f=dh(r,u.split("."));return{title:(f==null?void 0:f.label)||u,dataIndex:u,key:u}}),size:"small"})};const O7=()=>{const{t}=se();return Y.jsx(z.GeneralSchemaDesigner,{disableInitializer:!0,title:t("Filter"),showDataSource:!1,children:Y.jsx(z.SchemaSettingsRemove,{breakRemoveOn:{"x-component":"ChartV2Block"}})})},_7=()=>({type:"void","x-action":"filter","x-decorator":"ChartFilterBlockProvider","x-component":"CardItem","x-component-props":{size:"small"},"x-designer":"ChartFilterBlockDesigner",properties:{[Fo.uid()]:{type:"void","x-component":"ChartFilterForm",properties:{grid:{type:"void","x-component":"ChartFilterGrid","x-initializer":"chartFilterForm:configureFields",properties:{}},actions:{type:"void","x-initializer":"chartFilterForm:configureActions","x-component":"ActionBar","x-component-props":{layout:"one-column",style:{float:"right",marginTop:8}},properties:{}}}}}}),S7=t=>{const{collapse:{collapsed:e}}=q.useContext(Tr),{token:n}=wt.theme.useToken();return Y.jsx("div",{className:Ga.css`
13
+ `))||o.message,showIcon:!0}):Y.jsx(wt.Table,{dataSource:i.map((u,f)=>pt(tt({},u),{_key:f})),rowKey:"_key",scroll:{x:"max-content"},columns:Object.keys(i[0]||{}).map(u=>{const f=dh(r,u.split("."));return{title:(f==null?void 0:f.label)||u,dataIndex:u,key:u}}),size:"small"})};const O7=()=>{const{t}=se();return Y.jsx(z.GeneralSchemaDesigner,{disableInitializer:!0,title:t("Filter"),showDataSource:!1,children:Y.jsx(z.SchemaSettingsRemove,{breakRemoveOn:{"x-component":"ChartV2Block"}})})},_7=()=>({type:"void","x-action":"filter","x-decorator":"ChartFilterBlockProvider","x-component":"CardItem","x-component-props":{size:"small"},"x-designer":"ChartFilterBlockDesigner",properties:{[Fo.uid()]:{type:"void","x-component":"ChartFilterForm",properties:{grid:{type:"void","x-component":"ChartFilterGrid","x-initializer":"chartFilterForm:configureFields",properties:{}},actions:{type:"void","x-initializer":"chartFilterForm:configureActions","x-component":"ActionBar","x-component-props":{layout:"one-column",style:{float:"right",marginTop:8}},properties:{}}}}}}),S7=t=>{const{collapse:{collapsed:e}}=q.useContext(Tr),{token:n}=wt.theme.useToken();return Y.jsx("div",{className:Ga.css`
14
14
  .ant-nb-grid {
15
15
  overflow: hidden;
16
16
  height: ${e?`${n.controlHeight*2}px`:"auto"};
17
17
  }
18
- `,children:Y.jsx(z.Grid,vt(tt({},t),{children:t.children}))})},HS=()=>{var c;const{insertAdjacent:t}=z.useDesignable(),{setEnabled:e}=q.useContext(Tr),n=z.useSchemaInitializerItem(),{remove:r,disabled:i}=n,o="x-action",a=_7(),{exists:s,remove:l}=z.useCurrentSchema((a==null?void 0:a[o])||((c=n==null?void 0:n.schema)==null?void 0:c[o]),o,n.find,r||n.remove);return Y.jsx(z.SchemaInitializerSwitch,{icon:Y.jsx(Nn.FilterOutlined,{}),checked:s,disabled:i,title:n.title,onClick:()=>{var f;if(i)return;if(s)return e(!1),l();const u=Fo.merge(a||{},n.schema||{});(f=n==null?void 0:n.schemaInitialize)==null||f.call(n,u),t("afterBegin",z.gridRowColWrap(u)),e(!0)}})},{Paragraph:E7,Text:M7}=wt.Typography,P7=dt.observer(t=>{const e=dt.useForm(),n=ky(e.values.component);return n?Y.jsx(z.SchemaComponent,tt({schema:n},t)):null},{displayName:"FieldComponentProps"}),A7=({error:t})=>Y.jsx(E7,{copyable:!0,children:Y.jsx(M7,{type:"danger",style:{whiteSpace:"pre-line",textAlign:"center",padding:"5px"},children:t.message})}),C7=dt.observer(t=>{var c,u;se();const e=dt.useField(),n=dt.useFieldSchema(),r=(u=(c=n["x-decorator-props"])==null?void 0:c.showTitle)!=null?u:!0,i=q.useMemo(()=>typeof e.description=="string"?Y.jsx("div",{dangerouslySetInnerHTML:{__html:z.HTMLEncode(e.description).split(`
18
+ `,children:Y.jsx(z.Grid,pt(tt({},t),{children:t.children}))})},HS=()=>{var c;const{insertAdjacent:t}=z.useDesignable(),{setEnabled:e}=q.useContext(Tr),n=z.useSchemaInitializerItem(),{remove:r,disabled:i}=n,o="x-action",a=_7(),{exists:s,remove:l}=z.useCurrentSchema((a==null?void 0:a[o])||((c=n==null?void 0:n.schema)==null?void 0:c[o]),o,n.find,r||n.remove);return Y.jsx(z.SchemaInitializerSwitch,{icon:Y.jsx(Nn.FilterOutlined,{}),checked:s,disabled:i,title:n.title,onClick:()=>{var f;if(i)return;if(s)return e(!1),l();const u=Fo.merge(a||{},n.schema||{});(f=n==null?void 0:n.schemaInitialize)==null||f.call(n,u),t("afterBegin",z.gridRowColWrap(u)),e(!0)}})},{Paragraph:E7,Text:M7}=wt.Typography,P7=dt.observer(t=>{const e=dt.useForm(),n=ky(e.values.component);return n?Y.jsx(z.SchemaComponent,tt({schema:n},t)):null},{displayName:"FieldComponentProps"}),A7=({error:t})=>Y.jsx(E7,{copyable:!0,children:Y.jsx(M7,{type:"danger",style:{whiteSpace:"pre-line",textAlign:"center",padding:"5px"},children:t.message})}),C7=dt.observer(t=>{var c,u;se();const e=dt.useField(),n=dt.useFieldSchema(),r=(u=(c=n["x-decorator-props"])==null?void 0:c.showTitle)!=null?u:!0,i=q.useMemo(()=>typeof e.description=="string"?Y.jsx("div",{dangerouslySetInnerHTML:{__html:z.HTMLEncode(e.description).split(`
19
19
  `).join("<br/>")}}):e.description,[e.description]),o=q.useMemo(()=>Ga.cx(Ga.css`
20
20
  & .ant-space {
21
21
  flex-wrap: wrap;
@@ -24,13 +24,13 @@
24
24
  > .ant-formily-item-label {
25
25
  display: none;
26
26
  }
27
- `]:r===!1}),[r]),a=(n==null?void 0:n["x-data-source"])||z.DEFAULT_DATA_SOURCE_KEY,s=(n==null?void 0:n["x-collection-field"])||"",[l]=s.split(".");return Y.jsx(z.BlockItem,{className:"nb-form-item",children:Y.jsx(z.CollectionManagerProvider,{dataSource:a,children:Y.jsx(z.CollectionProvider,{name:l,allowNull:!l,children:Y.jsx(z.CollectionFieldProvider,{name:n.name,allowNull:!n["x-collection-field"],children:Y.jsx(z.ACLCollectionFieldProvider,{children:Y.jsx(LS,{onError:f=>console.log(f),FallbackComponent:A7,children:Y.jsx(ae.FormItem,vt(tt({className:o},t),{extra:i}))})})})})})})},{displayName:"ChartFilterFormItem"}),US=q.memo(t=>{const{locale:e}=q.useContext(wt.ConfigProvider.ConfigContext),{t:n}=se(),r=Ei.useMemoizedFn(n),{scope:i,components:o}=q.useContext(dt.SchemaOptionsContext),{theme:a}=z.useGlobalTheme(),{insert:s}=t,l=z.useSchemaInitializerItem(),c=z.useDataSourceManager(),u=WS(),{options:f,values:d}=GS(),h=q.useCallback(()=>Cr(this,null,function*(){var w,O;const p=yield z.FormDialog(r("Add custom field"),()=>Y.jsx(z.SchemaComponentOptions,{scope:vt(tt({},i),{useChartFilterSourceFields:WS}),components:vt(tt({},o),{FieldComponentProps:P7}),children:Y.jsxs(ae.FormLayout,{layout:"vertical",children:[Y.jsx(wt.Alert,{type:"info",message:r('To filter with custom fields, use "Current filter" variables in the chart configuration.'),style:{marginBottom:16}}),Y.jsx(wt.ConfigProvider,{locale:e,children:Y.jsx(z.SchemaComponent,{schema:{properties:{name:{type:"string",required:!0},title:{type:"string",title:r("Field title"),"x-component":"Input","x-decorator":"FormItem",required:!0},source:{type:"string",title:r("Field source"),"x-decorator":"FormItem","x-component":"Cascader",enum:u,description:r("Select a source field to use metadata of the field")},component:{type:"string",title:r("Field component"),"x-component":"Select","x-decorator":"FormItem",required:!0,enum:f},props:{type:"object",title:r("Component properties"),"x-component":"FieldComponentProps"}}}})})]})}),a).open({values:{name:`f_${Fo.uid()}`},effects(){wn.onFieldValueChange("source",_=>{if(!_.value)return;const[S,...E]=_.value,M=c.getDataSource(S);if(!M)return;const P=M.collectionManager,C=E.join("."),A=P.getCollectionField(C);if(!A)return;const T=A.uiSchema||{};let k;if(d.includes(T["x-component"])){k=T["x-component"];const j=T["x-component-props"]||{};T.enum&&(j.options=T.enum),_.query(".props").take().setValue(j)}else d.includes(A.interface)&&(k=A.interface);if(!k)return;_.query(".component").take().setValue(k)})}}),{name:v,title:g,component:y,props:m}=p,x=((O=(w=c.collectionFieldInterfaceManager.getFieldInterface(y))==null?void 0:w.default)==null?void 0:O.uiSchema)||{};s(z.gridRowColWrap(vt(tt({"x-component":y},x),{type:"string",title:g,name:`custom.${v}`,required:!1,"x-designer":"ChartFilterItemDesigner","x-decorator":"ChartFilterFormItem","x-component-props":tt(tt({},x["x-component-props"]||{}),m)})))}),[a]);return Y.jsx(z.SchemaInitializerItem,vt(tt(tt({},l),t),{onClick:h}))});US.displayName="ChartFilterCustomItemInitializer";const VS={name:"chartFilterForm:configureFields","data-testid":"configure-fields-button-of-chart-filter-item",wrap:z.gridRowColWrap,icon:"SettingOutlined",title:'{{ t("Configure fields") }}',items:[{type:"itemGroup",name:"displayFields",title:'{{ t("Display fields") }}',useChildren:()=>{const{t}=se(),{chartCollections:e,showDataSource:n}=Ny(),{getChartFilterFields:r}=sl(),i=z.useDataSourceManager(),o=i.collectionFieldInterfaceManager;return q.useMemo(()=>{var s;const a=Object.entries(e).map(([l,c])=>{const u=i.getDataSource(l);return{name:u.key,title:dt.Schema.compile(u.displayName,{t}),type:"subMenu",children:c.map(f=>{const d=u.collectionManager,h=d.getCollection(f),p=r({dataSource:l,collection:h,cm:d,fim:o});return{name:h.key,title:dt.Schema.compile(h.title,{t}),type:"subMenu",children:p}})}});return n?a:((s=a[0])==null?void 0:s.children)||[]},[e,n])}},{name:"divider",type:"divider"},{name:"custom",type:"item",title:At("Custom"),Component:()=>{const{insertAdjacent:t}=z.useDesignable();return Y.jsx(US,{insert:e=>t("beforeEnd",e)})}}]},XS=new z.CompatibleSchemaInitializer(vt(tt({},VS),{name:"ChartFilterItemInitializers"})),T7=new z.CompatibleSchemaInitializer(VS,XS),k7=()=>{const{filter:t}=sl();return{onClick:t}},L7=()=>{const t=dt.useForm(),{filter:e}=sl();return{onClick:()=>Cr(this,null,function*(){t.reset(),yield e()})}},N7=()=>{const{collapse:{collapsed:t},setCollapse:e}=q.useContext(Tr),{t:n}=se();return{onClick:()=>e({collapsed:!t}),title:Y.jsxs(Y.Fragment,{children:[Y.jsx(Nn.DownOutlined,{rotate:t?0:180})," ",n(t?"Expand":"Collapse")]})}},I7=t=>{const{t:e}=se();return Y.jsx(z.GeneralSchemaDesigner,vt(tt({},t),{disableInitializer:!0,children:Y.jsx(z.SchemaSettingsRemove,{breakRemoveOn:n=>n["x-component"]==="Space"||n["x-component"].endsWith("ActionBar"),confirm:{title:e("Delete action")}})}))},j7=t=>{const i=t,{buttonEditorProps:e}=i,n=rB(i,["buttonEditorProps"]),{t:r}=se();return Y.jsxs(z.GeneralSchemaDesigner,vt(tt({},n),{disableInitializer:!0,children:[Y.jsx(z.Action.Designer.ButtonEditor,tt({},e)),Y.jsx(z.SchemaSettingsDivider,{}),Y.jsx(z.SchemaSettingsRemove,{breakRemoveOn:o=>o["x-component"]==="Space"||o["x-component"].endsWith("ActionBar"),confirm:{title:r("Delete action")}})]}))},qS=t=>{const e={title:'{{ t("Filter") }}',"x-action":"submit","x-component":"Action","x-use-component-props":"useChartFilterActionProps","x-designer":"ChartFilterActionDesigner","x-component-props":{htmlType:"submit",type:"primary"}};return Y.jsx(z.ActionInitializer,vt(tt({},t),{schema:e}))},KS=t=>{const e={title:'{{ t("Reset") }}',"x-action":"reset","x-component":"Action","x-use-component-props":"useChartFilterResetProps","x-designer":"ChartFilterActionDesigner"};return Y.jsx(z.ActionInitializer,vt(tt({},t),{schema:e}))},ZS=t=>{const e={title:'{{ t("Collapse") }}',"x-action":"collapse","x-component":"Action","x-use-component-props":"useChartFilterCollapseProps","x-component-props":{type:"link"},"x-designer":"ChartFilterCollapseDesigner"};return Y.jsx(z.ActionInitializer,vt(tt({},t),{schema:e}))},QS=new z.CompatibleSchemaInitializer({name:"ChartFilterActionInitializers","data-testid":"configure-actions-button-of-chart-filter",title:'{{t("Configure actions")}}',icon:"SettingOutlined",items:[{name:"enbaleActions",type:"itemGroup",title:'{{t("Enable actions")}}',children:[{name:"filter",type:"item",title:'{{t("Filter")}}',component:qS,schema:{"x-action-settings":{}}},{name:"reset",type:"item",title:'{{t("Reset")}}',component:KS,schema:{"x-action-settings":{}}},{name:"collapse",type:"item",title:'{{t("Collapse")}}',component:ZS,schema:{"x-action-settings":{}}}]}]}),D7=new z.CompatibleSchemaInitializer({name:"chartFilterForm:configureActions","data-testid":"configure-actions-button-of-chart-filter",title:'{{t("Configure actions")}}',icon:"SettingOutlined",items:[{name:"enbaleActions",type:"itemGroup",title:'{{t("Enable actions")}}',children:[{name:"filter",type:"item",title:'{{t("Filter")}}',component:qS,schema:{"x-action-settings":{}}},{name:"reset",type:"item",title:'{{t("Reset")}}',component:KS,schema:{"x-action-settings":{}}},{name:"collapse",type:"item",title:'{{t("Collapse")}}',component:ZS,schema:{"x-action-settings":{}}}]}]},QS),$7=t=>{var u;const{value:e,onChange:n,fieldSchema:r}=t,{currentUserSettings:i}=z.useCurrentUserVariable({collectionField:{uiSchema:r},uiSchema:r}),{datetimeSettings:o}=z.useDatetimeVariable({operator:(u=r["x-component-props"])==null?void 0:u["filter-operator"],schema:r,noDisabled:!0}),a=q.useMemo(()=>[i,o].filter(Boolean),[o,i]),s=vt(tt({},r),{"x-component":r["x-component"]||"Input","x-decorator":"",title:"",name:"value",default:""}),l=r["x-component-props"]||{},c=Ei.useMemoizedFn(n);return q.useEffect(()=>{r.default&&c({value:r.default})},[r.default,c]),Y.jsx(z.VariableScopeProvider,{scope:a,children:Y.jsx(z.VariableInput,vt(tt({},l),{renderSchemaComponent:()=>Y.jsx(z.SchemaComponent,{schema:s}),fieldNames:{},value:e==null?void 0:e.value,scope:a,onChange:f=>{n({value:f})},shouldChange:z.getShouldChange({})}))})},{Text:F7}=wt.Typography,R7=()=>{const t=dt.useField(),e=dt.useFieldSchema(),{t:n}=se(),{dn:r}=z.useDesignable(),{setField:i}=q.useContext(Tr);return Y.jsx(z.SchemaSettingsModalItem,{title:n("Edit field title"),schema:{type:"object",title:n("Edit field title"),properties:{title:{title:n("Field title"),default:t==null?void 0:t.title,required:!0,"x-decorator":"FormItem","x-component":"Input","x-component-props":{}}}},onSubmit:({title:o})=>{o&&(t.title=o,e.title=o,r.emit("patch",{schema:{"x-uid":e["x-uid"],title:e.title}}),i(e.name,{title:o})),r.refresh()}},"edit-field-title")},B7=()=>{var y,m,b,x;const t=z.useCompile(),e=dt.useFieldSchema(),n=dt.useField(),{t:r}=se(),{dn:i}=z.useDesignable(),{setField:o}=q.useContext(Tr),a=e["x-collection-field"],s=e["x-data-source"]||z.DEFAULT_DATA_SOURCE_KEY,{cm:l,fim:c}=su(s);if(!l)return null;const u=w=>{var E;let O=w==null?void 0:w.interface;O==="formula"&&(O=PB(w.dataType)||w.dataType);const _=c.getFieldInterface(O);return{operatorList:((E=_==null?void 0:_.filterable)==null?void 0:E.operators)||[],interfaceConfig:_}};let f=l.getCollectionField(a),{operatorList:d,interfaceConfig:h}=u(f);if(!d.length){const w=a.split("."),O=w.pop();if(w.length<2||(f=l.getCollectionField(w.join(".")),!f))return null;const _=u(f);if(d=_.operatorList,h=_.interfaceConfig,!h)return null;const E=((h==null?void 0:h.filterable.children)||[]).find(M=>M.name===O);d=(E==null?void 0:E.operators)||[]}if(!d.length)return null;const p=((m=(y=h==null?void 0:h.default)==null?void 0:y.uiSchema)==null?void 0:m["x-component"])||"Input",v=(b=e["x-component-props"])==null?void 0:b["filter-operator"],g=(w,O,_={})=>{const S=n.componentProps||{};n.component=O,n.componentProps=tt(vt(tt({},S),{"filter-operator":w}),_),e["x-component"]=O,e["x-component-props"]=tt(vt(tt({},e["x-component-props"]),{"filter-operator":w}),_),i.emit("patch",{schema:{"x-uid":e["x-uid"],"x-component":O,"x-component-props":tt(vt(tt({},e["x-component-props"]),{"filter-operator":w}),_)}})};return Y.jsx(z.SchemaSettingsSelectItem,{title:r("Operator"),value:(v==null?void 0:v.value)||((x=d[0])==null?void 0:x.value),options:t(d),onChange:w=>{var _;const O=d.find(S=>S.value===w);O.noValue?g(O,"ChartFilterCheckbox",{content:dt.Schema.compile(O.label,{t:r})}):(_=O.schema)!=null&&_["x-component"]?g(O,O.schema["x-component"]):g(O,p),o(e.name,{operator:O}),i.refresh()}},"operator")},z7=()=>{const{t}=se(),{dn:e}=z.useDesignable(),n=dt.useField(),r=dt.useFieldSchema(),i=ky(r["x-component"]);return Y.jsx(z.SchemaSettingsModalItem,{title:t("Edit field properties"),schema:tt({title:t("Edit field properties")},i),initialValues:n.componentProps,onSubmit:o=>{n.reset(),n.componentProps=o,r["x-component-props"]=o,e.emit("patch",{schema:{"x-uid":r["x-uid"],"x-component-props":o}}),e.refresh()}},"edit-field-props")},Y7=()=>{const{t}=se(),{dn:e}=z.useDesignable(),n=q.useContext(z.VariablesContext),r=dt.useField(),i=dt.useFieldSchema(),{getTranslatedTitle:o}=sl(),a=o(i.title);return Y.jsx(z.SchemaSettingsModalItem,{title:t("Set default value"),components:{ChartFilterVariableInput:$7},schema:{type:"void",title:t("Set default value"),properties:{default:{title:a,"x-decorator":"FormItem","x-component":"ChartFilterVariableInput","x-component-props":{fieldSchema:i}}}},onSubmit:({default:{value:s}})=>{r.setInitialValue(s),i.default=s,e.emit("patch",{schema:{"x-uid":i["x-uid"],default:s}}),e.refresh(),zS(r,n)}},"set field default value")},W7=()=>{var f,d,h;const{getCollectionFields:t,getCollectionJoinField:e,getInterface:n}=z.useCollectionManager_deprecated(),r=dt.useField(),i=dt.useFieldSchema(),{t:o}=se(),{dn:a}=z.useDesignable(),s=z.useCompile(),l=e(i["x-collection-field"]),u=(l!=null&&l.target?t(l==null?void 0:l.target):(f=t(l==null?void 0:l.targetCollection))!=null?f:[]).filter(p=>{if(p!=null&&p.target||p.type==="boolean")return!1;const v=n(p==null?void 0:p.interface);return v==null?void 0:v.titleUsable}).map(p=>{var v;return{value:p==null?void 0:p.name,label:s((v=p==null?void 0:p.uiSchema)==null?void 0:v.title)||(p==null?void 0:p.name)}});return u.length>0&&i["x-component"]==="CollectionField"?Y.jsx(z.SchemaSettingsSelectItem,{title:o("Title field"),options:u,value:(h=(d=r==null?void 0:r.componentProps)==null?void 0:d.fieldNames)==null?void 0:h.label,onChange:p=>{var y,m;const v={"x-uid":i["x-uid"]},g=vt(tt(tt({},(m=(y=l==null?void 0:l.uiSchema)==null?void 0:y["x-component-props"])==null?void 0:m.fieldNames),r.componentProps.fieldNames),{label:p});i["x-component-props"]=i["x-component-props"]||{},i["x-component-props"].fieldNames=g,v["x-component-props"]=i["x-component-props"],r.componentProps.fieldNames=i["x-component-props"].fieldNames,a.emit("patch",{schema:v}),a.refresh()}},"title-field"):null},G7=()=>{var s,l,c;const{dn:t}=z.useDesignable(),e=dt.useField(),n=dt.useFieldSchema(),r=n["x-data-source"]||z.DEFAULT_DATA_SOURCE_KEY,{form:i}=z.useFormBlockContext(),{cm:o}=su(r),a=o.getCollectionField(n["x-collection-field"]);return a?Y.jsx(z.SchemaSettingsDataScope,{form:i,defaultFilter:((c=(l=(s=n==null?void 0:n["x-component-props"])==null?void 0:s.service)==null?void 0:l.params)==null?void 0:c.filter)||{},collectionName:a.target,onSubmit:({filter:u})=>{u=z.removeNullCondition(u),rn.set(e.componentProps,"service.params.filter",u),n["x-component-props"]=e.componentProps,t.emit("patch",{schema:{"x-uid":n["x-uid"],"x-component-props":e.componentProps}})}}):null},H7=()=>{const{getCollectionJoinField:t}=z.useCollectionManager_deprecated(),{getField:e}=z.useCollection_deprecated(),{t:n}=se(),r=dt.useFieldSchema(),i=r.name,o=r["x-data-source"]||z.DEFAULT_DATA_SOURCE_KEY,a=e(i)||t(r["x-collection-field"]),s=i.startsWith("custom."),l=ky(r["x-component"]),c=h7(o,i),u=z.useIsAssociationField();return Y.jsxs(z.GeneralSchemaDesigner,{disableInitializer:!0,children:[!s&&Y.jsxs(Y.Fragment,{children:[Y.jsx(z.SchemaSettingsItem,{title:i,children:Y.jsxs(F7,{type:"secondary",children:[n("Original field"),": ",c]})}),Y.jsx(z.SchemaSettingsDivider,{})]}),Y.jsx(R7,{}),Y.jsx(z.EditDescription,{}),l&&s&&Y.jsx(z7,{}),!s&&Y.jsx(B7,{}),Y.jsx(W7,{}),Y.jsx(Y7,{}),u&&Y.jsx(G7,{}),a?Y.jsx(z.SchemaSettingsDivider,{}):null,Y.jsx(z.SchemaSettingsRemove,{confirm:{title:n("Delete field")},breakRemoveOn:{"x-component":"Grid"}},"remove")]})},U7=dt.connect(t=>{const{content:e}=t,n=dt.useField(),r=()=>{n.setValue(!n.value)};return Y.jsx(wt.Checkbox,{onClick:r,checked:n.value,children:e})}),JS=q.memo(t=>{const{setField:e,removeField:n,setForm:r}=q.useContext(Tr),{getTranslatedTitle:i}=sl(),o=q.useRef(null);o.current=q.useContext(z.VariablesContext);const a=q.useMemo(()=>wn.createForm({effects(){const s=l=>{if(l.displayName!=="Field")return null;const{name:c}=l.props||{};return c};wn.onFieldInit("*",l=>{s(l)&&l.setValue(null)}),wn.onFieldMount("*",l=>Cr(this,null,function*(){const c=s(l);c&&(e(c,{title:l.title,operator:l.componentProps["filter-operator"]}),l.title.includes("/")&&(l.title=i(l.title)),zS(l,o.current))})),wn.onFieldUnmount("*",l=>{const c=s(l);c&&n(c)})}}),[e,i,n,o]);return q.useEffect(()=>r(a),[a,r]),Y.jsx(z.FormV2,vt(tt({},t),{form:a}))});JS.displayName="ChartFilterForm";const V7=()=>{const t={},e=z.useSchemaInitializerItem();return Y.jsx(z.InitializerWithSwitch,vt(tt({},e),{item:e,schema:t,type:"name"}))},X7=t=>{const{t:e}=se(),{setEnabled:n}=q.useContext(Tr);return q.useEffect(()=>{n(!0)},[n]),Y.jsx("div",{className:Ga.css`
27
+ `]:r===!1}),[r]),a=(n==null?void 0:n["x-data-source"])||z.DEFAULT_DATA_SOURCE_KEY,s=(n==null?void 0:n["x-collection-field"])||"",[l]=s.split(".");return Y.jsx(z.BlockItem,{className:"nb-form-item",children:Y.jsx(z.CollectionManagerProvider,{dataSource:a,children:Y.jsx(z.CollectionProvider,{name:l,allowNull:!l,children:Y.jsx(z.CollectionFieldProvider,{name:n.name,allowNull:!n["x-collection-field"],children:Y.jsx(z.ACLCollectionFieldProvider,{children:Y.jsx(LS,{onError:f=>console.log(f),FallbackComponent:A7,children:Y.jsx(ae.FormItem,pt(tt({className:o},t),{extra:i}))})})})})})})},{displayName:"ChartFilterFormItem"}),US=q.memo(t=>{const{locale:e}=q.useContext(wt.ConfigProvider.ConfigContext),{t:n}=se(),r=Ei.useMemoizedFn(n),{scope:i,components:o}=q.useContext(dt.SchemaOptionsContext),{theme:a}=z.useGlobalTheme(),{insert:s}=t,l=z.useSchemaInitializerItem(),c=z.useDataSourceManager(),u=WS(),{options:f,values:d}=GS(),h=q.useCallback(()=>Cr(this,null,function*(){var w,O;const p=yield z.FormDialog(r("Add custom field"),()=>Y.jsx(z.SchemaComponentOptions,{scope:pt(tt({},i),{useChartFilterSourceFields:WS}),components:pt(tt({},o),{FieldComponentProps:P7}),children:Y.jsxs(ae.FormLayout,{layout:"vertical",children:[Y.jsx(wt.Alert,{type:"info",message:r('To filter with custom fields, use "Current filter" variables in the chart configuration.'),style:{marginBottom:16}}),Y.jsx(wt.ConfigProvider,{locale:e,children:Y.jsx(z.SchemaComponent,{schema:{properties:{name:{type:"string",required:!0},title:{type:"string",title:r("Field title"),"x-component":"Input","x-decorator":"FormItem",required:!0},source:{type:"string",title:r("Field source"),"x-decorator":"FormItem","x-component":"Cascader",enum:u,description:r("Select a source field to use metadata of the field")},component:{type:"string",title:r("Field component"),"x-component":"Select","x-decorator":"FormItem",required:!0,enum:f},props:{type:"object",title:r("Component properties"),"x-component":"FieldComponentProps"}}}})})]})}),a).open({values:{name:`f_${Fo.uid()}`},effects(){wn.onFieldValueChange("source",_=>{if(!_.value)return;const[S,...E]=_.value,M=c.getDataSource(S);if(!M)return;const P=M.collectionManager,C=E.join("."),A=P.getCollectionField(C);if(!A)return;const T=A.uiSchema||{};let k;if(d.includes(T["x-component"])){k=T["x-component"];const j=T["x-component-props"]||{};T.enum&&(j.options=T.enum),_.query(".props").take().setValue(j)}else d.includes(A.interface)&&(k=A.interface);if(!k)return;_.query(".component").take().setValue(k)})}}),{name:v,title:g,component:y,props:m}=p,x=((O=(w=c.collectionFieldInterfaceManager.getFieldInterface(y))==null?void 0:w.default)==null?void 0:O.uiSchema)||{};s(z.gridRowColWrap(pt(tt({"x-component":y},x),{type:"string",title:g,name:`custom.${v}`,required:!1,"x-designer":"ChartFilterItemDesigner","x-decorator":"ChartFilterFormItem","x-component-props":tt(tt({},x["x-component-props"]||{}),m)})))}),[a]);return Y.jsx(z.SchemaInitializerItem,pt(tt(tt({},l),t),{onClick:h}))});US.displayName="ChartFilterCustomItemInitializer";const VS={name:"chartFilterForm:configureFields","data-testid":"configure-fields-button-of-chart-filter-item",wrap:z.gridRowColWrap,icon:"SettingOutlined",title:'{{ t("Configure fields") }}',items:[{type:"itemGroup",name:"displayFields",title:'{{ t("Display fields") }}',useChildren:()=>{const{t}=se(),{chartCollections:e,showDataSource:n}=Ny(),{getChartFilterFields:r}=sl(),i=z.useDataSourceManager(),o=i.collectionFieldInterfaceManager;return q.useMemo(()=>{var s;const a=Object.entries(e).map(([l,c])=>{const u=i.getDataSource(l);return{name:u.key,title:dt.Schema.compile(u.displayName,{t}),type:"subMenu",children:c.map(f=>{const d=u.collectionManager,h=d.getCollection(f),p=r({dataSource:l,collection:h,cm:d,fim:o});return{name:h.key,title:dt.Schema.compile(h.title,{t}),type:"subMenu",children:p}})}});return n?a:((s=a[0])==null?void 0:s.children)||[]},[e,n])}},{name:"divider",type:"divider"},{name:"custom",type:"item",title:At("Custom"),Component:()=>{const{insertAdjacent:t}=z.useDesignable();return Y.jsx(US,{insert:e=>t("beforeEnd",e)})}}]},XS=new z.CompatibleSchemaInitializer(pt(tt({},VS),{name:"ChartFilterItemInitializers"})),T7=new z.CompatibleSchemaInitializer(VS,XS),k7=()=>{const{filter:t}=sl();return{onClick:t}},L7=()=>{const t=dt.useForm(),{filter:e}=sl();return{onClick:()=>Cr(this,null,function*(){t.reset(),yield e()})}},N7=()=>{const{collapse:{collapsed:t},setCollapse:e}=q.useContext(Tr),{t:n}=se();return{onClick:()=>e({collapsed:!t}),title:Y.jsxs(Y.Fragment,{children:[Y.jsx(Nn.DownOutlined,{rotate:t?0:180})," ",n(t?"Expand":"Collapse")]})}},I7=t=>{const{t:e}=se();return Y.jsx(z.GeneralSchemaDesigner,pt(tt({},t),{disableInitializer:!0,children:Y.jsx(z.SchemaSettingsRemove,{breakRemoveOn:n=>n["x-component"]==="Space"||n["x-component"].endsWith("ActionBar"),confirm:{title:e("Delete action")}})}))},j7=t=>{const i=t,{buttonEditorProps:e}=i,n=rB(i,["buttonEditorProps"]),{t:r}=se();return Y.jsxs(z.GeneralSchemaDesigner,pt(tt({},n),{disableInitializer:!0,children:[Y.jsx(z.Action.Designer.ButtonEditor,tt({},e)),Y.jsx(z.SchemaSettingsDivider,{}),Y.jsx(z.SchemaSettingsRemove,{breakRemoveOn:o=>o["x-component"]==="Space"||o["x-component"].endsWith("ActionBar"),confirm:{title:r("Delete action")}})]}))},qS=t=>{const e={title:'{{ t("Filter") }}',"x-action":"submit","x-component":"Action","x-use-component-props":"useChartFilterActionProps","x-designer":"ChartFilterActionDesigner","x-component-props":{htmlType:"submit",type:"primary"}};return Y.jsx(z.ActionInitializer,pt(tt({},t),{schema:e}))},KS=t=>{const e={title:'{{ t("Reset") }}',"x-action":"reset","x-component":"Action","x-use-component-props":"useChartFilterResetProps","x-designer":"ChartFilterActionDesigner"};return Y.jsx(z.ActionInitializer,pt(tt({},t),{schema:e}))},ZS=t=>{const e={title:'{{ t("Collapse") }}',"x-action":"collapse","x-component":"Action","x-use-component-props":"useChartFilterCollapseProps","x-component-props":{type:"link"},"x-designer":"ChartFilterCollapseDesigner"};return Y.jsx(z.ActionInitializer,pt(tt({},t),{schema:e}))},QS=new z.CompatibleSchemaInitializer({name:"ChartFilterActionInitializers","data-testid":"configure-actions-button-of-chart-filter",title:'{{t("Configure actions")}}',icon:"SettingOutlined",items:[{name:"enbaleActions",type:"itemGroup",title:'{{t("Enable actions")}}',children:[{name:"filter",type:"item",title:'{{t("Filter")}}',component:qS,schema:{"x-action-settings":{}}},{name:"reset",type:"item",title:'{{t("Reset")}}',component:KS,schema:{"x-action-settings":{}}},{name:"collapse",type:"item",title:'{{t("Collapse")}}',component:ZS,schema:{"x-action-settings":{}}}]}]}),D7=new z.CompatibleSchemaInitializer({name:"chartFilterForm:configureActions","data-testid":"configure-actions-button-of-chart-filter",title:'{{t("Configure actions")}}',icon:"SettingOutlined",items:[{name:"enbaleActions",type:"itemGroup",title:'{{t("Enable actions")}}',children:[{name:"filter",type:"item",title:'{{t("Filter")}}',component:qS,schema:{"x-action-settings":{}}},{name:"reset",type:"item",title:'{{t("Reset")}}',component:KS,schema:{"x-action-settings":{}}},{name:"collapse",type:"item",title:'{{t("Collapse")}}',component:ZS,schema:{"x-action-settings":{}}}]}]},QS),$7=t=>{var u;const{value:e,onChange:n,fieldSchema:r}=t,{currentUserSettings:i}=z.useCurrentUserVariable({collectionField:{uiSchema:r},uiSchema:r}),{datetimeSettings:o}=z.useDatetimeVariable({operator:(u=r["x-component-props"])==null?void 0:u["filter-operator"],schema:r,noDisabled:!0}),a=q.useMemo(()=>[i,o].filter(Boolean),[o,i]),s=pt(tt({},r),{"x-component":r["x-component"]||"Input","x-decorator":"",title:"",name:"value",default:""}),l=r["x-component-props"]||{},c=Ei.useMemoizedFn(n);return q.useEffect(()=>{r.default&&c({value:r.default})},[r.default,c]),Y.jsx(z.VariableScopeProvider,{scope:a,children:Y.jsx(z.VariableInput,pt(tt({},l),{renderSchemaComponent:()=>Y.jsx(z.SchemaComponent,{schema:s}),fieldNames:{},value:e==null?void 0:e.value,scope:a,onChange:f=>{n({value:f})},shouldChange:z.getShouldChange({})}))})},{Text:F7}=wt.Typography,R7=()=>{const t=dt.useField(),e=dt.useFieldSchema(),{t:n}=se(),{dn:r}=z.useDesignable(),{setField:i}=q.useContext(Tr);return Y.jsx(z.SchemaSettingsModalItem,{title:n("Edit field title"),schema:{type:"object",title:n("Edit field title"),properties:{title:{title:n("Field title"),default:t==null?void 0:t.title,required:!0,"x-decorator":"FormItem","x-component":"Input","x-component-props":{}}}},onSubmit:({title:o})=>{o&&(t.title=o,e.title=o,r.emit("patch",{schema:{"x-uid":e["x-uid"],title:e.title}}),i(e.name,{title:o})),r.refresh()}},"edit-field-title")},B7=()=>{var y,m,b,x;const t=z.useCompile(),e=dt.useFieldSchema(),n=dt.useField(),{t:r}=se(),{dn:i}=z.useDesignable(),{setField:o}=q.useContext(Tr),a=e["x-collection-field"],s=e["x-data-source"]||z.DEFAULT_DATA_SOURCE_KEY,{cm:l,fim:c}=su(s);if(!l)return null;const u=w=>{var E;let O=w==null?void 0:w.interface;O==="formula"&&(O=PB(w.dataType)||w.dataType);const _=c.getFieldInterface(O);return{operatorList:((E=_==null?void 0:_.filterable)==null?void 0:E.operators)||[],interfaceConfig:_}};let f=l.getCollectionField(a),{operatorList:d,interfaceConfig:h}=u(f);if(!d.length){const w=a.split("."),O=w.pop();if(w.length<2||(f=l.getCollectionField(w.join(".")),!f))return null;const _=u(f);if(d=_.operatorList,h=_.interfaceConfig,!h)return null;const E=((h==null?void 0:h.filterable.children)||[]).find(M=>M.name===O);d=(E==null?void 0:E.operators)||[]}if(!d.length)return null;const p=((m=(y=h==null?void 0:h.default)==null?void 0:y.uiSchema)==null?void 0:m["x-component"])||"Input",v=(b=e["x-component-props"])==null?void 0:b["filter-operator"],g=(w,O,_={})=>{const S=n.componentProps||{};n.component=O,n.componentProps=tt(pt(tt({},S),{"filter-operator":w}),_),e["x-component"]=O,e["x-component-props"]=tt(pt(tt({},e["x-component-props"]),{"filter-operator":w}),_),i.emit("patch",{schema:{"x-uid":e["x-uid"],"x-component":O,"x-component-props":tt(pt(tt({},e["x-component-props"]),{"filter-operator":w}),_)}})};return Y.jsx(z.SchemaSettingsSelectItem,{title:r("Operator"),value:(v==null?void 0:v.value)||((x=d[0])==null?void 0:x.value),options:t(d),onChange:w=>{var _;const O=d.find(S=>S.value===w);O.noValue?g(O,"ChartFilterCheckbox",{content:dt.Schema.compile(O.label,{t:r})}):(_=O.schema)!=null&&_["x-component"]?g(O,O.schema["x-component"]):g(O,p),o(e.name,{operator:O}),i.refresh()}},"operator")},z7=()=>{const{t}=se(),{dn:e}=z.useDesignable(),n=dt.useField(),r=dt.useFieldSchema(),i=ky(r["x-component"]);return Y.jsx(z.SchemaSettingsModalItem,{title:t("Edit field properties"),schema:tt({title:t("Edit field properties")},i),initialValues:n.componentProps,onSubmit:o=>{n.reset(),n.componentProps=o,r["x-component-props"]=o,e.emit("patch",{schema:{"x-uid":r["x-uid"],"x-component-props":o}}),e.refresh()}},"edit-field-props")},Y7=()=>{const{t}=se(),{dn:e}=z.useDesignable(),n=q.useContext(z.VariablesContext),r=dt.useField(),i=dt.useFieldSchema(),{getTranslatedTitle:o}=sl(),a=o(i.title);return Y.jsx(z.SchemaSettingsModalItem,{title:t("Set default value"),components:{ChartFilterVariableInput:$7},schema:{type:"void",title:t("Set default value"),properties:{default:{title:a,"x-decorator":"FormItem","x-component":"ChartFilterVariableInput","x-component-props":{fieldSchema:i}}}},onSubmit:({default:{value:s}})=>{r.setInitialValue(s),i.default=s,e.emit("patch",{schema:{"x-uid":i["x-uid"],default:s}}),e.refresh(),zS(r,n)}},"set field default value")},W7=()=>{var f,d,h;const{getCollectionFields:t,getCollectionJoinField:e,getInterface:n}=z.useCollectionManager_deprecated(),r=dt.useField(),i=dt.useFieldSchema(),{t:o}=se(),{dn:a}=z.useDesignable(),s=z.useCompile(),l=e(i["x-collection-field"]),u=(l!=null&&l.target?t(l==null?void 0:l.target):(f=t(l==null?void 0:l.targetCollection))!=null?f:[]).filter(p=>{if(p!=null&&p.target||p.type==="boolean")return!1;const v=n(p==null?void 0:p.interface);return v==null?void 0:v.titleUsable}).map(p=>{var v;return{value:p==null?void 0:p.name,label:s((v=p==null?void 0:p.uiSchema)==null?void 0:v.title)||(p==null?void 0:p.name)}});return u.length>0&&i["x-component"]==="CollectionField"?Y.jsx(z.SchemaSettingsSelectItem,{title:o("Title field"),options:u,value:(h=(d=r==null?void 0:r.componentProps)==null?void 0:d.fieldNames)==null?void 0:h.label,onChange:p=>{var y,m;const v={"x-uid":i["x-uid"]},g=pt(tt(tt({},(m=(y=l==null?void 0:l.uiSchema)==null?void 0:y["x-component-props"])==null?void 0:m.fieldNames),r.componentProps.fieldNames),{label:p});i["x-component-props"]=i["x-component-props"]||{},i["x-component-props"].fieldNames=g,v["x-component-props"]=i["x-component-props"],r.componentProps.fieldNames=i["x-component-props"].fieldNames,a.emit("patch",{schema:v}),a.refresh()}},"title-field"):null},G7=()=>{var s,l,c;const{dn:t}=z.useDesignable(),e=dt.useField(),n=dt.useFieldSchema(),r=n["x-data-source"]||z.DEFAULT_DATA_SOURCE_KEY,{form:i}=z.useFormBlockContext(),{cm:o}=su(r),a=o.getCollectionField(n["x-collection-field"]);return a?Y.jsx(z.SchemaSettingsDataScope,{form:i,defaultFilter:((c=(l=(s=n==null?void 0:n["x-component-props"])==null?void 0:s.service)==null?void 0:l.params)==null?void 0:c.filter)||{},collectionName:a.target,onSubmit:({filter:u})=>{u=z.removeNullCondition(u),rn.set(e.componentProps,"service.params.filter",u),n["x-component-props"]=e.componentProps,t.emit("patch",{schema:{"x-uid":n["x-uid"],"x-component-props":e.componentProps}})}}):null},H7=()=>{const{getCollectionJoinField:t}=z.useCollectionManager_deprecated(),{getField:e}=z.useCollection_deprecated(),{t:n}=se(),r=dt.useFieldSchema(),i=r.name,o=r["x-data-source"]||z.DEFAULT_DATA_SOURCE_KEY,a=e(i)||t(r["x-collection-field"]),s=i.startsWith("custom."),l=ky(r["x-component"]),c=h7(o,i),u=z.useIsAssociationField();return Y.jsxs(z.GeneralSchemaDesigner,{disableInitializer:!0,children:[!s&&Y.jsxs(Y.Fragment,{children:[Y.jsx(z.SchemaSettingsItem,{title:i,children:Y.jsxs(F7,{type:"secondary",children:[n("Original field"),": ",c]})}),Y.jsx(z.SchemaSettingsDivider,{})]}),Y.jsx(R7,{}),Y.jsx(z.EditDescription,{}),l&&s&&Y.jsx(z7,{}),!s&&Y.jsx(B7,{}),Y.jsx(W7,{}),Y.jsx(Y7,{}),u&&Y.jsx(G7,{}),a?Y.jsx(z.SchemaSettingsDivider,{}):null,Y.jsx(z.SchemaSettingsRemove,{confirm:{title:n("Delete field")},breakRemoveOn:{"x-component":"Grid"}},"remove")]})},U7=dt.connect(t=>{const{content:e}=t,n=dt.useField(),r=()=>{n.setValue(!n.value)};return Y.jsx(wt.Checkbox,{onClick:r,checked:n.value,children:e})}),JS=q.memo(t=>{const{setField:e,removeField:n,setForm:r}=q.useContext(Tr),{getTranslatedTitle:i}=sl(),o=q.useRef(null);o.current=q.useContext(z.VariablesContext);const a=q.useMemo(()=>wn.createForm({effects(){const s=l=>{if(l.displayName!=="Field")return null;const{name:c}=l.props||{};return c};wn.onFieldInit("*",l=>{s(l)&&l.setValue(null)}),wn.onFieldMount("*",l=>Cr(this,null,function*(){const c=s(l);c&&(e(c,{title:l.title,operator:l.componentProps["filter-operator"]}),l.title.includes("/")&&(l.title=i(l.title)),zS(l,o.current))})),wn.onFieldUnmount("*",l=>{const c=s(l);c&&n(c)})}}),[e,i,n,o]);return q.useEffect(()=>r(a),[a,r]),Y.jsx(z.FormV2,pt(tt({},t),{form:a}))});JS.displayName="ChartFilterForm";const V7=()=>{const t={},e=z.useSchemaInitializerItem();return Y.jsx(z.InitializerWithSwitch,pt(tt({},e),{item:e,schema:t,type:"name"}))},X7=t=>{const{t:e}=se(),{setEnabled:n}=q.useContext(Tr);return q.useEffect(()=>{n(!0)},[n]),Y.jsx("div",{className:Ga.css`
28
28
  .ant-card {
29
29
  box-shadow: none;
30
30
  border: none;
31
31
  margin-bottom: 6px;
32
32
  }
33
- `,children:Y.jsx(z.SchemaComponentOptions,{components:{ChartFilterItemDesigner:H7,ChartFilterForm:JS,ChartFilterGrid:S7,ChartFilterCheckbox:U7,ChartFilterFormItem:C7,ArrayItems:ae.ArrayItems,ChartFilterCollapseDesigner:I7,ChartFilterActionDesigner:j7,CollectionFieldInitializer:V7},scope:{t:e,useChartFilterActionProps:k7,useChartFilterResetProps:L7,useChartFilterCollapseProps:N7},children:t.children})})},q7=t=>{const[e,n]=q.useState(!1),r=z.useSchemaInitializer();return Y.jsx(z.SchemaInitializerContext.Provider,{value:vt(tt({},r),{visible:e,setVisible:n}),children:Y.jsx(z.SchemaComponentOptions,{components:{ChartRenderer:Ty,ChartRendererProvider:IS,ChartFilterBlockProvider:X7,ChartFilterBlockDesigner:O7},children:Y.jsx(AB,{children:Y.jsx(CB,{children:Y.jsx(b7,{children:t.children})})})})})},K7=()=>{const{t}=se();return Y.jsxs(z.GeneralSchemaDesigner,{title:t("Charts"),showDataSource:!1,children:[Y.jsx(z.SchemaSettingsBlockTitleItem,{}),Y.jsx(z.SchemaSettingsDivider,{}),Y.jsx(z.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}})]})},tE=()=>{const{setVisible:t,setCurrent:e}=q.useContext(Mi),{parseAction:n}=z.useACLRoleContext(),r=z.useSchemaInitializerItem(),i=q.useCallback(o=>n(`${o.name}:list`),[n]);return Y.jsx(z.DataBlockInitializer,vt(tt({},r),{filter:i,filterDataSource:o=>o.key===z.DEFAULT_DATA_SOURCE_KEY||o.getOptions().isDBInstance,icon:Y.jsx(Nn.BarChartOutlined,{}),componentType:"Chart",onCreateBlockSchema:a=>Cr(this,[a],function*({item:o}){e({schema:{},field:null,collection:o.name,dataSource:o.dataSource,service:null,data:void 0}),t(!0)})}))},eE=new z.CompatibleSchemaInitializer({name:"ChartInitializers",icon:"PlusOutlined",title:'{{t("Add block")}}',items:[{name:"chart",title:At("Chart"),Component:tE},{name:"otherBlocks",type:"itemGroup",title:At("Other blocks"),children:[{name:"filter",title:At("Filter"),Component:HS}]}]}),Z7=new z.CompatibleSchemaInitializer({name:"charts:addBlock",icon:"PlusOutlined",title:'{{t("Add block")}}',items:[{name:"chart",title:At("Chart"),Component:tE},{name:"otherBlocks",type:"itemGroup",title:At("Other blocks"),children:[{name:"filter",title:At("Filter"),Component:HS}]}]},eE),Q7=()=>{const t=z.useSchemaInitializerItem(),{insert:e}=z.useSchemaInitializer();return Y.jsx(z.SchemaInitializerItem,vt(tt({},t),{icon:Y.jsx(Nn.LineChartOutlined,{}),onClick:()=>{e({type:"void","x-component":"CardItem","x-component-props":{name:"charts"},"x-designer":"ChartV2BlockDesigner",properties:{[Fo.uid()]:{type:"void","x-component":"Grid","x-decorator":"ChartV2Block","x-initializer":"charts:addBlock"}}})}}))},fu=({name:t,title:e,required:n,defaultValue:r})=>({[t||"field"]:{title:At(e||"Field"),type:"string","x-decorator":"FormItem","x-component":"Select","x-reactions":"{{ useChartFields }}",required:n,default:r}}),nE={field:fu,booleanField:({name:t,title:e,defaultValue:n=!1})=>({[t||"field"]:{"x-content":At(e||"Field"),type:"boolean","x-decorator":"FormItem","x-component":"Checkbox",default:n}}),xField:t=>fu(tt({name:"xField",title:"xField",required:!0},t)),yField:t=>fu(tt({name:"yField",title:"yField",required:!0},t)),seriesField:t=>fu(tt({name:"seriesField",title:"seriesField"},t)),colorField:t=>fu(tt({name:"colorField",title:"colorField"},t))};let jy=class{constructor({name:e,title:n,Component:r,config:i}){ni(this,"name");ni(this,"title");ni(this,"Component");ni(this,"config");ni(this,"configs",new Map);this.name=e,this.title=n,this.Component=r,this.config=i,this.addConfigs(nE)}get schema(){return this.config?{type:"object",properties:this.config.reduce((n,r)=>{let i={};if(typeof r=="string"){const o=this.configs.get(r);i=(o==null?void 0:o())||{}}else if(typeof r=="function")i=r();else if(r.property){const o=this.configs.get(r.property);i=(o==null?void 0:o(r))||{}}else i=r;return tt(tt({},n),i)},{})}:{}}addConfigs(e){Object.entries(e).forEach(([n,r])=>{this.configs.set(n,r)})}infer(e,{measures:n,dimensions:r}){let i,o,a,s,l;const c=(u,f)=>{if(f.alias)return u.find(h=>h.value===f.alias);const{alias:d}=au(f.field);return u.find(h=>h.value===d)};if(n!=null&&n.length&&(o=c(e,n[0]),l=n.map(u=>c(e,u))),r){if(r.length===1)i=c(e,r[0]);else if(r.length>1){let u;r.forEach((d,h)=>{const p=c(e,d);["date","time","datetime"].includes(p==null?void 0:p.type)&&(i=p,u=h)}),u=u||0,i=i||c(e,r[u]);const f=r.filter((d,h)=>h!==u).map(d=>c(e,d));f.length===1?(a=f[0],s=f[0]):f.length>1&&(s=f[0],a=f[1])}}return{xField:i,yField:o,seriesField:a,colorField:s,yFields:l}}getProps(e){return e}};class rE extends jy{getReference(){return{title:this.title,link:`https://ant.design/components/${this.name}`}}}class J7 extends rE{constructor(){super({name:"statistic",title:"Statistic",Component:wt.Statistic,config:[{property:"field",name:"field",title:"Field",required:!0},{title:{title:At("Title"),type:"string","x-decorator":"FormItem","x-component":"Input"}}]});ni(this,"init",(n,{measures:r,dimensions:i})=>{const{yField:o}=this.infer(n,{measures:r,dimensions:i});return{general:{field:o==null?void 0:o.value,title:o==null?void 0:o.label}}})}getProps({data:n,fieldProps:r,general:i,advanced:o}){const a=n[0]||{},s=i==null?void 0:i.field,l=r[s];return tt(tt({value:a[s],formatter:l==null?void 0:l.transformer},i),o)}}class tz extends rE{constructor(){super({name:"table",title:"Table",Component:wt.Table})}getProps({data:e,fieldProps:n,general:r,advanced:i}){var l;const o=e.length?Object.keys(e[0]).map(c=>{var u;return{title:((u=n[c])==null?void 0:u.label)||c,dataIndex:c,key:c}}):[],a=e.map((c,u)=>(Object.keys(c).map(f=>{const d=n[f];if((d==null?void 0:d.interface)==="percent"){const h=Math.round(parseFloat(c[f])*100).toFixed(2);c[f]=`${h}%`}typeof c[f]=="boolean"&&(c[f]=c[f].toString()),d!=null&&d.transformer&&(c[f]=d.transformer(c[f]))}),c._key=u,c)),s=((l=i==null?void 0:i.pagination)==null?void 0:l.pageSize)||10;return tt(tt({size:"middle",pagination:a.length<s?!1:{pageSize:s},dataSource:a,columns:o,scroll:{x:"max-content"},rowKey:"_key"},r),i)}}const ez=[new J7,new tz],iE=()=>[["cartesian"]];iE.props={};function nz(t,e){return t=t%(2*Math.PI),e=e%(2*Math.PI),t<0&&(t=2*Math.PI+t),e<0&&(e=2*Math.PI+e),t>=e&&(e=e+2*Math.PI),{startAngle:t,endAngle:e}}const oE=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:Math.PI*3/2,innerRadius:0,outerRadius:1},n=Object.assign(Object.assign({},e),t);return Object.assign(Object.assign({},n),nz(n.startAngle,n.endAngle))},du=t=>{const{startAngle:e,endAngle:n,innerRadius:r,outerRadius:i}=oE(t);return[["translate",0,.5],["reflect.y"],["translate",0,-.5],["polar",e,n,r,i]]};du.props={};const Dy=()=>[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]];Dy.props={transform:!0};const rz=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:Math.PI*3/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)},aE=t=>{const{startAngle:e,endAngle:n,innerRadius:r,outerRadius:i}=rz(t);return[...Dy(),...du({startAngle:e,endAngle:n,innerRadius:r,outerRadius:i})]};aE.props={};const sE=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:Math.PI*3/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)},$y=t=>{const{startAngle:e,endAngle:n,innerRadius:r,outerRadius:i}=sE(t);return[["transpose"],["translate",.5,.5],["reflect"],["translate",-.5,-.5],...du({startAngle:e,endAngle:n,innerRadius:r,outerRadius:i})]};$y.props={};const Fy=()=>[["parallel",0,1,0,1]];Fy.props={};const lE=({focusX:t=0,focusY:e=0,distortionX:n=2,distortionY:r=2,visual:i=!1})=>[["fisheye",t,e,n,r,i]];lE.props={transform:!0};const cE=t=>{const{startAngle:e=-Math.PI/2,endAngle:n=Math.PI*3/2,innerRadius:r=0,outerRadius:i=1}=t;return[...Fy(),...du({startAngle:e,endAngle:n,innerRadius:r,outerRadius:i})]};cE.props={};const uE=({value:t})=>e=>e.map(()=>t);uE.props={};const fE=({value:t})=>e=>e.map(t);fE.props={};const dE=({value:t})=>e=>e.map(n=>n[t]);dE.props={};const hE=({value:t})=>()=>t;hE.props={};var iz=function(t){return t!==null&&typeof t!="function"&&isFinite(t.length)};const ph=iz,Ry=function(t){return typeof t=="function"};var oz=function(t){return t==null};const By=oz;var az={}.toString,sz=function(t,e){return az.call(t)==="[object "+e+"]"};const vh=sz,Bo=function(t){return Array.isArray?Array.isArray(t):vh(t,"Array")},lz=function(t){var e=typeof t;return t!==null&&e==="object"||e==="function"};function zy(t,e){if(t){var n;if(Bo(t))for(var r=0,i=t.length;r<i&&(n=e(t[r],r),n!==!1);r++);else if(lz(t)){for(var o in t)if(t.hasOwnProperty(o)&&(n=e(t[o],o),n===!1))break}}}var cz=Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];return zy(t,function(n,r){Ry(t)&&r==="prototype"||e.push(r)}),e};const pE=cz;function uz(t,e){var n=pE(e),r=n.length;if(By(t))return!r;for(var i=0;i<r;i+=1){var o=n[i];if(e[o]!==t[o]||!(o in t))return!1}return!0}var fz=function(t){return typeof t=="object"&&t!==null};const Yy=fz;var dz=function(t){if(!Yy(t)||!vh(t,"Object"))return!1;if(Object.getPrototypeOf(t)===null)return!0;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};const Ua=dz;function vE(t,e){if(!Bo(t))return null;var n;if(Ry(e)&&(n=e),Ua(e)&&(n=function(i){return uz(i,e)}),n){for(var r=0;r<t.length;r+=1)if(n(t[r]))return t[r]}return null}var hz=function(t,e,n){if(!Bo(t)&&!Ua(t))return t;var r=n;return zy(t,function(i,o){r=e(r,i,o)}),r};const pz=hz,Wy=function(t){return vh(t,"String")};function hu(t){if(ph(t)){var e=t;return e[e.length-1]}}var vz=function(t){return vh(t,"Number")};const Va=vz,gE=function(t){return By(t)?"":t.toString()};var gz=function(t){var e=gE(t);return e.charAt(0).toLowerCase()+e.substring(1)};const yE=gz;var yz=function(t){var e=gE(t);return e.charAt(0).toUpperCase()+e.substring(1)};const zo=yz;function mz(t,e,n){var r;return function(){var i=this,o=arguments,a=function(){r=null,n||t.apply(i,o)},s=n&&!r;clearTimeout(r),r=setTimeout(a,e),s&&t.apply(i,o)}}var bz=5;function xz(t,e){if(Object.hasOwn)return Object.hasOwn(t,e);if(t==null)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(t),e)}function mE(t,e,n,r){n=n||0,r=r||bz;for(var i in e)if(xz(e,i)){var o=e[i];o!==null&&Ua(o)?(Ua(t[i])||(t[i]={}),n<r?mE(t[i],o,n+1,r):t[i]=e[i]):Bo(o)?(t[i]=[],t[i]=t[i].concat(o)):o!==void 0&&(t[i]=o)}}var wz=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)mE(t,e[r]);return t};const Z=wz;var Gy=function(t,e){if(t===e)return!0;if(!t||!e||Wy(t)||Wy(e))return!1;if(ph(t)||ph(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;r<t.length&&(n=Gy(t[r],e[r]),!!n);r++);return n}if(Yy(t)||Yy(e)){var i=Object.keys(t),o=Object.keys(e);if(i.length!==o.length)return!1;for(var n=!0,r=0;r<i.length&&(n=Gy(t[i[r]],e[i[r]]),!!n);r++);return n}return!1};const Oz=Gy,Un=function(t,e,n){for(var r=0,i=Wy(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return t===void 0||r<i.length?n:t};var _z=Object.prototype.hasOwnProperty;const Sz=function(t,e){if(t===null||!Ua(t))return{};var n={};return zy(e,function(r){_z.call(t,r)&&(n[r]=t[r])}),n},bE=function(t,e){return pz(t,function(n,r,i){return e.includes(i)||(n[i]=r),n},{})},Xa=function(t,e,n){var r,i,o,a,s=0;n||(n={});var l=function(){s=n.leading===!1?0:Date.now(),r=null,a=t.apply(i,o),r||(i=o=null)},c=function(){var u=Date.now();!s&&n.leading===!1&&(s=u);var f=e-(u-s);return i=this,o=arguments,f<=0||f>e?(r&&(clearTimeout(r),r=null),s=u,a=t.apply(i,o),r||(i=o=null)):!r&&n.trailing!==!1&&(r=setTimeout(l,f)),a};return c.cancel=function(){clearTimeout(r),s=0,r=i=o=null},c};function xE(t){return By(t)?0:ph(t)?t.length:Object.keys(t).length}var be=1e-6,Re=typeof Float32Array!="undefined"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});function ll(){var t=new Re(9);return Re!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function Ez(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function Mz(t){var e=new Re(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function Pz(t,e,n,r,i,o,a,s,l){var c=new Re(9);return c[0]=t,c[1]=e,c[2]=n,c[3]=r,c[4]=i,c[5]=o,c[6]=a,c[7]=s,c[8]=l,c}function Az(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],f=u*a-s*c,d=-u*o+s*l,h=c*o-a*l,p=n*f+r*d+i*h;return p?(p=1/p,t[0]=f*p,t[1]=(-u*r+i*c)*p,t[2]=(s*r-i*a)*p,t[3]=d*p,t[4]=(u*n-i*l)*p,t[5]=(-s*n+i*o)*p,t[6]=h*p,t[7]=(-c*n+r*l)*p,t[8]=(a*n-r*o)*p,t):null}function Cz(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],f=e[8],d=n[0],h=n[1],p=n[2],v=n[3],g=n[4],y=n[5],m=n[6],b=n[7],x=n[8];return t[0]=d*r+h*a+p*c,t[1]=d*i+h*s+p*u,t[2]=d*o+h*l+p*f,t[3]=v*r+g*a+y*c,t[4]=v*i+g*s+y*u,t[5]=v*o+g*l+y*f,t[6]=m*r+b*a+x*c,t[7]=m*i+b*s+x*u,t[8]=m*o+b*l+x*f,t}function Tz(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function kz(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Lz(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}var Nz=Cz;function Kt(){var t=new Re(16);return Re!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function Hy(t){var e=new Re(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function qa(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Iz(t,e,n,r,i,o,a,s,l,c,u,f,d,h,p,v){var g=new Re(16);return g[0]=t,g[1]=e,g[2]=n,g[3]=r,g[4]=i,g[5]=o,g[6]=a,g[7]=s,g[8]=l,g[9]=c,g[10]=u,g[11]=f,g[12]=d,g[13]=h,g[14]=p,g[15]=v,g}function Uy(t,e,n,r,i,o,a,s,l,c,u,f,d,h,p,v,g){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=l,t[8]=c,t[9]=u,t[10]=f,t[11]=d,t[12]=h,t[13]=p,t[14]=v,t[15]=g,t}function pu(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function wE(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function oi(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],f=e[9],d=e[10],h=e[11],p=e[12],v=e[13],g=e[14],y=e[15],m=n*s-r*a,b=n*l-i*a,x=n*c-o*a,w=r*l-i*s,O=r*c-o*s,_=i*c-o*l,S=u*v-f*p,E=u*g-d*p,M=u*y-h*p,P=f*g-d*v,C=f*y-h*v,A=d*y-h*g,T=m*A-b*C+x*P+w*M-O*E+_*S;return T?(T=1/T,t[0]=(s*A-l*C+c*P)*T,t[1]=(i*C-r*A-o*P)*T,t[2]=(v*_-g*O+y*w)*T,t[3]=(d*O-f*_-h*w)*T,t[4]=(l*M-a*A-c*E)*T,t[5]=(n*A-i*M+o*E)*T,t[6]=(g*x-p*_-y*b)*T,t[7]=(u*_-d*x+h*b)*T,t[8]=(a*C-s*M+c*S)*T,t[9]=(r*M-n*C-o*S)*T,t[10]=(p*O-v*x+y*m)*T,t[11]=(f*x-u*O-h*m)*T,t[12]=(s*E-a*P-l*S)*T,t[13]=(n*P-r*E+i*S)*T,t[14]=(v*b-p*w-g*m)*T,t[15]=(u*w-f*b+d*m)*T,t):null}function jz(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],f=e[9],d=e[10],h=e[11],p=e[12],v=e[13],g=e[14],y=e[15];return t[0]=s*(d*y-h*g)-f*(l*y-c*g)+v*(l*h-c*d),t[1]=-(r*(d*y-h*g)-f*(i*y-o*g)+v*(i*h-o*d)),t[2]=r*(l*y-c*g)-s*(i*y-o*g)+v*(i*c-o*l),t[3]=-(r*(l*h-c*d)-s*(i*h-o*d)+f*(i*c-o*l)),t[4]=-(a*(d*y-h*g)-u*(l*y-c*g)+p*(l*h-c*d)),t[5]=n*(d*y-h*g)-u*(i*y-o*g)+p*(i*h-o*d),t[6]=-(n*(l*y-c*g)-a*(i*y-o*g)+p*(i*c-o*l)),t[7]=n*(l*h-c*d)-a*(i*h-o*d)+u*(i*c-o*l),t[8]=a*(f*y-h*v)-u*(s*y-c*v)+p*(s*h-c*f),t[9]=-(n*(f*y-h*v)-u*(r*y-o*v)+p*(r*h-o*f)),t[10]=n*(s*y-c*v)-a*(r*y-o*v)+p*(r*c-o*s),t[11]=-(n*(s*h-c*f)-a*(r*h-o*f)+u*(r*c-o*s)),t[12]=-(a*(f*g-d*v)-u*(s*g-l*v)+p*(s*d-l*f)),t[13]=n*(f*g-d*v)-u*(r*g-i*v)+p*(r*d-i*f),t[14]=-(n*(s*g-l*v)-a*(r*g-i*v)+p*(r*l-i*s)),t[15]=n*(s*d-l*f)-a*(r*d-i*f)+u*(r*l-i*s),t}function OE(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],l=t[7],c=t[8],u=t[9],f=t[10],d=t[11],h=t[12],p=t[13],v=t[14],g=t[15],y=e*a-n*o,m=e*s-r*o,b=e*l-i*o,x=n*s-r*a,w=n*l-i*a,O=r*l-i*s,_=c*p-u*h,S=c*v-f*h,E=c*g-d*h,M=u*v-f*p,P=u*g-d*p,C=f*g-d*v;return y*C-m*P+b*M+x*E-w*S+O*_}function On(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],f=e[8],d=e[9],h=e[10],p=e[11],v=e[12],g=e[13],y=e[14],m=e[15],b=n[0],x=n[1],w=n[2],O=n[3];return t[0]=b*r+x*s+w*f+O*v,t[1]=b*i+x*l+w*d+O*g,t[2]=b*o+x*c+w*h+O*y,t[3]=b*a+x*u+w*p+O*m,b=n[4],x=n[5],w=n[6],O=n[7],t[4]=b*r+x*s+w*f+O*v,t[5]=b*i+x*l+w*d+O*g,t[6]=b*o+x*c+w*h+O*y,t[7]=b*a+x*u+w*p+O*m,b=n[8],x=n[9],w=n[10],O=n[11],t[8]=b*r+x*s+w*f+O*v,t[9]=b*i+x*l+w*d+O*g,t[10]=b*o+x*c+w*h+O*y,t[11]=b*a+x*u+w*p+O*m,b=n[12],x=n[13],w=n[14],O=n[15],t[12]=b*r+x*s+w*f+O*v,t[13]=b*i+x*l+w*d+O*g,t[14]=b*o+x*c+w*h+O*y,t[15]=b*a+x*u+w*p+O*m,t}function Yo(t,e,n){var r=n[0],i=n[1],o=n[2],a,s,l,c,u,f,d,h,p,v,g,y;return e===t?(t[12]=e[0]*r+e[4]*i+e[8]*o+e[12],t[13]=e[1]*r+e[5]*i+e[9]*o+e[13],t[14]=e[2]*r+e[6]*i+e[10]*o+e[14],t[15]=e[3]*r+e[7]*i+e[11]*o+e[15]):(a=e[0],s=e[1],l=e[2],c=e[3],u=e[4],f=e[5],d=e[6],h=e[7],p=e[8],v=e[9],g=e[10],y=e[11],t[0]=a,t[1]=s,t[2]=l,t[3]=c,t[4]=u,t[5]=f,t[6]=d,t[7]=h,t[8]=p,t[9]=v,t[10]=g,t[11]=y,t[12]=a*r+u*i+p*o+e[12],t[13]=s*r+f*i+v*o+e[13],t[14]=l*r+d*i+g*o+e[14],t[15]=c*r+h*i+y*o+e[15]),t}function gh(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Dz(t,e,n,r){var i=r[0],o=r[1],a=r[2],s=Math.hypot(i,o,a),l,c,u,f,d,h,p,v,g,y,m,b,x,w,O,_,S,E,M,P,C,A,T,k;return s<be?null:(s=1/s,i*=s,o*=s,a*=s,l=Math.sin(n),c=Math.cos(n),u=1-c,f=e[0],d=e[1],h=e[2],p=e[3],v=e[4],g=e[5],y=e[6],m=e[7],b=e[8],x=e[9],w=e[10],O=e[11],_=i*i*u+c,S=o*i*u+a*l,E=a*i*u-o*l,M=i*o*u-a*l,P=o*o*u+c,C=a*o*u+i*l,A=i*a*u+o*l,T=o*a*u-i*l,k=a*a*u+c,t[0]=f*_+v*S+b*E,t[1]=d*_+g*S+x*E,t[2]=h*_+y*S+w*E,t[3]=p*_+m*S+O*E,t[4]=f*M+v*P+b*C,t[5]=d*M+g*P+x*C,t[6]=h*M+y*P+w*C,t[7]=p*M+m*P+O*C,t[8]=f*A+v*T+b*k,t[9]=d*A+g*T+x*k,t[10]=h*A+y*T+w*k,t[11]=p*A+m*T+O*k,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function _E(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],l=e[7],c=e[8],u=e[9],f=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+c*r,t[5]=a*i+u*r,t[6]=s*i+f*r,t[7]=l*i+d*r,t[8]=c*i-o*r,t[9]=u*i-a*r,t[10]=f*i-s*r,t[11]=d*i-l*r,t}function SE(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],l=e[3],c=e[8],u=e[9],f=e[10],d=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-c*r,t[1]=a*i-u*r,t[2]=s*i-f*r,t[3]=l*i-d*r,t[8]=o*r+c*i,t[9]=a*r+u*i,t[10]=s*r+f*i,t[11]=l*r+d*i,t}function $z(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],l=e[3],c=e[4],u=e[5],f=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+c*r,t[1]=a*i+u*r,t[2]=s*i+f*r,t[3]=l*i+d*r,t[4]=c*i-o*r,t[5]=u*i-a*r,t[6]=f*i-s*r,t[7]=d*i-l*r,t}function Vy(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function Xy(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Fz(t,e,n){var r=n[0],i=n[1],o=n[2],a=Math.hypot(r,i,o),s,l,c;return a<be?null:(a=1/a,r*=a,i*=a,o*=a,s=Math.sin(e),l=Math.cos(e),c=1-l,t[0]=r*r*c+l,t[1]=i*r*c+o*s,t[2]=o*r*c-i*s,t[3]=0,t[4]=r*i*c-o*s,t[5]=i*i*c+l,t[6]=o*i*c+r*s,t[7]=0,t[8]=r*o*c+i*s,t[9]=i*o*c-r*s,t[10]=o*o*c+l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function Rz(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Bz(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function zz(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function EE(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=r+r,l=i+i,c=o+o,u=r*s,f=r*l,d=r*c,h=i*l,p=i*c,v=o*c,g=a*s,y=a*l,m=a*c;return t[0]=1-(h+v),t[1]=f+m,t[2]=d-y,t[3]=0,t[4]=f-m,t[5]=1-(u+v),t[6]=p+g,t[7]=0,t[8]=d+y,t[9]=p-g,t[10]=1-(u+h),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function Yz(t,e){var n=new Re(3),r=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],f=r*r+i*i+o*o+a*a;return f>0?(n[0]=(s*a+u*r+l*o-c*i)*2/f,n[1]=(l*a+u*i+c*r-s*o)*2/f,n[2]=(c*a+u*o+s*i-l*r)*2/f):(n[0]=(s*a+u*r+l*o-c*i)*2,n[1]=(l*a+u*i+c*r-s*o)*2,n[2]=(c*a+u*o+s*i-l*r)*2),EE(t,e,n),t}function yh(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function cl(t,e){var n=e[0],r=e[1],i=e[2],o=e[4],a=e[5],s=e[6],l=e[8],c=e[9],u=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(l,c,u),t}function mh(t,e){var n=new Re(3);cl(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,s=e[1]*i,l=e[2]*o,c=e[4]*r,u=e[5]*i,f=e[6]*o,d=e[8]*r,h=e[9]*i,p=e[10]*o,v=a+u+p,g=0;return v>0?(g=Math.sqrt(v+1)*2,t[3]=.25*g,t[0]=(f-h)/g,t[1]=(d-l)/g,t[2]=(s-c)/g):a>u&&a>p?(g=Math.sqrt(1+a-u-p)*2,t[3]=(f-h)/g,t[0]=.25*g,t[1]=(s+c)/g,t[2]=(d+l)/g):u>p?(g=Math.sqrt(1+u-a-p)*2,t[3]=(d-l)/g,t[0]=(s+c)/g,t[1]=.25*g,t[2]=(f+h)/g):(g=Math.sqrt(1+p-a-u)*2,t[3]=(s-c)/g,t[0]=(d+l)/g,t[1]=(f+h)/g,t[2]=.25*g),t}function Wz(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],l=i+i,c=o+o,u=a+a,f=i*l,d=i*c,h=i*u,p=o*c,v=o*u,g=a*u,y=s*l,m=s*c,b=s*u,x=r[0],w=r[1],O=r[2];return t[0]=(1-(p+g))*x,t[1]=(d+b)*x,t[2]=(h-m)*x,t[3]=0,t[4]=(d-b)*w,t[5]=(1-(f+g))*w,t[6]=(v+y)*w,t[7]=0,t[8]=(h+m)*O,t[9]=(v-y)*O,t[10]=(1-(f+p))*O,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function vu(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],l=e[3],c=o+o,u=a+a,f=s+s,d=o*c,h=o*u,p=o*f,v=a*u,g=a*f,y=s*f,m=l*c,b=l*u,x=l*f,w=r[0],O=r[1],_=r[2],S=i[0],E=i[1],M=i[2],P=(1-(v+y))*w,C=(h+x)*w,A=(p-b)*w,T=(h-x)*O,k=(1-(d+y))*O,N=(g+m)*O,j=(p+b)*_,L=(g-m)*_,I=(1-(d+v))*_;return t[0]=P,t[1]=C,t[2]=A,t[3]=0,t[4]=T,t[5]=k,t[6]=N,t[7]=0,t[8]=j,t[9]=L,t[10]=I,t[11]=0,t[12]=n[0]+S-(P*S+T*E+j*M),t[13]=n[1]+E-(C*S+k*E+L*M),t[14]=n[2]+M-(A*S+N*E+I*M),t[15]=1,t}function qy(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,l=i+i,c=n*a,u=r*a,f=r*s,d=i*a,h=i*s,p=i*l,v=o*a,g=o*s,y=o*l;return t[0]=1-f-p,t[1]=u+y,t[2]=d-g,t[3]=0,t[4]=u-y,t[5]=1-c-p,t[6]=h+v,t[7]=0,t[8]=d+g,t[9]=h-v,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Gz(t,e,n,r,i,o,a){var s=1/(n-e),l=1/(i-r),c=1/(o-a);return t[0]=o*2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o*2*l,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*l,t[10]=(a+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*c,t[15]=0,t}function ME(t,e,n,r,i){var o=1/Math.tan(e/2),a;return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,i!=null&&i!==1/0?(a=1/(r-i),t[10]=(i+r)*a,t[14]=2*i*r*a):(t[10]=-1,t[14]=-2*r),t}var Hz=ME;function Uz(t,e,n,r,i){var o=1/Math.tan(e/2),a;return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,i!=null&&i!==1/0?(a=1/(r-i),t[10]=i*a,t[14]=i*r*a):(t[10]=-1,t[14]=-r),t}function Vz(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(a+s),c=2/(i+o);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-((a-s)*l*.5),t[9]=(i-o)*c*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t}function PE(t,e,n,r,i,o,a){var s=1/(e-n),l=1/(r-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*l,t[14]=(a+o)*c,t[15]=1,t}var AE=PE;function CE(t,e,n,r,i,o,a){var s=1/(e-n),l=1/(r-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*l,t[14]=o*c,t[15]=1,t}function TE(t,e,n,r){var i,o,a,s,l,c,u,f,d,h,p=e[0],v=e[1],g=e[2],y=r[0],m=r[1],b=r[2],x=n[0],w=n[1],O=n[2];return Math.abs(p-x)<be&&Math.abs(v-w)<be&&Math.abs(g-O)<be?pu(t):(u=p-x,f=v-w,d=g-O,h=1/Math.hypot(u,f,d),u*=h,f*=h,d*=h,i=m*d-b*f,o=b*u-y*d,a=y*f-m*u,h=Math.hypot(i,o,a),h?(h=1/h,i*=h,o*=h,a*=h):(i=0,o=0,a=0),s=f*a-d*o,l=d*i-u*a,c=u*o-f*i,h=Math.hypot(s,l,c),h?(h=1/h,s*=h,l*=h,c*=h):(s=0,l=0,c=0),t[0]=i,t[1]=s,t[2]=u,t[3]=0,t[4]=o,t[5]=l,t[6]=f,t[7]=0,t[8]=a,t[9]=c,t[10]=d,t[11]=0,t[12]=-(i*p+o*v+a*g),t[13]=-(s*p+l*v+c*g),t[14]=-(u*p+f*v+d*g),t[15]=1,t)}function Xz(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=r[0],l=r[1],c=r[2],u=i-n[0],f=o-n[1],d=a-n[2],h=u*u+f*f+d*d;h>0&&(h=1/Math.sqrt(h),u*=h,f*=h,d*=h);var p=l*d-c*f,v=c*u-s*d,g=s*f-l*u;return h=p*p+v*v+g*g,h>0&&(h=1/Math.sqrt(h),p*=h,v*=h,g*=h),t[0]=p,t[1]=v,t[2]=g,t[3]=0,t[4]=f*g-d*v,t[5]=d*p-u*g,t[6]=u*v-f*p,t[7]=0,t[8]=u,t[9]=f,t[10]=d,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t}function qz(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function Kz(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Zz(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t}function kE(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}function Qz(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t}function Jz(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t}function tY(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function eY(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],f=t[9],d=t[10],h=t[11],p=t[12],v=t[13],g=t[14],y=t[15],m=e[0],b=e[1],x=e[2],w=e[3],O=e[4],_=e[5],S=e[6],E=e[7],M=e[8],P=e[9],C=e[10],A=e[11],T=e[12],k=e[13],N=e[14],j=e[15];return Math.abs(n-m)<=be*Math.max(1,Math.abs(n),Math.abs(m))&&Math.abs(r-b)<=be*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-x)<=be*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(o-w)<=be*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(a-O)<=be*Math.max(1,Math.abs(a),Math.abs(O))&&Math.abs(s-_)<=be*Math.max(1,Math.abs(s),Math.abs(_))&&Math.abs(l-S)<=be*Math.max(1,Math.abs(l),Math.abs(S))&&Math.abs(c-E)<=be*Math.max(1,Math.abs(c),Math.abs(E))&&Math.abs(u-M)<=be*Math.max(1,Math.abs(u),Math.abs(M))&&Math.abs(f-P)<=be*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(d-C)<=be*Math.max(1,Math.abs(d),Math.abs(C))&&Math.abs(h-A)<=be*Math.max(1,Math.abs(h),Math.abs(A))&&Math.abs(p-T)<=be*Math.max(1,Math.abs(p),Math.abs(T))&&Math.abs(v-k)<=be*Math.max(1,Math.abs(v),Math.abs(k))&&Math.abs(g-N)<=be*Math.max(1,Math.abs(g),Math.abs(N))&&Math.abs(y-j)<=be*Math.max(1,Math.abs(y),Math.abs(j))}var LE=On,nY=kE;const rY=Object.freeze(Object.defineProperty({__proto__:null,add:Zz,adjoint:jz,clone:Hy,copy:qa,create:Kt,determinant:OE,equals:eY,exactEquals:tY,frob:Kz,fromQuat:qy,fromQuat2:Yz,fromRotation:Fz,fromRotationTranslation:EE,fromRotationTranslationScale:Wz,fromRotationTranslationScaleOrigin:vu,fromScaling:Xy,fromTranslation:Vy,fromValues:Iz,fromXRotation:Rz,fromYRotation:Bz,fromZRotation:zz,frustum:Gz,getRotation:mh,getScaling:cl,getTranslation:yh,identity:pu,invert:oi,lookAt:TE,mul:LE,multiply:On,multiplyScalar:Qz,multiplyScalarAndAdd:Jz,ortho:AE,orthoNO:PE,orthoZO:CE,perspective:Hz,perspectiveFromFieldOfView:Vz,perspectiveNO:ME,perspectiveZO:Uz,rotate:Dz,rotateX:_E,rotateY:SE,rotateZ:$z,scale:gh,set:Uy,str:qz,sub:nY,subtract:kE,targetTo:Xz,translate:Yo,transpose:wE},Symbol.toStringTag,{value:"Module"}));function Ct(){var t=new Re(3);return Re!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function to(t){var e=new Re(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function eo(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function jt(t,e,n){var r=new Re(3);return r[0]=t,r[1]=e,r[2]=n,r}function Vn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function ai(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function ul(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function NE(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function iY(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function Ky(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function oY(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.hypot(n,r,i)}function Ka(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function Pi(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function bh(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],l=n[2];return t[0]=i*l-o*s,t[1]=o*a-r*l,t[2]=r*s-i*a,t}function Zy(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}function Qe(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function IE(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t}function aY(t,e,n){var r=n[0],i=n[1],o=n[2],a=n[3],s=e[0],l=e[1],c=e[2],u=i*c-o*l,f=o*s-r*c,d=r*l-i*s,h=i*d-o*f,p=o*u-r*d,v=r*f-i*u,g=a*2;return u*=g,f*=g,d*=g,h*=2,p*=2,v*=2,t[0]=s+u+h,t[1]=l+f+p,t[2]=c+d+v,t}function gu(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2];return Math.abs(n-o)<=be*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=be*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=be*Math.max(1,Math.abs(i),Math.abs(s))}var jE=oY,DE=eo;(function(){var t=Ct();return function(e,n,r,i,o,a){var s,l;for(n||(n=3),r||(r=0),i?l=Math.min(i*n+r,e.length):l=e.length,s=r;s<l;s+=n)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],o(t,t,a),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2];return e}})();function fl(){var t=new Re(4);return Re!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function sY(t,e,n,r){var i=new Re(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function lY(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function cY(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t}function dl(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}(function(){var t=fl();return function(e,n,r,i,o,a){var s,l;for(n||(n=4),r||(r=0),i?l=Math.min(i*n+r,e.length):l=e.length,s=r;s<l;s+=n)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],t[3]=e[s+3],o(t,t,a),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2],e[s+3]=t[3];return e}})();function Ge(){var t=new Re(4);return Re!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Wo(t,e,n){n=n*.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function Go(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],l=n[1],c=n[2],u=n[3];return t[0]=r*u+a*s+i*c-o*l,t[1]=i*u+a*l+o*s-r*c,t[2]=o*u+a*c+r*l-i*s,t[3]=a*u-r*s-i*l-o*c,t}function Qy(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],l=n[0],c=n[1],u=n[2],f=n[3],d,h,p,v,g;return h=i*l+o*c+a*u+s*f,h<0&&(h=-h,l=-l,c=-c,u=-u,f=-f),1-h>be?(d=Math.acos(h),p=Math.sin(d),v=Math.sin((1-r)*d)/p,g=Math.sin(r*d)/p):(v=1-r,g=r),t[0]=v*i+g*l,t[1]=v*o+g*c,t[2]=v*a+g*u,t[3]=v*s+g*f,t}function Jy(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,t}function uY(t,e){var n=e[0]+e[4]+e[8],r;if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[i*3+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;r=Math.sqrt(e[i*3+i]-e[o*3+o]-e[a*3+a]+1),t[i]=.5*r,r=.5/r,t[3]=(e[o*3+a]-e[a*3+o])*r,t[o]=(e[o*3+i]+e[i*3+o])*r,t[a]=(e[a*3+i]+e[i*3+a])*r}return t}function xh(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var o=Math.sin(e),a=Math.cos(e),s=Math.sin(n),l=Math.cos(n),c=Math.sin(r),u=Math.cos(r);return t[0]=o*l*u-a*s*c,t[1]=a*s*u+o*l*c,t[2]=a*l*c-o*s*u,t[3]=a*l*u+o*s*c,t}var tm=sY,wh=lY,$E=Go,Oh=cY;(function(){var t=Ct(),e=jt(1,0,0),n=jt(0,1,0);return function(r,i,o){var a=Pi(i,o);return a<-.999999?(bh(t,e,i),DE(t)<1e-6&&bh(t,n,i),Ka(t,t),Wo(r,t,Math.PI),r):a>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(bh(t,i,o),r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=1+a,Oh(r,r))}})(),function(){var t=Ge(),e=Ge();return function(n,r,i,o,a,s){return Qy(t,r,a,s),Qy(e,i,o,s),Qy(n,t,e,2*s*(1-s)),n}}(),function(){var t=ll();return function(e,n,r,i){return t[0]=r[0],t[3]=r[1],t[6]=r[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-n[0],t[5]=-n[1],t[8]=-n[2],Oh(e,uY(e,t))}}();function fY(){var t=new Re(2);return Re!=Float32Array&&(t[0]=0,t[1]=0),t}function dY(t,e){var n=new Re(2);return n[0]=t,n[1]=e,n}function hY(t,e){return t[0]=e[0],t[1]=e[1],t}function pY(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function vY(t,e){return t[0]*e[0]+t[1]*e[1]}function gY(t,e){return t[0]===e[0]&&t[1]===e[1]}(function(){var t=fY();return function(e,n,r,i,o,a){var s,l;for(n||(n=2),r||(r=0),i?l=Math.min(i*n+r,e.length):l=e.length,s=r;s<l;s+=n)t[0]=e[s],t[1]=e[s+1],o(t,t,a),e[s]=t[0],e[s+1]=t[1];return e}})();var em=function(t,e){return em=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},em(t,e)};function st(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");em(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var G=function(){return G=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},G.apply(this,arguments)};function Qt(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function hl(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?o(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})}function pl(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=e.call(t,n)}catch(u){c=[6,u],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function ur(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function D(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function nm(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var r=Array(t),i=0,e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}function Q(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}function rm(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)}typeof SuppressedError=="function"&&SuppressedError;function le(t,e){if(t!==null)return{type:"column",value:t,field:e}}function _h(t,e){const n=le(t,e);return Object.assign(Object.assign({},n),{inferred:!0})}function Sh(t,e){if(t!==null)return{type:"column",value:t,field:e,visual:!0}}function yY(t,e){const n=le(t,e);return Object.assign(Object.assign({},n),{constant:!1})}function Ho(t,e){const n=[];for(const r of t)n[r]=e;return n}function It(t,e){const n=t[e];if(!n)return[null,null];const{value:r,field:i=null}=n;return[r,i]}function yu(t,...e){for(const n of e)if(typeof n=="string"){const[r,i]=It(t,n);if(r!==null)return[r,i]}else return[n,null];return[null,null]}function mu(t){return t instanceof Date?!1:typeof t=="object"}const bu=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;return r!==void 0?[t,e]:[t,Z({},e,{encode:{y1:_h(Ho(t,0))}})]};bu.props={};function Te(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function mY(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function vl(t){let e,n,r;t.length!==2?(e=Te,n=(s,l)=>Te(t(s),l),r=(s,l)=>t(s)-l):(e=t===Te||t===mY?t:bY,n=t,r=t);function i(s,l,c=0,u=s.length){if(c<u){if(e(l,l)!==0)return u;do{const f=c+u>>>1;n(s[f],l)<0?c=f+1:u=f}while(c<u)}return c}function o(s,l,c=0,u=s.length){if(c<u){if(e(l,l)!==0)return u;do{const f=c+u>>>1;n(s[f],l)<=0?c=f+1:u=f}while(c<u)}return c}function a(s,l,c=0,u=s.length){const f=i(s,l,c,u-1);return f>c&&r(s[f-1],l)>-r(s[f],l)?f-1:f}return{left:i,center:a,right:o}}function bY(){return 0}function im(t){return t===null?NaN:+t}function*xY(t,e){if(e===void 0)for(let n of t)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of t)(r=e(r,++n,t))!=null&&(r=+r)>=r&&(yield r)}}const FE=vl(Te),wY=FE.right,OY=FE.left,_Y=vl(im).center,SY=wY;function RE(t,e){let n=0;if(e===void 0)for(let r of t)r!=null&&(r=+r)>=r&&++n;else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(i=+i)>=i&&++n}return n}function EY(t,e){let n=0,r,i=0,o=0;if(e===void 0)for(let a of t)a!=null&&(a=+a)>=a&&(r=a-i,i+=r/++n,o+=r*(a-i));else{let a=-1;for(let s of t)(s=e(s,++a,t))!=null&&(s=+s)>=s&&(r=s-i,i+=r/++n,o+=r*(s-i))}if(n>1)return o/(n-1)}function BE(t,e){const n=EY(t,e);return n&&Math.sqrt(n)}function no(t,e){let n,r;if(e===void 0)for(const i of t)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)));else{let i=-1;for(let o of t)(o=e(o,++i,t))!=null&&(n===void 0?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)))}return[n,r]}class Za{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){const n=this._partials;let r=0;for(let i=0;i<this._n&&i<32;i++){const o=n[i],a=e+o,s=Math.abs(e)<Math.abs(o)?e-(a-o):o-(a-e);s&&(n[r++]=s),e=a}return n[r]=e,this._n=r+1,this}valueOf(){const e=this._partials;let n=this._n,r,i,o,a=0;if(n>0){for(a=e[--n];n>0&&(r=a,i=e[--n],a=r+i,o=i-(a-r),!o););n>0&&(o<0&&e[n-1]<0||o>0&&e[n-1]>0)&&(i=o*2,r=a+i,i==r-a&&(a=r))}return a}}let MY=class extends Map{constructor(e,n=CY){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[r,i]of e)this.set(r,i)}get(e){return super.get(zE(this,e))}has(e){return super.has(zE(this,e))}set(e,n){return super.set(PY(this,e),n)}delete(e){return super.delete(AY(this,e))}};function zE({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function PY({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function AY({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function CY(t){return t!==null&&typeof t=="object"?t.valueOf():t}function xu(t){return t}function xe(t,...e){return Eh(t,xu,xu,e)}function om(t,...e){return Eh(t,Array.from,xu,e)}function am(t,e,...n){return Eh(t,xu,e,n)}function YE(t,e,...n){return Eh(t,Array.from,e,n)}function Eh(t,e,n,r){return function i(o,a){if(a>=r.length)return n(o);const s=new MY,l=r[a++];let c=-1;for(const u of o){const f=l(u,++c,o),d=s.get(f);d?d.push(u):s.set(f,[u])}for(const[u,f]of s)s.set(u,i(f,a));return e(s)}(t,0)}function TY(t,e){return Array.from(e,n=>t[n])}function ro(t,...e){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&n.length!==2||e.length>1){const r=Uint32Array.from(t,(i,o)=>o);return e.length>1?(e=e.map(i=>t.map(i)),r.sort((i,o)=>{for(const a of e){const s=wu(a[i],a[o]);if(s)return s}})):(n=t.map(n),r.sort((i,o)=>wu(n[i],n[o]))),TY(t,r)}return t.sort(WE(n))}function WE(t=Te){if(t===Te)return wu;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||r===0?r:(t(n,n)===0)-(t(e,e)===0)}}function wu(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(t<e?-1:t>e?1:0)}function kY(t,e,n){return(e.length!==2?ro(am(t,e,n),([r,i],[o,a])=>Te(i,a)||Te(r,o)):ro(xe(t,n),([r,i],[o,a])=>e(i,a)||Te(r,o))).map(([r])=>r)}var LY=Array.prototype,NY=LY.slice;function sm(t){return()=>t}const IY=Math.sqrt(50),jY=Math.sqrt(10),DY=Math.sqrt(2);function Mh(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=IY?10:o>=jY?5:o>=DY?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/a,s=Math.round(t*c),l=Math.round(e*c),s/c<t&&++s,l/c>e&&--l,c=-c):(c=Math.pow(10,i)*a,s=Math.round(t/c),l=Math.round(e/c),s*c<t&&++s,l*c>e&&--l),l<s&&.5<=n&&n<2?Mh(t,e,n*2):[s,l,c]}function $Y(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const r=e<t,[i,o,a]=r?Mh(e,t,n):Mh(t,e,n);if(!(o>=i))return[];const s=o-i+1,l=new Array(s);if(r)if(a<0)for(let c=0;c<s;++c)l[c]=(o-c)/-a;else for(let c=0;c<s;++c)l[c]=(o-c)*a;else if(a<0)for(let c=0;c<s;++c)l[c]=(i+c)/-a;else for(let c=0;c<s;++c)l[c]=(i+c)*a;return l}function lm(t,e,n){return e=+e,t=+t,n=+n,Mh(t,e,n)[2]}function FY(t,e,n){let r;for(;;){const i=lm(t,e,n);if(i===r||i===0||!isFinite(i))return[t,e];i>0?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),r=i}}function RY(t){return Math.max(1,Math.ceil(Math.log(RE(t))/Math.LN2)+1)}function BY(){var t=xu,e=no,n=RY;function r(i){Array.isArray(i)||(i=Array.from(i));var o,a=i.length,s,l,c=new Array(a);for(o=0;o<a;++o)c[o]=t(i[o],o,i);var u=e(c),f=u[0],d=u[1],h=n(c,f,d);if(!Array.isArray(h)){const b=d,x=+h;if(e===no&&([f,d]=FY(f,d,x)),h=$Y(f,d,x),h[0]<=f&&(l=lm(f,d,x)),h[h.length-1]>=d)if(b>=d&&e===no){const w=lm(f,d,x);isFinite(w)&&(w>0?d=(Math.floor(d/w)+1)*w:w<0&&(d=(Math.ceil(d*-w)+1)/-w))}else h.pop()}for(var p=h.length,v=0,g=p;h[v]<=f;)++v;for(;h[g-1]>d;)--g;(v||g<p)&&(h=h.slice(v,g),p=g-v);var y=new Array(p+1),m;for(o=0;o<=p;++o)m=y[o]=[],m.x0=o>0?h[o-1]:f,m.x1=o<p?h[o]:d;if(isFinite(l)){if(l>0)for(o=0;o<a;++o)(s=c[o])!=null&&f<=s&&s<=d&&y[Math.min(p,Math.floor((s-f)/l))].push(i[o]);else if(l<0){for(o=0;o<a;++o)if((s=c[o])!=null&&f<=s&&s<=d){const b=Math.floor((f-s)*l);y[Math.min(p,b+(h[b]<=s))].push(i[o])}}}else for(o=0;o<a;++o)(s=c[o])!=null&&f<=s&&s<=d&&y[SY(h,s,0,p)].push(i[o]);return y}return r.value=function(i){return arguments.length?(t=typeof i=="function"?i:sm(i),r):t},r.domain=function(i){return arguments.length?(e=typeof i=="function"?i:sm([i[0],i[1]]),r):e},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:sm(Array.isArray(i)?NY.call(i):i),r):n},r}function Gt(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function gl(t,e){let n,r=-1,i=-1;if(e===void 0)for(const o of t)++i,o!=null&&(n<o||n===void 0&&o>=o)&&(n=o,r=i);else for(let o of t)(o=e(o,++i,t))!=null&&(n<o||n===void 0&&o>=o)&&(n=o,r=i);return r}function fr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function Ph(t,e){let n,r=-1,i=-1;if(e===void 0)for(const o of t)++i,o!=null&&(n>o||n===void 0&&o>=o)&&(n=o,r=i);else for(let o of t)(o=e(o,++i,t))!=null&&(n>o||n===void 0&&o>=o)&&(n=o,r=i);return r}function cm(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=i===void 0?wu:WE(i);r>n;){if(r-n>600){const l=r-n+1,c=e-n+1,u=Math.log(l),f=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1),h=Math.max(n,Math.floor(e-c*f/l+d)),p=Math.min(r,Math.floor(e+(l-c)*f/l+d));cm(t,e,h,p,i)}const o=t[e];let a=n,s=r;for(Ou(t,n,e),i(t[r],o)>0&&Ou(t,n,r);a<s;){for(Ou(t,a,s),++a,--s;i(t[a],o)<0;)++a;for(;i(t[s],o)>0;)--s}i(t[n],o)===0?Ou(t,n,s):(++s,Ou(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function Ou(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function zY(t,e=Te){let n,r=!1;if(e.length===1){let i;for(const o of t){const a=e(o);(r?Te(a,i)>0:Te(a,a)===0)&&(n=o,i=a,r=!0)}}else for(const i of t)(r?e(i,n)>0:e(i,i)===0)&&(n=i,r=!0);return n}function Ah(t,e,n){if(t=Float64Array.from(xY(t,n)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return fr(t);if(e>=1)return Gt(t);var r,i=(r-1)*e,o=Math.floor(i),a=Gt(cm(t,o).subarray(0,o+1)),s=fr(t.subarray(o+1));return a+(s-a)*(i-o)}}function YY(t,e,n=im){if(!isNaN(e=+e)){if(r=Float64Array.from(t,(s,l)=>im(n(t[l],l,t))),e<=0)return Ph(r);if(e>=1)return gl(r);var r,i=Uint32Array.from(t,(s,l)=>l),o=r.length-1,a=Math.floor(o*e);return cm(i,a,0,o,(s,l)=>wu(r[s],r[l])),a=zY(i.subarray(0,a+1),s=>r[s]),a>=0?a:-1}}function WY(t,e,n){const r=RE(t),i=BE(t);return r&&i?Math.ceil((n-e)*Math.cbrt(r)/(3.49*i)):1}function _u(t,e){let n=0,r=0;if(e===void 0)for(let i of t)i!=null&&(i=+i)>=i&&(++n,r+=i);else{let i=-1;for(let o of t)(o=e(o,++i,t))!=null&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function um(t,e){return Ah(t,.5,e)}function GY(t,e){return YY(t,.5,e)}function*HY(t){for(const e of t)yield*iB(e)}function GE(t){return Array.from(HY(t))}function yl(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,o=new Array(i);++r<i;)o[r]=t+r*n;return o}function kr(t,e){let n=0;if(e===void 0)for(let r of t)(r=+r)&&(n+=r);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}var UY=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?o(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})};function Qa(t){return t}function fm(t){return t.reduce((e,n)=>(r,...i)=>n(e(r,...i),...i),Qa)}function VY(t){return t.reduce((e,n)=>r=>UY(this,void 0,void 0,function*(){const i=yield e(r);return n(i)}),Qa)}function dm(t){return t.replace(/( |^)[a-z]/g,e=>e.toUpperCase())}function ml(t=""){throw new Error(t)}function hm(t,e){const{attributes:n}=e,r=new Set(["id","className"]);for(const[i,o]of Object.entries(n))r.has(i)||(i==="transform"&&t.attr(i,""),t.attr(i,o))}function ie(t){return t!=null&&!Number.isNaN(t)}function XY(t){const e=new Map;return n=>{if(e.has(n))return e.get(n);const r=t(n);return e.set(n,r),r}}function qY(t,e){const{transform:n}=t.style,i=(o=>o==="none"||o===void 0)(n)?"":n;t.style.transform=`${i} ${e}`.trimStart()}function ot(t,e){return HE(t,e)||{}}function HE(t,e){const n=Object.entries(t||{}).filter(([r])=>r.startsWith(e)).map(([r,i])=>[yE(r.replace(e,"").trim()),i]).filter(([r])=>!!r);return n.length===0?null:Object.fromEntries(n)}function KY(t,e){return Object.fromEntries(Object.entries(t).filter(([n])=>e.find(r=>n.startsWith(r))))}function pm(t,...e){return Object.fromEntries(Object.entries(t).filter(([n])=>e.every(r=>!n.startsWith(r))))}function UE(t,e){if(t===void 0)return null;if(typeof t=="number")return t;const n=+t.replace("%","");return Number.isNaN(n)?null:n/100*e}function Su(t){return typeof t=="object"&&!(t instanceof Date)&&t!==null&&!Array.isArray(t)}function io(t){return t===null||t===!1}function VE(t,e,n=5,r=0){if(!(r>=n)){for(const i of Object.keys(e)){const o=e[i];!Ua(o)||!Ua(t[i])?t[i]=o:VE(t[i],o,n,r+1)}return t}}function Uo(t,e){return Object.entries(t).reduce((n,[r,i])=>(n[r]=e(i,r,t),n),{})}function Ja(t){return t.map((e,n)=>n)}function ZY(t){return t[0]}function XE(t){return t[t.length-1]}function QY(t){return Array.from(new Set(t))}function qE(t,e){const n=[[],[]];return t.forEach(r=>{n[e(r)?0:1].push(r)}),n}function KE(t,e=t.length){if(e===1)return t.map(r=>[r]);const n=[];for(let r=0;r<t.length;r++){const i=t.slice(r+1);KE(i,e-1).forEach(a=>{n.push([t[r],...a])})}return n}function JY(t){if(t.length===1)return[t];const e=[];for(let n=1;n<=t.length;n++)e.push(...KE(t,n));return e}function Vo(t,e,n){const{encode:r}=n;if(t===null)return[e];const i=tW(t).map(a=>{var s;return[a,(s=It(r,a))===null||s===void 0?void 0:s[0]]}).filter(([,a])=>ie(a)),o=a=>i.map(([,s])=>s[a]).join("-");return Array.from(xe(e,o).values())}function ZE(t){return Array.isArray(t)?rW(t):typeof t=="function"?nW(t):t==="series"?eW:t==="value"?iW:t==="sum"?oW:t==="maxIndex"?aW:()=>null}function QE(t,e){for(const n of t)n.sort(e)}function JE(t,e){return(e==null?void 0:e.domain)||Array.from(new Set(t))}function tW(t){return Array.isArray(t)?t:[t]}function eW(t,e,n){return Eu(r=>n[r])}function nW(t){return(e,n,r)=>Eu(i=>t(e[i]))}function rW(t){return(e,n,r)=>(i,o)=>t.reduce((a,s)=>a!==0?a:Te(e[i][s],e[o][s]),0)}function iW(t,e,n){return Eu(r=>e[r])}function oW(t,e,n){const r=Ja(t),i=Array.from(xe(r,a=>n[+a]).entries()),o=new Map(i.map(([a,s])=>[a,s.reduce((l,c)=>l+ +e[c])]));return Eu(a=>o.get(n[a]))}function aW(t,e,n){const r=Ja(t),i=Array.from(xe(r,a=>n[+a]).entries()),o=new Map(i.map(([a,s])=>[a,gl(s,l=>e[l])]));return Eu(a=>o.get(n[a]))}function Eu(t){return(e,n)=>Te(t(e),t(n))}const tM=(t={})=>{const{groupBy:e="x",orderBy:n=null,reverse:r=!1,y:i="y",y1:o="y1",series:a=!0}=t;return(s,l)=>{const{data:c,encode:u,style:f={}}=l,[d,h]=It(u,"y"),[p,v]=It(u,"y1"),[g]=a?yu(u,"series","color"):It(u,"color"),y=Vo(e,s,l),b=ZE(n)(c,d,g);b&&QE(y,b);const x=new Array(s.length),w=new Array(s.length),O=new Array(s.length),_=[],S=[];for(const A of y){r&&A.reverse();const T=p?+p[A[0]]:0,k=[],N=[];for(const B of A){const W=O[B]=+d[B]-T;W<0?N.push(B):W>=0&&k.push(B)}const j=k.length>0?k:N,L=N.length>0?N:k;let I=k.length-1,$=0;for(;I>0&&d[j[I]]===0;)I--;for(;$<L.length-1&&d[L[$]]===0;)$++;_.push(j[I]),S.push(L[$]);let F=T;for(const B of N.reverse()){const W=O[B];F=x[B]=(w[B]=F)+W}let R=T;for(const B of k){const W=O[B];W>0?R=x[B]=(w[B]=R)+W:x[B]=w[B]=R}}const E=new Set(_),M=new Set(S),P=i==="y"?x:w,C=o==="y"?x:w;return[s,Z({},l,{encode:{y0:_h(d,h),y:le(P,h),y1:le(C,v)},style:Object.assign({first:(A,T)=>E.has(T),last:(A,T)=>M.has(T)},f)})]}};tM.props={};function Mu(t){return Math.abs(t)>10?String(t):t.toString().padStart(2,"0")}function sW(t){const e=t.getFullYear(),n=Mu(t.getMonth()+1),r=Mu(t.getDate()),i=`${e}-${n}-${r}`,o=t.getHours(),a=t.getMinutes(),s=t.getSeconds();return o||a||s?`${i} ${Mu(o)}:${Mu(a)}:${Mu(s)}`:i}const Ch=(t={})=>{const{channel:e="x"}=t;return(n,r)=>{const{encode:i}=r,{tooltip:o}=r;if(io(o))return[n,r];const{title:a}=o;if(a!==void 0)return[n,r];const s=Object.keys(i).filter(c=>c.startsWith(e)).filter(c=>!i[c].inferred).map(c=>It(i,c)).filter(([c])=>c).map(c=>c[0]);if(s.length===0)return[n,r];const l=[];for(const c of n)l[c]={value:s.map(u=>u[c]instanceof Date?sW(u[c]):u[c]).join(", ")};return[n,Z({},r,{tooltip:{title:l}})]}};Ch.props={};const ts=()=>(t,e)=>{const{encode:n}=e,{x:r}=n;return r!==void 0?[t,e]:[t,Z({},e,{encode:{x:_h(Ho(t,0))},scale:{x:{guide:null}}})]};ts.props={};const Th=()=>(t,e)=>{const{encode:n}=e,{y:r}=n;return r!==void 0?[t,e]:[t,Z({},e,{encode:{y:_h(Ho(t,0))},scale:{y:{guide:null}}})]};Th.props={};const eM=()=>(t,e)=>{const{encode:n}=e,{size:r}=n;return r!==void 0?[t,e]:[t,Z({},e,{encode:{size:Sh(Ho(t,3))}})]};eM.props={};var lW=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const nM=()=>(t,e)=>{const{encode:n}=e,{key:r}=n,i=lW(n,["key"]);if(r!==void 0)return[t,e];const o=Object.values(i).map(({value:s})=>s),a=t.map(s=>o.filter(Array.isArray).map(l=>l[s]).join("-"));return[t,Z({},e,{encode:{key:le(a)}})]};nM.props={};const vm=()=>(t,e)=>{const{encode:n}=e,{series:r,color:i}=n;if(r!==void 0||i===void 0)return[t,e];const[o,a]=It(n,"color");return[t,Z({},e,{encode:{series:le(o,a)}})]};vm.props={};const rM=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(mu)?[t,e]:[t,Z({},e,{encode:{y:le(n)}})]};rM.props={};const iM=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(mu)?[t,e]:[t,Z({},e,{encode:{x:le(n)}})]};iM.props={};const oM=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;if(r)return[t,e];const[i]=It(n,"y");return[t,Z({},e,{encode:{y1:le([...i])}})]};oM.props={};const aM=()=>(t,e)=>{const{encode:n}=e,{x1:r}=n;if(r)return[t,e];const[i]=It(n,"x");return[t,Z({},e,{encode:{x1:le([...i])}})]};aM.props={};const sM=()=>(t,e)=>{const{data:n}=e;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(mu))){const r=(i,o)=>Array.isArray(i[0])?i.map(a=>a[o]):[i[o]];return[t,Z({},e,{encode:{x:le(r(n,0)),x1:le(r(n,1))}})]}return[t,e]};sM.props={};const lM=()=>(t,e)=>{const{data:n}=e;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(mu))){const r=(i,o)=>Array.isArray(i[0])?i.map(a=>a[o]):[i[o]];return[t,Z({},e,{encode:{y:le(r(n,0)),y1:le(r(n,1))}})]}return[t,e]};lM.props={};const kh=t=>{const{channel:e}=t;return(n,r)=>{const{encode:i,tooltip:o}=r;if(io(o))return[n,r];const{items:a=[]}=o;if(!a||a.length>0)return[n,r];const l=(Array.isArray(e)?e:[e]).flatMap(c=>Object.keys(i).filter(u=>u.startsWith(c)).map(u=>{const{field:f,value:d,inferred:h=!1,aggregate:p}=i[u];return h?null:p&&d?{channel:u}:f?{field:f}:d?{channel:u}:null}).filter(u=>u!==null));return[n,Z({},r,{tooltip:{items:l}})]}};kh.props={};const gm=()=>(t,e)=>[t,Z({scale:{x:{padding:0},y:{padding:0}}},e)];gm.props={};var cM=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const Lh=()=>(t,e)=>{const{data:n,style:r={}}=e,i=cM(e,["data","style"]),{x:o,y:a}=r,s=cM(r,["x","y"]);if(o==null||a==null)return[t,e];const l=o||0,c=a||0;return[[0],Z({},i,{data:[0],cartesian:!0,encode:{x:le([l]),y:le([c])},scale:{x:{type:"identity",independent:!0,guide:null},y:{type:"identity",independent:!0,guide:null}},style:s})]};Lh.props={};const uM=()=>(t,e)=>{const{style:n={}}=e;return[t,Z({},e,{style:Object.assign(Object.assign({},n),Object.fromEntries(Object.entries(n).filter(([,r])=>typeof r=="function").map(([r,i])=>[r,()=>i])))})]};uM.props={};const Nh=()=>(t,e)=>{const{data:n}=e;if(!Array.isArray(n)||n.some(mu))return[t,e];const r=Array.isArray(n[0])?n:[n],i=r.map(a=>a[0]),o=r.map(a=>a[1]);return[t,Z({},e,{encode:{x:le(i),y:le(o)}})]};Nh.props={};const fM=()=>(t,e)=>{const{style:n={},encode:r}=e,{series:i}=r,{gradient:o}=n;return!o||i?[t,e]:[t,Z({},e,{encode:{series:Sh(Ho(t,void 0))}})]};fM.props={};var cW=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const dM=(t={})=>{const{groupBy:e="x",reverse:n=!1,orderBy:r,padding:i}=t;return cW(t,["groupBy","reverse","orderBy","padding"]),(o,a)=>{const{data:s,encode:l,scale:c}=a,{series:u}=c,[f]=It(l,"y"),[d]=yu(l,"series","color"),h=JE(d,u),p=Vo(e,o,a),g=ZE(r)(s,f,d);g&&QE(p,g);const y=new Array(o.length);for(const m of p){n&&m.reverse();for(let b=0;b<m.length;b++)y[m[b]]=h[b]}return[o,Z({},a,{scale:{series:{domain:h,paddingInner:i}},encode:{series:le(y)}})]}};dM.props={};const hM=t=>{const{groupBy:e=["x"],reducer:n=(a,s)=>s[a[0]],orderBy:r=null,reverse:i=!1,duration:o}=t;return(a,s)=>{const{encode:l}=s,u=(Array.isArray(e)?e:[e]).map(g=>[g,It(l,g)[0]]);if(u.length===0)return[a,s];let f=[a];for(const[,g]of u){const y=[];for(const m of f){const b=Array.from(xe(m,x=>g[x]).values());y.push(...b)}f=y}if(r){const[g]=It(l,r);g&&f.sort((y,m)=>n(y,g)-n(m,g)),i&&f.reverse()}const d=(o||3e3)/f.length,[h]=o?[Ho(a,d)]:yu(l,"enterDuration",Ho(a,d)),[p]=yu(l,"enterDelay",Ho(a,0)),v=new Array(a.length);for(let g=0,y=0;g<f.length;g++){const m=f[g],b=Gt(m,x=>+h[x]);for(const x of m)v[x]=+p[x]+y;y+=b}return[a,Z({},s,{encode:{enterDuration:Sh(h),enterDelay:Sh(v)}})]}};hM.props={};var uW=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function fW(t){return typeof t=="function"?t:{min:(n,r)=>fr(n,i=>r[+i]),max:(n,r)=>Gt(n,i=>r[+i]),first:(n,r)=>r[n[0]],last:(n,r)=>r[n[n.length-1]],mean:(n,r)=>_u(n,i=>r[+i]),median:(n,r)=>um(n,i=>r[+i]),sum:(n,r)=>kr(n,i=>r[+i]),deviation:(n,r)=>BE(n,i=>r[+i])}[t]||Gt}const pM=(t={})=>{const{groupBy:e="x",basis:n="max"}=t;return(r,i)=>{const{encode:o,tooltip:a}=i,s=uW(o,["x"]),l=Object.entries(s).filter(([p])=>p.startsWith("y")).map(([p])=>[p,It(o,p)[0]]),[,c]=l.find(([p])=>p==="y"),u=l.map(([p])=>[p,new Array(r.length)]),f=Vo(e,r,i),d=fW(n);for(const p of f){const v=d(p,c);for(const g of p)for(let y=0;y<l.length;y++){const[,m]=l[y],[,b]=u[y];b[g]=+m[g]/v}}const h=io(a)||(a==null?void 0:a.items)&&(a==null?void 0:a.items.length)!==0;return[r,Z({},i,Object.assign({encode:Object.fromEntries(u.map(([p,v])=>[p,le(v,It(o,p)[1])]))},!h&&o.y0&&{tooltip:{items:[{channel:"y0"}]}}))]}};pM.props={};function bl(t,...e){return e.reduce((n,r)=>i=>n(r(i)),t)}function Ih(t,e){return e-t?n=>(n-t)/(e-t):n=>.5}function dW(t,e){const n=e<t?e:t,r=t>e?t:e;return i=>Math.min(Math.max(n,i),r)}function ym(t,e,n,r,i){let o=n||0,a=r||t.length;const s=i||(l=>l);for(;o<a;){const l=Math.floor((o+a)/2);s(t[l])>e?a=l:o=l+1}return o}const mm=Math.sqrt(50),bm=Math.sqrt(10),xm=Math.sqrt(2);function jh(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/Ce(10,i);return i>=0?(o>=mm?10:o>=bm?5:o>=xm?2:1)*Ce(10,i):-Ce(10,-i)/(o>=mm?10:o>=bm?5:o>=xm?2:1)}function vM(t,e,n){const r=Math.abs(e-t)/Math.max(0,n);let i=Ce(10,Math.floor(Math.log(r)/Math.LN10));const o=r/i;return o>=mm?i*=10:o>=bm?i*=5:o>=xm&&(i*=2),e<t?-i:i}const gM=(t,e,n=5)=>{const r=[t,e];let i=0,o=r.length-1,a=r[i],s=r[o],l;return s<a&&([a,s]=[s,a],[i,o]=[o,i]),l=jh(a,s,n),l>0?(a=Math.floor(a/l)*l,s=Math.ceil(s/l)*l,l=jh(a,s,n)):l<0&&(a=Math.ceil(a*l)/l,s=Math.floor(s*l)/l,l=jh(a,s,n)),l>0?(r[i]=Math.floor(a/l)*l,r[o]=Math.ceil(s/l)*l):l<0&&(r[i]=Math.ceil(a*l)/l,r[o]=Math.floor(s*l)/l),r},Pu=1e3,Au=Pu*60,Cu=Au*60,es=Cu*24,Tu=es*7,yM=es*30,mM=es*365;function _n(t,e,n,r){const i=(c,u)=>{const f=h=>r(h)%u===0;let d=u;for(;d&&!f(c);)n(c,-1),d-=1;return c},o=(c,u)=>{u&&i(c,u),e(c)},a=(c,u)=>{const f=new Date(+c);return o(f,u),f},s=(c,u)=>{const f=new Date(+c-1);return o(f,u),n(f,u),o(f),f};return{ceil:s,floor:a,range:(c,u,f,d)=>{const h=[],p=Math.floor(f),v=d?s(c,f):s(c);for(let g=v;g<u;n(g,p),o(g))h.push(new Date(+g));return h},duration:t}}const hW=_n(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),pW=_n(Pu,t=>{t.setMilliseconds(0)},(t,e=1)=>{t.setTime(+t+Pu*e)},t=>t.getSeconds()),vW=_n(Au,t=>{t.setSeconds(0,0)},(t,e=1)=>{t.setTime(+t+Au*e)},t=>t.getMinutes()),gW=_n(Cu,t=>{t.setMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+Cu*e)},t=>t.getHours()),yW=_n(es,t=>{t.setHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+es*e)},t=>t.getDate()-1),bM=_n(yM,t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e=1)=>{const n=t.getMonth();t.setMonth(n+e)},t=>t.getMonth()),mW=_n(Tu,t=>{t.setDate(t.getDate()-t.getDay()%7),t.setHours(0,0,0,0)},(t,e=1)=>{t.setDate(t.getDate()+7*e)},t=>{const e=bM.floor(t),n=new Date(+t);return Math.floor((+n-+e)/Tu)}),bW=_n(mM,t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e=1)=>{const n=t.getFullYear();t.setFullYear(n+e)},t=>t.getFullYear()),xM={millisecond:hW,second:pW,minute:vW,hour:gW,day:yW,week:mW,month:bM,year:bW},xW=_n(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),wW=_n(Pu,t=>{t.setUTCMilliseconds(0)},(t,e=1)=>{t.setTime(+t+Pu*e)},t=>t.getUTCSeconds()),OW=_n(Au,t=>{t.setUTCSeconds(0,0)},(t,e=1)=>{t.setTime(+t+Au*e)},t=>t.getUTCMinutes()),_W=_n(Cu,t=>{t.setUTCMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+Cu*e)},t=>t.getUTCHours()),SW=_n(es,t=>{t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+es*e)},t=>t.getUTCDate()-1),wM=_n(yM,t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e=1)=>{const n=t.getUTCMonth();t.setUTCMonth(n+e)},t=>t.getUTCMonth()),EW=_n(Tu,t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+Tu*e)},t=>{const e=wM.floor(t),n=new Date(+t);return Math.floor((+n-+e)/Tu)}),MW=_n(mM,t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e=1)=>{const n=t.getUTCFullYear();t.setUTCFullYear(n+e)},t=>t.getUTCFullYear()),OM={millisecond:xW,second:wW,minute:OW,hour:_W,day:SW,week:EW,month:wM,year:MW};function PW(t){const e=t?OM:xM,{year:n,month:r,week:i,day:o,hour:a,minute:s,second:l,millisecond:c}=e;return{tickIntervals:[[l,1],[l,5],[l,15],[l,30],[s,1],[s,5],[s,15],[s,30],[a,1],[a,3],[a,6],[a,12],[o,1],[o,2],[i,1],[r,1],[r,3],[n,1]],year:n,millisecond:c}}function _M(t,e,n,r,i){const o=+t,a=+e,{tickIntervals:s,year:l,millisecond:c}=PW(i),u=([g,y])=>g.duration*y,f=r?(a-o)/r:n||5,d=r||(a-o)/f,h=s.length,p=ym(s,d,0,h,u);let v;if(p===h){const g=vM(o/l.duration,a/l.duration,f);v=[l,g]}else if(p){const g=d/u(s[p-1])<u(s[p])/d,[y,m]=g?s[p-1]:s[p],b=r?Math.ceil(r/y.duration):m;v=[y,b]}else{const g=Math.max(vM(o,a,f),1);v=[c,g]}return v}const AW=(t,e,n,r,i)=>{const o=t>e,a=o?e:t,s=o?t:e,[l,c]=_M(a,s,n,r,i),u=[l.floor(a,c),l.ceil(s,c)];return o?u.reverse():u};var SM=function(t){return t!==null&&typeof t!="function"&&isFinite(t.length)},CW={}.toString,ku=function(t,e){return CW.call(t)==="[object "+e+"]"};const EM=function(t){return ku(t,"Function")};var TW=function(t){return t==null};const MM=function(t){return Array.isArray?Array.isArray(t):ku(t,"Array")},kW=function(t){var e=typeof t;return t!==null&&e==="object"||e==="function"};function LW(t,e){if(t){var n;if(MM(t))for(var r=0,i=t.length;r<i&&(n=e(t[r],r),n!==!1);r++);else if(kW(t)){for(var o in t)if(t.hasOwnProperty(o)&&(n=e(t[o],o),n===!1))break}}}var NW=function(t){return typeof t=="object"&&t!==null},PM=function(t){if(!NW(t)||!ku(t,"Object"))return!1;if(Object.getPrototypeOf(t)===null)return!0;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};const IW=function(t){return ku(t,"String")};var Lu=function(t){return ku(t,"Number")},jW=Object.values?function(t){return Object.values(t)}:function(t){var e=[];return LW(t,function(n,r){EM(t)&&r==="prototype"||e.push(n)}),e},DW=function(t){return t===null},$W=function(t){return t===void 0};const FW=function(t,e){if(!EM(t))throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=t.apply(this,r);return a.set(o,s),s};return n.cache=new Map,n};var RW=5;function AM(t,e,n,r){n=n||0,r=r||RW;for(var i in e)if(e.hasOwnProperty(i)){var o=e[i];o!==null&&PM(o)?(PM(t[i])||(t[i]={}),n<r?AM(t[i],o,n+1,r):t[i]=e[i]):MM(o)?(t[i]=[],t[i]=t[i].concat(o)):o!==void 0&&(t[i]=o)}}var CM=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)AM(t,e[r]);return t},TM=function(t,e){if(!SM(t))return-1;var n=Array.prototype.indexOf;if(n)return n.call(t,e);for(var r=-1,i=0;i<t.length;i++)if(t[i]===e){r=i;break}return r};const ns=function(t){return t};function kM(t){return TW(t)?0:SM(t)?t.length:Object.keys(t).length}var Dh;FW(function(t,e){e===void 0&&(e={});var n=e.fontSize,r=e.fontFamily,i=e.fontWeight,o=e.fontStyle,a=e.fontVariant;return Dh||(Dh=document.createElement("canvas").getContext("2d")),Dh.font=[o,a,i,n+"px",r].join(" "),Dh.measureText(IW(t)?t:"").width},function(t,e){return e===void 0&&(e={}),nm([t],jW(e)).join("")});function $h(t){return!$W(t)&&!DW(t)&&!Number.isNaN(t)}const LM=t=>e=>-t(-e),wm=(t,e)=>{const n=Math.log(t),r=t===Math.E?Math.log:t===10?Math.log10:t===2?Math.log2:i=>Math.log(i)/n;return e?LM(r):r},Om=(t,e)=>{const n=t===Math.E?Math.exp:r=>Ce(t,r);return e?LM(n):n},BW=(t,e,n,r)=>{const i=t<0,o=wm(r,i),a=Om(r,i),s=t>e,l=s?e:t,c=s?t:e,u=[a(Math.floor(o(l))),a(Math.ceil(o(c)))];return s?u.reverse():u},zW=t=>e=>{const n=t(e);return Lu(n)?Math.round(n):n};function YW(t,e){return n=>{n.prototype.rescale=function(){this.initRange(),this.nice();const[r]=this.chooseTransforms();this.composeOutput(r,this.chooseClamp(r))},n.prototype.initRange=function(){const{interpolator:r}=this.options;this.options.range=t(r)},n.prototype.composeOutput=function(r,i){const{domain:o,interpolator:a,round:s}=this.getOptions(),l=e(o.map(r)),c=s?zW(a):a;this.output=bl(c,l,i,r)},n.prototype.invert=void 0}}var NM={exports:{}},WW={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},IM={exports:{}},GW=function(e){return!e||typeof e=="string"?!1:e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&e.constructor.name!=="String")},HW=GW,UW=Array.prototype.concat,VW=Array.prototype.slice,jM=IM.exports=function(e){for(var n=[],r=0,i=e.length;r<i;r++){var o=e[r];HW(o)?n=UW.call(n,VW.call(o)):n.push(o)}return n};jM.wrap=function(t){return function(){return t(jM(arguments))}};var XW=IM.exports,Nu=WW,Iu=XW,DM=Object.hasOwnProperty,$M=Object.create(null);for(var _m in Nu)DM.call(Nu,_m)&&($M[Nu[_m]]=_m);var dr=NM.exports={to:{},get:{}};dr.get=function(t){var e=t.substring(0,3).toLowerCase(),n,r;switch(e){case"hsl":n=dr.get.hsl(t),r="hsl";break;case"hwb":n=dr.get.hwb(t),r="hwb";break;default:n=dr.get.rgb(t),r="rgb";break}return n?{model:r,value:n}:null},dr.get.rgb=function(t){if(!t)return null;var e=/^#([a-f0-9]{3,4})$/i,n=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,r=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,i=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,o=/^(\w+)$/,a=[0,0,0,1],s,l,c;if(s=t.match(n)){for(c=s[2],s=s[1],l=0;l<3;l++){var u=l*2;a[l]=parseInt(s.slice(u,u+2),16)}c&&(a[3]=parseInt(c,16)/255)}else if(s=t.match(e)){for(s=s[1],c=s[3],l=0;l<3;l++)a[l]=parseInt(s[l]+s[l],16);c&&(a[3]=parseInt(c+c,16)/255)}else if(s=t.match(r)){for(l=0;l<3;l++)a[l]=parseInt(s[l+1],0);s[4]&&(s[5]?a[3]=parseFloat(s[4])*.01:a[3]=parseFloat(s[4]))}else if(s=t.match(i)){for(l=0;l<3;l++)a[l]=Math.round(parseFloat(s[l+1])*2.55);s[4]&&(s[5]?a[3]=parseFloat(s[4])*.01:a[3]=parseFloat(s[4]))}else return(s=t.match(o))?s[1]==="transparent"?[0,0,0,0]:DM.call(Nu,s[1])?(a=Nu[s[1]],a[3]=1,a):null:null;for(l=0;l<3;l++)a[l]=Xo(a[l],0,255);return a[3]=Xo(a[3],0,1),a},dr.get.hsl=function(t){if(!t)return null;var e=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=t.match(e);if(n){var r=parseFloat(n[4]),i=(parseFloat(n[1])%360+360)%360,o=Xo(parseFloat(n[2]),0,100),a=Xo(parseFloat(n[3]),0,100),s=Xo(isNaN(r)?1:r,0,1);return[i,o,a,s]}return null},dr.get.hwb=function(t){if(!t)return null;var e=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=t.match(e);if(n){var r=parseFloat(n[4]),i=(parseFloat(n[1])%360+360)%360,o=Xo(parseFloat(n[2]),0,100),a=Xo(parseFloat(n[3]),0,100),s=Xo(isNaN(r)?1:r,0,1);return[i,o,a,s]}return null},dr.to.hex=function(){var t=Iu(arguments);return"#"+Fh(t[0])+Fh(t[1])+Fh(t[2])+(t[3]<1?Fh(Math.round(t[3]*255)):"")},dr.to.rgb=function(){var t=Iu(arguments);return t.length<4||t[3]===1?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},dr.to.rgb.percent=function(){var t=Iu(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return t.length<4||t[3]===1?"rgb("+e+"%, "+n+"%, "+r+"%)":"rgba("+e+"%, "+n+"%, "+r+"%, "+t[3]+")"},dr.to.hsl=function(){var t=Iu(arguments);return t.length<4||t[3]===1?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},dr.to.hwb=function(){var t=Iu(arguments),e="";return t.length>=4&&t[3]!==1&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},dr.to.keyword=function(t){return $M[t.slice(0,3)]};function Xo(t,e,n){return Math.min(Math.max(e,t),n)}function Fh(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}var qW=NM.exports;const Sm=lu(qW);function Em(t,e,n){let r=n;return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function KW(t){const e=t[0]/360,n=t[1]/100,r=t[2]/100,i=t[3];if(n===0)return[r*255,r*255,r*255,i];const o=r<.5?r*(1+n):r+n-r*n,a=2*r-o,s=Em(a,o,e+1/3),l=Em(a,o,e),c=Em(a,o,e-1/3);return[s*255,l*255,c*255,i]}function FM(t){const e=Sm.get(t);if(!e)return null;const{model:n,value:r}=e;return n==="rgb"?r:n==="hsl"?KW(r):null}const xl=(t,e)=>n=>t*(1-n)+e*n,ZW=(t,e)=>{const n=FM(t),r=FM(e);return n===null||r===null?n?()=>t:()=>e:i=>{const o=new Array(4);for(let u=0;u<4;u+=1){const f=n[u],d=r[u];o[u]=f*(1-i)+d*i}const[a,s,l,c]=o;return`rgba(${Math.round(a)}, ${Math.round(s)}, ${Math.round(l)}, ${c})`}},ju=(t,e)=>typeof t=="number"&&typeof e=="number"?xl(t,e):typeof t=="string"&&typeof e=="string"?ZW(t,e):()=>t,QW=(t,e)=>{const n=xl(t,e);return r=>Math.round(n(r))};function JW(t,e){const{second:n,minute:r,hour:i,day:o,week:a,month:s,year:l}=e;return n.floor(t)<t?".SSS":r.floor(t)<t?":ss":i.floor(t)<t?"hh:mm":o.floor(t)<t?"hh A":s.floor(t)<t?a.floor(t)<t?"MMM DD":"ddd DD":l.floor(t)<t?"MMMM":"YYYY"}function RM({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):n}function tG({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function eG({map:t,initKey:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function nG(t){return typeof t=="object"?t.valueOf():t}let BM=class extends Map{constructor(e){if(super(),this.map=new Map,this.initKey=nG,e!==null)for(const[n,r]of e)this.set(n,r)}get(e){return super.get(RM({map:this.map,initKey:this.initKey},e))}has(e){return super.has(RM({map:this.map,initKey:this.initKey},e))}set(e,n){return super.set(tG({map:this.map,initKey:this.initKey},e),n)}delete(e){return super.delete(eG({map:this.map,initKey:this.initKey},e))}},Du=class{constructor(e){this.options=CM({},this.getDefaultOptions()),this.update(e)}getOptions(){return this.options}update(e={}){this.options=CM({},this.options,e),this.rescale(e)}rescale(e){}};const Rh=Symbol("defaultUnknown");function zM(t,e,n){for(let r=0;r<e.length;r+=1)t.has(e[r])||t.set(n(e[r]),r)}function YM(t){const{value:e,from:n,to:r,mapper:i,notFoundReturn:o}=t;let a=i.get(e);if(a===void 0){if(o!==Rh)return o;a=n.push(e)-1,i.set(e,a)}return r[a%r.length]}function WM(t){return t instanceof Date?e=>`${e}`:typeof t=="object"?e=>JSON.stringify(e):e=>e}let GM=class oB extends Du{getDefaultOptions(){return{domain:[],range:[],unknown:Rh}}constructor(e){super(e)}map(e){return this.domainIndexMap.size===0&&zM(this.domainIndexMap,this.getDomain(),this.domainKey),YM({value:this.domainKey(e),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(e){return this.rangeIndexMap.size===0&&zM(this.rangeIndexMap,this.getRange(),this.rangeKey),YM({value:this.rangeKey(e),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(e){const[n]=this.options.domain,[r]=this.options.range;if(this.domainKey=WM(n),this.rangeKey=WM(r),!this.rangeIndexMap){this.rangeIndexMap=new Map,this.domainIndexMap=new Map;return}(!e||e.range)&&this.rangeIndexMap.clear(),(!e||e.domain||e.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new oB(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:e,compare:n}=this.options;return this.sortedDomain=n?[...e].sort(n):e,this.sortedDomain}};function rG(t){const e=Math.min(...t);return t.map(n=>n/e)}function iG(t,e){const n=t.length,r=e-n;return r>0?[...t,...new Array(r).fill(1)]:r<0?t.slice(0,e):t}function oG(t){return Math.round(t*1e12)/1e12}function aG(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:o,round:a,align:s}=t,l=e.length,c=iG(o,l),[u,f]=n,d=f-u,h=2/l*r+1-1/l*i,p=d/h,v=p*i/l,g=p-l*v,y=rG(c),m=y.reduce((C,A)=>C+A),b=g/m,x=new BM(e.map((C,A)=>{const T=y[A]*b;return[C,a?Math.floor(T):T]})),w=new BM(e.map((C,A)=>{const k=y[A]*b+v;return[C,a?Math.floor(k):k]})),O=Array.from(w.values()).reduce((C,A)=>C+A),S=(d-(O-O/l*i))*s,E=u+S;let M=a?Math.round(E):E;const P=new Array(l);for(let C=0;C<l;C+=1){P[C]=oG(M);const A=e[C];M+=w.get(A)}return{valueBandWidth:x,valueStep:w,adjustedRange:P}}function sG(t){var e;const{domain:n}=t,r=n.length;if(r===0)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(!!(!((e=t.flex)===null||e===void 0)&&e.length))return aG(t);const{range:o,paddingOuter:a,paddingInner:s,round:l,align:c}=t;let u,f,d=o[0];const p=o[1]-d,v=a*2,g=r-s;u=p/Math.max(1,v+g),l&&(u=Math.floor(u)),d+=(p-u*(r-s))*c,f=u*(1-s),l&&(d=Math.round(d),f=Math.round(f));const y=new Array(r).fill(0).map((m,b)=>d+b*u);return{valueStep:u,valueBandWidth:f,adjustedRange:y}}let $u=class aB extends GM{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:Rh,flex:[]}}constructor(e){super(e)}clone(){return new aB(this.options)}getStep(e){return this.valueStep===void 0?1:typeof this.valueStep=="number"?this.valueStep:e===void 0?Array.from(this.valueStep.values())[0]:this.valueStep.get(e)}getBandWidth(e){return this.valueBandWidth===void 0?1:typeof this.valueBandWidth=="number"?this.valueBandWidth:e===void 0?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(e)}getRange(){return this.adjustedRange}getPaddingInner(){const{padding:e,paddingInner:n}=this.options;return e>0?e:n}getPaddingOuter(){const{padding:e,paddingOuter:n}=this.options;return e>0?e:n}rescale(){super.rescale();const{align:e,domain:n,range:r,round:i,flex:o}=this.options,{adjustedRange:a,valueBandWidth:s,valueStep:l}=sG({align:e,range:r,round:i,flex:o,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:n});this.valueStep=l,this.valueBandWidth=s,this.adjustedRange=a}};const rs=(t,e,n)=>{let r,i,o=t,a=e;if(o===a&&n>0)return[o];let s=jh(o,a,n);if(s===0||!Number.isFinite(s))return[];if(s>0){o=Math.ceil(o/s),a=Math.floor(a/s),i=new Array(r=Math.ceil(a-o+1));for(let l=0;l<r;l+=1)i[l]=(o+l)*s}else{s=-s,o=Math.ceil(o*s),a=Math.floor(a*s),i=new Array(r=Math.ceil(a-o+1));for(let l=0;l<r;l+=1)i[l]=(o+l)/s}return i};let Mm=class sB extends Du{getDefaultOptions(){return{range:[0],domain:[0,1],unknown:void 0,tickCount:5,tickMethod:rs}}map(e){const[n]=this.options.range;return n!==void 0?n:this.options.unknown}invert(e){const[n]=this.options.range;return e===n&&n!==void 0?this.options.domain:[]}getTicks(){const{tickMethod:e,domain:n,tickCount:r}=this.options,[i,o]=n;return!Lu(i)||!Lu(o)?[]:e(i,o,r)}clone(){return new sB(this.options)}};function Fu(t){return Math.abs(t)<1e-14?t:parseFloat(t.toFixed(14))}const lG=[1,5,2,2.5,4,3],HM=Number.EPSILON*100;function cG(t,e){return(t%e+e)%e}function uG(t){return Math.round(t*1e12)/1e12}function fG(t,e,n,r,i,o){const a=kM(e),s=TM(e,t);let l=0;const c=cG(r,o);return(c<HM||o-c<HM)&&r<=0&&i>=0&&(l=1),1-s/(a-1)-n+l}function dG(t,e,n){const r=kM(e),i=TM(e,t),o=1;return 1-i/(r-1)-n+o}function hG(t,e,n,r,i,o){const a=(t-1)/(o-i),s=(e-1)/(Math.max(o,r)-Math.min(n,i));return 2-Math.max(a/s,s/a)}function pG(t,e){return t>=e?2-(t-1)/(e-1):1}function vG(t,e,n,r){const i=e-t;return 1-.5*(Ce(e-r,2)+Ce(t-n,2))/Ce(.1*i,2)}function gG(t,e,n){const r=e-t;if(n>r){const i=(n-r)/2;return 1-Ce(i,2)/Ce(.1*r,2)}return 1}function yG(){return 1}const Pm=(t,e,n=5,r=!0,i=lG,o=[.25,.2,.5,.05])=>{const a=n<0?0:Math.round(n);if(Number.isNaN(t)||Number.isNaN(e)||typeof t!="number"||typeof e!="number"||!a)return[];if(e-t<1e-15||a===1)return[t];const s={score:-2,lmin:0,lmax:0,lstep:0};let l=1;for(;l<1/0;){for(let p=0;p<i.length;p+=1){const v=i[p],g=dG(v,i,l);if(o[0]*g+o[1]+o[2]+o[3]<s.score){l=1/0;break}let y=2;for(;y<1/0;){const m=pG(y,a);if(o[0]*g+o[1]+o[2]*m+o[3]<s.score)break;const b=(e-t)/(y+1)/l/v;let x=Math.ceil(Math.log10(b));for(;x<1/0;){const w=l*v*Ce(10,x),O=gG(t,e,w*(y-1));if(o[0]*g+o[1]*O+o[2]*m+o[3]<s.score)break;const _=Math.floor(e/w)*l-(y-1)*l,S=Math.ceil(t/w)*l;if(_<=S){const E=S-_;for(let M=0;M<=E;M+=1){const C=(_+M)*(w/l),A=C+w*(y-1),T=w,k=fG(v,i,l,C,A,T),N=vG(t,e,C,A),j=hG(y,a,t,e,C,A),L=yG(),I=o[0]*k+o[1]*N+o[2]*j+o[3]*L;I>s.score&&(!r||C<=t&&A>=e)&&(s.lmin=C,s.lmax=A,s.lstep=T,s.score=I)}}x+=1}y+=1}}l+=1}const c=Fu(s.lmax),u=Fu(s.lmin),f=Fu(s.lstep),d=Math.floor(uG((c-u)/f))+1,h=new Array(d);h[0]=Fu(u);for(let p=1;p<d;p+=1)h[p]=Fu(h[p-1]+f);return h};let UM=class lB extends Du{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:Pm}}map(e){return $h(e)?e:this.options.unknown}invert(e){return this.map(e)}clone(){return new lB(this.options)}getTicks(){const{domain:e,tickCount:n,tickMethod:r}=this.options,[i,o]=e;return!Lu(i)||!Lu(o)?[]:r(i,o,n)}};const mG=(t,e,n)=>{const[r,i]=t,[o,a]=e;let s,l;return r<i?(s=Ih(r,i),l=n(o,a)):(s=Ih(i,r),l=n(a,o)),bl(l,s)},bG=(t,e,n)=>{const r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=t[0]>t[r],s=a?[...t].reverse():t,l=a?[...e].reverse():e;for(let c=0;c<r;c+=1)i[c]=Ih(s[c],s[c+1]),o[c]=n(l[c],l[c+1]);return c=>{const u=ym(t,c,1,r)-1,f=i[u],d=o[u];return bl(d,f)(c)}},VM=(t,e,n,r)=>(Math.min(t.length,e.length)>2?bG:mG)(t,e,r?QW:n);let Bh=class extends Du{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:xl,tickCount:5}}map(e){return $h(e)?this.output(e):this.options.unknown}invert(e){return $h(e)?this.input(e):this.options.unknown}nice(){if(!this.options.nice)return;const[e,n,r,...i]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(e,n,r,...i)}getTicks(){const{tickMethod:e}=this.options,[n,r,i,...o]=this.getTickMethodOptions();return e(n,r,i,...o)}getTickMethodOptions(){const{domain:e,tickCount:n}=this.options,r=e[0],i=e[e.length-1];return[r,i,n]}chooseNice(){return gM}rescale(){this.nice();const[e,n]=this.chooseTransforms();this.composeOutput(e,this.chooseClamp(e)),this.composeInput(e,n,this.chooseClamp(n))}chooseClamp(e){const{clamp:n,range:r}=this.options,i=this.options.domain.map(e),o=Math.min(i.length,r.length);return n?dW(i[0],i[o-1]):ns}composeOutput(e,n){const{domain:r,range:i,round:o,interpolate:a}=this.options,s=VM(r.map(e),i,a,o);this.output=bl(s,n,e)}composeInput(e,n,r){const{domain:i,range:o}=this.options,a=VM(o,i.map(e),xl);this.input=bl(n,r,a)}},oo=class cB extends Bh{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:ju,tickMethod:rs,tickCount:5}}chooseTransforms(){return[ns,ns]}clone(){return new cB(this.options)}},xG=class uB extends $u{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:Rh,paddingInner:1,paddingOuter:0}}constructor(e){super(e)}getPaddingInner(){return 1}clone(){return new uB(this.options)}update(e){super.update(e)}getPaddingOuter(){return this.options.padding}};const wG=t=>e=>e<0?-Ce(-e,t):Ce(e,t),OG=t=>e=>e<0?-Ce(-e,1/t):Ce(e,1/t),_G=t=>t<0?-Math.sqrt(-t):Math.sqrt(t);let XM=class fB extends Bh{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:ju,tickMethod:rs,tickCount:5}}constructor(e){super(e)}chooseTransforms(){const{exponent:e}=this.options;if(e===1)return[ns,ns];const n=e===.5?_G:wG(e),r=OG(e);return[n,r]}clone(){return new fB(this.options)}},SG=class dB extends XM{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:ju,tickMethod:rs,tickCount:5,exponent:.5}}constructor(e){super(e)}update(e){super.update(e)}clone(){return new dB(this.options)}},zh=class hB extends Du{getDefaultOptions(){return{domain:[.5],range:[0,1]}}constructor(e){super(e)}map(e){if(!$h(e))return this.options.unknown;const n=ym(this.thresholds,e,0,this.n);return this.options.range[n]}invert(e){const{range:n}=this.options,r=n.indexOf(e),i=this.thresholds;return[i[r-1],i[r]]}clone(){return new hB(this.options)}rescale(){const{domain:e,range:n}=this.options;this.n=Math.min(e.length,n.length-1),this.thresholds=e}};const EG=(t,e,n,r=10)=>{const i=t<0,o=Om(r,i),a=wm(r,i),s=e<t,l=s?e:t,c=s?t:e;let u=a(l),f=a(c),d=[];if(!(r%1)&&f-u<n){if(u=Math.floor(u),f=Math.ceil(f),i)for(;u<=f;u+=1){const h=o(u);for(let p=r-1;p>=1;p-=1){const v=h*p;if(v>c)break;v>=l&&d.push(v)}}else for(;u<=f;u+=1){const h=o(u);for(let p=1;p<r;p+=1){const v=h*p;if(v>c)break;v>=l&&d.push(v)}}d.length*2<n&&(d=rs(l,c,n))}else{const h=n===-1?f-u:Math.min(f-u,n);d=rs(u,f,h).map(o)}return s?d.reverse():d};let MG=class pB extends Bh{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:ju,tickMethod:EG,tickCount:5}}chooseNice(){return BW}getTickMethodOptions(){const{domain:e,tickCount:n,base:r}=this.options,i=e[0],o=e[e.length-1];return[i,o,n,r]}chooseTransforms(){const{base:e,domain:n}=this.options,r=n[0]<0;return[wm(e,r),Om(e,r)]}clone(){return new pB(this.options)}},qM=class vB extends zh{getDefaultOptions(){return{domain:[0,1],range:[.5],nice:!1,tickCount:5,tickMethod:Pm}}constructor(e){super(e)}nice(){const{nice:e}=this.options;if(e){const[n,r,i]=this.getTickMethodOptions();this.options.domain=gM(n,r,i)}}getTicks(){const{tickMethod:e}=this.options,[n,r,i]=this.getTickMethodOptions();return e(n,r,i)}getTickMethodOptions(){const{domain:e,tickCount:n}=this.options,r=e[0],i=e[e.length-1];return[r,i,n]}rescale(){this.nice();const{range:e,domain:n}=this.options,[r,i]=n;this.n=e.length-1,this.thresholds=new Array(this.n);for(let o=0;o<this.n;o+=1)this.thresholds[o]=((o+1)*i-(o-this.n)*r)/(this.n+1)}invert(e){const[n,r]=super.invert(e),[i,o]=this.options.domain;return n===void 0&&r===void 0?[n,r]:[n||i,r||o]}getThresholds(){return this.thresholds}clone(){return new vB(this.options)}};function PG(t,e){const n=t.length;if(!n)return;if(n<2)return t[n-1];const r=(n-1)*e,i=Math.floor(r),o=t[i],a=t[i+1];return o+(a-o)*(r-i)}function AG(t,e,n=!1){const r=t;n||r.sort((o,a)=>o-a);const i=[];for(let o=1;o<e;o+=1)i.push(PG(r,o/e));return i}let KM=class gB extends zh{getDefaultOptions(){return{domain:[],range:[],tickCount:5,unknown:void 0,tickMethod:Pm}}constructor(e){super(e)}rescale(){const{domain:e,range:n}=this.options;this.n=n.length-1,this.thresholds=AG(e,this.n+1,!1)}invert(e){const[n,r]=super.invert(e),{domain:i}=this.options,o=i[0],a=i[i.length-1];return n===void 0&&r===void 0?[n,r]:[n||o,r||a]}getThresholds(){return this.thresholds}clone(){return new gB(this.options)}getTicks(){const{tickCount:e,domain:n,tickMethod:r}=this.options,i=n.length-1,o=n[0],a=n[i];return r(o,a,e)}};var CG=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,TG=/\[([^]*?)\]/gm;function ZM(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}function Am(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0,i=e;r<i.length;r++){var o=i[r];for(var a in o)t[a]=o[a]}return t}var QM=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],JM=["January","February","March","April","May","June","July","August","September","October","November","December"],kG=ZM(JM,3),LG=ZM(QM,3),NG={dayNamesShort:LG,dayNames:QM,monthNamesShort:kG,monthNames:JM,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][t%10>3?0:(t-t%10!==10?1:0)*t%10]}},IG=Am({},NG),Xn=function(t,e){for(e===void 0&&(e=2),t=String(t);t.length<e;)t="0"+t;return t},jG={D:function(t){return String(t.getDate())},DD:function(t){return Xn(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return Xn(t.getDay())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return String(t.getMonth()+1)},MM:function(t){return Xn(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},YY:function(t){return Xn(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return Xn(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return Xn(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return Xn(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return Xn(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return Xn(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return Xn(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return Xn(t.getMilliseconds(),3)},a:function(t,e){return t.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(t,e){return t.getHours()<12?e.amPm[0].toUpperCase():e.amPm[1].toUpperCase()},ZZ:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+Xn(Math.floor(Math.abs(e)/60)*100+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+Xn(Math.floor(Math.abs(e)/60),2)+":"+Xn(Math.abs(e)%60,2)}},tP={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},DG=function(t,e,n){if(e===void 0&&(e=tP.default),n===void 0&&(n={}),typeof t=="number"&&(t=new Date(t)),Object.prototype.toString.call(t)!=="[object Date]"||isNaN(t.getTime()))throw new Error("Invalid Date pass to format");e=tP[e]||e;var r=[];e=e.replace(TG,function(o,a){return r.push(a),"@@@"});var i=Am(Am({},IG),n);return e=e.replace(CG,function(o){return jG[o](t,i)}),e.replace(/@@@/g,function(){return r.shift()})};const $G=(t,e,n,r,i)=>{const o=t>e,a=o?e:t,s=o?t:e,[l,c]=_M(a,s,n,r,i),u=l.range(a,new Date(+s+1),c,!0);return o?u.reverse():u};function FG(t){const e=t.getTimezoneOffset(),n=new Date(t);return n.setMinutes(n.getMinutes()+e,n.getSeconds(),n.getMilliseconds()),n}let RG=class yB extends Bh{getDefaultOptions(){return{domain:[new Date(2e3,0,1),new Date(2e3,0,2)],range:[0,1],nice:!1,tickCount:5,tickInterval:void 0,unknown:void 0,clamp:!1,tickMethod:$G,interpolate:xl,mask:void 0,utc:!1}}chooseTransforms(){return[r=>+r,r=>new Date(r)]}chooseNice(){return AW}getTickMethodOptions(){const{domain:e,tickCount:n,tickInterval:r,utc:i}=this.options,o=e[0],a=e[e.length-1];return[o,a,n,r,i]}getFormatter(){const{mask:e,utc:n}=this.options,r=n?OM:xM,i=n?FG:ns;return o=>DG(i(o),e||JW(o,r))}clone(){return new yB(this.options)}};var BG=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Cm;function zG(t){return[t(0),t(1)]}const YG=t=>{const[e,n]=t;return bl(xl(0,1),Ih(e,n))};let Tm=Cm=class extends oo{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:ns,tickMethod:rs,tickCount:5}}constructor(e){super(e)}clone(){return new Cm(this.options)}};Tm=Cm=BG([YW(zG,YG)],Tm);function Yh(t,e,n){if(t===null)return[-.5,.5];const r=JE(t,e),o=new $u({domain:r,range:[0,1],padding:n}).getBandWidth();return[-o/2,o/2]}function Wh(t,e,n){return e*(1-t)+n*t}const eP=(t={})=>{const{padding:e=0,paddingX:n=e,paddingY:r=e,random:i=Math.random}=t;return(o,a)=>{const{encode:s,scale:l}=a,{x:c,y:u}=l,[f]=It(s,"x"),[d]=It(s,"y"),h=Yh(f,c,n),p=Yh(d,u,r),v=o.map(()=>Wh(i(),...p)),g=o.map(()=>Wh(i(),...h));return[o,Z({scale:{x:{padding:.5},y:{padding:.5}}},a,{encode:{dy:le(v),dx:le(g)}})]}};eP.props={};const nP=(t={})=>{const{padding:e=0,random:n=Math.random}=t;return(r,i)=>{const{encode:o,scale:a}=i,{x:s}=a,[l]=It(o,"x"),c=Yh(l,s,e),u=r.map(()=>Wh(n(),...c));return[r,Z({scale:{x:{padding:.5}}},i,{encode:{dx:le(u)}})]}};nP.props={};const rP=(t={})=>{const{padding:e=0,random:n=Math.random}=t;return(r,i)=>{const{encode:o,scale:a}=i,{y:s}=a,[l]=It(o,"y"),c=Yh(l,s,e),u=r.map(()=>Wh(n(),...c));return[r,Z({scale:{y:{padding:.5}}},i,{encode:{dy:le(u)}})]}};rP.props={};var WG=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const iP=(t={})=>{const{groupBy:e="x"}=t;return(n,r)=>{const{encode:i}=r,o=WG(i,["x"]),a=Object.entries(o).filter(([f])=>f.startsWith("y")).map(([f])=>[f,It(i,f)[0]]),s=a.map(([f])=>[f,new Array(n.length)]),l=Vo(e,n,r),c=new Array(l.length);for(let f=0;f<l.length;f++){const h=l[f].flatMap(g=>a.map(([,y])=>+y[g])),[p,v]=no(h);c[f]=(p+v)/2}const u=Math.max(...c);for(let f=0;f<l.length;f++){const d=u-c[f],h=l[f];for(const p of h)for(let v=0;v<a.length;v++){const[,g]=a[v],[,y]=s[v];y[p]=+g[p]+d}}return[n,Z({},r,{encode:Object.fromEntries(s.map(([f,d])=>[f,le(d,It(i,f)[1])]))})]}};iP.props={};const oP=(t={})=>{const{groupBy:e="x",series:n=!0}=t;return(r,i)=>{const{encode:o}=i,[a]=It(o,"y"),[s,l]=It(o,"y1");n?yu(o,"series","color"):It(o,"color");const c=Vo(e,r,i),u=new Array(r.length);for(const f of c){const d=f.map(h=>+a[h]);for(let h=0;h<f.length;h++){const p=f[h],v=Math.max(...d.filter((g,y)=>y!==h));u[p]=a[p]>v?v:a[p]}}return[r,Z({},i,{encode:{y1:le(u,l)}})]}};oP.props={};function aP(t,e){return[t[0]]}function GG(t,e){const n=t.length-1;return[t[n]]}function HG(t,e){const n=gl(t,r=>e[r]);return[t[n]]}function UG(t,e){const n=Ph(t,r=>e[r]);return[t[n]]}function VG(t){return typeof t=="function"?t:{first:aP,last:GG,max:HG,min:UG}[t]||aP}const Gh=(t={})=>{const{groupBy:e="series",channel:n,selector:r}=t;return(i,o)=>{const{encode:a}=o,s=Vo(e,i,o),[l]=It(a,n),c=VG(r);return[s.flatMap(u=>c(u,l)),o]}};Gh.props={};var XG=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const sP=(t={})=>{const{selector:e}=t,n=XG(t,["selector"]);return Gh(Object.assign({channel:"x",selector:e},n))};sP.props={};var qG=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const lP=(t={})=>{const{selector:e}=t,n=qG(t,["selector"]);return Gh(Object.assign({channel:"y",selector:e},n))};lP.props={};var KG=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function qo(t){return e=>e===null?t:`${t} of ${e}`}function ZG(t){if(typeof t=="function")return[t,null];const n={mean:QG,max:tH,count:nH,first:iH,last:oH,sum:rH,min:eH,median:JG}[t];if(!n)throw new Error(`Unknown reducer: ${t}.`);return n()}function QG(){const t=(n,r)=>_u(n,i=>+r[i]),e=qo("mean");return[t,e]}function JG(){const t=(n,r)=>um(n,i=>+r[i]),e=qo("median");return[t,e]}function tH(){const t=(n,r)=>Gt(n,i=>+r[i]),e=qo("max");return[t,e]}function eH(){const t=(n,r)=>fr(n,i=>+r[i]),e=qo("min");return[t,e]}function nH(){const t=(n,r)=>n.length,e=qo("count");return[t,e]}function rH(){const t=(n,r)=>kr(n,i=>+r[i]),e=qo("sum");return[t,e]}function iH(){const t=(n,r)=>r[n[0]],e=qo("first");return[t,e]}function oH(){const t=(n,r)=>r[n[n.length-1]],e=qo("last");return[t,e]}const km=(t={})=>{const{groupBy:e}=t,n=KG(t,["groupBy"]);return(r,i)=>{const{data:o,encode:a}=i,s=e(r,i);if(!s)return[r,i];const l=(h,p)=>{if(h)return h;const{from:v}=p;if(!v)return h;const[,g]=It(a,v);return g},c=Object.entries(n).map(([h,p])=>{const[v,g]=ZG(p),[y,m]=It(a,h),b=l(m,p),x=s.map(w=>v(w,y!=null?y:o));return[h,Object.assign(Object.assign({},yY(x,(g==null?void 0:g(b))||b)),{aggregate:!0})]}),u=Object.keys(a).map(h=>{const[p,v]=It(a,h),g=s.map(y=>p[y[0]]);return[h,le(g,v)]}),f=s.map(h=>o[h[0]]);return[Ja(s),Z({},i,{data:f,encode:Object.fromEntries([...u,...c])})]}};km.props={};var aH=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const Ru=(t={})=>{const{channels:e=["x","y"]}=t,n=aH(t,["channels"]),r=(i,o)=>Vo(e,i,o);return km(Object.assign(Object.assign({},n),{groupBy:r}))};Ru.props={};const cP=(t={})=>Ru(Object.assign(Object.assign({},t),{channels:["x","color","series"]}));cP.props={};const uP=(t={})=>Ru(Object.assign(Object.assign({},t),{channels:["y","color","series"]}));uP.props={};const fP=(t={})=>Ru(Object.assign(Object.assign({},t),{channels:["color"]}));fP.props={};var dP=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function sH(t,e,n){const{by:r=t,reducer:i="max"}=e,[o]=It(n,r);if(typeof i=="function")return a=>i(a,o);if(i==="max")return a=>Gt(a,s=>+o[s]);if(i==="min")return a=>fr(a,s=>+o[s]);if(i==="sum")return a=>kr(a,s=>+o[s]);if(i==="median")return a=>um(a,s=>+o[s]);if(i==="mean")return a=>_u(a,s=>+o[s]);if(i==="first")return a=>o[a[0]];if(i==="last")return a=>o[a[a.length-1]];throw new Error(`Unknown reducer: ${i}`)}function lH(t,e,n){const{reverse:r,channel:i}=n,{encode:o}=e,[a]=It(o,i),s=ro(t,l=>a[l]);return r&&s.reverse(),[s,e]}function cH(t,e,n){if(!Array.isArray(n))return t;const r=new Set(n);return t.filter(i=>r.has(e[i]))}function uH(t,e,n){var r;const{reverse:i,slice:o,channel:a}=n,s=dP(n,["reverse","slice","channel"]),{encode:l,scale:c={}}=e,u=(r=c[a])===null||r===void 0?void 0:r.domain,[f]=It(l,a),d=sH(a,s,l),h=cH(t,f,u),p=kY(h,d,y=>f[y]);i&&p.reverse();const v=typeof o=="number"?[0,o]:o,g=o?p.slice(...v):p;return[t,Z(e,{scale:{[a]:{domain:g}}})]}const Hh=(t={})=>{const{reverse:e=!1,slice:n,channel:r,ordinal:i=!0}=t,o=dP(t,["reverse","slice","channel","ordinal"]);return(a,s)=>i?uH(a,s,Object.assign({reverse:e,slice:n,channel:r},o)):lH(a,s,Object.assign({reverse:e,slice:n,channel:r},o))};Hh.props={};const hP=(t={})=>Hh(Object.assign(Object.assign({},t),{channel:"x"}));hP.props={};const pP=(t={})=>Hh(Object.assign(Object.assign({},t),{channel:"color"}));pP.props={};const vP=(t={})=>Hh(Object.assign(Object.assign({},t),{channel:"y"}));vP.props={};function fH(t,e){return typeof e=="string"?t.map(n=>n[e]):t.map(e)}function dH(t,e){if(typeof t=="function")return n=>t(n,e);if(t==="sum")return n=>kr(n,r=>+e[r]);throw new Error(`Unknown reducer: ${t}`)}const gP=(t={})=>{const{field:e,channel:n="y",reducer:r="sum"}=t;return(i,o)=>{const{data:a,encode:s}=o,[l]=It(s,"x"),c=e?fH(a,e):It(s,n)[0],u=dH(r,c),f=YE(i,u,d=>l[d]).map(d=>d[1]);return[i,Z({},o,{scale:{x:{flex:f}}})]}};gP.props={};function ke([t,e],[n,r]){return[t-n,e-r]}function Uh([t,e],[n,r]){return[t+n,e+r]}function we([t,e],[n,r]){return Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))}function Lr([t,e]){return Math.atan2(e,t)}function wl([t,e]){return Lr([t,e])+Math.PI/2}function yP(t,e){const n=Lr(t),r=Lr(e);return n<r?r-n:Math.PI*2-(n-r)}function Lm(t){let e=1/0,n=-1/0,r=1/0,i=-1/0;for(const[s,l]of t)e=Math.min(s,e),n=Math.max(s,n),r=Math.min(l,r),i=Math.max(l,i);const o=n-e,a=i-r;return[e,r,o,a]}function mP([t,e],[n,r]){return[(t+n)/2,(e+r)/2]}function hH(t){const{padding:e=0,direction:n="col"}=t;return(r,i,o)=>{const a=r.length;if(a===0)return[];const{innerWidth:s,innerHeight:l}=o,c=l/s;let u=Math.ceil(Math.sqrt(i/c)),f=s/u,d=Math.ceil(i/u),h=d*f;for(;h>l;)u=u+1,f=s/u,d=Math.ceil(i/u),h=d*f;const p=l-d*f,v=d<=1?0:p/(d-1),[g,y]=d<=1?[(s-a*f)/(a-1),(l-f)/2]:[0,0];return r.map((m,b)=>{const[x,w,O,_]=Lm(m),S=n==="col"?b%u:Math.floor(b/d),E=n==="col"?Math.floor(b/u):b%d,M=S*f,P=(d-E-1)*f+p,C=(f-e)/O,A=(f-e)/_,T=M-x+g*S+1/2*e,k=P-w-v*E-y+1/2*e;return`translate(${T}, ${k}) scale(${C}, ${A})`})}}const bP=t=>(e,n)=>[e,Z({},n,{modifier:hH(t),axis:!1})];bP.props={};var pH=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const xP="thresholds";function vH(t){const[e,n]=no(t);return Math.min(200,WY(t,e,n))}const Nm=(t={})=>{const{groupChannels:e=["color"],binChannels:n=["x","y"]}=t,r=pH(t,["groupChannels","binChannels"]),i={},o=(a,s)=>{const{encode:l}=s,c=n.map(p=>{const[v]=It(l,p);return v}),u=ot(r,xP),f=a.filter(p=>c.every(v=>ie(v[p]))),d=[...e.map(p=>{const[v]=It(l,p);return v}).filter(ie).map(p=>v=>p[v]),...n.map((p,v)=>{const g=c[v],y=u[p]||vH(g),m=BY().thresholds(y).value(x=>+g[x])(f),b=new Map(m.flatMap(x=>{const{x0:w,x1:O}=x,_=`${w},${O}`;return x.map(S=>[S,_])}));return i[p]=b,x=>b.get(x)})],h=p=>d.map(v=>v(p)).join("-");return Array.from(xe(f,h).values())};return km(Object.assign(Object.assign(Object.assign({},Object.fromEntries(Object.entries(r).filter(([a])=>!a.startsWith(xP)))),Object.fromEntries(n.flatMap(a=>{const s=([c])=>+i[a].get(c).split(",")[0],l=([c])=>+i[a].get(c).split(",")[1];return l.from=a,[[a,s],[`${a}1`,l]]}))),{groupBy:o}))};Nm.props={};const wP=(t={})=>{const{thresholds:e}=t;return Nm(Object.assign(Object.assign({},t),{thresholdsX:e,groupChannels:["color"],binChannels:["x"]}))};wP.props={};function gH(t,e,n,r){const i=t.length;if(r>=i||r===0)return t;const o=h=>e[t[h]]*1,a=h=>n[t[h]]*1,s=[],l=(i-2)/(r-2);let c=0,u,f,d;s.push(c);for(let h=0;h<r-2;h++){let p=0,v=0,g=Math.floor((h+1)*l)+1,y=Math.floor((h+2)*l)+1;y=Math.min(y,i);const m=y-g;for(;g<y;g++)p+=o(g),v+=a(g);p/=m,v/=m;let b=Math.floor((h+0)*l)+1;const x=Math.floor((h+1)*l)+1,w=[o(c),a(c)];for(u=f=-1;b<x;b++)f=Math.abs((w[0]-p)*(o(b)-w[1])-(w[0]-a(b))*(v-w[0]))*.5,f>u&&(u=f,d=b);s.push(d),c=d}return s.push(i-1),s.map(h=>t[h])}function yH(t){if(typeof t=="function")return t;if(t==="lttb")return gH;const e={first:r=>[r[0]],last:r=>[r[r.length-1]],min:(r,i,o)=>[r[Ph(r,a=>o[a])]],max:(r,i,o)=>[r[gl(r,a=>o[a])]],median:(r,i,o)=>[r[GY(r,a=>o[a])]]},n=e[t]||e.median;return(r,i,o,a)=>{const s=Math.max(1,Math.floor(r.length/a));return mH(r,s).flatMap(c=>n(c,i,o))}}function mH(t,e){const n=t.length,r=[];let i=0;for(;i<n;)r.push(t.slice(i,i+=e));return r}const OP=(t={})=>{const{strategy:e="median",thresholds:n=2e3,groupBy:r=["series","color"]}=t,i=yH(e);return(o,a)=>{const{encode:s}=a,l=Vo(r,o,a),[c]=It(s,"x"),[u]=It(s,"y");return[l.flatMap(f=>i(f,c,u,n)),a]}};OP.props={};function bH(t){return typeof t=="object"?[t.value,t.ordinal]:[t,!0]}const _P=(t={})=>(e,n)=>{const{encode:r,data:i}=n,o=Object.entries(t).map(([u,f])=>{const[d]=It(r,u);if(!d)return null;const[h,p=!0]=bH(f);if(typeof h=="function")return v=>h(d[v]);if(p){const v=Array.isArray(h)?h:[h];return v.length===0?null:g=>v.includes(d[g])}else{const[v,g]=h;return y=>d[y]>=v&&d[y]<=g}}).filter(ie);if(o.length===0)return[e,n];const a=u=>o.every(f=>f(u)),s=e.filter(a),l=s.map((u,f)=>f),c=Object.entries(r).map(([u,f])=>[u,Object.assign(Object.assign({},f),{value:l.map(d=>f.value[s[d]]).filter(d=>d!==void 0)})]);return[l,Z({},n,{encode:Object.fromEntries(c),data:s.map(u=>i[u])})]};_P.props={};function de(t){return function(){return t}}const SP=Math.abs,Sn=Math.atan2,is=Math.cos,xH=Math.max,Im=Math.min,Ai=Math.sin,Ol=Math.sqrt,En=1e-12,Bu=Math.PI,Vh=Bu/2,wH=2*Bu;function OH(t){return t>1?0:t<-1?Bu:Math.acos(t)}function EP(t){return t>=1?Vh:t<=-1?-Vh:Math.asin(t)}const jm=Math.PI,Dm=2*jm,os=1e-6,_H=Dm-os;function MP(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function SH(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return MP;const n=Ce(10,e);return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}let $m=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?MP:SH(e)}moveTo(e,n){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,n){this._append`L${this._x1=+e},${this._y1=+n}`}quadraticCurveTo(e,n,r,i){this._append`Q${+e},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(e,n,r,i,o,a){this._append`C${+e},${+n},${+r},${+i},${this._x1=+o},${this._y1=+a}`}arcTo(e,n,r,i,o){if(e=+e,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let a=this._x1,s=this._y1,l=r-e,c=i-n,u=a-e,f=s-n,d=u*u+f*f;if(this._x1===null)this._append`M${this._x1=e},${this._y1=n}`;else if(d>os)if(!(Math.abs(f*l-c*u)>os)||!o)this._append`L${this._x1=e},${this._y1=n}`;else{let h=r-a,p=i-s,v=l*l+c*c,g=h*h+p*p,y=Math.sqrt(v),m=Math.sqrt(d),b=o*Math.tan((jm-Math.acos((v+d-g)/(2*y*m)))/2),x=b/m,w=b/y;Math.abs(x-1)>os&&this._append`L${e+x*u},${n+x*f}`,this._append`A${o},${o},0,0,${+(f*h>u*p)},${this._x1=e+w*l},${this._y1=n+w*c}`}}arc(e,n,r,i,o,a){if(e=+e,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),l=r*Math.sin(i),c=e+s,u=n+l,f=1^a,d=a?i-o:o-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>os||Math.abs(this._y1-u)>os)&&this._append`L${c},${u}`,r&&(d<0&&(d=d%Dm+Dm),d>_H?this._append`A${r},${r},0,1,${f},${e-s},${n-l}A${r},${r},0,1,${f},${this._x1=c},${this._y1=u}`:d>os&&this._append`A${r},${r},0,${+(d>=jm)},${f},${this._x1=e+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(e,n,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function Nr(){return new $m}Nr.prototype=$m.prototype;function Fm(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new $m(e)}function EH(t){return t.innerRadius}function MH(t){return t.outerRadius}function PH(t){return t.startAngle}function AH(t){return t.endAngle}function CH(t){return t&&t.padAngle}function TH(t,e,n,r,i,o,a,s){var l=n-t,c=r-e,u=a-i,f=s-o,d=f*l-u*c;if(!(d*d<En))return d=(u*(e-o)-f*(t-i))/d,[t+d*l,e+d*c]}function Xh(t,e,n,r,i,o,a){var s=t-n,l=e-r,c=(a?o:-o)/Ol(s*s+l*l),u=c*l,f=-c*s,d=t+u,h=e+f,p=n+u,v=r+f,g=(d+p)/2,y=(h+v)/2,m=p-d,b=v-h,x=m*m+b*b,w=i-o,O=d*v-p*h,_=(b<0?-1:1)*Ol(xH(0,w*w*x-O*O)),S=(O*b-m*_)/x,E=(-O*m-b*_)/x,M=(O*b+m*_)/x,P=(-O*m+b*_)/x,C=S-g,A=E-y,T=M-g,k=P-y;return C*C+A*A>T*T+k*k&&(S=M,E=P),{cx:S,cy:E,x01:-u,y01:-f,x11:S*(i/w-1),y11:E*(i/w-1)}}function qh(){var t=EH,e=MH,n=de(0),r=null,i=PH,o=AH,a=CH,s=null,l=Fm(c);function c(){var u,f,d=+t.apply(this,arguments),h=+e.apply(this,arguments),p=i.apply(this,arguments)-Vh,v=o.apply(this,arguments)-Vh,g=SP(v-p),y=v>p;if(s||(s=u=l()),h<d&&(f=h,h=d,d=f),!(h>En))s.moveTo(0,0);else if(g>wH-En)s.moveTo(h*is(p),h*Ai(p)),s.arc(0,0,h,p,v,!y),d>En&&(s.moveTo(d*is(v),d*Ai(v)),s.arc(0,0,d,v,p,y));else{var m=p,b=v,x=p,w=v,O=g,_=g,S=a.apply(this,arguments)/2,E=S>En&&(r?+r.apply(this,arguments):Ol(d*d+h*h)),M=Im(SP(h-d)/2,+n.apply(this,arguments)),P=M,C=M,A,T;if(E>En){var k=EP(E/d*Ai(S)),N=EP(E/h*Ai(S));(O-=k*2)>En?(k*=y?1:-1,x+=k,w-=k):(O=0,x=w=(p+v)/2),(_-=N*2)>En?(N*=y?1:-1,m+=N,b-=N):(_=0,m=b=(p+v)/2)}var j=h*is(m),L=h*Ai(m),I=d*is(w),$=d*Ai(w);if(M>En){var F=h*is(b),R=h*Ai(b),B=d*is(x),W=d*Ai(x),K;if(g<Bu)if(K=TH(j,L,B,W,F,R,I,$)){var J=j-K[0],X=L-K[1],V=F-K[0],it=R-K[1],nt=1/Ai(OH((J*V+X*it)/(Ol(J*J+X*X)*Ol(V*V+it*it)))/2),lt=Ol(K[0]*K[0]+K[1]*K[1]);P=Im(M,(d-lt)/(nt-1)),C=Im(M,(h-lt)/(nt+1))}else P=C=0}_>En?C>En?(A=Xh(B,W,j,L,h,C,y),T=Xh(F,R,I,$,h,C,y),s.moveTo(A.cx+A.x01,A.cy+A.y01),C<M?s.arc(A.cx,A.cy,C,Sn(A.y01,A.x01),Sn(T.y01,T.x01),!y):(s.arc(A.cx,A.cy,C,Sn(A.y01,A.x01),Sn(A.y11,A.x11),!y),s.arc(0,0,h,Sn(A.cy+A.y11,A.cx+A.x11),Sn(T.cy+T.y11,T.cx+T.x11),!y),s.arc(T.cx,T.cy,C,Sn(T.y11,T.x11),Sn(T.y01,T.x01),!y))):(s.moveTo(j,L),s.arc(0,0,h,m,b,!y)):s.moveTo(j,L),!(d>En)||!(O>En)?s.lineTo(I,$):P>En?(A=Xh(I,$,F,R,d,-P,y),T=Xh(j,L,B,W,d,-P,y),s.lineTo(A.cx+A.x01,A.cy+A.y01),P<M?s.arc(A.cx,A.cy,P,Sn(A.y01,A.x01),Sn(T.y01,T.x01),!y):(s.arc(A.cx,A.cy,P,Sn(A.y01,A.x01),Sn(A.y11,A.x11),!y),s.arc(0,0,d,Sn(A.cy+A.y11,A.cx+A.x11),Sn(T.cy+T.y11,T.cx+T.x11),y),s.arc(T.cx,T.cy,P,Sn(T.y11,T.x11),Sn(T.y01,T.x01),!y))):s.arc(0,0,d,w,x,y)}if(s.closePath(),u)return s=null,u+""||null}return c.centroid=function(){var u=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,f=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-Bu/2;return[is(f)*u,Ai(f)*u]},c.innerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:de(+u),c):t},c.outerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:de(+u),c):e},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:de(+u),c):n},c.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:de(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:de(+u),c):i},c.endAngle=function(u){return arguments.length?(o=typeof u=="function"?u:de(+u),c):o},c.padAngle=function(u){return arguments.length?(a=typeof u=="function"?u:de(+u),c):a},c.context=function(u){return arguments.length?(s=u==null?null:u,c):s},c}function PP(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function AP(t){this._context=t}AP.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function zu(t){return new AP(t)}function CP(t){return t[0]}function TP(t){return t[1]}function Ko(t,e){var n=de(!0),r=null,i=zu,o=null,a=Fm(s);t=typeof t=="function"?t:t===void 0?CP:de(t),e=typeof e=="function"?e:e===void 0?TP:de(e);function s(l){var c,u=(l=PP(l)).length,f,d=!1,h;for(r==null&&(o=i(h=a())),c=0;c<=u;++c)!(c<u&&n(f=l[c],c,l))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+t(f,c,l),+e(f,c,l));if(h)return o=null,h+""||null}return s.x=function(l){return arguments.length?(t=typeof l=="function"?l:de(+l),s):t},s.y=function(l){return arguments.length?(e=typeof l=="function"?l:de(+l),s):e},s.defined=function(l){return arguments.length?(n=typeof l=="function"?l:de(!!l),s):n},s.curve=function(l){return arguments.length?(i=l,r!=null&&(o=i(r)),s):i},s.context=function(l){return arguments.length?(l==null?r=o=null:o=i(r=l),s):r},s}function Rm(t,e,n){var r=null,i=de(!0),o=null,a=zu,s=null,l=Fm(c);t=typeof t=="function"?t:t===void 0?CP:de(+t),e=typeof e=="function"?e:de(e===void 0?0:+e),n=typeof n=="function"?n:n===void 0?TP:de(+n);function c(f){var d,h,p,v=(f=PP(f)).length,g,y=!1,m,b=new Array(v),x=new Array(v);for(o==null&&(s=a(m=l())),d=0;d<=v;++d){if(!(d<v&&i(g=f[d],d,f))===y)if(y=!y)h=d,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),p=d-1;p>=h;--p)s.point(b[p],x[p]);s.lineEnd(),s.areaEnd()}y&&(b[d]=+t(g,d,f),x[d]=+e(g,d,f),s.point(r?+r(g,d,f):b[d],n?+n(g,d,f):x[d]))}if(m)return s=null,m+""||null}function u(){return Ko().defined(i).curve(a).context(o)}return c.x=function(f){return arguments.length?(t=typeof f=="function"?f:de(+f),r=null,c):t},c.x0=function(f){return arguments.length?(t=typeof f=="function"?f:de(+f),c):t},c.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:de(+f),c):r},c.y=function(f){return arguments.length?(e=typeof f=="function"?f:de(+f),n=null,c):e},c.y0=function(f){return arguments.length?(e=typeof f=="function"?f:de(+f),c):e},c.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:de(+f),c):n},c.lineX0=c.lineY0=function(){return u().x(t).y(e)},c.lineY1=function(){return u().x(t).y(n)},c.lineX1=function(){return u().x(r).y(e)},c.defined=function(f){return arguments.length?(i=typeof f=="function"?f:de(!!f),c):i},c.curve=function(f){return arguments.length?(a=f,o!=null&&(s=a(o)),c):a},c.context=function(f){return arguments.length?(f==null?o=s=null:s=a(o=f),c):o},c}var kP=Bm(zu);function LP(t){this._curve=t}LP.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};function Bm(t){function e(n){return new LP(t(n))}return e._curve=t,e}function Yu(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(n){return arguments.length?e(Bm(n)):e()._curve},t}function kH(){return Yu(Ko().curve(kP))}function LH(){var t=Rm().curve(kP),e=t.curve,n=t.lineX0,r=t.lineX1,i=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return Yu(n())},delete t.lineX0,t.lineEndAngle=function(){return Yu(r())},delete t.lineX1,t.lineInnerRadius=function(){return Yu(i())},delete t.lineY0,t.lineOuterRadius=function(){return Yu(o())},delete t.lineY1,t.curve=function(a){return arguments.length?e(Bm(a)):e()._curve},t}function _l(){}function zm(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Ym(t,e){this._context=t,this._k=(1-e)/6}Ym.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:zm(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:zm(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(r){return new Ym(r,e)}return n.tension=function(r){return t(+r)},n}(0);function Wm(t,e){this._context=t,this._k=(1-e)/6}Wm.prototype={areaStart:_l,areaEnd:_l,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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:zm(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(r){return new Wm(r,e)}return n.tension=function(r){return t(+r)},n}(0);function NP(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>En){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>En){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*c+t._x1*t._l23_2a-e*t._l12_2a)/u,a=(a*c+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function IP(t,e){this._context=t,this._alpha=e}IP.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(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:NP(this,t,e);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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(r){return e?new IP(r,e):new Ym(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function jP(t,e){this._context=t,this._alpha=e}jP.prototype={areaStart:_l,areaEnd:_l,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(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:NP(this,t,e);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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const DP=function t(e){function n(r){return e?new jP(r,e):new Wm(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function $P(t){this._context=t}$P.prototype={areaStart:_l,areaEnd:_l,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Gm(t){return new $P(t)}function FP(t){return t<0?-1:1}function RP(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(FP(o)+FP(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function BP(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Hm(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,s=(o-r)/3;t._context.bezierCurveTo(r+s,i+s*e,o-s,a-s*n,o,a)}function Kh(t){this._context=t}Kh.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:Hm(this,this._t0,BP(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Hm(this,BP(this,n=RP(this,t,e)),n);break;default:Hm(this,this._t0,n=RP(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function zP(t){this._context=new YP(t)}(zP.prototype=Object.create(Kh.prototype)).point=function(t,e){Kh.prototype.point.call(this,e,t)};function YP(t){this._context=t}YP.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}};function WP(t){return new Kh(t)}function GP(t){return new zP(t)}function Zh(t,e){this._context=t,this._t=e}Zh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function HP(t){return new Zh(t,.5)}function UP(t){return new Zh(t,0)}function VP(t){return new Zh(t,1)}function he(t){const{transformations:e}=t.getOptions();return e.map(([r])=>r).filter(r=>r==="transpose").length%2!==0}function ce(t){const{transformations:e}=t.getOptions();return e.some(([n])=>n==="polar")}function Qh(t){const{transformations:e}=t.getOptions();return e.some(([n])=>n==="reflect")&&e.some(([n])=>n.startsWith("transpose"))}function XP(t){const{transformations:e}=t.getOptions();return e.some(([n])=>n==="helix")}function Jh(t){const{transformations:e}=t.getOptions();return e.some(([n])=>n==="parallel")}function qP(t){const{transformations:e}=t.getOptions();return e.some(([n])=>n==="fisheye")}function NH(t){return Jh(t)&&ce(t)}function Sl(t){return XP(t)||ce(t)}function IH(t){return ce(t)&&he(t)}function jH(t){if(Sl(t)){const[e,n]=t.getSize(),r=t.getOptions().transformations.find(i=>i[0]==="polar");if(r)return Math.max(e,n)/2*r[4]}return 0}function tp(t){const{transformations:e}=t.getOptions(),[,,,n,r]=e.find(i=>i[0]==="polar");return[+n,+r]}function Um(t,e=!0){const{transformations:n}=t.getOptions(),[,r,i]=n.find(o=>o[0]==="polar");return e?[+r*180/Math.PI,+i*180/Math.PI]:[r,i]}function DH(t,e){const{transformations:n}=t.getOptions(),[,...r]=n.find(i=>i[0]===e);return r}var KP={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(l,c,u){this.fn=l,this.context=c,this.once=u||!1}function o(l,c,u,f,d){if(typeof u!="function")throw new TypeError("The listener must be a function");var h=new i(u,f||l,d),p=n?n+c:c;return l._events[p]?l._events[p].fn?l._events[p]=[l._events[p],h]:l._events[p].push(h):(l._events[p]=h,l._eventsCount++),l}function a(l,c){--l._eventsCount===0?l._events=new r:delete l._events[c]}function s(){this._events=new r,this._eventsCount=0}s.prototype.eventNames=function(){var c=[],u,f;if(this._eventsCount===0)return c;for(f in u=this._events)e.call(u,f)&&c.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(u)):c},s.prototype.listeners=function(c){var u=n?n+c:c,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,h=f.length,p=new Array(h);d<h;d++)p[d]=f[d].fn;return p},s.prototype.listenerCount=function(c){var u=n?n+c:c,f=this._events[u];return f?f.fn?1:f.length:0},s.prototype.emit=function(c,u,f,d,h,p){var v=n?n+c:c;if(!this._events[v])return!1;var g=this._events[v],y=arguments.length,m,b;if(g.fn){switch(g.once&&this.removeListener(c,g.fn,void 0,!0),y){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,u),!0;case 3:return g.fn.call(g.context,u,f),!0;case 4:return g.fn.call(g.context,u,f,d),!0;case 5:return g.fn.call(g.context,u,f,d,h),!0;case 6:return g.fn.call(g.context,u,f,d,h,p),!0}for(b=1,m=new Array(y-1);b<y;b++)m[b-1]=arguments[b];g.fn.apply(g.context,m)}else{var x=g.length,w;for(b=0;b<x;b++)switch(g[b].once&&this.removeListener(c,g[b].fn,void 0,!0),y){case 1:g[b].fn.call(g[b].context);break;case 2:g[b].fn.call(g[b].context,u);break;case 3:g[b].fn.call(g[b].context,u,f);break;case 4:g[b].fn.call(g[b].context,u,f,d);break;default:if(!m)for(w=1,m=new Array(y-1);w<y;w++)m[w-1]=arguments[w];g[b].fn.apply(g[b].context,m)}}return!0},s.prototype.on=function(c,u,f){return o(this,c,u,f,!1)},s.prototype.once=function(c,u,f){return o(this,c,u,f,!0)},s.prototype.removeListener=function(c,u,f,d){var h=n?n+c:c;if(!this._events[h])return this;if(!u)return a(this,h),this;var p=this._events[h];if(p.fn)p.fn===u&&(!d||p.once)&&(!f||p.context===f)&&a(this,h);else{for(var v=0,g=[],y=p.length;v<y;v++)(p[v].fn!==u||d&&!p[v].once||f&&p[v].context!==f)&&g.push(p[v]);g.length?this._events[h]=g.length===1?g[0]:g:a(this,h)}return this},s.prototype.removeAllListeners=function(c){var u;return c?(u=n?n+c:c,this._events[u]&&a(this,u)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s})(KP);var $H=KP.exports;const Vm=lu($H);var FH=function(t){return t==null};const Ot=FH;var RH={}.toString,BH=function(t,e){return RH.call(t)==="[object "+e+"]"};const ep=BH,Xm=function(t){return Array.isArray?Array.isArray(t):ep(t,"Array")},np=function(t){var e=typeof t;return t!==null&&e==="object"||e==="function"},ZP=function(t){if(Xm(t))return t.reduce(function(e,n){return Math.max(e,n)},t[0])},QP=function(t){if(Xm(t))return t.reduce(function(e,n){return Math.min(e,n)},t[0])},ao=function(t){return ep(t,"String")};var zH=function(t,e,n){return t<e?e:t>n?n:t};const Wu=zH;var YH=function(t){return ep(t,"Number")};const as=YH;var WH=1e-5;function GH(t,e,n){return n===void 0&&(n=WH),Math.abs(t-e)<n}var HH=function(t,e){return(t%e+e)%e};const JP=HH;var UH=function(t){return ep(t,"Boolean")};const tA=UH;var VH=function(t){return t===void 0};const Le=VH;var eA={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function XH(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],i=n;r.length;)e[n]="A",t.splice(i+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var Gu={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function nA(t){return Array.isArray(t)&&t.every(function(e){var n=e[0].toLowerCase();return Gu[n]===e.length-1&&"achlmqstvz".includes(n)})}function rA(t){return nA(t)&&t.every(function(e){var n=e[0];return n===n.toUpperCase()})}function iA(t){return rA(t)&&t.every(function(e){var n=e[0];return"ACLMQZ".includes(n)})}function oA(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=Gu[n]&&(n==="m"&&r.length>2?(t.segments.push([e].concat(r.splice(0,2))),n="l",e=e==="m"?"l":"L"):t.segments.push([e].concat(r.splice(0,Gu[n]))),!!Gu[n]););}function qH(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);if(r===48){t.param=0,t.index+=1;return}if(r===49){t.param=1,t.index+=1;return}t.err='[path-util]: invalid Arc flag "'+n[e]+'", expecting 0 or 1 at index '+e}function KH(t){return t>=48&&t<=57||t===43||t===45||t===46}function El(t){return t>=48&&t<=57}function ZH(t){var e=t.max,n=t.pathValue,r=t.index,i=r,o=!1,a=!1,s=!1,l=!1,c;if(i>=e){t.err="[path-util]: Invalid path value at index "+i+', "pathValue" is missing param';return}if(c=n.charCodeAt(i),(c===43||c===45)&&(i+=1,c=n.charCodeAt(i)),!El(c)&&c!==46){t.err="[path-util]: Invalid path value at index "+i+', "'+n[i]+'" is not a number';return}if(c!==46){if(o=c===48,i+=1,c=n.charCodeAt(i),o&&i<e&&c&&El(c)){t.err="[path-util]: Invalid path value at index "+r+', "'+n[r]+'" illegal number';return}for(;i<e&&El(n.charCodeAt(i));)i+=1,a=!0;c=n.charCodeAt(i)}if(c===46){for(l=!0,i+=1;El(n.charCodeAt(i));)i+=1,s=!0;c=n.charCodeAt(i)}if(c===101||c===69){if(l&&!a&&!s){t.err="[path-util]: Invalid path value at index "+i+', "'+n[i]+'" invalid float exponent';return}if(i+=1,c=n.charCodeAt(i),(c===43||c===45)&&(i+=1),i<e&&El(n.charCodeAt(i)))for(;i<e&&El(n.charCodeAt(i));)i+=1;else{t.err="[path-util]: Invalid path value at index "+i+', "'+n[i]+'" invalid integer exponent';return}}t.index=i,t.param=+t.pathValue.slice(r,i)}function QH(t){var e=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];return t===10||t===13||t===8232||t===8233||t===32||t===9||t===11||t===12||t===160||t>=5760&&e.includes(t)}function rp(t){for(var e=t.pathValue,n=t.max;t.index<n&&QH(e.charCodeAt(t.index));)t.index+=1}function JH(t){switch(t|32){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}function tU(t){return(t|32)===97}function eU(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),o=Gu[n[r].toLowerCase()];if(t.segmentStart=r,!JH(i)){t.err='[path-util]: Invalid path value "'+n[r]+'" is not a path command';return}if(t.index+=1,rp(t),t.data=[],!o){oA(t);return}for(;;){for(var a=o;a>0;a-=1){if(tU(i)&&(a===3||a===4)?qH(t):ZH(t),t.err.length)return;t.data.push(t.param),rp(t),t.index<e&&n.charCodeAt(t.index)===44&&(t.index+=1,rp(t))}if(t.index>=t.max||!KH(n.charCodeAt(t.index)))break}oA(t)}var nU=function(){function t(e){this.pathValue=e,this.segments=[],this.max=e.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""}return t}();function rU(t){if(nA(t))return[].concat(t);var e=new nU(t);for(rp(e);e.index<e.max&&!e.err.length;)eU(e);return e.err?e.err:e.segments}function iU(t){if(rA(t))return[].concat(t);var e=rU(t),n=0,r=0,i=0,o=0;return e.map(function(a){var s=a.slice(1).map(Number),l=a[0],c=l.toUpperCase();if(l==="M")return n=s[0],r=s[1],i=n,o=r,["M",n,r];var u;if(l!==c)switch(c){case"A":u=[c,s[0],s[1],s[2],s[3],s[4],s[5]+n,s[6]+r];break;case"V":u=[c,s[0]+r];break;case"H":u=[c,s[0]+n];break;default:{var f=s.map(function(h,p){return h+(p%2?r:n)});u=[c].concat(f)}}else u=[c].concat(s);var d=u.length;switch(c){case"Z":n=i,r=o;break;case"H":n=u[1];break;case"V":r=u[1];break;default:n=u[d-2],r=u[d-1],c==="M"&&(i=n,o=r)}return u})}function oU(t,e){var n=t[0],r=e.x1,i=e.y1,o=e.x2,a=e.y2,s=t.slice(1).map(Number),l=t;if("TQ".includes(n)||(e.qx=null,e.qy=null),n==="H")l=["L",t[1],i];else if(n==="V")l=["L",r,t[1]];else if(n==="S"){var c=r*2-o,u=i*2-a;e.x1=c,e.y1=u,l=["C",c,u].concat(s)}else if(n==="T"){var f=r*2-e.qx,d=i*2-e.qy;e.qx=f,e.qy=d,l=["Q",f,d].concat(s)}else if(n==="Q"){var h=s[0],p=s[1];e.qx=h,e.qy=p}return l}function ip(t){if(iA(t))return[].concat(t);for(var e=iU(t),n=G({},eA),r=0;r<e.length;r+=1){e[r]=oU(e[r],n);var i=e[r],o=i.length;n.x1=+i[o-2],n.y1=+i[o-1],n.x2=+i[o-4]||n.x1,n.y2=+i[o-3]||n.y1}return e}function aU(t){return iA(t)&&t.every(function(e){var n=e[0];return"MC".includes(n)})}function op(t,e,n){var r=t*Math.cos(n)-e*Math.sin(n),i=t*Math.sin(n)+e*Math.cos(n);return{x:r,y:i}}function aA(t,e,n,r,i,o,a,s,l,c){var u=t,f=e,d=n,h=r,p=s,v=l,g=Math.PI*120/180,y=Math.PI/180*(+i||0),m=[],b,x,w,O,_;if(c)x=c[0],w=c[1],O=c[2],_=c[3];else{b=op(u,f,-y),u=b.x,f=b.y,b=op(p,v,-y),p=b.x,v=b.y;var S=(u-p)/2,E=(f-v)/2,M=S*S/(d*d)+E*E/(h*h);M>1&&(M=Math.sqrt(M),d*=M,h*=M);var P=d*d,C=h*h,A=(o===a?-1:1)*Math.sqrt(Math.abs((P*C-P*E*E-C*S*S)/(P*E*E+C*S*S)));O=A*d*E/h+(u+p)/2,_=A*-h*S/d+(f+v)/2,x=Math.asin(((f-_)/h*Math.pow(10,9)>>0)/Math.pow(10,9)),w=Math.asin(((v-_)/h*Math.pow(10,9)>>0)/Math.pow(10,9)),x=u<O?Math.PI-x:x,w=p<O?Math.PI-w:w,x<0&&(x=Math.PI*2+x),w<0&&(w=Math.PI*2+w),a&&x>w&&(x-=Math.PI*2),!a&&w>x&&(w-=Math.PI*2)}var T=w-x;if(Math.abs(T)>g){var k=w,N=p,j=v;w=x+g*(a&&w>x?1:-1),p=O+d*Math.cos(w),v=_+h*Math.sin(w),m=aA(p,v,d,h,i,0,a,N,j,[w,k,O,_])}T=w-x;var L=Math.cos(x),I=Math.sin(x),$=Math.cos(w),F=Math.sin(w),R=Math.tan(T/4),B=4/3*d*R,W=4/3*h*R,K=[u,f],J=[u+B*I,f-W*L],X=[p+B*F,v-W*$],V=[p,v];if(J[0]=2*K[0]-J[0],J[1]=2*K[1]-J[1],c)return J.concat(X,V,m);m=J.concat(X,V,m);for(var it=[],nt=0,lt=m.length;nt<lt;nt+=1)it[nt]=nt%2?op(m[nt-1],m[nt],y).y:op(m[nt],m[nt+1],y).x;return it}function sU(t,e,n,r,i,o){var a=.3333333333333333,s=2/3;return[a*t+s*n,a*e+s*r,a*i+s*n,a*o+s*r,i,o]}function Zo(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return[r+(o-r)*n,i+(a-i)*n]}var sA=function(t,e,n,r){var i=.5,o=Zo([t,e],[n,r],i);return Q(Q([],o,!0),[n,r,n,r],!1)};function lU(t,e){var n=t[0],r=t.slice(1).map(Number),i=r[0],o=r[1],a,s=e.x1,l=e.y1,c=e.x,u=e.y;switch("TQ".includes(n)||(e.qx=null,e.qy=null),n){case"M":return e.x=i,e.y=o,t;case"A":return a=[s,l].concat(r),["C"].concat(aA(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9]));case"Q":return e.qx=i,e.qy=o,a=[s,l].concat(r),["C"].concat(sU(a[0],a[1],a[2],a[3],a[4],a[5]));case"L":return["C"].concat(sA(s,l,i,o));case"Z":return s===c&&l===u?["C",s,l,c,u,c,u]:["C"].concat(sA(s,l,c,u))}return t}function qm(t,e){if(e===void 0&&(e=!1),aU(t)){var n=[].concat(t);return e?[n,[]]:n}for(var r=ip(t),i=G({},eA),o=[],a="",s=r.length,l,c,u=[],f=0;f<s;f+=1){r[f]&&(a=r[f][0]),o[f]=a;var d=lU(r[f],i);r[f]=d,XH(r,o,f),s=r.length,a==="Z"&&u.push(f),l=r[f],c=l.length,i.x1=+l[c-2],i.y1=+l[c-1],i.x2=+l[c-4]||i.x1,i.y2=+l[c-3]||i.y1}return e?[r,u]:r}function cU(t){return t.map(function(e){return Array.isArray(e)?[].concat(e):e})}function uU(t){var e=t.slice(1).map(function(n,r,i){return r?i[r-1].slice(-2).concat(n.slice(1)):t[0].slice(1).concat(n.slice(1))}).map(function(n){return n.map(function(r,i){return n[n.length-i-2*(1-i%2)]})}).reverse();return[["M"].concat(e[0].slice(0,2))].concat(e.map(function(n){return["C"].concat(n.slice(2))}))}function hr(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function Km(t,e,n,r,i){var o=hr([t,e],[n,r]),a={x:0,y:0};if(typeof i=="number")if(i<=0)a={x:t,y:e};else if(i>=o)a={x:n,y:r};else{var s=Zo([t,e],[n,r],i/o),l=s[0],c=s[1];a={x:l,y:c}}return{length:o,point:a,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function lA(t,e){var n=t.x,r=t.y,i=e.x,o=e.y,a=n*i+r*o,s=Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(o,2))),l=n*o-r*i<0?-1:1,c=l*Math.acos(a/s);return c}function fU(t,e,n,r,i,o,a,s,l,c){var u=Math.abs,f=Math.sin,d=Math.cos,h=Math.sqrt,p=Math.PI,v=u(n),g=u(r),y=(i%360+360)%360,m=y*(p/180);if(t===s&&e===l)return{x:t,y:e};if(v===0||g===0)return Km(t,e,s,l,c).point;var b=(t-s)/2,x=(e-l)/2,w={x:d(m)*b+f(m)*x,y:-f(m)*b+d(m)*x},O=Math.pow(w.x,2)/Math.pow(v,2)+Math.pow(w.y,2)/Math.pow(g,2);O>1&&(v*=h(O),g*=h(O));var _=Math.pow(v,2)*Math.pow(g,2)-Math.pow(v,2)*Math.pow(w.y,2)-Math.pow(g,2)*Math.pow(w.x,2),S=Math.pow(v,2)*Math.pow(w.y,2)+Math.pow(g,2)*Math.pow(w.x,2),E=_/S;E=E<0?0:E;var M=(o!==a?1:-1)*h(E),P={x:M*(v*w.y/g),y:M*(-(g*w.x)/v)},C={x:d(m)*P.x-f(m)*P.y+(t+s)/2,y:f(m)*P.x+d(m)*P.y+(e+l)/2},A={x:(w.x-P.x)/v,y:(w.y-P.y)/g},T=lA({x:1,y:0},A),k={x:(-w.x-P.x)/v,y:(-w.y-P.y)/g},N=lA(A,k);!a&&N>0?N-=2*p:a&&N<0&&(N+=2*p),N%=2*p;var j=T+N*c,L=v*d(j),I=g*f(j),$={x:d(m)*L-f(m)*I+C.x,y:f(m)*L+d(m)*I+C.y};return $}function dU(t,e,n,r,i,o,a,s,l,c,u){var f,d=u.bbox,h=d===void 0?!0:d,p=u.length,v=p===void 0?!0:p,g=u.sampleSize,y=g===void 0?30:g,m=typeof c=="number",b=t,x=e,w=0,O=[b,x,w],_=[b,x],S=0,E={x:0,y:0},M=[{x:b,y:x}];m&&c<=0&&(E={x:b,y:x});for(var P=0;P<=y;P+=1){if(S=P/y,f=fU(t,e,n,r,i,o,a,s,l,S),b=f.x,x=f.y,h&&M.push({x:b,y:x}),v&&(w+=hr(_,[b,x])),_=[b,x],m&&w>=c&&c>O[2]){var C=(w-c)/(w-O[2]);E={x:_[0]*(1-C)+O[0]*C,y:_[1]*(1-C)+O[1]*C}}O=[b,x,w]}return m&&c>=w&&(E={x:s,y:l}),{length:w,point:E,min:{x:Math.min.apply(null,M.map(function(A){return A.x})),y:Math.min.apply(null,M.map(function(A){return A.y}))},max:{x:Math.max.apply(null,M.map(function(A){return A.x})),y:Math.max.apply(null,M.map(function(A){return A.y}))}}}function hU(t,e,n,r,i,o,a,s,l){var c=1-l;return{x:Math.pow(c,3)*t+3*Math.pow(c,2)*l*n+3*c*Math.pow(l,2)*i+Math.pow(l,3)*a,y:Math.pow(c,3)*e+3*Math.pow(c,2)*l*r+3*c*Math.pow(l,2)*o+Math.pow(l,3)*s}}function cA(t,e,n,r,i,o,a,s,l,c){var u,f=c.bbox,d=f===void 0?!0:f,h=c.length,p=h===void 0?!0:h,v=c.sampleSize,g=v===void 0?10:v,y=typeof l=="number",m=t,b=e,x=0,w=[m,b,x],O=[m,b],_=0,S={x:0,y:0},E=[{x:m,y:b}];y&&l<=0&&(S={x:m,y:b});for(var M=0;M<=g;M+=1){if(_=M/g,u=hU(t,e,n,r,i,o,a,s,_),m=u.x,b=u.y,d&&E.push({x:m,y:b}),p&&(x+=hr(O,[m,b])),O=[m,b],y&&x>=l&&l>w[2]){var P=(x-l)/(x-w[2]);S={x:O[0]*(1-P)+w[0]*P,y:O[1]*(1-P)+w[1]*P}}w=[m,b,x]}return y&&l>=x&&(S={x:a,y:s}),{length:x,point:S,min:{x:Math.min.apply(null,E.map(function(C){return C.x})),y:Math.min.apply(null,E.map(function(C){return C.y}))},max:{x:Math.max.apply(null,E.map(function(C){return C.x})),y:Math.max.apply(null,E.map(function(C){return C.y}))}}}function pU(t,e,n,r,i,o,a){var s=1-a;return{x:Math.pow(s,2)*t+2*s*a*n+Math.pow(a,2)*i,y:Math.pow(s,2)*e+2*s*a*r+Math.pow(a,2)*o}}function vU(t,e,n,r,i,o,a,s){var l,c=s.bbox,u=c===void 0?!0:c,f=s.length,d=f===void 0?!0:f,h=s.sampleSize,p=h===void 0?10:h,v=typeof a=="number",g=t,y=e,m=0,b=[g,y,m],x=[g,y],w=0,O={x:0,y:0},_=[{x:g,y}];v&&a<=0&&(O={x:g,y});for(var S=0;S<=p;S+=1){if(w=S/p,l=pU(t,e,n,r,i,o,w),g=l.x,y=l.y,u&&_.push({x:g,y}),d&&(m+=hr(x,[g,y])),x=[g,y],v&&m>=a&&a>b[2]){var E=(m-a)/(m-b[2]);O={x:x[0]*(1-E)+b[0]*E,y:x[1]*(1-E)+b[1]*E}}b=[g,y,m]}return v&&a>=m&&(O={x:i,y:o}),{length:m,point:O,min:{x:Math.min.apply(null,_.map(function(M){return M.x})),y:Math.min.apply(null,_.map(function(M){return M.y}))},max:{x:Math.max.apply(null,_.map(function(M){return M.x})),y:Math.max.apply(null,_.map(function(M){return M.y}))}}}function uA(t,e,n){for(var r,i,o,a,s,l,c=ip(t),u=typeof e=="number",f,d=[],h,p=0,v=0,g=0,y=0,m,b=[],x=[],w=0,O={x:0,y:0},_=O,S=O,E=O,M=0,P=0,C=c.length;P<C;P+=1)m=c[P],h=m[0],f=h==="M",d=f?d:[p,v].concat(m.slice(1)),f?(g=m[1],y=m[2],O={x:g,y},_=O,w=0,u&&e<.001&&(E=O)):h==="L"?(r=Km(d[0],d[1],d[2],d[3],(e||0)-M),w=r.length,O=r.min,_=r.max,S=r.point):h==="A"?(i=dU(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],(e||0)-M,n||{}),w=i.length,O=i.min,_=i.max,S=i.point):h==="C"?(o=cA(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],(e||0)-M,n||{}),w=o.length,O=o.min,_=o.max,S=o.point):h==="Q"?(a=vU(d[0],d[1],d[2],d[3],d[4],d[5],(e||0)-M,n||{}),w=a.length,O=a.min,_=a.max,S=a.point):h==="Z"&&(d=[p,v,g,y],s=Km(d[0],d[1],d[2],d[3],(e||0)-M),w=s.length,O=s.min,_=s.max,S=s.point),u&&M<e&&M+w>=e&&(E=S),x.push(_),b.push(O),M+=w,l=h!=="Z"?m.slice(-2):[g,y],p=l[0],v=l[1];return u&&e>=M&&(E={x:p,y:v}),{length:M,point:E,min:{x:Math.min.apply(null,b.map(function(A){return A.x})),y:Math.min.apply(null,b.map(function(A){return A.y}))},max:{x:Math.max.apply(null,x.map(function(A){return A.x})),y:Math.max.apply(null,x.map(function(A){return A.y}))}}}function gU(t,e){return uA(t,void 0,G(G({},e),{bbox:!1,length:!0})).length}function yU(t){var e=t.length,n=e-1;return t.map(function(r,i){return t.map(function(o,a){var s=i+a,l;return a===0||t[s]&&t[s][0]==="M"?(l=t[s],["M"].concat(l.slice(-2))):(s>=e&&(s-=n),t[s])})})}function mU(t,e){var n=t.length-1,r=[],i=0,o=0,a=yU(t);return a.forEach(function(s,l){t.slice(1).forEach(function(c,u){o+=hr(t[(l+u)%n].slice(-2),e[u%n].slice(-2))}),r[l]=o,o=0}),i=r.indexOf(Math.min.apply(null,r)),a[i]}function bU(t,e,n,r,i,o,a,s){return 3*((s-e)*(n+i)-(a-t)*(r+o)+r*(t-i)-n*(e-o)+s*(i+t/3)-a*(o+e/3))/20}function xU(t){var e=0,n=0,r=0;return qm(t).map(function(i){var o;switch(i[0]){case"M":return e=i[1],n=i[2],0;default:var a=i.slice(1),s=a[0],l=a[1],c=a[2],u=a[3],f=a[4],d=a[5];return r=bU(e,n,s,l,c,u,f,d),o=i.slice(-2),e=o[0],n=o[1],r}}).reduce(function(i,o){return i+o},0)}function fA(t){return xU(t)>=0}function wU(t,e,n){return uA(t,e,G(G({},n),{bbox:!1,length:!0})).point}function OU(t,e){e===void 0&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),a=Zo(n,r,e),s=Zo(r,i,e),l=Zo(i,o,e),c=Zo(a,s,e),u=Zo(s,l,e),f=Zo(c,u,e);return[["C"].concat(a,c,f),["C"].concat(u,l,o)]}function dA(t){return t.map(function(e,n,r){var i=n&&r[n-1].slice(-2).concat(e.slice(1)),o=n?cA(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8],{bbox:!1}).length:0,a;return n?a=o?OU(i):[e,e]:a=[e],{s:e,ss:a,l:o}})}function hA(t,e,n){var r=dA(t),i=dA(e),o=r.length,a=i.length,s=r.filter(function(g){return g.l}).length,l=i.filter(function(g){return g.l}).length,c=r.filter(function(g){return g.l}).reduce(function(g,y){var m=y.l;return g+m},0)/s||0,u=i.filter(function(g){return g.l}).reduce(function(g,y){var m=y.l;return g+m},0)/l||0,f=n||Math.max(o,a),d=[c,u],h=[f-o,f-a],p=0,v=[r,i].map(function(g,y){return g.l===f?g.map(function(m){return m.s}):g.map(function(m,b){return p=b&&h[y]&&m.l>=d[y],h[y]-=p?1:0,p?m.ss:[m.s]}).flat()});return v[0].length===v[1].length?v:hA(v[0],v[1],f)}function Zm(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function pA(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Hu(){}var Uu=.7,ap=1/Uu,Ml="\\s*([+-]?\\d+)\\s*",Vu="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ci="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",_U=/^#([0-9a-f]{3,8})$/,SU=new RegExp("^rgb\\("+[Ml,Ml,Ml]+"\\)$"),EU=new RegExp("^rgb\\("+[Ci,Ci,Ci]+"\\)$"),MU=new RegExp("^rgba\\("+[Ml,Ml,Ml,Vu]+"\\)$"),PU=new RegExp("^rgba\\("+[Ci,Ci,Ci,Vu]+"\\)$"),AU=new RegExp("^hsl\\("+[Vu,Ci,Ci]+"\\)$"),CU=new RegExp("^hsla\\("+[Vu,Ci,Ci,Vu]+"\\)$"),vA={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};Zm(Hu,sp,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:gA,formatHex:gA,formatHsl:TU,formatRgb:yA,toString:yA});function gA(){return this.rgb().formatHex()}function TU(){return OA(this).formatHsl()}function yA(){return this.rgb().formatRgb()}function sp(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=_U.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?mA(e):n===3?new pr(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?lp(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?lp(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=SU.exec(t))?new pr(e[1],e[2],e[3],1):(e=EU.exec(t))?new pr(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=MU.exec(t))?lp(e[1],e[2],e[3],e[4]):(e=PU.exec(t))?lp(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=AU.exec(t))?wA(e[1],e[2]/100,e[3]/100,1):(e=CU.exec(t))?wA(e[1],e[2]/100,e[3]/100,e[4]):vA.hasOwnProperty(t)?mA(vA[t]):t==="transparent"?new pr(NaN,NaN,NaN,0):null}function mA(t){return new pr(t>>16&255,t>>8&255,t&255,1)}function lp(t,e,n,r){return r<=0&&(t=e=n=NaN),new pr(t,e,n,r)}function kU(t){return t instanceof Hu||(t=sp(t)),t?(t=t.rgb(),new pr(t.r,t.g,t.b,t.opacity)):new pr}function LU(t,e,n,r){return arguments.length===1?kU(t):new pr(t,e,n,r==null?1:r)}function pr(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}Zm(pr,LU,pA(Hu,{brighter:function(t){return t=t==null?ap:Math.pow(ap,t),new pr(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=t==null?Uu:Math.pow(Uu,t),new pr(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:bA,formatHex:bA,formatRgb:xA,toString:xA}));function bA(){return"#"+Qm(this.r)+Qm(this.g)+Qm(this.b)}function xA(){var t=this.opacity;return t=isNaN(t)?1:Math.max(0,Math.min(1,t)),(t===1?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(t===1?")":", "+t+")")}function Qm(t){return t=Math.max(0,Math.min(255,Math.round(t)||0)),(t<16?"0":"")+t.toString(16)}function wA(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Ti(t,e,n,r)}function OA(t){if(t instanceof Ti)return new Ti(t.h,t.s,t.l,t.opacity);if(t instanceof Hu||(t=sp(t)),!t)return new Ti;if(t instanceof Ti)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(e===o?a=(n-r)/s+(n<r)*6:n===o?a=(r-e)/s+2:a=(e-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new Ti(a,s,l,t.opacity)}function NU(t,e,n,r){return arguments.length===1?OA(t):new Ti(t,e,n,r==null?1:r)}function Ti(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}Zm(Ti,NU,pA(Hu,{brighter:function(t){return t=t==null?ap:Math.pow(ap,t),new Ti(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=t==null?Uu:Math.pow(Uu,t),new Ti(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new pr(Jm(t>=240?t-240:t+120,i,r),Jm(t,i,r),Jm(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return t=isNaN(t)?1:Math.max(0,Math.min(1,t)),(t===1?"hsl(":"hsla(")+(this.h||0)+", "+(this.s||0)*100+"%, "+(this.l||0)*100+"%"+(t===1?")":", "+t+")")}}));function Jm(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}var IU=1e-5;function cp(t,e,n){return n===void 0&&(n=IU),Math.abs(t-e)<n}function so(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function _A(t,e){var n=Math.min.apply(Math,Q([],D(t),!1)),r=Math.min.apply(Math,Q([],D(e),!1)),i=Math.max.apply(Math,Q([],D(t),!1)),o=Math.max.apply(Math,Q([],D(e),!1));return{x:n,y:r,width:i-n,height:o-r}}function jU(t,e,n){return Math.atan(-e/t*Math.tan(n))}function DU(t,e,n){return Math.atan(e/(t*Math.tan(n)))}function $U(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function FU(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}function RU(t,e,n,r,i,o,a){for(var s=jU(n,r,i),l=1/0,c=-1/0,u=[o,a],f=-Math.PI*2;f<=Math.PI*2;f+=Math.PI){var d=s+f;o<a?o<d&&d<a&&u.push(d):a<d&&d<o&&u.push(d)}for(var f=0;f<u.length;f++){var h=$U(t,e,n,r,i,u[f]);h<l&&(l=h),h>c&&(c=h)}for(var p=DU(n,r,i),v=1/0,g=-1/0,y=[o,a],f=-Math.PI*2;f<=Math.PI*2;f+=Math.PI){var m=p+f;o<a?o<m&&m<a&&y.push(m):a<m&&m<o&&y.push(m)}for(var f=0;f<y.length;f++){var b=FU(t,e,n,r,i,y[f]);b<v&&(v=b),b>g&&(g=b)}return{x:l,y:v,width:c-l,height:g-v}}var BU=1e-4;function SA(t,e,n,r,i,o){var a=-1,s=1/0,l=[n,r],c=20;o&&o>200&&(c=o/10);for(var u=1/c,f=u/10,d=0;d<=c;d++){var h=d*u,p=[i.apply(void 0,Q([],D(t.concat([h])),!1)),i.apply(void 0,Q([],D(e.concat([h])),!1))],v=so(l[0],l[1],p[0],p[1]);v<s&&(a=h,s=v)}if(a===0)return{x:t[0],y:e[0]};if(a===1){var g=t.length;return{x:t[g-1],y:e[g-1]}}s=1/0;for(var d=0;d<32&&!(f<BU);d++){var y=a-f,m=a+f,p=[i.apply(void 0,Q([],D(t.concat([y])),!1)),i.apply(void 0,Q([],D(e.concat([y])),!1))],v=so(l[0],l[1],p[0],p[1]);if(y>=0&&v<s)a=y,s=v;else{var b=[i.apply(void 0,Q([],D(t.concat([m])),!1)),i.apply(void 0,Q([],D(e.concat([m])),!1))],x=so(l[0],l[1],b[0],b[1]);m<=1&&x<s?(a=m,s=x):f*=.5}}return{x:i.apply(void 0,Q([],D(t.concat([a])),!1)),y:i.apply(void 0,Q([],D(e.concat([a])),!1))}}function EA(t,e,n,r){return so(t,e,n,r)}function MA(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function zU(t,e,n,r,i,o){var a=[n-t,r-e];if(gY(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var s=[-a[1],a[0]];pY(s,s);var l=[i-t,o-e];return Math.abs(vY(l,s))}function t1(t,e,n,r,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*n*i*i*o+r*i*i*i}function PA(t,e,n,r){var i=-3*t+9*e-9*n+3*r,o=6*t-12*e+6*n,a=3*e-3*t,s=[],l,c,u;if(cp(i,0))cp(o,0)||(l=-a/o,l>=0&&l<=1&&s.push(l));else{var f=o*o-4*i*a;cp(f,0)?s.push(-o/(2*i)):f>0&&(u=Math.sqrt(f),l=(-o+u)/(2*i),c=(-o-u)/(2*i),l>=0&&l<=1&&s.push(l),c>=0&&c<=1&&s.push(c))}return s}function YU(t,e,n,r,i,o,a,s){for(var l=[t,a],c=[e,s],u=PA(t,n,i,a),f=PA(e,r,o,s),d=0;d<u.length;d++)l.push(t1(t,n,i,a,u[d]));for(var d=0;d<f.length;d++)c.push(t1(e,r,o,s,f[d]));return _A(l,c)}function WU(t,e,n,r,i,o,a,s,l,c,u){return SA([t,n,i,a],[e,r,o,s],l,c,t1,u)}function AA(t,e,n,r,i,o,a,s,l,c,u){var f=WU(t,e,n,r,i,o,a,s,l,c,u);return so(f.x,f.y,l,c)}function GU(t){if(t.length<2)return 0;for(var e=0,n=0;n<t.length-1;n++){var r=t[n],i=t[n+1];e+=so(r[0],r[1],i[0],i[1])}return e}function HU(t){return GU(t)}function e1(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function CA(t,e,n){var r=t+n-2*e;if(cp(r,0))return[.5];var i=(t-e)/r;return i<=1&&i>=0?[i]:[]}function UU(t,e,n,r,i,o){var a=CA(t,n,i)[0],s=CA(e,r,o)[0],l=[t,i],c=[e,o];return a!==void 0&&l.push(e1(t,n,i,a)),s!==void 0&&c.push(e1(e,r,o,s)),_A(l,c)}function VU(t,e,n,r,i,o,a,s){return SA([t,n,i],[e,r,o],a,s,e1)}function XU(t,e,n,r,i,o,a,s){var l=VU(t,e,n,r,i,o,a,s);return so(l.x,l.y,a,s)}var qU=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},TA={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(qU,function(){function n(w,O,_,S,E){r(w,O,_||0,S||w.length-1,E||o)}function r(w,O,_,S,E){for(;S>_;){if(S-_>600){var M=S-_+1,P=O-_+1,C=Math.log(M),A=.5*Math.exp(2*C/3),T=.5*Math.sqrt(C*A*(M-A)/M)*(P-M/2<0?-1:1),k=Math.max(_,Math.floor(O-P*A/M+T)),N=Math.min(S,Math.floor(O+(M-P)*A/M+T));r(w,O,k,N,E)}var j=w[O],L=_,I=S;for(i(w,_,O),E(w[S],j)>0&&i(w,_,S);L<I;){for(i(w,L,I),L++,I--;E(w[L],j)<0;)L++;for(;E(w[I],j)>0;)I--}E(w[_],j)===0?i(w,_,I):(I++,i(w,I,S)),I<=O&&(_=I+1),O<=I&&(S=I-1)}}function i(w,O,_){var S=w[O];w[O]=w[_],w[_]=S}function o(w,O){return w<O?-1:w>O?1:0}var a=function(O){O===void 0&&(O=9),this._maxEntries=Math.max(4,O),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()};a.prototype.all=function(){return this._all(this.data,[])},a.prototype.search=function(O){var _=this.data,S=[];if(!m(O,_))return S;for(var E=this.toBBox,M=[];_;){for(var P=0;P<_.children.length;P++){var C=_.children[P],A=_.leaf?E(C):C;m(O,A)&&(_.leaf?S.push(C):y(O,A)?this._all(C,S):M.push(C))}_=M.pop()}return S},a.prototype.collides=function(O){var _=this.data;if(!m(O,_))return!1;for(var S=[];_;){for(var E=0;E<_.children.length;E++){var M=_.children[E],P=_.leaf?this.toBBox(M):M;if(m(O,P)){if(_.leaf||y(O,P))return!0;S.push(M)}}_=S.pop()}return!1},a.prototype.load=function(O){if(!(O&&O.length))return this;if(O.length<this._minEntries){for(var _=0;_<O.length;_++)this.insert(O[_]);return this}var S=this._build(O.slice(),0,O.length-1,0);if(!this.data.children.length)this.data=S;else if(this.data.height===S.height)this._splitRoot(this.data,S);else{if(this.data.height<S.height){var E=this.data;this.data=S,S=E}this._insert(S,this.data.height-S.height-1,!0)}return this},a.prototype.insert=function(O){return O&&this._insert(O,this.data.height-1),this},a.prototype.clear=function(){return this.data=b([]),this},a.prototype.remove=function(O,_){if(!O)return this;for(var S=this.data,E=this.toBBox(O),M=[],P=[],C,A,T;S||M.length;){if(S||(S=M.pop(),A=M[M.length-1],C=P.pop(),T=!0),S.leaf){var k=s(O,S.children,_);if(k!==-1)return S.children.splice(k,1),M.push(S),this._condense(M),this}!T&&!S.leaf&&y(S,E)?(M.push(S),P.push(C),C=0,A=S,S=S.children[0]):A?(C++,S=A.children[C],T=!1):S=null}return this},a.prototype.toBBox=function(O){return O},a.prototype.compareMinX=function(O,_){return O.minX-_.minX},a.prototype.compareMinY=function(O,_){return O.minY-_.minY},a.prototype.toJSON=function(){return this.data},a.prototype.fromJSON=function(O){return this.data=O,this},a.prototype._all=function(O,_){for(var S=[];O;)O.leaf?_.push.apply(_,O.children):S.push.apply(S,O.children),O=S.pop();return _},a.prototype._build=function(O,_,S,E){var M=S-_+1,P=this._maxEntries,C;if(M<=P)return C=b(O.slice(_,S+1)),l(C,this.toBBox),C;E||(E=Math.ceil(Math.log(M)/Math.log(P)),P=Math.ceil(M/Math.pow(P,E-1))),C=b([]),C.leaf=!1,C.height=E;var A=Math.ceil(M/P),T=A*Math.ceil(Math.sqrt(P));x(O,_,S,T,this.compareMinX);for(var k=_;k<=S;k+=T){var N=Math.min(k+T-1,S);x(O,k,N,A,this.compareMinY);for(var j=k;j<=N;j+=A){var L=Math.min(j+A-1,N);C.children.push(this._build(O,j,L,E-1))}}return l(C,this.toBBox),C},a.prototype._chooseSubtree=function(O,_,S,E){for(;E.push(_),!(_.leaf||E.length-1===S);){for(var M=1/0,P=1/0,C=void 0,A=0;A<_.children.length;A++){var T=_.children[A],k=h(T),N=v(O,T)-k;N<P?(P=N,M=k<M?k:M,C=T):N===P&&k<M&&(M=k,C=T)}_=C||_.children[0]}return _},a.prototype._insert=function(O,_,S){var E=S?O:this.toBBox(O),M=[],P=this._chooseSubtree(E,this.data,_,M);for(P.children.push(O),u(P,E);_>=0&&M[_].children.length>this._maxEntries;)this._split(M,_),_--;this._adjustParentBBoxes(E,M,_)},a.prototype._split=function(O,_){var S=O[_],E=S.children.length,M=this._minEntries;this._chooseSplitAxis(S,M,E);var P=this._chooseSplitIndex(S,M,E),C=b(S.children.splice(P,S.children.length-P));C.height=S.height,C.leaf=S.leaf,l(S,this.toBBox),l(C,this.toBBox),_?O[_-1].children.push(C):this._splitRoot(S,C)},a.prototype._splitRoot=function(O,_){this.data=b([O,_]),this.data.height=O.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},a.prototype._chooseSplitIndex=function(O,_,S){for(var E,M=1/0,P=1/0,C=_;C<=S-_;C++){var A=c(O,0,C,this.toBBox),T=c(O,C,S,this.toBBox),k=g(A,T),N=h(A)+h(T);k<M?(M=k,E=C,P=N<P?N:P):k===M&&N<P&&(P=N,E=C)}return E||S-_},a.prototype._chooseSplitAxis=function(O,_,S){var E=O.leaf?this.compareMinX:f,M=O.leaf?this.compareMinY:d,P=this._allDistMargin(O,_,S,E),C=this._allDistMargin(O,_,S,M);P<C&&O.children.sort(E)},a.prototype._allDistMargin=function(O,_,S,E){O.children.sort(E);for(var M=this.toBBox,P=c(O,0,_,M),C=c(O,S-_,S,M),A=p(P)+p(C),T=_;T<S-_;T++){var k=O.children[T];u(P,O.leaf?M(k):k),A+=p(P)}for(var N=S-_-1;N>=_;N--){var j=O.children[N];u(C,O.leaf?M(j):j),A+=p(C)}return A},a.prototype._adjustParentBBoxes=function(O,_,S){for(var E=S;E>=0;E--)u(_[E],O)},a.prototype._condense=function(O){for(var _=O.length-1,S=void 0;_>=0;_--)O[_].children.length===0?_>0?(S=O[_-1].children,S.splice(S.indexOf(O[_]),1)):this.clear():l(O[_],this.toBBox)};function s(w,O,_){if(!_)return O.indexOf(w);for(var S=0;S<O.length;S++)if(_(w,O[S]))return S;return-1}function l(w,O){c(w,0,w.children.length,O,w)}function c(w,O,_,S,E){E||(E=b(null)),E.minX=1/0,E.minY=1/0,E.maxX=-1/0,E.maxY=-1/0;for(var M=O;M<_;M++){var P=w.children[M];u(E,w.leaf?S(P):P)}return E}function u(w,O){return w.minX=Math.min(w.minX,O.minX),w.minY=Math.min(w.minY,O.minY),w.maxX=Math.max(w.maxX,O.maxX),w.maxY=Math.max(w.maxY,O.maxY),w}function f(w,O){return w.minX-O.minX}function d(w,O){return w.minY-O.minY}function h(w){return(w.maxX-w.minX)*(w.maxY-w.minY)}function p(w){return w.maxX-w.minX+(w.maxY-w.minY)}function v(w,O){return(Math.max(O.maxX,w.maxX)-Math.min(O.minX,w.minX))*(Math.max(O.maxY,w.maxY)-Math.min(O.minY,w.minY))}function g(w,O){var _=Math.max(w.minX,O.minX),S=Math.max(w.minY,O.minY),E=Math.min(w.maxX,O.maxX),M=Math.min(w.maxY,O.maxY);return Math.max(0,E-_)*Math.max(0,M-S)}function y(w,O){return w.minX<=O.minX&&w.minY<=O.minY&&O.maxX<=w.maxX&&O.maxY<=w.maxY}function m(w,O){return O.minX<=w.maxX&&O.minY<=w.maxY&&O.maxX>=w.minX&&O.maxY>=w.minY}function b(w){return{children:w,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function x(w,O,_,S,E){for(var M=[O,_];M.length;)if(_=M.pop(),O=M.pop(),!(_-O<=S)){var P=O+Math.ceil((_-O)/S/2)*S;n(w,P,O,_,E),M.push(O,P,P,_)}}return a})})(TA);var KU=TA.exports,H;(function(t){t.GROUP="g",t.CIRCLE="circle",t.ELLIPSE="ellipse",t.IMAGE="image",t.RECT="rect",t.LINE="line",t.POLYLINE="polyline",t.POLYGON="polygon",t.TEXT="text",t.PATH="path",t.HTML="html",t.MESH="mesh"})(H||(H={}));var Pl;(function(t){t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE"})(Pl||(Pl={}));var Qo=function(){function t(){this.plugins=[]}return t.prototype.addRenderingPlugin=function(e){this.plugins.push(e),this.context.renderingPlugins.push(e)},t.prototype.removeAllRenderingPlugins=function(){var e=this;this.plugins.forEach(function(n){var r=e.context.renderingPlugins.indexOf(n);r>=0&&e.context.renderingPlugins.splice(r,1)})},t}(),ZU=function(){function t(e){this.clipSpaceNearZ=Pl.NEGATIVE_ONE,this.plugins=[],this.config=G({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0},e)}return t.prototype.registerPlugin=function(e){var n=this.plugins.findIndex(function(r){return r===e});n===-1&&this.plugins.push(e)},t.prototype.unregisterPlugin=function(e){var n=this.plugins.findIndex(function(r){return r===e});n>-1&&this.plugins.splice(n,1)},t.prototype.getPlugins=function(){return this.plugins},t.prototype.getPlugin=function(e){return this.plugins.find(function(n){return n.name===e})},t.prototype.getConfig=function(){return this.config},t.prototype.setConfig=function(e){Object.assign(this.config,e)},t}();function Al(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function n1(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function up(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function kA(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function QU(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t}function JU(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t}function Cl(t){return t===void 0?0:t>360||t<-360?t%360:t}function In(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=0),Array.isArray(t)&&t.length===3?to(t):as(t)?jt(t,e,n):jt(t[0],t[1]||e,t[2]||n)}function Me(t){return t*(Math.PI/180)}function Ir(t){return t*(180/Math.PI)}function tV(t){return 360*t}function eV(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n,s=r*r,l=i*i,c=o*o,u=a+s+l+c,f=n*o-r*i;return f>.499995*u?(t[0]=Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):f<-.499995*u?(t[0]=-Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-o*r)),t[1]=Math.atan2(2*(n*o+r*i),1-2*(l+c)),t[2]=Math.atan2(2*(n*r+i*o),1-2*(s+l))),t}function nV(t,e){var n,r,i=Math.PI*.5,o=D(cl(Ct(),e),3),a=o[0],s=o[1],l=o[2],c=Math.asin(-e[2]/a);return c<i?c>-i?(n=Math.atan2(e[6]/s,e[10]/l),r=Math.atan2(e[1]/a,e[0]/a)):(r=0,n=-Math.atan2(e[4]/s,e[5]/s)):(r=0,n=Math.atan2(e[4]/s,e[5]/s)),t[0]=n,t[1]=c,t[2]=r,t}function r1(t,e){return e.length===16?nV(t,e):eV(t,e)}function rV(t,e,n,r,i){var o=Math.cos(t),a=Math.sin(t);return Pz(r*o,i*a,0,-r*a,i*o,0,e,n,1)}function iV(t,e,n,r,i,o,a,s){s===void 0&&(s=!1);var l=2*o/(n-e),c=2*o/(r-i),u=(n+e)/(n-e),f=(r+i)/(r-i),d,h;return s?(d=-a/(a-o),h=-a*o/(a-o)):(d=-(a+o)/(a-o),h=-2*a*o/(a-o)),t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=u,t[9]=f,t[10]=d,t[11]=-1,t[12]=0,t[13]=0,t[14]=h,t[15]=0,t}function LA(t){var e=t[0],n=t[1],r=t[3],i=t[4],o=Math.sqrt(e*e+n*n),a=Math.sqrt(r*r+i*i),s=e*i-n*r;s<0&&(e<i?o=-o:a=-a),o&&(e*=1/o,n*=1/o),a&&(r*=1/a,i*=1/a);var l=Math.atan2(n,e),c=Ir(l);return[t[6],t[7],o,a,c]}var ki=Kt(),si=Kt(),Xu=fl(),xt=[Ct(),Ct(),Ct()],NA=Ct();function oV(t,e,n,r,i,o){if(!aV(ki,t)||(qa(si,ki),si[3]=0,si[7]=0,si[11]=0,si[15]=1,Math.abs(OE(si))<1e-8))return!1;var a=ki[3],s=ki[7],l=ki[11],c=ki[12],u=ki[13],f=ki[14],d=ki[15];if(a!==0||s!==0||l!==0){Xu[0]=a,Xu[1]=s,Xu[2]=l,Xu[3]=d;var h=oi(si,si);if(!h)return!1;wE(si,si),dl(i,Xu,si)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=c,e[1]=u,e[2]=f,sV(xt,ki),n[0]=eo(xt[0]),Ka(xt[0],xt[0]),r[0]=Pi(xt[0],xt[1]),i1(xt[1],xt[1],xt[0],1,-r[0]),n[1]=eo(xt[1]),Ka(xt[1],xt[1]),r[0]/=n[1],r[1]=Pi(xt[0],xt[2]),i1(xt[2],xt[2],xt[0],1,-r[1]),r[2]=Pi(xt[1],xt[2]),i1(xt[2],xt[2],xt[1],1,-r[2]),n[2]=eo(xt[2]),Ka(xt[2],xt[2]),r[1]/=n[2],r[2]/=n[2],bh(NA,xt[1],xt[2]),Pi(xt[0],NA)<0)for(var p=0;p<3;p++)n[p]*=-1,xt[p][0]*=-1,xt[p][1]*=-1,xt[p][2]*=-1;return o[0]=.5*Math.sqrt(Math.max(1+xt[0][0]-xt[1][1]-xt[2][2],0)),o[1]=.5*Math.sqrt(Math.max(1-xt[0][0]+xt[1][1]-xt[2][2],0)),o[2]=.5*Math.sqrt(Math.max(1-xt[0][0]-xt[1][1]+xt[2][2],0)),o[3]=.5*Math.sqrt(Math.max(1+xt[0][0]+xt[1][1]+xt[2][2],0)),xt[2][1]>xt[1][2]&&(o[0]=-o[0]),xt[0][2]>xt[2][0]&&(o[1]=-o[1]),xt[1][0]>xt[0][1]&&(o[2]=-o[2]),!0}function aV(t,e){var n=e[15];if(n===0)return!1;for(var r=1/n,i=0;i<16;i++)t[i]=e[i]*r;return!0}function sV(t,e){t[0][0]=e[0],t[0][1]=e[1],t[0][2]=e[2],t[1][0]=e[4],t[1][1]=e[5],t[1][2]=e[6],t[2][0]=e[8],t[2][1]=e[9],t[2][2]=e[10]}function i1(t,e,n,r,i){t[0]=e[0]*r+n[0]*i,t[1]=e[1]*r+n[1]*i,t[2]=e[2]*r+n[2]*i}var Xe=function(){function t(){this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return t.isEmpty=function(e){return!e||e.halfExtents[0]===0&&e.halfExtents[1]===0&&e.halfExtents[2]===0},t.prototype.update=function(e,n){Al(this.center,e),Al(this.halfExtents,n),n1(this.min,this.center,this.halfExtents),up(this.max,this.center,this.halfExtents)},t.prototype.setMinMax=function(e,n){up(this.center,n,e),kA(this.center,this.center,.5),n1(this.halfExtents,n,e),kA(this.halfExtents,this.halfExtents,.5),Al(this.min,e),Al(this.max,n)},t.prototype.getMin=function(){return this.min},t.prototype.getMax=function(){return this.max},t.prototype.add=function(e){if(!t.isEmpty(e)){if(t.isEmpty(this)){this.setMinMax(e.getMin(),e.getMax());return}var n=this.center,r=n[0],i=n[1],o=n[2],a=this.halfExtents,s=a[0],l=a[1],c=a[2],u=r-s,f=r+s,d=i-l,h=i+l,p=o-c,v=o+c,g=e.center,y=g[0],m=g[1],b=g[2],x=e.halfExtents,w=x[0],O=x[1],_=x[2],S=y-w,E=y+w,M=m-O,P=m+O,C=b-_,A=b+_;S<u&&(u=S),E>f&&(f=E),M<d&&(d=M),P>h&&(h=P),C<p&&(p=C),A>v&&(v=A),n[0]=(u+f)*.5,n[1]=(d+h)*.5,n[2]=(p+v)*.5,a[0]=(f-u)*.5,a[1]=(h-d)*.5,a[2]=(v-p)*.5,this.min[0]=u,this.min[1]=d,this.min[2]=p,this.max[0]=f,this.max[1]=h,this.max[2]=v}},t.prototype.setFromTransformedAABB=function(e,n){var r=this.center,i=this.halfExtents,o=e.center,a=e.halfExtents,s=n[0],l=n[4],c=n[8],u=n[1],f=n[5],d=n[9],h=n[2],p=n[6],v=n[10],g=Math.abs(s),y=Math.abs(l),m=Math.abs(c),b=Math.abs(u),x=Math.abs(f),w=Math.abs(d),O=Math.abs(h),_=Math.abs(p),S=Math.abs(v);r[0]=n[12]+s*o[0]+l*o[1]+c*o[2],r[1]=n[13]+u*o[0]+f*o[1]+d*o[2],r[2]=n[14]+h*o[0]+p*o[1]+v*o[2],i[0]=g*a[0]+y*a[1]+m*a[2],i[1]=b*a[0]+x*a[1]+w*a[2],i[2]=O*a[0]+_*a[1]+S*a[2],n1(this.min,r,i),up(this.max,r,i)},t.prototype.intersects=function(e){var n=this.getMax(),r=this.getMin(),i=e.getMax(),o=e.getMin();return r[0]<=i[0]&&n[0]>=o[0]&&r[1]<=i[1]&&n[1]>=o[1]&&r[2]<=i[2]&&n[2]>=o[2]},t.prototype.intersection=function(e){if(!this.intersects(e))return null;var n=new t,r=QU([0,0,0],this.getMin(),e.getMin()),i=JU([0,0,0],this.getMax(),e.getMax());return n.setMinMax(r,i),n},t.prototype.getNegativeFarPoint=function(e){return e.pnVertexFlag===273?Al([0,0,0],this.min):e.pnVertexFlag===272?[this.min[0],this.min[1],this.max[2]]:e.pnVertexFlag===257?[this.min[0],this.max[1],this.min[2]]:e.pnVertexFlag===256?[this.min[0],this.max[1],this.max[2]]:e.pnVertexFlag===17?[this.max[0],this.min[1],this.min[2]]:e.pnVertexFlag===16?[this.max[0],this.min[1],this.max[2]]:e.pnVertexFlag===1?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]},t.prototype.getPositiveFarPoint=function(e){return e.pnVertexFlag===273?Al([0,0,0],this.max):e.pnVertexFlag===272?[this.max[0],this.max[1],this.min[2]]:e.pnVertexFlag===257?[this.max[0],this.min[1],this.max[2]]:e.pnVertexFlag===256?[this.max[0],this.min[1],this.min[2]]:e.pnVertexFlag===17?[this.min[0],this.max[1],this.max[2]]:e.pnVertexFlag===16?[this.min[0],this.max[1],this.min[2]]:e.pnVertexFlag===1?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]},t}(),lV=function(){function t(e,n){this.distance=e||0,this.normal=n||jt(0,1,0),this.updatePNVertexFlag()}return t.prototype.updatePNVertexFlag=function(){this.pnVertexFlag=(+(this.normal[0]>=0)<<8)+(+(this.normal[1]>=0)<<4)+ +(this.normal[2]>=0)},t.prototype.distanceToPoint=function(e){return Pi(e,this.normal)-this.distance},t.prototype.normalize=function(){var e=1/DE(this.normal);Ky(this.normal,this.normal,e),this.distance*=e},t.prototype.intersectsLine=function(e,n,r){var i=this.distanceToPoint(e),o=this.distanceToPoint(n),a=i/(i-o),s=a>=0&&a<=1;return s&&r&&Zy(r,e,n,a),s},t}(),Jo;(function(t){t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE"})(Jo||(Jo={}));var cV=function(){function t(e){if(this.planes=[],e)this.planes=e;else for(var n=0;n<6;n++)this.planes.push(new lV)}return t.prototype.extractFromVPMatrix=function(e){var n=D(e,16),r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],l=n[5],c=n[6],u=n[7],f=n[8],d=n[9],h=n[10],p=n[11],v=n[12],g=n[13],y=n[14],m=n[15];ai(this.planes[0].normal,a-r,u-s,p-f),this.planes[0].distance=m-v,ai(this.planes[1].normal,a+r,u+s,p+f),this.planes[1].distance=m+v,ai(this.planes[2].normal,a+i,u+l,p+d),this.planes[2].distance=m+g,ai(this.planes[3].normal,a-i,u-l,p-d),this.planes[3].distance=m-g,ai(this.planes[4].normal,a-o,u-c,p-h),this.planes[4].distance=m-y,ai(this.planes[5].normal,a+o,u+c,p+h),this.planes[5].distance=m+y,this.planes.forEach(function(b){b.normalize(),b.updatePNVertexFlag()})},t}(),on=function(){function t(e,n){e===void 0&&(e=0),n===void 0&&(n=0),this.x=0,this.y=0,this.x=e,this.y=n}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(e){this.x=e.x,this.y=e.y},t}(),ss=function(){function t(e,n,r,i){this.x=e,this.y=n,this.width=r,this.height=i,this.left=e,this.right=e+r,this.top=n,this.bottom=n+i}return t.prototype.toJSON=function(){},t}(),Jt="Method not implemented.",Tl="Use document.documentElement instead.",uV="Cannot append a destroyed element.",Ht;(function(t){t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING"})(Ht||(Ht={}));var qu;(function(t){t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC"})(qu||(qu={}));var qn;(function(t){t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE"})(qn||(qn={}));var IA={UPDATED:"updated"},jA=2e-4,DA=function(){function t(){this.clipSpaceNearZ=Pl.NEGATIVE_ONE,this.eventEmitter=new Vm,this.matrix=Kt(),this.right=jt(1,0,0),this.up=jt(0,1,0),this.forward=jt(0,0,1),this.position=jt(0,0,1),this.focalPoint=jt(0,0,0),this.distanceVector=jt(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.projectionMatrix=Kt(),this.projectionMatrixInverse=Kt(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=Ht.EXPLORING,this.trackingMode=qu.DEFAULT,this.projectionMode=qn.PERSPECTIVE,this.frustum=new cV,this.orthoMatrix=Kt()}return t.prototype.isOrtho=function(){return this.projectionMode===qn.ORTHOGRAPHIC},t.prototype.getProjectionMode=function(){return this.projectionMode},t.prototype.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},t.prototype.getPerspectiveInverse=function(){return this.projectionMatrixInverse},t.prototype.getFrustum=function(){return this.frustum},t.prototype.getPosition=function(){return this.position},t.prototype.getFocalPoint=function(){return this.focalPoint},t.prototype.getDollyingStep=function(){return this.dollyingStep},t.prototype.getNear=function(){return this.near},t.prototype.getFar=function(){return this.far},t.prototype.getZoom=function(){return this.zoom},t.prototype.getOrthoMatrix=function(){return this.orthoMatrix},t.prototype.getView=function(){return this.view},t.prototype.setEnableUpdate=function(e){this.enableUpdate=e},t.prototype.setType=function(e,n){return this.type=e,this.type===Ht.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===Ht.TRACKING&&n!==void 0&&this.setTrackingMode(n),this},t.prototype.setProjectionMode=function(e){return this.projectionMode=e,this},t.prototype.setTrackingMode=function(e){if(this.type!==Ht.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=e,this},t.prototype.setWorldRotation=function(e){return this.rotateWorld=e,this._getAngles(),this},t.prototype.getViewTransform=function(){return oi(Kt(),this.matrix)},t.prototype.getWorldTransform=function(){return this.matrix},t.prototype.jitterProjectionMatrix=function(e,n){var r=Vy(Kt(),[e,n,0]);this.jitteredProjectionMatrix=On(Kt(),r,this.projectionMatrix)},t.prototype.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},t.prototype.setMatrix=function(e){return this.matrix=e,this._update(),this},t.prototype.setFov=function(e){return this.setPerspective(this.near,this.far,e,this.aspect),this},t.prototype.setAspect=function(e){return this.setPerspective(this.near,this.far,this.fov,e),this},t.prototype.setNear=function(e){return this.projectionMode===qn.PERSPECTIVE?this.setPerspective(e,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,e,this.far),this},t.prototype.setFar=function(e){return this.projectionMode===qn.PERSPECTIVE?this.setPerspective(this.near,e,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,e),this},t.prototype.setViewOffset=function(e,n,r,i,o,a){return this.aspect=e/n,this.view===void 0&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.projectionMode===qn.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},t.prototype.clearViewOffset=function(){return this.view!==void 0&&(this.view.enabled=!1),this.projectionMode===qn.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},t.prototype.setZoom=function(e){return this.zoom=e,this.projectionMode===qn.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===qn.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},t.prototype.setZoomByViewportPoint=function(e,n){var r=this.canvas.viewport2Canvas({x:n[0],y:n[1]}),i=r.x,o=r.y,a=this.roll;this.rotate(0,0,-a),this.setPosition(i,o),this.setFocalPoint(i,o),this.setZoom(e),this.rotate(0,0,a);var s=this.canvas.viewport2Canvas({x:n[0],y:n[1]}),l=s.x,c=s.y,u=jt(l-i,c-o,0),f=Pi(u,this.right)/eo(this.right),d=Pi(u,this.up)/eo(this.up);return this.pan(-f,-d),this},t.prototype.setPerspective=function(e,n,r,i){var o;this.projectionMode=qn.PERSPECTIVE,this.fov=r,this.near=e,this.far=n,this.aspect=i;var a=this.near*Math.tan(Me(.5*this.fov))/this.zoom,s=2*a,l=this.aspect*s,c=-.5*l;if(!((o=this.view)===null||o===void 0)&&o.enabled){var u=this.view.fullWidth,f=this.view.fullHeight;c+=this.view.offsetX*l/u,a-=this.view.offsetY*s/f,l*=this.view.width/u,s*=this.view.height/f}return iV(this.projectionMatrix,c,c+l,a,a-s,e,this.far,this.clipSpaceNearZ===Pl.ZERO),gh(this.projectionMatrix,this.projectionMatrix,jt(1,-1,1)),oi(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},t.prototype.setOrthographic=function(e,n,r,i,o,a){var s;this.projectionMode=qn.ORTHOGRAPHIC,this.rright=n,this.left=e,this.top=r,this.bottom=i,this.near=o,this.far=a;var l=(this.rright-this.left)/(2*this.zoom),c=(this.top-this.bottom)/(2*this.zoom),u=(this.rright+this.left)/2,f=(this.top+this.bottom)/2,d=u-l,h=u+l,p=f+c,v=f-c;if(!((s=this.view)===null||s===void 0)&&s.enabled){var g=(this.rright-this.left)/this.view.fullWidth/this.zoom,y=(this.top-this.bottom)/this.view.fullHeight/this.zoom;d+=g*this.view.offsetX,h=d+g*this.view.width,p-=y*this.view.offsetY,v=p-y*this.view.height}return this.clipSpaceNearZ===Pl.NEGATIVE_ONE?AE(this.projectionMatrix,d,h,v,p,o,a):CE(this.projectionMatrix,d,h,v,p,o,a),gh(this.projectionMatrix,this.projectionMatrix,jt(1,-1,1)),oi(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},t.prototype.setPosition=function(e,n,r){n===void 0&&(n=this.position[1]),r===void 0&&(r=this.position[2]);var i=In(e,n,r);return this._setPosition(i),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},t.prototype.setFocalPoint=function(e,n,r){n===void 0&&(n=this.focalPoint[1]),r===void 0&&(r=this.focalPoint[2]);var i=jt(0,1,0);if(this.focalPoint=In(e,n,r),this.trackingMode===qu.CINEMATIC){var o=NE(Ct(),this.focalPoint,this.position);e=o[0],n=o[1],r=o[2];var a=eo(o),s=Ir(Math.asin(n/a)),l=90+Ir(Math.atan2(r,e)),c=Kt();SE(c,c,Me(l)),_E(c,c,Me(s)),i=Qe(Ct(),[0,1,0],c)}return oi(this.matrix,TE(Kt(),this.position,this.focalPoint,i)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},t.prototype.getDistance=function(){return this.distance},t.prototype.getDistanceVector=function(){return this.distanceVector},t.prototype.setDistance=function(e){if(this.distance===e||e<0)return this;this.distance=e,this.distance<jA&&(this.distance=jA),this.dollyingStep=this.distance/100;var n=Ct();e=this.distance;var r=this.forward,i=this.focalPoint;return n[0]=e*r[0]+i[0],n[1]=e*r[1]+i[1],n[2]=e*r[2]+i[2],this._setPosition(n),this.triggerUpdate(),this},t.prototype.setMaxDistance=function(e){return this.maxDistance=e,this},t.prototype.setMinDistance=function(e){return this.minDistance=e,this},t.prototype.setAzimuth=function(e){return this.azimuth=Cl(e),this.computeMatrix(),this._getAxes(),this.type===Ht.ORBITING||this.type===Ht.EXPLORING?this._getPosition():this.type===Ht.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getAzimuth=function(){return this.azimuth},t.prototype.setElevation=function(e){return this.elevation=Cl(e),this.computeMatrix(),this._getAxes(),this.type===Ht.ORBITING||this.type===Ht.EXPLORING?this._getPosition():this.type===Ht.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getElevation=function(){return this.elevation},t.prototype.setRoll=function(e){return this.roll=Cl(e),this.computeMatrix(),this._getAxes(),this.type===Ht.ORBITING||this.type===Ht.EXPLORING?this._getPosition():this.type===Ht.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getRoll=function(){return this.roll},t.prototype._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},t.prototype.computeMatrix=function(){var e=Wo(Ge(),[0,0,1],Me(this.roll));pu(this.matrix);var n=Wo(Ge(),[1,0,0],Me((this.rotateWorld&&this.type!==Ht.TRACKING||this.type===Ht.TRACKING?1:-1)*this.elevation)),r=Wo(Ge(),[0,1,0],Me((this.rotateWorld&&this.type!==Ht.TRACKING||this.type===Ht.TRACKING?1:-1)*this.azimuth)),i=Go(Ge(),r,n);i=Go(Ge(),i,e);var o=qy(Kt(),i);this.type===Ht.ORBITING||this.type===Ht.EXPLORING?(Yo(this.matrix,this.matrix,this.focalPoint),On(this.matrix,this.matrix,o),Yo(this.matrix,this.matrix,[0,0,this.distance])):this.type===Ht.TRACKING&&(Yo(this.matrix,this.matrix,this.position),On(this.matrix,this.matrix,o))},t.prototype._setPosition=function(e,n,r){this.position=In(e,n,r);var i=this.matrix;i[12]=this.position[0],i[13]=this.position[1],i[14]=this.position[2],i[15]=1,this._getOrthoMatrix()},t.prototype._getAxes=function(){Vn(this.right,In(dl(fl(),[1,0,0,0],this.matrix))),Vn(this.up,In(dl(fl(),[0,1,0,0],this.matrix))),Vn(this.forward,In(dl(fl(),[0,0,1,0],this.matrix))),Ka(this.right,this.right),Ka(this.up,this.up),Ka(this.forward,this.forward)},t.prototype._getAngles=function(){var e=this.distanceVector[0],n=this.distanceVector[1],r=this.distanceVector[2],i=eo(this.distanceVector);if(i===0){this.elevation=0,this.azimuth=0;return}this.type===Ht.TRACKING?(this.elevation=Ir(Math.asin(n/i)),this.azimuth=Ir(Math.atan2(-e,-r))):this.rotateWorld?(this.elevation=Ir(Math.asin(n/i)),this.azimuth=Ir(Math.atan2(-e,-r))):(this.elevation=-Ir(Math.asin(n/i)),this.azimuth=-Ir(Math.atan2(-e,-r)))},t.prototype._getPosition=function(){Vn(this.position,In(dl(fl(),[0,0,0,1],this.matrix))),this._getDistance()},t.prototype._getFocalPoint=function(){IE(this.distanceVector,[0,0,-this.distance],Ez(ll(),this.matrix)),ul(this.focalPoint,this.position,this.distanceVector),this._getDistance()},t.prototype._getDistance=function(){this.distanceVector=NE(Ct(),this.focalPoint,this.position),this.distance=eo(this.distanceVector),this.dollyingStep=this.distance/100},t.prototype._getOrthoMatrix=function(){if(this.projectionMode===qn.ORTHOGRAPHIC){var e=this.position,n=Wo(Ge(),[0,0,1],-this.roll*Math.PI/180);vu(this.orthoMatrix,n,jt((this.rright-this.left)/2-e[0],(this.top-this.bottom)/2-e[1],0),jt(this.zoom,this.zoom,1),e)}},t.prototype.triggerUpdate=function(){if(this.enableUpdate){var e=this.getViewTransform(),n=On(Kt(),this.getPerspective(),e);this.getFrustum().extractFromVPMatrix(n),this.eventEmitter.emit(IA.UPDATED)}},t.prototype.rotate=function(e,n,r){throw new Error(Jt)},t.prototype.pan=function(e,n){throw new Error(Jt)},t.prototype.dolly=function(e){throw new Error(Jt)},t.prototype.createLandmark=function(e,n){throw new Error(Jt)},t.prototype.gotoLandmark=function(e,n){throw new Error(Jt)},t.prototype.cancelLandmarkAnimation=function(){throw new Error(Jt)},t}();function pn(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=t.apply(this,r);return n.cache=a.set(o,s)||a,s};return n.cache=new(pn.Cache||Map),n}pn.Cache=Map;var rt;(function(t){t[t.kUnknown=0]="kUnknown",t[t.kNumber=1]="kNumber",t[t.kPercentage=2]="kPercentage",t[t.kEms=3]="kEms",t[t.kPixels=4]="kPixels",t[t.kRems=5]="kRems",t[t.kDegrees=6]="kDegrees",t[t.kRadians=7]="kRadians",t[t.kGradians=8]="kGradians",t[t.kTurns=9]="kTurns",t[t.kMilliseconds=10]="kMilliseconds",t[t.kSeconds=11]="kSeconds",t[t.kInteger=12]="kInteger"})(rt||(rt={}));var vr;(function(t){t[t.kUNumber=0]="kUNumber",t[t.kUPercent=1]="kUPercent",t[t.kULength=2]="kULength",t[t.kUAngle=3]="kUAngle",t[t.kUTime=4]="kUTime",t[t.kUOther=5]="kUOther"})(vr||(vr={}));var $A;(function(t){t[t.kAll=0]="kAll",t[t.kNonNegative=1]="kNonNegative",t[t.kInteger=2]="kInteger",t[t.kNonNegativeInteger=3]="kNonNegativeInteger",t[t.kPositiveInteger=4]="kPositiveInteger"})($A||($A={}));var o1;(function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"})(o1||(o1={}));var a1;(function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"})(a1||(a1={}));var fV=[{name:"em",unit_type:rt.kEms},{name:"px",unit_type:rt.kPixels},{name:"deg",unit_type:rt.kDegrees},{name:"rad",unit_type:rt.kRadians},{name:"grad",unit_type:rt.kGradians},{name:"ms",unit_type:rt.kMilliseconds},{name:"s",unit_type:rt.kSeconds},{name:"rem",unit_type:rt.kRems},{name:"turn",unit_type:rt.kTurns}],ta;(function(t){t[t.kUnknownType=0]="kUnknownType",t[t.kUnparsedType=1]="kUnparsedType",t[t.kKeywordType=2]="kKeywordType",t[t.kUnitType=3]="kUnitType",t[t.kSumType=4]="kSumType",t[t.kProductType=5]="kProductType",t[t.kNegateType=6]="kNegateType",t[t.kInvertType=7]="kInvertType",t[t.kMinType=8]="kMinType",t[t.kMaxType=9]="kMaxType",t[t.kClampType=10]="kClampType",t[t.kTransformType=11]="kTransformType",t[t.kPositionType=12]="kPositionType",t[t.kURLImageType=13]="kURLImageType",t[t.kColorType=14]="kColorType",t[t.kUnsupportedColorType=15]="kUnsupportedColorType"})(ta||(ta={}));var dV=function(t){return fV.find(function(e){return e.name===t}).unit_type},hV=function(t){return t?t==="number"?rt.kNumber:t==="percent"||t==="%"?rt.kPercentage:dV(t):rt.kUnknown},pV=function(t){switch(t){case rt.kNumber:case rt.kInteger:return vr.kUNumber;case rt.kPercentage:return vr.kUPercent;case rt.kPixels:return vr.kULength;case rt.kMilliseconds:case rt.kSeconds:return vr.kUTime;case rt.kDegrees:case rt.kRadians:case rt.kGradians:case rt.kTurns:return vr.kUAngle;default:return vr.kUOther}},vV=function(t){switch(t){case vr.kUNumber:return rt.kNumber;case vr.kULength:return rt.kPixels;case vr.kUPercent:return rt.kPercentage;case vr.kUTime:return rt.kSeconds;case vr.kUAngle:return rt.kDegrees;default:return rt.kUnknown}},FA=function(t){var e=1;switch(t){case rt.kPixels:case rt.kDegrees:case rt.kSeconds:break;case rt.kMilliseconds:e=.001;break;case rt.kRadians:e=180/Math.PI;break;case rt.kGradians:e=.9;break;case rt.kTurns:e=360;break}return e},s1=function(t){switch(t){case rt.kNumber:case rt.kInteger:return"";case rt.kPercentage:return"%";case rt.kEms:return"em";case rt.kRems:return"rem";case rt.kPixels:return"px";case rt.kDegrees:return"deg";case rt.kRadians:return"rad";case rt.kGradians:return"grad";case rt.kMilliseconds:return"ms";case rt.kSeconds:return"s";case rt.kTurns:return"turn"}return""},fp=function(){function t(){}return t.isAngle=function(e){return e===rt.kDegrees||e===rt.kRadians||e===rt.kGradians||e===rt.kTurns},t.isLength=function(e){return e>=rt.kEms&&e<rt.kDegrees},t.isRelativeUnit=function(e){return e===rt.kPercentage||e===rt.kEms||e===rt.kRems},t.isTime=function(e){return e===rt.kSeconds||e===rt.kMilliseconds},t.prototype.toString=function(){return this.buildCSSText(o1.kNo,a1.kNo,"")},t.prototype.isNumericValue=function(){return this.getType()>=ta.kUnitType&&this.getType()<=ta.kClampType},t}(),gV=function(t){st(e,t);function e(n){var r=t.call(this)||this;return r.colorSpace=n,r}return e.prototype.getType=function(){return ta.kColorType},e.prototype.to=function(n){return this},e}(fp),Li;(function(t){t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient"})(Li||(Li={}));var dp=function(t){st(e,t);function e(n,r){var i=t.call(this)||this;return i.type=n,i.value=r,i}return e.prototype.clone=function(){return new e(this.type,this.value)},e.prototype.buildCSSText=function(n,r,i){return i},e.prototype.getType=function(){return ta.kColorType},e}(fp),Kn=function(t){st(e,t);function e(n){var r=t.call(this)||this;return r.value=n,r}return e.prototype.clone=function(){return new e(this.value)},e.prototype.getType=function(){return ta.kKeywordType},e.prototype.buildCSSText=function(n,r,i){return i+this.value},e}(fp),yV=pn(function(t){return t===void 0&&(t=""),t.replace(/-([a-z])/g,function(e){return e[1].toUpperCase()})}),RA=function(t){return t.split("").map(function(e,n){return e.toUpperCase()===e?"".concat(n!==0?"-":"").concat(e.toLowerCase()):e}).join("")};function mV(t){if(!t)throw new Error}function kl(t){return typeof t=="function"}function bV(t){return typeof t=="symbol"}var xV={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},l1=pn(function(t){var e=yV(t),n=xV[e];return e=(n==null?void 0:n.alias)||e,e}),wV=function(t,e){e===void 0&&(e="");var n="";return Number.isFinite(t)?(mV(Number.isNaN(t)),n="NaN"):t>0?n="infinity":n="-infinity",n+=e},c1=function(t){return vV(pV(t))},te=function(t){st(e,t);function e(n,r){r===void 0&&(r=rt.kNumber);var i=t.call(this)||this,o;return typeof r=="string"?o=hV(r):o=r,i.unit=o,i.value=n,i}return e.prototype.clone=function(){return new e(this.value,this.unit)},e.prototype.equals=function(n){var r=n;return this.value===r.value&&this.unit===r.unit},e.prototype.getType=function(){return ta.kUnitType},e.prototype.convertTo=function(n){if(this.unit===n)return new e(this.value,this.unit);var r=c1(this.unit);if(r!==c1(n)||r===rt.kUnknown)return null;var i=FA(this.unit)/FA(n);return new e(this.value*i,n)},e.prototype.buildCSSText=function(n,r,i){var o;switch(this.unit){case rt.kUnknown:break;case rt.kInteger:o=Number(this.value).toFixed(0);break;case rt.kNumber:case rt.kPercentage:case rt.kEms:case rt.kRems:case rt.kPixels:case rt.kDegrees:case rt.kRadians:case rt.kGradians:case rt.kMilliseconds:case rt.kSeconds:case rt.kTurns:{var a=-999999,s=999999,l=this.value,c=s1(this.unit);if(l<a||l>s){var u=s1(this.unit);!Number.isFinite(l)||Number.isNaN(l)?o=wV(l,u):o=l+(u||"")}else o="".concat(l).concat(c)}}return i+=o,i},e}(fp),Je=new te(0,"px");new te(1,"px");var li=new te(0,"deg"),u1=function(t){st(e,t);function e(n,r,i,o,a){o===void 0&&(o=1),a===void 0&&(a=!1);var s=t.call(this,"rgb")||this;return s.r=n,s.g=r,s.b=i,s.alpha=o,s.isNone=a,s}return e.prototype.clone=function(){return new e(this.r,this.g,this.b,this.alpha)},e.prototype.buildCSSText=function(n,r,i){return i+"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")},e}(gV),ue=new Kn("unset"),OV=new Kn("initial"),_V=new Kn("inherit"),f1={"":ue,unset:ue,initial:OV,inherit:_V},d1=function(t){return f1[t]||(f1[t]=new Kn(t)),f1[t]},h1=new u1(0,0,0,0,!0),BA=new u1(0,0,0,0),SV=pn(function(t,e,n,r){return new u1(t,e,n,r)},function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")}),oe=function(t,e){return e===void 0&&(e=rt.kNumber),new te(t,e)},hp=new te(50,"%"),p1;(function(t){t[t.Standard=0]="Standard"})(p1||(p1={}));var Ll;(function(t){t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED"})(Ll||(Ll={}));var zA={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new ss(0,0,0,0)},at;(function(t){t.COORDINATE="<coordinate>",t.COLOR="<color>",t.PAINT="<paint>",t.NUMBER="<number>",t.ANGLE="<angle>",t.OPACITY_VALUE="<opacity-value>",t.SHADOW_BLUR="<shadow-blur>",t.LENGTH="<length>",t.PERCENTAGE="<percentage>",t.LENGTH_PERCENTAGE="<length> | <percentage>",t.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",t.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",t.LIST_OF_POINTS="<list-of-points>",t.PATH="<path>",t.FILTER="<filter>",t.Z_INDEX="<z-index>",t.OFFSET_DISTANCE="<offset-distance>",t.DEFINED_PATH="<defined-path>",t.MARKER="<marker>",t.TRANSFORM="<transform>",t.TRANSFORM_ORIGIN="<transform-origin>",t.TEXT="<text>",t.TEXT_TRANSFORM="<text-transform>"})(at||(at={}));function EV(t){var e=t.type,n=t.value;return e==="hex"?"#".concat(n):e==="literal"?n:e==="rgb"?"rgb(".concat(n.join(","),")"):"rgba(".concat(n.join(","),")")}var MV=function(){var t={linearGradient:/^(linear\-gradient)/i,repeatingLinearGradient:/^(repeating\-linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,repeatingRadialGradient:/^(repeating\-radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},e="";function n(j){throw new Error(e+": "+j)}function r(){var j=i();return e.length>0&&n("Invalid input not EOF"),j}function i(){return b(o)}function o(){return a("linear-gradient",t.linearGradient,l)||a("repeating-linear-gradient",t.repeatingLinearGradient,l)||a("radial-gradient",t.radialGradient,f)||a("repeating-radial-gradient",t.repeatingRadialGradient,f)||a("conic-gradient",t.conicGradient,f)}function a(j,L,I){return s(L,function($){var F=I();return F&&(k(t.comma)||n("Missing comma before color stops")),{type:j,orientation:F,colorStops:b(x)}})}function s(j,L){var I=k(j);if(I){k(t.startCall)||n("Missing (");var $=L(I);return k(t.endCall)||n("Missing )"),$}}function l(){return c()||u()}function c(){return T("directional",t.sideOrCorner,1)}function u(){return T("angular",t.angleValue,1)}function f(){var j,L=d(),I;return L&&(j=[],j.push(L),I=e,k(t.comma)&&(L=d(),L?j.push(L):e=I)),j}function d(){var j=h()||p();if(j)j.at=g();else{var L=v();if(L){j=L;var I=g();I&&(j.at=I)}else{var $=y();$&&(j={type:"default-radial",at:$})}}return j}function h(){var j=T("shape",/^(circle)/i,0);return j&&(j.style=A()||v()),j}function p(){var j=T("shape",/^(ellipse)/i,0);return j&&(j.style=P()||v()),j}function v(){return T("extent-keyword",t.extentKeywords,1)}function g(){if(T("position",/^at/,0)){var j=y();return j||n("Missing positioning value"),j}}function y(){var j=m();if(j.x||j.y)return{type:"position",value:j}}function m(){return{x:P(),y:P()}}function b(j){var L=j(),I=[];if(L)for(I.push(L);k(t.comma);)L=j(),L?I.push(L):n("One extra comma");return I}function x(){var j=w();return j||n("Expected color definition"),j.length=P(),j}function w(){return _()||E()||S()||O()}function O(){return T("literal",t.literalColor,0)}function _(){return T("hex",t.hexColor,1)}function S(){return s(t.rgbColor,function(){return{type:"rgb",value:b(M)}})}function E(){return s(t.rgbaColor,function(){return{type:"rgba",value:b(M)}})}function M(){return k(t.number)[1]}function P(){return T("%",t.percentageValue,1)||C()||A()}function C(){return T("position-keyword",t.positionKeywords,1)}function A(){return T("px",t.pixelValue,1)||T("em",t.emValue,1)}function T(j,L,I){var $=k(L);if($)return{type:j,value:$[I]}}function k(j){var L=/^[\n\r\t\s]+/.exec(e);L&&N(L[0].length);var I=j.exec(e);return I&&N(I[0].length),I}function N(j){e=e.substring(j)}return function(j){return e=j,r()}}();function PV(t,e,n){var r=Me(n.value),i=0,o=0,a=i+t/2,s=o+e/2,l=Math.abs(t*Math.cos(r))+Math.abs(e*Math.sin(r)),c=a-Math.cos(r)*l/2,u=s-Math.sin(r)*l/2,f=a+Math.cos(r)*l/2,d=s+Math.sin(r)*l/2;return{x1:c,y1:u,x2:f,y2:d}}function AV(t,e,n,r,i){var o=n.value,a=r.value;n.unit===rt.kPercentage&&(o=n.value/100*t),r.unit===rt.kPercentage&&(a=r.value/100*e);var s=Math.max(hr([0,0],[o,a]),hr([0,e],[o,a]),hr([t,e],[o,a]),hr([t,0],[o,a]));return i&&(i instanceof te?s=i.value:i instanceof Kn&&(i.value==="closest-side"?s=Math.min(o,t-o,a,e-a):i.value==="farthest-side"?s=Math.max(o,t-o,a,e-a):i.value==="closest-corner"&&(s=Math.min(hr([0,0],[o,a]),hr([0,e],[o,a]),hr([t,e],[o,a]),hr([t,0],[o,a]))))),{x:o,y:a,r:s}}var CV=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,TV=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,kV=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,YA=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function LV(t){var e,n,r,i=t.length;t[i-1].length=(e=t[i-1].length)!==null&&e!==void 0?e:{type:"%",value:"100"},i>1&&(t[0].length=(n=t[0].length)!==null&&n!==void 0?n:{type:"%",value:"0"});for(var o=0,a=Number(t[0].length.value),s=1;s<i;s++){var l=(r=t[s].length)===null||r===void 0?void 0:r.value;if(!Ot(l)&&!Ot(a)){for(var c=1;c<s-o;c++)t[o+c].length={type:"%",value:"".concat(a+(Number(l)-a)*c/(s-o))};o=s,a=Number(l)}}}var NV={left:180,top:-90,bottom:90,right:0,"left top":225,"top left":225,"left bottom":135,"bottom left":135,"right top":-45,"top right":-45,"right bottom":45,"bottom right":45},IV=pn(function(t){var e;return t.type==="angular"?e=Number(t.value):e=NV[t.value]||0,oe(e,"deg")}),jV=pn(function(t){var e=50,n=50,r="%",i="%";if((t==null?void 0:t.type)==="position"){var o=t.value,a=o.x,s=o.y;(a==null?void 0:a.type)==="position-keyword"&&(a.value==="left"?e=0:a.value==="center"?e=50:a.value==="right"?e=100:a.value==="top"?n=0:a.value==="bottom"&&(n=100)),(s==null?void 0:s.type)==="position-keyword"&&(s.value==="left"?e=0:s.value==="center"?n=50:s.value==="right"?e=100:s.value==="top"?n=0:s.value==="bottom"&&(n=100)),((a==null?void 0:a.type)==="px"||(a==null?void 0:a.type)==="%"||(a==null?void 0:a.type)==="em")&&(r=a==null?void 0:a.type,e=Number(a.value)),((s==null?void 0:s.type)==="px"||(s==null?void 0:s.type)==="%"||(s==null?void 0:s.type)==="em")&&(i=s==null?void 0:s.type,n=Number(s.value))}return{cx:oe(e,r),cy:oe(n,i)}}),DV=pn(function(t){var e;if(t.indexOf("linear")>-1||t.indexOf("radial")>-1){var n=MV(t);return n.map(function(s){var l=s.type,c=s.orientation,u=s.colorStops;LV(u);var f=u.map(function(b){return{offset:oe(Number(b.length.value),"%"),color:EV(b)}});if(l==="linear-gradient")return new dp(Li.LinearGradient,{angle:c?IV(c):li,steps:f});if(l==="radial-gradient"&&(c||(c=[{type:"shape",value:"circle"}]),c[0].type==="shape"&&c[0].value==="circle")){var d=jV(c[0].at),h=d.cx,p=d.cy,v=void 0;if(c[0].style){var g=c[0].style,y=g.type,m=g.value;y==="extent-keyword"?v=d1(m):v=oe(m,y)}return new dp(Li.RadialGradient,{cx:h,cy:p,size:v,steps:f})}})}var r=t[0];if(t[1]==="("||t[2]==="("){if(r==="l"){var i=CV.exec(t);if(i){var o=((e=i[2].match(YA))===null||e===void 0?void 0:e.map(function(s){return s.split(":")}))||[];return[new dp(Li.LinearGradient,{angle:oe(parseFloat(i[1]),"deg"),steps:o.map(function(s){var l=D(s,2),c=l[0],u=l[1];return{offset:oe(Number(c)*100,"%"),color:u}})})]}}else if(r==="r"){var a=$V(t);if(a)if(ao(a))t=a;else return[new dp(Li.RadialGradient,a)]}else if(r==="p")return FV(t)}});function $V(t){var e,n=TV.exec(t);if(n){var r=((e=n[4].match(YA))===null||e===void 0?void 0:e.map(function(i){return i.split(":")}))||[];return{cx:oe(50,"%"),cy:oe(50,"%"),steps:r.map(function(i){var o=D(i,2),a=o[0],s=o[1];return{offset:oe(Number(a)*100,"%"),color:s}})}}return null}function FV(t){var e=kV.exec(t);if(e){var n=e[1],r=e[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;case"n":n="no-repeat";break;default:n="no-repeat"}return{image:r,repetition:n}}return null}function Ku(t){return t&&!!t.image}function pp(t){return t&&!Ot(t.r)&&!Ot(t.g)&&!Ot(t.b)}var lo=pn(function(t){if(Ku(t))return G({repetition:"repeat"},t);if(Ot(t)&&(t=""),t==="transparent")return BA;t==="currentColor"&&(t="black");var e=DV(t);if(e)return e;var n=sp(t),r=[0,0,0,0];return n!==null&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),SV.apply(void 0,Q([],D(r),!1))});function RV(t,e){if(!(!pp(t)||!pp(e)))return[[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],function(n){var r=n.slice();if(r[3])for(var i=0;i<3;i++)r[i]=Math.round(Wu(r[i],0,255));return r[3]=Wu(r[3],0,1),"rgba(".concat(r.join(","),")")}]}function Zu(t,e){if(Ot(e))return oe(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return oe(Number(e),"px");if("deg".search(t)>=0)return oe(Number(e),"deg")}var n=[];e=e.replace(t,function(i){return n.push(i),"U"+i});var r="U("+t.source+")";return n.map(function(i){return oe(Number(e.replace(new RegExp("U"+i,"g"),"").replace(new RegExp(r,"g"),"*0")),i)})[0]}var WA=function(t){return Zu(new RegExp("px","g"),t)},BV=pn(WA),zV=function(t){return Zu(new RegExp("%","g"),t)};pn(zV);var Qu=function(t){return as(t)||isFinite(Number(t))?oe(Number(t)||0,"px"):Zu(new RegExp("px|%|em|rem","g"),t)},Nl=pn(Qu),v1=function(t){return Zu(new RegExp("deg|rad|grad|turn","g"),t)},GA=pn(v1);function YV(t,e,n,r,i){i===void 0&&(i=0);var o="",a=t.value||0,s=e.value||0,l=c1(t.unit),c=t.convertTo(l),u=e.convertTo(l);return c&&u?(a=c.value,s=u.value,o=s1(t.unit)):(te.isLength(t.unit)||te.isLength(e.unit))&&(a=yr(t,i,n),s=yr(e,i,n),o="px"),[a,s,function(f){return r&&(f=Math.max(f,0)),f+o}]}function gr(t){var e=0;return t.unit===rt.kDegrees?e=t.value:t.unit===rt.kRadians?e=Ir(Number(t.value)):t.unit===rt.kTurns&&(e=tV(Number(t.value))),e}function g1(t,e){var n;return Array.isArray(t)?n=t.map(function(r){return Number(r)}):ao(t)?n=t.split(" ").map(function(r){return Number(r)}):as(t)&&(n=[t]),e===2?n.length===1?[n[0],n[0]]:[n[0],n[1]]:n.length===1?[n[0],n[0],n[0],n[0]]:n.length===2?[n[0],n[1],n[0],n[1]]:n.length===3?[n[0],n[1],n[2],n[1]]:[n[0],n[1],n[2],n[3]]}function HA(t){return ao(t)?t.split(" ").map(function(e){return Nl(e)}):t.map(function(e){return Nl(e.toString())})}function yr(t,e,n){if(t.value===0)return 0;if(t.unit===rt.kPixels)return Number(t.value);if(t.unit===rt.kPercentage&&n){var r=n.nodeName===H.GROUP?n.getLocalBounds():n.geometry.contentBounds;return t.value/100*r.halfExtents[e]*2}return 0}var WV=function(t){return Zu(/deg|rad|grad|turn|px|%/g,t)},GV=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function UA(t){if(t===void 0&&(t=""),t=t.toLowerCase().trim(),t==="none")return[];for(var e=/\s*([\w-]+)\(([^)]*)\)/g,n=[],r,i=0;r=e.exec(t);){if(r.index!==i)return[];if(i=r.index+r[0].length,GV.indexOf(r[1])>-1&&n.push({name:r[1],params:r[2].split(" ").map(function(o){return WV(o)||lo(o)})}),e.lastIndex===t.length)return n}return[]}function VA(t){return t.toString()}var Il=function(t){return typeof t=="number"?oe(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?oe(Number(t)):oe(0)},ls=pn(Il);pn(function(t){return ao(t)?t.split(" ").map(ls):t.map(ls)});function y1(t,e){return[t,e,VA]}function m1(t,e){return function(n,r){return[n,r,function(i){return VA(Wu(i,t,e))}]}}function XA(t,e){if(t.length===e.length)return[t,e,function(n){return n}]}function b1(t){return t.parsedStyle.path.totalLength===0&&(t.parsedStyle.path.totalLength=gU(t.parsedStyle.path.absolutePath)),t.parsedStyle.path.totalLength}function HV(t){for(var e=0;e<t.length;e++){var n=t[e-1],r=t[e],i=r[0];if(i==="M"&&n){var o=n[0],a=[r[1],r[2]],s=void 0;o==="L"||o==="M"?s=[n[1],n[2]]:(o==="C"||o==="A"||o==="Q")&&(s=[n[n.length-2],n[n.length-1]]),s&&vp(a,s)&&(t.splice(e,1),e--)}}}function UV(t){for(var e=!1,n=t.length,r=0;r<n;r++){var i=t[r],o=i[0];if(o==="C"||o==="A"||o==="Q"){e=!0;break}}return e}function VV(t){for(var e=[],n=[],r=[],i=0;i<t.length;i++){var o=t[i],a=o[0];a==="M"?(r.length&&(n.push(r),r=[]),r.push([o[1],o[2]])):a==="Z"?r.length&&(e.push(r),r=[]):r.push([o[1],o[2]])}return r.length>0&&n.push(r),{polygons:e,polylines:n}}function vp(t,e){return t[0]===e[0]&&t[1]===e[1]}function XV(t,e){for(var n=[],r=[],i=[],o=0;o<t.length;o++){var a=t[o],s=a.currentPoint,l=a.params,c=a.prePoint,u=void 0;switch(a.command){case"Q":u=UU(c[0],c[1],l[1],l[2],l[3],l[4]);break;case"C":u=YU(c[0],c[1],l[1],l[2],l[3],l[4],l[5],l[6]);break;case"A":var f=a.arcParams;u=RU(f.cx,f.cy,f.rx,f.ry,f.xRotation,f.startAngle,f.endAngle);break;default:n.push(s[0]),r.push(s[1]);break}u&&(a.box=u,n.push(u.x,u.x+u.width),r.push(u.y,u.y+u.height)),e&&(a.command==="L"||a.command==="M")&&a.prePoint&&a.nextPoint&&i.push(a)}n=n.filter(function(y){return!Number.isNaN(y)&&y!==1/0&&y!==-1/0}),r=r.filter(function(y){return!Number.isNaN(y)&&y!==1/0&&y!==-1/0});var d=QP(n),h=QP(r),p=ZP(n),v=ZP(r);if(i.length===0)return{x:d,y:h,width:p-d,height:v-h};for(var o=0;o<i.length;o++){var a=i[o],s=a.currentPoint,g=void 0;s[0]===d?(g=gp(a,e),d=d-g.xExtra):s[0]===p&&(g=gp(a,e),p=p+g.xExtra),s[1]===h?(g=gp(a,e),h=h-g.yExtra):s[1]===v&&(g=gp(a,e),v=v+g.yExtra)}return{x:d,y:h,width:p-d,height:v-h}}function gp(t,e){var n=t.prePoint,r=t.currentPoint,i=t.nextPoint,o=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),a=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2),l=Math.acos((o+a-s)/(2*Math.sqrt(o)*Math.sqrt(a)));if(!l||Math.sin(l)===0||GH(l,0))return{xExtra:0,yExtra:0};var c=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),u=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));c=c>Math.PI/2?Math.PI-c:c,u=u>Math.PI/2?Math.PI-u:u;var f={xExtra:Math.cos(l/2-c)*(e/2*(1/Math.sin(l/2)))-e/2||0,yExtra:Math.cos(u-l/2)*(e/2*(1/Math.sin(l/2)))-e/2||0};return f}function qA(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}var KA=function(t,e){var n=t.x*e.x+t.y*e.y,r=Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2))),i=t.x*e.y-t.y*e.x<0?-1:1,o=i*Math.acos(n/r);return o},ZA=function(t,e,n,r,i,o,a,s){e=Math.abs(e),n=Math.abs(n),r=JP(r,360);var l=Me(r);if(t.x===a.x&&t.y===a.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(e===0||n===0)return{x:0,y:0,ellipticalArcAngle:0};var c=(t.x-a.x)/2,u=(t.y-a.y)/2,f={x:Math.cos(l)*c+Math.sin(l)*u,y:-Math.sin(l)*c+Math.cos(l)*u},d=Math.pow(f.x,2)/Math.pow(e,2)+Math.pow(f.y,2)/Math.pow(n,2);d>1&&(e=Math.sqrt(d)*e,n=Math.sqrt(d)*n);var h=Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(f.y,2)-Math.pow(n,2)*Math.pow(f.x,2),p=Math.pow(e,2)*Math.pow(f.y,2)+Math.pow(n,2)*Math.pow(f.x,2),v=h/p;v=v<0?0:v;var g=(i!==o?1:-1)*Math.sqrt(v),y={x:g*(e*f.y/n),y:g*(-(n*f.x)/e)},m={x:Math.cos(l)*y.x-Math.sin(l)*y.y+(t.x+a.x)/2,y:Math.sin(l)*y.x+Math.cos(l)*y.y+(t.y+a.y)/2},b={x:(f.x-y.x)/e,y:(f.y-y.y)/n},x=KA({x:1,y:0},b),w={x:(-f.x-y.x)/e,y:(-f.y-y.y)/n},O=KA(b,w);!o&&O>0?O-=2*Math.PI:o&&O<0&&(O+=2*Math.PI),O%=2*Math.PI;var _=x+O*s,S=e*Math.cos(_),E=n*Math.sin(_),M={x:Math.cos(l)*S-Math.sin(l)*E+m.x,y:Math.sin(l)*S+Math.cos(l)*E+m.y,ellipticalArcStartAngle:x,ellipticalArcEndAngle:x+O,ellipticalArcAngle:_,ellipticalArcCenter:m,resultantRx:e,resultantRy:n};return M};function qV(t){for(var e=[],n=null,r=null,i=null,o=0,a=t.length,s=0;s<a;s++){var l=t[s];r=t[s+1];var c=l[0],u={command:c,prePoint:n,params:l,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(c){case"M":i=[l[1],l[2]],o=s;break;case"A":var f=KV(n,l);u.arcParams=f;break}if(c==="Z")n=i,r=t[o+1];else{var d=l.length;n=[l[d-2],l[d-1]]}r&&r[0]==="Z"&&(r=t[o],e[o]&&(e[o].prePoint=n)),u.currentPoint=n,e[o]&&vp(n,e[o].currentPoint)&&(e[o].prePoint=u.prePoint);var h=r?[r[r.length-2],r[r.length-1]]:null;u.nextPoint=h;var p=u.prePoint;if(["L","H","V"].includes(c))u.startTangent=[p[0]-n[0],p[1]-n[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]];else if(c==="Q"){var v=[l[1],l[2]];u.startTangent=[p[0]-v[0],p[1]-v[1]],u.endTangent=[n[0]-v[0],n[1]-v[1]]}else if(c==="T"){var g=e[s-1],v=qA(g.currentPoint,p);g.command==="Q"?(u.command="Q",u.startTangent=[p[0]-v[0],p[1]-v[1]],u.endTangent=[n[0]-v[0],n[1]-v[1]]):(u.command="TL",u.startTangent=[p[0]-n[0],p[1]-n[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]])}else if(c==="C"){var y=[l[1],l[2]],m=[l[3],l[4]];u.startTangent=[p[0]-y[0],p[1]-y[1]],u.endTangent=[n[0]-m[0],n[1]-m[1]],u.startTangent[0]===0&&u.startTangent[1]===0&&(u.startTangent=[y[0]-m[0],y[1]-m[1]]),u.endTangent[0]===0&&u.endTangent[1]===0&&(u.endTangent=[m[0]-y[0],m[1]-y[1]])}else if(c==="S"){var g=e[s-1],y=qA(g.currentPoint,p),m=[l[1],l[2]];g.command==="C"?(u.command="C",u.startTangent=[p[0]-y[0],p[1]-y[1]],u.endTangent=[n[0]-m[0],n[1]-m[1]]):(u.command="SQ",u.startTangent=[p[0]-m[0],p[1]-m[1]],u.endTangent=[n[0]-m[0],n[1]-m[1]])}else if(c==="A"){var b=QA(u,0),x=b.x,w=b.y,O=QA(u,1,!1),_=O.x,S=O.y;u.startTangent=[x,w],u.endTangent=[_,S]}e.push(u)}return e}function QA(t,e,n){n===void 0&&(n=!0);var r=t.arcParams,i=r.rx,o=i===void 0?0:i,a=r.ry,s=a===void 0?0:a,l=r.xRotation,c=r.arcFlag,u=r.sweepFlag,f=ZA({x:t.prePoint[0],y:t.prePoint[1]},o,s,l,!!c,!!u,{x:t.currentPoint[0],y:t.currentPoint[1]},e),d=ZA({x:t.prePoint[0],y:t.prePoint[1]},o,s,l,!!c,!!u,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),h=d.x-f.x,p=d.y-f.y,v=Math.sqrt(h*h+p*p);return{x:-h/v,y:-p/v}}function yp(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function x1(t,e){return yp(t)*yp(e)?(t[0]*e[0]+t[1]*e[1])/(yp(t)*yp(e)):1}function JA(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(x1(t,e))}function KV(t,e){var n=e[1],r=e[2],i=JP(Me(e[3]),Math.PI*2),o=e[4],a=e[5],s=t[0],l=t[1],c=e[6],u=e[7],f=Math.cos(i)*(s-c)/2+Math.sin(i)*(l-u)/2,d=-1*Math.sin(i)*(s-c)/2+Math.cos(i)*(l-u)/2,h=f*f/(n*n)+d*d/(r*r);h>1&&(n*=Math.sqrt(h),r*=Math.sqrt(h));var p=n*n*(d*d)+r*r*(f*f),v=p?Math.sqrt((n*n*(r*r)-p)/p):1;o===a&&(v*=-1),isNaN(v)&&(v=0);var g=r?v*n*d/r:0,y=n?v*-r*f/n:0,m=(s+c)/2+Math.cos(i)*g-Math.sin(i)*y,b=(l+u)/2+Math.sin(i)*g+Math.cos(i)*y,x=[(f-g)/n,(d-y)/r],w=[(-1*f-g)/n,(-1*d-y)/r],O=JA([1,0],x),_=JA(x,w);return x1(x,w)<=-1&&(_=Math.PI),x1(x,w)>=1&&(_=0),a===0&&_>0&&(_=_-2*Math.PI),a===1&&_<0&&(_=_+2*Math.PI),{cx:m,cy:b,rx:vp(t,[c,u])?0:n,ry:vp(t,[c,u])?0:r,startAngle:O,endAngle:O+_,xRotation:i,arcFlag:o,sweepFlag:a}}function ZV(t,e,n){var r=e.parsedStyle,i=r.defX,o=i===void 0?0:i,a=r.defY,s=a===void 0?0:a;return t.reduce(function(l,c){var u="";if(c[0]==="M"||c[0]==="L"){var f=jt(c[1]-o,c[2]-s,0);n&&Qe(f,f,n),u="".concat(c[0]).concat(f[0],",").concat(f[1])}else if(c[0]==="Z")u=c[0];else if(c[0]==="C"){var d=jt(c[1]-o,c[2]-s,0),h=jt(c[3]-o,c[4]-s,0),p=jt(c[5]-o,c[6]-s,0);n&&(Qe(d,d,n),Qe(h,h,n),Qe(p,p,n)),u="".concat(c[0]).concat(d[0],",").concat(d[1],",").concat(h[0],",").concat(h[1],",").concat(p[0],",").concat(p[1])}else if(c[0]==="A"){var v=jt(c[6]-o,c[7]-s,0);n&&Qe(v,v,n),u="".concat(c[0]).concat(c[1],",").concat(c[2],",").concat(c[3],",").concat(c[4],",").concat(c[5],",").concat(v[0],",").concat(v[1])}else if(c[0]==="Q"){var d=jt(c[1]-o,c[2]-s,0),h=jt(c[3]-o,c[4]-s,0);n&&(Qe(d,d,n),Qe(h,h,n)),u="".concat(c[0]).concat(c[1],",").concat(c[2],",").concat(c[3],",").concat(c[4],"}")}return l+=u},"")}function QV(t,e,n,r){return[["M",t,e],["L",n,r]]}function tC(t,e,n,r){var i=(-1+Math.sqrt(2))/3*4,o=t*i,a=e*i,s=n-t,l=n+t,c=r-e,u=r+e;return[["M",s,r],["C",s,r-a,n-o,c,n,c],["C",n+o,c,l,r-a,l,r],["C",l,r+a,n+o,u,n,u],["C",n-o,u,s,r+a,s,r],["Z"]]}function JV(t,e){var n=t.map(function(r,i){return[i===0?"M":"L",r[0],r[1]]});return e&&n.push(["Z"]),n}function tX(t,e,n,r,i){if(i){var o=D(i,4),a=o[0],s=o[1],l=o[2],c=o[3],u=t>0?1:-1,f=e>0?1:-1,d=u+f!==0?1:0;return[["M",u*a+n,r],["L",t-u*s+n,r],s?["A",s,s,0,0,d,t+n,f*s+r]:null,["L",t+n,e-f*l+r],l?["A",l,l,0,0,d,t+n-u*l,e+r]:null,["L",n+u*c,e+r],c?["A",c,c,0,0,d,n,e+r-f*c]:null,["L",n,f*a+r],a?["A",a,a,0,0,d,u*a+n,r]:null,["Z"]].filter(function(h){return h})}return[["M",n,r],["L",n+t,r],["L",n+t,r+e],["L",n,r+e],["Z"]]}function w1(t,e){e===void 0&&(e=t.getLocalTransform());var n=[];switch(t.nodeName){case H.LINE:var r=t.parsedStyle,i=r.x1,o=i===void 0?0:i,a=r.y1,s=a===void 0?0:a,l=r.x2,c=l===void 0?0:l,u=r.y2,f=u===void 0?0:u;n=QV(o,s,c,f);break;case H.CIRCLE:{var d=t.parsedStyle,h=d.r,p=h===void 0?0:h,v=d.cx,g=v===void 0?0:v,y=d.cy,m=y===void 0?0:y;n=tC(p,p,g,m);break}case H.ELLIPSE:{var b=t.parsedStyle,x=b.rx,w=x===void 0?0:x,O=b.ry,_=O===void 0?0:O,S=b.cx,g=S===void 0?0:S,E=b.cy,m=E===void 0?0:E;n=tC(w,_,g,m);break}case H.POLYLINE:case H.POLYGON:var M=t.parsedStyle.points;n=JV(M.points,t.nodeName===H.POLYGON);break;case H.RECT:var P=t.parsedStyle,C=P.width,A=C===void 0?0:C,T=P.height,k=T===void 0?0:T,N=P.x,j=N===void 0?0:N,L=P.y,I=L===void 0?0:L,$=P.radius,F=$&&$.some(function(B){return B!==0});n=tX(A,k,j,I,F&&$.map(function(B){return Wu(B,0,Math.min(Math.abs(A)/2,Math.abs(k)/2))}));break;case H.PATH:var R=t.parsedStyle.path.absolutePath;n=Q([],D(R),!1);break}if(n.length)return ZV(n,t,e)}var eC=function(t){if(t===""||Array.isArray(t)&&t.length===0)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var e;try{e=ip(t)}catch(d){e=ip(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}HV(e);var n=UV(e),r=VV(e),i=r.polygons,o=r.polylines,a=qV(e),s=XV(a,0),l=s.x,c=s.y,u=s.width,f=s.height;return{absolutePath:e,hasArc:n,segments:a,polygons:i,polylines:o,totalLength:0,rect:{x:Number.isFinite(l)?l:0,y:Number.isFinite(c)?c:0,width:Number.isFinite(u)?u:0,height:Number.isFinite(f)?f:0}}},eX=pn(eC);function O1(t){return ao(t)?eX(t):eC(t)}function nX(t,e,n){var r=t.curve,i=e.curve;(!r||r.length===0)&&(r=qm(t.absolutePath,!1),t.curve=r),(!i||i.length===0)&&(i=qm(e.absolutePath,!1),e.curve=i);var o=[r,i];r.length!==i.length&&(o=hA(r,i));var a=fA(o[0])!==fA(o[1])?uU(o[0]):cU(o[0]);return[a,mU(o[1],a),function(s){return s}]}function nC(t,e){var n;ao(t)?n=t.split(" ").map(function(u){var f=D(u.split(","),2),d=f[0],h=f[1];return[Number(d),Number(h)]}):n=t;var r=[],i=0,o,a,s=HU(n);n.forEach(function(u,f){n[f+1]&&(o=[0,0],o[0]=i/s,a=EA(u[0],u[1],n[f+1][0],n[f+1][1]),i+=a,o[1]=i/s,r.push(o))});var l=Math.min.apply(Math,Q([],D(n.map(function(u){return u[0]})),!1)),c=Math.min.apply(Math,Q([],D(n.map(function(u){return u[1]})),!1));return e&&(e.parsedStyle.defX=l,e.parsedStyle.defY=c),{points:n,totalLength:s,segments:r}}function rX(t,e){return[t.points,e.points,function(n){return n}]}var Ne=null;function Zn(t){return function(e){var n=0;return t.map(function(r){return r===Ne?e[n++]:r})}}function cs(t){return t}var mp={matrix:["NNNNNN",[Ne,Ne,0,0,Ne,Ne,0,0,0,0,1,0,Ne,Ne,0,1],cs],matrix3d:["NNNNNNNNNNNNNNNN",cs],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Zn([Ne,Ne,new te(1)]),cs],scalex:["N",Zn([Ne,new te(1),new te(1)]),Zn([Ne,new te(1)])],scaley:["N",Zn([new te(1),Ne,new te(1)]),Zn([new te(1),Ne])],scalez:["N",Zn([new te(1),new te(1),Ne])],scale3d:["NNN",cs],skew:["Aa",null,cs],skewx:["A",null,Zn([Ne,li])],skewy:["A",null,Zn([li,Ne])],translate:["Tt",Zn([Ne,Ne,Je]),cs],translatex:["T",Zn([Ne,Je,Je]),Zn([Ne,Je])],translatey:["T",Zn([Je,Ne,Je]),Zn([Je,Ne])],translatez:["L",Zn([Je,Je,Ne])],translate3d:["TTL",cs]};function _1(t){if(t=(t||"none").toLowerCase().trim(),t==="none")return[];for(var e=/\s*(\w+)\(([^)]*)\)/g,n=[],r,i=0;r=e.exec(t);){if(r.index!==i)return[];i=r.index+r[0].length;var o=r[1],a=mp[o];if(!a)return[];var s=r[2].split(","),l=a[0];if(l.length<s.length)return[];for(var c=[],u=0;u<l.length;u++){var f=s[u],d=l[u],h=void 0;if(f?h={A:function(p){return p.trim()==="0"?li:GA(p)},N:ls,T:Nl,L:BV}[d.toUpperCase()](f):h={a:li,n:c[0],t:Je}[d],h===void 0)return[];c.push(h)}if(n.push({t:o,d:c}),e.lastIndex===t.length)return n}return[]}function rC(t){if(t=(t||"none").toLowerCase().trim(),t==="none")return[];for(var e=/\s*(\w+)\(([^)]*)\)/g,n=[],r,i=0;r=e.exec(t);){if(r.index!==i)return[];i=r.index+r[0].length;var o=r[1],a=mp[o];if(!a)return[];var s=r[2].split(","),l=a[0];if(l.length<s.length)return[];for(var c=[],u=0;u<l.length;u++){var f=s[u],d=l[u],h=void 0;if(f?h={A:function(p){return p.trim()==="0"?li:v1(p)},N:Il,T:Qu,L:WA}[d.toUpperCase()](f):h={a:li,n:c[0],t:Je}[d],h===void 0)return[];c.push(h)}if(n.push({t:o,d:c}),e.lastIndex===t.length)return n}return[]}function iX(t){var e,n,r,i;switch(t.t){case"rotatex":return i=Me(gr(t.d[0])),[1,0,0,0,0,Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1];case"rotatey":return i=Me(gr(t.d[0])),[Math.cos(i),0,-Math.sin(i),0,0,1,0,0,Math.sin(i),0,Math.cos(i),0,0,0,0,1];case"rotate":case"rotatez":return i=Me(gr(t.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":e=t.d[0].value,n=t.d[1].value,r=t.d[2].value,i=Me(gr(t.d[3]));var o=e*e+n*n+r*r;if(o===0)e=1,n=0,r=0;else if(o!==1){var a=Math.sqrt(o);e/=a,n/=a,r/=a}var s=Math.sin(i/2),l=s*Math.cos(i/2),c=s*s;return[1-2*(n*n+r*r)*c,2*(e*n*c+r*l),2*(e*r*c-n*l),0,2*(e*n*c-r*l),1-2*(e*e+r*r)*c,2*(n*r*c+e*l),0,2*(e*r*c+n*l),2*(n*r*c-e*l),1-2*(e*e+n*n)*c,0,0,0,0,1];case"scale":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scalex":return[t.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaley":return[1,0,0,0,0,t.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scalez":return[1,0,0,0,0,1,0,0,0,0,t.d[0].value,0,0,0,0,1];case"scale3d":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,t.d[2].value,0,0,0,0,1];case"skew":var u=Me(gr(t.d[0])),f=Me(gr(t.d[1]));return[1,Math.tan(f),0,0,Math.tan(u),1,0,0,0,0,1,0,0,0,0,1];case"skewx":return i=Me(gr(t.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewy":return i=Me(gr(t.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return e=yr(t.d[0],0,null)||0,n=yr(t.d[1],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,e,n,0,1];case"translatex":return e=yr(t.d[0],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,e,0,0,1];case"translatey":return n=yr(t.d[0],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,0,n,0,1];case"translatez":return r=yr(t.d[0],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,r,1];case"translate3d":return e=yr(t.d[0],0,null)||0,n=yr(t.d[1],0,null)||0,r=yr(t.d[2],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,e,n,r,1];case"perspective":var d=yr(t.d[0],0,null)||0,h=d?-1/d:0;return[1,0,0,0,0,1,0,0,0,0,1,h,0,0,0,1];case"matrix":return[t.d[0].value,t.d[1].value,0,0,t.d[2].value,t.d[3].value,0,0,0,0,1,0,t.d[4].value,t.d[5].value,0,1];case"matrix3d":return t.d.map(function(p){return p.value})}}function oX(t,e){return[t[0]*e[0]+t[4]*e[1]+t[8]*e[2]+t[12]*e[3],t[1]*e[0]+t[5]*e[1]+t[9]*e[2]+t[13]*e[3],t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]*e[3],t[3]*e[0]+t[7]*e[1]+t[11]*e[2]+t[15]*e[3],t[0]*e[4]+t[4]*e[5]+t[8]*e[6]+t[12]*e[7],t[1]*e[4]+t[5]*e[5]+t[9]*e[6]+t[13]*e[7],t[2]*e[4]+t[6]*e[5]+t[10]*e[6]+t[14]*e[7],t[3]*e[4]+t[7]*e[5]+t[11]*e[6]+t[15]*e[7],t[0]*e[8]+t[4]*e[9]+t[8]*e[10]+t[12]*e[11],t[1]*e[8]+t[5]*e[9]+t[9]*e[10]+t[13]*e[11],t[2]*e[8]+t[6]*e[9]+t[10]*e[10]+t[14]*e[11],t[3]*e[8]+t[7]*e[9]+t[11]*e[10]+t[15]*e[11],t[0]*e[12]+t[4]*e[13]+t[8]*e[14]+t[12]*e[15],t[1]*e[12]+t[5]*e[13]+t[9]*e[14]+t[13]*e[15],t[2]*e[12]+t[6]*e[13]+t[10]*e[14]+t[14]*e[15],t[3]*e[12]+t[7]*e[13]+t[11]*e[14]+t[15]*e[15]]}function aX(t){return t.length===0?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(iX).reduce(oX)}function iC(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],o=[0,0,0,1];return oV(aX(t),e,n,r,i,o),[[e,n,r,o,i]]}var sX=function(){function t(r,i){for(var o=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],a=0;a<4;a++)for(var s=0;s<4;s++)for(var l=0;l<4;l++)o[a][s]+=i[a][l]*r[l][s];return o}function e(r){return r[0][2]==0&&r[0][3]==0&&r[1][2]==0&&r[1][3]==0&&r[2][0]==0&&r[2][1]==0&&r[2][2]==1&&r[2][3]==0&&r[3][2]==0&&r[3][3]==1}function n(r,i,o,a,s){for(var l=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],c=0;c<4;c++)l[c][3]=s[c];for(var c=0;c<3;c++)for(var u=0;u<3;u++)l[3][c]+=r[u]*l[u][c];var f=a[0],d=a[1],h=a[2],p=a[3],v=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];v[0][0]=1-2*(d*d+h*h),v[0][1]=2*(f*d-h*p),v[0][2]=2*(f*h+d*p),v[1][0]=2*(f*d+h*p),v[1][1]=1-2*(f*f+h*h),v[1][2]=2*(d*h-f*p),v[2][0]=2*(f*h-d*p),v[2][1]=2*(d*h+f*p),v[2][2]=1-2*(f*f+d*d),l=t(l,v);var g=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];o[2]&&(g[2][1]=o[2],l=t(l,g)),o[1]&&(g[2][1]=0,g[2][0]=o[0],l=t(l,g)),o[0]&&(g[2][0]=0,g[1][0]=o[0],l=t(l,g));for(var c=0;c<3;c++)for(var u=0;u<3;u++)l[c][u]*=i[c];return e(l)?[l[0][0],l[0][1],l[1][0],l[1][1],l[3][0],l[3][1]]:l[0].concat(l[1],l[2],l[3])}return n}();function lX(t){return t.toFixed(6).replace(".000000","")}function S1(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=iC(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=iC(e)),n[0]===null||r[0]===null?[[!1],[!0],function(i){return i?e[0].d:t[0].d}]:(n[0].push(0),r[0].push(1),[n,r,function(i){var o=uX(n[0][3],r[0][3],i[5]),a=sX(i[0],i[1],i[2],o,i[4]),s=a.map(lX).join(",");return s}])}function cX(t,e){for(var n=0,r=0;r<t.length;r++)n+=t[r]*e[r];return n}function uX(t,e,n){var r=cX(t,e);r=Wu(r,-1,1);var i=[];if(r===1)i=t;else for(var o=Math.acos(r),a=Math.sin(n*o)*1/Math.sqrt(1-r*r),s=0;s<4;s++)i.push(t[s]*(Math.cos(n*o)-r*a)+e[s]*a);return i}function E1(t){return t.replace(/[xy]/,"")}function M1(t){return t.replace(/(x|y|z|3d)?$/,"3d")}var fX=function(t,e){return t==="perspective"&&e==="perspective"||(t==="matrix"||t==="matrix3d")&&(e==="matrix"||e==="matrix3d")};function dX(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(O){var _=t[O],S=_.t,E=_.d,M=S.substring(0,5)==="scale"?1:0;e.push({t:S,d:E.map(function(P){return typeof P=="number"?oe(M):oe(M,P.unit)})})},o=0;o<t.length;o++)i(o)}var a=[],s=[],l=[];if(t.length!==e.length){var c=S1(t,e);a=[c[0]],s=[c[1]],l=[["matrix",[c[2]]]]}else for(var o=0;o<t.length;o++){var u=t[o].t,f=e[o].t,d=t[o].d,h=e[o].d,p=mp[u],v=mp[f],g=void 0;if(fX(u,f)){var c=S1([t[o]],[e[o]]);a.push(c[0]),s.push(c[1]),l.push(["matrix",[c[2]]]);continue}else if(u===f)g=u;else if(p[2]&&v[2]&&E1(u)===E1(f))g=E1(u),d=p[2](d),h=v[2](h);else if(p[1]&&v[1]&&M1(u)===M1(f))g=M1(u),d=p[1](d),h=v[1](h);else{var c=S1(t,e);a=[c[0]],s=[c[1]],l=[["matrix",[c[2]]]];break}for(var y=[],m=[],b=[],x=0;x<d.length;x++){var c=YV(d[x],h[x],n,!1,x);y[x]=c[0],m[x]=c[1],b.push(c[2])}a.push(y),s.push(m),l.push([g,b])}if(r){var w=a;a=s,s=w}return[a,s,function(O){return O.map(function(_,S){var E=_.map(function(M,P){return l[S][1][P](M)}).join(",");return l[S][0]==="matrix"&&E.split(",").length===16&&(l[S][0]="matrix3d"),l[S][0]==="matrix3d"&&E.split(",").length===6&&(l[S][0]="matrix"),l[S][0]+"("+E+")"}).join(" ")}]}var oC=pn(function(t){if(ao(t)){if(t==="text-anchor")return[oe(0,"px"),oe(0,"px")];var e=t.split(" ");return e.length===1&&(e[0]==="top"||e[0]==="bottom"?(e[1]=e[0],e[0]="center"):e[1]="center"),e.length!==2?null:[Nl(bp(e[0])),Nl(bp(e[1]))]}else return[oe(t[0]||0,"px"),oe(t[1]||0,"px")]}),hX=function(t){if(ao(t)){if(t==="text-anchor")return[oe(0,"px"),oe(0,"px")];var e=t.split(" ");return e.length===1&&(e[0]==="top"||e[0]==="bottom"?(e[1]=e[0],e[0]="center"):e[1]="center"),e.length!==2?null:[Qu(bp(e[0])),Qu(bp(e[1]))]}else return[oe(t[0]||0,"px"),oe(t[1]||0,"px")]};function bp(t){return t==="center"?"50%":t==="left"||t==="top"?"0":t==="right"||t==="bottom"?"100%":t}var P1=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:at.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:at.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:at.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:at.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:at.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:at.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:at.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:at.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:at.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:at.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:at.LENGTH_PERCENTAGE},{n:"lineJoin",inh:!0,l:!0,a:["strokeLinejoin"],k:["miter","bevel","round"],d:"miter"},{n:"lineCap",inh:!0,l:!0,a:["strokeLinecap"],k:["butt","round","square"],d:"butt"},{n:"lineDash",int:!0,inh:!0,k:["none"],a:["strokeDasharray"],syntax:at.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:at.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:at.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:at.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:at.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:at.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:at.Z_INDEX},{n:"visibility",k:["visible","hidden"],ind:!0,inh:!0,int:!0,d:"visible"},{n:"pointerEvents",inh:!0,k:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","all"],d:"auto"},{n:"filter",ind:!0,l:!0,k:["none"],d:"none",syntax:at.FILTER},{n:"clipPath",syntax:at.DEFINED_PATH},{n:"textPath",syntax:at.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:at.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:at.TRANSFORM},{n:"transformOrigin",p:100,d:function(t){return t===H.CIRCLE||t===H.ELLIPSE?"center":t===H.TEXT?"text-anchor":"left top"},l:!0,syntax:at.TRANSFORM_ORIGIN},{n:"anchor",p:99,d:function(t){return t===H.CIRCLE||t===H.ELLIPSE?"0.5 0.5":"0 0"},l:!0,syntax:at.LENGTH_PERCENTAGE_12},{n:"cx",int:!0,d:"0",syntax:at.COORDINATE},{n:"cy",int:!0,d:"0",syntax:at.COORDINATE},{n:"cz",int:!0,d:"0",syntax:at.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:at.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:at.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:at.LENGTH_PERCENTAGE},{n:"x",int:!0,d:"0",syntax:at.COORDINATE},{n:"y",int:!0,d:"0",syntax:at.COORDINATE},{n:"z",int:!0,d:"0",syntax:at.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:at.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:at.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:at.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:at.COORDINATE},{n:"y1",int:!0,l:!0,syntax:at.COORDINATE},{n:"z1",int:!0,l:!0,syntax:at.COORDINATE},{n:"x2",int:!0,l:!0,syntax:at.COORDINATE},{n:"y2",int:!0,l:!0,syntax:at.COORDINATE},{n:"z2",int:!0,l:!0,syntax:at.COORDINATE},{n:"path",int:!0,l:!0,d:"",a:["d"],syntax:at.PATH,p:50},{n:"points",int:!0,l:!0,syntax:at.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:at.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:at.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:at.LENGTH_PERCENTAGE},{n:"fontFamily",l:!0,inh:!0,d:"sans-serif"},{n:"fontStyle",l:!0,inh:!0,k:["normal","italic","oblique"],d:"normal"},{n:"fontWeight",l:!0,inh:!0,k:["normal","bold","bolder","lighter"],d:"normal"},{n:"fontVariant",l:!0,inh:!0,k:["normal","small-caps"],d:"normal"},{n:"lineHeight",l:!0,syntax:at.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:at.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:at.NUMBER,d:function(t){return t===H.PATH||t===H.POLYGON||t===H.POLYLINE?"4":"10"}},{n:"wordWrap",l:!0},{n:"wordWrapWidth",l:!0},{n:"maxLines",l:!0},{n:"textOverflow",l:!0,d:"clip"},{n:"leading",l:!0},{n:"textBaseline",l:!0,inh:!0,k:["top","hanging","middle","alphabetic","ideographic","bottom"],d:"alphabetic"},{n:"textAlign",l:!0,inh:!0,k:["start","center","middle","end","left","right"],d:"start"},{n:"markerStart",syntax:at.MARKER},{n:"markerEnd",syntax:at.MARKER},{n:"markerMid",syntax:at.MARKER},{n:"markerStartOffset",syntax:at.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:at.LENGTH,l:!0,int:!0,d:"0"}],aC=P1.filter(function(t){return!!t.l}).map(function(t){return t.n}),ea={},jl=new WeakMap,pX=function(t,e){var n=jl.get(t);return!n||n.length===0?!0:n.includes(e)},vX=function(){function t(e){var n=this;this.runtime=e,P1.forEach(function(r){n.registerMetadata(r)})}return t.prototype.registerMetadata=function(e){Q([e.n],D(e.a||[]),!1).forEach(function(n){ea[n]=e})},t.prototype.unregisterMetadata=function(e){delete ea[e]},t.prototype.getPropertySyntax=function(e){return this.runtime.CSSPropertySyntaxFactory[e]},t.prototype.processProperties=function(e,n,r){var i=this;if(r===void 0&&(r={skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0}),!this.runtime.enableCSSParsing){Object.assign(e.attributes,n);var o=Object.keys(n),a=e.parsedStyle.clipPath,s=e.parsedStyle.offsetPath;e.parsedStyle=Object.assign(e.parsedStyle,n);var l=!!r.forceUpdateGeometry;if(!l){for(var c=0;c<aC.length;c++)if(aC[c]in n){l=!0;break}}n.fill&&(e.parsedStyle.fill=lo(n.fill)),n.stroke&&(e.parsedStyle.stroke=lo(n.stroke)),n.shadowColor&&(e.parsedStyle.shadowColor=lo(n.shadowColor)),n.filter&&(e.parsedStyle.filter=UA(n.filter)),Ot(n.radius)||(e.parsedStyle.radius=g1(n.radius,4)),Ot(n.lineDash)||(e.parsedStyle.lineDash=g1(n.lineDash,2)),n.points&&(e.parsedStyle.points=nC(n.points,e)),n.path===""&&(e.parsedStyle.path=G({},zA)),n.path&&(e.parsedStyle.path=O1(n.path),e.parsedStyle.defX=e.parsedStyle.path.rect.x,e.parsedStyle.defY=e.parsedStyle.path.rect.y),n.textTransform&&this.runtime.CSSPropertySyntaxFactory["<text-transform>"].calculator(null,null,{value:n.textTransform},e,null),n.clipPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("clipPath",a,n.clipPath,e,this.runtime),n.offsetPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("offsetPath",s,n.offsetPath,e,this.runtime),n.anchor&&(e.parsedStyle.anchor=g1(n.anchor,2)),n.transform&&(e.parsedStyle.transform=_1(n.transform)),n.transformOrigin&&(e.parsedStyle.transformOrigin=oC(n.transformOrigin)),n.markerStart&&(e.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,n.markerStart,n.markerStart,null,null)),n.markerEnd&&(e.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,n.markerEnd,n.markerEnd,null,null)),n.markerMid&&(e.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator("",n.markerMid,n.markerMid,null,null)),((e.nodeName===H.CIRCLE||e.nodeName===H.ELLIPSE)&&(!Ot(n.cx)||!Ot(n.cy))||(e.nodeName===H.RECT||e.nodeName===H.IMAGE||e.nodeName===H.GROUP||e.nodeName===H.HTML||e.nodeName===H.TEXT||e.nodeName===H.MESH)&&(!Ot(n.x)||!Ot(n.y)||!Ot(n.z))||e.nodeName===H.LINE&&(!Ot(n.x1)||!Ot(n.y1)||!Ot(n.z1)||!Ot(n.x2)||!Ot(n.y2)||!Ot(n.z2)))&&this.runtime.CSSPropertySyntaxFactory["<coordinate>"].postProcessor(e,o),Ot(n.zIndex)||this.runtime.CSSPropertySyntaxFactory["<z-index>"].postProcessor(e,o),n.path&&this.runtime.CSSPropertySyntaxFactory["<path>"].postProcessor(e,o),n.points&&this.runtime.CSSPropertySyntaxFactory["<list-of-points>"].postProcessor(e,o),Ot(n.offsetDistance)||this.runtime.CSSPropertySyntaxFactory["<offset-distance>"].postProcessor(e,o),n.transform&&this.runtime.CSSPropertySyntaxFactory["<transform>"].postProcessor(e,o),l&&this.updateGeometry(e);return}var u=r.skipUpdateAttribute,f=r.skipParse,d=r.forceUpdateGeometry,h=r.usedAttributes,p=r.memoize,v=d,g=Object.keys(n);g.forEach(function(y){var m;u||(e.attributes[y]=n[y]),!v&&(!((m=ea[y])===null||m===void 0)&&m.l)&&(v=!0)}),f||g.forEach(function(y){e.computedStyle[y]=i.parseProperty(y,e.attributes[y],e,p)}),h!=null&&h.length&&(g=Array.from(new Set(g.concat(h)))),g.forEach(function(y){y in e.computedStyle&&(e.parsedStyle[y]=i.computeProperty(y,e.computedStyle[y],e,p))}),v&&this.updateGeometry(e),g.forEach(function(y){y in e.parsedStyle&&i.postProcessProperty(y,e,g)}),this.runtime.enableCSSParsing&&e.children.length&&g.forEach(function(y){y in e.parsedStyle&&i.isPropertyInheritable(y)&&e.children.forEach(function(m){m.internalSetAttribute(y,null,{skipUpdateAttribute:!0,skipParse:!0})})})},t.prototype.parseProperty=function(e,n,r,i){var o=ea[e],a=n;if((n===""||Ot(n))&&(n="unset"),n==="unset"||n==="initial"||n==="inherit")a=d1(n);else if(o){var s=o.k,l=o.syntax,c=l&&this.getPropertySyntax(l);s&&s.indexOf(n)>-1?a=d1(n):c&&(!i&&c.parserUnmemoize?a=c.parserUnmemoize(n,r):c.parser&&(a=c.parser(n,r)))}return a},t.prototype.computeProperty=function(e,n,r,i){var o=ea[e],a=r.id==="g-root",s=n;if(o){var l=o.syntax,c=o.inh,u=o.d;if(n instanceof Kn){var f=n.value;if(f==="unset"&&(c&&!a?f="inherit":f="initial"),f==="initial")Ot(u)||(n=this.parseProperty(e,kl(u)?u(r.nodeName):u,r,i));else if(f==="inherit"){var d=this.tryToResolveProperty(r,e,{inherited:!0});if(Ot(d)){this.addUnresolveProperty(r,e);return}else return d}}var h=l&&this.getPropertySyntax(l);if(h&&h.calculator){var p=r.parsedStyle[e];s=h.calculator(e,p,n,r,this.runtime)}else n instanceof Kn?s=n.value:s=n}return s},t.prototype.postProcessProperty=function(e,n,r){var i=ea[e];if(i&&i.syntax){var o=i.syntax&&this.getPropertySyntax(i.syntax),a=o;a&&a.postProcessor&&a.postProcessor(n,r)}},t.prototype.addUnresolveProperty=function(e,n){var r=jl.get(e);r||(jl.set(e,[]),r=jl.get(e)),r.indexOf(n)===-1&&r.push(n)},t.prototype.tryToResolveProperty=function(e,n,r){r===void 0&&(r={});var i=r.inherited;if(i&&e.parentElement&&pX(e.parentElement,n)){var o=e.parentElement.parsedStyle[n];return o==="unset"||o==="initial"||o==="inherit"?void 0:o}},t.prototype.recalc=function(e){var n=jl.get(e);if(n&&n.length){var r={};n.forEach(function(i){r[i]=e.attributes[i]}),this.processProperties(e,r),jl.delete(e)}},t.prototype.updateGeometry=function(e){var n=e.nodeName,r=this.runtime.geometryUpdaterFactory[n];if(r){var i=e.geometry;i.contentBounds||(i.contentBounds=new Xe),i.renderBounds||(i.renderBounds=new Xe);var o=e.parsedStyle,a=r.update(o,e),s=a.width,l=a.height,c=a.depth,u=c===void 0?0:c,f=a.offsetX,d=f===void 0?0:f,h=a.offsetY,p=h===void 0?0:h,v=a.offsetZ,g=v===void 0?0:v,y=[Math.abs(s)/2,Math.abs(l)/2,u/2],m=o,b=m.stroke,x=m.lineWidth,w=m.increasedLineWidthForHitTesting,O=m.shadowType,_=m.shadowColor,S=m.filter,E=S===void 0?[]:S,M=m.transformOrigin,P=o.anchor;n===H.TEXT?delete o.anchor:n===H.MESH&&(o.anchor[2]=.5);var C=[(1-(P&&P[0]||0)*2)*s/2+d,(1-(P&&P[1]||0)*2)*l/2+p,(1-(P&&P[2]||0)*2)*y[2]+g];i.contentBounds.update(C,y);var A=n===H.POLYLINE||n===H.POLYGON||n===H.PATH?Math.SQRT2:.5,T=b&&!b.isNone;if(T){var k=((x||0)+(w||0))*A;y[0]+=k,y[1]+=k}if(i.renderBounds.update(C,y),_&&O&&O!=="inner"){var N=i.renderBounds,j=N.min,L=N.max,I=o,$=I.shadowBlur,F=I.shadowOffsetX,R=I.shadowOffsetY,B=$||0,W=F||0,K=R||0,J=j[0]-B+W,X=L[0]+B+W,V=j[1]-B+K,it=L[1]+B+K;j[0]=Math.min(j[0],J),L[0]=Math.max(L[0],X),j[1]=Math.min(j[1],V),L[1]=Math.max(L[1],it),i.renderBounds.setMinMax(j,L)}E.forEach(function(mt){var Nt=mt.name,Yt=mt.params;if(Nt==="blur"){var me=Yt[0].value;i.renderBounds.update(i.renderBounds.center,up(i.renderBounds.halfExtents,i.renderBounds.halfExtents,[me,me,0]))}else if(Nt==="drop-shadow"){var We=Yt[0].value,lr=Yt[1].value,$o=Yt[2].value,rl=i.renderBounds,Hn=rl.min,ei=rl.max,$t=Hn[0]-$o+We,Wt=ei[0]+$o+We,Ae=Hn[1]-$o+lr,qt=ei[1]+$o+lr;Hn[0]=Math.min(Hn[0],$t),ei[0]=Math.max(ei[0],Wt),Hn[1]=Math.min(Hn[1],Ae),ei[1]=Math.max(ei[1],qt),i.renderBounds.setMinMax(Hn,ei)}}),P=o.anchor;var nt=s<0,lt=l<0,yt=(nt?-1:1)*(M?yr(M[0],0,e):0),pt=(lt?-1:1)*(M?yr(M[1],1,e):0);yt=yt-(nt?-1:1)*(P&&P[0]||0)*i.contentBounds.halfExtents[0]*2,pt=pt-(lt?-1:1)*(P&&P[1]||0)*i.contentBounds.halfExtents[1]*2,e.setOrigin(yt,pt),this.runtime.sceneGraphService.dirtifyToRoot(e)}},t.prototype.updateSizeAttenuation=function(e,n){e.style.isSizeAttenuation?(e.style.rawLineWidth||(e.style.rawLineWidth=e.style.lineWidth),e.style.lineWidth=e.style.rawLineWidth/n,e.nodeName===H.CIRCLE&&(e.style.rawR||(e.style.rawR=e.style.r),e.style.r=e.style.rawR/n)):(e.style.rawLineWidth&&(e.style.lineWidth=e.style.rawLineWidth,delete e.style.rawLineWidth),e.nodeName===H.CIRCLE&&e.style.rawR&&(e.style.r=e.style.rawR,delete e.style.rawR))},t.prototype.isPropertyInheritable=function(e){var n=ea[e];return n?n.inh:!1},t}(),gX=function(){function t(){this.parser=GA,this.parserUnmemoize=v1,this.parserWithCSSDisabled=null,this.mixer=y1}return t.prototype.calculator=function(e,n,r,i){return gr(r)},t}(),yX=function(){function t(){}return t.prototype.calculator=function(e,n,r,i,o){return r instanceof Kn&&(r=null),o.sceneGraphService.updateDisplayObjectDependency(e,n,r,i),e==="clipPath"&&i.forEach(function(a){a.childNodes.length===0&&o.sceneGraphService.dirtifyToRoot(a)}),r},t}(),mX=function(){function t(){this.parser=lo,this.parserWithCSSDisabled=lo,this.mixer=RV}return t.prototype.calculator=function(e,n,r,i){return r instanceof Kn?r.value==="none"?h1:BA:r},t}(),bX=function(){function t(){this.parser=UA}return t.prototype.calculator=function(e,n,r){return r instanceof Kn?[]:r},t}();function sC(t){var e=t.parsedStyle.fontSize;return Ot(e)?null:e}var A1=function(){function t(){this.parser=Nl,this.parserUnmemoize=Qu,this.parserWithCSSDisabled=null,this.mixer=y1}return t.prototype.calculator=function(e,n,r,i,o){var a;if(as(r))return r;if(te.isRelativeUnit(r.unit)){var s=o.styleValueRegistry;if(r.unit===rt.kPercentage)return 0;if(r.unit===rt.kEms){if(i.parentNode){var l=sC(i.parentNode);if(l)return l*=r.value,l;s.addUnresolveProperty(i,e)}else s.addUnresolveProperty(i,e);return 0}else if(r.unit===rt.kRems){if(!((a=i==null?void 0:i.ownerDocument)===null||a===void 0)&&a.documentElement){var l=sC(i.ownerDocument.documentElement);if(l)return l*=r.value,l;s.addUnresolveProperty(i,e)}else s.addUnresolveProperty(i,e);return 0}}else return r.value},t}(),xX=function(){function t(){this.mixer=XA}return t.prototype.parser=function(e){var n=HA(as(e)?[e]:e),r;return n.length===1?r=[n[0],n[0]]:r=[n[0],n[1]],r},t.prototype.calculator=function(e,n,r){return r.map(function(i){return i.value})},t}(),wX=function(){function t(){this.mixer=XA}return t.prototype.parser=function(e){var n=HA(as(e)?[e]:e),r;return n.length===1?r=[n[0],n[0],n[0],n[0]]:n.length===2?r=[n[0],n[1],n[0],n[1]]:n.length===3?r=[n[0],n[1],n[2],n[1]]:r=[n[0],n[1],n[2],n[3]],r},t.prototype.calculator=function(e,n,r){return r.map(function(i){return i.value})},t}(),Ju=Kt();function C1(t,e){var n=e.parsedStyle.defX||0,r=e.parsedStyle.defY||0;return e.resetLocalTransform(),e.setLocalPosition(n,r),t.forEach(function(i){var o=i.t,a=i.d;if(o==="scale"){var s=(a==null?void 0:a.map(function(m){return m.value}))||[1,1];e.scaleLocal(s[0],s[1],1)}else if(o==="scalex"){var s=(a==null?void 0:a.map(function(b){return b.value}))||[1];e.scaleLocal(s[0],1,1)}else if(o==="scaley"){var s=(a==null?void 0:a.map(function(b){return b.value}))||[1];e.scaleLocal(1,s[0],1)}else if(o==="scalez"){var s=(a==null?void 0:a.map(function(b){return b.value}))||[1];e.scaleLocal(1,1,s[0])}else if(o==="scale3d"){var s=(a==null?void 0:a.map(function(b){return b.value}))||[1,1,1];e.scaleLocal(s[0],s[1],s[2])}else if(o==="translate"){var l=a||[Je,Je];e.translateLocal(l[0].value,l[1].value,0)}else if(o==="translatex"){var l=a||[Je];e.translateLocal(l[0].value,0,0)}else if(o==="translatey"){var l=a||[Je];e.translateLocal(0,l[0].value,0)}else if(o==="translatez"){var l=a||[Je];e.translateLocal(0,0,l[0].value)}else if(o==="translate3d"){var l=a||[Je,Je,Je];e.translateLocal(l[0].value,l[1].value,l[2].value)}else if(o==="rotate"){var c=a||[li];e.rotateLocal(0,0,gr(c[0]))}else if(o==="rotatex"){var c=a||[li];e.rotateLocal(gr(c[0]),0,0)}else if(o==="rotatey"){var c=a||[li];e.rotateLocal(0,gr(c[0]),0)}else if(o==="rotatez"){var c=a||[li];e.rotateLocal(0,0,gr(c[0]))}else if(o!=="rotate3d")if(o==="skew"){var u=(a==null?void 0:a.map(function(m){return m.value}))||[0,0];e.setLocalSkew(Me(u[0]),Me(u[1]))}else if(o==="skewx"){var u=(a==null?void 0:a.map(function(b){return b.value}))||[0];e.setLocalSkew(Me(u[0]),e.getLocalSkew()[1])}else if(o==="skewy"){var u=(a==null?void 0:a.map(function(b){return b.value}))||[0];e.setLocalSkew(e.getLocalSkew()[0],Me(u[0]))}else if(o==="matrix"){var f=D(a.map(function(m){return m.value}),6),d=f[0],h=f[1],p=f[2],v=f[3],g=f[4],y=f[5];e.setLocalTransform(Uy(Ju,d,h,0,0,p,v,0,0,0,0,1,0,g+n,y+r,0,1))}else o==="matrix3d"&&(Uy.apply(rY,Q([Ju],D(a.map(function(m){return m.value})),!1)),Ju[12]+=n,Ju[13]+=r,e.setLocalTransform(Ju))}),e.getLocalTransform()}var OX=function(t){st(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.postProcessor=function(n,r){var i,o,a;switch(n.nodeName){case H.CIRCLE:case H.ELLIPSE:var s=n.parsedStyle,l=s.cx,c=s.cy,u=s.cz;Ot(l)||(i=l),Ot(c)||(o=c),Ot(u)||(a=u);break;case H.LINE:var f=n.parsedStyle,d=f.x1,h=f.x2,p=f.y1,v=f.y2,g=Math.min(d,h),y=Math.min(p,v);i=g,o=y,a=0;break;case H.RECT:case H.IMAGE:case H.GROUP:case H.HTML:case H.TEXT:case H.MESH:Ot(n.parsedStyle.x)||(i=n.parsedStyle.x),Ot(n.parsedStyle.y)||(o=n.parsedStyle.y),Ot(n.parsedStyle.z)||(a=n.parsedStyle.z);break}n.nodeName!==H.PATH&&n.nodeName!==H.POLYLINE&&n.nodeName!==H.POLYGON&&(n.parsedStyle.defX=i||0,n.parsedStyle.defY=o||0);var m=!Ot(i)||!Ot(o)||!Ot(a);if(m&&r.indexOf("transform")===-1){var b=n.parsedStyle.transform;if(b&&b.length)C1(b,n);else{var x=D(n.getLocalPosition(),3),w=x[0],O=x[1],_=x[2];n.setLocalPosition(Ot(i)?w:i,Ot(o)?O:o,Ot(a)?_:a)}}},e}(A1),_X=function(){function t(){}return t.prototype.calculator=function(e,n,r,i){r instanceof Kn&&(r=null);var o=r==null?void 0:r.cloneNode(!0);return o&&(o.style.isMarker=!0),o},t}(),SX=function(){function t(){this.mixer=y1,this.parser=ls,this.parserUnmemoize=Il,this.parserWithCSSDisabled=null}return t.prototype.calculator=function(e,n,r){return r.value},t}(),EX=function(){function t(){this.parser=ls,this.parserUnmemoize=Il,this.parserWithCSSDisabled=null,this.mixer=m1(0,1)}return t.prototype.calculator=function(e,n,r){return r.value},t.prototype.postProcessor=function(e){var n=e.parsedStyle,r=n.offsetPath,i=n.offsetDistance;if(r){var o=r.nodeName;if(o===H.LINE||o===H.PATH||o===H.POLYLINE){var a=r.getPoint(i);a&&(e.parsedStyle.defX=a.x,e.parsedStyle.defY=a.y,e.setLocalPosition(a.x,a.y))}}},t}(),MX=function(){function t(){this.parser=ls,this.parserUnmemoize=Il,this.parserWithCSSDisabled=null,this.mixer=m1(0,1)}return t.prototype.calculator=function(e,n,r){return r.value},t}(),PX=function(){function t(){this.parser=O1,this.parserWithCSSDisabled=O1,this.mixer=nX}return t.prototype.calculator=function(e,n,r){return r instanceof Kn&&r.value==="unset"?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new ss(0,0,0,0)}:r},t.prototype.postProcessor=function(e,n){if(e.parsedStyle.defX=e.parsedStyle.path.rect.x,e.parsedStyle.defY=e.parsedStyle.path.rect.y,e.nodeName===H.PATH&&n.indexOf("transform")===-1){var r=e.parsedStyle,i=r.defX,o=i===void 0?0:i,a=r.defY,s=a===void 0?0:a;e.setLocalPosition(o,s)}},t}(),AX=function(){function t(){this.parser=nC,this.mixer=rX}return t.prototype.postProcessor=function(e,n){if((e.nodeName===H.POLYGON||e.nodeName===H.POLYLINE)&&n.indexOf("transform")===-1){var r=e.parsedStyle,i=r.defX,o=r.defY;e.setLocalPosition(i,o)}},t}(),CX=function(t){st(e,t);function e(){var n=t.apply(this,Q([],D(arguments),!1))||this;return n.mixer=m1(0,1/0),n}return e}(A1),TX=function(){function t(){}return t.prototype.calculator=function(e,n,r,i){return r instanceof Kn?r.value==="unset"?"":r.value:"".concat(r)},t.prototype.postProcessor=function(e){e.nodeValue="".concat(e.parsedStyle.text)||""},t}(),kX=function(){function t(){}return t.prototype.calculator=function(e,n,r,i){var o=i.getAttribute("text");if(o){var a=o;r.value==="capitalize"?a=o.charAt(0).toUpperCase()+o.slice(1):r.value==="lowercase"?a=o.toLowerCase():r.value==="uppercase"&&(a=o.toUpperCase()),i.parsedStyle.text=a}return r.value},t}(),T1={},LX=0;function NX(t,e){if(t){var n=typeof t=="string"?t:t.id||LX++;T1[n]&&T1[n].destroy(),T1[n]=e}}var tf=typeof window!="undefined"&&typeof window.document!="undefined";function IX(t){return!!t.getAttribute}function jX(t,e){for(var n=0,r=t.length;n<r;){var i=n+r>>>1;lC(t[i],e)<0?n=i+1:r=i}return n}function lC(t,e){var n=Number(t.parsedStyle.zIndex),r=Number(e.parsedStyle.zIndex);if(n===r){var i=t.parentNode;if(i){var o=i.childNodes||[];return o.indexOf(t)-o.indexOf(e)}}return n-r}function cC(t){var e,n=t;do{var r=(e=n.parsedStyle)===null||e===void 0?void 0:e.clipPath;if(r)return n;n=n.parentElement}while(n!==null);return null}var uC="px";function DX(t,e,n){tf&&t.style&&(t.style.width=e+uC,t.style.height=n+uC)}function fC(t,e){if(tf)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}function $X(t){var e=fC(t,"width");return e==="auto"?t.offsetWidth:parseFloat(e)}function FX(t){var e=fC(t,"height");return e==="auto"?t.offsetHeight:parseFloat(e)}var RX=1,BX={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},k1=typeof performance=="object"&&performance.now?performance:Date;function us(t,e,n){var r=!1,i=!1,o=!!e&&!e.isNone,a=!!n&&!n.isNone;return t==="visiblepainted"||t==="painted"||t==="auto"?(r=o,i=a):t==="visiblefill"||t==="fill"?r=!0:t==="visiblestroke"||t==="stroke"?i=!0:(t==="visible"||t==="all")&&(r=!0,i=!0),[r,i]}var zX=1,YX=function(){return zX++},Ni=typeof self=="object"&&self.self==self?self:typeof global=="object"&&global.global==global?global:{},WX=Date.now(),GX=function(){return Ni.performance&&typeof Ni.performance.now=="function"?Ni.performance.now():Date.now()-WX},ef={},dC=Date.now(),HX=function(t){if(typeof t!="function")throw new TypeError(t+" is not a function");var e=Date.now(),n=e-dC,r=n>16?0:16-n,i=YX();return ef[i]=t,Object.keys(ef).length>1||setTimeout(function(){dC=e;var o=ef;ef={},Object.keys(o).forEach(function(a){return o[a](GX())})},r),i},UX=function(t){delete ef[t]},VX=["","webkit","moz","ms","o"],hC=function(t){return typeof t!="string"?HX:t===""?Ni.requestAnimationFrame:Ni[t+"RequestAnimationFrame"]},XX=function(t){return typeof t!="string"?UX:t===""?Ni.cancelAnimationFrame:Ni[t+"CancelAnimationFrame"]||Ni[t+"CancelRequestAnimationFrame"]},qX=function(t,e){for(var n=0;t[n]!==void 0;){if(e(t[n]))return t[n];n=n+1}},pC=qX(VX,function(t){return!!hC(t)}),vC=hC(pC),gC=XX(pC);Ni.requestAnimationFrame=vC,Ni.cancelAnimationFrame=gC;var KX=function(){function t(){this.callbacks=[]}return t.prototype.getCallbacksNum=function(){return this.callbacks.length},t.prototype.tapPromise=function(e,n){this.callbacks.push(n)},t.prototype.promise=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return Promise.all(this.callbacks.map(function(r){return r.apply(void 0,Q([],D(e),!1))}))},t}(),ZX=function(){function t(){this.callbacks=[]}return t.prototype.tapPromise=function(e,n){this.callbacks.push(n)},t.prototype.promise=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return hl(this,void 0,void 0,function(){var r,i,o,a;return pl(this,function(s){switch(s.label){case 0:return this.callbacks.length?[4,(a=this.callbacks)[0].apply(a,Q([],D(e),!1))]:[3,6];case 1:r=s.sent(),i=0,s.label=2;case 2:return i<this.callbacks.length-1?(o=this.callbacks[i],[4,o(r)]):[3,5];case 3:r=s.sent(),s.label=4;case 4:return i++,[3,2];case 5:return[2,r];case 6:return[2,null]}})})},t}(),jn=function(){function t(){this.callbacks=[]}return t.prototype.tap=function(e,n){this.callbacks.push(n)},t.prototype.call=function(){var e=arguments;this.callbacks.forEach(function(n){n.apply(void 0,e)})},t}(),L1=function(){function t(){this.callbacks=[]}return t.prototype.tap=function(e,n){this.callbacks.push(n)},t.prototype.call=function(){if(this.callbacks.length){for(var e=arguments,n=this.callbacks[0].apply(void 0,e),r=0;r<this.callbacks.length-1;r++){var i=this.callbacks[r];n=i(n)}return n}return null},t}(),QX=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],JX=/([\"\'])[^\'\"]+\1/;function tq(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,o=t.fontWeight,a=as(e)&&"".concat(e,"px")||"16px",s=n.split(","),l=s.length-1;l>=0;l--){var c=s[l].trim();!JX.test(c)&&QX.indexOf(c)<0&&(c='"'.concat(c,'"')),s[l]=c}return"".concat(r," ").concat(i," ").concat(o," ").concat(a," ").concat(s.join(","))}var eq=function(){function t(){this.parser=_1,this.parserUnmemoize=rC,this.parserWithCSSDisabled=rC,this.mixer=dX}return t.prototype.calculator=function(e,n,r,i){return r instanceof Kn?[]:r},t.prototype.postProcessor=function(e){var n=e.parsedStyle.transform;C1(n,e)},t}(),nq=function(){function t(){this.parser=oC,this.parserUnmemoize=hX}return t}(),rq=function(){function t(){this.parser=ls,this.parserUnmemoize=Il}return t.prototype.calculator=function(e,n,r,i){return r.value},t.prototype.postProcessor=function(e){if(e.parentNode){var n=e.parentNode,r=n.renderable,i=n.sortable;r&&(r.dirty=!0),i&&(i.dirty=!0,i.dirtyReason=Ll.Z_INDEX_CHANGED)}},t}(),iq=function(){function t(){}return t.prototype.update=function(e,n){var r=e.r,i=r*2,o=r*2;return{width:i,height:o}},t}(),oq=function(){function t(){}return t.prototype.update=function(e,n){var r=e.rx,i=e.ry,o=r*2,a=i*2;return{width:o,height:a}},t}(),aq=function(){function t(){}return t.prototype.update=function(e){var n=e.x1,r=e.y1,i=e.x2,o=e.y2,a=Math.min(n,i),s=Math.max(n,i),l=Math.min(r,o),c=Math.max(r,o),u=s-a,f=c-l;return{width:u,height:f}},t}(),sq=function(){function t(){}return t.prototype.update=function(e){var n=e.path,r=n.rect,i=r.width,o=r.height;return{width:i,height:o}},t}(),lq=function(){function t(){}return t.prototype.update=function(e){if(e.points&&Xm(e.points.points)){var n=e.points.points,r=Math.min.apply(Math,Q([],D(n.map(function(c){return c[0]})),!1)),i=Math.max.apply(Math,Q([],D(n.map(function(c){return c[0]})),!1)),o=Math.min.apply(Math,Q([],D(n.map(function(c){return c[1]})),!1)),a=Math.max.apply(Math,Q([],D(n.map(function(c){return c[1]})),!1)),s=i-r,l=a-o;return{width:s,height:l}}return{width:0,height:0}},t}(),cq=function(){function t(){}return t.prototype.update=function(e,n){var r=e.img,i=e.width,o=i===void 0?0:i,a=e.height,s=a===void 0?0:a,l=o,c=s;return r&&!ao(r)&&(l||(l=r.width,e.width=l),c||(c=r.height,e.height=c)),{width:l,height:c}},t}(),uq=function(){function t(e){this.globalRuntime=e}return t.prototype.isReadyToMeasure=function(e,n){var r=e.text,i=e.textAlign,o=e.textBaseline,a=e.fontSize,s=e.fontStyle,l=e.fontWeight,c=e.fontVariant,u=e.lineWidth;return r&&a&&s&&l&&c&&i&&o&&!Ot(u)},t.prototype.update=function(e,n){var r,i,o=e.text,a=e.textAlign,s=e.lineWidth,l=e.textBaseline,c=e.dx,u=e.dy;if(!this.isReadyToMeasure(e,n))return e.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{width:0,height:0,x:0,y:0,offsetX:0,offsetY:0};var f=(((i=(r=n==null?void 0:n.ownerDocument)===null||r===void 0?void 0:r.defaultView)===null||i===void 0?void 0:i.getConfig())||{}).offscreenCanvas,d=this.globalRuntime.textService.measureText(o,e,f);e.metrics=d;var h=d.width,p=d.height,v=d.lineHeight,g=d.fontProperties,y=[h/2,p/2,0],m=[0,1],b=0;a==="center"||a==="middle"?(b=s/2,m=[.5,1]):(a==="right"||a==="end")&&(b=s,m=[1,1]);var x=0;return l==="middle"?x=y[1]:l==="top"||l==="hanging"?x=y[1]*2:l==="alphabetic"?x=this.globalRuntime.enableCSSParsing?v-g.ascent:0:(l==="bottom"||l==="ideographic")&&(x=0),c&&(b+=c),u&&(x+=u),e.anchor=[m[0],m[1],0],{width:y[0]*2,height:y[1]*2,offsetX:b,offsetY:x}},t}();function fq(t){return!!t.type}var xp=function(){function t(e){this.eventPhase=t.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new on,this.page=new on,this.canvas=new on,this.viewport=new on,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}return Object.defineProperty(t.prototype,"name",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layerX",{get:function(){return this.layer.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layerY",{get:function(){return this.layer.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageX",{get:function(){return this.page.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageY",{get:function(){return this.page.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasX",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasY",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportX",{get:function(){return this.viewport.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportY",{get:function(){return this.viewport.y},enumerable:!1,configurable:!0}),t.prototype.composedPath=function(){return this.manager&&(!this.path||this.path[0]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},Object.defineProperty(t.prototype,"propagationPath",{get:function(){return this.composedPath()},enumerable:!1,configurable:!0}),t.prototype.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},t.prototype.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t.prototype.initEvent=function(){},t.prototype.initUIEvent=function(){},t.prototype.clone=function(){throw new Error(Jt)},t}(),yC=function(t){st(e,t);function e(){var n=t.apply(this,Q([],D(arguments),!1))||this;return n.client=new on,n.movement=new on,n.offset=new on,n.global=new on,n.screen=new on,n}return Object.defineProperty(e.prototype,"clientX",{get:function(){return this.client.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clientY",{get:function(){return this.client.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"movementX",{get:function(){return this.movement.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"movementY",{get:function(){return this.movement.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsetX",{get:function(){return this.offset.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsetY",{get:function(){return this.offset.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalX",{get:function(){return this.global.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalY",{get:function(){return this.global.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"screenX",{get:function(){return this.screen.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"screenY",{get:function(){return this.screen.y},enumerable:!1,configurable:!0}),e.prototype.getModifierState=function(n){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(n)},e.prototype.initMouseEvent=function(){throw new Error(Jt)},e}(xp),N1=function(t){st(e,t);function e(){var n=t.apply(this,Q([],D(arguments),!1))||this;return n.width=0,n.height=0,n.isPrimary=!1,n}return e.prototype.getCoalescedEvents=function(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]},e.prototype.getPredictedEvents=function(){throw new Error("getPredictedEvents is not supported!")},e.prototype.clone=function(){return this.manager.clonePointerEvent(this)},e}(yC),I1=function(t){st(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},e}(yC),ee=function(t){st(e,t);function e(n,r){var i=t.call(this,null)||this;return i.type=n,i.detail=r,Object.assign(i,r),i}return e}(xp),mC=":",bC=function(){function t(){this.emitter=new Vm}return t.prototype.on=function(e,n,r){return this.addEventListener(e,n,r),this},t.prototype.addEventListener=function(e,n,r){var i=tA(r)&&r||np(r)&&r.capture,o=np(r)&&r.once,a=kl(n)?void 0:n,s=!1,l="";if(e.indexOf(mC)>-1){var c=D(e.split(mC),2),u=c[0],f=c[1];e=f,l=u,s=!0}if(e=i?"".concat(e,"capture"):e,n=kl(n)?n:n.handleEvent,s){var d=n;n=function(){for(var h,p=[],v=0;v<arguments.length;v++)p[v]=arguments[v];((h=p[0].target)===null||h===void 0?void 0:h.name)===l&&d.apply(void 0,Q([],D(p),!1))}}return o?this.emitter.once(e,n,a):this.emitter.on(e,n,a),this},t.prototype.off=function(e,n,r){return e?this.removeEventListener(e,n,r):this.removeAllEventListeners(),this},t.prototype.removeAllEventListeners=function(){this.emitter.removeAllListeners()},t.prototype.removeEventListener=function(e,n,r){var i=tA(r)&&r||np(r)&&r.capture,o=kl(n)?void 0:n;return e=i?"".concat(e,"capture"):e,n=kl(n)?n:n==null?void 0:n.handleEvent,this.emitter.off(e,n,o),this},t.prototype.emit=function(e,n){this.dispatchEvent(new ee(e,n))},t.prototype.dispatchEvent=function(e,n){var r,i;if(n===void 0&&(n=!1),!fq(e))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");var o;if(this.document?o=this:this.defaultView?o=this.defaultView:o=(r=this.ownerDocument)===null||r===void 0?void 0:r.defaultView,o){if(e.manager=o.getEventService()||null,!e.manager)return!1;e.defaultPrevented=!1,e.path=[],n||(e.target=this),(i=e.manager)===null||i===void 0||i.dispatchEvent(e,e.type,n)}return!e.defaultPrevented},t}(),an=function(t){st(e,t);function e(){var n=t.apply(this,Q([],D(arguments),!1))||this;return n.shadow=!1,n.ownerDocument=null,n.isConnected=!1,n.baseURI="",n.childNodes=[],n.nodeType=0,n.nodeName="",n.nodeValue=null,n.parentNode=null,n}return e.isNode=function(n){return!!n.childNodes},Object.defineProperty(e.prototype,"textContent",{get:function(){var n,r,i="";this.nodeName===H.TEXT&&(i+=this.style.text);try{for(var o=ur(this.childNodes),a=o.next();!a.done;a=o.next()){var s=a.value;s.nodeName===H.TEXT?i+=s.nodeValue:i+=s.textContent}}catch(l){n={error:l}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},set:function(n){var r=this;this.childNodes.slice().forEach(function(i){r.removeChild(i)}),this.nodeName===H.TEXT&&(this.style.text="".concat(n))},enumerable:!1,configurable:!0}),e.prototype.getRootNode=function(n){return n===void 0&&(n={}),this.parentNode?this.parentNode.getRootNode(n):n.composed&&this.host?this.host.getRootNode(n):this},e.prototype.hasChildNodes=function(){return this.childNodes.length>0},e.prototype.isDefaultNamespace=function(n){throw new Error(Jt)},e.prototype.lookupNamespaceURI=function(n){throw new Error(Jt)},e.prototype.lookupPrefix=function(n){throw new Error(Jt)},e.prototype.normalize=function(){throw new Error(Jt)},e.prototype.isEqualNode=function(n){return this===n},e.prototype.isSameNode=function(n){return this.isEqualNode(n)},Object.defineProperty(e.prototype,"parent",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentElement",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstChild",{get:function(){return this.childNodes.length>0?this.childNodes[0]:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastChild",{get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null},enumerable:!1,configurable:!0}),e.prototype.compareDocumentPosition=function(n){var r;if(n===this)return 0;for(var i=n,o=this,a=[i],s=[o];(r=i.parentNode)!==null&&r!==void 0?r:o.parentNode;)i=i.parentNode?(a.push(i.parentNode),i.parentNode):i,o=o.parentNode?(s.push(o.parentNode),o.parentNode):o;if(i!==o)return e.DOCUMENT_POSITION_DISCONNECTED|e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|e.DOCUMENT_POSITION_PRECEDING;var l=a.length>s.length?a:s,c=l===a?s:a;if(l[l.length-c.length]===c[0])return l===a?e.DOCUMENT_POSITION_CONTAINED_BY|e.DOCUMENT_POSITION_FOLLOWING:e.DOCUMENT_POSITION_CONTAINS|e.DOCUMENT_POSITION_PRECEDING;for(var u=l.length-c.length,f=c.length-1;f>=0;f--){var d=c[f],h=l[u+f];if(h!==d){var p=d.parentNode.childNodes;return p.indexOf(d)<p.indexOf(h)?c===a?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING:l===a?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING}}return e.DOCUMENT_POSITION_FOLLOWING},e.prototype.contain=function(n){return this.contains(n)},e.prototype.contains=function(n){for(var r=n;r&&this!==r;)r=r.parentNode;return!!r},e.prototype.getAncestor=function(n){for(var r=this;n>0&&r;)r=r.parentNode,n--;return r},e.prototype.forEach=function(n,r){r===void 0&&(r=!1),n(this)||(r?this.childNodes.slice():this.childNodes).forEach(function(i){i.forEach(n)})},e.DOCUMENT_POSITION_DISCONNECTED=1,e.DOCUMENT_POSITION_PRECEDING=2,e.DOCUMENT_POSITION_FOLLOWING=4,e.DOCUMENT_POSITION_CONTAINS=8,e.DOCUMENT_POSITION_CONTAINED_BY=16,e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32,e}(bC),dq=2048,hq=function(){function t(e,n){var r=this;this.globalRuntime=e,this.context=n,this.emitter=new Vm,this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=Kt(),this.tmpVec3=Ct(),this.onPointerDown=function(i){var o=r.createPointerEvent(i);if(r.dispatchEvent(o,"pointerdown"),o.pointerType==="touch")r.dispatchEvent(o,"touchstart");else if(o.pointerType==="mouse"||o.pointerType==="pen"){var a=o.button===2;r.dispatchEvent(o,a?"rightdown":"mousedown")}var s=r.trackingData(i.pointerId);s.pressTargetsByButton[i.button]=o.composedPath(),r.freeEvent(o)},this.onPointerUp=function(i){var o,a=k1.now(),s=r.createPointerEvent(i,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);if(r.dispatchEvent(s,"pointerup"),s.pointerType==="touch")r.dispatchEvent(s,"touchend");else if(s.pointerType==="mouse"||s.pointerType==="pen"){var l=s.button===2;r.dispatchEvent(s,l?"rightup":"mouseup")}var c=r.trackingData(i.pointerId),u=r.findMountedTarget(c.pressTargetsByButton[i.button]),f=u;if(u&&!s.composedPath().includes(u)){for(var d=u;d&&!s.composedPath().includes(d);){if(s.currentTarget=d,r.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch")r.notifyTarget(s,"touchendoutside");else if(s.pointerType==="mouse"||s.pointerType==="pen"){var l=s.button===2;r.notifyTarget(s,l?"rightupoutside":"mouseupoutside")}an.isNode(d)&&(d=d.parentNode)}delete c.pressTargetsByButton[i.button],f=d}if(f){var h=r.clonePointerEvent(s,"click");h.target=f,h.path=[],c.clicksByButton[i.button]||(c.clicksByButton[i.button]={clickCount:0,target:h.target,timeStamp:a});var p=c.clicksByButton[i.button];p.target===h.target&&a-p.timeStamp<200?++p.clickCount:p.clickCount=1,p.target=h.target,p.timeStamp=a,h.detail=p.clickCount,!((o=s.detail)===null||o===void 0)&&o.preventClick||(!r.context.config.useNativeClickEvent&&(h.pointerType==="mouse"||h.pointerType==="touch")&&r.dispatchEvent(h,"click"),r.dispatchEvent(h,"pointertap")),r.freeEvent(h)}r.freeEvent(s)},this.onPointerMove=function(i){var o=r.createPointerEvent(i,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0),a=o.pointerType==="mouse"||o.pointerType==="pen",s=r.trackingData(i.pointerId),l=r.findMountedTarget(s.overTargets);if(s.overTargets&&l!==o.target){var c=i.type==="mousemove"?"mouseout":"pointerout",u=r.createPointerEvent(i,c,l||void 0);if(r.dispatchEvent(u,"pointerout"),a&&r.dispatchEvent(u,"mouseout"),!o.composedPath().includes(l)){var f=r.createPointerEvent(i,"pointerleave",l||void 0);for(f.eventPhase=f.AT_TARGET;f.target&&!o.composedPath().includes(f.target);)f.currentTarget=f.target,r.notifyTarget(f),a&&r.notifyTarget(f,"mouseleave"),an.isNode(f.target)&&(f.target=f.target.parentNode);r.freeEvent(f)}r.freeEvent(u)}if(l!==o.target){var d=i.type==="mousemove"?"mouseover":"pointerover",h=r.clonePointerEvent(o,d);r.dispatchEvent(h,"pointerover"),a&&r.dispatchEvent(h,"mouseover");for(var p=l&&an.isNode(l)&&l.parentNode;p&&p!==(an.isNode(r.rootTarget)&&r.rootTarget.parentNode)&&p!==o.target;)p=p.parentNode;var v=!p||p===(an.isNode(r.rootTarget)&&r.rootTarget.parentNode);if(v){var g=r.clonePointerEvent(o,"pointerenter");for(g.eventPhase=g.AT_TARGET;g.target&&g.target!==l&&g.target!==(an.isNode(r.rootTarget)&&r.rootTarget.parentNode);)g.currentTarget=g.target,r.notifyTarget(g),a&&r.notifyTarget(g,"mouseenter"),an.isNode(g.target)&&(g.target=g.target.parentNode);r.freeEvent(g)}r.freeEvent(h)}r.dispatchEvent(o,"pointermove"),o.pointerType==="touch"&&r.dispatchEvent(o,"touchmove"),a&&(r.dispatchEvent(o,"mousemove"),r.cursor=r.getCursor(o.target)),s.overTargets=o.composedPath(),r.freeEvent(o)},this.onPointerOut=function(i){var o=r.trackingData(i.pointerId);if(o.overTargets){var a=i.pointerType==="mouse"||i.pointerType==="pen",s=r.findMountedTarget(o.overTargets),l=r.createPointerEvent(i,"pointerout",s||void 0);r.dispatchEvent(l),a&&r.dispatchEvent(l,"mouseout");var c=r.createPointerEvent(i,"pointerleave",s||void 0);for(c.eventPhase=c.AT_TARGET;c.target&&c.target!==(an.isNode(r.rootTarget)&&r.rootTarget.parentNode);)c.currentTarget=c.target,r.notifyTarget(c),a&&r.notifyTarget(c,"mouseleave"),an.isNode(c.target)&&(c.target=c.target.parentNode);o.overTargets=null,r.freeEvent(l),r.freeEvent(c)}r.cursor=null},this.onPointerOver=function(i){var o=r.trackingData(i.pointerId),a=r.createPointerEvent(i),s=a.pointerType==="mouse"||a.pointerType==="pen";r.dispatchEvent(a,"pointerover"),s&&r.dispatchEvent(a,"mouseover"),a.pointerType==="mouse"&&(r.cursor=r.getCursor(a.target));var l=r.clonePointerEvent(a,"pointerenter");for(l.eventPhase=l.AT_TARGET;l.target&&l.target!==(an.isNode(r.rootTarget)&&r.rootTarget.parentNode);)l.currentTarget=l.target,r.notifyTarget(l),s&&r.notifyTarget(l,"mouseenter"),an.isNode(l.target)&&(l.target=l.target.parentNode);o.overTargets=a.composedPath(),r.freeEvent(a),r.freeEvent(l)},this.onPointerUpOutside=function(i){var o=r.trackingData(i.pointerId),a=r.findMountedTarget(o.pressTargetsByButton[i.button]),s=r.createPointerEvent(i);if(a){for(var l=a;l;)s.currentTarget=l,r.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch"||(s.pointerType==="mouse"||s.pointerType==="pen")&&r.notifyTarget(s,s.button===2?"rightupoutside":"mouseupoutside"),an.isNode(l)&&(l=l.parentNode);delete o.pressTargetsByButton[i.button]}r.freeEvent(s)},this.onWheel=function(i){var o=r.createWheelEvent(i);r.dispatchEvent(o),r.freeEvent(o)},this.onClick=function(i){if(r.context.config.useNativeClickEvent){var o=r.createPointerEvent(i);r.dispatchEvent(o),r.freeEvent(o)}},this.onPointerCancel=function(i){var o=r.createPointerEvent(i,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);r.dispatchEvent(o),r.freeEvent(o)}}return t.prototype.init=function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)},t.prototype.destroy=function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()},t.prototype.client2Viewport=function(e){var n=this.context.contextService.getBoundingClientRect();return new on(e.x-((n==null?void 0:n.left)||0),e.y-((n==null?void 0:n.top)||0))},t.prototype.viewport2Client=function(e){var n=this.context.contextService.getBoundingClientRect();return new on(e.x+((n==null?void 0:n.left)||0),e.y+((n==null?void 0:n.top)||0))},t.prototype.viewport2Canvas=function(e){var n=e.x,r=e.y,i=this.rootTarget.defaultView,o=i.getCamera(),a=this.context.config,s=a.width,l=a.height,c=o.getPerspectiveInverse(),u=o.getWorldTransform(),f=On(this.tmpMatrix,u,c),d=ai(this.tmpVec3,n/s*2-1,(1-r/l)*2-1,0);return Qe(d,d,f),new on(d[0],d[1])},t.prototype.canvas2Viewport=function(e){var n=this.rootTarget.defaultView,r=n.getCamera(),i=r.getPerspective(),o=r.getViewTransform(),a=On(this.tmpMatrix,i,o),s=ai(this.tmpVec3,e.x,e.y,0);Qe(this.tmpVec3,this.tmpVec3,a);var l=this.context.config,c=l.width,u=l.height;return new on((s[0]+1)/2*c,(1-(s[1]+1)/2)*u)},t.prototype.setPickHandler=function(e){this.pickHandler=e},t.prototype.addEventMapping=function(e,n){this.mappingTable[e]||(this.mappingTable[e]=[]),this.mappingTable[e].push({fn:n,priority:0}),this.mappingTable[e].sort(function(r,i){return r.priority-i.priority})},t.prototype.mapEvent=function(e){if(this.rootTarget){var n=this.mappingTable[e.type];if(n)for(var r=0,i=n.length;r<i;r++)n[r].fn(e);else console.warn("[EventService]: Event mapping not defined for ".concat(e.type))}},t.prototype.dispatchEvent=function(e,n,r){if(!r)e.propagationStopped=!1,e.propagationImmediatelyStopped=!1,this.propagate(e,n);else{e.eventPhase=e.AT_TARGET;var i=this.rootTarget.defaultView||null;e.currentTarget=i,this.notifyListeners(e,n)}this.emitter.emit(n||e.type,e)},t.prototype.propagate=function(e,n){if(e.target){var r=e.composedPath();e.eventPhase=e.CAPTURING_PHASE;for(var i=r.length-1;i>=1;i--)if(e.currentTarget=r[i],this.notifyTarget(e,n),e.propagationStopped||e.propagationImmediatelyStopped)return;if(e.eventPhase=e.AT_TARGET,e.currentTarget=e.target,this.notifyTarget(e,n),!(e.propagationStopped||e.propagationImmediatelyStopped)){var o=r.indexOf(e.currentTarget);e.eventPhase=e.BUBBLING_PHASE;for(var i=o+1;i<r.length;i++)if(e.currentTarget=r[i],this.notifyTarget(e,n),e.propagationStopped||e.propagationImmediatelyStopped)return}}},t.prototype.propagationPath=function(e){var n=[e],r=this.rootTarget.defaultView||null;if(r&&r===e)return n.unshift(r.document),n;for(var i=0;i<dq&&e!==this.rootTarget;i++)an.isNode(e)&&e.parentNode&&(n.push(e.parentNode),e=e.parentNode);return r&&n.push(r),n},t.prototype.hitTest=function(e){var n=e.viewportX,r=e.viewportY,i=this.context.config,o=i.width,a=i.height,s=i.disableHitTesting;return n<0||r<0||n>o||r>a?null:!s&&this.pickHandler(e)||this.rootTarget||null},t.prototype.isNativeEventFromCanvas=function(e){var n,r=this.context.contextService.getDomElement(),i=(n=e.nativeEvent)===null||n===void 0?void 0:n.target;if(i){if(i===r)return!0;if(r&&r.contains)return r.contains(i)}return e.nativeEvent.composedPath?e.nativeEvent.composedPath().indexOf(r)>-1:!1},t.prototype.getExistedHTML=function(e){var n,r;if(e.nativeEvent.composedPath)try{for(var i=ur(e.nativeEvent.composedPath()),o=i.next();!o.done;o=i.next()){var a=o.value,s=this.nativeHTMLMap.get(a);if(s)return s}}catch(l){n={error:l}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return null},t.prototype.pickTarget=function(e){return this.hitTest({clientX:e.clientX,clientY:e.clientY,viewportX:e.viewportX,viewportY:e.viewportY,x:e.canvasX,y:e.canvasY})},t.prototype.createPointerEvent=function(e,n,r,i){var o=this.allocateEvent(N1);this.copyPointerData(e,o),this.copyMouseData(e,o),this.copyData(e,o),o.nativeEvent=e.nativeEvent,o.originalEvent=e;var a=this.getExistedHTML(o);return o.target=r!=null?r:a||this.isNativeEventFromCanvas(o)&&this.pickTarget(o)||i,typeof n=="string"&&(o.type=n),o},t.prototype.createWheelEvent=function(e){var n=this.allocateEvent(I1);this.copyWheelData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.nativeEvent=e.nativeEvent,n.originalEvent=e;var r=this.getExistedHTML(n);return n.target=r||this.isNativeEventFromCanvas(n)&&this.pickTarget(n),n},t.prototype.trackingData=function(e){return this.mappingState.trackingData[e]||(this.mappingState.trackingData[e]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[e]},t.prototype.cloneWheelEvent=function(e){var n=this.allocateEvent(I1);return n.nativeEvent=e.nativeEvent,n.originalEvent=e.originalEvent,this.copyWheelData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.target=e.target,n.path=e.composedPath().slice(),n.type=e.type,n},t.prototype.clonePointerEvent=function(e,n){var r=this.allocateEvent(N1);return r.nativeEvent=e.nativeEvent,r.originalEvent=e.originalEvent,this.copyPointerData(e,r),this.copyMouseData(e,r),this.copyData(e,r),r.target=e.target,r.path=e.composedPath().slice(),r.type=n!=null?n:r.type,r},t.prototype.copyPointerData=function(e,n){n.pointerId=e.pointerId,n.width=e.width,n.height=e.height,n.isPrimary=e.isPrimary,n.pointerType=e.pointerType,n.pressure=e.pressure,n.tangentialPressure=e.tangentialPressure,n.tiltX=e.tiltX,n.tiltY=e.tiltY,n.twist=e.twist},t.prototype.copyMouseData=function(e,n){n.altKey=e.altKey,n.button=e.button,n.buttons=e.buttons,n.ctrlKey=e.ctrlKey,n.metaKey=e.metaKey,n.shiftKey=e.shiftKey,n.client.copyFrom(e.client),n.movement.copyFrom(e.movement),n.canvas.copyFrom(e.canvas),n.screen.copyFrom(e.screen),n.global.copyFrom(e.global),n.offset.copyFrom(e.offset)},t.prototype.copyWheelData=function(e,n){n.deltaMode=e.deltaMode,n.deltaX=e.deltaX,n.deltaY=e.deltaY,n.deltaZ=e.deltaZ},t.prototype.copyData=function(e,n){n.isTrusted=e.isTrusted,n.timeStamp=k1.now(),n.type=e.type,n.detail=e.detail,n.view=e.view,n.page.copyFrom(e.page),n.viewport.copyFrom(e.viewport)},t.prototype.allocateEvent=function(e){this.eventPool.has(e)||this.eventPool.set(e,[]);var n=this.eventPool.get(e).pop()||new e(this);return n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.target=null,n},t.prototype.freeEvent=function(e){if(e.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var n=e.constructor;this.eventPool.has(n)||this.eventPool.set(n,[]),this.eventPool.get(n).push(e)},t.prototype.notifyTarget=function(e,n){n=n!=null?n:e.type;var r=e.eventPhase===e.CAPTURING_PHASE||e.eventPhase===e.AT_TARGET?"".concat(n,"capture"):n;this.notifyListeners(e,r),e.eventPhase===e.AT_TARGET&&this.notifyListeners(e,n)},t.prototype.notifyListeners=function(e,n){var r=e.currentTarget.emitter,i=r._events[n];if(i)if("fn"in i)i.once&&r.removeListener(n,i.fn,void 0,!0),i.fn.call(e.currentTarget||i.context,e);else for(var o=0;o<i.length&&!e.propagationImmediatelyStopped;o++)i[o].once&&r.removeListener(n,i[o].fn,void 0,!0),i[o].fn.call(e.currentTarget||i[o].context,e)},t.prototype.findMountedTarget=function(e){if(!e)return null;for(var n=e[e.length-1],r=e.length-2;r>=0;r--){var i=e[r];if(i===this.rootTarget||an.isNode(i)&&i.parentNode===n)n=e[r];else break}return n},t.prototype.getCursor=function(e){for(var n=e;n;){var r=IX(n)&&n.getAttribute("cursor");if(r)return r;n=an.isNode(n)&&n.parentNode}},t}(),pq=function(){function t(){}return t.prototype.getOrCreateCanvas=function(e,n){if(this.canvas)return this.canvas;if(e||U.offscreenCanvas)this.canvas=e||U.offscreenCanvas,this.context=this.canvas.getContext("2d",G({willReadFrequently:!0},n));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",G({willReadFrequently:!0},n)),(!this.context||!this.context.measureText)&&(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(r){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",G({willReadFrequently:!0},n))}return this.canvas.width=10,this.canvas.height=10,this.canvas},t.prototype.getOrCreateContext=function(e,n){return this.context?this.context:(this.getOrCreateCanvas(e,n),this.context)},t}(),na;(function(t){t[t.CAMERA_CHANGED=0]="CAMERA_CHANGED",t[t.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",t[t.NONE=2]="NONE"})(na||(na={}));var vq=function(){function t(e,n){this.globalRuntime=e,this.context=n,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new jn,initAsync:new KX,dirtycheck:new L1,cull:new L1,beginFrame:new jn,beforeRender:new jn,render:new jn,afterRender:new jn,endFrame:new jn,destroy:new jn,pick:new ZX,pickSync:new L1,pointerDown:new jn,pointerUp:new jn,pointerMove:new jn,pointerOut:new jn,pointerOver:new jn,pointerWheel:new jn,pointerCancel:new jn,click:new jn}}return t.prototype.init=function(e){var n=this,r=G(G({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach(function(i){i.apply(r,n.globalRuntime)}),this.hooks.init.call(),this.hooks.initAsync.getCallbacksNum()===0?(this.inited=!0,e()):this.hooks.initAsync.promise().then(function(){n.inited=!0,e()})},t.prototype.getStats=function(){return this.stats},t.prototype.disableDirtyRectangleRendering=function(){var e=this.context.config.renderer,n=e.getConfig().enableDirtyRectangleRendering;return!n||this.context.renderingContext.renderReasons.has(na.CAMERA_CHANGED)},t.prototype.render=function(e,n){var r=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var i=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(i.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),i.renderReasons.size&&this.inited){i.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var o=i.renderReasons.size===1&&i.renderReasons.has(na.CAMERA_CHANGED),a=!e.disableRenderHooks||!(e.disableRenderHooks&&o);a&&this.renderDisplayObject(i.root,e,i),this.hooks.beginFrame.call(),a&&i.renderListCurrentFrame.forEach(function(s){r.hooks.beforeRender.call(s),r.hooks.render.call(s),r.hooks.afterRender.call(s)}),this.hooks.endFrame.call(),i.renderListCurrentFrame=[],i.renderReasons.clear(),n()}},t.prototype.renderDisplayObject=function(e,n,r){var i=this,o=n.renderer.getConfig(),a=o.enableDirtyCheck,s=o.enableCulling;this.globalRuntime.enableCSSParsing&&this.globalRuntime.styleValueRegistry.recalc(e);var l=e.renderable,c=a?l.dirty||r.dirtyRectangleRenderingDisabled?e:null:e;if(c){var u=s?this.hooks.cull.call(c,this.context.camera):c;u&&(this.stats.rendered++,r.renderListCurrentFrame.push(u))}e.renderable.dirty=!1,e.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var f=e.sortable;f.dirty&&(this.sort(e,f),f.dirty=!1,f.dirtyChildren=[],f.dirtyReason=void 0),(f.sorted||e.childNodes).forEach(function(d){i.renderDisplayObject(d,n,r)})},t.prototype.sort=function(e,n){n.sorted&&n.dirtyReason!==Ll.Z_INDEX_CHANGED?n.dirtyChildren.forEach(function(r){var i=e.childNodes.indexOf(r);if(i===-1){var o=n.sorted.indexOf(r);o>=0&&n.sorted.splice(o,1)}else if(n.sorted.length===0)n.sorted.push(r);else{var a=jX(n.sorted,r);n.sorted.splice(a,0,r)}}):n.sorted=e.childNodes.slice().sort(lC)},t.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},t.prototype.dirtify=function(){this.context.renderingContext.renderReasons.add(na.DISPLAY_OBJECT_CHANGED)},t}(),gq=/\[\s*(.*)=(.*)\s*\]/,yq=function(){function t(){}return t.prototype.selectOne=function(e,n){var r=this;if(e.startsWith("."))return n.find(function(s){return((s==null?void 0:s.classList)||[]).indexOf(r.getIdOrClassname(e))>-1});if(e.startsWith("#"))return n.find(function(s){return s.id===r.getIdOrClassname(e)});if(e.startsWith("[")){var i=this.getAttribute(e),o=i.name,a=i.value;return o?n.find(function(s){return n!==s&&(o==="name"?s.name===a:r.attributeToString(s,o)===a)}):null}else return n.find(function(s){return n!==s&&s.nodeName===e})},t.prototype.selectAll=function(e,n){var r=this;if(e.startsWith("."))return n.findAll(function(s){return n!==s&&((s==null?void 0:s.classList)||[]).indexOf(r.getIdOrClassname(e))>-1});if(e.startsWith("#"))return n.findAll(function(s){return n!==s&&s.id===r.getIdOrClassname(e)});if(e.startsWith("[")){var i=this.getAttribute(e),o=i.name,a=i.value;return o?n.findAll(function(s){return n!==s&&(o==="name"?s.name===a:r.attributeToString(s,o)===a)}):[]}else return n.findAll(function(s){return n!==s&&s.nodeName===e})},t.prototype.is=function(e,n){if(e.startsWith("."))return n.className===this.getIdOrClassname(e);if(e.startsWith("#"))return n.id===this.getIdOrClassname(e);if(e.startsWith("[")){var r=this.getAttribute(e),i=r.name,o=r.value;return i==="name"?n.name===o:this.attributeToString(n,i)===o}else return n.nodeName===e},t.prototype.getIdOrClassname=function(e){return e.substring(1)},t.prototype.getAttribute=function(e){var n=e.match(gq),r="",i="";return n&&n.length>2&&(r=n[1].replace(/"/g,""),i=n[2].replace(/"/g,"")),{name:r,value:i}},t.prototype.attributeToString=function(e,n){if(!e.getAttribute)return"";var r=e.getAttribute(n);return Ot(r)?"":r.toString?r.toString():""},t}(),fs=function(t){st(e,t);function e(n,r,i,o,a,s,l,c){var u=t.call(this,null)||this;return u.relatedNode=r,u.prevValue=i,u.newValue=o,u.attrName=a,u.attrChange=s,u.prevParsedValue=l,u.newParsedValue=c,u.type=n,u}return e.ADDITION=2,e.MODIFICATION=1,e.REMOVAL=3,e}(xp),St;(function(t){t.REPARENT="reparent",t.DESTROY="destroy",t.ATTR_MODIFIED="DOMAttrModified",t.INSERTED="DOMNodeInserted",t.REMOVED="removed",t.MOUNTED="DOMNodeInsertedIntoDocument",t.UNMOUNTED="DOMNodeRemovedFromDocument",t.BOUNDS_CHANGED="bounds-changed",t.CULLED="culled"})(St||(St={}));function xC(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}var mq=new fs(St.REPARENT,null,"","","",0,"",""),bq=function(){function t(e){var n=this;this.runtime=e,this.pendingEvents=[],this.boundsChangedEvent=new ee(St.BOUNDS_CHANGED),this.rotate=function(){var r=Ge();return function(i,o,a,s){a===void 0&&(a=0),s===void 0&&(s=0),typeof o=="number"&&(o=jt(o,a,s));var l=i.transformable;if(i.parentNode===null||!i.parentNode.transformable)n.rotateLocal(i,o);else{var c=Ge();xh(c,o[0],o[1],o[2]);var u=n.getRotation(i),f=n.getRotation(i.parentNode);wh(r,f),Jy(r,r),Go(c,r,c),Go(l.localRotation,c,u),Oh(l.localRotation,l.localRotation),n.dirtifyLocal(i,l)}}}(),this.rotateLocal=function(){var r=Ge();return function(i,o,a,s){a===void 0&&(a=0),s===void 0&&(s=0),typeof o=="number"&&(o=jt(o,a,s));var l=i.transformable;xh(r,o[0],o[1],o[2]),$E(l.localRotation,l.localRotation,r),n.dirtifyLocal(i,l)}}(),this.setEulerAngles=function(){var r=Ge();return function(i,o,a,s){a===void 0&&(a=0),s===void 0&&(s=0),typeof o=="number"&&(o=jt(o,a,s));var l=i.transformable;if(i.parentNode===null||!i.parentNode.transformable)n.setLocalEulerAngles(i,o);else{xh(l.localRotation,o[0],o[1],o[2]);var c=n.getRotation(i.parentNode);wh(r,Jy(Ge(),c)),$E(l.localRotation,l.localRotation,r),n.dirtifyLocal(i,l)}}}(),this.translateLocal=function(){return function(r,i,o,a){o===void 0&&(o=0),a===void 0&&(a=0),typeof i=="number"&&(i=jt(i,o,a));var s=r.transformable;gu(i,Ct())||(aY(i,i,s.localRotation),ul(s.localPosition,s.localPosition,i),n.dirtifyLocal(r,s))}}(),this.setPosition=function(){var r=Kt(),i=Ct();return function(o,a){var s=o.transformable;if(i[0]=a[0],i[1]=a[1],i[2]=a[2]||0,!gu(n.getPosition(o),i)){if(Vn(s.position,i),o.parentNode===null||!o.parentNode.transformable)Vn(s.localPosition,i);else{var l=o.parentNode.transformable;qa(r,l.worldTransform),oi(r,r),Qe(s.localPosition,i,r)}n.dirtifyLocal(o,s)}}}(),this.setLocalPosition=function(){var r=Ct();return function(i,o){var a=i.transformable;r[0]=o[0],r[1]=o[1],r[2]=o[2]||0,!gu(a.localPosition,r)&&(Vn(a.localPosition,r),n.dirtifyLocal(i,a))}}(),this.translate=function(){var r=Ct(),i=Ct(),o=Ct();return function(a,s,l,c){l===void 0&&(l=0),c===void 0&&(c=0),typeof s=="number"&&(s=ai(i,s,l,c)),!gu(s,r)&&(ul(o,n.getPosition(a),s),n.setPosition(a,o))}}(),this.setRotation=function(){var r=Ge();return function(i,o,a,s,l){var c=i.transformable;if(typeof o=="number"&&(o=tm(o,a,s,l)),i.parentNode===null||!i.parentNode.transformable)n.setLocalRotation(i,o);else{var u=n.getRotation(i.parentNode);wh(r,u),Jy(r,r),Go(c.localRotation,r,o),Oh(c.localRotation,c.localRotation),n.dirtifyLocal(i,c)}}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=function(){var r=Kt(),i=Ct(),o=tm(0,0,0,1);return function(a){var s=a.localSkew[0]!==0||a.localSkew[1]!==0;if(s){if(vu(a.localTransform,a.localRotation,a.localPosition,jt(1,1,1),a.origin),a.localSkew[0]!==0||a.localSkew[1]!==0){var l=pu(r);l[4]=Math.tan(a.localSkew[0]),l[1]=Math.tan(a.localSkew[1]),On(a.localTransform,a.localTransform,l)}var c=vu(r,o,i,a.localScale,a.origin);On(a.localTransform,a.localTransform,c)}else vu(a.localTransform,a.localRotation,a.localPosition,a.localScale,a.origin)}}()}return t.prototype.matches=function(e,n){return this.runtime.sceneGraphSelector.is(e,n)},t.prototype.querySelector=function(e,n){return this.runtime.sceneGraphSelector.selectOne(e,n)},t.prototype.querySelectorAll=function(e,n){return this.runtime.sceneGraphSelector.selectAll(e,n)},t.prototype.attach=function(e,n,r){var i,o,a=!1;e.parentNode&&(a=e.parentNode!==n,this.detach(e)),e.parentNode=n,Ot(r)?e.parentNode.childNodes.push(e):e.parentNode.childNodes.splice(r,0,e);var s=n.sortable;(!((i=s==null?void 0:s.sorted)===null||i===void 0)&&i.length||!((o=e.style)===null||o===void 0)&&o.zIndex)&&(s.dirtyChildren.indexOf(e)===-1&&s.dirtyChildren.push(e),s.dirty=!0,s.dirtyReason=Ll.ADDED);var l=e.transformable;l&&this.dirtifyWorld(e,l),l.frozen&&this.unfreezeParentToRoot(e),a&&e.dispatchEvent(mq)},t.prototype.detach=function(e){var n,r;if(e.parentNode){var i=e.transformable,o=e.parentNode.sortable;(!((n=o==null?void 0:o.sorted)===null||n===void 0)&&n.length||!((r=e.style)===null||r===void 0)&&r.zIndex)&&(o.dirtyChildren.indexOf(e)===-1&&o.dirtyChildren.push(e),o.dirty=!0,o.dirtyReason=Ll.REMOVED);var a=e.parentNode.childNodes.indexOf(e);a>-1&&e.parentNode.childNodes.splice(a,1),i&&this.dirtifyWorld(e,i),e.parentNode=null}},t.prototype.getOrigin=function(e){return e.transformable.origin},t.prototype.setOrigin=function(e,n,r,i){r===void 0&&(r=0),i===void 0&&(i=0),typeof n=="number"&&(n=[n,r,i]);var o=e.transformable;if(!(n[0]===o.origin[0]&&n[1]===o.origin[1]&&n[2]===o.origin[2])){var a=o.origin;a[0]=n[0],a[1]=n[1],a[2]=n[2]||0,this.dirtifyLocal(e,o)}},t.prototype.setLocalEulerAngles=function(e,n,r,i){r===void 0&&(r=0),i===void 0&&(i=0),typeof n=="number"&&(n=jt(n,r,i));var o=e.transformable;xh(o.localRotation,n[0],n[1],n[2]),this.dirtifyLocal(e,o)},t.prototype.scaleLocal=function(e,n){var r=e.transformable;iY(r.localScale,r.localScale,jt(n[0],n[1],n[2]||1)),this.dirtifyLocal(e,r)},t.prototype.setLocalScale=function(e,n){var r=e.transformable,i=jt(n[0],n[1],n[2]||r.localScale[2]);gu(i,r.localScale)||(Vn(r.localScale,i),this.dirtifyLocal(e,r))},t.prototype.setLocalRotation=function(e,n,r,i,o){typeof n=="number"&&(n=tm(n,r,i,o));var a=e.transformable;wh(a.localRotation,n),this.dirtifyLocal(e,a)},t.prototype.setLocalSkew=function(e,n,r){typeof n=="number"&&(n=dY(n,r));var i=e.transformable;hY(i.localSkew,n),this.dirtifyLocal(e,i)},t.prototype.dirtifyLocal=function(e,n){n.localDirtyFlag||(n.localDirtyFlag=!0,n.dirtyFlag||this.dirtifyWorld(e,n))},t.prototype.dirtifyWorld=function(e,n){n.dirtyFlag||this.unfreezeParentToRoot(e),this.dirtifyWorldInternal(e,n),this.dirtifyToRoot(e,!0)},t.prototype.triggerPendingEvents=function(){var e=this,n=new Set,r=function(i,o){i.isConnected&&!n.has(i.entity)&&(e.boundsChangedEvent.detail=o,e.boundsChangedEvent.target=i,i.isMutationObserved?i.dispatchEvent(e.boundsChangedEvent):i.ownerDocument.defaultView.dispatchEvent(e.boundsChangedEvent,!0),n.add(i.entity))};this.pendingEvents.forEach(function(i){var o=D(i,2),a=o[0],s=o[1];s.affectChildren?a.forEach(function(l){r(l,s)}):r(a,s)}),this.clearPendingEvents(),n.clear()},t.prototype.clearPendingEvents=function(){this.pendingEvents=[]},t.prototype.dirtifyToRoot=function(e,n){n===void 0&&(n=!1);var r=e;for(r.renderable&&(r.renderable.dirty=!0);r;)xC(r),r=r.parentNode;n&&e.forEach(function(i){xC(i)}),this.informDependentDisplayObjects(e),this.pendingEvents.push([e,{affectChildren:n}])},t.prototype.updateDisplayObjectDependency=function(e,n,r,i){if(n&&n!==r){var o=this.displayObjectDependencyMap.get(n);if(o&&o[e]){var a=o[e].indexOf(i);o[e].splice(a,1)}}if(r){var s=this.displayObjectDependencyMap.get(r);s||(this.displayObjectDependencyMap.set(r,{}),s=this.displayObjectDependencyMap.get(r)),s[e]||(s[e]=[]),s[e].push(i)}},t.prototype.informDependentDisplayObjects=function(e){var n=this,r=this.displayObjectDependencyMap.get(e);r&&Object.keys(r).forEach(function(i){r[i].forEach(function(o){n.dirtifyToRoot(o,!0),o.dispatchEvent(new fs(St.ATTR_MODIFIED,o,n,n,i,fs.MODIFICATION,n,n)),o.isCustomElement&&o.isConnected&&o.attributeChangedCallback&&o.attributeChangedCallback(i,n,n)})})},t.prototype.getPosition=function(e){var n=e.transformable;return yh(n.position,this.getWorldTransform(e,n))},t.prototype.getRotation=function(e){var n=e.transformable;return mh(n.rotation,this.getWorldTransform(e,n))},t.prototype.getScale=function(e){var n=e.transformable;return cl(n.scaling,this.getWorldTransform(e,n))},t.prototype.getWorldTransform=function(e,n){return n===void 0&&(n=e.transformable),!n.localDirtyFlag&&!n.dirtyFlag||(e.parentNode&&e.parentNode.transformable&&this.getWorldTransform(e.parentNode),this.sync(e,n)),n.worldTransform},t.prototype.getLocalPosition=function(e){return e.transformable.localPosition},t.prototype.getLocalRotation=function(e){return e.transformable.localRotation},t.prototype.getLocalScale=function(e){return e.transformable.localScale},t.prototype.getLocalSkew=function(e){return e.transformable.localSkew},t.prototype.getLocalTransform=function(e){var n=e.transformable;return n.localDirtyFlag&&(this.calcLocalTransform(n),n.localDirtyFlag=!1),n.localTransform},t.prototype.setLocalTransform=function(e,n){var r=yh(Ct(),n),i=mh(Ge(),n),o=cl(Ct(),n);this.setLocalScale(e,o),this.setLocalPosition(e,r),this.setLocalRotation(e,i)},t.prototype.resetLocalTransform=function(e){this.setLocalScale(e,[1,1,1]),this.setLocalPosition(e,[0,0,0]),this.setLocalEulerAngles(e,[0,0,0]),this.setLocalSkew(e,[0,0])},t.prototype.getTransformedGeometryBounds=function(e,n,r){n===void 0&&(n=!1);var i=this.getGeometryBounds(e,n);if(Xe.isEmpty(i))return null;var o=r||new Xe;return o.setFromTransformedAABB(i,this.getWorldTransform(e)),o},t.prototype.getGeometryBounds=function(e,n){n===void 0&&(n=!1);var r=e.geometry,i=n?r.renderBounds:r.contentBounds||null;return i||new Xe},t.prototype.getBounds=function(e,n){var r=this;n===void 0&&(n=!1);var i=e.renderable;if(!i.boundsDirty&&!n&&i.bounds)return i.bounds;if(!i.renderBoundsDirty&&n&&i.renderBounds)return i.renderBounds;var o=n?i.renderBounds:i.bounds,a=this.getTransformedGeometryBounds(e,n,o),s=e.childNodes;if(s.forEach(function(u){var f=r.getBounds(u,n);f&&(a?a.add(f):(a=o||new Xe,a.update(f.center,f.halfExtents)))}),n){var l=cC(e);if(l){var c=l.parsedStyle.clipPath.getBounds(n);a?c&&(a=c.intersection(a)):a=c}}return a||(a=new Xe),a&&(n?i.renderBounds=a:i.bounds=a),n?i.renderBoundsDirty=!1:i.boundsDirty=!1,a},t.prototype.getLocalBounds=function(e){if(e.parentNode){var n=Kt();e.parentNode.transformable&&(n=oi(Kt(),this.getWorldTransform(e.parentNode)));var r=this.getBounds(e);if(!Xe.isEmpty(r)){var i=new Xe;return i.setFromTransformedAABB(r,n),i}}return this.getBounds(e)},t.prototype.getBoundingClientRect=function(e){var n,r,i,o=this.getGeometryBounds(e);Xe.isEmpty(o)||(i=new Xe,i.setFromTransformedAABB(o,this.getWorldTransform(e)));var a=(r=(n=e.ownerDocument)===null||n===void 0?void 0:n.defaultView)===null||r===void 0?void 0:r.getContextService().getBoundingClientRect();if(i){var s=D(i.getMin(),2),l=s[0],c=s[1],u=D(i.getMax(),2),f=u[0],d=u[1];return new ss(l+((a==null?void 0:a.left)||0),c+((a==null?void 0:a.top)||0),f-l,d-c)}return new ss((a==null?void 0:a.left)||0,(a==null?void 0:a.top)||0,0,0)},t.prototype.dirtifyWorldInternal=function(e,n){var r=this;if(!n.dirtyFlag){n.dirtyFlag=!0,n.frozen=!1,e.childNodes.forEach(function(o){var a=o.transformable;a.dirtyFlag||r.dirtifyWorldInternal(o,a)});var i=e.renderable;i&&(i.renderBoundsDirty=!0,i.boundsDirty=!0,i.dirty=!0)}},t.prototype.syncHierarchy=function(e){var n=e.transformable;if(!n.frozen){n.frozen=!0,(n.localDirtyFlag||n.dirtyFlag)&&this.sync(e,n);for(var r=e.childNodes,i=0;i<r.length;i++)this.syncHierarchy(r[i])}},t.prototype.sync=function(e,n){if(n.localDirtyFlag&&(this.calcLocalTransform(n),n.localDirtyFlag=!1),n.dirtyFlag){var r=e.parentNode,i=r&&r.transformable;r===null||!i?qa(n.worldTransform,n.localTransform):On(n.worldTransform,i.worldTransform,n.localTransform),n.dirtyFlag=!1}},t.prototype.unfreezeParentToRoot=function(e){for(var n=e.parentNode;n;){var r=n.transformable;r&&(r.frozen=!1),n=n.parentNode}},t}(),ds={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},wC=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,xq=/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/,wq=/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/,Oq=/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/,_q=/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/,Sq=/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/,Eq=/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/,Mq=/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/,Pq=/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/,Aq=new RegExp("".concat(xq.source,"|").concat(Oq.source,"|").concat(Sq.source,"|").concat(Mq.source)),Cq=new RegExp("".concat(wq.source,"|").concat(_q.source,"|").concat(Eq.source,"|").concat(Pq.source)),Tq=function(){function t(e){var n=this;this.runtime=e,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(r,i){return n.isBreakingSpace(i)?!1:!!(r&&(Cq.exec(i)||Aq.exec(r)))},this.trimByKinsokuShorui=function(r){var i=Q([],D(r),!1),o=i[i.length-2];if(!o)return r;var a=o[o.length-1];return i[i.length-2]=o.slice(0,-1),i[i.length-1]=a+i[i.length-1],i}}return t.prototype.measureFont=function(e,n){if(this.fontMetricsCache[e])return this.fontMetricsCache[e];var r={ascent:0,descent:0,fontSize:0},i=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(n),o=this.runtime.offscreenCanvasCreator.getOrCreateContext(n,{willReadFrequently:!0});o.font=e;var a=ds.MetricsString+ds.BaselineSymbol,s=Math.ceil(o.measureText(a).width),l=Math.ceil(o.measureText(ds.BaselineSymbol).width),c=ds.HeightMultiplier*l;l=l*ds.BaselineMultiplier|0,i.width=s,i.height=c,o.fillStyle="#f00",o.fillRect(0,0,s,c),o.font=e,o.textBaseline="alphabetic",o.fillStyle="#000",o.fillText(a,0,l);var u=o.getImageData(0,0,s||1,c||1).data,f=u.length,d=s*4,h=0,p=0,v=!1;for(h=0;h<l;++h){for(var g=0;g<d;g+=4)if(u[p+g]!==255){v=!0;break}if(!v)p+=d;else break}for(r.ascent=l-h,p=f-d,v=!1,h=c;h>l;--h){for(var g=0;g<d;g+=4)if(u[p+g]!==255){v=!0;break}if(!v)p-=d;else break}return r.descent=h-l,r.fontSize=r.ascent+r.descent,this.fontMetricsCache[e]=r,r},t.prototype.measureText=function(e,n,r){var i=n.fontSize,o=n.wordWrap,a=n.lineHeight,s=n.lineWidth,l=n.textBaseline,c=n.textAlign,u=n.letterSpacing,f=n.textPath;n.textPathSide,n.textPathStartOffset;var d=n.leading,h=d===void 0?0:d,p=tq(n),v=this.measureFont(p,r);v.fontSize===0&&(v.fontSize=i,v.ascent=i);var g=this.runtime.offscreenCanvasCreator.getOrCreateContext(r);g.font=p,n.isOverflowing=!1;var y=o?this.wordWrap(e,n,r):e,m=y.split(/(?:\r\n|\r|\n)/),b=new Array(m.length),x=0;if(f){f.getTotalLength();for(var w=0;w<m.length;w++)var O=g.measureText(m[w]).width+(m[w].length-1)*u}else{for(var w=0;w<m.length;w++){var _=g.measureText(m[w]).width+(m[w].length-1)*u;b[w]=_,x=Math.max(x,_)}var O=x+s,S=a||v.fontSize+s,E=Math.max(S,v.fontSize+s)+(m.length-1)*(S+h);S+=h;var M=0;return l==="middle"?M=-E/2:l==="bottom"||l==="alphabetic"||l==="ideographic"?M=-E:(l==="top"||l==="hanging")&&(M=0),{font:p,width:O,height:E,lines:m,lineWidths:b,lineHeight:S,maxLineWidth:x,fontProperties:v,lineMetrics:b.map(function(C,A){var T=0;return c==="center"||c==="middle"?T-=C/2:(c==="right"||c==="end")&&(T-=C),new ss(T-s/2,M+A*S,C+s,S)})}}},t.prototype.setGraphemeOnPath=function(){},t.prototype.wordWrap=function(e,n,r){var i=this,o=n.wordWrapWidth,a=o===void 0?0:o,s=n.letterSpacing,l=n.maxLines,c=l===void 0?1/0:l,u=n.textOverflow,f=this.runtime.offscreenCanvasCreator.getOrCreateContext(r),d=a+s,h="";u==="ellipsis"?h="...":u&&u!=="clip"&&(h=u);for(var p=[],v=0,g=0,y={},m=function(k){return i.getFromCache(k,s,y,f)},b=Array.from(h).reduce(function(k,N){return k+m(N)},0),x=Array.from(e),w=0;w<x.length;w++){var O=x[w],_=e[w-1],S=e[w+1],E=m(O);if(this.isNewline(O)){if(v++,v>=c){n.isOverflowing=!0;break}g=0,p[v]="";continue}if(g>0&&g+E>d){if(v+1>=c){if(n.isOverflowing=!0,b>0&&b<=d){for(var M=p[v].length,P=0,C=M,A=0;A<M;A++){var T=m(p[v][A]);if(P+T+b>d){C=A;break}P+=T}p[v]=(p[v]||"").slice(0,C)+h}break}if(v++,g=0,p[v]="",this.isBreakingSpace(O))continue;this.canBreakInLastChar(O)||(p=this.trimToBreakable(p),g=this.sumTextWidthByCache(p[v]||"",y)),this.shouldBreakByKinsokuShorui(O,S)&&(p=this.trimByKinsokuShorui(p),g+=m(_||""))}g+=E,p[v]=(p[v]||"")+O}return p.join(`
33
+ `,children:Y.jsx(z.SchemaComponentOptions,{components:{ChartFilterItemDesigner:H7,ChartFilterForm:JS,ChartFilterGrid:S7,ChartFilterCheckbox:U7,ChartFilterFormItem:C7,ArrayItems:ae.ArrayItems,ChartFilterCollapseDesigner:I7,ChartFilterActionDesigner:j7,CollectionFieldInitializer:V7},scope:{t:e,useChartFilterActionProps:k7,useChartFilterResetProps:L7,useChartFilterCollapseProps:N7},children:t.children})})},q7=t=>{const[e,n]=q.useState(!1),r=z.useSchemaInitializer();return Y.jsx(z.SchemaInitializerContext.Provider,{value:pt(tt({},r),{visible:e,setVisible:n}),children:Y.jsx(z.SchemaComponentOptions,{components:{ChartRenderer:Ty,ChartRendererProvider:IS,ChartFilterBlockProvider:X7,ChartFilterBlockDesigner:O7},children:Y.jsx(AB,{children:Y.jsx(CB,{children:Y.jsx(b7,{children:t.children})})})})})},K7=()=>{const{t}=se();return Y.jsxs(z.GeneralSchemaDesigner,{title:t("Charts"),showDataSource:!1,children:[Y.jsx(z.SchemaSettingsBlockTitleItem,{}),Y.jsx(z.SchemaSettingsDivider,{}),Y.jsx(z.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}})]})},tE=()=>{const{setVisible:t,setCurrent:e}=q.useContext(Mi),{parseAction:n}=z.useACLRoleContext(),r=z.useSchemaInitializerItem(),i=q.useCallback(o=>n(`${o.name}:list`),[n]);return Y.jsx(z.DataBlockInitializer,pt(tt({},r),{filter:i,filterDataSource:o=>o.key===z.DEFAULT_DATA_SOURCE_KEY||o.getOptions().isDBInstance,icon:Y.jsx(Nn.BarChartOutlined,{}),componentType:"Chart",onCreateBlockSchema:a=>Cr(this,[a],function*({item:o}){e({schema:{},field:null,collection:o.name,dataSource:o.dataSource,service:null,data:void 0}),t(!0)})}))},eE=new z.CompatibleSchemaInitializer({name:"ChartInitializers",icon:"PlusOutlined",title:'{{t("Add block")}}',items:[{name:"chart",title:At("Chart"),Component:tE},{name:"otherBlocks",type:"itemGroup",title:At("Other blocks"),children:[{name:"filter",title:At("Filter"),Component:HS}]}]}),Z7=new z.CompatibleSchemaInitializer({name:"charts:addBlock",icon:"PlusOutlined",title:'{{t("Add block")}}',items:[{name:"chart",title:At("Chart"),Component:tE},{name:"otherBlocks",type:"itemGroup",title:At("Other blocks"),children:[{name:"filter",title:At("Filter"),Component:HS}]}]},eE),Q7=()=>{const t=z.useSchemaInitializerItem(),{insert:e}=z.useSchemaInitializer();return Y.jsx(z.SchemaInitializerItem,pt(tt({},t),{icon:Y.jsx(Nn.LineChartOutlined,{}),onClick:()=>{e({type:"void","x-component":"CardItem","x-component-props":{name:"charts"},"x-designer":"ChartV2BlockDesigner",properties:{[Fo.uid()]:{type:"void","x-component":"Grid","x-decorator":"ChartV2Block","x-initializer":"charts:addBlock"}}})}}))},fu=({name:t,title:e,required:n,defaultValue:r})=>({[t||"field"]:{title:At(e||"Field"),type:"string","x-decorator":"FormItem","x-component":"Select","x-reactions":"{{ useChartFields }}",required:n,default:r}}),nE={field:fu,booleanField:({name:t,title:e,defaultValue:n=!1})=>({[t||"field"]:{"x-content":At(e||"Field"),type:"boolean","x-decorator":"FormItem","x-component":"Checkbox",default:n}}),xField:t=>fu(tt({name:"xField",title:"xField",required:!0},t)),yField:t=>fu(tt({name:"yField",title:"yField",required:!0},t)),seriesField:t=>fu(tt({name:"seriesField",title:"seriesField"},t)),colorField:t=>fu(tt({name:"colorField",title:"colorField"},t))};let jy=class{constructor({name:e,title:n,Component:r,config:i}){ni(this,"name");ni(this,"title");ni(this,"Component");ni(this,"config");ni(this,"configs",new Map);this.name=e,this.title=n,this.Component=r,this.config=i,this.addConfigs(nE)}get schema(){return this.config?{type:"object",properties:this.config.reduce((n,r)=>{let i={};if(typeof r=="string"){const o=this.configs.get(r);i=(o==null?void 0:o())||{}}else if(typeof r=="function")i=r();else if(r.property){const o=this.configs.get(r.property);i=(o==null?void 0:o(r))||{}}else i=r;return tt(tt({},n),i)},{})}:{}}addConfigs(e){Object.entries(e).forEach(([n,r])=>{this.configs.set(n,r)})}infer(e,{measures:n,dimensions:r}){let i,o,a,s,l;const c=(u,f)=>{if(f.alias)return u.find(h=>h.value===f.alias);const{alias:d}=au(f.field);return u.find(h=>h.value===d)};if(n!=null&&n.length&&(o=c(e,n[0]),l=n.map(u=>c(e,u))),r){if(r.length===1)i=c(e,r[0]);else if(r.length>1){let u;r.forEach((d,h)=>{const p=c(e,d);["date","time","datetime"].includes(p==null?void 0:p.type)&&(i=p,u=h)}),u=u||0,i=i||c(e,r[u]);const f=r.filter((d,h)=>h!==u).map(d=>c(e,d));f.length===1?(a=f[0],s=f[0]):f.length>1&&(s=f[0],a=f[1])}}return{xField:i,yField:o,seriesField:a,colorField:s,yFields:l}}getProps(e){return e}};class rE extends jy{getReference(){return{title:this.title,link:`https://ant.design/components/${this.name}`}}}class J7 extends rE{constructor(){super({name:"statistic",title:"Statistic",Component:wt.Statistic,config:[{property:"field",name:"field",title:"Field",required:!0},{title:{title:At("Title"),type:"string","x-decorator":"FormItem","x-component":"Input"}}]});ni(this,"init",(n,{measures:r,dimensions:i})=>{const{yField:o}=this.infer(n,{measures:r,dimensions:i});return{general:{field:o==null?void 0:o.value,title:o==null?void 0:o.label}}})}getProps({data:n,fieldProps:r,general:i,advanced:o}){const a=n[0]||{},s=i==null?void 0:i.field,l=r[s];return tt(tt({value:a[s],formatter:l==null?void 0:l.transformer},i),o)}}class tz extends rE{constructor(){super({name:"table",title:"Table",Component:wt.Table})}getProps({data:e,fieldProps:n,general:r,advanced:i}){var l;const o=e.length?Object.keys(e[0]).map(c=>{var u;return{title:((u=n[c])==null?void 0:u.label)||c,dataIndex:c,key:c}}):[],a=e.map((c,u)=>(Object.keys(c).map(f=>{const d=n[f];if((d==null?void 0:d.interface)==="percent"){const h=Math.round(parseFloat(c[f])*100).toFixed(2);c[f]=`${h}%`}typeof c[f]=="boolean"&&(c[f]=c[f].toString()),d!=null&&d.transformer&&(c[f]=d.transformer(c[f]))}),c._key=u,c)),s=((l=i==null?void 0:i.pagination)==null?void 0:l.pageSize)||10;return tt(tt({size:"middle",pagination:a.length<s?!1:{pageSize:s},dataSource:a,columns:o,scroll:{x:"max-content"},rowKey:"_key"},r),i)}}const ez=[new J7,new tz],iE=()=>[["cartesian"]];iE.props={};function nz(t,e){return t=t%(2*Math.PI),e=e%(2*Math.PI),t<0&&(t=2*Math.PI+t),e<0&&(e=2*Math.PI+e),t>=e&&(e=e+2*Math.PI),{startAngle:t,endAngle:e}}const oE=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:Math.PI*3/2,innerRadius:0,outerRadius:1},n=Object.assign(Object.assign({},e),t);return Object.assign(Object.assign({},n),nz(n.startAngle,n.endAngle))},du=t=>{const{startAngle:e,endAngle:n,innerRadius:r,outerRadius:i}=oE(t);return[["translate",0,.5],["reflect.y"],["translate",0,-.5],["polar",e,n,r,i]]};du.props={};const Dy=()=>[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]];Dy.props={transform:!0};const rz=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:Math.PI*3/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)},aE=t=>{const{startAngle:e,endAngle:n,innerRadius:r,outerRadius:i}=rz(t);return[...Dy(),...du({startAngle:e,endAngle:n,innerRadius:r,outerRadius:i})]};aE.props={};const sE=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:Math.PI*3/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)},$y=t=>{const{startAngle:e,endAngle:n,innerRadius:r,outerRadius:i}=sE(t);return[["transpose"],["translate",.5,.5],["reflect"],["translate",-.5,-.5],...du({startAngle:e,endAngle:n,innerRadius:r,outerRadius:i})]};$y.props={};const Fy=()=>[["parallel",0,1,0,1]];Fy.props={};const lE=({focusX:t=0,focusY:e=0,distortionX:n=2,distortionY:r=2,visual:i=!1})=>[["fisheye",t,e,n,r,i]];lE.props={transform:!0};const cE=t=>{const{startAngle:e=-Math.PI/2,endAngle:n=Math.PI*3/2,innerRadius:r=0,outerRadius:i=1}=t;return[...Fy(),...du({startAngle:e,endAngle:n,innerRadius:r,outerRadius:i})]};cE.props={};const uE=({value:t})=>e=>e.map(()=>t);uE.props={};const fE=({value:t})=>e=>e.map(t);fE.props={};const dE=({value:t})=>e=>e.map(n=>n[t]);dE.props={};const hE=({value:t})=>()=>t;hE.props={};var iz=function(t){return t!==null&&typeof t!="function"&&isFinite(t.length)};const ph=iz,Ry=function(t){return typeof t=="function"};var oz=function(t){return t==null};const By=oz;var az={}.toString,sz=function(t,e){return az.call(t)==="[object "+e+"]"};const vh=sz,Bo=function(t){return Array.isArray?Array.isArray(t):vh(t,"Array")},lz=function(t){var e=typeof t;return t!==null&&e==="object"||e==="function"};function zy(t,e){if(t){var n;if(Bo(t))for(var r=0,i=t.length;r<i&&(n=e(t[r],r),n!==!1);r++);else if(lz(t)){for(var o in t)if(t.hasOwnProperty(o)&&(n=e(t[o],o),n===!1))break}}}var cz=Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];return zy(t,function(n,r){Ry(t)&&r==="prototype"||e.push(r)}),e};const pE=cz;function uz(t,e){var n=pE(e),r=n.length;if(By(t))return!r;for(var i=0;i<r;i+=1){var o=n[i];if(e[o]!==t[o]||!(o in t))return!1}return!0}var fz=function(t){return typeof t=="object"&&t!==null};const Yy=fz;var dz=function(t){if(!Yy(t)||!vh(t,"Object"))return!1;if(Object.getPrototypeOf(t)===null)return!0;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};const Ua=dz;function vE(t,e){if(!Bo(t))return null;var n;if(Ry(e)&&(n=e),Ua(e)&&(n=function(i){return uz(i,e)}),n){for(var r=0;r<t.length;r+=1)if(n(t[r]))return t[r]}return null}var hz=function(t,e,n){if(!Bo(t)&&!Ua(t))return t;var r=n;return zy(t,function(i,o){r=e(r,i,o)}),r};const pz=hz,Wy=function(t){return vh(t,"String")};function hu(t){if(ph(t)){var e=t;return e[e.length-1]}}var vz=function(t){return vh(t,"Number")};const Va=vz,gE=function(t){return By(t)?"":t.toString()};var gz=function(t){var e=gE(t);return e.charAt(0).toLowerCase()+e.substring(1)};const yE=gz;var yz=function(t){var e=gE(t);return e.charAt(0).toUpperCase()+e.substring(1)};const zo=yz;function mz(t,e,n){var r;return function(){var i=this,o=arguments,a=function(){r=null,n||t.apply(i,o)},s=n&&!r;clearTimeout(r),r=setTimeout(a,e),s&&t.apply(i,o)}}var bz=5;function xz(t,e){if(Object.hasOwn)return Object.hasOwn(t,e);if(t==null)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(t),e)}function mE(t,e,n,r){n=n||0,r=r||bz;for(var i in e)if(xz(e,i)){var o=e[i];o!==null&&Ua(o)?(Ua(t[i])||(t[i]={}),n<r?mE(t[i],o,n+1,r):t[i]=e[i]):Bo(o)?(t[i]=[],t[i]=t[i].concat(o)):o!==void 0&&(t[i]=o)}}var wz=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)mE(t,e[r]);return t};const Z=wz;var Gy=function(t,e){if(t===e)return!0;if(!t||!e||Wy(t)||Wy(e))return!1;if(ph(t)||ph(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;r<t.length&&(n=Gy(t[r],e[r]),!!n);r++);return n}if(Yy(t)||Yy(e)){var i=Object.keys(t),o=Object.keys(e);if(i.length!==o.length)return!1;for(var n=!0,r=0;r<i.length&&(n=Gy(t[i[r]],e[i[r]]),!!n);r++);return n}return!1};const Oz=Gy,Un=function(t,e,n){for(var r=0,i=Wy(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return t===void 0||r<i.length?n:t};var _z=Object.prototype.hasOwnProperty;const Sz=function(t,e){if(t===null||!Ua(t))return{};var n={};return zy(e,function(r){_z.call(t,r)&&(n[r]=t[r])}),n},bE=function(t,e){return pz(t,function(n,r,i){return e.includes(i)||(n[i]=r),n},{})},Xa=function(t,e,n){var r,i,o,a,s=0;n||(n={});var l=function(){s=n.leading===!1?0:Date.now(),r=null,a=t.apply(i,o),r||(i=o=null)},c=function(){var u=Date.now();!s&&n.leading===!1&&(s=u);var f=e-(u-s);return i=this,o=arguments,f<=0||f>e?(r&&(clearTimeout(r),r=null),s=u,a=t.apply(i,o),r||(i=o=null)):!r&&n.trailing!==!1&&(r=setTimeout(l,f)),a};return c.cancel=function(){clearTimeout(r),s=0,r=i=o=null},c};function xE(t){return By(t)?0:ph(t)?t.length:Object.keys(t).length}var be=1e-6,Re=typeof Float32Array!="undefined"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});function ll(){var t=new Re(9);return Re!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function Ez(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function Mz(t){var e=new Re(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function Pz(t,e,n,r,i,o,a,s,l){var c=new Re(9);return c[0]=t,c[1]=e,c[2]=n,c[3]=r,c[4]=i,c[5]=o,c[6]=a,c[7]=s,c[8]=l,c}function Az(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],f=u*a-s*c,d=-u*o+s*l,h=c*o-a*l,p=n*f+r*d+i*h;return p?(p=1/p,t[0]=f*p,t[1]=(-u*r+i*c)*p,t[2]=(s*r-i*a)*p,t[3]=d*p,t[4]=(u*n-i*l)*p,t[5]=(-s*n+i*o)*p,t[6]=h*p,t[7]=(-c*n+r*l)*p,t[8]=(a*n-r*o)*p,t):null}function Cz(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],f=e[8],d=n[0],h=n[1],p=n[2],v=n[3],g=n[4],y=n[5],m=n[6],b=n[7],x=n[8];return t[0]=d*r+h*a+p*c,t[1]=d*i+h*s+p*u,t[2]=d*o+h*l+p*f,t[3]=v*r+g*a+y*c,t[4]=v*i+g*s+y*u,t[5]=v*o+g*l+y*f,t[6]=m*r+b*a+x*c,t[7]=m*i+b*s+x*u,t[8]=m*o+b*l+x*f,t}function Tz(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function kz(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Lz(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}var Nz=Cz;function Kt(){var t=new Re(16);return Re!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function Hy(t){var e=new Re(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function qa(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Iz(t,e,n,r,i,o,a,s,l,c,u,f,d,h,p,v){var g=new Re(16);return g[0]=t,g[1]=e,g[2]=n,g[3]=r,g[4]=i,g[5]=o,g[6]=a,g[7]=s,g[8]=l,g[9]=c,g[10]=u,g[11]=f,g[12]=d,g[13]=h,g[14]=p,g[15]=v,g}function Uy(t,e,n,r,i,o,a,s,l,c,u,f,d,h,p,v,g){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=l,t[8]=c,t[9]=u,t[10]=f,t[11]=d,t[12]=h,t[13]=p,t[14]=v,t[15]=g,t}function pu(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function wE(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function oi(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],f=e[9],d=e[10],h=e[11],p=e[12],v=e[13],g=e[14],y=e[15],m=n*s-r*a,b=n*l-i*a,x=n*c-o*a,w=r*l-i*s,O=r*c-o*s,_=i*c-o*l,S=u*v-f*p,E=u*g-d*p,M=u*y-h*p,P=f*g-d*v,C=f*y-h*v,A=d*y-h*g,T=m*A-b*C+x*P+w*M-O*E+_*S;return T?(T=1/T,t[0]=(s*A-l*C+c*P)*T,t[1]=(i*C-r*A-o*P)*T,t[2]=(v*_-g*O+y*w)*T,t[3]=(d*O-f*_-h*w)*T,t[4]=(l*M-a*A-c*E)*T,t[5]=(n*A-i*M+o*E)*T,t[6]=(g*x-p*_-y*b)*T,t[7]=(u*_-d*x+h*b)*T,t[8]=(a*C-s*M+c*S)*T,t[9]=(r*M-n*C-o*S)*T,t[10]=(p*O-v*x+y*m)*T,t[11]=(f*x-u*O-h*m)*T,t[12]=(s*E-a*P-l*S)*T,t[13]=(n*P-r*E+i*S)*T,t[14]=(v*b-p*w-g*m)*T,t[15]=(u*w-f*b+d*m)*T,t):null}function jz(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],f=e[9],d=e[10],h=e[11],p=e[12],v=e[13],g=e[14],y=e[15];return t[0]=s*(d*y-h*g)-f*(l*y-c*g)+v*(l*h-c*d),t[1]=-(r*(d*y-h*g)-f*(i*y-o*g)+v*(i*h-o*d)),t[2]=r*(l*y-c*g)-s*(i*y-o*g)+v*(i*c-o*l),t[3]=-(r*(l*h-c*d)-s*(i*h-o*d)+f*(i*c-o*l)),t[4]=-(a*(d*y-h*g)-u*(l*y-c*g)+p*(l*h-c*d)),t[5]=n*(d*y-h*g)-u*(i*y-o*g)+p*(i*h-o*d),t[6]=-(n*(l*y-c*g)-a*(i*y-o*g)+p*(i*c-o*l)),t[7]=n*(l*h-c*d)-a*(i*h-o*d)+u*(i*c-o*l),t[8]=a*(f*y-h*v)-u*(s*y-c*v)+p*(s*h-c*f),t[9]=-(n*(f*y-h*v)-u*(r*y-o*v)+p*(r*h-o*f)),t[10]=n*(s*y-c*v)-a*(r*y-o*v)+p*(r*c-o*s),t[11]=-(n*(s*h-c*f)-a*(r*h-o*f)+u*(r*c-o*s)),t[12]=-(a*(f*g-d*v)-u*(s*g-l*v)+p*(s*d-l*f)),t[13]=n*(f*g-d*v)-u*(r*g-i*v)+p*(r*d-i*f),t[14]=-(n*(s*g-l*v)-a*(r*g-i*v)+p*(r*l-i*s)),t[15]=n*(s*d-l*f)-a*(r*d-i*f)+u*(r*l-i*s),t}function OE(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],l=t[7],c=t[8],u=t[9],f=t[10],d=t[11],h=t[12],p=t[13],v=t[14],g=t[15],y=e*a-n*o,m=e*s-r*o,b=e*l-i*o,x=n*s-r*a,w=n*l-i*a,O=r*l-i*s,_=c*p-u*h,S=c*v-f*h,E=c*g-d*h,M=u*v-f*p,P=u*g-d*p,C=f*g-d*v;return y*C-m*P+b*M+x*E-w*S+O*_}function On(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],f=e[8],d=e[9],h=e[10],p=e[11],v=e[12],g=e[13],y=e[14],m=e[15],b=n[0],x=n[1],w=n[2],O=n[3];return t[0]=b*r+x*s+w*f+O*v,t[1]=b*i+x*l+w*d+O*g,t[2]=b*o+x*c+w*h+O*y,t[3]=b*a+x*u+w*p+O*m,b=n[4],x=n[5],w=n[6],O=n[7],t[4]=b*r+x*s+w*f+O*v,t[5]=b*i+x*l+w*d+O*g,t[6]=b*o+x*c+w*h+O*y,t[7]=b*a+x*u+w*p+O*m,b=n[8],x=n[9],w=n[10],O=n[11],t[8]=b*r+x*s+w*f+O*v,t[9]=b*i+x*l+w*d+O*g,t[10]=b*o+x*c+w*h+O*y,t[11]=b*a+x*u+w*p+O*m,b=n[12],x=n[13],w=n[14],O=n[15],t[12]=b*r+x*s+w*f+O*v,t[13]=b*i+x*l+w*d+O*g,t[14]=b*o+x*c+w*h+O*y,t[15]=b*a+x*u+w*p+O*m,t}function Yo(t,e,n){var r=n[0],i=n[1],o=n[2],a,s,l,c,u,f,d,h,p,v,g,y;return e===t?(t[12]=e[0]*r+e[4]*i+e[8]*o+e[12],t[13]=e[1]*r+e[5]*i+e[9]*o+e[13],t[14]=e[2]*r+e[6]*i+e[10]*o+e[14],t[15]=e[3]*r+e[7]*i+e[11]*o+e[15]):(a=e[0],s=e[1],l=e[2],c=e[3],u=e[4],f=e[5],d=e[6],h=e[7],p=e[8],v=e[9],g=e[10],y=e[11],t[0]=a,t[1]=s,t[2]=l,t[3]=c,t[4]=u,t[5]=f,t[6]=d,t[7]=h,t[8]=p,t[9]=v,t[10]=g,t[11]=y,t[12]=a*r+u*i+p*o+e[12],t[13]=s*r+f*i+v*o+e[13],t[14]=l*r+d*i+g*o+e[14],t[15]=c*r+h*i+y*o+e[15]),t}function gh(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Dz(t,e,n,r){var i=r[0],o=r[1],a=r[2],s=Math.hypot(i,o,a),l,c,u,f,d,h,p,v,g,y,m,b,x,w,O,_,S,E,M,P,C,A,T,k;return s<be?null:(s=1/s,i*=s,o*=s,a*=s,l=Math.sin(n),c=Math.cos(n),u=1-c,f=e[0],d=e[1],h=e[2],p=e[3],v=e[4],g=e[5],y=e[6],m=e[7],b=e[8],x=e[9],w=e[10],O=e[11],_=i*i*u+c,S=o*i*u+a*l,E=a*i*u-o*l,M=i*o*u-a*l,P=o*o*u+c,C=a*o*u+i*l,A=i*a*u+o*l,T=o*a*u-i*l,k=a*a*u+c,t[0]=f*_+v*S+b*E,t[1]=d*_+g*S+x*E,t[2]=h*_+y*S+w*E,t[3]=p*_+m*S+O*E,t[4]=f*M+v*P+b*C,t[5]=d*M+g*P+x*C,t[6]=h*M+y*P+w*C,t[7]=p*M+m*P+O*C,t[8]=f*A+v*T+b*k,t[9]=d*A+g*T+x*k,t[10]=h*A+y*T+w*k,t[11]=p*A+m*T+O*k,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function _E(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],l=e[7],c=e[8],u=e[9],f=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+c*r,t[5]=a*i+u*r,t[6]=s*i+f*r,t[7]=l*i+d*r,t[8]=c*i-o*r,t[9]=u*i-a*r,t[10]=f*i-s*r,t[11]=d*i-l*r,t}function SE(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],l=e[3],c=e[8],u=e[9],f=e[10],d=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-c*r,t[1]=a*i-u*r,t[2]=s*i-f*r,t[3]=l*i-d*r,t[8]=o*r+c*i,t[9]=a*r+u*i,t[10]=s*r+f*i,t[11]=l*r+d*i,t}function $z(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],l=e[3],c=e[4],u=e[5],f=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+c*r,t[1]=a*i+u*r,t[2]=s*i+f*r,t[3]=l*i+d*r,t[4]=c*i-o*r,t[5]=u*i-a*r,t[6]=f*i-s*r,t[7]=d*i-l*r,t}function Vy(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function Xy(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Fz(t,e,n){var r=n[0],i=n[1],o=n[2],a=Math.hypot(r,i,o),s,l,c;return a<be?null:(a=1/a,r*=a,i*=a,o*=a,s=Math.sin(e),l=Math.cos(e),c=1-l,t[0]=r*r*c+l,t[1]=i*r*c+o*s,t[2]=o*r*c-i*s,t[3]=0,t[4]=r*i*c-o*s,t[5]=i*i*c+l,t[6]=o*i*c+r*s,t[7]=0,t[8]=r*o*c+i*s,t[9]=i*o*c-r*s,t[10]=o*o*c+l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function Rz(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Bz(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function zz(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function EE(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=r+r,l=i+i,c=o+o,u=r*s,f=r*l,d=r*c,h=i*l,p=i*c,v=o*c,g=a*s,y=a*l,m=a*c;return t[0]=1-(h+v),t[1]=f+m,t[2]=d-y,t[3]=0,t[4]=f-m,t[5]=1-(u+v),t[6]=p+g,t[7]=0,t[8]=d+y,t[9]=p-g,t[10]=1-(u+h),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function Yz(t,e){var n=new Re(3),r=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],f=r*r+i*i+o*o+a*a;return f>0?(n[0]=(s*a+u*r+l*o-c*i)*2/f,n[1]=(l*a+u*i+c*r-s*o)*2/f,n[2]=(c*a+u*o+s*i-l*r)*2/f):(n[0]=(s*a+u*r+l*o-c*i)*2,n[1]=(l*a+u*i+c*r-s*o)*2,n[2]=(c*a+u*o+s*i-l*r)*2),EE(t,e,n),t}function yh(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function cl(t,e){var n=e[0],r=e[1],i=e[2],o=e[4],a=e[5],s=e[6],l=e[8],c=e[9],u=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(l,c,u),t}function mh(t,e){var n=new Re(3);cl(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,s=e[1]*i,l=e[2]*o,c=e[4]*r,u=e[5]*i,f=e[6]*o,d=e[8]*r,h=e[9]*i,p=e[10]*o,v=a+u+p,g=0;return v>0?(g=Math.sqrt(v+1)*2,t[3]=.25*g,t[0]=(f-h)/g,t[1]=(d-l)/g,t[2]=(s-c)/g):a>u&&a>p?(g=Math.sqrt(1+a-u-p)*2,t[3]=(f-h)/g,t[0]=.25*g,t[1]=(s+c)/g,t[2]=(d+l)/g):u>p?(g=Math.sqrt(1+u-a-p)*2,t[3]=(d-l)/g,t[0]=(s+c)/g,t[1]=.25*g,t[2]=(f+h)/g):(g=Math.sqrt(1+p-a-u)*2,t[3]=(s-c)/g,t[0]=(d+l)/g,t[1]=(f+h)/g,t[2]=.25*g),t}function Wz(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],l=i+i,c=o+o,u=a+a,f=i*l,d=i*c,h=i*u,p=o*c,v=o*u,g=a*u,y=s*l,m=s*c,b=s*u,x=r[0],w=r[1],O=r[2];return t[0]=(1-(p+g))*x,t[1]=(d+b)*x,t[2]=(h-m)*x,t[3]=0,t[4]=(d-b)*w,t[5]=(1-(f+g))*w,t[6]=(v+y)*w,t[7]=0,t[8]=(h+m)*O,t[9]=(v-y)*O,t[10]=(1-(f+p))*O,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function vu(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],l=e[3],c=o+o,u=a+a,f=s+s,d=o*c,h=o*u,p=o*f,v=a*u,g=a*f,y=s*f,m=l*c,b=l*u,x=l*f,w=r[0],O=r[1],_=r[2],S=i[0],E=i[1],M=i[2],P=(1-(v+y))*w,C=(h+x)*w,A=(p-b)*w,T=(h-x)*O,k=(1-(d+y))*O,N=(g+m)*O,j=(p+b)*_,L=(g-m)*_,I=(1-(d+v))*_;return t[0]=P,t[1]=C,t[2]=A,t[3]=0,t[4]=T,t[5]=k,t[6]=N,t[7]=0,t[8]=j,t[9]=L,t[10]=I,t[11]=0,t[12]=n[0]+S-(P*S+T*E+j*M),t[13]=n[1]+E-(C*S+k*E+L*M),t[14]=n[2]+M-(A*S+N*E+I*M),t[15]=1,t}function qy(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,l=i+i,c=n*a,u=r*a,f=r*s,d=i*a,h=i*s,p=i*l,v=o*a,g=o*s,y=o*l;return t[0]=1-f-p,t[1]=u+y,t[2]=d-g,t[3]=0,t[4]=u-y,t[5]=1-c-p,t[6]=h+v,t[7]=0,t[8]=d+g,t[9]=h-v,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Gz(t,e,n,r,i,o,a){var s=1/(n-e),l=1/(i-r),c=1/(o-a);return t[0]=o*2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o*2*l,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*l,t[10]=(a+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*c,t[15]=0,t}function ME(t,e,n,r,i){var o=1/Math.tan(e/2),a;return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,i!=null&&i!==1/0?(a=1/(r-i),t[10]=(i+r)*a,t[14]=2*i*r*a):(t[10]=-1,t[14]=-2*r),t}var Hz=ME;function Uz(t,e,n,r,i){var o=1/Math.tan(e/2),a;return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,i!=null&&i!==1/0?(a=1/(r-i),t[10]=i*a,t[14]=i*r*a):(t[10]=-1,t[14]=-r),t}function Vz(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(a+s),c=2/(i+o);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-((a-s)*l*.5),t[9]=(i-o)*c*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t}function PE(t,e,n,r,i,o,a){var s=1/(e-n),l=1/(r-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*l,t[14]=(a+o)*c,t[15]=1,t}var AE=PE;function CE(t,e,n,r,i,o,a){var s=1/(e-n),l=1/(r-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*l,t[14]=o*c,t[15]=1,t}function TE(t,e,n,r){var i,o,a,s,l,c,u,f,d,h,p=e[0],v=e[1],g=e[2],y=r[0],m=r[1],b=r[2],x=n[0],w=n[1],O=n[2];return Math.abs(p-x)<be&&Math.abs(v-w)<be&&Math.abs(g-O)<be?pu(t):(u=p-x,f=v-w,d=g-O,h=1/Math.hypot(u,f,d),u*=h,f*=h,d*=h,i=m*d-b*f,o=b*u-y*d,a=y*f-m*u,h=Math.hypot(i,o,a),h?(h=1/h,i*=h,o*=h,a*=h):(i=0,o=0,a=0),s=f*a-d*o,l=d*i-u*a,c=u*o-f*i,h=Math.hypot(s,l,c),h?(h=1/h,s*=h,l*=h,c*=h):(s=0,l=0,c=0),t[0]=i,t[1]=s,t[2]=u,t[3]=0,t[4]=o,t[5]=l,t[6]=f,t[7]=0,t[8]=a,t[9]=c,t[10]=d,t[11]=0,t[12]=-(i*p+o*v+a*g),t[13]=-(s*p+l*v+c*g),t[14]=-(u*p+f*v+d*g),t[15]=1,t)}function Xz(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=r[0],l=r[1],c=r[2],u=i-n[0],f=o-n[1],d=a-n[2],h=u*u+f*f+d*d;h>0&&(h=1/Math.sqrt(h),u*=h,f*=h,d*=h);var p=l*d-c*f,v=c*u-s*d,g=s*f-l*u;return h=p*p+v*v+g*g,h>0&&(h=1/Math.sqrt(h),p*=h,v*=h,g*=h),t[0]=p,t[1]=v,t[2]=g,t[3]=0,t[4]=f*g-d*v,t[5]=d*p-u*g,t[6]=u*v-f*p,t[7]=0,t[8]=u,t[9]=f,t[10]=d,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t}function qz(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function Kz(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Zz(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t}function kE(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}function Qz(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t}function Jz(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t}function tY(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function eY(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],f=t[9],d=t[10],h=t[11],p=t[12],v=t[13],g=t[14],y=t[15],m=e[0],b=e[1],x=e[2],w=e[3],O=e[4],_=e[5],S=e[6],E=e[7],M=e[8],P=e[9],C=e[10],A=e[11],T=e[12],k=e[13],N=e[14],j=e[15];return Math.abs(n-m)<=be*Math.max(1,Math.abs(n),Math.abs(m))&&Math.abs(r-b)<=be*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-x)<=be*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(o-w)<=be*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(a-O)<=be*Math.max(1,Math.abs(a),Math.abs(O))&&Math.abs(s-_)<=be*Math.max(1,Math.abs(s),Math.abs(_))&&Math.abs(l-S)<=be*Math.max(1,Math.abs(l),Math.abs(S))&&Math.abs(c-E)<=be*Math.max(1,Math.abs(c),Math.abs(E))&&Math.abs(u-M)<=be*Math.max(1,Math.abs(u),Math.abs(M))&&Math.abs(f-P)<=be*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(d-C)<=be*Math.max(1,Math.abs(d),Math.abs(C))&&Math.abs(h-A)<=be*Math.max(1,Math.abs(h),Math.abs(A))&&Math.abs(p-T)<=be*Math.max(1,Math.abs(p),Math.abs(T))&&Math.abs(v-k)<=be*Math.max(1,Math.abs(v),Math.abs(k))&&Math.abs(g-N)<=be*Math.max(1,Math.abs(g),Math.abs(N))&&Math.abs(y-j)<=be*Math.max(1,Math.abs(y),Math.abs(j))}var LE=On,nY=kE;const rY=Object.freeze(Object.defineProperty({__proto__:null,add:Zz,adjoint:jz,clone:Hy,copy:qa,create:Kt,determinant:OE,equals:eY,exactEquals:tY,frob:Kz,fromQuat:qy,fromQuat2:Yz,fromRotation:Fz,fromRotationTranslation:EE,fromRotationTranslationScale:Wz,fromRotationTranslationScaleOrigin:vu,fromScaling:Xy,fromTranslation:Vy,fromValues:Iz,fromXRotation:Rz,fromYRotation:Bz,fromZRotation:zz,frustum:Gz,getRotation:mh,getScaling:cl,getTranslation:yh,identity:pu,invert:oi,lookAt:TE,mul:LE,multiply:On,multiplyScalar:Qz,multiplyScalarAndAdd:Jz,ortho:AE,orthoNO:PE,orthoZO:CE,perspective:Hz,perspectiveFromFieldOfView:Vz,perspectiveNO:ME,perspectiveZO:Uz,rotate:Dz,rotateX:_E,rotateY:SE,rotateZ:$z,scale:gh,set:Uy,str:qz,sub:nY,subtract:kE,targetTo:Xz,translate:Yo,transpose:wE},Symbol.toStringTag,{value:"Module"}));function Ct(){var t=new Re(3);return Re!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function to(t){var e=new Re(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function eo(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function jt(t,e,n){var r=new Re(3);return r[0]=t,r[1]=e,r[2]=n,r}function Vn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function ai(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function ul(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function NE(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function iY(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function Ky(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function oY(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.hypot(n,r,i)}function Ka(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function Pi(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function bh(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],l=n[2];return t[0]=i*l-o*s,t[1]=o*a-r*l,t[2]=r*s-i*a,t}function Zy(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}function Qe(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function IE(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t}function aY(t,e,n){var r=n[0],i=n[1],o=n[2],a=n[3],s=e[0],l=e[1],c=e[2],u=i*c-o*l,f=o*s-r*c,d=r*l-i*s,h=i*d-o*f,p=o*u-r*d,v=r*f-i*u,g=a*2;return u*=g,f*=g,d*=g,h*=2,p*=2,v*=2,t[0]=s+u+h,t[1]=l+f+p,t[2]=c+d+v,t}function gu(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2];return Math.abs(n-o)<=be*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=be*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=be*Math.max(1,Math.abs(i),Math.abs(s))}var jE=oY,DE=eo;(function(){var t=Ct();return function(e,n,r,i,o,a){var s,l;for(n||(n=3),r||(r=0),i?l=Math.min(i*n+r,e.length):l=e.length,s=r;s<l;s+=n)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],o(t,t,a),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2];return e}})();function fl(){var t=new Re(4);return Re!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function sY(t,e,n,r){var i=new Re(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function lY(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function cY(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t}function dl(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}(function(){var t=fl();return function(e,n,r,i,o,a){var s,l;for(n||(n=4),r||(r=0),i?l=Math.min(i*n+r,e.length):l=e.length,s=r;s<l;s+=n)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],t[3]=e[s+3],o(t,t,a),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2],e[s+3]=t[3];return e}})();function Ge(){var t=new Re(4);return Re!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Wo(t,e,n){n=n*.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function Go(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],l=n[1],c=n[2],u=n[3];return t[0]=r*u+a*s+i*c-o*l,t[1]=i*u+a*l+o*s-r*c,t[2]=o*u+a*c+r*l-i*s,t[3]=a*u-r*s-i*l-o*c,t}function Qy(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],l=n[0],c=n[1],u=n[2],f=n[3],d,h,p,v,g;return h=i*l+o*c+a*u+s*f,h<0&&(h=-h,l=-l,c=-c,u=-u,f=-f),1-h>be?(d=Math.acos(h),p=Math.sin(d),v=Math.sin((1-r)*d)/p,g=Math.sin(r*d)/p):(v=1-r,g=r),t[0]=v*i+g*l,t[1]=v*o+g*c,t[2]=v*a+g*u,t[3]=v*s+g*f,t}function Jy(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,t}function uY(t,e){var n=e[0]+e[4]+e[8],r;if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[i*3+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;r=Math.sqrt(e[i*3+i]-e[o*3+o]-e[a*3+a]+1),t[i]=.5*r,r=.5/r,t[3]=(e[o*3+a]-e[a*3+o])*r,t[o]=(e[o*3+i]+e[i*3+o])*r,t[a]=(e[a*3+i]+e[i*3+a])*r}return t}function xh(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var o=Math.sin(e),a=Math.cos(e),s=Math.sin(n),l=Math.cos(n),c=Math.sin(r),u=Math.cos(r);return t[0]=o*l*u-a*s*c,t[1]=a*s*u+o*l*c,t[2]=a*l*c-o*s*u,t[3]=a*l*u+o*s*c,t}var tm=sY,wh=lY,$E=Go,Oh=cY;(function(){var t=Ct(),e=jt(1,0,0),n=jt(0,1,0);return function(r,i,o){var a=Pi(i,o);return a<-.999999?(bh(t,e,i),DE(t)<1e-6&&bh(t,n,i),Ka(t,t),Wo(r,t,Math.PI),r):a>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(bh(t,i,o),r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=1+a,Oh(r,r))}})(),function(){var t=Ge(),e=Ge();return function(n,r,i,o,a,s){return Qy(t,r,a,s),Qy(e,i,o,s),Qy(n,t,e,2*s*(1-s)),n}}(),function(){var t=ll();return function(e,n,r,i){return t[0]=r[0],t[3]=r[1],t[6]=r[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-n[0],t[5]=-n[1],t[8]=-n[2],Oh(e,uY(e,t))}}();function fY(){var t=new Re(2);return Re!=Float32Array&&(t[0]=0,t[1]=0),t}function dY(t,e){var n=new Re(2);return n[0]=t,n[1]=e,n}function hY(t,e){return t[0]=e[0],t[1]=e[1],t}function pY(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function vY(t,e){return t[0]*e[0]+t[1]*e[1]}function gY(t,e){return t[0]===e[0]&&t[1]===e[1]}(function(){var t=fY();return function(e,n,r,i,o,a){var s,l;for(n||(n=2),r||(r=0),i?l=Math.min(i*n+r,e.length):l=e.length,s=r;s<l;s+=n)t[0]=e[s],t[1]=e[s+1],o(t,t,a),e[s]=t[0],e[s+1]=t[1];return e}})();var em=function(t,e){return em=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},em(t,e)};function st(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");em(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var G=function(){return G=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},G.apply(this,arguments)};function Qt(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function hl(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?o(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})}function pl(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=e.call(t,n)}catch(u){c=[6,u],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function ur(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function D(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function nm(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var r=Array(t),i=0,e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}function Q(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}function rm(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)}typeof SuppressedError=="function"&&SuppressedError;function le(t,e){if(t!==null)return{type:"column",value:t,field:e}}function _h(t,e){const n=le(t,e);return Object.assign(Object.assign({},n),{inferred:!0})}function Sh(t,e){if(t!==null)return{type:"column",value:t,field:e,visual:!0}}function yY(t,e){const n=le(t,e);return Object.assign(Object.assign({},n),{constant:!1})}function Ho(t,e){const n=[];for(const r of t)n[r]=e;return n}function It(t,e){const n=t[e];if(!n)return[null,null];const{value:r,field:i=null}=n;return[r,i]}function yu(t,...e){for(const n of e)if(typeof n=="string"){const[r,i]=It(t,n);if(r!==null)return[r,i]}else return[n,null];return[null,null]}function mu(t){return t instanceof Date?!1:typeof t=="object"}const bu=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;return r!==void 0?[t,e]:[t,Z({},e,{encode:{y1:_h(Ho(t,0))}})]};bu.props={};function Te(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function mY(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function vl(t){let e,n,r;t.length!==2?(e=Te,n=(s,l)=>Te(t(s),l),r=(s,l)=>t(s)-l):(e=t===Te||t===mY?t:bY,n=t,r=t);function i(s,l,c=0,u=s.length){if(c<u){if(e(l,l)!==0)return u;do{const f=c+u>>>1;n(s[f],l)<0?c=f+1:u=f}while(c<u)}return c}function o(s,l,c=0,u=s.length){if(c<u){if(e(l,l)!==0)return u;do{const f=c+u>>>1;n(s[f],l)<=0?c=f+1:u=f}while(c<u)}return c}function a(s,l,c=0,u=s.length){const f=i(s,l,c,u-1);return f>c&&r(s[f-1],l)>-r(s[f],l)?f-1:f}return{left:i,center:a,right:o}}function bY(){return 0}function im(t){return t===null?NaN:+t}function*xY(t,e){if(e===void 0)for(let n of t)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of t)(r=e(r,++n,t))!=null&&(r=+r)>=r&&(yield r)}}const FE=vl(Te),wY=FE.right,OY=FE.left,_Y=vl(im).center,SY=wY;function RE(t,e){let n=0;if(e===void 0)for(let r of t)r!=null&&(r=+r)>=r&&++n;else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(i=+i)>=i&&++n}return n}function EY(t,e){let n=0,r,i=0,o=0;if(e===void 0)for(let a of t)a!=null&&(a=+a)>=a&&(r=a-i,i+=r/++n,o+=r*(a-i));else{let a=-1;for(let s of t)(s=e(s,++a,t))!=null&&(s=+s)>=s&&(r=s-i,i+=r/++n,o+=r*(s-i))}if(n>1)return o/(n-1)}function BE(t,e){const n=EY(t,e);return n&&Math.sqrt(n)}function no(t,e){let n,r;if(e===void 0)for(const i of t)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)));else{let i=-1;for(let o of t)(o=e(o,++i,t))!=null&&(n===void 0?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)))}return[n,r]}class Za{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){const n=this._partials;let r=0;for(let i=0;i<this._n&&i<32;i++){const o=n[i],a=e+o,s=Math.abs(e)<Math.abs(o)?e-(a-o):o-(a-e);s&&(n[r++]=s),e=a}return n[r]=e,this._n=r+1,this}valueOf(){const e=this._partials;let n=this._n,r,i,o,a=0;if(n>0){for(a=e[--n];n>0&&(r=a,i=e[--n],a=r+i,o=i-(a-r),!o););n>0&&(o<0&&e[n-1]<0||o>0&&e[n-1]>0)&&(i=o*2,r=a+i,i==r-a&&(a=r))}return a}}let MY=class extends Map{constructor(e,n=CY){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[r,i]of e)this.set(r,i)}get(e){return super.get(zE(this,e))}has(e){return super.has(zE(this,e))}set(e,n){return super.set(PY(this,e),n)}delete(e){return super.delete(AY(this,e))}};function zE({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function PY({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function AY({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function CY(t){return t!==null&&typeof t=="object"?t.valueOf():t}function xu(t){return t}function xe(t,...e){return Eh(t,xu,xu,e)}function om(t,...e){return Eh(t,Array.from,xu,e)}function am(t,e,...n){return Eh(t,xu,e,n)}function YE(t,e,...n){return Eh(t,Array.from,e,n)}function Eh(t,e,n,r){return function i(o,a){if(a>=r.length)return n(o);const s=new MY,l=r[a++];let c=-1;for(const u of o){const f=l(u,++c,o),d=s.get(f);d?d.push(u):s.set(f,[u])}for(const[u,f]of s)s.set(u,i(f,a));return e(s)}(t,0)}function TY(t,e){return Array.from(e,n=>t[n])}function ro(t,...e){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&n.length!==2||e.length>1){const r=Uint32Array.from(t,(i,o)=>o);return e.length>1?(e=e.map(i=>t.map(i)),r.sort((i,o)=>{for(const a of e){const s=wu(a[i],a[o]);if(s)return s}})):(n=t.map(n),r.sort((i,o)=>wu(n[i],n[o]))),TY(t,r)}return t.sort(WE(n))}function WE(t=Te){if(t===Te)return wu;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||r===0?r:(t(n,n)===0)-(t(e,e)===0)}}function wu(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(t<e?-1:t>e?1:0)}function kY(t,e,n){return(e.length!==2?ro(am(t,e,n),([r,i],[o,a])=>Te(i,a)||Te(r,o)):ro(xe(t,n),([r,i],[o,a])=>e(i,a)||Te(r,o))).map(([r])=>r)}var LY=Array.prototype,NY=LY.slice;function sm(t){return()=>t}const IY=Math.sqrt(50),jY=Math.sqrt(10),DY=Math.sqrt(2);function Mh(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=IY?10:o>=jY?5:o>=DY?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/a,s=Math.round(t*c),l=Math.round(e*c),s/c<t&&++s,l/c>e&&--l,c=-c):(c=Math.pow(10,i)*a,s=Math.round(t/c),l=Math.round(e/c),s*c<t&&++s,l*c>e&&--l),l<s&&.5<=n&&n<2?Mh(t,e,n*2):[s,l,c]}function $Y(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const r=e<t,[i,o,a]=r?Mh(e,t,n):Mh(t,e,n);if(!(o>=i))return[];const s=o-i+1,l=new Array(s);if(r)if(a<0)for(let c=0;c<s;++c)l[c]=(o-c)/-a;else for(let c=0;c<s;++c)l[c]=(o-c)*a;else if(a<0)for(let c=0;c<s;++c)l[c]=(i+c)/-a;else for(let c=0;c<s;++c)l[c]=(i+c)*a;return l}function lm(t,e,n){return e=+e,t=+t,n=+n,Mh(t,e,n)[2]}function FY(t,e,n){let r;for(;;){const i=lm(t,e,n);if(i===r||i===0||!isFinite(i))return[t,e];i>0?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),r=i}}function RY(t){return Math.max(1,Math.ceil(Math.log(RE(t))/Math.LN2)+1)}function BY(){var t=xu,e=no,n=RY;function r(i){Array.isArray(i)||(i=Array.from(i));var o,a=i.length,s,l,c=new Array(a);for(o=0;o<a;++o)c[o]=t(i[o],o,i);var u=e(c),f=u[0],d=u[1],h=n(c,f,d);if(!Array.isArray(h)){const b=d,x=+h;if(e===no&&([f,d]=FY(f,d,x)),h=$Y(f,d,x),h[0]<=f&&(l=lm(f,d,x)),h[h.length-1]>=d)if(b>=d&&e===no){const w=lm(f,d,x);isFinite(w)&&(w>0?d=(Math.floor(d/w)+1)*w:w<0&&(d=(Math.ceil(d*-w)+1)/-w))}else h.pop()}for(var p=h.length,v=0,g=p;h[v]<=f;)++v;for(;h[g-1]>d;)--g;(v||g<p)&&(h=h.slice(v,g),p=g-v);var y=new Array(p+1),m;for(o=0;o<=p;++o)m=y[o]=[],m.x0=o>0?h[o-1]:f,m.x1=o<p?h[o]:d;if(isFinite(l)){if(l>0)for(o=0;o<a;++o)(s=c[o])!=null&&f<=s&&s<=d&&y[Math.min(p,Math.floor((s-f)/l))].push(i[o]);else if(l<0){for(o=0;o<a;++o)if((s=c[o])!=null&&f<=s&&s<=d){const b=Math.floor((f-s)*l);y[Math.min(p,b+(h[b]<=s))].push(i[o])}}}else for(o=0;o<a;++o)(s=c[o])!=null&&f<=s&&s<=d&&y[SY(h,s,0,p)].push(i[o]);return y}return r.value=function(i){return arguments.length?(t=typeof i=="function"?i:sm(i),r):t},r.domain=function(i){return arguments.length?(e=typeof i=="function"?i:sm([i[0],i[1]]),r):e},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:sm(Array.isArray(i)?NY.call(i):i),r):n},r}function Gt(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function gl(t,e){let n,r=-1,i=-1;if(e===void 0)for(const o of t)++i,o!=null&&(n<o||n===void 0&&o>=o)&&(n=o,r=i);else for(let o of t)(o=e(o,++i,t))!=null&&(n<o||n===void 0&&o>=o)&&(n=o,r=i);return r}function fr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function Ph(t,e){let n,r=-1,i=-1;if(e===void 0)for(const o of t)++i,o!=null&&(n>o||n===void 0&&o>=o)&&(n=o,r=i);else for(let o of t)(o=e(o,++i,t))!=null&&(n>o||n===void 0&&o>=o)&&(n=o,r=i);return r}function cm(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=i===void 0?wu:WE(i);r>n;){if(r-n>600){const l=r-n+1,c=e-n+1,u=Math.log(l),f=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1),h=Math.max(n,Math.floor(e-c*f/l+d)),p=Math.min(r,Math.floor(e+(l-c)*f/l+d));cm(t,e,h,p,i)}const o=t[e];let a=n,s=r;for(Ou(t,n,e),i(t[r],o)>0&&Ou(t,n,r);a<s;){for(Ou(t,a,s),++a,--s;i(t[a],o)<0;)++a;for(;i(t[s],o)>0;)--s}i(t[n],o)===0?Ou(t,n,s):(++s,Ou(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function Ou(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function zY(t,e=Te){let n,r=!1;if(e.length===1){let i;for(const o of t){const a=e(o);(r?Te(a,i)>0:Te(a,a)===0)&&(n=o,i=a,r=!0)}}else for(const i of t)(r?e(i,n)>0:e(i,i)===0)&&(n=i,r=!0);return n}function Ah(t,e,n){if(t=Float64Array.from(xY(t,n)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return fr(t);if(e>=1)return Gt(t);var r,i=(r-1)*e,o=Math.floor(i),a=Gt(cm(t,o).subarray(0,o+1)),s=fr(t.subarray(o+1));return a+(s-a)*(i-o)}}function YY(t,e,n=im){if(!isNaN(e=+e)){if(r=Float64Array.from(t,(s,l)=>im(n(t[l],l,t))),e<=0)return Ph(r);if(e>=1)return gl(r);var r,i=Uint32Array.from(t,(s,l)=>l),o=r.length-1,a=Math.floor(o*e);return cm(i,a,0,o,(s,l)=>wu(r[s],r[l])),a=zY(i.subarray(0,a+1),s=>r[s]),a>=0?a:-1}}function WY(t,e,n){const r=RE(t),i=BE(t);return r&&i?Math.ceil((n-e)*Math.cbrt(r)/(3.49*i)):1}function _u(t,e){let n=0,r=0;if(e===void 0)for(let i of t)i!=null&&(i=+i)>=i&&(++n,r+=i);else{let i=-1;for(let o of t)(o=e(o,++i,t))!=null&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function um(t,e){return Ah(t,.5,e)}function GY(t,e){return YY(t,.5,e)}function*HY(t){for(const e of t)yield*iB(e)}function GE(t){return Array.from(HY(t))}function yl(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,o=new Array(i);++r<i;)o[r]=t+r*n;return o}function kr(t,e){let n=0;if(e===void 0)for(let r of t)(r=+r)&&(n+=r);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}var UY=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?o(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})};function Qa(t){return t}function fm(t){return t.reduce((e,n)=>(r,...i)=>n(e(r,...i),...i),Qa)}function VY(t){return t.reduce((e,n)=>r=>UY(this,void 0,void 0,function*(){const i=yield e(r);return n(i)}),Qa)}function dm(t){return t.replace(/( |^)[a-z]/g,e=>e.toUpperCase())}function ml(t=""){throw new Error(t)}function hm(t,e){const{attributes:n}=e,r=new Set(["id","className"]);for(const[i,o]of Object.entries(n))r.has(i)||(i==="transform"&&t.attr(i,""),t.attr(i,o))}function ie(t){return t!=null&&!Number.isNaN(t)}function XY(t){const e=new Map;return n=>{if(e.has(n))return e.get(n);const r=t(n);return e.set(n,r),r}}function qY(t,e){const{transform:n}=t.style,i=(o=>o==="none"||o===void 0)(n)?"":n;t.style.transform=`${i} ${e}`.trimStart()}function ot(t,e){return HE(t,e)||{}}function HE(t,e){const n=Object.entries(t||{}).filter(([r])=>r.startsWith(e)).map(([r,i])=>[yE(r.replace(e,"").trim()),i]).filter(([r])=>!!r);return n.length===0?null:Object.fromEntries(n)}function KY(t,e){return Object.fromEntries(Object.entries(t).filter(([n])=>e.find(r=>n.startsWith(r))))}function pm(t,...e){return Object.fromEntries(Object.entries(t).filter(([n])=>e.every(r=>!n.startsWith(r))))}function UE(t,e){if(t===void 0)return null;if(typeof t=="number")return t;const n=+t.replace("%","");return Number.isNaN(n)?null:n/100*e}function Su(t){return typeof t=="object"&&!(t instanceof Date)&&t!==null&&!Array.isArray(t)}function io(t){return t===null||t===!1}function VE(t,e,n=5,r=0){if(!(r>=n)){for(const i of Object.keys(e)){const o=e[i];!Ua(o)||!Ua(t[i])?t[i]=o:VE(t[i],o,n,r+1)}return t}}function Uo(t,e){return Object.entries(t).reduce((n,[r,i])=>(n[r]=e(i,r,t),n),{})}function Ja(t){return t.map((e,n)=>n)}function ZY(t){return t[0]}function XE(t){return t[t.length-1]}function QY(t){return Array.from(new Set(t))}function qE(t,e){const n=[[],[]];return t.forEach(r=>{n[e(r)?0:1].push(r)}),n}function KE(t,e=t.length){if(e===1)return t.map(r=>[r]);const n=[];for(let r=0;r<t.length;r++){const i=t.slice(r+1);KE(i,e-1).forEach(a=>{n.push([t[r],...a])})}return n}function JY(t){if(t.length===1)return[t];const e=[];for(let n=1;n<=t.length;n++)e.push(...KE(t,n));return e}function Vo(t,e,n){const{encode:r}=n;if(t===null)return[e];const i=tW(t).map(a=>{var s;return[a,(s=It(r,a))===null||s===void 0?void 0:s[0]]}).filter(([,a])=>ie(a)),o=a=>i.map(([,s])=>s[a]).join("-");return Array.from(xe(e,o).values())}function ZE(t){return Array.isArray(t)?rW(t):typeof t=="function"?nW(t):t==="series"?eW:t==="value"?iW:t==="sum"?oW:t==="maxIndex"?aW:()=>null}function QE(t,e){for(const n of t)n.sort(e)}function JE(t,e){return(e==null?void 0:e.domain)||Array.from(new Set(t))}function tW(t){return Array.isArray(t)?t:[t]}function eW(t,e,n){return Eu(r=>n[r])}function nW(t){return(e,n,r)=>Eu(i=>t(e[i]))}function rW(t){return(e,n,r)=>(i,o)=>t.reduce((a,s)=>a!==0?a:Te(e[i][s],e[o][s]),0)}function iW(t,e,n){return Eu(r=>e[r])}function oW(t,e,n){const r=Ja(t),i=Array.from(xe(r,a=>n[+a]).entries()),o=new Map(i.map(([a,s])=>[a,s.reduce((l,c)=>l+ +e[c])]));return Eu(a=>o.get(n[a]))}function aW(t,e,n){const r=Ja(t),i=Array.from(xe(r,a=>n[+a]).entries()),o=new Map(i.map(([a,s])=>[a,gl(s,l=>e[l])]));return Eu(a=>o.get(n[a]))}function Eu(t){return(e,n)=>Te(t(e),t(n))}const tM=(t={})=>{const{groupBy:e="x",orderBy:n=null,reverse:r=!1,y:i="y",y1:o="y1",series:a=!0}=t;return(s,l)=>{const{data:c,encode:u,style:f={}}=l,[d,h]=It(u,"y"),[p,v]=It(u,"y1"),[g]=a?yu(u,"series","color"):It(u,"color"),y=Vo(e,s,l),b=ZE(n)(c,d,g);b&&QE(y,b);const x=new Array(s.length),w=new Array(s.length),O=new Array(s.length),_=[],S=[];for(const A of y){r&&A.reverse();const T=p?+p[A[0]]:0,k=[],N=[];for(const B of A){const W=O[B]=+d[B]-T;W<0?N.push(B):W>=0&&k.push(B)}const j=k.length>0?k:N,L=N.length>0?N:k;let I=k.length-1,$=0;for(;I>0&&d[j[I]]===0;)I--;for(;$<L.length-1&&d[L[$]]===0;)$++;_.push(j[I]),S.push(L[$]);let F=T;for(const B of N.reverse()){const W=O[B];F=x[B]=(w[B]=F)+W}let R=T;for(const B of k){const W=O[B];W>0?R=x[B]=(w[B]=R)+W:x[B]=w[B]=R}}const E=new Set(_),M=new Set(S),P=i==="y"?x:w,C=o==="y"?x:w;return[s,Z({},l,{encode:{y0:_h(d,h),y:le(P,h),y1:le(C,v)},style:Object.assign({first:(A,T)=>E.has(T),last:(A,T)=>M.has(T)},f)})]}};tM.props={};function Mu(t){return Math.abs(t)>10?String(t):t.toString().padStart(2,"0")}function sW(t){const e=t.getFullYear(),n=Mu(t.getMonth()+1),r=Mu(t.getDate()),i=`${e}-${n}-${r}`,o=t.getHours(),a=t.getMinutes(),s=t.getSeconds();return o||a||s?`${i} ${Mu(o)}:${Mu(a)}:${Mu(s)}`:i}const Ch=(t={})=>{const{channel:e="x"}=t;return(n,r)=>{const{encode:i}=r,{tooltip:o}=r;if(io(o))return[n,r];const{title:a}=o;if(a!==void 0)return[n,r];const s=Object.keys(i).filter(c=>c.startsWith(e)).filter(c=>!i[c].inferred).map(c=>It(i,c)).filter(([c])=>c).map(c=>c[0]);if(s.length===0)return[n,r];const l=[];for(const c of n)l[c]={value:s.map(u=>u[c]instanceof Date?sW(u[c]):u[c]).join(", ")};return[n,Z({},r,{tooltip:{title:l}})]}};Ch.props={};const ts=()=>(t,e)=>{const{encode:n}=e,{x:r}=n;return r!==void 0?[t,e]:[t,Z({},e,{encode:{x:_h(Ho(t,0))},scale:{x:{guide:null}}})]};ts.props={};const Th=()=>(t,e)=>{const{encode:n}=e,{y:r}=n;return r!==void 0?[t,e]:[t,Z({},e,{encode:{y:_h(Ho(t,0))},scale:{y:{guide:null}}})]};Th.props={};const eM=()=>(t,e)=>{const{encode:n}=e,{size:r}=n;return r!==void 0?[t,e]:[t,Z({},e,{encode:{size:Sh(Ho(t,3))}})]};eM.props={};var lW=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const nM=()=>(t,e)=>{const{encode:n}=e,{key:r}=n,i=lW(n,["key"]);if(r!==void 0)return[t,e];const o=Object.values(i).map(({value:s})=>s),a=t.map(s=>o.filter(Array.isArray).map(l=>l[s]).join("-"));return[t,Z({},e,{encode:{key:le(a)}})]};nM.props={};const vm=()=>(t,e)=>{const{encode:n}=e,{series:r,color:i}=n;if(r!==void 0||i===void 0)return[t,e];const[o,a]=It(n,"color");return[t,Z({},e,{encode:{series:le(o,a)}})]};vm.props={};const rM=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(mu)?[t,e]:[t,Z({},e,{encode:{y:le(n)}})]};rM.props={};const iM=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(mu)?[t,e]:[t,Z({},e,{encode:{x:le(n)}})]};iM.props={};const oM=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;if(r)return[t,e];const[i]=It(n,"y");return[t,Z({},e,{encode:{y1:le([...i])}})]};oM.props={};const aM=()=>(t,e)=>{const{encode:n}=e,{x1:r}=n;if(r)return[t,e];const[i]=It(n,"x");return[t,Z({},e,{encode:{x1:le([...i])}})]};aM.props={};const sM=()=>(t,e)=>{const{data:n}=e;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(mu))){const r=(i,o)=>Array.isArray(i[0])?i.map(a=>a[o]):[i[o]];return[t,Z({},e,{encode:{x:le(r(n,0)),x1:le(r(n,1))}})]}return[t,e]};sM.props={};const lM=()=>(t,e)=>{const{data:n}=e;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(mu))){const r=(i,o)=>Array.isArray(i[0])?i.map(a=>a[o]):[i[o]];return[t,Z({},e,{encode:{y:le(r(n,0)),y1:le(r(n,1))}})]}return[t,e]};lM.props={};const kh=t=>{const{channel:e}=t;return(n,r)=>{const{encode:i,tooltip:o}=r;if(io(o))return[n,r];const{items:a=[]}=o;if(!a||a.length>0)return[n,r];const l=(Array.isArray(e)?e:[e]).flatMap(c=>Object.keys(i).filter(u=>u.startsWith(c)).map(u=>{const{field:f,value:d,inferred:h=!1,aggregate:p}=i[u];return h?null:p&&d?{channel:u}:f?{field:f}:d?{channel:u}:null}).filter(u=>u!==null));return[n,Z({},r,{tooltip:{items:l}})]}};kh.props={};const gm=()=>(t,e)=>[t,Z({scale:{x:{padding:0},y:{padding:0}}},e)];gm.props={};var cM=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const Lh=()=>(t,e)=>{const{data:n,style:r={}}=e,i=cM(e,["data","style"]),{x:o,y:a}=r,s=cM(r,["x","y"]);if(o==null||a==null)return[t,e];const l=o||0,c=a||0;return[[0],Z({},i,{data:[0],cartesian:!0,encode:{x:le([l]),y:le([c])},scale:{x:{type:"identity",independent:!0,guide:null},y:{type:"identity",independent:!0,guide:null}},style:s})]};Lh.props={};const uM=()=>(t,e)=>{const{style:n={}}=e;return[t,Z({},e,{style:Object.assign(Object.assign({},n),Object.fromEntries(Object.entries(n).filter(([,r])=>typeof r=="function").map(([r,i])=>[r,()=>i])))})]};uM.props={};const Nh=()=>(t,e)=>{const{data:n}=e;if(!Array.isArray(n)||n.some(mu))return[t,e];const r=Array.isArray(n[0])?n:[n],i=r.map(a=>a[0]),o=r.map(a=>a[1]);return[t,Z({},e,{encode:{x:le(i),y:le(o)}})]};Nh.props={};const fM=()=>(t,e)=>{const{style:n={},encode:r}=e,{series:i}=r,{gradient:o}=n;return!o||i?[t,e]:[t,Z({},e,{encode:{series:Sh(Ho(t,void 0))}})]};fM.props={};var cW=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const dM=(t={})=>{const{groupBy:e="x",reverse:n=!1,orderBy:r,padding:i}=t;return cW(t,["groupBy","reverse","orderBy","padding"]),(o,a)=>{const{data:s,encode:l,scale:c}=a,{series:u}=c,[f]=It(l,"y"),[d]=yu(l,"series","color"),h=JE(d,u),p=Vo(e,o,a),g=ZE(r)(s,f,d);g&&QE(p,g);const y=new Array(o.length);for(const m of p){n&&m.reverse();for(let b=0;b<m.length;b++)y[m[b]]=h[b]}return[o,Z({},a,{scale:{series:{domain:h,paddingInner:i}},encode:{series:le(y)}})]}};dM.props={};const hM=t=>{const{groupBy:e=["x"],reducer:n=(a,s)=>s[a[0]],orderBy:r=null,reverse:i=!1,duration:o}=t;return(a,s)=>{const{encode:l}=s,u=(Array.isArray(e)?e:[e]).map(g=>[g,It(l,g)[0]]);if(u.length===0)return[a,s];let f=[a];for(const[,g]of u){const y=[];for(const m of f){const b=Array.from(xe(m,x=>g[x]).values());y.push(...b)}f=y}if(r){const[g]=It(l,r);g&&f.sort((y,m)=>n(y,g)-n(m,g)),i&&f.reverse()}const d=(o||3e3)/f.length,[h]=o?[Ho(a,d)]:yu(l,"enterDuration",Ho(a,d)),[p]=yu(l,"enterDelay",Ho(a,0)),v=new Array(a.length);for(let g=0,y=0;g<f.length;g++){const m=f[g],b=Gt(m,x=>+h[x]);for(const x of m)v[x]=+p[x]+y;y+=b}return[a,Z({},s,{encode:{enterDuration:Sh(h),enterDelay:Sh(v)}})]}};hM.props={};var uW=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function fW(t){return typeof t=="function"?t:{min:(n,r)=>fr(n,i=>r[+i]),max:(n,r)=>Gt(n,i=>r[+i]),first:(n,r)=>r[n[0]],last:(n,r)=>r[n[n.length-1]],mean:(n,r)=>_u(n,i=>r[+i]),median:(n,r)=>um(n,i=>r[+i]),sum:(n,r)=>kr(n,i=>r[+i]),deviation:(n,r)=>BE(n,i=>r[+i])}[t]||Gt}const pM=(t={})=>{const{groupBy:e="x",basis:n="max"}=t;return(r,i)=>{const{encode:o,tooltip:a}=i,s=uW(o,["x"]),l=Object.entries(s).filter(([p])=>p.startsWith("y")).map(([p])=>[p,It(o,p)[0]]),[,c]=l.find(([p])=>p==="y"),u=l.map(([p])=>[p,new Array(r.length)]),f=Vo(e,r,i),d=fW(n);for(const p of f){const v=d(p,c);for(const g of p)for(let y=0;y<l.length;y++){const[,m]=l[y],[,b]=u[y];b[g]=+m[g]/v}}const h=io(a)||(a==null?void 0:a.items)&&(a==null?void 0:a.items.length)!==0;return[r,Z({},i,Object.assign({encode:Object.fromEntries(u.map(([p,v])=>[p,le(v,It(o,p)[1])]))},!h&&o.y0&&{tooltip:{items:[{channel:"y0"}]}}))]}};pM.props={};function bl(t,...e){return e.reduce((n,r)=>i=>n(r(i)),t)}function Ih(t,e){return e-t?n=>(n-t)/(e-t):n=>.5}function dW(t,e){const n=e<t?e:t,r=t>e?t:e;return i=>Math.min(Math.max(n,i),r)}function ym(t,e,n,r,i){let o=n||0,a=r||t.length;const s=i||(l=>l);for(;o<a;){const l=Math.floor((o+a)/2);s(t[l])>e?a=l:o=l+1}return o}const mm=Math.sqrt(50),bm=Math.sqrt(10),xm=Math.sqrt(2);function jh(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/Ce(10,i);return i>=0?(o>=mm?10:o>=bm?5:o>=xm?2:1)*Ce(10,i):-Ce(10,-i)/(o>=mm?10:o>=bm?5:o>=xm?2:1)}function vM(t,e,n){const r=Math.abs(e-t)/Math.max(0,n);let i=Ce(10,Math.floor(Math.log(r)/Math.LN10));const o=r/i;return o>=mm?i*=10:o>=bm?i*=5:o>=xm&&(i*=2),e<t?-i:i}const gM=(t,e,n=5)=>{const r=[t,e];let i=0,o=r.length-1,a=r[i],s=r[o],l;return s<a&&([a,s]=[s,a],[i,o]=[o,i]),l=jh(a,s,n),l>0?(a=Math.floor(a/l)*l,s=Math.ceil(s/l)*l,l=jh(a,s,n)):l<0&&(a=Math.ceil(a*l)/l,s=Math.floor(s*l)/l,l=jh(a,s,n)),l>0?(r[i]=Math.floor(a/l)*l,r[o]=Math.ceil(s/l)*l):l<0&&(r[i]=Math.ceil(a*l)/l,r[o]=Math.floor(s*l)/l),r},Pu=1e3,Au=Pu*60,Cu=Au*60,es=Cu*24,Tu=es*7,yM=es*30,mM=es*365;function _n(t,e,n,r){const i=(c,u)=>{const f=h=>r(h)%u===0;let d=u;for(;d&&!f(c);)n(c,-1),d-=1;return c},o=(c,u)=>{u&&i(c,u),e(c)},a=(c,u)=>{const f=new Date(+c);return o(f,u),f},s=(c,u)=>{const f=new Date(+c-1);return o(f,u),n(f,u),o(f),f};return{ceil:s,floor:a,range:(c,u,f,d)=>{const h=[],p=Math.floor(f),v=d?s(c,f):s(c);for(let g=v;g<u;n(g,p),o(g))h.push(new Date(+g));return h},duration:t}}const hW=_n(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),pW=_n(Pu,t=>{t.setMilliseconds(0)},(t,e=1)=>{t.setTime(+t+Pu*e)},t=>t.getSeconds()),vW=_n(Au,t=>{t.setSeconds(0,0)},(t,e=1)=>{t.setTime(+t+Au*e)},t=>t.getMinutes()),gW=_n(Cu,t=>{t.setMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+Cu*e)},t=>t.getHours()),yW=_n(es,t=>{t.setHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+es*e)},t=>t.getDate()-1),bM=_n(yM,t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e=1)=>{const n=t.getMonth();t.setMonth(n+e)},t=>t.getMonth()),mW=_n(Tu,t=>{t.setDate(t.getDate()-t.getDay()%7),t.setHours(0,0,0,0)},(t,e=1)=>{t.setDate(t.getDate()+7*e)},t=>{const e=bM.floor(t),n=new Date(+t);return Math.floor((+n-+e)/Tu)}),bW=_n(mM,t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e=1)=>{const n=t.getFullYear();t.setFullYear(n+e)},t=>t.getFullYear()),xM={millisecond:hW,second:pW,minute:vW,hour:gW,day:yW,week:mW,month:bM,year:bW},xW=_n(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),wW=_n(Pu,t=>{t.setUTCMilliseconds(0)},(t,e=1)=>{t.setTime(+t+Pu*e)},t=>t.getUTCSeconds()),OW=_n(Au,t=>{t.setUTCSeconds(0,0)},(t,e=1)=>{t.setTime(+t+Au*e)},t=>t.getUTCMinutes()),_W=_n(Cu,t=>{t.setUTCMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+Cu*e)},t=>t.getUTCHours()),SW=_n(es,t=>{t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+es*e)},t=>t.getUTCDate()-1),wM=_n(yM,t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e=1)=>{const n=t.getUTCMonth();t.setUTCMonth(n+e)},t=>t.getUTCMonth()),EW=_n(Tu,t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+Tu*e)},t=>{const e=wM.floor(t),n=new Date(+t);return Math.floor((+n-+e)/Tu)}),MW=_n(mM,t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e=1)=>{const n=t.getUTCFullYear();t.setUTCFullYear(n+e)},t=>t.getUTCFullYear()),OM={millisecond:xW,second:wW,minute:OW,hour:_W,day:SW,week:EW,month:wM,year:MW};function PW(t){const e=t?OM:xM,{year:n,month:r,week:i,day:o,hour:a,minute:s,second:l,millisecond:c}=e;return{tickIntervals:[[l,1],[l,5],[l,15],[l,30],[s,1],[s,5],[s,15],[s,30],[a,1],[a,3],[a,6],[a,12],[o,1],[o,2],[i,1],[r,1],[r,3],[n,1]],year:n,millisecond:c}}function _M(t,e,n,r,i){const o=+t,a=+e,{tickIntervals:s,year:l,millisecond:c}=PW(i),u=([g,y])=>g.duration*y,f=r?(a-o)/r:n||5,d=r||(a-o)/f,h=s.length,p=ym(s,d,0,h,u);let v;if(p===h){const g=vM(o/l.duration,a/l.duration,f);v=[l,g]}else if(p){const g=d/u(s[p-1])<u(s[p])/d,[y,m]=g?s[p-1]:s[p],b=r?Math.ceil(r/y.duration):m;v=[y,b]}else{const g=Math.max(vM(o,a,f),1);v=[c,g]}return v}const AW=(t,e,n,r,i)=>{const o=t>e,a=o?e:t,s=o?t:e,[l,c]=_M(a,s,n,r,i),u=[l.floor(a,c),l.ceil(s,c)];return o?u.reverse():u};var SM=function(t){return t!==null&&typeof t!="function"&&isFinite(t.length)},CW={}.toString,ku=function(t,e){return CW.call(t)==="[object "+e+"]"};const EM=function(t){return ku(t,"Function")};var TW=function(t){return t==null};const MM=function(t){return Array.isArray?Array.isArray(t):ku(t,"Array")},kW=function(t){var e=typeof t;return t!==null&&e==="object"||e==="function"};function LW(t,e){if(t){var n;if(MM(t))for(var r=0,i=t.length;r<i&&(n=e(t[r],r),n!==!1);r++);else if(kW(t)){for(var o in t)if(t.hasOwnProperty(o)&&(n=e(t[o],o),n===!1))break}}}var NW=function(t){return typeof t=="object"&&t!==null},PM=function(t){if(!NW(t)||!ku(t,"Object"))return!1;if(Object.getPrototypeOf(t)===null)return!0;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};const IW=function(t){return ku(t,"String")};var Lu=function(t){return ku(t,"Number")},jW=Object.values?function(t){return Object.values(t)}:function(t){var e=[];return LW(t,function(n,r){EM(t)&&r==="prototype"||e.push(n)}),e},DW=function(t){return t===null},$W=function(t){return t===void 0};const FW=function(t,e){if(!EM(t))throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=t.apply(this,r);return a.set(o,s),s};return n.cache=new Map,n};var RW=5;function AM(t,e,n,r){n=n||0,r=r||RW;for(var i in e)if(e.hasOwnProperty(i)){var o=e[i];o!==null&&PM(o)?(PM(t[i])||(t[i]={}),n<r?AM(t[i],o,n+1,r):t[i]=e[i]):MM(o)?(t[i]=[],t[i]=t[i].concat(o)):o!==void 0&&(t[i]=o)}}var CM=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)AM(t,e[r]);return t},TM=function(t,e){if(!SM(t))return-1;var n=Array.prototype.indexOf;if(n)return n.call(t,e);for(var r=-1,i=0;i<t.length;i++)if(t[i]===e){r=i;break}return r};const ns=function(t){return t};function kM(t){return TW(t)?0:SM(t)?t.length:Object.keys(t).length}var Dh;FW(function(t,e){e===void 0&&(e={});var n=e.fontSize,r=e.fontFamily,i=e.fontWeight,o=e.fontStyle,a=e.fontVariant;return Dh||(Dh=document.createElement("canvas").getContext("2d")),Dh.font=[o,a,i,n+"px",r].join(" "),Dh.measureText(IW(t)?t:"").width},function(t,e){return e===void 0&&(e={}),nm([t],jW(e)).join("")});function $h(t){return!$W(t)&&!DW(t)&&!Number.isNaN(t)}const LM=t=>e=>-t(-e),wm=(t,e)=>{const n=Math.log(t),r=t===Math.E?Math.log:t===10?Math.log10:t===2?Math.log2:i=>Math.log(i)/n;return e?LM(r):r},Om=(t,e)=>{const n=t===Math.E?Math.exp:r=>Ce(t,r);return e?LM(n):n},BW=(t,e,n,r)=>{const i=t<0,o=wm(r,i),a=Om(r,i),s=t>e,l=s?e:t,c=s?t:e,u=[a(Math.floor(o(l))),a(Math.ceil(o(c)))];return s?u.reverse():u},zW=t=>e=>{const n=t(e);return Lu(n)?Math.round(n):n};function YW(t,e){return n=>{n.prototype.rescale=function(){this.initRange(),this.nice();const[r]=this.chooseTransforms();this.composeOutput(r,this.chooseClamp(r))},n.prototype.initRange=function(){const{interpolator:r}=this.options;this.options.range=t(r)},n.prototype.composeOutput=function(r,i){const{domain:o,interpolator:a,round:s}=this.getOptions(),l=e(o.map(r)),c=s?zW(a):a;this.output=bl(c,l,i,r)},n.prototype.invert=void 0}}var NM={exports:{}},WW={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},IM={exports:{}},GW=function(e){return!e||typeof e=="string"?!1:e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&e.constructor.name!=="String")},HW=GW,UW=Array.prototype.concat,VW=Array.prototype.slice,jM=IM.exports=function(e){for(var n=[],r=0,i=e.length;r<i;r++){var o=e[r];HW(o)?n=UW.call(n,VW.call(o)):n.push(o)}return n};jM.wrap=function(t){return function(){return t(jM(arguments))}};var XW=IM.exports,Nu=WW,Iu=XW,DM=Object.hasOwnProperty,$M=Object.create(null);for(var _m in Nu)DM.call(Nu,_m)&&($M[Nu[_m]]=_m);var dr=NM.exports={to:{},get:{}};dr.get=function(t){var e=t.substring(0,3).toLowerCase(),n,r;switch(e){case"hsl":n=dr.get.hsl(t),r="hsl";break;case"hwb":n=dr.get.hwb(t),r="hwb";break;default:n=dr.get.rgb(t),r="rgb";break}return n?{model:r,value:n}:null},dr.get.rgb=function(t){if(!t)return null;var e=/^#([a-f0-9]{3,4})$/i,n=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,r=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,i=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,o=/^(\w+)$/,a=[0,0,0,1],s,l,c;if(s=t.match(n)){for(c=s[2],s=s[1],l=0;l<3;l++){var u=l*2;a[l]=parseInt(s.slice(u,u+2),16)}c&&(a[3]=parseInt(c,16)/255)}else if(s=t.match(e)){for(s=s[1],c=s[3],l=0;l<3;l++)a[l]=parseInt(s[l]+s[l],16);c&&(a[3]=parseInt(c+c,16)/255)}else if(s=t.match(r)){for(l=0;l<3;l++)a[l]=parseInt(s[l+1],0);s[4]&&(s[5]?a[3]=parseFloat(s[4])*.01:a[3]=parseFloat(s[4]))}else if(s=t.match(i)){for(l=0;l<3;l++)a[l]=Math.round(parseFloat(s[l+1])*2.55);s[4]&&(s[5]?a[3]=parseFloat(s[4])*.01:a[3]=parseFloat(s[4]))}else return(s=t.match(o))?s[1]==="transparent"?[0,0,0,0]:DM.call(Nu,s[1])?(a=Nu[s[1]],a[3]=1,a):null:null;for(l=0;l<3;l++)a[l]=Xo(a[l],0,255);return a[3]=Xo(a[3],0,1),a},dr.get.hsl=function(t){if(!t)return null;var e=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=t.match(e);if(n){var r=parseFloat(n[4]),i=(parseFloat(n[1])%360+360)%360,o=Xo(parseFloat(n[2]),0,100),a=Xo(parseFloat(n[3]),0,100),s=Xo(isNaN(r)?1:r,0,1);return[i,o,a,s]}return null},dr.get.hwb=function(t){if(!t)return null;var e=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=t.match(e);if(n){var r=parseFloat(n[4]),i=(parseFloat(n[1])%360+360)%360,o=Xo(parseFloat(n[2]),0,100),a=Xo(parseFloat(n[3]),0,100),s=Xo(isNaN(r)?1:r,0,1);return[i,o,a,s]}return null},dr.to.hex=function(){var t=Iu(arguments);return"#"+Fh(t[0])+Fh(t[1])+Fh(t[2])+(t[3]<1?Fh(Math.round(t[3]*255)):"")},dr.to.rgb=function(){var t=Iu(arguments);return t.length<4||t[3]===1?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},dr.to.rgb.percent=function(){var t=Iu(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return t.length<4||t[3]===1?"rgb("+e+"%, "+n+"%, "+r+"%)":"rgba("+e+"%, "+n+"%, "+r+"%, "+t[3]+")"},dr.to.hsl=function(){var t=Iu(arguments);return t.length<4||t[3]===1?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},dr.to.hwb=function(){var t=Iu(arguments),e="";return t.length>=4&&t[3]!==1&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},dr.to.keyword=function(t){return $M[t.slice(0,3)]};function Xo(t,e,n){return Math.min(Math.max(e,t),n)}function Fh(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}var qW=NM.exports;const Sm=lu(qW);function Em(t,e,n){let r=n;return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function KW(t){const e=t[0]/360,n=t[1]/100,r=t[2]/100,i=t[3];if(n===0)return[r*255,r*255,r*255,i];const o=r<.5?r*(1+n):r+n-r*n,a=2*r-o,s=Em(a,o,e+1/3),l=Em(a,o,e),c=Em(a,o,e-1/3);return[s*255,l*255,c*255,i]}function FM(t){const e=Sm.get(t);if(!e)return null;const{model:n,value:r}=e;return n==="rgb"?r:n==="hsl"?KW(r):null}const xl=(t,e)=>n=>t*(1-n)+e*n,ZW=(t,e)=>{const n=FM(t),r=FM(e);return n===null||r===null?n?()=>t:()=>e:i=>{const o=new Array(4);for(let u=0;u<4;u+=1){const f=n[u],d=r[u];o[u]=f*(1-i)+d*i}const[a,s,l,c]=o;return`rgba(${Math.round(a)}, ${Math.round(s)}, ${Math.round(l)}, ${c})`}},ju=(t,e)=>typeof t=="number"&&typeof e=="number"?xl(t,e):typeof t=="string"&&typeof e=="string"?ZW(t,e):()=>t,QW=(t,e)=>{const n=xl(t,e);return r=>Math.round(n(r))};function JW(t,e){const{second:n,minute:r,hour:i,day:o,week:a,month:s,year:l}=e;return n.floor(t)<t?".SSS":r.floor(t)<t?":ss":i.floor(t)<t?"hh:mm":o.floor(t)<t?"hh A":s.floor(t)<t?a.floor(t)<t?"MMM DD":"ddd DD":l.floor(t)<t?"MMMM":"YYYY"}function RM({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):n}function tG({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function eG({map:t,initKey:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function nG(t){return typeof t=="object"?t.valueOf():t}let BM=class extends Map{constructor(e){if(super(),this.map=new Map,this.initKey=nG,e!==null)for(const[n,r]of e)this.set(n,r)}get(e){return super.get(RM({map:this.map,initKey:this.initKey},e))}has(e){return super.has(RM({map:this.map,initKey:this.initKey},e))}set(e,n){return super.set(tG({map:this.map,initKey:this.initKey},e),n)}delete(e){return super.delete(eG({map:this.map,initKey:this.initKey},e))}},Du=class{constructor(e){this.options=CM({},this.getDefaultOptions()),this.update(e)}getOptions(){return this.options}update(e={}){this.options=CM({},this.options,e),this.rescale(e)}rescale(e){}};const Rh=Symbol("defaultUnknown");function zM(t,e,n){for(let r=0;r<e.length;r+=1)t.has(e[r])||t.set(n(e[r]),r)}function YM(t){const{value:e,from:n,to:r,mapper:i,notFoundReturn:o}=t;let a=i.get(e);if(a===void 0){if(o!==Rh)return o;a=n.push(e)-1,i.set(e,a)}return r[a%r.length]}function WM(t){return t instanceof Date?e=>`${e}`:typeof t=="object"?e=>JSON.stringify(e):e=>e}let GM=class oB extends Du{getDefaultOptions(){return{domain:[],range:[],unknown:Rh}}constructor(e){super(e)}map(e){return this.domainIndexMap.size===0&&zM(this.domainIndexMap,this.getDomain(),this.domainKey),YM({value:this.domainKey(e),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(e){return this.rangeIndexMap.size===0&&zM(this.rangeIndexMap,this.getRange(),this.rangeKey),YM({value:this.rangeKey(e),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(e){const[n]=this.options.domain,[r]=this.options.range;if(this.domainKey=WM(n),this.rangeKey=WM(r),!this.rangeIndexMap){this.rangeIndexMap=new Map,this.domainIndexMap=new Map;return}(!e||e.range)&&this.rangeIndexMap.clear(),(!e||e.domain||e.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new oB(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:e,compare:n}=this.options;return this.sortedDomain=n?[...e].sort(n):e,this.sortedDomain}};function rG(t){const e=Math.min(...t);return t.map(n=>n/e)}function iG(t,e){const n=t.length,r=e-n;return r>0?[...t,...new Array(r).fill(1)]:r<0?t.slice(0,e):t}function oG(t){return Math.round(t*1e12)/1e12}function aG(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:o,round:a,align:s}=t,l=e.length,c=iG(o,l),[u,f]=n,d=f-u,h=2/l*r+1-1/l*i,p=d/h,v=p*i/l,g=p-l*v,y=rG(c),m=y.reduce((C,A)=>C+A),b=g/m,x=new BM(e.map((C,A)=>{const T=y[A]*b;return[C,a?Math.floor(T):T]})),w=new BM(e.map((C,A)=>{const k=y[A]*b+v;return[C,a?Math.floor(k):k]})),O=Array.from(w.values()).reduce((C,A)=>C+A),S=(d-(O-O/l*i))*s,E=u+S;let M=a?Math.round(E):E;const P=new Array(l);for(let C=0;C<l;C+=1){P[C]=oG(M);const A=e[C];M+=w.get(A)}return{valueBandWidth:x,valueStep:w,adjustedRange:P}}function sG(t){var e;const{domain:n}=t,r=n.length;if(r===0)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(!!(!((e=t.flex)===null||e===void 0)&&e.length))return aG(t);const{range:o,paddingOuter:a,paddingInner:s,round:l,align:c}=t;let u,f,d=o[0];const p=o[1]-d,v=a*2,g=r-s;u=p/Math.max(1,v+g),l&&(u=Math.floor(u)),d+=(p-u*(r-s))*c,f=u*(1-s),l&&(d=Math.round(d),f=Math.round(f));const y=new Array(r).fill(0).map((m,b)=>d+b*u);return{valueStep:u,valueBandWidth:f,adjustedRange:y}}let $u=class aB extends GM{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:Rh,flex:[]}}constructor(e){super(e)}clone(){return new aB(this.options)}getStep(e){return this.valueStep===void 0?1:typeof this.valueStep=="number"?this.valueStep:e===void 0?Array.from(this.valueStep.values())[0]:this.valueStep.get(e)}getBandWidth(e){return this.valueBandWidth===void 0?1:typeof this.valueBandWidth=="number"?this.valueBandWidth:e===void 0?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(e)}getRange(){return this.adjustedRange}getPaddingInner(){const{padding:e,paddingInner:n}=this.options;return e>0?e:n}getPaddingOuter(){const{padding:e,paddingOuter:n}=this.options;return e>0?e:n}rescale(){super.rescale();const{align:e,domain:n,range:r,round:i,flex:o}=this.options,{adjustedRange:a,valueBandWidth:s,valueStep:l}=sG({align:e,range:r,round:i,flex:o,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:n});this.valueStep=l,this.valueBandWidth=s,this.adjustedRange=a}};const rs=(t,e,n)=>{let r,i,o=t,a=e;if(o===a&&n>0)return[o];let s=jh(o,a,n);if(s===0||!Number.isFinite(s))return[];if(s>0){o=Math.ceil(o/s),a=Math.floor(a/s),i=new Array(r=Math.ceil(a-o+1));for(let l=0;l<r;l+=1)i[l]=(o+l)*s}else{s=-s,o=Math.ceil(o*s),a=Math.floor(a*s),i=new Array(r=Math.ceil(a-o+1));for(let l=0;l<r;l+=1)i[l]=(o+l)/s}return i};let Mm=class sB extends Du{getDefaultOptions(){return{range:[0],domain:[0,1],unknown:void 0,tickCount:5,tickMethod:rs}}map(e){const[n]=this.options.range;return n!==void 0?n:this.options.unknown}invert(e){const[n]=this.options.range;return e===n&&n!==void 0?this.options.domain:[]}getTicks(){const{tickMethod:e,domain:n,tickCount:r}=this.options,[i,o]=n;return!Lu(i)||!Lu(o)?[]:e(i,o,r)}clone(){return new sB(this.options)}};function Fu(t){return Math.abs(t)<1e-14?t:parseFloat(t.toFixed(14))}const lG=[1,5,2,2.5,4,3],HM=Number.EPSILON*100;function cG(t,e){return(t%e+e)%e}function uG(t){return Math.round(t*1e12)/1e12}function fG(t,e,n,r,i,o){const a=kM(e),s=TM(e,t);let l=0;const c=cG(r,o);return(c<HM||o-c<HM)&&r<=0&&i>=0&&(l=1),1-s/(a-1)-n+l}function dG(t,e,n){const r=kM(e),i=TM(e,t),o=1;return 1-i/(r-1)-n+o}function hG(t,e,n,r,i,o){const a=(t-1)/(o-i),s=(e-1)/(Math.max(o,r)-Math.min(n,i));return 2-Math.max(a/s,s/a)}function pG(t,e){return t>=e?2-(t-1)/(e-1):1}function vG(t,e,n,r){const i=e-t;return 1-.5*(Ce(e-r,2)+Ce(t-n,2))/Ce(.1*i,2)}function gG(t,e,n){const r=e-t;if(n>r){const i=(n-r)/2;return 1-Ce(i,2)/Ce(.1*r,2)}return 1}function yG(){return 1}const Pm=(t,e,n=5,r=!0,i=lG,o=[.25,.2,.5,.05])=>{const a=n<0?0:Math.round(n);if(Number.isNaN(t)||Number.isNaN(e)||typeof t!="number"||typeof e!="number"||!a)return[];if(e-t<1e-15||a===1)return[t];const s={score:-2,lmin:0,lmax:0,lstep:0};let l=1;for(;l<1/0;){for(let p=0;p<i.length;p+=1){const v=i[p],g=dG(v,i,l);if(o[0]*g+o[1]+o[2]+o[3]<s.score){l=1/0;break}let y=2;for(;y<1/0;){const m=pG(y,a);if(o[0]*g+o[1]+o[2]*m+o[3]<s.score)break;const b=(e-t)/(y+1)/l/v;let x=Math.ceil(Math.log10(b));for(;x<1/0;){const w=l*v*Ce(10,x),O=gG(t,e,w*(y-1));if(o[0]*g+o[1]*O+o[2]*m+o[3]<s.score)break;const _=Math.floor(e/w)*l-(y-1)*l,S=Math.ceil(t/w)*l;if(_<=S){const E=S-_;for(let M=0;M<=E;M+=1){const C=(_+M)*(w/l),A=C+w*(y-1),T=w,k=fG(v,i,l,C,A,T),N=vG(t,e,C,A),j=hG(y,a,t,e,C,A),L=yG(),I=o[0]*k+o[1]*N+o[2]*j+o[3]*L;I>s.score&&(!r||C<=t&&A>=e)&&(s.lmin=C,s.lmax=A,s.lstep=T,s.score=I)}}x+=1}y+=1}}l+=1}const c=Fu(s.lmax),u=Fu(s.lmin),f=Fu(s.lstep),d=Math.floor(uG((c-u)/f))+1,h=new Array(d);h[0]=Fu(u);for(let p=1;p<d;p+=1)h[p]=Fu(h[p-1]+f);return h};let UM=class lB extends Du{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:Pm}}map(e){return $h(e)?e:this.options.unknown}invert(e){return this.map(e)}clone(){return new lB(this.options)}getTicks(){const{domain:e,tickCount:n,tickMethod:r}=this.options,[i,o]=e;return!Lu(i)||!Lu(o)?[]:r(i,o,n)}};const mG=(t,e,n)=>{const[r,i]=t,[o,a]=e;let s,l;return r<i?(s=Ih(r,i),l=n(o,a)):(s=Ih(i,r),l=n(a,o)),bl(l,s)},bG=(t,e,n)=>{const r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=t[0]>t[r],s=a?[...t].reverse():t,l=a?[...e].reverse():e;for(let c=0;c<r;c+=1)i[c]=Ih(s[c],s[c+1]),o[c]=n(l[c],l[c+1]);return c=>{const u=ym(t,c,1,r)-1,f=i[u],d=o[u];return bl(d,f)(c)}},VM=(t,e,n,r)=>(Math.min(t.length,e.length)>2?bG:mG)(t,e,r?QW:n);let Bh=class extends Du{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:xl,tickCount:5}}map(e){return $h(e)?this.output(e):this.options.unknown}invert(e){return $h(e)?this.input(e):this.options.unknown}nice(){if(!this.options.nice)return;const[e,n,r,...i]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(e,n,r,...i)}getTicks(){const{tickMethod:e}=this.options,[n,r,i,...o]=this.getTickMethodOptions();return e(n,r,i,...o)}getTickMethodOptions(){const{domain:e,tickCount:n}=this.options,r=e[0],i=e[e.length-1];return[r,i,n]}chooseNice(){return gM}rescale(){this.nice();const[e,n]=this.chooseTransforms();this.composeOutput(e,this.chooseClamp(e)),this.composeInput(e,n,this.chooseClamp(n))}chooseClamp(e){const{clamp:n,range:r}=this.options,i=this.options.domain.map(e),o=Math.min(i.length,r.length);return n?dW(i[0],i[o-1]):ns}composeOutput(e,n){const{domain:r,range:i,round:o,interpolate:a}=this.options,s=VM(r.map(e),i,a,o);this.output=bl(s,n,e)}composeInput(e,n,r){const{domain:i,range:o}=this.options,a=VM(o,i.map(e),xl);this.input=bl(n,r,a)}},oo=class cB extends Bh{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:ju,tickMethod:rs,tickCount:5}}chooseTransforms(){return[ns,ns]}clone(){return new cB(this.options)}},xG=class uB extends $u{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:Rh,paddingInner:1,paddingOuter:0}}constructor(e){super(e)}getPaddingInner(){return 1}clone(){return new uB(this.options)}update(e){super.update(e)}getPaddingOuter(){return this.options.padding}};const wG=t=>e=>e<0?-Ce(-e,t):Ce(e,t),OG=t=>e=>e<0?-Ce(-e,1/t):Ce(e,1/t),_G=t=>t<0?-Math.sqrt(-t):Math.sqrt(t);let XM=class fB extends Bh{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:ju,tickMethod:rs,tickCount:5}}constructor(e){super(e)}chooseTransforms(){const{exponent:e}=this.options;if(e===1)return[ns,ns];const n=e===.5?_G:wG(e),r=OG(e);return[n,r]}clone(){return new fB(this.options)}},SG=class dB extends XM{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:ju,tickMethod:rs,tickCount:5,exponent:.5}}constructor(e){super(e)}update(e){super.update(e)}clone(){return new dB(this.options)}},zh=class hB extends Du{getDefaultOptions(){return{domain:[.5],range:[0,1]}}constructor(e){super(e)}map(e){if(!$h(e))return this.options.unknown;const n=ym(this.thresholds,e,0,this.n);return this.options.range[n]}invert(e){const{range:n}=this.options,r=n.indexOf(e),i=this.thresholds;return[i[r-1],i[r]]}clone(){return new hB(this.options)}rescale(){const{domain:e,range:n}=this.options;this.n=Math.min(e.length,n.length-1),this.thresholds=e}};const EG=(t,e,n,r=10)=>{const i=t<0,o=Om(r,i),a=wm(r,i),s=e<t,l=s?e:t,c=s?t:e;let u=a(l),f=a(c),d=[];if(!(r%1)&&f-u<n){if(u=Math.floor(u),f=Math.ceil(f),i)for(;u<=f;u+=1){const h=o(u);for(let p=r-1;p>=1;p-=1){const v=h*p;if(v>c)break;v>=l&&d.push(v)}}else for(;u<=f;u+=1){const h=o(u);for(let p=1;p<r;p+=1){const v=h*p;if(v>c)break;v>=l&&d.push(v)}}d.length*2<n&&(d=rs(l,c,n))}else{const h=n===-1?f-u:Math.min(f-u,n);d=rs(u,f,h).map(o)}return s?d.reverse():d};let MG=class pB extends Bh{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:ju,tickMethod:EG,tickCount:5}}chooseNice(){return BW}getTickMethodOptions(){const{domain:e,tickCount:n,base:r}=this.options,i=e[0],o=e[e.length-1];return[i,o,n,r]}chooseTransforms(){const{base:e,domain:n}=this.options,r=n[0]<0;return[wm(e,r),Om(e,r)]}clone(){return new pB(this.options)}},qM=class vB extends zh{getDefaultOptions(){return{domain:[0,1],range:[.5],nice:!1,tickCount:5,tickMethod:Pm}}constructor(e){super(e)}nice(){const{nice:e}=this.options;if(e){const[n,r,i]=this.getTickMethodOptions();this.options.domain=gM(n,r,i)}}getTicks(){const{tickMethod:e}=this.options,[n,r,i]=this.getTickMethodOptions();return e(n,r,i)}getTickMethodOptions(){const{domain:e,tickCount:n}=this.options,r=e[0],i=e[e.length-1];return[r,i,n]}rescale(){this.nice();const{range:e,domain:n}=this.options,[r,i]=n;this.n=e.length-1,this.thresholds=new Array(this.n);for(let o=0;o<this.n;o+=1)this.thresholds[o]=((o+1)*i-(o-this.n)*r)/(this.n+1)}invert(e){const[n,r]=super.invert(e),[i,o]=this.options.domain;return n===void 0&&r===void 0?[n,r]:[n||i,r||o]}getThresholds(){return this.thresholds}clone(){return new vB(this.options)}};function PG(t,e){const n=t.length;if(!n)return;if(n<2)return t[n-1];const r=(n-1)*e,i=Math.floor(r),o=t[i],a=t[i+1];return o+(a-o)*(r-i)}function AG(t,e,n=!1){const r=t;n||r.sort((o,a)=>o-a);const i=[];for(let o=1;o<e;o+=1)i.push(PG(r,o/e));return i}let KM=class gB extends zh{getDefaultOptions(){return{domain:[],range:[],tickCount:5,unknown:void 0,tickMethod:Pm}}constructor(e){super(e)}rescale(){const{domain:e,range:n}=this.options;this.n=n.length-1,this.thresholds=AG(e,this.n+1,!1)}invert(e){const[n,r]=super.invert(e),{domain:i}=this.options,o=i[0],a=i[i.length-1];return n===void 0&&r===void 0?[n,r]:[n||o,r||a]}getThresholds(){return this.thresholds}clone(){return new gB(this.options)}getTicks(){const{tickCount:e,domain:n,tickMethod:r}=this.options,i=n.length-1,o=n[0],a=n[i];return r(o,a,e)}};var CG=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,TG=/\[([^]*?)\]/gm;function ZM(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}function Am(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0,i=e;r<i.length;r++){var o=i[r];for(var a in o)t[a]=o[a]}return t}var QM=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],JM=["January","February","March","April","May","June","July","August","September","October","November","December"],kG=ZM(JM,3),LG=ZM(QM,3),NG={dayNamesShort:LG,dayNames:QM,monthNamesShort:kG,monthNames:JM,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][t%10>3?0:(t-t%10!==10?1:0)*t%10]}},IG=Am({},NG),Xn=function(t,e){for(e===void 0&&(e=2),t=String(t);t.length<e;)t="0"+t;return t},jG={D:function(t){return String(t.getDate())},DD:function(t){return Xn(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return Xn(t.getDay())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return String(t.getMonth()+1)},MM:function(t){return Xn(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},YY:function(t){return Xn(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return Xn(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return Xn(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return Xn(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return Xn(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return Xn(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return Xn(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return Xn(t.getMilliseconds(),3)},a:function(t,e){return t.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(t,e){return t.getHours()<12?e.amPm[0].toUpperCase():e.amPm[1].toUpperCase()},ZZ:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+Xn(Math.floor(Math.abs(e)/60)*100+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+Xn(Math.floor(Math.abs(e)/60),2)+":"+Xn(Math.abs(e)%60,2)}},tP={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},DG=function(t,e,n){if(e===void 0&&(e=tP.default),n===void 0&&(n={}),typeof t=="number"&&(t=new Date(t)),Object.prototype.toString.call(t)!=="[object Date]"||isNaN(t.getTime()))throw new Error("Invalid Date pass to format");e=tP[e]||e;var r=[];e=e.replace(TG,function(o,a){return r.push(a),"@@@"});var i=Am(Am({},IG),n);return e=e.replace(CG,function(o){return jG[o](t,i)}),e.replace(/@@@/g,function(){return r.shift()})};const $G=(t,e,n,r,i)=>{const o=t>e,a=o?e:t,s=o?t:e,[l,c]=_M(a,s,n,r,i),u=l.range(a,new Date(+s+1),c,!0);return o?u.reverse():u};function FG(t){const e=t.getTimezoneOffset(),n=new Date(t);return n.setMinutes(n.getMinutes()+e,n.getSeconds(),n.getMilliseconds()),n}let RG=class yB extends Bh{getDefaultOptions(){return{domain:[new Date(2e3,0,1),new Date(2e3,0,2)],range:[0,1],nice:!1,tickCount:5,tickInterval:void 0,unknown:void 0,clamp:!1,tickMethod:$G,interpolate:xl,mask:void 0,utc:!1}}chooseTransforms(){return[r=>+r,r=>new Date(r)]}chooseNice(){return AW}getTickMethodOptions(){const{domain:e,tickCount:n,tickInterval:r,utc:i}=this.options,o=e[0],a=e[e.length-1];return[o,a,n,r,i]}getFormatter(){const{mask:e,utc:n}=this.options,r=n?OM:xM,i=n?FG:ns;return o=>DG(i(o),e||JW(o,r))}clone(){return new yB(this.options)}};var BG=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},Cm;function zG(t){return[t(0),t(1)]}const YG=t=>{const[e,n]=t;return bl(xl(0,1),Ih(e,n))};let Tm=Cm=class extends oo{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:ns,tickMethod:rs,tickCount:5}}constructor(e){super(e)}clone(){return new Cm(this.options)}};Tm=Cm=BG([YW(zG,YG)],Tm);function Yh(t,e,n){if(t===null)return[-.5,.5];const r=JE(t,e),o=new $u({domain:r,range:[0,1],padding:n}).getBandWidth();return[-o/2,o/2]}function Wh(t,e,n){return e*(1-t)+n*t}const eP=(t={})=>{const{padding:e=0,paddingX:n=e,paddingY:r=e,random:i=Math.random}=t;return(o,a)=>{const{encode:s,scale:l}=a,{x:c,y:u}=l,[f]=It(s,"x"),[d]=It(s,"y"),h=Yh(f,c,n),p=Yh(d,u,r),v=o.map(()=>Wh(i(),...p)),g=o.map(()=>Wh(i(),...h));return[o,Z({scale:{x:{padding:.5},y:{padding:.5}}},a,{encode:{dy:le(v),dx:le(g)}})]}};eP.props={};const nP=(t={})=>{const{padding:e=0,random:n=Math.random}=t;return(r,i)=>{const{encode:o,scale:a}=i,{x:s}=a,[l]=It(o,"x"),c=Yh(l,s,e),u=r.map(()=>Wh(n(),...c));return[r,Z({scale:{x:{padding:.5}}},i,{encode:{dx:le(u)}})]}};nP.props={};const rP=(t={})=>{const{padding:e=0,random:n=Math.random}=t;return(r,i)=>{const{encode:o,scale:a}=i,{y:s}=a,[l]=It(o,"y"),c=Yh(l,s,e),u=r.map(()=>Wh(n(),...c));return[r,Z({scale:{y:{padding:.5}}},i,{encode:{dy:le(u)}})]}};rP.props={};var WG=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const iP=(t={})=>{const{groupBy:e="x"}=t;return(n,r)=>{const{encode:i}=r,o=WG(i,["x"]),a=Object.entries(o).filter(([f])=>f.startsWith("y")).map(([f])=>[f,It(i,f)[0]]),s=a.map(([f])=>[f,new Array(n.length)]),l=Vo(e,n,r),c=new Array(l.length);for(let f=0;f<l.length;f++){const h=l[f].flatMap(g=>a.map(([,y])=>+y[g])),[p,v]=no(h);c[f]=(p+v)/2}const u=Math.max(...c);for(let f=0;f<l.length;f++){const d=u-c[f],h=l[f];for(const p of h)for(let v=0;v<a.length;v++){const[,g]=a[v],[,y]=s[v];y[p]=+g[p]+d}}return[n,Z({},r,{encode:Object.fromEntries(s.map(([f,d])=>[f,le(d,It(i,f)[1])]))})]}};iP.props={};const oP=(t={})=>{const{groupBy:e="x",series:n=!0}=t;return(r,i)=>{const{encode:o}=i,[a]=It(o,"y"),[s,l]=It(o,"y1");n?yu(o,"series","color"):It(o,"color");const c=Vo(e,r,i),u=new Array(r.length);for(const f of c){const d=f.map(h=>+a[h]);for(let h=0;h<f.length;h++){const p=f[h],v=Math.max(...d.filter((g,y)=>y!==h));u[p]=a[p]>v?v:a[p]}}return[r,Z({},i,{encode:{y1:le(u,l)}})]}};oP.props={};function aP(t,e){return[t[0]]}function GG(t,e){const n=t.length-1;return[t[n]]}function HG(t,e){const n=gl(t,r=>e[r]);return[t[n]]}function UG(t,e){const n=Ph(t,r=>e[r]);return[t[n]]}function VG(t){return typeof t=="function"?t:{first:aP,last:GG,max:HG,min:UG}[t]||aP}const Gh=(t={})=>{const{groupBy:e="series",channel:n,selector:r}=t;return(i,o)=>{const{encode:a}=o,s=Vo(e,i,o),[l]=It(a,n),c=VG(r);return[s.flatMap(u=>c(u,l)),o]}};Gh.props={};var XG=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const sP=(t={})=>{const{selector:e}=t,n=XG(t,["selector"]);return Gh(Object.assign({channel:"x",selector:e},n))};sP.props={};var qG=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const lP=(t={})=>{const{selector:e}=t,n=qG(t,["selector"]);return Gh(Object.assign({channel:"y",selector:e},n))};lP.props={};var KG=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function qo(t){return e=>e===null?t:`${t} of ${e}`}function ZG(t){if(typeof t=="function")return[t,null];const n={mean:QG,max:tH,count:nH,first:iH,last:oH,sum:rH,min:eH,median:JG}[t];if(!n)throw new Error(`Unknown reducer: ${t}.`);return n()}function QG(){const t=(n,r)=>_u(n,i=>+r[i]),e=qo("mean");return[t,e]}function JG(){const t=(n,r)=>um(n,i=>+r[i]),e=qo("median");return[t,e]}function tH(){const t=(n,r)=>Gt(n,i=>+r[i]),e=qo("max");return[t,e]}function eH(){const t=(n,r)=>fr(n,i=>+r[i]),e=qo("min");return[t,e]}function nH(){const t=(n,r)=>n.length,e=qo("count");return[t,e]}function rH(){const t=(n,r)=>kr(n,i=>+r[i]),e=qo("sum");return[t,e]}function iH(){const t=(n,r)=>r[n[0]],e=qo("first");return[t,e]}function oH(){const t=(n,r)=>r[n[n.length-1]],e=qo("last");return[t,e]}const km=(t={})=>{const{groupBy:e}=t,n=KG(t,["groupBy"]);return(r,i)=>{const{data:o,encode:a}=i,s=e(r,i);if(!s)return[r,i];const l=(h,p)=>{if(h)return h;const{from:v}=p;if(!v)return h;const[,g]=It(a,v);return g},c=Object.entries(n).map(([h,p])=>{const[v,g]=ZG(p),[y,m]=It(a,h),b=l(m,p),x=s.map(w=>v(w,y!=null?y:o));return[h,Object.assign(Object.assign({},yY(x,(g==null?void 0:g(b))||b)),{aggregate:!0})]}),u=Object.keys(a).map(h=>{const[p,v]=It(a,h),g=s.map(y=>p[y[0]]);return[h,le(g,v)]}),f=s.map(h=>o[h[0]]);return[Ja(s),Z({},i,{data:f,encode:Object.fromEntries([...u,...c])})]}};km.props={};var aH=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const Ru=(t={})=>{const{channels:e=["x","y"]}=t,n=aH(t,["channels"]),r=(i,o)=>Vo(e,i,o);return km(Object.assign(Object.assign({},n),{groupBy:r}))};Ru.props={};const cP=(t={})=>Ru(Object.assign(Object.assign({},t),{channels:["x","color","series"]}));cP.props={};const uP=(t={})=>Ru(Object.assign(Object.assign({},t),{channels:["y","color","series"]}));uP.props={};const fP=(t={})=>Ru(Object.assign(Object.assign({},t),{channels:["color"]}));fP.props={};var dP=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function sH(t,e,n){const{by:r=t,reducer:i="max"}=e,[o]=It(n,r);if(typeof i=="function")return a=>i(a,o);if(i==="max")return a=>Gt(a,s=>+o[s]);if(i==="min")return a=>fr(a,s=>+o[s]);if(i==="sum")return a=>kr(a,s=>+o[s]);if(i==="median")return a=>um(a,s=>+o[s]);if(i==="mean")return a=>_u(a,s=>+o[s]);if(i==="first")return a=>o[a[0]];if(i==="last")return a=>o[a[a.length-1]];throw new Error(`Unknown reducer: ${i}`)}function lH(t,e,n){const{reverse:r,channel:i}=n,{encode:o}=e,[a]=It(o,i),s=ro(t,l=>a[l]);return r&&s.reverse(),[s,e]}function cH(t,e,n){if(!Array.isArray(n))return t;const r=new Set(n);return t.filter(i=>r.has(e[i]))}function uH(t,e,n){var r;const{reverse:i,slice:o,channel:a}=n,s=dP(n,["reverse","slice","channel"]),{encode:l,scale:c={}}=e,u=(r=c[a])===null||r===void 0?void 0:r.domain,[f]=It(l,a),d=sH(a,s,l),h=cH(t,f,u),p=kY(h,d,y=>f[y]);i&&p.reverse();const v=typeof o=="number"?[0,o]:o,g=o?p.slice(...v):p;return[t,Z(e,{scale:{[a]:{domain:g}}})]}const Hh=(t={})=>{const{reverse:e=!1,slice:n,channel:r,ordinal:i=!0}=t,o=dP(t,["reverse","slice","channel","ordinal"]);return(a,s)=>i?uH(a,s,Object.assign({reverse:e,slice:n,channel:r},o)):lH(a,s,Object.assign({reverse:e,slice:n,channel:r},o))};Hh.props={};const hP=(t={})=>Hh(Object.assign(Object.assign({},t),{channel:"x"}));hP.props={};const pP=(t={})=>Hh(Object.assign(Object.assign({},t),{channel:"color"}));pP.props={};const vP=(t={})=>Hh(Object.assign(Object.assign({},t),{channel:"y"}));vP.props={};function fH(t,e){return typeof e=="string"?t.map(n=>n[e]):t.map(e)}function dH(t,e){if(typeof t=="function")return n=>t(n,e);if(t==="sum")return n=>kr(n,r=>+e[r]);throw new Error(`Unknown reducer: ${t}`)}const gP=(t={})=>{const{field:e,channel:n="y",reducer:r="sum"}=t;return(i,o)=>{const{data:a,encode:s}=o,[l]=It(s,"x"),c=e?fH(a,e):It(s,n)[0],u=dH(r,c),f=YE(i,u,d=>l[d]).map(d=>d[1]);return[i,Z({},o,{scale:{x:{flex:f}}})]}};gP.props={};function ke([t,e],[n,r]){return[t-n,e-r]}function Uh([t,e],[n,r]){return[t+n,e+r]}function we([t,e],[n,r]){return Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))}function Lr([t,e]){return Math.atan2(e,t)}function wl([t,e]){return Lr([t,e])+Math.PI/2}function yP(t,e){const n=Lr(t),r=Lr(e);return n<r?r-n:Math.PI*2-(n-r)}function Lm(t){let e=1/0,n=-1/0,r=1/0,i=-1/0;for(const[s,l]of t)e=Math.min(s,e),n=Math.max(s,n),r=Math.min(l,r),i=Math.max(l,i);const o=n-e,a=i-r;return[e,r,o,a]}function mP([t,e],[n,r]){return[(t+n)/2,(e+r)/2]}function hH(t){const{padding:e=0,direction:n="col"}=t;return(r,i,o)=>{const a=r.length;if(a===0)return[];const{innerWidth:s,innerHeight:l}=o,c=l/s;let u=Math.ceil(Math.sqrt(i/c)),f=s/u,d=Math.ceil(i/u),h=d*f;for(;h>l;)u=u+1,f=s/u,d=Math.ceil(i/u),h=d*f;const p=l-d*f,v=d<=1?0:p/(d-1),[g,y]=d<=1?[(s-a*f)/(a-1),(l-f)/2]:[0,0];return r.map((m,b)=>{const[x,w,O,_]=Lm(m),S=n==="col"?b%u:Math.floor(b/d),E=n==="col"?Math.floor(b/u):b%d,M=S*f,P=(d-E-1)*f+p,C=(f-e)/O,A=(f-e)/_,T=M-x+g*S+1/2*e,k=P-w-v*E-y+1/2*e;return`translate(${T}, ${k}) scale(${C}, ${A})`})}}const bP=t=>(e,n)=>[e,Z({},n,{modifier:hH(t),axis:!1})];bP.props={};var pH=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const xP="thresholds";function vH(t){const[e,n]=no(t);return Math.min(200,WY(t,e,n))}const Nm=(t={})=>{const{groupChannels:e=["color"],binChannels:n=["x","y"]}=t,r=pH(t,["groupChannels","binChannels"]),i={},o=(a,s)=>{const{encode:l}=s,c=n.map(p=>{const[v]=It(l,p);return v}),u=ot(r,xP),f=a.filter(p=>c.every(v=>ie(v[p]))),d=[...e.map(p=>{const[v]=It(l,p);return v}).filter(ie).map(p=>v=>p[v]),...n.map((p,v)=>{const g=c[v],y=u[p]||vH(g),m=BY().thresholds(y).value(x=>+g[x])(f),b=new Map(m.flatMap(x=>{const{x0:w,x1:O}=x,_=`${w},${O}`;return x.map(S=>[S,_])}));return i[p]=b,x=>b.get(x)})],h=p=>d.map(v=>v(p)).join("-");return Array.from(xe(f,h).values())};return km(Object.assign(Object.assign(Object.assign({},Object.fromEntries(Object.entries(r).filter(([a])=>!a.startsWith(xP)))),Object.fromEntries(n.flatMap(a=>{const s=([c])=>+i[a].get(c).split(",")[0],l=([c])=>+i[a].get(c).split(",")[1];return l.from=a,[[a,s],[`${a}1`,l]]}))),{groupBy:o}))};Nm.props={};const wP=(t={})=>{const{thresholds:e}=t;return Nm(Object.assign(Object.assign({},t),{thresholdsX:e,groupChannels:["color"],binChannels:["x"]}))};wP.props={};function gH(t,e,n,r){const i=t.length;if(r>=i||r===0)return t;const o=h=>e[t[h]]*1,a=h=>n[t[h]]*1,s=[],l=(i-2)/(r-2);let c=0,u,f,d;s.push(c);for(let h=0;h<r-2;h++){let p=0,v=0,g=Math.floor((h+1)*l)+1,y=Math.floor((h+2)*l)+1;y=Math.min(y,i);const m=y-g;for(;g<y;g++)p+=o(g),v+=a(g);p/=m,v/=m;let b=Math.floor((h+0)*l)+1;const x=Math.floor((h+1)*l)+1,w=[o(c),a(c)];for(u=f=-1;b<x;b++)f=Math.abs((w[0]-p)*(o(b)-w[1])-(w[0]-a(b))*(v-w[0]))*.5,f>u&&(u=f,d=b);s.push(d),c=d}return s.push(i-1),s.map(h=>t[h])}function yH(t){if(typeof t=="function")return t;if(t==="lttb")return gH;const e={first:r=>[r[0]],last:r=>[r[r.length-1]],min:(r,i,o)=>[r[Ph(r,a=>o[a])]],max:(r,i,o)=>[r[gl(r,a=>o[a])]],median:(r,i,o)=>[r[GY(r,a=>o[a])]]},n=e[t]||e.median;return(r,i,o,a)=>{const s=Math.max(1,Math.floor(r.length/a));return mH(r,s).flatMap(c=>n(c,i,o))}}function mH(t,e){const n=t.length,r=[];let i=0;for(;i<n;)r.push(t.slice(i,i+=e));return r}const OP=(t={})=>{const{strategy:e="median",thresholds:n=2e3,groupBy:r=["series","color"]}=t,i=yH(e);return(o,a)=>{const{encode:s}=a,l=Vo(r,o,a),[c]=It(s,"x"),[u]=It(s,"y");return[l.flatMap(f=>i(f,c,u,n)),a]}};OP.props={};function bH(t){return typeof t=="object"?[t.value,t.ordinal]:[t,!0]}const _P=(t={})=>(e,n)=>{const{encode:r,data:i}=n,o=Object.entries(t).map(([u,f])=>{const[d]=It(r,u);if(!d)return null;const[h,p=!0]=bH(f);if(typeof h=="function")return v=>h(d[v]);if(p){const v=Array.isArray(h)?h:[h];return v.length===0?null:g=>v.includes(d[g])}else{const[v,g]=h;return y=>d[y]>=v&&d[y]<=g}}).filter(ie);if(o.length===0)return[e,n];const a=u=>o.every(f=>f(u)),s=e.filter(a),l=s.map((u,f)=>f),c=Object.entries(r).map(([u,f])=>[u,Object.assign(Object.assign({},f),{value:l.map(d=>f.value[s[d]]).filter(d=>d!==void 0)})]);return[l,Z({},n,{encode:Object.fromEntries(c),data:s.map(u=>i[u])})]};_P.props={};function de(t){return function(){return t}}const SP=Math.abs,Sn=Math.atan2,is=Math.cos,xH=Math.max,Im=Math.min,Ai=Math.sin,Ol=Math.sqrt,En=1e-12,Bu=Math.PI,Vh=Bu/2,wH=2*Bu;function OH(t){return t>1?0:t<-1?Bu:Math.acos(t)}function EP(t){return t>=1?Vh:t<=-1?-Vh:Math.asin(t)}const jm=Math.PI,Dm=2*jm,os=1e-6,_H=Dm-os;function MP(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function SH(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return MP;const n=Ce(10,e);return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}let $m=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?MP:SH(e)}moveTo(e,n){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,n){this._append`L${this._x1=+e},${this._y1=+n}`}quadraticCurveTo(e,n,r,i){this._append`Q${+e},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(e,n,r,i,o,a){this._append`C${+e},${+n},${+r},${+i},${this._x1=+o},${this._y1=+a}`}arcTo(e,n,r,i,o){if(e=+e,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let a=this._x1,s=this._y1,l=r-e,c=i-n,u=a-e,f=s-n,d=u*u+f*f;if(this._x1===null)this._append`M${this._x1=e},${this._y1=n}`;else if(d>os)if(!(Math.abs(f*l-c*u)>os)||!o)this._append`L${this._x1=e},${this._y1=n}`;else{let h=r-a,p=i-s,v=l*l+c*c,g=h*h+p*p,y=Math.sqrt(v),m=Math.sqrt(d),b=o*Math.tan((jm-Math.acos((v+d-g)/(2*y*m)))/2),x=b/m,w=b/y;Math.abs(x-1)>os&&this._append`L${e+x*u},${n+x*f}`,this._append`A${o},${o},0,0,${+(f*h>u*p)},${this._x1=e+w*l},${this._y1=n+w*c}`}}arc(e,n,r,i,o,a){if(e=+e,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),l=r*Math.sin(i),c=e+s,u=n+l,f=1^a,d=a?i-o:o-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>os||Math.abs(this._y1-u)>os)&&this._append`L${c},${u}`,r&&(d<0&&(d=d%Dm+Dm),d>_H?this._append`A${r},${r},0,1,${f},${e-s},${n-l}A${r},${r},0,1,${f},${this._x1=c},${this._y1=u}`:d>os&&this._append`A${r},${r},0,${+(d>=jm)},${f},${this._x1=e+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(e,n,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function Nr(){return new $m}Nr.prototype=$m.prototype;function Fm(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new $m(e)}function EH(t){return t.innerRadius}function MH(t){return t.outerRadius}function PH(t){return t.startAngle}function AH(t){return t.endAngle}function CH(t){return t&&t.padAngle}function TH(t,e,n,r,i,o,a,s){var l=n-t,c=r-e,u=a-i,f=s-o,d=f*l-u*c;if(!(d*d<En))return d=(u*(e-o)-f*(t-i))/d,[t+d*l,e+d*c]}function Xh(t,e,n,r,i,o,a){var s=t-n,l=e-r,c=(a?o:-o)/Ol(s*s+l*l),u=c*l,f=-c*s,d=t+u,h=e+f,p=n+u,v=r+f,g=(d+p)/2,y=(h+v)/2,m=p-d,b=v-h,x=m*m+b*b,w=i-o,O=d*v-p*h,_=(b<0?-1:1)*Ol(xH(0,w*w*x-O*O)),S=(O*b-m*_)/x,E=(-O*m-b*_)/x,M=(O*b+m*_)/x,P=(-O*m+b*_)/x,C=S-g,A=E-y,T=M-g,k=P-y;return C*C+A*A>T*T+k*k&&(S=M,E=P),{cx:S,cy:E,x01:-u,y01:-f,x11:S*(i/w-1),y11:E*(i/w-1)}}function qh(){var t=EH,e=MH,n=de(0),r=null,i=PH,o=AH,a=CH,s=null,l=Fm(c);function c(){var u,f,d=+t.apply(this,arguments),h=+e.apply(this,arguments),p=i.apply(this,arguments)-Vh,v=o.apply(this,arguments)-Vh,g=SP(v-p),y=v>p;if(s||(s=u=l()),h<d&&(f=h,h=d,d=f),!(h>En))s.moveTo(0,0);else if(g>wH-En)s.moveTo(h*is(p),h*Ai(p)),s.arc(0,0,h,p,v,!y),d>En&&(s.moveTo(d*is(v),d*Ai(v)),s.arc(0,0,d,v,p,y));else{var m=p,b=v,x=p,w=v,O=g,_=g,S=a.apply(this,arguments)/2,E=S>En&&(r?+r.apply(this,arguments):Ol(d*d+h*h)),M=Im(SP(h-d)/2,+n.apply(this,arguments)),P=M,C=M,A,T;if(E>En){var k=EP(E/d*Ai(S)),N=EP(E/h*Ai(S));(O-=k*2)>En?(k*=y?1:-1,x+=k,w-=k):(O=0,x=w=(p+v)/2),(_-=N*2)>En?(N*=y?1:-1,m+=N,b-=N):(_=0,m=b=(p+v)/2)}var j=h*is(m),L=h*Ai(m),I=d*is(w),$=d*Ai(w);if(M>En){var F=h*is(b),R=h*Ai(b),B=d*is(x),W=d*Ai(x),K;if(g<Bu)if(K=TH(j,L,B,W,F,R,I,$)){var J=j-K[0],X=L-K[1],V=F-K[0],it=R-K[1],nt=1/Ai(OH((J*V+X*it)/(Ol(J*J+X*X)*Ol(V*V+it*it)))/2),lt=Ol(K[0]*K[0]+K[1]*K[1]);P=Im(M,(d-lt)/(nt-1)),C=Im(M,(h-lt)/(nt+1))}else P=C=0}_>En?C>En?(A=Xh(B,W,j,L,h,C,y),T=Xh(F,R,I,$,h,C,y),s.moveTo(A.cx+A.x01,A.cy+A.y01),C<M?s.arc(A.cx,A.cy,C,Sn(A.y01,A.x01),Sn(T.y01,T.x01),!y):(s.arc(A.cx,A.cy,C,Sn(A.y01,A.x01),Sn(A.y11,A.x11),!y),s.arc(0,0,h,Sn(A.cy+A.y11,A.cx+A.x11),Sn(T.cy+T.y11,T.cx+T.x11),!y),s.arc(T.cx,T.cy,C,Sn(T.y11,T.x11),Sn(T.y01,T.x01),!y))):(s.moveTo(j,L),s.arc(0,0,h,m,b,!y)):s.moveTo(j,L),!(d>En)||!(O>En)?s.lineTo(I,$):P>En?(A=Xh(I,$,F,R,d,-P,y),T=Xh(j,L,B,W,d,-P,y),s.lineTo(A.cx+A.x01,A.cy+A.y01),P<M?s.arc(A.cx,A.cy,P,Sn(A.y01,A.x01),Sn(T.y01,T.x01),!y):(s.arc(A.cx,A.cy,P,Sn(A.y01,A.x01),Sn(A.y11,A.x11),!y),s.arc(0,0,d,Sn(A.cy+A.y11,A.cx+A.x11),Sn(T.cy+T.y11,T.cx+T.x11),y),s.arc(T.cx,T.cy,P,Sn(T.y11,T.x11),Sn(T.y01,T.x01),!y))):s.arc(0,0,d,w,x,y)}if(s.closePath(),u)return s=null,u+""||null}return c.centroid=function(){var u=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,f=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-Bu/2;return[is(f)*u,Ai(f)*u]},c.innerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:de(+u),c):t},c.outerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:de(+u),c):e},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:de(+u),c):n},c.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:de(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:de(+u),c):i},c.endAngle=function(u){return arguments.length?(o=typeof u=="function"?u:de(+u),c):o},c.padAngle=function(u){return arguments.length?(a=typeof u=="function"?u:de(+u),c):a},c.context=function(u){return arguments.length?(s=u==null?null:u,c):s},c}function PP(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function AP(t){this._context=t}AP.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function zu(t){return new AP(t)}function CP(t){return t[0]}function TP(t){return t[1]}function Ko(t,e){var n=de(!0),r=null,i=zu,o=null,a=Fm(s);t=typeof t=="function"?t:t===void 0?CP:de(t),e=typeof e=="function"?e:e===void 0?TP:de(e);function s(l){var c,u=(l=PP(l)).length,f,d=!1,h;for(r==null&&(o=i(h=a())),c=0;c<=u;++c)!(c<u&&n(f=l[c],c,l))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+t(f,c,l),+e(f,c,l));if(h)return o=null,h+""||null}return s.x=function(l){return arguments.length?(t=typeof l=="function"?l:de(+l),s):t},s.y=function(l){return arguments.length?(e=typeof l=="function"?l:de(+l),s):e},s.defined=function(l){return arguments.length?(n=typeof l=="function"?l:de(!!l),s):n},s.curve=function(l){return arguments.length?(i=l,r!=null&&(o=i(r)),s):i},s.context=function(l){return arguments.length?(l==null?r=o=null:o=i(r=l),s):r},s}function Rm(t,e,n){var r=null,i=de(!0),o=null,a=zu,s=null,l=Fm(c);t=typeof t=="function"?t:t===void 0?CP:de(+t),e=typeof e=="function"?e:de(e===void 0?0:+e),n=typeof n=="function"?n:n===void 0?TP:de(+n);function c(f){var d,h,p,v=(f=PP(f)).length,g,y=!1,m,b=new Array(v),x=new Array(v);for(o==null&&(s=a(m=l())),d=0;d<=v;++d){if(!(d<v&&i(g=f[d],d,f))===y)if(y=!y)h=d,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),p=d-1;p>=h;--p)s.point(b[p],x[p]);s.lineEnd(),s.areaEnd()}y&&(b[d]=+t(g,d,f),x[d]=+e(g,d,f),s.point(r?+r(g,d,f):b[d],n?+n(g,d,f):x[d]))}if(m)return s=null,m+""||null}function u(){return Ko().defined(i).curve(a).context(o)}return c.x=function(f){return arguments.length?(t=typeof f=="function"?f:de(+f),r=null,c):t},c.x0=function(f){return arguments.length?(t=typeof f=="function"?f:de(+f),c):t},c.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:de(+f),c):r},c.y=function(f){return arguments.length?(e=typeof f=="function"?f:de(+f),n=null,c):e},c.y0=function(f){return arguments.length?(e=typeof f=="function"?f:de(+f),c):e},c.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:de(+f),c):n},c.lineX0=c.lineY0=function(){return u().x(t).y(e)},c.lineY1=function(){return u().x(t).y(n)},c.lineX1=function(){return u().x(r).y(e)},c.defined=function(f){return arguments.length?(i=typeof f=="function"?f:de(!!f),c):i},c.curve=function(f){return arguments.length?(a=f,o!=null&&(s=a(o)),c):a},c.context=function(f){return arguments.length?(f==null?o=s=null:s=a(o=f),c):o},c}var kP=Bm(zu);function LP(t){this._curve=t}LP.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};function Bm(t){function e(n){return new LP(t(n))}return e._curve=t,e}function Yu(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(n){return arguments.length?e(Bm(n)):e()._curve},t}function kH(){return Yu(Ko().curve(kP))}function LH(){var t=Rm().curve(kP),e=t.curve,n=t.lineX0,r=t.lineX1,i=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return Yu(n())},delete t.lineX0,t.lineEndAngle=function(){return Yu(r())},delete t.lineX1,t.lineInnerRadius=function(){return Yu(i())},delete t.lineY0,t.lineOuterRadius=function(){return Yu(o())},delete t.lineY1,t.curve=function(a){return arguments.length?e(Bm(a)):e()._curve},t}function _l(){}function zm(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Ym(t,e){this._context=t,this._k=(1-e)/6}Ym.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:zm(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:zm(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(r){return new Ym(r,e)}return n.tension=function(r){return t(+r)},n}(0);function Wm(t,e){this._context=t,this._k=(1-e)/6}Wm.prototype={areaStart:_l,areaEnd:_l,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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:zm(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(r){return new Wm(r,e)}return n.tension=function(r){return t(+r)},n}(0);function NP(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>En){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>En){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*c+t._x1*t._l23_2a-e*t._l12_2a)/u,a=(a*c+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function IP(t,e){this._context=t,this._alpha=e}IP.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(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:NP(this,t,e);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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(r){return e?new IP(r,e):new Ym(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function jP(t,e){this._context=t,this._alpha=e}jP.prototype={areaStart:_l,areaEnd:_l,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(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:NP(this,t,e);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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const DP=function t(e){function n(r){return e?new jP(r,e):new Wm(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function $P(t){this._context=t}$P.prototype={areaStart:_l,areaEnd:_l,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Gm(t){return new $P(t)}function FP(t){return t<0?-1:1}function RP(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(FP(o)+FP(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function BP(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Hm(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,s=(o-r)/3;t._context.bezierCurveTo(r+s,i+s*e,o-s,a-s*n,o,a)}function Kh(t){this._context=t}Kh.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:Hm(this,this._t0,BP(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Hm(this,BP(this,n=RP(this,t,e)),n);break;default:Hm(this,this._t0,n=RP(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function zP(t){this._context=new YP(t)}(zP.prototype=Object.create(Kh.prototype)).point=function(t,e){Kh.prototype.point.call(this,e,t)};function YP(t){this._context=t}YP.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}};function WP(t){return new Kh(t)}function GP(t){return new zP(t)}function Zh(t,e){this._context=t,this._t=e}Zh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function HP(t){return new Zh(t,.5)}function UP(t){return new Zh(t,0)}function VP(t){return new Zh(t,1)}function he(t){const{transformations:e}=t.getOptions();return e.map(([r])=>r).filter(r=>r==="transpose").length%2!==0}function ce(t){const{transformations:e}=t.getOptions();return e.some(([n])=>n==="polar")}function Qh(t){const{transformations:e}=t.getOptions();return e.some(([n])=>n==="reflect")&&e.some(([n])=>n.startsWith("transpose"))}function XP(t){const{transformations:e}=t.getOptions();return e.some(([n])=>n==="helix")}function Jh(t){const{transformations:e}=t.getOptions();return e.some(([n])=>n==="parallel")}function qP(t){const{transformations:e}=t.getOptions();return e.some(([n])=>n==="fisheye")}function NH(t){return Jh(t)&&ce(t)}function Sl(t){return XP(t)||ce(t)}function IH(t){return ce(t)&&he(t)}function jH(t){if(Sl(t)){const[e,n]=t.getSize(),r=t.getOptions().transformations.find(i=>i[0]==="polar");if(r)return Math.max(e,n)/2*r[4]}return 0}function tp(t){const{transformations:e}=t.getOptions(),[,,,n,r]=e.find(i=>i[0]==="polar");return[+n,+r]}function Um(t,e=!0){const{transformations:n}=t.getOptions(),[,r,i]=n.find(o=>o[0]==="polar");return e?[+r*180/Math.PI,+i*180/Math.PI]:[r,i]}function DH(t,e){const{transformations:n}=t.getOptions(),[,...r]=n.find(i=>i[0]===e);return r}var KP={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(l,c,u){this.fn=l,this.context=c,this.once=u||!1}function o(l,c,u,f,d){if(typeof u!="function")throw new TypeError("The listener must be a function");var h=new i(u,f||l,d),p=n?n+c:c;return l._events[p]?l._events[p].fn?l._events[p]=[l._events[p],h]:l._events[p].push(h):(l._events[p]=h,l._eventsCount++),l}function a(l,c){--l._eventsCount===0?l._events=new r:delete l._events[c]}function s(){this._events=new r,this._eventsCount=0}s.prototype.eventNames=function(){var c=[],u,f;if(this._eventsCount===0)return c;for(f in u=this._events)e.call(u,f)&&c.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(u)):c},s.prototype.listeners=function(c){var u=n?n+c:c,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,h=f.length,p=new Array(h);d<h;d++)p[d]=f[d].fn;return p},s.prototype.listenerCount=function(c){var u=n?n+c:c,f=this._events[u];return f?f.fn?1:f.length:0},s.prototype.emit=function(c,u,f,d,h,p){var v=n?n+c:c;if(!this._events[v])return!1;var g=this._events[v],y=arguments.length,m,b;if(g.fn){switch(g.once&&this.removeListener(c,g.fn,void 0,!0),y){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,u),!0;case 3:return g.fn.call(g.context,u,f),!0;case 4:return g.fn.call(g.context,u,f,d),!0;case 5:return g.fn.call(g.context,u,f,d,h),!0;case 6:return g.fn.call(g.context,u,f,d,h,p),!0}for(b=1,m=new Array(y-1);b<y;b++)m[b-1]=arguments[b];g.fn.apply(g.context,m)}else{var x=g.length,w;for(b=0;b<x;b++)switch(g[b].once&&this.removeListener(c,g[b].fn,void 0,!0),y){case 1:g[b].fn.call(g[b].context);break;case 2:g[b].fn.call(g[b].context,u);break;case 3:g[b].fn.call(g[b].context,u,f);break;case 4:g[b].fn.call(g[b].context,u,f,d);break;default:if(!m)for(w=1,m=new Array(y-1);w<y;w++)m[w-1]=arguments[w];g[b].fn.apply(g[b].context,m)}}return!0},s.prototype.on=function(c,u,f){return o(this,c,u,f,!1)},s.prototype.once=function(c,u,f){return o(this,c,u,f,!0)},s.prototype.removeListener=function(c,u,f,d){var h=n?n+c:c;if(!this._events[h])return this;if(!u)return a(this,h),this;var p=this._events[h];if(p.fn)p.fn===u&&(!d||p.once)&&(!f||p.context===f)&&a(this,h);else{for(var v=0,g=[],y=p.length;v<y;v++)(p[v].fn!==u||d&&!p[v].once||f&&p[v].context!==f)&&g.push(p[v]);g.length?this._events[h]=g.length===1?g[0]:g:a(this,h)}return this},s.prototype.removeAllListeners=function(c){var u;return c?(u=n?n+c:c,this._events[u]&&a(this,u)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s})(KP);var $H=KP.exports;const Vm=lu($H);var FH=function(t){return t==null};const Ot=FH;var RH={}.toString,BH=function(t,e){return RH.call(t)==="[object "+e+"]"};const ep=BH,Xm=function(t){return Array.isArray?Array.isArray(t):ep(t,"Array")},np=function(t){var e=typeof t;return t!==null&&e==="object"||e==="function"},ZP=function(t){if(Xm(t))return t.reduce(function(e,n){return Math.max(e,n)},t[0])},QP=function(t){if(Xm(t))return t.reduce(function(e,n){return Math.min(e,n)},t[0])},ao=function(t){return ep(t,"String")};var zH=function(t,e,n){return t<e?e:t>n?n:t};const Wu=zH;var YH=function(t){return ep(t,"Number")};const as=YH;var WH=1e-5;function GH(t,e,n){return n===void 0&&(n=WH),Math.abs(t-e)<n}var HH=function(t,e){return(t%e+e)%e};const JP=HH;var UH=function(t){return ep(t,"Boolean")};const tA=UH;var VH=function(t){return t===void 0};const Le=VH;var eA={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function XH(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],i=n;r.length;)e[n]="A",t.splice(i+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var Gu={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function nA(t){return Array.isArray(t)&&t.every(function(e){var n=e[0].toLowerCase();return Gu[n]===e.length-1&&"achlmqstvz".includes(n)})}function rA(t){return nA(t)&&t.every(function(e){var n=e[0];return n===n.toUpperCase()})}function iA(t){return rA(t)&&t.every(function(e){var n=e[0];return"ACLMQZ".includes(n)})}function oA(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=Gu[n]&&(n==="m"&&r.length>2?(t.segments.push([e].concat(r.splice(0,2))),n="l",e=e==="m"?"l":"L"):t.segments.push([e].concat(r.splice(0,Gu[n]))),!!Gu[n]););}function qH(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);if(r===48){t.param=0,t.index+=1;return}if(r===49){t.param=1,t.index+=1;return}t.err='[path-util]: invalid Arc flag "'+n[e]+'", expecting 0 or 1 at index '+e}function KH(t){return t>=48&&t<=57||t===43||t===45||t===46}function El(t){return t>=48&&t<=57}function ZH(t){var e=t.max,n=t.pathValue,r=t.index,i=r,o=!1,a=!1,s=!1,l=!1,c;if(i>=e){t.err="[path-util]: Invalid path value at index "+i+', "pathValue" is missing param';return}if(c=n.charCodeAt(i),(c===43||c===45)&&(i+=1,c=n.charCodeAt(i)),!El(c)&&c!==46){t.err="[path-util]: Invalid path value at index "+i+', "'+n[i]+'" is not a number';return}if(c!==46){if(o=c===48,i+=1,c=n.charCodeAt(i),o&&i<e&&c&&El(c)){t.err="[path-util]: Invalid path value at index "+r+', "'+n[r]+'" illegal number';return}for(;i<e&&El(n.charCodeAt(i));)i+=1,a=!0;c=n.charCodeAt(i)}if(c===46){for(l=!0,i+=1;El(n.charCodeAt(i));)i+=1,s=!0;c=n.charCodeAt(i)}if(c===101||c===69){if(l&&!a&&!s){t.err="[path-util]: Invalid path value at index "+i+', "'+n[i]+'" invalid float exponent';return}if(i+=1,c=n.charCodeAt(i),(c===43||c===45)&&(i+=1),i<e&&El(n.charCodeAt(i)))for(;i<e&&El(n.charCodeAt(i));)i+=1;else{t.err="[path-util]: Invalid path value at index "+i+', "'+n[i]+'" invalid integer exponent';return}}t.index=i,t.param=+t.pathValue.slice(r,i)}function QH(t){var e=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];return t===10||t===13||t===8232||t===8233||t===32||t===9||t===11||t===12||t===160||t>=5760&&e.includes(t)}function rp(t){for(var e=t.pathValue,n=t.max;t.index<n&&QH(e.charCodeAt(t.index));)t.index+=1}function JH(t){switch(t|32){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}function tU(t){return(t|32)===97}function eU(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),o=Gu[n[r].toLowerCase()];if(t.segmentStart=r,!JH(i)){t.err='[path-util]: Invalid path value "'+n[r]+'" is not a path command';return}if(t.index+=1,rp(t),t.data=[],!o){oA(t);return}for(;;){for(var a=o;a>0;a-=1){if(tU(i)&&(a===3||a===4)?qH(t):ZH(t),t.err.length)return;t.data.push(t.param),rp(t),t.index<e&&n.charCodeAt(t.index)===44&&(t.index+=1,rp(t))}if(t.index>=t.max||!KH(n.charCodeAt(t.index)))break}oA(t)}var nU=function(){function t(e){this.pathValue=e,this.segments=[],this.max=e.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""}return t}();function rU(t){if(nA(t))return[].concat(t);var e=new nU(t);for(rp(e);e.index<e.max&&!e.err.length;)eU(e);return e.err?e.err:e.segments}function iU(t){if(rA(t))return[].concat(t);var e=rU(t),n=0,r=0,i=0,o=0;return e.map(function(a){var s=a.slice(1).map(Number),l=a[0],c=l.toUpperCase();if(l==="M")return n=s[0],r=s[1],i=n,o=r,["M",n,r];var u;if(l!==c)switch(c){case"A":u=[c,s[0],s[1],s[2],s[3],s[4],s[5]+n,s[6]+r];break;case"V":u=[c,s[0]+r];break;case"H":u=[c,s[0]+n];break;default:{var f=s.map(function(h,p){return h+(p%2?r:n)});u=[c].concat(f)}}else u=[c].concat(s);var d=u.length;switch(c){case"Z":n=i,r=o;break;case"H":n=u[1];break;case"V":r=u[1];break;default:n=u[d-2],r=u[d-1],c==="M"&&(i=n,o=r)}return u})}function oU(t,e){var n=t[0],r=e.x1,i=e.y1,o=e.x2,a=e.y2,s=t.slice(1).map(Number),l=t;if("TQ".includes(n)||(e.qx=null,e.qy=null),n==="H")l=["L",t[1],i];else if(n==="V")l=["L",r,t[1]];else if(n==="S"){var c=r*2-o,u=i*2-a;e.x1=c,e.y1=u,l=["C",c,u].concat(s)}else if(n==="T"){var f=r*2-e.qx,d=i*2-e.qy;e.qx=f,e.qy=d,l=["Q",f,d].concat(s)}else if(n==="Q"){var h=s[0],p=s[1];e.qx=h,e.qy=p}return l}function ip(t){if(iA(t))return[].concat(t);for(var e=iU(t),n=G({},eA),r=0;r<e.length;r+=1){e[r]=oU(e[r],n);var i=e[r],o=i.length;n.x1=+i[o-2],n.y1=+i[o-1],n.x2=+i[o-4]||n.x1,n.y2=+i[o-3]||n.y1}return e}function aU(t){return iA(t)&&t.every(function(e){var n=e[0];return"MC".includes(n)})}function op(t,e,n){var r=t*Math.cos(n)-e*Math.sin(n),i=t*Math.sin(n)+e*Math.cos(n);return{x:r,y:i}}function aA(t,e,n,r,i,o,a,s,l,c){var u=t,f=e,d=n,h=r,p=s,v=l,g=Math.PI*120/180,y=Math.PI/180*(+i||0),m=[],b,x,w,O,_;if(c)x=c[0],w=c[1],O=c[2],_=c[3];else{b=op(u,f,-y),u=b.x,f=b.y,b=op(p,v,-y),p=b.x,v=b.y;var S=(u-p)/2,E=(f-v)/2,M=S*S/(d*d)+E*E/(h*h);M>1&&(M=Math.sqrt(M),d*=M,h*=M);var P=d*d,C=h*h,A=(o===a?-1:1)*Math.sqrt(Math.abs((P*C-P*E*E-C*S*S)/(P*E*E+C*S*S)));O=A*d*E/h+(u+p)/2,_=A*-h*S/d+(f+v)/2,x=Math.asin(((f-_)/h*Math.pow(10,9)>>0)/Math.pow(10,9)),w=Math.asin(((v-_)/h*Math.pow(10,9)>>0)/Math.pow(10,9)),x=u<O?Math.PI-x:x,w=p<O?Math.PI-w:w,x<0&&(x=Math.PI*2+x),w<0&&(w=Math.PI*2+w),a&&x>w&&(x-=Math.PI*2),!a&&w>x&&(w-=Math.PI*2)}var T=w-x;if(Math.abs(T)>g){var k=w,N=p,j=v;w=x+g*(a&&w>x?1:-1),p=O+d*Math.cos(w),v=_+h*Math.sin(w),m=aA(p,v,d,h,i,0,a,N,j,[w,k,O,_])}T=w-x;var L=Math.cos(x),I=Math.sin(x),$=Math.cos(w),F=Math.sin(w),R=Math.tan(T/4),B=4/3*d*R,W=4/3*h*R,K=[u,f],J=[u+B*I,f-W*L],X=[p+B*F,v-W*$],V=[p,v];if(J[0]=2*K[0]-J[0],J[1]=2*K[1]-J[1],c)return J.concat(X,V,m);m=J.concat(X,V,m);for(var it=[],nt=0,lt=m.length;nt<lt;nt+=1)it[nt]=nt%2?op(m[nt-1],m[nt],y).y:op(m[nt],m[nt+1],y).x;return it}function sU(t,e,n,r,i,o){var a=.3333333333333333,s=2/3;return[a*t+s*n,a*e+s*r,a*i+s*n,a*o+s*r,i,o]}function Zo(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return[r+(o-r)*n,i+(a-i)*n]}var sA=function(t,e,n,r){var i=.5,o=Zo([t,e],[n,r],i);return Q(Q([],o,!0),[n,r,n,r],!1)};function lU(t,e){var n=t[0],r=t.slice(1).map(Number),i=r[0],o=r[1],a,s=e.x1,l=e.y1,c=e.x,u=e.y;switch("TQ".includes(n)||(e.qx=null,e.qy=null),n){case"M":return e.x=i,e.y=o,t;case"A":return a=[s,l].concat(r),["C"].concat(aA(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9]));case"Q":return e.qx=i,e.qy=o,a=[s,l].concat(r),["C"].concat(sU(a[0],a[1],a[2],a[3],a[4],a[5]));case"L":return["C"].concat(sA(s,l,i,o));case"Z":return s===c&&l===u?["C",s,l,c,u,c,u]:["C"].concat(sA(s,l,c,u))}return t}function qm(t,e){if(e===void 0&&(e=!1),aU(t)){var n=[].concat(t);return e?[n,[]]:n}for(var r=ip(t),i=G({},eA),o=[],a="",s=r.length,l,c,u=[],f=0;f<s;f+=1){r[f]&&(a=r[f][0]),o[f]=a;var d=lU(r[f],i);r[f]=d,XH(r,o,f),s=r.length,a==="Z"&&u.push(f),l=r[f],c=l.length,i.x1=+l[c-2],i.y1=+l[c-1],i.x2=+l[c-4]||i.x1,i.y2=+l[c-3]||i.y1}return e?[r,u]:r}function cU(t){return t.map(function(e){return Array.isArray(e)?[].concat(e):e})}function uU(t){var e=t.slice(1).map(function(n,r,i){return r?i[r-1].slice(-2).concat(n.slice(1)):t[0].slice(1).concat(n.slice(1))}).map(function(n){return n.map(function(r,i){return n[n.length-i-2*(1-i%2)]})}).reverse();return[["M"].concat(e[0].slice(0,2))].concat(e.map(function(n){return["C"].concat(n.slice(2))}))}function hr(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function Km(t,e,n,r,i){var o=hr([t,e],[n,r]),a={x:0,y:0};if(typeof i=="number")if(i<=0)a={x:t,y:e};else if(i>=o)a={x:n,y:r};else{var s=Zo([t,e],[n,r],i/o),l=s[0],c=s[1];a={x:l,y:c}}return{length:o,point:a,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function lA(t,e){var n=t.x,r=t.y,i=e.x,o=e.y,a=n*i+r*o,s=Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(o,2))),l=n*o-r*i<0?-1:1,c=l*Math.acos(a/s);return c}function fU(t,e,n,r,i,o,a,s,l,c){var u=Math.abs,f=Math.sin,d=Math.cos,h=Math.sqrt,p=Math.PI,v=u(n),g=u(r),y=(i%360+360)%360,m=y*(p/180);if(t===s&&e===l)return{x:t,y:e};if(v===0||g===0)return Km(t,e,s,l,c).point;var b=(t-s)/2,x=(e-l)/2,w={x:d(m)*b+f(m)*x,y:-f(m)*b+d(m)*x},O=Math.pow(w.x,2)/Math.pow(v,2)+Math.pow(w.y,2)/Math.pow(g,2);O>1&&(v*=h(O),g*=h(O));var _=Math.pow(v,2)*Math.pow(g,2)-Math.pow(v,2)*Math.pow(w.y,2)-Math.pow(g,2)*Math.pow(w.x,2),S=Math.pow(v,2)*Math.pow(w.y,2)+Math.pow(g,2)*Math.pow(w.x,2),E=_/S;E=E<0?0:E;var M=(o!==a?1:-1)*h(E),P={x:M*(v*w.y/g),y:M*(-(g*w.x)/v)},C={x:d(m)*P.x-f(m)*P.y+(t+s)/2,y:f(m)*P.x+d(m)*P.y+(e+l)/2},A={x:(w.x-P.x)/v,y:(w.y-P.y)/g},T=lA({x:1,y:0},A),k={x:(-w.x-P.x)/v,y:(-w.y-P.y)/g},N=lA(A,k);!a&&N>0?N-=2*p:a&&N<0&&(N+=2*p),N%=2*p;var j=T+N*c,L=v*d(j),I=g*f(j),$={x:d(m)*L-f(m)*I+C.x,y:f(m)*L+d(m)*I+C.y};return $}function dU(t,e,n,r,i,o,a,s,l,c,u){var f,d=u.bbox,h=d===void 0?!0:d,p=u.length,v=p===void 0?!0:p,g=u.sampleSize,y=g===void 0?30:g,m=typeof c=="number",b=t,x=e,w=0,O=[b,x,w],_=[b,x],S=0,E={x:0,y:0},M=[{x:b,y:x}];m&&c<=0&&(E={x:b,y:x});for(var P=0;P<=y;P+=1){if(S=P/y,f=fU(t,e,n,r,i,o,a,s,l,S),b=f.x,x=f.y,h&&M.push({x:b,y:x}),v&&(w+=hr(_,[b,x])),_=[b,x],m&&w>=c&&c>O[2]){var C=(w-c)/(w-O[2]);E={x:_[0]*(1-C)+O[0]*C,y:_[1]*(1-C)+O[1]*C}}O=[b,x,w]}return m&&c>=w&&(E={x:s,y:l}),{length:w,point:E,min:{x:Math.min.apply(null,M.map(function(A){return A.x})),y:Math.min.apply(null,M.map(function(A){return A.y}))},max:{x:Math.max.apply(null,M.map(function(A){return A.x})),y:Math.max.apply(null,M.map(function(A){return A.y}))}}}function hU(t,e,n,r,i,o,a,s,l){var c=1-l;return{x:Math.pow(c,3)*t+3*Math.pow(c,2)*l*n+3*c*Math.pow(l,2)*i+Math.pow(l,3)*a,y:Math.pow(c,3)*e+3*Math.pow(c,2)*l*r+3*c*Math.pow(l,2)*o+Math.pow(l,3)*s}}function cA(t,e,n,r,i,o,a,s,l,c){var u,f=c.bbox,d=f===void 0?!0:f,h=c.length,p=h===void 0?!0:h,v=c.sampleSize,g=v===void 0?10:v,y=typeof l=="number",m=t,b=e,x=0,w=[m,b,x],O=[m,b],_=0,S={x:0,y:0},E=[{x:m,y:b}];y&&l<=0&&(S={x:m,y:b});for(var M=0;M<=g;M+=1){if(_=M/g,u=hU(t,e,n,r,i,o,a,s,_),m=u.x,b=u.y,d&&E.push({x:m,y:b}),p&&(x+=hr(O,[m,b])),O=[m,b],y&&x>=l&&l>w[2]){var P=(x-l)/(x-w[2]);S={x:O[0]*(1-P)+w[0]*P,y:O[1]*(1-P)+w[1]*P}}w=[m,b,x]}return y&&l>=x&&(S={x:a,y:s}),{length:x,point:S,min:{x:Math.min.apply(null,E.map(function(C){return C.x})),y:Math.min.apply(null,E.map(function(C){return C.y}))},max:{x:Math.max.apply(null,E.map(function(C){return C.x})),y:Math.max.apply(null,E.map(function(C){return C.y}))}}}function pU(t,e,n,r,i,o,a){var s=1-a;return{x:Math.pow(s,2)*t+2*s*a*n+Math.pow(a,2)*i,y:Math.pow(s,2)*e+2*s*a*r+Math.pow(a,2)*o}}function vU(t,e,n,r,i,o,a,s){var l,c=s.bbox,u=c===void 0?!0:c,f=s.length,d=f===void 0?!0:f,h=s.sampleSize,p=h===void 0?10:h,v=typeof a=="number",g=t,y=e,m=0,b=[g,y,m],x=[g,y],w=0,O={x:0,y:0},_=[{x:g,y}];v&&a<=0&&(O={x:g,y});for(var S=0;S<=p;S+=1){if(w=S/p,l=pU(t,e,n,r,i,o,w),g=l.x,y=l.y,u&&_.push({x:g,y}),d&&(m+=hr(x,[g,y])),x=[g,y],v&&m>=a&&a>b[2]){var E=(m-a)/(m-b[2]);O={x:x[0]*(1-E)+b[0]*E,y:x[1]*(1-E)+b[1]*E}}b=[g,y,m]}return v&&a>=m&&(O={x:i,y:o}),{length:m,point:O,min:{x:Math.min.apply(null,_.map(function(M){return M.x})),y:Math.min.apply(null,_.map(function(M){return M.y}))},max:{x:Math.max.apply(null,_.map(function(M){return M.x})),y:Math.max.apply(null,_.map(function(M){return M.y}))}}}function uA(t,e,n){for(var r,i,o,a,s,l,c=ip(t),u=typeof e=="number",f,d=[],h,p=0,v=0,g=0,y=0,m,b=[],x=[],w=0,O={x:0,y:0},_=O,S=O,E=O,M=0,P=0,C=c.length;P<C;P+=1)m=c[P],h=m[0],f=h==="M",d=f?d:[p,v].concat(m.slice(1)),f?(g=m[1],y=m[2],O={x:g,y},_=O,w=0,u&&e<.001&&(E=O)):h==="L"?(r=Km(d[0],d[1],d[2],d[3],(e||0)-M),w=r.length,O=r.min,_=r.max,S=r.point):h==="A"?(i=dU(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],(e||0)-M,n||{}),w=i.length,O=i.min,_=i.max,S=i.point):h==="C"?(o=cA(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],(e||0)-M,n||{}),w=o.length,O=o.min,_=o.max,S=o.point):h==="Q"?(a=vU(d[0],d[1],d[2],d[3],d[4],d[5],(e||0)-M,n||{}),w=a.length,O=a.min,_=a.max,S=a.point):h==="Z"&&(d=[p,v,g,y],s=Km(d[0],d[1],d[2],d[3],(e||0)-M),w=s.length,O=s.min,_=s.max,S=s.point),u&&M<e&&M+w>=e&&(E=S),x.push(_),b.push(O),M+=w,l=h!=="Z"?m.slice(-2):[g,y],p=l[0],v=l[1];return u&&e>=M&&(E={x:p,y:v}),{length:M,point:E,min:{x:Math.min.apply(null,b.map(function(A){return A.x})),y:Math.min.apply(null,b.map(function(A){return A.y}))},max:{x:Math.max.apply(null,x.map(function(A){return A.x})),y:Math.max.apply(null,x.map(function(A){return A.y}))}}}function gU(t,e){return uA(t,void 0,G(G({},e),{bbox:!1,length:!0})).length}function yU(t){var e=t.length,n=e-1;return t.map(function(r,i){return t.map(function(o,a){var s=i+a,l;return a===0||t[s]&&t[s][0]==="M"?(l=t[s],["M"].concat(l.slice(-2))):(s>=e&&(s-=n),t[s])})})}function mU(t,e){var n=t.length-1,r=[],i=0,o=0,a=yU(t);return a.forEach(function(s,l){t.slice(1).forEach(function(c,u){o+=hr(t[(l+u)%n].slice(-2),e[u%n].slice(-2))}),r[l]=o,o=0}),i=r.indexOf(Math.min.apply(null,r)),a[i]}function bU(t,e,n,r,i,o,a,s){return 3*((s-e)*(n+i)-(a-t)*(r+o)+r*(t-i)-n*(e-o)+s*(i+t/3)-a*(o+e/3))/20}function xU(t){var e=0,n=0,r=0;return qm(t).map(function(i){var o;switch(i[0]){case"M":return e=i[1],n=i[2],0;default:var a=i.slice(1),s=a[0],l=a[1],c=a[2],u=a[3],f=a[4],d=a[5];return r=bU(e,n,s,l,c,u,f,d),o=i.slice(-2),e=o[0],n=o[1],r}}).reduce(function(i,o){return i+o},0)}function fA(t){return xU(t)>=0}function wU(t,e,n){return uA(t,e,G(G({},n),{bbox:!1,length:!0})).point}function OU(t,e){e===void 0&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),a=Zo(n,r,e),s=Zo(r,i,e),l=Zo(i,o,e),c=Zo(a,s,e),u=Zo(s,l,e),f=Zo(c,u,e);return[["C"].concat(a,c,f),["C"].concat(u,l,o)]}function dA(t){return t.map(function(e,n,r){var i=n&&r[n-1].slice(-2).concat(e.slice(1)),o=n?cA(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8],{bbox:!1}).length:0,a;return n?a=o?OU(i):[e,e]:a=[e],{s:e,ss:a,l:o}})}function hA(t,e,n){var r=dA(t),i=dA(e),o=r.length,a=i.length,s=r.filter(function(g){return g.l}).length,l=i.filter(function(g){return g.l}).length,c=r.filter(function(g){return g.l}).reduce(function(g,y){var m=y.l;return g+m},0)/s||0,u=i.filter(function(g){return g.l}).reduce(function(g,y){var m=y.l;return g+m},0)/l||0,f=n||Math.max(o,a),d=[c,u],h=[f-o,f-a],p=0,v=[r,i].map(function(g,y){return g.l===f?g.map(function(m){return m.s}):g.map(function(m,b){return p=b&&h[y]&&m.l>=d[y],h[y]-=p?1:0,p?m.ss:[m.s]}).flat()});return v[0].length===v[1].length?v:hA(v[0],v[1],f)}function Zm(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function pA(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Hu(){}var Uu=.7,ap=1/Uu,Ml="\\s*([+-]?\\d+)\\s*",Vu="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ci="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",_U=/^#([0-9a-f]{3,8})$/,SU=new RegExp("^rgb\\("+[Ml,Ml,Ml]+"\\)$"),EU=new RegExp("^rgb\\("+[Ci,Ci,Ci]+"\\)$"),MU=new RegExp("^rgba\\("+[Ml,Ml,Ml,Vu]+"\\)$"),PU=new RegExp("^rgba\\("+[Ci,Ci,Ci,Vu]+"\\)$"),AU=new RegExp("^hsl\\("+[Vu,Ci,Ci]+"\\)$"),CU=new RegExp("^hsla\\("+[Vu,Ci,Ci,Vu]+"\\)$"),vA={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};Zm(Hu,sp,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:gA,formatHex:gA,formatHsl:TU,formatRgb:yA,toString:yA});function gA(){return this.rgb().formatHex()}function TU(){return OA(this).formatHsl()}function yA(){return this.rgb().formatRgb()}function sp(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=_U.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?mA(e):n===3?new pr(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?lp(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?lp(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=SU.exec(t))?new pr(e[1],e[2],e[3],1):(e=EU.exec(t))?new pr(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=MU.exec(t))?lp(e[1],e[2],e[3],e[4]):(e=PU.exec(t))?lp(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=AU.exec(t))?wA(e[1],e[2]/100,e[3]/100,1):(e=CU.exec(t))?wA(e[1],e[2]/100,e[3]/100,e[4]):vA.hasOwnProperty(t)?mA(vA[t]):t==="transparent"?new pr(NaN,NaN,NaN,0):null}function mA(t){return new pr(t>>16&255,t>>8&255,t&255,1)}function lp(t,e,n,r){return r<=0&&(t=e=n=NaN),new pr(t,e,n,r)}function kU(t){return t instanceof Hu||(t=sp(t)),t?(t=t.rgb(),new pr(t.r,t.g,t.b,t.opacity)):new pr}function LU(t,e,n,r){return arguments.length===1?kU(t):new pr(t,e,n,r==null?1:r)}function pr(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}Zm(pr,LU,pA(Hu,{brighter:function(t){return t=t==null?ap:Math.pow(ap,t),new pr(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=t==null?Uu:Math.pow(Uu,t),new pr(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:bA,formatHex:bA,formatRgb:xA,toString:xA}));function bA(){return"#"+Qm(this.r)+Qm(this.g)+Qm(this.b)}function xA(){var t=this.opacity;return t=isNaN(t)?1:Math.max(0,Math.min(1,t)),(t===1?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(t===1?")":", "+t+")")}function Qm(t){return t=Math.max(0,Math.min(255,Math.round(t)||0)),(t<16?"0":"")+t.toString(16)}function wA(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Ti(t,e,n,r)}function OA(t){if(t instanceof Ti)return new Ti(t.h,t.s,t.l,t.opacity);if(t instanceof Hu||(t=sp(t)),!t)return new Ti;if(t instanceof Ti)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(e===o?a=(n-r)/s+(n<r)*6:n===o?a=(r-e)/s+2:a=(e-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new Ti(a,s,l,t.opacity)}function NU(t,e,n,r){return arguments.length===1?OA(t):new Ti(t,e,n,r==null?1:r)}function Ti(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}Zm(Ti,NU,pA(Hu,{brighter:function(t){return t=t==null?ap:Math.pow(ap,t),new Ti(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=t==null?Uu:Math.pow(Uu,t),new Ti(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new pr(Jm(t>=240?t-240:t+120,i,r),Jm(t,i,r),Jm(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return t=isNaN(t)?1:Math.max(0,Math.min(1,t)),(t===1?"hsl(":"hsla(")+(this.h||0)+", "+(this.s||0)*100+"%, "+(this.l||0)*100+"%"+(t===1?")":", "+t+")")}}));function Jm(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}var IU=1e-5;function cp(t,e,n){return n===void 0&&(n=IU),Math.abs(t-e)<n}function so(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function _A(t,e){var n=Math.min.apply(Math,Q([],D(t),!1)),r=Math.min.apply(Math,Q([],D(e),!1)),i=Math.max.apply(Math,Q([],D(t),!1)),o=Math.max.apply(Math,Q([],D(e),!1));return{x:n,y:r,width:i-n,height:o-r}}function jU(t,e,n){return Math.atan(-e/t*Math.tan(n))}function DU(t,e,n){return Math.atan(e/(t*Math.tan(n)))}function $U(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function FU(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}function RU(t,e,n,r,i,o,a){for(var s=jU(n,r,i),l=1/0,c=-1/0,u=[o,a],f=-Math.PI*2;f<=Math.PI*2;f+=Math.PI){var d=s+f;o<a?o<d&&d<a&&u.push(d):a<d&&d<o&&u.push(d)}for(var f=0;f<u.length;f++){var h=$U(t,e,n,r,i,u[f]);h<l&&(l=h),h>c&&(c=h)}for(var p=DU(n,r,i),v=1/0,g=-1/0,y=[o,a],f=-Math.PI*2;f<=Math.PI*2;f+=Math.PI){var m=p+f;o<a?o<m&&m<a&&y.push(m):a<m&&m<o&&y.push(m)}for(var f=0;f<y.length;f++){var b=FU(t,e,n,r,i,y[f]);b<v&&(v=b),b>g&&(g=b)}return{x:l,y:v,width:c-l,height:g-v}}var BU=1e-4;function SA(t,e,n,r,i,o){var a=-1,s=1/0,l=[n,r],c=20;o&&o>200&&(c=o/10);for(var u=1/c,f=u/10,d=0;d<=c;d++){var h=d*u,p=[i.apply(void 0,Q([],D(t.concat([h])),!1)),i.apply(void 0,Q([],D(e.concat([h])),!1))],v=so(l[0],l[1],p[0],p[1]);v<s&&(a=h,s=v)}if(a===0)return{x:t[0],y:e[0]};if(a===1){var g=t.length;return{x:t[g-1],y:e[g-1]}}s=1/0;for(var d=0;d<32&&!(f<BU);d++){var y=a-f,m=a+f,p=[i.apply(void 0,Q([],D(t.concat([y])),!1)),i.apply(void 0,Q([],D(e.concat([y])),!1))],v=so(l[0],l[1],p[0],p[1]);if(y>=0&&v<s)a=y,s=v;else{var b=[i.apply(void 0,Q([],D(t.concat([m])),!1)),i.apply(void 0,Q([],D(e.concat([m])),!1))],x=so(l[0],l[1],b[0],b[1]);m<=1&&x<s?(a=m,s=x):f*=.5}}return{x:i.apply(void 0,Q([],D(t.concat([a])),!1)),y:i.apply(void 0,Q([],D(e.concat([a])),!1))}}function EA(t,e,n,r){return so(t,e,n,r)}function MA(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function zU(t,e,n,r,i,o){var a=[n-t,r-e];if(gY(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var s=[-a[1],a[0]];pY(s,s);var l=[i-t,o-e];return Math.abs(vY(l,s))}function t1(t,e,n,r,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*n*i*i*o+r*i*i*i}function PA(t,e,n,r){var i=-3*t+9*e-9*n+3*r,o=6*t-12*e+6*n,a=3*e-3*t,s=[],l,c,u;if(cp(i,0))cp(o,0)||(l=-a/o,l>=0&&l<=1&&s.push(l));else{var f=o*o-4*i*a;cp(f,0)?s.push(-o/(2*i)):f>0&&(u=Math.sqrt(f),l=(-o+u)/(2*i),c=(-o-u)/(2*i),l>=0&&l<=1&&s.push(l),c>=0&&c<=1&&s.push(c))}return s}function YU(t,e,n,r,i,o,a,s){for(var l=[t,a],c=[e,s],u=PA(t,n,i,a),f=PA(e,r,o,s),d=0;d<u.length;d++)l.push(t1(t,n,i,a,u[d]));for(var d=0;d<f.length;d++)c.push(t1(e,r,o,s,f[d]));return _A(l,c)}function WU(t,e,n,r,i,o,a,s,l,c,u){return SA([t,n,i,a],[e,r,o,s],l,c,t1,u)}function AA(t,e,n,r,i,o,a,s,l,c,u){var f=WU(t,e,n,r,i,o,a,s,l,c,u);return so(f.x,f.y,l,c)}function GU(t){if(t.length<2)return 0;for(var e=0,n=0;n<t.length-1;n++){var r=t[n],i=t[n+1];e+=so(r[0],r[1],i[0],i[1])}return e}function HU(t){return GU(t)}function e1(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function CA(t,e,n){var r=t+n-2*e;if(cp(r,0))return[.5];var i=(t-e)/r;return i<=1&&i>=0?[i]:[]}function UU(t,e,n,r,i,o){var a=CA(t,n,i)[0],s=CA(e,r,o)[0],l=[t,i],c=[e,o];return a!==void 0&&l.push(e1(t,n,i,a)),s!==void 0&&c.push(e1(e,r,o,s)),_A(l,c)}function VU(t,e,n,r,i,o,a,s){return SA([t,n,i],[e,r,o],a,s,e1)}function XU(t,e,n,r,i,o,a,s){var l=VU(t,e,n,r,i,o,a,s);return so(l.x,l.y,a,s)}var qU=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},TA={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(qU,function(){function n(w,O,_,S,E){r(w,O,_||0,S||w.length-1,E||o)}function r(w,O,_,S,E){for(;S>_;){if(S-_>600){var M=S-_+1,P=O-_+1,C=Math.log(M),A=.5*Math.exp(2*C/3),T=.5*Math.sqrt(C*A*(M-A)/M)*(P-M/2<0?-1:1),k=Math.max(_,Math.floor(O-P*A/M+T)),N=Math.min(S,Math.floor(O+(M-P)*A/M+T));r(w,O,k,N,E)}var j=w[O],L=_,I=S;for(i(w,_,O),E(w[S],j)>0&&i(w,_,S);L<I;){for(i(w,L,I),L++,I--;E(w[L],j)<0;)L++;for(;E(w[I],j)>0;)I--}E(w[_],j)===0?i(w,_,I):(I++,i(w,I,S)),I<=O&&(_=I+1),O<=I&&(S=I-1)}}function i(w,O,_){var S=w[O];w[O]=w[_],w[_]=S}function o(w,O){return w<O?-1:w>O?1:0}var a=function(O){O===void 0&&(O=9),this._maxEntries=Math.max(4,O),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()};a.prototype.all=function(){return this._all(this.data,[])},a.prototype.search=function(O){var _=this.data,S=[];if(!m(O,_))return S;for(var E=this.toBBox,M=[];_;){for(var P=0;P<_.children.length;P++){var C=_.children[P],A=_.leaf?E(C):C;m(O,A)&&(_.leaf?S.push(C):y(O,A)?this._all(C,S):M.push(C))}_=M.pop()}return S},a.prototype.collides=function(O){var _=this.data;if(!m(O,_))return!1;for(var S=[];_;){for(var E=0;E<_.children.length;E++){var M=_.children[E],P=_.leaf?this.toBBox(M):M;if(m(O,P)){if(_.leaf||y(O,P))return!0;S.push(M)}}_=S.pop()}return!1},a.prototype.load=function(O){if(!(O&&O.length))return this;if(O.length<this._minEntries){for(var _=0;_<O.length;_++)this.insert(O[_]);return this}var S=this._build(O.slice(),0,O.length-1,0);if(!this.data.children.length)this.data=S;else if(this.data.height===S.height)this._splitRoot(this.data,S);else{if(this.data.height<S.height){var E=this.data;this.data=S,S=E}this._insert(S,this.data.height-S.height-1,!0)}return this},a.prototype.insert=function(O){return O&&this._insert(O,this.data.height-1),this},a.prototype.clear=function(){return this.data=b([]),this},a.prototype.remove=function(O,_){if(!O)return this;for(var S=this.data,E=this.toBBox(O),M=[],P=[],C,A,T;S||M.length;){if(S||(S=M.pop(),A=M[M.length-1],C=P.pop(),T=!0),S.leaf){var k=s(O,S.children,_);if(k!==-1)return S.children.splice(k,1),M.push(S),this._condense(M),this}!T&&!S.leaf&&y(S,E)?(M.push(S),P.push(C),C=0,A=S,S=S.children[0]):A?(C++,S=A.children[C],T=!1):S=null}return this},a.prototype.toBBox=function(O){return O},a.prototype.compareMinX=function(O,_){return O.minX-_.minX},a.prototype.compareMinY=function(O,_){return O.minY-_.minY},a.prototype.toJSON=function(){return this.data},a.prototype.fromJSON=function(O){return this.data=O,this},a.prototype._all=function(O,_){for(var S=[];O;)O.leaf?_.push.apply(_,O.children):S.push.apply(S,O.children),O=S.pop();return _},a.prototype._build=function(O,_,S,E){var M=S-_+1,P=this._maxEntries,C;if(M<=P)return C=b(O.slice(_,S+1)),l(C,this.toBBox),C;E||(E=Math.ceil(Math.log(M)/Math.log(P)),P=Math.ceil(M/Math.pow(P,E-1))),C=b([]),C.leaf=!1,C.height=E;var A=Math.ceil(M/P),T=A*Math.ceil(Math.sqrt(P));x(O,_,S,T,this.compareMinX);for(var k=_;k<=S;k+=T){var N=Math.min(k+T-1,S);x(O,k,N,A,this.compareMinY);for(var j=k;j<=N;j+=A){var L=Math.min(j+A-1,N);C.children.push(this._build(O,j,L,E-1))}}return l(C,this.toBBox),C},a.prototype._chooseSubtree=function(O,_,S,E){for(;E.push(_),!(_.leaf||E.length-1===S);){for(var M=1/0,P=1/0,C=void 0,A=0;A<_.children.length;A++){var T=_.children[A],k=h(T),N=v(O,T)-k;N<P?(P=N,M=k<M?k:M,C=T):N===P&&k<M&&(M=k,C=T)}_=C||_.children[0]}return _},a.prototype._insert=function(O,_,S){var E=S?O:this.toBBox(O),M=[],P=this._chooseSubtree(E,this.data,_,M);for(P.children.push(O),u(P,E);_>=0&&M[_].children.length>this._maxEntries;)this._split(M,_),_--;this._adjustParentBBoxes(E,M,_)},a.prototype._split=function(O,_){var S=O[_],E=S.children.length,M=this._minEntries;this._chooseSplitAxis(S,M,E);var P=this._chooseSplitIndex(S,M,E),C=b(S.children.splice(P,S.children.length-P));C.height=S.height,C.leaf=S.leaf,l(S,this.toBBox),l(C,this.toBBox),_?O[_-1].children.push(C):this._splitRoot(S,C)},a.prototype._splitRoot=function(O,_){this.data=b([O,_]),this.data.height=O.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},a.prototype._chooseSplitIndex=function(O,_,S){for(var E,M=1/0,P=1/0,C=_;C<=S-_;C++){var A=c(O,0,C,this.toBBox),T=c(O,C,S,this.toBBox),k=g(A,T),N=h(A)+h(T);k<M?(M=k,E=C,P=N<P?N:P):k===M&&N<P&&(P=N,E=C)}return E||S-_},a.prototype._chooseSplitAxis=function(O,_,S){var E=O.leaf?this.compareMinX:f,M=O.leaf?this.compareMinY:d,P=this._allDistMargin(O,_,S,E),C=this._allDistMargin(O,_,S,M);P<C&&O.children.sort(E)},a.prototype._allDistMargin=function(O,_,S,E){O.children.sort(E);for(var M=this.toBBox,P=c(O,0,_,M),C=c(O,S-_,S,M),A=p(P)+p(C),T=_;T<S-_;T++){var k=O.children[T];u(P,O.leaf?M(k):k),A+=p(P)}for(var N=S-_-1;N>=_;N--){var j=O.children[N];u(C,O.leaf?M(j):j),A+=p(C)}return A},a.prototype._adjustParentBBoxes=function(O,_,S){for(var E=S;E>=0;E--)u(_[E],O)},a.prototype._condense=function(O){for(var _=O.length-1,S=void 0;_>=0;_--)O[_].children.length===0?_>0?(S=O[_-1].children,S.splice(S.indexOf(O[_]),1)):this.clear():l(O[_],this.toBBox)};function s(w,O,_){if(!_)return O.indexOf(w);for(var S=0;S<O.length;S++)if(_(w,O[S]))return S;return-1}function l(w,O){c(w,0,w.children.length,O,w)}function c(w,O,_,S,E){E||(E=b(null)),E.minX=1/0,E.minY=1/0,E.maxX=-1/0,E.maxY=-1/0;for(var M=O;M<_;M++){var P=w.children[M];u(E,w.leaf?S(P):P)}return E}function u(w,O){return w.minX=Math.min(w.minX,O.minX),w.minY=Math.min(w.minY,O.minY),w.maxX=Math.max(w.maxX,O.maxX),w.maxY=Math.max(w.maxY,O.maxY),w}function f(w,O){return w.minX-O.minX}function d(w,O){return w.minY-O.minY}function h(w){return(w.maxX-w.minX)*(w.maxY-w.minY)}function p(w){return w.maxX-w.minX+(w.maxY-w.minY)}function v(w,O){return(Math.max(O.maxX,w.maxX)-Math.min(O.minX,w.minX))*(Math.max(O.maxY,w.maxY)-Math.min(O.minY,w.minY))}function g(w,O){var _=Math.max(w.minX,O.minX),S=Math.max(w.minY,O.minY),E=Math.min(w.maxX,O.maxX),M=Math.min(w.maxY,O.maxY);return Math.max(0,E-_)*Math.max(0,M-S)}function y(w,O){return w.minX<=O.minX&&w.minY<=O.minY&&O.maxX<=w.maxX&&O.maxY<=w.maxY}function m(w,O){return O.minX<=w.maxX&&O.minY<=w.maxY&&O.maxX>=w.minX&&O.maxY>=w.minY}function b(w){return{children:w,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function x(w,O,_,S,E){for(var M=[O,_];M.length;)if(_=M.pop(),O=M.pop(),!(_-O<=S)){var P=O+Math.ceil((_-O)/S/2)*S;n(w,P,O,_,E),M.push(O,P,P,_)}}return a})})(TA);var KU=TA.exports,H;(function(t){t.GROUP="g",t.CIRCLE="circle",t.ELLIPSE="ellipse",t.IMAGE="image",t.RECT="rect",t.LINE="line",t.POLYLINE="polyline",t.POLYGON="polygon",t.TEXT="text",t.PATH="path",t.HTML="html",t.MESH="mesh"})(H||(H={}));var Pl;(function(t){t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE"})(Pl||(Pl={}));var Qo=function(){function t(){this.plugins=[]}return t.prototype.addRenderingPlugin=function(e){this.plugins.push(e),this.context.renderingPlugins.push(e)},t.prototype.removeAllRenderingPlugins=function(){var e=this;this.plugins.forEach(function(n){var r=e.context.renderingPlugins.indexOf(n);r>=0&&e.context.renderingPlugins.splice(r,1)})},t}(),ZU=function(){function t(e){this.clipSpaceNearZ=Pl.NEGATIVE_ONE,this.plugins=[],this.config=G({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0},e)}return t.prototype.registerPlugin=function(e){var n=this.plugins.findIndex(function(r){return r===e});n===-1&&this.plugins.push(e)},t.prototype.unregisterPlugin=function(e){var n=this.plugins.findIndex(function(r){return r===e});n>-1&&this.plugins.splice(n,1)},t.prototype.getPlugins=function(){return this.plugins},t.prototype.getPlugin=function(e){return this.plugins.find(function(n){return n.name===e})},t.prototype.getConfig=function(){return this.config},t.prototype.setConfig=function(e){Object.assign(this.config,e)},t}();function Al(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function n1(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function up(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function kA(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function QU(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t}function JU(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t}function Cl(t){return t===void 0?0:t>360||t<-360?t%360:t}function In(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=0),Array.isArray(t)&&t.length===3?to(t):as(t)?jt(t,e,n):jt(t[0],t[1]||e,t[2]||n)}function Me(t){return t*(Math.PI/180)}function Ir(t){return t*(180/Math.PI)}function tV(t){return 360*t}function eV(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n,s=r*r,l=i*i,c=o*o,u=a+s+l+c,f=n*o-r*i;return f>.499995*u?(t[0]=Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):f<-.499995*u?(t[0]=-Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-o*r)),t[1]=Math.atan2(2*(n*o+r*i),1-2*(l+c)),t[2]=Math.atan2(2*(n*r+i*o),1-2*(s+l))),t}function nV(t,e){var n,r,i=Math.PI*.5,o=D(cl(Ct(),e),3),a=o[0],s=o[1],l=o[2],c=Math.asin(-e[2]/a);return c<i?c>-i?(n=Math.atan2(e[6]/s,e[10]/l),r=Math.atan2(e[1]/a,e[0]/a)):(r=0,n=-Math.atan2(e[4]/s,e[5]/s)):(r=0,n=Math.atan2(e[4]/s,e[5]/s)),t[0]=n,t[1]=c,t[2]=r,t}function r1(t,e){return e.length===16?nV(t,e):eV(t,e)}function rV(t,e,n,r,i){var o=Math.cos(t),a=Math.sin(t);return Pz(r*o,i*a,0,-r*a,i*o,0,e,n,1)}function iV(t,e,n,r,i,o,a,s){s===void 0&&(s=!1);var l=2*o/(n-e),c=2*o/(r-i),u=(n+e)/(n-e),f=(r+i)/(r-i),d,h;return s?(d=-a/(a-o),h=-a*o/(a-o)):(d=-(a+o)/(a-o),h=-2*a*o/(a-o)),t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=u,t[9]=f,t[10]=d,t[11]=-1,t[12]=0,t[13]=0,t[14]=h,t[15]=0,t}function LA(t){var e=t[0],n=t[1],r=t[3],i=t[4],o=Math.sqrt(e*e+n*n),a=Math.sqrt(r*r+i*i),s=e*i-n*r;s<0&&(e<i?o=-o:a=-a),o&&(e*=1/o,n*=1/o),a&&(r*=1/a,i*=1/a);var l=Math.atan2(n,e),c=Ir(l);return[t[6],t[7],o,a,c]}var ki=Kt(),si=Kt(),Xu=fl(),xt=[Ct(),Ct(),Ct()],NA=Ct();function oV(t,e,n,r,i,o){if(!aV(ki,t)||(qa(si,ki),si[3]=0,si[7]=0,si[11]=0,si[15]=1,Math.abs(OE(si))<1e-8))return!1;var a=ki[3],s=ki[7],l=ki[11],c=ki[12],u=ki[13],f=ki[14],d=ki[15];if(a!==0||s!==0||l!==0){Xu[0]=a,Xu[1]=s,Xu[2]=l,Xu[3]=d;var h=oi(si,si);if(!h)return!1;wE(si,si),dl(i,Xu,si)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=c,e[1]=u,e[2]=f,sV(xt,ki),n[0]=eo(xt[0]),Ka(xt[0],xt[0]),r[0]=Pi(xt[0],xt[1]),i1(xt[1],xt[1],xt[0],1,-r[0]),n[1]=eo(xt[1]),Ka(xt[1],xt[1]),r[0]/=n[1],r[1]=Pi(xt[0],xt[2]),i1(xt[2],xt[2],xt[0],1,-r[1]),r[2]=Pi(xt[1],xt[2]),i1(xt[2],xt[2],xt[1],1,-r[2]),n[2]=eo(xt[2]),Ka(xt[2],xt[2]),r[1]/=n[2],r[2]/=n[2],bh(NA,xt[1],xt[2]),Pi(xt[0],NA)<0)for(var p=0;p<3;p++)n[p]*=-1,xt[p][0]*=-1,xt[p][1]*=-1,xt[p][2]*=-1;return o[0]=.5*Math.sqrt(Math.max(1+xt[0][0]-xt[1][1]-xt[2][2],0)),o[1]=.5*Math.sqrt(Math.max(1-xt[0][0]+xt[1][1]-xt[2][2],0)),o[2]=.5*Math.sqrt(Math.max(1-xt[0][0]-xt[1][1]+xt[2][2],0)),o[3]=.5*Math.sqrt(Math.max(1+xt[0][0]+xt[1][1]+xt[2][2],0)),xt[2][1]>xt[1][2]&&(o[0]=-o[0]),xt[0][2]>xt[2][0]&&(o[1]=-o[1]),xt[1][0]>xt[0][1]&&(o[2]=-o[2]),!0}function aV(t,e){var n=e[15];if(n===0)return!1;for(var r=1/n,i=0;i<16;i++)t[i]=e[i]*r;return!0}function sV(t,e){t[0][0]=e[0],t[0][1]=e[1],t[0][2]=e[2],t[1][0]=e[4],t[1][1]=e[5],t[1][2]=e[6],t[2][0]=e[8],t[2][1]=e[9],t[2][2]=e[10]}function i1(t,e,n,r,i){t[0]=e[0]*r+n[0]*i,t[1]=e[1]*r+n[1]*i,t[2]=e[2]*r+n[2]*i}var Xe=function(){function t(){this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return t.isEmpty=function(e){return!e||e.halfExtents[0]===0&&e.halfExtents[1]===0&&e.halfExtents[2]===0},t.prototype.update=function(e,n){Al(this.center,e),Al(this.halfExtents,n),n1(this.min,this.center,this.halfExtents),up(this.max,this.center,this.halfExtents)},t.prototype.setMinMax=function(e,n){up(this.center,n,e),kA(this.center,this.center,.5),n1(this.halfExtents,n,e),kA(this.halfExtents,this.halfExtents,.5),Al(this.min,e),Al(this.max,n)},t.prototype.getMin=function(){return this.min},t.prototype.getMax=function(){return this.max},t.prototype.add=function(e){if(!t.isEmpty(e)){if(t.isEmpty(this)){this.setMinMax(e.getMin(),e.getMax());return}var n=this.center,r=n[0],i=n[1],o=n[2],a=this.halfExtents,s=a[0],l=a[1],c=a[2],u=r-s,f=r+s,d=i-l,h=i+l,p=o-c,v=o+c,g=e.center,y=g[0],m=g[1],b=g[2],x=e.halfExtents,w=x[0],O=x[1],_=x[2],S=y-w,E=y+w,M=m-O,P=m+O,C=b-_,A=b+_;S<u&&(u=S),E>f&&(f=E),M<d&&(d=M),P>h&&(h=P),C<p&&(p=C),A>v&&(v=A),n[0]=(u+f)*.5,n[1]=(d+h)*.5,n[2]=(p+v)*.5,a[0]=(f-u)*.5,a[1]=(h-d)*.5,a[2]=(v-p)*.5,this.min[0]=u,this.min[1]=d,this.min[2]=p,this.max[0]=f,this.max[1]=h,this.max[2]=v}},t.prototype.setFromTransformedAABB=function(e,n){var r=this.center,i=this.halfExtents,o=e.center,a=e.halfExtents,s=n[0],l=n[4],c=n[8],u=n[1],f=n[5],d=n[9],h=n[2],p=n[6],v=n[10],g=Math.abs(s),y=Math.abs(l),m=Math.abs(c),b=Math.abs(u),x=Math.abs(f),w=Math.abs(d),O=Math.abs(h),_=Math.abs(p),S=Math.abs(v);r[0]=n[12]+s*o[0]+l*o[1]+c*o[2],r[1]=n[13]+u*o[0]+f*o[1]+d*o[2],r[2]=n[14]+h*o[0]+p*o[1]+v*o[2],i[0]=g*a[0]+y*a[1]+m*a[2],i[1]=b*a[0]+x*a[1]+w*a[2],i[2]=O*a[0]+_*a[1]+S*a[2],n1(this.min,r,i),up(this.max,r,i)},t.prototype.intersects=function(e){var n=this.getMax(),r=this.getMin(),i=e.getMax(),o=e.getMin();return r[0]<=i[0]&&n[0]>=o[0]&&r[1]<=i[1]&&n[1]>=o[1]&&r[2]<=i[2]&&n[2]>=o[2]},t.prototype.intersection=function(e){if(!this.intersects(e))return null;var n=new t,r=QU([0,0,0],this.getMin(),e.getMin()),i=JU([0,0,0],this.getMax(),e.getMax());return n.setMinMax(r,i),n},t.prototype.getNegativeFarPoint=function(e){return e.pnVertexFlag===273?Al([0,0,0],this.min):e.pnVertexFlag===272?[this.min[0],this.min[1],this.max[2]]:e.pnVertexFlag===257?[this.min[0],this.max[1],this.min[2]]:e.pnVertexFlag===256?[this.min[0],this.max[1],this.max[2]]:e.pnVertexFlag===17?[this.max[0],this.min[1],this.min[2]]:e.pnVertexFlag===16?[this.max[0],this.min[1],this.max[2]]:e.pnVertexFlag===1?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]},t.prototype.getPositiveFarPoint=function(e){return e.pnVertexFlag===273?Al([0,0,0],this.max):e.pnVertexFlag===272?[this.max[0],this.max[1],this.min[2]]:e.pnVertexFlag===257?[this.max[0],this.min[1],this.max[2]]:e.pnVertexFlag===256?[this.max[0],this.min[1],this.min[2]]:e.pnVertexFlag===17?[this.min[0],this.max[1],this.max[2]]:e.pnVertexFlag===16?[this.min[0],this.max[1],this.min[2]]:e.pnVertexFlag===1?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]},t}(),lV=function(){function t(e,n){this.distance=e||0,this.normal=n||jt(0,1,0),this.updatePNVertexFlag()}return t.prototype.updatePNVertexFlag=function(){this.pnVertexFlag=(+(this.normal[0]>=0)<<8)+(+(this.normal[1]>=0)<<4)+ +(this.normal[2]>=0)},t.prototype.distanceToPoint=function(e){return Pi(e,this.normal)-this.distance},t.prototype.normalize=function(){var e=1/DE(this.normal);Ky(this.normal,this.normal,e),this.distance*=e},t.prototype.intersectsLine=function(e,n,r){var i=this.distanceToPoint(e),o=this.distanceToPoint(n),a=i/(i-o),s=a>=0&&a<=1;return s&&r&&Zy(r,e,n,a),s},t}(),Jo;(function(t){t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE"})(Jo||(Jo={}));var cV=function(){function t(e){if(this.planes=[],e)this.planes=e;else for(var n=0;n<6;n++)this.planes.push(new lV)}return t.prototype.extractFromVPMatrix=function(e){var n=D(e,16),r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],l=n[5],c=n[6],u=n[7],f=n[8],d=n[9],h=n[10],p=n[11],v=n[12],g=n[13],y=n[14],m=n[15];ai(this.planes[0].normal,a-r,u-s,p-f),this.planes[0].distance=m-v,ai(this.planes[1].normal,a+r,u+s,p+f),this.planes[1].distance=m+v,ai(this.planes[2].normal,a+i,u+l,p+d),this.planes[2].distance=m+g,ai(this.planes[3].normal,a-i,u-l,p-d),this.planes[3].distance=m-g,ai(this.planes[4].normal,a-o,u-c,p-h),this.planes[4].distance=m-y,ai(this.planes[5].normal,a+o,u+c,p+h),this.planes[5].distance=m+y,this.planes.forEach(function(b){b.normalize(),b.updatePNVertexFlag()})},t}(),on=function(){function t(e,n){e===void 0&&(e=0),n===void 0&&(n=0),this.x=0,this.y=0,this.x=e,this.y=n}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(e){this.x=e.x,this.y=e.y},t}(),ss=function(){function t(e,n,r,i){this.x=e,this.y=n,this.width=r,this.height=i,this.left=e,this.right=e+r,this.top=n,this.bottom=n+i}return t.prototype.toJSON=function(){},t}(),Jt="Method not implemented.",Tl="Use document.documentElement instead.",uV="Cannot append a destroyed element.",Ht;(function(t){t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING"})(Ht||(Ht={}));var qu;(function(t){t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC"})(qu||(qu={}));var qn;(function(t){t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE"})(qn||(qn={}));var IA={UPDATED:"updated"},jA=2e-4,DA=function(){function t(){this.clipSpaceNearZ=Pl.NEGATIVE_ONE,this.eventEmitter=new Vm,this.matrix=Kt(),this.right=jt(1,0,0),this.up=jt(0,1,0),this.forward=jt(0,0,1),this.position=jt(0,0,1),this.focalPoint=jt(0,0,0),this.distanceVector=jt(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.projectionMatrix=Kt(),this.projectionMatrixInverse=Kt(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=Ht.EXPLORING,this.trackingMode=qu.DEFAULT,this.projectionMode=qn.PERSPECTIVE,this.frustum=new cV,this.orthoMatrix=Kt()}return t.prototype.isOrtho=function(){return this.projectionMode===qn.ORTHOGRAPHIC},t.prototype.getProjectionMode=function(){return this.projectionMode},t.prototype.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},t.prototype.getPerspectiveInverse=function(){return this.projectionMatrixInverse},t.prototype.getFrustum=function(){return this.frustum},t.prototype.getPosition=function(){return this.position},t.prototype.getFocalPoint=function(){return this.focalPoint},t.prototype.getDollyingStep=function(){return this.dollyingStep},t.prototype.getNear=function(){return this.near},t.prototype.getFar=function(){return this.far},t.prototype.getZoom=function(){return this.zoom},t.prototype.getOrthoMatrix=function(){return this.orthoMatrix},t.prototype.getView=function(){return this.view},t.prototype.setEnableUpdate=function(e){this.enableUpdate=e},t.prototype.setType=function(e,n){return this.type=e,this.type===Ht.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===Ht.TRACKING&&n!==void 0&&this.setTrackingMode(n),this},t.prototype.setProjectionMode=function(e){return this.projectionMode=e,this},t.prototype.setTrackingMode=function(e){if(this.type!==Ht.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=e,this},t.prototype.setWorldRotation=function(e){return this.rotateWorld=e,this._getAngles(),this},t.prototype.getViewTransform=function(){return oi(Kt(),this.matrix)},t.prototype.getWorldTransform=function(){return this.matrix},t.prototype.jitterProjectionMatrix=function(e,n){var r=Vy(Kt(),[e,n,0]);this.jitteredProjectionMatrix=On(Kt(),r,this.projectionMatrix)},t.prototype.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},t.prototype.setMatrix=function(e){return this.matrix=e,this._update(),this},t.prototype.setFov=function(e){return this.setPerspective(this.near,this.far,e,this.aspect),this},t.prototype.setAspect=function(e){return this.setPerspective(this.near,this.far,this.fov,e),this},t.prototype.setNear=function(e){return this.projectionMode===qn.PERSPECTIVE?this.setPerspective(e,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,e,this.far),this},t.prototype.setFar=function(e){return this.projectionMode===qn.PERSPECTIVE?this.setPerspective(this.near,e,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,e),this},t.prototype.setViewOffset=function(e,n,r,i,o,a){return this.aspect=e/n,this.view===void 0&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.projectionMode===qn.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},t.prototype.clearViewOffset=function(){return this.view!==void 0&&(this.view.enabled=!1),this.projectionMode===qn.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},t.prototype.setZoom=function(e){return this.zoom=e,this.projectionMode===qn.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===qn.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},t.prototype.setZoomByViewportPoint=function(e,n){var r=this.canvas.viewport2Canvas({x:n[0],y:n[1]}),i=r.x,o=r.y,a=this.roll;this.rotate(0,0,-a),this.setPosition(i,o),this.setFocalPoint(i,o),this.setZoom(e),this.rotate(0,0,a);var s=this.canvas.viewport2Canvas({x:n[0],y:n[1]}),l=s.x,c=s.y,u=jt(l-i,c-o,0),f=Pi(u,this.right)/eo(this.right),d=Pi(u,this.up)/eo(this.up);return this.pan(-f,-d),this},t.prototype.setPerspective=function(e,n,r,i){var o;this.projectionMode=qn.PERSPECTIVE,this.fov=r,this.near=e,this.far=n,this.aspect=i;var a=this.near*Math.tan(Me(.5*this.fov))/this.zoom,s=2*a,l=this.aspect*s,c=-.5*l;if(!((o=this.view)===null||o===void 0)&&o.enabled){var u=this.view.fullWidth,f=this.view.fullHeight;c+=this.view.offsetX*l/u,a-=this.view.offsetY*s/f,l*=this.view.width/u,s*=this.view.height/f}return iV(this.projectionMatrix,c,c+l,a,a-s,e,this.far,this.clipSpaceNearZ===Pl.ZERO),gh(this.projectionMatrix,this.projectionMatrix,jt(1,-1,1)),oi(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},t.prototype.setOrthographic=function(e,n,r,i,o,a){var s;this.projectionMode=qn.ORTHOGRAPHIC,this.rright=n,this.left=e,this.top=r,this.bottom=i,this.near=o,this.far=a;var l=(this.rright-this.left)/(2*this.zoom),c=(this.top-this.bottom)/(2*this.zoom),u=(this.rright+this.left)/2,f=(this.top+this.bottom)/2,d=u-l,h=u+l,p=f+c,v=f-c;if(!((s=this.view)===null||s===void 0)&&s.enabled){var g=(this.rright-this.left)/this.view.fullWidth/this.zoom,y=(this.top-this.bottom)/this.view.fullHeight/this.zoom;d+=g*this.view.offsetX,h=d+g*this.view.width,p-=y*this.view.offsetY,v=p-y*this.view.height}return this.clipSpaceNearZ===Pl.NEGATIVE_ONE?AE(this.projectionMatrix,d,h,v,p,o,a):CE(this.projectionMatrix,d,h,v,p,o,a),gh(this.projectionMatrix,this.projectionMatrix,jt(1,-1,1)),oi(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},t.prototype.setPosition=function(e,n,r){n===void 0&&(n=this.position[1]),r===void 0&&(r=this.position[2]);var i=In(e,n,r);return this._setPosition(i),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},t.prototype.setFocalPoint=function(e,n,r){n===void 0&&(n=this.focalPoint[1]),r===void 0&&(r=this.focalPoint[2]);var i=jt(0,1,0);if(this.focalPoint=In(e,n,r),this.trackingMode===qu.CINEMATIC){var o=NE(Ct(),this.focalPoint,this.position);e=o[0],n=o[1],r=o[2];var a=eo(o),s=Ir(Math.asin(n/a)),l=90+Ir(Math.atan2(r,e)),c=Kt();SE(c,c,Me(l)),_E(c,c,Me(s)),i=Qe(Ct(),[0,1,0],c)}return oi(this.matrix,TE(Kt(),this.position,this.focalPoint,i)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},t.prototype.getDistance=function(){return this.distance},t.prototype.getDistanceVector=function(){return this.distanceVector},t.prototype.setDistance=function(e){if(this.distance===e||e<0)return this;this.distance=e,this.distance<jA&&(this.distance=jA),this.dollyingStep=this.distance/100;var n=Ct();e=this.distance;var r=this.forward,i=this.focalPoint;return n[0]=e*r[0]+i[0],n[1]=e*r[1]+i[1],n[2]=e*r[2]+i[2],this._setPosition(n),this.triggerUpdate(),this},t.prototype.setMaxDistance=function(e){return this.maxDistance=e,this},t.prototype.setMinDistance=function(e){return this.minDistance=e,this},t.prototype.setAzimuth=function(e){return this.azimuth=Cl(e),this.computeMatrix(),this._getAxes(),this.type===Ht.ORBITING||this.type===Ht.EXPLORING?this._getPosition():this.type===Ht.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getAzimuth=function(){return this.azimuth},t.prototype.setElevation=function(e){return this.elevation=Cl(e),this.computeMatrix(),this._getAxes(),this.type===Ht.ORBITING||this.type===Ht.EXPLORING?this._getPosition():this.type===Ht.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getElevation=function(){return this.elevation},t.prototype.setRoll=function(e){return this.roll=Cl(e),this.computeMatrix(),this._getAxes(),this.type===Ht.ORBITING||this.type===Ht.EXPLORING?this._getPosition():this.type===Ht.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getRoll=function(){return this.roll},t.prototype._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},t.prototype.computeMatrix=function(){var e=Wo(Ge(),[0,0,1],Me(this.roll));pu(this.matrix);var n=Wo(Ge(),[1,0,0],Me((this.rotateWorld&&this.type!==Ht.TRACKING||this.type===Ht.TRACKING?1:-1)*this.elevation)),r=Wo(Ge(),[0,1,0],Me((this.rotateWorld&&this.type!==Ht.TRACKING||this.type===Ht.TRACKING?1:-1)*this.azimuth)),i=Go(Ge(),r,n);i=Go(Ge(),i,e);var o=qy(Kt(),i);this.type===Ht.ORBITING||this.type===Ht.EXPLORING?(Yo(this.matrix,this.matrix,this.focalPoint),On(this.matrix,this.matrix,o),Yo(this.matrix,this.matrix,[0,0,this.distance])):this.type===Ht.TRACKING&&(Yo(this.matrix,this.matrix,this.position),On(this.matrix,this.matrix,o))},t.prototype._setPosition=function(e,n,r){this.position=In(e,n,r);var i=this.matrix;i[12]=this.position[0],i[13]=this.position[1],i[14]=this.position[2],i[15]=1,this._getOrthoMatrix()},t.prototype._getAxes=function(){Vn(this.right,In(dl(fl(),[1,0,0,0],this.matrix))),Vn(this.up,In(dl(fl(),[0,1,0,0],this.matrix))),Vn(this.forward,In(dl(fl(),[0,0,1,0],this.matrix))),Ka(this.right,this.right),Ka(this.up,this.up),Ka(this.forward,this.forward)},t.prototype._getAngles=function(){var e=this.distanceVector[0],n=this.distanceVector[1],r=this.distanceVector[2],i=eo(this.distanceVector);if(i===0){this.elevation=0,this.azimuth=0;return}this.type===Ht.TRACKING?(this.elevation=Ir(Math.asin(n/i)),this.azimuth=Ir(Math.atan2(-e,-r))):this.rotateWorld?(this.elevation=Ir(Math.asin(n/i)),this.azimuth=Ir(Math.atan2(-e,-r))):(this.elevation=-Ir(Math.asin(n/i)),this.azimuth=-Ir(Math.atan2(-e,-r)))},t.prototype._getPosition=function(){Vn(this.position,In(dl(fl(),[0,0,0,1],this.matrix))),this._getDistance()},t.prototype._getFocalPoint=function(){IE(this.distanceVector,[0,0,-this.distance],Ez(ll(),this.matrix)),ul(this.focalPoint,this.position,this.distanceVector),this._getDistance()},t.prototype._getDistance=function(){this.distanceVector=NE(Ct(),this.focalPoint,this.position),this.distance=eo(this.distanceVector),this.dollyingStep=this.distance/100},t.prototype._getOrthoMatrix=function(){if(this.projectionMode===qn.ORTHOGRAPHIC){var e=this.position,n=Wo(Ge(),[0,0,1],-this.roll*Math.PI/180);vu(this.orthoMatrix,n,jt((this.rright-this.left)/2-e[0],(this.top-this.bottom)/2-e[1],0),jt(this.zoom,this.zoom,1),e)}},t.prototype.triggerUpdate=function(){if(this.enableUpdate){var e=this.getViewTransform(),n=On(Kt(),this.getPerspective(),e);this.getFrustum().extractFromVPMatrix(n),this.eventEmitter.emit(IA.UPDATED)}},t.prototype.rotate=function(e,n,r){throw new Error(Jt)},t.prototype.pan=function(e,n){throw new Error(Jt)},t.prototype.dolly=function(e){throw new Error(Jt)},t.prototype.createLandmark=function(e,n){throw new Error(Jt)},t.prototype.gotoLandmark=function(e,n){throw new Error(Jt)},t.prototype.cancelLandmarkAnimation=function(){throw new Error(Jt)},t}();function pn(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=t.apply(this,r);return n.cache=a.set(o,s)||a,s};return n.cache=new(pn.Cache||Map),n}pn.Cache=Map;var rt;(function(t){t[t.kUnknown=0]="kUnknown",t[t.kNumber=1]="kNumber",t[t.kPercentage=2]="kPercentage",t[t.kEms=3]="kEms",t[t.kPixels=4]="kPixels",t[t.kRems=5]="kRems",t[t.kDegrees=6]="kDegrees",t[t.kRadians=7]="kRadians",t[t.kGradians=8]="kGradians",t[t.kTurns=9]="kTurns",t[t.kMilliseconds=10]="kMilliseconds",t[t.kSeconds=11]="kSeconds",t[t.kInteger=12]="kInteger"})(rt||(rt={}));var vr;(function(t){t[t.kUNumber=0]="kUNumber",t[t.kUPercent=1]="kUPercent",t[t.kULength=2]="kULength",t[t.kUAngle=3]="kUAngle",t[t.kUTime=4]="kUTime",t[t.kUOther=5]="kUOther"})(vr||(vr={}));var $A;(function(t){t[t.kAll=0]="kAll",t[t.kNonNegative=1]="kNonNegative",t[t.kInteger=2]="kInteger",t[t.kNonNegativeInteger=3]="kNonNegativeInteger",t[t.kPositiveInteger=4]="kPositiveInteger"})($A||($A={}));var o1;(function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"})(o1||(o1={}));var a1;(function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"})(a1||(a1={}));var fV=[{name:"em",unit_type:rt.kEms},{name:"px",unit_type:rt.kPixels},{name:"deg",unit_type:rt.kDegrees},{name:"rad",unit_type:rt.kRadians},{name:"grad",unit_type:rt.kGradians},{name:"ms",unit_type:rt.kMilliseconds},{name:"s",unit_type:rt.kSeconds},{name:"rem",unit_type:rt.kRems},{name:"turn",unit_type:rt.kTurns}],ta;(function(t){t[t.kUnknownType=0]="kUnknownType",t[t.kUnparsedType=1]="kUnparsedType",t[t.kKeywordType=2]="kKeywordType",t[t.kUnitType=3]="kUnitType",t[t.kSumType=4]="kSumType",t[t.kProductType=5]="kProductType",t[t.kNegateType=6]="kNegateType",t[t.kInvertType=7]="kInvertType",t[t.kMinType=8]="kMinType",t[t.kMaxType=9]="kMaxType",t[t.kClampType=10]="kClampType",t[t.kTransformType=11]="kTransformType",t[t.kPositionType=12]="kPositionType",t[t.kURLImageType=13]="kURLImageType",t[t.kColorType=14]="kColorType",t[t.kUnsupportedColorType=15]="kUnsupportedColorType"})(ta||(ta={}));var dV=function(t){return fV.find(function(e){return e.name===t}).unit_type},hV=function(t){return t?t==="number"?rt.kNumber:t==="percent"||t==="%"?rt.kPercentage:dV(t):rt.kUnknown},pV=function(t){switch(t){case rt.kNumber:case rt.kInteger:return vr.kUNumber;case rt.kPercentage:return vr.kUPercent;case rt.kPixels:return vr.kULength;case rt.kMilliseconds:case rt.kSeconds:return vr.kUTime;case rt.kDegrees:case rt.kRadians:case rt.kGradians:case rt.kTurns:return vr.kUAngle;default:return vr.kUOther}},vV=function(t){switch(t){case vr.kUNumber:return rt.kNumber;case vr.kULength:return rt.kPixels;case vr.kUPercent:return rt.kPercentage;case vr.kUTime:return rt.kSeconds;case vr.kUAngle:return rt.kDegrees;default:return rt.kUnknown}},FA=function(t){var e=1;switch(t){case rt.kPixels:case rt.kDegrees:case rt.kSeconds:break;case rt.kMilliseconds:e=.001;break;case rt.kRadians:e=180/Math.PI;break;case rt.kGradians:e=.9;break;case rt.kTurns:e=360;break}return e},s1=function(t){switch(t){case rt.kNumber:case rt.kInteger:return"";case rt.kPercentage:return"%";case rt.kEms:return"em";case rt.kRems:return"rem";case rt.kPixels:return"px";case rt.kDegrees:return"deg";case rt.kRadians:return"rad";case rt.kGradians:return"grad";case rt.kMilliseconds:return"ms";case rt.kSeconds:return"s";case rt.kTurns:return"turn"}return""},fp=function(){function t(){}return t.isAngle=function(e){return e===rt.kDegrees||e===rt.kRadians||e===rt.kGradians||e===rt.kTurns},t.isLength=function(e){return e>=rt.kEms&&e<rt.kDegrees},t.isRelativeUnit=function(e){return e===rt.kPercentage||e===rt.kEms||e===rt.kRems},t.isTime=function(e){return e===rt.kSeconds||e===rt.kMilliseconds},t.prototype.toString=function(){return this.buildCSSText(o1.kNo,a1.kNo,"")},t.prototype.isNumericValue=function(){return this.getType()>=ta.kUnitType&&this.getType()<=ta.kClampType},t}(),gV=function(t){st(e,t);function e(n){var r=t.call(this)||this;return r.colorSpace=n,r}return e.prototype.getType=function(){return ta.kColorType},e.prototype.to=function(n){return this},e}(fp),Li;(function(t){t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient"})(Li||(Li={}));var dp=function(t){st(e,t);function e(n,r){var i=t.call(this)||this;return i.type=n,i.value=r,i}return e.prototype.clone=function(){return new e(this.type,this.value)},e.prototype.buildCSSText=function(n,r,i){return i},e.prototype.getType=function(){return ta.kColorType},e}(fp),Kn=function(t){st(e,t);function e(n){var r=t.call(this)||this;return r.value=n,r}return e.prototype.clone=function(){return new e(this.value)},e.prototype.getType=function(){return ta.kKeywordType},e.prototype.buildCSSText=function(n,r,i){return i+this.value},e}(fp),yV=pn(function(t){return t===void 0&&(t=""),t.replace(/-([a-z])/g,function(e){return e[1].toUpperCase()})}),RA=function(t){return t.split("").map(function(e,n){return e.toUpperCase()===e?"".concat(n!==0?"-":"").concat(e.toLowerCase()):e}).join("")};function mV(t){if(!t)throw new Error}function kl(t){return typeof t=="function"}function bV(t){return typeof t=="symbol"}var xV={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},l1=pn(function(t){var e=yV(t),n=xV[e];return e=(n==null?void 0:n.alias)||e,e}),wV=function(t,e){e===void 0&&(e="");var n="";return Number.isFinite(t)?(mV(Number.isNaN(t)),n="NaN"):t>0?n="infinity":n="-infinity",n+=e},c1=function(t){return vV(pV(t))},te=function(t){st(e,t);function e(n,r){r===void 0&&(r=rt.kNumber);var i=t.call(this)||this,o;return typeof r=="string"?o=hV(r):o=r,i.unit=o,i.value=n,i}return e.prototype.clone=function(){return new e(this.value,this.unit)},e.prototype.equals=function(n){var r=n;return this.value===r.value&&this.unit===r.unit},e.prototype.getType=function(){return ta.kUnitType},e.prototype.convertTo=function(n){if(this.unit===n)return new e(this.value,this.unit);var r=c1(this.unit);if(r!==c1(n)||r===rt.kUnknown)return null;var i=FA(this.unit)/FA(n);return new e(this.value*i,n)},e.prototype.buildCSSText=function(n,r,i){var o;switch(this.unit){case rt.kUnknown:break;case rt.kInteger:o=Number(this.value).toFixed(0);break;case rt.kNumber:case rt.kPercentage:case rt.kEms:case rt.kRems:case rt.kPixels:case rt.kDegrees:case rt.kRadians:case rt.kGradians:case rt.kMilliseconds:case rt.kSeconds:case rt.kTurns:{var a=-999999,s=999999,l=this.value,c=s1(this.unit);if(l<a||l>s){var u=s1(this.unit);!Number.isFinite(l)||Number.isNaN(l)?o=wV(l,u):o=l+(u||"")}else o="".concat(l).concat(c)}}return i+=o,i},e}(fp),Je=new te(0,"px");new te(1,"px");var li=new te(0,"deg"),u1=function(t){st(e,t);function e(n,r,i,o,a){o===void 0&&(o=1),a===void 0&&(a=!1);var s=t.call(this,"rgb")||this;return s.r=n,s.g=r,s.b=i,s.alpha=o,s.isNone=a,s}return e.prototype.clone=function(){return new e(this.r,this.g,this.b,this.alpha)},e.prototype.buildCSSText=function(n,r,i){return i+"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")},e}(gV),ue=new Kn("unset"),OV=new Kn("initial"),_V=new Kn("inherit"),f1={"":ue,unset:ue,initial:OV,inherit:_V},d1=function(t){return f1[t]||(f1[t]=new Kn(t)),f1[t]},h1=new u1(0,0,0,0,!0),BA=new u1(0,0,0,0),SV=pn(function(t,e,n,r){return new u1(t,e,n,r)},function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")}),oe=function(t,e){return e===void 0&&(e=rt.kNumber),new te(t,e)},hp=new te(50,"%"),p1;(function(t){t[t.Standard=0]="Standard"})(p1||(p1={}));var Ll;(function(t){t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED"})(Ll||(Ll={}));var zA={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new ss(0,0,0,0)},at;(function(t){t.COORDINATE="<coordinate>",t.COLOR="<color>",t.PAINT="<paint>",t.NUMBER="<number>",t.ANGLE="<angle>",t.OPACITY_VALUE="<opacity-value>",t.SHADOW_BLUR="<shadow-blur>",t.LENGTH="<length>",t.PERCENTAGE="<percentage>",t.LENGTH_PERCENTAGE="<length> | <percentage>",t.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",t.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",t.LIST_OF_POINTS="<list-of-points>",t.PATH="<path>",t.FILTER="<filter>",t.Z_INDEX="<z-index>",t.OFFSET_DISTANCE="<offset-distance>",t.DEFINED_PATH="<defined-path>",t.MARKER="<marker>",t.TRANSFORM="<transform>",t.TRANSFORM_ORIGIN="<transform-origin>",t.TEXT="<text>",t.TEXT_TRANSFORM="<text-transform>"})(at||(at={}));function EV(t){var e=t.type,n=t.value;return e==="hex"?"#".concat(n):e==="literal"?n:e==="rgb"?"rgb(".concat(n.join(","),")"):"rgba(".concat(n.join(","),")")}var MV=function(){var t={linearGradient:/^(linear\-gradient)/i,repeatingLinearGradient:/^(repeating\-linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,repeatingRadialGradient:/^(repeating\-radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},e="";function n(j){throw new Error(e+": "+j)}function r(){var j=i();return e.length>0&&n("Invalid input not EOF"),j}function i(){return b(o)}function o(){return a("linear-gradient",t.linearGradient,l)||a("repeating-linear-gradient",t.repeatingLinearGradient,l)||a("radial-gradient",t.radialGradient,f)||a("repeating-radial-gradient",t.repeatingRadialGradient,f)||a("conic-gradient",t.conicGradient,f)}function a(j,L,I){return s(L,function($){var F=I();return F&&(k(t.comma)||n("Missing comma before color stops")),{type:j,orientation:F,colorStops:b(x)}})}function s(j,L){var I=k(j);if(I){k(t.startCall)||n("Missing (");var $=L(I);return k(t.endCall)||n("Missing )"),$}}function l(){return c()||u()}function c(){return T("directional",t.sideOrCorner,1)}function u(){return T("angular",t.angleValue,1)}function f(){var j,L=d(),I;return L&&(j=[],j.push(L),I=e,k(t.comma)&&(L=d(),L?j.push(L):e=I)),j}function d(){var j=h()||p();if(j)j.at=g();else{var L=v();if(L){j=L;var I=g();I&&(j.at=I)}else{var $=y();$&&(j={type:"default-radial",at:$})}}return j}function h(){var j=T("shape",/^(circle)/i,0);return j&&(j.style=A()||v()),j}function p(){var j=T("shape",/^(ellipse)/i,0);return j&&(j.style=P()||v()),j}function v(){return T("extent-keyword",t.extentKeywords,1)}function g(){if(T("position",/^at/,0)){var j=y();return j||n("Missing positioning value"),j}}function y(){var j=m();if(j.x||j.y)return{type:"position",value:j}}function m(){return{x:P(),y:P()}}function b(j){var L=j(),I=[];if(L)for(I.push(L);k(t.comma);)L=j(),L?I.push(L):n("One extra comma");return I}function x(){var j=w();return j||n("Expected color definition"),j.length=P(),j}function w(){return _()||E()||S()||O()}function O(){return T("literal",t.literalColor,0)}function _(){return T("hex",t.hexColor,1)}function S(){return s(t.rgbColor,function(){return{type:"rgb",value:b(M)}})}function E(){return s(t.rgbaColor,function(){return{type:"rgba",value:b(M)}})}function M(){return k(t.number)[1]}function P(){return T("%",t.percentageValue,1)||C()||A()}function C(){return T("position-keyword",t.positionKeywords,1)}function A(){return T("px",t.pixelValue,1)||T("em",t.emValue,1)}function T(j,L,I){var $=k(L);if($)return{type:j,value:$[I]}}function k(j){var L=/^[\n\r\t\s]+/.exec(e);L&&N(L[0].length);var I=j.exec(e);return I&&N(I[0].length),I}function N(j){e=e.substring(j)}return function(j){return e=j,r()}}();function PV(t,e,n){var r=Me(n.value),i=0,o=0,a=i+t/2,s=o+e/2,l=Math.abs(t*Math.cos(r))+Math.abs(e*Math.sin(r)),c=a-Math.cos(r)*l/2,u=s-Math.sin(r)*l/2,f=a+Math.cos(r)*l/2,d=s+Math.sin(r)*l/2;return{x1:c,y1:u,x2:f,y2:d}}function AV(t,e,n,r,i){var o=n.value,a=r.value;n.unit===rt.kPercentage&&(o=n.value/100*t),r.unit===rt.kPercentage&&(a=r.value/100*e);var s=Math.max(hr([0,0],[o,a]),hr([0,e],[o,a]),hr([t,e],[o,a]),hr([t,0],[o,a]));return i&&(i instanceof te?s=i.value:i instanceof Kn&&(i.value==="closest-side"?s=Math.min(o,t-o,a,e-a):i.value==="farthest-side"?s=Math.max(o,t-o,a,e-a):i.value==="closest-corner"&&(s=Math.min(hr([0,0],[o,a]),hr([0,e],[o,a]),hr([t,e],[o,a]),hr([t,0],[o,a]))))),{x:o,y:a,r:s}}var CV=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,TV=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,kV=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,YA=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function LV(t){var e,n,r,i=t.length;t[i-1].length=(e=t[i-1].length)!==null&&e!==void 0?e:{type:"%",value:"100"},i>1&&(t[0].length=(n=t[0].length)!==null&&n!==void 0?n:{type:"%",value:"0"});for(var o=0,a=Number(t[0].length.value),s=1;s<i;s++){var l=(r=t[s].length)===null||r===void 0?void 0:r.value;if(!Ot(l)&&!Ot(a)){for(var c=1;c<s-o;c++)t[o+c].length={type:"%",value:"".concat(a+(Number(l)-a)*c/(s-o))};o=s,a=Number(l)}}}var NV={left:180,top:-90,bottom:90,right:0,"left top":225,"top left":225,"left bottom":135,"bottom left":135,"right top":-45,"top right":-45,"right bottom":45,"bottom right":45},IV=pn(function(t){var e;return t.type==="angular"?e=Number(t.value):e=NV[t.value]||0,oe(e,"deg")}),jV=pn(function(t){var e=50,n=50,r="%",i="%";if((t==null?void 0:t.type)==="position"){var o=t.value,a=o.x,s=o.y;(a==null?void 0:a.type)==="position-keyword"&&(a.value==="left"?e=0:a.value==="center"?e=50:a.value==="right"?e=100:a.value==="top"?n=0:a.value==="bottom"&&(n=100)),(s==null?void 0:s.type)==="position-keyword"&&(s.value==="left"?e=0:s.value==="center"?n=50:s.value==="right"?e=100:s.value==="top"?n=0:s.value==="bottom"&&(n=100)),((a==null?void 0:a.type)==="px"||(a==null?void 0:a.type)==="%"||(a==null?void 0:a.type)==="em")&&(r=a==null?void 0:a.type,e=Number(a.value)),((s==null?void 0:s.type)==="px"||(s==null?void 0:s.type)==="%"||(s==null?void 0:s.type)==="em")&&(i=s==null?void 0:s.type,n=Number(s.value))}return{cx:oe(e,r),cy:oe(n,i)}}),DV=pn(function(t){var e;if(t.indexOf("linear")>-1||t.indexOf("radial")>-1){var n=MV(t);return n.map(function(s){var l=s.type,c=s.orientation,u=s.colorStops;LV(u);var f=u.map(function(b){return{offset:oe(Number(b.length.value),"%"),color:EV(b)}});if(l==="linear-gradient")return new dp(Li.LinearGradient,{angle:c?IV(c):li,steps:f});if(l==="radial-gradient"&&(c||(c=[{type:"shape",value:"circle"}]),c[0].type==="shape"&&c[0].value==="circle")){var d=jV(c[0].at),h=d.cx,p=d.cy,v=void 0;if(c[0].style){var g=c[0].style,y=g.type,m=g.value;y==="extent-keyword"?v=d1(m):v=oe(m,y)}return new dp(Li.RadialGradient,{cx:h,cy:p,size:v,steps:f})}})}var r=t[0];if(t[1]==="("||t[2]==="("){if(r==="l"){var i=CV.exec(t);if(i){var o=((e=i[2].match(YA))===null||e===void 0?void 0:e.map(function(s){return s.split(":")}))||[];return[new dp(Li.LinearGradient,{angle:oe(parseFloat(i[1]),"deg"),steps:o.map(function(s){var l=D(s,2),c=l[0],u=l[1];return{offset:oe(Number(c)*100,"%"),color:u}})})]}}else if(r==="r"){var a=$V(t);if(a)if(ao(a))t=a;else return[new dp(Li.RadialGradient,a)]}else if(r==="p")return FV(t)}});function $V(t){var e,n=TV.exec(t);if(n){var r=((e=n[4].match(YA))===null||e===void 0?void 0:e.map(function(i){return i.split(":")}))||[];return{cx:oe(50,"%"),cy:oe(50,"%"),steps:r.map(function(i){var o=D(i,2),a=o[0],s=o[1];return{offset:oe(Number(a)*100,"%"),color:s}})}}return null}function FV(t){var e=kV.exec(t);if(e){var n=e[1],r=e[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;case"n":n="no-repeat";break;default:n="no-repeat"}return{image:r,repetition:n}}return null}function Ku(t){return t&&!!t.image}function pp(t){return t&&!Ot(t.r)&&!Ot(t.g)&&!Ot(t.b)}var lo=pn(function(t){if(Ku(t))return G({repetition:"repeat"},t);if(Ot(t)&&(t=""),t==="transparent")return BA;t==="currentColor"&&(t="black");var e=DV(t);if(e)return e;var n=sp(t),r=[0,0,0,0];return n!==null&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),SV.apply(void 0,Q([],D(r),!1))});function RV(t,e){if(!(!pp(t)||!pp(e)))return[[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],function(n){var r=n.slice();if(r[3])for(var i=0;i<3;i++)r[i]=Math.round(Wu(r[i],0,255));return r[3]=Wu(r[3],0,1),"rgba(".concat(r.join(","),")")}]}function Zu(t,e){if(Ot(e))return oe(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return oe(Number(e),"px");if("deg".search(t)>=0)return oe(Number(e),"deg")}var n=[];e=e.replace(t,function(i){return n.push(i),"U"+i});var r="U("+t.source+")";return n.map(function(i){return oe(Number(e.replace(new RegExp("U"+i,"g"),"").replace(new RegExp(r,"g"),"*0")),i)})[0]}var WA=function(t){return Zu(new RegExp("px","g"),t)},BV=pn(WA),zV=function(t){return Zu(new RegExp("%","g"),t)};pn(zV);var Qu=function(t){return as(t)||isFinite(Number(t))?oe(Number(t)||0,"px"):Zu(new RegExp("px|%|em|rem","g"),t)},Nl=pn(Qu),v1=function(t){return Zu(new RegExp("deg|rad|grad|turn","g"),t)},GA=pn(v1);function YV(t,e,n,r,i){i===void 0&&(i=0);var o="",a=t.value||0,s=e.value||0,l=c1(t.unit),c=t.convertTo(l),u=e.convertTo(l);return c&&u?(a=c.value,s=u.value,o=s1(t.unit)):(te.isLength(t.unit)||te.isLength(e.unit))&&(a=yr(t,i,n),s=yr(e,i,n),o="px"),[a,s,function(f){return r&&(f=Math.max(f,0)),f+o}]}function gr(t){var e=0;return t.unit===rt.kDegrees?e=t.value:t.unit===rt.kRadians?e=Ir(Number(t.value)):t.unit===rt.kTurns&&(e=tV(Number(t.value))),e}function g1(t,e){var n;return Array.isArray(t)?n=t.map(function(r){return Number(r)}):ao(t)?n=t.split(" ").map(function(r){return Number(r)}):as(t)&&(n=[t]),e===2?n.length===1?[n[0],n[0]]:[n[0],n[1]]:n.length===1?[n[0],n[0],n[0],n[0]]:n.length===2?[n[0],n[1],n[0],n[1]]:n.length===3?[n[0],n[1],n[2],n[1]]:[n[0],n[1],n[2],n[3]]}function HA(t){return ao(t)?t.split(" ").map(function(e){return Nl(e)}):t.map(function(e){return Nl(e.toString())})}function yr(t,e,n){if(t.value===0)return 0;if(t.unit===rt.kPixels)return Number(t.value);if(t.unit===rt.kPercentage&&n){var r=n.nodeName===H.GROUP?n.getLocalBounds():n.geometry.contentBounds;return t.value/100*r.halfExtents[e]*2}return 0}var WV=function(t){return Zu(/deg|rad|grad|turn|px|%/g,t)},GV=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function UA(t){if(t===void 0&&(t=""),t=t.toLowerCase().trim(),t==="none")return[];for(var e=/\s*([\w-]+)\(([^)]*)\)/g,n=[],r,i=0;r=e.exec(t);){if(r.index!==i)return[];if(i=r.index+r[0].length,GV.indexOf(r[1])>-1&&n.push({name:r[1],params:r[2].split(" ").map(function(o){return WV(o)||lo(o)})}),e.lastIndex===t.length)return n}return[]}function VA(t){return t.toString()}var Il=function(t){return typeof t=="number"?oe(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?oe(Number(t)):oe(0)},ls=pn(Il);pn(function(t){return ao(t)?t.split(" ").map(ls):t.map(ls)});function y1(t,e){return[t,e,VA]}function m1(t,e){return function(n,r){return[n,r,function(i){return VA(Wu(i,t,e))}]}}function XA(t,e){if(t.length===e.length)return[t,e,function(n){return n}]}function b1(t){return t.parsedStyle.path.totalLength===0&&(t.parsedStyle.path.totalLength=gU(t.parsedStyle.path.absolutePath)),t.parsedStyle.path.totalLength}function HV(t){for(var e=0;e<t.length;e++){var n=t[e-1],r=t[e],i=r[0];if(i==="M"&&n){var o=n[0],a=[r[1],r[2]],s=void 0;o==="L"||o==="M"?s=[n[1],n[2]]:(o==="C"||o==="A"||o==="Q")&&(s=[n[n.length-2],n[n.length-1]]),s&&vp(a,s)&&(t.splice(e,1),e--)}}}function UV(t){for(var e=!1,n=t.length,r=0;r<n;r++){var i=t[r],o=i[0];if(o==="C"||o==="A"||o==="Q"){e=!0;break}}return e}function VV(t){for(var e=[],n=[],r=[],i=0;i<t.length;i++){var o=t[i],a=o[0];a==="M"?(r.length&&(n.push(r),r=[]),r.push([o[1],o[2]])):a==="Z"?r.length&&(e.push(r),r=[]):r.push([o[1],o[2]])}return r.length>0&&n.push(r),{polygons:e,polylines:n}}function vp(t,e){return t[0]===e[0]&&t[1]===e[1]}function XV(t,e){for(var n=[],r=[],i=[],o=0;o<t.length;o++){var a=t[o],s=a.currentPoint,l=a.params,c=a.prePoint,u=void 0;switch(a.command){case"Q":u=UU(c[0],c[1],l[1],l[2],l[3],l[4]);break;case"C":u=YU(c[0],c[1],l[1],l[2],l[3],l[4],l[5],l[6]);break;case"A":var f=a.arcParams;u=RU(f.cx,f.cy,f.rx,f.ry,f.xRotation,f.startAngle,f.endAngle);break;default:n.push(s[0]),r.push(s[1]);break}u&&(a.box=u,n.push(u.x,u.x+u.width),r.push(u.y,u.y+u.height)),e&&(a.command==="L"||a.command==="M")&&a.prePoint&&a.nextPoint&&i.push(a)}n=n.filter(function(y){return!Number.isNaN(y)&&y!==1/0&&y!==-1/0}),r=r.filter(function(y){return!Number.isNaN(y)&&y!==1/0&&y!==-1/0});var d=QP(n),h=QP(r),p=ZP(n),v=ZP(r);if(i.length===0)return{x:d,y:h,width:p-d,height:v-h};for(var o=0;o<i.length;o++){var a=i[o],s=a.currentPoint,g=void 0;s[0]===d?(g=gp(a,e),d=d-g.xExtra):s[0]===p&&(g=gp(a,e),p=p+g.xExtra),s[1]===h?(g=gp(a,e),h=h-g.yExtra):s[1]===v&&(g=gp(a,e),v=v+g.yExtra)}return{x:d,y:h,width:p-d,height:v-h}}function gp(t,e){var n=t.prePoint,r=t.currentPoint,i=t.nextPoint,o=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),a=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2),l=Math.acos((o+a-s)/(2*Math.sqrt(o)*Math.sqrt(a)));if(!l||Math.sin(l)===0||GH(l,0))return{xExtra:0,yExtra:0};var c=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),u=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));c=c>Math.PI/2?Math.PI-c:c,u=u>Math.PI/2?Math.PI-u:u;var f={xExtra:Math.cos(l/2-c)*(e/2*(1/Math.sin(l/2)))-e/2||0,yExtra:Math.cos(u-l/2)*(e/2*(1/Math.sin(l/2)))-e/2||0};return f}function qA(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}var KA=function(t,e){var n=t.x*e.x+t.y*e.y,r=Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2))),i=t.x*e.y-t.y*e.x<0?-1:1,o=i*Math.acos(n/r);return o},ZA=function(t,e,n,r,i,o,a,s){e=Math.abs(e),n=Math.abs(n),r=JP(r,360);var l=Me(r);if(t.x===a.x&&t.y===a.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(e===0||n===0)return{x:0,y:0,ellipticalArcAngle:0};var c=(t.x-a.x)/2,u=(t.y-a.y)/2,f={x:Math.cos(l)*c+Math.sin(l)*u,y:-Math.sin(l)*c+Math.cos(l)*u},d=Math.pow(f.x,2)/Math.pow(e,2)+Math.pow(f.y,2)/Math.pow(n,2);d>1&&(e=Math.sqrt(d)*e,n=Math.sqrt(d)*n);var h=Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(f.y,2)-Math.pow(n,2)*Math.pow(f.x,2),p=Math.pow(e,2)*Math.pow(f.y,2)+Math.pow(n,2)*Math.pow(f.x,2),v=h/p;v=v<0?0:v;var g=(i!==o?1:-1)*Math.sqrt(v),y={x:g*(e*f.y/n),y:g*(-(n*f.x)/e)},m={x:Math.cos(l)*y.x-Math.sin(l)*y.y+(t.x+a.x)/2,y:Math.sin(l)*y.x+Math.cos(l)*y.y+(t.y+a.y)/2},b={x:(f.x-y.x)/e,y:(f.y-y.y)/n},x=KA({x:1,y:0},b),w={x:(-f.x-y.x)/e,y:(-f.y-y.y)/n},O=KA(b,w);!o&&O>0?O-=2*Math.PI:o&&O<0&&(O+=2*Math.PI),O%=2*Math.PI;var _=x+O*s,S=e*Math.cos(_),E=n*Math.sin(_),M={x:Math.cos(l)*S-Math.sin(l)*E+m.x,y:Math.sin(l)*S+Math.cos(l)*E+m.y,ellipticalArcStartAngle:x,ellipticalArcEndAngle:x+O,ellipticalArcAngle:_,ellipticalArcCenter:m,resultantRx:e,resultantRy:n};return M};function qV(t){for(var e=[],n=null,r=null,i=null,o=0,a=t.length,s=0;s<a;s++){var l=t[s];r=t[s+1];var c=l[0],u={command:c,prePoint:n,params:l,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(c){case"M":i=[l[1],l[2]],o=s;break;case"A":var f=KV(n,l);u.arcParams=f;break}if(c==="Z")n=i,r=t[o+1];else{var d=l.length;n=[l[d-2],l[d-1]]}r&&r[0]==="Z"&&(r=t[o],e[o]&&(e[o].prePoint=n)),u.currentPoint=n,e[o]&&vp(n,e[o].currentPoint)&&(e[o].prePoint=u.prePoint);var h=r?[r[r.length-2],r[r.length-1]]:null;u.nextPoint=h;var p=u.prePoint;if(["L","H","V"].includes(c))u.startTangent=[p[0]-n[0],p[1]-n[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]];else if(c==="Q"){var v=[l[1],l[2]];u.startTangent=[p[0]-v[0],p[1]-v[1]],u.endTangent=[n[0]-v[0],n[1]-v[1]]}else if(c==="T"){var g=e[s-1],v=qA(g.currentPoint,p);g.command==="Q"?(u.command="Q",u.startTangent=[p[0]-v[0],p[1]-v[1]],u.endTangent=[n[0]-v[0],n[1]-v[1]]):(u.command="TL",u.startTangent=[p[0]-n[0],p[1]-n[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]])}else if(c==="C"){var y=[l[1],l[2]],m=[l[3],l[4]];u.startTangent=[p[0]-y[0],p[1]-y[1]],u.endTangent=[n[0]-m[0],n[1]-m[1]],u.startTangent[0]===0&&u.startTangent[1]===0&&(u.startTangent=[y[0]-m[0],y[1]-m[1]]),u.endTangent[0]===0&&u.endTangent[1]===0&&(u.endTangent=[m[0]-y[0],m[1]-y[1]])}else if(c==="S"){var g=e[s-1],y=qA(g.currentPoint,p),m=[l[1],l[2]];g.command==="C"?(u.command="C",u.startTangent=[p[0]-y[0],p[1]-y[1]],u.endTangent=[n[0]-m[0],n[1]-m[1]]):(u.command="SQ",u.startTangent=[p[0]-m[0],p[1]-m[1]],u.endTangent=[n[0]-m[0],n[1]-m[1]])}else if(c==="A"){var b=QA(u,0),x=b.x,w=b.y,O=QA(u,1,!1),_=O.x,S=O.y;u.startTangent=[x,w],u.endTangent=[_,S]}e.push(u)}return e}function QA(t,e,n){n===void 0&&(n=!0);var r=t.arcParams,i=r.rx,o=i===void 0?0:i,a=r.ry,s=a===void 0?0:a,l=r.xRotation,c=r.arcFlag,u=r.sweepFlag,f=ZA({x:t.prePoint[0],y:t.prePoint[1]},o,s,l,!!c,!!u,{x:t.currentPoint[0],y:t.currentPoint[1]},e),d=ZA({x:t.prePoint[0],y:t.prePoint[1]},o,s,l,!!c,!!u,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),h=d.x-f.x,p=d.y-f.y,v=Math.sqrt(h*h+p*p);return{x:-h/v,y:-p/v}}function yp(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function x1(t,e){return yp(t)*yp(e)?(t[0]*e[0]+t[1]*e[1])/(yp(t)*yp(e)):1}function JA(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(x1(t,e))}function KV(t,e){var n=e[1],r=e[2],i=JP(Me(e[3]),Math.PI*2),o=e[4],a=e[5],s=t[0],l=t[1],c=e[6],u=e[7],f=Math.cos(i)*(s-c)/2+Math.sin(i)*(l-u)/2,d=-1*Math.sin(i)*(s-c)/2+Math.cos(i)*(l-u)/2,h=f*f/(n*n)+d*d/(r*r);h>1&&(n*=Math.sqrt(h),r*=Math.sqrt(h));var p=n*n*(d*d)+r*r*(f*f),v=p?Math.sqrt((n*n*(r*r)-p)/p):1;o===a&&(v*=-1),isNaN(v)&&(v=0);var g=r?v*n*d/r:0,y=n?v*-r*f/n:0,m=(s+c)/2+Math.cos(i)*g-Math.sin(i)*y,b=(l+u)/2+Math.sin(i)*g+Math.cos(i)*y,x=[(f-g)/n,(d-y)/r],w=[(-1*f-g)/n,(-1*d-y)/r],O=JA([1,0],x),_=JA(x,w);return x1(x,w)<=-1&&(_=Math.PI),x1(x,w)>=1&&(_=0),a===0&&_>0&&(_=_-2*Math.PI),a===1&&_<0&&(_=_+2*Math.PI),{cx:m,cy:b,rx:vp(t,[c,u])?0:n,ry:vp(t,[c,u])?0:r,startAngle:O,endAngle:O+_,xRotation:i,arcFlag:o,sweepFlag:a}}function ZV(t,e,n){var r=e.parsedStyle,i=r.defX,o=i===void 0?0:i,a=r.defY,s=a===void 0?0:a;return t.reduce(function(l,c){var u="";if(c[0]==="M"||c[0]==="L"){var f=jt(c[1]-o,c[2]-s,0);n&&Qe(f,f,n),u="".concat(c[0]).concat(f[0],",").concat(f[1])}else if(c[0]==="Z")u=c[0];else if(c[0]==="C"){var d=jt(c[1]-o,c[2]-s,0),h=jt(c[3]-o,c[4]-s,0),p=jt(c[5]-o,c[6]-s,0);n&&(Qe(d,d,n),Qe(h,h,n),Qe(p,p,n)),u="".concat(c[0]).concat(d[0],",").concat(d[1],",").concat(h[0],",").concat(h[1],",").concat(p[0],",").concat(p[1])}else if(c[0]==="A"){var v=jt(c[6]-o,c[7]-s,0);n&&Qe(v,v,n),u="".concat(c[0]).concat(c[1],",").concat(c[2],",").concat(c[3],",").concat(c[4],",").concat(c[5],",").concat(v[0],",").concat(v[1])}else if(c[0]==="Q"){var d=jt(c[1]-o,c[2]-s,0),h=jt(c[3]-o,c[4]-s,0);n&&(Qe(d,d,n),Qe(h,h,n)),u="".concat(c[0]).concat(c[1],",").concat(c[2],",").concat(c[3],",").concat(c[4],"}")}return l+=u},"")}function QV(t,e,n,r){return[["M",t,e],["L",n,r]]}function tC(t,e,n,r){var i=(-1+Math.sqrt(2))/3*4,o=t*i,a=e*i,s=n-t,l=n+t,c=r-e,u=r+e;return[["M",s,r],["C",s,r-a,n-o,c,n,c],["C",n+o,c,l,r-a,l,r],["C",l,r+a,n+o,u,n,u],["C",n-o,u,s,r+a,s,r],["Z"]]}function JV(t,e){var n=t.map(function(r,i){return[i===0?"M":"L",r[0],r[1]]});return e&&n.push(["Z"]),n}function tX(t,e,n,r,i){if(i){var o=D(i,4),a=o[0],s=o[1],l=o[2],c=o[3],u=t>0?1:-1,f=e>0?1:-1,d=u+f!==0?1:0;return[["M",u*a+n,r],["L",t-u*s+n,r],s?["A",s,s,0,0,d,t+n,f*s+r]:null,["L",t+n,e-f*l+r],l?["A",l,l,0,0,d,t+n-u*l,e+r]:null,["L",n+u*c,e+r],c?["A",c,c,0,0,d,n,e+r-f*c]:null,["L",n,f*a+r],a?["A",a,a,0,0,d,u*a+n,r]:null,["Z"]].filter(function(h){return h})}return[["M",n,r],["L",n+t,r],["L",n+t,r+e],["L",n,r+e],["Z"]]}function w1(t,e){e===void 0&&(e=t.getLocalTransform());var n=[];switch(t.nodeName){case H.LINE:var r=t.parsedStyle,i=r.x1,o=i===void 0?0:i,a=r.y1,s=a===void 0?0:a,l=r.x2,c=l===void 0?0:l,u=r.y2,f=u===void 0?0:u;n=QV(o,s,c,f);break;case H.CIRCLE:{var d=t.parsedStyle,h=d.r,p=h===void 0?0:h,v=d.cx,g=v===void 0?0:v,y=d.cy,m=y===void 0?0:y;n=tC(p,p,g,m);break}case H.ELLIPSE:{var b=t.parsedStyle,x=b.rx,w=x===void 0?0:x,O=b.ry,_=O===void 0?0:O,S=b.cx,g=S===void 0?0:S,E=b.cy,m=E===void 0?0:E;n=tC(w,_,g,m);break}case H.POLYLINE:case H.POLYGON:var M=t.parsedStyle.points;n=JV(M.points,t.nodeName===H.POLYGON);break;case H.RECT:var P=t.parsedStyle,C=P.width,A=C===void 0?0:C,T=P.height,k=T===void 0?0:T,N=P.x,j=N===void 0?0:N,L=P.y,I=L===void 0?0:L,$=P.radius,F=$&&$.some(function(B){return B!==0});n=tX(A,k,j,I,F&&$.map(function(B){return Wu(B,0,Math.min(Math.abs(A)/2,Math.abs(k)/2))}));break;case H.PATH:var R=t.parsedStyle.path.absolutePath;n=Q([],D(R),!1);break}if(n.length)return ZV(n,t,e)}var eC=function(t){if(t===""||Array.isArray(t)&&t.length===0)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var e;try{e=ip(t)}catch(d){e=ip(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}HV(e);var n=UV(e),r=VV(e),i=r.polygons,o=r.polylines,a=qV(e),s=XV(a,0),l=s.x,c=s.y,u=s.width,f=s.height;return{absolutePath:e,hasArc:n,segments:a,polygons:i,polylines:o,totalLength:0,rect:{x:Number.isFinite(l)?l:0,y:Number.isFinite(c)?c:0,width:Number.isFinite(u)?u:0,height:Number.isFinite(f)?f:0}}},eX=pn(eC);function O1(t){return ao(t)?eX(t):eC(t)}function nX(t,e,n){var r=t.curve,i=e.curve;(!r||r.length===0)&&(r=qm(t.absolutePath,!1),t.curve=r),(!i||i.length===0)&&(i=qm(e.absolutePath,!1),e.curve=i);var o=[r,i];r.length!==i.length&&(o=hA(r,i));var a=fA(o[0])!==fA(o[1])?uU(o[0]):cU(o[0]);return[a,mU(o[1],a),function(s){return s}]}function nC(t,e){var n;ao(t)?n=t.split(" ").map(function(u){var f=D(u.split(","),2),d=f[0],h=f[1];return[Number(d),Number(h)]}):n=t;var r=[],i=0,o,a,s=HU(n);n.forEach(function(u,f){n[f+1]&&(o=[0,0],o[0]=i/s,a=EA(u[0],u[1],n[f+1][0],n[f+1][1]),i+=a,o[1]=i/s,r.push(o))});var l=Math.min.apply(Math,Q([],D(n.map(function(u){return u[0]})),!1)),c=Math.min.apply(Math,Q([],D(n.map(function(u){return u[1]})),!1));return e&&(e.parsedStyle.defX=l,e.parsedStyle.defY=c),{points:n,totalLength:s,segments:r}}function rX(t,e){return[t.points,e.points,function(n){return n}]}var Ne=null;function Zn(t){return function(e){var n=0;return t.map(function(r){return r===Ne?e[n++]:r})}}function cs(t){return t}var mp={matrix:["NNNNNN",[Ne,Ne,0,0,Ne,Ne,0,0,0,0,1,0,Ne,Ne,0,1],cs],matrix3d:["NNNNNNNNNNNNNNNN",cs],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Zn([Ne,Ne,new te(1)]),cs],scalex:["N",Zn([Ne,new te(1),new te(1)]),Zn([Ne,new te(1)])],scaley:["N",Zn([new te(1),Ne,new te(1)]),Zn([new te(1),Ne])],scalez:["N",Zn([new te(1),new te(1),Ne])],scale3d:["NNN",cs],skew:["Aa",null,cs],skewx:["A",null,Zn([Ne,li])],skewy:["A",null,Zn([li,Ne])],translate:["Tt",Zn([Ne,Ne,Je]),cs],translatex:["T",Zn([Ne,Je,Je]),Zn([Ne,Je])],translatey:["T",Zn([Je,Ne,Je]),Zn([Je,Ne])],translatez:["L",Zn([Je,Je,Ne])],translate3d:["TTL",cs]};function _1(t){if(t=(t||"none").toLowerCase().trim(),t==="none")return[];for(var e=/\s*(\w+)\(([^)]*)\)/g,n=[],r,i=0;r=e.exec(t);){if(r.index!==i)return[];i=r.index+r[0].length;var o=r[1],a=mp[o];if(!a)return[];var s=r[2].split(","),l=a[0];if(l.length<s.length)return[];for(var c=[],u=0;u<l.length;u++){var f=s[u],d=l[u],h=void 0;if(f?h={A:function(p){return p.trim()==="0"?li:GA(p)},N:ls,T:Nl,L:BV}[d.toUpperCase()](f):h={a:li,n:c[0],t:Je}[d],h===void 0)return[];c.push(h)}if(n.push({t:o,d:c}),e.lastIndex===t.length)return n}return[]}function rC(t){if(t=(t||"none").toLowerCase().trim(),t==="none")return[];for(var e=/\s*(\w+)\(([^)]*)\)/g,n=[],r,i=0;r=e.exec(t);){if(r.index!==i)return[];i=r.index+r[0].length;var o=r[1],a=mp[o];if(!a)return[];var s=r[2].split(","),l=a[0];if(l.length<s.length)return[];for(var c=[],u=0;u<l.length;u++){var f=s[u],d=l[u],h=void 0;if(f?h={A:function(p){return p.trim()==="0"?li:v1(p)},N:Il,T:Qu,L:WA}[d.toUpperCase()](f):h={a:li,n:c[0],t:Je}[d],h===void 0)return[];c.push(h)}if(n.push({t:o,d:c}),e.lastIndex===t.length)return n}return[]}function iX(t){var e,n,r,i;switch(t.t){case"rotatex":return i=Me(gr(t.d[0])),[1,0,0,0,0,Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1];case"rotatey":return i=Me(gr(t.d[0])),[Math.cos(i),0,-Math.sin(i),0,0,1,0,0,Math.sin(i),0,Math.cos(i),0,0,0,0,1];case"rotate":case"rotatez":return i=Me(gr(t.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":e=t.d[0].value,n=t.d[1].value,r=t.d[2].value,i=Me(gr(t.d[3]));var o=e*e+n*n+r*r;if(o===0)e=1,n=0,r=0;else if(o!==1){var a=Math.sqrt(o);e/=a,n/=a,r/=a}var s=Math.sin(i/2),l=s*Math.cos(i/2),c=s*s;return[1-2*(n*n+r*r)*c,2*(e*n*c+r*l),2*(e*r*c-n*l),0,2*(e*n*c-r*l),1-2*(e*e+r*r)*c,2*(n*r*c+e*l),0,2*(e*r*c+n*l),2*(n*r*c-e*l),1-2*(e*e+n*n)*c,0,0,0,0,1];case"scale":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scalex":return[t.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaley":return[1,0,0,0,0,t.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scalez":return[1,0,0,0,0,1,0,0,0,0,t.d[0].value,0,0,0,0,1];case"scale3d":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,t.d[2].value,0,0,0,0,1];case"skew":var u=Me(gr(t.d[0])),f=Me(gr(t.d[1]));return[1,Math.tan(f),0,0,Math.tan(u),1,0,0,0,0,1,0,0,0,0,1];case"skewx":return i=Me(gr(t.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewy":return i=Me(gr(t.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return e=yr(t.d[0],0,null)||0,n=yr(t.d[1],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,e,n,0,1];case"translatex":return e=yr(t.d[0],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,e,0,0,1];case"translatey":return n=yr(t.d[0],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,0,n,0,1];case"translatez":return r=yr(t.d[0],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,r,1];case"translate3d":return e=yr(t.d[0],0,null)||0,n=yr(t.d[1],0,null)||0,r=yr(t.d[2],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,e,n,r,1];case"perspective":var d=yr(t.d[0],0,null)||0,h=d?-1/d:0;return[1,0,0,0,0,1,0,0,0,0,1,h,0,0,0,1];case"matrix":return[t.d[0].value,t.d[1].value,0,0,t.d[2].value,t.d[3].value,0,0,0,0,1,0,t.d[4].value,t.d[5].value,0,1];case"matrix3d":return t.d.map(function(p){return p.value})}}function oX(t,e){return[t[0]*e[0]+t[4]*e[1]+t[8]*e[2]+t[12]*e[3],t[1]*e[0]+t[5]*e[1]+t[9]*e[2]+t[13]*e[3],t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]*e[3],t[3]*e[0]+t[7]*e[1]+t[11]*e[2]+t[15]*e[3],t[0]*e[4]+t[4]*e[5]+t[8]*e[6]+t[12]*e[7],t[1]*e[4]+t[5]*e[5]+t[9]*e[6]+t[13]*e[7],t[2]*e[4]+t[6]*e[5]+t[10]*e[6]+t[14]*e[7],t[3]*e[4]+t[7]*e[5]+t[11]*e[6]+t[15]*e[7],t[0]*e[8]+t[4]*e[9]+t[8]*e[10]+t[12]*e[11],t[1]*e[8]+t[5]*e[9]+t[9]*e[10]+t[13]*e[11],t[2]*e[8]+t[6]*e[9]+t[10]*e[10]+t[14]*e[11],t[3]*e[8]+t[7]*e[9]+t[11]*e[10]+t[15]*e[11],t[0]*e[12]+t[4]*e[13]+t[8]*e[14]+t[12]*e[15],t[1]*e[12]+t[5]*e[13]+t[9]*e[14]+t[13]*e[15],t[2]*e[12]+t[6]*e[13]+t[10]*e[14]+t[14]*e[15],t[3]*e[12]+t[7]*e[13]+t[11]*e[14]+t[15]*e[15]]}function aX(t){return t.length===0?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(iX).reduce(oX)}function iC(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],o=[0,0,0,1];return oV(aX(t),e,n,r,i,o),[[e,n,r,o,i]]}var sX=function(){function t(r,i){for(var o=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],a=0;a<4;a++)for(var s=0;s<4;s++)for(var l=0;l<4;l++)o[a][s]+=i[a][l]*r[l][s];return o}function e(r){return r[0][2]==0&&r[0][3]==0&&r[1][2]==0&&r[1][3]==0&&r[2][0]==0&&r[2][1]==0&&r[2][2]==1&&r[2][3]==0&&r[3][2]==0&&r[3][3]==1}function n(r,i,o,a,s){for(var l=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],c=0;c<4;c++)l[c][3]=s[c];for(var c=0;c<3;c++)for(var u=0;u<3;u++)l[3][c]+=r[u]*l[u][c];var f=a[0],d=a[1],h=a[2],p=a[3],v=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];v[0][0]=1-2*(d*d+h*h),v[0][1]=2*(f*d-h*p),v[0][2]=2*(f*h+d*p),v[1][0]=2*(f*d+h*p),v[1][1]=1-2*(f*f+h*h),v[1][2]=2*(d*h-f*p),v[2][0]=2*(f*h-d*p),v[2][1]=2*(d*h+f*p),v[2][2]=1-2*(f*f+d*d),l=t(l,v);var g=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];o[2]&&(g[2][1]=o[2],l=t(l,g)),o[1]&&(g[2][1]=0,g[2][0]=o[0],l=t(l,g)),o[0]&&(g[2][0]=0,g[1][0]=o[0],l=t(l,g));for(var c=0;c<3;c++)for(var u=0;u<3;u++)l[c][u]*=i[c];return e(l)?[l[0][0],l[0][1],l[1][0],l[1][1],l[3][0],l[3][1]]:l[0].concat(l[1],l[2],l[3])}return n}();function lX(t){return t.toFixed(6).replace(".000000","")}function S1(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=iC(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=iC(e)),n[0]===null||r[0]===null?[[!1],[!0],function(i){return i?e[0].d:t[0].d}]:(n[0].push(0),r[0].push(1),[n,r,function(i){var o=uX(n[0][3],r[0][3],i[5]),a=sX(i[0],i[1],i[2],o,i[4]),s=a.map(lX).join(",");return s}])}function cX(t,e){for(var n=0,r=0;r<t.length;r++)n+=t[r]*e[r];return n}function uX(t,e,n){var r=cX(t,e);r=Wu(r,-1,1);var i=[];if(r===1)i=t;else for(var o=Math.acos(r),a=Math.sin(n*o)*1/Math.sqrt(1-r*r),s=0;s<4;s++)i.push(t[s]*(Math.cos(n*o)-r*a)+e[s]*a);return i}function E1(t){return t.replace(/[xy]/,"")}function M1(t){return t.replace(/(x|y|z|3d)?$/,"3d")}var fX=function(t,e){return t==="perspective"&&e==="perspective"||(t==="matrix"||t==="matrix3d")&&(e==="matrix"||e==="matrix3d")};function dX(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(O){var _=t[O],S=_.t,E=_.d,M=S.substring(0,5)==="scale"?1:0;e.push({t:S,d:E.map(function(P){return typeof P=="number"?oe(M):oe(M,P.unit)})})},o=0;o<t.length;o++)i(o)}var a=[],s=[],l=[];if(t.length!==e.length){var c=S1(t,e);a=[c[0]],s=[c[1]],l=[["matrix",[c[2]]]]}else for(var o=0;o<t.length;o++){var u=t[o].t,f=e[o].t,d=t[o].d,h=e[o].d,p=mp[u],v=mp[f],g=void 0;if(fX(u,f)){var c=S1([t[o]],[e[o]]);a.push(c[0]),s.push(c[1]),l.push(["matrix",[c[2]]]);continue}else if(u===f)g=u;else if(p[2]&&v[2]&&E1(u)===E1(f))g=E1(u),d=p[2](d),h=v[2](h);else if(p[1]&&v[1]&&M1(u)===M1(f))g=M1(u),d=p[1](d),h=v[1](h);else{var c=S1(t,e);a=[c[0]],s=[c[1]],l=[["matrix",[c[2]]]];break}for(var y=[],m=[],b=[],x=0;x<d.length;x++){var c=YV(d[x],h[x],n,!1,x);y[x]=c[0],m[x]=c[1],b.push(c[2])}a.push(y),s.push(m),l.push([g,b])}if(r){var w=a;a=s,s=w}return[a,s,function(O){return O.map(function(_,S){var E=_.map(function(M,P){return l[S][1][P](M)}).join(",");return l[S][0]==="matrix"&&E.split(",").length===16&&(l[S][0]="matrix3d"),l[S][0]==="matrix3d"&&E.split(",").length===6&&(l[S][0]="matrix"),l[S][0]+"("+E+")"}).join(" ")}]}var oC=pn(function(t){if(ao(t)){if(t==="text-anchor")return[oe(0,"px"),oe(0,"px")];var e=t.split(" ");return e.length===1&&(e[0]==="top"||e[0]==="bottom"?(e[1]=e[0],e[0]="center"):e[1]="center"),e.length!==2?null:[Nl(bp(e[0])),Nl(bp(e[1]))]}else return[oe(t[0]||0,"px"),oe(t[1]||0,"px")]}),hX=function(t){if(ao(t)){if(t==="text-anchor")return[oe(0,"px"),oe(0,"px")];var e=t.split(" ");return e.length===1&&(e[0]==="top"||e[0]==="bottom"?(e[1]=e[0],e[0]="center"):e[1]="center"),e.length!==2?null:[Qu(bp(e[0])),Qu(bp(e[1]))]}else return[oe(t[0]||0,"px"),oe(t[1]||0,"px")]};function bp(t){return t==="center"?"50%":t==="left"||t==="top"?"0":t==="right"||t==="bottom"?"100%":t}var P1=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:at.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:at.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:at.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:at.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:at.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:at.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:at.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:at.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:at.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:at.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:at.LENGTH_PERCENTAGE},{n:"lineJoin",inh:!0,l:!0,a:["strokeLinejoin"],k:["miter","bevel","round"],d:"miter"},{n:"lineCap",inh:!0,l:!0,a:["strokeLinecap"],k:["butt","round","square"],d:"butt"},{n:"lineDash",int:!0,inh:!0,k:["none"],a:["strokeDasharray"],syntax:at.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:at.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:at.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:at.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:at.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:at.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:at.Z_INDEX},{n:"visibility",k:["visible","hidden"],ind:!0,inh:!0,int:!0,d:"visible"},{n:"pointerEvents",inh:!0,k:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","all"],d:"auto"},{n:"filter",ind:!0,l:!0,k:["none"],d:"none",syntax:at.FILTER},{n:"clipPath",syntax:at.DEFINED_PATH},{n:"textPath",syntax:at.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:at.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:at.TRANSFORM},{n:"transformOrigin",p:100,d:function(t){return t===H.CIRCLE||t===H.ELLIPSE?"center":t===H.TEXT?"text-anchor":"left top"},l:!0,syntax:at.TRANSFORM_ORIGIN},{n:"anchor",p:99,d:function(t){return t===H.CIRCLE||t===H.ELLIPSE?"0.5 0.5":"0 0"},l:!0,syntax:at.LENGTH_PERCENTAGE_12},{n:"cx",int:!0,d:"0",syntax:at.COORDINATE},{n:"cy",int:!0,d:"0",syntax:at.COORDINATE},{n:"cz",int:!0,d:"0",syntax:at.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:at.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:at.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:at.LENGTH_PERCENTAGE},{n:"x",int:!0,d:"0",syntax:at.COORDINATE},{n:"y",int:!0,d:"0",syntax:at.COORDINATE},{n:"z",int:!0,d:"0",syntax:at.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:at.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:at.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:at.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:at.COORDINATE},{n:"y1",int:!0,l:!0,syntax:at.COORDINATE},{n:"z1",int:!0,l:!0,syntax:at.COORDINATE},{n:"x2",int:!0,l:!0,syntax:at.COORDINATE},{n:"y2",int:!0,l:!0,syntax:at.COORDINATE},{n:"z2",int:!0,l:!0,syntax:at.COORDINATE},{n:"path",int:!0,l:!0,d:"",a:["d"],syntax:at.PATH,p:50},{n:"points",int:!0,l:!0,syntax:at.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:at.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:at.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:at.LENGTH_PERCENTAGE},{n:"fontFamily",l:!0,inh:!0,d:"sans-serif"},{n:"fontStyle",l:!0,inh:!0,k:["normal","italic","oblique"],d:"normal"},{n:"fontWeight",l:!0,inh:!0,k:["normal","bold","bolder","lighter"],d:"normal"},{n:"fontVariant",l:!0,inh:!0,k:["normal","small-caps"],d:"normal"},{n:"lineHeight",l:!0,syntax:at.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:at.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:at.NUMBER,d:function(t){return t===H.PATH||t===H.POLYGON||t===H.POLYLINE?"4":"10"}},{n:"wordWrap",l:!0},{n:"wordWrapWidth",l:!0},{n:"maxLines",l:!0},{n:"textOverflow",l:!0,d:"clip"},{n:"leading",l:!0},{n:"textBaseline",l:!0,inh:!0,k:["top","hanging","middle","alphabetic","ideographic","bottom"],d:"alphabetic"},{n:"textAlign",l:!0,inh:!0,k:["start","center","middle","end","left","right"],d:"start"},{n:"markerStart",syntax:at.MARKER},{n:"markerEnd",syntax:at.MARKER},{n:"markerMid",syntax:at.MARKER},{n:"markerStartOffset",syntax:at.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:at.LENGTH,l:!0,int:!0,d:"0"}],aC=P1.filter(function(t){return!!t.l}).map(function(t){return t.n}),ea={},jl=new WeakMap,pX=function(t,e){var n=jl.get(t);return!n||n.length===0?!0:n.includes(e)},vX=function(){function t(e){var n=this;this.runtime=e,P1.forEach(function(r){n.registerMetadata(r)})}return t.prototype.registerMetadata=function(e){Q([e.n],D(e.a||[]),!1).forEach(function(n){ea[n]=e})},t.prototype.unregisterMetadata=function(e){delete ea[e]},t.prototype.getPropertySyntax=function(e){return this.runtime.CSSPropertySyntaxFactory[e]},t.prototype.processProperties=function(e,n,r){var i=this;if(r===void 0&&(r={skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0}),!this.runtime.enableCSSParsing){Object.assign(e.attributes,n);var o=Object.keys(n),a=e.parsedStyle.clipPath,s=e.parsedStyle.offsetPath;e.parsedStyle=Object.assign(e.parsedStyle,n);var l=!!r.forceUpdateGeometry;if(!l){for(var c=0;c<aC.length;c++)if(aC[c]in n){l=!0;break}}n.fill&&(e.parsedStyle.fill=lo(n.fill)),n.stroke&&(e.parsedStyle.stroke=lo(n.stroke)),n.shadowColor&&(e.parsedStyle.shadowColor=lo(n.shadowColor)),n.filter&&(e.parsedStyle.filter=UA(n.filter)),Ot(n.radius)||(e.parsedStyle.radius=g1(n.radius,4)),Ot(n.lineDash)||(e.parsedStyle.lineDash=g1(n.lineDash,2)),n.points&&(e.parsedStyle.points=nC(n.points,e)),n.path===""&&(e.parsedStyle.path=G({},zA)),n.path&&(e.parsedStyle.path=O1(n.path),e.parsedStyle.defX=e.parsedStyle.path.rect.x,e.parsedStyle.defY=e.parsedStyle.path.rect.y),n.textTransform&&this.runtime.CSSPropertySyntaxFactory["<text-transform>"].calculator(null,null,{value:n.textTransform},e,null),n.clipPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("clipPath",a,n.clipPath,e,this.runtime),n.offsetPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("offsetPath",s,n.offsetPath,e,this.runtime),n.anchor&&(e.parsedStyle.anchor=g1(n.anchor,2)),n.transform&&(e.parsedStyle.transform=_1(n.transform)),n.transformOrigin&&(e.parsedStyle.transformOrigin=oC(n.transformOrigin)),n.markerStart&&(e.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,n.markerStart,n.markerStart,null,null)),n.markerEnd&&(e.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,n.markerEnd,n.markerEnd,null,null)),n.markerMid&&(e.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator("",n.markerMid,n.markerMid,null,null)),((e.nodeName===H.CIRCLE||e.nodeName===H.ELLIPSE)&&(!Ot(n.cx)||!Ot(n.cy))||(e.nodeName===H.RECT||e.nodeName===H.IMAGE||e.nodeName===H.GROUP||e.nodeName===H.HTML||e.nodeName===H.TEXT||e.nodeName===H.MESH)&&(!Ot(n.x)||!Ot(n.y)||!Ot(n.z))||e.nodeName===H.LINE&&(!Ot(n.x1)||!Ot(n.y1)||!Ot(n.z1)||!Ot(n.x2)||!Ot(n.y2)||!Ot(n.z2)))&&this.runtime.CSSPropertySyntaxFactory["<coordinate>"].postProcessor(e,o),Ot(n.zIndex)||this.runtime.CSSPropertySyntaxFactory["<z-index>"].postProcessor(e,o),n.path&&this.runtime.CSSPropertySyntaxFactory["<path>"].postProcessor(e,o),n.points&&this.runtime.CSSPropertySyntaxFactory["<list-of-points>"].postProcessor(e,o),Ot(n.offsetDistance)||this.runtime.CSSPropertySyntaxFactory["<offset-distance>"].postProcessor(e,o),n.transform&&this.runtime.CSSPropertySyntaxFactory["<transform>"].postProcessor(e,o),l&&this.updateGeometry(e);return}var u=r.skipUpdateAttribute,f=r.skipParse,d=r.forceUpdateGeometry,h=r.usedAttributes,p=r.memoize,v=d,g=Object.keys(n);g.forEach(function(y){var m;u||(e.attributes[y]=n[y]),!v&&(!((m=ea[y])===null||m===void 0)&&m.l)&&(v=!0)}),f||g.forEach(function(y){e.computedStyle[y]=i.parseProperty(y,e.attributes[y],e,p)}),h!=null&&h.length&&(g=Array.from(new Set(g.concat(h)))),g.forEach(function(y){y in e.computedStyle&&(e.parsedStyle[y]=i.computeProperty(y,e.computedStyle[y],e,p))}),v&&this.updateGeometry(e),g.forEach(function(y){y in e.parsedStyle&&i.postProcessProperty(y,e,g)}),this.runtime.enableCSSParsing&&e.children.length&&g.forEach(function(y){y in e.parsedStyle&&i.isPropertyInheritable(y)&&e.children.forEach(function(m){m.internalSetAttribute(y,null,{skipUpdateAttribute:!0,skipParse:!0})})})},t.prototype.parseProperty=function(e,n,r,i){var o=ea[e],a=n;if((n===""||Ot(n))&&(n="unset"),n==="unset"||n==="initial"||n==="inherit")a=d1(n);else if(o){var s=o.k,l=o.syntax,c=l&&this.getPropertySyntax(l);s&&s.indexOf(n)>-1?a=d1(n):c&&(!i&&c.parserUnmemoize?a=c.parserUnmemoize(n,r):c.parser&&(a=c.parser(n,r)))}return a},t.prototype.computeProperty=function(e,n,r,i){var o=ea[e],a=r.id==="g-root",s=n;if(o){var l=o.syntax,c=o.inh,u=o.d;if(n instanceof Kn){var f=n.value;if(f==="unset"&&(c&&!a?f="inherit":f="initial"),f==="initial")Ot(u)||(n=this.parseProperty(e,kl(u)?u(r.nodeName):u,r,i));else if(f==="inherit"){var d=this.tryToResolveProperty(r,e,{inherited:!0});if(Ot(d)){this.addUnresolveProperty(r,e);return}else return d}}var h=l&&this.getPropertySyntax(l);if(h&&h.calculator){var p=r.parsedStyle[e];s=h.calculator(e,p,n,r,this.runtime)}else n instanceof Kn?s=n.value:s=n}return s},t.prototype.postProcessProperty=function(e,n,r){var i=ea[e];if(i&&i.syntax){var o=i.syntax&&this.getPropertySyntax(i.syntax),a=o;a&&a.postProcessor&&a.postProcessor(n,r)}},t.prototype.addUnresolveProperty=function(e,n){var r=jl.get(e);r||(jl.set(e,[]),r=jl.get(e)),r.indexOf(n)===-1&&r.push(n)},t.prototype.tryToResolveProperty=function(e,n,r){r===void 0&&(r={});var i=r.inherited;if(i&&e.parentElement&&pX(e.parentElement,n)){var o=e.parentElement.parsedStyle[n];return o==="unset"||o==="initial"||o==="inherit"?void 0:o}},t.prototype.recalc=function(e){var n=jl.get(e);if(n&&n.length){var r={};n.forEach(function(i){r[i]=e.attributes[i]}),this.processProperties(e,r),jl.delete(e)}},t.prototype.updateGeometry=function(e){var n=e.nodeName,r=this.runtime.geometryUpdaterFactory[n];if(r){var i=e.geometry;i.contentBounds||(i.contentBounds=new Xe),i.renderBounds||(i.renderBounds=new Xe);var o=e.parsedStyle,a=r.update(o,e),s=a.width,l=a.height,c=a.depth,u=c===void 0?0:c,f=a.offsetX,d=f===void 0?0:f,h=a.offsetY,p=h===void 0?0:h,v=a.offsetZ,g=v===void 0?0:v,y=[Math.abs(s)/2,Math.abs(l)/2,u/2],m=o,b=m.stroke,x=m.lineWidth,w=m.increasedLineWidthForHitTesting,O=m.shadowType,_=m.shadowColor,S=m.filter,E=S===void 0?[]:S,M=m.transformOrigin,P=o.anchor;n===H.TEXT?delete o.anchor:n===H.MESH&&(o.anchor[2]=.5);var C=[(1-(P&&P[0]||0)*2)*s/2+d,(1-(P&&P[1]||0)*2)*l/2+p,(1-(P&&P[2]||0)*2)*y[2]+g];i.contentBounds.update(C,y);var A=n===H.POLYLINE||n===H.POLYGON||n===H.PATH?Math.SQRT2:.5,T=b&&!b.isNone;if(T){var k=((x||0)+(w||0))*A;y[0]+=k,y[1]+=k}if(i.renderBounds.update(C,y),_&&O&&O!=="inner"){var N=i.renderBounds,j=N.min,L=N.max,I=o,$=I.shadowBlur,F=I.shadowOffsetX,R=I.shadowOffsetY,B=$||0,W=F||0,K=R||0,J=j[0]-B+W,X=L[0]+B+W,V=j[1]-B+K,it=L[1]+B+K;j[0]=Math.min(j[0],J),L[0]=Math.max(L[0],X),j[1]=Math.min(j[1],V),L[1]=Math.max(L[1],it),i.renderBounds.setMinMax(j,L)}E.forEach(function(mt){var Nt=mt.name,Yt=mt.params;if(Nt==="blur"){var me=Yt[0].value;i.renderBounds.update(i.renderBounds.center,up(i.renderBounds.halfExtents,i.renderBounds.halfExtents,[me,me,0]))}else if(Nt==="drop-shadow"){var We=Yt[0].value,lr=Yt[1].value,$o=Yt[2].value,rl=i.renderBounds,Hn=rl.min,ei=rl.max,$t=Hn[0]-$o+We,Wt=ei[0]+$o+We,Ae=Hn[1]-$o+lr,qt=ei[1]+$o+lr;Hn[0]=Math.min(Hn[0],$t),ei[0]=Math.max(ei[0],Wt),Hn[1]=Math.min(Hn[1],Ae),ei[1]=Math.max(ei[1],qt),i.renderBounds.setMinMax(Hn,ei)}}),P=o.anchor;var nt=s<0,lt=l<0,yt=(nt?-1:1)*(M?yr(M[0],0,e):0),vt=(lt?-1:1)*(M?yr(M[1],1,e):0);yt=yt-(nt?-1:1)*(P&&P[0]||0)*i.contentBounds.halfExtents[0]*2,vt=vt-(lt?-1:1)*(P&&P[1]||0)*i.contentBounds.halfExtents[1]*2,e.setOrigin(yt,vt),this.runtime.sceneGraphService.dirtifyToRoot(e)}},t.prototype.updateSizeAttenuation=function(e,n){e.style.isSizeAttenuation?(e.style.rawLineWidth||(e.style.rawLineWidth=e.style.lineWidth),e.style.lineWidth=e.style.rawLineWidth/n,e.nodeName===H.CIRCLE&&(e.style.rawR||(e.style.rawR=e.style.r),e.style.r=e.style.rawR/n)):(e.style.rawLineWidth&&(e.style.lineWidth=e.style.rawLineWidth,delete e.style.rawLineWidth),e.nodeName===H.CIRCLE&&e.style.rawR&&(e.style.r=e.style.rawR,delete e.style.rawR))},t.prototype.isPropertyInheritable=function(e){var n=ea[e];return n?n.inh:!1},t}(),gX=function(){function t(){this.parser=GA,this.parserUnmemoize=v1,this.parserWithCSSDisabled=null,this.mixer=y1}return t.prototype.calculator=function(e,n,r,i){return gr(r)},t}(),yX=function(){function t(){}return t.prototype.calculator=function(e,n,r,i,o){return r instanceof Kn&&(r=null),o.sceneGraphService.updateDisplayObjectDependency(e,n,r,i),e==="clipPath"&&i.forEach(function(a){a.childNodes.length===0&&o.sceneGraphService.dirtifyToRoot(a)}),r},t}(),mX=function(){function t(){this.parser=lo,this.parserWithCSSDisabled=lo,this.mixer=RV}return t.prototype.calculator=function(e,n,r,i){return r instanceof Kn?r.value==="none"?h1:BA:r},t}(),bX=function(){function t(){this.parser=UA}return t.prototype.calculator=function(e,n,r){return r instanceof Kn?[]:r},t}();function sC(t){var e=t.parsedStyle.fontSize;return Ot(e)?null:e}var A1=function(){function t(){this.parser=Nl,this.parserUnmemoize=Qu,this.parserWithCSSDisabled=null,this.mixer=y1}return t.prototype.calculator=function(e,n,r,i,o){var a;if(as(r))return r;if(te.isRelativeUnit(r.unit)){var s=o.styleValueRegistry;if(r.unit===rt.kPercentage)return 0;if(r.unit===rt.kEms){if(i.parentNode){var l=sC(i.parentNode);if(l)return l*=r.value,l;s.addUnresolveProperty(i,e)}else s.addUnresolveProperty(i,e);return 0}else if(r.unit===rt.kRems){if(!((a=i==null?void 0:i.ownerDocument)===null||a===void 0)&&a.documentElement){var l=sC(i.ownerDocument.documentElement);if(l)return l*=r.value,l;s.addUnresolveProperty(i,e)}else s.addUnresolveProperty(i,e);return 0}}else return r.value},t}(),xX=function(){function t(){this.mixer=XA}return t.prototype.parser=function(e){var n=HA(as(e)?[e]:e),r;return n.length===1?r=[n[0],n[0]]:r=[n[0],n[1]],r},t.prototype.calculator=function(e,n,r){return r.map(function(i){return i.value})},t}(),wX=function(){function t(){this.mixer=XA}return t.prototype.parser=function(e){var n=HA(as(e)?[e]:e),r;return n.length===1?r=[n[0],n[0],n[0],n[0]]:n.length===2?r=[n[0],n[1],n[0],n[1]]:n.length===3?r=[n[0],n[1],n[2],n[1]]:r=[n[0],n[1],n[2],n[3]],r},t.prototype.calculator=function(e,n,r){return r.map(function(i){return i.value})},t}(),Ju=Kt();function C1(t,e){var n=e.parsedStyle.defX||0,r=e.parsedStyle.defY||0;return e.resetLocalTransform(),e.setLocalPosition(n,r),t.forEach(function(i){var o=i.t,a=i.d;if(o==="scale"){var s=(a==null?void 0:a.map(function(m){return m.value}))||[1,1];e.scaleLocal(s[0],s[1],1)}else if(o==="scalex"){var s=(a==null?void 0:a.map(function(b){return b.value}))||[1];e.scaleLocal(s[0],1,1)}else if(o==="scaley"){var s=(a==null?void 0:a.map(function(b){return b.value}))||[1];e.scaleLocal(1,s[0],1)}else if(o==="scalez"){var s=(a==null?void 0:a.map(function(b){return b.value}))||[1];e.scaleLocal(1,1,s[0])}else if(o==="scale3d"){var s=(a==null?void 0:a.map(function(b){return b.value}))||[1,1,1];e.scaleLocal(s[0],s[1],s[2])}else if(o==="translate"){var l=a||[Je,Je];e.translateLocal(l[0].value,l[1].value,0)}else if(o==="translatex"){var l=a||[Je];e.translateLocal(l[0].value,0,0)}else if(o==="translatey"){var l=a||[Je];e.translateLocal(0,l[0].value,0)}else if(o==="translatez"){var l=a||[Je];e.translateLocal(0,0,l[0].value)}else if(o==="translate3d"){var l=a||[Je,Je,Je];e.translateLocal(l[0].value,l[1].value,l[2].value)}else if(o==="rotate"){var c=a||[li];e.rotateLocal(0,0,gr(c[0]))}else if(o==="rotatex"){var c=a||[li];e.rotateLocal(gr(c[0]),0,0)}else if(o==="rotatey"){var c=a||[li];e.rotateLocal(0,gr(c[0]),0)}else if(o==="rotatez"){var c=a||[li];e.rotateLocal(0,0,gr(c[0]))}else if(o!=="rotate3d")if(o==="skew"){var u=(a==null?void 0:a.map(function(m){return m.value}))||[0,0];e.setLocalSkew(Me(u[0]),Me(u[1]))}else if(o==="skewx"){var u=(a==null?void 0:a.map(function(b){return b.value}))||[0];e.setLocalSkew(Me(u[0]),e.getLocalSkew()[1])}else if(o==="skewy"){var u=(a==null?void 0:a.map(function(b){return b.value}))||[0];e.setLocalSkew(e.getLocalSkew()[0],Me(u[0]))}else if(o==="matrix"){var f=D(a.map(function(m){return m.value}),6),d=f[0],h=f[1],p=f[2],v=f[3],g=f[4],y=f[5];e.setLocalTransform(Uy(Ju,d,h,0,0,p,v,0,0,0,0,1,0,g+n,y+r,0,1))}else o==="matrix3d"&&(Uy.apply(rY,Q([Ju],D(a.map(function(m){return m.value})),!1)),Ju[12]+=n,Ju[13]+=r,e.setLocalTransform(Ju))}),e.getLocalTransform()}var OX=function(t){st(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.postProcessor=function(n,r){var i,o,a;switch(n.nodeName){case H.CIRCLE:case H.ELLIPSE:var s=n.parsedStyle,l=s.cx,c=s.cy,u=s.cz;Ot(l)||(i=l),Ot(c)||(o=c),Ot(u)||(a=u);break;case H.LINE:var f=n.parsedStyle,d=f.x1,h=f.x2,p=f.y1,v=f.y2,g=Math.min(d,h),y=Math.min(p,v);i=g,o=y,a=0;break;case H.RECT:case H.IMAGE:case H.GROUP:case H.HTML:case H.TEXT:case H.MESH:Ot(n.parsedStyle.x)||(i=n.parsedStyle.x),Ot(n.parsedStyle.y)||(o=n.parsedStyle.y),Ot(n.parsedStyle.z)||(a=n.parsedStyle.z);break}n.nodeName!==H.PATH&&n.nodeName!==H.POLYLINE&&n.nodeName!==H.POLYGON&&(n.parsedStyle.defX=i||0,n.parsedStyle.defY=o||0);var m=!Ot(i)||!Ot(o)||!Ot(a);if(m&&r.indexOf("transform")===-1){var b=n.parsedStyle.transform;if(b&&b.length)C1(b,n);else{var x=D(n.getLocalPosition(),3),w=x[0],O=x[1],_=x[2];n.setLocalPosition(Ot(i)?w:i,Ot(o)?O:o,Ot(a)?_:a)}}},e}(A1),_X=function(){function t(){}return t.prototype.calculator=function(e,n,r,i){r instanceof Kn&&(r=null);var o=r==null?void 0:r.cloneNode(!0);return o&&(o.style.isMarker=!0),o},t}(),SX=function(){function t(){this.mixer=y1,this.parser=ls,this.parserUnmemoize=Il,this.parserWithCSSDisabled=null}return t.prototype.calculator=function(e,n,r){return r.value},t}(),EX=function(){function t(){this.parser=ls,this.parserUnmemoize=Il,this.parserWithCSSDisabled=null,this.mixer=m1(0,1)}return t.prototype.calculator=function(e,n,r){return r.value},t.prototype.postProcessor=function(e){var n=e.parsedStyle,r=n.offsetPath,i=n.offsetDistance;if(r){var o=r.nodeName;if(o===H.LINE||o===H.PATH||o===H.POLYLINE){var a=r.getPoint(i);a&&(e.parsedStyle.defX=a.x,e.parsedStyle.defY=a.y,e.setLocalPosition(a.x,a.y))}}},t}(),MX=function(){function t(){this.parser=ls,this.parserUnmemoize=Il,this.parserWithCSSDisabled=null,this.mixer=m1(0,1)}return t.prototype.calculator=function(e,n,r){return r.value},t}(),PX=function(){function t(){this.parser=O1,this.parserWithCSSDisabled=O1,this.mixer=nX}return t.prototype.calculator=function(e,n,r){return r instanceof Kn&&r.value==="unset"?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new ss(0,0,0,0)}:r},t.prototype.postProcessor=function(e,n){if(e.parsedStyle.defX=e.parsedStyle.path.rect.x,e.parsedStyle.defY=e.parsedStyle.path.rect.y,e.nodeName===H.PATH&&n.indexOf("transform")===-1){var r=e.parsedStyle,i=r.defX,o=i===void 0?0:i,a=r.defY,s=a===void 0?0:a;e.setLocalPosition(o,s)}},t}(),AX=function(){function t(){this.parser=nC,this.mixer=rX}return t.prototype.postProcessor=function(e,n){if((e.nodeName===H.POLYGON||e.nodeName===H.POLYLINE)&&n.indexOf("transform")===-1){var r=e.parsedStyle,i=r.defX,o=r.defY;e.setLocalPosition(i,o)}},t}(),CX=function(t){st(e,t);function e(){var n=t.apply(this,Q([],D(arguments),!1))||this;return n.mixer=m1(0,1/0),n}return e}(A1),TX=function(){function t(){}return t.prototype.calculator=function(e,n,r,i){return r instanceof Kn?r.value==="unset"?"":r.value:"".concat(r)},t.prototype.postProcessor=function(e){e.nodeValue="".concat(e.parsedStyle.text)||""},t}(),kX=function(){function t(){}return t.prototype.calculator=function(e,n,r,i){var o=i.getAttribute("text");if(o){var a=o;r.value==="capitalize"?a=o.charAt(0).toUpperCase()+o.slice(1):r.value==="lowercase"?a=o.toLowerCase():r.value==="uppercase"&&(a=o.toUpperCase()),i.parsedStyle.text=a}return r.value},t}(),T1={},LX=0;function NX(t,e){if(t){var n=typeof t=="string"?t:t.id||LX++;T1[n]&&T1[n].destroy(),T1[n]=e}}var tf=typeof window!="undefined"&&typeof window.document!="undefined";function IX(t){return!!t.getAttribute}function jX(t,e){for(var n=0,r=t.length;n<r;){var i=n+r>>>1;lC(t[i],e)<0?n=i+1:r=i}return n}function lC(t,e){var n=Number(t.parsedStyle.zIndex),r=Number(e.parsedStyle.zIndex);if(n===r){var i=t.parentNode;if(i){var o=i.childNodes||[];return o.indexOf(t)-o.indexOf(e)}}return n-r}function cC(t){var e,n=t;do{var r=(e=n.parsedStyle)===null||e===void 0?void 0:e.clipPath;if(r)return n;n=n.parentElement}while(n!==null);return null}var uC="px";function DX(t,e,n){tf&&t.style&&(t.style.width=e+uC,t.style.height=n+uC)}function fC(t,e){if(tf)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}function $X(t){var e=fC(t,"width");return e==="auto"?t.offsetWidth:parseFloat(e)}function FX(t){var e=fC(t,"height");return e==="auto"?t.offsetHeight:parseFloat(e)}var RX=1,BX={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},k1=typeof performance=="object"&&performance.now?performance:Date;function us(t,e,n){var r=!1,i=!1,o=!!e&&!e.isNone,a=!!n&&!n.isNone;return t==="visiblepainted"||t==="painted"||t==="auto"?(r=o,i=a):t==="visiblefill"||t==="fill"?r=!0:t==="visiblestroke"||t==="stroke"?i=!0:(t==="visible"||t==="all")&&(r=!0,i=!0),[r,i]}var zX=1,YX=function(){return zX++},Ni=typeof self=="object"&&self.self==self?self:typeof global=="object"&&global.global==global?global:{},WX=Date.now(),GX=function(){return Ni.performance&&typeof Ni.performance.now=="function"?Ni.performance.now():Date.now()-WX},ef={},dC=Date.now(),HX=function(t){if(typeof t!="function")throw new TypeError(t+" is not a function");var e=Date.now(),n=e-dC,r=n>16?0:16-n,i=YX();return ef[i]=t,Object.keys(ef).length>1||setTimeout(function(){dC=e;var o=ef;ef={},Object.keys(o).forEach(function(a){return o[a](GX())})},r),i},UX=function(t){delete ef[t]},VX=["","webkit","moz","ms","o"],hC=function(t){return typeof t!="string"?HX:t===""?Ni.requestAnimationFrame:Ni[t+"RequestAnimationFrame"]},XX=function(t){return typeof t!="string"?UX:t===""?Ni.cancelAnimationFrame:Ni[t+"CancelAnimationFrame"]||Ni[t+"CancelRequestAnimationFrame"]},qX=function(t,e){for(var n=0;t[n]!==void 0;){if(e(t[n]))return t[n];n=n+1}},pC=qX(VX,function(t){return!!hC(t)}),vC=hC(pC),gC=XX(pC);Ni.requestAnimationFrame=vC,Ni.cancelAnimationFrame=gC;var KX=function(){function t(){this.callbacks=[]}return t.prototype.getCallbacksNum=function(){return this.callbacks.length},t.prototype.tapPromise=function(e,n){this.callbacks.push(n)},t.prototype.promise=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return Promise.all(this.callbacks.map(function(r){return r.apply(void 0,Q([],D(e),!1))}))},t}(),ZX=function(){function t(){this.callbacks=[]}return t.prototype.tapPromise=function(e,n){this.callbacks.push(n)},t.prototype.promise=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return hl(this,void 0,void 0,function(){var r,i,o,a;return pl(this,function(s){switch(s.label){case 0:return this.callbacks.length?[4,(a=this.callbacks)[0].apply(a,Q([],D(e),!1))]:[3,6];case 1:r=s.sent(),i=0,s.label=2;case 2:return i<this.callbacks.length-1?(o=this.callbacks[i],[4,o(r)]):[3,5];case 3:r=s.sent(),s.label=4;case 4:return i++,[3,2];case 5:return[2,r];case 6:return[2,null]}})})},t}(),jn=function(){function t(){this.callbacks=[]}return t.prototype.tap=function(e,n){this.callbacks.push(n)},t.prototype.call=function(){var e=arguments;this.callbacks.forEach(function(n){n.apply(void 0,e)})},t}(),L1=function(){function t(){this.callbacks=[]}return t.prototype.tap=function(e,n){this.callbacks.push(n)},t.prototype.call=function(){if(this.callbacks.length){for(var e=arguments,n=this.callbacks[0].apply(void 0,e),r=0;r<this.callbacks.length-1;r++){var i=this.callbacks[r];n=i(n)}return n}return null},t}(),QX=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],JX=/([\"\'])[^\'\"]+\1/;function tq(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,o=t.fontWeight,a=as(e)&&"".concat(e,"px")||"16px",s=n.split(","),l=s.length-1;l>=0;l--){var c=s[l].trim();!JX.test(c)&&QX.indexOf(c)<0&&(c='"'.concat(c,'"')),s[l]=c}return"".concat(r," ").concat(i," ").concat(o," ").concat(a," ").concat(s.join(","))}var eq=function(){function t(){this.parser=_1,this.parserUnmemoize=rC,this.parserWithCSSDisabled=rC,this.mixer=dX}return t.prototype.calculator=function(e,n,r,i){return r instanceof Kn?[]:r},t.prototype.postProcessor=function(e){var n=e.parsedStyle.transform;C1(n,e)},t}(),nq=function(){function t(){this.parser=oC,this.parserUnmemoize=hX}return t}(),rq=function(){function t(){this.parser=ls,this.parserUnmemoize=Il}return t.prototype.calculator=function(e,n,r,i){return r.value},t.prototype.postProcessor=function(e){if(e.parentNode){var n=e.parentNode,r=n.renderable,i=n.sortable;r&&(r.dirty=!0),i&&(i.dirty=!0,i.dirtyReason=Ll.Z_INDEX_CHANGED)}},t}(),iq=function(){function t(){}return t.prototype.update=function(e,n){var r=e.r,i=r*2,o=r*2;return{width:i,height:o}},t}(),oq=function(){function t(){}return t.prototype.update=function(e,n){var r=e.rx,i=e.ry,o=r*2,a=i*2;return{width:o,height:a}},t}(),aq=function(){function t(){}return t.prototype.update=function(e){var n=e.x1,r=e.y1,i=e.x2,o=e.y2,a=Math.min(n,i),s=Math.max(n,i),l=Math.min(r,o),c=Math.max(r,o),u=s-a,f=c-l;return{width:u,height:f}},t}(),sq=function(){function t(){}return t.prototype.update=function(e){var n=e.path,r=n.rect,i=r.width,o=r.height;return{width:i,height:o}},t}(),lq=function(){function t(){}return t.prototype.update=function(e){if(e.points&&Xm(e.points.points)){var n=e.points.points,r=Math.min.apply(Math,Q([],D(n.map(function(c){return c[0]})),!1)),i=Math.max.apply(Math,Q([],D(n.map(function(c){return c[0]})),!1)),o=Math.min.apply(Math,Q([],D(n.map(function(c){return c[1]})),!1)),a=Math.max.apply(Math,Q([],D(n.map(function(c){return c[1]})),!1)),s=i-r,l=a-o;return{width:s,height:l}}return{width:0,height:0}},t}(),cq=function(){function t(){}return t.prototype.update=function(e,n){var r=e.img,i=e.width,o=i===void 0?0:i,a=e.height,s=a===void 0?0:a,l=o,c=s;return r&&!ao(r)&&(l||(l=r.width,e.width=l),c||(c=r.height,e.height=c)),{width:l,height:c}},t}(),uq=function(){function t(e){this.globalRuntime=e}return t.prototype.isReadyToMeasure=function(e,n){var r=e.text,i=e.textAlign,o=e.textBaseline,a=e.fontSize,s=e.fontStyle,l=e.fontWeight,c=e.fontVariant,u=e.lineWidth;return r&&a&&s&&l&&c&&i&&o&&!Ot(u)},t.prototype.update=function(e,n){var r,i,o=e.text,a=e.textAlign,s=e.lineWidth,l=e.textBaseline,c=e.dx,u=e.dy;if(!this.isReadyToMeasure(e,n))return e.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{width:0,height:0,x:0,y:0,offsetX:0,offsetY:0};var f=(((i=(r=n==null?void 0:n.ownerDocument)===null||r===void 0?void 0:r.defaultView)===null||i===void 0?void 0:i.getConfig())||{}).offscreenCanvas,d=this.globalRuntime.textService.measureText(o,e,f);e.metrics=d;var h=d.width,p=d.height,v=d.lineHeight,g=d.fontProperties,y=[h/2,p/2,0],m=[0,1],b=0;a==="center"||a==="middle"?(b=s/2,m=[.5,1]):(a==="right"||a==="end")&&(b=s,m=[1,1]);var x=0;return l==="middle"?x=y[1]:l==="top"||l==="hanging"?x=y[1]*2:l==="alphabetic"?x=this.globalRuntime.enableCSSParsing?v-g.ascent:0:(l==="bottom"||l==="ideographic")&&(x=0),c&&(b+=c),u&&(x+=u),e.anchor=[m[0],m[1],0],{width:y[0]*2,height:y[1]*2,offsetX:b,offsetY:x}},t}();function fq(t){return!!t.type}var xp=function(){function t(e){this.eventPhase=t.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new on,this.page=new on,this.canvas=new on,this.viewport=new on,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}return Object.defineProperty(t.prototype,"name",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layerX",{get:function(){return this.layer.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layerY",{get:function(){return this.layer.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageX",{get:function(){return this.page.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageY",{get:function(){return this.page.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasX",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasY",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportX",{get:function(){return this.viewport.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportY",{get:function(){return this.viewport.y},enumerable:!1,configurable:!0}),t.prototype.composedPath=function(){return this.manager&&(!this.path||this.path[0]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},Object.defineProperty(t.prototype,"propagationPath",{get:function(){return this.composedPath()},enumerable:!1,configurable:!0}),t.prototype.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},t.prototype.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t.prototype.initEvent=function(){},t.prototype.initUIEvent=function(){},t.prototype.clone=function(){throw new Error(Jt)},t}(),yC=function(t){st(e,t);function e(){var n=t.apply(this,Q([],D(arguments),!1))||this;return n.client=new on,n.movement=new on,n.offset=new on,n.global=new on,n.screen=new on,n}return Object.defineProperty(e.prototype,"clientX",{get:function(){return this.client.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clientY",{get:function(){return this.client.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"movementX",{get:function(){return this.movement.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"movementY",{get:function(){return this.movement.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsetX",{get:function(){return this.offset.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsetY",{get:function(){return this.offset.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalX",{get:function(){return this.global.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalY",{get:function(){return this.global.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"screenX",{get:function(){return this.screen.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"screenY",{get:function(){return this.screen.y},enumerable:!1,configurable:!0}),e.prototype.getModifierState=function(n){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(n)},e.prototype.initMouseEvent=function(){throw new Error(Jt)},e}(xp),N1=function(t){st(e,t);function e(){var n=t.apply(this,Q([],D(arguments),!1))||this;return n.width=0,n.height=0,n.isPrimary=!1,n}return e.prototype.getCoalescedEvents=function(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]},e.prototype.getPredictedEvents=function(){throw new Error("getPredictedEvents is not supported!")},e.prototype.clone=function(){return this.manager.clonePointerEvent(this)},e}(yC),I1=function(t){st(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},e}(yC),ee=function(t){st(e,t);function e(n,r){var i=t.call(this,null)||this;return i.type=n,i.detail=r,Object.assign(i,r),i}return e}(xp),mC=":",bC=function(){function t(){this.emitter=new Vm}return t.prototype.on=function(e,n,r){return this.addEventListener(e,n,r),this},t.prototype.addEventListener=function(e,n,r){var i=tA(r)&&r||np(r)&&r.capture,o=np(r)&&r.once,a=kl(n)?void 0:n,s=!1,l="";if(e.indexOf(mC)>-1){var c=D(e.split(mC),2),u=c[0],f=c[1];e=f,l=u,s=!0}if(e=i?"".concat(e,"capture"):e,n=kl(n)?n:n.handleEvent,s){var d=n;n=function(){for(var h,p=[],v=0;v<arguments.length;v++)p[v]=arguments[v];((h=p[0].target)===null||h===void 0?void 0:h.name)===l&&d.apply(void 0,Q([],D(p),!1))}}return o?this.emitter.once(e,n,a):this.emitter.on(e,n,a),this},t.prototype.off=function(e,n,r){return e?this.removeEventListener(e,n,r):this.removeAllEventListeners(),this},t.prototype.removeAllEventListeners=function(){this.emitter.removeAllListeners()},t.prototype.removeEventListener=function(e,n,r){var i=tA(r)&&r||np(r)&&r.capture,o=kl(n)?void 0:n;return e=i?"".concat(e,"capture"):e,n=kl(n)?n:n==null?void 0:n.handleEvent,this.emitter.off(e,n,o),this},t.prototype.emit=function(e,n){this.dispatchEvent(new ee(e,n))},t.prototype.dispatchEvent=function(e,n){var r,i;if(n===void 0&&(n=!1),!fq(e))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");var o;if(this.document?o=this:this.defaultView?o=this.defaultView:o=(r=this.ownerDocument)===null||r===void 0?void 0:r.defaultView,o){if(e.manager=o.getEventService()||null,!e.manager)return!1;e.defaultPrevented=!1,e.path=[],n||(e.target=this),(i=e.manager)===null||i===void 0||i.dispatchEvent(e,e.type,n)}return!e.defaultPrevented},t}(),an=function(t){st(e,t);function e(){var n=t.apply(this,Q([],D(arguments),!1))||this;return n.shadow=!1,n.ownerDocument=null,n.isConnected=!1,n.baseURI="",n.childNodes=[],n.nodeType=0,n.nodeName="",n.nodeValue=null,n.parentNode=null,n}return e.isNode=function(n){return!!n.childNodes},Object.defineProperty(e.prototype,"textContent",{get:function(){var n,r,i="";this.nodeName===H.TEXT&&(i+=this.style.text);try{for(var o=ur(this.childNodes),a=o.next();!a.done;a=o.next()){var s=a.value;s.nodeName===H.TEXT?i+=s.nodeValue:i+=s.textContent}}catch(l){n={error:l}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},set:function(n){var r=this;this.childNodes.slice().forEach(function(i){r.removeChild(i)}),this.nodeName===H.TEXT&&(this.style.text="".concat(n))},enumerable:!1,configurable:!0}),e.prototype.getRootNode=function(n){return n===void 0&&(n={}),this.parentNode?this.parentNode.getRootNode(n):n.composed&&this.host?this.host.getRootNode(n):this},e.prototype.hasChildNodes=function(){return this.childNodes.length>0},e.prototype.isDefaultNamespace=function(n){throw new Error(Jt)},e.prototype.lookupNamespaceURI=function(n){throw new Error(Jt)},e.prototype.lookupPrefix=function(n){throw new Error(Jt)},e.prototype.normalize=function(){throw new Error(Jt)},e.prototype.isEqualNode=function(n){return this===n},e.prototype.isSameNode=function(n){return this.isEqualNode(n)},Object.defineProperty(e.prototype,"parent",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentElement",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstChild",{get:function(){return this.childNodes.length>0?this.childNodes[0]:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastChild",{get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null},enumerable:!1,configurable:!0}),e.prototype.compareDocumentPosition=function(n){var r;if(n===this)return 0;for(var i=n,o=this,a=[i],s=[o];(r=i.parentNode)!==null&&r!==void 0?r:o.parentNode;)i=i.parentNode?(a.push(i.parentNode),i.parentNode):i,o=o.parentNode?(s.push(o.parentNode),o.parentNode):o;if(i!==o)return e.DOCUMENT_POSITION_DISCONNECTED|e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|e.DOCUMENT_POSITION_PRECEDING;var l=a.length>s.length?a:s,c=l===a?s:a;if(l[l.length-c.length]===c[0])return l===a?e.DOCUMENT_POSITION_CONTAINED_BY|e.DOCUMENT_POSITION_FOLLOWING:e.DOCUMENT_POSITION_CONTAINS|e.DOCUMENT_POSITION_PRECEDING;for(var u=l.length-c.length,f=c.length-1;f>=0;f--){var d=c[f],h=l[u+f];if(h!==d){var p=d.parentNode.childNodes;return p.indexOf(d)<p.indexOf(h)?c===a?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING:l===a?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING}}return e.DOCUMENT_POSITION_FOLLOWING},e.prototype.contain=function(n){return this.contains(n)},e.prototype.contains=function(n){for(var r=n;r&&this!==r;)r=r.parentNode;return!!r},e.prototype.getAncestor=function(n){for(var r=this;n>0&&r;)r=r.parentNode,n--;return r},e.prototype.forEach=function(n,r){r===void 0&&(r=!1),n(this)||(r?this.childNodes.slice():this.childNodes).forEach(function(i){i.forEach(n)})},e.DOCUMENT_POSITION_DISCONNECTED=1,e.DOCUMENT_POSITION_PRECEDING=2,e.DOCUMENT_POSITION_FOLLOWING=4,e.DOCUMENT_POSITION_CONTAINS=8,e.DOCUMENT_POSITION_CONTAINED_BY=16,e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32,e}(bC),dq=2048,hq=function(){function t(e,n){var r=this;this.globalRuntime=e,this.context=n,this.emitter=new Vm,this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=Kt(),this.tmpVec3=Ct(),this.onPointerDown=function(i){var o=r.createPointerEvent(i);if(r.dispatchEvent(o,"pointerdown"),o.pointerType==="touch")r.dispatchEvent(o,"touchstart");else if(o.pointerType==="mouse"||o.pointerType==="pen"){var a=o.button===2;r.dispatchEvent(o,a?"rightdown":"mousedown")}var s=r.trackingData(i.pointerId);s.pressTargetsByButton[i.button]=o.composedPath(),r.freeEvent(o)},this.onPointerUp=function(i){var o,a=k1.now(),s=r.createPointerEvent(i,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);if(r.dispatchEvent(s,"pointerup"),s.pointerType==="touch")r.dispatchEvent(s,"touchend");else if(s.pointerType==="mouse"||s.pointerType==="pen"){var l=s.button===2;r.dispatchEvent(s,l?"rightup":"mouseup")}var c=r.trackingData(i.pointerId),u=r.findMountedTarget(c.pressTargetsByButton[i.button]),f=u;if(u&&!s.composedPath().includes(u)){for(var d=u;d&&!s.composedPath().includes(d);){if(s.currentTarget=d,r.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch")r.notifyTarget(s,"touchendoutside");else if(s.pointerType==="mouse"||s.pointerType==="pen"){var l=s.button===2;r.notifyTarget(s,l?"rightupoutside":"mouseupoutside")}an.isNode(d)&&(d=d.parentNode)}delete c.pressTargetsByButton[i.button],f=d}if(f){var h=r.clonePointerEvent(s,"click");h.target=f,h.path=[],c.clicksByButton[i.button]||(c.clicksByButton[i.button]={clickCount:0,target:h.target,timeStamp:a});var p=c.clicksByButton[i.button];p.target===h.target&&a-p.timeStamp<200?++p.clickCount:p.clickCount=1,p.target=h.target,p.timeStamp=a,h.detail=p.clickCount,!((o=s.detail)===null||o===void 0)&&o.preventClick||(!r.context.config.useNativeClickEvent&&(h.pointerType==="mouse"||h.pointerType==="touch")&&r.dispatchEvent(h,"click"),r.dispatchEvent(h,"pointertap")),r.freeEvent(h)}r.freeEvent(s)},this.onPointerMove=function(i){var o=r.createPointerEvent(i,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0),a=o.pointerType==="mouse"||o.pointerType==="pen",s=r.trackingData(i.pointerId),l=r.findMountedTarget(s.overTargets);if(s.overTargets&&l!==o.target){var c=i.type==="mousemove"?"mouseout":"pointerout",u=r.createPointerEvent(i,c,l||void 0);if(r.dispatchEvent(u,"pointerout"),a&&r.dispatchEvent(u,"mouseout"),!o.composedPath().includes(l)){var f=r.createPointerEvent(i,"pointerleave",l||void 0);for(f.eventPhase=f.AT_TARGET;f.target&&!o.composedPath().includes(f.target);)f.currentTarget=f.target,r.notifyTarget(f),a&&r.notifyTarget(f,"mouseleave"),an.isNode(f.target)&&(f.target=f.target.parentNode);r.freeEvent(f)}r.freeEvent(u)}if(l!==o.target){var d=i.type==="mousemove"?"mouseover":"pointerover",h=r.clonePointerEvent(o,d);r.dispatchEvent(h,"pointerover"),a&&r.dispatchEvent(h,"mouseover");for(var p=l&&an.isNode(l)&&l.parentNode;p&&p!==(an.isNode(r.rootTarget)&&r.rootTarget.parentNode)&&p!==o.target;)p=p.parentNode;var v=!p||p===(an.isNode(r.rootTarget)&&r.rootTarget.parentNode);if(v){var g=r.clonePointerEvent(o,"pointerenter");for(g.eventPhase=g.AT_TARGET;g.target&&g.target!==l&&g.target!==(an.isNode(r.rootTarget)&&r.rootTarget.parentNode);)g.currentTarget=g.target,r.notifyTarget(g),a&&r.notifyTarget(g,"mouseenter"),an.isNode(g.target)&&(g.target=g.target.parentNode);r.freeEvent(g)}r.freeEvent(h)}r.dispatchEvent(o,"pointermove"),o.pointerType==="touch"&&r.dispatchEvent(o,"touchmove"),a&&(r.dispatchEvent(o,"mousemove"),r.cursor=r.getCursor(o.target)),s.overTargets=o.composedPath(),r.freeEvent(o)},this.onPointerOut=function(i){var o=r.trackingData(i.pointerId);if(o.overTargets){var a=i.pointerType==="mouse"||i.pointerType==="pen",s=r.findMountedTarget(o.overTargets),l=r.createPointerEvent(i,"pointerout",s||void 0);r.dispatchEvent(l),a&&r.dispatchEvent(l,"mouseout");var c=r.createPointerEvent(i,"pointerleave",s||void 0);for(c.eventPhase=c.AT_TARGET;c.target&&c.target!==(an.isNode(r.rootTarget)&&r.rootTarget.parentNode);)c.currentTarget=c.target,r.notifyTarget(c),a&&r.notifyTarget(c,"mouseleave"),an.isNode(c.target)&&(c.target=c.target.parentNode);o.overTargets=null,r.freeEvent(l),r.freeEvent(c)}r.cursor=null},this.onPointerOver=function(i){var o=r.trackingData(i.pointerId),a=r.createPointerEvent(i),s=a.pointerType==="mouse"||a.pointerType==="pen";r.dispatchEvent(a,"pointerover"),s&&r.dispatchEvent(a,"mouseover"),a.pointerType==="mouse"&&(r.cursor=r.getCursor(a.target));var l=r.clonePointerEvent(a,"pointerenter");for(l.eventPhase=l.AT_TARGET;l.target&&l.target!==(an.isNode(r.rootTarget)&&r.rootTarget.parentNode);)l.currentTarget=l.target,r.notifyTarget(l),s&&r.notifyTarget(l,"mouseenter"),an.isNode(l.target)&&(l.target=l.target.parentNode);o.overTargets=a.composedPath(),r.freeEvent(a),r.freeEvent(l)},this.onPointerUpOutside=function(i){var o=r.trackingData(i.pointerId),a=r.findMountedTarget(o.pressTargetsByButton[i.button]),s=r.createPointerEvent(i);if(a){for(var l=a;l;)s.currentTarget=l,r.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch"||(s.pointerType==="mouse"||s.pointerType==="pen")&&r.notifyTarget(s,s.button===2?"rightupoutside":"mouseupoutside"),an.isNode(l)&&(l=l.parentNode);delete o.pressTargetsByButton[i.button]}r.freeEvent(s)},this.onWheel=function(i){var o=r.createWheelEvent(i);r.dispatchEvent(o),r.freeEvent(o)},this.onClick=function(i){if(r.context.config.useNativeClickEvent){var o=r.createPointerEvent(i);r.dispatchEvent(o),r.freeEvent(o)}},this.onPointerCancel=function(i){var o=r.createPointerEvent(i,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);r.dispatchEvent(o),r.freeEvent(o)}}return t.prototype.init=function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)},t.prototype.destroy=function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()},t.prototype.client2Viewport=function(e){var n=this.context.contextService.getBoundingClientRect();return new on(e.x-((n==null?void 0:n.left)||0),e.y-((n==null?void 0:n.top)||0))},t.prototype.viewport2Client=function(e){var n=this.context.contextService.getBoundingClientRect();return new on(e.x+((n==null?void 0:n.left)||0),e.y+((n==null?void 0:n.top)||0))},t.prototype.viewport2Canvas=function(e){var n=e.x,r=e.y,i=this.rootTarget.defaultView,o=i.getCamera(),a=this.context.config,s=a.width,l=a.height,c=o.getPerspectiveInverse(),u=o.getWorldTransform(),f=On(this.tmpMatrix,u,c),d=ai(this.tmpVec3,n/s*2-1,(1-r/l)*2-1,0);return Qe(d,d,f),new on(d[0],d[1])},t.prototype.canvas2Viewport=function(e){var n=this.rootTarget.defaultView,r=n.getCamera(),i=r.getPerspective(),o=r.getViewTransform(),a=On(this.tmpMatrix,i,o),s=ai(this.tmpVec3,e.x,e.y,0);Qe(this.tmpVec3,this.tmpVec3,a);var l=this.context.config,c=l.width,u=l.height;return new on((s[0]+1)/2*c,(1-(s[1]+1)/2)*u)},t.prototype.setPickHandler=function(e){this.pickHandler=e},t.prototype.addEventMapping=function(e,n){this.mappingTable[e]||(this.mappingTable[e]=[]),this.mappingTable[e].push({fn:n,priority:0}),this.mappingTable[e].sort(function(r,i){return r.priority-i.priority})},t.prototype.mapEvent=function(e){if(this.rootTarget){var n=this.mappingTable[e.type];if(n)for(var r=0,i=n.length;r<i;r++)n[r].fn(e);else console.warn("[EventService]: Event mapping not defined for ".concat(e.type))}},t.prototype.dispatchEvent=function(e,n,r){if(!r)e.propagationStopped=!1,e.propagationImmediatelyStopped=!1,this.propagate(e,n);else{e.eventPhase=e.AT_TARGET;var i=this.rootTarget.defaultView||null;e.currentTarget=i,this.notifyListeners(e,n)}this.emitter.emit(n||e.type,e)},t.prototype.propagate=function(e,n){if(e.target){var r=e.composedPath();e.eventPhase=e.CAPTURING_PHASE;for(var i=r.length-1;i>=1;i--)if(e.currentTarget=r[i],this.notifyTarget(e,n),e.propagationStopped||e.propagationImmediatelyStopped)return;if(e.eventPhase=e.AT_TARGET,e.currentTarget=e.target,this.notifyTarget(e,n),!(e.propagationStopped||e.propagationImmediatelyStopped)){var o=r.indexOf(e.currentTarget);e.eventPhase=e.BUBBLING_PHASE;for(var i=o+1;i<r.length;i++)if(e.currentTarget=r[i],this.notifyTarget(e,n),e.propagationStopped||e.propagationImmediatelyStopped)return}}},t.prototype.propagationPath=function(e){var n=[e],r=this.rootTarget.defaultView||null;if(r&&r===e)return n.unshift(r.document),n;for(var i=0;i<dq&&e!==this.rootTarget;i++)an.isNode(e)&&e.parentNode&&(n.push(e.parentNode),e=e.parentNode);return r&&n.push(r),n},t.prototype.hitTest=function(e){var n=e.viewportX,r=e.viewportY,i=this.context.config,o=i.width,a=i.height,s=i.disableHitTesting;return n<0||r<0||n>o||r>a?null:!s&&this.pickHandler(e)||this.rootTarget||null},t.prototype.isNativeEventFromCanvas=function(e){var n,r=this.context.contextService.getDomElement(),i=(n=e.nativeEvent)===null||n===void 0?void 0:n.target;if(i){if(i===r)return!0;if(r&&r.contains)return r.contains(i)}return e.nativeEvent.composedPath?e.nativeEvent.composedPath().indexOf(r)>-1:!1},t.prototype.getExistedHTML=function(e){var n,r;if(e.nativeEvent.composedPath)try{for(var i=ur(e.nativeEvent.composedPath()),o=i.next();!o.done;o=i.next()){var a=o.value,s=this.nativeHTMLMap.get(a);if(s)return s}}catch(l){n={error:l}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return null},t.prototype.pickTarget=function(e){return this.hitTest({clientX:e.clientX,clientY:e.clientY,viewportX:e.viewportX,viewportY:e.viewportY,x:e.canvasX,y:e.canvasY})},t.prototype.createPointerEvent=function(e,n,r,i){var o=this.allocateEvent(N1);this.copyPointerData(e,o),this.copyMouseData(e,o),this.copyData(e,o),o.nativeEvent=e.nativeEvent,o.originalEvent=e;var a=this.getExistedHTML(o);return o.target=r!=null?r:a||this.isNativeEventFromCanvas(o)&&this.pickTarget(o)||i,typeof n=="string"&&(o.type=n),o},t.prototype.createWheelEvent=function(e){var n=this.allocateEvent(I1);this.copyWheelData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.nativeEvent=e.nativeEvent,n.originalEvent=e;var r=this.getExistedHTML(n);return n.target=r||this.isNativeEventFromCanvas(n)&&this.pickTarget(n),n},t.prototype.trackingData=function(e){return this.mappingState.trackingData[e]||(this.mappingState.trackingData[e]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[e]},t.prototype.cloneWheelEvent=function(e){var n=this.allocateEvent(I1);return n.nativeEvent=e.nativeEvent,n.originalEvent=e.originalEvent,this.copyWheelData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.target=e.target,n.path=e.composedPath().slice(),n.type=e.type,n},t.prototype.clonePointerEvent=function(e,n){var r=this.allocateEvent(N1);return r.nativeEvent=e.nativeEvent,r.originalEvent=e.originalEvent,this.copyPointerData(e,r),this.copyMouseData(e,r),this.copyData(e,r),r.target=e.target,r.path=e.composedPath().slice(),r.type=n!=null?n:r.type,r},t.prototype.copyPointerData=function(e,n){n.pointerId=e.pointerId,n.width=e.width,n.height=e.height,n.isPrimary=e.isPrimary,n.pointerType=e.pointerType,n.pressure=e.pressure,n.tangentialPressure=e.tangentialPressure,n.tiltX=e.tiltX,n.tiltY=e.tiltY,n.twist=e.twist},t.prototype.copyMouseData=function(e,n){n.altKey=e.altKey,n.button=e.button,n.buttons=e.buttons,n.ctrlKey=e.ctrlKey,n.metaKey=e.metaKey,n.shiftKey=e.shiftKey,n.client.copyFrom(e.client),n.movement.copyFrom(e.movement),n.canvas.copyFrom(e.canvas),n.screen.copyFrom(e.screen),n.global.copyFrom(e.global),n.offset.copyFrom(e.offset)},t.prototype.copyWheelData=function(e,n){n.deltaMode=e.deltaMode,n.deltaX=e.deltaX,n.deltaY=e.deltaY,n.deltaZ=e.deltaZ},t.prototype.copyData=function(e,n){n.isTrusted=e.isTrusted,n.timeStamp=k1.now(),n.type=e.type,n.detail=e.detail,n.view=e.view,n.page.copyFrom(e.page),n.viewport.copyFrom(e.viewport)},t.prototype.allocateEvent=function(e){this.eventPool.has(e)||this.eventPool.set(e,[]);var n=this.eventPool.get(e).pop()||new e(this);return n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.target=null,n},t.prototype.freeEvent=function(e){if(e.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var n=e.constructor;this.eventPool.has(n)||this.eventPool.set(n,[]),this.eventPool.get(n).push(e)},t.prototype.notifyTarget=function(e,n){n=n!=null?n:e.type;var r=e.eventPhase===e.CAPTURING_PHASE||e.eventPhase===e.AT_TARGET?"".concat(n,"capture"):n;this.notifyListeners(e,r),e.eventPhase===e.AT_TARGET&&this.notifyListeners(e,n)},t.prototype.notifyListeners=function(e,n){var r=e.currentTarget.emitter,i=r._events[n];if(i)if("fn"in i)i.once&&r.removeListener(n,i.fn,void 0,!0),i.fn.call(e.currentTarget||i.context,e);else for(var o=0;o<i.length&&!e.propagationImmediatelyStopped;o++)i[o].once&&r.removeListener(n,i[o].fn,void 0,!0),i[o].fn.call(e.currentTarget||i[o].context,e)},t.prototype.findMountedTarget=function(e){if(!e)return null;for(var n=e[e.length-1],r=e.length-2;r>=0;r--){var i=e[r];if(i===this.rootTarget||an.isNode(i)&&i.parentNode===n)n=e[r];else break}return n},t.prototype.getCursor=function(e){for(var n=e;n;){var r=IX(n)&&n.getAttribute("cursor");if(r)return r;n=an.isNode(n)&&n.parentNode}},t}(),pq=function(){function t(){}return t.prototype.getOrCreateCanvas=function(e,n){if(this.canvas)return this.canvas;if(e||U.offscreenCanvas)this.canvas=e||U.offscreenCanvas,this.context=this.canvas.getContext("2d",G({willReadFrequently:!0},n));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",G({willReadFrequently:!0},n)),(!this.context||!this.context.measureText)&&(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(r){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",G({willReadFrequently:!0},n))}return this.canvas.width=10,this.canvas.height=10,this.canvas},t.prototype.getOrCreateContext=function(e,n){return this.context?this.context:(this.getOrCreateCanvas(e,n),this.context)},t}(),na;(function(t){t[t.CAMERA_CHANGED=0]="CAMERA_CHANGED",t[t.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",t[t.NONE=2]="NONE"})(na||(na={}));var vq=function(){function t(e,n){this.globalRuntime=e,this.context=n,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new jn,initAsync:new KX,dirtycheck:new L1,cull:new L1,beginFrame:new jn,beforeRender:new jn,render:new jn,afterRender:new jn,endFrame:new jn,destroy:new jn,pick:new ZX,pickSync:new L1,pointerDown:new jn,pointerUp:new jn,pointerMove:new jn,pointerOut:new jn,pointerOver:new jn,pointerWheel:new jn,pointerCancel:new jn,click:new jn}}return t.prototype.init=function(e){var n=this,r=G(G({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach(function(i){i.apply(r,n.globalRuntime)}),this.hooks.init.call(),this.hooks.initAsync.getCallbacksNum()===0?(this.inited=!0,e()):this.hooks.initAsync.promise().then(function(){n.inited=!0,e()})},t.prototype.getStats=function(){return this.stats},t.prototype.disableDirtyRectangleRendering=function(){var e=this.context.config.renderer,n=e.getConfig().enableDirtyRectangleRendering;return!n||this.context.renderingContext.renderReasons.has(na.CAMERA_CHANGED)},t.prototype.render=function(e,n){var r=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var i=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(i.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),i.renderReasons.size&&this.inited){i.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var o=i.renderReasons.size===1&&i.renderReasons.has(na.CAMERA_CHANGED),a=!e.disableRenderHooks||!(e.disableRenderHooks&&o);a&&this.renderDisplayObject(i.root,e,i),this.hooks.beginFrame.call(),a&&i.renderListCurrentFrame.forEach(function(s){r.hooks.beforeRender.call(s),r.hooks.render.call(s),r.hooks.afterRender.call(s)}),this.hooks.endFrame.call(),i.renderListCurrentFrame=[],i.renderReasons.clear(),n()}},t.prototype.renderDisplayObject=function(e,n,r){var i=this,o=n.renderer.getConfig(),a=o.enableDirtyCheck,s=o.enableCulling;this.globalRuntime.enableCSSParsing&&this.globalRuntime.styleValueRegistry.recalc(e);var l=e.renderable,c=a?l.dirty||r.dirtyRectangleRenderingDisabled?e:null:e;if(c){var u=s?this.hooks.cull.call(c,this.context.camera):c;u&&(this.stats.rendered++,r.renderListCurrentFrame.push(u))}e.renderable.dirty=!1,e.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var f=e.sortable;f.dirty&&(this.sort(e,f),f.dirty=!1,f.dirtyChildren=[],f.dirtyReason=void 0),(f.sorted||e.childNodes).forEach(function(d){i.renderDisplayObject(d,n,r)})},t.prototype.sort=function(e,n){n.sorted&&n.dirtyReason!==Ll.Z_INDEX_CHANGED?n.dirtyChildren.forEach(function(r){var i=e.childNodes.indexOf(r);if(i===-1){var o=n.sorted.indexOf(r);o>=0&&n.sorted.splice(o,1)}else if(n.sorted.length===0)n.sorted.push(r);else{var a=jX(n.sorted,r);n.sorted.splice(a,0,r)}}):n.sorted=e.childNodes.slice().sort(lC)},t.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},t.prototype.dirtify=function(){this.context.renderingContext.renderReasons.add(na.DISPLAY_OBJECT_CHANGED)},t}(),gq=/\[\s*(.*)=(.*)\s*\]/,yq=function(){function t(){}return t.prototype.selectOne=function(e,n){var r=this;if(e.startsWith("."))return n.find(function(s){return((s==null?void 0:s.classList)||[]).indexOf(r.getIdOrClassname(e))>-1});if(e.startsWith("#"))return n.find(function(s){return s.id===r.getIdOrClassname(e)});if(e.startsWith("[")){var i=this.getAttribute(e),o=i.name,a=i.value;return o?n.find(function(s){return n!==s&&(o==="name"?s.name===a:r.attributeToString(s,o)===a)}):null}else return n.find(function(s){return n!==s&&s.nodeName===e})},t.prototype.selectAll=function(e,n){var r=this;if(e.startsWith("."))return n.findAll(function(s){return n!==s&&((s==null?void 0:s.classList)||[]).indexOf(r.getIdOrClassname(e))>-1});if(e.startsWith("#"))return n.findAll(function(s){return n!==s&&s.id===r.getIdOrClassname(e)});if(e.startsWith("[")){var i=this.getAttribute(e),o=i.name,a=i.value;return o?n.findAll(function(s){return n!==s&&(o==="name"?s.name===a:r.attributeToString(s,o)===a)}):[]}else return n.findAll(function(s){return n!==s&&s.nodeName===e})},t.prototype.is=function(e,n){if(e.startsWith("."))return n.className===this.getIdOrClassname(e);if(e.startsWith("#"))return n.id===this.getIdOrClassname(e);if(e.startsWith("[")){var r=this.getAttribute(e),i=r.name,o=r.value;return i==="name"?n.name===o:this.attributeToString(n,i)===o}else return n.nodeName===e},t.prototype.getIdOrClassname=function(e){return e.substring(1)},t.prototype.getAttribute=function(e){var n=e.match(gq),r="",i="";return n&&n.length>2&&(r=n[1].replace(/"/g,""),i=n[2].replace(/"/g,"")),{name:r,value:i}},t.prototype.attributeToString=function(e,n){if(!e.getAttribute)return"";var r=e.getAttribute(n);return Ot(r)?"":r.toString?r.toString():""},t}(),fs=function(t){st(e,t);function e(n,r,i,o,a,s,l,c){var u=t.call(this,null)||this;return u.relatedNode=r,u.prevValue=i,u.newValue=o,u.attrName=a,u.attrChange=s,u.prevParsedValue=l,u.newParsedValue=c,u.type=n,u}return e.ADDITION=2,e.MODIFICATION=1,e.REMOVAL=3,e}(xp),St;(function(t){t.REPARENT="reparent",t.DESTROY="destroy",t.ATTR_MODIFIED="DOMAttrModified",t.INSERTED="DOMNodeInserted",t.REMOVED="removed",t.MOUNTED="DOMNodeInsertedIntoDocument",t.UNMOUNTED="DOMNodeRemovedFromDocument",t.BOUNDS_CHANGED="bounds-changed",t.CULLED="culled"})(St||(St={}));function xC(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}var mq=new fs(St.REPARENT,null,"","","",0,"",""),bq=function(){function t(e){var n=this;this.runtime=e,this.pendingEvents=[],this.boundsChangedEvent=new ee(St.BOUNDS_CHANGED),this.rotate=function(){var r=Ge();return function(i,o,a,s){a===void 0&&(a=0),s===void 0&&(s=0),typeof o=="number"&&(o=jt(o,a,s));var l=i.transformable;if(i.parentNode===null||!i.parentNode.transformable)n.rotateLocal(i,o);else{var c=Ge();xh(c,o[0],o[1],o[2]);var u=n.getRotation(i),f=n.getRotation(i.parentNode);wh(r,f),Jy(r,r),Go(c,r,c),Go(l.localRotation,c,u),Oh(l.localRotation,l.localRotation),n.dirtifyLocal(i,l)}}}(),this.rotateLocal=function(){var r=Ge();return function(i,o,a,s){a===void 0&&(a=0),s===void 0&&(s=0),typeof o=="number"&&(o=jt(o,a,s));var l=i.transformable;xh(r,o[0],o[1],o[2]),$E(l.localRotation,l.localRotation,r),n.dirtifyLocal(i,l)}}(),this.setEulerAngles=function(){var r=Ge();return function(i,o,a,s){a===void 0&&(a=0),s===void 0&&(s=0),typeof o=="number"&&(o=jt(o,a,s));var l=i.transformable;if(i.parentNode===null||!i.parentNode.transformable)n.setLocalEulerAngles(i,o);else{xh(l.localRotation,o[0],o[1],o[2]);var c=n.getRotation(i.parentNode);wh(r,Jy(Ge(),c)),$E(l.localRotation,l.localRotation,r),n.dirtifyLocal(i,l)}}}(),this.translateLocal=function(){return function(r,i,o,a){o===void 0&&(o=0),a===void 0&&(a=0),typeof i=="number"&&(i=jt(i,o,a));var s=r.transformable;gu(i,Ct())||(aY(i,i,s.localRotation),ul(s.localPosition,s.localPosition,i),n.dirtifyLocal(r,s))}}(),this.setPosition=function(){var r=Kt(),i=Ct();return function(o,a){var s=o.transformable;if(i[0]=a[0],i[1]=a[1],i[2]=a[2]||0,!gu(n.getPosition(o),i)){if(Vn(s.position,i),o.parentNode===null||!o.parentNode.transformable)Vn(s.localPosition,i);else{var l=o.parentNode.transformable;qa(r,l.worldTransform),oi(r,r),Qe(s.localPosition,i,r)}n.dirtifyLocal(o,s)}}}(),this.setLocalPosition=function(){var r=Ct();return function(i,o){var a=i.transformable;r[0]=o[0],r[1]=o[1],r[2]=o[2]||0,!gu(a.localPosition,r)&&(Vn(a.localPosition,r),n.dirtifyLocal(i,a))}}(),this.translate=function(){var r=Ct(),i=Ct(),o=Ct();return function(a,s,l,c){l===void 0&&(l=0),c===void 0&&(c=0),typeof s=="number"&&(s=ai(i,s,l,c)),!gu(s,r)&&(ul(o,n.getPosition(a),s),n.setPosition(a,o))}}(),this.setRotation=function(){var r=Ge();return function(i,o,a,s,l){var c=i.transformable;if(typeof o=="number"&&(o=tm(o,a,s,l)),i.parentNode===null||!i.parentNode.transformable)n.setLocalRotation(i,o);else{var u=n.getRotation(i.parentNode);wh(r,u),Jy(r,r),Go(c.localRotation,r,o),Oh(c.localRotation,c.localRotation),n.dirtifyLocal(i,c)}}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=function(){var r=Kt(),i=Ct(),o=tm(0,0,0,1);return function(a){var s=a.localSkew[0]!==0||a.localSkew[1]!==0;if(s){if(vu(a.localTransform,a.localRotation,a.localPosition,jt(1,1,1),a.origin),a.localSkew[0]!==0||a.localSkew[1]!==0){var l=pu(r);l[4]=Math.tan(a.localSkew[0]),l[1]=Math.tan(a.localSkew[1]),On(a.localTransform,a.localTransform,l)}var c=vu(r,o,i,a.localScale,a.origin);On(a.localTransform,a.localTransform,c)}else vu(a.localTransform,a.localRotation,a.localPosition,a.localScale,a.origin)}}()}return t.prototype.matches=function(e,n){return this.runtime.sceneGraphSelector.is(e,n)},t.prototype.querySelector=function(e,n){return this.runtime.sceneGraphSelector.selectOne(e,n)},t.prototype.querySelectorAll=function(e,n){return this.runtime.sceneGraphSelector.selectAll(e,n)},t.prototype.attach=function(e,n,r){var i,o,a=!1;e.parentNode&&(a=e.parentNode!==n,this.detach(e)),e.parentNode=n,Ot(r)?e.parentNode.childNodes.push(e):e.parentNode.childNodes.splice(r,0,e);var s=n.sortable;(!((i=s==null?void 0:s.sorted)===null||i===void 0)&&i.length||!((o=e.style)===null||o===void 0)&&o.zIndex)&&(s.dirtyChildren.indexOf(e)===-1&&s.dirtyChildren.push(e),s.dirty=!0,s.dirtyReason=Ll.ADDED);var l=e.transformable;l&&this.dirtifyWorld(e,l),l.frozen&&this.unfreezeParentToRoot(e),a&&e.dispatchEvent(mq)},t.prototype.detach=function(e){var n,r;if(e.parentNode){var i=e.transformable,o=e.parentNode.sortable;(!((n=o==null?void 0:o.sorted)===null||n===void 0)&&n.length||!((r=e.style)===null||r===void 0)&&r.zIndex)&&(o.dirtyChildren.indexOf(e)===-1&&o.dirtyChildren.push(e),o.dirty=!0,o.dirtyReason=Ll.REMOVED);var a=e.parentNode.childNodes.indexOf(e);a>-1&&e.parentNode.childNodes.splice(a,1),i&&this.dirtifyWorld(e,i),e.parentNode=null}},t.prototype.getOrigin=function(e){return e.transformable.origin},t.prototype.setOrigin=function(e,n,r,i){r===void 0&&(r=0),i===void 0&&(i=0),typeof n=="number"&&(n=[n,r,i]);var o=e.transformable;if(!(n[0]===o.origin[0]&&n[1]===o.origin[1]&&n[2]===o.origin[2])){var a=o.origin;a[0]=n[0],a[1]=n[1],a[2]=n[2]||0,this.dirtifyLocal(e,o)}},t.prototype.setLocalEulerAngles=function(e,n,r,i){r===void 0&&(r=0),i===void 0&&(i=0),typeof n=="number"&&(n=jt(n,r,i));var o=e.transformable;xh(o.localRotation,n[0],n[1],n[2]),this.dirtifyLocal(e,o)},t.prototype.scaleLocal=function(e,n){var r=e.transformable;iY(r.localScale,r.localScale,jt(n[0],n[1],n[2]||1)),this.dirtifyLocal(e,r)},t.prototype.setLocalScale=function(e,n){var r=e.transformable,i=jt(n[0],n[1],n[2]||r.localScale[2]);gu(i,r.localScale)||(Vn(r.localScale,i),this.dirtifyLocal(e,r))},t.prototype.setLocalRotation=function(e,n,r,i,o){typeof n=="number"&&(n=tm(n,r,i,o));var a=e.transformable;wh(a.localRotation,n),this.dirtifyLocal(e,a)},t.prototype.setLocalSkew=function(e,n,r){typeof n=="number"&&(n=dY(n,r));var i=e.transformable;hY(i.localSkew,n),this.dirtifyLocal(e,i)},t.prototype.dirtifyLocal=function(e,n){n.localDirtyFlag||(n.localDirtyFlag=!0,n.dirtyFlag||this.dirtifyWorld(e,n))},t.prototype.dirtifyWorld=function(e,n){n.dirtyFlag||this.unfreezeParentToRoot(e),this.dirtifyWorldInternal(e,n),this.dirtifyToRoot(e,!0)},t.prototype.triggerPendingEvents=function(){var e=this,n=new Set,r=function(i,o){i.isConnected&&!n.has(i.entity)&&(e.boundsChangedEvent.detail=o,e.boundsChangedEvent.target=i,i.isMutationObserved?i.dispatchEvent(e.boundsChangedEvent):i.ownerDocument.defaultView.dispatchEvent(e.boundsChangedEvent,!0),n.add(i.entity))};this.pendingEvents.forEach(function(i){var o=D(i,2),a=o[0],s=o[1];s.affectChildren?a.forEach(function(l){r(l,s)}):r(a,s)}),this.clearPendingEvents(),n.clear()},t.prototype.clearPendingEvents=function(){this.pendingEvents=[]},t.prototype.dirtifyToRoot=function(e,n){n===void 0&&(n=!1);var r=e;for(r.renderable&&(r.renderable.dirty=!0);r;)xC(r),r=r.parentNode;n&&e.forEach(function(i){xC(i)}),this.informDependentDisplayObjects(e),this.pendingEvents.push([e,{affectChildren:n}])},t.prototype.updateDisplayObjectDependency=function(e,n,r,i){if(n&&n!==r){var o=this.displayObjectDependencyMap.get(n);if(o&&o[e]){var a=o[e].indexOf(i);o[e].splice(a,1)}}if(r){var s=this.displayObjectDependencyMap.get(r);s||(this.displayObjectDependencyMap.set(r,{}),s=this.displayObjectDependencyMap.get(r)),s[e]||(s[e]=[]),s[e].push(i)}},t.prototype.informDependentDisplayObjects=function(e){var n=this,r=this.displayObjectDependencyMap.get(e);r&&Object.keys(r).forEach(function(i){r[i].forEach(function(o){n.dirtifyToRoot(o,!0),o.dispatchEvent(new fs(St.ATTR_MODIFIED,o,n,n,i,fs.MODIFICATION,n,n)),o.isCustomElement&&o.isConnected&&o.attributeChangedCallback&&o.attributeChangedCallback(i,n,n)})})},t.prototype.getPosition=function(e){var n=e.transformable;return yh(n.position,this.getWorldTransform(e,n))},t.prototype.getRotation=function(e){var n=e.transformable;return mh(n.rotation,this.getWorldTransform(e,n))},t.prototype.getScale=function(e){var n=e.transformable;return cl(n.scaling,this.getWorldTransform(e,n))},t.prototype.getWorldTransform=function(e,n){return n===void 0&&(n=e.transformable),!n.localDirtyFlag&&!n.dirtyFlag||(e.parentNode&&e.parentNode.transformable&&this.getWorldTransform(e.parentNode),this.sync(e,n)),n.worldTransform},t.prototype.getLocalPosition=function(e){return e.transformable.localPosition},t.prototype.getLocalRotation=function(e){return e.transformable.localRotation},t.prototype.getLocalScale=function(e){return e.transformable.localScale},t.prototype.getLocalSkew=function(e){return e.transformable.localSkew},t.prototype.getLocalTransform=function(e){var n=e.transformable;return n.localDirtyFlag&&(this.calcLocalTransform(n),n.localDirtyFlag=!1),n.localTransform},t.prototype.setLocalTransform=function(e,n){var r=yh(Ct(),n),i=mh(Ge(),n),o=cl(Ct(),n);this.setLocalScale(e,o),this.setLocalPosition(e,r),this.setLocalRotation(e,i)},t.prototype.resetLocalTransform=function(e){this.setLocalScale(e,[1,1,1]),this.setLocalPosition(e,[0,0,0]),this.setLocalEulerAngles(e,[0,0,0]),this.setLocalSkew(e,[0,0])},t.prototype.getTransformedGeometryBounds=function(e,n,r){n===void 0&&(n=!1);var i=this.getGeometryBounds(e,n);if(Xe.isEmpty(i))return null;var o=r||new Xe;return o.setFromTransformedAABB(i,this.getWorldTransform(e)),o},t.prototype.getGeometryBounds=function(e,n){n===void 0&&(n=!1);var r=e.geometry,i=n?r.renderBounds:r.contentBounds||null;return i||new Xe},t.prototype.getBounds=function(e,n){var r=this;n===void 0&&(n=!1);var i=e.renderable;if(!i.boundsDirty&&!n&&i.bounds)return i.bounds;if(!i.renderBoundsDirty&&n&&i.renderBounds)return i.renderBounds;var o=n?i.renderBounds:i.bounds,a=this.getTransformedGeometryBounds(e,n,o),s=e.childNodes;if(s.forEach(function(u){var f=r.getBounds(u,n);f&&(a?a.add(f):(a=o||new Xe,a.update(f.center,f.halfExtents)))}),n){var l=cC(e);if(l){var c=l.parsedStyle.clipPath.getBounds(n);a?c&&(a=c.intersection(a)):a=c}}return a||(a=new Xe),a&&(n?i.renderBounds=a:i.bounds=a),n?i.renderBoundsDirty=!1:i.boundsDirty=!1,a},t.prototype.getLocalBounds=function(e){if(e.parentNode){var n=Kt();e.parentNode.transformable&&(n=oi(Kt(),this.getWorldTransform(e.parentNode)));var r=this.getBounds(e);if(!Xe.isEmpty(r)){var i=new Xe;return i.setFromTransformedAABB(r,n),i}}return this.getBounds(e)},t.prototype.getBoundingClientRect=function(e){var n,r,i,o=this.getGeometryBounds(e);Xe.isEmpty(o)||(i=new Xe,i.setFromTransformedAABB(o,this.getWorldTransform(e)));var a=(r=(n=e.ownerDocument)===null||n===void 0?void 0:n.defaultView)===null||r===void 0?void 0:r.getContextService().getBoundingClientRect();if(i){var s=D(i.getMin(),2),l=s[0],c=s[1],u=D(i.getMax(),2),f=u[0],d=u[1];return new ss(l+((a==null?void 0:a.left)||0),c+((a==null?void 0:a.top)||0),f-l,d-c)}return new ss((a==null?void 0:a.left)||0,(a==null?void 0:a.top)||0,0,0)},t.prototype.dirtifyWorldInternal=function(e,n){var r=this;if(!n.dirtyFlag){n.dirtyFlag=!0,n.frozen=!1,e.childNodes.forEach(function(o){var a=o.transformable;a.dirtyFlag||r.dirtifyWorldInternal(o,a)});var i=e.renderable;i&&(i.renderBoundsDirty=!0,i.boundsDirty=!0,i.dirty=!0)}},t.prototype.syncHierarchy=function(e){var n=e.transformable;if(!n.frozen){n.frozen=!0,(n.localDirtyFlag||n.dirtyFlag)&&this.sync(e,n);for(var r=e.childNodes,i=0;i<r.length;i++)this.syncHierarchy(r[i])}},t.prototype.sync=function(e,n){if(n.localDirtyFlag&&(this.calcLocalTransform(n),n.localDirtyFlag=!1),n.dirtyFlag){var r=e.parentNode,i=r&&r.transformable;r===null||!i?qa(n.worldTransform,n.localTransform):On(n.worldTransform,i.worldTransform,n.localTransform),n.dirtyFlag=!1}},t.prototype.unfreezeParentToRoot=function(e){for(var n=e.parentNode;n;){var r=n.transformable;r&&(r.frozen=!1),n=n.parentNode}},t}(),ds={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},wC=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,xq=/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/,wq=/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/,Oq=/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/,_q=/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/,Sq=/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/,Eq=/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/,Mq=/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/,Pq=/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/,Aq=new RegExp("".concat(xq.source,"|").concat(Oq.source,"|").concat(Sq.source,"|").concat(Mq.source)),Cq=new RegExp("".concat(wq.source,"|").concat(_q.source,"|").concat(Eq.source,"|").concat(Pq.source)),Tq=function(){function t(e){var n=this;this.runtime=e,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(r,i){return n.isBreakingSpace(i)?!1:!!(r&&(Cq.exec(i)||Aq.exec(r)))},this.trimByKinsokuShorui=function(r){var i=Q([],D(r),!1),o=i[i.length-2];if(!o)return r;var a=o[o.length-1];return i[i.length-2]=o.slice(0,-1),i[i.length-1]=a+i[i.length-1],i}}return t.prototype.measureFont=function(e,n){if(this.fontMetricsCache[e])return this.fontMetricsCache[e];var r={ascent:0,descent:0,fontSize:0},i=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(n),o=this.runtime.offscreenCanvasCreator.getOrCreateContext(n,{willReadFrequently:!0});o.font=e;var a=ds.MetricsString+ds.BaselineSymbol,s=Math.ceil(o.measureText(a).width),l=Math.ceil(o.measureText(ds.BaselineSymbol).width),c=ds.HeightMultiplier*l;l=l*ds.BaselineMultiplier|0,i.width=s,i.height=c,o.fillStyle="#f00",o.fillRect(0,0,s,c),o.font=e,o.textBaseline="alphabetic",o.fillStyle="#000",o.fillText(a,0,l);var u=o.getImageData(0,0,s||1,c||1).data,f=u.length,d=s*4,h=0,p=0,v=!1;for(h=0;h<l;++h){for(var g=0;g<d;g+=4)if(u[p+g]!==255){v=!0;break}if(!v)p+=d;else break}for(r.ascent=l-h,p=f-d,v=!1,h=c;h>l;--h){for(var g=0;g<d;g+=4)if(u[p+g]!==255){v=!0;break}if(!v)p-=d;else break}return r.descent=h-l,r.fontSize=r.ascent+r.descent,this.fontMetricsCache[e]=r,r},t.prototype.measureText=function(e,n,r){var i=n.fontSize,o=n.wordWrap,a=n.lineHeight,s=n.lineWidth,l=n.textBaseline,c=n.textAlign,u=n.letterSpacing,f=n.textPath;n.textPathSide,n.textPathStartOffset;var d=n.leading,h=d===void 0?0:d,p=tq(n),v=this.measureFont(p,r);v.fontSize===0&&(v.fontSize=i,v.ascent=i);var g=this.runtime.offscreenCanvasCreator.getOrCreateContext(r);g.font=p,n.isOverflowing=!1;var y=o?this.wordWrap(e,n,r):e,m=y.split(/(?:\r\n|\r|\n)/),b=new Array(m.length),x=0;if(f){f.getTotalLength();for(var w=0;w<m.length;w++)var O=g.measureText(m[w]).width+(m[w].length-1)*u}else{for(var w=0;w<m.length;w++){var _=g.measureText(m[w]).width+(m[w].length-1)*u;b[w]=_,x=Math.max(x,_)}var O=x+s,S=a||v.fontSize+s,E=Math.max(S,v.fontSize+s)+(m.length-1)*(S+h);S+=h;var M=0;return l==="middle"?M=-E/2:l==="bottom"||l==="alphabetic"||l==="ideographic"?M=-E:(l==="top"||l==="hanging")&&(M=0),{font:p,width:O,height:E,lines:m,lineWidths:b,lineHeight:S,maxLineWidth:x,fontProperties:v,lineMetrics:b.map(function(C,A){var T=0;return c==="center"||c==="middle"?T-=C/2:(c==="right"||c==="end")&&(T-=C),new ss(T-s/2,M+A*S,C+s,S)})}}},t.prototype.setGraphemeOnPath=function(){},t.prototype.wordWrap=function(e,n,r){var i=this,o=n.wordWrapWidth,a=o===void 0?0:o,s=n.letterSpacing,l=n.maxLines,c=l===void 0?1/0:l,u=n.textOverflow,f=this.runtime.offscreenCanvasCreator.getOrCreateContext(r),d=a+s,h="";u==="ellipsis"?h="...":u&&u!=="clip"&&(h=u);for(var p=[],v=0,g=0,y={},m=function(k){return i.getFromCache(k,s,y,f)},b=Array.from(h).reduce(function(k,N){return k+m(N)},0),x=Array.from(e),w=0;w<x.length;w++){var O=x[w],_=e[w-1],S=e[w+1],E=m(O);if(this.isNewline(O)){if(v++,v>=c){n.isOverflowing=!0;break}g=0,p[v]="";continue}if(g>0&&g+E>d){if(v+1>=c){if(n.isOverflowing=!0,b>0&&b<=d){for(var M=p[v].length,P=0,C=M,A=0;A<M;A++){var T=m(p[v][A]);if(P+T+b>d){C=A;break}P+=T}p[v]=(p[v]||"").slice(0,C)+h}break}if(v++,g=0,p[v]="",this.isBreakingSpace(O))continue;this.canBreakInLastChar(O)||(p=this.trimToBreakable(p),g=this.sumTextWidthByCache(p[v]||"",y)),this.shouldBreakByKinsokuShorui(O,S)&&(p=this.trimByKinsokuShorui(p),g+=m(_||""))}g+=E,p[v]=(p[v]||"")+O}return p.join(`
34
34
  `)},t.prototype.isBreakingSpace=function(e){return typeof e!="string"?!1:ds.BreakingSpaces.indexOf(e.charCodeAt(0))>=0},t.prototype.isNewline=function(e){return typeof e!="string"?!1:ds.Newlines.indexOf(e.charCodeAt(0))>=0},t.prototype.trimToBreakable=function(e){var n=Q([],D(e),!1),r=n[n.length-2],i=this.findBreakableIndex(r);if(i===-1||!r)return n;var o=r.slice(i,i+1),a=this.isBreakingSpace(o),s=i+1,l=i+(a?0:1);return n[n.length-1]+=r.slice(s,r.length),n[n.length-2]=r.slice(0,l),n},t.prototype.canBreakInLastChar=function(e){return!(e&&wC.test(e))},t.prototype.sumTextWidthByCache=function(e,n){return e.split("").reduce(function(r,i){if(!n[i])throw Error("cannot count the word without cache");return r+n[i]},0)},t.prototype.findBreakableIndex=function(e){for(var n=e.length-1;n>=0;n--)if(!wC.test(e[n]))return n;return-1},t.prototype.getFromCache=function(e,n,r,i){var o=r[e];if(typeof o!="number"){var a=e.length*n;o=i.measureText(e).width+a,r[e]=o}return o},t}(),U={},kq=function(){var t,e=new cq,n=new lq;return t={},t[H.CIRCLE]=new iq,t[H.ELLIPSE]=new oq,t[H.RECT]=e,t[H.IMAGE]=e,t[H.GROUP]=e,t[H.LINE]=new aq,t[H.TEXT]=new uq(U),t[H.POLYLINE]=n,t[H.POLYGON]=n,t[H.PATH]=new sq,t[H.HTML]=null,t[H.MESH]=null,t}(),Lq=function(){var t,e=new mX,n=new A1;return t={},t[at.PERCENTAGE]=null,t[at.NUMBER]=new SX,t[at.ANGLE]=new gX,t[at.DEFINED_PATH]=new yX,t[at.PAINT]=e,t[at.COLOR]=e,t[at.FILTER]=new bX,t[at.LENGTH]=n,t[at.LENGTH_PERCENTAGE]=n,t[at.LENGTH_PERCENTAGE_12]=new xX,t[at.LENGTH_PERCENTAGE_14]=new wX,t[at.COORDINATE]=new OX,t[at.OFFSET_DISTANCE]=new EX,t[at.OPACITY_VALUE]=new MX,t[at.PATH]=new PX,t[at.LIST_OF_POINTS]=new AX,t[at.SHADOW_BLUR]=new CX,t[at.TEXT]=new TX,t[at.TEXT_TRANSFORM]=new kX,t[at.TRANSFORM]=new eq,t[at.TRANSFORM_ORIGIN]=new nq,t[at.Z_INDEX]=new rq,t[at.MARKER]=new _X,t}(),Nq=function(){return typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{}};U.CameraContribution=DA,U.AnimationTimeline=null,U.EasingFunction=null,U.offscreenCanvasCreator=new pq,U.sceneGraphSelector=new yq,U.sceneGraphService=new bq(U),U.textService=new Tq(U),U.geometryUpdaterFactory=kq,U.CSSPropertySyntaxFactory=Lq,U.styleValueRegistry=new vX(U),U.layoutRegistry=null,U.globalThis=Nq(),U.enableCSSParsing=!0,U.enableDataset=!1,U.enableStyleSyntax=!0,U.enableSizeAttenuation=!1;var Iq=0,OC=new fs(St.INSERTED,null,"","","",0,"",""),_C=new fs(St.REMOVED,null,"","","",0,"",""),jq=new ee(St.DESTROY),Dq=function(t){st(e,t);function e(){var n=t.apply(this,Q([],D(arguments),!1))||this;return n.entity=Iq++,n.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},n.cullable={strategy:p1.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},n.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},n.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},n.geometry={contentBounds:void 0,renderBounds:void 0},n.rBushNode={aabb:void 0},n.namespaceURI="g",n.scrollLeft=0,n.scrollTop=0,n.clientTop=0,n.clientLeft=0,n.destroyed=!1,n.style={},n.computedStyle=U.enableCSSParsing?{anchor:ue,opacity:ue,fillOpacity:ue,strokeOpacity:ue,fill:ue,stroke:ue,transform:ue,transformOrigin:ue,visibility:ue,pointerEvents:ue,lineWidth:ue,lineCap:ue,lineJoin:ue,increasedLineWidthForHitTesting:ue,fontSize:ue,fontFamily:ue,fontStyle:ue,fontWeight:ue,fontVariant:ue,textAlign:ue,textBaseline:ue,textTransform:ue,zIndex:ue,filter:ue,shadowType:ue}:null,n.parsedStyle={},n.attributes={},n}return Object.defineProperty(e.prototype,"className",{get:function(){return this.getAttribute("class")||""},set:function(n){this.setAttribute("class",n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"classList",{get:function(){return this.className.split(" ").filter(function(n){return n!==""})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tagName",{get:function(){return this.nodeName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentElement",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){if(this.parentNode){var n=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[n+1]||null}return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){if(this.parentNode){var n=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[n-1]||null}return null},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(n){throw new Error(Jt)},e.prototype.appendChild=function(n,r){var i;if(n.destroyed)throw new Error(uV);return U.sceneGraphService.attach(n,this,r),!((i=this.ownerDocument)===null||i===void 0)&&i.defaultView&&this.ownerDocument.defaultView.mountChildren(n),OC.relatedNode=this,n.dispatchEvent(OC),n},e.prototype.insertBefore=function(n,r){if(!r)this.appendChild(n);else{n.parentElement&&n.parentElement.removeChild(n);var i=this.childNodes.indexOf(r);i===-1?this.appendChild(n):this.appendChild(n,i)}return n},e.prototype.replaceChild=function(n,r){var i=this.childNodes.indexOf(r);return this.removeChild(r),this.appendChild(n,i),r},e.prototype.removeChild=function(n){var r;return _C.relatedNode=this,n.dispatchEvent(_C),!((r=n.ownerDocument)===null||r===void 0)&&r.defaultView&&n.ownerDocument.defaultView.unmountChildren(n),U.sceneGraphService.detach(n),n},e.prototype.removeChildren=function(){for(var n=this.childNodes.length-1;n>=0;n--){var r=this.childNodes[n];this.removeChild(r)}},e.prototype.destroyChildren=function(){for(var n=this.childNodes.length-1;n>=0;n--){var r=this.childNodes[n];r.childNodes.length&&r.destroyChildren(),r.destroy()}},e.prototype.matches=function(n){return U.sceneGraphService.matches(n,this)},e.prototype.getElementById=function(n){return U.sceneGraphService.querySelector("#".concat(n),this)},e.prototype.getElementsByName=function(n){return U.sceneGraphService.querySelectorAll('[name="'.concat(n,'"]'),this)},e.prototype.getElementsByClassName=function(n){return U.sceneGraphService.querySelectorAll(".".concat(n),this)},e.prototype.getElementsByTagName=function(n){return U.sceneGraphService.querySelectorAll(n,this)},e.prototype.querySelector=function(n){return U.sceneGraphService.querySelector(n,this)},e.prototype.querySelectorAll=function(n){return U.sceneGraphService.querySelectorAll(n,this)},e.prototype.closest=function(n){var r=this;do{if(U.sceneGraphService.matches(n,r))return r;r=r.parentElement}while(r!==null);return null},e.prototype.find=function(n){var r=this,i=null;return this.forEach(function(o){return o!==r&&n(o)?(i=o,!0):!1}),i},e.prototype.findAll=function(n){var r=this,i=[];return this.forEach(function(o){o!==r&&n(o)&&i.push(o)}),i},e.prototype.after=function(){for(var n=this,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];if(this.parentNode){var o=this.parentNode.childNodes.indexOf(this);r.forEach(function(a,s){var l;return(l=n.parentNode)===null||l===void 0?void 0:l.appendChild(a,o+s+1)})}},e.prototype.before=function(){for(var n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];if(this.parentNode){var o=this.parentNode.childNodes.indexOf(this),a=D(r),s=a[0],l=a.slice(1);this.parentNode.appendChild(s,o),(n=s).after.apply(n,Q([],D(l),!1))}},e.prototype.replaceWith=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];this.after.apply(this,Q([],D(n),!1)),this.remove()},e.prototype.append=function(){for(var n=this,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];r.forEach(function(o){return n.appendChild(o)})},e.prototype.prepend=function(){for(var n=this,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];r.forEach(function(o,a){return n.appendChild(o,a)})},e.prototype.replaceChildren=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,Q([],D(n),!1))},e.prototype.remove=function(){return this.parentNode?this.parentNode.removeChild(this):this},e.prototype.destroy=function(){this.dispatchEvent(jq),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},e.prototype.getGeometryBounds=function(){return U.sceneGraphService.getGeometryBounds(this)},e.prototype.getRenderBounds=function(){return U.sceneGraphService.getBounds(this,!0)},e.prototype.getBounds=function(){return U.sceneGraphService.getBounds(this)},e.prototype.getLocalBounds=function(){return U.sceneGraphService.getLocalBounds(this)},e.prototype.getBoundingClientRect=function(){return U.sceneGraphService.getBoundingClientRect(this)},e.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},e.prototype.computedStyleMap=function(){return new Map(Object.entries(this.computedStyle))},e.prototype.getAttributeNames=function(){return Object.keys(this.attributes)},e.prototype.getAttribute=function(n){if(bV(n))return U.enableCSSParsing?null:void 0;var r=this.attributes[n];if(r===void 0){var i=l1(n);return r=this.attributes[i],U.enableCSSParsing&&Ot(r)?null:r}else return r},e.prototype.hasAttribute=function(n){return this.getAttributeNames().includes(n)},e.prototype.hasAttributes=function(){return!!this.getAttributeNames().length},e.prototype.removeAttribute=function(n){this.setAttribute(n,null),delete this.attributes[n]},e.prototype.setAttribute=function(n,r,i){this.attributes[n]=r},e.prototype.getAttributeNS=function(n,r){throw new Error(Jt)},e.prototype.getAttributeNode=function(n){throw new Error(Jt)},e.prototype.getAttributeNodeNS=function(n,r){throw new Error(Jt)},e.prototype.hasAttributeNS=function(n,r){throw new Error(Jt)},e.prototype.removeAttributeNS=function(n,r){throw new Error(Jt)},e.prototype.removeAttributeNode=function(n){throw new Error(Jt)},e.prototype.setAttributeNS=function(n,r,i){throw new Error(Jt)},e.prototype.setAttributeNode=function(n){throw new Error(Jt)},e.prototype.setAttributeNodeNS=function(n){throw new Error(Jt)},e.prototype.toggleAttribute=function(n,r){throw new Error(Jt)},e}(an);function Dt(t){return!!(t!=null&&t.nodeName)}var co=new fs(St.ATTR_MODIFIED,null,null,null,null,fs.MODIFICATION,null,null),$q={anchor:"",opacity:"",fillOpacity:"",strokeOpacity:"",fill:"",stroke:"",transform:"",transformOrigin:"",visibility:"",pointerEvents:"",lineWidth:"",lineCap:"",lineJoin:"",increasedLineWidthForHitTesting:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",zIndex:"",filter:"",shadowType:""},SC={anchor:[0,0],fill:h1,stroke:h1,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},Fq=G(G({},SC),{opacity:1,fillOpacity:1,strokeOpacity:1,visibility:"visible",pointerEvents:"auto",lineWidth:1,lineCap:"butt",lineJoin:"miter",increasedLineWidthForHitTesting:0,fillRule:"nonzero"}),Rq=["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"],Bq=Q(Q([],D(Rq),!1),["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"],!1),EC="data-",Mn=function(t){st(e,t);function e(n){var r,i=t.call(this)||this;i.isCustomElement=!1,i.isMutationObserved=!1,i.activeAnimations=[],i.getClip=function(){return this.style.clipPath||null},i.config=n,i.config.interactive=(r=i.config.capture)!==null&&r!==void 0?r:i.config.interactive,i.id=i.config.id||"",i.name=i.config.name||"",(i.config.className||i.config.class)&&(i.className=i.config.className||i.config.class),i.nodeName=i.config.type||H.GROUP,i.config.style=i.config.style||i.config.attrs||{},Object.assign(i.config.style,i.config.attrs),i.config.visible!=null&&(i.config.style.visibility=i.config.visible===!1?"hidden":"visible"),i.config.interactive!=null&&(i.config.style.pointerEvents=i.config.interactive===!1?"none":"auto"),Object.assign(i.parsedStyle,U.enableCSSParsing?SC:Fq,i.config.initialParsedStyle),U.enableCSSParsing&&Object.assign(i.attributes,$q),i.initAttributes(i.config.style);var o=U.globalThis.Proxy?U.globalThis.Proxy:function(){};return U.enableDataset&&(i.dataset=new o({},{get:function(a,s){var l="".concat(EC).concat(RA(s));return a[l]!==void 0?a[l]:i.getAttribute(l)},set:function(a,s,l){return i.setAttribute("".concat(EC).concat(RA(s)),l),!0}})),U.enableStyleSyntax&&(i.style=new o({setProperty:function(a,s){i.setAttribute(a,s)},getPropertyValue:function(a){return i.getAttribute(a)},removeProperty:function(a){i.removeAttribute(a)},item:function(){return""}},{get:function(a,s){return a[s]!==void 0?a[s]:i.getAttribute(s)},set:function(a,s,l){return i.setAttribute(s,l),!0}})),i}return e.prototype.destroy=function(){t.prototype.destroy.call(this),this.getAnimations().forEach(function(n){n.cancel()})},e.prototype.cloneNode=function(n,r){var i=G({},this.attributes);for(var o in i){var a=i[o];Dt(a)&&o!=="clipPath"&&o!=="offsetPath"&&o!=="textPath"&&(i[o]=a.cloneNode(n)),r&&(i[o]=r(o,a))}var s=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:i});return s.setLocalTransform(this.getLocalTransform()),n&&this.children.forEach(function(l){if(!l.style.isMarker){var c=l.cloneNode(n);s.appendChild(c)}}),s},e.prototype.initAttributes=function(n){n===void 0&&(n={});var r=this.renderable,i={forceUpdateGeometry:!0};U.enableCSSParsing&&(i.usedAttributes=Bq);var o={};for(var a in n){var s=l1(a);o[s]=n[a]}U.styleValueRegistry.processProperties(this,o,i),r.dirty=!0},e.prototype.setAttribute=function(n,r,i,o){i===void 0&&(i=!1),o===void 0&&(o=!0);var a=l1(n);Le(r)||(i||r!==this.attributes[a])&&(this.internalSetAttribute(a,r,{memoize:o}),t.prototype.setAttribute.call(this,a,r))},e.prototype.internalSetAttribute=function(n,r,i){var o;i===void 0&&(i={});var a=this.renderable,s=this.attributes[n],l=this.parsedStyle[n];U.styleValueRegistry.processProperties(this,(o={},o[n]=r,o),i),a.dirty=!0;var c=this.parsedStyle[n];this.isConnected&&(co.relatedNode=this,co.prevValue=s,co.newValue=r,co.attrName=n,co.prevParsedValue=l,co.newParsedValue=c,this.isMutationObserved?this.dispatchEvent(co):(co.target=this,this.ownerDocument.defaultView.dispatchEvent(co,!0))),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(n,s,r,l,c)},e.prototype.getBBox=function(){var n=this.getBounds(),r=D(n.getMin(),2),i=r[0],o=r[1],a=D(n.getMax(),2),s=a[0],l=a[1];return new ss(i,o,s-i,l-o)},e.prototype.setOrigin=function(n,r,i){return r===void 0&&(r=0),i===void 0&&(i=0),U.sceneGraphService.setOrigin(this,In(n,r,i)),this},e.prototype.getOrigin=function(){return U.sceneGraphService.getOrigin(this)},e.prototype.setPosition=function(n,r,i){return r===void 0&&(r=0),i===void 0&&(i=0),U.sceneGraphService.setPosition(this,In(n,r,i)),this},e.prototype.setLocalPosition=function(n,r,i){return r===void 0&&(r=0),i===void 0&&(i=0),U.sceneGraphService.setLocalPosition(this,In(n,r,i)),this},e.prototype.translate=function(n,r,i){return r===void 0&&(r=0),i===void 0&&(i=0),U.sceneGraphService.translate(this,In(n,r,i)),this},e.prototype.translateLocal=function(n,r,i){return r===void 0&&(r=0),i===void 0&&(i=0),U.sceneGraphService.translateLocal(this,In(n,r,i)),this},e.prototype.getPosition=function(){return U.sceneGraphService.getPosition(this)},e.prototype.getLocalPosition=function(){return U.sceneGraphService.getLocalPosition(this)},e.prototype.scale=function(n,r,i){return this.scaleLocal(n,r,i)},e.prototype.scaleLocal=function(n,r,i){return typeof n=="number"&&(r=r||n,i=i||n,n=In(n,r,i)),U.sceneGraphService.scaleLocal(this,n),this},e.prototype.setLocalScale=function(n,r,i){return typeof n=="number"&&(r=r||n,i=i||n,n=In(n,r,i)),U.sceneGraphService.setLocalScale(this,n),this},e.prototype.getLocalScale=function(){return U.sceneGraphService.getLocalScale(this)},e.prototype.getScale=function(){return U.sceneGraphService.getScale(this)},e.prototype.getEulerAngles=function(){var n=D(r1(Ct(),U.sceneGraphService.getWorldTransform(this)),3),r=n[2];return Ir(r)},e.prototype.getLocalEulerAngles=function(){var n=D(r1(Ct(),U.sceneGraphService.getLocalRotation(this)),3),r=n[2];return Ir(r)},e.prototype.setEulerAngles=function(n){return U.sceneGraphService.setEulerAngles(this,0,0,n),this},e.prototype.setLocalEulerAngles=function(n){return U.sceneGraphService.setLocalEulerAngles(this,0,0,n),this},e.prototype.rotateLocal=function(n,r,i){return Ot(r)&&Ot(i)?U.sceneGraphService.rotateLocal(this,0,0,n):U.sceneGraphService.rotateLocal(this,n,r,i),this},e.prototype.rotate=function(n,r,i){return Ot(r)&&Ot(i)?U.sceneGraphService.rotate(this,0,0,n):U.sceneGraphService.rotate(this,n,r,i),this},e.prototype.setRotation=function(n,r,i,o){return U.sceneGraphService.setRotation(this,n,r,i,o),this},e.prototype.setLocalRotation=function(n,r,i,o){return U.sceneGraphService.setLocalRotation(this,n,r,i,o),this},e.prototype.setLocalSkew=function(n,r){return U.sceneGraphService.setLocalSkew(this,n,r),this},e.prototype.getRotation=function(){return U.sceneGraphService.getRotation(this)},e.prototype.getLocalRotation=function(){return U.sceneGraphService.getLocalRotation(this)},e.prototype.getLocalSkew=function(){return U.sceneGraphService.getLocalSkew(this)},e.prototype.getLocalTransform=function(){return U.sceneGraphService.getLocalTransform(this)},e.prototype.getWorldTransform=function(){return U.sceneGraphService.getWorldTransform(this)},e.prototype.setLocalTransform=function(n){return U.sceneGraphService.setLocalTransform(this,n),this},e.prototype.resetLocalTransform=function(){U.sceneGraphService.resetLocalTransform(this)},e.prototype.getAnimations=function(){return this.activeAnimations},e.prototype.animate=function(n,r){var i,o=(i=this.ownerDocument)===null||i===void 0?void 0:i.timeline;return o?o.play(this,n,r):null},e.prototype.isVisible=function(){var n;return((n=this.parsedStyle)===null||n===void 0?void 0:n.visibility)==="visible"},Object.defineProperty(e.prototype,"interactive",{get:function(){return this.isInteractive()},set:function(n){this.style.pointerEvents=n?"auto":"none"},enumerable:!1,configurable:!0}),e.prototype.isInteractive=function(){var n;return((n=this.parsedStyle)===null||n===void 0?void 0:n.pointerEvents)!=="none"},e.prototype.isCulled=function(){return!!(this.cullable&&this.cullable.enable&&!this.cullable.visible)},e.prototype.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,Q([],D(this.parentNode.children.map(function(n){return Number(n.style.zIndex)})),!1))+1),this},e.prototype.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,Q([],D(this.parentNode.children.map(function(n){return Number(n.style.zIndex)})),!1))-1),this},e.prototype.getConfig=function(){return this.config},e.prototype.attr=function(){for(var n=this,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=D(r,2),a=o[0],s=o[1];return a?np(a)?(Object.keys(a).forEach(function(l){n.setAttribute(l,a[l])}),this):r.length===2?(this.setAttribute(a,s),this):this.attributes[a]:this.attributes},e.prototype.getMatrix=function(n){var r=n||this.getWorldTransform(),i=D(yh(Ct(),r),2),o=i[0],a=i[1],s=D(cl(Ct(),r),2),l=s[0],c=s[1],u=mh(Ge(),r),f=D(r1(Ct(),u),3),d=f[0],h=f[2];return rV(d||h,o,a,l,c)},e.prototype.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},e.prototype.setMatrix=function(n){var r=D(LA(n),5),i=r[0],o=r[1],a=r[2],s=r[3],l=r[4];this.setEulerAngles(l).setPosition(i,o).setLocalScale(a,s)},e.prototype.setLocalMatrix=function(n){var r=D(LA(n),5),i=r[0],o=r[1],a=r[2],s=r[3],l=r[4];this.setLocalEulerAngles(l).setLocalPosition(i,o).setLocalScale(a,s)},e.prototype.show=function(){U.enableCSSParsing?this.style.visibility="visible":this.forEach(function(n){n.style.visibility="visible"})},e.prototype.hide=function(){U.enableCSSParsing?this.style.visibility="hidden":this.forEach(function(n){n.style.visibility="hidden"})},e.prototype.getCount=function(){return this.childElementCount},e.prototype.getParent=function(){return this.parentElement},e.prototype.getChildren=function(){return this.children},e.prototype.getFirst=function(){return this.firstElementChild},e.prototype.getLast=function(){return this.lastElementChild},e.prototype.getChildByIndex=function(n){return this.children[n]||null},e.prototype.add=function(n,r){return this.appendChild(n,r)},e.prototype.setClip=function(n){this.style.clipPath=n},e.prototype.set=function(n,r){this.config[n]=r},e.prototype.get=function(n){return this.config[n]},e.prototype.moveTo=function(n,r,i){return r===void 0&&(r=0),i===void 0&&(i=0),this.setPosition(n,r,i),this},e.prototype.move=function(n,r,i){return r===void 0&&(r=0),i===void 0&&(i=0),this.setPosition(n,r,i),this},e.prototype.setZIndex=function(n){return this.style.zIndex=n,this},e}(Dq),MC={number:function(t){return new te(t)},percent:function(t){return new te(t,"%")},px:function(t){return new te(t,"px")},em:function(t){return new te(t,"em")},rem:function(t){return new te(t,"rem")},deg:function(t){return new te(t,"deg")},grad:function(t){return new te(t,"grad")},rad:function(t){return new te(t,"rad")},turn:function(t){return new te(t,"turn")},s:function(t){return new te(t,"s")},ms:function(t){return new te(t,"ms")},registerProperty:function(t){var e=t.name,n=t.inherits,r=t.interpolable,i=t.initialValue,o=t.syntax;U.styleValueRegistry.registerMetadata({n:e,inh:n,int:r,d:i,syntax:o})},registerLayout:function(t,e){U.layoutRegistry.registerLayout(t,e)}},nf=function(t){st(e,t);function e(n){n===void 0&&(n={});var r=n.style,i=Qt(n,["style"]);return t.call(this,G({type:H.CIRCLE,style:U.enableCSSParsing?G({cx:"",cy:"",r:""},r):G({},r),initialParsedStyle:{anchor:[.5,.5],transformOrigin:U.enableCSSParsing?null:[hp,hp]}},i))||this}return e}(Mn),wp=function(t){st(e,t);function e(n){n===void 0&&(n={});var r=this,i=n.style,o=Qt(n,["style"]);return r=t.call(this,G({style:U.enableCSSParsing?G({x:"",y:""},i):G({},i)},o))||this,r.isCustomElement=!0,r}return e}(Mn),j1=function(t){st(e,t);function e(n){n===void 0&&(n={});var r=n.style,i=Qt(n,["style"]);return t.call(this,G({type:H.ELLIPSE,style:U.enableCSSParsing?G({cx:"",cy:"",rx:"",ry:""},r):G({},r),initialParsedStyle:{anchor:[.5,.5],transformOrigin:U.enableCSSParsing?null:[hp,hp]}},i))||this}return e}(Mn),sn=function(t){st(e,t);function e(n){n===void 0&&(n={});var r=n.style,i=Qt(n,["style"]);return t.call(this,G({type:H.GROUP,style:U.enableCSSParsing?G({x:"",y:"",width:"",height:""},r):G({},r)},i))||this}return e}(Mn),Op=function(t){st(e,t);function e(n){n===void 0&&(n={});var r=this,i=n.style,o=Qt(n,["style"]);return r=t.call(this,G({type:H.HTML,style:U.enableCSSParsing?G({x:"",y:"",width:"auto",height:"auto",innerHTML:""},i):G({},i)},o))||this,r.cullable.enable=!1,r}return e.prototype.getDomElement=function(){return this.parsedStyle.$el},e.prototype.getBoundingClientRect=function(){if(this.parsedStyle.$el)return this.parsedStyle.$el.getBoundingClientRect();var n=this.parsedStyle,r=n.x,i=n.y,o=n.width,a=n.height;return new ss(r,i,o,a)},e.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},e.prototype.getBounds=function(){var n,r,i=this.getBoundingClientRect(),o=(r=(n=this.ownerDocument)===null||n===void 0?void 0:n.defaultView)===null||r===void 0?void 0:r.getContextService().getBoundingClientRect(),a=new Xe,s=i.left-((o==null?void 0:o.left)||0),l=i.top-((o==null?void 0:o.top)||0);return a.setMinMax([s,l,0],[s+i.width,l+i.height,0]),a},e.prototype.getLocalBounds=function(){if(this.parentNode){var n=oi(Kt(),this.parentNode.getWorldTransform()),r=this.getBounds();if(!Xe.isEmpty(r)){var i=new Xe;return i.setFromTransformedAABB(r,n),i}}return this.getBounds()},e}(Mn),D1=function(t){st(e,t);function e(n){n===void 0&&(n={});var r=n.style,i=Qt(n,["style"]);return t.call(this,G({type:H.IMAGE,style:U.enableCSSParsing?G({x:"",y:"",img:"",width:"",height:""},r):G({},r)},i))||this}return e}(Mn),rf=function(t){st(e,t);function e(n){n===void 0&&(n={});var r=this,i=n.style,o=Qt(n,["style"]);r=t.call(this,G({type:H.LINE,style:G({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},i)},o))||this,r.markerStartAngle=0,r.markerEndAngle=0;var a=r.parsedStyle,s=a.markerStart,l=a.markerEnd;return s&&Dt(s)&&(r.markerStartAngle=s.getLocalEulerAngles(),r.appendChild(s)),l&&Dt(l)&&(r.markerEndAngle=l.getLocalEulerAngles(),r.appendChild(l)),r.transformMarker(!0),r.transformMarker(!1),r}return e.prototype.attributeChangedCallback=function(n,r,i,o,a){n==="x1"||n==="y1"||n==="x2"||n==="y2"||n==="markerStartOffset"||n==="markerEndOffset"?(this.transformMarker(!0),this.transformMarker(!1)):n==="markerStart"?(o&&Dt(o)&&(this.markerStartAngle=0,o.remove()),a&&Dt(a)&&(this.markerStartAngle=a.getLocalEulerAngles(),this.appendChild(a),this.transformMarker(!0))):n==="markerEnd"&&(o&&Dt(o)&&(this.markerEndAngle=0,o.remove()),a&&Dt(a)&&(this.markerEndAngle=a.getLocalEulerAngles(),this.appendChild(a),this.transformMarker(!1)))},e.prototype.transformMarker=function(n){var r=this.parsedStyle,i=r.markerStart,o=r.markerEnd,a=r.markerStartOffset,s=r.markerEndOffset,l=r.x1,c=r.x2,u=r.y1,f=r.y2,d=r.defX,h=r.defY,p=n?i:o;if(!(!p||!Dt(p))){var v=0,g,y,m,b,x,w;n?(m=l-d,b=u-h,g=c-l,y=f-u,x=a||0,w=this.markerStartAngle):(m=c-d,b=f-h,g=l-c,y=u-f,x=s||0,w=this.markerEndAngle),v=Math.atan2(y,g),p.setLocalEulerAngles(v*180/Math.PI+w),p.setLocalPosition(m+Math.cos(v)*x,b+Math.sin(v)*x)}},e.prototype.getPoint=function(n,r){r===void 0&&(r=!1);var i=this.parsedStyle,o=i.x1,a=i.y1,s=i.x2,l=i.y2,c=i.defX,u=i.defY,f=MA(o,a,s,l,n),d=f.x,h=f.y,p=Qe(Ct(),jt(d-c,h-u,0),r?this.getWorldTransform():this.getLocalTransform());return new on(p[0],p[1])},e.prototype.getPointAtLength=function(n,r){return r===void 0&&(r=!1),this.getPoint(n/this.getTotalLength(),r)},e.prototype.getTotalLength=function(){var n=this.parsedStyle,r=n.x1,i=n.y1,o=n.x2,a=n.y2;return EA(r,i,o,a)},e}(Mn),Dn=function(t){st(e,t);function e(n){n===void 0&&(n={});var r=this,i=n.style,o=Qt(n,["style"]);r=t.call(this,G({type:H.PATH,style:U.enableCSSParsing?G({path:"",miterLimit:""},i):G({},i),initialParsedStyle:U.enableCSSParsing?null:{miterLimit:4,path:G({},zA)}},o))||this,r.markerStartAngle=0,r.markerEndAngle=0,r.markerMidList=[];var a=r.parsedStyle,s=a.markerStart,l=a.markerEnd,c=a.markerMid;return s&&Dt(s)&&(r.markerStartAngle=s.getLocalEulerAngles(),r.appendChild(s)),c&&Dt(c)&&r.placeMarkerMid(c),l&&Dt(l)&&(r.markerEndAngle=l.getLocalEulerAngles(),r.appendChild(l)),r.transformMarker(!0),r.transformMarker(!1),r}return e.prototype.attributeChangedCallback=function(n,r,i,o,a){n==="path"?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):n==="markerStartOffset"||n==="markerEndOffset"?(this.transformMarker(!0),this.transformMarker(!1)):n==="markerStart"?(o&&Dt(o)&&(this.markerStartAngle=0,o.remove()),a&&Dt(a)&&(this.markerStartAngle=a.getLocalEulerAngles(),this.appendChild(a),this.transformMarker(!0))):n==="markerEnd"?(o&&Dt(o)&&(this.markerEndAngle=0,o.remove()),a&&Dt(a)&&(this.markerEndAngle=a.getLocalEulerAngles(),this.appendChild(a),this.transformMarker(!1))):n==="markerMid"&&this.placeMarkerMid(a)},e.prototype.transformMarker=function(n){var r=this.parsedStyle,i=r.markerStart,o=r.markerEnd,a=r.markerStartOffset,s=r.markerEndOffset,l=r.defX,c=r.defY,u=n?i:o;if(!(!u||!Dt(u))){var f=0,d,h,p,v,g,y;if(n){var m=D(this.getStartTangent(),2),b=m[0],x=m[1];p=x[0]-l,v=x[1]-c,d=b[0]-x[0],h=b[1]-x[1],g=a||0,y=this.markerStartAngle}else{var w=D(this.getEndTangent(),2),b=w[0],x=w[1];p=x[0]-l,v=x[1]-c,d=b[0]-x[0],h=b[1]-x[1],g=s||0,y=this.markerEndAngle}f=Math.atan2(h,d),u.setLocalEulerAngles(f*180/Math.PI+y),u.setLocalPosition(p+Math.cos(f)*g,v+Math.sin(f)*g)}},e.prototype.placeMarkerMid=function(n){var r=this.parsedStyle,i=r.path.segments,o=r.defX,a=r.defY;if(this.markerMidList.forEach(function(d){d.remove()}),n&&Dt(n))for(var s=1;s<i.length-1;s++){var l=D(i[s].currentPoint,2),c=l[0],u=l[1],f=s===1?n:n.cloneNode(!0);this.markerMidList.push(f),this.appendChild(f),f.setLocalPosition(c-o,u-a)}},e.prototype.getTotalLength=function(){return b1(this)},e.prototype.getPointAtLength=function(n,r){r===void 0&&(r=!1);var i=this.parsedStyle,o=i.defX,a=i.defY,s=i.path.absolutePath,l=wU(s,n),c=l.x,u=l.y,f=Qe(Ct(),jt(c-o,u-a,0),r?this.getWorldTransform():this.getLocalTransform());return new on(f[0],f[1])},e.prototype.getPoint=function(n,r){return r===void 0&&(r=!1),this.getPointAtLength(n*b1(this),r)},e.prototype.getStartTangent=function(){var n=this.parsedStyle.path.segments,r=[];if(n.length>1){var i=n[0].currentPoint,o=n[1].currentPoint,a=n[1].startTangent;r=[],a?(r.push([i[0]-a[0],i[1]-a[1]]),r.push([i[0],i[1]])):(r.push([o[0],o[1]]),r.push([i[0],i[1]]))}return r},e.prototype.getEndTangent=function(){var n=this.parsedStyle.path.segments,r=n.length,i=[];if(r>1){var o=n[r-2].currentPoint,a=n[r-1].currentPoint,s=n[r-1].endTangent;i=[],s?(i.push([a[0]-s[0],a[1]-s[1]]),i.push([a[0],a[1]])):(i.push([o[0],o[1]]),i.push([a[0],a[1]]))}return i},e}(Mn),of=function(t){st(e,t);function e(n){n===void 0&&(n={});var r=this,i=n.style,o=Qt(n,["style"]);r=t.call(this,G({type:H.POLYGON,style:U.enableCSSParsing?G({points:"",miterLimit:"",isClosed:!0},i):G({},i),initialParsedStyle:U.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},o))||this,r.markerStartAngle=0,r.markerEndAngle=0,r.markerMidList=[];var a=r.parsedStyle,s=a.markerStart,l=a.markerEnd,c=a.markerMid;return s&&Dt(s)&&(r.markerStartAngle=s.getLocalEulerAngles(),r.appendChild(s)),c&&Dt(c)&&r.placeMarkerMid(c),l&&Dt(l)&&(r.markerEndAngle=l.getLocalEulerAngles(),r.appendChild(l)),r.transformMarker(!0),r.transformMarker(!1),r}return e.prototype.attributeChangedCallback=function(n,r,i,o,a){n==="points"?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):n==="markerStartOffset"||n==="markerEndOffset"?(this.transformMarker(!0),this.transformMarker(!1)):n==="markerStart"?(o&&Dt(o)&&(this.markerStartAngle=0,o.remove()),a&&Dt(a)&&(this.markerStartAngle=a.getLocalEulerAngles(),this.appendChild(a),this.transformMarker(!0))):n==="markerEnd"?(o&&Dt(o)&&(this.markerEndAngle=0,o.remove()),a&&Dt(a)&&(this.markerEndAngle=a.getLocalEulerAngles(),this.appendChild(a),this.transformMarker(!1))):n==="markerMid"&&this.placeMarkerMid(a)},e.prototype.transformMarker=function(n){var r=this.parsedStyle,i=r.markerStart,o=r.markerEnd,a=r.markerStartOffset,s=r.markerEndOffset,l=r.points,c=r.defX,u=r.defY,f=(l||{}).points,d=n?i:o;if(!(!d||!Dt(d)||!f)){var h=0,p,v,g,y,m,b;if(g=f[0][0]-c,y=f[0][1]-u,n)p=f[1][0]-f[0][0],v=f[1][1]-f[0][1],m=a||0,b=this.markerStartAngle;else{var x=f.length;this.parsedStyle.isClosed?(p=f[x-1][0]-f[0][0],v=f[x-1][1]-f[0][1]):(g=f[x-1][0]-c,y=f[x-1][1]-u,p=f[x-2][0]-f[x-1][0],v=f[x-2][1]-f[x-1][1]),m=s||0,b=this.markerEndAngle}h=Math.atan2(v,p),d.setLocalEulerAngles(h*180/Math.PI+b),d.setLocalPosition(g+Math.cos(h)*m,y+Math.sin(h)*m)}},e.prototype.placeMarkerMid=function(n){var r=this.parsedStyle,i=r.points,o=r.defX,a=r.defY,s=(i||{}).points;if(this.markerMidList.forEach(function(d){d.remove()}),this.markerMidList=[],n&&Dt(n)&&s)for(var l=1;l<(this.parsedStyle.isClosed?s.length:s.length-1);l++){var c=s[l][0]-o,u=s[l][1]-a,f=l===1?n:n.cloneNode(!0);this.markerMidList.push(f),this.appendChild(f),f.setLocalPosition(c,u)}},e}(Mn),$1=function(t){st(e,t);function e(n){n===void 0&&(n={});var r=n.style,i=Qt(n,["style"]);return t.call(this,G({type:H.POLYLINE,style:U.enableCSSParsing?G({points:"",miterLimit:"",isClosed:!1},r):G({},r),initialParsedStyle:U.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},i))||this}return e.prototype.getTotalLength=function(){return this.parsedStyle.points.totalLength},e.prototype.getPointAtLength=function(n,r){return r===void 0&&(r=!1),this.getPoint(n/this.getTotalLength(),r)},e.prototype.getPoint=function(n,r){r===void 0&&(r=!1);var i=this.parsedStyle,o=i.defX,a=i.defY,s=i.points,l=s.points,c=s.segments,u=0,f=0;c.forEach(function(g,y){n>=g[0]&&n<=g[1]&&(u=(n-g[0])/(g[1]-g[0]),f=y)});var d=MA(l[f][0],l[f][1],l[f+1][0],l[f+1][1],u),h=d.x,p=d.y,v=Qe(Ct(),jt(h-o,p-a,0),r?this.getWorldTransform():this.getLocalTransform());return new on(v[0],v[1])},e.prototype.getStartTangent=function(){var n=this.parsedStyle.points.points,r=[];return r.push([n[1][0],n[1][1]]),r.push([n[0][0],n[0][1]]),r},e.prototype.getEndTangent=function(){var n=this.parsedStyle.points.points,r=n.length-1,i=[];return i.push([n[r-1][0],n[r-1][1]]),i.push([n[r][0],n[r][1]]),i},e}(of),hs=function(t){st(e,t);function e(n){n===void 0&&(n={});var r=n.style,i=Qt(n,["style"]);return t.call(this,G({type:H.RECT,style:U.enableCSSParsing?G({x:"",y:"",width:"",height:"",radius:""},r):G({},r)},i))||this}return e}(Mn),jr=function(t){st(e,t);function e(n){n===void 0&&(n={});var r=n.style,i=Qt(n,["style"]);return t.call(this,G({type:H.TEXT,style:U.enableCSSParsing?G({x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""},r):G({fill:"black"},r),initialParsedStyle:U.enableCSSParsing?{}:{x:0,y:0,fontSize:16,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",lineHeight:0,letterSpacing:0,textBaseline:"alphabetic",textAlign:"start",wordWrap:!1,wordWrapWidth:0,leading:0,dx:0,dy:0}},i))||this}return e.prototype.getComputedTextLength=function(){var n;return((n=this.parsedStyle.metrics)===null||n===void 0?void 0:n.maxLineWidth)||0},e.prototype.getLineBoundingRects=function(){var n;return((n=this.parsedStyle.metrics)===null||n===void 0?void 0:n.lineMetrics)||[]},e.prototype.isOverflowing=function(){return!!this.parsedStyle.isOverflowing},e}(Mn),zq=function(){function t(){this.registry={},this.define(H.CIRCLE,nf),this.define(H.ELLIPSE,j1),this.define(H.RECT,hs),this.define(H.IMAGE,D1),this.define(H.LINE,rf),this.define(H.GROUP,sn),this.define(H.PATH,Dn),this.define(H.POLYGON,of),this.define(H.POLYLINE,$1),this.define(H.TEXT,jr),this.define(H.HTML,Op)}return t.prototype.define=function(e,n){this.registry[e]=n},t.prototype.get=function(e){return this.registry[e]},t}(),Yq=function(t){st(e,t);function e(){var n=t.call(this)||this;n.defaultView=null,n.ownerDocument=null,n.nodeName="document";try{n.timeline=new U.AnimationTimeline(n)}catch(i){}var r={};return P1.forEach(function(i){var o=i.n,a=i.inh,s=i.d;a&&s&&(r[o]=kl(s)?s(H.GROUP):s)}),n.documentElement=new sn({id:"g-root",style:r}),n.documentElement.ownerDocument=n,n.documentElement.parentNode=n,n.childNodes=[n.documentElement],n}return Object.defineProperty(e.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),e.prototype.createElement=function(n,r){if(n==="svg")return this.documentElement;var i=this.defaultView.customElements.get(n);i||(console.warn("Unsupported tagName: ",n),i=n==="tspan"?jr:sn);var o=new i(r);return o.ownerDocument=this,o},e.prototype.createElementNS=function(n,r,i){return this.createElement(r,i)},e.prototype.cloneNode=function(n){throw new Error(Jt)},e.prototype.destroy=function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(n){}},e.prototype.elementsFromBBox=function(n,r,i,o){var a=this.defaultView.context.rBushRoot,s=a.search({minX:n,minY:r,maxX:i,maxY:o}),l=[];return s.forEach(function(c){var u=c.displayObject,f=u.parsedStyle.pointerEvents,d=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(f);(!d||d&&u.isVisible())&&!u.isCulled()&&u.isInteractive()&&l.push(u)}),l.sort(function(c,u){return u.sortable.renderOrder-c.sortable.renderOrder}),l},e.prototype.elementFromPointSync=function(n,r){var i=this.defaultView.canvas2Viewport({x:n,y:r}),o=i.x,a=i.y,s=this.defaultView.getConfig(),l=s.width,c=s.height;if(o<0||a<0||o>l||a>c)return null;var u=this.defaultView.viewport2Client({x:o,y:a}),f=u.x,d=u.y,h=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:n,y:r,viewportX:o,viewportY:a,clientX:f,clientY:d},picked:[]}).picked;return h&&h[0]||this.documentElement},e.prototype.elementFromPoint=function(n,r){return hl(this,void 0,void 0,function(){var i,o,a,s,l,c,u,f,d,h;return pl(this,function(p){switch(p.label){case 0:return i=this.defaultView.canvas2Viewport({x:n,y:r}),o=i.x,a=i.y,s=this.defaultView.getConfig(),l=s.width,c=s.height,o<0||a<0||o>l||a>c?[2,null]:(u=this.defaultView.viewport2Client({x:o,y:a}),f=u.x,d=u.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:n,y:r,viewportX:o,viewportY:a,clientX:f,clientY:d},picked:[]})]);case 1:return h=p.sent().picked,[2,h&&h[0]||this.documentElement]}})})},e.prototype.elementsFromPointSync=function(n,r){var i=this.defaultView.canvas2Viewport({x:n,y:r}),o=i.x,a=i.y,s=this.defaultView.getConfig(),l=s.width,c=s.height;if(o<0||a<0||o>l||a>c)return[];var u=this.defaultView.viewport2Client({x:o,y:a}),f=u.x,d=u.y,h=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:n,y:r,viewportX:o,viewportY:a,clientX:f,clientY:d},picked:[]}).picked;return h[h.length-1]!==this.documentElement&&h.push(this.documentElement),h},e.prototype.elementsFromPoint=function(n,r){return hl(this,void 0,void 0,function(){var i,o,a,s,l,c,u,f,d,h;return pl(this,function(p){switch(p.label){case 0:return i=this.defaultView.canvas2Viewport({x:n,y:r}),o=i.x,a=i.y,s=this.defaultView.getConfig(),l=s.width,c=s.height,o<0||a<0||o>l||a>c?[2,[]]:(u=this.defaultView.viewport2Client({x:o,y:a}),f=u.x,d=u.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:n,y:r,viewportX:o,viewportY:a,clientX:f,clientY:d},picked:[]})]);case 1:return h=p.sent().picked,h[h.length-1]!==this.documentElement&&h.push(this.documentElement),[2,h]}})})},e.prototype.appendChild=function(n,r){throw new Error(Tl)},e.prototype.insertBefore=function(n,r){throw new Error(Tl)},e.prototype.removeChild=function(n,r){throw new Error(Tl)},e.prototype.replaceChild=function(n,r,i){throw new Error(Tl)},e.prototype.append=function(){throw new Error(Tl)},e.prototype.prepend=function(){throw new Error(Tl)},e.prototype.getElementById=function(n){return this.documentElement.getElementById(n)},e.prototype.getElementsByName=function(n){return this.documentElement.getElementsByName(n)},e.prototype.getElementsByTagName=function(n){return this.documentElement.getElementsByTagName(n)},e.prototype.getElementsByClassName=function(n){return this.documentElement.getElementsByClassName(n)},e.prototype.querySelector=function(n){return this.documentElement.querySelector(n)},e.prototype.querySelectorAll=function(n){return this.documentElement.querySelectorAll(n)},e.prototype.find=function(n){return this.documentElement.find(n)},e.prototype.findAll=function(n){return this.documentElement.findAll(n)},e}(an),Wq=function(){function t(e){this.strategies=e}return t.prototype.apply=function(e){var n=e.camera,r=e.renderingService,i=e.renderingContext,o=this.strategies;r.hooks.cull.tap(t.tag,function(a){if(a){var s=a.cullable;return o.length===0?s.visible=i.unculledEntities.indexOf(a.entity)>-1:s.visible=o.every(function(l){return l.isVisible(n,a)}),!a.isCulled()&&a.isVisible()?a:(a.dispatchEvent(new ee(St.CULLED)),null)}return a}),r.hooks.afterRender.tap(t.tag,function(a){a.cullable.visibilityPlaneMask=-1})},t.tag="Culling",t}(),Gq=function(){function t(){var e=this;this.autoPreventDefault=!1,this.rootPointerEvent=new N1(null),this.rootWheelEvent=new I1(null),this.onPointerMove=function(n){var r,i,o,a,s=(a=(o=e.context.renderingContext.root)===null||o===void 0?void 0:o.ownerDocument)===null||a===void 0?void 0:a.defaultView;if(!(s.supportsTouchEvents&&n.pointerType==="touch")){var l=e.normalizeToPointerEvent(n,s);try{for(var c=ur(l),u=c.next();!u.done;u=c.next()){var f=u.value,d=e.bootstrapEvent(e.rootPointerEvent,f,s,n);e.context.eventService.mapEvent(d)}}catch(h){r={error:h}}finally{try{u&&!u.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}e.setCursor(e.context.eventService.cursor)}},this.onClick=function(n){var r,i,o,a,s=(a=(o=e.context.renderingContext.root)===null||o===void 0?void 0:o.ownerDocument)===null||a===void 0?void 0:a.defaultView,l=e.normalizeToPointerEvent(n,s);try{for(var c=ur(l),u=c.next();!u.done;u=c.next()){var f=u.value,d=e.bootstrapEvent(e.rootPointerEvent,f,s,n);e.context.eventService.mapEvent(d)}}catch(h){r={error:h}}finally{try{u&&!u.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}e.setCursor(e.context.eventService.cursor)}}return t.prototype.apply=function(e){var n=this;this.context=e;var r=e.renderingService,i=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler(function(o){var a=n.context.renderingService.hooks.pickSync.call({position:o,picked:[],topmost:!0}).picked;return a[0]||null}),r.hooks.pointerWheel.tap(t.tag,function(o){var a=n.normalizeWheelEvent(o);n.context.eventService.mapEvent(a)}),r.hooks.pointerDown.tap(t.tag,function(o){var a,s;if(!(i.supportsTouchEvents&&o.pointerType==="touch")){var l=n.normalizeToPointerEvent(o,i);if(n.autoPreventDefault&&l[0].isNormalized){var c=o.cancelable||!("cancelable"in o);c&&o.preventDefault()}try{for(var u=ur(l),f=u.next();!f.done;f=u.next()){var d=f.value,h=n.bootstrapEvent(n.rootPointerEvent,d,i,o);n.context.eventService.mapEvent(h)}}catch(p){a={error:p}}finally{try{f&&!f.done&&(s=u.return)&&s.call(u)}finally{if(a)throw a.error}}n.setCursor(n.context.eventService.cursor)}}),r.hooks.pointerUp.tap(t.tag,function(o){var a,s;if(!(i.supportsTouchEvents&&o.pointerType==="touch")){var l=n.context.contextService.getDomElement(),c="outside";try{c=l&&o.target&&o.target!==l&&l.contains&&!l.contains(o.target)?"outside":""}catch(v){}var u=n.normalizeToPointerEvent(o,i);try{for(var f=ur(u),d=f.next();!d.done;d=f.next()){var h=d.value,p=n.bootstrapEvent(n.rootPointerEvent,h,i,o);p.type+=c,n.context.eventService.mapEvent(p)}}catch(v){a={error:v}}finally{try{d&&!d.done&&(s=f.return)&&s.call(f)}finally{if(a)throw a.error}}n.setCursor(n.context.eventService.cursor)}}),r.hooks.pointerMove.tap(t.tag,this.onPointerMove),r.hooks.pointerOver.tap(t.tag,this.onPointerMove),r.hooks.pointerOut.tap(t.tag,this.onPointerMove),r.hooks.click.tap(t.tag,this.onClick),r.hooks.pointerCancel.tap(t.tag,function(o){var a,s,l=n.normalizeToPointerEvent(o,i);try{for(var c=ur(l),u=c.next();!u.done;u=c.next()){var f=u.value,d=n.bootstrapEvent(n.rootPointerEvent,f,i,o);n.context.eventService.mapEvent(d)}}catch(h){a={error:h}}finally{try{u&&!u.done&&(s=c.return)&&s.call(c)}finally{if(a)throw a.error}}n.setCursor(n.context.eventService.cursor)})},t.prototype.getViewportXY=function(e){var n,r,i=e.offsetX,o=e.offsetY,a=e.clientX,s=e.clientY;if(this.context.config.supportsCSSTransform&&!Ot(i)&&!Ot(o))n=i,r=o;else{var l=this.context.eventService.client2Viewport(new on(a,s));n=l.x,r=l.y}return{x:n,y:r}},t.prototype.bootstrapEvent=function(e,n,r,i){e.view=r,e.originalEvent=null,e.nativeEvent=i,e.pointerId=n.pointerId,e.width=n.width,e.height=n.height,e.isPrimary=n.isPrimary,e.pointerType=n.pointerType,e.pressure=n.pressure,e.tangentialPressure=n.tangentialPressure,e.tiltX=n.tiltX,e.tiltY=n.tiltY,e.twist=n.twist,this.transferMouseData(e,n);var o=this.getViewportXY(n),a=o.x,s=o.y;e.viewport.x=a,e.viewport.y=s;var l=this.context.eventService.viewport2Canvas(e.viewport),c=l.x,u=l.y;return e.canvas.x=c,e.canvas.y=u,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.isTrusted=i.isTrusted,e.type==="pointerleave"&&(e.type="pointerout"),e.type.startsWith("mouse")&&(e.type=e.type.replace("mouse","pointer")),e.type.startsWith("touch")&&(e.type=BX[e.type]||e.type),e},t.prototype.normalizeWheelEvent=function(e){var n=this.rootWheelEvent;this.transferMouseData(n,e),n.deltaMode=e.deltaMode,n.deltaX=e.deltaX,n.deltaY=e.deltaY,n.deltaZ=e.deltaZ;var r=this.getViewportXY(e),i=r.x,o=r.y;n.viewport.x=i,n.viewport.y=o;var a=this.context.eventService.viewport2Canvas(n.viewport),s=a.x,l=a.y;return n.canvas.x=s,n.canvas.y=l,n.global.copyFrom(n.canvas),n.offset.copyFrom(n.canvas),n.nativeEvent=e,n.type=e.type,n},t.prototype.transferMouseData=function(e,n){e.isTrusted=n.isTrusted,e.srcElement=n.srcElement,e.timeStamp=k1.now(),e.type=n.type,e.altKey=n.altKey,e.metaKey=n.metaKey,e.shiftKey=n.shiftKey,e.ctrlKey=n.ctrlKey,e.button=n.button,e.buttons=n.buttons,e.client.x=n.clientX,e.client.y=n.clientY,e.movement.x=n.movementX,e.movement.y=n.movementY,e.page.x=n.pageX,e.page.y=n.pageY,e.screen.x=n.screenX,e.screen.y=n.screenY,e.relatedTarget=null},t.prototype.setCursor=function(e){this.context.contextService.applyCursorStyle(e||this.context.config.cursor||"default")},t.prototype.normalizeToPointerEvent=function(e,n){var r=[];if(n.isTouchEvent(e))for(var i=0;i<e.changedTouches.length;i++){var o=e.changedTouches[i];Le(o.button)&&(o.button=0),Le(o.buttons)&&(o.buttons=1),Le(o.isPrimary)&&(o.isPrimary=e.touches.length===1&&e.type==="touchstart"),Le(o.width)&&(o.width=o.radiusX||1),Le(o.height)&&(o.height=o.radiusY||1),Le(o.tiltX)&&(o.tiltX=0),Le(o.tiltY)&&(o.tiltY=0),Le(o.pointerType)&&(o.pointerType="touch"),Le(o.pointerId)&&(o.pointerId=o.identifier||0),Le(o.pressure)&&(o.pressure=o.force||.5),Le(o.twist)&&(o.twist=0),Le(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,o.type=e.type,r.push(o)}else if(n.isMouseEvent(e)){var a=e;Le(a.isPrimary)&&(a.isPrimary=!0),Le(a.width)&&(a.width=1),Le(a.height)&&(a.height=1),Le(a.tiltX)&&(a.tiltX=0),Le(a.tiltY)&&(a.tiltY=0),Le(a.pointerType)&&(a.pointerType="mouse"),Le(a.pointerId)&&(a.pointerId=RX),Le(a.pressure)&&(a.pressure=.5),Le(a.twist)&&(a.twist=0),Le(a.tangentialPressure)&&(a.tangentialPressure=0),a.isNormalized=!0,r.push(a)}else r.push(e);return r},t.tag="Event",t}(),Hq=[H.CIRCLE,H.ELLIPSE,H.IMAGE,H.RECT,H.LINE,H.POLYLINE,H.POLYGON,H.TEXT,H.PATH,H.HTML],Uq=function(){function t(){}return t.prototype.isVisible=function(e,n){var r,i,o=n.cullable;if(!o.enable)return!0;var a=n.getRenderBounds();if(Xe.isEmpty(a))return!1;var s=e.getFrustum(),l=(i=(r=n.parentNode)===null||r===void 0?void 0:r.cullable)===null||i===void 0?void 0:i.visibilityPlaneMask;return o.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(n,a,l||Jo.INDETERMINATE,s.planes),o.visible=o.visibilityPlaneMask!==Jo.OUTSIDE,o.visible},t.prototype.computeVisibilityWithPlaneMask=function(e,n,r,i){if(r===Jo.OUTSIDE||r===Jo.INSIDE)return r;for(var o=Jo.INSIDE,a=Hq.indexOf(e.nodeName)>-1,s=0,l=i.length;s<l;++s){var c=1<<s;if(r&c&&!(a&&(s===4||s===5))){var u=i[s],f=u.normal,d=u.distance;if(Pi(f,n.getPositiveFarPoint(i[s]))+d<0)return Jo.OUTSIDE;Pi(f,n.getNegativeFarPoint(i[s]))+d<0&&(o|=c)}}return o},t}(),Vq=function(){function t(){this.toSync=new Set}return t.prototype.apply=function(e){var n=this,r=e.renderingService,i=e.renderingContext,o=e.rBushRoot,a=i.root.ownerDocument.defaultView;this.rBush=o;var s=function(f){var d=f.target;d.renderable.dirty=!0,r.dirtify()},l=function(f){var d=f.detail.affectChildren,h=f.target;d&&h.forEach(function(v){n.toSync.add(v)});for(var p=h;p;)p.renderable&&n.toSync.add(p),p=p.parentElement;r.dirtify()},c=function(f){var d=f.target;U.enableSizeAttenuation&&U.styleValueRegistry.updateSizeAttenuation(d,a.getCamera().getZoom()),U.enableCSSParsing&&U.styleValueRegistry.recalc(d),U.sceneGraphService.dirtifyToRoot(d),r.dirtify()},u=function(f){var d=f.target,h=d.rBushNode;h.aabb&&n.rBush.remove(h.aabb),n.toSync.delete(d),U.sceneGraphService.dirtifyToRoot(d),r.dirtify()};r.hooks.init.tap(t.tag,function(){a.addEventListener(St.MOUNTED,c),a.addEventListener(St.UNMOUNTED,u),a.addEventListener(St.ATTR_MODIFIED,s),a.addEventListener(St.BOUNDS_CHANGED,l)}),r.hooks.destroy.tap(t.tag,function(){a.removeEventListener(St.MOUNTED,c),a.removeEventListener(St.UNMOUNTED,u),a.removeEventListener(St.ATTR_MODIFIED,s),a.removeEventListener(St.BOUNDS_CHANGED,l),n.toSync.clear()}),r.hooks.endFrame.tap(t.tag,function(){n.syncRTree()})},t.prototype.syncRTree=function(){var e=this,n=[];Array.from(this.toSync).filter(function(r){return r.isConnected}).forEach(function(r){var i=r.rBushNode;i&&i.aabb&&e.rBush.remove(i.aabb);var o=r.getRenderBounds();if(o){var a=D(o.getMin(),2),s=a[0],l=a[1],c=D(o.getMax(),2),u=c[0],f=c[1];i.aabb||(i.aabb={}),i.aabb.displayObject=r,i.aabb.minX=s,i.aabb.minY=l,i.aabb.maxX=u,i.aabb.maxY=f}i.aabb&&!isNaN(i.aabb.maxX)&&!isNaN(i.aabb.maxX)&&!isNaN(i.aabb.minX)&&!isNaN(i.aabb.minY)&&n.push(i.aabb)}),this.rBush.load(n),n.length=0,this.toSync.clear()},t.tag="Prepare",t}(),Qn;(function(t){t.READY="ready",t.BEFORE_RENDER="beforerender",t.RERENDER="rerender",t.AFTER_RENDER="afterrender",t.BEFORE_DESTROY="beforedestroy",t.AFTER_DESTROY="afterdestroy",t.RESIZE="resize",t.DIRTY_RECTANGLE="dirtyrectangle",t.RENDERER_CHANGED="rendererchanged"})(Qn||(Qn={}));var PC=500,Xq=.1,qq=1e3,F1=new ee(St.MOUNTED),R1=new ee(St.UNMOUNTED),Kq=new ee(Qn.BEFORE_RENDER),Zq=new ee(Qn.RERENDER),Qq=new ee(Qn.AFTER_RENDER),AC=function(t){st(e,t);function e(n){var r=t.call(this)||this;r.Element=Mn,r.inited=!1,r.context={},r.document=new Yq,r.document.defaultView=r,r.customElements=new zq;var i=n.container,o=n.canvas,a=n.offscreenCanvas,s=n.width,l=n.height,c=n.devicePixelRatio,u=n.renderer,f=n.background,d=n.cursor,h=n.document,p=n.requestAnimationFrame,v=n.cancelAnimationFrame,g=n.createImage,y=n.supportsPointerEvents,m=n.supportsTouchEvents,b=n.supportsCSSTransform,x=n.supportsMutipleCanvasesInOneContainer,w=n.useNativeClickEvent,O=n.alwaysTriggerPointerEventOnCanvas,_=n.isTouchEvent,S=n.isMouseEvent;x||NX(i,r);var E=s,M=l,P=c;return o&&(P=c||tf&&window.devicePixelRatio||1,P=P>=1?Math.ceil(P):1,E=s||$X(o)||o.width/P,M=l||FX(o)||o.height/P),a&&(U.offscreenCanvas=a),r.devicePixelRatio=P,r.requestAnimationFrame=p!=null?p:vC.bind(U.globalThis),r.cancelAnimationFrame=v!=null?v:gC.bind(U.globalThis),r.supportsTouchEvents=m!=null?m:"ontouchstart"in U.globalThis,r.supportsPointerEvents=y!=null?y:!!U.globalThis.PointerEvent,r.isTouchEvent=_!=null?_:function(C){return r.supportsTouchEvents&&C instanceof U.globalThis.TouchEvent},r.isMouseEvent=S!=null?S:function(C){return!U.globalThis.MouseEvent||C instanceof U.globalThis.MouseEvent&&(!r.supportsPointerEvents||!(C instanceof U.globalThis.PointerEvent))},r.initRenderingContext({container:i,canvas:o,width:E,height:M,renderer:u,offscreenCanvas:a,devicePixelRatio:P,cursor:d||"default",background:f||"transparent",createImage:g,document:h,supportsCSSTransform:b,useNativeClickEvent:w,alwaysTriggerPointerEventOnCanvas:O}),r.initDefaultCamera(E,M,u.clipSpaceNearZ),r.initRenderer(u,!0),r}return e.prototype.initRenderingContext=function(n){this.context.config=n,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},e.prototype.initDefaultCamera=function(n,r,i){var o=this,a=new U.CameraContribution;a.clipSpaceNearZ=i,a.setType(Ht.EXPLORING,qu.DEFAULT).setPosition(n/2,r/2,PC).setFocalPoint(n/2,r/2,0).setOrthographic(n/-2,n/2,r/2,r/-2,Xq,qq),a.canvas=this,a.eventEmitter.on(IA.UPDATED,function(){o.context.renderingContext.renderReasons.add(na.CAMERA_CHANGED),U.enableSizeAttenuation&&o.getConfig().renderer.getConfig().enableSizeAttenuation&&o.updateSizeAttenuation()}),this.context.camera=a},e.prototype.updateSizeAttenuation=function(){var n=this.getCamera().getZoom();this.document.documentElement.forEach(function(r){U.styleValueRegistry.updateSizeAttenuation(r,n)})},e.prototype.getConfig=function(){return this.context.config},e.prototype.getRoot=function(){return this.document.documentElement},e.prototype.getCamera=function(){return this.context.camera},e.prototype.getContextService=function(){return this.context.contextService},e.prototype.getEventService=function(){return this.context.eventService},e.prototype.getRenderingService=function(){return this.context.renderingService},e.prototype.getRenderingContext=function(){return this.context.renderingContext},e.prototype.getStats=function(){return this.getRenderingService().getStats()},Object.defineProperty(e.prototype,"ready",{get:function(){var n=this;return this.readyPromise||(this.readyPromise=new Promise(function(r){n.resolveReadyPromise=function(){r(n)}}),this.inited&&this.resolveReadyPromise()),this.readyPromise},enumerable:!1,configurable:!0}),e.prototype.destroy=function(n,r){if(n===void 0&&(n=!0),r===void 0&&(r=!1),r||this.dispatchEvent(new ee(Qn.BEFORE_DESTROY)),this.frameId){var i=this.getConfig().cancelAnimationFrame||cancelAnimationFrame;i(this.frameId)}var o=this.getRoot();this.unmountChildren(o),n&&(this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),n&&this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),r||this.dispatchEvent(new ee(Qn.AFTER_DESTROY))},e.prototype.changeSize=function(n,r){this.resize(n,r)},e.prototype.resize=function(n,r){var i=this.context.config;i.width=n,i.height=r,this.getContextService().resize(n,r);var o=this.context.camera,a=o.getProjectionMode();o.setPosition(n/2,r/2,PC).setFocalPoint(n/2,r/2,0),a===qn.ORTHOGRAPHIC?o.setOrthographic(n/-2,n/2,r/2,r/-2,o.getNear(),o.getFar()):o.setAspect(n/r),this.dispatchEvent(new ee(Qn.RESIZE,{width:n,height:r}))},e.prototype.appendChild=function(n,r){return this.document.documentElement.appendChild(n,r)},e.prototype.insertBefore=function(n,r){return this.document.documentElement.insertBefore(n,r)},e.prototype.removeChild=function(n){return this.document.documentElement.removeChild(n)},e.prototype.removeChildren=function(){this.document.documentElement.removeChildren()},e.prototype.destroyChildren=function(){this.document.documentElement.destroyChildren()},e.prototype.render=function(){var n=this;this.dispatchEvent(Kq);var r=this.getRenderingService();r.render(this.getConfig(),function(){n.dispatchEvent(Zq)}),this.dispatchEvent(Qq)},e.prototype.run=function(){var n=this,r=function(){n.render(),n.frameId=n.requestAnimationFrame(r)};r()},e.prototype.initRenderer=function(n,r){var i=this;if(r===void 0&&(r=!1),!n)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new KU,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new Gq,new Vq,new Wq([new Uq])),this.loadRendererContainerModule(n),this.context.contextService=new this.context.ContextService(G(G({},U),this.context)),this.context.renderingService=new vq(U,this.context),this.context.eventService=new hq(U,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(n,r,!0)):this.context.contextService.initAsync().then(function(){i.initRenderingService(n,r)})},e.prototype.initRenderingService=function(n,r,i){var o=this;r===void 0&&(r=!1),i===void 0&&(i=!1),this.context.renderingService.init(function(){o.inited=!0,r?(i?o.requestAnimationFrame(function(){o.dispatchEvent(new ee(Qn.READY))}):o.dispatchEvent(new ee(Qn.READY)),o.readyPromise&&o.resolveReadyPromise()):o.dispatchEvent(new ee(Qn.RENDERER_CHANGED)),r||o.getRoot().forEach(function(a){var s=a.renderable;s&&(s.renderBoundsDirty=!0,s.boundsDirty=!0,s.dirty=!0)}),o.mountChildren(o.getRoot()),n.getConfig().enableAutoRendering&&o.run()})},e.prototype.loadRendererContainerModule=function(n){var r=this,i=n.getPlugins();i.forEach(function(o){o.context=r.context,o.init(U)})},e.prototype.setRenderer=function(n){var r=this.getConfig();if(r.renderer!==n){var i=r.renderer;r.renderer=n,this.destroy(!1,!0),Q([],D(i==null?void 0:i.getPlugins()),!1).reverse().forEach(function(o){o.destroy(U)}),this.initRenderer(n)}},e.prototype.setCursor=function(n){var r=this.getConfig();r.cursor=n,this.getContextService().applyCursorStyle(n)},e.prototype.unmountChildren=function(n){var r=this;n.childNodes.forEach(function(i){r.unmountChildren(i)}),this.inited&&(n.isMutationObserved?n.dispatchEvent(R1):(R1.target=n,this.dispatchEvent(R1,!0)),n!==this.document.documentElement&&(n.ownerDocument=null),n.isConnected=!1),n.isCustomElement&&n.disconnectedCallback&&n.disconnectedCallback()},e.prototype.mountChildren=function(n){var r=this;this.inited?n.isConnected||(n.ownerDocument=this.document,n.isConnected=!0,n.isMutationObserved?n.dispatchEvent(F1):(F1.target=n,this.dispatchEvent(F1,!0))):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",n.nodeName),n.childNodes.forEach(function(i){r.mountChildren(i)}),n.isCustomElement&&n.connectedCallback&&n.connectedCallback()},e.prototype.client2Viewport=function(n){return this.getEventService().client2Viewport(n)},e.prototype.viewport2Client=function(n){return this.getEventService().viewport2Client(n)},e.prototype.viewport2Canvas=function(n){return this.getEventService().viewport2Canvas(n)},e.prototype.canvas2Viewport=function(n){return this.getEventService().canvas2Viewport(n)},e.prototype.getPointByClient=function(n,r){return this.client2Viewport({x:n,y:r})},e.prototype.getClientByPoint=function(n,r){return this.viewport2Client({x:n,y:r})},e}(bC),Jq={}.toString,tK=function(t,e){return Jq.call(t)==="[object "+e+"]"};const CC=tK,eK=function(t){return CC(t,"String")};var nK=function(t){return CC(t,"Number")};const rK=nK;var iK=function(t){st(e,t);function e(){var n=t.apply(this,Q([],D(arguments),!1))||this;return n.landmarks=[],n}return e.prototype.rotate=function(n,r,i){if(this.relElevation=Cl(r),this.relAzimuth=Cl(n),this.relRoll=Cl(i),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===Ht.EXPLORING){var o=Wo(Ge(),[1,0,0],Me((this.rotateWorld?1:-1)*this.relElevation)),a=Wo(Ge(),[0,1,0],Me((this.rotateWorld?1:-1)*this.relAzimuth)),s=Wo(Ge(),[0,0,1],Me(this.relRoll)),l=Go(Ge(),a,o);l=Go(Ge(),l,s);var c=qy(Kt(),l);Yo(this.matrix,this.matrix,[0,0,-this.distance]),On(this.matrix,this.matrix,c),Yo(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===Ht.ORBITING||this.type===Ht.EXPLORING?this._getPosition():this.type===Ht.TRACKING&&this._getFocalPoint(),this._update(),this},e.prototype.pan=function(n,r){var i=In(n,r,0),o=to(this.position);return ul(o,o,Ky(Ct(),this.right,i[0])),ul(o,o,Ky(Ct(),this.up,i[1])),this._setPosition(o),this.triggerUpdate(),this},e.prototype.dolly=function(n){var r=this.forward,i=to(this.position),o=n*this.dollyingStep,a=this.distance+n*this.dollyingStep;return o=Math.max(Math.min(a,this.maxDistance),this.minDistance)-this.distance,i[0]+=o*r[0],i[1]+=o*r[1],i[2]+=o*r[2],this._setPosition(i),this.type===Ht.ORBITING||this.type===Ht.EXPLORING?this._getDistance():this.type===Ht.TRACKING&&ul(this.focalPoint,i,this.distanceVector),this.triggerUpdate(),this},e.prototype.cancelLandmarkAnimation=function(){this.landmarkAnimationID!==void 0&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)},e.prototype.createLandmark=function(n,r){var i,o,a,s;r===void 0&&(r={});var l=r.position,c=l===void 0?this.position:l,u=r.focalPoint,f=u===void 0?this.focalPoint:u,d=r.roll,h=r.zoom,p=new U.CameraContribution;p.setType(this.type,void 0),p.setPosition(c[0],(i=c[1])!==null&&i!==void 0?i:this.position[1],(o=c[2])!==null&&o!==void 0?o:this.position[2]),p.setFocalPoint(f[0],(a=f[1])!==null&&a!==void 0?a:this.focalPoint[1],(s=f[2])!==null&&s!==void 0?s:this.focalPoint[2]),p.setRoll(d!=null?d:this.roll),p.setZoom(h!=null?h:this.zoom);var v={name:n,matrix:Hy(p.getWorldTransform()),right:to(p.right),up:to(p.up),forward:to(p.forward),position:to(p.getPosition()),focalPoint:to(p.getFocalPoint()),distanceVector:to(p.getDistanceVector()),distance:p.getDistance(),dollyingStep:p.getDollyingStep(),azimuth:p.getAzimuth(),elevation:p.getElevation(),roll:p.getRoll(),relAzimuth:p.relAzimuth,relElevation:p.relElevation,relRoll:p.relRoll,zoom:p.getZoom()};return this.landmarks.push(v),v},e.prototype.gotoLandmark=function(n,r){var i=this;r===void 0&&(r={});var o=eK(n)?this.landmarks.find(function(M){return M.name===n}):n;if(o){var a=rK(r)?{duration:r}:r,s=a.easing,l=s===void 0?"linear":s,c=a.duration,u=c===void 0?100:c,f=a.easingFunction,d=f===void 0?void 0:f,h=a.onfinish,p=h===void 0?void 0:h,v=a.onframe,g=v===void 0?void 0:v,y=.01;if(u===0){this.syncFromLandmark(o),p&&p();return}this.cancelLandmarkAnimation();var m=o.position,b=o.focalPoint,x=o.zoom,w=o.roll,O=d||U.EasingFunction(l),_,S=function(){i.setFocalPoint(b),i.setPosition(m),i.setRoll(w),i.setZoom(x),i.computeMatrix(),i.triggerUpdate(),p&&p()},E=function(M){_===void 0&&(_=M);var P=M-_;if(P>u){S();return}var C=O(P/u),A=Ct(),T=Ct(),k=1,N=0;Zy(A,i.focalPoint,b,C),Zy(T,i.position,m,C),N=i.roll*(1-C)+w*C,k=i.zoom*(1-C)+x*C,i.setFocalPoint(A),i.setPosition(T),i.setRoll(N),i.setZoom(k);var j=jE(A,b)+jE(T,m);if(j<=y&&x==null&&w==null){S();return}i.computeMatrix(),i.triggerUpdate(),P<u&&(g&&g(C),i.landmarkAnimationID=i.canvas.requestAnimationFrame(E))};this.canvas.requestAnimationFrame(E)}},e.prototype.syncFromLandmark=function(n){this.matrix=qa(this.matrix,n.matrix),this.right=Vn(this.right,n.right),this.up=Vn(this.up,n.up),this.forward=Vn(this.forward,n.forward),this.position=Vn(this.position,n.position),this.focalPoint=Vn(this.focalPoint,n.focalPoint),this.distanceVector=Vn(this.distanceVector,n.distanceVector),this.azimuth=n.azimuth,this.elevation=n.elevation,this.roll=n.roll,this.relAzimuth=n.relAzimuth,this.relElevation=n.relElevation,this.relRoll=n.relRoll,this.dollyingStep=n.dollyingStep,this.distance=n.distance,this.zoom=n.zoom},e}(DA);U.CameraContribution=iK;var oK=function(t){return t==null};const B1=oK;var aK={}.toString,sK=function(t,e){return aK.call(t)==="[object "+e+"]"};const lK=sK;var cK=function(t,e,n){return t<e?e:t>n?n:t};const ps=cK;var uK=function(t){return lK(t,"Number")};const fK=uK;var z1=function(t){st(e,t);function e(n,r,i,o){var a=t.call(this,n)||this;return a.currentTime=i,a.timelineTime=o,a.target=r,a.type="finish",a.bubbles=!1,a.currentTarget=r,a.defaultPrevented=!1,a.eventPhase=a.AT_TARGET,a.timeStamp=Date.now(),a.currentTime=i,a.timelineTime=o,a}return e}(xp),dK=0,hK=function(){function t(e,n){var r;this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=e,e.animation=this,this.timeline=n,this.id="".concat(dK++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number((r=this.effect)===null||r===void 0?void 0:r.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}return Object.defineProperty(t.prototype,"pending",{get:function(){return this._startTime===null&&!this._paused&&this.playbackRate!==0||this.currentTimePending},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playState",{get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ready",{get:function(){var e=this;return this.readyPromise||(this.timeline.animationsWithPromises.indexOf(this)===-1&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise(function(n,r){e.resolveReadyPromise=function(){n(e)},e.rejectReadyPromise=function(){r(new Error)}}),this.pending||this.resolveReadyPromise()),this.readyPromise},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"finished",{get:function(){var e=this;return this.finishedPromise||(this.timeline.animationsWithPromises.indexOf(this)===-1&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise(function(n,r){e.resolveFinishedPromise=function(){n(e)},e.rejectFinishedPromise=function(){r(new Error)}}),this.playState==="finished"&&this.resolveFinishedPromise()),this.finishedPromise},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentTime",{get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(e){var n;e=Number(e),!isNaN(e)&&(this.timeline.restart(),!this._paused&&this._startTime!==null&&(this._startTime=Number((n=this.timeline)===null||n===void 0?void 0:n.currentTime)-e/this.playbackRate),this.currentTimePending=!1,this._currentTime!==e&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(e,!0),this.timeline.applyDirtiedAnimation(this)))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"startTime",{get:function(){return this._startTime},set:function(e){if(e!==null){if(this.updatePromises(),e=Number(e),isNaN(e)||this._paused||this._idle)return;this._startTime=e,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playbackRate",{get:function(){return this._playbackRate},set:function(e){if(e!==this._playbackRate){this.updatePromises();var n=this.currentTime;this._playbackRate=e,this.startTime=null,this.playState!=="paused"&&this.playState!=="idle"&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),n!==null&&(this.currentTime=n),this.updatePromises()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_isFinished",{get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"totalDuration",{get:function(){return this._totalDuration},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_needsTick",{get:function(){return this.pending||this.playState==="running"||!this._finishedFlag},enumerable:!1,configurable:!0}),t.prototype.updatePromises=function(){var e=this.oldPlayState,n=this.pending?"pending":this.playState;return this.readyPromise&&n!==e&&(n==="idle"?(this.rejectReadyPromise(),this.readyPromise=void 0):e==="pending"?this.resolveReadyPromise():n==="pending"&&(this.readyPromise=void 0)),this.finishedPromise&&n!==e&&(n==="idle"?(this.rejectFinishedPromise(),this.finishedPromise=void 0):n==="finished"?this.resolveFinishedPromise():e==="finished"&&(this.finishedPromise=void 0)),this.oldPlayState=n,this.readyPromise||this.finishedPromise},t.prototype.play=function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),this.timeline.animations.indexOf(this)===-1&&this.timeline.animations.push(this),this.updatePromises()},t.prototype.pause=function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),!this._isFinished&&!this._paused&&!this._idle?this.currentTimePending=!0:this._idle&&(this.rewind(),this._idle=!1),this._startTime=null,this._paused=!0,this.updatePromises()},t.prototype.finish=function(){this.updatePromises(),!this._idle&&(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())},t.prototype.cancel=function(){var e=this;if(this.updatePromises(),!!this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises(),this.oncancel)){var n=new z1(null,this,this.currentTime,null);setTimeout(function(){e.oncancel(n)})}},t.prototype.reverse=function(){this.updatePromises();var e=this.currentTime;this.playbackRate*=-1,this.play(),e!==null&&(this.currentTime=e),this.updatePromises()},t.prototype.updatePlaybackRate=function(e){this.playbackRate=e},t.prototype.targetAnimations=function(){var e,n=(e=this.effect)===null||e===void 0?void 0:e.target;return n.getAnimations()},t.prototype.markTarget=function(){var e=this.targetAnimations();e.indexOf(this)===-1&&e.push(this)},t.prototype.unmarkTarget=function(){var e=this.targetAnimations(),n=e.indexOf(this);n!==-1&&e.splice(n,1)},t.prototype.tick=function(e,n){!this._idle&&!this._paused&&(this._startTime===null?n&&(this.startTime=e-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((e-this._startTime)*this.playbackRate)),n&&(this.currentTimePending=!1,this.fireEvents(e))},t.prototype.rewind=function(){if(this.playbackRate>=0)this.currentTime=0;else if(this._totalDuration<1/0)this.currentTime=this._totalDuration;else throw new Error("Unable to rewind negative playback rate animation with infinite duration")},t.prototype.persist=function(){throw new Error(Jt)},t.prototype.addEventListener=function(e,n,r){throw new Error(Jt)},t.prototype.removeEventListener=function(e,n,r){throw new Error(Jt)},t.prototype.dispatchEvent=function(e){throw new Error(Jt)},t.prototype.commitStyles=function(){throw new Error(Jt)},t.prototype.ensureAlive=function(){var e,n;this.playbackRate<0&&this.currentTime===0?this._inEffect=!!(!((e=this.effect)===null||e===void 0)&&e.update(-1)):this._inEffect=!!(!((n=this.effect)===null||n===void 0)&&n.update(this.currentTime)),!this._inTimeline&&(this._inEffect||!this._finishedFlag)&&(this._inTimeline=!0,this.timeline.animations.push(this))},t.prototype.tickCurrentTime=function(e,n){e!==this._currentTime&&(this._currentTime=e,this._isFinished&&!n&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())},t.prototype.fireEvents=function(e){var n=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var r=new z1(null,this,this.currentTime,e);setTimeout(function(){n.onfinish&&n.onfinish(r)})}this._finishedFlag=!0}}else{if(this.onframe&&this.playState==="running"){var i=new z1(null,this,this.currentTime,e);this.onframe(i)}this._finishedFlag=!1}},t}(),pK=4,vK=.001,gK=1e-7,yK=10,af=11,_p=1/(af-1),mK=typeof Float32Array=="function",TC=function(t,e){return 1-3*e+3*t},kC=function(t,e){return 3*e-6*t},LC=function(t){return 3*t},Sp=function(t,e,n){return((TC(e,n)*t+kC(e,n))*t+LC(e))*t},NC=function(t,e,n){return 3*TC(e,n)*t*t+2*kC(e,n)*t+LC(e)},bK=function(t,e,n,r,i){var o,a,s=0;do a=e+(n-e)/2,o=Sp(a,r,i)-t,o>0?n=a:e=a;while(Math.abs(o)>gK&&++s<yK);return a},xK=function(t,e,n,r){for(var i=0;i<pK;++i){var o=NC(e,n,r);if(o===0)return e;var a=Sp(e,n,r)-t;e-=a/o}return e},Y1=function(t,e,n,r){if(!(0<=t&&t<=1&&0<=n&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(t===e&&n===r)return function(s){return s};for(var i=mK?new Float32Array(af):new Array(af),o=0;o<af;++o)i[o]=Sp(o*_p,t,n);var a=function(s){for(var l=0,c=1,u=af-1;c!==u&&i[c]<=s;++c)l+=_p;--c;var f=(s-i[c])/(i[c+1]-i[c]),d=l+f*_p,h=NC(d,t,n);return h>=vK?xK(s,d,t,n):h===0?d:bK(s,l,l+_p,t,n)};return function(s){return s===0||s===1?s:Sp(a(s),e,r)}},wK=function(t){return t=t.replace(/([A-Z])/g,function(e){return"-".concat(e.toLowerCase())}),t.charAt(0)==="-"?t.substring(1):t},Ep=function(t){return Math.pow(t,2)},Mp=function(t){return Math.pow(t,3)},Pp=function(t){return Math.pow(t,4)},Ap=function(t){return Math.pow(t,5)},Cp=function(t){return Math.pow(t,6)},Tp=function(t){return 1-Math.cos(t*Math.PI/2)},kp=function(t){return 1-Math.sqrt(1-t*t)},Lp=function(t){return t*t*(3*t-2)},Np=function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((e*3-2)/22-t,2)},Ip=function(t,e){e===void 0&&(e=[]);var n=D(e,2),r=n[0],i=r===void 0?1:r,o=n[1],a=o===void 0?.5:o,s=ps(Number(i),1,10),l=ps(Number(a),.1,2);return t===0||t===1?t:-s*Math.pow(2,10*(t-1))*Math.sin((t-1-l/(Math.PI*2)*Math.asin(1/s))*(Math.PI*2)/l)},sf=function(t,e,n){e===void 0&&(e=[]);var r=D(e,4),i=r[0],o=i===void 0?1:i,a=r[1],s=a===void 0?100:a,l=r[2],c=l===void 0?10:l,u=r[3],f=u===void 0?0:u;o=ps(o,.1,1e3),s=ps(s,.1,1e3),c=ps(c,.1,1e3),f=ps(f,.1,1e3);var d=Math.sqrt(s/o),h=c/(2*Math.sqrt(s*o)),p=h<1?d*Math.sqrt(1-h*h):0,v=1,g=h<1?(h*d+-f)/p:-f+d,y=n?n*t/1e3:t;return h<1?y=Math.exp(-y*h*d)*(v*Math.cos(p*y)+g*Math.sin(p*y)):y=(v+g*y)*Math.exp(-y*d),t===0||t===1?t:1-y},W1=function(t,e){e===void 0&&(e=[]);var n=D(e,2),r=n[0],i=r===void 0?10:r,o=n[1],a=o=="start"?Math.ceil:Math.floor;return a(ps(t,0,1)*i)/i},IC=function(t,e){e===void 0&&(e=[]);var n=D(e,4),r=n[0],i=n[1],o=n[2],a=n[3];return Y1(r,i,o,a)(t)},jp=Y1(.42,0,1,1),Dr=function(t){return function(e,n,r){return n===void 0&&(n=[]),1-t(1-e,n,r)}},$r=function(t){return function(e,n,r){return n===void 0&&(n=[]),e<.5?t(e*2,n,r)/2:1-t(e*-2+2,n,r)/2}},Fr=function(t){return function(e,n,r){return n===void 0&&(n=[]),e<.5?(1-t(1-e*2,n,r))/2:(t(e*2-1,n,r)+1)/2}},jC={steps:W1,"step-start":function(t){return W1(t,[1,"start"])},"step-end":function(t){return W1(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":IC,ease:function(t){return IC(t,[.25,.1,.25,1])},in:jp,out:Dr(jp),"in-out":$r(jp),"out-in":Fr(jp),"in-quad":Ep,"out-quad":Dr(Ep),"in-out-quad":$r(Ep),"out-in-quad":Fr(Ep),"in-cubic":Mp,"out-cubic":Dr(Mp),"in-out-cubic":$r(Mp),"out-in-cubic":Fr(Mp),"in-quart":Pp,"out-quart":Dr(Pp),"in-out-quart":$r(Pp),"out-in-quart":Fr(Pp),"in-quint":Ap,"out-quint":Dr(Ap),"in-out-quint":$r(Ap),"out-in-quint":Fr(Ap),"in-expo":Cp,"out-expo":Dr(Cp),"in-out-expo":$r(Cp),"out-in-expo":Fr(Cp),"in-sine":Tp,"out-sine":Dr(Tp),"in-out-sine":$r(Tp),"out-in-sine":Fr(Tp),"in-circ":kp,"out-circ":Dr(kp),"in-out-circ":$r(kp),"out-in-circ":Fr(kp),"in-back":Lp,"out-back":Dr(Lp),"in-out-back":$r(Lp),"out-in-back":Fr(Lp),"in-bounce":Np,"out-bounce":Dr(Np),"in-out-bounce":$r(Np),"out-in-bounce":Fr(Np),"in-elastic":Ip,"out-elastic":Dr(Ip),"in-out-elastic":$r(Ip),"out-in-elastic":Fr(Ip),spring:sf,"spring-in":sf,"spring-out":Dr(sf),"spring-in-out":$r(sf),"spring-out-in":Fr(sf)},OK=function(t){return wK(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()},_K=function(t){return jC[OK(t)]||jC.linear},SK=function(t){return t},EK=1,MK=.5,DC=0;function $C(t,e){return function(n){if(n>=1)return 1;var r=1/t;return n+=e*r,n-n%r}}var Dp="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",PK=new RegExp("cubic-bezier\\("+Dp+","+Dp+","+Dp+","+Dp+"\\)"),AK=/steps\(\s*(\d+)\s*\)/,CK=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function G1(t){var e=PK.exec(t);if(e)return Y1.apply(void 0,Q([],D(e.slice(1).map(Number)),!1));var n=AK.exec(t);if(n)return $C(Number(n[1]),DC);var r=CK.exec(t);return r?$C(Number(r[1]),{start:EK,middle:MK,end:DC}[r[2]]):_K(t)}function TK(t){return Math.abs(kK(t)/(t.playbackRate||1))}function kK(t){var e;return t.duration===0||t.iterations===0?0:(t.duration==="auto"?0:Number(t.duration))*((e=t.iterations)!==null&&e!==void 0?e:1)}var FC=0,H1=1,$p=2,RC=3;function LK(t,e,n){if(e===null)return FC;var r=n.endTime;return e<Math.min(n.delay,r)?H1:e>=Math.min(n.delay+t+n.endDelay,r)?$p:RC}function NK(t,e,n,r,i){switch(r){case H1:return e==="backwards"||e==="both"?0:null;case RC:return n-i;case $p:return e==="forwards"||e==="both"?t:null;case FC:return null}}function IK(t,e,n,r,i){var o=i;return t===0?e!==H1&&(o+=n):o+=r/t,o}function jK(t,e,n,r,i,o){var a=t===1/0?e%1:t%1;return a===0&&n===$p&&r!==0&&(i!==0||o===0)&&(a=1),a}function DK(t,e,n,r){return t===$p&&e===1/0?1/0:n===1?Math.floor(r)-1:Math.floor(r)}function $K(t,e,n){var r=t;if(t!=="normal"&&t!=="reverse"){var i=e;t==="alternate-reverse"&&(i+=1),r="normal",i!==1/0&&i%2!==0&&(r="reverse")}return r==="normal"?n:1-n}function FK(t,e,n){var r=LK(t,e,n),i=NK(t,n.fill,e,r,n.delay);if(i===null)return null;var o=n.duration==="auto"?0:n.duration,a=IK(o,r,n.iterations,i,n.iterationStart),s=jK(a,n.iterationStart,r,n.iterations,i,o),l=DK(r,n.iterations,s,a),c=$K(n.direction,l,s);return n.currentIteration=l,n.progress=c,n.easingFunction(c)}function RK(t,e,n){var r=BK(t,e),i=zK(r,n);return function(o,a){if(a!==null)i.filter(function(l){return a>=l.applyFrom&&a<l.applyTo}).forEach(function(l){var c=a-l.startOffset,u=l.endOffset-l.startOffset,f=u===0?0:l.easingFunction(c/u);o.setAttribute(l.property,l.interpolation(f),!1,!1)});else for(var s in r)BC(s)&&o.setAttribute(s,null)}}function BC(t){return t!=="offset"&&t!=="easing"&&t!=="composite"&&t!=="computedOffset"}function BK(t,e){for(var n={},r=0;r<t.length;r++)for(var i in t[r])if(BC(i)){var o={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:G1(t[r].easing)||e.easingFunction,value:t[r][i]};n[i]=n[i]||[],n[i].push(o)}return n}function zK(t,e){var n=[];for(var r in t)for(var i=t[r],o=0;o<i.length-1;o++){var a=o,s=o+1,l=i[a].computedOffset,c=i[s].computedOffset,u=l,f=c;o===0&&(u=-1/0,c===0&&(s=a)),o===i.length-2&&(f=1/0,l===1&&(a=s)),n.push({applyFrom:u,applyTo:f,startOffset:i[a].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[a].easingFunction,property:r,interpolation:YK(r,i[a].value,i[s].value,e)})}return n.sort(function(d,h){return d.startOffset-h.startOffset}),n}var zC=function(t,e,n){return function(r){var i=YC(t,e,r);return!U.enableCSSParsing&&fK(i)?i:n(i)}};function YK(t,e,n,r){var i=ea[t];if(i&&i.syntax&&i.int){var o=U.styleValueRegistry.getPropertySyntax(i.syntax);if(o){var a=void 0,s=void 0;if(U.enableCSSParsing){var l=U.styleValueRegistry.parseProperty(t,e,r,!1),c=U.styleValueRegistry.parseProperty(t,n,r,!1);a=U.styleValueRegistry.computeProperty(t,l,r,!1),s=U.styleValueRegistry.computeProperty(t,c,r,!1)}else{var u=o.parserWithCSSDisabled;a=u?u(e,r):e,s=u?u(n,r):n}var f=o.mixer(a,s,r);if(f){var d=zC.apply(void 0,Q([],D(f),!1));return function(h){return h===0?e:h===1?n:d(h)}}}}return zC(!1,!0,function(h){return h?n:e})}function YC(t,e,n){if(typeof t=="number"&&typeof e=="number")return t*(1-n)+e*n;if(typeof t=="boolean"&&typeof e=="boolean"||typeof t=="string"&&typeof e=="string")return n<.5?t:e;if(Array.isArray(t)&&Array.isArray(e)){for(var r=t.length,i=e.length,o=Math.max(r,i),a=[],s=0;s<o;s++)a.push(YC(t[s<r?s:r-1],e[s<i?s:i-1],n));return a}throw new Error("Mismatched interpolation arguments "+t+":"+e)}var WK=function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=SK,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null}return Object.defineProperty(t.prototype,"easing",{get:function(){return this._easing},set:function(e){this.easingFunction=G1(e),this._easing=e},enumerable:!1,configurable:!0}),t}();function GK(t){var e=[];for(var n in t)if(!(n in["easing","offset","composite"])){var r=t[n];Array.isArray(r)||(r=[r]);for(var i=r.length,o=0;o<i;o++){if(!e[o]){var a={};"offset"in t&&(a.offset=Number(t.offset)),"easing"in t&&(a.easing=t.easing),"composite"in t&&(a.composite=t.composite),e[o]=a}r[o]!==void 0&&r[o]!==null&&(e[o][n]=r[o])}}return e.sort(function(s,l){return(s.computedOffset||0)-(l.computedOffset||0)}),e}function WC(t,e){if(t===null)return[];Array.isArray(t)||(t=GK(t));for(var n=t.map(function(l){var c={};e!=null&&e.composite&&(c.composite="auto");for(var u in l){var f=l[u];if(u==="offset"){if(f!==null){if(f=Number(f),!isFinite(f))throw new Error("Keyframe offsets must be numbers.");if(f<0||f>1)throw new Error("Keyframe offsets must be between 0 and 1.");c.computedOffset=f}}else if(u==="composite"&&["replace","add","accumulate","auto"].indexOf(f)===-1)throw new Error("".concat(f," compositing is not supported"));c[u]=f}return c.offset===void 0&&(c.offset=null),c.easing===void 0&&(c.easing=(e==null?void 0:e.easing)||"linear"),c.composite===void 0&&(c.composite="auto"),c}),r=!0,i=-1/0,o=0;o<n.length;o++){var a=n[o].offset;if(B1(a))r=!1;else{if(a<i)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=a}}n=n.filter(function(l){return Number(l.offset)>=0&&Number(l.offset)<=1});function s(){var l,c,u=n.length;n[u-1].computedOffset=Number((l=n[u-1].offset)!==null&&l!==void 0?l:1),u>1&&(n[0].computedOffset=Number((c=n[0].offset)!==null&&c!==void 0?c:0));for(var f=0,d=Number(n[0].computedOffset),h=1;h<u;h++){var p=n[h].computedOffset;if(!B1(p)&&!B1(d)){for(var v=1;v<h-f;v++)n[f+v].computedOffset=d+(Number(p)-d)*v/(h-f);f=h,d=Number(p)}}}return r||s(),n}var HK="backwards|forwards|both|none".split("|"),UK="reverse|alternate|alternate-reverse".split("|");function VK(t,e){var n=new WK;return e&&(n.fill="both",n.duration="auto"),typeof t=="number"&&!isNaN(t)?n.duration=t:t!==void 0&&Object.keys(t).forEach(function(r){if(t[r]!==void 0&&t[r]!==null&&t[r]!=="auto"){if((typeof n[r]=="number"||r==="duration")&&(typeof t[r]!="number"||isNaN(t[r]))||r==="fill"&&HK.indexOf(t[r])===-1||r==="direction"&&UK.indexOf(t[r])===-1)return;n[r]=t[r]}}),n}function XK(t,e){return t=qK(t!=null?t:{duration:"auto"}),VK(t,e)}function qK(t){return typeof t=="number"&&(isNaN(t)?t={duration:"auto"}:t={duration:t}),t}var KK=function(){function t(e,n,r){var i=this;this.composite="replace",this.iterationComposite="replace",this.target=e,this.timing=XK(r,!1),this.timing.effect=this,this.timing.activeDuration=TK(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=WC(n,this.timing),this.interpolations=RK(this.normalizedKeyframes,this.timing,this.target);var o=U.globalThis.Proxy;this.computedTiming=o?new o(this.timing,{get:function(a,s){return s==="duration"?a.duration==="auto"?0:a.duration:s==="fill"?a.fill==="auto"?"none":a.fill:s==="localTime"?i.animation&&i.animation.currentTime||null:s==="currentIteration"?!i.animation||i.animation.playState!=="running"?null:a.currentIteration||0:s==="progress"?!i.animation||i.animation.playState!=="running"?null:a.progress||0:a[s]},set:function(){return!0}}):this.timing}return t.prototype.applyInterpolations=function(){this.interpolations(this.target,Number(this.timeFraction))},t.prototype.update=function(e){return e===null?!1:(this.timeFraction=FK(this.timing.activeDuration,e,this.timing),this.timeFraction!==null)},t.prototype.getKeyframes=function(){return this.normalizedKeyframes},t.prototype.setKeyframes=function(e){this.normalizedKeyframes=WC(e)},t.prototype.getComputedTiming=function(){return this.computedTiming},t.prototype.getTiming=function(){return this.timing},t.prototype.updateTiming=function(e){var n=this;Object.keys(e||{}).forEach(function(r){n.timing[r]=e[r]})},t}();function GC(t,e){return Number(t.id)-Number(e.id)}var ZK=function(){function t(e){var n=this;this.document=e,this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.webAnimationsNextTick=function(r){n.currentTime=r,n.discardAnimations(),n.animations.length===0?n.timelineTicking=!1:n.requestAnimationFrame(n.webAnimationsNextTick)},this.processRafCallbacks=function(r){var i=n.rafCallbacks;n.rafCallbacks=[],r<Number(n.currentTime)&&(r=Number(n.currentTime)),n.animations.sort(GC),n.animations=n.tick(r,!0,n.animations)[0],i.forEach(function(o){o[1](r)}),n.applyPendingEffects()}}return t.prototype.getAnimations=function(){return this.discardAnimations(),this.animations.slice()},t.prototype.isTicking=function(){return this.inTick},t.prototype.play=function(e,n,r){var i=new KK(e,n,r),o=new hK(i,this);return this.animations.push(o),this.restartWebAnimationsNextTick(),o.updatePromises(),o.play(),o.updatePromises(),o},t.prototype.applyDirtiedAnimation=function(e){var n=this;if(!this.inTick){e.markTarget();var r=e.targetAnimations();r.sort(GC);var i=this.tick(Number(this.currentTime),!1,r.slice())[1];i.forEach(function(o){var a=n.animations.indexOf(o);a!==-1&&n.animations.splice(a,1)}),this.applyPendingEffects()}},t.prototype.restart=function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame(function(){}),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame},t.prototype.destroy=function(){this.document.defaultView.cancelAnimationFrame(this.frameId)},t.prototype.applyPendingEffects=function(){this.pendingEffects.forEach(function(e){e==null||e.applyInterpolations()}),this.pendingEffects=[]},t.prototype.updateAnimationsPromises=function(){this.animationsWithPromises=this.animationsWithPromises.filter(function(e){return e.updatePromises()})},t.prototype.discardAnimations=function(){this.updateAnimationsPromises(),this.animations=this.animations.filter(function(e){return e.playState!=="finished"&&e.playState!=="idle"})},t.prototype.restartWebAnimationsNextTick=function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))},t.prototype.rAF=function(e){var n=this.rafId++;return this.rafCallbacks.length===0&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([n,e]),n},t.prototype.requestAnimationFrame=function(e){var n=this;return this.rAF(function(r){n.updateAnimationsPromises(),e(r),n.updateAnimationsPromises()})},t.prototype.tick=function(e,n,r){var i,o,a=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=e,this.ticking=!1;var s=[],l=[],c=[],u=[];return r.forEach(function(f){f.tick(e,n),f._inEffect?(l.push(f.effect),f.markTarget()):(s.push(f.effect),f.unmarkTarget()),f._needsTick&&(a.ticking=!0);var d=f._inEffect||f._needsTick;f._inTimeline=d,d?c.push(f):u.push(f)}),(i=this.pendingEffects).push.apply(i,Q([],D(s),!1)),(o=this.pendingEffects).push.apply(o,Q([],D(l),!1)),this.ticking&&this.requestAnimationFrame(function(){}),this.inTick=!1,[c,u]},t}();U.EasingFunction=G1,U.AnimationTimeline=ZK;function gt(t){return new Fp([t],null,t,t.ownerDocument)}let Fp=class xn{constructor(e=null,n=null,r=null,i=null,o=[null,null,null,null,null],a=[],s=[]){this._elements=Array.from(e),this._data=n,this._parent=r,this._document=i,this._enter=o[0],this._update=o[1],this._exit=o[2],this._merge=o[3],this._split=o[4],this._transitions=a,this._facetElements=s}selectAll(e){const n=typeof e=="string"?this._parent.querySelectorAll(e):e;return new xn(n,null,this._elements[0],this._document)}selectFacetAll(e){const n=typeof e=="string"?this._parent.querySelectorAll(e):e;return new xn(this._elements,null,this._parent,this._document,void 0,void 0,n)}select(e){const n=typeof e=="string"?this._parent.querySelectorAll(e)[0]||null:e;return new xn([n],null,n,this._document)}append(e){const n=typeof e=="function"?e:()=>this.createElement(e),r=[];if(this._data!==null){for(let i=0;i<this._data.length;i++){const o=this._data[i],[a,s]=Array.isArray(o)?o:[o,null],l=n(a,i);l.__data__=a,s!==null&&(l.__fromElements__=s),this._parent.appendChild(l),r.push(l)}return new xn(r,null,this._parent,this._document)}else{for(let i=0;i<this._elements.length;i++){const o=this._elements[i],a=o.__data__,s=n(a,i);o.appendChild(s),r.push(s)}return new xn(r,null,r[0],this._document)}}maybeAppend(e,n,r){const i=this._elements[0],o=i.getElementById(e);if(o)return new xn([o],null,this._parent,this._document);const a=typeof n=="string"?this.createElement(n):n();return a.id=e,r&&(a.className=r),i.appendChild(a),new xn([a],null,this._parent,this._document)}data(e,n=i=>i,r=()=>null){const i=[],o=[],a=new Set(this._elements),s=[],l=new Set,c=new Map(this._elements.map((h,p)=>[n(h.__data__,p),h])),u=new Map(this._facetElements.map((h,p)=>[n(h.__data__,p),h])),f=xe(this._elements,h=>r(h.__data__));for(let h=0;h<e.length;h++){const p=e[h],v=n(p,h),g=r(p,h);if(c.has(v)){const y=c.get(v);y.__data__=p,y.__facet__=!1,o.push(y),a.delete(y),c.delete(v)}else if(u.has(v)){const y=u.get(v);y.__data__=p,y.__facet__=!0,o.push(y),u.delete(v)}else if(f.has(v)){const y=f.get(v);s.push([p,y]);for(const m of y)a.delete(m);f.delete(v)}else if(c.has(g)){const y=c.get(g);y.__toData__?y.__toData__.push(p):y.__toData__=[p],l.add(y),a.delete(y)}else i.push(p)}const d=[new xn([],i,this._parent,this._document),new xn(o,null,this._parent,this._document),new xn(a,null,this._parent,this._document),new xn([],s,this._parent,this._document),new xn(l,null,this._parent,this._document)];return new xn(this._elements,null,this._parent,this._document,d)}merge(e){const n=[...this._elements,...e._elements],r=[...this._transitions,...e._transitions];return new xn(n,null,this._parent,this._document,void 0,r)}createElement(e){if(this._document)return this._document.createElement(e,{});const n=xn.registry[e];return n?new n:ml(`Unknown node type: ${e}`)}join(e=a=>a,n=a=>a,r=a=>a.remove(),i=a=>a,o=a=>a.remove()){const a=e(this._enter),s=n(this._update),l=r(this._exit),c=i(this._merge),u=o(this._split);return s.merge(a).merge(l).merge(c).merge(u)}remove(){for(let e=0;e<this._elements.length;e++){const n=this._transitions[e];if(n){const r=Array.isArray(n)?n:[n];Promise.all(r.map(i=>i.finished)).then(()=>{this._elements[e].remove()})}else this._elements[e].remove()}return new xn([],null,this._parent,this._document,void 0,this._transitions)}each(e){for(let n=0;n<this._elements.length;n++){const r=this._elements[n],i=r.__data__;e(i,n,r)}return this}attr(e,n){const r=typeof n!="function"?()=>n:n;return this.each(function(i,o,a){n!==void 0&&(a[e]=r(i,o,a))})}style(e,n){const r=typeof n!="function"?()=>n:n;return this.each(function(i,o,a){n!==void 0&&(a.style[e]=r(i,o,a))})}transition(e){const n=typeof e!="function"?()=>e:e,{_transitions:r}=this;return this.each(function(i,o,a){r[o]=n(i,o,a)})}on(e,n){return this.each(function(r,i,o){o.addEventListener(e,n)}),this}call(e,...n){return e(this,...n),this}node(){return this._elements[0]}nodes(){return this._elements}transitions(){return this._transitions}parent(){return this._parent}};Fp.registry={g:sn,rect:hs,circle:nf,path:Dn,text:jr,ellipse:j1,image:D1,line:rf,polygon:of,polyline:$1,html:Op};function Rp(t,e,n){return Math.max(e,Math.min(t,n))}function Bp(t,e=10){return typeof t!="number"||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(e))}function ft(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}function QK(t,e){return e.forEach((n,r)=>r===0?t.moveTo(n[0],n[1]):t.lineTo(n[0],n[1])),t.closePath(),t}function JK(t,e,n){const{arrowSize:r}=n,i=typeof r=="string"?+parseFloat(r)/100*we(t,e):r,o=Math.PI/6,a=Math.atan2(e[1]-t[1],e[0]-t[0]),s=Math.PI/2-a-o,l=[e[0]-i*Math.sin(s),e[1]-i*Math.cos(s)],c=a-o,u=[e[0]-i*Math.cos(c),e[1]-i*Math.sin(c)];return[l,u]}function lf(t,e,n,r,i){const o=Lr(ke(r,e))+Math.PI,a=Lr(ke(r,n))+Math.PI;return t.arc(r[0],r[1],i,o,a,a-o<0),t}function HC(t,e,n,r="y",i="between",o=!1){const a=(g,y)=>g==="y"||g===!0?y?180:90:y?90:0,s=r==="y"||r===!0?n:e,l=a(r,o),c=Ja(s),[u,f]=no(c,g=>s[g]),d=new oo({domain:[u,f],range:[0,100]}),h=g=>Va(s[g])&&!Number.isNaN(s[g])?d.map(s[g]):0,p={between:g=>`${t[g]} ${h(g)}%`,start:g=>g===0?`${t[g]} ${h(g)}%`:`${t[g-1]} ${h(g)}%, ${t[g]} ${h(g)}%`,end:g=>g===t.length-1?`${t[g]} ${h(g)}%`:`${t[g]} ${h(g)}%, ${t[g+1]} ${h(g)}%`},v=c.sort((g,y)=>h(g)-h(y)).map(p[i]||p.between).join(",");return`linear-gradient(${l}deg, ${v})`}function zp(t){const[e,n,r,i]=t;return[i,e,n,r]}function vs(t,e,n){const[r,i,,o]=he(t)?zp(e):e,[a,s]=n,l=t.getCenter(),c=wl(ke(r,l)),u=wl(ke(i,l)),f=u===c&&a!==s?u+Math.PI*2:u;return{startAngle:c,endAngle:f-c>=0?f:Math.PI*2+f,innerRadius:we(o,l),outerRadius:we(r,l)}}function UC(t){const{colorAttribute:e,opacityAttribute:n=e}=t;return`${n}Opacity`}function VC(t,e){if(!ce(t))return"";const n=t.getCenter(),{transform:r}=e;return`translate(${n[0]}, ${n[1]}) ${r||""}`}function XC(t){if(t.length===1)return t[0];const[[e,n,r=0],[i,o,a=0]]=t;return[(e+i)/2,(n+o)/2,(r+a)/2]}var Yp=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function qC(t,e,n,r,i={}){const{inset:o=0,radius:a=0,insetLeft:s=o,insetTop:l=o,insetRight:c=o,insetBottom:u=o,radiusBottomLeft:f=a,radiusBottomRight:d=a,radiusTopLeft:h=a,radiusTopRight:p=a,minWidth:v=-1/0,maxWidth:g=1/0,minHeight:y=-1/0}=i,m=Yp(i,["inset","radius","insetLeft","insetTop","insetRight","insetBottom","radiusBottomLeft","radiusBottomRight","radiusTopLeft","radiusTopRight","minWidth","maxWidth","minHeight"]);if(!ce(r)&&!XP(r)){const S=!!he(r),[E,,M]=S?zp(e):e,[P,C]=E,[A,T]=ke(M,E),k=A>0?P:P+A,N=T>0?C:C+T,j=Math.abs(A),L=Math.abs(T),I=k+s,$=N+l,F=j-(s+c),R=L-(l+u),B=S?Rp(F,y,1/0):Rp(F,v,g),W=S?Rp(R,v,g):Rp(R,y,1/0),K=S?I:I-(B-F)/2,J=S?$-(W-R)/2:$-(W-R);return gt(t.createElement("rect",{})).style("x",K).style("y",J).style("width",B).style("height",W).style("radius",[h,p,d,f]).call(ft,m).node()}const{y:b,y1:x}=n,w=r.getCenter(),O=vs(r,e,[b,x]),_=qh().cornerRadius(a).padAngle(o*Math.PI/180);return gt(t.createElement("path",{})).style("path",_(O)).style("transform",`translate(${w[0]}, ${w[1]})`).style("radius",a).style("inset",o).call(ft,m).node()}const cf=(t,e)=>{const{colorAttribute:n,opacityAttribute:r="fill",first:i=!0,last:o=!0}=t,a=Yp(t,["colorAttribute","opacityAttribute","first","last"]),{coordinate:s,document:l}=e;return(c,u,f)=>{const{color:d,radius:h=0}=f,p=Yp(f,["color","radius"]),v=p.lineWidth||1,{stroke:g,radius:y=h,radiusTopLeft:m=y,radiusTopRight:b=y,radiusBottomRight:x=y,radiusBottomLeft:w=y,innerRadius:O=0,innerRadiusTopLeft:_=O,innerRadiusTopRight:S=O,innerRadiusBottomRight:E=O,innerRadiusBottomLeft:M=O,lineWidth:P=n==="stroke"||g?v:0,inset:C=0,insetLeft:A=C,insetRight:T=C,insetBottom:k=C,insetTop:N=C,minWidth:j,maxWidth:L,minHeight:I}=a,$=Yp(a,["stroke","radius","radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft","innerRadius","innerRadiusTopLeft","innerRadiusTopRight","innerRadiusBottomRight","innerRadiusBottomLeft","lineWidth","inset","insetLeft","insetRight","insetBottom","insetTop","minWidth","maxWidth","minHeight"]),{color:F=d,opacity:R}=u,B=[i?m:_,i?b:S,o?x:E,o?w:M],W=["radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft"];he(s)&&W.push(W.shift());const K=Object.assign(Object.assign({radius:y},Object.fromEntries(W.map((J,X)=>[J,B[X]]))),{inset:C,insetLeft:A,insetRight:T,insetBottom:k,insetTop:N,minWidth:j,maxWidth:L,minHeight:I});return gt(qC(l,c,u,s,K)).call(ft,p).style("fill","transparent").style(n,F).style(UC(t),R).style("lineWidth",P).style("stroke",g===void 0?F:g).call(ft,$).node()}};cf.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const gs=(t,e)=>cf(Object.assign({colorAttribute:"fill"},t),e);gs.props=Object.assign(Object.assign({},cf.props),{defaultMarker:"square"});const Wp=(t,e)=>cf(Object.assign({colorAttribute:"stroke"},t),e);Wp.props=Object.assign(Object.assign({},cf.props),{defaultMarker:"hollowSquare"});var KC=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function tZ(t,e,n){const[r,i,o,a]=t;if(he(n)){const c=[e?e[0][0]:i[0],i[1]],u=[e?e[3][0]:o[0],o[1]];return[r,c,u,a]}const s=[i[0],e?e[0][1]:i[1]],l=[o[0],e?e[3][1]:o[1]];return[r,s,l,a]}const U1=(t,e)=>{const{adjustPoints:n=tZ}=t,r=KC(t,["adjustPoints"]),{coordinate:i,document:o}=e;return(a,s,l,c)=>{const{index:u}=s,{color:f}=l,d=KC(l,["color"]),h=c[u+1],p=n(a,h,i),v=!!he(i),[g,y,m,b]=v?zp(p):p,{color:x=f,opacity:w}=s,O=Ko().curve(Gm)([g,y,m,b]);return gt(o.createElement("path",{})).call(ft,d).style("path",O).style("fill",x).style("fillOpacity",w).call(ft,r).node()}};U1.props={defaultMarker:"square"};function eZ(t,e,n){const[r,i,o,a]=t;if(he(n)){const c=[e?e[0][0]:(i[0]+o[0])/2,i[1]],u=[e?e[3][0]:(i[0]+o[0])/2,o[1]];return[r,c,u,a]}const s=[i[0],e?e[0][1]:(i[1]+o[1])/2],l=[o[0],e?e[3][1]:(i[1]+o[1])/2];return[r,s,l,a]}const ZC=(t,e)=>U1(Object.assign({adjustPoints:eZ},t),e);ZC.props={defaultMarker:"square"};function Dl(t){const e=typeof t=="function"?t:t.render;return class extends wp{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){e(this)}}}var QC=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const nZ=Dl(t=>{const{d1:e,d2:n,style1:r,style2:i}=t.attributes,o=t.ownerDocument;gt(t).maybeAppend("line",()=>o.createElement("path",{})).style("d",e).call(ft,r),gt(t).maybeAppend("line1",()=>o.createElement("path",{})).style("d",n).call(ft,i)});function rZ(t,e){const n=[],r=[];let i=!1,o=null;for(const a of t)!e(a[0])||!e(a[1])?i=!0:(n.push(a),i&&(i=!1,r.push([o,a])),o=a);return[n,r]}const Rr=(t,e)=>{const{curve:n,gradient:r=!1,gradientColor:i="between",defined:o=u=>!Number.isNaN(u)&&u!==void 0&&u!==null,connect:a=!1}=t,s=QC(t,["curve","gradient","gradientColor","defined","connect"]),{coordinate:l,document:c}=e;return(u,f,d)=>{const{color:h,lineWidth:p}=d,v=QC(d,["color","lineWidth"]),{color:g=h,size:y=p,seriesColor:m,seriesX:b,seriesY:x}=f,w=VC(l,f),O=he(l),_=r&&m?HC(m,b,x,r,i,O):g,S=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},v),_&&{stroke:_}),y&&{lineWidth:y}),w&&{transform:w}),s);let E;if(ce(l)){const k=l.getCenter();E=N=>kH().angle((j,L)=>wl(ke(N[L],k))).radius((j,L)=>we(N[L],k)).defined(([j,L])=>o(j)&&o(L)).curve(n)(N)}else E=Ko().x(k=>k[0]).y(k=>k[1]).defined(([k,N])=>o(k)&&o(N)).curve(n);const[M,P]=rZ(u,o),C=ot(S,"connect"),A=!!P.length;if(!A||a&&!Object.keys(C).length)return gt(c.createElement("path",{})).style("d",E(M)||[]).call(ft,S).node();if(A&&!a)return gt(c.createElement("path",{})).style("d",E(u)).call(ft,S).node();const T=k=>k.map(E).join(",");return gt(new nZ).style("style1",Object.assign(Object.assign({},S),C)).style("style2",S).style("d1",T(P)).style("d2",E(u)).node()}};Rr.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const JC=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=ce(n)?Gm:zu;return Rr(Object.assign({curve:i},t),e)(...r)}};JC.props=Object.assign(Object.assign({},Rr.props),{defaultMarker:"line"});var iZ=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const tT=(t,e)=>{const n=iZ(t,[]),{coordinate:r}=e;return(...i)=>{const o=ce(r)?DP:he(r)?GP:WP;return Rr(Object.assign({curve:o},n),e)(...i)}};tT.props=Object.assign(Object.assign({},Rr.props),{defaultMarker:"smooth"});const eT=(t,e)=>Rr(Object.assign({curve:VP},t),e);eT.props=Object.assign(Object.assign({},Rr.props),{defaultMarker:"hv"});const nT=(t,e)=>Rr(Object.assign({curve:UP},t),e);nT.props=Object.assign(Object.assign({},Rr.props),{defaultMarker:"vh"});const rT=(t,e)=>Rr(Object.assign({curve:HP},t),e);rT.props=Object.assign(Object.assign({},Rr.props),{defaultMarker:"hvh"});var oZ=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function aZ(t,e,n,r,i){const o=ke(n,e),a=Lr(o),s=a+Math.PI/2,l=[r/2*Math.cos(s),r/2*Math.sin(s)],c=[i/2*Math.cos(s),i/2*Math.sin(s)],u=[i/2*Math.cos(a),i/2*Math.sin(a)],f=[r/2*Math.cos(a),r/2*Math.sin(a)],d=Uh(e,l),h=Uh(n,c),p=Uh(h,u),v=Uh(n,u),g=ke(v,c),y=ke(n,c),m=ke(e,l),b=ke(m,f),x=ke(e,f),w=ke(d,f);t.moveTo(...d),t.lineTo(...h),t.arcTo(...p,...v,i/2),t.arcTo(...g,...y,i/2),t.lineTo(...m),t.arcTo(...b,...x,r/2),t.arcTo(...w,...d,r/2),t.closePath()}const iT=(t,e)=>{const{document:n}=e;return(r,i,o)=>{const{seriesSize:a,color:s}=i,{color:l}=o,c=oZ(o,["color"]),u=Nr();for(let f=0;f<r.length-1;f++){const d=r[f],h=r[f+1],p=a[f],v=a[f+1];[...d,...h].every(ie)&&aZ(u,d,h,p,v)}return gt(n.createElement("path",{})).call(ft,c).style("fill",s||l).style("d",u.toString()).call(ft,t).node()}};iT.props=Object.assign(Object.assign({},Rr.props),{defaultMarker:"line"});var sZ=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const V1=(t,e,n)=>[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]];V1.style=["fill"];const oT=V1.bind(void 0);oT.style=["stroke","lineWidth"];const Gp=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]];Gp.style=["fill"];const aT=Gp.bind(void 0);aT.style=["fill"];const sT=Gp.bind(void 0);sT.style=["stroke","lineWidth"];const X1=(t,e,n)=>{const r=n*.618;return[["M",t-r,e],["L",t,e-n],["L",t+r,e],["L",t,e+n],["Z"]]};X1.style=["fill"];const lT=X1.bind(void 0);lT.style=["stroke","lineWidth"];const q1=(t,e,n)=>{const r=n*Math.sin(.3333333333333333*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]};q1.style=["fill"];const cT=q1.bind(void 0);cT.style=["stroke","lineWidth"];const K1=(t,e,n)=>{const r=n*Math.sin(.3333333333333333*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]};K1.style=["fill"];const uT=K1.bind(void 0);uT.style=["stroke","lineWidth"];const Z1=(t,e,n)=>{const r=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+r,e-n/2],["L",t+r,e+n/2],["L",t,e+n],["L",t-r,e+n/2],["L",t-r,e-n/2],["Z"]]};Z1.style=["fill"];const fT=Z1.bind(void 0);fT.style=["stroke","lineWidth"];const Q1=(t,e,n)=>{const r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]};Q1.style=["fill"];const dT=Q1.bind(void 0);dT.style=["stroke","lineWidth"];const hT=(t,e,n)=>[["M",t,e+n],["L",t,e-n]];hT.style=["stroke","lineWidth"];const pT=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]];pT.style=["stroke","lineWidth"];const vT=(t,e,n)=>[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]];vT.style=["stroke","lineWidth"];const gT=(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]];gT.style=["stroke","lineWidth"];const yT=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];yT.style=["stroke","lineWidth"];const J1=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];J1.style=["stroke","lineWidth"];const mT=J1.bind(void 0);mT.style=["stroke","lineWidth"];const bT=(t,e,n)=>[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]];bT.style=["stroke","lineWidth"];const xT=(t,e,n)=>[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]];xT.style=["stroke","lineWidth"];const wT=(t,e,n)=>[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]];wT.style=["stroke","lineWidth"];const OT=(t,e,n)=>[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]];OT.style=["stroke","lineWidth"];const _T=(t,e,n)=>[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]];_T.style=["stroke","lineWidth"];const Hp=new Map([["bowtie",Q1],["cross",pT],["dash",mT],["diamond",X1],["dot",J1],["hexagon",Z1],["hollowBowtie",dT],["hollowDiamond",lT],["hollowHexagon",fT],["hollowPoint",oT],["hollowSquare",sT],["hollowTriangle",cT],["hollowTriangleDown",uT],["hv",xT],["hvh",OT],["hyphen",yT],["line",hT],["plus",gT],["point",V1],["rect",aT],["smooth",bT],["square",Gp],["tick",vT],["triangleDown",K1],["triangle",q1],["vh",wT],["vhv",_T]]);function lZ(t,e){var{d:n,fill:r,strokeWidth:i,path:o,stroke:a,lineWidth:s,color:l}=e,c=sZ(e,["d","fill","strokeWidth","path","stroke","lineWidth","color"]);const u=Hp.get(t)||Hp.get("point");return(...f)=>new Dn({style:Object.assign(Object.assign({},c),{path:u(...f),stroke:u.style.includes("stroke")?l||a:"",fill:u.style.includes("fill")?l||r:"",lineWidth:u.style.includes("lineWidth")?s||s||2:0})})}var cZ=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function uZ(t,e,n,r){if(e.length===1)return;const{size:i}=n;if(t==="fixed")return i;if(t==="normal"||qP(r)){const[[o,a],[s,l]]=e,c=Math.abs((s-o)/2),u=Math.abs((l-a)/2);return Math.max(0,(c+u)/2)}return i}const kt=(t,e)=>{const{colorAttribute:n,symbol:r,mode:i="auto"}=t,o=cZ(t,["colorAttribute","symbol","mode"]),a=Hp.get(r)||Hp.get("point"),{coordinate:s,document:l}=e;return(c,u,f)=>{const{lineWidth:d,color:h}=f,p=o.stroke?d||1:d,{color:v=h,transform:g,opacity:y}=u,[m,b]=XC(c),w=uZ(i,c,u,s)||o.r||f.r;return gt(l.createElement("path",{})).call(ft,f).style("fill","transparent").style("d",a(m,b,w)).style("lineWidth",p).style("transform",g).style("stroke",v).style(UC(t),y).style(n,v).call(ft,o).node()}};kt.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const ST=(t,e)=>kt(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t),e);ST.props=Object.assign({defaultMarker:"hollowBowtie"},kt.props);const ET=(t,e)=>kt(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t),e);ET.props=Object.assign({defaultMarker:"hollowDiamond"},kt.props);const MT=(t,e)=>kt(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t),e);MT.props=Object.assign({defaultMarker:"hollowHexagon"},kt.props);const PT=(t,e)=>kt(Object.assign({colorAttribute:"stroke",symbol:"point"},t),e);PT.props=Object.assign({defaultMarker:"hollowPoint"},kt.props);const AT=(t,e)=>kt(Object.assign({colorAttribute:"stroke",symbol:"square"},t),e);AT.props=Object.assign({defaultMarker:"hollowSquare"},kt.props);const CT=(t,e)=>kt(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t),e);CT.props=Object.assign({defaultMarker:"hollowTriangle"},kt.props);const TT=(t,e)=>kt(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t),e);TT.props=Object.assign({defaultMarker:"hollowTriangleDown"},kt.props);const kT=(t,e)=>kt(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t),e);kT.props=Object.assign({defaultMarker:"bowtie"},kt.props);const LT=(t,e)=>kt(Object.assign({colorAttribute:"stroke",symbol:"cross"},t),e);LT.props=Object.assign({defaultMarker:"cross"},kt.props);const NT=(t,e)=>kt(Object.assign({colorAttribute:"fill",symbol:"diamond"},t),e);NT.props=Object.assign({defaultMarker:"diamond"},kt.props);const IT=(t,e)=>kt(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t),e);IT.props=Object.assign({defaultMarker:"hexagon"},kt.props);const jT=(t,e)=>kt(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t),e);jT.props=Object.assign({defaultMarker:"hyphen"},kt.props);const DT=(t,e)=>kt(Object.assign({colorAttribute:"stroke",symbol:"line"},t),e);DT.props=Object.assign({defaultMarker:"line"},kt.props);const $T=(t,e)=>kt(Object.assign({colorAttribute:"stroke",symbol:"plus"},t),e);$T.props=Object.assign({defaultMarker:"plus"},kt.props);const FT=(t,e)=>kt(Object.assign({colorAttribute:"fill",symbol:"point"},t),e);FT.props=Object.assign({defaultMarker:"point"},kt.props);const RT=(t,e)=>kt(Object.assign({colorAttribute:"fill",symbol:"square"},t),e);RT.props=Object.assign({defaultMarker:"square"},kt.props);const BT=(t,e)=>kt(Object.assign({colorAttribute:"stroke",symbol:"tick"},t),e);BT.props=Object.assign({defaultMarker:"tick"},kt.props);const zT=(t,e)=>kt(Object.assign({colorAttribute:"fill",symbol:"triangle"},t),e);zT.props=Object.assign({defaultMarker:"triangle"},kt.props);const YT=(t,e)=>kt(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t),e);YT.props=Object.assign({defaultMarker:"triangleDown"},kt.props);var WT=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const tb=(t,e)=>{const{arrow:n=!0,arrowSize:r="40%"}=t,i=WT(t,["arrow","arrowSize"]),{document:o}=e;return(a,s,l)=>{const{defaultColor:c}=l,u=WT(l,["defaultColor"]),{color:f=c,transform:d}=s,[h,p]=a,v=Nr();if(v.moveTo(...h),v.lineTo(...p),n){const[g,y]=JK(h,p,{arrowSize:r});v.moveTo(...p),v.lineTo(...g),v.moveTo(...p),v.lineTo(...y)}return gt(o.createElement("path",{})).call(ft,u).style("d",v.toString()).style("stroke",f).style("transform",d).call(ft,i).node()}};tb.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var fZ=function(t){return t!==null&&typeof t!="function"&&isFinite(t.length)};const GT=fZ,Br=function(t){return typeof t=="function"};var dZ=function(t){return t==null};const eb=dZ;var hZ={}.toString,pZ=function(t,e){return hZ.call(t)==="[object "+e+"]"};const Up=pZ,uo=function(t){return Array.isArray?Array.isArray(t):Up(t,"Array")},HT=function(t){var e=typeof t;return t!==null&&e==="object"||e==="function"};var vZ=function(t){return typeof t=="object"&&t!==null};const nb=vZ;var gZ=function(t){if(!nb(t)||!Up(t,"Object"))return!1;if(Object.getPrototypeOf(t)===null)return!0;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};const Vp=gZ,UT=function(t){if(uo(t))return t.reduce(function(e,n){return Math.max(e,n)},t[0])},VT=function(t){if(uo(t))return t.reduce(function(e,n){return Math.min(e,n)},t[0])},$l=function(t){return Up(t,"String")};var yZ=function(t,e,n){return t<e?e:t>n?n:t};const fo=yZ;var mZ=function(t){return Up(t,"Number")};const Xp=mZ,bZ=function(t,e){if(uo(t)){for(var n,r=-1/0,i=0;i<t.length;i++){var o=t[i],a=Br(e)?e(o):o[e];a>r&&(n=o,r=a)}return n}},xZ=function(t,e){if(uo(t)){for(var n,r=1/0,i=0;i<t.length;i++){var o=t[i],a=Br(e)?e(o):o[e];a<r&&(n=o,r=a)}return n}};function wZ(t,e){return!t||!e?t:t.replace(/\\?\{([^{}]+)\}/g,function(n,r){return n.charAt(0)==="\\"?n.slice(1):e[r]===void 0?"":e[r]})}var OZ=function(t){return t===void 0};const _Z=OZ;var rb=function(t){if(typeof t!="object"||t===null)return t;var e;if(uo(t)){e=[];for(var n=0,r=t.length;n<r;n++)typeof t[n]=="object"&&t[n]!=null?e[n]=rb(t[n]):e[n]=t[n]}else{e={};for(var i in t)typeof t[i]=="object"&&t[i]!=null?e[i]=rb(t[i]):e[i]=t[i]}return e};const ib=rb;function SZ(t,e,n){var r;return function(){var i=this,o=arguments,a=function(){r=null,n||t.apply(i,o)},s=n&&!r;clearTimeout(r),r=setTimeout(a,e),s&&t.apply(i,o)}}function EZ(t){var e,n,r,i=t||1;function o(s,l){++e>i&&(r=n,a(1),++e),n[s]=l}function a(s){e=0,n=Object.create(null),s||(r=Object.create(null))}return a(),{clear:a,has:function(s){return n[s]!==void 0||r[s]!==void 0},get:function(s){var l=n[s];if(l!==void 0)return l;if((l=r[s])!==void 0)return o(s,l),l},set:function(s,l){n[s]!==void 0?n[s]=l:o(s,l)}}}const MZ=function(t,e,n){if(n===void 0&&(n=128),!Br(t))throw new TypeError("Expected a function");var r=function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];var a=e?e.apply(this,i):i[0],s=r.cache;if(s.has(a))return s.get(a);var l=t.apply(this,i);return s.set(a,l),l};return r.cache=EZ(n),r};var PZ=5;function AZ(t,e){if(Object.hasOwn)return Object.hasOwn(t,e);if(t==null)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(t),e)}function XT(t,e,n,r){n=n||0,r=r||PZ;for(var i in e)if(AZ(e,i)){var o=e[i];o!==null&&Vp(o)?(Vp(t[i])||(t[i]={}),n<r?XT(t[i],o,n+1,r):t[i]=e[i]):uo(o)?(t[i]=[],t[i]=t[i].concat(o)):o!==void 0&&(t[i]=o)}}var CZ=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)XT(t,e[r]);return t};const qp=CZ;var ob=function(t,e){if(t===e)return!0;if(!t||!e||$l(t)||$l(e))return!1;if(GT(t)||GT(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;r<t.length&&(n=ob(t[r],e[r]),!!n);r++);return n}if(nb(t)||nb(e)){var i=Object.keys(t),o=Object.keys(e);if(i.length!==o.length)return!1;for(var n=!0,r=0;r<i.length&&(n=ob(t[i[r]],e[i[r]]),!!n);r++);return n}return!1};const TZ=ob,qT=function(t,e,n){for(var r=0,i=$l(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return t===void 0||r<i.length?n:t},kZ=function(t,e,n){var r=t,i=$l(e)?e.split("."):e;return i.forEach(function(o,a){a<i.length-1?(HT(r[o])||(r[o]=Xp(i[a+1])?[]:{}),r=r[o]):r[o]=n}),t},ab=function(){};function KT(t){var e=document.createElement("div");e.innerHTML=t;var n=e.childNodes[0];return n&&e.contains(n)&&e.removeChild(n),n}function ZT(t,e){e(t),t.children&&t.children.forEach(function(n){n&&ZT(n,e)})}function uf(t){Kp(t,!0)}function ra(t){Kp(t,!1)}function Kp(t,e){var n=e?"visible":"hidden";ZT(t,function(r){r.attr("visibility",n)})}var LZ=function(t){st(e,t);function e(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=t.apply(this,Q([],D(n),!1))||this;return i.addEventListener(St.INSERTED,function(){ra(i)}),i}return e}(sn);function QT(t){var e=t.appendChild(new LZ({class:"offscreen"}));return ra(e),e}function NZ(t){for(var e=t;e;){if(e.className==="offscreen")return!0;e=e.parent}return!1}var sb=function(t){st(e,t);function e(n){n===void 0&&(n={});var r=n.style,i=Qt(n,["style"]);return t.call(this,G({style:G({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},r)},i))||this}return Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=QT(this)),this._offscreen},enumerable:!1,configurable:!0}),e.prototype.disconnectedCallback=function(){var n;(n=this._offscreen)===null||n===void 0||n.destroy()},e}(jr);function Fl(t){return t*Math.PI/180}function JT(t){return Number((t*180/Math.PI).toPrecision(5))}var Oe=function(){function t(e,n,r,i){e===void 0&&(e=0),n===void 0&&(n=0),r===void 0&&(r=0),i===void 0&&(i=0),this.x=0,this.y=0,this.width=0,this.height=0,this.x=e,this.y=n,this.width=r,this.height=i}return Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t.prototype.toJSON=function(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.top,right:this.right,bottom:this.bottom,left:this.left}},t.prototype.isPointIn=function(e,n){return e>=this.left&&e<=this.right&&n>=this.top&&n<=this.bottom},t}();function zr(t,e){return Br(t)?t.apply(void 0,Q([],D(e),!1)):t}var Yr=function(t,e){var n=function(i){return"".concat(e,"-").concat(i)},r=Object.fromEntries(Object.entries(t).map(function(i){var o=D(i,2),a=o[0],s=o[1],l=n(s);return[a,{name:l,class:".".concat(l),id:"#".concat(l),toString:function(){return l}}]}));return Object.assign(r,{prefix:n}),r},IZ=5,tk=function(t,e,n,r){n===void 0&&(n=0),r===void 0&&(r=IZ),Object.entries(e).forEach(function(i){var o=D(i,2),a=o[0],s=o[1],l=t;Object.prototype.hasOwnProperty.call(e,a)&&(s?Vp(s)?(Vp(t[a])||(l[a]={}),n<r?tk(t[a],s,n+1,r):l[a]=e[a]):uo(s)?(l[a]=[],l[a]=l[a].concat(s)):l[a]=s:l[a]=s)})},ho=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)tk(t,e[r]);return t},ek=function(t){return t!==void 0&&t!=null&&!Number.isNaN(t)},Zp,jZ=MZ(function(t,e){var n=e.fontSize,r=e.fontFamily,i=e.fontWeight,o=e.fontStyle,a=e.fontVariant;return Zp||(Zp=U.offscreenCanvasCreator.getOrCreateContext(void 0)),Zp.font=[o,a,i,"".concat(n,"px"),r].join(" "),Zp.measureText(t).width},function(t,e){return[t,Object.values(e||nk(t)).join()].join("")},4096),nk=function(t){var e=t.style.fontFamily||"sans-serif",n=t.style.fontWeight||"normal",r=t.style.fontStyle||"normal",i=t.style.fontVariant,o=t.style.fontSize;return o=typeof o=="object"?o.value:o,{fontSize:o,fontFamily:e,fontWeight:n,fontStyle:r,fontVariant:i}};function rk(t){return t.nodeName==="text"?t:t.nodeName==="g"&&t.children.length===1&&t.children[0].nodeName==="text"?t.children[0]:null}function ik(t,e){var n=rk(t);n&&n.attr(e)}function lb(t,e,n){n===void 0&&(n="..."),ik(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n})}function DZ(t,e,n,r){n===void 0&&(n=2),r===void 0&&(r="top"),ik(t,{wordWrap:!0,wordWrapWidth:e,maxLines:n,textBaseline:r})}function Qp(t){var e=t.canvas,n=t.touches,r=t.offsetX,i=t.offsetY;if(e){var o=e.x,a=e.y;return[o,a]}if(n){var s=n[0],l=s.clientX,c=s.clientY;return[l,c]}return r&&i?[r,i]:[0,0]}function ys(t){return typeof t=="function"?t():$l(t)||Xp(t)?new sb({style:{text:String(t)}}):t}function $Z(t,e){return t.reduce(function(n,r){return(n[r[e]]=n[r[e]]||[]).push(r),n},{})}function Jn(t,e,n,r,i){return r===void 0&&(r=!0),i===void 0&&(i=function(o){o.node().removeChildren()}),t?n(e):(r&&i(e),null)}function vn(t,e,n,r,i){return r===void 0&&(r=!0),i===void 0&&(i=!1),r&&t===e||i&&t===n?!0:t>e&&t<n}var FZ=function(t,e){return function(n){return t*(1-n)+e*n}};function RZ(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0;return function(i){var o=new Array(r),a=new Array(n),s=0;for(s=0;s<r;++s)o[s]=cb(t[s],e[s]);for(;s<n;++s)a[s]=e[s];for(s=0;s<r;++s)a[s]=o[s](i);return a}}function BZ(t,e){t===void 0&&(t={}),e===void 0&&(e={});var n={},r={};return Object.entries(e).forEach(function(i){var o=D(i,2),a=o[0],s=o[1];a in t?n[a]=cb(t[a],s):r[a]=s}),function(i){return Object.entries(n).forEach(function(o){var a=D(o,2),s=a[0],l=a[1];return r[s]=l(i)}),r}}function cb(t,e){return typeof t=="number"&&typeof e=="number"?FZ(t,e):Array.isArray(t)&&Array.isArray(e)?RZ(t,e):typeof t=="object"&&typeof e=="object"?BZ(t,e):function(n){return t}}function zZ(t,e,n,r){if(!r)return t.attr("__keyframe_data__",n),null;var i=r.duration,o=i===void 0?0:i,a=cb(e,n),s=Math.ceil(+o/16),l=new Array(s).fill(0).map(function(c,u,f){return{__keyframe_data__:a(u/(f.length-1))}});return t.animate(l,G({fill:"both"},r))}function ok(t){for(var e=1/0,n=1/0,r=-1/0,i=-1/0,o=0;o<t.length;o++){var a=t[o],s=a.x,l=a.y,c=a.width,u=a.height,f=D([s+c,l+u],2),d=f[0],h=f[1];s<e&&(e=s),l<n&&(n=l),d>r&&(r=d),h>i&&(i=h)}return new Oe(e,n,r-e,i-n)}var YZ=function(t,e,n){var r=t.width,i=t.height,o=n.flexDirection,a=o===void 0?"row":o;n.flexWrap;var s=n.justifyContent,l=s===void 0?"flex-start":s;n.alignContent;var c=n.alignItems,u=c===void 0?"flex-start":c,f=a==="row",d=a==="row"||a==="column",h=f?d?[1,0]:[-1,0]:d?[0,1]:[0,-1],p=D([0,0],2),v=p[0],g=p[1],y=e.map(function(S){var E,M=S.width,P=S.height,C=D([v,g],2),A=C[0],T=C[1];return E=D([v+M*h[0],g+P*h[1]],2),v=E[0],g=E[1],new Oe(A,T,M,P)}),m=ok(y),b={"flex-start":0,"flex-end":f?r-m.width:i-m.height,center:f?(r-m.width)/2:(i-m.height)/2},x=y.map(function(S){var E=S.x,M=S.y,P=Oe.fromRect(S);return P.x=f?E+b[l]:E,P.y=f?M:M+b[l],P});ok(x);var w=function(S){var E=D(f?["height",i]:["width",r],2),M=E[0],P=E[1];switch(u){case"flex-start":return 0;case"flex-end":return P-S[M];case"center":return P/2-S[M]/2;default:return 0}},O=x.map(function(S){var E=S.x,M=S.y,P=Oe.fromRect(S);return P.x=f?E:E+w(P),P.y=f?M+w(P):M,P}),_=O.map(function(S){var E,M,P=Oe.fromRect(S);return P.x+=(E=t.x)!==null&&E!==void 0?E:0,P.y+=(M=t.y)!==null&&M!==void 0?M:0,P});return _},WZ=function(t,e,n){return[]};const GZ=function(t,e,n){if(e.length===0)return[];var r={flex:YZ,grid:WZ},i=n.display in r?r[n.display]:null;return(i==null?void 0:i.call(null,t,e,n))||[]};function po(t,e){return[t[0]*e,t[1]*e]}function ff(t,e){return[t[0]+e[0],t[1]+e[1]]}function ub(t,e){return[t[0]-e[0],t[1]-e[1]]}function ms(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function bs(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function df(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function ak(t){if(t[0]===0&&t[1]===0)return[0,0];var e=Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2));return[t[0]/e,t[1]/e]}function HZ(t,e){return e?[t[1],-t[0]]:[-t[1],t[0]]}function fb(t,e){return+t.toPrecision(e)}function sk(t,e){var n={},r=Array.isArray(e)?e:[e];for(var i in t)r.includes(i)||(n[i]=t[i]);return n}function UZ(t,e,n,r){var i,o=[],a=!!r,s,l,c=[1/0,1/0],u=[-1/0,-1/0],f,d,h;if(a){i=D(r,2),c=i[0],u=i[1];for(var p=0,v=t.length;p<v;p+=1){var g=t[p];c=ms(c,g),u=bs(u,g)}}for(var p=0,y=t.length;p<y;p+=1){var g=t[p];if(p===0&&!n)h=g;else if(p===y-1&&!n)d=g,o.push(h),o.push(d);else{var m=[p?p-1:y-1,p-1][n?0:1];s=t[m],l=t[n?(p+1)%y:p+1];var b=[0,0];b=ub(l,s),b=po(b,e);var x=df(g,s),w=df(g,l),O=x+w;O!==0&&(x/=O,w/=O);var _=po(b,-x),S=po(b,w);d=ff(g,_),f=ff(g,S),f=ms(f,bs(l,g)),f=bs(f,ms(l,g)),_=ub(f,g),_=po(_,-x/w),d=ff(g,_),d=ms(d,bs(s,g)),d=bs(d,ms(s,g)),S=ub(g,d),S=po(S,w/x),f=ff(g,S),a&&(d=bs(d,c),d=ms(d,u),f=bs(f,c),f=ms(f,u)),o.push(h),o.push(d),h=f}}return n&&o.push(o.shift()),o}function VZ(t,e,n){var r;e===void 0&&(e=!1),n===void 0&&(n=[[0,0],[1,1]]);for(var i=!!e,o=[],a=0,s=t.length;a<s;a+=2)o.push([t[a],t[a+1]]);for(var l=UZ(o,.4,i,n),c=o.length,u=[],f,d,h,a=0;a<c-1;a+=1)f=l[a*2],d=l[a*2+1],h=o[a+1],u.push(["C",f[0],f[1],d[0],d[1],h[0],h[1]]);return i&&(f=l[c],d=l[c+1],r=D(o,1),h=r[0],u.push(["C",f[0],f[1],d[0],d[1],h[0],h[1]])),u}var XZ=["$el","anchor","cx","cy","d","defX","defY","dx","dy","fill","fillOpacity","filter","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","height","img","increasedLineWidthForHitTesting","innerHTML","isBillboard","billboardRotation","isSizeAttenuation","isClosed","isOverflowing","leading","letterSpacing","lineDash","lineHeight","lineWidth","markerEnd","markerEndOffset","markerMid","markerStart","markerStartOffset","maxLines","metrics","miterLimit","offsetX","offsetY","opacity","path","points","r","radius","rx","ry","shadowColor","src","stroke","strokeOpacity","text","textAlign","textBaseline","textDecorationColor","textDecorationLine","textDecorationStyle","textOverflow","textPath","textPathSide","textPathStartOffset","transform","transformOrigin","visibility","width","wordWrap","wordWrapWidth","x","x1","x2","y","y1","y2","z1","z2","zIndex"];function qZ(t){return XZ.includes(t)}function lk(t){var e={};for(var n in t)qZ(n)&&(e[n]=t[n]);return e}function KZ(t,e){if(t.length<=e)return t;for(var n=Math.floor(t.length/e),r=[],i=0;i<t.length;i+=n)r.push(t[i]);return r}function db(t,e,n){n===void 0&&(n=!1);var r=t.getBBox(),i=r.width,o=r.height,a=e/Math.max(i,o);return n&&t.scale(a),a}function ZZ(t,e){var n=new Map;return t.forEach(function(r){var i=e(r);n.has(i)||n.set(i,[]),n.get(i).push(r)}),n}function QZ(t){throw new Error(t)}var JZ=function(){function t(i,o,a,s,l,c,u){i===void 0&&(i=null),o===void 0&&(o=null),a===void 0&&(a=null),s===void 0&&(s=null),l===void 0&&(l=[null,null,null,null,null]),c===void 0&&(c=[]),u===void 0&&(u=[]),e.add(this),this._elements=Array.from(i),this._data=o,this._parent=a,this._document=s,this._enter=l[0],this._update=l[1],this._exit=l[2],this._merge=l[3],this._split=l[4],this._transitions=c,this._facetElements=u}t.prototype.selectAll=function(i){var o=typeof i=="string"?this._parent.querySelectorAll(i):i;return new n(o,null,this._elements[0],this._document)},t.prototype.selectFacetAll=function(i){var o=typeof i=="string"?this._parent.querySelectorAll(i):i;return new n(this._elements,null,this._parent,this._document,void 0,void 0,o)},t.prototype.select=function(i){var o=typeof i=="string"?this._parent.querySelectorAll(i)[0]||null:i;return new n([o],null,o,this._document)},t.prototype.append=function(i){var o=this,a=typeof i=="function"?i:function(){return o.createElement(i)},s=[];if(this._data!==null){for(var l=0;l<this._data.length;l++){var c=this._data[l],u=D(Array.isArray(c)?c:[c,null],2),f=u[0],d=u[1],h=a(f,l);h.__data__=f,d!==null&&(h.__fromElements__=d),this._parent.appendChild(h),s.push(h)}return new n(s,null,this._parent,this._document)}for(var l=0;l<this._elements.length;l++){var p=this._elements[l],f=p.__data__,h=a(f,l);p.appendChild(h),s.push(h)}return new n(s,null,s[0],this._document)},t.prototype.maybeAppend=function(i,o){var a=rm(this,e,"m",r).call(this,i[0]==="#"?i:"#".concat(i),o);return a.attr("id",i),a},t.prototype.maybeAppendByClassName=function(i,o){var a=i.toString(),s=rm(this,e,"m",r).call(this,a[0]==="."?a:".".concat(a),o);return s.attr("className",a),s},t.prototype.maybeAppendByName=function(i,o){var a=rm(this,e,"m",r).call(this,'[name="'.concat(i,'"]'),o);return a.attr("name",i),a},t.prototype.data=function(i,o,a){var s,l;o===void 0&&(o=function(M){return M}),a===void 0&&(a=function(){return null});for(var c=[],u=[],f=new Set(this._elements),d=[],h=new Set,p=new Map(this._elements.map(function(M,P){return[o(M.__data__,P),M]})),v=new Map(this._facetElements.map(function(M,P){return[o(M.__data__,P),M]})),g=ZZ(this._elements,function(M){return a(M.__data__)}),y=0;y<i.length;y++){var m=i[y],b=o(m,y),x=a(m,y);if(p.has(b)){var w=p.get(b);w.__data__=m,w.__facet__=!1,u.push(w),f.delete(w),p.delete(b)}else if(v.has(b)){var w=v.get(b);w.__data__=m,w.__facet__=!0,u.push(w),v.delete(b)}else if(g.has(b)){var O=g.get(b);d.push([m,O]);try{for(var _=(s=void 0,ur(O)),S=_.next();!S.done;S=_.next()){var w=S.value;f.delete(w)}}catch(M){s={error:M}}finally{try{S&&!S.done&&(l=_.return)&&l.call(_)}finally{if(s)throw s.error}}g.delete(b)}else if(p.has(x)){var w=p.get(x);w.__toData__?w.__toData__.push(m):w.__toData__=[m],h.add(w),f.delete(w)}else c.push(m)}var E=[new n([],c,this._parent,this._document),new n(u,null,this._parent,this._document),new n(f,null,this._parent,this._document),new n([],d,this._parent,this._document),new n(h,null,this._parent,this._document)];return new n(this._elements,null,this._parent,this._document,E)},t.prototype.merge=function(i){var o=Q(Q([],D(this._elements),!1),D(i._elements),!1),a=Q(Q([],D(this._transitions),!1),D(i._transitions),!1);return new n(o,null,this._parent,this._document,void 0,a)},t.prototype.createElement=function(i){if(this._document)return this._document.createElement(i,{});var o=n.registry[i];return o?new o:QZ("Unknown node type: ".concat(i))},t.prototype.join=function(i,o,a,s,l){i===void 0&&(i=function(p){return p}),o===void 0&&(o=function(p){return p}),a===void 0&&(a=function(p){return p.remove()}),s===void 0&&(s=function(p){return p}),l===void 0&&(l=function(p){return p.remove()});var c=i(this._enter),u=o(this._update),f=a(this._exit),d=s(this._merge),h=l(this._split);return u.merge(c).merge(f).merge(d).merge(h)},t.prototype.remove=function(){for(var i=function(s){var l=o._elements[s],c=o._transitions[s];c?c.then(function(){return l.remove()}):l.remove()},o=this,a=0;a<this._elements.length;a++)i(a);return new n([],null,this._parent,this._document,void 0,this._transitions)},t.prototype.each=function(i){for(var o=0;o<this._elements.length;o++){var a=this._elements[o],s=a.__data__;i.call(a,s,o)}return this},t.prototype.attr=function(i,o){var a=typeof o!="function"?function(){return o}:o;return this.each(function(s,l){o!==void 0&&(this[i]=a.call(this,s,l))})},t.prototype.style=function(i,o,a){a===void 0&&(a=!0);var s=typeof o!="function"||!a?function(){return o}:o;return this.each(function(l,c){o!==void 0&&(this.style[i]=s.call(this,l,c))})},t.prototype.styles=function(i,o){return i===void 0&&(i={}),o===void 0&&(o=!0),this.each(function(a,s){var l=this;Object.entries(i).forEach(function(c){var u=D(c,2),f=u[0],d=u[1],h=typeof d!="function"||!o?function(){return d}:d;d!==void 0&&l.attr(f,h.call(l,a,s))})})},t.prototype.update=function(i,o){o===void 0&&(o=!0);var a=typeof i!="function"||!o?function(){return i}:i;return this.each(function(s,l){i&&this.update&&this.update(a.call(this,s,l))})},t.prototype.maybeUpdate=function(i,o){o===void 0&&(o=!0);var a=typeof i!="function"||!o?function(){return i}:i;return this.each(function(s,l){i&&this.update&&this.update(a.call(this,s,l))})},t.prototype.transition=function(i){var o=this._transitions;return this.each(function(a,s){o[s]=i.call(this,a,s)})},t.prototype.on=function(i,o){return this.each(function(){this.addEventListener(i,o)}),this},t.prototype.call=function(i){for(var o=[],a=1;a<arguments.length;a++)o[a-1]=arguments[a];return i.call.apply(i,Q([this._parent,this],D(o),!1)),this},t.prototype.node=function(){return this._elements[0]},t.prototype.nodes=function(){return this._elements},t.prototype.transitions=function(){return this._transitions.filter(function(i){return!!i})},t.prototype.parent=function(){return this._parent};var e,n,r;return n=t,e=new WeakSet,r=function(o,a){var s=this._elements[0],l=s.querySelector(o);if(l)return new n([l],null,this._parent,this._document);var c=typeof a=="string"?this.createElement(a):a();return s.appendChild(c),new n([c],null,this._parent,this._document)},t.registry={g:sn,rect:hs,circle:nf,path:Dn,text:sb,ellipse:j1,image:D1,line:rf,polygon:of,polyline:$1,html:Op},t}();function _t(t){return new JZ([t],null,t,t.ownerDocument)}function tQ(t,e,n){return t.querySelector(e)?_t(t).select(e):_t(t).append(n)}function gn(t){if(Xp(t))return[t,t,t,t];if(uo(t)){var e=t.length;if(e===1)return[t[0],t[0],t[0],t[0]];if(e===2)return[t[0],t[1],t[0],t[1]];if(e===3)return[t[0],t[1],t[2],t[1]];if(e===4)return t}return[0,0,0,0]}function ck(t){var e=t.getLocalBounds(),n=e.min,r=e.max,i=D([n,r],2),o=D(i[0],2),a=o[0],s=o[1],l=D(i[1],2),c=l[0],u=l[1];return{x:a,y:s,width:c-a,height:u-s,left:a,bottom:u,top:s,right:c}}function eQ(t,e){var n=D(t,2),r=n[0],i=n[1],o=D(e,2),a=o[0],s=o[1];return r!==a&&i===s}function nQ(t,e){var n,r,i=e.attributes;try{for(var o=ur(Object.entries(i)),a=o.next();!a.done;a=o.next()){var s=D(a.value,2),l=s[0],c=s[1];l!=="id"&&l!=="className"&&t.attr(l,c)}}catch(u){n={error:u}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}function hb(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function rQ(t){return t.toString().charAt(0).toLowerCase()+t.toString().slice(1)}function iQ(t,e){return"".concat(e).concat(hb(t))}function uk(t,e,n){var r;n===void 0&&(n=!0);var i=e||((r=t.match(/^([a-z][a-z0-9]+)/))===null||r===void 0?void 0:r[0])||"",o=t.replace(new RegExp("^(".concat(i,")")),"");return n?rQ(o):o}function oQ(t,e){Object.entries(e).forEach(function(n){var r=D(n,2),i=r[0],o=r[1];Q([t],D(t.querySelectorAll(i)),!1).filter(function(a){return a.matches(i)}).forEach(function(a){if(a){var s=a;s.style.cssText+=Object.entries(o).reduce(function(l,c){return"".concat(l).concat(c.join(":"),";")},"")}})})}var Jp=function(t,e){if(!(t!=null&&t.startsWith(e)))return!1;var n=t[e.length];return n>="A"&&n<="Z"};function Pt(t,e,n){n===void 0&&(n=!1);var r={};return Object.entries(t).forEach(function(i){var o=D(i,2),a=o[0],s=o[1];if(!(a==="className"||a==="class")){if(Jp(a,"show")&&Jp(uk(a,"show"),e)!==n)a===iQ(e,"show")?r[a]=s:r[a.replace(new RegExp(hb(e)),"")]=s;else if(!Jp(a,"show")&&Jp(a,e)!==n){var l=uk(a,e);l==="filter"&&typeof s=="function"||(r[l]=s)}}}),r}function Ii(t,e){return Object.entries(t).reduce(function(n,r){var i=D(r,2),o=i[0],a=i[1];return o.startsWith("show")?n["show".concat(e).concat(o.slice(4))]=a:n["".concat(e).concat(hb(o))]=a,n},{})}function vo(t,e){e===void 0&&(e=["x","y","class","className"]);var n=["transform","transformOrigin","anchor","visibility","pointerEvents","zIndex","cursor","clipPath","clipPathTargets","offsetPath","offsetPathTargets","offsetDistance","draggable","droppable"],r={},i={};return Object.entries(t).forEach(function(o){var a=D(o,2),s=a[0],l=a[1];e.includes(s)||(n.indexOf(s)!==-1?i[s]=l:r[s]=l)}),[r,i]}function aQ(t,e,n){var r=t.getBBox(),i=r.width,o=r.height,a=D([e,n].map(function(c,u){var f;return c.includes("%")?parseFloat(((f=c.match(/[+-]?([0-9]*[.])?[0-9]+/))===null||f===void 0?void 0:f[0])||"0")/100*(u===0?i:o):c}),2),s=a[0],l=a[1];return[s,l]}function t0(t,e){if(e)try{var n=/translate\(([+-]*[\d]+[%]*),[ ]*([+-]*[\d]+[%]*)\)/g,r=e.replace(n,function(i,o,a){return"translate(".concat(aQ(t,o,a),")")});t.attr("transform",r)}catch(i){}}function sQ(t){var e;return((e=t[0])===null||e===void 0?void 0:e.map(function(n,r){return t.map(function(i){return i[r]})}))||[]}function lQ(){Kp(this,this.attributes.visibility!=="hidden")}var ln=function(t){st(e,t);function e(n,r){r===void 0&&(r={});var i=t.call(this,ho({},{style:r},n))||this;return i.initialized=!1,i._defaultOptions=r,i}return Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=QT(this)),this._offscreen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"defaultOptions",{get:function(){return this._defaultOptions},enumerable:!1,configurable:!0}),e.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this),this.initialized=!0},e.prototype.disconnectedCallback=function(){var n;(n=this._offscreen)===null||n===void 0||n.destroy()},e.prototype.attributeChangedCallback=function(n){n==="visibility"&&lQ.call(this)},e.prototype.update=function(n,r){var i;return this.attr(ho({},this.attributes,n||{})),(i=this.render)===null||i===void 0?void 0:i.call(this,this.attributes,this,r)},e.prototype.clear=function(){this.removeChildren()},e.prototype.bindEvents=function(n,r){},e}(wp),fk=function(t,e,n){return[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]]},cQ=fk,uQ=function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]},fQ=function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]},dQ=function(t,e,n){var r=n*Math.sin(.3333333333333333*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]},hQ=function(t,e,n){var r=n*Math.sin(.3333333333333333*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]},pQ=function(t,e,n){var r=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+r,e-n/2],["L",t+r,e+n/2],["L",t,e+n],["L",t-r,e+n/2],["L",t-r,e-n/2],["Z"]]},vQ=function(t,e,n){var r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]},dk=function(t,e,n){return[["M",t,e+n],["L",t,e-n]]},gQ=function(t,e,n){return[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]]},yQ=function(t,e,n){return[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]]},mQ=function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]},bQ=function(t,e,n){return[["M",t-n,e],["L",t+n,e]]},hk=function(t,e,n){return[["M",t-n,e],["L",t+n,e]]},xQ=hk,wQ=function(t,e,n){return[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]]},OQ=function(t,e,n){return[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]]},_Q=function(t,e,n){return[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]]},SQ=function(t,e,n){return[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]]};function EQ(t,e){return[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]]}var MQ=function(t,e,n){return[["M",t-n,e-n],["L",t+n,e],["L",t-n,e+n],["Z"]]};function PQ(t){var e="default";if(HT(t)&&t instanceof Image)e="image";else if(Br(t))e="symbol";else if($l(t)){var n=new RegExp("data:(image|text)");t.match(n)?e="base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(t)?e="url":e="symbol"}return e}function AQ(t){var e=PQ(t);return["base64","url","image"].includes(e)?"image":t&&e==="symbol"?"path":null}var ne=function(t){st(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(n,r){var i=n.symbol,o=n.size,a=o===void 0?16:o,s=Qt(n,["symbol","size"]),l=AQ(i);Jn(!!l,_t(r),function(c){c.maybeAppendByClassName("marker",l).attr("className","marker ".concat(l,"-marker")).call(function(u){if(l==="image"){var f=a*2;u.styles({img:i,width:f,height:f,x:-a,y:-a})}else{var f=a/2,d=Br(i)?i:e.getSymbol(i);u.styles(G({path:d==null?void 0:d(0,0,f)},s))}})})},e.MARKER_SYMBOL_MAP=new Map,e.registerSymbol=function(n,r){e.MARKER_SYMBOL_MAP.set(n,r)},e.getSymbol=function(n){return e.MARKER_SYMBOL_MAP.get(n)},e.getSymbols=function(){return Array.from(e.MARKER_SYMBOL_MAP.keys())},e}(ln);ne.registerSymbol("cross",gQ),ne.registerSymbol("hyphen",bQ),ne.registerSymbol("line",dk),ne.registerSymbol("plus",mQ),ne.registerSymbol("tick",yQ),ne.registerSymbol("circle",fk),ne.registerSymbol("point",cQ),ne.registerSymbol("bowtie",vQ),ne.registerSymbol("hexagon",pQ),ne.registerSymbol("square",uQ),ne.registerSymbol("diamond",fQ),ne.registerSymbol("triangle",dQ),ne.registerSymbol("triangle-down",hQ),ne.registerSymbol("line",dk),ne.registerSymbol("dot",hk),ne.registerSymbol("dash",xQ),ne.registerSymbol("smooth",wQ),ne.registerSymbol("hv",OQ),ne.registerSymbol("vh",_Q),ne.registerSymbol("hvh",SQ),ne.registerSymbol("vhv",EQ);function e0(t,...e){return e.reduce((n,r)=>i=>n(r(i)),t)}function pb(t,e){return e-t?n=>(n-t)/(e-t):n=>.5}function CQ(t,e){const n=e<t?e:t,r=t>e?t:e;return i=>Math.min(Math.max(n,i),r)}function TQ(t,e,n,r,i){let o=n||0,a=r||t.length;const s=i||(l=>l);for(;o<a;){const l=Math.floor((o+a)/2);s(t[l])>e?a=l:o=l+1}return o}const pk=Math.sqrt(50),vk=Math.sqrt(10),gk=Math.sqrt(2);function n0(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/Ce(10,i);return i>=0?(o>=pk?10:o>=vk?5:o>=gk?2:1)*Ce(10,i):-Ce(10,-i)/(o>=pk?10:o>=vk?5:o>=gk?2:1)}const kQ=(t,e,n=5)=>{const r=[t,e];let i=0,o=r.length-1,a=r[i],s=r[o],l;return s<a&&([a,s]=[s,a],[i,o]=[o,i]),l=n0(a,s,n),l>0?(a=Math.floor(a/l)*l,s=Math.ceil(s/l)*l,l=n0(a,s,n)):l<0&&(a=Math.ceil(a*l)/l,s=Math.floor(s*l)/l,l=n0(a,s,n)),l>0?(r[i]=Math.floor(a/l)*l,r[o]=Math.ceil(s/l)*l):l<0&&(r[i]=Math.ceil(a*l)/l,r[o]=Math.floor(s*l)/l),r};var LQ={}.toString,r0=function(t,e){return LQ.call(t)==="[object "+e+"]"};const yk=function(t){return r0(t,"Function")},mk=function(t){return Array.isArray?Array.isArray(t):r0(t,"Array")},NQ=function(t){var e=typeof t;return t!==null&&e==="object"||e==="function"};function IQ(t,e){if(t){var n;if(mk(t))for(var r=0,i=t.length;r<i&&(n=e(t[r],r),n!==!1);r++);else if(NQ(t)){for(var o in t)if(t.hasOwnProperty(o)&&(n=e(t[o],o),n===!1))break}}}var jQ=function(t){return typeof t=="object"&&t!==null},bk=function(t){if(!jQ(t)||!r0(t,"Object"))return!1;if(Object.getPrototypeOf(t)===null)return!0;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};const DQ=function(t){return r0(t,"String")};var $Q=Object.values?function(t){return Object.values(t)}:function(t){var e=[];return IQ(t,function(n,r){yk(t)&&r==="prototype"||e.push(n)}),e},FQ=function(t){return t===null},RQ=function(t){return t===void 0};const BQ=function(t,e){if(!yk(t))throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=t.apply(this,r);return a.set(o,s),s};return n.cache=new Map,n};var zQ=5;function xk(t,e,n,r){n=n||0,r=r||zQ;for(var i in e)if(e.hasOwnProperty(i)){var o=e[i];o!==null&&bk(o)?(bk(t[i])||(t[i]={}),n<r?xk(t[i],o,n+1,r):t[i]=e[i]):mk(o)?(t[i]=[],t[i]=t[i].concat(o)):o!==void 0&&(t[i]=o)}}var YQ=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)xk(t,e[r]);return t};const wk=YQ,vb=function(t){return t};var i0;BQ(function(t,e){e===void 0&&(e={});var n=e.fontSize,r=e.fontFamily,i=e.fontWeight,o=e.fontStyle,a=e.fontVariant;return i0||(i0=document.createElement("canvas").getContext("2d")),i0.font=[o,a,i,n+"px",r].join(" "),i0.measureText(DQ(t)?t:"").width},function(t,e){return e===void 0&&(e={}),nm([t],$Q(e)).join("")});function Ok(t){return!RQ(t)&&!FQ(t)&&!Number.isNaN(t)}function gb(t,e,n){let r=n;return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function WQ(t){const e=t[0]/360,n=t[1]/100,r=t[2]/100,i=t[3];if(n===0)return[r*255,r*255,r*255,i];const o=r<.5?r*(1+n):r+n-r*n,a=2*r-o,s=gb(a,o,e+1/3),l=gb(a,o,e),c=gb(a,o,e-1/3);return[s*255,l*255,c*255,i]}function _k(t){const e=Sm.get(t);if(!e)return null;const{model:n,value:r}=e;return n==="rgb"?r:n==="hsl"?WQ(r):null}const o0=(t,e)=>n=>t*(1-n)+e*n,GQ=(t,e)=>{const n=_k(t),r=_k(e);return n===null||r===null?n?()=>t:()=>e:i=>{const o=new Array(4);for(let u=0;u<4;u+=1){const f=n[u],d=r[u];o[u]=f*(1-i)+d*i}const[a,s,l,c]=o;return`rgba(${Math.round(a)}, ${Math.round(s)}, ${Math.round(l)}, ${c})`}},HQ=(t,e)=>typeof t=="number"&&typeof e=="number"?o0(t,e):typeof t=="string"&&typeof e=="string"?GQ(t,e):()=>t,UQ=(t,e)=>{const n=o0(t,e);return r=>Math.round(n(r))};function Sk({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):n}function VQ({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function XQ({map:t,initKey:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function qQ(t){return typeof t=="object"?t.valueOf():t}let Ek=class extends Map{constructor(e){if(super(),this.map=new Map,this.initKey=qQ,e!==null)for(const[n,r]of e)this.set(n,r)}get(e){return super.get(Sk({map:this.map,initKey:this.initKey},e))}has(e){return super.has(Sk({map:this.map,initKey:this.initKey},e))}set(e,n){return super.set(VQ({map:this.map,initKey:this.initKey},e),n)}delete(e){return super.delete(XQ({map:this.map,initKey:this.initKey},e))}},Mk=class{constructor(e){this.options=wk({},this.getDefaultOptions()),this.update(e)}getOptions(){return this.options}update(e={}){this.options=wk({},this.options,e),this.rescale(e)}rescale(e){}};const yb=Symbol("defaultUnknown");function Pk(t,e,n){for(let r=0;r<e.length;r+=1)t.has(e[r])||t.set(n(e[r]),r)}function Ak(t){const{value:e,from:n,to:r,mapper:i,notFoundReturn:o}=t;let a=i.get(e);if(a===void 0){if(o!==yb)return o;a=n.push(e)-1,i.set(e,a)}return r[a%r.length]}function Ck(t){return t instanceof Date?e=>`${e}`:typeof t=="object"?e=>JSON.stringify(e):e=>e}let KQ=class mB extends Mk{getDefaultOptions(){return{domain:[],range:[],unknown:yb}}constructor(e){super(e)}map(e){return this.domainIndexMap.size===0&&Pk(this.domainIndexMap,this.getDomain(),this.domainKey),Ak({value:this.domainKey(e),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(e){return this.rangeIndexMap.size===0&&Pk(this.rangeIndexMap,this.getRange(),this.rangeKey),Ak({value:this.rangeKey(e),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(e){const[n]=this.options.domain,[r]=this.options.range;if(this.domainKey=Ck(n),this.rangeKey=Ck(r),!this.rangeIndexMap){this.rangeIndexMap=new Map,this.domainIndexMap=new Map;return}(!e||e.range)&&this.rangeIndexMap.clear(),(!e||e.domain||e.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new mB(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:e,compare:n}=this.options;return this.sortedDomain=n?[...e].sort(n):e,this.sortedDomain}};function ZQ(t){const e=Math.min(...t);return t.map(n=>n/e)}function QQ(t,e){const n=t.length,r=e-n;return r>0?[...t,...new Array(r).fill(1)]:r<0?t.slice(0,e):t}function JQ(t){return Math.round(t*1e12)/1e12}function tJ(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:o,round:a,align:s}=t,l=e.length,c=QQ(o,l),[u,f]=n,d=f-u,h=2/l*r+1-1/l*i,p=d/h,v=p*i/l,g=p-l*v,y=ZQ(c),m=y.reduce((C,A)=>C+A),b=g/m,x=new Ek(e.map((C,A)=>{const T=y[A]*b;return[C,a?Math.floor(T):T]})),w=new Ek(e.map((C,A)=>{const k=y[A]*b+v;return[C,a?Math.floor(k):k]})),O=Array.from(w.values()).reduce((C,A)=>C+A),S=(d-(O-O/l*i))*s,E=u+S;let M=a?Math.round(E):E;const P=new Array(l);for(let C=0;C<l;C+=1){P[C]=JQ(M);const A=e[C];M+=w.get(A)}return{valueBandWidth:x,valueStep:w,adjustedRange:P}}function eJ(t){var e;const{domain:n}=t,r=n.length;if(r===0)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(!!(!((e=t.flex)===null||e===void 0)&&e.length))return tJ(t);const{range:o,paddingOuter:a,paddingInner:s,round:l,align:c}=t;let u,f,d=o[0];const p=o[1]-d,v=a*2,g=r-s;u=p/Math.max(1,v+g),l&&(u=Math.floor(u)),d+=(p-u*(r-s))*c,f=u*(1-s),l&&(d=Math.round(d),f=Math.round(f));const y=new Array(r).fill(0).map((m,b)=>d+b*u);return{valueStep:u,valueBandWidth:f,adjustedRange:y}}let nJ=class bB extends KQ{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:yb,flex:[]}}constructor(e){super(e)}clone(){return new bB(this.options)}getStep(e){return this.valueStep===void 0?1:typeof this.valueStep=="number"?this.valueStep:e===void 0?Array.from(this.valueStep.values())[0]:this.valueStep.get(e)}getBandWidth(e){return this.valueBandWidth===void 0?1:typeof this.valueBandWidth=="number"?this.valueBandWidth:e===void 0?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(e)}getRange(){return this.adjustedRange}getPaddingInner(){const{padding:e,paddingInner:n}=this.options;return e>0?e:n}getPaddingOuter(){const{padding:e,paddingOuter:n}=this.options;return e>0?e:n}rescale(){super.rescale();const{align:e,domain:n,range:r,round:i,flex:o}=this.options,{adjustedRange:a,valueBandWidth:s,valueStep:l}=eJ({align:e,range:r,round:i,flex:o,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:n});this.valueStep=l,this.valueBandWidth=s,this.adjustedRange=a}};const rJ=(t,e,n)=>{let r,i,o=t,a=e;if(o===a&&n>0)return[o];let s=n0(o,a,n);if(s===0||!Number.isFinite(s))return[];if(s>0){o=Math.ceil(o/s),a=Math.floor(a/s),i=new Array(r=Math.ceil(a-o+1));for(let l=0;l<r;l+=1)i[l]=(o+l)*s}else{s=-s,o=Math.ceil(o*s),a=Math.floor(a*s),i=new Array(r=Math.ceil(a-o+1));for(let l=0;l<r;l+=1)i[l]=(o+l)/s}return i},iJ=(t,e,n)=>{const[r,i]=t,[o,a]=e;let s,l;return r<i?(s=pb(r,i),l=n(o,a)):(s=pb(i,r),l=n(a,o)),e0(l,s)},oJ=(t,e,n)=>{const r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=t[0]>t[r],s=a?[...t].reverse():t,l=a?[...e].reverse():e;for(let c=0;c<r;c+=1)i[c]=pb(s[c],s[c+1]),o[c]=n(l[c],l[c+1]);return c=>{const u=TQ(t,c,1,r)-1,f=i[u],d=o[u];return e0(d,f)(c)}},Tk=(t,e,n,r)=>(Math.min(t.length,e.length)>2?oJ:iJ)(t,e,r?UQ:n);let aJ=class extends Mk{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:o0,tickCount:5}}map(e){return Ok(e)?this.output(e):this.options.unknown}invert(e){return Ok(e)?this.input(e):this.options.unknown}nice(){if(!this.options.nice)return;const[e,n,r,...i]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(e,n,r,...i)}getTicks(){const{tickMethod:e}=this.options,[n,r,i,...o]=this.getTickMethodOptions();return e(n,r,i,...o)}getTickMethodOptions(){const{domain:e,tickCount:n}=this.options,r=e[0],i=e[e.length-1];return[r,i,n]}chooseNice(){return kQ}rescale(){this.nice();const[e,n]=this.chooseTransforms();this.composeOutput(e,this.chooseClamp(e)),this.composeInput(e,n,this.chooseClamp(n))}chooseClamp(e){const{clamp:n,range:r}=this.options,i=this.options.domain.map(e),o=Math.min(i.length,r.length);return n?CQ(i[0],i[o-1]):vb}composeOutput(e,n){const{domain:r,range:i,round:o,interpolate:a}=this.options,s=Tk(r.map(e),i,a,o);this.output=e0(s,n,e)}composeInput(e,n,r){const{domain:i,range:o}=this.options,a=Tk(o,i.map(e),o0);this.input=e0(n,r,a)}},hf=class xB extends aJ{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:HQ,tickMethod:rJ,tickCount:5}}chooseTransforms(){return[vb,vb]}clone(){return new xB(this.options)}};var sJ=function(t){st(e,t);function e(n){var r=this,i=n.style,o=Qt(n,["style"]);return r=t.call(this,qp({},{type:"column"},G({style:i},o)))||this,r.columnsGroup=new sn({name:"columns"}),r.appendChild(r.columnsGroup),r.render(),r}return e.prototype.render=function(){var n=this.attributes.columns;_t(this.columnsGroup).selectAll(".column").data(n.flat()).join(function(r){return r.append("rect").attr("className","column").each(function(i){this.attr(i)})},function(r){return r.each(function(i){this.attr(i)})},function(r){return r.remove()})},e.prototype.update=function(n){this.attr(ho({},this.attributes,n)),this.render()},e.prototype.clear=function(){this.removeChildren()},e}(Mn),lJ=function(t){st(e,t);function e(n){var r=this,i=n.style,o=Qt(n,["style"]);return r=t.call(this,qp({},{type:"lines"},G({style:i},o)))||this,r.linesGroup=r.appendChild(new sn),r.areasGroup=r.appendChild(new sn),r.render(),r}return e.prototype.render=function(){var n=this.attributes,r=n.lines,i=n.areas;r&&this.renderLines(r),i&&this.renderAreas(i)},e.prototype.clear=function(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()},e.prototype.update=function(n){this.attr(ho({},this.attributes,n)),this.render()},e.prototype.renderLines=function(n){_t(this.linesGroup).selectAll(".line").data(n).join(function(r){return r.append("path").attr("className","line").each(function(i){this.attr(i)})},function(r){return r.each(function(i){this.attr(i)})},function(r){return r.remove()})},e.prototype.renderAreas=function(n){_t(this.linesGroup).selectAll(".area").data(n).join(function(r){return r.append("path").attr("className","area").each(function(i){this.attr(i)})},function(r){return r.each(function(i){this.style(i)})},function(r){return r.remove()})},e}(Mn);function cJ(t,e){var n,r=e.x,i=e.y,o=D(i.getOptions().range||[0,0],2),a=o[0],s=o[1];return s>a&&(n=D([a,s],2),s=n[0],a=n[1]),t.map(function(l){var c=l.map(function(u,f){return[r.map(f),fo(i.map(u),s,a)]});return c})}function pf(t,e){e===void 0&&(e=!1);var n=e?t.length-1:0,r=t.map(function(i,o){return Q([o===n?"M":"L"],D(i),!1)});return e?r.reverse():r}function a0(t,e){if(e===void 0&&(e=!1),t.length<=2)return pf(t);for(var n=[],r=t.length,i=0;i<r;i+=1){var o=e?t[r-i-1]:t[i];TZ(o,n.slice(-2))||n.push.apply(n,Q([],D(o),!1))}var a=VZ(n,!1);return e?a.unshift(Q(["M"],D(t[r-1]),!1)):a.unshift(Q(["M"],D(t[0]),!1)),a}function mb(t,e,n){var r=ib(t);return r.push(["L",e,n],["L",0,n],["Z"]),r}function uJ(t,e,n,r){return t.map(function(i){return mb(e?a0(i):pf(i),n,r)})}function fJ(t,e,n){for(var r=[],i=t.length-1;i>=0;i-=1){var o=t[i],a=pf(o),s=void 0;if(i===0)s=mb(a,e,n);else{var l=t[i-1],c=pf(l,!0);c[0][0]="L",s=Q(Q(Q([],D(a),!1),D(c),!1),[["Z"]],!1)}r.push(s)}return r}function dJ(t,e,n){for(var r=[],i=t.length-1;i>=0;i-=1){var o=t[i],a=a0(o),s=void 0;if(i===0)s=mb(a,e,n);else{var l=t[i-1],c=a0(l,!0),u=o[0];c[0][0]="L",s=Q(Q(Q([],D(a),!1),D(c),!1),[Q(["M"],D(u),!1),["Z"]],!1)}r.push(s)}return r}function kk(t){return t.length===0?[0,0]:[VT(xZ(t,function(e){return VT(e)||0})),UT(bZ(t,function(e){return UT(e)||0}))]}function Lk(t){for(var e=ib(t),n=e[0].length,r=D([Array(n).fill(0),Array(n).fill(0)],2),i=r[0],o=r[1],a=0;a<e.length;a+=1)for(var s=e[a],l=0;l<n;l+=1)s[l]>=0?(s[l]+=i[l],i[l]=s[l]):(s[l]+=o[l],o[l]=s[l]);return e}var hJ=function(t){st(e,t);function e(n){return t.call(this,n,{type:"line",width:200,height:20,isStack:!1,color:["#83daad","#edbf45","#d2cef9","#e290b3","#6f63f4"],smooth:!0,lineLineWidth:1,areaOpacity:0,isGroup:!1,columnLineWidth:1,columnStroke:"#fff",scale:1,spacing:0})||this}return Object.defineProperty(e.prototype,"rawData",{get:function(){var n=this.attributes.data;if(!n||(n==null?void 0:n.length)===0)return[[]];var r=ib(n);return Xp(r[0])?[r]:r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.attributes.isStack?Lk(this.rawData):this.rawData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scales",{get:function(){return this.createScales(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseline",{get:function(){var n=this.scales.y,r=D(n.getOptions().domain||[0,0],2),i=r[0],o=r[1];return o<0?n.map(o):n.map(i<0?0:i)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"containerShape",{get:function(){var n=this.attributes,r=n.width,i=n.height;return{width:r,height:i}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linesStyle",{get:function(){var n=this,r=this.attributes,i=r.type,o=r.isStack,a=r.smooth;if(i!=="line")throw new Error("linesStyle can only be used in line type");var s=Pt(this.attributes,"area"),l=Pt(this.attributes,"line"),c=this.containerShape.width,u=this.data;if(u[0].length===0)return{lines:[],areas:[]};var f=this.scales,d=f.x,h=f.y,p=cJ(u,{type:"line",x:d,y:h}),v=[];if(s){var g=this.baseline;o?v=a?dJ(p,c,g):fJ(p,c,g):v=uJ(p,a,c,g)}return{lines:p.map(function(y,m){return G({stroke:n.getColor(m),path:a?a0(y):pf(y)},l)}),areas:v.map(function(y,m){return G({path:y,fill:n.getColor(m)},s)})}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"columnsStyle",{get:function(){var n=this,r=Pt(this.attributes,"column"),i=this.attributes,o=i.isStack,a=i.type,s=i.scale;if(a!=="column")throw new Error("columnsStyle can only be used in column type");var l=this.containerShape.height,c=this.rawData;if(!c)return{columns:[]};o&&(c=Lk(c));var u=this.createScales(c),f=u.x,d=u.y,h=D(kk(c),2),p=h[0],v=h[1],g=new hf({domain:[0,v-(p>0?0:p)],range:[0,l*s]}),y=f.getBandWidth(),m=this.rawData;return{columns:c.map(function(b,x){return b.map(function(w,O){var _=y/c.length,S=function(){return{x:f.map(O)+_*x,y:w>=0?d.map(w):d.map(0),width:_,height:g.map(Math.abs(w))}},E=function(){return{x:f.map(O),y:d.map(w),width:y,height:g.map(m[x][O])}};return G(G({fill:n.getColor(x)},r),o?E():S())})})}},enumerable:!1,configurable:!0}),e.prototype.render=function(n,r){tQ(r,".container","rect").attr("className","container").node();var i=n.type,o="spark".concat(i),a=i==="line"?this.linesStyle:this.columnsStyle;_t(r).selectAll(".spark").data([i]).join(function(s){return s.append(function(l){return l==="line"?new lJ({className:o,style:a}):new sJ({className:o,style:a})}).attr("className","spark ".concat(o))},function(s){return s.update(a)},function(s){return s.remove()})},e.prototype.getColor=function(n){var r=this.attributes.color;return uo(r)?r[n%r.length]:Br(r)?r.call(null,n):r},e.prototype.createScales=function(n){var r,i,o=this.attributes,a=o.type,s=o.scale,l=o.range,c=l===void 0?[]:l,u=o.spacing,f=this.containerShape,d=f.width,h=f.height,p=D(kk(n),2),v=p[0],g=p[1],y=new hf({domain:[(r=c[0])!==null&&r!==void 0?r:v,(i=c[1])!==null&&i!==void 0?i:g],range:[h,h*(1-s)]});return a==="line"?{type:a,x:new hf({domain:[0,n[0].length-1],range:[0,d]}),y}:{type:a,x:new nJ({domain:n[0].map(function(m,b){return b}),range:[0,d],paddingInner:u,paddingOuter:u/2,align:.5}),y}},e.tag="sparkline",e}(ln);function pJ(t){return typeof t=="boolean"?!1:"enter"in t&&"update"in t&&"exit"in t}function Nk(t){if(!t)return{enter:!1,update:!1,exit:!1};var e=["enter","update","exit"],n=Object.fromEntries(Object.entries(t).filter(function(r){var i=D(r,1),o=i[0];return!e.includes(o)}));return Object.fromEntries(e.map(function(r){return pJ(t)?t[r]===!1?[r,!1]:[r,G(G({},t[r]),n)]:[r,n]}))}function Rl(t,e){t?t.finished.then(e):e()}function vJ(t,e){t.length===0?e():Promise.all(t.map(function(n){return n==null?void 0:n.finished})).then(e)}function Ik(t,e){"update"in t?t.update(e):t.attr(e)}function jk(t,e,n){if(e.length===0)return null;if(!n){var r=e.slice(-1)[0];return Ik(t,{style:r}),null}return t.animate(e,n)}function gJ(t,e){return!(t.nodeName!=="text"||e.nodeName!=="text"||t.attributes.text!==e.attributes.text)}function yJ(t,e,n,r){if(r===void 0&&(r="destroy"),gJ(t,e))return t.remove(),[null];var i=function(){r==="destroy"?t.destroy():r==="hide"&&ra(t),e.isVisible()&&uf(e)};if(!n)return i(),[null];var o=n.duration,a=o===void 0?0:o,s=n.delay,l=s===void 0?0:s,c=Math.ceil(+a/2),u=+a/4,f=function(P){if(P.nodeName==="circle"){var C=D(P.getLocalPosition(),2),A=C[0],T=C[1],k=P.attr("r");return[A-k,T-k]}return P.getLocalPosition()},d=D(f(t),2),h=d[0],p=d[1],v=D(f(e),2),g=v[0],y=v[1],m=D([(h+g)/2-h,(p+y)/2-p],2),b=m[0],x=m[1],w=t.style.opacity,O=w===void 0?1:w,_=e.style.opacity,S=_===void 0?1:_,E=t.animate([{opacity:O,transform:"translate(0, 0)"},{opacity:0,transform:"translate(".concat(b,", ").concat(x,")")}],G(G({fill:"both"},n),{duration:l+c+u})),M=e.animate([{opacity:0,transform:"translate(".concat(-b,", ").concat(-x,")"),offset:.01},{opacity:S,transform:"translate(0, 0)"}],G(G({fill:"both"},n),{duration:c+u,delay:l+c-u}));return Rl(M,i),[E,M]}function ci(t,e,n){var r={},i={};return Object.entries(e).forEach(function(o){var a=D(o,2),s=a[0],l=a[1];if(!eb(l)){var c=t.style[s]||t.parsedStyle[s]||0;c!==l&&(r[s]=c,i[s]=l)}}),n?jk(t,[r,i],G({fill:"both"},n)):(Ik(t,i),null)}function s0(t,e){return t.style.opacity||(t.style.opacity=1),ci(t,{opacity:0},e)}var Dk={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},$k={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},Fk={orientation:"horizontal",showLabel:!0,type:"start"},ji=Yr({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider"),ia=Yr({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),mJ=function(t){st(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(n,r){var i=n.size,o=i===void 0?10:i,a=n.radius,s=a===void 0?o/4:a,l=n.orientation,c=Qt(n,["size","radius","orientation"]),u=o,f=u*2.4,d=_t(r).maybeAppendByClassName(ia.iconRect,"rect").styles(G(G({},c),{width:u,height:f,radius:s,x:-u/2,y:-f/2})),h=1/3*u,p=2/3*u,v=1/4*f,g=3/4*f;d.maybeAppendByClassName("".concat(ia.iconLine,"-1"),"line").styles(G({x1:h,x2:h,y1:v,y2:g},c)),d.maybeAppendByClassName("".concat(ia.iconLine,"-2"),"line").styles(G({x1:p,x2:p,y1:v,y2:g},c)),d.node().setOrigin(u/2,f/2),l==="vertical"?r.setLocalEulerAngles(90):r.setLocalEulerAngles(0)},e}(ln),Rk=function(t){st(e,t);function e(n){return t.call(this,n,Fk)||this}return e.prototype.renderLabel=function(n){var r=this,i=this.attributes.showLabel,o=Pt(this.attributes,"label"),a=o.transform,s=Qt(o,["transform"]),l=D(vo(s,[]),2),c=l[0],u=l[1],f=_t(n).maybeAppendByClassName(ia.labelGroup,"g").styles(u),d=G(G({},$k),c),h=d.text,p=Qt(d,["text"]);Jn(!!i,f,function(v){r.label=v.maybeAppendByClassName(ia.label,"text").styles(G(G({},p),{transform:a,text:"".concat(h)})),r.label.on("mousedown",function(g){g.stopPropagation()}),r.label.on("touchstart",function(g){g.stopPropagation()})})},e.prototype.renderIcon=function(n){var r=this.attributes,i=r.orientation,o=r.type,a=G(G({orientation:i},Dk),Pt(this.attributes,"icon")),s=this.attributes.iconShape,l=s===void 0?function(){return new mJ({style:a})}:s,c=_t(n).maybeAppendByClassName(ia.iconGroup,"g");c.selectAll(ia.icon.class).data([l]).join(function(u){return u.append(typeof l=="string"?l:function(){return l(o)}).attr("className",ia.icon.name)},function(u){return u.update(a)},function(u){return u.remove()})},e.prototype.render=function(n,r){this.renderIcon(r),this.renderLabel(r)},e}(ln),Bk=function(t){st(e,t);function e(n){var r=t.call(this,n,G(G(G({animate:{duration:100,fill:"both"},brushable:!0,formatter:function(i){return i.toString()},handleSpacing:2,orientation:"horizontal",padding:0,autoFitLabel:!0,scrollable:!0,selectionFill:"#5B8FF9",selectionFillOpacity:.45,selectionZIndex:2,showHandle:!0,showLabel:!0,slidable:!0,trackFill:"#416180",trackLength:200,trackOpacity:.05,trackSize:20,trackZIndex:-1,values:[0,1],type:"range",selectionType:"select",handleIconOffset:0},Ii(Fk,"handle")),Ii(Dk,"handleIcon")),Ii($k,"handleLabel")))||this;return r.range=[0,1],r.onDragStart=function(i){return function(o){o.stopPropagation(),r.target=i,r.prevPos=r.getOrientVal(Qp(o));var a=r.availableSpace,s=a.x,l=a.y,c=r.getBBox(),u=c.x,f=c.y;r.selectionStartPos=r.getRatio(r.prevPos-r.getOrientVal([s,l])-r.getOrientVal([+u,+f])),r.selectionWidth=0,document.addEventListener("pointermove",r.onDragging),document.addEventListener("pointerup",r.onDragEnd)}},r.onDragging=function(i){var o=r.attributes,a=o.slidable,s=o.brushable,l=o.type;i.stopPropagation();var c=r.getOrientVal(Qp(i)),u=c-r.prevPos;if(u){var f=r.getRatio(u);switch(r.target){case"start":a&&r.setValuesOffset(f);break;case"end":a&&r.setValuesOffset(0,f);break;case"selection":a&&r.setValuesOffset(f,f);break;case"track":if(!s)return;r.selectionWidth+=f,l==="range"?r.innerSetValues([r.selectionStartPos,r.selectionStartPos+r.selectionWidth].sort(),!0):r.innerSetValues([0,r.selectionStartPos+r.selectionWidth],!0);break}r.prevPos=c}},r.onDragEnd=function(){document.removeEventListener("pointermove",r.onDragging),document.removeEventListener("pointermove",r.onDragging),document.removeEventListener("pointerup",r.onDragEnd),r.target="",r.updateHandlesPosition(!1)},r.onValueChange=function(i){var o=r.attributes,a=o.onChange,s=o.type,l=s==="range"?i:i[1],c=s==="range"?r.getValues():r.getValues()[1],u=new ee("valuechange",{detail:{oldValue:l,value:c}});r.dispatchEvent(u),a==null||a(c)},r.selectionStartPos=0,r.selectionWidth=0,r.prevPos=0,r.target="",r}return Object.defineProperty(e.prototype,"values",{get:function(){return this.attributes.values},set:function(n){this.attributes.values=this.clampValues(n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sparklineStyle",{get:function(){var n=this.attributes.orientation;if(n!=="horizontal")return null;var r=Pt(this.attributes,"sparkline");return G(G({zIndex:0},this.availableSpace),r)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var n=this.attributes,r=n.trackLength,i=n.trackSize,o=D(this.getOrientVal([[r,i],[i,r]]),2),a=o[0],s=o[1];return{width:a,height:s}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableSpace",{get:function(){var n=this.attributes.padding,r=D(gn(n),4),i=r[0],o=r[1],a=r[2],s=r[3],l=this.shape,c=l.width,u=l.height;return{x:s,y:i,width:c-(s+o),height:u-(i+a)}},enumerable:!1,configurable:!0}),e.prototype.getValues=function(){return this.values},e.prototype.setValues=function(n,r){n===void 0&&(n=[0,0]),r===void 0&&(r=!1),this.attributes.values=n;var i=r===!1?!1:this.attributes.animate;this.updateSelectionArea(i),this.updateHandlesPosition(i)},e.prototype.updateSelectionArea=function(n){var r=this.calcSelectionArea();this.foregroundGroup.selectAll(ji.selection.class).each(function(i,o){ci(this,r[o],n)})},e.prototype.updateHandlesPosition=function(n){this.attributes.showHandle&&(this.startHandle&&ci(this.startHandle,this.getHandleStyle("start"),n),this.endHandle&&ci(this.endHandle,this.getHandleStyle("end"),n))},e.prototype.innerSetValues=function(n,r){n===void 0&&(n=[0,0]),r===void 0&&(r=!1);var i=this.values,o=this.clampValues(n);this.attributes.values=o,this.setValues(o),r&&this.onValueChange(i)},e.prototype.renderTrack=function(n){var r=Pt(this.attributes,"track");this.trackShape=_t(n).maybeAppendByClassName(ji.track,"rect").styles(G(G({},this.shape),r))},e.prototype.renderBrushArea=function(n){var r=this.attributes.brushable;this.brushArea=_t(n).maybeAppendByClassName(ji.brushArea,"rect").styles(G({fill:"transparent",cursor:r?"crosshair":"default"},this.shape))},e.prototype.renderSparkline=function(n){var r=this,i=this.attributes.orientation,o=_t(n).maybeAppendByClassName(ji.sparklineGroup,"g");Jn(i==="horizontal",o,function(a){var s=r.sparklineStyle;a.maybeAppendByClassName(ji.sparkline,function(){return new hJ({style:s})}).update(s)})},e.prototype.renderHandles=function(){var n=this,r,i=this.attributes,o=i.showHandle,a=i.type,s=a==="range"?["start","end"]:["end"],l=o?s:[],c=this;(r=this.foregroundGroup)===null||r===void 0||r.selectAll(ji.handle.class).data(l.map(function(u){return{type:u}}),function(u){return u.type}).join(function(u){return u.append(function(f){var d=f.type;return new Rk({style:n.getHandleStyle(d)})}).each(function(f){var d=f.type;this.attr("class","".concat(ji.handle.name," ").concat(d,"-handle"));var h="".concat(d,"Handle");c[h]=this,this.addEventListener("pointerdown",c.onDragStart(d))})},function(u){return u.each(function(f){var d=f.type;this.update(c.getHandleStyle(d))})},function(u){return u.each(function(f){var d=f.type,h="".concat(d,"Handle");c[h]=void 0}).remove()})},e.prototype.renderSelection=function(n){var r=this.attributes,i=r.type,o=r.selectionType;this.foregroundGroup=_t(n).maybeAppendByClassName(ji.foreground,"g");var a=Pt(this.attributes,"selection"),s=function(c){return c.style("visibility",function(u){return u.show?"visible":"hidden"}).style("cursor",function(u){return o==="select"?"grab":o==="invert"?"crosshair":"default"}).styles(a)},l=this;this.foregroundGroup.selectAll(ji.selection.class).data(i==="value"?[]:this.calcSelectionArea().map(function(c,u){return{style:G({},c),index:u,show:o==="select"?u===1:u!==1}}),function(c){return c.index}).join(function(c){return c.append("rect").attr("className",ji.selection.name).call(s).each(function(u,f){var d=this;f===1?(l.selectionShape=_t(this),this.on("pointerdown",function(h){d.attr("cursor","grabbing"),l.onDragStart("selection")(h)}),l.dispatchCustomEvent(this,"pointerenter","selectionMouseenter"),l.dispatchCustomEvent(this,"pointerleave","selectionMouseleave"),l.dispatchCustomEvent(this,"click","selectionClick"),this.addEventListener("pointerdown",function(){d.attr("cursor","grabbing")}),this.addEventListener("pointerup",function(){d.attr("cursor","pointer")}),this.addEventListener("pointerover",function(){d.attr("cursor","pointer")})):this.on("pointerdown",l.onDragStart("track"))})},function(c){return c.call(s)},function(c){return c.remove()}),this.updateSelectionArea(!1),this.renderHandles()},e.prototype.render=function(n,r){this.renderTrack(r),this.renderSparkline(r),this.renderBrushArea(r),this.renderSelection(r)},e.prototype.clampValues=function(n,r){var i;r===void 0&&(r=4);var o=D(this.range,2),a=o[0],s=o[1],l=D(this.getValues().map(function(g){return fb(g,r)}),2),c=l[0],u=l[1],f=Array.isArray(n)?n:[c,n!=null?n:u],d=D((f||[c,u]).map(function(g){return fb(g,r)}),2),h=d[0],p=d[1];if(this.attributes.type==="value")return[0,fo(p,a,s)];h>p&&(i=D([p,h],2),h=i[0],p=i[1]);var v=p-h;return v>s-a?[a,s]:h<a?c===a&&u===p?[a,p]:[a,v+a]:p>s?u===s&&c===h?[h,s]:[s-v,s]:[h,p]},e.prototype.calcSelectionArea=function(n){var r=D(this.clampValues(n),2),i=r[0],o=r[1],a=this.availableSpace,s=a.x,l=a.y,c=a.width,u=a.height;return this.getOrientVal([[{y:l,height:u,x:s,width:i*c},{y:l,height:u,x:i*c+s,width:(o-i)*c},{y:l,height:u,x:o*c,width:(1-o)*c}],[{x:s,width:c,y:l,height:i*u},{x:s,width:c,y:i*u+l,height:(o-i)*u},{x:s,width:c,y:o*u,height:(1-o)*u}]])},e.prototype.calcHandlePosition=function(n){var r=this.attributes.handleIconOffset,i=this.availableSpace,o=i.x,a=i.y,s=i.width,l=i.height,c=D(this.clampValues(),2),u=c[0],f=c[1],d=n==="start"?-r:r,h=(n==="start"?u:f)*this.getOrientVal([s,l])+d;return{x:o+this.getOrientVal([h,s/2]),y:a+this.getOrientVal([l/2,h])}},e.prototype.inferTextStyle=function(n){var r=this.attributes.orientation;return r==="horizontal"?{}:n==="start"?{transform:"rotate(90)",textAlign:"start"}:n==="end"?{transform:"rotate(90)",textAlign:"end"}:{}},e.prototype.calcHandleText=function(n){var r,i=this.attributes,o=i.type,a=i.orientation,s=i.formatter,l=i.autoFitLabel,c=Pt(this.attributes,"handle"),u=Pt(c,"label"),f=c.spacing,d=this.getHandleSize(),h=this.clampValues(),p=n==="start"?h[0]:h[1],v=s(p),g=new sb({style:G(G(G({},u),this.inferTextStyle(n)),{text:v})}),y=g.getBBox(),m=y.width,b=y.height;if(g.destroy(),!l){if(o==="value")return{text:v,x:0,y:-b-f};var x=f+d+(a==="horizontal"?m/2:0);return r={text:v},r[a==="horizontal"?"x":"y"]=n==="start"?-x:x,r}var w=0,O=0,_=this.availableSpace,S=_.width,E=_.height,M=this.calcSelectionArea()[1],P=M.x,C=M.y,A=M.width,T=M.height,k=f+d;if(a==="horizontal"){var N=k+m/2;if(n==="start"){var j=P-k-m;w=j>0?-N:N}else{var L=S-P-A-k>m;w=L?N:-N}}else{var I=k,$=b+k;n==="start"?O=C-d>b?-$:I:O=E-(C+T)-d>b?$:-I}return{x:w,y:O,text:v}},e.prototype.getHandleLabelStyle=function(n){var r=Pt(this.attributes,"handleLabel");return G(G(G({},r),this.calcHandleText(n)),this.inferTextStyle(n))},e.prototype.getHandleIconStyle=function(){var n=this.attributes.handleIconShape,r=Pt(this.attributes,"handleIcon"),i=this.getOrientVal(["ew-resize","ns-resize"]),o=this.getHandleSize();return G({cursor:i,shape:n,size:o},r)},e.prototype.getHandleStyle=function(n){var r=this.attributes,i=r.showLabel,o=r.showLabelOnInteraction,a=r.orientation,s=this.calcHandlePosition(n),l=this.calcHandleText(n),c=i;return!i&&o&&(this.target?c=!0:c=!1),G(G(G(G({},Ii(this.getHandleIconStyle(),"icon")),Ii(G(G({},this.getHandleLabelStyle(n)),l),"label")),s),{orientation:a,showLabel:c,type:n,zIndex:3})},e.prototype.getHandleSize=function(){var n=this.attributes,r=n.handleIconSize,i=n.width,o=n.height;return r||Math.floor((this.getOrientVal([+o,+i])+4)/2.4)},e.prototype.getOrientVal=function(n){var r=D(n,2),i=r[0],o=r[1],a=this.attributes.orientation;return a==="horizontal"?i:o},e.prototype.setValuesOffset=function(n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var o=this.attributes.type,a=D(this.getValues(),2),s=a[0],l=a[1],c=o==="range"?n:0,u=[s+c,l+r].sort();i?this.setValues(u):this.innerSetValues(u,!0)},e.prototype.getRatio=function(n){var r=this.availableSpace,i=r.width,o=r.height;return n/this.getOrientVal([i,o])},e.prototype.dispatchCustomEvent=function(n,r,i){var o=this;n.on(r,function(a){a.stopPropagation(),o.dispatchEvent(new ee(i,{detail:a}))})},e.prototype.bindEvents=function(){this.addEventListener("wheel",this.onScroll);var n=this.brushArea;this.dispatchCustomEvent(n,"click","trackClick"),this.dispatchCustomEvent(n,"pointerenter","trackMouseenter"),this.dispatchCustomEvent(n,"pointerleave","trackMouseleave"),n.on("pointerdown",this.onDragStart("track"))},e.prototype.onScroll=function(n){var r=this.attributes.scrollable;if(r){var i=n.deltaX,o=n.deltaY,a=o||i,s=this.getRatio(a);this.setValuesOffset(s,s,!0)}},e.tag="slider",e}(ln),bJ=function(t){st(e,t);function e(n){var r=t.call(this,n,{isRound:!0,orientation:"vertical",padding:[2,2,2,2],scrollable:!0,slidable:!0,thumbCursor:"default",trackSize:10,value:0})||this;return r.range=[0,1],r.onValueChange=function(i){var o=r.attributes.value;if(i!==o){var a={detail:{oldValue:i,value:o}};r.dispatchEvent(new ee("scroll",a)),r.dispatchEvent(new ee("valuechange",a))}},r.onTrackClick=function(i){var o=r.attributes.slidable;if(o){var a=D(r.getLocalPosition(),2),s=a[0],l=a[1],c=D(r.padding,4),u=c[0],f=c[3],d=r.getOrientVal([s+f,l+u]),h=r.getOrientVal(Qp(i)),p=(h-d)/r.trackLength;r.setValue(p,!0)}},r.onThumbMouseenter=function(i){r.dispatchEvent(new ee("thumbMouseenter",{detail:i.detail}))},r.onTrackMouseenter=function(i){r.dispatchEvent(new ee("trackMouseenter",{detail:i.detail}))},r.onThumbMouseleave=function(i){r.dispatchEvent(new ee("thumbMouseleave",{detail:i.detail}))},r.onTrackMouseleave=function(i){r.dispatchEvent(new ee("trackMouseleave",{detail:i.detail}))},r}return Object.defineProperty(e.prototype,"padding",{get:function(){var n=this.attributes.padding;return gn(n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){var n=this.attributes.value,r=D(this.range,2),i=r[0],o=r[1];return fo(n,i,o)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trackLength",{get:function(){var n=this.attributes,r=n.viewportLength,i=n.trackLength,o=i===void 0?r:i;return o},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableSpace",{get:function(){var n=this.attributes.trackSize,r=this.trackLength,i=D(this.padding,4),o=i[0],a=i[1],s=i[2],l=i[3],c=D(this.getOrientVal([[r,n],[n,r]]),2),u=c[0],f=c[1];return{x:l,y:o,width:+u-(l+a),height:+f-(o+s)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trackRadius",{get:function(){var n=this.attributes,r=n.isRound,i=n.trackSize;return r?i/2:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thumbRadius",{get:function(){var n=this.attributes,r=n.isRound,i=n.thumbRadius;if(!r)return 0;var o=this.availableSpace,a=o.width,s=o.height;return i||this.getOrientVal([s,a])/2},enumerable:!1,configurable:!0}),e.prototype.getValues=function(n){n===void 0&&(n=this.value);var r=this.attributes,i=r.viewportLength,o=r.contentLength,a=i/o,s=D(this.range,2),l=s[0],c=s[1],u=n*(c-l-a);return[u,u+a]},e.prototype.getValue=function(){return this.value},e.prototype.renderSlider=function(n){var r=this.attributes,i=r.orientation,o=r.trackSize,a=r.padding,s=r.slidable,l=Pt(this.attributes,"track"),c=Pt(this.attributes,"thumb"),u=G(G({brushable:!1,orientation:i,padding:a,selectionRadius:this.thumbRadius,showHandle:!1,slidable:s,trackLength:this.trackLength,trackRadius:this.trackRadius,trackSize:o,values:this.getValues()},Ii(l,"track")),Ii(c,"selection"));this.slider=_t(n).maybeAppendByClassName("scrollbar",function(){return new Bk({style:u})}).update(u).node()},e.prototype.render=function(n,r){this.renderSlider(r)},e.prototype.setValue=function(n,r){r===void 0&&(r=!1);var i=this.attributes.value,o=D(this.range,2),a=o[0],s=o[1];this.slider.setValues(this.getValues(fo(n,a,s)),r),this.onValueChange(i)},e.prototype.bindEvents=function(){var n=this;this.slider.addEventListener("trackClick",function(r){r.stopPropagation(),n.onTrackClick(r.detail)}),this.onHover()},e.prototype.getOrientVal=function(n){var r=this.attributes.orientation;return r==="horizontal"?n[0]:n[1]},e.prototype.onHover=function(){this.slider.addEventListener("selectionMouseenter",this.onThumbMouseenter),this.slider.addEventListener("trackMouseenter",this.onTrackMouseenter),this.slider.addEventListener("selectionMouseleave",this.onThumbMouseleave),this.slider.addEventListener("trackMouseleave",this.onTrackMouseleave)},e.tag="scrollbar",e}(ln),bb={data:[],animate:{enter:!1,update:{duration:100,easing:"ease-in-out-sine",fill:"both"},exit:{duration:100,fill:"both"}},showArrow:!0,showGrid:!0,showLabel:!0,showLine:!0,showTick:!0,showTitle:!0,showTrunc:!1,dataThreshold:100,lineLineWidth:1,lineStroke:"black",crossPadding:10,titleFill:"black",titleFontSize:12,titlePosition:"lb",titleSpacing:0,titleTextAlign:"center",titleTextBaseline:"middle",lineArrow:function(){return new Dn({style:{path:[["M",10,10],["L",-10,0],["L",10,-10],["L",0,0],["L",10,10],["Z"]],anchor:"0.5 0.5",fill:"black",transformOrigin:"center"}})},labelAlign:"parallel",labelDirection:"positive",labelFontSize:12,labelSpacing:0,gridConnect:"line",gridControlAngles:[],gridDirection:"positive",gridLength:0,gridType:"segment",lineArrowOffset:15,lineArrowSize:10,tickDirection:"positive",tickLength:5,tickLineWidth:1,tickStroke:"black",labelOverlap:[]};qp({},bb,{style:{type:"arc"}}),qp({},bb,{style:{}});var Zt=Yr({mainGroup:"main-group",gridGroup:"grid-group",grid:"grid",lineGroup:"line-group",line:"line",tickGroup:"tick-group",tick:"tick",tickItem:"tick-item",labelGroup:"label-group",label:"label",labelItem:"label-item",titleGroup:"title-group",title:"title",lineFirst:"line-first",lineSecond:"line-second"},"axis"),Bl=Yr({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function zk(t){return t.reduce(function(e,n,r){return e.push(Q([r===0?"M":"L"],D(n),!1)),e},[])}function xJ(t,e,n){var r=e.connect,i=r===void 0?"line":r,o=e.center;if(i==="line")return zk(t);if(!o)return[];var a=df(t[0],o),s=n?0:1;return t.reduce(function(l,c,u){return u===0?l.push(Q(["M"],D(c),!1)):l.push(Q(["A",a,a,0,0,s],D(c),!1)),l},[])}function xb(t,e,n){return e.type==="surround"?xJ(t,e,n):zk(t)}function wJ(t,e,n){var r=n.type,i=n.connect,o=n.center,a=n.closed,s=a?[["Z"]]:[],l=D([xb(t,n),xb(e.slice().reverse(),n,!0)],2),c=l[0],u=l[1],f=D([t[0],e.slice(-1)[0]],2),d=f[0],h=f[1],p=function(m,b){return[c,m,u,b,s].flat()};if(i==="line"||r==="surround")return p([Q(["L"],D(h),!1)],[Q(["L"],D(d),!1)]);if(!o)throw new Error("Arc grid need to specified center");var v=D([df(h,o),df(d,o)],2),g=v[0],y=v[1];return p([Q(["A",g,g,0,0,1],D(h),!1),Q(["L"],D(h),!1)],[Q(["A",y,y,0,0,0],D(d),!1),Q(["L"],D(d),!1)])}function OJ(t,e,n,r){var i=n.animate,o=n.isBillboard,a=e.map(function(s,l){return{id:s.id||"grid-line-".concat(l),path:xb(s.points,n)}});return t.selectAll(Bl.line.class).data(a,function(s){return s.id}).join(function(s){return s.append("path").each(function(l,c){var u=zr(lk(G({path:l.path},r)),[l,c,a]);this.attr(G({class:Bl.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:o},u))})},function(s){return s.transition(function(l,c){var u=zr(lk(G({path:l.path},r)),[l,c,a]);return ci(this,u,i.update)})},function(s){return s.transition(function(){var l=this,c=s0(this,i.exit);return Rl(c,function(){return l.remove()}),c})}).transitions()}function _J(t,e,n){var r=n.animate,i=n.connect,o=n.areaFill;if(e.length<2||!o||!i)return[];for(var a=Array.isArray(o)?o:[o,"transparent"],s=function(p){return a[p%a.length]},l=[],c=0;c<e.length-1;c++){var u=D([e[c].points,e[c+1].points],2),f=u[0],d=u[1],h=wJ(f,d,n);l.push({path:h,fill:s(c)})}return t.selectAll(Bl.region.class).data(l,function(p,v){return v}).join(function(p){return p.append("path").each(function(v,g){var y=zr(v,[v,g,l]);this.attr(y)}).attr("className",Bl.region.name)},function(p){return p.transition(function(v,g){var y=zr(v,[v,g,l]);return ci(this,y,r.update)})},function(p){return p.transition(function(){var v=this,g=s0(this,r.exit);return Rl(g,function(){return v.remove()}),g})}).transitions()}function SJ(t){var e=t.data,n=e===void 0?[]:e,r=t.closed;return r?n.map(function(i){var o=i.points,a=D(o,1),s=a[0];return G(G({},i),{points:Q(Q([],D(o),!1),[s],!1)})}):n}var EJ=function(t){st(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(n,r){n.type,n.center,n.areaFill,n.closed;var i=Qt(n,["type","center","areaFill","closed"]),o=SJ(n),a=_t(r).maybeAppendByClassName(Bl.lineGroup,"g"),s=_t(r).maybeAppendByClassName(Bl.regionGroup,"g"),l=OJ(a,o,n,i),c=_J(s,o,n);return Q(Q([],D(l),!1),D(c),!1)},e}(ln);function Yk(t,e){return Object.fromEntries(Object.entries(t).map(function(n){var r=D(n,2),i=r[0],o=r[1];return[i,zr(o,e)]}))}function wb(t,e){return e&&Br(e)?t.filter(e):t}function Wk(t,e){var n=e.startAngle,r=e.endAngle;return(r-n)*t+n}function l0(t,e){if(e.type==="linear"){var n=D(e.startPos,2),r=n[0],i=n[1],o=D(e.endPos,2),a=o[0],s=o[1],l=D([a-r,s-i],2),c=l[0],u=l[1];return ak([c,u])}var f=Fl(Wk(t,e));return[-Math.sin(f),Math.cos(f)]}function Ob(t,e,n){var r=l0(t,n);return HZ(r,e!=="positive")}function vf(t,e){return Ob(t,e.labelDirection,e)}function MJ(t,e){var n=D(e.startPos,2),r=n[0],i=n[1],o=D(e.endPos,2),a=o[0],s=o[1],l=D([a-r,s-i],2),c=l[0],u=l[1];return[r+c*t,i+u*t]}function PJ(t,e){var n=e.radius,r=D(e.center,2),i=r[0],o=r[1],a=Fl(Wk(t,e));return[i+n*Math.cos(a),o+n*Math.sin(a)]}function c0(t,e){return e.type==="linear"?MJ(t,e):PJ(t,e)}function Gk(t){return l0(0,t)[1]===0}function Hk(t){return l0(0,t)[0]===0}function Uk(t,e){return e-t===360}function Vk(t,e,n,r,i){var o=e-t,a=D([i,i],2),s=a[0],l=a[1],c=D([Fl(t),Fl(e)],2),u=c[0],f=c[1],d=function(E){return[n+i*Math.cos(E),r+i*Math.sin(E)]},h=D(d(u),2),p=h[0],v=h[1],g=D(d(f),2),y=g[0],m=g[1];if(Uk(t,e)){var b=(f+u)/2,x=D(d(b),2),w=x[0],O=x[1];return[["M",p,v],["A",s,l,0,1,0,w,O],["A",s,l,0,1,0,y,m]]}var _=o>180?1:0,S=t>e?0:1;return"M".concat(p,",").concat(v,",A").concat(s,",").concat(l,",0,").concat(_,",").concat(S,",").concat(y,",").concat(m)}function AJ(t){var e=t.attributes,n=e.startAngle,r=e.endAngle,i=e.center,o=e.radius;return Q(Q([n,r],D(i),!1),[o],!1)}function CJ(t,e,n,r){var i=e.startAngle,o=e.endAngle,a=e.center,s=e.radius;return t.selectAll(Zt.line.class).data([{path:Vk.apply(void 0,Q(Q([i,o],D(a),!1),[s],!1))}],function(l,c){return c}).join(function(l){return l.append("path").attr("className",Zt.line.name).styles(e).styles({path:function(c){return c.path}})},function(l){return l.transition(function(){var c=this,u=zZ(this,AJ(this),Q(Q([i,o],D(a),!1),[s],!1),r.update);if(u){var f=function(){var d=qT(c.attributes,"__keyframe_data__");c.style.path=Vk.apply(void 0,Q([],D(d),!1))};u.onframe=f,u.onfinish=f}return u}).styles(e)},function(l){return l.remove()}).styles(n).transitions()}function TJ(t,e){e.truncRange,e.truncShape,e.lineExtension}function kJ(t,e,n){n===void 0&&(n=[0,0]);var r=D([t,e,n],3),i=D(r[0],2),o=i[0],a=i[1],s=D(r[1],2),l=s[0],c=s[1],u=D(r[2],2),f=u[0],d=u[1],h=D([l-o,c-a],2),p=h[0],v=h[1],g=Math.sqrt(Math.pow(p,2)+Math.pow(v,2)),y=D([-f/g,d/g],2),m=y[0],b=y[1];return[m*p,m*v,b*p,b*v]}function Xk(t){var e=D(t,2),n=D(e[0],2),r=n[0],i=n[1],o=D(e[1],2),a=o[0],s=o[1];return{x1:r,y1:i,x2:a,y2:s}}function LJ(t,e,n,r){var i=e.showTrunc,o=e.startPos,a=e.endPos,s=e.truncRange,l=e.lineExtension,c=D([o,a],2),u=D(c[0],2),f=u[0],d=u[1],h=D(c[1],2),p=h[0],v=h[1],g=D(l?kJ(o,a,l):new Array(4).fill(0),4),y=g[0],m=g[1],b=g[2],x=g[3],w=function(L){return t.selectAll(Zt.line.class).data(L,function(I,$){return $}).join(function(I){return I.append("line").attr("className",function($){return"".concat(Zt.line.name," ").concat($.className)}).styles(n).transition(function($){return ci(this,Xk($.line),!1)})},function(I){return I.styles(n).transition(function($){var F=$.line;return ci(this,Xk(F),r.update)})},function(I){return I.remove()}).transitions()};if(!i||!s)return w([{line:[[f+y,d+m],[p+b,v+x]],className:Zt.line.name}]);var O=D(s,2),_=O[0],S=O[1],E=p-f,M=v-d,P=D([f+E*_,d+M*_],2),C=P[0],A=P[1],T=D([f+E*S,d+M*S],2),k=T[0],N=T[1],j=w([{line:[[f+y,d+m],[C,A]],className:Zt.lineFirst.name},{line:[[k,N],[p+b,v+x]],className:Zt.lineSecond.name}]);return TJ(t,e),j}function NJ(t,e,n,r){var i=n.showArrow,o=n.showTrunc,a=n.lineArrow,s=n.lineArrowOffset,l=n.lineArrowSize,c;if(e==="arc"?c=t.select(Zt.line.class):o?c=t.select(Zt.lineSecond.class):c=t.select(Zt.line.class),!i||!a||n.type==="arc"&&Uk(n.startAngle,n.endAngle)){var u=c.node();u&&(u.style.markerEnd=void 0);return}var f=ys(a);f.attr(r),db(f,l,!0),c.style("markerEnd",f).style("markerEndOffset",-s)}function IJ(t,e,n){var r=e.type,i,o=Pt(e,"line");return r==="linear"?i=LJ(t,e,sk(o,"arrow"),n):i=CJ(t,e,sk(o,"arrow"),n),NJ(t,r,e,o),i}function jJ(t,e){return Ob(t,e.gridDirection,e)}function qk(t){var e=t.type,n=t.gridCenter;return e==="linear"?n:n||t.center}function DJ(t,e){var n=e.gridLength;return t.map(function(r,i){var o=r.value,a=D(c0(o,e),2),s=a[0],l=a[1],c=D(po(jJ(o,e),n),2),u=c[0],f=c[1];return{id:i,points:[[s,l],[s+u,l+f]]}})}function $J(t,e){var n=e.gridControlAngles,r=qk(e);if(!r)throw new Error("grid center is not provide");if(t.length<2)throw new Error("Invalid grid data");if(!n||n.length===0)throw new Error("Invalid gridControlAngles");var i=D(r,2),o=i[0],a=i[1];return t.map(function(s,l){var c=s.value,u=D(c0(c,e),2),f=u[0],d=u[1],h=D([f-o,d-a],2),p=h[0],v=h[1],g=[];return n.forEach(function(y){var m=Fl(y),b=D([Math.cos(m),Math.sin(m)],2),x=b[0],w=b[1],O=p*x-v*w+o,_=p*w+v*x+a;g.push([O,_])}),{points:g,id:l}})}function FJ(t,e,n,r){var i=Pt(n,"grid"),o=i.type,a=i.areaFill,s=qk(n),l=wb(e,n.gridFilter),c=o==="segment"?DJ(l,n):$J(l,n),u=G(G({},i),{center:s,areaFill:Br(a)?l.map(function(f,d){return zr(a,[f,d,l])}):a,animate:r,data:c});return t.selectAll(Zt.grid.class).data([1]).join(function(f){return f.append(function(){return new EJ({style:u})}).attr("className",Zt.grid.name)},function(f){return f.transition(function(){return this.update(u)})},function(f){return f.remove()}).transitions()}var _b=function(){function t(e,n,r,i){this.set(e,n,r,i)}return Object.defineProperty(t.prototype,"left",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0},enumerable:!1,configurable:!0}),t.prototype.rotatedPoints=function(e,n,r){var i=this,o=i.x1,a=i.y1,s=i.x2,l=i.y2,c=Math.cos(e),u=Math.sin(e),f=n-n*c+r*u,d=r-n*u-r*c,h=[[c*o-u*l+f,u*o+c*l+d],[c*s-u*l+f,u*s+c*l+d],[c*o-u*a+f,u*o+c*a+d],[c*s-u*a+f,u*s+c*a+d]];return h},t.prototype.set=function(e,n,r,i){return r<e?(this.x2=e,this.x1=r):(this.x1=e,this.x2=r),i<n?(this.y2=n,this.y1=i):(this.y1=n,this.y2=i),this},t.prototype.defined=function(e){return this[e]!==Number.MAX_VALUE&&this[e]!==-Number.MAX_VALUE},t}();function Sb(t,e){var n=t.getEulerAngles()||0;t.setEulerAngles(0);var r=t.getLocalBounds(),i=D(r.min,2),o=i[0],a=i[1],s=D(r.max,2),l=s[0],c=s[1],u=Eb(t),f=u.width,d=u.height,h=d,p=0,v=0,g=o,y=a,m=rk(t);if(m){h-=1.5;var b=m.style.textAlign,x=m.style.textBaseline;b==="center"?g=(o+l)/2:(b==="right"||b==="end")&&(g=l),x==="middle"?y=(a+c)/2:x==="bottom"&&(y=c)}var w=D(gn(e),4),O=w[0],_=O===void 0?0:O,S=w[1],E=S===void 0?0:S,M=w[2],P=M===void 0?_:M,C=w[3],A=C===void 0?E:C,T=new _b((p+=o)-A,(v+=a)-_,p+f+E,v+h+P);return t.setEulerAngles(n),T.rotatedPoints(Fl(n),g,y)}function Eb(t){return t.__bbox__?t.__bbox__:t.getBBox()}function gf(t,e){return e[0]<=Math.max(t[0][0],t[1][0])&&e[0]<=Math.min(t[0][0],t[1][0])&&e[1]<=Math.max(t[0][1],t[1][1])&&e[1]<=Math.min(t[0][1],t[1][1])}function yf(t,e,n){var r=(e[1]-t[1])*(n[0]-e[0])-(e[0]-t[0])*(n[1]-e[1]);return r===0?0:r<0?2:1}function RJ(t,e){var n=yf(t[0],t[1],e[0]),r=yf(t[0],t[1],e[1]),i=yf(e[0],e[1],t[0]),o=yf(e[0],e[1],t[1]);return!!(n!==r&&i!==o||n===0&&gf(t,e[0])||r===0&&gf(t,e[1])||i===0&&gf(e,t[0])||o===0&&gf(e,t[1]))}function BJ(t,e){var n=t.length;if(n<3)return!1;var r=[e,[9999,e[1]]],i=0,o=0;do{var a=[t[o],t[(o+1)%n]];if(RJ(a,r)){if(yf(a[0],e,a[1])===0)return gf(a,e);i++}o=(o+1)%n}while(o!==0);return!!(i&1)}function zJ(t,e){return e.every(function(n){return BJ(t,n)})}function YJ(t,e,n){var r=t.x1,i=t.x2,o=t.y1,a=t.y2,s=[[r,o],[i,o],[i,a],[r,a]],l=Sb(e,n);return zJ(s,l)}function WJ(t,e){var n=D(t,4),r=n[0],i=n[1],o=n[2],a=n[3],s=D(e,4),l=s[0],c=s[1],u=s[2],f=s[3],d=o-r,h=a-i,p=u-l,v=f-c,g=d*v-p*h;if(g===0)return!1;var y=g>0,m=r-l,b=i-c,x=d*b-h*m;if(x<0===y)return!1;var w=p*b-v*m;return!(w<0===y||x>g===y||w>g===y)}function GJ(t,e){var n=[[t[0],t[1],t[2],t[3]],[t[2],t[3],t[4],t[5]],[t[4],t[5],t[6],t[7]],[t[6],t[7],t[0],t[1]]];return n.some(function(r){return WJ(e,r)})}function HJ(t,e,n){var r,i,o=Sb(t,n).flat(1),a=Sb(e,n).flat(1),s=[[o[0],o[1],o[2],o[3]],[o[0],o[1],o[4],o[5]],[o[4],o[5],o[6],o[7]],[o[2],o[3],o[6],o[7]]];try{for(var l=ur(s),c=l.next();!c.done;c=l.next()){var u=c.value;if(GJ(a,u))return!0}}catch(f){r={error:f}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}return!1}function UJ(t,e){var n=t.type,r=t.labelDirection,i=t.crossSize;if(!i)return!1;if(n==="arc"){var o=t.center,a=t.radius,s=D(o,2),l=s[0],c=s[1],u=r==="negative"?0:i,f=-a-u,d=a+u,h=D(gn(e),4),p=h[0],v=h[1],g=h[2],y=h[3];return new _b(l+f-y,c+f-p,l+d+v,c+d+g)}var m=D(t.startPos,2),b=m[0],x=m[1],w=D(t.endPos,2),O=w[0],_=w[1],S=D(Hk(t)?[-e,0,e,0]:[0,e,0,-e],4),E=S[0],M=S[1],P=S[2],C=S[3],A=vf(0,t),T=po(A,i),k=new _b(b,x,O,_);return k.x1+=C,k.y1+=E,k.x2+=M+T[0],k.y2+=P+T[1],k}function u0(t,e,n){var r,i,o=e.crossPadding,a=new Set,s=null,l=UJ(e,o),c=function(p){return l?YJ(l,p):!0},u=function(p,v){return p?!HJ(p,v,gn(n)):!0};try{for(var f=ur(t),d=f.next();!d.done;d=f.next()){var h=d.value;c(h)?!s||u(s,h)?s=h:(a.add(s),a.add(h)):a.add(h)}}catch(p){r={error:p}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}return Array.from(a)}function Mb(t,e){return e===void 0&&(e={}),eb(t)?0:typeof t=="number"?t:Math.floor(jZ(t,e))}function VJ(t,e,n,r){if(!(t.length<=1)){var i=e.suffix,o=i===void 0?"...":i,a=e.minLength,s=e.maxLength,l=s===void 0?1/0:s,c=e.step,u=c===void 0?" ":c,f=e.margin,d=f===void 0?[0,0,0,0]:f,h=nk(r.getTextShape(t[0])),p=Mb(u,h),v=a?Mb(a,h):p,g=Mb(l,h);(eb(g)||g===1/0)&&(g=Math.max.apply(null,t.map(function(O){return Eb(O).width})));var y=t.slice(),m=D(d,4);m[0],m[1],m[2],m[3];for(var b=function(O){if(y.forEach(function(_){r.ellipsis(r.getTextShape(_),O,o)}),y=u0(t,n,d),y.length<1)return{value:void 0}},x=g;x>v+p;x-=p){var w=b(x);if(typeof w=="object")return w.value}}}var XJ={parity:function(t,e){var n=e.seq,r=n===void 0?2:n;return t.filter(function(i,o){return o%r?(ra(i),!1):!0})}},qJ=function(t){return t.filter(ek)};function KJ(t,e,n,r){var i=t.length,o=e.keepHeader,a=e.keepTail;if(!(i<=1||i===2&&o&&a)){var s=XJ.parity,l=function(b){return b.forEach(r.show),b},c=2,u=t.slice(),f=t.slice(),d=Math.min.apply(Math,Q([1],D(t.map(function(b){return Eb(b).width})),!1));if(n.type==="linear"&&(Gk(n)||Hk(n))){var h=ck(t[0]).left,p=ck(t[i-1]).right,v=Math.abs(p-h)||1;c=Math.max(Math.floor(i*d/v),c)}var g,y;for(o&&(g=u.splice(0,1)[0]),a&&(y=u.splice(-1,1)[0],u.reverse()),l(u);c<t.length&&u0(qJ(y?Q(Q([y],D(f),!1),[g],!1):Q([g],D(f),!1)),n,e==null?void 0:e.margin).length;){if(y&&!g&&c%2===0){var m=u.splice(0,1);m.forEach(r.hide)}else if(y&&g){var m=u.splice(0,1);m.forEach(r.hide)}f=s(l(u),{seq:c}),c++}}}function ZJ(t,e,n,r){var i,o,a=e.optionalAngles,s=a===void 0?[0,45,90]:a,l=e.margin,c=e.recoverWhenFailed,u=c===void 0?!0:c,f=t.map(function(y){return y.getLocalEulerAngles()}),d=function(){return u0(t,n,l).length<1},h=function(y){return t.forEach(function(m,b){var x=Array.isArray(y)?y[b]:y;r.rotate(m,+x)})};try{for(var p=ur(s),v=p.next();!v.done;v=p.next()){var g=v.value;if(h(g),d())return}}catch(y){i={error:y}}finally{try{v&&!v.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}u&&h(f)}function QJ(t){var e=t.type,n=t.labelDirection;return e==="linear"&&Gk(t)?n==="negative"?"bottom":"top":"middle"}function JJ(t,e,n,r){var i=e.wordWrapWidth,o=i===void 0?50:i,a=e.maxLines,s=a===void 0?3:a,l=e.recoverWhenFailed,c=l===void 0?!0:l,u=e.margin,f=u===void 0?[0,0,0,0]:u,d=t.map(function(m){return m.attr("maxLines")||1}),h=Math.min.apply(Math,Q([],D(d),!1)),p=function(){return u0(t,n,f).length<1},v=QJ(n),g=function(m){return t.forEach(function(b,x){var w=Array.isArray(m)?m[x]:m;r.wrap(b,o,w,v)})};if(!(h>s)){for(var y=h;y<=s;y++)if(g(y),p())return;c&&g(d)}}var ttt=new Map([["hide",KJ],["rotate",ZJ],["ellipsis",VJ],["wrap",JJ]]);function ett(t,e,n){return e.labelOverlap.length<1?!1:n==="hide"?!NZ(t[0]):n==="rotate"?!t.some(function(r){var i;return!!(!((i=r.attr("transform"))===null||i===void 0)&&i.includes("rotate"))}):n==="ellipsis"||n==="wrap"?t.filter(function(r){return r.querySelector("text")}).length>1:!0}function ntt(t,e,n){var r=e.labelOverlap,i=r===void 0?[]:r;i.length&&i.forEach(function(o){var a=o.type,s=ttt.get(a);ett(t,e,a)&&(s==null||s(t,o,e,n))})}function rtt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=function(r){return r==="positive"?-1:1};return t.reduce(function(r,i){return r*n(i)},1)}function Kk(t){for(var e=t;e<0;)e+=360;return Math.round(e%360)}function Pb(t,e){var n=D(t,2),r=n[0],i=n[1],o=D(e,2),a=o[0],s=o[1],l=D([r*a+i*s,r*s-i*a],2),c=l[0],u=l[1];return Math.atan2(u,c)}function itt(t){var e=(t+360)%180;return vn(e,-90,90)||(e+=180),e}function ott(t,e,n){var r,i=n.labelAlign,o=(r=e.style.transform)===null||r===void 0?void 0:r.includes("rotate");if(o)return e.getLocalEulerAngles();var a=0,s=vf(t.value,n),l=l0(t.value,n);return i==="horizontal"?0:(i==="perpendicular"?a=Pb([1,0],s):a=Pb([l[0]<0?-1:1,0],l),itt(JT(a)))}function Zk(t,e,n){var r=n.type,i=n.labelAlign,o=vf(t,n),a=Kk(e),s=Kk(JT(Pb([1,0],o))),l="center",c="middle";return r==="linear"?[90,270].includes(s)&&a===0?(l="center",c=o[1]===1?"top":"bottom"):!(s%180)&&[90,270].includes(a)?l="center":s===0?(vn(a,0,90,!1,!0)||vn(a,0,90)||vn(a,270,360))&&(l="start"):s===90?vn(a,0,90,!1,!0)?l="start":(vn(a,90,180)||vn(a,270,360))&&(l="end"):s===270?vn(a,0,90,!1,!0)?l="end":(vn(a,90,180)||vn(a,270,360))&&(l="start"):s===180&&(a===90?l="start":(vn(a,0,90)||vn(a,270,360))&&(l="end")):i==="parallel"?vn(s,0,180,!0)?c="top":c="bottom":i==="horizontal"?vn(s,90,270,!1)?l="end":(vn(s,270,360,!1)||vn(s,0,90))&&(l="start"):i==="perpendicular"&&(vn(s,90,270)?l="end":l="start"),{textAlign:l,textBaseline:c}}function att(t,e,n){e.setLocalEulerAngles(t);var r=e.__data__.value,i=Zk(r,t,n),o=e.querySelector(Zt.labelItem.class);o&&Jk(o,i)}function Qk(t,e,n){var r=n.showTick,i=n.tickLength,o=n.tickDirection,a=n.labelDirection,s=n.labelSpacing,l=e.indexOf(t),c=zr(s,[t,l,e]),u=D([vf(t.value,n),rtt(a,o)],2),f=u[0],d=u[1],h=d===1?zr(r?i:0,[t,l,e]):0,p=D(ff(po(f,c+h),c0(t.value,n)),2),v=p[0],g=p[1];return{x:v,y:g}}function stt(t,e,n,r){var i=r.labelFormatter,o=Br(i)?function(){return ys(zr(i,[t,e,n,vf(t.value,r)]))}:function(){return ys(t.label||"")};return o}function Jk(t,e){t.nodeName==="text"&&t.attr(e)}function t3(t){ntt(this.node().childNodes,t,{hide:ra,show:uf,rotate:function(e,n){att(+n,e,t)},ellipsis:function(e,n,r){e&&lb(e,n||1/0,r)},wrap:function(e,n,r){e&&DZ(e,n,r)},getTextShape:function(e){return e.querySelector("text")}})}function e3(t,e,n,r,i){var o=n.indexOf(e),a=_t(t).append(stt(e,o,n,i)).attr("className",Zt.labelItem.name).node(),s=D(vo(Yk(r,[e,o,n])),2),l=s[0],c=s[1],u=c.transform,f=Qt(c,["transform"]);t0(t,u);var d=ott(e,t,i);return t.setLocalEulerAngles(+d),Jk(a,G(G({},Zk(e.value,d,i)),l)),t0(t,u),t.attr(f),a}function ltt(t,e,n,r){var i=wb(e,n.labelFilter),o=Pt(n,"label");return t.selectAll(Zt.label.class).data(i,function(a,s){return s}).join(function(a){return a.append("g").attr("className",Zt.label.name).transition(function(s){return e3(this,s,e,o,n),this.attr(Qk(s,e,n)),this.__bbox__=s.bbox,null}).call(function(){return t3.call(t,n)})},function(a){return a.transition(function(s){var l=this.querySelector(Zt.labelItem.class),c=e3(this,s,e,o,n),u=yJ(l,c,r.update),f=ci(this,Qk(s,e,n),r.update);return this.__bbox__=s.bbox,Q(Q([],D(u),!1),[f],!1)}).call(function(s){var l=qT(s,"_transitions").flat().filter(ek);vJ(l,function(){return t3.call(t,n)})})},function(a){return a.transition(function(){var s=this,l=s0(this.childNodes[0],r.exit);return Rl(l,function(){return _t(s).remove()}),l})}).transitions()}function n3(t,e){return Ob(t,e.tickDirection,e)}function ctt(t,e){var n=D(t,2),r=n[0],i=n[1];return[[0,0],[r*e,i*e]]}function utt(t,e,n,r,i){var o=i.tickLength,a=D(ctt(r,zr(o,[t,e,n])),2),s=D(a[0],2),l=s[0],c=s[1],u=D(a[1],2),f=u[0],d=u[1];return{x1:l,x2:f,y1:c,y2:d}}function ftt(t,e,n,r,i){var o=i.tickFormatter,a=n3(e.value,i),s="line";return Br(o)&&(s=function(){return zr(o,[e,n,r,a])}),t.append(s).attr("className",Zt.tickItem.name)}function dtt(t,e,n,r,i,o,a){var s=n3(t.value,o),l=utt(t,e,n,s,o),c=l.x1,u=l.x2,f=l.y1,d=l.y2,h=D(vo(Yk(a,[t,e,n,s])),2),p=h[0],v=h[1];r.node().nodeName==="line"&&r.styles(G({x1:c,x2:u,y1:f,y2:d},p)),i.attr(v),r.styles(p)}function r3(t,e,n,r,i,o){var a=ftt(_t(this),t,e,n,r);dtt(t,e,n,a,this,r,i);var s=D(c0(t.value,r),2),l=s[0],c=s[1];return ci(this,{x:l,y:c},o)}function htt(t,e,n,r){var i=wb(e,n.tickFilter),o=Pt(n,"tick");return t.selectAll(Zt.tick.class).data(i,function(a){return a.id||a.label}).join(function(a){return a.append("g").attr("className",Zt.tick.name).transition(function(s,l){return r3.call(this,s,l,i,n,o,!1)})},function(a){return a.transition(function(s,l){return this.removeChildren(),r3.call(this,s,l,i,n,o,r.update)})},function(a){return a.transition(function(){var s=this,l=s0(this.childNodes[0],r.exit);return Rl(l,function(){return s.remove()}),l})}).transitions()}var i3=Yr({text:"text"},"title");function f0(t){return/\S+-\S+/g.test(t)?t.split("-").map(function(e){return e[0]}):t.length>2?[t[0]]:t.split("")}function ptt(t,e){var n=t.attributes,r=n.position,i=n.spacing,o=n.inset,a=n.text,s=t.getBBox(),l=e.getBBox(),c=f0(r),u=D(gn(a?i:0),4),f=u[0],d=u[1],h=u[2],p=u[3],v=D(gn(o),4),g=v[0],y=v[1],m=v[2],b=v[3],x=D([p+d,f+h],2),w=x[0],O=x[1],_=D([b+y,g+m],2),S=_[0],E=_[1];if(c[0]==="l")return new Oe(s.x,s.y,l.width+s.width+w+S,Math.max(l.height+E,s.height));if(c[0]==="t")return new Oe(s.x,s.y,Math.max(l.width+S,s.width),l.height+s.height+O+E);var M=D([e.attributes.width||l.width,e.attributes.height||l.height],2),P=M[0],C=M[1];return new Oe(l.x,l.y,P+s.width+w+S,C+s.height+O+E)}function vtt(t,e){var n=Object.entries(e).reduce(function(r,i){var o=D(i,2),a=o[0],s=o[1],l=t.node().attr(a);return l||(r[a]=s),r},{});t.styles(n)}function gtt(t){var e,n,r,i,o=t,a=o.width,s=o.height,l=o.position,c=D([+a/2,+s/2],2),u=c[0],f=c[1],d=D([+u,+f,"center","middle"],4),h=d[0],p=d[1],v=d[2],g=d[3],y=f0(l);return y.includes("l")&&(e=D([0,"start"],2),h=e[0],v=e[1]),y.includes("r")&&(n=D([+a,"end"],2),h=n[0],v=n[1]),y.includes("t")&&(r=D([0,"top"],2),p=r[0],g=r[1]),y.includes("b")&&(i=D([+s,"bottom"],2),p=i[0],g=i[1]),{x:h,y:p,textAlign:v,textBaseline:g}}var o3=function(t){st(e,t);function e(n){return t.call(this,n,{text:"",width:0,height:0,fill:"#4a505a",fontWeight:"bold",fontSize:12,fontFamily:"sans-serif",inset:0,spacing:0,position:"top-left"})||this}return e.prototype.getAvailableSpace=function(){var n=this,r=this.attributes,i=r.width,o=r.height,a=r.position,s=r.spacing,l=r.inset,c=n.querySelector(i3.text.class);if(!c)return new Oe(0,0,+i,+o);var u=c.getBBox(),f=u.width,d=u.height,h=D(gn(s),4),p=h[0],v=h[1],g=h[2],y=h[3],m=D([0,0,+i,+o],4),b=m[0],x=m[1],w=m[2],O=m[3],_=f0(a);if(_.includes("i"))return new Oe(b,x,w,O);_.forEach(function(N,j){var L,I,$,F;N==="t"&&(L=D(j===0?[d+g,+o-d-g]:[0,+o],2),x=L[0],O=L[1]),N==="r"&&(I=D([+i-f-y],1),w=I[0]),N==="b"&&($=D([+o-d-p],1),O=$[0]),N==="l"&&(F=D(j===0?[f+v,+i-f-v]:[0,+i],2),b=F[0],w=F[1])});var S=D(gn(l),4),E=S[0],M=S[1],P=S[2],C=S[3],A=D([C+M,E+P],2),T=A[0],k=A[1];return new Oe(b+C,x+E,w-T,O-k)},e.prototype.getBBox=function(){return this.title?this.title.getBBox():new Oe(0,0,0,0)},e.prototype.render=function(n,r){var i=this;n.width,n.height,n.position,n.spacing;var o=Qt(n,["width","height","position","spacing"]),a=D(vo(o),1),s=a[0],l=gtt(n),c=l.x,u=l.y,f=l.textAlign,d=l.textBaseline;Jn(!!o.text,_t(r),function(h){i.title=h.maybeAppendByClassName(i3.text,"text").styles(s).call(vtt,{x:c,y:u,textAlign:f,textBaseline:d}).node()})},e}(ln);function ytt(t,e,n){var r=n.titlePosition,i=r===void 0?"lb":r,o=n.titleSpacing,a=f0(i),s=t.node().getLocalBounds(),l=D(s.min,2),c=l[0],u=l[1],f=D(s.halfExtents,2),d=f[0],h=f[1],p=D(e.node().getLocalBounds().halfExtents,2),v=p[0],g=p[1],y=D([c+d,u+h],2),m=y[0],b=y[1],x=D(gn(o),4),w=x[0],O=x[1],_=x[2],S=x[3];if(["start","end"].includes(i)&&n.type==="linear"){var E=n.startPos,M=n.endPos,P=D(i==="start"?[E,M]:[M,E],2),C=P[0],A=P[1],T=ak([-A[0]+C[0],-A[1]+C[1]]),k=D(po(T,w),2),N=k[0],j=k[1];return{x:C[0]+N,y:C[1]+j}}return a.includes("t")&&(b-=h+g+w),a.includes("r")&&(m+=d+v+O),a.includes("l")&&(m-=d+v*2+S),a.includes("b")&&(b+=h+g*2+_),{x:m,y:b}}function mtt(t,e,n){var r=t.cloneNode(!0);r.style.transform="scale(1, 1)",r.style.transform="none";var i=r.getBBox().height;if(e==="vertical"){if(n==="left")return"rotate(-90) translate(0, ".concat(i/2,")");if(n==="right")return"rotate(-90) translate(0, -".concat(i/2,")")}return""}function a3(t,e,n,r,i){var o=Pt(r,"title"),a=D(vo(o),2),s=a[0],l=a[1],c=l.transform,u=Qt(l,["transform"]);t.styles(s),e.styles(u);var f=c||mtt(t.node(),s.direction,s.position);t0(t.node(),f);var d=ytt(_t(n._offscreen||n.querySelector(Zt.mainGroup.class)),e,r),h=d.x,p=d.y,v=ci(e.node(),{x:h,y:p},i);return t0(t.node(),f),v}function btt(t,e,n,r){var i=n.titleText;return t.selectAll(Zt.title.class).data([{title:i}].filter(function(o){return!!o.title}),function(o,a){return o.title}).join(function(o){return o.append(function(){return ys(i)}).attr("className",Zt.title.name).transition(function(){return a3(_t(this),t,e,n,r.enter)})},function(o){return o.transition(function(){return a3(_t(this),t,e,n,r.update)})},function(o){return o.remove()}).transitions()}function s3(t,e,n,r){var i=t.showLine,o=t.showTick,a=t.showLabel,s=e.maybeAppendByClassName(Zt.lineGroup,"g"),l=Jn(i,s,function(h){return IJ(h,t,r)})||[],c=e.maybeAppendByClassName(Zt.tickGroup,"g"),u=Jn(o,c,function(h){return htt(h,n,t,r)})||[],f=e.maybeAppendByClassName(Zt.labelGroup,"g"),d=Jn(a,f,function(h){return ltt(h,n,t,r)})||[];return Q(Q(Q([],D(l),!1),D(u),!1),D(d),!1).filter(function(h){return!!h})}var Ab=function(t){st(e,t);function e(n){return t.call(this,n,bb)||this}return e.prototype.render=function(n,r,i){var o=this,a=n.titleText,s=n.data,l=n.animate,c=n.showTitle,u=n.showGrid,f=n.dataThreshold,d=n.truncRange,h=KZ(s,f).filter(function(w){var O=w.value;return!(d&&O>d[0]&&O<d[1])}),p=Nk(i===void 0?l:i),v=_t(r).maybeAppendByClassName(Zt.gridGroup,"g"),g=Jn(u,v,function(w){return FJ(w,h,n,p)})||[],y=_t(r).maybeAppendByClassName(Zt.mainGroup,"g");a&&(!this.initialized&&p.enter||this.initialized&&p.update)&&s3(n,_t(this.offscreenGroup),h,Nk(!1));var m=s3(n,_t(y.node()),h,p),b=_t(r).maybeAppendByClassName(Zt.titleGroup,"g"),x=Jn(c,b,function(w){return btt(w,o,n,p)})||[];return Q(Q(Q([],D(g),!1),D(m),!1),D(x),!1).flat().filter(function(w){return!!w})},e}(ln),Wr=Yr({prevBtnGroup:"prev-btn-group",prevBtn:"prev-btn",nextBtnGroup:"next-btn-group",nextBtn:"next-btn",pageInfoGroup:"page-info-group",pageInfo:"page-info",playWindow:"play-window",contentGroup:"content-group",controller:"controller",clipPath:"clip-path"},"navigator"),xtt=function(t){st(e,t);function e(n){var r=t.call(this,n,{animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonPath:MQ(0,0,6),buttonSize:12,controllerPadding:5,controllerSpacing:5,formatter:function(i,o){return"".concat(i,"/").concat(o)},defaultPage:0,loop:!1,orientation:"horizontal",pageNumFill:"black",pageNumFontSize:12,pageNumTextAlign:"start",pageNumTextBaseline:"middle"})||this;return r.playState="idle",r.contentGroup=r.appendChild(new sn({class:Wr.contentGroup.name})),r.playWindow=r.contentGroup.appendChild(new sn({class:Wr.playWindow.name})),r.innerCurrPage=r.defaultPage,r}return Object.defineProperty(e.prototype,"defaultPage",{get:function(){var n=this.attributes.defaultPage;return fo(n,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"controllerShape",{get:function(){return this.totalPages>1?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageShape",{get:function(){var n=this.pageViews,r=D(sQ(n.map(function(f){var d=f.getBBox(),h=d.width,p=d.height;return[h,p]})).map(function(f){return Math.max.apply(Math,Q([],D(f),!1))}),2),i=r[0],o=r[1],a=this.attributes,s=a.pageWidth,l=s===void 0?i:s,c=a.pageHeight,u=c===void 0?o:c;return{pageWidth:l,pageHeight:u}},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(e.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var n=t.prototype.getBBox.call(this),r=n.x,i=n.y,o=this.controllerShape,a=this.pageShape,s=a.pageWidth,l=a.pageHeight;return new Oe(r,i,s+o.width,l)},e.prototype.goTo=function(n){var r=this,i=this.attributes.animate,o=this,a=o.currPage,s=o.playState,l=o.playWindow,c=o.pageViews;if(s!=="idle"||n<0||c.length<=0||n>=c.length)return null;c[a].setLocalPosition(0,0),this.prepareFollowingPage(n);var u=D(this.getFollowingPageDiff(n),2),f=u[0],d=u[1];this.playState="running";var h=jk(l,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-f,", ").concat(-d,")")}],i);return Rl(h,function(){r.innerCurrPage=n,r.playState="idle",r.setVisiblePages([n]),r.updatePageInfo()}),h},e.prototype.prev=function(){var n=this.attributes.loop,r=this.pageViews.length,i=this.currPage;if(!n&&i<=0)return null;var o=n?(i-1+r)%r:fo(i-1,0,r);return this.goTo(o)},e.prototype.next=function(){var n=this.attributes.loop,r=this.pageViews.length,i=this.currPage;if(!n&&i>=r-1)return null;var o=n?(i+1)%r:fo(i+1,0,r);return this.goTo(o)},e.prototype.renderClipPath=function(n){var r=this.pageShape,i=r.pageWidth,o=r.pageHeight;if(!i||!o){this.contentGroup.style.clipPath=void 0;return}this.clipPath=n.maybeAppendByClassName(Wr.clipPath,"rect").styles({width:i,height:o}),this.contentGroup.attr("clipPath",this.clipPath.node())},e.prototype.setVisiblePages=function(n){this.playWindow.children.forEach(function(r,i){n.includes(i)?uf(r):ra(r)})},e.prototype.adjustControllerLayout=function(){var n=this,r=n.prevBtnGroup,i=n.nextBtnGroup,o=n.pageInfoGroup,a=this.attributes,s=a.orientation,l=a.controllerPadding,c=o.getBBox(),u=c.width;c.height;var f=D(s==="horizontal"?[-180,0]:[-90,90],2),d=f[0],h=f[1];r.setLocalEulerAngles(d),i.setLocalEulerAngles(h);var p=r.getBBox(),v=p.width,g=p.height,y=i.getBBox(),m=y.width,b=y.height,x=Math.max(v,u,m),w=s==="horizontal"?{offset:[[0,0],[v/2+l,0],[v+u+l*2,0]],textAlign:"start"}:{offset:[[x/2,-g-l],[x/2,0],[x/2,b+l]],textAlign:"center"},O=D(w.offset,3),_=D(O[0],2),S=_[0],E=_[1],M=D(O[1],2),P=M[0],C=M[1],A=D(O[2],2),T=A[0],k=A[1],N=w.textAlign,j=o.querySelector("text");j&&(j.style.textAlign=N),r.setLocalPosition(S,E),o.setLocalPosition(P,C),i.setLocalPosition(T,k)},e.prototype.updatePageInfo=function(){var n,r=this,i=r.currPage,o=r.pageViews,a=r.attributes.formatter;o.length<2||((n=this.pageInfoGroup.querySelector(Wr.pageInfo.class))===null||n===void 0||n.attr("text",a(i+1,o.length)),this.adjustControllerLayout())},e.prototype.getFollowingPageDiff=function(n){var r=this.currPage;if(r===n)return[0,0];var i=this.attributes.orientation,o=this.pageShape,a=o.pageWidth,s=o.pageHeight,l=n<r?-1:1;return i==="horizontal"?[l*a,0]:[0,l*s]},e.prototype.prepareFollowingPage=function(n){var r=this,i=r.currPage,o=r.pageViews;if(this.setVisiblePages([n,i]),n!==i){var a=D(this.getFollowingPageDiff(n),2),s=a[0],l=a[1];o[n].setLocalPosition(s,l)}},e.prototype.renderController=function(n){var r=this,i=this.attributes.controllerSpacing,o=this.pageShape,a=o.pageWidth,s=o.pageHeight,l=this.pageViews.length>=2,c=n.maybeAppendByClassName(Wr.controller,"g");if(Kp(c.node(),l),!!l){var u=Pt(this.attributes,"button"),f=Pt(this.attributes,"pageNum"),d=D(vo(u),2),h=d[0],p=d[1],v=h.size,g=Qt(h,["size"]),y=!c.select(Wr.prevBtnGroup.class).node(),m=c.maybeAppendByClassName(Wr.prevBtnGroup,"g").styles(p);this.prevBtnGroup=m.node();var b=m.maybeAppendByClassName(Wr.prevBtn,"path"),x=c.maybeAppendByClassName(Wr.nextBtnGroup,"g").styles(p);this.nextBtnGroup=x.node();var w=x.maybeAppendByClassName(Wr.nextBtn,"path");[b,w].forEach(function(_){_.styles(G(G({},g),{transformOrigin:"center"})),db(_.node(),v,!0)});var O=c.maybeAppendByClassName(Wr.pageInfoGroup,"g");this.pageInfoGroup=O.node(),O.maybeAppendByClassName(Wr.pageInfo,"text").styles(f),this.updatePageInfo(),c.node().setLocalPosition(a+i,s/2),y&&(this.prevBtnGroup.addEventListener("click",function(){r.prev()}),this.nextBtnGroup.addEventListener("click",function(){r.next()}))}},e.prototype.render=function(n,r){var i=_t(r);this.renderClipPath(i),this.renderController(i),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},e.prototype.bindEvents=function(){var n=this,r=SZ(function(){return n.render(n.attributes,n)},50);this.playWindow.addEventListener(St.INSERTED,r),this.playWindow.addEventListener(St.REMOVED,r)},e}(ln);function wtt(t,e,n){var r=Math.round((t-n)/e);return n+r*e}function Ott(t,e,n){var r=1.4,i=r*n;return[["M",t-n,e-i],["L",t+n,e-i],["L",t+n,e+i],["L",t-n,e+i],["Z"]]}var l3=1.4,c3=.4;function _tt(t,e,n){var r=n,i=r*l3,o=r/2,a=r/6,s=t+i*c3;return[["M",t,e],["L",s,e+o],["L",t+i,e+o],["L",t+i,e-o],["L",s,e-o],["Z"],["M",s,e+a],["L",t+i-2,e+a],["M",s,e-a],["L",t+i-2,e-a]]}function Stt(t,e,n){var r=n,i=r*l3,o=r/2,a=r/6,s=e+i*c3;return[["M",t,e],["L",t-o,s],["L",t-o,e+i],["L",t+o,e+i],["L",t+o,s],["Z"],["M",t-a,s],["L",t-a,e+i-2],["M",t+a,s],["L",t+a,e+i-2]]}ne.registerSymbol("hiddenHandle",Ott),ne.registerSymbol("verticalHandle",_tt),ne.registerSymbol("horizontalHandle",Stt);function Ett(t,e,n,r){var i,o=D(t,2),a=o[0],s=o[1],l=D(e,2),c=l[0],u=l[1],f=D(n,2),d=f[0],h=f[1],p=D([c,u],2),v=p[0],g=p[1],y=g-v;return v>g&&(i=D([g,v],2),v=i[0],g=i[1]),y>s-a?[a,s]:v<a?d===a&&h===g?[a,g]:[a,y+a]:g>s?h===s&&d===v?[v,s]:[s-y,s]:[v,g]}function Di(t,e,n){return t===void 0&&(t="horizontal"),t==="horizontal"?e:n}var mr=Yr({layout:"flex",markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label",valueGroup:"value-group",value:"value",backgroundGroup:"background-group",background:"background"},"legend-category-item");function Mtt(t){var e=t.querySelector(mr.marker.class);return e?e.style:{}}var Ptt=function(t){st(e,t);function e(n){return t.call(this,n,{span:[1,1],marker:function(){return new nf({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}return Object.defineProperty(e.prototype,"showValue",{get:function(){var n=this.attributes.valueText;return n?typeof n=="string"||typeof n=="number"?n!=="":typeof n=="function"?!0:n.attr("text")!=="":!1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"actualSpace",{get:function(){var n=this.labelGroup,r=this.valueGroup,i=this.attributes.markerSize,o=n.node().getBBox(),a=o.width,s=o.height,l=r.node().getBBox(),c=l.width,u=l.height;return{markerWidth:i,labelWidth:a,valueWidth:c,height:Math.max(i,s,u)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"span",{get:function(){var n=this.attributes.span;if(!n)return[1,1];var r=D(gn(n),2),i=r[0],o=r[1],a=this.showValue?o:0,s=i+a;return[i/s,a/s]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var n,r=this.attributes,i=r.markerSize,o=r.width,a=this.actualSpace,s=a.markerWidth,l=a.height,c=this.actualSpace,u=c.labelWidth,f=c.valueWidth,d=D(this.spacing,2),h=d[0],p=d[1];if(o){var v=o-i-h-p,g=D(this.span,2),y=g[0],m=g[1];n=D([y*v,m*v],2),u=n[0],f=n[1]}var b=s+u+f+h+p;return{width:b,height:l,markerWidth:s,labelWidth:u,valueWidth:f}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){var n=this.attributes.spacing;if(!n)return[0,0];var r=D(gn(n),2),i=r[0],o=r[1];return this.showValue?[i,o]:[i,0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"layout",{get:function(){var n=this.shape,r=n.markerWidth,i=n.labelWidth,o=n.valueWidth,a=n.width,s=n.height,l=D(this.spacing,2),c=l[0],u=l[1];return{height:s,width:a,markerWidth:r,labelWidth:i,valueWidth:o,position:[r/2,r+c,r+i+c+u]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleSize",{get:function(){var n=Mtt(this.markerGroup.node()),r=this.attributes,i=r.markerSize,o=r.markerStrokeWidth,a=o===void 0?n.strokeWidth:o,s=r.markerLineWidth,l=s===void 0?n.lineWidth:s,c=r.markerStroke,u=c===void 0?n.stroke:c,f=+(a||l||(u?1:0))*Math.sqrt(2),d=this.markerGroup.node().getBBox(),h=d.width,p=d.height;return(1-f/Math.max(h,p))*i},enumerable:!1,configurable:!0}),e.prototype.renderMarker=function(n){var r=this,i=this.attributes.marker,o=Pt(this.attributes,"marker");this.markerGroup=n.maybeAppendByClassName(mr.markerGroup,"g").style("zIndex",0),Jn(!!i,this.markerGroup,function(){var a=r.markerGroup.node(),s=a.getElementsByClassName(mr.marker.name)[0],l=i();s?l.nodeName===s.nodeName?(nQ(s,l),_t(s).styles(o)):(s.remove(),_t(l).attr("className",mr.marker.name).styles(o),a.appendChild(l)):(_t(l).attr("className",mr.marker.name).styles(o),a.appendChild(l)),r.markerGroup.node().scale(1/r.markerGroup.node().getScale()[0]),db(r.markerGroup.node(),r.scaleSize,!0)})},e.prototype.renderLabel=function(n){var r=Pt(this.attributes,"label"),i=r.text,o=Qt(r,["text"]);this.labelGroup=n.maybeAppendByClassName(mr.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(mr.label,function(){return ys(i)}).styles(o)},e.prototype.renderValue=function(n){var r=this,i=Pt(this.attributes,"value"),o=i.text,a=Qt(i,["text"]);this.valueGroup=n.maybeAppendByClassName(mr.valueGroup,"g").style("zIndex",0),Jn(this.showValue,this.valueGroup,function(){r.valueGroup.maybeAppendByClassName(mr.value,function(){return ys(o)}).styles(a)})},e.prototype.renderBackground=function(n){var r=this.shape,i=r.width,o=r.height,a=Pt(this.attributes,"background");this.background=n.maybeAppendByClassName(mr.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(mr.background,"rect").styles(G({width:i,height:o},a))},e.prototype.adjustLayout=function(){var n=this.layout,r=n.labelWidth,i=n.valueWidth,o=n.height,a=D(n.position,3),s=a[0],l=a[1],c=a[2],u=o/2;this.markerGroup.styles({x:s,y:u}),this.labelGroup.styles({x:l,y:u}),lb(this.labelGroup.select(mr.label.class).node(),Math.ceil(r)),this.showValue&&(this.valueGroup.styles({x:c,y:u}),lb(this.valueGroup.select(mr.value.class).node(),Math.ceil(i)))},e.prototype.render=function(n,r){var i=_t(r);this.renderMarker(i),this.renderLabel(i),this.renderValue(i),this.renderBackground(i),this.adjustLayout()},e}(ln),xs=Yr({page:"item-page",navigator:"navigator",item:"item"},"items"),u3=function(t,e,n){return n===void 0&&(n=!0),t?e(t):n},Att=function(t){st(e,t);function e(n){var r=t.call(this,n,{data:[],gridRow:1/0,gridCol:void 0,padding:0,width:1e3,height:100,rowPadding:0,colPadding:0,layout:"flex",orientation:"horizontal",click:ab,mouseenter:ab,mouseleave:ab})||this;return r.navigatorShape=[0,0],r}return Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"grid",{get:function(){var n=this.attributes,r=n.gridRow,i=n.gridCol,o=n.data;if(!r&&!i)throw new Error("gridRow and gridCol can not be set null at the same time");return r&&i?[r,i]:r?[r,o.length]:[o.length,i]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderData",{get:function(){var n=this.attributes,r=n.data,i=n.layout,o=Pt(this.attributes,"item"),a=r.map(function(s,l){var c=s.id,u=c===void 0?l:c,f=s.label,d=s.value;return{id:"".concat(u),index:l,style:G({layout:i,labelText:f,valueText:d},Object.fromEntries(Object.entries(o).map(function(h){var p=D(h,2),v=p[0],g=p[1];return[v,zr(g,[s,l,r])]})))}});return a},enumerable:!1,configurable:!0}),e.prototype.getGridLayout=function(){var n=this,r=this.attributes,i=r.orientation,o=r.width,a=r.rowPadding,s=r.colPadding,l=D(this.navigatorShape,1),c=l[0],u=D(this.grid,2),f=u[0],d=u[1],h=d*f,p=0;return this.pageViews.children.map(function(v,g){var y,m,b=Math.floor(g/h),x=g%h,w=n.ifHorizontal(d,f),O=[Math.floor(x/w),x%w];i==="vertical"&&O.reverse();var _=D(O,2),S=_[0],E=_[1],M=(o-c-(d-1)*s)/d,P=v.getBBox().height,C=D([0,0],2),A=C[0],T=C[1];return i==="horizontal"?(y=D([p,S*(P+a)],2),A=y[0],T=y[1],p=E===d-1?0:p+M+s):(m=D([E*(M+s),p],2),A=m[0],T=m[1],p=S===f-1?0:p+P+a),{page:b,index:g,row:S,col:E,pageIndex:x,width:M,height:P,x:A,y:T}})},e.prototype.getFlexLayout=function(){var n=this.attributes,r=n.width,i=n.height,o=n.rowPadding,a=n.colPadding,s=D(this.navigatorShape,1),l=s[0],c=D(this.grid,2),u=c[0],f=c[1],d=D([r-l,i],2),h=d[0],p=d[1],v=D([0,0,0,0,0,0,0,0],8),g=v[0],y=v[1],m=v[2],b=v[3],x=v[4],w=v[5],O=v[6],_=v[7];return this.pageViews.children.map(function(S,E){var M,P,C,A,T=S.getBBox(),k=T.width,N=T.height,j=O===0?0:a,L=O+j+k;if(L<=h&&u3(x,function($){return $<f}))return M=D([O+j,_,L],3),g=M[0],y=M[1],O=M[2],{width:k,height:N,x:g,y,page:m,index:E,pageIndex:b++,row:w,col:x++};P=D([w+1,0,0,_+N+o],4),w=P[0],x=P[1],O=P[2],_=P[3];var I=_+N;return I<=p&&u3(w,function($){return $<u})?(C=D([O,_,k],3),g=C[0],y=C[1],O=C[2],{width:k,height:N,x:g,y,page:m,index:E,pageIndex:b++,row:w,col:x++}):(A=D([0,0,k,0,m+1,0,0,0],8),g=A[0],y=A[1],O=A[2],_=A[3],m=A[4],b=A[5],w=A[6],x=A[7],{width:k,height:N,x:g,y,page:m,index:E,pageIndex:b++,row:w,col:x++})})},Object.defineProperty(e.prototype,"itemsLayout",{get:function(){this.navigatorShape=[0,0];var n=this.attributes.layout==="grid"?this.getGridLayout:this.getFlexLayout,r=n.call(this);return r.slice(-1)[0].page>0?(this.navigatorShape=[55,0],n.call(this)):r},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(n,r){var i=this.attributes.orientation;return Di(i,n,r)},e.prototype.flattenPage=function(n){n.querySelectorAll(xs.item.class).forEach(function(r){n.appendChild(r)}),n.querySelectorAll(xs.page.class).forEach(function(r){var i=n.removeChild(r);i.destroy()})},e.prototype.renderItems=function(n){var r=this.attributes,i=r.click,o=r.mouseenter,a=r.mouseleave;this.flattenPage(n);var s=this.dispatchCustomEvent.bind(this);_t(n).selectAll(xs.item.class).data(this.renderData,function(l){return l.id}).join(function(l){return l.append(function(c){var u=c.style;return new Ptt({style:u})}).attr("className",xs.item.name).on("click",function(){i==null||i(this),s("itemClick",{item:this})}).on("pointerenter",function(){o==null||o(this),s("itemMouseenter",{item:this})}).on("pointerleave",function(){a==null||a(this),s("itemMouseleave",{item:this})})},function(l){return l.each(function(c){var u=c.style;this.update(u)})},function(l){return l.remove()})},e.prototype.relayoutNavigator=function(){var n,r=this.attributes,i=r.layout,o=r.width,a=((n=this.pageViews.children[0])===null||n===void 0?void 0:n.getBBox().height)||0,s=D(this.navigatorShape,2),l=s[0],c=s[1];this.navigator.update(i==="grid"?{pageWidth:o-l,pageHeight:a-c}:{})},e.prototype.adjustLayout=function(){var n=this,r=Object.entries($Z(this.itemsLayout,"page")).map(function(o){var a=D(o,2),s=a[0],l=a[1];return{page:s,layouts:l}}),i=Q([],D(this.navigator.getContainer().children),!1);r.forEach(function(o){var a=o.layouts,s=n.pageViews.appendChild(new sn({className:xs.page.name}));a.forEach(function(l){var c=l.x,u=l.y,f=l.index,d=l.width,h=l.height,p=i[f];s.appendChild(p),kZ(p,"__layout__",l),p.update({x:c,y:u,width:d,height:h})})}),this.relayoutNavigator()},e.prototype.renderNavigator=function(n){var r=this.attributes.orientation,i=Pt(this.attributes,"nav"),o=ho({orientation:r},i),a=this;return n.selectAll(xs.navigator.class).data(["nav"]).join(function(s){return s.append(function(){return new xtt({style:o})}).attr("className",xs.navigator.name).each(function(){a.navigator=this})},function(s){return s.each(function(){this.update(o)})},function(s){return s.remove()}),this.navigator},e.prototype.getBBox=function(){return this.navigator.getBBox()},e.prototype.render=function(n,r){var i=this.attributes.data;if(!(!i||i.length===0)){var o=this.renderNavigator(_t(r));this.renderItems(o.getContainer()),this.adjustLayout()}},e.prototype.dispatchCustomEvent=function(n,r){var i=new ee(n,{detail:r});this.dispatchEvent(i)},e}(ln),mf=Yr({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),f3={showLabel:!0,formatter:function(t){return t.toString()},markerSize:25,markerStroke:"#c5c5c5",markerFill:"#fff",markerLineWidth:1,labelFontSize:12,labelFill:"#c5c5c5",labelText:"",orientation:"vertical",spacing:0},Ctt=function(t){st(e,t);function e(n){return t.call(this,n,f3)||this}return e.prototype.render=function(n,r){var i=_t(r).maybeAppendByClassName(mf.markerGroup,"g");this.renderMarker(i);var o=_t(r).maybeAppendByClassName(mf.labelGroup,"g");this.renderLabel(o)},e.prototype.renderMarker=function(n){var r=this,i=this.attributes,o=i.orientation,a=i.markerSymbol,s=a===void 0?Di(o,"horizontalHandle","verticalHandle"):a;Jn(!!s,n,function(l){var c=Pt(r.attributes,"marker"),u=G({symbol:s},c);r.marker=l.maybeAppendByClassName(mf.marker,function(){return new ne({style:u})}).update(u)})},e.prototype.renderLabel=function(n){var r=this,i=this.attributes,o=i.showLabel,a=i.orientation,s=i.spacing,l=s===void 0?0:s,c=i.formatter;Jn(o,n,function(u){var f,d=Pt(r.attributes,"label"),h=d.text,p=Qt(d,["text"]),v=((f=u.select(mf.marker.class))===null||f===void 0?void 0:f.node().getBBox())||{},g=v.width,y=g===void 0?0:g,m=v.height,b=m===void 0?0:m,x=D(Di(a,[0,b+l,"center","top"],[y+l,0,"start","middle"]),4),w=x[0],O=x[1],_=x[2],S=x[3];u.maybeAppendByClassName(mf.label,"text").styles(G(G({},p),{x:w,y:O,text:c(h).toString(),textAlign:_,textBaseline:S}))})},e}(ln),d3={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},Ttt=ho({},d3,{}),ktt=ho({},d3,Ii(f3,"handle"),{color:["#d0e3fa","#acc7f6","#8daaf2","#6d8eea","#4d73cd","#325bb1","#5a3e75","#8c3c79","#e23455","#e7655b"],indicatorBackgroundFill:"#262626",indicatorLabelFill:"white",indicatorLabelFontSize:12,indicatorVisibility:"hidden",labelAlign:"value",labelDirection:"positive",labelSpacing:5,showHandle:!0,showIndicator:!0,showLabel:!0,slidable:!0,titleText:"",type:"continuous"}),Ltt=.01,cn=Yr({title:"title",titleGroup:"title-group",items:"items",itemsGroup:"items-group",contentGroup:"content-group",ribbonGroup:"ribbon-group",ribbon:"ribbon",handlesGroup:"handles-group",handle:"handle",startHandle:"start-handle",endHandle:"end-handle",labelGroup:"label-group",label:"label",indicator:"indicator"},"legend"),Ntt=function(t){st(e,t);function e(n){return t.call(this,n,Ttt)||this}return e.prototype.renderTitle=function(n,r,i){var o=this.attributes,a=o.showTitle,s=o.titleText,l=Pt(this.attributes,"title"),c=D(vo(l),2),u=c[0],f=c[1];this.titleGroup=n.maybeAppendByClassName(cn.titleGroup,"g").styles(f);var d=G(G({width:r,height:i},u),{text:a?s:""});this.title=this.titleGroup.maybeAppendByClassName(cn.title,function(){return new o3({style:d})}).update(d)},e.prototype.renderItems=function(n,r){var i=r.x,o=r.y,a=r.width,s=r.height,l=Pt(this.attributes,"title",!0),c=D(vo(l),2),u=c[0],f=c[1],d=G(G({},u),{width:a,height:s,x:0,y:0});this.itemsGroup=n.maybeAppendByClassName(cn.itemsGroup,"g").styles(G({x:i,y:o},f));var h=this;this.itemsGroup.selectAll(cn.items.class).data(["items"]).join(function(p){return p.append(function(){return new Att({style:d})}).attr("className",cn.items.name).each(function(){h.items=_t(this)})},function(p){return p.update(d)},function(p){return p.remove()})},e.prototype.adjustLayout=function(){var n=this.attributes.showTitle;if(n){var r=this.title.node().getAvailableSpace(),i=r.x,o=r.y;this.itemsGroup.node().setLocalPosition(i,o)}},Object.defineProperty(e.prototype,"availableSpace",{get:function(){var n=this.attributes,r=n.showTitle,i=n.width,o=n.height;return r?this.title.node().getAvailableSpace():new Oe(0,0,i,o)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var n,r,i=(n=this.title)===null||n===void 0?void 0:n.node(),o=(r=this.items)===null||r===void 0?void 0:r.node();return!i||!o?t.prototype.getBBox.call(this):ptt(i,o)},e.prototype.render=function(n,r){var i=n.width,o=n.height,a=_t(r);this.renderTitle(a,i,o),this.renderItems(a,this.availableSpace),this.adjustLayout()},e}(ln),Itt={backgroundFill:"#262626",backgroundLineCap:"round",backgroundLineWidth:1,backgroundStroke:"#333",backgroundZIndex:-1,formatter:function(t){return t.toString()},labelFill:"#fff",labelFontSize:12,labelTextBaseline:"middle",padding:[2,4],position:"right",radius:0,zIndex:999},Cb=Yr({background:"background",labelGroup:"label-group",label:"label"},"indicator"),jtt=function(t){st(e,t);function e(n){var r=t.call(this,n,Itt)||this;return r.point=[0,0],r.group=r.appendChild(new sn({})),r.isMutationObserved=!0,r}return e.prototype.renderBackground=function(){if(this.label){var n=this.attributes,r=n.position,i=n.padding,o=D(gn(i),4),a=o[0],s=o[1],l=o[2],c=o[3],u=this.label.node().getLocalBounds(),f=u.min,d=u.max,h=new Oe(f[0]-c,f[1]-a,d[0]+s-f[0]+c,d[1]+l-f[1]+a),p=this.getPath(r,h),v=Pt(this.attributes,"background");this.background=_t(this.group).maybeAppendByClassName(Cb.background,"path").styles(G(G({},v),{path:p})),this.group.appendChild(this.label.node())}},e.prototype.renderLabel=function(){var n=this.attributes,r=n.formatter,i=n.labelText,o=Pt(this.attributes,"label"),a=D(vo(o),2),s=a[0],l=a[1];s.text;var c=Qt(s,["text"]);if(this.label=_t(this.group).maybeAppendByClassName(Cb.labelGroup,"g").styles(l),!!i){var u=this.label.maybeAppendByClassName(Cb.label,function(){return ys(r(i))}).style("text",r(i).toString());u.selectAll("text").styles(c)}},e.prototype.adjustLayout=function(){var n=D(this.point,2),r=n[0],i=n[1];this.group.attr("x",-r).attr("y",-i)},e.prototype.getPath=function(n,r){var i=this.attributes.radius,o=r.x,a=r.y,s=r.width,l=r.height,c=[["M",o+i,a],["L",o+s-i,a],["A",i,i,0,0,1,o+s,a+i],["L",o+s,a+l-i],["A",i,i,0,0,1,o+s-i,a+l],["L",o+i,a+l],["A",i,i,0,0,1,o,a+l-i],["L",o,a+i],["A",i,i,0,0,1,o+i,a],["Z"]],u={top:4,right:6,bottom:0,left:2},f=u[n],d=this.createCorner([c[f].slice(-2),c[f+1].slice(-2)]);return c.splice.apply(c,Q([f+1,1],D(d),!1)),c[0][0]="M",c},e.prototype.createCorner=function(n,r){r===void 0&&(r=10);var i=.8,o=eQ.apply(void 0,Q([],D(n),!1)),a=D(n,2),s=D(a[0],2),l=s[0],c=s[1],u=D(a[1],2),f=u[0],d=u[1],h=D(o?[f-l,[l,f]]:[d-c,[c,d]],2),p=h[0],v=D(h[1],2),g=v[0],y=v[1],m=p/2,b=p/Math.abs(p),x=r*b,w=x/2,O=x*Math.sqrt(3)/2*i,_=D([g,g+m-w,g+m,g+m+w,y],5),S=_[0],E=_[1],M=_[2],P=_[3],C=_[4];return o?(this.point=[M,c-O],[["L",S,c],["L",E,c],["L",M,c-O],["L",P,c],["L",C,c]]):(this.point=[l+O,M],[["L",l,S],["L",l,E],["L",l+O,M],["L",l,P],["L",l,C]])},e.prototype.applyVisibility=function(){var n=this.attributes.visibility;n==="hidden"?ra(this):uf(this)},e.prototype.bindEvents=function(){this.label.on(St.BOUNDS_CHANGED,this.renderBackground)},e.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()},e}(ln);function Dtt(t,e){for(var n=1;n<t.length;n+=1){var r=t[n-1],i=t[n];if(e>=r&&e<=i)return[r,i]}return[e,e]}function $tt(t,e,n){var r=Array.from(e),i=t.length;return new Array(i).fill(0).reduce(function(o,a,s){var l=r[s%r.length];return o+=" ".concat(t[s],":").concat(l).concat(s<i-1?" ".concat(t[s+1],":").concat(l):"")},"l(".concat(n==="horizontal"?"0":"270",")"))}function h3(t,e){var n=D(Dtt(t,e),2),r=n[0],i=n[1];return{tick:e>(r+i)/2?i:r,range:[r,i]}}var bf=Yr({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function p3(t){var e=t.orientation,n=t.size,r=t.length;return Di(e,[r,n],[n,r])}function v3(t){var e=t.type,n=D(p3(t),2),r=n[0],i=n[1];return e==="size"?[["M",0,i],["L",0+r,0],["L",0+r,i],["Z"]]:[["M",0,i],["L",0,0],["L",0+r,0],["L",0+r,i],["Z"]]}function Ftt(t){return v3(t)}function Rtt(t){var e=t.orientation,n=t.color,r=t.block,i=t.partition,o;if(Br(n)){var a=20;o=new Array(a).fill(0).map(function(c,u,f){return n(u/(f.length-1))})}else o=n;var s=o.length,l=o.map(function(c){return lo(c).toString()});return s?s===1?l[0]:r?$tt(i,l,e):l.reduce(function(c,u,f){return c+=" ".concat(f/(s-1),":").concat(u)},"l(".concat(Di(e,"0","270"),")")):""}function Btt(t){var e=t.orientation,n=t.range;if(!n)return[];var r=D(p3(t),2),i=r[0],o=r[1],a=D(n,2),s=a[0],l=a[1],c=Di(e,s*i,0),u=Di(e,0,s*o),f=Di(e,l*i,i),d=Di(e,o,l*o);return[["M",c,u],["L",c,d],["L",f,d],["L",f,u],["Z"]]}function ztt(t,e){var n=Pt(e,"track");t.maybeAppendByClassName(bf.track,"path").styles(G({path:v3(e)},n))}function Ytt(t,e){var n=Pt(e,"selection"),r=Rtt(e),i=t.maybeAppendByClassName(bf.selection,"path").styles(G({path:Ftt(e),fill:r},n)),o=i.maybeAppendByClassName(bf.clipPath,"path").styles({path:Btt(e)}).node();i.style("clip-path",o)}var Wtt=function(t){st(e,t);function e(n){return t.call(this,n,{type:"color",orientation:"horizontal",size:30,range:[0,1],length:200,block:!1,partition:[],color:["#fff","#000"],trackFill:"#e5e5e5"})||this}return e.prototype.render=function(n,r){var i=_t(r).maybeAppendByClassName(bf.trackGroup,"g");ztt(i,n);var o=_t(r).maybeAppendByClassName(bf.selectionGroup,"g");Ytt(o,n)},e}(ln);function Gtt(t){return{min:Math.min.apply(Math,Q([],D(t.map(function(e){return e.value})),!1)),max:Math.max.apply(Math,Q([],D(t.map(function(e){return e.value})),!1))}}var Htt=function(t){st(e,t);function e(n){var r=t.call(this,n,ktt)||this;return r.eventToOffsetScale=new hf({}),r.innerRibbonScale=new hf({}),r.cacheLabelBBox=null,r.cacheHandleBBox=null,r.onHovering=function(i){var o=r.attributes,a=o.data,s=o.block;i.stopPropagation();var l=r.getValueByCanvasPoint(i);if(s){var c=h3(a.map(function(f){var d=f.value;return d}),l).range;r.showIndicator((c[0]+c[1])/2,"".concat(c[0],"-").concat(c[1])),r.dispatchIndicated(l,c)}else{var u=r.getTickValue(l);r.showIndicator(u),r.dispatchIndicated(u)}},r.onDragStart=function(i){return function(o){o.stopPropagation(),r.attributes.slidable&&(r.target=i,r.prevValue=r.getTickValue(r.getValueByCanvasPoint(o)),document.addEventListener("mousemove",r.onDragging),document.addEventListener("touchmove",r.onDragging),document.addEventListener("mouseleave",r.onDragEnd),document.addEventListener("mouseup",r.onDragEnd),document.addEventListener("mouseup",r.onDragEnd),document.addEventListener("touchend",r.onDragEnd))}},r.onDragging=function(i){var o=r.target;r.updateMouse();var a=D(r.selection,2),s=a[0],l=a[1],c=r.getTickValue(r.getValueByCanvasPoint(i)),u=c-r.prevValue;o==="start"?s!==c&&r.updateSelection(c,l):o==="end"?l!==c&&r.updateSelection(s,c):o==="ribbon"&&u!==0&&(r.prevValue=c,r.updateSelection(u,u,!0))},r.onDragEnd=function(){r.style.cursor="pointer",document.removeEventListener("mousemove",r.onDragging),document.removeEventListener("touchmove",r.onDragging),document.removeEventListener("mouseup",r.onDragEnd),document.removeEventListener("touchend",r.onDragEnd)},r}return Object.defineProperty(e.prototype,"handleOffsetRatio",{get:function(){return this.ifHorizontal(.5,.5)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var n=this.attributes,r=n.width,i=n.height;return new Oe(0,0,r,i)},e.prototype.render=function(n,r){var i=this,o=n.showLabel;this.renderTitle(_t(r));var a=this.availableSpace,s=a.x,l=a.y,c=_t(r).maybeAppendByClassName(cn.contentGroup,"g").styles({x:s,y:l}),u=c.maybeAppendByClassName(cn.labelGroup,"g").styles({zIndex:1});Jn(!!o,u,function(d){i.renderLabel(d)});var f=c.maybeAppendByClassName(cn.ribbonGroup,"g").styles({zIndex:0});this.handlesGroup=c.maybeAppendByClassName(cn.handlesGroup,"g").styles({zIndex:2}),this.renderHandles(),this.renderRibbon(f),this.renderIndicator(c),this.adjustLabel(),this.adjustHandles()},Object.defineProperty(e.prototype,"range",{get:function(){var n=this.attributes,r=n.data,i=n.domain;return i?{min:i[0],max:i[1]}:Gtt(r)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonScale",{get:function(){var n=this.range,r=n.min,i=n.max;return this.innerRibbonScale.update({domain:[r,i],range:[0,1]}),this.innerRibbonScale},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonRange",{get:function(){var n=D(this.selection,2),r=n[0],i=n[1],o=this.ribbonScale;return[o.map(r),o.map(i)]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selection",{get:function(){var n=this.range,r=n.min,i=n.max,o=this.attributes.defaultValue,a=o===void 0?[r,i]:o,s=D(a,2),l=s[0],c=s[1];return[l,c]},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(n,r){return Di(this.attributes.orientation,typeof n=="function"?n():n,typeof r=="function"?r():r)},e.prototype.renderTitle=function(n){var r=this.attributes,i=r.showTitle,o=r.titleText,a=r.width,s=r.height,l=Pt(this.attributes,"title"),c=G(G({},l),{width:a,height:s,text:o}),u=this;n.selectAll(cn.title.class).data(i?[o]:[]).join(function(f){return f.append(function(){return new o3({style:c})}).attr("className",cn.title.name).each(function(){u.title=this})},function(f){return f.update(c)},function(f){return f.each(function(){u.title=void 0}).remove()})},Object.defineProperty(e.prototype,"availableSpace",{get:function(){if(this.title)return this.title.getAvailableSpace();var n=this.attributes,r=n.width,i=n.height;return new Oe(0,0,r,i)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelFixedSpacing",{get:function(){var n=this.attributes.showTick;return n?5:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelPosition",{get:function(){var n=this.attributes,r=n.orientation,i=n.labelDirection,o={vertical:{positive:"right",negative:"left"},horizontal:{positive:"bottom",negative:"top"}};return o[r][i]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelBBox",{get:function(){var n,r=this.attributes.showLabel;if(!r)return new Oe(0,0,0,0);if(this.cacheLabelBBox)return this.cacheLabelBBox;var i=((n=this.label.querySelector(Zt.labelGroup.class))===null||n===void 0?void 0:n.children.slice(-1)[0]).getBBox(),o=i.width,a=i.height;return this.cacheLabelBBox=new Oe(0,0,o,a),this.cacheLabelBBox},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelShape",{get:function(){var n=this.attributes,r=n.showLabel,i=n.labelSpacing,o=i===void 0?0:i;if(!r)return{width:0,height:0,size:0,length:0};var a=this.labelBBox,s=a.width,l=a.height,c=this.ifHorizontal(l,s)+o+this.labelFixedSpacing,u=this.ifHorizontal(s,l);return{width:s,height:l,size:c,length:u}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonBBox",{get:function(){var n=this.attributes,r=n.showHandle,i=n.ribbonSize,o=this.availableSpace,a=o.width,s=o.height,l=this.labelShape,c=l.size,u=l.length,f=D(this.ifHorizontal([s,a],[a,s]),2),d=f[0],h=f[1],p=r?this.handleShape:{size:0,length:0},v=p.size,g=p.length,y=this.handleOffsetRatio,m=0,b=this.labelPosition;i?m=i:["bottom","right"].includes(b)?m=Math.min(d-c,(d-v)/y):d*(1-y)>v?m=Math.max(d-c,0):m=Math.max((d-c-v)/y,0);var x=Math.max(g,u),w=h-x,O=D(this.ifHorizontal([w,m],[m,w]),2),_=O[0],S=O[1],E=["top","left"].includes(b)?c:0,M=D(this.ifHorizontal([x/2,E],[E,x/2]),2),P=M[0],C=M[1];return new Oe(P,C,_,S)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonShape",{get:function(){var n=this.ribbonBBox,r=n.width,i=n.height;return this.ifHorizontal({size:i,length:r},{size:r,length:i})},enumerable:!1,configurable:!0}),e.prototype.renderRibbon=function(n){var r=this.attributes,i=r.data,o=r.type,a=r.orientation,s=r.color,l=r.block,c=Pt(this.attributes,"ribbon"),u=this.range,f=u.min,d=u.max,h=this.ribbonBBox,p=h.x,v=h.y,g=this.ribbonShape,y=g.length,m=g.size,b=ho({x:p,y:v,length:y,size:m,type:o,orientation:a,color:s,block:l,partition:i.map(function(x){return(x.value-f)/(d-f)}),range:this.ribbonRange},c);this.ribbon=n.maybeAppendByClassName(cn.ribbon,function(){return new Wtt({style:b})}).update(b)},e.prototype.getHandleClassName=function(n){return"".concat(cn.prefix("".concat(n,"-handle")))},e.prototype.renderHandles=function(){var n=this.attributes,r=n.showHandle,i=n.orientation,o=Pt(this.attributes,"handle"),a=D(this.selection,2),s=a[0],l=a[1],c=G(G({},o),{orientation:i}),u=o.shape,f=u===void 0?"slider":u,d=f==="basic"?Ctt:Rk,h=this;this.handlesGroup.selectAll(cn.handle.class).data(r?[{value:s,type:"start"},{value:l,type:"end"}]:[],function(p){return p.type}).join(function(p){return p.append(function(){return new d({style:c})}).attr("className",function(v){var g=v.type;return"".concat(cn.handle," ").concat(h.getHandleClassName(g))}).each(function(v){var g=v.type,y=v.value;this.update({labelText:y});var m="".concat(g,"Handle");h[m]=this,this.addEventListener("pointerdown",h.onDragStart(g))})},function(p){return p.update(c).each(function(v){var g=v.value;this.update({labelText:g})})},function(p){return p.each(function(v){var g=v.type,y="".concat(g,"Handle");h[y]=void 0}).remove()})},e.prototype.adjustHandles=function(){var n=D(this.selection,2),r=n[0],i=n[1];this.setHandlePosition("start",r),this.setHandlePosition("end",i)},e.prototype.adjustTitle=function(){var n=this.attributes,r=n.titlePosition,i=n.orientation,o=D(this.getElementsByClassName(cn.title.name),1),a=o[0],s=this.handlesGroup.select(".".concat(this.getHandleClassName("start"))).node();if(!(!a||!s)&&!(r!=="top-left"||i!=="horizontal")){var l=D(s.getLocalBounds().min,1),c=l[0],u=D(a.getLocalBounds().min,1),f=u[0],d=c-f;a.style.x=+(this.style.x||0)+d}},Object.defineProperty(e.prototype,"handleBBox",{get:function(){if(this.cacheHandleBBox)return this.cacheHandleBBox;if(!this.attributes.showHandle)return new Oe(0,0,0,0);var n=this.startHandle.getBBox(),r=n.width,i=n.height,o=this.endHandle.getBBox(),a=o.width,s=o.height,l=D([Math.max(r,a),Math.max(i,s)],2),c=l[0],u=l[1];return this.cacheHandleBBox=new Oe(0,0,c,u),this.cacheHandleBBox},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"handleShape",{get:function(){var n=this.handleBBox,r=n.width,i=n.height,o=D(this.ifHorizontal([i,r],[r,i]),2),a=o[0],s=o[1];return{width:r,height:i,size:a,length:s}},enumerable:!1,configurable:!0}),e.prototype.setHandlePosition=function(n,r){var i=this.attributes.handleFormatter,o=this.ribbonBBox,a=o.x,s=o.y,l=this.ribbonShape.size,c=this.getOffset(r),u=D(this.ifHorizontal([a+c,s+l*this.handleOffsetRatio],[a+l*this.handleOffsetRatio,s+c]),2),f=u[0],d=u[1],h=this.handlesGroup.select(".".concat(this.getHandleClassName(n))).node();h==null||h.update({x:f,y:d,formatter:i})},e.prototype.renderIndicator=function(n){var r=Pt(this.attributes,"indicator");this.indicator=n.maybeAppendByClassName(cn.indicator,function(){return new jtt({})}).update(r)},Object.defineProperty(e.prototype,"labelData",{get:function(){var n=this,r=this.attributes.data;return r.reduce(function(i,o,a,s){var l,c,u=(l=o==null?void 0:o.id)!==null&&l!==void 0?l:a.toString();if(i.push(G(G({},o),{id:u,index:a,type:"value",label:(c=o==null?void 0:o.label)!==null&&c!==void 0?c:o.value.toString(),value:n.ribbonScale.map(o.value)})),a<s.length-1){var f=s[a+1],d=D([o.value,f.value],2),h=d[0],p=d[1],v=(h+p)/2;i.push(G(G({},o),{id:u,index:a,type:"range",range:[h,p],label:[h,p].join("~"),value:n.ribbonScale.map(v)}))}return i},[])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelStyle",{get:function(){var n=D(["center","middle"],2),r=n[0],i=n[1],o=this.labelPosition;return o==="top"?i="bottom":o==="bottom"?i="top":o==="left"?r="end":o==="right"&&(r="start"),{labelTextAlign:r,labelTextBaseline:i}},enumerable:!1,configurable:!0}),e.prototype.renderLabel=function(n){var r=this.attributes,i=r.showTick,o=i===void 0?!1:i,a=r.labelFilter,s=r.labelFormatter,l=Pt(this.attributes,"tick"),c=Pt(this.attributes,"label"),u=c.align,f=ho(G({showLine:!1,showGrid:!1,showTick:o,type:"linear",startPos:[0,0],endPos:[0,0],tickDirection:"negative",labelTransform:"rotate(0)"},this.labelStyle),Ii(l,"tick"),Ii(c,"label"),{data:this.labelData}),d={tickFilter:function(p,v,g){return(p==null?void 0:p.type)!=="value"?!1:a?a(p,p.index,g.filter(function(y){return y.type!=="value"})):!0},labelFilter:function(p,v,g){return(p==null?void 0:p.type)!==u?!1:a?a(p,p.index,g.filter(function(y){return y.type===u})):!0},labelFormatter:s},h=G(G(G({},f),d),{labelOverlap:[{type:"hide"}]});this.label=n.maybeAppendByClassName(cn.label,function(){return new Ab({style:h})}).node(),this.label.update(h,!1)},Object.defineProperty(e.prototype,"labelAxisStyle",{get:function(){var n=this.attributes,r=n.showTick,i=n.labelDirection,o=n.labelSpacing,a=n.tickLength,s=this.ribbonShape.size,l=this.labelPosition,c=this.labelFixedSpacing,u=D([0,0,0],3),f=u[0];u[1];var d=u[2],h=a!=null?a:s;return r?(d=h,i==="positive"?l==="right"?(f=h,d=h):l==="bottom"&&(f=d):i==="negative"&&(l==="top"||l==="left")&&(f=s)):i==="positive"&&(l==="right"||l==="bottom"&&(f=s+c)),{offset:f,spacing:o,tickLength:d}},enumerable:!1,configurable:!0}),e.prototype.adjustLabel=function(){var n=this.attributes.showLabel;if(n){var r=this.ribbonBBox,i=r.x,o=r.y,a=r.width,s=r.height,l=this.labelAxisStyle,c=l.offset,u=l.spacing,f=l.tickLength,d=D(this.ifHorizontal([[i,o+c],[i+a,o+c]],[[i+c,o+s],[i+c,o]]),2),h=d[0],p=d[1];this.label.update({startPos:h,endPos:p,tickLength:f,labelSpacing:u},!1)}},e.prototype.bindEvents=function(){this.style.cursor="pointer",this.ribbon.on("pointerdown",this.onDragStart("ribbon")),this.ribbon.on("pointermove",this.onHovering),this.addEventListener("pointerout",this.hideIndicator)},e.prototype.showIndicator=function(n,r){r===void 0&&(r="".concat(n));var i=this.attributes.showIndicator;if(!i||typeof n!="number"){this.hideIndicator();return}var o=this.range,a=o.min,s=o.max,l=this.ribbonBBox,c=l.x,u=l.y,f=fo(n,a,s),d=this.getOffset(f),h=this.ifHorizontal([d+c,u],[c,d+u]);this.indicator.update({x:h[0],y:h[1],position:this.ifHorizontal("top","left"),labelText:r}),uf(this.indicator.node())},e.prototype.hideIndicator=function(){ra(this.indicator.node())},e.prototype.updateMouse=function(){this.attributes.slidable&&(this.style.cursor="grabbing")},e.prototype.setSelection=function(n,r){this.updateSelection(n,r)},e.prototype.updateSelection=function(n,r,i){var o;i===void 0&&(i=!1);var a=D(this.selection,2),s=a[0],l=a[1],c=D([n,r],2),u=c[0],f=c[1];i&&(u+=s,f+=l);var d=this.range,h=d.min,p=d.max;o=D(Ett([h,p],[u,f],this.selection),2),u=o[0],f=o[1],this.update({defaultValue:[u,f]}),this.dispatchSelection()},Object.defineProperty(e.prototype,"step",{get:function(){var n=this.attributes.step,r=n===void 0?1:n,i=this.range,o=i.min,a=i.max;return _Z(r)?fb((a-o)*Ltt,0):r},enumerable:!1,configurable:!0}),e.prototype.getTickValue=function(n){var r=this.attributes,i=r.data,o=r.block,a=this.range.min;return o?h3(i.map(function(s){var l=s.value;return l}),n).tick:wtt(n,this.step,a)},e.prototype.getValueByCanvasPoint=function(n,r){var i=this.range,o=i.min,a=i.max,s=D(this.ribbon.node().getPosition(),2),l=s[0],c=s[1],u=this.ifHorizontal(l,c),f=this.ifHorizontal.apply(this,Q([],D(Qp(n)),!1)),d=f-u,h=fo(this.getOffset(d,!0),o,a);return h},e.prototype.getOffset=function(n,r){r===void 0&&(r=!1);var i=this.range,o=i.min,a=i.max,s=this.ribbonShape.length,l=this.eventToOffsetScale;return l.update({domain:[o,a],range:[0,s]}),r?l.invert(n):l.map(n)},e.prototype.dispatchSelection=function(){var n=new ee("valuechange",{detail:{value:this.selection}});this.dispatchEvent(n)},e.prototype.dispatchIndicated=function(n,r){var i=new ee("indicate",{detail:{value:n,range:r}});this.dispatchEvent(i)},e}(ln);function Tb(t){return t===void 0&&(t=""),{CONTAINER:"".concat(t,"tooltip"),TITLE:"".concat(t,"tooltip-title"),LIST:"".concat(t,"tooltip-list"),LIST_ITEM:"".concat(t,"tooltip-list-item"),NAME:"".concat(t,"tooltip-list-item-name"),MARKER:"".concat(t,"tooltip-list-item-marker"),NAME_LABEL:"".concat(t,"tooltip-list-item-name-label"),VALUE:"".concat(t,"tooltip-list-item-value"),CROSSHAIR_X:"".concat(t,"tooltip-crosshair-x"),CROSSHAIR_Y:"".concat(t,"tooltip-crosshair-y")}}var g3={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function Utt(t){var e;t===void 0&&(t="");var n=Tb(t);return e={},e[".".concat(n.CONTAINER)]={position:"absolute",visibility:"visible","z-index":8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)","background-color":"rgba(255, 255, 255, 0.96)","box-shadow":"0 6px 12px 0 rgba(0, 0, 0, 0.12)","border-radius":"4px",color:"rgba(0, 0, 0, 0.65)","font-size":"12px","line-height":"20px",padding:"12px","min-width":"120px","max-width":"360px","font-family":"Roboto-Regular"},e[".".concat(n.TITLE)]={color:"rgba(0, 0, 0, 0.45)"},e[".".concat(n.LIST)]={margin:"0px","list-style-type":"none",padding:"0px"},e[".".concat(n.LIST_ITEM)]={"list-style-type":"none",display:"flex","line-height":"2em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},e[".".concat(n.MARKER)]={width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},e[".".concat(n.NAME)]={display:"flex","align-items":"center","max-width":"216px"},e[".".concat(n.NAME_LABEL)]=G({flex:1},g3),e[".".concat(n.VALUE)]=G({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},g3),e[".".concat(n.CROSSHAIR_X)]={position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e[".".concat(n.CROSSHAIR_Y)]={position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e}var Vtt=function(t){st(e,t);function e(n){var r=this,i,o,a=(o=(i=n.style)===null||i===void 0?void 0:i.template)===null||o===void 0?void 0:o.prefixCls,s=Tb(a);return r=t.call(this,n,{data:[],x:0,y:0,visibility:"visible",title:"",position:"bottom-right",offset:[5,5],enterable:!1,container:{x:0,y:0},bounding:null,template:{prefixCls:"",container:'<div class="'.concat(s.CONTAINER,'"></div>'),title:'<div class="'.concat(s.TITLE,'"></div>'),item:'<li class="'.concat(s.LIST_ITEM,`" data-index={index}>
35
35
  <span class="`).concat(s.NAME,`">
36
36
  <span class="`).concat(s.MARKER,`" style="background:{color}"></span>
@@ -77,10 +77,10 @@ A`,a,a,0,s?1:0,1,o.p1.x,o.p1.y)}return r.join(" ")}}const ON=t=>{const{sets:e="s
77
77
  L ${e+r} ${n+i}
78
78
  L ${e} ${n+i}
79
79
  Z
80
- `}function cst(t,e){const[n,r,i,o]=Ox(t),a=o/i,s=Math.ceil(Math.sqrt(e/a)),l=Math.ceil(e/s),c=[],u=o/l;let f=0,d=e;for(;d>0;){const h=Math.min(d,s),p=i/h;for(let v=0;v<h;v++){const g=n+v*p,y=r+f*u;c.push(lst([g,y,p,u]))}d-=h,f+=1}return c}function ust(t="pack"){return typeof t=="function"?t:cst}function fst(t,e,n){const[r,i,o,a]=Ox(t),{transform:s}=t.style,{transform:l}=e.style;CI(e,t);const[c,u,f,d]=Ox(e),h=r-c,p=i-u,v=o/f,g=a/d,y=[Object.assign({transform:`${s?s+" ":""}translate(${h}, ${p}) scale(${v}, ${g})`},Kl(t,Zl)),Object.assign({transform:`${l?l+" ":""}translate(0, 0) scale(1, 1)`},Kl(e,Zl))];return e.animate(y,n)}function CI(t,e){t.__data__=e.__data__,t.className=e.className,t.markType=e.markType,e.parentNode.replaceChild(t,e)}function dst(t,e){const{nodeName:n}=t;if(n==="path")return t;const r=new Dn({style:Object.assign(Object.assign({},Kl(t,Zl)),{d:e})});return CI(r,t),r}function TI(t,e){const n=t.indexOf(e),r=t.lastIndexOf(e);return n===r}function hst(t){return!TI(t,"m")||!TI(t,"M")}function kI(t){const e=w1(t);if(e&&!hst(e))return e}function _x(t,e,n,r){const{nodeName:i}=e,{nodeName:o}=n,a=kI(e),s=kI(n);if(i===o&&i!=="path"||(a===void 0||s===void 0))return fst(e,n,r);const u=dst(t,a),f=[Object.assign({path:a},Kl(e,Zl)),Object.assign({path:s},Kl(n,Zl))],d=u.animate(f,r);return d.onfinish=()=>{u.style.transform="none",hm(u,n)},u.style.transform="none",d}function pst(t,e,n,r){t.style.visibility="hidden";const i=r(t,e.length);return e.map((o,a)=>{const s=new Dn({style:Object.assign({path:i[a]},Kl(t,Zl))});return _x(o,s,o,n)})}function vst(t,e,n,r){const i=r(e,t.length),{fillOpacity:o=1,strokeOpacity:a=1,opacity:s=1}=e.style,l=[{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:0,strokeOpacity:0,opacity:0,offset:.99},{fillOpacity:o,strokeOpacity:a,opacity:s}],c=e.animate(l,n);return[...t.map((f,d)=>{const h=new Dn({style:{path:i[d],fill:e.style.fill}});return _x(f,f,h,n)}),c]}const LI=t=>(e,n,r)=>{const i=ust(t.split),o=Object.assign(Object.assign({},r),t),{length:a}=e,{length:s}=n;if(a===1&&s===1||a>1&&s>1){const[l]=e,[c]=n;return _x(l,l,c,o)}if(a===1&&s>1){const[l]=e;return pst(l,n,o,i)}if(a>1&&s===1){const[l]=n;return vst(e,l,o,i)}return null};LI.props={};const NI=(t,e)=>{MC.registerProperty({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:at.NUMBER});const{coordinate:r}=e;return(i,o,a)=>{const[s]=i;if(!ce(r))return wx(t,e)(i,o,a);const l=r.getCenter(),{__data__:c,style:u}=s,{radius:f=0,inset:d=0,fillOpacity:h=1,strokeOpacity:p=1,opacity:v=1}=u,{points:g,y,y1:m}=c,b=qh().cornerRadius(f).padAngle(d*Math.PI/180),x=vs(r,g,[y,m]),{startAngle:w,endAngle:O}=x,_=new Dn({}),S=P=>{_.attr({d:b(P),transform:`translate(${l[0]}, ${l[1]})`});const C=w1(_);return _.style.transform="",C},E=[{waveInArcAngle:w+1e-4,fillOpacity:0,strokeOpacity:0,opacity:0},{waveInArcAngle:w+1e-4,fillOpacity:h,strokeOpacity:p,opacity:v,offset:.01},{waveInArcAngle:O,fillOpacity:h,strokeOpacity:p,opacity:v}],M=s.animate(E,Object.assign(Object.assign({},a),t));return M.onframe=function(){s.style.path=S(Object.assign(Object.assign({},x),{endAngle:Number(s.style.waveInArcAngle)}))},M.onfinish=function(){s.style.path=S(Object.assign(Object.assign({},x),{endAngle:O}))},M}};NI.props={};const gst=t=>(n,r,i)=>{const[o]=n,{transform:a="",fillOpacity:s=1,strokeOpacity:l=1,opacity:c=1}=o.style,u="center center",f=[{transform:`${a} scale(${1e-4})`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${a} scale(${1e-4})`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:l,opacity:c,offset:.01},{transform:`${a} scale(1)`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:l,opacity:c}];return o.animate(f,Object.assign(Object.assign({},i),t))},yst=t=>(n,r,i)=>{const[o]=n,{transform:a="",fillOpacity:s=1,strokeOpacity:l=1,opacity:c=1}=o.style,u="center center",f=[{transform:`${a} scale(1)`.trimStart(),transformOrigin:u},{transform:`${a} scale(${1e-4})`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:l,opacity:c,offset:.99},{transform:`${a} scale(${1e-4})`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0}];return o.animate(f,Object.assign(Object.assign({},i),t))},II=t=>(e,n,r)=>{var i,o;const[a]=e,s=((o=(i=a).getTotalLength)===null||o===void 0?void 0:o.call(i))||0,l=[{lineDash:[0,s]},{lineDash:[s,0]}];return a.animate(l,Object.assign(Object.assign({},r),t))};II.props={};const jI=(t,e)=>(n,r,i)=>{const[o]=n,{height:a,width:s}=o.getBoundingClientRect(),l=new Dn({style:{path:`M0,0L${s},0L${s},${a}L0,${a}Z`}});return o.appendChild(l),o.style.clipPath=l,wx(t,e)([l],r,i)};jI.props={};const DI=(t,e)=>(n,r,i)=>{const[o]=n,{height:a,width:s}=o.getBoundingClientRect(),l=new Dn({style:{path:`M0,0L${s},0L${s},${a}L0,${a}Z`}});return o.appendChild(l),o.style.clipPath=l,MI(t,e)([l],r,i)};DI.props={};const $I="main-layer",Sx="label-layer",mo="element",Ex="view",Nf="plot",FI="component",Mx="label",RI="area";var mst=function(t,e,n){return t<e?e:t>n?n:t};const bst=mst;function xst(t,e){var n=e.r;t.arc(n,n,n,0,Math.PI*2,!1)}function wst(t,e){var n=e.rx,r=e.ry,i=n,o=r;if(t.ellipse)t.ellipse(i,o,i,o,0,0,Math.PI*2,!1);else{var a=i>o?i:o,s=i>o?1:i/o,l=i>o?o/i:1;t.save(),t.scale(s,l),t.arc(a,a,a,0,Math.PI*2)}}function Ost(t,e){var n=e.x1,r=e.y1,i=e.x2,o=e.y2,a=e.defX,s=a===void 0?0:a,l=e.defY,c=l===void 0?0:l,u=e.markerStart,f=e.markerEnd,d=e.markerStartOffset,h=e.markerEndOffset,p=0,v=0,g=0,y=0,m=0,b,x;u&&Dt(u)&&d&&(b=i-n,x=o-r,m=Math.atan2(x,b),p=Math.cos(m)*(d||0),v=Math.sin(m)*(d||0)),f&&Dt(f)&&h&&(b=n-i,x=r-o,m=Math.atan2(x,b),g=Math.cos(m)*(h||0),y=Math.sin(m)*(h||0)),t.moveTo(n-s+p,r-c+v),t.lineTo(i-s+g,o-c+y)}function _st(t,e){var n=e.defX,r=n===void 0?0:n,i=e.defY,o=i===void 0?0:i,a=e.markerStart,s=e.markerEnd,l=e.markerStartOffset,c=e.markerEndOffset,u=e.path,f=u.absolutePath,d=u.segments,h=0,p=0,v=0,g=0,y=0,m,b;if(a&&Dt(a)&&l){var x=D(a.parentNode.getStartTangent(),2),w=x[0],O=x[1];m=w[0]-O[0],b=w[1]-O[1],y=Math.atan2(b,m),h=Math.cos(y)*(l||0),p=Math.sin(y)*(l||0)}if(s&&Dt(s)&&c){var _=D(s.parentNode.getEndTangent(),2),w=_[0],O=_[1];m=w[0]-O[0],b=w[1]-O[1],y=Math.atan2(b,m),v=Math.cos(y)*(c||0),g=Math.sin(y)*(c||0)}for(var S=0;S<f.length;S++){var E=f[S],M=E[0],P=f[S+1],C=S===0&&(h!==0||p!==0),A=(S===f.length-1||P&&(P[0]==="M"||P[0]==="Z"))&&v!==0&&g!==0;switch(M){case"M":C?(t.moveTo(E[1]-r+h,E[2]-o+p),t.lineTo(E[1]-r,E[2]-o)):t.moveTo(E[1]-r,E[2]-o);break;case"L":A?t.lineTo(E[1]-r+v,E[2]-o+g):t.lineTo(E[1]-r,E[2]-o);break;case"Q":t.quadraticCurveTo(E[1]-r,E[2]-o,E[3]-r,E[4]-o),A&&t.lineTo(E[3]-r+v,E[4]-o+g);break;case"C":t.bezierCurveTo(E[1]-r,E[2]-o,E[3]-r,E[4]-o,E[5]-r,E[6]-o),A&&t.lineTo(E[5]-r+v,E[6]-o+g);break;case"A":{var T=d[S].arcParams,k=T.cx,N=T.cy,j=T.rx,L=T.ry,I=T.startAngle,$=T.endAngle,F=T.xRotation,R=T.sweepFlag;if(t.ellipse)t.ellipse(k-r,N-o,j,L,F,I,$,!!(1-R));else{var B=j>L?j:L,W=j>L?1:j/L,K=j>L?L/j:1;t.translate(k-r,N-o),t.rotate(F),t.scale(W,K),t.arc(0,0,B,I,$,!!(1-R)),t.scale(1/W,1/K),t.rotate(-F),t.translate(-(k-r),-(N-o))}A&&t.lineTo(E[6]-r+v,E[7]-o+g);break}case"Z":t.closePath();break}}}function Sst(t,e){var n=e.defX,r=n===void 0?0:n,i=e.defY,o=i===void 0?0:i,a=e.markerStart,s=e.markerEnd,l=e.markerStartOffset,c=e.markerEndOffset,u=e.points.points,f=u.length,d=u[0][0]-r,h=u[0][1]-o,p=u[f-1][0]-r,v=u[f-1][1]-o,g=0,y=0,m=0,b=0,x=0,w,O;a&&Dt(a)&&l&&(w=u[1][0]-u[0][0],O=u[1][1]-u[0][1],x=Math.atan2(O,w),g=Math.cos(x)*(l||0),y=Math.sin(x)*(l||0)),s&&Dt(s)&&c&&(w=u[f-1][0]-u[0][0],O=u[f-1][1]-u[0][1],x=Math.atan2(O,w),m=Math.cos(x)*(c||0),b=Math.sin(x)*(c||0)),t.moveTo(d+(g||m),h+(y||b));for(var _=1;_<f-1;_++){var S=u[_];t.lineTo(S[0]-r,S[1]-o)}t.lineTo(p,v)}function Est(t,e){var n=e.defX,r=n===void 0?0:n,i=e.defY,o=i===void 0?0:i,a=e.markerStart,s=e.markerEnd,l=e.markerStartOffset,c=e.markerEndOffset,u=e.points.points,f=u.length,d=u[0][0]-r,h=u[0][1]-o,p=u[f-1][0]-r,v=u[f-1][1]-o,g=0,y=0,m=0,b=0,x=0,w,O;a&&Dt(a)&&l&&(w=u[1][0]-u[0][0],O=u[1][1]-u[0][1],x=Math.atan2(O,w),g=Math.cos(x)*(l||0),y=Math.sin(x)*(l||0)),s&&Dt(s)&&c&&(w=u[f-2][0]-u[f-1][0],O=u[f-2][1]-u[f-1][1],x=Math.atan2(O,w),m=Math.cos(x)*(c||0),b=Math.sin(x)*(c||0)),t.moveTo(d+g,h+y);for(var _=1;_<f-1;_++){var S=u[_];t.lineTo(S[0]-r,S[1]-o)}t.lineTo(p+m,v+b)}function Mst(t,e){var n=e.radius,r=e.width,i=e.height,o=r,a=i,s=n&&n.some(function(g){return g!==0});if(!s)t.rect(0,0,o,a);else{var l=r>0?1:-1,c=i>0?1:-1,u=l+c===0,f=D(n.map(function(g){return bst(g,0,Math.min(Math.abs(o)/2,Math.abs(a)/2))}),4),d=f[0],h=f[1],p=f[2],v=f[3];t.moveTo(l*d,0),t.lineTo(o-l*h,0),h!==0&&t.arc(o-l*h,c*h,h,-c*Math.PI/2,l>0?0:Math.PI,u),t.lineTo(o,a-c*p),p!==0&&t.arc(o-l*p,a-c*p,p,l>0?0:Math.PI,c>0?Math.PI/2:1.5*Math.PI,u),t.lineTo(l*v,a),v!==0&&t.arc(l*v,a-c*v,v,c>0?Math.PI/2:-Math.PI/2,l>0?Math.PI:0,u),t.lineTo(0,c*d),d!==0&&t.arc(l*d,c*d,d,l>0?Math.PI:0,c>0?Math.PI*1.5:Math.PI/2,u)}}var Pst=function(t){st(e,t);function e(){var n=t.apply(this,Q([],D(arguments),!1))||this;return n.name="canvas-path-generator",n}return e.prototype.init=function(){var n,r=(n={},n[H.CIRCLE]=xst,n[H.ELLIPSE]=wst,n[H.RECT]=Mst,n[H.LINE]=Ost,n[H.POLYLINE]=Est,n[H.POLYGON]=Sst,n[H.PATH]=_st,n[H.TEXT]=void 0,n[H.GROUP]=void 0,n[H.IMAGE]=void 0,n[H.HTML]=void 0,n[H.MESH]=void 0,n);this.context.pathGeneratorFactory=r},e.prototype.destroy=function(){delete this.context.pathGeneratorFactory},e}(Qo),Ast=function(t,e,n){return t<e?e:t>n?n:t};const Cst=Ast;function j0(t,e,n){var r=t*Math.cos(n)-e*Math.sin(n),i=t*Math.sin(n)+e*Math.cos(n);return{x:r,y:i}}function BI(t,e,n,r,i,o,a,s,l,c){var u=t,f=e,d=n,h=r,p=s,v=l,g=Math.PI*120/180,y=Math.PI/180*(+i||0),m=[],b,x,w,O,_;if(c)x=c[0],w=c[1],O=c[2],_=c[3];else{b=j0(u,f,-y),u=b.x,f=b.y,b=j0(p,v,-y),p=b.x,v=b.y;var S=(u-p)/2,E=(f-v)/2,M=S*S/(d*d)+E*E/(h*h);M>1&&(M=Math.sqrt(M),d*=M,h*=M);var P=d*d,C=h*h,A=(o===a?-1:1)*Math.sqrt(Math.abs((P*C-P*E*E-C*S*S)/(P*E*E+C*S*S)));O=A*d*E/h+(u+p)/2,_=A*-h*S/d+(f+v)/2,x=Math.asin(((f-_)/h*Math.pow(10,9)>>0)/Math.pow(10,9)),w=Math.asin(((v-_)/h*Math.pow(10,9)>>0)/Math.pow(10,9)),x=u<O?Math.PI-x:x,w=p<O?Math.PI-w:w,x<0&&(x=Math.PI*2+x),w<0&&(w=Math.PI*2+w),a&&x>w&&(x-=Math.PI*2),!a&&w>x&&(w-=Math.PI*2)}var T=w-x;if(Math.abs(T)>g){var k=w,N=p,j=v;w=x+g*(a&&w>x?1:-1),p=O+d*Math.cos(w),v=_+h*Math.sin(w),m=BI(p,v,d,h,i,0,a,N,j,[w,k,O,_])}T=w-x;var L=Math.cos(x),I=Math.sin(x),$=Math.cos(w),F=Math.sin(w),R=Math.tan(T/4),B=4/3*d*R,W=4/3*h*R,K=[u,f],J=[u+B*I,f-W*L],X=[p+B*F,v-W*$],V=[p,v];if(J[0]=2*K[0]-J[0],J[1]=2*K[1]-J[1],c)return J.concat(X,V,m);m=J.concat(X,V,m);for(var it=[],nt=0,lt=m.length;nt<lt;nt+=1)it[nt]=nt%2?j0(m[nt-1],m[nt],y).y:j0(m[nt],m[nt+1],y).x;return it}var Tst=Ct(),kst=Ct(),Lst=Ct(),Nst=Kt(),Ist=function(){function t(){var e=this;this.isHit=function(n,r,i,o){var a=e.context.pointInPathPickerFactory[n.nodeName];if(a){var s=oi(Nst,i),l=Qe(kst,ai(Lst,r[0],r[1],0),s),c=n.getGeometryBounds().halfExtents,u=n.parsedStyle.anchor;if(l[0]+=(u&&u[0]||0)*c[0]*2,l[1]+=(u&&u[1]||0)*c[1]*2,a(n,new on(l[0],l[1]),o,e.isPointInPath,e.context,e.runtime))return!0}return!1},this.isPointInPath=function(n,r){var i=e.runtime.offscreenCanvasCreator.getOrCreateContext(e.context.config.offscreenCanvas),o=e.context.pathGeneratorFactory[n.nodeName];return o&&(i.beginPath(),o(i,n.parsedStyle),i.closePath()),i.isPointInPath(r.x,r.y)}}return t.prototype.apply=function(e,n){var r=this,i,o=e.renderingService,a=e.renderingContext;this.context=e,this.runtime=n;var s=(i=a.root)===null||i===void 0?void 0:i.ownerDocument;o.hooks.pick.tapPromise(t.tag,function(l){return hl(r,void 0,void 0,function(){return pl(this,function(c){return[2,this.pick(s,l)]})})}),o.hooks.pickSync.tap(t.tag,function(l){return r.pick(s,l)})},t.prototype.pick=function(e,n){var r,i,o=n.topmost,a=n.position,s=a.x,l=a.y,c=ai(Tst,s,l,0),u=e.elementsFromBBox(c[0],c[1],c[0],c[1]),f=[];try{for(var d=ur(u),h=d.next();!h.done;h=d.next()){var p=h.value,v=p.getWorldTransform(),g=this.isHit(p,c,v,!1);if(g){var y=cC(p);if(y){var m=y.parsedStyle.clipPath,b=this.isHit(m,c,m.getWorldTransform(),!0);if(b){if(o)return n.picked=[p],n;f.push(p)}}else{if(o)return n.picked=[p],n;f.push(p)}}}}catch(x){r={error:x}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}return n.picked=f,n},t.tag="CanvasPicker",t}();function jst(t,e,n){var r=t.parsedStyle,i=r.r,o=r.fill,a=r.stroke,s=r.lineWidth,l=r.increasedLineWidthForHitTesting,c=r.pointerEvents,u=((s||0)+(l||0))/2,f=so(i,i,e.x,e.y),d=D(us(c,o,a),2),h=d[0],p=d[1];return h&&p||n?f<=i+u:h?f<=i:p?f>=i-u&&f<=i+u:!1}function D0(t,e,n,r){return t/(n*n)+e/(r*r)}function Dst(t,e,n){var r=t.parsedStyle,i=r.rx,o=r.ry,a=r.fill,s=r.stroke,l=r.lineWidth,c=r.increasedLineWidthForHitTesting,u=r.pointerEvents,f=e.x,d=e.y,h=D(us(u,a,s),2),p=h[0],v=h[1],g=((l||0)+(c||0))/2,y=(f-i)*(f-i),m=(d-o)*(d-o);return p&&v||n?D0(y,m,i+g,o+g)<=1:p?D0(y,m,i,o)<=1:v?D0(y,m,i-g,o-g)>=1&&D0(y,m,i+g,o+g)<=1:!1}function Ss(t,e,n,r,i,o){return i>=t&&i<=t+n&&o>=e&&o<=e+r}function $st(t,e,n,r,i,o,a){var s=i/2;return Ss(t-s,e-s,n,i,o,a)||Ss(t+n-s,e-s,i,r,o,a)||Ss(t+s,e+r-s,n,i,o,a)||Ss(t-s,e+s,i,r,o,a)}function $0(t,e,n,r,i,o,a,s){var l=(Math.atan2(s-e,a-t)+Math.PI*2)%(Math.PI*2),c={x:t+n*Math.cos(l),y:e+n*Math.sin(l)};return so(c.x,c.y,a,s)<=o/2}function fa(t,e,n,r,i,o,a){var s=Math.min(t,n),l=Math.max(t,n),c=Math.min(e,r),u=Math.max(e,r),f=i/2;return o>=s-f&&o<=l+f&&a>=c-f&&a<=u+f?zU(t,e,n,r,o,a)<=i/2:!1}function zI(t,e,n,r,i){var o=t.length;if(o<2)return!1;for(var a=0;a<o-1;a++){var s=t[a][0],l=t[a][1],c=t[a+1][0],u=t[a+1][1];if(fa(s,l,c,u,e,n,r))return!0}if(i){var f=t[0],d=t[o-1];if(fa(f[0],f[1],d[0],d[1],e,n,r))return!0}return!1}var Fst=1e-6;function Px(t){return Math.abs(t)<Fst?0:t<0?-1:1}function Rst(t,e,n){return(n[0]-t[0])*(e[1]-t[1])===(e[0]-t[0])*(n[1]-t[1])&&Math.min(t[0],e[0])<=n[0]&&n[0]<=Math.max(t[0],e[0])&&Math.min(t[1],e[1])<=n[1]&&n[1]<=Math.max(t[1],e[1])}function YI(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var o=0;o<i;o++){var a=t[o],s=t[(o+1)%i];if(Rst(a,s,[e,n]))return!0;Px(a[1]-n)>0!=Px(s[1]-n)>0&&Px(e-(n-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(r=!r)}return r}function WI(t,e,n){for(var r=!1,i=0;i<t.length;i++){var o=t[i];if(r=YI(o,e,n),r)break}return r}function Bst(t,e,n){var r=t.parsedStyle,i=r.x1,o=r.y1,a=r.x2,s=r.y2,l=r.lineWidth,c=r.increasedLineWidthForHitTesting,u=r.defX,f=u===void 0?0:u,d=r.defY,h=d===void 0?0:d,p=r.pointerEvents,v=r.fill,g=r.stroke,y=D(us(p,v,g),2),m=y[1];return!m&&!n||!l?!1:fa(i,o,a,s,(l||0)+(c||0),e.x+f,e.y+h)}function zst(t,e,n,r,i){for(var o=!1,a=e/2,s=0;s<t.length;s++){var l=t[s],c=l.currentPoint,u=l.params,f=l.prePoint,d=l.box;if(!(d&&!Ss(d.x-a,d.y-a,d.width+e,d.height+e,n,r)))switch(l.command){case"L":case"Z":if(o=fa(f[0],f[1],c[0],c[1],e,n,r),o)return!0;break;case"Q":var h=XU(f[0],f[1],u[1],u[2],u[3],u[4],n,r);if(o=h<=e/2,o)return!0;break;case"C":var p=AA(f[0],f[1],u[1],u[2],u[3],u[4],u[5],u[6],n,r,i);if(o=p<=e/2,o)return!0;break;case"A":l.cubicParams||(l.cubicParams=BI(f[0],f[1],u[1],u[2],u[3],u[4],u[5],u[6],u[7],void 0));for(var v=l.cubicParams,g=f,y=0;y<v.length;y+=6){var m=AA(g[0],g[1],v[y],v[y+1],v[y+2],v[y+3],v[y+4],v[y+5],n,r,i);if(g=[v[y+4],v[y+5]],o=m<=e/2,o)return!0}break}}return o}function Yst(t,e,n,r,i,o){var a=t.parsedStyle,s=a.lineWidth,l=a.increasedLineWidthForHitTesting,c=a.stroke,u=a.fill,f=a.defX,d=f===void 0?0:f,h=a.defY,p=h===void 0?0:h,v=a.path,g=a.pointerEvents,y=v.segments,m=v.hasArc,b=v.polylines,x=v.polygons,w=D(us(g,(x==null?void 0:x.length)&&u,c),2),O=w[0],_=w[1],S=b1(t),E=!1;return O||n?(m?E=r(t,e):E=WI(x,e.x+d,e.y+p)||WI(b,e.x+d,e.y+p),E):((_||n)&&(E=zst(y,(s||0)+(l||0),e.x+d,e.y+p,S)),E)}function Wst(t,e,n){var r=t.parsedStyle,i=r.stroke,o=r.fill,a=r.lineWidth,s=r.increasedLineWidthForHitTesting,l=r.points,c=r.defX,u=c===void 0?0:c,f=r.defY,d=f===void 0?0:f,h=r.pointerEvents,p=D(us(h,o,i),2),v=p[0],g=p[1],y=!1;return(g||n)&&(y=zI(l.points,(a||0)+(s||0),e.x+u,e.y+d,!0)),!y&&(v||n)&&(y=YI(l.points,e.x+u,e.y+d)),y}function Gst(t,e,n){var r=t.parsedStyle,i=r.lineWidth,o=r.increasedLineWidthForHitTesting,a=r.points,s=r.defX,l=s===void 0?0:s,c=r.defY,u=c===void 0?0:c,f=r.pointerEvents,d=r.fill,h=r.stroke,p=D(us(f,d,h),2),v=p[1];return!v&&!n||!i?!1:zI(a.points,(i||0)+(o||0),e.x+l,e.y+u,!1)}function Hst(t,e,n,r,i){var o=t.parsedStyle,a=o.radius,s=o.fill,l=o.stroke,c=o.lineWidth,u=o.increasedLineWidthForHitTesting,f=o.width,d=o.height,h=o.pointerEvents,p=D(us(h,s,l),2),v=p[0],g=p[1],y=a&&a.some(function(w){return w!==0}),m=(c||0)+(u||0);if(y){var x=!1;return(g||n)&&(x=Ust(0,0,f,d,a.map(function(w){return Cst(w,0,Math.min(Math.abs(f)/2,Math.abs(d)/2))}),m,e.x,e.y)),!x&&(v||n)&&(x=r(t,e)),x}else{var b=m/2;if(v&&g||n)return Ss(0-b,0-b,f+b,d+b,e.x,e.y);if(v)return Ss(0,0,f,d,e.x,e.y);if(g)return $st(0,0,f,d,m,e.x,e.y)}return!1}function Ust(t,e,n,r,i,o,a,s){var l=D(i,4),c=l[0],u=l[1],f=l[2],d=l[3];return fa(t+c,e,t+n-u,e,o,a,s)||fa(t+n,e+u,t+n,e+r-f,o,a,s)||fa(t+n-f,e+r,t+d,e+r,o,a,s)||fa(t,e+r-d,t,e+c,o,a,s)||$0(t+n-u,e+u,u,1.5*Math.PI,2*Math.PI,o,a,s)||$0(t+n-f,e+r-f,f,0,.5*Math.PI,o,a,s)||$0(t+d,e+r-d,d,.5*Math.PI,Math.PI,o,a,s)||$0(t+c,e+c,c,Math.PI,1.5*Math.PI,o,a,s)}function Vst(t,e,n,r,i,o){var a=t.parsedStyle,s=a.pointerEvents,l=a.width,c=a.height;if(s==="non-transparent-pixel"){var u=i.config.offscreenCanvas,f=o.offscreenCanvasCreator.getOrCreateCanvas(u),d=o.offscreenCanvasCreator.getOrCreateContext(u,{willReadFrequently:!0});f.width=l,f.height=c,i.defaultStyleRendererFactory[H.IMAGE].render(d,t.parsedStyle,t,void 0,void 0,void 0);var h=d.getImageData(e.x,e.y,1,1).data;return h.every(function(p){return p!==0})}return!0}var Xst=function(t){st(e,t);function e(){var n=t.apply(this,Q([],D(arguments),!1))||this;return n.name="canvas-picker",n}return e.prototype.init=function(){var n,r=function(){return!0},i=(n={},n[H.CIRCLE]=jst,n[H.ELLIPSE]=Dst,n[H.RECT]=Hst,n[H.LINE]=Bst,n[H.POLYLINE]=Gst,n[H.POLYGON]=Wst,n[H.PATH]=Yst,n[H.TEXT]=r,n[H.GROUP]=null,n[H.IMAGE]=Vst,n[H.HTML]=null,n[H.MESH]=null,n);this.context.pointInPathPickerFactory=i,this.addRenderingPlugin(new Ist)},e.prototype.destroy=function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()},e}(Qo),qst=function(t){return t==null};const un=qst;var Kst={}.toString,Zst=function(t,e){return Kst.call(t)==="[object "+e+"]"};const Qst=Zst,Jst=function(t){return Qst(t,"String")};var tlt=function(){function t(e){this.canvasRendererPluginOptions=e,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.vpMatrix=Kt(),this.dprMatrix=Kt(),this.tmpMat4=Kt(),this.vec3a=Ct(),this.vec3b=Ct(),this.vec3c=Ct(),this.vec3d=Ct()}return t.prototype.apply=function(e,n){var r=this;this.context=e;var i=e.config,o=e.camera,a=e.renderingService,s=e.renderingContext,l=e.rBushRoot,c=e.pathGeneratorFactory;this.rBush=l,this.pathGeneratorFactory=c;var u=e.contextService,f=s.root.ownerDocument.defaultView,d=function(v){var g=v.target,y=g.rBushNode;y.aabb&&r.removedRBushNodeAABBs.push(y.aabb)},h=function(v){var g=v.target,y=g.rBushNode;y.aabb&&r.removedRBushNodeAABBs.push(y.aabb)};a.hooks.init.tap(t.tag,function(){f.addEventListener(St.UNMOUNTED,d),f.addEventListener(St.CULLED,h);var v=u.getDPR(),g=i.width,y=i.height,m=u.getContext();r.clearRect(m,0,0,g*v,y*v,i.background)}),a.hooks.destroy.tap(t.tag,function(){f.removeEventListener(St.UNMOUNTED,d),f.removeEventListener(St.CULLED,h),r.renderQueue=[],r.removedRBushNodeAABBs=[],r.restoreStack=[]}),a.hooks.beginFrame.tap(t.tag,function(){var v=u.getContext(),g=u.getDPR(),y=i.width,m=i.height,b=r.canvasRendererPluginOptions,x=b.dirtyObjectNumThreshold,w=b.dirtyObjectRatioThreshold,O=a.getStats(),_=O.total,S=O.rendered,E=S/_;r.clearFullScreen=a.disableDirtyRectangleRendering()||S>x&&E>w,v&&(v.resetTransform?v.resetTransform():v.setTransform(1,0,0,1,0,0),r.clearFullScreen&&r.clearRect(v,0,0,y*g,m*g,i.background))});var p=function(v,g){v.isVisible()&&!v.isCulled()&&(r.renderDisplayObject(v,g,r.context,r.restoreStack,n),r.saveDirtyAABB(v));var y=v.sortable.sorted||v.childNodes;y.forEach(function(m){p(m,g)})};a.hooks.endFrame.tap(t.tag,function(){var v=u.getContext(),g=u.getDPR();if(Xy(r.dprMatrix,[g,g,1]),On(r.vpMatrix,r.dprMatrix,o.getOrthoMatrix()),r.clearFullScreen)p(s.root,v);else{var y=r.safeMergeAABB.apply(r,Q([r.mergeDirtyAABBs(r.renderQueue)],D(r.removedRBushNodeAABBs.map(function(F){var R=F.minX,B=F.minY,W=F.maxX,K=F.maxY,J=new Xe;return J.setMinMax([R,B,0],[W,K,0]),J})),!1));if(r.removedRBushNodeAABBs=[],Xe.isEmpty(y)){r.renderQueue=[];return}var m=r.convertAABB2Rect(y),b=m.x,x=m.y,w=m.width,O=m.height,_=Qe(r.vec3a,[b,x,0],r.vpMatrix),S=Qe(r.vec3b,[b+w,x,0],r.vpMatrix),E=Qe(r.vec3c,[b,x+O,0],r.vpMatrix),M=Qe(r.vec3d,[b+w,x+O,0],r.vpMatrix),P=Math.min(_[0],S[0],M[0],E[0]),C=Math.min(_[1],S[1],M[1],E[1]),A=Math.max(_[0],S[0],M[0],E[0]),T=Math.max(_[1],S[1],M[1],E[1]),k=Math.floor(P),N=Math.floor(C),j=Math.ceil(A-P),L=Math.ceil(T-C);v.save(),r.clearRect(v,k,N,j,L,i.background),v.beginPath(),v.rect(k,N,j,L),v.clip(),v.setTransform(r.vpMatrix[0],r.vpMatrix[1],r.vpMatrix[4],r.vpMatrix[5],r.vpMatrix[12],r.vpMatrix[13]);var I=i.renderer.getConfig().enableDirtyRectangleRenderingDebug;I&&f.dispatchEvent(new ee(Qn.DIRTY_RECTANGLE,{dirtyRect:{x:k,y:N,width:j,height:L}}));var $=r.searchDirtyObjects(y);$.sort(function(F,R){return F.sortable.renderOrder-R.sortable.renderOrder}).forEach(function(F){F&&F.isVisible()&&!F.isCulled()&&r.renderDisplayObject(F,v,r.context,r.restoreStack,n)}),v.restore(),r.renderQueue.forEach(function(F){r.saveDirtyAABB(F)}),r.renderQueue=[]}r.restoreStack.forEach(function(){v.restore()}),r.restoreStack=[]}),a.hooks.render.tap(t.tag,function(v){r.clearFullScreen||r.renderQueue.push(v)})},t.prototype.clearRect=function(e,n,r,i,o,a){e.clearRect(n,r,i,o),a&&(e.fillStyle=a,e.fillRect(n,r,i,o))},t.prototype.renderDisplayObject=function(e,n,r,i,o){var a=e.nodeName,s=i[i.length-1];s&&!(e.compareDocumentPosition(s)&an.DOCUMENT_POSITION_CONTAINS)&&(n.restore(),i.pop());var l=this.context.styleRendererFactory[a],c=this.pathGeneratorFactory[a],u=e.parsedStyle.clipPath;if(u){this.applyWorldTransform(n,u);var f=this.pathGeneratorFactory[u.nodeName];f&&(n.save(),i.push(e),n.beginPath(),f(n,u.parsedStyle),n.closePath(),n.clip())}l&&(this.applyWorldTransform(n,e),n.save(),this.applyAttributesToContext(n,e)),c&&(n.beginPath(),c(n,e.parsedStyle),e.nodeName!==H.LINE&&e.nodeName!==H.PATH&&e.nodeName!==H.POLYLINE&&n.closePath()),l&&(l.render(n,e.parsedStyle,e,r,this,o),n.restore()),e.renderable.dirty=!1},t.prototype.convertAABB2Rect=function(e){var n=e.getMin(),r=e.getMax(),i=Math.floor(n[0]),o=Math.floor(n[1]),a=Math.ceil(r[0]),s=Math.ceil(r[1]),l=a-i,c=s-o;return{x:i,y:o,width:l,height:c}},t.prototype.mergeDirtyAABBs=function(e){var n=new Xe;return e.forEach(function(r){var i=r.getRenderBounds();n.add(i);var o=r.renderable.dirtyRenderBounds;o&&n.add(o)}),n},t.prototype.searchDirtyObjects=function(e){var n=D(e.getMin(),2),r=n[0],i=n[1],o=D(e.getMax(),2),a=o[0],s=o[1],l=this.rBush.search({minX:r,minY:i,maxX:a,maxY:s});return l.map(function(c){var u=c.displayObject;return u})},t.prototype.saveDirtyAABB=function(e){var n=e.renderable;n.dirtyRenderBounds||(n.dirtyRenderBounds=new Xe);var r=e.getRenderBounds();r&&n.dirtyRenderBounds.update(r.center,r.halfExtents)},t.prototype.applyAttributesToContext=function(e,n){var r=n.parsedStyle,i=r.stroke,o=r.fill,a=r.opacity,s=r.lineDash,l=r.lineDashOffset;s&&e.setLineDash(s),un(l)||(e.lineDashOffset=l),un(a)||(e.globalAlpha*=a),!un(i)&&!Array.isArray(i)&&!i.isNone&&(e.strokeStyle=n.attributes.stroke),!un(o)&&!Array.isArray(o)&&!o.isNone&&(e.fillStyle=n.attributes.fill)},t.prototype.applyWorldTransform=function(e,n,r){var i=0,o=0,a=(n.parsedStyle||{}).anchor,s=a&&a[0]||0,l=a&&a[1]||0;if(s!==0||l!==0){var c=n.geometry.contentBounds,u=c&&c.halfExtents[0]*2||0,f=c&&c.halfExtents[1]*2||0;i=-(s*u),o=-(l*f)}r?(qa(this.tmpMat4,n.getLocalTransform()),this.vec3a[0]=i,this.vec3a[1]=o,this.vec3a[2]=0,Yo(this.tmpMat4,this.tmpMat4,this.vec3a),On(this.tmpMat4,r,this.tmpMat4),On(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(qa(this.tmpMat4,n.getWorldTransform()),this.vec3a[0]=i,this.vec3a[1]=o,this.vec3a[2]=0,Yo(this.tmpMat4,this.tmpMat4,this.vec3a),On(this.tmpMat4,this.vpMatrix,this.tmpMat4)),e.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])},t.prototype.safeMergeAABB=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=new Xe;return e.forEach(function(i){r.add(i)}),r},t.tag="CanvasRenderer",t}(),da=function(){function t(e){this.imagePool=e}return t.prototype.render=function(e,n,r,i,o,a){var s=n.fill,l=n.fillRule,c=n.opacity,u=n.fillOpacity,f=n.stroke,d=n.strokeOpacity,h=n.lineWidth,p=n.lineCap,v=n.lineJoin,g=n.shadowType,y=n.shadowColor,m=n.shadowBlur,b=n.filter,x=n.miterLimit,w=!un(s)&&!s.isNone,O=!un(f)&&!f.isNone&&h>0,_=s.alpha===0,S=!!(b&&b.length),E=!un(y)&&m>0,M=r.nodeName,P=g==="inner",C=O&&E&&(M===H.PATH||M===H.LINE||M===H.POLYLINE||_||P);w&&(e.globalAlpha=c*u,C||F0(r,e,E),this.fill(e,r,s,l,i,o,a),C||this.clearShadowAndFilter(e,S,E)),O&&(e.globalAlpha=c*d,e.lineWidth=h,un(x)||(e.miterLimit=x),un(p)||(e.lineCap=p),un(v)||(e.lineJoin=v),C&&(P&&(e.globalCompositeOperation="source-atop"),F0(r,e,!0),P&&(this.stroke(e,r,f,i,o,a),e.globalCompositeOperation="source-over",this.clearShadowAndFilter(e,S,!0))),this.stroke(e,r,f,i,o,a))},t.prototype.clearShadowAndFilter=function(e,n,r){if(r&&(e.shadowColor="transparent",e.shadowBlur=0),n){var i=e.filter;!un(i)&&i.indexOf("drop-shadow")>-1&&(e.filter=i.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}},t.prototype.fill=function(e,n,r,i,o,a,s){var l=this;Array.isArray(r)?r.forEach(function(c){e.fillStyle=l.getColor(c,n,e),i?e.fill(i):e.fill()}):(Ku(r)&&(e.fillStyle=this.getPattern(r,n,e,o,a,s)),i?e.fill(i):e.fill())},t.prototype.stroke=function(e,n,r,i,o,a){var s=this;Array.isArray(r)?r.forEach(function(l){e.strokeStyle=s.getColor(l,n,e),e.stroke()}):(Ku(r)&&(e.strokeStyle=this.getPattern(r,n,e,i,o,a)),e.stroke())},t.prototype.getPattern=function(e,n,r,i,o,a){var s,l;if(e.image.nodeName==="rect"){var c=e.image.parsedStyle,u=c.width,f=c.height;l=i.contextService.getDPR();var d=i.config.offscreenCanvas;s=a.offscreenCanvasCreator.getOrCreateCanvas(d),s.width=u*l,s.height=f*l;var h=a.offscreenCanvasCreator.getOrCreateContext(d),p=[];e.image.forEach(function(g){o.renderDisplayObject(g,h,i,p,a)}),p.forEach(function(){h.restore()})}var v=this.imagePool.getOrCreatePatternSync(e,r,s,l,function(){n.renderable.dirty=!0,i.renderingService.dirtify()});return v},t.prototype.getColor=function(e,n,r){var i;if(e.type===Li.LinearGradient||e.type===Li.RadialGradient){var o=n.getGeometryBounds(),a=o&&o.halfExtents[0]*2||1,s=o&&o.halfExtents[1]*2||1;i=this.imagePool.getOrCreateGradient(G(G({type:e.type},e.value),{width:a,height:s}),r)}return i},t}();function F0(t,e,n){var r=t.parsedStyle,i=r.filter,o=r.shadowColor,a=r.shadowBlur,s=r.shadowOffsetX,l=r.shadowOffsetY;i&&i.length&&(e.filter=t.style.filter),n&&(e.shadowColor=o.toString(),e.shadowBlur=a||0,e.shadowOffsetX=s||0,e.shadowOffsetY=l||0)}var elt=function(){function t(e){this.imagePool=e}return t.prototype.render=function(e,n,r){var i=n.width,o=n.height,a=n.img,s=n.shadowColor,l=n.shadowBlur,c,u=i,f=o;if(Jst(a)?c=this.imagePool.getImageSync(a):(u||(u=a.width),f||(f=a.height),c=a),c){var d=!un(s)&&l>0;F0(r,e,d);try{e.drawImage(c,0,0,u,f)}catch(h){}}},t}(),nlt=function(){function t(){}return t.prototype.render=function(e,n,r,i,o,a){var s=n,l=s.lineWidth,c=s.textAlign,u=s.textBaseline,f=s.lineJoin,d=s.miterLimit,h=s.letterSpacing,p=s.stroke,v=s.fill,g=s.fillOpacity,y=s.strokeOpacity,m=s.opacity,b=s.metrics,x=s.dx,w=s.dy,O=s.shadowColor,_=s.shadowBlur,S=b.font,E=b.lines,M=b.height,P=b.lineHeight,C=b.lineMetrics;e.font=S,e.lineWidth=l,e.textAlign=c==="middle"?"center":c;var A=u;!a.enableCSSParsing&&A==="alphabetic"&&(A="bottom"),e.lineJoin=f,un(d)||(e.miterLimit=d);var T=0;u==="middle"?T=-M/2-P/2:u==="bottom"||u==="alphabetic"||u==="ideographic"?T=-M:(u==="top"||u==="hanging")&&(T=-P);var k=x||0;T+=w||0,E.length===1&&(A==="bottom"?(A="middle",T-=.5*M):A==="top"&&(A="middle",T+=.5*M)),e.textBaseline=A;var N=!un(O)&&_>0;F0(r,e,N);for(var j=0;j<E.length;j++){var L=l/2+k;T+=P,!un(p)&&!p.isNone&&l&&this.drawLetterSpacing(e,E[j],C[j],c,L,T,h,g,y,m,!0),un(v)||this.drawLetterSpacing(e,E[j],C[j],c,L,T,h,g,y,m)}},t.prototype.drawLetterSpacing=function(e,n,r,i,o,a,s,l,c,u,f){if(f===void 0&&(f=!1),s===0){f?this.strokeText(e,n,o,a,c):this.fillText(e,n,o,a,l,u);return}var d=e.textAlign;e.textAlign="left";var h=o;i==="center"||i==="middle"?h=o-r.width/2:(i==="right"||i==="end")&&(h=o-r.width);for(var p=Array.from(n),v=e.measureText(n).width,g=0,y=0;y<p.length;++y){var m=p[y];f?this.strokeText(e,m,h,a,c):this.fillText(e,m,h,a,l,u),g=e.measureText(n.substring(y+1)).width,h+=v-g+s,v=g}e.textAlign=d},t.prototype.fillText=function(e,n,r,i,o,a){var s,l=!un(o)&&o!==1;l&&(s=e.globalAlpha,e.globalAlpha=o*a),e.fillText(n,r,i),l&&(e.globalAlpha=s)},t.prototype.strokeText=function(e,n,r,i,o){var a,s=!un(o)&&o!==1;s&&(a=e.globalAlpha,e.globalAlpha=o),e.strokeText(n,r,i),s&&(e.globalAlpha=a)},t}();(function(t){st(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(da),function(t){st(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(da),function(t){st(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(da),function(t){st(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(da),function(t){st(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(da),function(t){st(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(da),function(t){st(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(da);var rlt=function(t){st(e,t);function e(n){n===void 0&&(n={});var r=t.call(this)||this;return r.options=n,r.name="canvas-renderer",r}return e.prototype.init=function(){var n,r=G({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),i=this.context.imagePool,o=new da(i),a=(n={},n[H.CIRCLE]=o,n[H.ELLIPSE]=o,n[H.RECT]=o,n[H.IMAGE]=new elt(i),n[H.TEXT]=new nlt,n[H.LINE]=o,n[H.POLYLINE]=o,n[H.POLYGON]=o,n[H.PATH]=o,n[H.GROUP]=void 0,n[H.HTML]=void 0,n[H.MESH]=void 0,n);this.context.defaultStyleRendererFactory=a,this.context.styleRendererFactory=a,this.addRenderingPlugin(new tlt(r))},e.prototype.destroy=function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory},e}(Qo),ilt=function(){function t(){}return t.prototype.apply=function(e,n){var r=this,i=e.renderingService,o=e.renderingContext,a=e.config;this.context=e;var s=o.root.ownerDocument.defaultView,l=function(O){i.hooks.pointerMove.call(O)},c=function(O){i.hooks.pointerUp.call(O)},u=function(O){i.hooks.pointerDown.call(O)},f=function(O){i.hooks.pointerOver.call(O)},d=function(O){i.hooks.pointerOut.call(O)},h=function(O){i.hooks.pointerCancel.call(O)},p=function(O){i.hooks.pointerWheel.call(O)},v=function(O){i.hooks.click.call(O)},g=function(O){n.globalThis.document.addEventListener("pointermove",l,!0),O.addEventListener("pointerdown",u,!0),O.addEventListener("pointerleave",d,!0),O.addEventListener("pointerover",f,!0),n.globalThis.addEventListener("pointerup",c,!0),n.globalThis.addEventListener("pointercancel",h,!0)},y=function(O){O.addEventListener("touchstart",u,!0),O.addEventListener("touchend",c,!0),O.addEventListener("touchmove",l,!0),O.addEventListener("touchcancel",h,!0)},m=function(O){n.globalThis.document.addEventListener("mousemove",l,!0),O.addEventListener("mousedown",u,!0),O.addEventListener("mouseout",d,!0),O.addEventListener("mouseover",f,!0),n.globalThis.addEventListener("mouseup",c,!0)},b=function(O){n.globalThis.document.removeEventListener("pointermove",l,!0),O.removeEventListener("pointerdown",u,!0),O.removeEventListener("pointerleave",d,!0),O.removeEventListener("pointerover",f,!0),n.globalThis.removeEventListener("pointerup",c,!0)},x=function(O){O.removeEventListener("touchstart",u,!0),O.removeEventListener("touchend",c,!0),O.removeEventListener("touchmove",l,!0),O.removeEventListener("touchcancel",h,!0)},w=function(O){n.globalThis.document.removeEventListener("mousemove",l,!0),O.removeEventListener("mousedown",u,!0),O.removeEventListener("mouseout",d,!0),O.removeEventListener("mouseover",f,!0),n.globalThis.removeEventListener("mouseup",c,!0)};i.hooks.init.tap(t.tag,function(){var O=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(O.style.msContentZooming="none",O.style.msTouchAction="none"):s.supportsPointerEvents&&(O.style.touchAction="none"),s.supportsPointerEvents?g(O):m(O),s.supportsTouchEvents&&y(O),a.useNativeClickEvent&&O.addEventListener("click",v,!0),O.addEventListener("wheel",p,{passive:!0,capture:!0})}),i.hooks.destroy.tap(t.tag,function(){var O=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(O.style.msContentZooming="",O.style.msTouchAction=""):s.supportsPointerEvents&&(O.style.touchAction=""),s.supportsPointerEvents?b(O):w(O),s.supportsTouchEvents&&x(O),a.useNativeClickEvent&&O.removeEventListener("click",v,!0),O.removeEventListener("wheel",p,!0)})},t.tag="DOMInteraction",t}(),olt=function(t){st(e,t);function e(){var n=t.apply(this,Q([],D(arguments),!1))||this;return n.name="dom-interaction",n}return e.prototype.init=function(){this.addRenderingPlugin(new ilt)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(Qo),alt=function(t){return t==null};const slt=alt;var llt={}.toString,clt=function(t,e){return llt.call(t)==="[object "+e+"]"};const GI=clt,ult=function(t){return GI(t,"String")};var flt=function(t){return GI(t,"Number")};const HI=flt;var dlt="g-canvas-camera",hlt=function(){function t(){this.displayObjectHTMLElementMap=new WeakMap}return t.prototype.joinTransformMatrix=function(e){return"matrix(".concat([e[0],e[1],e[4],e[5],e[12],e[13]].join(","),")")},t.prototype.apply=function(e,n){var r=this,i=e.camera,o=e.renderingContext,a=e.renderingService;this.context=e;var s=o.root.ownerDocument.defaultView,l=s.context.eventService.nativeHTMLMap,c=function(v,g){g.style.transform=r.joinTransformMatrix(v.getWorldTransform())},u=function(v){var g=v.target;if(g.nodeName===H.HTML){r.$camera||(r.$camera=r.createCamera(i));var y=r.getOrCreateEl(g);if(r.$camera.appendChild(y),n.enableCSSParsing){var m=g.ownerDocument.documentElement.attributes;Object.keys(m).forEach(function(b){y.style[b]=m[b]})}Object.keys(g.attributes).forEach(function(b){r.updateAttribute(b,g)}),c(g,y),l.set(y,g)}},f=function(v){var g=v.target;if(g.nodeName===H.HTML&&r.$camera){var y=r.getOrCreateEl(g);y&&(y.remove(),l.delete(y))}},d=function(v){var g=v.target;if(g.nodeName===H.HTML){var y=v.attrName;r.updateAttribute(y,g)}},h=function(v){var g=v.target;if(g.nodeName===H.HTML){var y=r.getOrCreateEl(g);c(g,y)}},p=function(){if(r.$camera){var v=r.context.config,g=v.width,y=v.height;r.$camera.style.width="".concat(g||0,"px"),r.$camera.style.height="".concat(y||0,"px")}};a.hooks.init.tap(t.tag,function(){s.addEventListener(Qn.RESIZE,p),s.addEventListener(St.MOUNTED,u),s.addEventListener(St.UNMOUNTED,f),s.addEventListener(St.ATTR_MODIFIED,d),s.addEventListener(St.BOUNDS_CHANGED,h)}),a.hooks.endFrame.tap(t.tag,function(){r.$camera&&o.renderReasons.has(na.CAMERA_CHANGED)&&(r.$camera.style.transform=r.joinTransformMatrix(i.getOrthoMatrix()))}),a.hooks.destroy.tap(t.tag,function(){r.$camera&&r.$camera.remove(),s.removeEventListener(Qn.RESIZE,p),s.removeEventListener(St.MOUNTED,u),s.removeEventListener(St.UNMOUNTED,f),s.removeEventListener(St.ATTR_MODIFIED,d),s.removeEventListener(St.BOUNDS_CHANGED,h)})},t.prototype.createCamera=function(e){var n=this.context.config,r=n.document,i=n.width,o=n.height,a=this.context.contextService.getDomElement(),s=a.parentNode;if(s){var l=dlt,c=s.querySelector("#"+l);if(!c){var u=(r||document).createElement("div");c=u,u.id=l,u.style.position="absolute",u.style.left="".concat(a.offsetLeft||0,"px"),u.style.top="".concat(a.offsetTop||0,"px"),u.style.transformOrigin="left top",u.style.transform=this.joinTransformMatrix(e.getOrthoMatrix()),u.style.overflow="hidden",u.style.pointerEvents="none",u.style.width="".concat(i||0,"px"),u.style.height="".concat(o||0,"px"),s.appendChild(u)}return c}return null},t.prototype.getOrCreateEl=function(e){var n=this.context.config.document,r=this.displayObjectHTMLElementMap.get(e);return r||(r=(n||document).createElement("div"),e.parsedStyle.$el=r,this.displayObjectHTMLElementMap.set(e,r),e.id&&(r.id=e.id),e.name&&r.setAttribute("name",e.name),e.className&&(r.className=e.className),r.style.position="absolute",r.style.left="0px",r.style.top="0px",r.style["will-change"]="transform",r.style.transform=this.joinTransformMatrix(e.getWorldTransform())),r},t.prototype.updateAttribute=function(e,n){var r=this.getOrCreateEl(n);switch(e){case"innerHTML":var i=n.parsedStyle.innerHTML;ult(i)?r.innerHTML=i:(r.innerHTML="",r.appendChild(i));break;case"transformOrigin":var o=n.parsedStyle.transformOrigin;r.style["transform-origin"]="".concat(o[0].value," ").concat(o[1].value);break;case"width":if(this.context.enableCSSParsing){var a=n.computedStyleMap().get("width");r.style.width=a.toString()}else{var a=n.parsedStyle.width;r.style.width=HI(a)?"".concat(a,"px"):a.toString()}break;case"height":if(this.context.enableCSSParsing){var s=n.computedStyleMap().get("height");r.style.height=s.toString()}else{var s=n.parsedStyle.height;r.style.height=HI(s)?"".concat(s,"px"):s.toString()}break;case"zIndex":var l=n.parsedStyle.zIndex;r.style["z-index"]="".concat(l);break;case"visibility":var c=n.parsedStyle.visibility;r.style.visibility=c;break;case"pointerEvents":var u=n.parsedStyle.pointerEvents;r.style.pointerEvents=u;break;case"opacity":var f=n.parsedStyle.opacity;r.style.opacity="".concat(f);break;case"fill":var d=n.parsedStyle.fill,h="";pp(d)?d.isNone?h="transparent":h=n.getAttribute("fill"):Array.isArray(d)?h=n.getAttribute("fill"):Ku(d),r.style.background=h;break;case"stroke":var p=n.parsedStyle.stroke,v="";pp(p)?p.isNone?v="transparent":v=n.getAttribute("stroke"):Array.isArray(p)?v=n.getAttribute("stroke"):Ku(p),r.style["border-color"]=v,r.style["border-style"]="solid";break;case"lineWidth":var g=n.parsedStyle.lineWidth;r.style["border-width"]="".concat(g||0,"px");break;case"lineDash":r.style["border-style"]="dashed";break;case"filter":var y=n.style.filter;r.style.filter=y;break;default:e!=="x"&&e!=="y"&&!slt(n.style[e])&&n.style[e]!==""&&(r.style[e]=n.style[e])}},t.tag="HTMLRendering",t}(),plt=function(t){st(e,t);function e(){var n=t.apply(this,Q([],D(arguments),!1))||this;return n.name="html-renderer",n}return e.prototype.init=function(){this.addRenderingPlugin(new hlt)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(Qo),vlt={}.toString,glt=function(t,e){return vlt.call(t)==="[object "+e+"]"};const ylt=glt,R0=function(t){return ylt(t,"String")};var mlt=function(){function t(e){this.canvasConfig=e,this.imageCache={},this.gradientCache={},this.patternCache={}}return t.prototype.getImageSync=function(e,n){return this.imageCache[e]?n&&n(this.imageCache[e]):this.getOrCreateImage(e).then(function(r){n&&n(r)}),this.imageCache[e]},t.prototype.getOrCreateImage=function(e){var n=this;if(this.imageCache[e])return Promise.resolve(this.imageCache[e]);var r=this.canvasConfig.createImage;return new Promise(function(i,o){var a;r?a=r(e):tf&&(a=new window.Image),a&&(a.onload=function(){n.imageCache[e]=a,i(a)},a.onerror=function(s){o(s)},a.crossOrigin="Anonymous",a.src=e)})},t.prototype.getOrCreatePatternSync=function(e,n,r,i,o){var a=this.generatePatternKey(e);if(a&&this.patternCache[a])return this.patternCache[a];var s=e.image,l=e.repetition,c=e.transform,u,f=!1;R0(s)?u=this.getImageSync(s,o):r?(u=r,f=!0):u=s;var d=u&&n.createPattern(u,l);if(d){var h=void 0;c?h=C1(_1(c),new Mn({})):h=pu(Kt()),f&&gh(h,h,[1/i,1/i,1]),d.setTransform({a:h[0],b:h[1],c:h[4],d:h[5],e:h[12],f:h[13]})}return a&&d&&(this.patternCache[a]=d),d},t.prototype.getOrCreateGradient=function(e,n){var r=this.generateGradientKey(e),i=e.type,o=e.steps,a=e.width,s=e.height,l=e.angle,c=e.cx,u=e.cy,f=e.size;if(this.gradientCache[r])return this.gradientCache[r];var d=null;if(i===Li.LinearGradient){var h=PV(a,s,l),p=h.x1,v=h.y1,g=h.x2,y=h.y2;d=n.createLinearGradient(p,v,g,y)}else if(i===Li.RadialGradient){var m=AV(a,s,c,u,f),b=m.x,x=m.y,w=m.r;d=n.createRadialGradient(b,x,0,b,x,w)}return d&&(o.forEach(function(O){var _=O.offset,S=O.color;_.unit===rt.kPercentage&&(d==null||d.addColorStop(_.value/100,S.toString()))}),this.gradientCache[r]=d),this.gradientCache[r]},t.prototype.generateGradientKey=function(e){var n=e.type,r=e.width,i=e.height,o=e.steps,a=e.angle,s=e.cx,l=e.cy,c=e.size;return"gradient-".concat(n,"-").concat((a==null?void 0:a.toString())||0,"-").concat((s==null?void 0:s.toString())||0,"-").concat((l==null?void 0:l.toString())||0,"-").concat((c==null?void 0:c.toString())||0,"-").concat(r,"-").concat(i,"-").concat(o.map(function(u){var f=u.offset,d=u.color;return"".concat(f).concat(d)}).join("-"))},t.prototype.generatePatternKey=function(e){var n=e.image,r=e.repetition;if(R0(n))return"pattern-".concat(n,"-").concat(r);if(n.nodeName==="rect")return"pattern-".concat(n.entity,"-").concat(r)},t}(),blt=function(){function t(){}return t.prototype.apply=function(e){var n=e.renderingService,r=e.renderingContext,i=e.imagePool,o=r.root.ownerDocument.defaultView,a=function(c,u,f){var d=c.parsedStyle,h=d.width,p=d.height;h&&!p?c.setAttribute("height",f/u*h):!h&&p&&c.setAttribute("width",u/f*p)},s=function(c){var u=c.target,f=u.nodeName,d=u.attributes;if(f===H.IMAGE){var h=d.img,p=d.keepAspectRatio;R0(h)&&i.getImageSync(h,function(v){var g=v.width,y=v.height;p&&a(u,g,y),u.renderable.dirty=!0,n.dirtify()})}},l=function(c){var u=c.target,f=c.attrName,d=c.newValue;u.nodeName===H.IMAGE&&f==="img"&&R0(d)&&i.getOrCreateImage(d).then(function(h){var p=h.width,v=h.height;u.attributes.keepAspectRatio&&a(u,p,v),u.renderable.dirty=!0,n.dirtify()})};n.hooks.init.tap(t.tag,function(){o.addEventListener(St.MOUNTED,s),o.addEventListener(St.ATTR_MODIFIED,l)}),n.hooks.destroy.tap(t.tag,function(){o.removeEventListener(St.MOUNTED,s),o.removeEventListener(St.ATTR_MODIFIED,l)})},t.tag="LoadImage",t}(),xlt=function(t){st(e,t);function e(){var n=t.apply(this,Q([],D(arguments),!1))||this;return n.name="image-loader",n}return e.prototype.init=function(){this.context.imagePool=new mlt(this.context.config),this.addRenderingPlugin(new blt)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(Qo),wlt={}.toString,Olt=function(t,e){return wlt.call(t)==="[object "+e+"]"};const _lt=Olt,Slt=function(t){return _lt(t,"String")};var Elt=function(){function t(e){this.renderingContext=e.renderingContext,this.canvasConfig=e.config}return t.prototype.init=function(){var e=this.canvasConfig,n=e.container,r=e.canvas;if(r)this.$canvas=r,n&&r.parentElement!==n&&n.appendChild(r),this.$container=r.parentElement,this.canvasConfig.container=this.$container;else if(n&&(this.$container=Slt(n)?document.getElementById(n):n,this.$container)){var i=document.createElement("canvas");this.$container.appendChild(i),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=i}this.context=this.$canvas.getContext("2d"),this.resize(this.canvasConfig.width,this.canvasConfig.height)},t.prototype.getContext=function(){return this.context},t.prototype.getDomElement=function(){return this.$canvas},t.prototype.getDPR=function(){return this.dpr},t.prototype.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},t.prototype.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},t.prototype.resize=function(e,n){var r=this.canvasConfig.devicePixelRatio,i=r||tf&&window.devicePixelRatio||1;i=i>=1?Math.ceil(i):1,this.dpr=i,this.$canvas&&(this.$canvas.width=this.dpr*e,this.$canvas.height=this.dpr*n,DX(this.$canvas,e,n)),this.renderingContext.renderReasons.add(na.CAMERA_CHANGED)},t.prototype.applyCursorStyle=function(e){this.$container&&this.$container.style&&(this.$container.style.cursor=e)},t.prototype.toDataURL=function(e){return e===void 0&&(e={}),hl(this,void 0,void 0,function(){var n,r;return pl(this,function(i){return n=e.type,r=e.encoderOptions,[2,this.context.canvas.toDataURL(n,r)]})})},t}(),Mlt=function(t){st(e,t);function e(){var n=t.apply(this,Q([],D(arguments),!1))||this;return n.name="canvas-context-register",n}return e.prototype.init=function(){this.context.ContextService=Elt},e.prototype.destroy=function(){delete this.context.ContextService},e}(Qo),UI=function(t){st(e,t);function e(n){var r=t.call(this,n)||this;return r.registerPlugin(new Mlt),r.registerPlugin(new xlt),r.registerPlugin(new Pst),r.registerPlugin(new rlt),r.registerPlugin(new olt),r.registerPlugin(new Xst),r.registerPlugin(new plt),r}return e}(ZU);function Plt(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var Alt=function(){function t(e){this.dragndropPluginOptions=e}return t.prototype.apply=function(e){var n=this,r=e.renderingService,i=e.renderingContext,o=i.root.ownerDocument,a=o.defaultView,s=function(l){var c=l.target,u=c===o,f=u&&n.dragndropPluginOptions.isDocumentDraggable?o:c.closest&&c.closest("[draggable=true]");if(f){var d=!1,h=l.timeStamp,p=[l.clientX,l.clientY],v=null,g=[l.clientX,l.clientY],y=function(b){return hl(n,void 0,void 0,function(){var x,w,O,_,S,E;return pl(this,function(M){switch(M.label){case 0:if(!d){if(x=b.timeStamp-h,w=Plt([b.clientX,b.clientY],p),x<=this.dragndropPluginOptions.dragstartTimeThreshold||w<=this.dragndropPluginOptions.dragstartDistanceThreshold)return[2];b.type="dragstart",f.dispatchEvent(b),d=!0}return b.type="drag",b.dx=b.clientX-g[0],b.dy=b.clientY-g[1],f.dispatchEvent(b),g=[b.clientX,b.clientY],u?[3,2]:(O=this.dragndropPluginOptions.overlap==="pointer"?[b.canvasX,b.canvasY]:c.getBounds().center,[4,o.elementsFromPoint(O[0],O[1])]);case 1:_=M.sent(),S=_[_.indexOf(c)+1],E=(S==null?void 0:S.closest("[droppable=true]"))||(this.dragndropPluginOptions.isDocumentDroppable?o:null),v!==E&&(v&&(b.type="dragleave",b.target=v,v.dispatchEvent(b)),E&&(b.type="dragenter",b.target=E,E.dispatchEvent(b)),v=E,v&&(b.type="dragover",b.target=v,v.dispatchEvent(b))),M.label=2;case 2:return[2]}})})};a.addEventListener("pointermove",y);var m=function(b){if(d){b.detail={preventClick:!0};var x=b.clone();v&&(x.type="drop",x.target=v,v.dispatchEvent(x)),x.type="dragend",f.dispatchEvent(x),d=!1}a.removeEventListener("pointermove",y)};c.addEventListener("pointerup",m,{once:!0}),c.addEventListener("pointerupoutside",m,{once:!0})}};r.hooks.init.tap(t.tag,function(){a.addEventListener("pointerdown",s)}),r.hooks.destroy.tap(t.tag,function(){a.removeEventListener("pointerdown",s)})},t.tag="Dragndrop",t}(),VI=function(t){st(e,t);function e(n){n===void 0&&(n={});var r=t.call(this)||this;return r.options=n,r.name="dragndrop",r}return e.prototype.init=function(){this.addRenderingPlugin(new Alt(G({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e.prototype.setOptions=function(n){Object.assign(this.plugins[0].dragndropPluginOptions,n)},e}(Qo),Clt="*",Ax=function(){function t(){this._events={}}return t.prototype.on=function(e,n,r){return this._events[e]||(this._events[e]=[]),this._events[e].push({callback:n,once:!!r}),this},t.prototype.once=function(e,n){return this.on(e,n,!0)},t.prototype.emit=function(e){for(var n=this,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];var o=this._events[e]||[],a=this._events[Clt]||[],s=function(l){for(var c=l.length,u=0;u<c;u++)if(l[u]){var f=l[u],d=f.callback,h=f.once;h&&(l.splice(u,1),l.length===0&&delete n._events[e],c--,u--),d.apply(n,r)}};s(o),s(a)},t.prototype.off=function(e,n){if(!e)this._events={};else if(!n)delete this._events[e];else{for(var r=this._events[e]||[],i=r.length,o=0;o<i;o++)r[o].callback===n&&(r.splice(o,1),i--,o--);r.length===0&&delete this._events[e]}return this},t.prototype.getEvents=function(){return this._events},t}();const Ut={BEFORE_RENDER:"beforerender",AFTER_RENDER:"afterrender",BEFORE_PAINT:"beforepaint",AFTER_PAINT:"afterpaint",BEFORE_CHANGE_DATA:"beforechangedata",AFTER_CHANGE_DATA:"afterchangedata",BEFORE_CLEAR:"beforeclear",AFTER_CLEAR:"afterclear",BEFORE_DESTROY:"beforedestroy",AFTER_DESTROY:"afterdestroy",BEFORE_CHANGE_SIZE:"beforechangesize",AFTER_CHANGE_SIZE:"afterchangesize",POINTER_TAP:"pointertap",POINTER_DOWN:"pointerdown",POINTER_UP:"pointerup",POINTER_OVER:"pointerover",POINTER_OUT:"pointerout",POINTER_MOVE:"pointermove",POINTER_ENTER:"pointerenter",POINTER_LEAVE:"pointerleave",POINTER_UPOUTSIDE:"pointerupoutside",DRAG_START:"dragstart",DRAG:"drag",DRAG_END:"dragend",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"DROP",CLICK:"click",DBLCLICK:"dblclick"},Tlt=[["legendCategory",[[["color","discrete"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","discrete"]],[["color","discrete"],["opacity","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"]],[["color","discrete"],["opacity","constant"],["size","constant"]],[["color","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"]],[["color","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["shape","discrete"]],[["color","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"]],[["color","discrete"],["opacity","constant"]],[["color","discrete"],["shape","constant"]],[["color","constant"],["shape","discrete"]],[["color","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"]],[["color","discrete"]]]],["legendContinuousSize",[[["color","continuous"],["opacity","continuous"],["size","continuous"]],[["color","constant"],["opacity","continuous"],["size","continuous"]],[["color","continuous"],["size","continuous"]],[["color","constant"],["size","continuous"]],[["size","continuous"],["opacity","continuous"]],[["size","continuous"]]]],["legendContinuousBlockSize",[[["color","distribution"],["opacity","distribution"],["size","distribution"]],[["color","distribution"],["size","distribution"]]]],["legendContinuousBlock",[[["color","distribution"],["opacity","continuous"]],[["color","distribution"]]]],["legendContinuous",[[["color","continuous"],["opacity","continuous"]],[["color","continuous"]],[["opacity","continuous"]]]]];var klt={}.toString,B0=function(t,e){return klt.call(t)==="[object "+e+"]"};const XI=function(t){return B0(t,"Function")},qI=function(t){return Array.isArray?Array.isArray(t):B0(t,"Array")},Llt=function(t){var e=typeof t;return t!==null&&e==="object"||e==="function"};function Nlt(t,e){if(t){var n;if(qI(t))for(var r=0,i=t.length;r<i&&(n=e(t[r],r),n!==!1);r++);else if(Llt(t)){for(var o in t)if(t.hasOwnProperty(o)&&(n=e(t[o],o),n===!1))break}}}var Ilt=function(t){return typeof t=="object"&&t!==null},KI=function(t){if(!Ilt(t)||!B0(t,"Object"))return!1;if(Object.getPrototypeOf(t)===null)return!0;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};const jlt=function(t){return B0(t,"String")};var Dlt=Object.values?function(t){return Object.values(t)}:function(t){var e=[];return Nlt(t,function(n,r){XI(t)&&r==="prototype"||e.push(n)}),e},$lt=function(t){return t===null},Flt=function(t){return t===void 0};const Rlt=function(t,e){if(!XI(t))throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=t.apply(this,r);return a.set(o,s),s};return n.cache=new Map,n};var Blt=5;function ZI(t,e,n,r){n=n||0,r=r||Blt;for(var i in e)if(e.hasOwnProperty(i)){var o=e[i];o!==null&&KI(o)?(KI(t[i])||(t[i]={}),n<r?ZI(t[i],o,n+1,r):t[i]=e[i]):qI(o)?(t[i]=[],t[i]=t[i].concat(o)):o!==void 0&&(t[i]=o)}}var z0=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)ZI(t,e[r]);return t};const Ql=function(t){return t};var Y0;Rlt(function(t,e){e===void 0&&(e={});var n=e.fontSize,r=e.fontFamily,i=e.fontWeight,o=e.fontStyle,a=e.fontVariant;return Y0||(Y0=document.createElement("canvas").getContext("2d")),Y0.font=[o,a,i,n+"px",r].join(" "),Y0.measureText(jlt(t)?t:"").width},function(t,e){return e===void 0&&(e={}),nm([t],Dlt(e)).join("")});function QI(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t?e.reduce(function(r,i){return function(o){return i(r(o))}},t):Ql}function JI(t){return t instanceof Float32Array||t instanceof Array}var t4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},e4=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};function zlt(t){return function(e){for(var n=[],r=0;r<e.length-1;r+=2){var i=[e[r],e[r+1]],o=t(i);n.push.apply(n,e4([],t4(o),!1))}return n}}function Ylt(t){return function(e){for(var n=[],r=0;r<e.length-1;r+=3){var i=[e[r],e[r+1],e[r+2]],o=t(i);n.push.apply(n,e4([],t4(o),!1))}return n}}function n4(t,e,n){for(;t<e;)t+=Math.PI*2;for(;t>n;)t-=Math.PI*2;return t}var Wlt=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Glt=function(t,e,n,r,i){var o=Wlt(t,2),a=o[0],s=o[1],l=ll();return Tz(l,[a,s])};function W0(t,...e){return e.reduce((n,r)=>i=>n(r(i)),t)}function Cx(t,e){return e-t?n=>(n-t)/(e-t):n=>.5}function Hlt(t,e){const n=e<t?e:t,r=t>e?t:e;return i=>Math.min(Math.max(n,i),r)}function Ult(t,e,n,r,i){let o=n||0,a=r||t.length;const s=i||(l=>l);for(;o<a;){const l=Math.floor((o+a)/2);s(t[l])>e?a=l:o=l+1}return o}const r4=Math.sqrt(50),i4=Math.sqrt(10),o4=Math.sqrt(2);function G0(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/Ce(10,i);return i>=0?(o>=r4?10:o>=i4?5:o>=o4?2:1)*Ce(10,i):-Ce(10,-i)/(o>=r4?10:o>=i4?5:o>=o4?2:1)}const Vlt=(t,e,n=5)=>{const r=[t,e];let i=0,o=r.length-1,a=r[i],s=r[o],l;return s<a&&([a,s]=[s,a],[i,o]=[o,i]),l=G0(a,s,n),l>0?(a=Math.floor(a/l)*l,s=Math.ceil(s/l)*l,l=G0(a,s,n)):l<0&&(a=Math.ceil(a*l)/l,s=Math.floor(s*l)/l,l=G0(a,s,n)),l>0?(r[i]=Math.floor(a/l)*l,r[o]=Math.ceil(s/l)*l):l<0&&(r[i]=Math.ceil(a*l)/l,r[o]=Math.floor(s*l)/l),r};function a4(t){return!Flt(t)&&!$lt(t)&&!Number.isNaN(t)}function Tx(t,e,n){let r=n;return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function Xlt(t){const e=t[0]/360,n=t[1]/100,r=t[2]/100,i=t[3];if(n===0)return[r*255,r*255,r*255,i];const o=r<.5?r*(1+n):r+n-r*n,a=2*r-o,s=Tx(a,o,e+1/3),l=Tx(a,o,e),c=Tx(a,o,e-1/3);return[s*255,l*255,c*255,i]}function s4(t){const e=Sm.get(t);if(!e)return null;const{model:n,value:r}=e;return n==="rgb"?r:n==="hsl"?Xlt(r):null}const H0=(t,e)=>n=>t*(1-n)+e*n,qlt=(t,e)=>{const n=s4(t),r=s4(e);return n===null||r===null?n?()=>t:()=>e:i=>{const o=new Array(4);for(let u=0;u<4;u+=1){const f=n[u],d=r[u];o[u]=f*(1-i)+d*i}const[a,s,l,c]=o;return`rgba(${Math.round(a)}, ${Math.round(s)}, ${Math.round(l)}, ${c})`}},Klt=(t,e)=>typeof t=="number"&&typeof e=="number"?H0(t,e):typeof t=="string"&&typeof e=="string"?qlt(t,e):()=>t,Zlt=(t,e)=>{const n=H0(t,e);return r=>Math.round(n(r))};function l4({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Qlt({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function Jlt({map:t,initKey:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function tct(t){return typeof t=="object"?t.valueOf():t}class c4 extends Map{constructor(e){if(super(),this.map=new Map,this.initKey=tct,e!==null)for(const[n,r]of e)this.set(n,r)}get(e){return super.get(l4({map:this.map,initKey:this.initKey},e))}has(e){return super.has(l4({map:this.map,initKey:this.initKey},e))}set(e,n){return super.set(Qlt({map:this.map,initKey:this.initKey},e),n)}delete(e){return super.delete(Jlt({map:this.map,initKey:this.initKey},e))}}let u4=class{constructor(e){this.options=z0({},this.getDefaultOptions()),this.update(e)}getOptions(){return this.options}update(e={}){this.options=z0({},this.options,e),this.rescale(e)}rescale(e){}};const U0=Symbol("defaultUnknown");function f4(t,e,n){for(let r=0;r<e.length;r+=1)t.has(e[r])||t.set(n(e[r]),r)}function d4(t){const{value:e,from:n,to:r,mapper:i,notFoundReturn:o}=t;let a=i.get(e);if(a===void 0){if(o!==U0)return o;a=n.push(e)-1,i.set(e,a)}return r[a%r.length]}function h4(t){return t instanceof Date?e=>`${e}`:typeof t=="object"?e=>JSON.stringify(e):e=>e}class kx extends u4{getDefaultOptions(){return{domain:[],range:[],unknown:U0}}constructor(e){super(e)}map(e){return this.domainIndexMap.size===0&&f4(this.domainIndexMap,this.getDomain(),this.domainKey),d4({value:this.domainKey(e),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(e){return this.rangeIndexMap.size===0&&f4(this.rangeIndexMap,this.getRange(),this.rangeKey),d4({value:this.rangeKey(e),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(e){const[n]=this.options.domain,[r]=this.options.range;if(this.domainKey=h4(n),this.rangeKey=h4(r),!this.rangeIndexMap){this.rangeIndexMap=new Map,this.domainIndexMap=new Map;return}(!e||e.range)&&this.rangeIndexMap.clear(),(!e||e.domain||e.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new kx(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:e,compare:n}=this.options;return this.sortedDomain=n?[...e].sort(n):e,this.sortedDomain}}function ect(t){const e=Math.min(...t);return t.map(n=>n/e)}function nct(t,e){const n=t.length,r=e-n;return r>0?[...t,...new Array(r).fill(1)]:r<0?t.slice(0,e):t}function rct(t){return Math.round(t*1e12)/1e12}function ict(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:o,round:a,align:s}=t,l=e.length,c=nct(o,l),[u,f]=n,d=f-u,h=2/l*r+1-1/l*i,p=d/h,v=p*i/l,g=p-l*v,y=ect(c),m=y.reduce((C,A)=>C+A),b=g/m,x=new c4(e.map((C,A)=>{const T=y[A]*b;return[C,a?Math.floor(T):T]})),w=new c4(e.map((C,A)=>{const k=y[A]*b+v;return[C,a?Math.floor(k):k]})),O=Array.from(w.values()).reduce((C,A)=>C+A),S=(d-(O-O/l*i))*s,E=u+S;let M=a?Math.round(E):E;const P=new Array(l);for(let C=0;C<l;C+=1){P[C]=rct(M);const A=e[C];M+=w.get(A)}return{valueBandWidth:x,valueStep:w,adjustedRange:P}}function oct(t){var e;const{domain:n}=t,r=n.length;if(r===0)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(!!(!((e=t.flex)===null||e===void 0)&&e.length))return ict(t);const{range:o,paddingOuter:a,paddingInner:s,round:l,align:c}=t;let u,f,d=o[0];const p=o[1]-d,v=a*2,g=r-s;u=p/Math.max(1,v+g),l&&(u=Math.floor(u)),d+=(p-u*(r-s))*c,f=u*(1-s),l&&(d=Math.round(d),f=Math.round(f));const y=new Array(r).fill(0).map((m,b)=>d+b*u);return{valueStep:u,valueBandWidth:f,adjustedRange:y}}class Lx extends kx{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:U0,flex:[]}}constructor(e){super(e)}clone(){return new Lx(this.options)}getStep(e){return this.valueStep===void 0?1:typeof this.valueStep=="number"?this.valueStep:e===void 0?Array.from(this.valueStep.values())[0]:this.valueStep.get(e)}getBandWidth(e){return this.valueBandWidth===void 0?1:typeof this.valueBandWidth=="number"?this.valueBandWidth:e===void 0?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(e)}getRange(){return this.adjustedRange}getPaddingInner(){const{padding:e,paddingInner:n}=this.options;return e>0?e:n}getPaddingOuter(){const{padding:e,paddingOuter:n}=this.options;return e>0?e:n}rescale(){super.rescale();const{align:e,domain:n,range:r,round:i,flex:o}=this.options,{adjustedRange:a,valueBandWidth:s,valueStep:l}=oct({align:e,range:r,round:i,flex:o,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:n});this.valueStep=l,this.valueBandWidth=s,this.adjustedRange=a}}const act=(t,e,n)=>{let r,i,o=t,a=e;if(o===a&&n>0)return[o];let s=G0(o,a,n);if(s===0||!Number.isFinite(s))return[];if(s>0){o=Math.ceil(o/s),a=Math.floor(a/s),i=new Array(r=Math.ceil(a-o+1));for(let l=0;l<r;l+=1)i[l]=(o+l)*s}else{s=-s,o=Math.ceil(o*s),a=Math.floor(a*s),i=new Array(r=Math.ceil(a-o+1));for(let l=0;l<r;l+=1)i[l]=(o+l)/s}return i},sct=(t,e,n)=>{const[r,i]=t,[o,a]=e;let s,l;return r<i?(s=Cx(r,i),l=n(o,a)):(s=Cx(i,r),l=n(a,o)),W0(l,s)},lct=(t,e,n)=>{const r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=t[0]>t[r],s=a?[...t].reverse():t,l=a?[...e].reverse():e;for(let c=0;c<r;c+=1)i[c]=Cx(s[c],s[c+1]),o[c]=n(l[c],l[c+1]);return c=>{const u=Ult(t,c,1,r)-1,f=i[u],d=o[u];return W0(d,f)(c)}},p4=(t,e,n,r)=>(Math.min(t.length,e.length)>2?lct:sct)(t,e,r?Zlt:n);class cct extends u4{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:H0,tickCount:5}}map(e){return a4(e)?this.output(e):this.options.unknown}invert(e){return a4(e)?this.input(e):this.options.unknown}nice(){if(!this.options.nice)return;const[e,n,r,...i]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(e,n,r,...i)}getTicks(){const{tickMethod:e}=this.options,[n,r,i,...o]=this.getTickMethodOptions();return e(n,r,i,...o)}getTickMethodOptions(){const{domain:e,tickCount:n}=this.options,r=e[0],i=e[e.length-1];return[r,i,n]}chooseNice(){return Vlt}rescale(){this.nice();const[e,n]=this.chooseTransforms();this.composeOutput(e,this.chooseClamp(e)),this.composeInput(e,n,this.chooseClamp(n))}chooseClamp(e){const{clamp:n,range:r}=this.options,i=this.options.domain.map(e),o=Math.min(i.length,r.length);return n?Hlt(i[0],i[o-1]):Ql}composeOutput(e,n){const{domain:r,range:i,round:o,interpolate:a}=this.options,s=p4(r.map(e),i,a,o);this.output=W0(s,n,e)}composeInput(e,n,r){const{domain:i,range:o}=this.options,a=p4(o,i.map(e),H0);this.input=W0(n,r,a)}}class Bn extends cct{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:Klt,tickMethod:act,tickCount:5}}chooseTransforms(){return[Ql,Ql]}clone(){return new Bn(this.options)}}class Nx extends Lx{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:U0,paddingInner:1,paddingOuter:0}}constructor(e){super(e)}getPaddingInner(){return 1}clone(){return new Nx(this.options)}update(e){super.update(e)}getPaddingOuter(){return this.options.padding}}var v4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},uct=function(t,e,n,r,i){var o=new Bn({range:[e,e+r]}),a=new Bn({range:[n,n+i]});return{transform:function(s){var l=v4(s,2),c=l[0],u=l[1];return[o.map(c),a.map(u)]},untransform:function(s){var l=v4(s,2),c=l[0],u=l[1];return[o.invert(c),a.invert(u)]}}},fct=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},dct=function(t,e,n,r,i){var o=fct(t,1),a=o[0];return a(e,n,r,i)},hct=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},pct=function(t,e,n,r,i){var o=hct(t,1),a=o[0];return a},Ix=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},vct=function(t,e,n,r,i){var o=Ix(t,4),a=o[0],s=o[1],l=o[2],c=o[3],u=new Bn({range:[l,c]}),f=new Bn({range:[a,s]}),d=i/r,h=d>1?1:d,p=d>1?1/d:1;return{transform:function(v){var g=Ix(v,2),y=g[0],m=g[1],b=f.map(y),x=u.map(m),w=x*Math.cos(b)*h,O=x*Math.sin(b)*p,_=w*.5+.5,S=O*.5+.5;return[_,S]},untransform:function(v){var g=Ix(v,2),y=g[0],m=g[1],b=(y-.5)*2/h,x=(m-.5)*2/p,w=Math.sqrt(Math.pow(b,2)+Math.pow(x,2)),O=Math.atan2(x,b),_=n4(O,a,s),S=f.invert(_),E=u.invert(w);return[S,E]}}},g4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},gct=function(t,e,n,r,i){return{transform:function(o){var a=g4(o,2),s=a[0],l=a[1];return[l,s]},untransform:function(o){var a=g4(o,2),s=a[0],l=a[1];return[l,s]}}},yct=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},V0=function(t,e,n,r,i){var o=yct(t,2),a=o[0],s=o[1],l=ll();return Lz(l,[a,s])},jx=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Dx=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},mct=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return V0.apply(void 0,Dx([[-1,-1]],jx(e),!1))},bct=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return V0.apply(void 0,Dx([[-1,1]],jx(e),!1))},xct=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return V0.apply(void 0,Dx([[1,-1]],jx(e),!1))},wct=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Oct=function(t,e,n,r,i){var o=wct(t,1),a=o[0],s=ll();return kz(s,a)},$x=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},_ct=function(t,e,n,r,i){var o=$x(t,4),a=o[0],s=o[1],l=o[2],c=o[3],u=(s-0)/(2*Math.PI)+1,f=(c-l)/u,d=f/(Math.PI*2),h=new Bn({range:[l,l+f*.99]}),p=new Bn({range:[a,s]}),v=i/r,g=v>1?1:v,y=v>1?1/v:1;return{transform:function(m){var b=$x(m,2),x=b[0],w=b[1],O=p.map(x),_=h.map(w),S=Math.cos(O)*(d*O+_)*g,E=Math.sin(O)*(d*O+_)*y,M=S*.5+.5,P=E*.5+.5;return[M,P]},untransform:function(m){var b=$x(m,2),x=b[0],w=b[1],O=(x-.5)*2/g,_=(w-.5)*2/y,S=Math.sqrt(Math.pow(O,2)+Math.pow(_,2)),E=Math.atan2(_,O)+Math.floor(S/f)*Math.PI*2,M=n4(E,a,s),P=S-d*M,C=p.invert(M),A=h.invert(P);return[C,A]}}},Sct=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Ect=function(t,e,n,r,i){var o=Sct(t,4),a=o[0],s=o[1],l=o[2],c=o[3],u=new Bn({range:[l,c]});return{transform:function(f){for(var d=[],h=f.length,p=new Nx({domain:new Array(h).fill(0).map(function(b,x){return x}),range:[a,s]}),v=0;v<h;v++){var g=f[v],y=p.map(v),m=u.map(g);d.push(y,m)}return d},untransform:function(f){for(var d=[],h=0;h<f.length;h+=2){var p=f[h+1];d.push(u.invert(p))}return d}}},Jl=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function y4(t){return 1/Math.tan(t)}var Mct=function(t,e,n,r,i){var o=Jl(t,1),a=o[0],s=y4(a);return{transform:function(l){var c=Jl(l,2),u=c[0],f=c[1],d=u+f*s;return[d,f]},untransform:function(l){var c=Jl(l,2),u=c[0],f=c[1],d=u-f*s;return[d,f]}}},Pct=function(t,e,n,r,i){var o=Jl(t,1),a=o[0],s=y4(a);return{transform:function(l){var c=Jl(l,2),u=c[0],f=c[1],d=f+u*s;return[u,d]},untransform:function(l){var c=Jl(l,2),u=c[0],f=c[1],d=f-u*s;return[u,d]}}},Gr=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function If(t,e,n,r,i){var o=t<e,a=(o?e-r:i-e)||i-r,s=o?-1:1;return s*a*(n+1)/(n+a/((t-e)*s))+e}function jf(t,e,n,r,i){var o=t<e,a=(o?e-r:i-e)||i-r,s=o?-1:1;return a/(a*(n+1)/(t-e)-n*s)+e}function X0(t,e,n){if(!n)return t;var r=new Bn({range:[0,1],domain:[0,e]});return r.map(t)}var Act=function(t,e,n,r,i){var o=Gr(t,3),a=o[0],s=o[1],l=o[2],c=l===void 0?!1:l,u=X0(a,r,c);return{transform:function(f){var d=Gr(f,2),h=d[0],p=d[1],v=If(h,u,s,0,1);return[v,p]},untransform:function(f){var d=Gr(f,2),h=d[0],p=d[1],v=jf(h,u,s,0,1);return[v,p]}}},Cct=function(t,e,n,r,i){var o=Gr(t,3),a=o[0],s=o[1],l=o[2],c=l===void 0?!1:l,u=X0(a,i,c);return{transform:function(f){var d=Gr(f,2),h=d[0],p=d[1],v=If(p,u,s,0,1);return[h,v]},untransform:function(f){var d=Gr(f,2),h=d[0],p=d[1],v=jf(p,u,s,0,1);return[h,v]}}},Tct=function(t,e,n,r,i){var o=Gr(t,5),a=o[0],s=o[1],l=o[2],c=o[3],u=o[4],f=u===void 0?!1:u,d=X0(a,r,f),h=X0(s,i,f);return{transform:function(p){var v=Gr(p,2),g=v[0],y=v[1],m=If(g,d,l,0,1),b=If(y,h,c,0,1);return[m,b]},untransform:function(p){var v=Gr(p,2),g=v[0],y=v[1],m=jf(g,d,l,0,1),b=jf(y,h,c,0,1);return[m,b]}}},kct=function(t,e,n,r,i){var o=Gr(t,5),a=o[0],s=o[1],l=o[2],c=o[3],u=o[4],f=u===void 0?!1:u,d=new Bn({range:[0,r]}),h=new Bn({range:[0,i]}),p=f?a:d.map(a),v=f?s:h.map(s);return{transform:function(g){var y=Gr(g,2),m=y[0],b=y[1],x=d.map(m)-p,w=h.map(b)-v,O=Math.sqrt(x*x+w*w);if(O>l)return[m,b];var _=If(O,0,c,0,l),S=Math.atan2(w,x),E=p+_*Math.cos(S),M=v+_*Math.sin(S);return[d.invert(E),h.invert(M)]},untransform:function(g){var y=Gr(g,2),m=y[0],b=y[1],x=d.map(m)-p,w=h.map(b)-v,O=Math.sqrt(x*x+w*w);if(O>l)return[m,b];var _=jf(O,0,c,0,l),S=Math.atan2(w,x),E=p+_*Math.cos(S),M=v+_*Math.sin(S);return[d.invert(E),h.invert(M)]}}},m4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Lct=function(t,e,n,r,i,o,a){var s=new Bn({range:[e,e+i]}),l=new Bn({range:[n,n+o]}),c=new Bn({range:[r,r+a]});return{transform:function(u){var f=m4(u,3),d=f[0],h=f[1],p=f[2];return[s.map(d),l.map(h),c.map(p)]},untransform:function(u){var f=m4(u,3),d=f[0],h=f[1],p=f[2];return[s.invert(d),l.invert(h),c.invert(p)]}}},Nct=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Ict=function(t,e,n,r,i,o,a){var s=Nct(t,3),l=s[0],c=s[1],u=s[2];return Vy(Kt(),[l,c,u])},b4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},jct=function(t,e,n,r,i,o,a){return{transform:function(s){var l=b4(s,3),c=l[0],u=l[1],f=l[2];return[u,c,f]},untransform:function(s){var l=b4(s,3),c=l[0],u=l[1],f=l[2];return[u,c,f]}}},Dct=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},$ct=function(t,e,n,r,i,o,a){var s=Dct(t,3),l=s[0],c=s[1],u=s[2];return Xy(Kt(),[l,c,u])},tc=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},ec=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Fct=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Rct=function(){function t(e){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:uct,translate:Glt,custom:dct,matrix:pct,polar:vct,transpose:gct,scale:V0,"shear.x":Mct,"shear.y":Pct,reflect:mct,"reflect.x":bct,"reflect.y":xct,rotate:Oct,helix:_ct,parallel:Ect,fisheye:Tct,"fisheye.x":Act,"fisheye.y":Cct,"fisheye.circular":kct},this.update(e)}return t.prototype.update=function(e){this.options=z0({},this.options,e),this.recoordinate()},t.prototype.clone=function(){return new t(this.options)},t.prototype.getOptions=function(){return this.options},t.prototype.clear=function(){this.update({transformations:[]})},t.prototype.getSize=function(){var e=this.options,n=e.width,r=e.height;return[n,r]},t.prototype.getCenter=function(){var e=this.options,n=e.x,r=e.y,i=e.width,o=e.height;return[(n*2+i)/2,(r*2+o)/2]},t.prototype.transform=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=this.options.transformations;return this.update({transformations:ec(ec([],tc(r),!1),[ec([],tc(e),!1)],!1)}),this},t.prototype.map=function(e){return this.output(e)},t.prototype.invert=function(e){return this.input(e)},t.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},t.prototype.compose=function(e){var n,r;e===void 0&&(e=!1);var i=e?ec([],tc(this.options.transformations),!1).reverse():this.options.transformations,o=e?function(_){return _.untransform}:function(_){return _.transform},a=[],s=[],l=function(_,S){return S===void 0&&(S=!0),s.push(S?zlt(_):_)};try{for(var c=Fct(i),u=c.next();!u.done;u=c.next()){var f=tc(u.value),d=f[0],h=f.slice(1),p=this.transformers[d];if(p){var v=this.options,g=v.x,y=v.y,m=v.width,b=v.height,x=p(ec([],tc(h),!1),g,y,m,b);if(JI(x))a.push(x);else{if(a.length){var w=this.createMatrixTransform(a,e);l(w),a.splice(0,a.length)}var O=o(x)||Ql;l(O,d!=="parallel")}}}}catch(_){n={error:_}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}if(a.length){var O=this.createMatrixTransform(a,e);l(O)}return QI.apply(void 0,ec([],tc(s),!1))},t.prototype.createMatrixTransform=function(e,n){var r=ll();return n&&e.reverse(),e.forEach(function(i){return Nz(r,r,i)}),n&&Az(r,Mz(r)),function(i){var o=[i[0],i[1],1];return IE(o,o,r),[o[0],o[1]]}},t}(),nc=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},rc=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Bct=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},zct=function(){function t(e){this.options={x:0,y:0,z:0,width:300,height:150,depth:150,transformations:[]},this.transformers={cartesian3D:Lct,translate3D:Ict,scale3D:$ct,transpose3D:jct},this.update(e)}return t.prototype.update=function(e){this.options=z0({},this.options,e),this.recoordinate()},t.prototype.clone=function(){return new t(this.options)},t.prototype.getOptions=function(){return this.options},t.prototype.clear=function(){this.update({transformations:[]})},t.prototype.getSize=function(){var e=this.options,n=e.width,r=e.height,i=e.depth;return[n,r,i]},t.prototype.getCenter=function(){var e=this.options,n=e.x,r=e.y,i=e.z,o=e.width,a=e.height,s=e.depth;return[(n*2+o)/2,(r*2+a)/2,(i*2+s)/2]},t.prototype.transform=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=this.options.transformations;return this.update({transformations:rc(rc([],nc(r),!1),[rc([],nc(e),!1)],!1)}),this},t.prototype.map=function(e){return this.output(e)},t.prototype.invert=function(e){return this.input(e)},t.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},t.prototype.compose=function(e){var n,r;e===void 0&&(e=!1);var i=e?rc([],nc(this.options.transformations),!1).reverse():this.options.transformations,o=e?function(E){return E.untransform}:function(E){return E.transform},a=[],s=[],l=function(E,M){return M===void 0&&(M=!0),s.push(M?Ylt(E):E)};try{for(var c=Bct(i),u=c.next();!u.done;u=c.next()){var f=nc(u.value),d=f[0],h=f.slice(1),p=this.transformers[d];if(p){var v=this.options,g=v.x,y=v.y,m=v.z,b=v.width,x=v.height,w=v.depth,O=p(rc([],nc(h),!1),g,y,m,b,x,w);if(JI(O))a.push(O);else{if(a.length){var _=this.createMatrixTransform(a,e);l(_),a.splice(0,a.length)}var S=o(O)||Ql;l(S,!0)}}}}catch(E){n={error:E}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}if(a.length){var S=this.createMatrixTransform(a,e);l(S)}return QI.apply(void 0,rc([],nc(s),!1))},t.prototype.createMatrixTransform=function(e,n){var r=Kt();return n&&e.reverse(),e.forEach(function(i){return LE(r,r,i)}),n&&oi(r,Hy(r)),function(i){var o=[i[0],i[1],i[2],1];return dl(o,o,r),[o[0],o[1],o[2]]}},t}(),Yct=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function ic(t){return(e,...n)=>Z({},t(e,...n),e)}function oc(t){return(e,...n)=>Z({},e,t(e,...n))}function Fx(t,e){if(!t)return e;if(Array.isArray(t))return t;const{value:n=e}=t,r=Yct(t,["value"]);return Object.assign(Object.assign({},r),{value:n})}var Wct=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const x4=()=>t=>{const{children:e}=t;if(!Array.isArray(e))return[];const{x:n=0,y:r=0,width:i,height:o,data:a}=t;return e.map(s=>{var{data:l,x:c,y:u,width:f,height:d}=s,h=Wct(s,["data","x","y","width","height"]);return Object.assign(Object.assign({},h),{data:Fx(l,a),x:c!=null?c:n,y:u!=null?u:r,width:f!=null?f:i,height:d!=null?d:o})})};x4.props={};var Gct=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const w4=()=>t=>{const{children:e}=t;if(!Array.isArray(e))return[];const{direction:n="row",ratio:r=e.map(()=>1),padding:i=0,data:o}=t,[a,s,l,c]=n==="col"?["y","height","width","x"]:["x","width","height","y"],u=r.reduce((v,g)=>v+g),f=t[s]-i*(e.length-1),d=r.map(v=>f*(v/u)),h=[];let p=t[a]||0;for(let v=0;v<d.length;v+=1){const g=e[v],{data:y}=g,m=Gct(g,["data"]),b=Fx(y,o);h.push(Object.assign({[a]:p,[s]:d[v],[c]:t[c]||0,[l]:t[l],data:b},m)),p+=d[v]+i}return h};w4.props={};var Rx=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const O4=()=>t=>{const{children:e}=t,n=Rx(t,["children"]);if(!Array.isArray(e))return[];const{data:r,scale:i={},axis:o={},legend:a={},encode:s={},transform:l=[]}=n,c=Rx(n,["data","scale","axis","legend","encode","transform"]),u=e.map(f=>{var{data:d,scale:h={},axis:p={},legend:v={},encode:g={},transform:y=[]}=f,m=Rx(f,["data","scale","axis","legend","encode","transform"]);return Object.assign({data:Fx(d,r),scale:Z({},i,h),encode:Z({},s,g),transform:[...l,...y],axis:p&&o?Z({},o,p):!1,legend:v&&a?Z({},a,v):!1},m)});return[Object.assign(Object.assign({},c),{marks:u,type:"standardView"})]};O4.props={};var Hct=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const _4=({static:t=!1}={})=>e=>{const{width:n,height:r,depth:i,paddingLeft:o,paddingRight:a,paddingTop:s,paddingBottom:l,padding:c,inset:u,insetLeft:f,insetTop:d,insetRight:h,insetBottom:p,margin:v,marginLeft:g,marginBottom:y,marginTop:m,marginRight:b,data:x,coordinate:w,theme:O,component:_,interaction:S,x:E,y:M,z:P,key:C,frame:A,labelTransform:T,parentKey:k,clip:N,viewStyle:j,title:L}=e,I=Hct(e,["width","height","depth","paddingLeft","paddingRight","paddingTop","paddingBottom","padding","inset","insetLeft","insetTop","insetRight","insetBottom","margin","marginLeft","marginBottom","marginTop","marginRight","data","coordinate","theme","component","interaction","x","y","z","key","frame","labelTransform","parentKey","clip","viewStyle","title"]);return[Object.assign(Object.assign({type:"standardView",x:E,y:M,z:P,key:C,width:n,height:r,depth:i,padding:c,paddingLeft:o,paddingRight:a,paddingTop:s,inset:u,insetLeft:f,insetTop:d,insetRight:h,insetBottom:p,paddingBottom:l,theme:O,coordinate:w,component:_,interaction:S,frame:A,labelTransform:T,margin:v,marginLeft:g,marginBottom:y,marginTop:m,marginRight:b,parentKey:k,clip:N,style:j},!t&&{title:L}),{marks:[Object.assign(Object.assign(Object.assign({},I),{key:`${C}-0`,data:x}),t&&{title:L})]})]};_4.props={};class Df{constructor(e){this.$value=e}static of(e){return new Df(e)}call(e,...n){return this.$value=e(this.$value,...n),this}value(){return this.$value}}var Uct=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const Vct=ic(t=>{const{encode:e,data:n,scale:r,shareSize:i=!1}=t,{x:o,y:a}=e,s=(l,c)=>{var u;if(l===void 0||!i)return{};const f=xe(n,p=>p[l]),d=((u=r==null?void 0:r[c])===null||u===void 0?void 0:u.domain)||Array.from(f.keys()),h=d.map(p=>f.has(p)?f.get(p).length:1);return{domain:d,flex:h}};return{scale:{x:Object.assign(Object.assign({paddingOuter:0,paddingInner:.1,guide:o===void 0?null:{position:"top"}},o===void 0&&{paddingInner:0}),s(o,"x")),y:Object.assign(Object.assign({range:[0,1],paddingOuter:0,paddingInner:.1,guide:a===void 0?null:{position:"right"}},a===void 0&&{paddingInner:0}),s(a,"y"))}}}),Bx=ic(t=>{const{data:e,scale:n}=t,r=[t];let i,o,a;for(;r.length;){const f=r.shift(),{children:d,encode:h={},scale:p={},legend:v={}}=f,{color:g}=h,{color:y}=p,{color:m}=v;g!==void 0&&(i=g),y!==void 0&&(o=y),m!==void 0&&(a=m),Array.isArray(d)&&r.push(...d)}const s=()=>{var f;const d=(f=n==null?void 0:n.color)===null||f===void 0?void 0:f.domain;if(d!==void 0)return[d];if(i===void 0)return[void 0];const h=typeof i=="function"?i:v=>v[i],p=e.map(h);return p.some(v=>typeof v=="number")?[no(p)]:[Array.from(new Set(p)),"ordinal"]},l=typeof i=="string"?i:"",[c,u]=s();return{encode:{color:i},scale:{color:Z({},o,{domain:c,type:u})},legend:{color:Z({title:l},a)}}}),zx=ic(()=>({animate:{enterType:"fadeIn"}})),Yx=oc(()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}})),Wx=oc(()=>({type:"cell"})),S4=oc(t=>{const{data:e}=t;return{data:{type:"inline",value:e,transform:[{type:"custom",callback:()=>{const{data:r,encode:i}=t,{x:o,y:a}=i,s=o?Array.from(new Set(r.map(u=>u[o]))):[],l=a?Array.from(new Set(r.map(u=>u[a]))):[];return(()=>{if(s.length&&l.length){const u=[];for(const f of s)for(const d of l)u.push({[o]:f,[a]:d});return u}if(s.length)return s.map(u=>({[o]:u}));if(l.length)return l.map(u=>({[a]:u}))})()}}]}}}),E4=oc((t,e=Xct,n=qct,r=Kct,i={})=>{const{data:o,encode:a,children:s,scale:l,x:c=0,y:u=0,shareData:f=!1,key:d}=t,{value:h}=o,{x:p,y:v}=a,{color:g}=l,{domain:y}=g;return{children:(b,x,w)=>{const{x:O,y:_}=x,{paddingLeft:S,paddingTop:E,marginLeft:M,marginTop:P}=w,{domain:C}=O.getOptions(),{domain:A}=_.getOptions(),T=Ja(b),k=b.map(e),N=b.map(({x:R,y:B})=>[O.invert(R),_.invert(B)]),L=N.map(([R,B])=>W=>{const{[p]:K,[v]:J}=W;return(p!==void 0?K===R:!0)&&(v!==void 0?J===B:!0)}).map(R=>h.filter(R)),I=f?Gt(L,R=>R.length):void 0,$=N.map(([R,B])=>({columnField:p,columnIndex:C.indexOf(R),columnValue:R,columnValuesLength:C.length,rowField:v,rowIndex:A.indexOf(B),rowValue:B,rowValuesLength:A.length})),F=$.map(R=>Array.isArray(s)?s:[s(R)].flat(1));return T.flatMap(R=>{const[B,W,K,J]=k[R],X=$[R],V=L[R];return F[R].map(nt=>{var lt,yt,{scale:pt,key:mt,facet:Nt=!0,axis:Yt={},legend:me={}}=nt,We=Uct(nt,["scale","key","facet","axis","legend"]);const lr=((lt=pt==null?void 0:pt.y)===null||lt===void 0?void 0:lt.guide)||Yt.y,$o=((yt=pt==null?void 0:pt.x)===null||yt===void 0?void 0:yt.guide)||Yt.x,rl={x:{tickCount:p?5:void 0},y:{tickCount:v?5:void 0}},Hn=Nt?V:V.length===0?[]:h,ei={color:{domain:y}},$t={x:M4($o,n)(X,Hn),y:M4(lr,r)(X,Hn)};return Object.assign(Object.assign({key:`${mt}-${R}`,data:Hn,margin:0,x:B+S+c+M,y:W+E+u+P,parentKey:d,width:K,height:J,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!!Hn.length,dataDomain:I,scale:Z(rl,pt,ei),axis:Z({},Yt,$t),legend:!1},We),i)})})}}});function Xct(t){const{points:e}=t;return Lm(e)}function q0(t,e){return e.length?Z({title:!1,tick:null,label:null},t):Z({title:!1,tick:null,label:null,grid:null},t)}function qct(t){return(e,n)=>{const{rowIndex:r,rowValuesLength:i,columnIndex:o,columnValuesLength:a}=e;if(r!==i-1)return q0(t,n);const s=o!==a-1?!1:void 0,l=n.length?void 0:null;return Z({title:s,grid:l},t)}}function Kct(t){return(e,n)=>{const{rowIndex:r,columnIndex:i}=e;if(i!==0)return q0(t,n);const o=r!==0?!1:void 0,a=n.length?void 0:null;return Z({title:o,grid:a},t)}}function M4(t,e){return typeof t=="function"?t:t===null||t===!1?()=>null:e(t)}const P4=()=>t=>[Df.of(t).call(Wx).call(Bx).call(zx).call(Vct).call(Yx).call(S4).call(E4).value()];P4.props={};var Gx=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const Zct=ic(t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}})),Qct=oc(t=>{const{data:e,children:n,x:r=0,y:i=0,key:o}=t;return{children:(s,l,c)=>{const{x:u,y:f}=l,{paddingLeft:d,paddingTop:h,marginLeft:p,marginTop:v}=c,{domain:g}=u.getOptions(),{domain:y}=f.getOptions(),m=Ja(s),b=s.map(({points:_})=>Lm(_)),x=s.map(({x:_,y:S})=>[u.invert(_),f.invert(S)]),w=x.map(([_,S])=>({columnField:_,columnIndex:g.indexOf(_),columnValue:_,columnValuesLength:g.length,rowField:S,rowIndex:y.indexOf(S),rowValue:S,rowValuesLength:y.length})),O=w.map(_=>Array.isArray(n)?n:[n(_)].flat(1));return m.flatMap(_=>{const[S,E,M,P]=b[_],[C,A]=x[_],T=w[_];return O[_].map(N=>{var j,L;const{scale:I,key:$,encode:F,axis:R,interaction:B}=N,W=Gx(N,["scale","key","encode","axis","interaction"]),K=(j=I==null?void 0:I.y)===null||j===void 0?void 0:j.guide,J=(L=I==null?void 0:I.x)===null||L===void 0?void 0:L.guide,X={x:{facet:!1},y:{facet:!1}},V={x:tut(J)(T,e),y:eut(K)(T,e)},it={x:{tickCount:5},y:{tickCount:5}};return Object.assign({data:e,parentKey:o,key:`${$}-${_}`,x:S+d+r+p,y:E+h+i+v,width:M,height:P,margin:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!0,scale:Z(X,I),axis:Z(it,R,V),legend:!1,encode:Z({},F,{x:C,y:A}),interaction:Z({},B,{legendFilter:!1})},W)})})}}}),Jct=oc(t=>{const{encode:e}=t,n=Gx(t,["encode"]),{position:r=[],x:i=r,y:o=[...r].reverse()}=e,a=Gx(e,["position","x","y"]),s=[];for(const l of[i].flat(1))for(const c of[o].flat(1))s.push({$x:l,$y:c});return Object.assign(Object.assign({},n),{data:s,encode:Object.assign(Object.assign({},a),{x:"$x",y:"$y"}),scale:Object.assign(Object.assign({},[i].flat(1).length===1&&{x:{paddingInner:0}}),[o].flat(1).length===1&&{y:{paddingInner:0}})})});function tut(t){return typeof t=="function"?t:t===null?()=>null:(e,n)=>{const{rowIndex:r,rowValuesLength:i}=e;if(r!==i-1)return q0(t,n)}}function eut(t){return typeof t=="function"?t:t===null?()=>null:(e,n)=>{const{columnIndex:r}=e;if(r!==0)return q0(t,n)}}const nut=()=>t=>[Df.of(t).call(Wx).call(Bx).call(Qct).call(Jct).call(zx).call(Yx).call(Zct).value()];var rut=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const iut=ic(t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}})),out=ic(t=>({coordinate:{type:"polar"}})),aut=t=>{const{encode:e}=t,n=rut(t,["encode"]),{position:r}=e;return Object.assign(Object.assign({},n),{encode:{x:r}})};function A4(t){return e=>null}function sut(t){const{points:e}=t,[n,r,i,o]=e,a=we(n,o),s=ke(n,o),l=ke(r,i),c=yP(s,l),u=1/Math.sin(c/2),f=a/(1+u),d=f*Math.sqrt(2),[h,p]=i,g=wl(s)+c/2,y=f*u,m=h+y*Math.sin(g),b=p-y*Math.cos(g);return[m-d/2,b-d/2,d,d]}const lut=()=>t=>[Df.of(t).call(Wx).call(aut).call(Bx).call(out).call(S4).call(E4,sut,A4,A4,{frame:!1}).call(zx).call(Yx).call(iut).value()];function cut(t,e,n){const i=n,o=[0,i],a=[-i+1,1];if(t==="normal")return o;if(t==="reverse")return a;if(t==="alternate")return e%2===0?o:a;if(t==="reverse-alternate")return e%2===0?a:o}function uut(t,e,n){const r=[t];for(;r.length;){const i=r.pop();i.animate=Z({enter:{duration:e},update:{duration:e,easing:n,type:"morphing",fill:"both"},exit:{type:"fadeOut",duration:e}},i.animate||{});const{children:o}=i;Array.isArray(o)&&r.push(...o)}return t}const C4=()=>t=>{const{children:e=[],duration:n=1e3,iterationCount:r=1,direction:i="normal",easing:o="ease-in-out-sine"}=t,a=e.length;if(!Array.isArray(e)||a===0)return[];const{key:s}=e[0],l=e.map(c=>Object.assign(Object.assign({},c),{key:s})).map(c=>uut(c,n,o));return function*(){let c=0,u;for(;r==="infinite"||c<r;){const[f,d]=cut(i,c,a);for(let h=f;h<d;h+=1){const p=Math.abs(h);u!==p&&(yield l[p]),u=p}c++}}};C4.props={};var fut=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const T4=()=>t=>{const{type:e,data:n,scale:r,encode:i,style:o,animate:a,key:s,state:l}=t,c=fut(t,["type","data","scale","encode","style","animate","key","state"]);return[Object.assign(Object.assign({type:"geoView"},c),{children:[{type:"geoPath",key:`${s}-0`,data:{value:n},scale:r,encode:i,style:o,animate:a,state:l}]})]};T4.props={};var bt=1e-6,k4=1e-12,Lt=Math.PI,ze=Lt/2,L4=Lt/4,xr=Lt*2,Pn=180/Lt,Ie=Lt/180,Bt=Math.abs,ac=Math.atan,bo=Math.atan2,Tt=Math.cos,K0=Math.ceil,N4=Math.exp,Z0=Math.log,Hx=Math.pow,Et=Math.sin,Hr=Math.sign||function(t){return t>0?1:t<0?-1:0},er=Math.sqrt,Ux=Math.tan;function I4(t){return t>1?0:t<-1?Lt:Math.acos(t)}function Ur(t){return t>1?ze:t<-1?-ze:Math.asin(t)}function Vr(){}function Q0(t,e){t&&D4.hasOwnProperty(t.type)&&D4[t.type](t,e)}var j4={Feature:function(t,e){Q0(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)Q0(n[r].geometry,e)}},D4={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){Vx(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Vx(n[r],e,0)},Polygon:function(t,e){$4(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)$4(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)Q0(n[r],e)}};function Vx(t,e,n){var r=-1,i=t.length-n,o;for(e.lineStart();++r<i;)o=t[r],e.point(o[0],o[1],o[2]);e.lineEnd()}function $4(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)Vx(t[n],e,1);e.polygonEnd()}function sc(t,e){t&&j4.hasOwnProperty(t.type)?j4[t.type](t,e):Q0(t,e)}function Xx(t){return[bo(t[1],t[0]),Ur(t[2])]}function lc(t){var e=t[0],n=t[1],r=Tt(n);return[r*Tt(e),r*Et(e),Et(n)]}function J0(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function tv(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function qx(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function ev(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Kx(t){var e=er(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Zx(t,e){function n(r,i){return r=t(r,i),e(r[0],r[1])}return t.invert&&e.invert&&(n.invert=function(r,i){return r=e.invert(r,i),r&&t.invert(r[0],r[1])}),n}function Qx(t,e){return Bt(t)>Lt&&(t-=Math.round(t/xr)*xr),[t,e]}Qx.invert=Qx;function F4(t,e,n){return(t%=xr)?e||n?Zx(B4(t),z4(e,n)):B4(t):e||n?z4(e,n):Qx}function R4(t){return function(e,n){return e+=t,Bt(e)>Lt&&(e-=Math.round(e/xr)*xr),[e,n]}}function B4(t){var e=R4(t);return e.invert=R4(-t),e}function z4(t,e){var n=Tt(t),r=Et(t),i=Tt(e),o=Et(e);function a(s,l){var c=Tt(l),u=Tt(s)*c,f=Et(s)*c,d=Et(l),h=d*n+u*r;return[bo(f*i-h*o,u*n-d*r),Ur(h*i+f*o)]}return a.invert=function(s,l){var c=Tt(l),u=Tt(s)*c,f=Et(s)*c,d=Et(l),h=d*i-f*o;return[bo(f*i+d*o,u*n+h*r),Ur(h*n-u*r)]},a}function dut(t){t=F4(t[0]*Ie,t[1]*Ie,t.length>2?t[2]*Ie:0);function e(n){return n=t(n[0]*Ie,n[1]*Ie),n[0]*=Pn,n[1]*=Pn,n}return e.invert=function(n){return n=t.invert(n[0]*Ie,n[1]*Ie),n[0]*=Pn,n[1]*=Pn,n},e}function hut(t,e,n,r,i,o){if(n){var a=Tt(e),s=Et(e),l=r*n;i==null?(i=e+r*xr,o=e-l/2):(i=Y4(a,i),o=Y4(a,o),(r>0?i<o:i>o)&&(i+=r*xr));for(var c,u=i;r>0?u>o:u<o;u-=l)c=Xx([a,-s*Tt(u),-s*Et(u)]),t.point(c[0],c[1])}}function Y4(t,e){e=lc(e),e[0]-=t,Kx(e);var n=I4(-e[1]);return((-e[2]<0?-n:n)+xr-bt)%xr}function W4(){var t=[],e;return{point:function(n,r,i){e.push([n,r,i])},lineStart:function(){t.push(e=[])},lineEnd:Vr,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function nv(t,e){return Bt(t[0]-e[0])<bt&&Bt(t[1]-e[1])<bt}function rv(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function G4(t,e,n,r,i){var o=[],a=[],s,l;if(t.forEach(function(p){if(!((v=p.length-1)<=0)){var v,g=p[0],y=p[v],m;if(nv(g,y)){if(!g[2]&&!y[2]){for(i.lineStart(),s=0;s<v;++s)i.point((g=p[s])[0],g[1]);i.lineEnd();return}y[0]+=2*bt}o.push(m=new rv(g,p,null,!0)),a.push(m.o=new rv(g,null,m,!1)),o.push(m=new rv(y,p,null,!1)),a.push(m.o=new rv(y,null,m,!0))}}),!!o.length){for(a.sort(e),H4(o),H4(a),s=0,l=a.length;s<l;++s)a[s].e=n=!n;for(var c=o[0],u,f;;){for(var d=c,h=!0;d.v;)if((d=d.n)===c)return;u=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(h)for(s=0,l=u.length;s<l;++s)i.point((f=u[s])[0],f[1]);else r(d.x,d.n.x,1,i);d=d.n}else{if(h)for(u=d.p.z,s=u.length-1;s>=0;--s)i.point((f=u[s])[0],f[1]);else r(d.x,d.p.x,-1,i);d=d.p}d=d.o,u=d.z,h=!h}while(!d.v);i.lineEnd()}}}function H4(t){if(e=t.length){for(var e,n=0,r=t[0],i;++n<e;)r.n=i=t[n],i.p=r,r=i;r.n=i=t[0],i.p=r}}function Jx(t){return Bt(t[0])<=Lt?t[0]:Hr(t[0])*((Bt(t[0])+Lt)%xr-Lt)}function put(t,e){var n=Jx(e),r=e[1],i=Et(r),o=[Et(n),-Tt(n),0],a=0,s=0,l=new Za;i===1?r=ze+bt:i===-1&&(r=-ze-bt);for(var c=0,u=t.length;c<u;++c)if(d=(f=t[c]).length)for(var f,d,h=f[d-1],p=Jx(h),v=h[1]/2+L4,g=Et(v),y=Tt(v),m=0;m<d;++m,p=x,g=O,y=_,h=b){var b=f[m],x=Jx(b),w=b[1]/2+L4,O=Et(w),_=Tt(w),S=x-p,E=S>=0?1:-1,M=E*S,P=M>Lt,C=g*O;if(l.add(bo(C*E*Et(M),y*_+C*Tt(M))),a+=P?S+E*xr:S,P^p>=n^x>=n){var A=tv(lc(h),lc(b));Kx(A);var T=tv(o,A);Kx(T);var k=(P^S>=0?-1:1)*Ur(T[2]);(r>k||r===k&&(A[0]||A[1]))&&(s+=P^S>=0?1:-1)}}return(a<-bt||a<bt&&l<-k4)^s&1}function U4(t,e,n,r){return function(i){var o=e(i),a=W4(),s=e(a),l=!1,c,u,f,d={point:h,lineStart:v,lineEnd:g,polygonStart:function(){d.point=y,d.lineStart=m,d.lineEnd=b,u=[],c=[]},polygonEnd:function(){d.point=h,d.lineStart=v,d.lineEnd=g,u=GE(u);var x=put(c,r);u.length?(l||(i.polygonStart(),l=!0),G4(u,gut,x,n,i)):x&&(l||(i.polygonStart(),l=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),l&&(i.polygonEnd(),l=!1),u=c=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function h(x,w){t(x,w)&&i.point(x,w)}function p(x,w){o.point(x,w)}function v(){d.point=p,o.lineStart()}function g(){d.point=h,o.lineEnd()}function y(x,w){f.push([x,w]),s.point(x,w)}function m(){s.lineStart(),f=[]}function b(){y(f[0][0],f[0][1]),s.lineEnd();var x=s.clean(),w=a.result(),O,_=w.length,S,E,M;if(f.pop(),c.push(f),f=null,!!_){if(x&1){if(E=w[0],(S=E.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),O=0;O<S;++O)i.point((M=E[O])[0],M[1]);i.lineEnd()}return}_>1&&x&2&&w.push(w.pop().concat(w.shift())),u.push(w.filter(vut))}}return d}}function vut(t){return t.length>1}function gut(t,e){return((t=t.x)[0]<0?t[1]-ze-bt:ze-t[1])-((e=e.x)[0]<0?e[1]-ze-bt:ze-e[1])}const V4=U4(function(){return!0},yut,but,[-Lt,-ze]);function yut(t){var e=NaN,n=NaN,r=NaN,i;return{lineStart:function(){t.lineStart(),i=1},point:function(o,a){var s=o>0?Lt:-Lt,l=Bt(o-e);Bt(l-Lt)<bt?(t.point(e,n=(n+a)/2>0?ze:-ze),t.point(r,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(o,n),i=0):r!==s&&l>=Lt&&(Bt(e-r)<bt&&(e-=r*bt),Bt(o-s)<bt&&(o-=s*bt),n=mut(e,n,o,a),t.point(r,n),t.lineEnd(),t.lineStart(),t.point(s,n),i=0),t.point(e=o,n=a),r=s},lineEnd:function(){t.lineEnd(),e=n=NaN},clean:function(){return 2-i}}}function mut(t,e,n,r){var i,o,a=Et(t-n);return Bt(a)>bt?ac((Et(e)*(o=Tt(r))*Et(n)-Et(r)*(i=Tt(e))*Et(t))/(i*o*a)):(e+r)/2}function but(t,e,n,r){var i;if(t==null)i=n*ze,r.point(-Lt,i),r.point(0,i),r.point(Lt,i),r.point(Lt,0),r.point(Lt,-i),r.point(0,-i),r.point(-Lt,-i),r.point(-Lt,0),r.point(-Lt,i);else if(Bt(t[0]-e[0])>bt){var o=t[0]<e[0]?Lt:-Lt;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])}function xut(t){var e=Tt(t),n=2*Ie,r=e>0,i=Bt(e)>bt;function o(u,f,d,h){hut(h,t,n,d,u,f)}function a(u,f){return Tt(u)*Tt(f)>e}function s(u){var f,d,h,p,v;return{lineStart:function(){p=h=!1,v=1},point:function(g,y){var m=[g,y],b,x=a(g,y),w=r?x?0:c(g,y):x?c(g+(g<0?Lt:-Lt),y):0;if(!f&&(p=h=x)&&u.lineStart(),x!==h&&(b=l(f,m),(!b||nv(f,b)||nv(m,b))&&(m[2]=1)),x!==h)v=0,x?(u.lineStart(),b=l(m,f),u.point(b[0],b[1])):(b=l(f,m),u.point(b[0],b[1],2),u.lineEnd()),f=b;else if(i&&f&&r^x){var O;!(w&d)&&(O=l(m,f,!0))&&(v=0,r?(u.lineStart(),u.point(O[0][0],O[0][1]),u.point(O[1][0],O[1][1]),u.lineEnd()):(u.point(O[1][0],O[1][1]),u.lineEnd(),u.lineStart(),u.point(O[0][0],O[0][1],3)))}x&&(!f||!nv(f,m))&&u.point(m[0],m[1]),f=m,h=x,d=w},lineEnd:function(){h&&u.lineEnd(),f=null},clean:function(){return v|(p&&h)<<1}}}function l(u,f,d){var h=lc(u),p=lc(f),v=[1,0,0],g=tv(h,p),y=J0(g,g),m=g[0],b=y-m*m;if(!b)return!d&&u;var x=e*y/b,w=-e*m/b,O=tv(v,g),_=ev(v,x),S=ev(g,w);qx(_,S);var E=O,M=J0(_,E),P=J0(E,E),C=M*M-P*(J0(_,_)-1);if(!(C<0)){var A=er(C),T=ev(E,(-M-A)/P);if(qx(T,_),T=Xx(T),!d)return T;var k=u[0],N=f[0],j=u[1],L=f[1],I;N<k&&(I=k,k=N,N=I);var $=N-k,F=Bt($-Lt)<bt,R=F||$<bt;if(!F&&L<j&&(I=j,j=L,L=I),R?F?j+L>0^T[1]<(Bt(T[0]-k)<bt?j:L):j<=T[1]&&T[1]<=L:$>Lt^(k<=T[0]&&T[0]<=N)){var B=ev(E,(-M+A)/P);return qx(B,_),[T,Xx(B)]}}}function c(u,f){var d=r?t:Lt-t,h=0;return u<-d?h|=1:u>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return U4(a,s,o,r?[0,-t]:[-Lt,t-Lt])}function wut(t,e,n,r,i,o){var a=t[0],s=t[1],l=e[0],c=e[1],u=0,f=1,d=l-a,h=c-s,p;if(p=n-a,!(!d&&p>0)){if(p/=d,d<0){if(p<u)return;p<f&&(f=p)}else if(d>0){if(p>f)return;p>u&&(u=p)}if(p=i-a,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>u&&(u=p)}else if(d>0){if(p<u)return;p<f&&(f=p)}if(p=r-s,!(!h&&p>0)){if(p/=h,h<0){if(p<u)return;p<f&&(f=p)}else if(h>0){if(p>f)return;p>u&&(u=p)}if(p=o-s,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>u&&(u=p)}else if(h>0){if(p<u)return;p<f&&(f=p)}return u>0&&(t[0]=a+u*d,t[1]=s+u*h),f<1&&(e[0]=a+f*d,e[1]=s+f*h),!0}}}}}var $f=1e9,iv=-$f;function X4(t,e,n,r){function i(c,u){return t<=c&&c<=n&&e<=u&&u<=r}function o(c,u,f,d){var h=0,p=0;if(c==null||(h=a(c,f))!==(p=a(u,f))||l(c,u)<0^f>0)do d.point(h===0||h===3?t:n,h>1?r:e);while((h=(h+f+4)%4)!==p);else d.point(u[0],u[1])}function a(c,u){return Bt(c[0]-t)<bt?u>0?0:3:Bt(c[0]-n)<bt?u>0?2:1:Bt(c[1]-e)<bt?u>0?1:0:u>0?3:2}function s(c,u){return l(c.x,u.x)}function l(c,u){var f=a(c,1),d=a(u,1);return f!==d?f-d:f===0?u[1]-c[1]:f===1?c[0]-u[0]:f===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,f=W4(),d,h,p,v,g,y,m,b,x,w,O,_={point:S,lineStart:C,lineEnd:A,polygonStart:M,polygonEnd:P};function S(k,N){i(k,N)&&u.point(k,N)}function E(){for(var k=0,N=0,j=h.length;N<j;++N)for(var L=h[N],I=1,$=L.length,F=L[0],R,B,W=F[0],K=F[1];I<$;++I)R=W,B=K,F=L[I],W=F[0],K=F[1],B<=r?K>r&&(W-R)*(r-B)>(K-B)*(t-R)&&++k:K<=r&&(W-R)*(r-B)<(K-B)*(t-R)&&--k;return k}function M(){u=f,d=[],h=[],O=!0}function P(){var k=E(),N=O&&k,j=(d=GE(d)).length;(N||j)&&(c.polygonStart(),N&&(c.lineStart(),o(null,null,1,c),c.lineEnd()),j&&G4(d,s,k,o,c),c.polygonEnd()),u=c,d=h=p=null}function C(){_.point=T,h&&h.push(p=[]),w=!0,x=!1,m=b=NaN}function A(){d&&(T(v,g),y&&x&&f.rejoin(),d.push(f.result())),_.point=S,x&&u.lineEnd()}function T(k,N){var j=i(k,N);if(h&&p.push([k,N]),w)v=k,g=N,y=j,w=!1,j&&(u.lineStart(),u.point(k,N));else if(j&&x)u.point(k,N);else{var L=[m=Math.max(iv,Math.min($f,m)),b=Math.max(iv,Math.min($f,b))],I=[k=Math.max(iv,Math.min($f,k)),N=Math.max(iv,Math.min($f,N))];wut(L,I,t,e,n,r)?(x||(u.lineStart(),u.point(L[0],L[1])),u.point(I[0],I[1]),j||u.lineEnd(),O=!1):j&&(u.lineStart(),u.point(k,N),O=!1)}m=k,b=N,x=j}return _}}function q4(t,e,n){var r=yl(t,e-bt,n).concat(e);return function(i){return r.map(function(o){return[i,o]})}}function K4(t,e,n){var r=yl(t,e-bt,n).concat(e);return function(i){return r.map(function(o){return[o,i]})}}function Out(){var t,e,n,r,i,o,a,s,l=10,c=l,u=90,f=360,d,h,p,v,g=2.5;function y(){return{type:"MultiLineString",coordinates:m()}}function m(){return yl(K0(r/u)*u,n,u).map(p).concat(yl(K0(s/f)*f,a,f).map(v)).concat(yl(K0(e/l)*l,t,l).filter(function(b){return Bt(b%u)>bt}).map(d)).concat(yl(K0(o/c)*c,i,c).filter(function(b){return Bt(b%f)>bt}).map(h))}return y.lines=function(){return m().map(function(b){return{type:"LineString",coordinates:b}})},y.outline=function(){return{type:"Polygon",coordinates:[p(r).concat(v(a).slice(1),p(n).reverse().slice(1),v(s).reverse().slice(1))]}},y.extent=function(b){return arguments.length?y.extentMajor(b).extentMinor(b):y.extentMinor()},y.extentMajor=function(b){return arguments.length?(r=+b[0][0],n=+b[1][0],s=+b[0][1],a=+b[1][1],r>n&&(b=r,r=n,n=b),s>a&&(b=s,s=a,a=b),y.precision(g)):[[r,s],[n,a]]},y.extentMinor=function(b){return arguments.length?(e=+b[0][0],t=+b[1][0],o=+b[0][1],i=+b[1][1],e>t&&(b=e,e=t,t=b),o>i&&(b=o,o=i,i=b),y.precision(g)):[[e,o],[t,i]]},y.step=function(b){return arguments.length?y.stepMajor(b).stepMinor(b):y.stepMinor()},y.stepMajor=function(b){return arguments.length?(u=+b[0],f=+b[1],y):[u,f]},y.stepMinor=function(b){return arguments.length?(l=+b[0],c=+b[1],y):[l,c]},y.precision=function(b){return arguments.length?(g=+b,d=q4(o,i,90),h=K4(e,t,g),p=q4(s,a,90),v=K4(r,n,g),y):g},y.extentMajor([[-180,-90+bt],[180,90-bt]]).extentMinor([[-180,-80-bt],[180,80+bt]])}function _ut(){return Out()()}const Ff=t=>t;var t2=new Za,e2=new Za,Z4,Q4,n2,r2,ha={point:Vr,lineStart:Vr,lineEnd:Vr,polygonStart:function(){ha.lineStart=Sut,ha.lineEnd=Mut},polygonEnd:function(){ha.lineStart=ha.lineEnd=ha.point=Vr,t2.add(Bt(e2)),e2=new Za},result:function(){var t=t2/2;return t2=new Za,t}};function Sut(){ha.point=Eut}function Eut(t,e){ha.point=J4,Z4=n2=t,Q4=r2=e}function J4(t,e){e2.add(r2*t-n2*e),n2=t,r2=e}function Mut(){J4(Z4,Q4)}const tj=ha;var cc=1/0,ov=cc,Rf=-cc,av=Rf,Put={point:Aut,lineStart:Vr,lineEnd:Vr,polygonStart:Vr,polygonEnd:Vr,result:function(){var t=[[cc,ov],[Rf,av]];return Rf=av=-(ov=cc=1/0),t}};function Aut(t,e){t<cc&&(cc=t),t>Rf&&(Rf=t),e<ov&&(ov=e),e>av&&(av=e)}const sv=Put;var i2=0,o2=0,Bf=0,lv=0,cv=0,uc=0,a2=0,s2=0,zf=0,ej,nj,zi,Yi,fi={point:Es,lineStart:rj,lineEnd:ij,polygonStart:function(){fi.lineStart=kut,fi.lineEnd=Lut},polygonEnd:function(){fi.point=Es,fi.lineStart=rj,fi.lineEnd=ij},result:function(){var t=zf?[a2/zf,s2/zf]:uc?[lv/uc,cv/uc]:Bf?[i2/Bf,o2/Bf]:[NaN,NaN];return i2=o2=Bf=lv=cv=uc=a2=s2=zf=0,t}};function Es(t,e){i2+=t,o2+=e,++Bf}function rj(){fi.point=Cut}function Cut(t,e){fi.point=Tut,Es(zi=t,Yi=e)}function Tut(t,e){var n=t-zi,r=e-Yi,i=er(n*n+r*r);lv+=i*(zi+t)/2,cv+=i*(Yi+e)/2,uc+=i,Es(zi=t,Yi=e)}function ij(){fi.point=Es}function kut(){fi.point=Nut}function Lut(){oj(ej,nj)}function Nut(t,e){fi.point=oj,Es(ej=zi=t,nj=Yi=e)}function oj(t,e){var n=t-zi,r=e-Yi,i=er(n*n+r*r);lv+=i*(zi+t)/2,cv+=i*(Yi+e)/2,uc+=i,i=Yi*t-zi*e,a2+=i*(zi+t),s2+=i*(Yi+e),zf+=i*3,Es(zi=t,Yi=e)}const aj=fi;function sj(t){this._context=t}sj.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:{this._context.moveTo(t,e),this._point=1;break}case 1:{this._context.lineTo(t,e);break}default:{this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,xr);break}}},result:Vr};var l2=new Za,c2,lj,cj,Yf,Wf,uv={point:Vr,lineStart:function(){uv.point=Iut},lineEnd:function(){c2&&uj(lj,cj),uv.point=Vr},polygonStart:function(){c2=!0},polygonEnd:function(){c2=null},result:function(){var t=+l2;return l2=new Za,t}};function Iut(t,e){uv.point=uj,lj=Yf=t,cj=Wf=e}function uj(t,e){Yf-=t,Wf-=e,l2.add(er(Yf*Yf+Wf*Wf)),Yf=t,Wf=e}const fj=uv;let dj,fv,hj,pj;class vj{constructor(e){this._append=e==null?gj:jut(e),this._radius=4.5,this._=""}pointRadius(e){return this._radius=+e,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(e,n){switch(this._point){case 0:{this._append`M${e},${n}`,this._point=1;break}case 1:{this._append`L${e},${n}`;break}default:{if(this._append`M${e},${n}`,this._radius!==hj||this._append!==fv){const r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,hj=r,fv=this._append,pj=this._,this._=i}this._+=pj;break}}}result(){const e=this._;return this._="",e.length?e:null}}function gj(t){let e=1;this._+=t[0];for(const n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function jut(t){const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return gj;if(e!==dj){const n=Ce(10,e);dj=e,fv=function(i){let o=1;this._+=i[0];for(const a=i.length;o<a;++o)this._+=Math.round(arguments[o]*n)/n+i[o]}}return fv}function yj(t,e){let n=3,r=4.5,i,o;function a(s){return s&&(typeof r=="function"&&o.pointRadius(+r.apply(this,arguments)),sc(s,i(o))),o.result()}return a.area=function(s){return sc(s,i(tj)),tj.result()},a.measure=function(s){return sc(s,i(fj)),fj.result()},a.bounds=function(s){return sc(s,i(sv)),sv.result()},a.centroid=function(s){return sc(s,i(aj)),aj.result()},a.projection=function(s){return arguments.length?(i=s==null?(t=null,Ff):(t=s).stream,a):t},a.context=function(s){return arguments.length?(o=s==null?(e=null,new vj(n)):new sj(e=s),typeof r!="function"&&o.pointRadius(r),a):e},a.pointRadius=function(s){return arguments.length?(r=typeof s=="function"?s:(o.pointRadius(+s),+s),a):r},a.digits=function(s){if(!arguments.length)return n;if(s==null)n=null;else{const l=Math.floor(s);if(!(l>=0))throw new RangeError(`invalid digits: ${s}`);n=l}return e===null&&(o=new vj(n)),a},a.projection(t).digits(n).context(e)}function dv(t){return function(e){var n=new u2;for(var r in t)n[r]=t[r];return n.stream=e,n}}function u2(){}u2.prototype={constructor:u2,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function f2(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),r!=null&&t.clipExtent(null),sc(n,t.stream(sv)),e(sv.result()),r!=null&&t.clipExtent(r),t}function hv(t,e,n){return f2(t,function(r){var i=e[1][0]-e[0][0],o=e[1][1]-e[0][1],a=Math.min(i/(r[1][0]-r[0][0]),o/(r[1][1]-r[0][1])),s=+e[0][0]+(i-a*(r[1][0]+r[0][0]))/2,l=+e[0][1]+(o-a*(r[1][1]+r[0][1]))/2;t.scale(150*a).translate([s,l])},n)}function d2(t,e,n){return hv(t,[[0,0],e],n)}function h2(t,e,n){return f2(t,function(r){var i=+e,o=i/(r[1][0]-r[0][0]),a=(i-o*(r[1][0]+r[0][0]))/2,s=-o*r[0][1];t.scale(150*o).translate([a,s])},n)}function p2(t,e,n){return f2(t,function(r){var i=+e,o=i/(r[1][1]-r[0][1]),a=-o*r[0][0],s=(i-o*(r[1][1]+r[0][1]))/2;t.scale(150*o).translate([a,s])},n)}var mj=16,Dut=Tt(30*Ie);function bj(t,e){return+e?Fut(t,e):$ut(t)}function $ut(t){return dv({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}function Fut(t,e){function n(r,i,o,a,s,l,c,u,f,d,h,p,v,g){var y=c-r,m=u-i,b=y*y+m*m;if(b>4*e&&v--){var x=a+d,w=s+h,O=l+p,_=er(x*x+w*w+O*O),S=Ur(O/=_),E=Bt(Bt(O)-1)<bt||Bt(o-f)<bt?(o+f)/2:bo(w,x),M=t(E,S),P=M[0],C=M[1],A=P-r,T=C-i,k=m*A-y*T;(k*k/b>e||Bt((y*A+m*T)/b-.5)>.3||a*d+s*h+l*p<Dut)&&(n(r,i,o,a,s,l,P,C,E,x/=_,w/=_,O,v,g),g.point(P,C),n(P,C,E,x,w,O,c,u,f,d,h,p,v,g))}}return function(r){var i,o,a,s,l,c,u,f,d,h,p,v,g={point:y,lineStart:m,lineEnd:x,polygonStart:function(){r.polygonStart(),g.lineStart=w},polygonEnd:function(){r.polygonEnd(),g.lineStart=m}};function y(S,E){S=t(S,E),r.point(S[0],S[1])}function m(){f=NaN,g.point=b,r.lineStart()}function b(S,E){var M=lc([S,E]),P=t(S,E);n(f,d,u,h,p,v,f=P[0],d=P[1],u=S,h=M[0],p=M[1],v=M[2],mj,r),r.point(f,d)}function x(){g.point=y,r.lineEnd()}function w(){m(),g.point=O,g.lineEnd=_}function O(S,E){b(i=S,E),o=f,a=d,s=h,l=p,c=v,g.point=b}function _(){n(f,d,u,h,p,v,o,a,i,s,l,c,mj,r),g.lineEnd=x,x()}return g}}var Rut=dv({point:function(t,e){this.stream.point(t*Ie,e*Ie)}});function But(t){return dv({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}function zut(t,e,n,r,i){function o(a,s){return a*=r,s*=i,[e+t*a,n-t*s]}return o.invert=function(a,s){return[(a-e)/t*r,(n-s)/t*i]},o}function xj(t,e,n,r,i,o){if(!o)return zut(t,e,n,r,i);var a=Tt(o),s=Et(o),l=a*t,c=s*t,u=a/t,f=s/t,d=(s*n-a*e)/t,h=(s*e+a*n)/t;function p(v,g){return v*=r,g*=i,[l*v-c*g+e,n-c*v-l*g]}return p.invert=function(v,g){return[r*(u*v-f*g+d),i*(h-f*v-u*g)]},p}function Wi(t){return v2(function(){return t})()}function v2(t){var e,n=150,r=480,i=250,o=0,a=0,s=0,l=0,c=0,u,f=0,d=1,h=1,p=null,v=V4,g=null,y,m,b,x=Ff,w=.5,O,_,S,E,M;function P(k){return S(k[0]*Ie,k[1]*Ie)}function C(k){return k=S.invert(k[0],k[1]),k&&[k[0]*Pn,k[1]*Pn]}P.stream=function(k){return E&&M===k?E:E=Rut(But(u)(v(O(x(M=k)))))},P.preclip=function(k){return arguments.length?(v=k,p=void 0,T()):v},P.postclip=function(k){return arguments.length?(x=k,g=y=m=b=null,T()):x},P.clipAngle=function(k){return arguments.length?(v=+k?xut(p=k*Ie):(p=null,V4),T()):p*Pn},P.clipExtent=function(k){return arguments.length?(x=k==null?(g=y=m=b=null,Ff):X4(g=+k[0][0],y=+k[0][1],m=+k[1][0],b=+k[1][1]),T()):g==null?null:[[g,y],[m,b]]},P.scale=function(k){return arguments.length?(n=+k,A()):n},P.translate=function(k){return arguments.length?(r=+k[0],i=+k[1],A()):[r,i]},P.center=function(k){return arguments.length?(o=k[0]%360*Ie,a=k[1]%360*Ie,A()):[o*Pn,a*Pn]},P.rotate=function(k){return arguments.length?(s=k[0]%360*Ie,l=k[1]%360*Ie,c=k.length>2?k[2]%360*Ie:0,A()):[s*Pn,l*Pn,c*Pn]},P.angle=function(k){return arguments.length?(f=k%360*Ie,A()):f*Pn},P.reflectX=function(k){return arguments.length?(d=k?-1:1,A()):d<0},P.reflectY=function(k){return arguments.length?(h=k?-1:1,A()):h<0},P.precision=function(k){return arguments.length?(O=bj(_,w=k*k),T()):er(w)},P.fitExtent=function(k,N){return hv(P,k,N)},P.fitSize=function(k,N){return d2(P,k,N)},P.fitWidth=function(k,N){return h2(P,k,N)},P.fitHeight=function(k,N){return p2(P,k,N)};function A(){var k=xj(n,0,0,d,h,f).apply(null,e(o,a)),N=xj(n,r-k[0],i-k[1],d,h,f);return u=F4(s,l,c),_=Zx(e,N),S=Zx(u,_),O=bj(_,w),T()}function T(){return E=M=null,P}return function(){return e=t.apply(this,arguments),P.invert=e.invert&&C,A()}}function g2(t){var e=0,n=Lt/3,r=v2(t),i=r(e,n);return i.parallels=function(o){return arguments.length?r(e=o[0]*Ie,n=o[1]*Ie):[e*Pn,n*Pn]},i}function Yut(t){var e=Tt(t);function n(r,i){return[r*e,Et(i)/e]}return n.invert=function(r,i){return[r/e,Ur(i*e)]},n}function wj(t,e){var n=Et(t),r=(n+Et(e))/2;if(Bt(r)<bt)return Yut(t);var i=1+n*(2*r-n),o=er(i)/r;function a(s,l){var c=er(i-2*r*Et(l))/r;return[c*Et(s*=r),o-c*Tt(s)]}return a.invert=function(s,l){var c=o-l,u=bo(s,Bt(c))*Hr(c);return c*r<0&&(u-=Lt*Hr(s)*Hr(c)),[u/r,Ur((i-(s*s+c*c)*r*r)/(2*r))]},a}function pv(){return g2(wj).scale(155.424).center([0,33.6442])}function Oj(){return pv().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Wut(t){var e=t.length;return{point:function(n,r){for(var i=-1;++i<e;)t[i].point(n,r)},sphere:function(){for(var n=-1;++n<e;)t[n].sphere()},lineStart:function(){for(var n=-1;++n<e;)t[n].lineStart()},lineEnd:function(){for(var n=-1;++n<e;)t[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<e;)t[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<e;)t[n].polygonEnd()}}}function Gut(){var t,e,n=Oj(),r,i=pv().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o,a=pv().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s,l,c={point:function(d,h){l=[d,h]}};function u(d){var h=d[0],p=d[1];return l=null,r.point(h,p),l||(o.point(h,p),l)||(s.point(h,p),l)}u.invert=function(d){var h=n.scale(),p=n.translate(),v=(d[0]-p[0])/h,g=(d[1]-p[1])/h;return(g>=.12&&g<.234&&v>=-.425&&v<-.214?i:g>=.166&&g<.234&&v>=-.214&&v<-.115?a:n).invert(d)},u.stream=function(d){return t&&e===d?t:t=Wut([n.stream(e=d),i.stream(d),a.stream(d)])},u.precision=function(d){return arguments.length?(n.precision(d),i.precision(d),a.precision(d),f()):n.precision()},u.scale=function(d){return arguments.length?(n.scale(d),i.scale(d*.35),a.scale(d),u.translate(n.translate())):n.scale()},u.translate=function(d){if(!arguments.length)return n.translate();var h=n.scale(),p=+d[0],v=+d[1];return r=n.translate(d).clipExtent([[p-.455*h,v-.238*h],[p+.455*h,v+.238*h]]).stream(c),o=i.translate([p-.307*h,v+.201*h]).clipExtent([[p-.425*h+bt,v+.12*h+bt],[p-.214*h-bt,v+.234*h-bt]]).stream(c),s=a.translate([p-.205*h,v+.212*h]).clipExtent([[p-.214*h+bt,v+.166*h+bt],[p-.115*h-bt,v+.234*h-bt]]).stream(c),f()},u.fitExtent=function(d,h){return hv(u,d,h)},u.fitSize=function(d,h){return d2(u,d,h)},u.fitWidth=function(d,h){return h2(u,d,h)},u.fitHeight=function(d,h){return p2(u,d,h)};function f(){return t=e=null,u}return u.scale(1070)}function _j(t){return function(e,n){var r=Tt(e),i=Tt(n),o=t(r*i);return o===1/0?[2,0]:[o*i*Et(e),o*Et(n)]}}function Gf(t){return function(e,n){var r=er(e*e+n*n),i=t(r),o=Et(i),a=Tt(i);return[bo(e*o,r*a),Ur(r&&n*o/r)]}}var y2=_j(function(t){return er(2/(1+t))});y2.invert=Gf(function(t){return 2*Ur(t/2)});function Hut(){return Wi(y2).scale(124.75).clipAngle(180-.001)}var m2=_j(function(t){return(t=I4(t))&&t/Et(t)});m2.invert=Gf(function(t){return t});function Uut(){return Wi(m2).scale(79.4188).clipAngle(180-.001)}function Hf(t,e){return[t,Z0(Ux((ze+e)/2))]}Hf.invert=function(t,e){return[t,2*ac(N4(e))-ze]};function Vut(){return Sj(Hf).scale(961/xr)}function Sj(t){var e=Wi(t),n=e.center,r=e.scale,i=e.translate,o=e.clipExtent,a=null,s,l,c;e.scale=function(f){return arguments.length?(r(f),u()):r()},e.translate=function(f){return arguments.length?(i(f),u()):i()},e.center=function(f){return arguments.length?(n(f),u()):n()},e.clipExtent=function(f){return arguments.length?(f==null?a=s=l=c=null:(a=+f[0][0],s=+f[0][1],l=+f[1][0],c=+f[1][1]),u()):a==null?null:[[a,s],[l,c]]};function u(){var f=Lt*r(),d=e(dut(e.rotate()).invert([0,0]));return o(a==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:t===Hf?[[Math.max(d[0]-f,a),s],[Math.min(d[0]+f,l),c]]:[[a,Math.max(d[1]-f,s)],[l,Math.min(d[1]+f,c)]])}return u()}function vv(t){return Ux((ze+t)/2)}function Ej(t,e){var n=Tt(t),r=t===e?Et(t):Z0(n/Tt(e))/Z0(vv(e)/vv(t)),i=n*Hx(vv(t),r)/r;if(!r)return Hf;function o(a,s){i>0?s<-ze+bt&&(s=-ze+bt):s>ze-bt&&(s=ze-bt);var l=i/Hx(vv(s),r);return[l*Et(r*a),i-l*Tt(r*a)]}return o.invert=function(a,s){var l=i-s,c=Hr(r)*er(a*a+l*l),u=bo(a,Bt(l))*Hr(l);return l*r<0&&(u-=Lt*Hr(a)*Hr(l)),[u/r,2*ac(Hx(i/c,1/r))-ze]},o}function Xut(){return g2(Ej).scale(109.5).parallels([30,30])}function Uf(t,e){return[t,e]}Uf.invert=Uf;function qut(){return Wi(Uf).scale(152.63)}function Mj(t,e){var n=Tt(t),r=t===e?Et(t):(n-Tt(e))/(e-t),i=n/r+t;if(Bt(r)<bt)return Uf;function o(a,s){var l=i-s,c=r*a;return[l*Et(c),i-l*Tt(c)]}return o.invert=function(a,s){var l=i-s,c=bo(a,Bt(l))*Hr(l);return l*r<0&&(c-=Lt*Hr(a)*Hr(l)),[c/r,i-Hr(r)*er(a*a+l*l)]},o}function Kut(){return g2(Mj).scale(131.154).center([0,13.9389])}var Vf=1.340264,Xf=-.081106,qf=893e-6,Kf=.003796,gv=er(3)/2,Zut=12;function b2(t,e){var n=Ur(gv*Et(e)),r=n*n,i=r*r*r;return[t*Tt(n)/(gv*(Vf+3*Xf*r+i*(7*qf+9*Kf*r))),n*(Vf+Xf*r+i*(qf+Kf*r))]}b2.invert=function(t,e){for(var n=e,r=n*n,i=r*r*r,o=0,a,s,l;o<Zut&&(s=n*(Vf+Xf*r+i*(qf+Kf*r))-e,l=Vf+3*Xf*r+i*(7*qf+9*Kf*r),n-=a=s/l,r=n*n,i=r*r*r,!(Bt(a)<k4));++o);return[gv*t*(Vf+3*Xf*r+i*(7*qf+9*Kf*r))/Tt(n),Ur(Et(n)/gv)]};function Qut(){return Wi(b2).scale(177.158)}function x2(t,e){var n=Tt(e),r=Tt(t)*n;return[n*Et(t)/r,Et(e)/r]}x2.invert=Gf(ac);function Jut(){return Wi(x2).scale(144.049).clipAngle(60)}function tft(){var t=1,e=0,n=0,r=1,i=1,o=0,a,s,l=null,c,u,f,d=1,h=1,p=dv({point:function(x,w){var O=b([x,w]);this.stream.point(O[0],O[1])}}),v=Ff,g,y;function m(){return d=t*r,h=t*i,g=y=null,b}function b(x){var w=x[0]*d,O=x[1]*h;if(o){var _=O*a-w*s;w=w*a+O*s,O=_}return[w+e,O+n]}return b.invert=function(x){var w=x[0]-e,O=x[1]-n;if(o){var _=O*a+w*s;w=w*a-O*s,O=_}return[w/d,O/h]},b.stream=function(x){return g&&y===x?g:g=p(v(y=x))},b.postclip=function(x){return arguments.length?(v=x,l=c=u=f=null,m()):v},b.clipExtent=function(x){return arguments.length?(v=x==null?(l=c=u=f=null,Ff):X4(l=+x[0][0],c=+x[0][1],u=+x[1][0],f=+x[1][1]),m()):l==null?null:[[l,c],[u,f]]},b.scale=function(x){return arguments.length?(t=+x,m()):t},b.translate=function(x){return arguments.length?(e=+x[0],n=+x[1],m()):[e,n]},b.angle=function(x){return arguments.length?(o=x%360*Ie,s=Et(o),a=Tt(o),m()):o*Pn},b.reflectX=function(x){return arguments.length?(r=x?-1:1,m()):r<0},b.reflectY=function(x){return arguments.length?(i=x?-1:1,m()):i<0},b.fitExtent=function(x,w){return hv(b,x,w)},b.fitSize=function(x,w){return d2(b,x,w)},b.fitWidth=function(x,w){return h2(b,x,w)},b.fitHeight=function(x,w){return p2(b,x,w)},b}function w2(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),e*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}w2.invert=function(t,e){var n=e,r=25,i;do{var o=n*n,a=o*o;n-=i=(n*(1.007226+o*(.015085+a*(-.044475+.028874*o-.005916*a)))-e)/(1.007226+o*(.015085*3+a*(-.044475*7+.028874*9*o-.005916*11*a)))}while(Bt(i)>bt&&--r>0);return[t/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};function eft(){return Wi(w2).scale(175.295)}function O2(t,e){return[Tt(e)*Et(t),Et(e)]}O2.invert=Gf(Ur);function nft(){return Wi(O2).scale(249.5).clipAngle(90+bt)}function _2(t,e){var n=Tt(e),r=1+Tt(t)*n;return[n*Et(t)/r,Et(e)/r]}_2.invert=Gf(function(t){return 2*ac(t)});function rft(){return Wi(_2).scale(250).clipAngle(142)}function S2(t,e){return[Z0(Ux((ze+e)/2)),-t]}S2.invert=function(t,e){return[-e,2*ac(N4(t))-ze]};function ift(){var t=Sj(S2),e=t.center,n=t.rotate;return t.center=function(r){return arguments.length?e([-r[1],r[0]]):(r=e(),[r[1],-r[0]])},t.rotate=function(r){return arguments.length?n([r[0],r[1],r.length>2?r[2]+90:90]):(r=n(),[r[0],r[1],r[2]-90])},n([0,0,90]).scale(159.155)}const oft=Object.freeze(Object.defineProperty({__proto__:null,geoAlbers:Oj,geoAlbersUsa:Gut,geoAzimuthalEqualArea:Hut,geoAzimuthalEqualAreaRaw:y2,geoAzimuthalEquidistant:Uut,geoAzimuthalEquidistantRaw:m2,geoConicConformal:Xut,geoConicConformalRaw:Ej,geoConicEqualArea:pv,geoConicEqualAreaRaw:wj,geoConicEquidistant:Kut,geoConicEquidistantRaw:Mj,geoEqualEarth:Qut,geoEqualEarthRaw:b2,geoEquirectangular:qut,geoEquirectangularRaw:Uf,geoGnomonic:Jut,geoGnomonicRaw:x2,geoIdentity:tft,geoMercator:Vut,geoMercatorRaw:Hf,geoNaturalEarth1:eft,geoNaturalEarth1Raw:w2,geoOrthographic:nft,geoOrthographicRaw:O2,geoProjection:Wi,geoProjectionMutator:v2,geoStereographic:rft,geoStereographicRaw:_2,geoTransverseMercator:ift,geoTransverseMercatorRaw:S2},Symbol.toStringTag,{value:"Module"}));var aft=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function sft(t){if(typeof t=="function")return t;const e=`geo${zo(t)}`,n=oft[e];if(!n)throw new Error(`Unknown coordinate: ${t}`);return n}function lft(t){return{type:"FeatureCollection",features:t.flatMap(e=>cft(e).features)}}function cft(t){const e={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featureCollection"};if(!t||!t.type)return null;const n=e[t.type];if(!n)return null;if(n==="geometry")return{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:t}]};if(n==="feature")return{type:"FeatureCollection",features:[t]};if(n==="featureCollection")return t}function uft(t,e){var n;for(const[r,i]of Object.entries(e))(n=t[r])===null||n===void 0||n.call(t,i)}function fft(t,e,n,r){const i=()=>{const s=e.filter(Pj);return s.find(c=>c.sphere)?{type:"Sphere"}:lft(s.filter(c=>!c.sphere).flatMap(c=>c.data.value))},{outline:o=i()}=r,{size:a="fitExtent"}=r;if(a==="fitExtent")return dft(t,o,n);if(a==="fitWidth")return hft(t,o,n)}function dft(t,e,n){const{x:r,y:i,width:o,height:a}=n;t.fitExtent([[r,i],[o,a]],e)}function hft(t,e,n){const{width:r,height:i}=n,[[o,a],[s,l]]=yj(t.fitWidth(r,e)).bounds(e),c=Math.ceil(l-a),u=Math.min(Math.ceil(s-o),c),f=t.scale()*(u-1)/u,[d,h]=t.translate(),p=h+(i-c)/2;t.scale(f).translate([d,p]).precision(.2)}function pft(t){const{data:e}=t;if(Array.isArray(e))return Object.assign(Object.assign({},t),{data:{value:e}});const{type:n}=e;return n==="graticule10"?Object.assign(Object.assign({},t),{data:{value:[_ut()]}}):n==="sphere"?Object.assign(Object.assign({},t),{sphere:!0,data:{value:[{type:"Sphere"}]}}):t}function Pj(t){return t.type==="geoPath"}const Aj=()=>t=>{const{children:e,coordinate:n={}}=t;if(!Array.isArray(e))return[];const{type:r="equalEarth"}=n,i=aft(n,["type"]),o=sft(r),a=e.map(pft);let s;function l(){return[["custom",(f,d,h,p)=>{const v=o();fft(v,a,{x:f,y:d,width:h,height:p},i),uft(v,i),s=yj(v);const y=new oo({domain:[f,f+h]}),m=new oo({domain:[d,d+p]}),b=w=>{const O=v(w);if(!O)return[null,null];const[_,S]=O;return[y.map(_),m.map(S)]},x=w=>{if(!w)return null;const[O,_]=w,S=[y.invert(O),m.invert(_)];return v.invert(S)};return{transform:w=>b(w),untransform:w=>x(w)}}]]}function c(f){const{style:d,tooltip:h={}}=f;return Object.assign(Object.assign({},f),{type:"path",tooltip:y0(h,{title:"id",items:[{channel:"color"}]}),style:Object.assign(Object.assign({},d),{d:p=>s(p)||[]})})}const u=f=>Pj(f)?c(f):f;return[Object.assign(Object.assign({},t),{type:"view",scale:{x:{type:"identity"},y:{type:"identity"}},axis:!1,coordinate:{type:l},children:a.flatMap(u)})]};Aj.props={};function Cj(t,e){const{__data__:n}=t,{markKey:r,index:i,seriesIndex:o}=n,{markState:a}=e,s=Array.from(a.keys()).find(l=>l.key===r);if(s)return o?o.map(l=>s.data[l]):s.data[i]}function E2(t,e){if(e(t))return t;let n=t.parent;for(;n&&!e(n);)n=n.parent;return n}function vft(t){return E2(t,e=>e.className==="component")}function gft(t){return E2(t,e=>e.className==="element")}function yft(t){return E2(t,e=>e.className==="label")}function fn(t,e,n,r=i=>!0){return i=>{if(!r(i))return;n.emit(`plot:${t}`,i);const{target:o}=i;if(!o)return;const{className:a}=o;if(a==="plot")return;const s=gft(o),l=vft(o),c=yft(o),u=s||l||c;if(!u)return;const{className:f,markType:d}=u,h=Object.assign(Object.assign({},i),{nativeEvent:!0});f==="element"?(h.data={data:Cj(u,e)},n.emit(`element:${t}`,h),n.emit(`${d}:${t}`,h)):f==="label"?(h.data={data:u.attributes.datum},n.emit(`label:${t}`,h),n.emit(`${a}:${t}`,h)):(n.emit(`component:${t}`,h),n.emit(`${a}:${t}`,h))}}function Tj(){return(t,e,n)=>{const{container:r,view:i}=t,o=fn(Ut.CLICK,i,n,_=>_.detail===1),a=fn(Ut.DBLCLICK,i,n,_=>_.detail===2),s=fn(Ut.POINTER_TAP,i,n),l=fn(Ut.POINTER_DOWN,i,n),c=fn(Ut.POINTER_UP,i,n),u=fn(Ut.POINTER_OVER,i,n),f=fn(Ut.POINTER_OUT,i,n),d=fn(Ut.POINTER_MOVE,i,n),h=fn(Ut.POINTER_ENTER,i,n),p=fn(Ut.POINTER_LEAVE,i,n),v=fn(Ut.POINTER_UPOUTSIDE,i,n),g=fn(Ut.DRAG_START,i,n),y=fn(Ut.DRAG,i,n),m=fn(Ut.DRAG_END,i,n),b=fn(Ut.DRAG_ENTER,i,n),x=fn(Ut.DRAG_LEAVE,i,n),w=fn(Ut.DRAG_OVER,i,n),O=fn(Ut.DROP,i,n);return r.addEventListener("click",o),r.addEventListener("click",a),r.addEventListener("pointertap",s),r.addEventListener("pointerdown",l),r.addEventListener("pointerup",c),r.addEventListener("pointerover",u),r.addEventListener("pointerout",f),r.addEventListener("pointermove",d),r.addEventListener("pointerenter",h),r.addEventListener("pointerleave",p),r.addEventListener("pointerupoutside",v),r.addEventListener("dragstart",g),r.addEventListener("drag",y),r.addEventListener("dragend",m),r.addEventListener("dragenter",b),r.addEventListener("dragleave",x),r.addEventListener("dragover",w),r.addEventListener("drop",O),()=>{r.removeEventListener("click",o),r.removeEventListener("click",a),r.removeEventListener("pointertap",s),r.removeEventListener("pointerdown",l),r.removeEventListener("pointerup",c),r.removeEventListener("pointerover",u),r.removeEventListener("pointerout",f),r.removeEventListener("pointermove",d),r.removeEventListener("pointerenter",h),r.removeEventListener("pointerleave",p),r.removeEventListener("pointerupoutside",v),r.removeEventListener("dragstart",g),r.removeEventListener("drag",y),r.removeEventListener("dragend",m),r.removeEventListener("dragenter",b),r.removeEventListener("dragleave",x),r.removeEventListener("dragover",w),r.removeEventListener("drop",O)}}}Tj.props={reapplyWhenUpdate:!0};function mft(){return{"component.axisRadar":gI,"component.axisLinear":la,"component.axisArc":hI,"component.legendContinuousBlock":yI,"component.legendContinuousBlockSize":mI,"component.legendContinuousSize":xx,"interaction.event":Tj,"composition.mark":_4,"composition.view":O4,"shape.label.label":Z3}}var bft=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function pe(t,e){const n=Object.assign(Object.assign({},mft()),e),r=o=>{if(typeof o!="string")return o;const a=`${t}.${o}`;return n[a]||ml(`Unknown Component: ${a}`)};return[(o,a)=>{const{type:s}=o,l=bft(o,["type"]);s||ml("Plot type is required!");const c=r(s);return c==null?void 0:c(l,a)},r]}function kj(t){const{canvas:e,group:n}=t;return(e==null?void 0:e.document)||(n==null?void 0:n.ownerDocument)||ml("Cannot find library document")}var Lj=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function xft(t,e,n){const[r]=pe("coordinate",n),{innerHeight:i,innerWidth:o,insetLeft:a,insetTop:s,insetRight:l,insetBottom:c}=t,{coordinates:u=[]}=e,f=Mft(u),d=f[0].type==="cartesian3D",h=Object.assign(Object.assign({},t),{x:a,y:s,width:o-a-l,height:i-c-s,transformations:f.flatMap(r)});return d?new zct(h):new Rct(h)}function Nj(t,e){const{coordinate:n={}}=t,r=Lj(t,["coordinate"]),{type:i,transform:o=[]}=n,a=Lj(n,["type","transform"]);if(!i)return Object.assign(Object.assign({},r),{coordinates:o});const[,s]=pe("coordinate",e),{transform:l=!1}=s(i).props||{};if(l)throw new Error(`Unknown coordinate: ${i}.`);return Object.assign(Object.assign({},r),{coordinates:[Object.assign({type:i},a),...o]})}function di(t,e){return t.filter(n=>n.type===e)}function Ms(t){return di(t,"polar").length>0}function wft(t){return di(t,"helix").length>0}function fc(t){return di(t,"transpose").length%2===1}function Oft(t){return di(t,"parallel").length>0}function Ij(t){return di(t,"theta").length>0}function _ft(t){return di(t,"reflect").length>0}function Zf(t){return di(t,"radial").length>0}function Sft(t){return di(t,"radar").length>0}function Eft(t){return di(t,"reflectY").length>0}function Mft(t){return t.find(e=>e.type==="cartesian"||e.type==="cartesian3D")?t:[...t,{type:"cartesian"}]}function Mt(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(r*6,++r*6);return n}const Pft=Mt("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),Aft=Mt("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),Cft=Mt("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),Tft=Mt("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),kft=Mt("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),Lft=Mt("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),Nft=Mt("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),Ift=Mt("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),jft=Mt("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),Dft=Mt("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),$ft=Mt("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function yv(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function M2(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function dc(){}var Ps=.7,hc=1/Ps,pc="\\s*([+-]?\\d+)\\s*",Qf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Gi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Fft=/^#([0-9a-f]{3,8})$/,Rft=new RegExp(`^rgb\\(${pc},${pc},${pc}\\)$`),Bft=new RegExp(`^rgb\\(${Gi},${Gi},${Gi}\\)$`),zft=new RegExp(`^rgba\\(${pc},${pc},${pc},${Qf}\\)$`),Yft=new RegExp(`^rgba\\(${Gi},${Gi},${Gi},${Qf}\\)$`),Wft=new RegExp(`^hsl\\(${Qf},${Gi},${Gi}\\)$`),Gft=new RegExp(`^hsla\\(${Qf},${Gi},${Gi},${Qf}\\)$`),jj={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};yv(dc,P2,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Dj,formatHex:Dj,formatHex8:Hft,formatHsl:Uft,formatRgb:$j,toString:$j});function Dj(){return this.rgb().formatHex()}function Hft(){return this.rgb().formatHex8()}function Uft(){return Wj(this).formatHsl()}function $j(){return this.rgb().formatRgb()}function P2(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Fft.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?Fj(e):n===3?new An(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?mv(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?mv(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Rft.exec(t))?new An(e[1],e[2],e[3],1):(e=Bft.exec(t))?new An(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=zft.exec(t))?mv(e[1],e[2],e[3],e[4]):(e=Yft.exec(t))?mv(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Wft.exec(t))?Yj(e[1],e[2]/100,e[3]/100,1):(e=Gft.exec(t))?Yj(e[1],e[2]/100,e[3]/100,e[4]):jj.hasOwnProperty(t)?Fj(jj[t]):t==="transparent"?new An(NaN,NaN,NaN,0):null}function Fj(t){return new An(t>>16&255,t>>8&255,t&255,1)}function mv(t,e,n,r){return r<=0&&(t=e=n=NaN),new An(t,e,n,r)}function Rj(t){return t instanceof dc||(t=P2(t)),t?(t=t.rgb(),new An(t.r,t.g,t.b,t.opacity)):new An}function Jf(t,e,n,r){return arguments.length===1?Rj(t):new An(t,e,n,r==null?1:r)}function An(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}yv(An,Jf,M2(dc,{brighter(t){return t=t==null?hc:Math.pow(hc,t),new An(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Ps:Math.pow(Ps,t),new An(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new An(As(this.r),As(this.g),As(this.b),bv(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:Bj,formatHex:Bj,formatHex8:Vft,formatRgb:zj,toString:zj}));function Bj(){return`#${Cs(this.r)}${Cs(this.g)}${Cs(this.b)}`}function Vft(){return`#${Cs(this.r)}${Cs(this.g)}${Cs(this.b)}${Cs((isNaN(this.opacity)?1:this.opacity)*255)}`}function zj(){const t=bv(this.opacity);return`${t===1?"rgb(":"rgba("}${As(this.r)}, ${As(this.g)}, ${As(this.b)}${t===1?")":`, ${t})`}`}function bv(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function As(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Cs(t){return t=As(t),(t<16?"0":"")+t.toString(16)}function Yj(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new hi(t,e,n,r)}function Wj(t){if(t instanceof hi)return new hi(t.h,t.s,t.l,t.opacity);if(t instanceof dc||(t=P2(t)),!t)return new hi;if(t instanceof hi)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(e===o?a=(n-r)/s+(n<r)*6:n===o?a=(r-e)/s+2:a=(e-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new hi(a,s,l,t.opacity)}function Xft(t,e,n,r){return arguments.length===1?Wj(t):new hi(t,e,n,r==null?1:r)}function hi(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}yv(hi,Xft,M2(dc,{brighter(t){return t=t==null?hc:Math.pow(hc,t),new hi(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Ps:Math.pow(Ps,t),new hi(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new An(A2(t>=240?t-240:t+120,i,r),A2(t,i,r),A2(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new hi(Gj(this.h),xv(this.s),xv(this.l),bv(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=bv(this.opacity);return`${t===1?"hsl(":"hsla("}${Gj(this.h)}, ${xv(this.s)*100}%, ${xv(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Gj(t){return t=(t||0)%360,t<0?t+360:t}function xv(t){return Math.max(0,Math.min(1,t||0))}function A2(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const qft=Math.PI/180,Kft=180/Math.PI;var Hj=-.14861,C2=1.78277,T2=-.29227,wv=-.90649,td=1.97294,Uj=td*wv,Vj=td*C2,Xj=C2*T2-wv*Hj;function Zft(t){if(t instanceof Ts)return new Ts(t.h,t.s,t.l,t.opacity);t instanceof An||(t=Rj(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(Xj*r+Uj*e-Vj*n)/(Xj+Uj-Vj),o=r-i,a=(td*(n-i)-T2*o)/wv,s=Math.sqrt(a*a+o*o)/(td*i*(1-i)),l=s?Math.atan2(a,o)*Kft-120:NaN;return new Ts(l<0?l+360:l,s,i,t.opacity)}function Hi(t,e,n,r){return arguments.length===1?Zft(t):new Ts(t,e,n,r==null?1:r)}function Ts(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}yv(Ts,Hi,M2(dc,{brighter(t){return t=t==null?hc:Math.pow(hc,t),new Ts(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Ps:Math.pow(Ps,t),new Ts(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*qft,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new An(255*(e+n*(Hj*r+C2*i)),255*(e+n*(T2*r+wv*i)),255*(e+n*(td*r)),this.opacity)}}));function Qft(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}function Jft(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r<e-1?t[r+2]:2*o-i;return Qft((n-r/e)*e,a,i,o,s)}}const k2=t=>()=>t;function qj(t,e){return function(n){return t+n*e}}function tdt(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function edt(t,e){var n=e-t;return n?qj(t,n>180||n<-180?n-360*Math.round(n/360):n):k2(isNaN(t)?e:t)}function ndt(t){return(t=+t)==1?vc:function(e,n){return n-e?tdt(e,n,t):k2(isNaN(e)?n:e)}}function vc(t,e){var n=e-t;return n?qj(t,n):k2(isNaN(t)?e:t)}(function t(e){var n=ndt(e);function r(i,o){var a=n((i=Jf(i)).r,(o=Jf(o)).r),s=n(i.g,o.g),l=n(i.b,o.b),c=vc(i.opacity,o.opacity);return function(u){return i.r=a(u),i.g=s(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=t,r})(1);function rdt(t){return function(e){var n=e.length,r=new Array(n),i=new Array(n),o=new Array(n),a,s;for(a=0;a<n;++a)s=Jf(e[a]),r[a]=s.r||0,i[a]=s.g||0,o[a]=s.b||0;return r=t(r),i=t(i),o=t(o),s.opacity=1,function(l){return s.r=r(l),s.g=i(l),s.b=o(l),s+""}}}var idt=rdt(Jft);function Kj(t){return function e(n){n=+n;function r(i,o){var a=t((i=Hi(i)).h,(o=Hi(o)).h),s=vc(i.s,o.s),l=vc(i.l,o.l),c=vc(i.opacity,o.opacity);return function(u){return i.h=a(u),i.s=s(u),i.l=l(Math.pow(u,n)),i.opacity=c(u),i+""}}return r.gamma=e,r}(1)}Kj(edt);var L2=Kj(vc);const fe=t=>idt(t[t.length-1]);var Zj=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Mt);const odt=fe(Zj);var Qj=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Mt);const adt=fe(Qj);var Jj=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Mt);const sdt=fe(Jj);var tD=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Mt);const ldt=fe(tD);var eD=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Mt);const cdt=fe(eD);var nD=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Mt);const udt=fe(nD);var rD=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Mt);const fdt=fe(rD);var iD=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Mt);const ddt=fe(iD);var oD=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Mt);const hdt=fe(oD);var aD=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Mt);const pdt=fe(aD);var sD=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Mt);const vdt=fe(sD);var lD=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Mt);const gdt=fe(lD);var cD=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Mt);const ydt=fe(cD);var uD=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Mt);const mdt=fe(uD);var fD=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Mt);const bdt=fe(fD);var dD=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Mt);const xdt=fe(dD);var hD=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Mt);const wdt=fe(hD);var pD=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Mt);const Odt=fe(pD);var vD=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Mt);const _dt=fe(vD);var gD=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Mt);const Sdt=fe(gD);var yD=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Mt);const Edt=fe(yD);var mD=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Mt);const Mdt=fe(mD);var bD=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Mt);const Pdt=fe(bD);var xD=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Mt);const Adt=fe(xD);var wD=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Mt);const Cdt=fe(wD);var OD=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Mt);const Tdt=fe(OD);var _D=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Mt);const kdt=fe(_D);function Ldt(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-t*2710.57)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-t*67.37)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-t*2475.67)))))))+")"}const Ndt=L2(Hi(300,.5,0),Hi(-240,.5,1));var Idt=L2(Hi(-100,.75,.35),Hi(80,1.5,.8)),jdt=L2(Hi(260,.75,.35),Hi(80,1.5,.8)),Ov=Hi();function Ddt(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return Ov.h=360*t-100,Ov.s=1.5-1.5*e,Ov.l=.8-.9*e,Ov+""}var _v=Jf(),$dt=Math.PI/3,Fdt=Math.PI*2/3;function Rdt(t){var e;return t=(.5-t)*Math.PI,_v.r=255*(e=Math.sin(t))*e,_v.g=255*(e=Math.sin(t+$dt))*e,_v.b=255*(e=Math.sin(t+Fdt))*e,_v+""}function Bdt(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-t*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+t*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-t*6838.66)))))))+")"}function Sv(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}const zdt=Sv(Mt("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var Ydt=Sv(Mt("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Wdt=Sv(Mt("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Gdt=Sv(Mt("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));const N2=Object.freeze(Object.defineProperty({__proto__:null,interpolateBlues:Mdt,interpolateBrBG:odt,interpolateBuGn:pdt,interpolateBuPu:vdt,interpolateCividis:Ldt,interpolateCool:jdt,interpolateCubehelixDefault:Ndt,interpolateGnBu:gdt,interpolateGreens:Pdt,interpolateGreys:Adt,interpolateInferno:Wdt,interpolateMagma:Ydt,interpolateOrRd:ydt,interpolateOranges:kdt,interpolatePRGn:adt,interpolatePiYG:sdt,interpolatePlasma:Gdt,interpolatePuBu:bdt,interpolatePuBuGn:mdt,interpolatePuOr:ldt,interpolatePuRd:xdt,interpolatePurples:Cdt,interpolateRainbow:Ddt,interpolateRdBu:cdt,interpolateRdGy:udt,interpolateRdPu:wdt,interpolateRdYlBu:fdt,interpolateRdYlGn:ddt,interpolateReds:Tdt,interpolateSinebow:Rdt,interpolateSpectral:hdt,interpolateTurbo:Bdt,interpolateViridis:zdt,interpolateWarm:Idt,interpolateYlGn:_dt,interpolateYlGnBu:Odt,interpolateYlOrBr:Sdt,interpolateYlOrRd:Edt,schemeAccent:Aft,schemeBlues:mD,schemeBrBG:Zj,schemeBuGn:aD,schemeBuPu:sD,schemeCategory10:Pft,schemeDark2:Cft,schemeGnBu:lD,schemeGreens:bD,schemeGreys:xD,schemeObservable10:Tft,schemeOrRd:cD,schemeOranges:_D,schemePRGn:Qj,schemePaired:kft,schemePastel1:Lft,schemePastel2:Nft,schemePiYG:Jj,schemePuBu:fD,schemePuBuGn:uD,schemePuOr:tD,schemePuRd:dD,schemePurples:wD,schemeRdBu:eD,schemeRdGy:nD,schemeRdPu:hD,schemeRdYlBu:rD,schemeRdYlGn:iD,schemeReds:OD,schemeSet1:Ift,schemeSet2:jft,schemeSet3:Dft,schemeSpectral:oD,schemeTableau10:$ft,schemeYlGn:vD,schemeYlGnBu:pD,schemeYlOrBr:gD,schemeYlOrRd:yD},Symbol.toStringTag,{value:"Module"}));function Hdt(t,e,n,r,i,o){const{guide:a={}}=n,s=tht(t,e,n);if(typeof s!="string")return n;const l=eht(s,t,e,n),c=Zdt(s,l,n);return Object.assign(Object.assign(Object.assign({},n),rht(s,t,e,n,r)),{domain:c,range:nht(s,t,e,n,c,i,o),expectedDomain:l,guide:a,name:t,type:s})}function Udt(t,e){const n={};for(const r of t){const{values:i,name:o}=r,a=e[o];for(const s of i){const{name:l,value:c}=s;n[l]=c.map(u=>a.map(u))}}return n}function Vdt(t,e){var n;const{components:r=[]}=e,i=["scale","encode","axis","legend","data","transform"],o=Array.from(new Set(t.flatMap(s=>s.channels.map(l=>l.scale)))),a=new Map(o.map(s=>[s.name,s]));for(const s of r){const l=Kdt(s);for(const c of l){const u=a.get(c),f=((n=s.scale)===null||n===void 0?void 0:n[c])||{},{independent:d=!1}=f;if(u&&!d){const{guide:h}=u,p=typeof h=="boolean"?{}:h;u.guide=Z({},p,s),Object.assign(u,f)}else{const h=Object.assign(Object.assign({},f),{expectedDomain:f.domain,name:c,guide:bE(s,i)});o.push(h)}}}return o}function Xdt(t){if(!t||!Array.isArray(t))return[Qa,Qa];let e,n;return[o=>{var a;e=o.map.bind(o),n=(a=o.invert)===null||a===void 0?void 0:a.bind(o);const s=t.filter(([d])=>typeof d=="function"),l=t.filter(([d])=>typeof d!="function"),c=new Map(l);if(o.map=d=>{for(const[h,p]of s)if(h(d))return p;return c.has(d)?c.get(d):e(d)},!n)return o;const u=new Map(l.map(([d,h])=>[h,d])),f=new Map(s.map(([d,h])=>[h,d]));return o.invert=d=>f.has(d)?d:u.has(d)?u.get(d):n(d),o},o=>(e!==null&&(o.map=e),n!==null&&(o.invert=n),o)]}function SD(t,e){const n=Object.keys(t);for(const r of Object.values(e)){const{name:i}=r.getOptions();if(!(i in t))t[i]=r;else{const o=n.filter(l=>l.startsWith(i)).map(l=>+(l.replace(i,"")||0)),a=Gt(o)+1,s=`${i}${a}`;t[s]=r,r.getOptions().key=s}}return t}function ED(t,e){const[n]=pe("scale",e),{relations:r}=t,[i]=Xdt(r),o=n(t);return i(o)}function qdt(t){const e=t.flatMap(n=>Array.from(n.values())).flatMap(n=>n.channels.map(r=>r.scale));MD(e,"x"),MD(e,"y")}function Kdt(t){const{channels:e=[],type:n,scale:r={}}=t,i=["shape","color","opacity","size"];return e.length!==0?e:n==="axisX"?["x"]:n==="axisY"?["y"]:n==="legends"?Object.keys(r).filter(o=>i.includes(o)):[]}function MD(t,e){const n=t.filter(({name:o,facet:a=!0})=>a&&o===e),r=n.flatMap(o=>o.domain),i=n.every(PD)?no(r):n.every(AD)?Array.from(new Set(r)):null;if(i!==null)for(const o of n)o.domain=i}function Zdt(t,e,n){const{ratio:r}=n;return r==null?e:PD({type:t})?Qdt(e,r,t):AD({type:t})?Jdt(e,r):e}function Qdt(t,e,n){const r=t.map(Number),i=new oo({domain:r,range:[r[0],r[0]+(r[r.length-1]-r[0])*e]});return n==="time"?t.map(o=>new Date(i.map(o))):t.map(o=>i.map(o))}function Jdt(t,e){const n=Math.round(t.length*e);return t.slice(0,n)}function PD(t){const{type:e}=t;return typeof e!="string"?!1:["linear","log","pow","time"].includes(e)}function AD(t){const{type:e}=t;return typeof e!="string"?!1:["band","point","ordinal"].includes(e)}function tht(t,e,n){const{type:r,domain:i,range:o,quantitative:a,ordinal:s}=n;return r!==void 0?r:pht(e)?"identity":typeof o=="string"?"linear":(i||o||[]).length>2?I2(t,s):i!==void 0?ND([i])?I2(t,s):ID(e)?"time":TD(t,o,a):ND(e)?I2(t,s):ID(e)?"time":TD(t,o,a)}function eht(t,e,n,r){const{domain:i}=r;if(i!==void 0)return i;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":case"quantize":case"threshold":return kD(uht(n,r),r);case"band":case"ordinal":case"point":return LD(n);case"quantile":return fht(n);case"sequential":return kD(dht(n),r);default:return[]}}function nht(t,e,n,r,i,o,a){const{range:s}=r;if(typeof s=="string")return iht(s);if(s!==void 0)return s;const{rangeMin:l,rangeMax:c}=r;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":{const u=CD(n,r,i,o,a),[f,d]=hht(e,u);return[l||f,c||d]}case"band":case"point":return[l||(e==="size"?5:0),c||(e==="size"?10:1)];case"ordinal":return CD(n,r,i,o,a);case"sequential":return;case"constant":return[n[0][0]];default:return[]}}function rht(t,e,n,r,i){switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":return sht(i,r);case"band":case"point":return lht(t,e,i,r);case"sequential":return aht(r);default:return r}}function CD(t,e,n,r,i){const[o]=pe("palette",i),{category10:a,category20:s}=r,l=QY(t.flat()).length<=a.length?a:s,{palette:c=l,offset:u}=e;if(Array.isArray(c))return c;try{return o({type:c})}catch(f){const d=oht(c,n,u);if(d)return d;throw new Error(`Unknown Component: ${c} `)}}function iht(t){return t.split("-")}function oht(t,e,n=r=>r){if(!t)return null;const r=zo(t),i=N2[`scheme${r}`],o=N2[`interpolate${r}`];if(!i&&!o)return null;if(i){if(!i.some(Array.isArray))return i;const a=i[e.length];if(a)return a}return e.map((a,s)=>o(n(s/e.length)))}function aht(t){const{palette:e="ylGnBu",offset:n}=t,r=zo(e),i=N2[`interpolate${r}`];if(!i)throw new Error(`Unknown palette: ${r}`);return{interpolator:n?o=>i(n(o)):i}}function sht(t,e){const{interpolate:n=ju,nice:r=!1,tickCount:i=5}=e;return Object.assign(Object.assign({},e),{interpolate:n,nice:r,tickCount:i})}function lht(t,e,n,r){if(r.padding!==void 0||r.paddingInner!==void 0||r.paddingOuter!==void 0)return Object.assign(Object.assign({},r),{unknown:NaN});const i=cht(t,e,n),{paddingInner:o=i,paddingOuter:a=i}=r;return Object.assign(Object.assign({},r),{paddingInner:o,paddingOuter:a,padding:i,unknown:NaN})}function cht(t,e,n){return e==="enterDelay"||e==="enterDuration"||e==="size"?0:t==="band"?Ij(n)?0:.1:t==="point"?.5:0}function I2(t,e){return e||(vht(t)?"point":"ordinal")}function TD(t,e,n){return n||(t!=="color"||e?"linear":"sequential")}function kD(t,e){if(t.length===0)return t;const{domainMin:n,domainMax:r}=e,[i,o]=t;return[n!=null?n:i,r!=null?r:o]}function uht(t,e){const{zero:n=!1}=e;let r=1/0,i=-1/0;for(const o of t)for(const a of o)ie(a)&&(r=Math.min(r,+a),i=Math.max(i,+a));return r===1/0?[]:n?[Math.min(0,r),i]:[r,i]}function LD(t){return Array.from(new Set(t.flat()))}function fht(t){return LD(t).sort()}function dht(t){let e=1/0,n=-1/0;for(const r of t)for(const i of r)ie(i)&&(e=Math.min(e,+i),n=Math.max(n,+i));return e===1/0?[]:[e<0?-n:e,n]}function hht(t,e){return t==="enterDelay"?[0,1e3]:t=="enterDuration"?[300,1e3]:t.startsWith("y")||t.startsWith("position")?[1,0]:t==="color"?[ZY(e),XE(e)]:t==="opacity"?[0,1]:t==="size"?[1,10]:[0,1]}function ND(t){return j2(t,e=>{const n=typeof e;return n==="string"||n==="boolean"})}function ID(t){return j2(t,e=>e instanceof Date)}function pht(t){return j2(t,Su)}function j2(t,e){for(const n of t)if(n.some(e))return!0;return!1}function vht(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")}function ght(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||t==="enterDelay"||t==="enterDuration"||t==="updateDelay"||t==="updateDuration"||t==="exitDelay"||t==="exitDuration"}function yht(t){if(!t||!t.type)return!1;if(typeof t.type=="function")return!0;const{type:e,domain:n,range:r,interpolator:i}=t,o=n&&n.length>0,a=r&&r.length>0;return!!(["linear","sqrt","log","time","pow","threshold","quantize","quantile","ordinal","band","point"].includes(e)&&o&&a||["sequential"].includes(e)&&o&&(a||i)||["constant","identity"].includes(e)&&a)}const mht={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},bht={threshold:"threshold",quantize:"quantize",quantile:"quantile"},xht={ordinal:"ordinal",band:"band",point:"point"},wht={constant:"constant"};var pa=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function Oht(t,e,n){const{coordinates:r=[],title:i}=e,[,o]=pe("component",n),a=t.filter(({guide:u})=>u!==null),s=[],l=Lht(e,t,n);if(s.push(...l),i){const{props:u}=o("title"),{defaultPosition:f,defaultOrientation:d,defaultOrder:h,defaultSize:p,defaultCrossPadding:v}=u,g=typeof i=="string"?{title:i}:i;s.push(Object.assign({type:"title",position:f,orientation:d,order:h,crossPadding:v[0],defaultSize:p},g))}return Pht(a,r).forEach(([u,f])=>{const{props:d}=o(u),{defaultPosition:h,defaultPlane:p="xy",defaultOrientation:v,defaultSize:g,defaultOrder:y,defaultLength:m,defaultPadding:b=[0,0],defaultCrossPadding:x=[0,0]}=d,w=Z({},...f),{guide:O,field:_}=w,S=Array.isArray(O)?O:[O];for(const E of S){const[M,P]=Tht(u,h,v,E,f,a,r);if(!M&&!P)continue;const C=M==="left"||M==="right",A=C?b[1]:b[0],T=C?x[1]:x[0],{size:k,order:N=y,length:j=m,padding:L=A,crossPadding:I=T}=E;s.push(Object.assign(Object.assign({title:_},E),{defaultSize:g,length:j,position:M,plane:p,orientation:P,padding:L,order:N,crossPadding:I,size:k,type:u,scales:f}))}}),s}function jD(t,e,n,r,i){const[o]=pe("component",r),{scaleInstances:a,scale:s,bbox:l}=t,c=pa(t,["scaleInstances","scale","bbox"]),u={bbox:l,library:r};return o(c)({coordinate:e,library:r,markState:i,scales:a,theme:n,value:u,scale:s})}function _ht(t){return t.map(e=>{const n=Z(e,e.style);return delete n.style,n})}function DD(t,e){const n=["left","right","bottom","top"];return om(t,({type:o,position:a,group:s})=>n.includes(a)?s===void 0?o.startsWith("legend")?`legend-${a}`:Symbol("independent"):s==="independent"?Symbol("independent"):s:Symbol("independent")).flatMap(([,o])=>{if(o.length===1)return o[0];if(e!==void 0){const u=o.filter(v=>v.length!==void 0).map(v=>v.length),f=kr(u);if(f>e)return o.forEach(v=>v.group=Symbol("independent")),o;const d=e-f,h=o.length-u.length,p=d/h;o.forEach(v=>{v.length===void 0&&(v.length=p)})}const a=Gt(o,u=>u.size),s=Gt(o,u=>u.order),l=Gt(o,u=>u.crossPadding),c=o[0].position;return{type:"group",size:a,order:s,position:c,children:o,crossPadding:l}})}function Sht(t,e){const n=["shape","size","color","opacity"],r=(d,h)=>d==="constant"&&h==="size",i=t.filter(({type:d,name:h})=>typeof d=="string"&&n.includes(h)&&!r(d,h)),o=i.filter(({type:d})=>d==="constant"),a=i.filter(({type:d})=>d!=="constant"),l=om(a,d=>d.field?d.field:Symbol("independent")).map(([d,h])=>[d,[...h,...o]]).filter(([,d])=>d.some(h=>h.type!=="constant")),c=new Map(l);if(c.size===0)return[];const u=d=>d.sort(([h],[p])=>h.localeCompare(p));return Array.from(c).map(([,d])=>{const p=JY(d).sort((v,g)=>g.length-v.length).map(v=>({combination:v,option:v.map(g=>[g.name,Eht(g)])}));for(const{option:v,combination:g}of p)if(!v.every(y=>y[1]==="constant")&&v.every(y=>y[1]==="discrete"||y[1]==="constant"))return["legendCategory",g];for(const[v,g]of Tlt)for(const{option:y,combination:m}of p)if(g.some(b=>Oz(u(b),u(y))))return[v,m];return null}).filter(ie)}function Eht(t){const{type:e}=t;return typeof e!="string"?null:e in mht?"continuous":e in xht?"discrete":e in bht?"distribution":e in wht?"constant":null}function Mht(t,e){return t.map(n=>{const{name:r}=n;if(wft(e)||Ij(e)||fc(e)&&(Ms(e)||Zf(e)))return null;if(r.startsWith("x"))return Ms(e)?["axisArc",[n]]:Zf(e)?["axisLinear",[n]]:[fc(e)?"axisY":"axisX",[n]];if(r.startsWith("y"))return Ms(e)?["axisLinear",[n]]:Zf(e)?["axisArc",[n]]:[fc(e)?"axisX":"axisY",[n]];if(r.startsWith("z"))return["axisZ",[n]];if(r.startsWith("position")){if(Sft(e))return["axisRadar",[n]];if(!Ms(e))return["axisY",[n]]}return null}).filter(ie)}function Pht(t,e){const n=t.filter(r=>yht(r));return[...Sht(n),...Mht(n,e)]}function D2(t){const e=di(t,"polar");if(e.length){const r=e[e.length-1],{startAngle:i,endAngle:o}=oE(r);return[i,o]}const n=di(t,"radial");if(n.length){const r=n[n.length-1],{startAngle:i,endAngle:o}=sE(r);return[i,o]}return[-Math.PI/2,Math.PI/2*3]}function Aht(t){const e=/position(\d*)/g.exec(t);return e?+e[1]:null}function Cht(t,e,n,r,i){const{name:o}=n[0];if(t==="axisRadar"){const a=r.filter(f=>f.name.startsWith("position")),s=Aht(o);if(o===a.slice(-1)[0].name||s===null)return[null,null];const[l,c]=D2(i);return["center",(c-l)/(a.length-1)*s+l]}if(t==="axisY"&&Oft(i))return fc(i)?["center","horizontal"]:["center","vertical"];if(t==="axisLinear"){const[a]=D2(i);return["center",a]}return t==="axisArc"?e[0]==="inner"?["inner",null]:["outer",null]:Ms(i)?["center",null]:Zf(i)?["center",null]:t==="axisX"&&_ft(i)||t==="axisX"&&Eft(i)?["top",null]:e}function Tht(t,e,n,r,i,o,a){const[s]=D2(a),l=[r.position||e,s!=null?s:n];return typeof t=="string"&&t.startsWith("axis")?Cht(t,l,i,o,a):typeof t=="string"&&t.startsWith("legend")&&Ms(a)&&r.position==="center"?["center","vertical"]:l}function kht(t,e,n=[]){return t==="x"?fc(n)?`${e}Y`:`${e}X`:t==="y"?fc(n)?`${e}X`:`${e}Y`:null}function Lht(t,e,n){const[,r]=pe("component",n),{coordinates:i}=t;function o(a,s,l,c){const u=kht(s,a,i);if(!c||!u)return;const{props:f}=r(u),{defaultPosition:d,defaultSize:h,defaultOrder:p,defaultCrossPadding:[v]}=f;return Object.assign(Object.assign({position:d,defaultSize:h,order:p,type:u,crossPadding:v},c),{scales:[l]})}return e.filter(a=>a.slider||a.scrollbar).flatMap(a=>{const{slider:s,scrollbar:l,name:c}=a;return[o("slider",c,a,s),o("scrollbar",c,a,l)]}).filter(a=>!!a)}function $D(t,e,n,r,i,o){const{type:a}=t;if(!["left","right","bottom","top"].includes(r)||typeof a!="string")return;const l=a;return(l.startsWith("axis")?$ht:l.startsWith("group")?Nht:l.startsWith("legendContinuous")?Fht:l==="legendCategory"?Rht:l.startsWith("slider")?Dht:l==="title"?jht:l.startsWith("scrollbar")?Iht:()=>{})(t,e,n,r,i,o)}function Nht(t,e,n,r,i,o){const{children:a}=t,s=Gt(a,c=>c.crossPadding);a.forEach(c=>c.crossPadding=s),a.forEach(c=>$D(c,e,n,r,i,o));const l=Gt(a,c=>c.size);t.size=l,a.forEach(c=>c.size=l)}function Iht(t,e,n,r,i,o){const{trackSize:a=6}=Z({},i.scrollbar,t);t.size=a}function jht(t,e,n,r,i,o){const a=Z({},i.title,t),{title:s,subtitle:l,spacing:c=0}=a,u=pa(a,["title","subtitle","spacing"]);if(s){const f=ot(u,"title"),d=Av(s,f);t.size=d.height}if(l){const f=ot(u,"subtitle"),d=Av(l,f);t.size+=c+d.height}}function Dht(t,e,n,r,i,o){const a=()=>{const{slider:u}=i;return Z({},u,t)},{trackSize:s,handleIconSize:l}=a(),c=Math.max(s,l*2.4);t.size=c}function $ht(t,e,n,r,i,o){t.transform=t.transform||[{type:"hide"}];const a=r==="left"||r==="right",s=FD(t,r,i),{tickLength:l=0,labelSpacing:c=0,titleSpacing:u=0,labelAutoRotate:f}=s,d=pa(s,["tickLength","labelSpacing","titleSpacing","labelAutoRotate"]),h=Ev(t,o),p=Mv(d,h),v=l+c;if(p&&p.length){const y=Gt(p,b=>b.width),m=Gt(p,b=>b.height);if(a)t.size=y+v;else{const{tickFilter:b,labelTransform:x}=t;Yht(h,p,e,n,b)&&!x&&f!==!1&&f!==null?(t.labelTransform="rotate(90)",t.size=y+v):t.size=m+v}}else t.size=l;const g=Pv(d);g&&(a?t.size+=u+g.width:t.size+=u+g.height)}function Fht(t,e,n,r,i,o){const s=(()=>{const{legendContinuous:x}=i;return Z({},x,t)})(),{labelSpacing:l=0,titleSpacing:c=0}=s,u=pa(s,["labelSpacing","titleSpacing"]),f=r==="left"||r==="right",d=ot(u,"ribbon"),{size:h}=d,p=ot(u,"handleIcon"),{size:v}=p,g=Math.max(h,v*2.4);t.size=g;const y=Ev(t,o),m=Mv(u,y);if(m){const x=f?"width":"height",w=Gt(m,O=>O[x]);t.size+=w+l}const b=Pv(u);b&&(f?t.size=Math.max(t.size,b.width):t.size+=c+b.height)}function Rht(t,e,n,r,i,o){const s=(()=>{const{legendCategory:T}=i,{title:k}=t,[N,j]=Array.isArray(k)?[k,void 0]:[void 0,k];return Z({title:N},T,Object.assign(Object.assign({},t),{title:j}))})(),{itemSpacing:l,itemMarkerSize:c,titleSpacing:u,rowPadding:f,colPadding:d,maxCols:h=1/0,maxRows:p=1/0}=s,v=pa(s,["itemSpacing","itemMarkerSize","titleSpacing","rowPadding","colPadding","maxCols","maxRows"]),{cols:g,length:y}=t,m=T=>Math.min(T,p),b=T=>Math.min(T,h),x=r==="left"||r==="right",w=y===void 0?e+(x?0:n[0]+n[1]):y,O=Pv(v),_=Ev(t,o),S=Mv(v,_,"itemLabel"),E=Math.max(S[0].height,c)+f,M=(T,k=0)=>c+T+l[0]+k;x?(()=>{let T=-1/0,k=0,N=1,j=0,L=-1/0,I=-1/0;const $=O?O.height:0,F=w-$;for(const{width:R}of S){const B=M(R,d);T=Math.max(T,B),k+E>F?(N++,L=Math.max(L,j),I=Math.max(I,k),j=1,k=E):(k+=E,j++)}N<=1&&(L=j,I=k),t.size=T*b(N),t.length=I+$,Z(t,{cols:b(N),gridRow:L})})():typeof g=="number"?(()=>{const T=Math.ceil(S.length/g),k=Gt(S,N=>M(N.width))*g;t.size=E*m(T)-f,t.length=Math.min(k,w)})():(()=>{let T=1,k=0,N=-1/0;for(const{width:j}of S){const L=M(j,d);k+L>w?(N=Math.max(N,k),k=L,T++):k+=L}T===1&&(N=k),t.size=E*m(T)-f,t.length=N})(),O&&(x?t.size=Math.max(t.size,O.width):t.size+=u+O.height)}function Ev(t,e){const[n]=pe("scale",e),{scales:r,tickCount:i,tickMethod:o}=t,a=r.find(s=>s.type!=="constant"&&s.type!=="identity");return i!==void 0&&(a.tickCount=i),o!==void 0&&(a.tickMethod=o),n(a)}function Mv(t,e,n="label"){const{labelFormatter:r,tickFilter:i,label:o=!0}=t,a=pa(t,["labelFormatter","tickFilter","label"]);if(!o)return null;const s=Bht(e,r,i),l=ot(a,n),c=s.map((d,h)=>Object.fromEntries(Object.entries(l).map(([p,v])=>[p,typeof v=="function"?v(d,h):v]))),u=s.map((d,h)=>{const p=c[h];return Av(d,p)});if(!c.some(d=>d.transform)){const d=s.map((h,p)=>p);t.indexBBox=new Map(d.map(h=>[h,[s[h],u[h]]]))}return u}function Pv(t){const e=c=>c===!1||c===null,{title:n}=t,r=pa(t,["title"]);if(e(n)||n===void 0)return null;const i=ot(r,"title"),{direction:o,transform:a}=i,s=Array.isArray(n)?n.join(","):n;return typeof s!="string"?null:Av(s,Object.assign(Object.assign({},i),{transform:a||(o==="vertical"?"rotate(-90)":"")}))}function FD(t,e,n){const{title:r}=t,[i,o]=Array.isArray(r)?[r,void 0]:[void 0,r],{axis:a,[`axis${dm(e)}`]:s}=n;return Z({title:i},a,s,Object.assign(Object.assign({},t),{title:o}))}function RD(t,e){const n=t.getTicks?t.getTicks():t.getOptions().domain;return e?n.filter(e):n}function Bht(t,e,n){const i=RD(t,n).map(a=>typeof a=="number"?Bp(a):a),o=e?typeof e=="string"?sa(e):e:t.getFormatter?t.getFormatter():a=>`${a}`;return i.map(o)}function zht(t,e){return t.getBandWidth?t.getBandWidth(e)/2:0}function Yht(t,e,n,r,i){if(kr(e,h=>h.width)>n)return!0;const a=t.clone();a.update({range:[0,n]});const s=RD(t,i),l=s.map(h=>a.map(h)+zht(a,h)),c=s.map((h,p)=>p),u=-r[0],f=n+r[1],d=(h,p)=>{const{width:v}=p;return[h-v/2,h+v/2]};for(let h=0;h<c.length;h++){const p=l[h],[v,g]=d(p,e[h]);if(v<u||g>f)return!0;const y=l[h+1];if(y){const[m]=d(y,e[h+1]);if(g>m)return!0}}return!1}function Av(t,e){const n=Wht(t),r=pa(e,["filter"]);return n.attr(Object.assign(Object.assign({},r),{visibility:"none"})),n.getBBox()}function Wht(t){return t instanceof Mn?t:new jr({style:{text:`${t}`}})}function Ght(t){const e=t.find(({type:n})=>n==="axisZ");if(e){const n=t.find(({type:i})=>i==="axisX");n.plane="xy";const r=t.find(({type:i})=>i==="axisY");r.plane="xy",e.plane="yz",e.origin=[n.bbox.x,n.bbox.y,0],e.eulerAngles=[0,-90,0],e.bbox.x=n.bbox.x,e.bbox.y=n.bbox.y,t.push(Object.assign(Object.assign({},n),{plane:"xz",showLabel:!1,showTitle:!1,origin:[n.bbox.x,n.bbox.y,0],eulerAngles:[-90,0,0]})),t.push(Object.assign(Object.assign({},r),{plane:"yz",showLabel:!1,showTitle:!1,origin:[r.bbox.x+r.bbox.width,r.bbox.y,0],eulerAngles:[0,-90,0]})),t.push(Object.assign(Object.assign({},e),{plane:"xz",actualPosition:"left",showLabel:!1,showTitle:!1,eulerAngles:[90,-90,0]}))}}function Hht(t,e,n,r){var i,o;const{width:a,height:s,depth:l,x:c=0,y:u=0,z:f=0,inset:d=(i=n.inset)!==null&&i!==void 0?i:0,insetLeft:h=d,insetTop:p=d,insetBottom:v=d,insetRight:g=d,margin:y=(o=n.margin)!==null&&o!==void 0?o:0,marginLeft:m=y,marginBottom:b=y,marginTop:x=y,marginRight:w=y,padding:O=n.padding,paddingBottom:_=O,paddingLeft:S=O,paddingRight:E=O,paddingTop:M=O}=Vht(t,e,n,r),P=1/4,C=(nt,lt,yt,pt,mt)=>{const{marks:Nt}=e;if(Nt.length===0)return[pt,mt];if(nt-pt-mt-nt*P>0)return[pt,mt];const We=nt*(1-P);return[lt==="auto"?We*pt/(pt+mt):pt,yt==="auto"?We*mt/(pt+mt):mt]},A=nt=>nt==="auto"?20:nt!=null?nt:20,T=A(M),k=A(_),N=BD(t,s-T-k,[T+x,k+b],["left","right"],e,n,r),{paddingLeft:j,paddingRight:L}=N,I=a-m-w,[$,F]=C(I,S,E,j,L),R=I-$-F,B=BD(t,R,[$+m,F+w],["bottom","top"],e,n,r),{paddingTop:W,paddingBottom:K}=B,J=s-b-x,[X,V]=C(J,_,M,K,W),it=J-X-V;return{width:a,height:s,depth:l,insetLeft:h,insetTop:p,insetBottom:v,insetRight:g,innerWidth:R,innerHeight:it,paddingLeft:$,paddingRight:F,paddingTop:V,paddingBottom:X,marginLeft:m,marginBottom:b,marginTop:x,marginRight:w,x:c,y:u,z:f}}function Uht(t){const{height:e,width:n,padding:r=0,paddingLeft:i=r,paddingRight:o=r,paddingTop:a=r,paddingBottom:s=r,margin:l=16,marginLeft:c=l,marginRight:u=l,marginTop:f=l,marginBottom:d=l,inset:h=0,insetLeft:p=h,insetRight:v=h,insetTop:g=h,insetBottom:y=h}=t,m=w=>w==="auto"?20:w,b=n-m(i)-m(o)-c-u-p-v,x=e-m(a)-m(s)-f-d-g-y;return{width:b,height:x}}function Vht(t,e,n,r){const{coordinates:i}=e;if(!Ms(i)&&!Zf(i))return e;const o=t.filter(y=>typeof y.type=="string"&&y.type.startsWith("axis"));if(o.length===0)return e;const a=o.map(y=>{const m=y.type==="axisArc"?"arc":"linear";return FD(y,m,n)}),s=Gt(a,y=>{var m;return(m=y.labelSpacing)!==null&&m!==void 0?m:0}),l=o.flatMap((y,m)=>{const b=a[m],x=Ev(y,r);return Mv(b,x)}).filter(ie),c=Gt(l,y=>y.height)+s,u=o.flatMap((y,m)=>{const b=a[m];return Pv(b)}).filter(y=>y!==null),f=u.length===0?0:Gt(u,y=>y.height),{inset:d=c,insetLeft:h=d,insetBottom:p=d,insetTop:v=d+f,insetRight:g=d}=e;return Object.assign(Object.assign({},e),{insetLeft:h,insetBottom:p,insetTop:v,insetRight:g})}function BD(t,e,n,r,i,o,a){const s=xe(t,p=>p.position),{padding:l=o.padding,paddingLeft:c=l,paddingRight:u=l,paddingBottom:f=l,paddingTop:d=l}=i,h={paddingBottom:f,paddingLeft:c,paddingTop:d,paddingRight:u};for(const p of r){const v=`padding${dm(W3(p))}`,g=s.get(p)||[],y=h[v],m=E=>{E.size===void 0&&(E.size=E.defaultSize)},b=E=>{E.type==="group"?(E.children.forEach(m),E.size=Gt(E.children,M=>M.size)):E.size=E.defaultSize},x=E=>{E.size||(y!=="auto"?b(E):($D(E,e,n,p,o,a),m(E)))},w=E=>{E.type.startsWith("axis")&&E.labelAutoHide===void 0&&(E.labelAutoHide=!0)},O=p==="bottom"||p==="top",_=fr(g,E=>E.order),S=g.filter(E=>E.type.startsWith("axis")&&E.order==_);if(S.length&&(S[0].crossPadding=0),typeof y=="number")g.forEach(m),g.forEach(w);else if(g.length===0)h[v]=0;else{const E=O?e+n[0]+n[1]:e,M=DD(g,E);M.forEach(x);const P=M.reduce((C,{size:A,crossPadding:T=12})=>C+A+T,0);h[v]=P}}return h}function Xht(t,e,n){const r=xe(t,O=>`${O.plane||"xy"}-${O.position}`),{paddingLeft:i,paddingRight:o,paddingTop:a,paddingBottom:s,marginLeft:l,marginTop:c,marginBottom:u,marginRight:f,innerHeight:d,innerWidth:h,insetBottom:p,insetLeft:v,insetRight:g,insetTop:y,height:m,width:b,depth:x}=n,w={xy:$2({width:b,height:m,paddingLeft:i,paddingRight:o,paddingTop:a,paddingBottom:s,marginLeft:l,marginTop:c,marginBottom:u,marginRight:f,innerHeight:d,innerWidth:h,insetBottom:p,insetLeft:v,insetRight:g,insetTop:y}),yz:$2({width:x,height:m,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:x,innerHeight:m,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0}),xz:$2({width:b,height:x,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:b,innerHeight:x,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0})};for(const[O,_]of r.entries()){const[S,E]=O.split("-"),M=w[S][E],[P,C]=qE(_,A=>typeof A.type!="string"?!1:!!(E==="center"||A.type.startsWith("axis")&&["inner","outer"].includes(E)));P.length&&qht(P,e,M,E),C.length&&ipt(_,e,M)}}function $2({width:t,height:e,paddingLeft:n,paddingRight:r,paddingTop:i,paddingBottom:o,marginLeft:a,marginTop:s,marginBottom:l,marginRight:c,innerHeight:u,innerWidth:f,insetBottom:d,insetLeft:h,insetRight:p,insetTop:v}){const g=n+a,y=i+s,m=r+c,b=o+l,x=t-a-c,w=[g+h,y+v,f-h-p,u-v-d,"center",null,null];return{top:[g,0,f,y,"vertical",!0,Te,a,x],right:[t-m,y,m,u,"horizontal",!1,Te],bottom:[g,e-b,f,b,"vertical",!1,Te,a,x],left:[0,y,g,u,"horizontal",!0,Te],"top-left":[g,0,f,y,"vertical",!0,Te],"top-right":[g,0,f,y,"vertical",!0,Te],"bottom-left":[g,e-b,f,b,"vertical",!1,Te],"bottom-right":[g,e-b,f,b,"vertical",!1,Te],center:w,inner:w,outer:w}}function qht(t,e,n,r){const[i,o]=qE(t,a=>!!(typeof a.type=="string"&&a.type.startsWith("axis")));Kht(i,e,n,r),opt(o,e,n)}function Kht(t,e,n,r){r==="center"?NH(e)?rpt(t,e,n):ce(e)?Jht(t,e,n):Jh(e)&&tpt(t,e,n,t[0].orientation):r==="inner"?Zht(t,e,n):r==="outer"&&Qht(t,e,n)}function Zht(t,e,n){const[r,i,,o]=n,[a,s]=e.getCenter(),[l]=tp(e),c=o/2,u=l*c,f=a-u,d=s-u;for(let h=0;h<t.length;h++){const p=t[h];p.bbox={x:r+f,y:i+d,width:u*2,height:u*2}}}function Qht(t,e,n){const[r,i,o,a]=n;for(const s of t)s.bbox={x:r,y:i,width:o,height:a}}function Jht(t,e,n){const[r,i,o,a]=n;for(const s of t)s.bbox={x:r,y:i,width:o,height:a}}function tpt(t,e,n,r){r==="horizontal"?npt(t,e,n):r==="vertical"&&ept(t,e,n)}function ept(t,e,n){const[r,i,,o]=n,a=new Array(t.length).fill(0),l=e.map(a).filter((c,u)=>u%2===0).map(c=>c+r);for(let c=0;c<t.length;c++){const u=t[c],f=l[c],d=l[c+1]-f;u.bbox={x:f,y:i,width:d,height:o}}}function npt(t,e,n){const[r,i,o]=n,a=new Array(t.length).fill(0),l=e.map(a).filter((c,u)=>u%2===1).map(c=>c+i);for(let c=0;c<t.length;c++){const u=t[c],f=l[c],d=l[c+1]-f;u.bbox={x:r,y:f,width:o,height:d}}}function rpt(t,e,n,r){const[i,o,a,s]=n;for(const l of t)l.bbox={x:i,y:o,width:a,height:s},l.radar={index:t.indexOf(l),count:t.length}}function ipt(t,e,n){const[r,i,o,a,s,l,c,u,f]=n,[d,h,p,v,g,y,m,b]=s==="vertical"?["y",i,"x",r,"height",a,"width",o]:["x",r,"y",i,"width",o,"height",a];t.sort((E,M)=>c==null?void 0:c(E.order,M.order));const x=E=>E==="title"||E==="group"||E.startsWith("legend"),w=(E,M,P)=>P===void 0?M:x(E)?P:M,O=(E,M,P)=>P===void 0?M:x(E)?P:M,_=l?h+y:h;for(let E=0,M=_;E<t.length;E++){const P=t[E],{crossPadding:C=0,type:A}=P,{size:T}=P;P.bbox={[d]:l?M-T-C:M+C,[p]:O(A,v,u),[g]:T,[m]:w(A,b,f)},M+=(T+C)*(l?-1:1)}const S=t.filter(E=>E.type==="group");for(const E of S){const{bbox:M,children:P}=E,C=M[m],A=C/P.length,T=P.reduce((I,$)=>{var F;const R=(F=$.layout)===null||F===void 0?void 0:F.justifyContent;return R||I},"flex-start"),k=P.map((I,$)=>{const{length:F=A,padding:R=0}=I;return F+($===P.length-1?0:R)}),N=kr(k),j=C-N,L=T==="flex-start"?0:T==="center"?j/2:j;for(let I=0,$=M[p]+L;I<P.length;I++){const F=P[I],{padding:R=0}=F,B=I===P.length-1?0:R;F.bbox={[g]:M[g],[d]:M[d],[p]:$,[m]:k[I]-B},Z(F,{layout:{justifyContent:T}}),$+=k[I]}}}function opt(t,e,n){if(t.length===0)return;const[r,i,o,a]=n,[s]=tp(e),l=a/2*s/Math.sqrt(2),c=r+o/2,u=i+a/2;for(let f=0;f<t.length;f++){const d=t[f];d.bbox={x:c-l,y:u-l,width:l*2,height:l*2}}}var apt=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?o(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})},gc=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function spt(t,e,n){const{encode:r={},scale:i={},transform:o=[]}=e,a=gc(e,["encode","scale","transform"]);return[t,Object.assign(Object.assign({},a),{encode:r,scale:i,transform:o})]}function zD(t,e,n){return apt(this,void 0,void 0,function*(){const{library:r}=n,{data:i}=e,[o]=pe("data",r),a=xpt(i),{transform:s=[]}=a,u=[gc(a,["transform"]),...s].map(o),f=yield VY(u)(i),d=i&&!Array.isArray(i)&&!Array.isArray(f)?{value:f}:f;return[Array.isArray(f)?Ja(f):[],Object.assign(Object.assign({},e),{data:d})]})}function lpt(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i={};for(const[o,a]of Object.entries(r))if(Array.isArray(a))for(let s=0;s<a.length;s++){const l=`${o}${s===0?"":s}`;i[l]=a[s]}else i[o]=a;return[t,Object.assign(Object.assign({},e),{encode:i})]}function cpt(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const o=Uo(r,a=>ypt(a)?a:{type:mpt(i,a),value:a});return[t,Object.assign(Object.assign({},e),{encode:o})]}function upt(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i=Uo(r,(o,a)=>{const{type:s}=o;return s!=="constant"||ght(a)?o:Object.assign(Object.assign({},o),{constant:!0})});return[t,Object.assign(Object.assign({},e),{encode:i})]}function fpt(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const{library:o}=n,a=_pt(o),s=Uo(r,l=>a(i,l));return[t,Object.assign(Object.assign({},e),{encode:s})]}function dpt(t,e,n){const{tooltip:r={}}=e;return io(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:Su(r)&&Q5(r)?[t,Object.assign(Object.assign({},e),{tooltip:r})]:[t,Object.assign(Object.assign({},e),{tooltip:{items:[r]}})]}function hpt(t,e,n){const{data:r,encode:i,tooltip:o={}}=e;if(io(o))return[t,e];const a=f=>{if(!f)return f;if(typeof f=="string")return t.map(d=>({name:f,value:r[d][f]}));if(Su(f)){const{field:d,channel:h,color:p,name:v=d,valueFormatter:g=O=>O}=f,y=typeof g=="string"?sa(g):g,m=h&&i[h],b=m&&i[h].field,x=v||b||h,w=[];for(const O of t){const _=d?r[O][d]:m?i[h].value[O]:null;w[O]={name:x,color:p,value:y(_)}}return w}if(typeof f=="function"){const d=[];for(const h of t){const p=f(r[h],h,r,i);Su(p)?d[h]=p:d[h]={value:p}}return d}return f},{title:s,items:l=[]}=o,c=gc(o,["title","items"]),u=Object.assign({title:a(s),items:Array.isArray(l)?l.map(a):[]},c);return[t,Object.assign(Object.assign({},e),{tooltip:u})]}function ppt(t,e,n){const{encode:r}=e,i=gc(e,["encode"]);if(!r)return[t,e];const o=Object.entries(r),a=o.filter(([,l])=>{const{value:c}=l;return Array.isArray(c[0])}).flatMap(([l,c])=>{const u=[[l,new Array(t.length).fill(void 0)]],{value:f}=c,d=gc(c,["value"]);for(let h=0;h<f.length;h++){const p=f[h];if(Array.isArray(p))for(let v=0;v<p.length;v++){const g=u[v]||[`${l}${v}`,new Array(t).fill(void 0)];g[1][h]=p[v],u[v]=g}}return u.map(([h,p])=>[h,Object.assign({type:"column",value:p},d)])}),s=Object.fromEntries([...o,...a]);return[t,Object.assign(Object.assign({},i),{encode:s})]}function vpt(t,e,n){const{axis:r={},legend:i={},slider:o={},scrollbar:a={}}=e,s=(c,u)=>{if(typeof c=="boolean")return c?{}:null;const f=c[u];return f===void 0||f?f:null},l=typeof r=="object"?Array.from(new Set(["x","y",...Object.keys(r)])):["x","y"];return Z(e,{scale:Object.assign(Object.assign({},Object.fromEntries(l.map(c=>{const u=s(a,c);return[c,Object.assign({guide:s(r,c),slider:s(o,c),scrollbar:u},u&&{ratio:u.ratio===void 0?.5:u.ratio})]}))),{color:{guide:s(i,"color")},size:{guide:s(i,"size")},shape:{guide:s(i,"shape")},opacity:{guide:s(i,"opacity")}})}),[t,e]}function gpt(t,e,n){const{animate:r}=e;return r||r===void 0?[t,e]:(Z(e,{animate:{enter:{type:null},exit:{type:null},update:{type:null}}}),[t,e])}function ypt(t){if(typeof t!="object"||t instanceof Date||t===null)return!1;const{type:e}=t;return ie(e)}function mpt(t,e){return typeof e=="function"?"transform":typeof e=="string"&&bpt(t,e)?"field":"constant"}function bpt(t,e){return Array.isArray(t)?t.some(n=>n[e]!==void 0):!1}function xpt(t){if(Va(t))return{type:"inline",value:t};if(!t)return{type:"inline",value:null};if(Array.isArray(t))return{type:"inline",value:t};const{type:e="inline"}=t,n=gc(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}var YD=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?o(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})},wpt=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function Opt(t,e,n){return YD(this,void 0,void 0,function*(){const r={library:n},[i,o]=yield Spt(t,e,r),{encode:a,scale:s,data:l,tooltip:c}=o;if(Array.isArray(l)===!1)return null;const{channels:u}=e,f=YE(Object.entries(a).filter(([,h])=>ie(h)),h=>h.map(([p,v])=>Object.assign({name:p},v)),([h])=>{var p;const v=(p=/([^\d]+)\d*$/.exec(h))===null||p===void 0?void 0:p[1],g=u.find(y=>y.name===v);return g!=null&&g.independent?h:v}),d=u.filter(h=>{const{name:p,required:v}=h;if(f.find(([g])=>g===p))return!0;if(v)throw new Error(`Missing encoding for channel: ${p}.`);return!1}).flatMap(h=>{const{name:p,scale:v,scaleKey:g,range:y,quantitative:m,ordinal:b}=h;return f.filter(([w])=>w.startsWith(p)).map(([w,O],_)=>{const S=O.some(j=>j.visual),E=O.some(j=>j.constant),M=s[w]||{},{independent:P=!1,key:C=g||w,type:A=E?"constant":S?"identity":v}=M,T=wpt(M,["independent","key","type"]),k=A==="constant",N=k?void 0:y;return{name:w,values:O,scaleKey:P||k?Symbol("independent"):C,scale:Object.assign(Object.assign({type:A,range:N},T),{quantitative:m,ordinal:b})}})});return[o,Object.assign(Object.assign({},e),{index:i,channels:d,tooltip:c})]})}function _pt(t){const[e]=pe("encode",t);return(n,r)=>r===void 0||n===void 0?null:Object.assign(Object.assign({},r),{type:"column",value:e(r)(n),field:Ept(r)})}function Spt(t,e,n){return YD(this,void 0,void 0,function*(){const{library:r}=n,[i]=pe("transform",r),{preInference:o=[],postInference:a=[]}=e,{transform:s=[]}=t,l=[spt,zD,lpt,cpt,upt,fpt,ppt,gpt,vpt,dpt,...o.map(i),...s.map(i),...a.map(i),hpt];let c=[],u=t;for(const f of l)[c,u]=yield f(c,u,n);return[c,u]})}function Ept(t){const{type:e,value:n}=t;return e==="field"&&typeof n=="string"?n:null}var xo=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?o(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})},va=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function F2(t,e,n,r){var i;return xo(this,void 0,void 0,function*(){const[o]=pe("composition",n),[a]=pe("interaction",n),s=new Set(Object.keys(n).map(A=>{var T;return(T=/mark\.(.*)/.exec(A))===null||T===void 0?void 0:T[1]}).filter(ie)),l=new Set(Object.keys(n).map(A=>{var T;return(T=/component\.(.*)/.exec(A))===null||T===void 0?void 0:T[1]}).filter(ie)),c=A=>{const{type:T}=A;if(typeof T=="function"){const{props:k={}}=T,{composite:N=!0}=k;if(N)return"mark"}return typeof T!="string"?T:s.has(T)||l.has(T)?"mark":T},u=A=>c(A)==="mark",f=A=>c(A)==="standardView",d=A=>{const{type:T}=A;return typeof T!="string"?!1:!!l.has(T)},h=A=>{if(f(A))return[A];const T=c(A);return o({type:T,static:d(A)})(A)},p=[],v=new Map,g=new Map,y=[t],m=[];for(;y.length;){const A=y.shift();if(f(A)){const T=g.get(A),[k,N]=T?UD(T,A,n):yield GD(A,n);v.set(k,A),p.push(k);const j=N.flatMap(h).map(L=>Nj(L,n));if(y.push(...j),j.every(f)){const L=yield Promise.all(j.map(I=>HD(I,n)));qdt(L);for(let I=0;I<j.length;I++){const $=j[I],F=L[I];g.set($,F)}}}else{const T=u(A)?A:yield KD(A,n),k=h(T);Array.isArray(k)?y.push(...k):typeof k=="function"&&m.push(k())}}r.emitter.emit(Ut.BEFORE_PAINT);const b=new Map,x=new Map,w=[];e.selectAll(Ui(Ex)).data(p,A=>A.key).join(A=>A.append("g").attr("className",Ex).attr("id",T=>T.key).call(WD).each(function(T,k,N){B2(T,gt(N),w,n,r),b.set(T,N)}),A=>A.call(WD).each(function(T,k,N){B2(T,gt(N),w,n,r),x.set(T,N)}),A=>A.each(function(T,k,N){const j=N.nameInteraction.values();for(const L of j)L.destroy()}).remove());const O=(A,T,k)=>Array.from(A.entries()).map(([N,j])=>{const L=k||new Map,I=(R,B=W=>W)=>L.set(R,B),$=v.get(N),F=Ppt(gt(j),$,n,r);return{view:N,container:j,options:$,setState:I,update:(R,B)=>xo(this,void 0,void 0,function*(){const K=fm(Array.from(L.values()))($);return yield F(K,R,()=>{Bo(B)&&T(A,B,L)})})}}),_=(A=x,T,k)=>{var N;const j=O(A,_,k);for(const L of j){const{options:I,container:$}=L,F=$.nameInteraction;let R=Cv(I);T&&(R=R.filter(B=>T.includes(B[0])));for(const B of R){const[W,K]=B,J=F.get(W);if(J&&((N=J.destroy)===null||N===void 0||N.call(J)),K){const V=R2(L.view,W,K,a)(L,j,r.emitter);F.set(W,{destroy:V})}}}},S=O(b,_);for(const A of S){const{options:T}=A,k=new Map;A.container.nameInteraction=k;for(const N of Cv(T)){const[j,L]=N;if(L){const $=R2(A.view,j,L,a)(A,S,r.emitter);k.set(j,{destroy:$})}}}_();const{width:E,height:M}=t,P=[];for(const A of m){const T=new Promise(k=>xo(this,void 0,void 0,function*(){for(const N of A){const j=Object.assign({width:E,height:M},N);yield F2(j,e,n,r)}k()}));P.push(T)}r.views=p,(i=r.animations)===null||i===void 0||i.forEach(A=>A==null?void 0:A.cancel()),r.animations=w,r.emitter.emit(Ut.AFTER_PAINT);const C=w.filter(ie).map(Ypt).map(A=>A.finished);return Promise.all([...C,...P])})}function WD(t){t.style("transform",e=>`translate(${e.layout.x}, ${e.layout.y})`)}function Mpt(t){const[,e]=pe("interaction",t);return n=>{const[r,i]=n;try{return[r,e(r)]}catch(o){return[r,i.type]}}}function Ppt(t,e,n,r){const i=Mpt(n),o=l=>l[1]&&l[1].props&&l[1].props.reapplyWhenUpdate,s=Cv(e).map(i).filter(o).map(l=>l[0]);return(l,c,u)=>xo(this,void 0,void 0,function*(){const f=[],[d,h]=yield GD(l,n);B2(d,t,f,n,r);for(const p of s.filter(v=>v!==c))Apt(p,t,l,d,n,r);for(const p of h)F2(p,t,n,r);return u(),{options:l,view:d}})}function Apt(t,e,n,r,i,o){var a;const[s]=pe("interaction",i),c=e.node().nameInteraction,u=Cv(n).find(([v])=>v===t),f=c.get(t);if(!f||((a=f.destroy)===null||a===void 0||a.call(f),!u[1]))return;const d=R2(r,t,u[1],s),h={options:n,view:r,container:e.node(),update:v=>Promise.resolve(v)},p=d(h,[],o.emitter);c.set(t,{destroy:p})}function GD(t,e){return xo(this,void 0,void 0,function*(){const n=yield Tpt(t,e),r=Cpt(n);t.interaction=r.interaction,t.coordinate=r.coordinate,t.marks=[...r.marks,...r.components];const i=Nj(r,e),o=yield HD(i,e);return UD(o,i,e)})}function Cpt(t){const{coordinate:e={},interaction:n={},style:r={},marks:i}=t,o=va(t,["coordinate","interaction","style","marks"]),a=i.map(d=>d.coordinate||{}),s=i.map(d=>d.interaction||{}),l=i.map(d=>d.viewStyle||{}),c=[...a,e].reduceRight((d,h)=>Z(d,h),{}),u=[n,...s].reduce((d,h)=>Z(d,h),{}),f=[...l,r].reduce((d,h)=>Z(d,h),{});return Object.assign(Object.assign({},o),{marks:i,coordinate:c,interaction:u,style:f})}function Tpt(t,e){return xo(this,void 0,void 0,function*(){const[n,r]=pe("mark",e),i=new Set(Object.keys(e).map(d=>{var h;return(h=/component\.(.*)/.exec(d))===null||h===void 0?void 0:h[1]}).filter(ie)),{marks:o}=t,a=[],s=[],l=[...o],{width:c,height:u}=Uht(t),f={options:t,width:c,height:u};for(;l.length;){const[d]=l.splice(0,1),h=yield KD(d,e),{type:p=ml("G2Mark type is required."),key:v}=h;if(i.has(p))s.push(h);else{const{props:g={}}=r(p),{composite:y=!0}=g;if(!y)a.push(h);else{const{data:m}=h,b=Object.assign(Object.assign({},h),{data:m&&(Array.isArray(m)?m:m.value)}),x=yield n(b,f),w=Array.isArray(x)?x:[x];l.unshift(...w.map((O,_)=>Object.assign(Object.assign({},O),{key:`${v}-${_}`})))}}}return Object.assign(Object.assign({},t),{marks:a,components:s})})}function HD(t,e){return xo(this,void 0,void 0,function*(){const[n]=pe("theme",e),[,r]=pe("mark",e),{theme:i,marks:o,coordinates:a=[]}=t,s=n(qD(i)),l=new Map;for(const u of o){const{type:f}=u,{props:d={}}=r(f),h=yield Opt(u,d,e);if(h){const[p,v]=h;l.set(p,v)}}const c=xe(Array.from(l.values()).flatMap(u=>u.channels),({scaleKey:u})=>u);for(const u of c.values()){const f=u.reduce((b,{scale:x})=>Z(b,x),{}),{scaleKey:d}=u[0],{values:h}=u[0],p=Array.from(new Set(h.map(b=>b.field).filter(ie))),v=Z({guide:{title:p.length===0?void 0:p},field:p[0]},f),{name:g}=u[0],y=u.flatMap(({values:b})=>b.map(x=>x.value)),m=Object.assign(Object.assign({},Hdt(g,y,v,a,s,e)),{key:d});u.forEach(b=>b.scale=m)}return l})}function R2(t,e,n,r){const i=t.theme,o=typeof e=="string"?i[e]||{}:{};return r(Z(o,Object.assign({type:e},n)))}function UD(t,e,n){const[r]=pe("mark",n),[i]=pe("theme",n),[o]=pe("labelTransform",n),{key:a,frame:s=!1,theme:l,clip:c,style:u={},labelTransform:f=[]}=e,d=i(qD(l)),h=Array.from(t.values()),p=Vdt(h,e),v=_ht(Oht(Upt(Array.from(p),h,t),e,n)),g=Hht(v,e,d,n),y=xft(g,e,n),m=s?Z({mainLineWidth:1,mainStroke:"#000"},u):u;Xht(DD(v),y,g),Ght(v);const b={};for(const O of v){const{scales:_=[]}=O,S=[];for(const E of _){const{name:M}=E,P=ED(E,n);S.push(P),M==="y"&&P.update(Object.assign(Object.assign({},P.getOptions()),{xScale:b.x})),SD(b,{[M]:P})}O.scaleInstances=S}const x=[];for(const[O,_]of t.entries()){const{children:S,dataDomain:E,modifier:M,key:P}=O,{index:C,channels:A,tooltip:T}=_,k=Object.fromEntries(A.map(({name:V,scale:it})=>[V,it])),N=Uo(k,V=>ED(V,n));SD(b,N);const j=Udt(A,N),L=r(O),[I,$,F]=Npt(L(C,N,j,y)),R=E||I.length,B=M?M($,R,g):[],W=V=>{var it,nt;return(nt=(it=T.title)===null||it===void 0?void 0:it[V])===null||nt===void 0?void 0:nt.value},K=V=>T.items.map(it=>it[V]),J=I.map((V,it)=>{const nt=Object.assign({points:$[it],transform:B[it],index:V,markKey:P,viewKey:a},T&&{title:W(V),items:K(V)});for(const[lt,yt]of Object.entries(j))nt[lt]=yt[V],F&&(nt[`series${zo(lt)}`]=F[it].map(pt=>yt[pt]));return F&&(nt.seriesIndex=F[it]),F&&T&&(nt.seriesItems=F[it].map(lt=>K(lt)),nt.seriesTitle=F[it].map(lt=>W(lt))),nt});_.data=J,_.index=I;const X=S==null?void 0:S(J,N,g);x.push(...X||[])}return[{layout:g,theme:d,coordinate:y,markState:t,key:a,clip:c,scale:b,style:m,components:v,labelTransform:fm(f.map(o))},x]}function B2(t,e,n,r,i){return xo(this,void 0,void 0,function*(){const{components:o,theme:a,layout:s,markState:l,coordinate:c,key:u,style:f,clip:d,scale:h}=t,{x:p,y:v,width:g,height:y}=s,m=va(s,["x","y","width","height"]),b=["view","plot","main","content"],x=b.map((L,I)=>I),w=["a","margin","padding","inset"],O=b.map(L=>HE(Object.assign({},a.view,f),L)),_=w.map(L=>ot(m,L)),S=L=>L.style("x",I=>A[I].x).style("y",I=>A[I].y).style("width",I=>A[I].width).style("height",I=>A[I].height).each(function(I,$,F){Vpt(gt(F),O[I])});let E=0,M=0,P=g,C=y;const A=x.map(L=>{const I=_[L],{left:$=0,top:F=0,bottom:R=0,right:B=0}=I;return E+=$,M+=F,P-=$+B,C-=F+R,{x:E,y:M,width:P,height:C}});e.selectAll(Ui(RI)).data(x.filter(L=>ie(O[L])),L=>b[L]).join(L=>L.append("rect").attr("className",RI).style("zIndex",-2).call(S),L=>L.call(S),L=>L.remove());const T=$pt(l),k=T?{duration:T[1]}:!1;for(const[,L]of om(o,I=>`${I.type}-${I.position}`))L.forEach((I,$)=>I.index=$);const N=e.selectAll(Ui(FI)).data(o,L=>`${L.type}-${L.position}-${L.index}`).join(L=>L.append("g").style("zIndex",({zIndex:I})=>I||-1).attr("className",FI).append(I=>jD(Z({animate:k,scale:h},I),c,a,r,l)),L=>L.transition(function(I,$,F){const{preserve:R=!1}=I;if(R)return;const B=jD(Z({animate:k,scale:h},I),c,a,r,l),{attributes:W}=B,[K]=F.childNodes;return K.update(W,!1)})).transitions();n.push(...N.flat().filter(ie));const j=e.selectAll(Ui(Nf)).data([s],()=>u).join(L=>L.append("rect").style("zIndex",0).style("fill","transparent").attr("className",Nf).call(ZD).call(JD,Array.from(l.keys())).call(t$,d),L=>L.call(JD,Array.from(l.keys())).call(I=>T?Hpt(I,T):ZD(I)).call(t$,d)).transitions();n.push(...j.flat());for(const[L,I]of l.entries()){const{data:$}=I,{key:F,class:R,type:B}=L,W=e.select(`#${F}`),K=Bpt(L,I,t,r,i),J=zpt(L,I,t,r),X=Wpt(L,I,t,r),V=Gpt(L,I,t,r),it=Fpt(e,W,R,"element"),nt=W.selectAll(Ui(mo)).selectFacetAll(it).data($,lt=>lt.key,lt=>lt.groupKey).join(lt=>lt.append(K).attr("className",mo).attr("markType",B).transition(function(yt,pt,mt){return J(yt,[mt])}),lt=>lt.call(yt=>{const pt=yt.parent(),mt=XY(Nt=>{const[Yt,me]=Nt.getBounds().min;return[Yt,me]});yt.transition(function(Nt,Yt,me){Rpt(me,pt,mt);const We=K(Nt,Yt),lr=X(Nt,[me],[We]);return lr!==null||(me.nodeName===We.nodeName&&We.nodeName!=="g"?hm(me,We):(me.parentNode.replaceChild(We,me),We.className=mo,We.markType=B,We.__data__=me.__data__)),lr}).attr("markType",B).attr("className",mo)}),lt=>lt.each(function(yt,pt,mt){mt.__removed__=!0}).transition(function(yt,pt,mt){return V(yt,[mt])}).remove(),lt=>lt.append(K).attr("className",mo).attr("markType",B).transition(function(yt,pt,mt){const{__fromElements__:Nt}=mt,Yt=X(yt,Nt,[mt]);return new Fp(Nt,null,mt.parentNode).transition(Yt).remove(),Yt}),lt=>lt.transition(function(yt,pt,mt){const Yt=new Fp([],mt.__toData__,mt.parentNode).append(K).attr("className",mo).attr("markType",B).nodes();return X(yt,[mt],Yt)}).remove()).transitions();n.push(...nt.flat())}kpt(t,e,n,r,i)})}function kpt(t,e,n,r,i){const[o]=pe("labelTransform",r),{markState:a,labelTransform:s}=t,l=e.select(Ui(Sx)).node(),c=new Map,u=new Map,f=Array.from(a.entries()).flatMap(([v,g])=>{const{labels:y=[],key:m}=v,b=Dpt(v,g,t,r,i),x=e.select(`#${m}`).selectAll(Ui(mo)).nodes().filter(w=>!w.__removed__);return y.flatMap((w,O)=>{const _=va(w,["transform"]);return x.flatMap(S=>{const E=Lpt(_,O,S);return E.forEach(M=>{c.set(M,b),u.set(M,w)}),E})})}),d=gt(l).selectAll(Ui(Mx)).data(f,v=>v.key).join(v=>v.append(g=>c.get(g)(g)).attr("className",Mx),v=>v.each(function(g,y,m){const x=c.get(g)(g);hm(m,x)}),v=>v.remove()).nodes(),h=xe(d,v=>u.get(v.__data__)),{coordinate:p}=t;for(const[v,g]of h){const{transform:y=[]}=v;fm(y.map(o))(g,p)}s&&s(d,p)}function Lpt(t,e,n){const{seriesIndex:r,seriesKey:i,points:o,key:a,index:s}=n.__data__,l=jpt(n);if(!r)return[Object.assign(Object.assign({},t),{key:`${a}-${e}`,bounds:l,index:s,points:o,dependentElement:n})];const c=Ipt(t),u=r.map((f,d)=>Object.assign(Object.assign({},t),{key:`${i[d]}-${e}`,bounds:[o[d]],index:f,points:o,dependentElement:n}));return c?c(u):u}function Npt([t,e,n]){if(n)return[t,e,n];const r=[],i=[];for(let o=0;o<t.length;o++){const a=t[o],s=e[o];s.every(([l,c])=>ie(l)&&ie(c))&&(r.push(a),i.push(s))}return[r,i]}function Ipt(t){const{selector:e}=t;if(!e)return null;if(typeof e=="function")return e;if(e==="first")return n=>[n[0]];if(e==="last")return n=>[n[n.length-1]];throw new Error(`Unknown selector: ${e}`)}function jpt(t){const e=t.cloneNode(),n=t.getAnimations();e.style.visibility="hidden",n.forEach(a=>{const s=a.effect.getKeyframes();e.attr(s[s.length-1])}),t.parentNode.appendChild(e);const r=e.getLocalBounds();e.destroy();const{min:i,max:o}=r;return[i,o]}function Dpt(t,e,n,r,i){const[o]=pe("shape",r),{data:a}=t,{data:s,defaultLabelShape:l}=e,c=s.map(h=>h.points),{theme:u,coordinate:f}=n,d=Object.assign(Object.assign({},i),{document:kj(i),theme:u,coordinate:f});return h=>{const{index:p,points:v}=h,g=a[p],{formatter:y=k=>`${k}`,transform:m,style:b,render:x}=h,w=va(h,["formatter","transform","style","render"]),O=Uo(Object.assign(Object.assign({},w),b),k=>VD(k,g,p,a)),{shape:_=l,text:S}=O,E=va(O,["shape","text"]),M=typeof y=="string"?sa(y):y,P=Object.assign(Object.assign({},E),{text:M(S,g,p,a),datum:g}),C=Object.assign({type:`label.${_}`,render:x},E),A=o(C,d),T=XD(u,"label",_,"label");return A(v,P,T,c)}}function VD(t,e,n,r){return typeof t=="function"?t(e,n,r):typeof t!="string"?t:e[t]!==void 0?e[t]:t}function $pt(t){let e=-1/0,n=1/0;for(const[r,i]of t){const{animate:o={}}=r,{data:a}=i,{enter:s={},update:l={},exit:c={}}=o,{type:u,duration:f=300,delay:d=0}=l,{type:h,duration:p=300,delay:v=0}=s,{type:g,duration:y=300,delay:m=0}=c;for(const b of a){const{updateType:x=u,updateDuration:w=f,updateDelay:O=d,enterType:_=h,enterDuration:S=p,enterDelay:E=v,exitDuration:M=y,exitDelay:P=m,exitType:C=g}=b;(x===void 0||x)&&(e=Math.max(e,w+O),n=Math.min(n,O)),(C===void 0||C)&&(e=Math.max(e,M+P),n=Math.min(n,P)),(_===void 0||_)&&(e=Math.max(e,S+E),n=Math.min(n,E))}}return e===-1/0?null:[n,e-n]}function Fpt(t,e,n,r){return t.node().parentElement.findAll(o=>o.style.facet!==void 0&&o.style.facet===n&&o!==e.node()).flatMap(o=>o.getElementsByClassName(r))}function Rpt(t,e,n){if(!t.__facet__)return;const r=t.parentNode.parentNode,i=e.parentNode,[o,a]=n(r),[s,l]=n(i),c=`translate(${o-s}, ${a-l})`;qY(t,c),e.append(t)}function Bpt(t,e,n,r,i){const[o]=pe("shape",r),{data:a}=t,{defaultShape:s,data:l,shape:c}=e,u=l.map(g=>g.points),{theme:f,coordinate:d}=n,{type:h,style:p={}}=t,v=Object.assign(Object.assign({},i),{document:kj(i),coordinate:d,theme:f});return g=>{const{shape:y=s}=p,{shape:m=y,points:b,seriesIndex:x,index:w}=g,O=va(g,["shape","points","seriesIndex","index"]),_=Object.assign(Object.assign({},O),{index:w}),S=x?x.map(A=>a[A]):a[w],E=x||w,M=Uo(p,A=>VD(A,S,E,a)),P=c[m]?c[m](M,v):o(Object.assign(Object.assign({},M),{type:QD(t,m)}),v),C=XD(f,h,m,s);return P(b,_,C,u)}}function XD(t,e,n,r){if(typeof e!="string")return;const{color:i}=t,o=t[e]||{},a=o[n]||o[r];return Object.assign({color:i},a)}function z2(t,e,n,r,i){var o,a;const[,s]=pe("shape",i),[l]=pe("animation",i),{defaultShape:c,shape:u}=n,{theme:f,coordinate:d}=r,p=`default${zo(t)}Animation`,{[p]:v}=((o=u[c])===null||o===void 0?void 0:o.props)||s(QD(e,c)).props,{[t]:g={}}=f,y=((a=e.animate)===null||a===void 0?void 0:a[t])||{},m={coordinate:d};return(b,x,w)=>{const{[`${t}Type`]:O,[`${t}Delay`]:_,[`${t}Duration`]:S,[`${t}Easing`]:E}=b,M=Object.assign({type:O||v},y);if(!M.type)return null;const A=l(M,m)(x,w,Z(g,{delay:_,duration:S,easing:E}));return Array.isArray(A)?A:[A]}}function zpt(t,e,n,r){return z2("enter",t,e,n,r)}function Ypt(t){return t.finished.then(()=>{t.cancel()}),t}function Wpt(t,e,n,r){return z2("update",t,e,n,r)}function Gpt(t,e,n,r){return z2("exit",t,e,n,r)}function qD(t={}){if(typeof t=="string")return{type:t};const{type:e="light"}=t,n=va(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}function Cv(t){const e={event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},{interaction:n={}}=t;return Object.entries(Z(e,n)).reverse()}function KD(t,e){return xo(this,void 0,void 0,function*(){const n={library:e},{data:r}=t,i=va(t,["data"]);if(r==null)return t;const[,{data:o}]=yield zD([],{data:r},n);return Object.assign({data:o},i)})}function ZD(t){t.style("x",e=>e.paddingLeft+e.marginLeft).style("y",e=>e.paddingTop+e.marginTop).style("width",e=>e.innerWidth).style("height",e=>e.innerHeight)}function Hpt(t,e){const[n,r]=e;t.transition(function(i,o,a){const{x:s,y:l,width:c,height:u}=a.style,{paddingLeft:f,paddingTop:d,innerWidth:h,innerHeight:p,marginLeft:v,marginTop:g}=i,y=[{x:s,y:l,width:c,height:u},{x:f+v,y:d+g,width:h,height:p}];return a.animate(y,{delay:n,duration:r,fill:"both"})})}function QD(t,e){const{type:n}=t;return typeof e=="string"?`${n}.${e}`:e}function JD(t,e){const n=o=>o.class!==void 0?`${o.class}`:"";t.nodes().length===0||(t.selectAll(Ui($I)).data(e,o=>o.key).join(o=>o.append("g").attr("className",$I).attr("id",a=>a.key).style("facet",n).style("fill","transparent").style("zIndex",a=>{var s;return(s=a.zIndex)!==null&&s!==void 0?s:0}),o=>o.style("facet",n).style("fill","transparent").style("zIndex",a=>{var s;return(s=a.zIndex)!==null&&s!==void 0?s:0}),o=>o.remove()),t.select(Ui(Sx)).node())||t.append("g").attr("className",Sx).style("zIndex",0)}function Ui(...t){return t.map(e=>`.${e}`).join("")}function t$(t,e){t.node()&&t.style("clipPath",n=>{if(!e)return null;const{paddingTop:r,paddingLeft:i,marginLeft:o,marginTop:a,innerWidth:s,innerHeight:l}=n;return new hs({style:{x:i+o,y:r+a,width:s,height:l}})})}function Upt(t,e,n){var r;for(const[c]of n.entries())if(c.type==="cell")return t.filter(u=>u.name!=="shape");if(e.length!==1||t.some(c=>c.name==="shape"))return t;const{defaultShape:i}=e[0];if(!["point","line","rect","hollow"].includes(i))return t;const a={point:"point",line:"hyphen",rect:"square",hollow:"hollow"},l={field:((r=t.find(c=>c.name==="color"))===null||r===void 0?void 0:r.field)||null,name:"shape",type:"constant",domain:[],range:[a[i]]};return[...t,l]}function Vpt(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}function Xpt(t){const e=Z({},t),n=new Map([[e,null]]),r=new Map([[null,-1]]),i=[e];for(;i.length;){const o=i.shift();if(o.key===void 0){const s=n.get(o),l=r.get(o),c=s===null?"0":`${s.key}-${l}`;o.key=c}const{children:a=[]}=o;if(Array.isArray(a))for(let s=0;s<a.length;s++){const l=Z({},a[s]);a[s]=l,n.set(l,o),r.set(l,s),i.push(l)}}return e}function qpt(t,e){const n=new UI;return n.registerPlugin(new VI),new AC({width:t,height:e,container:document.createElement("div"),renderer:n})}function Kpt(t,e={},n=()=>{},r=i=>{throw i}){const{width:i=640,height:o=480,depth:a=0}=t,s=Xpt(t),{canvas:l=qpt(i,o),emitter:c=new Ax,library:u}=e;e.canvas=l,e.emitter=c;const{width:f,height:d}=l.getConfig();(f!==i||d!==o)&&l.resize(i,o),c.emit(Ut.BEFORE_RENDER);const h=gt(l.document.documentElement);return l.ready.then(()=>F2(Object.assign(Object.assign({},s),{width:i,height:o,depth:a}),h,u,e)).then(()=>{if(a){const[p,v]=l.document.documentElement.getPosition();l.document.documentElement.setPosition(p,v,-a/2)}l.requestAnimationFrame(()=>{c.emit(Ut.AFTER_RENDER),n==null||n()})}).catch(p=>{r==null||r(p)}),Qpt(l.getConfig().container)}function e$(t,e={},n=!1){const{canvas:r,emitter:i}=e;r&&(Zpt(r),n?r.destroy():r.destroyChildren()),i.off()}function Zpt(t){const e=t.getRoot().querySelectorAll(`.${Ex}`);e==null||e.forEach(n=>{const{nameInteraction:r=new Map}=n;(r==null?void 0:r.size)>0&&Array.from(r==null?void 0:r.values()).forEach(i=>{i==null||i.destroy()})})}function Qpt(t){return typeof t=="string"?document.getElementById(t):t}const Jpt={visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1};function t0t(t,e){var n;return(n=t.style[e])!==null&&n!==void 0?n:Jpt[e]}function Y2(t,e,n,r){t.style[e]=n,r&&t.children.forEach(i=>Y2(i,e,n,r))}function W2(t){Y2(t,"visibility","hidden",!0)}function G2(t){Y2(t,"visibility","visible",!0)}var ed=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function ga(t){return gt(t).selectAll(`.${mo}`).nodes().filter(e=>!e.__removed__)}function n$(t,e){return H2(t,e).flatMap(({container:n})=>ga(n))}function H2(t,e){return e.filter(n=>n!==t&&n.options.parentKey===t.options.key)}function wo(t){return gt(t).select(`.${Nf}`).node()}function r$(t){if(t.nodeName!=="rect")return t.getRenderBounds();const{x:e,y:n,width:r,height:i}=t.style;return{min:[e,n],max:[e+r,n+i]}}function U2(t,e){const{offsetX:n,offsetY:r}=e,i=r$(t),{min:[o,a],max:[s,l]}=i,c=n<o||n>s,u=r<a||r>l;return c||u?null:[n-o,r-a]}function V2(t,e){const{offsetX:n,offsetY:r}=e,[i,o,a,s]=e0t(t);return[Math.min(a,Math.max(i,n))-i,Math.min(s,Math.max(o,r))-o]}function e0t(t){const e=t.getRenderBounds(),{min:[n,r],max:[i,o]}=e;return[n,r,i,o]}function i$(t){return e=>e.__data__.color}function X2(t){return e=>e.__data__.x}function ks(t){const e=Array.isArray(t)?t:[t],n=new Map(e.flatMap(r=>Array.from(r.markState.keys()).map(o=>[Tv(r.key,o.key),o.data])));return r=>{const{index:i,markKey:o,viewKey:a}=r.__data__;return n.get(Tv(a,o))[i]}}function Oo(t,e=(r,i)=>r,n=(r,i,o)=>r.setAttribute(i,o)){const r="__states__",i="__ordinal__",o=u=>{const{[r]:f=[],[i]:d={}}=u,h=f.reduce((p,v)=>Object.assign(Object.assign({},p),t[v]),d);if(Object.keys(h).length!==0){for(const[p,v]of Object.entries(h)){const g=t0t(u,p),y=e(v,u);n(u,p,y),p in d||(d[p]=g)}u[i]=d}},a=u=>{u[r]||(u[r]=[])};return{setState:(u,...f)=>{a(u),u[r]=[...f],o(u)},removeState:(u,...f)=>{a(u);for(const d of f){const h=u[r].indexOf(d);h!==-1&&u[r].splice(h,1)}o(u)},hasState:(u,f)=>(a(u),u[r].indexOf(f)!==-1)}}function n0t(t){return t===void 0?!0:typeof t!="object"?!1:Object.keys(t).length===0}function Tv(t,e){return`${t},${e}`}function yc(t,e){const r=(Array.isArray(t)?t:[t]).flatMap(o=>o.marks.map(a=>[Tv(o.key,a.key),a.state])),i={};for(const o of e){const[a,s]=Array.isArray(o)?o:[o,{}];i[a]=r.reduce((l,c)=>{const[u,f={}]=c,d=n0t(f[a])?s:f[a];for(const[h,p]of Object.entries(d)){const v=l[h],g=(y,m,b,x)=>{const w=Tv(x.__data__.viewKey,x.__data__.markKey);return u!==w?v==null?void 0:v(y,m,b,x):typeof p!="function"?p:p(y,m,b,x)};l[h]=g}return l},{})}return i}function nd(t,e){const n=new Map(t.map((i,o)=>[i,o])),r=e?t.map(e):t;return(i,o)=>{if(typeof i!="function")return i;const a=n.get(o),s=e?e(o):o;return i(s,a,r,o)}}function o$(t){var{link:e=!1,valueof:n=(u,f)=>u,coordinate:r}=t,i=ed(t,["link","valueof","coordinate"]);const o="element-link";if(!e)return[()=>{},()=>{}];const a=u=>u.__data__.points,s=(u,f)=>{const[,d,h]=u,[p,,,v]=f;return[d,p,v,h]};return[u=>{var f;if(u.length<=1)return;const d=ro(u,(h,p)=>{const{x:v}=h.__data__,{x:g}=p.__data__;return v-g});for(let h=1;h<d.length;h++){const p=Nr(),v=d[h-1],g=d[h],[y,m,b,x]=s(a(v),a(g));p.moveTo(...y),p.lineTo(...m),p.lineTo(...b),p.lineTo(...x),p.closePath();const w=Uo(i,E=>n(E,v)),{fill:O=v.getAttribute("fill")}=w,_=ed(w,["fill"]),S=new Dn({className:o,style:Object.assign({d:p.toString(),fill:O,zIndex:-2},_)});(f=v.link)===null||f===void 0||f.remove(),v.parentNode.appendChild(S),v.link=S}},u=>{var f;(f=u.link)===null||f===void 0||f.remove(),u.link=null}]}function a$(t,e,n){const r=i=>{const{transform:o}=t.style;return o?`${o} ${i}`:i};if(ce(n)){const{points:i}=t.__data__,[o,a]=he(n)?zp(i):i,s=n.getCenter(),l=ke(o,s),c=ke(a,s),u=Lr(l),f=yP(l,c),d=u+f/2,h=e*Math.cos(d),p=e*Math.sin(d);return r(`translate(${h}, ${p})`)}return he(n)?r(`translate(${e}, 0)`):r(`translate(0, ${-e})`)}function s$(t){var{document:e,background:n,scale:r,coordinate:i,valueof:o}=t,a=ed(t,["document","background","scale","coordinate","valueof"]);const s="element-background";if(!n)return[()=>{},()=>{}];const l=(y,m,b)=>{const x=y.invert(m),w=m+y.getBandWidth(x)/2,O=y.getStep(x)/2,_=O*b;return[w-O+_,w+O-_]},c=(y,m)=>{const{x:b}=r;if(!Tf(b))return[0,1];const{__data__:x}=y,{x:w}=x,[O,_]=l(b,w,m);return[O,_]},u=(y,m)=>{const{y:b}=r;if(!Tf(b))return[0,1];const{__data__:x}=y,{y:w}=x,[O,_]=l(b,w,m);return[O,_]},f=(y,m)=>{const{padding:b}=m,[x,w]=c(y,b),[O,_]=u(y,b),S=[[x,O],[w,O],[w,_],[x,_]].map(C=>i.map(C)),{__data__:E}=y,{y:M,y1:P}=E;return qC(e,S,{y:M,y1:P},i,m)},d=(y,m)=>{const{transform:b="scale(1.2, 1.2)",transformOrigin:x="center center",stroke:w=""}=m,O=ed(m,["transform","transformOrigin","stroke"]),_=Object.assign({transform:b,transformOrigin:x,stroke:w},O),S=y.cloneNode(!0);for(const[E,M]of Object.entries(_))S.style[E]=M;return S},h=()=>{const{x:y,y:m}=r;return[y,m].some(Tf)};return[y=>{y.background&&y.background.remove();const m=Uo(a,C=>o(C,y)),{fill:b="#CCD6EC",fillOpacity:x=.3,zIndex:w=-2,padding:O=.001,strokeWidth:_=0}=m,S=ed(m,["fill","fillOpacity","zIndex","padding","strokeWidth"]),E=Object.assign(Object.assign({},S),{fill:b,fillOpacity:x,zIndex:w,padding:O,strokeWidth:_}),P=(h()?f:d)(y,E);P.className=s,y.parentNode.parentNode.appendChild(P),y.background=P},y=>{var m;(m=y.background)===null||m===void 0||m.remove(),y.background=null},y=>y.className===s]}function ya(t,e){const r=t.getRootNode().defaultView.getContextService().getDomElement();r!=null&&r.style&&(t.cursor=r.style.cursor,r.style.cursor=e)}function r0t(t){ya(t,t.cursor)}function q2(t,e,n){return t.find(r=>Object.entries(e).every(([i,o])=>n(r)[i]===o))}var i0t=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function o0t(t,{elements:e,datum:n,groupKey:r=f=>f,link:i=!1,background:o=!1,delay:a=60,scale:s,coordinate:l,emitter:c,state:u={}}){var f;const d=e(t),h=new Set(d),p=xe(d,r),v=nd(d,n),[g,y]=o$(Object.assign({elements:d,valueof:v,link:i,coordinate:l},ot(u.active,"link"))),[m,b,x]=s$(Object.assign({document:t.ownerDocument,scale:s,coordinate:l,background:o,valueof:v},ot(u.active,"background"))),w=Z(u,{active:Object.assign({},((f=u.active)===null||f===void 0?void 0:f.offset)&&{transform:(...j)=>{const L=u.active.offset(...j),[,I]=j;return a$(d[I],L,l)}})}),{setState:O,removeState:_,hasState:S}=Oo(w,v);let E;const M=j=>{const{target:L,nativeEvent:I=!0}=j;if(!h.has(L))return;E&&clearTimeout(E);const $=r(L),F=p.get($),R=new Set(F);for(const B of d)R.has(B)?S(B,"active")||O(B,"active"):(O(B,"inactive"),y(B)),B!==L&&b(B);m(L),g(F),I&&c.emit("element:highlight",{nativeEvent:I,data:{data:n(L),group:F.map(n)}})},P=()=>{E&&clearTimeout(E),E=setTimeout(()=>{C(),E=null},a)},C=(j=!0)=>{for(const L of d)_(L,"active","inactive"),b(L),y(L);j&&c.emit("element:unhighlight",{nativeEvent:j})},A=j=>{const{target:L}=j;o&&!x(L)||!o&&!h.has(L)||(a>0?P():C())},T=()=>{C()};t.addEventListener("pointerover",M),t.addEventListener("pointerout",A),t.addEventListener("pointerleave",T);const k=j=>{const{nativeEvent:L}=j;L||C(!1)},N=j=>{const{nativeEvent:L}=j;if(L)return;const{data:I}=j.data,$=q2(d,I,n);$&&M({target:$,nativeEvent:!1})};return c.on("element:highlight",N),c.on("element:unhighlight",k),()=>{t.removeEventListener("pointerover",M),t.removeEventListener("pointerout",A),t.removeEventListener("pointerleave",T),c.off("element:highlight",N),c.off("element:unhighlight",k);for(const j of d)b(j),y(j)}}function kv(t){var{delay:e,createGroup:n,background:r=!1,link:i=!1}=t,o=i0t(t,["delay","createGroup","background","link"]);return(a,s,l)=>{const{container:c,view:u,options:f}=a,{scale:d,coordinate:h}=u,p=wo(c);return o0t(p,Object.assign({elements:ga,datum:ks(u),groupKey:n?n(u):void 0,coordinate:h,scale:d,state:yc(f,[["active",r?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:r,link:i,delay:e,emitter:l},o))}}kv.props={reapplyWhenUpdate:!0};function l$(t){return kv(Object.assign(Object.assign({},t),{createGroup:X2}))}l$.props={reapplyWhenUpdate:!0};function c$(t){return kv(Object.assign(Object.assign({},t),{createGroup:i$}))}c$.props={reapplyWhenUpdate:!0};var a0t=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function s0t(t,{elements:e,datum:n,groupKey:r=f=>f,link:i=!1,single:o=!1,coordinate:a,background:s=!1,scale:l,emitter:c,state:u={}}){var f;const d=e(t),h=new Set(d),p=xe(d,r),v=nd(d,n),[g,y]=o$(Object.assign({link:i,elements:d,valueof:v,coordinate:a},ot(u.selected,"link"))),[m,b]=s$(Object.assign({document:t.ownerDocument,background:s,coordinate:a,scale:l,valueof:v},ot(u.selected,"background"))),x=Z(u,{selected:Object.assign({},((f=u.selected)===null||f===void 0?void 0:f.offset)&&{transform:(...T)=>{const k=u.selected.offset(...T),[,N]=T;return a$(d[N],k,a)}})}),{setState:w,removeState:O,hasState:_}=Oo(x,v),S=(T=!0)=>{for(const k of d)O(k,"selected","unselected"),y(k),b(k);T&&c.emit("element:unselect",{nativeEvent:!0})},E=(T,k,N=!0)=>{if(_(k,"selected"))S();else{const j=r(k),L=p.get(j),I=new Set(L);for(const $ of d)I.has($)?w($,"selected"):(w($,"unselected"),y($)),$!==k&&b($);if(g(L),m(k),!N)return;c.emit("element:select",Object.assign(Object.assign({},T),{nativeEvent:N,data:{data:[n(k),...L.map(n)]}}))}},M=(T,k,N=!0)=>{const j=r(k),L=p.get(j),I=new Set(L);if(_(k,"selected")){if(!d.some(F=>!I.has(F)&&_(F,"selected")))return S();for(const F of L)w(F,"unselected"),y(F),b(F)}else{const $=L.some(F=>_(F,"selected"));for(const F of d)I.has(F)?w(F,"selected"):_(F,"selected")||w(F,"unselected");!$&&i&&g(L),m(k)}N&&c.emit("element:select",Object.assign(Object.assign({},T),{nativeEvent:N,data:{data:d.filter($=>_($,"selected")).map(n)}}))},P=T=>{const{target:k,nativeEvent:N=!0}=T;return h.has(k)?o?E(T,k,N):M(T,k,N):S()};t.addEventListener("click",P);const C=T=>{const{nativeEvent:k,data:N}=T;if(k)return;const j=o?N.data.slice(0,1):N.data;for(const L of j){const I=q2(d,L,n);P({target:I,nativeEvent:!1})}},A=()=>{S(!1)};return c.on("element:select",C),c.on("element:unselect",A),()=>{for(const T of d)y(T);t.removeEventListener("click",P),c.off("element:select",C),c.off("element:unselect",A)}}function Lv(t){var{createGroup:e,background:n=!1,link:r=!1}=t,i=a0t(t,["createGroup","background","link"]);return(o,a,s)=>{const{container:l,view:c,options:u}=o,{coordinate:f,scale:d}=c,h=wo(l);return s0t(h,Object.assign({elements:ga,datum:ks(c),groupKey:e?e(c):void 0,coordinate:f,scale:d,state:yc(u,[["selected",n?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:n,link:r,emitter:s},i))}}Lv.props={reapplyWhenUpdate:!0};function u$(t){return Lv(Object.assign(Object.assign({},t),{createGroup:X2}))}u$.props={reapplyWhenUpdate:!0};function f$(t){return Lv(Object.assign(Object.assign({},t),{createGroup:i$}))}f$.props={reapplyWhenUpdate:!0};var l0t=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?o(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})},c0t=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function u0t(t){const{transform:e=[]}=t,n=e.find(i=>i.type==="normalizeY");if(n)return n;const r={type:"normalizeY"};return e.push(r),t.transform=e,r}function f0t(t,e,n){const[r]=Array.from(t.entries()).filter(([i])=>i.type===e).map(([i])=>{const{encode:o}=i,a=s=>{const l=o[s];return[s,l?l.value:void 0]};return Object.fromEntries(n.map(a))});return r}function d$(t){var{wait:e=20,leading:n,trailing:r=!1,labelFormatter:i=a=>`${a}`}=t,o=c0t(t,["wait","leading","trailing","labelFormatter"]);return a=>{const{view:s,container:l,update:c,setState:u}=a,{markState:f,scale:d,coordinate:h}=s,p=f0t(f,"line",["x","y","series"]);if(!p)return;const{y:v,x:g,series:y=[]}=p,m=v.map((j,L)=>L),b=ro(m.map(j=>g[j])),x=wo(l),w=l.getElementsByClassName(mo),O=l.getElementsByClassName(Mx),S=xe(O,j=>j.__data__.key.split("-")[0]),E=new rf({style:Object.assign({x1:0,y1:0,x2:0,y2:x.getAttribute("height"),stroke:"black",lineWidth:1},ot(o,"rule"))}),M=new jr({style:Object.assign({x:0,y:x.getAttribute("height"),text:"",fontSize:10},ot(o,"label"))});E.append(M),x.appendChild(E);const P=(j,L,I)=>{const[$]=j.invert(I),F=L.invert($);return b[_Y(b,F)]},C=(j,L)=>{E.setAttribute("x1",j[0]),E.setAttribute("x2",j[0]),M.setAttribute("text",i(L))};let A;const T=j=>l0t(this,void 0,void 0,function*(){const{x:L}=d,I=P(h,L,j);C(j,I),u("chartIndex",F=>{const R=Z({},F),B=R.marks.find(V=>V.type==="line"),K=Gt(am(m,V=>Gt(V,it=>+v[it])/fr(V,it=>+v[it]),V=>y[V]).values()),J=[1/K,K];Z(B,{scale:{y:{domain:J}}});const X=u0t(B);X.groupBy="color",X.basis=(V,it)=>{const nt=V[vl(lt=>g[+lt]).center(V,I)];return it[nt]};for(const V of R.marks)V.animate=!1;return R}),A=(yield c("chartIndex")).view}),k=j=>{const{scale:L,coordinate:I}=A,{x:$,y:F}=L,R=P(I,$,j);C(j,R);for(const B of w){const{seriesIndex:W,key:K}=B.__data__,J=W[vl(pt=>g[+pt]).center(W,R)],X=[0,F.map(1)],V=[0,F.map(v[J]/v[W[0]])],[,it]=I.map(X),[,nt]=I.map(V),lt=it-nt;B.setAttribute("transform",`translate(0, ${lt})`);const yt=S.get(K)||[];for(const pt of yt)pt.setAttribute("dy",lt)}},N=Xa(j=>{const L=U2(x,j);L&&k(L)},e,{leading:n,trailing:r});return T([0,0]),x.addEventListener("pointerenter",N),x.addEventListener("pointermove",N),x.addEventListener("pointerleave",N),()=>{E.remove(),x.removeEventListener("pointerenter",N),x.removeEventListener("pointermove",N),x.removeEventListener("pointerleave",N)}}}d$.props={reapplyWhenUpdate:!0};function d0t(t){const{coordinate:e={}}=t,{transform:n=[]}=e,r=n.find(o=>o.type==="fisheye");if(r)return r;const i={type:"fisheye"};return n.push(i),e.transform=n,t.coordinate=e,i}function h0t({wait:t=30,leading:e,trailing:n=!1}){return r=>{const{options:i,update:o,setState:a,container:s}=r,l=wo(s),c=Xa(u=>{const f=U2(l,u);if(!f){a("fisheye"),o();return}a("fisheye",d=>{const h=Z({},d,{interaction:{tooltip:{preserve:!0}}});for(const y of h.marks)y.animate=!1;const[p,v]=f,g=d0t(h);return g.focusX=p,g.focusY=v,g.visual=!0,h}),o()},t,{leading:e,trailing:n});return l.addEventListener("pointerenter",c),l.addEventListener("pointermove",c),l.addEventListener("pointerleave",c),()=>{l.removeEventListener("pointerenter",c),l.removeEventListener("pointermove",c),l.removeEventListener("pointerleave",c)}}}var rd=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function Nv(t,e){return e?typeof e=="string"?document.querySelector(e):e:t.ownerDocument.defaultView.getContextService().getDomElement().parentElement}function p0t(t){const e=t.getRenderBounds(),{min:[n,r],max:[i,o]}=e;return{x:n,y:r,width:i-n,height:o-r}}function v0t(t,e){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return{x:n.x-r.x,y:n.y-r.y}}function g0t(t,e,n,r,i,o,a,s={}){const l={".g2-tooltip":{},".g2-tooltip-title":{overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}},c=new Vtt({className:"tooltip",style:{x:e,y:n,container:a,data:[],bounding:o,position:r,enterable:i,title:"",offset:[10,10],template:{prefixCls:"g2-"},style:Z(l,s)}});return t.appendChild(c.HTMLTooltipElement),c}function h$({root:t,data:e,x:n,y:r,render:i,event:o,single:a,position:s="right-bottom",enterable:l=!1,css:c,mount:u,bounding:f}){const d=Nv(t,u),h=Nv(t),p=a?h:t,v=f||p0t(t),g=v0t(h,d),{tooltipElement:y=g0t(d,n,r,s,l,v,g,c)}=p,{items:m,title:b=""}=e;y.update(Object.assign({x:n,y:r,data:m,title:b,position:s,enterable:l},i!==void 0&&{content:i(o,{items:m,title:b})})),p.tooltipElement=y}function ma({root:t,single:e,emitter:n,nativeEvent:r=!0,event:i=null}){r&&n.emit("tooltip:hide",{nativeEvent:r});const o=Nv(t),a=e?o:t,{tooltipElement:s}=a;s&&s.hide(i==null?void 0:i.clientX,i==null?void 0:i.clientY)}function K2({root:t,single:e}){const n=Nv(t),r=e?n:t;if(!r)return;const{tooltipElement:i}=r;i&&(i.destroy(),r.tooltipElement=void 0)}function p$(t){const{value:e}=t;return Object.assign(Object.assign({},t),{value:e===void 0?"undefined":e})}function y0t(t){const{__data__:e}=t,{title:n,items:r=[]}=e,i=r.filter(ie).map(o=>{var{color:a=v$(t)}=o,s=rd(o,["color"]);return Object.assign(Object.assign({},s),{color:a})}).map(p$);return Object.assign(Object.assign({},n&&{title:n}),{items:i})}function m0t(t,e){const{color:n,series:r,facet:i=!1}=t,{color:o,series:a}=e,s=l=>l&&l.invert&&!(l instanceof $u)&&!(l instanceof Mm);if(s(r))return r.clone().invert(a);if(a&&r instanceof $u&&r.invert(a)!==o&&!i)return r.invert(a);if(s(n)){const l=n.invert(o);return Array.isArray(l)?null:l}return null}function v$(t){const e=t.getAttribute("fill"),n=t.getAttribute("stroke"),{__data__:r}=t,{color:i=e&&e!=="transparent"?e:n}=r;return i}function g$(t,e=n=>n){const n=new Map(t.map(r=>[e(r),r]));return Array.from(n.values())}function y$(t,e,n,r=t.map(o=>o.__data__),i={}){const o=l=>l instanceof Date?+l:l,a=g$(r.map(l=>l.title),o).filter(ie),s=r.flatMap((l,c)=>{const u=t[c],{items:f=[],title:d}=l,h=f.filter(ie),p=n!==void 0?n:f.length<=1;return h.map(v=>{var{color:g=v$(u)||i.color,name:y}=v,m=rd(v,["color","name"]);const b=m0t(e,l),x=p?b||y:y||b;return Object.assign(Object.assign({},m),{color:g,name:x||d})})}).map(p$);return Object.assign(Object.assign({},a.length>0&&{title:a.join(",")}),{items:g$(s,l=>`(${o(l.name)}, ${o(l.value)}, ${o(l.color)})`)})}function b0t(t,e,n){var{plotWidth:r,plotHeight:i,mainWidth:o,mainHeight:a,startX:s,startY:l,transposed:c,polar:u,insetLeft:f,insetTop:d}=n,h=rd(n,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const p=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},h),v=e.map(E=>E[1]),g=e.map(E=>E[0]),y=_u(v),m=_u(g),b=()=>{if(u){const E=Math.min(o,a)/2,M=s+f+o/2,P=l+d+a/2,C=Lr(ke([m,y],[M,P])),A=M+E*Math.cos(C),T=P+E*Math.sin(C);return[M,A,P,T]}return c?[s,s+r,y+l,y+l]:[m+s,m+s,l,l+i]},[x,w,O,_]=b(),S=()=>{const E=new rf({style:Object.assign({x1:x,x2:w,y1:O,y2:_},p)});return t.appendChild(E),E};if(g.length>0){const E=t.ruleY||S();E.style.x1=x,E.style.x2=w,E.style.y1=O,E.style.y2=_,t.ruleY=E}}function m$(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function x0t(t,{data:e,style:n,theme:r}){t.markers&&t.markers.forEach(o=>o.remove());const i=e.filter(o=>{const[{x:a,y:s}]=o;return ie(a)&&ie(s)}).map(o=>{const[{color:a,element:s},l]=o,c=a||s.style.fill||s.style.stroke||r.color;return new nf({style:Object.assign({cx:l[0],cy:l[1],fill:c,r:4,stroke:"#fff",strokeWidth:2},n)})});for(const o of i)t.appendChild(o);t.markers=i}function b$(t){t.markers&&(t.markers.forEach(e=>e.remove()),t.markers=[])}function x$(t,e){return Array.from(t.values()).some(n=>{var r;return(r=n.interaction)===null||r===void 0?void 0:r[e]})}function Z2(t,e){return t===void 0?e:t}function w$(t){const{title:e,items:n}=t;return n.length===0&&e===void 0}function w0t(t){return Array.from(t.values()).some(e=>{var n;return((n=e.interaction)===null||n===void 0?void 0:n.seriesTooltip)&&e.tooltip})}function O$(t,e){var{elements:n,sort:r,filter:i,scale:o,coordinate:a,crosshairs:s,render:l,groupName:c,emitter:u,wait:f=50,leading:d=!0,trailing:h=!1,startX:p=0,startY:v=0,body:g=!0,single:y=!0,position:m,enterable:b,mount:x,bounding:w,theme:O,disableNative:_=!1,marker:S=!0,preserve:E=!1,style:M={},css:P={}}=e,C=rd(e,["elements","sort","filter","scale","coordinate","crosshairs","render","groupName","emitter","wait","leading","trailing","startX","startY","body","single","position","enterable","mount","bounding","theme","disableNative","marker","preserve","style","css"]);const A=n(t),T=he(a),k=ce(a),N=Z(M,C),{innerWidth:j,innerHeight:L,width:I,height:$,insetLeft:F,insetTop:R}=a.getOptions(),B=[],W=[];for(const $t of A){const{__data__:Wt}=$t,{seriesX:Ae,title:qt,items:Ke}=Wt;Ae?B.push($t):(qt||Ke)&&W.push($t)}const J=!!(T?o.y:o.x).getBandWidth&&W.length>0;B.sort(($t,Wt)=>{const Ae=T?0:1,qt=Ke=>Ke.getBounds().min[Ae];return T?qt(Wt)-qt($t):qt($t)-qt(Wt)});const X=$t=>{const Wt=T?1:0,{min:Ae,max:qt}=$t.getLocalBounds();return ro([Ae[Wt],qt[Wt]])};W.sort(($t,Wt)=>{const[Ae,qt]=X($t),[Ke,nn]=X(Wt),cr=(Ae+qt)/2,Ar=(Ke+nn)/2;return T?Ar-cr:cr-Ar});const V=new Map(B.map($t=>{const{__data__:Wt}=$t,{seriesX:Ae}=Wt,qt=Ae.map((nn,cr)=>cr),Ke=ro(qt,nn=>Ae[+nn]);return[$t,[Ke,Ae]]})),{x:it}=o,nt=it!=null&&it.getBandWidth?it.getBandWidth()/2:0,lt=$t=>{const[Wt]=a.invert($t);return Wt-nt},yt=($t,Wt,Ae)=>{const qt=lt($t),Ke=Ae.filter(ie),[nn,cr]=ro([Ke[0],Ke[Ke.length-1]]),Ar=nn===cr;if(!J&&(qt<nn||qt>cr)&&!Ar)return null;const Si=vl(MS=>Ae[+MS]).center,Wa=Si(Wt,qt);return Wt[Wa]},pt=($t,Wt)=>{const qt=$t[T?1:0],Ke=Wt.filter(Ar=>{const[Si,Wa]=X(Ar);return qt>=Si&&qt<=Wa});if(!J||Ke.length>0)return Ke;const nn=vl(Ar=>{const[Si,Wa]=X(Ar);return(Si+Wa)/2}).center,cr=nn(Wt,qt);return[Wt[cr]].filter(ie)},mt=($t,Wt)=>{const{__data__:Ae}=$t;return Object.fromEntries(Object.entries(Ae).filter(([qt])=>qt.startsWith("series")&&qt!=="series").map(([qt,Ke])=>{const nn=Ke[Wt];return[yE(qt.replace("series","")),nn]}))},Nt=Xa($t=>{const Wt=U2(t,$t);if(!Wt)return;const Ae=r$(t),qt=Ae.min[0],Ke=Ae.min[1],nn=[Wt[0]-p,Wt[1]-v];if(!nn)return;const cr=pt(nn,W),Ar=[],Si=[];for(const Ze of B){const[fh,AS]=V.get(Ze),J9=yt(nn,fh,AS);if(J9!==null){Ar.push(Ze);const tB=mt(Ze,J9),{x:PMt,y:AMt}=tB,CMt=a.map([(PMt||0)+nt,AMt||0]);Si.push([Object.assign(Object.assign({},tB),{element:Ze}),CMt])}}const Wa=Array.from(new Set(Si.map(Ze=>Ze[0].x))),MS=Wa[Ph(Wa,Ze=>Math.abs(Ze-lt(nn)))],PS=Si.filter(Ze=>Ze[0].x===MS),MMt=[...PS.map(Ze=>Ze[0]),...cr.map(Ze=>Ze.__data__)],Q9=[...Ar,...cr],uh=y$(Q9,o,c,MMt,O);if(r&&uh.items.sort((Ze,fh)=>r(Ze)-r(fh)),i&&(uh.items=uh.items.filter(i)),Q9.length===0||w$(uh)){Yt($t);return}if(g&&h$({root:t,data:uh,x:Wt[0]+qt,y:Wt[1]+Ke,render:l,event:$t,single:y,position:m,enterable:b,mount:x,bounding:w,css:P}),s){const Ze=PS.map(AS=>AS[1]),fh=ot(N,"crosshairs");b0t(t,Ze,Object.assign(Object.assign({},fh),{plotWidth:j,plotHeight:L,mainWidth:I,mainHeight:$,insetLeft:F,insetTop:R,startX:p,startY:v,transposed:T,polar:k}))}if(S){const Ze=ot(N,"marker");x0t(t,{data:PS,style:Ze,theme:O})}u.emit("tooltip:show",Object.assign(Object.assign({},$t),{nativeEvent:!0,data:{data:{x:ql(o.x,lt(nn),!0)}}}))},f,{leading:d,trailing:h}),Yt=$t=>{ma({root:t,single:y,emitter:u,event:$t}),s&&m$(t),S&&b$(t)},me=()=>{K2({root:t,single:y}),s&&m$(t),S&&b$(t)},We=({nativeEvent:$t,data:Wt})=>{if($t)return;const{x:Ae}=Wt.data,{x:qt}=o,Ke=qt.map(Ae),[nn,cr]=a.map([Ke,.5]),{min:[Ar,Si]}=t.getRenderBounds();Nt({offsetX:nn+Ar,offsetY:cr+Si})},lr=()=>{ma({root:t,single:y,emitter:u,nativeEvent:!1})},$o=()=>{ei(),me()},rl=()=>{Hn()},Hn=()=>{_||(t.addEventListener("pointerenter",Nt),t.addEventListener("pointermove",Nt),t.addEventListener("pointerleave",Yt))},ei=()=>{_||(t.removeEventListener("pointerenter",Nt),t.removeEventListener("pointermove",Nt),t.removeEventListener("pointerleave",Yt))};return Hn(),u.on("tooltip:show",We),u.on("tooltip:hide",lr),u.on("tooltip:disable",$o),u.on("tooltip:enable",rl),()=>{ei(),u.off("tooltip:show",We),u.off("tooltip:hide",lr),u.off("tooltip:disable",$o),u.off("tooltip:enable",rl),E?ma({root:t,single:y,emitter:u,nativeEvent:!1}):me()}}function O0t(t,{elements:e,scale:n,render:r,groupName:i,sort:o,filter:a,emitter:s,wait:l=50,leading:c=!0,trailing:u=!1,groupKey:f=E=>E,single:d=!0,position:h,enterable:p,datum:v,view:g,mount:y,bounding:m,theme:b,shared:x=!1,body:w=!0,disableNative:O=!1,preserve:_=!1,css:S={}}){const E=e(t),M=new Set(E),P=xe(E,f),C=Xa($=>{const{target:F}=$;if(!M.has(F)){ma({root:t,single:d,emitter:s,event:$});return}const R=f(F),B=P.get(R),W=B.length===1&&!x?y0t(B[0]):y$(B,n,i,void 0,b);if(o&&W.items.sort((X,V)=>o(X)-o(V)),a&&(W.items=W.items.filter(a)),w$(W)){ma({root:t,single:d,emitter:s,event:$});return}const{offsetX:K,offsetY:J}=$;w&&h$({root:t,data:W,x:K,y:J,render:r,event:$,single:d,position:h,enterable:p,mount:y,bounding:m,css:S}),s.emit("tooltip:show",Object.assign(Object.assign({},$),{nativeEvent:!0,data:{data:Cj(F,g)}}))},l,{leading:c,trailing:u}),A=$=>{ma({root:t,single:d,emitter:s,event:$})},T=()=>{O||(t.addEventListener("pointermove",C),t.addEventListener("pointerleave",A))},k=()=>{O||(t.removeEventListener("pointermove",C),t.removeEventListener("pointerleave",A))},N=({nativeEvent:$,data:F})=>{if($)return;const R=q2(E,F.data,v);if(!R)return;const B=R.getBBox(),{x:W,y:K,width:J,height:X}=B;C({target:R,offsetX:W+J/2,offsetY:K+X/2})},j=({nativeEvent:$}={})=>{$||ma({root:t,single:d,emitter:s,nativeEvent:!1})},L=()=>{k(),K2({root:t,single:d})},I=()=>{T()};return s.on("tooltip:show",N),s.on("tooltip:hide",j),s.on("tooltip:enable",I),s.on("tooltip:disable",L),T(),()=>{k(),s.off("tooltip:show",N),s.off("tooltip:hide",j),_?ma({root:t,single:d,emitter:s,nativeEvent:!1}):K2({root:t,single:d})}}function _$(t){const{shared:e,crosshairs:n,series:r,name:i,item:o=()=>({}),facet:a=!1}=t,s=rd(t,["shared","crosshairs","series","name","item","facet"]);return(l,c,u)=>{const{container:f,view:d}=l,{scale:h,markState:p,coordinate:v,theme:g}=d,y=x$(p,"seriesTooltip"),m=x$(p,"crosshairs"),b=wo(f),x=Z2(r,y);if(x&&w0t(p)&&!a)return O$(b,Object.assign(Object.assign({},s),{theme:g,elements:ga,scale:h,coordinate:v,crosshairs:Z2(n,m),item:o,emitter:u}));if(x&&a){const w=c.filter(P=>P!==l&&P.options.parentKey===l.options.key),O=n$(l,c),_=w[0].view.scale,S=b.getBounds(),E=S.min[0],M=S.min[1];return Object.assign(_,{facet:!0}),O$(b.parentNode.parentNode,Object.assign(Object.assign({},s),{theme:g,elements:()=>O,scale:_,coordinate:v,crosshairs:Z2(n,m),item:o,startX:E,startY:M,emitter:u}))}return O0t(b,Object.assign(Object.assign({},s),{datum:ks(d),elements:ga,scale:h,coordinate:v,groupKey:e?X2():void 0,item:o,emitter:u,view:d,theme:g,shared:e}))}}_$.props={reapplyWhenUpdate:!0};var Iv=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?o(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})};const S$="legend-category",_0t="legend-continuous",S0t="items-item",E0t="legend-category-item-marker",M0t="legend-category-item-label";function E$(t){return t.getElementsByClassName(E0t)[0]}function M$(t){return t.getElementsByClassName(M0t)[0]}function P$(t){return t.getElementsByClassName(S0t)}function Q2(t){return t.getElementsByClassName(S$)}function A$(t){return t.getElementsByClassName(_0t)}function P0t(t,e){[...Q2(t),...A$(t)].forEach(r=>{e(r,i=>i)})}function J2(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function A0t(t,{legends:e,marker:n,label:r,datum:i,filter:o,emitter:a,channel:s,state:l={}}){const c=new Map,u=new Map,f=new Map,{unselected:d={markerStroke:"#aaa",markerFill:"#aaa",labelFill:"#aaa"}}=l,h={unselected:ot(d,"marker")},p={unselected:ot(d,"label")},{setState:v,removeState:g}=Oo(h,void 0),{setState:y,removeState:m}=Oo(p,void 0),b=Array.from(e(t));let x=b.map(i);const w=()=>{for(const S of b){const E=i(S),M=n(S),P=r(S);x.includes(E)?(g(M,"unselected"),m(P,"unselected")):(v(M,"unselected"),y(P,"unselected"))}};for(const S of b){const E=()=>{ya(t,"pointer")},M=()=>{r0t(t)},P=C=>Iv(this,void 0,void 0,function*(){const A=i(S),T=x.indexOf(A);T===-1?x.push(A):x.splice(T,1),x.length===0&&x.push(...b.map(i)),yield o(x),w();const{nativeEvent:k=!0}=C;k&&(x.length===b.length?a.emit("legend:reset",{nativeEvent:k}):a.emit("legend:filter",Object.assign(Object.assign({},C),{nativeEvent:k,data:{channel:s,values:x}})))});S.addEventListener("click",P),S.addEventListener("pointerenter",E),S.addEventListener("pointerout",M),c.set(S,P),u.set(S,E),f.set(S,M)}const O=S=>Iv(this,void 0,void 0,function*(){const{nativeEvent:E}=S;if(E)return;const{data:M}=S,{channel:P,values:C}=M;P===s&&(x=C,yield o(x),w())}),_=S=>Iv(this,void 0,void 0,function*(){const{nativeEvent:E}=S;E||(x=b.map(i),yield o(x),w())});return a.on("legend:filter",O),a.on("legend:reset",_),()=>{for(const S of b)S.removeEventListener("click",c.get(S)),S.removeEventListener("pointerenter",u.get(S)),S.removeEventListener("pointerout",f.get(S)),a.off("legend:filter",O),a.off("legend:reset",_)}}function C0t(t,{legend:e,filter:n,emitter:r,channel:i}){const o=({detail:{value:a}})=>{n(a),r.emit({nativeEvent:!0,data:{channel:i,values:a}})};return e.addEventListener("valuechange",o),()=>{e.removeEventListener("valuechange",o)}}function C$(t,{legend:e,channel:n,value:r,ordinal:i,channels:o,allChannels:a,facet:s=!1}){return Iv(this,void 0,void 0,function*(){const{view:l,update:c,setState:u}=t;u(e,f=>{const{marks:d}=f,h=d.map(p=>{if(p.type==="legends")return p;const{transform:v=[]}=p,g=v.findIndex(({type:b})=>b.startsWith("group")||b.startsWith("bin")),y=[...v];y.splice(g+1,0,{type:"filter",[n]:{value:r,ordinal:i}});const m=Object.fromEntries(o.map(b=>[b,{domain:l.scale[b].getOptions().domain}]));return Z({},p,Object.assign(Object.assign({transform:y,scale:m},!i&&{animate:!1}),{legend:s?!1:Object.fromEntries(a.map(b=>[b,{preserve:!0}]))}))});return Object.assign(Object.assign({},f),{marks:h})}),yield c()})}function T0t(t,e){for(const n of t)C$(n,Object.assign(Object.assign({},e),{facet:!0}))}function k0t(){return(t,e,n)=>{const{container:r}=t,i=e.filter(f=>f!==t),o=i.length>0,a=f=>J2(f).scales.map(d=>d.name),s=[...Q2(r),...A$(r)],l=s.flatMap(a),c=o?Xa(T0t,50,{trailing:!0}):Xa(C$,50,{trailing:!0}),u=s.map(f=>{const{name:d,domain:h}=J2(f).scales[0],p=a(f),v={legend:f,channel:d,channels:p,allChannels:l};return f.className===S$?A0t(r,{legends:P$,marker:E$,label:M$,datum:g=>{const{__data__:y}=g,{index:m}=y;return h[m]},filter:g=>{const y=Object.assign(Object.assign({},v),{value:g,ordinal:!0});c(o?i:t,y)},state:f.attributes.state,channel:d,emitter:n}):C0t(r,{legend:f,filter:g=>{const y=Object.assign(Object.assign({},v),{value:g,ordinal:!1});c(o?i:t,y)},emitter:n,channel:d})});return()=>{u.forEach(f=>f())}}}function L0t(){return(t,e,n)=>{const{container:r,view:i,options:o}=t,a=Q2(r),s=ga(r),l=h=>J2(h).scales[0].name,c=h=>{const{scale:{[h]:p}}=i;return p},u=yc(o,["active","inactive"]),f=nd(s,ks(i)),d=[];for(const h of a){const p=$=>{const{data:F}=h.attributes,{__data__:R}=$,{index:B}=R;return F[B].label},v=l(h),g=P$(h),y=c(v),m=xe(s,$=>y.invert($.__data__[v])),{state:b={}}=h.attributes,{inactive:x={}}=b,{setState:w,removeState:O}=Oo(u,f),_={inactive:ot(x,"marker")},S={inactive:ot(x,"label")},{setState:E,removeState:M}=Oo(_),{setState:P,removeState:C}=Oo(S),A=$=>{for(const F of g){const R=E$(F),B=M$(F);F===$||$===null?(M(R,"inactive"),C(B,"inactive")):(E(R,"inactive"),P(B,"inactive"))}},T=($,F)=>{const R=p(F),B=new Set(m.get(R));for(const K of s)B.has(K)?w(K,"active"):w(K,"inactive");A(F);const{nativeEvent:W=!0}=$;W&&n.emit("legend:highlight",Object.assign(Object.assign({},$),{nativeEvent:W,data:{channel:v,value:R}}))},k=new Map;for(const $ of g){const F=R=>{T(R,$)};$.addEventListener("pointerover",F),k.set($,F)}const N=$=>{for(const R of s)O(R,"inactive","active");A(null);const{nativeEvent:F=!0}=$;F&&n.emit("legend:unhighlight",{nativeEvent:F})},j=$=>{const{nativeEvent:F,data:R}=$;if(F)return;const{channel:B,value:W}=R;if(B!==v)return;const K=g.find(J=>p(J)===W);K&&T({nativeEvent:!1},K)},L=$=>{const{nativeEvent:F}=$;F||N({nativeEvent:!1})};h.addEventListener("pointerleave",N),n.on("legend:highlight",j),n.on("legend:unhighlight",L);const I=()=>{h.removeEventListener(N),n.off("legend:highlight",j),n.off("legend:unhighlight",L);for(const[$,F]of k)$.removeEventListener(F)};d.push(I)}return()=>d.forEach(h=>h())}}var wr=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function N0t(t,e){const[n,r,i,o]=t,[a,s,l,c]=e;return!(a>i||l<n||s>o||c<r)}function I0t(t,e,n,r,i){const[o,a,s,l]=i;return[Math.max(o,Math.min(t,n)),Math.max(a,Math.min(e,r)),Math.min(s,Math.max(t,n)),Math.min(l,Math.max(e,r))]}function j0t(t){const{width:e,height:n}=t.getBBox();return[0,0,e,n]}function _o(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}const T$=Dl(t=>{const e=t.attributes,{x:n,y:r,width:i,height:o,class:a,renders:s={},handleSize:l=10,document:c}=e,u=wr(e,["x","y","width","height","class","renders","handleSize","document"]);if(!c||i===void 0||o===void 0||n===void 0||r===void 0)return;const f=l/2,d=(W,K,J)=>{W.handle||(W.handle=J.createElement("rect"),W.append(W.handle));const{handle:X}=W;return X.attr(K),X},h=ot(pm(u,"handleNW","handleNE"),"handleN"),{render:p=d}=h,v=wr(h,["render"]),g=ot(u,"handleE"),{render:y=d}=g,m=wr(g,["render"]),b=ot(pm(u,"handleSE","handleSW"),"handleS"),{render:x=d}=b,w=wr(b,["render"]),O=ot(u,"handleW"),{render:_=d}=O,S=wr(O,["render"]),E=ot(u,"handleNW"),{render:M=d}=E,P=wr(E,["render"]),C=ot(u,"handleNE"),{render:A=d}=C,T=wr(C,["render"]),k=ot(u,"handleSE"),{render:N=d}=k,j=wr(k,["render"]),L=ot(u,"handleSW"),{render:I=d}=L,$=wr(L,["render"]),F=(W,K)=>{const{id:J}=W,X=W.attributes,V=wr(X,["x","y"]),it=K(W,Object.assign({x:0,y:0},V),c);it.id=J,it.style.draggable=!0},R=W=>()=>{const K=Dl(J=>F(J,W));return new K({})},B=gt(t).attr("className",a).style("x",n).style("y",r).style("draggable",!0);B.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(_o,Object.assign({width:i,height:o},pm(u,"handle"))),B.maybeAppend("handle-n",R(p)).style("x",f).style("y",-f).style("width",i-l).style("height",l).style("fill","transparent").call(_o,v),B.maybeAppend("handle-e",R(y)).style("x",i-f).style("y",f).style("width",l).style("height",o-l).style("fill","transparent").call(_o,m),B.maybeAppend("handle-s",R(x)).style("x",f).style("y",o-f).style("width",i-l).style("height",l).style("fill","transparent").call(_o,w),B.maybeAppend("handle-w",R(_)).style("x",-f).style("y",f).style("width",l).style("height",o-l).style("fill","transparent").call(_o,S),B.maybeAppend("handle-nw",R(M)).style("x",-f).style("y",-f).style("width",l).style("height",l).style("fill","transparent").call(_o,P),B.maybeAppend("handle-ne",R(A)).style("x",i-f).style("y",-f).style("width",l).style("height",l).style("fill","transparent").call(_o,T),B.maybeAppend("handle-se",R(N)).style("x",i-f).style("y",o-f).style("width",l).style("height",l).style("fill","transparent").call(_o,j),B.maybeAppend("handle-sw",R(I)).style("x",-f).style("y",o-f).style("width",l).style("height",l).style("fill","transparent").call(_o,$)});function tw(t,e){var{brushed:n=()=>{},brushended:r=()=>{},brushcreated:i=()=>{},brushstarted:o=()=>{},brushupdated:a=()=>{},extent:s=j0t(t),brushRegion:l=(X,V,it,nt,lt)=>[X,V,it,nt],reverse:c=!1,fill:u="#777",fillOpacity:f="0.3",stroke:d="#fff",selectedHandles:h=["handle-n","handle-e","handle-s","handle-w","handle-nw","handle-ne","handle-se","handle-sw"]}=e,p=wr(e,["brushed","brushended","brushcreated","brushstarted","brushupdated","extent","brushRegion","reverse","fill","fillOpacity","stroke","selectedHandles"]);let v=null,g=null,y=null,m=null,b=null,x=!1;const[w,O,_,S]=s;ya(t,"crosshair"),t.style.draggable=!0;const E=(X,V,it)=>{if(o(it),m&&m.remove(),b&&b.remove(),v=[X,V],c)return M();P()},M=()=>{b=new Dn({style:Object.assign(Object.assign({},p),{fill:u,fillOpacity:f,stroke:d,pointerEvents:"none"})}),m=new T$({style:{x:0,y:0,width:0,height:0,draggable:!0,document:t.ownerDocument},className:"mask"}),t.appendChild(b),t.appendChild(m)},P=()=>{m=new T$({style:Object.assign(Object.assign({document:t.ownerDocument,x:0,y:0},p),{fill:u,fillOpacity:f,stroke:d,draggable:!0}),className:"mask"}),t.appendChild(m)},C=(X=!0)=>{m&&m.remove(),b&&b.remove(),v=null,g=null,y=null,x=!1,m=null,b=null,r(X)},A=(X,V,it=!0)=>{const[nt,lt,yt,pt]=I0t(X[0],X[1],V[0],V[1],s),[mt,Nt,Yt,me]=l(nt,lt,yt,pt,s);return c?k(mt,Nt,Yt,me):T(mt,Nt,Yt,me),n(mt,Nt,Yt,me,it),[mt,Nt,Yt,me]},T=(X,V,it,nt)=>{m.style.x=X,m.style.y=V,m.style.width=it-X,m.style.height=nt-V},k=(X,V,it,nt)=>{b.style.d=`
80
+ `}function cst(t,e){const[n,r,i,o]=Ox(t),a=o/i,s=Math.ceil(Math.sqrt(e/a)),l=Math.ceil(e/s),c=[],u=o/l;let f=0,d=e;for(;d>0;){const h=Math.min(d,s),p=i/h;for(let v=0;v<h;v++){const g=n+v*p,y=r+f*u;c.push(lst([g,y,p,u]))}d-=h,f+=1}return c}function ust(t="pack"){return typeof t=="function"?t:cst}function fst(t,e,n){const[r,i,o,a]=Ox(t),{transform:s}=t.style,{transform:l}=e.style;CI(e,t);const[c,u,f,d]=Ox(e),h=r-c,p=i-u,v=o/f,g=a/d,y=[Object.assign({transform:`${s?s+" ":""}translate(${h}, ${p}) scale(${v}, ${g})`},Kl(t,Zl)),Object.assign({transform:`${l?l+" ":""}translate(0, 0) scale(1, 1)`},Kl(e,Zl))];return e.animate(y,n)}function CI(t,e){t.__data__=e.__data__,t.className=e.className,t.markType=e.markType,e.parentNode.replaceChild(t,e)}function dst(t,e){const{nodeName:n}=t;if(n==="path")return t;const r=new Dn({style:Object.assign(Object.assign({},Kl(t,Zl)),{d:e})});return CI(r,t),r}function TI(t,e){const n=t.indexOf(e),r=t.lastIndexOf(e);return n===r}function hst(t){return!TI(t,"m")||!TI(t,"M")}function kI(t){const e=w1(t);if(e&&!hst(e))return e}function _x(t,e,n,r){const{nodeName:i}=e,{nodeName:o}=n,a=kI(e),s=kI(n);if(i===o&&i!=="path"||(a===void 0||s===void 0))return fst(e,n,r);const u=dst(t,a),f=[Object.assign({path:a},Kl(e,Zl)),Object.assign({path:s},Kl(n,Zl))],d=u.animate(f,r);return d.onfinish=()=>{u.style.transform="none",hm(u,n)},u.style.transform="none",d}function pst(t,e,n,r){t.style.visibility="hidden";const i=r(t,e.length);return e.map((o,a)=>{const s=new Dn({style:Object.assign({path:i[a]},Kl(t,Zl))});return _x(o,s,o,n)})}function vst(t,e,n,r){const i=r(e,t.length),{fillOpacity:o=1,strokeOpacity:a=1,opacity:s=1}=e.style,l=[{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:0,strokeOpacity:0,opacity:0,offset:.99},{fillOpacity:o,strokeOpacity:a,opacity:s}],c=e.animate(l,n);return[...t.map((f,d)=>{const h=new Dn({style:{path:i[d],fill:e.style.fill}});return _x(f,f,h,n)}),c]}const LI=t=>(e,n,r)=>{const i=ust(t.split),o=Object.assign(Object.assign({},r),t),{length:a}=e,{length:s}=n;if(a===1&&s===1||a>1&&s>1){const[l]=e,[c]=n;return _x(l,l,c,o)}if(a===1&&s>1){const[l]=e;return pst(l,n,o,i)}if(a>1&&s===1){const[l]=n;return vst(e,l,o,i)}return null};LI.props={};const NI=(t,e)=>{MC.registerProperty({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:at.NUMBER});const{coordinate:r}=e;return(i,o,a)=>{const[s]=i;if(!ce(r))return wx(t,e)(i,o,a);const l=r.getCenter(),{__data__:c,style:u}=s,{radius:f=0,inset:d=0,fillOpacity:h=1,strokeOpacity:p=1,opacity:v=1}=u,{points:g,y,y1:m}=c,b=qh().cornerRadius(f).padAngle(d*Math.PI/180),x=vs(r,g,[y,m]),{startAngle:w,endAngle:O}=x,_=new Dn({}),S=P=>{_.attr({d:b(P),transform:`translate(${l[0]}, ${l[1]})`});const C=w1(_);return _.style.transform="",C},E=[{waveInArcAngle:w+1e-4,fillOpacity:0,strokeOpacity:0,opacity:0},{waveInArcAngle:w+1e-4,fillOpacity:h,strokeOpacity:p,opacity:v,offset:.01},{waveInArcAngle:O,fillOpacity:h,strokeOpacity:p,opacity:v}],M=s.animate(E,Object.assign(Object.assign({},a),t));return M.onframe=function(){s.style.path=S(Object.assign(Object.assign({},x),{endAngle:Number(s.style.waveInArcAngle)}))},M.onfinish=function(){s.style.path=S(Object.assign(Object.assign({},x),{endAngle:O}))},M}};NI.props={};const gst=t=>(n,r,i)=>{const[o]=n,{transform:a="",fillOpacity:s=1,strokeOpacity:l=1,opacity:c=1}=o.style,u="center center",f=[{transform:`${a} scale(${1e-4})`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${a} scale(${1e-4})`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:l,opacity:c,offset:.01},{transform:`${a} scale(1)`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:l,opacity:c}];return o.animate(f,Object.assign(Object.assign({},i),t))},yst=t=>(n,r,i)=>{const[o]=n,{transform:a="",fillOpacity:s=1,strokeOpacity:l=1,opacity:c=1}=o.style,u="center center",f=[{transform:`${a} scale(1)`.trimStart(),transformOrigin:u},{transform:`${a} scale(${1e-4})`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:l,opacity:c,offset:.99},{transform:`${a} scale(${1e-4})`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0}];return o.animate(f,Object.assign(Object.assign({},i),t))},II=t=>(e,n,r)=>{var i,o;const[a]=e,s=((o=(i=a).getTotalLength)===null||o===void 0?void 0:o.call(i))||0,l=[{lineDash:[0,s]},{lineDash:[s,0]}];return a.animate(l,Object.assign(Object.assign({},r),t))};II.props={};const jI=(t,e)=>(n,r,i)=>{const[o]=n,{height:a,width:s}=o.getBoundingClientRect(),l=new Dn({style:{path:`M0,0L${s},0L${s},${a}L0,${a}Z`}});return o.appendChild(l),o.style.clipPath=l,wx(t,e)([l],r,i)};jI.props={};const DI=(t,e)=>(n,r,i)=>{const[o]=n,{height:a,width:s}=o.getBoundingClientRect(),l=new Dn({style:{path:`M0,0L${s},0L${s},${a}L0,${a}Z`}});return o.appendChild(l),o.style.clipPath=l,MI(t,e)([l],r,i)};DI.props={};const $I="main-layer",Sx="label-layer",mo="element",Ex="view",Nf="plot",FI="component",Mx="label",RI="area";var mst=function(t,e,n){return t<e?e:t>n?n:t};const bst=mst;function xst(t,e){var n=e.r;t.arc(n,n,n,0,Math.PI*2,!1)}function wst(t,e){var n=e.rx,r=e.ry,i=n,o=r;if(t.ellipse)t.ellipse(i,o,i,o,0,0,Math.PI*2,!1);else{var a=i>o?i:o,s=i>o?1:i/o,l=i>o?o/i:1;t.save(),t.scale(s,l),t.arc(a,a,a,0,Math.PI*2)}}function Ost(t,e){var n=e.x1,r=e.y1,i=e.x2,o=e.y2,a=e.defX,s=a===void 0?0:a,l=e.defY,c=l===void 0?0:l,u=e.markerStart,f=e.markerEnd,d=e.markerStartOffset,h=e.markerEndOffset,p=0,v=0,g=0,y=0,m=0,b,x;u&&Dt(u)&&d&&(b=i-n,x=o-r,m=Math.atan2(x,b),p=Math.cos(m)*(d||0),v=Math.sin(m)*(d||0)),f&&Dt(f)&&h&&(b=n-i,x=r-o,m=Math.atan2(x,b),g=Math.cos(m)*(h||0),y=Math.sin(m)*(h||0)),t.moveTo(n-s+p,r-c+v),t.lineTo(i-s+g,o-c+y)}function _st(t,e){var n=e.defX,r=n===void 0?0:n,i=e.defY,o=i===void 0?0:i,a=e.markerStart,s=e.markerEnd,l=e.markerStartOffset,c=e.markerEndOffset,u=e.path,f=u.absolutePath,d=u.segments,h=0,p=0,v=0,g=0,y=0,m,b;if(a&&Dt(a)&&l){var x=D(a.parentNode.getStartTangent(),2),w=x[0],O=x[1];m=w[0]-O[0],b=w[1]-O[1],y=Math.atan2(b,m),h=Math.cos(y)*(l||0),p=Math.sin(y)*(l||0)}if(s&&Dt(s)&&c){var _=D(s.parentNode.getEndTangent(),2),w=_[0],O=_[1];m=w[0]-O[0],b=w[1]-O[1],y=Math.atan2(b,m),v=Math.cos(y)*(c||0),g=Math.sin(y)*(c||0)}for(var S=0;S<f.length;S++){var E=f[S],M=E[0],P=f[S+1],C=S===0&&(h!==0||p!==0),A=(S===f.length-1||P&&(P[0]==="M"||P[0]==="Z"))&&v!==0&&g!==0;switch(M){case"M":C?(t.moveTo(E[1]-r+h,E[2]-o+p),t.lineTo(E[1]-r,E[2]-o)):t.moveTo(E[1]-r,E[2]-o);break;case"L":A?t.lineTo(E[1]-r+v,E[2]-o+g):t.lineTo(E[1]-r,E[2]-o);break;case"Q":t.quadraticCurveTo(E[1]-r,E[2]-o,E[3]-r,E[4]-o),A&&t.lineTo(E[3]-r+v,E[4]-o+g);break;case"C":t.bezierCurveTo(E[1]-r,E[2]-o,E[3]-r,E[4]-o,E[5]-r,E[6]-o),A&&t.lineTo(E[5]-r+v,E[6]-o+g);break;case"A":{var T=d[S].arcParams,k=T.cx,N=T.cy,j=T.rx,L=T.ry,I=T.startAngle,$=T.endAngle,F=T.xRotation,R=T.sweepFlag;if(t.ellipse)t.ellipse(k-r,N-o,j,L,F,I,$,!!(1-R));else{var B=j>L?j:L,W=j>L?1:j/L,K=j>L?L/j:1;t.translate(k-r,N-o),t.rotate(F),t.scale(W,K),t.arc(0,0,B,I,$,!!(1-R)),t.scale(1/W,1/K),t.rotate(-F),t.translate(-(k-r),-(N-o))}A&&t.lineTo(E[6]-r+v,E[7]-o+g);break}case"Z":t.closePath();break}}}function Sst(t,e){var n=e.defX,r=n===void 0?0:n,i=e.defY,o=i===void 0?0:i,a=e.markerStart,s=e.markerEnd,l=e.markerStartOffset,c=e.markerEndOffset,u=e.points.points,f=u.length,d=u[0][0]-r,h=u[0][1]-o,p=u[f-1][0]-r,v=u[f-1][1]-o,g=0,y=0,m=0,b=0,x=0,w,O;a&&Dt(a)&&l&&(w=u[1][0]-u[0][0],O=u[1][1]-u[0][1],x=Math.atan2(O,w),g=Math.cos(x)*(l||0),y=Math.sin(x)*(l||0)),s&&Dt(s)&&c&&(w=u[f-1][0]-u[0][0],O=u[f-1][1]-u[0][1],x=Math.atan2(O,w),m=Math.cos(x)*(c||0),b=Math.sin(x)*(c||0)),t.moveTo(d+(g||m),h+(y||b));for(var _=1;_<f-1;_++){var S=u[_];t.lineTo(S[0]-r,S[1]-o)}t.lineTo(p,v)}function Est(t,e){var n=e.defX,r=n===void 0?0:n,i=e.defY,o=i===void 0?0:i,a=e.markerStart,s=e.markerEnd,l=e.markerStartOffset,c=e.markerEndOffset,u=e.points.points,f=u.length,d=u[0][0]-r,h=u[0][1]-o,p=u[f-1][0]-r,v=u[f-1][1]-o,g=0,y=0,m=0,b=0,x=0,w,O;a&&Dt(a)&&l&&(w=u[1][0]-u[0][0],O=u[1][1]-u[0][1],x=Math.atan2(O,w),g=Math.cos(x)*(l||0),y=Math.sin(x)*(l||0)),s&&Dt(s)&&c&&(w=u[f-2][0]-u[f-1][0],O=u[f-2][1]-u[f-1][1],x=Math.atan2(O,w),m=Math.cos(x)*(c||0),b=Math.sin(x)*(c||0)),t.moveTo(d+g,h+y);for(var _=1;_<f-1;_++){var S=u[_];t.lineTo(S[0]-r,S[1]-o)}t.lineTo(p+m,v+b)}function Mst(t,e){var n=e.radius,r=e.width,i=e.height,o=r,a=i,s=n&&n.some(function(g){return g!==0});if(!s)t.rect(0,0,o,a);else{var l=r>0?1:-1,c=i>0?1:-1,u=l+c===0,f=D(n.map(function(g){return bst(g,0,Math.min(Math.abs(o)/2,Math.abs(a)/2))}),4),d=f[0],h=f[1],p=f[2],v=f[3];t.moveTo(l*d,0),t.lineTo(o-l*h,0),h!==0&&t.arc(o-l*h,c*h,h,-c*Math.PI/2,l>0?0:Math.PI,u),t.lineTo(o,a-c*p),p!==0&&t.arc(o-l*p,a-c*p,p,l>0?0:Math.PI,c>0?Math.PI/2:1.5*Math.PI,u),t.lineTo(l*v,a),v!==0&&t.arc(l*v,a-c*v,v,c>0?Math.PI/2:-Math.PI/2,l>0?Math.PI:0,u),t.lineTo(0,c*d),d!==0&&t.arc(l*d,c*d,d,l>0?Math.PI:0,c>0?Math.PI*1.5:Math.PI/2,u)}}var Pst=function(t){st(e,t);function e(){var n=t.apply(this,Q([],D(arguments),!1))||this;return n.name="canvas-path-generator",n}return e.prototype.init=function(){var n,r=(n={},n[H.CIRCLE]=xst,n[H.ELLIPSE]=wst,n[H.RECT]=Mst,n[H.LINE]=Ost,n[H.POLYLINE]=Est,n[H.POLYGON]=Sst,n[H.PATH]=_st,n[H.TEXT]=void 0,n[H.GROUP]=void 0,n[H.IMAGE]=void 0,n[H.HTML]=void 0,n[H.MESH]=void 0,n);this.context.pathGeneratorFactory=r},e.prototype.destroy=function(){delete this.context.pathGeneratorFactory},e}(Qo),Ast=function(t,e,n){return t<e?e:t>n?n:t};const Cst=Ast;function j0(t,e,n){var r=t*Math.cos(n)-e*Math.sin(n),i=t*Math.sin(n)+e*Math.cos(n);return{x:r,y:i}}function BI(t,e,n,r,i,o,a,s,l,c){var u=t,f=e,d=n,h=r,p=s,v=l,g=Math.PI*120/180,y=Math.PI/180*(+i||0),m=[],b,x,w,O,_;if(c)x=c[0],w=c[1],O=c[2],_=c[3];else{b=j0(u,f,-y),u=b.x,f=b.y,b=j0(p,v,-y),p=b.x,v=b.y;var S=(u-p)/2,E=(f-v)/2,M=S*S/(d*d)+E*E/(h*h);M>1&&(M=Math.sqrt(M),d*=M,h*=M);var P=d*d,C=h*h,A=(o===a?-1:1)*Math.sqrt(Math.abs((P*C-P*E*E-C*S*S)/(P*E*E+C*S*S)));O=A*d*E/h+(u+p)/2,_=A*-h*S/d+(f+v)/2,x=Math.asin(((f-_)/h*Math.pow(10,9)>>0)/Math.pow(10,9)),w=Math.asin(((v-_)/h*Math.pow(10,9)>>0)/Math.pow(10,9)),x=u<O?Math.PI-x:x,w=p<O?Math.PI-w:w,x<0&&(x=Math.PI*2+x),w<0&&(w=Math.PI*2+w),a&&x>w&&(x-=Math.PI*2),!a&&w>x&&(w-=Math.PI*2)}var T=w-x;if(Math.abs(T)>g){var k=w,N=p,j=v;w=x+g*(a&&w>x?1:-1),p=O+d*Math.cos(w),v=_+h*Math.sin(w),m=BI(p,v,d,h,i,0,a,N,j,[w,k,O,_])}T=w-x;var L=Math.cos(x),I=Math.sin(x),$=Math.cos(w),F=Math.sin(w),R=Math.tan(T/4),B=4/3*d*R,W=4/3*h*R,K=[u,f],J=[u+B*I,f-W*L],X=[p+B*F,v-W*$],V=[p,v];if(J[0]=2*K[0]-J[0],J[1]=2*K[1]-J[1],c)return J.concat(X,V,m);m=J.concat(X,V,m);for(var it=[],nt=0,lt=m.length;nt<lt;nt+=1)it[nt]=nt%2?j0(m[nt-1],m[nt],y).y:j0(m[nt],m[nt+1],y).x;return it}var Tst=Ct(),kst=Ct(),Lst=Ct(),Nst=Kt(),Ist=function(){function t(){var e=this;this.isHit=function(n,r,i,o){var a=e.context.pointInPathPickerFactory[n.nodeName];if(a){var s=oi(Nst,i),l=Qe(kst,ai(Lst,r[0],r[1],0),s),c=n.getGeometryBounds().halfExtents,u=n.parsedStyle.anchor;if(l[0]+=(u&&u[0]||0)*c[0]*2,l[1]+=(u&&u[1]||0)*c[1]*2,a(n,new on(l[0],l[1]),o,e.isPointInPath,e.context,e.runtime))return!0}return!1},this.isPointInPath=function(n,r){var i=e.runtime.offscreenCanvasCreator.getOrCreateContext(e.context.config.offscreenCanvas),o=e.context.pathGeneratorFactory[n.nodeName];return o&&(i.beginPath(),o(i,n.parsedStyle),i.closePath()),i.isPointInPath(r.x,r.y)}}return t.prototype.apply=function(e,n){var r=this,i,o=e.renderingService,a=e.renderingContext;this.context=e,this.runtime=n;var s=(i=a.root)===null||i===void 0?void 0:i.ownerDocument;o.hooks.pick.tapPromise(t.tag,function(l){return hl(r,void 0,void 0,function(){return pl(this,function(c){return[2,this.pick(s,l)]})})}),o.hooks.pickSync.tap(t.tag,function(l){return r.pick(s,l)})},t.prototype.pick=function(e,n){var r,i,o=n.topmost,a=n.position,s=a.x,l=a.y,c=ai(Tst,s,l,0),u=e.elementsFromBBox(c[0],c[1],c[0],c[1]),f=[];try{for(var d=ur(u),h=d.next();!h.done;h=d.next()){var p=h.value,v=p.getWorldTransform(),g=this.isHit(p,c,v,!1);if(g){var y=cC(p);if(y){var m=y.parsedStyle.clipPath,b=this.isHit(m,c,m.getWorldTransform(),!0);if(b){if(o)return n.picked=[p],n;f.push(p)}}else{if(o)return n.picked=[p],n;f.push(p)}}}}catch(x){r={error:x}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}return n.picked=f,n},t.tag="CanvasPicker",t}();function jst(t,e,n){var r=t.parsedStyle,i=r.r,o=r.fill,a=r.stroke,s=r.lineWidth,l=r.increasedLineWidthForHitTesting,c=r.pointerEvents,u=((s||0)+(l||0))/2,f=so(i,i,e.x,e.y),d=D(us(c,o,a),2),h=d[0],p=d[1];return h&&p||n?f<=i+u:h?f<=i:p?f>=i-u&&f<=i+u:!1}function D0(t,e,n,r){return t/(n*n)+e/(r*r)}function Dst(t,e,n){var r=t.parsedStyle,i=r.rx,o=r.ry,a=r.fill,s=r.stroke,l=r.lineWidth,c=r.increasedLineWidthForHitTesting,u=r.pointerEvents,f=e.x,d=e.y,h=D(us(u,a,s),2),p=h[0],v=h[1],g=((l||0)+(c||0))/2,y=(f-i)*(f-i),m=(d-o)*(d-o);return p&&v||n?D0(y,m,i+g,o+g)<=1:p?D0(y,m,i,o)<=1:v?D0(y,m,i-g,o-g)>=1&&D0(y,m,i+g,o+g)<=1:!1}function Ss(t,e,n,r,i,o){return i>=t&&i<=t+n&&o>=e&&o<=e+r}function $st(t,e,n,r,i,o,a){var s=i/2;return Ss(t-s,e-s,n,i,o,a)||Ss(t+n-s,e-s,i,r,o,a)||Ss(t+s,e+r-s,n,i,o,a)||Ss(t-s,e+s,i,r,o,a)}function $0(t,e,n,r,i,o,a,s){var l=(Math.atan2(s-e,a-t)+Math.PI*2)%(Math.PI*2),c={x:t+n*Math.cos(l),y:e+n*Math.sin(l)};return so(c.x,c.y,a,s)<=o/2}function fa(t,e,n,r,i,o,a){var s=Math.min(t,n),l=Math.max(t,n),c=Math.min(e,r),u=Math.max(e,r),f=i/2;return o>=s-f&&o<=l+f&&a>=c-f&&a<=u+f?zU(t,e,n,r,o,a)<=i/2:!1}function zI(t,e,n,r,i){var o=t.length;if(o<2)return!1;for(var a=0;a<o-1;a++){var s=t[a][0],l=t[a][1],c=t[a+1][0],u=t[a+1][1];if(fa(s,l,c,u,e,n,r))return!0}if(i){var f=t[0],d=t[o-1];if(fa(f[0],f[1],d[0],d[1],e,n,r))return!0}return!1}var Fst=1e-6;function Px(t){return Math.abs(t)<Fst?0:t<0?-1:1}function Rst(t,e,n){return(n[0]-t[0])*(e[1]-t[1])===(e[0]-t[0])*(n[1]-t[1])&&Math.min(t[0],e[0])<=n[0]&&n[0]<=Math.max(t[0],e[0])&&Math.min(t[1],e[1])<=n[1]&&n[1]<=Math.max(t[1],e[1])}function YI(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var o=0;o<i;o++){var a=t[o],s=t[(o+1)%i];if(Rst(a,s,[e,n]))return!0;Px(a[1]-n)>0!=Px(s[1]-n)>0&&Px(e-(n-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(r=!r)}return r}function WI(t,e,n){for(var r=!1,i=0;i<t.length;i++){var o=t[i];if(r=YI(o,e,n),r)break}return r}function Bst(t,e,n){var r=t.parsedStyle,i=r.x1,o=r.y1,a=r.x2,s=r.y2,l=r.lineWidth,c=r.increasedLineWidthForHitTesting,u=r.defX,f=u===void 0?0:u,d=r.defY,h=d===void 0?0:d,p=r.pointerEvents,v=r.fill,g=r.stroke,y=D(us(p,v,g),2),m=y[1];return!m&&!n||!l?!1:fa(i,o,a,s,(l||0)+(c||0),e.x+f,e.y+h)}function zst(t,e,n,r,i){for(var o=!1,a=e/2,s=0;s<t.length;s++){var l=t[s],c=l.currentPoint,u=l.params,f=l.prePoint,d=l.box;if(!(d&&!Ss(d.x-a,d.y-a,d.width+e,d.height+e,n,r)))switch(l.command){case"L":case"Z":if(o=fa(f[0],f[1],c[0],c[1],e,n,r),o)return!0;break;case"Q":var h=XU(f[0],f[1],u[1],u[2],u[3],u[4],n,r);if(o=h<=e/2,o)return!0;break;case"C":var p=AA(f[0],f[1],u[1],u[2],u[3],u[4],u[5],u[6],n,r,i);if(o=p<=e/2,o)return!0;break;case"A":l.cubicParams||(l.cubicParams=BI(f[0],f[1],u[1],u[2],u[3],u[4],u[5],u[6],u[7],void 0));for(var v=l.cubicParams,g=f,y=0;y<v.length;y+=6){var m=AA(g[0],g[1],v[y],v[y+1],v[y+2],v[y+3],v[y+4],v[y+5],n,r,i);if(g=[v[y+4],v[y+5]],o=m<=e/2,o)return!0}break}}return o}function Yst(t,e,n,r,i,o){var a=t.parsedStyle,s=a.lineWidth,l=a.increasedLineWidthForHitTesting,c=a.stroke,u=a.fill,f=a.defX,d=f===void 0?0:f,h=a.defY,p=h===void 0?0:h,v=a.path,g=a.pointerEvents,y=v.segments,m=v.hasArc,b=v.polylines,x=v.polygons,w=D(us(g,(x==null?void 0:x.length)&&u,c),2),O=w[0],_=w[1],S=b1(t),E=!1;return O||n?(m?E=r(t,e):E=WI(x,e.x+d,e.y+p)||WI(b,e.x+d,e.y+p),E):((_||n)&&(E=zst(y,(s||0)+(l||0),e.x+d,e.y+p,S)),E)}function Wst(t,e,n){var r=t.parsedStyle,i=r.stroke,o=r.fill,a=r.lineWidth,s=r.increasedLineWidthForHitTesting,l=r.points,c=r.defX,u=c===void 0?0:c,f=r.defY,d=f===void 0?0:f,h=r.pointerEvents,p=D(us(h,o,i),2),v=p[0],g=p[1],y=!1;return(g||n)&&(y=zI(l.points,(a||0)+(s||0),e.x+u,e.y+d,!0)),!y&&(v||n)&&(y=YI(l.points,e.x+u,e.y+d)),y}function Gst(t,e,n){var r=t.parsedStyle,i=r.lineWidth,o=r.increasedLineWidthForHitTesting,a=r.points,s=r.defX,l=s===void 0?0:s,c=r.defY,u=c===void 0?0:c,f=r.pointerEvents,d=r.fill,h=r.stroke,p=D(us(f,d,h),2),v=p[1];return!v&&!n||!i?!1:zI(a.points,(i||0)+(o||0),e.x+l,e.y+u,!1)}function Hst(t,e,n,r,i){var o=t.parsedStyle,a=o.radius,s=o.fill,l=o.stroke,c=o.lineWidth,u=o.increasedLineWidthForHitTesting,f=o.width,d=o.height,h=o.pointerEvents,p=D(us(h,s,l),2),v=p[0],g=p[1],y=a&&a.some(function(w){return w!==0}),m=(c||0)+(u||0);if(y){var x=!1;return(g||n)&&(x=Ust(0,0,f,d,a.map(function(w){return Cst(w,0,Math.min(Math.abs(f)/2,Math.abs(d)/2))}),m,e.x,e.y)),!x&&(v||n)&&(x=r(t,e)),x}else{var b=m/2;if(v&&g||n)return Ss(0-b,0-b,f+b,d+b,e.x,e.y);if(v)return Ss(0,0,f,d,e.x,e.y);if(g)return $st(0,0,f,d,m,e.x,e.y)}return!1}function Ust(t,e,n,r,i,o,a,s){var l=D(i,4),c=l[0],u=l[1],f=l[2],d=l[3];return fa(t+c,e,t+n-u,e,o,a,s)||fa(t+n,e+u,t+n,e+r-f,o,a,s)||fa(t+n-f,e+r,t+d,e+r,o,a,s)||fa(t,e+r-d,t,e+c,o,a,s)||$0(t+n-u,e+u,u,1.5*Math.PI,2*Math.PI,o,a,s)||$0(t+n-f,e+r-f,f,0,.5*Math.PI,o,a,s)||$0(t+d,e+r-d,d,.5*Math.PI,Math.PI,o,a,s)||$0(t+c,e+c,c,Math.PI,1.5*Math.PI,o,a,s)}function Vst(t,e,n,r,i,o){var a=t.parsedStyle,s=a.pointerEvents,l=a.width,c=a.height;if(s==="non-transparent-pixel"){var u=i.config.offscreenCanvas,f=o.offscreenCanvasCreator.getOrCreateCanvas(u),d=o.offscreenCanvasCreator.getOrCreateContext(u,{willReadFrequently:!0});f.width=l,f.height=c,i.defaultStyleRendererFactory[H.IMAGE].render(d,t.parsedStyle,t,void 0,void 0,void 0);var h=d.getImageData(e.x,e.y,1,1).data;return h.every(function(p){return p!==0})}return!0}var Xst=function(t){st(e,t);function e(){var n=t.apply(this,Q([],D(arguments),!1))||this;return n.name="canvas-picker",n}return e.prototype.init=function(){var n,r=function(){return!0},i=(n={},n[H.CIRCLE]=jst,n[H.ELLIPSE]=Dst,n[H.RECT]=Hst,n[H.LINE]=Bst,n[H.POLYLINE]=Gst,n[H.POLYGON]=Wst,n[H.PATH]=Yst,n[H.TEXT]=r,n[H.GROUP]=null,n[H.IMAGE]=Vst,n[H.HTML]=null,n[H.MESH]=null,n);this.context.pointInPathPickerFactory=i,this.addRenderingPlugin(new Ist)},e.prototype.destroy=function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()},e}(Qo),qst=function(t){return t==null};const un=qst;var Kst={}.toString,Zst=function(t,e){return Kst.call(t)==="[object "+e+"]"};const Qst=Zst,Jst=function(t){return Qst(t,"String")};var tlt=function(){function t(e){this.canvasRendererPluginOptions=e,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.vpMatrix=Kt(),this.dprMatrix=Kt(),this.tmpMat4=Kt(),this.vec3a=Ct(),this.vec3b=Ct(),this.vec3c=Ct(),this.vec3d=Ct()}return t.prototype.apply=function(e,n){var r=this;this.context=e;var i=e.config,o=e.camera,a=e.renderingService,s=e.renderingContext,l=e.rBushRoot,c=e.pathGeneratorFactory;this.rBush=l,this.pathGeneratorFactory=c;var u=e.contextService,f=s.root.ownerDocument.defaultView,d=function(v){var g=v.target,y=g.rBushNode;y.aabb&&r.removedRBushNodeAABBs.push(y.aabb)},h=function(v){var g=v.target,y=g.rBushNode;y.aabb&&r.removedRBushNodeAABBs.push(y.aabb)};a.hooks.init.tap(t.tag,function(){f.addEventListener(St.UNMOUNTED,d),f.addEventListener(St.CULLED,h);var v=u.getDPR(),g=i.width,y=i.height,m=u.getContext();r.clearRect(m,0,0,g*v,y*v,i.background)}),a.hooks.destroy.tap(t.tag,function(){f.removeEventListener(St.UNMOUNTED,d),f.removeEventListener(St.CULLED,h),r.renderQueue=[],r.removedRBushNodeAABBs=[],r.restoreStack=[]}),a.hooks.beginFrame.tap(t.tag,function(){var v=u.getContext(),g=u.getDPR(),y=i.width,m=i.height,b=r.canvasRendererPluginOptions,x=b.dirtyObjectNumThreshold,w=b.dirtyObjectRatioThreshold,O=a.getStats(),_=O.total,S=O.rendered,E=S/_;r.clearFullScreen=a.disableDirtyRectangleRendering()||S>x&&E>w,v&&(v.resetTransform?v.resetTransform():v.setTransform(1,0,0,1,0,0),r.clearFullScreen&&r.clearRect(v,0,0,y*g,m*g,i.background))});var p=function(v,g){v.isVisible()&&!v.isCulled()&&(r.renderDisplayObject(v,g,r.context,r.restoreStack,n),r.saveDirtyAABB(v));var y=v.sortable.sorted||v.childNodes;y.forEach(function(m){p(m,g)})};a.hooks.endFrame.tap(t.tag,function(){var v=u.getContext(),g=u.getDPR();if(Xy(r.dprMatrix,[g,g,1]),On(r.vpMatrix,r.dprMatrix,o.getOrthoMatrix()),r.clearFullScreen)p(s.root,v);else{var y=r.safeMergeAABB.apply(r,Q([r.mergeDirtyAABBs(r.renderQueue)],D(r.removedRBushNodeAABBs.map(function(F){var R=F.minX,B=F.minY,W=F.maxX,K=F.maxY,J=new Xe;return J.setMinMax([R,B,0],[W,K,0]),J})),!1));if(r.removedRBushNodeAABBs=[],Xe.isEmpty(y)){r.renderQueue=[];return}var m=r.convertAABB2Rect(y),b=m.x,x=m.y,w=m.width,O=m.height,_=Qe(r.vec3a,[b,x,0],r.vpMatrix),S=Qe(r.vec3b,[b+w,x,0],r.vpMatrix),E=Qe(r.vec3c,[b,x+O,0],r.vpMatrix),M=Qe(r.vec3d,[b+w,x+O,0],r.vpMatrix),P=Math.min(_[0],S[0],M[0],E[0]),C=Math.min(_[1],S[1],M[1],E[1]),A=Math.max(_[0],S[0],M[0],E[0]),T=Math.max(_[1],S[1],M[1],E[1]),k=Math.floor(P),N=Math.floor(C),j=Math.ceil(A-P),L=Math.ceil(T-C);v.save(),r.clearRect(v,k,N,j,L,i.background),v.beginPath(),v.rect(k,N,j,L),v.clip(),v.setTransform(r.vpMatrix[0],r.vpMatrix[1],r.vpMatrix[4],r.vpMatrix[5],r.vpMatrix[12],r.vpMatrix[13]);var I=i.renderer.getConfig().enableDirtyRectangleRenderingDebug;I&&f.dispatchEvent(new ee(Qn.DIRTY_RECTANGLE,{dirtyRect:{x:k,y:N,width:j,height:L}}));var $=r.searchDirtyObjects(y);$.sort(function(F,R){return F.sortable.renderOrder-R.sortable.renderOrder}).forEach(function(F){F&&F.isVisible()&&!F.isCulled()&&r.renderDisplayObject(F,v,r.context,r.restoreStack,n)}),v.restore(),r.renderQueue.forEach(function(F){r.saveDirtyAABB(F)}),r.renderQueue=[]}r.restoreStack.forEach(function(){v.restore()}),r.restoreStack=[]}),a.hooks.render.tap(t.tag,function(v){r.clearFullScreen||r.renderQueue.push(v)})},t.prototype.clearRect=function(e,n,r,i,o,a){e.clearRect(n,r,i,o),a&&(e.fillStyle=a,e.fillRect(n,r,i,o))},t.prototype.renderDisplayObject=function(e,n,r,i,o){var a=e.nodeName,s=i[i.length-1];s&&!(e.compareDocumentPosition(s)&an.DOCUMENT_POSITION_CONTAINS)&&(n.restore(),i.pop());var l=this.context.styleRendererFactory[a],c=this.pathGeneratorFactory[a],u=e.parsedStyle.clipPath;if(u){this.applyWorldTransform(n,u);var f=this.pathGeneratorFactory[u.nodeName];f&&(n.save(),i.push(e),n.beginPath(),f(n,u.parsedStyle),n.closePath(),n.clip())}l&&(this.applyWorldTransform(n,e),n.save(),this.applyAttributesToContext(n,e)),c&&(n.beginPath(),c(n,e.parsedStyle),e.nodeName!==H.LINE&&e.nodeName!==H.PATH&&e.nodeName!==H.POLYLINE&&n.closePath()),l&&(l.render(n,e.parsedStyle,e,r,this,o),n.restore()),e.renderable.dirty=!1},t.prototype.convertAABB2Rect=function(e){var n=e.getMin(),r=e.getMax(),i=Math.floor(n[0]),o=Math.floor(n[1]),a=Math.ceil(r[0]),s=Math.ceil(r[1]),l=a-i,c=s-o;return{x:i,y:o,width:l,height:c}},t.prototype.mergeDirtyAABBs=function(e){var n=new Xe;return e.forEach(function(r){var i=r.getRenderBounds();n.add(i);var o=r.renderable.dirtyRenderBounds;o&&n.add(o)}),n},t.prototype.searchDirtyObjects=function(e){var n=D(e.getMin(),2),r=n[0],i=n[1],o=D(e.getMax(),2),a=o[0],s=o[1],l=this.rBush.search({minX:r,minY:i,maxX:a,maxY:s});return l.map(function(c){var u=c.displayObject;return u})},t.prototype.saveDirtyAABB=function(e){var n=e.renderable;n.dirtyRenderBounds||(n.dirtyRenderBounds=new Xe);var r=e.getRenderBounds();r&&n.dirtyRenderBounds.update(r.center,r.halfExtents)},t.prototype.applyAttributesToContext=function(e,n){var r=n.parsedStyle,i=r.stroke,o=r.fill,a=r.opacity,s=r.lineDash,l=r.lineDashOffset;s&&e.setLineDash(s),un(l)||(e.lineDashOffset=l),un(a)||(e.globalAlpha*=a),!un(i)&&!Array.isArray(i)&&!i.isNone&&(e.strokeStyle=n.attributes.stroke),!un(o)&&!Array.isArray(o)&&!o.isNone&&(e.fillStyle=n.attributes.fill)},t.prototype.applyWorldTransform=function(e,n,r){var i=0,o=0,a=(n.parsedStyle||{}).anchor,s=a&&a[0]||0,l=a&&a[1]||0;if(s!==0||l!==0){var c=n.geometry.contentBounds,u=c&&c.halfExtents[0]*2||0,f=c&&c.halfExtents[1]*2||0;i=-(s*u),o=-(l*f)}r?(qa(this.tmpMat4,n.getLocalTransform()),this.vec3a[0]=i,this.vec3a[1]=o,this.vec3a[2]=0,Yo(this.tmpMat4,this.tmpMat4,this.vec3a),On(this.tmpMat4,r,this.tmpMat4),On(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(qa(this.tmpMat4,n.getWorldTransform()),this.vec3a[0]=i,this.vec3a[1]=o,this.vec3a[2]=0,Yo(this.tmpMat4,this.tmpMat4,this.vec3a),On(this.tmpMat4,this.vpMatrix,this.tmpMat4)),e.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])},t.prototype.safeMergeAABB=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=new Xe;return e.forEach(function(i){r.add(i)}),r},t.tag="CanvasRenderer",t}(),da=function(){function t(e){this.imagePool=e}return t.prototype.render=function(e,n,r,i,o,a){var s=n.fill,l=n.fillRule,c=n.opacity,u=n.fillOpacity,f=n.stroke,d=n.strokeOpacity,h=n.lineWidth,p=n.lineCap,v=n.lineJoin,g=n.shadowType,y=n.shadowColor,m=n.shadowBlur,b=n.filter,x=n.miterLimit,w=!un(s)&&!s.isNone,O=!un(f)&&!f.isNone&&h>0,_=s.alpha===0,S=!!(b&&b.length),E=!un(y)&&m>0,M=r.nodeName,P=g==="inner",C=O&&E&&(M===H.PATH||M===H.LINE||M===H.POLYLINE||_||P);w&&(e.globalAlpha=c*u,C||F0(r,e,E),this.fill(e,r,s,l,i,o,a),C||this.clearShadowAndFilter(e,S,E)),O&&(e.globalAlpha=c*d,e.lineWidth=h,un(x)||(e.miterLimit=x),un(p)||(e.lineCap=p),un(v)||(e.lineJoin=v),C&&(P&&(e.globalCompositeOperation="source-atop"),F0(r,e,!0),P&&(this.stroke(e,r,f,i,o,a),e.globalCompositeOperation="source-over",this.clearShadowAndFilter(e,S,!0))),this.stroke(e,r,f,i,o,a))},t.prototype.clearShadowAndFilter=function(e,n,r){if(r&&(e.shadowColor="transparent",e.shadowBlur=0),n){var i=e.filter;!un(i)&&i.indexOf("drop-shadow")>-1&&(e.filter=i.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}},t.prototype.fill=function(e,n,r,i,o,a,s){var l=this;Array.isArray(r)?r.forEach(function(c){e.fillStyle=l.getColor(c,n,e),i?e.fill(i):e.fill()}):(Ku(r)&&(e.fillStyle=this.getPattern(r,n,e,o,a,s)),i?e.fill(i):e.fill())},t.prototype.stroke=function(e,n,r,i,o,a){var s=this;Array.isArray(r)?r.forEach(function(l){e.strokeStyle=s.getColor(l,n,e),e.stroke()}):(Ku(r)&&(e.strokeStyle=this.getPattern(r,n,e,i,o,a)),e.stroke())},t.prototype.getPattern=function(e,n,r,i,o,a){var s,l;if(e.image.nodeName==="rect"){var c=e.image.parsedStyle,u=c.width,f=c.height;l=i.contextService.getDPR();var d=i.config.offscreenCanvas;s=a.offscreenCanvasCreator.getOrCreateCanvas(d),s.width=u*l,s.height=f*l;var h=a.offscreenCanvasCreator.getOrCreateContext(d),p=[];e.image.forEach(function(g){o.renderDisplayObject(g,h,i,p,a)}),p.forEach(function(){h.restore()})}var v=this.imagePool.getOrCreatePatternSync(e,r,s,l,function(){n.renderable.dirty=!0,i.renderingService.dirtify()});return v},t.prototype.getColor=function(e,n,r){var i;if(e.type===Li.LinearGradient||e.type===Li.RadialGradient){var o=n.getGeometryBounds(),a=o&&o.halfExtents[0]*2||1,s=o&&o.halfExtents[1]*2||1;i=this.imagePool.getOrCreateGradient(G(G({type:e.type},e.value),{width:a,height:s}),r)}return i},t}();function F0(t,e,n){var r=t.parsedStyle,i=r.filter,o=r.shadowColor,a=r.shadowBlur,s=r.shadowOffsetX,l=r.shadowOffsetY;i&&i.length&&(e.filter=t.style.filter),n&&(e.shadowColor=o.toString(),e.shadowBlur=a||0,e.shadowOffsetX=s||0,e.shadowOffsetY=l||0)}var elt=function(){function t(e){this.imagePool=e}return t.prototype.render=function(e,n,r){var i=n.width,o=n.height,a=n.img,s=n.shadowColor,l=n.shadowBlur,c,u=i,f=o;if(Jst(a)?c=this.imagePool.getImageSync(a):(u||(u=a.width),f||(f=a.height),c=a),c){var d=!un(s)&&l>0;F0(r,e,d);try{e.drawImage(c,0,0,u,f)}catch(h){}}},t}(),nlt=function(){function t(){}return t.prototype.render=function(e,n,r,i,o,a){var s=n,l=s.lineWidth,c=s.textAlign,u=s.textBaseline,f=s.lineJoin,d=s.miterLimit,h=s.letterSpacing,p=s.stroke,v=s.fill,g=s.fillOpacity,y=s.strokeOpacity,m=s.opacity,b=s.metrics,x=s.dx,w=s.dy,O=s.shadowColor,_=s.shadowBlur,S=b.font,E=b.lines,M=b.height,P=b.lineHeight,C=b.lineMetrics;e.font=S,e.lineWidth=l,e.textAlign=c==="middle"?"center":c;var A=u;!a.enableCSSParsing&&A==="alphabetic"&&(A="bottom"),e.lineJoin=f,un(d)||(e.miterLimit=d);var T=0;u==="middle"?T=-M/2-P/2:u==="bottom"||u==="alphabetic"||u==="ideographic"?T=-M:(u==="top"||u==="hanging")&&(T=-P);var k=x||0;T+=w||0,E.length===1&&(A==="bottom"?(A="middle",T-=.5*M):A==="top"&&(A="middle",T+=.5*M)),e.textBaseline=A;var N=!un(O)&&_>0;F0(r,e,N);for(var j=0;j<E.length;j++){var L=l/2+k;T+=P,!un(p)&&!p.isNone&&l&&this.drawLetterSpacing(e,E[j],C[j],c,L,T,h,g,y,m,!0),un(v)||this.drawLetterSpacing(e,E[j],C[j],c,L,T,h,g,y,m)}},t.prototype.drawLetterSpacing=function(e,n,r,i,o,a,s,l,c,u,f){if(f===void 0&&(f=!1),s===0){f?this.strokeText(e,n,o,a,c):this.fillText(e,n,o,a,l,u);return}var d=e.textAlign;e.textAlign="left";var h=o;i==="center"||i==="middle"?h=o-r.width/2:(i==="right"||i==="end")&&(h=o-r.width);for(var p=Array.from(n),v=e.measureText(n).width,g=0,y=0;y<p.length;++y){var m=p[y];f?this.strokeText(e,m,h,a,c):this.fillText(e,m,h,a,l,u),g=e.measureText(n.substring(y+1)).width,h+=v-g+s,v=g}e.textAlign=d},t.prototype.fillText=function(e,n,r,i,o,a){var s,l=!un(o)&&o!==1;l&&(s=e.globalAlpha,e.globalAlpha=o*a),e.fillText(n,r,i),l&&(e.globalAlpha=s)},t.prototype.strokeText=function(e,n,r,i,o){var a,s=!un(o)&&o!==1;s&&(a=e.globalAlpha,e.globalAlpha=o),e.strokeText(n,r,i),s&&(e.globalAlpha=a)},t}();(function(t){st(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(da),function(t){st(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(da),function(t){st(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(da),function(t){st(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(da),function(t){st(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(da),function(t){st(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(da),function(t){st(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(da);var rlt=function(t){st(e,t);function e(n){n===void 0&&(n={});var r=t.call(this)||this;return r.options=n,r.name="canvas-renderer",r}return e.prototype.init=function(){var n,r=G({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),i=this.context.imagePool,o=new da(i),a=(n={},n[H.CIRCLE]=o,n[H.ELLIPSE]=o,n[H.RECT]=o,n[H.IMAGE]=new elt(i),n[H.TEXT]=new nlt,n[H.LINE]=o,n[H.POLYLINE]=o,n[H.POLYGON]=o,n[H.PATH]=o,n[H.GROUP]=void 0,n[H.HTML]=void 0,n[H.MESH]=void 0,n);this.context.defaultStyleRendererFactory=a,this.context.styleRendererFactory=a,this.addRenderingPlugin(new tlt(r))},e.prototype.destroy=function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory},e}(Qo),ilt=function(){function t(){}return t.prototype.apply=function(e,n){var r=this,i=e.renderingService,o=e.renderingContext,a=e.config;this.context=e;var s=o.root.ownerDocument.defaultView,l=function(O){i.hooks.pointerMove.call(O)},c=function(O){i.hooks.pointerUp.call(O)},u=function(O){i.hooks.pointerDown.call(O)},f=function(O){i.hooks.pointerOver.call(O)},d=function(O){i.hooks.pointerOut.call(O)},h=function(O){i.hooks.pointerCancel.call(O)},p=function(O){i.hooks.pointerWheel.call(O)},v=function(O){i.hooks.click.call(O)},g=function(O){n.globalThis.document.addEventListener("pointermove",l,!0),O.addEventListener("pointerdown",u,!0),O.addEventListener("pointerleave",d,!0),O.addEventListener("pointerover",f,!0),n.globalThis.addEventListener("pointerup",c,!0),n.globalThis.addEventListener("pointercancel",h,!0)},y=function(O){O.addEventListener("touchstart",u,!0),O.addEventListener("touchend",c,!0),O.addEventListener("touchmove",l,!0),O.addEventListener("touchcancel",h,!0)},m=function(O){n.globalThis.document.addEventListener("mousemove",l,!0),O.addEventListener("mousedown",u,!0),O.addEventListener("mouseout",d,!0),O.addEventListener("mouseover",f,!0),n.globalThis.addEventListener("mouseup",c,!0)},b=function(O){n.globalThis.document.removeEventListener("pointermove",l,!0),O.removeEventListener("pointerdown",u,!0),O.removeEventListener("pointerleave",d,!0),O.removeEventListener("pointerover",f,!0),n.globalThis.removeEventListener("pointerup",c,!0)},x=function(O){O.removeEventListener("touchstart",u,!0),O.removeEventListener("touchend",c,!0),O.removeEventListener("touchmove",l,!0),O.removeEventListener("touchcancel",h,!0)},w=function(O){n.globalThis.document.removeEventListener("mousemove",l,!0),O.removeEventListener("mousedown",u,!0),O.removeEventListener("mouseout",d,!0),O.removeEventListener("mouseover",f,!0),n.globalThis.removeEventListener("mouseup",c,!0)};i.hooks.init.tap(t.tag,function(){var O=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(O.style.msContentZooming="none",O.style.msTouchAction="none"):s.supportsPointerEvents&&(O.style.touchAction="none"),s.supportsPointerEvents?g(O):m(O),s.supportsTouchEvents&&y(O),a.useNativeClickEvent&&O.addEventListener("click",v,!0),O.addEventListener("wheel",p,{passive:!0,capture:!0})}),i.hooks.destroy.tap(t.tag,function(){var O=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(O.style.msContentZooming="",O.style.msTouchAction=""):s.supportsPointerEvents&&(O.style.touchAction=""),s.supportsPointerEvents?b(O):w(O),s.supportsTouchEvents&&x(O),a.useNativeClickEvent&&O.removeEventListener("click",v,!0),O.removeEventListener("wheel",p,!0)})},t.tag="DOMInteraction",t}(),olt=function(t){st(e,t);function e(){var n=t.apply(this,Q([],D(arguments),!1))||this;return n.name="dom-interaction",n}return e.prototype.init=function(){this.addRenderingPlugin(new ilt)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(Qo),alt=function(t){return t==null};const slt=alt;var llt={}.toString,clt=function(t,e){return llt.call(t)==="[object "+e+"]"};const GI=clt,ult=function(t){return GI(t,"String")};var flt=function(t){return GI(t,"Number")};const HI=flt;var dlt="g-canvas-camera",hlt=function(){function t(){this.displayObjectHTMLElementMap=new WeakMap}return t.prototype.joinTransformMatrix=function(e){return"matrix(".concat([e[0],e[1],e[4],e[5],e[12],e[13]].join(","),")")},t.prototype.apply=function(e,n){var r=this,i=e.camera,o=e.renderingContext,a=e.renderingService;this.context=e;var s=o.root.ownerDocument.defaultView,l=s.context.eventService.nativeHTMLMap,c=function(v,g){g.style.transform=r.joinTransformMatrix(v.getWorldTransform())},u=function(v){var g=v.target;if(g.nodeName===H.HTML){r.$camera||(r.$camera=r.createCamera(i));var y=r.getOrCreateEl(g);if(r.$camera.appendChild(y),n.enableCSSParsing){var m=g.ownerDocument.documentElement.attributes;Object.keys(m).forEach(function(b){y.style[b]=m[b]})}Object.keys(g.attributes).forEach(function(b){r.updateAttribute(b,g)}),c(g,y),l.set(y,g)}},f=function(v){var g=v.target;if(g.nodeName===H.HTML&&r.$camera){var y=r.getOrCreateEl(g);y&&(y.remove(),l.delete(y))}},d=function(v){var g=v.target;if(g.nodeName===H.HTML){var y=v.attrName;r.updateAttribute(y,g)}},h=function(v){var g=v.target;if(g.nodeName===H.HTML){var y=r.getOrCreateEl(g);c(g,y)}},p=function(){if(r.$camera){var v=r.context.config,g=v.width,y=v.height;r.$camera.style.width="".concat(g||0,"px"),r.$camera.style.height="".concat(y||0,"px")}};a.hooks.init.tap(t.tag,function(){s.addEventListener(Qn.RESIZE,p),s.addEventListener(St.MOUNTED,u),s.addEventListener(St.UNMOUNTED,f),s.addEventListener(St.ATTR_MODIFIED,d),s.addEventListener(St.BOUNDS_CHANGED,h)}),a.hooks.endFrame.tap(t.tag,function(){r.$camera&&o.renderReasons.has(na.CAMERA_CHANGED)&&(r.$camera.style.transform=r.joinTransformMatrix(i.getOrthoMatrix()))}),a.hooks.destroy.tap(t.tag,function(){r.$camera&&r.$camera.remove(),s.removeEventListener(Qn.RESIZE,p),s.removeEventListener(St.MOUNTED,u),s.removeEventListener(St.UNMOUNTED,f),s.removeEventListener(St.ATTR_MODIFIED,d),s.removeEventListener(St.BOUNDS_CHANGED,h)})},t.prototype.createCamera=function(e){var n=this.context.config,r=n.document,i=n.width,o=n.height,a=this.context.contextService.getDomElement(),s=a.parentNode;if(s){var l=dlt,c=s.querySelector("#"+l);if(!c){var u=(r||document).createElement("div");c=u,u.id=l,u.style.position="absolute",u.style.left="".concat(a.offsetLeft||0,"px"),u.style.top="".concat(a.offsetTop||0,"px"),u.style.transformOrigin="left top",u.style.transform=this.joinTransformMatrix(e.getOrthoMatrix()),u.style.overflow="hidden",u.style.pointerEvents="none",u.style.width="".concat(i||0,"px"),u.style.height="".concat(o||0,"px"),s.appendChild(u)}return c}return null},t.prototype.getOrCreateEl=function(e){var n=this.context.config.document,r=this.displayObjectHTMLElementMap.get(e);return r||(r=(n||document).createElement("div"),e.parsedStyle.$el=r,this.displayObjectHTMLElementMap.set(e,r),e.id&&(r.id=e.id),e.name&&r.setAttribute("name",e.name),e.className&&(r.className=e.className),r.style.position="absolute",r.style.left="0px",r.style.top="0px",r.style["will-change"]="transform",r.style.transform=this.joinTransformMatrix(e.getWorldTransform())),r},t.prototype.updateAttribute=function(e,n){var r=this.getOrCreateEl(n);switch(e){case"innerHTML":var i=n.parsedStyle.innerHTML;ult(i)?r.innerHTML=i:(r.innerHTML="",r.appendChild(i));break;case"transformOrigin":var o=n.parsedStyle.transformOrigin;r.style["transform-origin"]="".concat(o[0].value," ").concat(o[1].value);break;case"width":if(this.context.enableCSSParsing){var a=n.computedStyleMap().get("width");r.style.width=a.toString()}else{var a=n.parsedStyle.width;r.style.width=HI(a)?"".concat(a,"px"):a.toString()}break;case"height":if(this.context.enableCSSParsing){var s=n.computedStyleMap().get("height");r.style.height=s.toString()}else{var s=n.parsedStyle.height;r.style.height=HI(s)?"".concat(s,"px"):s.toString()}break;case"zIndex":var l=n.parsedStyle.zIndex;r.style["z-index"]="".concat(l);break;case"visibility":var c=n.parsedStyle.visibility;r.style.visibility=c;break;case"pointerEvents":var u=n.parsedStyle.pointerEvents;r.style.pointerEvents=u;break;case"opacity":var f=n.parsedStyle.opacity;r.style.opacity="".concat(f);break;case"fill":var d=n.parsedStyle.fill,h="";pp(d)?d.isNone?h="transparent":h=n.getAttribute("fill"):Array.isArray(d)?h=n.getAttribute("fill"):Ku(d),r.style.background=h;break;case"stroke":var p=n.parsedStyle.stroke,v="";pp(p)?p.isNone?v="transparent":v=n.getAttribute("stroke"):Array.isArray(p)?v=n.getAttribute("stroke"):Ku(p),r.style["border-color"]=v,r.style["border-style"]="solid";break;case"lineWidth":var g=n.parsedStyle.lineWidth;r.style["border-width"]="".concat(g||0,"px");break;case"lineDash":r.style["border-style"]="dashed";break;case"filter":var y=n.style.filter;r.style.filter=y;break;default:e!=="x"&&e!=="y"&&!slt(n.style[e])&&n.style[e]!==""&&(r.style[e]=n.style[e])}},t.tag="HTMLRendering",t}(),plt=function(t){st(e,t);function e(){var n=t.apply(this,Q([],D(arguments),!1))||this;return n.name="html-renderer",n}return e.prototype.init=function(){this.addRenderingPlugin(new hlt)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(Qo),vlt={}.toString,glt=function(t,e){return vlt.call(t)==="[object "+e+"]"};const ylt=glt,R0=function(t){return ylt(t,"String")};var mlt=function(){function t(e){this.canvasConfig=e,this.imageCache={},this.gradientCache={},this.patternCache={}}return t.prototype.getImageSync=function(e,n){return this.imageCache[e]?n&&n(this.imageCache[e]):this.getOrCreateImage(e).then(function(r){n&&n(r)}),this.imageCache[e]},t.prototype.getOrCreateImage=function(e){var n=this;if(this.imageCache[e])return Promise.resolve(this.imageCache[e]);var r=this.canvasConfig.createImage;return new Promise(function(i,o){var a;r?a=r(e):tf&&(a=new window.Image),a&&(a.onload=function(){n.imageCache[e]=a,i(a)},a.onerror=function(s){o(s)},a.crossOrigin="Anonymous",a.src=e)})},t.prototype.getOrCreatePatternSync=function(e,n,r,i,o){var a=this.generatePatternKey(e);if(a&&this.patternCache[a])return this.patternCache[a];var s=e.image,l=e.repetition,c=e.transform,u,f=!1;R0(s)?u=this.getImageSync(s,o):r?(u=r,f=!0):u=s;var d=u&&n.createPattern(u,l);if(d){var h=void 0;c?h=C1(_1(c),new Mn({})):h=pu(Kt()),f&&gh(h,h,[1/i,1/i,1]),d.setTransform({a:h[0],b:h[1],c:h[4],d:h[5],e:h[12],f:h[13]})}return a&&d&&(this.patternCache[a]=d),d},t.prototype.getOrCreateGradient=function(e,n){var r=this.generateGradientKey(e),i=e.type,o=e.steps,a=e.width,s=e.height,l=e.angle,c=e.cx,u=e.cy,f=e.size;if(this.gradientCache[r])return this.gradientCache[r];var d=null;if(i===Li.LinearGradient){var h=PV(a,s,l),p=h.x1,v=h.y1,g=h.x2,y=h.y2;d=n.createLinearGradient(p,v,g,y)}else if(i===Li.RadialGradient){var m=AV(a,s,c,u,f),b=m.x,x=m.y,w=m.r;d=n.createRadialGradient(b,x,0,b,x,w)}return d&&(o.forEach(function(O){var _=O.offset,S=O.color;_.unit===rt.kPercentage&&(d==null||d.addColorStop(_.value/100,S.toString()))}),this.gradientCache[r]=d),this.gradientCache[r]},t.prototype.generateGradientKey=function(e){var n=e.type,r=e.width,i=e.height,o=e.steps,a=e.angle,s=e.cx,l=e.cy,c=e.size;return"gradient-".concat(n,"-").concat((a==null?void 0:a.toString())||0,"-").concat((s==null?void 0:s.toString())||0,"-").concat((l==null?void 0:l.toString())||0,"-").concat((c==null?void 0:c.toString())||0,"-").concat(r,"-").concat(i,"-").concat(o.map(function(u){var f=u.offset,d=u.color;return"".concat(f).concat(d)}).join("-"))},t.prototype.generatePatternKey=function(e){var n=e.image,r=e.repetition;if(R0(n))return"pattern-".concat(n,"-").concat(r);if(n.nodeName==="rect")return"pattern-".concat(n.entity,"-").concat(r)},t}(),blt=function(){function t(){}return t.prototype.apply=function(e){var n=e.renderingService,r=e.renderingContext,i=e.imagePool,o=r.root.ownerDocument.defaultView,a=function(c,u,f){var d=c.parsedStyle,h=d.width,p=d.height;h&&!p?c.setAttribute("height",f/u*h):!h&&p&&c.setAttribute("width",u/f*p)},s=function(c){var u=c.target,f=u.nodeName,d=u.attributes;if(f===H.IMAGE){var h=d.img,p=d.keepAspectRatio;R0(h)&&i.getImageSync(h,function(v){var g=v.width,y=v.height;p&&a(u,g,y),u.renderable.dirty=!0,n.dirtify()})}},l=function(c){var u=c.target,f=c.attrName,d=c.newValue;u.nodeName===H.IMAGE&&f==="img"&&R0(d)&&i.getOrCreateImage(d).then(function(h){var p=h.width,v=h.height;u.attributes.keepAspectRatio&&a(u,p,v),u.renderable.dirty=!0,n.dirtify()})};n.hooks.init.tap(t.tag,function(){o.addEventListener(St.MOUNTED,s),o.addEventListener(St.ATTR_MODIFIED,l)}),n.hooks.destroy.tap(t.tag,function(){o.removeEventListener(St.MOUNTED,s),o.removeEventListener(St.ATTR_MODIFIED,l)})},t.tag="LoadImage",t}(),xlt=function(t){st(e,t);function e(){var n=t.apply(this,Q([],D(arguments),!1))||this;return n.name="image-loader",n}return e.prototype.init=function(){this.context.imagePool=new mlt(this.context.config),this.addRenderingPlugin(new blt)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(Qo),wlt={}.toString,Olt=function(t,e){return wlt.call(t)==="[object "+e+"]"};const _lt=Olt,Slt=function(t){return _lt(t,"String")};var Elt=function(){function t(e){this.renderingContext=e.renderingContext,this.canvasConfig=e.config}return t.prototype.init=function(){var e=this.canvasConfig,n=e.container,r=e.canvas;if(r)this.$canvas=r,n&&r.parentElement!==n&&n.appendChild(r),this.$container=r.parentElement,this.canvasConfig.container=this.$container;else if(n&&(this.$container=Slt(n)?document.getElementById(n):n,this.$container)){var i=document.createElement("canvas");this.$container.appendChild(i),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=i}this.context=this.$canvas.getContext("2d"),this.resize(this.canvasConfig.width,this.canvasConfig.height)},t.prototype.getContext=function(){return this.context},t.prototype.getDomElement=function(){return this.$canvas},t.prototype.getDPR=function(){return this.dpr},t.prototype.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},t.prototype.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},t.prototype.resize=function(e,n){var r=this.canvasConfig.devicePixelRatio,i=r||tf&&window.devicePixelRatio||1;i=i>=1?Math.ceil(i):1,this.dpr=i,this.$canvas&&(this.$canvas.width=this.dpr*e,this.$canvas.height=this.dpr*n,DX(this.$canvas,e,n)),this.renderingContext.renderReasons.add(na.CAMERA_CHANGED)},t.prototype.applyCursorStyle=function(e){this.$container&&this.$container.style&&(this.$container.style.cursor=e)},t.prototype.toDataURL=function(e){return e===void 0&&(e={}),hl(this,void 0,void 0,function(){var n,r;return pl(this,function(i){return n=e.type,r=e.encoderOptions,[2,this.context.canvas.toDataURL(n,r)]})})},t}(),Mlt=function(t){st(e,t);function e(){var n=t.apply(this,Q([],D(arguments),!1))||this;return n.name="canvas-context-register",n}return e.prototype.init=function(){this.context.ContextService=Elt},e.prototype.destroy=function(){delete this.context.ContextService},e}(Qo),UI=function(t){st(e,t);function e(n){var r=t.call(this,n)||this;return r.registerPlugin(new Mlt),r.registerPlugin(new xlt),r.registerPlugin(new Pst),r.registerPlugin(new rlt),r.registerPlugin(new olt),r.registerPlugin(new Xst),r.registerPlugin(new plt),r}return e}(ZU);function Plt(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var Alt=function(){function t(e){this.dragndropPluginOptions=e}return t.prototype.apply=function(e){var n=this,r=e.renderingService,i=e.renderingContext,o=i.root.ownerDocument,a=o.defaultView,s=function(l){var c=l.target,u=c===o,f=u&&n.dragndropPluginOptions.isDocumentDraggable?o:c.closest&&c.closest("[draggable=true]");if(f){var d=!1,h=l.timeStamp,p=[l.clientX,l.clientY],v=null,g=[l.clientX,l.clientY],y=function(b){return hl(n,void 0,void 0,function(){var x,w,O,_,S,E;return pl(this,function(M){switch(M.label){case 0:if(!d){if(x=b.timeStamp-h,w=Plt([b.clientX,b.clientY],p),x<=this.dragndropPluginOptions.dragstartTimeThreshold||w<=this.dragndropPluginOptions.dragstartDistanceThreshold)return[2];b.type="dragstart",f.dispatchEvent(b),d=!0}return b.type="drag",b.dx=b.clientX-g[0],b.dy=b.clientY-g[1],f.dispatchEvent(b),g=[b.clientX,b.clientY],u?[3,2]:(O=this.dragndropPluginOptions.overlap==="pointer"?[b.canvasX,b.canvasY]:c.getBounds().center,[4,o.elementsFromPoint(O[0],O[1])]);case 1:_=M.sent(),S=_[_.indexOf(c)+1],E=(S==null?void 0:S.closest("[droppable=true]"))||(this.dragndropPluginOptions.isDocumentDroppable?o:null),v!==E&&(v&&(b.type="dragleave",b.target=v,v.dispatchEvent(b)),E&&(b.type="dragenter",b.target=E,E.dispatchEvent(b)),v=E,v&&(b.type="dragover",b.target=v,v.dispatchEvent(b))),M.label=2;case 2:return[2]}})})};a.addEventListener("pointermove",y);var m=function(b){if(d){b.detail={preventClick:!0};var x=b.clone();v&&(x.type="drop",x.target=v,v.dispatchEvent(x)),x.type="dragend",f.dispatchEvent(x),d=!1}a.removeEventListener("pointermove",y)};c.addEventListener("pointerup",m,{once:!0}),c.addEventListener("pointerupoutside",m,{once:!0})}};r.hooks.init.tap(t.tag,function(){a.addEventListener("pointerdown",s)}),r.hooks.destroy.tap(t.tag,function(){a.removeEventListener("pointerdown",s)})},t.tag="Dragndrop",t}(),VI=function(t){st(e,t);function e(n){n===void 0&&(n={});var r=t.call(this)||this;return r.options=n,r.name="dragndrop",r}return e.prototype.init=function(){this.addRenderingPlugin(new Alt(G({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e.prototype.setOptions=function(n){Object.assign(this.plugins[0].dragndropPluginOptions,n)},e}(Qo),Clt="*",Ax=function(){function t(){this._events={}}return t.prototype.on=function(e,n,r){return this._events[e]||(this._events[e]=[]),this._events[e].push({callback:n,once:!!r}),this},t.prototype.once=function(e,n){return this.on(e,n,!0)},t.prototype.emit=function(e){for(var n=this,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];var o=this._events[e]||[],a=this._events[Clt]||[],s=function(l){for(var c=l.length,u=0;u<c;u++)if(l[u]){var f=l[u],d=f.callback,h=f.once;h&&(l.splice(u,1),l.length===0&&delete n._events[e],c--,u--),d.apply(n,r)}};s(o),s(a)},t.prototype.off=function(e,n){if(!e)this._events={};else if(!n)delete this._events[e];else{for(var r=this._events[e]||[],i=r.length,o=0;o<i;o++)r[o].callback===n&&(r.splice(o,1),i--,o--);r.length===0&&delete this._events[e]}return this},t.prototype.getEvents=function(){return this._events},t}();const Ut={BEFORE_RENDER:"beforerender",AFTER_RENDER:"afterrender",BEFORE_PAINT:"beforepaint",AFTER_PAINT:"afterpaint",BEFORE_CHANGE_DATA:"beforechangedata",AFTER_CHANGE_DATA:"afterchangedata",BEFORE_CLEAR:"beforeclear",AFTER_CLEAR:"afterclear",BEFORE_DESTROY:"beforedestroy",AFTER_DESTROY:"afterdestroy",BEFORE_CHANGE_SIZE:"beforechangesize",AFTER_CHANGE_SIZE:"afterchangesize",POINTER_TAP:"pointertap",POINTER_DOWN:"pointerdown",POINTER_UP:"pointerup",POINTER_OVER:"pointerover",POINTER_OUT:"pointerout",POINTER_MOVE:"pointermove",POINTER_ENTER:"pointerenter",POINTER_LEAVE:"pointerleave",POINTER_UPOUTSIDE:"pointerupoutside",DRAG_START:"dragstart",DRAG:"drag",DRAG_END:"dragend",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"DROP",CLICK:"click",DBLCLICK:"dblclick"},Tlt=[["legendCategory",[[["color","discrete"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","discrete"]],[["color","discrete"],["opacity","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"]],[["color","discrete"],["opacity","constant"],["size","constant"]],[["color","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"]],[["color","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["shape","discrete"]],[["color","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"]],[["color","discrete"],["opacity","constant"]],[["color","discrete"],["shape","constant"]],[["color","constant"],["shape","discrete"]],[["color","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"]],[["color","discrete"]]]],["legendContinuousSize",[[["color","continuous"],["opacity","continuous"],["size","continuous"]],[["color","constant"],["opacity","continuous"],["size","continuous"]],[["color","continuous"],["size","continuous"]],[["color","constant"],["size","continuous"]],[["size","continuous"],["opacity","continuous"]],[["size","continuous"]]]],["legendContinuousBlockSize",[[["color","distribution"],["opacity","distribution"],["size","distribution"]],[["color","distribution"],["size","distribution"]]]],["legendContinuousBlock",[[["color","distribution"],["opacity","continuous"]],[["color","distribution"]]]],["legendContinuous",[[["color","continuous"],["opacity","continuous"]],[["color","continuous"]],[["opacity","continuous"]]]]];var klt={}.toString,B0=function(t,e){return klt.call(t)==="[object "+e+"]"};const XI=function(t){return B0(t,"Function")},qI=function(t){return Array.isArray?Array.isArray(t):B0(t,"Array")},Llt=function(t){var e=typeof t;return t!==null&&e==="object"||e==="function"};function Nlt(t,e){if(t){var n;if(qI(t))for(var r=0,i=t.length;r<i&&(n=e(t[r],r),n!==!1);r++);else if(Llt(t)){for(var o in t)if(t.hasOwnProperty(o)&&(n=e(t[o],o),n===!1))break}}}var Ilt=function(t){return typeof t=="object"&&t!==null},KI=function(t){if(!Ilt(t)||!B0(t,"Object"))return!1;if(Object.getPrototypeOf(t)===null)return!0;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};const jlt=function(t){return B0(t,"String")};var Dlt=Object.values?function(t){return Object.values(t)}:function(t){var e=[];return Nlt(t,function(n,r){XI(t)&&r==="prototype"||e.push(n)}),e},$lt=function(t){return t===null},Flt=function(t){return t===void 0};const Rlt=function(t,e){if(!XI(t))throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=t.apply(this,r);return a.set(o,s),s};return n.cache=new Map,n};var Blt=5;function ZI(t,e,n,r){n=n||0,r=r||Blt;for(var i in e)if(e.hasOwnProperty(i)){var o=e[i];o!==null&&KI(o)?(KI(t[i])||(t[i]={}),n<r?ZI(t[i],o,n+1,r):t[i]=e[i]):qI(o)?(t[i]=[],t[i]=t[i].concat(o)):o!==void 0&&(t[i]=o)}}var z0=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)ZI(t,e[r]);return t};const Ql=function(t){return t};var Y0;Rlt(function(t,e){e===void 0&&(e={});var n=e.fontSize,r=e.fontFamily,i=e.fontWeight,o=e.fontStyle,a=e.fontVariant;return Y0||(Y0=document.createElement("canvas").getContext("2d")),Y0.font=[o,a,i,n+"px",r].join(" "),Y0.measureText(jlt(t)?t:"").width},function(t,e){return e===void 0&&(e={}),nm([t],Dlt(e)).join("")});function QI(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t?e.reduce(function(r,i){return function(o){return i(r(o))}},t):Ql}function JI(t){return t instanceof Float32Array||t instanceof Array}var t4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},e4=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};function zlt(t){return function(e){for(var n=[],r=0;r<e.length-1;r+=2){var i=[e[r],e[r+1]],o=t(i);n.push.apply(n,e4([],t4(o),!1))}return n}}function Ylt(t){return function(e){for(var n=[],r=0;r<e.length-1;r+=3){var i=[e[r],e[r+1],e[r+2]],o=t(i);n.push.apply(n,e4([],t4(o),!1))}return n}}function n4(t,e,n){for(;t<e;)t+=Math.PI*2;for(;t>n;)t-=Math.PI*2;return t}var Wlt=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Glt=function(t,e,n,r,i){var o=Wlt(t,2),a=o[0],s=o[1],l=ll();return Tz(l,[a,s])};function W0(t,...e){return e.reduce((n,r)=>i=>n(r(i)),t)}function Cx(t,e){return e-t?n=>(n-t)/(e-t):n=>.5}function Hlt(t,e){const n=e<t?e:t,r=t>e?t:e;return i=>Math.min(Math.max(n,i),r)}function Ult(t,e,n,r,i){let o=n||0,a=r||t.length;const s=i||(l=>l);for(;o<a;){const l=Math.floor((o+a)/2);s(t[l])>e?a=l:o=l+1}return o}const r4=Math.sqrt(50),i4=Math.sqrt(10),o4=Math.sqrt(2);function G0(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/Ce(10,i);return i>=0?(o>=r4?10:o>=i4?5:o>=o4?2:1)*Ce(10,i):-Ce(10,-i)/(o>=r4?10:o>=i4?5:o>=o4?2:1)}const Vlt=(t,e,n=5)=>{const r=[t,e];let i=0,o=r.length-1,a=r[i],s=r[o],l;return s<a&&([a,s]=[s,a],[i,o]=[o,i]),l=G0(a,s,n),l>0?(a=Math.floor(a/l)*l,s=Math.ceil(s/l)*l,l=G0(a,s,n)):l<0&&(a=Math.ceil(a*l)/l,s=Math.floor(s*l)/l,l=G0(a,s,n)),l>0?(r[i]=Math.floor(a/l)*l,r[o]=Math.ceil(s/l)*l):l<0&&(r[i]=Math.ceil(a*l)/l,r[o]=Math.floor(s*l)/l),r};function a4(t){return!Flt(t)&&!$lt(t)&&!Number.isNaN(t)}function Tx(t,e,n){let r=n;return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function Xlt(t){const e=t[0]/360,n=t[1]/100,r=t[2]/100,i=t[3];if(n===0)return[r*255,r*255,r*255,i];const o=r<.5?r*(1+n):r+n-r*n,a=2*r-o,s=Tx(a,o,e+1/3),l=Tx(a,o,e),c=Tx(a,o,e-1/3);return[s*255,l*255,c*255,i]}function s4(t){const e=Sm.get(t);if(!e)return null;const{model:n,value:r}=e;return n==="rgb"?r:n==="hsl"?Xlt(r):null}const H0=(t,e)=>n=>t*(1-n)+e*n,qlt=(t,e)=>{const n=s4(t),r=s4(e);return n===null||r===null?n?()=>t:()=>e:i=>{const o=new Array(4);for(let u=0;u<4;u+=1){const f=n[u],d=r[u];o[u]=f*(1-i)+d*i}const[a,s,l,c]=o;return`rgba(${Math.round(a)}, ${Math.round(s)}, ${Math.round(l)}, ${c})`}},Klt=(t,e)=>typeof t=="number"&&typeof e=="number"?H0(t,e):typeof t=="string"&&typeof e=="string"?qlt(t,e):()=>t,Zlt=(t,e)=>{const n=H0(t,e);return r=>Math.round(n(r))};function l4({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Qlt({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function Jlt({map:t,initKey:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function tct(t){return typeof t=="object"?t.valueOf():t}class c4 extends Map{constructor(e){if(super(),this.map=new Map,this.initKey=tct,e!==null)for(const[n,r]of e)this.set(n,r)}get(e){return super.get(l4({map:this.map,initKey:this.initKey},e))}has(e){return super.has(l4({map:this.map,initKey:this.initKey},e))}set(e,n){return super.set(Qlt({map:this.map,initKey:this.initKey},e),n)}delete(e){return super.delete(Jlt({map:this.map,initKey:this.initKey},e))}}let u4=class{constructor(e){this.options=z0({},this.getDefaultOptions()),this.update(e)}getOptions(){return this.options}update(e={}){this.options=z0({},this.options,e),this.rescale(e)}rescale(e){}};const U0=Symbol("defaultUnknown");function f4(t,e,n){for(let r=0;r<e.length;r+=1)t.has(e[r])||t.set(n(e[r]),r)}function d4(t){const{value:e,from:n,to:r,mapper:i,notFoundReturn:o}=t;let a=i.get(e);if(a===void 0){if(o!==U0)return o;a=n.push(e)-1,i.set(e,a)}return r[a%r.length]}function h4(t){return t instanceof Date?e=>`${e}`:typeof t=="object"?e=>JSON.stringify(e):e=>e}class kx extends u4{getDefaultOptions(){return{domain:[],range:[],unknown:U0}}constructor(e){super(e)}map(e){return this.domainIndexMap.size===0&&f4(this.domainIndexMap,this.getDomain(),this.domainKey),d4({value:this.domainKey(e),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(e){return this.rangeIndexMap.size===0&&f4(this.rangeIndexMap,this.getRange(),this.rangeKey),d4({value:this.rangeKey(e),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(e){const[n]=this.options.domain,[r]=this.options.range;if(this.domainKey=h4(n),this.rangeKey=h4(r),!this.rangeIndexMap){this.rangeIndexMap=new Map,this.domainIndexMap=new Map;return}(!e||e.range)&&this.rangeIndexMap.clear(),(!e||e.domain||e.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new kx(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:e,compare:n}=this.options;return this.sortedDomain=n?[...e].sort(n):e,this.sortedDomain}}function ect(t){const e=Math.min(...t);return t.map(n=>n/e)}function nct(t,e){const n=t.length,r=e-n;return r>0?[...t,...new Array(r).fill(1)]:r<0?t.slice(0,e):t}function rct(t){return Math.round(t*1e12)/1e12}function ict(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:o,round:a,align:s}=t,l=e.length,c=nct(o,l),[u,f]=n,d=f-u,h=2/l*r+1-1/l*i,p=d/h,v=p*i/l,g=p-l*v,y=ect(c),m=y.reduce((C,A)=>C+A),b=g/m,x=new c4(e.map((C,A)=>{const T=y[A]*b;return[C,a?Math.floor(T):T]})),w=new c4(e.map((C,A)=>{const k=y[A]*b+v;return[C,a?Math.floor(k):k]})),O=Array.from(w.values()).reduce((C,A)=>C+A),S=(d-(O-O/l*i))*s,E=u+S;let M=a?Math.round(E):E;const P=new Array(l);for(let C=0;C<l;C+=1){P[C]=rct(M);const A=e[C];M+=w.get(A)}return{valueBandWidth:x,valueStep:w,adjustedRange:P}}function oct(t){var e;const{domain:n}=t,r=n.length;if(r===0)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(!!(!((e=t.flex)===null||e===void 0)&&e.length))return ict(t);const{range:o,paddingOuter:a,paddingInner:s,round:l,align:c}=t;let u,f,d=o[0];const p=o[1]-d,v=a*2,g=r-s;u=p/Math.max(1,v+g),l&&(u=Math.floor(u)),d+=(p-u*(r-s))*c,f=u*(1-s),l&&(d=Math.round(d),f=Math.round(f));const y=new Array(r).fill(0).map((m,b)=>d+b*u);return{valueStep:u,valueBandWidth:f,adjustedRange:y}}class Lx extends kx{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:U0,flex:[]}}constructor(e){super(e)}clone(){return new Lx(this.options)}getStep(e){return this.valueStep===void 0?1:typeof this.valueStep=="number"?this.valueStep:e===void 0?Array.from(this.valueStep.values())[0]:this.valueStep.get(e)}getBandWidth(e){return this.valueBandWidth===void 0?1:typeof this.valueBandWidth=="number"?this.valueBandWidth:e===void 0?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(e)}getRange(){return this.adjustedRange}getPaddingInner(){const{padding:e,paddingInner:n}=this.options;return e>0?e:n}getPaddingOuter(){const{padding:e,paddingOuter:n}=this.options;return e>0?e:n}rescale(){super.rescale();const{align:e,domain:n,range:r,round:i,flex:o}=this.options,{adjustedRange:a,valueBandWidth:s,valueStep:l}=oct({align:e,range:r,round:i,flex:o,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:n});this.valueStep=l,this.valueBandWidth=s,this.adjustedRange=a}}const act=(t,e,n)=>{let r,i,o=t,a=e;if(o===a&&n>0)return[o];let s=G0(o,a,n);if(s===0||!Number.isFinite(s))return[];if(s>0){o=Math.ceil(o/s),a=Math.floor(a/s),i=new Array(r=Math.ceil(a-o+1));for(let l=0;l<r;l+=1)i[l]=(o+l)*s}else{s=-s,o=Math.ceil(o*s),a=Math.floor(a*s),i=new Array(r=Math.ceil(a-o+1));for(let l=0;l<r;l+=1)i[l]=(o+l)/s}return i},sct=(t,e,n)=>{const[r,i]=t,[o,a]=e;let s,l;return r<i?(s=Cx(r,i),l=n(o,a)):(s=Cx(i,r),l=n(a,o)),W0(l,s)},lct=(t,e,n)=>{const r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=t[0]>t[r],s=a?[...t].reverse():t,l=a?[...e].reverse():e;for(let c=0;c<r;c+=1)i[c]=Cx(s[c],s[c+1]),o[c]=n(l[c],l[c+1]);return c=>{const u=Ult(t,c,1,r)-1,f=i[u],d=o[u];return W0(d,f)(c)}},p4=(t,e,n,r)=>(Math.min(t.length,e.length)>2?lct:sct)(t,e,r?Zlt:n);class cct extends u4{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:H0,tickCount:5}}map(e){return a4(e)?this.output(e):this.options.unknown}invert(e){return a4(e)?this.input(e):this.options.unknown}nice(){if(!this.options.nice)return;const[e,n,r,...i]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(e,n,r,...i)}getTicks(){const{tickMethod:e}=this.options,[n,r,i,...o]=this.getTickMethodOptions();return e(n,r,i,...o)}getTickMethodOptions(){const{domain:e,tickCount:n}=this.options,r=e[0],i=e[e.length-1];return[r,i,n]}chooseNice(){return Vlt}rescale(){this.nice();const[e,n]=this.chooseTransforms();this.composeOutput(e,this.chooseClamp(e)),this.composeInput(e,n,this.chooseClamp(n))}chooseClamp(e){const{clamp:n,range:r}=this.options,i=this.options.domain.map(e),o=Math.min(i.length,r.length);return n?Hlt(i[0],i[o-1]):Ql}composeOutput(e,n){const{domain:r,range:i,round:o,interpolate:a}=this.options,s=p4(r.map(e),i,a,o);this.output=W0(s,n,e)}composeInput(e,n,r){const{domain:i,range:o}=this.options,a=p4(o,i.map(e),H0);this.input=W0(n,r,a)}}class Bn extends cct{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:Klt,tickMethod:act,tickCount:5}}chooseTransforms(){return[Ql,Ql]}clone(){return new Bn(this.options)}}class Nx extends Lx{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:U0,paddingInner:1,paddingOuter:0}}constructor(e){super(e)}getPaddingInner(){return 1}clone(){return new Nx(this.options)}update(e){super.update(e)}getPaddingOuter(){return this.options.padding}}var v4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},uct=function(t,e,n,r,i){var o=new Bn({range:[e,e+r]}),a=new Bn({range:[n,n+i]});return{transform:function(s){var l=v4(s,2),c=l[0],u=l[1];return[o.map(c),a.map(u)]},untransform:function(s){var l=v4(s,2),c=l[0],u=l[1];return[o.invert(c),a.invert(u)]}}},fct=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},dct=function(t,e,n,r,i){var o=fct(t,1),a=o[0];return a(e,n,r,i)},hct=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},pct=function(t,e,n,r,i){var o=hct(t,1),a=o[0];return a},Ix=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},vct=function(t,e,n,r,i){var o=Ix(t,4),a=o[0],s=o[1],l=o[2],c=o[3],u=new Bn({range:[l,c]}),f=new Bn({range:[a,s]}),d=i/r,h=d>1?1:d,p=d>1?1/d:1;return{transform:function(v){var g=Ix(v,2),y=g[0],m=g[1],b=f.map(y),x=u.map(m),w=x*Math.cos(b)*h,O=x*Math.sin(b)*p,_=w*.5+.5,S=O*.5+.5;return[_,S]},untransform:function(v){var g=Ix(v,2),y=g[0],m=g[1],b=(y-.5)*2/h,x=(m-.5)*2/p,w=Math.sqrt(Math.pow(b,2)+Math.pow(x,2)),O=Math.atan2(x,b),_=n4(O,a,s),S=f.invert(_),E=u.invert(w);return[S,E]}}},g4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},gct=function(t,e,n,r,i){return{transform:function(o){var a=g4(o,2),s=a[0],l=a[1];return[l,s]},untransform:function(o){var a=g4(o,2),s=a[0],l=a[1];return[l,s]}}},yct=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},V0=function(t,e,n,r,i){var o=yct(t,2),a=o[0],s=o[1],l=ll();return Lz(l,[a,s])},jx=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Dx=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},mct=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return V0.apply(void 0,Dx([[-1,-1]],jx(e),!1))},bct=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return V0.apply(void 0,Dx([[-1,1]],jx(e),!1))},xct=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return V0.apply(void 0,Dx([[1,-1]],jx(e),!1))},wct=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Oct=function(t,e,n,r,i){var o=wct(t,1),a=o[0],s=ll();return kz(s,a)},$x=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},_ct=function(t,e,n,r,i){var o=$x(t,4),a=o[0],s=o[1],l=o[2],c=o[3],u=(s-0)/(2*Math.PI)+1,f=(c-l)/u,d=f/(Math.PI*2),h=new Bn({range:[l,l+f*.99]}),p=new Bn({range:[a,s]}),v=i/r,g=v>1?1:v,y=v>1?1/v:1;return{transform:function(m){var b=$x(m,2),x=b[0],w=b[1],O=p.map(x),_=h.map(w),S=Math.cos(O)*(d*O+_)*g,E=Math.sin(O)*(d*O+_)*y,M=S*.5+.5,P=E*.5+.5;return[M,P]},untransform:function(m){var b=$x(m,2),x=b[0],w=b[1],O=(x-.5)*2/g,_=(w-.5)*2/y,S=Math.sqrt(Math.pow(O,2)+Math.pow(_,2)),E=Math.atan2(_,O)+Math.floor(S/f)*Math.PI*2,M=n4(E,a,s),P=S-d*M,C=p.invert(M),A=h.invert(P);return[C,A]}}},Sct=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Ect=function(t,e,n,r,i){var o=Sct(t,4),a=o[0],s=o[1],l=o[2],c=o[3],u=new Bn({range:[l,c]});return{transform:function(f){for(var d=[],h=f.length,p=new Nx({domain:new Array(h).fill(0).map(function(b,x){return x}),range:[a,s]}),v=0;v<h;v++){var g=f[v],y=p.map(v),m=u.map(g);d.push(y,m)}return d},untransform:function(f){for(var d=[],h=0;h<f.length;h+=2){var p=f[h+1];d.push(u.invert(p))}return d}}},Jl=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function y4(t){return 1/Math.tan(t)}var Mct=function(t,e,n,r,i){var o=Jl(t,1),a=o[0],s=y4(a);return{transform:function(l){var c=Jl(l,2),u=c[0],f=c[1],d=u+f*s;return[d,f]},untransform:function(l){var c=Jl(l,2),u=c[0],f=c[1],d=u-f*s;return[d,f]}}},Pct=function(t,e,n,r,i){var o=Jl(t,1),a=o[0],s=y4(a);return{transform:function(l){var c=Jl(l,2),u=c[0],f=c[1],d=f+u*s;return[u,d]},untransform:function(l){var c=Jl(l,2),u=c[0],f=c[1],d=f-u*s;return[u,d]}}},Gr=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function If(t,e,n,r,i){var o=t<e,a=(o?e-r:i-e)||i-r,s=o?-1:1;return s*a*(n+1)/(n+a/((t-e)*s))+e}function jf(t,e,n,r,i){var o=t<e,a=(o?e-r:i-e)||i-r,s=o?-1:1;return a/(a*(n+1)/(t-e)-n*s)+e}function X0(t,e,n){if(!n)return t;var r=new Bn({range:[0,1],domain:[0,e]});return r.map(t)}var Act=function(t,e,n,r,i){var o=Gr(t,3),a=o[0],s=o[1],l=o[2],c=l===void 0?!1:l,u=X0(a,r,c);return{transform:function(f){var d=Gr(f,2),h=d[0],p=d[1],v=If(h,u,s,0,1);return[v,p]},untransform:function(f){var d=Gr(f,2),h=d[0],p=d[1],v=jf(h,u,s,0,1);return[v,p]}}},Cct=function(t,e,n,r,i){var o=Gr(t,3),a=o[0],s=o[1],l=o[2],c=l===void 0?!1:l,u=X0(a,i,c);return{transform:function(f){var d=Gr(f,2),h=d[0],p=d[1],v=If(p,u,s,0,1);return[h,v]},untransform:function(f){var d=Gr(f,2),h=d[0],p=d[1],v=jf(p,u,s,0,1);return[h,v]}}},Tct=function(t,e,n,r,i){var o=Gr(t,5),a=o[0],s=o[1],l=o[2],c=o[3],u=o[4],f=u===void 0?!1:u,d=X0(a,r,f),h=X0(s,i,f);return{transform:function(p){var v=Gr(p,2),g=v[0],y=v[1],m=If(g,d,l,0,1),b=If(y,h,c,0,1);return[m,b]},untransform:function(p){var v=Gr(p,2),g=v[0],y=v[1],m=jf(g,d,l,0,1),b=jf(y,h,c,0,1);return[m,b]}}},kct=function(t,e,n,r,i){var o=Gr(t,5),a=o[0],s=o[1],l=o[2],c=o[3],u=o[4],f=u===void 0?!1:u,d=new Bn({range:[0,r]}),h=new Bn({range:[0,i]}),p=f?a:d.map(a),v=f?s:h.map(s);return{transform:function(g){var y=Gr(g,2),m=y[0],b=y[1],x=d.map(m)-p,w=h.map(b)-v,O=Math.sqrt(x*x+w*w);if(O>l)return[m,b];var _=If(O,0,c,0,l),S=Math.atan2(w,x),E=p+_*Math.cos(S),M=v+_*Math.sin(S);return[d.invert(E),h.invert(M)]},untransform:function(g){var y=Gr(g,2),m=y[0],b=y[1],x=d.map(m)-p,w=h.map(b)-v,O=Math.sqrt(x*x+w*w);if(O>l)return[m,b];var _=jf(O,0,c,0,l),S=Math.atan2(w,x),E=p+_*Math.cos(S),M=v+_*Math.sin(S);return[d.invert(E),h.invert(M)]}}},m4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Lct=function(t,e,n,r,i,o,a){var s=new Bn({range:[e,e+i]}),l=new Bn({range:[n,n+o]}),c=new Bn({range:[r,r+a]});return{transform:function(u){var f=m4(u,3),d=f[0],h=f[1],p=f[2];return[s.map(d),l.map(h),c.map(p)]},untransform:function(u){var f=m4(u,3),d=f[0],h=f[1],p=f[2];return[s.invert(d),l.invert(h),c.invert(p)]}}},Nct=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},Ict=function(t,e,n,r,i,o,a){var s=Nct(t,3),l=s[0],c=s[1],u=s[2];return Vy(Kt(),[l,c,u])},b4=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},jct=function(t,e,n,r,i,o,a){return{transform:function(s){var l=b4(s,3),c=l[0],u=l[1],f=l[2];return[u,c,f]},untransform:function(s){var l=b4(s,3),c=l[0],u=l[1],f=l[2];return[u,c,f]}}},Dct=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},$ct=function(t,e,n,r,i,o,a){var s=Dct(t,3),l=s[0],c=s[1],u=s[2];return Xy(Kt(),[l,c,u])},tc=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},ec=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Fct=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Rct=function(){function t(e){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:uct,translate:Glt,custom:dct,matrix:pct,polar:vct,transpose:gct,scale:V0,"shear.x":Mct,"shear.y":Pct,reflect:mct,"reflect.x":bct,"reflect.y":xct,rotate:Oct,helix:_ct,parallel:Ect,fisheye:Tct,"fisheye.x":Act,"fisheye.y":Cct,"fisheye.circular":kct},this.update(e)}return t.prototype.update=function(e){this.options=z0({},this.options,e),this.recoordinate()},t.prototype.clone=function(){return new t(this.options)},t.prototype.getOptions=function(){return this.options},t.prototype.clear=function(){this.update({transformations:[]})},t.prototype.getSize=function(){var e=this.options,n=e.width,r=e.height;return[n,r]},t.prototype.getCenter=function(){var e=this.options,n=e.x,r=e.y,i=e.width,o=e.height;return[(n*2+i)/2,(r*2+o)/2]},t.prototype.transform=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=this.options.transformations;return this.update({transformations:ec(ec([],tc(r),!1),[ec([],tc(e),!1)],!1)}),this},t.prototype.map=function(e){return this.output(e)},t.prototype.invert=function(e){return this.input(e)},t.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},t.prototype.compose=function(e){var n,r;e===void 0&&(e=!1);var i=e?ec([],tc(this.options.transformations),!1).reverse():this.options.transformations,o=e?function(_){return _.untransform}:function(_){return _.transform},a=[],s=[],l=function(_,S){return S===void 0&&(S=!0),s.push(S?zlt(_):_)};try{for(var c=Fct(i),u=c.next();!u.done;u=c.next()){var f=tc(u.value),d=f[0],h=f.slice(1),p=this.transformers[d];if(p){var v=this.options,g=v.x,y=v.y,m=v.width,b=v.height,x=p(ec([],tc(h),!1),g,y,m,b);if(JI(x))a.push(x);else{if(a.length){var w=this.createMatrixTransform(a,e);l(w),a.splice(0,a.length)}var O=o(x)||Ql;l(O,d!=="parallel")}}}}catch(_){n={error:_}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}if(a.length){var O=this.createMatrixTransform(a,e);l(O)}return QI.apply(void 0,ec([],tc(s),!1))},t.prototype.createMatrixTransform=function(e,n){var r=ll();return n&&e.reverse(),e.forEach(function(i){return Nz(r,r,i)}),n&&Az(r,Mz(r)),function(i){var o=[i[0],i[1],1];return IE(o,o,r),[o[0],o[1]]}},t}(),nc=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o},rc=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Bct=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},zct=function(){function t(e){this.options={x:0,y:0,z:0,width:300,height:150,depth:150,transformations:[]},this.transformers={cartesian3D:Lct,translate3D:Ict,scale3D:$ct,transpose3D:jct},this.update(e)}return t.prototype.update=function(e){this.options=z0({},this.options,e),this.recoordinate()},t.prototype.clone=function(){return new t(this.options)},t.prototype.getOptions=function(){return this.options},t.prototype.clear=function(){this.update({transformations:[]})},t.prototype.getSize=function(){var e=this.options,n=e.width,r=e.height,i=e.depth;return[n,r,i]},t.prototype.getCenter=function(){var e=this.options,n=e.x,r=e.y,i=e.z,o=e.width,a=e.height,s=e.depth;return[(n*2+o)/2,(r*2+a)/2,(i*2+s)/2]},t.prototype.transform=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=this.options.transformations;return this.update({transformations:rc(rc([],nc(r),!1),[rc([],nc(e),!1)],!1)}),this},t.prototype.map=function(e){return this.output(e)},t.prototype.invert=function(e){return this.input(e)},t.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},t.prototype.compose=function(e){var n,r;e===void 0&&(e=!1);var i=e?rc([],nc(this.options.transformations),!1).reverse():this.options.transformations,o=e?function(E){return E.untransform}:function(E){return E.transform},a=[],s=[],l=function(E,M){return M===void 0&&(M=!0),s.push(M?Ylt(E):E)};try{for(var c=Bct(i),u=c.next();!u.done;u=c.next()){var f=nc(u.value),d=f[0],h=f.slice(1),p=this.transformers[d];if(p){var v=this.options,g=v.x,y=v.y,m=v.z,b=v.width,x=v.height,w=v.depth,O=p(rc([],nc(h),!1),g,y,m,b,x,w);if(JI(O))a.push(O);else{if(a.length){var _=this.createMatrixTransform(a,e);l(_),a.splice(0,a.length)}var S=o(O)||Ql;l(S,!0)}}}}catch(E){n={error:E}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}if(a.length){var S=this.createMatrixTransform(a,e);l(S)}return QI.apply(void 0,rc([],nc(s),!1))},t.prototype.createMatrixTransform=function(e,n){var r=Kt();return n&&e.reverse(),e.forEach(function(i){return LE(r,r,i)}),n&&oi(r,Hy(r)),function(i){var o=[i[0],i[1],i[2],1];return dl(o,o,r),[o[0],o[1],o[2]]}},t}(),Yct=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function ic(t){return(e,...n)=>Z({},t(e,...n),e)}function oc(t){return(e,...n)=>Z({},e,t(e,...n))}function Fx(t,e){if(!t)return e;if(Array.isArray(t))return t;const{value:n=e}=t,r=Yct(t,["value"]);return Object.assign(Object.assign({},r),{value:n})}var Wct=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const x4=()=>t=>{const{children:e}=t;if(!Array.isArray(e))return[];const{x:n=0,y:r=0,width:i,height:o,data:a}=t;return e.map(s=>{var{data:l,x:c,y:u,width:f,height:d}=s,h=Wct(s,["data","x","y","width","height"]);return Object.assign(Object.assign({},h),{data:Fx(l,a),x:c!=null?c:n,y:u!=null?u:r,width:f!=null?f:i,height:d!=null?d:o})})};x4.props={};var Gct=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const w4=()=>t=>{const{children:e}=t;if(!Array.isArray(e))return[];const{direction:n="row",ratio:r=e.map(()=>1),padding:i=0,data:o}=t,[a,s,l,c]=n==="col"?["y","height","width","x"]:["x","width","height","y"],u=r.reduce((v,g)=>v+g),f=t[s]-i*(e.length-1),d=r.map(v=>f*(v/u)),h=[];let p=t[a]||0;for(let v=0;v<d.length;v+=1){const g=e[v],{data:y}=g,m=Gct(g,["data"]),b=Fx(y,o);h.push(Object.assign({[a]:p,[s]:d[v],[c]:t[c]||0,[l]:t[l],data:b},m)),p+=d[v]+i}return h};w4.props={};var Rx=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const O4=()=>t=>{const{children:e}=t,n=Rx(t,["children"]);if(!Array.isArray(e))return[];const{data:r,scale:i={},axis:o={},legend:a={},encode:s={},transform:l=[]}=n,c=Rx(n,["data","scale","axis","legend","encode","transform"]),u=e.map(f=>{var{data:d,scale:h={},axis:p={},legend:v={},encode:g={},transform:y=[]}=f,m=Rx(f,["data","scale","axis","legend","encode","transform"]);return Object.assign({data:Fx(d,r),scale:Z({},i,h),encode:Z({},s,g),transform:[...l,...y],axis:p&&o?Z({},o,p):!1,legend:v&&a?Z({},a,v):!1},m)});return[Object.assign(Object.assign({},c),{marks:u,type:"standardView"})]};O4.props={};var Hct=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const _4=({static:t=!1}={})=>e=>{const{width:n,height:r,depth:i,paddingLeft:o,paddingRight:a,paddingTop:s,paddingBottom:l,padding:c,inset:u,insetLeft:f,insetTop:d,insetRight:h,insetBottom:p,margin:v,marginLeft:g,marginBottom:y,marginTop:m,marginRight:b,data:x,coordinate:w,theme:O,component:_,interaction:S,x:E,y:M,z:P,key:C,frame:A,labelTransform:T,parentKey:k,clip:N,viewStyle:j,title:L}=e,I=Hct(e,["width","height","depth","paddingLeft","paddingRight","paddingTop","paddingBottom","padding","inset","insetLeft","insetTop","insetRight","insetBottom","margin","marginLeft","marginBottom","marginTop","marginRight","data","coordinate","theme","component","interaction","x","y","z","key","frame","labelTransform","parentKey","clip","viewStyle","title"]);return[Object.assign(Object.assign({type:"standardView",x:E,y:M,z:P,key:C,width:n,height:r,depth:i,padding:c,paddingLeft:o,paddingRight:a,paddingTop:s,inset:u,insetLeft:f,insetTop:d,insetRight:h,insetBottom:p,paddingBottom:l,theme:O,coordinate:w,component:_,interaction:S,frame:A,labelTransform:T,margin:v,marginLeft:g,marginBottom:y,marginTop:m,marginRight:b,parentKey:k,clip:N,style:j},!t&&{title:L}),{marks:[Object.assign(Object.assign(Object.assign({},I),{key:`${C}-0`,data:x}),t&&{title:L})]})]};_4.props={};class Df{constructor(e){this.$value=e}static of(e){return new Df(e)}call(e,...n){return this.$value=e(this.$value,...n),this}value(){return this.$value}}var Uct=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const Vct=ic(t=>{const{encode:e,data:n,scale:r,shareSize:i=!1}=t,{x:o,y:a}=e,s=(l,c)=>{var u;if(l===void 0||!i)return{};const f=xe(n,p=>p[l]),d=((u=r==null?void 0:r[c])===null||u===void 0?void 0:u.domain)||Array.from(f.keys()),h=d.map(p=>f.has(p)?f.get(p).length:1);return{domain:d,flex:h}};return{scale:{x:Object.assign(Object.assign({paddingOuter:0,paddingInner:.1,guide:o===void 0?null:{position:"top"}},o===void 0&&{paddingInner:0}),s(o,"x")),y:Object.assign(Object.assign({range:[0,1],paddingOuter:0,paddingInner:.1,guide:a===void 0?null:{position:"right"}},a===void 0&&{paddingInner:0}),s(a,"y"))}}}),Bx=ic(t=>{const{data:e,scale:n}=t,r=[t];let i,o,a;for(;r.length;){const f=r.shift(),{children:d,encode:h={},scale:p={},legend:v={}}=f,{color:g}=h,{color:y}=p,{color:m}=v;g!==void 0&&(i=g),y!==void 0&&(o=y),m!==void 0&&(a=m),Array.isArray(d)&&r.push(...d)}const s=()=>{var f;const d=(f=n==null?void 0:n.color)===null||f===void 0?void 0:f.domain;if(d!==void 0)return[d];if(i===void 0)return[void 0];const h=typeof i=="function"?i:v=>v[i],p=e.map(h);return p.some(v=>typeof v=="number")?[no(p)]:[Array.from(new Set(p)),"ordinal"]},l=typeof i=="string"?i:"",[c,u]=s();return{encode:{color:i},scale:{color:Z({},o,{domain:c,type:u})},legend:{color:Z({title:l},a)}}}),zx=ic(()=>({animate:{enterType:"fadeIn"}})),Yx=oc(()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}})),Wx=oc(()=>({type:"cell"})),S4=oc(t=>{const{data:e}=t;return{data:{type:"inline",value:e,transform:[{type:"custom",callback:()=>{const{data:r,encode:i}=t,{x:o,y:a}=i,s=o?Array.from(new Set(r.map(u=>u[o]))):[],l=a?Array.from(new Set(r.map(u=>u[a]))):[];return(()=>{if(s.length&&l.length){const u=[];for(const f of s)for(const d of l)u.push({[o]:f,[a]:d});return u}if(s.length)return s.map(u=>({[o]:u}));if(l.length)return l.map(u=>({[a]:u}))})()}}]}}}),E4=oc((t,e=Xct,n=qct,r=Kct,i={})=>{const{data:o,encode:a,children:s,scale:l,x:c=0,y:u=0,shareData:f=!1,key:d}=t,{value:h}=o,{x:p,y:v}=a,{color:g}=l,{domain:y}=g;return{children:(b,x,w)=>{const{x:O,y:_}=x,{paddingLeft:S,paddingTop:E,marginLeft:M,marginTop:P}=w,{domain:C}=O.getOptions(),{domain:A}=_.getOptions(),T=Ja(b),k=b.map(e),N=b.map(({x:R,y:B})=>[O.invert(R),_.invert(B)]),L=N.map(([R,B])=>W=>{const{[p]:K,[v]:J}=W;return(p!==void 0?K===R:!0)&&(v!==void 0?J===B:!0)}).map(R=>h.filter(R)),I=f?Gt(L,R=>R.length):void 0,$=N.map(([R,B])=>({columnField:p,columnIndex:C.indexOf(R),columnValue:R,columnValuesLength:C.length,rowField:v,rowIndex:A.indexOf(B),rowValue:B,rowValuesLength:A.length})),F=$.map(R=>Array.isArray(s)?s:[s(R)].flat(1));return T.flatMap(R=>{const[B,W,K,J]=k[R],X=$[R],V=L[R];return F[R].map(nt=>{var lt,yt,{scale:vt,key:mt,facet:Nt=!0,axis:Yt={},legend:me={}}=nt,We=Uct(nt,["scale","key","facet","axis","legend"]);const lr=((lt=vt==null?void 0:vt.y)===null||lt===void 0?void 0:lt.guide)||Yt.y,$o=((yt=vt==null?void 0:vt.x)===null||yt===void 0?void 0:yt.guide)||Yt.x,rl={x:{tickCount:p?5:void 0},y:{tickCount:v?5:void 0}},Hn=Nt?V:V.length===0?[]:h,ei={color:{domain:y}},$t={x:M4($o,n)(X,Hn),y:M4(lr,r)(X,Hn)};return Object.assign(Object.assign({key:`${mt}-${R}`,data:Hn,margin:0,x:B+S+c+M,y:W+E+u+P,parentKey:d,width:K,height:J,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!!Hn.length,dataDomain:I,scale:Z(rl,vt,ei),axis:Z({},Yt,$t),legend:!1},We),i)})})}}});function Xct(t){const{points:e}=t;return Lm(e)}function q0(t,e){return e.length?Z({title:!1,tick:null,label:null},t):Z({title:!1,tick:null,label:null,grid:null},t)}function qct(t){return(e,n)=>{const{rowIndex:r,rowValuesLength:i,columnIndex:o,columnValuesLength:a}=e;if(r!==i-1)return q0(t,n);const s=o!==a-1?!1:void 0,l=n.length?void 0:null;return Z({title:s,grid:l},t)}}function Kct(t){return(e,n)=>{const{rowIndex:r,columnIndex:i}=e;if(i!==0)return q0(t,n);const o=r!==0?!1:void 0,a=n.length?void 0:null;return Z({title:o,grid:a},t)}}function M4(t,e){return typeof t=="function"?t:t===null||t===!1?()=>null:e(t)}const P4=()=>t=>[Df.of(t).call(Wx).call(Bx).call(zx).call(Vct).call(Yx).call(S4).call(E4).value()];P4.props={};var Gx=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const Zct=ic(t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}})),Qct=oc(t=>{const{data:e,children:n,x:r=0,y:i=0,key:o}=t;return{children:(s,l,c)=>{const{x:u,y:f}=l,{paddingLeft:d,paddingTop:h,marginLeft:p,marginTop:v}=c,{domain:g}=u.getOptions(),{domain:y}=f.getOptions(),m=Ja(s),b=s.map(({points:_})=>Lm(_)),x=s.map(({x:_,y:S})=>[u.invert(_),f.invert(S)]),w=x.map(([_,S])=>({columnField:_,columnIndex:g.indexOf(_),columnValue:_,columnValuesLength:g.length,rowField:S,rowIndex:y.indexOf(S),rowValue:S,rowValuesLength:y.length})),O=w.map(_=>Array.isArray(n)?n:[n(_)].flat(1));return m.flatMap(_=>{const[S,E,M,P]=b[_],[C,A]=x[_],T=w[_];return O[_].map(N=>{var j,L;const{scale:I,key:$,encode:F,axis:R,interaction:B}=N,W=Gx(N,["scale","key","encode","axis","interaction"]),K=(j=I==null?void 0:I.y)===null||j===void 0?void 0:j.guide,J=(L=I==null?void 0:I.x)===null||L===void 0?void 0:L.guide,X={x:{facet:!1},y:{facet:!1}},V={x:tut(J)(T,e),y:eut(K)(T,e)},it={x:{tickCount:5},y:{tickCount:5}};return Object.assign({data:e,parentKey:o,key:`${$}-${_}`,x:S+d+r+p,y:E+h+i+v,width:M,height:P,margin:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!0,scale:Z(X,I),axis:Z(it,R,V),legend:!1,encode:Z({},F,{x:C,y:A}),interaction:Z({},B,{legendFilter:!1})},W)})})}}}),Jct=oc(t=>{const{encode:e}=t,n=Gx(t,["encode"]),{position:r=[],x:i=r,y:o=[...r].reverse()}=e,a=Gx(e,["position","x","y"]),s=[];for(const l of[i].flat(1))for(const c of[o].flat(1))s.push({$x:l,$y:c});return Object.assign(Object.assign({},n),{data:s,encode:Object.assign(Object.assign({},a),{x:"$x",y:"$y"}),scale:Object.assign(Object.assign({},[i].flat(1).length===1&&{x:{paddingInner:0}}),[o].flat(1).length===1&&{y:{paddingInner:0}})})});function tut(t){return typeof t=="function"?t:t===null?()=>null:(e,n)=>{const{rowIndex:r,rowValuesLength:i}=e;if(r!==i-1)return q0(t,n)}}function eut(t){return typeof t=="function"?t:t===null?()=>null:(e,n)=>{const{columnIndex:r}=e;if(r!==0)return q0(t,n)}}const nut=()=>t=>[Df.of(t).call(Wx).call(Bx).call(Qct).call(Jct).call(zx).call(Yx).call(Zct).value()];var rut=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const iut=ic(t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}})),out=ic(t=>({coordinate:{type:"polar"}})),aut=t=>{const{encode:e}=t,n=rut(t,["encode"]),{position:r}=e;return Object.assign(Object.assign({},n),{encode:{x:r}})};function A4(t){return e=>null}function sut(t){const{points:e}=t,[n,r,i,o]=e,a=we(n,o),s=ke(n,o),l=ke(r,i),c=yP(s,l),u=1/Math.sin(c/2),f=a/(1+u),d=f*Math.sqrt(2),[h,p]=i,g=wl(s)+c/2,y=f*u,m=h+y*Math.sin(g),b=p-y*Math.cos(g);return[m-d/2,b-d/2,d,d]}const lut=()=>t=>[Df.of(t).call(Wx).call(aut).call(Bx).call(out).call(S4).call(E4,sut,A4,A4,{frame:!1}).call(zx).call(Yx).call(iut).value()];function cut(t,e,n){const i=n,o=[0,i],a=[-i+1,1];if(t==="normal")return o;if(t==="reverse")return a;if(t==="alternate")return e%2===0?o:a;if(t==="reverse-alternate")return e%2===0?a:o}function uut(t,e,n){const r=[t];for(;r.length;){const i=r.pop();i.animate=Z({enter:{duration:e},update:{duration:e,easing:n,type:"morphing",fill:"both"},exit:{type:"fadeOut",duration:e}},i.animate||{});const{children:o}=i;Array.isArray(o)&&r.push(...o)}return t}const C4=()=>t=>{const{children:e=[],duration:n=1e3,iterationCount:r=1,direction:i="normal",easing:o="ease-in-out-sine"}=t,a=e.length;if(!Array.isArray(e)||a===0)return[];const{key:s}=e[0],l=e.map(c=>Object.assign(Object.assign({},c),{key:s})).map(c=>uut(c,n,o));return function*(){let c=0,u;for(;r==="infinite"||c<r;){const[f,d]=cut(i,c,a);for(let h=f;h<d;h+=1){const p=Math.abs(h);u!==p&&(yield l[p]),u=p}c++}}};C4.props={};var fut=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const T4=()=>t=>{const{type:e,data:n,scale:r,encode:i,style:o,animate:a,key:s,state:l}=t,c=fut(t,["type","data","scale","encode","style","animate","key","state"]);return[Object.assign(Object.assign({type:"geoView"},c),{children:[{type:"geoPath",key:`${s}-0`,data:{value:n},scale:r,encode:i,style:o,animate:a,state:l}]})]};T4.props={};var bt=1e-6,k4=1e-12,Lt=Math.PI,ze=Lt/2,L4=Lt/4,xr=Lt*2,Pn=180/Lt,Ie=Lt/180,Bt=Math.abs,ac=Math.atan,bo=Math.atan2,Tt=Math.cos,K0=Math.ceil,N4=Math.exp,Z0=Math.log,Hx=Math.pow,Et=Math.sin,Hr=Math.sign||function(t){return t>0?1:t<0?-1:0},er=Math.sqrt,Ux=Math.tan;function I4(t){return t>1?0:t<-1?Lt:Math.acos(t)}function Ur(t){return t>1?ze:t<-1?-ze:Math.asin(t)}function Vr(){}function Q0(t,e){t&&D4.hasOwnProperty(t.type)&&D4[t.type](t,e)}var j4={Feature:function(t,e){Q0(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)Q0(n[r].geometry,e)}},D4={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){Vx(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Vx(n[r],e,0)},Polygon:function(t,e){$4(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)$4(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)Q0(n[r],e)}};function Vx(t,e,n){var r=-1,i=t.length-n,o;for(e.lineStart();++r<i;)o=t[r],e.point(o[0],o[1],o[2]);e.lineEnd()}function $4(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)Vx(t[n],e,1);e.polygonEnd()}function sc(t,e){t&&j4.hasOwnProperty(t.type)?j4[t.type](t,e):Q0(t,e)}function Xx(t){return[bo(t[1],t[0]),Ur(t[2])]}function lc(t){var e=t[0],n=t[1],r=Tt(n);return[r*Tt(e),r*Et(e),Et(n)]}function J0(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function tv(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function qx(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function ev(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Kx(t){var e=er(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Zx(t,e){function n(r,i){return r=t(r,i),e(r[0],r[1])}return t.invert&&e.invert&&(n.invert=function(r,i){return r=e.invert(r,i),r&&t.invert(r[0],r[1])}),n}function Qx(t,e){return Bt(t)>Lt&&(t-=Math.round(t/xr)*xr),[t,e]}Qx.invert=Qx;function F4(t,e,n){return(t%=xr)?e||n?Zx(B4(t),z4(e,n)):B4(t):e||n?z4(e,n):Qx}function R4(t){return function(e,n){return e+=t,Bt(e)>Lt&&(e-=Math.round(e/xr)*xr),[e,n]}}function B4(t){var e=R4(t);return e.invert=R4(-t),e}function z4(t,e){var n=Tt(t),r=Et(t),i=Tt(e),o=Et(e);function a(s,l){var c=Tt(l),u=Tt(s)*c,f=Et(s)*c,d=Et(l),h=d*n+u*r;return[bo(f*i-h*o,u*n-d*r),Ur(h*i+f*o)]}return a.invert=function(s,l){var c=Tt(l),u=Tt(s)*c,f=Et(s)*c,d=Et(l),h=d*i-f*o;return[bo(f*i+d*o,u*n+h*r),Ur(h*n-u*r)]},a}function dut(t){t=F4(t[0]*Ie,t[1]*Ie,t.length>2?t[2]*Ie:0);function e(n){return n=t(n[0]*Ie,n[1]*Ie),n[0]*=Pn,n[1]*=Pn,n}return e.invert=function(n){return n=t.invert(n[0]*Ie,n[1]*Ie),n[0]*=Pn,n[1]*=Pn,n},e}function hut(t,e,n,r,i,o){if(n){var a=Tt(e),s=Et(e),l=r*n;i==null?(i=e+r*xr,o=e-l/2):(i=Y4(a,i),o=Y4(a,o),(r>0?i<o:i>o)&&(i+=r*xr));for(var c,u=i;r>0?u>o:u<o;u-=l)c=Xx([a,-s*Tt(u),-s*Et(u)]),t.point(c[0],c[1])}}function Y4(t,e){e=lc(e),e[0]-=t,Kx(e);var n=I4(-e[1]);return((-e[2]<0?-n:n)+xr-bt)%xr}function W4(){var t=[],e;return{point:function(n,r,i){e.push([n,r,i])},lineStart:function(){t.push(e=[])},lineEnd:Vr,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function nv(t,e){return Bt(t[0]-e[0])<bt&&Bt(t[1]-e[1])<bt}function rv(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function G4(t,e,n,r,i){var o=[],a=[],s,l;if(t.forEach(function(p){if(!((v=p.length-1)<=0)){var v,g=p[0],y=p[v],m;if(nv(g,y)){if(!g[2]&&!y[2]){for(i.lineStart(),s=0;s<v;++s)i.point((g=p[s])[0],g[1]);i.lineEnd();return}y[0]+=2*bt}o.push(m=new rv(g,p,null,!0)),a.push(m.o=new rv(g,null,m,!1)),o.push(m=new rv(y,p,null,!1)),a.push(m.o=new rv(y,null,m,!0))}}),!!o.length){for(a.sort(e),H4(o),H4(a),s=0,l=a.length;s<l;++s)a[s].e=n=!n;for(var c=o[0],u,f;;){for(var d=c,h=!0;d.v;)if((d=d.n)===c)return;u=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(h)for(s=0,l=u.length;s<l;++s)i.point((f=u[s])[0],f[1]);else r(d.x,d.n.x,1,i);d=d.n}else{if(h)for(u=d.p.z,s=u.length-1;s>=0;--s)i.point((f=u[s])[0],f[1]);else r(d.x,d.p.x,-1,i);d=d.p}d=d.o,u=d.z,h=!h}while(!d.v);i.lineEnd()}}}function H4(t){if(e=t.length){for(var e,n=0,r=t[0],i;++n<e;)r.n=i=t[n],i.p=r,r=i;r.n=i=t[0],i.p=r}}function Jx(t){return Bt(t[0])<=Lt?t[0]:Hr(t[0])*((Bt(t[0])+Lt)%xr-Lt)}function put(t,e){var n=Jx(e),r=e[1],i=Et(r),o=[Et(n),-Tt(n),0],a=0,s=0,l=new Za;i===1?r=ze+bt:i===-1&&(r=-ze-bt);for(var c=0,u=t.length;c<u;++c)if(d=(f=t[c]).length)for(var f,d,h=f[d-1],p=Jx(h),v=h[1]/2+L4,g=Et(v),y=Tt(v),m=0;m<d;++m,p=x,g=O,y=_,h=b){var b=f[m],x=Jx(b),w=b[1]/2+L4,O=Et(w),_=Tt(w),S=x-p,E=S>=0?1:-1,M=E*S,P=M>Lt,C=g*O;if(l.add(bo(C*E*Et(M),y*_+C*Tt(M))),a+=P?S+E*xr:S,P^p>=n^x>=n){var A=tv(lc(h),lc(b));Kx(A);var T=tv(o,A);Kx(T);var k=(P^S>=0?-1:1)*Ur(T[2]);(r>k||r===k&&(A[0]||A[1]))&&(s+=P^S>=0?1:-1)}}return(a<-bt||a<bt&&l<-k4)^s&1}function U4(t,e,n,r){return function(i){var o=e(i),a=W4(),s=e(a),l=!1,c,u,f,d={point:h,lineStart:v,lineEnd:g,polygonStart:function(){d.point=y,d.lineStart=m,d.lineEnd=b,u=[],c=[]},polygonEnd:function(){d.point=h,d.lineStart=v,d.lineEnd=g,u=GE(u);var x=put(c,r);u.length?(l||(i.polygonStart(),l=!0),G4(u,gut,x,n,i)):x&&(l||(i.polygonStart(),l=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),l&&(i.polygonEnd(),l=!1),u=c=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function h(x,w){t(x,w)&&i.point(x,w)}function p(x,w){o.point(x,w)}function v(){d.point=p,o.lineStart()}function g(){d.point=h,o.lineEnd()}function y(x,w){f.push([x,w]),s.point(x,w)}function m(){s.lineStart(),f=[]}function b(){y(f[0][0],f[0][1]),s.lineEnd();var x=s.clean(),w=a.result(),O,_=w.length,S,E,M;if(f.pop(),c.push(f),f=null,!!_){if(x&1){if(E=w[0],(S=E.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),O=0;O<S;++O)i.point((M=E[O])[0],M[1]);i.lineEnd()}return}_>1&&x&2&&w.push(w.pop().concat(w.shift())),u.push(w.filter(vut))}}return d}}function vut(t){return t.length>1}function gut(t,e){return((t=t.x)[0]<0?t[1]-ze-bt:ze-t[1])-((e=e.x)[0]<0?e[1]-ze-bt:ze-e[1])}const V4=U4(function(){return!0},yut,but,[-Lt,-ze]);function yut(t){var e=NaN,n=NaN,r=NaN,i;return{lineStart:function(){t.lineStart(),i=1},point:function(o,a){var s=o>0?Lt:-Lt,l=Bt(o-e);Bt(l-Lt)<bt?(t.point(e,n=(n+a)/2>0?ze:-ze),t.point(r,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(o,n),i=0):r!==s&&l>=Lt&&(Bt(e-r)<bt&&(e-=r*bt),Bt(o-s)<bt&&(o-=s*bt),n=mut(e,n,o,a),t.point(r,n),t.lineEnd(),t.lineStart(),t.point(s,n),i=0),t.point(e=o,n=a),r=s},lineEnd:function(){t.lineEnd(),e=n=NaN},clean:function(){return 2-i}}}function mut(t,e,n,r){var i,o,a=Et(t-n);return Bt(a)>bt?ac((Et(e)*(o=Tt(r))*Et(n)-Et(r)*(i=Tt(e))*Et(t))/(i*o*a)):(e+r)/2}function but(t,e,n,r){var i;if(t==null)i=n*ze,r.point(-Lt,i),r.point(0,i),r.point(Lt,i),r.point(Lt,0),r.point(Lt,-i),r.point(0,-i),r.point(-Lt,-i),r.point(-Lt,0),r.point(-Lt,i);else if(Bt(t[0]-e[0])>bt){var o=t[0]<e[0]?Lt:-Lt;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])}function xut(t){var e=Tt(t),n=2*Ie,r=e>0,i=Bt(e)>bt;function o(u,f,d,h){hut(h,t,n,d,u,f)}function a(u,f){return Tt(u)*Tt(f)>e}function s(u){var f,d,h,p,v;return{lineStart:function(){p=h=!1,v=1},point:function(g,y){var m=[g,y],b,x=a(g,y),w=r?x?0:c(g,y):x?c(g+(g<0?Lt:-Lt),y):0;if(!f&&(p=h=x)&&u.lineStart(),x!==h&&(b=l(f,m),(!b||nv(f,b)||nv(m,b))&&(m[2]=1)),x!==h)v=0,x?(u.lineStart(),b=l(m,f),u.point(b[0],b[1])):(b=l(f,m),u.point(b[0],b[1],2),u.lineEnd()),f=b;else if(i&&f&&r^x){var O;!(w&d)&&(O=l(m,f,!0))&&(v=0,r?(u.lineStart(),u.point(O[0][0],O[0][1]),u.point(O[1][0],O[1][1]),u.lineEnd()):(u.point(O[1][0],O[1][1]),u.lineEnd(),u.lineStart(),u.point(O[0][0],O[0][1],3)))}x&&(!f||!nv(f,m))&&u.point(m[0],m[1]),f=m,h=x,d=w},lineEnd:function(){h&&u.lineEnd(),f=null},clean:function(){return v|(p&&h)<<1}}}function l(u,f,d){var h=lc(u),p=lc(f),v=[1,0,0],g=tv(h,p),y=J0(g,g),m=g[0],b=y-m*m;if(!b)return!d&&u;var x=e*y/b,w=-e*m/b,O=tv(v,g),_=ev(v,x),S=ev(g,w);qx(_,S);var E=O,M=J0(_,E),P=J0(E,E),C=M*M-P*(J0(_,_)-1);if(!(C<0)){var A=er(C),T=ev(E,(-M-A)/P);if(qx(T,_),T=Xx(T),!d)return T;var k=u[0],N=f[0],j=u[1],L=f[1],I;N<k&&(I=k,k=N,N=I);var $=N-k,F=Bt($-Lt)<bt,R=F||$<bt;if(!F&&L<j&&(I=j,j=L,L=I),R?F?j+L>0^T[1]<(Bt(T[0]-k)<bt?j:L):j<=T[1]&&T[1]<=L:$>Lt^(k<=T[0]&&T[0]<=N)){var B=ev(E,(-M+A)/P);return qx(B,_),[T,Xx(B)]}}}function c(u,f){var d=r?t:Lt-t,h=0;return u<-d?h|=1:u>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return U4(a,s,o,r?[0,-t]:[-Lt,t-Lt])}function wut(t,e,n,r,i,o){var a=t[0],s=t[1],l=e[0],c=e[1],u=0,f=1,d=l-a,h=c-s,p;if(p=n-a,!(!d&&p>0)){if(p/=d,d<0){if(p<u)return;p<f&&(f=p)}else if(d>0){if(p>f)return;p>u&&(u=p)}if(p=i-a,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>u&&(u=p)}else if(d>0){if(p<u)return;p<f&&(f=p)}if(p=r-s,!(!h&&p>0)){if(p/=h,h<0){if(p<u)return;p<f&&(f=p)}else if(h>0){if(p>f)return;p>u&&(u=p)}if(p=o-s,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>u&&(u=p)}else if(h>0){if(p<u)return;p<f&&(f=p)}return u>0&&(t[0]=a+u*d,t[1]=s+u*h),f<1&&(e[0]=a+f*d,e[1]=s+f*h),!0}}}}}var $f=1e9,iv=-$f;function X4(t,e,n,r){function i(c,u){return t<=c&&c<=n&&e<=u&&u<=r}function o(c,u,f,d){var h=0,p=0;if(c==null||(h=a(c,f))!==(p=a(u,f))||l(c,u)<0^f>0)do d.point(h===0||h===3?t:n,h>1?r:e);while((h=(h+f+4)%4)!==p);else d.point(u[0],u[1])}function a(c,u){return Bt(c[0]-t)<bt?u>0?0:3:Bt(c[0]-n)<bt?u>0?2:1:Bt(c[1]-e)<bt?u>0?1:0:u>0?3:2}function s(c,u){return l(c.x,u.x)}function l(c,u){var f=a(c,1),d=a(u,1);return f!==d?f-d:f===0?u[1]-c[1]:f===1?c[0]-u[0]:f===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,f=W4(),d,h,p,v,g,y,m,b,x,w,O,_={point:S,lineStart:C,lineEnd:A,polygonStart:M,polygonEnd:P};function S(k,N){i(k,N)&&u.point(k,N)}function E(){for(var k=0,N=0,j=h.length;N<j;++N)for(var L=h[N],I=1,$=L.length,F=L[0],R,B,W=F[0],K=F[1];I<$;++I)R=W,B=K,F=L[I],W=F[0],K=F[1],B<=r?K>r&&(W-R)*(r-B)>(K-B)*(t-R)&&++k:K<=r&&(W-R)*(r-B)<(K-B)*(t-R)&&--k;return k}function M(){u=f,d=[],h=[],O=!0}function P(){var k=E(),N=O&&k,j=(d=GE(d)).length;(N||j)&&(c.polygonStart(),N&&(c.lineStart(),o(null,null,1,c),c.lineEnd()),j&&G4(d,s,k,o,c),c.polygonEnd()),u=c,d=h=p=null}function C(){_.point=T,h&&h.push(p=[]),w=!0,x=!1,m=b=NaN}function A(){d&&(T(v,g),y&&x&&f.rejoin(),d.push(f.result())),_.point=S,x&&u.lineEnd()}function T(k,N){var j=i(k,N);if(h&&p.push([k,N]),w)v=k,g=N,y=j,w=!1,j&&(u.lineStart(),u.point(k,N));else if(j&&x)u.point(k,N);else{var L=[m=Math.max(iv,Math.min($f,m)),b=Math.max(iv,Math.min($f,b))],I=[k=Math.max(iv,Math.min($f,k)),N=Math.max(iv,Math.min($f,N))];wut(L,I,t,e,n,r)?(x||(u.lineStart(),u.point(L[0],L[1])),u.point(I[0],I[1]),j||u.lineEnd(),O=!1):j&&(u.lineStart(),u.point(k,N),O=!1)}m=k,b=N,x=j}return _}}function q4(t,e,n){var r=yl(t,e-bt,n).concat(e);return function(i){return r.map(function(o){return[i,o]})}}function K4(t,e,n){var r=yl(t,e-bt,n).concat(e);return function(i){return r.map(function(o){return[o,i]})}}function Out(){var t,e,n,r,i,o,a,s,l=10,c=l,u=90,f=360,d,h,p,v,g=2.5;function y(){return{type:"MultiLineString",coordinates:m()}}function m(){return yl(K0(r/u)*u,n,u).map(p).concat(yl(K0(s/f)*f,a,f).map(v)).concat(yl(K0(e/l)*l,t,l).filter(function(b){return Bt(b%u)>bt}).map(d)).concat(yl(K0(o/c)*c,i,c).filter(function(b){return Bt(b%f)>bt}).map(h))}return y.lines=function(){return m().map(function(b){return{type:"LineString",coordinates:b}})},y.outline=function(){return{type:"Polygon",coordinates:[p(r).concat(v(a).slice(1),p(n).reverse().slice(1),v(s).reverse().slice(1))]}},y.extent=function(b){return arguments.length?y.extentMajor(b).extentMinor(b):y.extentMinor()},y.extentMajor=function(b){return arguments.length?(r=+b[0][0],n=+b[1][0],s=+b[0][1],a=+b[1][1],r>n&&(b=r,r=n,n=b),s>a&&(b=s,s=a,a=b),y.precision(g)):[[r,s],[n,a]]},y.extentMinor=function(b){return arguments.length?(e=+b[0][0],t=+b[1][0],o=+b[0][1],i=+b[1][1],e>t&&(b=e,e=t,t=b),o>i&&(b=o,o=i,i=b),y.precision(g)):[[e,o],[t,i]]},y.step=function(b){return arguments.length?y.stepMajor(b).stepMinor(b):y.stepMinor()},y.stepMajor=function(b){return arguments.length?(u=+b[0],f=+b[1],y):[u,f]},y.stepMinor=function(b){return arguments.length?(l=+b[0],c=+b[1],y):[l,c]},y.precision=function(b){return arguments.length?(g=+b,d=q4(o,i,90),h=K4(e,t,g),p=q4(s,a,90),v=K4(r,n,g),y):g},y.extentMajor([[-180,-90+bt],[180,90-bt]]).extentMinor([[-180,-80-bt],[180,80+bt]])}function _ut(){return Out()()}const Ff=t=>t;var t2=new Za,e2=new Za,Z4,Q4,n2,r2,ha={point:Vr,lineStart:Vr,lineEnd:Vr,polygonStart:function(){ha.lineStart=Sut,ha.lineEnd=Mut},polygonEnd:function(){ha.lineStart=ha.lineEnd=ha.point=Vr,t2.add(Bt(e2)),e2=new Za},result:function(){var t=t2/2;return t2=new Za,t}};function Sut(){ha.point=Eut}function Eut(t,e){ha.point=J4,Z4=n2=t,Q4=r2=e}function J4(t,e){e2.add(r2*t-n2*e),n2=t,r2=e}function Mut(){J4(Z4,Q4)}const tj=ha;var cc=1/0,ov=cc,Rf=-cc,av=Rf,Put={point:Aut,lineStart:Vr,lineEnd:Vr,polygonStart:Vr,polygonEnd:Vr,result:function(){var t=[[cc,ov],[Rf,av]];return Rf=av=-(ov=cc=1/0),t}};function Aut(t,e){t<cc&&(cc=t),t>Rf&&(Rf=t),e<ov&&(ov=e),e>av&&(av=e)}const sv=Put;var i2=0,o2=0,Bf=0,lv=0,cv=0,uc=0,a2=0,s2=0,zf=0,ej,nj,zi,Yi,fi={point:Es,lineStart:rj,lineEnd:ij,polygonStart:function(){fi.lineStart=kut,fi.lineEnd=Lut},polygonEnd:function(){fi.point=Es,fi.lineStart=rj,fi.lineEnd=ij},result:function(){var t=zf?[a2/zf,s2/zf]:uc?[lv/uc,cv/uc]:Bf?[i2/Bf,o2/Bf]:[NaN,NaN];return i2=o2=Bf=lv=cv=uc=a2=s2=zf=0,t}};function Es(t,e){i2+=t,o2+=e,++Bf}function rj(){fi.point=Cut}function Cut(t,e){fi.point=Tut,Es(zi=t,Yi=e)}function Tut(t,e){var n=t-zi,r=e-Yi,i=er(n*n+r*r);lv+=i*(zi+t)/2,cv+=i*(Yi+e)/2,uc+=i,Es(zi=t,Yi=e)}function ij(){fi.point=Es}function kut(){fi.point=Nut}function Lut(){oj(ej,nj)}function Nut(t,e){fi.point=oj,Es(ej=zi=t,nj=Yi=e)}function oj(t,e){var n=t-zi,r=e-Yi,i=er(n*n+r*r);lv+=i*(zi+t)/2,cv+=i*(Yi+e)/2,uc+=i,i=Yi*t-zi*e,a2+=i*(zi+t),s2+=i*(Yi+e),zf+=i*3,Es(zi=t,Yi=e)}const aj=fi;function sj(t){this._context=t}sj.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:{this._context.moveTo(t,e),this._point=1;break}case 1:{this._context.lineTo(t,e);break}default:{this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,xr);break}}},result:Vr};var l2=new Za,c2,lj,cj,Yf,Wf,uv={point:Vr,lineStart:function(){uv.point=Iut},lineEnd:function(){c2&&uj(lj,cj),uv.point=Vr},polygonStart:function(){c2=!0},polygonEnd:function(){c2=null},result:function(){var t=+l2;return l2=new Za,t}};function Iut(t,e){uv.point=uj,lj=Yf=t,cj=Wf=e}function uj(t,e){Yf-=t,Wf-=e,l2.add(er(Yf*Yf+Wf*Wf)),Yf=t,Wf=e}const fj=uv;let dj,fv,hj,pj;class vj{constructor(e){this._append=e==null?gj:jut(e),this._radius=4.5,this._=""}pointRadius(e){return this._radius=+e,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(e,n){switch(this._point){case 0:{this._append`M${e},${n}`,this._point=1;break}case 1:{this._append`L${e},${n}`;break}default:{if(this._append`M${e},${n}`,this._radius!==hj||this._append!==fv){const r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,hj=r,fv=this._append,pj=this._,this._=i}this._+=pj;break}}}result(){const e=this._;return this._="",e.length?e:null}}function gj(t){let e=1;this._+=t[0];for(const n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function jut(t){const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return gj;if(e!==dj){const n=Ce(10,e);dj=e,fv=function(i){let o=1;this._+=i[0];for(const a=i.length;o<a;++o)this._+=Math.round(arguments[o]*n)/n+i[o]}}return fv}function yj(t,e){let n=3,r=4.5,i,o;function a(s){return s&&(typeof r=="function"&&o.pointRadius(+r.apply(this,arguments)),sc(s,i(o))),o.result()}return a.area=function(s){return sc(s,i(tj)),tj.result()},a.measure=function(s){return sc(s,i(fj)),fj.result()},a.bounds=function(s){return sc(s,i(sv)),sv.result()},a.centroid=function(s){return sc(s,i(aj)),aj.result()},a.projection=function(s){return arguments.length?(i=s==null?(t=null,Ff):(t=s).stream,a):t},a.context=function(s){return arguments.length?(o=s==null?(e=null,new vj(n)):new sj(e=s),typeof r!="function"&&o.pointRadius(r),a):e},a.pointRadius=function(s){return arguments.length?(r=typeof s=="function"?s:(o.pointRadius(+s),+s),a):r},a.digits=function(s){if(!arguments.length)return n;if(s==null)n=null;else{const l=Math.floor(s);if(!(l>=0))throw new RangeError(`invalid digits: ${s}`);n=l}return e===null&&(o=new vj(n)),a},a.projection(t).digits(n).context(e)}function dv(t){return function(e){var n=new u2;for(var r in t)n[r]=t[r];return n.stream=e,n}}function u2(){}u2.prototype={constructor:u2,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function f2(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),r!=null&&t.clipExtent(null),sc(n,t.stream(sv)),e(sv.result()),r!=null&&t.clipExtent(r),t}function hv(t,e,n){return f2(t,function(r){var i=e[1][0]-e[0][0],o=e[1][1]-e[0][1],a=Math.min(i/(r[1][0]-r[0][0]),o/(r[1][1]-r[0][1])),s=+e[0][0]+(i-a*(r[1][0]+r[0][0]))/2,l=+e[0][1]+(o-a*(r[1][1]+r[0][1]))/2;t.scale(150*a).translate([s,l])},n)}function d2(t,e,n){return hv(t,[[0,0],e],n)}function h2(t,e,n){return f2(t,function(r){var i=+e,o=i/(r[1][0]-r[0][0]),a=(i-o*(r[1][0]+r[0][0]))/2,s=-o*r[0][1];t.scale(150*o).translate([a,s])},n)}function p2(t,e,n){return f2(t,function(r){var i=+e,o=i/(r[1][1]-r[0][1]),a=-o*r[0][0],s=(i-o*(r[1][1]+r[0][1]))/2;t.scale(150*o).translate([a,s])},n)}var mj=16,Dut=Tt(30*Ie);function bj(t,e){return+e?Fut(t,e):$ut(t)}function $ut(t){return dv({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}function Fut(t,e){function n(r,i,o,a,s,l,c,u,f,d,h,p,v,g){var y=c-r,m=u-i,b=y*y+m*m;if(b>4*e&&v--){var x=a+d,w=s+h,O=l+p,_=er(x*x+w*w+O*O),S=Ur(O/=_),E=Bt(Bt(O)-1)<bt||Bt(o-f)<bt?(o+f)/2:bo(w,x),M=t(E,S),P=M[0],C=M[1],A=P-r,T=C-i,k=m*A-y*T;(k*k/b>e||Bt((y*A+m*T)/b-.5)>.3||a*d+s*h+l*p<Dut)&&(n(r,i,o,a,s,l,P,C,E,x/=_,w/=_,O,v,g),g.point(P,C),n(P,C,E,x,w,O,c,u,f,d,h,p,v,g))}}return function(r){var i,o,a,s,l,c,u,f,d,h,p,v,g={point:y,lineStart:m,lineEnd:x,polygonStart:function(){r.polygonStart(),g.lineStart=w},polygonEnd:function(){r.polygonEnd(),g.lineStart=m}};function y(S,E){S=t(S,E),r.point(S[0],S[1])}function m(){f=NaN,g.point=b,r.lineStart()}function b(S,E){var M=lc([S,E]),P=t(S,E);n(f,d,u,h,p,v,f=P[0],d=P[1],u=S,h=M[0],p=M[1],v=M[2],mj,r),r.point(f,d)}function x(){g.point=y,r.lineEnd()}function w(){m(),g.point=O,g.lineEnd=_}function O(S,E){b(i=S,E),o=f,a=d,s=h,l=p,c=v,g.point=b}function _(){n(f,d,u,h,p,v,o,a,i,s,l,c,mj,r),g.lineEnd=x,x()}return g}}var Rut=dv({point:function(t,e){this.stream.point(t*Ie,e*Ie)}});function But(t){return dv({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}function zut(t,e,n,r,i){function o(a,s){return a*=r,s*=i,[e+t*a,n-t*s]}return o.invert=function(a,s){return[(a-e)/t*r,(n-s)/t*i]},o}function xj(t,e,n,r,i,o){if(!o)return zut(t,e,n,r,i);var a=Tt(o),s=Et(o),l=a*t,c=s*t,u=a/t,f=s/t,d=(s*n-a*e)/t,h=(s*e+a*n)/t;function p(v,g){return v*=r,g*=i,[l*v-c*g+e,n-c*v-l*g]}return p.invert=function(v,g){return[r*(u*v-f*g+d),i*(h-f*v-u*g)]},p}function Wi(t){return v2(function(){return t})()}function v2(t){var e,n=150,r=480,i=250,o=0,a=0,s=0,l=0,c=0,u,f=0,d=1,h=1,p=null,v=V4,g=null,y,m,b,x=Ff,w=.5,O,_,S,E,M;function P(k){return S(k[0]*Ie,k[1]*Ie)}function C(k){return k=S.invert(k[0],k[1]),k&&[k[0]*Pn,k[1]*Pn]}P.stream=function(k){return E&&M===k?E:E=Rut(But(u)(v(O(x(M=k)))))},P.preclip=function(k){return arguments.length?(v=k,p=void 0,T()):v},P.postclip=function(k){return arguments.length?(x=k,g=y=m=b=null,T()):x},P.clipAngle=function(k){return arguments.length?(v=+k?xut(p=k*Ie):(p=null,V4),T()):p*Pn},P.clipExtent=function(k){return arguments.length?(x=k==null?(g=y=m=b=null,Ff):X4(g=+k[0][0],y=+k[0][1],m=+k[1][0],b=+k[1][1]),T()):g==null?null:[[g,y],[m,b]]},P.scale=function(k){return arguments.length?(n=+k,A()):n},P.translate=function(k){return arguments.length?(r=+k[0],i=+k[1],A()):[r,i]},P.center=function(k){return arguments.length?(o=k[0]%360*Ie,a=k[1]%360*Ie,A()):[o*Pn,a*Pn]},P.rotate=function(k){return arguments.length?(s=k[0]%360*Ie,l=k[1]%360*Ie,c=k.length>2?k[2]%360*Ie:0,A()):[s*Pn,l*Pn,c*Pn]},P.angle=function(k){return arguments.length?(f=k%360*Ie,A()):f*Pn},P.reflectX=function(k){return arguments.length?(d=k?-1:1,A()):d<0},P.reflectY=function(k){return arguments.length?(h=k?-1:1,A()):h<0},P.precision=function(k){return arguments.length?(O=bj(_,w=k*k),T()):er(w)},P.fitExtent=function(k,N){return hv(P,k,N)},P.fitSize=function(k,N){return d2(P,k,N)},P.fitWidth=function(k,N){return h2(P,k,N)},P.fitHeight=function(k,N){return p2(P,k,N)};function A(){var k=xj(n,0,0,d,h,f).apply(null,e(o,a)),N=xj(n,r-k[0],i-k[1],d,h,f);return u=F4(s,l,c),_=Zx(e,N),S=Zx(u,_),O=bj(_,w),T()}function T(){return E=M=null,P}return function(){return e=t.apply(this,arguments),P.invert=e.invert&&C,A()}}function g2(t){var e=0,n=Lt/3,r=v2(t),i=r(e,n);return i.parallels=function(o){return arguments.length?r(e=o[0]*Ie,n=o[1]*Ie):[e*Pn,n*Pn]},i}function Yut(t){var e=Tt(t);function n(r,i){return[r*e,Et(i)/e]}return n.invert=function(r,i){return[r/e,Ur(i*e)]},n}function wj(t,e){var n=Et(t),r=(n+Et(e))/2;if(Bt(r)<bt)return Yut(t);var i=1+n*(2*r-n),o=er(i)/r;function a(s,l){var c=er(i-2*r*Et(l))/r;return[c*Et(s*=r),o-c*Tt(s)]}return a.invert=function(s,l){var c=o-l,u=bo(s,Bt(c))*Hr(c);return c*r<0&&(u-=Lt*Hr(s)*Hr(c)),[u/r,Ur((i-(s*s+c*c)*r*r)/(2*r))]},a}function pv(){return g2(wj).scale(155.424).center([0,33.6442])}function Oj(){return pv().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Wut(t){var e=t.length;return{point:function(n,r){for(var i=-1;++i<e;)t[i].point(n,r)},sphere:function(){for(var n=-1;++n<e;)t[n].sphere()},lineStart:function(){for(var n=-1;++n<e;)t[n].lineStart()},lineEnd:function(){for(var n=-1;++n<e;)t[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<e;)t[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<e;)t[n].polygonEnd()}}}function Gut(){var t,e,n=Oj(),r,i=pv().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o,a=pv().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s,l,c={point:function(d,h){l=[d,h]}};function u(d){var h=d[0],p=d[1];return l=null,r.point(h,p),l||(o.point(h,p),l)||(s.point(h,p),l)}u.invert=function(d){var h=n.scale(),p=n.translate(),v=(d[0]-p[0])/h,g=(d[1]-p[1])/h;return(g>=.12&&g<.234&&v>=-.425&&v<-.214?i:g>=.166&&g<.234&&v>=-.214&&v<-.115?a:n).invert(d)},u.stream=function(d){return t&&e===d?t:t=Wut([n.stream(e=d),i.stream(d),a.stream(d)])},u.precision=function(d){return arguments.length?(n.precision(d),i.precision(d),a.precision(d),f()):n.precision()},u.scale=function(d){return arguments.length?(n.scale(d),i.scale(d*.35),a.scale(d),u.translate(n.translate())):n.scale()},u.translate=function(d){if(!arguments.length)return n.translate();var h=n.scale(),p=+d[0],v=+d[1];return r=n.translate(d).clipExtent([[p-.455*h,v-.238*h],[p+.455*h,v+.238*h]]).stream(c),o=i.translate([p-.307*h,v+.201*h]).clipExtent([[p-.425*h+bt,v+.12*h+bt],[p-.214*h-bt,v+.234*h-bt]]).stream(c),s=a.translate([p-.205*h,v+.212*h]).clipExtent([[p-.214*h+bt,v+.166*h+bt],[p-.115*h-bt,v+.234*h-bt]]).stream(c),f()},u.fitExtent=function(d,h){return hv(u,d,h)},u.fitSize=function(d,h){return d2(u,d,h)},u.fitWidth=function(d,h){return h2(u,d,h)},u.fitHeight=function(d,h){return p2(u,d,h)};function f(){return t=e=null,u}return u.scale(1070)}function _j(t){return function(e,n){var r=Tt(e),i=Tt(n),o=t(r*i);return o===1/0?[2,0]:[o*i*Et(e),o*Et(n)]}}function Gf(t){return function(e,n){var r=er(e*e+n*n),i=t(r),o=Et(i),a=Tt(i);return[bo(e*o,r*a),Ur(r&&n*o/r)]}}var y2=_j(function(t){return er(2/(1+t))});y2.invert=Gf(function(t){return 2*Ur(t/2)});function Hut(){return Wi(y2).scale(124.75).clipAngle(180-.001)}var m2=_j(function(t){return(t=I4(t))&&t/Et(t)});m2.invert=Gf(function(t){return t});function Uut(){return Wi(m2).scale(79.4188).clipAngle(180-.001)}function Hf(t,e){return[t,Z0(Ux((ze+e)/2))]}Hf.invert=function(t,e){return[t,2*ac(N4(e))-ze]};function Vut(){return Sj(Hf).scale(961/xr)}function Sj(t){var e=Wi(t),n=e.center,r=e.scale,i=e.translate,o=e.clipExtent,a=null,s,l,c;e.scale=function(f){return arguments.length?(r(f),u()):r()},e.translate=function(f){return arguments.length?(i(f),u()):i()},e.center=function(f){return arguments.length?(n(f),u()):n()},e.clipExtent=function(f){return arguments.length?(f==null?a=s=l=c=null:(a=+f[0][0],s=+f[0][1],l=+f[1][0],c=+f[1][1]),u()):a==null?null:[[a,s],[l,c]]};function u(){var f=Lt*r(),d=e(dut(e.rotate()).invert([0,0]));return o(a==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:t===Hf?[[Math.max(d[0]-f,a),s],[Math.min(d[0]+f,l),c]]:[[a,Math.max(d[1]-f,s)],[l,Math.min(d[1]+f,c)]])}return u()}function vv(t){return Ux((ze+t)/2)}function Ej(t,e){var n=Tt(t),r=t===e?Et(t):Z0(n/Tt(e))/Z0(vv(e)/vv(t)),i=n*Hx(vv(t),r)/r;if(!r)return Hf;function o(a,s){i>0?s<-ze+bt&&(s=-ze+bt):s>ze-bt&&(s=ze-bt);var l=i/Hx(vv(s),r);return[l*Et(r*a),i-l*Tt(r*a)]}return o.invert=function(a,s){var l=i-s,c=Hr(r)*er(a*a+l*l),u=bo(a,Bt(l))*Hr(l);return l*r<0&&(u-=Lt*Hr(a)*Hr(l)),[u/r,2*ac(Hx(i/c,1/r))-ze]},o}function Xut(){return g2(Ej).scale(109.5).parallels([30,30])}function Uf(t,e){return[t,e]}Uf.invert=Uf;function qut(){return Wi(Uf).scale(152.63)}function Mj(t,e){var n=Tt(t),r=t===e?Et(t):(n-Tt(e))/(e-t),i=n/r+t;if(Bt(r)<bt)return Uf;function o(a,s){var l=i-s,c=r*a;return[l*Et(c),i-l*Tt(c)]}return o.invert=function(a,s){var l=i-s,c=bo(a,Bt(l))*Hr(l);return l*r<0&&(c-=Lt*Hr(a)*Hr(l)),[c/r,i-Hr(r)*er(a*a+l*l)]},o}function Kut(){return g2(Mj).scale(131.154).center([0,13.9389])}var Vf=1.340264,Xf=-.081106,qf=893e-6,Kf=.003796,gv=er(3)/2,Zut=12;function b2(t,e){var n=Ur(gv*Et(e)),r=n*n,i=r*r*r;return[t*Tt(n)/(gv*(Vf+3*Xf*r+i*(7*qf+9*Kf*r))),n*(Vf+Xf*r+i*(qf+Kf*r))]}b2.invert=function(t,e){for(var n=e,r=n*n,i=r*r*r,o=0,a,s,l;o<Zut&&(s=n*(Vf+Xf*r+i*(qf+Kf*r))-e,l=Vf+3*Xf*r+i*(7*qf+9*Kf*r),n-=a=s/l,r=n*n,i=r*r*r,!(Bt(a)<k4));++o);return[gv*t*(Vf+3*Xf*r+i*(7*qf+9*Kf*r))/Tt(n),Ur(Et(n)/gv)]};function Qut(){return Wi(b2).scale(177.158)}function x2(t,e){var n=Tt(e),r=Tt(t)*n;return[n*Et(t)/r,Et(e)/r]}x2.invert=Gf(ac);function Jut(){return Wi(x2).scale(144.049).clipAngle(60)}function tft(){var t=1,e=0,n=0,r=1,i=1,o=0,a,s,l=null,c,u,f,d=1,h=1,p=dv({point:function(x,w){var O=b([x,w]);this.stream.point(O[0],O[1])}}),v=Ff,g,y;function m(){return d=t*r,h=t*i,g=y=null,b}function b(x){var w=x[0]*d,O=x[1]*h;if(o){var _=O*a-w*s;w=w*a+O*s,O=_}return[w+e,O+n]}return b.invert=function(x){var w=x[0]-e,O=x[1]-n;if(o){var _=O*a+w*s;w=w*a-O*s,O=_}return[w/d,O/h]},b.stream=function(x){return g&&y===x?g:g=p(v(y=x))},b.postclip=function(x){return arguments.length?(v=x,l=c=u=f=null,m()):v},b.clipExtent=function(x){return arguments.length?(v=x==null?(l=c=u=f=null,Ff):X4(l=+x[0][0],c=+x[0][1],u=+x[1][0],f=+x[1][1]),m()):l==null?null:[[l,c],[u,f]]},b.scale=function(x){return arguments.length?(t=+x,m()):t},b.translate=function(x){return arguments.length?(e=+x[0],n=+x[1],m()):[e,n]},b.angle=function(x){return arguments.length?(o=x%360*Ie,s=Et(o),a=Tt(o),m()):o*Pn},b.reflectX=function(x){return arguments.length?(r=x?-1:1,m()):r<0},b.reflectY=function(x){return arguments.length?(i=x?-1:1,m()):i<0},b.fitExtent=function(x,w){return hv(b,x,w)},b.fitSize=function(x,w){return d2(b,x,w)},b.fitWidth=function(x,w){return h2(b,x,w)},b.fitHeight=function(x,w){return p2(b,x,w)},b}function w2(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),e*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}w2.invert=function(t,e){var n=e,r=25,i;do{var o=n*n,a=o*o;n-=i=(n*(1.007226+o*(.015085+a*(-.044475+.028874*o-.005916*a)))-e)/(1.007226+o*(.015085*3+a*(-.044475*7+.028874*9*o-.005916*11*a)))}while(Bt(i)>bt&&--r>0);return[t/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};function eft(){return Wi(w2).scale(175.295)}function O2(t,e){return[Tt(e)*Et(t),Et(e)]}O2.invert=Gf(Ur);function nft(){return Wi(O2).scale(249.5).clipAngle(90+bt)}function _2(t,e){var n=Tt(e),r=1+Tt(t)*n;return[n*Et(t)/r,Et(e)/r]}_2.invert=Gf(function(t){return 2*ac(t)});function rft(){return Wi(_2).scale(250).clipAngle(142)}function S2(t,e){return[Z0(Ux((ze+e)/2)),-t]}S2.invert=function(t,e){return[-e,2*ac(N4(t))-ze]};function ift(){var t=Sj(S2),e=t.center,n=t.rotate;return t.center=function(r){return arguments.length?e([-r[1],r[0]]):(r=e(),[r[1],-r[0]])},t.rotate=function(r){return arguments.length?n([r[0],r[1],r.length>2?r[2]+90:90]):(r=n(),[r[0],r[1],r[2]-90])},n([0,0,90]).scale(159.155)}const oft=Object.freeze(Object.defineProperty({__proto__:null,geoAlbers:Oj,geoAlbersUsa:Gut,geoAzimuthalEqualArea:Hut,geoAzimuthalEqualAreaRaw:y2,geoAzimuthalEquidistant:Uut,geoAzimuthalEquidistantRaw:m2,geoConicConformal:Xut,geoConicConformalRaw:Ej,geoConicEqualArea:pv,geoConicEqualAreaRaw:wj,geoConicEquidistant:Kut,geoConicEquidistantRaw:Mj,geoEqualEarth:Qut,geoEqualEarthRaw:b2,geoEquirectangular:qut,geoEquirectangularRaw:Uf,geoGnomonic:Jut,geoGnomonicRaw:x2,geoIdentity:tft,geoMercator:Vut,geoMercatorRaw:Hf,geoNaturalEarth1:eft,geoNaturalEarth1Raw:w2,geoOrthographic:nft,geoOrthographicRaw:O2,geoProjection:Wi,geoProjectionMutator:v2,geoStereographic:rft,geoStereographicRaw:_2,geoTransverseMercator:ift,geoTransverseMercatorRaw:S2},Symbol.toStringTag,{value:"Module"}));var aft=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function sft(t){if(typeof t=="function")return t;const e=`geo${zo(t)}`,n=oft[e];if(!n)throw new Error(`Unknown coordinate: ${t}`);return n}function lft(t){return{type:"FeatureCollection",features:t.flatMap(e=>cft(e).features)}}function cft(t){const e={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featureCollection"};if(!t||!t.type)return null;const n=e[t.type];if(!n)return null;if(n==="geometry")return{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:t}]};if(n==="feature")return{type:"FeatureCollection",features:[t]};if(n==="featureCollection")return t}function uft(t,e){var n;for(const[r,i]of Object.entries(e))(n=t[r])===null||n===void 0||n.call(t,i)}function fft(t,e,n,r){const i=()=>{const s=e.filter(Pj);return s.find(c=>c.sphere)?{type:"Sphere"}:lft(s.filter(c=>!c.sphere).flatMap(c=>c.data.value))},{outline:o=i()}=r,{size:a="fitExtent"}=r;if(a==="fitExtent")return dft(t,o,n);if(a==="fitWidth")return hft(t,o,n)}function dft(t,e,n){const{x:r,y:i,width:o,height:a}=n;t.fitExtent([[r,i],[o,a]],e)}function hft(t,e,n){const{width:r,height:i}=n,[[o,a],[s,l]]=yj(t.fitWidth(r,e)).bounds(e),c=Math.ceil(l-a),u=Math.min(Math.ceil(s-o),c),f=t.scale()*(u-1)/u,[d,h]=t.translate(),p=h+(i-c)/2;t.scale(f).translate([d,p]).precision(.2)}function pft(t){const{data:e}=t;if(Array.isArray(e))return Object.assign(Object.assign({},t),{data:{value:e}});const{type:n}=e;return n==="graticule10"?Object.assign(Object.assign({},t),{data:{value:[_ut()]}}):n==="sphere"?Object.assign(Object.assign({},t),{sphere:!0,data:{value:[{type:"Sphere"}]}}):t}function Pj(t){return t.type==="geoPath"}const Aj=()=>t=>{const{children:e,coordinate:n={}}=t;if(!Array.isArray(e))return[];const{type:r="equalEarth"}=n,i=aft(n,["type"]),o=sft(r),a=e.map(pft);let s;function l(){return[["custom",(f,d,h,p)=>{const v=o();fft(v,a,{x:f,y:d,width:h,height:p},i),uft(v,i),s=yj(v);const y=new oo({domain:[f,f+h]}),m=new oo({domain:[d,d+p]}),b=w=>{const O=v(w);if(!O)return[null,null];const[_,S]=O;return[y.map(_),m.map(S)]},x=w=>{if(!w)return null;const[O,_]=w,S=[y.invert(O),m.invert(_)];return v.invert(S)};return{transform:w=>b(w),untransform:w=>x(w)}}]]}function c(f){const{style:d,tooltip:h={}}=f;return Object.assign(Object.assign({},f),{type:"path",tooltip:y0(h,{title:"id",items:[{channel:"color"}]}),style:Object.assign(Object.assign({},d),{d:p=>s(p)||[]})})}const u=f=>Pj(f)?c(f):f;return[Object.assign(Object.assign({},t),{type:"view",scale:{x:{type:"identity"},y:{type:"identity"}},axis:!1,coordinate:{type:l},children:a.flatMap(u)})]};Aj.props={};function Cj(t,e){const{__data__:n}=t,{markKey:r,index:i,seriesIndex:o}=n,{markState:a}=e,s=Array.from(a.keys()).find(l=>l.key===r);if(s)return o?o.map(l=>s.data[l]):s.data[i]}function E2(t,e){if(e(t))return t;let n=t.parent;for(;n&&!e(n);)n=n.parent;return n}function vft(t){return E2(t,e=>e.className==="component")}function gft(t){return E2(t,e=>e.className==="element")}function yft(t){return E2(t,e=>e.className==="label")}function fn(t,e,n,r=i=>!0){return i=>{if(!r(i))return;n.emit(`plot:${t}`,i);const{target:o}=i;if(!o)return;const{className:a}=o;if(a==="plot")return;const s=gft(o),l=vft(o),c=yft(o),u=s||l||c;if(!u)return;const{className:f,markType:d}=u,h=Object.assign(Object.assign({},i),{nativeEvent:!0});f==="element"?(h.data={data:Cj(u,e)},n.emit(`element:${t}`,h),n.emit(`${d}:${t}`,h)):f==="label"?(h.data={data:u.attributes.datum},n.emit(`label:${t}`,h),n.emit(`${a}:${t}`,h)):(n.emit(`component:${t}`,h),n.emit(`${a}:${t}`,h))}}function Tj(){return(t,e,n)=>{const{container:r,view:i}=t,o=fn(Ut.CLICK,i,n,_=>_.detail===1),a=fn(Ut.DBLCLICK,i,n,_=>_.detail===2),s=fn(Ut.POINTER_TAP,i,n),l=fn(Ut.POINTER_DOWN,i,n),c=fn(Ut.POINTER_UP,i,n),u=fn(Ut.POINTER_OVER,i,n),f=fn(Ut.POINTER_OUT,i,n),d=fn(Ut.POINTER_MOVE,i,n),h=fn(Ut.POINTER_ENTER,i,n),p=fn(Ut.POINTER_LEAVE,i,n),v=fn(Ut.POINTER_UPOUTSIDE,i,n),g=fn(Ut.DRAG_START,i,n),y=fn(Ut.DRAG,i,n),m=fn(Ut.DRAG_END,i,n),b=fn(Ut.DRAG_ENTER,i,n),x=fn(Ut.DRAG_LEAVE,i,n),w=fn(Ut.DRAG_OVER,i,n),O=fn(Ut.DROP,i,n);return r.addEventListener("click",o),r.addEventListener("click",a),r.addEventListener("pointertap",s),r.addEventListener("pointerdown",l),r.addEventListener("pointerup",c),r.addEventListener("pointerover",u),r.addEventListener("pointerout",f),r.addEventListener("pointermove",d),r.addEventListener("pointerenter",h),r.addEventListener("pointerleave",p),r.addEventListener("pointerupoutside",v),r.addEventListener("dragstart",g),r.addEventListener("drag",y),r.addEventListener("dragend",m),r.addEventListener("dragenter",b),r.addEventListener("dragleave",x),r.addEventListener("dragover",w),r.addEventListener("drop",O),()=>{r.removeEventListener("click",o),r.removeEventListener("click",a),r.removeEventListener("pointertap",s),r.removeEventListener("pointerdown",l),r.removeEventListener("pointerup",c),r.removeEventListener("pointerover",u),r.removeEventListener("pointerout",f),r.removeEventListener("pointermove",d),r.removeEventListener("pointerenter",h),r.removeEventListener("pointerleave",p),r.removeEventListener("pointerupoutside",v),r.removeEventListener("dragstart",g),r.removeEventListener("drag",y),r.removeEventListener("dragend",m),r.removeEventListener("dragenter",b),r.removeEventListener("dragleave",x),r.removeEventListener("dragover",w),r.removeEventListener("drop",O)}}}Tj.props={reapplyWhenUpdate:!0};function mft(){return{"component.axisRadar":gI,"component.axisLinear":la,"component.axisArc":hI,"component.legendContinuousBlock":yI,"component.legendContinuousBlockSize":mI,"component.legendContinuousSize":xx,"interaction.event":Tj,"composition.mark":_4,"composition.view":O4,"shape.label.label":Z3}}var bft=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function pe(t,e){const n=Object.assign(Object.assign({},mft()),e),r=o=>{if(typeof o!="string")return o;const a=`${t}.${o}`;return n[a]||ml(`Unknown Component: ${a}`)};return[(o,a)=>{const{type:s}=o,l=bft(o,["type"]);s||ml("Plot type is required!");const c=r(s);return c==null?void 0:c(l,a)},r]}function kj(t){const{canvas:e,group:n}=t;return(e==null?void 0:e.document)||(n==null?void 0:n.ownerDocument)||ml("Cannot find library document")}var Lj=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function xft(t,e,n){const[r]=pe("coordinate",n),{innerHeight:i,innerWidth:o,insetLeft:a,insetTop:s,insetRight:l,insetBottom:c}=t,{coordinates:u=[]}=e,f=Mft(u),d=f[0].type==="cartesian3D",h=Object.assign(Object.assign({},t),{x:a,y:s,width:o-a-l,height:i-c-s,transformations:f.flatMap(r)});return d?new zct(h):new Rct(h)}function Nj(t,e){const{coordinate:n={}}=t,r=Lj(t,["coordinate"]),{type:i,transform:o=[]}=n,a=Lj(n,["type","transform"]);if(!i)return Object.assign(Object.assign({},r),{coordinates:o});const[,s]=pe("coordinate",e),{transform:l=!1}=s(i).props||{};if(l)throw new Error(`Unknown coordinate: ${i}.`);return Object.assign(Object.assign({},r),{coordinates:[Object.assign({type:i},a),...o]})}function di(t,e){return t.filter(n=>n.type===e)}function Ms(t){return di(t,"polar").length>0}function wft(t){return di(t,"helix").length>0}function fc(t){return di(t,"transpose").length%2===1}function Oft(t){return di(t,"parallel").length>0}function Ij(t){return di(t,"theta").length>0}function _ft(t){return di(t,"reflect").length>0}function Zf(t){return di(t,"radial").length>0}function Sft(t){return di(t,"radar").length>0}function Eft(t){return di(t,"reflectY").length>0}function Mft(t){return t.find(e=>e.type==="cartesian"||e.type==="cartesian3D")?t:[...t,{type:"cartesian"}]}function Mt(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(r*6,++r*6);return n}const Pft=Mt("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),Aft=Mt("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),Cft=Mt("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),Tft=Mt("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),kft=Mt("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),Lft=Mt("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),Nft=Mt("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),Ift=Mt("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),jft=Mt("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),Dft=Mt("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),$ft=Mt("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function yv(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function M2(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function dc(){}var Ps=.7,hc=1/Ps,pc="\\s*([+-]?\\d+)\\s*",Qf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Gi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Fft=/^#([0-9a-f]{3,8})$/,Rft=new RegExp(`^rgb\\(${pc},${pc},${pc}\\)$`),Bft=new RegExp(`^rgb\\(${Gi},${Gi},${Gi}\\)$`),zft=new RegExp(`^rgba\\(${pc},${pc},${pc},${Qf}\\)$`),Yft=new RegExp(`^rgba\\(${Gi},${Gi},${Gi},${Qf}\\)$`),Wft=new RegExp(`^hsl\\(${Qf},${Gi},${Gi}\\)$`),Gft=new RegExp(`^hsla\\(${Qf},${Gi},${Gi},${Qf}\\)$`),jj={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};yv(dc,P2,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Dj,formatHex:Dj,formatHex8:Hft,formatHsl:Uft,formatRgb:$j,toString:$j});function Dj(){return this.rgb().formatHex()}function Hft(){return this.rgb().formatHex8()}function Uft(){return Wj(this).formatHsl()}function $j(){return this.rgb().formatRgb()}function P2(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Fft.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?Fj(e):n===3?new An(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?mv(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?mv(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Rft.exec(t))?new An(e[1],e[2],e[3],1):(e=Bft.exec(t))?new An(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=zft.exec(t))?mv(e[1],e[2],e[3],e[4]):(e=Yft.exec(t))?mv(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Wft.exec(t))?Yj(e[1],e[2]/100,e[3]/100,1):(e=Gft.exec(t))?Yj(e[1],e[2]/100,e[3]/100,e[4]):jj.hasOwnProperty(t)?Fj(jj[t]):t==="transparent"?new An(NaN,NaN,NaN,0):null}function Fj(t){return new An(t>>16&255,t>>8&255,t&255,1)}function mv(t,e,n,r){return r<=0&&(t=e=n=NaN),new An(t,e,n,r)}function Rj(t){return t instanceof dc||(t=P2(t)),t?(t=t.rgb(),new An(t.r,t.g,t.b,t.opacity)):new An}function Jf(t,e,n,r){return arguments.length===1?Rj(t):new An(t,e,n,r==null?1:r)}function An(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}yv(An,Jf,M2(dc,{brighter(t){return t=t==null?hc:Math.pow(hc,t),new An(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Ps:Math.pow(Ps,t),new An(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new An(As(this.r),As(this.g),As(this.b),bv(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:Bj,formatHex:Bj,formatHex8:Vft,formatRgb:zj,toString:zj}));function Bj(){return`#${Cs(this.r)}${Cs(this.g)}${Cs(this.b)}`}function Vft(){return`#${Cs(this.r)}${Cs(this.g)}${Cs(this.b)}${Cs((isNaN(this.opacity)?1:this.opacity)*255)}`}function zj(){const t=bv(this.opacity);return`${t===1?"rgb(":"rgba("}${As(this.r)}, ${As(this.g)}, ${As(this.b)}${t===1?")":`, ${t})`}`}function bv(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function As(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Cs(t){return t=As(t),(t<16?"0":"")+t.toString(16)}function Yj(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new hi(t,e,n,r)}function Wj(t){if(t instanceof hi)return new hi(t.h,t.s,t.l,t.opacity);if(t instanceof dc||(t=P2(t)),!t)return new hi;if(t instanceof hi)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(e===o?a=(n-r)/s+(n<r)*6:n===o?a=(r-e)/s+2:a=(e-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new hi(a,s,l,t.opacity)}function Xft(t,e,n,r){return arguments.length===1?Wj(t):new hi(t,e,n,r==null?1:r)}function hi(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}yv(hi,Xft,M2(dc,{brighter(t){return t=t==null?hc:Math.pow(hc,t),new hi(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Ps:Math.pow(Ps,t),new hi(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new An(A2(t>=240?t-240:t+120,i,r),A2(t,i,r),A2(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new hi(Gj(this.h),xv(this.s),xv(this.l),bv(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=bv(this.opacity);return`${t===1?"hsl(":"hsla("}${Gj(this.h)}, ${xv(this.s)*100}%, ${xv(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Gj(t){return t=(t||0)%360,t<0?t+360:t}function xv(t){return Math.max(0,Math.min(1,t||0))}function A2(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const qft=Math.PI/180,Kft=180/Math.PI;var Hj=-.14861,C2=1.78277,T2=-.29227,wv=-.90649,td=1.97294,Uj=td*wv,Vj=td*C2,Xj=C2*T2-wv*Hj;function Zft(t){if(t instanceof Ts)return new Ts(t.h,t.s,t.l,t.opacity);t instanceof An||(t=Rj(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(Xj*r+Uj*e-Vj*n)/(Xj+Uj-Vj),o=r-i,a=(td*(n-i)-T2*o)/wv,s=Math.sqrt(a*a+o*o)/(td*i*(1-i)),l=s?Math.atan2(a,o)*Kft-120:NaN;return new Ts(l<0?l+360:l,s,i,t.opacity)}function Hi(t,e,n,r){return arguments.length===1?Zft(t):new Ts(t,e,n,r==null?1:r)}function Ts(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}yv(Ts,Hi,M2(dc,{brighter(t){return t=t==null?hc:Math.pow(hc,t),new Ts(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Ps:Math.pow(Ps,t),new Ts(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*qft,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new An(255*(e+n*(Hj*r+C2*i)),255*(e+n*(T2*r+wv*i)),255*(e+n*(td*r)),this.opacity)}}));function Qft(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}function Jft(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r<e-1?t[r+2]:2*o-i;return Qft((n-r/e)*e,a,i,o,s)}}const k2=t=>()=>t;function qj(t,e){return function(n){return t+n*e}}function tdt(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function edt(t,e){var n=e-t;return n?qj(t,n>180||n<-180?n-360*Math.round(n/360):n):k2(isNaN(t)?e:t)}function ndt(t){return(t=+t)==1?vc:function(e,n){return n-e?tdt(e,n,t):k2(isNaN(e)?n:e)}}function vc(t,e){var n=e-t;return n?qj(t,n):k2(isNaN(t)?e:t)}(function t(e){var n=ndt(e);function r(i,o){var a=n((i=Jf(i)).r,(o=Jf(o)).r),s=n(i.g,o.g),l=n(i.b,o.b),c=vc(i.opacity,o.opacity);return function(u){return i.r=a(u),i.g=s(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=t,r})(1);function rdt(t){return function(e){var n=e.length,r=new Array(n),i=new Array(n),o=new Array(n),a,s;for(a=0;a<n;++a)s=Jf(e[a]),r[a]=s.r||0,i[a]=s.g||0,o[a]=s.b||0;return r=t(r),i=t(i),o=t(o),s.opacity=1,function(l){return s.r=r(l),s.g=i(l),s.b=o(l),s+""}}}var idt=rdt(Jft);function Kj(t){return function e(n){n=+n;function r(i,o){var a=t((i=Hi(i)).h,(o=Hi(o)).h),s=vc(i.s,o.s),l=vc(i.l,o.l),c=vc(i.opacity,o.opacity);return function(u){return i.h=a(u),i.s=s(u),i.l=l(Math.pow(u,n)),i.opacity=c(u),i+""}}return r.gamma=e,r}(1)}Kj(edt);var L2=Kj(vc);const fe=t=>idt(t[t.length-1]);var Zj=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Mt);const odt=fe(Zj);var Qj=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Mt);const adt=fe(Qj);var Jj=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Mt);const sdt=fe(Jj);var tD=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Mt);const ldt=fe(tD);var eD=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Mt);const cdt=fe(eD);var nD=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Mt);const udt=fe(nD);var rD=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Mt);const fdt=fe(rD);var iD=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Mt);const ddt=fe(iD);var oD=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Mt);const hdt=fe(oD);var aD=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Mt);const pdt=fe(aD);var sD=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Mt);const vdt=fe(sD);var lD=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Mt);const gdt=fe(lD);var cD=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Mt);const ydt=fe(cD);var uD=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Mt);const mdt=fe(uD);var fD=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Mt);const bdt=fe(fD);var dD=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Mt);const xdt=fe(dD);var hD=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Mt);const wdt=fe(hD);var pD=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Mt);const Odt=fe(pD);var vD=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Mt);const _dt=fe(vD);var gD=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Mt);const Sdt=fe(gD);var yD=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Mt);const Edt=fe(yD);var mD=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Mt);const Mdt=fe(mD);var bD=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Mt);const Pdt=fe(bD);var xD=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Mt);const Adt=fe(xD);var wD=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Mt);const Cdt=fe(wD);var OD=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Mt);const Tdt=fe(OD);var _D=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Mt);const kdt=fe(_D);function Ldt(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-t*2710.57)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-t*67.37)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-t*2475.67)))))))+")"}const Ndt=L2(Hi(300,.5,0),Hi(-240,.5,1));var Idt=L2(Hi(-100,.75,.35),Hi(80,1.5,.8)),jdt=L2(Hi(260,.75,.35),Hi(80,1.5,.8)),Ov=Hi();function Ddt(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return Ov.h=360*t-100,Ov.s=1.5-1.5*e,Ov.l=.8-.9*e,Ov+""}var _v=Jf(),$dt=Math.PI/3,Fdt=Math.PI*2/3;function Rdt(t){var e;return t=(.5-t)*Math.PI,_v.r=255*(e=Math.sin(t))*e,_v.g=255*(e=Math.sin(t+$dt))*e,_v.b=255*(e=Math.sin(t+Fdt))*e,_v+""}function Bdt(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-t*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+t*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-t*6838.66)))))))+")"}function Sv(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}const zdt=Sv(Mt("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var Ydt=Sv(Mt("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Wdt=Sv(Mt("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Gdt=Sv(Mt("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));const N2=Object.freeze(Object.defineProperty({__proto__:null,interpolateBlues:Mdt,interpolateBrBG:odt,interpolateBuGn:pdt,interpolateBuPu:vdt,interpolateCividis:Ldt,interpolateCool:jdt,interpolateCubehelixDefault:Ndt,interpolateGnBu:gdt,interpolateGreens:Pdt,interpolateGreys:Adt,interpolateInferno:Wdt,interpolateMagma:Ydt,interpolateOrRd:ydt,interpolateOranges:kdt,interpolatePRGn:adt,interpolatePiYG:sdt,interpolatePlasma:Gdt,interpolatePuBu:bdt,interpolatePuBuGn:mdt,interpolatePuOr:ldt,interpolatePuRd:xdt,interpolatePurples:Cdt,interpolateRainbow:Ddt,interpolateRdBu:cdt,interpolateRdGy:udt,interpolateRdPu:wdt,interpolateRdYlBu:fdt,interpolateRdYlGn:ddt,interpolateReds:Tdt,interpolateSinebow:Rdt,interpolateSpectral:hdt,interpolateTurbo:Bdt,interpolateViridis:zdt,interpolateWarm:Idt,interpolateYlGn:_dt,interpolateYlGnBu:Odt,interpolateYlOrBr:Sdt,interpolateYlOrRd:Edt,schemeAccent:Aft,schemeBlues:mD,schemeBrBG:Zj,schemeBuGn:aD,schemeBuPu:sD,schemeCategory10:Pft,schemeDark2:Cft,schemeGnBu:lD,schemeGreens:bD,schemeGreys:xD,schemeObservable10:Tft,schemeOrRd:cD,schemeOranges:_D,schemePRGn:Qj,schemePaired:kft,schemePastel1:Lft,schemePastel2:Nft,schemePiYG:Jj,schemePuBu:fD,schemePuBuGn:uD,schemePuOr:tD,schemePuRd:dD,schemePurples:wD,schemeRdBu:eD,schemeRdGy:nD,schemeRdPu:hD,schemeRdYlBu:rD,schemeRdYlGn:iD,schemeReds:OD,schemeSet1:Ift,schemeSet2:jft,schemeSet3:Dft,schemeSpectral:oD,schemeTableau10:$ft,schemeYlGn:vD,schemeYlGnBu:pD,schemeYlOrBr:gD,schemeYlOrRd:yD},Symbol.toStringTag,{value:"Module"}));function Hdt(t,e,n,r,i,o){const{guide:a={}}=n,s=tht(t,e,n);if(typeof s!="string")return n;const l=eht(s,t,e,n),c=Zdt(s,l,n);return Object.assign(Object.assign(Object.assign({},n),rht(s,t,e,n,r)),{domain:c,range:nht(s,t,e,n,c,i,o),expectedDomain:l,guide:a,name:t,type:s})}function Udt(t,e){const n={};for(const r of t){const{values:i,name:o}=r,a=e[o];for(const s of i){const{name:l,value:c}=s;n[l]=c.map(u=>a.map(u))}}return n}function Vdt(t,e){var n;const{components:r=[]}=e,i=["scale","encode","axis","legend","data","transform"],o=Array.from(new Set(t.flatMap(s=>s.channels.map(l=>l.scale)))),a=new Map(o.map(s=>[s.name,s]));for(const s of r){const l=Kdt(s);for(const c of l){const u=a.get(c),f=((n=s.scale)===null||n===void 0?void 0:n[c])||{},{independent:d=!1}=f;if(u&&!d){const{guide:h}=u,p=typeof h=="boolean"?{}:h;u.guide=Z({},p,s),Object.assign(u,f)}else{const h=Object.assign(Object.assign({},f),{expectedDomain:f.domain,name:c,guide:bE(s,i)});o.push(h)}}}return o}function Xdt(t){if(!t||!Array.isArray(t))return[Qa,Qa];let e,n;return[o=>{var a;e=o.map.bind(o),n=(a=o.invert)===null||a===void 0?void 0:a.bind(o);const s=t.filter(([d])=>typeof d=="function"),l=t.filter(([d])=>typeof d!="function"),c=new Map(l);if(o.map=d=>{for(const[h,p]of s)if(h(d))return p;return c.has(d)?c.get(d):e(d)},!n)return o;const u=new Map(l.map(([d,h])=>[h,d])),f=new Map(s.map(([d,h])=>[h,d]));return o.invert=d=>f.has(d)?d:u.has(d)?u.get(d):n(d),o},o=>(e!==null&&(o.map=e),n!==null&&(o.invert=n),o)]}function SD(t,e){const n=Object.keys(t);for(const r of Object.values(e)){const{name:i}=r.getOptions();if(!(i in t))t[i]=r;else{const o=n.filter(l=>l.startsWith(i)).map(l=>+(l.replace(i,"")||0)),a=Gt(o)+1,s=`${i}${a}`;t[s]=r,r.getOptions().key=s}}return t}function ED(t,e){const[n]=pe("scale",e),{relations:r}=t,[i]=Xdt(r),o=n(t);return i(o)}function qdt(t){const e=t.flatMap(n=>Array.from(n.values())).flatMap(n=>n.channels.map(r=>r.scale));MD(e,"x"),MD(e,"y")}function Kdt(t){const{channels:e=[],type:n,scale:r={}}=t,i=["shape","color","opacity","size"];return e.length!==0?e:n==="axisX"?["x"]:n==="axisY"?["y"]:n==="legends"?Object.keys(r).filter(o=>i.includes(o)):[]}function MD(t,e){const n=t.filter(({name:o,facet:a=!0})=>a&&o===e),r=n.flatMap(o=>o.domain),i=n.every(PD)?no(r):n.every(AD)?Array.from(new Set(r)):null;if(i!==null)for(const o of n)o.domain=i}function Zdt(t,e,n){const{ratio:r}=n;return r==null?e:PD({type:t})?Qdt(e,r,t):AD({type:t})?Jdt(e,r):e}function Qdt(t,e,n){const r=t.map(Number),i=new oo({domain:r,range:[r[0],r[0]+(r[r.length-1]-r[0])*e]});return n==="time"?t.map(o=>new Date(i.map(o))):t.map(o=>i.map(o))}function Jdt(t,e){const n=Math.round(t.length*e);return t.slice(0,n)}function PD(t){const{type:e}=t;return typeof e!="string"?!1:["linear","log","pow","time"].includes(e)}function AD(t){const{type:e}=t;return typeof e!="string"?!1:["band","point","ordinal"].includes(e)}function tht(t,e,n){const{type:r,domain:i,range:o,quantitative:a,ordinal:s}=n;return r!==void 0?r:pht(e)?"identity":typeof o=="string"?"linear":(i||o||[]).length>2?I2(t,s):i!==void 0?ND([i])?I2(t,s):ID(e)?"time":TD(t,o,a):ND(e)?I2(t,s):ID(e)?"time":TD(t,o,a)}function eht(t,e,n,r){const{domain:i}=r;if(i!==void 0)return i;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":case"quantize":case"threshold":return kD(uht(n,r),r);case"band":case"ordinal":case"point":return LD(n);case"quantile":return fht(n);case"sequential":return kD(dht(n),r);default:return[]}}function nht(t,e,n,r,i,o,a){const{range:s}=r;if(typeof s=="string")return iht(s);if(s!==void 0)return s;const{rangeMin:l,rangeMax:c}=r;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":{const u=CD(n,r,i,o,a),[f,d]=hht(e,u);return[l||f,c||d]}case"band":case"point":return[l||(e==="size"?5:0),c||(e==="size"?10:1)];case"ordinal":return CD(n,r,i,o,a);case"sequential":return;case"constant":return[n[0][0]];default:return[]}}function rht(t,e,n,r,i){switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":return sht(i,r);case"band":case"point":return lht(t,e,i,r);case"sequential":return aht(r);default:return r}}function CD(t,e,n,r,i){const[o]=pe("palette",i),{category10:a,category20:s}=r,l=QY(t.flat()).length<=a.length?a:s,{palette:c=l,offset:u}=e;if(Array.isArray(c))return c;try{return o({type:c})}catch(f){const d=oht(c,n,u);if(d)return d;throw new Error(`Unknown Component: ${c} `)}}function iht(t){return t.split("-")}function oht(t,e,n=r=>r){if(!t)return null;const r=zo(t),i=N2[`scheme${r}`],o=N2[`interpolate${r}`];if(!i&&!o)return null;if(i){if(!i.some(Array.isArray))return i;const a=i[e.length];if(a)return a}return e.map((a,s)=>o(n(s/e.length)))}function aht(t){const{palette:e="ylGnBu",offset:n}=t,r=zo(e),i=N2[`interpolate${r}`];if(!i)throw new Error(`Unknown palette: ${r}`);return{interpolator:n?o=>i(n(o)):i}}function sht(t,e){const{interpolate:n=ju,nice:r=!1,tickCount:i=5}=e;return Object.assign(Object.assign({},e),{interpolate:n,nice:r,tickCount:i})}function lht(t,e,n,r){if(r.padding!==void 0||r.paddingInner!==void 0||r.paddingOuter!==void 0)return Object.assign(Object.assign({},r),{unknown:NaN});const i=cht(t,e,n),{paddingInner:o=i,paddingOuter:a=i}=r;return Object.assign(Object.assign({},r),{paddingInner:o,paddingOuter:a,padding:i,unknown:NaN})}function cht(t,e,n){return e==="enterDelay"||e==="enterDuration"||e==="size"?0:t==="band"?Ij(n)?0:.1:t==="point"?.5:0}function I2(t,e){return e||(vht(t)?"point":"ordinal")}function TD(t,e,n){return n||(t!=="color"||e?"linear":"sequential")}function kD(t,e){if(t.length===0)return t;const{domainMin:n,domainMax:r}=e,[i,o]=t;return[n!=null?n:i,r!=null?r:o]}function uht(t,e){const{zero:n=!1}=e;let r=1/0,i=-1/0;for(const o of t)for(const a of o)ie(a)&&(r=Math.min(r,+a),i=Math.max(i,+a));return r===1/0?[]:n?[Math.min(0,r),i]:[r,i]}function LD(t){return Array.from(new Set(t.flat()))}function fht(t){return LD(t).sort()}function dht(t){let e=1/0,n=-1/0;for(const r of t)for(const i of r)ie(i)&&(e=Math.min(e,+i),n=Math.max(n,+i));return e===1/0?[]:[e<0?-n:e,n]}function hht(t,e){return t==="enterDelay"?[0,1e3]:t=="enterDuration"?[300,1e3]:t.startsWith("y")||t.startsWith("position")?[1,0]:t==="color"?[ZY(e),XE(e)]:t==="opacity"?[0,1]:t==="size"?[1,10]:[0,1]}function ND(t){return j2(t,e=>{const n=typeof e;return n==="string"||n==="boolean"})}function ID(t){return j2(t,e=>e instanceof Date)}function pht(t){return j2(t,Su)}function j2(t,e){for(const n of t)if(n.some(e))return!0;return!1}function vht(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")}function ght(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||t==="enterDelay"||t==="enterDuration"||t==="updateDelay"||t==="updateDuration"||t==="exitDelay"||t==="exitDuration"}function yht(t){if(!t||!t.type)return!1;if(typeof t.type=="function")return!0;const{type:e,domain:n,range:r,interpolator:i}=t,o=n&&n.length>0,a=r&&r.length>0;return!!(["linear","sqrt","log","time","pow","threshold","quantize","quantile","ordinal","band","point"].includes(e)&&o&&a||["sequential"].includes(e)&&o&&(a||i)||["constant","identity"].includes(e)&&a)}const mht={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},bht={threshold:"threshold",quantize:"quantize",quantile:"quantile"},xht={ordinal:"ordinal",band:"band",point:"point"},wht={constant:"constant"};var pa=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function Oht(t,e,n){const{coordinates:r=[],title:i}=e,[,o]=pe("component",n),a=t.filter(({guide:u})=>u!==null),s=[],l=Lht(e,t,n);if(s.push(...l),i){const{props:u}=o("title"),{defaultPosition:f,defaultOrientation:d,defaultOrder:h,defaultSize:p,defaultCrossPadding:v}=u,g=typeof i=="string"?{title:i}:i;s.push(Object.assign({type:"title",position:f,orientation:d,order:h,crossPadding:v[0],defaultSize:p},g))}return Pht(a,r).forEach(([u,f])=>{const{props:d}=o(u),{defaultPosition:h,defaultPlane:p="xy",defaultOrientation:v,defaultSize:g,defaultOrder:y,defaultLength:m,defaultPadding:b=[0,0],defaultCrossPadding:x=[0,0]}=d,w=Z({},...f),{guide:O,field:_}=w,S=Array.isArray(O)?O:[O];for(const E of S){const[M,P]=Tht(u,h,v,E,f,a,r);if(!M&&!P)continue;const C=M==="left"||M==="right",A=C?b[1]:b[0],T=C?x[1]:x[0],{size:k,order:N=y,length:j=m,padding:L=A,crossPadding:I=T}=E;s.push(Object.assign(Object.assign({title:_},E),{defaultSize:g,length:j,position:M,plane:p,orientation:P,padding:L,order:N,crossPadding:I,size:k,type:u,scales:f}))}}),s}function jD(t,e,n,r,i){const[o]=pe("component",r),{scaleInstances:a,scale:s,bbox:l}=t,c=pa(t,["scaleInstances","scale","bbox"]),u={bbox:l,library:r};return o(c)({coordinate:e,library:r,markState:i,scales:a,theme:n,value:u,scale:s})}function _ht(t){return t.map(e=>{const n=Z(e,e.style);return delete n.style,n})}function DD(t,e){const n=["left","right","bottom","top"];return om(t,({type:o,position:a,group:s})=>n.includes(a)?s===void 0?o.startsWith("legend")?`legend-${a}`:Symbol("independent"):s==="independent"?Symbol("independent"):s:Symbol("independent")).flatMap(([,o])=>{if(o.length===1)return o[0];if(e!==void 0){const u=o.filter(v=>v.length!==void 0).map(v=>v.length),f=kr(u);if(f>e)return o.forEach(v=>v.group=Symbol("independent")),o;const d=e-f,h=o.length-u.length,p=d/h;o.forEach(v=>{v.length===void 0&&(v.length=p)})}const a=Gt(o,u=>u.size),s=Gt(o,u=>u.order),l=Gt(o,u=>u.crossPadding),c=o[0].position;return{type:"group",size:a,order:s,position:c,children:o,crossPadding:l}})}function Sht(t,e){const n=["shape","size","color","opacity"],r=(d,h)=>d==="constant"&&h==="size",i=t.filter(({type:d,name:h})=>typeof d=="string"&&n.includes(h)&&!r(d,h)),o=i.filter(({type:d})=>d==="constant"),a=i.filter(({type:d})=>d!=="constant"),l=om(a,d=>d.field?d.field:Symbol("independent")).map(([d,h])=>[d,[...h,...o]]).filter(([,d])=>d.some(h=>h.type!=="constant")),c=new Map(l);if(c.size===0)return[];const u=d=>d.sort(([h],[p])=>h.localeCompare(p));return Array.from(c).map(([,d])=>{const p=JY(d).sort((v,g)=>g.length-v.length).map(v=>({combination:v,option:v.map(g=>[g.name,Eht(g)])}));for(const{option:v,combination:g}of p)if(!v.every(y=>y[1]==="constant")&&v.every(y=>y[1]==="discrete"||y[1]==="constant"))return["legendCategory",g];for(const[v,g]of Tlt)for(const{option:y,combination:m}of p)if(g.some(b=>Oz(u(b),u(y))))return[v,m];return null}).filter(ie)}function Eht(t){const{type:e}=t;return typeof e!="string"?null:e in mht?"continuous":e in xht?"discrete":e in bht?"distribution":e in wht?"constant":null}function Mht(t,e){return t.map(n=>{const{name:r}=n;if(wft(e)||Ij(e)||fc(e)&&(Ms(e)||Zf(e)))return null;if(r.startsWith("x"))return Ms(e)?["axisArc",[n]]:Zf(e)?["axisLinear",[n]]:[fc(e)?"axisY":"axisX",[n]];if(r.startsWith("y"))return Ms(e)?["axisLinear",[n]]:Zf(e)?["axisArc",[n]]:[fc(e)?"axisX":"axisY",[n]];if(r.startsWith("z"))return["axisZ",[n]];if(r.startsWith("position")){if(Sft(e))return["axisRadar",[n]];if(!Ms(e))return["axisY",[n]]}return null}).filter(ie)}function Pht(t,e){const n=t.filter(r=>yht(r));return[...Sht(n),...Mht(n,e)]}function D2(t){const e=di(t,"polar");if(e.length){const r=e[e.length-1],{startAngle:i,endAngle:o}=oE(r);return[i,o]}const n=di(t,"radial");if(n.length){const r=n[n.length-1],{startAngle:i,endAngle:o}=sE(r);return[i,o]}return[-Math.PI/2,Math.PI/2*3]}function Aht(t){const e=/position(\d*)/g.exec(t);return e?+e[1]:null}function Cht(t,e,n,r,i){const{name:o}=n[0];if(t==="axisRadar"){const a=r.filter(f=>f.name.startsWith("position")),s=Aht(o);if(o===a.slice(-1)[0].name||s===null)return[null,null];const[l,c]=D2(i);return["center",(c-l)/(a.length-1)*s+l]}if(t==="axisY"&&Oft(i))return fc(i)?["center","horizontal"]:["center","vertical"];if(t==="axisLinear"){const[a]=D2(i);return["center",a]}return t==="axisArc"?e[0]==="inner"?["inner",null]:["outer",null]:Ms(i)?["center",null]:Zf(i)?["center",null]:t==="axisX"&&_ft(i)||t==="axisX"&&Eft(i)?["top",null]:e}function Tht(t,e,n,r,i,o,a){const[s]=D2(a),l=[r.position||e,s!=null?s:n];return typeof t=="string"&&t.startsWith("axis")?Cht(t,l,i,o,a):typeof t=="string"&&t.startsWith("legend")&&Ms(a)&&r.position==="center"?["center","vertical"]:l}function kht(t,e,n=[]){return t==="x"?fc(n)?`${e}Y`:`${e}X`:t==="y"?fc(n)?`${e}X`:`${e}Y`:null}function Lht(t,e,n){const[,r]=pe("component",n),{coordinates:i}=t;function o(a,s,l,c){const u=kht(s,a,i);if(!c||!u)return;const{props:f}=r(u),{defaultPosition:d,defaultSize:h,defaultOrder:p,defaultCrossPadding:[v]}=f;return Object.assign(Object.assign({position:d,defaultSize:h,order:p,type:u,crossPadding:v},c),{scales:[l]})}return e.filter(a=>a.slider||a.scrollbar).flatMap(a=>{const{slider:s,scrollbar:l,name:c}=a;return[o("slider",c,a,s),o("scrollbar",c,a,l)]}).filter(a=>!!a)}function $D(t,e,n,r,i,o){const{type:a}=t;if(!["left","right","bottom","top"].includes(r)||typeof a!="string")return;const l=a;return(l.startsWith("axis")?$ht:l.startsWith("group")?Nht:l.startsWith("legendContinuous")?Fht:l==="legendCategory"?Rht:l.startsWith("slider")?Dht:l==="title"?jht:l.startsWith("scrollbar")?Iht:()=>{})(t,e,n,r,i,o)}function Nht(t,e,n,r,i,o){const{children:a}=t,s=Gt(a,c=>c.crossPadding);a.forEach(c=>c.crossPadding=s),a.forEach(c=>$D(c,e,n,r,i,o));const l=Gt(a,c=>c.size);t.size=l,a.forEach(c=>c.size=l)}function Iht(t,e,n,r,i,o){const{trackSize:a=6}=Z({},i.scrollbar,t);t.size=a}function jht(t,e,n,r,i,o){const a=Z({},i.title,t),{title:s,subtitle:l,spacing:c=0}=a,u=pa(a,["title","subtitle","spacing"]);if(s){const f=ot(u,"title"),d=Av(s,f);t.size=d.height}if(l){const f=ot(u,"subtitle"),d=Av(l,f);t.size+=c+d.height}}function Dht(t,e,n,r,i,o){const a=()=>{const{slider:u}=i;return Z({},u,t)},{trackSize:s,handleIconSize:l}=a(),c=Math.max(s,l*2.4);t.size=c}function $ht(t,e,n,r,i,o){t.transform=t.transform||[{type:"hide"}];const a=r==="left"||r==="right",s=FD(t,r,i),{tickLength:l=0,labelSpacing:c=0,titleSpacing:u=0,labelAutoRotate:f}=s,d=pa(s,["tickLength","labelSpacing","titleSpacing","labelAutoRotate"]),h=Ev(t,o),p=Mv(d,h),v=l+c;if(p&&p.length){const y=Gt(p,b=>b.width),m=Gt(p,b=>b.height);if(a)t.size=y+v;else{const{tickFilter:b,labelTransform:x}=t;Yht(h,p,e,n,b)&&!x&&f!==!1&&f!==null?(t.labelTransform="rotate(90)",t.size=y+v):t.size=m+v}}else t.size=l;const g=Pv(d);g&&(a?t.size+=u+g.width:t.size+=u+g.height)}function Fht(t,e,n,r,i,o){const s=(()=>{const{legendContinuous:x}=i;return Z({},x,t)})(),{labelSpacing:l=0,titleSpacing:c=0}=s,u=pa(s,["labelSpacing","titleSpacing"]),f=r==="left"||r==="right",d=ot(u,"ribbon"),{size:h}=d,p=ot(u,"handleIcon"),{size:v}=p,g=Math.max(h,v*2.4);t.size=g;const y=Ev(t,o),m=Mv(u,y);if(m){const x=f?"width":"height",w=Gt(m,O=>O[x]);t.size+=w+l}const b=Pv(u);b&&(f?t.size=Math.max(t.size,b.width):t.size+=c+b.height)}function Rht(t,e,n,r,i,o){const s=(()=>{const{legendCategory:T}=i,{title:k}=t,[N,j]=Array.isArray(k)?[k,void 0]:[void 0,k];return Z({title:N},T,Object.assign(Object.assign({},t),{title:j}))})(),{itemSpacing:l,itemMarkerSize:c,titleSpacing:u,rowPadding:f,colPadding:d,maxCols:h=1/0,maxRows:p=1/0}=s,v=pa(s,["itemSpacing","itemMarkerSize","titleSpacing","rowPadding","colPadding","maxCols","maxRows"]),{cols:g,length:y}=t,m=T=>Math.min(T,p),b=T=>Math.min(T,h),x=r==="left"||r==="right",w=y===void 0?e+(x?0:n[0]+n[1]):y,O=Pv(v),_=Ev(t,o),S=Mv(v,_,"itemLabel"),E=Math.max(S[0].height,c)+f,M=(T,k=0)=>c+T+l[0]+k;x?(()=>{let T=-1/0,k=0,N=1,j=0,L=-1/0,I=-1/0;const $=O?O.height:0,F=w-$;for(const{width:R}of S){const B=M(R,d);T=Math.max(T,B),k+E>F?(N++,L=Math.max(L,j),I=Math.max(I,k),j=1,k=E):(k+=E,j++)}N<=1&&(L=j,I=k),t.size=T*b(N),t.length=I+$,Z(t,{cols:b(N),gridRow:L})})():typeof g=="number"?(()=>{const T=Math.ceil(S.length/g),k=Gt(S,N=>M(N.width))*g;t.size=E*m(T)-f,t.length=Math.min(k,w)})():(()=>{let T=1,k=0,N=-1/0;for(const{width:j}of S){const L=M(j,d);k+L>w?(N=Math.max(N,k),k=L,T++):k+=L}T===1&&(N=k),t.size=E*m(T)-f,t.length=N})(),O&&(x?t.size=Math.max(t.size,O.width):t.size+=u+O.height)}function Ev(t,e){const[n]=pe("scale",e),{scales:r,tickCount:i,tickMethod:o}=t,a=r.find(s=>s.type!=="constant"&&s.type!=="identity");return i!==void 0&&(a.tickCount=i),o!==void 0&&(a.tickMethod=o),n(a)}function Mv(t,e,n="label"){const{labelFormatter:r,tickFilter:i,label:o=!0}=t,a=pa(t,["labelFormatter","tickFilter","label"]);if(!o)return null;const s=Bht(e,r,i),l=ot(a,n),c=s.map((d,h)=>Object.fromEntries(Object.entries(l).map(([p,v])=>[p,typeof v=="function"?v(d,h):v]))),u=s.map((d,h)=>{const p=c[h];return Av(d,p)});if(!c.some(d=>d.transform)){const d=s.map((h,p)=>p);t.indexBBox=new Map(d.map(h=>[h,[s[h],u[h]]]))}return u}function Pv(t){const e=c=>c===!1||c===null,{title:n}=t,r=pa(t,["title"]);if(e(n)||n===void 0)return null;const i=ot(r,"title"),{direction:o,transform:a}=i,s=Array.isArray(n)?n.join(","):n;return typeof s!="string"?null:Av(s,Object.assign(Object.assign({},i),{transform:a||(o==="vertical"?"rotate(-90)":"")}))}function FD(t,e,n){const{title:r}=t,[i,o]=Array.isArray(r)?[r,void 0]:[void 0,r],{axis:a,[`axis${dm(e)}`]:s}=n;return Z({title:i},a,s,Object.assign(Object.assign({},t),{title:o}))}function RD(t,e){const n=t.getTicks?t.getTicks():t.getOptions().domain;return e?n.filter(e):n}function Bht(t,e,n){const i=RD(t,n).map(a=>typeof a=="number"?Bp(a):a),o=e?typeof e=="string"?sa(e):e:t.getFormatter?t.getFormatter():a=>`${a}`;return i.map(o)}function zht(t,e){return t.getBandWidth?t.getBandWidth(e)/2:0}function Yht(t,e,n,r,i){if(kr(e,h=>h.width)>n)return!0;const a=t.clone();a.update({range:[0,n]});const s=RD(t,i),l=s.map(h=>a.map(h)+zht(a,h)),c=s.map((h,p)=>p),u=-r[0],f=n+r[1],d=(h,p)=>{const{width:v}=p;return[h-v/2,h+v/2]};for(let h=0;h<c.length;h++){const p=l[h],[v,g]=d(p,e[h]);if(v<u||g>f)return!0;const y=l[h+1];if(y){const[m]=d(y,e[h+1]);if(g>m)return!0}}return!1}function Av(t,e){const n=Wht(t),r=pa(e,["filter"]);return n.attr(Object.assign(Object.assign({},r),{visibility:"none"})),n.getBBox()}function Wht(t){return t instanceof Mn?t:new jr({style:{text:`${t}`}})}function Ght(t){const e=t.find(({type:n})=>n==="axisZ");if(e){const n=t.find(({type:i})=>i==="axisX");n.plane="xy";const r=t.find(({type:i})=>i==="axisY");r.plane="xy",e.plane="yz",e.origin=[n.bbox.x,n.bbox.y,0],e.eulerAngles=[0,-90,0],e.bbox.x=n.bbox.x,e.bbox.y=n.bbox.y,t.push(Object.assign(Object.assign({},n),{plane:"xz",showLabel:!1,showTitle:!1,origin:[n.bbox.x,n.bbox.y,0],eulerAngles:[-90,0,0]})),t.push(Object.assign(Object.assign({},r),{plane:"yz",showLabel:!1,showTitle:!1,origin:[r.bbox.x+r.bbox.width,r.bbox.y,0],eulerAngles:[0,-90,0]})),t.push(Object.assign(Object.assign({},e),{plane:"xz",actualPosition:"left",showLabel:!1,showTitle:!1,eulerAngles:[90,-90,0]}))}}function Hht(t,e,n,r){var i,o;const{width:a,height:s,depth:l,x:c=0,y:u=0,z:f=0,inset:d=(i=n.inset)!==null&&i!==void 0?i:0,insetLeft:h=d,insetTop:p=d,insetBottom:v=d,insetRight:g=d,margin:y=(o=n.margin)!==null&&o!==void 0?o:0,marginLeft:m=y,marginBottom:b=y,marginTop:x=y,marginRight:w=y,padding:O=n.padding,paddingBottom:_=O,paddingLeft:S=O,paddingRight:E=O,paddingTop:M=O}=Vht(t,e,n,r),P=1/4,C=(nt,lt,yt,vt,mt)=>{const{marks:Nt}=e;if(Nt.length===0)return[vt,mt];if(nt-vt-mt-nt*P>0)return[vt,mt];const We=nt*(1-P);return[lt==="auto"?We*vt/(vt+mt):vt,yt==="auto"?We*mt/(vt+mt):mt]},A=nt=>nt==="auto"?20:nt!=null?nt:20,T=A(M),k=A(_),N=BD(t,s-T-k,[T+x,k+b],["left","right"],e,n,r),{paddingLeft:j,paddingRight:L}=N,I=a-m-w,[$,F]=C(I,S,E,j,L),R=I-$-F,B=BD(t,R,[$+m,F+w],["bottom","top"],e,n,r),{paddingTop:W,paddingBottom:K}=B,J=s-b-x,[X,V]=C(J,_,M,K,W),it=J-X-V;return{width:a,height:s,depth:l,insetLeft:h,insetTop:p,insetBottom:v,insetRight:g,innerWidth:R,innerHeight:it,paddingLeft:$,paddingRight:F,paddingTop:V,paddingBottom:X,marginLeft:m,marginBottom:b,marginTop:x,marginRight:w,x:c,y:u,z:f}}function Uht(t){const{height:e,width:n,padding:r=0,paddingLeft:i=r,paddingRight:o=r,paddingTop:a=r,paddingBottom:s=r,margin:l=16,marginLeft:c=l,marginRight:u=l,marginTop:f=l,marginBottom:d=l,inset:h=0,insetLeft:p=h,insetRight:v=h,insetTop:g=h,insetBottom:y=h}=t,m=w=>w==="auto"?20:w,b=n-m(i)-m(o)-c-u-p-v,x=e-m(a)-m(s)-f-d-g-y;return{width:b,height:x}}function Vht(t,e,n,r){const{coordinates:i}=e;if(!Ms(i)&&!Zf(i))return e;const o=t.filter(y=>typeof y.type=="string"&&y.type.startsWith("axis"));if(o.length===0)return e;const a=o.map(y=>{const m=y.type==="axisArc"?"arc":"linear";return FD(y,m,n)}),s=Gt(a,y=>{var m;return(m=y.labelSpacing)!==null&&m!==void 0?m:0}),l=o.flatMap((y,m)=>{const b=a[m],x=Ev(y,r);return Mv(b,x)}).filter(ie),c=Gt(l,y=>y.height)+s,u=o.flatMap((y,m)=>{const b=a[m];return Pv(b)}).filter(y=>y!==null),f=u.length===0?0:Gt(u,y=>y.height),{inset:d=c,insetLeft:h=d,insetBottom:p=d,insetTop:v=d+f,insetRight:g=d}=e;return Object.assign(Object.assign({},e),{insetLeft:h,insetBottom:p,insetTop:v,insetRight:g})}function BD(t,e,n,r,i,o,a){const s=xe(t,p=>p.position),{padding:l=o.padding,paddingLeft:c=l,paddingRight:u=l,paddingBottom:f=l,paddingTop:d=l}=i,h={paddingBottom:f,paddingLeft:c,paddingTop:d,paddingRight:u};for(const p of r){const v=`padding${dm(W3(p))}`,g=s.get(p)||[],y=h[v],m=E=>{E.size===void 0&&(E.size=E.defaultSize)},b=E=>{E.type==="group"?(E.children.forEach(m),E.size=Gt(E.children,M=>M.size)):E.size=E.defaultSize},x=E=>{E.size||(y!=="auto"?b(E):($D(E,e,n,p,o,a),m(E)))},w=E=>{E.type.startsWith("axis")&&E.labelAutoHide===void 0&&(E.labelAutoHide=!0)},O=p==="bottom"||p==="top",_=fr(g,E=>E.order),S=g.filter(E=>E.type.startsWith("axis")&&E.order==_);if(S.length&&(S[0].crossPadding=0),typeof y=="number")g.forEach(m),g.forEach(w);else if(g.length===0)h[v]=0;else{const E=O?e+n[0]+n[1]:e,M=DD(g,E);M.forEach(x);const P=M.reduce((C,{size:A,crossPadding:T=12})=>C+A+T,0);h[v]=P}}return h}function Xht(t,e,n){const r=xe(t,O=>`${O.plane||"xy"}-${O.position}`),{paddingLeft:i,paddingRight:o,paddingTop:a,paddingBottom:s,marginLeft:l,marginTop:c,marginBottom:u,marginRight:f,innerHeight:d,innerWidth:h,insetBottom:p,insetLeft:v,insetRight:g,insetTop:y,height:m,width:b,depth:x}=n,w={xy:$2({width:b,height:m,paddingLeft:i,paddingRight:o,paddingTop:a,paddingBottom:s,marginLeft:l,marginTop:c,marginBottom:u,marginRight:f,innerHeight:d,innerWidth:h,insetBottom:p,insetLeft:v,insetRight:g,insetTop:y}),yz:$2({width:x,height:m,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:x,innerHeight:m,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0}),xz:$2({width:b,height:x,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:b,innerHeight:x,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0})};for(const[O,_]of r.entries()){const[S,E]=O.split("-"),M=w[S][E],[P,C]=qE(_,A=>typeof A.type!="string"?!1:!!(E==="center"||A.type.startsWith("axis")&&["inner","outer"].includes(E)));P.length&&qht(P,e,M,E),C.length&&ipt(_,e,M)}}function $2({width:t,height:e,paddingLeft:n,paddingRight:r,paddingTop:i,paddingBottom:o,marginLeft:a,marginTop:s,marginBottom:l,marginRight:c,innerHeight:u,innerWidth:f,insetBottom:d,insetLeft:h,insetRight:p,insetTop:v}){const g=n+a,y=i+s,m=r+c,b=o+l,x=t-a-c,w=[g+h,y+v,f-h-p,u-v-d,"center",null,null];return{top:[g,0,f,y,"vertical",!0,Te,a,x],right:[t-m,y,m,u,"horizontal",!1,Te],bottom:[g,e-b,f,b,"vertical",!1,Te,a,x],left:[0,y,g,u,"horizontal",!0,Te],"top-left":[g,0,f,y,"vertical",!0,Te],"top-right":[g,0,f,y,"vertical",!0,Te],"bottom-left":[g,e-b,f,b,"vertical",!1,Te],"bottom-right":[g,e-b,f,b,"vertical",!1,Te],center:w,inner:w,outer:w}}function qht(t,e,n,r){const[i,o]=qE(t,a=>!!(typeof a.type=="string"&&a.type.startsWith("axis")));Kht(i,e,n,r),opt(o,e,n)}function Kht(t,e,n,r){r==="center"?NH(e)?rpt(t,e,n):ce(e)?Jht(t,e,n):Jh(e)&&tpt(t,e,n,t[0].orientation):r==="inner"?Zht(t,e,n):r==="outer"&&Qht(t,e,n)}function Zht(t,e,n){const[r,i,,o]=n,[a,s]=e.getCenter(),[l]=tp(e),c=o/2,u=l*c,f=a-u,d=s-u;for(let h=0;h<t.length;h++){const p=t[h];p.bbox={x:r+f,y:i+d,width:u*2,height:u*2}}}function Qht(t,e,n){const[r,i,o,a]=n;for(const s of t)s.bbox={x:r,y:i,width:o,height:a}}function Jht(t,e,n){const[r,i,o,a]=n;for(const s of t)s.bbox={x:r,y:i,width:o,height:a}}function tpt(t,e,n,r){r==="horizontal"?npt(t,e,n):r==="vertical"&&ept(t,e,n)}function ept(t,e,n){const[r,i,,o]=n,a=new Array(t.length).fill(0),l=e.map(a).filter((c,u)=>u%2===0).map(c=>c+r);for(let c=0;c<t.length;c++){const u=t[c],f=l[c],d=l[c+1]-f;u.bbox={x:f,y:i,width:d,height:o}}}function npt(t,e,n){const[r,i,o]=n,a=new Array(t.length).fill(0),l=e.map(a).filter((c,u)=>u%2===1).map(c=>c+i);for(let c=0;c<t.length;c++){const u=t[c],f=l[c],d=l[c+1]-f;u.bbox={x:r,y:f,width:o,height:d}}}function rpt(t,e,n,r){const[i,o,a,s]=n;for(const l of t)l.bbox={x:i,y:o,width:a,height:s},l.radar={index:t.indexOf(l),count:t.length}}function ipt(t,e,n){const[r,i,o,a,s,l,c,u,f]=n,[d,h,p,v,g,y,m,b]=s==="vertical"?["y",i,"x",r,"height",a,"width",o]:["x",r,"y",i,"width",o,"height",a];t.sort((E,M)=>c==null?void 0:c(E.order,M.order));const x=E=>E==="title"||E==="group"||E.startsWith("legend"),w=(E,M,P)=>P===void 0?M:x(E)?P:M,O=(E,M,P)=>P===void 0?M:x(E)?P:M,_=l?h+y:h;for(let E=0,M=_;E<t.length;E++){const P=t[E],{crossPadding:C=0,type:A}=P,{size:T}=P;P.bbox={[d]:l?M-T-C:M+C,[p]:O(A,v,u),[g]:T,[m]:w(A,b,f)},M+=(T+C)*(l?-1:1)}const S=t.filter(E=>E.type==="group");for(const E of S){const{bbox:M,children:P}=E,C=M[m],A=C/P.length,T=P.reduce((I,$)=>{var F;const R=(F=$.layout)===null||F===void 0?void 0:F.justifyContent;return R||I},"flex-start"),k=P.map((I,$)=>{const{length:F=A,padding:R=0}=I;return F+($===P.length-1?0:R)}),N=kr(k),j=C-N,L=T==="flex-start"?0:T==="center"?j/2:j;for(let I=0,$=M[p]+L;I<P.length;I++){const F=P[I],{padding:R=0}=F,B=I===P.length-1?0:R;F.bbox={[g]:M[g],[d]:M[d],[p]:$,[m]:k[I]-B},Z(F,{layout:{justifyContent:T}}),$+=k[I]}}}function opt(t,e,n){if(t.length===0)return;const[r,i,o,a]=n,[s]=tp(e),l=a/2*s/Math.sqrt(2),c=r+o/2,u=i+a/2;for(let f=0;f<t.length;f++){const d=t[f];d.bbox={x:c-l,y:u-l,width:l*2,height:l*2}}}var apt=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?o(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})},gc=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function spt(t,e,n){const{encode:r={},scale:i={},transform:o=[]}=e,a=gc(e,["encode","scale","transform"]);return[t,Object.assign(Object.assign({},a),{encode:r,scale:i,transform:o})]}function zD(t,e,n){return apt(this,void 0,void 0,function*(){const{library:r}=n,{data:i}=e,[o]=pe("data",r),a=xpt(i),{transform:s=[]}=a,u=[gc(a,["transform"]),...s].map(o),f=yield VY(u)(i),d=i&&!Array.isArray(i)&&!Array.isArray(f)?{value:f}:f;return[Array.isArray(f)?Ja(f):[],Object.assign(Object.assign({},e),{data:d})]})}function lpt(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i={};for(const[o,a]of Object.entries(r))if(Array.isArray(a))for(let s=0;s<a.length;s++){const l=`${o}${s===0?"":s}`;i[l]=a[s]}else i[o]=a;return[t,Object.assign(Object.assign({},e),{encode:i})]}function cpt(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const o=Uo(r,a=>ypt(a)?a:{type:mpt(i,a),value:a});return[t,Object.assign(Object.assign({},e),{encode:o})]}function upt(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i=Uo(r,(o,a)=>{const{type:s}=o;return s!=="constant"||ght(a)?o:Object.assign(Object.assign({},o),{constant:!0})});return[t,Object.assign(Object.assign({},e),{encode:i})]}function fpt(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const{library:o}=n,a=_pt(o),s=Uo(r,l=>a(i,l));return[t,Object.assign(Object.assign({},e),{encode:s})]}function dpt(t,e,n){const{tooltip:r={}}=e;return io(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:Su(r)&&Q5(r)?[t,Object.assign(Object.assign({},e),{tooltip:r})]:[t,Object.assign(Object.assign({},e),{tooltip:{items:[r]}})]}function hpt(t,e,n){const{data:r,encode:i,tooltip:o={}}=e;if(io(o))return[t,e];const a=f=>{if(!f)return f;if(typeof f=="string")return t.map(d=>({name:f,value:r[d][f]}));if(Su(f)){const{field:d,channel:h,color:p,name:v=d,valueFormatter:g=O=>O}=f,y=typeof g=="string"?sa(g):g,m=h&&i[h],b=m&&i[h].field,x=v||b||h,w=[];for(const O of t){const _=d?r[O][d]:m?i[h].value[O]:null;w[O]={name:x,color:p,value:y(_)}}return w}if(typeof f=="function"){const d=[];for(const h of t){const p=f(r[h],h,r,i);Su(p)?d[h]=p:d[h]={value:p}}return d}return f},{title:s,items:l=[]}=o,c=gc(o,["title","items"]),u=Object.assign({title:a(s),items:Array.isArray(l)?l.map(a):[]},c);return[t,Object.assign(Object.assign({},e),{tooltip:u})]}function ppt(t,e,n){const{encode:r}=e,i=gc(e,["encode"]);if(!r)return[t,e];const o=Object.entries(r),a=o.filter(([,l])=>{const{value:c}=l;return Array.isArray(c[0])}).flatMap(([l,c])=>{const u=[[l,new Array(t.length).fill(void 0)]],{value:f}=c,d=gc(c,["value"]);for(let h=0;h<f.length;h++){const p=f[h];if(Array.isArray(p))for(let v=0;v<p.length;v++){const g=u[v]||[`${l}${v}`,new Array(t).fill(void 0)];g[1][h]=p[v],u[v]=g}}return u.map(([h,p])=>[h,Object.assign({type:"column",value:p},d)])}),s=Object.fromEntries([...o,...a]);return[t,Object.assign(Object.assign({},i),{encode:s})]}function vpt(t,e,n){const{axis:r={},legend:i={},slider:o={},scrollbar:a={}}=e,s=(c,u)=>{if(typeof c=="boolean")return c?{}:null;const f=c[u];return f===void 0||f?f:null},l=typeof r=="object"?Array.from(new Set(["x","y",...Object.keys(r)])):["x","y"];return Z(e,{scale:Object.assign(Object.assign({},Object.fromEntries(l.map(c=>{const u=s(a,c);return[c,Object.assign({guide:s(r,c),slider:s(o,c),scrollbar:u},u&&{ratio:u.ratio===void 0?.5:u.ratio})]}))),{color:{guide:s(i,"color")},size:{guide:s(i,"size")},shape:{guide:s(i,"shape")},opacity:{guide:s(i,"opacity")}})}),[t,e]}function gpt(t,e,n){const{animate:r}=e;return r||r===void 0?[t,e]:(Z(e,{animate:{enter:{type:null},exit:{type:null},update:{type:null}}}),[t,e])}function ypt(t){if(typeof t!="object"||t instanceof Date||t===null)return!1;const{type:e}=t;return ie(e)}function mpt(t,e){return typeof e=="function"?"transform":typeof e=="string"&&bpt(t,e)?"field":"constant"}function bpt(t,e){return Array.isArray(t)?t.some(n=>n[e]!==void 0):!1}function xpt(t){if(Va(t))return{type:"inline",value:t};if(!t)return{type:"inline",value:null};if(Array.isArray(t))return{type:"inline",value:t};const{type:e="inline"}=t,n=gc(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}var YD=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?o(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})},wpt=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function Opt(t,e,n){return YD(this,void 0,void 0,function*(){const r={library:n},[i,o]=yield Spt(t,e,r),{encode:a,scale:s,data:l,tooltip:c}=o;if(Array.isArray(l)===!1)return null;const{channels:u}=e,f=YE(Object.entries(a).filter(([,h])=>ie(h)),h=>h.map(([p,v])=>Object.assign({name:p},v)),([h])=>{var p;const v=(p=/([^\d]+)\d*$/.exec(h))===null||p===void 0?void 0:p[1],g=u.find(y=>y.name===v);return g!=null&&g.independent?h:v}),d=u.filter(h=>{const{name:p,required:v}=h;if(f.find(([g])=>g===p))return!0;if(v)throw new Error(`Missing encoding for channel: ${p}.`);return!1}).flatMap(h=>{const{name:p,scale:v,scaleKey:g,range:y,quantitative:m,ordinal:b}=h;return f.filter(([w])=>w.startsWith(p)).map(([w,O],_)=>{const S=O.some(j=>j.visual),E=O.some(j=>j.constant),M=s[w]||{},{independent:P=!1,key:C=g||w,type:A=E?"constant":S?"identity":v}=M,T=wpt(M,["independent","key","type"]),k=A==="constant",N=k?void 0:y;return{name:w,values:O,scaleKey:P||k?Symbol("independent"):C,scale:Object.assign(Object.assign({type:A,range:N},T),{quantitative:m,ordinal:b})}})});return[o,Object.assign(Object.assign({},e),{index:i,channels:d,tooltip:c})]})}function _pt(t){const[e]=pe("encode",t);return(n,r)=>r===void 0||n===void 0?null:Object.assign(Object.assign({},r),{type:"column",value:e(r)(n),field:Ept(r)})}function Spt(t,e,n){return YD(this,void 0,void 0,function*(){const{library:r}=n,[i]=pe("transform",r),{preInference:o=[],postInference:a=[]}=e,{transform:s=[]}=t,l=[spt,zD,lpt,cpt,upt,fpt,ppt,gpt,vpt,dpt,...o.map(i),...s.map(i),...a.map(i),hpt];let c=[],u=t;for(const f of l)[c,u]=yield f(c,u,n);return[c,u]})}function Ept(t){const{type:e,value:n}=t;return e==="field"&&typeof n=="string"?n:null}var xo=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?o(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})},va=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function F2(t,e,n,r){var i;return xo(this,void 0,void 0,function*(){const[o]=pe("composition",n),[a]=pe("interaction",n),s=new Set(Object.keys(n).map(A=>{var T;return(T=/mark\.(.*)/.exec(A))===null||T===void 0?void 0:T[1]}).filter(ie)),l=new Set(Object.keys(n).map(A=>{var T;return(T=/component\.(.*)/.exec(A))===null||T===void 0?void 0:T[1]}).filter(ie)),c=A=>{const{type:T}=A;if(typeof T=="function"){const{props:k={}}=T,{composite:N=!0}=k;if(N)return"mark"}return typeof T!="string"?T:s.has(T)||l.has(T)?"mark":T},u=A=>c(A)==="mark",f=A=>c(A)==="standardView",d=A=>{const{type:T}=A;return typeof T!="string"?!1:!!l.has(T)},h=A=>{if(f(A))return[A];const T=c(A);return o({type:T,static:d(A)})(A)},p=[],v=new Map,g=new Map,y=[t],m=[];for(;y.length;){const A=y.shift();if(f(A)){const T=g.get(A),[k,N]=T?UD(T,A,n):yield GD(A,n);v.set(k,A),p.push(k);const j=N.flatMap(h).map(L=>Nj(L,n));if(y.push(...j),j.every(f)){const L=yield Promise.all(j.map(I=>HD(I,n)));qdt(L);for(let I=0;I<j.length;I++){const $=j[I],F=L[I];g.set($,F)}}}else{const T=u(A)?A:yield KD(A,n),k=h(T);Array.isArray(k)?y.push(...k):typeof k=="function"&&m.push(k())}}r.emitter.emit(Ut.BEFORE_PAINT);const b=new Map,x=new Map,w=[];e.selectAll(Ui(Ex)).data(p,A=>A.key).join(A=>A.append("g").attr("className",Ex).attr("id",T=>T.key).call(WD).each(function(T,k,N){B2(T,gt(N),w,n,r),b.set(T,N)}),A=>A.call(WD).each(function(T,k,N){B2(T,gt(N),w,n,r),x.set(T,N)}),A=>A.each(function(T,k,N){const j=N.nameInteraction.values();for(const L of j)L.destroy()}).remove());const O=(A,T,k)=>Array.from(A.entries()).map(([N,j])=>{const L=k||new Map,I=(R,B=W=>W)=>L.set(R,B),$=v.get(N),F=Ppt(gt(j),$,n,r);return{view:N,container:j,options:$,setState:I,update:(R,B)=>xo(this,void 0,void 0,function*(){const K=fm(Array.from(L.values()))($);return yield F(K,R,()=>{Bo(B)&&T(A,B,L)})})}}),_=(A=x,T,k)=>{var N;const j=O(A,_,k);for(const L of j){const{options:I,container:$}=L,F=$.nameInteraction;let R=Cv(I);T&&(R=R.filter(B=>T.includes(B[0])));for(const B of R){const[W,K]=B,J=F.get(W);if(J&&((N=J.destroy)===null||N===void 0||N.call(J)),K){const V=R2(L.view,W,K,a)(L,j,r.emitter);F.set(W,{destroy:V})}}}},S=O(b,_);for(const A of S){const{options:T}=A,k=new Map;A.container.nameInteraction=k;for(const N of Cv(T)){const[j,L]=N;if(L){const $=R2(A.view,j,L,a)(A,S,r.emitter);k.set(j,{destroy:$})}}}_();const{width:E,height:M}=t,P=[];for(const A of m){const T=new Promise(k=>xo(this,void 0,void 0,function*(){for(const N of A){const j=Object.assign({width:E,height:M},N);yield F2(j,e,n,r)}k()}));P.push(T)}r.views=p,(i=r.animations)===null||i===void 0||i.forEach(A=>A==null?void 0:A.cancel()),r.animations=w,r.emitter.emit(Ut.AFTER_PAINT);const C=w.filter(ie).map(Ypt).map(A=>A.finished);return Promise.all([...C,...P])})}function WD(t){t.style("transform",e=>`translate(${e.layout.x}, ${e.layout.y})`)}function Mpt(t){const[,e]=pe("interaction",t);return n=>{const[r,i]=n;try{return[r,e(r)]}catch(o){return[r,i.type]}}}function Ppt(t,e,n,r){const i=Mpt(n),o=l=>l[1]&&l[1].props&&l[1].props.reapplyWhenUpdate,s=Cv(e).map(i).filter(o).map(l=>l[0]);return(l,c,u)=>xo(this,void 0,void 0,function*(){const f=[],[d,h]=yield GD(l,n);B2(d,t,f,n,r);for(const p of s.filter(v=>v!==c))Apt(p,t,l,d,n,r);for(const p of h)F2(p,t,n,r);return u(),{options:l,view:d}})}function Apt(t,e,n,r,i,o){var a;const[s]=pe("interaction",i),c=e.node().nameInteraction,u=Cv(n).find(([v])=>v===t),f=c.get(t);if(!f||((a=f.destroy)===null||a===void 0||a.call(f),!u[1]))return;const d=R2(r,t,u[1],s),h={options:n,view:r,container:e.node(),update:v=>Promise.resolve(v)},p=d(h,[],o.emitter);c.set(t,{destroy:p})}function GD(t,e){return xo(this,void 0,void 0,function*(){const n=yield Tpt(t,e),r=Cpt(n);t.interaction=r.interaction,t.coordinate=r.coordinate,t.marks=[...r.marks,...r.components];const i=Nj(r,e),o=yield HD(i,e);return UD(o,i,e)})}function Cpt(t){const{coordinate:e={},interaction:n={},style:r={},marks:i}=t,o=va(t,["coordinate","interaction","style","marks"]),a=i.map(d=>d.coordinate||{}),s=i.map(d=>d.interaction||{}),l=i.map(d=>d.viewStyle||{}),c=[...a,e].reduceRight((d,h)=>Z(d,h),{}),u=[n,...s].reduce((d,h)=>Z(d,h),{}),f=[...l,r].reduce((d,h)=>Z(d,h),{});return Object.assign(Object.assign({},o),{marks:i,coordinate:c,interaction:u,style:f})}function Tpt(t,e){return xo(this,void 0,void 0,function*(){const[n,r]=pe("mark",e),i=new Set(Object.keys(e).map(d=>{var h;return(h=/component\.(.*)/.exec(d))===null||h===void 0?void 0:h[1]}).filter(ie)),{marks:o}=t,a=[],s=[],l=[...o],{width:c,height:u}=Uht(t),f={options:t,width:c,height:u};for(;l.length;){const[d]=l.splice(0,1),h=yield KD(d,e),{type:p=ml("G2Mark type is required."),key:v}=h;if(i.has(p))s.push(h);else{const{props:g={}}=r(p),{composite:y=!0}=g;if(!y)a.push(h);else{const{data:m}=h,b=Object.assign(Object.assign({},h),{data:m&&(Array.isArray(m)?m:m.value)}),x=yield n(b,f),w=Array.isArray(x)?x:[x];l.unshift(...w.map((O,_)=>Object.assign(Object.assign({},O),{key:`${v}-${_}`})))}}}return Object.assign(Object.assign({},t),{marks:a,components:s})})}function HD(t,e){return xo(this,void 0,void 0,function*(){const[n]=pe("theme",e),[,r]=pe("mark",e),{theme:i,marks:o,coordinates:a=[]}=t,s=n(qD(i)),l=new Map;for(const u of o){const{type:f}=u,{props:d={}}=r(f),h=yield Opt(u,d,e);if(h){const[p,v]=h;l.set(p,v)}}const c=xe(Array.from(l.values()).flatMap(u=>u.channels),({scaleKey:u})=>u);for(const u of c.values()){const f=u.reduce((b,{scale:x})=>Z(b,x),{}),{scaleKey:d}=u[0],{values:h}=u[0],p=Array.from(new Set(h.map(b=>b.field).filter(ie))),v=Z({guide:{title:p.length===0?void 0:p},field:p[0]},f),{name:g}=u[0],y=u.flatMap(({values:b})=>b.map(x=>x.value)),m=Object.assign(Object.assign({},Hdt(g,y,v,a,s,e)),{key:d});u.forEach(b=>b.scale=m)}return l})}function R2(t,e,n,r){const i=t.theme,o=typeof e=="string"?i[e]||{}:{};return r(Z(o,Object.assign({type:e},n)))}function UD(t,e,n){const[r]=pe("mark",n),[i]=pe("theme",n),[o]=pe("labelTransform",n),{key:a,frame:s=!1,theme:l,clip:c,style:u={},labelTransform:f=[]}=e,d=i(qD(l)),h=Array.from(t.values()),p=Vdt(h,e),v=_ht(Oht(Upt(Array.from(p),h,t),e,n)),g=Hht(v,e,d,n),y=xft(g,e,n),m=s?Z({mainLineWidth:1,mainStroke:"#000"},u):u;Xht(DD(v),y,g),Ght(v);const b={};for(const O of v){const{scales:_=[]}=O,S=[];for(const E of _){const{name:M}=E,P=ED(E,n);S.push(P),M==="y"&&P.update(Object.assign(Object.assign({},P.getOptions()),{xScale:b.x})),SD(b,{[M]:P})}O.scaleInstances=S}const x=[];for(const[O,_]of t.entries()){const{children:S,dataDomain:E,modifier:M,key:P}=O,{index:C,channels:A,tooltip:T}=_,k=Object.fromEntries(A.map(({name:V,scale:it})=>[V,it])),N=Uo(k,V=>ED(V,n));SD(b,N);const j=Udt(A,N),L=r(O),[I,$,F]=Npt(L(C,N,j,y)),R=E||I.length,B=M?M($,R,g):[],W=V=>{var it,nt;return(nt=(it=T.title)===null||it===void 0?void 0:it[V])===null||nt===void 0?void 0:nt.value},K=V=>T.items.map(it=>it[V]),J=I.map((V,it)=>{const nt=Object.assign({points:$[it],transform:B[it],index:V,markKey:P,viewKey:a},T&&{title:W(V),items:K(V)});for(const[lt,yt]of Object.entries(j))nt[lt]=yt[V],F&&(nt[`series${zo(lt)}`]=F[it].map(vt=>yt[vt]));return F&&(nt.seriesIndex=F[it]),F&&T&&(nt.seriesItems=F[it].map(lt=>K(lt)),nt.seriesTitle=F[it].map(lt=>W(lt))),nt});_.data=J,_.index=I;const X=S==null?void 0:S(J,N,g);x.push(...X||[])}return[{layout:g,theme:d,coordinate:y,markState:t,key:a,clip:c,scale:b,style:m,components:v,labelTransform:fm(f.map(o))},x]}function B2(t,e,n,r,i){return xo(this,void 0,void 0,function*(){const{components:o,theme:a,layout:s,markState:l,coordinate:c,key:u,style:f,clip:d,scale:h}=t,{x:p,y:v,width:g,height:y}=s,m=va(s,["x","y","width","height"]),b=["view","plot","main","content"],x=b.map((L,I)=>I),w=["a","margin","padding","inset"],O=b.map(L=>HE(Object.assign({},a.view,f),L)),_=w.map(L=>ot(m,L)),S=L=>L.style("x",I=>A[I].x).style("y",I=>A[I].y).style("width",I=>A[I].width).style("height",I=>A[I].height).each(function(I,$,F){Vpt(gt(F),O[I])});let E=0,M=0,P=g,C=y;const A=x.map(L=>{const I=_[L],{left:$=0,top:F=0,bottom:R=0,right:B=0}=I;return E+=$,M+=F,P-=$+B,C-=F+R,{x:E,y:M,width:P,height:C}});e.selectAll(Ui(RI)).data(x.filter(L=>ie(O[L])),L=>b[L]).join(L=>L.append("rect").attr("className",RI).style("zIndex",-2).call(S),L=>L.call(S),L=>L.remove());const T=$pt(l),k=T?{duration:T[1]}:!1;for(const[,L]of om(o,I=>`${I.type}-${I.position}`))L.forEach((I,$)=>I.index=$);const N=e.selectAll(Ui(FI)).data(o,L=>`${L.type}-${L.position}-${L.index}`).join(L=>L.append("g").style("zIndex",({zIndex:I})=>I||-1).attr("className",FI).append(I=>jD(Z({animate:k,scale:h},I),c,a,r,l)),L=>L.transition(function(I,$,F){const{preserve:R=!1}=I;if(R)return;const B=jD(Z({animate:k,scale:h},I),c,a,r,l),{attributes:W}=B,[K]=F.childNodes;return K.update(W,!1)})).transitions();n.push(...N.flat().filter(ie));const j=e.selectAll(Ui(Nf)).data([s],()=>u).join(L=>L.append("rect").style("zIndex",0).style("fill","transparent").attr("className",Nf).call(ZD).call(JD,Array.from(l.keys())).call(t$,d),L=>L.call(JD,Array.from(l.keys())).call(I=>T?Hpt(I,T):ZD(I)).call(t$,d)).transitions();n.push(...j.flat());for(const[L,I]of l.entries()){const{data:$}=I,{key:F,class:R,type:B}=L,W=e.select(`#${F}`),K=Bpt(L,I,t,r,i),J=zpt(L,I,t,r),X=Wpt(L,I,t,r),V=Gpt(L,I,t,r),it=Fpt(e,W,R,"element"),nt=W.selectAll(Ui(mo)).selectFacetAll(it).data($,lt=>lt.key,lt=>lt.groupKey).join(lt=>lt.append(K).attr("className",mo).attr("markType",B).transition(function(yt,vt,mt){return J(yt,[mt])}),lt=>lt.call(yt=>{const vt=yt.parent(),mt=XY(Nt=>{const[Yt,me]=Nt.getBounds().min;return[Yt,me]});yt.transition(function(Nt,Yt,me){Rpt(me,vt,mt);const We=K(Nt,Yt),lr=X(Nt,[me],[We]);return lr!==null||(me.nodeName===We.nodeName&&We.nodeName!=="g"?hm(me,We):(me.parentNode.replaceChild(We,me),We.className=mo,We.markType=B,We.__data__=me.__data__)),lr}).attr("markType",B).attr("className",mo)}),lt=>lt.each(function(yt,vt,mt){mt.__removed__=!0}).transition(function(yt,vt,mt){return V(yt,[mt])}).remove(),lt=>lt.append(K).attr("className",mo).attr("markType",B).transition(function(yt,vt,mt){const{__fromElements__:Nt}=mt,Yt=X(yt,Nt,[mt]);return new Fp(Nt,null,mt.parentNode).transition(Yt).remove(),Yt}),lt=>lt.transition(function(yt,vt,mt){const Yt=new Fp([],mt.__toData__,mt.parentNode).append(K).attr("className",mo).attr("markType",B).nodes();return X(yt,[mt],Yt)}).remove()).transitions();n.push(...nt.flat())}kpt(t,e,n,r,i)})}function kpt(t,e,n,r,i){const[o]=pe("labelTransform",r),{markState:a,labelTransform:s}=t,l=e.select(Ui(Sx)).node(),c=new Map,u=new Map,f=Array.from(a.entries()).flatMap(([v,g])=>{const{labels:y=[],key:m}=v,b=Dpt(v,g,t,r,i),x=e.select(`#${m}`).selectAll(Ui(mo)).nodes().filter(w=>!w.__removed__);return y.flatMap((w,O)=>{const _=va(w,["transform"]);return x.flatMap(S=>{const E=Lpt(_,O,S);return E.forEach(M=>{c.set(M,b),u.set(M,w)}),E})})}),d=gt(l).selectAll(Ui(Mx)).data(f,v=>v.key).join(v=>v.append(g=>c.get(g)(g)).attr("className",Mx),v=>v.each(function(g,y,m){const x=c.get(g)(g);hm(m,x)}),v=>v.remove()).nodes(),h=xe(d,v=>u.get(v.__data__)),{coordinate:p}=t;for(const[v,g]of h){const{transform:y=[]}=v;fm(y.map(o))(g,p)}s&&s(d,p)}function Lpt(t,e,n){const{seriesIndex:r,seriesKey:i,points:o,key:a,index:s}=n.__data__,l=jpt(n);if(!r)return[Object.assign(Object.assign({},t),{key:`${a}-${e}`,bounds:l,index:s,points:o,dependentElement:n})];const c=Ipt(t),u=r.map((f,d)=>Object.assign(Object.assign({},t),{key:`${i[d]}-${e}`,bounds:[o[d]],index:f,points:o,dependentElement:n}));return c?c(u):u}function Npt([t,e,n]){if(n)return[t,e,n];const r=[],i=[];for(let o=0;o<t.length;o++){const a=t[o],s=e[o];s.every(([l,c])=>ie(l)&&ie(c))&&(r.push(a),i.push(s))}return[r,i]}function Ipt(t){const{selector:e}=t;if(!e)return null;if(typeof e=="function")return e;if(e==="first")return n=>[n[0]];if(e==="last")return n=>[n[n.length-1]];throw new Error(`Unknown selector: ${e}`)}function jpt(t){const e=t.cloneNode(),n=t.getAnimations();e.style.visibility="hidden",n.forEach(a=>{const s=a.effect.getKeyframes();e.attr(s[s.length-1])}),t.parentNode.appendChild(e);const r=e.getLocalBounds();e.destroy();const{min:i,max:o}=r;return[i,o]}function Dpt(t,e,n,r,i){const[o]=pe("shape",r),{data:a}=t,{data:s,defaultLabelShape:l}=e,c=s.map(h=>h.points),{theme:u,coordinate:f}=n,d=Object.assign(Object.assign({},i),{document:kj(i),theme:u,coordinate:f});return h=>{const{index:p,points:v}=h,g=a[p],{formatter:y=k=>`${k}`,transform:m,style:b,render:x}=h,w=va(h,["formatter","transform","style","render"]),O=Uo(Object.assign(Object.assign({},w),b),k=>VD(k,g,p,a)),{shape:_=l,text:S}=O,E=va(O,["shape","text"]),M=typeof y=="string"?sa(y):y,P=Object.assign(Object.assign({},E),{text:M(S,g,p,a),datum:g}),C=Object.assign({type:`label.${_}`,render:x},E),A=o(C,d),T=XD(u,"label",_,"label");return A(v,P,T,c)}}function VD(t,e,n,r){return typeof t=="function"?t(e,n,r):typeof t!="string"?t:e[t]!==void 0?e[t]:t}function $pt(t){let e=-1/0,n=1/0;for(const[r,i]of t){const{animate:o={}}=r,{data:a}=i,{enter:s={},update:l={},exit:c={}}=o,{type:u,duration:f=300,delay:d=0}=l,{type:h,duration:p=300,delay:v=0}=s,{type:g,duration:y=300,delay:m=0}=c;for(const b of a){const{updateType:x=u,updateDuration:w=f,updateDelay:O=d,enterType:_=h,enterDuration:S=p,enterDelay:E=v,exitDuration:M=y,exitDelay:P=m,exitType:C=g}=b;(x===void 0||x)&&(e=Math.max(e,w+O),n=Math.min(n,O)),(C===void 0||C)&&(e=Math.max(e,M+P),n=Math.min(n,P)),(_===void 0||_)&&(e=Math.max(e,S+E),n=Math.min(n,E))}}return e===-1/0?null:[n,e-n]}function Fpt(t,e,n,r){return t.node().parentElement.findAll(o=>o.style.facet!==void 0&&o.style.facet===n&&o!==e.node()).flatMap(o=>o.getElementsByClassName(r))}function Rpt(t,e,n){if(!t.__facet__)return;const r=t.parentNode.parentNode,i=e.parentNode,[o,a]=n(r),[s,l]=n(i),c=`translate(${o-s}, ${a-l})`;qY(t,c),e.append(t)}function Bpt(t,e,n,r,i){const[o]=pe("shape",r),{data:a}=t,{defaultShape:s,data:l,shape:c}=e,u=l.map(g=>g.points),{theme:f,coordinate:d}=n,{type:h,style:p={}}=t,v=Object.assign(Object.assign({},i),{document:kj(i),coordinate:d,theme:f});return g=>{const{shape:y=s}=p,{shape:m=y,points:b,seriesIndex:x,index:w}=g,O=va(g,["shape","points","seriesIndex","index"]),_=Object.assign(Object.assign({},O),{index:w}),S=x?x.map(A=>a[A]):a[w],E=x||w,M=Uo(p,A=>VD(A,S,E,a)),P=c[m]?c[m](M,v):o(Object.assign(Object.assign({},M),{type:QD(t,m)}),v),C=XD(f,h,m,s);return P(b,_,C,u)}}function XD(t,e,n,r){if(typeof e!="string")return;const{color:i}=t,o=t[e]||{},a=o[n]||o[r];return Object.assign({color:i},a)}function z2(t,e,n,r,i){var o,a;const[,s]=pe("shape",i),[l]=pe("animation",i),{defaultShape:c,shape:u}=n,{theme:f,coordinate:d}=r,p=`default${zo(t)}Animation`,{[p]:v}=((o=u[c])===null||o===void 0?void 0:o.props)||s(QD(e,c)).props,{[t]:g={}}=f,y=((a=e.animate)===null||a===void 0?void 0:a[t])||{},m={coordinate:d};return(b,x,w)=>{const{[`${t}Type`]:O,[`${t}Delay`]:_,[`${t}Duration`]:S,[`${t}Easing`]:E}=b,M=Object.assign({type:O||v},y);if(!M.type)return null;const A=l(M,m)(x,w,Z(g,{delay:_,duration:S,easing:E}));return Array.isArray(A)?A:[A]}}function zpt(t,e,n,r){return z2("enter",t,e,n,r)}function Ypt(t){return t.finished.then(()=>{t.cancel()}),t}function Wpt(t,e,n,r){return z2("update",t,e,n,r)}function Gpt(t,e,n,r){return z2("exit",t,e,n,r)}function qD(t={}){if(typeof t=="string")return{type:t};const{type:e="light"}=t,n=va(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}function Cv(t){const e={event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},{interaction:n={}}=t;return Object.entries(Z(e,n)).reverse()}function KD(t,e){return xo(this,void 0,void 0,function*(){const n={library:e},{data:r}=t,i=va(t,["data"]);if(r==null)return t;const[,{data:o}]=yield zD([],{data:r},n);return Object.assign({data:o},i)})}function ZD(t){t.style("x",e=>e.paddingLeft+e.marginLeft).style("y",e=>e.paddingTop+e.marginTop).style("width",e=>e.innerWidth).style("height",e=>e.innerHeight)}function Hpt(t,e){const[n,r]=e;t.transition(function(i,o,a){const{x:s,y:l,width:c,height:u}=a.style,{paddingLeft:f,paddingTop:d,innerWidth:h,innerHeight:p,marginLeft:v,marginTop:g}=i,y=[{x:s,y:l,width:c,height:u},{x:f+v,y:d+g,width:h,height:p}];return a.animate(y,{delay:n,duration:r,fill:"both"})})}function QD(t,e){const{type:n}=t;return typeof e=="string"?`${n}.${e}`:e}function JD(t,e){const n=o=>o.class!==void 0?`${o.class}`:"";t.nodes().length===0||(t.selectAll(Ui($I)).data(e,o=>o.key).join(o=>o.append("g").attr("className",$I).attr("id",a=>a.key).style("facet",n).style("fill","transparent").style("zIndex",a=>{var s;return(s=a.zIndex)!==null&&s!==void 0?s:0}),o=>o.style("facet",n).style("fill","transparent").style("zIndex",a=>{var s;return(s=a.zIndex)!==null&&s!==void 0?s:0}),o=>o.remove()),t.select(Ui(Sx)).node())||t.append("g").attr("className",Sx).style("zIndex",0)}function Ui(...t){return t.map(e=>`.${e}`).join("")}function t$(t,e){t.node()&&t.style("clipPath",n=>{if(!e)return null;const{paddingTop:r,paddingLeft:i,marginLeft:o,marginTop:a,innerWidth:s,innerHeight:l}=n;return new hs({style:{x:i+o,y:r+a,width:s,height:l}})})}function Upt(t,e,n){var r;for(const[c]of n.entries())if(c.type==="cell")return t.filter(u=>u.name!=="shape");if(e.length!==1||t.some(c=>c.name==="shape"))return t;const{defaultShape:i}=e[0];if(!["point","line","rect","hollow"].includes(i))return t;const a={point:"point",line:"hyphen",rect:"square",hollow:"hollow"},l={field:((r=t.find(c=>c.name==="color"))===null||r===void 0?void 0:r.field)||null,name:"shape",type:"constant",domain:[],range:[a[i]]};return[...t,l]}function Vpt(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}function Xpt(t){const e=Z({},t),n=new Map([[e,null]]),r=new Map([[null,-1]]),i=[e];for(;i.length;){const o=i.shift();if(o.key===void 0){const s=n.get(o),l=r.get(o),c=s===null?"0":`${s.key}-${l}`;o.key=c}const{children:a=[]}=o;if(Array.isArray(a))for(let s=0;s<a.length;s++){const l=Z({},a[s]);a[s]=l,n.set(l,o),r.set(l,s),i.push(l)}}return e}function qpt(t,e){const n=new UI;return n.registerPlugin(new VI),new AC({width:t,height:e,container:document.createElement("div"),renderer:n})}function Kpt(t,e={},n=()=>{},r=i=>{throw i}){const{width:i=640,height:o=480,depth:a=0}=t,s=Xpt(t),{canvas:l=qpt(i,o),emitter:c=new Ax,library:u}=e;e.canvas=l,e.emitter=c;const{width:f,height:d}=l.getConfig();(f!==i||d!==o)&&l.resize(i,o),c.emit(Ut.BEFORE_RENDER);const h=gt(l.document.documentElement);return l.ready.then(()=>F2(Object.assign(Object.assign({},s),{width:i,height:o,depth:a}),h,u,e)).then(()=>{if(a){const[p,v]=l.document.documentElement.getPosition();l.document.documentElement.setPosition(p,v,-a/2)}l.requestAnimationFrame(()=>{c.emit(Ut.AFTER_RENDER),n==null||n()})}).catch(p=>{r==null||r(p)}),Qpt(l.getConfig().container)}function e$(t,e={},n=!1){const{canvas:r,emitter:i}=e;r&&(Zpt(r),n?r.destroy():r.destroyChildren()),i.off()}function Zpt(t){const e=t.getRoot().querySelectorAll(`.${Ex}`);e==null||e.forEach(n=>{const{nameInteraction:r=new Map}=n;(r==null?void 0:r.size)>0&&Array.from(r==null?void 0:r.values()).forEach(i=>{i==null||i.destroy()})})}function Qpt(t){return typeof t=="string"?document.getElementById(t):t}const Jpt={visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1};function t0t(t,e){var n;return(n=t.style[e])!==null&&n!==void 0?n:Jpt[e]}function Y2(t,e,n,r){t.style[e]=n,r&&t.children.forEach(i=>Y2(i,e,n,r))}function W2(t){Y2(t,"visibility","hidden",!0)}function G2(t){Y2(t,"visibility","visible",!0)}var ed=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function ga(t){return gt(t).selectAll(`.${mo}`).nodes().filter(e=>!e.__removed__)}function n$(t,e){return H2(t,e).flatMap(({container:n})=>ga(n))}function H2(t,e){return e.filter(n=>n!==t&&n.options.parentKey===t.options.key)}function wo(t){return gt(t).select(`.${Nf}`).node()}function r$(t){if(t.nodeName!=="rect")return t.getRenderBounds();const{x:e,y:n,width:r,height:i}=t.style;return{min:[e,n],max:[e+r,n+i]}}function U2(t,e){const{offsetX:n,offsetY:r}=e,i=r$(t),{min:[o,a],max:[s,l]}=i,c=n<o||n>s,u=r<a||r>l;return c||u?null:[n-o,r-a]}function V2(t,e){const{offsetX:n,offsetY:r}=e,[i,o,a,s]=e0t(t);return[Math.min(a,Math.max(i,n))-i,Math.min(s,Math.max(o,r))-o]}function e0t(t){const e=t.getRenderBounds(),{min:[n,r],max:[i,o]}=e;return[n,r,i,o]}function i$(t){return e=>e.__data__.color}function X2(t){return e=>e.__data__.x}function ks(t){const e=Array.isArray(t)?t:[t],n=new Map(e.flatMap(r=>Array.from(r.markState.keys()).map(o=>[Tv(r.key,o.key),o.data])));return r=>{const{index:i,markKey:o,viewKey:a}=r.__data__;return n.get(Tv(a,o))[i]}}function Oo(t,e=(r,i)=>r,n=(r,i,o)=>r.setAttribute(i,o)){const r="__states__",i="__ordinal__",o=u=>{const{[r]:f=[],[i]:d={}}=u,h=f.reduce((p,v)=>Object.assign(Object.assign({},p),t[v]),d);if(Object.keys(h).length!==0){for(const[p,v]of Object.entries(h)){const g=t0t(u,p),y=e(v,u);n(u,p,y),p in d||(d[p]=g)}u[i]=d}},a=u=>{u[r]||(u[r]=[])};return{setState:(u,...f)=>{a(u),u[r]=[...f],o(u)},removeState:(u,...f)=>{a(u);for(const d of f){const h=u[r].indexOf(d);h!==-1&&u[r].splice(h,1)}o(u)},hasState:(u,f)=>(a(u),u[r].indexOf(f)!==-1)}}function n0t(t){return t===void 0?!0:typeof t!="object"?!1:Object.keys(t).length===0}function Tv(t,e){return`${t},${e}`}function yc(t,e){const r=(Array.isArray(t)?t:[t]).flatMap(o=>o.marks.map(a=>[Tv(o.key,a.key),a.state])),i={};for(const o of e){const[a,s]=Array.isArray(o)?o:[o,{}];i[a]=r.reduce((l,c)=>{const[u,f={}]=c,d=n0t(f[a])?s:f[a];for(const[h,p]of Object.entries(d)){const v=l[h],g=(y,m,b,x)=>{const w=Tv(x.__data__.viewKey,x.__data__.markKey);return u!==w?v==null?void 0:v(y,m,b,x):typeof p!="function"?p:p(y,m,b,x)};l[h]=g}return l},{})}return i}function nd(t,e){const n=new Map(t.map((i,o)=>[i,o])),r=e?t.map(e):t;return(i,o)=>{if(typeof i!="function")return i;const a=n.get(o),s=e?e(o):o;return i(s,a,r,o)}}function o$(t){var{link:e=!1,valueof:n=(u,f)=>u,coordinate:r}=t,i=ed(t,["link","valueof","coordinate"]);const o="element-link";if(!e)return[()=>{},()=>{}];const a=u=>u.__data__.points,s=(u,f)=>{const[,d,h]=u,[p,,,v]=f;return[d,p,v,h]};return[u=>{var f;if(u.length<=1)return;const d=ro(u,(h,p)=>{const{x:v}=h.__data__,{x:g}=p.__data__;return v-g});for(let h=1;h<d.length;h++){const p=Nr(),v=d[h-1],g=d[h],[y,m,b,x]=s(a(v),a(g));p.moveTo(...y),p.lineTo(...m),p.lineTo(...b),p.lineTo(...x),p.closePath();const w=Uo(i,E=>n(E,v)),{fill:O=v.getAttribute("fill")}=w,_=ed(w,["fill"]),S=new Dn({className:o,style:Object.assign({d:p.toString(),fill:O,zIndex:-2},_)});(f=v.link)===null||f===void 0||f.remove(),v.parentNode.appendChild(S),v.link=S}},u=>{var f;(f=u.link)===null||f===void 0||f.remove(),u.link=null}]}function a$(t,e,n){const r=i=>{const{transform:o}=t.style;return o?`${o} ${i}`:i};if(ce(n)){const{points:i}=t.__data__,[o,a]=he(n)?zp(i):i,s=n.getCenter(),l=ke(o,s),c=ke(a,s),u=Lr(l),f=yP(l,c),d=u+f/2,h=e*Math.cos(d),p=e*Math.sin(d);return r(`translate(${h}, ${p})`)}return he(n)?r(`translate(${e}, 0)`):r(`translate(0, ${-e})`)}function s$(t){var{document:e,background:n,scale:r,coordinate:i,valueof:o}=t,a=ed(t,["document","background","scale","coordinate","valueof"]);const s="element-background";if(!n)return[()=>{},()=>{}];const l=(y,m,b)=>{const x=y.invert(m),w=m+y.getBandWidth(x)/2,O=y.getStep(x)/2,_=O*b;return[w-O+_,w+O-_]},c=(y,m)=>{const{x:b}=r;if(!Tf(b))return[0,1];const{__data__:x}=y,{x:w}=x,[O,_]=l(b,w,m);return[O,_]},u=(y,m)=>{const{y:b}=r;if(!Tf(b))return[0,1];const{__data__:x}=y,{y:w}=x,[O,_]=l(b,w,m);return[O,_]},f=(y,m)=>{const{padding:b}=m,[x,w]=c(y,b),[O,_]=u(y,b),S=[[x,O],[w,O],[w,_],[x,_]].map(C=>i.map(C)),{__data__:E}=y,{y:M,y1:P}=E;return qC(e,S,{y:M,y1:P},i,m)},d=(y,m)=>{const{transform:b="scale(1.2, 1.2)",transformOrigin:x="center center",stroke:w=""}=m,O=ed(m,["transform","transformOrigin","stroke"]),_=Object.assign({transform:b,transformOrigin:x,stroke:w},O),S=y.cloneNode(!0);for(const[E,M]of Object.entries(_))S.style[E]=M;return S},h=()=>{const{x:y,y:m}=r;return[y,m].some(Tf)};return[y=>{y.background&&y.background.remove();const m=Uo(a,C=>o(C,y)),{fill:b="#CCD6EC",fillOpacity:x=.3,zIndex:w=-2,padding:O=.001,strokeWidth:_=0}=m,S=ed(m,["fill","fillOpacity","zIndex","padding","strokeWidth"]),E=Object.assign(Object.assign({},S),{fill:b,fillOpacity:x,zIndex:w,padding:O,strokeWidth:_}),P=(h()?f:d)(y,E);P.className=s,y.parentNode.parentNode.appendChild(P),y.background=P},y=>{var m;(m=y.background)===null||m===void 0||m.remove(),y.background=null},y=>y.className===s]}function ya(t,e){const r=t.getRootNode().defaultView.getContextService().getDomElement();r!=null&&r.style&&(t.cursor=r.style.cursor,r.style.cursor=e)}function r0t(t){ya(t,t.cursor)}function q2(t,e,n){return t.find(r=>Object.entries(e).every(([i,o])=>n(r)[i]===o))}var i0t=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function o0t(t,{elements:e,datum:n,groupKey:r=f=>f,link:i=!1,background:o=!1,delay:a=60,scale:s,coordinate:l,emitter:c,state:u={}}){var f;const d=e(t),h=new Set(d),p=xe(d,r),v=nd(d,n),[g,y]=o$(Object.assign({elements:d,valueof:v,link:i,coordinate:l},ot(u.active,"link"))),[m,b,x]=s$(Object.assign({document:t.ownerDocument,scale:s,coordinate:l,background:o,valueof:v},ot(u.active,"background"))),w=Z(u,{active:Object.assign({},((f=u.active)===null||f===void 0?void 0:f.offset)&&{transform:(...j)=>{const L=u.active.offset(...j),[,I]=j;return a$(d[I],L,l)}})}),{setState:O,removeState:_,hasState:S}=Oo(w,v);let E;const M=j=>{const{target:L,nativeEvent:I=!0}=j;if(!h.has(L))return;E&&clearTimeout(E);const $=r(L),F=p.get($),R=new Set(F);for(const B of d)R.has(B)?S(B,"active")||O(B,"active"):(O(B,"inactive"),y(B)),B!==L&&b(B);m(L),g(F),I&&c.emit("element:highlight",{nativeEvent:I,data:{data:n(L),group:F.map(n)}})},P=()=>{E&&clearTimeout(E),E=setTimeout(()=>{C(),E=null},a)},C=(j=!0)=>{for(const L of d)_(L,"active","inactive"),b(L),y(L);j&&c.emit("element:unhighlight",{nativeEvent:j})},A=j=>{const{target:L}=j;o&&!x(L)||!o&&!h.has(L)||(a>0?P():C())},T=()=>{C()};t.addEventListener("pointerover",M),t.addEventListener("pointerout",A),t.addEventListener("pointerleave",T);const k=j=>{const{nativeEvent:L}=j;L||C(!1)},N=j=>{const{nativeEvent:L}=j;if(L)return;const{data:I}=j.data,$=q2(d,I,n);$&&M({target:$,nativeEvent:!1})};return c.on("element:highlight",N),c.on("element:unhighlight",k),()=>{t.removeEventListener("pointerover",M),t.removeEventListener("pointerout",A),t.removeEventListener("pointerleave",T),c.off("element:highlight",N),c.off("element:unhighlight",k);for(const j of d)b(j),y(j)}}function kv(t){var{delay:e,createGroup:n,background:r=!1,link:i=!1}=t,o=i0t(t,["delay","createGroup","background","link"]);return(a,s,l)=>{const{container:c,view:u,options:f}=a,{scale:d,coordinate:h}=u,p=wo(c);return o0t(p,Object.assign({elements:ga,datum:ks(u),groupKey:n?n(u):void 0,coordinate:h,scale:d,state:yc(f,[["active",r?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:r,link:i,delay:e,emitter:l},o))}}kv.props={reapplyWhenUpdate:!0};function l$(t){return kv(Object.assign(Object.assign({},t),{createGroup:X2}))}l$.props={reapplyWhenUpdate:!0};function c$(t){return kv(Object.assign(Object.assign({},t),{createGroup:i$}))}c$.props={reapplyWhenUpdate:!0};var a0t=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function s0t(t,{elements:e,datum:n,groupKey:r=f=>f,link:i=!1,single:o=!1,coordinate:a,background:s=!1,scale:l,emitter:c,state:u={}}){var f;const d=e(t),h=new Set(d),p=xe(d,r),v=nd(d,n),[g,y]=o$(Object.assign({link:i,elements:d,valueof:v,coordinate:a},ot(u.selected,"link"))),[m,b]=s$(Object.assign({document:t.ownerDocument,background:s,coordinate:a,scale:l,valueof:v},ot(u.selected,"background"))),x=Z(u,{selected:Object.assign({},((f=u.selected)===null||f===void 0?void 0:f.offset)&&{transform:(...T)=>{const k=u.selected.offset(...T),[,N]=T;return a$(d[N],k,a)}})}),{setState:w,removeState:O,hasState:_}=Oo(x,v),S=(T=!0)=>{for(const k of d)O(k,"selected","unselected"),y(k),b(k);T&&c.emit("element:unselect",{nativeEvent:!0})},E=(T,k,N=!0)=>{if(_(k,"selected"))S();else{const j=r(k),L=p.get(j),I=new Set(L);for(const $ of d)I.has($)?w($,"selected"):(w($,"unselected"),y($)),$!==k&&b($);if(g(L),m(k),!N)return;c.emit("element:select",Object.assign(Object.assign({},T),{nativeEvent:N,data:{data:[n(k),...L.map(n)]}}))}},M=(T,k,N=!0)=>{const j=r(k),L=p.get(j),I=new Set(L);if(_(k,"selected")){if(!d.some(F=>!I.has(F)&&_(F,"selected")))return S();for(const F of L)w(F,"unselected"),y(F),b(F)}else{const $=L.some(F=>_(F,"selected"));for(const F of d)I.has(F)?w(F,"selected"):_(F,"selected")||w(F,"unselected");!$&&i&&g(L),m(k)}N&&c.emit("element:select",Object.assign(Object.assign({},T),{nativeEvent:N,data:{data:d.filter($=>_($,"selected")).map(n)}}))},P=T=>{const{target:k,nativeEvent:N=!0}=T;return h.has(k)?o?E(T,k,N):M(T,k,N):S()};t.addEventListener("click",P);const C=T=>{const{nativeEvent:k,data:N}=T;if(k)return;const j=o?N.data.slice(0,1):N.data;for(const L of j){const I=q2(d,L,n);P({target:I,nativeEvent:!1})}},A=()=>{S(!1)};return c.on("element:select",C),c.on("element:unselect",A),()=>{for(const T of d)y(T);t.removeEventListener("click",P),c.off("element:select",C),c.off("element:unselect",A)}}function Lv(t){var{createGroup:e,background:n=!1,link:r=!1}=t,i=a0t(t,["createGroup","background","link"]);return(o,a,s)=>{const{container:l,view:c,options:u}=o,{coordinate:f,scale:d}=c,h=wo(l);return s0t(h,Object.assign({elements:ga,datum:ks(c),groupKey:e?e(c):void 0,coordinate:f,scale:d,state:yc(u,[["selected",n?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:n,link:r,emitter:s},i))}}Lv.props={reapplyWhenUpdate:!0};function u$(t){return Lv(Object.assign(Object.assign({},t),{createGroup:X2}))}u$.props={reapplyWhenUpdate:!0};function f$(t){return Lv(Object.assign(Object.assign({},t),{createGroup:i$}))}f$.props={reapplyWhenUpdate:!0};var l0t=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?o(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})},c0t=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function u0t(t){const{transform:e=[]}=t,n=e.find(i=>i.type==="normalizeY");if(n)return n;const r={type:"normalizeY"};return e.push(r),t.transform=e,r}function f0t(t,e,n){const[r]=Array.from(t.entries()).filter(([i])=>i.type===e).map(([i])=>{const{encode:o}=i,a=s=>{const l=o[s];return[s,l?l.value:void 0]};return Object.fromEntries(n.map(a))});return r}function d$(t){var{wait:e=20,leading:n,trailing:r=!1,labelFormatter:i=a=>`${a}`}=t,o=c0t(t,["wait","leading","trailing","labelFormatter"]);return a=>{const{view:s,container:l,update:c,setState:u}=a,{markState:f,scale:d,coordinate:h}=s,p=f0t(f,"line",["x","y","series"]);if(!p)return;const{y:v,x:g,series:y=[]}=p,m=v.map((j,L)=>L),b=ro(m.map(j=>g[j])),x=wo(l),w=l.getElementsByClassName(mo),O=l.getElementsByClassName(Mx),S=xe(O,j=>j.__data__.key.split("-")[0]),E=new rf({style:Object.assign({x1:0,y1:0,x2:0,y2:x.getAttribute("height"),stroke:"black",lineWidth:1},ot(o,"rule"))}),M=new jr({style:Object.assign({x:0,y:x.getAttribute("height"),text:"",fontSize:10},ot(o,"label"))});E.append(M),x.appendChild(E);const P=(j,L,I)=>{const[$]=j.invert(I),F=L.invert($);return b[_Y(b,F)]},C=(j,L)=>{E.setAttribute("x1",j[0]),E.setAttribute("x2",j[0]),M.setAttribute("text",i(L))};let A;const T=j=>l0t(this,void 0,void 0,function*(){const{x:L}=d,I=P(h,L,j);C(j,I),u("chartIndex",F=>{const R=Z({},F),B=R.marks.find(V=>V.type==="line"),K=Gt(am(m,V=>Gt(V,it=>+v[it])/fr(V,it=>+v[it]),V=>y[V]).values()),J=[1/K,K];Z(B,{scale:{y:{domain:J}}});const X=u0t(B);X.groupBy="color",X.basis=(V,it)=>{const nt=V[vl(lt=>g[+lt]).center(V,I)];return it[nt]};for(const V of R.marks)V.animate=!1;return R}),A=(yield c("chartIndex")).view}),k=j=>{const{scale:L,coordinate:I}=A,{x:$,y:F}=L,R=P(I,$,j);C(j,R);for(const B of w){const{seriesIndex:W,key:K}=B.__data__,J=W[vl(vt=>g[+vt]).center(W,R)],X=[0,F.map(1)],V=[0,F.map(v[J]/v[W[0]])],[,it]=I.map(X),[,nt]=I.map(V),lt=it-nt;B.setAttribute("transform",`translate(0, ${lt})`);const yt=S.get(K)||[];for(const vt of yt)vt.setAttribute("dy",lt)}},N=Xa(j=>{const L=U2(x,j);L&&k(L)},e,{leading:n,trailing:r});return T([0,0]),x.addEventListener("pointerenter",N),x.addEventListener("pointermove",N),x.addEventListener("pointerleave",N),()=>{E.remove(),x.removeEventListener("pointerenter",N),x.removeEventListener("pointermove",N),x.removeEventListener("pointerleave",N)}}}d$.props={reapplyWhenUpdate:!0};function d0t(t){const{coordinate:e={}}=t,{transform:n=[]}=e,r=n.find(o=>o.type==="fisheye");if(r)return r;const i={type:"fisheye"};return n.push(i),e.transform=n,t.coordinate=e,i}function h0t({wait:t=30,leading:e,trailing:n=!1}){return r=>{const{options:i,update:o,setState:a,container:s}=r,l=wo(s),c=Xa(u=>{const f=U2(l,u);if(!f){a("fisheye"),o();return}a("fisheye",d=>{const h=Z({},d,{interaction:{tooltip:{preserve:!0}}});for(const y of h.marks)y.animate=!1;const[p,v]=f,g=d0t(h);return g.focusX=p,g.focusY=v,g.visual=!0,h}),o()},t,{leading:e,trailing:n});return l.addEventListener("pointerenter",c),l.addEventListener("pointermove",c),l.addEventListener("pointerleave",c),()=>{l.removeEventListener("pointerenter",c),l.removeEventListener("pointermove",c),l.removeEventListener("pointerleave",c)}}}var rd=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function Nv(t,e){return e?typeof e=="string"?document.querySelector(e):e:t.ownerDocument.defaultView.getContextService().getDomElement().parentElement}function p0t(t){const e=t.getRenderBounds(),{min:[n,r],max:[i,o]}=e;return{x:n,y:r,width:i-n,height:o-r}}function v0t(t,e){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return{x:n.x-r.x,y:n.y-r.y}}function g0t(t,e,n,r,i,o,a,s={}){const l={".g2-tooltip":{},".g2-tooltip-title":{overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}},c=new Vtt({className:"tooltip",style:{x:e,y:n,container:a,data:[],bounding:o,position:r,enterable:i,title:"",offset:[10,10],template:{prefixCls:"g2-"},style:Z(l,s)}});return t.appendChild(c.HTMLTooltipElement),c}function h$({root:t,data:e,x:n,y:r,render:i,event:o,single:a,position:s="right-bottom",enterable:l=!1,css:c,mount:u,bounding:f}){const d=Nv(t,u),h=Nv(t),p=a?h:t,v=f||p0t(t),g=v0t(h,d),{tooltipElement:y=g0t(d,n,r,s,l,v,g,c)}=p,{items:m,title:b=""}=e;y.update(Object.assign({x:n,y:r,data:m,title:b,position:s,enterable:l},i!==void 0&&{content:i(o,{items:m,title:b})})),p.tooltipElement=y}function ma({root:t,single:e,emitter:n,nativeEvent:r=!0,event:i=null}){r&&n.emit("tooltip:hide",{nativeEvent:r});const o=Nv(t),a=e?o:t,{tooltipElement:s}=a;s&&s.hide(i==null?void 0:i.clientX,i==null?void 0:i.clientY)}function K2({root:t,single:e}){const n=Nv(t),r=e?n:t;if(!r)return;const{tooltipElement:i}=r;i&&(i.destroy(),r.tooltipElement=void 0)}function p$(t){const{value:e}=t;return Object.assign(Object.assign({},t),{value:e===void 0?"undefined":e})}function y0t(t){const{__data__:e}=t,{title:n,items:r=[]}=e,i=r.filter(ie).map(o=>{var{color:a=v$(t)}=o,s=rd(o,["color"]);return Object.assign(Object.assign({},s),{color:a})}).map(p$);return Object.assign(Object.assign({},n&&{title:n}),{items:i})}function m0t(t,e){const{color:n,series:r,facet:i=!1}=t,{color:o,series:a}=e,s=l=>l&&l.invert&&!(l instanceof $u)&&!(l instanceof Mm);if(s(r))return r.clone().invert(a);if(a&&r instanceof $u&&r.invert(a)!==o&&!i)return r.invert(a);if(s(n)){const l=n.invert(o);return Array.isArray(l)?null:l}return null}function v$(t){const e=t.getAttribute("fill"),n=t.getAttribute("stroke"),{__data__:r}=t,{color:i=e&&e!=="transparent"?e:n}=r;return i}function g$(t,e=n=>n){const n=new Map(t.map(r=>[e(r),r]));return Array.from(n.values())}function y$(t,e,n,r=t.map(o=>o.__data__),i={}){const o=l=>l instanceof Date?+l:l,a=g$(r.map(l=>l.title),o).filter(ie),s=r.flatMap((l,c)=>{const u=t[c],{items:f=[],title:d}=l,h=f.filter(ie),p=n!==void 0?n:f.length<=1;return h.map(v=>{var{color:g=v$(u)||i.color,name:y}=v,m=rd(v,["color","name"]);const b=m0t(e,l),x=p?b||y:y||b;return Object.assign(Object.assign({},m),{color:g,name:x||d})})}).map(p$);return Object.assign(Object.assign({},a.length>0&&{title:a.join(",")}),{items:g$(s,l=>`(${o(l.name)}, ${o(l.value)}, ${o(l.color)})`)})}function b0t(t,e,n){var{plotWidth:r,plotHeight:i,mainWidth:o,mainHeight:a,startX:s,startY:l,transposed:c,polar:u,insetLeft:f,insetTop:d}=n,h=rd(n,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const p=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},h),v=e.map(E=>E[1]),g=e.map(E=>E[0]),y=_u(v),m=_u(g),b=()=>{if(u){const E=Math.min(o,a)/2,M=s+f+o/2,P=l+d+a/2,C=Lr(ke([m,y],[M,P])),A=M+E*Math.cos(C),T=P+E*Math.sin(C);return[M,A,P,T]}return c?[s,s+r,y+l,y+l]:[m+s,m+s,l,l+i]},[x,w,O,_]=b(),S=()=>{const E=new rf({style:Object.assign({x1:x,x2:w,y1:O,y2:_},p)});return t.appendChild(E),E};if(g.length>0){const E=t.ruleY||S();E.style.x1=x,E.style.x2=w,E.style.y1=O,E.style.y2=_,t.ruleY=E}}function m$(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function x0t(t,{data:e,style:n,theme:r}){t.markers&&t.markers.forEach(o=>o.remove());const i=e.filter(o=>{const[{x:a,y:s}]=o;return ie(a)&&ie(s)}).map(o=>{const[{color:a,element:s},l]=o,c=a||s.style.fill||s.style.stroke||r.color;return new nf({style:Object.assign({cx:l[0],cy:l[1],fill:c,r:4,stroke:"#fff",strokeWidth:2},n)})});for(const o of i)t.appendChild(o);t.markers=i}function b$(t){t.markers&&(t.markers.forEach(e=>e.remove()),t.markers=[])}function x$(t,e){return Array.from(t.values()).some(n=>{var r;return(r=n.interaction)===null||r===void 0?void 0:r[e]})}function Z2(t,e){return t===void 0?e:t}function w$(t){const{title:e,items:n}=t;return n.length===0&&e===void 0}function w0t(t){return Array.from(t.values()).some(e=>{var n;return((n=e.interaction)===null||n===void 0?void 0:n.seriesTooltip)&&e.tooltip})}function O$(t,e){var{elements:n,sort:r,filter:i,scale:o,coordinate:a,crosshairs:s,render:l,groupName:c,emitter:u,wait:f=50,leading:d=!0,trailing:h=!1,startX:p=0,startY:v=0,body:g=!0,single:y=!0,position:m,enterable:b,mount:x,bounding:w,theme:O,disableNative:_=!1,marker:S=!0,preserve:E=!1,style:M={},css:P={}}=e,C=rd(e,["elements","sort","filter","scale","coordinate","crosshairs","render","groupName","emitter","wait","leading","trailing","startX","startY","body","single","position","enterable","mount","bounding","theme","disableNative","marker","preserve","style","css"]);const A=n(t),T=he(a),k=ce(a),N=Z(M,C),{innerWidth:j,innerHeight:L,width:I,height:$,insetLeft:F,insetTop:R}=a.getOptions(),B=[],W=[];for(const $t of A){const{__data__:Wt}=$t,{seriesX:Ae,title:qt,items:Ke}=Wt;Ae?B.push($t):(qt||Ke)&&W.push($t)}const J=!!(T?o.y:o.x).getBandWidth&&W.length>0;B.sort(($t,Wt)=>{const Ae=T?0:1,qt=Ke=>Ke.getBounds().min[Ae];return T?qt(Wt)-qt($t):qt($t)-qt(Wt)});const X=$t=>{const Wt=T?1:0,{min:Ae,max:qt}=$t.getLocalBounds();return ro([Ae[Wt],qt[Wt]])};W.sort(($t,Wt)=>{const[Ae,qt]=X($t),[Ke,nn]=X(Wt),cr=(Ae+qt)/2,Ar=(Ke+nn)/2;return T?Ar-cr:cr-Ar});const V=new Map(B.map($t=>{const{__data__:Wt}=$t,{seriesX:Ae}=Wt,qt=Ae.map((nn,cr)=>cr),Ke=ro(qt,nn=>Ae[+nn]);return[$t,[Ke,Ae]]})),{x:it}=o,nt=it!=null&&it.getBandWidth?it.getBandWidth()/2:0,lt=$t=>{const[Wt]=a.invert($t);return Wt-nt},yt=($t,Wt,Ae)=>{const qt=lt($t),Ke=Ae.filter(ie),[nn,cr]=ro([Ke[0],Ke[Ke.length-1]]),Ar=nn===cr;if(!J&&(qt<nn||qt>cr)&&!Ar)return null;const Si=vl(MS=>Ae[+MS]).center,Wa=Si(Wt,qt);return Wt[Wa]},vt=($t,Wt)=>{const qt=$t[T?1:0],Ke=Wt.filter(Ar=>{const[Si,Wa]=X(Ar);return qt>=Si&&qt<=Wa});if(!J||Ke.length>0)return Ke;const nn=vl(Ar=>{const[Si,Wa]=X(Ar);return(Si+Wa)/2}).center,cr=nn(Wt,qt);return[Wt[cr]].filter(ie)},mt=($t,Wt)=>{const{__data__:Ae}=$t;return Object.fromEntries(Object.entries(Ae).filter(([qt])=>qt.startsWith("series")&&qt!=="series").map(([qt,Ke])=>{const nn=Ke[Wt];return[yE(qt.replace("series","")),nn]}))},Nt=Xa($t=>{const Wt=U2(t,$t);if(!Wt)return;const Ae=r$(t),qt=Ae.min[0],Ke=Ae.min[1],nn=[Wt[0]-p,Wt[1]-v];if(!nn)return;const cr=vt(nn,W),Ar=[],Si=[];for(const Ze of B){const[fh,AS]=V.get(Ze),J9=yt(nn,fh,AS);if(J9!==null){Ar.push(Ze);const tB=mt(Ze,J9),{x:PMt,y:AMt}=tB,CMt=a.map([(PMt||0)+nt,AMt||0]);Si.push([Object.assign(Object.assign({},tB),{element:Ze}),CMt])}}const Wa=Array.from(new Set(Si.map(Ze=>Ze[0].x))),MS=Wa[Ph(Wa,Ze=>Math.abs(Ze-lt(nn)))],PS=Si.filter(Ze=>Ze[0].x===MS),MMt=[...PS.map(Ze=>Ze[0]),...cr.map(Ze=>Ze.__data__)],Q9=[...Ar,...cr],uh=y$(Q9,o,c,MMt,O);if(r&&uh.items.sort((Ze,fh)=>r(Ze)-r(fh)),i&&(uh.items=uh.items.filter(i)),Q9.length===0||w$(uh)){Yt($t);return}if(g&&h$({root:t,data:uh,x:Wt[0]+qt,y:Wt[1]+Ke,render:l,event:$t,single:y,position:m,enterable:b,mount:x,bounding:w,css:P}),s){const Ze=PS.map(AS=>AS[1]),fh=ot(N,"crosshairs");b0t(t,Ze,Object.assign(Object.assign({},fh),{plotWidth:j,plotHeight:L,mainWidth:I,mainHeight:$,insetLeft:F,insetTop:R,startX:p,startY:v,transposed:T,polar:k}))}if(S){const Ze=ot(N,"marker");x0t(t,{data:PS,style:Ze,theme:O})}u.emit("tooltip:show",Object.assign(Object.assign({},$t),{nativeEvent:!0,data:{data:{x:ql(o.x,lt(nn),!0)}}}))},f,{leading:d,trailing:h}),Yt=$t=>{ma({root:t,single:y,emitter:u,event:$t}),s&&m$(t),S&&b$(t)},me=()=>{K2({root:t,single:y}),s&&m$(t),S&&b$(t)},We=({nativeEvent:$t,data:Wt})=>{if($t)return;const{x:Ae}=Wt.data,{x:qt}=o,Ke=qt.map(Ae),[nn,cr]=a.map([Ke,.5]),{min:[Ar,Si]}=t.getRenderBounds();Nt({offsetX:nn+Ar,offsetY:cr+Si})},lr=()=>{ma({root:t,single:y,emitter:u,nativeEvent:!1})},$o=()=>{ei(),me()},rl=()=>{Hn()},Hn=()=>{_||(t.addEventListener("pointerenter",Nt),t.addEventListener("pointermove",Nt),t.addEventListener("pointerleave",Yt))},ei=()=>{_||(t.removeEventListener("pointerenter",Nt),t.removeEventListener("pointermove",Nt),t.removeEventListener("pointerleave",Yt))};return Hn(),u.on("tooltip:show",We),u.on("tooltip:hide",lr),u.on("tooltip:disable",$o),u.on("tooltip:enable",rl),()=>{ei(),u.off("tooltip:show",We),u.off("tooltip:hide",lr),u.off("tooltip:disable",$o),u.off("tooltip:enable",rl),E?ma({root:t,single:y,emitter:u,nativeEvent:!1}):me()}}function O0t(t,{elements:e,scale:n,render:r,groupName:i,sort:o,filter:a,emitter:s,wait:l=50,leading:c=!0,trailing:u=!1,groupKey:f=E=>E,single:d=!0,position:h,enterable:p,datum:v,view:g,mount:y,bounding:m,theme:b,shared:x=!1,body:w=!0,disableNative:O=!1,preserve:_=!1,css:S={}}){const E=e(t),M=new Set(E),P=xe(E,f),C=Xa($=>{const{target:F}=$;if(!M.has(F)){ma({root:t,single:d,emitter:s,event:$});return}const R=f(F),B=P.get(R),W=B.length===1&&!x?y0t(B[0]):y$(B,n,i,void 0,b);if(o&&W.items.sort((X,V)=>o(X)-o(V)),a&&(W.items=W.items.filter(a)),w$(W)){ma({root:t,single:d,emitter:s,event:$});return}const{offsetX:K,offsetY:J}=$;w&&h$({root:t,data:W,x:K,y:J,render:r,event:$,single:d,position:h,enterable:p,mount:y,bounding:m,css:S}),s.emit("tooltip:show",Object.assign(Object.assign({},$),{nativeEvent:!0,data:{data:Cj(F,g)}}))},l,{leading:c,trailing:u}),A=$=>{ma({root:t,single:d,emitter:s,event:$})},T=()=>{O||(t.addEventListener("pointermove",C),t.addEventListener("pointerleave",A))},k=()=>{O||(t.removeEventListener("pointermove",C),t.removeEventListener("pointerleave",A))},N=({nativeEvent:$,data:F})=>{if($)return;const R=q2(E,F.data,v);if(!R)return;const B=R.getBBox(),{x:W,y:K,width:J,height:X}=B;C({target:R,offsetX:W+J/2,offsetY:K+X/2})},j=({nativeEvent:$}={})=>{$||ma({root:t,single:d,emitter:s,nativeEvent:!1})},L=()=>{k(),K2({root:t,single:d})},I=()=>{T()};return s.on("tooltip:show",N),s.on("tooltip:hide",j),s.on("tooltip:enable",I),s.on("tooltip:disable",L),T(),()=>{k(),s.off("tooltip:show",N),s.off("tooltip:hide",j),_?ma({root:t,single:d,emitter:s,nativeEvent:!1}):K2({root:t,single:d})}}function _$(t){const{shared:e,crosshairs:n,series:r,name:i,item:o=()=>({}),facet:a=!1}=t,s=rd(t,["shared","crosshairs","series","name","item","facet"]);return(l,c,u)=>{const{container:f,view:d}=l,{scale:h,markState:p,coordinate:v,theme:g}=d,y=x$(p,"seriesTooltip"),m=x$(p,"crosshairs"),b=wo(f),x=Z2(r,y);if(x&&w0t(p)&&!a)return O$(b,Object.assign(Object.assign({},s),{theme:g,elements:ga,scale:h,coordinate:v,crosshairs:Z2(n,m),item:o,emitter:u}));if(x&&a){const w=c.filter(P=>P!==l&&P.options.parentKey===l.options.key),O=n$(l,c),_=w[0].view.scale,S=b.getBounds(),E=S.min[0],M=S.min[1];return Object.assign(_,{facet:!0}),O$(b.parentNode.parentNode,Object.assign(Object.assign({},s),{theme:g,elements:()=>O,scale:_,coordinate:v,crosshairs:Z2(n,m),item:o,startX:E,startY:M,emitter:u}))}return O0t(b,Object.assign(Object.assign({},s),{datum:ks(d),elements:ga,scale:h,coordinate:v,groupKey:e?X2():void 0,item:o,emitter:u,view:d,theme:g,shared:e}))}}_$.props={reapplyWhenUpdate:!0};var Iv=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?o(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})};const S$="legend-category",_0t="legend-continuous",S0t="items-item",E0t="legend-category-item-marker",M0t="legend-category-item-label";function E$(t){return t.getElementsByClassName(E0t)[0]}function M$(t){return t.getElementsByClassName(M0t)[0]}function P$(t){return t.getElementsByClassName(S0t)}function Q2(t){return t.getElementsByClassName(S$)}function A$(t){return t.getElementsByClassName(_0t)}function P0t(t,e){[...Q2(t),...A$(t)].forEach(r=>{e(r,i=>i)})}function J2(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function A0t(t,{legends:e,marker:n,label:r,datum:i,filter:o,emitter:a,channel:s,state:l={}}){const c=new Map,u=new Map,f=new Map,{unselected:d={markerStroke:"#aaa",markerFill:"#aaa",labelFill:"#aaa"}}=l,h={unselected:ot(d,"marker")},p={unselected:ot(d,"label")},{setState:v,removeState:g}=Oo(h,void 0),{setState:y,removeState:m}=Oo(p,void 0),b=Array.from(e(t));let x=b.map(i);const w=()=>{for(const S of b){const E=i(S),M=n(S),P=r(S);x.includes(E)?(g(M,"unselected"),m(P,"unselected")):(v(M,"unselected"),y(P,"unselected"))}};for(const S of b){const E=()=>{ya(t,"pointer")},M=()=>{r0t(t)},P=C=>Iv(this,void 0,void 0,function*(){const A=i(S),T=x.indexOf(A);T===-1?x.push(A):x.splice(T,1),x.length===0&&x.push(...b.map(i)),yield o(x),w();const{nativeEvent:k=!0}=C;k&&(x.length===b.length?a.emit("legend:reset",{nativeEvent:k}):a.emit("legend:filter",Object.assign(Object.assign({},C),{nativeEvent:k,data:{channel:s,values:x}})))});S.addEventListener("click",P),S.addEventListener("pointerenter",E),S.addEventListener("pointerout",M),c.set(S,P),u.set(S,E),f.set(S,M)}const O=S=>Iv(this,void 0,void 0,function*(){const{nativeEvent:E}=S;if(E)return;const{data:M}=S,{channel:P,values:C}=M;P===s&&(x=C,yield o(x),w())}),_=S=>Iv(this,void 0,void 0,function*(){const{nativeEvent:E}=S;E||(x=b.map(i),yield o(x),w())});return a.on("legend:filter",O),a.on("legend:reset",_),()=>{for(const S of b)S.removeEventListener("click",c.get(S)),S.removeEventListener("pointerenter",u.get(S)),S.removeEventListener("pointerout",f.get(S)),a.off("legend:filter",O),a.off("legend:reset",_)}}function C0t(t,{legend:e,filter:n,emitter:r,channel:i}){const o=({detail:{value:a}})=>{n(a),r.emit({nativeEvent:!0,data:{channel:i,values:a}})};return e.addEventListener("valuechange",o),()=>{e.removeEventListener("valuechange",o)}}function C$(t,{legend:e,channel:n,value:r,ordinal:i,channels:o,allChannels:a,facet:s=!1}){return Iv(this,void 0,void 0,function*(){const{view:l,update:c,setState:u}=t;u(e,f=>{const{marks:d}=f,h=d.map(p=>{if(p.type==="legends")return p;const{transform:v=[]}=p,g=v.findIndex(({type:b})=>b.startsWith("group")||b.startsWith("bin")),y=[...v];y.splice(g+1,0,{type:"filter",[n]:{value:r,ordinal:i}});const m=Object.fromEntries(o.map(b=>[b,{domain:l.scale[b].getOptions().domain}]));return Z({},p,Object.assign(Object.assign({transform:y,scale:m},!i&&{animate:!1}),{legend:s?!1:Object.fromEntries(a.map(b=>[b,{preserve:!0}]))}))});return Object.assign(Object.assign({},f),{marks:h})}),yield c()})}function T0t(t,e){for(const n of t)C$(n,Object.assign(Object.assign({},e),{facet:!0}))}function k0t(){return(t,e,n)=>{const{container:r}=t,i=e.filter(f=>f!==t),o=i.length>0,a=f=>J2(f).scales.map(d=>d.name),s=[...Q2(r),...A$(r)],l=s.flatMap(a),c=o?Xa(T0t,50,{trailing:!0}):Xa(C$,50,{trailing:!0}),u=s.map(f=>{const{name:d,domain:h}=J2(f).scales[0],p=a(f),v={legend:f,channel:d,channels:p,allChannels:l};return f.className===S$?A0t(r,{legends:P$,marker:E$,label:M$,datum:g=>{const{__data__:y}=g,{index:m}=y;return h[m]},filter:g=>{const y=Object.assign(Object.assign({},v),{value:g,ordinal:!0});c(o?i:t,y)},state:f.attributes.state,channel:d,emitter:n}):C0t(r,{legend:f,filter:g=>{const y=Object.assign(Object.assign({},v),{value:g,ordinal:!1});c(o?i:t,y)},emitter:n,channel:d})});return()=>{u.forEach(f=>f())}}}function L0t(){return(t,e,n)=>{const{container:r,view:i,options:o}=t,a=Q2(r),s=ga(r),l=h=>J2(h).scales[0].name,c=h=>{const{scale:{[h]:p}}=i;return p},u=yc(o,["active","inactive"]),f=nd(s,ks(i)),d=[];for(const h of a){const p=$=>{const{data:F}=h.attributes,{__data__:R}=$,{index:B}=R;return F[B].label},v=l(h),g=P$(h),y=c(v),m=xe(s,$=>y.invert($.__data__[v])),{state:b={}}=h.attributes,{inactive:x={}}=b,{setState:w,removeState:O}=Oo(u,f),_={inactive:ot(x,"marker")},S={inactive:ot(x,"label")},{setState:E,removeState:M}=Oo(_),{setState:P,removeState:C}=Oo(S),A=$=>{for(const F of g){const R=E$(F),B=M$(F);F===$||$===null?(M(R,"inactive"),C(B,"inactive")):(E(R,"inactive"),P(B,"inactive"))}},T=($,F)=>{const R=p(F),B=new Set(m.get(R));for(const K of s)B.has(K)?w(K,"active"):w(K,"inactive");A(F);const{nativeEvent:W=!0}=$;W&&n.emit("legend:highlight",Object.assign(Object.assign({},$),{nativeEvent:W,data:{channel:v,value:R}}))},k=new Map;for(const $ of g){const F=R=>{T(R,$)};$.addEventListener("pointerover",F),k.set($,F)}const N=$=>{for(const R of s)O(R,"inactive","active");A(null);const{nativeEvent:F=!0}=$;F&&n.emit("legend:unhighlight",{nativeEvent:F})},j=$=>{const{nativeEvent:F,data:R}=$;if(F)return;const{channel:B,value:W}=R;if(B!==v)return;const K=g.find(J=>p(J)===W);K&&T({nativeEvent:!1},K)},L=$=>{const{nativeEvent:F}=$;F||N({nativeEvent:!1})};h.addEventListener("pointerleave",N),n.on("legend:highlight",j),n.on("legend:unhighlight",L);const I=()=>{h.removeEventListener(N),n.off("legend:highlight",j),n.off("legend:unhighlight",L);for(const[$,F]of k)$.removeEventListener(F)};d.push(I)}return()=>d.forEach(h=>h())}}var wr=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function N0t(t,e){const[n,r,i,o]=t,[a,s,l,c]=e;return!(a>i||l<n||s>o||c<r)}function I0t(t,e,n,r,i){const[o,a,s,l]=i;return[Math.max(o,Math.min(t,n)),Math.max(a,Math.min(e,r)),Math.min(s,Math.max(t,n)),Math.min(l,Math.max(e,r))]}function j0t(t){const{width:e,height:n}=t.getBBox();return[0,0,e,n]}function _o(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}const T$=Dl(t=>{const e=t.attributes,{x:n,y:r,width:i,height:o,class:a,renders:s={},handleSize:l=10,document:c}=e,u=wr(e,["x","y","width","height","class","renders","handleSize","document"]);if(!c||i===void 0||o===void 0||n===void 0||r===void 0)return;const f=l/2,d=(W,K,J)=>{W.handle||(W.handle=J.createElement("rect"),W.append(W.handle));const{handle:X}=W;return X.attr(K),X},h=ot(pm(u,"handleNW","handleNE"),"handleN"),{render:p=d}=h,v=wr(h,["render"]),g=ot(u,"handleE"),{render:y=d}=g,m=wr(g,["render"]),b=ot(pm(u,"handleSE","handleSW"),"handleS"),{render:x=d}=b,w=wr(b,["render"]),O=ot(u,"handleW"),{render:_=d}=O,S=wr(O,["render"]),E=ot(u,"handleNW"),{render:M=d}=E,P=wr(E,["render"]),C=ot(u,"handleNE"),{render:A=d}=C,T=wr(C,["render"]),k=ot(u,"handleSE"),{render:N=d}=k,j=wr(k,["render"]),L=ot(u,"handleSW"),{render:I=d}=L,$=wr(L,["render"]),F=(W,K)=>{const{id:J}=W,X=W.attributes,V=wr(X,["x","y"]),it=K(W,Object.assign({x:0,y:0},V),c);it.id=J,it.style.draggable=!0},R=W=>()=>{const K=Dl(J=>F(J,W));return new K({})},B=gt(t).attr("className",a).style("x",n).style("y",r).style("draggable",!0);B.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(_o,Object.assign({width:i,height:o},pm(u,"handle"))),B.maybeAppend("handle-n",R(p)).style("x",f).style("y",-f).style("width",i-l).style("height",l).style("fill","transparent").call(_o,v),B.maybeAppend("handle-e",R(y)).style("x",i-f).style("y",f).style("width",l).style("height",o-l).style("fill","transparent").call(_o,m),B.maybeAppend("handle-s",R(x)).style("x",f).style("y",o-f).style("width",i-l).style("height",l).style("fill","transparent").call(_o,w),B.maybeAppend("handle-w",R(_)).style("x",-f).style("y",f).style("width",l).style("height",o-l).style("fill","transparent").call(_o,S),B.maybeAppend("handle-nw",R(M)).style("x",-f).style("y",-f).style("width",l).style("height",l).style("fill","transparent").call(_o,P),B.maybeAppend("handle-ne",R(A)).style("x",i-f).style("y",-f).style("width",l).style("height",l).style("fill","transparent").call(_o,T),B.maybeAppend("handle-se",R(N)).style("x",i-f).style("y",o-f).style("width",l).style("height",l).style("fill","transparent").call(_o,j),B.maybeAppend("handle-sw",R(I)).style("x",-f).style("y",o-f).style("width",l).style("height",l).style("fill","transparent").call(_o,$)});function tw(t,e){var{brushed:n=()=>{},brushended:r=()=>{},brushcreated:i=()=>{},brushstarted:o=()=>{},brushupdated:a=()=>{},extent:s=j0t(t),brushRegion:l=(X,V,it,nt,lt)=>[X,V,it,nt],reverse:c=!1,fill:u="#777",fillOpacity:f="0.3",stroke:d="#fff",selectedHandles:h=["handle-n","handle-e","handle-s","handle-w","handle-nw","handle-ne","handle-se","handle-sw"]}=e,p=wr(e,["brushed","brushended","brushcreated","brushstarted","brushupdated","extent","brushRegion","reverse","fill","fillOpacity","stroke","selectedHandles"]);let v=null,g=null,y=null,m=null,b=null,x=!1;const[w,O,_,S]=s;ya(t,"crosshair"),t.style.draggable=!0;const E=(X,V,it)=>{if(o(it),m&&m.remove(),b&&b.remove(),v=[X,V],c)return M();P()},M=()=>{b=new Dn({style:Object.assign(Object.assign({},p),{fill:u,fillOpacity:f,stroke:d,pointerEvents:"none"})}),m=new T$({style:{x:0,y:0,width:0,height:0,draggable:!0,document:t.ownerDocument},className:"mask"}),t.appendChild(b),t.appendChild(m)},P=()=>{m=new T$({style:Object.assign(Object.assign({document:t.ownerDocument,x:0,y:0},p),{fill:u,fillOpacity:f,stroke:d,draggable:!0}),className:"mask"}),t.appendChild(m)},C=(X=!0)=>{m&&m.remove(),b&&b.remove(),v=null,g=null,y=null,x=!1,m=null,b=null,r(X)},A=(X,V,it=!0)=>{const[nt,lt,yt,vt]=I0t(X[0],X[1],V[0],V[1],s),[mt,Nt,Yt,me]=l(nt,lt,yt,vt,s);return c?k(mt,Nt,Yt,me):T(mt,Nt,Yt,me),n(mt,Nt,Yt,me,it),[mt,Nt,Yt,me]},T=(X,V,it,nt)=>{m.style.x=X,m.style.y=V,m.style.width=it-X,m.style.height=nt-V},k=(X,V,it,nt)=>{b.style.d=`
81
81
  M${w},${O}L${_},${O}L${_},${S}L${w},${S}Z
82
82
  M${X},${V}L${X},${nt}L${it},${nt}L${it},${V}Z
83
- `,m.style.x=X,m.style.y=V,m.style.width=it-X,m.style.height=nt-V},N=X=>{const V=(Nt,Yt,me,We,lr)=>Nt+Yt<We?We-Yt:Nt+me>lr?lr-me:Nt,it=X[0]-y[0],nt=X[1]-y[1],lt=V(it,v[0],g[0],w,_),yt=V(nt,v[1],g[1],O,S),pt=[v[0]+lt,v[1]+yt],mt=[g[0]+lt,g[1]+yt];A(pt,mt)},j={"handle-n":{vector:[0,1,0,0],cursor:"ns-resize"},"handle-e":{vector:[0,0,1,0],cursor:"ew-resize"},"handle-s":{vector:[0,0,0,1],cursor:"ns-resize"},"handle-w":{vector:[1,0,0,0],cursor:"ew-resize"},"handle-nw":{vector:[1,1,0,0],cursor:"nwse-resize"},"handle-ne":{vector:[0,1,1,0],cursor:"nesw-resize"},"handle-se":{vector:[0,0,1,1],cursor:"nwse-resize"},"handle-sw":{vector:[1,0,0,1],cursor:"nesw-resize"}},L=X=>$(X)||I(X),I=X=>{const{id:V}=X;return h.indexOf(V)===-1?!1:new Set(Object.keys(j)).has(V)},$=X=>X===m.getElementById("selection"),F=X=>{const{target:V}=X,[it,nt]=V2(t,X);if(!m||!L(V)){E(it,nt,X),x=!0;return}L(V)&&(y=[it,nt])},R=X=>{const{target:V}=X,it=V2(t,X);if(!v)return;if(!y)return A(v,it);if($(V))return N(it);const[nt,lt]=[it[0]-y[0],it[1]-y[1]],{id:yt}=V;if(j[yt]){const[pt,mt,Nt,Yt]=j[yt].vector;return A([v[0]+nt*pt,v[1]+lt*mt],[g[0]+nt*Nt,g[1]+lt*Yt])}},B=X=>{if(y){y=null;const{x:yt,y:pt,width:mt,height:Nt}=m.style;v=[yt,pt],g=[yt+mt,pt+Nt],a(yt,pt,yt+mt,pt+Nt,X);return}g=V2(t,X);const[V,it,nt,lt]=A(v,g);x=!1,i(V,it,nt,lt,X)},W=X=>{const{target:V}=X;m&&!L(V)&&C()},K=X=>{const{target:V}=X;!m||!L(V)||x?ya(t,"crosshair"):$(V)?ya(t,"move"):I(V)&&ya(t,j[V.id].cursor)},J=()=>{ya(t,"default")};return t.addEventListener("dragstart",F),t.addEventListener("drag",R),t.addEventListener("dragend",B),t.addEventListener("click",W),t.addEventListener("pointermove",K),t.addEventListener("pointerleave",J),{mask:m,move(X,V,it,nt,lt=!0){m||E(X,V,{}),v=[X,V],g=[it,nt],A([X,V],[it,nt],lt)},remove(X=!0){m&&C(X)},destroy(){m&&C(!1),ya(t,"default"),t.removeEventListener("dragstart",F),t.removeEventListener("drag",R),t.removeEventListener("dragend",B),t.removeEventListener("click",W),t.removeEventListener("pointermove",K),t.removeEventListener("pointerleave",J)}}}function ew(t,e,n){return e.filter(r=>{if(r===t)return!1;const{interaction:i={}}=r.options;return Object.values(i).find(o=>o.brushKey===n)})}function D0t(t,e,n){return ew(t,e,n).map(r=>wo(r.container))}function $0t(t,e,n){return ew(t,e,n).map(r=>r.options)}function k$(t,e){var{elements:n,selectedHandles:r,siblings:i=R=>[],datum:o,brushRegion:a,extent:s,reverse:l,scale:c,coordinate:u,series:f=!1,key:d=R=>R,bboxOf:h=R=>{const{x:B,y:W,width:K,height:J}=R.style;return{x:B,y:W,width:K,height:J}},state:p={},emitter:v}=e,g=wr(e,["elements","selectedHandles","siblings","datum","brushRegion","extent","reverse","scale","coordinate","series","key","bboxOf","state","emitter"]);const y=n(t),m=i(t),b=m.flatMap(n),x=nd(y,o),w=ot(g,"mask"),{setState:O,removeState:_}=Oo(p,x),S=new Map,{width:E,height:M,x:P=0,y:C=0}=h(t),A=s||[0,0,E,M],T=()=>{for(const R of[...y,...b])_(R,"active","inactive")},k=(R,B,W,K)=>{var J;for(const V of m)(J=V.brush)===null||J===void 0||J.remove();const X=new Set;for(const V of y){const{min:it,max:nt}=V.getLocalBounds(),[lt,yt]=it,[pt,mt]=nt;N0t([lt,yt,pt,mt],[R,B,W,K])?(O(V,"active"),X.add(d(V))):O(V,"inactive")}for(const V of b)X.has(d(V))?O(V,"active"):O(V,"inactive")},N=()=>{for(const R of y)_(R,"inactive");for(const R of S.values())R.remove();S.clear()},j=(R,B,W,K)=>{const J=X=>{const V=X.cloneNode();return V.__data__=X.__data__,X.parentNode.appendChild(V),S.set(X,V),V};for(const X of y){const V=S.get(X)||J(X);V.style.clipPath=new hs({style:{x:R+P,y:B+C,width:W-R,height:K-B}}),O(X,"inactive"),O(V,"active")}},L=tw(t,Object.assign(Object.assign({},w),{extent:A,brushRegion:a,reverse:l,selectedHandles:r,brushended:R=>{const B=f?N:T;R&&v.emit("brush:remove",{nativeEvent:!0}),B()},brushed:(R,B,W,K,J)=>{const X=N0(R,B,W,K,c,u);J&&v.emit("brush:highlight",{nativeEvent:!0,data:{selection:X}}),(f?j:k)(R,B,W,K)},brushcreated:(R,B,W,K,J)=>{const X=N0(R,B,W,K,c,u);v.emit("brush:end",Object.assign(Object.assign({},J),{nativeEvent:!0,data:{selection:X}}))},brushupdated:(R,B,W,K,J)=>{const X=N0(R,B,W,K,c,u);v.emit("brush:end",Object.assign(Object.assign({},J),{nativeEvent:!0,data:{selection:X}}))},brushstarted:R=>{v.emit("brush:start",R)}})),I=({nativeEvent:R,data:B})=>{if(R)return;const{selection:W}=B,[K,J,X,V]=tst(W,c,u);L.move(K,J,X,V,!1)};v.on("brush:highlight",I);const $=({nativeEvent:R}={})=>{R||L.remove(!1)};v.on("brush:remove",$);const F=L.destroy.bind(L);return L.destroy=()=>{v.off("brush:highlight",I),v.off("brush:remove",$),F()},L}function nw(t){var{facet:e,brushKey:n}=t,r=wr(t,["facet","brushKey"]);return(i,o,a)=>{const{container:s,view:l,options:c}=i,u=wo(s),f={maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",reverse:!1},d=["active",["inactive",{opacity:.5}]],{scale:h,coordinate:p}=l;if(e){const g=u.getBounds(),y=g.min[0],m=g.min[1],b=g.max[0],x=g.max[1];return k$(u.parentNode.parentNode,Object.assign(Object.assign({elements:()=>n$(i,o),datum:ks(H2(i,o).map(w=>w.view)),brushRegion:(w,O,_,S)=>[w,O,_,S],extent:[y,m,b,x],state:yc(H2(i,o).map(w=>w.options),d),emitter:a,scale:h,coordinate:p,selectedHandles:void 0},f),r))}const v=k$(u,Object.assign(Object.assign({elements:ga,key:g=>g.__data__.key,siblings:()=>D0t(i,o,n),datum:ks([l,...ew(i,o,n).map(g=>g.view)]),brushRegion:(g,y,m,b)=>[g,y,m,b],extent:void 0,state:yc([c,...$0t(i,o,n)],d),emitter:a,scale:h,coordinate:p,selectedHandles:void 0},f),r));return u.brush=v,()=>v.destroy()}}function rw(t,e,n,r,i){const[,o,,a]=i;return[t,o,n,a]}function F0t(t){return nw(Object.assign(Object.assign({},t),{brushRegion:rw,selectedHandles:["handle-e","handle-w"]}))}function iw(t,e,n,r,i){const[o,,a]=i;return[o,e,a,r]}function R0t(t){return nw(Object.assign(Object.assign({},t),{brushRegion:iw,selectedHandles:["handle-n","handle-s"]}))}var ow=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const B0t="axis",z0t="axis-line",Y0t="axis-main-group",L$="axis-hot-area";function W0t(t){return t.getElementsByClassName(B0t)}function N$(t){return t.getElementsByClassName(z0t)[0]}function G0t(t){return t.getElementsByClassName(Y0t)[0]}function I$(t){return G0t(t).getLocalBounds()}function H0t(t,e){var{cross:n,offsetX:r,offsetY:i}=e,o=ow(e,["cross","offsetX","offsetY"]);const a=I$(t),s=N$(t),[l]=s.getLocalBounds().min,[c,u]=a.min,[f,d]=a.max,h=(f-c)*2;return{brushRegion:iw,hotZone:new hs({className:L$,style:Object.assign({x:n?c:l-h/2,width:n?h/2:h,y:u,height:d-u},o)}),extent:n?(p,v,g,y)=>[-1/0,v,1/0,y]:(p,v,g,y)=>[Math.floor(c-r),v,Math.ceil(f-r),y]}}function U0t(t,e){var{offsetY:n,offsetX:r,cross:i=!1}=e,o=ow(e,["offsetY","offsetX","cross"]);const a=I$(t),s=N$(t),[,l]=s.getLocalBounds().min,[c,u]=a.min,[f,d]=a.max,h=d-u;return{brushRegion:rw,hotZone:new hs({className:L$,style:Object.assign({x:c,width:f-c,y:i?u:l-h,height:i?h:h*2},o)}),extent:i?(p,v,g,y)=>[p,-1/0,g,1/0]:(p,v,g,y)=>[p,Math.floor(u-n),g,Math.ceil(d-n)]}}function V0t(t,e){var{axes:n,elements:r,points:i,horizontal:o,datum:a,offsetY:s,offsetX:l,reverse:c=!1,state:u={},emitter:f,coordinate:d}=e,h=ow(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse","state","emitter","coordinate"]);const p=r(t),v=n(t),g=nd(p,a),{setState:y,removeState:m}=Oo(u,g),b=new Map,x=ot(h,"mask"),w=I=>Array.from(b.values()).every(([$,F,R,B])=>I.some(([W,K])=>W>=$&&W<=R&&K>=F&&K<=B)),O=v.map(I=>I.attributes.scale),_=I=>I.length>2?[I[0],I[I.length-1]]:I,S=new Map,E=()=>{S.clear();for(let I=0;I<v.length;I++){const $=O[I],{domain:F}=$.getOptions();S.set(I,_(F))}};E();const M=(I,$)=>{const F=[];for(const B of p){const W=i(B);w(W)?(y(B,"active"),F.push(B)):y(B,"inactive")}if(S.set(I,C(F,I)),!$)return;const R=()=>{if(!A)return Array.from(S.values());const B=[];for(const[W,K]of S){const J=O[W],{name:X}=J.getOptions();X==="x"?B[0]=K:B[1]=K}return B};f.emit("brushAxis:highlight",{nativeEvent:!0,data:{selection:R()}})},P=I=>{for(const $ of p)m($,"active","inactive");E(),I&&f.emit("brushAxis:remove",{nativeEvent:!0})},C=(I,$)=>{const F=O[$],{name:R}=F.getOptions(),B=I.map(W=>{const K=W.__data__;return F.invert(K[R])});return _(ua(F,B))},A=v.some(o)&&v.some(I=>!o(I)),T=[];for(let I=0;I<v.length;I++){const $=v[I],F=o($)?U0t:H0t,{hotZone:R,brushRegion:B,extent:W}=F($,{offsetY:s,offsetX:l,cross:A,zIndex:999,fill:"transparent"});$.parentNode.appendChild(R);const K=tw(R,Object.assign(Object.assign({},x),{reverse:c,brushRegion:B,brushended(J){b.delete($),Array.from(b.entries()).length===0?P(J):M(I,J)},brushed(J,X,V,it,nt){b.set($,W(J,X,V,it)),M(I,nt)}}));T.push(K)}const k=(I={})=>{const{nativeEvent:$}=I;$||T.forEach(F=>F.remove(!1))},N=(I,$,F)=>{const[R,B]=I,W=X=>X.getStep?X.getStep():0,K=j(R,$,F),J=j(B,$,F)+W($);return o(F)?[K,-1/0,J,1/0]:[-1/0,K,1/0,J]},j=(I,$,F)=>{const{height:R,width:B}=d.getOptions(),W=$.clone();return o(F)?W.update({range:[0,B]}):W.update({range:[R,0]}),W.map(I)},L=I=>{const{nativeEvent:$}=I;if($)return;const{selection:F}=I.data;for(let R=0;R<T.length;R++){const B=F[R],W=T[R],K=v[R];if(B){const J=O[R];W.move(...N(B,J,K),!1)}else W.remove(!1)}};return f.on("brushAxis:remove",k),f.on("brushAxis:highlight",L),()=>{T.forEach(I=>I.destroy()),f.off("brushAxis:remove",k),f.off("brushAxis:highlight",L)}}function X0t(t){return(e,n,r)=>{const{container:i,view:o,options:a}=e,s=wo(i),{x:l,y:c}=s.getBBox(),{coordinate:u}=o;return V0t(i,Object.assign({elements:ga,axes:W0t,offsetY:c,offsetX:l,points:f=>f.__data__.points,horizontal:f=>{const{startPos:[d,h],endPos:[p,v]}=f.attributes;return d!==p&&h===v},datum:ks(o),state:yc(a,["active",["inactive",{opacity:.5}]]),coordinate:u,emitter:r},t))}}var q0t=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?o(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})},j$=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function K0t(t=300){let e=null;return n=>{const{timeStamp:r}=n;return e!==null&&r-e<t?(e=r,!0):(e=r,!1)}}function Z0t(t,e){var{filter:n,reset:r,brushRegion:i,extent:o,reverse:a,emitter:s,scale:l,coordinate:c,selection:u,series:f=!1}=e,d=j$(e,["filter","reset","brushRegion","extent","reverse","emitter","scale","coordinate","selection","series"]);const h=ot(d,"mask"),{width:p,height:v}=t.getBBox(),g=o||[0,0,p,v],y=K0t(),m=tw(t,Object.assign(Object.assign({},h),{extent:g,brushRegion:i,reverse:a,brushcreated:b}));t.addEventListener("click",x);function b(O,_,S,E,M){M.nativeEvent=!0,n(u(O,_,S,E),M),m.remove()}function x(O){y(O)&&(O.nativeEvent=!0,r(O))}const w=({nativeEvent:O,data:_})=>{if(O)return;const{selection:S}=_;n(S,{nativeEvent:!1})};return s.on("brush:filter",w),()=>{m.destroy(),s.off("brush:filter",w),t.removeEventListener("click",x)}}function aw(t){var{hideX:e=!0,hideY:n=!0}=t,r=j$(t,["hideX","hideY"]);return(i,o,a)=>{const{container:s,view:l,options:c,update:u,setState:f}=i,d=wo(s),h={maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1};let p=!1,v=!1,g=l;const{scale:y,coordinate:m}=l;return Z0t(d,Object.assign(Object.assign({brushRegion:(b,x,w,O)=>[b,x,w,O],selection:(b,x,w,O)=>{const{scale:_,coordinate:S}=g;return N0(b,x,w,O,_,S)},filter:(b,x)=>q0t(this,void 0,void 0,function*(){if(v)return;v=!0;const[w,O]=b;f("brushFilter",S=>{const{marks:E}=S,M=E.map(P=>Z({axis:Object.assign(Object.assign({},e&&{x:{transform:[{type:"hide"}]}}),n&&{y:{transform:[{type:"hide"}]}})},P,{scale:{x:{domain:w,nice:!1},y:{domain:O,nice:!1}}}));return Object.assign(Object.assign({},c),{marks:M,clip:!0})}),a.emit("brush:filter",Object.assign(Object.assign({},x),{data:{selection:[w,O]}})),g=(yield u()).view,v=!1,p=!0}),reset:b=>{if(v||!p)return;const{scale:x}=l,{x:w,y:O}=x,_=w.getOptions().domain,S=O.getOptions().domain;a.emit("brush:filter",Object.assign(Object.assign({},b),{data:{selection:[_,S]}})),p=!1,g=l,f("brushFilter"),u()},extent:void 0,emitter:a,scale:y,coordinate:m},h),r))}}function Q0t(t){return aw(Object.assign(Object.assign({hideX:!0},t),{brushRegion:rw}))}function J0t(t){return aw(Object.assign(Object.assign({hideY:!0},t),{brushRegion:iw}))}var tvt=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?o(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})};const evt="slider";function nvt(t,e,n,r=!1,i="x",o="y"){const{marks:a}=t,s=a.map(l=>{var c,u;return Z({axis:{x:{transform:[{type:"hide"}]},y:{transform:[{type:"hide"}]}}},l,{scale:e,[n]:Object.assign(Object.assign({},((c=l[n])===null||c===void 0?void 0:c[i])&&{[i]:Object.assign({preserve:!0},r&&{ratio:null})}),((u=l[n])===null||u===void 0?void 0:u[o])&&{[o]:{preserve:!0}}),animate:!1})});return Object.assign(Object.assign({},t),{marks:s,clip:!0,animate:!1})}function rvt(t,e,n){const[r,i]=t,o=n?l=>1-l:l=>l,a=ql(e,o(r),!0),s=ql(e,o(i),!1);return ua(e,[a,s])}function jv(t){return[t[0],t[t.length-1]]}function D$({initDomain:t={},className:e=evt,prefix:n="slider",setValue:r=(c,u)=>c.setValues(u),hasState:i=!1,wait:o=50,leading:a=!0,trailing:s=!1,getInitValues:l=c=>{var u;const f=(u=c==null?void 0:c.attributes)===null||u===void 0?void 0:u.values;if(f[0]!==0||f[1]!==1)return f}}){return(c,u,f)=>{const{container:d,view:h,update:p,setState:v}=c,g=d.getElementsByClassName(e);if(!g.length)return()=>{};let y=!1;const{scale:m,coordinate:b,layout:x}=h,{paddingLeft:w,paddingTop:O,paddingBottom:_,paddingRight:S}=x,{x:E,y:M}=m,P=he(b),C=N=>{const j=N==="vertical"?"y":"x",L=N==="vertical"?"x":"y";return P?[L,j]:[j,L]},A=new Map,T=new Set,k={x:t.x||E.getOptions().domain,y:t.y||M.getOptions().domain};for(const N of g){const{orientation:j}=N.attributes,[L,I]=C(j),$=`${n}${zo(L)}:filter`,F=L==="x",{ratio:R}=E.getOptions(),{ratio:B}=M.getOptions(),W=V=>{if(V.data){const{selection:pt}=V.data,[mt=jv(k.x),Nt=jv(k.y)]=pt;return F?[ua(E,mt,R),ua(M,Nt,B)]:[ua(M,Nt,B),ua(E,mt,R)]}const{value:it}=V.detail,nt=m[L],lt=rvt(it,nt,P&&j==="horizontal"),yt=k[I];return[lt,yt]},K=Xa(V=>tvt(this,void 0,void 0,function*(){const{initValue:it=!1}=V;if(y&&!it)return;y=!0;const{nativeEvent:nt=!0}=V,[lt,yt]=W(V);if(k[L]=lt,k[I]=yt,nt){const pt=F?lt:yt,mt=F?yt:lt;f.emit($,Object.assign(Object.assign({},V),{nativeEvent:nt,data:{selection:[jv(pt),jv(mt)]}}))}v(N,pt=>Object.assign(Object.assign({},nvt(pt,{[L]:{domain:lt,nice:!1}},n,i,L,I)),{paddingLeft:w,paddingTop:O,paddingBottom:_,paddingRight:S})),yield p(),y=!1}),o,{leading:a,trailing:s}),J=V=>{const{nativeEvent:it}=V;if(it)return;const{data:nt}=V,{selection:lt}=nt,[yt,pt]=lt;N.dispatchEvent(new ee("valuechange",{data:nt,nativeEvent:!1}));const mt=F?I0(yt,E):I0(pt,M);r(N,mt)};f.on($,J),N.addEventListener("valuechange",K),A.set(N,K),T.add([$,J]);const X=l(N);X&&N.dispatchEvent(new ee("valuechange",{detail:{value:X},nativeEvent:!1,initValue:!0}))}return p(),()=>{for(const[N,j]of A)N.removeEventListener("valuechange",j);for(const[N,j]of T)f.off(N,j)}}}const $$="g2-scrollbar";function ivt(t={}){return(e,n,r)=>{const{view:i,container:o}=e;if(!o.getElementsByClassName($$).length)return()=>{};const{scale:s}=i,{x:l,y:c}=s,u={x:[...l.getOptions().domain],y:[...c.getOptions().domain]};return l.update({domain:l.getOptions().expectedDomain}),c.update({domain:c.getOptions().expectedDomain}),D$(Object.assign(Object.assign({},t),{initDomain:u,className:$$,prefix:"scrollbar",hasState:!0,setValue:(d,h)=>d.setValue(h[0]),getInitValues:d=>{const h=d.slider.attributes.values;if(h[0]!==0)return h}}))(e,n,r)}}var ovt=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function avt(t,e,n){return`<${t} style="${Object.entries(n).map(([r,i])=>`${Oet(r)}:${i}`).join(";")}">${e}</${t}>`}const svt={backgroundColor:"rgba(0,0,0,0.75)",color:"#fff",width:"max-content",padding:"1px 4px",fontSize:"12px",borderRadius:"2.5px",boxShadow:"0 3px 6px -4px rgba(0,0,0,0.12), 0 6px 16px 0 rgba(0,0,0,0.08), 0 9px 28px 8px rgba(0,0,0,0.05)"};function F$(t){return t.nodeName!=="text"?!1:!!t.isOverflowing()}function R$(t){var{offsetX:e=8,offsetY:n=8}=t,r=ovt(t,["offsetX","offsetY"]);return i=>{const{container:o}=i,[a,s]=o.getBounds().min,l=ot(r,"tip"),c=new Set,u=d=>{const{target:h}=d;if(!F$(h)){d.stopPropagation();return}const{offsetX:p,offsetY:v}=d,g=p+e-a,y=v+n-s;if(h.tip){h.tip.style.x=g,h.tip.style.y=y;return}const{text:m}=h.style,b=new Op({className:"poptip",style:{innerHTML:avt("div",m,Object.assign(Object.assign({},svt),l)),x:g,y}});o.appendChild(b),h.tip=b,c.add(b)},f=d=>{const{target:h}=d;if(!F$(h)){d.stopPropagation();return}h.tip&&(h.tip.remove(),h.tip=null,c.delete(h.tip))};return o.addEventListener("pointerover",u),o.addEventListener("pointerout",f),()=>{o.removeEventListener("pointerover",u),o.removeEventListener("pointerout",f),c.forEach(d=>d.remove())}}}R$.props={reapplyWhenUpdate:!0};var lvt=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?o(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})},cvt=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const uvt=t=>t.querySelectorAll(".element");function fvt(t){return gt(t).select(`.${Nf}`).node()}const dvt={breadCrumbFill:"rgba(0, 0, 0, 0.85)",breadCrumbFontSize:12,breadCrumbY:12,activeFill:"rgba(0, 0, 0, 0.5)"};function hvt(t={}){const{originData:e=[],layout:n}=t,r=cvt(t,["originData","layout"]),i=Z({},dvt,r),o=ot(i,"breadCrumb"),a=ot(i,"active");return s=>{const{update:l,setState:c,container:u,options:f}=s,d=fvt(u),h=f.marks[0],{state:p}=h,v=new sn;d.appendChild(v);const g=(x,w)=>lvt(this,void 0,void 0,function*(){if(v.removeChildren(),w){let O="",_=o.y,S=0;const E=[],M=d.getBBox().width,P=x.map((C,A)=>{O=`${O}${C}/`,E.push(C);const T=new jr({name:O.replace(/\/$/,""),style:Object.assign(Object.assign({text:C,x:S,path:[...E],depth:A},o),{y:_})});v.appendChild(T),S+=T.getBBox().width;const k=new jr({style:Object.assign(Object.assign({x:S,text:" / "},o),{y:_})});return v.appendChild(k),S+=k.getBBox().width,S>M&&(_=v.getBBox().height+o.y,S=0,T.attr({x:S,y:_}),S+=T.getBBox().width,k.attr({x:S,y:_}),S+=k.getBBox().width),A===xE(x)-1&&k.remove(),T});P.forEach((C,A)=>{if(A===xE(P)-1)return;const T=Object.assign({},C.attributes);C.attr("cursor","pointer"),C.addEventListener("mouseenter",()=>{C.attr(a)}),C.addEventListener("mouseleave",()=>{C.attr(T)}),C.addEventListener("click",()=>{g(Un(C,["style","path"]),Un(C,["style","depth"]))})})}P0t(u,c),c("treemapDrillDown",O=>{const{marks:_}=O,S=x.join("/"),E=_.map(M=>{if(M.type!=="rect")return M;let P=e;if(w){const A=e.filter(L=>{const I=Un(L,["id"]);return I&&(I.match(`${S}/`)||S.match(I))}).map(L=>({value:L.height===0?Un(L,["value"]):void 0,name:Un(L,["id"])})),{paddingLeft:T,paddingBottom:k,paddingRight:N}=n,j=Object.assign(Object.assign({},n),{paddingTop:(n.paddingTop||v.getBBox().height+10)/(w+1),paddingLeft:T/(w+1),paddingBottom:k/(w+1),paddingRight:N/(w+1),path:L=>L.name,layer:L=>L.depth===w+1});P=OL(A,j,{value:"value"})[0]}else P=e.filter(A=>A.depth===1);const C=[];return P.forEach(({path:A})=>{C.push(hu(A))}),Z({},M,{data:P,scale:{color:{domain:C}}})});return Object.assign(Object.assign({},O),{marks:E})}),yield l(void 0,["legendFilter"])}),y=x=>{const w=x.target;if(Un(w,["markType"])!=="rect")return;const O=Un(w,["__data__","key"]),_=vE(e,S=>S.id===O);Un(_,"height")&&g(Un(_,"path"),Un(_,"depth"))};d.addEventListener("click",y);const m=pE(Object.assign(Object.assign({},p.active),p.inactive)),b=()=>{uvt(d).forEach(w=>{const O=Un(w,["style","cursor"]),_=vE(e,S=>S.id===Un(w,["__data__","key"]));if(O!=="pointer"&&(_!=null&&_.height)){w.style.cursor="pointer";const S=Sz(w.attributes,m);w.addEventListener("mouseenter",()=>{w.attr(p.active)}),w.addEventListener("mouseleave",()=>{w.attr(Z(S,p.inactive))})}})};return b(),d.addEventListener("mousemove",b),()=>{v.remove(),d.removeEventListener("click",y),d.removeEventListener("mousemove",b)}}}function sw(t){const{min:e,max:n}=t;return[[e[0],e[1]],[n[0],n[1]]]}function B$(t,e){const[n,r]=t,[i,o]=e;return n>=i[0]&&n<=o[0]&&r>=i[1]&&r<=o[1]}function pvt(t,e){const[n,r]=t;return!(B$(n,e)&&B$(r,e))}function vvt(t,e){const[n,r]=t,[i,o]=e;return n[0]<o[0]&&r[0]>i[0]&&n[1]<o[1]&&r[1]>i[1]}const gvt=t=>{const{priority:e}=t;return n=>{const r=[];return e&&n.sort(e),n.forEach(i=>{G2(i);const o=i.getLocalBounds();r.some(s=>vvt(sw(o),sw(s.getLocalBounds())))?W2(i):r.push(i)}),n}};function yvt([t,e],[n,r]){return r>t&&e>n}function Dv(){const t=new Map;return[r=>t.get(r),(r,i)=>t.set(r,i)]}function mvt(t){const e=t.cloneNode(!0),n=e.getElementById("connector");n&&e.removeChild(n);const{min:r,max:i}=e.getRenderBounds();return e.destroy(),{min:r,max:i}}const bvt=t=>{const{maxIterations:e=10,maxError:n=.1,padding:r=1}=t;return i=>{const o=i.length;if(o<=1)return i;const[a,s]=Dv(),[l,c]=Dv(),[u,f]=Dv(),[d,h]=Dv();for(const p of i){const{min:v,max:g}=mvt(p),[y,m]=v,[b,x]=g;s(p,m),c(p,m),f(p,x-m),h(p,[y,b])}for(let p=0;p<e;p++){i.sort((g,y)=>Te(l(g),l(y)));let v=0;for(let g=0;g<o-1;g++){const y=i[g];let m=g+1,b;for(;(b=i[m])&&!yvt(d(y),d(b));)m+=1;if(b){const x=l(y),w=u(y),O=l(b),_=O-(x+w);if(_<r){const S=(r-_)/2;v=Math.max(v,S),c(y,x-S),c(b,O+S)}}}if(v<n)break}for(const p of i)p.style.y+=l(p)-a(p);return i}};function xvt(t){return typeof t=="object"?t:lo(t)}function lw(t){let e=t/255;return e=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),e}function z$(t,e,n){return .2126*lw(t)+.7152*lw(e)+.0722*lw(n)}function Y$(t,e){const{r:n,g:r,b:i}=t,{r:o,g:a,b:s}=e,l=z$(n,r,i),c=z$(o,a,s);return(Math.max(l,c)+.05)/(Math.min(l,c)+.05)}function wvt(t,e){const n=gl(e,r=>Y$(t,xvt(r)));return e[n]}const Ovt=t=>{const{threshold:e=4.5,palette:n=["#000","#fff"]}=t;return r=>(r.forEach(i=>{const o=i.attr("dependentElement").parsedStyle.fill,a=i.parsedStyle.fill;Y$(a,o)<e&&i.attr("fill",wvt(o,n))}),r)},_vt=()=>t=>(t.forEach(e=>{G2(e);const n=e.attr("bounds"),r=e.getLocalBounds();pvt(sw(r),n)&&W2(e)}),t);function Svt(){return{"data.fetch":KL,"data.inline":rN,"data.sortBy":nN,"data.sort":JL,"data.filter":QL,"data.pick":tN,"data.rename":eN,"data.fold":ZL,"data.slice":dN,"data.custom":iN,"data.map":oN,"data.join":fN,"data.kde":vN,"data.log":_N,"transform.stackY":tM,"transform.binX":wP,"transform.bin":Nm,"transform.dodgeX":dM,"transform.jitter":eP,"transform.jitterX":nP,"transform.jitterY":rP,"transform.symmetryY":iP,"transform.diffY":oP,"transform.stackEnter":hM,"transform.normalizeY":pM,"transform.select":Gh,"transform.selectX":sP,"transform.selectY":lP,"transform.groupX":cP,"transform.groupY":uP,"transform.groupColor":fP,"transform.group":Ru,"transform.sortX":hP,"transform.sortY":vP,"transform.sortColor":pP,"transform.flexX":gP,"transform.pack":bP,"transform.sample":OP,"transform.filter":_P,"coordinate.cartesian":iE,"coordinate.polar":du,"coordinate.transpose":Dy,"coordinate.theta":aE,"coordinate.parallel":Fy,"coordinate.fisheye":lE,"coordinate.radial":$y,"coordinate.radar":cE,"encode.constant":uE,"encode.field":dE,"encode.transform":fE,"encode.column":hE,"mark.interval":d5,"mark.rect":p5,"mark.line":g5,"mark.point":m5,"mark.text":x5,"mark.cell":O5,"mark.area":S5,"mark.link":zb,"mark.image":P5,"mark.polygon":C5,"mark.box":k5,"mark.vector":N5,"mark.lineX":$5,"mark.lineY":j5,"mark.connector":R5,"mark.range":Y5,"mark.rangeX":G5,"mark.rangeY":U5,"mark.path":rL,"mark.shape":CL,"mark.density":AN,"mark.heatmap":TN,"palette.category10":LN,"palette.category20":NN,"scale.linear":jN,"scale.ordinal":DN,"scale.band":IN,"scale.identity":$N,"scale.point":FN,"scale.time":RN,"scale.log":BN,"scale.pow":zN,"scale.sqrt":HN,"scale.threshold":YN,"scale.quantile":WN,"scale.quantize":GN,"scale.sequential":UN,"scale.constant":VN,"theme.classic":XN,"theme.classicDark":KN,"theme.academy":ZN,"theme.light":vx,"theme.dark":qN,"component.axisX":pI,"component.axisY":vI,"component.legendCategory":mx,"component.legendContinuous":ca,"component.legends":EI,"component.title":xI,"component.sliderX":wI,"component.sliderY":OI,"component.scrollbarX":_I,"component.scrollbarY":SI,"animation.scaleInX":wx,"animation.scaleOutX":ast,"animation.scaleInY":MI,"animation.scaleOutY":sst,"animation.waveIn":NI,"animation.fadeIn":PI,"animation.fadeOut":AI,"animation.zoomIn":gst,"animation.zoomOut":yst,"animation.pathIn":II,"animation.morphing":LI,"animation.growInX":jI,"animation.growInY":DI,"interaction.elementHighlight":kv,"interaction.elementHighlightByX":l$,"interaction.elementHighlightByColor":c$,"interaction.elementSelect":Lv,"interaction.elementSelectByX":u$,"interaction.elementSelectByColor":f$,"interaction.fisheye":h0t,"interaction.chartIndex":d$,"interaction.tooltip":_$,"interaction.legendFilter":k0t,"interaction.legendHighlight":L0t,"interaction.brushHighlight":nw,"interaction.brushXHighlight":F0t,"interaction.brushYHighlight":R0t,"interaction.brushAxisHighlight":X0t,"interaction.brushFilter":aw,"interaction.brushXFilter":Q0t,"interaction.brushYFilter":J0t,"interaction.sliderFilter":D$,"interaction.scrollbarFilter":ivt,"interaction.poptip":R$,"interaction.treemapDrillDown":hvt,"composition.spaceLayer":x4,"composition.spaceFlex":w4,"composition.facetRect":P4,"composition.repeatMatrix":nut,"composition.facetCircle":lut,"composition.timingKeyframe":C4,"labelTransform.overlapHide":gvt,"labelTransform.overlapDodgeY":bvt,"labelTransform.overflowHide":_vt,"labelTransform.contrastReverse":Ovt}}function Evt(){return{"composition.geoView":Aj,"composition.geoPath":T4}}function Mvt(){return{"data.arc":Gb,"data.cluster":GL,"mark.forceGraph":YL,"mark.tree":UL,"mark.pack":SL,"mark.sankey":J5,"mark.chord":eL,"mark.treemap":_L}}function Pvt(){return{"data.venn":ON,"mark.boxplot":AL,"mark.gauge":MN,"mark.wordCloud":SN,"mark.liquid":kN}}function W$(){return Object.assign(Object.assign(Object.assign(Object.assign({},Evt()),Mvt()),Pvt()),Svt())}function Avt(t,e){class n extends t{constructor(i){super(Object.assign(Object.assign({},i),{lib:e}))}}return n}const G$={};function H$(t,e){Object.assign(G$,{[t]:e})}const mc=t=>t?parseInt(t):0;function Cvt(t){const e=getComputedStyle(t),n=t.clientWidth||mc(e.width),r=t.clientHeight||mc(e.height),i=mc(e.paddingLeft)+mc(e.paddingRight),o=mc(e.paddingTop)+mc(e.paddingBottom);return{width:n-i,height:r-o}}function cw(t,e){const n=[t];for(;n.length;){const r=n.shift();e&&e(r);const i=r.children||[];for(const o of i)n.push(o)}}class uw{constructor(e={},n){this.parentNode=null,this.children=[],this.index=0,this.type=n,this.value=e}map(e=n=>n){const n=e(this.value);return this.value=n,this}attr(e,n){return arguments.length===1?this.value[e]:this.map(r=>(r[e]=n,r))}append(e){const n=new e({});return n.children=[],this.push(n),n}push(e){return e.parentNode=this,e.index=this.children.length,this.children.push(e),this}remove(){const e=this.parentNode;if(e){const{children:n}=e,r=n.findIndex(i=>i===this);n.splice(r,1)}return this}getNodeByKey(e){let n=null;return cw(this,i=>{e===i.attr("key")&&(n=i)}),n}getNodesByType(e){const n=[];return cw(this,i=>{e===i.type&&n.push(i)}),n}getNodeByType(e){let n=null;return cw(this,r=>{n||e===r.type&&(n=r)}),n}call(e,...n){return e(this.map(),...n),this}getRoot(){let e=this;for(;e&&e.parentNode;)e=e.parentNode;return e}}var U$=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const fw=["width","height","depth","padding","paddingLeft","paddingRight","paddingBottom","paddingTop","inset","insetLeft","insetRight","insetTop","insetBottom","margin","marginLeft","marginRight","marginTop","marginBottom","autoFit","theme","title"],V$="__remove__",X$="__callback__",q$=1,K$=1;function Tvt(t){if(t===void 0){const e=document.createElement("div");return e[V$]=!0,e}return typeof t=="string"?document.getElementById(t):t}function kvt(t){const e=t.parentNode;e&&e.removeChild(t)}function Lvt(t){if(t.type!==null)return t;const e=t.children[t.children.length-1];for(const n of fw)e.attr(n,t.attr(n));return e}function Z$(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function dw(t,e){const{width:n,height:r,autoFit:i,depth:o=0}=t;let a=640,s=480;if(i){const{width:l,height:c}=Cvt(e);a=l||a,s=c||s}return a=n||a,s=r||s,{width:Math.max(Va(a)?a:q$,q$),height:Math.max(Va(s)?s:K$,K$),depth:o}}function Nvt(t){const e=Lvt(t),n=[e],r=new Map;for(r.set(e,Z$(e));n.length;){const i=n.pop(),o=r.get(i),{children:a=[]}=i;for(const s of a)if(s.type===X$)o.children=s.value;else{const l=Z$(s),{children:c=[]}=o;c.push(l),n.push(s),r.set(s,l),o.children=c}}return r.get(e)}function Ivt(t,e){return typeof t=="function"?!0:new Set(Object.keys(e)).has(t)}function jvt(t,e){return typeof t!="function"&&new Set(Object.keys(e)).has(t)}function Dvt(t,e,n,r,i){const{type:o}=t,{type:a=n||o}=e;if(jvt(a,i)){for(const s of fw)t.attr(s)!==void 0&&e[s]===void 0&&(e[s]=t.attr(s));return e}if(Ivt(a,r)){const s={type:"view"},l=Object.assign({},e);for(const c of fw)l[c]!==void 0&&(s[c]=l[c],delete l[c]);return Object.assign(Object.assign({},s),{children:[l]})}return e}function $vt(t,e,n){if(typeof t=="function")return e.mark;const i=Object.assign(Object.assign({},e),n)[t];if(!i)throw new Error(`Unknown mark: ${t}.`);return i}function Fvt(t,e,n){if(typeof t=="function"){const l=new uw;return l.value=t,l.type=X$,l}const{type:r,children:i}=t,o=U$(t,["type","children"]),a=$vt(r,e,n),s=new a;return s.value=o,s.type=r,s}function Rvt(t,e){const{type:n,children:r}=e,i=U$(e,["type","children"]);t.type===n||n===void 0?VE(t.value,i):typeof n=="string"&&(t.type=n,t.value=i)}function Bvt(t,e,n,r){if(!t)return;const i=[[t,e]];for(;i.length;){const[o,a]=i.shift(),s=Fvt(a,n,r);Array.isArray(o.children)&&o.push(s);const{children:l}=a;if(Array.isArray(l))for(const c of l)i.push([s,c]);else typeof l=="function"&&i.push([s,l])}}function zvt(t,e,n,r,i){const o=Dvt(t,e,n,r,i),a=[[null,t,o]];for(;a.length;){const[s,l,c]=a.shift();if(!l)Bvt(s,c,r,i);else if(!c)l.remove();else{Rvt(l,c);const{children:u}=c,{children:f}=l;if(Array.isArray(u)&&Array.isArray(f)){const d=Math.max(u.length,f.length);for(let h=0;h<d;h++){const p=u[h],v=f[h];a.push([l,v,p])}}else typeof u=="function"&&a.push([l,null,u])}}}function Yvt(){let t,e;return[new Promise((r,i)=>{e=r,t=i}),e,t]}function Wvt(t,e,{key:n=e}){t.prototype[e]=function(r){return arguments.length===0?this.attr(n):this.attr(n,r)}}function Gvt(t,e,{key:n=e}){t.prototype[e]=function(r){if(arguments.length===0)return this.attr(n);if(Array.isArray(r))return this.attr(n,r);const i=[...this.attr(n)||[],r];return this.attr(n,i)}}function Hvt(t,e,{key:n=e}){t.prototype[e]=function(r,i){if(arguments.length===0)return this.attr(n);if(arguments.length===1&&typeof r!="string")return this.attr(n,r);const o=this.attr(n)||{};return o[r]=arguments.length===1?!0:i,this.attr(n,o)}}function Uvt(t,e,n){t.prototype[e]=function(r){if(arguments.length===0)return this.attr(e);if(Array.isArray(r))return this.attr(e,{items:r});if(Su(r)&&(r.title!==void 0||r.items!==void 0))return this.attr(e,r);if(r===null||r===!1)return this.attr(e,r);const i=this.attr(e)||{},{items:o=[]}=i;return o.push(r),i.items=o,this.attr(e,i)}}function Vvt(t,e,{ctor:n}){t.prototype[e]=function(r){const i=this.append(n);return e==="mark"&&(i.type=r),i}}function Xvt(t,e,{ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}function $v(t){return e=>{for(const[n,r]of Object.entries(t)){const{type:i}=r;i==="value"?Wvt(e,n,r):i==="array"?Gvt(e,n,r):i==="object"?Hvt(e,n,r):i==="node"?Vvt(e,n,r):i==="container"?Xvt(e,n,r):i==="mix"&&Uvt(e,n)}return e}}function Q$(t){return Object.fromEntries(Object.entries(t).map(([e,n])=>[e,{type:"node",ctor:n}]))}const J$={encode:{type:"object"},scale:{type:"object"},data:{type:"value"},transform:{type:"array"},style:{type:"object"},animate:{type:"object"},coordinate:{type:"object"},interaction:{type:"object"},label:{type:"array",key:"labels"},axis:{type:"object"},legend:{type:"object"},slider:{type:"object"},scrollbar:{type:"object"},state:{type:"object"},layout:{type:"object"},theme:{type:"object"},title:{type:"value"}},qvt=Object.assign(Object.assign({},J$),{tooltip:{type:"mix"},viewStyle:{type:"object"}}),Kvt=Object.assign(Object.assign({},J$),{labelTransform:{type:"array"}});var Zvt=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Fv=class extends uw{changeData(e){var n;const r=this.getRoot();if(r)return this.attr("data",e),!((n=this.children)===null||n===void 0)&&n.length&&this.children.forEach(i=>{i.attr("data",e)}),r==null?void 0:r.render()}getView(){const e=this.getRoot(),{views:n}=e.getContext();if(n!=null&&n.length)return n.find(r=>r.key===this._key)}getScale(){var e;return(e=this.getView())===null||e===void 0?void 0:e.scale}getScaleByChannel(e){const n=this.getScale();if(n)return n[e]}getCoordinate(){var e;return(e=this.getView())===null||e===void 0?void 0:e.coordinate}getTheme(){var e;return(e=this.getView())===null||e===void 0?void 0:e.theme}getGroup(){const e=this._key;return e?this.getRoot().getContext().canvas.getRoot().getElementById(e):void 0}show(){const e=this.getGroup();e&&!e.isVisible()&&G2(e)}hide(){const e=this.getGroup();e&&e.isVisible()&&W2(e)}};Fv=Zvt([$v(Kvt)],Fv);var Qvt=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let hw=class extends uw{changeData(e){const n=this.getRoot();if(n)return this.attr("data",e),n==null?void 0:n.render()}getMark(){var e;const n=(e=this.getRoot())===null||e===void 0?void 0:e.getView();if(!n)return;const{markState:r}=n,i=Array.from(r.keys()).find(o=>o.key===this.attr("key"));return r.get(i)}getScale(){var e;const n=(e=this.getRoot())===null||e===void 0?void 0:e.getView();if(n)return n==null?void 0:n.scale}getScaleByChannel(e){var n,r;const i=(n=this.getRoot())===null||n===void 0?void 0:n.getView();if(i)return(r=i==null?void 0:i.scale)===null||r===void 0?void 0:r[e]}getGroup(){const e=this.attr("key");return e?this.getRoot().getContext().canvas.getRoot().getElementById(e):void 0}};hw=Qvt([$v(qvt)],hw);var Jvt=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},tgt=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const egt="G2_CHART_KEY";class ngt extends Fv{constructor(e){const{container:n,canvas:r,renderer:i,plugins:o,lib:a}=e,s=tgt(e,["container","canvas","renderer","plugins","lib"]);super(s,"view"),this._hasBindAutoFit=!1,this._rendering=!1,this._trailing=!1,this._trailingResolve=null,this._trailingReject=null,this._previousDefinedType=null,this._onResize=mz(()=>{this.forceFit()},300),this._renderer=i||new UI,this._plugins=o||[],this._container=Tvt(n),this._emitter=new Ax,this._context={library:Object.assign(Object.assign({},a),G$),emitter:this._emitter,canvas:r},this._create()}render(){if(this._rendering)return this._addToTrailing();this._context.canvas||this._createCanvas(),this._context.canvas.getConfig().supportsCSSTransform=!0,this._bindAutoFit(),this._rendering=!0;const e=new Promise((o,a)=>Kpt(this._computedOptions(),this._context,this._createResolve(o),this._createReject(a))),[n,r,i]=Yvt();return e.then(r).catch(i).then(()=>this._renderTrailing()),n}options(e){if(arguments.length===0)return Nvt(this);const{type:n}=e;return n&&(this._previousDefinedType=n),zvt(this,e,this._previousDefinedType,this._marks,this._compositions),this}getContainer(){return this._container}getContext(){return this._context}on(e,n,r){return this._emitter.on(e,n,r),this}once(e,n){return this._emitter.once(e,n),this}emit(e,...n){return this._emitter.emit(e,...n),this}off(e,n){return this._emitter.off(e,n),this}clear(){const e=this.options();this.emit(Ut.BEFORE_CLEAR),this._reset(),e$(e,this._context,!1),this.emit(Ut.AFTER_CLEAR)}destroy(){const e=this.options();this.emit(Ut.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),e$(e,this._context,!0),this._container[V$]&&kvt(this._container),this.emit(Ut.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;const{width:e,height:n}=dw(this.options(),this._container);if(e===this._width&&n===this._height)return Promise.resolve(this);this.emit(Ut.BEFORE_CHANGE_SIZE);const r=this.render();return r.then(()=>{this.emit(Ut.AFTER_CHANGE_SIZE)}),r}changeSize(e,n){if(e===this._width&&n===this._height)return Promise.resolve(this);this.emit(Ut.BEFORE_CHANGE_SIZE),this.attr("width",e),this.attr("height",n);const r=this.render();return r.then(()=>{this.emit(Ut.AFTER_CHANGE_SIZE)}),r}_create(){const{library:e}=this._context,n=o=>o.startsWith("mark.")||o==="component.axisX"||o==="component.axisY"||o==="component.legends",r=["mark.mark",...Object.keys(e).filter(n)];this._marks={};for(const o of r){const a=o.split(".").pop();class s extends hw{constructor(){super({},a)}}this._marks[a]=s,this[a]=function(l){const c=this.append(s);return a==="mark"&&(c.type=l),c}}const i=["composition.view",...Object.keys(e).filter(o=>o.startsWith("composition.")&&o!=="composition.mark")];this._compositions=Object.fromEntries(i.map(o=>{const a=o.split(".").pop();let s=class extends Fv{constructor(){super({},a)}};return s=Jvt([$v(Q$(this._marks))],s),[a,s]}));for(const o of Object.values(this._compositions))$v(Q$(this._compositions))(o);for(const o of i){const a=o.split(".").pop();this[a]=function(){const s=this._compositions[a];return this.type=null,this.append(s)}}}_reset(){const e=["theme","type","width","height","autoFit"];this.type="view",this.value=Object.fromEntries(Object.entries(this.value).filter(([n])=>n.startsWith("margin")||n.startsWith("padding")||n.startsWith("inset")||e.includes(n))),this.children=[]}_renderTrailing(){this._trailing&&(this._trailing=!1,this.render().then(()=>{const e=this._trailingResolve.bind(this);this._trailingResolve=null,e(this)}).catch(e=>{const n=this._trailingReject.bind(this);this._trailingReject=null,n(e)}))}_createResolve(e){return()=>{this._rendering=!1,e(this)}}_createReject(e){return n=>{this._rendering=!1,e(n)}}_computedOptions(){const e=this.options(),{key:n=egt}=e,{width:r,height:i,depth:o}=dw(e,this._container);return this._width=r,this._height=i,this._key=n,Object.assign(Object.assign({key:this._key},e),{width:r,height:i,depth:o})}_createCanvas(){const{width:e,height:n}=dw(this.options(),this._container);this._plugins.push(new VI),this._plugins.forEach(r=>this._renderer.registerPlugin(r)),this._context.canvas=new AC({container:this._container,width:e,height:n,renderer:this._renderer})}_addToTrailing(){var e;return(e=this._trailingResolve)===null||e===void 0||e.call(this,this),this._trailing=!0,new Promise((r,i)=>{this._trailingResolve=r,this._trailingReject=i})}_bindAutoFit(){const e=this.options(),{autoFit:n}=e;if(this._hasBindAutoFit){n||this._unbindAutoFit();return}n&&(this._hasBindAutoFit=!0,window.addEventListener("resize",this._onResize))}_unbindAutoFit(){this._hasBindAutoFit&&(this._hasBindAutoFit=!1,window.removeEventListener("resize",this._onResize))}}U.enableCSSParsing=!1,Object.assign({},W$());var tF={exports:{}},Or={},eF={exports:{}},nF={};/**
83
+ `,m.style.x=X,m.style.y=V,m.style.width=it-X,m.style.height=nt-V},N=X=>{const V=(Nt,Yt,me,We,lr)=>Nt+Yt<We?We-Yt:Nt+me>lr?lr-me:Nt,it=X[0]-y[0],nt=X[1]-y[1],lt=V(it,v[0],g[0],w,_),yt=V(nt,v[1],g[1],O,S),vt=[v[0]+lt,v[1]+yt],mt=[g[0]+lt,g[1]+yt];A(vt,mt)},j={"handle-n":{vector:[0,1,0,0],cursor:"ns-resize"},"handle-e":{vector:[0,0,1,0],cursor:"ew-resize"},"handle-s":{vector:[0,0,0,1],cursor:"ns-resize"},"handle-w":{vector:[1,0,0,0],cursor:"ew-resize"},"handle-nw":{vector:[1,1,0,0],cursor:"nwse-resize"},"handle-ne":{vector:[0,1,1,0],cursor:"nesw-resize"},"handle-se":{vector:[0,0,1,1],cursor:"nwse-resize"},"handle-sw":{vector:[1,0,0,1],cursor:"nesw-resize"}},L=X=>$(X)||I(X),I=X=>{const{id:V}=X;return h.indexOf(V)===-1?!1:new Set(Object.keys(j)).has(V)},$=X=>X===m.getElementById("selection"),F=X=>{const{target:V}=X,[it,nt]=V2(t,X);if(!m||!L(V)){E(it,nt,X),x=!0;return}L(V)&&(y=[it,nt])},R=X=>{const{target:V}=X,it=V2(t,X);if(!v)return;if(!y)return A(v,it);if($(V))return N(it);const[nt,lt]=[it[0]-y[0],it[1]-y[1]],{id:yt}=V;if(j[yt]){const[vt,mt,Nt,Yt]=j[yt].vector;return A([v[0]+nt*vt,v[1]+lt*mt],[g[0]+nt*Nt,g[1]+lt*Yt])}},B=X=>{if(y){y=null;const{x:yt,y:vt,width:mt,height:Nt}=m.style;v=[yt,vt],g=[yt+mt,vt+Nt],a(yt,vt,yt+mt,vt+Nt,X);return}g=V2(t,X);const[V,it,nt,lt]=A(v,g);x=!1,i(V,it,nt,lt,X)},W=X=>{const{target:V}=X;m&&!L(V)&&C()},K=X=>{const{target:V}=X;!m||!L(V)||x?ya(t,"crosshair"):$(V)?ya(t,"move"):I(V)&&ya(t,j[V.id].cursor)},J=()=>{ya(t,"default")};return t.addEventListener("dragstart",F),t.addEventListener("drag",R),t.addEventListener("dragend",B),t.addEventListener("click",W),t.addEventListener("pointermove",K),t.addEventListener("pointerleave",J),{mask:m,move(X,V,it,nt,lt=!0){m||E(X,V,{}),v=[X,V],g=[it,nt],A([X,V],[it,nt],lt)},remove(X=!0){m&&C(X)},destroy(){m&&C(!1),ya(t,"default"),t.removeEventListener("dragstart",F),t.removeEventListener("drag",R),t.removeEventListener("dragend",B),t.removeEventListener("click",W),t.removeEventListener("pointermove",K),t.removeEventListener("pointerleave",J)}}}function ew(t,e,n){return e.filter(r=>{if(r===t)return!1;const{interaction:i={}}=r.options;return Object.values(i).find(o=>o.brushKey===n)})}function D0t(t,e,n){return ew(t,e,n).map(r=>wo(r.container))}function $0t(t,e,n){return ew(t,e,n).map(r=>r.options)}function k$(t,e){var{elements:n,selectedHandles:r,siblings:i=R=>[],datum:o,brushRegion:a,extent:s,reverse:l,scale:c,coordinate:u,series:f=!1,key:d=R=>R,bboxOf:h=R=>{const{x:B,y:W,width:K,height:J}=R.style;return{x:B,y:W,width:K,height:J}},state:p={},emitter:v}=e,g=wr(e,["elements","selectedHandles","siblings","datum","brushRegion","extent","reverse","scale","coordinate","series","key","bboxOf","state","emitter"]);const y=n(t),m=i(t),b=m.flatMap(n),x=nd(y,o),w=ot(g,"mask"),{setState:O,removeState:_}=Oo(p,x),S=new Map,{width:E,height:M,x:P=0,y:C=0}=h(t),A=s||[0,0,E,M],T=()=>{for(const R of[...y,...b])_(R,"active","inactive")},k=(R,B,W,K)=>{var J;for(const V of m)(J=V.brush)===null||J===void 0||J.remove();const X=new Set;for(const V of y){const{min:it,max:nt}=V.getLocalBounds(),[lt,yt]=it,[vt,mt]=nt;N0t([lt,yt,vt,mt],[R,B,W,K])?(O(V,"active"),X.add(d(V))):O(V,"inactive")}for(const V of b)X.has(d(V))?O(V,"active"):O(V,"inactive")},N=()=>{for(const R of y)_(R,"inactive");for(const R of S.values())R.remove();S.clear()},j=(R,B,W,K)=>{const J=X=>{const V=X.cloneNode();return V.__data__=X.__data__,X.parentNode.appendChild(V),S.set(X,V),V};for(const X of y){const V=S.get(X)||J(X);V.style.clipPath=new hs({style:{x:R+P,y:B+C,width:W-R,height:K-B}}),O(X,"inactive"),O(V,"active")}},L=tw(t,Object.assign(Object.assign({},w),{extent:A,brushRegion:a,reverse:l,selectedHandles:r,brushended:R=>{const B=f?N:T;R&&v.emit("brush:remove",{nativeEvent:!0}),B()},brushed:(R,B,W,K,J)=>{const X=N0(R,B,W,K,c,u);J&&v.emit("brush:highlight",{nativeEvent:!0,data:{selection:X}}),(f?j:k)(R,B,W,K)},brushcreated:(R,B,W,K,J)=>{const X=N0(R,B,W,K,c,u);v.emit("brush:end",Object.assign(Object.assign({},J),{nativeEvent:!0,data:{selection:X}}))},brushupdated:(R,B,W,K,J)=>{const X=N0(R,B,W,K,c,u);v.emit("brush:end",Object.assign(Object.assign({},J),{nativeEvent:!0,data:{selection:X}}))},brushstarted:R=>{v.emit("brush:start",R)}})),I=({nativeEvent:R,data:B})=>{if(R)return;const{selection:W}=B,[K,J,X,V]=tst(W,c,u);L.move(K,J,X,V,!1)};v.on("brush:highlight",I);const $=({nativeEvent:R}={})=>{R||L.remove(!1)};v.on("brush:remove",$);const F=L.destroy.bind(L);return L.destroy=()=>{v.off("brush:highlight",I),v.off("brush:remove",$),F()},L}function nw(t){var{facet:e,brushKey:n}=t,r=wr(t,["facet","brushKey"]);return(i,o,a)=>{const{container:s,view:l,options:c}=i,u=wo(s),f={maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",reverse:!1},d=["active",["inactive",{opacity:.5}]],{scale:h,coordinate:p}=l;if(e){const g=u.getBounds(),y=g.min[0],m=g.min[1],b=g.max[0],x=g.max[1];return k$(u.parentNode.parentNode,Object.assign(Object.assign({elements:()=>n$(i,o),datum:ks(H2(i,o).map(w=>w.view)),brushRegion:(w,O,_,S)=>[w,O,_,S],extent:[y,m,b,x],state:yc(H2(i,o).map(w=>w.options),d),emitter:a,scale:h,coordinate:p,selectedHandles:void 0},f),r))}const v=k$(u,Object.assign(Object.assign({elements:ga,key:g=>g.__data__.key,siblings:()=>D0t(i,o,n),datum:ks([l,...ew(i,o,n).map(g=>g.view)]),brushRegion:(g,y,m,b)=>[g,y,m,b],extent:void 0,state:yc([c,...$0t(i,o,n)],d),emitter:a,scale:h,coordinate:p,selectedHandles:void 0},f),r));return u.brush=v,()=>v.destroy()}}function rw(t,e,n,r,i){const[,o,,a]=i;return[t,o,n,a]}function F0t(t){return nw(Object.assign(Object.assign({},t),{brushRegion:rw,selectedHandles:["handle-e","handle-w"]}))}function iw(t,e,n,r,i){const[o,,a]=i;return[o,e,a,r]}function R0t(t){return nw(Object.assign(Object.assign({},t),{brushRegion:iw,selectedHandles:["handle-n","handle-s"]}))}var ow=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const B0t="axis",z0t="axis-line",Y0t="axis-main-group",L$="axis-hot-area";function W0t(t){return t.getElementsByClassName(B0t)}function N$(t){return t.getElementsByClassName(z0t)[0]}function G0t(t){return t.getElementsByClassName(Y0t)[0]}function I$(t){return G0t(t).getLocalBounds()}function H0t(t,e){var{cross:n,offsetX:r,offsetY:i}=e,o=ow(e,["cross","offsetX","offsetY"]);const a=I$(t),s=N$(t),[l]=s.getLocalBounds().min,[c,u]=a.min,[f,d]=a.max,h=(f-c)*2;return{brushRegion:iw,hotZone:new hs({className:L$,style:Object.assign({x:n?c:l-h/2,width:n?h/2:h,y:u,height:d-u},o)}),extent:n?(p,v,g,y)=>[-1/0,v,1/0,y]:(p,v,g,y)=>[Math.floor(c-r),v,Math.ceil(f-r),y]}}function U0t(t,e){var{offsetY:n,offsetX:r,cross:i=!1}=e,o=ow(e,["offsetY","offsetX","cross"]);const a=I$(t),s=N$(t),[,l]=s.getLocalBounds().min,[c,u]=a.min,[f,d]=a.max,h=d-u;return{brushRegion:rw,hotZone:new hs({className:L$,style:Object.assign({x:c,width:f-c,y:i?u:l-h,height:i?h:h*2},o)}),extent:i?(p,v,g,y)=>[p,-1/0,g,1/0]:(p,v,g,y)=>[p,Math.floor(u-n),g,Math.ceil(d-n)]}}function V0t(t,e){var{axes:n,elements:r,points:i,horizontal:o,datum:a,offsetY:s,offsetX:l,reverse:c=!1,state:u={},emitter:f,coordinate:d}=e,h=ow(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse","state","emitter","coordinate"]);const p=r(t),v=n(t),g=nd(p,a),{setState:y,removeState:m}=Oo(u,g),b=new Map,x=ot(h,"mask"),w=I=>Array.from(b.values()).every(([$,F,R,B])=>I.some(([W,K])=>W>=$&&W<=R&&K>=F&&K<=B)),O=v.map(I=>I.attributes.scale),_=I=>I.length>2?[I[0],I[I.length-1]]:I,S=new Map,E=()=>{S.clear();for(let I=0;I<v.length;I++){const $=O[I],{domain:F}=$.getOptions();S.set(I,_(F))}};E();const M=(I,$)=>{const F=[];for(const B of p){const W=i(B);w(W)?(y(B,"active"),F.push(B)):y(B,"inactive")}if(S.set(I,C(F,I)),!$)return;const R=()=>{if(!A)return Array.from(S.values());const B=[];for(const[W,K]of S){const J=O[W],{name:X}=J.getOptions();X==="x"?B[0]=K:B[1]=K}return B};f.emit("brushAxis:highlight",{nativeEvent:!0,data:{selection:R()}})},P=I=>{for(const $ of p)m($,"active","inactive");E(),I&&f.emit("brushAxis:remove",{nativeEvent:!0})},C=(I,$)=>{const F=O[$],{name:R}=F.getOptions(),B=I.map(W=>{const K=W.__data__;return F.invert(K[R])});return _(ua(F,B))},A=v.some(o)&&v.some(I=>!o(I)),T=[];for(let I=0;I<v.length;I++){const $=v[I],F=o($)?U0t:H0t,{hotZone:R,brushRegion:B,extent:W}=F($,{offsetY:s,offsetX:l,cross:A,zIndex:999,fill:"transparent"});$.parentNode.appendChild(R);const K=tw(R,Object.assign(Object.assign({},x),{reverse:c,brushRegion:B,brushended(J){b.delete($),Array.from(b.entries()).length===0?P(J):M(I,J)},brushed(J,X,V,it,nt){b.set($,W(J,X,V,it)),M(I,nt)}}));T.push(K)}const k=(I={})=>{const{nativeEvent:$}=I;$||T.forEach(F=>F.remove(!1))},N=(I,$,F)=>{const[R,B]=I,W=X=>X.getStep?X.getStep():0,K=j(R,$,F),J=j(B,$,F)+W($);return o(F)?[K,-1/0,J,1/0]:[-1/0,K,1/0,J]},j=(I,$,F)=>{const{height:R,width:B}=d.getOptions(),W=$.clone();return o(F)?W.update({range:[0,B]}):W.update({range:[R,0]}),W.map(I)},L=I=>{const{nativeEvent:$}=I;if($)return;const{selection:F}=I.data;for(let R=0;R<T.length;R++){const B=F[R],W=T[R],K=v[R];if(B){const J=O[R];W.move(...N(B,J,K),!1)}else W.remove(!1)}};return f.on("brushAxis:remove",k),f.on("brushAxis:highlight",L),()=>{T.forEach(I=>I.destroy()),f.off("brushAxis:remove",k),f.off("brushAxis:highlight",L)}}function X0t(t){return(e,n,r)=>{const{container:i,view:o,options:a}=e,s=wo(i),{x:l,y:c}=s.getBBox(),{coordinate:u}=o;return V0t(i,Object.assign({elements:ga,axes:W0t,offsetY:c,offsetX:l,points:f=>f.__data__.points,horizontal:f=>{const{startPos:[d,h],endPos:[p,v]}=f.attributes;return d!==p&&h===v},datum:ks(o),state:yc(a,["active",["inactive",{opacity:.5}]]),coordinate:u,emitter:r},t))}}var q0t=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?o(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})},j$=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function K0t(t=300){let e=null;return n=>{const{timeStamp:r}=n;return e!==null&&r-e<t?(e=r,!0):(e=r,!1)}}function Z0t(t,e){var{filter:n,reset:r,brushRegion:i,extent:o,reverse:a,emitter:s,scale:l,coordinate:c,selection:u,series:f=!1}=e,d=j$(e,["filter","reset","brushRegion","extent","reverse","emitter","scale","coordinate","selection","series"]);const h=ot(d,"mask"),{width:p,height:v}=t.getBBox(),g=o||[0,0,p,v],y=K0t(),m=tw(t,Object.assign(Object.assign({},h),{extent:g,brushRegion:i,reverse:a,brushcreated:b}));t.addEventListener("click",x);function b(O,_,S,E,M){M.nativeEvent=!0,n(u(O,_,S,E),M),m.remove()}function x(O){y(O)&&(O.nativeEvent=!0,r(O))}const w=({nativeEvent:O,data:_})=>{if(O)return;const{selection:S}=_;n(S,{nativeEvent:!1})};return s.on("brush:filter",w),()=>{m.destroy(),s.off("brush:filter",w),t.removeEventListener("click",x)}}function aw(t){var{hideX:e=!0,hideY:n=!0}=t,r=j$(t,["hideX","hideY"]);return(i,o,a)=>{const{container:s,view:l,options:c,update:u,setState:f}=i,d=wo(s),h={maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1};let p=!1,v=!1,g=l;const{scale:y,coordinate:m}=l;return Z0t(d,Object.assign(Object.assign({brushRegion:(b,x,w,O)=>[b,x,w,O],selection:(b,x,w,O)=>{const{scale:_,coordinate:S}=g;return N0(b,x,w,O,_,S)},filter:(b,x)=>q0t(this,void 0,void 0,function*(){if(v)return;v=!0;const[w,O]=b;f("brushFilter",S=>{const{marks:E}=S,M=E.map(P=>Z({axis:Object.assign(Object.assign({},e&&{x:{transform:[{type:"hide"}]}}),n&&{y:{transform:[{type:"hide"}]}})},P,{scale:{x:{domain:w,nice:!1},y:{domain:O,nice:!1}}}));return Object.assign(Object.assign({},c),{marks:M,clip:!0})}),a.emit("brush:filter",Object.assign(Object.assign({},x),{data:{selection:[w,O]}})),g=(yield u()).view,v=!1,p=!0}),reset:b=>{if(v||!p)return;const{scale:x}=l,{x:w,y:O}=x,_=w.getOptions().domain,S=O.getOptions().domain;a.emit("brush:filter",Object.assign(Object.assign({},b),{data:{selection:[_,S]}})),p=!1,g=l,f("brushFilter"),u()},extent:void 0,emitter:a,scale:y,coordinate:m},h),r))}}function Q0t(t){return aw(Object.assign(Object.assign({hideX:!0},t),{brushRegion:rw}))}function J0t(t){return aw(Object.assign(Object.assign({hideY:!0},t),{brushRegion:iw}))}var tvt=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?o(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})};const evt="slider";function nvt(t,e,n,r=!1,i="x",o="y"){const{marks:a}=t,s=a.map(l=>{var c,u;return Z({axis:{x:{transform:[{type:"hide"}]},y:{transform:[{type:"hide"}]}}},l,{scale:e,[n]:Object.assign(Object.assign({},((c=l[n])===null||c===void 0?void 0:c[i])&&{[i]:Object.assign({preserve:!0},r&&{ratio:null})}),((u=l[n])===null||u===void 0?void 0:u[o])&&{[o]:{preserve:!0}}),animate:!1})});return Object.assign(Object.assign({},t),{marks:s,clip:!0,animate:!1})}function rvt(t,e,n){const[r,i]=t,o=n?l=>1-l:l=>l,a=ql(e,o(r),!0),s=ql(e,o(i),!1);return ua(e,[a,s])}function jv(t){return[t[0],t[t.length-1]]}function D$({initDomain:t={},className:e=evt,prefix:n="slider",setValue:r=(c,u)=>c.setValues(u),hasState:i=!1,wait:o=50,leading:a=!0,trailing:s=!1,getInitValues:l=c=>{var u;const f=(u=c==null?void 0:c.attributes)===null||u===void 0?void 0:u.values;if(f[0]!==0||f[1]!==1)return f}}){return(c,u,f)=>{const{container:d,view:h,update:p,setState:v}=c,g=d.getElementsByClassName(e);if(!g.length)return()=>{};let y=!1;const{scale:m,coordinate:b,layout:x}=h,{paddingLeft:w,paddingTop:O,paddingBottom:_,paddingRight:S}=x,{x:E,y:M}=m,P=he(b),C=N=>{const j=N==="vertical"?"y":"x",L=N==="vertical"?"x":"y";return P?[L,j]:[j,L]},A=new Map,T=new Set,k={x:t.x||E.getOptions().domain,y:t.y||M.getOptions().domain};for(const N of g){const{orientation:j}=N.attributes,[L,I]=C(j),$=`${n}${zo(L)}:filter`,F=L==="x",{ratio:R}=E.getOptions(),{ratio:B}=M.getOptions(),W=V=>{if(V.data){const{selection:vt}=V.data,[mt=jv(k.x),Nt=jv(k.y)]=vt;return F?[ua(E,mt,R),ua(M,Nt,B)]:[ua(M,Nt,B),ua(E,mt,R)]}const{value:it}=V.detail,nt=m[L],lt=rvt(it,nt,P&&j==="horizontal"),yt=k[I];return[lt,yt]},K=Xa(V=>tvt(this,void 0,void 0,function*(){const{initValue:it=!1}=V;if(y&&!it)return;y=!0;const{nativeEvent:nt=!0}=V,[lt,yt]=W(V);if(k[L]=lt,k[I]=yt,nt){const vt=F?lt:yt,mt=F?yt:lt;f.emit($,Object.assign(Object.assign({},V),{nativeEvent:nt,data:{selection:[jv(vt),jv(mt)]}}))}v(N,vt=>Object.assign(Object.assign({},nvt(vt,{[L]:{domain:lt,nice:!1}},n,i,L,I)),{paddingLeft:w,paddingTop:O,paddingBottom:_,paddingRight:S})),yield p(),y=!1}),o,{leading:a,trailing:s}),J=V=>{const{nativeEvent:it}=V;if(it)return;const{data:nt}=V,{selection:lt}=nt,[yt,vt]=lt;N.dispatchEvent(new ee("valuechange",{data:nt,nativeEvent:!1}));const mt=F?I0(yt,E):I0(vt,M);r(N,mt)};f.on($,J),N.addEventListener("valuechange",K),A.set(N,K),T.add([$,J]);const X=l(N);X&&N.dispatchEvent(new ee("valuechange",{detail:{value:X},nativeEvent:!1,initValue:!0}))}return p(),()=>{for(const[N,j]of A)N.removeEventListener("valuechange",j);for(const[N,j]of T)f.off(N,j)}}}const $$="g2-scrollbar";function ivt(t={}){return(e,n,r)=>{const{view:i,container:o}=e;if(!o.getElementsByClassName($$).length)return()=>{};const{scale:s}=i,{x:l,y:c}=s,u={x:[...l.getOptions().domain],y:[...c.getOptions().domain]};return l.update({domain:l.getOptions().expectedDomain}),c.update({domain:c.getOptions().expectedDomain}),D$(Object.assign(Object.assign({},t),{initDomain:u,className:$$,prefix:"scrollbar",hasState:!0,setValue:(d,h)=>d.setValue(h[0]),getInitValues:d=>{const h=d.slider.attributes.values;if(h[0]!==0)return h}}))(e,n,r)}}var ovt=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function avt(t,e,n){return`<${t} style="${Object.entries(n).map(([r,i])=>`${Oet(r)}:${i}`).join(";")}">${e}</${t}>`}const svt={backgroundColor:"rgba(0,0,0,0.75)",color:"#fff",width:"max-content",padding:"1px 4px",fontSize:"12px",borderRadius:"2.5px",boxShadow:"0 3px 6px -4px rgba(0,0,0,0.12), 0 6px 16px 0 rgba(0,0,0,0.08), 0 9px 28px 8px rgba(0,0,0,0.05)"};function F$(t){return t.nodeName!=="text"?!1:!!t.isOverflowing()}function R$(t){var{offsetX:e=8,offsetY:n=8}=t,r=ovt(t,["offsetX","offsetY"]);return i=>{const{container:o}=i,[a,s]=o.getBounds().min,l=ot(r,"tip"),c=new Set,u=d=>{const{target:h}=d;if(!F$(h)){d.stopPropagation();return}const{offsetX:p,offsetY:v}=d,g=p+e-a,y=v+n-s;if(h.tip){h.tip.style.x=g,h.tip.style.y=y;return}const{text:m}=h.style,b=new Op({className:"poptip",style:{innerHTML:avt("div",m,Object.assign(Object.assign({},svt),l)),x:g,y}});o.appendChild(b),h.tip=b,c.add(b)},f=d=>{const{target:h}=d;if(!F$(h)){d.stopPropagation();return}h.tip&&(h.tip.remove(),h.tip=null,c.delete(h.tip))};return o.addEventListener("pointerover",u),o.addEventListener("pointerout",f),()=>{o.removeEventListener("pointerover",u),o.removeEventListener("pointerout",f),c.forEach(d=>d.remove())}}}R$.props={reapplyWhenUpdate:!0};var lvt=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?o(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})},cvt=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const uvt=t=>t.querySelectorAll(".element");function fvt(t){return gt(t).select(`.${Nf}`).node()}const dvt={breadCrumbFill:"rgba(0, 0, 0, 0.85)",breadCrumbFontSize:12,breadCrumbY:12,activeFill:"rgba(0, 0, 0, 0.5)"};function hvt(t={}){const{originData:e=[],layout:n}=t,r=cvt(t,["originData","layout"]),i=Z({},dvt,r),o=ot(i,"breadCrumb"),a=ot(i,"active");return s=>{const{update:l,setState:c,container:u,options:f}=s,d=fvt(u),h=f.marks[0],{state:p}=h,v=new sn;d.appendChild(v);const g=(x,w)=>lvt(this,void 0,void 0,function*(){if(v.removeChildren(),w){let O="",_=o.y,S=0;const E=[],M=d.getBBox().width,P=x.map((C,A)=>{O=`${O}${C}/`,E.push(C);const T=new jr({name:O.replace(/\/$/,""),style:Object.assign(Object.assign({text:C,x:S,path:[...E],depth:A},o),{y:_})});v.appendChild(T),S+=T.getBBox().width;const k=new jr({style:Object.assign(Object.assign({x:S,text:" / "},o),{y:_})});return v.appendChild(k),S+=k.getBBox().width,S>M&&(_=v.getBBox().height+o.y,S=0,T.attr({x:S,y:_}),S+=T.getBBox().width,k.attr({x:S,y:_}),S+=k.getBBox().width),A===xE(x)-1&&k.remove(),T});P.forEach((C,A)=>{if(A===xE(P)-1)return;const T=Object.assign({},C.attributes);C.attr("cursor","pointer"),C.addEventListener("mouseenter",()=>{C.attr(a)}),C.addEventListener("mouseleave",()=>{C.attr(T)}),C.addEventListener("click",()=>{g(Un(C,["style","path"]),Un(C,["style","depth"]))})})}P0t(u,c),c("treemapDrillDown",O=>{const{marks:_}=O,S=x.join("/"),E=_.map(M=>{if(M.type!=="rect")return M;let P=e;if(w){const A=e.filter(L=>{const I=Un(L,["id"]);return I&&(I.match(`${S}/`)||S.match(I))}).map(L=>({value:L.height===0?Un(L,["value"]):void 0,name:Un(L,["id"])})),{paddingLeft:T,paddingBottom:k,paddingRight:N}=n,j=Object.assign(Object.assign({},n),{paddingTop:(n.paddingTop||v.getBBox().height+10)/(w+1),paddingLeft:T/(w+1),paddingBottom:k/(w+1),paddingRight:N/(w+1),path:L=>L.name,layer:L=>L.depth===w+1});P=OL(A,j,{value:"value"})[0]}else P=e.filter(A=>A.depth===1);const C=[];return P.forEach(({path:A})=>{C.push(hu(A))}),Z({},M,{data:P,scale:{color:{domain:C}}})});return Object.assign(Object.assign({},O),{marks:E})}),yield l(void 0,["legendFilter"])}),y=x=>{const w=x.target;if(Un(w,["markType"])!=="rect")return;const O=Un(w,["__data__","key"]),_=vE(e,S=>S.id===O);Un(_,"height")&&g(Un(_,"path"),Un(_,"depth"))};d.addEventListener("click",y);const m=pE(Object.assign(Object.assign({},p.active),p.inactive)),b=()=>{uvt(d).forEach(w=>{const O=Un(w,["style","cursor"]),_=vE(e,S=>S.id===Un(w,["__data__","key"]));if(O!=="pointer"&&(_!=null&&_.height)){w.style.cursor="pointer";const S=Sz(w.attributes,m);w.addEventListener("mouseenter",()=>{w.attr(p.active)}),w.addEventListener("mouseleave",()=>{w.attr(Z(S,p.inactive))})}})};return b(),d.addEventListener("mousemove",b),()=>{v.remove(),d.removeEventListener("click",y),d.removeEventListener("mousemove",b)}}}function sw(t){const{min:e,max:n}=t;return[[e[0],e[1]],[n[0],n[1]]]}function B$(t,e){const[n,r]=t,[i,o]=e;return n>=i[0]&&n<=o[0]&&r>=i[1]&&r<=o[1]}function pvt(t,e){const[n,r]=t;return!(B$(n,e)&&B$(r,e))}function vvt(t,e){const[n,r]=t,[i,o]=e;return n[0]<o[0]&&r[0]>i[0]&&n[1]<o[1]&&r[1]>i[1]}const gvt=t=>{const{priority:e}=t;return n=>{const r=[];return e&&n.sort(e),n.forEach(i=>{G2(i);const o=i.getLocalBounds();r.some(s=>vvt(sw(o),sw(s.getLocalBounds())))?W2(i):r.push(i)}),n}};function yvt([t,e],[n,r]){return r>t&&e>n}function Dv(){const t=new Map;return[r=>t.get(r),(r,i)=>t.set(r,i)]}function mvt(t){const e=t.cloneNode(!0),n=e.getElementById("connector");n&&e.removeChild(n);const{min:r,max:i}=e.getRenderBounds();return e.destroy(),{min:r,max:i}}const bvt=t=>{const{maxIterations:e=10,maxError:n=.1,padding:r=1}=t;return i=>{const o=i.length;if(o<=1)return i;const[a,s]=Dv(),[l,c]=Dv(),[u,f]=Dv(),[d,h]=Dv();for(const p of i){const{min:v,max:g}=mvt(p),[y,m]=v,[b,x]=g;s(p,m),c(p,m),f(p,x-m),h(p,[y,b])}for(let p=0;p<e;p++){i.sort((g,y)=>Te(l(g),l(y)));let v=0;for(let g=0;g<o-1;g++){const y=i[g];let m=g+1,b;for(;(b=i[m])&&!yvt(d(y),d(b));)m+=1;if(b){const x=l(y),w=u(y),O=l(b),_=O-(x+w);if(_<r){const S=(r-_)/2;v=Math.max(v,S),c(y,x-S),c(b,O+S)}}}if(v<n)break}for(const p of i)p.style.y+=l(p)-a(p);return i}};function xvt(t){return typeof t=="object"?t:lo(t)}function lw(t){let e=t/255;return e=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),e}function z$(t,e,n){return .2126*lw(t)+.7152*lw(e)+.0722*lw(n)}function Y$(t,e){const{r:n,g:r,b:i}=t,{r:o,g:a,b:s}=e,l=z$(n,r,i),c=z$(o,a,s);return(Math.max(l,c)+.05)/(Math.min(l,c)+.05)}function wvt(t,e){const n=gl(e,r=>Y$(t,xvt(r)));return e[n]}const Ovt=t=>{const{threshold:e=4.5,palette:n=["#000","#fff"]}=t;return r=>(r.forEach(i=>{const o=i.attr("dependentElement").parsedStyle.fill,a=i.parsedStyle.fill;Y$(a,o)<e&&i.attr("fill",wvt(o,n))}),r)},_vt=()=>t=>(t.forEach(e=>{G2(e);const n=e.attr("bounds"),r=e.getLocalBounds();pvt(sw(r),n)&&W2(e)}),t);function Svt(){return{"data.fetch":KL,"data.inline":rN,"data.sortBy":nN,"data.sort":JL,"data.filter":QL,"data.pick":tN,"data.rename":eN,"data.fold":ZL,"data.slice":dN,"data.custom":iN,"data.map":oN,"data.join":fN,"data.kde":vN,"data.log":_N,"transform.stackY":tM,"transform.binX":wP,"transform.bin":Nm,"transform.dodgeX":dM,"transform.jitter":eP,"transform.jitterX":nP,"transform.jitterY":rP,"transform.symmetryY":iP,"transform.diffY":oP,"transform.stackEnter":hM,"transform.normalizeY":pM,"transform.select":Gh,"transform.selectX":sP,"transform.selectY":lP,"transform.groupX":cP,"transform.groupY":uP,"transform.groupColor":fP,"transform.group":Ru,"transform.sortX":hP,"transform.sortY":vP,"transform.sortColor":pP,"transform.flexX":gP,"transform.pack":bP,"transform.sample":OP,"transform.filter":_P,"coordinate.cartesian":iE,"coordinate.polar":du,"coordinate.transpose":Dy,"coordinate.theta":aE,"coordinate.parallel":Fy,"coordinate.fisheye":lE,"coordinate.radial":$y,"coordinate.radar":cE,"encode.constant":uE,"encode.field":dE,"encode.transform":fE,"encode.column":hE,"mark.interval":d5,"mark.rect":p5,"mark.line":g5,"mark.point":m5,"mark.text":x5,"mark.cell":O5,"mark.area":S5,"mark.link":zb,"mark.image":P5,"mark.polygon":C5,"mark.box":k5,"mark.vector":N5,"mark.lineX":$5,"mark.lineY":j5,"mark.connector":R5,"mark.range":Y5,"mark.rangeX":G5,"mark.rangeY":U5,"mark.path":rL,"mark.shape":CL,"mark.density":AN,"mark.heatmap":TN,"palette.category10":LN,"palette.category20":NN,"scale.linear":jN,"scale.ordinal":DN,"scale.band":IN,"scale.identity":$N,"scale.point":FN,"scale.time":RN,"scale.log":BN,"scale.pow":zN,"scale.sqrt":HN,"scale.threshold":YN,"scale.quantile":WN,"scale.quantize":GN,"scale.sequential":UN,"scale.constant":VN,"theme.classic":XN,"theme.classicDark":KN,"theme.academy":ZN,"theme.light":vx,"theme.dark":qN,"component.axisX":pI,"component.axisY":vI,"component.legendCategory":mx,"component.legendContinuous":ca,"component.legends":EI,"component.title":xI,"component.sliderX":wI,"component.sliderY":OI,"component.scrollbarX":_I,"component.scrollbarY":SI,"animation.scaleInX":wx,"animation.scaleOutX":ast,"animation.scaleInY":MI,"animation.scaleOutY":sst,"animation.waveIn":NI,"animation.fadeIn":PI,"animation.fadeOut":AI,"animation.zoomIn":gst,"animation.zoomOut":yst,"animation.pathIn":II,"animation.morphing":LI,"animation.growInX":jI,"animation.growInY":DI,"interaction.elementHighlight":kv,"interaction.elementHighlightByX":l$,"interaction.elementHighlightByColor":c$,"interaction.elementSelect":Lv,"interaction.elementSelectByX":u$,"interaction.elementSelectByColor":f$,"interaction.fisheye":h0t,"interaction.chartIndex":d$,"interaction.tooltip":_$,"interaction.legendFilter":k0t,"interaction.legendHighlight":L0t,"interaction.brushHighlight":nw,"interaction.brushXHighlight":F0t,"interaction.brushYHighlight":R0t,"interaction.brushAxisHighlight":X0t,"interaction.brushFilter":aw,"interaction.brushXFilter":Q0t,"interaction.brushYFilter":J0t,"interaction.sliderFilter":D$,"interaction.scrollbarFilter":ivt,"interaction.poptip":R$,"interaction.treemapDrillDown":hvt,"composition.spaceLayer":x4,"composition.spaceFlex":w4,"composition.facetRect":P4,"composition.repeatMatrix":nut,"composition.facetCircle":lut,"composition.timingKeyframe":C4,"labelTransform.overlapHide":gvt,"labelTransform.overlapDodgeY":bvt,"labelTransform.overflowHide":_vt,"labelTransform.contrastReverse":Ovt}}function Evt(){return{"composition.geoView":Aj,"composition.geoPath":T4}}function Mvt(){return{"data.arc":Gb,"data.cluster":GL,"mark.forceGraph":YL,"mark.tree":UL,"mark.pack":SL,"mark.sankey":J5,"mark.chord":eL,"mark.treemap":_L}}function Pvt(){return{"data.venn":ON,"mark.boxplot":AL,"mark.gauge":MN,"mark.wordCloud":SN,"mark.liquid":kN}}function W$(){return Object.assign(Object.assign(Object.assign(Object.assign({},Evt()),Mvt()),Pvt()),Svt())}function Avt(t,e){class n extends t{constructor(i){super(Object.assign(Object.assign({},i),{lib:e}))}}return n}const G$={};function H$(t,e){Object.assign(G$,{[t]:e})}const mc=t=>t?parseInt(t):0;function Cvt(t){const e=getComputedStyle(t),n=t.clientWidth||mc(e.width),r=t.clientHeight||mc(e.height),i=mc(e.paddingLeft)+mc(e.paddingRight),o=mc(e.paddingTop)+mc(e.paddingBottom);return{width:n-i,height:r-o}}function cw(t,e){const n=[t];for(;n.length;){const r=n.shift();e&&e(r);const i=r.children||[];for(const o of i)n.push(o)}}class uw{constructor(e={},n){this.parentNode=null,this.children=[],this.index=0,this.type=n,this.value=e}map(e=n=>n){const n=e(this.value);return this.value=n,this}attr(e,n){return arguments.length===1?this.value[e]:this.map(r=>(r[e]=n,r))}append(e){const n=new e({});return n.children=[],this.push(n),n}push(e){return e.parentNode=this,e.index=this.children.length,this.children.push(e),this}remove(){const e=this.parentNode;if(e){const{children:n}=e,r=n.findIndex(i=>i===this);n.splice(r,1)}return this}getNodeByKey(e){let n=null;return cw(this,i=>{e===i.attr("key")&&(n=i)}),n}getNodesByType(e){const n=[];return cw(this,i=>{e===i.type&&n.push(i)}),n}getNodeByType(e){let n=null;return cw(this,r=>{n||e===r.type&&(n=r)}),n}call(e,...n){return e(this.map(),...n),this}getRoot(){let e=this;for(;e&&e.parentNode;)e=e.parentNode;return e}}var U$=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const fw=["width","height","depth","padding","paddingLeft","paddingRight","paddingBottom","paddingTop","inset","insetLeft","insetRight","insetTop","insetBottom","margin","marginLeft","marginRight","marginTop","marginBottom","autoFit","theme","title"],V$="__remove__",X$="__callback__",q$=1,K$=1;function Tvt(t){if(t===void 0){const e=document.createElement("div");return e[V$]=!0,e}return typeof t=="string"?document.getElementById(t):t}function kvt(t){const e=t.parentNode;e&&e.removeChild(t)}function Lvt(t){if(t.type!==null)return t;const e=t.children[t.children.length-1];for(const n of fw)e.attr(n,t.attr(n));return e}function Z$(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function dw(t,e){const{width:n,height:r,autoFit:i,depth:o=0}=t;let a=640,s=480;if(i){const{width:l,height:c}=Cvt(e);a=l||a,s=c||s}return a=n||a,s=r||s,{width:Math.max(Va(a)?a:q$,q$),height:Math.max(Va(s)?s:K$,K$),depth:o}}function Nvt(t){const e=Lvt(t),n=[e],r=new Map;for(r.set(e,Z$(e));n.length;){const i=n.pop(),o=r.get(i),{children:a=[]}=i;for(const s of a)if(s.type===X$)o.children=s.value;else{const l=Z$(s),{children:c=[]}=o;c.push(l),n.push(s),r.set(s,l),o.children=c}}return r.get(e)}function Ivt(t,e){return typeof t=="function"?!0:new Set(Object.keys(e)).has(t)}function jvt(t,e){return typeof t!="function"&&new Set(Object.keys(e)).has(t)}function Dvt(t,e,n,r,i){const{type:o}=t,{type:a=n||o}=e;if(jvt(a,i)){for(const s of fw)t.attr(s)!==void 0&&e[s]===void 0&&(e[s]=t.attr(s));return e}if(Ivt(a,r)){const s={type:"view"},l=Object.assign({},e);for(const c of fw)l[c]!==void 0&&(s[c]=l[c],delete l[c]);return Object.assign(Object.assign({},s),{children:[l]})}return e}function $vt(t,e,n){if(typeof t=="function")return e.mark;const i=Object.assign(Object.assign({},e),n)[t];if(!i)throw new Error(`Unknown mark: ${t}.`);return i}function Fvt(t,e,n){if(typeof t=="function"){const l=new uw;return l.value=t,l.type=X$,l}const{type:r,children:i}=t,o=U$(t,["type","children"]),a=$vt(r,e,n),s=new a;return s.value=o,s.type=r,s}function Rvt(t,e){const{type:n,children:r}=e,i=U$(e,["type","children"]);t.type===n||n===void 0?VE(t.value,i):typeof n=="string"&&(t.type=n,t.value=i)}function Bvt(t,e,n,r){if(!t)return;const i=[[t,e]];for(;i.length;){const[o,a]=i.shift(),s=Fvt(a,n,r);Array.isArray(o.children)&&o.push(s);const{children:l}=a;if(Array.isArray(l))for(const c of l)i.push([s,c]);else typeof l=="function"&&i.push([s,l])}}function zvt(t,e,n,r,i){const o=Dvt(t,e,n,r,i),a=[[null,t,o]];for(;a.length;){const[s,l,c]=a.shift();if(!l)Bvt(s,c,r,i);else if(!c)l.remove();else{Rvt(l,c);const{children:u}=c,{children:f}=l;if(Array.isArray(u)&&Array.isArray(f)){const d=Math.max(u.length,f.length);for(let h=0;h<d;h++){const p=u[h],v=f[h];a.push([l,v,p])}}else typeof u=="function"&&a.push([l,null,u])}}}function Yvt(){let t,e;return[new Promise((r,i)=>{e=r,t=i}),e,t]}function Wvt(t,e,{key:n=e}){t.prototype[e]=function(r){return arguments.length===0?this.attr(n):this.attr(n,r)}}function Gvt(t,e,{key:n=e}){t.prototype[e]=function(r){if(arguments.length===0)return this.attr(n);if(Array.isArray(r))return this.attr(n,r);const i=[...this.attr(n)||[],r];return this.attr(n,i)}}function Hvt(t,e,{key:n=e}){t.prototype[e]=function(r,i){if(arguments.length===0)return this.attr(n);if(arguments.length===1&&typeof r!="string")return this.attr(n,r);const o=this.attr(n)||{};return o[r]=arguments.length===1?!0:i,this.attr(n,o)}}function Uvt(t,e,n){t.prototype[e]=function(r){if(arguments.length===0)return this.attr(e);if(Array.isArray(r))return this.attr(e,{items:r});if(Su(r)&&(r.title!==void 0||r.items!==void 0))return this.attr(e,r);if(r===null||r===!1)return this.attr(e,r);const i=this.attr(e)||{},{items:o=[]}=i;return o.push(r),i.items=o,this.attr(e,i)}}function Vvt(t,e,{ctor:n}){t.prototype[e]=function(r){const i=this.append(n);return e==="mark"&&(i.type=r),i}}function Xvt(t,e,{ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}function $v(t){return e=>{for(const[n,r]of Object.entries(t)){const{type:i}=r;i==="value"?Wvt(e,n,r):i==="array"?Gvt(e,n,r):i==="object"?Hvt(e,n,r):i==="node"?Vvt(e,n,r):i==="container"?Xvt(e,n,r):i==="mix"&&Uvt(e,n)}return e}}function Q$(t){return Object.fromEntries(Object.entries(t).map(([e,n])=>[e,{type:"node",ctor:n}]))}const J$={encode:{type:"object"},scale:{type:"object"},data:{type:"value"},transform:{type:"array"},style:{type:"object"},animate:{type:"object"},coordinate:{type:"object"},interaction:{type:"object"},label:{type:"array",key:"labels"},axis:{type:"object"},legend:{type:"object"},slider:{type:"object"},scrollbar:{type:"object"},state:{type:"object"},layout:{type:"object"},theme:{type:"object"},title:{type:"value"}},qvt=Object.assign(Object.assign({},J$),{tooltip:{type:"mix"},viewStyle:{type:"object"}}),Kvt=Object.assign(Object.assign({},J$),{labelTransform:{type:"array"}});var Zvt=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Fv=class extends uw{changeData(e){var n;const r=this.getRoot();if(r)return this.attr("data",e),!((n=this.children)===null||n===void 0)&&n.length&&this.children.forEach(i=>{i.attr("data",e)}),r==null?void 0:r.render()}getView(){const e=this.getRoot(),{views:n}=e.getContext();if(n!=null&&n.length)return n.find(r=>r.key===this._key)}getScale(){var e;return(e=this.getView())===null||e===void 0?void 0:e.scale}getScaleByChannel(e){const n=this.getScale();if(n)return n[e]}getCoordinate(){var e;return(e=this.getView())===null||e===void 0?void 0:e.coordinate}getTheme(){var e;return(e=this.getView())===null||e===void 0?void 0:e.theme}getGroup(){const e=this._key;return e?this.getRoot().getContext().canvas.getRoot().getElementById(e):void 0}show(){const e=this.getGroup();e&&!e.isVisible()&&G2(e)}hide(){const e=this.getGroup();e&&e.isVisible()&&W2(e)}};Fv=Zvt([$v(Kvt)],Fv);var Qvt=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let hw=class extends uw{changeData(e){const n=this.getRoot();if(n)return this.attr("data",e),n==null?void 0:n.render()}getMark(){var e;const n=(e=this.getRoot())===null||e===void 0?void 0:e.getView();if(!n)return;const{markState:r}=n,i=Array.from(r.keys()).find(o=>o.key===this.attr("key"));return r.get(i)}getScale(){var e;const n=(e=this.getRoot())===null||e===void 0?void 0:e.getView();if(n)return n==null?void 0:n.scale}getScaleByChannel(e){var n,r;const i=(n=this.getRoot())===null||n===void 0?void 0:n.getView();if(i)return(r=i==null?void 0:i.scale)===null||r===void 0?void 0:r[e]}getGroup(){const e=this.attr("key");return e?this.getRoot().getContext().canvas.getRoot().getElementById(e):void 0}};hw=Qvt([$v(qvt)],hw);var Jvt=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(i<3?a(o):i>3?a(e,n,o):a(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o},tgt=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const egt="G2_CHART_KEY";class ngt extends Fv{constructor(e){const{container:n,canvas:r,renderer:i,plugins:o,lib:a}=e,s=tgt(e,["container","canvas","renderer","plugins","lib"]);super(s,"view"),this._hasBindAutoFit=!1,this._rendering=!1,this._trailing=!1,this._trailingResolve=null,this._trailingReject=null,this._previousDefinedType=null,this._onResize=mz(()=>{this.forceFit()},300),this._renderer=i||new UI,this._plugins=o||[],this._container=Tvt(n),this._emitter=new Ax,this._context={library:Object.assign(Object.assign({},a),G$),emitter:this._emitter,canvas:r},this._create()}render(){if(this._rendering)return this._addToTrailing();this._context.canvas||this._createCanvas(),this._context.canvas.getConfig().supportsCSSTransform=!0,this._bindAutoFit(),this._rendering=!0;const e=new Promise((o,a)=>Kpt(this._computedOptions(),this._context,this._createResolve(o),this._createReject(a))),[n,r,i]=Yvt();return e.then(r).catch(i).then(()=>this._renderTrailing()),n}options(e){if(arguments.length===0)return Nvt(this);const{type:n}=e;return n&&(this._previousDefinedType=n),zvt(this,e,this._previousDefinedType,this._marks,this._compositions),this}getContainer(){return this._container}getContext(){return this._context}on(e,n,r){return this._emitter.on(e,n,r),this}once(e,n){return this._emitter.once(e,n),this}emit(e,...n){return this._emitter.emit(e,...n),this}off(e,n){return this._emitter.off(e,n),this}clear(){const e=this.options();this.emit(Ut.BEFORE_CLEAR),this._reset(),e$(e,this._context,!1),this.emit(Ut.AFTER_CLEAR)}destroy(){const e=this.options();this.emit(Ut.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),e$(e,this._context,!0),this._container[V$]&&kvt(this._container),this.emit(Ut.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;const{width:e,height:n}=dw(this.options(),this._container);if(e===this._width&&n===this._height)return Promise.resolve(this);this.emit(Ut.BEFORE_CHANGE_SIZE);const r=this.render();return r.then(()=>{this.emit(Ut.AFTER_CHANGE_SIZE)}),r}changeSize(e,n){if(e===this._width&&n===this._height)return Promise.resolve(this);this.emit(Ut.BEFORE_CHANGE_SIZE),this.attr("width",e),this.attr("height",n);const r=this.render();return r.then(()=>{this.emit(Ut.AFTER_CHANGE_SIZE)}),r}_create(){const{library:e}=this._context,n=o=>o.startsWith("mark.")||o==="component.axisX"||o==="component.axisY"||o==="component.legends",r=["mark.mark",...Object.keys(e).filter(n)];this._marks={};for(const o of r){const a=o.split(".").pop();class s extends hw{constructor(){super({},a)}}this._marks[a]=s,this[a]=function(l){const c=this.append(s);return a==="mark"&&(c.type=l),c}}const i=["composition.view",...Object.keys(e).filter(o=>o.startsWith("composition.")&&o!=="composition.mark")];this._compositions=Object.fromEntries(i.map(o=>{const a=o.split(".").pop();let s=class extends Fv{constructor(){super({},a)}};return s=Jvt([$v(Q$(this._marks))],s),[a,s]}));for(const o of Object.values(this._compositions))$v(Q$(this._compositions))(o);for(const o of i){const a=o.split(".").pop();this[a]=function(){const s=this._compositions[a];return this.type=null,this.append(s)}}}_reset(){const e=["theme","type","width","height","autoFit"];this.type="view",this.value=Object.fromEntries(Object.entries(this.value).filter(([n])=>n.startsWith("margin")||n.startsWith("padding")||n.startsWith("inset")||e.includes(n))),this.children=[]}_renderTrailing(){this._trailing&&(this._trailing=!1,this.render().then(()=>{const e=this._trailingResolve.bind(this);this._trailingResolve=null,e(this)}).catch(e=>{const n=this._trailingReject.bind(this);this._trailingReject=null,n(e)}))}_createResolve(e){return()=>{this._rendering=!1,e(this)}}_createReject(e){return n=>{this._rendering=!1,e(n)}}_computedOptions(){const e=this.options(),{key:n=egt}=e,{width:r,height:i,depth:o}=dw(e,this._container);return this._width=r,this._height=i,this._key=n,Object.assign(Object.assign({key:this._key},e),{width:r,height:i,depth:o})}_createCanvas(){const{width:e,height:n}=dw(this.options(),this._container);this._plugins.push(new VI),this._plugins.forEach(r=>this._renderer.registerPlugin(r)),this._context.canvas=new AC({container:this._container,width:e,height:n,renderer:this._renderer})}_addToTrailing(){var e;return(e=this._trailingResolve)===null||e===void 0||e.call(this,this),this._trailing=!0,new Promise((r,i)=>{this._trailingResolve=r,this._trailingReject=i})}_bindAutoFit(){const e=this.options(),{autoFit:n}=e;if(this._hasBindAutoFit){n||this._unbindAutoFit();return}n&&(this._hasBindAutoFit=!0,window.addEventListener("resize",this._onResize))}_unbindAutoFit(){this._hasBindAutoFit&&(this._hasBindAutoFit=!1,window.removeEventListener("resize",this._onResize))}}U.enableCSSParsing=!1,Object.assign({},W$());var tF={exports:{}},Or={},eF={exports:{}},nF={};/**
84
84
  * @license React
85
85
  * scheduler.production.min.js
86
86
  *
@@ -158,4 +158,4 @@ Error generating stack: `+o.message+`
158
158
  transform: translate(24px, 0);
159
159
  }
160
160
  }
161
- `,n.classList.add("loading"),n.innerHTML="<div></div><div></div><div></div><div></div>",e.appendChild(r),e.appendChild(n)},vmt=function(t){var e=t.loadingTemplate,n=t.theme,r=n===void 0?"light":n,i=q.useRef(null);q.useEffect(function(){!e&&i.current&&pmt(i.current)},[]);var o=function(){return e||q.createElement("div",{ref:i})};return q.createElement("div",{className:"charts-loading-container",style:{position:"absolute",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",left:0,top:0,zIndex:99,backgroundColor:r==="dark"?"rgb(20, 20, 20)":"rgb(255, 255, 255)"}},o())},gmt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ymt=function(t){gmt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={hasError:!1},n.renderError=function(r){var i=n.props.errorTemplate;switch(r){default:return typeof i=="function"?i(r):i||q.createElement("h5",null,"组件出错了,请核查后重试: ",r.message)}},n}return e.getDerivedStateFromError=function(n){return{hasError:!0,error:n}},e.getDerivedStateFromProps=function(n,r){return r.children!==n.children?{children:n.children,hasError:!1,error:void 0}:null},e.prototype.render=function(){return this.state.hasError?this.renderError(this.state.error):q.createElement(q.Fragment,null,this.props.children)},e}(q.Component),mmt=typeof global=="object"&&global&&global.Object===Object&&global;const fR=mmt;var bmt=typeof self=="object"&&self&&self.Object===Object&&self,xmt=fR||bmt||Function("return this")();const wi=xmt;var wmt=wi.Symbol;const ti=wmt;var dR=Object.prototype,Omt=dR.hasOwnProperty,_mt=dR.toString,Vd=ti?ti.toStringTag:void 0;function Smt(t){var e=Omt.call(t,Vd),n=t[Vd];try{t[Vd]=void 0;var r=!0}catch(o){}var i=_mt.call(t);return r&&(e?t[Vd]=n:delete t[Vd]),i}var Emt=Object.prototype,Mmt=Emt.toString;function Pmt(t){return Mmt.call(t)}var Amt="[object Null]",Cmt="[object Undefined]",hR=ti?ti.toStringTag:void 0;function Qi(t){return t==null?t===void 0?Cmt:Amt:hR&&hR in Object(t)?Smt(t):Pmt(t)}function sr(t){return t!=null&&typeof t=="object"}var Tmt="[object Symbol]";function Xd(t){return typeof t=="symbol"||sr(t)&&Qi(t)==Tmt}var kmt=NaN;function pR(t){return typeof t=="number"?t:Xd(t)?kmt:+t}function Zg(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var Lmt=Array.isArray;const Vt=Lmt;var Nmt=1/0,vR=ti?ti.prototype:void 0,gR=vR?vR.toString:void 0;function Qg(t){if(typeof t=="string")return t;if(Vt(t))return Zg(t,Qg)+"";if(Xd(t))return gR?gR.call(t):"";var e=t+"";return e=="0"&&1/t==-Nmt?"-0":e}function Imt(t,e){return function(n,r){var i;if(n===void 0&&r===void 0)return e;if(n!==void 0&&(i=n),r!==void 0){if(i===void 0)return r;typeof n=="string"||typeof r=="string"?(n=Qg(n),r=Qg(r)):(n=pR(n),r=pR(r)),i=t(n,r)}return i}}var jmt=/\s/;function Dmt(t){for(var e=t.length;e--&&jmt.test(t.charAt(e)););return e}var $mt=/^\s+/;function Fmt(t){return t&&t.slice(0,Dmt(t)+1).replace($mt,"")}function Gn(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var yR=NaN,Rmt=/^[-+]0x[0-9a-f]+$/i,Bmt=/^0b[01]+$/i,zmt=/^0o[0-7]+$/i,Ymt=parseInt;function mR(t){if(typeof t=="number")return t;if(Xd(t))return yR;if(Gn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Gn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Fmt(t);var n=Bmt.test(t);return n||zmt.test(t)?Ymt(t.slice(2),n?2:8):Rmt.test(t)?yR:+t}var bR=1/0,Wmt=17976931348623157e292;function Gmt(t){if(!t)return t===0?t:0;if(t=mR(t),t===bR||t===-bR){var e=t<0?-1:1;return e*Wmt}return t===t?t:0}function xR(t){var e=Gmt(t),n=e%1;return e===e?n?e-n:e:0}function __(t){return t}var Hmt="[object AsyncFunction]",Umt="[object Function]",Vmt="[object GeneratorFunction]",Xmt="[object Proxy]";function Vc(t){if(!Gn(t))return!1;var e=Qi(t);return e==Umt||e==Vmt||e==Hmt||e==Xmt}var qmt=wi["__core-js_shared__"];const S_=qmt;var wR=function(){var t=/[^.]+$/.exec(S_&&S_.keys&&S_.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Kmt(t){return!!wR&&wR in t}var Zmt=Function.prototype,Qmt=Zmt.toString;function Us(t){if(t!=null){try{return Qmt.call(t)}catch(e){}try{return t+""}catch(e){}}return""}var Jmt=/[\\^$.*+?()[\]{}|]/g,t1t=/^\[object .+?Constructor\]$/,e1t=Function.prototype,n1t=Object.prototype,r1t=e1t.toString,i1t=n1t.hasOwnProperty,o1t=RegExp("^"+r1t.call(i1t).replace(Jmt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function a1t(t){if(!Gn(t)||Kmt(t))return!1;var e=Vc(t)?o1t:t1t;return e.test(Us(t))}function s1t(t,e){return t==null?void 0:t[e]}function Vs(t,e){var n=s1t(t,e);return a1t(n)?n:void 0}var l1t=Vs(wi,"WeakMap");const qd=l1t;var c1t=qd&&new qd;const OR=c1t;var _R=Object.create,u1t=function(){function t(){}return function(e){if(!Gn(e))return{};if(_R)return _R(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();const E_=u1t;function f1t(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function M_(){}var d1t=4294967295;function Xc(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d1t,this.__views__=[]}Xc.prototype=E_(M_.prototype),Xc.prototype.constructor=Xc;function SR(){}var h1t=OR?function(t){return OR.get(t)}:SR;const ER=h1t;var p1t={};const MR=p1t;var v1t=Object.prototype,g1t=v1t.hasOwnProperty;function Jg(t){for(var e=t.name+"",n=MR[e],r=g1t.call(MR,e)?n.length:0;r--;){var i=n[r],o=i.func;if(o==null||o==t)return i.name}return e}function Ra(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}Ra.prototype=E_(M_.prototype),Ra.prototype.constructor=Ra;function P_(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function y1t(t){if(t instanceof Xc)return t.clone();var e=new Ra(t.__wrapped__,t.__chain__);return e.__actions__=P_(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var m1t=Object.prototype,b1t=m1t.hasOwnProperty;function ty(t){if(sr(t)&&!Vt(t)&&!(t instanceof Xc)){if(t instanceof Ra)return t;if(b1t.call(t,"__wrapped__"))return y1t(t)}return new Ra(t)}ty.prototype=M_.prototype,ty.prototype.constructor=ty;function PR(t){var e=Jg(t),n=ty[e];if(typeof n!="function"||!(e in Xc.prototype))return!1;if(t===n)return!0;var r=ER(n);return!!r&&t===r[0]}var x1t=800,w1t=16,O1t=Date.now;function _1t(t){var e=0,n=0;return function(){var r=O1t(),i=w1t-(r-n);if(n=r,i>0){if(++e>=x1t)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function S1t(t){return function(){return t}}var E1t=function(){try{var t=Vs(Object,"defineProperty");return t({},"",{}),t}catch(e){}}();const ey=E1t;var M1t=ey?function(t,e){return ey(t,"toString",{configurable:!0,enumerable:!1,value:S1t(e),writable:!0})}:__,P1t=_1t(M1t);const AR=P1t;function A1t(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}function C1t(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function T1t(t){return t!==t}function k1t(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}function CR(t,e,n){return e===e?k1t(t,e,n):C1t(t,T1t,n)}function L1t(t,e){var n=t==null?0:t.length;return!!n&&CR(t,e,0)>-1}var N1t=9007199254740991,I1t=/^(?:0|[1-9]\d*)$/;function ny(t,e){var n=typeof t;return e=e==null?N1t:e,!!e&&(n=="number"||n!="symbol"&&I1t.test(t))&&t>-1&&t%1==0&&t<e}function ry(t,e,n){e=="__proto__"&&ey?ey(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Kd(t,e){return t===e||t!==t&&e!==e}var j1t=Object.prototype,D1t=j1t.hasOwnProperty;function iy(t,e,n){var r=t[e];(!(D1t.call(t,e)&&Kd(r,n))||n===void 0&&!(e in t))&&ry(t,e,n)}function Xs(t,e,n,r){var i=!n;n||(n={});for(var o=-1,a=e.length;++o<a;){var s=e[o],l=r?r(n[s],t[s],s,n,t):void 0;l===void 0&&(l=t[s]),i?ry(n,s,l):iy(n,s,l)}return n}var TR=Math.max;function kR(t,e,n){return e=TR(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=TR(r.length-e,0),a=Array(o);++i<o;)a[i]=r[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=r[i];return s[e]=n(a),f1t(t,this,s)}}function $1t(t,e){return AR(kR(t,e,__),t+"")}var F1t=9007199254740991;function A_(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=F1t}function Ba(t){return t!=null&&A_(t.length)&&!Vc(t)}function R1t(t,e,n){if(!Gn(n))return!1;var r=typeof e;return(r=="number"?Ba(n)&&ny(e,n.length):r=="string"&&e in n)?Kd(n[e],t):!1}function LR(t){return $1t(function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=t.length>3&&typeof o=="function"?(i--,o):void 0,a&&R1t(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++r<i;){var s=n[r];s&&t(e,s,r,o)}return e})}var B1t=Object.prototype;function oy(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||B1t;return t===n}function z1t(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var Y1t="[object Arguments]";function NR(t){return sr(t)&&Qi(t)==Y1t}var IR=Object.prototype,W1t=IR.hasOwnProperty,G1t=IR.propertyIsEnumerable,H1t=NR(function(){return arguments}())?NR:function(t){return sr(t)&&W1t.call(t,"callee")&&!G1t.call(t,"callee")};const Zd=H1t;function U1t(){return!1}var jR=typeof ct=="object"&&ct&&!ct.nodeType&&ct,DR=jR&&typeof module=="object"&&module&&!module.nodeType&&module,V1t=DR&&DR.exports===jR,$R=V1t?wi.Buffer:void 0,X1t=$R?$R.isBuffer:void 0,q1t=X1t||U1t;const Qd=q1t;var K1t="[object Arguments]",Z1t="[object Array]",Q1t="[object Boolean]",J1t="[object Date]",tbt="[object Error]",ebt="[object Function]",nbt="[object Map]",rbt="[object Number]",ibt="[object Object]",obt="[object RegExp]",abt="[object Set]",sbt="[object String]",lbt="[object WeakMap]",cbt="[object ArrayBuffer]",ubt="[object DataView]",fbt="[object Float32Array]",dbt="[object Float64Array]",hbt="[object Int8Array]",pbt="[object Int16Array]",vbt="[object Int32Array]",gbt="[object Uint8Array]",ybt="[object Uint8ClampedArray]",mbt="[object Uint16Array]",bbt="[object Uint32Array]",Ee={};Ee[fbt]=Ee[dbt]=Ee[hbt]=Ee[pbt]=Ee[vbt]=Ee[gbt]=Ee[ybt]=Ee[mbt]=Ee[bbt]=!0,Ee[K1t]=Ee[Z1t]=Ee[cbt]=Ee[Q1t]=Ee[ubt]=Ee[J1t]=Ee[tbt]=Ee[ebt]=Ee[nbt]=Ee[rbt]=Ee[ibt]=Ee[obt]=Ee[abt]=Ee[sbt]=Ee[lbt]=!1;function xbt(t){return sr(t)&&A_(t.length)&&!!Ee[Qi(t)]}function C_(t){return function(e){return t(e)}}var FR=typeof ct=="object"&&ct&&!ct.nodeType&&ct,Jd=FR&&typeof module=="object"&&module&&!module.nodeType&&module,wbt=Jd&&Jd.exports===FR,T_=wbt&&fR.process,Obt=function(){try{var t=Jd&&Jd.require&&Jd.require("util").types;return t||T_&&T_.binding&&T_.binding("util")}catch(e){}}();const qc=Obt;var RR=qc&&qc.isTypedArray,_bt=RR?C_(RR):xbt;const k_=_bt;var Sbt=Object.prototype,Ebt=Sbt.hasOwnProperty;function BR(t,e){var n=Vt(t),r=!n&&Zd(t),i=!n&&!r&&Qd(t),o=!n&&!r&&!i&&k_(t),a=n||r||i||o,s=a?z1t(t.length,String):[],l=s.length;for(var c in t)(e||Ebt.call(t,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||ny(c,l)))&&s.push(c);return s}function zR(t,e){return function(n){return t(e(n))}}var Mbt=zR(Object.keys,Object);const Pbt=Mbt;var Abt=Object.prototype,Cbt=Abt.hasOwnProperty;function Tbt(t){if(!oy(t))return Pbt(t);var e=[];for(var n in Object(t))Cbt.call(t,n)&&n!="constructor"&&e.push(n);return e}function qs(t){return Ba(t)?BR(t):Tbt(t)}var kbt=Object.prototype,Lbt=kbt.hasOwnProperty,Nbt=LR(function(t,e){if(oy(e)||Ba(e)){Xs(e,qs(e),t);return}for(var n in e)Lbt.call(e,n)&&iy(t,n,e[n])});const YR=Nbt;function Ibt(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var jbt=Object.prototype,Dbt=jbt.hasOwnProperty;function $bt(t){if(!Gn(t))return Ibt(t);var e=oy(t),n=[];for(var r in t)r=="constructor"&&(e||!Dbt.call(t,r))||n.push(r);return n}function th(t){return Ba(t)?BR(t,!0):$bt(t)}var Fbt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Rbt=/^\w*$/;function L_(t,e){if(Vt(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||Xd(t)?!0:Rbt.test(t)||!Fbt.test(t)||e!=null&&t in Object(e)}var Bbt=Vs(Object,"create");const eh=Bbt;function zbt(){this.__data__=eh?eh(null):{},this.size=0}function Ybt(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Wbt="__lodash_hash_undefined__",Gbt=Object.prototype,Hbt=Gbt.hasOwnProperty;function Ubt(t){var e=this.__data__;if(eh){var n=e[t];return n===Wbt?void 0:n}return Hbt.call(e,t)?e[t]:void 0}var Vbt=Object.prototype,Xbt=Vbt.hasOwnProperty;function qbt(t){var e=this.__data__;return eh?e[t]!==void 0:Xbt.call(e,t)}var Kbt="__lodash_hash_undefined__";function Zbt(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=eh&&e===void 0?Kbt:e,this}function Ks(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Ks.prototype.clear=zbt,Ks.prototype.delete=Ybt,Ks.prototype.get=Ubt,Ks.prototype.has=qbt,Ks.prototype.set=Zbt;function Qbt(){this.__data__=[],this.size=0}function ay(t,e){for(var n=t.length;n--;)if(Kd(t[n][0],e))return n;return-1}var Jbt=Array.prototype,txt=Jbt.splice;function ext(t){var e=this.__data__,n=ay(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():txt.call(e,n,1),--this.size,!0}function nxt(t){var e=this.__data__,n=ay(e,t);return n<0?void 0:e[n][1]}function rxt(t){return ay(this.__data__,t)>-1}function ixt(t,e){var n=this.__data__,r=ay(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Io(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Io.prototype.clear=Qbt,Io.prototype.delete=ext,Io.prototype.get=nxt,Io.prototype.has=rxt,Io.prototype.set=ixt;var oxt=Vs(wi,"Map");const nh=oxt;function axt(){this.size=0,this.__data__={hash:new Ks,map:new(nh||Io),string:new Ks}}function sxt(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function sy(t,e){var n=t.__data__;return sxt(e)?n[typeof e=="string"?"string":"hash"]:n.map}function lxt(t){var e=sy(this,t).delete(t);return this.size-=e?1:0,e}function cxt(t){return sy(this,t).get(t)}function uxt(t){return sy(this,t).has(t)}function fxt(t,e){var n=sy(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function jo(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}jo.prototype.clear=axt,jo.prototype.delete=lxt,jo.prototype.get=cxt,jo.prototype.has=uxt,jo.prototype.set=fxt;var dxt="Expected a function";function N_(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(dxt);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(N_.Cache||jo),n}N_.Cache=jo;var hxt=500;function pxt(t){var e=N_(t,function(r){return n.size===hxt&&n.clear(),r}),n=e.cache;return e}var vxt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,gxt=/\\(\\)?/g,yxt=pxt(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(vxt,function(n,r,i,o){e.push(i?o.replace(gxt,"$1"):r||n)}),e});const mxt=yxt;function I_(t){return t==null?"":Qg(t)}function Kc(t,e){return Vt(t)?t:L_(t,e)?[t]:mxt(I_(t))}var bxt=1/0;function Zc(t){if(typeof t=="string"||Xd(t))return t;var e=t+"";return e=="0"&&1/t==-bxt?"-0":e}function ly(t,e){e=Kc(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[Zc(e[n++])];return n&&n==r?t:void 0}function ge(t,e,n){var r=t==null?void 0:ly(t,e);return r===void 0?n:r}function j_(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var WR=ti?ti.isConcatSpreadable:void 0;function xxt(t){return Vt(t)||Zd(t)||!!(WR&&t&&t[WR])}function GR(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=xxt),i||(i=[]);++o<a;){var s=t[o];e>0&&n(s)?e>1?GR(s,e-1,n,r,i):j_(i,s):r||(i[i.length]=s)}return i}function wxt(t){var e=t==null?0:t.length;return e?GR(t,1):[]}function D_(t){return AR(kR(t,void 0,wxt),t+"")}var Oxt=zR(Object.getPrototypeOf,Object);const $_=Oxt;var _xt="[object Object]",Sxt=Function.prototype,Ext=Object.prototype,HR=Sxt.toString,Mxt=Ext.hasOwnProperty,Pxt=HR.call(Object);function F_(t){if(!sr(t)||Qi(t)!=_xt)return!1;var e=$_(t);if(e===null)return!0;var n=Mxt.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&HR.call(n)==Pxt}function Axt(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r<i;)o[r]=t[r+e];return o}var Cxt=wi.isFinite,Txt=Math.min;function kxt(t){var e=Math[t];return function(n,r){if(n=mR(n),r=r==null?0:Txt(xR(r),292),r&&Cxt(n)){var i=(I_(n)+"e").split("e"),o=e(i[0]+"e"+(+i[1]+r));return i=(I_(o)+"e").split("e"),+(i[0]+"e"+(+i[1]-r))}return e(n)}}var Lxt=kxt("ceil");const Nxt=Lxt;function Ixt(){this.__data__=new Io,this.size=0}function jxt(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function Dxt(t){return this.__data__.get(t)}function $xt(t){return this.__data__.has(t)}var Fxt=200;function Rxt(t,e){var n=this.__data__;if(n instanceof Io){var r=n.__data__;if(!nh||r.length<Fxt-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new jo(r)}return n.set(t,e),this.size=n.size,this}function Oi(t){var e=this.__data__=new Io(t);this.size=e.size}Oi.prototype.clear=Ixt,Oi.prototype.delete=jxt,Oi.prototype.get=Dxt,Oi.prototype.has=$xt,Oi.prototype.set=Rxt;function Bxt(t,e){return t&&Xs(e,qs(e),t)}function zxt(t,e){return t&&Xs(e,th(e),t)}var UR=typeof ct=="object"&&ct&&!ct.nodeType&&ct,VR=UR&&typeof module=="object"&&module&&!module.nodeType&&module,Yxt=VR&&VR.exports===UR,XR=Yxt?wi.Buffer:void 0,qR=XR?XR.allocUnsafe:void 0;function KR(t,e){if(e)return t.slice();var n=t.length,r=qR?qR(n):new t.constructor(n);return t.copy(r),r}function Wxt(t,e){for(var n=-1,r=t==null?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}function ZR(){return[]}var Gxt=Object.prototype,Hxt=Gxt.propertyIsEnumerable,QR=Object.getOwnPropertySymbols,Uxt=QR?function(t){return t==null?[]:(t=Object(t),Wxt(QR(t),function(e){return Hxt.call(t,e)}))}:ZR;const R_=Uxt;function Vxt(t,e){return Xs(t,R_(t),e)}var Xxt=Object.getOwnPropertySymbols,qxt=Xxt?function(t){for(var e=[];t;)j_(e,R_(t)),t=$_(t);return e}:ZR;const JR=qxt;function Kxt(t,e){return Xs(t,JR(t),e)}function t9(t,e,n){var r=e(t);return Vt(t)?r:j_(r,n(t))}function B_(t){return t9(t,qs,R_)}function e9(t){return t9(t,th,JR)}var Zxt=Vs(wi,"DataView");const z_=Zxt;var Qxt=Vs(wi,"Promise");const Y_=Qxt;var Jxt=Vs(wi,"Set");const Qc=Jxt;var n9="[object Map]",t2t="[object Object]",r9="[object Promise]",i9="[object Set]",o9="[object WeakMap]",a9="[object DataView]",e2t=Us(z_),n2t=Us(nh),r2t=Us(Y_),i2t=Us(Qc),o2t=Us(qd),Zs=Qi;(z_&&Zs(new z_(new ArrayBuffer(1)))!=a9||nh&&Zs(new nh)!=n9||Y_&&Zs(Y_.resolve())!=r9||Qc&&Zs(new Qc)!=i9||qd&&Zs(new qd)!=o9)&&(Zs=function(t){var e=Qi(t),n=e==t2t?t.constructor:void 0,r=n?Us(n):"";if(r)switch(r){case e2t:return a9;case n2t:return n9;case r2t:return r9;case i2t:return i9;case o2t:return o9}return e});const rh=Zs;var a2t=Object.prototype,s2t=a2t.hasOwnProperty;function l2t(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&s2t.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var c2t=wi.Uint8Array;const cy=c2t;function W_(t){var e=new t.constructor(t.byteLength);return new cy(e).set(new cy(t)),e}function u2t(t,e){var n=e?W_(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var f2t=/\w*$/;function d2t(t){var e=new t.constructor(t.source,f2t.exec(t));return e.lastIndex=t.lastIndex,e}var s9=ti?ti.prototype:void 0,l9=s9?s9.valueOf:void 0;function h2t(t){return l9?Object(l9.call(t)):{}}function c9(t,e){var n=e?W_(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var p2t="[object Boolean]",v2t="[object Date]",g2t="[object Map]",y2t="[object Number]",m2t="[object RegExp]",b2t="[object Set]",x2t="[object String]",w2t="[object Symbol]",O2t="[object ArrayBuffer]",_2t="[object DataView]",S2t="[object Float32Array]",E2t="[object Float64Array]",M2t="[object Int8Array]",P2t="[object Int16Array]",A2t="[object Int32Array]",C2t="[object Uint8Array]",T2t="[object Uint8ClampedArray]",k2t="[object Uint16Array]",L2t="[object Uint32Array]";function N2t(t,e,n){var r=t.constructor;switch(e){case O2t:return W_(t);case p2t:case v2t:return new r(+t);case _2t:return u2t(t,n);case S2t:case E2t:case M2t:case P2t:case A2t:case C2t:case T2t:case k2t:case L2t:return c9(t,n);case g2t:return new r;case y2t:case x2t:return new r(t);case m2t:return d2t(t);case b2t:return new r;case w2t:return h2t(t)}}function u9(t){return typeof t.constructor=="function"&&!oy(t)?E_($_(t)):{}}var I2t="[object Map]";function j2t(t){return sr(t)&&rh(t)==I2t}var f9=qc&&qc.isMap,D2t=f9?C_(f9):j2t;const $2t=D2t;var F2t="[object Set]";function R2t(t){return sr(t)&&rh(t)==F2t}var d9=qc&&qc.isSet,B2t=d9?C_(d9):R2t;const z2t=B2t;var Y2t=1,W2t=2,G2t=4,h9="[object Arguments]",H2t="[object Array]",U2t="[object Boolean]",V2t="[object Date]",X2t="[object Error]",p9="[object Function]",q2t="[object GeneratorFunction]",K2t="[object Map]",Z2t="[object Number]",v9="[object Object]",Q2t="[object RegExp]",J2t="[object Set]",twt="[object String]",ewt="[object Symbol]",nwt="[object WeakMap]",rwt="[object ArrayBuffer]",iwt="[object DataView]",owt="[object Float32Array]",awt="[object Float64Array]",swt="[object Int8Array]",lwt="[object Int16Array]",cwt="[object Int32Array]",uwt="[object Uint8Array]",fwt="[object Uint8ClampedArray]",dwt="[object Uint16Array]",hwt="[object Uint32Array]",ye={};ye[h9]=ye[H2t]=ye[rwt]=ye[iwt]=ye[U2t]=ye[V2t]=ye[owt]=ye[awt]=ye[swt]=ye[lwt]=ye[cwt]=ye[K2t]=ye[Z2t]=ye[v9]=ye[Q2t]=ye[J2t]=ye[twt]=ye[ewt]=ye[uwt]=ye[fwt]=ye[dwt]=ye[hwt]=!0,ye[X2t]=ye[p9]=ye[nwt]=!1;function ih(t,e,n,r,i,o){var a,s=e&Y2t,l=e&W2t,c=e&G2t;if(n&&(a=i?n(t,r,i,o):n(t)),a!==void 0)return a;if(!Gn(t))return t;var u=Vt(t);if(u){if(a=l2t(t),!s)return P_(t,a)}else{var f=rh(t),d=f==p9||f==q2t;if(Qd(t))return KR(t,s);if(f==v9||f==h9||d&&!i){if(a=l||d?{}:u9(t),!s)return l?Kxt(t,zxt(a,t)):Vxt(t,Bxt(a,t))}else{if(!ye[f])return i?t:{};a=N2t(t,f,s)}}o||(o=new Oi);var h=o.get(t);if(h)return h;o.set(t,a),z2t(t)?t.forEach(function(g){a.add(ih(g,e,n,g,t,o))}):$2t(t)&&t.forEach(function(g,y){a.set(y,ih(g,e,n,y,t,o))});var p=c?l?e9:B_:l?th:qs,v=u?void 0:p(t);return A1t(v||t,function(g,y){v&&(y=g,g=t[y]),iy(a,y,ih(g,e,n,y,t,o))}),a}var pwt=1,vwt=4;function g9(t){return ih(t,pwt|vwt)}var gwt="__lodash_hash_undefined__";function ywt(t){return this.__data__.set(t,gwt),this}function mwt(t){return this.__data__.has(t)}function oh(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new jo;++e<n;)this.add(t[e])}oh.prototype.add=oh.prototype.push=ywt,oh.prototype.has=mwt;function bwt(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function y9(t,e){return t.has(e)}var xwt=1,wwt=2;function m9(t,e,n,r,i,o){var a=n&xwt,s=t.length,l=e.length;if(s!=l&&!(a&&l>s))return!1;var c=o.get(t),u=o.get(e);if(c&&u)return c==e&&u==t;var f=-1,d=!0,h=n&wwt?new oh:void 0;for(o.set(t,e),o.set(e,t);++f<s;){var p=t[f],v=e[f];if(r)var g=a?r(v,p,f,e,t,o):r(p,v,f,t,e,o);if(g!==void 0){if(g)continue;d=!1;break}if(h){if(!bwt(e,function(y,m){if(!y9(h,m)&&(p===y||i(p,y,n,r,o)))return h.push(m)})){d=!1;break}}else if(!(p===v||i(p,v,n,r,o))){d=!1;break}}return o.delete(t),o.delete(e),d}function Owt(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function G_(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var _wt=1,Swt=2,Ewt="[object Boolean]",Mwt="[object Date]",Pwt="[object Error]",Awt="[object Map]",Cwt="[object Number]",Twt="[object RegExp]",kwt="[object Set]",Lwt="[object String]",Nwt="[object Symbol]",Iwt="[object ArrayBuffer]",jwt="[object DataView]",b9=ti?ti.prototype:void 0,H_=b9?b9.valueOf:void 0;function Dwt(t,e,n,r,i,o,a){switch(n){case jwt:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Iwt:return!(t.byteLength!=e.byteLength||!o(new cy(t),new cy(e)));case Ewt:case Mwt:case Cwt:return Kd(+t,+e);case Pwt:return t.name==e.name&&t.message==e.message;case Twt:case Lwt:return t==e+"";case Awt:var s=Owt;case kwt:var l=r&_wt;if(s||(s=G_),t.size!=e.size&&!l)return!1;var c=a.get(t);if(c)return c==e;r|=Swt,a.set(t,e);var u=m9(s(t),s(e),r,i,o,a);return a.delete(t),u;case Nwt:if(H_)return H_.call(t)==H_.call(e)}return!1}var $wt=1,Fwt=Object.prototype,Rwt=Fwt.hasOwnProperty;function Bwt(t,e,n,r,i,o){var a=n&$wt,s=B_(t),l=s.length,c=B_(e),u=c.length;if(l!=u&&!a)return!1;for(var f=l;f--;){var d=s[f];if(!(a?d in e:Rwt.call(e,d)))return!1}var h=o.get(t),p=o.get(e);if(h&&p)return h==e&&p==t;var v=!0;o.set(t,e),o.set(e,t);for(var g=a;++f<l;){d=s[f];var y=t[d],m=e[d];if(r)var b=a?r(m,y,d,e,t,o):r(y,m,d,t,e,o);if(!(b===void 0?y===m||i(y,m,n,r,o):b)){v=!1;break}g||(g=d=="constructor")}if(v&&!g){var x=t.constructor,w=e.constructor;x!=w&&"constructor"in t&&"constructor"in e&&!(typeof x=="function"&&x instanceof x&&typeof w=="function"&&w instanceof w)&&(v=!1)}return o.delete(t),o.delete(e),v}var zwt=1,x9="[object Arguments]",w9="[object Array]",uy="[object Object]",Ywt=Object.prototype,O9=Ywt.hasOwnProperty;function Wwt(t,e,n,r,i,o){var a=Vt(t),s=Vt(e),l=a?w9:rh(t),c=s?w9:rh(e);l=l==x9?uy:l,c=c==x9?uy:c;var u=l==uy,f=c==uy,d=l==c;if(d&&Qd(t)){if(!Qd(e))return!1;a=!0,u=!1}if(d&&!u)return o||(o=new Oi),a||k_(t)?m9(t,e,n,r,i,o):Dwt(t,e,l,n,r,i,o);if(!(n&zwt)){var h=u&&O9.call(t,"__wrapped__"),p=f&&O9.call(e,"__wrapped__");if(h||p){var v=h?t.value():t,g=p?e.value():e;return o||(o=new Oi),i(v,g,n,r,o)}}return d?(o||(o=new Oi),Bwt(t,e,n,r,i,o)):!1}function fy(t,e,n,r,i){return t===e?!0:t==null||e==null||!sr(t)&&!sr(e)?t!==t&&e!==e:Wwt(t,e,n,r,fy,i)}var Gwt=1,Hwt=2;function Uwt(t,e,n,r){var i=n.length,o=i,a=!r;if(t==null)return!o;for(t=Object(t);i--;){var s=n[i];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<o;){s=n[i];var l=s[0],c=t[l],u=s[1];if(a&&s[2]){if(c===void 0&&!(l in t))return!1}else{var f=new Oi;if(r)var d=r(c,u,l,t,e,f);if(!(d===void 0?fy(u,c,Gwt|Hwt,r,f):d))return!1}}return!0}function _9(t){return t===t&&!Gn(t)}function Vwt(t){for(var e=qs(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,_9(i)]}return e}function S9(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function Xwt(t){var e=Vwt(t);return e.length==1&&e[0][2]?S9(e[0][0],e[0][1]):function(n){return n===t||Uwt(n,t,e)}}function qwt(t,e){return t!=null&&e in Object(t)}function Kwt(t,e,n){e=Kc(e,t);for(var r=-1,i=e.length,o=!1;++r<i;){var a=Zc(e[r]);if(!(o=t!=null&&n(t,a)))break;t=t[a]}return o||++r!=i?o:(i=t==null?0:t.length,!!i&&A_(i)&&ny(a,i)&&(Vt(t)||Zd(t)))}function E9(t,e){return t!=null&&Kwt(t,e,qwt)}var Zwt=1,Qwt=2;function Jwt(t,e){return L_(t)&&_9(e)?S9(Zc(t),e):function(n){var r=ge(n,t);return r===void 0&&r===e?E9(n,t):fy(e,r,Zwt|Qwt)}}function tOt(t){return function(e){return e==null?void 0:e[t]}}function eOt(t){return function(e){return ly(e,t)}}function nOt(t){return L_(t)?tOt(Zc(t)):eOt(t)}function U_(t){return typeof t=="function"?t:t==null?__:typeof t=="object"?Vt(t)?Jwt(t[0],t[1]):Xwt(t):nOt(t)}function rOt(t,e,n,r){for(var i=-1,o=t==null?0:t.length;++i<o;){var a=t[i];e(r,a,n(a),t)}return r}function iOt(t){return function(e,n,r){for(var i=-1,o=Object(e),a=r(e),s=a.length;s--;){var l=a[t?s:++i];if(n(o[l],l,o)===!1)break}return e}}var oOt=iOt();const M9=oOt;function aOt(t,e){return t&&M9(t,e,qs)}function sOt(t,e){return function(n,r){if(n==null)return n;if(!Ba(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=Object(n);(e?o--:++o<i)&&r(a[o],o,a)!==!1;);return n}}var lOt=sOt(aOt);const P9=lOt;function cOt(t,e,n,r){return P9(t,function(i,o,a){e(r,i,n(i),a)}),r}function uOt(t,e){return function(n,r){var i=Vt(n)?rOt:cOt,o=e?e():{};return i(n,t,U_(r),o)}}function V_(t,e,n){(n!==void 0&&!Kd(t[e],n)||n===void 0&&!(e in t))&&ry(t,e,n)}function fOt(t){return sr(t)&&Ba(t)}function X_(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function dOt(t){return Xs(t,th(t))}function hOt(t,e,n,r,i,o,a){var s=X_(t,n),l=X_(e,n),c=a.get(l);if(c){V_(t,n,c);return}var u=o?o(s,l,n+"",t,e,a):void 0,f=u===void 0;if(f){var d=Vt(l),h=!d&&Qd(l),p=!d&&!h&&k_(l);u=l,d||h||p?Vt(s)?u=s:fOt(s)?u=P_(s):h?(f=!1,u=KR(l,!0)):p?(f=!1,u=c9(l,!0)):u=[]:F_(l)||Zd(l)?(u=s,Zd(s)?u=dOt(s):(!Gn(s)||Vc(s))&&(u=u9(l))):f=!1}f&&(a.set(l,u),i(u,l,r,o,a),a.delete(l)),V_(t,n,u)}function A9(t,e,n,r,i){t!==e&&M9(e,function(o,a){if(i||(i=new Oi),Gn(o))hOt(t,e,a,n,A9,r,i);else{var s=r?r(X_(t,a),o,a+"",t,e,i):void 0;s===void 0&&(s=o),V_(t,a,s)}},th)}var pOt=LR(function(t,e,n,r){A9(t,e,n,r)});const vOt=pOt;function gOt(t,e,n){for(var r=-1,i=t==null?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function yOt(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var mOt=Imt(function(t,e){return t/e},1);const bOt=mOt;function xOt(t,e){var n=-1,r=Ba(t)?Array(t.length):[];return P9(t,function(i,o,a){r[++n]=e(i,o,a)}),r}function Jc(t,e){var n=Vt(t)?Zg:xOt;return n(t,U_(e))}var wOt="Expected a function",OOt=8,_Ot=32,SOt=128,EOt=256;function MOt(t){return D_(function(e){var n=e.length,r=n,i=Ra.prototype.thru;for(t&&e.reverse();r--;){var o=e[r];if(typeof o!="function")throw new TypeError(wOt);if(i&&!a&&Jg(o)=="wrapper")var a=new Ra([],!0)}for(r=a?r:n;++r<n;){o=e[r];var s=Jg(o),l=s=="wrapper"?ER(o):void 0;l&&PR(l[0])&&l[1]==(SOt|OOt|_Ot|EOt)&&!l[4].length&&l[9]==1?a=a[Jg(l[0])].apply(a,l[3]):a=o.length==1&&PR(o)?a[s]():a.thru(o)}return function(){var c=arguments,u=c[0];if(a&&c.length==1&&Vt(u))return a.plant(u).value();for(var f=0,d=n?e[f].apply(this,c):u;++f<n;)d=e[f].call(this,d);return d}})}var POt=MOt();const zt=POt;var AOt=Object.prototype,COt=AOt.hasOwnProperty,TOt=uOt(function(t,e,n){COt.call(t,n)?t[n].push(e):ry(t,n,[e])});const C9=TOt;var kOt="[object String]";function T9(t){return typeof t=="string"||!Vt(t)&&sr(t)&&Qi(t)==kOt}function LOt(t,e){return Zg(e,function(n){return t[n]})}function NOt(t){return t==null?[]:LOt(t,qs(t))}var IOt=Math.max;function jOt(t,e,n,r){t=Ba(t)?t:NOt(t),n=n&&!r?xR(n):0;var i=t.length;return n<0&&(n=IOt(i+n,0)),T9(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&CR(t,e,n)>-1}function DOt(t,e){return e.length<2?t:ly(t,Axt(e,0,-1))}var $Ot="[object Boolean]";function q_(t){return t===!0||t===!1||sr(t)&&Qi(t)==$Ot}function k9(t,e){return fy(t,e)}var FOt="[object Number]";function tu(t){return typeof t=="number"||sr(t)&&Qi(t)==FOt}function ROt(t){return t==null}function BOt(t){return t===void 0}function zOt(t,e){return e=Kc(e,t),t=DOt(t,e),t==null||delete t[Zc(yOt(e))]}function YOt(t){return F_(t)?void 0:t}var WOt=1,GOt=2,HOt=4,UOt=D_(function(t,e){var n={};if(t==null)return n;var r=!1;e=Zg(e,function(o){return o=Kc(o,t),r||(r=o.length>1),o}),Xs(t,e9(t),n),r&&(n=ih(n,WOt|GOt|HOt,YOt));for(var i=e.length;i--;)zOt(n,e[i]);return n});const K_=UOt;function L9(t,e,n,r){if(!Gn(t))return t;e=Kc(e,t);for(var i=-1,o=e.length,a=o-1,s=t;s!=null&&++i<o;){var l=Zc(e[i]),c=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(i!=a){var u=s[l];c=r?r(u,l,s):void 0,c===void 0&&(c=Gn(u)?u:ny(e[i+1])?[]:{})}iy(s,l,c),s=s[l]}return t}function VOt(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var a=e[r],s=ly(t,a);n(s,a)&&L9(o,Kc(a,t),s)}return o}function XOt(t,e){return VOt(t,e,function(n,r){return E9(t,r)})}var qOt=D_(function(t,e){return t==null?{}:XOt(t,e)});const N9=qOt;function ht(t,e,n){return t==null?t:L9(t,e,n)}var KOt=1/0,ZOt=Qc&&1/G_(new Qc([,-0]))[1]==KOt?function(t){return new Qc(t)}:SR;const QOt=ZOt;var JOt=200;function t_t(t,e,n){var r=-1,i=L1t,o=t.length,a=!0,s=[],l=s;if(n)a=!1,i=gOt;else if(o>=JOt){var c=e?null:QOt(t);if(c)return G_(c);a=!1,i=y9,l=new oh}else l=e?[]:s;t:for(;++r<o;){var u=t[r],f=e?e(u):u;if(u=n||u!==0?u:0,a&&f===f){for(var d=l.length;d--;)if(l[d]===f)continue t;e&&l.push(f),s.push(u)}else i(l,f,n)||(l!==s&&l.push(f),s.push(u))}return s}function Z_(t,e){return t&&t.length?t_t(t,U_(e)):[]}var e_t=function(t){var e=/react|\.jsx|children:\[\(|return\s+[A-Za-z0-9].createElement\((?!['"][g|circle|ellipse|image|rect|line|polyline|polygon|text|path|html|mesh]['"])([^\)])*,/i;return e.test(t)},Q_=function(){return Q_=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Q_.apply(this,arguments)},I9=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function n_t(t,e){var n=q.useRef(),r=q.useRef(),i=q.useRef(null),o=e.onReady,a=e.onEvent,s=function(u,f){var d;u===void 0&&(u="image/png");var h=(d=i.current)===null||d===void 0?void 0:d.getElementsByTagName("canvas")[0];return h==null?void 0:h.toDataURL(u,f)},l=function(u,f,d){u===void 0&&(u="download"),f===void 0&&(f="image/png");var h=u;u.indexOf(".")===-1&&(h="".concat(u,".").concat(f.split("/")[1]));var p=s(f,d),v=document.createElement("a");return v.href=p,v.download=h,document.body.appendChild(v),v.click(),document.body.removeChild(v),v=null,h},c=function(u,f){f===void 0&&(f=!1);var d=Object.keys(u),h=f;d.forEach(function(p){var v=u[p];p==="tooltip"&&(h=!0),Vc(v)&&e_t("".concat(v))?u[p]=function(){for(var g=[],y=0;y<arguments.length;y++)g[y]=arguments[y];return hmt(v.apply(void 0,g),h)}:Vt(v)?v.forEach(function(g){c(g,h)}):Gn(v)?c(v,h):h=f})};return q.useEffect(function(){if(n.current&&!k9(r.current,e)){var u=!1;if(r.current){var f=r.current;f.data;var d=I9(f,["data"]);e.data;var h=I9(e,["data"]);u=k9(d,h)}r.current=g9(e),u?n.current.changeData(ge(e,"data")):(c(e),n.current.update(e),n.current.render())}},[e]),q.useEffect(function(){if(!i.current)return function(){return null};r.current||(r.current=g9(e)),c(e);var u=new t(i.current,Q_({},e));u.toDataURL=s,u.downloadImage=l,u.render(),n.current=u,o&&o(u);var f=function(d){a&&a(u,d)};return u.on("*",f),function(){n.current&&(n.current.destroy(),n.current.off("*",f),n.current=void 0)}},[]),{chart:n,container:i}}var r_t=function(t){return t!==null&&typeof t!="function"&&isFinite(t.length)};const j9=r_t;var i_t=function(t,e){if(!j9(t))return t;for(var n=[],r=0;r<t.length;r++){var i=t[r];e(i,r)&&n.push(i)}return n};const o_t=i_t,a_t=function(t){return typeof t=="function"};var s_t=function(t){return t==null};const l_t=s_t;var c_t={}.toString,u_t=function(t,e){return c_t.call(t)==="[object "+e+"]"};const J_=u_t,eu=function(t){return Array.isArray?Array.isArray(t):J_(t,"Array")},f_t=function(t){var e=typeof t;return t!==null&&e==="object"||e==="function"};function tS(t,e){if(t){var n;if(eu(t))for(var r=0,i=t.length;r<i&&(n=e(t[r],r),n!==!1);r++);else if(f_t(t)){for(var o in t)if(t.hasOwnProperty(o)&&(n=e(t[o],o),n===!1))break}}}var d_t=Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];return tS(t,function(n,r){a_t(t)&&r==="prototype"||e.push(r)}),e};const h_t=d_t;var p_t=function(t){return typeof t=="object"&&t!==null};const v_t=p_t;var g_t=function(t){if(!v_t(t)||!J_(t,"Object"))return!1;if(Object.getPrototypeOf(t)===null)return!0;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};const dy=g_t;var y_t=function(t,e,n){if(!eu(t)&&!dy(t))return t;var r=n;return tS(t,function(i,o){r=e(r,i,o)}),r};const m_t=y_t,eS=function(t){return J_(t,"String")};function nS(t,e){for(var n in e)e.hasOwnProperty(n)&&n!=="constructor"&&e[n]!==void 0&&(t[n]=e[n])}function b_t(t,e,n,r){return e&&nS(t,e),n&&nS(t,n),r&&nS(t,r),t}var x_t=5;function w_t(t,e){if(Object.hasOwn)return Object.hasOwn(t,e);if(t==null)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(t),e)}function D9(t,e,n,r){n=n||0,r=r||x_t;for(var i in e)if(w_t(e,i)){var o=e[i];o!==null&&dy(o)?(dy(t[i])||(t[i]={}),n<r?D9(t[i],o,n+1,r):t[i]=e[i]):eu(o)?(t[i]=[],t[i]=t[i].concat(o)):o!==void 0&&(t[i]=o)}}var O_t=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)D9(t,e[r]);return t};const hy=O_t,Ji=function(t,e,n){for(var r=0,i=eS(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return t===void 0||r<i.length?n:t};var __t=Object.prototype.hasOwnProperty;const $9=function(t,e){if(t===null||!dy(t))return{};var n={};return tS(e,function(r){__t.call(t,r)&&(n[r]=t[r])}),n};function S_t(t){return l_t(t)?0:j9(t)?t.length:Object.keys(t).length}const E_t={field:"value",size:[1,1],round:!1,padding:0,sort:(t,e)=>e.value-t.value,as:["x","y"],ignoreParentValue:!0},M_t="nodeIndex",ah="childNodeCount",P_t="nodeAncestor",rS="Invalid field: it must be a string!";function A_t(t,e){const{field:n,fields:r}=t;if(eS(n))return n;if(eu(n))return console.warn(rS),n[0];if(console.warn(`${rS} will try to get fields instead.`),eS(r))return r;if(eu(r)&&r.length)return r[0];if(e)return e;throw new TypeError(rS)}function C_t(t){const e=[];if(t&&t.each){let n,r;t.each(i=>{var o,a;i.parent!==n?(n=i.parent,r=0):r+=1;const s=o_t((((o=i.ancestors)===null||o===void 0?void 0:o.call(i))||[]).map(l=>e.find(c=>c.name===l.name)||l),({depth:l})=>l>0&&l<i.depth);i[P_t]=s,i[ah]=((a=i.children)===null||a===void 0?void 0:a.length)||0,i[M_t]=r,e.push(i)})}else t&&t.eachNode&&t.eachNode(n=>{e.push(n)});return e}function T_t(t,e){e=b_t({},E_t,e);const n=e.as;if(!eu(n)||n.length!==2)throw new TypeError('Invalid as: it must be an array with 2 strings (e.g. [ "x", "y" ])!');let r;try{r=A_t(e)}catch(l){console.warn(l)}const o=(l=>prt().size(e.size).round(e.round).padding(e.padding)(Wl(l).sum(c=>S_t(c.children)?e.ignoreParentValue?0:c[r]-m_t(c.children,(u,f)=>u+f[r],0):c[r]).sort(e.sort)))(t),a=n[0],s=n[1];return o.each(l=>{var c,u;l[a]=[l.x0,l.x1,l.x1,l.x0],l[s]=[l.y1,l.y1,l.y0,l.y0],l.name=l.name||((c=l.data)===null||c===void 0?void 0:c.name)||((u=l.data)===null||u===void 0?void 0:u.label),l.data.name=l.name,["x0","x1","y0","y1"].forEach(f=>{n.indexOf(f)===-1&&delete l[f]})}),C_t(o)}var k_t=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const nu="sunburst",iS="markType",F9="path",py="ancestor-node";function L_t(t){const{data:e,encode:n}=t,{color:r,value:i}=n,a=T_t(e,{field:i,type:"hierarchy.partition",as:["x","y"]}),s=[];return a.forEach(l=>{var c,u,f,d;if(l.depth===0)return null;let h=l.data.name;const p=[h];let v=Object.assign({},l);for(;v.depth>1;)h=`${(c=v.parent.data)===null||c===void 0?void 0:c.name} / ${h}`,p.unshift((u=v.parent.data)===null||u===void 0?void 0:u.name),v=v.parent;const g=Object.assign(Object.assign(Object.assign({},$9(l.data,[i])),{[F9]:h,[py]:v.data.name}),l);r&&r!==py&&(g[r]=l.data[r]||((d=(f=l.parent)===null||f===void 0?void 0:f.data)===null||d===void 0?void 0:d[r])),s.push(g)}),s.map(l=>Object.assign(Object.assign({},l),{x:l.x.slice(0,2),y:[l.y[2],l.y[0]],fillOpacity:Math.pow(.85,l.depth)}))}const R9={id:nu,encode:{x:"x",y:"y",key:F9,color:py,value:"value"},axis:{x:!1,y:!1},style:{[iS]:nu,stroke:"#fff",lineWidth:.5,fillOpacity:"fillOpacity",[ah]:ah,depth:"depth"},state:{active:{zIndex:2,stroke:"#000"},inactive:{zIndex:1,stroke:"#fff"}},legend:!1,interaction:{drillDown:!0},coordinate:{type:"polar",innerRadius:.2}},B9=t=>{const{encode:e,data:n=[],legend:r}=t,i=k_t(t,["encode","data","legend"]),o=Object.assign(Object.assign({},i.coordinate),{innerRadius:Math.max(Ji(i,["coordinate","innerRadius"],.2),1e-5)}),a=Object.assign(Object.assign({},R9.encode),e),{value:s}=a,l=L_t({encode:a,data:n});return[hy({},R9,Object.assign(Object.assign({type:"rect",data:l,encode:a,tooltip:{title:"path",items:[c=>({name:s,value:c[s]})]}},i),{coordinate:o}))]};B9.props={};var N_t=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?o(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})};const I_t=t=>t.querySelectorAll(".element").filter(e=>Ji(e,["style",iS])===nu);function j_t(t){return gt(t).select(`.${Nf}`).node()}const D_t={rootText:"root",style:{fill:"rgba(0, 0, 0, 0.85)",fontSize:12,y:1},active:{fill:"rgba(0, 0, 0, 0.5)"}};function $_t(t={}){const{breadCrumb:e={},fixedColor:n=!0}=t,r=hy({},D_t,e);return i=>{const{update:o,setState:a,container:s,view:l,options:c}=i,u=j_t(s),f=c.marks.find(({id:m})=>m===nu),{state:d}=f,h=new sn;u.appendChild(h);const p=(m,b)=>N_t(this,void 0,void 0,function*(){if(h.removeChildren(),m){const x=new jr({style:Object.assign({x:0,text:r.rootText,depth:0},r.style)});h.appendChild(x);let w="";const O=m==null?void 0:m.split(" / ");let _=r.style.y,S=h.getBBox().width;const E=u.getBBox().width,M=O.map((P,C)=>{const A=new jr({style:Object.assign(Object.assign({x:S,text:" / "},r.style),{y:_})});h.appendChild(A),S+=A.getBBox().width,w=`${w}${P} / `;const T=new jr({name:w.replace(/\s\/\s$/,""),style:Object.assign(Object.assign({text:P,x:S,depth:C+1},r.style),{y:_})});return h.appendChild(T),S+=T.getBBox().width,S>E&&(_=h.getBBox().height,S=0,A.attr({x:S,y:_}),S+=A.getBBox().width,T.attr({x:S,y:_}),S+=T.getBBox().width),T});[x,...M].forEach((P,C)=>{if(C===M.length)return;const A=Object.assign({},P.attributes);P.attr("cursor","pointer"),P.addEventListener("mouseenter",()=>{P.attr(r.active)}),P.addEventListener("mouseleave",()=>{P.attr(A)}),P.addEventListener("click",()=>{p(P.name,Ji(P,["style","depth"]))})})}a("drillDown",x=>{const{marks:w}=x,O=w.map(_=>{if(_.id!==nu&&_.type!=="rect")return _;const{data:S}=_,E=Object.fromEntries(["color"].map(P=>[P,{domain:l.scale[P].getOptions().domain}])),M=S.filter(P=>{const C=P.path;return n&&(P[py]=C.split(" / ")[b]),m?new RegExp(`^${m}.+`).test(C):!0});return hy({},_,n?{data:M}:{data:M,scale:E})});return Object.assign(Object.assign({},x),{marks:O})}),yield o()}),v=m=>{const b=m.target;if(Ji(b,["style",iS])!==nu||Ji(b,["markType"])!=="rect"||!Ji(b,["style",ah]))return;const x=Ji(b,["__data__","key"]),w=Ji(b,["style","depth"]);b.style.cursor="pointer",p(x,w)};u.addEventListener("click",v);const g=h_t(Object.assign(Object.assign({},d.active),d.inactive)),y=()=>{I_t(u).forEach(b=>{const x=Ji(b,["style",ah]);if(Ji(b,["style","cursor"])!=="pointer"&&x){b.style.cursor="pointer";const O=$9(b.attributes,g);b.addEventListener("mouseenter",()=>{b.attr(d.active)}),b.addEventListener("mouseleave",()=>{b.attr(hy(O,d.inactive))})}})};return u.addEventListener("mousemove",y),()=>{h.remove(),u.removeEventListener("click",v),u.removeEventListener("mousemove",y)}}}U.enableCSSParsing=!1;function F_t(){return{"interaction.drillDown":$_t,"mark.sunburst":B9}}var vy=function(){return vy=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},vy.apply(this,arguments)},R_t=Avt(ngt,vy(vy({},W$()),F_t())),Xt=function(t){var e=z_t(t),n=e.children,r=n===void 0?[]:n,i=K_(e,[].concat(W9,gy.map(function(c){return c.key}))),o=function(c){var u;return(u=U_t.find(function(f){return f.key===c}))===null||u===void 0?void 0:u.callback},a=function(c,u,f){var d=o(u);d?d(c,u,f):c[u]=za({},c[u],f)},s=function(c){Object.keys(c).forEach(function(u){var f=gy.find(function(p){return p.key===u});if(f){var d=f.type,h=f.extend_keys;d?r.push(l(za({},N9(c,h),{type:d},c[u]))):Vt(c[u])&&c[u].forEach(function(p){r.push(l(p))})}})},l=function(c){return s(c),Object.keys(aS).forEach(function(u){var f=aS[u];if(!BOt(c[u]))if(Gn(f)){var d=f.value,h=f.target,p=d(c[u]);a(c,h,p)}else ht(c,f,c[u])}),c};return r.forEach(function(c){var u=za({},i,c);l(za(c,u))}),s(e),B_t(e),t},z9=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},B_t=function(t){var e=t.children,n=e===void 0?[]:e,r=Object.keys(aS).concat(gy.map(function(i){return i.key}));return r.forEach(function(i){delete t[i]}),n.forEach(function(i){Object.keys(i).forEach(function(o){r.includes(o)&&delete i[o]})}),Object.keys(t).forEach(function(i){z9(z9([],W9,!0),lS.map(function(o){return o.key}),!0).includes(i)||delete t[i]}),t},z_t=function(t){var e=t.options,n=e.children,r=n===void 0?[]:n;return r.forEach(function(i){Object.keys(i).forEach(function(o){Vt(i[o])&&o!=="data"&&(i[o]=i[o].filter(function(a){return!a[oS]}))})}),e},Y9=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Y_t=function(t,e){if(Vt(e))return e},za=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return vOt.apply(void 0,Y9(Y9([],t,!1),[Y_t],!1))},sh=function(){return sh=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},sh.apply(this,arguments)},W_t=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},G_t=["renderer"],W9=["width","height","autoFit","theme","inset","insetLeft","insetRight","insetTop","insetBottom","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","margin","marginTop","marginRight","marginBottom","marginLeft","depth","title","clip","children","type","data","direction"],oS="__transform__",H_t="__skipDelCustomKeys__",Qs=function(t,e){return q_(e)?{type:t,available:e}:sh({type:t},e)},aS={xField:"encode.x",yField:"encode.y",colorField:"encode.color",angleField:"encode.y",keyField:"encode.key",sizeField:"encode.size",shapeField:"encode.shape",seriesField:"encode.series",positionField:"encode.position",textField:"encode.text",valueField:"encode.value",binField:"encode.x",srcField:"encode.src",linkColorField:"encode.linkColor",radius:"coordinate.outerRadius",innerRadius:"coordinate.innerRadius",startAngle:"coordinate.startAngle",endAngle:"coordinate.endAngle",focusX:"coordinate.focusX",focusY:"coordinate.focusY",distortionX:"coordinate.distortionX",distortionY:"coordinate.distortionY",visual:"coordinate.visual",stack:{target:"transform",value:function(t){return Qs("stackY",t)}},normalize:{target:"transform",value:function(t){return Qs("normalizeY",t)}},percent:{target:"transform",value:function(t){return Qs("normalizeY",t)}},group:{target:"transform",value:function(t){return Qs("dodgeX",t)}},sort:{target:"transform",value:function(t){return Qs("sortX",t)}},symmetry:{target:"transform",value:function(t){return Qs("symmetryY",t)}},diff:{target:"transform",value:function(t){return Qs("diffY",t)}},meta:{target:"scale",value:function(t){return t}},label:{target:"labels",value:function(t){return t}},shape:"style.shape",connectNulls:{target:"style",value:function(t){return q_(t)?{connect:t}:t}}},sS=["xField","yField","seriesField","colorField","keyField","positionField","meta","tooltip","animate","stack","normalize","percent","group","sort","symmetry","diff"],gy=[{key:"annotations",extend_keys:[]},{key:"line",type:"line",extend_keys:sS},{key:"point",type:"point",extend_keys:sS},{key:"area",type:"area",extend_keys:sS}],U_t=[{key:"transform",callback:function(t,e,n){var r;t[e]=t[e]||[];var i=n.available,o=i===void 0?!0:i,a=W_t(n,["available"]);o?t[e].push(sh((r={},r[oS]=!0,r),a)):t[e].splice(t[e].indexOf(function(s){return s.type===n.type}),1)}},{key:"labels",callback:function(t,e,n){var r;if(!n||Vt(n)){t[e]=n||[];return}n.text||(n.text=t.yField),t[e]=t[e]||[],t[e].push(sh((r={},r[oS]=!0,r),n))}}],lS=[{key:"conversionTag",shape:"ConversionTag"},{key:"axisText",shape:"BidirectionalBarAxisText"}],V_t=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),yy=function(){return yy=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},yy.apply(this,arguments)},X_t=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},G9=function(t){V_t(e,t);function e(n){n===void 0&&(n={});var r=n.style,i=X_t(n,["style"]);return t.call(this,yy({style:yy({text:"",fontSize:12,textBaseline:"middle",textAlign:"center",fill:"#000",fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1},r)},i))||this}return e}(jr),q_t=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),my=function(){return my=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},my.apply(this,arguments)},K_t=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},Z_t=function(t){q_t(e,t);function e(n){n===void 0&&(n={});var r=n.style,i=K_t(n,["style"]);return t.call(this,my({style:my({fill:"#eee"},r)},i))||this}return e}(of),Q_t=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),H9=function(t){Q_t(e,t);function e(n,r,i){var o=t.call(this,{style:za(i,r)})||this;return o.chart=n,o}return e.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this)},e.prototype.disconnectedCallback=function(){},e.prototype.attributeChangedCallback=function(n){},e.prototype.update=function(n,r){var i;return this.attr(za({},this.attributes,n||{})),(i=this.render)===null||i===void 0?void 0:i.call(this,this.attributes,this,r)},e.prototype.clear=function(){this.removeChildren()},e.prototype.getElementsLayout=function(){var n=this.chart.getContext().canvas,r=n.document.getElementsByClassName("element"),i=[];return r.forEach(function(o){var a=o.getBBox(),s=a.x,l=a.y,c=a.width,u=a.height,f=o.__data__;i.push({bbox:a,x:s,y:l,width:c,height:u,key:f.key,data:f})}),i},e.prototype.bindEvents=function(n,r){},e}(wp),J_t=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),by=function(){return by=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},by.apply(this,arguments)},tSt=function(t){J_t(e,t);function e(n,r){return t.call(this,n,r,{type:e.tag})||this}return e.prototype.getConversionTagLayout=function(){var n=this.direction==="vertical",r=this.getElementsLayout(),i=r[0],o=i.x,a=i.y,s=i.height,l=i.width,c=i.data,u=["items",0,"value"],f=ge(c,u),d=n?r[1].y-a-s:r[1].x-o-l,h=[],p=this.attributes,v=p.size,g=v===void 0?40:v,y=p.arrowSize,m=y===void 0?20:y,b=p.spacing,x=b===void 0?4:b;return r.forEach(function(w,O){if(O>0){var _=w.x,S=w.y,E=w.height,M=w.width,P=w.data,C=w.key,A=ge(P,u),T=g/2;if(n){var k=_+M/2,N=S;h.push({points:[[k+T,N-d+x],[k+T,N-m-x],[k,N-x],[k-T,N-m-x],[k-T,N-d+x]],center:[k,N-d/2-x],width:d,value:[f,A],key:C})}else{var k=_,N=S+E/2;h.push({points:[[_-d+x,N-T],[_-m-x,N-T],[k-x,N],[_-m-x,N+T],[_-d+x,N+T]],center:[k-d/2-x,N],width:d,value:[f,A],key:C})}f=A}}),h},e.prototype.render=function(){this.setDirection(),this.drawConversionTag()},e.prototype.setDirection=function(){var n=this.chart.getCoordinate(),r=ge(n,"options.transformations"),i="horizontal";r.forEach(function(o){o.includes("transpose")&&(i="vertical")}),this.direction=i},e.prototype.drawConversionTag=function(){var n=this,r=this.getConversionTagLayout(),i=this.attributes,o=i.style,a=i.text,s=a.style,l=a.formatter;r.forEach(function(c){var u=c.points,f=c.center,d=c.value,h=c.key,p=d[0],v=d[1],g=f[0],y=f[1],m=new Z_t({style:by({points:u,fill:"#eee"},o),id:"polygon-".concat(h)}),b=new G9({style:by({x:g,y,text:Vc(l)?l(p,v):(v/p*100).toFixed(2)+"%"},s),id:"text-".concat(h)});n.appendChild(m),n.appendChild(b)})},e.prototype.update=function(){var n=this,r=this.getConversionTagLayout();r.forEach(function(i){var o=i.points,a=i.center,s=i.key,l=a[0],c=a[1],u=n.getElementById("polygon-".concat(s)),f=n.getElementById("text-".concat(s));u.setAttribute("points",o),f.setAttribute("x",l),f.setAttribute("y",c)})},e.tag="ConversionTag",e}(H9),cS=32,U9=16,V9=48,eSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),lh=function(){return lh=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},lh.apply(this,arguments)},nSt=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},rSt=function(t){eSt(e,t);function e(n,r){return t.call(this,n,r,{type:e.tag})||this}return e.prototype.render=function(){this.drawText()},e.prototype.getBidirectionalBarAxisTextLayout=function(){var n=this.attributes.layout,r=n==="vertical",i=this.getElementsLayout(),o=r?Z_(i,"x"):Z_(i,"y"),a=["title"],s=[],l=this.chart.getContext().views,c=ge(l,[0,"layout"]),u=c.width,f=c.height;return o.forEach(function(d){var h=d.x,p=d.y,v=d.height,g=d.width,y=d.data,m=d.key,b=ge(y,a);r?s.push({x:h+g/2,y:f,text:b,key:m}):s.push({x:u,y:p+v/2,text:b,key:m})}),Z_(s,"text").length!==s.length&&(s=Object.values(C9(s,"text")).map(function(d){var h,p=d.reduce(function(v,g){return v+(r?g.x:g.y)},0);return lh(lh({},d[0]),(h={},h[r?"x":"y"]=p/d.length,h))})),s},e.prototype.transformLabelStyle=function(n){var r={},i=/^label[A-Z]/;return Object.keys(n).forEach(function(o){i.test(o)&&(r[o.replace("label","").replace(/^[A-Z]/,function(a){return a.toLowerCase()})]=n[o])}),r},e.prototype.drawText=function(){var n=this,r=this.getBidirectionalBarAxisTextLayout(),i=this.attributes,o=i.layout,a=i.labelFormatter,s=nSt(i,["layout","labelFormatter"]);r.forEach(function(l){var c=l.x,u=l.y,f=l.text,d=l.key,h=new G9({style:lh({x:c,y:u,text:Vc(a)?a(f):f,wordWrap:!0,wordWrapWidth:o==="horizontal"?cS*2:120,maxLines:2,textOverflow:"ellipsis"},n.transformLabelStyle(s)),id:"text-".concat(d)});n.appendChild(h)})},e.prototype.update=function(){var n=this,r=this.getBidirectionalBarAxisTextLayout();r.forEach(function(i){var o=i.x,a=i.y,s=i.key,l=n.getElementById("text-".concat(s));l.setAttribute("x",o),l.setAttribute("y",a)})},e.tag="BidirectionalBarAxisText",e}(H9),iSt={ConversionTag:tSt,BidirectionalBarAxisText:rSt},oSt=function(){function t(e,n){this.container=new Map,this.chart=e,this.config=n,this.init()}return t.prototype.init=function(){var e=this;lS.forEach(function(n){var r,i=n.key,o=n.shape,a=e.config[i];if(a){var s=new iSt[o](e.chart,a),l=e.chart.getContext().canvas;l.appendChild(s),e.container.set(i,s)}else(r=e.container.get(i))===null||r===void 0||r.clear()})},t.prototype.update=function(){var e=this;this.container.size&&lS.forEach(function(n){var r=n.key,i=e.container.get(r);i==null||i.update()})},t}(),aSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ru=function(){return ru=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ru.apply(this,arguments)},X9="data-chart-source-type",Rt=function(t){aSt(e,t);function e(n,r){var i=t.call(this)||this;return i.container=typeof n=="string"?document.getElementById(n):n,i.options=i.mergeOption(r),i.createG2(),i.bindEvents(),i}return e.prototype.getChartOptions=function(){return ru(ru({},N9(this.options,G_t)),{container:this.container})},e.prototype.getSpecOptions=function(){return this.type==="base"||this[H_t]?ru(ru({},this.options),this.getChartOptions()):this.options},e.prototype.createG2=function(){if(!this.container)throw Error("The container is not initialized!");this.chart=new R_t(this.getChartOptions()),this.container.setAttribute(X9,"Ant Design Charts")},e.prototype.bindEvents=function(){var n=this;this.chart&&this.chart.on("*",function(r){r!=null&&r.type&&n.emit(r.type,r)})},e.prototype.getBaseOptions=function(){return{type:"view",autoFit:!0}},e.prototype.getDefaultOptions=function(){},e.prototype.render=function(){var n=this;this.type!=="base"&&this.execAdaptor(),this.chart.options(this.getSpecOptions()),this.chart.render().then(function(){n.annotation=new oSt(n.chart,n.options)}),this.bindSizeSensor()},e.prototype.update=function(n){this.options=this.mergeOption(n)},e.prototype.mergeOption=function(n){return za({},this.getBaseOptions(),this.getDefaultOptions(),n)},e.prototype.changeData=function(n){this.chart.changeData(n)},e.prototype.changeSize=function(n,r){this.chart.changeSize(n,r)},e.prototype.destroy=function(){this.chart.destroy(),this.off(),this.container.removeAttribute(X9)},e.prototype.execAdaptor=function(){var n=this.getSchemaAdaptor();n({chart:this.chart,options:this.options})},e.prototype.triggerResize=function(){this.chart.forceFit()},e.prototype.bindSizeSensor=function(){var n=this,r=this.options.autoFit,i=r===void 0?!0:r;i&&this.chart.on(Ut.AFTER_CHANGE_SIZE,function(){n.annotation.update()})},e}(Ax),sSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),lSt=function(t){sSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="base",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"line"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return function(n){return n}},e}(Rt),uS=function(){return uS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},uS.apply(this,arguments)};function cSt(t){var e=t.options,n=e.stack,r=e.tooltip,i=e.xField;if(!n)return t;var o=gy.map(function(s){return s.type}).filter(function(s){return!!s}),a=!1;return o.forEach(function(s){e[s]&&(a=!0,ht(e,[s,"stack"],uS({y1:"y"},typeof n=="object"?n:{})))}),a&&!q_(r)&&!r&&ht(e,"tooltip",{title:i,items:[{channel:"y"}]}),t}function Fe(t){return zt(cSt)(t)}function uSt(t){var e=t.options.layout,n=e===void 0?"horizontal":e;return t.options.coordinate.transform=n!=="horizontal"?void 0:[{type:"transpose"}],t}function fSt(t){uSt(t);var e=t.options.layout,n=e===void 0?"horizontal":e;return t.options.children.forEach(function(r){var i;!((i=r==null?void 0:r.coordinate)===null||i===void 0)&&i.transform&&(r.coordinate.transform=n!=="horizontal"?void 0:[{type:"transpose"}])}),t}function dSt(t){return zt(Fe,Xt)(t)}var hSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),pSt=function(t){hSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="area",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"area"}],scale:{y:{nice:!0}},axis:{y:{title:!1},x:{title:!1}},interaction:{tooltip:{shared:!0}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return dSt},e}(Rt),iu=function(){return iu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},iu.apply(this,arguments)};function q9(t){var e=function(n){var r=n.options;ge(r,"children.length")>1&&ht(r,"children",[{type:"interval"}]);var i=r.scale,o=r.markBackground,a=r.data,s=r.children,l=r.yField,c=ge(i,"y.domain",[]);if(o&&c.length&&Vt(a)){var u="domainMax",f=a.map(function(d){var h;return iu(iu({originData:iu({},d)},K_(d,l)),(h={},h[u]=c[c.length-1],h))});s.unshift(iu({type:"interval",data:f,yField:u,tooltip:!1,style:{fill:"#eee"},label:!1},o))}return n};return zt(e,Fe,Xt)(t)}var vSt=function(){var t=function(e,n){return function(r){var i=e.fill,o=i===void 0?"#2888FF":i,a=e.stroke,s=e.fillOpacity,l=s===void 0?1:s,c=e.strokeOpacity,u=c===void 0?.2:c,f=e.pitch,d=f===void 0?8:f,h=r[0],p=r[1],v=r[2],g=r[3],y=(p[1]-h[1])/2,m=n.document,b=m.createElement("g",{}),x=m.createElement("polygon",{style:{points:[h,[h[0]-d,h[1]+y],[v[0]-d,h[1]+y],g],fill:o,fillOpacity:l,stroke:a,strokeOpacity:u,inset:30}}),w=m.createElement("polygon",{style:{points:[[h[0]-d,h[1]+y],p,v,[v[0]-d,h[1]+y]],fill:o,fillOpacity:l,stroke:a,strokeOpacity:u}}),O=m.createElement("polygon",{style:{points:[h,[h[0]-d,h[1]+y],p,[h[0]+d,h[1]+y]],fill:o,fillOpacity:l-.2}});return b.appendChild(x),b.appendChild(w),b.appendChild(O),b}};H$("shape.interval.bar25D",t)},gSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();vSt();var ySt=function(t){gSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="Bar",n}return e.getDefaultOptions=function(){return{type:"view",coordinate:{transform:[{type:"transpose"}]},children:[{type:"interval"}],scale:{y:{nice:!0}},axis:{y:{title:!1},x:{title:!1}},interaction:{tooltip:{shared:!0},elementHighlightByColor:{background:!0}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return q9},e}(Rt),mSt=function(){var t=function(e,n){return function(r){var i=e.fill,o=i===void 0?"#2888FF":i,a=e.stroke,s=e.fillOpacity,l=s===void 0?1:s,c=e.strokeOpacity,u=c===void 0?.2:c,f=e.pitch,d=f===void 0?8:f,h=r[1][0]-r[0][0],p=h/2+r[0][0],v=n.document,g=v.createElement("g",{}),y=v.createElement("polygon",{style:{points:[[r[0][0],r[0][1]],[p,r[1][1]+d],[p,r[3][1]+d],[r[3][0],r[3][1]]],fill:o,fillOpacity:l,stroke:a,strokeOpacity:u,inset:30}}),m=v.createElement("polygon",{style:{points:[[p,r[1][1]+d],[r[1][0],r[1][1]],[r[2][0],r[2][1]],[p,r[2][1]+d]],fill:o,fillOpacity:l,stroke:a,strokeOpacity:u}}),b=v.createElement("polygon",{style:{points:[[r[0][0],r[0][1]],[p,r[1][1]-d],[r[1][0],r[1][1]],[p,r[1][1]+d]],fill:o,fillOpacity:l-.2}});return g.appendChild(m),g.appendChild(y),g.appendChild(b),g}};H$("shape.interval.column25D",t)},bSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();mSt();var xSt=function(t){bSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="column",n}return e.getDefaultOptions=function(){return{type:"view",scale:{y:{nice:!0}},interaction:{tooltip:{shared:!0},elementHighlightByColor:{background:!0}},axis:{y:{title:!1},x:{title:!1}},children:[{type:"interval"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return q9},e}(Rt);function wSt(t){var e=function(r){var i=r.options,o=i.children,a=o===void 0?[]:o,s=i.legend;return s&&a.forEach(function(l){if(!ge(l,"colorField")){var c=ge(l,"yField");ht(l,"colorField",function(){return c})}}),r},n=function(r){var i=r.options,o=i.annotations,a=o===void 0?[]:o,s=i.children,l=s===void 0?[]:s,c=i.scale,u=!1;return ge(c,"y.key")||l.forEach(function(f,d){if(!ge(f,"scale.y.key")){var h="child".concat(d,"Scale");ht(f,"scale.y.key",h);var p=f.annotations,v=p===void 0?[]:p;v.length>0&&(ht(f,"scale.y.independent",!1),v.forEach(function(g){ht(g,"scale.y.key",h)})),!u&&a.length>0&&ge(f,"scale.y.independent")===void 0&&(u=!0,ht(f,"scale.y.independent",!1),a.forEach(function(g){ht(g,"scale.y.key",h)}))}}),r};return zt(e,n,Fe,Xt)(t)}var OSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),K9=function(t){OSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="DualAxes",n}return e.getDefaultOptions=function(){return{type:"view",axis:{y:{title:!1,tick:!1},x:{title:!1}},scale:{y:{independent:!0,nice:!0}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return wSt},e}(Rt);function _St(t){var e=function(o){var a=o.options,s=a.xField,l=a.colorField;return l||ht(a,"colorField",s),o},n=function(o){var a=o.options,s=a.compareField,l=a.transform,c=a.isTransposed,u=c===void 0?!0:c,f=a.coordinate;return l||(s?ht(a,"transform",[]):ht(a,"transform",[{type:"symmetryY"}])),!f&&u&&ht(a,"coordinate",{transform:[{type:"transpose"}]}),o},r=function(o){var a=o.options,s=a.compareField,l=a.seriesField,c=a.data,u=a.children,f=a.yField,d=a.isTransposed,h=d===void 0?!0:d;if(s||l){var p=Object.values(C9(c,function(v){return v[s||l]}));u[0].data=p[0],u.push({type:"interval",data:p[1],yField:function(v){return-v[f]}}),delete a.compareField,delete a.data}return l&&(ht(a,"type","spaceFlex"),ht(a,"ratio",[1,1]),ht(a,"direction",h?"row":"col"),delete a.seriesField),o},i=function(o){var a=o.options,s=a.tooltip,l=a.xField,c=a.yField;return s||ht(a,"tooltip",{title:!1,items:[function(u){return{name:u[l],value:u[c]}}]}),o};return zt(e,n,r,i,Fe,Xt)(t)}var SSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ESt=function(t){SSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="column",n}return e.getDefaultOptions=function(){return{type:"view",scale:{x:{padding:0}},animate:{enter:{type:"fadeIn"}},axis:!1,shapeField:"funnel",label:{position:"inside",transform:[{type:"contrastReverse"}]},children:[{type:"interval"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return _St},e}(Rt);function MSt(t){return zt(Fe,Xt)(t)}var PSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ASt=function(t){PSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="line",n}return e.getDefaultOptions=function(){return{type:"view",scale:{y:{nice:!0}},interaction:{tooltip:{shared:!0}},axis:{y:{title:!1},x:{title:!1}},children:[{type:"line"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return MSt},e}(Rt),Ya=function(){return Ya=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ya.apply(this,arguments)};function CSt(t){var e=function(n){var r=n.options,i=r.angleField,o=r.data,a=r.label,s=r.tooltip,l=r.colorField;if(Vt(o)){var c=o.reduce(function(f,d){return f+d[i]},0);if(c===0){var u=o.map(function(f){var d;return Ya(Ya({},f),(d={},d[i]=1,d))});ht(r,"data",u),a&&ht(r,"label",Ya(Ya({},a),{formatter:function(){return 0}})),s!==!1&&ht(r,"tooltip",Ya(Ya({},s),{items:[function(f){return{name:f[l],value:0}}]}))}}return n};return zt(e,Xt)(t)}var TSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),kSt=function(t){TSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="pie",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"interval"}],coordinate:{type:"theta"},transform:[{type:"stackY",reverse:!0}],animate:{enter:{type:"waveIn"}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return CSt},e}(Rt);function LSt(t){return zt(Fe,Xt)(t)}var NSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ISt=function(t){NSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="scatter",n}return e.getDefaultOptions=function(){return{axis:{y:{title:!1},x:{title:!1}},legend:{size:!1},children:[{type:"point"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return LSt},e}(Rt);function jSt(t){var e=function(n){return ht(n,"options.coordinate",{type:ge(n,"options.coordinateType","polar")}),n};return zt(e,Xt)(t)}var DSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$St=function(t){DSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="radar",n}return e.getDefaultOptions=function(){return{axis:{x:{grid:!0,line:!0},y:{zIndex:1,title:!1,line:!0,nice:!0}},meta:{x:{padding:.5,align:0}},interaction:{tooltip:{style:{crosshairsLineDash:[4,4]}}},children:[{type:"line"}],coordinateType:"polar"}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return jSt},e}(Rt),Do=function(){return Do=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Do.apply(this,arguments)},FSt="__stock-range__",RSt="trend",BSt="up",zSt="down";function YSt(t){var e=function(r){var i=r.options,o=i.data,a=i.yField;return r.options.data=Jc(o,function(s){var l=s&&Do({},s);if(Array.isArray(a)&&l){var c=a[0],u=a[1],f=a[2],d=a[3];l[RSt]=l[c]<=l[u]?BSt:zSt,l[FSt]=[l[c],l[u],l[f],l[d]]}return l}),r},n=function(r){var i=r.options,o=i.xField,a=i.yField,s=i.fallingFill,l=i.risingFill,c=a[0],u=a[1],f=a[2],d=a[3];return r.options.children=Jc(r.options.children,function(h,p){var v=p===0;return Do(Do({},h),{tooltip:{title:function(g){return g[o]instanceof Date?g[o].toLocaleString():g[o]},items:[{field:f},{field:d},{field:c},{field:u}]},encode:Do(Do({},h.encode||{}),{y:v?[f,d]:[c,u],color:function(g){return Math.sign(g[u]-g[c])}}),style:Do(Do({},h.style||{}),{lineWidth:v?1:10})})}),delete i.yField,r.options.legend={color:!1},s&&ht(r,"options.scale.color.range[0]",s),l&&ht(r,"options.scale.color.range[2]",l),r};return zt(e,n,Xt)(t)}var WSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),GSt=["#26a69a","#999999","#ef5350"],HSt=function(t){WSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="stock",n}return e.getDefaultOptions=function(){return{type:"view",scale:{color:{domain:[-1,0,1],range:GSt},y:{nice:!0}},children:[{type:"link"},{type:"link"}],axis:{x:{title:!1,grid:!1},y:{title:!1,grid:!0,gridLineDash:null}},animate:{enter:{type:"scaleInY"}},interaction:{tooltip:{shared:!0,marker:!1,groupName:!1,crosshairs:!0}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return YSt},e}(Rt);function USt(t){return zt(Fe,Xt)(t)}var VSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),XSt=function(t){VSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="TinyLine",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"line",axis:!1}],autoFit:!1,animate:{enter:{type:"growInX",duration:500}},padding:0,margin:0,tooltip:!1}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return USt},e}(Rt);function qSt(t){return zt(Fe,Xt)(t)}var KSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ZSt=function(t){KSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="TinyArea",n}return e.getDefaultOptions=function(){return{type:"view",animate:{enter:{type:"growInX",duration:500}},children:[{type:"area",axis:!1}],autoFit:!1,padding:0,margin:0,tooltip:!1}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return qSt},e}(Rt);function QSt(t){return zt(Fe,Xt)(t)}var JSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),tEt=function(t){JSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="TinyColumn",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"interval",axis:!1}],autoFit:!1,padding:0,margin:0,tooltip:!1}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return QSt},e}(Rt),fS=function(){return fS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},fS.apply(this,arguments)};function eEt(t){var e=function(n){var r=n.options,i=r.percent,o=r.color,a=o===void 0?[]:o;if(!i)return n;var s={scale:{color:{range:a.length?a:[]}},data:[1,i]};return Object.assign(r,fS({},s)),n};return zt(e,Fe,Xt)(t)}var nEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),rEt=function(t){nEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="TinyProgress",n}return e.getDefaultOptions=function(){return{type:"view",data:[],autoFit:!1,margin:0,padding:0,tooltip:!1,children:[{interaction:{tooltip:!1},coordinate:{transform:[{type:"transpose"}]},type:"interval",axis:!1,legend:!1,encode:{y:function(n){return n},color:function(n,r){return r}}}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return eEt},e}(Rt),dS=function(){return dS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},dS.apply(this,arguments)};function iEt(t){var e=function(r){var i=r.options,o=i.radius,a=o===void 0?.8:o;return ht(r,"options.coordinate.innerRadius",a),r},n=function(r){var i=r.options,o=i.percent,a=i.color,s=a===void 0?[]:a;if(!o)return r;var l={scale:{color:{range:s.length?s:[]}},data:[1,o]};return Object.assign(i,dS({},l)),r};return zt(e,n,Fe,Xt)(t)}var oEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),aEt=function(t){oEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="TinyRing",n}return e.getDefaultOptions=function(){return{type:"view",data:[],autoFit:!1,margin:0,padding:0,coordinate:{type:"theta"},animate:{enter:{type:"waveIn"}},interaction:{tooltip:!1},tooltip:!1,children:[{type:"interval",axis:!1,legend:!1,encode:{y:function(n){return n},color:function(n,r){return r}}}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return iEt},e}(Rt);function sEt(t){return zt(Xt)(t)}var lEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),cEt=function(t){lEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="rose",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"interval"}],coordinate:{type:"polar"},animate:{enter:{type:"waveIn"}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return sEt},e}(Rt),hS="__start__",ou="__end__",pS="__waterfall_value__",vS=function(){return vS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},vS.apply(this,arguments)},uEt=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};function fEt(t){var e=function(r){var i=r.options,o=i.data,a=o===void 0?[]:o,s=i.yField;return a.length&&(a.reduce(function(l,c,u){var f;if(u===0||c.isTotal)c[hS]=0,c[ou]=c[s],c[pS]=c[s];else{var d=(f=l[ou])!==null&&f!==void 0?f:l[s];c[hS]=d,c[ou]=d+c[s],c[pS]=l[ou]}return c},[]),Object.assign(i,{yField:[hS,ou]})),r},n=function(r){var i=r.options,o=i.data,a=o===void 0?[]:o,s=i.xField,l=i.children,c=i.linkStyle,u=uEt([],a,!0);return u.reduce(function(f,d,h){return h>0&&(d.x1=f[s],d.x2=d[s],d.y1=f[ou]),d},[]),u.shift(),l.push({type:"link",xField:["x1","x2"],yField:"y1",zIndex:-1,data:u,style:vS({stroke:"#697474"},c),label:!1,tooltip:!1}),r};return zt(e,n,Fe,Xt)(t)}var dEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),hEt=function(t){dEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="waterfall",n}return e.getDefaultOptions=function(){return{type:"view",legend:null,tooltip:{field:pS,valueFormatter:"~s",name:"value"},axis:{y:{title:null,labelFormatter:"~s"},x:{title:null}},children:[{type:"interval",interaction:{elementHighlightByColor:{background:!0}}}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return fEt},e}(Rt);function pEt(t){var e=function(n){var r=n.options,i=r.data,o=r.binNumber,a=r.binWidth,s=r.children,l=r.channel,c=l===void 0?"count":l,u=ge(s,"[0].transform[0]",{});return tu(a)?(YR(u,{thresholds:Nxt(bOt(i.length,a)),y:c}),n):(tu(o)&&YR(u,{thresholds:o,y:c}),n)};return zt(e,Fe,Xt)(t)}var vEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),gEt=function(t){vEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="Histogram",n}return e.getDefaultOptions=function(){return{type:"view",autoFit:!0,axis:{y:{title:!1},x:{title:!1}},children:[{type:"rect",transform:[{type:"binX",y:"count"}],interaction:{elementHighlightByColor:{background:!0}}}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return pEt},e}(Rt);function yEt(t){var e=function(r){var i=r.options,o=i.tooltip,a=i.colorField,s=i.sizeField;return o&&!o.field&&(o.field=a||s),r},n=function(r){var i=r.options,o=i.mark,a=i.children;return o&&(a[0].type=o),r};return zt(e,n,Fe,Xt)(t)}var mEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),bEt=function(t){mEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="heatmap",n}return e.getDefaultOptions=function(){return{type:"view",legend:null,tooltip:{valueFormatter:"~s"},axis:{y:{title:null,grid:!0},x:{title:null,grid:!0}},children:[{type:"point",interaction:{elementHighlightByColor:{background:!0}}}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return yEt},e}(Rt);function xEt(t){var e=function(n){var r=n.options.boxType,i=r===void 0?"box":r;return n.options.children[0].type=i,n};return zt(e,Fe,Xt)(t)}var wEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),OEt=function(t){wEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="box",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"box"}],axis:{y:{title:!1},x:{title:!1}},tooltip:{items:[{name:"min",channel:"y"},{name:"q1",channel:"y1"},{name:"q2",channel:"y2"},{name:"q3",channel:"y3"},{name:"max",channel:"y4"}]}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return xEt},e}(Rt);function _Et(t){var e=function(n){var r=n.options,i=r.data,o=[{type:"custom",callback:function(s){return{links:s}}}];if(Vt(i))i.length>0?ht(r,"data",{value:i,transform:o}):delete r.children;else if(ge(i,"type")==="fetch"&&ge(i,"value")){var a=ge(i,"transform");Vt(a)?ht(i,"transform",a.concat(o)):ht(i,"transform",o)}return n};return zt(e,Fe,Xt)(t)}var SEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),EEt=function(t){SEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="sankey",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"sankey"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return _Et},e}(Rt),_i=function(){return _i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},_i.apply(this,arguments)},xy=["#f0efff","#5B8FF9","#3D76DD"];function gS(t,e,n,r){r===void 0&&(r=!0);var i=0,o=!1,a=Jc(t,function(s){var l,c,u=ge(s,[e]);if(ROt(u))return[];if(T9(u)){var f=Number(u);return isNaN(f)?[]:(l={},l[n]=s[n],l[e]=f,l)}return Vt(u)?(o=!0,i=Math.max(i,u.length),Jc(r?u.sort(function(d,h){return h-d}):u,function(d,h){var p;return p={},p[n]=s[n],p[e]=d,p.index=h,p})):(i=Math.max(1,i),c={},c[n]=s[n],c[e]=u,c)}).flat();return o?[a.map(function(s){return _i({index:0},s)}),i]:[a,i]}function yS(t,e){return new Array(t).fill("").map(function(n,r){return Vt(e)?e[r%e.length]:e})}function MEt(t){var e=function(i){var o=i.options,a=o.color,s=o.rangeField,l=s===void 0?"ranges":s,c=o.measureField,u=c===void 0?"measures":c,f=o.targetField,d=f===void 0?"targets":f,h=o.xField,p=h===void 0?"title":h,v=o.mapField,g=o.data,y=gS(g,l,p),m=y[0],b=y[1],x=gS(g,u,p,!1),w=x[0],O=x[1],_=gS(g,d,p,!1),S=_[0],E=_[1],M=ge(a,[l],xy[0]),P=ge(a,[u],xy[1]),C=ge(a,[d],xy[2]),A=[yS(b,M),yS(O,P),yS(E,C)].flat();return i.options.children=Jc(i.options.children,function(T,k){var N=[m,w,S][k],j=[l,u,d][k];return _i(_i({},T),{data:N,encode:_i(_i({},T.encode||{}),{x:p,y:j,color:function(L){var I=L.index,$=tu(I)?"".concat(j,"_").concat(I):j;return v?ge(v,[j,I],$):$}}),style:_i(_i({},T.style||{}),{zIndex:function(L){return-L[j]}}),labels:k!==0?Jc(T.labels,function(L){return _i(_i({},L),{text:j})}):void 0})}),i.options.scale.color.range=A,i.options.legend.color.itemMarker=function(T){return v&&jOt(v==null?void 0:v[d],T)||(T==null?void 0:T.replace(/\_\d$/,""))===d?"line":"square"},i},n=function(i){var o=i.options.layout,a=o===void 0?"horizontal":o;return a!=="horizontal"&&ht(i,"options.children[2].shapeField","hyphen"),i},r=function(i){var o=i.options,a=o.range,s=a===void 0?{}:a,l=o.measure,c=l===void 0?{}:l,u=o.target,f=u===void 0?{}:u,d=o.children;return i.options.children=[s,c,f].map(function(h,p){return za(d[p],h)}),i};return zt(e,n,r,fSt,Xt)(t)}var PEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),AEt=function(t){PEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="bullet",n}return e.getDefaultOptions=function(){return{type:"view",scale:{color:{range:xy}},legend:{color:{itemMarker:function(n){return n==="target"?"line":"square"}}},axis:{y:{title:!1},x:{title:!1}},children:[{type:"interval",style:{maxWidth:30},axis:{y:{grid:!0,gridLineWidth:2}}},{type:"interval",style:{maxWidth:20},transform:[{type:"stackY"}]},{type:"point",encode:{size:8,shape:"line"}}],interaction:{tooltip:{shared:!0}},coordinate:{transform:[{type:"transpose"}]}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return MEt},e}(Rt);function CEt(t){var e=function(n){var r=n.options.data;return n.options.data={value:r},n};return zt(e,Fe,Xt)(t)}var TEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),kEt=function(t){TEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="Gauge",n}return e.getDefaultOptions=function(){return{type:"view",legend:!1,children:[{type:"gauge"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return CEt},e}(Rt);function LEt(t){var e=function(n){var r=n.options.percent;return tu(r)&&ht(n,"options.data",r),n};return zt(e,Fe,Xt)(t)}var NEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),IEt=function(t){NEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="Liquid",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"liquid"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return LEt},e}(Rt);function jEt(t){return zt(Fe,Xt)(t)}var DEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$Et=function(t){DEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="WordCloud",n}return e.getDefaultOptions=function(){return{type:"view",legend:!1,children:[{type:"wordCloud"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return jEt},e}(Rt);function FEt(t){var e=function(n){var r=n.options,i=r.data;return i&&ht(r,"data",{value:i}),n};return zt(e,Fe,Xt)(t)}var REt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),BEt=function(t){REt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="treemap",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"treemap"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return FEt},e}(Rt),Js=function(){return Js=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Js.apply(this,arguments)};function zEt(t){var e=function(i){var o=i.options,a=o.startAngle,s=o.maxAngle,l=o.coordinate,c=tu(a)?a/(2*Math.PI)*360:-90,u=tu(s)?(Number(s)+c)/180*Math.PI:Math.PI;return ht(i,["options","coordinate"],Js(Js({},l),{endAngle:u,startAngle:a!=null?a:-Math.PI/2})),i},n=function(i){var o=i.options,a=o.tooltip,s=o.xField,l=o.yField;return a||ht(o,"tooltip",{title:!1,items:[function(c){return{name:c[s],value:c[l]}}]}),i},r=function(i){var o=i.options,a=o.markBackground,s=o.children,l=o.scale,c=o.coordinate,u=o.xField,f=ge(l,"y.domain",[]);return a&&s.unshift(Js({type:"interval",xField:u,yField:f[f.length-1],colorField:a.color,scale:{color:{type:"identity"}},style:{fillOpacity:a.opacity,fill:a.color?void 0:"#e0e4ee"},coordinate:Js(Js({},c),{startAngle:-Math.PI/2,endAngle:1.5*Math.PI}),animate:!1},a)),i};return zt(e,n,r,Fe,Xt)(t)}var YEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),WEt=function(t){YEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="radial",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"interval"}],coordinate:{type:"radial",innerRadius:.1,outerRadius:1,endAngle:Math.PI},animate:{enter:{type:"waveIn",duration:800}},axis:{y:{nice:!0,labelAutoHide:!0,labelAutoRotate:!1},x:{title:!1,nice:!0,labelAutoRotate:!1,labelAutoHide:{type:"equidistance",cfg:{minGap:6}}}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return zEt},e}(Rt);function GEt(t){return zt(Xt)(t)}var HEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),UEt=function(t){HEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="CirclePacking",n}return e.getDefaultOptions=function(){return{legend:!1,type:"view",children:[{type:"pack"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return GEt},e}(Rt),wy=function(){return wy=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},wy.apply(this,arguments)};function VEt(t){var e=function(n){var r=n.options,i=r.xField,o=r.yField,a=r.seriesField,s=r.children,l=s==null?void 0:s.map(function(c){return wy(wy({},c),{xField:i,yField:o,seriesField:a,colorField:a,data:c.type==="density"?{transform:[{type:"kde",field:o,groupBy:[i,a]}]}:c.data})}).filter(function(c){return r.violinType!=="density"||c.type==="density"});return ht(r,"children",l),r.violinType==="polar"&&ht(r,"coordinate",{type:"polar"}),ht(r,"violinType",void 0),n};return zt(e,Fe,Xt)(t)}var XEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),qEt=function(t){XEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="violin",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"density",sizeField:"size",tooltip:!1},{type:"boxplot",shapeField:"violin",style:{opacity:.5,point:!1}}],animate:{enter:{type:"fadeIn"}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return VEt},e}(Rt),ch=function(){return ch=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ch.apply(this,arguments)},KEt=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};function ZEt(t){var e=function(o){var a=o.options,s=a.yField,l=a.children;return l.forEach(function(c,u){ht(c,"yField",s[u])}),o},n=function(o){var a=o.options,s=a.yField,l=a.children,c=a.data;if(F_(c))return o;var u=Vt(ge(c,[0]))?c:[c,c];return l.forEach(function(f,d){ht(f,"data",KEt([],u[d].map(function(h){return ch({groupKey:s[d]},h)}),!0))}),o},r=function(o){var a=o.options,s=a.yField,l=s[0],c=s[1],u=a.tooltip;return u||ht(a,"tooltip",{items:[{field:l,value:l},{field:c,value:c}]}),o},i=function(o){var a=o.options,s=a.children,l=a.layout,c=a.coordinate.transform,u=a.paddingBottom,f=u===void 0?V9:u,d=a.paddingLeft,h=d===void 0?V9:d,p=a.axis;ht(a,"axisText",ch(ch({},(p==null?void 0:p.x)||{}),{layout:l}));var v=s[0],g=s[1];if(l==="vertical")ht(a,"direction","col"),ht(a,"paddingLeft",h),ht(a,"coordinate.transform",c.filter(function(w){return w.type!=="transpose"})),ht(v,"paddingBottom",U9),ht(g,"paddingTop",U9),ht(g,"axis",{x:{position:"top"}}),ht(g,"scale",{y:{range:[0,1]}});else{ht(a,"paddingBottom",f),ht(v,"scale",{y:{range:[0,1]}});var y=v.paddingRight,m=y===void 0?cS:y,b=g.paddingLeft,x=b===void 0?cS:b;ht(v,"paddingRight",m),ht(v,"axis",{x:{position:"right"}}),ht(g,"paddingLeft",x)}return o};return zt(e,n,r,i,Fe,Xt)(t)}var QEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),JEt=function(t){QEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="BidirectionalBar",n}return e.getDefaultOptions=function(){return{type:"spaceFlex",coordinate:{transform:[{type:"transpose"}]},scale:{y:{nice:!0}},direction:"row",layout:"horizontal",legend:!1,axis:{y:{title:!1},x:{title:!1,label:!1}},children:[{type:"interval"},{type:"interval"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return ZEt},e}(Rt),tl;(function(t){t.color="key",t.d="path"})(tl||(tl={}));function tMt(t){var e=function(n){var r=n.options,i=r.data,o=r.setsField,a=r.sizeField;return Vt(i)&&(ht(r,"data",{type:"inline",value:i,transform:[{type:"venn",sets:o,size:a,as:[tl.color,tl.d]}]}),ht(r,"colorField",o),ht(r,["children","0","encode","d"],tl.d)),ht(n,"options",K_(r,["sizeField","setsField"])),n};return zt(e,Xt)(t)}var eMt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),nMt=function(t){eMt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="venn",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"path"}],legend:{color:{itemMarker:"circle"}},encode:{color:tl.color,d:tl.d}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return tMt},e}(Rt);function rMt(t){var e=function(n){return n};return zt(e,Xt)(t)}var iMt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),oMt=function(t){iMt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="Sunburst",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"sunburst"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return rMt},e}(Rt),aMt={Base:lSt,Line:ASt,Column:xSt,Pie:kSt,Area:pSt,Bar:ySt,DualAxes:K9,Funnel:ESt,Scatter:ISt,Radar:$St,Rose:cEt,Stock:HSt,TinyLine:XSt,TinyArea:ZSt,TinyColumn:tEt,TinyProgress:rEt,TinyRing:aEt,Waterfall:hEt,Histogram:gEt,Heatmap:bEt,Box:OEt,Sankey:EEt,Bullet:AEt,Gauge:kEt,Liquid:IEt,WordCloud:$Et,Treemap:BEt,RadialBar:WEt,CirclePacking:UEt,Violin:qEt,BidirectionalBar:JEt,Venn:nMt,Mix:K9,Sunburst:oMt},mS=function(){return mS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},mS.apply(this,arguments)},Z9=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},el=q.forwardRef(function(t,e){var n=t.chartType,r=n===void 0?"Base":n,i=Z9(t,["chartType"]),o=i.containerStyle,a=o===void 0?{height:"inherit"}:o,s=i.containerAttributes,l=s===void 0?{}:s,c=i.className,u=i.loading,f=i.loadingTemplate,d=i.errorTemplate,h=Z9(i,["containerStyle","containerAttributes","className","loading","loadingTemplate","errorTemplate"]),p=n_t(aMt[r],h),v=p.chart,g=p.container;return q.useImperativeHandle(e,function(){return v.current}),q.createElement(ymt,{errorTemplate:d},u&&q.createElement(vmt,{loadingTemplate:f}),q.createElement("div",mS({className:c,style:a,ref:g},l)))}),bS=function(){return bS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},bS.apply(this,arguments)},sMt=function(t){return q.createElement(el,bS({},t,{chartType:"Area"}))};const lMt=sMt;var xS=function(){return xS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},xS.apply(this,arguments)},cMt=function(t){return q.createElement(el,xS({},t,{chartType:"Bar"}))};const uMt=cMt;var wS=function(){return wS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},wS.apply(this,arguments)},fMt=function(t){return q.createElement(el,wS({},t,{chartType:"Column"}))};const dMt=fMt;var OS=function(){return OS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},OS.apply(this,arguments)},hMt=function(t){return q.createElement(el,OS({},t,{chartType:"DualAxes"}))};const pMt=hMt;var _S=function(){return _S=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},_S.apply(this,arguments)},vMt=function(t){return q.createElement(el,_S({},t,{chartType:"Line"}))};const gMt=vMt;var SS=function(){return SS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},SS.apply(this,arguments)},yMt=function(t){return q.createElement(el,SS({},t,{chartType:"Pie"}))};const mMt=yMt;var ES=function(){return ES=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ES.apply(this,arguments)},bMt=function(t){return q.createElement(el,ES({},t,{chartType:"Scatter"}))};const xMt=bMt,{booleanField:Oy}=nE,wMt={isStack:t=>Oy(tt({name:"isStack",title:"isStack"},t)),smooth:t=>Oy(tt({name:"smooth",title:"smooth"},t)),isPercent:t=>Oy(tt({name:"isPercent",title:"isPercent"},t)),isGroup:t=>Oy(tt({name:"isGroup",title:"isGroup"},t))},OMt=t=>e=>{const{service:n}=q.useContext(ri),r=q.useRef(null),[i,o]=q.useState(0);return q.useEffect(()=>{const a=r.current;if(!a||n.loading===!0||e.height)return;const s=new ResizeObserver(l=>{l.forEach(c=>{o(c.contentRect.height)})});return s.observe(a),()=>s.disconnect()},[n.loading,e.height]),Y.jsx("div",{ref:r,style:i?{height:`${e.height||i}px`}:{},children:Y.jsx(t,tt(tt({},e),i?{height:e.height||i}:{}))})};class nl extends jy{constructor({name:n,title:r,Component:i,config:o}){super({name:n,title:r,Component:OMt(i),config:["xField","yField","seriesField",...o||[]]});ni(this,"init",(n,{measures:r,dimensions:i})=>{const{xField:o,yField:a,seriesField:s}=this.infer(n,{measures:r,dimensions:i});return{general:{xField:o==null?void 0:o.value,yField:a==null?void 0:a.value,seriesField:s==null?void 0:s.value}}});this.addConfigs(wMt)}getProps({data:n,general:r,advanced:i,fieldProps:o}){const a=o[r.xField],s=o[r.yField],l=o[r.seriesField];return tt(vt(tt(tt({legend:{color:{itemLabelText:u=>{const f=l==null?void 0:l.transformer;return f?f(u.label):u.label}}},tooltip:{title:u=>{const{[r.xField]:f}=u;return a!=null&&a.transformer?a.transformer(f):f},items:[u=>{const{[r.xField]:f,[r.yField]:d,[r.seriesField]:h}=u;let p="";return h?p=l.transformer?l.transformer(h):h:p=(s==null?void 0:s.label)||r.yField,{name:p,value:s!=null&&s.transformer?s.transformer(d):d}}]},axis:{x:{labelFormatter:u=>{const f=a==null?void 0:a.transformer;return f?f(u):u}},y:{labelFormatter:u=>{const f=s==null?void 0:s.transformer;return f?f(u):u}}},data:n,theme:"classic",animate:{enter:{type:!1},update:{type:!1},exit:{type:!1}},colorField:r.seriesField,stack:r.isStack,percent:r.isPercent?!0:void 0},r.smooth?{shapeField:"smooth"}:{}),r),{seriesField:r.isGroup?r.seriesField:void 0}),i)}getReference(){return{title:this.title,link:`https://ant-design-charts-next.antgroup.com/examples#statistics-${this.name}`}}}class _Mt extends nl{constructor(){super({name:"pie",title:"Pie Chart",Component:mMt});ni(this,"init",(n,{measures:r,dimensions:i})=>{const{xField:o,yField:a}=this.infer(n,{measures:r,dimensions:i});return{general:{colorField:o==null?void 0:o.value,angleField:a==null?void 0:a.value}}});this.config=[{property:"field",name:"angleField",title:"angleField",required:!0},{property:"field",name:"colorField",title:"colorField",required:!0}]}getProps({data:n,general:r,advanced:i,fieldProps:o}){const a=o[r.angleField],s=super.getProps({data:n,general:r,advanced:i,fieldProps:o});return vt(tt({},s),{tooltip:{items:[l=>{const{[r.colorField]:c,[r.angleField]:u}=l,f=c||(a==null?void 0:a.label)||r.angleField,d=a==null?void 0:a.transformer;return{name:f,value:d?d(u):u}}]}})}}class SMt extends nl{constructor(){super({name:"dualAxes",title:"Dual Axes Chart",Component:pMt});ni(this,"init",(n,{measures:r,dimensions:i})=>{const{xField:o,yFields:a}=this.infer(n,{measures:r,dimensions:i});return{general:{xField:o==null?void 0:o.value,yField:(a==null?void 0:a.map(s=>s.value))||[]}}});this.config=["xField",{yField:{title:'{{t("yField")}}',type:"array","x-decorator":"FormItem","x-component":"ArrayItems",items:{type:"void","x-component":"Space",properties:{sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"},input:{type:"string","x-decorator":"FormItem","x-component":"Select","x-reactions":"{{ useChartFields }}","x-component-props":{style:{minWidth:"200px"}},required:!0},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}},properties:{add:{type:"void",title:'{{t("Add")}}',"x-component":"ArrayItems.Addition"}}}}]}getProps({data:n,general:r,advanced:i,fieldProps:o}){var s;const a=super.getProps({data:n,general:r,advanced:i,fieldProps:o});return vt(tt({},rn.omit(a,["legend","tooltip","yField"])),{children:((s=a.yField)==null?void 0:s.map((l,c)=>{var u;return{type:"line",yField:l,colorField:()=>{const f=o[l];return(f==null?void 0:f.label)||l},axis:{y:{title:((u=o[l])==null?void 0:u.label)||l,position:c===0?"left":"right",labelFormatter:f=>{const d=o[l],h=d==null?void 0:d.transformer;return h?h(f):f}}}}}))||[]})}}const EMt=[new nl({name:"line",title:"Line Chart",Component:gMt,config:["smooth","isStack"]}),new nl({name:"area",title:"Area Chart",Component:lMt,config:["smooth",{property:"isStack",defaultValue:!0},"isPercent"]}),new nl({name:"column",title:"Column Chart",Component:dMt,config:["isGroup","isStack","isPercent"]}),new nl({name:"bar",title:"Bar Chart",Component:uMt,config:["isGroup","isStack","isPercent"]}),new _Mt,new SMt,new nl({name:"scatter",title:"Scatter Chart",Component:xMt})];class _y extends z.Plugin{constructor(){super(...arguments);ni(this,"charts",new TB)}load(){return Cr(this,null,function*(){this.charts.setGroup("Built-in",[...EMt,...ez]),this.app.addComponents({ChartV2BlockInitializer:Q7,ChartV2BlockDesigner:K7,ChartV2Block:q7}),this.app.schemaInitializerManager.add(eE),this.app.schemaInitializerManager.add(Z7),this.app.schemaInitializerManager.add(XS),this.app.schemaInitializerManager.add(T7),this.app.schemaInitializerManager.add(QS),this.app.schemaInitializerManager.add(D7);const n=this.app.schemaInitializerManager.get("page:addBlock");n==null||n.add("dataBlocks.chartV2",{title:At("Charts"),Component:"ChartV2BlockInitializer"})})}}ct.Chart=jy,ct.ChartConfigContext=Mi,ct.default=_y,Object.defineProperties(ct,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
161
+ `,n.classList.add("loading"),n.innerHTML="<div></div><div></div><div></div><div></div>",e.appendChild(r),e.appendChild(n)},vmt=function(t){var e=t.loadingTemplate,n=t.theme,r=n===void 0?"light":n,i=q.useRef(null);q.useEffect(function(){!e&&i.current&&pmt(i.current)},[]);var o=function(){return e||q.createElement("div",{ref:i})};return q.createElement("div",{className:"charts-loading-container",style:{position:"absolute",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",left:0,top:0,zIndex:99,backgroundColor:r==="dark"?"rgb(20, 20, 20)":"rgb(255, 255, 255)"}},o())},gmt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ymt=function(t){gmt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={hasError:!1},n.renderError=function(r){var i=n.props.errorTemplate;switch(r){default:return typeof i=="function"?i(r):i||q.createElement("h5",null,"组件出错了,请核查后重试: ",r.message)}},n}return e.getDerivedStateFromError=function(n){return{hasError:!0,error:n}},e.getDerivedStateFromProps=function(n,r){return r.children!==n.children?{children:n.children,hasError:!1,error:void 0}:null},e.prototype.render=function(){return this.state.hasError?this.renderError(this.state.error):q.createElement(q.Fragment,null,this.props.children)},e}(q.Component),mmt=typeof global=="object"&&global&&global.Object===Object&&global;const fR=mmt;var bmt=typeof self=="object"&&self&&self.Object===Object&&self,xmt=fR||bmt||Function("return this")();const wi=xmt;var wmt=wi.Symbol;const ti=wmt;var dR=Object.prototype,Omt=dR.hasOwnProperty,_mt=dR.toString,Vd=ti?ti.toStringTag:void 0;function Smt(t){var e=Omt.call(t,Vd),n=t[Vd];try{t[Vd]=void 0;var r=!0}catch(o){}var i=_mt.call(t);return r&&(e?t[Vd]=n:delete t[Vd]),i}var Emt=Object.prototype,Mmt=Emt.toString;function Pmt(t){return Mmt.call(t)}var Amt="[object Null]",Cmt="[object Undefined]",hR=ti?ti.toStringTag:void 0;function Qi(t){return t==null?t===void 0?Cmt:Amt:hR&&hR in Object(t)?Smt(t):Pmt(t)}function sr(t){return t!=null&&typeof t=="object"}var Tmt="[object Symbol]";function Xd(t){return typeof t=="symbol"||sr(t)&&Qi(t)==Tmt}var kmt=NaN;function pR(t){return typeof t=="number"?t:Xd(t)?kmt:+t}function Zg(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var Lmt=Array.isArray;const Vt=Lmt;var Nmt=1/0,vR=ti?ti.prototype:void 0,gR=vR?vR.toString:void 0;function Qg(t){if(typeof t=="string")return t;if(Vt(t))return Zg(t,Qg)+"";if(Xd(t))return gR?gR.call(t):"";var e=t+"";return e=="0"&&1/t==-Nmt?"-0":e}function Imt(t,e){return function(n,r){var i;if(n===void 0&&r===void 0)return e;if(n!==void 0&&(i=n),r!==void 0){if(i===void 0)return r;typeof n=="string"||typeof r=="string"?(n=Qg(n),r=Qg(r)):(n=pR(n),r=pR(r)),i=t(n,r)}return i}}var jmt=/\s/;function Dmt(t){for(var e=t.length;e--&&jmt.test(t.charAt(e)););return e}var $mt=/^\s+/;function Fmt(t){return t&&t.slice(0,Dmt(t)+1).replace($mt,"")}function Gn(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var yR=NaN,Rmt=/^[-+]0x[0-9a-f]+$/i,Bmt=/^0b[01]+$/i,zmt=/^0o[0-7]+$/i,Ymt=parseInt;function mR(t){if(typeof t=="number")return t;if(Xd(t))return yR;if(Gn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Gn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Fmt(t);var n=Bmt.test(t);return n||zmt.test(t)?Ymt(t.slice(2),n?2:8):Rmt.test(t)?yR:+t}var bR=1/0,Wmt=17976931348623157e292;function Gmt(t){if(!t)return t===0?t:0;if(t=mR(t),t===bR||t===-bR){var e=t<0?-1:1;return e*Wmt}return t===t?t:0}function xR(t){var e=Gmt(t),n=e%1;return e===e?n?e-n:e:0}function __(t){return t}var Hmt="[object AsyncFunction]",Umt="[object Function]",Vmt="[object GeneratorFunction]",Xmt="[object Proxy]";function Vc(t){if(!Gn(t))return!1;var e=Qi(t);return e==Umt||e==Vmt||e==Hmt||e==Xmt}var qmt=wi["__core-js_shared__"];const S_=qmt;var wR=function(){var t=/[^.]+$/.exec(S_&&S_.keys&&S_.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Kmt(t){return!!wR&&wR in t}var Zmt=Function.prototype,Qmt=Zmt.toString;function Us(t){if(t!=null){try{return Qmt.call(t)}catch(e){}try{return t+""}catch(e){}}return""}var Jmt=/[\\^$.*+?()[\]{}|]/g,t1t=/^\[object .+?Constructor\]$/,e1t=Function.prototype,n1t=Object.prototype,r1t=e1t.toString,i1t=n1t.hasOwnProperty,o1t=RegExp("^"+r1t.call(i1t).replace(Jmt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function a1t(t){if(!Gn(t)||Kmt(t))return!1;var e=Vc(t)?o1t:t1t;return e.test(Us(t))}function s1t(t,e){return t==null?void 0:t[e]}function Vs(t,e){var n=s1t(t,e);return a1t(n)?n:void 0}var l1t=Vs(wi,"WeakMap");const qd=l1t;var c1t=qd&&new qd;const OR=c1t;var _R=Object.create,u1t=function(){function t(){}return function(e){if(!Gn(e))return{};if(_R)return _R(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();const E_=u1t;function f1t(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function M_(){}var d1t=4294967295;function Xc(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d1t,this.__views__=[]}Xc.prototype=E_(M_.prototype),Xc.prototype.constructor=Xc;function SR(){}var h1t=OR?function(t){return OR.get(t)}:SR;const ER=h1t;var p1t={};const MR=p1t;var v1t=Object.prototype,g1t=v1t.hasOwnProperty;function Jg(t){for(var e=t.name+"",n=MR[e],r=g1t.call(MR,e)?n.length:0;r--;){var i=n[r],o=i.func;if(o==null||o==t)return i.name}return e}function Ra(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}Ra.prototype=E_(M_.prototype),Ra.prototype.constructor=Ra;function P_(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function y1t(t){if(t instanceof Xc)return t.clone();var e=new Ra(t.__wrapped__,t.__chain__);return e.__actions__=P_(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var m1t=Object.prototype,b1t=m1t.hasOwnProperty;function ty(t){if(sr(t)&&!Vt(t)&&!(t instanceof Xc)){if(t instanceof Ra)return t;if(b1t.call(t,"__wrapped__"))return y1t(t)}return new Ra(t)}ty.prototype=M_.prototype,ty.prototype.constructor=ty;function PR(t){var e=Jg(t),n=ty[e];if(typeof n!="function"||!(e in Xc.prototype))return!1;if(t===n)return!0;var r=ER(n);return!!r&&t===r[0]}var x1t=800,w1t=16,O1t=Date.now;function _1t(t){var e=0,n=0;return function(){var r=O1t(),i=w1t-(r-n);if(n=r,i>0){if(++e>=x1t)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function S1t(t){return function(){return t}}var E1t=function(){try{var t=Vs(Object,"defineProperty");return t({},"",{}),t}catch(e){}}();const ey=E1t;var M1t=ey?function(t,e){return ey(t,"toString",{configurable:!0,enumerable:!1,value:S1t(e),writable:!0})}:__,P1t=_1t(M1t);const AR=P1t;function A1t(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}function C1t(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function T1t(t){return t!==t}function k1t(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}function CR(t,e,n){return e===e?k1t(t,e,n):C1t(t,T1t,n)}function L1t(t,e){var n=t==null?0:t.length;return!!n&&CR(t,e,0)>-1}var N1t=9007199254740991,I1t=/^(?:0|[1-9]\d*)$/;function ny(t,e){var n=typeof t;return e=e==null?N1t:e,!!e&&(n=="number"||n!="symbol"&&I1t.test(t))&&t>-1&&t%1==0&&t<e}function ry(t,e,n){e=="__proto__"&&ey?ey(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Kd(t,e){return t===e||t!==t&&e!==e}var j1t=Object.prototype,D1t=j1t.hasOwnProperty;function iy(t,e,n){var r=t[e];(!(D1t.call(t,e)&&Kd(r,n))||n===void 0&&!(e in t))&&ry(t,e,n)}function Xs(t,e,n,r){var i=!n;n||(n={});for(var o=-1,a=e.length;++o<a;){var s=e[o],l=r?r(n[s],t[s],s,n,t):void 0;l===void 0&&(l=t[s]),i?ry(n,s,l):iy(n,s,l)}return n}var TR=Math.max;function kR(t,e,n){return e=TR(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=TR(r.length-e,0),a=Array(o);++i<o;)a[i]=r[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=r[i];return s[e]=n(a),f1t(t,this,s)}}function $1t(t,e){return AR(kR(t,e,__),t+"")}var F1t=9007199254740991;function A_(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=F1t}function Ba(t){return t!=null&&A_(t.length)&&!Vc(t)}function R1t(t,e,n){if(!Gn(n))return!1;var r=typeof e;return(r=="number"?Ba(n)&&ny(e,n.length):r=="string"&&e in n)?Kd(n[e],t):!1}function LR(t){return $1t(function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=t.length>3&&typeof o=="function"?(i--,o):void 0,a&&R1t(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++r<i;){var s=n[r];s&&t(e,s,r,o)}return e})}var B1t=Object.prototype;function oy(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||B1t;return t===n}function z1t(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var Y1t="[object Arguments]";function NR(t){return sr(t)&&Qi(t)==Y1t}var IR=Object.prototype,W1t=IR.hasOwnProperty,G1t=IR.propertyIsEnumerable,H1t=NR(function(){return arguments}())?NR:function(t){return sr(t)&&W1t.call(t,"callee")&&!G1t.call(t,"callee")};const Zd=H1t;function U1t(){return!1}var jR=typeof ct=="object"&&ct&&!ct.nodeType&&ct,DR=jR&&typeof module=="object"&&module&&!module.nodeType&&module,V1t=DR&&DR.exports===jR,$R=V1t?wi.Buffer:void 0,X1t=$R?$R.isBuffer:void 0,q1t=X1t||U1t;const Qd=q1t;var K1t="[object Arguments]",Z1t="[object Array]",Q1t="[object Boolean]",J1t="[object Date]",tbt="[object Error]",ebt="[object Function]",nbt="[object Map]",rbt="[object Number]",ibt="[object Object]",obt="[object RegExp]",abt="[object Set]",sbt="[object String]",lbt="[object WeakMap]",cbt="[object ArrayBuffer]",ubt="[object DataView]",fbt="[object Float32Array]",dbt="[object Float64Array]",hbt="[object Int8Array]",pbt="[object Int16Array]",vbt="[object Int32Array]",gbt="[object Uint8Array]",ybt="[object Uint8ClampedArray]",mbt="[object Uint16Array]",bbt="[object Uint32Array]",Ee={};Ee[fbt]=Ee[dbt]=Ee[hbt]=Ee[pbt]=Ee[vbt]=Ee[gbt]=Ee[ybt]=Ee[mbt]=Ee[bbt]=!0,Ee[K1t]=Ee[Z1t]=Ee[cbt]=Ee[Q1t]=Ee[ubt]=Ee[J1t]=Ee[tbt]=Ee[ebt]=Ee[nbt]=Ee[rbt]=Ee[ibt]=Ee[obt]=Ee[abt]=Ee[sbt]=Ee[lbt]=!1;function xbt(t){return sr(t)&&A_(t.length)&&!!Ee[Qi(t)]}function C_(t){return function(e){return t(e)}}var FR=typeof ct=="object"&&ct&&!ct.nodeType&&ct,Jd=FR&&typeof module=="object"&&module&&!module.nodeType&&module,wbt=Jd&&Jd.exports===FR,T_=wbt&&fR.process,Obt=function(){try{var t=Jd&&Jd.require&&Jd.require("util").types;return t||T_&&T_.binding&&T_.binding("util")}catch(e){}}();const qc=Obt;var RR=qc&&qc.isTypedArray,_bt=RR?C_(RR):xbt;const k_=_bt;var Sbt=Object.prototype,Ebt=Sbt.hasOwnProperty;function BR(t,e){var n=Vt(t),r=!n&&Zd(t),i=!n&&!r&&Qd(t),o=!n&&!r&&!i&&k_(t),a=n||r||i||o,s=a?z1t(t.length,String):[],l=s.length;for(var c in t)(e||Ebt.call(t,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||ny(c,l)))&&s.push(c);return s}function zR(t,e){return function(n){return t(e(n))}}var Mbt=zR(Object.keys,Object);const Pbt=Mbt;var Abt=Object.prototype,Cbt=Abt.hasOwnProperty;function Tbt(t){if(!oy(t))return Pbt(t);var e=[];for(var n in Object(t))Cbt.call(t,n)&&n!="constructor"&&e.push(n);return e}function qs(t){return Ba(t)?BR(t):Tbt(t)}var kbt=Object.prototype,Lbt=kbt.hasOwnProperty,Nbt=LR(function(t,e){if(oy(e)||Ba(e)){Xs(e,qs(e),t);return}for(var n in e)Lbt.call(e,n)&&iy(t,n,e[n])});const YR=Nbt;function Ibt(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var jbt=Object.prototype,Dbt=jbt.hasOwnProperty;function $bt(t){if(!Gn(t))return Ibt(t);var e=oy(t),n=[];for(var r in t)r=="constructor"&&(e||!Dbt.call(t,r))||n.push(r);return n}function th(t){return Ba(t)?BR(t,!0):$bt(t)}var Fbt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Rbt=/^\w*$/;function L_(t,e){if(Vt(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||Xd(t)?!0:Rbt.test(t)||!Fbt.test(t)||e!=null&&t in Object(e)}var Bbt=Vs(Object,"create");const eh=Bbt;function zbt(){this.__data__=eh?eh(null):{},this.size=0}function Ybt(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Wbt="__lodash_hash_undefined__",Gbt=Object.prototype,Hbt=Gbt.hasOwnProperty;function Ubt(t){var e=this.__data__;if(eh){var n=e[t];return n===Wbt?void 0:n}return Hbt.call(e,t)?e[t]:void 0}var Vbt=Object.prototype,Xbt=Vbt.hasOwnProperty;function qbt(t){var e=this.__data__;return eh?e[t]!==void 0:Xbt.call(e,t)}var Kbt="__lodash_hash_undefined__";function Zbt(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=eh&&e===void 0?Kbt:e,this}function Ks(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Ks.prototype.clear=zbt,Ks.prototype.delete=Ybt,Ks.prototype.get=Ubt,Ks.prototype.has=qbt,Ks.prototype.set=Zbt;function Qbt(){this.__data__=[],this.size=0}function ay(t,e){for(var n=t.length;n--;)if(Kd(t[n][0],e))return n;return-1}var Jbt=Array.prototype,txt=Jbt.splice;function ext(t){var e=this.__data__,n=ay(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():txt.call(e,n,1),--this.size,!0}function nxt(t){var e=this.__data__,n=ay(e,t);return n<0?void 0:e[n][1]}function rxt(t){return ay(this.__data__,t)>-1}function ixt(t,e){var n=this.__data__,r=ay(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Io(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Io.prototype.clear=Qbt,Io.prototype.delete=ext,Io.prototype.get=nxt,Io.prototype.has=rxt,Io.prototype.set=ixt;var oxt=Vs(wi,"Map");const nh=oxt;function axt(){this.size=0,this.__data__={hash:new Ks,map:new(nh||Io),string:new Ks}}function sxt(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function sy(t,e){var n=t.__data__;return sxt(e)?n[typeof e=="string"?"string":"hash"]:n.map}function lxt(t){var e=sy(this,t).delete(t);return this.size-=e?1:0,e}function cxt(t){return sy(this,t).get(t)}function uxt(t){return sy(this,t).has(t)}function fxt(t,e){var n=sy(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function jo(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}jo.prototype.clear=axt,jo.prototype.delete=lxt,jo.prototype.get=cxt,jo.prototype.has=uxt,jo.prototype.set=fxt;var dxt="Expected a function";function N_(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(dxt);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(N_.Cache||jo),n}N_.Cache=jo;var hxt=500;function pxt(t){var e=N_(t,function(r){return n.size===hxt&&n.clear(),r}),n=e.cache;return e}var vxt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,gxt=/\\(\\)?/g,yxt=pxt(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(vxt,function(n,r,i,o){e.push(i?o.replace(gxt,"$1"):r||n)}),e});const mxt=yxt;function I_(t){return t==null?"":Qg(t)}function Kc(t,e){return Vt(t)?t:L_(t,e)?[t]:mxt(I_(t))}var bxt=1/0;function Zc(t){if(typeof t=="string"||Xd(t))return t;var e=t+"";return e=="0"&&1/t==-bxt?"-0":e}function ly(t,e){e=Kc(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[Zc(e[n++])];return n&&n==r?t:void 0}function ge(t,e,n){var r=t==null?void 0:ly(t,e);return r===void 0?n:r}function j_(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var WR=ti?ti.isConcatSpreadable:void 0;function xxt(t){return Vt(t)||Zd(t)||!!(WR&&t&&t[WR])}function GR(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=xxt),i||(i=[]);++o<a;){var s=t[o];e>0&&n(s)?e>1?GR(s,e-1,n,r,i):j_(i,s):r||(i[i.length]=s)}return i}function wxt(t){var e=t==null?0:t.length;return e?GR(t,1):[]}function D_(t){return AR(kR(t,void 0,wxt),t+"")}var Oxt=zR(Object.getPrototypeOf,Object);const $_=Oxt;var _xt="[object Object]",Sxt=Function.prototype,Ext=Object.prototype,HR=Sxt.toString,Mxt=Ext.hasOwnProperty,Pxt=HR.call(Object);function F_(t){if(!sr(t)||Qi(t)!=_xt)return!1;var e=$_(t);if(e===null)return!0;var n=Mxt.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&HR.call(n)==Pxt}function Axt(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r<i;)o[r]=t[r+e];return o}var Cxt=wi.isFinite,Txt=Math.min;function kxt(t){var e=Math[t];return function(n,r){if(n=mR(n),r=r==null?0:Txt(xR(r),292),r&&Cxt(n)){var i=(I_(n)+"e").split("e"),o=e(i[0]+"e"+(+i[1]+r));return i=(I_(o)+"e").split("e"),+(i[0]+"e"+(+i[1]-r))}return e(n)}}var Lxt=kxt("ceil");const Nxt=Lxt;function Ixt(){this.__data__=new Io,this.size=0}function jxt(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function Dxt(t){return this.__data__.get(t)}function $xt(t){return this.__data__.has(t)}var Fxt=200;function Rxt(t,e){var n=this.__data__;if(n instanceof Io){var r=n.__data__;if(!nh||r.length<Fxt-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new jo(r)}return n.set(t,e),this.size=n.size,this}function Oi(t){var e=this.__data__=new Io(t);this.size=e.size}Oi.prototype.clear=Ixt,Oi.prototype.delete=jxt,Oi.prototype.get=Dxt,Oi.prototype.has=$xt,Oi.prototype.set=Rxt;function Bxt(t,e){return t&&Xs(e,qs(e),t)}function zxt(t,e){return t&&Xs(e,th(e),t)}var UR=typeof ct=="object"&&ct&&!ct.nodeType&&ct,VR=UR&&typeof module=="object"&&module&&!module.nodeType&&module,Yxt=VR&&VR.exports===UR,XR=Yxt?wi.Buffer:void 0,qR=XR?XR.allocUnsafe:void 0;function KR(t,e){if(e)return t.slice();var n=t.length,r=qR?qR(n):new t.constructor(n);return t.copy(r),r}function Wxt(t,e){for(var n=-1,r=t==null?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}function ZR(){return[]}var Gxt=Object.prototype,Hxt=Gxt.propertyIsEnumerable,QR=Object.getOwnPropertySymbols,Uxt=QR?function(t){return t==null?[]:(t=Object(t),Wxt(QR(t),function(e){return Hxt.call(t,e)}))}:ZR;const R_=Uxt;function Vxt(t,e){return Xs(t,R_(t),e)}var Xxt=Object.getOwnPropertySymbols,qxt=Xxt?function(t){for(var e=[];t;)j_(e,R_(t)),t=$_(t);return e}:ZR;const JR=qxt;function Kxt(t,e){return Xs(t,JR(t),e)}function t9(t,e,n){var r=e(t);return Vt(t)?r:j_(r,n(t))}function B_(t){return t9(t,qs,R_)}function e9(t){return t9(t,th,JR)}var Zxt=Vs(wi,"DataView");const z_=Zxt;var Qxt=Vs(wi,"Promise");const Y_=Qxt;var Jxt=Vs(wi,"Set");const Qc=Jxt;var n9="[object Map]",t2t="[object Object]",r9="[object Promise]",i9="[object Set]",o9="[object WeakMap]",a9="[object DataView]",e2t=Us(z_),n2t=Us(nh),r2t=Us(Y_),i2t=Us(Qc),o2t=Us(qd),Zs=Qi;(z_&&Zs(new z_(new ArrayBuffer(1)))!=a9||nh&&Zs(new nh)!=n9||Y_&&Zs(Y_.resolve())!=r9||Qc&&Zs(new Qc)!=i9||qd&&Zs(new qd)!=o9)&&(Zs=function(t){var e=Qi(t),n=e==t2t?t.constructor:void 0,r=n?Us(n):"";if(r)switch(r){case e2t:return a9;case n2t:return n9;case r2t:return r9;case i2t:return i9;case o2t:return o9}return e});const rh=Zs;var a2t=Object.prototype,s2t=a2t.hasOwnProperty;function l2t(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&s2t.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var c2t=wi.Uint8Array;const cy=c2t;function W_(t){var e=new t.constructor(t.byteLength);return new cy(e).set(new cy(t)),e}function u2t(t,e){var n=e?W_(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var f2t=/\w*$/;function d2t(t){var e=new t.constructor(t.source,f2t.exec(t));return e.lastIndex=t.lastIndex,e}var s9=ti?ti.prototype:void 0,l9=s9?s9.valueOf:void 0;function h2t(t){return l9?Object(l9.call(t)):{}}function c9(t,e){var n=e?W_(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var p2t="[object Boolean]",v2t="[object Date]",g2t="[object Map]",y2t="[object Number]",m2t="[object RegExp]",b2t="[object Set]",x2t="[object String]",w2t="[object Symbol]",O2t="[object ArrayBuffer]",_2t="[object DataView]",S2t="[object Float32Array]",E2t="[object Float64Array]",M2t="[object Int8Array]",P2t="[object Int16Array]",A2t="[object Int32Array]",C2t="[object Uint8Array]",T2t="[object Uint8ClampedArray]",k2t="[object Uint16Array]",L2t="[object Uint32Array]";function N2t(t,e,n){var r=t.constructor;switch(e){case O2t:return W_(t);case p2t:case v2t:return new r(+t);case _2t:return u2t(t,n);case S2t:case E2t:case M2t:case P2t:case A2t:case C2t:case T2t:case k2t:case L2t:return c9(t,n);case g2t:return new r;case y2t:case x2t:return new r(t);case m2t:return d2t(t);case b2t:return new r;case w2t:return h2t(t)}}function u9(t){return typeof t.constructor=="function"&&!oy(t)?E_($_(t)):{}}var I2t="[object Map]";function j2t(t){return sr(t)&&rh(t)==I2t}var f9=qc&&qc.isMap,D2t=f9?C_(f9):j2t;const $2t=D2t;var F2t="[object Set]";function R2t(t){return sr(t)&&rh(t)==F2t}var d9=qc&&qc.isSet,B2t=d9?C_(d9):R2t;const z2t=B2t;var Y2t=1,W2t=2,G2t=4,h9="[object Arguments]",H2t="[object Array]",U2t="[object Boolean]",V2t="[object Date]",X2t="[object Error]",p9="[object Function]",q2t="[object GeneratorFunction]",K2t="[object Map]",Z2t="[object Number]",v9="[object Object]",Q2t="[object RegExp]",J2t="[object Set]",twt="[object String]",ewt="[object Symbol]",nwt="[object WeakMap]",rwt="[object ArrayBuffer]",iwt="[object DataView]",owt="[object Float32Array]",awt="[object Float64Array]",swt="[object Int8Array]",lwt="[object Int16Array]",cwt="[object Int32Array]",uwt="[object Uint8Array]",fwt="[object Uint8ClampedArray]",dwt="[object Uint16Array]",hwt="[object Uint32Array]",ye={};ye[h9]=ye[H2t]=ye[rwt]=ye[iwt]=ye[U2t]=ye[V2t]=ye[owt]=ye[awt]=ye[swt]=ye[lwt]=ye[cwt]=ye[K2t]=ye[Z2t]=ye[v9]=ye[Q2t]=ye[J2t]=ye[twt]=ye[ewt]=ye[uwt]=ye[fwt]=ye[dwt]=ye[hwt]=!0,ye[X2t]=ye[p9]=ye[nwt]=!1;function ih(t,e,n,r,i,o){var a,s=e&Y2t,l=e&W2t,c=e&G2t;if(n&&(a=i?n(t,r,i,o):n(t)),a!==void 0)return a;if(!Gn(t))return t;var u=Vt(t);if(u){if(a=l2t(t),!s)return P_(t,a)}else{var f=rh(t),d=f==p9||f==q2t;if(Qd(t))return KR(t,s);if(f==v9||f==h9||d&&!i){if(a=l||d?{}:u9(t),!s)return l?Kxt(t,zxt(a,t)):Vxt(t,Bxt(a,t))}else{if(!ye[f])return i?t:{};a=N2t(t,f,s)}}o||(o=new Oi);var h=o.get(t);if(h)return h;o.set(t,a),z2t(t)?t.forEach(function(g){a.add(ih(g,e,n,g,t,o))}):$2t(t)&&t.forEach(function(g,y){a.set(y,ih(g,e,n,y,t,o))});var p=c?l?e9:B_:l?th:qs,v=u?void 0:p(t);return A1t(v||t,function(g,y){v&&(y=g,g=t[y]),iy(a,y,ih(g,e,n,y,t,o))}),a}var pwt=1,vwt=4;function g9(t){return ih(t,pwt|vwt)}var gwt="__lodash_hash_undefined__";function ywt(t){return this.__data__.set(t,gwt),this}function mwt(t){return this.__data__.has(t)}function oh(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new jo;++e<n;)this.add(t[e])}oh.prototype.add=oh.prototype.push=ywt,oh.prototype.has=mwt;function bwt(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function y9(t,e){return t.has(e)}var xwt=1,wwt=2;function m9(t,e,n,r,i,o){var a=n&xwt,s=t.length,l=e.length;if(s!=l&&!(a&&l>s))return!1;var c=o.get(t),u=o.get(e);if(c&&u)return c==e&&u==t;var f=-1,d=!0,h=n&wwt?new oh:void 0;for(o.set(t,e),o.set(e,t);++f<s;){var p=t[f],v=e[f];if(r)var g=a?r(v,p,f,e,t,o):r(p,v,f,t,e,o);if(g!==void 0){if(g)continue;d=!1;break}if(h){if(!bwt(e,function(y,m){if(!y9(h,m)&&(p===y||i(p,y,n,r,o)))return h.push(m)})){d=!1;break}}else if(!(p===v||i(p,v,n,r,o))){d=!1;break}}return o.delete(t),o.delete(e),d}function Owt(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function G_(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var _wt=1,Swt=2,Ewt="[object Boolean]",Mwt="[object Date]",Pwt="[object Error]",Awt="[object Map]",Cwt="[object Number]",Twt="[object RegExp]",kwt="[object Set]",Lwt="[object String]",Nwt="[object Symbol]",Iwt="[object ArrayBuffer]",jwt="[object DataView]",b9=ti?ti.prototype:void 0,H_=b9?b9.valueOf:void 0;function Dwt(t,e,n,r,i,o,a){switch(n){case jwt:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Iwt:return!(t.byteLength!=e.byteLength||!o(new cy(t),new cy(e)));case Ewt:case Mwt:case Cwt:return Kd(+t,+e);case Pwt:return t.name==e.name&&t.message==e.message;case Twt:case Lwt:return t==e+"";case Awt:var s=Owt;case kwt:var l=r&_wt;if(s||(s=G_),t.size!=e.size&&!l)return!1;var c=a.get(t);if(c)return c==e;r|=Swt,a.set(t,e);var u=m9(s(t),s(e),r,i,o,a);return a.delete(t),u;case Nwt:if(H_)return H_.call(t)==H_.call(e)}return!1}var $wt=1,Fwt=Object.prototype,Rwt=Fwt.hasOwnProperty;function Bwt(t,e,n,r,i,o){var a=n&$wt,s=B_(t),l=s.length,c=B_(e),u=c.length;if(l!=u&&!a)return!1;for(var f=l;f--;){var d=s[f];if(!(a?d in e:Rwt.call(e,d)))return!1}var h=o.get(t),p=o.get(e);if(h&&p)return h==e&&p==t;var v=!0;o.set(t,e),o.set(e,t);for(var g=a;++f<l;){d=s[f];var y=t[d],m=e[d];if(r)var b=a?r(m,y,d,e,t,o):r(y,m,d,t,e,o);if(!(b===void 0?y===m||i(y,m,n,r,o):b)){v=!1;break}g||(g=d=="constructor")}if(v&&!g){var x=t.constructor,w=e.constructor;x!=w&&"constructor"in t&&"constructor"in e&&!(typeof x=="function"&&x instanceof x&&typeof w=="function"&&w instanceof w)&&(v=!1)}return o.delete(t),o.delete(e),v}var zwt=1,x9="[object Arguments]",w9="[object Array]",uy="[object Object]",Ywt=Object.prototype,O9=Ywt.hasOwnProperty;function Wwt(t,e,n,r,i,o){var a=Vt(t),s=Vt(e),l=a?w9:rh(t),c=s?w9:rh(e);l=l==x9?uy:l,c=c==x9?uy:c;var u=l==uy,f=c==uy,d=l==c;if(d&&Qd(t)){if(!Qd(e))return!1;a=!0,u=!1}if(d&&!u)return o||(o=new Oi),a||k_(t)?m9(t,e,n,r,i,o):Dwt(t,e,l,n,r,i,o);if(!(n&zwt)){var h=u&&O9.call(t,"__wrapped__"),p=f&&O9.call(e,"__wrapped__");if(h||p){var v=h?t.value():t,g=p?e.value():e;return o||(o=new Oi),i(v,g,n,r,o)}}return d?(o||(o=new Oi),Bwt(t,e,n,r,i,o)):!1}function fy(t,e,n,r,i){return t===e?!0:t==null||e==null||!sr(t)&&!sr(e)?t!==t&&e!==e:Wwt(t,e,n,r,fy,i)}var Gwt=1,Hwt=2;function Uwt(t,e,n,r){var i=n.length,o=i,a=!r;if(t==null)return!o;for(t=Object(t);i--;){var s=n[i];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<o;){s=n[i];var l=s[0],c=t[l],u=s[1];if(a&&s[2]){if(c===void 0&&!(l in t))return!1}else{var f=new Oi;if(r)var d=r(c,u,l,t,e,f);if(!(d===void 0?fy(u,c,Gwt|Hwt,r,f):d))return!1}}return!0}function _9(t){return t===t&&!Gn(t)}function Vwt(t){for(var e=qs(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,_9(i)]}return e}function S9(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function Xwt(t){var e=Vwt(t);return e.length==1&&e[0][2]?S9(e[0][0],e[0][1]):function(n){return n===t||Uwt(n,t,e)}}function qwt(t,e){return t!=null&&e in Object(t)}function Kwt(t,e,n){e=Kc(e,t);for(var r=-1,i=e.length,o=!1;++r<i;){var a=Zc(e[r]);if(!(o=t!=null&&n(t,a)))break;t=t[a]}return o||++r!=i?o:(i=t==null?0:t.length,!!i&&A_(i)&&ny(a,i)&&(Vt(t)||Zd(t)))}function E9(t,e){return t!=null&&Kwt(t,e,qwt)}var Zwt=1,Qwt=2;function Jwt(t,e){return L_(t)&&_9(e)?S9(Zc(t),e):function(n){var r=ge(n,t);return r===void 0&&r===e?E9(n,t):fy(e,r,Zwt|Qwt)}}function tOt(t){return function(e){return e==null?void 0:e[t]}}function eOt(t){return function(e){return ly(e,t)}}function nOt(t){return L_(t)?tOt(Zc(t)):eOt(t)}function U_(t){return typeof t=="function"?t:t==null?__:typeof t=="object"?Vt(t)?Jwt(t[0],t[1]):Xwt(t):nOt(t)}function rOt(t,e,n,r){for(var i=-1,o=t==null?0:t.length;++i<o;){var a=t[i];e(r,a,n(a),t)}return r}function iOt(t){return function(e,n,r){for(var i=-1,o=Object(e),a=r(e),s=a.length;s--;){var l=a[t?s:++i];if(n(o[l],l,o)===!1)break}return e}}var oOt=iOt();const M9=oOt;function aOt(t,e){return t&&M9(t,e,qs)}function sOt(t,e){return function(n,r){if(n==null)return n;if(!Ba(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=Object(n);(e?o--:++o<i)&&r(a[o],o,a)!==!1;);return n}}var lOt=sOt(aOt);const P9=lOt;function cOt(t,e,n,r){return P9(t,function(i,o,a){e(r,i,n(i),a)}),r}function uOt(t,e){return function(n,r){var i=Vt(n)?rOt:cOt,o=e?e():{};return i(n,t,U_(r),o)}}function V_(t,e,n){(n!==void 0&&!Kd(t[e],n)||n===void 0&&!(e in t))&&ry(t,e,n)}function fOt(t){return sr(t)&&Ba(t)}function X_(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function dOt(t){return Xs(t,th(t))}function hOt(t,e,n,r,i,o,a){var s=X_(t,n),l=X_(e,n),c=a.get(l);if(c){V_(t,n,c);return}var u=o?o(s,l,n+"",t,e,a):void 0,f=u===void 0;if(f){var d=Vt(l),h=!d&&Qd(l),p=!d&&!h&&k_(l);u=l,d||h||p?Vt(s)?u=s:fOt(s)?u=P_(s):h?(f=!1,u=KR(l,!0)):p?(f=!1,u=c9(l,!0)):u=[]:F_(l)||Zd(l)?(u=s,Zd(s)?u=dOt(s):(!Gn(s)||Vc(s))&&(u=u9(l))):f=!1}f&&(a.set(l,u),i(u,l,r,o,a),a.delete(l)),V_(t,n,u)}function A9(t,e,n,r,i){t!==e&&M9(e,function(o,a){if(i||(i=new Oi),Gn(o))hOt(t,e,a,n,A9,r,i);else{var s=r?r(X_(t,a),o,a+"",t,e,i):void 0;s===void 0&&(s=o),V_(t,a,s)}},th)}var pOt=LR(function(t,e,n,r){A9(t,e,n,r)});const vOt=pOt;function gOt(t,e,n){for(var r=-1,i=t==null?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function yOt(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var mOt=Imt(function(t,e){return t/e},1);const bOt=mOt;function xOt(t,e){var n=-1,r=Ba(t)?Array(t.length):[];return P9(t,function(i,o,a){r[++n]=e(i,o,a)}),r}function Jc(t,e){var n=Vt(t)?Zg:xOt;return n(t,U_(e))}var wOt="Expected a function",OOt=8,_Ot=32,SOt=128,EOt=256;function MOt(t){return D_(function(e){var n=e.length,r=n,i=Ra.prototype.thru;for(t&&e.reverse();r--;){var o=e[r];if(typeof o!="function")throw new TypeError(wOt);if(i&&!a&&Jg(o)=="wrapper")var a=new Ra([],!0)}for(r=a?r:n;++r<n;){o=e[r];var s=Jg(o),l=s=="wrapper"?ER(o):void 0;l&&PR(l[0])&&l[1]==(SOt|OOt|_Ot|EOt)&&!l[4].length&&l[9]==1?a=a[Jg(l[0])].apply(a,l[3]):a=o.length==1&&PR(o)?a[s]():a.thru(o)}return function(){var c=arguments,u=c[0];if(a&&c.length==1&&Vt(u))return a.plant(u).value();for(var f=0,d=n?e[f].apply(this,c):u;++f<n;)d=e[f].call(this,d);return d}})}var POt=MOt();const zt=POt;var AOt=Object.prototype,COt=AOt.hasOwnProperty,TOt=uOt(function(t,e,n){COt.call(t,n)?t[n].push(e):ry(t,n,[e])});const C9=TOt;var kOt="[object String]";function T9(t){return typeof t=="string"||!Vt(t)&&sr(t)&&Qi(t)==kOt}function LOt(t,e){return Zg(e,function(n){return t[n]})}function NOt(t){return t==null?[]:LOt(t,qs(t))}var IOt=Math.max;function jOt(t,e,n,r){t=Ba(t)?t:NOt(t),n=n&&!r?xR(n):0;var i=t.length;return n<0&&(n=IOt(i+n,0)),T9(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&CR(t,e,n)>-1}function DOt(t,e){return e.length<2?t:ly(t,Axt(e,0,-1))}var $Ot="[object Boolean]";function q_(t){return t===!0||t===!1||sr(t)&&Qi(t)==$Ot}function k9(t,e){return fy(t,e)}var FOt="[object Number]";function tu(t){return typeof t=="number"||sr(t)&&Qi(t)==FOt}function ROt(t){return t==null}function BOt(t){return t===void 0}function zOt(t,e){return e=Kc(e,t),t=DOt(t,e),t==null||delete t[Zc(yOt(e))]}function YOt(t){return F_(t)?void 0:t}var WOt=1,GOt=2,HOt=4,UOt=D_(function(t,e){var n={};if(t==null)return n;var r=!1;e=Zg(e,function(o){return o=Kc(o,t),r||(r=o.length>1),o}),Xs(t,e9(t),n),r&&(n=ih(n,WOt|GOt|HOt,YOt));for(var i=e.length;i--;)zOt(n,e[i]);return n});const K_=UOt;function L9(t,e,n,r){if(!Gn(t))return t;e=Kc(e,t);for(var i=-1,o=e.length,a=o-1,s=t;s!=null&&++i<o;){var l=Zc(e[i]),c=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(i!=a){var u=s[l];c=r?r(u,l,s):void 0,c===void 0&&(c=Gn(u)?u:ny(e[i+1])?[]:{})}iy(s,l,c),s=s[l]}return t}function VOt(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var a=e[r],s=ly(t,a);n(s,a)&&L9(o,Kc(a,t),s)}return o}function XOt(t,e){return VOt(t,e,function(n,r){return E9(t,r)})}var qOt=D_(function(t,e){return t==null?{}:XOt(t,e)});const N9=qOt;function ht(t,e,n){return t==null?t:L9(t,e,n)}var KOt=1/0,ZOt=Qc&&1/G_(new Qc([,-0]))[1]==KOt?function(t){return new Qc(t)}:SR;const QOt=ZOt;var JOt=200;function t_t(t,e,n){var r=-1,i=L1t,o=t.length,a=!0,s=[],l=s;if(n)a=!1,i=gOt;else if(o>=JOt){var c=e?null:QOt(t);if(c)return G_(c);a=!1,i=y9,l=new oh}else l=e?[]:s;t:for(;++r<o;){var u=t[r],f=e?e(u):u;if(u=n||u!==0?u:0,a&&f===f){for(var d=l.length;d--;)if(l[d]===f)continue t;e&&l.push(f),s.push(u)}else i(l,f,n)||(l!==s&&l.push(f),s.push(u))}return s}function Z_(t,e){return t&&t.length?t_t(t,U_(e)):[]}var e_t=function(t){var e=/react|\.jsx|children:\[\(|return\s+[A-Za-z0-9].createElement\((?!['"][g|circle|ellipse|image|rect|line|polyline|polygon|text|path|html|mesh]['"])([^\)])*,/i;return e.test(t)},Q_=function(){return Q_=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Q_.apply(this,arguments)},I9=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};function n_t(t,e){var n=q.useRef(),r=q.useRef(),i=q.useRef(null),o=e.onReady,a=e.onEvent,s=function(u,f){var d;u===void 0&&(u="image/png");var h=(d=i.current)===null||d===void 0?void 0:d.getElementsByTagName("canvas")[0];return h==null?void 0:h.toDataURL(u,f)},l=function(u,f,d){u===void 0&&(u="download"),f===void 0&&(f="image/png");var h=u;u.indexOf(".")===-1&&(h="".concat(u,".").concat(f.split("/")[1]));var p=s(f,d),v=document.createElement("a");return v.href=p,v.download=h,document.body.appendChild(v),v.click(),document.body.removeChild(v),v=null,h},c=function(u,f){f===void 0&&(f=!1);var d=Object.keys(u),h=f;d.forEach(function(p){var v=u[p];p==="tooltip"&&(h=!0),Vc(v)&&e_t("".concat(v))?u[p]=function(){for(var g=[],y=0;y<arguments.length;y++)g[y]=arguments[y];return hmt(v.apply(void 0,g),h)}:Vt(v)?v.forEach(function(g){c(g,h)}):Gn(v)?c(v,h):h=f})};return q.useEffect(function(){if(n.current&&!k9(r.current,e)){var u=!1;if(r.current){var f=r.current;f.data;var d=I9(f,["data"]);e.data;var h=I9(e,["data"]);u=k9(d,h)}r.current=g9(e),u?n.current.changeData(ge(e,"data")):(c(e),n.current.update(e),n.current.render())}},[e]),q.useEffect(function(){if(!i.current)return function(){return null};r.current||(r.current=g9(e)),c(e);var u=new t(i.current,Q_({},e));u.toDataURL=s,u.downloadImage=l,u.render(),n.current=u,o&&o(u);var f=function(d){a&&a(u,d)};return u.on("*",f),function(){n.current&&(n.current.destroy(),n.current.off("*",f),n.current=void 0)}},[]),{chart:n,container:i}}var r_t=function(t){return t!==null&&typeof t!="function"&&isFinite(t.length)};const j9=r_t;var i_t=function(t,e){if(!j9(t))return t;for(var n=[],r=0;r<t.length;r++){var i=t[r];e(i,r)&&n.push(i)}return n};const o_t=i_t,a_t=function(t){return typeof t=="function"};var s_t=function(t){return t==null};const l_t=s_t;var c_t={}.toString,u_t=function(t,e){return c_t.call(t)==="[object "+e+"]"};const J_=u_t,eu=function(t){return Array.isArray?Array.isArray(t):J_(t,"Array")},f_t=function(t){var e=typeof t;return t!==null&&e==="object"||e==="function"};function tS(t,e){if(t){var n;if(eu(t))for(var r=0,i=t.length;r<i&&(n=e(t[r],r),n!==!1);r++);else if(f_t(t)){for(var o in t)if(t.hasOwnProperty(o)&&(n=e(t[o],o),n===!1))break}}}var d_t=Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];return tS(t,function(n,r){a_t(t)&&r==="prototype"||e.push(r)}),e};const h_t=d_t;var p_t=function(t){return typeof t=="object"&&t!==null};const v_t=p_t;var g_t=function(t){if(!v_t(t)||!J_(t,"Object"))return!1;if(Object.getPrototypeOf(t)===null)return!0;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};const dy=g_t;var y_t=function(t,e,n){if(!eu(t)&&!dy(t))return t;var r=n;return tS(t,function(i,o){r=e(r,i,o)}),r};const m_t=y_t,eS=function(t){return J_(t,"String")};function nS(t,e){for(var n in e)e.hasOwnProperty(n)&&n!=="constructor"&&e[n]!==void 0&&(t[n]=e[n])}function b_t(t,e,n,r){return e&&nS(t,e),n&&nS(t,n),r&&nS(t,r),t}var x_t=5;function w_t(t,e){if(Object.hasOwn)return Object.hasOwn(t,e);if(t==null)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(t),e)}function D9(t,e,n,r){n=n||0,r=r||x_t;for(var i in e)if(w_t(e,i)){var o=e[i];o!==null&&dy(o)?(dy(t[i])||(t[i]={}),n<r?D9(t[i],o,n+1,r):t[i]=e[i]):eu(o)?(t[i]=[],t[i]=t[i].concat(o)):o!==void 0&&(t[i]=o)}}var O_t=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)D9(t,e[r]);return t};const hy=O_t,Ji=function(t,e,n){for(var r=0,i=eS(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return t===void 0||r<i.length?n:t};var __t=Object.prototype.hasOwnProperty;const $9=function(t,e){if(t===null||!dy(t))return{};var n={};return tS(e,function(r){__t.call(t,r)&&(n[r]=t[r])}),n};function S_t(t){return l_t(t)?0:j9(t)?t.length:Object.keys(t).length}const E_t={field:"value",size:[1,1],round:!1,padding:0,sort:(t,e)=>e.value-t.value,as:["x","y"],ignoreParentValue:!0},M_t="nodeIndex",ah="childNodeCount",P_t="nodeAncestor",rS="Invalid field: it must be a string!";function A_t(t,e){const{field:n,fields:r}=t;if(eS(n))return n;if(eu(n))return console.warn(rS),n[0];if(console.warn(`${rS} will try to get fields instead.`),eS(r))return r;if(eu(r)&&r.length)return r[0];if(e)return e;throw new TypeError(rS)}function C_t(t){const e=[];if(t&&t.each){let n,r;t.each(i=>{var o,a;i.parent!==n?(n=i.parent,r=0):r+=1;const s=o_t((((o=i.ancestors)===null||o===void 0?void 0:o.call(i))||[]).map(l=>e.find(c=>c.name===l.name)||l),({depth:l})=>l>0&&l<i.depth);i[P_t]=s,i[ah]=((a=i.children)===null||a===void 0?void 0:a.length)||0,i[M_t]=r,e.push(i)})}else t&&t.eachNode&&t.eachNode(n=>{e.push(n)});return e}function T_t(t,e){e=b_t({},E_t,e);const n=e.as;if(!eu(n)||n.length!==2)throw new TypeError('Invalid as: it must be an array with 2 strings (e.g. [ "x", "y" ])!');let r;try{r=A_t(e)}catch(l){console.warn(l)}const o=(l=>prt().size(e.size).round(e.round).padding(e.padding)(Wl(l).sum(c=>S_t(c.children)?e.ignoreParentValue?0:c[r]-m_t(c.children,(u,f)=>u+f[r],0):c[r]).sort(e.sort)))(t),a=n[0],s=n[1];return o.each(l=>{var c,u;l[a]=[l.x0,l.x1,l.x1,l.x0],l[s]=[l.y1,l.y1,l.y0,l.y0],l.name=l.name||((c=l.data)===null||c===void 0?void 0:c.name)||((u=l.data)===null||u===void 0?void 0:u.label),l.data.name=l.name,["x0","x1","y0","y1"].forEach(f=>{n.indexOf(f)===-1&&delete l[f]})}),C_t(o)}var k_t=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const nu="sunburst",iS="markType",F9="path",py="ancestor-node";function L_t(t){const{data:e,encode:n}=t,{color:r,value:i}=n,a=T_t(e,{field:i,type:"hierarchy.partition",as:["x","y"]}),s=[];return a.forEach(l=>{var c,u,f,d;if(l.depth===0)return null;let h=l.data.name;const p=[h];let v=Object.assign({},l);for(;v.depth>1;)h=`${(c=v.parent.data)===null||c===void 0?void 0:c.name} / ${h}`,p.unshift((u=v.parent.data)===null||u===void 0?void 0:u.name),v=v.parent;const g=Object.assign(Object.assign(Object.assign({},$9(l.data,[i])),{[F9]:h,[py]:v.data.name}),l);r&&r!==py&&(g[r]=l.data[r]||((d=(f=l.parent)===null||f===void 0?void 0:f.data)===null||d===void 0?void 0:d[r])),s.push(g)}),s.map(l=>Object.assign(Object.assign({},l),{x:l.x.slice(0,2),y:[l.y[2],l.y[0]],fillOpacity:Math.pow(.85,l.depth)}))}const R9={id:nu,encode:{x:"x",y:"y",key:F9,color:py,value:"value"},axis:{x:!1,y:!1},style:{[iS]:nu,stroke:"#fff",lineWidth:.5,fillOpacity:"fillOpacity",[ah]:ah,depth:"depth"},state:{active:{zIndex:2,stroke:"#000"},inactive:{zIndex:1,stroke:"#fff"}},legend:!1,interaction:{drillDown:!0},coordinate:{type:"polar",innerRadius:.2}},B9=t=>{const{encode:e,data:n=[],legend:r}=t,i=k_t(t,["encode","data","legend"]),o=Object.assign(Object.assign({},i.coordinate),{innerRadius:Math.max(Ji(i,["coordinate","innerRadius"],.2),1e-5)}),a=Object.assign(Object.assign({},R9.encode),e),{value:s}=a,l=L_t({encode:a,data:n});return[hy({},R9,Object.assign(Object.assign({type:"rect",data:l,encode:a,tooltip:{title:"path",items:[c=>({name:s,value:c[s]})]}},i),{coordinate:o}))]};B9.props={};var N_t=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?o(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})};const I_t=t=>t.querySelectorAll(".element").filter(e=>Ji(e,["style",iS])===nu);function j_t(t){return gt(t).select(`.${Nf}`).node()}const D_t={rootText:"root",style:{fill:"rgba(0, 0, 0, 0.85)",fontSize:12,y:1},active:{fill:"rgba(0, 0, 0, 0.5)"}};function $_t(t={}){const{breadCrumb:e={},fixedColor:n=!0}=t,r=hy({},D_t,e);return i=>{const{update:o,setState:a,container:s,view:l,options:c}=i,u=j_t(s),f=c.marks.find(({id:m})=>m===nu),{state:d}=f,h=new sn;u.appendChild(h);const p=(m,b)=>N_t(this,void 0,void 0,function*(){if(h.removeChildren(),m){const x=new jr({style:Object.assign({x:0,text:r.rootText,depth:0},r.style)});h.appendChild(x);let w="";const O=m==null?void 0:m.split(" / ");let _=r.style.y,S=h.getBBox().width;const E=u.getBBox().width,M=O.map((P,C)=>{const A=new jr({style:Object.assign(Object.assign({x:S,text:" / "},r.style),{y:_})});h.appendChild(A),S+=A.getBBox().width,w=`${w}${P} / `;const T=new jr({name:w.replace(/\s\/\s$/,""),style:Object.assign(Object.assign({text:P,x:S,depth:C+1},r.style),{y:_})});return h.appendChild(T),S+=T.getBBox().width,S>E&&(_=h.getBBox().height,S=0,A.attr({x:S,y:_}),S+=A.getBBox().width,T.attr({x:S,y:_}),S+=T.getBBox().width),T});[x,...M].forEach((P,C)=>{if(C===M.length)return;const A=Object.assign({},P.attributes);P.attr("cursor","pointer"),P.addEventListener("mouseenter",()=>{P.attr(r.active)}),P.addEventListener("mouseleave",()=>{P.attr(A)}),P.addEventListener("click",()=>{p(P.name,Ji(P,["style","depth"]))})})}a("drillDown",x=>{const{marks:w}=x,O=w.map(_=>{if(_.id!==nu&&_.type!=="rect")return _;const{data:S}=_,E=Object.fromEntries(["color"].map(P=>[P,{domain:l.scale[P].getOptions().domain}])),M=S.filter(P=>{const C=P.path;return n&&(P[py]=C.split(" / ")[b]),m?new RegExp(`^${m}.+`).test(C):!0});return hy({},_,n?{data:M}:{data:M,scale:E})});return Object.assign(Object.assign({},x),{marks:O})}),yield o()}),v=m=>{const b=m.target;if(Ji(b,["style",iS])!==nu||Ji(b,["markType"])!=="rect"||!Ji(b,["style",ah]))return;const x=Ji(b,["__data__","key"]),w=Ji(b,["style","depth"]);b.style.cursor="pointer",p(x,w)};u.addEventListener("click",v);const g=h_t(Object.assign(Object.assign({},d.active),d.inactive)),y=()=>{I_t(u).forEach(b=>{const x=Ji(b,["style",ah]);if(Ji(b,["style","cursor"])!=="pointer"&&x){b.style.cursor="pointer";const O=$9(b.attributes,g);b.addEventListener("mouseenter",()=>{b.attr(d.active)}),b.addEventListener("mouseleave",()=>{b.attr(hy(O,d.inactive))})}})};return u.addEventListener("mousemove",y),()=>{h.remove(),u.removeEventListener("click",v),u.removeEventListener("mousemove",y)}}}U.enableCSSParsing=!1;function F_t(){return{"interaction.drillDown":$_t,"mark.sunburst":B9}}var vy=function(){return vy=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},vy.apply(this,arguments)},R_t=Avt(ngt,vy(vy({},W$()),F_t())),Xt=function(t){var e=z_t(t),n=e.children,r=n===void 0?[]:n,i=K_(e,[].concat(W9,gy.map(function(c){return c.key}))),o=function(c){var u;return(u=U_t.find(function(f){return f.key===c}))===null||u===void 0?void 0:u.callback},a=function(c,u,f){var d=o(u);d?d(c,u,f):c[u]=za({},c[u],f)},s=function(c){Object.keys(c).forEach(function(u){var f=gy.find(function(p){return p.key===u});if(f){var d=f.type,h=f.extend_keys;d?r.push(l(za({},N9(c,h),{type:d},c[u]))):Vt(c[u])&&c[u].forEach(function(p){r.push(l(p))})}})},l=function(c){return s(c),Object.keys(aS).forEach(function(u){var f=aS[u];if(!BOt(c[u]))if(Gn(f)){var d=f.value,h=f.target,p=d(c[u]);a(c,h,p)}else ht(c,f,c[u])}),c};return r.forEach(function(c){var u=za({},i,c);l(za(c,u))}),s(e),B_t(e),t},z9=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},B_t=function(t){var e=t.children,n=e===void 0?[]:e,r=Object.keys(aS).concat(gy.map(function(i){return i.key}));return r.forEach(function(i){delete t[i]}),n.forEach(function(i){Object.keys(i).forEach(function(o){r.includes(o)&&delete i[o]})}),Object.keys(t).forEach(function(i){z9(z9([],W9,!0),lS.map(function(o){return o.key}),!0).includes(i)||delete t[i]}),t},z_t=function(t){var e=t.options,n=e.children,r=n===void 0?[]:n;return r.forEach(function(i){Object.keys(i).forEach(function(o){Vt(i[o])&&o!=="data"&&(i[o]=i[o].filter(function(a){return!a[oS]}))})}),e},Y9=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Y_t=function(t,e){if(Vt(e))return e},za=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return vOt.apply(void 0,Y9(Y9([],t,!1),[Y_t],!1))},sh=function(){return sh=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},sh.apply(this,arguments)},W_t=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},G_t=["renderer"],W9=["width","height","autoFit","theme","inset","insetLeft","insetRight","insetTop","insetBottom","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","margin","marginTop","marginRight","marginBottom","marginLeft","depth","title","clip","children","type","data","direction"],oS="__transform__",H_t="__skipDelCustomKeys__",Qs=function(t,e){return q_(e)?{type:t,available:e}:sh({type:t},e)},aS={xField:"encode.x",yField:"encode.y",colorField:"encode.color",angleField:"encode.y",keyField:"encode.key",sizeField:"encode.size",shapeField:"encode.shape",seriesField:"encode.series",positionField:"encode.position",textField:"encode.text",valueField:"encode.value",binField:"encode.x",srcField:"encode.src",linkColorField:"encode.linkColor",radius:"coordinate.outerRadius",innerRadius:"coordinate.innerRadius",startAngle:"coordinate.startAngle",endAngle:"coordinate.endAngle",focusX:"coordinate.focusX",focusY:"coordinate.focusY",distortionX:"coordinate.distortionX",distortionY:"coordinate.distortionY",visual:"coordinate.visual",stack:{target:"transform",value:function(t){return Qs("stackY",t)}},normalize:{target:"transform",value:function(t){return Qs("normalizeY",t)}},percent:{target:"transform",value:function(t){return Qs("normalizeY",t)}},group:{target:"transform",value:function(t){return Qs("dodgeX",t)}},sort:{target:"transform",value:function(t){return Qs("sortX",t)}},symmetry:{target:"transform",value:function(t){return Qs("symmetryY",t)}},diff:{target:"transform",value:function(t){return Qs("diffY",t)}},meta:{target:"scale",value:function(t){return t}},label:{target:"labels",value:function(t){return t}},shape:"style.shape",connectNulls:{target:"style",value:function(t){return q_(t)?{connect:t}:t}}},sS=["xField","yField","seriesField","colorField","keyField","positionField","meta","tooltip","animate","stack","normalize","percent","group","sort","symmetry","diff"],gy=[{key:"annotations",extend_keys:[]},{key:"line",type:"line",extend_keys:sS},{key:"point",type:"point",extend_keys:sS},{key:"area",type:"area",extend_keys:sS}],U_t=[{key:"transform",callback:function(t,e,n){var r;t[e]=t[e]||[];var i=n.available,o=i===void 0?!0:i,a=W_t(n,["available"]);o?t[e].push(sh((r={},r[oS]=!0,r),a)):t[e].splice(t[e].indexOf(function(s){return s.type===n.type}),1)}},{key:"labels",callback:function(t,e,n){var r;if(!n||Vt(n)){t[e]=n||[];return}n.text||(n.text=t.yField),t[e]=t[e]||[],t[e].push(sh((r={},r[oS]=!0,r),n))}}],lS=[{key:"conversionTag",shape:"ConversionTag"},{key:"axisText",shape:"BidirectionalBarAxisText"}],V_t=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),yy=function(){return yy=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},yy.apply(this,arguments)},X_t=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},G9=function(t){V_t(e,t);function e(n){n===void 0&&(n={});var r=n.style,i=X_t(n,["style"]);return t.call(this,yy({style:yy({text:"",fontSize:12,textBaseline:"middle",textAlign:"center",fill:"#000",fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1},r)},i))||this}return e}(jr),q_t=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),my=function(){return my=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},my.apply(this,arguments)},K_t=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},Z_t=function(t){q_t(e,t);function e(n){n===void 0&&(n={});var r=n.style,i=K_t(n,["style"]);return t.call(this,my({style:my({fill:"#eee"},r)},i))||this}return e}(of),Q_t=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),H9=function(t){Q_t(e,t);function e(n,r,i){var o=t.call(this,{style:za(i,r)})||this;return o.chart=n,o}return e.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this)},e.prototype.disconnectedCallback=function(){},e.prototype.attributeChangedCallback=function(n){},e.prototype.update=function(n,r){var i;return this.attr(za({},this.attributes,n||{})),(i=this.render)===null||i===void 0?void 0:i.call(this,this.attributes,this,r)},e.prototype.clear=function(){this.removeChildren()},e.prototype.getElementsLayout=function(){var n=this.chart.getContext().canvas,r=n.document.getElementsByClassName("element"),i=[];return r.forEach(function(o){var a=o.getBBox(),s=a.x,l=a.y,c=a.width,u=a.height,f=o.__data__;i.push({bbox:a,x:s,y:l,width:c,height:u,key:f.key,data:f})}),i},e.prototype.bindEvents=function(n,r){},e}(wp),J_t=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),by=function(){return by=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},by.apply(this,arguments)},tSt=function(t){J_t(e,t);function e(n,r){return t.call(this,n,r,{type:e.tag})||this}return e.prototype.getConversionTagLayout=function(){var n=this.direction==="vertical",r=this.getElementsLayout(),i=r[0],o=i.x,a=i.y,s=i.height,l=i.width,c=i.data,u=["items",0,"value"],f=ge(c,u),d=n?r[1].y-a-s:r[1].x-o-l,h=[],p=this.attributes,v=p.size,g=v===void 0?40:v,y=p.arrowSize,m=y===void 0?20:y,b=p.spacing,x=b===void 0?4:b;return r.forEach(function(w,O){if(O>0){var _=w.x,S=w.y,E=w.height,M=w.width,P=w.data,C=w.key,A=ge(P,u),T=g/2;if(n){var k=_+M/2,N=S;h.push({points:[[k+T,N-d+x],[k+T,N-m-x],[k,N-x],[k-T,N-m-x],[k-T,N-d+x]],center:[k,N-d/2-x],width:d,value:[f,A],key:C})}else{var k=_,N=S+E/2;h.push({points:[[_-d+x,N-T],[_-m-x,N-T],[k-x,N],[_-m-x,N+T],[_-d+x,N+T]],center:[k-d/2-x,N],width:d,value:[f,A],key:C})}f=A}}),h},e.prototype.render=function(){this.setDirection(),this.drawConversionTag()},e.prototype.setDirection=function(){var n=this.chart.getCoordinate(),r=ge(n,"options.transformations"),i="horizontal";r.forEach(function(o){o.includes("transpose")&&(i="vertical")}),this.direction=i},e.prototype.drawConversionTag=function(){var n=this,r=this.getConversionTagLayout(),i=this.attributes,o=i.style,a=i.text,s=a.style,l=a.formatter;r.forEach(function(c){var u=c.points,f=c.center,d=c.value,h=c.key,p=d[0],v=d[1],g=f[0],y=f[1],m=new Z_t({style:by({points:u,fill:"#eee"},o),id:"polygon-".concat(h)}),b=new G9({style:by({x:g,y,text:Vc(l)?l(p,v):(v/p*100).toFixed(2)+"%"},s),id:"text-".concat(h)});n.appendChild(m),n.appendChild(b)})},e.prototype.update=function(){var n=this,r=this.getConversionTagLayout();r.forEach(function(i){var o=i.points,a=i.center,s=i.key,l=a[0],c=a[1],u=n.getElementById("polygon-".concat(s)),f=n.getElementById("text-".concat(s));u.setAttribute("points",o),f.setAttribute("x",l),f.setAttribute("y",c)})},e.tag="ConversionTag",e}(H9),cS=32,U9=16,V9=48,eSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),lh=function(){return lh=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},lh.apply(this,arguments)},nSt=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},rSt=function(t){eSt(e,t);function e(n,r){return t.call(this,n,r,{type:e.tag})||this}return e.prototype.render=function(){this.drawText()},e.prototype.getBidirectionalBarAxisTextLayout=function(){var n=this.attributes.layout,r=n==="vertical",i=this.getElementsLayout(),o=r?Z_(i,"x"):Z_(i,"y"),a=["title"],s=[],l=this.chart.getContext().views,c=ge(l,[0,"layout"]),u=c.width,f=c.height;return o.forEach(function(d){var h=d.x,p=d.y,v=d.height,g=d.width,y=d.data,m=d.key,b=ge(y,a);r?s.push({x:h+g/2,y:f,text:b,key:m}):s.push({x:u,y:p+v/2,text:b,key:m})}),Z_(s,"text").length!==s.length&&(s=Object.values(C9(s,"text")).map(function(d){var h,p=d.reduce(function(v,g){return v+(r?g.x:g.y)},0);return lh(lh({},d[0]),(h={},h[r?"x":"y"]=p/d.length,h))})),s},e.prototype.transformLabelStyle=function(n){var r={},i=/^label[A-Z]/;return Object.keys(n).forEach(function(o){i.test(o)&&(r[o.replace("label","").replace(/^[A-Z]/,function(a){return a.toLowerCase()})]=n[o])}),r},e.prototype.drawText=function(){var n=this,r=this.getBidirectionalBarAxisTextLayout(),i=this.attributes,o=i.layout,a=i.labelFormatter,s=nSt(i,["layout","labelFormatter"]);r.forEach(function(l){var c=l.x,u=l.y,f=l.text,d=l.key,h=new G9({style:lh({x:c,y:u,text:Vc(a)?a(f):f,wordWrap:!0,wordWrapWidth:o==="horizontal"?cS*2:120,maxLines:2,textOverflow:"ellipsis"},n.transformLabelStyle(s)),id:"text-".concat(d)});n.appendChild(h)})},e.prototype.update=function(){var n=this,r=this.getBidirectionalBarAxisTextLayout();r.forEach(function(i){var o=i.x,a=i.y,s=i.key,l=n.getElementById("text-".concat(s));l.setAttribute("x",o),l.setAttribute("y",a)})},e.tag="BidirectionalBarAxisText",e}(H9),iSt={ConversionTag:tSt,BidirectionalBarAxisText:rSt},oSt=function(){function t(e,n){this.container=new Map,this.chart=e,this.config=n,this.init()}return t.prototype.init=function(){var e=this;lS.forEach(function(n){var r,i=n.key,o=n.shape,a=e.config[i];if(a){var s=new iSt[o](e.chart,a),l=e.chart.getContext().canvas;l.appendChild(s),e.container.set(i,s)}else(r=e.container.get(i))===null||r===void 0||r.clear()})},t.prototype.update=function(){var e=this;this.container.size&&lS.forEach(function(n){var r=n.key,i=e.container.get(r);i==null||i.update()})},t}(),aSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ru=function(){return ru=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ru.apply(this,arguments)},X9="data-chart-source-type",Rt=function(t){aSt(e,t);function e(n,r){var i=t.call(this)||this;return i.container=typeof n=="string"?document.getElementById(n):n,i.options=i.mergeOption(r),i.createG2(),i.bindEvents(),i}return e.prototype.getChartOptions=function(){return ru(ru({},N9(this.options,G_t)),{container:this.container})},e.prototype.getSpecOptions=function(){return this.type==="base"||this[H_t]?ru(ru({},this.options),this.getChartOptions()):this.options},e.prototype.createG2=function(){if(!this.container)throw Error("The container is not initialized!");this.chart=new R_t(this.getChartOptions()),this.container.setAttribute(X9,"Ant Design Charts")},e.prototype.bindEvents=function(){var n=this;this.chart&&this.chart.on("*",function(r){r!=null&&r.type&&n.emit(r.type,r)})},e.prototype.getBaseOptions=function(){return{type:"view",autoFit:!0}},e.prototype.getDefaultOptions=function(){},e.prototype.render=function(){var n=this;this.type!=="base"&&this.execAdaptor(),this.chart.options(this.getSpecOptions()),this.chart.render().then(function(){n.annotation=new oSt(n.chart,n.options)}),this.bindSizeSensor()},e.prototype.update=function(n){this.options=this.mergeOption(n)},e.prototype.mergeOption=function(n){return za({},this.getBaseOptions(),this.getDefaultOptions(),n)},e.prototype.changeData=function(n){this.chart.changeData(n)},e.prototype.changeSize=function(n,r){this.chart.changeSize(n,r)},e.prototype.destroy=function(){this.chart.destroy(),this.off(),this.container.removeAttribute(X9)},e.prototype.execAdaptor=function(){var n=this.getSchemaAdaptor();n({chart:this.chart,options:this.options})},e.prototype.triggerResize=function(){this.chart.forceFit()},e.prototype.bindSizeSensor=function(){var n=this,r=this.options.autoFit,i=r===void 0?!0:r;i&&this.chart.on(Ut.AFTER_CHANGE_SIZE,function(){n.annotation.update()})},e}(Ax),sSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),lSt=function(t){sSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="base",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"line"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return function(n){return n}},e}(Rt),uS=function(){return uS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},uS.apply(this,arguments)};function cSt(t){var e=t.options,n=e.stack,r=e.tooltip,i=e.xField;if(!n)return t;var o=gy.map(function(s){return s.type}).filter(function(s){return!!s}),a=!1;return o.forEach(function(s){e[s]&&(a=!0,ht(e,[s,"stack"],uS({y1:"y"},typeof n=="object"?n:{})))}),a&&!q_(r)&&!r&&ht(e,"tooltip",{title:i,items:[{channel:"y"}]}),t}function Fe(t){return zt(cSt)(t)}function uSt(t){var e=t.options.layout,n=e===void 0?"horizontal":e;return t.options.coordinate.transform=n!=="horizontal"?void 0:[{type:"transpose"}],t}function fSt(t){uSt(t);var e=t.options.layout,n=e===void 0?"horizontal":e;return t.options.children.forEach(function(r){var i;!((i=r==null?void 0:r.coordinate)===null||i===void 0)&&i.transform&&(r.coordinate.transform=n!=="horizontal"?void 0:[{type:"transpose"}])}),t}function dSt(t){return zt(Fe,Xt)(t)}var hSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),pSt=function(t){hSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="area",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"area"}],scale:{y:{nice:!0}},axis:{y:{title:!1},x:{title:!1}},interaction:{tooltip:{shared:!0}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return dSt},e}(Rt),iu=function(){return iu=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},iu.apply(this,arguments)};function q9(t){var e=function(n){var r=n.options;ge(r,"children.length")>1&&ht(r,"children",[{type:"interval"}]);var i=r.scale,o=r.markBackground,a=r.data,s=r.children,l=r.yField,c=ge(i,"y.domain",[]);if(o&&c.length&&Vt(a)){var u="domainMax",f=a.map(function(d){var h;return iu(iu({originData:iu({},d)},K_(d,l)),(h={},h[u]=c[c.length-1],h))});s.unshift(iu({type:"interval",data:f,yField:u,tooltip:!1,style:{fill:"#eee"},label:!1},o))}return n};return zt(e,Fe,Xt)(t)}var vSt=function(){var t=function(e,n){return function(r){var i=e.fill,o=i===void 0?"#2888FF":i,a=e.stroke,s=e.fillOpacity,l=s===void 0?1:s,c=e.strokeOpacity,u=c===void 0?.2:c,f=e.pitch,d=f===void 0?8:f,h=r[0],p=r[1],v=r[2],g=r[3],y=(p[1]-h[1])/2,m=n.document,b=m.createElement("g",{}),x=m.createElement("polygon",{style:{points:[h,[h[0]-d,h[1]+y],[v[0]-d,h[1]+y],g],fill:o,fillOpacity:l,stroke:a,strokeOpacity:u,inset:30}}),w=m.createElement("polygon",{style:{points:[[h[0]-d,h[1]+y],p,v,[v[0]-d,h[1]+y]],fill:o,fillOpacity:l,stroke:a,strokeOpacity:u}}),O=m.createElement("polygon",{style:{points:[h,[h[0]-d,h[1]+y],p,[h[0]+d,h[1]+y]],fill:o,fillOpacity:l-.2}});return b.appendChild(x),b.appendChild(w),b.appendChild(O),b}};H$("shape.interval.bar25D",t)},gSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();vSt();var ySt=function(t){gSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="Bar",n}return e.getDefaultOptions=function(){return{type:"view",coordinate:{transform:[{type:"transpose"}]},children:[{type:"interval"}],scale:{y:{nice:!0}},axis:{y:{title:!1},x:{title:!1}},interaction:{tooltip:{shared:!0},elementHighlightByColor:{background:!0}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return q9},e}(Rt),mSt=function(){var t=function(e,n){return function(r){var i=e.fill,o=i===void 0?"#2888FF":i,a=e.stroke,s=e.fillOpacity,l=s===void 0?1:s,c=e.strokeOpacity,u=c===void 0?.2:c,f=e.pitch,d=f===void 0?8:f,h=r[1][0]-r[0][0],p=h/2+r[0][0],v=n.document,g=v.createElement("g",{}),y=v.createElement("polygon",{style:{points:[[r[0][0],r[0][1]],[p,r[1][1]+d],[p,r[3][1]+d],[r[3][0],r[3][1]]],fill:o,fillOpacity:l,stroke:a,strokeOpacity:u,inset:30}}),m=v.createElement("polygon",{style:{points:[[p,r[1][1]+d],[r[1][0],r[1][1]],[r[2][0],r[2][1]],[p,r[2][1]+d]],fill:o,fillOpacity:l,stroke:a,strokeOpacity:u}}),b=v.createElement("polygon",{style:{points:[[r[0][0],r[0][1]],[p,r[1][1]-d],[r[1][0],r[1][1]],[p,r[1][1]+d]],fill:o,fillOpacity:l-.2}});return g.appendChild(m),g.appendChild(y),g.appendChild(b),g}};H$("shape.interval.column25D",t)},bSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();mSt();var xSt=function(t){bSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="column",n}return e.getDefaultOptions=function(){return{type:"view",scale:{y:{nice:!0}},interaction:{tooltip:{shared:!0},elementHighlightByColor:{background:!0}},axis:{y:{title:!1},x:{title:!1}},children:[{type:"interval"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return q9},e}(Rt);function wSt(t){var e=function(r){var i=r.options,o=i.children,a=o===void 0?[]:o,s=i.legend;return s&&a.forEach(function(l){if(!ge(l,"colorField")){var c=ge(l,"yField");ht(l,"colorField",function(){return c})}}),r},n=function(r){var i=r.options,o=i.annotations,a=o===void 0?[]:o,s=i.children,l=s===void 0?[]:s,c=i.scale,u=!1;return ge(c,"y.key")||l.forEach(function(f,d){if(!ge(f,"scale.y.key")){var h="child".concat(d,"Scale");ht(f,"scale.y.key",h);var p=f.annotations,v=p===void 0?[]:p;v.length>0&&(ht(f,"scale.y.independent",!1),v.forEach(function(g){ht(g,"scale.y.key",h)})),!u&&a.length>0&&ge(f,"scale.y.independent")===void 0&&(u=!0,ht(f,"scale.y.independent",!1),a.forEach(function(g){ht(g,"scale.y.key",h)}))}}),r};return zt(e,n,Fe,Xt)(t)}var OSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),K9=function(t){OSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="DualAxes",n}return e.getDefaultOptions=function(){return{type:"view",axis:{y:{title:!1,tick:!1},x:{title:!1}},scale:{y:{independent:!0,nice:!0}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return wSt},e}(Rt);function _St(t){var e=function(o){var a=o.options,s=a.xField,l=a.colorField;return l||ht(a,"colorField",s),o},n=function(o){var a=o.options,s=a.compareField,l=a.transform,c=a.isTransposed,u=c===void 0?!0:c,f=a.coordinate;return l||(s?ht(a,"transform",[]):ht(a,"transform",[{type:"symmetryY"}])),!f&&u&&ht(a,"coordinate",{transform:[{type:"transpose"}]}),o},r=function(o){var a=o.options,s=a.compareField,l=a.seriesField,c=a.data,u=a.children,f=a.yField,d=a.isTransposed,h=d===void 0?!0:d;if(s||l){var p=Object.values(C9(c,function(v){return v[s||l]}));u[0].data=p[0],u.push({type:"interval",data:p[1],yField:function(v){return-v[f]}}),delete a.compareField,delete a.data}return l&&(ht(a,"type","spaceFlex"),ht(a,"ratio",[1,1]),ht(a,"direction",h?"row":"col"),delete a.seriesField),o},i=function(o){var a=o.options,s=a.tooltip,l=a.xField,c=a.yField;return s||ht(a,"tooltip",{title:!1,items:[function(u){return{name:u[l],value:u[c]}}]}),o};return zt(e,n,r,i,Fe,Xt)(t)}var SSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ESt=function(t){SSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="column",n}return e.getDefaultOptions=function(){return{type:"view",scale:{x:{padding:0}},animate:{enter:{type:"fadeIn"}},axis:!1,shapeField:"funnel",label:{position:"inside",transform:[{type:"contrastReverse"}]},children:[{type:"interval"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return _St},e}(Rt);function MSt(t){return zt(Fe,Xt)(t)}var PSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ASt=function(t){PSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="line",n}return e.getDefaultOptions=function(){return{type:"view",scale:{y:{nice:!0}},interaction:{tooltip:{shared:!0}},axis:{y:{title:!1},x:{title:!1}},children:[{type:"line"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return MSt},e}(Rt),Ya=function(){return Ya=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Ya.apply(this,arguments)};function CSt(t){var e=function(n){var r=n.options,i=r.angleField,o=r.data,a=r.label,s=r.tooltip,l=r.colorField;if(Vt(o)){var c=o.reduce(function(f,d){return f+d[i]},0);if(c===0){var u=o.map(function(f){var d;return Ya(Ya({},f),(d={},d[i]=1,d))});ht(r,"data",u),a&&ht(r,"label",Ya(Ya({},a),{formatter:function(){return 0}})),s!==!1&&ht(r,"tooltip",Ya(Ya({},s),{items:[function(f){return{name:f[l],value:0}}]}))}}return n};return zt(e,Xt)(t)}var TSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),kSt=function(t){TSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="pie",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"interval"}],coordinate:{type:"theta"},transform:[{type:"stackY",reverse:!0}],animate:{enter:{type:"waveIn"}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return CSt},e}(Rt);function LSt(t){return zt(Fe,Xt)(t)}var NSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ISt=function(t){NSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="scatter",n}return e.getDefaultOptions=function(){return{axis:{y:{title:!1},x:{title:!1}},legend:{size:!1},children:[{type:"point"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return LSt},e}(Rt);function jSt(t){var e=function(n){return ht(n,"options.coordinate",{type:ge(n,"options.coordinateType","polar")}),n};return zt(e,Xt)(t)}var DSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$St=function(t){DSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="radar",n}return e.getDefaultOptions=function(){return{axis:{x:{grid:!0,line:!0},y:{zIndex:1,title:!1,line:!0,nice:!0}},meta:{x:{padding:.5,align:0}},interaction:{tooltip:{style:{crosshairsLineDash:[4,4]}}},children:[{type:"line"}],coordinateType:"polar"}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return jSt},e}(Rt),Do=function(){return Do=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Do.apply(this,arguments)},FSt="__stock-range__",RSt="trend",BSt="up",zSt="down";function YSt(t){var e=function(r){var i=r.options,o=i.data,a=i.yField;return r.options.data=Jc(o,function(s){var l=s&&Do({},s);if(Array.isArray(a)&&l){var c=a[0],u=a[1],f=a[2],d=a[3];l[RSt]=l[c]<=l[u]?BSt:zSt,l[FSt]=[l[c],l[u],l[f],l[d]]}return l}),r},n=function(r){var i=r.options,o=i.xField,a=i.yField,s=i.fallingFill,l=i.risingFill,c=a[0],u=a[1],f=a[2],d=a[3];return r.options.children=Jc(r.options.children,function(h,p){var v=p===0;return Do(Do({},h),{tooltip:{title:function(g){return g[o]instanceof Date?g[o].toLocaleString():g[o]},items:[{field:f},{field:d},{field:c},{field:u}]},encode:Do(Do({},h.encode||{}),{y:v?[f,d]:[c,u],color:function(g){return Math.sign(g[u]-g[c])}}),style:Do(Do({},h.style||{}),{lineWidth:v?1:10})})}),delete i.yField,r.options.legend={color:!1},s&&ht(r,"options.scale.color.range[0]",s),l&&ht(r,"options.scale.color.range[2]",l),r};return zt(e,n,Xt)(t)}var WSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),GSt=["#26a69a","#999999","#ef5350"],HSt=function(t){WSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="stock",n}return e.getDefaultOptions=function(){return{type:"view",scale:{color:{domain:[-1,0,1],range:GSt},y:{nice:!0}},children:[{type:"link"},{type:"link"}],axis:{x:{title:!1,grid:!1},y:{title:!1,grid:!0,gridLineDash:null}},animate:{enter:{type:"scaleInY"}},interaction:{tooltip:{shared:!0,marker:!1,groupName:!1,crosshairs:!0}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return YSt},e}(Rt);function USt(t){return zt(Fe,Xt)(t)}var VSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),XSt=function(t){VSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="TinyLine",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"line",axis:!1}],autoFit:!1,animate:{enter:{type:"growInX",duration:500}},padding:0,margin:0,tooltip:!1}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return USt},e}(Rt);function qSt(t){return zt(Fe,Xt)(t)}var KSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ZSt=function(t){KSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="TinyArea",n}return e.getDefaultOptions=function(){return{type:"view",animate:{enter:{type:"growInX",duration:500}},children:[{type:"area",axis:!1}],autoFit:!1,padding:0,margin:0,tooltip:!1}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return qSt},e}(Rt);function QSt(t){return zt(Fe,Xt)(t)}var JSt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),tEt=function(t){JSt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="TinyColumn",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"interval",axis:!1}],autoFit:!1,padding:0,margin:0,tooltip:!1}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return QSt},e}(Rt),fS=function(){return fS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},fS.apply(this,arguments)};function eEt(t){var e=function(n){var r=n.options,i=r.percent,o=r.color,a=o===void 0?[]:o;if(!i)return n;var s={scale:{color:{range:a.length?a:[]}},data:[1,i]};return Object.assign(r,fS({},s)),n};return zt(e,Fe,Xt)(t)}var nEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),rEt=function(t){nEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="TinyProgress",n}return e.getDefaultOptions=function(){return{type:"view",data:[],autoFit:!1,margin:0,padding:0,tooltip:!1,children:[{interaction:{tooltip:!1},coordinate:{transform:[{type:"transpose"}]},type:"interval",axis:!1,legend:!1,encode:{y:function(n){return n},color:function(n,r){return r}}}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return eEt},e}(Rt),dS=function(){return dS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},dS.apply(this,arguments)};function iEt(t){var e=function(r){var i=r.options,o=i.radius,a=o===void 0?.8:o;return ht(r,"options.coordinate.innerRadius",a),r},n=function(r){var i=r.options,o=i.percent,a=i.color,s=a===void 0?[]:a;if(!o)return r;var l={scale:{color:{range:s.length?s:[]}},data:[1,o]};return Object.assign(i,dS({},l)),r};return zt(e,n,Fe,Xt)(t)}var oEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),aEt=function(t){oEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="TinyRing",n}return e.getDefaultOptions=function(){return{type:"view",data:[],autoFit:!1,margin:0,padding:0,coordinate:{type:"theta"},animate:{enter:{type:"waveIn"}},interaction:{tooltip:!1},tooltip:!1,children:[{type:"interval",axis:!1,legend:!1,encode:{y:function(n){return n},color:function(n,r){return r}}}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return iEt},e}(Rt);function sEt(t){return zt(Xt)(t)}var lEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),cEt=function(t){lEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="rose",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"interval"}],coordinate:{type:"polar"},animate:{enter:{type:"waveIn"}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return sEt},e}(Rt),hS="__start__",ou="__end__",pS="__waterfall_value__",vS=function(){return vS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},vS.apply(this,arguments)},uEt=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};function fEt(t){var e=function(r){var i=r.options,o=i.data,a=o===void 0?[]:o,s=i.yField;return a.length&&(a.reduce(function(l,c,u){var f;if(u===0||c.isTotal)c[hS]=0,c[ou]=c[s],c[pS]=c[s];else{var d=(f=l[ou])!==null&&f!==void 0?f:l[s];c[hS]=d,c[ou]=d+c[s],c[pS]=l[ou]}return c},[]),Object.assign(i,{yField:[hS,ou]})),r},n=function(r){var i=r.options,o=i.data,a=o===void 0?[]:o,s=i.xField,l=i.children,c=i.linkStyle,u=uEt([],a,!0);return u.reduce(function(f,d,h){return h>0&&(d.x1=f[s],d.x2=d[s],d.y1=f[ou]),d},[]),u.shift(),l.push({type:"link",xField:["x1","x2"],yField:"y1",zIndex:-1,data:u,style:vS({stroke:"#697474"},c),label:!1,tooltip:!1}),r};return zt(e,n,Fe,Xt)(t)}var dEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),hEt=function(t){dEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="waterfall",n}return e.getDefaultOptions=function(){return{type:"view",legend:null,tooltip:{field:pS,valueFormatter:"~s",name:"value"},axis:{y:{title:null,labelFormatter:"~s"},x:{title:null}},children:[{type:"interval",interaction:{elementHighlightByColor:{background:!0}}}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return fEt},e}(Rt);function pEt(t){var e=function(n){var r=n.options,i=r.data,o=r.binNumber,a=r.binWidth,s=r.children,l=r.channel,c=l===void 0?"count":l,u=ge(s,"[0].transform[0]",{});return tu(a)?(YR(u,{thresholds:Nxt(bOt(i.length,a)),y:c}),n):(tu(o)&&YR(u,{thresholds:o,y:c}),n)};return zt(e,Fe,Xt)(t)}var vEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),gEt=function(t){vEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="Histogram",n}return e.getDefaultOptions=function(){return{type:"view",autoFit:!0,axis:{y:{title:!1},x:{title:!1}},children:[{type:"rect",transform:[{type:"binX",y:"count"}],interaction:{elementHighlightByColor:{background:!0}}}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return pEt},e}(Rt);function yEt(t){var e=function(r){var i=r.options,o=i.tooltip,a=i.colorField,s=i.sizeField;return o&&!o.field&&(o.field=a||s),r},n=function(r){var i=r.options,o=i.mark,a=i.children;return o&&(a[0].type=o),r};return zt(e,n,Fe,Xt)(t)}var mEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),bEt=function(t){mEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="heatmap",n}return e.getDefaultOptions=function(){return{type:"view",legend:null,tooltip:{valueFormatter:"~s"},axis:{y:{title:null,grid:!0},x:{title:null,grid:!0}},children:[{type:"point",interaction:{elementHighlightByColor:{background:!0}}}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return yEt},e}(Rt);function xEt(t){var e=function(n){var r=n.options.boxType,i=r===void 0?"box":r;return n.options.children[0].type=i,n};return zt(e,Fe,Xt)(t)}var wEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),OEt=function(t){wEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="box",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"box"}],axis:{y:{title:!1},x:{title:!1}},tooltip:{items:[{name:"min",channel:"y"},{name:"q1",channel:"y1"},{name:"q2",channel:"y2"},{name:"q3",channel:"y3"},{name:"max",channel:"y4"}]}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return xEt},e}(Rt);function _Et(t){var e=function(n){var r=n.options,i=r.data,o=[{type:"custom",callback:function(s){return{links:s}}}];if(Vt(i))i.length>0?ht(r,"data",{value:i,transform:o}):delete r.children;else if(ge(i,"type")==="fetch"&&ge(i,"value")){var a=ge(i,"transform");Vt(a)?ht(i,"transform",a.concat(o)):ht(i,"transform",o)}return n};return zt(e,Fe,Xt)(t)}var SEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),EEt=function(t){SEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="sankey",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"sankey"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return _Et},e}(Rt),_i=function(){return _i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},_i.apply(this,arguments)},xy=["#f0efff","#5B8FF9","#3D76DD"];function gS(t,e,n,r){r===void 0&&(r=!0);var i=0,o=!1,a=Jc(t,function(s){var l,c,u=ge(s,[e]);if(ROt(u))return[];if(T9(u)){var f=Number(u);return isNaN(f)?[]:(l={},l[n]=s[n],l[e]=f,l)}return Vt(u)?(o=!0,i=Math.max(i,u.length),Jc(r?u.sort(function(d,h){return h-d}):u,function(d,h){var p;return p={},p[n]=s[n],p[e]=d,p.index=h,p})):(i=Math.max(1,i),c={},c[n]=s[n],c[e]=u,c)}).flat();return o?[a.map(function(s){return _i({index:0},s)}),i]:[a,i]}function yS(t,e){return new Array(t).fill("").map(function(n,r){return Vt(e)?e[r%e.length]:e})}function MEt(t){var e=function(i){var o=i.options,a=o.color,s=o.rangeField,l=s===void 0?"ranges":s,c=o.measureField,u=c===void 0?"measures":c,f=o.targetField,d=f===void 0?"targets":f,h=o.xField,p=h===void 0?"title":h,v=o.mapField,g=o.data,y=gS(g,l,p),m=y[0],b=y[1],x=gS(g,u,p,!1),w=x[0],O=x[1],_=gS(g,d,p,!1),S=_[0],E=_[1],M=ge(a,[l],xy[0]),P=ge(a,[u],xy[1]),C=ge(a,[d],xy[2]),A=[yS(b,M),yS(O,P),yS(E,C)].flat();return i.options.children=Jc(i.options.children,function(T,k){var N=[m,w,S][k],j=[l,u,d][k];return _i(_i({},T),{data:N,encode:_i(_i({},T.encode||{}),{x:p,y:j,color:function(L){var I=L.index,$=tu(I)?"".concat(j,"_").concat(I):j;return v?ge(v,[j,I],$):$}}),style:_i(_i({},T.style||{}),{zIndex:function(L){return-L[j]}}),labels:k!==0?Jc(T.labels,function(L){return _i(_i({},L),{text:j})}):void 0})}),i.options.scale.color.range=A,i.options.legend.color.itemMarker=function(T){return v&&jOt(v==null?void 0:v[d],T)||(T==null?void 0:T.replace(/\_\d$/,""))===d?"line":"square"},i},n=function(i){var o=i.options.layout,a=o===void 0?"horizontal":o;return a!=="horizontal"&&ht(i,"options.children[2].shapeField","hyphen"),i},r=function(i){var o=i.options,a=o.range,s=a===void 0?{}:a,l=o.measure,c=l===void 0?{}:l,u=o.target,f=u===void 0?{}:u,d=o.children;return i.options.children=[s,c,f].map(function(h,p){return za(d[p],h)}),i};return zt(e,n,r,fSt,Xt)(t)}var PEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),AEt=function(t){PEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="bullet",n}return e.getDefaultOptions=function(){return{type:"view",scale:{color:{range:xy}},legend:{color:{itemMarker:function(n){return n==="target"?"line":"square"}}},axis:{y:{title:!1},x:{title:!1}},children:[{type:"interval",style:{maxWidth:30},axis:{y:{grid:!0,gridLineWidth:2}}},{type:"interval",style:{maxWidth:20},transform:[{type:"stackY"}]},{type:"point",encode:{size:8,shape:"line"}}],interaction:{tooltip:{shared:!0}},coordinate:{transform:[{type:"transpose"}]}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return MEt},e}(Rt);function CEt(t){var e=function(n){var r=n.options.data;return n.options.data={value:r},n};return zt(e,Fe,Xt)(t)}var TEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),kEt=function(t){TEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="Gauge",n}return e.getDefaultOptions=function(){return{type:"view",legend:!1,children:[{type:"gauge"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return CEt},e}(Rt);function LEt(t){var e=function(n){var r=n.options.percent;return tu(r)&&ht(n,"options.data",r),n};return zt(e,Fe,Xt)(t)}var NEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),IEt=function(t){NEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="Liquid",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"liquid"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return LEt},e}(Rt);function jEt(t){return zt(Fe,Xt)(t)}var DEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$Et=function(t){DEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="WordCloud",n}return e.getDefaultOptions=function(){return{type:"view",legend:!1,children:[{type:"wordCloud"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return jEt},e}(Rt);function FEt(t){var e=function(n){var r=n.options,i=r.data;return i&&ht(r,"data",{value:i}),n};return zt(e,Fe,Xt)(t)}var REt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),BEt=function(t){REt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="treemap",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"treemap"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return FEt},e}(Rt),Js=function(){return Js=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Js.apply(this,arguments)};function zEt(t){var e=function(i){var o=i.options,a=o.startAngle,s=o.maxAngle,l=o.coordinate,c=tu(a)?a/(2*Math.PI)*360:-90,u=tu(s)?(Number(s)+c)/180*Math.PI:Math.PI;return ht(i,["options","coordinate"],Js(Js({},l),{endAngle:u,startAngle:a!=null?a:-Math.PI/2})),i},n=function(i){var o=i.options,a=o.tooltip,s=o.xField,l=o.yField;return a||ht(o,"tooltip",{title:!1,items:[function(c){return{name:c[s],value:c[l]}}]}),i},r=function(i){var o=i.options,a=o.markBackground,s=o.children,l=o.scale,c=o.coordinate,u=o.xField,f=ge(l,"y.domain",[]);return a&&s.unshift(Js({type:"interval",xField:u,yField:f[f.length-1],colorField:a.color,scale:{color:{type:"identity"}},style:{fillOpacity:a.opacity,fill:a.color?void 0:"#e0e4ee"},coordinate:Js(Js({},c),{startAngle:-Math.PI/2,endAngle:1.5*Math.PI}),animate:!1},a)),i};return zt(e,n,r,Fe,Xt)(t)}var YEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),WEt=function(t){YEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="radial",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"interval"}],coordinate:{type:"radial",innerRadius:.1,outerRadius:1,endAngle:Math.PI},animate:{enter:{type:"waveIn",duration:800}},axis:{y:{nice:!0,labelAutoHide:!0,labelAutoRotate:!1},x:{title:!1,nice:!0,labelAutoRotate:!1,labelAutoHide:{type:"equidistance",cfg:{minGap:6}}}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return zEt},e}(Rt);function GEt(t){return zt(Xt)(t)}var HEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),UEt=function(t){HEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="CirclePacking",n}return e.getDefaultOptions=function(){return{legend:!1,type:"view",children:[{type:"pack"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return GEt},e}(Rt),wy=function(){return wy=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},wy.apply(this,arguments)};function VEt(t){var e=function(n){var r=n.options,i=r.xField,o=r.yField,a=r.seriesField,s=r.children,l=s==null?void 0:s.map(function(c){return wy(wy({},c),{xField:i,yField:o,seriesField:a,colorField:a,data:c.type==="density"?{transform:[{type:"kde",field:o,groupBy:[i,a]}]}:c.data})}).filter(function(c){return r.violinType!=="density"||c.type==="density"});return ht(r,"children",l),r.violinType==="polar"&&ht(r,"coordinate",{type:"polar"}),ht(r,"violinType",void 0),n};return zt(e,Fe,Xt)(t)}var XEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),qEt=function(t){XEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="violin",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"density",sizeField:"size",tooltip:!1},{type:"boxplot",shapeField:"violin",style:{opacity:.5,point:!1}}],animate:{enter:{type:"fadeIn"}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return VEt},e}(Rt),ch=function(){return ch=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ch.apply(this,arguments)},KEt=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};function ZEt(t){var e=function(o){var a=o.options,s=a.yField,l=a.children;return l.forEach(function(c,u){ht(c,"yField",s[u])}),o},n=function(o){var a=o.options,s=a.yField,l=a.children,c=a.data;if(F_(c))return o;var u=Vt(ge(c,[0]))?c:[c,c];return l.forEach(function(f,d){ht(f,"data",KEt([],u[d].map(function(h){return ch({groupKey:s[d]},h)}),!0))}),o},r=function(o){var a=o.options,s=a.yField,l=s[0],c=s[1],u=a.tooltip;return u||ht(a,"tooltip",{items:[{field:l,value:l},{field:c,value:c}]}),o},i=function(o){var a=o.options,s=a.children,l=a.layout,c=a.coordinate.transform,u=a.paddingBottom,f=u===void 0?V9:u,d=a.paddingLeft,h=d===void 0?V9:d,p=a.axis;ht(a,"axisText",ch(ch({},(p==null?void 0:p.x)||{}),{layout:l}));var v=s[0],g=s[1];if(l==="vertical")ht(a,"direction","col"),ht(a,"paddingLeft",h),ht(a,"coordinate.transform",c.filter(function(w){return w.type!=="transpose"})),ht(v,"paddingBottom",U9),ht(g,"paddingTop",U9),ht(g,"axis",{x:{position:"top"}}),ht(g,"scale",{y:{range:[0,1]}});else{ht(a,"paddingBottom",f),ht(v,"scale",{y:{range:[0,1]}});var y=v.paddingRight,m=y===void 0?cS:y,b=g.paddingLeft,x=b===void 0?cS:b;ht(v,"paddingRight",m),ht(v,"axis",{x:{position:"right"}}),ht(g,"paddingLeft",x)}return o};return zt(e,n,r,i,Fe,Xt)(t)}var QEt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),JEt=function(t){QEt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="BidirectionalBar",n}return e.getDefaultOptions=function(){return{type:"spaceFlex",coordinate:{transform:[{type:"transpose"}]},scale:{y:{nice:!0}},direction:"row",layout:"horizontal",legend:!1,axis:{y:{title:!1},x:{title:!1,label:!1}},children:[{type:"interval"},{type:"interval"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return ZEt},e}(Rt),tl;(function(t){t.color="key",t.d="path"})(tl||(tl={}));function tMt(t){var e=function(n){var r=n.options,i=r.data,o=r.setsField,a=r.sizeField;return Vt(i)&&(ht(r,"data",{type:"inline",value:i,transform:[{type:"venn",sets:o,size:a,as:[tl.color,tl.d]}]}),ht(r,"colorField",o),ht(r,["children","0","encode","d"],tl.d)),ht(n,"options",K_(r,["sizeField","setsField"])),n};return zt(e,Xt)(t)}var eMt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),nMt=function(t){eMt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="venn",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"path"}],legend:{color:{itemMarker:"circle"}},encode:{color:tl.color,d:tl.d}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return tMt},e}(Rt);function rMt(t){var e=function(n){return n};return zt(e,Xt)(t)}var iMt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),oMt=function(t){iMt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type="Sunburst",n}return e.getDefaultOptions=function(){return{type:"view",children:[{type:"sunburst"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return rMt},e}(Rt),aMt={Base:lSt,Line:ASt,Column:xSt,Pie:kSt,Area:pSt,Bar:ySt,DualAxes:K9,Funnel:ESt,Scatter:ISt,Radar:$St,Rose:cEt,Stock:HSt,TinyLine:XSt,TinyArea:ZSt,TinyColumn:tEt,TinyProgress:rEt,TinyRing:aEt,Waterfall:hEt,Histogram:gEt,Heatmap:bEt,Box:OEt,Sankey:EEt,Bullet:AEt,Gauge:kEt,Liquid:IEt,WordCloud:$Et,Treemap:BEt,RadialBar:WEt,CirclePacking:UEt,Violin:qEt,BidirectionalBar:JEt,Venn:nMt,Mix:K9,Sunburst:oMt},mS=function(){return mS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},mS.apply(this,arguments)},Z9=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n},el=q.forwardRef(function(t,e){var n=t.chartType,r=n===void 0?"Base":n,i=Z9(t,["chartType"]),o=i.containerStyle,a=o===void 0?{height:"inherit"}:o,s=i.containerAttributes,l=s===void 0?{}:s,c=i.className,u=i.loading,f=i.loadingTemplate,d=i.errorTemplate,h=Z9(i,["containerStyle","containerAttributes","className","loading","loadingTemplate","errorTemplate"]),p=n_t(aMt[r],h),v=p.chart,g=p.container;return q.useImperativeHandle(e,function(){return v.current}),q.createElement(ymt,{errorTemplate:d},u&&q.createElement(vmt,{loadingTemplate:f}),q.createElement("div",mS({className:c,style:a,ref:g},l)))}),bS=function(){return bS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},bS.apply(this,arguments)},sMt=function(t){return q.createElement(el,bS({},t,{chartType:"Area"}))};const lMt=sMt;var xS=function(){return xS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},xS.apply(this,arguments)},cMt=function(t){return q.createElement(el,xS({},t,{chartType:"Bar"}))};const uMt=cMt;var wS=function(){return wS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},wS.apply(this,arguments)},fMt=function(t){return q.createElement(el,wS({},t,{chartType:"Column"}))};const dMt=fMt;var OS=function(){return OS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},OS.apply(this,arguments)},hMt=function(t){return q.createElement(el,OS({},t,{chartType:"DualAxes"}))};const pMt=hMt;var _S=function(){return _S=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},_S.apply(this,arguments)},vMt=function(t){return q.createElement(el,_S({},t,{chartType:"Line"}))};const gMt=vMt;var SS=function(){return SS=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},SS.apply(this,arguments)},yMt=function(t){return q.createElement(el,SS({},t,{chartType:"Pie"}))};const mMt=yMt;var ES=function(){return ES=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},ES.apply(this,arguments)},bMt=function(t){return q.createElement(el,ES({},t,{chartType:"Scatter"}))};const xMt=bMt,{booleanField:Oy}=nE,wMt={isStack:t=>Oy(tt({name:"isStack",title:"isStack"},t)),smooth:t=>Oy(tt({name:"smooth",title:"smooth"},t)),isPercent:t=>Oy(tt({name:"isPercent",title:"isPercent"},t)),isGroup:t=>Oy(tt({name:"isGroup",title:"isGroup"},t))},OMt=t=>e=>{const{service:n}=q.useContext(ri),r=q.useRef(null),[i,o]=q.useState(0);return q.useEffect(()=>{const a=r.current;if(!a||n.loading===!0||e.height)return;const s=new ResizeObserver(l=>{l.forEach(c=>{o(c.contentRect.height)})});return s.observe(a),()=>s.disconnect()},[n.loading,e.height]),Y.jsx("div",{ref:r,style:i?{height:`${e.height||i}px`}:{},children:Y.jsx(t,tt(tt({},e),i?{height:e.height||i}:{}))})};class nl extends jy{constructor({name:n,title:r,Component:i,config:o}){super({name:n,title:r,Component:OMt(i),config:["xField","yField","seriesField",...o||[]]});ni(this,"init",(n,{measures:r,dimensions:i})=>{const{xField:o,yField:a,seriesField:s}=this.infer(n,{measures:r,dimensions:i});return{general:{xField:o==null?void 0:o.value,yField:a==null?void 0:a.value,seriesField:s==null?void 0:s.value}}});this.addConfigs(wMt)}getProps({data:n,general:r,advanced:i,fieldProps:o}){const a=o[r.xField],s=o[r.yField],l=o[r.seriesField];return tt(pt(tt(tt({legend:{color:{itemLabelText:u=>{const f=l==null?void 0:l.transformer;return f?f(u.label):u.label}}},tooltip:{title:u=>{const{[r.xField]:f}=u;return a!=null&&a.transformer?a.transformer(f):f},items:[u=>{const{[r.xField]:f,[r.yField]:d,[r.seriesField]:h}=u;let p="";return h?p=l.transformer?l.transformer(h):h:p=(s==null?void 0:s.label)||r.yField,{name:p,value:s!=null&&s.transformer?s.transformer(d):d}}]},axis:{x:{labelFormatter:u=>{const f=a==null?void 0:a.transformer;return f?f(u):u}},y:{labelFormatter:u=>{const f=s==null?void 0:s.transformer;return f?f(u):u}}},data:n,theme:"classic",animate:{enter:{type:!1},update:{type:!1},exit:{type:!1}},colorField:r.seriesField,stack:r.isStack,percent:r.isPercent?!0:void 0},r.smooth?{shapeField:"smooth"}:{}),r),{seriesField:r.isGroup?r.seriesField:void 0}),i)}getReference(){return{title:this.title,link:`https://ant-design-charts-next.antgroup.com/examples#statistics-${this.name}`}}}class _Mt extends nl{constructor(){super({name:"pie",title:"Pie Chart",Component:mMt});ni(this,"init",(n,{measures:r,dimensions:i})=>{const{xField:o,yField:a}=this.infer(n,{measures:r,dimensions:i});return{general:{colorField:o==null?void 0:o.value,angleField:a==null?void 0:a.value}}});this.config=[{property:"field",name:"angleField",title:"angleField",required:!0},{property:"field",name:"colorField",title:"colorField",required:!0}]}getProps({data:n,general:r,advanced:i,fieldProps:o}){const a=r.angleField,s=o[a]||{};if(n.some(u=>u[a]<0)){const u=Math.min(...n.map(d=>d[a]));n=n.map(d=>pt(tt({},d),{[a]:d[a]-u}));const f=s.transformer;s.transformer=d=>{const h=d+u;return f?f(h):h}}const c=super.getProps({data:n,general:r,advanced:i,fieldProps:o});return pt(tt({},c),{tooltip:{items:[u=>{const{[r.colorField]:f,[a]:d}=u,h=f||(s==null?void 0:s.label)||a,p=s==null?void 0:s.transformer;return{name:h,value:p?p(d):d}}]}})}}class SMt extends nl{constructor(){super({name:"dualAxes",title:"Dual Axes Chart",Component:pMt});ni(this,"init",(n,{measures:r,dimensions:i})=>{const{xField:o,yFields:a}=this.infer(n,{measures:r,dimensions:i});return{general:{xField:o==null?void 0:o.value,yField:(a==null?void 0:a.map(s=>s.value))||[]}}});this.config=["xField",{yField:{title:'{{t("yField")}}',type:"array","x-decorator":"FormItem","x-component":"ArrayItems",items:{type:"void","x-component":"Space",properties:{sort:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.SortHandle"},input:{type:"string","x-decorator":"FormItem","x-component":"Select","x-reactions":"{{ useChartFields }}","x-component-props":{style:{minWidth:"200px"}},required:!0},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}},properties:{add:{type:"void",title:'{{t("Add")}}',"x-component":"ArrayItems.Addition"}}}}]}getProps({data:n,general:r,advanced:i,fieldProps:o}){var s;const a=super.getProps({data:n,general:r,advanced:i,fieldProps:o});return pt(tt({},rn.omit(a,["legend","tooltip","yField"])),{children:((s=a.yField)==null?void 0:s.map((l,c)=>{var u;return{type:"line",yField:l,colorField:()=>{const f=o[l];return(f==null?void 0:f.label)||l},axis:{y:{title:((u=o[l])==null?void 0:u.label)||l,position:c===0?"left":"right",labelFormatter:f=>{const d=o[l],h=d==null?void 0:d.transformer;return h?h(f):f}}}}}))||[]})}}const EMt=[new nl({name:"line",title:"Line Chart",Component:gMt,config:["smooth","isStack"]}),new nl({name:"area",title:"Area Chart",Component:lMt,config:["smooth",{property:"isStack",defaultValue:!0},"isPercent"]}),new nl({name:"column",title:"Column Chart",Component:dMt,config:["isGroup","isStack","isPercent"]}),new nl({name:"bar",title:"Bar Chart",Component:uMt,config:["isGroup","isStack","isPercent"]}),new _Mt,new SMt,new nl({name:"scatter",title:"Scatter Chart",Component:xMt})];class _y extends z.Plugin{constructor(){super(...arguments);ni(this,"charts",new TB)}load(){return Cr(this,null,function*(){this.charts.setGroup("Built-in",[...EMt,...ez]),this.app.addComponents({ChartV2BlockInitializer:Q7,ChartV2BlockDesigner:K7,ChartV2Block:q7}),this.app.schemaInitializerManager.add(eE),this.app.schemaInitializerManager.add(Z7),this.app.schemaInitializerManager.add(XS),this.app.schemaInitializerManager.add(T7),this.app.schemaInitializerManager.add(QS),this.app.schemaInitializerManager.add(D7);const n=this.app.schemaInitializerManager.get("page:addBlock");n==null||n.add("dataBlocks.chartV2",{title:At("Charts"),Component:"ChartV2BlockInitializer"})})}}ct.Chart=jy,ct.ChartConfigContext=Mi,ct.default=_y,Object.defineProperties(ct,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});