@milaboratories/graph-maker 1.1.125 → 1.1.126
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/graph-maker.js +9 -3
- package/dist/graph-maker.umd.cjs +2 -2
- package/package.json +3 -3
package/dist/graph-maker.umd.cjs
CHANGED
|
@@ -24,7 +24,7 @@ __p += '`),Oa&&(Dt+=`' +
|
|
|
24
24
|
function print() { __p += __j.call(arguments, '') }
|
|
25
25
|
`:`;
|
|
26
26
|
`)+Dt+`return __p
|
|
27
|
-
}`;var Wr=NS(function(){return na(Te,xn+"return "+Dt).apply(n,Ve)});if(Wr.source=Dt,Ch(Wr))throw Wr;return Wr}function $P(w){return xi(w).toLowerCase()}function i6(w){return xi(w).toUpperCase()}function IP(w,_,N){if(w=xi(w),w&&(N||_===n))return $t(w);if(!w||!(_=Jo(_)))return w;var re=ci(w),ve=ci(_),Te=_a(re,ve),Ve=ul(re,ve)+1;return Su(re,Te,Ve).join("")}function o6(w,_,N){if(w=xi(w),w&&(N||_===n))return w.slice(0,r0(w)+1);if(!w||!(_=Jo(_)))return w;var re=ci(w),ve=ul(re,ci(_))+1;return Su(re,0,ve).join("")}function VS(w,_,N){if(w=xi(w),w&&(N||_===n))return w.replace(ta,"");if(!w||!(_=Jo(_)))return w;var re=ci(w),ve=_a(re,ci(_));return Su(re,ve).join("")}function LP(w,_){var N=le,re=G;if(nl(_)){var ve="separator"in _?_.separator:ve;N="length"in _?Nr(_.length):N,re="omission"in _?Jo(_.omission):re}w=xi(w);var Te=w.length;if(Id(w)){var Ve=ci(w);Te=Ve.length}if(N>=Te)return w;var Fe=N-ef(re);if(Fe<1)return re;var Je=Ve?Su(Ve,0,Fe).join(""):w.slice(0,Fe);if(ve===n)return Je+re;if(Ve&&(Fe+=Je.length-Fe),X3(ve)){if(w.slice(Fe).search(ve)){var _t,Et=Je;for(ve.global||(ve=os(ve.source,xi(On.exec(ve))+"g")),ve.lastIndex=0;_t=ve.exec(Et);)var Dt=_t.index;Je=Je.slice(0,Dt===n?Fe:Dt)}}else if(w.indexOf(Jo(ve),Fe)!=Fe){var Kt=Je.lastIndexOf(ve);Kt>-1&&(Je=Je.slice(0,Kt))}return Je+re}function RP(w){return w=xi(w),w&&lo.test(w)?w.replace(Er,aA):w}var VP=U(function(w,_,N){return w+(N?" ":"")+_.toUpperCase()}),l6=V("toUpperCase");function s6(w,_,N){return w=xi(w),_=N?n:_,_===n?pp(w)?sh(w):Zc(w):w.match(_)||[]}var NS=Sr(function(w,_){try{return Jn(w,n,_)}catch(N){return Ch(N)?N:new Qn(N)}}),NP=Gd(function(w,_){return gr(_,function(N){N=Tu(N),Ol(w,N,Rt(w[N],w))}),w});function zP(w){var _=w==null?0:w.length,N=Kn();return w=_?Fr(w,function(re){if(typeof re[1]!="function")throw new Ms(o);return[N(re[0]),re[1]]}):[],Sr(function(re){for(var ve=-1;++ve<_;){var Te=w[ve];if(Jn(Te[0],this,re))return Jn(Te[1],this,re)}})}function OP(w){return u0(Ko(w,h))}function u6(w){return function(){return w}}function FP(w,_){return w==null||w!==w?_:w}var QP=Le(),c6=Le(!0);function wf(w){return w}function f6(w){return lf(typeof w=="function"?w:Ko(w,h))}function jP(w){return au(Ko(w,h))}function UP(w,_){return qa(w,Ko(_,h))}var GP=Sr(function(w,_){return function(N){return Al(N,w,_)}}),YP=Sr(function(w,_){return function(N){return Al(w,N,_)}});function d6(w,_,N){var re=lu(_),ve=dl(_,re);N==null&&!(nl(_)&&(ve.length||!re.length))&&(N=_,_=w,w=this,ve=dl(_,lu(_)));var Te=!(nl(N)&&"chain"in N)||!!N.chain,Ve=b0(w);return gr(ve,function(Fe){var Je=_[Fe];w[Fe]=Je,Ve&&(w.prototype[Fe]=function(){var _t=this.__chain__;if(Te||_t){var Et=w(this.__wrapped__),Dt=Et.__actions__=yo(this.__actions__);return Dt.push({func:Je,args:arguments,thisArg:w}),Et.__chain__=_t,Et}return Je.apply(w,sl([this.value()],arguments))})}),w}function WP(){return va._===this&&(va._=v1),this}function A6(){}function zS(w){return w=Nr(w),Sr(function(_){return sf(_,w)})}var h6=Wt(Fr),XP=Wt(_s),KP=Wt(Kc);function vg(w){return sn(w)?q(Tu(w)):bn(w)}function mg(w){return function(_){return w==null?n:po(w,_)}}var ZP=wo(),JP=wo(!0);function p6(){return[]}function v6(){return!1}function qP(){return{}}function eH(){return""}function tH(){return!0}function OS(w,_){if(w=Nr(w),w<1||w>ae)return[];var N=fe,re=Ki(w,fe);_=Kn(_),w-=fe;for(var ve=et(re,_);++N<w;)_(N);return ve}function nH(w){return Qr(w)?Fr(w,Tu):Ha(w)?[w]:yo(r2(xi(w)))}function rH(w){var _=++yc;return xi(w)+_}var aH=Mt(function(w,_){return w+_},0),iH=Pa("ceil"),oH=Mt(function(w,_){return w/_},1),lH=Pa("floor");function sH(w){return w&&w.length?Hs(w,wf,Js):n}function uH(w,_){return w&&w.length?Hs(w,Kn(_,2),Js):n}function cH(w){return A1(w,wf)}function fH(w,_){return A1(w,Kn(_,2))}function dH(w){return w&&w.length?Hs(w,wf,Tl):n}function AH(w,_){return w&&w.length?Hs(w,Kn(_,2),Tl):n}var hH=Mt(function(w,_){return w*_},1),pH=Pa("round"),vH=Mt(function(w,_){return w-_},0);function mH(w){return w&&w.length?at(w,wf):0}function x2(w,_){return w&&w.length?at(w,Kn(_,2)):0}return xe.after=Qe,xe.ary=dt,xe.assign=gf,xe.assignIn=b2,xe.assignInWith=Ip,xe.assignWith=Eh,xe.at=_S,xe.before=Lt,xe.bind=Rt,xe.bindAll=NP,xe.bindKey=It,xe.castArray=yS,xe.chain=d2,xe.chunk=dA,xe.compact=a2,xe.concat=hf,xe.cond=zP,xe.conforms=OP,xe.constant=u6,xe.countBy=tg,xe.create=Lp,xe.curry=rn,xe.curryRight=wn,xe.debounce=Sn,xe.defaults=Rp,xe.defaultsDeep=J3,xe.defer=vl,xe.delay=it,xe.difference=ca,xe.differenceBy=tl,xe.differenceWith=no,xe.drop=Gl,xe.dropRight=ac,xe.dropRightWhile=vh,xe.dropWhile=Yl,xe.fill=Sp,xe.filter=v2,xe.flatMap=rg,xe.flatMapDeep=O9,xe.flatMapDepth=ag,xe.flatten=i2,xe.flattenDeep=v0,xe.flattenDepth=ou,xe.flip=Ue,xe.flow=QP,xe.flowRight=c6,xe.fromPairs=o2,xe.functions=MS,xe.functionsIn=dP,xe.groupBy=y0,xe.initial=l2,xe.intersection=Xm,xe.intersectionBy=pf,xe.intersectionWith=mh,xe.invert=PS,xe.invertBy=AP,xe.invokeMap=G3,xe.iteratee=f6,xe.keyBy=F9,xe.keys=lu,xe.keysIn=yf,xe.map=gA,xe.mapKeys=hP,xe.mapValues=pP,xe.matches=jP,xe.matchesProperty=UP,xe.memoize=lt,xe.merge=vP,xe.mergeWith=HS,xe.method=GP,xe.methodOf=YP,xe.mixin=d6,xe.negate=Ft,xe.nthArg=zS,xe.omit=mP,xe.omitBy=gP,xe.once=Hn,xe.orderBy=Q9,xe.over=h6,xe.overArgs=er,xe.overEvery=XP,xe.overSome=KP,xe.partial=hn,xe.partialRight=tr,xe.partition=Pp,xe.pick=yP,xe.pickBy=DS,xe.property=vg,xe.propertyOf=mg,xe.pull=Ep,xe.pullAll=m0,xe.pullAllBy=gs,xe.pullAllWith=k1,xe.pullAt=No,xe.range=ZP,xe.rangeRight=JP,xe.rearg=Xl,xe.reject=p,xe.remove=Wl,xe.rest=ei,xe.reverse=gh,xe.sampleSize=T,xe.set=e6,xe.setWith=t6,xe.shuffle=L,xe.slice=pA,xe.sortBy=we,xe.sortedUniq=u2,xe.sortedUniqBy=vA,xe.split=PP,xe.spread=M1,xe.tail=L3,xe.take=R3,xe.takeRight=Bp,xe.takeRightWhile=c2,xe.takeWhile=I9,xe.tap=z9,xe.throttle=j9,xe.thru=dd,xe.toArray=w2,xe.toPairs=r4,xe.toPairsIn=$S,xe.toPath=nH,xe.toPlainObject=K9,xe.transform=cg,xe.unary=ZM,xe.union=L9,xe.unionBy=V3,xe.unionWith=N3,xe.uniq=g0,xe.uniqBy=R9,xe.uniqWith=wh,xe.unset=fg,xe.unzip=f2,xe.unzipWith=zo,xe.update=wP,xe.updateWith=IS,xe.values=S2,xe.valuesIn=bP,xe.without=V9,xe.words=s6,xe.wrap=JM,xe.xor=z3,xe.xorBy=qm,xe.xorWith=N9,xe.zip=O3,xe.zipObject=F3,xe.zipObjectDeep=Q3,xe.zipWith=mf,xe.entries=r4,xe.entriesIn=$S,xe.extend=b2,xe.extendWith=Ip,d6(xe,xe),xe.add=aH,xe.attempt=NS,xe.camelCase=RS,xe.capitalize=dg,xe.ceil=iH,xe.clamp=LS,xe.clone=wS,xe.cloneDeep=eP,xe.cloneDeepWith=bS,xe.cloneWith=qM,xe.conformsTo=U9,xe.deburr=Ag,xe.defaultTo=FP,xe.divide=oH,xe.endsWith=a4,xe.eq=P1,xe.escape=hg,xe.escapeRegExp=pg,xe.every=ng,xe.find=kp,xe.findIndex=p0,xe.findKey=Z9,xe.findLast=U3,xe.findLastIndex=AA,xe.findLastKey=q3,xe.floor=lH,xe.forEach=Mp,xe.forEachRight=bh,xe.forIn=ug,xe.forInRight=TS,xe.forOwn=e4,xe.forOwnRight=kS,xe.get=J9,xe.gt=tP,xe.gte=nP,xe.has=t4,xe.hasIn=C2,xe.head=hA,xe.identity=wf,xe.includes=m2,xe.indexOf=T1,xe.inRange=CP,xe.invoke=n4,xe.isArguments=Hp,xe.isArray=Qr,xe.isArrayBuffer=rP,xe.isArrayLike=Is,xe.isArrayLikeObject=ml,xe.isBoolean=ig,xe.isBuffer=w0,xe.isDate=aP,xe.isElement=iP,xe.isEmpty=CS,xe.isEqual=oP,xe.isEqualWith=W3,xe.isError=Ch,xe.isFinite=G9,xe.isFunction=b0,xe.isInteger=og,xe.isLength=lg,xe.isMap=Y9,xe.isMatch=SS,xe.isMatchWith=xS,xe.isNaN=Sh,xe.isNative=lP,xe.isNil=uP,xe.isNull=sP,xe.isNumber=y2,xe.isObject=nl,xe.isObjectLike=gl,xe.isPlainObject=Dp,xe.isRegExp=X3,xe.isSafeInteger=cP,xe.isSet=W9,xe.isString=K3,xe.isSymbol=Ha,xe.isTypedArray=xh,xe.isUndefined=Z3,xe.isWeakMap=sg,xe.isWeakSet=ES,xe.join=vf,xe.kebabCase=xP,xe.last=ku,xe.lastIndexOf=xp,xe.lowerCase=n6,xe.lowerFirst=r6,xe.lt=BS,xe.lte=X9,xe.max=sH,xe.maxBy=uH,xe.mean=cH,xe.meanBy=fH,xe.min=dH,xe.minBy=AH,xe.stubArray=p6,xe.stubFalse=v6,xe.stubObject=qP,xe.stubString=eH,xe.stubTrue=tH,xe.multiply=hH,xe.nth=s2,xe.noConflict=WP,xe.noop=A6,xe.now=Ie,xe.pad=EP,xe.padEnd=BP,xe.padStart=aJ,xe.parseInt=_P,xe.random=SP,xe.reduce=Y3,xe.reduceRight=g2,xe.repeat=TP,xe.replace=kP,xe.result=q9,xe.round=pH,xe.runInContext=Ye,xe.sample=m,xe.size=W,xe.snakeCase=MP,xe.some=ne,xe.sortedIndex=Km,xe.sortedIndexBy=Zm,xe.sortedIndexOf=Kd,xe.sortedLastIndex=yh,xe.sortedLastIndexBy=Jm,xe.sortedLastIndexOf=Zd,xe.startCase=HP,xe.startsWith=a6,xe.subtract=vH,xe.sum=mH,xe.sumBy=x2,xe.template=DP,xe.times=OS,xe.toFinite=yA,xe.toInteger=Nr,xe.toLength=$p,xe.toLower=$P,xe.toNumber=Jd,xe.toSafeInteger=fP,xe.toString=xi,xe.toUpper=i6,xe.trim=IP,xe.trimEnd=o6,xe.trimStart=VS,xe.truncate=LP,xe.unescape=RP,xe.uniqueId=rH,xe.upperCase=VP,xe.upperFirst=l6,xe.each=Mp,xe.eachRight=bh,xe.first=hA,d6(xe,function(){var w={};return Ma(xe,function(_,N){la.call(xe.prototype,N)||(w[N]=_)}),w}(),{chain:!1}),xe.VERSION=r,gr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(w){xe[w].placeholder=xe}),gr(["drop","take"],function(w,_){cr.prototype[w]=function(N){N=N===n?1:ii(Nr(N),0);var re=this.__filtered__&&!_?new cr(this):this.clone();return re.__filtered__?re.__takeCount__=Ki(N,re.__takeCount__):re.__views__.push({size:Ki(N,fe),type:w+(re.__dir__<0?"Right":"")}),re},cr.prototype[w+"Right"]=function(N){return this.reverse()[w](N).reverse()}}),gr(["filter","map","takeWhile"],function(w,_){var N=_+1,re=N==Y||N==ee;cr.prototype[w]=function(ve){var Te=this.clone();return Te.__iteratees__.push({iteratee:Kn(ve,3),type:N}),Te.__filtered__=Te.__filtered__||re,Te}}),gr(["head","last"],function(w,_){var N="take"+(_?"Right":"");cr.prototype[w]=function(){return this[N](1).value()[0]}}),gr(["initial","tail"],function(w,_){var N="drop"+(_?"":"Right");cr.prototype[w]=function(){return this.__filtered__?new cr(this):this[N](1)}}),cr.prototype.compact=function(){return this.filter(wf)},cr.prototype.find=function(w){return this.filter(w).head()},cr.prototype.findLast=function(w){return this.reverse().find(w)},cr.prototype.invokeMap=Sr(function(w,_){return typeof w=="function"?new cr(this):this.map(function(N){return Al(N,w,_)})}),cr.prototype.reject=function(w){return this.filter(Ft(Kn(w)))},cr.prototype.slice=function(w,_){w=Nr(w);var N=this;return N.__filtered__&&(w>0||_<0)?new cr(N):(w<0?N=N.takeRight(-w):w&&(N=N.drop(w)),_!==n&&(_=Nr(_),N=_<0?N.dropRight(-_):N.take(_-w)),N)},cr.prototype.takeRightWhile=function(w){return this.reverse().takeWhile(w).reverse()},cr.prototype.toArray=function(){return this.take(fe)},Ma(cr.prototype,function(w,_){var N=/^(?:filter|find|map|reject)|While$/.test(_),re=/^(?:head|last)$/.test(_),ve=xe[re?"take"+(_=="last"?"Right":""):_],Te=re||/^find/.test(_);ve&&(xe.prototype[_]=function(){var Ve=this.__wrapped__,Fe=re?[1]:arguments,Je=Ve instanceof cr,_t=Fe[0],Et=Je||Qr(Ve),Dt=function(ya){var Oa=ve.apply(xe,sl([ya],Fe));return re&&Kt?Oa[0]:Oa};Et&&N&&typeof _t=="function"&&_t.length!=1&&(Je=Et=!1);var Kt=this.__chain__,xn=!!this.__actions__.length,ir=Te&&!Kt,Wr=Je&&!xn;if(!Te&&Et){Ve=Wr?Ve:new cr(this);var hr=w.apply(Ve,Fe);return hr.__actions__.push({func:dd,args:[Dt],thisArg:n}),new fo(hr,Kt)}return ir&&Wr?w.apply(this,Fe):(hr=this.thru(Dt),ir?re?hr.value()[0]:hr.value():hr)})}),gr(["pop","push","shift","sort","splice","unshift"],function(w){var _=ls[w],N=/^(?:push|sort|unshift)$/.test(w)?"tap":"thru",re=/^(?:pop|shift)$/.test(w);xe.prototype[w]=function(){var ve=arguments;if(re&&!this.__chain__){var Te=this.value();return _.apply(Qr(Te)?Te:[],ve)}return this[N](function(Ve){return _.apply(Qr(Ve)?Ve:[],ve)})}}),Ma(cr.prototype,function(w,_){var N=xe[_];if(N){var re=N.name+"";la.call(Xf,re)||(Xf[re]=[]),Xf[re].push({name:_,func:N})}}),Xf[Ze(n,E).name]=[{name:"wrapper",func:n}],cr.prototype.clone=Bn,cr.prototype.reverse=Ys,cr.prototype.value=Ja,xe.prototype.at=A2,xe.prototype.chain=mA,xe.prototype.commit=h2,xe.prototype.next=p2,xe.prototype.plant=Tp,xe.prototype.reverse=eg,xe.prototype.toJSON=xe.prototype.valueOf=xe.prototype.value=j3,xe.prototype.first=xe.prototype.head,Rl&&(xe.prototype[Rl]=_p),xe},mc=a0();Re?((Re.exports=mc)._=mc,he._=mc):va._=mc}).call(k4)}(dw,dw.exports);var lI=dw.exports;const Zn=Xp(lI);var _ne="pl7.app/axisNature",sI="pl7.app/label",Tne="pl7.app/columnAsAxis/name",kne="pl7.app/columnAsAxis/domain",F2="pl7.app/isSubset",Ng="pl7.app/isDiscreteFilter",Mne="pl7.app/discreteValues",Pne="pl7.app/graph/axis/highCardinality",Hne="pl7.app/graph/isVirtual",uI="pl7.app/isLinkerColumn",Lr=class nw{constructor({type:t,name:n,domain:r}){this.kind="axis",this.type=t,this.name=n,this.domain={...r}}toCanonicalString(){return I1(this)}static fromAxisSpec(t){return new nw({name:t.name,type:t.type,domain:t.domain})}static fromAxesSpec(t){return t.map(n=>nw.fromAxisSpec(n))}copy(){return new nw({type:this.type,name:this.name,domain:this.domain})}toPFrameId(){return{type:this.type,name:this.name,domain:this.domain}}static fromPojo(t){return new nw(t)}},Q2=class ute{constructor({name:t,type:n}){this.kind="column",this.name=t,this.type=n}toCanonicalString(){return I1(this)}static fromPojo(t){return new ute(t)}};function kn(e){return e!==null&&e.kind==="column"}function Aw(e){return e!==null&&e.kind==="axis"}function en(e){const t=JSON.parse(e);if(t.kind==="column")return Q2.fromPojo(t);if(t.kind==="axis")return Lr.fromPojo(t);throw Error("wrong column or axis object")}async function Dne(e,t,n){if(n){const r=await e.pFrameProvider.getTableOuterJoin([t,n],[]),a=r.columnsData[t.toCanonicalString()],i=r.columnsData[n.toCanonicalString()];return a.reduce((o,s,c)=>(o[String(s)]=String(i[c]),o),{})}return null}async function $ne(e,t,n,r){if(r){const{data:a,axesData:i}=await e.pFrameProvider.getSingleColumnData(r);return i[t.toCanonicalString()].reduce((s,c,f)=>(s[String(c)]=String(a[f]),s),{})}return null}async function Ine(e,t,n,r,a,i,o=!0){var s,c,f,A;const h=en(t);if(kn(h)){const v=await e.pFrameProvider.getColumnSpecById(h);if(!v)return;const g=v.axesSpec.map(E=>Lr.fromAxisSpec(E).toCanonicalString()),C=[],b={};o&&g.forEach((E,k)=>{!a.has(E)&&!i.has(E)&&(C.push(E),b[E]=k)});const B={kind:"column",name:v.name,label:n??await Kr(e,t,[]),type:v.valueType,spec:v,annotations:v.annotations,isSubsetFilter:((s=v.annotations)==null?void 0:s[F2])==="true",isDiscreteFilter:v.valueType==="String"||((c=v.annotations)==null?void 0:c[Ng])==="true",axesToBeFixed:C,axesToBeFixedIndexes:b};r.set(h.toCanonicalString(),B);for(const E of v.axesSpec){const P=Lr.fromAxisSpec(E).toCanonicalString();if(r.has(P))continue;const I=AI(E),$={kind:"axis",name:E.name,label:await Kr(e,P,[t]),type:E.type,mustBeConsumed:I,dividable:!1,spec:E,annotations:E.annotations,isSubsetFilter:((f=E.annotations)==null?void 0:f[F2])==="true",isDiscreteFilter:E.type==="String"||((A=E.annotations)==null?void 0:A[Ng])==="true",parentSources:[t]};r.set(P,$)}}}function cI(e){const t=en(e),{name:n,type:r}=t;return kn(t)?{kind:"column",name:"",label:" ",type:t.type,spec:{axesSpec:[],kind:"PColumn",valueType:t.type,name:n},annotations:void 0,isSubsetFilter:!1,isDiscreteFilter:t.type==="String",axesToBeFixed:[],axesToBeFixedIndexes:{}}:{kind:"axis",name:"",label:" ",type:r,spec:{type:r,name:n},mustBeConsumed:!1,dividable:!1,annotations:void 0,isSubsetFilter:!1,isDiscreteFilter:r==="String",parentSources:[]}}function hw(e){return{type:e.type,components:{...e.components},dividedAxes:{...e.dividedAxes}}}function Lne(e){const{selectedSource:t,type:n,selectedFilterRange:r,selectedFilterValue:a}=e,i=en(t);if(!i)throw Error("Empty source selected");if(n==="range"){const o=[];return(r==null?void 0:r.max)!==void 0&&o.push({type:"bySingleColumnV2",column:Aw(i)?{type:"axis",id:i.toPFrameId()}:{type:"column",id:i.name},predicate:{operator:"LessOrEqual",reference:r.max}}),(r==null?void 0:r.min)!==void 0&&o.push({type:"bySingleColumnV2",column:Aw(i)?{type:"axis",id:i.toPFrameId()}:{type:"column",id:i.name},predicate:{operator:"GreaterOrEqual",reference:r==null?void 0:r.min}}),o}else if(n==="subset")return[{type:"bySingleColumnV2",column:Aw(i)?{type:"axis",id:i.toPFrameId()}:{type:"column",id:i.name},predicate:{operator:"Not",operand:{operator:"IsNA"}}}];return typeof a>"u"?[]:[{type:"bySingleColumnV2",column:Aw(i)?{type:"axis",id:i.toPFrameId()}:{type:"column",id:i.name},predicate:{operator:"Equal",reference:i.type==="String"?String(a):Number(a)}}]}function tv(e){const t=[];for(const n of e)t.push(...Lne(n));return t}function fI(e){var t,n,r,a;if("kind"in e&&e.kind==="PColumn"){const s=(n=e.name)!=null?n:(t=e.annotations)==null?void 0:t[Tne],c=(a=e.domain)!=null?a:(r=e.annotations)==null?void 0:r[kne];return I1({name:s,domain:c})}const i=e.name,o=e.domain;return I1({name:i,domain:o})}async function dI(e,t,n){var r;for(const a of n){const i=en(a);if(kn(i)){const o=await e.pFrameProvider.getColumnSpecById(i),s=((r=o==null?void 0:o.axesSpec)!=null?r:[]).find(c=>Lr.fromAxisSpec(c).toCanonicalString()===t.toCanonicalString());if(s)return s}}return null}var Rne="pl7.app/label";async function wa(e,t,n){const r=en(t);if(kn(r))return;async function a(c){const f=await dI(e,c,n);return f?fI(f):null}const i=await e.pFrameProvider.getColumnsFull([],!1,void 0,[Rne]),o=await a(r),s=i.find(({spec:c})=>c&&c.axesSpec.length===1&&fI(c.axesSpec[0])===o);return s?new Q2({name:s.columnId,type:s.spec.valueType}):void 0}async function Kr(e,t,n){var r,a;const i=en(t),o=await wa(e,t,n);let s;if(kn(i)?s=await e.pFrameProvider.getColumnSpecById(o??i):s=o?await e.pFrameProvider.getColumnSpecById(o):await dI(e,i,n),!s)return"";const c=(a=(r=s.annotations)==null?void 0:r[sI])!=null?a:s.name;return e.labelsModifier(s.name,c)}function AI(e){var t,n;const r=(n=(t=e.annotations)==null?void 0:t[_ne])==null?void 0:n.toLowerCase();return!!r&&r!=="homogenous"&&r!=="homogeneous"}function nv(e){var t,n;return((t=e.annotations)==null?void 0:t[F2])==="true"||((n=e.annotations)==null?void 0:n[Ng])==="true",!0}function Vne(e){var t,n;return!e.name.includes("metadata")&&((t=e.annotations)==null?void 0:t[Hne])!=="true"&&((n=e.annotations)==null?void 0:n[F2])!=="true"}async function rv(e){var t;const n=await e.pFrameProvider.getColumns([],!1,void 0,void 0,{[uI]:"true"}),r={};for(const a of n){const i=await e.pFrameProvider.getColumnSpecById(a),o=(t=i==null?void 0:i.axesSpec)!=null?t:[];if(i&&o.length){const[s,c]=o,f=Lr.fromAxisSpec(s).toCanonicalString(),A=Lr.fromAxisSpec(c).toCanonicalString();r[f]||(r[f]={}),r[A]||(r[A]={}),r[f][A]={id:a,spec:i},r[A][f]={id:a,spec:i}}}return r}async function j2(e,t){const n=new Set;for(const r of t){const a=en(r);if(kn(a)){const i=await e.pFrameProvider.getColumnSpecById(a);if(!i)continue;i.axesSpec.forEach(o=>{n.add(Lr.fromAxisSpec(o).toCanonicalString())})}}return n}function Nne(e,t,n){const r={},a=new Set([t]);let i=[t];for(;i.length;){const o=new Set;for(const s of i)if(e[s]){const c=Object.keys(e[s]);for(const f of c)if(r[f]=s,f===n){const A=[];let h=n;for(;r[h]!==t;)A.push(h),h=r[h];return A.push(h),A.map(v=>e[v][r[v]].id)}else a.has(f)||(o.add(f),a.add(f))}i=[...o]}return null}function zne(e,t,n){const r=[...t].map(i=>Nne(e,i,n)).filter(i=>i!==null);if(r.length===0)return[];let a=r[0];for(const i of r)i.length<a.length&&(a=i);return a}async function jc(e,t,n,r,a){const i=en(r);if(!kn(i))return[];const o=await e.pFrameProvider.getColumnSpecById(i);if(!o)return[];const s=o.axesSpec.map(f=>Lr.fromAxisSpec(f).toCanonicalString()).filter(f=>!n.has(f)&&!(a!=null&&a.some(A=>A.axisSource===f))),c=new Set;return s.forEach(f=>{zne(t,n,f).forEach(h=>{c.add(h.toCanonicalString())})}),[...c].map(f=>en(f))}function hI(e,t){const n=t.columnsData[Object.keys(t.columnsData)[0]].length,r=new Int32Array(n).fill(0);for(let a=0;a<n;a++){let i=!1;for(let o=0;o<e.length;o++){const{selectedSource:s,selectedFilterValue:c,selectedFilterRange:f,type:A}=e[o],h=en(s),v=(kn(h)?t.columnsData[s]:t.axesData[s])[a];if(c!==void 0&&(i=i||v===c),f!==void 0&&(f.min!==void 0||f.max!==void 0)&&typeof v=="number"){let g=!0;f.min!==void 0&&(g=g&&v>=f.min),f.max!==void 0&&(g=g&&v<=f.max),i=i||g}A==="subset"&&(i=i||v!=null)}i&&(r[a]=1)}return r}var U2=class{constructor(e,t){this.simpleComponentControllers=e,this.filterComponentControllers=t,this.ignoredOptionIdNames=[],this.dataInputs=[],this.dontAllowUnfilteredHighCardinality=!1}get requiredComponents(){const e=[];for(const t of Object.keys(this.simpleComponentControllers))this.simpleComponentControllers[t].isRequired&&e.push(t);return e}get dimensionsConsumerComponents(){const e=[];for(const t of Object.keys(this.simpleComponentControllers))this.simpleComponentControllers[t].isDimensionsConsumer&&e.push(t);for(const t of Object.keys(this.filterComponentControllers))this.filterComponentControllers[t].isDimensionsConsumer&&e.push(t);return e}addSelected(e,t,n){if(e in this.simpleComponentControllers)return this.simpleComponentControllers[e].addSelected(t,n);if(e in this.filterComponentControllers)return this.filterComponentControllers[e].addSelected(t,n);throw Error(`Unknown input name: ${String(e)}`)}deleteSelected(e,t,n,r){if(e in this.simpleComponentControllers)return this.simpleComponentControllers[e].deleteSelected(n,r.selectedSource);if(e in this.filterComponentControllers)return this.filterComponentControllers[e].deleteSelected(n,r.selectedSource);throw Error(`Unknown input name: ${String(e)}`)}changeSelected(e,t,n,r){const a=n.components[e].selectorStates,i=a.filter(c=>!r.find(f=>f.selectedSource===c.selectedSource)),o=r.filter(c=>!a.find(f=>f.selectedSource===c.selectedSource));let s=hw(n);return i.forEach(c=>{s=this.deleteSelected(e,t,s,c)}),o.forEach(c=>{s=this.addSelected(e,s,c)}),n.components[e].selectorStates=r.map(c=>n.components[e].selectorStates.find(f=>f.selectedSource===c.selectedSource)).filter(Boolean),s}switchDividableAxis(e,t){return hw(e)}async getMustBeConsumedAxes(e,t){return Promise.resolve(new Set)}createEmptyComponentsGuide(e){return Object.fromEntries(Object.entries(e.components).map(([t,n])=>[t,{options:[],optionsInfo:new Map,stateConsistency:{},required:!1,multipleSelectors:!1}]))}async getSelectedSourcesInfo(e,t,n,r){var a;const i=new Map,o=new Set;for(const f of this.dataInputs)for(const A of t.components[f].selectorStates){const h=en(A.selectedSource);if(kn(h)){const v=await e.pFrameProvider.getColumnSpecById(h);v&&v.axesSpec.forEach(g=>o.add(Lr.fromAxisSpec(g).toCanonicalString()))}}const s=new Set;let c=[...o];for(;c.length;){const f=[];for(const A of c)if(r[A]){const h=Object.keys(r[A]);for(const v of h)!s.has(v)&&!o.has(v)&&(f.push(v),s.add(v))}c=f}for(const[f,{selectorStates:A}]of Object.entries(t.components)){const v=((a=this.simpleComponentControllers[f])!=null?a:this.filterComponentControllers[f]).settings.columnsWithExtraAxesAllowed;for(const{selectedSource:g}of A)await Ine(e,g,n[g],i,o,s,v)}return i}getEmptyInputGuide(e){return{components:this.createEmptyComponentsGuide(e),getSourceInfo:t=>cI(t),freeOptionsSet:new Set,axesToBeFixedSet:new Set,readyData:!1,ready:!1,consistent:!0}}getConsumedOptionsSet(e){const t=new Set;for(const n of this.dimensionsConsumerComponents)for(const{selectedSource:r}of e.components[n].selectorStates)t.add(r);return t}async getLabelsMap(e,t){const n=await e.pFrameProvider.getColumnsFull(this.dataInputs.reduce((r,a)=>{const o=t.components[a].selectorStates.map(s=>en(s.selectedSource));return r.concat(o)},[]),!1);return Ene(n,r=>r.spec).reduce((r,a)=>{const i=new Q2({name:a.value.columnId,type:a.value.spec.valueType}).toCanonicalString();return r[i]=a.label,r},{})}async calculateOptions(e,t,n=[],r=Vne){var a,i;const o=this.createEmptyComponentsGuide(t),s=this.getConsumedOptionsSet(t),c=new Set(this.ignoredOptionIdNames),f=new Set(n),A=await rv(e),h=await this.getLabelsMap(e,t),v=await this.getSelectedSourcesInfo(e,t,h,A),g=new Map,C={...this.simpleComponentControllers,...this.filterComponentControllers},b=new Set;for(const[$,z]of Object.entries(C)){const O=await z.getOptions(e,t,h,s,A,r,c,f);this.dataInputs.includes($)||O.options.forEach(K=>{b.add(K.value)});for(const[K,te]of O.optionsInfo)g.set(K,te);o[$]=O}const B=$=>{const z=g.get($);z&&z.kind==="axis"&&(z.mustBeConsumed=!0);const O=v.get($);O&&O.kind==="axis"&&(O.mustBeConsumed=!0)},E=await this.getMustBeConsumedAxes(e,t);for(const $ of E)B($);if(this.dontAllowUnfilteredHighCardinality){const $=O=>{var K;return((K=O==null?void 0:O.annotations)==null?void 0:K[Pne])==="true"},z=(i=(a=t.components.filters)==null?void 0:a.selectorStates.reduce((O,K)=>{const te=v.get(K.selectedSource);return(te==null?void 0:te.kind)==="column"&&te.spec.axesSpec.filter($).forEach(G=>O.add(Lr.fromAxisSpec(G).toCanonicalString())),(te==null?void 0:te.kind)==="axis"&&$(te.spec)&&O.add(Lr.fromAxisSpec(te.spec).toCanonicalString()),O},new Set))!=null?i:new Set;this.dataInputs.forEach(O=>{for(const{selectedSource:K}of t.components[O].selectorStates){const te=v.get(K);if((te==null?void 0:te.kind)==="column"&&te.spec.axesSpec.filter($).forEach(G=>{const Q=Lr.fromAxisSpec(G).toCanonicalString();!b.has(Q)&&!z.has(Q)&&b.add(Q),z.has(Q)||B(Q)}),(te==null?void 0:te.kind)==="axis"&&$(te.spec)){const le=Lr.fromAxisSpec(te.spec).toCanonicalString();b.has(le)||b.add(le),z.has(le)||B(le)}}})}const k=new Set;for(const{selectorStates:$}of Object.values(t.components))for(const{selectedSource:z}of $){const O=v.get(z);O&&O.kind==="column"&&O.axesToBeFixed.forEach(K=>{k.add(K)})}const P=await this.isConsistent(e,t,A),I=$=>{var z,O,K;const te=(z=en($).toCanonicalString())!=null?z:$;return(K=(O=g.get(te))!=null?O:v.get(te))!=null?K:cI($)};return{components:o,getSourceInfo:I,freeOptionsSet:b,axesToBeFixedSet:k,readyData:this.readyDataInputs(t),ready:this.readyForPlotBuilding(e,t,P,b,I),consistent:P}}async getUniqueSourceValuesWithLabels(e,t,n){var r;const a=t.getSourceInfo(n),i=(r=a.annotations)==null?void 0:r[Mne],o=i?JSON.parse(i).map(s=>String(s)):null;if(a.kind==="axis"){const s=en(n),c=a.parentSources.map(en),f=await wa(e,n,a.parentSources),A=o??await e.pFrameProvider.getAxisUniqueValues(s,c),h=await $ne(e,s,c[0],f);return A.map(v=>{var g;return{value:v,label:(g=h==null?void 0:h[v])!=null?g:v}})}if(a.kind==="column"){const s=en(n),c=await wa(e,n,[]),f=await e.pFrameProvider.getColumnUniqueValues(s),A=await Dne(e,s,c);return f.map(h=>{var v;return{value:h,label:(v=A==null?void 0:A[h])!=null?v:h}})}return[]}async checkStateConsistency(e,t,n){const r=new Map;for(const a of Object.keys(this.simpleComponentControllers))r.set(a,await this.simpleComponentControllers[a].checkStateConsistency(e,t,n));for(const a of Object.keys(this.filterComponentControllers))r.set(a,await this.filterComponentControllers[a].checkStateConsistency(e,t,n));return r}async isConsistent(e,t,n){const r=await this.checkStateConsistency(e,t,n);for(const a of r.values())if(Object.values(a).some(i=>!i))return!1;return!0}readyDataInputs(e){return this.dataInputs.every(t=>e.components[t].selectorStates.length>0)}readyForPlotBuilding(e,t,n,r,a){if(!n||!this.readyDataInputs(t))return!1;let i=!1;for(const s of r){const c=a(s);if(c&&c.kind==="axis"&&c.mustBeConsumed){i=!0;break}}let o=!1;for(const{selectorStates:s}of Object.values(t.components)){for(const{selectedSource:c,fixedAxes:f}of s){const A=a(c);if(A&&A.kind==="column"&&A.axesToBeFixed.some(h=>{var v;return((v=(f??[]).find(g=>g.axisSource===h))==null?void 0:v.axisValue)===void 0})){o=!0;break}}if(o)break}return this.requiredComponents.every(s=>t.components[s].selectorStates.length>0)&&!i&&!o}async createDataForPlot(e,t){return{data:await this.createDataByColumns(e,t),settings:await this.createChartSettings(e,t)}}},pI=class cte{constructor({componentName:t,allowedTypes:n,settings:r,strictlyDependsOnParents:a,dependsOn:i=[],parentComponents:o=[],annotations:s={},checkSourceBySpec:c}){this.componentName=t,this.allowedTypes=[...n],this.settings={...cte.DefaultSettings,...r},this.dependsOn=[...i],this.parentComponents=[...o],this.strictlyDependsOnParents=a??!0,this.annotations={...s},c&&(this.checkSourceBySpec=c)}get isRequired(){return this.settings.required}get isDimensionsConsumer(){return this.settings.dimensionConsumer}addSelected(t,n){const r=hw(t);return r.components[this.componentName].selectorStates.push(n),r}deleteSelected(t,n){const r=hw(t);return r.components[this.componentName].selectorStates=r.components[this.componentName].selectorStates.filter(a=>a.selectedSource!==n),r}async checkStateConsistency(t,n,r){const a=n.components[this.componentName],{allowedAxes:i}=await this.getAllowedAxes(t,n,r);function o(c){const f=Lr.fromAxisSpec(c);return i.has(f.toCanonicalString())}const s=await Promise.all(a.selectorStates.map(async({selectedSource:c})=>{const f=en(c);if(kn(f)){const A=await t.pFrameProvider.getColumnSpecById(f);return A?this.parentComponents.length===0?!0:this.strictlyDependsOnParents&&!this.settings.columnsWithExtraAxesAllowed&&!this.settings.isDataComponent?A.axesSpec.every(v=>o(v)):this.settings.columnsWithExtraAxesAllowed&&!this.settings.isDataComponent?A.axesSpec.some(v=>o(v)):i.size===0||A.axesSpec.some(v=>o(v)):!1}return i.has(c)}));return a.selectorStates.reduce((c,f,A)=>(c[f.selectedSource]=s[A],c),{})}async getProducingAxes(t,n){const i=n.components[this.componentName].selectorStates.map(c=>en(c.selectedSource)).filter(c=>kn(c)),o=new Set;return(await Promise.all(i.map(c=>t.pFrameProvider.getColumnSpecById(c)))).forEach(c=>{c&&c.axesSpec.forEach(f=>{o.add(Lr.fromAxisSpec(f).toCanonicalString())})}),o}getParentSelectedSources(t,n){return this.parentComponents.reduce((a,i)=>{const o=n.components[i].selectorStates.map(s=>en(s.selectedSource));return a.push(...o),a},[])}async getParentAxes(t,n){var r;const a=this.getParentSelectedSources(t,n),i=new Set;for(const o of a)if(kn(o)){const s=await t.pFrameProvider.getColumnSpecById(o);(r=s==null?void 0:s.axesSpec)==null||r.forEach(c=>{const f=Lr.fromAxisSpec(c);i.add(f.toCanonicalString())})}return i}async getAllowedAxes(t,n,r){var a,i,o,s,c,f,A;const h=this.getParentSelectedSources(t,n),v=new Set,g=new Set,C=new Set,b=new Map;for(const E of h)if(kn(E)){const k=await t.pFrameProvider.getColumnSpecById(E);for(const P of(a=k==null?void 0:k.axesSpec)!=null?a:[]){const $=Lr.fromAxisSpec(P).toCanonicalString();if(v.has($))continue;v.add($),g.add($);const z=AI(P);b.set($,{kind:"axis",name:P.name,label:await Kr(t,$,[E.toCanonicalString()]),type:P.type,mustBeConsumed:z,dividable:!1,spec:P,annotations:P.annotations,isSubsetFilter:((i=P.annotations)==null?void 0:i[F2])==="true",isDiscreteFilter:P.type==="String"||((o=P.annotations)==null?void 0:o[Ng])==="true",parentSources:[E.toCanonicalString()]})}}let B=[...v];for(;B.length;){const E=[];for(const k of B)if(r[k]){const P=Object.keys(r[k]);for(const I of P)if(!v.has(I)){E.push(I),v.add(I),C.add(I);const{spec:$,id:z}=r[k][I];for(const O of $.axesSpec){const K=Lr.fromAxisSpec(O).toCanonicalString();b.has(K)||b.set(K,{kind:"axis",name:O.name,label:(c=(s=O.annotations)==null?void 0:s[sI])!=null?c:"",type:O.type,mustBeConsumed:!1,dividable:!1,spec:O,annotations:O.annotations,isSubsetFilter:((f=O.annotations)==null?void 0:f[F2])==="true",isDiscreteFilter:O.type==="String"||((A=O.annotations)==null?void 0:A[Ng])==="true",parentSources:[z.toCanonicalString()]})}}}B=E}return{allowedAxes:v,parentAxes:g,linkerAxes:C,optionsInfo:b}}async getOptions(t,n,r,a,i,o,s=new Set,c=new Set){var f,A,h,v,g,C,b,B;const E=this.settings.multipleSelectors,k=this.settings.required,P=await this.checkStateConsistency(t,n,i);if(this.dependsOn.length&&this.dependsOn.some(Q=>n.components[Q].selectorStates.length===0))return{multipleSelectors:E,required:k,stateConsistency:P,options:[],optionsInfo:new Map};if(this.strictlyDependsOnParents&&!this.settings.isDataComponent&&this.parentComponents.some(Q=>n.components[Q].selectorStates.length===0))return{multipleSelectors:E,required:k,stateConsistency:P,options:[],optionsInfo:new Map};const I=this.getParentSelectedSources(t,n),$=(await t.pFrameProvider.getColumns([],!1,this.allowedTypes,void 0,this.annotations)).filter(Q=>!a.has(Q.toCanonicalString())),{allowedAxes:z,parentAxes:O,linkerAxes:K,optionsInfo:te}=await this.getAllowedAxes(t,n,i),le=n.components[this.componentName],G=[];if(this.settings.axesAllowed)for(const Q of O){const j=en(Q),Y=te.get(j.toCanonicalString()),X=this.allowedTypes.includes(Y.spec.type),ee=Object.entries(this.annotations).every(([Ce,De])=>{var ke;return((ke=Y.spec.annotations)==null?void 0:ke[Ce])===De}),pe=this.checkSourceBySpec?this.checkSourceBySpec(Y.spec,n):!0,ae=!this.settings.homogeneous||!(Y!=null&&Y.mustBeConsumed),ge=!a.has(Q),me=s.has(j.name)||c.has(j.toCanonicalString()),fe=le.selectorStates.some(Ce=>Ce.selectedSource===Q);X&&ee&&pe&&ae&&ge&&!me&&!fe&&G.push({value:Q})}if(this.settings.columnsAllowed){const Q=!this.settings.columnsWithExtraAxesAllowed&&this.strictlyDependsOnParents;for(const j of $){const Y=j.toCanonicalString(),X=en(Y),ee=await t.pFrameProvider.getColumnSpecById(X),pe=((f=ee==null?void 0:ee.annotations)==null?void 0:f[uI])==="true";if(!ee||Bne(ee)||pe||this.checkSourceBySpec&&!this.checkSourceBySpec(ee,n)||this.settings.isDataComponent&&!o(ee)||Q&&((A=ee.axesSpec)!=null&&A.some(De=>!z.has(Lr.fromAxisSpec(De).toCanonicalString())))||I.length&&!((h=ee.axesSpec)!=null&&h.some(De=>z.has(Lr.fromAxisSpec(De).toCanonicalString()))))continue;const ae=(g=(v=ee==null?void 0:ee.axesSpec)==null?void 0:v.map(De=>Lr.fromAxisSpec(De).toCanonicalString()))!=null?g:[],ge=[],me={};if(this.settings.columnsWithExtraAxesAllowed&&ae.forEach((De,ke)=>{z.has(De)||(ge.push(De),me[De]=ke)}),ee){const De=(C=r[Y])!=null?C:await Kr(t,j.toCanonicalString(),[]),ke={kind:"column",name:ee.name,label:De,type:ee.valueType,spec:ee,annotations:ee.annotations,isSubsetFilter:((b=ee.annotations)==null?void 0:b[F2])==="true",isDiscreteFilter:ee.valueType==="String"||((B=ee.annotations)==null?void 0:B[Ng])==="true",axesToBeFixed:ge,axesToBeFixedIndexes:me};te.set(X.toCanonicalString(),ke)}const fe=s.has(X.name)||c.has(X.toCanonicalString()),Ce=n.components[this.componentName].selectorStates.some(De=>De.selectedSource===Y);!fe&&!Ce&&G.push({value:Y})}}return{multipleSelectors:E,required:k,stateConsistency:P,options:G,optionsInfo:te}}};pI.DefaultSettings={isDataComponent:!1,multipleSelectors:!1,required:!1,homogeneous:!1,axesAllowed:!1,columnsAllowed:!0,columnsWithExtraAxesAllowed:!0,dimensionConsumer:!1};var En=pI,One={type:"bubble",components:{valueSize:{type:"simple",selectorStates:[]},valueColor:{type:"simple",selectorStates:[]},x:{type:"simple",selectorStates:[]},y:{type:"simple",selectorStates:[]},filters:{type:"filter",selectorStates:[]},tabBy:{type:"filter",selectorStates:[]},facetBy:{type:"simple",selectorStates:[]},tooltipContent:{type:"simple",selectorStates:[]}},dividedAxes:{}};function pw(e,t){if(!t.length)return[];const n=t.map(i=>en(i)),r=Object.values(e.columnsData)[0].length,a=[];for(let i=0;i<r;i++){const o=n.map(s=>{const c=s.toCanonicalString();return kn(s)?e.columnsData[c][i]:e.axesData[c][i]}).join(", ");a.push(o)}return a}var Fne=class extends U2{constructor(){super({valueSize:new En({componentName:"valueSize",allowedTypes:["Int","Long","Double","Float"],strictlyDependsOnParents:!0,parentComponents:["valueColor"],settings:{isDataComponent:!0,columnsAllowed:!0,axesAllowed:!1,required:!0}}),valueColor:new En({componentName:"valueColor",allowedTypes:["Int","Long","Double","Float"],strictlyDependsOnParents:!0,parentComponents:["valueSize"],settings:{isDataComponent:!0,columnsAllowed:!0,axesAllowed:!1,required:!0}}),x:new En({componentName:"x",allowedTypes:["Int","String","Long"],strictlyDependsOnParents:!0,parentComponents:["valueSize","valueColor"],settings:{required:!0,dimensionConsumer:!0,multipleSelectors:!0,axesAllowed:!0,columnsAllowed:!1}}),y:new En({componentName:"y",allowedTypes:["Int","String","Long"],strictlyDependsOnParents:!0,parentComponents:["valueSize","valueColor"],settings:{required:!0,dimensionConsumer:!0,multipleSelectors:!0,axesAllowed:!0,columnsAllowed:!1}}),tooltipContent:new En({componentName:"tooltipContent",allowedTypes:["String","Int","Long","Float","Double"],strictlyDependsOnParents:!0,parentComponents:["valueSize","valueColor"],settings:{columnsAllowed:!0,axesAllowed:!0,multipleSelectors:!0}}),facetBy:new En({componentName:"facetBy",allowedTypes:["String","Int","Long"],strictlyDependsOnParents:!0,parentComponents:["valueSize","valueColor"],settings:{axesAllowed:!0,dimensionConsumer:!0,multipleSelectors:!0}})},{filters:new En({componentName:"filters",allowedTypes:["String","Int","Long","Double","Long"],strictlyDependsOnParents:!0,parentComponents:["valueSize","valueColor"],settings:{columnsAllowed:!0,axesAllowed:!0,dimensionConsumer:!0,multipleSelectors:!0},checkSourceBySpec:nv}),tabBy:new En({componentName:"tabBy",allowedTypes:["String","Int"],strictlyDependsOnParents:!0,parentComponents:["valueSize","valueColor"],settings:{columnsAllowed:!0,axesAllowed:!0,dimensionConsumer:!0}})}),this.dataInputs=["valueSize","valueColor"],this.dontAllowUnfilteredHighCardinality=!0}async getMustBeConsumedAxes(e,t){if(!t.components.valueColor.selectorStates.length)return new Set;const n=t.components.valueColor.selectorStates[0].selectedSource,r=await e.pFrameProvider.getColumnSpecById(en(n));return r?new Set(r.axesSpec.map(a=>Lr.fromAxisSpec(a).toCanonicalString())):new Set}async createDataByColumns(e,t){var n,r,a;const i=(n=t.components.valueColor.selectorStates[0])==null?void 0:n.selectedSource,o=(r=t.components.valueSize.selectorStates[0])==null?void 0:r.selectedSource;if(!i||!o)throw Error("Value column is not valid");const s=en(i),c=en(o);if(!s||!c||!kn(s)&&!kn(c))throw Error("Value column is not valid");const f={type:"columns",id:(a=I1(t.components))!=null?a:"",values:{}},A=await rv(e),h=[...t.components.filters.selectorStates,...t.components.tabBy.selectorStates],v=tv(h),g=h.map(j=>en(j.selectedSource)).filter(kn),C=[s,c].filter(kn),b=C.map(j=>j.toCanonicalString()),B=await j2(e,b),E=[t.components.facetBy,t.components.x,t.components.y,t.components.tooltipContent],k=[],P=C.map(()=>[]),I=[],$=[];for(const{selectedSource:j,fixedAxes:Y}of h)$.push(...await jc(e,A,B,j,Y)),P.push((Y??[]).map(({axisIdx:X,axisValue:ee})=>({idx:X,value:ee})));for(const j of E)for(const{selectedSource:Y,fixedAxes:X}of j.selectorStates){k.push(en(Y)),I.push((X??[]).map(({axisIdx:pe,axisValue:ae})=>({idx:pe,value:ae}))),$.push(...await jc(e,A,B,Y,X));const ee=await wa(e,Y,b);ee&&k.push(ee)}const z=await e.pFrameProvider.getTableOuterJoin([...C,...$,...g],k,v,!0,P,I);k.forEach(j=>{const Y=j.toCanonicalString();f.values[Y]=kn(j)?z.columnsData[Y]:z.axesData[Y]}),f.values[i]=kn(s)?z.columnsData[i]:z.axesData[i],f.values[o]=kn(c)?z.columnsData[o]:z.axesData[o];const O=t.components.x.selectorStates.map(j=>j.selectedSource),K=O.join(", "),te=await Promise.all(O.map(async j=>{var Y,X;return(X=(Y=await wa(e,j,b))==null?void 0:Y.toCanonicalString())!=null?X:j}));f.values[K]=pw(z,O),f.values.xLabels=pw(z,te);const le=t.components.y.selectorStates.map(j=>j.selectedSource),G=le.join(", "),Q=await Promise.all(le.map(async j=>{var Y,X;return(X=(Y=await wa(e,j,b))==null?void 0:Y.toCanonicalString())!=null?X:j}));return f.values[G]=pw(z,le),f.values.yLabels=pw(z,Q),{byColumns:f}}async createChartSettings(e,t){var n,r;const a=(n=t.components.valueColor.selectorStates[0])==null?void 0:n.selectedSource,i=(r=t.components.valueSize.selectorStates[0])==null?void 0:r.selectedSource;if(!a||!i)throw Error("Value column is not valid");const o=en(a),s=en(i);if(!kn(o)&&!kn(s))throw Error("Value column is not valid");const c=[o,s].filter(kn).map(P=>P.toCanonicalString()),f={type:"column",value:a,label:await Kr(e,a,[])},A={type:"column",value:i,label:await Kr(e,i,[])},v=t.components.x.selectorStates.map(({selectedSource:P})=>P).join(", "),C=t.components.y.selectorStates.map(({selectedSource:P})=>P).join(", "),b=await Promise.all(t.components.facetBy.selectorStates.map(async P=>{var I,$;return{type:"column",value:($=(I=await wa(e,P.selectedSource,c))==null?void 0:I.toCanonicalString())!=null?$:P.selectedSource}})),B=(await Promise.all(t.components.x.selectorStates.map(P=>Kr(e,P.selectedSource,c)))).join(", "),E=(await Promise.all(t.components.y.selectorStates.map(P=>Kr(e,P.selectedSource,c)))).join(", "),k=await Promise.all(t.components.tooltipContent.selectorStates.map(async P=>{var I,$;const z=P.selectedSource;return{type:"column",label:await Kr(e,z,c)||z,value:z,valueLabels:($=(I=await wa(e,z,c))==null?void 0:I.toCanonicalString())!=null?$:z}}));return{type:"bubble",valueColor:f,valueSize:A,xColumn:{type:"column",value:v,label:B,valueLabels:"xLabels"},yColumn:{type:"column",value:C,label:E,valueLabels:"yLabels"},facetBy:b,tooltips:{show:!0,content:k}}}},Qne={type:"histogram",components:{value:{type:"simple",selectorStates:[]},grouping:{type:"simple",selectorStates:[]},filters:{type:"filter",selectorStates:[]},tabBy:{type:"filter",selectorStates:[]},facetBy:{type:"simple",selectorStates:[]}},dividedAxes:{}},jne=class extends U2{constructor(){super({value:new En({componentName:"value",allowedTypes:["Int","Long","Double","Float"],settings:{isDataComponent:!0,columnsAllowed:!0,axesAllowed:!1,required:!0}}),grouping:new En({componentName:"grouping",allowedTypes:["String","Int","Long"],parentComponents:["value"],dependsOn:["value"],settings:{axesAllowed:!0,multipleSelectors:!1}}),facetBy:new En({componentName:"facetBy",allowedTypes:["String","Int","Long"],parentComponents:["value"],dependsOn:["value"],settings:{axesAllowed:!0,dimensionConsumer:!0,multipleSelectors:!0}})},{filters:new En({componentName:"filters",allowedTypes:["String","Int","Long","Double","Float"],parentComponents:["value"],dependsOn:["value"],settings:{columnsAllowed:!0,axesAllowed:!0,dimensionConsumer:!0,multipleSelectors:!0},checkSourceBySpec:nv}),tabBy:new En({componentName:"tabBy",allowedTypes:["String","Int"],parentComponents:["value"],dependsOn:["value"],settings:{columnsAllowed:!0,axesAllowed:!0,dimensionConsumer:!0}})}),this.dataInputs=["value"]}async createDataByColumns(e,t){var n,r;const a=(n=t.components.value.selectorStates[0])==null?void 0:n.selectedSource;if(!a)throw Error("Value column is not valid");const i=en(a);if(!kn(i))throw Error("Value column is not valid");const o={type:"columns",id:(r=I1(t.components))!=null?r:"",values:{}},s=await rv(e),c=[...t.components.filters.selectorStates,...t.components.tabBy.selectorStates],f=tv(c),A=c.map(P=>en(P.selectedSource)).filter(kn),h=[a],v=await j2(e,h),g=[t.components.facetBy,t.components.grouping],C=[],b=[[]],B=[],E=[];for(const{selectedSource:P,fixedAxes:I}of c)E.push(...await jc(e,s,v,P,I)),E.push(...await jc(e,s,v,P,I)),b.push((I??[]).map(({axisIdx:$,axisValue:z})=>({idx:$,value:z})));for(const P of g)for(const{selectedSource:I,fixedAxes:$}of P.selectorStates){C.push(en(I)),B.push(($??[]).map(({axisIdx:O,axisValue:K})=>({idx:O,value:K}))),E.push(...await jc(e,s,v,I,$));const z=await wa(e,I,h);z&&C.push(z)}const k=await e.pFrameProvider.getTableOuterJoin([i,...E,...A],C,f,!0,b,B);return C.forEach(P=>{const I=P.toCanonicalString();o.values[I]=kn(P)?k.columnsData[I]:k.axesData[I]}),o.values[i.toCanonicalString()]=k.columnsData[i.toCanonicalString()],{byColumns:o}}async createChartSettings(e,t){var n,r;const a=(n=t.components.value.selectorStates[0])==null?void 0:n.selectedSource;if(!a)throw Error("Value column is not valid");const i=en(a);if(!kn(i))throw Error("Value column is not valid");const o=[a],s={type:"column",value:a,label:await Kr(e,a,[])},c=await Promise.all(t.components.facetBy.selectorStates.map(async A=>{var h,v;return{type:"column",value:(v=(h=await wa(e,A.selectedSource,o))==null?void 0:h.toCanonicalString())!=null?v:A.selectedSource}}));let f;if(t.components.grouping.selectorStates.length){const{selectedSource:A}=t.components.grouping.selectorStates[0];f={type:"column",value:A,label:await Kr(e,A,o),valueLabels:(r=await wa(e,A,o))==null?void 0:r.toCanonicalString()}}return{type:"histogram",valueColumn:s,facetBy:c,grouping:f}}},Une={type:"discrete",components:{y:{type:"simple",selectorStates:[]},filters:{type:"filter",selectorStates:[]},tabBy:{type:"filter",selectorStates:[]},facetBy:{type:"simple",selectorStates:[]},primaryGrouping:{type:"simple",selectorStates:[]},secondaryGrouping:{type:"simple",selectorStates:[]}},dividedAxes:{}},Gne=class extends U2{constructor(){super({y:new En({componentName:"y",allowedTypes:["Int","Double","Long","Float"],settings:{isDataComponent:!0}}),primaryGrouping:new En({componentName:"primaryGrouping",allowedTypes:["String","Int","Long"],strictlyDependsOnParents:!0,parentComponents:["y"],dependsOn:["y"],settings:{axesAllowed:!0,homogeneous:!0}}),secondaryGrouping:new En({componentName:"secondaryGrouping",allowedTypes:["String","Int","Long"],strictlyDependsOnParents:!0,parentComponents:["y"],dependsOn:["primaryGrouping"],settings:{axesAllowed:!0,homogeneous:!0}}),facetBy:new En({componentName:"facetBy",allowedTypes:["String","Int","Long"],strictlyDependsOnParents:!0,parentComponents:["y"],dependsOn:["y"],settings:{axesAllowed:!0,dimensionConsumer:!0,multipleSelectors:!0}})},{filters:new En({componentName:"filters",allowedTypes:["String","Int","Long","Double","Float"],strictlyDependsOnParents:!0,parentComponents:["y"],dependsOn:["y"],settings:{axesAllowed:!0,dimensionConsumer:!0,multipleSelectors:!0},checkSourceBySpec:nv}),tabBy:new En({componentName:"tabBy",allowedTypes:["String","Int"],strictlyDependsOnParents:!0,parentComponents:["y"],dependsOn:["y"],settings:{axesAllowed:!0,dimensionConsumer:!0}})}),this.dataInputs=["y"],this.dontAllowUnfilteredHighCardinality=!0}async createDataByColumns(e,t){var n;const r=t.components.y.selectorStates[0].selectedSource,a=en(r);if(!r||!kn(a))throw Error("Y column is not valid");const i={type:"columns",id:(n=I1(t.components))!=null?n:"",values:{}},o=await rv(e),s=[...t.components.filters.selectorStates,...t.components.tabBy.selectorStates],c=tv(s),f=s.map(k=>en(k.selectedSource)).filter(kn),A=[r],h=await j2(e,A),v=[t.components.primaryGrouping,t.components.secondaryGrouping,t.components.facetBy],g=[],C=[[]],b=[],B=[];for(const{selectedSource:k,fixedAxes:P}of s)B.push(...await jc(e,o,h,k,P)),C.push((P??[]).map(({axisIdx:I,axisValue:$})=>({idx:I,value:$})));for(const k of v)for(const{selectedSource:P,fixedAxes:I}of k.selectorStates){g.push(en(P)),b.push((I??[]).map(({axisIdx:z,axisValue:O})=>({idx:z,value:O}))),B.push(...await jc(e,o,h,P,I));const $=await wa(e,P,A);$&&g.push($)}const E=await e.pFrameProvider.getTableOuterJoin([a,...B,...f],g,c,!0,C,b);return g.forEach(k=>{const P=k.toCanonicalString();i.values[P]=kn(k)?E.columnsData[P]:E.axesData[P]}),i.values[a.toCanonicalString()]=E.columnsData[a.toCanonicalString()],{byColumns:i}}async createChartSettings(e,t){var n,r;const a=t.components.y.selectorStates[0].selectedSource,i=en(a);if(!a||!kn(i))throw Error("Y column is not valid");const o={type:"column",value:a,label:await Kr(e,a,[])},s=[a];let c;if(t.components.primaryGrouping.selectorStates.length){const{selectedSource:h}=t.components.primaryGrouping.selectorStates[0];c={columnName:{type:"column",value:h,label:await Kr(e,h,s),valueLabels:(n=await wa(e,h,s))==null?void 0:n.toCanonicalString()}}}let f;if(t.components.secondaryGrouping.selectorStates.length){const{selectedSource:h}=t.components.secondaryGrouping.selectorStates[0];f={columnName:{type:"column",value:h,label:await Kr(e,h,s),valueLabels:(r=await wa(e,h,s))==null?void 0:r.toCanonicalString()}}}const A=await Promise.all(t.components.facetBy.selectorStates.map(async h=>{var v,g;return{type:"column",value:(g=(v=await wa(e,h.selectedSource,s))==null?void 0:v.toCanonicalString())!=null?g:h.selectedSource,label:await Kr(e,h.selectedSource,s)}}));return{type:"discrete",y:o,primaryGrouping:c,secondaryGrouping:f,facetBy:A}}},Yne={type:"heatmap",components:{value:{type:"simple",selectorStates:[]},x:{type:"simple",selectorStates:[]},y:{type:"simple",selectorStates:[]},xGroupBy:{type:"simple",selectorStates:[]},yGroupBy:{type:"simple",selectorStates:[]},filters:{type:"filter",selectorStates:[]},tabBy:{type:"filter",selectorStates:[]},facetBy:{type:"simple",selectorStates:[]},annotationsX:{type:"simple",selectorStates:[]},annotationsY:{type:"simple",selectorStates:[]},tooltipContent:{type:"simple",selectorStates:[]}},dividedAxes:{}};function oE(e){return e?"kind"in e&&e.kind==="PColumn"?e.valueType==="String":e.type==="String":!0}function vw(e,t){if(!t.length)return[];const n=t.map(i=>en(i)),r=Object.values(e.columnsData)[0].length,a=[];for(let i=0;i<r;i++){const o=n.map(s=>{const c=s.toCanonicalString();return kn(s)?e.columnsData[c][i]:e.axesData[c][i]}).join(", ");a.push(o)}return a}var Wne=class extends U2{constructor(){super({value:new En({componentName:"value",allowedTypes:["Int","Long","Double","Float","String"],settings:{isDataComponent:!0,columnsAllowed:!0,axesAllowed:!1,required:!0}}),x:new En({componentName:"x",allowedTypes:["Int","String","Long"],strictlyDependsOnParents:!0,parentComponents:["value"],settings:{required:!0,dimensionConsumer:!0,multipleSelectors:!0,axesAllowed:!0,columnsAllowed:!1}}),xGroupBy:new En({componentName:"xGroupBy",allowedTypes:["Int","String","Long"],strictlyDependsOnParents:!0,parentComponents:["value"],settings:{dimensionConsumer:!0,multipleSelectors:!0,axesAllowed:!0,columnsAllowed:!0},dependsOn:["x"],checkSourceBySpec:(e,t)=>{const n=new Set([...t.components.x.selectorStates.map(r=>r.selectedSource),...t.components.xGroupBy.selectorStates.map(r=>r.selectedSource)]);return"kind"in e&&e.kind==="PColumn"?Lr.fromAxesSpec(e.axesSpec).every(r=>n.has(r.toCanonicalString())):!0}}),y:new En({componentName:"y",allowedTypes:["Int","String","Long"],strictlyDependsOnParents:!0,parentComponents:["value"],settings:{required:!0,dimensionConsumer:!0,multipleSelectors:!0,axesAllowed:!0,columnsAllowed:!0}}),yGroupBy:new En({componentName:"yGroupBy",allowedTypes:["Int","String","Long"],strictlyDependsOnParents:!0,parentComponents:["value"],settings:{dimensionConsumer:!0,multipleSelectors:!0,axesAllowed:!0,columnsAllowed:!1},dependsOn:["y"],checkSourceBySpec:(e,t)=>{const n=new Set([...t.components.y.selectorStates.map(r=>r.selectedSource),...t.components.yGroupBy.selectorStates.map(r=>r.selectedSource)]);return"kind"in e&&e.kind==="PColumn"?Lr.fromAxesSpec(e.axesSpec).every(r=>n.has(r.toCanonicalString())):!0}}),tooltipContent:new En({componentName:"tooltipContent",allowedTypes:["String","Int","Long","Float","Double"],strictlyDependsOnParents:!0,parentComponents:["value"],dependsOn:["value"],settings:{columnsAllowed:!0,axesAllowed:!0,multipleSelectors:!0}}),facetBy:new En({componentName:"facetBy",allowedTypes:["String","Int","Long"],strictlyDependsOnParents:!0,parentComponents:["value"],dependsOn:["value"],settings:{axesAllowed:!0,dimensionConsumer:!0,multipleSelectors:!0}}),annotationsX:new En({componentName:"annotationsX",allowedTypes:["Int","Long","Double","Float","String"],parentComponents:["value"],settings:{axesAllowed:!0,multipleSelectors:!0},dependsOn:["x"],checkSourceBySpec:(e,t)=>{const n=new Set([...t.components.x.selectorStates.map(r=>r.selectedSource),...t.components.xGroupBy.selectorStates.map(r=>r.selectedSource)]);return"kind"in e&&e.kind==="PColumn"?Lr.fromAxesSpec(e.axesSpec).every(r=>n.has(r.toCanonicalString())):n.has(Lr.fromAxisSpec(e).toCanonicalString())}}),annotationsY:new En({componentName:"annotationsY",allowedTypes:["Int","Long","Double","Float","String"],parentComponents:["value"],settings:{axesAllowed:!0,multipleSelectors:!0},dependsOn:["y"],checkSourceBySpec:(e,t)=>{const n=new Set([...t.components.y.selectorStates.map(r=>r.selectedSource),...t.components.yGroupBy.selectorStates.map(r=>r.selectedSource)]);return"kind"in e&&e.kind==="PColumn"?Lr.fromAxesSpec(e.axesSpec).every(r=>n.has(r.toCanonicalString())):n.has(Lr.fromAxisSpec(e).toCanonicalString())}})},{filters:new En({componentName:"filters",allowedTypes:["String","Int","Long","Double","Long"],strictlyDependsOnParents:!0,parentComponents:["value"],dependsOn:["value"],settings:{columnsAllowed:!0,axesAllowed:!0,dimensionConsumer:!0,multipleSelectors:!0},checkSourceBySpec:nv}),tabBy:new En({componentName:"tabBy",allowedTypes:["String","Int"],strictlyDependsOnParents:!0,parentComponents:["value"],dependsOn:["value"],settings:{columnsAllowed:!0,axesAllowed:!0,dimensionConsumer:!0}})}),this.dataInputs=["value"],this.dontAllowUnfilteredHighCardinality=!0}async getMustBeConsumedAxes(e,t){if(!t.components.value.selectorStates.length)return new Set;const n=t.components.value.selectorStates[0].selectedSource,r=await e.pFrameProvider.getColumnSpecById(en(n));return r?new Set(r.axesSpec.map(a=>Lr.fromAxisSpec(a).toCanonicalString())):new Set}async createDataByColumns(e,t){var n,r;const a=(n=t.components.value.selectorStates[0])==null?void 0:n.selectedSource;if(!a)throw Error("Value column is not valid");const i=en(a);if(!kn(i))throw Error("Value column is not valid");const o={type:"columns",id:(r=I1(t.components))!=null?r:"",values:{}},s=await rv(e),c=[...t.components.filters.selectorStates,...t.components.tabBy.selectorStates],f=tv(c),A=c.map(G=>en(G.selectedSource)).filter(kn),h=[a],v=await j2(e,h),g=[t.components.facetBy,t.components.annotationsX,t.components.annotationsY,t.components.x,t.components.y,t.components.xGroupBy,t.components.yGroupBy,t.components.tooltipContent],C=[],b=[[]],B=[],E=[];for(const{selectedSource:G,fixedAxes:Q}of c)E.push(...await jc(e,s,v,G,Q)),b.push((Q??[]).map(({axisIdx:j,axisValue:Y})=>({idx:j,value:Y})));for(const G of g)for(const{selectedSource:Q,fixedAxes:j}of G.selectorStates){C.push(en(Q)),B.push((j??[]).map(({axisIdx:X,axisValue:ee})=>({idx:X,value:ee}))),E.push(...await jc(e,s,v,Q,j));const Y=await wa(e,Q,h);Y&&C.push(Y)}const k=await e.pFrameProvider.getTableOuterJoin([i,...E,...A],C,f,!0,b,B);C.forEach(G=>{const Q=G.toCanonicalString();o.values[Q]=kn(G)?k.columnsData[Q]:k.axesData[Q]}),o.values[i.toCanonicalString()]=k.columnsData[i.toCanonicalString()];const P=t.components.x.selectorStates.concat(t.components.xGroupBy.selectorStates).map(G=>G.selectedSource),I=P.join(", ");o.values[I]=vw(k,P);const $=t.components.x.selectorStates.map(G=>G.selectedSource),z=await Promise.all($.map(async G=>{var Q,j;return(j=(Q=await wa(e,G,h))==null?void 0:Q.toCanonicalString())!=null?j:G}));o.values.xLabelsKey=vw(k,z);const O=t.components.y.selectorStates.concat(t.components.yGroupBy.selectorStates).map(G=>G.selectedSource),K=O.join(", ");o.values[K]=vw(k,O);const te=t.components.y.selectorStates.map(G=>G.selectedSource),le=await Promise.all(te.map(async G=>{var Q,j;return(j=(Q=await wa(e,G,h))==null?void 0:Q.toCanonicalString())!=null?j:G}));return o.values.yLabelsKey=vw(k,le),{byColumns:o}}async createChartSettings(e,t){var n;const r=(n=t.components.value.selectorStates[0])==null?void 0:n.selectedSource;if(!r)throw Error("Value column is not valid");const a=en(r);if(!kn(a))throw Error("Value column is not valid");const i=[r],o={type:"column",value:r,label:await Kr(e,r,[])},c=t.components.x.selectorStates.concat(t.components.xGroupBy.selectorStates).map(({selectedSource:I})=>en(I)).map(I=>I.toCanonicalString()).join(", "),A=t.components.y.selectorStates.concat(t.components.yGroupBy.selectorStates).map(({selectedSource:I})=>en(I)).map(I=>I.toCanonicalString()).join(", "),h=await Promise.all(t.components.facetBy.selectorStates.map(async I=>{var $,z;return{type:"column",value:(z=($=await wa(e,I.selectedSource,i))==null?void 0:$.toCanonicalString())!=null?z:I.selectedSource}})),v=await Promise.all(t.components.xGroupBy.selectorStates.map(async I=>{var $,z;return{type:"column",label:await Kr(e,I.selectedSource,i),value:I.selectedSource,valueLabels:(z=($=await wa(e,I.selectedSource,i))==null?void 0:$.toCanonicalString())!=null?z:I.selectedSource}})),g=await Promise.all(t.components.yGroupBy.selectorStates.map(async I=>{var $,z;return{type:"column",label:await Kr(e,I.selectedSource,i),value:I.selectedSource,valueLabels:(z=($=await wa(e,I.selectedSource,i))==null?void 0:$.toCanonicalString())!=null?z:I.selectedSource}})),C=await e.pFrameProvider.getColumnSpecById(a),b=await Promise.all(t.components.annotationsX.selectorStates.map(async I=>{var $,z;const O=I.selectedSource,K=en(O),te=kn(K)?await e.pFrameProvider.getColumnSpecById(K):(z=($=C==null?void 0:C.axesSpec)==null?void 0:$.find(le=>Lr.fromAxisSpec(le).toCanonicalString()===O))!=null?z:null;return{axis:"x",valueColumn:{type:"column",value:O,label:await Kr(e,O,i)},type:oE(te)?"discrete":"continuous"}})),B=await Promise.all(t.components.annotationsY.selectorStates.map(async I=>{var $,z;const O=I.selectedSource,K=en(O),te=kn(K)?await e.pFrameProvider.getColumnSpecById(K):(z=($=C==null?void 0:C.axesSpec)==null?void 0:$.find(le=>Lr.fromAxisSpec(le).toCanonicalString()===O))!=null?z:null;return{axis:"y",valueColumn:{type:"column",value:O,label:await Kr(e,O,i)},type:oE(te)?"discrete":"continuous"}})),E=(await Promise.all(t.components.x.selectorStates.map(I=>Kr(e,I.selectedSource,i)))).join(", "),k=(await Promise.all(t.components.y.selectorStates.map(I=>Kr(e,I.selectedSource,i)))).join(", "),P=await Promise.all(t.components.tooltipContent.selectorStates.map(async I=>{var $,z;const O=I.selectedSource;return{type:"column",label:await Kr(e,O,i)||O,value:O,valueLabels:(z=($=await wa(e,O,i))==null?void 0:$.toCanonicalString())!=null?z:O}}));return{type:"heatmap",valueColumn:o,valueType:oE(C)?"discrete":"continuous",xColumn:{type:"column",value:c,label:E,valueLabels:"xLabelsKey"},yColumn:{type:"column",value:A,label:k,valueLabels:"yLabelsKey"},facetBy:h,xGroupBy:v,yGroupBy:g,annotations:[...b,...B],tooltips:{show:!0,content:P}}}},Xne={type:"scatterplot",components:{x:{type:"simple",selectorStates:[]},y:{type:"simple",selectorStates:[]},filters:{type:"filter",selectorStates:[]},highlight:{type:"filter",selectorStates:[]},tabBy:{type:"filter",selectorStates:[]},facetBy:{type:"simple",selectorStates:[]},grouping:{type:"simple",selectorStates:[]},shape:{type:"simple",selectorStates:[]},size:{type:"simple",selectorStates:[]},label:{type:"simple",selectorStates:[]},tooltipContent:{type:"simple",selectorStates:[]}},dividedAxes:{}},Kne=class extends U2{constructor(){super({x:new En({componentName:"x",allowedTypes:["Int","Long","Double","Float"],parentComponents:["y"],strictlyDependsOnParents:!1,settings:{isDataComponent:!0,required:!0,axesAllowed:!0,columnsAllowed:!0}}),y:new En({componentName:"y",allowedTypes:["Int","Long","Double","Float"],parentComponents:["x"],strictlyDependsOnParents:!1,settings:{isDataComponent:!0,required:!0,axesAllowed:!0,columnsAllowed:!0}}),facetBy:new En({componentName:"facetBy",allowedTypes:["String","Int","Long"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{axesAllowed:!0,dimensionConsumer:!0,multipleSelectors:!0}}),grouping:new En({componentName:"grouping",allowedTypes:["String","Int","Long","Double","Float"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{axesAllowed:!0,multipleSelectors:!0}}),shape:new En({componentName:"shape",allowedTypes:["String","Int","Long"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{axesAllowed:!0}}),size:new En({componentName:"size",allowedTypes:["Int","Long","Double","Float"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{axesAllowed:!0}}),tooltipContent:new En({componentName:"tooltipContent",allowedTypes:["String","Int","Long","Float","Double"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{columnsAllowed:!0,axesAllowed:!0,multipleSelectors:!0}}),label:new En({componentName:"label",allowedTypes:["String","Int","Long"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{axesAllowed:!0,columnsAllowed:!0,multipleSelectors:!1}})},{filters:new En({componentName:"filters",allowedTypes:["String","Int","Long","Double","Float"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{axesAllowed:!0,columnsAllowed:!0,dimensionConsumer:!0,multipleSelectors:!0},checkSourceBySpec:nv}),tabBy:new En({componentName:"tabBy",allowedTypes:["String","Int"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{axesAllowed:!0,dimensionConsumer:!0}}),highlight:new En({componentName:"highlight",allowedTypes:["String","Int","Long","Double","Float"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{axesAllowed:!0,columnsAllowed:!0,multipleSelectors:!0},checkSourceBySpec:nv})}),this.dataInputs=["x","y"]}async getMustBeConsumedAxes(e,t){if(!t.components.x.selectorStates.length||!t.components.y.selectorStates.length)return new Set;const n=t.components.x.selectorStates[0].selectedSource,r=t.components.y.selectorStates[0].selectedSource,a=await e.pFrameProvider.getColumnSpecById(en(n)),i=await e.pFrameProvider.getColumnSpecById(en(r));if(!a||!i)return new Set;const o=a.axesSpec.map(A=>Lr.fromAxisSpec(A).toCanonicalString()),s=i.axesSpec.map(A=>Lr.fromAxisSpec(A).toCanonicalString()),c=o.filter(A=>!s.some(h=>h===A)),f=s.filter(A=>!o.some(h=>h===A));return new Set([...c,...f])}async createDataByColumns(e,t){var n,r,a;const i=(n=t.components.x.selectorStates[0])==null?void 0:n.selectedSource,o=(r=t.components.y.selectorStates[0])==null?void 0:r.selectedSource;if(!i||!o)throw Error("X or Y column is not valid");const s=en(i),c=en(o),f={type:"columns",id:(a=I1(t.components))!=null?a:"",values:{}},A=await rv(e),h=[...t.components.filters.selectorStates,...t.components.tabBy.selectorStates],v=tv(h),g=h.map(O=>en(O.selectedSource)).filter(kn),C=[s,c].filter(kn).map(O=>O.toCanonicalString());if(C.length===0)throw Error("One of X and Y should be a column");const b=await j2(e,C),B=[s,c,...g],E=[],k=[[],[]],P=[],I=[];for(const{selectedSource:O,fixedAxes:K}of h)I.push(...await jc(e,A,b,O,K)),k.push((K??[]).map(({axisIdx:te,axisValue:le})=>({idx:te,value:le})));const $=[t.components.grouping,t.components.size,t.components.shape,t.components.tooltipContent,t.components.facetBy,t.components.label,t.components.highlight];for(const O of $)for(const{selectedSource:K,fixedAxes:te}of O.selectorStates){E.push(en(K)),P.push((te??[]).map(({axisIdx:G,axisValue:Q})=>({idx:G,value:Q}))),I.push(...await jc(e,A,b,K,te));const le=await wa(e,K,C);le&&E.push(le)}const z=await e.pFrameProvider.getTableOuterJoin([s,c,...I,...g],E,v,!1,k,P);return[...B,...E].forEach(O=>{const K=O.toCanonicalString();f.values[K]=kn(O)?z.columnsData[K]:z.axesData[K]}),f.values.key=new Array(f.values[Object.keys(f.values)[0]].length).fill(0).map((O,K)=>K),t.components.highlight.selectorStates.length&&(f.values.highlight=hI(t.components.highlight.selectorStates,z)),{byColumns:f}}async createChartSettings(e,t){var n,r,a,i;const o=(n=t.components.x.selectorStates[0])==null?void 0:n.selectedSource,s=(r=t.components.y.selectorStates[0])==null?void 0:r.selectedSource,c=o?en(o):null,f=s?en(s):null;if(!o||!s||!c||!f||!kn(c)&&!kn(f))throw Error("Empty or invalid required data");const A=[c,f].filter(kn).map(I=>I.toCanonicalString()),h={type:"column",value:o,label:await Kr(e,o,A)},v={type:"column",value:s,label:await Kr(e,s,A)},g={type:"column",value:"key"},C=await Promise.all(t.components.facetBy.selectorStates.map(async I=>{var $,z;return{type:"column",value:(z=($=await wa(e,I.selectedSource,A))==null?void 0:$.toCanonicalString())!=null?z:I.selectedSource}})),b=Zn.uniq([...t.components.grouping.selectorStates.map(I=>I.selectedSource),...t.components.size.selectorStates.map(I=>I.selectedSource),...t.components.shape.selectorStates.map(I=>I.selectedSource)]),B=await Promise.all(b.map(async I=>{var $,z;return{type:"column",label:await Kr(e,I,A)||I,value:I,valueLabels:(z=($=await wa(e,I,A))==null?void 0:$.toCanonicalString())!=null?z:I}})),E=await Promise.all(t.components.tooltipContent.selectorStates.map(async I=>{var $,z;const O=I.selectedSource;return{type:"column",label:await Kr(e,O,A)||O,value:O,valueLabels:(z=($=await wa(e,O,A))==null?void 0:$.toCanonicalString())!=null?z:O}}));let k;if(t.components.label.selectorStates.length){const I=t.components.label.selectorStates[0].selectedSource;k={type:"column",value:I,label:await Kr(e,I,A),valueLabels:(i=(a=await wa(e,I,A))==null?void 0:a.toCanonicalString())!=null?i:I}}let P;return t.components.highlight.selectorStates.length&&(P={type:"column",value:"highlight"}),{type:"scatterplot",x:h,y:v,keyColumn:g,facetBy:C,grouping:B,label:k,highlight:P,tooltips:{show:!0,content:E}}}},Zne={type:"scatterplot-umap",components:{x:{type:"simple",selectorStates:[]},y:{type:"simple",selectorStates:[]},filters:{type:"filter",selectorStates:[]},highlight:{type:"filter",selectorStates:[]},tabBy:{type:"filter",selectorStates:[]},facetBy:{type:"simple",selectorStates:[]},grouping:{type:"simple",selectorStates:[]},label:{type:"simple",selectorStates:[]},tooltipContent:{type:"simple",selectorStates:[]},size:{type:"simple",selectorStates:[]}},dividedAxes:{}},Jne=class extends U2{constructor(){super({x:new En({componentName:"x",allowedTypes:["Int","Long","Double","Float"],parentComponents:["y"],strictlyDependsOnParents:!1,settings:{isDataComponent:!0,required:!0,axesAllowed:!0,columnsAllowed:!0}}),y:new En({componentName:"y",allowedTypes:["Int","Long","Double","Float"],parentComponents:["x"],strictlyDependsOnParents:!1,settings:{isDataComponent:!0,required:!0,axesAllowed:!0,columnsAllowed:!0}}),facetBy:new En({componentName:"facetBy",allowedTypes:["String","Int","Long"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{axesAllowed:!0,dimensionConsumer:!0,multipleSelectors:!0}}),grouping:new En({componentName:"grouping",allowedTypes:["String","Int","Long","Float","Double"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{axesAllowed:!0,multipleSelectors:!0}}),tooltipContent:new En({componentName:"tooltipContent",allowedTypes:["String","Int","Long","Float","Double"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{columnsAllowed:!0,axesAllowed:!0,multipleSelectors:!0}}),label:new En({componentName:"label",allowedTypes:["String","Int","Long"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{axesAllowed:!0,columnsAllowed:!0,multipleSelectors:!1}}),size:new En({componentName:"size",allowedTypes:["Int","Long","Double","Float"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{axesAllowed:!0}})},{filters:new En({componentName:"filters",allowedTypes:["String","Int","Long","Double","Float"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{axesAllowed:!0,dimensionConsumer:!0,multipleSelectors:!0},checkSourceBySpec:nv}),tabBy:new En({componentName:"tabBy",allowedTypes:["String","Int"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{axesAllowed:!0,dimensionConsumer:!0}}),highlight:new En({componentName:"highlight",allowedTypes:["String","Int","Long","Double","Float"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{axesAllowed:!0,columnsAllowed:!0,multipleSelectors:!0},checkSourceBySpec:nv})}),this.dataInputs=["x","y"]}async getMustBeConsumedAxes(e,t){if(!t.components.x.selectorStates.length||!t.components.y.selectorStates.length)return new Set;const n=t.components.x.selectorStates[0].selectedSource,r=t.components.y.selectorStates[0].selectedSource,a=await e.pFrameProvider.getColumnSpecById(en(n)),i=await e.pFrameProvider.getColumnSpecById(en(r));if(!a||!i)return new Set;const o=a.axesSpec.map(A=>Lr.fromAxisSpec(A).toCanonicalString()),s=i.axesSpec.map(A=>Lr.fromAxisSpec(A).toCanonicalString()),c=o.filter(A=>!s.some(h=>h===A)),f=s.filter(A=>!o.some(h=>h===A));return new Set([...c,...f])}async createDataByColumns(e,t){var n,r,a;const i=(n=t.components.x.selectorStates[0])==null?void 0:n.selectedSource,o=(r=t.components.y.selectorStates[0])==null?void 0:r.selectedSource;if(!i||!o)throw Error("X or Y column is not valid");const s=en(i),c=en(o);if(!s||!c)throw Error("X or Y column is not valid");const f={type:"columns",id:(a=I1(t.components))!=null?a:"",values:{}},A=await rv(e),h=[...t.components.filters.selectorStates,...t.components.tabBy.selectorStates],v=tv(h),g=h.map(O=>en(O.selectedSource)).filter(kn),C=[s,c].filter(kn).map(O=>O.toCanonicalString());if(C.length===0)throw Error("One of X and Y should be a column");const b=await j2(e,C),B=[s,c,...g],E=[],k=[[],[]],P=[],I=[];for(const{selectedSource:O,fixedAxes:K}of h)I.push(...await jc(e,A,b,O,K)),I.push(...await jc(e,A,b,O,K)),k.push((K??[]).map(({axisIdx:te,axisValue:le})=>({idx:te,value:le})));const $=[t.components.grouping,t.components.facetBy,t.components.tooltipContent,t.components.label,t.components.highlight,t.components.size];for(const O of $)for(const{selectedSource:K,fixedAxes:te}of O.selectorStates){E.push(en(K)),P.push((te??[]).map(({axisIdx:G,axisValue:Q})=>({idx:G,value:Q}))),I.push(...await jc(e,A,b,K,te));const le=await wa(e,K,C);le&&E.push(le)}const z=await e.pFrameProvider.getTableOuterJoin([s,c,...I,...g],E,v,!1,k,P);return[...B,...E].forEach(O=>{const K=O.toCanonicalString();f.values[K]=kn(O)?z.columnsData[K]:z.axesData[K]}),t.components.highlight.selectorStates.length&&(f.values.highlight=hI(t.components.highlight.selectorStates,z)),{byColumns:f,axesData:z.axesData}}async createChartSettings(e,t){var n,r,a,i;const o=(n=t.components.x.selectorStates[0])==null?void 0:n.selectedSource,s=(r=t.components.y.selectorStates[0])==null?void 0:r.selectedSource,c=o?en(o):null,f=s?en(s):null;if(!o||!s||!c||!f||!kn(c)&&!kn(f))throw Error("Empty or invalid required data");const A=[c,f].filter(kn).map(I=>I.toCanonicalString()),h={type:"column",value:o,label:await Kr(e,o,A)},v={type:"column",value:s,label:await Kr(e,s,A)},g={type:"column",value:"key"},C=await Promise.all(t.components.facetBy.selectorStates.map(async I=>{var $,z;return{type:"column",value:(z=($=await wa(e,I.selectedSource,A))==null?void 0:$.toCanonicalString())!=null?z:I.selectedSource}})),b=Zn.uniq([...t.components.grouping.selectorStates.map(I=>I.selectedSource),...t.components.size.selectorStates.map(I=>I.selectedSource)]),B=await Promise.all(b.map(async I=>{var $,z;return{type:"column",label:await Kr(e,I,A)||I,value:I,valueLabels:(z=($=await wa(e,I,A))==null?void 0:$.toCanonicalString())!=null?z:I}})),E=await Promise.all(t.components.tooltipContent.selectorStates.map(async I=>{var $,z;const O=I.selectedSource;return{type:"column",label:await Kr(e,O,A)||O,value:O,valueLabels:(z=($=await wa(e,O,A))==null?void 0:$.toCanonicalString())!=null?z:O}}));let k;if(t.components.label.selectorStates.length){const I=t.components.label.selectorStates[0].selectedSource;k={type:"column",value:I,label:await Kr(e,I,A),valueLabels:(i=(a=await wa(e,I,A))==null?void 0:a.toCanonicalString())!=null?i:I}}let P;return t.components.highlight.selectorStates.length&&(P={type:"column",value:"highlight"}),{type:"scatterplot-umap",x:h,y:v,keyColumn:g,facetBy:C,grouping:B,label:k,highlight:P,tooltips:{show:!0,content:E}}}},lE="pl7.app/dendrogram/nodeId",sE="id",qne={type:"dendro",components:{value:{type:"simple",selectorStates:[]},height:{type:"simple",selectorStates:[]},labels:{type:"simple",selectorStates:[]},tableContent:{type:"simple",selectorStates:[]},nodeColor:{type:"simple",selectorStates:[]},nodeShape:{type:"simple",selectorStates:[]},nodeSize:{type:"simple",selectorStates:[]},lineColor:{type:"simple",selectorStates:[]},heatmapAnnotation:{type:"simple",selectorStates:[]},heatmapForSequence:{type:"simple",selectorStates:[]},filters:{type:"filter",selectorStates:[]},tabBy:{type:"filter",selectorStates:[]},facetBy:{type:"simple",selectorStates:[]},heatmapAxis:{type:"simple",selectorStates:[]},heatmapGroup:{type:"simple",selectorStates:[]}},dividedAxes:{}},ere=class extends U2{constructor(){super({value:new En({componentName:"value",allowedTypes:["Int","Long"],annotations:{"pl7.app/dendrogram/isTopology":"true"},settings:{isDataComponent:!0,columnsAllowed:!0,required:!0,dimensionConsumer:!0,columnsWithExtraAxesAllowed:!1}}),height:new En({componentName:"height",allowedTypes:["Int","Long","Double","Float"],annotations:{"pl7.app/dendrogram/isDistance":"true"},parentComponents:["value"],strictlyDependsOnParents:!0,settings:{columnsAllowed:!0,axesAllowed:!1,dimensionConsumer:!0,columnsWithExtraAxesAllowed:!1}}),labels:new En({componentName:"labels",allowedTypes:["Int","String","Long"],parentComponents:["value"],strictlyDependsOnParents:!1,settings:{columnsAllowed:!0,axesAllowed:!1,columnsWithExtraAxesAllowed:!1}}),tableContent:new En({componentName:"tableContent",allowedTypes:["Int","String","Long","Double","Float"],parentComponents:["value"],strictlyDependsOnParents:!1,settings:{columnsAllowed:!0,axesAllowed:!0,multipleSelectors:!0,columnsWithExtraAxesAllowed:!1}}),nodeShape:new En({componentName:"nodeShape",allowedTypes:["Int","String","Long"],parentComponents:["value"],strictlyDependsOnParents:!1,settings:{columnsAllowed:!0,axesAllowed:!0,columnsWithExtraAxesAllowed:!1}}),nodeSize:new En({componentName:"nodeSize",allowedTypes:["Double","Int","String","Long"],parentComponents:["value"],strictlyDependsOnParents:!1,settings:{columnsAllowed:!0,axesAllowed:!0,columnsWithExtraAxesAllowed:!1}}),nodeColor:new En({componentName:"nodeColor",allowedTypes:["Double","Int","String","Long"],parentComponents:["value"],strictlyDependsOnParents:!1,settings:{columnsAllowed:!0,axesAllowed:!0,columnsWithExtraAxesAllowed:!1}}),lineColor:new En({componentName:"lineColor",allowedTypes:["Double","Int","String","Long"],parentComponents:["value"],strictlyDependsOnParents:!1,settings:{columnsAllowed:!0,axesAllowed:!1,columnsWithExtraAxesAllowed:!1}}),heatmapForSequence:new En({componentName:"heatmapForSequence",allowedTypes:["String"],annotations:{"pl7.app/type":"sequence"},parentComponents:["value"],strictlyDependsOnParents:!1,settings:{columnsAllowed:!0,axesAllowed:!0,columnsWithExtraAxesAllowed:!1}}),heatmapAnnotation:new En({componentName:"heatmapAnnotation",allowedTypes:["Double","Int","Long","Float","String"],parentComponents:["value"],strictlyDependsOnParents:!1,settings:{isDataComponent:!0,columnsAllowed:!0,axesAllowed:!1,columnsWithExtraAxesAllowed:!1}}),facetBy:new En({componentName:"facetBy",allowedTypes:["String","Int","Long"],parentComponents:["value"],strictlyDependsOnParents:!0,settings:{dimensionConsumer:!0,multipleSelectors:!0,axesAllowed:!0,columnsAllowed:!1,columnsWithExtraAxesAllowed:!1}}),heatmapAxis:new En({componentName:"heatmapAxis",allowedTypes:["String","Int","Long"],parentComponents:["heatmapAnnotation"],settings:{dimensionConsumer:!0,axesAllowed:!0,columnsAllowed:!1,columnsWithExtraAxesAllowed:!1}}),heatmapGroup:new En({componentName:"heatmapGroup",allowedTypes:["String","Int","Long"],parentComponents:["heatmapAnnotation"],settings:{dimensionConsumer:!0,multipleSelectors:!0,axesAllowed:!0,columnsAllowed:!1,columnsWithExtraAxesAllowed:!1}})},{filters:new En({componentName:"filters",allowedTypes:["String","Int","Long"],parentComponents:["value","heatmapAnnotation"],strictlyDependsOnParents:!1,settings:{dimensionConsumer:!0,multipleSelectors:!0,axesAllowed:!0,columnsAllowed:!1,columnsWithExtraAxesAllowed:!1}}),tabBy:new En({componentName:"tabBy",allowedTypes:["String","Int","Long"],parentComponents:["value","heatmapAnnotation"],strictlyDependsOnParents:!1,settings:{dimensionConsumer:!0,axesAllowed:!0,columnsAllowed:!1,columnsWithExtraAxesAllowed:!1}})}),this.ignoredOptionIdNames=[lE]}readyDataInputs(e){return e.components.value.selectorStates.length>0}async createTableData(e,t){var n;const r={},a=(n=t.components.value.selectorStates[0])==null?void 0:n.selectedSource,i=en(a);if(!a||!kn(i))throw Error("Value column is not valid");const o=await rv(e),s=tv([...t.components.filters.selectorStates,...t.components.tabBy.selectorStates]),c=[...t.components.filters.selectorStates.map(P=>en(P.selectedSource)),...t.components.tabBy.selectorStates.map(P=>en(P.selectedSource))].filter(kn),f=[a],A=await j2(e,f),h=[],v=[],g=[],C=[t.components.value],b=[t.components.tableContent,t.components.labels,t.components.nodeColor,t.components.nodeSize,t.components.nodeShape,t.components.lineColor],B={};for(const P of C)for(const{selectedSource:I,fixedAxes:$}of P.selectorStates){g.push(...await jc(e,o,A,I,$));const z=await wa(e,I,f),O=z??en(I);B[O.toCanonicalString()]=I,h.push(O)}for(const P of b)for(const{selectedSource:I,fixedAxes:$}of P.selectorStates){g.push(...await jc(e,o,A,I,$));const z=await wa(e,I,f),O=z??en(I);B[I]=O.toCanonicalString(),v.push(O)}const E=await e.pFrameProvider.getTableOuterJoin([...h,...c,...g],v,s,!1);for(const P of[...h,...v]){const I=P.toCanonicalString(),$=B[P.toCanonicalString()];r[$]={data:kn(P)?E.columnsData[I]:E.axesData[I],spec:kn(P)?E.columnSpecs[I]:E.axesSpecs[I],label:await Kr(e,$,f)}}const k=Object.keys(E.axesData).find(P=>{var I;return((I=en(P))==null?void 0:I.name)===lE});return k?r[sE]={data:E.axesData[k],spec:{kind:"PColumn",valueType:"Int",name:"Node id"},label:"Node id"}:console.warn("Missed node id axis in data column"),r}async createDataByColumns(e,t){var n,r,a;const i=(n=t.components.value.selectorStates[0])==null?void 0:n.selectedSource,o=(r=t.components.heatmapAnnotation.selectorStates[0])==null?void 0:r.selectedSource,s=en(i),c=o?en(o):null;if(!i||!kn(s))throw Error("Value column is not valid");const f={type:"columns",id:(a=I1(t.components))!=null?a:"",values:{}},A=[...t.components.filters.selectorStates,...t.components.tabBy.selectorStates],h=tv(A),v=A.map(z=>en(z.selectedSource)).filter(kn),g=[s,c].filter(kn).map(z=>z.toCanonicalString()),C=[],b=[],B=[],E=[],k=[t.components.value,t.components.height,t.components.labels,t.components.nodeColor,t.components.nodeSize,t.components.nodeShape,t.components.lineColor,t.components.heatmapAnnotation,t.components.heatmapForSequence],P=[t.components.facetBy,t.components.heatmapAxis,t.components.heatmapGroup,t.components.tableContent];for(const z of k)for(const{selectedSource:O,fixedAxes:K}of z.selectorStates){C.push(en(O)),B.push((K??[]).map(({axisIdx:le,axisValue:G})=>({idx:le,value:G})));const te=await wa(e,O,g);te&&C.push(te)}A.forEach(({fixedAxes:z})=>{B.push((z??[]).map(({axisIdx:O,axisValue:K})=>({idx:O,value:K})))});for(const z of P)for(const{selectedSource:O,fixedAxes:K}of z.selectorStates){b.push(en(O)),E.push((K??[]).map(({axisIdx:le,axisValue:G})=>({idx:le,value:G})));const te=await wa(e,O,g);te&&b.push(te)}const I=await e.pFrameProvider.getTableOuterJoin([...C,...v],b,h,!1,B,E);[...C,...b].forEach(z=>{const O=z.toCanonicalString(),K=kn(z)?I.columnsData[O]:I.axesData[O];f.values[O]=[],f.values[O]=K});const $=Object.keys(I.axesData).find(z=>{var O;return((O=en(z))==null?void 0:O.name)===lE});return $?f.values[sE]=I.axesData[$]:console.warn("Missed node id axis in data column"),{byColumns:f}}async createChartSettings(e,t){var n,r,a;const i=(n=t.components.value.selectorStates[0])==null?void 0:n.selectedSource,o=en(i);if(!i||!kn(o))throw Error("Data column is not valid");const s=[i],c={type:"column",value:sE},f={type:"column",value:i},A=t.components.height.selectorStates.length?{type:"column",value:t.components.height.selectorStates[0].selectedSource}:void 0,h=t.components.labels.selectorStates.length?{type:"column",value:t.components.labels.selectorStates[0].selectedSource}:void 0,v={};if(t.components.nodeColor.selectorStates.length){const B=t.components.nodeColor.selectorStates[0].selectedSource;v.nodeColor={columnName:{type:"column",value:B,label:await Kr(e,B,s)}}}if(t.components.nodeShape.selectorStates.length){const B=t.components.nodeShape.selectorStates[0].selectedSource;v.nodeShape={columnName:{type:"column",value:B,label:await Kr(e,B,s)}}}if(t.components.nodeSize.selectorStates.length){const B=t.components.nodeSize.selectorStates[0].selectedSource;v.nodeSize={columnName:{type:"column",value:B,label:await Kr(e,B,s)}}}if(t.components.lineColor.selectorStates.length){const B=t.components.lineColor.selectorStates[0].selectedSource;v.lineColor={columnName:{type:"column",value:B,label:await Kr(e,B,s)}}}let g,C,b;if(t.components.heatmapAnnotation.selectorStates.length&&t.components.heatmapAxis.selectorStates.length){const B=t.components.heatmapAnnotation.selectorStates[0].selectedSource;g={type:"column",value:B,label:await Kr(e,B,[]),valueLabels:(r=await wa(e,B,[]))==null?void 0:r.toCanonicalString()};const E=t.components.heatmapAxis.selectorStates[0].selectedSource;C={type:"column",value:E,label:await Kr(e,E,[B]),valueLabels:(a=await wa(e,E,[B]))==null?void 0:a.toCanonicalString()},b=await Promise.all(t.components.heatmapGroup.selectorStates.map(async k=>{var P;return{type:"column",value:k.selectedSource,label:await Kr(e,k.selectedSource,[B]),valueLabels:(P=await wa(e,k.selectedSource,[B]))==null?void 0:P.toCanonicalString()}}))}else if(t.components.heatmapForSequence.selectorStates.length){const B=t.components.heatmapForSequence.selectorStates[0].selectedSource;g={type:"column",value:B,label:await Kr(e,B,[])}}return{type:"dendro",id:c,parentId:f,height:A,labels:h,aes:v,heatmapAnnotation:g,heatmapAxis:C,heatmapGroup:b}}},mw=1e6;function gw(e,t){if(e==="String")return t.data;for(let n=0;n<t.data.length;n++){const r=t.data[n];e==="Int"&&r===-2147483648||e==="Long"&&r===BigInt(-9007199254740991)||(e==="Double"||e==="Float")&&isNaN(r)?t.data[n]=null:t.data[n]=Number(t.data[n])}return t.data}var av=!1,mkt=100,tre=class{constructor(e,t){this.pframeHandle=e,this.pframeDriver=t}async isColumnExisted(e){return!!await this.getColumnSpecById(e)}async getSingleColumnData(e,t=[]){if(!await this.isColumnExisted(e))return{axesData:{},data:[]};try{const n=Date.now(),r=await this.pframeDriver.calculateTableData(this.pframeHandle,{src:{type:"column",column:e.name},filters:t,sorting:[]}),a=r.filter(o=>o.spec.type==="axis"),i=r.filter(o=>o.spec.type==="column");return{axesData:a.reduce((o,s)=>{const c=Lr.fromAxisSpec(s.spec.spec);return o[c.toCanonicalString()]=gw(c.type,s.data),o},{}),data:i.length?gw(e.type,i[0].data):[]}}catch(n){throw console.error("PFrame: calculateTableData error"),n}}async getColumnUniqueValues(e,t=[],n=!1){if(!await this.isColumnExisted(e))return[];const r={columnId:e.name,filters:t,limit:mw};try{const a=Date.now(),i=await this.pframeDriver.getUniqueValues(this.pframeHandle,r);return i.overflow&&console.warn(`More than ${mw} values for ${e.name} column`),Array.from(i.values.data).map(String)}catch(a){throw console.error("PFrame: getUniqueValues for column error"),a}}async getAxisUniqueValues(e,t,n=[]){const r=t.filter(kn),a=await Promise.all(r.map(s=>this.getColumnSpecById(s))),i=e.toCanonicalString(),o=r.filter((s,c)=>{const f=a[c];return f!==null&&f.axesSpec.some(A=>Lr.fromAxisSpec(A).toCanonicalString()===i)});if(o.length===0)return[];try{const s=Date.now(),c=await Promise.all(o.map(f=>this.pframeDriver.getUniqueValues(this.pframeHandle,{columnId:f.name,axis:e.toPFrameId(),filters:n,limit:mw})));return c.forEach((f,A)=>{f.overflow&&console.warn(`More than ${mw} values for ${o[A].name} column`)}),Zn.uniq(Zn.flatten(c.map(f=>Array.from(f.values.data).map(String))))}catch(s){throw console.error("PFrame: getUniqueValues for axis error",s),s}}async getTableOuterJoin(e,t,n=[],r=!0,a=[],i=[]){const o=e.filter(kn),s=t.filter(kn),c={src:{type:"outer",primary:{type:r?"inner":"full",entries:o.map((f,A)=>{var h;const v=(h=a[A])==null?void 0:h.map(g=>({type:"constant",axisIndex:g.idx,constant:g.value})).filter(g=>g.constant!==void 0);return v!=null&&v.length?{type:"slicedColumn",newId:f.name,column:f.name,axisFilters:v}:{type:"column",column:f.name}})},secondary:s.map((f,A)=>{var h;const v=(h=i[A])==null?void 0:h.map(g=>({type:"constant",axisIndex:g.idx,constant:g.value})).filter(g=>g.constant!==void 0);return v!=null&&v.length?{type:"slicedColumn",newId:f.name,column:f.name,axisFilters:v}:{type:"column",column:f.name}})},filters:n,sorting:[]};try{const f=Date.now(),A=await this.pframeDriver.calculateTableData(this.pframeHandle,c),h=A.filter(g=>g.spec.type==="axis"),v=A.filter(g=>g.spec.type==="column");return{axesData:h.reduce((g,C)=>{const b=Lr.fromAxisSpec(C.spec.spec);return g[b.toCanonicalString()]=gw(b.type,C.data),g},{}),columnsData:v.reduce((g,C)=>{const b=C.spec.spec,B=new Q2({name:C.spec.id,type:b.valueType});return g[B.toCanonicalString()]=gw(B.type,C.data),g},{}),columnSpecs:v.reduce((g,C)=>{const b=C.spec.spec,B=new Q2({name:C.spec.id,type:b.valueType});return g[B.toCanonicalString()]=b,g},{}),axesSpecs:h.reduce((g,C)=>{const b=C.spec.spec,B=Lr.fromAxisSpec(b);return g[B.toCanonicalString()]=b,g},{})}}catch(f){throw console.error("PFrame: table outer join error"),console.info("error with request: ",c),f}}async getColumnSpecById(e){try{const t=Date.now(),n=await this.pframeDriver.getColumnSpec(this.pframeHandle,e.name);return n??null}catch{return console.error("PFrame: get single column error"),null}}async getColumnAxesIds(e){var t,n;return(n=(t=await this.getColumnSpecById(e))==null?void 0:t.axesSpec.map(r=>Lr.fromAxisSpec(r)))!=null?n:[]}async getRequestColumnsFromSelectedSources(e){var t,n;const r=[];for(const a of e)if(kn(a)){const i=(n=(t=await this.getColumnSpecById(a))==null?void 0:t.axesSpec)!=null?n:[];r.push(...i.map(o=>Lr.fromAxisSpec(o).toPFrameId()))}return r}async getColumnsList(){return this.pframeDriver.listColumns(this.pframeHandle)}async getColumnsFull(e,t,n,r,a){try{const i={columnFilter:{type:n,name:r,annotationValue:a},compatibleWith:await this.getRequestColumnsFromSelectedSources(e),strictlyCompatible:t},o=Date.now(),s=await this.pframeDriver.findColumns(this.pframeHandle,i),c=[];return s.hits.forEach(f=>{c.push(f)}),c}catch(i){throw console.error("PFrame: findColumns error"),i}}async getColumns(e,t,n,r,a){return(await this.getColumnsFull(e,t,n,r,a)).map(i=>new Q2({name:i.columnId,type:i.spec.valueType}))}async findColumnBy(e,t,n,r){try{const a={columnFilter:{name:[e],...t?{type:[t]}:{},...n?{annotationValue:n}:{},...r?{domainValue:r}:{}},compatibleWith:[],strictlyCompatible:!1},i=Date.now(),o=await this.pframeDriver.findColumns(this.pframeHandle,a),s=[];return o.hits.forEach(({columnId:c,spec:f})=>{s.push(new Q2({name:c,type:f.valueType}))}),s.length>1&&console.warn(`More than 1 column found for ${e}}`),s.length===0?(console.warn(`No columns found for ${e}}`),null):s[0]}catch(a){throw console.error("PFrame: findColumns error"),a}}},nre=class{constructor(e,t,n=(r,a)=>a??r){this.labelsModifier=n,this.pFrameProvider=new tre(e,t)}},vI={controllers:{discrete:new Gne,scatterplot:new Kne,"scatterplot-umap":new Jne,heatmap:new Wne,dendro:new ere,histogram:new jne,bubble:new Fne},initialStates:{discrete:Une,scatterplot:Xne,"scatterplot-umap":Zne,heatmap:Yne,dendro:qne,histogram:Qne,bubble:One}};function yw(e){return vI.controllers[e]}function mI(e){return vI.initialStates[e]}const mr=(e,t)=>{const n=e.__vccOpts||e;for(const[r,a]of t)n[r]=a;return n},rre={},are={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ire(e,t){return d.openBlock(),d.createElementBlock("svg",are,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5 1.25H4.25V2.75H5H6.25L6.25 5H4C3.44772 5 3 5.44772 3 6V8V9.25V10V10.75V12V16C3 16.5523 3.44772 17 4 17H6.25V21.25H5H4.25V22.75H5H9H9.75V21.25H9H7.75V17H10C10.5523 17 11 16.5523 11 16V12V10.75V10V9.25V8V6C11 5.44771 10.5523 5 10 5H7.75V2.75H9H9.75V1.25H9H5ZM4.5 10.75H9.5V12V15.5H4.5V12V10.75ZM9.5 9.25H4.5V8V6.5H9.5V8V9.25Z",fill:"#110529"},null,-1),d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M17 1C17.5523 1 18 1.44772 18 2C18 2.55228 17.5523 3 17 3C16.4477 3 16 2.55228 16 2C16 1.44772 16.4477 1 17 1ZM15 6.75H16.25L16.25 9H14C13.4477 9 13 9.44771 13 10V12.125V13.25V14V14.75V16V18C13 18.5523 13.4477 19 14 19H16.25L16.25 21.25H15H14.25V22.75H15H19H19.75V21.25H19H17.75V19H20C20.5523 19 21 18.5523 21 18V16V14.75V14V13.25V12.125V10C21 9.44771 20.5523 9 20 9H17.75V6.75H19H19.75V5.25H19H15H14.25V6.75H15ZM16.25 10.5H14.5V12.125V13.25H19.5V12.125V10.5H17.75H16.25ZM14.5 16V14.75H19.5V16V17.5H14.5V16Z",fill:"#07AD3E"},null,-1)]))}const ore=mr(rre,[["render",ire]]),lre={},sre={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ure(e,t){return d.openBlock(),d.createElementBlock("svg",sre,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5 1.25H4.25V2.75H5H6.25L6.25 5H4C3.44772 5 3 5.44772 3 6V8V9.25V10V10.75V12V16C3 16.5523 3.44772 17 4 17H6.25L6.25 21.25H5H4.25V22.75H5H9H9.75V21.25H9H7.75V17H10C10.5523 17 11 16.5523 11 16V12V10.75V10V9.25V8V6C11 5.44771 10.5523 5 10 5H7.75V2.75H9H9.75V1.25H9H5ZM4.5 10.75H9.5V12V15.5H4.5V12V10.75ZM9.5 9.25H4.5V8V6.5H9.5V8V9.25Z",fill:"#110529"},null,-1),d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14.25 7C14.25 5.75736 15.2574 4.75 16.5 4.75C17.7426 4.75 18.75 5.75736 18.75 7C18.75 7.08866 18.7449 7.17613 18.7349 7.26211C19.8671 7.37957 20.75 8.33668 20.75 9.5C20.75 10.6633 19.8671 11.6204 18.7349 11.7379C18.7449 11.8239 18.75 11.9113 18.75 12C18.75 13.2426 17.7426 14.25 16.5 14.25C15.2574 14.25 14.25 13.2426 14.25 12C14.25 11.9113 14.2551 11.8239 14.2651 11.7379C13.1329 11.6204 12.25 10.6633 12.25 9.5C12.25 8.33668 13.1329 7.37957 14.2651 7.26211C14.2551 7.17613 14.25 7.08866 14.25 7ZM16.5 6.25C16.0858 6.25 15.75 6.58579 15.75 7C15.75 7.41421 16.0858 7.75 16.5 7.75C16.9142 7.75 17.25 7.41421 17.25 7C17.25 6.58579 16.9142 6.25 16.5 6.25ZM13.75 9.5C13.75 9.08579 14.0858 8.75 14.5 8.75C14.9142 8.75 15.25 9.08579 15.25 9.5C15.25 9.91421 14.9142 10.25 14.5 10.25C14.0858 10.25 13.75 9.91421 13.75 9.5ZM18.5 8.75C18.0858 8.75 17.75 9.08579 17.75 9.5C17.75 9.91421 18.0858 10.25 18.5 10.25C18.9142 10.25 19.25 9.91421 19.25 9.5C19.25 9.08579 18.9142 8.75 18.5 8.75ZM14.25 18.5C14.25 17.2574 15.2574 16.25 16.5 16.25C17.7426 16.25 18.75 17.2574 18.75 18.5C18.75 19.7426 17.7426 20.75 16.5 20.75C15.2574 20.75 14.25 19.7426 14.25 18.5ZM16.5 17.75C16.0858 17.75 15.75 18.0858 15.75 18.5C15.75 18.9142 16.0858 19.25 16.5 19.25C16.9142 19.25 17.25 18.9142 17.25 18.5C17.25 18.0858 16.9142 17.75 16.5 17.75ZM15.75 12C15.75 11.5858 16.0858 11.25 16.5 11.25C16.9142 11.25 17.25 11.5858 17.25 12C17.25 12.4142 16.9142 12.75 16.5 12.75C16.0858 12.75 15.75 12.4142 15.75 12Z",fill:"#07AD3E"},null,-1)]))}const cre=mr(lre,[["render",ure]]),fre={},dre={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Are(e,t){return d.openBlock(),d.createElementBlock("svg",dre,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5 1.25H4.25V2.75H5H6.25L6.25 5H4C3.44772 5 3 5.44772 3 6V8V9.25V10V10.75V12V16C3 16.5523 3.44772 17 4 17H6.25L6.25 21.25H5H4.25V22.75H5H9H9.75V21.25H9H7.75V17H10C10.5523 17 11 16.5523 11 16V12V10.75V10V9.25V8V6C11 5.44771 10.5523 5 10 5H7.75V2.75H9H9.75V1.25H9H5ZM4.5 10.75H9.5V12V15.5H4.5V12V10.75ZM9.5 9.25H4.5V8V6.5H9.5V8V9.25Z",fill:"#110529"},null,-1),d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M18 3C18 3.55228 17.5523 4 17 4C16.4477 4 16 3.55228 16 3C16 2.44772 16.4477 2 17 2C17.5523 2 18 2.44772 18 3ZM17 15C17 15.5523 16.5523 16 16 16C15.4477 16 15 15.5523 15 15C15 14.4477 15.4477 14 16 14C16.5523 14 17 14.4477 17 15ZM18 17.5C18.5523 17.5 19 17.0523 19 16.5C19 15.9477 18.5523 15.5 18 15.5C17.4477 15.5 17 15.9477 17 16.5C17 17.0523 17.4477 17.5 18 17.5ZM17 6.5C17 7.05228 16.5523 7.5 16 7.5C15.4477 7.5 15 7.05228 15 6.5C15 5.94772 15.4477 5.5 16 5.5C16.5523 5.5 17 5.94772 17 6.5ZM18 9.5C18.5523 9.5 19 9.05228 19 8.5C19 7.94772 18.5523 7.5 18 7.5C17.4477 7.5 17 7.94772 17 8.5C17 9.05228 17.4477 9.5 18 9.5ZM21 15C21 15.5523 20.5523 16 20 16C19.4477 16 19 15.5523 19 15C19 14.4477 19.4477 14 20 14C20.5523 14 21 14.4477 21 15ZM15 13.5C15.5523 13.5 16 13.0523 16 12.5C16 11.9477 15.5523 11.5 15 11.5C14.4477 11.5 14 11.9477 14 12.5C14 13.0523 14.4477 13.5 15 13.5ZM15 16.5C15 17.0523 14.5523 17.5 14 17.5C13.4477 17.5 13 17.0523 13 16.5C13 15.9477 13.4477 15.5 14 15.5C14.5523 15.5 15 15.9477 15 16.5ZM16 19C16.5523 19 17 18.5523 17 18C17 17.4477 16.5523 17 16 17C15.4477 17 15 17.4477 15 18C15 18.5523 15.4477 19 16 19ZM18 11C18 11.5523 17.5523 12 17 12C16.4477 12 16 11.5523 16 11C16 10.4477 16.4477 10 17 10C17.5523 10 18 10.4477 18 11ZM18 14.5C18.5523 14.5 19 14.0523 19 13.5C19 12.9477 18.5523 12.5 18 12.5C17.4477 12.5 17 12.9477 17 13.5C17 14.0523 17.4477 14.5 18 14.5ZM18 20.5C18 21.0523 17.5523 21.5 17 21.5C16.4477 21.5 16 21.0523 16 20.5C16 19.9477 16.4477 19.5 17 19.5C17.5523 19.5 18 19.9477 18 20.5Z",fill:"#07AD3E"},null,-1)]))}const hre=mr(fre,[["render",Are]]),pre={},vre={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function mre(e,t){return d.openBlock(),d.createElementBlock("svg",vre,t[0]||(t[0]=[d.createStaticVNode('<path d="M3 21.25H21" stroke="#110529" stroke-width="1.5" stroke-linecap="square"></path><path d="M3 4L3 2.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 7L3 5.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 10L3 8.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 13L3 11.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 16L3 14.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 19L3 17.5" stroke="#110529" stroke-width="1.5"></path><path d="M14 11.5C14 12.3284 13.3284 13 12.5 13C11.6716 13 11 12.3284 11 11.5C11 10.6716 11.6716 10 12.5 10C13.3284 10 14 10.6716 14 11.5Z" stroke="#07AD3E" stroke-width="1.5"></path><path d="M14 14.5C14 15.3284 13.3284 16 12.5 16C11.6716 16 11 15.3284 11 14.5C11 13.6716 11.6716 13 12.5 13C13.3284 13 14 13.6716 14 14.5Z" stroke="#07AD3E" stroke-width="1.5"></path><path d="M14 17.5C14 18.3284 13.3284 19 12.5 19C11.6716 19 11 18.3284 11 17.5C11 16.6716 11.6716 16 12.5 16C13.3284 16 14 16.6716 14 17.5Z" stroke="#07AD3E" stroke-width="1.5"></path><path d="M9 17.5C9 18.3284 8.32843 19 7.5 19C6.67157 19 6 18.3284 6 17.5C6 16.6716 6.67157 16 7.5 16C8.32843 16 9 16.6716 9 17.5Z" stroke="#07AD3E" stroke-width="1.5"></path><path d="M17 8.5C17 9.32843 16.3284 10 15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7C16.3284 7 17 7.67157 17 8.5Z" stroke="#07AD3E" stroke-width="1.5"></path><path d="M17 5.5C17 6.32843 16.3284 7 15.5 7C14.6716 7 14 6.32843 14 5.5C14 4.67157 14.6716 4 15.5 4C16.3284 4 17 4.67157 17 5.5Z" stroke="#07AD3E" stroke-width="1.5"></path><path d="M17 17.5C17 18.3284 16.3284 19 15.5 19C14.6716 19 14 18.3284 14 17.5C14 16.6716 14.6716 16 15.5 16C16.3284 16 17 16.6716 17 17.5Z" stroke="#07AD3E" stroke-width="1.5"></path><path d="M20 17.5C20 18.3284 19.3284 19 18.5 19C17.6716 19 17 18.3284 17 17.5C17 16.6716 17.6716 16 18.5 16C19.3284 16 20 16.6716 20 17.5Z" stroke="#07AD3E" stroke-width="1.5"></path><path d="M20 14.5C20 15.3284 19.3284 16 18.5 16C17.6716 16 17 15.3284 17 14.5C17 13.6716 17.6716 13 18.5 13C19.3284 13 20 13.6716 20 14.5Z" stroke="#07AD3E" stroke-width="1.5"></path><path d="M17 14.5C17 15.3284 16.3284 16 15.5 16C14.6716 16 14 15.3284 14 14.5C14 13.6716 14.6716 13 15.5 13C16.3284 13 17 13.6716 17 14.5Z" stroke="#07AD3E" stroke-width="1.5"></path><path d="M17 11.5C17 12.3284 16.3284 13 15.5 13C14.6716 13 14 12.3284 14 11.5C14 10.6716 14.6716 10 15.5 10C16.3284 10 17 10.6716 17 11.5Z" stroke="#07AD3E" stroke-width="1.5"></path>',18)]))}const gre=mr(pre,[["render",mre]]),yre={},wre={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function bre(e,t){return d.openBlock(),d.createElementBlock("svg",wre,t[0]||(t[0]=[d.createStaticVNode('<path d="M18 3C18 3.55228 17.5523 4 17 4C16.4477 4 16 3.55228 16 3C16 2.44772 16.4477 2 17 2C17.5523 2 18 2.44772 18 3Z" fill="#07AD3E"></path><path d="M17 15C17 15.5523 16.5523 16 16 16C15.4477 16 15 15.5523 15 15C15 14.4477 15.4477 14 16 14C16.5523 14 17 14.4477 17 15Z" fill="#07AD3E"></path><path d="M18 17.5C18.5523 17.5 19 17.0523 19 16.5C19 15.9477 18.5523 15.5 18 15.5C17.4477 15.5 17 15.9477 17 16.5C17 17.0523 17.4477 17.5 18 17.5Z" fill="#07AD3E"></path><path d="M17 6.5C17 7.05228 16.5523 7.5 16 7.5C15.4477 7.5 15 7.05228 15 6.5C15 5.94772 15.4477 5.5 16 5.5C16.5523 5.5 17 5.94772 17 6.5Z" fill="#07AD3E"></path><path d="M18 9.5C18.5523 9.5 19 9.05228 19 8.5C19 7.94772 18.5523 7.5 18 7.5C17.4477 7.5 17 7.94772 17 8.5C17 9.05228 17.4477 9.5 18 9.5Z" fill="#07AD3E"></path><path d="M21 15C21 15.5523 20.5523 16 20 16C19.4477 16 19 15.5523 19 15C19 14.4477 19.4477 14 20 14C20.5523 14 21 14.4477 21 15Z" fill="#07AD3E"></path><path d="M15 13.5C15.5523 13.5 16 13.0523 16 12.5C16 11.9477 15.5523 11.5 15 11.5C14.4477 11.5 14 11.9477 14 12.5C14 13.0523 14.4477 13.5 15 13.5Z" fill="#07AD3E"></path><path d="M15 16.5C15 17.0523 14.5523 17.5 14 17.5C13.4477 17.5 13 17.0523 13 16.5C13 15.9477 13.4477 15.5 14 15.5C14.5523 15.5 15 15.9477 15 16.5Z" fill="#07AD3E"></path><path d="M16 19C16.5523 19 17 18.5523 17 18C17 17.4477 16.5523 17 16 17C15.4477 17 15 17.4477 15 18C15 18.5523 15.4477 19 16 19Z" fill="#07AD3E"></path><path d="M18 11C18 11.5523 17.5523 12 17 12C16.4477 12 16 11.5523 16 11C16 10.4477 16.4477 10 17 10C17.5523 10 18 10.4477 18 11Z" fill="#07AD3E"></path><path d="M18 14.5C18.5523 14.5 19 14.0523 19 13.5C19 12.9477 18.5523 12.5 18 12.5C17.4477 12.5 17 12.9477 17 13.5C17 14.0523 17.4477 14.5 18 14.5Z" fill="#07AD3E"></path><path d="M18 20.5C18 21.0523 17.5523 21.5 17 21.5C16.4477 21.5 16 21.0523 16 20.5C16 19.9477 16.4477 19.5 17 19.5C17.5523 19.5 18 19.9477 18 20.5Z" fill="#07AD3E"></path><path d="M8 3C8 2.44772 7.55228 2 7 2C6.44772 2 6 2.44772 6 3C6 3.55228 6.44772 4 7 4C7.55228 4 8 3.55228 8 3Z" fill="#110529"></path><path d="M6 4.5C6.55228 4.5 7 4.94772 7 5.5C7 6.05228 6.55228 6.5 6 6.5C5.44772 6.5 5 6.05228 5 5.5C5 4.94772 5.44772 4.5 6 4.5Z" fill="#110529"></path><path d="M5 7C5 6.44772 4.55228 6 4 6C3.44772 6 3 6.44772 3 7C3 7.55228 3.44772 8 4 8C4.55228 8 5 7.55228 5 7Z" fill="#110529"></path><path d="M8 6C8.55228 6 9 6.44772 9 7C9 7.55228 8.55228 8 8 8C7.44772 8 7 7.55228 7 7C7 6.44772 7.44772 6 8 6Z" fill="#110529"></path><path d="M7 8.5C7 7.94772 6.55228 7.5 6 7.5C5.44772 7.5 5 7.94772 5 8.5C5 9.05228 5.44772 9.5 6 9.5C6.55228 9.5 7 9.05228 7 8.5Z" fill="#110529"></path><path d="M8 20.5C8 19.9477 7.55228 19.5 7 19.5C6.44772 19.5 6 19.9477 6 20.5C6 21.0523 6.44772 21.5 7 21.5C7.55228 21.5 8 21.0523 8 20.5Z" fill="#110529"></path><path d="M7 17C7 16.4477 6.55228 16 6 16C5.44772 16 5 16.4477 5 17C5 17.5523 5.44772 18 6 18C6.55228 18 7 17.5523 7 17Z" fill="#110529"></path><path d="M8 14C8.55228 14 9 14.4477 9 15C9 15.5523 8.55228 16 8 16C7.44772 16 7 15.5523 7 15C7 14.4477 7.44772 14 8 14Z" fill="#110529"></path><path d="M11 8.5C11 7.94772 10.5523 7.5 10 7.5C9.44772 7.5 9 7.94772 9 8.5C9 9.05228 9.44772 9.5 10 9.5C10.5523 9.5 11 9.05228 11 8.5Z" fill="#110529"></path><path d="M5 10C5.55228 10 6 10.4477 6 11C6 11.5523 5.55228 12 5 12C4.44772 12 4 11.5523 4 11C4 10.4477 4.44772 10 5 10Z" fill="#110529"></path><path d="M8 12.5C8 11.9477 7.55228 11.5 7 11.5C6.44772 11.5 6 11.9477 6 12.5C6 13.0523 6.44772 13.5 7 13.5C7.55228 13.5 8 13.0523 8 12.5Z" fill="#110529"></path><path d="M8 9C8.55228 9 9 9.44772 9 10C9 10.5523 8.55228 11 8 11C7.44772 11 7 10.5523 7 10C7 9.44772 7.44772 9 8 9Z" fill="#110529"></path>',24)]))}const Cre=mr(yre,[["render",bre]]),Sre={},xre={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Ere(e,t){return d.openBlock(),d.createElementBlock("svg",xre,t[0]||(t[0]=[d.createElementVNode("path",{d:"M5.25 6.225C5.25 5.2973 5.72673 4.83692 6.50349 4.27228C6.57903 4.21737 6.65984 4.16045 6.74435 4.10093C7.13565 3.82533 7.60622 3.49391 8 3.04693C8.39378 3.49391 8.86435 3.82533 9.25565 4.10093C9.34016 4.16045 9.42097 4.21737 9.49651 4.27228C10.2733 4.83692 10.75 5.2973 10.75 6.225C10.75 6.98245 10.4136 7.42894 9.96423 7.88766C9.91223 7.94075 9.85282 7.99937 9.78954 8.06181C9.60563 8.24327 9.38899 8.45703 9.22609 8.66134C8.98372 8.96531 8.75 9.37152 8.75 9.9C8.75 10.2529 8.89718 10.5561 9.04005 10.7795C9.1882 11.0112 9.38331 11.2356 9.5837 11.4445C9.81868 11.6895 10.1205 11.9716 10.424 12.2553C10.6132 12.4321 10.8031 12.6096 10.9779 12.779C11.4667 13.2531 11.9187 13.7374 12.2473 14.2398C12.5747 14.7403 12.75 15.214 12.75 15.675C12.75 16.8257 11.9675 17.5375 10.6808 18.4832C10.5917 18.5487 10.5001 18.6153 10.4066 18.6832C9.61093 19.2617 8.67831 19.9396 8 20.8746C7.32169 19.9396 6.38907 19.2617 5.59338 18.6832C5.49988 18.6153 5.40827 18.5487 5.31918 18.4832C4.03253 17.5375 3.25 16.8257 3.25 15.675C3.25 15.2151 3.42451 14.7479 3.75038 14.2556C4.07818 13.7604 4.52918 13.2845 5.01908 12.8148C5.17958 12.6609 5.35137 12.5014 5.52353 12.3416C5.84428 12.0438 6.16631 11.7448 6.419 11.4786C6.62115 11.2656 6.81744 11.0354 6.96613 10.7948C7.11184 10.559 7.25 10.2526 7.25 9.9C7.25 9.36255 7.02776 8.9483 6.77782 8.62937C6.60371 8.4072 6.37475 8.18497 6.18446 8.00027C6.12892 7.94636 6.07668 7.89566 6.03005 7.84908C5.58055 7.40004 5.25 6.97698 5.25 6.225Z",stroke:"#110529","stroke-width":"1.5"},null,-1),d.createElementVNode("path",{d:"M16.1603 11.6035C16.5892 12.0178 17.0904 12.5021 17.5 13.1017C17.9096 12.5021 18.4108 12.0178 18.8397 11.6035C18.8575 11.5863 18.8751 11.5692 18.8927 11.5522C19.7742 10.6998 20.25 10.1824 20.25 9.5C20.25 8.81759 19.7742 8.30021 18.8927 7.4478C18.8751 7.43083 18.8575 7.41374 18.8397 7.39653C18.4108 6.98221 17.9096 6.49792 17.5 5.89827C17.0904 6.49792 16.5892 6.98221 16.1603 7.39653C16.1425 7.41374 16.1249 7.43083 16.1073 7.4478C15.2258 8.30021 14.75 8.81759 14.75 9.5C14.75 10.1824 15.2258 10.6998 16.1073 11.5522C16.1249 11.5692 16.1425 11.5863 16.1603 11.6035Z",stroke:"#07AD3E","stroke-width":"1.5"},null,-1),d.createElementVNode("circle",{cx:"17.5",cy:"18",r:"0.5",stroke:"#07AD3E"},null,-1)]))}const Bre=mr(Sre,[["render",Ere]]),_re={},Tre={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function kre(e,t){return d.openBlock(),d.createElementBlock("svg",Tre,t[0]||(t[0]=[d.createElementVNode("path",{d:"M5.25 6.225C5.25 5.2973 5.72673 4.83692 6.50349 4.27228C6.57903 4.21737 6.65984 4.16045 6.74435 4.10093C7.13565 3.82533 7.60622 3.49391 8 3.04693C8.39378 3.49391 8.86435 3.82533 9.25565 4.10093C9.34016 4.16045 9.42097 4.21737 9.49651 4.27228C10.2733 4.83692 10.75 5.2973 10.75 6.225C10.75 6.98245 10.4136 7.42894 9.96423 7.88766C9.91223 7.94075 9.85282 7.99937 9.78954 8.06181C9.60563 8.24327 9.38899 8.45703 9.22609 8.66134C8.98372 8.96531 8.75 9.37152 8.75 9.9C8.75 10.2529 8.89718 10.5561 9.04005 10.7795C9.1882 11.0112 9.38331 11.2356 9.5837 11.4445C9.81868 11.6895 10.1205 11.9716 10.424 12.2553C10.6132 12.4321 10.8031 12.6096 10.9779 12.779C11.4667 13.2531 11.9187 13.7374 12.2473 14.2398C12.5747 14.7403 12.75 15.214 12.75 15.675C12.75 16.8257 11.9675 17.5375 10.6808 18.4832C10.5917 18.5487 10.5001 18.6153 10.4066 18.6832C9.61093 19.2617 8.67831 19.9396 8 20.8746C7.32169 19.9396 6.38907 19.2617 5.59338 18.6832C5.49988 18.6153 5.40826 18.5487 5.31918 18.4832C4.03253 17.5375 3.25 16.8257 3.25 15.675C3.25 15.2151 3.42451 14.7479 3.75038 14.2556C4.07818 13.7604 4.52918 13.2845 5.01908 12.8148C5.17958 12.6609 5.35137 12.5014 5.52353 12.3416C5.84428 12.0438 6.16631 11.7448 6.419 11.4786C6.62115 11.2656 6.81744 11.0354 6.96613 10.7948C7.11184 10.559 7.25 10.2526 7.25 9.9C7.25 9.36255 7.02776 8.9483 6.77782 8.62937C6.60371 8.4072 6.37475 8.18497 6.18446 8.00027C6.12892 7.94636 6.07668 7.89566 6.03005 7.84908C5.58055 7.40004 5.25 6.97698 5.25 6.225Z",stroke:"#110529","stroke-width":"1.5"},null,-1),d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14.25 7C14.25 5.75736 15.2574 4.75 16.5 4.75C17.7426 4.75 18.75 5.75736 18.75 7C18.75 7.08866 18.7449 7.17613 18.7349 7.26211C19.8671 7.37957 20.75 8.33668 20.75 9.5C20.75 10.6633 19.8671 11.6204 18.7349 11.7379C18.7449 11.8239 18.75 11.9113 18.75 12C18.75 13.2426 17.7426 14.25 16.5 14.25C15.2574 14.25 14.25 13.2426 14.25 12C14.25 11.9113 14.2551 11.8239 14.2651 11.7379C13.1329 11.6204 12.25 10.6633 12.25 9.5C12.25 8.33668 13.1329 7.37957 14.2651 7.26211C14.2551 7.17613 14.25 7.08866 14.25 7ZM16.5 6.25C16.0858 6.25 15.75 6.58579 15.75 7C15.75 7.41421 16.0858 7.75 16.5 7.75C16.9142 7.75 17.25 7.41421 17.25 7C17.25 6.58579 16.9142 6.25 16.5 6.25ZM13.75 9.5C13.75 9.08579 14.0858 8.75 14.5 8.75C14.9142 8.75 15.25 9.08579 15.25 9.5C15.25 9.91421 14.9142 10.25 14.5 10.25C14.0858 10.25 13.75 9.91421 13.75 9.5ZM18.5 8.75C18.0858 8.75 17.75 9.08579 17.75 9.5C17.75 9.91421 18.0858 10.25 18.5 10.25C18.9142 10.25 19.25 9.91421 19.25 9.5C19.25 9.08579 18.9142 8.75 18.5 8.75ZM14.25 18.5C14.25 17.2574 15.2574 16.25 16.5 16.25C17.7426 16.25 18.75 17.2574 18.75 18.5C18.75 19.7426 17.7426 20.75 16.5 20.75C15.2574 20.75 14.25 19.7426 14.25 18.5ZM16.5 17.75C16.0858 17.75 15.75 18.0858 15.75 18.5C15.75 18.9142 16.0858 19.25 16.5 19.25C16.9142 19.25 17.25 18.9142 17.25 18.5C17.25 18.0858 16.9142 17.75 16.5 17.75ZM15.75 12C15.75 11.5858 16.0858 11.25 16.5 11.25C16.9142 11.25 17.25 11.5858 17.25 12C17.25 12.4142 16.9142 12.75 16.5 12.75C16.0858 12.75 15.75 12.4142 15.75 12Z",fill:"#07AD3E"},null,-1)]))}const Mre=mr(_re,[["render",kre]]),Pre={},Hre={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Dre(e,t){return d.openBlock(),d.createElementBlock("svg",Hre,t[0]||(t[0]=[d.createElementVNode("path",{d:"M5.25 6.225C5.25 5.2973 5.72673 4.83692 6.50349 4.27228C6.57903 4.21737 6.65984 4.16045 6.74435 4.10093C7.13565 3.82533 7.60622 3.49391 8 3.04693C8.39378 3.49391 8.86435 3.82533 9.25565 4.10093C9.34016 4.16045 9.42097 4.21737 9.49651 4.27228C10.2733 4.83692 10.75 5.2973 10.75 6.225C10.75 6.98245 10.4136 7.42894 9.96423 7.88766C9.91223 7.94075 9.85282 7.99937 9.78954 8.06181C9.60563 8.24327 9.38899 8.45703 9.22609 8.66134C8.98372 8.96531 8.75 9.37152 8.75 9.9C8.75 10.2529 8.89718 10.5561 9.04005 10.7795C9.1882 11.0112 9.38331 11.2356 9.5837 11.4445C9.81868 11.6895 10.1205 11.9716 10.424 12.2553C10.6132 12.4321 10.8031 12.6096 10.9779 12.779C11.4667 13.2531 11.9187 13.7374 12.2473 14.2398C12.5747 14.7403 12.75 15.214 12.75 15.675C12.75 16.8257 11.9675 17.5375 10.6808 18.4832C10.5917 18.5487 10.5001 18.6153 10.4066 18.6832C9.61093 19.2617 8.67831 19.9396 8 20.8746C7.32169 19.9396 6.38907 19.2617 5.59338 18.6832C5.49988 18.6153 5.40827 18.5487 5.31918 18.4832C4.03253 17.5375 3.25 16.8257 3.25 15.675C3.25 15.2151 3.42451 14.7479 3.75038 14.2556C4.07818 13.7604 4.52918 13.2845 5.01908 12.8148C5.17958 12.6609 5.35137 12.5014 5.52353 12.3416C5.84428 12.0438 6.16631 11.7448 6.419 11.4786C6.62115 11.2656 6.81744 11.0354 6.96613 10.7948C7.11184 10.559 7.25 10.2526 7.25 9.9C7.25 9.36255 7.02776 8.9483 6.77782 8.62937C6.60371 8.4072 6.37475 8.18497 6.18446 8.00027C6.12892 7.94636 6.07668 7.89566 6.03005 7.84908C5.58055 7.40004 5.25 6.97698 5.25 6.225Z",stroke:"#110529","stroke-width":"1.5"},null,-1),d.createElementVNode("path",{d:"M16.1603 11.6035C16.5892 12.0178 17.0904 12.5021 17.5 13.1017C17.9096 12.5021 18.4108 12.0178 18.8397 11.6035C18.8575 11.5863 18.8751 11.5692 18.8927 11.5522C19.7742 10.6998 20.25 10.1824 20.25 9.5C20.25 8.81759 19.7742 8.30021 18.8927 7.4478C18.8751 7.43083 18.8575 7.41374 18.8397 7.39653C18.4108 6.98221 17.9096 6.49792 17.5 5.89827C17.0904 6.49792 16.5892 6.98221 16.1603 7.39653C16.1425 7.41374 16.1249 7.43083 16.1073 7.4478C15.2258 8.30021 14.75 8.81759 14.75 9.5C14.75 10.1824 15.2258 10.6998 16.1073 11.5522C16.1249 11.5692 16.1425 11.5863 16.1603 11.6035Z",stroke:"#07AD3E","stroke-width":"1.5"},null,-1),d.createElementVNode("circle",{cx:"17.5",cy:"18",r:"0.5",stroke:"#07AD3E"},null,-1)]))}const $re=mr(Pre,[["render",Dre]]),Ire={},Lre={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Rre(e,t){return d.openBlock(),d.createElementBlock("svg",Lre,t[0]||(t[0]=[d.createStaticVNode('<path d="M3 21.25L21 21.25" stroke="#110529" stroke-width="1.5" stroke-linecap="square"></path><path d="M3 4L3 2.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 7L3 5.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 10L3 8.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 13L3 11.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 16L3 14.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 19L3 17.5" stroke="#110529" stroke-width="1.5"></path><path d="M7 19L7 10" stroke="#07AD3E" stroke-width="1.5"></path><path d="M11 19L11 14" stroke="#110529" stroke-width="1.5"></path><path d="M15 19L15 3" stroke="#07AD3E" stroke-width="1.5"></path><path d="M19 19L19 7" stroke="#110529" stroke-width="1.5"></path>',11)]))}const gI=mr(Ire,[["render",Rre]]),Vre={},Nre={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function zre(e,t){return d.openBlock(),d.createElementBlock("svg",Nre,t[0]||(t[0]=[d.createStaticVNode('<path d="M3 21.25L21 21.25" stroke="#110529" stroke-width="1.5" stroke-linecap="square"></path><path d="M3 4L3 2.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 7L3 5.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 10L3 8.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 13L3 11.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 16L3 14.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 19L3 17.5" stroke="#110529" stroke-width="1.5"></path><path d="M5.49982 10.5L10.5037 5.49615C10.7829 5.21695 11.2307 5.20204 11.5279 5.46205L14.4718 8.03795C14.7689 8.29796 15.2168 8.28305 15.496 8.00385L20.4998 3" stroke="#07AD3E" stroke-width="1.5"></path><path d="M7 14V19" stroke="#110529" stroke-width="1.5"></path><path d="M11 10L11 19" stroke="#110529" stroke-width="1.5"></path><path d="M15 12V19" stroke="#110529" stroke-width="1.5"></path><path d="M19 9L19 19" stroke="#110529" stroke-width="1.5"></path>',12)]))}const yI=mr(Vre,[["render",zre]]),Ore={},Fre={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Qre(e,t){return d.openBlock(),d.createElementBlock("svg",Fre,t[0]||(t[0]=[d.createStaticVNode('<path d="M3 21.25L21 21.25" stroke="#110529" stroke-width="1.5" stroke-linecap="square"></path><path d="M3 4L3 2.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 7L3 5.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 10L3 8.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 13L3 11.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 16L3 14.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 19L3 17.5" stroke="#110529" stroke-width="1.5"></path><path d="M11.25 11V13V16V18C11.25 18.1381 11.1381 18.25 11 18.25H9H7C6.86193 18.25 6.75 18.1381 6.75 18V16V13V11C6.75 10.8619 6.86193 10.75 7 10.75H9H11C11.1381 10.75 11.25 10.8619 11.25 11Z" stroke="#07AD3E" stroke-width="1.5" stroke-linecap="round"></path><path d="M9.75 8V7.25H8.25V8H9.75ZM9.75 14V8H8.25V14H9.75Z" fill="#07AD3E"></path><path d="M19.25 6V9.66667V14.3333V18C19.25 18.1381 19.1381 18.25 19 18.25H17H15C14.8619 18.25 14.75 18.1381 14.75 18V14.3333V9.66667V6C14.75 5.86193 14.8619 5.75 15 5.75H17H19C19.1381 5.75 19.25 5.86193 19.25 6Z" stroke="#110529" stroke-width="1.5" stroke-linecap="round"></path><path d="M17 9V3" stroke="#110529" stroke-width="1.5" stroke-linecap="square"></path>',11)]))}const jre=mr(Ore,[["render",Qre]]),Ure={},Gre={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Yre(e,t){return d.openBlock(),d.createElementBlock("svg",Gre,t[0]||(t[0]=[d.createStaticVNode('<path d="M3 21.25L21 21.25" stroke="#110529" stroke-width="1.5" stroke-linecap="square"></path><path d="M3 4L3 2.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 7L3 5.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 10L3 8.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 13L3 11.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 16L3 14.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 19L3 17.5" stroke="#110529" stroke-width="1.5"></path><path d="M11 19L11 14" stroke="#110529" stroke-width="1.5"></path><path d="M11 13L11 9" stroke="#07AD3E" stroke-width="1.5"></path><path d="M15 19L15 7" stroke="#110529" stroke-width="1.5"></path><path d="M7 19L7 11" stroke="#110529" stroke-width="1.5"></path><path d="M19 19L19 11" stroke="#110529" stroke-width="1.5"></path><path d="M15 6L15 3" stroke="#07AD3E" stroke-width="1.5"></path><path d="M7 10L7 7" stroke="#07AD3E" stroke-width="1.5"></path><path d="M19 10L19 6" stroke="#07AD3E" stroke-width="1.5"></path>',15)]))}const Wre=mr(Ure,[["render",Yre]]),Xre={},Kre={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Zre(e,t){return d.openBlock(),d.createElementBlock("svg",Kre,t[0]||(t[0]=[d.createStaticVNode('<path d="M3 21.25L21 21.25" stroke="#110529" stroke-width="1.5" stroke-linecap="square"></path><path d="M3 4L3 2.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 7L3 5.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 10L3 8.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 13L3 11.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 16L3 14.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 19L3 17.5" stroke="#110529" stroke-width="1.5"></path><path d="M6 17L10.3949 10.1634C10.4567 10.0673 10.5759 10.0253 10.6843 10.0614L16.3157 11.9386C16.4241 11.9747 16.5433 11.9327 16.6051 11.8366L21 5" stroke="#07AD3E" stroke-width="1.5"></path>',8)]))}const wI=mr(Xre,[["render",Zre]]),Jre={},qre={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function eae(e,t){return d.openBlock(),d.createElementBlock("svg",qre,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7.87166 17.4862C6.72148 18.5589 5.21191 19.25 3 19.25H2.25V20.75H3C5.01 20.75 6.5821 20.2481 7.84779 19.4106C7.78374 19.1173 7.75 18.8126 7.75 18.5C7.75 18.1506 7.79216 17.8111 7.87166 17.4862ZM16.5833 6.12522C17.6721 5.27714 19.0682 4.75 21 4.75H21.75V3.25H21C18.7445 3.25 17.0404 3.882 15.702 4.91089C15.8578 5.18652 15.9838 5.48129 16.0755 5.79079C16.253 5.8903 16.4227 6.00217 16.5833 6.12522ZM3.75 5.5L3.75 4H2.25L2.25 5.5H3.75ZM3.75 8.5V7H2.25L2.25 8.5H3.75ZM3.75 10L3.75 11.5H2.25L2.25 10H3.75ZM3.75 14.5V13H2.25V14.5H3.75ZM3.75 16L3.75 17.5H2.25V16H3.75ZM20.25 6.5V8L21.75 8V6.5H20.25ZM20.25 11V9.5H21.75V11H20.25ZM20.25 12.5V14H21.75V12.5H20.25ZM20.25 17V15.5H21.75V17H20.25ZM20.25 20V18.5H21.75V20H20.25Z",fill:"#110529"},null,-1),d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9.75 7C9.75 5.75736 10.7574 4.75 12 4.75C13.2426 4.75 14.25 5.75736 14.25 7C14.25 7.08866 14.2449 7.17613 14.2349 7.26211C15.3671 7.37957 16.25 8.33668 16.25 9.5C16.25 10.6633 15.3671 11.6204 14.2349 11.7379C14.2449 11.8239 14.25 11.9113 14.25 12C14.25 13.2426 13.2426 14.25 12 14.25C10.7574 14.25 9.75 13.2426 9.75 12C9.75 11.9113 9.75513 11.8239 9.7651 11.7379C8.63285 11.6204 7.75 10.6633 7.75 9.5C7.75 8.33668 8.63285 7.37957 9.7651 7.26211C9.75513 7.17613 9.75 7.08866 9.75 7ZM12 6.25C11.5858 6.25 11.25 6.58579 11.25 7C11.25 7.41421 11.5858 7.75 12 7.75C12.4142 7.75 12.75 7.41421 12.75 7C12.75 6.58579 12.4142 6.25 12 6.25ZM9.25 9.5C9.25 9.08579 9.58579 8.75 10 8.75C10.4142 8.75 10.75 9.08579 10.75 9.5C10.75 9.91421 10.4142 10.25 10 10.25C9.58579 10.25 9.25 9.91421 9.25 9.5ZM14 8.75C13.5858 8.75 13.25 9.08579 13.25 9.5C13.25 9.91421 13.5858 10.25 14 10.25C14.4142 10.25 14.75 9.91421 14.75 9.5C14.75 9.08579 14.4142 8.75 14 8.75ZM9.75 18.5C9.75 17.2574 10.7574 16.25 12 16.25C13.2426 16.25 14.25 17.2574 14.25 18.5C14.25 19.7426 13.2426 20.75 12 20.75C10.7574 20.75 9.75 19.7426 9.75 18.5ZM12 17.75C11.5858 17.75 11.25 18.0858 11.25 18.5C11.25 18.9142 11.5858 19.25 12 19.25C12.4142 19.25 12.75 18.9142 12.75 18.5C12.75 18.0858 12.4142 17.75 12 17.75ZM11.25 12C11.25 11.5858 11.5858 11.25 12 11.25C12.4142 11.25 12.75 11.5858 12.75 12C12.75 12.4142 12.4142 12.75 12 12.75C11.5858 12.75 11.25 12.4142 11.25 12Z",fill:"#07AD3E"},null,-1)]))}const tae=mr(Jre,[["render",eae]]),nae={},rae={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function aae(e,t){return d.openBlock(),d.createElementBlock("svg",rae,t[0]||(t[0]=[d.createStaticVNode('<path fill-rule="evenodd" clip-rule="evenodd" d="M6.66173 18.3797C5.69642 18.9269 4.51239 19.25 3 19.25H2.25V20.75H3C5.08009 20.75 6.69121 20.2125 7.97909 19.3218C7.45744 19.133 7.00308 18.8038 6.66173 18.3797ZM15.6198 7.03708C15.6306 7.02483 15.6415 7.01261 15.6524 7.00044C16.858 5.65468 18.4693 4.75 21 4.75H21.75V3.25H21C18.0608 3.25 16.0579 4.32325 14.5803 5.94949C15.0122 6.21765 15.3709 6.59244 15.6198 7.03708ZM3.75 5.5L3.75 4H2.25L2.25 5.5H3.75ZM3.75 8.5V7H2.25L2.25 8.5H3.75ZM3.75 10L3.75 11.5H2.25L2.25 10H3.75ZM3.75 14.5V13H2.25V14.5H3.75ZM3.75 16L3.75 17.5H2.25V16H3.75ZM20.25 6.5V8L21.75 8V6.5H20.25ZM20.25 11V9.5H21.75V11H20.25ZM20.25 12.5V14H21.75V12.5H20.25ZM20.25 17V15.5H21.75V17H20.25ZM20.25 20V18.5H21.75V20H20.25Z" fill="#110529"></path><path d="M13 3C13 3.55228 12.5523 4 12 4C11.4477 4 11 3.55228 11 3C11 2.44772 11.4477 2 12 2C12.5523 2 13 2.44772 13 3Z" fill="#07AD3E"></path><path d="M12 15C12 15.5523 11.5523 16 11 16C10.4477 16 10 15.5523 10 15C10 14.4477 10.4477 14 11 14C11.5523 14 12 14.4477 12 15Z" fill="#07AD3E"></path><path d="M13 17.5C13.5523 17.5 14 17.0523 14 16.5C14 15.9477 13.5523 15.5 13 15.5C12.4477 15.5 12 15.9477 12 16.5C12 17.0523 12.4477 17.5 13 17.5Z" fill="#07AD3E"></path><path d="M12 6.5C12 7.05228 11.5523 7.5 11 7.5C10.4477 7.5 10 7.05228 10 6.5C10 5.94772 10.4477 5.5 11 5.5C11.5523 5.5 12 5.94772 12 6.5Z" fill="#07AD3E"></path><path d="M13 9.5C13.5523 9.5 14 9.05228 14 8.5C14 7.94772 13.5523 7.5 13 7.5C12.4477 7.5 12 7.94772 12 8.5C12 9.05228 12.4477 9.5 13 9.5Z" fill="#07AD3E"></path><path d="M16 15C16 15.5523 15.5523 16 15 16C14.4477 16 14 15.5523 14 15C14 14.4477 14.4477 14 15 14C15.5523 14 16 14.4477 16 15Z" fill="#07AD3E"></path><path d="M10 13.5C10.5523 13.5 11 13.0523 11 12.5C11 11.9477 10.5523 11.5 10 11.5C9.44772 11.5 9 11.9477 9 12.5C9 13.0523 9.44772 13.5 10 13.5Z" fill="#07AD3E"></path><path d="M10 16.5C10 17.0523 9.55228 17.5 9 17.5C8.44772 17.5 8 17.0523 8 16.5C8 15.9477 8.44772 15.5 9 15.5C9.55228 15.5 10 15.9477 10 16.5Z" fill="#07AD3E"></path><path d="M11 19C11.5523 19 12 18.5523 12 18C12 17.4477 11.5523 17 11 17C10.4477 17 10 17.4477 10 18C10 18.5523 10.4477 19 11 19Z" fill="#07AD3E"></path><path d="M13 11C13 11.5523 12.5523 12 12 12C11.4477 12 11 11.5523 11 11C11 10.4477 11.4477 10 12 10C12.5523 10 13 10.4477 13 11Z" fill="#07AD3E"></path><path d="M13 14.5C13.5523 14.5 14 14.0523 14 13.5C14 12.9477 13.5523 12.5 13 12.5C12.4477 12.5 12 12.9477 12 13.5C12 14.0523 12.4477 14.5 13 14.5Z" fill="#07AD3E"></path><path d="M13 20.5C13 21.0523 12.5523 21.5 12 21.5C11.4477 21.5 11 21.0523 11 20.5C11 19.9477 11.4477 19.5 12 19.5C12.5523 19.5 13 19.9477 13 20.5Z" fill="#07AD3E"></path>',13)]))}const bI=mr(nae,[["render",aae]]),iae={},oae={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function lae(e,t){return d.openBlock(),d.createElementBlock("svg",oae,t[0]||(t[0]=[d.createElementVNode("path",{d:"M5 16.5C13.5556 16.5 10.4444 7.5 19 7.5",stroke:"#07AD3E","stroke-width":"1.5"},null,-1),d.createElementVNode("path",{d:"M5 21.25V16.5V11.75M5 21.25H8M5 21.25H2M5 11.75H8M5 11.75H2M5 9.5V8M5 6.5V5M5 3.5V2",stroke:"#110529","stroke-width":"1.5"},null,-1),d.createElementVNode("path",{d:"M5 21.25V16.5V11.75M5 21.25H8M5 21.25H2M5 11.75H8M5 11.75H2M5 9.5V8M5 6.5V5M5 3.5V2",stroke:"#110529","stroke-width":"1.5"},null,-1),d.createElementVNode("path",{d:"M19 2.75V7.5V12.25M19 2.75H16M19 2.75H22M19 12.25H16M19 12.25H22M19 14.5V16M19 17.5V19M19 20.5V22",stroke:"#110529","stroke-width":"1.5"},null,-1)]))}const sae=mr(iae,[["render",lae]]),uae={},cae={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function fae(e,t){return d.openBlock(),d.createElementBlock("svg",cae,t[0]||(t[0]=[d.createStaticVNode('<path d="M18 4.5C18 3.94772 17.5523 3.5 17 3.5C16.4477 3.5 16 3.94772 16 4.5C16 5.05228 16.4477 5.5 17 5.5C17.5523 5.5 18 5.05228 18 4.5Z" fill="#07AD3E"></path><path d="M17 18.5C17.5523 18.5 18 18.9477 18 19.5C18 20.0523 17.5523 20.5 17 20.5C16.4477 20.5 16 20.0523 16 19.5C16 18.9477 16.4477 18.5 17 18.5Z" fill="#07AD3E"></path><path d="M16 16.5C16.5523 16.5 17 16.9477 17 17.5C17 18.0523 16.5523 18.5 16 18.5C15.4477 18.5 15 18.0523 15 17.5C15 16.9477 15.4477 16.5 16 16.5Z" fill="#07AD3E"></path><path d="M17 17.5C17 16.9477 17.4477 16.5 18 16.5C18.5523 16.5 19 16.9477 19 17.5C19 18.0523 18.5523 18.5 18 18.5C17.4477 18.5 17 18.0523 17 17.5Z" fill="#07AD3E"></path><path d="M17 14.5C17.5523 14.5 18 14.9477 18 15.5C18 16.0523 17.5523 16.5 17 16.5C16.4477 16.5 16 16.0523 16 15.5C16 14.9477 16.4477 14.5 17 14.5Z" fill="#07AD3E"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M16 7C16.5523 7 17 7.44772 17 8C17 8.55228 16.5523 9 16 9C15.4477 9 15 8.55228 15 8C15 7.44772 15.4477 7 16 7ZM17 10C17 9.44772 16.5523 9 16 9C15.4477 9 15 9.44772 15 10C15 9.44772 14.5523 9 14 9C13.4477 9 13 9.44772 13 10C13 10.5523 13.4477 11 14 11C14.5523 11 15 10.5523 15 10C15 10.5523 15.4477 11 16 11C15.4477 11 15 11.4477 15 12C15 12.5523 15.4477 13 16 13C16.5523 13 17 12.5523 17 12C17 12.5523 17.4477 13 18 13C18.5523 13 19 12.5523 19 12C19 11.4477 18.5523 11 18 11C18.5523 11 19 10.5523 19 10C19 10.5523 19.4477 11 20 11C20.5523 11 21 10.5523 21 10C21 9.44772 20.5523 9 20 9C19.4477 9 19 9.44772 19 10C19 9.44772 18.5523 9 18 9C18.5523 9 19 8.55228 19 8C19 7.44772 18.5523 7 18 7C17.4477 7 17 7.44772 17 8C17 8.55228 17.4477 9 18 9C17.4477 9 17 9.44772 17 10ZM17 10C17 10.5523 17.4477 11 18 11C17.4477 11 17 11.4477 17 12C17 11.4477 16.5523 11 16 11C16.5523 11 17 10.5523 17 10Z" fill="#07AD3E"></path><path d="M7 5.5C7.55228 5.5 8 5.05228 8 4.5C8 3.94772 7.55228 3.5 7 3.5C6.44772 3.5 6 3.94772 6 4.5C6 5.05228 6.44772 5.5 7 5.5Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8 15C8.55228 15 9 14.5523 9 14C9 14.5523 9.44772 15 10 15C10.5523 15 11 14.5523 11 14C11 13.4477 10.5523 13 10 13C9.44772 13 9 13.4477 9 14C9 13.4477 8.55228 13 8 13C8.55228 13 9 12.5523 9 12C9 11.4477 8.55228 11 8 11C7.44772 11 7 11.4477 7 12C7 11.4477 6.55228 11 6 11C5.44772 11 5 11.4477 5 12C5 12.5523 5.44772 13 6 13C5.44772 13 5 13.4477 5 14C5 13.4477 4.55228 13 4 13C3.44772 13 3 13.4477 3 14C3 14.5523 3.44772 15 4 15C4.55228 15 5 14.5523 5 14C5 14.5523 5.44772 15 6 15C5.44772 15 5 15.4477 5 16C5 16.5523 5.44772 17 6 17C6.55228 17 7 16.5523 7 16C7 16.5523 7.44772 17 8 17C8.55228 17 9 16.5523 9 16C9 15.4477 8.55228 15 8 15ZM8 15C7.44772 15 7 15.4477 7 16C7 15.4477 6.55228 15 6 15C6.55228 15 7 14.5523 7 14C7 14.5523 7.44772 15 8 15ZM7 14C7 13.4477 6.55228 13 6 13C6.55228 13 7 12.5523 7 12C7 12.5523 7.44772 13 8 13C7.44772 13 7 13.4477 7 14Z" fill="#110529"></path><path d="M6 7.5C6.55228 7.5 7 7.05228 7 6.5C7 7.05228 7.44772 7.5 8 7.5C8.55228 7.5 9 7.05228 9 6.5C9 5.94772 8.55228 5.5 8 5.5C7.44772 5.5 7 5.94772 7 6.5C7 5.94772 6.55228 5.5 6 5.5C5.44772 5.5 5 5.94772 5 6.5C5 7.05228 5.44772 7.5 6 7.5Z" fill="#110529"></path><path d="M7 9.5C7.55228 9.5 8 9.05228 8 8.5C8 7.94772 7.55228 7.5 7 7.5C6.44772 7.5 6 7.94772 6 8.5C6 9.05228 6.44772 9.5 7 9.5Z" fill="#110529"></path><path d="M8 19.5C8 20.0523 7.55228 20.5 7 20.5C6.44772 20.5 6 20.0523 6 19.5C6 18.9477 6.44772 18.5 7 18.5C7.55228 18.5 8 18.9477 8 19.5Z" fill="#110529"></path>',11)]))}const dae=mr(uae,[["render",fae]]),Aae={},hae={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function pae(e,t){return d.openBlock(),d.createElementBlock("svg",hae,t[0]||(t[0]=[d.createStaticVNode('<path d="M3 21.25L21 21.25" stroke="#110529" stroke-width="1.5" stroke-linecap="square"></path><path d="M3 4L3 2.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 7L3 5.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 10L3 8.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 13L3 11.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 16L3 14.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 19L3 17.5" stroke="#110529" stroke-width="1.5"></path><path d="M20 5C20 5.55228 19.5523 6 19 6C18.4477 6 18 5.55228 18 5C18 4.44772 18.4477 4 19 4C19.5523 4 20 4.44772 20 5Z" fill="#07AD3E"></path><path d="M8 9C8.55228 9 9 8.55228 9 8C9 7.44772 8.55228 7 8 7C7.44772 7 7 7.44772 7 8C7 8.55228 7.44772 9 8 9Z" fill="#07AD3E"></path><path d="M16 17C16.5523 17 17 16.5523 17 16C17 15.4477 16.5523 15 16 15C15.4477 15 15 15.4477 15 16C15 16.5523 15.4477 17 16 17Z" fill="#07AD3E"></path><path d="M13 6C13.5523 6 14 5.55228 14 5C14 4.44772 13.5523 4 13 4C12.4477 4 12 4.44772 12 5C12 5.55228 12.4477 6 13 6Z" fill="#110529"></path><path d="M16 9C16.5523 9 17 8.55228 17 8C17 7.44772 16.5523 7 16 7C15.4477 7 15 7.44772 15 8C15 8.55228 15.4477 9 16 9Z" fill="#110529"></path><path d="M8 17C8.55228 17 9 16.5523 9 16C9 15.4477 8.55228 15 8 15C7.44772 15 7 15.4477 7 16C7 16.5523 7.44772 17 8 17Z" fill="#110529"></path><path d="M20 11C20 11.5523 19.5523 12 19 12C18.4477 12 18 11.5523 18 11C18 10.4477 18.4477 10 19 10C19.5523 10 20 10.4477 20 11Z" fill="#110529"></path><path d="M15 12C15.5523 12 16 11.5523 16 11C16 10.4477 15.5523 10 15 10C14.4477 10 14 10.4477 14 11C14 11.5523 14.4477 12 15 12Z" fill="#110529"></path><path d="M10 13C10 13.5523 9.55228 14 9 14C8.44772 14 8 13.5523 8 13C8 12.4477 8.44772 12 9 12C9.55228 12 10 12.4477 10 13Z" fill="#110529"></path><path d="M11 16C11.5523 16 12 15.5523 12 15C12 14.4477 11.5523 14 11 14C10.4477 14 10 14.4477 10 15C10 15.5523 10.4477 16 11 16Z" fill="#110529"></path><path d="M14 9C14 9.55228 13.5523 10 13 10C12.4477 10 12 9.55228 12 9C12 8.44772 12.4477 8 13 8C13.5523 8 14 8.44772 14 9Z" fill="#110529"></path><path d="M13 12C13 12.5523 12.5523 13 12 13C11.4477 13 11 12.5523 11 12C11 11.4477 11.4477 11 12 11C12.5523 11 13 11.4477 13 12Z" fill="#110529"></path>',19)]))}const vae=mr(Aae,[["render",pae]]),mae={},gae={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function yae(e,t){return d.openBlock(),d.createElementBlock("svg",gae,t[0]||(t[0]=[d.createStaticVNode('<path d="M10 20.5C10 20.7761 10.2239 21 10.5 21H13.5C13.7761 21 14 20.7761 14 20.5V19.3333V18.3333V18V17.5C14 17.2239 13.7761 17 13.5 17H10.5C10.2239 17 10 17.2239 10 17.5V18V18.3333V19.3333V20.5Z" stroke="#07AD3E" stroke-width="1.5"></path><path d="M10 13.5C10 13.7761 10.2239 14 10.5 14H13.5C13.7761 14 14 13.7761 14 13.5V12.3333V11.3333V11V10.5C14 10.2239 13.7761 10 13.5 10H10.5C10.2239 10 10 10.2239 10 10.5V11V11.3333V12.3333V13.5Z" stroke="#110529" stroke-width="1.5"></path><path d="M17 13.5C17 13.7761 17.2239 14 17.5 14H20.5C20.7761 14 21 13.7761 21 13.5V12.3333V11.3333V11V10.5C21 10.2239 20.7761 10 20.5 10H17.5C17.2239 10 17 10.2239 17 10.5V11V11.3333V12.3333V13.5Z" stroke="#110529" stroke-width="1.5"></path><path d="M17 20.5C17 20.7761 17.2239 21 17.5 21H20.5C20.7761 21 21 20.7761 21 20.5V19.3333V18.3333V18V17.5C21 17.2239 20.7761 17 20.5 17H17.5C17.2239 17 17 17.2239 17 17.5V18V18.3333V19.3333V20.5Z" stroke="#110529" stroke-width="1.5"></path><path d="M10 6.5C10 6.77614 10.2239 7 10.5 7H13.5C13.7761 7 14 6.77614 14 6.5V5.33333V4.33333V4V3.5C14 3.22386 13.7761 3 13.5 3H10.5C10.2239 3 10 3.22386 10 3.5V4V4.33333V5.33333V6.5Z" stroke="#110529" stroke-width="1.5"></path><path d="M3 20.5C3 20.7761 3.22386 21 3.5 21H6.5C6.77614 21 7 20.7761 7 20.5V19.3333V18.3333V18V17.5C7 17.2239 6.77614 17 6.5 17H3.5C3.22386 17 3 17.2239 3 17.5V18V18.3333V19.3333V20.5Z" stroke="#110529" stroke-width="1.5"></path><path d="M3 13.5C3 13.7761 3.22386 14 3.5 14H6.5C6.77614 14 7 13.7761 7 13.5V12.3333V11.3333V11V10.5C7 10.2239 6.77614 10 6.5 10H3.5C3.22386 10 3 10.2239 3 10.5V11V11.3333V12.3333V13.5Z" stroke="#07AD3E" stroke-width="1.5"></path><path d="M17 6.5C17 6.77614 17.2239 7 17.5 7H20.5C20.7761 7 21 6.77614 21 6.5V5.33333V4.33333V4V3.5C21 3.22386 20.7761 3 20.5 3H17.5C17.2239 3 17 3.22386 17 3.5V4V4.33333V5.33333V6.5Z" stroke="#07AD3E" stroke-width="1.5"></path><path d="M3 6.5C3 6.77614 3.22386 7 3.5 7H6.5C6.77614 7 7 6.77614 7 6.5V5.33333V4.33333V4V3.5C7 3.22386 6.77614 3 6.5 3H3.5C3.22386 3 3 3.22386 3 3.5V4V4.33333V5.33333V6.5Z" stroke="#110529" stroke-width="1.5"></path>',9)]))}const CI=mr(mae,[["render",yae]]),wae={},bae={class:"inline-icon",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function Cae(e,t){return d.openBlock(),d.createElementBlock("svg",bae,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.25 20.5H21.75V22H2.25V20.5Z",fill:"#110529"},null,-1),d.createElementVNode("path",{d:"M8.91649 19H7.25L10.2842 10H12.2116L15.25 19H13.5835L11.2816 11.8457H11.2142L8.91649 19ZM8.9712 15.4712H13.5162V16.7808H8.9712V15.4712Z",fill:"#07AD3E"},null,-1),d.createElementVNode("path",{d:"M20.4799 8.18631C20.4158 7.77567 20.3273 7.40811 20.2144 7.08365C20.1041 6.75412 19.9707 6.47275 19.8142 6.23954C19.6603 6.00634 19.4832 5.83143 19.2831 5.71483C19.083 5.59316 18.8649 5.53232 18.6289 5.53232C18.2056 5.53232 17.8285 5.74271 17.4975 6.1635C17.1666 6.58428 16.9062 7.20279 16.7163 8.01901C16.529 8.83016 16.4354 9.81876 16.4354 10.9848C16.4354 12.161 16.529 13.1572 16.7163 13.9734C16.9036 14.7896 17.164 15.4106 17.4975 15.8365C17.831 16.2573 18.2184 16.4677 18.6597 16.4677C19.0599 16.4677 19.4063 16.3156 19.6987 16.0114C19.9938 15.7072 20.2208 15.2763 20.3799 14.7186C20.5389 14.1559 20.6185 13.4968 20.6185 12.7414H20.618H18.8021V10.635H22V12.5057C22 13.839 21.8563 14.9924 21.569 15.9658C21.2817 16.9392 20.8866 17.6895 20.3837 18.2167C19.8809 18.7389 19.3036 19 18.652 19C17.926 19 17.2884 18.6781 16.7394 18.0342C16.193 17.3853 15.7658 16.4651 15.4579 15.2738C15.1526 14.0773 15 12.6578 15 11.0152C15 9.75792 15.0898 8.63498 15.2694 7.64639C15.4515 6.6578 15.7055 5.81876 16.0313 5.12928C16.3572 4.43473 16.7394 3.90748 17.1781 3.54753C17.6168 3.18251 18.094 3 18.6097 3C19.0458 3 19.4524 3.12674 19.8296 3.38023C20.2067 3.62864 20.5415 3.98352 20.834 4.44487C21.129 4.90621 21.3714 5.45374 21.5613 6.08745C21.7511 6.72117 21.8756 7.42079 21.9346 8.18631H20.4799Z",fill:"#110529"},null,-1),d.createElementVNode("path",{d:"M2 7V5H9L9 7H6.25V19H4.75V7H2Z",fill:"#110529"},null,-1)]))}const Sae=mr(wae,[["render",Cae]]),zg=[{name:"Light green",color:"#99E099"},{name:"Green",color:"#42B842"},{name:"Dark green",color:"#198020"},{name:"Light violet",color:"#C1ADFF"},{name:"Violet",color:"#845CFF"},{name:"Dark violet",color:"#5F31CC"},{name:"Light orange",color:"#FFCB8F"},{name:"Orange",color:"#FF9429"},{name:"Dark orange",color:"#C26A27"},{name:"Light teal",color:"#90E0E0"},{name:"Teal",color:"#27C2C2"},{name:"Dark teal",color:"#068A94"},{name:"Light rose",color:"#FAAAFA"},{name:"Rose",color:"#E553E5"},{name:"Dark rose",color:"#A324B2"},{name:"Light lime",color:"#CBEB67"},{name:"Lime",color:"#95C700"},{name:"Dark lime",color:"#659406"},{name:"Light blue",color:"#99CCFF"},{name:"Blue",color:"#2D93FA"},{name:"Dark blue",color:"#105BCC"},{name:"Light red",color:"#FFADBA"},{name:"Red",color:"#F05670"},{name:"Dark red",color:"#AD3757"},{name:"Light grey",color:"#D3D7E0"},{name:"Grey",color:"#929BAD"},{name:"Dark grey",color:"#5E5E70"},{name:"Black",color:"#110529"},{name:"White",color:"#FFFFFF"},{name:"None",color:"transparent"}],iv="#FFFFFF",pi="#110529";zg.reduce((e,t)=>(e[t.color]=t,e),{});const Y4=zg.slice(0,-3).map(e=>e.color),xae=Y4.filter((e,t)=>t%3===0),Eae=Y4.filter((e,t)=>t%3===1),Bae=Y4.filter((e,t)=>t%3===2),_ae=Y4.filter((e,t)=>t%3!==2),Tae=Y4,kae=["#FFF680","#53D788","#36739D","#4A005C"],Mae=["#FFF680","#F77E5B","#902B83","#2B125C"],Pae=["#DFFADC","#74CFD1","#635AC1","#611347"],Hae=["#FAFAB4","#8DDA7F","#337E90","#1C0F5C"],Dae=["#FFEA80","#F07A76","#7535A4","#003752"],$ae=["#FFF780","#6CEA90","#6C90F0","#942AAE"],Iae=["#43317B","#7ACFAC","#F5F5B7","#F07B75","#5C1243"],Lae=["#122B5C","#41B5A8","#F0F0F0","#F07C80","#5C1243"],Rae=["#0E0E8F","#7E93FB","#F0F0F0","#ED7883","#5C1243"],Vae=["#2E5C00","#9ED26A","#F0F0F0","#EB8BDB","#701260"],Nae=["#4A005C","#36749D","#56D688","#FFF680","#F77E5E","#902B82","#2B125C"],SI=["light","bright","dark","paired","triadic"],zae=["viridis","magma","density","salinity","sunset","perceptual_rainbow"],Oae=["spectrum","teal_red","blue_red","lime_rose","viridis_magma"];function uE(e){return SI.includes(e)}const Ui={...{light:{title:"Light",colors:xae},bright:{title:"Bright",colors:Eae},dark:{title:"Dark",colors:Bae},paired:{title:"Paired",colors:_ae},triadic:{title:"Triadic",colors:Tae}},...{viridis:{title:"Viridis",colors:kae},magma:{title:"Magma",colors:Mae},density:{title:"Density",colors:Pae},salinity:{title:"Salinity",colors:Hae},sunset:{title:"Sunset",colors:Dae},perceptual_rainbow:{title:"Rainbow",colors:$ae}},...{spectrum:{title:"Spectrum",colors:Iae},teal_red:{title:"Teal-Red",colors:Lae},blue_red:{title:"Blue-Red",colors:Rae},lime_rose:{title:"Lime-Rose",colors:Vae},viridis_magma:{title:"Vir-Mag",colors:Nae}}},xI="light",ov="salinity",Fae="salinity",W4=["0","5","1","2","6","7","9","3","4","8","12","10","13","14","11","22","23","21","24","25"],ww="#F0F0F0",DA="21",Og=["solid","dashed","dotted","dotdash","longdash","twodash"],bw="solid",Qae={solid:{title:"Solid"},dashed:{title:"Dashed"},dotted:{title:"Dotted"},dotdash:{title:"Dotdash"},longdash:{title:"Longdash"},twodash:{title:"Twodash"}},jae={A:"#cc0100",C:"#0000cc",G:"#ffb300",T:"#027f00",U:"#027f00"},Uae={A:"#7fa0f0",R:"#ef1405",N:"#01ff00",D:"#c048bf",C:"#ef8080",Q:"#01ff00",E:"#c048bf",G:"#f09047",H:"#14a4a4",I:"#7fa0f0",L:"#7fa0f0",K:"#ef1405",M:"#7fa0f0",F:"#7fa0f0",P:"#ffff00",S:"#01ff00",T:"#01ff00",W:"#7fa0f0",Y:"#14a4a4",V:"#7fa0f0",B:"#eeeeee",X:"#eeeeee",Z:"#eeeeee"};function Fg(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Gae(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function cE(e){let t,n,r;e.length!==2?(t=Fg,n=(s,c)=>Fg(e(s),c),r=(s,c)=>e(s)-c):(t=e===Fg||e===Gae?e:Yae,n=e,r=e);function a(s,c,f=0,A=s.length){if(f<A){if(t(c,c)!==0)return A;do{const h=f+A>>>1;n(s[h],c)<0?f=h+1:A=h}while(f<A)}return f}function i(s,c,f=0,A=s.length){if(f<A){if(t(c,c)!==0)return A;do{const h=f+A>>>1;n(s[h],c)<=0?f=h+1:A=h}while(f<A)}return f}function o(s,c,f=0,A=s.length){const h=a(s,c,f,A-1);return h>f&&r(s[h-1],c)>-r(s[h],c)?h-1:h}return{left:a,center:o,right:i}}function Yae(){return 0}function EI(e){return e===null?NaN:+e}function*Wae(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const BI=cE(Fg).right;cE(EI).center;function Xae(e,t){let n=0;for(let r of e)r!=null&&(r=+r)>=r&&++n;return n}function Kae(e,t){let n=0,r,a=0,i=0;for(let o of e)o!=null&&(o=+o)>=o&&(r=o-a,a+=r/++n,i+=r*(o-a));if(n>1)return i/(n-1)}function _I(e,t){const n=Kae(e);return n&&Math.sqrt(n)}function H0(e,t){let n,r;if(t===void 0)for(const a of e)a!=null&&(n===void 0?a>=a&&(n=r=a):(n>a&&(n=a),r<a&&(r=a)));else{let a=-1;for(let i of e)(i=t(i,++a,e))!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)))}return[n,r]}class TI extends Map{constructor(t,n=qae){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,a]of t)this.set(r,a)}get(t){return super.get(kI(this,t))}has(t){return super.has(kI(this,t))}set(t,n){return super.set(Zae(this,t),n)}delete(t){return super.delete(Jae(this,t))}}function kI({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Zae({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Jae({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function qae(e){return e!==null&&typeof e=="object"?e.valueOf():e}function eie(e){return e}function tie(e=Fg){if(e===Fg)return MI;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function MI(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var nie=Array.prototype,rie=nie.slice;function fE(e){return()=>e}const aie=Math.sqrt(50),iie=Math.sqrt(10),oie=Math.sqrt(2);function Cw(e,t,n){const r=(t-e)/Math.max(0,n),a=Math.floor(Math.log10(r)),i=r/Math.pow(10,a),o=i>=aie?10:i>=iie?5:i>=oie?2:1;let s,c,f;return a<0?(f=Math.pow(10,-a)/o,s=Math.round(e*f),c=Math.round(t*f),s/f<e&&++s,c/f>t&&--c,f=-f):(f=Math.pow(10,a)*o,s=Math.round(e/f),c=Math.round(t/f),s*f<e&&++s,c*f>t&&--c),c<s&&.5<=n&&n<2?Cw(e,t,n*2):[s,c,f]}function Sw(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[a,i,o]=r?Cw(t,e,n):Cw(e,t,n);if(!(i>=a))return[];const s=i-a+1,c=new Array(s);if(r)if(o<0)for(let f=0;f<s;++f)c[f]=(i-f)/-o;else for(let f=0;f<s;++f)c[f]=(i-f)*o;else if(o<0)for(let f=0;f<s;++f)c[f]=(a+f)/-o;else for(let f=0;f<s;++f)c[f]=(a+f)*o;return c}function Qg(e,t,n){return t=+t,e=+e,n=+n,Cw(e,t,n)[2]}function dE(e,t,n){t=+t,e=+e,n=+n;const r=t<e,a=r?Qg(t,e,n):Qg(e,t,n);return(r?-1:1)*(a<0?1/-a:a)}function lie(e,t,n){let r;for(;;){const a=Qg(e,t,n);if(a===r||a===0||!isFinite(a))return[e,t];a>0?(e=Math.floor(e/a)*a,t=Math.ceil(t/a)*a):a<0&&(e=Math.ceil(e*a)/a,t=Math.floor(t*a)/a),r=a}}function sie(e){return Math.max(1,Math.ceil(Math.log(Xae(e))/Math.LN2)+1)}function PI(){var e=eie,t=H0,n=sie;function r(a){Array.isArray(a)||(a=Array.from(a));var i,o=a.length,s,c,f=new Array(o);for(i=0;i<o;++i)f[i]=e(a[i],i,a);var A=t(f),h=A[0],v=A[1],g=n(f,h,v);if(!Array.isArray(g)){const P=v,I=+g;if(t===H0&&([h,v]=lie(h,v,I)),g=Sw(h,v,I),g[0]<=h&&(c=Qg(h,v,I)),g[g.length-1]>=v)if(P>=v&&t===H0){const $=Qg(h,v,I);isFinite($)&&($>0?v=(Math.floor(v/$)+1)*$:$<0&&(v=(Math.ceil(v*-$)+1)/-$))}else g.pop()}for(var C=g.length,b=0,B=C;g[b]<=h;)++b;for(;g[B-1]>v;)--B;(b||B<C)&&(g=g.slice(b,B),C=B-b);var E=new Array(C+1),k;for(i=0;i<=C;++i)k=E[i]=[],k.x0=i>0?g[i-1]:h,k.x1=i<C?g[i]:v;if(isFinite(c)){if(c>0)for(i=0;i<o;++i)(s=f[i])!=null&&h<=s&&s<=v&&E[Math.min(C,Math.floor((s-h)/c))].push(a[i]);else if(c<0){for(i=0;i<o;++i)if((s=f[i])!=null&&h<=s&&s<=v){const P=Math.floor((h-s)*c);E[Math.min(C,P+(g[P]<=s))].push(a[i])}}}else for(i=0;i<o;++i)(s=f[i])!=null&&h<=s&&s<=v&&E[BI(g,s,0,C)].push(a[i]);return E}return r.value=function(a){return arguments.length?(e=typeof a=="function"?a:fE(a),r):e},r.domain=function(a){return arguments.length?(t=typeof a=="function"?a:fE([a[0],a[1]]),r):t},r.thresholds=function(a){return arguments.length?(n=typeof a=="function"?a:fE(Array.isArray(a)?rie.call(a):a),r):n},r}function Vh(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let a of e)(a=t(a,++r,e))!=null&&(n<a||n===void 0&&a>=a)&&(n=a)}return n}function xw(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let a of e)(a=t(a,++r,e))!=null&&(n>a||n===void 0&&a>=a)&&(n=a)}return n}function HI(e,t,n=0,r=1/0,a){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(a=a===void 0?MI:tie(a);r>n;){if(r-n>600){const c=r-n+1,f=t-n+1,A=Math.log(c),h=.5*Math.exp(2*A/3),v=.5*Math.sqrt(A*h*(c-h)/c)*(f-c/2<0?-1:1),g=Math.max(n,Math.floor(t-f*h/c+v)),C=Math.min(r,Math.floor(t+(c-f)*h/c+v));HI(e,t,g,C,a)}const i=e[t];let o=n,s=r;for(X4(e,n,t),a(e[r],i)>0&&X4(e,n,r);o<s;){for(X4(e,o,s),++o,--s;a(e[o],i)<0;)++o;for(;a(e[s],i)>0;)--s}a(e[n],i)===0?X4(e,n,s):(++s,X4(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function X4(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function DI(e,t,n){if(e=Float64Array.from(Wae(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return xw(e);if(t>=1)return Vh(e);var r,a=(r-1)*t,i=Math.floor(a),o=Vh(HI(e,i).subarray(0,i+1)),s=xw(e.subarray(i+1));return o+(s-o)*(a-i)}}function D0(e,t,n=EI){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,a=(r-1)*t,i=Math.floor(a),o=+n(e[i],i,e),s=+n(e[i+1],i+1,e);return o+(s-o)*(a-i)}}function Vs(e,t){let n=0,r=0;if(t===void 0)for(let a of e)a!=null&&(a=+a)>=a&&(++n,r+=a);else{let a=-1;for(let i of e)(i=t(i,++a,e))!=null&&(i=+i)>=i&&(++n,r+=i)}if(n)return r/n}function uie(e,t,n){e=+e,t=+t,n=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+n;for(var r=-1,a=Math.max(0,Math.ceil((t-e)/n))|0,i=new Array(a);++r<a;)i[r]=e+r*n;return i}function lc(e,t){let n=0;if(t===void 0)for(let r of e)(r=+r)&&(n+=r);else{let r=-1;for(let a of e)(a=+t(a,++r,e))&&(n+=a)}return n}function G2(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const $I=Symbol("implicit");function Qo(){var e=new TI,t=[],n=[],r=$I;function a(i){let o=e.get(i);if(o===void 0){if(r!==$I)return r;e.set(i,o=t.push(i)-1)}return n[o%n.length]}return a.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new TI;for(const o of i)e.has(o)||e.set(o,t.push(o)-1);return a},a.range=function(i){return arguments.length?(n=Array.from(i),a):n.slice()},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return Qo(t,n).unknown(r)},G2.apply(a,arguments),a}function K4(){var e=Qo().unknown(void 0),t=e.domain,n=e.range,r=0,a=1,i,o,s=!1,c=0,f=0,A=.5;delete e.unknown;function h(){var v=t().length,g=a<r,C=g?a:r,b=g?r:a;i=(b-C)/Math.max(1,v-c+f*2),s&&(i=Math.floor(i)),C+=(b-C-i*(v-c))*A,o=i*(1-c),s&&(C=Math.round(C),o=Math.round(o));var B=uie(v).map(function(E){return C+i*E});return n(g?B.reverse():B)}return e.domain=function(v){return arguments.length?(t(v),h()):t()},e.range=function(v){return arguments.length?([r,a]=v,r=+r,a=+a,h()):[r,a]},e.rangeRound=function(v){return[r,a]=v,r=+r,a=+a,s=!0,h()},e.bandwidth=function(){return o},e.step=function(){return i},e.round=function(v){return arguments.length?(s=!!v,h()):s},e.padding=function(v){return arguments.length?(c=Math.min(1,f=+v),h()):c},e.paddingInner=function(v){return arguments.length?(c=Math.min(1,v),h()):c},e.paddingOuter=function(v){return arguments.length?(f=+v,h()):f},e.align=function(v){return arguments.length?(A=Math.max(0,Math.min(1,v)),h()):A},e.copy=function(){return K4(t(),[r,a]).round(s).paddingInner(c).paddingOuter(f).align(A)},G2.apply(h(),arguments)}function AE(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function II(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Z4(){}var J4=.7,Ew=1/J4,jg="\\s*([+-]?\\d+)\\s*",q4="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",$A="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",cie=/^#([0-9a-f]{3,8})$/,fie=new RegExp(`^rgb\\(${jg},${jg},${jg}\\)$`),die=new RegExp(`^rgb\\(${$A},${$A},${$A}\\)$`),Aie=new RegExp(`^rgba\\(${jg},${jg},${jg},${q4}\\)$`),hie=new RegExp(`^rgba\\(${$A},${$A},${$A},${q4}\\)$`),pie=new RegExp(`^hsl\\(${q4},${$A},${$A}\\)$`),vie=new RegExp(`^hsla\\(${q4},${$A},${$A},${q4}\\)$`),LI={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};AE(Z4,lv,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:RI,formatHex:RI,formatHex8:mie,formatHsl:gie,formatRgb:VI,toString:VI});function RI(){return this.rgb().formatHex()}function mie(){return this.rgb().formatHex8()}function gie(){return QI(this).formatHsl()}function VI(){return this.rgb().formatRgb()}function lv(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=cie.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?NI(t):n===3?new gd(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Bw(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Bw(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=fie.exec(e))?new gd(t[1],t[2],t[3],1):(t=die.exec(e))?new gd(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Aie.exec(e))?Bw(t[1],t[2],t[3],t[4]):(t=hie.exec(e))?Bw(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=pie.exec(e))?FI(t[1],t[2]/100,t[3]/100,1):(t=vie.exec(e))?FI(t[1],t[2]/100,t[3]/100,t[4]):LI.hasOwnProperty(e)?NI(LI[e]):e==="transparent"?new gd(NaN,NaN,NaN,0):null}function NI(e){return new gd(e>>16&255,e>>8&255,e&255,1)}function Bw(e,t,n,r){return r<=0&&(e=t=n=NaN),new gd(e,t,n,r)}function yie(e){return e instanceof Z4||(e=lv(e)),e?(e=e.rgb(),new gd(e.r,e.g,e.b,e.opacity)):new gd}function Ug(e,t,n,r){return arguments.length===1?yie(e):new gd(e,t,n,r??1)}function gd(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}AE(gd,Ug,II(Z4,{brighter(e){return e=e==null?Ew:Math.pow(Ew,e),new gd(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?J4:Math.pow(J4,e),new gd(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new gd(Y2(this.r),Y2(this.g),Y2(this.b),_w(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:zI,formatHex:zI,formatHex8:wie,formatRgb:OI,toString:OI}));function zI(){return`#${W2(this.r)}${W2(this.g)}${W2(this.b)}`}function wie(){return`#${W2(this.r)}${W2(this.g)}${W2(this.b)}${W2((isNaN(this.opacity)?1:this.opacity)*255)}`}function OI(){const e=_w(this.opacity);return`${e===1?"rgb(":"rgba("}${Y2(this.r)}, ${Y2(this.g)}, ${Y2(this.b)}${e===1?")":`, ${e})`}`}function _w(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Y2(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function W2(e){return e=Y2(e),(e<16?"0":"")+e.toString(16)}function FI(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new $0(e,t,n,r)}function QI(e){if(e instanceof $0)return new $0(e.h,e.s,e.l,e.opacity);if(e instanceof Z4||(e=lv(e)),!e)return new $0;if(e instanceof $0)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),i=Math.max(t,n,r),o=NaN,s=i-a,c=(i+a)/2;return s?(t===i?o=(n-r)/s+(n<r)*6:n===i?o=(r-t)/s+2:o=(t-n)/s+4,s/=c<.5?i+a:2-i-a,o*=60):s=c>0&&c<1?0:o,new $0(o,s,c,e.opacity)}function bie(e,t,n,r){return arguments.length===1?QI(e):new $0(e,t,n,r??1)}function $0(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}AE($0,bie,II(Z4,{brighter(e){return e=e==null?Ew:Math.pow(Ew,e),new $0(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?J4:Math.pow(J4,e),new $0(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new gd(hE(e>=240?e-240:e+120,a,r),hE(e,a,r),hE(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new $0(jI(this.h),Tw(this.s),Tw(this.l),_w(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=_w(this.opacity);return`${e===1?"hsl(":"hsla("}${jI(this.h)}, ${Tw(this.s)*100}%, ${Tw(this.l)*100}%${e===1?")":`, ${e})`}`}}));function jI(e){return e=(e||0)%360,e<0?e+360:e}function Tw(e){return Math.max(0,Math.min(1,e||0))}function hE(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const pE=e=>()=>e;function Cie(e,t){return function(n){return e+n*t}}function Sie(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function xie(e){return(e=+e)==1?UI:function(t,n){return n-t?Sie(t,n,e):pE(isNaN(t)?n:t)}}function UI(e,t){var n=t-e;return n?Cie(e,n):pE(isNaN(e)?t:e)}const kw=function e(t){var n=xie(t);function r(a,i){var o=n((a=Ug(a)).r,(i=Ug(i)).r),s=n(a.g,i.g),c=n(a.b,i.b),f=UI(a.opacity,i.opacity);return function(A){return a.r=o(A),a.g=s(A),a.b=c(A),a.opacity=f(A),a+""}}return r.gamma=e,r}(1);function Eie(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(i){for(a=0;a<n;++a)r[a]=e[a]*(1-i)+t[a]*i;return r}}function Bie(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function _ie(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,a=new Array(r),i=new Array(n),o;for(o=0;o<r;++o)a[o]=gE(e[o],t[o]);for(;o<n;++o)i[o]=t[o];return function(s){for(o=0;o<r;++o)i[o]=a[o](s);return i}}function Tie(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function I0(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function kie(e,t){var n={},r={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?n[a]=gE(e[a],t[a]):r[a]=t[a];return function(i){for(a in n)r[a]=n[a](i);return r}}var vE=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,mE=new RegExp(vE.source,"g");function Mie(e){return function(){return e}}function Pie(e){return function(t){return e(t)+""}}function GI(e,t){var n=vE.lastIndex=mE.lastIndex=0,r,a,i,o=-1,s=[],c=[];for(e=e+"",t=t+"";(r=vE.exec(e))&&(a=mE.exec(t));)(i=a.index)>n&&(i=t.slice(n,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(a=a[0])?s[o]?s[o]+=a:s[++o]=a:(s[++o]=null,c.push({i:o,x:I0(r,a)})),n=mE.lastIndex;return n<t.length&&(i=t.slice(n),s[o]?s[o]+=i:s[++o]=i),s.length<2?c[0]?Pie(c[0].x):Mie(t):(t=c.length,function(f){for(var A=0,h;A<t;++A)s[(h=c[A]).i]=h.x(f);return s.join("")})}function gE(e,t){var n=typeof t,r;return t==null||n==="boolean"?pE(t):(n==="number"?I0:n==="string"?(r=lv(t))?(t=r,kw):GI:t instanceof lv?kw:t instanceof Date?Tie:Bie(t)?Eie:Array.isArray(t)?_ie:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?kie:I0)(e,t)}function Hie(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var YI=180/Math.PI,yE={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function WI(e,t,n,r,a,i){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:a,translateY:i,rotate:Math.atan2(t,e)*YI,skewX:Math.atan(c)*YI,scaleX:o,scaleY:s}}var Mw;function Die(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?yE:WI(t.a,t.b,t.c,t.d,t.e,t.f)}function $ie(e){return e==null||(Mw||(Mw=document.createElementNS("http://www.w3.org/2000/svg","g")),Mw.setAttribute("transform",e),!(e=Mw.transform.baseVal.consolidate()))?yE:(e=e.matrix,WI(e.a,e.b,e.c,e.d,e.e,e.f))}function XI(e,t,n,r){function a(f){return f.length?f.pop()+" ":""}function i(f,A,h,v,g,C){if(f!==h||A!==v){var b=g.push("translate(",null,t,null,n);C.push({i:b-4,x:I0(f,h)},{i:b-2,x:I0(A,v)})}else(h||v)&&g.push("translate("+h+t+v+n)}function o(f,A,h,v){f!==A?(f-A>180?A+=360:A-f>180&&(f+=360),v.push({i:h.push(a(h)+"rotate(",null,r)-2,x:I0(f,A)})):A&&h.push(a(h)+"rotate("+A+r)}function s(f,A,h,v){f!==A?v.push({i:h.push(a(h)+"skewX(",null,r)-2,x:I0(f,A)}):A&&h.push(a(h)+"skewX("+A+r)}function c(f,A,h,v,g,C){if(f!==h||A!==v){var b=g.push(a(g)+"scale(",null,",",null,")");C.push({i:b-4,x:I0(f,h)},{i:b-2,x:I0(A,v)})}else(h!==1||v!==1)&&g.push(a(g)+"scale("+h+","+v+")")}return function(f,A){var h=[],v=[];return f=e(f),A=e(A),i(f.translateX,f.translateY,A.translateX,A.translateY,h,v),o(f.rotate,A.rotate,h,v),s(f.skewX,A.skewX,h,v),c(f.scaleX,f.scaleY,A.scaleX,A.scaleY,h,v),f=A=null,function(g){for(var C=-1,b=v.length,B;++C<b;)h[(B=v[C]).i]=B.x(g);return h.join("")}}}var Iie=XI(Die,"px, ","px)","deg)"),Lie=XI($ie,", ",")",")"),Rie=1e-12;function KI(e){return((e=Math.exp(e))+1/e)/2}function Vie(e){return((e=Math.exp(e))-1/e)/2}function Nie(e){return((e=Math.exp(2*e))-1)/(e+1)}const zie=function e(t,n,r){function a(i,o){var s=i[0],c=i[1],f=i[2],A=o[0],h=o[1],v=o[2],g=A-s,C=h-c,b=g*g+C*C,B,E;if(b<Rie)E=Math.log(v/f)/t,B=function(O){return[s+O*g,c+O*C,f*Math.exp(t*O*E)]};else{var k=Math.sqrt(b),P=(v*v-f*f+r*b)/(2*f*n*k),I=(v*v-f*f-r*b)/(2*v*n*k),$=Math.log(Math.sqrt(P*P+1)-P),z=Math.log(Math.sqrt(I*I+1)-I);E=(z-$)/t,B=function(O){var K=O*E,te=KI($),le=f/(n*k)*(te*Nie(t*K+$)-Vie($));return[s+le*g,c+le*C,f*te/KI(t*K+$)]}}return B.duration=E*1e3*t/Math.SQRT2,B}return a.rho=function(i){var o=Math.max(.001,+i),s=o*o,c=s*s;return e(o,s,c)},a}(Math.SQRT2,2,4);function Oie(e){return function(){return e}}function wE(e){return+e}var ZI=[0,1];function IA(e){return e}function bE(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Oie(isNaN(t)?NaN:.5)}function Fie(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Qie(e,t,n){var r=e[0],a=e[1],i=t[0],o=t[1];return a<r?(r=bE(a,r),i=n(o,i)):(r=bE(r,a),i=n(i,o)),function(s){return i(r(s))}}function jie(e,t,n){var r=Math.min(e.length,t.length)-1,a=new Array(r),i=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)a[o]=bE(e[o],e[o+1]),i[o]=n(t[o],t[o+1]);return function(s){var c=BI(e,s,1,r)-1;return i[c](a[c](s))}}function ey(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Pw(){var e=ZI,t=ZI,n=gE,r,a,i,o=IA,s,c,f;function A(){var v=Math.min(e.length,t.length);return o!==IA&&(o=Fie(e[0],e[v-1])),s=v>2?jie:Qie,c=f=null,h}function h(v){return v==null||isNaN(v=+v)?i:(c||(c=s(e.map(r),t,n)))(r(o(v)))}return h.invert=function(v){return o(a((f||(f=s(t,e.map(r),I0)))(v)))},h.domain=function(v){return arguments.length?(e=Array.from(v,wE),A()):e.slice()},h.range=function(v){return arguments.length?(t=Array.from(v),A()):t.slice()},h.rangeRound=function(v){return t=Array.from(v),n=Hie,A()},h.clamp=function(v){return arguments.length?(o=v?!0:IA,A()):o!==IA},h.interpolate=function(v){return arguments.length?(n=v,A()):n},h.unknown=function(v){return arguments.length?(i=v,h):i},function(v,g){return r=v,a=g,A()}}function JI(){return Pw()(IA,IA)}function Uie(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Hw(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Gg(e){return e=Hw(Math.abs(e)),e?e[1]:NaN}function Gie(e,t){return function(n,r){for(var a=n.length,i=[],o=0,s=e[0],c=0;a>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),i.push(n.substring(a-=s,a+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return i.reverse().join(t)}}function Yie(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Wie=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ty(e){if(!(t=Wie.exec(e)))throw new Error("invalid format: "+e);var t;return new CE({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}ty.prototype=CE.prototype;function CE(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}CE.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Xie(e){e:for(var t=e.length,n=1,r=-1,a;n<t;++n)switch(e[n]){case".":r=a=n;break;case"0":r===0&&(r=n),a=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(a+1):e}var qI;function Kie(e,t){var n=Hw(e,t);if(!n)return e+"";var r=n[0],a=n[1],i=a-(qI=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,o=r.length;return i===o?r:i>o?r+new Array(i-o+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+Hw(e,Math.max(0,t+i-1))[0]}function eL(e,t){var n=Hw(e,t);if(!n)return e+"";var r=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+r:r.length>a+1?r.slice(0,a+1)+"."+r.slice(a+1):r+new Array(a-r.length+2).join("0")}const tL={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Uie,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>eL(e*100,t),r:eL,s:Kie,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function nL(e){return e}var rL=Array.prototype.map,aL=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Zie(e){var t=e.grouping===void 0||e.thousands===void 0?nL:Gie(rL.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?nL:Yie(rL.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function f(h){h=ty(h);var v=h.fill,g=h.align,C=h.sign,b=h.symbol,B=h.zero,E=h.width,k=h.comma,P=h.precision,I=h.trim,$=h.type;$==="n"?(k=!0,$="g"):tL[$]||(P===void 0&&(P=12),I=!0,$="g"),(B||v==="0"&&g==="=")&&(B=!0,v="0",g="=");var z=b==="$"?n:b==="#"&&/[boxX]/.test($)?"0"+$.toLowerCase():"",O=b==="$"?r:/[%p]/.test($)?o:"",K=tL[$],te=/[defgprs%]/.test($);P=P===void 0?6:/[gprs]/.test($)?Math.max(1,Math.min(21,P)):Math.max(0,Math.min(20,P));function le(G){var Q=z,j=O,Y,X,ee;if($==="c")j=K(G)+j,G="";else{G=+G;var pe=G<0||1/G<0;if(G=isNaN(G)?c:K(Math.abs(G),P),I&&(G=Xie(G)),pe&&+G==0&&C!=="+"&&(pe=!1),Q=(pe?C==="("?C:s:C==="-"||C==="("?"":C)+Q,j=($==="s"?aL[8+qI/3]:"")+j+(pe&&C==="("?")":""),te){for(Y=-1,X=G.length;++Y<X;)if(ee=G.charCodeAt(Y),48>ee||ee>57){j=(ee===46?a+G.slice(Y+1):G.slice(Y))+j,G=G.slice(0,Y);break}}}k&&!B&&(G=t(G,1/0));var ae=Q.length+G.length+j.length,ge=ae<E?new Array(E-ae+1).join(v):"";switch(k&&B&&(G=t(ge+G,ge.length?E-j.length:1/0),ge=""),g){case"<":G=Q+G+j+ge;break;case"=":G=Q+ge+G+j;break;case"^":G=ge.slice(0,ae=ge.length>>1)+Q+G+j+ge.slice(ae);break;default:G=ge+Q+G+j;break}return i(G)}return le.toString=function(){return h+""},le}function A(h,v){var g=f((h=ty(h),h.type="f",h)),C=Math.max(-8,Math.min(8,Math.floor(Gg(v)/3)))*3,b=Math.pow(10,-C),B=aL[8+C/3];return function(E){return g(b*E)+B}}return{format:f,formatPrefix:A}}var Dw,ny,iL;Jie({thousands:",",grouping:[3],currency:["$",""]});function Jie(e){return Dw=Zie(e),ny=Dw.format,iL=Dw.formatPrefix,Dw}function qie(e){return Math.max(0,-Gg(Math.abs(e)))}function eoe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Gg(t)/3)))*3-Gg(Math.abs(e)))}function toe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Gg(t)-Gg(e))+1}function noe(e,t,n,r){var a=dE(e,t,n),i;switch(r=ty(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(i=eoe(a,o))&&(r.precision=i),iL(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=toe(a,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=qie(a))&&(r.precision=i-(r.type==="%")*2);break}}return ny(r)}function $w(e){var t=e.domain;return e.ticks=function(n){var r=t();return Sw(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var a=t();return noe(a[0],a[a.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),a=0,i=r.length-1,o=r[a],s=r[i],c,f,A=10;for(s<o&&(f=o,o=s,s=f,f=a,a=i,i=f);A-- >0;){if(f=Qg(o,s,n),f===c)return r[a]=o,r[i]=s,t(r);if(f>0)o=Math.floor(o/f)*f,s=Math.ceil(s/f)*f;else if(f<0)o=Math.ceil(o*f)/f,s=Math.floor(s*f)/f;else break;c=f}return e},e}function Zr(){var e=JI();return e.copy=function(){return ey(e,Zr())},G2.apply(e,arguments),$w(e)}function sv(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,wE),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return sv(e).unknown(t)},e=arguments.length?Array.from(e,wE):[0,1],$w(n)}function oL(e,t){e=e.slice();var n=0,r=e.length-1,a=e[n],i=e[r],o;return i<a&&(o=n,n=r,r=o,o=a,a=i,i=o),e[n]=t.floor(a),e[r]=t.ceil(i),e}function lL(e){return Math.log(e)}function sL(e){return Math.exp(e)}function roe(e){return-Math.log(-e)}function aoe(e){return-Math.exp(-e)}function ioe(e){return isFinite(e)?+("1e"+e):e<0?0:e}function ooe(e){return e===10?ioe:e===Math.E?Math.exp:t=>Math.pow(e,t)}function loe(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function uL(e){return(t,n)=>-e(-t,n)}function soe(e){const t=e(lL,sL),n=t.domain;let r=10,a,i;function o(){return a=loe(r),i=ooe(r),n()[0]<0?(a=uL(a),i=uL(i),e(roe,aoe)):e(lL,sL),t}return t.base=function(s){return arguments.length?(r=+s,o()):r},t.domain=function(s){return arguments.length?(n(s),o()):n()},t.ticks=s=>{const c=n();let f=c[0],A=c[c.length-1];const h=A<f;h&&([f,A]=[A,f]);let v=a(f),g=a(A),C,b;const B=s==null?10:+s;let E=[];if(!(r%1)&&g-v<B){if(v=Math.floor(v),g=Math.ceil(g),f>0){for(;v<=g;++v)for(C=1;C<r;++C)if(b=v<0?C/i(-v):C*i(v),!(b<f)){if(b>A)break;E.push(b)}}else for(;v<=g;++v)for(C=r-1;C>=1;--C)if(b=v>0?C/i(-v):C*i(v),!(b<f)){if(b>A)break;E.push(b)}E.length*2<B&&(E=Sw(f,A,B))}else E=Sw(v,g,Math.min(g-v,B)).map(i);return h?E.reverse():E},t.tickFormat=(s,c)=>{if(s==null&&(s=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=ty(c)).precision==null&&(c.trim=!0),c=ny(c)),s===1/0)return c;const f=Math.max(1,r*s/t.ticks().length);return A=>{let h=A/i(Math.round(a(A)));return h*r<r-.5&&(h*=r),h<=f?c(A):""}},t.nice=()=>n(oL(n(),{floor:s=>i(Math.floor(a(s))),ceil:s=>i(Math.ceil(a(s)))})),t}function X2(){const e=soe(Pw()).domain([1,10]);return e.copy=()=>ey(e,X2()).base(e.base()),G2.apply(e,arguments),e}function cL(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function fL(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function uoe(e){var t=1,n=e(cL(t),fL(t));return n.constant=function(r){return arguments.length?e(cL(t=+r),fL(t)):t},$w(n)}function uv(){var e=uoe(Pw());return e.copy=function(){return ey(e,uv()).constant(e.constant())},G2.apply(e,arguments)}function dL(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function coe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function foe(e){return e<0?-e*e:e*e}function doe(e){var t=e(IA,IA),n=1;function r(){return n===1?e(IA,IA):n===.5?e(coe,foe):e(dL(n),dL(1/n))}return t.exponent=function(a){return arguments.length?(n=+a,r()):n},$w(t)}function SE(){var e=doe(Pw());return e.copy=function(){return ey(e,SE()).exponent(e.exponent())},G2.apply(e,arguments),e}function cv(){return SE.apply(null,arguments).exponent(.5)}const xE=new Date,EE=new Date;function uu(e,t,n,r){function a(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return a.floor=i=>(e(i=new Date(+i)),i),a.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),a.round=i=>{const o=a(i),s=a.ceil(i);return i-o<s-i?o:s},a.offset=(i,o)=>(t(i=new Date(+i),o==null?1:Math.floor(o)),i),a.range=(i,o,s)=>{const c=[];if(i=a.ceil(i),s=s==null?1:Math.floor(s),!(i<o)||!(s>0))return c;let f;do c.push(f=new Date(+i)),t(i,s),e(i);while(f<i&&i<o);return c},a.filter=i=>uu(o=>{if(o>=o)for(;e(o),!i(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!i(o););else for(;--s>=0;)for(;t(o,1),!i(o););}),n&&(a.count=(i,o)=>(xE.setTime(+i),EE.setTime(+o),e(xE),e(EE),Math.floor(n(xE,EE))),a.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?a.filter(r?o=>r(o)%i===0:o=>a.count(0,o)%i===0):a)),a}const Iw=uu(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Iw.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?uu(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Iw),Iw.range;const Nh=1e3,L1=Nh*60,zh=L1*60,Oh=zh*24,BE=Oh*7,AL=Oh*30,_E=Oh*365,Yg=uu(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Nh)},(e,t)=>(t-e)/Nh,e=>e.getUTCSeconds());Yg.range;const TE=uu(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Nh)},(e,t)=>{e.setTime(+e+t*L1)},(e,t)=>(t-e)/L1,e=>e.getMinutes());TE.range,uu(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*L1)},(e,t)=>(t-e)/L1,e=>e.getUTCMinutes()).range;const kE=uu(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Nh-e.getMinutes()*L1)},(e,t)=>{e.setTime(+e+t*zh)},(e,t)=>(t-e)/zh,e=>e.getHours());kE.range,uu(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*zh)},(e,t)=>(t-e)/zh,e=>e.getUTCHours()).range;const ry=uu(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*L1)/Oh,e=>e.getDate()-1);ry.range;const ME=uu(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Oh,e=>e.getUTCDate()-1);ME.range,uu(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Oh,e=>Math.floor(e/Oh)).range;function K2(e){return uu(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*L1)/BE)}const Lw=K2(0),Rw=K2(1),Aoe=K2(2),hoe=K2(3),Wg=K2(4),poe=K2(5),voe=K2(6);Lw.range,Rw.range,Aoe.range,hoe.range,Wg.range,poe.range,voe.range;function Z2(e){return uu(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/BE)}const hL=Z2(0),Vw=Z2(1),moe=Z2(2),goe=Z2(3),Xg=Z2(4),yoe=Z2(5),woe=Z2(6);hL.range,Vw.range,moe.range,goe.range,Xg.range,yoe.range,woe.range;const PE=uu(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());PE.range,uu(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth()).range;const Fh=uu(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Fh.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:uu(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),Fh.range;const J2=uu(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());J2.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:uu(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),J2.range;function boe(e,t,n,r,a,i){const o=[[Yg,1,Nh],[Yg,5,5*Nh],[Yg,15,15*Nh],[Yg,30,30*Nh],[i,1,L1],[i,5,5*L1],[i,15,15*L1],[i,30,30*L1],[a,1,zh],[a,3,3*zh],[a,6,6*zh],[a,12,12*zh],[r,1,Oh],[r,2,2*Oh],[n,1,BE],[t,1,AL],[t,3,3*AL],[e,1,_E]];function s(f,A,h){const v=A<f;v&&([f,A]=[A,f]);const g=h&&typeof h.range=="function"?h:c(f,A,h),C=g?g.range(f,+A+1):[];return v?C.reverse():C}function c(f,A,h){const v=Math.abs(A-f)/h,g=cE(([,,B])=>B).right(o,v);if(g===o.length)return e.every(dE(f/_E,A/_E,h));if(g===0)return Iw.every(Math.max(dE(f,A,h),1));const[C,b]=o[v/o[g-1][2]<o[g][2]/v?g-1:g];return C.every(b)}return[s,c]}const[Coe,Soe]=boe(Fh,PE,Lw,ry,kE,TE);function HE(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function DE(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function ay(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function xoe(e){var t=e.dateTime,n=e.date,r=e.time,a=e.periods,i=e.days,o=e.shortDays,s=e.months,c=e.shortMonths,f=iy(a),A=oy(a),h=iy(i),v=oy(i),g=iy(o),C=oy(o),b=iy(s),B=oy(s),E=iy(c),k=oy(c),P={a:pe,A:ae,b:ge,B:me,c:null,d:wL,e:wL,f:Yoe,g:rle,G:ile,H:joe,I:Uoe,j:Goe,L:bL,m:Woe,M:Xoe,p:fe,q:Ce,Q:_L,s:TL,S:Koe,u:Zoe,U:Joe,V:qoe,w:ele,W:tle,x:null,X:null,y:nle,Y:ale,Z:ole,"%":BL},I={a:De,A:ke,b:$e,B:je,c:null,d:SL,e:SL,f:cle,g:wle,G:Cle,H:lle,I:sle,j:ule,L:xL,m:fle,M:dle,p:Oe,q:ft,Q:_L,s:TL,S:Ale,u:hle,U:ple,V:vle,w:mle,W:gle,x:null,X:null,y:yle,Y:ble,Z:Sle,"%":BL},$={a:le,A:G,b:Q,B:j,c:Y,d:gL,e:gL,f:zoe,g:mL,G:vL,H:yL,I:yL,j:Loe,L:Noe,m:Ioe,M:Roe,p:te,q:$oe,Q:Foe,s:Qoe,S:Voe,u:koe,U:Moe,V:Poe,w:Toe,W:Hoe,x:X,X:ee,y:mL,Y:vL,Z:Doe,"%":Ooe};P.x=z(n,P),P.X=z(r,P),P.c=z(t,P),I.x=z(n,I),I.X=z(r,I),I.c=z(t,I);function z(ze,Xe){return function(tt){var qe=[],gt=-1,wt=0,Xt=ze.length,rr,sr,ra;for(tt instanceof Date||(tt=new Date(+tt));++gt<Xt;)ze.charCodeAt(gt)===37&&(qe.push(ze.slice(wt,gt)),(sr=pL[rr=ze.charAt(++gt)])!=null?rr=ze.charAt(++gt):sr=rr==="e"?" ":"0",(ra=Xe[rr])&&(rr=ra(tt,sr)),qe.push(rr),wt=gt+1);return qe.push(ze.slice(wt,gt)),qe.join("")}}function O(ze,Xe){return function(tt){var qe=ay(1900,void 0,1),gt=K(qe,ze,tt+="",0),wt,Xt;if(gt!=tt.length)return null;if("Q"in qe)return new Date(qe.Q);if("s"in qe)return new Date(qe.s*1e3+("L"in qe?qe.L:0));if(Xe&&!("Z"in qe)&&(qe.Z=0),"p"in qe&&(qe.H=qe.H%12+qe.p*12),qe.m===void 0&&(qe.m="q"in qe?qe.q:0),"V"in qe){if(qe.V<1||qe.V>53)return null;"w"in qe||(qe.w=1),"Z"in qe?(wt=DE(ay(qe.y,0,1)),Xt=wt.getUTCDay(),wt=Xt>4||Xt===0?Vw.ceil(wt):Vw(wt),wt=ME.offset(wt,(qe.V-1)*7),qe.y=wt.getUTCFullYear(),qe.m=wt.getUTCMonth(),qe.d=wt.getUTCDate()+(qe.w+6)%7):(wt=HE(ay(qe.y,0,1)),Xt=wt.getDay(),wt=Xt>4||Xt===0?Rw.ceil(wt):Rw(wt),wt=ry.offset(wt,(qe.V-1)*7),qe.y=wt.getFullYear(),qe.m=wt.getMonth(),qe.d=wt.getDate()+(qe.w+6)%7)}else("W"in qe||"U"in qe)&&("w"in qe||(qe.w="u"in qe?qe.u%7:"W"in qe?1:0),Xt="Z"in qe?DE(ay(qe.y,0,1)).getUTCDay():HE(ay(qe.y,0,1)).getDay(),qe.m=0,qe.d="W"in qe?(qe.w+6)%7+qe.W*7-(Xt+5)%7:qe.w+qe.U*7-(Xt+6)%7);return"Z"in qe?(qe.H+=qe.Z/100|0,qe.M+=qe.Z%100,DE(qe)):HE(qe)}}function K(ze,Xe,tt,qe){for(var gt=0,wt=Xe.length,Xt=tt.length,rr,sr;gt<wt;){if(qe>=Xt)return-1;if(rr=Xe.charCodeAt(gt++),rr===37){if(rr=Xe.charAt(gt++),sr=$[rr in pL?Xe.charAt(gt++):rr],!sr||(qe=sr(ze,tt,qe))<0)return-1}else if(rr!=tt.charCodeAt(qe++))return-1}return qe}function te(ze,Xe,tt){var qe=f.exec(Xe.slice(tt));return qe?(ze.p=A.get(qe[0].toLowerCase()),tt+qe[0].length):-1}function le(ze,Xe,tt){var qe=g.exec(Xe.slice(tt));return qe?(ze.w=C.get(qe[0].toLowerCase()),tt+qe[0].length):-1}function G(ze,Xe,tt){var qe=h.exec(Xe.slice(tt));return qe?(ze.w=v.get(qe[0].toLowerCase()),tt+qe[0].length):-1}function Q(ze,Xe,tt){var qe=E.exec(Xe.slice(tt));return qe?(ze.m=k.get(qe[0].toLowerCase()),tt+qe[0].length):-1}function j(ze,Xe,tt){var qe=b.exec(Xe.slice(tt));return qe?(ze.m=B.get(qe[0].toLowerCase()),tt+qe[0].length):-1}function Y(ze,Xe,tt){return K(ze,t,Xe,tt)}function X(ze,Xe,tt){return K(ze,n,Xe,tt)}function ee(ze,Xe,tt){return K(ze,r,Xe,tt)}function pe(ze){return o[ze.getDay()]}function ae(ze){return i[ze.getDay()]}function ge(ze){return c[ze.getMonth()]}function me(ze){return s[ze.getMonth()]}function fe(ze){return a[+(ze.getHours()>=12)]}function Ce(ze){return 1+~~(ze.getMonth()/3)}function De(ze){return o[ze.getUTCDay()]}function ke(ze){return i[ze.getUTCDay()]}function $e(ze){return c[ze.getUTCMonth()]}function je(ze){return s[ze.getUTCMonth()]}function Oe(ze){return a[+(ze.getUTCHours()>=12)]}function ft(ze){return 1+~~(ze.getUTCMonth()/3)}return{format:function(ze){var Xe=z(ze+="",P);return Xe.toString=function(){return ze},Xe},parse:function(ze){var Xe=O(ze+="",!1);return Xe.toString=function(){return ze},Xe},utcFormat:function(ze){var Xe=z(ze+="",I);return Xe.toString=function(){return ze},Xe},utcParse:function(ze){var Xe=O(ze+="",!0);return Xe.toString=function(){return ze},Xe}}}var pL={"-":"",_:" ",0:"0"},Nu=/^\s*\d+/,Eoe=/^%/,Boe=/[\\^$*+?|[\]().{}]/g;function yi(e,t,n){var r=e<0?"-":"",a=(r?-e:e)+"",i=a.length;return r+(i<n?new Array(n-i+1).join(t)+a:a)}function _oe(e){return e.replace(Boe,"\\$&")}function iy(e){return new RegExp("^(?:"+e.map(_oe).join("|")+")","i")}function oy(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Toe(e,t,n){var r=Nu.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function koe(e,t,n){var r=Nu.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Moe(e,t,n){var r=Nu.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Poe(e,t,n){var r=Nu.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Hoe(e,t,n){var r=Nu.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function vL(e,t,n){var r=Nu.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function mL(e,t,n){var r=Nu.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Doe(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function $oe(e,t,n){var r=Nu.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Ioe(e,t,n){var r=Nu.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function gL(e,t,n){var r=Nu.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Loe(e,t,n){var r=Nu.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function yL(e,t,n){var r=Nu.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Roe(e,t,n){var r=Nu.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Voe(e,t,n){var r=Nu.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Noe(e,t,n){var r=Nu.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function zoe(e,t,n){var r=Nu.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Ooe(e,t,n){var r=Eoe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Foe(e,t,n){var r=Nu.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Qoe(e,t,n){var r=Nu.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function wL(e,t){return yi(e.getDate(),t,2)}function joe(e,t){return yi(e.getHours(),t,2)}function Uoe(e,t){return yi(e.getHours()%12||12,t,2)}function Goe(e,t){return yi(1+ry.count(Fh(e),e),t,3)}function bL(e,t){return yi(e.getMilliseconds(),t,3)}function Yoe(e,t){return bL(e,t)+"000"}function Woe(e,t){return yi(e.getMonth()+1,t,2)}function Xoe(e,t){return yi(e.getMinutes(),t,2)}function Koe(e,t){return yi(e.getSeconds(),t,2)}function Zoe(e){var t=e.getDay();return t===0?7:t}function Joe(e,t){return yi(Lw.count(Fh(e)-1,e),t,2)}function CL(e){var t=e.getDay();return t>=4||t===0?Wg(e):Wg.ceil(e)}function qoe(e,t){return e=CL(e),yi(Wg.count(Fh(e),e)+(Fh(e).getDay()===4),t,2)}function ele(e){return e.getDay()}function tle(e,t){return yi(Rw.count(Fh(e)-1,e),t,2)}function nle(e,t){return yi(e.getFullYear()%100,t,2)}function rle(e,t){return e=CL(e),yi(e.getFullYear()%100,t,2)}function ale(e,t){return yi(e.getFullYear()%1e4,t,4)}function ile(e,t){var n=e.getDay();return e=n>=4||n===0?Wg(e):Wg.ceil(e),yi(e.getFullYear()%1e4,t,4)}function ole(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+yi(t/60|0,"0",2)+yi(t%60,"0",2)}function SL(e,t){return yi(e.getUTCDate(),t,2)}function lle(e,t){return yi(e.getUTCHours(),t,2)}function sle(e,t){return yi(e.getUTCHours()%12||12,t,2)}function ule(e,t){return yi(1+ME.count(J2(e),e),t,3)}function xL(e,t){return yi(e.getUTCMilliseconds(),t,3)}function cle(e,t){return xL(e,t)+"000"}function fle(e,t){return yi(e.getUTCMonth()+1,t,2)}function dle(e,t){return yi(e.getUTCMinutes(),t,2)}function Ale(e,t){return yi(e.getUTCSeconds(),t,2)}function hle(e){var t=e.getUTCDay();return t===0?7:t}function ple(e,t){return yi(hL.count(J2(e)-1,e),t,2)}function EL(e){var t=e.getUTCDay();return t>=4||t===0?Xg(e):Xg.ceil(e)}function vle(e,t){return e=EL(e),yi(Xg.count(J2(e),e)+(J2(e).getUTCDay()===4),t,2)}function mle(e){return e.getUTCDay()}function gle(e,t){return yi(Vw.count(J2(e)-1,e),t,2)}function yle(e,t){return yi(e.getUTCFullYear()%100,t,2)}function wle(e,t){return e=EL(e),yi(e.getUTCFullYear()%100,t,2)}function ble(e,t){return yi(e.getUTCFullYear()%1e4,t,4)}function Cle(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Xg(e):Xg.ceil(e),yi(e.getUTCFullYear()%1e4,t,4)}function Sle(){return"+0000"}function BL(){return"%"}function _L(e){return+e}function TL(e){return Math.floor(+e/1e3)}var Kg,kL;xle({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function xle(e){return Kg=xoe(e),kL=Kg.format,Kg.parse,Kg.utcFormat,Kg.utcParse,Kg}function Ele(e){return new Date(e)}function Ble(e){return e instanceof Date?+e:+new Date(+e)}function ML(e,t,n,r,a,i,o,s,c,f){var A=JI(),h=A.invert,v=A.domain,g=f(".%L"),C=f(":%S"),b=f("%I:%M"),B=f("%I %p"),E=f("%a %d"),k=f("%b %d"),P=f("%B"),I=f("%Y");function $(z){return(c(z)<z?g:s(z)<z?C:o(z)<z?b:i(z)<z?B:r(z)<z?a(z)<z?E:k:n(z)<z?P:I)(z)}return A.invert=function(z){return new Date(h(z))},A.domain=function(z){return arguments.length?v(Array.from(z,Ble)):v().map(Ele)},A.ticks=function(z){var O=v();return e(O[0],O[O.length-1],z??10)},A.tickFormat=function(z,O){return O==null?$:f(O)},A.nice=function(z){var O=v();return(!z||typeof z.range!="function")&&(z=t(O[0],O[O.length-1],z??10)),z?v(oL(O,z)):A},A.copy=function(){return ey(A,ML(e,t,n,r,a,i,o,s,c,f))},A}function _le(){return G2.apply(ML(Coe,Soe,Fh,PE,Lw,ry,kE,TE,Yg,kL).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function PL(e){return e!==null&&typeof e=="object"&&"palette"in e&&"type"in e&&e.type==="continuous"}function $E(e){return e!==null&&typeof e=="object"&&"palette"in e&&"type"in e&&e.type==="categorical"}function HL(e){return $E(e)||PL(e)}const Zg="#110529",Tle="solid",ly=1,q2="21",L0=3,IE=2,em={min:3,max:10},DL={color:"#ccc",lineShape:Tle,dotShape:q2},kle="light";function Mle(e){const t=1/(e.length-1);return Zr().domain(e.map((n,r)=>r*t)).range(e)}function $L(e,t){const n=Ui[e].colors,r=t.length>1?1/(t.length-1):0,a=Mle(n),i=uE(e),o=t.reduce((s,c,f)=>(s[c]={colorIdx:i?f:f*r,aes:{color:i?n[f%n.length]:a(f*r),lineShape:Og[f%Og.length],dotShape:W4[f%W4.length]}},s),{});return{type:"categorical",palette:e,naAes:DL,order:t,mapping:o}}function tm(e){return{type:"continuous",palette:e,naAes:DL,range:null,midPoint:null,log:!1}}function nm(e){return $L(kle,e)}function IL(e,t,n,r){var i;if((t==null?void 0:t.type)==="continuous")return{inheritedAes:{}};const a=t??nm(n?((i=e[n])==null?void 0:i.list)??[]:[]);return{order:a.order,inheritedAes:a.order.reduce((o,s)=>{const c=a.mapping[s].aes;return o[s]={},r.fill&&(o[s].fillColor=c.color,o[s].dotFill=c.color),r.stroke&&(o[s].lineColor=c.color),r.dotShape&&(o[s].dotShape=c.dotShape),r.lineType&&(o[s].lineShape=c.lineShape),o},{})}}function LL(e,t,n){var i;const r=n[e];if(r&&!$E(r))return{};const a=r??nm(((i=t[e])==null?void 0:i.list)??[]);return a.order.reduce((o,s)=>{const c=a.mapping[s].aes;return o[s]={fillColor:c.color,lineColor:c.color,dotFill:c.color,dotShape:c.dotShape,dotSize:L0,lineWidth:ly},o},{})}function Ple(e,t,n){var i;const r=n[e];if(r&&!$E(r))return{};const a=r??nm(((i=t[e])==null?void 0:i.list)??[]);return{order:a.order,inheritedAes:a.order.reduce((o,s)=>{const c=a.mapping[s].aes;return o[s]={fillColor:c.color,lineColor:pi,dotFill:pi,dotShape:q2,dotSize:L0,lineWidth:ly},o},{})}}function LE(e,t,n,r){var i;const a=n[e]??nm(((i=t[e])==null?void 0:i.list)??[]);return a.order.reduce((o,s)=>{const c=a.mapping[s].aes;return o[s]=c[r],o},{})}const Hle={},Dle={class:"inline-icon",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function $le(e,t){return d.openBlock(),d.createElementBlock("svg",Dle,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.5 2.25H12V3.75H15.25V11.25H13.5C12.8096 11.25 12.25 11.8096 12.25 12.5V21H13.75V12.75H18.25V16.25H17.5C16.8096 16.25 16.25 16.8096 16.25 17.5V21H17.75V17.75H20.25V21H21.75V17.5C21.75 16.8096 21.1904 16.25 20.5 16.25H19.75V12.5C19.75 11.8096 19.1904 11.25 18.5 11.25H16.75V3.5C16.75 2.80964 16.1904 2.25 15.5 2.25Z",fill:"#110529"},null,-1),d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.5 3.75H7.25V7.25H8.5C9.19036 7.25 9.75 7.80964 9.75 8.5V21H8.25V8.75H4.75V21H3.25V8.5C3.25 7.80965 3.80964 7.25 4.5 7.25H5.75V3.5C5.75 2.80964 6.30964 2.25 7 2.25H10.5V3.75Z",fill:"#07AD3E"},null,-1)]))}const RL=mr(Hle,[["render",$le]]),Nw="pl7.app/graph/thresholds",fv="pl7.app/graph/axis/lowerLimit",dv="pl7.app/graph/axis/upperLimit",Av="pl7.app/graph/axis/symmetricRange",Jg="pl7.app/graph/palette",zw="pl7.app/axisNature",Ile="pl7.app/isSubset";function Lle(e,t){return t==="discrete"?e&&qg[e]?e:"box":t==="scatterplot"||t==="scatterplot-umap"?e&&rm[e]?e:"dots":t==="dendro"?"dendro":e??"heatmap"}const qg={box:["box"],box_binnedDots:["box","binnedDots"],box_jitteredDots:["box","jitteredDots"],violin:["violin"],violin_binnedDots:["violin","binnedDots"],violin_jitteredDots:["violin","jitteredDots"],binnedDots:["binnedDots"],jitteredDots:["jitteredDots"],bar:["bar"],bar_line:["bar","line"],bar_errorbar:["bar","errorbar"],stackedBar:["stackedBar"],line:["line"],line_jitteredDots:["line","jitteredDots"],line_binnedDots:["line","binnedDots"],line_errorbar:["line","errorbar"],errorbar:["errorbar"],sina:["sina"],logo:["logo"]},rm={dots:["dots"],curve:["curve"],curve_dots:["curve","dots"]},VL={dots:["dots"],curve_dots:["curve","dots"]},Rle={heatmap:["heatmap"],heatmapClustered:["heatmapClustered"]},Vle={bins:["bins"]},LA={box:"Boxplot",binnedDots:"Binned Dots",jitteredDots:"Jittered Dots",violin:"Violins",bar:"Bar",stackedBar:"Stacked Bar",line:"Line",errorbar:"Error Bar",sina:"Sina",logo:"Logo Plot",dots:"Scatter Plot",curve:"Curve",heatmap:"Heatmap",heatmapClustered:"Heatmap + Dendro",dendro:"Dendrogram",bins:"Histogram",bubble:"Bubble plot"};function Nle(e,t){var r,a,i,o,s,c,f,A,h,v,g,C,b,B,E,k,P,I,$,z,O,K,te,le,G,Q,j,Y,X,ee,pe;if(e==="discrete"){const ae=t;return{overall:{data:{testMethod:((a=(r=ae==null?void 0:ae.overall)==null?void 0:r.data)==null?void 0:a.testMethod)??null},validity:{testMethod:((o=(i=ae==null?void 0:ae.overall)==null?void 0:i.validity)==null?void 0:o.testMethod)??!0}},referenceGroup:{data:{testMethod:((c=(s=ae==null?void 0:ae.referenceGroup)==null?void 0:s.data)==null?void 0:c.testMethod)??null,referenceGroup:((A=(f=ae==null?void 0:ae.referenceGroup)==null?void 0:f.data)==null?void 0:A.referenceGroup)??null,correctionMethod:((v=(h=ae==null?void 0:ae.referenceGroup)==null?void 0:h.data)==null?void 0:v.correctionMethod)??"Bonferroni",format:((C=(g=ae==null?void 0:ae.referenceGroup)==null?void 0:g.data)==null?void 0:C.format)??"significance",ns:((B=(b=ae==null?void 0:ae.referenceGroup)==null?void 0:b.data)==null?void 0:B.ns)??!1},validity:{testMethod:((k=(E=ae==null?void 0:ae.referenceGroup)==null?void 0:E.validity)==null?void 0:k.testMethod)??!0,referenceGroup:((I=(P=ae==null?void 0:ae.referenceGroup)==null?void 0:P.validity)==null?void 0:I.referenceGroup)??!0}},pairwise:{data:{testMethod:((z=($=ae==null?void 0:ae.pairwise)==null?void 0:$.data)==null?void 0:z.testMethod)??null,correctionMethod:((K=(O=ae==null?void 0:ae.pairwise)==null?void 0:O.data)==null?void 0:K.correctionMethod)??"Bonferroni",format:((le=(te=ae==null?void 0:ae.pairwise)==null?void 0:te.data)==null?void 0:le.format)??"significance",ns:((Q=(G=ae==null?void 0:ae.pairwise)==null?void 0:G.data)==null?void 0:Q.ns)??!1},validity:{testMethod:((Y=(j=ae==null?void 0:ae.pairwise)==null?void 0:j.validity)==null?void 0:Y.testMethod)??!0}}}}const n=t;return{trend:{on:((X=n==null?void 0:n.trend)==null?void 0:X.on)??!1,trim:((ee=n==null?void 0:n.trend)==null?void 0:ee.trim)??!1,showLegend:((pe=n==null?void 0:n.trend)==null?void 0:pe.showLegend)??!0}}}function RE(e){return typeof e<"u"&&e!==null&&typeof e=="object"&&"min"in e&&"max"in e}function e5(e){return typeof e=="object"&&e!==null&&"type"in e}function Qh(e){return typeof e<"u"&&e!==null&&typeof e=="object"&&"range"in e}const zle=()=>({bubble:{NAValueAs:0,strokeColor:null,minRadius:3,maxRadius:38,normalizationDirection:"row",normalizationMethod:"standardScaling"},bins:{fillColor:null,opacity:1},dendro:{dotFill:pi,dotShape:DA,dotSize:L0,lineColor:pi,mode:"normal",leavesMode:"normal",showTable:!1,showLegend:!0},heatmap:{NAValueAs:0,normalizationDirection:"row",normalizationMethod:"standardScaling"},heatmapClustered:{NAValueAs:0,normalizationDirection:"row",normalizationMethod:"standardScaling",dendrogramX:!0,dendrogramY:!0,disableClusteringX:!1,disableClusteringY:!1},dots:{dotFill:null,dotShape:null,dotSize:null},curve:{lineColor:pi,smoothing:!0},box:{showOutliers:!0,fillColor:null,lineColor:Zg,dotShape:DA,lineType:bw,gapWidth:.2,opacity:1,stat:{low:.25,middle:.5,upper:.75,k:1.5}},binnedDots:{fillColor:null,lineColor:Zg,opacity:1,showOutliers:!0},jitteredDots:{dotFill:null,dotShape:DA,lineColor:Zg,opacity:1,showOutliers:!0},violin:{fillColor:null,lineColor:Zg,lineType:bw,opacity:1,trim:!1,showQuartiles:!1,quartilesLineStyle:"dashed",medianLineStyle:"solid"},bar:{fillColor:null,lineColor:Zg,opacity:1,height:"max"},stackedBar:{fillColor:null,lineColor:Zg,opacity:1,normalize:!1},line:{pointsValues:"mean",lineColor:null,dotShape:DA,lineType:bw,dotFill:null,opacity:1},errorbar:{pointsValues:"mean",interval:"sd",lineColor:null,dotShape:DA,dotFill:null,opacity:1},sina:{dotFill:null,dotShape:DA,opacity:1,showOutliers:!0},logo:{normalize:!1,opacity:1}});function Ole(e){const t=zle();return Object.keys(t).reduce((r,a)=>(Object.assign(r[a],(e==null?void 0:e[a])??{}),r),t)}const Fle=()=>({title:{value:"Graph 1",position:"center",mode:"auto",facetTitleFrame:"full"},axisX:{labelsPosition:"bottom",labelsRotation:null,axisLabelsAngle:90,titleMode:"auto",customTitle:"",gridlines:!0,linesBetweenCategories:!0,ticks:!0,scale:"linear",significantLinesStyle:"dashed",sorting:"asc",allowNullPrimaryGroups:!1,allowNullSecondaryGroups:!1},axisY:{titleMode:"auto",customTitle:"",axisLabelsAngle:90,gridlines:!0,ticks:!0,scale:"linear",significantLinesStyle:"dashed",sorting:"asc"},legend:{},other:{frame:"full",reverse:!1,facetSharedBy:"xy",facetColumns:3,binsCount:10,groupingDirection:"straight",groupingStack:"vertical"}});function NL(e){return e==="full"||e==="none"}function Qle(e,t){var a;const n=Fle();if(!t)return n;function r(i){return!i||e==="heatmap"&&!NL(i)?"full":e!=="heatmap"&&NL(i)&&i==="none"?"empty":i}return{title:{...n.title,...t.title},axisX:{...n.axisX,...t.axisX},axisY:{...n.axisY,...t.axisY},legend:{...n.legend,...t.legend},other:{...n.other,...t.other,frame:r((a=t.other)==null?void 0:a.frame)}}}const _f={box:ore,box_binnedDots:cre,box_jitteredDots:hre,binnedDots:gre,jitteredDots:Cre,violin:Bre,violin_binnedDots:Mre,violin_jitteredDots:$re,bar:gI,bar_line:yI,bar_errorbar:jre,stackedBar:Wre,line:wI,line_binnedDots:tae,line_jitteredDots:bI,line_errorbar:sae,errorbar:yI,sina:dae,logo:Sae,dots:vae,curve:wI,curve_dots:bI,heatmap:CI,heatmapClustered:RL,dendro:RL,bins:gI,bubble:CI},Ow=[{value:"ttest",text:"TTest"},{value:"anova",text:"ANOVA"},{value:"wilcoxon",text:"Wilcoxon"},{value:"kruskalWallis",text:"Kruskal-Wallis"}],zL=[{value:"BenjaminiHochberg",text:"Benjamini-Hochberg"},{value:"BenjaminiYekutieli",text:"Benjamini-Yekutieli"},{value:"Bonferroni",text:"Bonferroni"},{value:"Hochberg",text:"Hochberg"},{value:"Holm",text:"Holm"},{value:"Hommel",text:"Hommel"},{value:"none",text:"None"}],OL=[{value:"pValue",text:"p-value"},{value:"significance",text:"significance"}],FL=600,QL=350,jle=400,Ule=250;function jL(e,t,n){var a,i,o,s,c,f;if(((i=(a=e.components)==null?void 0:a.y)==null?void 0:i.selectorStates.length)===0)return[];if(!((s=(o=e.components)==null?void 0:o[n])!=null&&s.selectorStates.length))return["single common group"];const r=(c=e.components)==null?void 0:c[n].selectorStates[0].selectedSource;return((f=t[r])==null?void 0:f.list)??[]}function Gle(e){const t=[];if(e.overall.data.testMethod&&e.overall.validity.testMethod&&t.push({type:"stat",statType:"overall",testMethod:e.overall.data.testMethod}),e.referenceGroup.data.testMethod&&e.referenceGroup.validity.testMethod&&e.referenceGroup.validity.referenceGroup){const n={type:"stat",statType:"referenceGroup",testMethod:e.referenceGroup.data.testMethod,referenceGroup:e.referenceGroup.data.referenceGroup,format:e.referenceGroup.data.format,ns:e.referenceGroup.data.ns};e.referenceGroup.data.correctionMethod!=="none"&&(n.correctionMethod=e.referenceGroup.data.correctionMethod),t.push(n)}if(e.pairwise.data.testMethod&&e.pairwise.validity.testMethod){const n={type:"stat",statType:"pairwise",testMethod:e.pairwise.data.testMethod,format:e.pairwise.data.format,ns:e.pairwise.data.ns};e.referenceGroup.data.correctionMethod!=="none"&&(n.correctionMethod=e.referenceGroup.data.correctionMethod),t.push(n)}return t}function UL(e,t,n,r,a){const i=[],o=r.components.primaryGrouping.selectorStates.length>0,s=r.components.secondaryGrouping.selectorStates.length>0;function c(f,A=!1){return f===null?s?{type:"secondaryGrouping"}:o&&!A?{type:"primaryGrouping"}:{type:"secondaryGrouping"}:f}return e.forEach(f=>{var A;if(f==="box"){const h=t[f];i.push({type:"box",aes:{showOutliers:h.showOutliers,dotShape:h.dotShape,fillColor:c(h.fillColor),lineColor:c(h.lineColor),lineShape:h.lineType,opacity:h.opacity}})}if(f==="binnedDots"){const h=t[f];i.push({type:"binnedDots",aes:{showOutliers:h.showOutliers,fillColor:c(h.fillColor),lineColor:c(h.lineColor),opacity:h.opacity}})}if(f==="jitteredDots"){const h=t[f];i.push({type:"dot",aes:{showOutliers:h.showOutliers,dotFill:c(h.dotFill),dotShape:h.dotShape,lineColor:h.lineColor,opacity:h.opacity}})}if(f==="violin"){const h=t[f];i.push({type:"violin",stat:{trim:h.trim},aes:{showQuartiles:h.showQuartiles,medianLineStyle:h.medianLineStyle,quartilesLineStyle:h.quartilesLineStyle,fillColor:c(h.fillColor),lineColor:c(h.lineColor),lineShape:h.lineType,opacity:h.opacity}})}if(f==="bar"){const h=t[f];i.push({type:"bar",height:h.height,aes:{fillColor:c(h.fillColor),lineColor:c(h.lineColor),opacity:h.opacity}})}if(f==="stackedBar"){const h=t[f];i.push({type:"stackedBar",normalize:h.normalize,aes:{fillColor:c(h.fillColor),lineColor:c(h.lineColor),opacity:h.opacity}})}if(f==="line"){const h=t[f];i.push({type:"line",pointsValues:h.pointsValues,aes:{lineColor:c(h.lineColor,!0),fillColor:c(h.dotFill,!0),lineShape:h.lineType,dotShape:h.dotShape,opacity:h.opacity}})}if(f==="errorbar"){const h=t[f];i.push({type:"errorbar",pointsValues:h.pointsValues,interval:h.interval,aes:{lineColor:c(h.lineColor,!0),fillColor:c(h.dotFill,!0),dotShape:h.dotShape,opacity:h.opacity}})}if(f==="sina"){const h=t[f];i.push({type:"sina",aes:{showOutliers:h.showOutliers,dotFill:c(h.dotFill),dotShape:h.dotShape}})}if(f==="logo"&&s){const h=t[f],g=((A=a.getSourceInfo(r.components.secondaryGrouping.selectorStates[0].selectedSource).spec.domain)==null?void 0:A["pl7.app/alphabet"])==="aminoacid";i.push({type:"logo",normalize:h.normalize,aes:{opacity:h.opacity,dotFill:g?Uae:jae}})}}),o&&!s&&i.push(...Gle(n)),i}function Yle(e,t,n,r){if(e){const a=Qh(t)?t:{column:e.value,range:em},i=[1/0,-1/0];return n.values[e.value].forEach(o=>{const s=Number(o);s<i[0]&&(i[0]=s),s>i[1]&&(i[1]=s)}),{columnName:e,domain:i,range:[a.range.min,a.range.max]}}return Qh(t)?r:t??r}function GL(e,t,n,r){const a=n.find(o=>o.value===e);let i=[1/0,-1/0];if(a){const{range:o,palette:s,midPoint:c,log:f}=t,A=(o==null?void 0:o.minValue)===null||(o==null?void 0:o.minValue)===void 0,h=(o==null?void 0:o.maxValue)===null||(o==null?void 0:o.maxValue)===void 0;if((A||h)&&r.values[a.value].forEach(v=>{const g=Number(v);A&&g<i[0]&&(i[0]=g),h&&g>i[1]&&(i[1]=g)}),A||(i[0]=o==null?void 0:o.minValue),h||(i[1]=o==null?void 0:o.maxValue),c!=null){const v=Math.max(Math.abs(c-i[0]),Math.abs(c-i[1]));i[0]=c-v,i[1]=c+v}return{columnName:a,domain:i,range:Ui[s].colors,type:f?"log":"linear"}}return pi}function YL(e,t,n,r,a,i,o=[],s=L0){var C,b;const c=[];function f(B,E,k,P=!1){var I;if(E.length){const $=E.length?(I=i.getSourceInfo(E[0]))==null?void 0:I.type:void 0,z=$==="String"||!P?{type:"grouping",value:E[0]}:GL(E[0],tm(ov),o,n),O=a[E[0]];return B===null||$==="String"||!P||!PL(O)?z:GL(E[0],O,o,n)}return typeof B=="object"?k:B}const A=r.components.grouping.selectorStates.map(B=>B.selectedSource),h=((C=r.components.shape)==null?void 0:C.selectorStates.map(B=>B.selectedSource))??[],v=(b=r.components.size)==null?void 0:b.selectorStates.map(B=>B.selectedSource)[0],g=v?o.find(B=>B.value===v):void 0;return e.forEach(B=>{if(B==="dots"){const E=t[B];c.push({type:"dots",aes:{dotFill:f(E.dotFill,A,pi,!0),dotShape:f(E.dotShape,h,DA),dotSize:Yle(g,E.dotSize,n,s)}})}if(B==="curve"){const E=t[B];c.push({type:"curve",smoothing:E.smoothing,aes:{lineColor:f(E.lineColor,A,pi,!0)}})}}),c}const Wle=6,Xle=5;function WL(e,t=[]){return e!==null?e:t.length>Wle&&t.some(({label:n})=>n.length>Xle)?"45deg":"center"}function t5(e,t,n=[]){let r={},a={};t==="discrete"&&(r.labelsPosition=WL(e.axisX.labelsRotation,n),r.linesBetweenCategories=e.axisX.linesBetweenCategories,a.scale=e.axisY.scale),(t==="discrete"||t==="scatterplot"||t==="scatterplot-umap")&&(r.showGrid=e.axisX.gridlines,r.showTicks=e.axisX.ticks,a.showGrid=e.axisY.gridlines,a.showTicks=e.axisY.ticks),(t==="scatterplot"||t==="scatterplot-umap")&&(r.scale=e.axisX.scale,a.scale=e.axisY.scale,r.significantLinesStyle=e.axisX.significantLinesStyle,a.significantLinesStyle=e.axisY.significantLinesStyle),t==="histogram"&&(r.scale=e.axisX.scale,a.scale=e.axisY.scale),(t==="heatmap"||t==="bubble")&&(r.axisLabelsAngle=e.axisX.axisLabelsAngle,a.axisLabelsAngle=e.axisY.axisLabelsAngle,r.sorting=e.axisX.sorting,a.sorting=e.axisY.sorting),e.axisY.titleMode!=="auto"&&(a.title=e.axisY.titleMode==="custom"?e.axisY.customTitle:""),e.axisX.titleMode!=="auto"&&(r.title=e.axisX.titleMode==="custom"?e.axisX.customTitle:"");const i={xAxis:r,yAxis:a,frame:{type:e.other.frame},facetSettings:{nCols:e.other.facetColumns}};return(t==="discrete"||t==="scatterplot"||t==="heatmap")&&(i.orientation=e.other.reverse?"horizontal":"vertical",i.facetSettings.sharedX=["x","xy"].includes(e.other.facetSharedBy),i.facetSettings.sharedY=["y","xy"].includes(e.other.facetSharedBy)),t==="histogram"&&(i.groupingDirection=e.other.groupingDirection,i.groupingStack=e.other.groupingStack),i}function R0(e){return JSON.parse(JSON.stringify(e))}function Kle(e,t){if(typeof e>"u")return!0;const n=Object.keys(e);return typeof t>"u"?n.length===0:n.every(r=>t[r])}function XL(e,t,n,r){return(t==null?void 0:t[Ile])==="true"?"subset":r!==void 0?"range":n!==void 0||e==="Int"||e==="String"?"equals":"range"}async function VE(e,t,n=!0){const r=[],a=t.filter(({selectedSource:s})=>"kind"in s&&s.kind==="PColumn"),i=t.filter(({selectedSource:s})=>!("kind"in s&&s.kind==="PColumn")),o=[];for(const{inputName:s,filterType:c,selectedSource:f,selectedFilterValue:A,selectedFilterRange:h,fixedAxes:v}of a){const{name:g,valueType:C,annotations:b,domain:B}=f,E=await e.pFrameProvider.findColumnBy(g,C,d.toRaw(b),d.toRaw(B)),k=s==="filters"||s==="tabBy"||s==="highlight";if(E){const P=await e.pFrameProvider.getColumnSpecById(E),I=P&&v?v.map($=>({axisIdx:$.axisIdx,axisValue:$.axisValue,axisSource:Lr.fromAxisSpec(P==null?void 0:P.axesSpec[$.axisIdx]).toCanonicalString()})):[];if(!k)r.push({inputName:s,selectedSource:E.toCanonicalString(),fixedAxes:I});else{const $=c??XL(C,P==null?void 0:P.annotations,A,h),z=$==="equals"&&typeof A>"u"?(await e.pFrameProvider.getColumnUniqueValues(E))[0]:A,O={min:void 0,max:void 0,...h};r.push({inputName:s,filterType:$,selectedSource:E.toCanonicalString(),selectedFilterValue:z,selectedFilterRange:O,fixedAxes:I})}o.push(...(P==null?void 0:P.axesSpec.map($=>({spec:$,parentColumn:E})))??[])}else console.warn(`Not found column for default option: ${JSON.stringify({inputName:s,selectedSource:f})}`)}for(const{inputName:s,selectedSource:c,filterType:f,selectedFilterValue:A,selectedFilterRange:h}of i){const v=Lr.fromAxisSpec(c),g=v.toCanonicalString(),C=s==="filters"||s==="tabBy"||s==="highlight",b=C?f??XL(v.type,c==null?void 0:c.annotations):void 0,B=o.find(P=>Lr.fromAxisSpec(P.spec).toCanonicalString()===g),E=C&&b==="equals"&&typeof A>"u"&&(B!=null&&B.parentColumn)?(await e.pFrameProvider.getAxisUniqueValues(v,[B==null?void 0:B.parentColumn]))[0]:A,k={min:void 0,max:void 0,...h};if(n||r.push({inputName:s,filterType:b,selectedSource:g,selectedFilterValue:E,selectedFilterRange:k,fixedAxes:[]}),B)r.push({inputName:s,filterType:b,selectedSource:g,selectedFilterValue:E,selectedFilterRange:k,fixedAxes:[]});else{const{spec:P,parentColumn:I}=o.find($=>v.name===$.spec.name&&v.type===$.spec.type&&Kle(v.domain,$.spec.domain))??{};if(P){const $=(s==="filters"||s==="tabBy")&&typeof A>"u"?(await e.pFrameProvider.getAxisUniqueValues(Lr.fromAxisSpec(P),[I]))[0]:A;r.push({inputName:s,filterType:b,selectedSource:Lr.fromAxisSpec(P).toCanonicalString(),selectedFilterValue:$,selectedFilterRange:k,fixedAxes:[]})}}}return r}async function KL(e,t,n){if(!n||n.length===0)return e;const r=await VE(t,n,!1),a=R0(e);return r.forEach(({inputName:i,selectedSource:o,selectedFilterValue:s})=>{e.components[i]&&a.components[i].selectorStates.push({selectedSource:o,type:"equals",selectedFilterValue:s})}),a}const ZL={fillColor:iv,lineColor:pi,dotFill:iv,dotShape:q2,dotSize:L0,lineWidth:ly};function Zle(e,t,n,r){var c;const a=UL(qg[t.template],t.layersSettings,t.statisticsSettings,t.optionsState,r),i=tR(t.chartType,t.template,t.layersSettings,t.statisticsSettings,t.optionsState,r);e.layers=a;const o=t.optionsState.components;if(o.primaryGrouping.selectorStates.length&&e.primaryGrouping){const f=o.primaryGrouping.selectorStates[0].selectedSource,A=i[f];Object.assign(e.primaryGrouping,IL(n,t.dataBindAes[f],f,A)),t.axesSettings.axisX.allowNullPrimaryGroups&&(e.primaryGrouping.allowNullGroup=!0,e.primaryGrouping.order&&(e.primaryGrouping.order=[...e.primaryGrouping.order,"null"]),e.primaryGrouping.inheritedAes&&(e.primaryGrouping.inheritedAes.null=ZL))}if(o.secondaryGrouping.selectorStates&&e.secondaryGrouping){const f=o.secondaryGrouping.selectorStates[0].selectedSource,A=i[f];Object.assign(e.secondaryGrouping,IL(n,t.dataBindAes[f],f,A)),t.axesSettings.axisX.allowNullSecondaryGroups&&(e.secondaryGrouping.allowNullGroup=!0,e.secondaryGrouping.order&&(e.secondaryGrouping.order=[...e.secondaryGrouping.order,"null"]),e.secondaryGrouping.inheritedAes&&(e.secondaryGrouping.inheritedAes.null=ZL))}const s=e.primaryGrouping?(c=n[e.primaryGrouping.columnName.value])==null?void 0:c.options:[];return Object.assign(e,t5(t.axesSettings,t.chartType,s)),e}function Jle(e,t,n,r,a){var C,b,B,E,k;e.layers=YL(rm[n.template],n.layersSettings,t,n.optionsState,n.dataBindAes,r,e==null?void 0:e.grouping);const i=n.optionsState.components.grouping,o=n.optionsState.components.shape;if(i.selectorStates.length||o.selectorStates.length){const P=[...i.selectorStates,...o.selectorStates],I={};P.forEach(({selectedSource:$})=>{I[$]=LL($,a,n.dataBindAes)}),Object.assign(e,{inheritedAes:I})}const s=n.statisticsSettings,c=e.layers.find(P=>P.type==="dots");s.trend.on&&c&&(e.trend={color:(C=c.aes)==null?void 0:C.dotFill,bounded:!1}),Object.assign(e,t5(n.axesSettings,n.chartType));const f=(b=i.selectorStates[0])==null?void 0:b.selectedSource,A=(B=n.optionsState.components.x.selectorStates[0])==null?void 0:B.selectedSource,h=(E=n.optionsState.components.y.selectorStates[0])==null?void 0:E.selectedSource,v=r.getSourceInfo(A),g=r.getSourceInfo(h);if(i.selectorStates.length){const P=r.getSourceInfo(f).annotations;if(P!=null&&P[Nw]&&(JSON.parse(P[Nw])??[]).forEach($=>{const{columnId:z,value:O}=$;z&&v.kind==="column"&&v.type===z.valueType&&v.name===z.name&&(e.xAxis.significantLines||(e.xAxis.significantLines=[]),e.xAxis.significantLines.push(Number(O))),z&&g.kind==="column"&&g.type===z.valueType&&g.name===z.name&&(e.yAxis.significantLines||(e.yAxis.significantLines=[]),e.yAxis.significantLines.push(Number(O)))}),P!=null&&P[Jg]){const I=JSON.parse(P[Jg]),{mapping:$={},name:z=""}=I;e.layers.forEach(te=>{te.type==="dots"&&(te.aes||(te.aes={}),te.aes.dotFill={type:"grouping",value:f})});const O=[...Object.entries($),["null",ww]],K=((k=Ui[z])==null?void 0:k.colors)??[];e.inheritedAes[f]=O.reduce((te,[le,G])=>{const Q=K[Number(G)]??pi;return te[le]={fillColor:Q,lineColor:Q,dotFill:Q,dotShape:q2,dotSize:L0,lineWidth:ly},te},{})}}return v.annotations&&(v.annotations[dv]&&(e.xAxis.upperValue=Number(v.annotations[dv])),v.annotations[fv]&&(e.xAxis.lowerValue=Number(v.annotations[fv])),v.annotations[Av]&&(e.xAxis.symmetricRange=Number(v.annotations[Av]))),g.annotations&&(g.annotations[dv]&&(e.yAxis.upperValue=Number(g.annotations[dv])),g.annotations[fv]&&(e.yAxis.lowerValue=Number(g.annotations[fv])),g.annotations[Av]&&(e.yAxis.symmetricRange=Number(g.annotations[Av]))),e}const qle=750,ese=450;function tse(e,t,n,r,a){var h,v,g,C;e.layers=YL(rm[n.template],n.layersSettings,t,n.optionsState,n.dataBindAes,r,e==null?void 0:e.grouping,IE);const i=n.optionsState.components.grouping;if(i.selectorStates.length){const b=[...i.selectorStates],B={};b.forEach(({selectedSource:E})=>{B[E]=LL(E,a,n.dataBindAes)}),Object.assign(e,{inheritedAes:B})}Object.assign(e,t5(n.axesSettings,n.chartType));const o=(h=i.selectorStates[0])==null?void 0:h.selectedSource,s=(v=n.optionsState.components.x.selectorStates[0])==null?void 0:v.selectedSource,c=(g=n.optionsState.components.y.selectorStates[0])==null?void 0:g.selectedSource,f=r.getSourceInfo(s),A=r.getSourceInfo(c);if(i.selectorStates.length){const b=r.getSourceInfo(o).annotations;if(b!=null&&b[Nw]&&(JSON.parse(b[Nw])??[]).forEach(E=>{const{columnId:k,value:P}=E;k&&f.kind==="column"&&f.type===k.valueType&&f.name===k.name&&(e.xAxis.significantLines||(e.xAxis.significantLines=[]),e.xAxis.significantLines.push(Number(P))),k&&A.kind==="column"&&A.type===k.valueType&&A.name===k.name&&(e.yAxis.significantLines||(e.yAxis.significantLines=[]),e.yAxis.significantLines.push(Number(P)))}),b!=null&&b[Jg]){const B=JSON.parse(b[Jg]),{mapping:E={},name:k=""}=B;e.layers.forEach($=>{$.type==="dots"&&($.aes||($.aes={}),$.aes.dotFill={type:"grouping",value:o})});const P=[...Object.entries(E),["null",ww]],I=((C=Ui[k])==null?void 0:C.colors)??[];e.inheritedAes[o]=P.reduce(($,[z,O])=>{const K=I[Number(O)]??pi;return $[z]={fillColor:K,lineColor:K,dotFill:K,dotShape:q2,dotSize:L0,lineWidth:ly},$},{})}}return f.annotations&&(f.annotations[dv]&&(e.xAxis.upperValue=Number(f.annotations[dv])),f.annotations[fv]&&(e.xAxis.lowerValue=Number(f.annotations[fv])),f.annotations[Av]&&(e.xAxis.symmetricRange=Number(f.annotations[Av]))),A.annotations&&(A.annotations[dv]&&(e.yAxis.upperValue=Number(A.annotations[dv])),A.annotations[fv]&&(e.yAxis.lowerValue=Number(A.annotations[fv])),A.annotations[Av]&&(e.yAxis.symmetricRange=Number(A.annotations[Av]))),e.size={width:qle,height:ese},e.lassoMode=n.lassoMode,e}function nse(e,t){var o,s;const n={},r=(o=t.dataBindAes[e.valueColumn.value])==null?void 0:o.palette;if((e==null?void 0:e.valueType)!=="discrete"){if(t.template==="heatmapClustered"){const c=t.layersSettings.heatmapClustered;c.disableClusteringX||(e.dendrogramX={fillNA:0,showNodes:!1,hidden:!c.dendrogramX}),c.disableClusteringY||(e.dendrogramY={fillNA:0,position:"right",showNodes:!1,hidden:!c.dendrogramY})}n.colorsList=Ui[r??Fae].colors}else n.colorsList=Ui[r??"bright"].colors;e.aes=n,(s=e.annotations)==null||s.forEach(c=>{var v;const f=c.valueColumn.value,A=(v=t.dataBindAes[f])==null?void 0:v.palette,h=c.type==="discrete"?xI:ov;c.colors=Ui[A??h].colors}),Object.assign(e,t5(t.axesSettings,t.chartType)),t.template==="heatmapClustered"&&(e==null?void 0:e.valueType)!=="discrete"&&(e.facetSettings.sharedX=!1,e.facetSettings.sharedY=!1);const a=t.template,i=t.layersSettings[a];return e.NAValueAs=i.NAValueAs,e.valueType==="continuous"&&i.normalizationDirection&&(e.normalization={method:i.normalizationMethod,direction:i.normalizationDirection}),e}const rse=280;function ase(e,t,n,r,a){var c,f,A,h,v;e.rootPosition="left",e.size={width:FL,height:QL};const i=n.optionsState.components,o=n.layersSettings.dendro,s=e==null?void 0:e.aes;if(s.nodeShape&&typeof s.nodeShape=="object"){const g=(c=i.nodeShape.selectorStates[0])==null?void 0:c.selectedSource,C=LE(g,a,n.dataBindAes,"dotShape");Object.keys(C).length?s.nodeShape.valuesMap=C:s.nodeShape=q2}else typeof o.dotShape=="string"&&(s.nodeShape=o.dotShape);if(s.nodeColor&&typeof s.nodeColor=="object"){const g=(f=i.nodeColor.selectorStates[0])==null?void 0:f.selectedSource,C=LE(g,a,n.dataBindAes,"color");Object.keys(C).length?s.nodeColor.valuesMap=C:s.nodeColor=pi}else typeof o.dotFill=="string"&&(s.nodeColor=o.dotFill);if(s.nodeSize&&typeof s.nodeSize=="object"){const g=(A=i.nodeSize.selectorStates[0])==null?void 0:A.selectedSource;let[C,b]=[1/0,-1/0];t.values[g].forEach(B=>{const E=Number(B);E<C&&(C=E),E>b&&(b=E)}),s.nodeSize.domain=[C,b],s.nodeSize.range=RE(o.dotSize)?[o.dotSize.min,o.dotSize.max]:[em.min,em.max]}else typeof o.dotSize=="number"&&(s.nodeSize=o.dotSize);if(s.lineColor&&typeof s.lineColor=="object"){const g=(h=i.lineColor.selectorStates[0])==null?void 0:h.selectedSource;s.lineColor.valuesMap=LE(g,a,n.dataBindAes,"color")}else typeof o.lineColor=="string"&&(s.lineColor=o.lineColor);if(i.heatmapForSequence.selectorStates.length>0&&(e.heatmapSettings={valueType:"stringSource",aes:{colorsList:Ui.bright.colors}},e.size.maxCellWidth=8),i.heatmapAnnotation.selectorStates.length>0){const g=i.heatmapAnnotation.selectorStates[0].selectedSource,C=r.getSourceInfo(g),b=C.type==="Double"||C.type==="Float"||C.type==="Int"||C.type==="Long"?"continuous":"discrete",B=Ui.bright.colors;let E;const k=(v=a[g])==null?void 0:v.list;k&&(E=k.reduce((P,I,$)=>(P[I]=B[$%B.length],P),{})),e.heatmapSettings={valueType:b,aes:{colorsList:Ui.viridis.colors,colorsMap:E}}}return e.mode=o.mode,e.leavesMode=o.leavesMode,e.showNodesLabels=i.labels.selectorStates.length>0,e.showLeavesLabels=i.labels.selectorStates.length>0,o.showTable&&i.heatmapAnnotation.selectorStates.length===0&&i.heatmapForSequence.selectorStates.length===0&&(e.size.width=rse),e.size.scale=n.chartScale/100,e.legend={show:n.layersSettings.dendro.showLegend??!0},e}function ise(e,t,n){return t.length?{type:"grouping",value:t[0]}:typeof e=="object"?n:e}function ose(e,t,n){const r=t.optionsState.components.grouping;if(r.selectorStates.length){const o=r.selectorStates[0].selectedSource,{inheritedAes:s,order:c}=Ple(o,n,t.dataBindAes);Object.assign(e,{inheritedAes:{[o]:s},groupingOrder:c})}const a=Vle[t.template],i=[];return a.forEach(o=>{if(o==="bins"){const s=t.layersSettings[o];i.push({type:"bins",aes:{opacity:s.opacity,fillColor:ise(s.fillColor,r.selectorStates.map(c=>c.selectedSource),"white")}})}}),e.layers=i,Object.assign(e,t5(t.axesSettings,t.chartType)),e.binsCount=t.axesSettings.other.binsCount,e}const JL=40,lse=JL/2-2,sse=3;function use(e,t){var i;const n=t.template,r=t.layersSettings[n],a=(i=t.dataBindAes[e.valueColor.value])==null?void 0:i.palette;return e.aes={cellStrokeColor:r.strokeColor??pi,colorsList:Ui[a??ov].colors,maxRadius:lse*(t.chartScale/100),minRadius:sse},e.size={cellSize:JL*(t.chartScale/100)},Object.assign(e,t5(t.axesSettings,t.chartType)),e.NAValueAs=r.NAValueAs,r.normalizationDirection&&(e.normalization={method:r.normalizationMethod,direction:r.normalizationDirection}),e}function cse(e,t=0){return{width:(t>0?jle:FL)*(e/100),height:(t>0?Ule:QL)*(e/100)}}function fse(e,t,n,r){var a,i;if(e!=="scatterplot"&&e!=="scatterplot-umap"&&e!=="discrete"&&e!=="heatmap"&&e!=="histogram"&&e!=="bubble")return{name:"",show:!1};if(r.title.mode==="hidden")return{name:"",show:!1};if(r.title.mode==="custom")return{name:r.title.value,show:!0,position:r.title.position};if(r.title.mode==="auto"){const o=[];return[...((a=t.components)==null?void 0:a.filters.selectorStates)??[],...((i=t.components)==null?void 0:i.tabBy.selectorStates)??[]].forEach(({type:f,selectedSource:A,selectedFilterValue:h})=>{if((!f||f==="equals")&&h){const v=n[A];o.push((v==null?void 0:v.labels[h])??String(h))}}),{name:o.join(", "),show:!0,position:r.title.position}}return{name:"",show:!1}}async function dse(e,t,n,r){if(!e.ready||n===null)return null;try{const a=yw(t.chartType),i=await KL(t.optionsState,n,r);return a.createDataForPlot(n,i)}catch(a){return console.warn("Cant build chart data"),console.warn(a.message),null}}function Ase(e,t,n,r){var o;if(!t.ready||e===null)return null;let a=e.settings;const i=e.data.byColumns;return a.title=fse(r.chartType,r.optionsState,n,r.axesSettings),a.size=cse(r.chartScale,((o=r.optionsState.components)==null?void 0:o.facetBy.selectorStates.length)||0),r.chartType==="discrete"&&(a=Zle(a,r,n,t)),r.chartType==="scatterplot"&&(a=Jle(a,i,r,t,n)),r.chartType==="scatterplot-umap"&&(a=tse(a,i,r,t,n)),r.chartType==="heatmap"&&(a=nse(a,r)),r.chartType==="dendro"&&(a=ase(a,i,r,t,n)),r.chartType==="histogram"&&(a=ose(a,r,n)),r.chartType==="bubble"&&(a=use(a,r)),{settings:a,data:e.data.byColumns}}function qL(e){return e.length<2?[]:e.map(t=>({value:String(t),text:String(t)}))}function eR(e){return e.length<2?[]:e.length>2?Ow.filter(t=>t.value!=="ttest"&&t.value!=="wilcoxon"):Ow}function NE(e){return async()=>{const t=e.value.commonHelpersData.primaryGroups.value;function n(c,f){return f===null||!!c.find(A=>A.value===f)}if(e.value.reactive.chartType!=="discrete")return;const r=e.value.reactive.statisticsSettings,a=eR(t),i=qL(t),o=r.overall.data.testMethod,s=r.referenceGroup.data.referenceGroup;r.overall.validity.testMethod=n(a,o),r.referenceGroup.validity.referenceGroup=n(i,s)}}function hse(e){e.dispatchEvent(new MouseEvent("click"))}function pse(e,t){const n=window.URL||window.webkitURL,r=document.createElement("a");r.download=t,r.rel="noopener",r.href=n.createObjectURL(e),setTimeout(function(){n.revokeObjectURL(r.href)},4e4),setTimeout(function(){hse(r)},0)}function sy(e,t,n){return e.some(r=>{var i;const a=(i=r==null?void 0:r.aes)==null?void 0:i[t];return e5(a)&&a.type===n})}function tR(e,t,n,r,a,i){var c,f,A;const o={};let s=[];if(e==="discrete"){s=["primaryGrouping","secondaryGrouping"];const h=UL(qg[t],n,r,a,i);s.forEach(v=>{var C,b;const g=(b=(C=a.components[v])==null?void 0:C.selectorStates[0])==null?void 0:b.selectedSource;g&&(o[g]={fill:sy(h,"fillColor",v)||sy(h,"dotFill",v),stroke:sy(h,"lineColor",v),dotShape:sy(h,"dotShape",v),lineType:sy(h,"lineShape",v),size:!1})})}if(e==="scatterplot"){const h=a.components.grouping.selectorStates.map(g=>g.selectedSource),v=a.components.shape.selectorStates.map(g=>g.selectedSource);s=[...h,...v],s.forEach(g=>{o[g]={fill:g===h[0],stroke:!1,dotShape:g===v[0],lineType:!1,size:!1}})}if(e==="scatterplot-umap"&&(s=a.components.grouping.selectorStates.map(h=>h.selectedSource),s.forEach(h=>{o[h]={fill:h===s[0],stroke:!1,dotShape:!1,lineType:!1,size:!1}})),e==="dendro"&&(s=[((c=a.components.nodeColor.selectorStates[0])==null?void 0:c.selectedSource)??null,((f=a.components.nodeShape.selectorStates[0])==null?void 0:f.selectedSource)??null,((A=a.components.lineColor.selectorStates[0])==null?void 0:A.selectedSource)??null].filter(v=>v!==null),s.forEach(v=>{o[v]={fill:e5(n.dendro.dotFill)&&n.dendro.dotFill.value===v,stroke:e5(n.dendro.lineColor)&&n.dendro.lineColor.value===v,dotShape:e5(n.dendro.dotShape)&&n.dendro.dotShape.value===v,lineType:!1,size:!1}})),e==="histogram"){const h=a.components.grouping.selectorStates.map(v=>v.selectedSource);h.forEach(v=>{o[v]={fill:v===h[0],stroke:!1,dotShape:!1,lineType:!1,size:!1}})}return o}var vse=Object.defineProperty,mse=(e,t,n)=>t in e?vse(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zE=(e,t,n)=>mse(e,typeof t!="symbol"?t+"":t,n);function gse(e,t){if(e==null)throw Error(t??"Empty (null | undefined) value");return e}function yse(e,t){if(e===void 0)throw Error(t??"Undefined value");return e}function wse(e=void 0){return e}function bse(e){return e}function Cse(e){return[...new Set(e)]}function Sse(e,t){if(e==null)throw Error(t??"Empty (null | undefined) value")}function xse(e,t){if(e===void 0)throw Error(t??"Undefined value")}function Ese(e,t,n){const r=Math.min(t,n),a=Math.max(t,n);return e>=r&&e<=a}function Bse(e){return e.map(t=>({text:String(t),value:t}))}function _se(e){return function(...t){const n=e(...t);async function r(a){return a.done?Promise.resolve(a.value):Promise.resolve(a.value).then(i=>r(n.next(i))).catch(i=>r(n.throw(i)))}try{return r(n.next())}catch(a){return Promise.reject(a instanceof Error?a:Error(String(a)))}}}class Tse{constructor(){zE(this,"promise"),zE(this,"resolve",()=>{}),zE(this,"reject",()=>{}),this.promise=new Promise((t,n)=>{this.resolve=t,this.reject=n})}}function OE(e){return new Promise(t=>setTimeout(t,e))}function kse(){return new Promise(e=>queueMicrotask(e))}function Mse(){const e=new Date().getTime();return function(){return new Date().getTime()-e}}function Pse(){const e=performance.now();return function(){return performance.now()-e}}function Hse(e){return e()}function Dse(e,t,n){return t>e?t:e>n?n:e}function $se(e,t){return t(e)}function Ise(e,t){if(e!=null)return t(e)}function Lse(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e))+e}function*nR(e,t,n=1){for(let r=e;r<t;r+=n)yield r}function rR(e){const t=[];for(const n of e)t.push(n);return t}function Rse(e,t){return rR(nR(0,e)).map(t)}let Vse=class{constructor(t){this._delay=t}async*generate(){let t=0;for(;;)await OE(this._delay),yield t++}async*[Symbol.asyncIterator](){let t=0;for(;;)await OE(this._delay),yield t++}};function Nse(e,t){return Array.from({length:e},(n,r)=>t(r))}function zse(e,t){throw Error(t)}function Ose(e){return t=>e[t]()}function Fse(e){if(e&&e.ok)return e.value}function Qse(e){if(e&&!e.ok)return e.error}function jse(e){if(e.ok)return e.value;throw Error(e.error)}function Use(e){return Array.isArray(e)?e:[e]}async function Gse(e){return Object.fromEntries(await Promise.all(Object.entries(e).map(async([t,n])=>[t,await n])))}function Yse(e,t){return Object.keys(t).every(n=>e[n]===t[n])}const Wse=e=>e;function Xse(e){return e}function Kse(e){return Object.entries(e).map(([t,n])=>({key:t,value:n}))}const uy=Object.freeze(Object.defineProperty({__proto__:null,Deferred:Tse,Interval:Vse,alike:Yse,arrayFrom:Nse,asConst:Xse,async:_se,between:Ese,bool:bse,call:Hse,checkIfDefined:xse,checkIfNotEmpty:Sse,clamp:Dse,delay:OE,errorOptional:Qse,exhaustive:zse,flatValue:Use,identity:Wse,listToOptions:Bse,match:Ose,notEmpty:gse,notUndef:yse,okOptional:Fse,performanceTimer:Pse,randomInt:Lse,range:nR,resolveAwaited:Gse,tap:$se,tapIf:Ise,tear:kse,timer:Mse,times:Rse,toList:rR,undef:wse,unionize:Kse,uniqueValues:Cse,unwrap:jse},Symbol.toStringTag,{value:"Module"})),cy=Array.isArray;function Fw(e){return e!==null&&typeof e=="object"}function n5(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null}function Zse(e,t){return Object.keys(e).map(n=>t(e[n],n))}function aR(e){return Object.values(e).reduce((t,n)=>n!==void 0?t+1:t,0)}function Qw(e,t){if(!(Fw(e)&&Fw(t)))return e===t;if(cy(e)&&cy(t))return e.length!==t.length?!1:[...e.keys()].every(n=>Qw(e[n],t[n]));if(n5(e)&&n5(t))return aR(e)!==aR(t)?!1:Object.keys(e).every(n=>Qw(e[n],t[n]));throw Error(`Cannot compare a ${String(e)} and b ${String(t)}`)}const Jse=Qw;function jw(e){if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++)t[n]=jw(e[n]);return t}else if(n5(e)){const t={};return Object.keys(e).forEach(n=>{t[n]=jw(e[n])}),t}else return e}function qse(e){return Array.isArray(e)?Object.assign([],e):Fw(e)?Object.assign({},e):e}function eue(e,t){const n={};for(const r in t)t[r]!==e[r]&&(n[r]=e[r]);return n}function tue(e){return Object.entries(e).forEach(([t,n])=>{n instanceof Function&&(e[t]=n.bind(e))}),e}function nue(e,t,n){return e[t]=n,e}function rue(e,t){return e[t]}function aue(e,t){e={...e};const n=e[t];return delete e[t],[n,e]}function iue(e,...t){return Object.assign({},...t.map(n=>({[n]:e[n]})))}function oue(e,...t){return t.map(n=>e[n])}function lue(e,...t){const n=Object.assign({},e);return t.forEach(r=>delete n[r]),n}function iR(e,t){return new Set([...Object.keys(e),...Object.keys(t)]).forEach(n=>{const r=e[n],a=t[n];n5(r)&&n5(a)||cy(r)&&cy(a)&&r.length===a.length?iR(r,a):e[n]=a}),e}const sue=Object.freeze(Object.defineProperty({__proto__:null,bindMethods:tue,deepClone:jw,deepEqual:Jse,deepPatch:iR,getProp:rue,isArray:cy,isJsonEqual:Qw,isNonPrimitive:Fw,isPlainObject:n5,map:Zse,omit:lue,pick:iue,pickValues:oue,setProp:nue,shallowClone:qse,shallowDiff:eue,shiftProp:aue},Symbol.toStringTag,{value:"Module"})),uue=["primaryGrouping","secondaryGrouping","grouping","shape","nodeColor","nodeShape","lineColor","heatmapAnnotation","filters","highlight","tabBy"];function cue(e,t){const n=R0(mI(e));if((t==null?void 0:t.type)!==e)return n;const r=R0(t);return{...n,...r,components:{...n.components,...r.components}}}function FE(e,t){return d.reactive({chartType:t,optionsState:cue(t,e.optionsState),dataStateKey:jw(e.dataStateKey),template:Lle(e.template,t),statisticsSettings:Nle(t,e.statisticsSettings),layersSettings:Ole(e.layersSettings),axesSettings:Qle(t,e.axesSettings),dataBindAes:R0(e.dataBindAes??{}),chartScale:e.zoomState??100,lassoMode:!1,currentTab:e.currentTab===void 0?"dataMapping":e.currentTab,dendroInfoByClick:null,dendroSelectedNodeId:null,showTooltipHint:!1})}function fue(e,t,n,r,a,i,o){return{reactive:e,loading:d.reactive({initialInputGuide:!0,initialCharts:!0,initialDefaults:!0,inputGuide:!1,chartData:!1,dendroTableData:!1}),commonHelpersData:{primaryGroups:d.computed(()=>jL(e.optionsState,i.value,"primaryGrouping")),secondaryGroups:d.computed(()=>jL(e.optionsState,i.value,"secondaryGrouping")),usedAesInMapping:d.computed(()=>tR(e.chartType,e.template,e.layersSettings,e.statisticsSettings,e.optionsState,n.value)),dendroTableData:a},controller:yw(e.chartType),columnsDataStore:t,inputGuide:n,chartData:r,uniqueValuesData:i,readonlyInputs:o}}function due(e,t,n,r,a,i,o){const s=FE(e,n),c=yw(s.chartType),f=d.ref(yw(s.chartType).getEmptyInputGuide(s.optionsState)),A=d.ref(null),h=d.ref({}),v=d.ref(null),g=d.computed(()=>fue(s,d.toRaw(t.value),f,A,v,h,o));d.watch([()=>t.value,()=>r.value],async([B,E])=>{if(!E||!B||!g.value.loading.initialDefaults)return;g.value.loading.initialDefaults=!1,g.value.loading.initialInputGuide=!0;const k=R0(s.optionsState.components),P=E.filter($=>{var z;return((z=s.optionsState.components[$.inputName])==null?void 0:z.selectorStates.length)===0||(o==null?void 0:o.includes($.inputName))});if(P.length===0)return;P.forEach($=>{k[$.inputName].selectorStates=[]});const I=await VE(B,P);for(const{inputName:$,selectedSource:z,filterType:O,selectedFilterValue:K,selectedFilterRange:te,fixedAxes:le}of I)k[$].selectorStates.push({selectedSource:z,type:O,selectedFilterValue:K,selectedFilterRange:te,fixedAxes:le});s.optionsState.components={...s.optionsState.components,...k}},{immediate:!0});const C=d.ref(0);d.watch([()=>s.optionsState,()=>t.value,()=>a.value],async([B,E,k])=>{C.value++;const P=C.value;g.value.loading.inputGuide=!0;const I=E&&k?(await VE(E,k,!1)).map(K=>K.selectedSource):[],$=E?await c.calculateOptions(d.toRaw(E),B,I,i):c.getEmptyInputGuide(B),z=[];uue.forEach(K=>{const te=s.optionsState.components[K];if(te)for(const{selectedSource:le}of te.selectorStates){const G=$.getSourceInfo(le);K==="filters"||K==="highlight"?(G.type==="String"||G.type==="Int"||G.type==="Long")&&z.push(le):K==="grouping"?G.type==="String"&&z.push(le):z.push(le)}}),[...$.freeOptionsSet].forEach(K=>{var le,G,Q;const te=$.getSourceInfo(K);te.kind==="axis"&&((le=te.annotations)!=null&&le[zw])&&((G=te.annotations)==null?void 0:G[zw])!=="homogeneous"&&((Q=te.annotations)==null?void 0:Q[zw])!=="homogenous"&&z.push(K)}),[...$.axesToBeFixedSet].forEach(K=>{z.push(K)});const O={};for(const K of z)if(E&&!h.value[K]){const te=await c.getUniqueSourceValuesWithLabels(E,$,K);if(!te.length)continue;te.sort((le,G)=>le.label.localeCompare(G.label,"en",{numeric:!0})),O[K]={list:te.map(le=>le.value),options:te,labels:te.reduce((le,G)=>(le[G.value]=G.label,le),{})}}h.value={...h.value,...O},P===C.value&&(f.value=$,g.value.loading.inputGuide=!1,g.value.loading.initialInputGuide=!1)},{immediate:!0,deep:!0});const b=d.ref(0);if(d.watch(()=>f.value,async B=>{b.value++;const E=b.value;g.value.loading.chartData=!0;const k=await dse(B,s,d.toRaw(t.value),a.value);E===b.value&&(A.value=k,B.ready&&(g.value.loading.initialCharts=!1),g.value.loading.chartData=!1)},{immediate:!0,deep:!0}),s.chartType==="dendro"){const B=d.ref(0);d.watch([()=>s.optionsState,()=>t.value,()=>f.value.readyData,()=>a.value],async([E,k,P,I])=>{if(P&&k){B.value++;const $=B.value;g.value.loading.dendroTableData=!0;const z=await KL(E,k,I),O=await c.createTableData(k,z);B.value===$&&(v.value=O),g.value.loading.dendroTableData=!1}},{immediate:!0})}return d.provide(j$,g),g}function Tr(){return vte(d.inject(j$),"Empty store")}const Aue={class:"template-list"},hue=["onClick"],pue=["onClick"],vue=["onClick"],mue=["onClick"],gue=d.defineComponent({__name:"TemplateForm",setup(e){const t=Tr(),n=Object.entries(qg).map(([A,h])=>({id:A,text:h.map(v=>LA[v]).join(" + "),icon:_f[A]})),r=Object.entries(rm).map(([A,h])=>({id:A,text:h.map(v=>LA[v]).join(" + "),icon:_f[A]})),a=Object.entries(VL).map(([A,h])=>({id:A,text:h.map(v=>LA[v]).join(" + "),icon:_f[A]})),i=[{id:"heatmap",text:"Heatmap",icon:_f.heatmap},{id:"heatmapClustered",text:"Heatmap + Dendro",icon:_f.heatmapClustered}],o=[{id:"dendro",text:"Dendrogram",icon:_f.dendro}],s=[{id:"bins",text:"Histogram",icon:_f.bar}],c=[{id:"bubble",text:"Bubble plot",icon:_f.bubble}];function f(A){t.value.reactive.template=A}return(A,h)=>(d.openBlock(),d.createElementBlock("div",{class:"template-form",onClick:h[0]||(h[0]=v=>v.stopPropagation())},[h[8]||(h[8]=d.createElementVNode("div",{class:"template-title"},[d.createElementVNode("h3",null," Template ")],-1)),d.createElementVNode("div",Aue,[d.unref(t).reactive.chartType==="discrete"?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(n),({id:v,text:g,icon:C})=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["template-item",{selected:d.unref(t).reactive.template===v}]),onClick:b=>f(v)},[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(C))),d.createTextVNode(" "+d.toDisplayString(g)+" ",1),h[1]||(h[1]=d.createElementVNode("div",{class:"checkmark"},null,-1))],10,hue))),256)):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="scatterplot"?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:1},d.renderList(d.unref(r),({id:v,text:g,icon:C})=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["template-item",{selected:d.unref(t).reactive.template===v}]),onClick:b=>f(v)},[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(C))),d.createTextVNode(" "+d.toDisplayString(g)+" ",1),h[2]||(h[2]=d.createElementVNode("div",{class:"checkmark"},null,-1))],10,pue))),256)):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="scatterplot-umap"?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:2},d.renderList(d.unref(a),({id:v,text:g,icon:C})=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["template-item",{selected:d.unref(t).reactive.template===v}]),onClick:b=>f(v)},[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(C))),d.createTextVNode(" "+d.toDisplayString(g)+" ",1),h[3]||(h[3]=d.createElementVNode("div",{class:"checkmark"},null,-1))],10,vue))),256)):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="heatmap"?(d.openBlock(),d.createElementBlock(d.Fragment,{key:3},d.renderList(i,({id:v,text:g,icon:C})=>d.createElementVNode("div",{class:d.normalizeClass(["template-item",{selected:d.unref(t).reactive.template===v}]),onClick:b=>f(v)},[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(C))),d.createTextVNode(" "+d.toDisplayString(g)+" ",1),h[4]||(h[4]=d.createElementVNode("div",{class:"checkmark"},null,-1))],10,mue)),64)):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="dendro"?(d.openBlock(),d.createElementBlock(d.Fragment,{key:4},d.renderList(o,({text:v,icon:g})=>d.createElementVNode("div",{class:d.normalizeClass(["template-item",{selected:!0}])},[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(g))),d.createTextVNode(" "+d.toDisplayString(v)+" ",1),h[5]||(h[5]=d.createElementVNode("div",{class:"checkmark"},null,-1))])),64)):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="histogram"?(d.openBlock(),d.createElementBlock(d.Fragment,{key:5},d.renderList(s,({text:v,icon:g})=>d.createElementVNode("div",{class:d.normalizeClass(["template-item",{selected:!0}])},[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(g))),d.createTextVNode(" "+d.toDisplayString(v)+" ",1),h[6]||(h[6]=d.createElementVNode("div",{class:"checkmark"},null,-1))])),64)):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="bubble"?(d.openBlock(),d.createElementBlock(d.Fragment,{key:6},d.renderList(c,({text:v,icon:g})=>d.createElementVNode("div",{class:d.normalizeClass(["template-item",{selected:!0}])},[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(g))),d.createTextVNode(" "+d.toDisplayString(v)+" ",1),h[7]||(h[7]=d.createElementVNode("div",{class:"checkmark"},null,-1))])),64)):d.createCommentVNode("",!0)])]))}});function oR(e,t,n,r,a){return d.computed({get(){return e.value.components[t].selectorStates.map(i=>i.selectedSource)},set(i){if(!r)return;const o=i.map(s=>{const c=e.value.components[t].selectorStates.find(f=>f.selectedSource===s);if(c)return c;{const f=a.value.getSourceInfo(s),A=f.kind==="column"?f.axesToBeFixed.map(h=>{var C,b;const v=a.value.axesToBeFixedSet.has(h);let g;if(v)for(const{selectorStates:B}of Object.values(e.value.components)){for(const E of B){const k=(b=(C=E.fixedAxes)==null?void 0:C.find(P=>P.axisSource===h&&P.axisValue!==void 0))==null?void 0:b.axisValue;if(k){g=k;break}}if(g)break}return{axisSource:h,axisIdx:f.axesToBeFixedIndexes[h],axisValue:g}}):[];return f.isSubsetFilter?{selectedSource:s,type:"subset",fixedAxes:A}:f.isDiscreteFilter?{selectedSource:s,type:"equals",selectedFilterValue:void 0,fixedAxes:A}:{selectedSource:s,type:"range",selectedFilterRange:{min:void 0,max:void 0},fixedAxes:A}}});e.value=n.changeSelected(t,r,e.value,o)}})}function lR(e,t,n,r,a){return d.computed({get(){return e.value.components[t].selectorStates.map(i=>i.selectedSource)},set(i){if(!r)return;const o=i.map(s=>{const c=e.value.components[t].selectorStates.find(f=>f.selectedSource===s);if(c)return c;{const f=a.value.getSourceInfo(s),A=f.kind==="column"?f.axesToBeFixed.map(h=>{var C,b;const v=a.value.axesToBeFixedSet.has(h);let g;if(v)for(const{selectorStates:B}of Object.values(e.value.components)){for(const E of B){const k=(b=(C=E.fixedAxes)==null?void 0:C.find(P=>P.axisSource===h&&P.axisValue!==void 0))==null?void 0:b.axisValue;if(k){g=k;break}}if(g)break}return{axisSource:h,axisIdx:f.axesToBeFixedIndexes[h],axisValue:g}}):[];return{selectedSource:s,fixedAxes:A}}});e.value=n.changeSelected(t,r,e.value,o)}})}function sR(e,t,n,r){return d.computed({get(){var a;return((a=e.value.components[t].selectorStates.map(i=>i.selectedSource))==null?void 0:a[0])??void 0},set(a){r&&(e.value=n.changeSelected(t,r,e.value,typeof a>"u"?[]:[{selectedSource:a}]))}})}function yue(e,t,n){const r=e.options.map(i=>({text:t(i.value).label,value:i.value}));return n.selectorStates.map(i=>i.selectedSource).forEach(i=>{const o=t(i),s=e.stateConsistency[i]===!1;r.unshift({text:s?"Inconsistent value":o.label,value:i})}),r.sort((i,o)=>i.text>o.text?1:-1)}function uR(e,t){return Object.keys(e.components).reduce((n,r)=>(n[r]=yue(t.value.components[r],t.value.getSourceInfo,e.components[r]),n),{})}function QE(e,t){if(!e.value.readyData)return[];const n=new Set;return t.forEach(r=>{e.value.components[r].options.forEach(({value:i})=>{n.add(i)})}),[...n].map(r=>({id:r,info:e.value.getSourceInfo(r)})).sort((r,a)=>r.info.label.localeCompare(a.info.label))}function wue(e,t){return QE(e,t).filter(({info:n})=>n.kind!=="axis"||!n.mustBeConsumed)}function bue(e,t){return QE(e,t).filter(({info:n})=>n.kind==="axis"&&n.mustBeConsumed)}function cR(e,t){return Object.values(t.components[e].stateConsistency).some(n=>!n)}function r5(e,t){return cR(e,t)?" ":""}function Cue(e){var n;const t=(n=e==null?void 0:e[zw])==null?void 0:n.toLowerCase();return!!t&&t!=="homogenous"&&t!=="homogeneous"}function fR(e,t,n){return n.reduce((r,a)=>{var A;const i=e.getSourceInfo(a),s=[...Object.keys(e.components).filter(h=>e.components[h].options.find(v=>v.value===a))],c=Object.values(e.components).some(({stateConsistency:h})=>h[a]===!1),f=(((A=t[a])==null?void 0:A.options)??[]).sort((h,v)=>h.label>v.label?1:-1).map(h=>h.label);return r[a]={id:a,title:c?"Inconsistent value":i.label,type:i.type,nonHomogenous:i.kind==="axis"&&Cue(i.annotations),isSubsetFilter:i.isSubsetFilter,isDiscreteFilter:i.isDiscreteFilter,availableBasketIds:new Set(s),uniqueValues:f,axesToBeFixed:i.kind==="column"?i.axesToBeFixed:[],axesToBeFixedInfo:i.kind==="column"?i.axesToBeFixed.reduce((h,v)=>{const g=e.getSourceInfo(v);return h[v]={title:g.label,type:g.type,idx:i.axesToBeFixedIndexes[v]},h},{}):{}},r},{})}const jE=`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
27
|
+
}`;var Wr=NS(function(){return na(Te,xn+"return "+Dt).apply(n,Ve)});if(Wr.source=Dt,Ch(Wr))throw Wr;return Wr}function $P(w){return xi(w).toLowerCase()}function i6(w){return xi(w).toUpperCase()}function IP(w,_,N){if(w=xi(w),w&&(N||_===n))return $t(w);if(!w||!(_=Jo(_)))return w;var re=ci(w),ve=ci(_),Te=_a(re,ve),Ve=ul(re,ve)+1;return Su(re,Te,Ve).join("")}function o6(w,_,N){if(w=xi(w),w&&(N||_===n))return w.slice(0,r0(w)+1);if(!w||!(_=Jo(_)))return w;var re=ci(w),ve=ul(re,ci(_))+1;return Su(re,0,ve).join("")}function VS(w,_,N){if(w=xi(w),w&&(N||_===n))return w.replace(ta,"");if(!w||!(_=Jo(_)))return w;var re=ci(w),ve=_a(re,ci(_));return Su(re,ve).join("")}function LP(w,_){var N=le,re=G;if(nl(_)){var ve="separator"in _?_.separator:ve;N="length"in _?Nr(_.length):N,re="omission"in _?Jo(_.omission):re}w=xi(w);var Te=w.length;if(Id(w)){var Ve=ci(w);Te=Ve.length}if(N>=Te)return w;var Fe=N-ef(re);if(Fe<1)return re;var Je=Ve?Su(Ve,0,Fe).join(""):w.slice(0,Fe);if(ve===n)return Je+re;if(Ve&&(Fe+=Je.length-Fe),X3(ve)){if(w.slice(Fe).search(ve)){var _t,Et=Je;for(ve.global||(ve=os(ve.source,xi(On.exec(ve))+"g")),ve.lastIndex=0;_t=ve.exec(Et);)var Dt=_t.index;Je=Je.slice(0,Dt===n?Fe:Dt)}}else if(w.indexOf(Jo(ve),Fe)!=Fe){var Kt=Je.lastIndexOf(ve);Kt>-1&&(Je=Je.slice(0,Kt))}return Je+re}function RP(w){return w=xi(w),w&&lo.test(w)?w.replace(Er,aA):w}var VP=U(function(w,_,N){return w+(N?" ":"")+_.toUpperCase()}),l6=V("toUpperCase");function s6(w,_,N){return w=xi(w),_=N?n:_,_===n?pp(w)?sh(w):Zc(w):w.match(_)||[]}var NS=Sr(function(w,_){try{return Jn(w,n,_)}catch(N){return Ch(N)?N:new Qn(N)}}),NP=Gd(function(w,_){return gr(_,function(N){N=Tu(N),Ol(w,N,Rt(w[N],w))}),w});function zP(w){var _=w==null?0:w.length,N=Kn();return w=_?Fr(w,function(re){if(typeof re[1]!="function")throw new Ms(o);return[N(re[0]),re[1]]}):[],Sr(function(re){for(var ve=-1;++ve<_;){var Te=w[ve];if(Jn(Te[0],this,re))return Jn(Te[1],this,re)}})}function OP(w){return u0(Ko(w,h))}function u6(w){return function(){return w}}function FP(w,_){return w==null||w!==w?_:w}var QP=Le(),c6=Le(!0);function wf(w){return w}function f6(w){return lf(typeof w=="function"?w:Ko(w,h))}function jP(w){return au(Ko(w,h))}function UP(w,_){return qa(w,Ko(_,h))}var GP=Sr(function(w,_){return function(N){return Al(N,w,_)}}),YP=Sr(function(w,_){return function(N){return Al(w,N,_)}});function d6(w,_,N){var re=lu(_),ve=dl(_,re);N==null&&!(nl(_)&&(ve.length||!re.length))&&(N=_,_=w,w=this,ve=dl(_,lu(_)));var Te=!(nl(N)&&"chain"in N)||!!N.chain,Ve=b0(w);return gr(ve,function(Fe){var Je=_[Fe];w[Fe]=Je,Ve&&(w.prototype[Fe]=function(){var _t=this.__chain__;if(Te||_t){var Et=w(this.__wrapped__),Dt=Et.__actions__=yo(this.__actions__);return Dt.push({func:Je,args:arguments,thisArg:w}),Et.__chain__=_t,Et}return Je.apply(w,sl([this.value()],arguments))})}),w}function WP(){return va._===this&&(va._=v1),this}function A6(){}function zS(w){return w=Nr(w),Sr(function(_){return sf(_,w)})}var h6=Wt(Fr),XP=Wt(_s),KP=Wt(Kc);function vg(w){return sn(w)?q(Tu(w)):bn(w)}function mg(w){return function(_){return w==null?n:po(w,_)}}var ZP=wo(),JP=wo(!0);function p6(){return[]}function v6(){return!1}function qP(){return{}}function eH(){return""}function tH(){return!0}function OS(w,_){if(w=Nr(w),w<1||w>ae)return[];var N=fe,re=Ki(w,fe);_=Kn(_),w-=fe;for(var ve=et(re,_);++N<w;)_(N);return ve}function nH(w){return Qr(w)?Fr(w,Tu):Ha(w)?[w]:yo(r2(xi(w)))}function rH(w){var _=++yc;return xi(w)+_}var aH=Mt(function(w,_){return w+_},0),iH=Pa("ceil"),oH=Mt(function(w,_){return w/_},1),lH=Pa("floor");function sH(w){return w&&w.length?Hs(w,wf,Js):n}function uH(w,_){return w&&w.length?Hs(w,Kn(_,2),Js):n}function cH(w){return A1(w,wf)}function fH(w,_){return A1(w,Kn(_,2))}function dH(w){return w&&w.length?Hs(w,wf,Tl):n}function AH(w,_){return w&&w.length?Hs(w,Kn(_,2),Tl):n}var hH=Mt(function(w,_){return w*_},1),pH=Pa("round"),vH=Mt(function(w,_){return w-_},0);function mH(w){return w&&w.length?at(w,wf):0}function x2(w,_){return w&&w.length?at(w,Kn(_,2)):0}return xe.after=Qe,xe.ary=dt,xe.assign=gf,xe.assignIn=b2,xe.assignInWith=Ip,xe.assignWith=Eh,xe.at=_S,xe.before=Lt,xe.bind=Rt,xe.bindAll=NP,xe.bindKey=It,xe.castArray=yS,xe.chain=d2,xe.chunk=dA,xe.compact=a2,xe.concat=hf,xe.cond=zP,xe.conforms=OP,xe.constant=u6,xe.countBy=tg,xe.create=Lp,xe.curry=rn,xe.curryRight=wn,xe.debounce=Sn,xe.defaults=Rp,xe.defaultsDeep=J3,xe.defer=vl,xe.delay=it,xe.difference=ca,xe.differenceBy=tl,xe.differenceWith=no,xe.drop=Gl,xe.dropRight=ac,xe.dropRightWhile=vh,xe.dropWhile=Yl,xe.fill=Sp,xe.filter=v2,xe.flatMap=rg,xe.flatMapDeep=O9,xe.flatMapDepth=ag,xe.flatten=i2,xe.flattenDeep=v0,xe.flattenDepth=ou,xe.flip=Ue,xe.flow=QP,xe.flowRight=c6,xe.fromPairs=o2,xe.functions=MS,xe.functionsIn=dP,xe.groupBy=y0,xe.initial=l2,xe.intersection=Xm,xe.intersectionBy=pf,xe.intersectionWith=mh,xe.invert=PS,xe.invertBy=AP,xe.invokeMap=G3,xe.iteratee=f6,xe.keyBy=F9,xe.keys=lu,xe.keysIn=yf,xe.map=gA,xe.mapKeys=hP,xe.mapValues=pP,xe.matches=jP,xe.matchesProperty=UP,xe.memoize=lt,xe.merge=vP,xe.mergeWith=HS,xe.method=GP,xe.methodOf=YP,xe.mixin=d6,xe.negate=Ft,xe.nthArg=zS,xe.omit=mP,xe.omitBy=gP,xe.once=Hn,xe.orderBy=Q9,xe.over=h6,xe.overArgs=er,xe.overEvery=XP,xe.overSome=KP,xe.partial=hn,xe.partialRight=tr,xe.partition=Pp,xe.pick=yP,xe.pickBy=DS,xe.property=vg,xe.propertyOf=mg,xe.pull=Ep,xe.pullAll=m0,xe.pullAllBy=gs,xe.pullAllWith=k1,xe.pullAt=No,xe.range=ZP,xe.rangeRight=JP,xe.rearg=Xl,xe.reject=p,xe.remove=Wl,xe.rest=ei,xe.reverse=gh,xe.sampleSize=T,xe.set=e6,xe.setWith=t6,xe.shuffle=L,xe.slice=pA,xe.sortBy=we,xe.sortedUniq=u2,xe.sortedUniqBy=vA,xe.split=PP,xe.spread=M1,xe.tail=L3,xe.take=R3,xe.takeRight=Bp,xe.takeRightWhile=c2,xe.takeWhile=I9,xe.tap=z9,xe.throttle=j9,xe.thru=dd,xe.toArray=w2,xe.toPairs=r4,xe.toPairsIn=$S,xe.toPath=nH,xe.toPlainObject=K9,xe.transform=cg,xe.unary=ZM,xe.union=L9,xe.unionBy=V3,xe.unionWith=N3,xe.uniq=g0,xe.uniqBy=R9,xe.uniqWith=wh,xe.unset=fg,xe.unzip=f2,xe.unzipWith=zo,xe.update=wP,xe.updateWith=IS,xe.values=S2,xe.valuesIn=bP,xe.without=V9,xe.words=s6,xe.wrap=JM,xe.xor=z3,xe.xorBy=qm,xe.xorWith=N9,xe.zip=O3,xe.zipObject=F3,xe.zipObjectDeep=Q3,xe.zipWith=mf,xe.entries=r4,xe.entriesIn=$S,xe.extend=b2,xe.extendWith=Ip,d6(xe,xe),xe.add=aH,xe.attempt=NS,xe.camelCase=RS,xe.capitalize=dg,xe.ceil=iH,xe.clamp=LS,xe.clone=wS,xe.cloneDeep=eP,xe.cloneDeepWith=bS,xe.cloneWith=qM,xe.conformsTo=U9,xe.deburr=Ag,xe.defaultTo=FP,xe.divide=oH,xe.endsWith=a4,xe.eq=P1,xe.escape=hg,xe.escapeRegExp=pg,xe.every=ng,xe.find=kp,xe.findIndex=p0,xe.findKey=Z9,xe.findLast=U3,xe.findLastIndex=AA,xe.findLastKey=q3,xe.floor=lH,xe.forEach=Mp,xe.forEachRight=bh,xe.forIn=ug,xe.forInRight=TS,xe.forOwn=e4,xe.forOwnRight=kS,xe.get=J9,xe.gt=tP,xe.gte=nP,xe.has=t4,xe.hasIn=C2,xe.head=hA,xe.identity=wf,xe.includes=m2,xe.indexOf=T1,xe.inRange=CP,xe.invoke=n4,xe.isArguments=Hp,xe.isArray=Qr,xe.isArrayBuffer=rP,xe.isArrayLike=Is,xe.isArrayLikeObject=ml,xe.isBoolean=ig,xe.isBuffer=w0,xe.isDate=aP,xe.isElement=iP,xe.isEmpty=CS,xe.isEqual=oP,xe.isEqualWith=W3,xe.isError=Ch,xe.isFinite=G9,xe.isFunction=b0,xe.isInteger=og,xe.isLength=lg,xe.isMap=Y9,xe.isMatch=SS,xe.isMatchWith=xS,xe.isNaN=Sh,xe.isNative=lP,xe.isNil=uP,xe.isNull=sP,xe.isNumber=y2,xe.isObject=nl,xe.isObjectLike=gl,xe.isPlainObject=Dp,xe.isRegExp=X3,xe.isSafeInteger=cP,xe.isSet=W9,xe.isString=K3,xe.isSymbol=Ha,xe.isTypedArray=xh,xe.isUndefined=Z3,xe.isWeakMap=sg,xe.isWeakSet=ES,xe.join=vf,xe.kebabCase=xP,xe.last=ku,xe.lastIndexOf=xp,xe.lowerCase=n6,xe.lowerFirst=r6,xe.lt=BS,xe.lte=X9,xe.max=sH,xe.maxBy=uH,xe.mean=cH,xe.meanBy=fH,xe.min=dH,xe.minBy=AH,xe.stubArray=p6,xe.stubFalse=v6,xe.stubObject=qP,xe.stubString=eH,xe.stubTrue=tH,xe.multiply=hH,xe.nth=s2,xe.noConflict=WP,xe.noop=A6,xe.now=Ie,xe.pad=EP,xe.padEnd=BP,xe.padStart=aJ,xe.parseInt=_P,xe.random=SP,xe.reduce=Y3,xe.reduceRight=g2,xe.repeat=TP,xe.replace=kP,xe.result=q9,xe.round=pH,xe.runInContext=Ye,xe.sample=m,xe.size=W,xe.snakeCase=MP,xe.some=ne,xe.sortedIndex=Km,xe.sortedIndexBy=Zm,xe.sortedIndexOf=Kd,xe.sortedLastIndex=yh,xe.sortedLastIndexBy=Jm,xe.sortedLastIndexOf=Zd,xe.startCase=HP,xe.startsWith=a6,xe.subtract=vH,xe.sum=mH,xe.sumBy=x2,xe.template=DP,xe.times=OS,xe.toFinite=yA,xe.toInteger=Nr,xe.toLength=$p,xe.toLower=$P,xe.toNumber=Jd,xe.toSafeInteger=fP,xe.toString=xi,xe.toUpper=i6,xe.trim=IP,xe.trimEnd=o6,xe.trimStart=VS,xe.truncate=LP,xe.unescape=RP,xe.uniqueId=rH,xe.upperCase=VP,xe.upperFirst=l6,xe.each=Mp,xe.eachRight=bh,xe.first=hA,d6(xe,function(){var w={};return Ma(xe,function(_,N){la.call(xe.prototype,N)||(w[N]=_)}),w}(),{chain:!1}),xe.VERSION=r,gr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(w){xe[w].placeholder=xe}),gr(["drop","take"],function(w,_){cr.prototype[w]=function(N){N=N===n?1:ii(Nr(N),0);var re=this.__filtered__&&!_?new cr(this):this.clone();return re.__filtered__?re.__takeCount__=Ki(N,re.__takeCount__):re.__views__.push({size:Ki(N,fe),type:w+(re.__dir__<0?"Right":"")}),re},cr.prototype[w+"Right"]=function(N){return this.reverse()[w](N).reverse()}}),gr(["filter","map","takeWhile"],function(w,_){var N=_+1,re=N==Y||N==ee;cr.prototype[w]=function(ve){var Te=this.clone();return Te.__iteratees__.push({iteratee:Kn(ve,3),type:N}),Te.__filtered__=Te.__filtered__||re,Te}}),gr(["head","last"],function(w,_){var N="take"+(_?"Right":"");cr.prototype[w]=function(){return this[N](1).value()[0]}}),gr(["initial","tail"],function(w,_){var N="drop"+(_?"":"Right");cr.prototype[w]=function(){return this.__filtered__?new cr(this):this[N](1)}}),cr.prototype.compact=function(){return this.filter(wf)},cr.prototype.find=function(w){return this.filter(w).head()},cr.prototype.findLast=function(w){return this.reverse().find(w)},cr.prototype.invokeMap=Sr(function(w,_){return typeof w=="function"?new cr(this):this.map(function(N){return Al(N,w,_)})}),cr.prototype.reject=function(w){return this.filter(Ft(Kn(w)))},cr.prototype.slice=function(w,_){w=Nr(w);var N=this;return N.__filtered__&&(w>0||_<0)?new cr(N):(w<0?N=N.takeRight(-w):w&&(N=N.drop(w)),_!==n&&(_=Nr(_),N=_<0?N.dropRight(-_):N.take(_-w)),N)},cr.prototype.takeRightWhile=function(w){return this.reverse().takeWhile(w).reverse()},cr.prototype.toArray=function(){return this.take(fe)},Ma(cr.prototype,function(w,_){var N=/^(?:filter|find|map|reject)|While$/.test(_),re=/^(?:head|last)$/.test(_),ve=xe[re?"take"+(_=="last"?"Right":""):_],Te=re||/^find/.test(_);ve&&(xe.prototype[_]=function(){var Ve=this.__wrapped__,Fe=re?[1]:arguments,Je=Ve instanceof cr,_t=Fe[0],Et=Je||Qr(Ve),Dt=function(ya){var Oa=ve.apply(xe,sl([ya],Fe));return re&&Kt?Oa[0]:Oa};Et&&N&&typeof _t=="function"&&_t.length!=1&&(Je=Et=!1);var Kt=this.__chain__,xn=!!this.__actions__.length,ir=Te&&!Kt,Wr=Je&&!xn;if(!Te&&Et){Ve=Wr?Ve:new cr(this);var hr=w.apply(Ve,Fe);return hr.__actions__.push({func:dd,args:[Dt],thisArg:n}),new fo(hr,Kt)}return ir&&Wr?w.apply(this,Fe):(hr=this.thru(Dt),ir?re?hr.value()[0]:hr.value():hr)})}),gr(["pop","push","shift","sort","splice","unshift"],function(w){var _=ls[w],N=/^(?:push|sort|unshift)$/.test(w)?"tap":"thru",re=/^(?:pop|shift)$/.test(w);xe.prototype[w]=function(){var ve=arguments;if(re&&!this.__chain__){var Te=this.value();return _.apply(Qr(Te)?Te:[],ve)}return this[N](function(Ve){return _.apply(Qr(Ve)?Ve:[],ve)})}}),Ma(cr.prototype,function(w,_){var N=xe[_];if(N){var re=N.name+"";la.call(Xf,re)||(Xf[re]=[]),Xf[re].push({name:_,func:N})}}),Xf[Ze(n,E).name]=[{name:"wrapper",func:n}],cr.prototype.clone=Bn,cr.prototype.reverse=Ys,cr.prototype.value=Ja,xe.prototype.at=A2,xe.prototype.chain=mA,xe.prototype.commit=h2,xe.prototype.next=p2,xe.prototype.plant=Tp,xe.prototype.reverse=eg,xe.prototype.toJSON=xe.prototype.valueOf=xe.prototype.value=j3,xe.prototype.first=xe.prototype.head,Rl&&(xe.prototype[Rl]=_p),xe},mc=a0();Re?((Re.exports=mc)._=mc,he._=mc):va._=mc}).call(k4)}(dw,dw.exports);var lI=dw.exports;const Zn=Xp(lI);var _ne="pl7.app/axisNature",sI="pl7.app/label",Tne="pl7.app/columnAsAxis/name",kne="pl7.app/columnAsAxis/domain",F2="pl7.app/isSubset",Ng="pl7.app/isDiscreteFilter",Mne="pl7.app/discreteValues",Pne="pl7.app/graph/axis/highCardinality",Hne="pl7.app/graph/isVirtual",uI="pl7.app/isLinkerColumn",Lr=class nw{constructor({type:t,name:n,domain:r}){this.kind="axis",this.type=t,this.name=n,this.domain={...r}}toCanonicalString(){return I1(this)}static fromAxisSpec(t){return new nw({name:t.name,type:t.type,domain:t.domain})}static fromAxesSpec(t){return t.map(n=>nw.fromAxisSpec(n))}copy(){return new nw({type:this.type,name:this.name,domain:this.domain})}toPFrameId(){return{type:this.type,name:this.name,domain:this.domain}}static fromPojo(t){return new nw(t)}},Q2=class ute{constructor({name:t,type:n}){this.kind="column",this.name=t,this.type=n}toCanonicalString(){return I1(this)}static fromPojo(t){return new ute(t)}};function kn(e){return e!==null&&e.kind==="column"}function Aw(e){return e!==null&&e.kind==="axis"}function en(e){const t=JSON.parse(e);if(t.kind==="column")return Q2.fromPojo(t);if(t.kind==="axis")return Lr.fromPojo(t);throw Error("wrong column or axis object")}async function Dne(e,t,n){if(n){const r=await e.pFrameProvider.getTableOuterJoin([t,n],[]),a=r.columnsData[t.toCanonicalString()],i=r.columnsData[n.toCanonicalString()];return a.reduce((o,s,c)=>(o[String(s)]=String(i[c]),o),{})}return null}async function $ne(e,t,n,r){if(r){const{data:a,axesData:i}=await e.pFrameProvider.getSingleColumnData(r);return i[t.toCanonicalString()].reduce((s,c,f)=>(s[String(c)]=String(a[f]),s),{})}return null}async function Ine(e,t,n,r,a,i,o=!0){var s,c,f,A;const h=en(t);if(kn(h)){const v=await e.pFrameProvider.getColumnSpecById(h);if(!v)return;const g=v.axesSpec.map(E=>Lr.fromAxisSpec(E).toCanonicalString()),C=[],b={};o&&g.forEach((E,k)=>{!a.has(E)&&!i.has(E)&&(C.push(E),b[E]=k)});const B={kind:"column",name:v.name,label:n??await Kr(e,t,[]),type:v.valueType,spec:v,annotations:v.annotations,isSubsetFilter:((s=v.annotations)==null?void 0:s[F2])==="true",isDiscreteFilter:v.valueType==="String"||((c=v.annotations)==null?void 0:c[Ng])==="true",axesToBeFixed:C,axesToBeFixedIndexes:b};r.set(h.toCanonicalString(),B);for(const E of v.axesSpec){const P=Lr.fromAxisSpec(E).toCanonicalString();if(r.has(P))continue;const I=AI(E),$={kind:"axis",name:E.name,label:await Kr(e,P,[t]),type:E.type,mustBeConsumed:I,dividable:!1,spec:E,annotations:E.annotations,isSubsetFilter:((f=E.annotations)==null?void 0:f[F2])==="true",isDiscreteFilter:E.type==="String"||((A=E.annotations)==null?void 0:A[Ng])==="true",parentSources:[t]};r.set(P,$)}}}function cI(e){const t=en(e),{name:n,type:r}=t;return kn(t)?{kind:"column",name:"",label:" ",type:t.type,spec:{axesSpec:[],kind:"PColumn",valueType:t.type,name:n},annotations:void 0,isSubsetFilter:!1,isDiscreteFilter:t.type==="String",axesToBeFixed:[],axesToBeFixedIndexes:{}}:{kind:"axis",name:"",label:" ",type:r,spec:{type:r,name:n},mustBeConsumed:!1,dividable:!1,annotations:void 0,isSubsetFilter:!1,isDiscreteFilter:r==="String",parentSources:[]}}function hw(e){return{type:e.type,components:{...e.components},dividedAxes:{...e.dividedAxes}}}function Lne(e){const{selectedSource:t,type:n,selectedFilterRange:r,selectedFilterValue:a}=e,i=en(t);if(!i)throw Error("Empty source selected");if(n==="range"){const o=[];return(r==null?void 0:r.max)!==void 0&&o.push({type:"bySingleColumnV2",column:Aw(i)?{type:"axis",id:i.toPFrameId()}:{type:"column",id:i.name},predicate:{operator:"LessOrEqual",reference:r.max}}),(r==null?void 0:r.min)!==void 0&&o.push({type:"bySingleColumnV2",column:Aw(i)?{type:"axis",id:i.toPFrameId()}:{type:"column",id:i.name},predicate:{operator:"GreaterOrEqual",reference:r==null?void 0:r.min}}),o}else if(n==="subset")return[{type:"bySingleColumnV2",column:Aw(i)?{type:"axis",id:i.toPFrameId()}:{type:"column",id:i.name},predicate:{operator:"Not",operand:{operator:"IsNA"}}}];return typeof a>"u"?[]:[{type:"bySingleColumnV2",column:Aw(i)?{type:"axis",id:i.toPFrameId()}:{type:"column",id:i.name},predicate:{operator:"Equal",reference:i.type==="String"?String(a):Number(a)}}]}function tv(e){const t=[];for(const n of e)t.push(...Lne(n));return t}function fI(e){var t,n,r,a;if("kind"in e&&e.kind==="PColumn"){const s=(n=e.name)!=null?n:(t=e.annotations)==null?void 0:t[Tne],c=(a=e.domain)!=null?a:(r=e.annotations)==null?void 0:r[kne];return I1({name:s,domain:c})}const i=e.name,o=e.domain;return I1({name:i,domain:o})}async function dI(e,t,n){var r;for(const a of n){const i=en(a);if(kn(i)){const o=await e.pFrameProvider.getColumnSpecById(i),s=((r=o==null?void 0:o.axesSpec)!=null?r:[]).find(c=>Lr.fromAxisSpec(c).toCanonicalString()===t.toCanonicalString());if(s)return s}}return null}var Rne="pl7.app/label";async function wa(e,t,n){const r=en(t);if(kn(r))return;async function a(c){const f=await dI(e,c,n);return f?fI(f):null}const i=await e.pFrameProvider.getColumnsFull([],!1,void 0,[Rne]),o=await a(r),s=i.find(({spec:c})=>c&&c.axesSpec.length===1&&fI(c.axesSpec[0])===o);return s?new Q2({name:s.columnId,type:s.spec.valueType}):void 0}async function Kr(e,t,n){var r,a;const i=en(t),o=await wa(e,t,n);let s;if(kn(i)?s=await e.pFrameProvider.getColumnSpecById(o??i):s=o?await e.pFrameProvider.getColumnSpecById(o):await dI(e,i,n),!s)return"";const c=(a=(r=s.annotations)==null?void 0:r[sI])!=null?a:s.name;return e.labelsModifier(s.name,c)}function AI(e){var t,n;const r=(n=(t=e.annotations)==null?void 0:t[_ne])==null?void 0:n.toLowerCase();return!!r&&r!=="homogenous"&&r!=="homogeneous"}function nv(e){var t,n;return((t=e.annotations)==null?void 0:t[F2])==="true"||((n=e.annotations)==null?void 0:n[Ng])==="true",!0}function Vne(e){var t,n;return!e.name.includes("metadata")&&((t=e.annotations)==null?void 0:t[Hne])!=="true"&&((n=e.annotations)==null?void 0:n[F2])!=="true"}async function rv(e){var t;const n=await e.pFrameProvider.getColumns([],!1,void 0,void 0,{[uI]:"true"}),r={};for(const a of n){const i=await e.pFrameProvider.getColumnSpecById(a),o=(t=i==null?void 0:i.axesSpec)!=null?t:[];if(i&&o.length){const[s,c]=o,f=Lr.fromAxisSpec(s).toCanonicalString(),A=Lr.fromAxisSpec(c).toCanonicalString();r[f]||(r[f]={}),r[A]||(r[A]={}),r[f][A]={id:a,spec:i},r[A][f]={id:a,spec:i}}}return r}async function j2(e,t){const n=new Set;for(const r of t){const a=en(r);if(kn(a)){const i=await e.pFrameProvider.getColumnSpecById(a);if(!i)continue;i.axesSpec.forEach(o=>{n.add(Lr.fromAxisSpec(o).toCanonicalString())})}}return n}function Nne(e,t,n){const r={},a=new Set([t]);let i=[t];for(;i.length;){const o=new Set;for(const s of i)if(e[s]){const c=Object.keys(e[s]);for(const f of c)if(r[f]=s,f===n){const A=[];let h=n;for(;r[h]!==t;)A.push(h),h=r[h];return A.push(h),A.map(v=>e[v][r[v]].id)}else a.has(f)||(o.add(f),a.add(f))}i=[...o]}return null}function zne(e,t,n){const r=[...t].map(i=>Nne(e,i,n)).filter(i=>i!==null);if(r.length===0)return[];let a=r[0];for(const i of r)i.length<a.length&&(a=i);return a}async function jc(e,t,n,r,a){const i=en(r);if(!kn(i))return[];const o=await e.pFrameProvider.getColumnSpecById(i);if(!o)return[];const s=o.axesSpec.map(f=>Lr.fromAxisSpec(f).toCanonicalString()).filter(f=>!n.has(f)&&!(a!=null&&a.some(A=>A.axisSource===f))),c=new Set;return s.forEach(f=>{zne(t,n,f).forEach(h=>{c.add(h.toCanonicalString())})}),[...c].map(f=>en(f))}function hI(e,t){const n=t.columnsData[Object.keys(t.columnsData)[0]].length,r=new Int32Array(n).fill(0);for(let a=0;a<n;a++){let i=!1;for(let o=0;o<e.length;o++){const{selectedSource:s,selectedFilterValue:c,selectedFilterRange:f,type:A}=e[o],h=en(s),v=(kn(h)?t.columnsData[s]:t.axesData[s])[a];if(c!==void 0&&(i=i||v===c),f!==void 0&&(f.min!==void 0||f.max!==void 0)&&typeof v=="number"){let g=!0;f.min!==void 0&&(g=g&&v>=f.min),f.max!==void 0&&(g=g&&v<=f.max),i=i||g}A==="subset"&&(i=i||v!=null)}i&&(r[a]=1)}return r}var U2=class{constructor(e,t){this.simpleComponentControllers=e,this.filterComponentControllers=t,this.ignoredOptionIdNames=[],this.dataInputs=[],this.dontAllowUnfilteredHighCardinality=!1}get requiredComponents(){const e=[];for(const t of Object.keys(this.simpleComponentControllers))this.simpleComponentControllers[t].isRequired&&e.push(t);return e}get dimensionsConsumerComponents(){const e=[];for(const t of Object.keys(this.simpleComponentControllers))this.simpleComponentControllers[t].isDimensionsConsumer&&e.push(t);for(const t of Object.keys(this.filterComponentControllers))this.filterComponentControllers[t].isDimensionsConsumer&&e.push(t);return e}addSelected(e,t,n){if(e in this.simpleComponentControllers)return this.simpleComponentControllers[e].addSelected(t,n);if(e in this.filterComponentControllers)return this.filterComponentControllers[e].addSelected(t,n);throw Error(`Unknown input name: ${String(e)}`)}deleteSelected(e,t,n,r){if(e in this.simpleComponentControllers)return this.simpleComponentControllers[e].deleteSelected(n,r.selectedSource);if(e in this.filterComponentControllers)return this.filterComponentControllers[e].deleteSelected(n,r.selectedSource);throw Error(`Unknown input name: ${String(e)}`)}changeSelected(e,t,n,r){const a=n.components[e].selectorStates,i=a.filter(c=>!r.find(f=>f.selectedSource===c.selectedSource)),o=r.filter(c=>!a.find(f=>f.selectedSource===c.selectedSource));let s=hw(n);return i.forEach(c=>{s=this.deleteSelected(e,t,s,c)}),o.forEach(c=>{s=this.addSelected(e,s,c)}),n.components[e].selectorStates=r.map(c=>n.components[e].selectorStates.find(f=>f.selectedSource===c.selectedSource)).filter(Boolean),s}switchDividableAxis(e,t){return hw(e)}async getMustBeConsumedAxes(e,t){return Promise.resolve(new Set)}createEmptyComponentsGuide(e){return Object.fromEntries(Object.entries(e.components).map(([t,n])=>[t,{options:[],optionsInfo:new Map,stateConsistency:{},required:!1,multipleSelectors:!1}]))}async getSelectedSourcesInfo(e,t,n,r){var a;const i=new Map,o=new Set;for(const f of this.dataInputs)for(const A of t.components[f].selectorStates){const h=en(A.selectedSource);if(kn(h)){const v=await e.pFrameProvider.getColumnSpecById(h);v&&v.axesSpec.forEach(g=>o.add(Lr.fromAxisSpec(g).toCanonicalString()))}}const s=new Set;let c=[...o];for(;c.length;){const f=[];for(const A of c)if(r[A]){const h=Object.keys(r[A]);for(const v of h)!s.has(v)&&!o.has(v)&&(f.push(v),s.add(v))}c=f}for(const[f,{selectorStates:A}]of Object.entries(t.components)){const v=((a=this.simpleComponentControllers[f])!=null?a:this.filterComponentControllers[f]).settings.columnsWithExtraAxesAllowed;for(const{selectedSource:g}of A)await Ine(e,g,n[g],i,o,s,v)}return i}getEmptyInputGuide(e){return{components:this.createEmptyComponentsGuide(e),getSourceInfo:t=>cI(t),freeOptionsSet:new Set,axesToBeFixedSet:new Set,readyData:!1,ready:!1,consistent:!0}}getConsumedOptionsSet(e){const t=new Set;for(const n of this.dimensionsConsumerComponents)for(const{selectedSource:r}of e.components[n].selectorStates)t.add(r);return t}async getLabelsMap(e,t){const n=await e.pFrameProvider.getColumnsFull(this.dataInputs.reduce((r,a)=>{const o=t.components[a].selectorStates.map(s=>en(s.selectedSource));return r.concat(o)},[]),!1);return Ene(n,r=>r.spec).reduce((r,a)=>{const i=new Q2({name:a.value.columnId,type:a.value.spec.valueType}).toCanonicalString();return r[i]=a.label,r},{})}async calculateOptions(e,t,n=[],r=Vne){var a,i;const o=this.createEmptyComponentsGuide(t),s=this.getConsumedOptionsSet(t),c=new Set(this.ignoredOptionIdNames),f=new Set(n),A=await rv(e),h=await this.getLabelsMap(e,t),v=await this.getSelectedSourcesInfo(e,t,h,A),g=new Map,C={...this.simpleComponentControllers,...this.filterComponentControllers},b=new Set;for(const[$,z]of Object.entries(C)){const O=await z.getOptions(e,t,h,s,A,r,c,f);this.dataInputs.includes($)||O.options.forEach(K=>{b.add(K.value)});for(const[K,te]of O.optionsInfo)g.set(K,te);o[$]=O}const B=$=>{const z=g.get($);z&&z.kind==="axis"&&(z.mustBeConsumed=!0);const O=v.get($);O&&O.kind==="axis"&&(O.mustBeConsumed=!0)},E=await this.getMustBeConsumedAxes(e,t);for(const $ of E)B($);if(this.dontAllowUnfilteredHighCardinality){const $=O=>{var K;return((K=O==null?void 0:O.annotations)==null?void 0:K[Pne])==="true"},z=(i=(a=t.components.filters)==null?void 0:a.selectorStates.reduce((O,K)=>{const te=v.get(K.selectedSource);return(te==null?void 0:te.kind)==="column"&&te.spec.axesSpec.filter($).forEach(G=>O.add(Lr.fromAxisSpec(G).toCanonicalString())),(te==null?void 0:te.kind)==="axis"&&$(te.spec)&&O.add(Lr.fromAxisSpec(te.spec).toCanonicalString()),O},new Set))!=null?i:new Set;this.dataInputs.forEach(O=>{for(const{selectedSource:K}of t.components[O].selectorStates){const te=v.get(K);if((te==null?void 0:te.kind)==="column"&&te.spec.axesSpec.filter($).forEach(G=>{const Q=Lr.fromAxisSpec(G).toCanonicalString();!b.has(Q)&&!z.has(Q)&&b.add(Q),z.has(Q)||B(Q)}),(te==null?void 0:te.kind)==="axis"&&$(te.spec)){const le=Lr.fromAxisSpec(te.spec).toCanonicalString();b.has(le)||b.add(le),z.has(le)||B(le)}}})}const k=new Set;for(const{selectorStates:$}of Object.values(t.components))for(const{selectedSource:z}of $){const O=v.get(z);O&&O.kind==="column"&&O.axesToBeFixed.forEach(K=>{k.add(K)})}const P=await this.isConsistent(e,t,A),I=$=>{var z,O,K;const te=(z=en($).toCanonicalString())!=null?z:$;return(K=(O=g.get(te))!=null?O:v.get(te))!=null?K:cI($)};return{components:o,getSourceInfo:I,freeOptionsSet:b,axesToBeFixedSet:k,readyData:this.readyDataInputs(t),ready:this.readyForPlotBuilding(e,t,P,b,I),consistent:P}}async getUniqueSourceValuesWithLabels(e,t,n){var r;const a=t.getSourceInfo(n),i=(r=a.annotations)==null?void 0:r[Mne],o=i?JSON.parse(i).map(s=>String(s)):null;if(a.kind==="axis"){const s=en(n),c=a.parentSources.map(en),f=await wa(e,n,a.parentSources),A=o??await e.pFrameProvider.getAxisUniqueValues(s,c),h=await $ne(e,s,c[0],f);return A.map(v=>{var g;return{value:v,label:(g=h==null?void 0:h[v])!=null?g:v}})}if(a.kind==="column"){const s=en(n),c=await wa(e,n,[]),f=await e.pFrameProvider.getColumnUniqueValues(s),A=await Dne(e,s,c);return f.map(h=>{var v;return{value:h,label:(v=A==null?void 0:A[h])!=null?v:h}})}return[]}async checkStateConsistency(e,t,n){const r=new Map;for(const a of Object.keys(this.simpleComponentControllers))r.set(a,await this.simpleComponentControllers[a].checkStateConsistency(e,t,n));for(const a of Object.keys(this.filterComponentControllers))r.set(a,await this.filterComponentControllers[a].checkStateConsistency(e,t,n));return r}async isConsistent(e,t,n){const r=await this.checkStateConsistency(e,t,n);for(const a of r.values())if(Object.values(a).some(i=>!i))return!1;return!0}readyDataInputs(e){return this.dataInputs.every(t=>e.components[t].selectorStates.length>0)}readyForPlotBuilding(e,t,n,r,a){if(!n||!this.readyDataInputs(t))return!1;let i=!1;for(const s of r){const c=a(s);if(c&&c.kind==="axis"&&c.mustBeConsumed){i=!0;break}}let o=!1;for(const{selectorStates:s}of Object.values(t.components)){for(const{selectedSource:c,fixedAxes:f}of s){const A=a(c);if(A&&A.kind==="column"&&A.axesToBeFixed.some(h=>{var v;return((v=(f??[]).find(g=>g.axisSource===h))==null?void 0:v.axisValue)===void 0})){o=!0;break}}if(o)break}return this.requiredComponents.every(s=>t.components[s].selectorStates.length>0)&&!i&&!o}async createDataForPlot(e,t){return{data:await this.createDataByColumns(e,t),settings:await this.createChartSettings(e,t)}}},pI=class cte{constructor({componentName:t,allowedTypes:n,settings:r,strictlyDependsOnParents:a,dependsOn:i=[],parentComponents:o=[],annotations:s={},checkSourceBySpec:c}){this.componentName=t,this.allowedTypes=[...n],this.settings={...cte.DefaultSettings,...r},this.dependsOn=[...i],this.parentComponents=[...o],this.strictlyDependsOnParents=a??!0,this.annotations={...s},c&&(this.checkSourceBySpec=c)}get isRequired(){return this.settings.required}get isDimensionsConsumer(){return this.settings.dimensionConsumer}addSelected(t,n){const r=hw(t);return r.components[this.componentName].selectorStates.push(n),r}deleteSelected(t,n){const r=hw(t);return r.components[this.componentName].selectorStates=r.components[this.componentName].selectorStates.filter(a=>a.selectedSource!==n),r}async checkStateConsistency(t,n,r){const a=n.components[this.componentName],{allowedAxes:i}=await this.getAllowedAxes(t,n,r);function o(c){const f=Lr.fromAxisSpec(c);return i.has(f.toCanonicalString())}const s=await Promise.all(a.selectorStates.map(async({selectedSource:c})=>{const f=en(c);if(kn(f)){const A=await t.pFrameProvider.getColumnSpecById(f);return A?this.parentComponents.length===0?!0:this.strictlyDependsOnParents&&!this.settings.columnsWithExtraAxesAllowed&&!this.settings.isDataComponent?A.axesSpec.every(v=>o(v)):this.settings.columnsWithExtraAxesAllowed&&!this.settings.isDataComponent?A.axesSpec.some(v=>o(v)):i.size===0||A.axesSpec.some(v=>o(v)):!1}return i.has(c)}));return a.selectorStates.reduce((c,f,A)=>(c[f.selectedSource]=s[A],c),{})}async getProducingAxes(t,n){const i=n.components[this.componentName].selectorStates.map(c=>en(c.selectedSource)).filter(c=>kn(c)),o=new Set;return(await Promise.all(i.map(c=>t.pFrameProvider.getColumnSpecById(c)))).forEach(c=>{c&&c.axesSpec.forEach(f=>{o.add(Lr.fromAxisSpec(f).toCanonicalString())})}),o}getParentSelectedSources(t,n){return this.parentComponents.reduce((a,i)=>{const o=n.components[i].selectorStates.map(s=>en(s.selectedSource));return a.push(...o),a},[])}async getParentAxes(t,n){var r;const a=this.getParentSelectedSources(t,n),i=new Set;for(const o of a)if(kn(o)){const s=await t.pFrameProvider.getColumnSpecById(o);(r=s==null?void 0:s.axesSpec)==null||r.forEach(c=>{const f=Lr.fromAxisSpec(c);i.add(f.toCanonicalString())})}return i}async getAllowedAxes(t,n,r){var a,i,o,s,c,f,A;const h=this.getParentSelectedSources(t,n),v=new Set,g=new Set,C=new Set,b=new Map;for(const E of h)if(kn(E)){const k=await t.pFrameProvider.getColumnSpecById(E);for(const P of(a=k==null?void 0:k.axesSpec)!=null?a:[]){const $=Lr.fromAxisSpec(P).toCanonicalString();if(v.has($))continue;v.add($),g.add($);const z=AI(P);b.set($,{kind:"axis",name:P.name,label:await Kr(t,$,[E.toCanonicalString()]),type:P.type,mustBeConsumed:z,dividable:!1,spec:P,annotations:P.annotations,isSubsetFilter:((i=P.annotations)==null?void 0:i[F2])==="true",isDiscreteFilter:P.type==="String"||((o=P.annotations)==null?void 0:o[Ng])==="true",parentSources:[E.toCanonicalString()]})}}let B=[...v];for(;B.length;){const E=[];for(const k of B)if(r[k]){const P=Object.keys(r[k]);for(const I of P)if(!v.has(I)){E.push(I),v.add(I),C.add(I);const{spec:$,id:z}=r[k][I];for(const O of $.axesSpec){const K=Lr.fromAxisSpec(O).toCanonicalString();b.has(K)||b.set(K,{kind:"axis",name:O.name,label:(c=(s=O.annotations)==null?void 0:s[sI])!=null?c:"",type:O.type,mustBeConsumed:!1,dividable:!1,spec:O,annotations:O.annotations,isSubsetFilter:((f=O.annotations)==null?void 0:f[F2])==="true",isDiscreteFilter:O.type==="String"||((A=O.annotations)==null?void 0:A[Ng])==="true",parentSources:[z.toCanonicalString()]})}}}B=E}return{allowedAxes:v,parentAxes:g,linkerAxes:C,optionsInfo:b}}async getOptions(t,n,r,a,i,o,s=new Set,c=new Set){var f,A,h,v,g,C,b,B;const E=this.settings.multipleSelectors,k=this.settings.required,P=await this.checkStateConsistency(t,n,i);if(this.dependsOn.length&&this.dependsOn.some(Q=>n.components[Q].selectorStates.length===0))return{multipleSelectors:E,required:k,stateConsistency:P,options:[],optionsInfo:new Map};if(this.strictlyDependsOnParents&&!this.settings.isDataComponent&&this.parentComponents.some(Q=>n.components[Q].selectorStates.length===0))return{multipleSelectors:E,required:k,stateConsistency:P,options:[],optionsInfo:new Map};const I=this.getParentSelectedSources(t,n),$=(await t.pFrameProvider.getColumns([],!1,this.allowedTypes,void 0,this.annotations)).filter(Q=>!a.has(Q.toCanonicalString())),{allowedAxes:z,parentAxes:O,linkerAxes:K,optionsInfo:te}=await this.getAllowedAxes(t,n,i),le=n.components[this.componentName],G=[];if(this.settings.axesAllowed)for(const Q of O){const j=en(Q),Y=te.get(j.toCanonicalString()),X=this.allowedTypes.includes(Y.spec.type),ee=Object.entries(this.annotations).every(([Ce,De])=>{var ke;return((ke=Y.spec.annotations)==null?void 0:ke[Ce])===De}),pe=this.checkSourceBySpec?this.checkSourceBySpec(Y.spec,n):!0,ae=!this.settings.homogeneous||!(Y!=null&&Y.mustBeConsumed),ge=!a.has(Q),me=s.has(j.name)||c.has(j.toCanonicalString()),fe=le.selectorStates.some(Ce=>Ce.selectedSource===Q);X&&ee&&pe&&ae&&ge&&!me&&!fe&&G.push({value:Q})}if(this.settings.columnsAllowed){const Q=!this.settings.columnsWithExtraAxesAllowed&&this.strictlyDependsOnParents;for(const j of $){const Y=j.toCanonicalString(),X=en(Y),ee=await t.pFrameProvider.getColumnSpecById(X),pe=((f=ee==null?void 0:ee.annotations)==null?void 0:f[uI])==="true";if(!ee||Bne(ee)||pe||this.checkSourceBySpec&&!this.checkSourceBySpec(ee,n)||this.settings.isDataComponent&&!o(ee)||Q&&((A=ee.axesSpec)!=null&&A.some(De=>!z.has(Lr.fromAxisSpec(De).toCanonicalString())))||I.length&&!((h=ee.axesSpec)!=null&&h.some(De=>z.has(Lr.fromAxisSpec(De).toCanonicalString()))))continue;const ae=(g=(v=ee==null?void 0:ee.axesSpec)==null?void 0:v.map(De=>Lr.fromAxisSpec(De).toCanonicalString()))!=null?g:[],ge=[],me={};if(this.settings.columnsWithExtraAxesAllowed&&ae.forEach((De,ke)=>{z.has(De)||(ge.push(De),me[De]=ke)}),ee){const De=(C=r[Y])!=null?C:await Kr(t,j.toCanonicalString(),[]),ke={kind:"column",name:ee.name,label:De,type:ee.valueType,spec:ee,annotations:ee.annotations,isSubsetFilter:((b=ee.annotations)==null?void 0:b[F2])==="true",isDiscreteFilter:ee.valueType==="String"||((B=ee.annotations)==null?void 0:B[Ng])==="true",axesToBeFixed:ge,axesToBeFixedIndexes:me};te.set(X.toCanonicalString(),ke)}const fe=s.has(X.name)||c.has(X.toCanonicalString()),Ce=n.components[this.componentName].selectorStates.some(De=>De.selectedSource===Y);!fe&&!Ce&&G.push({value:Y})}}return{multipleSelectors:E,required:k,stateConsistency:P,options:G,optionsInfo:te}}};pI.DefaultSettings={isDataComponent:!1,multipleSelectors:!1,required:!1,homogeneous:!1,axesAllowed:!1,columnsAllowed:!0,columnsWithExtraAxesAllowed:!0,dimensionConsumer:!1};var En=pI,One={type:"bubble",components:{valueSize:{type:"simple",selectorStates:[]},valueColor:{type:"simple",selectorStates:[]},x:{type:"simple",selectorStates:[]},y:{type:"simple",selectorStates:[]},filters:{type:"filter",selectorStates:[]},tabBy:{type:"filter",selectorStates:[]},facetBy:{type:"simple",selectorStates:[]},tooltipContent:{type:"simple",selectorStates:[]}},dividedAxes:{}};function pw(e,t){if(!t.length)return[];const n=t.map(i=>en(i)),r=Object.values(e.columnsData)[0].length,a=[];for(let i=0;i<r;i++){const o=n.map(s=>{const c=s.toCanonicalString();return kn(s)?e.columnsData[c][i]:e.axesData[c][i]}).join(", ");a.push(o)}return a}var Fne=class extends U2{constructor(){super({valueSize:new En({componentName:"valueSize",allowedTypes:["Int","Long","Double","Float"],strictlyDependsOnParents:!0,parentComponents:["valueColor"],settings:{isDataComponent:!0,columnsAllowed:!0,axesAllowed:!1,required:!0}}),valueColor:new En({componentName:"valueColor",allowedTypes:["Int","Long","Double","Float"],strictlyDependsOnParents:!0,parentComponents:["valueSize"],settings:{isDataComponent:!0,columnsAllowed:!0,axesAllowed:!1,required:!0}}),x:new En({componentName:"x",allowedTypes:["Int","String","Long"],strictlyDependsOnParents:!0,parentComponents:["valueSize","valueColor"],settings:{required:!0,dimensionConsumer:!0,multipleSelectors:!0,axesAllowed:!0,columnsAllowed:!1}}),y:new En({componentName:"y",allowedTypes:["Int","String","Long"],strictlyDependsOnParents:!0,parentComponents:["valueSize","valueColor"],settings:{required:!0,dimensionConsumer:!0,multipleSelectors:!0,axesAllowed:!0,columnsAllowed:!1}}),tooltipContent:new En({componentName:"tooltipContent",allowedTypes:["String","Int","Long","Float","Double"],strictlyDependsOnParents:!0,parentComponents:["valueSize","valueColor"],settings:{columnsAllowed:!0,axesAllowed:!0,multipleSelectors:!0}}),facetBy:new En({componentName:"facetBy",allowedTypes:["String","Int","Long"],strictlyDependsOnParents:!0,parentComponents:["valueSize","valueColor"],settings:{axesAllowed:!0,dimensionConsumer:!0,multipleSelectors:!0}})},{filters:new En({componentName:"filters",allowedTypes:["String","Int","Long","Double","Long"],strictlyDependsOnParents:!0,parentComponents:["valueSize","valueColor"],settings:{columnsAllowed:!0,axesAllowed:!0,dimensionConsumer:!0,multipleSelectors:!0},checkSourceBySpec:nv}),tabBy:new En({componentName:"tabBy",allowedTypes:["String","Int"],strictlyDependsOnParents:!0,parentComponents:["valueSize","valueColor"],settings:{columnsAllowed:!0,axesAllowed:!0,dimensionConsumer:!0}})}),this.dataInputs=["valueSize","valueColor"],this.dontAllowUnfilteredHighCardinality=!0}async getMustBeConsumedAxes(e,t){if(!t.components.valueColor.selectorStates.length)return new Set;const n=t.components.valueColor.selectorStates[0].selectedSource,r=await e.pFrameProvider.getColumnSpecById(en(n));return r?new Set(r.axesSpec.map(a=>Lr.fromAxisSpec(a).toCanonicalString())):new Set}async createDataByColumns(e,t){var n,r,a;const i=(n=t.components.valueColor.selectorStates[0])==null?void 0:n.selectedSource,o=(r=t.components.valueSize.selectorStates[0])==null?void 0:r.selectedSource;if(!i||!o)throw Error("Value column is not valid");const s=en(i),c=en(o);if(!s||!c||!kn(s)&&!kn(c))throw Error("Value column is not valid");const f={type:"columns",id:(a=I1(t.components))!=null?a:"",values:{}},A=await rv(e),h=[...t.components.filters.selectorStates,...t.components.tabBy.selectorStates],v=tv(h),g=h.map(j=>en(j.selectedSource)).filter(kn),C=[s,c].filter(kn),b=C.map(j=>j.toCanonicalString()),B=await j2(e,b),E=[t.components.facetBy,t.components.x,t.components.y,t.components.tooltipContent],k=[],P=C.map(()=>[]),I=[],$=[];for(const{selectedSource:j,fixedAxes:Y}of h)$.push(...await jc(e,A,B,j,Y)),P.push((Y??[]).map(({axisIdx:X,axisValue:ee})=>({idx:X,value:ee})));for(const j of E)for(const{selectedSource:Y,fixedAxes:X}of j.selectorStates){k.push(en(Y)),I.push((X??[]).map(({axisIdx:pe,axisValue:ae})=>({idx:pe,value:ae}))),$.push(...await jc(e,A,B,Y,X));const ee=await wa(e,Y,b);ee&&k.push(ee)}const z=await e.pFrameProvider.getTableOuterJoin([...C,...$,...g],k,v,!0,P,I);k.forEach(j=>{const Y=j.toCanonicalString();f.values[Y]=kn(j)?z.columnsData[Y]:z.axesData[Y]}),f.values[i]=kn(s)?z.columnsData[i]:z.axesData[i],f.values[o]=kn(c)?z.columnsData[o]:z.axesData[o];const O=t.components.x.selectorStates.map(j=>j.selectedSource),K=O.join(", "),te=await Promise.all(O.map(async j=>{var Y,X;return(X=(Y=await wa(e,j,b))==null?void 0:Y.toCanonicalString())!=null?X:j}));f.values[K]=pw(z,O),f.values.xLabels=pw(z,te);const le=t.components.y.selectorStates.map(j=>j.selectedSource),G=le.join(", "),Q=await Promise.all(le.map(async j=>{var Y,X;return(X=(Y=await wa(e,j,b))==null?void 0:Y.toCanonicalString())!=null?X:j}));return f.values[G]=pw(z,le),f.values.yLabels=pw(z,Q),{byColumns:f}}async createChartSettings(e,t){var n,r;const a=(n=t.components.valueColor.selectorStates[0])==null?void 0:n.selectedSource,i=(r=t.components.valueSize.selectorStates[0])==null?void 0:r.selectedSource;if(!a||!i)throw Error("Value column is not valid");const o=en(a),s=en(i);if(!kn(o)&&!kn(s))throw Error("Value column is not valid");const c=[o,s].filter(kn).map(P=>P.toCanonicalString()),f={type:"column",value:a,label:await Kr(e,a,[])},A={type:"column",value:i,label:await Kr(e,i,[])},v=t.components.x.selectorStates.map(({selectedSource:P})=>P).join(", "),C=t.components.y.selectorStates.map(({selectedSource:P})=>P).join(", "),b=await Promise.all(t.components.facetBy.selectorStates.map(async P=>{var I,$;return{type:"column",value:($=(I=await wa(e,P.selectedSource,c))==null?void 0:I.toCanonicalString())!=null?$:P.selectedSource}})),B=(await Promise.all(t.components.x.selectorStates.map(P=>Kr(e,P.selectedSource,c)))).join(", "),E=(await Promise.all(t.components.y.selectorStates.map(P=>Kr(e,P.selectedSource,c)))).join(", "),k=await Promise.all(t.components.tooltipContent.selectorStates.map(async P=>{var I,$;const z=P.selectedSource;return{type:"column",label:await Kr(e,z,c)||z,value:z,valueLabels:($=(I=await wa(e,z,c))==null?void 0:I.toCanonicalString())!=null?$:z}}));return{type:"bubble",valueColor:f,valueSize:A,xColumn:{type:"column",value:v,label:B,valueLabels:"xLabels"},yColumn:{type:"column",value:C,label:E,valueLabels:"yLabels"},facetBy:b,tooltips:{show:!0,content:k}}}},Qne={type:"histogram",components:{value:{type:"simple",selectorStates:[]},grouping:{type:"simple",selectorStates:[]},filters:{type:"filter",selectorStates:[]},tabBy:{type:"filter",selectorStates:[]},facetBy:{type:"simple",selectorStates:[]}},dividedAxes:{}},jne=class extends U2{constructor(){super({value:new En({componentName:"value",allowedTypes:["Int","Long","Double","Float"],settings:{isDataComponent:!0,columnsAllowed:!0,axesAllowed:!1,required:!0}}),grouping:new En({componentName:"grouping",allowedTypes:["String","Int","Long"],parentComponents:["value"],dependsOn:["value"],settings:{axesAllowed:!0,multipleSelectors:!1}}),facetBy:new En({componentName:"facetBy",allowedTypes:["String","Int","Long"],parentComponents:["value"],dependsOn:["value"],settings:{axesAllowed:!0,dimensionConsumer:!0,multipleSelectors:!0}})},{filters:new En({componentName:"filters",allowedTypes:["String","Int","Long","Double","Float"],parentComponents:["value"],dependsOn:["value"],settings:{columnsAllowed:!0,axesAllowed:!0,dimensionConsumer:!0,multipleSelectors:!0},checkSourceBySpec:nv}),tabBy:new En({componentName:"tabBy",allowedTypes:["String","Int"],parentComponents:["value"],dependsOn:["value"],settings:{columnsAllowed:!0,axesAllowed:!0,dimensionConsumer:!0}})}),this.dataInputs=["value"]}async createDataByColumns(e,t){var n,r;const a=(n=t.components.value.selectorStates[0])==null?void 0:n.selectedSource;if(!a)throw Error("Value column is not valid");const i=en(a);if(!kn(i))throw Error("Value column is not valid");const o={type:"columns",id:(r=I1(t.components))!=null?r:"",values:{}},s=await rv(e),c=[...t.components.filters.selectorStates,...t.components.tabBy.selectorStates],f=tv(c),A=c.map(P=>en(P.selectedSource)).filter(kn),h=[a],v=await j2(e,h),g=[t.components.facetBy,t.components.grouping],C=[],b=[[]],B=[],E=[];for(const{selectedSource:P,fixedAxes:I}of c)E.push(...await jc(e,s,v,P,I)),E.push(...await jc(e,s,v,P,I)),b.push((I??[]).map(({axisIdx:$,axisValue:z})=>({idx:$,value:z})));for(const P of g)for(const{selectedSource:I,fixedAxes:$}of P.selectorStates){C.push(en(I)),B.push(($??[]).map(({axisIdx:O,axisValue:K})=>({idx:O,value:K}))),E.push(...await jc(e,s,v,I,$));const z=await wa(e,I,h);z&&C.push(z)}const k=await e.pFrameProvider.getTableOuterJoin([i,...E,...A],C,f,!0,b,B);return C.forEach(P=>{const I=P.toCanonicalString();o.values[I]=kn(P)?k.columnsData[I]:k.axesData[I]}),o.values[i.toCanonicalString()]=k.columnsData[i.toCanonicalString()],{byColumns:o}}async createChartSettings(e,t){var n,r;const a=(n=t.components.value.selectorStates[0])==null?void 0:n.selectedSource;if(!a)throw Error("Value column is not valid");const i=en(a);if(!kn(i))throw Error("Value column is not valid");const o=[a],s={type:"column",value:a,label:await Kr(e,a,[])},c=await Promise.all(t.components.facetBy.selectorStates.map(async A=>{var h,v;return{type:"column",value:(v=(h=await wa(e,A.selectedSource,o))==null?void 0:h.toCanonicalString())!=null?v:A.selectedSource}}));let f;if(t.components.grouping.selectorStates.length){const{selectedSource:A}=t.components.grouping.selectorStates[0];f={type:"column",value:A,label:await Kr(e,A,o),valueLabels:(r=await wa(e,A,o))==null?void 0:r.toCanonicalString()}}return{type:"histogram",valueColumn:s,facetBy:c,grouping:f}}},Une={type:"discrete",components:{y:{type:"simple",selectorStates:[]},filters:{type:"filter",selectorStates:[]},tabBy:{type:"filter",selectorStates:[]},facetBy:{type:"simple",selectorStates:[]},primaryGrouping:{type:"simple",selectorStates:[]},secondaryGrouping:{type:"simple",selectorStates:[]}},dividedAxes:{}},Gne=class extends U2{constructor(){super({y:new En({componentName:"y",allowedTypes:["Int","Double","Long","Float"],settings:{isDataComponent:!0}}),primaryGrouping:new En({componentName:"primaryGrouping",allowedTypes:["String","Int","Long"],strictlyDependsOnParents:!0,parentComponents:["y"],dependsOn:["y"],settings:{axesAllowed:!0,homogeneous:!0}}),secondaryGrouping:new En({componentName:"secondaryGrouping",allowedTypes:["String","Int","Long"],strictlyDependsOnParents:!0,parentComponents:["y"],dependsOn:["primaryGrouping"],settings:{axesAllowed:!0,homogeneous:!0}}),facetBy:new En({componentName:"facetBy",allowedTypes:["String","Int","Long"],strictlyDependsOnParents:!0,parentComponents:["y"],dependsOn:["y"],settings:{axesAllowed:!0,dimensionConsumer:!0,multipleSelectors:!0}})},{filters:new En({componentName:"filters",allowedTypes:["String","Int","Long","Double","Float"],strictlyDependsOnParents:!0,parentComponents:["y"],dependsOn:["y"],settings:{axesAllowed:!0,dimensionConsumer:!0,multipleSelectors:!0},checkSourceBySpec:nv}),tabBy:new En({componentName:"tabBy",allowedTypes:["String","Int"],strictlyDependsOnParents:!0,parentComponents:["y"],dependsOn:["y"],settings:{axesAllowed:!0,dimensionConsumer:!0}})}),this.dataInputs=["y"],this.dontAllowUnfilteredHighCardinality=!0}async createDataByColumns(e,t){var n;const r=t.components.y.selectorStates[0].selectedSource,a=en(r);if(!r||!kn(a))throw Error("Y column is not valid");const i={type:"columns",id:(n=I1(t.components))!=null?n:"",values:{}},o=await rv(e),s=[...t.components.filters.selectorStates,...t.components.tabBy.selectorStates],c=tv(s),f=s.map(k=>en(k.selectedSource)).filter(kn),A=[r],h=await j2(e,A),v=[t.components.primaryGrouping,t.components.secondaryGrouping,t.components.facetBy],g=[],C=[[]],b=[],B=[];for(const{selectedSource:k,fixedAxes:P}of s)B.push(...await jc(e,o,h,k,P)),C.push((P??[]).map(({axisIdx:I,axisValue:$})=>({idx:I,value:$})));for(const k of v)for(const{selectedSource:P,fixedAxes:I}of k.selectorStates){g.push(en(P)),b.push((I??[]).map(({axisIdx:z,axisValue:O})=>({idx:z,value:O}))),B.push(...await jc(e,o,h,P,I));const $=await wa(e,P,A);$&&g.push($)}const E=await e.pFrameProvider.getTableOuterJoin([a,...B,...f],g,c,!0,C,b);return g.forEach(k=>{const P=k.toCanonicalString();i.values[P]=kn(k)?E.columnsData[P]:E.axesData[P]}),i.values[a.toCanonicalString()]=E.columnsData[a.toCanonicalString()],{byColumns:i}}async createChartSettings(e,t){var n,r;const a=t.components.y.selectorStates[0].selectedSource,i=en(a);if(!a||!kn(i))throw Error("Y column is not valid");const o={type:"column",value:a,label:await Kr(e,a,[])},s=[a];let c;if(t.components.primaryGrouping.selectorStates.length){const{selectedSource:h}=t.components.primaryGrouping.selectorStates[0];c={columnName:{type:"column",value:h,label:await Kr(e,h,s),valueLabels:(n=await wa(e,h,s))==null?void 0:n.toCanonicalString()}}}let f;if(t.components.secondaryGrouping.selectorStates.length){const{selectedSource:h}=t.components.secondaryGrouping.selectorStates[0];f={columnName:{type:"column",value:h,label:await Kr(e,h,s),valueLabels:(r=await wa(e,h,s))==null?void 0:r.toCanonicalString()}}}const A=await Promise.all(t.components.facetBy.selectorStates.map(async h=>{var v,g;return{type:"column",value:(g=(v=await wa(e,h.selectedSource,s))==null?void 0:v.toCanonicalString())!=null?g:h.selectedSource,label:await Kr(e,h.selectedSource,s)}}));return{type:"discrete",y:o,primaryGrouping:c,secondaryGrouping:f,facetBy:A}}},Yne={type:"heatmap",components:{value:{type:"simple",selectorStates:[]},x:{type:"simple",selectorStates:[]},y:{type:"simple",selectorStates:[]},xGroupBy:{type:"simple",selectorStates:[]},yGroupBy:{type:"simple",selectorStates:[]},filters:{type:"filter",selectorStates:[]},tabBy:{type:"filter",selectorStates:[]},facetBy:{type:"simple",selectorStates:[]},annotationsX:{type:"simple",selectorStates:[]},annotationsY:{type:"simple",selectorStates:[]},tooltipContent:{type:"simple",selectorStates:[]}},dividedAxes:{}};function oE(e){return e?"kind"in e&&e.kind==="PColumn"?e.valueType==="String":e.type==="String":!0}function vw(e,t){if(!t.length)return[];const n=t.map(i=>en(i)),r=Object.values(e.columnsData)[0].length,a=[];for(let i=0;i<r;i++){const o=n.map(s=>{const c=s.toCanonicalString();return kn(s)?e.columnsData[c][i]:e.axesData[c][i]}).join(", ");a.push(o)}return a}var Wne=class extends U2{constructor(){super({value:new En({componentName:"value",allowedTypes:["Int","Long","Double","Float","String"],settings:{isDataComponent:!0,columnsAllowed:!0,axesAllowed:!1,required:!0}}),x:new En({componentName:"x",allowedTypes:["Int","String","Long"],strictlyDependsOnParents:!0,parentComponents:["value"],settings:{required:!0,dimensionConsumer:!0,multipleSelectors:!0,axesAllowed:!0,columnsAllowed:!1}}),xGroupBy:new En({componentName:"xGroupBy",allowedTypes:["Int","String","Long"],strictlyDependsOnParents:!0,parentComponents:["value"],settings:{dimensionConsumer:!0,multipleSelectors:!0,axesAllowed:!0,columnsAllowed:!0},dependsOn:["x"],checkSourceBySpec:(e,t)=>{const n=new Set([...t.components.x.selectorStates.map(r=>r.selectedSource),...t.components.xGroupBy.selectorStates.map(r=>r.selectedSource)]);return"kind"in e&&e.kind==="PColumn"?Lr.fromAxesSpec(e.axesSpec).every(r=>n.has(r.toCanonicalString())):!0}}),y:new En({componentName:"y",allowedTypes:["Int","String","Long"],strictlyDependsOnParents:!0,parentComponents:["value"],settings:{required:!0,dimensionConsumer:!0,multipleSelectors:!0,axesAllowed:!0,columnsAllowed:!0}}),yGroupBy:new En({componentName:"yGroupBy",allowedTypes:["Int","String","Long"],strictlyDependsOnParents:!0,parentComponents:["value"],settings:{dimensionConsumer:!0,multipleSelectors:!0,axesAllowed:!0,columnsAllowed:!1},dependsOn:["y"],checkSourceBySpec:(e,t)=>{const n=new Set([...t.components.y.selectorStates.map(r=>r.selectedSource),...t.components.yGroupBy.selectorStates.map(r=>r.selectedSource)]);return"kind"in e&&e.kind==="PColumn"?Lr.fromAxesSpec(e.axesSpec).every(r=>n.has(r.toCanonicalString())):!0}}),tooltipContent:new En({componentName:"tooltipContent",allowedTypes:["String","Int","Long","Float","Double"],strictlyDependsOnParents:!0,parentComponents:["value"],dependsOn:["value"],settings:{columnsAllowed:!0,axesAllowed:!0,multipleSelectors:!0}}),facetBy:new En({componentName:"facetBy",allowedTypes:["String","Int","Long"],strictlyDependsOnParents:!0,parentComponents:["value"],dependsOn:["value"],settings:{axesAllowed:!0,dimensionConsumer:!0,multipleSelectors:!0}}),annotationsX:new En({componentName:"annotationsX",allowedTypes:["Int","Long","Double","Float","String"],parentComponents:["value"],settings:{axesAllowed:!0,multipleSelectors:!0},dependsOn:["x"],checkSourceBySpec:(e,t)=>{const n=new Set([...t.components.x.selectorStates.map(r=>r.selectedSource),...t.components.xGroupBy.selectorStates.map(r=>r.selectedSource)]);return"kind"in e&&e.kind==="PColumn"?Lr.fromAxesSpec(e.axesSpec).every(r=>n.has(r.toCanonicalString())):n.has(Lr.fromAxisSpec(e).toCanonicalString())}}),annotationsY:new En({componentName:"annotationsY",allowedTypes:["Int","Long","Double","Float","String"],parentComponents:["value"],settings:{axesAllowed:!0,multipleSelectors:!0},dependsOn:["y"],checkSourceBySpec:(e,t)=>{const n=new Set([...t.components.y.selectorStates.map(r=>r.selectedSource),...t.components.yGroupBy.selectorStates.map(r=>r.selectedSource)]);return"kind"in e&&e.kind==="PColumn"?Lr.fromAxesSpec(e.axesSpec).every(r=>n.has(r.toCanonicalString())):n.has(Lr.fromAxisSpec(e).toCanonicalString())}})},{filters:new En({componentName:"filters",allowedTypes:["String","Int","Long","Double","Long"],strictlyDependsOnParents:!0,parentComponents:["value"],dependsOn:["value"],settings:{columnsAllowed:!0,axesAllowed:!0,dimensionConsumer:!0,multipleSelectors:!0},checkSourceBySpec:nv}),tabBy:new En({componentName:"tabBy",allowedTypes:["String","Int"],strictlyDependsOnParents:!0,parentComponents:["value"],dependsOn:["value"],settings:{columnsAllowed:!0,axesAllowed:!0,dimensionConsumer:!0}})}),this.dataInputs=["value"],this.dontAllowUnfilteredHighCardinality=!0}async getMustBeConsumedAxes(e,t){if(!t.components.value.selectorStates.length)return new Set;const n=t.components.value.selectorStates[0].selectedSource,r=await e.pFrameProvider.getColumnSpecById(en(n));return r?new Set(r.axesSpec.map(a=>Lr.fromAxisSpec(a).toCanonicalString())):new Set}async createDataByColumns(e,t){var n,r;const a=(n=t.components.value.selectorStates[0])==null?void 0:n.selectedSource;if(!a)throw Error("Value column is not valid");const i=en(a);if(!kn(i))throw Error("Value column is not valid");const o={type:"columns",id:(r=I1(t.components))!=null?r:"",values:{}},s=await rv(e),c=[...t.components.filters.selectorStates,...t.components.tabBy.selectorStates],f=tv(c),A=c.map(G=>en(G.selectedSource)).filter(kn),h=[a],v=await j2(e,h),g=[t.components.facetBy,t.components.annotationsX,t.components.annotationsY,t.components.x,t.components.y,t.components.xGroupBy,t.components.yGroupBy,t.components.tooltipContent],C=[],b=[[]],B=[],E=[];for(const{selectedSource:G,fixedAxes:Q}of c)E.push(...await jc(e,s,v,G,Q)),b.push((Q??[]).map(({axisIdx:j,axisValue:Y})=>({idx:j,value:Y})));for(const G of g)for(const{selectedSource:Q,fixedAxes:j}of G.selectorStates){C.push(en(Q)),B.push((j??[]).map(({axisIdx:X,axisValue:ee})=>({idx:X,value:ee}))),E.push(...await jc(e,s,v,Q,j));const Y=await wa(e,Q,h);Y&&C.push(Y)}const k=await e.pFrameProvider.getTableOuterJoin([i,...E,...A],C,f,!0,b,B);C.forEach(G=>{const Q=G.toCanonicalString();o.values[Q]=kn(G)?k.columnsData[Q]:k.axesData[Q]}),o.values[i.toCanonicalString()]=k.columnsData[i.toCanonicalString()];const P=t.components.x.selectorStates.concat(t.components.xGroupBy.selectorStates).map(G=>G.selectedSource),I=P.join(", ");o.values[I]=vw(k,P);const $=t.components.x.selectorStates.map(G=>G.selectedSource),z=await Promise.all($.map(async G=>{var Q,j;return(j=(Q=await wa(e,G,h))==null?void 0:Q.toCanonicalString())!=null?j:G}));o.values.xLabelsKey=vw(k,z);const O=t.components.y.selectorStates.concat(t.components.yGroupBy.selectorStates).map(G=>G.selectedSource),K=O.join(", ");o.values[K]=vw(k,O);const te=t.components.y.selectorStates.map(G=>G.selectedSource),le=await Promise.all(te.map(async G=>{var Q,j;return(j=(Q=await wa(e,G,h))==null?void 0:Q.toCanonicalString())!=null?j:G}));return o.values.yLabelsKey=vw(k,le),{byColumns:o}}async createChartSettings(e,t){var n;const r=(n=t.components.value.selectorStates[0])==null?void 0:n.selectedSource;if(!r)throw Error("Value column is not valid");const a=en(r);if(!kn(a))throw Error("Value column is not valid");const i=[r],o={type:"column",value:r,label:await Kr(e,r,[])},c=t.components.x.selectorStates.concat(t.components.xGroupBy.selectorStates).map(({selectedSource:I})=>en(I)).map(I=>I.toCanonicalString()).join(", "),A=t.components.y.selectorStates.concat(t.components.yGroupBy.selectorStates).map(({selectedSource:I})=>en(I)).map(I=>I.toCanonicalString()).join(", "),h=await Promise.all(t.components.facetBy.selectorStates.map(async I=>{var $,z;return{type:"column",value:(z=($=await wa(e,I.selectedSource,i))==null?void 0:$.toCanonicalString())!=null?z:I.selectedSource}})),v=await Promise.all(t.components.xGroupBy.selectorStates.map(async I=>{var $,z;return{type:"column",label:await Kr(e,I.selectedSource,i),value:I.selectedSource,valueLabels:(z=($=await wa(e,I.selectedSource,i))==null?void 0:$.toCanonicalString())!=null?z:I.selectedSource}})),g=await Promise.all(t.components.yGroupBy.selectorStates.map(async I=>{var $,z;return{type:"column",label:await Kr(e,I.selectedSource,i),value:I.selectedSource,valueLabels:(z=($=await wa(e,I.selectedSource,i))==null?void 0:$.toCanonicalString())!=null?z:I.selectedSource}})),C=await e.pFrameProvider.getColumnSpecById(a),b=await Promise.all(t.components.annotationsX.selectorStates.map(async I=>{var $,z;const O=I.selectedSource,K=en(O),te=kn(K)?await e.pFrameProvider.getColumnSpecById(K):(z=($=C==null?void 0:C.axesSpec)==null?void 0:$.find(le=>Lr.fromAxisSpec(le).toCanonicalString()===O))!=null?z:null;return{axis:"x",valueColumn:{type:"column",value:O,label:await Kr(e,O,i)},type:oE(te)?"discrete":"continuous"}})),B=await Promise.all(t.components.annotationsY.selectorStates.map(async I=>{var $,z;const O=I.selectedSource,K=en(O),te=kn(K)?await e.pFrameProvider.getColumnSpecById(K):(z=($=C==null?void 0:C.axesSpec)==null?void 0:$.find(le=>Lr.fromAxisSpec(le).toCanonicalString()===O))!=null?z:null;return{axis:"y",valueColumn:{type:"column",value:O,label:await Kr(e,O,i)},type:oE(te)?"discrete":"continuous"}})),E=(await Promise.all(t.components.x.selectorStates.map(I=>Kr(e,I.selectedSource,i)))).join(", "),k=(await Promise.all(t.components.y.selectorStates.map(I=>Kr(e,I.selectedSource,i)))).join(", "),P=await Promise.all(t.components.tooltipContent.selectorStates.map(async I=>{var $,z;const O=I.selectedSource;return{type:"column",label:await Kr(e,O,i)||O,value:O,valueLabels:(z=($=await wa(e,O,i))==null?void 0:$.toCanonicalString())!=null?z:O}}));return{type:"heatmap",valueColumn:o,valueType:oE(C)?"discrete":"continuous",xColumn:{type:"column",value:c,label:E,valueLabels:"xLabelsKey"},yColumn:{type:"column",value:A,label:k,valueLabels:"yLabelsKey"},facetBy:h,xGroupBy:v,yGroupBy:g,annotations:[...b,...B],tooltips:{show:!0,content:P}}}},Xne={type:"scatterplot",components:{x:{type:"simple",selectorStates:[]},y:{type:"simple",selectorStates:[]},filters:{type:"filter",selectorStates:[]},highlight:{type:"filter",selectorStates:[]},tabBy:{type:"filter",selectorStates:[]},facetBy:{type:"simple",selectorStates:[]},grouping:{type:"simple",selectorStates:[]},shape:{type:"simple",selectorStates:[]},size:{type:"simple",selectorStates:[]},label:{type:"simple",selectorStates:[]},tooltipContent:{type:"simple",selectorStates:[]}},dividedAxes:{}},Kne=class extends U2{constructor(){super({x:new En({componentName:"x",allowedTypes:["Int","Long","Double","Float"],parentComponents:["y"],strictlyDependsOnParents:!1,settings:{isDataComponent:!0,required:!0,axesAllowed:!0,columnsAllowed:!0}}),y:new En({componentName:"y",allowedTypes:["Int","Long","Double","Float"],parentComponents:["x"],strictlyDependsOnParents:!1,settings:{isDataComponent:!0,required:!0,axesAllowed:!0,columnsAllowed:!0}}),facetBy:new En({componentName:"facetBy",allowedTypes:["String","Int","Long"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{axesAllowed:!0,dimensionConsumer:!0,multipleSelectors:!0}}),grouping:new En({componentName:"grouping",allowedTypes:["String","Int","Long","Double","Float"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{axesAllowed:!0,multipleSelectors:!0}}),shape:new En({componentName:"shape",allowedTypes:["String","Int","Long"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{axesAllowed:!0}}),size:new En({componentName:"size",allowedTypes:["Int","Long","Double","Float"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{axesAllowed:!0}}),tooltipContent:new En({componentName:"tooltipContent",allowedTypes:["String","Int","Long","Float","Double"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{columnsAllowed:!0,axesAllowed:!0,multipleSelectors:!0}}),label:new En({componentName:"label",allowedTypes:["String","Int","Long"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{axesAllowed:!0,columnsAllowed:!0,multipleSelectors:!1}})},{filters:new En({componentName:"filters",allowedTypes:["String","Int","Long","Double","Float"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{axesAllowed:!0,columnsAllowed:!0,dimensionConsumer:!0,multipleSelectors:!0},checkSourceBySpec:nv}),tabBy:new En({componentName:"tabBy",allowedTypes:["String","Int"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{axesAllowed:!0,dimensionConsumer:!0}}),highlight:new En({componentName:"highlight",allowedTypes:["String","Int","Long","Double","Float"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{axesAllowed:!0,columnsAllowed:!0,multipleSelectors:!0},checkSourceBySpec:nv})}),this.dataInputs=["x","y"]}async getMustBeConsumedAxes(e,t){if(!t.components.x.selectorStates.length||!t.components.y.selectorStates.length)return new Set;const n=t.components.x.selectorStates[0].selectedSource,r=t.components.y.selectorStates[0].selectedSource,a=await e.pFrameProvider.getColumnSpecById(en(n)),i=await e.pFrameProvider.getColumnSpecById(en(r));if(!a||!i)return new Set;const o=a.axesSpec.map(A=>Lr.fromAxisSpec(A).toCanonicalString()),s=i.axesSpec.map(A=>Lr.fromAxisSpec(A).toCanonicalString()),c=o.filter(A=>!s.some(h=>h===A)),f=s.filter(A=>!o.some(h=>h===A));return new Set([...c,...f])}async createDataByColumns(e,t){var n,r,a;const i=(n=t.components.x.selectorStates[0])==null?void 0:n.selectedSource,o=(r=t.components.y.selectorStates[0])==null?void 0:r.selectedSource;if(!i||!o)throw Error("X or Y column is not valid");const s=en(i),c=en(o),f={type:"columns",id:(a=I1(t.components))!=null?a:"",values:{}},A=await rv(e),h=[...t.components.filters.selectorStates,...t.components.tabBy.selectorStates],v=tv(h),g=h.map(O=>en(O.selectedSource)).filter(kn),C=[s,c].filter(kn).map(O=>O.toCanonicalString());if(C.length===0)throw Error("One of X and Y should be a column");const b=await j2(e,C),B=[s,c,...g],E=[],k=[[],[]],P=[],I=[];for(const{selectedSource:O,fixedAxes:K}of h)I.push(...await jc(e,A,b,O,K)),k.push((K??[]).map(({axisIdx:te,axisValue:le})=>({idx:te,value:le})));const $=[t.components.grouping,t.components.size,t.components.shape,t.components.tooltipContent,t.components.facetBy,t.components.label,t.components.highlight];for(const O of $)for(const{selectedSource:K,fixedAxes:te}of O.selectorStates){E.push(en(K)),P.push((te??[]).map(({axisIdx:G,axisValue:Q})=>({idx:G,value:Q}))),I.push(...await jc(e,A,b,K,te));const le=await wa(e,K,C);le&&E.push(le)}const z=await e.pFrameProvider.getTableOuterJoin([s,c,...I,...g],E,v,!1,k,P);return[...B,...E].forEach(O=>{const K=O.toCanonicalString();f.values[K]=kn(O)?z.columnsData[K]:z.axesData[K]}),f.values.key=new Array(f.values[Object.keys(f.values)[0]].length).fill(0).map((O,K)=>K),t.components.highlight.selectorStates.length&&(f.values.highlight=hI(t.components.highlight.selectorStates,z)),{byColumns:f}}async createChartSettings(e,t){var n,r,a,i;const o=(n=t.components.x.selectorStates[0])==null?void 0:n.selectedSource,s=(r=t.components.y.selectorStates[0])==null?void 0:r.selectedSource,c=o?en(o):null,f=s?en(s):null;if(!o||!s||!c||!f||!kn(c)&&!kn(f))throw Error("Empty or invalid required data");const A=[c,f].filter(kn).map(I=>I.toCanonicalString()),h={type:"column",value:o,label:await Kr(e,o,A)},v={type:"column",value:s,label:await Kr(e,s,A)},g={type:"column",value:"key"},C=await Promise.all(t.components.facetBy.selectorStates.map(async I=>{var $,z;return{type:"column",value:(z=($=await wa(e,I.selectedSource,A))==null?void 0:$.toCanonicalString())!=null?z:I.selectedSource}})),b=Zn.uniq([...t.components.grouping.selectorStates.map(I=>I.selectedSource),...t.components.size.selectorStates.map(I=>I.selectedSource),...t.components.shape.selectorStates.map(I=>I.selectedSource)]),B=await Promise.all(b.map(async I=>{var $,z;return{type:"column",label:await Kr(e,I,A)||I,value:I,valueLabels:(z=($=await wa(e,I,A))==null?void 0:$.toCanonicalString())!=null?z:I}})),E=await Promise.all(t.components.tooltipContent.selectorStates.map(async I=>{var $,z;const O=I.selectedSource;return{type:"column",label:await Kr(e,O,A)||O,value:O,valueLabels:(z=($=await wa(e,O,A))==null?void 0:$.toCanonicalString())!=null?z:O}}));let k;if(t.components.label.selectorStates.length){const I=t.components.label.selectorStates[0].selectedSource;k={type:"column",value:I,label:await Kr(e,I,A),valueLabels:(i=(a=await wa(e,I,A))==null?void 0:a.toCanonicalString())!=null?i:I}}let P;return t.components.highlight.selectorStates.length&&(P={type:"column",value:"highlight"}),{type:"scatterplot",x:h,y:v,keyColumn:g,facetBy:C,grouping:B,label:k,highlight:P,tooltips:{show:!0,content:E}}}},Zne={type:"scatterplot-umap",components:{x:{type:"simple",selectorStates:[]},y:{type:"simple",selectorStates:[]},filters:{type:"filter",selectorStates:[]},highlight:{type:"filter",selectorStates:[]},tabBy:{type:"filter",selectorStates:[]},facetBy:{type:"simple",selectorStates:[]},grouping:{type:"simple",selectorStates:[]},label:{type:"simple",selectorStates:[]},tooltipContent:{type:"simple",selectorStates:[]},size:{type:"simple",selectorStates:[]}},dividedAxes:{}},Jne=class extends U2{constructor(){super({x:new En({componentName:"x",allowedTypes:["Int","Long","Double","Float"],parentComponents:["y"],strictlyDependsOnParents:!1,settings:{isDataComponent:!0,required:!0,axesAllowed:!0,columnsAllowed:!0}}),y:new En({componentName:"y",allowedTypes:["Int","Long","Double","Float"],parentComponents:["x"],strictlyDependsOnParents:!1,settings:{isDataComponent:!0,required:!0,axesAllowed:!0,columnsAllowed:!0}}),facetBy:new En({componentName:"facetBy",allowedTypes:["String","Int","Long"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{axesAllowed:!0,dimensionConsumer:!0,multipleSelectors:!0}}),grouping:new En({componentName:"grouping",allowedTypes:["String","Int","Long","Float","Double"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{axesAllowed:!0,multipleSelectors:!0}}),tooltipContent:new En({componentName:"tooltipContent",allowedTypes:["String","Int","Long","Float","Double"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{columnsAllowed:!0,axesAllowed:!0,multipleSelectors:!0}}),label:new En({componentName:"label",allowedTypes:["String","Int","Long"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{axesAllowed:!0,columnsAllowed:!0,multipleSelectors:!1}}),size:new En({componentName:"size",allowedTypes:["Int","Long","Double","Float"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{axesAllowed:!0}})},{filters:new En({componentName:"filters",allowedTypes:["String","Int","Long","Double","Float"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{axesAllowed:!0,dimensionConsumer:!0,multipleSelectors:!0},checkSourceBySpec:nv}),tabBy:new En({componentName:"tabBy",allowedTypes:["String","Int"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{axesAllowed:!0,dimensionConsumer:!0}}),highlight:new En({componentName:"highlight",allowedTypes:["String","Int","Long","Double","Float"],strictlyDependsOnParents:!0,parentComponents:["x","y"],dependsOn:["x","y"],settings:{axesAllowed:!0,columnsAllowed:!0,multipleSelectors:!0},checkSourceBySpec:nv})}),this.dataInputs=["x","y"]}async getMustBeConsumedAxes(e,t){if(!t.components.x.selectorStates.length||!t.components.y.selectorStates.length)return new Set;const n=t.components.x.selectorStates[0].selectedSource,r=t.components.y.selectorStates[0].selectedSource,a=await e.pFrameProvider.getColumnSpecById(en(n)),i=await e.pFrameProvider.getColumnSpecById(en(r));if(!a||!i)return new Set;const o=a.axesSpec.map(A=>Lr.fromAxisSpec(A).toCanonicalString()),s=i.axesSpec.map(A=>Lr.fromAxisSpec(A).toCanonicalString()),c=o.filter(A=>!s.some(h=>h===A)),f=s.filter(A=>!o.some(h=>h===A));return new Set([...c,...f])}async createDataByColumns(e,t){var n,r,a;const i=(n=t.components.x.selectorStates[0])==null?void 0:n.selectedSource,o=(r=t.components.y.selectorStates[0])==null?void 0:r.selectedSource;if(!i||!o)throw Error("X or Y column is not valid");const s=en(i),c=en(o);if(!s||!c)throw Error("X or Y column is not valid");const f={type:"columns",id:(a=I1(t.components))!=null?a:"",values:{}},A=await rv(e),h=[...t.components.filters.selectorStates,...t.components.tabBy.selectorStates],v=tv(h),g=h.map(O=>en(O.selectedSource)).filter(kn),C=[s,c].filter(kn).map(O=>O.toCanonicalString());if(C.length===0)throw Error("One of X and Y should be a column");const b=await j2(e,C),B=[s,c,...g],E=[],k=[[],[]],P=[],I=[];for(const{selectedSource:O,fixedAxes:K}of h)I.push(...await jc(e,A,b,O,K)),I.push(...await jc(e,A,b,O,K)),k.push((K??[]).map(({axisIdx:te,axisValue:le})=>({idx:te,value:le})));const $=[t.components.grouping,t.components.facetBy,t.components.tooltipContent,t.components.label,t.components.highlight,t.components.size];for(const O of $)for(const{selectedSource:K,fixedAxes:te}of O.selectorStates){E.push(en(K)),P.push((te??[]).map(({axisIdx:G,axisValue:Q})=>({idx:G,value:Q}))),I.push(...await jc(e,A,b,K,te));const le=await wa(e,K,C);le&&E.push(le)}const z=await e.pFrameProvider.getTableOuterJoin([s,c,...I,...g],E,v,!1,k,P);return[...B,...E].forEach(O=>{const K=O.toCanonicalString();f.values[K]=kn(O)?z.columnsData[K]:z.axesData[K]}),t.components.highlight.selectorStates.length&&(f.values.highlight=hI(t.components.highlight.selectorStates,z)),{byColumns:f,axesData:z.axesData}}async createChartSettings(e,t){var n,r,a,i;const o=(n=t.components.x.selectorStates[0])==null?void 0:n.selectedSource,s=(r=t.components.y.selectorStates[0])==null?void 0:r.selectedSource,c=o?en(o):null,f=s?en(s):null;if(!o||!s||!c||!f||!kn(c)&&!kn(f))throw Error("Empty or invalid required data");const A=[c,f].filter(kn).map(I=>I.toCanonicalString()),h={type:"column",value:o,label:await Kr(e,o,A)},v={type:"column",value:s,label:await Kr(e,s,A)},g={type:"column",value:"key"},C=await Promise.all(t.components.facetBy.selectorStates.map(async I=>{var $,z;return{type:"column",value:(z=($=await wa(e,I.selectedSource,A))==null?void 0:$.toCanonicalString())!=null?z:I.selectedSource}})),b=Zn.uniq([...t.components.grouping.selectorStates.map(I=>I.selectedSource),...t.components.size.selectorStates.map(I=>I.selectedSource)]),B=await Promise.all(b.map(async I=>{var $,z;return{type:"column",label:await Kr(e,I,A)||I,value:I,valueLabels:(z=($=await wa(e,I,A))==null?void 0:$.toCanonicalString())!=null?z:I}})),E=await Promise.all(t.components.tooltipContent.selectorStates.map(async I=>{var $,z;const O=I.selectedSource;return{type:"column",label:await Kr(e,O,A)||O,value:O,valueLabels:(z=($=await wa(e,O,A))==null?void 0:$.toCanonicalString())!=null?z:O}}));let k;if(t.components.label.selectorStates.length){const I=t.components.label.selectorStates[0].selectedSource;k={type:"column",value:I,label:await Kr(e,I,A),valueLabels:(i=(a=await wa(e,I,A))==null?void 0:a.toCanonicalString())!=null?i:I}}let P;return t.components.highlight.selectorStates.length&&(P={type:"column",value:"highlight"}),{type:"scatterplot-umap",x:h,y:v,keyColumn:g,facetBy:C,grouping:B,label:k,highlight:P,tooltips:{show:!0,content:E}}}},lE="pl7.app/dendrogram/nodeId",sE="id",qne={type:"dendro",components:{value:{type:"simple",selectorStates:[]},height:{type:"simple",selectorStates:[]},labels:{type:"simple",selectorStates:[]},tableContent:{type:"simple",selectorStates:[]},nodeColor:{type:"simple",selectorStates:[]},nodeShape:{type:"simple",selectorStates:[]},nodeSize:{type:"simple",selectorStates:[]},lineColor:{type:"simple",selectorStates:[]},heatmapAnnotation:{type:"simple",selectorStates:[]},heatmapForSequence:{type:"simple",selectorStates:[]},filters:{type:"filter",selectorStates:[]},tabBy:{type:"filter",selectorStates:[]},facetBy:{type:"simple",selectorStates:[]},heatmapAxis:{type:"simple",selectorStates:[]},heatmapGroup:{type:"simple",selectorStates:[]}},dividedAxes:{}},ere=class extends U2{constructor(){super({value:new En({componentName:"value",allowedTypes:["Int","Long"],annotations:{"pl7.app/dendrogram/isTopology":"true"},settings:{isDataComponent:!0,columnsAllowed:!0,required:!0,dimensionConsumer:!0,columnsWithExtraAxesAllowed:!1}}),height:new En({componentName:"height",allowedTypes:["Int","Long","Double","Float"],annotations:{"pl7.app/dendrogram/isDistance":"true"},parentComponents:["value"],strictlyDependsOnParents:!0,settings:{columnsAllowed:!0,axesAllowed:!1,dimensionConsumer:!0,columnsWithExtraAxesAllowed:!1}}),labels:new En({componentName:"labels",allowedTypes:["Int","String","Long"],parentComponents:["value"],strictlyDependsOnParents:!1,settings:{columnsAllowed:!0,axesAllowed:!1,columnsWithExtraAxesAllowed:!1}}),tableContent:new En({componentName:"tableContent",allowedTypes:["Int","String","Long","Double","Float"],parentComponents:["value"],strictlyDependsOnParents:!1,settings:{columnsAllowed:!0,axesAllowed:!0,multipleSelectors:!0,columnsWithExtraAxesAllowed:!1}}),nodeShape:new En({componentName:"nodeShape",allowedTypes:["Int","String","Long"],parentComponents:["value"],strictlyDependsOnParents:!1,settings:{columnsAllowed:!0,axesAllowed:!0,columnsWithExtraAxesAllowed:!1}}),nodeSize:new En({componentName:"nodeSize",allowedTypes:["Double","Int","String","Long"],parentComponents:["value"],strictlyDependsOnParents:!1,settings:{columnsAllowed:!0,axesAllowed:!0,columnsWithExtraAxesAllowed:!1}}),nodeColor:new En({componentName:"nodeColor",allowedTypes:["Double","Int","String","Long"],parentComponents:["value"],strictlyDependsOnParents:!1,settings:{columnsAllowed:!0,axesAllowed:!0,columnsWithExtraAxesAllowed:!1}}),lineColor:new En({componentName:"lineColor",allowedTypes:["Double","Int","String","Long"],parentComponents:["value"],strictlyDependsOnParents:!1,settings:{columnsAllowed:!0,axesAllowed:!1,columnsWithExtraAxesAllowed:!1}}),heatmapForSequence:new En({componentName:"heatmapForSequence",allowedTypes:["String"],annotations:{"pl7.app/type":"sequence"},parentComponents:["value"],strictlyDependsOnParents:!1,settings:{columnsAllowed:!0,axesAllowed:!0,columnsWithExtraAxesAllowed:!1}}),heatmapAnnotation:new En({componentName:"heatmapAnnotation",allowedTypes:["Double","Int","Long","Float","String"],parentComponents:["value"],strictlyDependsOnParents:!1,settings:{isDataComponent:!0,columnsAllowed:!0,axesAllowed:!1,columnsWithExtraAxesAllowed:!1}}),facetBy:new En({componentName:"facetBy",allowedTypes:["String","Int","Long"],parentComponents:["value"],strictlyDependsOnParents:!0,settings:{dimensionConsumer:!0,multipleSelectors:!0,axesAllowed:!0,columnsAllowed:!1,columnsWithExtraAxesAllowed:!1}}),heatmapAxis:new En({componentName:"heatmapAxis",allowedTypes:["String","Int","Long"],parentComponents:["heatmapAnnotation"],settings:{dimensionConsumer:!0,axesAllowed:!0,columnsAllowed:!1,columnsWithExtraAxesAllowed:!1}}),heatmapGroup:new En({componentName:"heatmapGroup",allowedTypes:["String","Int","Long"],parentComponents:["heatmapAnnotation"],settings:{dimensionConsumer:!0,multipleSelectors:!0,axesAllowed:!0,columnsAllowed:!1,columnsWithExtraAxesAllowed:!1}})},{filters:new En({componentName:"filters",allowedTypes:["String","Int","Long"],parentComponents:["value","heatmapAnnotation"],strictlyDependsOnParents:!1,settings:{dimensionConsumer:!0,multipleSelectors:!0,axesAllowed:!0,columnsAllowed:!1,columnsWithExtraAxesAllowed:!1}}),tabBy:new En({componentName:"tabBy",allowedTypes:["String","Int","Long"],parentComponents:["value","heatmapAnnotation"],strictlyDependsOnParents:!1,settings:{dimensionConsumer:!0,axesAllowed:!0,columnsAllowed:!1,columnsWithExtraAxesAllowed:!1}})}),this.ignoredOptionIdNames=[lE]}readyDataInputs(e){return e.components.value.selectorStates.length>0}async createTableData(e,t){var n;const r={},a=(n=t.components.value.selectorStates[0])==null?void 0:n.selectedSource,i=en(a);if(!a||!kn(i))throw Error("Value column is not valid");const o=await rv(e),s=tv([...t.components.filters.selectorStates,...t.components.tabBy.selectorStates]),c=[...t.components.filters.selectorStates.map(P=>en(P.selectedSource)),...t.components.tabBy.selectorStates.map(P=>en(P.selectedSource))].filter(kn),f=[a],A=await j2(e,f),h=[],v=[],g=[],C=[t.components.value],b=[t.components.tableContent,t.components.labels,t.components.nodeColor,t.components.nodeSize,t.components.nodeShape,t.components.lineColor],B={};for(const P of C)for(const{selectedSource:I,fixedAxes:$}of P.selectorStates){g.push(...await jc(e,o,A,I,$));const z=await wa(e,I,f),O=z??en(I);B[O.toCanonicalString()]=I,h.push(O)}for(const P of b)for(const{selectedSource:I,fixedAxes:$}of P.selectorStates){g.push(...await jc(e,o,A,I,$));const z=await wa(e,I,f),O=z??en(I);B[I]=O.toCanonicalString(),v.push(O)}const E=await e.pFrameProvider.getTableOuterJoin([...h,...c,...g],v,s,!1);for(const P of[...h,...v]){const I=P.toCanonicalString(),$=B[P.toCanonicalString()];r[$]={data:kn(P)?E.columnsData[I]:E.axesData[I],spec:kn(P)?E.columnSpecs[I]:E.axesSpecs[I],label:await Kr(e,$,f)}}const k=Object.keys(E.axesData).find(P=>{var I;return((I=en(P))==null?void 0:I.name)===lE});return k?r[sE]={data:E.axesData[k],spec:{kind:"PColumn",valueType:"Int",name:"Node id"},label:"Node id"}:console.warn("Missed node id axis in data column"),r}async createDataByColumns(e,t){var n,r,a;const i=(n=t.components.value.selectorStates[0])==null?void 0:n.selectedSource,o=(r=t.components.heatmapAnnotation.selectorStates[0])==null?void 0:r.selectedSource,s=en(i),c=o?en(o):null;if(!i||!kn(s))throw Error("Value column is not valid");const f={type:"columns",id:(a=I1(t.components))!=null?a:"",values:{}},A=[...t.components.filters.selectorStates,...t.components.tabBy.selectorStates],h=tv(A),v=A.map(z=>en(z.selectedSource)).filter(kn),g=[s,c].filter(kn).map(z=>z.toCanonicalString()),C=[],b=[],B=[],E=[],k=[t.components.value,t.components.height,t.components.labels,t.components.nodeColor,t.components.nodeSize,t.components.nodeShape,t.components.lineColor,t.components.heatmapAnnotation,t.components.heatmapForSequence],P=[t.components.facetBy,t.components.heatmapAxis,t.components.heatmapGroup,t.components.tableContent];for(const z of k)for(const{selectedSource:O,fixedAxes:K}of z.selectorStates){C.push(en(O)),B.push((K??[]).map(({axisIdx:le,axisValue:G})=>({idx:le,value:G})));const te=await wa(e,O,g);te&&C.push(te)}A.forEach(({fixedAxes:z})=>{B.push((z??[]).map(({axisIdx:O,axisValue:K})=>({idx:O,value:K})))});for(const z of P)for(const{selectedSource:O,fixedAxes:K}of z.selectorStates){b.push(en(O)),E.push((K??[]).map(({axisIdx:le,axisValue:G})=>({idx:le,value:G})));const te=await wa(e,O,g);te&&b.push(te)}const I=await e.pFrameProvider.getTableOuterJoin([...C,...v],b,h,!1,B,E);[...C,...b].forEach(z=>{const O=z.toCanonicalString(),K=kn(z)?I.columnsData[O]:I.axesData[O];f.values[O]=[],f.values[O]=K});const $=Object.keys(I.axesData).find(z=>{var O;return((O=en(z))==null?void 0:O.name)===lE});return $?f.values[sE]=I.axesData[$]:console.warn("Missed node id axis in data column"),{byColumns:f}}async createChartSettings(e,t){var n,r,a;const i=(n=t.components.value.selectorStates[0])==null?void 0:n.selectedSource,o=en(i);if(!i||!kn(o))throw Error("Data column is not valid");const s=[i],c={type:"column",value:sE},f={type:"column",value:i},A=t.components.height.selectorStates.length?{type:"column",value:t.components.height.selectorStates[0].selectedSource}:void 0,h=t.components.labels.selectorStates.length?{type:"column",value:t.components.labels.selectorStates[0].selectedSource}:void 0,v={};if(t.components.nodeColor.selectorStates.length){const B=t.components.nodeColor.selectorStates[0].selectedSource;v.nodeColor={columnName:{type:"column",value:B,label:await Kr(e,B,s)}}}if(t.components.nodeShape.selectorStates.length){const B=t.components.nodeShape.selectorStates[0].selectedSource;v.nodeShape={columnName:{type:"column",value:B,label:await Kr(e,B,s)}}}if(t.components.nodeSize.selectorStates.length){const B=t.components.nodeSize.selectorStates[0].selectedSource;v.nodeSize={columnName:{type:"column",value:B,label:await Kr(e,B,s)}}}if(t.components.lineColor.selectorStates.length){const B=t.components.lineColor.selectorStates[0].selectedSource;v.lineColor={columnName:{type:"column",value:B,label:await Kr(e,B,s)}}}let g,C,b;if(t.components.heatmapAnnotation.selectorStates.length&&t.components.heatmapAxis.selectorStates.length){const B=t.components.heatmapAnnotation.selectorStates[0].selectedSource;g={type:"column",value:B,label:await Kr(e,B,[]),valueLabels:(r=await wa(e,B,[]))==null?void 0:r.toCanonicalString()};const E=t.components.heatmapAxis.selectorStates[0].selectedSource;C={type:"column",value:E,label:await Kr(e,E,[B]),valueLabels:(a=await wa(e,E,[B]))==null?void 0:a.toCanonicalString()},b=await Promise.all(t.components.heatmapGroup.selectorStates.map(async k=>{var P;return{type:"column",value:k.selectedSource,label:await Kr(e,k.selectedSource,[B]),valueLabels:(P=await wa(e,k.selectedSource,[B]))==null?void 0:P.toCanonicalString()}}))}else if(t.components.heatmapForSequence.selectorStates.length){const B=t.components.heatmapForSequence.selectorStates[0].selectedSource;g={type:"column",value:B,label:await Kr(e,B,[])}}return{type:"dendro",id:c,parentId:f,height:A,labels:h,aes:v,heatmapAnnotation:g,heatmapAxis:C,heatmapGroup:b}}},mw=1e6;function gw(e,t){if(e==="String")return t.data;if(typeof t.data[0]=="bigint"){const n=new Array(t.data.length);for(let r=0;r<t.data.length;r++)n[r]=t.data[r]===BigInt(-9007199254740991)?null:Number(t.data[r]);return n}for(let n=0;n<t.data.length;n++){const r=t.data[n];e==="Int"&&r===-2147483648||(e==="Double"||e==="Float")&&isNaN(r)?t.data[n]=null:t.data[n]=Number(t.data[n])}return t.data}var av=!1,mkt=100,tre=class{constructor(e,t){this.pframeHandle=e,this.pframeDriver=t}async isColumnExisted(e){return!!await this.getColumnSpecById(e)}async getSingleColumnData(e,t=[]){if(!await this.isColumnExisted(e))return{axesData:{},data:[]};try{const n=Date.now(),r=await this.pframeDriver.calculateTableData(this.pframeHandle,{src:{type:"column",column:e.name},filters:t,sorting:[]}),a=r.filter(o=>o.spec.type==="axis"),i=r.filter(o=>o.spec.type==="column");return{axesData:a.reduce((o,s)=>{const c=Lr.fromAxisSpec(s.spec.spec);return o[c.toCanonicalString()]=gw(c.type,s.data),o},{}),data:i.length?gw(e.type,i[0].data):[]}}catch(n){throw console.error("PFrame: calculateTableData error"),n}}async getColumnUniqueValues(e,t=[],n=!1){if(!await this.isColumnExisted(e))return[];const r={columnId:e.name,filters:t,limit:mw};try{const a=Date.now(),i=await this.pframeDriver.getUniqueValues(this.pframeHandle,r);return i.overflow&&console.warn(`More than ${mw} values for ${e.name} column`),Array.from(i.values.data).map(String)}catch(a){throw console.error("PFrame: getUniqueValues for column error"),a}}async getAxisUniqueValues(e,t,n=[]){const r=t.filter(kn),a=await Promise.all(r.map(s=>this.getColumnSpecById(s))),i=e.toCanonicalString(),o=r.filter((s,c)=>{const f=a[c];return f!==null&&f.axesSpec.some(A=>Lr.fromAxisSpec(A).toCanonicalString()===i)});if(o.length===0)return[];try{const s=Date.now(),c=await Promise.all(o.map(f=>this.pframeDriver.getUniqueValues(this.pframeHandle,{columnId:f.name,axis:e.toPFrameId(),filters:n,limit:mw})));return c.forEach((f,A)=>{f.overflow&&console.warn(`More than ${mw} values for ${o[A].name} column`)}),Zn.uniq(Zn.flatten(c.map(f=>Array.from(f.values.data).map(String))))}catch(s){throw console.error("PFrame: getUniqueValues for axis error",s),s}}async getTableOuterJoin(e,t,n=[],r=!0,a=[],i=[]){const o=e.filter(kn),s=t.filter(kn),c={src:{type:"outer",primary:{type:r?"inner":"full",entries:o.map((f,A)=>{var h;const v=(h=a[A])==null?void 0:h.map(g=>({type:"constant",axisIndex:g.idx,constant:g.value})).filter(g=>g.constant!==void 0);return v!=null&&v.length?{type:"slicedColumn",newId:f.name,column:f.name,axisFilters:v}:{type:"column",column:f.name}})},secondary:s.map((f,A)=>{var h;const v=(h=i[A])==null?void 0:h.map(g=>({type:"constant",axisIndex:g.idx,constant:g.value})).filter(g=>g.constant!==void 0);return v!=null&&v.length?{type:"slicedColumn",newId:f.name,column:f.name,axisFilters:v}:{type:"column",column:f.name}})},filters:n,sorting:[]};try{const f=Date.now(),A=await this.pframeDriver.calculateTableData(this.pframeHandle,c),h=A.filter(g=>g.spec.type==="axis"),v=A.filter(g=>g.spec.type==="column");return{axesData:h.reduce((g,C)=>{const b=Lr.fromAxisSpec(C.spec.spec);return g[b.toCanonicalString()]=gw(b.type,C.data),g},{}),columnsData:v.reduce((g,C)=>{const b=C.spec.spec,B=new Q2({name:C.spec.id,type:b.valueType});return g[B.toCanonicalString()]=gw(B.type,C.data),g},{}),columnSpecs:v.reduce((g,C)=>{const b=C.spec.spec,B=new Q2({name:C.spec.id,type:b.valueType});return g[B.toCanonicalString()]=b,g},{}),axesSpecs:h.reduce((g,C)=>{const b=C.spec.spec,B=Lr.fromAxisSpec(b);return g[B.toCanonicalString()]=b,g},{})}}catch(f){throw console.error("PFrame: table outer join error"),console.info("error with request: ",c),f}}async getColumnSpecById(e){try{const t=Date.now(),n=await this.pframeDriver.getColumnSpec(this.pframeHandle,e.name);return n??null}catch{return console.error("PFrame: get single column error"),null}}async getColumnAxesIds(e){var t,n;return(n=(t=await this.getColumnSpecById(e))==null?void 0:t.axesSpec.map(r=>Lr.fromAxisSpec(r)))!=null?n:[]}async getRequestColumnsFromSelectedSources(e){var t,n;const r=[];for(const a of e)if(kn(a)){const i=(n=(t=await this.getColumnSpecById(a))==null?void 0:t.axesSpec)!=null?n:[];r.push(...i.map(o=>Lr.fromAxisSpec(o).toPFrameId()))}return r}async getColumnsList(){return this.pframeDriver.listColumns(this.pframeHandle)}async getColumnsFull(e,t,n,r,a){try{const i={columnFilter:{type:n,name:r,annotationValue:a},compatibleWith:await this.getRequestColumnsFromSelectedSources(e),strictlyCompatible:t},o=Date.now(),s=await this.pframeDriver.findColumns(this.pframeHandle,i),c=[];return s.hits.forEach(f=>{c.push(f)}),c}catch(i){throw console.error("PFrame: findColumns error"),i}}async getColumns(e,t,n,r,a){return(await this.getColumnsFull(e,t,n,r,a)).map(i=>new Q2({name:i.columnId,type:i.spec.valueType}))}async findColumnBy(e,t,n,r){try{const a={columnFilter:{name:[e],...t?{type:[t]}:{},...n?{annotationValue:n}:{},...r?{domainValue:r}:{}},compatibleWith:[],strictlyCompatible:!1},i=Date.now(),o=await this.pframeDriver.findColumns(this.pframeHandle,a),s=[];return o.hits.forEach(({columnId:c,spec:f})=>{s.push(new Q2({name:c,type:f.valueType}))}),s.length>1&&console.warn(`More than 1 column found for ${e}}`),s.length===0?(console.warn(`No columns found for ${e}}`),null):s[0]}catch(a){throw console.error("PFrame: findColumns error"),a}}},nre=class{constructor(e,t,n=(r,a)=>a??r){this.labelsModifier=n,this.pFrameProvider=new tre(e,t)}},vI={controllers:{discrete:new Gne,scatterplot:new Kne,"scatterplot-umap":new Jne,heatmap:new Wne,dendro:new ere,histogram:new jne,bubble:new Fne},initialStates:{discrete:Une,scatterplot:Xne,"scatterplot-umap":Zne,heatmap:Yne,dendro:qne,histogram:Qne,bubble:One}};function yw(e){return vI.controllers[e]}function mI(e){return vI.initialStates[e]}const mr=(e,t)=>{const n=e.__vccOpts||e;for(const[r,a]of t)n[r]=a;return n},rre={},are={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ire(e,t){return d.openBlock(),d.createElementBlock("svg",are,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5 1.25H4.25V2.75H5H6.25L6.25 5H4C3.44772 5 3 5.44772 3 6V8V9.25V10V10.75V12V16C3 16.5523 3.44772 17 4 17H6.25V21.25H5H4.25V22.75H5H9H9.75V21.25H9H7.75V17H10C10.5523 17 11 16.5523 11 16V12V10.75V10V9.25V8V6C11 5.44771 10.5523 5 10 5H7.75V2.75H9H9.75V1.25H9H5ZM4.5 10.75H9.5V12V15.5H4.5V12V10.75ZM9.5 9.25H4.5V8V6.5H9.5V8V9.25Z",fill:"#110529"},null,-1),d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M17 1C17.5523 1 18 1.44772 18 2C18 2.55228 17.5523 3 17 3C16.4477 3 16 2.55228 16 2C16 1.44772 16.4477 1 17 1ZM15 6.75H16.25L16.25 9H14C13.4477 9 13 9.44771 13 10V12.125V13.25V14V14.75V16V18C13 18.5523 13.4477 19 14 19H16.25L16.25 21.25H15H14.25V22.75H15H19H19.75V21.25H19H17.75V19H20C20.5523 19 21 18.5523 21 18V16V14.75V14V13.25V12.125V10C21 9.44771 20.5523 9 20 9H17.75V6.75H19H19.75V5.25H19H15H14.25V6.75H15ZM16.25 10.5H14.5V12.125V13.25H19.5V12.125V10.5H17.75H16.25ZM14.5 16V14.75H19.5V16V17.5H14.5V16Z",fill:"#07AD3E"},null,-1)]))}const ore=mr(rre,[["render",ire]]),lre={},sre={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ure(e,t){return d.openBlock(),d.createElementBlock("svg",sre,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5 1.25H4.25V2.75H5H6.25L6.25 5H4C3.44772 5 3 5.44772 3 6V8V9.25V10V10.75V12V16C3 16.5523 3.44772 17 4 17H6.25L6.25 21.25H5H4.25V22.75H5H9H9.75V21.25H9H7.75V17H10C10.5523 17 11 16.5523 11 16V12V10.75V10V9.25V8V6C11 5.44771 10.5523 5 10 5H7.75V2.75H9H9.75V1.25H9H5ZM4.5 10.75H9.5V12V15.5H4.5V12V10.75ZM9.5 9.25H4.5V8V6.5H9.5V8V9.25Z",fill:"#110529"},null,-1),d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14.25 7C14.25 5.75736 15.2574 4.75 16.5 4.75C17.7426 4.75 18.75 5.75736 18.75 7C18.75 7.08866 18.7449 7.17613 18.7349 7.26211C19.8671 7.37957 20.75 8.33668 20.75 9.5C20.75 10.6633 19.8671 11.6204 18.7349 11.7379C18.7449 11.8239 18.75 11.9113 18.75 12C18.75 13.2426 17.7426 14.25 16.5 14.25C15.2574 14.25 14.25 13.2426 14.25 12C14.25 11.9113 14.2551 11.8239 14.2651 11.7379C13.1329 11.6204 12.25 10.6633 12.25 9.5C12.25 8.33668 13.1329 7.37957 14.2651 7.26211C14.2551 7.17613 14.25 7.08866 14.25 7ZM16.5 6.25C16.0858 6.25 15.75 6.58579 15.75 7C15.75 7.41421 16.0858 7.75 16.5 7.75C16.9142 7.75 17.25 7.41421 17.25 7C17.25 6.58579 16.9142 6.25 16.5 6.25ZM13.75 9.5C13.75 9.08579 14.0858 8.75 14.5 8.75C14.9142 8.75 15.25 9.08579 15.25 9.5C15.25 9.91421 14.9142 10.25 14.5 10.25C14.0858 10.25 13.75 9.91421 13.75 9.5ZM18.5 8.75C18.0858 8.75 17.75 9.08579 17.75 9.5C17.75 9.91421 18.0858 10.25 18.5 10.25C18.9142 10.25 19.25 9.91421 19.25 9.5C19.25 9.08579 18.9142 8.75 18.5 8.75ZM14.25 18.5C14.25 17.2574 15.2574 16.25 16.5 16.25C17.7426 16.25 18.75 17.2574 18.75 18.5C18.75 19.7426 17.7426 20.75 16.5 20.75C15.2574 20.75 14.25 19.7426 14.25 18.5ZM16.5 17.75C16.0858 17.75 15.75 18.0858 15.75 18.5C15.75 18.9142 16.0858 19.25 16.5 19.25C16.9142 19.25 17.25 18.9142 17.25 18.5C17.25 18.0858 16.9142 17.75 16.5 17.75ZM15.75 12C15.75 11.5858 16.0858 11.25 16.5 11.25C16.9142 11.25 17.25 11.5858 17.25 12C17.25 12.4142 16.9142 12.75 16.5 12.75C16.0858 12.75 15.75 12.4142 15.75 12Z",fill:"#07AD3E"},null,-1)]))}const cre=mr(lre,[["render",ure]]),fre={},dre={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Are(e,t){return d.openBlock(),d.createElementBlock("svg",dre,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5 1.25H4.25V2.75H5H6.25L6.25 5H4C3.44772 5 3 5.44772 3 6V8V9.25V10V10.75V12V16C3 16.5523 3.44772 17 4 17H6.25L6.25 21.25H5H4.25V22.75H5H9H9.75V21.25H9H7.75V17H10C10.5523 17 11 16.5523 11 16V12V10.75V10V9.25V8V6C11 5.44771 10.5523 5 10 5H7.75V2.75H9H9.75V1.25H9H5ZM4.5 10.75H9.5V12V15.5H4.5V12V10.75ZM9.5 9.25H4.5V8V6.5H9.5V8V9.25Z",fill:"#110529"},null,-1),d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M18 3C18 3.55228 17.5523 4 17 4C16.4477 4 16 3.55228 16 3C16 2.44772 16.4477 2 17 2C17.5523 2 18 2.44772 18 3ZM17 15C17 15.5523 16.5523 16 16 16C15.4477 16 15 15.5523 15 15C15 14.4477 15.4477 14 16 14C16.5523 14 17 14.4477 17 15ZM18 17.5C18.5523 17.5 19 17.0523 19 16.5C19 15.9477 18.5523 15.5 18 15.5C17.4477 15.5 17 15.9477 17 16.5C17 17.0523 17.4477 17.5 18 17.5ZM17 6.5C17 7.05228 16.5523 7.5 16 7.5C15.4477 7.5 15 7.05228 15 6.5C15 5.94772 15.4477 5.5 16 5.5C16.5523 5.5 17 5.94772 17 6.5ZM18 9.5C18.5523 9.5 19 9.05228 19 8.5C19 7.94772 18.5523 7.5 18 7.5C17.4477 7.5 17 7.94772 17 8.5C17 9.05228 17.4477 9.5 18 9.5ZM21 15C21 15.5523 20.5523 16 20 16C19.4477 16 19 15.5523 19 15C19 14.4477 19.4477 14 20 14C20.5523 14 21 14.4477 21 15ZM15 13.5C15.5523 13.5 16 13.0523 16 12.5C16 11.9477 15.5523 11.5 15 11.5C14.4477 11.5 14 11.9477 14 12.5C14 13.0523 14.4477 13.5 15 13.5ZM15 16.5C15 17.0523 14.5523 17.5 14 17.5C13.4477 17.5 13 17.0523 13 16.5C13 15.9477 13.4477 15.5 14 15.5C14.5523 15.5 15 15.9477 15 16.5ZM16 19C16.5523 19 17 18.5523 17 18C17 17.4477 16.5523 17 16 17C15.4477 17 15 17.4477 15 18C15 18.5523 15.4477 19 16 19ZM18 11C18 11.5523 17.5523 12 17 12C16.4477 12 16 11.5523 16 11C16 10.4477 16.4477 10 17 10C17.5523 10 18 10.4477 18 11ZM18 14.5C18.5523 14.5 19 14.0523 19 13.5C19 12.9477 18.5523 12.5 18 12.5C17.4477 12.5 17 12.9477 17 13.5C17 14.0523 17.4477 14.5 18 14.5ZM18 20.5C18 21.0523 17.5523 21.5 17 21.5C16.4477 21.5 16 21.0523 16 20.5C16 19.9477 16.4477 19.5 17 19.5C17.5523 19.5 18 19.9477 18 20.5Z",fill:"#07AD3E"},null,-1)]))}const hre=mr(fre,[["render",Are]]),pre={},vre={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function mre(e,t){return d.openBlock(),d.createElementBlock("svg",vre,t[0]||(t[0]=[d.createStaticVNode('<path d="M3 21.25H21" stroke="#110529" stroke-width="1.5" stroke-linecap="square"></path><path d="M3 4L3 2.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 7L3 5.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 10L3 8.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 13L3 11.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 16L3 14.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 19L3 17.5" stroke="#110529" stroke-width="1.5"></path><path d="M14 11.5C14 12.3284 13.3284 13 12.5 13C11.6716 13 11 12.3284 11 11.5C11 10.6716 11.6716 10 12.5 10C13.3284 10 14 10.6716 14 11.5Z" stroke="#07AD3E" stroke-width="1.5"></path><path d="M14 14.5C14 15.3284 13.3284 16 12.5 16C11.6716 16 11 15.3284 11 14.5C11 13.6716 11.6716 13 12.5 13C13.3284 13 14 13.6716 14 14.5Z" stroke="#07AD3E" stroke-width="1.5"></path><path d="M14 17.5C14 18.3284 13.3284 19 12.5 19C11.6716 19 11 18.3284 11 17.5C11 16.6716 11.6716 16 12.5 16C13.3284 16 14 16.6716 14 17.5Z" stroke="#07AD3E" stroke-width="1.5"></path><path d="M9 17.5C9 18.3284 8.32843 19 7.5 19C6.67157 19 6 18.3284 6 17.5C6 16.6716 6.67157 16 7.5 16C8.32843 16 9 16.6716 9 17.5Z" stroke="#07AD3E" stroke-width="1.5"></path><path d="M17 8.5C17 9.32843 16.3284 10 15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7C16.3284 7 17 7.67157 17 8.5Z" stroke="#07AD3E" stroke-width="1.5"></path><path d="M17 5.5C17 6.32843 16.3284 7 15.5 7C14.6716 7 14 6.32843 14 5.5C14 4.67157 14.6716 4 15.5 4C16.3284 4 17 4.67157 17 5.5Z" stroke="#07AD3E" stroke-width="1.5"></path><path d="M17 17.5C17 18.3284 16.3284 19 15.5 19C14.6716 19 14 18.3284 14 17.5C14 16.6716 14.6716 16 15.5 16C16.3284 16 17 16.6716 17 17.5Z" stroke="#07AD3E" stroke-width="1.5"></path><path d="M20 17.5C20 18.3284 19.3284 19 18.5 19C17.6716 19 17 18.3284 17 17.5C17 16.6716 17.6716 16 18.5 16C19.3284 16 20 16.6716 20 17.5Z" stroke="#07AD3E" stroke-width="1.5"></path><path d="M20 14.5C20 15.3284 19.3284 16 18.5 16C17.6716 16 17 15.3284 17 14.5C17 13.6716 17.6716 13 18.5 13C19.3284 13 20 13.6716 20 14.5Z" stroke="#07AD3E" stroke-width="1.5"></path><path d="M17 14.5C17 15.3284 16.3284 16 15.5 16C14.6716 16 14 15.3284 14 14.5C14 13.6716 14.6716 13 15.5 13C16.3284 13 17 13.6716 17 14.5Z" stroke="#07AD3E" stroke-width="1.5"></path><path d="M17 11.5C17 12.3284 16.3284 13 15.5 13C14.6716 13 14 12.3284 14 11.5C14 10.6716 14.6716 10 15.5 10C16.3284 10 17 10.6716 17 11.5Z" stroke="#07AD3E" stroke-width="1.5"></path>',18)]))}const gre=mr(pre,[["render",mre]]),yre={},wre={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function bre(e,t){return d.openBlock(),d.createElementBlock("svg",wre,t[0]||(t[0]=[d.createStaticVNode('<path d="M18 3C18 3.55228 17.5523 4 17 4C16.4477 4 16 3.55228 16 3C16 2.44772 16.4477 2 17 2C17.5523 2 18 2.44772 18 3Z" fill="#07AD3E"></path><path d="M17 15C17 15.5523 16.5523 16 16 16C15.4477 16 15 15.5523 15 15C15 14.4477 15.4477 14 16 14C16.5523 14 17 14.4477 17 15Z" fill="#07AD3E"></path><path d="M18 17.5C18.5523 17.5 19 17.0523 19 16.5C19 15.9477 18.5523 15.5 18 15.5C17.4477 15.5 17 15.9477 17 16.5C17 17.0523 17.4477 17.5 18 17.5Z" fill="#07AD3E"></path><path d="M17 6.5C17 7.05228 16.5523 7.5 16 7.5C15.4477 7.5 15 7.05228 15 6.5C15 5.94772 15.4477 5.5 16 5.5C16.5523 5.5 17 5.94772 17 6.5Z" fill="#07AD3E"></path><path d="M18 9.5C18.5523 9.5 19 9.05228 19 8.5C19 7.94772 18.5523 7.5 18 7.5C17.4477 7.5 17 7.94772 17 8.5C17 9.05228 17.4477 9.5 18 9.5Z" fill="#07AD3E"></path><path d="M21 15C21 15.5523 20.5523 16 20 16C19.4477 16 19 15.5523 19 15C19 14.4477 19.4477 14 20 14C20.5523 14 21 14.4477 21 15Z" fill="#07AD3E"></path><path d="M15 13.5C15.5523 13.5 16 13.0523 16 12.5C16 11.9477 15.5523 11.5 15 11.5C14.4477 11.5 14 11.9477 14 12.5C14 13.0523 14.4477 13.5 15 13.5Z" fill="#07AD3E"></path><path d="M15 16.5C15 17.0523 14.5523 17.5 14 17.5C13.4477 17.5 13 17.0523 13 16.5C13 15.9477 13.4477 15.5 14 15.5C14.5523 15.5 15 15.9477 15 16.5Z" fill="#07AD3E"></path><path d="M16 19C16.5523 19 17 18.5523 17 18C17 17.4477 16.5523 17 16 17C15.4477 17 15 17.4477 15 18C15 18.5523 15.4477 19 16 19Z" fill="#07AD3E"></path><path d="M18 11C18 11.5523 17.5523 12 17 12C16.4477 12 16 11.5523 16 11C16 10.4477 16.4477 10 17 10C17.5523 10 18 10.4477 18 11Z" fill="#07AD3E"></path><path d="M18 14.5C18.5523 14.5 19 14.0523 19 13.5C19 12.9477 18.5523 12.5 18 12.5C17.4477 12.5 17 12.9477 17 13.5C17 14.0523 17.4477 14.5 18 14.5Z" fill="#07AD3E"></path><path d="M18 20.5C18 21.0523 17.5523 21.5 17 21.5C16.4477 21.5 16 21.0523 16 20.5C16 19.9477 16.4477 19.5 17 19.5C17.5523 19.5 18 19.9477 18 20.5Z" fill="#07AD3E"></path><path d="M8 3C8 2.44772 7.55228 2 7 2C6.44772 2 6 2.44772 6 3C6 3.55228 6.44772 4 7 4C7.55228 4 8 3.55228 8 3Z" fill="#110529"></path><path d="M6 4.5C6.55228 4.5 7 4.94772 7 5.5C7 6.05228 6.55228 6.5 6 6.5C5.44772 6.5 5 6.05228 5 5.5C5 4.94772 5.44772 4.5 6 4.5Z" fill="#110529"></path><path d="M5 7C5 6.44772 4.55228 6 4 6C3.44772 6 3 6.44772 3 7C3 7.55228 3.44772 8 4 8C4.55228 8 5 7.55228 5 7Z" fill="#110529"></path><path d="M8 6C8.55228 6 9 6.44772 9 7C9 7.55228 8.55228 8 8 8C7.44772 8 7 7.55228 7 7C7 6.44772 7.44772 6 8 6Z" fill="#110529"></path><path d="M7 8.5C7 7.94772 6.55228 7.5 6 7.5C5.44772 7.5 5 7.94772 5 8.5C5 9.05228 5.44772 9.5 6 9.5C6.55228 9.5 7 9.05228 7 8.5Z" fill="#110529"></path><path d="M8 20.5C8 19.9477 7.55228 19.5 7 19.5C6.44772 19.5 6 19.9477 6 20.5C6 21.0523 6.44772 21.5 7 21.5C7.55228 21.5 8 21.0523 8 20.5Z" fill="#110529"></path><path d="M7 17C7 16.4477 6.55228 16 6 16C5.44772 16 5 16.4477 5 17C5 17.5523 5.44772 18 6 18C6.55228 18 7 17.5523 7 17Z" fill="#110529"></path><path d="M8 14C8.55228 14 9 14.4477 9 15C9 15.5523 8.55228 16 8 16C7.44772 16 7 15.5523 7 15C7 14.4477 7.44772 14 8 14Z" fill="#110529"></path><path d="M11 8.5C11 7.94772 10.5523 7.5 10 7.5C9.44772 7.5 9 7.94772 9 8.5C9 9.05228 9.44772 9.5 10 9.5C10.5523 9.5 11 9.05228 11 8.5Z" fill="#110529"></path><path d="M5 10C5.55228 10 6 10.4477 6 11C6 11.5523 5.55228 12 5 12C4.44772 12 4 11.5523 4 11C4 10.4477 4.44772 10 5 10Z" fill="#110529"></path><path d="M8 12.5C8 11.9477 7.55228 11.5 7 11.5C6.44772 11.5 6 11.9477 6 12.5C6 13.0523 6.44772 13.5 7 13.5C7.55228 13.5 8 13.0523 8 12.5Z" fill="#110529"></path><path d="M8 9C8.55228 9 9 9.44772 9 10C9 10.5523 8.55228 11 8 11C7.44772 11 7 10.5523 7 10C7 9.44772 7.44772 9 8 9Z" fill="#110529"></path>',24)]))}const Cre=mr(yre,[["render",bre]]),Sre={},xre={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Ere(e,t){return d.openBlock(),d.createElementBlock("svg",xre,t[0]||(t[0]=[d.createElementVNode("path",{d:"M5.25 6.225C5.25 5.2973 5.72673 4.83692 6.50349 4.27228C6.57903 4.21737 6.65984 4.16045 6.74435 4.10093C7.13565 3.82533 7.60622 3.49391 8 3.04693C8.39378 3.49391 8.86435 3.82533 9.25565 4.10093C9.34016 4.16045 9.42097 4.21737 9.49651 4.27228C10.2733 4.83692 10.75 5.2973 10.75 6.225C10.75 6.98245 10.4136 7.42894 9.96423 7.88766C9.91223 7.94075 9.85282 7.99937 9.78954 8.06181C9.60563 8.24327 9.38899 8.45703 9.22609 8.66134C8.98372 8.96531 8.75 9.37152 8.75 9.9C8.75 10.2529 8.89718 10.5561 9.04005 10.7795C9.1882 11.0112 9.38331 11.2356 9.5837 11.4445C9.81868 11.6895 10.1205 11.9716 10.424 12.2553C10.6132 12.4321 10.8031 12.6096 10.9779 12.779C11.4667 13.2531 11.9187 13.7374 12.2473 14.2398C12.5747 14.7403 12.75 15.214 12.75 15.675C12.75 16.8257 11.9675 17.5375 10.6808 18.4832C10.5917 18.5487 10.5001 18.6153 10.4066 18.6832C9.61093 19.2617 8.67831 19.9396 8 20.8746C7.32169 19.9396 6.38907 19.2617 5.59338 18.6832C5.49988 18.6153 5.40827 18.5487 5.31918 18.4832C4.03253 17.5375 3.25 16.8257 3.25 15.675C3.25 15.2151 3.42451 14.7479 3.75038 14.2556C4.07818 13.7604 4.52918 13.2845 5.01908 12.8148C5.17958 12.6609 5.35137 12.5014 5.52353 12.3416C5.84428 12.0438 6.16631 11.7448 6.419 11.4786C6.62115 11.2656 6.81744 11.0354 6.96613 10.7948C7.11184 10.559 7.25 10.2526 7.25 9.9C7.25 9.36255 7.02776 8.9483 6.77782 8.62937C6.60371 8.4072 6.37475 8.18497 6.18446 8.00027C6.12892 7.94636 6.07668 7.89566 6.03005 7.84908C5.58055 7.40004 5.25 6.97698 5.25 6.225Z",stroke:"#110529","stroke-width":"1.5"},null,-1),d.createElementVNode("path",{d:"M16.1603 11.6035C16.5892 12.0178 17.0904 12.5021 17.5 13.1017C17.9096 12.5021 18.4108 12.0178 18.8397 11.6035C18.8575 11.5863 18.8751 11.5692 18.8927 11.5522C19.7742 10.6998 20.25 10.1824 20.25 9.5C20.25 8.81759 19.7742 8.30021 18.8927 7.4478C18.8751 7.43083 18.8575 7.41374 18.8397 7.39653C18.4108 6.98221 17.9096 6.49792 17.5 5.89827C17.0904 6.49792 16.5892 6.98221 16.1603 7.39653C16.1425 7.41374 16.1249 7.43083 16.1073 7.4478C15.2258 8.30021 14.75 8.81759 14.75 9.5C14.75 10.1824 15.2258 10.6998 16.1073 11.5522C16.1249 11.5692 16.1425 11.5863 16.1603 11.6035Z",stroke:"#07AD3E","stroke-width":"1.5"},null,-1),d.createElementVNode("circle",{cx:"17.5",cy:"18",r:"0.5",stroke:"#07AD3E"},null,-1)]))}const Bre=mr(Sre,[["render",Ere]]),_re={},Tre={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function kre(e,t){return d.openBlock(),d.createElementBlock("svg",Tre,t[0]||(t[0]=[d.createElementVNode("path",{d:"M5.25 6.225C5.25 5.2973 5.72673 4.83692 6.50349 4.27228C6.57903 4.21737 6.65984 4.16045 6.74435 4.10093C7.13565 3.82533 7.60622 3.49391 8 3.04693C8.39378 3.49391 8.86435 3.82533 9.25565 4.10093C9.34016 4.16045 9.42097 4.21737 9.49651 4.27228C10.2733 4.83692 10.75 5.2973 10.75 6.225C10.75 6.98245 10.4136 7.42894 9.96423 7.88766C9.91223 7.94075 9.85282 7.99937 9.78954 8.06181C9.60563 8.24327 9.38899 8.45703 9.22609 8.66134C8.98372 8.96531 8.75 9.37152 8.75 9.9C8.75 10.2529 8.89718 10.5561 9.04005 10.7795C9.1882 11.0112 9.38331 11.2356 9.5837 11.4445C9.81868 11.6895 10.1205 11.9716 10.424 12.2553C10.6132 12.4321 10.8031 12.6096 10.9779 12.779C11.4667 13.2531 11.9187 13.7374 12.2473 14.2398C12.5747 14.7403 12.75 15.214 12.75 15.675C12.75 16.8257 11.9675 17.5375 10.6808 18.4832C10.5917 18.5487 10.5001 18.6153 10.4066 18.6832C9.61093 19.2617 8.67831 19.9396 8 20.8746C7.32169 19.9396 6.38907 19.2617 5.59338 18.6832C5.49988 18.6153 5.40826 18.5487 5.31918 18.4832C4.03253 17.5375 3.25 16.8257 3.25 15.675C3.25 15.2151 3.42451 14.7479 3.75038 14.2556C4.07818 13.7604 4.52918 13.2845 5.01908 12.8148C5.17958 12.6609 5.35137 12.5014 5.52353 12.3416C5.84428 12.0438 6.16631 11.7448 6.419 11.4786C6.62115 11.2656 6.81744 11.0354 6.96613 10.7948C7.11184 10.559 7.25 10.2526 7.25 9.9C7.25 9.36255 7.02776 8.9483 6.77782 8.62937C6.60371 8.4072 6.37475 8.18497 6.18446 8.00027C6.12892 7.94636 6.07668 7.89566 6.03005 7.84908C5.58055 7.40004 5.25 6.97698 5.25 6.225Z",stroke:"#110529","stroke-width":"1.5"},null,-1),d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14.25 7C14.25 5.75736 15.2574 4.75 16.5 4.75C17.7426 4.75 18.75 5.75736 18.75 7C18.75 7.08866 18.7449 7.17613 18.7349 7.26211C19.8671 7.37957 20.75 8.33668 20.75 9.5C20.75 10.6633 19.8671 11.6204 18.7349 11.7379C18.7449 11.8239 18.75 11.9113 18.75 12C18.75 13.2426 17.7426 14.25 16.5 14.25C15.2574 14.25 14.25 13.2426 14.25 12C14.25 11.9113 14.2551 11.8239 14.2651 11.7379C13.1329 11.6204 12.25 10.6633 12.25 9.5C12.25 8.33668 13.1329 7.37957 14.2651 7.26211C14.2551 7.17613 14.25 7.08866 14.25 7ZM16.5 6.25C16.0858 6.25 15.75 6.58579 15.75 7C15.75 7.41421 16.0858 7.75 16.5 7.75C16.9142 7.75 17.25 7.41421 17.25 7C17.25 6.58579 16.9142 6.25 16.5 6.25ZM13.75 9.5C13.75 9.08579 14.0858 8.75 14.5 8.75C14.9142 8.75 15.25 9.08579 15.25 9.5C15.25 9.91421 14.9142 10.25 14.5 10.25C14.0858 10.25 13.75 9.91421 13.75 9.5ZM18.5 8.75C18.0858 8.75 17.75 9.08579 17.75 9.5C17.75 9.91421 18.0858 10.25 18.5 10.25C18.9142 10.25 19.25 9.91421 19.25 9.5C19.25 9.08579 18.9142 8.75 18.5 8.75ZM14.25 18.5C14.25 17.2574 15.2574 16.25 16.5 16.25C17.7426 16.25 18.75 17.2574 18.75 18.5C18.75 19.7426 17.7426 20.75 16.5 20.75C15.2574 20.75 14.25 19.7426 14.25 18.5ZM16.5 17.75C16.0858 17.75 15.75 18.0858 15.75 18.5C15.75 18.9142 16.0858 19.25 16.5 19.25C16.9142 19.25 17.25 18.9142 17.25 18.5C17.25 18.0858 16.9142 17.75 16.5 17.75ZM15.75 12C15.75 11.5858 16.0858 11.25 16.5 11.25C16.9142 11.25 17.25 11.5858 17.25 12C17.25 12.4142 16.9142 12.75 16.5 12.75C16.0858 12.75 15.75 12.4142 15.75 12Z",fill:"#07AD3E"},null,-1)]))}const Mre=mr(_re,[["render",kre]]),Pre={},Hre={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Dre(e,t){return d.openBlock(),d.createElementBlock("svg",Hre,t[0]||(t[0]=[d.createElementVNode("path",{d:"M5.25 6.225C5.25 5.2973 5.72673 4.83692 6.50349 4.27228C6.57903 4.21737 6.65984 4.16045 6.74435 4.10093C7.13565 3.82533 7.60622 3.49391 8 3.04693C8.39378 3.49391 8.86435 3.82533 9.25565 4.10093C9.34016 4.16045 9.42097 4.21737 9.49651 4.27228C10.2733 4.83692 10.75 5.2973 10.75 6.225C10.75 6.98245 10.4136 7.42894 9.96423 7.88766C9.91223 7.94075 9.85282 7.99937 9.78954 8.06181C9.60563 8.24327 9.38899 8.45703 9.22609 8.66134C8.98372 8.96531 8.75 9.37152 8.75 9.9C8.75 10.2529 8.89718 10.5561 9.04005 10.7795C9.1882 11.0112 9.38331 11.2356 9.5837 11.4445C9.81868 11.6895 10.1205 11.9716 10.424 12.2553C10.6132 12.4321 10.8031 12.6096 10.9779 12.779C11.4667 13.2531 11.9187 13.7374 12.2473 14.2398C12.5747 14.7403 12.75 15.214 12.75 15.675C12.75 16.8257 11.9675 17.5375 10.6808 18.4832C10.5917 18.5487 10.5001 18.6153 10.4066 18.6832C9.61093 19.2617 8.67831 19.9396 8 20.8746C7.32169 19.9396 6.38907 19.2617 5.59338 18.6832C5.49988 18.6153 5.40827 18.5487 5.31918 18.4832C4.03253 17.5375 3.25 16.8257 3.25 15.675C3.25 15.2151 3.42451 14.7479 3.75038 14.2556C4.07818 13.7604 4.52918 13.2845 5.01908 12.8148C5.17958 12.6609 5.35137 12.5014 5.52353 12.3416C5.84428 12.0438 6.16631 11.7448 6.419 11.4786C6.62115 11.2656 6.81744 11.0354 6.96613 10.7948C7.11184 10.559 7.25 10.2526 7.25 9.9C7.25 9.36255 7.02776 8.9483 6.77782 8.62937C6.60371 8.4072 6.37475 8.18497 6.18446 8.00027C6.12892 7.94636 6.07668 7.89566 6.03005 7.84908C5.58055 7.40004 5.25 6.97698 5.25 6.225Z",stroke:"#110529","stroke-width":"1.5"},null,-1),d.createElementVNode("path",{d:"M16.1603 11.6035C16.5892 12.0178 17.0904 12.5021 17.5 13.1017C17.9096 12.5021 18.4108 12.0178 18.8397 11.6035C18.8575 11.5863 18.8751 11.5692 18.8927 11.5522C19.7742 10.6998 20.25 10.1824 20.25 9.5C20.25 8.81759 19.7742 8.30021 18.8927 7.4478C18.8751 7.43083 18.8575 7.41374 18.8397 7.39653C18.4108 6.98221 17.9096 6.49792 17.5 5.89827C17.0904 6.49792 16.5892 6.98221 16.1603 7.39653C16.1425 7.41374 16.1249 7.43083 16.1073 7.4478C15.2258 8.30021 14.75 8.81759 14.75 9.5C14.75 10.1824 15.2258 10.6998 16.1073 11.5522C16.1249 11.5692 16.1425 11.5863 16.1603 11.6035Z",stroke:"#07AD3E","stroke-width":"1.5"},null,-1),d.createElementVNode("circle",{cx:"17.5",cy:"18",r:"0.5",stroke:"#07AD3E"},null,-1)]))}const $re=mr(Pre,[["render",Dre]]),Ire={},Lre={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Rre(e,t){return d.openBlock(),d.createElementBlock("svg",Lre,t[0]||(t[0]=[d.createStaticVNode('<path d="M3 21.25L21 21.25" stroke="#110529" stroke-width="1.5" stroke-linecap="square"></path><path d="M3 4L3 2.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 7L3 5.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 10L3 8.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 13L3 11.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 16L3 14.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 19L3 17.5" stroke="#110529" stroke-width="1.5"></path><path d="M7 19L7 10" stroke="#07AD3E" stroke-width="1.5"></path><path d="M11 19L11 14" stroke="#110529" stroke-width="1.5"></path><path d="M15 19L15 3" stroke="#07AD3E" stroke-width="1.5"></path><path d="M19 19L19 7" stroke="#110529" stroke-width="1.5"></path>',11)]))}const gI=mr(Ire,[["render",Rre]]),Vre={},Nre={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function zre(e,t){return d.openBlock(),d.createElementBlock("svg",Nre,t[0]||(t[0]=[d.createStaticVNode('<path d="M3 21.25L21 21.25" stroke="#110529" stroke-width="1.5" stroke-linecap="square"></path><path d="M3 4L3 2.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 7L3 5.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 10L3 8.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 13L3 11.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 16L3 14.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 19L3 17.5" stroke="#110529" stroke-width="1.5"></path><path d="M5.49982 10.5L10.5037 5.49615C10.7829 5.21695 11.2307 5.20204 11.5279 5.46205L14.4718 8.03795C14.7689 8.29796 15.2168 8.28305 15.496 8.00385L20.4998 3" stroke="#07AD3E" stroke-width="1.5"></path><path d="M7 14V19" stroke="#110529" stroke-width="1.5"></path><path d="M11 10L11 19" stroke="#110529" stroke-width="1.5"></path><path d="M15 12V19" stroke="#110529" stroke-width="1.5"></path><path d="M19 9L19 19" stroke="#110529" stroke-width="1.5"></path>',12)]))}const yI=mr(Vre,[["render",zre]]),Ore={},Fre={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Qre(e,t){return d.openBlock(),d.createElementBlock("svg",Fre,t[0]||(t[0]=[d.createStaticVNode('<path d="M3 21.25L21 21.25" stroke="#110529" stroke-width="1.5" stroke-linecap="square"></path><path d="M3 4L3 2.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 7L3 5.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 10L3 8.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 13L3 11.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 16L3 14.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 19L3 17.5" stroke="#110529" stroke-width="1.5"></path><path d="M11.25 11V13V16V18C11.25 18.1381 11.1381 18.25 11 18.25H9H7C6.86193 18.25 6.75 18.1381 6.75 18V16V13V11C6.75 10.8619 6.86193 10.75 7 10.75H9H11C11.1381 10.75 11.25 10.8619 11.25 11Z" stroke="#07AD3E" stroke-width="1.5" stroke-linecap="round"></path><path d="M9.75 8V7.25H8.25V8H9.75ZM9.75 14V8H8.25V14H9.75Z" fill="#07AD3E"></path><path d="M19.25 6V9.66667V14.3333V18C19.25 18.1381 19.1381 18.25 19 18.25H17H15C14.8619 18.25 14.75 18.1381 14.75 18V14.3333V9.66667V6C14.75 5.86193 14.8619 5.75 15 5.75H17H19C19.1381 5.75 19.25 5.86193 19.25 6Z" stroke="#110529" stroke-width="1.5" stroke-linecap="round"></path><path d="M17 9V3" stroke="#110529" stroke-width="1.5" stroke-linecap="square"></path>',11)]))}const jre=mr(Ore,[["render",Qre]]),Ure={},Gre={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Yre(e,t){return d.openBlock(),d.createElementBlock("svg",Gre,t[0]||(t[0]=[d.createStaticVNode('<path d="M3 21.25L21 21.25" stroke="#110529" stroke-width="1.5" stroke-linecap="square"></path><path d="M3 4L3 2.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 7L3 5.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 10L3 8.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 13L3 11.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 16L3 14.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 19L3 17.5" stroke="#110529" stroke-width="1.5"></path><path d="M11 19L11 14" stroke="#110529" stroke-width="1.5"></path><path d="M11 13L11 9" stroke="#07AD3E" stroke-width="1.5"></path><path d="M15 19L15 7" stroke="#110529" stroke-width="1.5"></path><path d="M7 19L7 11" stroke="#110529" stroke-width="1.5"></path><path d="M19 19L19 11" stroke="#110529" stroke-width="1.5"></path><path d="M15 6L15 3" stroke="#07AD3E" stroke-width="1.5"></path><path d="M7 10L7 7" stroke="#07AD3E" stroke-width="1.5"></path><path d="M19 10L19 6" stroke="#07AD3E" stroke-width="1.5"></path>',15)]))}const Wre=mr(Ure,[["render",Yre]]),Xre={},Kre={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Zre(e,t){return d.openBlock(),d.createElementBlock("svg",Kre,t[0]||(t[0]=[d.createStaticVNode('<path d="M3 21.25L21 21.25" stroke="#110529" stroke-width="1.5" stroke-linecap="square"></path><path d="M3 4L3 2.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 7L3 5.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 10L3 8.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 13L3 11.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 16L3 14.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 19L3 17.5" stroke="#110529" stroke-width="1.5"></path><path d="M6 17L10.3949 10.1634C10.4567 10.0673 10.5759 10.0253 10.6843 10.0614L16.3157 11.9386C16.4241 11.9747 16.5433 11.9327 16.6051 11.8366L21 5" stroke="#07AD3E" stroke-width="1.5"></path>',8)]))}const wI=mr(Xre,[["render",Zre]]),Jre={},qre={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function eae(e,t){return d.openBlock(),d.createElementBlock("svg",qre,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7.87166 17.4862C6.72148 18.5589 5.21191 19.25 3 19.25H2.25V20.75H3C5.01 20.75 6.5821 20.2481 7.84779 19.4106C7.78374 19.1173 7.75 18.8126 7.75 18.5C7.75 18.1506 7.79216 17.8111 7.87166 17.4862ZM16.5833 6.12522C17.6721 5.27714 19.0682 4.75 21 4.75H21.75V3.25H21C18.7445 3.25 17.0404 3.882 15.702 4.91089C15.8578 5.18652 15.9838 5.48129 16.0755 5.79079C16.253 5.8903 16.4227 6.00217 16.5833 6.12522ZM3.75 5.5L3.75 4H2.25L2.25 5.5H3.75ZM3.75 8.5V7H2.25L2.25 8.5H3.75ZM3.75 10L3.75 11.5H2.25L2.25 10H3.75ZM3.75 14.5V13H2.25V14.5H3.75ZM3.75 16L3.75 17.5H2.25V16H3.75ZM20.25 6.5V8L21.75 8V6.5H20.25ZM20.25 11V9.5H21.75V11H20.25ZM20.25 12.5V14H21.75V12.5H20.25ZM20.25 17V15.5H21.75V17H20.25ZM20.25 20V18.5H21.75V20H20.25Z",fill:"#110529"},null,-1),d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9.75 7C9.75 5.75736 10.7574 4.75 12 4.75C13.2426 4.75 14.25 5.75736 14.25 7C14.25 7.08866 14.2449 7.17613 14.2349 7.26211C15.3671 7.37957 16.25 8.33668 16.25 9.5C16.25 10.6633 15.3671 11.6204 14.2349 11.7379C14.2449 11.8239 14.25 11.9113 14.25 12C14.25 13.2426 13.2426 14.25 12 14.25C10.7574 14.25 9.75 13.2426 9.75 12C9.75 11.9113 9.75513 11.8239 9.7651 11.7379C8.63285 11.6204 7.75 10.6633 7.75 9.5C7.75 8.33668 8.63285 7.37957 9.7651 7.26211C9.75513 7.17613 9.75 7.08866 9.75 7ZM12 6.25C11.5858 6.25 11.25 6.58579 11.25 7C11.25 7.41421 11.5858 7.75 12 7.75C12.4142 7.75 12.75 7.41421 12.75 7C12.75 6.58579 12.4142 6.25 12 6.25ZM9.25 9.5C9.25 9.08579 9.58579 8.75 10 8.75C10.4142 8.75 10.75 9.08579 10.75 9.5C10.75 9.91421 10.4142 10.25 10 10.25C9.58579 10.25 9.25 9.91421 9.25 9.5ZM14 8.75C13.5858 8.75 13.25 9.08579 13.25 9.5C13.25 9.91421 13.5858 10.25 14 10.25C14.4142 10.25 14.75 9.91421 14.75 9.5C14.75 9.08579 14.4142 8.75 14 8.75ZM9.75 18.5C9.75 17.2574 10.7574 16.25 12 16.25C13.2426 16.25 14.25 17.2574 14.25 18.5C14.25 19.7426 13.2426 20.75 12 20.75C10.7574 20.75 9.75 19.7426 9.75 18.5ZM12 17.75C11.5858 17.75 11.25 18.0858 11.25 18.5C11.25 18.9142 11.5858 19.25 12 19.25C12.4142 19.25 12.75 18.9142 12.75 18.5C12.75 18.0858 12.4142 17.75 12 17.75ZM11.25 12C11.25 11.5858 11.5858 11.25 12 11.25C12.4142 11.25 12.75 11.5858 12.75 12C12.75 12.4142 12.4142 12.75 12 12.75C11.5858 12.75 11.25 12.4142 11.25 12Z",fill:"#07AD3E"},null,-1)]))}const tae=mr(Jre,[["render",eae]]),nae={},rae={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function aae(e,t){return d.openBlock(),d.createElementBlock("svg",rae,t[0]||(t[0]=[d.createStaticVNode('<path fill-rule="evenodd" clip-rule="evenodd" d="M6.66173 18.3797C5.69642 18.9269 4.51239 19.25 3 19.25H2.25V20.75H3C5.08009 20.75 6.69121 20.2125 7.97909 19.3218C7.45744 19.133 7.00308 18.8038 6.66173 18.3797ZM15.6198 7.03708C15.6306 7.02483 15.6415 7.01261 15.6524 7.00044C16.858 5.65468 18.4693 4.75 21 4.75H21.75V3.25H21C18.0608 3.25 16.0579 4.32325 14.5803 5.94949C15.0122 6.21765 15.3709 6.59244 15.6198 7.03708ZM3.75 5.5L3.75 4H2.25L2.25 5.5H3.75ZM3.75 8.5V7H2.25L2.25 8.5H3.75ZM3.75 10L3.75 11.5H2.25L2.25 10H3.75ZM3.75 14.5V13H2.25V14.5H3.75ZM3.75 16L3.75 17.5H2.25V16H3.75ZM20.25 6.5V8L21.75 8V6.5H20.25ZM20.25 11V9.5H21.75V11H20.25ZM20.25 12.5V14H21.75V12.5H20.25ZM20.25 17V15.5H21.75V17H20.25ZM20.25 20V18.5H21.75V20H20.25Z" fill="#110529"></path><path d="M13 3C13 3.55228 12.5523 4 12 4C11.4477 4 11 3.55228 11 3C11 2.44772 11.4477 2 12 2C12.5523 2 13 2.44772 13 3Z" fill="#07AD3E"></path><path d="M12 15C12 15.5523 11.5523 16 11 16C10.4477 16 10 15.5523 10 15C10 14.4477 10.4477 14 11 14C11.5523 14 12 14.4477 12 15Z" fill="#07AD3E"></path><path d="M13 17.5C13.5523 17.5 14 17.0523 14 16.5C14 15.9477 13.5523 15.5 13 15.5C12.4477 15.5 12 15.9477 12 16.5C12 17.0523 12.4477 17.5 13 17.5Z" fill="#07AD3E"></path><path d="M12 6.5C12 7.05228 11.5523 7.5 11 7.5C10.4477 7.5 10 7.05228 10 6.5C10 5.94772 10.4477 5.5 11 5.5C11.5523 5.5 12 5.94772 12 6.5Z" fill="#07AD3E"></path><path d="M13 9.5C13.5523 9.5 14 9.05228 14 8.5C14 7.94772 13.5523 7.5 13 7.5C12.4477 7.5 12 7.94772 12 8.5C12 9.05228 12.4477 9.5 13 9.5Z" fill="#07AD3E"></path><path d="M16 15C16 15.5523 15.5523 16 15 16C14.4477 16 14 15.5523 14 15C14 14.4477 14.4477 14 15 14C15.5523 14 16 14.4477 16 15Z" fill="#07AD3E"></path><path d="M10 13.5C10.5523 13.5 11 13.0523 11 12.5C11 11.9477 10.5523 11.5 10 11.5C9.44772 11.5 9 11.9477 9 12.5C9 13.0523 9.44772 13.5 10 13.5Z" fill="#07AD3E"></path><path d="M10 16.5C10 17.0523 9.55228 17.5 9 17.5C8.44772 17.5 8 17.0523 8 16.5C8 15.9477 8.44772 15.5 9 15.5C9.55228 15.5 10 15.9477 10 16.5Z" fill="#07AD3E"></path><path d="M11 19C11.5523 19 12 18.5523 12 18C12 17.4477 11.5523 17 11 17C10.4477 17 10 17.4477 10 18C10 18.5523 10.4477 19 11 19Z" fill="#07AD3E"></path><path d="M13 11C13 11.5523 12.5523 12 12 12C11.4477 12 11 11.5523 11 11C11 10.4477 11.4477 10 12 10C12.5523 10 13 10.4477 13 11Z" fill="#07AD3E"></path><path d="M13 14.5C13.5523 14.5 14 14.0523 14 13.5C14 12.9477 13.5523 12.5 13 12.5C12.4477 12.5 12 12.9477 12 13.5C12 14.0523 12.4477 14.5 13 14.5Z" fill="#07AD3E"></path><path d="M13 20.5C13 21.0523 12.5523 21.5 12 21.5C11.4477 21.5 11 21.0523 11 20.5C11 19.9477 11.4477 19.5 12 19.5C12.5523 19.5 13 19.9477 13 20.5Z" fill="#07AD3E"></path>',13)]))}const bI=mr(nae,[["render",aae]]),iae={},oae={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function lae(e,t){return d.openBlock(),d.createElementBlock("svg",oae,t[0]||(t[0]=[d.createElementVNode("path",{d:"M5 16.5C13.5556 16.5 10.4444 7.5 19 7.5",stroke:"#07AD3E","stroke-width":"1.5"},null,-1),d.createElementVNode("path",{d:"M5 21.25V16.5V11.75M5 21.25H8M5 21.25H2M5 11.75H8M5 11.75H2M5 9.5V8M5 6.5V5M5 3.5V2",stroke:"#110529","stroke-width":"1.5"},null,-1),d.createElementVNode("path",{d:"M5 21.25V16.5V11.75M5 21.25H8M5 21.25H2M5 11.75H8M5 11.75H2M5 9.5V8M5 6.5V5M5 3.5V2",stroke:"#110529","stroke-width":"1.5"},null,-1),d.createElementVNode("path",{d:"M19 2.75V7.5V12.25M19 2.75H16M19 2.75H22M19 12.25H16M19 12.25H22M19 14.5V16M19 17.5V19M19 20.5V22",stroke:"#110529","stroke-width":"1.5"},null,-1)]))}const sae=mr(iae,[["render",lae]]),uae={},cae={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function fae(e,t){return d.openBlock(),d.createElementBlock("svg",cae,t[0]||(t[0]=[d.createStaticVNode('<path d="M18 4.5C18 3.94772 17.5523 3.5 17 3.5C16.4477 3.5 16 3.94772 16 4.5C16 5.05228 16.4477 5.5 17 5.5C17.5523 5.5 18 5.05228 18 4.5Z" fill="#07AD3E"></path><path d="M17 18.5C17.5523 18.5 18 18.9477 18 19.5C18 20.0523 17.5523 20.5 17 20.5C16.4477 20.5 16 20.0523 16 19.5C16 18.9477 16.4477 18.5 17 18.5Z" fill="#07AD3E"></path><path d="M16 16.5C16.5523 16.5 17 16.9477 17 17.5C17 18.0523 16.5523 18.5 16 18.5C15.4477 18.5 15 18.0523 15 17.5C15 16.9477 15.4477 16.5 16 16.5Z" fill="#07AD3E"></path><path d="M17 17.5C17 16.9477 17.4477 16.5 18 16.5C18.5523 16.5 19 16.9477 19 17.5C19 18.0523 18.5523 18.5 18 18.5C17.4477 18.5 17 18.0523 17 17.5Z" fill="#07AD3E"></path><path d="M17 14.5C17.5523 14.5 18 14.9477 18 15.5C18 16.0523 17.5523 16.5 17 16.5C16.4477 16.5 16 16.0523 16 15.5C16 14.9477 16.4477 14.5 17 14.5Z" fill="#07AD3E"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M16 7C16.5523 7 17 7.44772 17 8C17 8.55228 16.5523 9 16 9C15.4477 9 15 8.55228 15 8C15 7.44772 15.4477 7 16 7ZM17 10C17 9.44772 16.5523 9 16 9C15.4477 9 15 9.44772 15 10C15 9.44772 14.5523 9 14 9C13.4477 9 13 9.44772 13 10C13 10.5523 13.4477 11 14 11C14.5523 11 15 10.5523 15 10C15 10.5523 15.4477 11 16 11C15.4477 11 15 11.4477 15 12C15 12.5523 15.4477 13 16 13C16.5523 13 17 12.5523 17 12C17 12.5523 17.4477 13 18 13C18.5523 13 19 12.5523 19 12C19 11.4477 18.5523 11 18 11C18.5523 11 19 10.5523 19 10C19 10.5523 19.4477 11 20 11C20.5523 11 21 10.5523 21 10C21 9.44772 20.5523 9 20 9C19.4477 9 19 9.44772 19 10C19 9.44772 18.5523 9 18 9C18.5523 9 19 8.55228 19 8C19 7.44772 18.5523 7 18 7C17.4477 7 17 7.44772 17 8C17 8.55228 17.4477 9 18 9C17.4477 9 17 9.44772 17 10ZM17 10C17 10.5523 17.4477 11 18 11C17.4477 11 17 11.4477 17 12C17 11.4477 16.5523 11 16 11C16.5523 11 17 10.5523 17 10Z" fill="#07AD3E"></path><path d="M7 5.5C7.55228 5.5 8 5.05228 8 4.5C8 3.94772 7.55228 3.5 7 3.5C6.44772 3.5 6 3.94772 6 4.5C6 5.05228 6.44772 5.5 7 5.5Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8 15C8.55228 15 9 14.5523 9 14C9 14.5523 9.44772 15 10 15C10.5523 15 11 14.5523 11 14C11 13.4477 10.5523 13 10 13C9.44772 13 9 13.4477 9 14C9 13.4477 8.55228 13 8 13C8.55228 13 9 12.5523 9 12C9 11.4477 8.55228 11 8 11C7.44772 11 7 11.4477 7 12C7 11.4477 6.55228 11 6 11C5.44772 11 5 11.4477 5 12C5 12.5523 5.44772 13 6 13C5.44772 13 5 13.4477 5 14C5 13.4477 4.55228 13 4 13C3.44772 13 3 13.4477 3 14C3 14.5523 3.44772 15 4 15C4.55228 15 5 14.5523 5 14C5 14.5523 5.44772 15 6 15C5.44772 15 5 15.4477 5 16C5 16.5523 5.44772 17 6 17C6.55228 17 7 16.5523 7 16C7 16.5523 7.44772 17 8 17C8.55228 17 9 16.5523 9 16C9 15.4477 8.55228 15 8 15ZM8 15C7.44772 15 7 15.4477 7 16C7 15.4477 6.55228 15 6 15C6.55228 15 7 14.5523 7 14C7 14.5523 7.44772 15 8 15ZM7 14C7 13.4477 6.55228 13 6 13C6.55228 13 7 12.5523 7 12C7 12.5523 7.44772 13 8 13C7.44772 13 7 13.4477 7 14Z" fill="#110529"></path><path d="M6 7.5C6.55228 7.5 7 7.05228 7 6.5C7 7.05228 7.44772 7.5 8 7.5C8.55228 7.5 9 7.05228 9 6.5C9 5.94772 8.55228 5.5 8 5.5C7.44772 5.5 7 5.94772 7 6.5C7 5.94772 6.55228 5.5 6 5.5C5.44772 5.5 5 5.94772 5 6.5C5 7.05228 5.44772 7.5 6 7.5Z" fill="#110529"></path><path d="M7 9.5C7.55228 9.5 8 9.05228 8 8.5C8 7.94772 7.55228 7.5 7 7.5C6.44772 7.5 6 7.94772 6 8.5C6 9.05228 6.44772 9.5 7 9.5Z" fill="#110529"></path><path d="M8 19.5C8 20.0523 7.55228 20.5 7 20.5C6.44772 20.5 6 20.0523 6 19.5C6 18.9477 6.44772 18.5 7 18.5C7.55228 18.5 8 18.9477 8 19.5Z" fill="#110529"></path>',11)]))}const dae=mr(uae,[["render",fae]]),Aae={},hae={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function pae(e,t){return d.openBlock(),d.createElementBlock("svg",hae,t[0]||(t[0]=[d.createStaticVNode('<path d="M3 21.25L21 21.25" stroke="#110529" stroke-width="1.5" stroke-linecap="square"></path><path d="M3 4L3 2.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 7L3 5.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 10L3 8.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 13L3 11.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 16L3 14.5" stroke="#110529" stroke-width="1.5"></path><path d="M3 19L3 17.5" stroke="#110529" stroke-width="1.5"></path><path d="M20 5C20 5.55228 19.5523 6 19 6C18.4477 6 18 5.55228 18 5C18 4.44772 18.4477 4 19 4C19.5523 4 20 4.44772 20 5Z" fill="#07AD3E"></path><path d="M8 9C8.55228 9 9 8.55228 9 8C9 7.44772 8.55228 7 8 7C7.44772 7 7 7.44772 7 8C7 8.55228 7.44772 9 8 9Z" fill="#07AD3E"></path><path d="M16 17C16.5523 17 17 16.5523 17 16C17 15.4477 16.5523 15 16 15C15.4477 15 15 15.4477 15 16C15 16.5523 15.4477 17 16 17Z" fill="#07AD3E"></path><path d="M13 6C13.5523 6 14 5.55228 14 5C14 4.44772 13.5523 4 13 4C12.4477 4 12 4.44772 12 5C12 5.55228 12.4477 6 13 6Z" fill="#110529"></path><path d="M16 9C16.5523 9 17 8.55228 17 8C17 7.44772 16.5523 7 16 7C15.4477 7 15 7.44772 15 8C15 8.55228 15.4477 9 16 9Z" fill="#110529"></path><path d="M8 17C8.55228 17 9 16.5523 9 16C9 15.4477 8.55228 15 8 15C7.44772 15 7 15.4477 7 16C7 16.5523 7.44772 17 8 17Z" fill="#110529"></path><path d="M20 11C20 11.5523 19.5523 12 19 12C18.4477 12 18 11.5523 18 11C18 10.4477 18.4477 10 19 10C19.5523 10 20 10.4477 20 11Z" fill="#110529"></path><path d="M15 12C15.5523 12 16 11.5523 16 11C16 10.4477 15.5523 10 15 10C14.4477 10 14 10.4477 14 11C14 11.5523 14.4477 12 15 12Z" fill="#110529"></path><path d="M10 13C10 13.5523 9.55228 14 9 14C8.44772 14 8 13.5523 8 13C8 12.4477 8.44772 12 9 12C9.55228 12 10 12.4477 10 13Z" fill="#110529"></path><path d="M11 16C11.5523 16 12 15.5523 12 15C12 14.4477 11.5523 14 11 14C10.4477 14 10 14.4477 10 15C10 15.5523 10.4477 16 11 16Z" fill="#110529"></path><path d="M14 9C14 9.55228 13.5523 10 13 10C12.4477 10 12 9.55228 12 9C12 8.44772 12.4477 8 13 8C13.5523 8 14 8.44772 14 9Z" fill="#110529"></path><path d="M13 12C13 12.5523 12.5523 13 12 13C11.4477 13 11 12.5523 11 12C11 11.4477 11.4477 11 12 11C12.5523 11 13 11.4477 13 12Z" fill="#110529"></path>',19)]))}const vae=mr(Aae,[["render",pae]]),mae={},gae={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function yae(e,t){return d.openBlock(),d.createElementBlock("svg",gae,t[0]||(t[0]=[d.createStaticVNode('<path d="M10 20.5C10 20.7761 10.2239 21 10.5 21H13.5C13.7761 21 14 20.7761 14 20.5V19.3333V18.3333V18V17.5C14 17.2239 13.7761 17 13.5 17H10.5C10.2239 17 10 17.2239 10 17.5V18V18.3333V19.3333V20.5Z" stroke="#07AD3E" stroke-width="1.5"></path><path d="M10 13.5C10 13.7761 10.2239 14 10.5 14H13.5C13.7761 14 14 13.7761 14 13.5V12.3333V11.3333V11V10.5C14 10.2239 13.7761 10 13.5 10H10.5C10.2239 10 10 10.2239 10 10.5V11V11.3333V12.3333V13.5Z" stroke="#110529" stroke-width="1.5"></path><path d="M17 13.5C17 13.7761 17.2239 14 17.5 14H20.5C20.7761 14 21 13.7761 21 13.5V12.3333V11.3333V11V10.5C21 10.2239 20.7761 10 20.5 10H17.5C17.2239 10 17 10.2239 17 10.5V11V11.3333V12.3333V13.5Z" stroke="#110529" stroke-width="1.5"></path><path d="M17 20.5C17 20.7761 17.2239 21 17.5 21H20.5C20.7761 21 21 20.7761 21 20.5V19.3333V18.3333V18V17.5C21 17.2239 20.7761 17 20.5 17H17.5C17.2239 17 17 17.2239 17 17.5V18V18.3333V19.3333V20.5Z" stroke="#110529" stroke-width="1.5"></path><path d="M10 6.5C10 6.77614 10.2239 7 10.5 7H13.5C13.7761 7 14 6.77614 14 6.5V5.33333V4.33333V4V3.5C14 3.22386 13.7761 3 13.5 3H10.5C10.2239 3 10 3.22386 10 3.5V4V4.33333V5.33333V6.5Z" stroke="#110529" stroke-width="1.5"></path><path d="M3 20.5C3 20.7761 3.22386 21 3.5 21H6.5C6.77614 21 7 20.7761 7 20.5V19.3333V18.3333V18V17.5C7 17.2239 6.77614 17 6.5 17H3.5C3.22386 17 3 17.2239 3 17.5V18V18.3333V19.3333V20.5Z" stroke="#110529" stroke-width="1.5"></path><path d="M3 13.5C3 13.7761 3.22386 14 3.5 14H6.5C6.77614 14 7 13.7761 7 13.5V12.3333V11.3333V11V10.5C7 10.2239 6.77614 10 6.5 10H3.5C3.22386 10 3 10.2239 3 10.5V11V11.3333V12.3333V13.5Z" stroke="#07AD3E" stroke-width="1.5"></path><path d="M17 6.5C17 6.77614 17.2239 7 17.5 7H20.5C20.7761 7 21 6.77614 21 6.5V5.33333V4.33333V4V3.5C21 3.22386 20.7761 3 20.5 3H17.5C17.2239 3 17 3.22386 17 3.5V4V4.33333V5.33333V6.5Z" stroke="#07AD3E" stroke-width="1.5"></path><path d="M3 6.5C3 6.77614 3.22386 7 3.5 7H6.5C6.77614 7 7 6.77614 7 6.5V5.33333V4.33333V4V3.5C7 3.22386 6.77614 3 6.5 3H3.5C3.22386 3 3 3.22386 3 3.5V4V4.33333V5.33333V6.5Z" stroke="#110529" stroke-width="1.5"></path>',9)]))}const CI=mr(mae,[["render",yae]]),wae={},bae={class:"inline-icon",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function Cae(e,t){return d.openBlock(),d.createElementBlock("svg",bae,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.25 20.5H21.75V22H2.25V20.5Z",fill:"#110529"},null,-1),d.createElementVNode("path",{d:"M8.91649 19H7.25L10.2842 10H12.2116L15.25 19H13.5835L11.2816 11.8457H11.2142L8.91649 19ZM8.9712 15.4712H13.5162V16.7808H8.9712V15.4712Z",fill:"#07AD3E"},null,-1),d.createElementVNode("path",{d:"M20.4799 8.18631C20.4158 7.77567 20.3273 7.40811 20.2144 7.08365C20.1041 6.75412 19.9707 6.47275 19.8142 6.23954C19.6603 6.00634 19.4832 5.83143 19.2831 5.71483C19.083 5.59316 18.8649 5.53232 18.6289 5.53232C18.2056 5.53232 17.8285 5.74271 17.4975 6.1635C17.1666 6.58428 16.9062 7.20279 16.7163 8.01901C16.529 8.83016 16.4354 9.81876 16.4354 10.9848C16.4354 12.161 16.529 13.1572 16.7163 13.9734C16.9036 14.7896 17.164 15.4106 17.4975 15.8365C17.831 16.2573 18.2184 16.4677 18.6597 16.4677C19.0599 16.4677 19.4063 16.3156 19.6987 16.0114C19.9938 15.7072 20.2208 15.2763 20.3799 14.7186C20.5389 14.1559 20.6185 13.4968 20.6185 12.7414H20.618H18.8021V10.635H22V12.5057C22 13.839 21.8563 14.9924 21.569 15.9658C21.2817 16.9392 20.8866 17.6895 20.3837 18.2167C19.8809 18.7389 19.3036 19 18.652 19C17.926 19 17.2884 18.6781 16.7394 18.0342C16.193 17.3853 15.7658 16.4651 15.4579 15.2738C15.1526 14.0773 15 12.6578 15 11.0152C15 9.75792 15.0898 8.63498 15.2694 7.64639C15.4515 6.6578 15.7055 5.81876 16.0313 5.12928C16.3572 4.43473 16.7394 3.90748 17.1781 3.54753C17.6168 3.18251 18.094 3 18.6097 3C19.0458 3 19.4524 3.12674 19.8296 3.38023C20.2067 3.62864 20.5415 3.98352 20.834 4.44487C21.129 4.90621 21.3714 5.45374 21.5613 6.08745C21.7511 6.72117 21.8756 7.42079 21.9346 8.18631H20.4799Z",fill:"#110529"},null,-1),d.createElementVNode("path",{d:"M2 7V5H9L9 7H6.25V19H4.75V7H2Z",fill:"#110529"},null,-1)]))}const Sae=mr(wae,[["render",Cae]]),zg=[{name:"Light green",color:"#99E099"},{name:"Green",color:"#42B842"},{name:"Dark green",color:"#198020"},{name:"Light violet",color:"#C1ADFF"},{name:"Violet",color:"#845CFF"},{name:"Dark violet",color:"#5F31CC"},{name:"Light orange",color:"#FFCB8F"},{name:"Orange",color:"#FF9429"},{name:"Dark orange",color:"#C26A27"},{name:"Light teal",color:"#90E0E0"},{name:"Teal",color:"#27C2C2"},{name:"Dark teal",color:"#068A94"},{name:"Light rose",color:"#FAAAFA"},{name:"Rose",color:"#E553E5"},{name:"Dark rose",color:"#A324B2"},{name:"Light lime",color:"#CBEB67"},{name:"Lime",color:"#95C700"},{name:"Dark lime",color:"#659406"},{name:"Light blue",color:"#99CCFF"},{name:"Blue",color:"#2D93FA"},{name:"Dark blue",color:"#105BCC"},{name:"Light red",color:"#FFADBA"},{name:"Red",color:"#F05670"},{name:"Dark red",color:"#AD3757"},{name:"Light grey",color:"#D3D7E0"},{name:"Grey",color:"#929BAD"},{name:"Dark grey",color:"#5E5E70"},{name:"Black",color:"#110529"},{name:"White",color:"#FFFFFF"},{name:"None",color:"transparent"}],iv="#FFFFFF",pi="#110529";zg.reduce((e,t)=>(e[t.color]=t,e),{});const Y4=zg.slice(0,-3).map(e=>e.color),xae=Y4.filter((e,t)=>t%3===0),Eae=Y4.filter((e,t)=>t%3===1),Bae=Y4.filter((e,t)=>t%3===2),_ae=Y4.filter((e,t)=>t%3!==2),Tae=Y4,kae=["#FFF680","#53D788","#36739D","#4A005C"],Mae=["#FFF680","#F77E5B","#902B83","#2B125C"],Pae=["#DFFADC","#74CFD1","#635AC1","#611347"],Hae=["#FAFAB4","#8DDA7F","#337E90","#1C0F5C"],Dae=["#FFEA80","#F07A76","#7535A4","#003752"],$ae=["#FFF780","#6CEA90","#6C90F0","#942AAE"],Iae=["#43317B","#7ACFAC","#F5F5B7","#F07B75","#5C1243"],Lae=["#122B5C","#41B5A8","#F0F0F0","#F07C80","#5C1243"],Rae=["#0E0E8F","#7E93FB","#F0F0F0","#ED7883","#5C1243"],Vae=["#2E5C00","#9ED26A","#F0F0F0","#EB8BDB","#701260"],Nae=["#4A005C","#36749D","#56D688","#FFF680","#F77E5E","#902B82","#2B125C"],SI=["light","bright","dark","paired","triadic"],zae=["viridis","magma","density","salinity","sunset","perceptual_rainbow"],Oae=["spectrum","teal_red","blue_red","lime_rose","viridis_magma"];function uE(e){return SI.includes(e)}const Ui={...{light:{title:"Light",colors:xae},bright:{title:"Bright",colors:Eae},dark:{title:"Dark",colors:Bae},paired:{title:"Paired",colors:_ae},triadic:{title:"Triadic",colors:Tae}},...{viridis:{title:"Viridis",colors:kae},magma:{title:"Magma",colors:Mae},density:{title:"Density",colors:Pae},salinity:{title:"Salinity",colors:Hae},sunset:{title:"Sunset",colors:Dae},perceptual_rainbow:{title:"Rainbow",colors:$ae}},...{spectrum:{title:"Spectrum",colors:Iae},teal_red:{title:"Teal-Red",colors:Lae},blue_red:{title:"Blue-Red",colors:Rae},lime_rose:{title:"Lime-Rose",colors:Vae},viridis_magma:{title:"Vir-Mag",colors:Nae}}},xI="light",ov="salinity",Fae="salinity",W4=["0","5","1","2","6","7","9","3","4","8","12","10","13","14","11","22","23","21","24","25"],ww="#F0F0F0",DA="21",Og=["solid","dashed","dotted","dotdash","longdash","twodash"],bw="solid",Qae={solid:{title:"Solid"},dashed:{title:"Dashed"},dotted:{title:"Dotted"},dotdash:{title:"Dotdash"},longdash:{title:"Longdash"},twodash:{title:"Twodash"}},jae={A:"#cc0100",C:"#0000cc",G:"#ffb300",T:"#027f00",U:"#027f00"},Uae={A:"#7fa0f0",R:"#ef1405",N:"#01ff00",D:"#c048bf",C:"#ef8080",Q:"#01ff00",E:"#c048bf",G:"#f09047",H:"#14a4a4",I:"#7fa0f0",L:"#7fa0f0",K:"#ef1405",M:"#7fa0f0",F:"#7fa0f0",P:"#ffff00",S:"#01ff00",T:"#01ff00",W:"#7fa0f0",Y:"#14a4a4",V:"#7fa0f0",B:"#eeeeee",X:"#eeeeee",Z:"#eeeeee"};function Fg(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Gae(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function cE(e){let t,n,r;e.length!==2?(t=Fg,n=(s,c)=>Fg(e(s),c),r=(s,c)=>e(s)-c):(t=e===Fg||e===Gae?e:Yae,n=e,r=e);function a(s,c,f=0,A=s.length){if(f<A){if(t(c,c)!==0)return A;do{const h=f+A>>>1;n(s[h],c)<0?f=h+1:A=h}while(f<A)}return f}function i(s,c,f=0,A=s.length){if(f<A){if(t(c,c)!==0)return A;do{const h=f+A>>>1;n(s[h],c)<=0?f=h+1:A=h}while(f<A)}return f}function o(s,c,f=0,A=s.length){const h=a(s,c,f,A-1);return h>f&&r(s[h-1],c)>-r(s[h],c)?h-1:h}return{left:a,center:o,right:i}}function Yae(){return 0}function EI(e){return e===null?NaN:+e}function*Wae(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const BI=cE(Fg).right;cE(EI).center;function Xae(e,t){let n=0;for(let r of e)r!=null&&(r=+r)>=r&&++n;return n}function Kae(e,t){let n=0,r,a=0,i=0;for(let o of e)o!=null&&(o=+o)>=o&&(r=o-a,a+=r/++n,i+=r*(o-a));if(n>1)return i/(n-1)}function _I(e,t){const n=Kae(e);return n&&Math.sqrt(n)}function H0(e,t){let n,r;if(t===void 0)for(const a of e)a!=null&&(n===void 0?a>=a&&(n=r=a):(n>a&&(n=a),r<a&&(r=a)));else{let a=-1;for(let i of e)(i=t(i,++a,e))!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)))}return[n,r]}class TI extends Map{constructor(t,n=qae){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,a]of t)this.set(r,a)}get(t){return super.get(kI(this,t))}has(t){return super.has(kI(this,t))}set(t,n){return super.set(Zae(this,t),n)}delete(t){return super.delete(Jae(this,t))}}function kI({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Zae({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Jae({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function qae(e){return e!==null&&typeof e=="object"?e.valueOf():e}function eie(e){return e}function tie(e=Fg){if(e===Fg)return MI;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function MI(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var nie=Array.prototype,rie=nie.slice;function fE(e){return()=>e}const aie=Math.sqrt(50),iie=Math.sqrt(10),oie=Math.sqrt(2);function Cw(e,t,n){const r=(t-e)/Math.max(0,n),a=Math.floor(Math.log10(r)),i=r/Math.pow(10,a),o=i>=aie?10:i>=iie?5:i>=oie?2:1;let s,c,f;return a<0?(f=Math.pow(10,-a)/o,s=Math.round(e*f),c=Math.round(t*f),s/f<e&&++s,c/f>t&&--c,f=-f):(f=Math.pow(10,a)*o,s=Math.round(e/f),c=Math.round(t/f),s*f<e&&++s,c*f>t&&--c),c<s&&.5<=n&&n<2?Cw(e,t,n*2):[s,c,f]}function Sw(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[a,i,o]=r?Cw(t,e,n):Cw(e,t,n);if(!(i>=a))return[];const s=i-a+1,c=new Array(s);if(r)if(o<0)for(let f=0;f<s;++f)c[f]=(i-f)/-o;else for(let f=0;f<s;++f)c[f]=(i-f)*o;else if(o<0)for(let f=0;f<s;++f)c[f]=(a+f)/-o;else for(let f=0;f<s;++f)c[f]=(a+f)*o;return c}function Qg(e,t,n){return t=+t,e=+e,n=+n,Cw(e,t,n)[2]}function dE(e,t,n){t=+t,e=+e,n=+n;const r=t<e,a=r?Qg(t,e,n):Qg(e,t,n);return(r?-1:1)*(a<0?1/-a:a)}function lie(e,t,n){let r;for(;;){const a=Qg(e,t,n);if(a===r||a===0||!isFinite(a))return[e,t];a>0?(e=Math.floor(e/a)*a,t=Math.ceil(t/a)*a):a<0&&(e=Math.ceil(e*a)/a,t=Math.floor(t*a)/a),r=a}}function sie(e){return Math.max(1,Math.ceil(Math.log(Xae(e))/Math.LN2)+1)}function PI(){var e=eie,t=H0,n=sie;function r(a){Array.isArray(a)||(a=Array.from(a));var i,o=a.length,s,c,f=new Array(o);for(i=0;i<o;++i)f[i]=e(a[i],i,a);var A=t(f),h=A[0],v=A[1],g=n(f,h,v);if(!Array.isArray(g)){const P=v,I=+g;if(t===H0&&([h,v]=lie(h,v,I)),g=Sw(h,v,I),g[0]<=h&&(c=Qg(h,v,I)),g[g.length-1]>=v)if(P>=v&&t===H0){const $=Qg(h,v,I);isFinite($)&&($>0?v=(Math.floor(v/$)+1)*$:$<0&&(v=(Math.ceil(v*-$)+1)/-$))}else g.pop()}for(var C=g.length,b=0,B=C;g[b]<=h;)++b;for(;g[B-1]>v;)--B;(b||B<C)&&(g=g.slice(b,B),C=B-b);var E=new Array(C+1),k;for(i=0;i<=C;++i)k=E[i]=[],k.x0=i>0?g[i-1]:h,k.x1=i<C?g[i]:v;if(isFinite(c)){if(c>0)for(i=0;i<o;++i)(s=f[i])!=null&&h<=s&&s<=v&&E[Math.min(C,Math.floor((s-h)/c))].push(a[i]);else if(c<0){for(i=0;i<o;++i)if((s=f[i])!=null&&h<=s&&s<=v){const P=Math.floor((h-s)*c);E[Math.min(C,P+(g[P]<=s))].push(a[i])}}}else for(i=0;i<o;++i)(s=f[i])!=null&&h<=s&&s<=v&&E[BI(g,s,0,C)].push(a[i]);return E}return r.value=function(a){return arguments.length?(e=typeof a=="function"?a:fE(a),r):e},r.domain=function(a){return arguments.length?(t=typeof a=="function"?a:fE([a[0],a[1]]),r):t},r.thresholds=function(a){return arguments.length?(n=typeof a=="function"?a:fE(Array.isArray(a)?rie.call(a):a),r):n},r}function Vh(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let a of e)(a=t(a,++r,e))!=null&&(n<a||n===void 0&&a>=a)&&(n=a)}return n}function xw(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let a of e)(a=t(a,++r,e))!=null&&(n>a||n===void 0&&a>=a)&&(n=a)}return n}function HI(e,t,n=0,r=1/0,a){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(a=a===void 0?MI:tie(a);r>n;){if(r-n>600){const c=r-n+1,f=t-n+1,A=Math.log(c),h=.5*Math.exp(2*A/3),v=.5*Math.sqrt(A*h*(c-h)/c)*(f-c/2<0?-1:1),g=Math.max(n,Math.floor(t-f*h/c+v)),C=Math.min(r,Math.floor(t+(c-f)*h/c+v));HI(e,t,g,C,a)}const i=e[t];let o=n,s=r;for(X4(e,n,t),a(e[r],i)>0&&X4(e,n,r);o<s;){for(X4(e,o,s),++o,--s;a(e[o],i)<0;)++o;for(;a(e[s],i)>0;)--s}a(e[n],i)===0?X4(e,n,s):(++s,X4(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function X4(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function DI(e,t,n){if(e=Float64Array.from(Wae(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return xw(e);if(t>=1)return Vh(e);var r,a=(r-1)*t,i=Math.floor(a),o=Vh(HI(e,i).subarray(0,i+1)),s=xw(e.subarray(i+1));return o+(s-o)*(a-i)}}function D0(e,t,n=EI){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,a=(r-1)*t,i=Math.floor(a),o=+n(e[i],i,e),s=+n(e[i+1],i+1,e);return o+(s-o)*(a-i)}}function Vs(e,t){let n=0,r=0;if(t===void 0)for(let a of e)a!=null&&(a=+a)>=a&&(++n,r+=a);else{let a=-1;for(let i of e)(i=t(i,++a,e))!=null&&(i=+i)>=i&&(++n,r+=i)}if(n)return r/n}function uie(e,t,n){e=+e,t=+t,n=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+n;for(var r=-1,a=Math.max(0,Math.ceil((t-e)/n))|0,i=new Array(a);++r<a;)i[r]=e+r*n;return i}function lc(e,t){let n=0;if(t===void 0)for(let r of e)(r=+r)&&(n+=r);else{let r=-1;for(let a of e)(a=+t(a,++r,e))&&(n+=a)}return n}function G2(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const $I=Symbol("implicit");function Qo(){var e=new TI,t=[],n=[],r=$I;function a(i){let o=e.get(i);if(o===void 0){if(r!==$I)return r;e.set(i,o=t.push(i)-1)}return n[o%n.length]}return a.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new TI;for(const o of i)e.has(o)||e.set(o,t.push(o)-1);return a},a.range=function(i){return arguments.length?(n=Array.from(i),a):n.slice()},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return Qo(t,n).unknown(r)},G2.apply(a,arguments),a}function K4(){var e=Qo().unknown(void 0),t=e.domain,n=e.range,r=0,a=1,i,o,s=!1,c=0,f=0,A=.5;delete e.unknown;function h(){var v=t().length,g=a<r,C=g?a:r,b=g?r:a;i=(b-C)/Math.max(1,v-c+f*2),s&&(i=Math.floor(i)),C+=(b-C-i*(v-c))*A,o=i*(1-c),s&&(C=Math.round(C),o=Math.round(o));var B=uie(v).map(function(E){return C+i*E});return n(g?B.reverse():B)}return e.domain=function(v){return arguments.length?(t(v),h()):t()},e.range=function(v){return arguments.length?([r,a]=v,r=+r,a=+a,h()):[r,a]},e.rangeRound=function(v){return[r,a]=v,r=+r,a=+a,s=!0,h()},e.bandwidth=function(){return o},e.step=function(){return i},e.round=function(v){return arguments.length?(s=!!v,h()):s},e.padding=function(v){return arguments.length?(c=Math.min(1,f=+v),h()):c},e.paddingInner=function(v){return arguments.length?(c=Math.min(1,v),h()):c},e.paddingOuter=function(v){return arguments.length?(f=+v,h()):f},e.align=function(v){return arguments.length?(A=Math.max(0,Math.min(1,v)),h()):A},e.copy=function(){return K4(t(),[r,a]).round(s).paddingInner(c).paddingOuter(f).align(A)},G2.apply(h(),arguments)}function AE(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function II(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Z4(){}var J4=.7,Ew=1/J4,jg="\\s*([+-]?\\d+)\\s*",q4="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",$A="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",cie=/^#([0-9a-f]{3,8})$/,fie=new RegExp(`^rgb\\(${jg},${jg},${jg}\\)$`),die=new RegExp(`^rgb\\(${$A},${$A},${$A}\\)$`),Aie=new RegExp(`^rgba\\(${jg},${jg},${jg},${q4}\\)$`),hie=new RegExp(`^rgba\\(${$A},${$A},${$A},${q4}\\)$`),pie=new RegExp(`^hsl\\(${q4},${$A},${$A}\\)$`),vie=new RegExp(`^hsla\\(${q4},${$A},${$A},${q4}\\)$`),LI={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};AE(Z4,lv,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:RI,formatHex:RI,formatHex8:mie,formatHsl:gie,formatRgb:VI,toString:VI});function RI(){return this.rgb().formatHex()}function mie(){return this.rgb().formatHex8()}function gie(){return QI(this).formatHsl()}function VI(){return this.rgb().formatRgb()}function lv(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=cie.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?NI(t):n===3?new gd(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Bw(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Bw(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=fie.exec(e))?new gd(t[1],t[2],t[3],1):(t=die.exec(e))?new gd(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Aie.exec(e))?Bw(t[1],t[2],t[3],t[4]):(t=hie.exec(e))?Bw(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=pie.exec(e))?FI(t[1],t[2]/100,t[3]/100,1):(t=vie.exec(e))?FI(t[1],t[2]/100,t[3]/100,t[4]):LI.hasOwnProperty(e)?NI(LI[e]):e==="transparent"?new gd(NaN,NaN,NaN,0):null}function NI(e){return new gd(e>>16&255,e>>8&255,e&255,1)}function Bw(e,t,n,r){return r<=0&&(e=t=n=NaN),new gd(e,t,n,r)}function yie(e){return e instanceof Z4||(e=lv(e)),e?(e=e.rgb(),new gd(e.r,e.g,e.b,e.opacity)):new gd}function Ug(e,t,n,r){return arguments.length===1?yie(e):new gd(e,t,n,r??1)}function gd(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}AE(gd,Ug,II(Z4,{brighter(e){return e=e==null?Ew:Math.pow(Ew,e),new gd(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?J4:Math.pow(J4,e),new gd(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new gd(Y2(this.r),Y2(this.g),Y2(this.b),_w(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:zI,formatHex:zI,formatHex8:wie,formatRgb:OI,toString:OI}));function zI(){return`#${W2(this.r)}${W2(this.g)}${W2(this.b)}`}function wie(){return`#${W2(this.r)}${W2(this.g)}${W2(this.b)}${W2((isNaN(this.opacity)?1:this.opacity)*255)}`}function OI(){const e=_w(this.opacity);return`${e===1?"rgb(":"rgba("}${Y2(this.r)}, ${Y2(this.g)}, ${Y2(this.b)}${e===1?")":`, ${e})`}`}function _w(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Y2(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function W2(e){return e=Y2(e),(e<16?"0":"")+e.toString(16)}function FI(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new $0(e,t,n,r)}function QI(e){if(e instanceof $0)return new $0(e.h,e.s,e.l,e.opacity);if(e instanceof Z4||(e=lv(e)),!e)return new $0;if(e instanceof $0)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),i=Math.max(t,n,r),o=NaN,s=i-a,c=(i+a)/2;return s?(t===i?o=(n-r)/s+(n<r)*6:n===i?o=(r-t)/s+2:o=(t-n)/s+4,s/=c<.5?i+a:2-i-a,o*=60):s=c>0&&c<1?0:o,new $0(o,s,c,e.opacity)}function bie(e,t,n,r){return arguments.length===1?QI(e):new $0(e,t,n,r??1)}function $0(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}AE($0,bie,II(Z4,{brighter(e){return e=e==null?Ew:Math.pow(Ew,e),new $0(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?J4:Math.pow(J4,e),new $0(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new gd(hE(e>=240?e-240:e+120,a,r),hE(e,a,r),hE(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new $0(jI(this.h),Tw(this.s),Tw(this.l),_w(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=_w(this.opacity);return`${e===1?"hsl(":"hsla("}${jI(this.h)}, ${Tw(this.s)*100}%, ${Tw(this.l)*100}%${e===1?")":`, ${e})`}`}}));function jI(e){return e=(e||0)%360,e<0?e+360:e}function Tw(e){return Math.max(0,Math.min(1,e||0))}function hE(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const pE=e=>()=>e;function Cie(e,t){return function(n){return e+n*t}}function Sie(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function xie(e){return(e=+e)==1?UI:function(t,n){return n-t?Sie(t,n,e):pE(isNaN(t)?n:t)}}function UI(e,t){var n=t-e;return n?Cie(e,n):pE(isNaN(e)?t:e)}const kw=function e(t){var n=xie(t);function r(a,i){var o=n((a=Ug(a)).r,(i=Ug(i)).r),s=n(a.g,i.g),c=n(a.b,i.b),f=UI(a.opacity,i.opacity);return function(A){return a.r=o(A),a.g=s(A),a.b=c(A),a.opacity=f(A),a+""}}return r.gamma=e,r}(1);function Eie(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(i){for(a=0;a<n;++a)r[a]=e[a]*(1-i)+t[a]*i;return r}}function Bie(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function _ie(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,a=new Array(r),i=new Array(n),o;for(o=0;o<r;++o)a[o]=gE(e[o],t[o]);for(;o<n;++o)i[o]=t[o];return function(s){for(o=0;o<r;++o)i[o]=a[o](s);return i}}function Tie(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function I0(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function kie(e,t){var n={},r={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?n[a]=gE(e[a],t[a]):r[a]=t[a];return function(i){for(a in n)r[a]=n[a](i);return r}}var vE=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,mE=new RegExp(vE.source,"g");function Mie(e){return function(){return e}}function Pie(e){return function(t){return e(t)+""}}function GI(e,t){var n=vE.lastIndex=mE.lastIndex=0,r,a,i,o=-1,s=[],c=[];for(e=e+"",t=t+"";(r=vE.exec(e))&&(a=mE.exec(t));)(i=a.index)>n&&(i=t.slice(n,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(a=a[0])?s[o]?s[o]+=a:s[++o]=a:(s[++o]=null,c.push({i:o,x:I0(r,a)})),n=mE.lastIndex;return n<t.length&&(i=t.slice(n),s[o]?s[o]+=i:s[++o]=i),s.length<2?c[0]?Pie(c[0].x):Mie(t):(t=c.length,function(f){for(var A=0,h;A<t;++A)s[(h=c[A]).i]=h.x(f);return s.join("")})}function gE(e,t){var n=typeof t,r;return t==null||n==="boolean"?pE(t):(n==="number"?I0:n==="string"?(r=lv(t))?(t=r,kw):GI:t instanceof lv?kw:t instanceof Date?Tie:Bie(t)?Eie:Array.isArray(t)?_ie:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?kie:I0)(e,t)}function Hie(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var YI=180/Math.PI,yE={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function WI(e,t,n,r,a,i){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:a,translateY:i,rotate:Math.atan2(t,e)*YI,skewX:Math.atan(c)*YI,scaleX:o,scaleY:s}}var Mw;function Die(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?yE:WI(t.a,t.b,t.c,t.d,t.e,t.f)}function $ie(e){return e==null||(Mw||(Mw=document.createElementNS("http://www.w3.org/2000/svg","g")),Mw.setAttribute("transform",e),!(e=Mw.transform.baseVal.consolidate()))?yE:(e=e.matrix,WI(e.a,e.b,e.c,e.d,e.e,e.f))}function XI(e,t,n,r){function a(f){return f.length?f.pop()+" ":""}function i(f,A,h,v,g,C){if(f!==h||A!==v){var b=g.push("translate(",null,t,null,n);C.push({i:b-4,x:I0(f,h)},{i:b-2,x:I0(A,v)})}else(h||v)&&g.push("translate("+h+t+v+n)}function o(f,A,h,v){f!==A?(f-A>180?A+=360:A-f>180&&(f+=360),v.push({i:h.push(a(h)+"rotate(",null,r)-2,x:I0(f,A)})):A&&h.push(a(h)+"rotate("+A+r)}function s(f,A,h,v){f!==A?v.push({i:h.push(a(h)+"skewX(",null,r)-2,x:I0(f,A)}):A&&h.push(a(h)+"skewX("+A+r)}function c(f,A,h,v,g,C){if(f!==h||A!==v){var b=g.push(a(g)+"scale(",null,",",null,")");C.push({i:b-4,x:I0(f,h)},{i:b-2,x:I0(A,v)})}else(h!==1||v!==1)&&g.push(a(g)+"scale("+h+","+v+")")}return function(f,A){var h=[],v=[];return f=e(f),A=e(A),i(f.translateX,f.translateY,A.translateX,A.translateY,h,v),o(f.rotate,A.rotate,h,v),s(f.skewX,A.skewX,h,v),c(f.scaleX,f.scaleY,A.scaleX,A.scaleY,h,v),f=A=null,function(g){for(var C=-1,b=v.length,B;++C<b;)h[(B=v[C]).i]=B.x(g);return h.join("")}}}var Iie=XI(Die,"px, ","px)","deg)"),Lie=XI($ie,", ",")",")"),Rie=1e-12;function KI(e){return((e=Math.exp(e))+1/e)/2}function Vie(e){return((e=Math.exp(e))-1/e)/2}function Nie(e){return((e=Math.exp(2*e))-1)/(e+1)}const zie=function e(t,n,r){function a(i,o){var s=i[0],c=i[1],f=i[2],A=o[0],h=o[1],v=o[2],g=A-s,C=h-c,b=g*g+C*C,B,E;if(b<Rie)E=Math.log(v/f)/t,B=function(O){return[s+O*g,c+O*C,f*Math.exp(t*O*E)]};else{var k=Math.sqrt(b),P=(v*v-f*f+r*b)/(2*f*n*k),I=(v*v-f*f-r*b)/(2*v*n*k),$=Math.log(Math.sqrt(P*P+1)-P),z=Math.log(Math.sqrt(I*I+1)-I);E=(z-$)/t,B=function(O){var K=O*E,te=KI($),le=f/(n*k)*(te*Nie(t*K+$)-Vie($));return[s+le*g,c+le*C,f*te/KI(t*K+$)]}}return B.duration=E*1e3*t/Math.SQRT2,B}return a.rho=function(i){var o=Math.max(.001,+i),s=o*o,c=s*s;return e(o,s,c)},a}(Math.SQRT2,2,4);function Oie(e){return function(){return e}}function wE(e){return+e}var ZI=[0,1];function IA(e){return e}function bE(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Oie(isNaN(t)?NaN:.5)}function Fie(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Qie(e,t,n){var r=e[0],a=e[1],i=t[0],o=t[1];return a<r?(r=bE(a,r),i=n(o,i)):(r=bE(r,a),i=n(i,o)),function(s){return i(r(s))}}function jie(e,t,n){var r=Math.min(e.length,t.length)-1,a=new Array(r),i=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)a[o]=bE(e[o],e[o+1]),i[o]=n(t[o],t[o+1]);return function(s){var c=BI(e,s,1,r)-1;return i[c](a[c](s))}}function ey(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Pw(){var e=ZI,t=ZI,n=gE,r,a,i,o=IA,s,c,f;function A(){var v=Math.min(e.length,t.length);return o!==IA&&(o=Fie(e[0],e[v-1])),s=v>2?jie:Qie,c=f=null,h}function h(v){return v==null||isNaN(v=+v)?i:(c||(c=s(e.map(r),t,n)))(r(o(v)))}return h.invert=function(v){return o(a((f||(f=s(t,e.map(r),I0)))(v)))},h.domain=function(v){return arguments.length?(e=Array.from(v,wE),A()):e.slice()},h.range=function(v){return arguments.length?(t=Array.from(v),A()):t.slice()},h.rangeRound=function(v){return t=Array.from(v),n=Hie,A()},h.clamp=function(v){return arguments.length?(o=v?!0:IA,A()):o!==IA},h.interpolate=function(v){return arguments.length?(n=v,A()):n},h.unknown=function(v){return arguments.length?(i=v,h):i},function(v,g){return r=v,a=g,A()}}function JI(){return Pw()(IA,IA)}function Uie(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Hw(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Gg(e){return e=Hw(Math.abs(e)),e?e[1]:NaN}function Gie(e,t){return function(n,r){for(var a=n.length,i=[],o=0,s=e[0],c=0;a>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),i.push(n.substring(a-=s,a+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return i.reverse().join(t)}}function Yie(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Wie=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ty(e){if(!(t=Wie.exec(e)))throw new Error("invalid format: "+e);var t;return new CE({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}ty.prototype=CE.prototype;function CE(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}CE.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Xie(e){e:for(var t=e.length,n=1,r=-1,a;n<t;++n)switch(e[n]){case".":r=a=n;break;case"0":r===0&&(r=n),a=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(a+1):e}var qI;function Kie(e,t){var n=Hw(e,t);if(!n)return e+"";var r=n[0],a=n[1],i=a-(qI=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,o=r.length;return i===o?r:i>o?r+new Array(i-o+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+Hw(e,Math.max(0,t+i-1))[0]}function eL(e,t){var n=Hw(e,t);if(!n)return e+"";var r=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+r:r.length>a+1?r.slice(0,a+1)+"."+r.slice(a+1):r+new Array(a-r.length+2).join("0")}const tL={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Uie,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>eL(e*100,t),r:eL,s:Kie,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function nL(e){return e}var rL=Array.prototype.map,aL=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Zie(e){var t=e.grouping===void 0||e.thousands===void 0?nL:Gie(rL.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?nL:Yie(rL.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function f(h){h=ty(h);var v=h.fill,g=h.align,C=h.sign,b=h.symbol,B=h.zero,E=h.width,k=h.comma,P=h.precision,I=h.trim,$=h.type;$==="n"?(k=!0,$="g"):tL[$]||(P===void 0&&(P=12),I=!0,$="g"),(B||v==="0"&&g==="=")&&(B=!0,v="0",g="=");var z=b==="$"?n:b==="#"&&/[boxX]/.test($)?"0"+$.toLowerCase():"",O=b==="$"?r:/[%p]/.test($)?o:"",K=tL[$],te=/[defgprs%]/.test($);P=P===void 0?6:/[gprs]/.test($)?Math.max(1,Math.min(21,P)):Math.max(0,Math.min(20,P));function le(G){var Q=z,j=O,Y,X,ee;if($==="c")j=K(G)+j,G="";else{G=+G;var pe=G<0||1/G<0;if(G=isNaN(G)?c:K(Math.abs(G),P),I&&(G=Xie(G)),pe&&+G==0&&C!=="+"&&(pe=!1),Q=(pe?C==="("?C:s:C==="-"||C==="("?"":C)+Q,j=($==="s"?aL[8+qI/3]:"")+j+(pe&&C==="("?")":""),te){for(Y=-1,X=G.length;++Y<X;)if(ee=G.charCodeAt(Y),48>ee||ee>57){j=(ee===46?a+G.slice(Y+1):G.slice(Y))+j,G=G.slice(0,Y);break}}}k&&!B&&(G=t(G,1/0));var ae=Q.length+G.length+j.length,ge=ae<E?new Array(E-ae+1).join(v):"";switch(k&&B&&(G=t(ge+G,ge.length?E-j.length:1/0),ge=""),g){case"<":G=Q+G+j+ge;break;case"=":G=Q+ge+G+j;break;case"^":G=ge.slice(0,ae=ge.length>>1)+Q+G+j+ge.slice(ae);break;default:G=ge+Q+G+j;break}return i(G)}return le.toString=function(){return h+""},le}function A(h,v){var g=f((h=ty(h),h.type="f",h)),C=Math.max(-8,Math.min(8,Math.floor(Gg(v)/3)))*3,b=Math.pow(10,-C),B=aL[8+C/3];return function(E){return g(b*E)+B}}return{format:f,formatPrefix:A}}var Dw,ny,iL;Jie({thousands:",",grouping:[3],currency:["$",""]});function Jie(e){return Dw=Zie(e),ny=Dw.format,iL=Dw.formatPrefix,Dw}function qie(e){return Math.max(0,-Gg(Math.abs(e)))}function eoe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Gg(t)/3)))*3-Gg(Math.abs(e)))}function toe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Gg(t)-Gg(e))+1}function noe(e,t,n,r){var a=dE(e,t,n),i;switch(r=ty(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(i=eoe(a,o))&&(r.precision=i),iL(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=toe(a,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=qie(a))&&(r.precision=i-(r.type==="%")*2);break}}return ny(r)}function $w(e){var t=e.domain;return e.ticks=function(n){var r=t();return Sw(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var a=t();return noe(a[0],a[a.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),a=0,i=r.length-1,o=r[a],s=r[i],c,f,A=10;for(s<o&&(f=o,o=s,s=f,f=a,a=i,i=f);A-- >0;){if(f=Qg(o,s,n),f===c)return r[a]=o,r[i]=s,t(r);if(f>0)o=Math.floor(o/f)*f,s=Math.ceil(s/f)*f;else if(f<0)o=Math.ceil(o*f)/f,s=Math.floor(s*f)/f;else break;c=f}return e},e}function Zr(){var e=JI();return e.copy=function(){return ey(e,Zr())},G2.apply(e,arguments),$w(e)}function sv(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,wE),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return sv(e).unknown(t)},e=arguments.length?Array.from(e,wE):[0,1],$w(n)}function oL(e,t){e=e.slice();var n=0,r=e.length-1,a=e[n],i=e[r],o;return i<a&&(o=n,n=r,r=o,o=a,a=i,i=o),e[n]=t.floor(a),e[r]=t.ceil(i),e}function lL(e){return Math.log(e)}function sL(e){return Math.exp(e)}function roe(e){return-Math.log(-e)}function aoe(e){return-Math.exp(-e)}function ioe(e){return isFinite(e)?+("1e"+e):e<0?0:e}function ooe(e){return e===10?ioe:e===Math.E?Math.exp:t=>Math.pow(e,t)}function loe(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function uL(e){return(t,n)=>-e(-t,n)}function soe(e){const t=e(lL,sL),n=t.domain;let r=10,a,i;function o(){return a=loe(r),i=ooe(r),n()[0]<0?(a=uL(a),i=uL(i),e(roe,aoe)):e(lL,sL),t}return t.base=function(s){return arguments.length?(r=+s,o()):r},t.domain=function(s){return arguments.length?(n(s),o()):n()},t.ticks=s=>{const c=n();let f=c[0],A=c[c.length-1];const h=A<f;h&&([f,A]=[A,f]);let v=a(f),g=a(A),C,b;const B=s==null?10:+s;let E=[];if(!(r%1)&&g-v<B){if(v=Math.floor(v),g=Math.ceil(g),f>0){for(;v<=g;++v)for(C=1;C<r;++C)if(b=v<0?C/i(-v):C*i(v),!(b<f)){if(b>A)break;E.push(b)}}else for(;v<=g;++v)for(C=r-1;C>=1;--C)if(b=v>0?C/i(-v):C*i(v),!(b<f)){if(b>A)break;E.push(b)}E.length*2<B&&(E=Sw(f,A,B))}else E=Sw(v,g,Math.min(g-v,B)).map(i);return h?E.reverse():E},t.tickFormat=(s,c)=>{if(s==null&&(s=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=ty(c)).precision==null&&(c.trim=!0),c=ny(c)),s===1/0)return c;const f=Math.max(1,r*s/t.ticks().length);return A=>{let h=A/i(Math.round(a(A)));return h*r<r-.5&&(h*=r),h<=f?c(A):""}},t.nice=()=>n(oL(n(),{floor:s=>i(Math.floor(a(s))),ceil:s=>i(Math.ceil(a(s)))})),t}function X2(){const e=soe(Pw()).domain([1,10]);return e.copy=()=>ey(e,X2()).base(e.base()),G2.apply(e,arguments),e}function cL(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function fL(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function uoe(e){var t=1,n=e(cL(t),fL(t));return n.constant=function(r){return arguments.length?e(cL(t=+r),fL(t)):t},$w(n)}function uv(){var e=uoe(Pw());return e.copy=function(){return ey(e,uv()).constant(e.constant())},G2.apply(e,arguments)}function dL(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function coe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function foe(e){return e<0?-e*e:e*e}function doe(e){var t=e(IA,IA),n=1;function r(){return n===1?e(IA,IA):n===.5?e(coe,foe):e(dL(n),dL(1/n))}return t.exponent=function(a){return arguments.length?(n=+a,r()):n},$w(t)}function SE(){var e=doe(Pw());return e.copy=function(){return ey(e,SE()).exponent(e.exponent())},G2.apply(e,arguments),e}function cv(){return SE.apply(null,arguments).exponent(.5)}const xE=new Date,EE=new Date;function uu(e,t,n,r){function a(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return a.floor=i=>(e(i=new Date(+i)),i),a.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),a.round=i=>{const o=a(i),s=a.ceil(i);return i-o<s-i?o:s},a.offset=(i,o)=>(t(i=new Date(+i),o==null?1:Math.floor(o)),i),a.range=(i,o,s)=>{const c=[];if(i=a.ceil(i),s=s==null?1:Math.floor(s),!(i<o)||!(s>0))return c;let f;do c.push(f=new Date(+i)),t(i,s),e(i);while(f<i&&i<o);return c},a.filter=i=>uu(o=>{if(o>=o)for(;e(o),!i(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!i(o););else for(;--s>=0;)for(;t(o,1),!i(o););}),n&&(a.count=(i,o)=>(xE.setTime(+i),EE.setTime(+o),e(xE),e(EE),Math.floor(n(xE,EE))),a.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?a.filter(r?o=>r(o)%i===0:o=>a.count(0,o)%i===0):a)),a}const Iw=uu(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Iw.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?uu(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Iw),Iw.range;const Nh=1e3,L1=Nh*60,zh=L1*60,Oh=zh*24,BE=Oh*7,AL=Oh*30,_E=Oh*365,Yg=uu(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Nh)},(e,t)=>(t-e)/Nh,e=>e.getUTCSeconds());Yg.range;const TE=uu(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Nh)},(e,t)=>{e.setTime(+e+t*L1)},(e,t)=>(t-e)/L1,e=>e.getMinutes());TE.range,uu(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*L1)},(e,t)=>(t-e)/L1,e=>e.getUTCMinutes()).range;const kE=uu(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Nh-e.getMinutes()*L1)},(e,t)=>{e.setTime(+e+t*zh)},(e,t)=>(t-e)/zh,e=>e.getHours());kE.range,uu(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*zh)},(e,t)=>(t-e)/zh,e=>e.getUTCHours()).range;const ry=uu(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*L1)/Oh,e=>e.getDate()-1);ry.range;const ME=uu(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Oh,e=>e.getUTCDate()-1);ME.range,uu(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Oh,e=>Math.floor(e/Oh)).range;function K2(e){return uu(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*L1)/BE)}const Lw=K2(0),Rw=K2(1),Aoe=K2(2),hoe=K2(3),Wg=K2(4),poe=K2(5),voe=K2(6);Lw.range,Rw.range,Aoe.range,hoe.range,Wg.range,poe.range,voe.range;function Z2(e){return uu(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/BE)}const hL=Z2(0),Vw=Z2(1),moe=Z2(2),goe=Z2(3),Xg=Z2(4),yoe=Z2(5),woe=Z2(6);hL.range,Vw.range,moe.range,goe.range,Xg.range,yoe.range,woe.range;const PE=uu(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());PE.range,uu(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth()).range;const Fh=uu(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Fh.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:uu(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),Fh.range;const J2=uu(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());J2.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:uu(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),J2.range;function boe(e,t,n,r,a,i){const o=[[Yg,1,Nh],[Yg,5,5*Nh],[Yg,15,15*Nh],[Yg,30,30*Nh],[i,1,L1],[i,5,5*L1],[i,15,15*L1],[i,30,30*L1],[a,1,zh],[a,3,3*zh],[a,6,6*zh],[a,12,12*zh],[r,1,Oh],[r,2,2*Oh],[n,1,BE],[t,1,AL],[t,3,3*AL],[e,1,_E]];function s(f,A,h){const v=A<f;v&&([f,A]=[A,f]);const g=h&&typeof h.range=="function"?h:c(f,A,h),C=g?g.range(f,+A+1):[];return v?C.reverse():C}function c(f,A,h){const v=Math.abs(A-f)/h,g=cE(([,,B])=>B).right(o,v);if(g===o.length)return e.every(dE(f/_E,A/_E,h));if(g===0)return Iw.every(Math.max(dE(f,A,h),1));const[C,b]=o[v/o[g-1][2]<o[g][2]/v?g-1:g];return C.every(b)}return[s,c]}const[Coe,Soe]=boe(Fh,PE,Lw,ry,kE,TE);function HE(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function DE(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function ay(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function xoe(e){var t=e.dateTime,n=e.date,r=e.time,a=e.periods,i=e.days,o=e.shortDays,s=e.months,c=e.shortMonths,f=iy(a),A=oy(a),h=iy(i),v=oy(i),g=iy(o),C=oy(o),b=iy(s),B=oy(s),E=iy(c),k=oy(c),P={a:pe,A:ae,b:ge,B:me,c:null,d:wL,e:wL,f:Yoe,g:rle,G:ile,H:joe,I:Uoe,j:Goe,L:bL,m:Woe,M:Xoe,p:fe,q:Ce,Q:_L,s:TL,S:Koe,u:Zoe,U:Joe,V:qoe,w:ele,W:tle,x:null,X:null,y:nle,Y:ale,Z:ole,"%":BL},I={a:De,A:ke,b:$e,B:je,c:null,d:SL,e:SL,f:cle,g:wle,G:Cle,H:lle,I:sle,j:ule,L:xL,m:fle,M:dle,p:Oe,q:ft,Q:_L,s:TL,S:Ale,u:hle,U:ple,V:vle,w:mle,W:gle,x:null,X:null,y:yle,Y:ble,Z:Sle,"%":BL},$={a:le,A:G,b:Q,B:j,c:Y,d:gL,e:gL,f:zoe,g:mL,G:vL,H:yL,I:yL,j:Loe,L:Noe,m:Ioe,M:Roe,p:te,q:$oe,Q:Foe,s:Qoe,S:Voe,u:koe,U:Moe,V:Poe,w:Toe,W:Hoe,x:X,X:ee,y:mL,Y:vL,Z:Doe,"%":Ooe};P.x=z(n,P),P.X=z(r,P),P.c=z(t,P),I.x=z(n,I),I.X=z(r,I),I.c=z(t,I);function z(ze,Xe){return function(tt){var qe=[],gt=-1,wt=0,Xt=ze.length,rr,sr,ra;for(tt instanceof Date||(tt=new Date(+tt));++gt<Xt;)ze.charCodeAt(gt)===37&&(qe.push(ze.slice(wt,gt)),(sr=pL[rr=ze.charAt(++gt)])!=null?rr=ze.charAt(++gt):sr=rr==="e"?" ":"0",(ra=Xe[rr])&&(rr=ra(tt,sr)),qe.push(rr),wt=gt+1);return qe.push(ze.slice(wt,gt)),qe.join("")}}function O(ze,Xe){return function(tt){var qe=ay(1900,void 0,1),gt=K(qe,ze,tt+="",0),wt,Xt;if(gt!=tt.length)return null;if("Q"in qe)return new Date(qe.Q);if("s"in qe)return new Date(qe.s*1e3+("L"in qe?qe.L:0));if(Xe&&!("Z"in qe)&&(qe.Z=0),"p"in qe&&(qe.H=qe.H%12+qe.p*12),qe.m===void 0&&(qe.m="q"in qe?qe.q:0),"V"in qe){if(qe.V<1||qe.V>53)return null;"w"in qe||(qe.w=1),"Z"in qe?(wt=DE(ay(qe.y,0,1)),Xt=wt.getUTCDay(),wt=Xt>4||Xt===0?Vw.ceil(wt):Vw(wt),wt=ME.offset(wt,(qe.V-1)*7),qe.y=wt.getUTCFullYear(),qe.m=wt.getUTCMonth(),qe.d=wt.getUTCDate()+(qe.w+6)%7):(wt=HE(ay(qe.y,0,1)),Xt=wt.getDay(),wt=Xt>4||Xt===0?Rw.ceil(wt):Rw(wt),wt=ry.offset(wt,(qe.V-1)*7),qe.y=wt.getFullYear(),qe.m=wt.getMonth(),qe.d=wt.getDate()+(qe.w+6)%7)}else("W"in qe||"U"in qe)&&("w"in qe||(qe.w="u"in qe?qe.u%7:"W"in qe?1:0),Xt="Z"in qe?DE(ay(qe.y,0,1)).getUTCDay():HE(ay(qe.y,0,1)).getDay(),qe.m=0,qe.d="W"in qe?(qe.w+6)%7+qe.W*7-(Xt+5)%7:qe.w+qe.U*7-(Xt+6)%7);return"Z"in qe?(qe.H+=qe.Z/100|0,qe.M+=qe.Z%100,DE(qe)):HE(qe)}}function K(ze,Xe,tt,qe){for(var gt=0,wt=Xe.length,Xt=tt.length,rr,sr;gt<wt;){if(qe>=Xt)return-1;if(rr=Xe.charCodeAt(gt++),rr===37){if(rr=Xe.charAt(gt++),sr=$[rr in pL?Xe.charAt(gt++):rr],!sr||(qe=sr(ze,tt,qe))<0)return-1}else if(rr!=tt.charCodeAt(qe++))return-1}return qe}function te(ze,Xe,tt){var qe=f.exec(Xe.slice(tt));return qe?(ze.p=A.get(qe[0].toLowerCase()),tt+qe[0].length):-1}function le(ze,Xe,tt){var qe=g.exec(Xe.slice(tt));return qe?(ze.w=C.get(qe[0].toLowerCase()),tt+qe[0].length):-1}function G(ze,Xe,tt){var qe=h.exec(Xe.slice(tt));return qe?(ze.w=v.get(qe[0].toLowerCase()),tt+qe[0].length):-1}function Q(ze,Xe,tt){var qe=E.exec(Xe.slice(tt));return qe?(ze.m=k.get(qe[0].toLowerCase()),tt+qe[0].length):-1}function j(ze,Xe,tt){var qe=b.exec(Xe.slice(tt));return qe?(ze.m=B.get(qe[0].toLowerCase()),tt+qe[0].length):-1}function Y(ze,Xe,tt){return K(ze,t,Xe,tt)}function X(ze,Xe,tt){return K(ze,n,Xe,tt)}function ee(ze,Xe,tt){return K(ze,r,Xe,tt)}function pe(ze){return o[ze.getDay()]}function ae(ze){return i[ze.getDay()]}function ge(ze){return c[ze.getMonth()]}function me(ze){return s[ze.getMonth()]}function fe(ze){return a[+(ze.getHours()>=12)]}function Ce(ze){return 1+~~(ze.getMonth()/3)}function De(ze){return o[ze.getUTCDay()]}function ke(ze){return i[ze.getUTCDay()]}function $e(ze){return c[ze.getUTCMonth()]}function je(ze){return s[ze.getUTCMonth()]}function Oe(ze){return a[+(ze.getUTCHours()>=12)]}function ft(ze){return 1+~~(ze.getUTCMonth()/3)}return{format:function(ze){var Xe=z(ze+="",P);return Xe.toString=function(){return ze},Xe},parse:function(ze){var Xe=O(ze+="",!1);return Xe.toString=function(){return ze},Xe},utcFormat:function(ze){var Xe=z(ze+="",I);return Xe.toString=function(){return ze},Xe},utcParse:function(ze){var Xe=O(ze+="",!0);return Xe.toString=function(){return ze},Xe}}}var pL={"-":"",_:" ",0:"0"},Nu=/^\s*\d+/,Eoe=/^%/,Boe=/[\\^$*+?|[\]().{}]/g;function yi(e,t,n){var r=e<0?"-":"",a=(r?-e:e)+"",i=a.length;return r+(i<n?new Array(n-i+1).join(t)+a:a)}function _oe(e){return e.replace(Boe,"\\$&")}function iy(e){return new RegExp("^(?:"+e.map(_oe).join("|")+")","i")}function oy(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Toe(e,t,n){var r=Nu.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function koe(e,t,n){var r=Nu.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Moe(e,t,n){var r=Nu.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Poe(e,t,n){var r=Nu.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Hoe(e,t,n){var r=Nu.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function vL(e,t,n){var r=Nu.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function mL(e,t,n){var r=Nu.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Doe(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function $oe(e,t,n){var r=Nu.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Ioe(e,t,n){var r=Nu.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function gL(e,t,n){var r=Nu.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Loe(e,t,n){var r=Nu.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function yL(e,t,n){var r=Nu.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Roe(e,t,n){var r=Nu.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Voe(e,t,n){var r=Nu.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Noe(e,t,n){var r=Nu.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function zoe(e,t,n){var r=Nu.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Ooe(e,t,n){var r=Eoe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Foe(e,t,n){var r=Nu.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Qoe(e,t,n){var r=Nu.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function wL(e,t){return yi(e.getDate(),t,2)}function joe(e,t){return yi(e.getHours(),t,2)}function Uoe(e,t){return yi(e.getHours()%12||12,t,2)}function Goe(e,t){return yi(1+ry.count(Fh(e),e),t,3)}function bL(e,t){return yi(e.getMilliseconds(),t,3)}function Yoe(e,t){return bL(e,t)+"000"}function Woe(e,t){return yi(e.getMonth()+1,t,2)}function Xoe(e,t){return yi(e.getMinutes(),t,2)}function Koe(e,t){return yi(e.getSeconds(),t,2)}function Zoe(e){var t=e.getDay();return t===0?7:t}function Joe(e,t){return yi(Lw.count(Fh(e)-1,e),t,2)}function CL(e){var t=e.getDay();return t>=4||t===0?Wg(e):Wg.ceil(e)}function qoe(e,t){return e=CL(e),yi(Wg.count(Fh(e),e)+(Fh(e).getDay()===4),t,2)}function ele(e){return e.getDay()}function tle(e,t){return yi(Rw.count(Fh(e)-1,e),t,2)}function nle(e,t){return yi(e.getFullYear()%100,t,2)}function rle(e,t){return e=CL(e),yi(e.getFullYear()%100,t,2)}function ale(e,t){return yi(e.getFullYear()%1e4,t,4)}function ile(e,t){var n=e.getDay();return e=n>=4||n===0?Wg(e):Wg.ceil(e),yi(e.getFullYear()%1e4,t,4)}function ole(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+yi(t/60|0,"0",2)+yi(t%60,"0",2)}function SL(e,t){return yi(e.getUTCDate(),t,2)}function lle(e,t){return yi(e.getUTCHours(),t,2)}function sle(e,t){return yi(e.getUTCHours()%12||12,t,2)}function ule(e,t){return yi(1+ME.count(J2(e),e),t,3)}function xL(e,t){return yi(e.getUTCMilliseconds(),t,3)}function cle(e,t){return xL(e,t)+"000"}function fle(e,t){return yi(e.getUTCMonth()+1,t,2)}function dle(e,t){return yi(e.getUTCMinutes(),t,2)}function Ale(e,t){return yi(e.getUTCSeconds(),t,2)}function hle(e){var t=e.getUTCDay();return t===0?7:t}function ple(e,t){return yi(hL.count(J2(e)-1,e),t,2)}function EL(e){var t=e.getUTCDay();return t>=4||t===0?Xg(e):Xg.ceil(e)}function vle(e,t){return e=EL(e),yi(Xg.count(J2(e),e)+(J2(e).getUTCDay()===4),t,2)}function mle(e){return e.getUTCDay()}function gle(e,t){return yi(Vw.count(J2(e)-1,e),t,2)}function yle(e,t){return yi(e.getUTCFullYear()%100,t,2)}function wle(e,t){return e=EL(e),yi(e.getUTCFullYear()%100,t,2)}function ble(e,t){return yi(e.getUTCFullYear()%1e4,t,4)}function Cle(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Xg(e):Xg.ceil(e),yi(e.getUTCFullYear()%1e4,t,4)}function Sle(){return"+0000"}function BL(){return"%"}function _L(e){return+e}function TL(e){return Math.floor(+e/1e3)}var Kg,kL;xle({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function xle(e){return Kg=xoe(e),kL=Kg.format,Kg.parse,Kg.utcFormat,Kg.utcParse,Kg}function Ele(e){return new Date(e)}function Ble(e){return e instanceof Date?+e:+new Date(+e)}function ML(e,t,n,r,a,i,o,s,c,f){var A=JI(),h=A.invert,v=A.domain,g=f(".%L"),C=f(":%S"),b=f("%I:%M"),B=f("%I %p"),E=f("%a %d"),k=f("%b %d"),P=f("%B"),I=f("%Y");function $(z){return(c(z)<z?g:s(z)<z?C:o(z)<z?b:i(z)<z?B:r(z)<z?a(z)<z?E:k:n(z)<z?P:I)(z)}return A.invert=function(z){return new Date(h(z))},A.domain=function(z){return arguments.length?v(Array.from(z,Ble)):v().map(Ele)},A.ticks=function(z){var O=v();return e(O[0],O[O.length-1],z??10)},A.tickFormat=function(z,O){return O==null?$:f(O)},A.nice=function(z){var O=v();return(!z||typeof z.range!="function")&&(z=t(O[0],O[O.length-1],z??10)),z?v(oL(O,z)):A},A.copy=function(){return ey(A,ML(e,t,n,r,a,i,o,s,c,f))},A}function _le(){return G2.apply(ML(Coe,Soe,Fh,PE,Lw,ry,kE,TE,Yg,kL).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function PL(e){return e!==null&&typeof e=="object"&&"palette"in e&&"type"in e&&e.type==="continuous"}function $E(e){return e!==null&&typeof e=="object"&&"palette"in e&&"type"in e&&e.type==="categorical"}function HL(e){return $E(e)||PL(e)}const Zg="#110529",Tle="solid",ly=1,q2="21",L0=3,IE=2,em={min:3,max:10},DL={color:"#ccc",lineShape:Tle,dotShape:q2},kle="light";function Mle(e){const t=1/(e.length-1);return Zr().domain(e.map((n,r)=>r*t)).range(e)}function $L(e,t){const n=Ui[e].colors,r=t.length>1?1/(t.length-1):0,a=Mle(n),i=uE(e),o=t.reduce((s,c,f)=>(s[c]={colorIdx:i?f:f*r,aes:{color:i?n[f%n.length]:a(f*r),lineShape:Og[f%Og.length],dotShape:W4[f%W4.length]}},s),{});return{type:"categorical",palette:e,naAes:DL,order:t,mapping:o}}function tm(e){return{type:"continuous",palette:e,naAes:DL,range:null,midPoint:null,log:!1}}function nm(e){return $L(kle,e)}function IL(e,t,n,r){var i;if((t==null?void 0:t.type)==="continuous")return{inheritedAes:{}};const a=t??nm(n?((i=e[n])==null?void 0:i.list)??[]:[]);return{order:a.order,inheritedAes:a.order.reduce((o,s)=>{const c=a.mapping[s].aes;return o[s]={},r.fill&&(o[s].fillColor=c.color,o[s].dotFill=c.color),r.stroke&&(o[s].lineColor=c.color),r.dotShape&&(o[s].dotShape=c.dotShape),r.lineType&&(o[s].lineShape=c.lineShape),o},{})}}function LL(e,t,n){var i;const r=n[e];if(r&&!$E(r))return{};const a=r??nm(((i=t[e])==null?void 0:i.list)??[]);return a.order.reduce((o,s)=>{const c=a.mapping[s].aes;return o[s]={fillColor:c.color,lineColor:c.color,dotFill:c.color,dotShape:c.dotShape,dotSize:L0,lineWidth:ly},o},{})}function Ple(e,t,n){var i;const r=n[e];if(r&&!$E(r))return{};const a=r??nm(((i=t[e])==null?void 0:i.list)??[]);return{order:a.order,inheritedAes:a.order.reduce((o,s)=>{const c=a.mapping[s].aes;return o[s]={fillColor:c.color,lineColor:pi,dotFill:pi,dotShape:q2,dotSize:L0,lineWidth:ly},o},{})}}function LE(e,t,n,r){var i;const a=n[e]??nm(((i=t[e])==null?void 0:i.list)??[]);return a.order.reduce((o,s)=>{const c=a.mapping[s].aes;return o[s]=c[r],o},{})}const Hle={},Dle={class:"inline-icon",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function $le(e,t){return d.openBlock(),d.createElementBlock("svg",Dle,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.5 2.25H12V3.75H15.25V11.25H13.5C12.8096 11.25 12.25 11.8096 12.25 12.5V21H13.75V12.75H18.25V16.25H17.5C16.8096 16.25 16.25 16.8096 16.25 17.5V21H17.75V17.75H20.25V21H21.75V17.5C21.75 16.8096 21.1904 16.25 20.5 16.25H19.75V12.5C19.75 11.8096 19.1904 11.25 18.5 11.25H16.75V3.5C16.75 2.80964 16.1904 2.25 15.5 2.25Z",fill:"#110529"},null,-1),d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.5 3.75H7.25V7.25H8.5C9.19036 7.25 9.75 7.80964 9.75 8.5V21H8.25V8.75H4.75V21H3.25V8.5C3.25 7.80965 3.80964 7.25 4.5 7.25H5.75V3.5C5.75 2.80964 6.30964 2.25 7 2.25H10.5V3.75Z",fill:"#07AD3E"},null,-1)]))}const RL=mr(Hle,[["render",$le]]),Nw="pl7.app/graph/thresholds",fv="pl7.app/graph/axis/lowerLimit",dv="pl7.app/graph/axis/upperLimit",Av="pl7.app/graph/axis/symmetricRange",Jg="pl7.app/graph/palette",zw="pl7.app/axisNature",Ile="pl7.app/isSubset";function Lle(e,t){return t==="discrete"?e&&qg[e]?e:"box":t==="scatterplot"||t==="scatterplot-umap"?e&&rm[e]?e:"dots":t==="dendro"?"dendro":e??"heatmap"}const qg={box:["box"],box_binnedDots:["box","binnedDots"],box_jitteredDots:["box","jitteredDots"],violin:["violin"],violin_binnedDots:["violin","binnedDots"],violin_jitteredDots:["violin","jitteredDots"],binnedDots:["binnedDots"],jitteredDots:["jitteredDots"],bar:["bar"],bar_line:["bar","line"],bar_errorbar:["bar","errorbar"],stackedBar:["stackedBar"],line:["line"],line_jitteredDots:["line","jitteredDots"],line_binnedDots:["line","binnedDots"],line_errorbar:["line","errorbar"],errorbar:["errorbar"],sina:["sina"],logo:["logo"]},rm={dots:["dots"],curve:["curve"],curve_dots:["curve","dots"]},VL={dots:["dots"],curve_dots:["curve","dots"]},Rle={heatmap:["heatmap"],heatmapClustered:["heatmapClustered"]},Vle={bins:["bins"]},LA={box:"Boxplot",binnedDots:"Binned Dots",jitteredDots:"Jittered Dots",violin:"Violins",bar:"Bar",stackedBar:"Stacked Bar",line:"Line",errorbar:"Error Bar",sina:"Sina",logo:"Logo Plot",dots:"Scatter Plot",curve:"Curve",heatmap:"Heatmap",heatmapClustered:"Heatmap + Dendro",dendro:"Dendrogram",bins:"Histogram",bubble:"Bubble plot"};function Nle(e,t){var r,a,i,o,s,c,f,A,h,v,g,C,b,B,E,k,P,I,$,z,O,K,te,le,G,Q,j,Y,X,ee,pe;if(e==="discrete"){const ae=t;return{overall:{data:{testMethod:((a=(r=ae==null?void 0:ae.overall)==null?void 0:r.data)==null?void 0:a.testMethod)??null},validity:{testMethod:((o=(i=ae==null?void 0:ae.overall)==null?void 0:i.validity)==null?void 0:o.testMethod)??!0}},referenceGroup:{data:{testMethod:((c=(s=ae==null?void 0:ae.referenceGroup)==null?void 0:s.data)==null?void 0:c.testMethod)??null,referenceGroup:((A=(f=ae==null?void 0:ae.referenceGroup)==null?void 0:f.data)==null?void 0:A.referenceGroup)??null,correctionMethod:((v=(h=ae==null?void 0:ae.referenceGroup)==null?void 0:h.data)==null?void 0:v.correctionMethod)??"Bonferroni",format:((C=(g=ae==null?void 0:ae.referenceGroup)==null?void 0:g.data)==null?void 0:C.format)??"significance",ns:((B=(b=ae==null?void 0:ae.referenceGroup)==null?void 0:b.data)==null?void 0:B.ns)??!1},validity:{testMethod:((k=(E=ae==null?void 0:ae.referenceGroup)==null?void 0:E.validity)==null?void 0:k.testMethod)??!0,referenceGroup:((I=(P=ae==null?void 0:ae.referenceGroup)==null?void 0:P.validity)==null?void 0:I.referenceGroup)??!0}},pairwise:{data:{testMethod:((z=($=ae==null?void 0:ae.pairwise)==null?void 0:$.data)==null?void 0:z.testMethod)??null,correctionMethod:((K=(O=ae==null?void 0:ae.pairwise)==null?void 0:O.data)==null?void 0:K.correctionMethod)??"Bonferroni",format:((le=(te=ae==null?void 0:ae.pairwise)==null?void 0:te.data)==null?void 0:le.format)??"significance",ns:((Q=(G=ae==null?void 0:ae.pairwise)==null?void 0:G.data)==null?void 0:Q.ns)??!1},validity:{testMethod:((Y=(j=ae==null?void 0:ae.pairwise)==null?void 0:j.validity)==null?void 0:Y.testMethod)??!0}}}}const n=t;return{trend:{on:((X=n==null?void 0:n.trend)==null?void 0:X.on)??!1,trim:((ee=n==null?void 0:n.trend)==null?void 0:ee.trim)??!1,showLegend:((pe=n==null?void 0:n.trend)==null?void 0:pe.showLegend)??!0}}}function RE(e){return typeof e<"u"&&e!==null&&typeof e=="object"&&"min"in e&&"max"in e}function e5(e){return typeof e=="object"&&e!==null&&"type"in e}function Qh(e){return typeof e<"u"&&e!==null&&typeof e=="object"&&"range"in e}const zle=()=>({bubble:{NAValueAs:0,strokeColor:null,minRadius:3,maxRadius:38,normalizationDirection:"row",normalizationMethod:"standardScaling"},bins:{fillColor:null,opacity:1},dendro:{dotFill:pi,dotShape:DA,dotSize:L0,lineColor:pi,mode:"normal",leavesMode:"normal",showTable:!1,showLegend:!0},heatmap:{NAValueAs:0,normalizationDirection:"row",normalizationMethod:"standardScaling"},heatmapClustered:{NAValueAs:0,normalizationDirection:"row",normalizationMethod:"standardScaling",dendrogramX:!0,dendrogramY:!0,disableClusteringX:!1,disableClusteringY:!1},dots:{dotFill:null,dotShape:null,dotSize:null},curve:{lineColor:pi,smoothing:!0},box:{showOutliers:!0,fillColor:null,lineColor:Zg,dotShape:DA,lineType:bw,gapWidth:.2,opacity:1,stat:{low:.25,middle:.5,upper:.75,k:1.5}},binnedDots:{fillColor:null,lineColor:Zg,opacity:1,showOutliers:!0},jitteredDots:{dotFill:null,dotShape:DA,lineColor:Zg,opacity:1,showOutliers:!0},violin:{fillColor:null,lineColor:Zg,lineType:bw,opacity:1,trim:!1,showQuartiles:!1,quartilesLineStyle:"dashed",medianLineStyle:"solid"},bar:{fillColor:null,lineColor:Zg,opacity:1,height:"max"},stackedBar:{fillColor:null,lineColor:Zg,opacity:1,normalize:!1},line:{pointsValues:"mean",lineColor:null,dotShape:DA,lineType:bw,dotFill:null,opacity:1},errorbar:{pointsValues:"mean",interval:"sd",lineColor:null,dotShape:DA,dotFill:null,opacity:1},sina:{dotFill:null,dotShape:DA,opacity:1,showOutliers:!0},logo:{normalize:!1,opacity:1}});function Ole(e){const t=zle();return Object.keys(t).reduce((r,a)=>(Object.assign(r[a],(e==null?void 0:e[a])??{}),r),t)}const Fle=()=>({title:{value:"Graph 1",position:"center",mode:"auto",facetTitleFrame:"full"},axisX:{labelsPosition:"bottom",labelsRotation:null,axisLabelsAngle:90,titleMode:"auto",customTitle:"",gridlines:!0,linesBetweenCategories:!0,ticks:!0,scale:"linear",significantLinesStyle:"dashed",sorting:"asc",allowNullPrimaryGroups:!1,allowNullSecondaryGroups:!1},axisY:{titleMode:"auto",customTitle:"",axisLabelsAngle:90,gridlines:!0,ticks:!0,scale:"linear",significantLinesStyle:"dashed",sorting:"asc"},legend:{},other:{frame:"full",reverse:!1,facetSharedBy:"xy",facetColumns:3,binsCount:10,groupingDirection:"straight",groupingStack:"vertical"}});function NL(e){return e==="full"||e==="none"}function Qle(e,t){var a;const n=Fle();if(!t)return n;function r(i){return!i||e==="heatmap"&&!NL(i)?"full":e!=="heatmap"&&NL(i)&&i==="none"?"empty":i}return{title:{...n.title,...t.title},axisX:{...n.axisX,...t.axisX},axisY:{...n.axisY,...t.axisY},legend:{...n.legend,...t.legend},other:{...n.other,...t.other,frame:r((a=t.other)==null?void 0:a.frame)}}}const _f={box:ore,box_binnedDots:cre,box_jitteredDots:hre,binnedDots:gre,jitteredDots:Cre,violin:Bre,violin_binnedDots:Mre,violin_jitteredDots:$re,bar:gI,bar_line:yI,bar_errorbar:jre,stackedBar:Wre,line:wI,line_binnedDots:tae,line_jitteredDots:bI,line_errorbar:sae,errorbar:yI,sina:dae,logo:Sae,dots:vae,curve:wI,curve_dots:bI,heatmap:CI,heatmapClustered:RL,dendro:RL,bins:gI,bubble:CI},Ow=[{value:"ttest",text:"TTest"},{value:"anova",text:"ANOVA"},{value:"wilcoxon",text:"Wilcoxon"},{value:"kruskalWallis",text:"Kruskal-Wallis"}],zL=[{value:"BenjaminiHochberg",text:"Benjamini-Hochberg"},{value:"BenjaminiYekutieli",text:"Benjamini-Yekutieli"},{value:"Bonferroni",text:"Bonferroni"},{value:"Hochberg",text:"Hochberg"},{value:"Holm",text:"Holm"},{value:"Hommel",text:"Hommel"},{value:"none",text:"None"}],OL=[{value:"pValue",text:"p-value"},{value:"significance",text:"significance"}],FL=600,QL=350,jle=400,Ule=250;function jL(e,t,n){var a,i,o,s,c,f;if(((i=(a=e.components)==null?void 0:a.y)==null?void 0:i.selectorStates.length)===0)return[];if(!((s=(o=e.components)==null?void 0:o[n])!=null&&s.selectorStates.length))return["single common group"];const r=(c=e.components)==null?void 0:c[n].selectorStates[0].selectedSource;return((f=t[r])==null?void 0:f.list)??[]}function Gle(e){const t=[];if(e.overall.data.testMethod&&e.overall.validity.testMethod&&t.push({type:"stat",statType:"overall",testMethod:e.overall.data.testMethod}),e.referenceGroup.data.testMethod&&e.referenceGroup.validity.testMethod&&e.referenceGroup.validity.referenceGroup){const n={type:"stat",statType:"referenceGroup",testMethod:e.referenceGroup.data.testMethod,referenceGroup:e.referenceGroup.data.referenceGroup,format:e.referenceGroup.data.format,ns:e.referenceGroup.data.ns};e.referenceGroup.data.correctionMethod!=="none"&&(n.correctionMethod=e.referenceGroup.data.correctionMethod),t.push(n)}if(e.pairwise.data.testMethod&&e.pairwise.validity.testMethod){const n={type:"stat",statType:"pairwise",testMethod:e.pairwise.data.testMethod,format:e.pairwise.data.format,ns:e.pairwise.data.ns};e.referenceGroup.data.correctionMethod!=="none"&&(n.correctionMethod=e.referenceGroup.data.correctionMethod),t.push(n)}return t}function UL(e,t,n,r,a){const i=[],o=r.components.primaryGrouping.selectorStates.length>0,s=r.components.secondaryGrouping.selectorStates.length>0;function c(f,A=!1){return f===null?s?{type:"secondaryGrouping"}:o&&!A?{type:"primaryGrouping"}:{type:"secondaryGrouping"}:f}return e.forEach(f=>{var A;if(f==="box"){const h=t[f];i.push({type:"box",aes:{showOutliers:h.showOutliers,dotShape:h.dotShape,fillColor:c(h.fillColor),lineColor:c(h.lineColor),lineShape:h.lineType,opacity:h.opacity}})}if(f==="binnedDots"){const h=t[f];i.push({type:"binnedDots",aes:{showOutliers:h.showOutliers,fillColor:c(h.fillColor),lineColor:c(h.lineColor),opacity:h.opacity}})}if(f==="jitteredDots"){const h=t[f];i.push({type:"dot",aes:{showOutliers:h.showOutliers,dotFill:c(h.dotFill),dotShape:h.dotShape,lineColor:h.lineColor,opacity:h.opacity}})}if(f==="violin"){const h=t[f];i.push({type:"violin",stat:{trim:h.trim},aes:{showQuartiles:h.showQuartiles,medianLineStyle:h.medianLineStyle,quartilesLineStyle:h.quartilesLineStyle,fillColor:c(h.fillColor),lineColor:c(h.lineColor),lineShape:h.lineType,opacity:h.opacity}})}if(f==="bar"){const h=t[f];i.push({type:"bar",height:h.height,aes:{fillColor:c(h.fillColor),lineColor:c(h.lineColor),opacity:h.opacity}})}if(f==="stackedBar"){const h=t[f];i.push({type:"stackedBar",normalize:h.normalize,aes:{fillColor:c(h.fillColor),lineColor:c(h.lineColor),opacity:h.opacity}})}if(f==="line"){const h=t[f];i.push({type:"line",pointsValues:h.pointsValues,aes:{lineColor:c(h.lineColor,!0),fillColor:c(h.dotFill,!0),lineShape:h.lineType,dotShape:h.dotShape,opacity:h.opacity}})}if(f==="errorbar"){const h=t[f];i.push({type:"errorbar",pointsValues:h.pointsValues,interval:h.interval,aes:{lineColor:c(h.lineColor,!0),fillColor:c(h.dotFill,!0),dotShape:h.dotShape,opacity:h.opacity}})}if(f==="sina"){const h=t[f];i.push({type:"sina",aes:{showOutliers:h.showOutliers,dotFill:c(h.dotFill),dotShape:h.dotShape}})}if(f==="logo"&&s){const h=t[f],g=((A=a.getSourceInfo(r.components.secondaryGrouping.selectorStates[0].selectedSource).spec.domain)==null?void 0:A["pl7.app/alphabet"])==="aminoacid";i.push({type:"logo",normalize:h.normalize,aes:{opacity:h.opacity,dotFill:g?Uae:jae}})}}),o&&!s&&i.push(...Gle(n)),i}function Yle(e,t,n,r){if(e){const a=Qh(t)?t:{column:e.value,range:em},i=[1/0,-1/0];return n.values[e.value].forEach(o=>{const s=Number(o);s<i[0]&&(i[0]=s),s>i[1]&&(i[1]=s)}),{columnName:e,domain:i,range:[a.range.min,a.range.max]}}return Qh(t)?r:t??r}function GL(e,t,n,r){const a=n.find(o=>o.value===e);let i=[1/0,-1/0];if(a){const{range:o,palette:s,midPoint:c,log:f}=t,A=(o==null?void 0:o.minValue)===null||(o==null?void 0:o.minValue)===void 0,h=(o==null?void 0:o.maxValue)===null||(o==null?void 0:o.maxValue)===void 0;if((A||h)&&r.values[a.value].forEach(v=>{const g=Number(v);A&&g<i[0]&&(i[0]=g),h&&g>i[1]&&(i[1]=g)}),A||(i[0]=o==null?void 0:o.minValue),h||(i[1]=o==null?void 0:o.maxValue),c!=null){const v=Math.max(Math.abs(c-i[0]),Math.abs(c-i[1]));i[0]=c-v,i[1]=c+v}return{columnName:a,domain:i,range:Ui[s].colors,type:f?"log":"linear"}}return pi}function YL(e,t,n,r,a,i,o=[],s=L0){var C,b;const c=[];function f(B,E,k,P=!1){var I;if(E.length){const $=E.length?(I=i.getSourceInfo(E[0]))==null?void 0:I.type:void 0,z=$==="String"||!P?{type:"grouping",value:E[0]}:GL(E[0],tm(ov),o,n),O=a[E[0]];return B===null||$==="String"||!P||!PL(O)?z:GL(E[0],O,o,n)}return typeof B=="object"?k:B}const A=r.components.grouping.selectorStates.map(B=>B.selectedSource),h=((C=r.components.shape)==null?void 0:C.selectorStates.map(B=>B.selectedSource))??[],v=(b=r.components.size)==null?void 0:b.selectorStates.map(B=>B.selectedSource)[0],g=v?o.find(B=>B.value===v):void 0;return e.forEach(B=>{if(B==="dots"){const E=t[B];c.push({type:"dots",aes:{dotFill:f(E.dotFill,A,pi,!0),dotShape:f(E.dotShape,h,DA),dotSize:Yle(g,E.dotSize,n,s)}})}if(B==="curve"){const E=t[B];c.push({type:"curve",smoothing:E.smoothing,aes:{lineColor:f(E.lineColor,A,pi,!0)}})}}),c}const Wle=6,Xle=5;function WL(e,t=[]){return e!==null?e:t.length>Wle&&t.some(({label:n})=>n.length>Xle)?"45deg":"center"}function t5(e,t,n=[]){let r={},a={};t==="discrete"&&(r.labelsPosition=WL(e.axisX.labelsRotation,n),r.linesBetweenCategories=e.axisX.linesBetweenCategories,a.scale=e.axisY.scale),(t==="discrete"||t==="scatterplot"||t==="scatterplot-umap")&&(r.showGrid=e.axisX.gridlines,r.showTicks=e.axisX.ticks,a.showGrid=e.axisY.gridlines,a.showTicks=e.axisY.ticks),(t==="scatterplot"||t==="scatterplot-umap")&&(r.scale=e.axisX.scale,a.scale=e.axisY.scale,r.significantLinesStyle=e.axisX.significantLinesStyle,a.significantLinesStyle=e.axisY.significantLinesStyle),t==="histogram"&&(r.scale=e.axisX.scale,a.scale=e.axisY.scale),(t==="heatmap"||t==="bubble")&&(r.axisLabelsAngle=e.axisX.axisLabelsAngle,a.axisLabelsAngle=e.axisY.axisLabelsAngle,r.sorting=e.axisX.sorting,a.sorting=e.axisY.sorting),e.axisY.titleMode!=="auto"&&(a.title=e.axisY.titleMode==="custom"?e.axisY.customTitle:""),e.axisX.titleMode!=="auto"&&(r.title=e.axisX.titleMode==="custom"?e.axisX.customTitle:"");const i={xAxis:r,yAxis:a,frame:{type:e.other.frame},facetSettings:{nCols:e.other.facetColumns}};return(t==="discrete"||t==="scatterplot"||t==="heatmap")&&(i.orientation=e.other.reverse?"horizontal":"vertical",i.facetSettings.sharedX=["x","xy"].includes(e.other.facetSharedBy),i.facetSettings.sharedY=["y","xy"].includes(e.other.facetSharedBy)),t==="histogram"&&(i.groupingDirection=e.other.groupingDirection,i.groupingStack=e.other.groupingStack),i}function R0(e){return JSON.parse(JSON.stringify(e))}function Kle(e,t){if(typeof e>"u")return!0;const n=Object.keys(e);return typeof t>"u"?n.length===0:n.every(r=>t[r])}function XL(e,t,n,r){return(t==null?void 0:t[Ile])==="true"?"subset":r!==void 0?"range":n!==void 0||e==="Int"||e==="String"?"equals":"range"}async function VE(e,t,n=!0){const r=[],a=t.filter(({selectedSource:s})=>"kind"in s&&s.kind==="PColumn"),i=t.filter(({selectedSource:s})=>!("kind"in s&&s.kind==="PColumn")),o=[];for(const{inputName:s,filterType:c,selectedSource:f,selectedFilterValue:A,selectedFilterRange:h,fixedAxes:v}of a){const{name:g,valueType:C,annotations:b,domain:B}=f,E=await e.pFrameProvider.findColumnBy(g,C,d.toRaw(b),d.toRaw(B)),k=s==="filters"||s==="tabBy"||s==="highlight";if(E){const P=await e.pFrameProvider.getColumnSpecById(E),I=P&&v?v.map($=>({axisIdx:$.axisIdx,axisValue:$.axisValue,axisSource:Lr.fromAxisSpec(P==null?void 0:P.axesSpec[$.axisIdx]).toCanonicalString()})):[];if(!k)r.push({inputName:s,selectedSource:E.toCanonicalString(),fixedAxes:I});else{const $=c??XL(C,P==null?void 0:P.annotations,A,h),z=$==="equals"&&typeof A>"u"?(await e.pFrameProvider.getColumnUniqueValues(E))[0]:A,O={min:void 0,max:void 0,...h};r.push({inputName:s,filterType:$,selectedSource:E.toCanonicalString(),selectedFilterValue:z,selectedFilterRange:O,fixedAxes:I})}o.push(...(P==null?void 0:P.axesSpec.map($=>({spec:$,parentColumn:E})))??[])}else console.warn(`Not found column for default option: ${JSON.stringify({inputName:s,selectedSource:f})}`)}for(const{inputName:s,selectedSource:c,filterType:f,selectedFilterValue:A,selectedFilterRange:h}of i){const v=Lr.fromAxisSpec(c),g=v.toCanonicalString(),C=s==="filters"||s==="tabBy"||s==="highlight",b=C?f??XL(v.type,c==null?void 0:c.annotations):void 0,B=o.find(P=>Lr.fromAxisSpec(P.spec).toCanonicalString()===g),E=C&&b==="equals"&&typeof A>"u"&&(B!=null&&B.parentColumn)?(await e.pFrameProvider.getAxisUniqueValues(v,[B==null?void 0:B.parentColumn]))[0]:A,k={min:void 0,max:void 0,...h};if(n||r.push({inputName:s,filterType:b,selectedSource:g,selectedFilterValue:E,selectedFilterRange:k,fixedAxes:[]}),B)r.push({inputName:s,filterType:b,selectedSource:g,selectedFilterValue:E,selectedFilterRange:k,fixedAxes:[]});else{const{spec:P,parentColumn:I}=o.find($=>v.name===$.spec.name&&v.type===$.spec.type&&Kle(v.domain,$.spec.domain))??{};if(P){const $=(s==="filters"||s==="tabBy")&&typeof A>"u"?(await e.pFrameProvider.getAxisUniqueValues(Lr.fromAxisSpec(P),[I]))[0]:A;r.push({inputName:s,filterType:b,selectedSource:Lr.fromAxisSpec(P).toCanonicalString(),selectedFilterValue:$,selectedFilterRange:k,fixedAxes:[]})}}}return r}async function KL(e,t,n){if(!n||n.length===0)return e;const r=await VE(t,n,!1),a=R0(e);return r.forEach(({inputName:i,selectedSource:o,selectedFilterValue:s})=>{e.components[i]&&a.components[i].selectorStates.push({selectedSource:o,type:"equals",selectedFilterValue:s})}),a}const ZL={fillColor:iv,lineColor:pi,dotFill:iv,dotShape:q2,dotSize:L0,lineWidth:ly};function Zle(e,t,n,r){var c;const a=UL(qg[t.template],t.layersSettings,t.statisticsSettings,t.optionsState,r),i=tR(t.chartType,t.template,t.layersSettings,t.statisticsSettings,t.optionsState,r);e.layers=a;const o=t.optionsState.components;if(o.primaryGrouping.selectorStates.length&&e.primaryGrouping){const f=o.primaryGrouping.selectorStates[0].selectedSource,A=i[f];Object.assign(e.primaryGrouping,IL(n,t.dataBindAes[f],f,A)),t.axesSettings.axisX.allowNullPrimaryGroups&&(e.primaryGrouping.allowNullGroup=!0,e.primaryGrouping.order&&(e.primaryGrouping.order=[...e.primaryGrouping.order,"null"]),e.primaryGrouping.inheritedAes&&(e.primaryGrouping.inheritedAes.null=ZL))}if(o.secondaryGrouping.selectorStates&&e.secondaryGrouping){const f=o.secondaryGrouping.selectorStates[0].selectedSource,A=i[f];Object.assign(e.secondaryGrouping,IL(n,t.dataBindAes[f],f,A)),t.axesSettings.axisX.allowNullSecondaryGroups&&(e.secondaryGrouping.allowNullGroup=!0,e.secondaryGrouping.order&&(e.secondaryGrouping.order=[...e.secondaryGrouping.order,"null"]),e.secondaryGrouping.inheritedAes&&(e.secondaryGrouping.inheritedAes.null=ZL))}const s=e.primaryGrouping?(c=n[e.primaryGrouping.columnName.value])==null?void 0:c.options:[];return Object.assign(e,t5(t.axesSettings,t.chartType,s)),e}function Jle(e,t,n,r,a){var C,b,B,E,k;e.layers=YL(rm[n.template],n.layersSettings,t,n.optionsState,n.dataBindAes,r,e==null?void 0:e.grouping);const i=n.optionsState.components.grouping,o=n.optionsState.components.shape;if(i.selectorStates.length||o.selectorStates.length){const P=[...i.selectorStates,...o.selectorStates],I={};P.forEach(({selectedSource:$})=>{I[$]=LL($,a,n.dataBindAes)}),Object.assign(e,{inheritedAes:I})}const s=n.statisticsSettings,c=e.layers.find(P=>P.type==="dots");s.trend.on&&c&&(e.trend={color:(C=c.aes)==null?void 0:C.dotFill,bounded:!1}),Object.assign(e,t5(n.axesSettings,n.chartType));const f=(b=i.selectorStates[0])==null?void 0:b.selectedSource,A=(B=n.optionsState.components.x.selectorStates[0])==null?void 0:B.selectedSource,h=(E=n.optionsState.components.y.selectorStates[0])==null?void 0:E.selectedSource,v=r.getSourceInfo(A),g=r.getSourceInfo(h);if(i.selectorStates.length){const P=r.getSourceInfo(f).annotations;if(P!=null&&P[Nw]&&(JSON.parse(P[Nw])??[]).forEach($=>{const{columnId:z,value:O}=$;z&&v.kind==="column"&&v.type===z.valueType&&v.name===z.name&&(e.xAxis.significantLines||(e.xAxis.significantLines=[]),e.xAxis.significantLines.push(Number(O))),z&&g.kind==="column"&&g.type===z.valueType&&g.name===z.name&&(e.yAxis.significantLines||(e.yAxis.significantLines=[]),e.yAxis.significantLines.push(Number(O)))}),P!=null&&P[Jg]){const I=JSON.parse(P[Jg]),{mapping:$={},name:z=""}=I;e.layers.forEach(te=>{te.type==="dots"&&(te.aes||(te.aes={}),te.aes.dotFill={type:"grouping",value:f})});const O=[...Object.entries($),["null",ww]],K=((k=Ui[z])==null?void 0:k.colors)??[];e.inheritedAes[f]=O.reduce((te,[le,G])=>{const Q=K[Number(G)]??pi;return te[le]={fillColor:Q,lineColor:Q,dotFill:Q,dotShape:q2,dotSize:L0,lineWidth:ly},te},{})}}return v.annotations&&(v.annotations[dv]&&(e.xAxis.upperValue=Number(v.annotations[dv])),v.annotations[fv]&&(e.xAxis.lowerValue=Number(v.annotations[fv])),v.annotations[Av]&&(e.xAxis.symmetricRange=Number(v.annotations[Av]))),g.annotations&&(g.annotations[dv]&&(e.yAxis.upperValue=Number(g.annotations[dv])),g.annotations[fv]&&(e.yAxis.lowerValue=Number(g.annotations[fv])),g.annotations[Av]&&(e.yAxis.symmetricRange=Number(g.annotations[Av]))),e}const qle=750,ese=450;function tse(e,t,n,r,a){var h,v,g,C;e.layers=YL(rm[n.template],n.layersSettings,t,n.optionsState,n.dataBindAes,r,e==null?void 0:e.grouping,IE);const i=n.optionsState.components.grouping;if(i.selectorStates.length){const b=[...i.selectorStates],B={};b.forEach(({selectedSource:E})=>{B[E]=LL(E,a,n.dataBindAes)}),Object.assign(e,{inheritedAes:B})}Object.assign(e,t5(n.axesSettings,n.chartType));const o=(h=i.selectorStates[0])==null?void 0:h.selectedSource,s=(v=n.optionsState.components.x.selectorStates[0])==null?void 0:v.selectedSource,c=(g=n.optionsState.components.y.selectorStates[0])==null?void 0:g.selectedSource,f=r.getSourceInfo(s),A=r.getSourceInfo(c);if(i.selectorStates.length){const b=r.getSourceInfo(o).annotations;if(b!=null&&b[Nw]&&(JSON.parse(b[Nw])??[]).forEach(E=>{const{columnId:k,value:P}=E;k&&f.kind==="column"&&f.type===k.valueType&&f.name===k.name&&(e.xAxis.significantLines||(e.xAxis.significantLines=[]),e.xAxis.significantLines.push(Number(P))),k&&A.kind==="column"&&A.type===k.valueType&&A.name===k.name&&(e.yAxis.significantLines||(e.yAxis.significantLines=[]),e.yAxis.significantLines.push(Number(P)))}),b!=null&&b[Jg]){const B=JSON.parse(b[Jg]),{mapping:E={},name:k=""}=B;e.layers.forEach($=>{$.type==="dots"&&($.aes||($.aes={}),$.aes.dotFill={type:"grouping",value:o})});const P=[...Object.entries(E),["null",ww]],I=((C=Ui[k])==null?void 0:C.colors)??[];e.inheritedAes[o]=P.reduce(($,[z,O])=>{const K=I[Number(O)]??pi;return $[z]={fillColor:K,lineColor:K,dotFill:K,dotShape:q2,dotSize:L0,lineWidth:ly},$},{})}}return f.annotations&&(f.annotations[dv]&&(e.xAxis.upperValue=Number(f.annotations[dv])),f.annotations[fv]&&(e.xAxis.lowerValue=Number(f.annotations[fv])),f.annotations[Av]&&(e.xAxis.symmetricRange=Number(f.annotations[Av]))),A.annotations&&(A.annotations[dv]&&(e.yAxis.upperValue=Number(A.annotations[dv])),A.annotations[fv]&&(e.yAxis.lowerValue=Number(A.annotations[fv])),A.annotations[Av]&&(e.yAxis.symmetricRange=Number(A.annotations[Av]))),e.size={width:qle,height:ese},e.lassoMode=n.lassoMode,e}function nse(e,t){var o,s;const n={},r=(o=t.dataBindAes[e.valueColumn.value])==null?void 0:o.palette;if((e==null?void 0:e.valueType)!=="discrete"){if(t.template==="heatmapClustered"){const c=t.layersSettings.heatmapClustered;c.disableClusteringX||(e.dendrogramX={fillNA:0,showNodes:!1,hidden:!c.dendrogramX}),c.disableClusteringY||(e.dendrogramY={fillNA:0,position:"right",showNodes:!1,hidden:!c.dendrogramY})}n.colorsList=Ui[r??Fae].colors}else n.colorsList=Ui[r??"bright"].colors;e.aes=n,(s=e.annotations)==null||s.forEach(c=>{var v;const f=c.valueColumn.value,A=(v=t.dataBindAes[f])==null?void 0:v.palette,h=c.type==="discrete"?xI:ov;c.colors=Ui[A??h].colors}),Object.assign(e,t5(t.axesSettings,t.chartType)),t.template==="heatmapClustered"&&(e==null?void 0:e.valueType)!=="discrete"&&(e.facetSettings.sharedX=!1,e.facetSettings.sharedY=!1);const a=t.template,i=t.layersSettings[a];return e.NAValueAs=i.NAValueAs,e.valueType==="continuous"&&i.normalizationDirection&&(e.normalization={method:i.normalizationMethod,direction:i.normalizationDirection}),e}const rse=280;function ase(e,t,n,r,a){var c,f,A,h,v;e.rootPosition="left",e.size={width:FL,height:QL};const i=n.optionsState.components,o=n.layersSettings.dendro,s=e==null?void 0:e.aes;if(s.nodeShape&&typeof s.nodeShape=="object"){const g=(c=i.nodeShape.selectorStates[0])==null?void 0:c.selectedSource,C=LE(g,a,n.dataBindAes,"dotShape");Object.keys(C).length?s.nodeShape.valuesMap=C:s.nodeShape=q2}else typeof o.dotShape=="string"&&(s.nodeShape=o.dotShape);if(s.nodeColor&&typeof s.nodeColor=="object"){const g=(f=i.nodeColor.selectorStates[0])==null?void 0:f.selectedSource,C=LE(g,a,n.dataBindAes,"color");Object.keys(C).length?s.nodeColor.valuesMap=C:s.nodeColor=pi}else typeof o.dotFill=="string"&&(s.nodeColor=o.dotFill);if(s.nodeSize&&typeof s.nodeSize=="object"){const g=(A=i.nodeSize.selectorStates[0])==null?void 0:A.selectedSource;let[C,b]=[1/0,-1/0];t.values[g].forEach(B=>{const E=Number(B);E<C&&(C=E),E>b&&(b=E)}),s.nodeSize.domain=[C,b],s.nodeSize.range=RE(o.dotSize)?[o.dotSize.min,o.dotSize.max]:[em.min,em.max]}else typeof o.dotSize=="number"&&(s.nodeSize=o.dotSize);if(s.lineColor&&typeof s.lineColor=="object"){const g=(h=i.lineColor.selectorStates[0])==null?void 0:h.selectedSource;s.lineColor.valuesMap=LE(g,a,n.dataBindAes,"color")}else typeof o.lineColor=="string"&&(s.lineColor=o.lineColor);if(i.heatmapForSequence.selectorStates.length>0&&(e.heatmapSettings={valueType:"stringSource",aes:{colorsList:Ui.bright.colors}},e.size.maxCellWidth=8),i.heatmapAnnotation.selectorStates.length>0){const g=i.heatmapAnnotation.selectorStates[0].selectedSource,C=r.getSourceInfo(g),b=C.type==="Double"||C.type==="Float"||C.type==="Int"||C.type==="Long"?"continuous":"discrete",B=Ui.bright.colors;let E;const k=(v=a[g])==null?void 0:v.list;k&&(E=k.reduce((P,I,$)=>(P[I]=B[$%B.length],P),{})),e.heatmapSettings={valueType:b,aes:{colorsList:Ui.viridis.colors,colorsMap:E}}}return e.mode=o.mode,e.leavesMode=o.leavesMode,e.showNodesLabels=i.labels.selectorStates.length>0,e.showLeavesLabels=i.labels.selectorStates.length>0,o.showTable&&i.heatmapAnnotation.selectorStates.length===0&&i.heatmapForSequence.selectorStates.length===0&&(e.size.width=rse),e.size.scale=n.chartScale/100,e.legend={show:n.layersSettings.dendro.showLegend??!0},e}function ise(e,t,n){return t.length?{type:"grouping",value:t[0]}:typeof e=="object"?n:e}function ose(e,t,n){const r=t.optionsState.components.grouping;if(r.selectorStates.length){const o=r.selectorStates[0].selectedSource,{inheritedAes:s,order:c}=Ple(o,n,t.dataBindAes);Object.assign(e,{inheritedAes:{[o]:s},groupingOrder:c})}const a=Vle[t.template],i=[];return a.forEach(o=>{if(o==="bins"){const s=t.layersSettings[o];i.push({type:"bins",aes:{opacity:s.opacity,fillColor:ise(s.fillColor,r.selectorStates.map(c=>c.selectedSource),"white")}})}}),e.layers=i,Object.assign(e,t5(t.axesSettings,t.chartType)),e.binsCount=t.axesSettings.other.binsCount,e}const JL=40,lse=JL/2-2,sse=3;function use(e,t){var i;const n=t.template,r=t.layersSettings[n],a=(i=t.dataBindAes[e.valueColor.value])==null?void 0:i.palette;return e.aes={cellStrokeColor:r.strokeColor??pi,colorsList:Ui[a??ov].colors,maxRadius:lse*(t.chartScale/100),minRadius:sse},e.size={cellSize:JL*(t.chartScale/100)},Object.assign(e,t5(t.axesSettings,t.chartType)),e.NAValueAs=r.NAValueAs,r.normalizationDirection&&(e.normalization={method:r.normalizationMethod,direction:r.normalizationDirection}),e}function cse(e,t=0){return{width:(t>0?jle:FL)*(e/100),height:(t>0?Ule:QL)*(e/100)}}function fse(e,t,n,r){var a,i;if(e!=="scatterplot"&&e!=="scatterplot-umap"&&e!=="discrete"&&e!=="heatmap"&&e!=="histogram"&&e!=="bubble")return{name:"",show:!1};if(r.title.mode==="hidden")return{name:"",show:!1};if(r.title.mode==="custom")return{name:r.title.value,show:!0,position:r.title.position};if(r.title.mode==="auto"){const o=[];return[...((a=t.components)==null?void 0:a.filters.selectorStates)??[],...((i=t.components)==null?void 0:i.tabBy.selectorStates)??[]].forEach(({type:f,selectedSource:A,selectedFilterValue:h})=>{if((!f||f==="equals")&&h){const v=n[A];o.push((v==null?void 0:v.labels[h])??String(h))}}),{name:o.join(", "),show:!0,position:r.title.position}}return{name:"",show:!1}}async function dse(e,t,n,r){if(!e.ready||n===null)return null;try{const a=yw(t.chartType),i=await KL(t.optionsState,n,r);return a.createDataForPlot(n,i)}catch(a){return console.warn("Cant build chart data"),console.warn(a.message),null}}function Ase(e,t,n,r){var o;if(!t.ready||e===null)return null;let a=e.settings;const i=e.data.byColumns;return a.title=fse(r.chartType,r.optionsState,n,r.axesSettings),a.size=cse(r.chartScale,((o=r.optionsState.components)==null?void 0:o.facetBy.selectorStates.length)||0),r.chartType==="discrete"&&(a=Zle(a,r,n,t)),r.chartType==="scatterplot"&&(a=Jle(a,i,r,t,n)),r.chartType==="scatterplot-umap"&&(a=tse(a,i,r,t,n)),r.chartType==="heatmap"&&(a=nse(a,r)),r.chartType==="dendro"&&(a=ase(a,i,r,t,n)),r.chartType==="histogram"&&(a=ose(a,r,n)),r.chartType==="bubble"&&(a=use(a,r)),{settings:a,data:e.data.byColumns}}function qL(e){return e.length<2?[]:e.map(t=>({value:String(t),text:String(t)}))}function eR(e){return e.length<2?[]:e.length>2?Ow.filter(t=>t.value!=="ttest"&&t.value!=="wilcoxon"):Ow}function NE(e){return async()=>{const t=e.value.commonHelpersData.primaryGroups.value;function n(c,f){return f===null||!!c.find(A=>A.value===f)}if(e.value.reactive.chartType!=="discrete")return;const r=e.value.reactive.statisticsSettings,a=eR(t),i=qL(t),o=r.overall.data.testMethod,s=r.referenceGroup.data.referenceGroup;r.overall.validity.testMethod=n(a,o),r.referenceGroup.validity.referenceGroup=n(i,s)}}function hse(e){e.dispatchEvent(new MouseEvent("click"))}function pse(e,t){const n=window.URL||window.webkitURL,r=document.createElement("a");r.download=t,r.rel="noopener",r.href=n.createObjectURL(e),setTimeout(function(){n.revokeObjectURL(r.href)},4e4),setTimeout(function(){hse(r)},0)}function sy(e,t,n){return e.some(r=>{var i;const a=(i=r==null?void 0:r.aes)==null?void 0:i[t];return e5(a)&&a.type===n})}function tR(e,t,n,r,a,i){var c,f,A;const o={};let s=[];if(e==="discrete"){s=["primaryGrouping","secondaryGrouping"];const h=UL(qg[t],n,r,a,i);s.forEach(v=>{var C,b;const g=(b=(C=a.components[v])==null?void 0:C.selectorStates[0])==null?void 0:b.selectedSource;g&&(o[g]={fill:sy(h,"fillColor",v)||sy(h,"dotFill",v),stroke:sy(h,"lineColor",v),dotShape:sy(h,"dotShape",v),lineType:sy(h,"lineShape",v),size:!1})})}if(e==="scatterplot"){const h=a.components.grouping.selectorStates.map(g=>g.selectedSource),v=a.components.shape.selectorStates.map(g=>g.selectedSource);s=[...h,...v],s.forEach(g=>{o[g]={fill:g===h[0],stroke:!1,dotShape:g===v[0],lineType:!1,size:!1}})}if(e==="scatterplot-umap"&&(s=a.components.grouping.selectorStates.map(h=>h.selectedSource),s.forEach(h=>{o[h]={fill:h===s[0],stroke:!1,dotShape:!1,lineType:!1,size:!1}})),e==="dendro"&&(s=[((c=a.components.nodeColor.selectorStates[0])==null?void 0:c.selectedSource)??null,((f=a.components.nodeShape.selectorStates[0])==null?void 0:f.selectedSource)??null,((A=a.components.lineColor.selectorStates[0])==null?void 0:A.selectedSource)??null].filter(v=>v!==null),s.forEach(v=>{o[v]={fill:e5(n.dendro.dotFill)&&n.dendro.dotFill.value===v,stroke:e5(n.dendro.lineColor)&&n.dendro.lineColor.value===v,dotShape:e5(n.dendro.dotShape)&&n.dendro.dotShape.value===v,lineType:!1,size:!1}})),e==="histogram"){const h=a.components.grouping.selectorStates.map(v=>v.selectedSource);h.forEach(v=>{o[v]={fill:v===h[0],stroke:!1,dotShape:!1,lineType:!1,size:!1}})}return o}var vse=Object.defineProperty,mse=(e,t,n)=>t in e?vse(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zE=(e,t,n)=>mse(e,typeof t!="symbol"?t+"":t,n);function gse(e,t){if(e==null)throw Error(t??"Empty (null | undefined) value");return e}function yse(e,t){if(e===void 0)throw Error(t??"Undefined value");return e}function wse(e=void 0){return e}function bse(e){return e}function Cse(e){return[...new Set(e)]}function Sse(e,t){if(e==null)throw Error(t??"Empty (null | undefined) value")}function xse(e,t){if(e===void 0)throw Error(t??"Undefined value")}function Ese(e,t,n){const r=Math.min(t,n),a=Math.max(t,n);return e>=r&&e<=a}function Bse(e){return e.map(t=>({text:String(t),value:t}))}function _se(e){return function(...t){const n=e(...t);async function r(a){return a.done?Promise.resolve(a.value):Promise.resolve(a.value).then(i=>r(n.next(i))).catch(i=>r(n.throw(i)))}try{return r(n.next())}catch(a){return Promise.reject(a instanceof Error?a:Error(String(a)))}}}class Tse{constructor(){zE(this,"promise"),zE(this,"resolve",()=>{}),zE(this,"reject",()=>{}),this.promise=new Promise((t,n)=>{this.resolve=t,this.reject=n})}}function OE(e){return new Promise(t=>setTimeout(t,e))}function kse(){return new Promise(e=>queueMicrotask(e))}function Mse(){const e=new Date().getTime();return function(){return new Date().getTime()-e}}function Pse(){const e=performance.now();return function(){return performance.now()-e}}function Hse(e){return e()}function Dse(e,t,n){return t>e?t:e>n?n:e}function $se(e,t){return t(e)}function Ise(e,t){if(e!=null)return t(e)}function Lse(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e))+e}function*nR(e,t,n=1){for(let r=e;r<t;r+=n)yield r}function rR(e){const t=[];for(const n of e)t.push(n);return t}function Rse(e,t){return rR(nR(0,e)).map(t)}let Vse=class{constructor(t){this._delay=t}async*generate(){let t=0;for(;;)await OE(this._delay),yield t++}async*[Symbol.asyncIterator](){let t=0;for(;;)await OE(this._delay),yield t++}};function Nse(e,t){return Array.from({length:e},(n,r)=>t(r))}function zse(e,t){throw Error(t)}function Ose(e){return t=>e[t]()}function Fse(e){if(e&&e.ok)return e.value}function Qse(e){if(e&&!e.ok)return e.error}function jse(e){if(e.ok)return e.value;throw Error(e.error)}function Use(e){return Array.isArray(e)?e:[e]}async function Gse(e){return Object.fromEntries(await Promise.all(Object.entries(e).map(async([t,n])=>[t,await n])))}function Yse(e,t){return Object.keys(t).every(n=>e[n]===t[n])}const Wse=e=>e;function Xse(e){return e}function Kse(e){return Object.entries(e).map(([t,n])=>({key:t,value:n}))}const uy=Object.freeze(Object.defineProperty({__proto__:null,Deferred:Tse,Interval:Vse,alike:Yse,arrayFrom:Nse,asConst:Xse,async:_se,between:Ese,bool:bse,call:Hse,checkIfDefined:xse,checkIfNotEmpty:Sse,clamp:Dse,delay:OE,errorOptional:Qse,exhaustive:zse,flatValue:Use,identity:Wse,listToOptions:Bse,match:Ose,notEmpty:gse,notUndef:yse,okOptional:Fse,performanceTimer:Pse,randomInt:Lse,range:nR,resolveAwaited:Gse,tap:$se,tapIf:Ise,tear:kse,timer:Mse,times:Rse,toList:rR,undef:wse,unionize:Kse,uniqueValues:Cse,unwrap:jse},Symbol.toStringTag,{value:"Module"})),cy=Array.isArray;function Fw(e){return e!==null&&typeof e=="object"}function n5(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null}function Zse(e,t){return Object.keys(e).map(n=>t(e[n],n))}function aR(e){return Object.values(e).reduce((t,n)=>n!==void 0?t+1:t,0)}function Qw(e,t){if(!(Fw(e)&&Fw(t)))return e===t;if(cy(e)&&cy(t))return e.length!==t.length?!1:[...e.keys()].every(n=>Qw(e[n],t[n]));if(n5(e)&&n5(t))return aR(e)!==aR(t)?!1:Object.keys(e).every(n=>Qw(e[n],t[n]));throw Error(`Cannot compare a ${String(e)} and b ${String(t)}`)}const Jse=Qw;function jw(e){if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++)t[n]=jw(e[n]);return t}else if(n5(e)){const t={};return Object.keys(e).forEach(n=>{t[n]=jw(e[n])}),t}else return e}function qse(e){return Array.isArray(e)?Object.assign([],e):Fw(e)?Object.assign({},e):e}function eue(e,t){const n={};for(const r in t)t[r]!==e[r]&&(n[r]=e[r]);return n}function tue(e){return Object.entries(e).forEach(([t,n])=>{n instanceof Function&&(e[t]=n.bind(e))}),e}function nue(e,t,n){return e[t]=n,e}function rue(e,t){return e[t]}function aue(e,t){e={...e};const n=e[t];return delete e[t],[n,e]}function iue(e,...t){return Object.assign({},...t.map(n=>({[n]:e[n]})))}function oue(e,...t){return t.map(n=>e[n])}function lue(e,...t){const n=Object.assign({},e);return t.forEach(r=>delete n[r]),n}function iR(e,t){return new Set([...Object.keys(e),...Object.keys(t)]).forEach(n=>{const r=e[n],a=t[n];n5(r)&&n5(a)||cy(r)&&cy(a)&&r.length===a.length?iR(r,a):e[n]=a}),e}const sue=Object.freeze(Object.defineProperty({__proto__:null,bindMethods:tue,deepClone:jw,deepEqual:Jse,deepPatch:iR,getProp:rue,isArray:cy,isJsonEqual:Qw,isNonPrimitive:Fw,isPlainObject:n5,map:Zse,omit:lue,pick:iue,pickValues:oue,setProp:nue,shallowClone:qse,shallowDiff:eue,shiftProp:aue},Symbol.toStringTag,{value:"Module"})),uue=["primaryGrouping","secondaryGrouping","grouping","shape","nodeColor","nodeShape","lineColor","heatmapAnnotation","filters","highlight","tabBy"];function cue(e,t){const n=R0(mI(e));if((t==null?void 0:t.type)!==e)return n;const r=R0(t);return{...n,...r,components:{...n.components,...r.components}}}function FE(e,t){return d.reactive({chartType:t,optionsState:cue(t,e.optionsState),dataStateKey:jw(e.dataStateKey),template:Lle(e.template,t),statisticsSettings:Nle(t,e.statisticsSettings),layersSettings:Ole(e.layersSettings),axesSettings:Qle(t,e.axesSettings),dataBindAes:R0(e.dataBindAes??{}),chartScale:e.zoomState??100,lassoMode:!1,currentTab:e.currentTab===void 0?"dataMapping":e.currentTab,dendroInfoByClick:null,dendroSelectedNodeId:null,showTooltipHint:!1})}function fue(e,t,n,r,a,i,o){return{reactive:e,loading:d.reactive({initialInputGuide:!0,initialCharts:!0,initialDefaults:!0,inputGuide:!1,chartData:!1,dendroTableData:!1}),commonHelpersData:{primaryGroups:d.computed(()=>jL(e.optionsState,i.value,"primaryGrouping")),secondaryGroups:d.computed(()=>jL(e.optionsState,i.value,"secondaryGrouping")),usedAesInMapping:d.computed(()=>tR(e.chartType,e.template,e.layersSettings,e.statisticsSettings,e.optionsState,n.value)),dendroTableData:a},controller:yw(e.chartType),columnsDataStore:t,inputGuide:n,chartData:r,uniqueValuesData:i,readonlyInputs:o}}function due(e,t,n,r,a,i,o){const s=FE(e,n),c=yw(s.chartType),f=d.ref(yw(s.chartType).getEmptyInputGuide(s.optionsState)),A=d.ref(null),h=d.ref({}),v=d.ref(null),g=d.computed(()=>fue(s,d.toRaw(t.value),f,A,v,h,o));d.watch([()=>t.value,()=>r.value],async([B,E])=>{if(!E||!B||!g.value.loading.initialDefaults)return;g.value.loading.initialDefaults=!1,g.value.loading.initialInputGuide=!0;const k=R0(s.optionsState.components),P=E.filter($=>{var z;return((z=s.optionsState.components[$.inputName])==null?void 0:z.selectorStates.length)===0||(o==null?void 0:o.includes($.inputName))});if(P.length===0)return;P.forEach($=>{k[$.inputName].selectorStates=[]});const I=await VE(B,P);for(const{inputName:$,selectedSource:z,filterType:O,selectedFilterValue:K,selectedFilterRange:te,fixedAxes:le}of I)k[$].selectorStates.push({selectedSource:z,type:O,selectedFilterValue:K,selectedFilterRange:te,fixedAxes:le});s.optionsState.components={...s.optionsState.components,...k}},{immediate:!0});const C=d.ref(0);d.watch([()=>s.optionsState,()=>t.value,()=>a.value],async([B,E,k])=>{C.value++;const P=C.value;g.value.loading.inputGuide=!0;const I=E&&k?(await VE(E,k,!1)).map(K=>K.selectedSource):[],$=E?await c.calculateOptions(d.toRaw(E),B,I,i):c.getEmptyInputGuide(B),z=[];uue.forEach(K=>{const te=s.optionsState.components[K];if(te)for(const{selectedSource:le}of te.selectorStates){const G=$.getSourceInfo(le);K==="filters"||K==="highlight"?(G.type==="String"||G.type==="Int"||G.type==="Long")&&z.push(le):K==="grouping"?G.type==="String"&&z.push(le):z.push(le)}}),[...$.freeOptionsSet].forEach(K=>{var le,G,Q;const te=$.getSourceInfo(K);te.kind==="axis"&&((le=te.annotations)!=null&&le[zw])&&((G=te.annotations)==null?void 0:G[zw])!=="homogeneous"&&((Q=te.annotations)==null?void 0:Q[zw])!=="homogenous"&&z.push(K)}),[...$.axesToBeFixedSet].forEach(K=>{z.push(K)});const O={};for(const K of z)if(E&&!h.value[K]){const te=await c.getUniqueSourceValuesWithLabels(E,$,K);if(!te.length)continue;te.sort((le,G)=>le.label.localeCompare(G.label,"en",{numeric:!0})),O[K]={list:te.map(le=>le.value),options:te,labels:te.reduce((le,G)=>(le[G.value]=G.label,le),{})}}h.value={...h.value,...O},P===C.value&&(f.value=$,g.value.loading.inputGuide=!1,g.value.loading.initialInputGuide=!1)},{immediate:!0,deep:!0});const b=d.ref(0);if(d.watch(()=>f.value,async B=>{b.value++;const E=b.value;g.value.loading.chartData=!0;const k=await dse(B,s,d.toRaw(t.value),a.value);E===b.value&&(A.value=k,B.ready&&(g.value.loading.initialCharts=!1),g.value.loading.chartData=!1)},{immediate:!0,deep:!0}),s.chartType==="dendro"){const B=d.ref(0);d.watch([()=>s.optionsState,()=>t.value,()=>f.value.readyData,()=>a.value],async([E,k,P,I])=>{if(P&&k){B.value++;const $=B.value;g.value.loading.dendroTableData=!0;const z=await KL(E,k,I),O=await c.createTableData(k,z);B.value===$&&(v.value=O),g.value.loading.dendroTableData=!1}},{immediate:!0})}return d.provide(j$,g),g}function Tr(){return vte(d.inject(j$),"Empty store")}const Aue={class:"template-list"},hue=["onClick"],pue=["onClick"],vue=["onClick"],mue=["onClick"],gue=d.defineComponent({__name:"TemplateForm",setup(e){const t=Tr(),n=Object.entries(qg).map(([A,h])=>({id:A,text:h.map(v=>LA[v]).join(" + "),icon:_f[A]})),r=Object.entries(rm).map(([A,h])=>({id:A,text:h.map(v=>LA[v]).join(" + "),icon:_f[A]})),a=Object.entries(VL).map(([A,h])=>({id:A,text:h.map(v=>LA[v]).join(" + "),icon:_f[A]})),i=[{id:"heatmap",text:"Heatmap",icon:_f.heatmap},{id:"heatmapClustered",text:"Heatmap + Dendro",icon:_f.heatmapClustered}],o=[{id:"dendro",text:"Dendrogram",icon:_f.dendro}],s=[{id:"bins",text:"Histogram",icon:_f.bar}],c=[{id:"bubble",text:"Bubble plot",icon:_f.bubble}];function f(A){t.value.reactive.template=A}return(A,h)=>(d.openBlock(),d.createElementBlock("div",{class:"template-form",onClick:h[0]||(h[0]=v=>v.stopPropagation())},[h[8]||(h[8]=d.createElementVNode("div",{class:"template-title"},[d.createElementVNode("h3",null," Template ")],-1)),d.createElementVNode("div",Aue,[d.unref(t).reactive.chartType==="discrete"?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(n),({id:v,text:g,icon:C})=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["template-item",{selected:d.unref(t).reactive.template===v}]),onClick:b=>f(v)},[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(C))),d.createTextVNode(" "+d.toDisplayString(g)+" ",1),h[1]||(h[1]=d.createElementVNode("div",{class:"checkmark"},null,-1))],10,hue))),256)):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="scatterplot"?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:1},d.renderList(d.unref(r),({id:v,text:g,icon:C})=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["template-item",{selected:d.unref(t).reactive.template===v}]),onClick:b=>f(v)},[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(C))),d.createTextVNode(" "+d.toDisplayString(g)+" ",1),h[2]||(h[2]=d.createElementVNode("div",{class:"checkmark"},null,-1))],10,pue))),256)):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="scatterplot-umap"?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:2},d.renderList(d.unref(a),({id:v,text:g,icon:C})=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["template-item",{selected:d.unref(t).reactive.template===v}]),onClick:b=>f(v)},[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(C))),d.createTextVNode(" "+d.toDisplayString(g)+" ",1),h[3]||(h[3]=d.createElementVNode("div",{class:"checkmark"},null,-1))],10,vue))),256)):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="heatmap"?(d.openBlock(),d.createElementBlock(d.Fragment,{key:3},d.renderList(i,({id:v,text:g,icon:C})=>d.createElementVNode("div",{class:d.normalizeClass(["template-item",{selected:d.unref(t).reactive.template===v}]),onClick:b=>f(v)},[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(C))),d.createTextVNode(" "+d.toDisplayString(g)+" ",1),h[4]||(h[4]=d.createElementVNode("div",{class:"checkmark"},null,-1))],10,mue)),64)):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="dendro"?(d.openBlock(),d.createElementBlock(d.Fragment,{key:4},d.renderList(o,({text:v,icon:g})=>d.createElementVNode("div",{class:d.normalizeClass(["template-item",{selected:!0}])},[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(g))),d.createTextVNode(" "+d.toDisplayString(v)+" ",1),h[5]||(h[5]=d.createElementVNode("div",{class:"checkmark"},null,-1))])),64)):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="histogram"?(d.openBlock(),d.createElementBlock(d.Fragment,{key:5},d.renderList(s,({text:v,icon:g})=>d.createElementVNode("div",{class:d.normalizeClass(["template-item",{selected:!0}])},[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(g))),d.createTextVNode(" "+d.toDisplayString(v)+" ",1),h[6]||(h[6]=d.createElementVNode("div",{class:"checkmark"},null,-1))])),64)):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="bubble"?(d.openBlock(),d.createElementBlock(d.Fragment,{key:6},d.renderList(c,({text:v,icon:g})=>d.createElementVNode("div",{class:d.normalizeClass(["template-item",{selected:!0}])},[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(g))),d.createTextVNode(" "+d.toDisplayString(v)+" ",1),h[7]||(h[7]=d.createElementVNode("div",{class:"checkmark"},null,-1))])),64)):d.createCommentVNode("",!0)])]))}});function oR(e,t,n,r,a){return d.computed({get(){return e.value.components[t].selectorStates.map(i=>i.selectedSource)},set(i){if(!r)return;const o=i.map(s=>{const c=e.value.components[t].selectorStates.find(f=>f.selectedSource===s);if(c)return c;{const f=a.value.getSourceInfo(s),A=f.kind==="column"?f.axesToBeFixed.map(h=>{var C,b;const v=a.value.axesToBeFixedSet.has(h);let g;if(v)for(const{selectorStates:B}of Object.values(e.value.components)){for(const E of B){const k=(b=(C=E.fixedAxes)==null?void 0:C.find(P=>P.axisSource===h&&P.axisValue!==void 0))==null?void 0:b.axisValue;if(k){g=k;break}}if(g)break}return{axisSource:h,axisIdx:f.axesToBeFixedIndexes[h],axisValue:g}}):[];return f.isSubsetFilter?{selectedSource:s,type:"subset",fixedAxes:A}:f.isDiscreteFilter?{selectedSource:s,type:"equals",selectedFilterValue:void 0,fixedAxes:A}:{selectedSource:s,type:"range",selectedFilterRange:{min:void 0,max:void 0},fixedAxes:A}}});e.value=n.changeSelected(t,r,e.value,o)}})}function lR(e,t,n,r,a){return d.computed({get(){return e.value.components[t].selectorStates.map(i=>i.selectedSource)},set(i){if(!r)return;const o=i.map(s=>{const c=e.value.components[t].selectorStates.find(f=>f.selectedSource===s);if(c)return c;{const f=a.value.getSourceInfo(s),A=f.kind==="column"?f.axesToBeFixed.map(h=>{var C,b;const v=a.value.axesToBeFixedSet.has(h);let g;if(v)for(const{selectorStates:B}of Object.values(e.value.components)){for(const E of B){const k=(b=(C=E.fixedAxes)==null?void 0:C.find(P=>P.axisSource===h&&P.axisValue!==void 0))==null?void 0:b.axisValue;if(k){g=k;break}}if(g)break}return{axisSource:h,axisIdx:f.axesToBeFixedIndexes[h],axisValue:g}}):[];return{selectedSource:s,fixedAxes:A}}});e.value=n.changeSelected(t,r,e.value,o)}})}function sR(e,t,n,r){return d.computed({get(){var a;return((a=e.value.components[t].selectorStates.map(i=>i.selectedSource))==null?void 0:a[0])??void 0},set(a){r&&(e.value=n.changeSelected(t,r,e.value,typeof a>"u"?[]:[{selectedSource:a}]))}})}function yue(e,t,n){const r=e.options.map(i=>({text:t(i.value).label,value:i.value}));return n.selectorStates.map(i=>i.selectedSource).forEach(i=>{const o=t(i),s=e.stateConsistency[i]===!1;r.unshift({text:s?"Inconsistent value":o.label,value:i})}),r.sort((i,o)=>i.text>o.text?1:-1)}function uR(e,t){return Object.keys(e.components).reduce((n,r)=>(n[r]=yue(t.value.components[r],t.value.getSourceInfo,e.components[r]),n),{})}function QE(e,t){if(!e.value.readyData)return[];const n=new Set;return t.forEach(r=>{e.value.components[r].options.forEach(({value:i})=>{n.add(i)})}),[...n].map(r=>({id:r,info:e.value.getSourceInfo(r)})).sort((r,a)=>r.info.label.localeCompare(a.info.label))}function wue(e,t){return QE(e,t).filter(({info:n})=>n.kind!=="axis"||!n.mustBeConsumed)}function bue(e,t){return QE(e,t).filter(({info:n})=>n.kind==="axis"&&n.mustBeConsumed)}function cR(e,t){return Object.values(t.components[e].stateConsistency).some(n=>!n)}function r5(e,t){return cR(e,t)?" ":""}function Cue(e){var n;const t=(n=e==null?void 0:e[zw])==null?void 0:n.toLowerCase();return!!t&&t!=="homogenous"&&t!=="homogeneous"}function fR(e,t,n){return n.reduce((r,a)=>{var A;const i=e.getSourceInfo(a),s=[...Object.keys(e.components).filter(h=>e.components[h].options.find(v=>v.value===a))],c=Object.values(e.components).some(({stateConsistency:h})=>h[a]===!1),f=(((A=t[a])==null?void 0:A.options)??[]).sort((h,v)=>h.label>v.label?1:-1).map(h=>h.label);return r[a]={id:a,title:c?"Inconsistent value":i.label,type:i.type,nonHomogenous:i.kind==="axis"&&Cue(i.annotations),isSubsetFilter:i.isSubsetFilter,isDiscreteFilter:i.isDiscreteFilter,availableBasketIds:new Set(s),uniqueValues:f,axesToBeFixed:i.kind==="column"?i.axesToBeFixed:[],axesToBeFixedInfo:i.kind==="column"?i.axesToBeFixed.reduce((h,v)=>{const g=e.getSourceInfo(v);return h[v]={title:g.label,type:g.type,idx:i.axesToBeFixedIndexes[v]},h},{}):{}},r},{})}const jE=`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
28
28
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.00011 2.93933L8.00011 6.93933L12.0001 2.93933L13.0608 3.99999L9.06077 7.99999L13.0608 12L12.0001 13.0607L8.00011 9.06065L4.00011 13.0607L2.93945 12L6.93945 7.99999L2.93945 3.99999L4.00011 2.93933Z" fill="#110529"/>
|
|
29
29
|
</svg>`;function dR(e,t){if(e==null)throw Error(t??"Empty (null | undefined) value");return e}function Sue(e,t){if(e!=null)return t(e)}function xue(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e))+e}function Eue(e){let t="";for(let n=0;n<e;n++)t+=String.fromCharCode(xue(65,91));return t}function Bue(e=42){return Eue(e)}function _ue(e){return typeof e=="object"&&e!==null}function Tue(e,t,n){let r;return function(...a){r&&clearTimeout(r),r=setTimeout(()=>{r=void 0,e.apply(this,a)},t)}}function kue(e){let t=0n,n;return async function(...r){const a=++t;try{await n}catch{}if(t!==a)return{ok:!1};const i=e(...r);return n=i,{ok:!0,value:await i}}}function Mue(e,t){try{return e()}catch(n){return t==null?void 0:t(n)}}function Pue(e){return e instanceof Error?!0:_ue(e)&&"message"in e&&typeof e.message=="string"}const a5=(e,t)=>{const n=e.__vccOpts||e;for(const[r,a]of t)n[r]=a;return n};function Uw(e,t,n,r){d.onMounted(()=>{var a;return(a=d.unref(e))==null?void 0:a.addEventListener(t,n,r)}),d.onUnmounted(()=>{var a;return(a=d.unref(e))==null?void 0:a.removeEventListener(t,n,r)})}function*Hue(e,t){for(const n of e)yield t(n)}function Due(e){const t=[];for(const n of e)t.push(n);return t}const UE=new Map;function $ue(e){return UE.has(e)||UE.set(e,d.ref(localStorage.getItem(e))),dR(UE.get(e),"...")}function Iue(e,t){t==null?localStorage.removeItem(e):localStorage.setItem(e,t)}function Lue(e){const t=$ue(e);return d.watch(t,n=>Iue(e,n)),t}const Rue=new Set;window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",e=>{Due(Hue(Rue.values(),t=>t(e.matches?"dark":"light")))});const Vue=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";d.ref(Vue),Lue("theme");const Nue=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
30
30
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M19.5 4.5H4.5L4.5 19.5H19.5V4.5ZM4.5 3C3.67157 3 3 3.67157 3 4.5V19.5C3 20.3284 3.67157 21 4.5 21H19.5C20.3284 21 21 20.3284 21 19.5V4.5C21 3.67157 20.3284 3 19.5 3H4.5Z" fill="#110529"/>
|
|
@@ -15123,7 +15123,7 @@ void main() {
|
|
|
15123
15123
|
H ${Jl}
|
|
15124
15124
|
L 0,0 z`}function m4t(e,t,n,r,a){switch(n){case"left":return A4t(e,t,a);case"right":return h4t(e,t,a);case"top":return p4t(e,t,r);case"bottom":return v4t(e,t,r);default:d1(n,"Unknown tooltip direction")}}function g4t(e,t,n,r,a,i,o){return o?i.right-n-a-Jl>e?"right":"left":i.top+r-a-Jl>t?"top":"bottom"}function y4t(e,t,n,r,a,i){return e==="left"||e==="right"?`translate(${e==="left"?-(r+Jl+t):r+Jl},${-n/2+i})`:`translate(${-t/2+a},${e==="top"?-(n+r+Jl):r+Jl})`}function w4t(e,t){return e==="left"||e==="right"?`translate(${e==="left"?-t:t},0)`:`translate(0,${e==="top"?-t:t})`}function b4t(e,t,n,r){if(e==="left"||e==="right")return 0;let a=t.right-n,i=t.left+n;return a<r/2?a-r/2:i<r/2?r/2-i:0}function C4t(e,t,n,r){if(e==="top"||e==="bottom")return 0;let a=t.top+n,i=t.bottom-n;return a<r/2?r/2-a:i<r/2?i-r/2:0}function h3(e=()=>{}){let[t,n]=tn.useState(null),[r,a]=tn.useState(!1),i=tn.useRef(!1),o=tn.useRef(!1),s=tn.useRef("null"),c=tn.useRef(null),f=()=>{n(null),i.current=!1,c.current&&(clearTimeout(c.current),c.current=null),e(!1)},A=()=>{o.current=!1,a(!1),f()},h=tn.useCallback((C,b)=>{o.current||(n(C),i.current=!0,s.current=b??"null",c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{e(!0)},2e3))},[]),v=tn.useCallback(()=>{o.current||f()},[]),g=tn.useCallback(A,[]);return tn.useEffect(()=>{function C(B){i.current&&B.key==="Enter"&&(o.current=!0,a(!0),c.current&&(clearTimeout(c.current),c.current=null),e(!1))}function b(B){if(!o.current)return;let E=document.querySelector(`.${cK}`),k=B.target;E&&k&&E.contains(k)||A()}return document.addEventListener("keydown",C),document.addEventListener("click",b),()=>{document.removeEventListener("keydown",C),document.removeEventListener("click",b)}},[]),{active:t!==null,currentFacet:s.current,fixed:r,selectedData:t,onMouseOver:h,onMouseLeave:v,onClose:g}}function fu({content:e,x:t,y:n,active:r,fixed:a,container:i,sideDistances:o,onClose:s=()=>{},offset:c=u4t,horizontal:f=!0}){if(!r||!i&&i!==null)return null;let A=d4t(e,a),h=f4t(e),v=g4t(A,h,t,n,c,o,f),g=b4t(v,o,t,A),C=C4t(v,o,n,h),b=`translate(${A-_M-JC},${ZC})`,B=`translate(${A-_M*2-lK-JC},${ZC})`,[E,k]=tn.useState(!1),[P,I]=tn.useState(!1),[$,z]=tn.useState(!1);function O(){var te;(te=window==null?void 0:window.navigator)==null||te.clipboard.writeText(e.join(`
|
|
15125
15125
|
`)),k(!0)}let K=ie.jsxs("g",{className:cK,transform:`translate(${o.left+t},${o.top+n})`,opacity:r?1:0,stroke:"none",fill:"none",style:{pointerEvents:a?"all":"none"},children:[ie.jsx("path",{transform:w4t(v,c),d:m4t(A,h,v,g,C),fill:Vt}),ie.jsxs("g",{fontSize:"14px",fontFamily:"Manrope",fill:"white",transform:y4t(v,A,h,c,g,C),children:[e.map((te,le)=>ie.jsx("text",{x:JC,y:ZC+BM*le+BM/2,dominantBaseline:"central",children:te},le)),a&&ie.jsxs("g",{transform:b,children:[ie.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.0006 2.93945L8.0006 6.93945L12.0006 2.93945L13.0613 4.00011L9.06126 8.00011L13.0613 12.0001L12.0006 13.0608L8.0006 9.06077L4.0006 13.0608L2.93994 12.0001L6.93994 8.00011L2.93994 4.00011L4.0006 2.93945Z",fill:P?sK:uK}),ie.jsx("rect",{x:"-8",y:"-8",width:"24",height:"24",fill:"transparent",onClick:s,onMouseOver:()=>I(!0),onMouseLeave:()=>I(!1),style:{cursor:"pointer"}})]}),a&&ie.jsxs("g",{transform:B,children:[E?ie.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.0601 4.43439L6.33313 12.5477L1.93945 7.93439L3.02566 6.8999L6.33313 10.3727L12.9739 3.3999L14.0601 4.43439Z",fill:"#07AD3E"}):ie.jsxs("g",{children:[ie.jsx("g",{clipPath:"url(#clip0_16418_6183)",children:ie.jsx("path",{d:"M16.0005 13H14.5005V1.5H3.00049V0H14.5005C15.3289 2.86102e-06 16.0005 0.671575 16.0005 1.5V13ZM1.34717 15.9922C0.641178 15.9205 0.0799799 15.3593 0.00830078 14.6533L0.000488281 14.5V4.5C0.000488281 3.72334 0.590765 3.08461 1.34717 3.00781L1.50049 3H11.5005L11.6538 3.00781C12.4102 3.08461 13.0005 3.72334 13.0005 4.5V14.5L12.9927 14.6533C12.921 15.3593 12.3598 15.9205 11.6538 15.9922L11.5005 16H1.50049L1.34717 15.9922ZM11.5005 4.5H1.50049V14.5H11.5005V4.5Z",fill:$?sK:uK})}),ie.jsx("defs",{children:ie.jsx("clipPath",{id:"clip0_16418_6183",children:ie.jsx("rect",{width:"16",height:"16",transform:"translate(0.000488281)",fill:"white"})})})]}),ie.jsx("rect",{x:"-8",y:"-8",width:"24",height:"24",fill:"transparent",onClick:O,onMouseOver:()=>z(!0),onMouseLeave:()=>z(!1),style:{cursor:"pointer"}})]})]})]});return i===null?K:cu.createPortal(K,i)}function S4t(e){if(e===null)return"null";if(typeof e=="number"){let t=Math.floor(e),n=e-t;return t+Number(n.toPrecision(2))}return e}function x4t(e,t){return[`X: ${t[e.x]}`,`Node: ${e.y}`,`Value: ${S4t(e.value)}`]}function E4t({heatmapData:e,scales:t,step:n,colorScale:r,tooltipsContainer:a,chartSizes:i,selectedNode:o,labels:s}){let{xKeys:c,yKeys:f,cells:A,meta:h}=e,[v,g]=tn.useState(null),C={left:i.treeWidth+30+Qu.LEFT,right:i.heatmapWidth+Qu.RIGHT,top:Qu.TOP,bottom:i.heatmapHeight+Qu.BOTTOM};return ie.jsxs("g",{onMouseLeave:()=>g(null),children:[s.length&&ie.jsx("g",{transform:"translate(0,-8)",children:c.map((b,B)=>ie.jsxs("text",{x:t.x(b)+2,fontWeight:"500",children:[ie.jsx("title",{children:h.xLabels[b]}),s[B]]},b))}),c.map(b=>f.map(B=>{var k;let E=(k=A==null?void 0:A[b])==null?void 0:k[B];return ie.jsx("rect",{x:t.x(b),y:t.y(B),width:n.x,height:n.y,stroke:"white",strokeWidth:"1px",fill:E?r(E==null?void 0:E.value):t3t,onMouseOver:()=>{(E==null?void 0:E.value)!==null&&typeof(E==null?void 0:E.value)<"u"?g(E):g(null)},opacity:o&&o.data.rawData[0].id!==(E==null?void 0:E.data.id)?CM:1},E?E.id:`${b}_${B}`)})),s.length&&ie.jsx("line",{x1:"0",x2:i.heatmapWidth,y1:"0",y2:"0",stroke:Vt,strokeWidth:"1px"}),v&&a&&ie.jsx(fu,{content:x4t(v,e.meta.xLabels),x:t.x(v.x)+n.x/2,y:t.y(v.y)+n.y/2,offset:c.length>1?n.x/2:0,active:!0,fixed:!1,sideDistances:C,container:a})]})}function B4t(e,t,n){let{source:r,target:a}=e,i=n==="top";return t==="rectangle"?i?`M ${r.x},${r.y} L ${a.x},${r.y} L${a.x},${a.y}`:`M ${r.y},${r.x} L ${r.y},${a.x} L${a.y},${a.x}`:t==="curve"?D4e(i?M4e:k4e).x(o=>i?o.x:o.y).y(o=>i?o.y:o.x).source(o=>o.target).target(o=>o.source)(e)??"":i?`M ${r.x},${r.y} L${a.x},${a.y}`:`M ${r.y},${r.x} L${a.y},${a.x}`}function fK({links:e,connectionType:t,rootPosition:n,edgeInheritance:r,aesGetters:a,selected:i}){return ie.jsx(ie.Fragment,{children:e.map(o=>{let{source:s,target:c}=o,f=(r==="up"?s:c).data.rawData[0];return ie.jsx("path",{d:B4t(o,t,n),stroke:i?n3t:a.lineColor(f),strokeWidth:i?2:1,fill:"none"},`${o.source.id},${o.target.id}`)})})}function b9(e){return Zr().domain([0,1]).range([e,Vt])(.25)}var qC=1.4;function Yc(e,t=6,n=Vt,r=null){switch(e){case null:return"";case"0":return ie.jsx("path",{d:`M -${t},-${t} l ${t*2},0 l 0,${t*2} l -${t*2},0 l 0,-${t*2}z`,fill:"none",stroke:n});case"1":return ie.jsx("path",{d:`M -${t},0 a ${t},${t} 0 1,0 ${t*2},0 a ${t},${t} 0 1,0 -${t*2},0z`,fill:"none",stroke:n});case"2":return ie.jsx("path",{d:`M0,-${t}L ${2*t*Math.tan(Math.PI/6)},${t}L ${-2*t*Math.tan(Math.PI/6)},${t}z`,fill:"none",stroke:n});case"3":return ie.jsx("path",{d:`M0,-${t}L 0,${t} M -${t},0 L ${t},0`,fill:"none",stroke:n});case"4":return ie.jsx("path",{d:`M-${t},-${t}L ${t},${t} M ${t},-${t} L -${t},${t}`,fill:"none",stroke:n});case"5":{let a=t*qC;return ie.jsx("path",{d:`M0,-${a}L ${a},0 L 0,${a} L -${a},0z`,fill:"none",stroke:n})}case"6":return ie.jsx("path",{d:`M${-2*t*Math.tan(Math.PI/6)},-${t}L ${2*t*Math.tan(Math.PI/6)},-${t}L0,${t}z`,fill:"none",stroke:n});case"7":return ie.jsx("path",{d:`M -${t},-${t} l ${t*2},0 l 0,${t*2} l -${t*2},0 l 0,-${t*2}z M-${t},-${t}L ${t},${t} M ${t},-${t} L -${t},${t}`,fill:"none",stroke:n});case"8":{let a=t*2*Math.cos(Math.PI/4);return ie.jsx("path",{d:`M0,-${a}L 0,${a} M -${a},0 L ${a},0 M-${t},-${t}L ${t},${t} M ${t},-${t} L -${t},${t}`,fill:"none",stroke:n})}case"9":{let a=t*qC;return ie.jsx("path",{d:`M0,-${a}L ${a},0 L 0,${a} L -${a},0z M0,-${a}L 0,${a} M -${a},0 L ${a},0`,fill:"none",stroke:n})}case"10":return ie.jsx("path",{d:`M -${t},0 a ${t},${t} 0 1,0 ${t*2},0 a ${t},${t} 0 1,0 -${t*2},0z M0,-${t}L 0,${t} M -${t},0 L ${t},0`,fill:"none",stroke:n});case"11":{let a=2*t*Math.tan(Math.PI/6);return ie.jsx("path",{d:`M-${a},-${t}L${a},-${t}L0,${-t+2*a}z
|
|
15126
|
-
M-${a},${t}L0,${t-2*a}L${a},${t}z`,fill:"none",stroke:n})}case"12":return ie.jsx("path",{d:`M -${t},-${t} l ${t*2},0 l 0,${t*2} l -${t*2},0 l 0,-${t*2}z M0,-${t}L 0,${t} M -${t},0 L ${t},0`,fill:"none",stroke:n});case"13":return ie.jsx("path",{d:`M -${t},0 a ${t},${t} 0 1,0 ${t*2},0 a ${t},${t} 0 1,0 -${t*2},0z M-${t},-${t}L ${t},${t} M ${t},-${t} L -${t},${t}`,fill:"none",stroke:n});case"14":return ie.jsx("path",{d:`M -${t},-${t} l ${t*2},0 l 0,${t*2} l -${t*2},0 l 0,-${t*2}z M-${t},${t}L0,${-t}L${t},${t}`,fill:"none",stroke:n});case"15":return ie.jsx("path",{d:`M -${t},-${t} l ${t*2},0 l 0,${t*2} l -${t*2},0 l 0,-${t*2}z`,fill:n,stroke:n});case"16":return ie.jsx("path",{d:`M -${t},0 a ${t},${t} 0 1,0 ${t*2},0 a ${t},${t} 0 1,0 -${t*2},0z`,fill:n,stroke:n});case"17":return ie.jsx("path",{d:`M0,-${t}L ${2*t*Math.tan(Math.PI/6)},${t}L ${-2*t*Math.tan(Math.PI/6)},${t}z`,fill:n,stroke:n});case"18":{let a=t*qC;return ie.jsx("path",{d:`M0,-${a}L ${a},0 L 0,${a} L -${a},0z`,fill:n,stroke:n})}case"20":{let a=t*2/3;return ie.jsx("path",{d:`M -${a},0 a ${a},${a} 0 1,0 ${a*2},0 a ${a},${a} 0 1,0 -${a*2},0z`,fill:n,stroke:n})}case"22":return ie.jsx("path",{d:`M -${t},-${t} l ${t*2},0 l 0,${t*2} l -${t*2},0 l 0,-${t*2}z`,fill:n,stroke:r??b9(n)});case"21":return ie.jsx("path",{d:`M -${t},0 a ${t},${t} 0 1,0 ${t*2},0 a ${t},${t} 0 1,0 -${t*2},0z`,fill:n,stroke:r??b9(n)});case"24":return ie.jsx("path",{d:`M0,-${t}L ${2*t*Math.tan(Math.PI/6)},${t}L ${-2*t*Math.tan(Math.PI/6)},${t}z`,fill:n,stroke:r??b9(n)});case"23":{let a=t*qC;return ie.jsx("path",{d:`M0,-${a}L ${a},0 L 0,${a} L -${a},0z`,fill:n,stroke:r??b9(n)})}case"25":return ie.jsx("path",{d:`M${-2*t*Math.tan(Math.PI/6)},-${t}L ${2*t*Math.tan(Math.PI/6)},-${t}L0,${t}z`,fill:n,stroke:r??b9(n)});default:d1(e,`Unknown point shape ${e}`)}}var _4t=12;function dK({nodes:e,rootPosition:t,showLeavesLabels:n,showNodesLabels:r,aesGetters:a,selectedNodeId:i,onClick:o,onSelectedUpdate:s}){let c=t==="top",[f,A]=tn.useState(null);return tn.useEffect(()=>{A(null)},[i]),ie.jsxs(ie.Fragment,{children:[ie.jsx("g",{children:e.map(h=>{let v=h.data.rawData[0],g=a.nodeSize(v),C=a.nodeColor(v),b=c?h.x:h.y,B=c?h.y:h.x;return ie.jsx("g",{transform:`translate(${b},${B})`,style:{cursor:"pointer"},onClick:E=>{E.stopPropagation(),o({x:b+Qu.LEFT,y:B+Qu.TOP,info:h.data.rawData}),s(h)},children:ie.jsx("g",{children:ie.jsx("circle",{cx:0,cy:0,r:g+_4t,fill:i===h.id?KX:f===h.id?C:"transparent",opacity:CM,onMouseOver:()=>A(h.id??null),onMouseLeave:()=>A(null)})})},h.id)})}),ie.jsx("g",{children:e.map(h=>{let v=h.data.rawData[0],g=a.nodeShape(v),C=a.nodeSize(v),b=a.nodeColor(v),B=c?h.x:h.y,E=c?h.y:h.x;return ie.jsx("g",{transform:`translate(${B},${E})`,style:{cursor:"pointer"},onClick:k=>{k.stopPropagation(),o({x:B+Qu.LEFT,y:E+Qu.TOP,info:h.data.rawData}),s(h)},children:ie.jsx("g",{onMouseOver:()=>A(h.id??null),onMouseLeave:()=>A(null),children:Yc(g,C,i===h.id?KX:b)})},h.id)})}),ie.jsx("g",{children:e.map(h=>{let v=h.data.rawData[0],g=a.nodeSize(v),C=c?h.x:h.y,b=c?h.y:h.x;return ie.jsx("g",{transform:`translate(${C},${b})`,style:{pointerEvents:"none"},children:(r&&h.children||n&&!h.children)&&ie.jsx("text",{x:g+4,y:"4",paintOrder:"stroke",stroke:"white",strokeWidth:"3",children:h.data.label})},h.id)})})]})}var AK=14,eS=12,C9=12,tS=-12;function T4t({aes:e,label:t}){let n=Yc(e.shape,e.size,e.color);return ie.jsxs("g",{children:[ie.jsx("g",{transform:`translate(${C9/2},${C9/2})`,children:n}),ie.jsx("text",{x:C9+8,y:C9/2,dominantBaseline:"central",fontWeight:500,children:t})]})}function k4t({legendData:e}){let t=e.items.filter(n=>n.type==="continuous");return ie.jsxs("g",{children:[ie.jsx("defs",{children:t.map(n=>ie.jsx("linearGradient",{id:n.id,gradientTransform:"rotate(90)",children:n.scale.domain().map(r=>{let a=n.scale.domain(),i=a[a.length-1]-a[0],o=i>0?(r-a[0])/i*100:0;return ie.jsx("stop",{offset:`${o}%`,stopColor:n.scale(r)},r)})},n.id))}),e.items.map(n=>{if(n.type==="continuous"){let r=Math.min(...n.values),a=Math.max(...n.values);return ie.jsxs("g",{transform:`translate(${n.left},${n.top})`,children:[ie.jsx("text",{fontWeight:500,fontSize:"14px",y:tS,children:n.title}),ie.jsx("rect",{x:"0",y:"0",width:AK,height:n.height,stroke:Vt,fill:`url(#${n.id})`}),ie.jsx("g",{transform:`translate(${AK},0)`,children:n.values.map(i=>{let o=a-r,s=o>0?n.height*(i-r)/o:0;return ie.jsxs("g",{transform:`translate(0,${s})`,children:[ie.jsx("line",{x1:"0",x2:-4,stroke:Vt}),ie.jsx("text",{x:8,y:4,children:i})]},i)})}),!1]},n.id)}if(n.type==="discrete")return ie.jsxs("g",{transform:`translate(${n.left},${n.top})`,children:[ie.jsx("text",{fontWeight:500,fontSize:"14px",y:tS,children:n.title}),n.values.map((r,a)=>ie.jsxs("g",{transform:`translate(0, ${a*(eS+4)})`,children:[ie.jsx("rect",{x:"0",y:"0",width:eS,height:eS,fill:n.scale(r),rx:"1",ry:"1"}),ie.jsx("text",{x:eS+8,y:10,children:r})]},r)),!1]},n.id);if(n.type==="nodes")return ie.jsxs("g",{transform:`translate(${n.left},${n.top})`,fontSize:"14px",fontWeight:500,children:[ie.jsx("text",{fontWeight:500,y:tS,children:n.title}),n.values.map((r,a)=>ie.jsx("g",{transform:`translate(0, ${a*(C9+4)})`,children:ie.jsx(T4t,{aes:n.scale(r),label:n.labels[r]})},r)),!1]},n.id);if(n.type==="size"){let r=n.height/n.values.length;return ie.jsxs("g",{transform:`translate(${n.left},${n.top})`,fontSize:"14px",fontWeight:500,children:[ie.jsx("text",{fontWeight:500,y:tS,children:n.title}),n.values.map((a,i)=>{let o=n.scale(a);return ie.jsxs("g",{transform:`translate(0, ${i*r})`,children:[ie.jsx("circle",{r:o,cx:r/2,cy:r/2,fill:Vt}),ie.jsx("text",{x:r+4,y:r/2,alignmentBaseline:"central",children:n.labels[a]})]},a)}),!1]},n.id)}})]})}function hK(e){if(!e)return null;let t=new Set,n=e;for(;n;)t.add(n.id),n=n.parent;return t}function M4t({chartSettings:e,chartSizes:t,nodes:n,links:r,connectionType:a,rootPosition:i,edgeInheritance:o,showNodes:s,showEdges:c,showLeavesLabels:f,showNodesLabels:A,aesGetters:h,labels:v,heatmapData:g,heatmapScales:C,heatmapStep:b,heatmapColor:B,heatmapLabels:E,legendData:k,onClick:P}){let I=tn.useRef(null),[$,z]=tn.useState(null),O=tn.useRef(null);tn.useEffect(()=>{O.current&&z(O.current);function X(){te(null),G(null)}function ee(pe){Object.entries(pe.detail).forEach(([ae,ge])=>{if(ae==="selectedNode"){let me=n.find(fe=>fe.data.rawData[0].id===ge)??null;te(hK(me)),G(me)}})}return document.addEventListener("click",X),document.addEventListener(SM,ee),()=>{document.removeEventListener("click",X),document.removeEventListener(SM,ee)}},[]);let[K,te]=T8.useState(null),[le,G]=T8.useState(null),Q=K!==null,j={connectionType:a,rootPosition:i,edgeInheritance:o,aesGetters:h},Y={rootPosition:i,showLeavesLabels:f,showNodesLabels:A,aesGetters:h,labels:v,onClick:P,selectedNodeId:le==null?void 0:le.id,onSelectedUpdate:X=>{te(hK(X)),G(X)}};return ie.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${t.totalWidth} ${t.totalHeight}`,ref:I,width:t.totalWidth,height:t.totalHeight,children:[ie.jsx("defs",{children:Qm}),ie.jsxs("g",{transform:`translate(${Qu.LEFT},${Qu.TOP})`,fontFamily:"Manrope",children:[ie.jsx("text",{x:"0",y:"-12",fontSize:"20",children:e.title.name}),ie.jsxs("g",{opacity:Q?CM:1,children:[c&&ie.jsx(fK,{links:r.filter(X=>{let{source:ee,target:pe}=X;return!K||!(K.has(ee.id??"")&&K.has(pe.id??""))}),selected:!1,...j}),s&&ie.jsx(dK,{nodes:n.filter(X=>!X.data.isFake&&!(K!=null&&K.has(X.id??""))),...Y})]}),Q&&ie.jsxs("g",{children:[c&&ie.jsx(fK,{links:r.filter(X=>{let{source:ee,target:pe}=X;return K.has(ee.id??"")&&K.has(pe.id??"")}),selected:!0,...j}),s&&ie.jsx(dK,{nodes:n.filter(X=>!X.data.isFake&&(K==null?void 0:K.has(X.id??""))),...Y})]}),g!==null&&ie.jsx("g",{transform:`translate(${t.treeWidth+30},0)`,children:ie.jsx(E4t,{heatmapData:g,scales:C,step:b,colorScale:B,chartSizes:t,labels:E,selectedNode:le,tooltipsContainer:$})}),e.legend.show&&ie.jsx("g",{transform:`translate(${t.treeWidth+30+t.heatmapWidth+30},0)`,children:ie.jsx(k4t,{legendData:k})})]}),ie.jsx("g",{ref:O})]})}function Xv({message:e}){return ie.jsx("div",{style:{width:"500px",height:"400px",color:"#ee1616",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"25px",fontFamily:"Arial",border:"1px solid",padding:"20px",lineHeight:"25px"},children:e})}function S9(e){if(JX(e))return t=>e.valuesMap[String(t[e.columnName.value])];if(oh(e)){let{domain:t,range:n}=e,r=cv().domain(t).range(n);return a=>{let i=r(Number(a[e.columnName.value]));return Math.max(1,i)}}return t=>e}function P4t(e){return{nodeShape:S9(e.nodeShape),nodeColor:S9(e.nodeColor),nodeSize:S9(e.nodeSize),lineShape:S9(e.lineShape),lineColor:S9(e.lineColor)}}var H4t=(e,t)=>{let n=Math.min(...t),r=Math.max(...t);if(n===r){let o=e%2===0?[]:[n];for(let s=1;s<e/2+1;s++)o.push(n+s),o.unshift(n-s);return o}if(e<2)return[n,r];let a=(r-n)/(e-1),i=[];for(let o=0;o<e-1;o++)i.push(n+a*o);return i.push(r),i};function D4t(e,t=1,n,r){let a=(e<16?40:e<49?32:24)*t;return Math.max(Math.min(a,r??1/0),n??-1/0)}var $4t=class{constructor(){Be(this,"component",ie.jsx(ie.Fragment,{}));Be(this,"reactRoot",null);Be(this,"parentNode",null);Be(this,"rootNode",null);Be(this,"chartSizes",{treeWidth:600,treeHeight:350,heatmapWidth:0,heatmapHeight:0,totalWidth:1200+Qu.LEFT+Qu.RIGHT,totalHeight:350+Qu.TOP+Qu.BOTTOM,labelsOffset:0});Be(this,"legend",{width:0,height:0,items:[]});Be(this,"heatmapScales",{x:Qo().domain(["null"]).range([1]),y:Qo().domain(["null"]).range([1])});Be(this,"heatmapStep",{x:0,y:0});Be(this,"heatmapColorScale",{scale:Qo([]),getter:()=>"white"});Be(this,"heatmapLabels",[])}clear(){var e;this.parentNode&&this.rootNode&&((e=this.parentNode)==null||e.removeChild(this.rootNode),this.parentNode=null,this.rootNode=null),setTimeout(()=>{var t;(t=this.reactRoot)==null||t.unmount(),this.reactRoot=null})}init(e){this.parentNode===null&&(this.parentNode=e,this.rootNode=document.createElement("div"),this.parentNode.appendChild(this.rootNode),this.reactRoot=Wh(this.rootNode))}updateHeatmapScales(e,t,n){if(e===null){this.chartSizes.heatmapWidth=0;return}let{xKeysByGroups:r,xGroupKeys:a,xKeys:i,yKeys:o}=e,s=5,c=a.map(B=>r[B].length),f=c.reduce((B,E)=>B+E,0),A=this.chartSizes.treeHeight/o.length,h=Math.min(Math.max((400-(c.filter(B=>B>0).length-1)*s)/f,n.minCellWidth),n.maxCellWidth),v=[],g=0;a.forEach(B=>{let E=r[B];E.forEach(()=>{v.push(g),g+=h}),E.length>0&&(g+=s)}),this.heatmapScales.x=Qo().domain(i).range(v),this.heatmapScales.y=Qo().domain(o).range(o.map((B,E)=>E*A)),this.heatmapStep.x=h,this.heatmapStep.y=A;let{colorsList:C,colorsMap:b}=t.aes;if(t.valueType==="continuous"&&C){let B=Zr().domain(H4t(C.length,e.meta.valueExtent)).range(C);this.heatmapColorScale={scale:B,getter:E=>B(E)}}if(t.valueType==="discrete"&&b){let B=Object.keys(b).filter(E=>e.meta.uniqueValues.has(E));this.heatmapColorScale={scale:Qo(B,B.map(E=>b[E])).unknown(v9),getter:E=>E?b[E]??v9:v9}}if(t.valueType==="stringSource"&&C){let B=[...e.meta.uniqueValues],E=Qo(B,B.map((k,P)=>C[P%C.length])).unknown(v9);this.heatmapColorScale={scale:E,getter:k=>k?E(k):v9}}this.chartSizes.heatmapWidth=this.heatmapScales.x(e.xKeys[e.xKeys.length-1])+this.heatmapStep.x}updateLegendSize(e,t,n,r,a,i){if(!e.show){this.legend={width:0,height:0,items:[]};return}let o=new hc("600 14px Arial"),s=16,c=48,f=20,A=24;function h(I,$){return Math.max(...I.map(z=>o.getTextWidth(String(z))+f),o.getTextWidth($))}let v=[];[n.nodeColor,n.nodeShape,n.lineColor].filter(JX).map(I=>I.columnName).forEach(I=>{let $=t[I.value];if($.usedAes.length===0||!$.aesMap)return;let z=I.label??I.value,O=$.values,K={};O.forEach(te=>{K[te]||(K[te]={...Gv}),$.usedAes.forEach(le=>{var G,Q,j;(le==="dotFill"||le==="lineColor")&&(K[te].color=((G=$.aesMap[te])==null?void 0:G[le])??Vt),le==="dotShape"&&(K[te].shape=((Q=$.aesMap[te])==null?void 0:Q[le])??"21"),le==="dotSize"&&(K[te].size=((j=$.aesMap[te])==null?void 0:j[le])??3)})}),v.push({columnKey:z,data:K,values:$.values,labels:$.labels})});let g=[],C=0,b=0,B=0,E=Math.min(this.chartSizes.treeHeight,400);if(r&&a){let I=i.valueType,$=r.label??r.value;if(I==="continuous"){let z=this.heatmapColorScale.scale,O=A3(z,a.meta.valueExtent,4),K={id:"heatmapValue",type:"continuous",width:oK(O,$),height:E,left:0,top:0,title:$,scale:z,values:O,labels:{}};g.push(K),b=K.height+c,C=K.width}else{let z=this.heatmapColorScale.scale,O=s4t(z,$),K=z.domain(),te=K.length*s,le={id:"heatmapValue",type:"discrete",width:O,height:te,left:0,top:0,title:$,scale:z,values:K,labels:{}};g.push(le),b=le.height+c,C=le.width}}if(v.map(({columnKey:I,labels:$,values:z,data:O})=>{b>E&&(b=0,B+=C+A);let K=I,te=h(z.map(Y=>$[Y]),K),le=z.length*s;le>E&&(E=le);let G=Qo().domain(z).range(z.map(Y=>O[Y])),Q=B,j=b;g.push({id:I,type:"nodes",width:te,height:le,left:Q,top:j,title:K,scale:G,values:z,labels:$}),C=te,b+=le+c}),oh(n.nodeSize)){b>E&&(b=0,B+=C+A);let{columnName:I,domain:$,range:z}=n.nodeSize,O=I.label??I.value,K=cv($,z),te=K.ticks(3),le=K.tickFormat(3),G=te.reduce((ee,pe)=>(ee[String(pe)]=le(pe),ee),{}),Q=h(te.map(ee=>G[ee]),O),j=(K(Math.max(...te))*2+4)*te.length;j>E&&(E=j);let Y=B,X=b;g.push({id:I.value,type:"size",width:Q,height:j,left:Y,top:X,title:O,scale:K,values:te,labels:G}),C=Q,b+=j+c}let k=B+C+2*YC,P=E;this.legend={width:k,height:P,items:g}}updateChartSizes(e,t,n){let r=n.leaves().length;this.chartSizes.treeWidth=t?e.width/2:e.width;let a=D4t(r,e.scale,e.minCellHeight,e.maxCellHeight)*r;this.chartSizes.treeHeight=a,this.chartSizes.heatmapHeight=a}updateTotalSizes(e){this.chartSizes.totalWidth=this.chartSizes.treeWidth+this.chartSizes.heatmapWidth+this.legend.width+Qu.LEFT+Qu.RIGHT,e&&(this.chartSizes.totalWidth+=30),this.legend.width>0&&(this.chartSizes.totalWidth+=30),this.chartSizes.totalHeight=Math.max(this.chartSizes.treeHeight,this.legend.height)+Qu.TOP+Qu.BOTTOM}prepareTableLabels(e){let t=new hc("bold 14px Arial"),n="…";if(this.heatmapStep.x<12||!e){this.heatmapLabels=[];return}let r=this.heatmapStep.x-4;this.heatmapLabels=e.xKeys.map(a=>{let i=e.meta.xLabels[a],o=t.getTextWidth(i);if(o<r)return i;let s=i,c=s==null?void 0:s.length;for(;o>r&&c>0;)c--,s=(i==null?void 0:i.substring(0,c))+n,o=t.getTextWidth(s);return c>0?s:""})}addLabelsWidthToTreeArea(e,t){if(!t)return;let n=e.leaves(),r=new hc("bold 14px Manrope"),a=0;n.forEach(i=>{if(!i.data.label)return;let o=r.getTextWidth(i.data.label),s=i.y+o-this.chartSizes.treeWidth+8;s>a&&(a=s)}),this.chartSizes.treeWidth+=a}render(e,t,n,r,a,i,o,s,c,f,A,h,v,g,C,b,B){var $;this.updateChartSizes(e.size,v,t),this.updateHeatmapScales(v,g,e.size),this.updateLegendSize(e.legend,C,f,h,v,g),this.prepareTableLabels(v);let E=r==="top"?[this.chartSizes.treeWidth,this.chartSizes.treeHeight]:[this.chartSizes.treeHeight,this.chartSizes.treeWidth];$B().size(E).separation(()=>1)(t);let k=t;l3t(k,r==="top"?this.chartSizes.treeHeight:this.chartSizes.treeWidth,b==="alignLeavesToLine"),s3t(k),this.addLabelsWidthToTreeArea(k,s),this.updateTotalSizes(v);let P=P4t(f),I=ie.jsx(M4t,{chartSizes:this.chartSizes,chartSettings:e,nodes:k.descendants(),links:k.links(),connectionType:n,rootPosition:r,edgeInheritance:a,showNodes:i,showEdges:o,showLeavesLabels:s,showNodesLabels:c,aesGetters:P,labels:A,heatmapData:v,heatmapScales:this.heatmapScales,heatmapStep:this.heatmapStep,heatmapColor:this.heatmapColorScale.getter,heatmapLabels:this.heatmapLabels,legendData:this.legend,onClick:B});this.component=I,($=this.reactRoot)==null||$.render(I)}renderError(e){var t;(t=this.reactRoot)==null||t.render(ie.jsx(Xv,{message:e}))}},I4t=$4t,pK=class{constructor(e){Be(this,"type","dendro");Be(this,"chartSettings");Be(this,"mode");Be(this,"leavesMode");Be(this,"id");Be(this,"parentId");Be(this,"height",null);Be(this,"labels");Be(this,"heatmapAnnotation");Be(this,"heatmapAxis");Be(this,"heatmapGroup");Be(this,"heatmapSettings");Be(this,"connectionType","rectangle");Be(this,"edgeInheritance","up");Be(this,"rootPosition","top");Be(this,"showNodes",!0);Be(this,"showEdges",!0);Be(this,"showLeavesLabels",!0);Be(this,"showNodesLabels",!0);Be(this,"aes",{nodeShape:"21",nodeColor:Vt,nodeSize:3,lineShape:"solid",lineColor:Vt});var t,n,r,a,i,o,s,c,f,A;J3t.parse(e),this.chartSettings={size:{width:((t=e==null?void 0:e.size)==null?void 0:t.width)??(e.facetSettings?400:560),height:((n=e==null?void 0:e.size)==null?void 0:n.height)??(e.facetSettings?250:350),scale:((r=e==null?void 0:e.size)==null?void 0:r.scale)??1,minCellWidth:((a=e==null?void 0:e.size)==null?void 0:a.minCellWidth)??q5t,maxCellWidth:((i=e==null?void 0:e.size)==null?void 0:i.maxCellWidth)??e3t,minCellHeight:(o=e==null?void 0:e.size)==null?void 0:o.minCellHeight,maxCellHeight:(s=e==null?void 0:e.size)==null?void 0:s.maxCellHeight},title:{position:"center",show:!0,...e.title,name:((c=e.title)==null?void 0:c.name)??"Dendrogram"},legend:{show:!0,position:"right",...e.legend}},this.mode=e.mode??"normal",this.leavesMode=e.leavesMode??"normal",this.id=e.id,this.parentId=e.parentId,this.height=e.height??null,this.labels=e.labels??this.id,this.heatmapAnnotation=e.heatmapAnnotation??null,this.heatmapAxis=e.heatmapAxis??null,this.heatmapGroup=e.heatmapGroup??[],this.heatmapSettings={valueType:((f=e.heatmapSettings)==null?void 0:f.valueType)??"continuous",aes:{colorsList:["#FFF680","#53D788","#36739D","#4A005C"],...(A=e.heatmapSettings)==null?void 0:A.aes}},this.connectionType=e.connectionType??this.connectionType,this.edgeInheritance=e.edgeInheritance??this.edgeInheritance,this.showNodes=e.showNodes??this.showNodes,this.showEdges=e.showEdges??this.showEdges,this.showLeavesLabels=e.showLeavesLabels??this.showLeavesLabels,this.showNodesLabels=e.showNodesLabels??this.showNodesLabels,this.rootPosition=e.rootPosition??this.rootPosition,this.aes={...this.aes,...e.aes}}};function nS(e){return typeof e!="object"?!1:"valuesMap"in e}function vK(e,t){let{nodeColor:n,nodeShape:r,lineColor:a}=t,i=[n,r,a].filter(nS);return Zn.uniqBy(i,o=>o.columnName.value).reduce((o,s)=>{let{columnName:c}=s,f=Zn.uniqBy(e.rows,C=>C[c.value]),A=C=>String(C[c.value]),h=C=>c.valueLabels?String(C[c.valueLabels]):A(C),v=new Set,g=f.reduce((C,b)=>{let B=A(b);return C[B]||(C[B]={}),C},{});return nS(n)&&c.value===n.columnName.value&&(v.add("dotFill"),f.forEach(C=>{let b=A(C);g[b].dotFill=n.valuesMap[b]})),nS(r)&&c.value===r.columnName.value&&(v.add("dotShape"),f.forEach(C=>{let b=A(C);g[b].dotShape=r.valuesMap[b]})),nS(a)&&c.value===a.columnName.value&&(v.add("lineColor"),f.forEach(C=>{let b=A(C);g[b].lineColor=a.valuesMap[b]})),o[c.value]={values:f.map(A).sort(),usedAes:[...v],aesMap:g,labels:f.reduce((C,b)=>(C[A(b)]=h(b),C),{})},o},{})}var L4t=class extends zm{constructor(t,n,r){super(t,n);Be(this,"settings");Be(this,"onClick",()=>nI);Be(this,"chartRenderer",new I4t);Be(this,"calculatedData",null);this.settings=new pK(n),r&&(this.onClick=r[0])}mount(t){try{this.chartRenderer.init(t),this._updateData(),this._updateChart()}catch(n){n instanceof Error&&this.chartRenderer.renderError(n.message)}}unmount(){this.chartRenderer.clear()}updateSettingsAndData(t,n){try{let r=this.settings,a=this.data;this.settings=new pK(n),this.data=t,this._needUpdateCalculatedDataBySettings(r,this.settings)||this._needUpdateCalculatedDataByData(a,this.data)?this._updateData():this._updateAesInData(),this._updateChart()}catch(r){r instanceof Error&&this.chartRenderer.renderError(r.message)}}updateChartState(t,n){if(document){let r=new CustomEvent(SM,{detail:{[t]:n}});document.dispatchEvent(r)}}export(){return this._updateChart(),w5(this.chartRenderer.component)}_needUpdateCalculatedDataBySettings(t,n){var A,h;let{mode:r,id:a,parentId:i,heatmapAnnotation:o,heatmapAxis:s,heatmapGroup:c}=n;function f(v,g){return v.length!==g.length||v.some((C,b)=>C.value!==g[b].value)}return t.mode!==r||t.id.value!==a.value||t.parentId.value!==i.value||((A=t.heatmapAnnotation)==null?void 0:A.value)!==(o==null?void 0:o.value)||((h=t.heatmapAxis)==null?void 0:h.value)!==(s==null?void 0:s.value)||f(t.heatmapGroup,c)}_needUpdateCalculatedDataByData(t,n){let r=Object.keys(t.data),a=Object.keys(n.data);return t.id!==n.id||r.length!==a.length||r.some(i=>{var o;return t.data[i].length!==((o=n.data[i])==null?void 0:o.length)})}_updateData(){let{mode:t,id:n,parentId:r,aes:a,heatmapAnnotation:i,heatmapAxis:o,heatmapGroup:s,heatmapSettings:c,height:f,labels:A}=this.settings,h=o3t(n.value,r.value,(f==null?void 0:f.value)??null,A.valueLabels??A.value??null,this.data.rows,t==="useAllNodesAsLeaves"),v=r3t(this.data,c.valueType,i,o,s,n,h),g=vK(this.data,a);this.calculatedData={chartSizes:this.chartRenderer.chartSizes,hierarchy:h,heatmapData:v,legendLabels:g}}_updateAesInData(){this.calculatedData&&(this.calculatedData.legendLabels=vK(this.data,this.settings.aes))}_updateChart(){if(!this.calculatedData)return;let{heatmapAnnotation:t,chartSettings:n,connectionType:r,edgeInheritance:a,rootPosition:i,showNodes:o,showEdges:s,showLeavesLabels:c,showNodesLabels:f,aes:A,labels:h,heatmapSettings:v,leavesMode:g}=this.settings;this.chartRenderer.render(n,this.calculatedData.hierarchy,r,i,a,o,s,c,f,A,h,t,this.calculatedData.heatmapData,v,this.calculatedData.legendLabels,g,this.onClick)}},J1=Symbol("noGrouped");function R4t(e){return"type"in e&&e.type==="columns"}var mK=class F${constructor(t,n){Be(this,"id");Be(this,"data");Be(this,"rowsCount");Be(this,"columnNames");Be(this,"rowsGrouped");this.id=t,this.data=n,this.columnNames=Object.keys(n),this.rowsCount=this.columnNames.length?n[this.columnNames[0]].length:0}static from(t){if(t instanceof F$)return t;if(R4t(t))return new F$(t.id,t.values);d1(t,"Unknown input data format")}get rows(){let t=[];for(let n=0;n<this.rowsCount;n++)t.push(this.columnNames.reduce((r,a)=>(r[a]=this.data[a][n],r),{}));return t}getColumn(t){return this.data[t]}getColumnCategories(t,n=!0){if(!this.columnNames.includes(t))throw new Error(`Column ${t} does not exist`);return Zn.uniq(this.getColumn(t)).filter(r=>n?r!==null:!0).map(String)}setGrouping(t){let n={grouped:{},rows:this.rows},r=[n];t.forEach(a=>{let i=a===null?[J1]:this.getColumnCategories(a,!1),o=[];r.forEach(s=>{if(a===null)s.grouped={[J1]:{rows:s.rows,grouped:{}}},o.push(s.grouped[J1]);else{let c=Zn.groupBy(s.rows,f=>String(f[a]));s.grouped=i.reduce((f,A)=>(f[A]={rows:c[A]??[],grouped:{}},o.push(f[A]),f),{})}}),r=o}),this.rowsGrouped=n.grouped}getColumnByGrouping(t,n){if(!this.rowsGrouped)return[];if(!t.length)return this.rows.map(a=>Number(a[n]));let r={grouped:this.rowsGrouped,rows:this.rows};return t.forEach(a=>{let i=r.grouped[a??"null"];if(!i)return[];r=i}),r.rows.map(a=>Number(a[n]))}getRowsByGrouping(t){if(!this.rowsGrouped)return[];if(!t.length)return this.rows;let n={grouped:this.rowsGrouped,rows:this.rows};return t.forEach(r=>{let a=n.grouped[r];if(!a)return[];n=a}),n==null?void 0:n.rows}};function Md(e){return e.map(String).join("_")}function V4t(e,t,n,r){let a=-1/0;return{type:"logo",geoms:t.facet.reduce((i,o)=>{let s=Md(o);return i[s]=[],t.primary.forEach(c=>{let f=0,A={};t.secondary.forEach(v=>{let g=n.getRowsByGrouping([...o,c,v]);if(!g.length)return;let C=lc(g,b=>Number(b[r.value]));A[String(v)]={height:C,key:String(v)},f+=C});let h=f;e.normalize&&t.secondary.forEach(v=>{A[String(v)]&&(A[String(v)].height=A[String(v)].height/h*100)}),a=Math.max(a,f),i[s].push({key:`logo_${String(c)}`,valuesMap:A,primaryGrouping:c,boundsY:{min:0,max:e.normalize?h:100}})}),i},{}),meta:{minY:0,maxY:e.normalize?100:a,normalize:e.normalize},aes:e.aes}}var N4t={TOP:30,BOTTOM:30},dp=30,z4t=6,x9=20,TM=15,O4t=24,p3=25,F4t=12,gK={fillColor:"white",lineColor:Vt,lineWidth:1,lineShape:"solid",dotSize:3,dotFill:Vt,dotShape:"21"},kM=20,yK=4,zf=4,wK=36,bK=25;function Q4t(e){return`translate(${e},0)`}function j4t(e){return`translate(0,${e})`}var E9=21;function U4t(e,t){if(e==="45deg"){let n=t==="left"?-E9/2:0,r=t==="bottom"?E9/2:-E9/2;return`translate(${n},${r}) rotate(-45)`}return e==="90deg"&&t==="bottom"?`translate(${-E9/2},${zf+E9/2}) rotate(-90)`:t==="bottom"?`translate(0,${zf})`:`translate(${-zf},0)`}function G4t(e,t){return t==="left"||t==="bottom"&&e==="90deg"?"central":e==="center"?"hanging":"auto"}function Y4t(e,t){return t==="left"||t==="bottom"&&e!=="center"?"end":"middle"}var CK=({scale:e,tickSize:t=6,tickPadding:n=zf,orient:r="bottom",labelsPosition:a="center",labels:i={},offset:o=typeof window<"u"&&window.devicePixelRatio>1?0:.5})=>{function s(B,E){return B.bandwidth&&(E=Math.max(0,B.bandwidth()-E*2)/2),B!=null&&B.round()&&(E=Math.round(E)),k=>{let P=B(k);return P===void 0?0:P+E}}let c=e.domain(),f=B=>i[B]??[],A=Math.max(t,0)+n,h=s(e.copy(),o),v=r==="bottom"?Q4t:j4t,g=r==="left"?-1:1,C={[(r==="left"?"x":"y")+"2"]:g*t},b={[r==="left"?"x":"y"]:g*A};return ie.jsx("g",{children:c.map((B,E)=>ie.jsxs("g",{className:"tick",transform:v(h(B)+o),children:[ie.jsx("line",{stroke:Vt,...C}),ie.jsx("g",{transform:U4t(a,r),children:f(B).map((k,P)=>ie.jsx("text",{fill:Vt,fontSize:"14px",fontWeight:"500",fontFamily:"Manrope",dominantBaseline:G4t(a,r),textAnchor:Y4t(a,r),dy:20*P,...b,children:k},`${k}_${P}`))})]},E))})};function SK(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r.primaryGrouping)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(r.secondaryGrouping)[t]}return n}function W4t({scales:e,orientation:t,bar:n,aes:r}){let a=t==="vertical",i=(e.xPrimary(n.primaryGrouping)??0)+(e.xSecondary(n.secondaryGrouping)??0)+e.xSecondary.bandwidth()/2,o=e.xSecondary.bandwidth(),s=r.width==="auto"?o*.8:Math.min(o,r.width),c=Math.abs(e.y(n.value)-e.y(0)),f=SK(e,"lineColor",r.lineColor,n),A=SK(e,"fillColor",r.fillColor,n);return ie.jsx("g",{transform:a?`translate(${i},0)`:`translate(0, ${i})`,opacity:r.opacity,stroke:f,strokeWidth:r.lineWidth,children:ie.jsx("rect",{width:a?s:c,height:a?c:s,x:a?-s/2:e.y(n.boundsY.min),y:a?e.y(n.boundsY.max):-s/2,fill:A})})}function Ka(e){return isNaN(e)?"?":e===0?"0":Math.abs(e)<.01?ny(".1e")(e):ny(".2f")(e)}function xK(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r.primaryGrouping)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(r.secondaryGrouping)[t]}return n}function X4t({facetKey:e,scales:t,orientation:n,geom:r,aes:a,min:i,max:o,binsCount:s,hasKeyFromColumn:c,sideDistances:f,showTooltips:A,activeElementContainer:h,tooltipsContainer:v,tooltipsData:g}){let C=n==="vertical",b=(t.xPrimary(r.primaryGrouping)??0)+(t.xSecondary(r.secondaryGrouping)??0)+t.xSecondary.bandwidth()/2,B=xK(t,"lineColor",a.lineColor,r),E=xK(t,"fillColor",a.fillColor,r),k=r.bins,P=a.dotSize?a.dotSize:Math.abs(t.y(o)-t.y(i))/s/2,I=h&&g.fixed;return ie.jsx("g",{children:k.map(({x:$,count:z,dots:O})=>ie.jsx("g",{children:O.map((K,te)=>{let le=(te-z/2)*2*P+P,G=C?le:0,Q=C?0:le,j=`binnedDot_${r.key}_${K.key}`,Y=g.selectedData===j&&g.currentFacet===e&&I,X=ie.jsxs("g",{transform:C?`translate(${b},${t.y($)})`:`translate(${t.y($)},${b})`,stroke:B,fill:E,strokeWidth:a.lineWidth,children:[ie.jsx("circle",{opacity:a.opacity,cx:G,cy:Q,r:P,onMouseOver:()=>g.onMouseOver(j,e),onMouseLeave:()=>g.onMouseLeave()}),A&&ie.jsx(fu,{content:c?[K.key,Ka(K.value)]:[Ka(K.value)],x:(C?b:t.y($))+G,y:(C?t.y($):b)+Q,sideDistances:f,horizontal:C,offset:P,active:j===g.selectedData&&g.currentFacet===e,fixed:g.fixed,onClose:g.onClose,container:v})]},K.key);return Y?cu.createPortal(X,h):X})},$))})}function Of(e=null){switch(e){case null:return"";case"solid":return"";case"dashed":return"6 6";case"dotted":return"1.5 4";case"dotdash":return"1.4 4 8 4";case"longdash":return"10 4";case"twodash":return"3 3 9 3";default:d1(e,`Unknown line shape ${e}`)}}function rS(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r.primaryGrouping)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(r.secondaryGrouping)[t]}return n}function K4t(e,t){return t?[e.id,`${Ka(e.y)}`]:[`${Ka(e.y)}`]}function Z4t({facetKey:e,scales:t,orientation:n,box:r,aes:a,hasKeyFromColumn:i,sideDistances:o,showTooltips:s,elementsAmount:c,activeElementContainer:f,tooltipsContainer:A,tooltipsData:h}){let v=n==="vertical",g=(t.xPrimary(r.primaryGrouping)??0)+(t.xSecondary(r.secondaryGrouping)??0)+t.xSecondary.bandwidth()/2,C=t.xSecondary.bandwidth(),b=a.boxWidth==="auto"?C*.8:Math.min(C,a.boxWidth),B=Math.abs(t.y(r.lower)-t.y(r.upper)),E=rS(t,"lineColor",a.lineColor,r),k=rS(t,"fillColor",a.fillColor,r),P=rS(t,"dotShape",a.dotShape,r),I=rS(t,"dotSize",a.dotSize,r),$=Yc(P,I,E),z=Math.abs(t.y.range()[0]-t.y.range()[1]),O=f&&h.fixed,K=h.selectedData===r&&O,te=ie.jsxs("g",{transform:v?`translate(${g},0)`:`translate(0, ${g})`,opacity:a.opacity,stroke:E,strokeWidth:a.lineWidth,strokeDasharray:Of(a.lineShape),children:[ie.jsx("line",{x1:v?0:t.y(r.min),x2:v?0:t.y(r.lower),y1:v?t.y(r.min):0,y2:v?t.y(r.lower):0}),ie.jsx("line",{x1:v?0:t.y(r.upper),x2:v?0:t.y(r.max),y1:v?t.y(r.upper):0,y2:v?t.y(r.max):0}),ie.jsx("rect",{width:v?b:B,height:v?B:b,x:v?-b/2:t.y(r.lower),y:v?t.y(r.upper):-b/2,fill:k}),ie.jsx("line",{x1:v?-b/2:t.y(r.middle),x2:v?b/2:t.y(r.middle),y1:v?t.y(r.middle):-b/2,y2:v?t.y(r.middle):b/2}),s&&A&&ie.jsx("rect",{onMouseOver:()=>h.onMouseOver(r,e),onMouseLeave:h.onMouseLeave,width:v?C:z,x:v?-C/2:0,y:v?0:-C/2,height:v?z:C,fill:"transparent",stroke:"none"}),a.showOutliers&&r.outliers.map(le=>{let G=h.selectedData===le&&h.currentFacet===e&&O,Q=v?G?g:0:t.y(le.y),j=v?t.y(le.y):G?g:0,Y=ie.jsxs("g",{transform:`translate(${Q},${j})`,strokeDasharray:"0",children:[$,s&&A&&ie.jsx("circle",{onMouseOver:()=>h.onMouseOver(le,e),onMouseLeave:h.onMouseLeave,r:"15",fill:"transparent",stroke:"none"}),s&&ie.jsx(fu,{content:K4t(le,i),x:v?g:t.y(le.y),y:v?t.y(le.y):g,sideDistances:o,horizontal:!0,active:h.selectedData===le&&h.currentFacet===e,onClose:h.onClose,fixed:h.fixed,container:A})]},le.id);return G?cu.createPortal(Y,f):Y}),s&&ie.jsx(fu,{content:[`Max = ${Ka(r.max)}`,`Upper = ${Ka(r.upper)}`,`Median = ${Ka(r.middle)}`,`Lower = ${Ka(r.lower)}`,`Min = ${Ka(r.min)}`],x:v?g:t.y(r.middle),y:v?t.y(r.middle):g,sideDistances:o,horizontal:v,active:h.active&&h.selectedData===r&&h.currentFacet===e,fixed:h.fixed,onClose:h.onClose,offset:c>1?C/2:C/4,container:A})]});return K?cu.createPortal(te,f):te}function MM(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r.primaryGrouping)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(r.secondaryGrouping)[t]}return n}function J4t(e,t,n){return n?[t,`${Ka(e)}`]:[`${Ka(e)}`]}function q4t({facetKey:e,scales:t,orientation:n,geom:r,aes:a,hasKeyFromColumn:i,sideDistances:o,showTooltips:s,activeElementContainer:c,tooltipsContainer:f,tooltipsData:A}){let h=n==="vertical",v=(t.xPrimary(r.primaryGrouping)??0)+(t.xSecondary(r.secondaryGrouping)??0)+t.xSecondary.bandwidth()/2,g=t.xSecondary.bandwidth()*a.jitter,C=I=>(1-I*2)*(g/2),b=MM(t,"lineColor",a.lineColor,r),B=MM(t,"dotFill",a.dotFill,r),E=MM(t,"dotShape",a.dotShape,r),k=Yc(E,a.dotSize,B),P=c&&A.fixed;return ie.jsx("g",{transform:h?`translate(${v},0)`:`translate(0, ${v})`,stroke:b,children:r.values.map(I=>{let{jitter:$,id:z}=I,O=A.selectedData===I&&P,K=C($),te=h?O?v+K:K:t.y(I.y),le=h?t.y(I.y):O?v+K:K,G=ie.jsxs("g",{opacity:a.opacity,transform:`translate(${te},${le})`,children:[k,s&&f&&ie.jsx("circle",{onMouseOver:()=>A.onMouseOver(I,e),onMouseLeave:()=>A.onMouseLeave(),r:"4",fill:"transparent",stroke:"none"}),s&&ie.jsx(fu,{content:J4t(I.y,z,i),x:v+C($),y:le,active:A.active&&A.selectedData===I&&A.currentFacet===e,fixed:A.fixed,onClose:A.onClose,sideDistances:o,container:f})]},z);return O?cu.createPortal(G,c):G})})}function PM(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r.primaryGrouping)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(r.secondaryGrouping)[t]}return n}function eyt({facetKey:e,scales:t,orientation:n,errorBar:r,aes:a,sideDistances:i,showTooltips:o,activeElementContainer:s,tooltipsContainer:c,tooltipsData:f}){let A=n==="vertical",h=PM(t,"lineColor",a.lineColor,r),v=PM(t,"fillColor",a.fillColor,r),g=PM(t,"dotShape",a.dotShape,r),C=(t.xPrimary(r.primaryGrouping)??0)+t.xPrimary.bandwidth()/2,b=a.width==="auto"?t.xPrimary.bandwidth()*.2:a.width,B=t.y(r.min),E=t.y(r.max),k=t.y(r.value),P=Yc(g,a.dotSize,v),I=s&&f.fixed,$=f.selectedData===r&&I,z=a.showDots?ie.jsxs("g",{transform:A?`translate(${C},${k})`:`translate(${k},${C})`,children:[P,o&&c&&ie.jsx("circle",{onMouseOver:()=>f.onMouseOver(r,e),onMouseLeave:()=>f.onMouseLeave(),r:"15",fill:"transparent",stroke:"none"}),o&&ie.jsx(fu,{content:[Ka(r.value)],x:A?C:k,y:A?k:C,sideDistances:i,horizontal:!0,active:f.active&&f.selectedData===r&&f.currentFacet===e,fixed:f.fixed,onClose:f.onClose,container:c})]}):null;return ie.jsxs("g",{opacity:a.opacity,stroke:h,fill:"none",strokeWidth:a.lineWidth,children:[ie.jsxs("g",{transform:A?`translate(${C},0)`:`translate(0,${C})`,children:[ie.jsx("line",{x1:A?0:B,x2:A?0:E,y1:A?B:0,y2:A?E:0}),ie.jsx("line",{x1:A?-b/2:B,x2:A?b/2:B,y1:A?B:-b/2,y2:A?B:b/2}),ie.jsx("line",{x1:A?-b/2:E,x2:A?b/2:E,y1:A?E:-b/2,y2:A?E:b/2})]}),$?cu.createPortal(z,s):z]})}function aS(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")throw new Error("Line cannot have aesthetics by primary grouping");if(n.type==="secondaryGrouping")return e.xSecondaryAes(r.key)[t]}return n}function tyt(e,t,n){let r=n.xPrimary.bandwidth()/2;return t.map(a=>[(n.xPrimary(a)??0)+r,n.y(e[a]),a,e[a]])}function nyt(e,t,n){let r=e.valueLabels[t];return r?[r,Ka(n)]:[Ka(n)]}function ryt({facetKey:e,scales:t,orientation:n,line:r,aes:a,sideDistances:i,showTooltips:o,secondaryGrouping:s,activeElementContainer:c,tooltipsContainer:f,tooltipsData:A}){let h=n==="vertical",v=aS(t,"lineColor",a.lineColor,r),g=aS(t,"dotFill",a.fillColor,r),C=aS(t,"lineShape",a.lineShape,r),b=aS(t,"dotShape",a.dotShape,r),B=tyt(r.dots,t.xPrimary.domain(),t),E=Yc(b,a.dotSize,g),k=c&&A.fixed;return ie.jsxs("g",{opacity:a.opacity,stroke:v,strokeDasharray:Of(C),strokeWidth:a.lineWidth,children:[ie.jsx("polyline",{points:B.map(([P,I])=>h?[P,I]:[I,P]).join(" "),stroke:v,fill:"none"},r.key),a.dotShape!==null&&ie.jsx("g",{children:B.map(P=>{let[I,$,z,O]=P,K=A.selectedData,te=!!(K&&e===A.currentFacet&&lI.isArray(K)&&K.every((Q,j)=>Q===P[j])),le=te&&k,G=ie.jsxs("g",{transform:h?`translate(${I},${$})`:`translate(${$},${I})`,strokeDasharray:"none",stroke:"none",children:[E,o&&f&&ie.jsx("circle",{onMouseOver:()=>A.onMouseOver(P,e),onMouseLeave:()=>A.onMouseLeave(),r:"15",fill:"transparent",stroke:"none"}),o&&ie.jsx(fu,{content:nyt(s,r.key,O),x:h?I:$,y:h?$:I,sideDistances:i,horizontal:!0,active:te,fixed:A.fixed,onClose:A.onClose,container:f})]},z);return le?cu.createPortal(G,c):G})})]})}var EK={A:"M100 100H75.9062L68.8622 76.6168H31.0006L24.1052 100H0L33.1961 0H66.8839L100 100ZM43.3619 34.7342L35.6089 61.0056H64.2424L56.7296 34.7342L50.6575 13.3372H49.3425L43.3619 34.7342Z",B:"M45.4184 0C56.8913 0 66.0972 1.04768 73.0217 3.15678C80.0142 5.26596 85.0715 8.18391 88.1943 11.8979C91.3839 15.5655 92.982 19.7862 92.982 24.5538C92.9812 30.6489 90.5672 35.6664 85.7508 39.6085C80.9994 43.5053 74.7182 45.8 66.9129 46.4882C73.4281 46.8551 79.1309 47.9556 84.0176 49.7889C88.9734 51.5771 92.8725 54.104 95.7238 57.3594C98.5744 60.614 99.9992 64.6461 100 69.4588C100 76.0611 97.792 81.6556 93.3797 86.2406C88.967 90.78 82.8289 94.2265 74.9538 96.565C67.0793 98.8571 57.809 100 47.1516 100H0V0H45.4184ZM27.8022 85.1468H44.8075C51.9358 85.1468 57.8845 83.9734 62.6367 81.635C67.4532 79.2511 69.8667 75.2176 69.8679 69.5356C69.8679 65.5037 68.6429 62.4975 66.2026 60.5258C63.7586 58.5542 60.5964 57.2647 56.7268 56.6686C52.8573 56.0267 48.8175 55.7091 44.6086 55.7091H27.8022V85.1468ZM27.8022 41.8154H42.1651C47.1205 41.8153 51.3011 41.2654 54.6953 40.165C58.0867 39.065 60.6592 37.4343 62.4236 35.2811C64.2566 33.0803 65.1797 30.3733 65.1797 27.1637C65.1795 22.7623 63.2071 19.5998 59.2698 17.6742C55.3323 15.7028 49.4604 14.7189 41.6536 14.7189H27.8022V41.8154Z",C:"M54.4005 0C63.8911 0.000435932 72.0623 1.41634 78.9173 4.24058C85.84 7.0661 91.116 11.2405 94.7422 16.7591C98.4335 22.2332 100.183 28.9442 99.9849 36.8902H73.4814C73.1518 32.5637 72.2691 28.9393 70.8186 26.0255C69.4341 23.0678 67.3207 20.8581 64.4859 19.4013C61.7175 17.901 57.9898 17.1566 53.3106 17.1563C47.7087 17.1563 42.9921 18.2992 39.1689 20.5931C35.3456 22.8444 32.4717 26.3789 30.5598 31.1899C28.6478 36.0022 27.7207 42.2329 27.7866 49.8707C27.8529 60.4208 29.9968 68.5683 34.2159 74.3071C38.5013 80.0017 44.6742 82.8437 52.7173 82.8437C57.4631 82.8435 61.2207 82.3345 63.9893 81.3193C66.8227 80.3039 68.8628 78.8265 70.115 76.8847C71.4333 74.8983 72.1629 72.4942 72.2949 69.6693H99.5848C99.4529 74.6128 98.1741 78.9828 95.7355 82.779C93.3624 86.5311 90.0312 89.6883 85.7467 92.2487C81.528 94.8089 76.5838 96.7539 70.9152 98.0783C65.2452 99.3587 59.0727 100 52.4138 100C41.2735 99.9995 31.782 97.9636 23.9373 93.9024C16.1587 89.8408 10.2268 84.0567 6.13955 76.5521C2.05273 69.0031 0 60.0208 0 49.6027C2.4153e-05 39.0955 2.11331 30.1555 6.3327 22.7827C10.5515 15.367 16.713 9.71467 24.8203 5.82964C32.9297 1.94454 42.7968 0 54.4005 0Z",D:"M36.9306 0C57.3372 0 72.9524 4.0091 83.7717 12.0322C94.5911 20.0563 100 32.3963 100 49.0405C99.9993 60.0888 97.4138 69.3977 92.2316 76.9622C87.0488 84.527 79.7265 90.2594 70.2684 94.1566C60.8744 98.054 49.7583 100 36.9306 100H0V0H36.9306ZM26.9252 82.5273H36.3476C43.9924 82.5273 50.4765 81.4275 55.789 79.2266C61.1642 76.9798 65.2464 73.4042 68.0315 68.4993C70.8817 63.5933 72.3021 57.1738 72.3021 49.242C72.302 41.2205 71.0145 34.8935 68.4246 30.2629C65.8339 25.6332 61.8118 22.3539 56.372 20.4279C50.9299 18.5022 43.8631 17.5398 35.1817 17.5398H26.9252V82.5273Z",E:"M96.3517 16.6379H29.2614V40.0307H88.741V56.1217H29.2614V82.8728H100V100H0V0H96.3517V16.6379Z",F:"M100 16.7818H30.2939V42.228H91.4268L91.3057 58.6644H30.2939V100H0V0H99.894L100 16.7818Z",G:"M55.4382 0.00126929C64.1095 -0.0425219 71.651 1.04689 78.0577 3.25536C84.5282 5.42011 89.637 8.84438 93.3902 13.5261C97.2079 18.1639 99.4172 24.1682 100 31.5438H74.7528C74.2349 28.8504 73.2941 26.4228 71.9355 24.2591C70.6416 22.0953 68.6385 20.3723 65.9217 19.0913C63.2041 17.8106 59.5139 17.1689 54.8557 17.1685C48.2538 17.1685 42.9402 18.493 38.9273 21.1436C34.9157 23.7495 32.0032 27.4813 30.191 32.3388C28.3787 37.1541 27.4685 42.9001 27.4685 49.5708C27.4685 56.374 28.4388 62.2729 30.3806 67.2649C32.3871 72.2567 35.3719 76.0982 39.3201 78.7929C43.3329 81.4873 48.3491 82.8328 54.3681 82.8328C58.8318 82.8327 62.7771 82.4142 66.2061 81.5755C69.6366 80.692 72.4273 79.541 74.5632 78.1273V61.635H53.7857V45.4662H99.1196L99.0248 86.8819C95.9195 89.2658 92.1976 91.4495 87.864 93.4363C83.5274 95.4243 78.602 97.0138 73.1004 98.2066C67.6639 99.3991 61.7068 100 55.235 100C43.5888 99.9995 33.6549 97.9905 25.4368 93.9725C17.2167 89.9083 10.9027 84.0915 6.50142 76.5372C2.16601 68.9836 0 59.9951 0 49.5708C7.19725e-06 39.1892 2.16484 30.3054 6.50142 22.9279C10.9027 15.5521 17.2482 9.89511 25.5316 5.96403C33.8158 2.03341 43.7893 0.0454419 55.4382 0.00126929Z",H:"M28.0722 40.0307H71.9138V0H100V100H71.9138V57.0812H28.0722V100H0V0H28.0722V40.0307Z",I:"M100 16.7146H65.2015V75.9931C65.2015 78.2398 64.5115 79.9418 63.1258 81.0881C61.8137 82.1874 59.8078 82.9184 57.1123 83.2854H100V100H0V83.2854H34.6764V23.9973C34.6772 21.7535 35.3684 20.0789 36.7521 18.9791C38.1379 17.8328 40.1552 17.0815 42.7808 16.7146H0V0H100V16.7146Z",K:"M25.5221 49.2804L40.9481 31.9804L67.9564 0H97.5272L57.5016 43.0628L100 100H71.1723L41.5375 57.5801L25.5221 73.2585V100H0V0H25.5221V49.2804Z",L:"M31.8025 82.7384H100V100H0V0H31.8025V82.7384Z",M:"M47.5503 42.0169L49.8164 54.5385H50.3608L52.4497 42.0169L62.6155 0H96.8224L100 100H78.4023L77.9592 58.4629L78.7695 12.7231H77.3136L70.4266 36.9315L59.5265 74.621H40.4735L29.4088 36.9315L22.5978 12.7231H21.0533L22.142 58.4629L21.5977 100H0L3.17762 0H37.2959L47.5503 42.0169Z",N:"M66.0971 57.4938L77.5346 80.877H78.2406L73.2703 51.516V0H100V100H64.8828L33.9029 42.7749L22.9737 20.6294H22.0559L26.7156 49.7889V100H0V0H34.9195L66.0971 57.4938Z",P:"M49.614 0C65.9884 0 78.4836 2.53923 87.092 7.62809C95.7004 12.6718 100 20.7713 100 31.9133C99.9996 36.3592 99.1326 40.6455 97.3859 44.7707C95.6384 48.8971 92.8172 52.5881 88.934 55.8434C85.0516 59.0521 79.9422 61.6227 73.6015 63.5483C67.2584 65.4282 59.4822 66.3692 50.2912 66.3692H34.1731C32.2339 66.3685 30.557 65.8604 29.1345 64.8532C28.1138 64.0613 27.4654 63.0777 27.2112 61.8979L27.0893 60.6601V100H0V0H49.614ZM27.0893 50.0672H48.3543C53.853 50.067 58.3506 49.4736 61.8448 48.2825C65.3396 47.0446 67.9365 45.1407 69.6194 42.5734C71.3664 40.0066 72.2329 36.7043 72.2335 32.6713C72.2335 28.7754 71.2617 25.6329 69.3214 23.2489C67.445 20.8654 64.6653 19.1414 60.9779 18.0867C57.2886 17.0322 52.7814 16.5036 47.4739 16.5036H27.0893V50.0672Z",Q:"M50 0C66.0982 0.000380175 78.4597 3.59164 87.0755 10.7794C95.692 17.9687 100 28.241 100 41.582C99.9995 50.6968 98.0845 58.4254 94.2485 64.7615C90.412 71.0606 84.7408 75.8568 77.2572 79.1547C76.6607 79.4197 76.0326 79.6555 75.4146 79.8992C76.1355 80.0194 76.9062 80.2004 77.731 80.4343C79.4291 80.916 80.8793 81.8049 82.0742 83.102L97.4467 100H67.452L55.712 83.9162C53.8622 84.0259 51.9607 84.1023 50 84.1024C39.3081 84.1024 30.214 82.4529 22.7297 79.1547C15.3107 75.857 9.65038 71.0593 5.75151 64.7615C1.9155 58.4254 0.00050139 50.6968 0 41.582C0 28.241 4.30801 17.9687 12.9245 10.7794C21.6036 3.5922 33.9645 0 50 0ZM50 14.2846C42.5168 14.2846 36.7574 16.4143 32.7323 20.6747C28.7071 24.9364 26.6912 31.9098 26.6912 41.582C26.6917 51.4747 28.7076 58.665 32.7323 63.1485C36.7574 67.5945 42.5165 69.8178 50 69.8178C57.6084 69.8173 63.398 67.5945 67.3598 63.1485C71.3217 58.665 73.2951 51.4747 73.2956 41.582C73.2956 31.9098 71.3221 24.9364 67.3598 20.6747C63.398 16.4143 57.6081 14.2851 50 14.2846Z",R:"M44.4713 0C59.0103 0 70.3242 2.35844 78.3943 7.08117C86.5255 11.8032 90.5898 19.0937 90.5911 28.9484C90.5911 32.2037 89.9122 35.4395 88.5672 38.649C87.2866 41.8578 85.2158 44.8412 82.3348 47.5916C79.4538 50.2958 75.6687 52.5395 70.9958 54.3274C68.56 55.2719 65.8456 56.0119 62.8736 56.5726C62.9225 56.5803 62.9727 56.5936 63.021 56.6014C65.0053 56.9226 66.7655 57.5677 68.3018 58.53C69.9023 59.4471 71.3804 60.8226 72.7248 62.6559L100 100H71.3711L41.8845 59.9021H26.605V100H0V0H44.4713ZM26.605 44.2238H42.0721C47.3231 44.2238 51.5492 43.5999 54.7514 42.3623C58.0179 41.0785 60.3953 39.2912 61.8684 36.9987C63.4046 34.7065 64.1737 32.0195 64.1737 28.9484C64.1729 25.2834 63.2118 22.4872 61.2921 20.5623C59.3706 18.6365 56.8011 17.283 53.5987 16.5036C50.3972 15.7247 46.7758 15.333 42.7423 15.333L26.605 15.2658V44.2238Z",S:"M50.5755 0C64.0221 0 74.604 2.42428 82.3151 7.27866C90.0897 12.1329 94.5868 19.4156 95.7978 29.124H70.6461C70.391 26.3633 69.3763 24.021 67.5922 22.1062C65.8722 20.1487 63.5464 18.6566 60.6175 17.6328C57.7497 16.6085 54.2673 16.0951 50.1887 16.0951C44.2643 16.0955 39.4247 16.9267 35.6658 18.5741C31.9066 20.2219 30.0247 22.7593 30.0247 26.1883C30.0252 28.7257 30.7599 30.8846 32.2252 32.6654C33.6901 34.401 36.2678 36.0471 39.96 37.6048C43.7199 39.119 48.9519 40.8136 55.6431 42.6841C61.3149 44.2428 66.797 45.7831 72.0864 47.2973C77.3748 48.7668 82.0942 50.5032 86.2359 52.507C90.4401 54.4662 93.7798 56.9841 96.2645 60.0559C98.7497 63.0841 99.9984 66.9574 99.9986 71.6775C100.062 77.6453 97.9605 82.7703 93.6907 87.0457C89.4847 91.2763 83.6794 94.5021 76.2872 96.7288C68.9599 98.9104 60.519 99.9997 50.9622 100C41.0206 100 32.1881 98.8903 24.477 96.6636C16.7676 94.437 10.7101 90.9431 6.31336 86.1789C1.98004 81.3693 -0.121801 75.1754 0.00544797 67.6048H25.8239C25.9515 71.3879 27.0275 74.5038 29.0645 76.9525C31.1676 79.3574 34.1359 81.1233 37.9596 82.2367C41.7825 83.3495 46.3709 83.9049 51.7224 83.9049C56.4382 83.9049 60.4213 83.4329 63.6714 82.4977C66.9848 81.5179 69.4694 80.1824 71.1262 78.4902C72.8454 76.7544 73.7125 74.8201 73.7134 72.6841C73.7134 70.0124 72.6846 67.8753 70.6461 66.2721C68.607 64.6245 65.4601 63.1461 61.1909 61.8546C56.9848 60.5631 51.5621 59.0528 44.9343 57.3159C37.2253 55.2678 30.2839 52.9043 24.1036 50.233C17.9237 47.5171 13.0722 44.248 9.56734 40.4194C6.06248 36.5895 4.31316 31.9981 4.31297 26.6542C4.31297 20.7769 6.31449 15.8551 10.3275 11.8919C14.3419 7.92869 19.8552 4.9605 26.8641 3.00093C33.874 0.996878 41.7812 5.03329e-05 50.5755 0Z",T:"M100 17.0505H63.592V100H36.408V24.4867C36.408 22.4234 37.0203 20.7427 38.25 19.4588C39.5445 18.175 41.5288 17.3714 44.1826 17.0505H0V0H100V17.0505Z",U:"M27.3115 59.9622C27.3115 64.1165 27.8423 67.639 28.8938 70.5293C30.0115 73.3748 31.5581 75.7075 33.5305 77.5142C35.5021 79.2737 37.9016 80.558 40.7265 81.3705C43.6177 82.183 46.8374 82.5893 50.3853 82.5898C53.7384 82.5898 56.8011 82.1835 59.5625 81.3705C62.3226 80.5579 64.6595 79.2744 66.5658 77.5142C68.5383 75.7075 70.0542 73.3748 71.1062 70.5293C72.1574 67.6392 72.6747 64.116 72.6747 59.9622V0.141777H100V62.8072C100 71.1631 97.8926 78.1212 93.6846 83.6768C89.4768 89.1863 83.6229 93.2922 76.1282 96.0019C68.633 98.6665 59.9889 100 50.1926 100C40.2652 99.9998 31.515 98.6666 23.9543 96.0019C16.3967 93.337 10.5082 89.2515 6.3016 83.7429C2.09459 78.2328 0 71.2525 0 62.8072V0H27.3115V59.9622Z",V:"M44.0874 62.7231L49.6536 83.2182H50.5136L55.817 62.7231L74.0564 0H100L66.2685 100H33.8151L0 0H25.9436L44.0874 62.7231Z",W:"M28.541 72.347C28.7554 74.7771 29.0518 77.1238 29.4269 79.3706C29.8018 81.5705 30.0986 84.069 30.3129 86.8643H30.8736L33.3632 63.6826L39.2284 24.0741H60.8501L66.648 63.6826L69.1376 86.8643H69.7768C69.9911 84.0688 70.2629 81.5706 70.5843 79.3706C70.9594 77.1238 71.2559 74.7771 71.4702 72.347L78.2999 0H100L83.2791 100H59.6501L54.2671 69.2573C53.3025 63.7551 52.524 58.6162 51.9345 53.8476C51.3987 49.034 50.8305 43.8719 50.2411 38.3708H49.7589C49.1695 43.8717 48.5876 49.0341 47.9982 53.8476C47.4087 58.6621 46.6551 63.801 45.7441 69.2573L40.5181 100H16.8891L0 0H21.7898L28.541 72.347Z",X:"M39.6147 20.9077L50.2513 38.3036L60.6365 21.042L72.3857 0H99.653L65.3506 50.2015L100 100H72.8165L59.9426 78.8141L49.9162 61.8307L40.2249 78.958L27.0998 100H0L34.9007 50.2015L0.430725 0H27.4468L39.6147 20.9077Z",Y:"M39.5066 28.2L49.3154 48.3496H50.5076L74.5397 0H100L61.5911 66.9449V100H38.4089V66.9641L0 0H25.543L39.5066 28.2Z",Z:"M43.1362 77.3748L36.708 83.8419L50.0528 83.2182H94.8918V100H0L56.2962 23.5176L64.7175 16.3021L52.5079 16.7818H5.67582V0H100L43.1362 77.3748Z"},ayt=()=>ie.jsx("path",{d:"M 0 49 h 100 v 2 h -100 z"});function iyt({facetKey:e,scales:t,orientation:n,geom:r,aes:a,sideDistances:i,showTooltips:o,elementsAmount:s,normalize:c,activeElementContainer:f,tooltipsContainer:A,tooltipsData:h}){let v=n==="vertical",g=t.xPrimary.bandwidth(),C=(t.xPrimary(r.primaryGrouping)??0)+g/2,b=a.width==="auto"?g*.95:Math.min(g,a.width),B=(g-b)/2,E=[...t.xSecondary.domain()].filter($=>r.valuesMap[$]).sort(($,z)=>{let O=r.valuesMap[$],K=r.valuesMap[z];return O.height-K.height}),k={},P=0;E.forEach($=>{if(!r.valuesMap[$])return;let z=r.valuesMap[$].height;k[$]={y1:P,y2:P+z},P+=z});let I=f&&h.fixed;return ie.jsx("g",{opacity:a.opacity,children:E.map($=>{if(!r.valuesMap[$])return null;let{y1:z,y2:O}=k[$],K=t.y(z),te=t.y(O),le=Math.abs(K-te)-2*B,G=typeof a.fillColor=="string"?a.fillColor:a.fillColor[$],Q=v?-b/2:Math.min(K,te)+B,j=v?Math.min(K,te)+B:-b/2,Y=$==="-";if(!Y&&!EK[$])return;let X=`logo_${r.key}_${$}`,ee=h.currentFacet===e&&h.selectedData===X&&I,pe=ie.jsxs("g",{transform:v?`translate(${C},0)`:`translate(0, ${C})`,children:[ie.jsx("g",{transform:`translate(${Q},${j})`,children:Y?ie.jsx("g",{transform:v?`scale(${b/100},1) translate(0,${le/2-50})`:`scale(${le/100},1) translate(0,${b/2-50}) `,children:ayt()}):ie.jsx("g",{transform:v?`scale(${b/100},${le/100})`:`scale(${le/100},${b/100})`,fill:G,onMouseOver:()=>h.onMouseOver(X,e),onMouseLeave:()=>h.onMouseLeave(),children:ie.jsx("path",{d:EK[$],fillRule:"evenodd",clipRule:"evenodd"})})}),o&&ie.jsx(fu,{content:[$,Ka(r.valuesMap[$].height)+(c?"%":"")],x:v?C:(K+te)/2,y:v?(K+te)/2:C,sideDistances:i,horizontal:v,offset:s>1?g/2:g/4,active:X===h.selectedData&&h.currentFacet===e,fixed:h.fixed,onClose:h.onClose,container:A})]},$);return ee?cu.createPortal(pe,f):pe})})}function v3(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(r)[t]}return n}function oyt({facetKey:e,scales:t,orientation:n,geom:r,aes:a,sideDistances:i,showTooltips:o,activeElementContainer:s,tooltipsContainer:c,tooltipsData:f}){let A=n==="vertical",h=v3(t,"lineColor",a.lineColor,r.id),v=v3(t,"lineShape",a.lineShape,r.id),g=v3(t,"fillColor",a.dotFill,r.key1),C=v3(t,"dotShape",a.dotShape,r.key1),b=v3(t,"fillColor",a.dotFill,r.key2),B=v3(t,"dotShape",a.dotShape,r.key2),E=Yc(C,a.dotSize,g),k=Yc(B,a.dotSize,b);function P($){return r.grouping==="primary"?(t.xPrimary($)??0)+t.xPrimary.bandwidth()/2:(t.xPrimary(r.id)??0)+(t.xSecondary($)??0)+t.xSecondary.bandwidth()/2}let I=s&&f.fixed;return ie.jsx("g",{opacity:a.opacity,children:r.pairs.map($=>{let z=A?P(r.key1):t.y($.key1.value),O=A?P(r.key2):t.y($.key2.value),K=A?t.y($.key1.value):P(r.key1),te=A?t.y($.key2.value):P(r.key2),le=`pairedPoints_${$.id}_${$.key1.id}`,G=`pairedPoints_${$.id}_${$.key2.id}`,Q=f.currentFacet===e&&f.selectedData===le&&I,j=f.currentFacet===e&&f.selectedData===G&&I,Y=ie.jsxs("g",{transform:`translate(${z},${K})`,children:[E,o&&c&&ie.jsx("circle",{onMouseOver:()=>f.onMouseOver(le,e),onMouseLeave:()=>f.onMouseLeave(),r:"15",fill:"transparent",stroke:"none"}),o&&ie.jsx(fu,{content:[$.id,Ka($.key1.value)],x:z,y:K,sideDistances:i,horizontal:!0,active:le===f.selectedData&&f.currentFacet===e,fixed:f.fixed,onClose:f.onClose,container:c})]}),X=ie.jsxs("g",{transform:`translate(${O},${te})`,children:[k,o&&c&&ie.jsx("circle",{onMouseOver:()=>f.onMouseOver(G,e),onMouseLeave:()=>f.onMouseLeave(),r:"15",fill:"transparent",stroke:"none"}),o&&ie.jsx(fu,{content:[$.id,Ka($.key2.value)],x:O,y:te,sideDistances:i,horizontal:!0,active:G===f.selectedData&&f.currentFacet===e,fixed:f.fixed,onClose:f.onClose,container:c})]});return ie.jsxs("g",{children:[ie.jsx("line",{x1:z,y1:K,x2:O,y2:te,stroke:h,strokeDasharray:Of(v),strokeWidth:a.lineWidth,fill:"none"}),Q?cu.createPortal(Y,s):Y,j?cu.createPortal(Y,s):X]},$.id)})})}function BK(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r.primaryGrouping)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(r.secondaryGrouping)[t]}return n}function lyt(e,t,n){return n?[t,`${Ka(e)}`]:[`${Ka(e)}`]}function syt({scales:e,orientation:t,geom:n,aes:r,hasKeyFromColumn:a,sideDistances:i,showTooltips:o,tooltipsContainer:s}){let[c,f]=tn.useState(null),A=t==="vertical",h=(e.xPrimary(n.primaryGrouping)??0)+(e.xSecondary(n.secondaryGrouping)??0)+e.xSecondary.bandwidth()/2,v=e.xSecondary.bandwidth(),g=r.width==="auto"?v*.8:Math.min(v,r.width),C=k=>(1-k*2)*(g/2),b=BK(e,"dotFill",r.dotFill,n),B=BK(e,"dotShape",r.dotShape,n),E=Yc(B,r.dotSize,b);return ie.jsx("g",{transform:A?`translate(${h},0)`:`translate(0, ${h})`,children:n.points.map(({x:k,y:P,jitter:I,id:$})=>{let z=A?P*C(I):e.y(k),O=A?e.y(k):P*C(I);return ie.jsxs("g",{opacity:r.opacity,transform:`translate(${z},${O})`,children:[E,o&&s&&ie.jsx("circle",{onMouseOver:()=>f($),onMouseLeave:()=>f(null),r:"4",fill:"transparent",stroke:"none"}),o&&ie.jsx(fu,{content:lyt(P,$,a),x:h+z,y:O,active:c===$,fixed:!1,sideDistances:i,container:s})]},$)})})}function _K(e,t,n,r,a){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(a)[t]}return n}function uyt(e,t,n,r){let a=e.valueLabels[n],i=Ka(t.valuesMap[n].height)+(r?"%":"");return a?[a,i]:[i]}function cyt({facetKey:e,scales:t,orientation:n,geom:r,aes:a,sideDistances:i,showTooltips:o,elementsAmount:s,normalize:c,secondaryGrouping:f,activeElementContainer:A,tooltipsContainer:h,tooltipsData:v}){let g=n==="vertical",C=t.xPrimary.bandwidth(),b=(t.xPrimary(r.primaryGrouping)??0)+C/2,B=a.width==="auto"?C*.8:Math.min(C,a.width),E=t.xSecondary.domain().reverse(),k={},P=0;E.forEach($=>{if(!r.valuesMap[$])return;let z=r.valuesMap[$].height;k[$]={y1:P,y2:P+z},P+=z});let I=A&&v.fixed;return ie.jsx("g",{opacity:a.opacity,strokeWidth:a.lineWidth,children:E.map($=>{if(!r.valuesMap[$])return null;let{y1:z,y2:O}=k[$],K=t.y(z),te=t.y(O),le=Math.abs(K-te),G=_K(t,"lineColor",a.lineColor,r.primaryGrouping,$),Q=_K(t,"fillColor",a.fillColor,r.primaryGrouping,$),j=`stackedBar_${r.primaryGrouping}_${$}`,Y=ie.jsx("rect",{width:g?B:le,height:g?le:B,x:g?b-B/2:Math.min(K,te),y:g?Math.min(K,te):b-B/2,fill:Q,stroke:G,onMouseOver:()=>v.onMouseOver(j,e),onMouseLeave:()=>v.onMouseLeave()}),X=v.selectedData===j&&e===v.currentFacet&&I;return ie.jsxs("g",{children:[X?cu.createPortal(Y,A):Y,o&&ie.jsx(fu,{content:uyt(f,r,$,c),x:g?b:(K+te)/2,y:g?(K+te)/2:b,sideDistances:i,horizontal:g,offset:s>1?C/2:C/4,active:j===v.selectedData&&e===v.currentFacet,fixed:v.fixed,onClose:v.onClose,container:h})]},$)})})}function TK(e,t,n,r){let a=t.reduce((i,o,s)=>(i[o]=s,i),{});return e.filter(([,i])=>r?i<=n.one:!0).sort(([[i,o]],[[s,c]])=>i!==o?a[o]-a[i]:a[c]-a[s])}function fyt(e,t){let n=t.reduce((a,i,o)=>(a[i]=o,a),{}),r=[];return e.map(([[a,i]])=>{let o=n[a],s=n[i];for(let c=0;c<r.length;c++)if(r[c]<o)return r[c]=s,c;return r.push(s),r.length-1})}function kK(e,t,n,r){let a=t.reduce((o,s,c)=>(o[s]=c,o),{}),i=[];return TK(e,t,n,!r).forEach(([[o,s]])=>{let c=a[o],f=a[s];for(let A=0;A<i.length;A++)if(i[A]<c){i[A]=f;return}i.push(f)}),i.length}var dyt={ttest:"TTest",anova:"ANOVA",kruskalWallis:"Kruskal-Wallis",wilcoxon:"Wilcoxon"};function Ayt(e,t){return e<=t.three?"***":e<=t.two?"**":e<=t.one?"*":"ns"}function HM(e,t,n,r){return!r&&e>n.one?"":t==="significance"?Ayt(e,n):Ka(e)}var m3=18,DM=12;function hyt({orientation:e,scales:t,testMethod:n,values:r,statType:a,format:i,ns:o,significanceLevels:s,yShift:c}){if(!r.length)return null;let f=E=>(t.xPrimary(E)??0)+t.xPrimary.bandwidth()/2,A=e==="vertical",h=Math.abs(t.xPrimary.range()[1]-t.xPrimary.range()[0]),v=Math.abs(t.y.range()[1]-t.y.range()[0]),g=t.xPrimary.domain(),C=a==="pairwise"?TK(r,g,s,!o):r,b=a==="pairwise"?fyt(C,g):[],B=Math.max(...b);return ie.jsxs("g",{fontSize:"14px",transform:A?`translate(0,${c})`:`translate(${v-c},0)`,children:[a==="overall"&&ie.jsx("text",{x:A?h/2:-m3,y:A?m3:h/2,transform:A?"":`rotate(90,${-m3},${h/2})`,textAnchor:"middle",children:`${dyt[n]}, p = ${HM(r[0][1],"pValue",s,!0)}`}),a==="referenceGroup"&&ie.jsx("g",{children:r.map(([[E],k])=>ie.jsx("text",{x:A?f(E):-m3,y:A?m3:f(E),transform:A?"":`rotate(90,${-m3},${f(E)})`,textAnchor:"middle",children:HM(k,i,s,o)},E))}),a==="pairwise"&&ie.jsx("g",{children:C.map(([[E,k],P],I)=>{let $=f(E),z=f(k),O=($+z)/2;return ie.jsxs("g",{transform:A?`translate(0,${(B-b[I])*p3})`:`translate(${-(B-b[I])*p3},0)`,children:[ie.jsx("text",{x:A?O:-DM,y:A?DM:O,transform:A?"":`rotate(90,${-DM},${O})`,textAnchor:"middle",children:HM(P,i,s,o)}),ie.jsx("path",{d:A?`M ${$},21 v-4 h ${z-$} v4`:`M -21,${$} h 4 v ${z-$} h-4`,fill:"none",stroke:Vt})]},`${E}_${k}`)})})]})}function pyt(e){return`translate(${e},0)`}function vyt(e){return`translate(0,${e})`}function myt(e){return e==="bottom"?`translate(0,${zf})`:`translate(${-zf},0)`}function gyt(e){return e==="bottom"?"hanging":"central"}function yyt(e){return e==="bottom"?"middle":"end"}var MK=({scale:e,tickSize:t=6,tickPadding:n=zf,orient:r="bottom",onlyPositive:a=!1,offset:i=typeof window<"u"&&window.devicePixelRatio>1?0:.5,hiddenLabels:o=!1})=>{function s(P){return I=>{let $=P(I);return $===void 0?0:+$}}let c=Math.abs(e.range()[0]-e.range()[1]),f=Math.min(Math.floor(c/bK),10),A=o?[]:e.ticks(f).filter(P=>a&&P>=0||!a),h=A.some(P=>Math.abs(P)<1e-4&&P!==0||P>1e4)?",e":",f",v=P=>e.tickFormat(f,h)(P),g=Math.max(t,0)+n,C=s(e.copy()),b=r==="bottom"?pyt:vyt,B=r==="left"?-1:1,E={[(r==="left"?"x":"y")+"2"]:B*t},k={[r==="left"?"x":"y"]:B*g};return ie.jsx("g",{children:A.map((P,I)=>ie.jsxs("g",{className:"tick",transform:b(C(P)+i),children:[ie.jsx("line",{stroke:Vt,...E}),ie.jsx("g",{transform:myt(r),children:ie.jsx("text",{fill:Vt,fontSize:"14px",fontWeight:"500",fontFamily:"Manrope",dominantBaseline:gyt(r),textAnchor:yyt(r),...k,children:v(P)})})]},I))})};function PK(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r.primaryGrouping)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(r.secondaryGrouping)[t]}return n}function wyt({facetKey:e,scales:t,orientation:n,violin:r,aes:a,maxViolinDensity:i,showTooltips:o,sideDistances:s,elementsAmount:c,activeElementContainer:f,tooltipsContainer:A,tooltipsData:h}){let v=n==="vertical",g=(t.xPrimary(r.primaryGrouping)??0)+(t.xSecondary(r.secondaryGrouping)??0)+t.xSecondary.bandwidth()/2,C=t.xSecondary.bandwidth(),b=a.width==="auto"?C*.8:Math.min(C,a.width),B=PK(t,"lineColor",a.lineColor,r),E=PK(t,"fillColor",a.fillColor,r),k=r.getArea(n,t.y,b,i)??"",P=r.getLine(n,t.y,b,i)??"",I=Math.abs(t.y.range()[0]-t.y.range()[1]),$=f&&h.fixed,z=h.selectedData===r&&$,O=ie.jsxs("g",{transform:v?`translate(${g},0)`:`translate(0, ${g})`,opacity:a.opacity,stroke:B,fill:E,strokeWidth:a.lineWidth,strokeDasharray:Of(a.lineShape),children:[ie.jsx("clipPath",{id:`violin_${r.key}`,children:ie.jsx("path",{d:k})}),ie.jsx("path",{d:k,stroke:"none"}),a.showQuartiles&&ie.jsxs("g",{clipPath:`url(#violin_${r.key})`,strokeWidth:a.lineWidth,stroke:B,children:[ie.jsx("line",{x1:v?-b/2:t.y(r.quartiles.q1),x2:v?b/2:t.y(r.quartiles.q1),y1:v?t.y(r.quartiles.q1):-b/2,y2:v?t.y(r.quartiles.q1):b/2,strokeDasharray:Of(a.quartilesLineStyle)}),ie.jsx("line",{x1:v?-b/2:t.y(r.quartiles.q2),x2:v?b/2:t.y(r.quartiles.q2),y1:v?t.y(r.quartiles.q2):-b/2,y2:v?t.y(r.quartiles.q2):b/2,strokeDasharray:Of(a.medianLineStyle)}),ie.jsx("line",{x1:v?-b/2:t.y(r.quartiles.q3),x2:v?b/2:t.y(r.quartiles.q3),y1:v?t.y(r.quartiles.q3):-b/2,y2:v?t.y(r.quartiles.q3):b/2,strokeDasharray:Of(a.quartilesLineStyle)})]}),ie.jsx("path",{d:P,fill:"none"}),o&&A&&ie.jsx("rect",{onMouseOver:()=>h.onMouseOver(r,e),onMouseLeave:h.onMouseLeave,width:v?C:I,x:v?-C/2:0,y:v?0:-C/2,height:v?I:C,fill:"transparent",stroke:"none"}),o&&ie.jsx(fu,{content:[`Quartile 3 = ${Ka(r.quartiles.q3)}`,`Median = ${Ka(r.quartiles.q2)}`,`Quartile 1 = ${Ka(r.quartiles.q1)}`],x:v?g:t.y(r.quartiles.q2),y:v?t.y(r.quartiles.q2):g,sideDistances:s,horizontal:v,active:h.active&&h.selectedData===r&&h.currentFacet===e,fixed:h.fixed,offset:c>1?b/2:b/4,onClose:h.onClose,container:A})]});return z?cu.createPortal(O,f):O}var byt=1;function Cyt({scaleX:e,scaleY:t,orientation:n,width:r,height:a,axisX:i,axisY:o,frameType:s}){let[c,f]=tn.useState(e.domain()),A=Math.abs(t.range()[0]-t.range()[1]),h=Math.min(Math.floor(A/bK),10),[v,g]=tn.useState(t.ticks(h)),C=e.bandwidth()/2,b=k=>(e(k)??0)+C,B=k=>t(k),E=n==="vertical";return tn.useEffect(()=>{let k=e.domain(),P=t.ticks(h);f(k),g(P)},[e,t]),ie.jsxs("g",{stroke:Nf,children:[i.showGrid&&c.map(k=>{let P=b(k)+(i.linesBetweenCategories?C:0);return ie.jsx("line",{x1:E?P:0,x2:E?P:r,y1:E?0:P,y2:E?a:P},`x_${k}`)}),o.showGrid&&v.map(k=>{let P=B(k);return ie.jsx("line",{x1:E?0:P,x2:E?r:P,y1:E?P:0,y2:E?P:a},`y_${k}`)}),s!=="empty"&&ie.jsxs("g",{strokeWidth:byt,children:[(i.showGrid||s!=="left")&&ie.jsx("line",{stroke:s==="left"?Nf:Vt,x1:"0",x2:r,y1:a,y2:a}),(i.showGrid||s!=="bottom")&&ie.jsx("line",{stroke:s==="bottom"?Nf:Vt,x1:"0",x2:"0",y1:"0",y2:a}),(i.showGrid||s==="full")&&ie.jsx("line",{stroke:s==="full"?Vt:Nf,x1:r,x2:r,y1:"0",y2:a}),(o.showGrid||s==="full")&&ie.jsx("line",{stroke:s==="full"?Vt:Nf,x1:"0",x2:r,y1:"0",y2:"0"})]})]})}function Syt(e,t,n){if(!e.length)return[];let r=[0];for(let a=0;a<e.length-1;a++){let i=e[a];if(i.meta.statType==="pairwise"){let o=kK(i.values[n],t,i.meta.significanceLevels,i.meta.ns);r.push(r[r.length-1]+p3*o)}else r.push(r[r.length-1]+p3)}return r}function HK(e){return typeof e=="string"?e:e.value}function xyt({facetSettings:e,facetTitle:t,dimensions:n,scales:r,orientation:a,layersData:i,statsData:o,facetKey:s,xAxis:c,yAxis:f,frameType:A,tooltips:h,tooltipsContainer:v,keyColumn:g,chartSizes:C,margins:b,xLabels:B,onlyPositive:E,secondaryGrouping:k,tooltipsData:P}){let[I,$]=tn.useState(),z=a==="vertical",O=Syt(o,r.xPrimary.domain(),s),K=c.showTicks?yK:0,te=f.showTicks?yK:0,le=HK(c.title),G=HK(f.title),Q=n.chartEdgeSides.includes("left")||z&&!(e!=null&&e.sharedY)||!z&&!(e!=null&&e.sharedX),j=n.chartEdgeSides.includes("bottom")||z&&!(e!=null&&e.sharedX)||!z&&!(e!=null&&e.sharedY),Y=n.chartEdgeSides.includes("left"),X=n.chartEdgeSides.includes("bottom"),{width:ee,height:pe}=n.inner,{left:ae,top:ge,padding:me}=n,fe={left:b.left+ae+me.left,right:C.totalWidth-(b.left+ae+me.left),top:b.top+ge+me.top,bottom:C.totalHeight-(b.top+ge+me.top)},Ce=`translate(${ae+me.left},${ge+me.top})`,De=!1;return ie.jsxs("g",{transform:Ce,children:[De,t.length&&ie.jsxs("g",{children:[A==="full"&&ie.jsx("rect",{x:"0",y:-me.top,height:me.top,width:ee,fill:"#F7F8FA",stroke:Vt}),t.map((ke,$e)=>{let je=t.length,Oe=(me.top-x9*je)/2;return ie.jsx("text",{fontSize:"14px",fontWeight:"500",fill:Vt,x:ee/2,dy:Oe+x9/2-me.top,y:$e*x9,textAnchor:"middle",dominantBaseline:"central",children:ke},$e)})]}),ie.jsxs("g",{dominantBaseline:"central",textAnchor:"middle",fontWeight:"500",fontSize:"14px",fill:Vt,children:[X&&ie.jsx("text",{x:ee/2,y:pe+me.bottom-dp/2,children:z?le:G}),X&&De&&ie.jsx("rect",{x:"0",y:pe+me.bottom-dp,width:ee,height:dp,fill:"none",stroke:"black"}),Y&&ie.jsx("text",{x:-me.left+dp/2,y:pe/2,transform:`rotate(-90,${-me.left+dp/2},${pe/2})`,children:z?G:le}),Y&&De&&ie.jsx("rect",{x:-me.left,y:"0",width:dp,height:pe,fill:"none",stroke:"black"})]}),ie.jsx(Cyt,{orientation:a,width:ee,height:pe,scaleX:r.xPrimary,scaleY:r.y,axisX:c,axisY:f,frameType:A}),j&&ie.jsx("g",{transform:`translate(0,${pe})`,children:z?ie.jsx(CK,{scale:r.xPrimary,orient:"bottom",labelsPosition:c.labelsPosition,tickSize:K,labels:B}):ie.jsx(MK,{scale:r.y,onlyPositive:E,orient:"bottom",tickSize:te,hiddenLabels:f.hiddenLabels})}),Q&&ie.jsx("g",{children:z?ie.jsx(MK,{scale:r.y,onlyPositive:E,orient:"left",tickSize:te,hiddenLabels:f.hiddenLabels}):ie.jsx(CK,{scale:r.xPrimary,orient:"left",labelsPosition:c.labelsPosition,tickSize:K,labels:B})}),ie.jsxs("g",{children:[i.map(ke=>ie.jsxs("g",{children:[ke.type==="box"&&ke.geoms[s].map($e=>ie.jsx(Z4t,{facetKey:s,box:$e,elementsAmount:ke.geoms[s].length,scales:r,orientation:a,aes:ke.aes,hasKeyFromColumn:g!==null,sideDistances:fe,showTooltips:h.box.show,tooltipsData:P,activeElementContainer:I,tooltipsContainer:v},$e.key)),ke.type==="violin"&&ke.geoms[s].map($e=>ie.jsx(wyt,{facetKey:s,violin:$e,elementsAmount:ke.geoms[s].length,scales:r,orientation:a,maxViolinDensity:ke.meta.maxDensity,aes:ke.aes,sideDistances:fe,showTooltips:h.violin.show,tooltipsData:P,activeElementContainer:I,tooltipsContainer:v},$e.key)),ke.type==="dot"&&ke.geoms[s].map($e=>ie.jsx(q4t,{facetKey:s,geom:$e,scales:r,orientation:a,aes:ke.aes,hasKeyFromColumn:g!==null,sideDistances:fe,showTooltips:h.dot.show,tooltipsData:P,activeElementContainer:I,tooltipsContainer:v},$e.key)),ke.type==="line"&&ke.geoms[s].map($e=>ie.jsx(ryt,{facetKey:s,line:$e,scales:r,orientation:a,sideDistances:fe,aes:ke.aes,showTooltips:h.line.show,secondaryGrouping:k,tooltipsData:P,activeElementContainer:I,tooltipsContainer:v},$e.key)),ke.type==="errorbar"&&ke.geoms[s].map($e=>ie.jsx(eyt,{facetKey:s,errorBar:$e,scales:r,orientation:a,aes:ke.aes,sideDistances:fe,showTooltips:h.errorBar.show,tooltipsData:P,activeElementContainer:I,tooltipsContainer:v},$e.key)),ke.type==="bar"&&ke.geoms[s].map($e=>ie.jsx(W4t,{bar:$e,scales:r,orientation:a,aes:ke.aes},$e.key)),ke.type==="stackedBar"&&ke.geoms[s].map($e=>ie.jsx(cyt,{facetKey:s,geom:$e,elementsAmount:ke.geoms[s].length,scales:r,orientation:a,aes:ke.aes,normalize:ke.meta.normalize,sideDistances:fe,showTooltips:h.stackedBar.show,secondaryGrouping:k,tooltipsData:P,activeElementContainer:I,tooltipsContainer:v},$e.key)),ke.type==="binnedDots"&&ke.geoms[s].map($e=>ie.jsx(X4t,{facetKey:s,geom:$e,scales:r,orientation:a,aes:ke.aes,binsCount:ke.meta.binsCount,min:ke.meta.minY,max:ke.meta.maxY,hasKeyFromColumn:ke.meta.hasKeyFromColumn,sideDistances:fe,showTooltips:h.stackedBar.show,tooltipsData:P,activeElementContainer:I,tooltipsContainer:v},$e.key)),ke.type==="pairedPoints"&&ke.geoms[s].map($e=>ie.jsx(oyt,{facetKey:s,geom:$e,scales:r,orientation:a,sideDistances:fe,aes:ke.aes,showTooltips:h.pairedPoints.show,tooltipsData:P,activeElementContainer:I,tooltipsContainer:v},$e.id)),ke.type==="sina"&&ke.geoms[s].map($e=>ie.jsx(syt,{geom:$e,scales:r,orientation:a,sideDistances:fe,aes:ke.aes,hasKeyFromColumn:g!==null,showTooltips:!1,tooltipsContainer:v},$e.key)),ke.type==="logo"&&ke.geoms[s].map($e=>ie.jsx(iyt,{facetKey:s,geom:$e,elementsAmount:ke.geoms[s].length,scales:r,orientation:a,aes:ke.aes,normalize:ke.meta.normalize,sideDistances:fe,showTooltips:h.logo.show,tooltipsData:P,activeElementContainer:I,tooltipsContainer:v},$e.key))]},ke.type)),o.map((ke,$e)=>ie.jsx(hyt,{yShift:O[$e],scales:r,orientation:a,statType:ke.meta.statType,values:ke.values[s],testMethod:ke.meta.testMethod,format:ke.meta.format,ns:ke.meta.ns,significanceLevels:ke.meta.significanceLevels},`${ke.meta.statType}_${ke.meta.testMethod}`))]}),ie.jsxs("g",{children:[P.fixed&&ie.jsx("rect",{width:C.chartWidth,height:C.chartHeight,fill:"rgba(255, 255, 255, 0.8)"}),ie.jsx("g",{ref:ke=>{ke&&!I&&$(ke)}})]})]})}var g3=class extends T8.Component{constructor(e){super(e),this.state={hasError:!1,message:""}}static getDerivedStateFromError(e){return{hasError:!0,message:e.message}}componentDidUpdate(e){e.dataId!==this.props.dataId&&this.setState({hasError:!1,message:"error.message"})}componentDidCatch(e,t){console.log(t)}render(){return this.state.hasError?ie.jsx(Xv,{message:this.state.message}):this.props.children}};function Eyt(e,t,n,r){return e==="left"?n:e==="right"?t-r:(t-(n+r))/2+n}function Byt(e){return e==="left"?"start":e==="right"?"end":"middle"}function y3({show:e,position:t,title:n,chartsWidth:r,leftPadding:a,rightPadding:i}){return e?ie.jsx("g",{children:n.map((o,s)=>ie.jsx("text",{x:Eyt(t,r,a,i),textAnchor:Byt(t),y:-(n.length-s-1)*24-24-24/2,fontSize:"20px",fontFamily:"Manrope",fontWeight:"500",dominantBaseline:"central",children:o},`${o}_${s}`))}):null}var pc=12,B9=-12,DK=14;function _yt(e=null){return e==="dashed"?"M1 11.25H6V12.75H1V11.25ZM9.5 11.25H14.5V12.75H9.5V11.25ZM18 11.25H23V12.75H18V11.25Z":e==="dotted"?"M2.75 11.25H1.25V12.75H2.75V11.25Z M11.25 11.25H12.75V12.75H11.25V11.25Z M22.75 11.25H21.25V12.75H22.75V11.25Z M7.75 11.25H6.25V12.75H7.75V11.25Z M16.25 11.25H17.75V12.75H16.25V11.25Z":e==="longdash"?"M1 11.25H10V12.75H1V11.25ZM14 11.25H23V12.75H14V11.25Z":e==="dotdash"?"M1 11.25H2.5V12.75H1V11.25ZM17 12.75H7V11.25H17V12.75ZM21.5 12.75V11.25H23V12.75H21.5Z":e==="twodash"?"M1 11.25H4V12.75H1V11.25ZM17.0261 12.75H7V11.25H17.0261V12.75ZM20 12.75V11.25H23V12.75H20Z":"M1 11.25H23V12.75H1V11.25Z"}var Tyt=3,kyt=24;function Myt(e,t){if(e==="transparent")return Vt;let n=lv(e??t??"");return n&&n.formatHex()==="#ffffff"?Vt:e??t}function Pyt({aes:e,label:t,usedAes:n}){let r=n.lineShape,a=n.dotShape,i=n.fillColor||n.lineColor&&!n.lineShape||n.dotFill&&!n.dotShape,o=a?Yc(e.dotShape??"21",Tyt,i?Vt:e.dotFill??Vt):null,s=(a&&r?2*pc:0)-6,c=r?s+kyt+8:pc+8;return ie.jsxs("g",{children:[i&&ie.jsx("rect",{width:pc,height:pc,stroke:Myt(e.fillColor,e.lineColor),fill:e.fillColor??e.lineColor,rx:"1",ry:"1"}),a&&ie.jsx("g",{transform:`translate(${pc/2},${pc/2})`,children:o}),r&&ie.jsx("path",{transform:`translate(${s},-5)`,fillRule:"evenodd",clipRule:"evenodd",d:_yt(e.lineShape),fill:e.lineColor}),ie.jsx("text",{x:c,y:pc/2,dominantBaseline:"central",fontWeight:500,children:t})]})}function Hyt({aes:e,label:t}){let n=Yc(e.shape,e.size,e.color);return ie.jsxs("g",{children:[ie.jsx("g",{transform:`translate(${pc/2},${pc/2})`,children:n}),ie.jsx("text",{x:pc+8,y:pc/2,dominantBaseline:"central",fontWeight:500,children:t})]})}function w3({legendData:e}){let t=e.items.filter(n=>n.type==="continuous");return ie.jsxs("g",{children:[ie.jsx("defs",{children:t.map(n=>ie.jsx("linearGradient",{id:n.id,gradientTransform:"rotate(90)",children:n.scale.domain().reverse().map(r=>{let a=n.scale.domain(),i=a[a.length-1]-a[0],o=i>0?100-(r-a[0])/i*100:0;return ie.jsx("stop",{offset:`${o}%`,stopColor:n.scale(r)},r)})},n.id))}),e.items.map(n=>{if(n.type==="continuous")return ie.jsxs("g",{transform:`translate(${n.left},${n.top})`,children:[ie.jsx("text",{fontWeight:500,fontSize:"14px",y:B9,children:n.title}),ie.jsx("rect",{x:"0",y:"0",width:DK,height:n.height,stroke:Vt,fill:`url(#${n.id})`}),ie.jsx("g",{transform:`translate(${DK},0)`,children:n.values.map(r=>{let a=n.tickPositionScale(r)??0;return ie.jsxs("g",{transform:`translate(0,${a})`,children:[ie.jsx("line",{x1:"0",x2:-4,stroke:Vt}),ie.jsx("text",{x:8,y:4,children:r})]},r)})}),!1]},n.id);if(n.type==="discreteColor")return ie.jsxs("g",{transform:`translate(${n.left},${n.top})`,children:[ie.jsx("text",{fontWeight:500,fontSize:"14px",y:B9,children:n.title}),n.values.map((r,a)=>ie.jsxs("g",{transform:`translate(0, ${a*(pc+4)})`,children:[ie.jsx("rect",{x:"0",y:"0",width:pc,height:pc,fill:n.scale(r),rx:"1",ry:"1",stroke:Vt}),ie.jsx("text",{x:pc+8,y:10,children:n.labels[r]??r})]},r)),!1]},n.id);if(n.type==="discreteMulti")return ie.jsxs("g",{transform:`translate(${n.left},${n.top})`,fontSize:"14px",fontWeight:500,children:[ie.jsx("text",{fontWeight:600,y:B9,children:n.title}),n.values.map((r,a)=>ie.jsx("g",{transform:`translate(0, ${a*(pc+4)})`,children:ie.jsx(Pyt,{aes:n.scale(r),label:n.labels[r],usedAes:n.usedAes})},r)),!1]},n.id);if(n.type==="dots")return ie.jsxs("g",{transform:`translate(${n.left},${n.top})`,fontSize:"14px",fontWeight:500,children:[ie.jsx("text",{fontWeight:500,y:B9,children:n.title}),n.values.map((r,a)=>ie.jsx("g",{transform:`translate(0, ${a*(pc+4)})`,children:ie.jsx(Hyt,{aes:n.scale(r),label:n.labels[r]})},r)),!1]},n.id);if(n.type==="size"){let r=n.height/n.values.length;return ie.jsxs("g",{transform:`translate(${n.left},${n.top})`,fontSize:"14px",fontWeight:500,children:[ie.jsx("text",{fontWeight:500,y:B9,children:n.title}),n.values.map((a,i)=>{let o=n.scale(a);return ie.jsxs("g",{transform:`translate(0, ${i*r})`,children:[ie.jsx("circle",{r:o,cx:r/2,cy:r/2,fill:Vt}),ie.jsx("text",{x:r+4,y:r/2,alignmentBaseline:"central",children:n.labels[a]})]},a)}),!1]},n.id)}})]})}function Dyt({settingsId:e,chartSettings:t,chartSizes:n,chartsDimensions:r,facetKeys:a,facetTitles:i,facetSettings:o,scales:s,layersData:c,statsData:f,legendData:A,margins:h,columnsCount:v,keyColumn:g,xLabels:C,chartTitle:b,onlyPositive:B,secondaryGrouping:E,onTooltipHintSwitch:k}){let[P,I]=tn.useState(),$=h3(k),{orientation:z,xAxis:O,yAxis:K,title:te,legend:le,frame:G}=t,Q=r[a[0]].padding,j=r[a[v-1]].padding,Y=n.chartsWidth+wK,X=Q.top;return ie.jsx(g3,{dataId:e,children:ie.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${n.totalWidth} ${n.totalHeight}`,width:n.totalWidth,height:n.totalHeight,children:[ie.jsx("defs",{children:Qm}),ie.jsxs("g",{transform:`translate(${h.left},${h.top})`,fontFamily:"Manrope",children:[ie.jsx(y3,{title:b,show:te.show,position:te.position,leftPadding:Q.left,rightPadding:j.right,chartsWidth:n.chartsWidth}),a.map(ee=>ie.jsx(xyt,{facetKey:ee,facetTitle:i[ee],facetSettings:o,orientation:z,scales:{...s,xPrimary:s.xPrimary[ee],xSecondary:s.xSecondary[ee],y:s.y[ee]},chartSizes:n,margins:h,dimensions:r[ee],layersData:c,statsData:f,xAxis:O,yAxis:K,frameType:G.type,tooltips:t.tooltips,tooltipsContainer:P,keyColumn:g,xLabels:C[ee],onlyPositive:B,secondaryGrouping:E,tooltipsData:$},ee)),le.show&&ie.jsx("g",{transform:`translate(${Y},${X})`,children:ie.jsx(w3,{legendData:A})})]}),ie.jsx("g",{style:{outline:"none"},ref:ee=>{ee&&!P&&I(ee)}})]})})}function $K(e,t,n){let r=Object.keys(e.values),a=e.length?e.reduce((i,o)=>{if(o.meta.statType==="pairwise"){let s=Object.values(o.values).map(c=>kK(c,t,o.meta.significanceLevels,o.meta.ns));return i+p3*Math.max(...s)}return(o.meta.ns?t.length>0:r.some(s=>o.values[s].some(([,c])=>c<o.meta.significanceLevels.one)))?i+p3:i},F4t):0;return Math.max(n,a)}function b3(e,t,n=r=>r){let r=A=>t==="log"?Math.log10(A):A,a=A=>t==="log"?Math.pow(10,A):A,i=e.map(n).map(r).sort((A,h)=>A-h),o=D0(i,.25),s=D0(i,.75),c=s-o,f=1.5;return[a(o-f*c),a(s+f*c)]}function $yt(e,t,n,r=14){let a=new hc(`600 ${r}px Manrope`),i=[];e.split(new RegExp("(?=[_-])|(?<=[_-])")).forEach(h=>{a.getTextWidth(h)>n?i.push(...h.split("")):i.push(h)});let o="",s=0,c=0,f="";for(;s<=t;){let h=a.getTextWidth(o+i[c]);h<t&&(o+=i[c],f=o,c++),s=h}o="",s=0;let A=[];for(c;c<i.length;c++){let h=a.getTextWidth(o+i[c]);h<n?(o+=i[c],s=h):(A.push(o),o=i[c],s=a.getTextWidth(i[c]))}return{firstPart:f,lines:A,lastPart:o,lastPartLength:s}}function Kv(e,t,n){let r=new hc(`600 ${n}px Manrope`);if(e.trim()==="")return[];if(r.getTextWidth(e)<=t)return[e];let a=e.split(/\s+/),i=[],o="",s=0;for(let c=0;c<a.length;c++){let f=`${o} ${a[c]}`,A=r.getTextWidth(f);if(A<=t)o=f,s=A;else{let h=r.getTextWidth(a[c]);if(h>t){let{firstPart:v,lines:g,lastPart:C,lastPartLength:b}=$yt(a[c],t-s,t,n);i.push(`${o} ${v}`),i.push(...g),o=C,s=b}else i.push(o),o=a[c],s=h}}return i.push(o),i.filter(c=>c.length>0)}var IK=new hc("600 14px Manrope"),Iyt=16,$M=48,Lyt=20,jm=24;function IM(e,t){return Math.max(...e.map(n=>IK.getTextWidth(String(n))+Lyt),IK.getTextWidth(t))}function Ryt(e,t,n,r){let a=[[]],i=0,o=t,s=0;return e.forEach(c=>{i+r<=o?(a[s].push(c),i+=r):(a.push([c]),s++,i=r,o=n)}),a}function C3(e,t,n){let r=n??t,a=0,i=0,o=0;e.sort((c,f)=>c.type==="continuous"&&f.type!=="continuous"?-1:f.type==="continuous"&&c.type!=="continuous"?1:c.type==="dots"&&f.type!=="dots"?-1:f.type==="dots"&&c.type!=="dots"?1:0);let s=[];return e.forEach(c=>{let{type:f,values:A,title:h,id:v,scale:g}=c;if(f==="continuous"){let C=oK(A,h),b=r;t-i<b&&(o+=a+jm,a=0,i=0);let B=o,E=i;C>a&&(a=C),i+=b+$M,i>=t&&(o+=a+jm,a=0,i=0),s.push({...c,width:C,height:b,left:B,top:E})}else if(f==="size"){let{labels:C}=c,b=g(Math.max(...A))*2+4,B=IM(A.map(I=>C[I]),h),E=A.length*b;t-i<E&&(o+=a+jm,a=0,i=0);let k=o,P=i;B>a&&(a=B),i+=E+$M,i>=t&&(o+=a+jm,a=0,i=0),s.push({...c,width:B,height:E,left:k,top:P})}else{let{labels:C}=c,b=Iyt,B=t-i;B<b&&(B=t,o+=a+jm,a=0,i=0);let E=Ryt(A,B,t,b),k=IM([],h),P=a===0,I=o+k+jm;E.forEach(($,z)=>{let O=z===E.length-1,K=z>0?"":h,te=z>0?`${v}_${z}`:v,le=IM($.map(Y=>C[Y]),P&&!O?"":K),G=$.length*b,Q=o,j=i;le>a&&(a=le),O?i+=G+$M:i=t,i>=t&&(o+=a+jm,P&&O&&o<I&&(o=I),a=0,i=0),s.push({...c,id:te,title:K,width:le,height:G,left:Q,top:j,values:$})})}}),s}function Vyt(e,t,n,r){let a=[];return e%n===n-1&&a.push("right"),e%n===0&&a.push("left"),e<n&&a.push("top"),(Math.ceil((e+1)/n)===r||Math.ceil((e+1)/n)===r-1&&e%n>(t-1)%n)&&a.push("bottom"),a}function Nyt(e,t,n,r,a,i,o,s,c,f,A){let h=e==="vertical",v=o.includes("left")||h&&!(s!=null&&s.sharedY)||!h&&!(s!=null&&s.sharedX),g=o.includes("left")&&n.title!=="",C=o.includes("bottom")||h&&!(s!=null&&s.sharedX)||!h&&!(s!=null&&s.sharedY),b=o.includes("bottom")&&t.title!=="",B=r.yAxisCaptionsWidth,E=(n.showTicks?c3:0)+(n.hiddenLabels?0:zf),k=g?dp:0,P=r.xAxisCaptionsWidthByRows[h?c:f],I=(t.showTicks?c3:0)+(t.hiddenLabels?0:zf),$=b?dp:0,z=h?B+E+k:P+I+$,O=h?I+P+$:E+2*dp,K=Math.max(...a.map(te=>i[te].length));return{left:v?z:TM,top:K===0?0:z4t*2+K*x9,bottom:C?O:TM,right:A?0:TM}}function zyt(e,t,n){let r=new Array(n).fill(null).map(()=>[]);for(let a=0;a<n;a++)for(let i=0;i<t;i++)i*n+a<e.length&&r[a].push(e[i*n+a]);return r}function LK(e,t,n){let r=[];for(let a=0;a<t;a++)r.push(e.slice(a*n,a*n+n));return r}function Oyt(e,t){let n=Math.floor(e/t),r=e-n*t;return[n,r]}function Fyt(e){return typeof e=="object"&&"type"in e}var Qyt=class{constructor(){Be(this,"reactRoot",null);Be(this,"parentNode",null);Be(this,"rootNode",null);Be(this,"component",ie.jsx(ie.Fragment,{}));Be(this,"chartsDimensions",{});Be(this,"chartSizes",{chartWidth:600,chartHeight:350,chartsWidth:600,chartsHeight:350,totalWidth:600,totalHeight:350});Be(this,"columnsCount",1);Be(this,"rowsCount",1);Be(this,"scales",{xPrimary:{null:K4().range([0,600]).domain(["1"])},xSecondary:{null:K4().range([0,600]).domain(["1"])},y:{null:Zr().domain([0,10]).range([350,0]).nice()},xPrimaryAes:Qo().unknown(gK),xSecondaryAes:Qo().unknown(gK)});Be(this,"facetTitles",{});Be(this,"mainTitle",[]);Be(this,"axisLabelsX",{});Be(this,"captionsSizes",{xAxisCaptionsWidthByRows:[],xCaptionsTail:0,yAxisCaptionsWidth:100});Be(this,"legend",{width:0,height:0,items:[]});Be(this,"margins",{left:0,right:0,top:0,bottom:0})}clear(){var e;this.parentNode&&this.rootNode&&((e=this.parentNode)==null||e.removeChild(this.rootNode),this.parentNode=null,this.rootNode=null),setTimeout(()=>{var t;(t=this.reactRoot)==null||t.unmount(),this.reactRoot=null})}init(e){this.parentNode===null&&(this.parentNode=e,this.rootNode=document.createElement("div"),this.parentNode.appendChild(this.rootNode),this.reactRoot=Wh(this.rootNode))}updateChartSize(e,t,n,r,a,i){let o=e.innerOffset,s=e.innerOffset,c=$K(i,r,e.innerOffset),f=t.length,A=Math.min((n==null?void 0:n.nRows)??f,f),h=Math.min((n==null?void 0:n.nCols)??f,f);this.columnsCount=n!=null&&n.nRows?Math.ceil(f/A):h,this.rowsCount=Math.ceil(f/this.columnsCount);let{width:v,height:g}=e;a==="vertical"&&c>o&&(g+=c),a==="horizontal"&&c>s&&(v+=c),this.chartSizes.chartWidth=v,this.chartSizes.chartHeight=g}updateChartDimensions(e,t,n,r,a){let{chartWidth:i,chartHeight:o}=this.chartSizes,s=0,c=0;this.chartsDimensions=e.reduce((h,v,g)=>{let[C,b]=Oyt(g,this.columnsCount),B=Vyt(g,e.length,this.columnsCount,this.rowsCount),E=Nyt(n,r,a,this.captionsSizes,LK(e,this.rowsCount,this.columnsCount)[C],this.facetTitles,B,t,C,b,b===this.columnsCount-1),k=i+E.left+E.right,P=o+E.top+E.bottom;return h[v]={left:s,top:c,chartEdgeSides:B,padding:E,inner:{width:i,height:o},outer:{width:k,height:P}},s+=k,b===this.columnsCount-1&&(s=0,c+=P),h},{});let f=Math.max(...e.map(h=>this.chartsDimensions[h].outer.width+this.chartsDimensions[h].left)),A=Math.max(...e.map(h=>this.chartsDimensions[h].outer.height+this.chartsDimensions[h].top));this.chartSizes.chartsWidth=f,this.chartSizes.chartsHeight=A}updateViewport(e,t,n,r,a,i,o,s,c,f){let A=c.innerOffset,h=e==="vertical",v=$K(s,t,c.innerOffset),g=a===null||a.sharedX,C=a===null||a.sharedY,{chartHeight:b,chartWidth:B}=this.chartSizes;r.forEach(E=>{let k=i.scale==="log"?X2():Zr(),P=Math.min(...C?o.map(({meta:O})=>O.minY):o.map(({geoms:O})=>Math.min(...O[E].map(({boundsY:K})=>K.min)))),I=Math.max(...C?o.map(({meta:O})=>O.maxY):o.map(({geoms:O})=>Math.max(...O[E].map(({boundsY:K})=>K.max)))),$=k.copy().domain([P,I]).range(h?[b-A,v]:[A,B-v]);k.domain([$.invert(h?b:0),$.invert(h?0:B)]).range(h?[b,0]:[0,B]),this.scales.y[E]=k;let z=g?t:f[E];this.scales.xPrimary[E]=K4().domain(z).range(h?[0,B]:[b,0]),this.scales.xSecondary[E]=K4().domain(n).range([0,this.scales.xPrimary[E].bandwidth()])})}createFacetTitles(e,t){this.facetTitles=e.reduce((n,r,a)=>(t[a].length===1&&t[a][0]==="null"?n[r]=[]:n[r]=Kv(t[a].join(", "),this.chartSizes.chartWidth,14),n),{})}createMainTitle(e,t){let n=this.chartsDimensions[e[0]],r=this.chartsDimensions[e[e.length-1]];this.mainTitle=Kv(t.name,this.chartSizes.chartsWidth-n.padding.left-r.padding.right,20)}createAxisLabels(e,t,n,r){let a={center:120,"45deg":256,"90deg":320},i=r==="vertical";function o(s,c){return s==="center"?1/0:Math.floor(s==="45deg"?c*Math.sin(Math.PI/4)/kM:c/kM)}this.axisLabelsX=e.reduce((s,c)=>{let f=this.scales.xPrimary[c],A=f.bandwidth(),h=a[t.labelsPosition],v=t.labelsPosition==="center"?Math.min(h,A):h,g=n.valueLabels;return s[c]=f.domain().reduce((C,b)=>{if(t.hiddenLabels)return C[b]=[],C;let B=g[b];if(!i)C[b]=[B];else{let E=o(t.labelsPosition,A),k=Kv(B,v,14);C[b]=k.length>E?[B]:k}return C},{}),s},{})}updateAesScales(e,t){if(e.inheritedAes){let{inheritedAes:n,keys:r}=e;this.scales.xPrimaryAes.domain(r).range(r.map(a=>n[a]??m9))}else this.scales.xPrimaryAes.domain([]).range([]);if(t.inheritedAes){let{inheritedAes:n,keys:r}=t;this.scales.xSecondaryAes.domain(r).range(r.map(a=>n[a]??m9))}else this.scales.xSecondaryAes.domain([]).range([])}updateCaptionsSize(e,t,n,r){let a=new hc("600 14px Manrope"),i=e==="vertical";function o(C){return C.length?Math.max(...C.map(b=>a.getTextWidth(b))):0}function s(C){return C.length?Math.max(...C.map(o)):0}let c=[],f=0,A=LK(t,this.rowsCount,this.columnsCount),h=zyt(t,this.rowsCount,this.columnsCount);if(!i)c=h.map(C=>Math.max(...C.map(b=>s(this.scales.xPrimary[b].domain().map(B=>this.axisLabelsX[b][B])))));else{if(n.labelsPosition==="center"&&(c=A.map(C=>Math.max(...C.map(b=>Math.max(...this.scales.xPrimary[b].domain().map(B=>B?this.axisLabelsX[b][B].length*kM:0)))))),n.labelsPosition==="45deg"){let C=Math.sin(Math.PI/4);c=A.map(b=>Math.max(...b.map(B=>{let E=this.scales.xPrimary[B].domain().map(P=>this.axisLabelsX[B][P]),k=s(E);return k>0?k*C+14:0}))),f=Math.max(...h[0].map(b=>{let B=this.scales.xPrimary[b].domain(),E=this.axisLabelsX[b][B[0]];return Math.max(o(E)*C-this.scales.xPrimary[b].bandwidth()/2+14,0)}))}n.labelsPosition==="90deg"&&(c=A.map(C=>Math.max(...C.map(b=>s(this.scales.xPrimary[b].domain().map(B=>this.axisLabelsX[b][B]))))))}let v=Zn.flatten(t.map(C=>{if(r.hiddenLabels)return[];let b=this.scales.y[C],B=b.ticks(),E=B.some(P=>Math.abs(P)<1e-4&&P!==0||P>1e4)?",e":",f",k=b.tickFormat(10,E);return B.map(k)})),g=o(v);this.captionsSizes={xCaptionsTail:f,xAxisCaptionsWidthByRows:c,yAxisCaptionsWidth:g}}updateMargins(e,t,n){let r=this.chartsDimensions[t[0]],a=this.chartsDimensions[t[t.length-1]],i=e==="vertical",o=this.mainTitle.length?24*this.mainTitle.length+24*2:0,s=n.outerOffset;this.margins={left:Math.max(s,i?this.captionsSizes.xCaptionsTail-r.padding.left:0),right:this.legend.width+s,top:Math.max(o,s),bottom:Math.max(s,i?0:this.captionsSizes.xCaptionsTail-a.padding.bottom)},this.chartSizes.totalWidth=this.margins.left+this.chartSizes.chartsWidth+this.margins.right,this.chartSizes.totalHeight=this.margins.top+Math.max(this.chartSizes.chartsHeight,this.legend.height)+this.margins.bottom}updateLegendSize(e,t,n,r){if(!e.show){this.legend={width:0,height:0,items:[]};return}let a=this.chartSizes.chartHeight,i={width:0,height:0,left:0,top:0},o=[];function s(C,b){return r.some(B=>{let E=B.aes[b];return E&&Fyt(E)&&E.type===C})}function c(C){return{dotFill:s(C,"dotFill"),fillColor:s(C,"fillColor"),lineColor:s(C,"lineColor"),dotShape:s(C,"dotShape"),lineShape:s(C,"lineShape")}}let f=c("primaryGrouping"),A=c("secondaryGrouping");if(Object.values(f).some(C=>C)&&t.inheritedAes&&o.push({type:"discreteMulti",id:"primary",title:t.label,scale:this.scales.xPrimaryAes,values:t.keys,labels:t.valueLabels,usedAes:f,...i}),Object.values(A).some(C=>C)&&n.inheritedAes&&o.push({type:"discreteMulti",id:"secondary",title:n.label,scale:this.scales.xSecondaryAes,values:n.keys,labels:n.valueLabels,usedAes:A,...i}),!o.length){this.legend={width:0,height:0,items:[]};return}let h=C3(o,this.chartSizes.chartHeight),v=h[h.length-1],g=v.left+v.width+wK;this.legend={width:g,height:a,items:h}}render(e,t,n,r,a,i,o,s,c,f,A,h,v){var k;let{orientation:g,xAxis:C,yAxis:b,size:B}=t;this.updateChartSize(B,i,a,n.keys,g,c),this.updateViewport(g,n.keys,r.keys,i,a,b,s,c,B,A),this.createAxisLabels(i,C,n,g),this.createFacetTitles(i,o),this.updateCaptionsSize(g,i,C,b),this.updateChartDimensions(i,a,g,C,b),this.updateLegendSize(t.legend,n,r,s),this.createMainTitle(i,t.title),this.updateMargins(g,i,B),this.updateAesScales(n,r);let E=ie.jsx(Dyt,{settingsId:e,chartSettings:t,facetKeys:i,facetSettings:a,facetTitles:this.facetTitles,chartSizes:this.chartSizes,chartsDimensions:this.chartsDimensions,scales:this.scales,layersData:s,statsData:c,legendData:this.legend,margins:this.margins,columnsCount:this.columnsCount,keyColumn:f,xLabels:this.axisLabelsX,chartTitle:this.mainTitle,onlyPositive:h,secondaryGrouping:r,onTooltipHintSwitch:v});this.component=E,(k=this.reactRoot)==null||k.render(E)}renderError(e){var t;(t=this.reactRoot)==null||t.render(ie.jsx(Xv,{message:e}))}},jyt=Qyt,_9="#3e9838",S3="21",x3=3,q1=class{},RK=class extends q1{constructor(t){super();Be(this,"type","box");Be(this,"stat",{upper:.75,medium:.5,lower:.25,k:1.5});Be(this,"aes",{showOutliers:!0,boxWidth:"auto",dotShape:S3,dotFill:Vt,dotSize:x3,lineColor:Vt,fillColor:_9,lineWidth:1,lineShape:"solid",opacity:1});this.stat={...this.stat,...t.stat},this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="box"&&Object.keys(this.stat).every(n=>this.stat[n]===t.stat[n])}},VK=class extends q1{constructor(t){super();Be(this,"type","violin");Be(this,"stat",{bandwidth:"auto",stepsCount:40,trim:!0});Be(this,"aes",{width:"auto",lineColor:Vt,fillColor:_9,lineWidth:1,lineShape:"solid",opacity:1,showQuartiles:!0,medianLineStyle:"solid",quartilesLineStyle:"dashed"});this.stat={...this.stat,...t.stat},this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="violin"&&(this.stat.bandwidth!==t.stat.bandwidth||this.stat.trim!==t.stat.trim||this.stat.stepsCount!==t.stat.stepsCount)}},NK=class extends q1{constructor(t){super();Be(this,"type","dot");Be(this,"aes",{showOutliers:!0,jitter:.8,lineColor:"none",dotFill:Vt,dotShape:S3,dotSize:x3,opacity:1});this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="dot"&&this.aes.showOutliers===t.aes.showOutliers}},zK=class extends q1{constructor(t){super();Be(this,"type","line");Be(this,"pointsValues");Be(this,"aes",{showOutliers:!0,lineWidth:1,lineShape:"solid",fillColor:"none",lineColor:Vt,dotShape:S3,dotSize:x3,opacity:1});this.pointsValues=t.pointsValues,this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="line"&&this.pointsValues===t.pointsValues}},OK=class extends q1{constructor(t){super();Be(this,"type","errorbar");Be(this,"pointsValues");Be(this,"interval");Be(this,"aes",{showDots:!0,width:"auto",lineWidth:1,fillColor:"none",lineColor:Vt,dotShape:S3,dotSize:x3,opacity:1});this.pointsValues=t.pointsValues,this.interval=t.interval,this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="errorbar"&&this.pointsValues===t.pointsValues&&this.interval===t.interval}},FK=class extends q1{constructor(t){super();Be(this,"type","bar");Be(this,"height");Be(this,"aes",{width:"auto",lineWidth:1,fillColor:"none",lineColor:Vt,opacity:1});this.height=t.height??"max",this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="bar"&&this.height===t.height}},QK=class extends q1{constructor(t){super();Be(this,"type","stackedBar");Be(this,"normalize",!1);Be(this,"aes",{width:"auto",lineWidth:1,fillColor:_9,lineColor:"none",opacity:1});this.normalize=t.normalize??!1,this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="stackedBar"&&t.normalize===this.normalize}},jK=class extends q1{constructor(t){super();Be(this,"type","logo");Be(this,"normalize",!1);Be(this,"aes",{width:"auto",fillColor:_9,lineColor:"none",opacity:1});this.normalize=t.normalize??!1,this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="logo"&&t.normalize===this.normalize}},UK=class extends q1{constructor(t){super();Be(this,"type","binnedDots");Be(this,"method");Be(this,"position");Be(this,"keyColumn");Be(this,"aes",{showOutliers:!0,width:"auto",lineWidth:1,fillColor:"none",lineColor:Vt,opacity:1});this.method=t.method??"dotdensity",this.position=t.position??"stack",this.keyColumn=t.keyColumn??null,this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){var n,r;return t.type==="binnedDots"&&this.method===t.method&&this.position===t.position&&((n=this.keyColumn)==null?void 0:n.value)===((r=t.keyColumn)==null?void 0:r.value)}},GK=class extends q1{constructor(t){super();Be(this,"type","pairedPoints");Be(this,"linkColumn");Be(this,"aes",{showOutliers:!0,lineWidth:1,lineColor:Vt,lineShape:"solid",dotFill:Vt,dotSize:x3,dotShape:S3,opacity:1});this.linkColumn=t.linkColumn,this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="pairedPoints"&&this.aes.showOutliers===t.aes.showOutliers&&this.linkColumn.value===t.linkColumn.value}},YK=class extends q1{constructor(t){super();Be(this,"type","sina");Be(this,"aes",{showOutliers:!0,width:"auto",dotFill:_9,dotSize:x3,dotShape:S3,opacity:1});this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="sina"&&this.aes.showOutliers===t.aes.showOutliers}},iS=class extends q1{constructor(t){var n,r,a;super();Be(this,"type","stat");Be(this,"statType");Be(this,"testMethod");Be(this,"paired");Be(this,"ns");Be(this,"format");Be(this,"referenceGroup",null);Be(this,"correctionMethod",null);Be(this,"significanceLevels");this.statType=t.statType,this.testMethod=t.testMethod,this.paired=t.paired??!1,this.ns=t.ns??!0,this.format=t.format??"pValue",this.statType==="referenceGroup"&&(this.referenceGroup=t.referenceGroup??null),(this.statType==="referenceGroup"||this.statType==="pairwise")&&(this.correctionMethod=t.correctionMethod??null),this.significanceLevels={one:((n=t.significanceLevels)==null?void 0:n.one)??.05,two:((r=t.significanceLevels)==null?void 0:r.two)??.01,three:((a=t.significanceLevels)==null?void 0:a.three)??.001}}isEqualForCalculation(t){return t.type==="stat"&&Object.keys(this).every(n=>this[n]===t[n])}},WK=class{constructor(e){Be(this,"id");Be(this,"type","discrete");Be(this,"y");Be(this,"keyColumn");Be(this,"primaryGrouping");Be(this,"secondaryGrouping");Be(this,"facetSettings");Be(this,"facetBy");Be(this,"chartSettings");Be(this,"layers");var t,n,r,a,i,o,s,c,f,A;N3t.parse(e),this.id=Zn.uniqueId("settings"),this.y=e.y,this.keyColumn=e.keyColumn??null,this.primaryGrouping=e.primaryGrouping??null,this.secondaryGrouping=e.secondaryGrouping??null,this.facetSettings={sharedX:!0,sharedY:!0,titlePosition:"left",...e.facetSettings},this.facetBy=e.facetBy??[],this.chartSettings={size:{width:((t=e==null?void 0:e.size)==null?void 0:t.width)??(this.facetBy.length?400:600),height:((n=e==null?void 0:e.size)==null?void 0:n.height)??(this.facetBy.length?250:350),outerOffset:((r=e==null?void 0:e.size)==null?void 0:r.outerOffset)??O4t,innerOffset:((a=e==null?void 0:e.size)==null?void 0:a.innerOffset)??N4t.TOP},title:{position:"center",show:!0,...e.title,name:((i=e.title)==null?void 0:i.name)??"Chart"},orientation:e.orientation??"vertical",yAxis:{title:((o=e.y)==null?void 0:o.label)??e.y.value??"",scale:"linear",showGrid:!0,showTicks:!0,hiddenLabels:!1,...e.yAxis},xAxis:{title:((c=(s=e.primaryGrouping)==null?void 0:s.columnName)==null?void 0:c.label)??((f=e.primaryGrouping)==null?void 0:f.columnName.value)??"",showGrid:!0,showTicks:!0,linesBetweenCategories:!0,labelsPosition:"center",hiddenLabels:!1,...e.xAxis},frame:{type:((A=e.frame)==null?void 0:A.type)??"full"},legend:{show:!0,position:"right",...e.legend},tooltips:{box:{show:!0},violin:{show:!0},boxOutliers:{show:!0},line:{show:!0},errorBar:{show:!0},dot:{show:!0},binnedDots:{show:!0},pairedPoints:{show:!0},stackedBar:{show:!0},logo:{show:!1},...e.tooltips}},this.layers=e.layers.map(h=>{if(h.type==="box")return new RK(h);if(h.type==="violin")return new VK(h);if(h.type==="dot")return new NK(h);if(h.type==="line")return new zK(h);if(h.type==="errorbar")return new OK(h);if(h.type==="bar")return new FK(h);if(h.type==="stackedBar")return new QK(h);if(h.type==="stat")return new iS(h);if(h.type==="binnedDots")return new UK(h);if(h.type==="pairedPoints")return new GK(h);if(h.type==="sina")return new YK(h);if(h.type==="logo")return new jK(h);d1(h,"Unknown layer type")}).filter(Boolean)}};function Uyt(e,t,n,r=!1){let a=e.map(t).sort((i,o)=>i-o);if(r){let i=Zn.find(a,o=>o>0);if(!i)throw Error("Group with all zeros in log scale");return a.map(o=>o===0?i:o).map(n)}return a.map(n)}var Gyt=class{constructor(e,t,n,r,a,i,o,s,c,f,A=!0){Be(this,"lower");Be(this,"middle");Be(this,"upper");Be(this,"min");Be(this,"max");Be(this,"outliers");Be(this,"primaryGrouping");Be(this,"secondaryGrouping");Be(this,"key");Be(this,"boundsY");if(e.length===0)throw Error("Unable to create box on empty data");if(o>s||o>c||s>c)throw Error(`Invalid box bounds values: lower=${o}, middle=${s}, upper=${c}`);if(f<0)throw Error(`Invalid box whiskers coefficient: k=${f}. It should be positive`);let h=$=>Number($[t]);this.primaryGrouping=String(a),this.secondaryGrouping=String(i),this.key=`box_${this.primaryGrouping}_${this.secondaryGrouping}`;let v=$=>r==="log"?Math.log10($):$,g=$=>r==="log"?Math.pow(10,$):$,C=Uyt(e,h,v,r==="log"),b=D0(C,o),B=D0(C,s),E=D0(C,c),k=E-b;this.upper=g(E),this.middle=g(B),this.lower=g(b),this.min=Math.max(xw(e,h),g(b-f*k)),this.max=Math.min(Vh(e,h),g(E+f*k)),this.outliers=e.filter($=>h($)<this.min||h($)>this.max).map(($,z)=>({y:h($),data:$,id:String(n?$[n]:z)}));let[P=1/0,I=-1/0]=H0(this.outliers,$=>$.y);this.boundsY={min:A?Math.min(this.min,P):this.min,max:A?Math.max(this.max,I):this.max}}};function Yyt(e,t,n,r,a,i){let o=1/0,s=-1/0;return{type:"box",geoms:t.facet.reduce((c,f)=>{let A=Md(f);return c[A]=[],t.primary.forEach(h=>{t.secondary.forEach(v=>{let g=n.getRowsByGrouping([...f,h,v]);if(!g.length)return;let C=new Gyt(g,r.value,(a==null?void 0:a.value)??null,i.scale,h,v,e.stat.lower,e.stat.medium,e.stat.upper,e.stat.k,e.aes.showOutliers);C.boundsY.min<o&&(o=C.boundsY.min),C.boundsY.max>s&&(s=C.boundsY.max),c[A].push(C)})}),c},{}),meta:{minY:o,maxY:s},aes:e.aes}}var XK=40;function Wyt(e,t){return function(n){return t.map(function(r){return[r,Vs(n,a=>e(r-a))]})}}function Xyt(e){return function(t){return 1/Math.sqrt(2*Math.PI)*Math.pow(Math.E,-.5*Math.pow(t/e,2))}}function Kyt(e){let t=Vs(e);return Vs(e.map(n=>Math.pow(n-t,2)))}function Zyt(e){return Math.sqrt(Kyt(e))}function Jyt(e,t,n){let r=(n-t)/1.34,a=Zyt(e);return 1.06*Math.min(a,r)*Math.pow(e.length,-1/5)}var qyt=class{constructor(e,t,n,r,a,i){Be(this,"getArea");Be(this,"getLine");Be(this,"maxDensity");Be(this,"primaryGrouping");Be(this,"secondaryGrouping");Be(this,"key");Be(this,"boundsY");Be(this,"quartiles");if(e.length===0)throw Error("Unable to calculate violin on empty data");if(r!=="auto"&&r<1)throw Error(`Unable to calculate violin with ${r} steps`);this.primaryGrouping=String(a),this.secondaryGrouping=String(i),this.key=`violin_${this.primaryGrouping}_${this.secondaryGrouping}`;let o=$=>t==="log"?Math.log10($):$,s=$=>t==="log"?Math.pow(10,$):$,c=e.filter($=>t==="log"&&Number($)===0?(console.warn("Value = 0 on chart with log scale, it was removed from calculation"),!1):!0).map(o).sort(($,z)=>$-z),f=c[0],A=c[c.length-1],h=A-f,v=D0(c,.25),g=D0(c,.5),C=D0(c,.75);this.quartiles={q1:s(v),q2:s(g),q3:s(C)};let b=Jyt(c,v,C),B=r!=="auto"?r:b/3>h/XK?XK:h/(b/3),E=n?f:f-3*b,k=n?A:A+3*b,P=Zr().domain([E,k]).ticks(B);this.boundsY={min:s(P[0]),max:s(P[P.length-1])};let I=Wyt(Xyt(b),P)(c).map(([$,z])=>[s($),z]);this.maxDensity=Vh(I,([,$])=>$),this.getArea=($,z,O,K)=>{let te=$==="vertical",le=K??this.maxDensity,G=Zr().domain([-le,le]).range([-O/2,O/2]);return te?XB().curve(C5).x0(Q=>G(Q[1])).x1(Q=>G(-Q[1])).y(Q=>z(Q[0]))(I):XB().curve(C5).y0(Q=>G(Q[1])).y1(Q=>G(-Q[1])).x(Q=>z(Q[0]))(I)},this.getLine=($,z,O,K)=>{let te=$==="vertical",le=K??this.maxDensity,G=Zr().domain([-le,le]).range([-O/2,O/2]);return b5().curve(C5).x(te?Q=>G(Q[1]):Q=>z(Q[0])).y(te?Q=>z(Q[0]):Q=>G(Q[1]))(I)+" "+b5().curve(C5).x(te?Q=>G(-Q[1]):Q=>z(Q[0])).y(te?Q=>z(Q[0]):Q=>G(-Q[1]))(I)}}};function e7t(e,t,n,r,a){let i=0,o=1/0,s=-1/0;return{type:"violin",geoms:t.facet.reduce((c,f)=>{let A=Md(f);return c[A]=[],t.primary.forEach(h=>{t.secondary.forEach(v=>{let g=n.getColumnByGrouping([...f,h,v],r.value);if(!g.length)return;let C=new qyt(g,a.scale,e.stat.trim,e.stat.stepsCount,h,v);C.maxDensity>i&&(i=C.maxDensity),C.boundsY.min<o&&(o=C.boundsY.min),C.boundsY.max>s&&(s=C.boundsY.max),c[A].push(C)})}),c},{}),meta:{maxDensity:i,minY:o,maxY:s},aes:e.aes}}var t7t=30;function n7t(e,t){return function(n){return t.map(function(r){return Vs(n,a=>e(r-a))})}}function r7t(e){return function(t){return 1/Math.sqrt(2*Math.PI)*Math.pow(Math.E,-.5*Math.pow(t/e,2))}}function a7t(e){let t=Vs(e);return Vs(e.map(n=>Math.pow(n-t,2)))}function i7t(e){return Math.sqrt(a7t(e))}function o7t(e){let t=D0(e,.25),n=(D0(e,.75)-t)/1.34,r=i7t(e);return 1.06*Math.min(r,n)*Math.pow(e.length,-1/5)}var l7t=class{constructor(e,t,n,r,a,i){Be(this,"key");Be(this,"maxDensity");Be(this,"primaryGrouping");Be(this,"secondaryGrouping");Be(this,"points");Be(this,"boundsY");let o=t7t;if(e.length===0)throw Error("Unable to calculate sina on empty data");this.primaryGrouping=String(r),this.secondaryGrouping=String(a),this.key=`sina_${this.primaryGrouping}_${this.secondaryGrouping}`;let s=P=>n==="log"?Math.log10(P):P,c=P=>n==="log"?Math.pow(10,P):P,f=P=>Number(P[t.value]),A=e.filter(P=>n==="log"&&f(P)===0?(console.warn("Value = 0 on chart with log scale, it was removed from calculation"),!1):!0).sort((P,I)=>s(f(P))-s(f(I))),h=A.map(P=>s(f(P))),v=h[0],g=h[A.length-1],C=(g-v)/o,b=o7t(h),B=Zn.range(v+C,g,C);this.boundsY={min:c(v),max:c(g)};let E=n7t(r7t(b),B)(h),k=Zr().domain(B).range(E).clamp(!0);this.maxDensity=Vh(E),this.points=A.map((P,I)=>({x:f(P),y:k(s(f(P)))/this.maxDensity,id:String(I),jitter:i(),data:P}))}};function s7t(e,t,n,r,a){let i=0,o=1/0,s=-1/0,c=yN(1);return{type:"sina",geoms:t.facet.reduce((f,A)=>{let h=Md(A);return f[h]=[],t.primary.forEach(v=>{t.secondary.forEach(g=>{let C=n.getRowsByGrouping([...A,v,g]);if(!C.length)return;let b=C;if(!e.aes.showOutliers){let E=I=>Number(I[r.value]),[k,P]=b3(C,a.scale,E);b=C.filter(I=>{let $=E(I);return $>=k&&$<=P})}let B=new l7t(b,r,a.scale,v,g,c);B.maxDensity>i&&(i=B.maxDensity),B.boundsY.min<o&&(o=B.boundsY.min),B.boundsY.max>s&&(s=B.boundsY.max),f[h].push(B)})}),f},{}),meta:{maxDensity:i,minY:o,maxY:s},aes:e.aes}}function u7t(e,t,n,r,a,i){let o=1/0,s=-1/0,c=yN(1);return{type:"dot",geoms:t.facet.reduce((f,A)=>{let h=Md(A);return f[h]=[],t.primary.forEach(v=>{t.secondary.forEach(g=>{let C=n.getRowsByGrouping([...A,v,g]);if(!C.length)return;let b=P=>Number(P[r.value]),B=C.map((P,I)=>({y:b(P),jitter:c(),id:String(i?P[i.value]:I),data:P}));if(!e.aes.showOutliers){let[P,I]=b3(C,a.scale,b);B=B.filter(({y:$})=>$>=P&&$<=I)}let[E=1/0,k=-1/0]=H0(B,P=>P.y);E<o&&(o=E),k>s&&(s=k),f[h].push({key:`dots_${String(v)}_${String(g)}`,values:B,primaryGrouping:String(v),secondaryGrouping:String(g),boundsY:{min:E,max:k}})})}),f},{}),meta:{minY:o,maxY:s},aes:e.aes}}function c7t(e,t){if(t==="median")return DI(e,.5);if(t==="mean")return Vs(e);d1(t,`Unknown line points calculation for dot layer: ${t}`)}function f7t(e,t,n,r,a){let i=1/0,o=-1/0;return{type:"line",geoms:t.facet.reduce((s,c)=>{let f=Md(c);s[f]=[];let A=-1/0,h=1/0;return e.aes.showOutliers||([A,h]=b3(n.getColumnByGrouping([...c],r.value),a.scale)),t.secondary.forEach(v=>{let g={key:`${String(v)}`,boundsY:{min:1/0,max:-1/0},dots:{}},C=!1,b=E=>a.scale==="log"?Math.log10(E):E,B=E=>a.scale==="log"?Math.pow(10,E):E;t.primary.forEach(E=>{let k=n.getColumnByGrouping([...c,E,v],r.value);if(!k.length){C=!0;return}let P=k;if(e.aes.showOutliers||(P=k.filter($=>$>=A&&$<=h)),!P.length){C=!0;return}let I=B(c7t(P.map(b),e.pointsValues));g.dots[String(E)]=I,I<i&&(i=I),I>o&&(o=I),I<g.boundsY.min&&(g.boundsY.min=I),I>g.boundsY.max&&(g.boundsY.max=I)}),C||s[f].push(g)}),s},{}),meta:{minY:i,maxY:o},aes:e.aes}}function d7t(e){let t=Vs(e);return Vs(e.map(n=>Math.pow(n-t,2)))}function LM(e){return Math.sqrt(d7t(e))}function A7t(e){return LM(e)/Math.sqrt(e.length)}function h7t(e){return 1.96*LM(e)}function p7t(e,t){if(t==="median")return DI(e,.5);if(t==="mean")return Vs(e);d1(t,"Unknown points calculation")}function v7t(e,t){if(t==="sd")return LM(e);if(t==="se")return A7t(e);if(t==="ci")return h7t(e);d1(t,"Unknown error interval calculation")}function m7t(e,t,n,r,a){let i=1/0,o=-1/0;return{type:"errorbar",geoms:t.facet.reduce((s,c)=>{let f=Md(c);s[f]=[];let A=v=>a.scale==="log"?Math.log10(v):v,h=v=>a.scale==="log"?Math.pow(10,v):v;return t.primary.forEach(v=>{t.secondary.forEach(g=>{let C=n.getColumnByGrouping([...c,v,g],r.value);if(!C.length)return;let b=C.map(A),B=h(p7t(b,e.pointsValues)),E=h(v7t(b,e.interval)),k=B-E,P=B+E;k<i&&(i=k),P>o&&(o=P),s[f].push({key:`errorbar_${String(v)}_${String(g)}`,primaryGrouping:String(v),secondaryGrouping:String(g),value:B,min:k,max:P,boundsY:{min:k,max:P}})})}),s},{}),meta:{minY:i,maxY:o},aes:e.aes}}function g7t(e,t,n,r){if(e.length===0)throw Error("Unable to create bar on empty data");let a=s=>t==="log"?Math.log10(s):s,i=s=>t==="log"?Math.pow(10,s):s,o=s=>{let c=Number(s[n]);if(t==="log"&&c<1)throw Error(`Value < 1 in log scale: ${c}`);return c};switch(r){case"max":return Vh(e,o)??o(e[0]);case"min":return xw(e,o)??o(e[0]);case"median":{let s=e.map(c=>Number(c[n])).map(a).sort((c,f)=>c-f);return i(D0(s,.5))}case"mean":return Vs(e,o)??o(e[0]);default:d1(r,`Unknown bar height function ${r}`)}}function y7t(e,t,n,r,a){let i=-1/0,o=1/0;return{type:"bar",geoms:t.facet.reduce((s,c)=>{let f=Md(c);return s[f]=[],t.primary.forEach(A=>{t.secondary.forEach(h=>{let v=n.getRowsByGrouping([...c,A,h]);if(!v.length)return;let g=g7t(v,a.scale,r.value,e.height);i=Math.max(i,g,0),o=Math.min(o,g,0),s[f].push({key:`bar_${String(A)}_${String(h)}`,value:g,primaryGrouping:A,secondaryGrouping:h,boundsY:{min:Math.min(0,g),max:Math.max(0,g)}})})}),s},{}),meta:{minY:o,maxY:i},aes:e.aes}}function w7t(e,t,n,r){let a=-1/0,i=1/0;return{type:"stackedBar",geoms:t.facet.reduce((o,s)=>{let c=Md(s);return o[c]=[],t.primary.forEach(f=>{let A=0,h={};t.secondary.forEach(C=>{let b=C===J1?"null":C,B=n.getRowsByGrouping([...s,f,C]);if(!B.length)return;let E=lc(B,k=>Number(k[r.value]));h[b]={height:E,key:b},A+=E});let v=A;e.normalize&&t.secondary.forEach(C=>{let b=C===J1?"null":C;h[b]&&(h[b].height=h[b].height/v*100)}),a=Math.max(a,0,A),i=Math.min(i,0,A);let g=e.normalize?100:v;o[c].push({key:`stackedBar_${String(f)}`,valuesMap:h,primaryGrouping:f,boundsY:{min:Math.min(g,0),max:Math.max(g,0)}})}),o},{}),meta:{minY:e.normalize?0:i,maxY:e.normalize?100:a,normalize:e.normalize},aes:e.aes}}var KK=30;function b7t(e,t,n,r,a,i){let o=e.map(v=>n(a(v))),s=e.length,c=e.map(A),f=[];function A(v,g){return{key:i(v,g),value:a(v)}}let h=0;for(let v=1;v<s;++v){let g=o[h],C=o[v],b=o[v-1];if(C>=g+t){let B=Math.min((g+b)/2,C-t);o.fill(B,h,v),f.push({x:r(B),count:v-h,dots:c.slice(h,v)}),h=v}}return o.fill((o[h]+o[s-1])/2,h,s),f.push({x:r((o[h]+o[s-1])/2),count:s-h,dots:c.slice(h,s)}),f}var C7t=class{constructor(e,t,n,r,a,i,o,s,c,f){Be(this,"bins");Be(this,"primaryGrouping");Be(this,"secondaryGrouping");Be(this,"key");Be(this,"boundsY");this.primaryGrouping=String(n),this.secondaryGrouping=String(r),this.key=`binnedDots_${this.primaryGrouping}_${this.secondaryGrouping}`;let A=e.filter(h=>s(h)===0&&c==="log"?(console.warn(`Item with ${t} = 0 is not shown on chart with log scale`),!1):!0).sort((h,v)=>i(s(h))-i(s(v)));this.bins=b7t(A,a,i,o,s,(h,v)=>String(f?h[f.value]:v)),this.boundsY={min:this.bins[0].x,max:this.bins[this.bins.length-1].x}}};function S7t(e,t,n,r,a){let i=C=>a.scale==="log"?Math.log10(C):C,o=C=>a.scale==="log"?Math.pow(10,C):C,s=C=>Number(C[r.value]),c=1/0,f=-1/0,A=n.getRowsByGrouping([]),[h=s(A[0]),v=s(A[0])]=H0(A.filter(C=>Number(C[r.value])===0&&a.scale==="log"?(console.warn(`Item with ${r.value} = 0 is not shown on chart with log scale`),!1):!0),C=>Number(C[r.value])),g=Math.abs(i(h)-i(v))/KK;return{type:"binnedDots",geoms:t.facet.reduce((C,b)=>{let B=Md(b);return C[B]=[],t.primary.forEach(E=>{t.secondary.forEach(k=>{let P=n.getRowsByGrouping([...b,E,k]);if(!P.length)return;let I=P;if(!e.aes.showOutliers){let[z,O]=b3(P,a.scale,s);I=P.filter(K=>{let te=s(K);return te>=z&&te<=O})}let $=new C7t(I,r.value,E,k,g,i,o,s,a.scale,e.keyColumn);$.boundsY.min<c&&(c=$.boundsY.min),$.boundsY.max>f&&(f=$.boundsY.max),C[B].push($)})}),C},{}),meta:{minY:Math.min(h,v,c),maxY:Math.max(h,v,f),binsCount:KK,hasKeyFromColumn:e.keyColumn!==null},aes:e.aes}}function x7t(e,t){if(t.length===2)return"secondary";if(e.length===2&&t.length<2)return"primary";throw Error("Too many groups for paired points layer")}function ZK(e,t,n,r,a,i,o,s,c){let f=Zn.groupBy(n,P=>P[a.value]),A=Zn.groupBy(r,P=>P[a.value]),h=Object.keys(f),v=Object.keys(A);if(Zn.uniq(h).length!==h.length||Zn.uniq(v).length!==v.length)throw Error(`Non unique keys in groups ${String(e)}, ${String(t)} for paired points layer`);if(h.length!==v.length||Zn.intersection(h,v).length!==h.length)throw Error(`Keys in groups ${String(e)}, ${String(t)} not match for paired points layer`);let g=P=>Number(P[i.value]),C=1/0,b=-1/0,B=!1,E=c==="log",k=h.map(P=>{let I=f[P][0],$=A[P][0],z=g(I),O=g($);return(z===0||O===0)&&(B=!0),C=Math.min(C,E&&z===0?1/0:z,E&&O===0?1/0:O),b=Math.max(b,E&&z===0?-1/0:z,E&&O===0?-1/0:O),{id:P,key1:{id:`${P}_${String(e)}`,value:z,data:I},key2:{id:`${P}_${String(t)}`,value:O,data:$}}});if(!s){C=1/0,b=-1/0;let[P,I]=b3(n,c,g),[$,z]=b3(r,c,g);k=k.filter(({key1:O,key2:K})=>O.value<P||O.value>I||K.value<$||K.value>z?!1:(C=Math.min(C,E&&O.value===0?1/0:O.value,E&&K.value===0?1/0:K.value),b=Math.max(b,E&&O.value===0?-1/0:O.value,E&&K.value===0?-1/0:K.value),!0))}return C=B?C/10:C,b=Math.max(b,C),{id:`${String(e)}_${String(t)}`,key1:String(e),key2:String(t),pairs:k.map(P=>({...P,key1:{...P.key1,value:P.key1.value===0?C:P.key1.value},key2:{...P.key2,value:P.key2.value===0?C:P.key2.value}})),grouping:o,boundsY:{min:C,max:b}}}function E7t(e,t,n,r,a){let i=x7t(t.primary,t.secondary),o=1/0,s=-1/0;return{type:"pairedPoints",geoms:t.facet.reduce((c,f)=>{let A=Md(f);if(c[A]=[],i==="primary"){let[h,v]=t.primary,g=n.getRowsByGrouping([...f,h]),C=n.getRowsByGrouping([...f,v]),b=ZK(h,v,g,C,e.linkColumn,r,i,e.aes.showOutliers,a.scale);o=Math.min(o,b.boundsY.min),s=Math.max(s,b.boundsY.max),c[A].push(b)}else i==="secondary"&&t.primary.forEach(h=>{let[v,g]=t.secondary,C=n.getRowsByGrouping([...f,h,v]),b=n.getRowsByGrouping([...f,h,g]),B=ZK(v,g,C,b,e.linkColumn,r,i,e.aes.showOutliers,a.scale);o=Math.min(o,B.boundsY.min),s=Math.max(s,B.boundsY.max),c[A].push(B)});return c},{}),meta:{minY:o,maxY:s},aes:e.aes}}function B7t(e){let t=Math.abs(e),n=1/(1+t/2),r=n*Math.exp(-t*t-1.26551223+n*(1.00002368+n*(.37409196+n*(.09678418+n*(-.18628806+n*(.27886807+n*(-1.13520398+n*(1.48851587+n*(-.82215223+n*.17087277)))))))));return e>=0?r:2-r}function _7t(e){return .5*B7t(-e/Math.sqrt(2))}var T7t=class{constructor(e,t){this.value=e,this.position=t}getValue(){return this.value}getPosition(){return this.position}};function k7t(e){let t=new Array(e.length);for(let o=0;o<e.length;o++)t[o]=new T7t(e[o],o);let n=P7t(t);t.sort((o,s)=>o.getValue()-s.getValue());let r=new Array(t.length),a=1;r[t[0].getPosition()]=a;let i=[];i.push(t[0].getPosition());for(let o=1;o<t.length;o++)t[o].getValue()>t[o-1].getValue()&&(a=o+1,i.length>1&&JK(r,i),i=[]),i.push(t[o].getPosition()),r[t[o].getPosition()]=a;return i.length>1&&JK(r,i),M7t(r,n),r}function JK(e,t){let n=(2*e[t[0]]+t.length-1)/2;t.forEach(r=>{e[r]=n})}function M7t(e,t){t.forEach(n=>{e[n]=NaN})}function P7t(e){let t=[];for(let n=0;n<e.length;n++)isNaN(e[n].getValue())&&t.push(n);return t}var H7t=class{constructor(){Be(this,"SMALL_SAMPLE_SIZE",50)}mannWhitneyU(e,t){let n=[...e,...t],r=k7t(n),a=0;for(let s=0;s<e.length;s++)a+=r[s];let i=a-e.length*(e.length+1)/2,o=e.length*t.length-i;return Math.min(i,o)}mannWhitneyUTest(e,t,n){if(typeof n>"u")return e.length+t.length<=this.SMALL_SAMPLE_SIZE&&Object.keys(this.tiesMap(e,t)).length===0?this.mannWhitneyUTest(e,t,!0):this.mannWhitneyUTest(e,t,!1);let r=this.tiesMap(e,t),a=this.mannWhitneyU(e,t);if(n){if(Object.keys(r).length!==0)throw new Error;return this.exactP(e.length,t.length,a)}return this.approximateP(a,e.length,t.length,this.varU(e.length,t.length,r))}approximateP(e,t,n,r){let a=t*n/2;if(a==e)return 1;let i=-Math.abs(e-a+.5)/Math.sqrt(r);return 2*_7t(i)}exactP(e,t,n){let r=t*e;if(n>r)return 1;let a=n<r/2?n:r/2-n,i=0,o=0;for(;o<=a;)i+=this.uDensity(e,t,o),o++;return 2*i}uDensity(e,t,n){if(n<0||n>t*e)return 0;let r=this.uFrequencies(e,t);return r[Math.round(n+1)]/Zn.sum(r)}uFrequencies(e,t){let n=Math.max(t,e);if(n>100)throw Error("n or m > 100");let r=Math.min(t,e),a=new Array(e*t+2),i=new Array(e*t+2);for(let s=1;s<a.length;s++)a[s]=s<=n+1?1:0;i[1]=0;let o=n;for(let s=2;s<=r;s++){i[s]=0,o=o+n;let c=o+2,f=1+o/2,A=s;for(let h=1;h<=f;h++){A++,c=c-1;let v=a[h]+i[h];a[h]=v,i[A]=v-a[c],a[c]=v}}return a}varU(e,t,n){let r=e*t;if(Object.keys(n).length===0)return r*(e+t+1)/12;let a=Zn.sum(Object.values(n).map(o=>o*o*o-o)),i=e+t;return r/12*(i+1-a/(i*(i-1)))}tiesMap(e,t){let n={};for(let r=0;r<e.length;r++)n[e[r]]=n[e[r]]?n[e[r]]+1:1;for(let r=0;r<t.length;r++)n[t[r]]=n[t[r]]?n[t[r]]+1:1;for(let r in n)n[r]===1&&delete n[r];return n}};function RM(e,t,n){switch(t){case"ttest":{if(e.length>2)throw new Error("more than 2 datasets passed");if(n){if(e[0].length!==e[1].length)throw Error("Different size groups in paired test");return slt(e[0],e[1]).pValue}let r=Blt(e[0],e[1]).pValue;return isNaN(r)?1:r}case"anova":{let r=AGe(Zn.flatten(e),Zn.flatten(e.map((a,i)=>a.map(()=>String(i))))).pValue;return isNaN(r)?1:r}case"wilcoxon":{if(e.length>2)throw new Error("more than 2 datasets passed");if(n){if(e[0].length!==e[1].length)throw Error("Different size groups in paired test");return Edt(e[0],e[1]).pValue}let r=new H7t().mannWhitneyUTest(e[0],e[1]);return isNaN(r)?1:r}case"kruskalWallis":{let r=Wct(...e).pValue;return isNaN(r)?1:r}default:throw new Error("Unknown test method")}}function qK(e,t){let n;if(e==t){n=new Array(t+1);for(let r=0;r<n.length;++r)n[r]=r+1}else if(e<t){n=new Array(t-e+1);for(let r=0;r<n.length;++r)n[r]=e+r}else{n=new Array(e-t+1);for(let r=0;r<n.length;++r)n[r]=e-r}return n}function E3(e,t){return Zn.orderBy(e.map((n,r)=>[n,r]),([n])=>n,[t?"desc":"asc"]).map(([,n])=>n)}function D7t(e){if(e.length<1)throw new Error("cummin requires at least one element");let t=new Array(e.length),n=e[0];for(let r=0;r<e.length;++r)e[r]<n&&(n=e[r]),t[r]=n;return t}function $7t(e){if(e.length<1)throw new Error("cummax requires at least one element");let t=new Array(e.length),n=e[0];for(let r=0;r<e.length;++r)e[r]>n&&(n=e[r]),t[r]=n;return t}function eZ(e,t){if(e.length<1)throw new Error("pmin requires at least one element");return e.map(n=>Math.min(n,t))}function I7t(e){if(e.length<1)throw new Error("pAdjust requires at least one element");return Math.min(...e)}function L7t(e){let t=e.length;if(t<1)throw new Error("pAdjust requires at least one element");let n=new Array(t);for(let r=0;r<t;++r){let a=e[r]*t;if(a>=1)n[r]=1;else if(0<=a)n[r]=a;else throw new Error(`${a} is outside [0, 1)`)}return n}function R7t(e){let t=e.length;if(t<1)throw new Error("pAdjust requires at least one element");let n=E3(e,!1),r=n.slice(),a=new Array(t).fill(0);for(let f=0;f<t;++f)a[f]=(t-f)*e[n[f]];let i=E3(r,!1),o=$7t(a),s=eZ(o,1),c=new Array(t);for(let f=0;f<t;++f)c[f]=s[i[f]];return c}function V7t(e){let t=e.length;if(t<1)throw new Error("pAdjust requires at least one element");let n=qK(t,t),r=E3(e,!1),a=new Array(t);for(let h=0;h<t;++h)a[h]=e[r[h]];let i=r.slice(),o=E3(i,!1),s=new Array(t),c=new Array(t),f=new Array(t);for(let h=0;h<t;++h)f[h]=a[h]*t/n[h];let A=I7t(f);s.fill(A),c.fill(A);for(let h=t;h>=2;--h){let v=qK(1,t-h+1);for(let B=0;B<t-h+1;++B)v[B]--;let g=h-1,C=new Array(g);for(let B=0;B<g;++B)C[B]=t-h+2+B-1;let b=h*a[C[0]]/2;for(let B=1;B<g;++B){let E=a[C[B]]*h/(2+B);E<b&&(b=E)}for(let B=0;B<t-h+1;++B)s[v[B]]=Math.min(a[v[B]]*h,b);for(let B=0;B<g;++B)s[C[B]]=s[t-h];for(let B=0;B<t;++B)c[B]<s[B]&&(c[B]=s[B])}for(let h=0;h<t;++h)s[h]=c[o[h]];return s}var N7t=class{constructor(e,t,n){this.ni=e,this.o=t,this.ro=n}result(e){let t=D7t(e),n=eZ(t,1),r=new Array(e.length);for(let a=0;a<e.length;++a)r[a]=n[this.ro[a]];return r}};function VM(e){let t=e.length,n=new Array(t),r=E3(e,!0);for(let i=0;i<t;++i){if(e[i]<0||e[i]>1)throw new Error("array["+i+"] = "+e[i]+" is outside [0, 1]");n[i]=t/(t-i)}let a=E3(r,!1);return new N7t(n,r,a)}function z7t(e){let t=e.length;if(t<1)throw new Error("pAdjust requires at least one element");let n=VM(e),r=new Array(t);for(let a=0;a<t;++a)r[a]=n.ni[a]*e[n.o[a]];return n.result(r)}function O7t(e){let t=e.length;if(t<1)throw new Error("pAdjust requires at least one element");let n=VM(e),r=new Array(t),a=0;for(let i=1;i<t+1;++i)a+=1/i;for(let i=0;i<t;++i)r[i]=a*n.ni[i]*e[n.o[i]];return n.result(r)}function F7t(e){let t=e.length;if(t<1)throw new Error("pAdjust requires at least one element");let n=VM(e),r=new Array(t);for(let a=0;a<t;++a)r[a]=(a+1)*e[n.o[a]];return n.result(r)}function tZ(e,t){switch(t){case"BenjaminiHochberg":return z7t(e);case"BenjaminiYekutieli":return O7t(e);case"Bonferroni":return L7t(e);case"Hochberg":return F7t(e);case"Holm":return R7t(e);case"Hommel":return V7t(e);case null:return e;default:throw new Error(`Unknown p-value correction method: ${t}`)}}function Q7t(e){return e.slice(0,-1).reduce((t,n,r)=>t.concat(e.slice(r+1).map(a=>[n,a])),[])}function j7t(e,t,n,r,a){return{type:"stats",values:t.reduce((i,o)=>{let s=[];switch(e.statType){case"overall":{let c=n.map(A=>a.getColumnByGrouping([...o,A],r.value)).filter(A=>A.length>0);if(c.length<2)break;let f=RM(c,e.testMethod,e.paired);s=[[["overall"],f]];break}case"referenceGroup":{let c=e.referenceGroup===null?J1:String(e.referenceGroup);if(c!==J1&&!n.includes(c))throw new Error(`Reference group ${String(c)} for ${e.testMethod} test is not in available groups`);let f=a.getColumnByGrouping([...o,c],r.value);if(f.length===0){s=[];break}let A=n.filter(v=>v!==c).map(v=>[v,a.getColumnByGrouping([...o,v],r.value)]).filter(([,v])=>v.length>0);if(A.length<2&&e.correctionMethod!==null)break;let h=tZ(A.map(([,v])=>RM([f,v],e.testMethod,e.paired)),e.correctionMethod);s=A.map(([v],g)=>[[v],h[g]]);break}case"pairwise":{let c=Q7t(n).map(([A,h])=>[[A,h],[a.getColumnByGrouping([...o,A],r.value),a.getColumnByGrouping([...o,h],r.value)]]).filter(([,[A,h]])=>A.length&&h.length);if(c.length<1)break;let f=tZ(c.map(([,A])=>RM(A,e.testMethod,e.paired)),e.correctionMethod);s=c.map(([A],h)=>[A,f[h]]);break}default:throw new Error("Unknown statType")}return i[Md(o)]=s,i},{}),meta:{statType:e.statType,testMethod:e.testMethod,format:e.format,ns:e.ns,significanceLevels:e.significanceLevels}}}function nZ(e,t,n=null){let r=t.value,a=e.getColumnCategories(r);return Zn.intersection(n??a,a).map(String)}function rZ(e){if(!e.length)return[];let t=[[]];return e.forEach(n=>{let r=[];n.forEach(a=>{r.push(...t.map(i=>[...i,a]))}),t=r}),t}function oS(e,t){if(!t)return{keys:["null"],value:null,label:"",valueLabels:{null:""},inheritedAes:null};let n=t.columnName.value,r=Zn.uniqBy(e.rows,c=>c[n]),a=c=>String(c[n]),i=c=>t.columnName.valueLabels?String(c[t.columnName.valueLabels]):a(c),o=e.getColumnCategories(n,!t.allowNullGroup),s=(t.order??o).map(String);return{keys:Zn.intersection(s,o),value:n,label:t.columnName.label??n,valueLabels:r.reduce((c,f)=>(c[a(f)]=i(f),c),{}),inheritedAes:t.inheritedAes??null}}var U7t=class extends zm{constructor(t,n,r){super(t,n);Be(this,"settings");Be(this,"chartRenderer",new jyt);Be(this,"onTooltipHintSwitch",()=>{});Be(this,"calculatedData",null);this.settings=new WK(n),r&&(this.onTooltipHintSwitch=r[0])}mount(t){this.chartRenderer.init(t),this._updateData(),this._updateChart()}unmount(){this.chartRenderer.clear()}updateSettingsAndData(t,n){let r=this.settings,a=this.data;this.settings=new WK(n),this.data=t,this._needUpdateCalculatedDataBySettings(r,this.settings)||this._needUpdateCalculatedDataByData(a,this.data)?this._updateData():this._updateAesInData(),this._updateChart()}updateChartState(t,n){console.warn("no chart state for discrete")}export(){return this._updateChart(),w5(this.chartRenderer.component)}_needUpdateCalculatedDataBySettings(t,n){var r,a,i,o,s,c,f,A;return t.chartSettings.yAxis.scale!==n.chartSettings.yAxis.scale||(((r=t.primaryGrouping)==null?void 0:r.columnName.value)??"")!==(((a=n.primaryGrouping)==null?void 0:a.columnName.value)??"")||(((i=t.secondaryGrouping)==null?void 0:i.columnName.value)??"")!==(((o=n.secondaryGrouping)==null?void 0:o.columnName.value)??"")||(((s=t.primaryGrouping)==null?void 0:s.allowNullGroup)??"")!==(((c=n.primaryGrouping)==null?void 0:c.allowNullGroup)??"")||(((f=t.secondaryGrouping)==null?void 0:f.allowNullGroup)??"")!==(((A=n.secondaryGrouping)==null?void 0:A.allowNullGroup)??"")||t.facetBy.some((h,v)=>{var g;return h.value!==((g=n.facetBy[v])==null?void 0:g.value)})||t.layers.length!==n.layers.length||t.layers.some((h,v)=>!h.isEqualForCalculation(n.layers[v]))}_needUpdateCalculatedDataByData(t,n){let r=Object.keys(t.data),a=Object.keys(n.data);return t.id!==n.id||r.length!==a.length||r.some(i=>{var o;return t.data[i].length!==((o=n.data[i])==null?void 0:o.length)})}_updateData(){let{chartSettings:t,y:n,keyColumn:r,facetBy:a,layers:i,facetSettings:o}=this.settings,{yAxis:s}=t,c=this.data.rows.every(E=>{let k=E[n.value];return k===null||!(Number(k)<0)}),f=oS(this.data,this.settings.primaryGrouping),A=oS(this.data,this.settings.secondaryGrouping),h=a.map(E=>E.value),v=a.length?rZ(a.map(E=>{var k;return nZ(this.data,E,(k=o==null?void 0:o.order)==null?void 0:k[E.value])})):[[J1]];this.data.setGrouping([...h,f.value,A.value]);let g={facet:v,primary:f.value!==null?f.keys:[J1],secondary:A.value!==null?A.keys:[J1]},C=g.facet.reduce((E,k)=>(E[Md(k)]=g.primary.filter(P=>this.data.getRowsByGrouping([...k,P]).length>0).map(String),E),{}),b=i.filter(E=>!(E instanceof iS)).map(E=>{if(E instanceof RK)return Yyt(E,g,this.data,n,r,s);if(E instanceof VK)return e7t(E,g,this.data,n,s);if(E instanceof NK)return u7t(E,g,this.data,n,s,r);if(E instanceof zK)return f7t(E,g,this.data,n,s);if(E instanceof OK)return m7t(E,g,this.data,n,s);if(E instanceof FK)return y7t(E,g,this.data,n,s);if(E instanceof QK)return w7t(E,g,this.data,n);if(E instanceof UK)return S7t(E,g,this.data,n,s);if(E instanceof GK)return E7t(E,g,this.data,n,s);if(E instanceof YK)return s7t(E,g,this.data,n,s);if(E instanceof jK)return V4t(E,g,this.data,n);throw new Error("Unknown layer type")}),B=i.filter(E=>E instanceof iS).map(E=>{if(f.value===null)throw new Error("Cannot calculate p-value without data grouping");return j7t(E,g.facet,g.primary,n,this.data)});this.calculatedData={layersData:b,statsLayersData:B,primaryGrouping:f,secondaryGrouping:A,facetKeyLists:v,nonEmptyGroupsByFacets:C,onlyPositive:c}}_updateAesInData(){if(this.calculatedData===null)return;let{layers:t,facetBy:n,primaryGrouping:r,secondaryGrouping:a,facetSettings:i}=this.settings,o=t.filter(s=>!(s instanceof iS));for(let s=0;s<o.length;s++){let c=o[s];"aes"in c&&(this.calculatedData.layersData[s].aes=c.aes)}this.calculatedData.primaryGrouping=oS(this.data,r),this.calculatedData.secondaryGrouping=oS(this.data,a),this.calculatedData.facetKeyLists=n.length?rZ(n.map(s=>{var c;return nZ(this.data,s,(c=i==null?void 0:i.order)==null?void 0:c[s.value])})):[[J1]]}_updateChart(){if(!this.calculatedData)return;let{id:t,chartSettings:n,keyColumn:r,facetSettings:a}=this.settings,i=this.calculatedData.facetKeyLists.map(Md),o=this.calculatedData.facetKeyLists.map(s=>s.map(c=>c===J1?"null":c));this.chartRenderer.render(t,n,this.calculatedData.primaryGrouping,this.calculatedData.secondaryGrouping,a,i,o,this.calculatedData.layersData,this.calculatedData.statsLayersData,r,this.calculatedData.nonEmptyGroupsByFacets,this.calculatedData.onlyPositive,this.onTooltipHintSwitch)}},G7t=1e6;function Y7t(e){let t=_I(e),n=Vs(e);return t===void 0||n===void 0||t===0?r=>r:r=>(r-n)/t}function W7t(e){let t=Vs(e),[n,r]=H0(e);return t===void 0||n===void 0||r===void 0||r===n?a=>a:a=>(a-t)/(r-n)}function X7t(e,t){return e==="standardScaling"?Y7t(t):e==="meanNormalization"?W7t(t):n=>n}function NM(e){if(!e.length)return[];let t=[[]];return e.forEach(n=>{let r=[];n.forEach(a=>{r.push(...t.map(i=>[...i,a]))}),t=r}),t}function K7t(e,t,n,r,a,i,o,s,c,f,A,h){let v=a.length?a.map(Y=>e.getColumnCategories(Y.value)):[["null"]],g=i.length?i.map(Y=>e.getColumnCategories(Y.value)):[["null"]],C=o.length?o.map(Y=>e.getColumnCategories(Y.value)):[["null"]],b=NM(v),B=NM(g),E=NM(C),k=b.map(Y=>Y.join("_")),P=B.map(Y=>Y.join("_")),I=E.map(Y=>Y.join("_")),$={meta:{facetKeys:k,xGroupKeys:P,yGroupKeys:I,xKeysByGroups:{},yKeysByGroups:{},xLabels:{},yLabels:{},xGroupLabels:{},yGroupLabels:{},xDataByKeys:{},yDataByKeys:{},facetKeyValues:k.reduce((Y,X,ee)=>(Y[X]=b[ee],Y),{}),xGroupKeyValues:P.reduce((Y,X,ee)=>(Y[X]=B[ee],Y),{}),yGroupKeyValues:I.reduce((Y,X,ee)=>(Y[X]=E[ee],Y),{}),valueExtent:[1/0,-1/0]},facets:{}},z=t.valueLabels??t.value,O=n.valueLabels??n.value,K=s.filter(Y=>Y.axis==="x").map(Y=>Y.valueColumn.value),te=s.filter(Y=>Y.axis==="y").map(Y=>Y.valueColumn.value),le=Object.values(c??{}).map(Y=>Y.value),G=Object.values(f??{}).map(Y=>Y.value),Q=Zn.uniq([...K,...le,z]),j=Zn.uniq([...te,...G,O]);if(e.rows.forEach(Y=>{let X=a.length?a.map(De=>Y[De.value]).join("_"):"null",ee=i.length?i.map(De=>Y[De.value]).join("_"):"null",pe=o.length?o.map(De=>Y[De.value]).join("_"):"null",ae=i.length?i.map(De=>Y[De.valueLabels??De.value]).join(", "):"",ge=o.length?o.map(De=>Y[De.valueLabels??De.value]).join(", "):"";$.meta.xGroupLabels[ee]=ae,$.meta.yGroupLabels[ee]=ge;let me=Y[t.value],fe=Y[n.value],Ce=Y[r.value]??h;if(!(me===null||fe===null||Ce===null)){if($.facets[X]||($.facets[X]={xKeys:[],yKeys:[],xKeysByGroups:{},yKeysByGroups:{},cells:{}}),$.facets[X].xKeysByGroups[ee]||($.facets[X].xKeysByGroups[ee]=[]),$.facets[X].yKeysByGroups[pe]||($.facets[X].yKeysByGroups[pe]=[]),$.facets[X].xKeys.push(me),$.facets[X].yKeys.push(fe),$.facets[X].xKeysByGroups[ee].push(me),$.facets[X].yKeysByGroups[pe].push(fe),$.facets[X].cells[me]||($.facets[X].cells[me]={}),$.meta.valueExtent[0]=Math.min(Ce,$.meta.valueExtent[0]),$.meta.valueExtent[1]=Math.max(Ce,$.meta.valueExtent[1]),$.facets[X].cells[me][fe])throw Error(`More than 1 value for x=${me}, y=${fe}`);if($.meta.xLabels[me]&&String(Y[z])!==$.meta.xLabels[me])throw Error(`More than 1 x-label value for x=${me}`);if($.meta.yLabels[fe]&&String(Y[O])!==$.meta.yLabels[fe])throw Error(`More than 1 y-label value for y=${fe}`);$.meta.xLabels[me]=String(Y[z]),$.meta.yLabels[fe]=String(Y[O]),Q.forEach(De=>{let ke=typeof $.meta.xDataByKeys[De]<"u",$e=ke&&typeof $.meta.xDataByKeys[De][me]<"u";if(ke||($.meta.xDataByKeys[De]={}),$e&&$.meta.xDataByKeys[De][me]!==Y[De])throw Error(`More than 1 value for x = ${me} and column = ${De}`);$e||($.meta.xDataByKeys[De][me]=Y[De])}),j.forEach(De=>{let ke=typeof $.meta.yDataByKeys[De]<"u",$e=ke&&typeof $.meta.yDataByKeys[De][fe]<"u";if(ke||($.meta.yDataByKeys[De]={}),$e&&$.meta.yDataByKeys[De][fe]!==Y[De])throw Error(`More than 1 value for y = ${fe} and column = ${De}`);$e||($.meta.yDataByKeys[De][fe]=Y[De])}),$.facets[X].cells[me][fe]={id:`${me}_${fe}`,x:me,y:fe,value:Ce,normalizedValue:Ce,data:Y}}}),$.meta.facetKeys=$.meta.facetKeys.filter(Y=>$.facets[Y]),$.meta.facetKeys.forEach(Y=>{let X=$.facets[Y];if(X.xKeys=Zn.uniq(X.xKeys),X.yKeys=Zn.uniq(X.yKeys),X.xKeys.length*X.yKeys.length>G7t)throw Error(`Too many cells for graph rendering (${X.xKeys.length*X.yKeys.length})`);P.forEach(ee=>{$.facets[Y].xKeysByGroups[ee]=Zn.uniq($.facets[Y].xKeysByGroups[ee])}),I.forEach(ee=>{$.facets[Y].yKeysByGroups[ee]=Zn.uniq($.facets[Y].yKeysByGroups[ee])})}),A){let Y=[1/0,-1/0];$.meta.facetKeys.forEach(X=>{let{xKeys:ee,yKeys:pe,cells:ae}=$.facets[X],ge=A.direction==="row"?ee:pe,me=A.direction==="row"?pe:ee,fe=A.direction==="row"?(Ce,De)=>{var ke;return(ke=ae[Ce])==null?void 0:ke[De]}:(Ce,De)=>{var ke;return(ke=ae[De])==null?void 0:ke[Ce]};me.forEach(Ce=>{let De=[];ge.forEach($e=>{var Oe;let je=(Oe=fe($e,Ce))==null?void 0:Oe.value;je!==void 0&&De.push(je)});let ke=X7t(A.method,De);ge.forEach($e=>{let je=fe($e,Ce);je!==void 0&&(je.normalizedValue=ke(je.value),Y[0]=Math.min(je.normalizedValue,Y[0]),Y[1]=Math.max(je.normalizedValue,Y[1]))})})}),$.meta.valueExtent=Y}return $.meta.xKeysByGroups=P.reduce((Y,X)=>(Y[X]=Zn.uniq(Zn.flatten($.meta.facetKeys.map(ee=>$.facets[ee].xKeysByGroups[X]))),Y),{}),$.meta.yKeysByGroups=I.reduce((Y,X)=>(Y[X]=Zn.uniq(Zn.flatten($.meta.facetKeys.map(ee=>$.facets[ee].yKeysByGroups[X]))),Y),{}),$.meta.valueExtent[0]===1/0&&($.meta.valueExtent[0]=0),$.meta.valueExtent[1]===-1/0&&($.meta.valueExtent[1]=0),$}function aZ(e,t){let n=0;for(let r=0;r<e.length;r++)n+=(e[r]-t[r])*(e[r]-t[r]);return n}function iZ(e,t){return Math.sqrt(aZ(e,t))}var oZ=(e,t,n)=>{let r=0;for(let a of e)for(let i of t)r+=n[a][i];return r/e.length/t.length},Z7t=(e,t,n)=>{let r=0;for(let a of e)for(let i of t)r=Math.max(r,n[a][i]);return r},J7t=(e,t,n)=>{let r=1/0;for(let a of e)for(let i of t)r=Math.min(r,n[a][i]);return r};function q7t(e){switch(e){case"average":return oZ;case"complete":return Z7t;case"single":return J7t;default:return oZ}}function e9t(e){switch(e){case"euclidean":return iZ;case"squaredEuclidean":return aZ;default:return iZ}}function lZ(e=[],t,n="euclidean",r="average"){let a=e9t(n),i=q7t(r),o=t.map(c=>t.map(f=>a(c,f))),s=e.map((c,f)=>({height:0,keys:[c],indexes:[f],children:[]}));for(let c=0;c<e.length&&!(c>=e.length-1);c++){let f=1/0,A=0,h=0;for(let g=0;g<s.length;g++)for(let C=g+1;C<s.length;C++){let b=i(s[g].indexes,s[C].indexes,o);b<f&&(f=b,A=g,h=C)}let v={keys:[...s[A].keys,...s[h].keys],indexes:[...s[A].indexes,...s[h].indexes],height:f,children:[s[A],s[h]]};s.splice(Math.max(A,h),1),s.splice(Math.min(A,h),1),s.push(v)}return s[0]}function t9t(e,t,n,r){let{facetKeys:a,xGroupKeys:i,yGroupKeys:o}=e.meta,s={};if(t&&r.sharedX)throw Error("Dendrogram on X axis is not available with shared by facets X axis");return a.forEach(c=>{let f={hierarchyX:[],hierarchyY:[]},A=e.facets[c];if(t){let h=[],v=[];i.forEach(g=>{let C=A.xKeysByGroups[g],b=A.yKeys,B=lZ(C,C.map(E=>b.map(k=>{var P;return((P=A.cells[E][k])==null?void 0:P.normalizedValue)??t.fillNA})),t.distance,t.linkage);e.facets[c].xKeysByGroups[g]=B.keys,v.push(...B.keys),h.push(B)}),e.facets[c].xKeys=v,f.hierarchyX=h.map(g=>_8(g))}if(n){let h=[],v=[];o.forEach(g=>{let C=A.yKeysByGroups[g],b=A.xKeys,B=lZ(C,C.map(E=>b.map(k=>{var P;return((P=A.cells[k][E])==null?void 0:P.normalizedValue)??n.fillNA})),n.distance,n.linkage);e.facets[c].yKeysByGroups[g]=B.keys,v.push(...B.keys),h.push(B)}),e.facets[c].yKeys=v,f.hierarchyY=h.map(g=>_8(g))}s[c]=f}),s}var n9t=15,Zv=8,Jv=30,r9t=48,a9t=24,B3=16,_3=4,lS=4,zM=20,i9t=16,Wc=16,T3=8,Ap={left:["annotations","axis","groups","axisTitle","dendro"],right:["annotations","axis","groups","axisTitle","dendro"],top:["annotations","axis","groups","axisTitle","dendro","facetTitle"],bottom:["annotations","axis","groups","axisTitle","dendro"]},sZ={fillColor:"white",lineColor:Vt,lineWidth:1,lineShape:"solid",dotSize:3,dotFill:Vt,dotShape:"21"};function o9t(e,t,n,r,a,i,o,s,c,f,A,h,v,g){let C=h.length>1&&(!c||o.includes(t.groupingPosition)),b=!c||o.includes(t.position),B=A.length>1&&(!s||o.includes(e.groupingPosition)),E=!s||o.includes(e.position),k=f.length>1,P=r.filter(ee=>o.includes(ee.position)||!s&&["left","right"].includes(ee.position)||!c&&["top","bottom"].includes(ee.position)),I=P.filter(ee=>ee.position==="left").length,$=P.filter(ee=>ee.position==="right").length,z=P.filter(ee=>ee.position==="top").length,O=P.filter(ee=>ee.position==="bottom").length,K=e.showTicks?lS:0,te=t.showTicks?lS:0,le=E&&e.showTitle?Jv:0,G=b&&t.showTitle?Jv:0,Q=E&&e.showAxisLabels&&v>B3?n.xAxisCaptions+K+_3:0,j=b&&t.showAxisLabels&&g>B3?n.yAxisCaptions+te+_3:0,Y=B&&e.showGroupLabels?n.xGroupCaptions:0,X=C&&t.showGroupLabels?n.yGroupCaptions:0;return{left:{dendro:!(i!=null&&i.hidden)&&(i==null?void 0:i.position)==="left"?i.size:0,axisTitle:t.position==="left"?G:0,groups:t.groupingPosition==="left"?X:0,axis:t.position==="left"?j:0,annotations:I*Wc+(I&&T3)},right:{dendro:!(i!=null&&i.hidden)&&(i==null?void 0:i.position)==="right"?i.size:0,axisTitle:t.position==="right"?G:0,groups:t.groupingPosition==="right"?X:0,axis:t.position==="right"?j:0,annotations:$*Wc+($&&T3)},top:{facetTitle:k?r9t:0,dendro:!(a!=null&&a.hidden)&&(a==null?void 0:a.position)==="top"?a.size:0,axisTitle:e.position==="top"?le:0,groups:e.groupingPosition==="top"?Y:0,axis:e.position==="top"?Q:0,annotations:z*Wc+(z&&T3)},bottom:{dendro:!(a!=null&&a.hidden)&&(a==null?void 0:a.position)==="bottom"?a.size:0,axisTitle:e.position==="bottom"?le:0,groups:e.groupingPosition==="bottom"?Y:0,axis:e.position==="bottom"?Q:0,annotations:O*Wc+(O&&T3)}}}function l9t(e,t,n){return{left:Ap.left.reduce((r,a,i)=>{let o=i>0?Ap.left[i-1]:null,s=e.left[a];return r[a]={x:o?r[o].x-s:-s,y:0,width:s,height:n,isVisible:s>0},r},{}),right:Ap.right.reduce((r,a,i)=>{let o=i>0?Ap.right[i-1]:null,s=e.right[a];return r[a]={x:o?r[o].x+r[o].width:t,y:0,width:s,height:n,isVisible:s>0},r},{}),top:Ap.top.reduce((r,a,i)=>{let o=i>0?Ap.top[i-1]:null,s=e.top[a];return r[a]={x:0,y:o?r[o].y-s:-s,width:t,height:s,isVisible:s>0},r},{}),bottom:Ap.bottom.reduce((r,a,i)=>{let o=i>0?Ap.bottom[i-1]:null,s=e.bottom[a];return r[a]={x:0,y:o?r[o].y+r[o].height:n,width:t,height:s,isVisible:s>0},r},{})}}function OM(e,t,n){let r=(t-e)/n,a=Zn.range(e,t-r/2,r);return a.push(t),a}function uZ(e,t){let n=OM(0,1,e.length-1),r=Zr().domain(n).range(e),a=OM(0,1,t.length-1).map(i=>r(i));return Qo().domain(t).range(a).unknown("#ccc")}function s9t(e,t,n,r,a,i){let o=OM(0,1,e.length-1),s=Zr().domain(o).range(e),c=[r,...o.filter(b=>b>r&&b<a),a],f=[a,...o.filter(b=>b>a&&b<i),i],A=(n-t)/2,h=c.map(b=>t+A*(b-r)/(a-r)),v=f.map(b=>(t+n)/2+A*(b-a)/(i-a)),g=c.map(b=>s(b)),C=f.map(b=>s(b));return Zr().domain(h.concat(v.slice(1))).range(g.concat(C.slice(1)))}var u9t=new hc("bold 14px Arial");function sS(e){let t=0;for(let n of e){let r=u9t.getTextWidth(n);r>t&&(t=r)}return t}function c9t(e,t,n,r){let a=e.filter(f=>f.showTitle&&(t.includes(f.position)||!n&&["left","right"].includes(f.position)||!r&&["top","bottom"].includes(f.position))),i=a.filter(f=>f.titlePosition==="left").map(f=>f.valueColumn.label??f.valueColumn.value),o=a.filter(f=>f.titlePosition==="right").map(f=>f.valueColumn.label??f.valueColumn.value),s=a.filter(f=>f.titlePosition==="top").map(f=>f.valueColumn.label??f.valueColumn.value),c=a.filter(f=>f.titlePosition==="bottom").map(f=>f.valueColumn.label??f.valueColumn.value);return{left:sS(i),right:sS(o),top:sS(s),bottom:sS(c)}}function f9t(e,t,n,r,a){let{facetKeys:i,xGroupKeys:o,yGroupKeys:s,xKeysByGroups:c,yKeysByGroups:f,xLabels:A,yLabels:h}=r.meta,v=e.xGroupLabels/180*Math.PI,g=e.yGroupLabels/180*Math.PI,C=e.xAxisLabels/180*Math.PI,b=e.yAxisLabels/180*Math.PI,B=0,E=0,k=e.xGroupLabels===45,P=e.xAxisLabels===45;if(k||P)if(!t.sharedX)i.forEach(z=>{let O=o.find(j=>r.facets[z].xKeysByGroups[j].length>0);if(!O)return;let K=r.facets[z].xKeysByGroups[O],te=n.x[z],le=te>B3,G=K.length*te/2,Q=A[K[0]];B=Math.max(B,(k?a.getTextWidth(O)*Math.cos(v):0)-G,(P&&le?a.getTextWidth(Q)*Math.cos(C):0)-te/2)});else{let z=o[0],O=i[0];if(z){let K=c[z],te=n.x[O],le=te>B3,G=K.length*te/2,Q=A[K[0]];B=Math.max(B,(k?a.getTextWidth(z)*Math.cos(v):0)-G,(P&&le?a.getTextWidth(Q)*Math.cos(C):0)-te/2)}}let I=e.yGroupLabels===45,$=e.yAxisLabels===45;if(I||$)if(!t.sharedY)i.forEach(z=>{let O=Zn.findLast(s,j=>r.facets[z].yKeysByGroups[j].length>0);if(!O)return;let K=r.facets[z].yKeysByGroups[O],te=n.y[z],le=te>B3,G=K.length*te/2,Q=h[K[K.length-1]];E=Math.max(E,(I?a.getTextWidth(O)*Math.cos(g):0)-G,($&&le?a.getTextWidth(Q)*Math.cos(b):0)-te/2)});else{let z=s[s.length-1],O=i[0];if(z){let K=f[z],te=n.y[O],le=te>B3,G=K.length*te/2,Q=h[K[K.length-1]];E=Math.max(E,(I?a.getTextWidth(z)*Math.cos(g):0)-G,($&&le?a.getTextWidth(Q)*Math.cos(b):0)-te/2)}}return{xCaptionTail:B,yCaptionTail:E}}function cZ(e,t,n,r){let a=[];return e%n===n-1&&a.push("right"),e%n===0&&a.push("left"),e<n&&a.push("top"),(Math.ceil((e+1)/n)===r||Math.ceil((e+1)/n)===r-1&&e%n>(t-1)%n)&&a.push("bottom"),a}function d9t(e,t,n,r,a){if(e){let s=Wc/2,c=n==="top"?-5:a+5;return{x:s,y:c,rotate:t==="left"?-90:90,anchor:t==="left"&&n==="top"?"start":"end"}}let i=n==="right"?r+5:-5,o=Wc/2;return{x:i,y:o,rotate:0,anchor:n==="right"?"start":"end"}}function A9t(e){return e!==null&&!("data"in e)}function uS({facetKey:e,data:t,scales:n,stepX:r,stepY:a,x:i,y:o,annotation:s,showTitle:c,width:f,height:A,colorScale:h,aes:v,frame:g,xGroupKeys:C,yGroupKeys:b,xKeysByGroups:B,yKeysByGroups:E,tooltipsData:k,activeElementContainer:P}){let{position:I,titlePosition:$,valueColumn:z}=s,O=I==="left"||I==="right",K=(O?n.y:n.x).domain(),te=d9t(O,I,$,f,A),le=k.fixed&&P;return ie.jsxs("g",{children:[K.map(G=>{let Q=t==null?void 0:t[G],j=h.type==="continuous"?h.scale(Number(Q)):h.scale(String(Q)),Y=i+(O?0:n.x(G)),X=o+(O?n.y(G):0),ee=O?Wc:r,pe=O?a:Wc,ae=O?null:G,ge=O?G:null,me=le&&A9t(k.selectedData)&&k.selectedData.xKey===ae&&k.selectedData.yKey===ge&&e===k.currentFacet,fe=ie.jsx("rect",{x:Y,y:X,width:ee,height:pe,fill:j,stroke:v.cellStrokeColor,onMouseOver:()=>k.onMouseOver({x:Y+ee,y:X+pe/2,xKey:ae,yKey:ge,value:Q,title:z.label??z.value},e),onMouseLeave:()=>k.onMouseLeave()},G);return me?cu.createPortal(fe,P):fe}),k.fixed&&!O&&C.map(G=>{let Q=B[G].length;if(Q===0)return null;let j=Q*r,Y=n.x(B[G][0]);return ie.jsx("rect",{x:Y+i,y:o,width:j,height:Wc,stroke:"none",fill:"rgba(255, 255, 255, 0.8)"},`${Y}_${o}`)}),k.fixed&&O&&b.map(G=>{let Q=E[G].length;if(Q===0)return null;let j=Q*a,Y=n.y(E[G][0]);return ie.jsx("rect",{x:i,y:Y+o,width:Wc,height:j,stroke:"none",fill:"rgba(255, 255, 255, 0.8)"},`${i}_${Y}`)}),g.type==="groups"&&!O&&C.map(G=>{let Q=B[G].length;if(Q===0)return null;let j=Q*r,Y=n.x(B[G][0]);return ie.jsx("rect",{x:Y+i,y:o,width:j,height:Wc,stroke:Vt,fill:"none"},`${Y}_${o}`)}),g.type==="groups"&&O&&b.map(G=>{let Q=E[G].length;if(Q===0)return null;let j=Q*a,Y=n.y(E[G][0]);return ie.jsx("rect",{x:i,y:Y+o,width:Wc,height:j,stroke:Vt,fill:"none"},`${i}_${Y}`)}),c&&ie.jsx("g",{fontWeight:"500",fontSize:"14px",transform:`translate(${i+te.x},${o+te.y}) rotate(${te.rotate})`,children:ie.jsx("text",{textAnchor:te.anchor,dominantBaseline:"central",children:z.label??z.value})})]})}function cS(e,t){return e.showTitle&&t.includes(e.titlePosition)}function h9t({facetKey:e,sideElementBBoxes:t,annotations:n,annotationColorScales:r,cellsMeta:a,chartEdgeSides:i,sharedX:o,sharedY:s,width:c,height:f,scales:A,stepX:h,stepY:v,aes:g,frame:C,xGroupKeys:b,yGroupKeys:B,xKeysByGroups:E,yKeysByGroups:k,tooltipsData:P,activeElementContainer:I}){let $=n.filter(j=>i.includes(j.position)||!o&&["left","right"].includes(j.position)||!s&&["top","bottom"].includes(j.position)),z=$.filter(j=>j.position==="left"),O=$.filter(j=>j.position==="right"),K=$.filter(j=>j.position==="top"),te=$.filter(j=>j.position==="bottom"),{xDataByKeys:le,yDataByKeys:G}=a,Q={facetKey:e,scales:A,stepX:h,stepY:v,width:c,height:f,aes:g,frame:C,xGroupKeys:b,yGroupKeys:B,xKeysByGroups:E,yKeysByGroups:k,tooltipsData:P,activeElementContainer:I};return ie.jsxs("g",{children:[z.map((j,Y)=>ie.jsx(uS,{annotation:j,colorScale:r[j.id],data:G[j.valueColumn.value],showTitle:cS(j,i),x:t.left.annotations.x+Y*Wc,y:t.left.annotations.y,...Q},j.id)),O.map((j,Y)=>ie.jsx(uS,{annotation:j,colorScale:r[j.id],data:G[j.valueColumn.value],showTitle:cS(j,i),x:t.right.annotations.x+Y*Wc+T3,y:t.right.annotations.y,...Q},j.id)),K.map((j,Y)=>ie.jsx(uS,{annotation:j,colorScale:r[j.id],data:le[j.valueColumn.value],showTitle:cS(j,i),x:t.top.annotations.x,y:t.top.annotations.y+Y*Wc,...Q},j.id)),te.map((j,Y)=>ie.jsx(uS,{annotation:j,colorScale:r[j.id],data:le[j.valueColumn.value],showTitle:cS(j,i),x:t.bottom.annotations.x,y:t.bottom.annotations.y+Y*Wc+T3,...Q},j.id))]})}function p9t({sideElementBBoxes:e,xGroupKeys:t,yGroupKeys:n,xKeysByGroups:r,yKeysByGroups:a,xGroupLabels:i,yGroupLabels:o,scales:s,stepX:c,stepY:f,xAxis:A,yAxis:h,labelAngles:v,debug:g}){let C=e.top.groups.isVisible||e.bottom.groups.isVisible,b=e.top.groups.isVisible?e.top.groups:e.bottom.groups,B=e.left.groups.isVisible||e.right.groups.isVisible,E=e.left.groups.isVisible?e.left.groups:e.right.groups;return ie.jsxs("g",{children:[C&&ie.jsx("g",{transform:`translate(${b.x},${b.y})`,children:t.map(k=>{let P=r[k].length;if(P===0)return null;let I=v.xGroupLabels!==0,$=A.groupingPosition==="top",z=P*c,O=s.x(r[k][0])+z/2,K=I?$?b.height:0:b.height/2,te=-v.xGroupLabels,le=I?$?"start":"end":"middle";return ie.jsxs("g",{transform:`translate(${O},${K})`,children:[ie.jsx("text",{transform:`rotate(${te})`,dominantBaseline:"central",textAnchor:le,children:i[k]}),g&&ie.jsx("rect",{x:-z/2,width:z,height:b.height,stroke:"black",fill:"none"})]},k)})}),B&&ie.jsx("g",{transform:`translate(${E.x},${E.y})`,children:n.map(k=>{let P=a[k].length;if(P===0)return null;let I=P*f,$=h.groupingPosition==="left",z=$?E.width:0,O=s.y(a[k][0])+I/2,K=v.yGroupLabels!==0,te=v.yGroupLabels===45?-45:($?-1:1)*(90-v.yGroupLabels),le=K?$?"end":"start":"middle";return ie.jsxs("g",{transform:`translate(${z},${O})`,children:[ie.jsx("text",{y:K?0:-E.width/2,transform:`rotate(${te})`,dominantBaseline:"central",textAnchor:le,children:o[k]}),g&&ie.jsx("rect",{x:-E.width/2,y:-I/2,width:E.width,height:I,stroke:"black",fill:"none"})]},k)})})]})}function v9t({sideElementBBoxes:e,debug:t,xKeys:n,yKeys:r,scales:a,xAxis:i,yAxis:o,stepX:s,stepY:c,labelAngles:f,xLabels:A,yLabels:h}){let v=i.showTicks?lS:0,g=o.showTicks?lS:0,C=e.top.axis.isVisible||e.bottom.axis.isVisible,b=e.top.axisTitle.isVisible?e.top.axisTitle:e.bottom.axisTitle,B=e.top.axis.isVisible?e.top.axis:e.bottom.axis,E=e.left.axis.isVisible||e.right.axis.isVisible,k=e.left.axisTitle.isVisible?e.left.axisTitle:e.right.axisTitle,P=e.left.axis.isVisible?e.left.axis:e.right.axis;return ie.jsxs("g",{children:[ie.jsxs("g",{children:[b.isVisible&&ie.jsxs("g",{transform:`translate(${b.x},${b.y})`,children:[ie.jsx("text",{x:b.width/2,y:b.height/2,textAnchor:"middle",dominantBaseline:"central",children:i.title}),t&&ie.jsx("rect",{width:b.width,height:b.height,stroke:Vt,fill:"none"})]}),C&&ie.jsxs("g",{fontSize:"14px",transform:`translate(${B.x},${B.y})`,children:[n.map(I=>{let $=f.xAxisLabels!==0,z=i.position==="bottom",O=z?0:B.height,K=z?O+v:O-v,te=z?K+_3:K-_3,le=a.x(I)+s/2,G=-f.xAxisLabels;return ie.jsxs("g",{children:[ie.jsx("line",{x1:le,x2:le,y1:O,y2:K,stroke:Vt}),ie.jsx("text",{x:le,y:te,textAnchor:$?z?"end":"start":"middle",transform:`rotate(${G},${le},${te})`,dominantBaseline:$?"central":z?"hanging":"auto",children:A[I]})]},I)}),t&&ie.jsx("rect",{width:B.width,height:B.height,stroke:Vt,fill:"none"})]})]}),ie.jsxs("g",{children:[k.isVisible&&ie.jsx("g",{transform:`translate(
|
|
15126
|
+
M-${a},${t}L0,${t-2*a}L${a},${t}z`,fill:"none",stroke:n})}case"12":return ie.jsx("path",{d:`M -${t},-${t} l ${t*2},0 l 0,${t*2} l -${t*2},0 l 0,-${t*2}z M0,-${t}L 0,${t} M -${t},0 L ${t},0`,fill:"none",stroke:n});case"13":return ie.jsx("path",{d:`M -${t},0 a ${t},${t} 0 1,0 ${t*2},0 a ${t},${t} 0 1,0 -${t*2},0z M-${t},-${t}L ${t},${t} M ${t},-${t} L -${t},${t}`,fill:"none",stroke:n});case"14":return ie.jsx("path",{d:`M -${t},-${t} l ${t*2},0 l 0,${t*2} l -${t*2},0 l 0,-${t*2}z M-${t},${t}L0,${-t}L${t},${t}`,fill:"none",stroke:n});case"15":return ie.jsx("path",{d:`M -${t},-${t} l ${t*2},0 l 0,${t*2} l -${t*2},0 l 0,-${t*2}z`,fill:n,stroke:n});case"16":return ie.jsx("path",{d:`M -${t},0 a ${t},${t} 0 1,0 ${t*2},0 a ${t},${t} 0 1,0 -${t*2},0z`,fill:n,stroke:n});case"17":return ie.jsx("path",{d:`M0,-${t}L ${2*t*Math.tan(Math.PI/6)},${t}L ${-2*t*Math.tan(Math.PI/6)},${t}z`,fill:n,stroke:n});case"18":{let a=t*qC;return ie.jsx("path",{d:`M0,-${a}L ${a},0 L 0,${a} L -${a},0z`,fill:n,stroke:n})}case"20":{let a=t*2/3;return ie.jsx("path",{d:`M -${a},0 a ${a},${a} 0 1,0 ${a*2},0 a ${a},${a} 0 1,0 -${a*2},0z`,fill:n,stroke:n})}case"22":return ie.jsx("path",{d:`M -${t},-${t} l ${t*2},0 l 0,${t*2} l -${t*2},0 l 0,-${t*2}z`,fill:n,stroke:r??b9(n)});case"21":return ie.jsx("path",{d:`M -${t},0 a ${t},${t} 0 1,0 ${t*2},0 a ${t},${t} 0 1,0 -${t*2},0z`,fill:n,stroke:r??b9(n)});case"24":return ie.jsx("path",{d:`M0,-${t}L ${2*t*Math.tan(Math.PI/6)},${t}L ${-2*t*Math.tan(Math.PI/6)},${t}z`,fill:n,stroke:r??b9(n)});case"23":{let a=t*qC;return ie.jsx("path",{d:`M0,-${a}L ${a},0 L 0,${a} L -${a},0z`,fill:n,stroke:r??b9(n)})}case"25":return ie.jsx("path",{d:`M${-2*t*Math.tan(Math.PI/6)},-${t}L ${2*t*Math.tan(Math.PI/6)},-${t}L0,${t}z`,fill:n,stroke:r??b9(n)});default:d1(e,`Unknown point shape ${e}`)}}var _4t=12;function dK({nodes:e,rootPosition:t,showLeavesLabels:n,showNodesLabels:r,aesGetters:a,selectedNodeId:i,onClick:o,onSelectedUpdate:s}){let c=t==="top",[f,A]=tn.useState(null);return tn.useEffect(()=>{A(null)},[i]),ie.jsxs(ie.Fragment,{children:[ie.jsx("g",{children:e.map(h=>{let v=h.data.rawData[0],g=a.nodeSize(v),C=a.nodeColor(v),b=c?h.x:h.y,B=c?h.y:h.x;return ie.jsx("g",{transform:`translate(${b},${B})`,style:{cursor:"pointer"},onClick:E=>{E.stopPropagation(),o({x:b+Qu.LEFT,y:B+Qu.TOP,info:h.data.rawData}),s(h)},children:ie.jsx("g",{children:ie.jsx("circle",{cx:0,cy:0,r:g+_4t,fill:i===h.id?KX:f===h.id?C:"transparent",opacity:CM,onMouseOver:()=>A(h.id??null),onMouseLeave:()=>A(null)})})},h.id)})}),ie.jsx("g",{children:e.map(h=>{let v=h.data.rawData[0],g=a.nodeShape(v),C=a.nodeSize(v),b=a.nodeColor(v),B=c?h.x:h.y,E=c?h.y:h.x;return ie.jsx("g",{transform:`translate(${B},${E})`,style:{cursor:"pointer"},onClick:k=>{k.stopPropagation(),o({x:B+Qu.LEFT,y:E+Qu.TOP,info:h.data.rawData}),s(h)},children:ie.jsx("g",{onMouseOver:()=>A(h.id??null),onMouseLeave:()=>A(null),children:Yc(g,C,i===h.id?KX:b)})},h.id)})}),ie.jsx("g",{children:e.map(h=>{let v=h.data.rawData[0],g=a.nodeSize(v),C=c?h.x:h.y,b=c?h.y:h.x;return ie.jsx("g",{transform:`translate(${C},${b})`,style:{pointerEvents:"none"},children:(r&&h.children||n&&!h.children)&&ie.jsx("text",{x:g+4,y:"4",paintOrder:"stroke",stroke:"white",strokeWidth:"3",children:h.data.label})},h.id)})})]})}var AK=14,eS=12,C9=12,tS=-12;function T4t({aes:e,label:t}){let n=Yc(e.shape,e.size,e.color);return ie.jsxs("g",{children:[ie.jsx("g",{transform:`translate(${C9/2},${C9/2})`,children:n}),ie.jsx("text",{x:C9+8,y:C9/2,dominantBaseline:"central",fontWeight:500,children:t})]})}function k4t({legendData:e}){let t=e.items.filter(n=>n.type==="continuous");return ie.jsxs("g",{children:[ie.jsx("defs",{children:t.map(n=>ie.jsx("linearGradient",{id:n.id,gradientTransform:"rotate(90)",children:n.scale.domain().map(r=>{let a=n.scale.domain(),i=a[a.length-1]-a[0],o=i>0?(r-a[0])/i*100:0;return ie.jsx("stop",{offset:`${o}%`,stopColor:n.scale(r)},r)})},n.id))}),e.items.map(n=>{if(n.type==="continuous"){let r=Math.min(...n.values),a=Math.max(...n.values);return ie.jsxs("g",{transform:`translate(${n.left},${n.top})`,children:[ie.jsx("text",{fontWeight:500,fontSize:"14px",y:tS,children:n.title}),ie.jsx("rect",{x:"0",y:"0",width:AK,height:n.height,stroke:Vt,fill:`url(#${n.id})`}),ie.jsx("g",{transform:`translate(${AK},0)`,children:n.values.map(i=>{let o=a-r,s=o>0?n.height*(i-r)/o:0;return ie.jsxs("g",{transform:`translate(0,${s})`,children:[ie.jsx("line",{x1:"0",x2:-4,stroke:Vt}),ie.jsx("text",{x:8,y:4,children:i})]},i)})}),!1]},n.id)}if(n.type==="discrete")return ie.jsxs("g",{transform:`translate(${n.left},${n.top})`,children:[ie.jsx("text",{fontWeight:500,fontSize:"14px",y:tS,children:n.title}),n.values.map((r,a)=>ie.jsxs("g",{transform:`translate(0, ${a*(eS+4)})`,children:[ie.jsx("rect",{x:"0",y:"0",width:eS,height:eS,fill:n.scale(r),rx:"1",ry:"1"}),ie.jsx("text",{x:eS+8,y:10,children:r})]},r)),!1]},n.id);if(n.type==="nodes")return ie.jsxs("g",{transform:`translate(${n.left},${n.top})`,fontSize:"14px",fontWeight:500,children:[ie.jsx("text",{fontWeight:500,y:tS,children:n.title}),n.values.map((r,a)=>ie.jsx("g",{transform:`translate(0, ${a*(C9+4)})`,children:ie.jsx(T4t,{aes:n.scale(r),label:n.labels[r]})},r)),!1]},n.id);if(n.type==="size"){let r=n.height/n.values.length;return ie.jsxs("g",{transform:`translate(${n.left},${n.top})`,fontSize:"14px",fontWeight:500,children:[ie.jsx("text",{fontWeight:500,y:tS,children:n.title}),n.values.map((a,i)=>{let o=n.scale(a);return ie.jsxs("g",{transform:`translate(0, ${i*r})`,children:[ie.jsx("circle",{r:o,cx:r/2,cy:r/2,fill:Vt}),ie.jsx("text",{x:r+4,y:r/2,alignmentBaseline:"central",children:n.labels[a]})]},a)}),!1]},n.id)}})]})}function hK(e){if(!e)return null;let t=new Set,n=e;for(;n;)t.add(n.id),n=n.parent;return t}function M4t({chartSettings:e,chartSizes:t,nodes:n,links:r,connectionType:a,rootPosition:i,edgeInheritance:o,showNodes:s,showEdges:c,showLeavesLabels:f,showNodesLabels:A,aesGetters:h,labels:v,heatmapData:g,heatmapScales:C,heatmapStep:b,heatmapColor:B,heatmapLabels:E,legendData:k,onClick:P}){let I=tn.useRef(null),[$,z]=tn.useState(null),O=tn.useRef(null);tn.useEffect(()=>{O.current&&z(O.current);function X(){te(null),G(null)}function ee(pe){Object.entries(pe.detail).forEach(([ae,ge])=>{if(ae==="selectedNode"){let me=n.find(fe=>fe.data.rawData[0].id===ge)??null;te(hK(me)),G(me)}})}return document.addEventListener("click",X),document.addEventListener(SM,ee),()=>{document.removeEventListener("click",X),document.removeEventListener(SM,ee)}},[]);let[K,te]=T8.useState(null),[le,G]=T8.useState(null),Q=K!==null,j={connectionType:a,rootPosition:i,edgeInheritance:o,aesGetters:h},Y={rootPosition:i,showLeavesLabels:f,showNodesLabels:A,aesGetters:h,labels:v,onClick:P,selectedNodeId:le==null?void 0:le.id,onSelectedUpdate:X=>{te(hK(X)),G(X)}};return ie.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${t.totalWidth} ${t.totalHeight}`,ref:I,width:t.totalWidth,height:t.totalHeight,children:[ie.jsx("defs",{children:Qm}),ie.jsxs("g",{transform:`translate(${Qu.LEFT},${Qu.TOP})`,fontFamily:"Manrope",children:[ie.jsx("text",{x:"0",y:"-12",fontSize:"20",children:e.title.name}),ie.jsxs("g",{opacity:Q?CM:1,children:[c&&ie.jsx(fK,{links:r.filter(X=>{let{source:ee,target:pe}=X;return!K||!(K.has(ee.id??"")&&K.has(pe.id??""))}),selected:!1,...j}),s&&ie.jsx(dK,{nodes:n.filter(X=>!X.data.isFake&&!(K!=null&&K.has(X.id??""))),...Y})]}),Q&&ie.jsxs("g",{children:[c&&ie.jsx(fK,{links:r.filter(X=>{let{source:ee,target:pe}=X;return K.has(ee.id??"")&&K.has(pe.id??"")}),selected:!0,...j}),s&&ie.jsx(dK,{nodes:n.filter(X=>!X.data.isFake&&(K==null?void 0:K.has(X.id??""))),...Y})]}),g!==null&&ie.jsx("g",{transform:`translate(${t.treeWidth+30},0)`,children:ie.jsx(E4t,{heatmapData:g,scales:C,step:b,colorScale:B,chartSizes:t,labels:E,selectedNode:le,tooltipsContainer:$})}),e.legend.show&&ie.jsx("g",{transform:`translate(${t.treeWidth+30+t.heatmapWidth+30},0)`,children:ie.jsx(k4t,{legendData:k})})]}),ie.jsx("g",{ref:O})]})}function Xv({message:e}){return ie.jsx("div",{style:{width:"500px",height:"400px",color:"#ee1616",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"25px",fontFamily:"Arial",border:"1px solid",padding:"20px",lineHeight:"25px"},children:e})}function S9(e){if(JX(e))return t=>e.valuesMap[String(t[e.columnName.value])];if(oh(e)){let{domain:t,range:n}=e,r=cv().domain(t).range(n);return a=>{let i=r(Number(a[e.columnName.value]));return Math.max(1,i)}}return t=>e}function P4t(e){return{nodeShape:S9(e.nodeShape),nodeColor:S9(e.nodeColor),nodeSize:S9(e.nodeSize),lineShape:S9(e.lineShape),lineColor:S9(e.lineColor)}}var H4t=(e,t)=>{let n=Math.min(...t),r=Math.max(...t);if(n===r){let o=e%2===0?[]:[n];for(let s=1;s<e/2+1;s++)o.push(n+s),o.unshift(n-s);return o}if(e<2)return[n,r];let a=(r-n)/(e-1),i=[];for(let o=0;o<e-1;o++)i.push(n+a*o);return i.push(r),i};function D4t(e,t=1,n,r){let a=(e<16?40:e<49?32:24)*t;return Math.max(Math.min(a,r??1/0),n??-1/0)}var $4t=class{constructor(){Be(this,"component",ie.jsx(ie.Fragment,{}));Be(this,"reactRoot",null);Be(this,"parentNode",null);Be(this,"rootNode",null);Be(this,"chartSizes",{treeWidth:600,treeHeight:350,heatmapWidth:0,heatmapHeight:0,totalWidth:1200+Qu.LEFT+Qu.RIGHT,totalHeight:350+Qu.TOP+Qu.BOTTOM,labelsOffset:0});Be(this,"legend",{width:0,height:0,items:[]});Be(this,"heatmapScales",{x:Qo().domain(["null"]).range([1]),y:Qo().domain(["null"]).range([1])});Be(this,"heatmapStep",{x:0,y:0});Be(this,"heatmapColorScale",{scale:Qo([]),getter:()=>"white"});Be(this,"heatmapLabels",[])}clear(){var e;this.parentNode&&this.rootNode&&((e=this.parentNode)==null||e.removeChild(this.rootNode),this.parentNode=null,this.rootNode=null),setTimeout(()=>{var t;(t=this.reactRoot)==null||t.unmount(),this.reactRoot=null})}init(e){this.parentNode===null&&(this.parentNode=e,this.rootNode=document.createElement("div"),this.parentNode.appendChild(this.rootNode),this.reactRoot=Wh(this.rootNode))}updateHeatmapScales(e,t,n){if(e===null){this.chartSizes.heatmapWidth=0;return}let{xKeysByGroups:r,xGroupKeys:a,xKeys:i,yKeys:o}=e,s=5,c=a.map(B=>r[B].length),f=c.reduce((B,E)=>B+E,0),A=this.chartSizes.treeHeight/o.length,h=Math.min(Math.max((400-(c.filter(B=>B>0).length-1)*s)/f,n.minCellWidth),n.maxCellWidth),v=[],g=0;a.forEach(B=>{let E=r[B];E.forEach(()=>{v.push(g),g+=h}),E.length>0&&(g+=s)}),this.heatmapScales.x=Qo().domain(i).range(v),this.heatmapScales.y=Qo().domain(o).range(o.map((B,E)=>E*A)),this.heatmapStep.x=h,this.heatmapStep.y=A;let{colorsList:C,colorsMap:b}=t.aes;if(t.valueType==="continuous"&&C){let B=Zr().domain(H4t(C.length,e.meta.valueExtent)).range(C);this.heatmapColorScale={scale:B,getter:E=>B(E)}}if(t.valueType==="discrete"&&b){let B=Object.keys(b).filter(E=>e.meta.uniqueValues.has(E));this.heatmapColorScale={scale:Qo(B,B.map(E=>b[E])).unknown(v9),getter:E=>E?b[E]??v9:v9}}if(t.valueType==="stringSource"&&C){let B=[...e.meta.uniqueValues],E=Qo(B,B.map((k,P)=>C[P%C.length])).unknown(v9);this.heatmapColorScale={scale:E,getter:k=>k?E(k):v9}}this.chartSizes.heatmapWidth=this.heatmapScales.x(e.xKeys[e.xKeys.length-1])+this.heatmapStep.x}updateLegendSize(e,t,n,r,a,i){if(!e.show){this.legend={width:0,height:0,items:[]};return}let o=new hc("600 14px Arial"),s=16,c=48,f=20,A=24;function h(I,$){return Math.max(...I.map(z=>o.getTextWidth(String(z))+f),o.getTextWidth($))}let v=[];[n.nodeColor,n.nodeShape,n.lineColor].filter(JX).map(I=>I.columnName).forEach(I=>{let $=t[I.value];if($.usedAes.length===0||!$.aesMap)return;let z=I.label??I.value,O=$.values,K={};O.forEach(te=>{K[te]||(K[te]={...Gv}),$.usedAes.forEach(le=>{var G,Q,j;(le==="dotFill"||le==="lineColor")&&(K[te].color=((G=$.aesMap[te])==null?void 0:G[le])??Vt),le==="dotShape"&&(K[te].shape=((Q=$.aesMap[te])==null?void 0:Q[le])??"21"),le==="dotSize"&&(K[te].size=((j=$.aesMap[te])==null?void 0:j[le])??3)})}),v.push({columnKey:z,data:K,values:$.values,labels:$.labels})});let g=[],C=0,b=0,B=0,E=Math.min(this.chartSizes.treeHeight,400);if(r&&a){let I=i.valueType,$=r.label??r.value;if(I==="continuous"){let z=this.heatmapColorScale.scale,O=A3(z,a.meta.valueExtent,4),K={id:"heatmapValue",type:"continuous",width:oK(O,$),height:E,left:0,top:0,title:$,scale:z,values:O,labels:{}};g.push(K),b=K.height+c,C=K.width}else{let z=this.heatmapColorScale.scale,O=s4t(z,$),K=z.domain(),te=K.length*s,le={id:"heatmapValue",type:"discrete",width:O,height:te,left:0,top:0,title:$,scale:z,values:K,labels:{}};g.push(le),b=le.height+c,C=le.width}}if(v.map(({columnKey:I,labels:$,values:z,data:O})=>{b>E&&(b=0,B+=C+A);let K=I,te=h(z.map(Y=>$[Y]),K),le=z.length*s;le>E&&(E=le);let G=Qo().domain(z).range(z.map(Y=>O[Y])),Q=B,j=b;g.push({id:I,type:"nodes",width:te,height:le,left:Q,top:j,title:K,scale:G,values:z,labels:$}),C=te,b+=le+c}),oh(n.nodeSize)){b>E&&(b=0,B+=C+A);let{columnName:I,domain:$,range:z}=n.nodeSize,O=I.label??I.value,K=cv($,z),te=K.ticks(3),le=K.tickFormat(3),G=te.reduce((ee,pe)=>(ee[String(pe)]=le(pe),ee),{}),Q=h(te.map(ee=>G[ee]),O),j=(K(Math.max(...te))*2+4)*te.length;j>E&&(E=j);let Y=B,X=b;g.push({id:I.value,type:"size",width:Q,height:j,left:Y,top:X,title:O,scale:K,values:te,labels:G}),C=Q,b+=j+c}let k=B+C+2*YC,P=E;this.legend={width:k,height:P,items:g}}updateChartSizes(e,t,n){let r=n.leaves().length;this.chartSizes.treeWidth=t?e.width/2:e.width;let a=D4t(r,e.scale,e.minCellHeight,e.maxCellHeight)*r;this.chartSizes.treeHeight=a,this.chartSizes.heatmapHeight=a}updateTotalSizes(e){this.chartSizes.totalWidth=this.chartSizes.treeWidth+this.chartSizes.heatmapWidth+this.legend.width+Qu.LEFT+Qu.RIGHT,e&&(this.chartSizes.totalWidth+=30),this.legend.width>0&&(this.chartSizes.totalWidth+=30),this.chartSizes.totalHeight=Math.max(this.chartSizes.treeHeight,this.legend.height)+Qu.TOP+Qu.BOTTOM}prepareTableLabels(e){let t=new hc("bold 14px Arial"),n="…";if(this.heatmapStep.x<12||!e){this.heatmapLabels=[];return}let r=this.heatmapStep.x-4;this.heatmapLabels=e.xKeys.map(a=>{let i=e.meta.xLabels[a],o=t.getTextWidth(i);if(o<r)return i;let s=i,c=s==null?void 0:s.length;for(;o>r&&c>0;)c--,s=(i==null?void 0:i.substring(0,c))+n,o=t.getTextWidth(s);return c>0?s:""})}addLabelsWidthToTreeArea(e,t){if(!t)return;let n=e.leaves(),r=new hc("bold 14px Manrope"),a=0;n.forEach(i=>{if(!i.data.label)return;let o=r.getTextWidth(i.data.label),s=i.y+o-this.chartSizes.treeWidth+8;s>a&&(a=s)}),this.chartSizes.treeWidth+=a}render(e,t,n,r,a,i,o,s,c,f,A,h,v,g,C,b,B){var $;this.updateChartSizes(e.size,v,t),this.updateHeatmapScales(v,g,e.size),this.updateLegendSize(e.legend,C,f,h,v,g),this.prepareTableLabels(v);let E=r==="top"?[this.chartSizes.treeWidth,this.chartSizes.treeHeight]:[this.chartSizes.treeHeight,this.chartSizes.treeWidth];$B().size(E).separation(()=>1)(t);let k=t;l3t(k,r==="top"?this.chartSizes.treeHeight:this.chartSizes.treeWidth,b==="alignLeavesToLine"),s3t(k),this.addLabelsWidthToTreeArea(k,s),this.updateTotalSizes(v);let P=P4t(f),I=ie.jsx(M4t,{chartSizes:this.chartSizes,chartSettings:e,nodes:k.descendants(),links:k.links(),connectionType:n,rootPosition:r,edgeInheritance:a,showNodes:i,showEdges:o,showLeavesLabels:s,showNodesLabels:c,aesGetters:P,labels:A,heatmapData:v,heatmapScales:this.heatmapScales,heatmapStep:this.heatmapStep,heatmapColor:this.heatmapColorScale.getter,heatmapLabels:this.heatmapLabels,legendData:this.legend,onClick:B});this.component=I,($=this.reactRoot)==null||$.render(I)}renderError(e){var t;(t=this.reactRoot)==null||t.render(ie.jsx(Xv,{message:e}))}},I4t=$4t,pK=class{constructor(e){Be(this,"type","dendro");Be(this,"chartSettings");Be(this,"mode");Be(this,"leavesMode");Be(this,"id");Be(this,"parentId");Be(this,"height",null);Be(this,"labels");Be(this,"heatmapAnnotation");Be(this,"heatmapAxis");Be(this,"heatmapGroup");Be(this,"heatmapSettings");Be(this,"connectionType","rectangle");Be(this,"edgeInheritance","up");Be(this,"rootPosition","top");Be(this,"showNodes",!0);Be(this,"showEdges",!0);Be(this,"showLeavesLabels",!0);Be(this,"showNodesLabels",!0);Be(this,"aes",{nodeShape:"21",nodeColor:Vt,nodeSize:3,lineShape:"solid",lineColor:Vt});var t,n,r,a,i,o,s,c,f,A;J3t.parse(e),this.chartSettings={size:{width:((t=e==null?void 0:e.size)==null?void 0:t.width)??(e.facetSettings?400:560),height:((n=e==null?void 0:e.size)==null?void 0:n.height)??(e.facetSettings?250:350),scale:((r=e==null?void 0:e.size)==null?void 0:r.scale)??1,minCellWidth:((a=e==null?void 0:e.size)==null?void 0:a.minCellWidth)??q5t,maxCellWidth:((i=e==null?void 0:e.size)==null?void 0:i.maxCellWidth)??e3t,minCellHeight:(o=e==null?void 0:e.size)==null?void 0:o.minCellHeight,maxCellHeight:(s=e==null?void 0:e.size)==null?void 0:s.maxCellHeight},title:{position:"center",show:!0,...e.title,name:((c=e.title)==null?void 0:c.name)??"Dendrogram"},legend:{show:!0,position:"right",...e.legend}},this.mode=e.mode??"normal",this.leavesMode=e.leavesMode??"normal",this.id=e.id,this.parentId=e.parentId,this.height=e.height??null,this.labels=e.labels??this.id,this.heatmapAnnotation=e.heatmapAnnotation??null,this.heatmapAxis=e.heatmapAxis??null,this.heatmapGroup=e.heatmapGroup??[],this.heatmapSettings={valueType:((f=e.heatmapSettings)==null?void 0:f.valueType)??"continuous",aes:{colorsList:["#FFF680","#53D788","#36739D","#4A005C"],...(A=e.heatmapSettings)==null?void 0:A.aes}},this.connectionType=e.connectionType??this.connectionType,this.edgeInheritance=e.edgeInheritance??this.edgeInheritance,this.showNodes=e.showNodes??this.showNodes,this.showEdges=e.showEdges??this.showEdges,this.showLeavesLabels=e.showLeavesLabels??this.showLeavesLabels,this.showNodesLabels=e.showNodesLabels??this.showNodesLabels,this.rootPosition=e.rootPosition??this.rootPosition,this.aes={...this.aes,...e.aes}}};function nS(e){return typeof e!="object"?!1:"valuesMap"in e}function vK(e,t){let{nodeColor:n,nodeShape:r,lineColor:a}=t,i=[n,r,a].filter(nS);return Zn.uniqBy(i,o=>o.columnName.value).reduce((o,s)=>{let{columnName:c}=s,f=Zn.uniqBy(e.rows,C=>C[c.value]),A=C=>String(C[c.value]),h=C=>c.valueLabels?String(C[c.valueLabels]):A(C),v=new Set,g=f.reduce((C,b)=>{let B=A(b);return C[B]||(C[B]={}),C},{});return nS(n)&&c.value===n.columnName.value&&(v.add("dotFill"),f.forEach(C=>{let b=A(C);g[b].dotFill=n.valuesMap[b]})),nS(r)&&c.value===r.columnName.value&&(v.add("dotShape"),f.forEach(C=>{let b=A(C);g[b].dotShape=r.valuesMap[b]})),nS(a)&&c.value===a.columnName.value&&(v.add("lineColor"),f.forEach(C=>{let b=A(C);g[b].lineColor=a.valuesMap[b]})),o[c.value]={values:f.map(A).sort(),usedAes:[...v],aesMap:g,labels:f.reduce((C,b)=>(C[A(b)]=h(b),C),{})},o},{})}var L4t=class extends zm{constructor(t,n,r){super(t,n);Be(this,"settings");Be(this,"onClick",()=>nI);Be(this,"chartRenderer",new I4t);Be(this,"calculatedData",null);this.settings=new pK(n),r&&(this.onClick=r[0])}mount(t){try{this.chartRenderer.init(t),this._updateData(),this._updateChart()}catch(n){n instanceof Error&&this.chartRenderer.renderError(n.message)}}unmount(){this.chartRenderer.clear()}updateSettingsAndData(t,n){try{let r=this.settings,a=this.data;this.settings=new pK(n),this.data=t,this._needUpdateCalculatedDataBySettings(r,this.settings)||this._needUpdateCalculatedDataByData(a,this.data)?this._updateData():this._updateAesInData(),this._updateChart()}catch(r){r instanceof Error&&this.chartRenderer.renderError(r.message)}}updateChartState(t,n){if(document){let r=new CustomEvent(SM,{detail:{[t]:n}});document.dispatchEvent(r)}}export(){return this._updateChart(),w5(this.chartRenderer.component)}_needUpdateCalculatedDataBySettings(t,n){var A,h;let{mode:r,id:a,parentId:i,heatmapAnnotation:o,heatmapAxis:s,heatmapGroup:c}=n;function f(v,g){return v.length!==g.length||v.some((C,b)=>C.value!==g[b].value)}return t.mode!==r||t.id.value!==a.value||t.parentId.value!==i.value||((A=t.heatmapAnnotation)==null?void 0:A.value)!==(o==null?void 0:o.value)||((h=t.heatmapAxis)==null?void 0:h.value)!==(s==null?void 0:s.value)||f(t.heatmapGroup,c)}_needUpdateCalculatedDataByData(t,n){let r=Object.keys(t.data),a=Object.keys(n.data);return t.id!==n.id||r.length!==a.length||r.some(i=>{var o;return t.data[i].length!==((o=n.data[i])==null?void 0:o.length)})}_updateData(){let{mode:t,id:n,parentId:r,aes:a,heatmapAnnotation:i,heatmapAxis:o,heatmapGroup:s,heatmapSettings:c,height:f,labels:A}=this.settings,h=o3t(n.value,r.value,(f==null?void 0:f.value)??null,A.valueLabels??A.value??null,this.data.rows,t==="useAllNodesAsLeaves"),v=r3t(this.data,c.valueType,i,o,s,n,h),g=vK(this.data,a);this.calculatedData={chartSizes:this.chartRenderer.chartSizes,hierarchy:h,heatmapData:v,legendLabels:g}}_updateAesInData(){this.calculatedData&&(this.calculatedData.legendLabels=vK(this.data,this.settings.aes))}_updateChart(){if(!this.calculatedData)return;let{heatmapAnnotation:t,chartSettings:n,connectionType:r,edgeInheritance:a,rootPosition:i,showNodes:o,showEdges:s,showLeavesLabels:c,showNodesLabels:f,aes:A,labels:h,heatmapSettings:v,leavesMode:g}=this.settings;this.chartRenderer.render(n,this.calculatedData.hierarchy,r,i,a,o,s,c,f,A,h,t,this.calculatedData.heatmapData,v,this.calculatedData.legendLabels,g,this.onClick)}},J1=Symbol("noGrouped");function R4t(e){return"type"in e&&e.type==="columns"}var mK=class F${constructor(t,n){Be(this,"id");Be(this,"data");Be(this,"rowsCount");Be(this,"columnNames");Be(this,"rowsGrouped");this.id=t,this.data=n,this.columnNames=Object.keys(n),this.rowsCount=this.columnNames.length?n[this.columnNames[0]].length:0}static from(t){if(t instanceof F$)return t;if(R4t(t))return new F$(t.id,t.values);d1(t,"Unknown input data format")}get rows(){let t=[];for(let n=0;n<this.rowsCount;n++)t.push(this.columnNames.reduce((r,a)=>(r[a]=this.data[a][n],r),{}));return t}getColumn(t){return this.data[t]}getColumnCategories(t,n=!0){if(!this.columnNames.includes(t))throw new Error(`Column ${t} does not exist`);return Zn.uniq(this.getColumn(t)).filter(r=>n?r!==null:!0).map(String)}setGrouping(t){let n={grouped:{},rows:this.rows},r=[n];t.forEach(a=>{let i=a===null?[J1]:this.getColumnCategories(a,!1),o=[];r.forEach(s=>{if(a===null)s.grouped={[J1]:{rows:s.rows,grouped:{}}},o.push(s.grouped[J1]);else{let c=Zn.groupBy(s.rows,f=>String(f[a]));s.grouped=i.reduce((f,A)=>(f[A]={rows:c[A]??[],grouped:{}},o.push(f[A]),f),{})}}),r=o}),this.rowsGrouped=n.grouped}getColumnByGrouping(t,n){if(!this.rowsGrouped)return[];if(!t.length)return this.rows.map(a=>Number(a[n]));let r={grouped:this.rowsGrouped,rows:this.rows};return t.forEach(a=>{let i=r.grouped[a??"null"];if(!i)return[];r=i}),r.rows.map(a=>Number(a[n]))}getRowsByGrouping(t){if(!this.rowsGrouped)return[];if(!t.length)return this.rows;let n={grouped:this.rowsGrouped,rows:this.rows};return t.forEach(r=>{let a=n.grouped[r];if(!a)return[];n=a}),n==null?void 0:n.rows}};function Md(e){return e.map(String).join("_")}function V4t(e,t,n,r){let a=-1/0;return{type:"logo",geoms:t.facet.reduce((i,o)=>{let s=Md(o);return i[s]=[],t.primary.forEach(c=>{let f=0,A={};t.secondary.forEach(v=>{let g=n.getRowsByGrouping([...o,c,v]);if(!g.length)return;let C=lc(g,b=>Number(b[r.value]));A[String(v)]={height:C,key:String(v)},f+=C});let h=f;e.normalize&&t.secondary.forEach(v=>{A[String(v)]&&(A[String(v)].height=A[String(v)].height/h*100)}),a=Math.max(a,f),i[s].push({key:`logo_${String(c)}`,valuesMap:A,primaryGrouping:c,boundsY:{min:0,max:e.normalize?h:100}})}),i},{}),meta:{minY:0,maxY:e.normalize?100:a,normalize:e.normalize},aes:e.aes}}var N4t={TOP:30,BOTTOM:30},dp=30,z4t=6,x9=20,TM=15,O4t=24,p3=25,F4t=12,gK={fillColor:"white",lineColor:Vt,lineWidth:1,lineShape:"solid",dotSize:3,dotFill:Vt,dotShape:"21"},kM=20,yK=4,zf=4,wK=36,bK=25;function Q4t(e){return`translate(${e},0)`}function j4t(e){return`translate(0,${e})`}var E9=21;function U4t(e,t){if(e==="45deg"){let n=t==="left"?-E9/2:0,r=t==="bottom"?E9/2:-E9/2;return`translate(${n},${r}) rotate(-45)`}return e==="90deg"&&t==="bottom"?`translate(${-E9/2},${zf+E9/2}) rotate(-90)`:t==="bottom"?`translate(0,${zf})`:`translate(${-zf},0)`}function G4t(e,t){return t==="left"||t==="bottom"&&e==="90deg"?"central":e==="center"?"hanging":"auto"}function Y4t(e,t){return t==="left"||t==="bottom"&&e!=="center"?"end":"middle"}var CK=({scale:e,tickSize:t=6,tickPadding:n=zf,orient:r="bottom",labelsPosition:a="center",labels:i={},offset:o=typeof window<"u"&&window.devicePixelRatio>1?0:.5})=>{function s(B,E){return B.bandwidth&&(E=Math.max(0,B.bandwidth()-E*2)/2),B!=null&&B.round()&&(E=Math.round(E)),k=>{let P=B(k);return P===void 0?0:P+E}}let c=e.domain(),f=B=>i[B]??[],A=Math.max(t,0)+n,h=s(e.copy(),o),v=r==="bottom"?Q4t:j4t,g=r==="left"?-1:1,C={[(r==="left"?"x":"y")+"2"]:g*t},b={[r==="left"?"x":"y"]:g*A};return ie.jsx("g",{children:c.map((B,E)=>ie.jsxs("g",{className:"tick",transform:v(h(B)+o),children:[ie.jsx("line",{stroke:Vt,...C}),ie.jsx("g",{transform:U4t(a,r),children:f(B).map((k,P)=>ie.jsx("text",{fill:Vt,fontSize:"14px",fontWeight:"500",fontFamily:"Manrope",dominantBaseline:G4t(a,r),textAnchor:Y4t(a,r),dy:20*P,...b,children:k},`${k}_${P}`))})]},E))})};function SK(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r.primaryGrouping)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(r.secondaryGrouping)[t]}return n}function W4t({scales:e,orientation:t,bar:n,aes:r}){let a=t==="vertical",i=(e.xPrimary(n.primaryGrouping)??0)+(e.xSecondary(n.secondaryGrouping)??0)+e.xSecondary.bandwidth()/2,o=e.xSecondary.bandwidth(),s=r.width==="auto"?o*.8:Math.min(o,r.width),c=Math.abs(e.y(n.value)-e.y(0)),f=SK(e,"lineColor",r.lineColor,n),A=SK(e,"fillColor",r.fillColor,n);return ie.jsx("g",{transform:a?`translate(${i},0)`:`translate(0, ${i})`,opacity:r.opacity,stroke:f,strokeWidth:r.lineWidth,children:ie.jsx("rect",{width:a?s:c,height:a?c:s,x:a?-s/2:e.y(n.boundsY.min),y:a?e.y(n.boundsY.max):-s/2,fill:A})})}function Ka(e){return isNaN(e)?"?":e===0?"0":Math.abs(e)<.01?ny(".1e")(e):ny(".2f")(e)}function xK(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r.primaryGrouping)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(r.secondaryGrouping)[t]}return n}function X4t({facetKey:e,scales:t,orientation:n,geom:r,aes:a,min:i,max:o,binsCount:s,hasKeyFromColumn:c,sideDistances:f,showTooltips:A,activeElementContainer:h,tooltipsContainer:v,tooltipsData:g}){let C=n==="vertical",b=(t.xPrimary(r.primaryGrouping)??0)+(t.xSecondary(r.secondaryGrouping)??0)+t.xSecondary.bandwidth()/2,B=xK(t,"lineColor",a.lineColor,r),E=xK(t,"fillColor",a.fillColor,r),k=r.bins,P=a.dotSize?a.dotSize:Math.abs(t.y(o)-t.y(i))/s/2,I=h&&g.fixed;return ie.jsx("g",{children:k.map(({x:$,count:z,dots:O})=>ie.jsx("g",{children:O.map((K,te)=>{let le=(te-z/2)*2*P+P,G=C?le:0,Q=C?0:le,j=`binnedDot_${r.key}_${K.key}`,Y=g.selectedData===j&&g.currentFacet===e&&I,X=ie.jsxs("g",{transform:C?`translate(${b},${t.y($)})`:`translate(${t.y($)},${b})`,stroke:B,fill:E,strokeWidth:a.lineWidth,children:[ie.jsx("circle",{opacity:a.opacity,cx:G,cy:Q,r:P,onMouseOver:()=>g.onMouseOver(j,e),onMouseLeave:()=>g.onMouseLeave()}),A&&ie.jsx(fu,{content:c?[K.key,Ka(K.value)]:[Ka(K.value)],x:(C?b:t.y($))+G,y:(C?t.y($):b)+Q,sideDistances:f,horizontal:C,offset:P,active:j===g.selectedData&&g.currentFacet===e,fixed:g.fixed,onClose:g.onClose,container:v})]},K.key);return Y?cu.createPortal(X,h):X})},$))})}function Of(e=null){switch(e){case null:return"";case"solid":return"";case"dashed":return"6 6";case"dotted":return"1.5 4";case"dotdash":return"1.4 4 8 4";case"longdash":return"10 4";case"twodash":return"3 3 9 3";default:d1(e,`Unknown line shape ${e}`)}}function rS(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r.primaryGrouping)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(r.secondaryGrouping)[t]}return n}function K4t(e,t){return t?[e.id,`${Ka(e.y)}`]:[`${Ka(e.y)}`]}function Z4t({facetKey:e,scales:t,orientation:n,box:r,aes:a,hasKeyFromColumn:i,sideDistances:o,showTooltips:s,elementsAmount:c,activeElementContainer:f,tooltipsContainer:A,tooltipsData:h}){let v=n==="vertical",g=(t.xPrimary(r.primaryGrouping)??0)+(t.xSecondary(r.secondaryGrouping)??0)+t.xSecondary.bandwidth()/2,C=t.xSecondary.bandwidth(),b=a.boxWidth==="auto"?C*.8:Math.min(C,a.boxWidth),B=Math.abs(t.y(r.lower)-t.y(r.upper)),E=rS(t,"lineColor",a.lineColor,r),k=rS(t,"fillColor",a.fillColor,r),P=rS(t,"dotShape",a.dotShape,r),I=rS(t,"dotSize",a.dotSize,r),$=Yc(P,I,E),z=Math.abs(t.y.range()[0]-t.y.range()[1]),O=f&&h.fixed,K=h.selectedData===r&&O,te=ie.jsxs("g",{transform:v?`translate(${g},0)`:`translate(0, ${g})`,opacity:a.opacity,stroke:E,strokeWidth:a.lineWidth,strokeDasharray:Of(a.lineShape),children:[ie.jsx("line",{x1:v?0:t.y(r.min),x2:v?0:t.y(r.lower),y1:v?t.y(r.min):0,y2:v?t.y(r.lower):0}),ie.jsx("line",{x1:v?0:t.y(r.upper),x2:v?0:t.y(r.max),y1:v?t.y(r.upper):0,y2:v?t.y(r.max):0}),ie.jsx("rect",{width:v?b:B,height:v?B:b,x:v?-b/2:t.y(r.lower),y:v?t.y(r.upper):-b/2,fill:k}),ie.jsx("line",{x1:v?-b/2:t.y(r.middle),x2:v?b/2:t.y(r.middle),y1:v?t.y(r.middle):-b/2,y2:v?t.y(r.middle):b/2}),s&&A&&ie.jsx("rect",{onMouseOver:()=>h.onMouseOver(r,e),onMouseLeave:h.onMouseLeave,width:v?C:z,x:v?-C/2:0,y:v?0:-C/2,height:v?z:C,fill:"transparent",stroke:"none"}),a.showOutliers&&r.outliers.map(le=>{let G=h.selectedData===le&&h.currentFacet===e&&O,Q=v?G?g:0:t.y(le.y),j=v?t.y(le.y):G?g:0,Y=ie.jsxs("g",{transform:`translate(${Q},${j})`,strokeDasharray:"0",children:[$,s&&A&&ie.jsx("circle",{onMouseOver:()=>h.onMouseOver(le,e),onMouseLeave:h.onMouseLeave,r:"15",fill:"transparent",stroke:"none"}),s&&ie.jsx(fu,{content:K4t(le,i),x:v?g:t.y(le.y),y:v?t.y(le.y):g,sideDistances:o,horizontal:!0,active:h.selectedData===le&&h.currentFacet===e,onClose:h.onClose,fixed:h.fixed,container:A})]},le.id);return G?cu.createPortal(Y,f):Y}),s&&ie.jsx(fu,{content:[`Max = ${Ka(r.max)}`,`Upper = ${Ka(r.upper)}`,`Median = ${Ka(r.middle)}`,`Lower = ${Ka(r.lower)}`,`Min = ${Ka(r.min)}`],x:v?g:t.y(r.middle),y:v?t.y(r.middle):g,sideDistances:o,horizontal:v,active:h.active&&h.selectedData===r&&h.currentFacet===e,fixed:h.fixed,onClose:h.onClose,offset:c>1?C/2:C/4,container:A})]});return K?cu.createPortal(te,f):te}function MM(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r.primaryGrouping)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(r.secondaryGrouping)[t]}return n}function J4t(e,t,n){return n?[t,`${Ka(e)}`]:[`${Ka(e)}`]}function q4t({facetKey:e,scales:t,orientation:n,geom:r,aes:a,hasKeyFromColumn:i,sideDistances:o,showTooltips:s,activeElementContainer:c,tooltipsContainer:f,tooltipsData:A}){let h=n==="vertical",v=(t.xPrimary(r.primaryGrouping)??0)+(t.xSecondary(r.secondaryGrouping)??0)+t.xSecondary.bandwidth()/2,g=t.xSecondary.bandwidth()*a.jitter,C=I=>(1-I*2)*(g/2),b=MM(t,"lineColor",a.lineColor,r),B=MM(t,"dotFill",a.dotFill,r),E=MM(t,"dotShape",a.dotShape,r),k=Yc(E,a.dotSize,B),P=c&&A.fixed;return ie.jsx("g",{transform:h?`translate(${v},0)`:`translate(0, ${v})`,stroke:b,children:r.values.map(I=>{let{jitter:$,id:z}=I,O=A.selectedData===I&&P,K=C($),te=h?O?v+K:K:t.y(I.y),le=h?t.y(I.y):O?v+K:K,G=ie.jsxs("g",{opacity:a.opacity,transform:`translate(${te},${le})`,children:[k,s&&f&&ie.jsx("circle",{onMouseOver:()=>A.onMouseOver(I,e),onMouseLeave:()=>A.onMouseLeave(),r:"4",fill:"transparent",stroke:"none"}),s&&ie.jsx(fu,{content:J4t(I.y,z,i),x:v+C($),y:le,active:A.active&&A.selectedData===I&&A.currentFacet===e,fixed:A.fixed,onClose:A.onClose,sideDistances:o,container:f})]},z);return O?cu.createPortal(G,c):G})})}function PM(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r.primaryGrouping)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(r.secondaryGrouping)[t]}return n}function eyt({facetKey:e,scales:t,orientation:n,errorBar:r,aes:a,sideDistances:i,showTooltips:o,activeElementContainer:s,tooltipsContainer:c,tooltipsData:f}){let A=n==="vertical",h=PM(t,"lineColor",a.lineColor,r),v=PM(t,"fillColor",a.fillColor,r),g=PM(t,"dotShape",a.dotShape,r),C=(t.xPrimary(r.primaryGrouping)??0)+t.xPrimary.bandwidth()/2,b=a.width==="auto"?t.xPrimary.bandwidth()*.2:a.width,B=t.y(r.min),E=t.y(r.max),k=t.y(r.value),P=Yc(g,a.dotSize,v),I=s&&f.fixed,$=f.selectedData===r&&I,z=a.showDots?ie.jsxs("g",{transform:A?`translate(${C},${k})`:`translate(${k},${C})`,children:[P,o&&c&&ie.jsx("circle",{onMouseOver:()=>f.onMouseOver(r,e),onMouseLeave:()=>f.onMouseLeave(),r:"15",fill:"transparent",stroke:"none"}),o&&ie.jsx(fu,{content:[Ka(r.value)],x:A?C:k,y:A?k:C,sideDistances:i,horizontal:!0,active:f.active&&f.selectedData===r&&f.currentFacet===e,fixed:f.fixed,onClose:f.onClose,container:c})]}):null;return ie.jsxs("g",{opacity:a.opacity,stroke:h,fill:"none",strokeWidth:a.lineWidth,children:[ie.jsxs("g",{transform:A?`translate(${C},0)`:`translate(0,${C})`,children:[ie.jsx("line",{x1:A?0:B,x2:A?0:E,y1:A?B:0,y2:A?E:0}),ie.jsx("line",{x1:A?-b/2:B,x2:A?b/2:B,y1:A?B:-b/2,y2:A?B:b/2}),ie.jsx("line",{x1:A?-b/2:E,x2:A?b/2:E,y1:A?E:-b/2,y2:A?E:b/2})]}),$?cu.createPortal(z,s):z]})}function aS(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")throw new Error("Line cannot have aesthetics by primary grouping");if(n.type==="secondaryGrouping")return e.xSecondaryAes(r.key)[t]}return n}function tyt(e,t,n){let r=n.xPrimary.bandwidth()/2;return t.map(a=>[(n.xPrimary(a)??0)+r,n.y(e[a]),a,e[a]])}function nyt(e,t,n){let r=e.valueLabels[t];return r?[r,Ka(n)]:[Ka(n)]}function ryt({facetKey:e,scales:t,orientation:n,line:r,aes:a,sideDistances:i,showTooltips:o,secondaryGrouping:s,activeElementContainer:c,tooltipsContainer:f,tooltipsData:A}){let h=n==="vertical",v=aS(t,"lineColor",a.lineColor,r),g=aS(t,"dotFill",a.fillColor,r),C=aS(t,"lineShape",a.lineShape,r),b=aS(t,"dotShape",a.dotShape,r),B=tyt(r.dots,t.xPrimary.domain(),t),E=Yc(b,a.dotSize,g),k=c&&A.fixed;return ie.jsxs("g",{opacity:a.opacity,stroke:v,strokeDasharray:Of(C),strokeWidth:a.lineWidth,children:[ie.jsx("polyline",{points:B.map(([P,I])=>h?[P,I]:[I,P]).join(" "),stroke:v,fill:"none"},r.key),a.dotShape!==null&&ie.jsx("g",{children:B.map(P=>{let[I,$,z,O]=P,K=A.selectedData,te=!!(K&&e===A.currentFacet&&lI.isArray(K)&&K.every((Q,j)=>Q===P[j])),le=te&&k,G=ie.jsxs("g",{transform:h?`translate(${I},${$})`:`translate(${$},${I})`,strokeDasharray:"none",stroke:"none",children:[E,o&&f&&ie.jsx("circle",{onMouseOver:()=>A.onMouseOver(P,e),onMouseLeave:()=>A.onMouseLeave(),r:"15",fill:"transparent",stroke:"none"}),o&&ie.jsx(fu,{content:nyt(s,r.key,O),x:h?I:$,y:h?$:I,sideDistances:i,horizontal:!0,active:te,fixed:A.fixed,onClose:A.onClose,container:f})]},z);return le?cu.createPortal(G,c):G})})]})}var EK={A:"M100 100H75.9062L68.8622 76.6168H31.0006L24.1052 100H0L33.1961 0H66.8839L100 100ZM43.3619 34.7342L35.6089 61.0056H64.2424L56.7296 34.7342L50.6575 13.3372H49.3425L43.3619 34.7342Z",B:"M45.4184 0C56.8913 0 66.0972 1.04768 73.0217 3.15678C80.0142 5.26596 85.0715 8.18391 88.1943 11.8979C91.3839 15.5655 92.982 19.7862 92.982 24.5538C92.9812 30.6489 90.5672 35.6664 85.7508 39.6085C80.9994 43.5053 74.7182 45.8 66.9129 46.4882C73.4281 46.8551 79.1309 47.9556 84.0176 49.7889C88.9734 51.5771 92.8725 54.104 95.7238 57.3594C98.5744 60.614 99.9992 64.6461 100 69.4588C100 76.0611 97.792 81.6556 93.3797 86.2406C88.967 90.78 82.8289 94.2265 74.9538 96.565C67.0793 98.8571 57.809 100 47.1516 100H0V0H45.4184ZM27.8022 85.1468H44.8075C51.9358 85.1468 57.8845 83.9734 62.6367 81.635C67.4532 79.2511 69.8667 75.2176 69.8679 69.5356C69.8679 65.5037 68.6429 62.4975 66.2026 60.5258C63.7586 58.5542 60.5964 57.2647 56.7268 56.6686C52.8573 56.0267 48.8175 55.7091 44.6086 55.7091H27.8022V85.1468ZM27.8022 41.8154H42.1651C47.1205 41.8153 51.3011 41.2654 54.6953 40.165C58.0867 39.065 60.6592 37.4343 62.4236 35.2811C64.2566 33.0803 65.1797 30.3733 65.1797 27.1637C65.1795 22.7623 63.2071 19.5998 59.2698 17.6742C55.3323 15.7028 49.4604 14.7189 41.6536 14.7189H27.8022V41.8154Z",C:"M54.4005 0C63.8911 0.000435932 72.0623 1.41634 78.9173 4.24058C85.84 7.0661 91.116 11.2405 94.7422 16.7591C98.4335 22.2332 100.183 28.9442 99.9849 36.8902H73.4814C73.1518 32.5637 72.2691 28.9393 70.8186 26.0255C69.4341 23.0678 67.3207 20.8581 64.4859 19.4013C61.7175 17.901 57.9898 17.1566 53.3106 17.1563C47.7087 17.1563 42.9921 18.2992 39.1689 20.5931C35.3456 22.8444 32.4717 26.3789 30.5598 31.1899C28.6478 36.0022 27.7207 42.2329 27.7866 49.8707C27.8529 60.4208 29.9968 68.5683 34.2159 74.3071C38.5013 80.0017 44.6742 82.8437 52.7173 82.8437C57.4631 82.8435 61.2207 82.3345 63.9893 81.3193C66.8227 80.3039 68.8628 78.8265 70.115 76.8847C71.4333 74.8983 72.1629 72.4942 72.2949 69.6693H99.5848C99.4529 74.6128 98.1741 78.9828 95.7355 82.779C93.3624 86.5311 90.0312 89.6883 85.7467 92.2487C81.528 94.8089 76.5838 96.7539 70.9152 98.0783C65.2452 99.3587 59.0727 100 52.4138 100C41.2735 99.9995 31.782 97.9636 23.9373 93.9024C16.1587 89.8408 10.2268 84.0567 6.13955 76.5521C2.05273 69.0031 0 60.0208 0 49.6027C2.4153e-05 39.0955 2.11331 30.1555 6.3327 22.7827C10.5515 15.367 16.713 9.71467 24.8203 5.82964C32.9297 1.94454 42.7968 0 54.4005 0Z",D:"M36.9306 0C57.3372 0 72.9524 4.0091 83.7717 12.0322C94.5911 20.0563 100 32.3963 100 49.0405C99.9993 60.0888 97.4138 69.3977 92.2316 76.9622C87.0488 84.527 79.7265 90.2594 70.2684 94.1566C60.8744 98.054 49.7583 100 36.9306 100H0V0H36.9306ZM26.9252 82.5273H36.3476C43.9924 82.5273 50.4765 81.4275 55.789 79.2266C61.1642 76.9798 65.2464 73.4042 68.0315 68.4993C70.8817 63.5933 72.3021 57.1738 72.3021 49.242C72.302 41.2205 71.0145 34.8935 68.4246 30.2629C65.8339 25.6332 61.8118 22.3539 56.372 20.4279C50.9299 18.5022 43.8631 17.5398 35.1817 17.5398H26.9252V82.5273Z",E:"M96.3517 16.6379H29.2614V40.0307H88.741V56.1217H29.2614V82.8728H100V100H0V0H96.3517V16.6379Z",F:"M100 16.7818H30.2939V42.228H91.4268L91.3057 58.6644H30.2939V100H0V0H99.894L100 16.7818Z",G:"M55.4382 0.00126929C64.1095 -0.0425219 71.651 1.04689 78.0577 3.25536C84.5282 5.42011 89.637 8.84438 93.3902 13.5261C97.2079 18.1639 99.4172 24.1682 100 31.5438H74.7528C74.2349 28.8504 73.2941 26.4228 71.9355 24.2591C70.6416 22.0953 68.6385 20.3723 65.9217 19.0913C63.2041 17.8106 59.5139 17.1689 54.8557 17.1685C48.2538 17.1685 42.9402 18.493 38.9273 21.1436C34.9157 23.7495 32.0032 27.4813 30.191 32.3388C28.3787 37.1541 27.4685 42.9001 27.4685 49.5708C27.4685 56.374 28.4388 62.2729 30.3806 67.2649C32.3871 72.2567 35.3719 76.0982 39.3201 78.7929C43.3329 81.4873 48.3491 82.8328 54.3681 82.8328C58.8318 82.8327 62.7771 82.4142 66.2061 81.5755C69.6366 80.692 72.4273 79.541 74.5632 78.1273V61.635H53.7857V45.4662H99.1196L99.0248 86.8819C95.9195 89.2658 92.1976 91.4495 87.864 93.4363C83.5274 95.4243 78.602 97.0138 73.1004 98.2066C67.6639 99.3991 61.7068 100 55.235 100C43.5888 99.9995 33.6549 97.9905 25.4368 93.9725C17.2167 89.9083 10.9027 84.0915 6.50142 76.5372C2.16601 68.9836 0 59.9951 0 49.5708C7.19725e-06 39.1892 2.16484 30.3054 6.50142 22.9279C10.9027 15.5521 17.2482 9.89511 25.5316 5.96403C33.8158 2.03341 43.7893 0.0454419 55.4382 0.00126929Z",H:"M28.0722 40.0307H71.9138V0H100V100H71.9138V57.0812H28.0722V100H0V0H28.0722V40.0307Z",I:"M100 16.7146H65.2015V75.9931C65.2015 78.2398 64.5115 79.9418 63.1258 81.0881C61.8137 82.1874 59.8078 82.9184 57.1123 83.2854H100V100H0V83.2854H34.6764V23.9973C34.6772 21.7535 35.3684 20.0789 36.7521 18.9791C38.1379 17.8328 40.1552 17.0815 42.7808 16.7146H0V0H100V16.7146Z",K:"M25.5221 49.2804L40.9481 31.9804L67.9564 0H97.5272L57.5016 43.0628L100 100H71.1723L41.5375 57.5801L25.5221 73.2585V100H0V0H25.5221V49.2804Z",L:"M31.8025 82.7384H100V100H0V0H31.8025V82.7384Z",M:"M47.5503 42.0169L49.8164 54.5385H50.3608L52.4497 42.0169L62.6155 0H96.8224L100 100H78.4023L77.9592 58.4629L78.7695 12.7231H77.3136L70.4266 36.9315L59.5265 74.621H40.4735L29.4088 36.9315L22.5978 12.7231H21.0533L22.142 58.4629L21.5977 100H0L3.17762 0H37.2959L47.5503 42.0169Z",N:"M66.0971 57.4938L77.5346 80.877H78.2406L73.2703 51.516V0H100V100H64.8828L33.9029 42.7749L22.9737 20.6294H22.0559L26.7156 49.7889V100H0V0H34.9195L66.0971 57.4938Z",P:"M49.614 0C65.9884 0 78.4836 2.53923 87.092 7.62809C95.7004 12.6718 100 20.7713 100 31.9133C99.9996 36.3592 99.1326 40.6455 97.3859 44.7707C95.6384 48.8971 92.8172 52.5881 88.934 55.8434C85.0516 59.0521 79.9422 61.6227 73.6015 63.5483C67.2584 65.4282 59.4822 66.3692 50.2912 66.3692H34.1731C32.2339 66.3685 30.557 65.8604 29.1345 64.8532C28.1138 64.0613 27.4654 63.0777 27.2112 61.8979L27.0893 60.6601V100H0V0H49.614ZM27.0893 50.0672H48.3543C53.853 50.067 58.3506 49.4736 61.8448 48.2825C65.3396 47.0446 67.9365 45.1407 69.6194 42.5734C71.3664 40.0066 72.2329 36.7043 72.2335 32.6713C72.2335 28.7754 71.2617 25.6329 69.3214 23.2489C67.445 20.8654 64.6653 19.1414 60.9779 18.0867C57.2886 17.0322 52.7814 16.5036 47.4739 16.5036H27.0893V50.0672Z",Q:"M50 0C66.0982 0.000380175 78.4597 3.59164 87.0755 10.7794C95.692 17.9687 100 28.241 100 41.582C99.9995 50.6968 98.0845 58.4254 94.2485 64.7615C90.412 71.0606 84.7408 75.8568 77.2572 79.1547C76.6607 79.4197 76.0326 79.6555 75.4146 79.8992C76.1355 80.0194 76.9062 80.2004 77.731 80.4343C79.4291 80.916 80.8793 81.8049 82.0742 83.102L97.4467 100H67.452L55.712 83.9162C53.8622 84.0259 51.9607 84.1023 50 84.1024C39.3081 84.1024 30.214 82.4529 22.7297 79.1547C15.3107 75.857 9.65038 71.0593 5.75151 64.7615C1.9155 58.4254 0.00050139 50.6968 0 41.582C0 28.241 4.30801 17.9687 12.9245 10.7794C21.6036 3.5922 33.9645 0 50 0ZM50 14.2846C42.5168 14.2846 36.7574 16.4143 32.7323 20.6747C28.7071 24.9364 26.6912 31.9098 26.6912 41.582C26.6917 51.4747 28.7076 58.665 32.7323 63.1485C36.7574 67.5945 42.5165 69.8178 50 69.8178C57.6084 69.8173 63.398 67.5945 67.3598 63.1485C71.3217 58.665 73.2951 51.4747 73.2956 41.582C73.2956 31.9098 71.3221 24.9364 67.3598 20.6747C63.398 16.4143 57.6081 14.2851 50 14.2846Z",R:"M44.4713 0C59.0103 0 70.3242 2.35844 78.3943 7.08117C86.5255 11.8032 90.5898 19.0937 90.5911 28.9484C90.5911 32.2037 89.9122 35.4395 88.5672 38.649C87.2866 41.8578 85.2158 44.8412 82.3348 47.5916C79.4538 50.2958 75.6687 52.5395 70.9958 54.3274C68.56 55.2719 65.8456 56.0119 62.8736 56.5726C62.9225 56.5803 62.9727 56.5936 63.021 56.6014C65.0053 56.9226 66.7655 57.5677 68.3018 58.53C69.9023 59.4471 71.3804 60.8226 72.7248 62.6559L100 100H71.3711L41.8845 59.9021H26.605V100H0V0H44.4713ZM26.605 44.2238H42.0721C47.3231 44.2238 51.5492 43.5999 54.7514 42.3623C58.0179 41.0785 60.3953 39.2912 61.8684 36.9987C63.4046 34.7065 64.1737 32.0195 64.1737 28.9484C64.1729 25.2834 63.2118 22.4872 61.2921 20.5623C59.3706 18.6365 56.8011 17.283 53.5987 16.5036C50.3972 15.7247 46.7758 15.333 42.7423 15.333L26.605 15.2658V44.2238Z",S:"M50.5755 0C64.0221 0 74.604 2.42428 82.3151 7.27866C90.0897 12.1329 94.5868 19.4156 95.7978 29.124H70.6461C70.391 26.3633 69.3763 24.021 67.5922 22.1062C65.8722 20.1487 63.5464 18.6566 60.6175 17.6328C57.7497 16.6085 54.2673 16.0951 50.1887 16.0951C44.2643 16.0955 39.4247 16.9267 35.6658 18.5741C31.9066 20.2219 30.0247 22.7593 30.0247 26.1883C30.0252 28.7257 30.7599 30.8846 32.2252 32.6654C33.6901 34.401 36.2678 36.0471 39.96 37.6048C43.7199 39.119 48.9519 40.8136 55.6431 42.6841C61.3149 44.2428 66.797 45.7831 72.0864 47.2973C77.3748 48.7668 82.0942 50.5032 86.2359 52.507C90.4401 54.4662 93.7798 56.9841 96.2645 60.0559C98.7497 63.0841 99.9984 66.9574 99.9986 71.6775C100.062 77.6453 97.9605 82.7703 93.6907 87.0457C89.4847 91.2763 83.6794 94.5021 76.2872 96.7288C68.9599 98.9104 60.519 99.9997 50.9622 100C41.0206 100 32.1881 98.8903 24.477 96.6636C16.7676 94.437 10.7101 90.9431 6.31336 86.1789C1.98004 81.3693 -0.121801 75.1754 0.00544797 67.6048H25.8239C25.9515 71.3879 27.0275 74.5038 29.0645 76.9525C31.1676 79.3574 34.1359 81.1233 37.9596 82.2367C41.7825 83.3495 46.3709 83.9049 51.7224 83.9049C56.4382 83.9049 60.4213 83.4329 63.6714 82.4977C66.9848 81.5179 69.4694 80.1824 71.1262 78.4902C72.8454 76.7544 73.7125 74.8201 73.7134 72.6841C73.7134 70.0124 72.6846 67.8753 70.6461 66.2721C68.607 64.6245 65.4601 63.1461 61.1909 61.8546C56.9848 60.5631 51.5621 59.0528 44.9343 57.3159C37.2253 55.2678 30.2839 52.9043 24.1036 50.233C17.9237 47.5171 13.0722 44.248 9.56734 40.4194C6.06248 36.5895 4.31316 31.9981 4.31297 26.6542C4.31297 20.7769 6.31449 15.8551 10.3275 11.8919C14.3419 7.92869 19.8552 4.9605 26.8641 3.00093C33.874 0.996878 41.7812 5.03329e-05 50.5755 0Z",T:"M100 17.0505H63.592V100H36.408V24.4867C36.408 22.4234 37.0203 20.7427 38.25 19.4588C39.5445 18.175 41.5288 17.3714 44.1826 17.0505H0V0H100V17.0505Z",U:"M27.3115 59.9622C27.3115 64.1165 27.8423 67.639 28.8938 70.5293C30.0115 73.3748 31.5581 75.7075 33.5305 77.5142C35.5021 79.2737 37.9016 80.558 40.7265 81.3705C43.6177 82.183 46.8374 82.5893 50.3853 82.5898C53.7384 82.5898 56.8011 82.1835 59.5625 81.3705C62.3226 80.5579 64.6595 79.2744 66.5658 77.5142C68.5383 75.7075 70.0542 73.3748 71.1062 70.5293C72.1574 67.6392 72.6747 64.116 72.6747 59.9622V0.141777H100V62.8072C100 71.1631 97.8926 78.1212 93.6846 83.6768C89.4768 89.1863 83.6229 93.2922 76.1282 96.0019C68.633 98.6665 59.9889 100 50.1926 100C40.2652 99.9998 31.515 98.6666 23.9543 96.0019C16.3967 93.337 10.5082 89.2515 6.3016 83.7429C2.09459 78.2328 0 71.2525 0 62.8072V0H27.3115V59.9622Z",V:"M44.0874 62.7231L49.6536 83.2182H50.5136L55.817 62.7231L74.0564 0H100L66.2685 100H33.8151L0 0H25.9436L44.0874 62.7231Z",W:"M28.541 72.347C28.7554 74.7771 29.0518 77.1238 29.4269 79.3706C29.8018 81.5705 30.0986 84.069 30.3129 86.8643H30.8736L33.3632 63.6826L39.2284 24.0741H60.8501L66.648 63.6826L69.1376 86.8643H69.7768C69.9911 84.0688 70.2629 81.5706 70.5843 79.3706C70.9594 77.1238 71.2559 74.7771 71.4702 72.347L78.2999 0H100L83.2791 100H59.6501L54.2671 69.2573C53.3025 63.7551 52.524 58.6162 51.9345 53.8476C51.3987 49.034 50.8305 43.8719 50.2411 38.3708H49.7589C49.1695 43.8717 48.5876 49.0341 47.9982 53.8476C47.4087 58.6621 46.6551 63.801 45.7441 69.2573L40.5181 100H16.8891L0 0H21.7898L28.541 72.347Z",X:"M39.6147 20.9077L50.2513 38.3036L60.6365 21.042L72.3857 0H99.653L65.3506 50.2015L100 100H72.8165L59.9426 78.8141L49.9162 61.8307L40.2249 78.958L27.0998 100H0L34.9007 50.2015L0.430725 0H27.4468L39.6147 20.9077Z",Y:"M39.5066 28.2L49.3154 48.3496H50.5076L74.5397 0H100L61.5911 66.9449V100H38.4089V66.9641L0 0H25.543L39.5066 28.2Z",Z:"M43.1362 77.3748L36.708 83.8419L50.0528 83.2182H94.8918V100H0L56.2962 23.5176L64.7175 16.3021L52.5079 16.7818H5.67582V0H100L43.1362 77.3748Z"},ayt=()=>ie.jsx("path",{d:"M 0 49 h 100 v 2 h -100 z"});function iyt({facetKey:e,scales:t,orientation:n,geom:r,aes:a,sideDistances:i,showTooltips:o,elementsAmount:s,normalize:c,activeElementContainer:f,tooltipsContainer:A,tooltipsData:h}){let v=n==="vertical",g=t.xPrimary.bandwidth(),C=(t.xPrimary(r.primaryGrouping)??0)+g/2,b=a.width==="auto"?g*.95:Math.min(g,a.width),B=(g-b)/2,E=[...t.xSecondary.domain()].filter($=>r.valuesMap[$]).sort(($,z)=>{let O=r.valuesMap[$],K=r.valuesMap[z];return O.height-K.height}),k={},P=0;E.forEach($=>{if(!r.valuesMap[$])return;let z=r.valuesMap[$].height;k[$]={y1:P,y2:P+z},P+=z});let I=f&&h.fixed;return ie.jsx("g",{opacity:a.opacity,children:E.map($=>{if(!r.valuesMap[$])return null;let{y1:z,y2:O}=k[$],K=t.y(z),te=t.y(O),le=Math.abs(K-te)-2*B,G=typeof a.fillColor=="string"?a.fillColor:a.fillColor[$],Q=v?-b/2:Math.min(K,te)+B,j=v?Math.min(K,te)+B:-b/2,Y=$==="-";if(!Y&&!EK[$])return;let X=`logo_${r.key}_${$}`,ee=h.currentFacet===e&&h.selectedData===X&&I,pe=ie.jsxs("g",{transform:v?`translate(${C},0)`:`translate(0, ${C})`,children:[ie.jsx("g",{transform:`translate(${Q},${j})`,children:Y?ie.jsx("g",{transform:v?`scale(${b/100},1) translate(0,${le/2-50})`:`scale(${le/100},1) translate(0,${b/2-50}) `,children:ayt()}):ie.jsx("g",{transform:v?`scale(${b/100},${le/100})`:`scale(${le/100},${b/100})`,fill:G,onMouseOver:()=>h.onMouseOver(X,e),onMouseLeave:()=>h.onMouseLeave(),children:ie.jsx("path",{d:EK[$],fillRule:"evenodd",clipRule:"evenodd"})})}),o&&ie.jsx(fu,{content:[$,Ka(r.valuesMap[$].height)+(c?"%":"")],x:v?C:(K+te)/2,y:v?(K+te)/2:C,sideDistances:i,horizontal:v,offset:s>1?g/2:g/4,active:X===h.selectedData&&h.currentFacet===e,fixed:h.fixed,onClose:h.onClose,container:A})]},$);return ee?cu.createPortal(pe,f):pe})})}function v3(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(r)[t]}return n}function oyt({facetKey:e,scales:t,orientation:n,geom:r,aes:a,sideDistances:i,showTooltips:o,activeElementContainer:s,tooltipsContainer:c,tooltipsData:f}){let A=n==="vertical",h=v3(t,"lineColor",a.lineColor,r.id),v=v3(t,"lineShape",a.lineShape,r.id),g=v3(t,"fillColor",a.dotFill,r.key1),C=v3(t,"dotShape",a.dotShape,r.key1),b=v3(t,"fillColor",a.dotFill,r.key2),B=v3(t,"dotShape",a.dotShape,r.key2),E=Yc(C,a.dotSize,g),k=Yc(B,a.dotSize,b);function P($){return r.grouping==="primary"?(t.xPrimary($)??0)+t.xPrimary.bandwidth()/2:(t.xPrimary(r.id)??0)+(t.xSecondary($)??0)+t.xSecondary.bandwidth()/2}let I=s&&f.fixed;return ie.jsx("g",{opacity:a.opacity,children:r.pairs.map($=>{let z=A?P(r.key1):t.y($.key1.value),O=A?P(r.key2):t.y($.key2.value),K=A?t.y($.key1.value):P(r.key1),te=A?t.y($.key2.value):P(r.key2),le=`pairedPoints_${$.id}_${$.key1.id}`,G=`pairedPoints_${$.id}_${$.key2.id}`,Q=f.currentFacet===e&&f.selectedData===le&&I,j=f.currentFacet===e&&f.selectedData===G&&I,Y=ie.jsxs("g",{transform:`translate(${z},${K})`,children:[E,o&&c&&ie.jsx("circle",{onMouseOver:()=>f.onMouseOver(le,e),onMouseLeave:()=>f.onMouseLeave(),r:"15",fill:"transparent",stroke:"none"}),o&&ie.jsx(fu,{content:[$.id,Ka($.key1.value)],x:z,y:K,sideDistances:i,horizontal:!0,active:le===f.selectedData&&f.currentFacet===e,fixed:f.fixed,onClose:f.onClose,container:c})]}),X=ie.jsxs("g",{transform:`translate(${O},${te})`,children:[k,o&&c&&ie.jsx("circle",{onMouseOver:()=>f.onMouseOver(G,e),onMouseLeave:()=>f.onMouseLeave(),r:"15",fill:"transparent",stroke:"none"}),o&&ie.jsx(fu,{content:[$.id,Ka($.key2.value)],x:O,y:te,sideDistances:i,horizontal:!0,active:G===f.selectedData&&f.currentFacet===e,fixed:f.fixed,onClose:f.onClose,container:c})]});return ie.jsxs("g",{children:[ie.jsx("line",{x1:z,y1:K,x2:O,y2:te,stroke:h,strokeDasharray:Of(v),strokeWidth:a.lineWidth,fill:"none"}),Q?cu.createPortal(Y,s):Y,j?cu.createPortal(Y,s):X]},$.id)})})}function BK(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r.primaryGrouping)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(r.secondaryGrouping)[t]}return n}function lyt(e,t,n){return n?[t,`${Ka(e)}`]:[`${Ka(e)}`]}function syt({scales:e,orientation:t,geom:n,aes:r,hasKeyFromColumn:a,sideDistances:i,showTooltips:o,tooltipsContainer:s}){let[c,f]=tn.useState(null),A=t==="vertical",h=(e.xPrimary(n.primaryGrouping)??0)+(e.xSecondary(n.secondaryGrouping)??0)+e.xSecondary.bandwidth()/2,v=e.xSecondary.bandwidth(),g=r.width==="auto"?v*.8:Math.min(v,r.width),C=k=>(1-k*2)*(g/2),b=BK(e,"dotFill",r.dotFill,n),B=BK(e,"dotShape",r.dotShape,n),E=Yc(B,r.dotSize,b);return ie.jsx("g",{transform:A?`translate(${h},0)`:`translate(0, ${h})`,children:n.points.map(({x:k,y:P,jitter:I,id:$})=>{let z=A?P*C(I):e.y(k),O=A?e.y(k):P*C(I);return ie.jsxs("g",{opacity:r.opacity,transform:`translate(${z},${O})`,children:[E,o&&s&&ie.jsx("circle",{onMouseOver:()=>f($),onMouseLeave:()=>f(null),r:"4",fill:"transparent",stroke:"none"}),o&&ie.jsx(fu,{content:lyt(P,$,a),x:h+z,y:O,active:c===$,fixed:!1,sideDistances:i,container:s})]},$)})})}function _K(e,t,n,r,a){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(a)[t]}return n}function uyt(e,t,n,r){let a=e.valueLabels[n],i=Ka(t.valuesMap[n].height)+(r?"%":"");return a?[a,i]:[i]}function cyt({facetKey:e,scales:t,orientation:n,geom:r,aes:a,sideDistances:i,showTooltips:o,elementsAmount:s,normalize:c,secondaryGrouping:f,activeElementContainer:A,tooltipsContainer:h,tooltipsData:v}){let g=n==="vertical",C=t.xPrimary.bandwidth(),b=(t.xPrimary(r.primaryGrouping)??0)+C/2,B=a.width==="auto"?C*.8:Math.min(C,a.width),E=t.xSecondary.domain().reverse(),k={},P=0;E.forEach($=>{if(!r.valuesMap[$])return;let z=r.valuesMap[$].height;k[$]={y1:P,y2:P+z},P+=z});let I=A&&v.fixed;return ie.jsx("g",{opacity:a.opacity,strokeWidth:a.lineWidth,children:E.map($=>{if(!r.valuesMap[$])return null;let{y1:z,y2:O}=k[$],K=t.y(z),te=t.y(O),le=Math.abs(K-te),G=_K(t,"lineColor",a.lineColor,r.primaryGrouping,$),Q=_K(t,"fillColor",a.fillColor,r.primaryGrouping,$),j=`stackedBar_${String(r.primaryGrouping)}_${String($)}`,Y=ie.jsx("rect",{width:g?B:le,height:g?le:B,x:g?b-B/2:Math.min(K,te),y:g?Math.min(K,te):b-B/2,fill:Q,stroke:G,onMouseOver:()=>v.onMouseOver(j,e),onMouseLeave:()=>v.onMouseLeave()}),X=v.selectedData===j&&e===v.currentFacet&&I;return ie.jsxs("g",{children:[X?cu.createPortal(Y,A):Y,o&&ie.jsx(fu,{content:uyt(f,r,$,c),x:g?b:(K+te)/2,y:g?(K+te)/2:b,sideDistances:i,horizontal:g,offset:s>1?C/2:C/4,active:j===v.selectedData&&e===v.currentFacet,fixed:v.fixed,onClose:v.onClose,container:h})]},$)})})}function TK(e,t,n,r){let a=t.reduce((i,o,s)=>(i[o]=s,i),{});return e.filter(([,i])=>r?i<=n.one:!0).sort(([[i,o]],[[s,c]])=>i!==o?a[o]-a[i]:a[c]-a[s])}function fyt(e,t){let n=t.reduce((a,i,o)=>(a[i]=o,a),{}),r=[];return e.map(([[a,i]])=>{let o=n[a],s=n[i];for(let c=0;c<r.length;c++)if(r[c]<o)return r[c]=s,c;return r.push(s),r.length-1})}function kK(e,t,n,r){let a=t.reduce((o,s,c)=>(o[s]=c,o),{}),i=[];return TK(e,t,n,!r).forEach(([[o,s]])=>{let c=a[o],f=a[s];for(let A=0;A<i.length;A++)if(i[A]<c){i[A]=f;return}i.push(f)}),i.length}var dyt={ttest:"TTest",anova:"ANOVA",kruskalWallis:"Kruskal-Wallis",wilcoxon:"Wilcoxon"};function Ayt(e,t){return e<=t.three?"***":e<=t.two?"**":e<=t.one?"*":"ns"}function HM(e,t,n,r){return!r&&e>n.one?"":t==="significance"?Ayt(e,n):Ka(e)}var m3=18,DM=12;function hyt({orientation:e,scales:t,testMethod:n,values:r,statType:a,format:i,ns:o,significanceLevels:s,yShift:c}){if(!r.length)return null;let f=E=>(t.xPrimary(E)??0)+t.xPrimary.bandwidth()/2,A=e==="vertical",h=Math.abs(t.xPrimary.range()[1]-t.xPrimary.range()[0]),v=Math.abs(t.y.range()[1]-t.y.range()[0]),g=t.xPrimary.domain(),C=a==="pairwise"?TK(r,g,s,!o):r,b=a==="pairwise"?fyt(C,g):[],B=Math.max(...b);return ie.jsxs("g",{fontSize:"14px",transform:A?`translate(0,${c})`:`translate(${v-c},0)`,children:[a==="overall"&&ie.jsx("text",{x:A?h/2:-m3,y:A?m3:h/2,transform:A?"":`rotate(90,${-m3},${h/2})`,textAnchor:"middle",children:`${dyt[n]}, p = ${HM(r[0][1],"pValue",s,!0)}`}),a==="referenceGroup"&&ie.jsx("g",{children:r.map(([[E],k])=>ie.jsx("text",{x:A?f(E):-m3,y:A?m3:f(E),transform:A?"":`rotate(90,${-m3},${f(E)})`,textAnchor:"middle",children:HM(k,i,s,o)},E))}),a==="pairwise"&&ie.jsx("g",{children:C.map(([[E,k],P],I)=>{let $=f(E),z=f(k),O=($+z)/2;return ie.jsxs("g",{transform:A?`translate(0,${(B-b[I])*p3})`:`translate(${-(B-b[I])*p3},0)`,children:[ie.jsx("text",{x:A?O:-DM,y:A?DM:O,transform:A?"":`rotate(90,${-DM},${O})`,textAnchor:"middle",children:HM(P,i,s,o)}),ie.jsx("path",{d:A?`M ${$},21 v-4 h ${z-$} v4`:`M -21,${$} h 4 v ${z-$} h-4`,fill:"none",stroke:Vt})]},`${E}_${k}`)})})]})}function pyt(e){return`translate(${e},0)`}function vyt(e){return`translate(0,${e})`}function myt(e){return e==="bottom"?`translate(0,${zf})`:`translate(${-zf},0)`}function gyt(e){return e==="bottom"?"hanging":"central"}function yyt(e){return e==="bottom"?"middle":"end"}var MK=({scale:e,tickSize:t=6,tickPadding:n=zf,orient:r="bottom",onlyPositive:a=!1,offset:i=typeof window<"u"&&window.devicePixelRatio>1?0:.5,hiddenLabels:o=!1})=>{function s(P){return I=>{let $=P(I);return $===void 0?0:+$}}let c=Math.abs(e.range()[0]-e.range()[1]),f=Math.min(Math.floor(c/bK),10),A=o?[]:e.ticks(f).filter(P=>a&&P>=0||!a),h=A.some(P=>Math.abs(P)<1e-4&&P!==0||P>1e4)?",e":",f",v=P=>e.tickFormat(f,h)(P),g=Math.max(t,0)+n,C=s(e.copy()),b=r==="bottom"?pyt:vyt,B=r==="left"?-1:1,E={[(r==="left"?"x":"y")+"2"]:B*t},k={[r==="left"?"x":"y"]:B*g};return ie.jsx("g",{children:A.map((P,I)=>ie.jsxs("g",{className:"tick",transform:b(C(P)+i),children:[ie.jsx("line",{stroke:Vt,...E}),ie.jsx("g",{transform:myt(r),children:ie.jsx("text",{fill:Vt,fontSize:"14px",fontWeight:"500",fontFamily:"Manrope",dominantBaseline:gyt(r),textAnchor:yyt(r),...k,children:v(P)})})]},I))})};function PK(e,t,n,r){if(n&&typeof n=="object"&&"type"in n){if(n.type==="primaryGrouping")return e.xPrimaryAes(r.primaryGrouping)[t];if(n.type==="secondaryGrouping")return e.xSecondaryAes(r.secondaryGrouping)[t]}return n}function wyt({facetKey:e,scales:t,orientation:n,violin:r,aes:a,maxViolinDensity:i,showTooltips:o,sideDistances:s,elementsAmount:c,activeElementContainer:f,tooltipsContainer:A,tooltipsData:h}){let v=n==="vertical",g=(t.xPrimary(r.primaryGrouping)??0)+(t.xSecondary(r.secondaryGrouping)??0)+t.xSecondary.bandwidth()/2,C=t.xSecondary.bandwidth(),b=a.width==="auto"?C*.8:Math.min(C,a.width),B=PK(t,"lineColor",a.lineColor,r),E=PK(t,"fillColor",a.fillColor,r),k=r.getArea(n,t.y,b,i)??"",P=r.getLine(n,t.y,b,i)??"",I=Math.abs(t.y.range()[0]-t.y.range()[1]),$=f&&h.fixed,z=h.selectedData===r&&$,O=ie.jsxs("g",{transform:v?`translate(${g},0)`:`translate(0, ${g})`,opacity:a.opacity,stroke:B,fill:E,strokeWidth:a.lineWidth,strokeDasharray:Of(a.lineShape),children:[ie.jsx("clipPath",{id:`violin_${r.key}`,children:ie.jsx("path",{d:k})}),ie.jsx("path",{d:k,stroke:"none"}),a.showQuartiles&&ie.jsxs("g",{clipPath:`url(#violin_${r.key})`,strokeWidth:a.lineWidth,stroke:B,children:[ie.jsx("line",{x1:v?-b/2:t.y(r.quartiles.q1),x2:v?b/2:t.y(r.quartiles.q1),y1:v?t.y(r.quartiles.q1):-b/2,y2:v?t.y(r.quartiles.q1):b/2,strokeDasharray:Of(a.quartilesLineStyle)}),ie.jsx("line",{x1:v?-b/2:t.y(r.quartiles.q2),x2:v?b/2:t.y(r.quartiles.q2),y1:v?t.y(r.quartiles.q2):-b/2,y2:v?t.y(r.quartiles.q2):b/2,strokeDasharray:Of(a.medianLineStyle)}),ie.jsx("line",{x1:v?-b/2:t.y(r.quartiles.q3),x2:v?b/2:t.y(r.quartiles.q3),y1:v?t.y(r.quartiles.q3):-b/2,y2:v?t.y(r.quartiles.q3):b/2,strokeDasharray:Of(a.quartilesLineStyle)})]}),ie.jsx("path",{d:P,fill:"none"}),o&&A&&ie.jsx("rect",{onMouseOver:()=>h.onMouseOver(r,e),onMouseLeave:h.onMouseLeave,width:v?C:I,x:v?-C/2:0,y:v?0:-C/2,height:v?I:C,fill:"transparent",stroke:"none"}),o&&ie.jsx(fu,{content:[`Quartile 3 = ${Ka(r.quartiles.q3)}`,`Median = ${Ka(r.quartiles.q2)}`,`Quartile 1 = ${Ka(r.quartiles.q1)}`],x:v?g:t.y(r.quartiles.q2),y:v?t.y(r.quartiles.q2):g,sideDistances:s,horizontal:v,active:h.active&&h.selectedData===r&&h.currentFacet===e,fixed:h.fixed,offset:c>1?b/2:b/4,onClose:h.onClose,container:A})]});return z?cu.createPortal(O,f):O}var byt=1;function Cyt({scaleX:e,scaleY:t,orientation:n,width:r,height:a,axisX:i,axisY:o,frameType:s}){let[c,f]=tn.useState(e.domain()),A=Math.abs(t.range()[0]-t.range()[1]),h=Math.min(Math.floor(A/bK),10),[v,g]=tn.useState(t.ticks(h)),C=e.bandwidth()/2,b=k=>(e(k)??0)+C,B=k=>t(k),E=n==="vertical";return tn.useEffect(()=>{let k=e.domain(),P=t.ticks(h);f(k),g(P)},[e,t]),ie.jsxs("g",{stroke:Nf,children:[i.showGrid&&c.map(k=>{let P=b(k)+(i.linesBetweenCategories?C:0);return ie.jsx("line",{x1:E?P:0,x2:E?P:r,y1:E?0:P,y2:E?a:P},`x_${k}`)}),o.showGrid&&v.map(k=>{let P=B(k);return ie.jsx("line",{x1:E?0:P,x2:E?r:P,y1:E?P:0,y2:E?P:a},`y_${k}`)}),s!=="empty"&&ie.jsxs("g",{strokeWidth:byt,children:[(i.showGrid||s!=="left")&&ie.jsx("line",{stroke:s==="left"?Nf:Vt,x1:"0",x2:r,y1:a,y2:a}),(i.showGrid||s!=="bottom")&&ie.jsx("line",{stroke:s==="bottom"?Nf:Vt,x1:"0",x2:"0",y1:"0",y2:a}),(i.showGrid||s==="full")&&ie.jsx("line",{stroke:s==="full"?Vt:Nf,x1:r,x2:r,y1:"0",y2:a}),(o.showGrid||s==="full")&&ie.jsx("line",{stroke:s==="full"?Vt:Nf,x1:"0",x2:r,y1:"0",y2:"0"})]})]})}function Syt(e,t,n){if(!e.length)return[];let r=[0];for(let a=0;a<e.length-1;a++){let i=e[a];if(i.meta.statType==="pairwise"){let o=kK(i.values[n],t,i.meta.significanceLevels,i.meta.ns);r.push(r[r.length-1]+p3*o)}else r.push(r[r.length-1]+p3)}return r}function HK(e){return typeof e=="string"?e:e.value}function xyt({facetSettings:e,facetTitle:t,dimensions:n,scales:r,orientation:a,layersData:i,statsData:o,facetKey:s,xAxis:c,yAxis:f,frameType:A,tooltips:h,tooltipsContainer:v,keyColumn:g,chartSizes:C,margins:b,xLabels:B,onlyPositive:E,secondaryGrouping:k,tooltipsData:P}){let[I,$]=tn.useState(),z=a==="vertical",O=Syt(o,r.xPrimary.domain(),s),K=c.showTicks?yK:0,te=f.showTicks?yK:0,le=HK(c.title),G=HK(f.title),Q=n.chartEdgeSides.includes("left")||z&&!(e!=null&&e.sharedY)||!z&&!(e!=null&&e.sharedX),j=n.chartEdgeSides.includes("bottom")||z&&!(e!=null&&e.sharedX)||!z&&!(e!=null&&e.sharedY),Y=n.chartEdgeSides.includes("left"),X=n.chartEdgeSides.includes("bottom"),{width:ee,height:pe}=n.inner,{left:ae,top:ge,padding:me}=n,fe={left:b.left+ae+me.left,right:C.totalWidth-(b.left+ae+me.left),top:b.top+ge+me.top,bottom:C.totalHeight-(b.top+ge+me.top)},Ce=`translate(${ae+me.left},${ge+me.top})`,De=!1;return ie.jsxs("g",{transform:Ce,children:[De,t.length&&ie.jsxs("g",{children:[A==="full"&&ie.jsx("rect",{x:"0",y:-me.top,height:me.top,width:ee,fill:"#F7F8FA",stroke:Vt}),t.map((ke,$e)=>{let je=t.length,Oe=(me.top-x9*je)/2;return ie.jsx("text",{fontSize:"14px",fontWeight:"500",fill:Vt,x:ee/2,dy:Oe+x9/2-me.top,y:$e*x9,textAnchor:"middle",dominantBaseline:"central",children:ke},$e)})]}),ie.jsxs("g",{dominantBaseline:"central",textAnchor:"middle",fontWeight:"500",fontSize:"14px",fill:Vt,children:[X&&ie.jsx("text",{x:ee/2,y:pe+me.bottom-dp/2,children:z?le:G}),X&&De&&ie.jsx("rect",{x:"0",y:pe+me.bottom-dp,width:ee,height:dp,fill:"none",stroke:"black"}),Y&&ie.jsx("text",{x:-me.left+dp/2,y:pe/2,transform:`rotate(-90,${-me.left+dp/2},${pe/2})`,children:z?G:le}),Y&&De&&ie.jsx("rect",{x:-me.left,y:"0",width:dp,height:pe,fill:"none",stroke:"black"})]}),ie.jsx(Cyt,{orientation:a,width:ee,height:pe,scaleX:r.xPrimary,scaleY:r.y,axisX:c,axisY:f,frameType:A}),j&&ie.jsx("g",{transform:`translate(0,${pe})`,children:z?ie.jsx(CK,{scale:r.xPrimary,orient:"bottom",labelsPosition:c.labelsPosition,tickSize:K,labels:B}):ie.jsx(MK,{scale:r.y,onlyPositive:E,orient:"bottom",tickSize:te,hiddenLabels:f.hiddenLabels})}),Q&&ie.jsx("g",{children:z?ie.jsx(MK,{scale:r.y,onlyPositive:E,orient:"left",tickSize:te,hiddenLabels:f.hiddenLabels}):ie.jsx(CK,{scale:r.xPrimary,orient:"left",labelsPosition:c.labelsPosition,tickSize:K,labels:B})}),ie.jsxs("g",{children:[i.map(ke=>ie.jsxs("g",{children:[ke.type==="box"&&ke.geoms[s].map($e=>ie.jsx(Z4t,{facetKey:s,box:$e,elementsAmount:ke.geoms[s].length,scales:r,orientation:a,aes:ke.aes,hasKeyFromColumn:g!==null,sideDistances:fe,showTooltips:h.box.show,tooltipsData:P,activeElementContainer:I,tooltipsContainer:v},$e.key)),ke.type==="violin"&&ke.geoms[s].map($e=>ie.jsx(wyt,{facetKey:s,violin:$e,elementsAmount:ke.geoms[s].length,scales:r,orientation:a,maxViolinDensity:ke.meta.maxDensity,aes:ke.aes,sideDistances:fe,showTooltips:h.violin.show,tooltipsData:P,activeElementContainer:I,tooltipsContainer:v},$e.key)),ke.type==="dot"&&ke.geoms[s].map($e=>ie.jsx(q4t,{facetKey:s,geom:$e,scales:r,orientation:a,aes:ke.aes,hasKeyFromColumn:g!==null,sideDistances:fe,showTooltips:h.dot.show,tooltipsData:P,activeElementContainer:I,tooltipsContainer:v},$e.key)),ke.type==="line"&&ke.geoms[s].map($e=>ie.jsx(ryt,{facetKey:s,line:$e,scales:r,orientation:a,sideDistances:fe,aes:ke.aes,showTooltips:h.line.show,secondaryGrouping:k,tooltipsData:P,activeElementContainer:I,tooltipsContainer:v},$e.key)),ke.type==="errorbar"&&ke.geoms[s].map($e=>ie.jsx(eyt,{facetKey:s,errorBar:$e,scales:r,orientation:a,aes:ke.aes,sideDistances:fe,showTooltips:h.errorBar.show,tooltipsData:P,activeElementContainer:I,tooltipsContainer:v},$e.key)),ke.type==="bar"&&ke.geoms[s].map($e=>ie.jsx(W4t,{bar:$e,scales:r,orientation:a,aes:ke.aes},$e.key)),ke.type==="stackedBar"&&ke.geoms[s].map($e=>ie.jsx(cyt,{facetKey:s,geom:$e,elementsAmount:ke.geoms[s].length,scales:r,orientation:a,aes:ke.aes,normalize:ke.meta.normalize,sideDistances:fe,showTooltips:h.stackedBar.show,secondaryGrouping:k,tooltipsData:P,activeElementContainer:I,tooltipsContainer:v},$e.key)),ke.type==="binnedDots"&&ke.geoms[s].map($e=>ie.jsx(X4t,{facetKey:s,geom:$e,scales:r,orientation:a,aes:ke.aes,binsCount:ke.meta.binsCount,min:ke.meta.minY,max:ke.meta.maxY,hasKeyFromColumn:ke.meta.hasKeyFromColumn,sideDistances:fe,showTooltips:h.stackedBar.show,tooltipsData:P,activeElementContainer:I,tooltipsContainer:v},$e.key)),ke.type==="pairedPoints"&&ke.geoms[s].map($e=>ie.jsx(oyt,{facetKey:s,geom:$e,scales:r,orientation:a,sideDistances:fe,aes:ke.aes,showTooltips:h.pairedPoints.show,tooltipsData:P,activeElementContainer:I,tooltipsContainer:v},$e.id)),ke.type==="sina"&&ke.geoms[s].map($e=>ie.jsx(syt,{geom:$e,scales:r,orientation:a,sideDistances:fe,aes:ke.aes,hasKeyFromColumn:g!==null,showTooltips:!1,tooltipsContainer:v},$e.key)),ke.type==="logo"&&ke.geoms[s].map($e=>ie.jsx(iyt,{facetKey:s,geom:$e,elementsAmount:ke.geoms[s].length,scales:r,orientation:a,aes:ke.aes,normalize:ke.meta.normalize,sideDistances:fe,showTooltips:h.logo.show,tooltipsData:P,activeElementContainer:I,tooltipsContainer:v},$e.key))]},ke.type)),o.map((ke,$e)=>ie.jsx(hyt,{yShift:O[$e],scales:r,orientation:a,statType:ke.meta.statType,values:ke.values[s],testMethod:ke.meta.testMethod,format:ke.meta.format,ns:ke.meta.ns,significanceLevels:ke.meta.significanceLevels},`${ke.meta.statType}_${ke.meta.testMethod}`))]}),ie.jsxs("g",{children:[P.fixed&&ie.jsx("rect",{width:C.chartWidth,height:C.chartHeight,fill:"rgba(255, 255, 255, 0.8)"}),ie.jsx("g",{ref:ke=>{ke&&!I&&$(ke)}})]})]})}var g3=class extends T8.Component{constructor(e){super(e),this.state={hasError:!1,message:""}}static getDerivedStateFromError(e){return{hasError:!0,message:e.message}}componentDidUpdate(e){e.dataId!==this.props.dataId&&this.setState({hasError:!1,message:"error.message"})}componentDidCatch(e,t){console.log(t)}render(){return this.state.hasError?ie.jsx(Xv,{message:this.state.message}):this.props.children}};function Eyt(e,t,n,r){return e==="left"?n:e==="right"?t-r:(t-(n+r))/2+n}function Byt(e){return e==="left"?"start":e==="right"?"end":"middle"}function y3({show:e,position:t,title:n,chartsWidth:r,leftPadding:a,rightPadding:i}){return e?ie.jsx("g",{children:n.map((o,s)=>ie.jsx("text",{x:Eyt(t,r,a,i),textAnchor:Byt(t),y:-(n.length-s-1)*24-24-24/2,fontSize:"20px",fontFamily:"Manrope",fontWeight:"500",dominantBaseline:"central",children:o},`${o}_${s}`))}):null}var pc=12,B9=-12,DK=14;function _yt(e=null){return e==="dashed"?"M1 11.25H6V12.75H1V11.25ZM9.5 11.25H14.5V12.75H9.5V11.25ZM18 11.25H23V12.75H18V11.25Z":e==="dotted"?"M2.75 11.25H1.25V12.75H2.75V11.25Z M11.25 11.25H12.75V12.75H11.25V11.25Z M22.75 11.25H21.25V12.75H22.75V11.25Z M7.75 11.25H6.25V12.75H7.75V11.25Z M16.25 11.25H17.75V12.75H16.25V11.25Z":e==="longdash"?"M1 11.25H10V12.75H1V11.25ZM14 11.25H23V12.75H14V11.25Z":e==="dotdash"?"M1 11.25H2.5V12.75H1V11.25ZM17 12.75H7V11.25H17V12.75ZM21.5 12.75V11.25H23V12.75H21.5Z":e==="twodash"?"M1 11.25H4V12.75H1V11.25ZM17.0261 12.75H7V11.25H17.0261V12.75ZM20 12.75V11.25H23V12.75H20Z":"M1 11.25H23V12.75H1V11.25Z"}var Tyt=3,kyt=24;function Myt(e,t){if(e==="transparent")return Vt;let n=lv(e??t??"");return n&&n.formatHex()==="#ffffff"?Vt:e??t}function Pyt({aes:e,label:t,usedAes:n}){let r=n.lineShape,a=n.dotShape,i=n.fillColor||n.lineColor&&!n.lineShape||n.dotFill&&!n.dotShape,o=a?Yc(e.dotShape??"21",Tyt,i?Vt:e.dotFill??Vt):null,s=(a&&r?2*pc:0)-6,c=r?s+kyt+8:pc+8;return ie.jsxs("g",{children:[i&&ie.jsx("rect",{width:pc,height:pc,stroke:Myt(e.fillColor,e.lineColor),fill:e.fillColor??e.lineColor,rx:"1",ry:"1"}),a&&ie.jsx("g",{transform:`translate(${pc/2},${pc/2})`,children:o}),r&&ie.jsx("path",{transform:`translate(${s},-5)`,fillRule:"evenodd",clipRule:"evenodd",d:_yt(e.lineShape),fill:e.lineColor}),ie.jsx("text",{x:c,y:pc/2,dominantBaseline:"central",fontWeight:500,children:t})]})}function Hyt({aes:e,label:t}){let n=Yc(e.shape,e.size,e.color);return ie.jsxs("g",{children:[ie.jsx("g",{transform:`translate(${pc/2},${pc/2})`,children:n}),ie.jsx("text",{x:pc+8,y:pc/2,dominantBaseline:"central",fontWeight:500,children:t})]})}function w3({legendData:e}){let t=e.items.filter(n=>n.type==="continuous");return ie.jsxs("g",{children:[ie.jsx("defs",{children:t.map(n=>ie.jsx("linearGradient",{id:n.id,gradientTransform:"rotate(90)",children:n.scale.domain().reverse().map(r=>{let a=n.scale.domain(),i=a[a.length-1]-a[0],o=i>0?100-(r-a[0])/i*100:0;return ie.jsx("stop",{offset:`${o}%`,stopColor:n.scale(r)},r)})},n.id))}),e.items.map(n=>{if(n.type==="continuous")return ie.jsxs("g",{transform:`translate(${n.left},${n.top})`,children:[ie.jsx("text",{fontWeight:500,fontSize:"14px",y:B9,children:n.title}),ie.jsx("rect",{x:"0",y:"0",width:DK,height:n.height,stroke:Vt,fill:`url(#${n.id})`}),ie.jsx("g",{transform:`translate(${DK},0)`,children:n.values.map(r=>{let a=n.tickPositionScale(r)??0;return ie.jsxs("g",{transform:`translate(0,${a})`,children:[ie.jsx("line",{x1:"0",x2:-4,stroke:Vt}),ie.jsx("text",{x:8,y:4,children:r})]},r)})}),!1]},n.id);if(n.type==="discreteColor")return ie.jsxs("g",{transform:`translate(${n.left},${n.top})`,children:[ie.jsx("text",{fontWeight:500,fontSize:"14px",y:B9,children:n.title}),n.values.map((r,a)=>ie.jsxs("g",{transform:`translate(0, ${a*(pc+4)})`,children:[ie.jsx("rect",{x:"0",y:"0",width:pc,height:pc,fill:n.scale(r),rx:"1",ry:"1",stroke:Vt}),ie.jsx("text",{x:pc+8,y:10,children:n.labels[r]??r})]},r)),!1]},n.id);if(n.type==="discreteMulti")return ie.jsxs("g",{transform:`translate(${n.left},${n.top})`,fontSize:"14px",fontWeight:500,children:[ie.jsx("text",{fontWeight:600,y:B9,children:n.title}),n.values.map((r,a)=>ie.jsx("g",{transform:`translate(0, ${a*(pc+4)})`,children:ie.jsx(Pyt,{aes:n.scale(r),label:n.labels[r],usedAes:n.usedAes})},r)),!1]},n.id);if(n.type==="dots")return ie.jsxs("g",{transform:`translate(${n.left},${n.top})`,fontSize:"14px",fontWeight:500,children:[ie.jsx("text",{fontWeight:500,y:B9,children:n.title}),n.values.map((r,a)=>ie.jsx("g",{transform:`translate(0, ${a*(pc+4)})`,children:ie.jsx(Hyt,{aes:n.scale(r),label:n.labels[r]})},r)),!1]},n.id);if(n.type==="size"){let r=n.height/n.values.length;return ie.jsxs("g",{transform:`translate(${n.left},${n.top})`,fontSize:"14px",fontWeight:500,children:[ie.jsx("text",{fontWeight:500,y:B9,children:n.title}),n.values.map((a,i)=>{let o=n.scale(a);return ie.jsxs("g",{transform:`translate(0, ${i*r})`,children:[ie.jsx("circle",{r:o,cx:r/2,cy:r/2,fill:Vt}),ie.jsx("text",{x:r+4,y:r/2,alignmentBaseline:"central",children:n.labels[a]})]},a)}),!1]},n.id)}})]})}function Dyt({settingsId:e,chartSettings:t,chartSizes:n,chartsDimensions:r,facetKeys:a,facetTitles:i,facetSettings:o,scales:s,layersData:c,statsData:f,legendData:A,margins:h,columnsCount:v,keyColumn:g,xLabels:C,chartTitle:b,onlyPositive:B,secondaryGrouping:E,onTooltipHintSwitch:k}){let[P,I]=tn.useState(),$=h3(k),{orientation:z,xAxis:O,yAxis:K,title:te,legend:le,frame:G}=t,Q=r[a[0]].padding,j=r[a[v-1]].padding,Y=n.chartsWidth+wK,X=Q.top;return ie.jsx(g3,{dataId:e,children:ie.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${n.totalWidth} ${n.totalHeight}`,width:n.totalWidth,height:n.totalHeight,children:[ie.jsx("defs",{children:Qm}),ie.jsxs("g",{transform:`translate(${h.left},${h.top})`,fontFamily:"Manrope",children:[ie.jsx(y3,{title:b,show:te.show,position:te.position,leftPadding:Q.left,rightPadding:j.right,chartsWidth:n.chartsWidth}),a.map(ee=>ie.jsx(xyt,{facetKey:ee,facetTitle:i[ee],facetSettings:o,orientation:z,scales:{...s,xPrimary:s.xPrimary[ee],xSecondary:s.xSecondary[ee],y:s.y[ee]},chartSizes:n,margins:h,dimensions:r[ee],layersData:c,statsData:f,xAxis:O,yAxis:K,frameType:G.type,tooltips:t.tooltips,tooltipsContainer:P,keyColumn:g,xLabels:C[ee],onlyPositive:B,secondaryGrouping:E,tooltipsData:$},ee)),le.show&&ie.jsx("g",{transform:`translate(${Y},${X})`,children:ie.jsx(w3,{legendData:A})})]}),ie.jsx("g",{style:{outline:"none"},ref:ee=>{ee&&!P&&I(ee)}})]})})}function $K(e,t,n){let r=Object.keys(e.values),a=e.length?e.reduce((i,o)=>{if(o.meta.statType==="pairwise"){let s=Object.values(o.values).map(c=>kK(c,t,o.meta.significanceLevels,o.meta.ns));return i+p3*Math.max(...s)}return(o.meta.ns?t.length>0:r.some(s=>o.values[s].some(([,c])=>c<o.meta.significanceLevels.one)))?i+p3:i},F4t):0;return Math.max(n,a)}function b3(e,t,n=r=>r){let r=A=>t==="log"?Math.log10(A):A,a=A=>t==="log"?Math.pow(10,A):A,i=e.map(n).map(r).sort((A,h)=>A-h),o=D0(i,.25),s=D0(i,.75),c=s-o,f=1.5;return[a(o-f*c),a(s+f*c)]}function $yt(e,t,n,r=14){let a=new hc(`600 ${r}px Manrope`),i=[];e.split(new RegExp("(?=[_-])|(?<=[_-])")).forEach(h=>{a.getTextWidth(h)>n?i.push(...h.split("")):i.push(h)});let o="",s=0,c=0,f="";for(;s<=t;){let h=a.getTextWidth(o+i[c]);h<t&&(o+=i[c],f=o,c++),s=h}o="",s=0;let A=[];for(c;c<i.length;c++){let h=a.getTextWidth(o+i[c]);h<n?(o+=i[c],s=h):(A.push(o),o=i[c],s=a.getTextWidth(i[c]))}return{firstPart:f,lines:A,lastPart:o,lastPartLength:s}}function Kv(e,t,n){let r=new hc(`600 ${n}px Manrope`);if(e.trim()==="")return[];if(r.getTextWidth(e)<=t)return[e];let a=e.split(/\s+/),i=[],o="",s=0;for(let c=0;c<a.length;c++){let f=`${o} ${a[c]}`,A=r.getTextWidth(f);if(A<=t)o=f,s=A;else{let h=r.getTextWidth(a[c]);if(h>t){let{firstPart:v,lines:g,lastPart:C,lastPartLength:b}=$yt(a[c],t-s,t,n);i.push(`${o} ${v}`),i.push(...g),o=C,s=b}else i.push(o),o=a[c],s=h}}return i.push(o),i.filter(c=>c.length>0)}var IK=new hc("600 14px Manrope"),Iyt=16,$M=48,Lyt=20,jm=24;function IM(e,t){return Math.max(...e.map(n=>IK.getTextWidth(String(n))+Lyt),IK.getTextWidth(t))}function Ryt(e,t,n,r){let a=[[]],i=0,o=t,s=0;return e.forEach(c=>{i+r<=o?(a[s].push(c),i+=r):(a.push([c]),s++,i=r,o=n)}),a}function C3(e,t,n){let r=n??t,a=0,i=0,o=0;e.sort((c,f)=>c.type==="continuous"&&f.type!=="continuous"?-1:f.type==="continuous"&&c.type!=="continuous"?1:c.type==="dots"&&f.type!=="dots"?-1:f.type==="dots"&&c.type!=="dots"?1:0);let s=[];return e.forEach(c=>{let{type:f,values:A,title:h,id:v,scale:g}=c;if(f==="continuous"){let C=oK(A,h),b=r;t-i<b&&(o+=a+jm,a=0,i=0);let B=o,E=i;C>a&&(a=C),i+=b+$M,i>=t&&(o+=a+jm,a=0,i=0),s.push({...c,width:C,height:b,left:B,top:E})}else if(f==="size"){let{labels:C}=c,b=g(Math.max(...A))*2+4,B=IM(A.map(I=>C[I]),h),E=A.length*b;t-i<E&&(o+=a+jm,a=0,i=0);let k=o,P=i;B>a&&(a=B),i+=E+$M,i>=t&&(o+=a+jm,a=0,i=0),s.push({...c,width:B,height:E,left:k,top:P})}else{let{labels:C}=c,b=Iyt,B=t-i;B<b&&(B=t,o+=a+jm,a=0,i=0);let E=Ryt(A,B,t,b),k=IM([],h),P=a===0,I=o+k+jm;E.forEach(($,z)=>{let O=z===E.length-1,K=z>0?"":h,te=z>0?`${v}_${z}`:v,le=IM($.map(Y=>C[Y]),P&&!O?"":K),G=$.length*b,Q=o,j=i;le>a&&(a=le),O?i+=G+$M:i=t,i>=t&&(o+=a+jm,P&&O&&o<I&&(o=I),a=0,i=0),s.push({...c,id:te,title:K,width:le,height:G,left:Q,top:j,values:$})})}}),s}function Vyt(e,t,n,r){let a=[];return e%n===n-1&&a.push("right"),e%n===0&&a.push("left"),e<n&&a.push("top"),(Math.ceil((e+1)/n)===r||Math.ceil((e+1)/n)===r-1&&e%n>(t-1)%n)&&a.push("bottom"),a}function Nyt(e,t,n,r,a,i,o,s,c,f,A){let h=e==="vertical",v=o.includes("left")||h&&!(s!=null&&s.sharedY)||!h&&!(s!=null&&s.sharedX),g=o.includes("left")&&n.title!=="",C=o.includes("bottom")||h&&!(s!=null&&s.sharedX)||!h&&!(s!=null&&s.sharedY),b=o.includes("bottom")&&t.title!=="",B=r.yAxisCaptionsWidth,E=(n.showTicks?c3:0)+(n.hiddenLabels?0:zf),k=g?dp:0,P=r.xAxisCaptionsWidthByRows[h?c:f],I=(t.showTicks?c3:0)+(t.hiddenLabels?0:zf),$=b?dp:0,z=h?B+E+k:P+I+$,O=h?I+P+$:E+2*dp,K=Math.max(...a.map(te=>i[te].length));return{left:v?z:TM,top:K===0?0:z4t*2+K*x9,bottom:C?O:TM,right:A?0:TM}}function zyt(e,t,n){let r=new Array(n).fill(null).map(()=>[]);for(let a=0;a<n;a++)for(let i=0;i<t;i++)i*n+a<e.length&&r[a].push(e[i*n+a]);return r}function LK(e,t,n){let r=[];for(let a=0;a<t;a++)r.push(e.slice(a*n,a*n+n));return r}function Oyt(e,t){let n=Math.floor(e/t),r=e-n*t;return[n,r]}function Fyt(e){return typeof e=="object"&&"type"in e}var Qyt=class{constructor(){Be(this,"reactRoot",null);Be(this,"parentNode",null);Be(this,"rootNode",null);Be(this,"component",ie.jsx(ie.Fragment,{}));Be(this,"chartsDimensions",{});Be(this,"chartSizes",{chartWidth:600,chartHeight:350,chartsWidth:600,chartsHeight:350,totalWidth:600,totalHeight:350});Be(this,"columnsCount",1);Be(this,"rowsCount",1);Be(this,"scales",{xPrimary:{null:K4().range([0,600]).domain(["1"])},xSecondary:{null:K4().range([0,600]).domain(["1"])},y:{null:Zr().domain([0,10]).range([350,0]).nice()},xPrimaryAes:Qo().unknown(gK),xSecondaryAes:Qo().unknown(gK)});Be(this,"facetTitles",{});Be(this,"mainTitle",[]);Be(this,"axisLabelsX",{});Be(this,"captionsSizes",{xAxisCaptionsWidthByRows:[],xCaptionsTail:0,yAxisCaptionsWidth:100});Be(this,"legend",{width:0,height:0,items:[]});Be(this,"margins",{left:0,right:0,top:0,bottom:0})}clear(){var e;this.parentNode&&this.rootNode&&((e=this.parentNode)==null||e.removeChild(this.rootNode),this.parentNode=null,this.rootNode=null),setTimeout(()=>{var t;(t=this.reactRoot)==null||t.unmount(),this.reactRoot=null})}init(e){this.parentNode===null&&(this.parentNode=e,this.rootNode=document.createElement("div"),this.parentNode.appendChild(this.rootNode),this.reactRoot=Wh(this.rootNode))}updateChartSize(e,t,n,r,a,i){let o=e.innerOffset,s=e.innerOffset,c=$K(i,r,e.innerOffset),f=t.length,A=Math.min((n==null?void 0:n.nRows)??f,f),h=Math.min((n==null?void 0:n.nCols)??f,f);this.columnsCount=n!=null&&n.nRows?Math.ceil(f/A):h,this.rowsCount=Math.ceil(f/this.columnsCount);let{width:v,height:g}=e;a==="vertical"&&c>o&&(g+=c),a==="horizontal"&&c>s&&(v+=c),this.chartSizes.chartWidth=v,this.chartSizes.chartHeight=g}updateChartDimensions(e,t,n,r,a){let{chartWidth:i,chartHeight:o}=this.chartSizes,s=0,c=0;this.chartsDimensions=e.reduce((h,v,g)=>{let[C,b]=Oyt(g,this.columnsCount),B=Vyt(g,e.length,this.columnsCount,this.rowsCount),E=Nyt(n,r,a,this.captionsSizes,LK(e,this.rowsCount,this.columnsCount)[C],this.facetTitles,B,t,C,b,b===this.columnsCount-1),k=i+E.left+E.right,P=o+E.top+E.bottom;return h[v]={left:s,top:c,chartEdgeSides:B,padding:E,inner:{width:i,height:o},outer:{width:k,height:P}},s+=k,b===this.columnsCount-1&&(s=0,c+=P),h},{});let f=Math.max(...e.map(h=>this.chartsDimensions[h].outer.width+this.chartsDimensions[h].left)),A=Math.max(...e.map(h=>this.chartsDimensions[h].outer.height+this.chartsDimensions[h].top));this.chartSizes.chartsWidth=f,this.chartSizes.chartsHeight=A}updateViewport(e,t,n,r,a,i,o,s,c,f){let A=c.innerOffset,h=e==="vertical",v=$K(s,t,c.innerOffset),g=a===null||a.sharedX,C=a===null||a.sharedY,{chartHeight:b,chartWidth:B}=this.chartSizes;r.forEach(E=>{let k=i.scale==="log"?X2():Zr(),P=Math.min(...C?o.map(({meta:O})=>O.minY):o.map(({geoms:O})=>Math.min(...O[E].map(({boundsY:K})=>K.min)))),I=Math.max(...C?o.map(({meta:O})=>O.maxY):o.map(({geoms:O})=>Math.max(...O[E].map(({boundsY:K})=>K.max)))),$=k.copy().domain([P,I]).range(h?[b-A,v]:[A,B-v]);k.domain([$.invert(h?b:0),$.invert(h?0:B)]).range(h?[b,0]:[0,B]),this.scales.y[E]=k;let z=g?t:f[E];this.scales.xPrimary[E]=K4().domain(z).range(h?[0,B]:[b,0]),this.scales.xSecondary[E]=K4().domain(n).range([0,this.scales.xPrimary[E].bandwidth()])})}createFacetTitles(e,t){this.facetTitles=e.reduce((n,r,a)=>(t[a].length===1&&t[a][0]==="null"?n[r]=[]:n[r]=Kv(t[a].join(", "),this.chartSizes.chartWidth,14),n),{})}createMainTitle(e,t){let n=this.chartsDimensions[e[0]],r=this.chartsDimensions[e[e.length-1]];this.mainTitle=Kv(t.name,this.chartSizes.chartsWidth-n.padding.left-r.padding.right,20)}createAxisLabels(e,t,n,r){let a={center:120,"45deg":256,"90deg":320},i=r==="vertical";function o(s,c){return s==="center"?1/0:Math.floor(s==="45deg"?c*Math.sin(Math.PI/4)/kM:c/kM)}this.axisLabelsX=e.reduce((s,c)=>{let f=this.scales.xPrimary[c],A=f.bandwidth(),h=a[t.labelsPosition],v=t.labelsPosition==="center"?Math.min(h,A):h,g=n.valueLabels;return s[c]=f.domain().reduce((C,b)=>{if(t.hiddenLabels)return C[b]=[],C;let B=g[b];if(!i)C[b]=[B];else{let E=o(t.labelsPosition,A),k=Kv(B,v,14);C[b]=k.length>E?[B]:k}return C},{}),s},{})}updateAesScales(e,t){if(e.inheritedAes){let{inheritedAes:n,keys:r}=e;this.scales.xPrimaryAes.domain(r).range(r.map(a=>n[a]??m9))}else this.scales.xPrimaryAes.domain([]).range([]);if(t.inheritedAes){let{inheritedAes:n,keys:r}=t;this.scales.xSecondaryAes.domain(r).range(r.map(a=>n[a]??m9))}else this.scales.xSecondaryAes.domain([]).range([])}updateCaptionsSize(e,t,n,r){let a=new hc("600 14px Manrope"),i=e==="vertical";function o(C){return C.length?Math.max(...C.map(b=>a.getTextWidth(b))):0}function s(C){return C.length?Math.max(...C.map(o)):0}let c=[],f=0,A=LK(t,this.rowsCount,this.columnsCount),h=zyt(t,this.rowsCount,this.columnsCount);if(!i)c=h.map(C=>Math.max(...C.map(b=>s(this.scales.xPrimary[b].domain().map(B=>this.axisLabelsX[b][B])))));else{if(n.labelsPosition==="center"&&(c=A.map(C=>Math.max(...C.map(b=>Math.max(...this.scales.xPrimary[b].domain().map(B=>B?this.axisLabelsX[b][B].length*kM:0)))))),n.labelsPosition==="45deg"){let C=Math.sin(Math.PI/4);c=A.map(b=>Math.max(...b.map(B=>{let E=this.scales.xPrimary[B].domain().map(P=>this.axisLabelsX[B][P]),k=s(E);return k>0?k*C+14:0}))),f=Math.max(...h[0].map(b=>{let B=this.scales.xPrimary[b].domain(),E=this.axisLabelsX[b][B[0]];return Math.max(o(E)*C-this.scales.xPrimary[b].bandwidth()/2+14,0)}))}n.labelsPosition==="90deg"&&(c=A.map(C=>Math.max(...C.map(b=>s(this.scales.xPrimary[b].domain().map(B=>this.axisLabelsX[b][B]))))))}let v=Zn.flatten(t.map(C=>{if(r.hiddenLabels)return[];let b=this.scales.y[C],B=b.ticks(),E=B.some(P=>Math.abs(P)<1e-4&&P!==0||P>1e4)?",e":",f",k=b.tickFormat(10,E);return B.map(k)})),g=o(v);this.captionsSizes={xCaptionsTail:f,xAxisCaptionsWidthByRows:c,yAxisCaptionsWidth:g}}updateMargins(e,t,n){let r=this.chartsDimensions[t[0]],a=this.chartsDimensions[t[t.length-1]],i=e==="vertical",o=this.mainTitle.length?24*this.mainTitle.length+24*2:0,s=n.outerOffset;this.margins={left:Math.max(s,i?this.captionsSizes.xCaptionsTail-r.padding.left:0),right:this.legend.width+s,top:Math.max(o,s),bottom:Math.max(s,i?0:this.captionsSizes.xCaptionsTail-a.padding.bottom)},this.chartSizes.totalWidth=this.margins.left+this.chartSizes.chartsWidth+this.margins.right,this.chartSizes.totalHeight=this.margins.top+Math.max(this.chartSizes.chartsHeight,this.legend.height)+this.margins.bottom}updateLegendSize(e,t,n,r){if(!e.show){this.legend={width:0,height:0,items:[]};return}let a=this.chartSizes.chartHeight,i={width:0,height:0,left:0,top:0},o=[];function s(C,b){return r.some(B=>{let E=B.aes[b];return E&&Fyt(E)&&E.type===C})}function c(C){return{dotFill:s(C,"dotFill"),fillColor:s(C,"fillColor"),lineColor:s(C,"lineColor"),dotShape:s(C,"dotShape"),lineShape:s(C,"lineShape")}}let f=c("primaryGrouping"),A=c("secondaryGrouping");if(Object.values(f).some(C=>C)&&t.inheritedAes&&o.push({type:"discreteMulti",id:"primary",title:t.label,scale:this.scales.xPrimaryAes,values:t.keys,labels:t.valueLabels,usedAes:f,...i}),Object.values(A).some(C=>C)&&n.inheritedAes&&o.push({type:"discreteMulti",id:"secondary",title:n.label,scale:this.scales.xSecondaryAes,values:n.keys,labels:n.valueLabels,usedAes:A,...i}),!o.length){this.legend={width:0,height:0,items:[]};return}let h=C3(o,this.chartSizes.chartHeight),v=h[h.length-1],g=v.left+v.width+wK;this.legend={width:g,height:a,items:h}}render(e,t,n,r,a,i,o,s,c,f,A,h,v){var k;let{orientation:g,xAxis:C,yAxis:b,size:B}=t;this.updateChartSize(B,i,a,n.keys,g,c),this.updateViewport(g,n.keys,r.keys,i,a,b,s,c,B,A),this.createAxisLabels(i,C,n,g),this.createFacetTitles(i,o),this.updateCaptionsSize(g,i,C,b),this.updateChartDimensions(i,a,g,C,b),this.updateLegendSize(t.legend,n,r,s),this.createMainTitle(i,t.title),this.updateMargins(g,i,B),this.updateAesScales(n,r);let E=ie.jsx(Dyt,{settingsId:e,chartSettings:t,facetKeys:i,facetSettings:a,facetTitles:this.facetTitles,chartSizes:this.chartSizes,chartsDimensions:this.chartsDimensions,scales:this.scales,layersData:s,statsData:c,legendData:this.legend,margins:this.margins,columnsCount:this.columnsCount,keyColumn:f,xLabels:this.axisLabelsX,chartTitle:this.mainTitle,onlyPositive:h,secondaryGrouping:r,onTooltipHintSwitch:v});this.component=E,(k=this.reactRoot)==null||k.render(E)}renderError(e){var t;(t=this.reactRoot)==null||t.render(ie.jsx(Xv,{message:e}))}},jyt=Qyt,_9="#3e9838",S3="21",x3=3,q1=class{},RK=class extends q1{constructor(t){super();Be(this,"type","box");Be(this,"stat",{upper:.75,medium:.5,lower:.25,k:1.5});Be(this,"aes",{showOutliers:!0,boxWidth:"auto",dotShape:S3,dotFill:Vt,dotSize:x3,lineColor:Vt,fillColor:_9,lineWidth:1,lineShape:"solid",opacity:1});this.stat={...this.stat,...t.stat},this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="box"&&Object.keys(this.stat).every(n=>this.stat[n]===t.stat[n])}},VK=class extends q1{constructor(t){super();Be(this,"type","violin");Be(this,"stat",{bandwidth:"auto",stepsCount:40,trim:!0});Be(this,"aes",{width:"auto",lineColor:Vt,fillColor:_9,lineWidth:1,lineShape:"solid",opacity:1,showQuartiles:!0,medianLineStyle:"solid",quartilesLineStyle:"dashed"});this.stat={...this.stat,...t.stat},this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="violin"&&(this.stat.bandwidth!==t.stat.bandwidth||this.stat.trim!==t.stat.trim||this.stat.stepsCount!==t.stat.stepsCount)}},NK=class extends q1{constructor(t){super();Be(this,"type","dot");Be(this,"aes",{showOutliers:!0,jitter:.8,lineColor:"none",dotFill:Vt,dotShape:S3,dotSize:x3,opacity:1});this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="dot"&&this.aes.showOutliers===t.aes.showOutliers}},zK=class extends q1{constructor(t){super();Be(this,"type","line");Be(this,"pointsValues");Be(this,"aes",{showOutliers:!0,lineWidth:1,lineShape:"solid",fillColor:"none",lineColor:Vt,dotShape:S3,dotSize:x3,opacity:1});this.pointsValues=t.pointsValues,this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="line"&&this.pointsValues===t.pointsValues}},OK=class extends q1{constructor(t){super();Be(this,"type","errorbar");Be(this,"pointsValues");Be(this,"interval");Be(this,"aes",{showDots:!0,width:"auto",lineWidth:1,fillColor:"none",lineColor:Vt,dotShape:S3,dotSize:x3,opacity:1});this.pointsValues=t.pointsValues,this.interval=t.interval,this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="errorbar"&&this.pointsValues===t.pointsValues&&this.interval===t.interval}},FK=class extends q1{constructor(t){super();Be(this,"type","bar");Be(this,"height");Be(this,"aes",{width:"auto",lineWidth:1,fillColor:"none",lineColor:Vt,opacity:1});this.height=t.height??"max",this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="bar"&&this.height===t.height}},QK=class extends q1{constructor(t){super();Be(this,"type","stackedBar");Be(this,"normalize",!1);Be(this,"aes",{width:"auto",lineWidth:1,fillColor:_9,lineColor:"none",opacity:1});this.normalize=t.normalize??!1,this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="stackedBar"&&t.normalize===this.normalize}},jK=class extends q1{constructor(t){super();Be(this,"type","logo");Be(this,"normalize",!1);Be(this,"aes",{width:"auto",fillColor:_9,lineColor:"none",opacity:1});this.normalize=t.normalize??!1,this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="logo"&&t.normalize===this.normalize}},UK=class extends q1{constructor(t){super();Be(this,"type","binnedDots");Be(this,"method");Be(this,"position");Be(this,"keyColumn");Be(this,"aes",{showOutliers:!0,width:"auto",lineWidth:1,fillColor:"none",lineColor:Vt,opacity:1});this.method=t.method??"dotdensity",this.position=t.position??"stack",this.keyColumn=t.keyColumn??null,this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){var n,r;return t.type==="binnedDots"&&this.method===t.method&&this.position===t.position&&((n=this.keyColumn)==null?void 0:n.value)===((r=t.keyColumn)==null?void 0:r.value)}},GK=class extends q1{constructor(t){super();Be(this,"type","pairedPoints");Be(this,"linkColumn");Be(this,"aes",{showOutliers:!0,lineWidth:1,lineColor:Vt,lineShape:"solid",dotFill:Vt,dotSize:x3,dotShape:S3,opacity:1});this.linkColumn=t.linkColumn,this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="pairedPoints"&&this.aes.showOutliers===t.aes.showOutliers&&this.linkColumn.value===t.linkColumn.value}},YK=class extends q1{constructor(t){super();Be(this,"type","sina");Be(this,"aes",{showOutliers:!0,width:"auto",dotFill:_9,dotSize:x3,dotShape:S3,opacity:1});this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="sina"&&this.aes.showOutliers===t.aes.showOutliers}},iS=class extends q1{constructor(t){var n,r,a;super();Be(this,"type","stat");Be(this,"statType");Be(this,"testMethod");Be(this,"paired");Be(this,"ns");Be(this,"format");Be(this,"referenceGroup",null);Be(this,"correctionMethod",null);Be(this,"significanceLevels");this.statType=t.statType,this.testMethod=t.testMethod,this.paired=t.paired??!1,this.ns=t.ns??!0,this.format=t.format??"pValue",this.statType==="referenceGroup"&&(this.referenceGroup=t.referenceGroup??null),(this.statType==="referenceGroup"||this.statType==="pairwise")&&(this.correctionMethod=t.correctionMethod??null),this.significanceLevels={one:((n=t.significanceLevels)==null?void 0:n.one)??.05,two:((r=t.significanceLevels)==null?void 0:r.two)??.01,three:((a=t.significanceLevels)==null?void 0:a.three)??.001}}isEqualForCalculation(t){return t.type==="stat"&&Object.keys(this).every(n=>this[n]===t[n])}},WK=class{constructor(e){Be(this,"id");Be(this,"type","discrete");Be(this,"y");Be(this,"keyColumn");Be(this,"primaryGrouping");Be(this,"secondaryGrouping");Be(this,"facetSettings");Be(this,"facetBy");Be(this,"chartSettings");Be(this,"layers");var t,n,r,a,i,o,s,c,f,A;N3t.parse(e),this.id=Zn.uniqueId("settings"),this.y=e.y,this.keyColumn=e.keyColumn??null,this.primaryGrouping=e.primaryGrouping??null,this.secondaryGrouping=e.secondaryGrouping??null,this.facetSettings={sharedX:!0,sharedY:!0,titlePosition:"left",...e.facetSettings},this.facetBy=e.facetBy??[],this.chartSettings={size:{width:((t=e==null?void 0:e.size)==null?void 0:t.width)??(this.facetBy.length?400:600),height:((n=e==null?void 0:e.size)==null?void 0:n.height)??(this.facetBy.length?250:350),outerOffset:((r=e==null?void 0:e.size)==null?void 0:r.outerOffset)??O4t,innerOffset:((a=e==null?void 0:e.size)==null?void 0:a.innerOffset)??N4t.TOP},title:{position:"center",show:!0,...e.title,name:((i=e.title)==null?void 0:i.name)??"Chart"},orientation:e.orientation??"vertical",yAxis:{title:((o=e.y)==null?void 0:o.label)??e.y.value??"",scale:"linear",showGrid:!0,showTicks:!0,hiddenLabels:!1,...e.yAxis},xAxis:{title:((c=(s=e.primaryGrouping)==null?void 0:s.columnName)==null?void 0:c.label)??((f=e.primaryGrouping)==null?void 0:f.columnName.value)??"",showGrid:!0,showTicks:!0,linesBetweenCategories:!0,labelsPosition:"center",hiddenLabels:!1,...e.xAxis},frame:{type:((A=e.frame)==null?void 0:A.type)??"full"},legend:{show:!0,position:"right",...e.legend},tooltips:{box:{show:!0},violin:{show:!0},boxOutliers:{show:!0},line:{show:!0},errorBar:{show:!0},dot:{show:!0},binnedDots:{show:!0},pairedPoints:{show:!0},stackedBar:{show:!0},logo:{show:!1},...e.tooltips}},this.layers=e.layers.map(h=>{if(h.type==="box")return new RK(h);if(h.type==="violin")return new VK(h);if(h.type==="dot")return new NK(h);if(h.type==="line")return new zK(h);if(h.type==="errorbar")return new OK(h);if(h.type==="bar")return new FK(h);if(h.type==="stackedBar")return new QK(h);if(h.type==="stat")return new iS(h);if(h.type==="binnedDots")return new UK(h);if(h.type==="pairedPoints")return new GK(h);if(h.type==="sina")return new YK(h);if(h.type==="logo")return new jK(h);d1(h,"Unknown layer type")}).filter(Boolean)}};function Uyt(e,t,n,r=!1){let a=e.map(t).sort((i,o)=>i-o);if(r){let i=Zn.find(a,o=>o>0);if(!i)throw Error("Group with all zeros in log scale");return a.map(o=>o===0?i:o).map(n)}return a.map(n)}var Gyt=class{constructor(e,t,n,r,a,i,o,s,c,f,A=!0){Be(this,"lower");Be(this,"middle");Be(this,"upper");Be(this,"min");Be(this,"max");Be(this,"outliers");Be(this,"primaryGrouping");Be(this,"secondaryGrouping");Be(this,"key");Be(this,"boundsY");if(e.length===0)throw Error("Unable to create box on empty data");if(o>s||o>c||s>c)throw Error(`Invalid box bounds values: lower=${o}, middle=${s}, upper=${c}`);if(f<0)throw Error(`Invalid box whiskers coefficient: k=${f}. It should be positive`);let h=$=>Number($[t]);this.primaryGrouping=String(a),this.secondaryGrouping=String(i),this.key=`box_${this.primaryGrouping}_${this.secondaryGrouping}`;let v=$=>r==="log"?Math.log10($):$,g=$=>r==="log"?Math.pow(10,$):$,C=Uyt(e,h,v,r==="log"),b=D0(C,o),B=D0(C,s),E=D0(C,c),k=E-b;this.upper=g(E),this.middle=g(B),this.lower=g(b),this.min=Math.max(xw(e,h),g(b-f*k)),this.max=Math.min(Vh(e,h),g(E+f*k)),this.outliers=e.filter($=>h($)<this.min||h($)>this.max).map(($,z)=>({y:h($),data:$,id:String(n?$[n]:z)}));let[P=1/0,I=-1/0]=H0(this.outliers,$=>$.y);this.boundsY={min:A?Math.min(this.min,P):this.min,max:A?Math.max(this.max,I):this.max}}};function Yyt(e,t,n,r,a,i){let o=1/0,s=-1/0;return{type:"box",geoms:t.facet.reduce((c,f)=>{let A=Md(f);return c[A]=[],t.primary.forEach(h=>{t.secondary.forEach(v=>{let g=n.getRowsByGrouping([...f,h,v]);if(!g.length)return;let C=new Gyt(g,r.value,(a==null?void 0:a.value)??null,i.scale,h,v,e.stat.lower,e.stat.medium,e.stat.upper,e.stat.k,e.aes.showOutliers);C.boundsY.min<o&&(o=C.boundsY.min),C.boundsY.max>s&&(s=C.boundsY.max),c[A].push(C)})}),c},{}),meta:{minY:o,maxY:s},aes:e.aes}}var XK=40;function Wyt(e,t){return function(n){return t.map(function(r){return[r,Vs(n,a=>e(r-a))]})}}function Xyt(e){return function(t){return 1/Math.sqrt(2*Math.PI)*Math.pow(Math.E,-.5*Math.pow(t/e,2))}}function Kyt(e){let t=Vs(e);return Vs(e.map(n=>Math.pow(n-t,2)))}function Zyt(e){return Math.sqrt(Kyt(e))}function Jyt(e,t,n){let r=(n-t)/1.34,a=Zyt(e);return 1.06*Math.min(a,r)*Math.pow(e.length,-1/5)}var qyt=class{constructor(e,t,n,r,a,i){Be(this,"getArea");Be(this,"getLine");Be(this,"maxDensity");Be(this,"primaryGrouping");Be(this,"secondaryGrouping");Be(this,"key");Be(this,"boundsY");Be(this,"quartiles");if(e.length===0)throw Error("Unable to calculate violin on empty data");if(r!=="auto"&&r<1)throw Error(`Unable to calculate violin with ${r} steps`);this.primaryGrouping=String(a),this.secondaryGrouping=String(i),this.key=`violin_${this.primaryGrouping}_${this.secondaryGrouping}`;let o=$=>t==="log"?Math.log10($):$,s=$=>t==="log"?Math.pow(10,$):$,c=e.filter($=>t==="log"&&Number($)===0?(console.warn("Value = 0 on chart with log scale, it was removed from calculation"),!1):!0).map(o).sort(($,z)=>$-z),f=c[0],A=c[c.length-1],h=A-f,v=D0(c,.25),g=D0(c,.5),C=D0(c,.75);this.quartiles={q1:s(v),q2:s(g),q3:s(C)};let b=Jyt(c,v,C),B=r!=="auto"?r:b/3>h/XK?XK:h/(b/3),E=n?f:f-3*b,k=n?A:A+3*b,P=Zr().domain([E,k]).ticks(B);this.boundsY={min:s(P[0]),max:s(P[P.length-1])};let I=Wyt(Xyt(b),P)(c).map(([$,z])=>[s($),z]);this.maxDensity=Vh(I,([,$])=>$),this.getArea=($,z,O,K)=>{let te=$==="vertical",le=K??this.maxDensity,G=Zr().domain([-le,le]).range([-O/2,O/2]);return te?XB().curve(C5).x0(Q=>G(Q[1])).x1(Q=>G(-Q[1])).y(Q=>z(Q[0]))(I):XB().curve(C5).y0(Q=>G(Q[1])).y1(Q=>G(-Q[1])).x(Q=>z(Q[0]))(I)},this.getLine=($,z,O,K)=>{let te=$==="vertical",le=K??this.maxDensity,G=Zr().domain([-le,le]).range([-O/2,O/2]);return b5().curve(C5).x(te?Q=>G(Q[1]):Q=>z(Q[0])).y(te?Q=>z(Q[0]):Q=>G(Q[1]))(I)+" "+b5().curve(C5).x(te?Q=>G(-Q[1]):Q=>z(Q[0])).y(te?Q=>z(Q[0]):Q=>G(-Q[1]))(I)}}};function e7t(e,t,n,r,a){let i=0,o=1/0,s=-1/0;return{type:"violin",geoms:t.facet.reduce((c,f)=>{let A=Md(f);return c[A]=[],t.primary.forEach(h=>{t.secondary.forEach(v=>{let g=n.getColumnByGrouping([...f,h,v],r.value);if(!g.length)return;let C=new qyt(g,a.scale,e.stat.trim,e.stat.stepsCount,h,v);C.maxDensity>i&&(i=C.maxDensity),C.boundsY.min<o&&(o=C.boundsY.min),C.boundsY.max>s&&(s=C.boundsY.max),c[A].push(C)})}),c},{}),meta:{maxDensity:i,minY:o,maxY:s},aes:e.aes}}var t7t=30;function n7t(e,t){return function(n){return t.map(function(r){return Vs(n,a=>e(r-a))})}}function r7t(e){return function(t){return 1/Math.sqrt(2*Math.PI)*Math.pow(Math.E,-.5*Math.pow(t/e,2))}}function a7t(e){let t=Vs(e);return Vs(e.map(n=>Math.pow(n-t,2)))}function i7t(e){return Math.sqrt(a7t(e))}function o7t(e){let t=D0(e,.25),n=(D0(e,.75)-t)/1.34,r=i7t(e);return 1.06*Math.min(r,n)*Math.pow(e.length,-1/5)}var l7t=class{constructor(e,t,n,r,a,i){Be(this,"key");Be(this,"maxDensity");Be(this,"primaryGrouping");Be(this,"secondaryGrouping");Be(this,"points");Be(this,"boundsY");let o=t7t;if(e.length===0)throw Error("Unable to calculate sina on empty data");this.primaryGrouping=String(r),this.secondaryGrouping=String(a),this.key=`sina_${this.primaryGrouping}_${this.secondaryGrouping}`;let s=P=>n==="log"?Math.log10(P):P,c=P=>n==="log"?Math.pow(10,P):P,f=P=>Number(P[t.value]),A=e.filter(P=>n==="log"&&f(P)===0?(console.warn("Value = 0 on chart with log scale, it was removed from calculation"),!1):!0).sort((P,I)=>s(f(P))-s(f(I))),h=A.map(P=>s(f(P))),v=h[0],g=h[A.length-1],C=(g-v)/o,b=o7t(h),B=Zn.range(v+C,g,C);this.boundsY={min:c(v),max:c(g)};let E=n7t(r7t(b),B)(h),k=Zr().domain(B).range(E).clamp(!0);this.maxDensity=Vh(E),this.points=A.map((P,I)=>({x:f(P),y:k(s(f(P)))/this.maxDensity,id:String(I),jitter:i(),data:P}))}};function s7t(e,t,n,r,a){let i=0,o=1/0,s=-1/0,c=yN(1);return{type:"sina",geoms:t.facet.reduce((f,A)=>{let h=Md(A);return f[h]=[],t.primary.forEach(v=>{t.secondary.forEach(g=>{let C=n.getRowsByGrouping([...A,v,g]);if(!C.length)return;let b=C;if(!e.aes.showOutliers){let E=I=>Number(I[r.value]),[k,P]=b3(C,a.scale,E);b=C.filter(I=>{let $=E(I);return $>=k&&$<=P})}let B=new l7t(b,r,a.scale,v,g,c);B.maxDensity>i&&(i=B.maxDensity),B.boundsY.min<o&&(o=B.boundsY.min),B.boundsY.max>s&&(s=B.boundsY.max),f[h].push(B)})}),f},{}),meta:{maxDensity:i,minY:o,maxY:s},aes:e.aes}}function u7t(e,t,n,r,a,i){let o=1/0,s=-1/0,c=yN(1);return{type:"dot",geoms:t.facet.reduce((f,A)=>{let h=Md(A);return f[h]=[],t.primary.forEach(v=>{t.secondary.forEach(g=>{let C=n.getRowsByGrouping([...A,v,g]);if(!C.length)return;let b=P=>Number(P[r.value]),B=C.map((P,I)=>({y:b(P),jitter:c(),id:String(i?P[i.value]:I),data:P}));if(!e.aes.showOutliers){let[P,I]=b3(C,a.scale,b);B=B.filter(({y:$})=>$>=P&&$<=I)}let[E=1/0,k=-1/0]=H0(B,P=>P.y);E<o&&(o=E),k>s&&(s=k),f[h].push({key:`dots_${String(v)}_${String(g)}`,values:B,primaryGrouping:String(v),secondaryGrouping:String(g),boundsY:{min:E,max:k}})})}),f},{}),meta:{minY:o,maxY:s},aes:e.aes}}function c7t(e,t){if(t==="median")return DI(e,.5);if(t==="mean")return Vs(e);d1(t,`Unknown line points calculation for dot layer: ${t}`)}function f7t(e,t,n,r,a){let i=1/0,o=-1/0;return{type:"line",geoms:t.facet.reduce((s,c)=>{let f=Md(c);s[f]=[];let A=-1/0,h=1/0;return e.aes.showOutliers||([A,h]=b3(n.getColumnByGrouping([...c],r.value),a.scale)),t.secondary.forEach(v=>{let g={key:`${String(v)}`,boundsY:{min:1/0,max:-1/0},dots:{}},C=!1,b=E=>a.scale==="log"?Math.log10(E):E,B=E=>a.scale==="log"?Math.pow(10,E):E;t.primary.forEach(E=>{let k=n.getColumnByGrouping([...c,E,v],r.value);if(!k.length){C=!0;return}let P=k;if(e.aes.showOutliers||(P=k.filter($=>$>=A&&$<=h)),!P.length){C=!0;return}let I=B(c7t(P.map(b),e.pointsValues));g.dots[String(E)]=I,I<i&&(i=I),I>o&&(o=I),I<g.boundsY.min&&(g.boundsY.min=I),I>g.boundsY.max&&(g.boundsY.max=I)}),C||s[f].push(g)}),s},{}),meta:{minY:i,maxY:o},aes:e.aes}}function d7t(e){let t=Vs(e);return Vs(e.map(n=>Math.pow(n-t,2)))}function LM(e){return Math.sqrt(d7t(e))}function A7t(e){return LM(e)/Math.sqrt(e.length)}function h7t(e){return 1.96*LM(e)}function p7t(e,t){if(t==="median")return DI(e,.5);if(t==="mean")return Vs(e);d1(t,"Unknown points calculation")}function v7t(e,t){if(t==="sd")return LM(e);if(t==="se")return A7t(e);if(t==="ci")return h7t(e);d1(t,"Unknown error interval calculation")}function m7t(e,t,n,r,a){let i=1/0,o=-1/0;return{type:"errorbar",geoms:t.facet.reduce((s,c)=>{let f=Md(c);s[f]=[];let A=v=>a.scale==="log"?Math.log10(v):v,h=v=>a.scale==="log"?Math.pow(10,v):v;return t.primary.forEach(v=>{t.secondary.forEach(g=>{let C=n.getColumnByGrouping([...c,v,g],r.value);if(!C.length)return;let b=C.map(A),B=h(p7t(b,e.pointsValues)),E=h(v7t(b,e.interval)),k=B-E,P=B+E;k<i&&(i=k),P>o&&(o=P),s[f].push({key:`errorbar_${String(v)}_${String(g)}`,primaryGrouping:String(v),secondaryGrouping:String(g),value:B,min:k,max:P,boundsY:{min:k,max:P}})})}),s},{}),meta:{minY:i,maxY:o},aes:e.aes}}function g7t(e,t,n,r){if(e.length===0)throw Error("Unable to create bar on empty data");let a=s=>t==="log"?Math.log10(s):s,i=s=>t==="log"?Math.pow(10,s):s,o=s=>{let c=Number(s[n]);if(t==="log"&&c<1)throw Error(`Value < 1 in log scale: ${c}`);return c};switch(r){case"max":return Vh(e,o)??o(e[0]);case"min":return xw(e,o)??o(e[0]);case"median":{let s=e.map(c=>Number(c[n])).map(a).sort((c,f)=>c-f);return i(D0(s,.5))}case"mean":return Vs(e,o)??o(e[0]);default:d1(r,`Unknown bar height function ${r}`)}}function y7t(e,t,n,r,a){let i=-1/0,o=1/0;return{type:"bar",geoms:t.facet.reduce((s,c)=>{let f=Md(c);return s[f]=[],t.primary.forEach(A=>{t.secondary.forEach(h=>{let v=n.getRowsByGrouping([...c,A,h]);if(!v.length)return;let g=g7t(v,a.scale,r.value,e.height);i=Math.max(i,g,0),o=Math.min(o,g,0),s[f].push({key:`bar_${String(A)}_${String(h)}`,value:g,primaryGrouping:A,secondaryGrouping:h,boundsY:{min:Math.min(0,g),max:Math.max(0,g)}})})}),s},{}),meta:{minY:o,maxY:i},aes:e.aes}}function w7t(e,t,n,r){let a=-1/0,i=1/0;return{type:"stackedBar",geoms:t.facet.reduce((o,s)=>{let c=Md(s);return o[c]=[],t.primary.forEach(f=>{let A=0,h={};t.secondary.forEach(C=>{let b=C===J1?"null":C,B=n.getRowsByGrouping([...s,f,C]);if(!B.length)return;let E=lc(B,k=>Number(k[r.value]));h[b]={height:E,key:String(b)},A+=E});let v=A;e.normalize&&t.secondary.forEach(C=>{let b=C===J1?"null":C;h[b]&&(h[b].height=h[b].height/v*100)}),a=Math.max(a,0,A),i=Math.min(i,0,A);let g=e.normalize?100:v;o[c].push({key:`stackedBar_${String(f)}`,valuesMap:h,primaryGrouping:f,boundsY:{min:Math.min(g,0),max:Math.max(g,0)}})}),o},{}),meta:{minY:e.normalize?0:i,maxY:e.normalize?100:a,normalize:e.normalize},aes:e.aes}}var KK=30;function b7t(e,t,n,r,a,i){let o=e.map(v=>n(a(v))),s=e.length,c=e.map(A),f=[];function A(v,g){return{key:i(v,g),value:a(v)}}let h=0;for(let v=1;v<s;++v){let g=o[h],C=o[v],b=o[v-1];if(C>=g+t){let B=Math.min((g+b)/2,C-t);o.fill(B,h,v),f.push({x:r(B),count:v-h,dots:c.slice(h,v)}),h=v}}return o.fill((o[h]+o[s-1])/2,h,s),f.push({x:r((o[h]+o[s-1])/2),count:s-h,dots:c.slice(h,s)}),f}var C7t=class{constructor(e,t,n,r,a,i,o,s,c,f){Be(this,"bins");Be(this,"primaryGrouping");Be(this,"secondaryGrouping");Be(this,"key");Be(this,"boundsY");this.primaryGrouping=String(n),this.secondaryGrouping=String(r),this.key=`binnedDots_${this.primaryGrouping}_${this.secondaryGrouping}`;let A=e.filter(h=>s(h)===0&&c==="log"?(console.warn(`Item with ${t} = 0 is not shown on chart with log scale`),!1):!0).sort((h,v)=>i(s(h))-i(s(v)));this.bins=b7t(A,a,i,o,s,(h,v)=>String(f?h[f.value]:v)),this.boundsY={min:this.bins[0].x,max:this.bins[this.bins.length-1].x}}};function S7t(e,t,n,r,a){let i=C=>a.scale==="log"?Math.log10(C):C,o=C=>a.scale==="log"?Math.pow(10,C):C,s=C=>Number(C[r.value]),c=1/0,f=-1/0,A=n.getRowsByGrouping([]),[h=s(A[0]),v=s(A[0])]=H0(A.filter(C=>Number(C[r.value])===0&&a.scale==="log"?(console.warn(`Item with ${r.value} = 0 is not shown on chart with log scale`),!1):!0),C=>Number(C[r.value])),g=Math.abs(i(h)-i(v))/KK;return{type:"binnedDots",geoms:t.facet.reduce((C,b)=>{let B=Md(b);return C[B]=[],t.primary.forEach(E=>{t.secondary.forEach(k=>{let P=n.getRowsByGrouping([...b,E,k]);if(!P.length)return;let I=P;if(!e.aes.showOutliers){let[z,O]=b3(P,a.scale,s);I=P.filter(K=>{let te=s(K);return te>=z&&te<=O})}let $=new C7t(I,r.value,E,k,g,i,o,s,a.scale,e.keyColumn);$.boundsY.min<c&&(c=$.boundsY.min),$.boundsY.max>f&&(f=$.boundsY.max),C[B].push($)})}),C},{}),meta:{minY:Math.min(h,v,c),maxY:Math.max(h,v,f),binsCount:KK,hasKeyFromColumn:e.keyColumn!==null},aes:e.aes}}function x7t(e,t){if(t.length===2)return"secondary";if(e.length===2&&t.length<2)return"primary";throw Error("Too many groups for paired points layer")}function ZK(e,t,n,r,a,i,o,s,c){let f=Zn.groupBy(n,P=>P[a.value]),A=Zn.groupBy(r,P=>P[a.value]),h=Object.keys(f),v=Object.keys(A);if(Zn.uniq(h).length!==h.length||Zn.uniq(v).length!==v.length)throw Error(`Non unique keys in groups ${String(e)}, ${String(t)} for paired points layer`);if(h.length!==v.length||Zn.intersection(h,v).length!==h.length)throw Error(`Keys in groups ${String(e)}, ${String(t)} not match for paired points layer`);let g=P=>Number(P[i.value]),C=1/0,b=-1/0,B=!1,E=c==="log",k=h.map(P=>{let I=f[P][0],$=A[P][0],z=g(I),O=g($);return(z===0||O===0)&&(B=!0),C=Math.min(C,E&&z===0?1/0:z,E&&O===0?1/0:O),b=Math.max(b,E&&z===0?-1/0:z,E&&O===0?-1/0:O),{id:P,key1:{id:`${P}_${String(e)}`,value:z,data:I},key2:{id:`${P}_${String(t)}`,value:O,data:$}}});if(!s){C=1/0,b=-1/0;let[P,I]=b3(n,c,g),[$,z]=b3(r,c,g);k=k.filter(({key1:O,key2:K})=>O.value<P||O.value>I||K.value<$||K.value>z?!1:(C=Math.min(C,E&&O.value===0?1/0:O.value,E&&K.value===0?1/0:K.value),b=Math.max(b,E&&O.value===0?-1/0:O.value,E&&K.value===0?-1/0:K.value),!0))}return C=B?C/10:C,b=Math.max(b,C),{id:`${String(e)}_${String(t)}`,key1:String(e),key2:String(t),pairs:k.map(P=>({...P,key1:{...P.key1,value:P.key1.value===0?C:P.key1.value},key2:{...P.key2,value:P.key2.value===0?C:P.key2.value}})),grouping:o,boundsY:{min:C,max:b}}}function E7t(e,t,n,r,a){let i=x7t(t.primary,t.secondary),o=1/0,s=-1/0;return{type:"pairedPoints",geoms:t.facet.reduce((c,f)=>{let A=Md(f);if(c[A]=[],i==="primary"){let[h,v]=t.primary,g=n.getRowsByGrouping([...f,h]),C=n.getRowsByGrouping([...f,v]),b=ZK(h,v,g,C,e.linkColumn,r,i,e.aes.showOutliers,a.scale);o=Math.min(o,b.boundsY.min),s=Math.max(s,b.boundsY.max),c[A].push(b)}else i==="secondary"&&t.primary.forEach(h=>{let[v,g]=t.secondary,C=n.getRowsByGrouping([...f,h,v]),b=n.getRowsByGrouping([...f,h,g]),B=ZK(v,g,C,b,e.linkColumn,r,i,e.aes.showOutliers,a.scale);o=Math.min(o,B.boundsY.min),s=Math.max(s,B.boundsY.max),c[A].push(B)});return c},{}),meta:{minY:o,maxY:s},aes:e.aes}}function B7t(e){let t=Math.abs(e),n=1/(1+t/2),r=n*Math.exp(-t*t-1.26551223+n*(1.00002368+n*(.37409196+n*(.09678418+n*(-.18628806+n*(.27886807+n*(-1.13520398+n*(1.48851587+n*(-.82215223+n*.17087277)))))))));return e>=0?r:2-r}function _7t(e){return .5*B7t(-e/Math.sqrt(2))}var T7t=class{constructor(e,t){this.value=e,this.position=t}getValue(){return this.value}getPosition(){return this.position}};function k7t(e){let t=new Array(e.length);for(let o=0;o<e.length;o++)t[o]=new T7t(e[o],o);let n=P7t(t);t.sort((o,s)=>o.getValue()-s.getValue());let r=new Array(t.length),a=1;r[t[0].getPosition()]=a;let i=[];i.push(t[0].getPosition());for(let o=1;o<t.length;o++)t[o].getValue()>t[o-1].getValue()&&(a=o+1,i.length>1&&JK(r,i),i=[]),i.push(t[o].getPosition()),r[t[o].getPosition()]=a;return i.length>1&&JK(r,i),M7t(r,n),r}function JK(e,t){let n=(2*e[t[0]]+t.length-1)/2;t.forEach(r=>{e[r]=n})}function M7t(e,t){t.forEach(n=>{e[n]=NaN})}function P7t(e){let t=[];for(let n=0;n<e.length;n++)isNaN(e[n].getValue())&&t.push(n);return t}var H7t=class{constructor(){Be(this,"SMALL_SAMPLE_SIZE",50)}mannWhitneyU(e,t){let n=[...e,...t],r=k7t(n),a=0;for(let s=0;s<e.length;s++)a+=r[s];let i=a-e.length*(e.length+1)/2,o=e.length*t.length-i;return Math.min(i,o)}mannWhitneyUTest(e,t,n){if(typeof n>"u")return e.length+t.length<=this.SMALL_SAMPLE_SIZE&&Object.keys(this.tiesMap(e,t)).length===0?this.mannWhitneyUTest(e,t,!0):this.mannWhitneyUTest(e,t,!1);let r=this.tiesMap(e,t),a=this.mannWhitneyU(e,t);if(n){if(Object.keys(r).length!==0)throw new Error;return this.exactP(e.length,t.length,a)}return this.approximateP(a,e.length,t.length,this.varU(e.length,t.length,r))}approximateP(e,t,n,r){let a=t*n/2;if(a==e)return 1;let i=-Math.abs(e-a+.5)/Math.sqrt(r);return 2*_7t(i)}exactP(e,t,n){let r=t*e;if(n>r)return 1;let a=n<r/2?n:r/2-n,i=0,o=0;for(;o<=a;)i+=this.uDensity(e,t,o),o++;return 2*i}uDensity(e,t,n){if(n<0||n>t*e)return 0;let r=this.uFrequencies(e,t);return r[Math.round(n+1)]/Zn.sum(r)}uFrequencies(e,t){let n=Math.max(t,e);if(n>100)throw Error("n or m > 100");let r=Math.min(t,e),a=new Array(e*t+2),i=new Array(e*t+2);for(let s=1;s<a.length;s++)a[s]=s<=n+1?1:0;i[1]=0;let o=n;for(let s=2;s<=r;s++){i[s]=0,o=o+n;let c=o+2,f=1+o/2,A=s;for(let h=1;h<=f;h++){A++,c=c-1;let v=a[h]+i[h];a[h]=v,i[A]=v-a[c],a[c]=v}}return a}varU(e,t,n){let r=e*t;if(Object.keys(n).length===0)return r*(e+t+1)/12;let a=Zn.sum(Object.values(n).map(o=>o*o*o-o)),i=e+t;return r/12*(i+1-a/(i*(i-1)))}tiesMap(e,t){let n={};for(let r=0;r<e.length;r++)n[e[r]]=n[e[r]]?n[e[r]]+1:1;for(let r=0;r<t.length;r++)n[t[r]]=n[t[r]]?n[t[r]]+1:1;for(let r in n)n[r]===1&&delete n[r];return n}};function RM(e,t,n){switch(t){case"ttest":{if(e.length>2)throw new Error("more than 2 datasets passed");if(n){if(e[0].length!==e[1].length)throw Error("Different size groups in paired test");return slt(e[0],e[1]).pValue}let r=Blt(e[0],e[1]).pValue;return isNaN(r)?1:r}case"anova":{let r=AGe(Zn.flatten(e),Zn.flatten(e.map((a,i)=>a.map(()=>String(i))))).pValue;return isNaN(r)?1:r}case"wilcoxon":{if(e.length>2)throw new Error("more than 2 datasets passed");if(n){if(e[0].length!==e[1].length)throw Error("Different size groups in paired test");return Edt(e[0],e[1]).pValue}let r=new H7t().mannWhitneyUTest(e[0],e[1]);return isNaN(r)?1:r}case"kruskalWallis":{let r=Wct(...e).pValue;return isNaN(r)?1:r}default:throw new Error("Unknown test method")}}function qK(e,t){let n;if(e==t){n=new Array(t+1);for(let r=0;r<n.length;++r)n[r]=r+1}else if(e<t){n=new Array(t-e+1);for(let r=0;r<n.length;++r)n[r]=e+r}else{n=new Array(e-t+1);for(let r=0;r<n.length;++r)n[r]=e-r}return n}function E3(e,t){return Zn.orderBy(e.map((n,r)=>[n,r]),([n])=>n,[t?"desc":"asc"]).map(([,n])=>n)}function D7t(e){if(e.length<1)throw new Error("cummin requires at least one element");let t=new Array(e.length),n=e[0];for(let r=0;r<e.length;++r)e[r]<n&&(n=e[r]),t[r]=n;return t}function $7t(e){if(e.length<1)throw new Error("cummax requires at least one element");let t=new Array(e.length),n=e[0];for(let r=0;r<e.length;++r)e[r]>n&&(n=e[r]),t[r]=n;return t}function eZ(e,t){if(e.length<1)throw new Error("pmin requires at least one element");return e.map(n=>Math.min(n,t))}function I7t(e){if(e.length<1)throw new Error("pAdjust requires at least one element");return Math.min(...e)}function L7t(e){let t=e.length;if(t<1)throw new Error("pAdjust requires at least one element");let n=new Array(t);for(let r=0;r<t;++r){let a=e[r]*t;if(a>=1)n[r]=1;else if(0<=a)n[r]=a;else throw new Error(`${a} is outside [0, 1)`)}return n}function R7t(e){let t=e.length;if(t<1)throw new Error("pAdjust requires at least one element");let n=E3(e,!1),r=n.slice(),a=new Array(t).fill(0);for(let f=0;f<t;++f)a[f]=(t-f)*e[n[f]];let i=E3(r,!1),o=$7t(a),s=eZ(o,1),c=new Array(t);for(let f=0;f<t;++f)c[f]=s[i[f]];return c}function V7t(e){let t=e.length;if(t<1)throw new Error("pAdjust requires at least one element");let n=qK(t,t),r=E3(e,!1),a=new Array(t);for(let h=0;h<t;++h)a[h]=e[r[h]];let i=r.slice(),o=E3(i,!1),s=new Array(t),c=new Array(t),f=new Array(t);for(let h=0;h<t;++h)f[h]=a[h]*t/n[h];let A=I7t(f);s.fill(A),c.fill(A);for(let h=t;h>=2;--h){let v=qK(1,t-h+1);for(let B=0;B<t-h+1;++B)v[B]--;let g=h-1,C=new Array(g);for(let B=0;B<g;++B)C[B]=t-h+2+B-1;let b=h*a[C[0]]/2;for(let B=1;B<g;++B){let E=a[C[B]]*h/(2+B);E<b&&(b=E)}for(let B=0;B<t-h+1;++B)s[v[B]]=Math.min(a[v[B]]*h,b);for(let B=0;B<g;++B)s[C[B]]=s[t-h];for(let B=0;B<t;++B)c[B]<s[B]&&(c[B]=s[B])}for(let h=0;h<t;++h)s[h]=c[o[h]];return s}var N7t=class{constructor(e,t,n){this.ni=e,this.o=t,this.ro=n}result(e){let t=D7t(e),n=eZ(t,1),r=new Array(e.length);for(let a=0;a<e.length;++a)r[a]=n[this.ro[a]];return r}};function VM(e){let t=e.length,n=new Array(t),r=E3(e,!0);for(let i=0;i<t;++i){if(e[i]<0||e[i]>1)throw new Error("array["+i+"] = "+e[i]+" is outside [0, 1]");n[i]=t/(t-i)}let a=E3(r,!1);return new N7t(n,r,a)}function z7t(e){let t=e.length;if(t<1)throw new Error("pAdjust requires at least one element");let n=VM(e),r=new Array(t);for(let a=0;a<t;++a)r[a]=n.ni[a]*e[n.o[a]];return n.result(r)}function O7t(e){let t=e.length;if(t<1)throw new Error("pAdjust requires at least one element");let n=VM(e),r=new Array(t),a=0;for(let i=1;i<t+1;++i)a+=1/i;for(let i=0;i<t;++i)r[i]=a*n.ni[i]*e[n.o[i]];return n.result(r)}function F7t(e){let t=e.length;if(t<1)throw new Error("pAdjust requires at least one element");let n=VM(e),r=new Array(t);for(let a=0;a<t;++a)r[a]=(a+1)*e[n.o[a]];return n.result(r)}function tZ(e,t){switch(t){case"BenjaminiHochberg":return z7t(e);case"BenjaminiYekutieli":return O7t(e);case"Bonferroni":return L7t(e);case"Hochberg":return F7t(e);case"Holm":return R7t(e);case"Hommel":return V7t(e);case null:return e;default:throw new Error(`Unknown p-value correction method: ${t}`)}}function Q7t(e){return e.slice(0,-1).reduce((t,n,r)=>t.concat(e.slice(r+1).map(a=>[n,a])),[])}function j7t(e,t,n,r,a){return{type:"stats",values:t.reduce((i,o)=>{let s=[];switch(e.statType){case"overall":{let c=n.map(A=>a.getColumnByGrouping([...o,A],r.value)).filter(A=>A.length>0);if(c.length<2)break;let f=RM(c,e.testMethod,e.paired);s=[[["overall"],f]];break}case"referenceGroup":{let c=e.referenceGroup===null?J1:String(e.referenceGroup);if(c!==J1&&!n.includes(c))throw new Error(`Reference group ${String(c)} for ${e.testMethod} test is not in available groups`);let f=a.getColumnByGrouping([...o,c],r.value);if(f.length===0){s=[];break}let A=n.filter(v=>v!==c).map(v=>[v,a.getColumnByGrouping([...o,v],r.value)]).filter(([,v])=>v.length>0);if(A.length<2&&e.correctionMethod!==null)break;let h=tZ(A.map(([,v])=>RM([f,v],e.testMethod,e.paired)),e.correctionMethod);s=A.map(([v],g)=>[[v],h[g]]);break}case"pairwise":{let c=Q7t(n).map(([A,h])=>[[A,h],[a.getColumnByGrouping([...o,A],r.value),a.getColumnByGrouping([...o,h],r.value)]]).filter(([,[A,h]])=>A.length&&h.length);if(c.length<1)break;let f=tZ(c.map(([,A])=>RM(A,e.testMethod,e.paired)),e.correctionMethod);s=c.map(([A],h)=>[A,f[h]]);break}default:throw new Error("Unknown statType")}return i[Md(o)]=s,i},{}),meta:{statType:e.statType,testMethod:e.testMethod,format:e.format,ns:e.ns,significanceLevels:e.significanceLevels}}}function nZ(e,t,n=null){let r=t.value,a=e.getColumnCategories(r);return Zn.intersection(n??a,a).map(String)}function rZ(e){if(!e.length)return[];let t=[[]];return e.forEach(n=>{let r=[];n.forEach(a=>{r.push(...t.map(i=>[...i,a]))}),t=r}),t}function oS(e,t){if(!t)return{keys:["null"],value:null,label:"",valueLabels:{null:""},inheritedAes:null};let n=t.columnName.value,r=Zn.uniqBy(e.rows,c=>c[n]),a=c=>String(c[n]),i=c=>t.columnName.valueLabels?String(c[t.columnName.valueLabels]):a(c),o=e.getColumnCategories(n,!t.allowNullGroup),s=(t.order??o).map(String);return{keys:Zn.intersection(s,o),value:n,label:t.columnName.label??n,valueLabels:r.reduce((c,f)=>(c[a(f)]=i(f),c),{}),inheritedAes:t.inheritedAes??null}}var U7t=class extends zm{constructor(t,n,r){super(t,n);Be(this,"settings");Be(this,"chartRenderer",new jyt);Be(this,"onTooltipHintSwitch",()=>{});Be(this,"calculatedData",null);this.settings=new WK(n),r&&(this.onTooltipHintSwitch=r[0])}mount(t){this.chartRenderer.init(t),this._updateData(),this._updateChart()}unmount(){this.chartRenderer.clear()}updateSettingsAndData(t,n){let r=this.settings,a=this.data;this.settings=new WK(n),this.data=t,this._needUpdateCalculatedDataBySettings(r,this.settings)||this._needUpdateCalculatedDataByData(a,this.data)?this._updateData():this._updateAesInData(),this._updateChart()}updateChartState(t,n){console.warn("no chart state for discrete")}export(){return this._updateChart(),w5(this.chartRenderer.component)}_needUpdateCalculatedDataBySettings(t,n){var r,a,i,o,s,c,f,A;return t.chartSettings.yAxis.scale!==n.chartSettings.yAxis.scale||(((r=t.primaryGrouping)==null?void 0:r.columnName.value)??"")!==(((a=n.primaryGrouping)==null?void 0:a.columnName.value)??"")||(((i=t.secondaryGrouping)==null?void 0:i.columnName.value)??"")!==(((o=n.secondaryGrouping)==null?void 0:o.columnName.value)??"")||(((s=t.primaryGrouping)==null?void 0:s.allowNullGroup)??"")!==(((c=n.primaryGrouping)==null?void 0:c.allowNullGroup)??"")||(((f=t.secondaryGrouping)==null?void 0:f.allowNullGroup)??"")!==(((A=n.secondaryGrouping)==null?void 0:A.allowNullGroup)??"")||t.facetBy.some((h,v)=>{var g;return h.value!==((g=n.facetBy[v])==null?void 0:g.value)})||t.layers.length!==n.layers.length||t.layers.some((h,v)=>!h.isEqualForCalculation(n.layers[v]))}_needUpdateCalculatedDataByData(t,n){let r=Object.keys(t.data),a=Object.keys(n.data);return t.id!==n.id||r.length!==a.length||r.some(i=>{var o;return t.data[i].length!==((o=n.data[i])==null?void 0:o.length)})}_updateData(){let{chartSettings:t,y:n,keyColumn:r,facetBy:a,layers:i,facetSettings:o}=this.settings,{yAxis:s}=t,c=this.data.rows.every(E=>{let k=E[n.value];return k===null||!(Number(k)<0)}),f=oS(this.data,this.settings.primaryGrouping),A=oS(this.data,this.settings.secondaryGrouping),h=a.map(E=>E.value),v=a.length?rZ(a.map(E=>{var k;return nZ(this.data,E,(k=o==null?void 0:o.order)==null?void 0:k[E.value])})):[[J1]];this.data.setGrouping([...h,f.value,A.value]);let g={facet:v,primary:f.value!==null?f.keys:[J1],secondary:A.value!==null?A.keys:[J1]},C=g.facet.reduce((E,k)=>(E[Md(k)]=g.primary.filter(P=>this.data.getRowsByGrouping([...k,P]).length>0).map(String),E),{}),b=i.filter(E=>!(E instanceof iS)).map(E=>{if(E instanceof RK)return Yyt(E,g,this.data,n,r,s);if(E instanceof VK)return e7t(E,g,this.data,n,s);if(E instanceof NK)return u7t(E,g,this.data,n,s,r);if(E instanceof zK)return f7t(E,g,this.data,n,s);if(E instanceof OK)return m7t(E,g,this.data,n,s);if(E instanceof FK)return y7t(E,g,this.data,n,s);if(E instanceof QK)return w7t(E,g,this.data,n);if(E instanceof UK)return S7t(E,g,this.data,n,s);if(E instanceof GK)return E7t(E,g,this.data,n,s);if(E instanceof YK)return s7t(E,g,this.data,n,s);if(E instanceof jK)return V4t(E,g,this.data,n);throw new Error("Unknown layer type")}),B=i.filter(E=>E instanceof iS).map(E=>{if(f.value===null)throw new Error("Cannot calculate p-value without data grouping");return j7t(E,g.facet,g.primary,n,this.data)});this.calculatedData={layersData:b,statsLayersData:B,primaryGrouping:f,secondaryGrouping:A,facetKeyLists:v,nonEmptyGroupsByFacets:C,onlyPositive:c}}_updateAesInData(){if(this.calculatedData===null)return;let{layers:t,facetBy:n,primaryGrouping:r,secondaryGrouping:a,facetSettings:i}=this.settings,o=t.filter(s=>!(s instanceof iS));for(let s=0;s<o.length;s++){let c=o[s];"aes"in c&&(this.calculatedData.layersData[s].aes=c.aes)}this.calculatedData.primaryGrouping=oS(this.data,r),this.calculatedData.secondaryGrouping=oS(this.data,a),this.calculatedData.facetKeyLists=n.length?rZ(n.map(s=>{var c;return nZ(this.data,s,(c=i==null?void 0:i.order)==null?void 0:c[s.value])})):[[J1]]}_updateChart(){if(!this.calculatedData)return;let{id:t,chartSettings:n,keyColumn:r,facetSettings:a}=this.settings,i=this.calculatedData.facetKeyLists.map(Md),o=this.calculatedData.facetKeyLists.map(s=>s.map(c=>c===J1?"null":c));this.chartRenderer.render(t,n,this.calculatedData.primaryGrouping,this.calculatedData.secondaryGrouping,a,i,o,this.calculatedData.layersData,this.calculatedData.statsLayersData,r,this.calculatedData.nonEmptyGroupsByFacets,this.calculatedData.onlyPositive,this.onTooltipHintSwitch)}},G7t=1e6;function Y7t(e){let t=_I(e),n=Vs(e);return t===void 0||n===void 0||t===0?r=>r:r=>(r-n)/t}function W7t(e){let t=Vs(e),[n,r]=H0(e);return t===void 0||n===void 0||r===void 0||r===n?a=>a:a=>(a-t)/(r-n)}function X7t(e,t){return e==="standardScaling"?Y7t(t):e==="meanNormalization"?W7t(t):n=>n}function NM(e){if(!e.length)return[];let t=[[]];return e.forEach(n=>{let r=[];n.forEach(a=>{r.push(...t.map(i=>[...i,a]))}),t=r}),t}function K7t(e,t,n,r,a,i,o,s,c,f,A,h){let v=a.length?a.map(Y=>e.getColumnCategories(Y.value)):[["null"]],g=i.length?i.map(Y=>e.getColumnCategories(Y.value)):[["null"]],C=o.length?o.map(Y=>e.getColumnCategories(Y.value)):[["null"]],b=NM(v),B=NM(g),E=NM(C),k=b.map(Y=>Y.join("_")),P=B.map(Y=>Y.join("_")),I=E.map(Y=>Y.join("_")),$={meta:{facetKeys:k,xGroupKeys:P,yGroupKeys:I,xKeysByGroups:{},yKeysByGroups:{},xLabels:{},yLabels:{},xGroupLabels:{},yGroupLabels:{},xDataByKeys:{},yDataByKeys:{},facetKeyValues:k.reduce((Y,X,ee)=>(Y[X]=b[ee],Y),{}),xGroupKeyValues:P.reduce((Y,X,ee)=>(Y[X]=B[ee],Y),{}),yGroupKeyValues:I.reduce((Y,X,ee)=>(Y[X]=E[ee],Y),{}),valueExtent:[1/0,-1/0]},facets:{}},z=t.valueLabels??t.value,O=n.valueLabels??n.value,K=s.filter(Y=>Y.axis==="x").map(Y=>Y.valueColumn.value),te=s.filter(Y=>Y.axis==="y").map(Y=>Y.valueColumn.value),le=Object.values(c??{}).map(Y=>Y.value),G=Object.values(f??{}).map(Y=>Y.value),Q=Zn.uniq([...K,...le,z]),j=Zn.uniq([...te,...G,O]);if(e.rows.forEach(Y=>{let X=a.length?a.map(De=>Y[De.value]).join("_"):"null",ee=i.length?i.map(De=>Y[De.value]).join("_"):"null",pe=o.length?o.map(De=>Y[De.value]).join("_"):"null",ae=i.length?i.map(De=>Y[De.valueLabels??De.value]).join(", "):"",ge=o.length?o.map(De=>Y[De.valueLabels??De.value]).join(", "):"";$.meta.xGroupLabels[ee]=ae,$.meta.yGroupLabels[ee]=ge;let me=Y[t.value],fe=Y[n.value],Ce=Y[r.value]??h;if(!(me===null||fe===null||Ce===null)){if($.facets[X]||($.facets[X]={xKeys:[],yKeys:[],xKeysByGroups:{},yKeysByGroups:{},cells:{}}),$.facets[X].xKeysByGroups[ee]||($.facets[X].xKeysByGroups[ee]=[]),$.facets[X].yKeysByGroups[pe]||($.facets[X].yKeysByGroups[pe]=[]),$.facets[X].xKeys.push(me),$.facets[X].yKeys.push(fe),$.facets[X].xKeysByGroups[ee].push(me),$.facets[X].yKeysByGroups[pe].push(fe),$.facets[X].cells[me]||($.facets[X].cells[me]={}),$.meta.valueExtent[0]=Math.min(Ce,$.meta.valueExtent[0]),$.meta.valueExtent[1]=Math.max(Ce,$.meta.valueExtent[1]),$.facets[X].cells[me][fe])throw Error(`More than 1 value for x=${me}, y=${fe}`);if($.meta.xLabels[me]&&String(Y[z])!==$.meta.xLabels[me])throw Error(`More than 1 x-label value for x=${me}`);if($.meta.yLabels[fe]&&String(Y[O])!==$.meta.yLabels[fe])throw Error(`More than 1 y-label value for y=${fe}`);$.meta.xLabels[me]=String(Y[z]),$.meta.yLabels[fe]=String(Y[O]),Q.forEach(De=>{let ke=typeof $.meta.xDataByKeys[De]<"u",$e=ke&&typeof $.meta.xDataByKeys[De][me]<"u";if(ke||($.meta.xDataByKeys[De]={}),$e&&$.meta.xDataByKeys[De][me]!==Y[De])throw Error(`More than 1 value for x = ${me} and column = ${De}`);$e||($.meta.xDataByKeys[De][me]=Y[De])}),j.forEach(De=>{let ke=typeof $.meta.yDataByKeys[De]<"u",$e=ke&&typeof $.meta.yDataByKeys[De][fe]<"u";if(ke||($.meta.yDataByKeys[De]={}),$e&&$.meta.yDataByKeys[De][fe]!==Y[De])throw Error(`More than 1 value for y = ${fe} and column = ${De}`);$e||($.meta.yDataByKeys[De][fe]=Y[De])}),$.facets[X].cells[me][fe]={id:`${me}_${fe}`,x:me,y:fe,value:Ce,normalizedValue:Ce,data:Y}}}),$.meta.facetKeys=$.meta.facetKeys.filter(Y=>$.facets[Y]),$.meta.facetKeys.forEach(Y=>{let X=$.facets[Y];if(X.xKeys=Zn.uniq(X.xKeys),X.yKeys=Zn.uniq(X.yKeys),X.xKeys.length*X.yKeys.length>G7t)throw Error(`Too many cells for graph rendering (${X.xKeys.length*X.yKeys.length})`);P.forEach(ee=>{$.facets[Y].xKeysByGroups[ee]=Zn.uniq($.facets[Y].xKeysByGroups[ee])}),I.forEach(ee=>{$.facets[Y].yKeysByGroups[ee]=Zn.uniq($.facets[Y].yKeysByGroups[ee])})}),A){let Y=[1/0,-1/0];$.meta.facetKeys.forEach(X=>{let{xKeys:ee,yKeys:pe,cells:ae}=$.facets[X],ge=A.direction==="row"?ee:pe,me=A.direction==="row"?pe:ee,fe=A.direction==="row"?(Ce,De)=>{var ke;return(ke=ae[Ce])==null?void 0:ke[De]}:(Ce,De)=>{var ke;return(ke=ae[De])==null?void 0:ke[Ce]};me.forEach(Ce=>{let De=[];ge.forEach($e=>{var Oe;let je=(Oe=fe($e,Ce))==null?void 0:Oe.value;je!==void 0&&De.push(je)});let ke=X7t(A.method,De);ge.forEach($e=>{let je=fe($e,Ce);je!==void 0&&(je.normalizedValue=ke(je.value),Y[0]=Math.min(je.normalizedValue,Y[0]),Y[1]=Math.max(je.normalizedValue,Y[1]))})})}),$.meta.valueExtent=Y}return $.meta.xKeysByGroups=P.reduce((Y,X)=>(Y[X]=Zn.uniq(Zn.flatten($.meta.facetKeys.map(ee=>$.facets[ee].xKeysByGroups[X]))),Y),{}),$.meta.yKeysByGroups=I.reduce((Y,X)=>(Y[X]=Zn.uniq(Zn.flatten($.meta.facetKeys.map(ee=>$.facets[ee].yKeysByGroups[X]))),Y),{}),$.meta.valueExtent[0]===1/0&&($.meta.valueExtent[0]=0),$.meta.valueExtent[1]===-1/0&&($.meta.valueExtent[1]=0),$}function aZ(e,t){let n=0;for(let r=0;r<e.length;r++)n+=(e[r]-t[r])*(e[r]-t[r]);return n}function iZ(e,t){return Math.sqrt(aZ(e,t))}var oZ=(e,t,n)=>{let r=0;for(let a of e)for(let i of t)r+=n[a][i];return r/e.length/t.length},Z7t=(e,t,n)=>{let r=0;for(let a of e)for(let i of t)r=Math.max(r,n[a][i]);return r},J7t=(e,t,n)=>{let r=1/0;for(let a of e)for(let i of t)r=Math.min(r,n[a][i]);return r};function q7t(e){switch(e){case"average":return oZ;case"complete":return Z7t;case"single":return J7t;default:return oZ}}function e9t(e){switch(e){case"euclidean":return iZ;case"squaredEuclidean":return aZ;default:return iZ}}function lZ(e=[],t,n="euclidean",r="average"){let a=e9t(n),i=q7t(r),o=t.map(c=>t.map(f=>a(c,f))),s=e.map((c,f)=>({height:0,keys:[c],indexes:[f],children:[]}));for(let c=0;c<e.length&&!(c>=e.length-1);c++){let f=1/0,A=0,h=0;for(let g=0;g<s.length;g++)for(let C=g+1;C<s.length;C++){let b=i(s[g].indexes,s[C].indexes,o);b<f&&(f=b,A=g,h=C)}let v={keys:[...s[A].keys,...s[h].keys],indexes:[...s[A].indexes,...s[h].indexes],height:f,children:[s[A],s[h]]};s.splice(Math.max(A,h),1),s.splice(Math.min(A,h),1),s.push(v)}return s[0]}function t9t(e,t,n,r){let{facetKeys:a,xGroupKeys:i,yGroupKeys:o}=e.meta,s={};if(t&&r.sharedX)throw Error("Dendrogram on X axis is not available with shared by facets X axis");return a.forEach(c=>{let f={hierarchyX:[],hierarchyY:[]},A=e.facets[c];if(t){let h=[],v=[];i.forEach(g=>{let C=A.xKeysByGroups[g],b=A.yKeys,B=lZ(C,C.map(E=>b.map(k=>{var P;return((P=A.cells[E][k])==null?void 0:P.normalizedValue)??t.fillNA})),t.distance,t.linkage);e.facets[c].xKeysByGroups[g]=B.keys,v.push(...B.keys),h.push(B)}),e.facets[c].xKeys=v,f.hierarchyX=h.map(g=>_8(g))}if(n){let h=[],v=[];o.forEach(g=>{let C=A.yKeysByGroups[g],b=A.xKeys,B=lZ(C,C.map(E=>b.map(k=>{var P;return((P=A.cells[k][E])==null?void 0:P.normalizedValue)??n.fillNA})),n.distance,n.linkage);e.facets[c].yKeysByGroups[g]=B.keys,v.push(...B.keys),h.push(B)}),e.facets[c].yKeys=v,f.hierarchyY=h.map(g=>_8(g))}s[c]=f}),s}var n9t=15,Zv=8,Jv=30,r9t=48,a9t=24,B3=16,_3=4,lS=4,zM=20,i9t=16,Wc=16,T3=8,Ap={left:["annotations","axis","groups","axisTitle","dendro"],right:["annotations","axis","groups","axisTitle","dendro"],top:["annotations","axis","groups","axisTitle","dendro","facetTitle"],bottom:["annotations","axis","groups","axisTitle","dendro"]},sZ={fillColor:"white",lineColor:Vt,lineWidth:1,lineShape:"solid",dotSize:3,dotFill:Vt,dotShape:"21"};function o9t(e,t,n,r,a,i,o,s,c,f,A,h,v,g){let C=h.length>1&&(!c||o.includes(t.groupingPosition)),b=!c||o.includes(t.position),B=A.length>1&&(!s||o.includes(e.groupingPosition)),E=!s||o.includes(e.position),k=f.length>1,P=r.filter(ee=>o.includes(ee.position)||!s&&["left","right"].includes(ee.position)||!c&&["top","bottom"].includes(ee.position)),I=P.filter(ee=>ee.position==="left").length,$=P.filter(ee=>ee.position==="right").length,z=P.filter(ee=>ee.position==="top").length,O=P.filter(ee=>ee.position==="bottom").length,K=e.showTicks?lS:0,te=t.showTicks?lS:0,le=E&&e.showTitle?Jv:0,G=b&&t.showTitle?Jv:0,Q=E&&e.showAxisLabels&&v>B3?n.xAxisCaptions+K+_3:0,j=b&&t.showAxisLabels&&g>B3?n.yAxisCaptions+te+_3:0,Y=B&&e.showGroupLabels?n.xGroupCaptions:0,X=C&&t.showGroupLabels?n.yGroupCaptions:0;return{left:{dendro:!(i!=null&&i.hidden)&&(i==null?void 0:i.position)==="left"?i.size:0,axisTitle:t.position==="left"?G:0,groups:t.groupingPosition==="left"?X:0,axis:t.position==="left"?j:0,annotations:I*Wc+(I&&T3)},right:{dendro:!(i!=null&&i.hidden)&&(i==null?void 0:i.position)==="right"?i.size:0,axisTitle:t.position==="right"?G:0,groups:t.groupingPosition==="right"?X:0,axis:t.position==="right"?j:0,annotations:$*Wc+($&&T3)},top:{facetTitle:k?r9t:0,dendro:!(a!=null&&a.hidden)&&(a==null?void 0:a.position)==="top"?a.size:0,axisTitle:e.position==="top"?le:0,groups:e.groupingPosition==="top"?Y:0,axis:e.position==="top"?Q:0,annotations:z*Wc+(z&&T3)},bottom:{dendro:!(a!=null&&a.hidden)&&(a==null?void 0:a.position)==="bottom"?a.size:0,axisTitle:e.position==="bottom"?le:0,groups:e.groupingPosition==="bottom"?Y:0,axis:e.position==="bottom"?Q:0,annotations:O*Wc+(O&&T3)}}}function l9t(e,t,n){return{left:Ap.left.reduce((r,a,i)=>{let o=i>0?Ap.left[i-1]:null,s=e.left[a];return r[a]={x:o?r[o].x-s:-s,y:0,width:s,height:n,isVisible:s>0},r},{}),right:Ap.right.reduce((r,a,i)=>{let o=i>0?Ap.right[i-1]:null,s=e.right[a];return r[a]={x:o?r[o].x+r[o].width:t,y:0,width:s,height:n,isVisible:s>0},r},{}),top:Ap.top.reduce((r,a,i)=>{let o=i>0?Ap.top[i-1]:null,s=e.top[a];return r[a]={x:0,y:o?r[o].y-s:-s,width:t,height:s,isVisible:s>0},r},{}),bottom:Ap.bottom.reduce((r,a,i)=>{let o=i>0?Ap.bottom[i-1]:null,s=e.bottom[a];return r[a]={x:0,y:o?r[o].y+r[o].height:n,width:t,height:s,isVisible:s>0},r},{})}}function OM(e,t,n){let r=(t-e)/n,a=Zn.range(e,t-r/2,r);return a.push(t),a}function uZ(e,t){let n=OM(0,1,e.length-1),r=Zr().domain(n).range(e),a=OM(0,1,t.length-1).map(i=>r(i));return Qo().domain(t).range(a).unknown("#ccc")}function s9t(e,t,n,r,a,i){let o=OM(0,1,e.length-1),s=Zr().domain(o).range(e),c=[r,...o.filter(b=>b>r&&b<a),a],f=[a,...o.filter(b=>b>a&&b<i),i],A=(n-t)/2,h=c.map(b=>t+A*(b-r)/(a-r)),v=f.map(b=>(t+n)/2+A*(b-a)/(i-a)),g=c.map(b=>s(b)),C=f.map(b=>s(b));return Zr().domain(h.concat(v.slice(1))).range(g.concat(C.slice(1)))}var u9t=new hc("bold 14px Arial");function sS(e){let t=0;for(let n of e){let r=u9t.getTextWidth(n);r>t&&(t=r)}return t}function c9t(e,t,n,r){let a=e.filter(f=>f.showTitle&&(t.includes(f.position)||!n&&["left","right"].includes(f.position)||!r&&["top","bottom"].includes(f.position))),i=a.filter(f=>f.titlePosition==="left").map(f=>f.valueColumn.label??f.valueColumn.value),o=a.filter(f=>f.titlePosition==="right").map(f=>f.valueColumn.label??f.valueColumn.value),s=a.filter(f=>f.titlePosition==="top").map(f=>f.valueColumn.label??f.valueColumn.value),c=a.filter(f=>f.titlePosition==="bottom").map(f=>f.valueColumn.label??f.valueColumn.value);return{left:sS(i),right:sS(o),top:sS(s),bottom:sS(c)}}function f9t(e,t,n,r,a){let{facetKeys:i,xGroupKeys:o,yGroupKeys:s,xKeysByGroups:c,yKeysByGroups:f,xLabels:A,yLabels:h}=r.meta,v=e.xGroupLabels/180*Math.PI,g=e.yGroupLabels/180*Math.PI,C=e.xAxisLabels/180*Math.PI,b=e.yAxisLabels/180*Math.PI,B=0,E=0,k=e.xGroupLabels===45,P=e.xAxisLabels===45;if(k||P)if(!t.sharedX)i.forEach(z=>{let O=o.find(j=>r.facets[z].xKeysByGroups[j].length>0);if(!O)return;let K=r.facets[z].xKeysByGroups[O],te=n.x[z],le=te>B3,G=K.length*te/2,Q=A[K[0]];B=Math.max(B,(k?a.getTextWidth(O)*Math.cos(v):0)-G,(P&&le?a.getTextWidth(Q)*Math.cos(C):0)-te/2)});else{let z=o[0],O=i[0];if(z){let K=c[z],te=n.x[O],le=te>B3,G=K.length*te/2,Q=A[K[0]];B=Math.max(B,(k?a.getTextWidth(z)*Math.cos(v):0)-G,(P&&le?a.getTextWidth(Q)*Math.cos(C):0)-te/2)}}let I=e.yGroupLabels===45,$=e.yAxisLabels===45;if(I||$)if(!t.sharedY)i.forEach(z=>{let O=Zn.findLast(s,j=>r.facets[z].yKeysByGroups[j].length>0);if(!O)return;let K=r.facets[z].yKeysByGroups[O],te=n.y[z],le=te>B3,G=K.length*te/2,Q=h[K[K.length-1]];E=Math.max(E,(I?a.getTextWidth(O)*Math.cos(g):0)-G,($&&le?a.getTextWidth(Q)*Math.cos(b):0)-te/2)});else{let z=s[s.length-1],O=i[0];if(z){let K=f[z],te=n.y[O],le=te>B3,G=K.length*te/2,Q=h[K[K.length-1]];E=Math.max(E,(I?a.getTextWidth(z)*Math.cos(g):0)-G,($&&le?a.getTextWidth(Q)*Math.cos(b):0)-te/2)}}return{xCaptionTail:B,yCaptionTail:E}}function cZ(e,t,n,r){let a=[];return e%n===n-1&&a.push("right"),e%n===0&&a.push("left"),e<n&&a.push("top"),(Math.ceil((e+1)/n)===r||Math.ceil((e+1)/n)===r-1&&e%n>(t-1)%n)&&a.push("bottom"),a}function d9t(e,t,n,r,a){if(e){let s=Wc/2,c=n==="top"?-5:a+5;return{x:s,y:c,rotate:t==="left"?-90:90,anchor:t==="left"&&n==="top"?"start":"end"}}let i=n==="right"?r+5:-5,o=Wc/2;return{x:i,y:o,rotate:0,anchor:n==="right"?"start":"end"}}function A9t(e){return e!==null&&!("data"in e)}function uS({facetKey:e,data:t,scales:n,stepX:r,stepY:a,x:i,y:o,annotation:s,showTitle:c,width:f,height:A,colorScale:h,aes:v,frame:g,xGroupKeys:C,yGroupKeys:b,xKeysByGroups:B,yKeysByGroups:E,tooltipsData:k,activeElementContainer:P}){let{position:I,titlePosition:$,valueColumn:z}=s,O=I==="left"||I==="right",K=(O?n.y:n.x).domain(),te=d9t(O,I,$,f,A),le=k.fixed&&P;return ie.jsxs("g",{children:[K.map(G=>{let Q=t==null?void 0:t[G],j=h.type==="continuous"?h.scale(Number(Q)):h.scale(String(Q)),Y=i+(O?0:n.x(G)),X=o+(O?n.y(G):0),ee=O?Wc:r,pe=O?a:Wc,ae=O?null:G,ge=O?G:null,me=le&&A9t(k.selectedData)&&k.selectedData.xKey===ae&&k.selectedData.yKey===ge&&e===k.currentFacet,fe=ie.jsx("rect",{x:Y,y:X,width:ee,height:pe,fill:j,stroke:v.cellStrokeColor,onMouseOver:()=>k.onMouseOver({x:Y+ee,y:X+pe/2,xKey:ae,yKey:ge,value:Q,title:z.label??z.value},e),onMouseLeave:()=>k.onMouseLeave()},G);return me?cu.createPortal(fe,P):fe}),k.fixed&&!O&&C.map(G=>{let Q=B[G].length;if(Q===0)return null;let j=Q*r,Y=n.x(B[G][0]);return ie.jsx("rect",{x:Y+i,y:o,width:j,height:Wc,stroke:"none",fill:"rgba(255, 255, 255, 0.8)"},`${Y}_${o}`)}),k.fixed&&O&&b.map(G=>{let Q=E[G].length;if(Q===0)return null;let j=Q*a,Y=n.y(E[G][0]);return ie.jsx("rect",{x:i,y:Y+o,width:Wc,height:j,stroke:"none",fill:"rgba(255, 255, 255, 0.8)"},`${i}_${Y}`)}),g.type==="groups"&&!O&&C.map(G=>{let Q=B[G].length;if(Q===0)return null;let j=Q*r,Y=n.x(B[G][0]);return ie.jsx("rect",{x:Y+i,y:o,width:j,height:Wc,stroke:Vt,fill:"none"},`${Y}_${o}`)}),g.type==="groups"&&O&&b.map(G=>{let Q=E[G].length;if(Q===0)return null;let j=Q*a,Y=n.y(E[G][0]);return ie.jsx("rect",{x:i,y:Y+o,width:Wc,height:j,stroke:Vt,fill:"none"},`${i}_${Y}`)}),c&&ie.jsx("g",{fontWeight:"500",fontSize:"14px",transform:`translate(${i+te.x},${o+te.y}) rotate(${te.rotate})`,children:ie.jsx("text",{textAnchor:te.anchor,dominantBaseline:"central",children:z.label??z.value})})]})}function cS(e,t){return e.showTitle&&t.includes(e.titlePosition)}function h9t({facetKey:e,sideElementBBoxes:t,annotations:n,annotationColorScales:r,cellsMeta:a,chartEdgeSides:i,sharedX:o,sharedY:s,width:c,height:f,scales:A,stepX:h,stepY:v,aes:g,frame:C,xGroupKeys:b,yGroupKeys:B,xKeysByGroups:E,yKeysByGroups:k,tooltipsData:P,activeElementContainer:I}){let $=n.filter(j=>i.includes(j.position)||!o&&["left","right"].includes(j.position)||!s&&["top","bottom"].includes(j.position)),z=$.filter(j=>j.position==="left"),O=$.filter(j=>j.position==="right"),K=$.filter(j=>j.position==="top"),te=$.filter(j=>j.position==="bottom"),{xDataByKeys:le,yDataByKeys:G}=a,Q={facetKey:e,scales:A,stepX:h,stepY:v,width:c,height:f,aes:g,frame:C,xGroupKeys:b,yGroupKeys:B,xKeysByGroups:E,yKeysByGroups:k,tooltipsData:P,activeElementContainer:I};return ie.jsxs("g",{children:[z.map((j,Y)=>ie.jsx(uS,{annotation:j,colorScale:r[j.id],data:G[j.valueColumn.value],showTitle:cS(j,i),x:t.left.annotations.x+Y*Wc,y:t.left.annotations.y,...Q},j.id)),O.map((j,Y)=>ie.jsx(uS,{annotation:j,colorScale:r[j.id],data:G[j.valueColumn.value],showTitle:cS(j,i),x:t.right.annotations.x+Y*Wc+T3,y:t.right.annotations.y,...Q},j.id)),K.map((j,Y)=>ie.jsx(uS,{annotation:j,colorScale:r[j.id],data:le[j.valueColumn.value],showTitle:cS(j,i),x:t.top.annotations.x,y:t.top.annotations.y+Y*Wc,...Q},j.id)),te.map((j,Y)=>ie.jsx(uS,{annotation:j,colorScale:r[j.id],data:le[j.valueColumn.value],showTitle:cS(j,i),x:t.bottom.annotations.x,y:t.bottom.annotations.y+Y*Wc+T3,...Q},j.id))]})}function p9t({sideElementBBoxes:e,xGroupKeys:t,yGroupKeys:n,xKeysByGroups:r,yKeysByGroups:a,xGroupLabels:i,yGroupLabels:o,scales:s,stepX:c,stepY:f,xAxis:A,yAxis:h,labelAngles:v,debug:g}){let C=e.top.groups.isVisible||e.bottom.groups.isVisible,b=e.top.groups.isVisible?e.top.groups:e.bottom.groups,B=e.left.groups.isVisible||e.right.groups.isVisible,E=e.left.groups.isVisible?e.left.groups:e.right.groups;return ie.jsxs("g",{children:[C&&ie.jsx("g",{transform:`translate(${b.x},${b.y})`,children:t.map(k=>{let P=r[k].length;if(P===0)return null;let I=v.xGroupLabels!==0,$=A.groupingPosition==="top",z=P*c,O=s.x(r[k][0])+z/2,K=I?$?b.height:0:b.height/2,te=-v.xGroupLabels,le=I?$?"start":"end":"middle";return ie.jsxs("g",{transform:`translate(${O},${K})`,children:[ie.jsx("text",{transform:`rotate(${te})`,dominantBaseline:"central",textAnchor:le,children:i[k]}),g&&ie.jsx("rect",{x:-z/2,width:z,height:b.height,stroke:"black",fill:"none"})]},k)})}),B&&ie.jsx("g",{transform:`translate(${E.x},${E.y})`,children:n.map(k=>{let P=a[k].length;if(P===0)return null;let I=P*f,$=h.groupingPosition==="left",z=$?E.width:0,O=s.y(a[k][0])+I/2,K=v.yGroupLabels!==0,te=v.yGroupLabels===45?-45:($?-1:1)*(90-v.yGroupLabels),le=K?$?"end":"start":"middle";return ie.jsxs("g",{transform:`translate(${z},${O})`,children:[ie.jsx("text",{y:K?0:-E.width/2,transform:`rotate(${te})`,dominantBaseline:"central",textAnchor:le,children:o[k]}),g&&ie.jsx("rect",{x:-E.width/2,y:-I/2,width:E.width,height:I,stroke:"black",fill:"none"})]},k)})})]})}function v9t({sideElementBBoxes:e,debug:t,xKeys:n,yKeys:r,scales:a,xAxis:i,yAxis:o,stepX:s,stepY:c,labelAngles:f,xLabels:A,yLabels:h}){let v=i.showTicks?lS:0,g=o.showTicks?lS:0,C=e.top.axis.isVisible||e.bottom.axis.isVisible,b=e.top.axisTitle.isVisible?e.top.axisTitle:e.bottom.axisTitle,B=e.top.axis.isVisible?e.top.axis:e.bottom.axis,E=e.left.axis.isVisible||e.right.axis.isVisible,k=e.left.axisTitle.isVisible?e.left.axisTitle:e.right.axisTitle,P=e.left.axis.isVisible?e.left.axis:e.right.axis;return ie.jsxs("g",{children:[ie.jsxs("g",{children:[b.isVisible&&ie.jsxs("g",{transform:`translate(${b.x},${b.y})`,children:[ie.jsx("text",{x:b.width/2,y:b.height/2,textAnchor:"middle",dominantBaseline:"central",children:i.title}),t&&ie.jsx("rect",{width:b.width,height:b.height,stroke:Vt,fill:"none"})]}),C&&ie.jsxs("g",{fontSize:"14px",transform:`translate(${B.x},${B.y})`,children:[n.map(I=>{let $=f.xAxisLabels!==0,z=i.position==="bottom",O=z?0:B.height,K=z?O+v:O-v,te=z?K+_3:K-_3,le=a.x(I)+s/2,G=-f.xAxisLabels;return ie.jsxs("g",{children:[ie.jsx("line",{x1:le,x2:le,y1:O,y2:K,stroke:Vt}),ie.jsx("text",{x:le,y:te,textAnchor:$?z?"end":"start":"middle",transform:`rotate(${G},${le},${te})`,dominantBaseline:$?"central":z?"hanging":"auto",children:A[I]})]},I)}),t&&ie.jsx("rect",{width:B.width,height:B.height,stroke:Vt,fill:"none"})]})]}),ie.jsxs("g",{children:[k.isVisible&&ie.jsx("g",{transform:`translate(
|
|
15127
15127
|
${k.x+k.width/2},
|
|
15128
15128
|
${k.y+k.height/2})`,children:ie.jsx("text",{transform:`rotate(${o.position==="left"?-90:90})`,dominantBaseline:"central",textAnchor:"middle",children:o.title})}),t&&ie.jsx("rect",{x:k.x,y:k.y,width:k.width,height:k.height,stroke:Vt,fill:"none"}),E&&ie.jsx("g",{fontSize:"14px",transform:`translate(${P.x},${P.y})`,children:r.map(I=>{let $=f.yAxisLabels!==0,z=o.position==="left",O=-(90-f.yAxisLabels),K=f.yAxisLabels===0?"middle":z?"end":"start",te=$?"central":z?"auto":"hanging",le=z?P.width:0,G=z?le-g:le+g,Q=z?G-_3:G+_3,j=a.y(I)+c/2;return ie.jsxs("g",{children:[ie.jsx("line",{x1:le,x2:G,y1:j,y2:j,stroke:Vt}),ie.jsx("text",{x:Q,y:j,textAnchor:K,transform:`rotate(${O},${Q},${j})`,dominantBaseline:te,children:h[I]})]},I)})}),t&&ie.jsx("rect",{x:P.x,y:P.y,height:P.height,width:P.width,stroke:Vt,fill:"none"})]})]})}function m9t({sideElementBBoxes:e,debug:t,xKeys:n,yKeys:r,scales:a,xAxis:i,yAxis:o,stepX:s,stepY:c,xGroupKeys:f,yGroupKeys:A,xKeysByGroups:h,yKeysByGroups:v,labelAngles:g,xLabels:C,yLabels:b,xGroupLabels:B,yGroupLabels:E}){return ie.jsxs("g",{fontWeight:"500",children:[ie.jsx(v9t,{sideElementBBoxes:e,xKeys:n,yKeys:r,scales:a,xAxis:i,yAxis:o,stepX:s,stepY:c,labelAngles:g,xLabels:C,yLabels:b,debug:t}),ie.jsx(p9t,{sideElementBBoxes:e,xGroupKeys:f,yGroupKeys:A,xKeysByGroups:h,yKeysByGroups:v,xGroupLabels:B,yGroupLabels:E,scales:a,stepX:s,stepY:c,xAxis:i,yAxis:o,labelAngles:g,debug:t})]})}function fZ(e,t="top"){let{source:n,target:r}=e;return t==="top"||t==="bottom"?`M ${n.x},${n.y} L ${r.x},${n.y} L${r.x},${r.y}`:`M ${n.x},${n.y} L ${n.x},${r.y} L${r.x},${r.y}`}function dZ(e,t,n,r,a){if(!n)return"";let i=n.aes[e];if(!w9(i))return i;let o=i.value,s=a[o],c=r[o][t.data.keys[0]];return t.data.keys.every(f=>c===r[o][f])?s(String(c))[e]:s.unknown()[e]}var AZ={x:0,y:0,width:0,height:0};function g9t({dendrograms:e,sideElementBBoxes:t,xDataByKeys:n,yDataByKeys:r,aesScales:a}){let i=e.x.data,o=e.y.data,s=i?t[i.position].dendro:AZ,c=o?t[o.position].dendro:AZ;function f(h,v){return dZ(h,v,i,n,a)}function A(h,v){return dZ(h,v,o,r,a)}return ie.jsxs("g",{children:[ie.jsx("g",{transform:`translate(${s.x},${s.y})`,children:i&&!i.hidden&&e.x.trees.map((h,v)=>{let g=h.links(),C=h.descendants();return ie.jsxs("g",{children:[g.map(b=>{let B=i.edgeInheritance==="up"?b.source:b.target;return ie.jsx("path",{d:fZ(b,i.position),stroke:f("lineColor",B),strokeWidth:f("lineWidth",B),strokeDasharray:Of(f("lineShape",B)),fill:"none"},`${b.source.x},${b.source.y},${b.target.x},${b.target.y}`)}),i.showNodes&&C.map(b=>ie.jsx("g",{transform:`translate(${b.x},${b.y})`,children:Yc(f("dotShape",b),f("dotSize",b),f("dotFill",b))},`${b.x},${b.y}`))]},v)})}),ie.jsx("g",{transform:`translate(${c.x},${c.y})`,children:o&&!o.hidden&&e.y.trees.map((h,v)=>{let g=h.links(),C=h.descendants();return ie.jsxs("g",{children:[g.map(b=>{let B=o.edgeInheritance==="up"?b.source:b.target;return ie.jsx("path",{d:fZ(b,o.position),stroke:A("lineColor",B),strokeWidth:A("lineWidth",B),strokeDasharray:Of(A("lineShape",B)),fill:"none"},`${b.source.x},${b.source.y},${b.target.x},${b.target.y}`)}),o.showNodes&&C.map(b=>ie.jsx("g",{transform:`translate(${b.x},${b.y})`,children:Yc(A("dotShape",b),A("dotSize",b),A("dotFill",b))},`${b.x},${b.y}`))]},v)})})]})}function y9t({frame:e,width:t,height:n,xGroupKeys:r,yGroupKeys:a,xKeysByGroups:i,yKeysByGroups:o,scales:s,stepX:c,stepY:f}){return ie.jsxs("g",{children:[e.type==="full"&&ie.jsx("rect",{fill:"none",stroke:Vt,x:"0",y:"0",width:t,height:n}),e.type==="groups"&&r.map(A=>{let h=i[A].length;if(h===0)return null;let v=h*c,g=s.x(i[A][0]);return a.map(C=>{let b=o[C].length;if(b===0)return null;let B=b*f,E=s.y(o[C][0]);return ie.jsx("rect",{x:g,y:E,width:v,height:B,stroke:Vt,fill:"none"},`${g}_${E}`)})})]})}function FM(e){if(e===null)return"null";if(typeof e=="number"){let t=e>0?Math.floor(e):Math.ceil(e),n=e-t;return t+Number(n.toPrecision(2))}return e}function w9t(e,t,n=[]){let r=e.data,a=[`X: ${t.xLabels[e.x]}`,`Y: ${t.yLabels[e.y]}`,`Value: ${FM(e.value)}${e.value!==e.normalizedValue?` (${FM(e.normalizedValue)})`:""}`];for(let i of n)a.push(`${i.label}: ${r[i.valueLabels??i.value]}`);return a}function b9t(e,t){let n=[];return e.xKey&&n.push(`X: ${t.xLabels[e.xKey]}`),e.yKey&&n.push(`Y: ${t.yLabels[e.yKey]}`),n.push(`${e.title}: ${FM(e.value)}`),n}function C9t(e){return e!==null&&!("data"in e)}function hZ(e){return e!==null&&"data"in e}function S9t({dendrograms:e,facetKey:t,dimensions:n,scales:r,cells:a,xGroupKeys:i,yGroupKeys:o,xKeysByGroups:s,yKeysByGroups:c,colorScale:f,chartSettings:A,cellsMeta:h,stepX:v,stepY:g,sharedX:C,sharedY:b,annotations:B,annotationColorScales:E,dendrogramAesScales:k,aes:P,labelAngles:I,chartSizes:$,margins:z,tooltipsContainer:O,tooltipsData:K}){let[te,le]=tn.useState(),{xAxis:G,yAxis:Q,tooltips:j}=A,{width:Y,height:X}=n.inner,{padding:ee,chartEdgeSides:pe,sideElementBBoxes:ae}=n,{xGroupLabels:ge,yGroupLabels:me,xLabels:fe,yLabels:Ce}=h,De=r.x.domain(),ke=r.y.domain(),$e={left:z.left+n.left+ee.left,right:$.totalWidth-(z.left+n.left+ee.left),top:z.top+n.top+ee.top,bottom:$.totalHeight-(z.top+n.top+ee.top)},je=!1,Oe=te&&K.fixed;return ie.jsxs("g",{transform:`translate(${n.left},${n.top})`,fontSize:i9t,children:[ie.jsxs("g",{transform:`translate(${ee.left},${ee.top})`,children:[ie.jsx(h9t,{facetKey:t,sideElementBBoxes:ae,annotations:B,cellsMeta:h,annotationColorScales:E,sharedX:C,sharedY:b,chartEdgeSides:pe,width:Y,height:X,scales:r,stepX:v,stepY:g,aes:P,frame:A.frame,xGroupKeys:i,yGroupKeys:o,xKeysByGroups:s,yKeysByGroups:c,tooltipsData:K,activeElementContainer:te}),ie.jsx(g9t,{dendrograms:e,sideElementBBoxes:ae,xDataByKeys:h.xDataByKeys,yDataByKeys:h.yDataByKeys,aesScales:k}),ae.top.facetTitle.isVisible&&ie.jsx("text",{x:ae.top.facetTitle.x,y:ae.top.facetTitle.y+ae.top.facetTitle.height-a9t,fontWeight:"500",fontSize:"20px",children:h.facetKeyValues[t].join(", ")}),je,De.map(ft=>ke.map(ze=>{var gt;let Xe=(gt=a==null?void 0:a[ft])==null?void 0:gt[ze],tt=Oe&&hZ(K.selectedData)&&(Xe==null?void 0:Xe.id)===K.selectedData.id,qe=Xe?ie.jsx("rect",{x:r.x(ft),y:r.y(ze),width:v,height:g,stroke:P.cellStrokeColor,fill:Xe.value===null?P.emptyCellColor:f(Xe.normalizedValue),onMouseOver:()=>K.onMouseOver(Xe,t),onMouseLeave:()=>K.onMouseLeave()},Xe?Xe.id:`${ft}_${ze}`):null;return tt?cu.createPortal(qe,te):qe})),ie.jsx(y9t,{frame:A.frame,xGroupKeys:i,yGroupKeys:o,xKeysByGroups:s,yKeysByGroups:c,scales:r,stepX:v,stepY:g,width:Y,height:X}),ie.jsx(m9t,{xAxis:G,yAxis:Q,scales:r,stepX:v,stepY:g,debug:je,sideElementBBoxes:ae,xKeys:De,yKeys:ke,xGroupKeys:i,yGroupKeys:o,xKeysByGroups:s,yKeysByGroups:c,xGroupLabels:ge,yGroupLabels:me,labelAngles:I,xLabels:fe,yLabels:Ce})]}),A.tooltips.show&&hZ(K.selectedData)&&K.currentFacet===t&&ie.jsx(fu,{content:w9t(K.selectedData,h,j==null?void 0:j.content),x:r.x(String(K.selectedData.x))+v/2,y:r.y(String(K.selectedData.y))+g/2,offset:De.length>1?v/2:0,active:!0,sideDistances:$e,fixed:K.fixed,onClose:K.onClose,container:O}),A.tooltips.show&&C9t(K.selectedData)&&K.currentFacet===t&&ie.jsx(fu,{content:b9t(K.selectedData,h),x:K.selectedData.x,y:K.selectedData.y,offset:0,active:!0,sideDistances:$e,fixed:K.fixed,onClose:K.onClose,container:O}),ie.jsxs("g",{transform:`translate(${ee.left},${ee.top})`,children:[K.fixed&&ie.jsx("rect",{width:$.chartWidth,height:$.chartHeight,fill:"rgba(255, 255, 255, 0.8)"}),ie.jsx("g",{ref:ft=>{ft&&!te&&le(ft)}})]})]})}function x9t({margins:e,captionsSizes:t,settingsId:n,chartSettings:r,chartSizes:a,chartsDimensions:i,facetKeys:o,facetSettings:s,xGroupKeys:c,yGroupKeys:f,scales:A,colorScale:h,groupedCells:v,cellsMeta:g,step:C,annotations:b,annotationColorScales:B,legend:E,aes:k,dendrograms:P,dendrogramAesScales:I,columnsCount:$,labelAngles:z,onTooltipHintSwitch:O}){let[K,te]=tn.useState(),le=h3(O),G=tn.useRef(null);tn.useEffect(()=>{G.current&&te(G.current)},[]);let Q=i[o[0]].padding,j=i[o[$-1]].padding,Y=e.left+a.chartsWidth+zM,X=e.top+Q.top;return ie.jsx(g3,{dataId:n,children:ie.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${a.totalWidth} ${a.totalHeight}`,width:a.totalWidth,height:a.totalHeight,fontFamily:"Manrope",children:[ie.jsx("defs",{children:Qm}),ie.jsxs("g",{transform:`translate(${e.left},${e.top})`,children:[ie.jsx(y3,{title:[r.title.name],show:r.title.show,position:r.title.position,leftPadding:Q.left,rightPadding:j.right,chartsWidth:a.chartsWidth}),o.map(ee=>{let{cells:pe,xKeysByGroups:ae,yKeysByGroups:ge}=v[ee];return ie.jsx(S9t,{dendrograms:P[ee],captionsSizes:t,facetKey:ee,dimensions:i[ee],xGroupKeys:c,yGroupKeys:f,xKeysByGroups:s.sharedX?g.xKeysByGroups:ae,yKeysByGroups:s.sharedY?g.yKeysByGroups:ge,sharedX:s.sharedX,sharedY:s.sharedY,scales:{x:A.x[ee],y:A.y[ee]},cells:pe,cellsMeta:g,stepX:C.x[ee],stepY:C.y[ee],colorScale:h,chartSettings:r,aes:k,annotations:b,annotationColorScales:B,dendrogramAesScales:I,labelAngles:z,margins:e,chartSizes:a,tooltipsContainer:K,tooltipsData:le},ee)})]}),ie.jsx("g",{transform:`translate(${Y},${X})`,children:ie.jsx(w3,{legendData:E})}),ie.jsx("g",{ref:G,style:{outline:"none"}})]})})}function pZ(e,t,n){function r(a){a[n]=t(a.data.height),a.children&&a.children.forEach(r)}r(e)}function vZ(e,t,n,r=n){function a(i){i[r]=i[n]+t,i.children&&i.children.forEach(a)}a(e)}var E9t=(e,t)=>{let n=Math.min(...t),r=Math.max(...t);if(n===r){let o=e%2===0?[]:[n];for(let s=1;s<e/2+1;s++)o.push(n+s),o.unshift(n-s);return o}if(e<2)return[n,r];let a=(r-n)/(e-1),i=[];for(let o=0;o<e-1;o++)i.push(n+a*o);return i.push(r),i};function mZ(e,t,n){let r=n;return e&&(e.colorRange&&(r=e.colorRange),e.method==="standardScaling"&&(r=[-2,2]),e.method==="meanNormalization"&&(r=[-.75,.75])),E9t(t,r)}var B9t=class{constructor(){Be(this,"reactRoot",null);Be(this,"parentNode",null);Be(this,"rootNode",null);Be(this,"component",ie.jsx(ie.Fragment,{}));Be(this,"chartsDimensions",{});Be(this,"chartSizes",{chartWidth:600,chartHeight:350,chartsWidth:600,chartsHeight:350,totalWidth:600,totalHeight:350});Be(this,"margins",{top:Zv,bottom:Zv,left:Zv,right:Zv});Be(this,"captionsSizes",{xAxisCaptions:100,yAxisCaptions:100,xGroupCaptions:Jv,yGroupCaptions:Jv,xCaptionTail:0,yCaptionTail:0});Be(this,"labelAngles",{xAxisLabels:0,yAxisLabels:0,xGroupLabels:0,yGroupLabels:0});Be(this,"columnsCount",1);Be(this,"rowsCount",1);Be(this,"scales",{x:{null:Qo().domain(["null"]).range([1])},y:{null:Qo().domain(["null"]).range([1])}});Be(this,"step",{x:{},y:{}});Be(this,"colorScale",Zr().domain([0,1]).range(["white","black"]));Be(this,"annotationColorScales",{});Be(this,"dendrogramAesScales",{});Be(this,"legend",{width:0,height:0,items:[]});Be(this,"dendrograms",{})}clear(){var e;this.parentNode&&this.rootNode&&((e=this.parentNode)==null||e.removeChild(this.rootNode),this.parentNode=null,this.rootNode=null),setTimeout(()=>{var t;(t=this.reactRoot)==null||t.unmount(),this.reactRoot=null})}init(e){this.parentNode===null&&(this.parentNode=e,this.rootNode=document.createElement("div"),this.parentNode.appendChild(this.rootNode),this.reactRoot=Wh(this.rootNode))}updateMargins(e){this.margins={top:e.show?24+24*2:Zv,bottom:Zv,left:Zv,right:this.legend.width+Zv},this.chartSizes.totalWidth=this.margins.left+this.chartSizes.chartsWidth+this.margins.right,this.chartSizes.totalHeight=this.margins.top+Math.max(this.chartSizes.chartsHeight+this.margins.bottom,this.legend.height)}updateLegendSize(e,t,n,r,a){if(!t.show){this.legend={width:0,height:0,items:[]};return}let i=this.chartSizes.chartHeight,o=[],s={width:0,height:0,left:0,top:0},c=v=>v.reduce((g,C)=>(g[C]=String(C),g),{});if(e==="continuous"){let v=this.colorScale,g=A3(v,a),C=Zr([g[0],g[g.length-1]],[i,0]),b=r.label??r.value;o.push({...s,type:"continuous",id:"heatmapValue",scale:v,values:g,title:b,tickPositionScale:C})}else if(e==="discrete"){let v=this.colorScale,g=r.label??r.value,C=v.domain(),b=c(C);o.push({...s,type:"discreteColor",id:"heatmapValue",title:g,scale:v,values:C,labels:b})}if(n.forEach(v=>{let g=v.valueColumn.label??v.valueColumn.value;if(v.type==="continuous"){let C=this.annotationColorScales[v.id].scale,b=A3(C,a),B=Zr([b[0],b[b.length-1]],[i,0]);o.push({...s,type:"continuous",id:v.id,tickPositionScale:B,title:g,scale:C,values:b})}if(v.type==="discrete"){let C=this.annotationColorScales[v.id].scale,b=C.domain(),B=c(b);o.push({...s,type:"discreteColor",id:v.id,title:g,scale:C,values:b,labels:B})}}),!o.length){this.legend={width:0,height:0,items:[]};return}let f=C3(o,this.chartSizes.chartHeight),A=f[f.length-1],h=A.left+A.width+zM;this.legend={width:h,height:i,items:f}}updateCaptionsSize(e,t,n,r){let a=new hc("bold 14px Arial"),{xGroupKeys:i,yGroupKeys:o,xGroupLabels:s,yGroupLabels:c,xKeysByGroups:f,yKeysByGroups:A,xLabels:h,yLabels:v}=e.meta;this.labelAngles={xAxisLabels:t.axisLabelsAngle,yAxisLabels:n.axisLabelsAngle,xGroupLabels:t.groupLabelsAngle,yGroupLabels:n.groupLabelsAngle};function g(le,G){let Q=0;for(let j of le){let Y=a.getTextWidth(G[j]);Y>Q&&(Q=Y)}return Q}let C=Zn.flatten(Object.values(f)),b=Zn.flatten(Object.values(A)),B=g(C,h),E=g(b,v),k=g(i,s),P=g(o,c),{xCaptionTail:I,yCaptionTail:$}=f9t(this.labelAngles,r,this.step,e,a),z=this.labelAngles.xGroupLabels/180*Math.PI,O=this.labelAngles.yGroupLabels/180*Math.PI,K=this.labelAngles.xAxisLabels/180*Math.PI,te=this.labelAngles.yAxisLabels/180*Math.PI;this.captionsSizes={xCaptionTail:I,yCaptionTail:$,xGroupCaptions:k*Math.sin(z)||Jv,yGroupCaptions:P*Math.sin(O)||Jv,xAxisCaptions:B*Math.sin(K)||Jv,yAxisCaptions:E*Math.sin(te)||Jv}}updateChartDimensions(e,t,n,r,a,i,o,s,c,f){let A=t.length,h=Math.min(a.nRows??A,A),v=Math.min(a.nCols??A,A);this.columnsCount=a.nRows?Math.ceil(A/h):v,this.rowsCount=Math.ceil(A/this.columnsCount);let{width:g,height:C}=e,{sharedX:b,sharedY:B}=a;this.chartsDimensions={};let E=0,k=0;t.forEach(($,z)=>{let O=z%this.columnsCount+1,K=cZ(z,t.length,this.columnsCount,this.rowsCount),te=this.step.x[$],le=this.step.y[$],G=o9t(i,o,this.captionsSizes,s,c,f,K,b,B,t,n,r,te,le),Q=c9t(s,K,b,B);function j(ae){return Math.max(Ap[ae].reduce((ge,me)=>ge+G[ae][me],0),Q[ae],n9t)}let Y={left:j("left"),right:j("right"),top:j("top"),bottom:j("bottom")};Y.left<this.captionsSizes.xCaptionTail&&(Y.left=this.captionsSizes.xCaptionTail),Y.bottom<this.captionsSizes.yCaptionTail&&(Y.bottom=this.captionsSizes.yCaptionTail);let X=l9t(G,g,C),ee=g+Y.left+Y.right,pe=C+Y.top+Y.bottom;this.chartsDimensions[$]={left:E,top:k,inner:{width:g,height:C},outer:{width:ee,height:pe},padding:Y,sideElementBBoxes:X,chartEdgeSides:K},E+=ee,O===this.columnsCount&&(E=0,k+=pe)});let P=t.slice(0,this.columnsCount).reduce(($,z)=>$+this.chartsDimensions[z].outer.width,0),I=t.filter(($,z)=>z%this.columnsCount===0).reduce(($,z)=>$+this.chartsDimensions[z].outer.height,0);this.chartSizes.chartsWidth=P,this.chartSizes.chartsHeight=I}updateChartsSizes(e){let{width:t,height:n}=e;this.chartSizes.chartWidth=t,this.chartSizes.chartHeight=n}updateScales(e,t,n,r,a,i,o,s,c){let{width:f,height:A}=a,{meta:h,facets:v}=t,{sharedX:g,sharedY:C}=r,b=(E,k={})=>E.sort((P,I)=>i.sorting==="asc"?(k[P]??P).localeCompare(k[I]??I,"en",{numeric:!0}):(k[I]??I).localeCompare(k[P]??P,"en",{numeric:!0})),B=(E,k={})=>E.sort((P,I)=>o.sorting==="asc"?(k[P]??P).localeCompare(k[I]??I,"en",{numeric:!0}):(k[I]??I).localeCompare(k[P]??P,"en",{numeric:!0}));e.forEach(E=>{let k=v[E],P=b(h.xGroupKeys),I=B(h.yGroupKeys),{xKeysByGroups:$}=g?h:k,{yKeysByGroups:z}=C?h:k,O=P.map(ge=>$[ge].length),K=I.map(ge=>z[ge].length),te=O.reduce((ge,me)=>ge+me,0),le=K.reduce((ge,me)=>ge+me,0),G=(f-(O.filter(ge=>ge>0).length-1)*n)/te,Q=(A-(K.filter(ge=>ge>0).length-1)*n)/le,j=[],Y=[],X=0;P.forEach(ge=>{let me=s?$[ge]:b($[ge],h.xLabels);Y.push(...me),me.forEach(()=>{j.push(X),X+=G}),me.length>0&&(X+=n)});let ee=[],pe=[],ae=0;I.forEach(ge=>{let me=c?z[ge]:B(z[ge],h.yLabels);pe.push(...me),me.forEach(()=>{ee.push(ae),ae+=Q}),me.length>0&&(ae+=n)}),this.scales.x[E]=Qo().domain(Y).range(j),this.scales.y[E]=Qo().domain(pe).range(ee),this.step.x[E]=G,this.step.y[E]=Q})}updateAesScale(e,t,n,r,a,i,o){if(e==="continuous")n.valueColors?this.colorScale=Zr().domain(n.valuesByColors??mZ(o,n.valueColors.length,t)).range(n.valueColors):n.colorsList&&(this.colorScale=Zr().domain(mZ(o,n.colorsList.length,t)).range(n.colorsList));else if(n.colorsMap){let f=Object.entries(n.colorsMap);this.colorScale=Qo().domain(f.map(A=>A[0])).range(f.map(A=>A[1])).unknown("#ccc")}else n.colorsList&&(this.colorScale=uZ(n.colorsList,i.map(String)));let{xDataByKeys:s,yDataByKeys:c}=a.meta;r.forEach(f=>{let{colors:A,type:h,axis:v,valueColumn:g}=f,C=(v==="x"?s:c)[g.value];if(h==="discrete"){let b=Zn.uniq(Object.values(C).map(String)).sort();this.annotationColorScales[f.id]={type:"discrete",scale:uZ(A,b)}}else{let b=Object.values(C).map(Number);if(!b.length)return;let[B=b[0],E=b[0]]=H0(b);this.annotationColorScales[f.id]={type:"continuous",scale:s9t(A,B,E,0,.5,1)}}})}updateDendrogram(e,t,n,r,a,i,o){e.forEach(s=>{this.dendrograms[s]={x:{trees:[],data:i},y:{trees:[],data:o}};let{xKeysByGroups:c,yKeysByGroups:f}=r[s],{hierarchyX:A,hierarchyY:h}=a[s],v=Math.max(...A.map(C=>C.data.height)),g=Math.max(...h.map(C=>C.data.height));i&&(this.dendrograms[s].x.trees=A.map((C,b)=>{let B=t[b],E=c[B];$B().separation(()=>1).size([E.length*this.step.x[s],i.size])(C);let k=C,P=Zr().domain(i.position==="top"?[0,v]:[v,0]).range([i.size,0]);return pZ(k,P,"y"),vZ(k,this.scales.x[s](E[0]),"x"),k}),this.dendrograms[s].x.data=i),o&&(this.dendrograms[s].y.trees=h.map((C,b)=>{let B=n[b],E=f[B];$B().separation(()=>1).size([E.length*this.step.y[s],o.size])(C);let k=C,P=Zr().domain(o.position==="left"?[0,g]:[g,0]).range([o.size,0]);return vZ(k,this.scales.y[s](E[0]),"x","y"),pZ(k,P,"x"),k}),this.dendrograms[s].y.data=o)})}updateDendrogramAesScales(e){if(!e)return;let t=Object.keys(e);this.dendrogramAesScales=t.reduce((n,r)=>{let a=e[r],i=Object.keys(a);return n[r]=Qo().domain(i).range(i.map(o=>({...sZ,...a[o]}))).unknown(sZ),n},{})}render(e,t,n,r,a,i,o,s,c,f,A,h,v,g){var le;let{meta:C,facets:b}=a,{facetKeys:B,xGroupKeys:E,yGroupKeys:k,valueExtent:P}=C,{xAxis:I,yAxis:$,title:z,size:O,valueType:K}=t;this.updateChartsSizes(O),this.updateAesScale(K,P,r,i,a,h,v),this.updateScales(B,a,r.groupGap,n,O,t.xAxis,t.yAxis,s,c),this.updateCaptionsSize(a,I,$,n),this.updateChartDimensions(O,B,E,k,n,I,$,i,s,c),this.updateLegendSize(K,t.legend,i,o,P),this.updateMargins(z),this.updateDendrogram(B,E,k,b,f,s,c),this.updateDendrogramAesScales(A);let te=ie.jsx(x9t,{aes:r,annotations:i,annotationColorScales:this.annotationColorScales,captionsSizes:this.captionsSizes,cellsMeta:C,columnsCount:this.columnsCount,chartsDimensions:this.chartsDimensions,chartSettings:t,chartSizes:this.chartSizes,colorScale:this.colorScale,dendrogramAesScales:this.dendrogramAesScales,dendrograms:this.dendrograms,facetKeys:B,facetSettings:n,groupedCells:b,labelAngles:this.labelAngles,legend:this.legend,margins:this.margins,scales:this.scales,settingsId:e,step:this.step,xGroupKeys:E,yGroupKeys:k,onTooltipHintSwitch:g});this.component=te,(le=this.reactRoot)==null||le.render(te)}renderError(e){var t;(t=this.reactRoot)==null||t.render(ie.jsx(Xv,{message:e}))}},_9t=B9t,QM={lineColor:Vt,dotShape:"21",dotFill:Vt,dotSize:3,lineShape:"solid",lineWidth:1},gZ={size:150,distance:"euclidean",linkage:"average",fillNA:0,showNodes:!0,hidden:!1,edgeInheritance:"up",aes:QM},yZ=class{constructor(e){Be(this,"id");Be(this,"type","heatmap");Be(this,"facetSettings");Be(this,"xColumn");Be(this,"xGroupBy");Be(this,"yColumn");Be(this,"yGroupBy");Be(this,"valueColumn");Be(this,"facetBy");Be(this,"normalization");Be(this,"chartSettings");Be(this,"aes");Be(this,"annotations");Be(this,"dendrogramX");Be(this,"dendrogramY");Be(this,"inheritedDendrogramAes");Be(this,"NAValueAs");var t,n,r,a,i,o,s,c,f,A,h,v,g;if(K3t.parse(e),this.id=Zn.uniqueId("settings"),this.facetSettings={sharedX:(e.facetBy??[]).length>0,sharedY:(e.facetBy??[]).length>0,...e.facetSettings},this.xColumn=e.xColumn,this.xGroupBy=e.xGroupBy??[],this.yColumn=e.yColumn,this.yGroupBy=e.yGroupBy??[],this.valueColumn=e.valueColumn,this.facetBy=e.facetBy??[],this.chartSettings={title:{position:"left",show:!0,...e.title,name:((t=e.title)==null?void 0:t.name)??"Chart"},size:{width:((n=e==null?void 0:e.size)==null?void 0:n.width)??(this.facetBy.length?400:600),height:((r=e==null?void 0:e.size)==null?void 0:r.height)??(this.facetBy.length?250:350)},frame:{type:((a=e.frame)==null?void 0:a.type)??"none"},valueType:e.valueType??"continuous",yAxis:{title:e.yColumn.label??e.yColumn.value,showTicks:!0,showTitle:!0,showAxisLabels:!0,showGroupLabels:!0,position:"left",groupingPosition:"left",axisLabelsAngle:90,groupLabelsAngle:0,sorting:"asc",...e.yAxis},xAxis:{title:e.xColumn.label??e.xColumn.value,showTicks:!0,showTitle:!0,showAxisLabels:!0,showGroupLabels:!0,position:"bottom",groupingPosition:"bottom",axisLabelsAngle:90,groupLabelsAngle:0,sorting:"asc",...e.xAxis},legend:{show:!0,position:"right",...e.legend},tooltips:{show:!0,...e.tooltips}},this.normalization=this.chartSettings.valueType==="continuous"?e.normalization??null:null,this.NAValueAs=e.NAValueAs??null,this.aes={colorsList:((i=e.aes)==null?void 0:i.colorsList)??["black","white","red"],colorsMap:((o=e.aes)==null?void 0:o.colorsMap)??null,valueColors:((s=e.aes)==null?void 0:s.valueColors)??null,valuesByColors:((c=e.aes)==null?void 0:c.valuesByColors)??null,cellStrokeColor:((f=e.aes)==null?void 0:f.cellStrokeColor)??"none",groupGap:((A=e.aes)==null?void 0:A.groupGap)??3,emptyCellColor:((h=e.aes)==null?void 0:h.emptyCellColor)??"white"},this.annotations=(e.annotations??[]).map(C=>C.axis==="x"?{id:Zn.uniqueId("annotation"),axis:"x",valueColumn:C.valueColumn,position:C.position??this.chartSettings.xAxis.position,titlePosition:C.titlePosition??"right",showTitle:C.showTitle??!0,type:C.type,colors:C.colors??["white","black"]}:{id:Zn.uniqueId("annotation"),axis:"y",valueColumn:C.valueColumn,position:C.position??this.chartSettings.yAxis.position,titlePosition:C.titlePosition??"top",showTitle:C.showTitle??!0,type:C.type,colors:C.colors??["white","black"]}),e.valueType==="discrete"&&(e.dendrogramX||e.dendrogramY))throw Error("Dendrogram is not available with discrete cells values");this.dendrogramX=e.dendrogramX?{...gZ,position:"top",...e.dendrogramX,aes:{...QM,...(v=e.dendrogramX)==null?void 0:v.aes}}:null,this.dendrogramY=e.dendrogramY?{...gZ,position:"left",...e.dendrogramY,aes:{...QM,...(g=e.dendrogramY)==null?void 0:g.aes}}:null,this.inheritedDendrogramAes=e.inheritedDendrogramAes??null}},T9t=class extends zm{constructor(t,n,r){super(t,n);Be(this,"settings");Be(this,"chartRenderer",new _9t);Be(this,"onTooltipHintSwitch",()=>{});Be(this,"calculatedData",null);this.settings=new yZ(n),r&&(this.onTooltipHintSwitch=r[0])}mount(t){try{this.chartRenderer.init(t),this._updateData(),this._updateChart()}catch(n){n instanceof Error&&this.chartRenderer.renderError(n.message)}}unmount(){this.chartRenderer.clear()}updateSettingsAndData(t,n){try{let r=this.settings,a=this.data;this.settings=new yZ(n),this.data=t,this._needUpdateCalculatedDataBySettings(r,this.settings)||this._needUpdateCalculatedDataByData(a,this.data)?this._updateData():this._updateAesInData(),this._updateChart()}catch(r){r instanceof Error&&this.chartRenderer.renderError(r.message)}}updateChartState(t,n){console.warn("no chart state for heatmap")}export(){return this._updateChart(),w5(this.chartRenderer.component)}_needUpdateCalculatedDataBySettings(t,n){var $,z,O,K,te,le,G,Q,j,Y,X,ee;let{xColumn:r,yColumn:a,valueColumn:i,xGroupBy:o,yGroupBy:s,facetBy:c,annotations:f,chartSettings:A,facetSettings:h,dendrogramX:v,dendrogramY:g,normalization:C,NAValueAs:b}=n,B=Object.values((($=t.dendrogramX)==null?void 0:$.aes)||{}).filter(w9),E=Object.values((v==null?void 0:v.aes)||{}).filter(w9),k=Object.values(((z=t.dendrogramY)==null?void 0:z.aes)||{}).filter(w9),P=Object.values((g==null?void 0:g.aes)||{}).filter(w9);function I(pe,ae){return pe.length!==ae.length||pe.some((ge,me)=>ge.value!==ae[me].value)}return t.xColumn.value!==r.value||t.yColumn.value!==a.value||t.valueColumn.value!==i.value||I(t.xGroupBy,o)||I(t.yGroupBy,s)||I(t.facetBy,c)||I(t.annotations.map(pe=>pe.valueColumn),f.map(pe=>pe.valueColumn))||I(B,E)||I(k,P)||(n.dendrogramX||t.dendrogramX)&&(((O=t.dendrogramX)==null?void 0:O.distance)!==((K=n.dendrogramX)==null?void 0:K.distance)||((te=t.dendrogramX)==null?void 0:te.linkage)!==((le=n.dendrogramX)==null?void 0:le.linkage))||(n.dendrogramY||t.dendrogramY)&&(((G=t.dendrogramY)==null?void 0:G.distance)!==((Q=n.dendrogramY)==null?void 0:Q.distance)||((j=t.dendrogramY)==null?void 0:j.linkage)!==((Y=n.dendrogramY)==null?void 0:Y.linkage))||t.chartSettings.valueType!==A.valueType||t.facetSettings.sharedX!==h.sharedX||t.facetSettings.sharedY!==h.sharedY||((X=t.normalization)==null?void 0:X.method)!==(C==null?void 0:C.method)||((ee=t.normalization)==null?void 0:ee.direction)!==(C==null?void 0:C.direction)||t.NAValueAs!==b}_needUpdateCalculatedDataByData(t,n){let r=Object.keys(t.data),a=Object.keys(n.data);return t.id!==n.id||r.length!==a.length||r.some(i=>{var o;return t.data[i].length!==((o=n.data[i])==null?void 0:o.length)})}_updateData(){let{xColumn:t,yColumn:n,valueColumn:r,xGroupBy:a,yGroupBy:i,facetBy:o,chartSettings:s,facetSettings:c,annotations:f,dendrogramX:A,dendrogramY:h,normalization:v,NAValueAs:g}=this.settings,C=K7t(this.data,t,n,r,o,a,i,f,A,h,v,g),b=t9t(C,A,h,c),B=s.valueType==="discrete"?this.data.getColumnCategories(r.value):[];this.calculatedData={groupedCellsData:C,dendrogramsData:b,cellUniqValues:B}}_updateAesInData(){}_updateChart(){if(!this.calculatedData)return;let{id:t,valueColumn:n,chartSettings:r,facetSettings:a,aes:i,annotations:o,dendrogramX:s,dendrogramY:c,inheritedDendrogramAes:f,normalization:A}=this.settings;this.chartRenderer.render(t,r,a,i,this.calculatedData.groupedCellsData,o,n,s,c,this.calculatedData.dendrogramsData,f,this.calculatedData.cellUniqValues,A,this.onTooltipHintSwitch)}},wZ=(e,t)=>{let n=Math.min(...t),r=Math.max(...t);if(n===r)return[n];if(e<2)return[(n+r)/2];let a=(r-n)/e,i=[];for(let o=1;o<e;o++)i.push(n+a*o);return i};function bZ(e,t,n){return e.map(r=>({count:r.length,y:{straight:r.length,reverse:r.length},rows:r,x:r.x0??0,groupingKey:t,groupingKeyIdx:n,width:(r.x1??0)-(r.x0??0)}))}function k9t(e,t,n,r,a,i){let o=wZ(n,r),s=PI().domain(r).thresholds(o).value(c=>c[t.value])(e);return{bins:bZ(s,a,i),maxCount:Vh(s,c=>c.length)??0}}function M9t(e,t,n,r,a,i){let o=wZ(n,r),s=uv().domain(r).range(r),c=o.map(A=>s.invert(A)),f=PI().domain(r).thresholds(c).value(A=>A[t.value])(e);return{bins:bZ(f,a,i),maxCount:Vh(f,A=>A.length)??0}}function P9t(e,t,n,r,a,i){let o={};return t.forEach(s=>{var b,B;let c=s.join("_");o[c]={groupingKeys:n,histogramByGroupingKey:{},minX:1/0,maxX:-1/0,maxCount:0,maxCountFromGroups:0};let f=e.getRowsByGrouping([...s]),[A,h]=H0(f,E=>E[r.value]);A=A??((b=f[0])==null?void 0:b[r.value])??0,h=h??((B=f[0])==null?void 0:B[r.value])??0;let v=[A,h],g=[...n].reverse();g.forEach((E,k)=>{let P=e.getRowsByGrouping([...s,E]),I=i==="linear"?k9t(P,r,a,v,E,k):M9t(P,r,a,v,E,k);o[c].histogramByGroupingKey[E]=I,o[c].minX=v[0],o[c].maxX=v[1],o[c].maxCountFromGroups=Math.max(o[c].maxCountFromGroups,I.maxCount);let $=k>0?g[k-1]:null,z=$!==null?o[c].histogramByGroupingKey[$]:null;I.bins.forEach((O,K)=>{O.y.straight=((z==null?void 0:z.bins[K].y.straight)??0)+O.count,o[c].maxCount=Math.max(o[c].maxCount,O.y.straight)})});let C=n;C.forEach((E,k)=>{let P=k>0?C[k-1]:null,I=o[c].histogramByGroupingKey[E],$=P!==null?o[c].histogramByGroupingKey[P]:null;I.bins.forEach((z,O)=>{z.y.reverse=(($==null?void 0:$.bins[O].y.reverse)??0)+z.count})})}),o}var H9t={TOP:30,BOTTOM:0,LEFT:10,RIGHT:10};function T9(e,t,n=!1){let r=Math.abs(e.range()[0]-e.range()[1]),a=n?Math.min(Math.floor(r/45),10):10,i=e.ticks(a).filter(c=>t&&c>=0||!t),o=new Set(i);if(!n&&i.length>1){let c=e(i[0]),f=e(i[0]);for(let A=1;A<i.length;A++)f=e(i[A]),Math.abs(f-c)>=20?c=f:o.delete(i[A])}n&&i.length>2&&Math.abs(e(i[1])-e(i[0]))<45&&(i=i.filter((c,f)=>f%2===0));let s=i.some(c=>Math.abs(c)<1e-4&&c!==0||c>1e4)?",e":",f";return{ticks:i,format:c=>o.has(c)?e.tickFormat(a,s)(c):""}}var CZ=(e,t)=>{let n=Math.min(...t),r=Math.max(...t);if(n===r){let o=e%2===0?[]:[n];for(let s=1;s<e/2+1;s++)o.push(n+s),o.unshift(n-s);return o}if(e<2)return[n,r];let a=(r-n)/(e-1),i=[];for(let o=0;o<e-1;o++)i.push(n+a*o);return i.push(r),i};function D9t(e,t,n){if(n==="linear")return CZ(e,t);if(n==="log"){let r=CZ(e,t),a=uv(t,t),i=r.map(o=>a.invert(o));return i[0]=t[0],i[i.length-1]=t[1],i}return[]}function k9(e,t,n){return(n==="log"?uv():Zr()).domain(D9t(e.length,t,n)).range(e)}function $9t(e){return`translate(${e},0)`}function I9t(e){return`translate(0,${e})`}function L9t(e){return e==="bottom"?`translate(0,${zf})`:`translate(${-zf},0)`}function R9t(e){return e==="bottom"?"hanging":"central"}function V9t(e){return e==="bottom"?"middle":"end"}var SZ=({scale:e,tickSize:t=6,tickPadding:n=zf,orient:r="bottom",onlyPositive:a=!1,hiddenLabels:i=!1,offset:o=typeof window<"u"&&window.devicePixelRatio>1?0:.5})=>{function s(B){return E=>{let k=B(E);return k===void 0?0:+k}}let{ticks:c,format:f}=i?{ticks:[],format:B=>B}:T9(e,a,r==="bottom"),A=Math.max(t,0)+n,h=s(e.copy()),v=r==="bottom"?$9t:I9t,g=r==="left"?-1:1,C={[(r==="left"?"x":"y")+"2"]:g*t},b={[r==="left"?"x":"y"]:g*A};return ie.jsx("g",{children:c.map((B,E)=>ie.jsxs("g",{className:"tick",transform:v(h(B)+o),children:[ie.jsx("line",{stroke:Vt,...C}),ie.jsx("g",{transform:L9t(r),children:ie.jsx("text",{fill:Vt,fontSize:"14px",fontWeight:"500",fontFamily:"Manrope",dominantBaseline:R9t(r),textAnchor:V9t(r),...b,children:f(B)})})]},E))})},N9t=1;function xZ({scaleX:e,scaleY:t,width:n,height:r,axisX:a,axisY:i,frameType:o,updatingKey:s=""}){let[c,f]=tn.useState(e.ticks()),[A,h]=tn.useState(t.ticks()),{significantLines:v=[]}=a,{significantLines:g=[]}=i;return tn.useEffect(()=>{let C=e.ticks().filter(B=>!v.includes(B)),b=t.ticks().filter(B=>!g.includes(B));f(C),h(b)},[e,t,s]),ie.jsxs("g",{stroke:Nf,children:[a.showGrid&&c.map(C=>{let b=e(C);return ie.jsx("line",{x1:b,x2:b,y1:0,y2:r},`x_${b}_${r}`)}),i.showGrid&&A.map(C=>{let b=t(C);return ie.jsx("line",{x1:0,x2:n,y1:b,y2:b},`y_${b}_${n}`)}),ie.jsx("g",{strokeDasharray:Of(a.significantLinesStyle),stroke:Vt,children:v.map(C=>{let b=e(C);return b<0||b>n?null:ie.jsx("line",{x1:b,x2:b,y1:0,y2:r},`significant_${b}_${r}`)})}),ie.jsx("g",{strokeDasharray:Of(i.significantLinesStyle),stroke:Vt,children:g.map(C=>{let b=t(C);return b<0||b>r?null:ie.jsx("line",{x1:0,x2:n,y1:b,y2:b},`significant_${b}_${n}`)})}),o!=="empty"&&ie.jsxs("g",{strokeWidth:N9t,children:[(a.showGrid||o!=="left")&&ie.jsx("line",{stroke:o==="left"?Nf:Vt,x1:"0",x2:n,y1:r,y2:r}),(a.showGrid||o!=="bottom")&&ie.jsx("line",{stroke:o==="bottom"?Nf:Vt,x1:"0",x2:"0",y1:"0",y2:r}),(a.showGrid||o==="full")&&ie.jsx("line",{stroke:o==="full"?Vt:Nf,x1:n,x2:n,y1:"0",y2:r}),(i.showGrid||o==="full")&&ie.jsx("line",{stroke:o==="full"?Vt:Nf,x1:"0",x2:n,y1:"0",y2:"0"})]})]})}function z9t(e){return typeof e=="string"?e:e.value}function O9t(e,t){let n=[`Amount: ${e.count}`,`(from ${Ka(e.x)}, to ${Ka(e.x+e.width)})`];return e.groupingKey!=="null"&&n.push(`${t[e.groupingKey]??e.groupingKey}`),n}function EZ(e,t,n,r){return t==="vertical"?e:e+n*r}function BZ(e,t,n,r){return t(n==="vertical"?r==="straight"?e.y.straight:e.y.reverse:e.count)}function F9t({facetKey:e,width:t,height:n,dimensions:r,scales:a,xAxis:i,yAxis:o,frameType:s,histogramData:c,facetSettings:f,captionsSizes:A,facetTitle:h,layers:v,aesColorGetter:g,groupingDirection:C,groupingStack:b,groupingLabels:B,chartSizes:E,margins:k,tooltipsContainer:P,tooltipsData:I}){let[$,z]=tn.useState(),{padding:O}=r,K=i.showTicks?4:0,te=o.showTicks?4:0,le=r.chartEdgeSides.includes("left")||!(f!=null&&f.sharedY),G=r.chartEdgeSides.includes("bottom")||!(f!=null&&f.sharedX),Q=r.chartEdgeSides.includes("bottom"),j=c.groupingKeys,Y=c.histogramByGroupingKey[j[0]].bins[0],X=a.x(Y.width)-a.x(0),ee=b==="vertical"?X:X/j.length,pe={left:k.left+r.left+O.left,right:E.totalWidth-(k.left+r.left+O.left),top:k.top+r.top+O.top,bottom:E.totalHeight-(k.top+r.top+O.top)},ae=$&&I.fixed,ge=!1;return ie.jsxs("g",{transform:`translate(${r.left+O.left},${r.top+O.top})`,children:[ge,h.length&&ie.jsxs("g",{children:[s==="full"&&ie.jsx("rect",{x:"0",y:-O.top,height:O.top,width:t,fill:"#F7F8FA",stroke:Vt}),h.map((me,fe)=>{let Ce=h.length,De=(O.top-20*Ce)/2;return ie.jsx("text",{fontSize:"14px",fontWeight:"500",fill:Vt,x:t/2,dy:De+20/2-O.top,y:fe*20,textAnchor:"middle",dominantBaseline:"central",children:me},fe)})]}),ie.jsxs("g",{dominantBaseline:"central",textAnchor:"middle",fontWeight:"500",fontSize:"14px",fill:Vt,children:[Q&&i.title&&ie.jsx("text",{x:t/2,y:n+O.bottom-20/2,children:z9t(i.title)}),ge]}),ie.jsx(xZ,{width:t,height:n,scaleX:a.x,scaleY:a.y,axisX:i,axisY:o,frameType:s}),G&&ie.jsxs("g",{transform:`translate(0,${n})`,children:[ie.jsx(SZ,{scale:a.x,orient:"bottom",tickSize:K,hiddenLabels:i.hiddenLabels}),ge]}),le&&ie.jsxs("g",{children:[ie.jsx(SZ,{scale:a.y,orient:"left",tickSize:te,hiddenLabels:o.hiddenLabels}),ge]}),v.map(me=>j.map((fe,Ce)=>c.histogramByGroupingKey[fe].bins.map(De=>{let ke=ae&&I.selectedData===De,$e=ie.jsx("rect",{x:EZ(a.x(De.x),b,Ce,ee),y:BZ(De,a.y,b,C),fill:De.rows[0]?g(me.aes.fillColor,De.rows[0],De.count):"",stroke:me.aes.lineColor,width:ee,height:a.y(0)-a.y(De.count),opacity:me.aes.opacity??1,onMouseOver:()=>I.onMouseOver(De,e),onMouseLeave:()=>I.onMouseLeave()},De.x);return ke?cu.createPortal($e,$):$e}))),I.fixed&&ie.jsx("rect",{width:E.chartWidth,height:E.chartHeight,fill:"rgba(255,255,255,0.8)"}),ie.jsx("g",{ref:me=>{me&&!$&&z(me)}}),I.selectedData&&I.currentFacet===e&&ie.jsx(fu,{content:O9t(I.selectedData,B),x:EZ(a.x(I.selectedData.x),b,I.selectedData.groupingKeyIdx,ee)+ee,y:BZ(I.selectedData,a.y,b,C)+a.y(0)-a.y(I.selectedData.count/2),offset:0,active:!0,fixed:I.fixed,sideDistances:pe,container:P,onClose:I.onClose})]})}function Q9t({settingsId:e,chartSettings:t,chartSizes:n,chartsDimensions:r,columnsCount:a,facetKeys:i,facetSettings:o,scales:s,margins:c,mainTitle:f,facetTitles:A,captionsSizes:h,histogramDataByFacets:v,layers:g,aesColorGetter:C,groupingDirection:b,groupingStack:B,groupingLabels:E,legend:k,onTooltipHintSwitch:P}){let I=h3(P),{xAxis:$,yAxis:z,title:O,frame:K}=t,te=r[i[0]].padding,le=r[i[a-1]].padding,[G,Q]=tn.useState(),j=tn.useRef(null);tn.useEffect(()=>{j.current&&Q(j.current)},[]);let Y=c.left+n.chartsWidth+zM,X=c.top+te.top;return ie.jsx(g3,{dataId:e,children:ie.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${n.totalWidth} ${n.totalHeight}`,width:n.totalWidth,height:n.totalHeight,children:[ie.jsx("defs",{children:Qm}),ie.jsxs("g",{transform:`translate(${c.left},${c.top})`,fontFamily:"Manrope",children:[ie.jsx(y3,{title:f,show:O.show,position:O.position,leftPadding:te.left,rightPadding:le.right,chartsWidth:n.chartsWidth}),i.map(ee=>ie.jsx(F9t,{facetKey:ee,scales:{x:s.x[ee],y:s.y[ee]},width:n.chartWidth,height:n.chartHeight,dimensions:r[ee],margins:c,chartSizes:n,facetSettings:o,xAxis:$,yAxis:z,frameType:K.type,facetTitle:A[ee],captionsSizes:h,histogramData:v[ee],layers:g,aesColorGetter:C,groupingDirection:b,groupingStack:B,groupingLabels:E,tooltipsContainer:G,tooltipsData:I},ee))]}),ie.jsx("g",{transform:`translate(${Y},${X})`,children:ie.jsx(w3,{legendData:k})}),ie.jsx("g",{ref:j,style:{outline:"none"}})]})})}function j9t(e,t,n,r){let a=[];return e%n===n-1&&a.push("right"),e%n===0&&a.push("left"),e<n&&a.push("top"),(Math.ceil((e+1)/n)===r||Math.ceil((e+1)/n)===r-1&&e%n>(t-1)%n)&&a.push("bottom"),a}function U9t(e,t,n,r,a,i,o,s){let c=i.includes("left")||!(s!=null&&s.sharedY),f=i.includes("bottom")||!(s!=null&&s.sharedX),A=i.includes("bottom")&&e.title!=="",h=n.yAxisCaptionsWidth,v=(t.showTicks?4:0)+(t.hiddenLabels?0:6),g=n.xAxisCaptionsWidth,C=(e.showTicks?4:0)+(e.hiddenLabels?0:6),b=A?20:0,B=h+v,E=C+g+b,k=Math.max(...r.map(P=>a[P].length));return{left:c?B:12,top:k===0?0:6*2+k*20,bottom:f?E:12,right:o?0:12}}function G9t(e,t,n){let r=[];for(let a=0;a<t;a++)r.push(e.slice(a*n,a*n+n));return r}function Y9t(e,t){let n=Math.floor(e/t),r=e-n*t;return[n,r]}function _Z(e){return typeof e=="object"&&e!==null&&"type"in e&&"value"in e&&e.type==="grouping"}function W9t(e){return typeof e=="object"&&e!==null&&"range"in e}function X9t(e,t,n){return function(r,a,i){var o,s;if(W9t(r)){let{domain:c=n,range:f,type:A="linear"}=r,h=k9(f,c,A);return h.clamp(!0),h(i)}if(_Z(r)){let c=r.value;return(s=((o=e[c])==null?void 0:o[String(a[c])])??m9)==null?void 0:s[t]}return r}}var K9t=class{constructor(){Be(this,"reactRoot",null);Be(this,"parentNode",null);Be(this,"rootNode",null);Be(this,"component",ie.jsx(ie.Fragment,{}));Be(this,"margins",{top:24,bottom:24,left:24,right:24});Be(this,"chartsDimensions",{});Be(this,"chartSizes",{chartWidth:600,chartHeight:350,chartsWidth:600,chartsHeight:350,totalWidth:600,totalHeight:350});Be(this,"columnsCount",1);Be(this,"rowsCount",1);Be(this,"scales",{x:{null:Zr().domain([0,10]).range([0,600])},y:{null:Zr().domain([0,10]).range([350,0])}});Be(this,"captionsSizes",{xAxisCaptionsWidth:30,yAxisCaptionsWidth:100});Be(this,"facetTitles",{});Be(this,"mainTitle",[]);Be(this,"legend",{width:0,height:0,items:[]})}clear(){var e;this.parentNode&&this.rootNode&&((e=this.parentNode)==null||e.removeChild(this.rootNode),this.parentNode=null,this.rootNode=null),setTimeout(()=>{var t;(t=this.reactRoot)==null||t.unmount(),this.reactRoot=null})}init(e){this.parentNode===null&&(this.parentNode=e,this.rootNode=document.createElement("div"),this.parentNode.appendChild(this.rootNode),this.reactRoot=Wh(this.rootNode))}updateChartSizes(e){this.chartSizes.chartWidth=e.width,this.chartSizes.chartHeight=e.height}updateChartDimensions(e,t,n,r){let{chartWidth:a,chartHeight:i}=this.chartSizes,o=0,s=0;this.chartsDimensions=e.reduce((A,h,v)=>{let[g,C]=Y9t(v,this.columnsCount),b=j9t(v,e.length,this.columnsCount,this.rowsCount),B=U9t(n,r,this.captionsSizes,G9t(e,this.rowsCount,this.columnsCount)[g],this.facetTitles,b,C===this.columnsCount-1,t),E=a+B.left+B.right,k=i+B.top+B.bottom;return A[h]={left:o,top:s,chartEdgeSides:b,padding:B,inner:{width:a,height:i},outer:{width:E,height:k}},o+=E,C===this.columnsCount-1&&(o=0,s+=k),A},{});let c=Math.max(...e.map(A=>this.chartsDimensions[A].outer.width+this.chartsDimensions[A].left)),f=Math.max(...e.map(A=>this.chartsDimensions[A].outer.height+this.chartsDimensions[A].top));this.chartSizes.chartsWidth=c,this.chartSizes.chartsHeight=f}updateViewport(e,t,n,r,a,i,o){let s=e.length,c=Math.min(t.nRows??s,s),f=Math.min(t.nCols??s,s);this.columnsCount=t.nRows?Math.ceil(s/c):f,this.rowsCount=Math.ceil(s/this.columnsCount);let[A,h]=[1/0,-1/0],v=-1/0,g=e.reduce((C,b)=>{let B=a[b],{minX:E,maxX:k,maxCount:P,maxCountFromGroups:I}=B;return A=Math.min(A,E),h=Math.max(h,k),v=Math.max(v,o==="vertical"?P:I),C[b]={minX:E,maxX:k,maxY:o==="vertical"?P:I},C},{});e.forEach(C=>{let b=n.scale==="log"?uv():Zr(),B=g[C],E=t.sharedX?A:B.minX,k=t.sharedX?h:B.maxX;b.domain([E,k]).range([0,this.chartSizes.chartWidth]),this.scales.x[C]=b}),e.forEach(C=>{let b=r.scale==="log"?uv():Zr(),B=g[C],E=0,k=t.sharedY?v:B.maxY,P=[this.chartSizes.chartHeight,0],I=b.copy().domain([E,k]).range([this.chartSizes.chartHeight,i.innerOffset]);b.domain([I.invert(this.chartSizes.chartHeight),I.invert(0)]).range(P),this.scales.y[C]=b})}updateCaptionsSize(e,t){let n=new hc("600 14px Arial"),r=0;function a(i){return Math.max(...i.map(o=>n.getTextWidth(o)))}t.hiddenLabels||Object.values(this.scales.y).forEach(i=>{let{ticks:o,format:s}=T9(i,!1);r=Math.max(r,a(o.map(s)))}),this.captionsSizes={xAxisCaptionsWidth:e.hiddenLabels?0:20,yAxisCaptionsWidth:r}}createMainTitle(e,t){let n=this.chartsDimensions[e[0]],r=this.chartsDimensions[e[e.length-1]];this.mainTitle=Kv(t.name,this.chartSizes.chartsWidth-n.padding.left-r.padding.right,20)}createFacetTitles(e,t){this.facetTitles=e.reduce((n,r,a)=>(t[a].length===1&&t[a][0]==="null"?n[r]=[]:n[r]=Kv(t[a].join(", "),this.chartSizes.chartWidth,14),n),{})}updateLegendSize(e,t,n,r){if(!e.show){this.legend={width:0,height:0,items:[]};return}let a=[],i={width:0,height:0,left:0,top:0};if(r.forEach(A=>{if(_Z(A.aes.fillColor)&&n){let h=A.aes.fillColor.value,v=t[n.value],g=n.label??n.value,C=Qo().domain(v.values).range(v.values.map(b=>v.aesMap[b].fillColor));a.push({...i,id:h,type:"discreteColor",title:g,scale:C,values:v.values,labels:v.labels})}}),!a.length){this.legend={width:0,height:0,items:[]};return}let o=C3(a,this.chartSizes.chartHeight),s=o[o.length-1],c=s.left+s.width+YC,f=this.chartSizes.chartHeight;this.legend={width:c,height:f,items:o}}updateMargins(e){let t=24*this.mainTitle.length,n=t>0?t+24*2:0,r=e.outerOffset;this.margins={top:Math.max(n,r),bottom:r,left:r,right:this.legend.width+r},this.chartSizes.totalWidth=this.margins.left+this.chartSizes.chartsWidth+this.margins.right,this.chartSizes.totalHeight=this.margins.top+this.chartSizes.chartsHeight+this.margins.bottom}render(e,t,n,r,a,i,o,s,c,f,A,h,v){var I;let{xAxis:g,yAxis:C,size:b,title:B}=t;this.updateChartSizes(b),this.updateViewport(r,n,g,C,i,b,A),this.updateCaptionsSize(g,C),this.createFacetTitles(r,a),this.updateChartDimensions(r,n,g,C),this.createMainTitle(r,B),this.updateLegendSize(t.legend,o,f,s),this.updateMargins(b);let E=r.reduce(($,z)=>Math.min($,i[z].minX),1/0),k=r.reduce(($,z)=>Math.max($,i[z].maxX),-1/0),P=ie.jsx(Q9t,{settingsId:e,chartSettings:t,facetKeys:r,facetSettings:n,chartSizes:this.chartSizes,chartsDimensions:this.chartsDimensions,scales:this.scales,columnsCount:this.columnsCount,margins:this.margins,mainTitle:this.mainTitle,facetTitles:this.facetTitles,captionsSizes:this.captionsSizes,histogramDataByFacets:i,layers:s,aesColorGetter:X9t(c,"fillColor",[E,k]),groupingDirection:h,groupingStack:A,groupingLabels:f?o[f.value].labels:{},legend:this.legend,onTooltipHintSwitch:v});this.component=P,(I=this.reactRoot)==null||I.render(P)}renderError(e){var t;(t=this.reactRoot)==null||t.render(ie.jsx(Xv,{message:e}))}},Z9t=K9t,J9t=10,q9t=class{constructor(e){Be(this,"type","bins");Be(this,"aes",{fillColor:"white",lineColor:Vt,opacity:1});this.aes={...this.aes,...e.aes}}},e6t=class{constructor(e){Be(this,"type","binsLine");Be(this,"aes",{opacity:1});this.aes={...this.aes,...e.aes}}},TZ=class{constructor(e){Be(this,"id");Be(this,"type","histogram");Be(this,"valueColumn");Be(this,"binsCount");Be(this,"facetSettings");Be(this,"facetBy");Be(this,"grouping");Be(this,"groupingStack");Be(this,"groupingDirection");Be(this,"groupingOrder");Be(this,"chartSettings");Be(this,"inheritedAes");Be(this,"layers");var t,n,r,a,i,o,s,c,f,A,h;a4t.parse(e),this.id=Zn.uniqueId("settings"),this.facetSettings={sharedX:!0,sharedY:!0,titlePosition:"left",...e.facetSettings},this.valueColumn=e.valueColumn,this.binsCount=e.binsCount??J9t,this.facetBy=e.facetBy??[],this.grouping=e.grouping??null,this.groupingStack=e.groupingStack??"vertical",this.groupingDirection=e.groupingDirection??"straight",this.groupingOrder=e.groupingOrder??null,this.chartSettings={size:{width:((t=e==null?void 0:e.size)==null?void 0:t.width)??(this.facetBy.length?400:600),height:((n=e==null?void 0:e.size)==null?void 0:n.height)??(this.facetBy.length?250:350),outerOffset:((r=e==null?void 0:e.size)==null?void 0:r.outerOffset)??24,innerOffset:((a=e==null?void 0:e.size)==null?void 0:a.innerOffset)??H9t.TOP},title:{position:"center",show:!0,...e.title,name:((i=e.title)==null?void 0:i.name)??"Chart"},yAxis:{showGrid:!0,showTicks:!0,scale:((o=e.xAxis)==null?void 0:o.scale)??"linear",hiddenLabels:!1,...e.yAxis},xAxis:{title:e.valueColumn.label??e.valueColumn.value??"",scale:((s=e.xAxis)==null?void 0:s.scale)??"linear",showGrid:((c=e.xAxis)==null?void 0:c.showGrid)??!0,showTicks:((f=e.xAxis)==null?void 0:f.showTicks)??!0,hiddenLabels:((A=e.xAxis)==null?void 0:A.hiddenLabels)??!1,...e.xAxis},frame:{type:((h=e.frame)==null?void 0:h.type)??"full"},legend:{show:!0,position:"right",...e.legend}},this.inheritedAes=e.inheritedAes??{},this.layers=e.layers.map(v=>{if(v.type==="bins")return new q9t(v);if(v.type==="binsLine")return new e6t(v);d1(v,"Unknown layer type")}).filter(Boolean)}};function kZ(e){if(!e.length)return[];let t=[[]];return e.forEach(n=>{let r=[];n.forEach(a=>{r.push(...t.map(i=>[...i,a]))}),t=r}),t}function t6t(e,t,n){return t.reduce((r,a)=>{let i=Zn.uniqBy(e.rows,f=>f[a.value]),o=f=>String(f[a.value]),s=f=>a.valueLabels?String(f[a.valueLabels]):o(f),c=i.reduce((f,A)=>(f[o(A)]=s(A),f),{});return r[a.value]={values:i.map(o).filter(f=>f!=="null").sort((f,A)=>c[f].localeCompare(c[A],"en",{numeric:!0})),aesMap:n[a.value],labels:c},r},{})}var n6t=class extends zm{constructor(t,n,r){super(t,n);Be(this,"settings");Be(this,"chartRenderer",new Z9t);Be(this,"onTooltipHintSwitch",()=>{});Be(this,"calculatedData",null);this.settings=new TZ(n),r&&(this.onTooltipHintSwitch=r[0])}mount(t){try{this.chartRenderer.init(t),this._updateData(),this._updateChart()}catch(n){n instanceof Error&&this.chartRenderer.renderError(n.message)}}unmount(){this.chartRenderer.clear()}updateSettingsAndData(t,n){try{let r=this.settings,a=this.data;this.settings=new TZ(n),this.data=t,this._needUpdateCalculatedDataBySettings(r,this.settings)||this._needUpdateCalculatedDataByData(a,this.data)?this._updateData():this._updateAesInData(),this._updateChart()}catch(r){r instanceof Error&&this.chartRenderer.renderError(r.message)}}updateChartState(t,n){console.warn("no chart state for histogram")}export(){return this._updateChart(),w5(this.chartRenderer.component)}_needUpdateCalculatedDataBySettings(t,n){var r,a,i,o;return t.valueColumn.value!==n.valueColumn.value||t.facetBy.some((s,c)=>{var f;return s.value!==((f=n.facetBy[c])==null?void 0:f.value)})||((r=t.grouping)==null?void 0:r.value)!==((a=n.grouping)==null?void 0:a.value)||t.layers.length!==n.layers.length||t.layers.some((s,c)=>s.type!==n.layers[c].type)||t.binsCount!==n.binsCount||t.chartSettings.xAxis.scale!==n.chartSettings.xAxis.scale||((i=t.groupingOrder)==null?void 0:i.some((s,c)=>{var f;return s!==((f=n.groupingOrder)==null?void 0:f[c])}))||((o=n.groupingOrder)==null?void 0:o.some((s,c)=>{var f;return s!==((f=t.groupingOrder)==null?void 0:f[c])}))}_needUpdateCalculatedDataByData(t,n){let r=Object.keys(t.data),a=Object.keys(n.data);return t.id!==n.id||r.length!==a.length||r.some(i=>{var o;return t.data[i].length!==((o=n.data[i])==null?void 0:o.length)})}_updateData(){let{valueColumn:t,facetBy:n,grouping:r,binsCount:a,chartSettings:i,inheritedAes:o,groupingOrder:s}=this.settings,c=n.map(C=>this.data.getColumnCategories(C.value)),f=c.length?kZ([...c]):[["null"]],A=n.map(C=>C.value)??null,h=r?[r.value]:[],v=r?this.data.getColumnCategories(r.value):["null"];s&&(v=Zn.intersection(s,v)),this.data.setGrouping([...A,...h]);let g=P9t(this.data,f,v,t,a,i.xAxis.scale);this.calculatedData={facetKeys:f.map(C=>C.join(", ")),facetKeysCombinations:f,histogramDataByFacets:g,legendInfo:t6t(this.data,r?[r]:[],o)}}_updateAesInData(){this.calculatedData}_updateChart(){if(!this.calculatedData)return;let{id:t,chartSettings:n,facetSettings:r,inheritedAes:a,layers:i,grouping:o,groupingDirection:s,groupingStack:c}=this.settings;this.chartRenderer.render(t,n,r,this.calculatedData.facetKeys,this.calculatedData.facetKeysCombinations,this.calculatedData.histogramDataByFacets,this.calculatedData.legendInfo,i,a,o,c,s,this.onTooltipHintSwitch)}};function r6t(e,t,n,r,a,i,o){let s={};return t.forEach(c=>{let f=[],A=1/0,h=1/0,v=-1/0,g=-1/0;o.forEach(C=>{e.getRowsByGrouping([...c,C]).forEach(b=>{let B=b[n.value],E=b[r.value];A=Math.min(A,B),h=Math.min(h,E),v=Math.max(v,B),g=Math.max(g,E),B!==null&&E!==null&&f.push({id:`${Object.values(b)}`,x:B,y:E,label:a?b[a.valueLabels??a.value]:null,dimmed:i?!b[i.value]:!1,data:b})})}),f.sort((C,b)=>C.x-b.x),s[c.join("_")]={minX:A,maxX:v,minY:h,maxY:g,dots:f}}),s}function a6t(e,t,n,r,a){return t.reduce((i,o)=>{let s=n[o].dots;return i[o]=e.map(c=>{if(c.type==="curve")return{type:"curve",info:c,geoms:r.map(f=>{let A=s.filter(v=>a.every((g,C)=>v.data[g.value]===f[C])),h=a.reduce((v,g,C)=>(v[g.value]=f[C],v),{});return{dots:A,data:h}})};if(c.type==="dots")return{type:"dots",info:c,geoms:s};d1(c,"Unknown scatterplot layer type")}),i},{})}function jM(e){let t=e.xPosition!=="middle"&&e.yPosition!=="middle",n=e.padding*(t?.7:1);return e.xPosition==="right"?e.x+n:e.xPosition==="middle"?e.x-e.width/2:e.x-e.width-n}function MZ(e){let t=e.xPosition!=="middle"&&e.yPosition!=="middle",n=e.padding*(t?.7:1);return e.yPosition==="middle"?e.y-e.height/2:e.yPosition==="top"?e.y-n-e.height:e.y+n}function i6t(e,t){return jM(e)-t}function o6t(e,t){return MZ(e)-t}function PZ(e){let t=jM(e),n=t+e.width,r=MZ(e),a=r+e.height;return{minX:t,maxX:n,minY:r,maxY:a}}function HZ(e,t,n){let r=i6t(e,n),a=jM(e)+e.width+n,i=o6t(e,t),o=i+e.height+2*t;return{minX:r,maxX:a,minY:i,maxY:o}}function l6t(e,t,n){return e.minX>=0&&e.maxX<=t&&e.minY>=0&&e.maxY<=n}var fS=2;function s6t(e,t=fS,n=fS){e.forEach(r=>{r.bbox=PZ(r),r.outerBBox=HZ(r,t,n)})}function dS(e,t,n,r=fS,a=fS){let i=[],o=new _dt,s=[["middle","right"],["top","right"],["bottom","right"],["middle","left"],["top","left"],["bottom","left"],["top","middle"],["bottom","middle"]];for(let c of e)for(let[f,A]of s){let h={...c,yPosition:f,xPosition:A};if(h.bbox=PZ(h),h.outerBBox=HZ(h,r,a),l6t(h.outerBBox,t,n)&&!o.collides(h.outerBBox)){i.push(h),o.insert(h.outerBBox);break}}return i}function u6t(e){return`translate(${e},0)`}function c6t(e){return`translate(0,${e})`}function f6t(e){return e==="bottom"?`translate(0,${zf})`:`translate(${-zf},0)`}function d6t(e){return e==="bottom"?"hanging":"central"}function A6t(e){return e==="bottom"?"middle":"end"}var AS=({scale:e,tickSize:t=6,tickPadding:n=zf,orient:r="bottom",onlyPositive:a=!1,offset:i=typeof window<"u"&&window.devicePixelRatio>1?0:.5})=>{function o(b){return B=>{let E=b(B);return E===void 0?0:+E}}let{ticks:s,format:c}=T9(e,a,r==="bottom"),f=Math.max(t,0)+n,A=o(e.copy()),h=r==="bottom"?u6t:c6t,v=r==="left"?-1:1,g={[(r==="left"?"x":"y")+"2"]:v*t},C={[r==="left"?"x":"y"]:v*f};return ie.jsx("g",{children:s.map((b,B)=>ie.jsxs("g",{className:"tick",transform:h(A(b)+i),children:[ie.jsx("line",{stroke:Vt,...g}),ie.jsx("g",{transform:f6t(r),children:ie.jsx("text",{fill:Vt,fontSize:"14px",fontWeight:"500",fontFamily:"Manrope",dominantBaseline:d6t(r),textAnchor:A6t(r),...C,children:c(b)})})]},B))})},h6t=1;function p6t({scaleX:e,scaleY:t,width:n,height:r,axisX:a,axisY:i,frameType:o,updatingKey:s=""}){let[c,f]=tn.useState(e.ticks()),[A,h]=tn.useState(t.ticks()),{significantLines:v=[]}=a,{significantLines:g=[]}=i;return tn.useEffect(()=>{let C=e.ticks().filter(B=>!v.includes(B)),b=t.ticks().filter(B=>!g.includes(B));f(C),h(b)},[e,t,s]),ie.jsxs("g",{stroke:Nf,children:[a.showGrid&&c.map(C=>{let b=e(C);return ie.jsx("line",{x1:b,x2:b,y1:0,y2:r},`x_${b}_${r}`)}),i.showGrid&&A.map(C=>{let b=t(C);return ie.jsx("line",{x1:0,x2:n,y1:b,y2:b},`y_${b}_${n}`)}),ie.jsx("g",{strokeDasharray:Of(a.significantLinesStyle),stroke:Vt,children:v.map(C=>{let b=e(C);return ie.jsx("line",{x1:b,x2:b,y1:0,y2:r},`significant_${b}_${r}`)})}),ie.jsx("g",{strokeDasharray:Of(i.significantLinesStyle),stroke:Vt,children:g.map(C=>{let b=t(C);return ie.jsx("line",{x1:0,x2:n,y1:b,y2:b},`significant_${b}_${n}`)})}),o!=="empty"&&ie.jsxs("g",{strokeWidth:h6t,children:[(a.showGrid||o!=="left")&&ie.jsx("line",{stroke:o==="left"?Nf:Vt,x1:"0",x2:n,y1:r,y2:r}),(a.showGrid||o!=="bottom")&&ie.jsx("line",{stroke:o==="bottom"?Nf:Vt,x1:"0",x2:"0",y1:"0",y2:r}),(a.showGrid||o==="full")&&ie.jsx("line",{stroke:o==="full"?Vt:Nf,x1:n,x2:n,y1:"0",y2:r}),(i.showGrid||o==="full")&&ie.jsx("line",{stroke:o==="full"?Vt:Nf,x1:"0",x2:n,y1:"0",y2:"0"})]})]})}var v6t=new hc("16px Manrope");function DZ(e,t){return typeof e=="string"?e:t.length?t[0].data[e.value]:""}function m6t(e,t,n=[]){let r=e.data,a=[`x: ${Ka(e.x)}`,`y: ${Ka(e.y)}`];t.label&&a.unshift(`${t.label}: ${r[t.label]}`);for(let i of n)a.push(`${i.label}: ${r[i.valueLabels??i.value]}`);return a}function g6t(e){return typeof e.r2>"u"?null:ie.jsxs(ie.Fragment,{children:[ie.jsx("tspan",{children:"R"}),ie.jsx("tspan",{fontSize:"10px",dy:"-8",children:"2"}),ie.jsx("tspan",{dy:"8",children:` = ${Ka(e.r2)}`})]})}function y6t(e){return typeof e.pValue>"u"?null:ie.jsx("tspan",{children:`p-value = ${Ka(e.pValue)}`})}function w6t(e){if(typeof e.coefficients>"u")return null;let{slope:t,slopeError:n,intercept:r,interceptError:a}=e.coefficients;return ie.jsx("tspan",{children:ie.jsx("tspan",{children:`slope = ${Ka(t)} ± ${Ka(n)}, intercept = ${Ka(r)} ± ${Ka(a)}`})})}function b6t(e){let t=[g6t(e),y6t(e),w6t(e)].filter(n=>n!==null);return ie.jsx(ie.Fragment,{children:t.map((n,r)=>ie.jsxs("tspan",{children:[n,ie.jsx("tspan",{children:r<t.length-1&&", "})]},r))})}var UM=3;function $Z(e,t,n,r){if(!r)return[];let a=[];for(let i of e){let o=i.label;if(!o)continue;let s=v6t.getTextMetrics(String(o));a.push({name:String(o),width:(s==null?void 0:s.width)??0,height:((s==null?void 0:s.actualBoundingBoxAscent)??0)+((s==null?void 0:s.actualBoundingBoxDescent)??0),x:t.x(i.x),y:t.y(i.y),xPosition:"right",yPosition:"middle",bbox:{minX:0,maxX:0,minY:0,maxY:0},dot:i,padding:n.dotSize(r.info.aes.dotSize,i.data)+UM})}return a}function C6t({facetKey:e,width:t,height:n,dimensions:r,scales:a,xAxis:i,yAxis:o,frameType:s,dotsData:c,facetSettings:f,trendsData:A,keyColumn:h,margins:v,chartSizes:g,tooltips:C,tooltipsContainer:b,captionsSizes:B,facetTitle:E,onlyPositive:k,layersData:P,aesGetters:I,tooltipsData:$}){let[z,O]=tn.useState(),{padding:K}=r,{dots:te}=c,le=i.showTicks?c3:0,G=o.showTicks?c3:0,Q=DZ(i.title,te),j=DZ(o.title,te),Y=r.chartEdgeSides.includes("left")||!(f!=null&&f.sharedY),X=r.chartEdgeSides.includes("bottom")||!(f!=null&&f.sharedX),ee=r.chartEdgeSides.includes("left"),pe=r.chartEdgeSides.includes("bottom"),ae={left:v.left+r.left+K.left,right:g.totalWidth-(v.left+r.left+K.left),top:v.top+r.top+K.top,bottom:g.totalHeight-(v.top+r.top+K.top)},ge=!1,[me,fe]=tn.useState(()=>$Z(te,a,I,P.find(Oe=>Oe.type==="dots"))),[Ce,De]=tn.useState(()=>dS(me,t,n,UM,UM)),[ke,$e]=tn.useState(null);tn.useEffect(()=>{fe($Z(te,a,I,P.find(Oe=>Oe.type==="dots")))},[te,a,I,P]),tn.useEffect(()=>{let Oe=dS(me,t,n);De(Oe)},[me,t,n]);let je=z&&$.fixed;return ie.jsxs("g",{transform:`translate(${r.left+K.left},${r.top+K.top})`,children:[ge,E.length&&ie.jsxs("g",{children:[s==="full"&&ie.jsx("rect",{x:"0",y:-K.top,height:K.top,width:t,fill:"#F7F8FA",stroke:Vt}),E.map((Oe,ft)=>{let ze=E.length,Xe=(K.top-xM*ze)/2;return ie.jsx("text",{fontSize:"14px",fontWeight:"500",fill:Vt,x:t/2,dy:Xe+xM/2-K.top,y:ft*xM,textAnchor:"middle",dominantBaseline:"central",children:Oe},ft)})]}),ie.jsxs("g",{dominantBaseline:"central",textAnchor:"middle",fontWeight:"500",fontSize:"14px",fill:Vt,children:[pe&&ie.jsx("text",{x:t/2,y:n+K.bottom-Yv-g9/2,children:Q}),ge,ee&&ie.jsx("text",{x:-K.left+Yv+g9/2,y:n/2,transform:`rotate(-90,${-K.left+Yv+g9/2},${n/2})`,children:j}),ge]}),ie.jsx(p6t,{width:t,height:n,scaleX:a.x,scaleY:a.y,axisX:i,axisY:o,frameType:s}),X&&ie.jsxs("g",{transform:`translate(0,${n})`,children:[ie.jsx(AS,{scale:a.x,orient:"bottom",onlyPositive:k.x,tickSize:le}),ge]}),Y&&ie.jsxs("g",{children:[ie.jsx(AS,{scale:a.y,orient:"left",onlyPositive:k.y,tickSize:G}),ge]}),A&&A.map(({predict:Oe,getArea:ft,color:ze,data:Xe,bounded:tt,xBounds:qe,stats:gt},wt)=>{let[Xt,rr]=tt?qe:a.x.domain(),sr=(rr-Xt)/15,ra=Oe(Xt),mi=Oe(rr);if(isNaN(ra)||isNaN(mi))return null;let ea=I.dotColor(ze,Xe);return ie.jsxs("g",{children:[ie.jsx("text",{y:wt*20+20,fill:ea,x:t-8,textAnchor:"end",children:b6t(gt)}),ie.jsx("path",{d:ft(a.x,a.y,Zn.range(Xt,rr+sr/2,sr)),fill:ea,opacity:.2}),ie.jsx("line",{x1:a.x(Xt),x2:a.x(rr),y1:a.y(ra),y2:a.y(mi),stroke:ea})]},wt)}),P.map((Oe,ft)=>{if(Oe.type==="dots")return ie.jsxs("g",{children:[te.map(ze=>{let Xe=je&&$.selectedData===ze,tt=ie.jsx("g",{transform:`translate(${a.x(ze.x)},${a.y(ze.y)})`,opacity:ze.dimmed?.3:1,onMouseOver:()=>$.onMouseOver(ze,e),onMouseLeave:()=>$.onMouseLeave(),children:Yc(I.dotShape(Oe.info.aes.dotShape,ze.data),I.dotSize(Oe.info.aes.dotSize,ze.data),I.dotColor(Oe.info.aes.dotFill,ze.data))},ze.id);return Xe?cu.createPortal(tt,z):tt}),Ce.map(ze=>{let{name:Xe,height:tt,bbox:qe,width:gt}=ze;return ie.jsx("g",{children:ie.jsxs("g",{transform:`translate(${qe.minX},${qe.minY})`,children:[ie.jsx("rect",{x:"0",y:"0",width:gt,height:tt,fill:"transparent",stroke:"none",onMouseOver:()=>$e(ze.dot),onMouseLeave:()=>$e(null)}),ie.jsx("text",{x:0,y:tt/2,stroke:"white",strokeWidth:2,paintOrder:"stroke",style:{pointerEvents:"none"},fontFamily:"Manrope",fontSize:"16px",dominantBaseline:"middle",children:Xe})]})},ze.dot.id)}),ke&&ie.jsxs("g",{transform:`translate(${a.x(ke.x)},${a.y(ke.y)})`,children:[Yc(I.dotShape(Oe.info.aes.dotShape,ke.data),I.dotSize(Oe.info.aes.dotSize,ke.data)+1,"white","white"),Yc(I.dotShape(Oe.info.aes.dotShape,ke.data),I.dotSize(Oe.info.aes.dotSize,ke.data),I.dotColor(Oe.info.aes.dotFill,ke.data))]},"activeDot")]},ft);if(Oe.type==="curve"&&!Oe.info.smoothing)return Oe.geoms.map((ze,Xe)=>ie.jsx("g",{children:ie.jsx("polyline",{points:ze.dots.map(tt=>`${a.x(tt.x)},${a.y(tt.y)}`).join(" "),fill:"none",stroke:I.lineColor(Oe.info.aes.lineColor,ze.data),strokeWidth:Oe.info.aes.lineWidth,strokeDasharray:Of(Oe.info.aes.lineShape)})},Xe));if(Oe.type==="curve"&&Oe.info.smoothing)return Oe.geoms.map((ze,Xe)=>ie.jsx("g",{children:ie.jsx("path",{d:b5().curve(C5).x(tt=>a.x(tt.x)).y(tt=>a.y(tt.y))(ze.dots)??"",fill:"none",stroke:I.lineColor(Oe.info.aes.lineColor,ze.data),strokeWidth:Oe.info.aes.lineWidth,strokeDasharray:Of(Oe.info.aes.lineShape)})},Xe))}),C.show&&$.selectedData&&$.currentFacet===e&&ie.jsx(fu,{content:m6t($.selectedData,h,C==null?void 0:C.content),x:a.x($.selectedData.x),y:a.y($.selectedData.y),active:!0,sideDistances:ae,fixed:$.fixed,onClose:$.onClose,container:b}),ie.jsxs("g",{children:[$.fixed&&ie.jsx("rect",{width:g.chartWidth,height:g.chartHeight,fill:"rgba(255, 255, 255, 0.8)"}),ie.jsx("g",{ref:Oe=>{Oe&&!z&&O(Oe)}})]})]})}function S6t({settingsId:e,chartSettings:t,chartSizes:n,chartsDimensions:r,facetKeys:a,facetSettings:i,scales:o,groupedDots:s,legendData:c,trendsData:f,columnsCount:A,margins:h,keyColumn:v,mainTitle:g,facetTitles:C,captionsSizes:b,onlyPositive:B,layersData:E,aesGetters:k,onTooltipHintSwitch:P}){let I=h3(P),[$,z]=tn.useState(),O=tn.useRef(null);tn.useEffect(()=>{O.current&&z(O.current)},[]);let{xAxis:K,yAxis:te,title:le,frame:G,legend:Q,tooltips:j}=t,Y=r[a[0]].padding,X=r[a[A-1]].padding,ee=n.chartsWidth+YC,pe=Y.top;return ie.jsx(g3,{dataId:e,children:ie.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${n.totalWidth} ${n.totalHeight}`,width:n.totalWidth,height:n.totalHeight,children:[ie.jsx("defs",{children:Qm}),ie.jsxs("g",{transform:`translate(${h.left},${h.top})`,fontFamily:"Manrope",children:[ie.jsx(y3,{title:g,show:le.show,position:le.position,leftPadding:Y.left,rightPadding:X.right,chartsWidth:n.chartsWidth}),a.map(ae=>ie.jsx(C6t,{facetKey:ae,scales:{x:o.x[ae],y:o.y[ae]},width:n.chartWidth,height:n.chartHeight,dimensions:r[ae],margins:h,chartSizes:n,facetSettings:i,xAxis:K,yAxis:te,frameType:G.type,dotsData:s[ae],trendsData:f?f[ae]:null,tooltips:j,tooltipsContainer:$,keyColumn:v,facetTitle:C[ae],captionsSizes:b,layersData:E[ae],onlyPositive:B,aesGetters:k,tooltipsData:I},ae)),Q.show&&ie.jsx("g",{transform:`translate(${ee},${pe})`,children:ie.jsx(w3,{legendData:c})})]}),ie.jsx("g",{ref:O,style:{outline:"none"}})]})})}function x6t(e,t,n,r){let a=[];return e%n===n-1&&a.push("right"),e%n===0&&a.push("left"),e<n&&a.push("top"),(Math.ceil((e+1)/n)===r||Math.ceil((e+1)/n)===r-1&&e%n>(t-1)%n)&&a.push("bottom"),a}function E6t(e,t,n,r,a,i,o){let s=i.includes("left")||!(o!=null&&o.sharedY),c=i.includes("left")&&t.title!=="",f=i.includes("bottom")||!(o!=null&&o.sharedX),A=i.includes("bottom")&&e.title!=="",h=n.yAxisCaptionsWidth+2*EM,v=(t.showTicks?c3:0)+EM,g=c?g9+Yv:0,C=n.xAxisCaptionsWidth+2*EM,b=e.showTicks?c3:0,B=A?g9+Yv:0,E=h+v+g+ZX,k=C+b+B+ZX,P=Math.max(...r.map(I=>a[I].length));return{left:s?E:Yv,top:P===0?0:u3t*2+P*x9,bottom:f?k+8:Yv,right:Yv}}function B6t(e,t,n){let r=[];for(let a=0;a<t;a++)r.push(e.slice(a*n,a*n+n));return r}function _6t(e,t){let n=Math.floor(e/t),r=e-n*t;return[n,r]}function T6t(e){return typeof e=="object"&&e!==null&&"type"in e&&"value"in e&&e.type==="grouping"}function k3(e,t){return function(n,r){var a,i;if(oh(n)&&t==="dotSize"){let{domain:o,range:s}=n,c=cv().domain(o).range(s)(Number(r[n.columnName.value]));return Math.max(1,c)}if(oh(n)&&(t==="dotFill"||t==="lineColor")){let{domain:o,range:s,type:c="linear"}=n,f=k9(s,o,c),A=r[n.columnName.value];return A===null?Gv.color:f(Number(A))}if(T6t(n)){let o=n.value;return(i=((a=e[o])==null?void 0:a[String(r[o])])??m9)==null?void 0:i[t]}return n}}function k6t(e){return{dotShape:k3(e,"dotShape"),dotColor:k3(e,"dotFill"),dotSize:k3(e,"dotSize"),lineShape:k3(e,"lineShape"),lineColor:k3(e,"lineColor"),trendColor:k3(e,"dotFill")}}var M6t=class{constructor(){Be(this,"reactRoot",null);Be(this,"parentNode",null);Be(this,"rootNode",null);Be(this,"component",ie.jsx(ie.Fragment,{}));Be(this,"margins",{top:Gc,bottom:Gc,left:Gc,right:Gc});Be(this,"chartsDimensions",{});Be(this,"chartSizes",{chartWidth:600,chartHeight:350,chartsWidth:600,chartsHeight:350,totalWidth:600,totalHeight:350});Be(this,"columnsCount",1);Be(this,"rowsCount",1);Be(this,"scales",{x:{null:Zr().domain([0,10]).range([0,600])},y:{null:Zr().domain([0,10]).range([350,0])}});Be(this,"captionsSizes",{xAxisCaptionsWidth:30,yAxisCaptionsWidth:100});Be(this,"facetTitles",{});Be(this,"mainTitle",[]);Be(this,"legend",{width:0,height:0,items:[]})}clear(){var e;this.parentNode&&this.rootNode&&((e=this.parentNode)==null||e.removeChild(this.rootNode),this.parentNode=null,this.rootNode=null),setTimeout(()=>{var t;(t=this.reactRoot)==null||t.unmount(),this.reactRoot=null})}init(e){this.parentNode===null&&(this.parentNode=e,this.rootNode=document.createElement("div"),this.parentNode.appendChild(this.rootNode),this.reactRoot=Wh(this.rootNode))}updateChartSizes(e){this.chartSizes.chartWidth=e.width,this.chartSizes.chartHeight=e.height}updateChartDimensions(e,t,n,r){let{chartWidth:a,chartHeight:i}=this.chartSizes,o=0,s=0;this.chartsDimensions=e.reduce((A,h,v)=>{let[g,C]=_6t(v,this.columnsCount),b=x6t(v,e.length,this.columnsCount,this.rowsCount),B=E6t(n,r,this.captionsSizes,B6t(e,this.rowsCount,this.columnsCount)[g],this.facetTitles,b,t),E=a+B.left+B.right,k=i+B.top+B.bottom;return A[h]={left:o,top:s,chartEdgeSides:b,padding:B,inner:{width:a,height:i},outer:{width:E,height:k}},o+=E,C===this.columnsCount-1&&(o=0,s+=k),A},{});let c=Math.max(...e.map(A=>this.chartsDimensions[A].outer.width+this.chartsDimensions[A].left)),f=Math.max(...e.map(A=>this.chartsDimensions[A].outer.height+this.chartsDimensions[A].top));this.chartSizes.chartsWidth=c,this.chartSizes.chartsHeight=f}updateViewport(e,t,n,r,a,i){let o=e.length,s=Math.min(t.nRows??o,o),c=Math.min(t.nCols??o,o);this.columnsCount=t.nRows?Math.ceil(o/s):c,this.rowsCount=Math.ceil(o/this.columnsCount);let[f,A]=[1/0,-1/0],[h,v]=[1/0,-1/0],g=e.reduce((b,B)=>{let E=a[B],{minX:k,minY:P,maxX:I,maxY:$}=E;return f=Math.min(f,k),h=Math.min(h,P),A=Math.max(A,I),v=Math.max(v,$),b[B]={minX:k,maxX:I,minY:P,maxY:$},b},{});e.forEach(b=>{let B=n.scale==="log"?X2():Zr(),E=g[b],k=n.lowerValue?Number(n.lowerValue):t.sharedX?f:E.minX,P=n.upperValue?Number(n.upperValue):t.sharedX?A:E.maxX;if(typeof n.symmetricRange<"u"){let z=n.symmetricRange;if(z>=k&&z<=P){let O=Math.max(z-k,P-z);k=z-O,P=z+O}}let I=[0,this.chartSizes.chartWidth],$=B.copy().domain([k,P]).range([GC.LEFT,this.chartSizes.chartWidth-GC.RIGHT]);B.domain([$.invert(0),$.invert(this.chartSizes.chartWidth)]).range(I).nice(),this.scales.x[b]=B});let C=e.reduce((b,B)=>{let E=i?i[B]:[];return b[B]=E.reduce((k,P)=>{let I=P.bounded?P.xBounds:this.scales.x[B].domain(),$=P.getInterval(I[0]),z=P.getInterval(I[1]);return k.minY=Math.min(k.minY,isNaN($.left)?k.minY:$.left,isNaN(z.left)?k.minY:z.left),k.maxY=Math.max(k.maxY,isNaN($.right)?k.maxY:$.right,isNaN(z.right)?k.maxY:z.right),k},{minY:1/0,maxY:-1/0}),h=Math.min(h,b[B].minY),v=Math.max(v,b[B].maxY),b},{});e.forEach(b=>{let B=r.scale==="log"?X2():Zr(),E=g[b],k=C[b],P=r.lowerValue?Number(r.lowerValue):t.sharedY?h:Math.min(E.minY,k.minY),I=r.upperValue?Number(r.upperValue):t.sharedY?v:Math.max(E.maxY,k.maxY);if(typeof r.symmetricRange<"u"){let O=r.symmetricRange;if(O>=P&&O<=I){let K=Math.max(O-P,I-O);P=O-K,I=O+K}}let $=[this.chartSizes.chartHeight,0],z=B.copy().domain([P,I]).range([this.chartSizes.chartHeight-GC.BOTTOM,GC.TOP]);B.domain([z.invert(this.chartSizes.chartHeight),z.invert(0)]).range($).nice(),this.scales.y[b]=B})}updateCaptionsSize(e){let t=new hc("600 14px Arial"),n=0;function r(a){return Math.max(...a.map(i=>t.getTextWidth(i)))}Object.values(this.scales.y).forEach(a=>{let{ticks:i,format:o}=T9(a,e);n=Math.max(n,r(i.map(o)))}),this.captionsSizes={xAxisCaptionsWidth:20,yAxisCaptionsWidth:n}}createMainTitle(e,t){let n=this.chartsDimensions[e[0]],r=this.chartsDimensions[e[e.length-1]];this.mainTitle=Kv(t.name,this.chartSizes.chartsWidth-n.padding.left-r.padding.right,20)}createFacetTitles(e,t){this.facetTitles=e.reduce((n,r,a)=>(t[a].length===1&&t[a][0]==="null"?n[r]=[]:n[r]=Kv(t[a].join(", "),this.chartSizes.chartWidth,14),n),{})}updateMargins(){let e=24*this.mainTitle.length,t=e>0?e+24*2:0;this.margins={top:Math.max(t,Gc),bottom:Gc,left:Gc,right:this.legend.width+Gc},this.chartSizes.totalWidth=this.margins.left+this.chartSizes.chartsWidth+this.margins.right,this.chartSizes.totalHeight=this.margins.top+Math.max(this.chartSizes.chartsHeight,this.legend.height)+this.margins.bottom}updateLegendSize(e,t,n,r){if(!e.show){this.legend={width:0,height:0,items:[]};return}let a=[],i={width:0,height:0,left:0,top:0};if(n.forEach(A=>{let h=t[A.value];if(h.usedAes.length===0||!h.aesMap)return;if(h.values.length>100){console.warn(`Too many values for discrete legend (${h.values.length})`);return}let v={};h.values.forEach(b=>{v[b]||(v[b]={...Gv}),h.usedAes.forEach(B=>{var E,k,P;(B==="dotFill"||B==="lineColor")&&(v[b].color=((E=h.aesMap[b])==null?void 0:E[B])??Vt),B==="dotShape"&&(v[b].shape=((k=h.aesMap[b])==null?void 0:k[B])??"21"),B==="dotSize"&&(v[b].size=((P=h.aesMap[b])==null?void 0:P[B])??3)})});let g=A.label??A.value,C=Qo().domain(h.values).range(h.values.map(b=>v[b])).unknown(Gv);a.push({...i,id:A.value,type:"dots",title:g,scale:C,values:h.values,labels:h.labels})}),r.forEach(A=>{if(A.type==="dots"&&oh(A.aes.dotFill)){let{domain:h,range:v,columnName:g,type:C="linear"}=A.aes.dotFill,b=g.label??g.value,B=k9(v,h,"linear"),E=(C==="log"?uv():Zr()).domain(h).range([this.chartSizes.chartHeight,0]),k=A3(E,h);a.push({...i,id:"dotFill",type:"continuous",title:b,scale:B,tickPositionScale:E,values:k})}if(A.type==="dots"&&oh(A.aes.dotSize)){let{columnName:h,domain:v,range:g}=A.aes.dotSize,C=h.label??h.value,b=cv(v,g),B=b.ticks(3),E=b.tickFormat(3),k=B.reduce((P,I)=>(P[String(I)]=E(I),P),{});a.push({...i,id:h.value,type:"size",title:C,scale:b,values:B,labels:k})}}),!a.length){this.legend={width:0,height:0,items:[]};return}let o=C3(a,this.chartSizes.chartHeight),s=o[o.length-1],c=s.left+s.width+YC,f=this.chartSizes.chartHeight;this.legend={width:c,height:f,items:o}}render(e,t,n,r,a,i,o,s,c,f,A,h,v,g,C){var $;let{xAxis:b,yAxis:B,size:E,title:k,legend:P}=t;this.updateChartSizes(E),this.updateViewport(r,n,b,B,i,o),this.updateCaptionsSize(c.y),this.createFacetTitles(r,a),this.updateChartDimensions(r,n,b,B),this.updateLegendSize(P,f,v,g),this.createMainTitle(r,k),this.updateMargins();let I=ie.jsx(S6t,{settingsId:e,chartSettings:t,facetKeys:r,facetSettings:n,chartSizes:this.chartSizes,chartsDimensions:this.chartsDimensions,scales:this.scales,groupedDots:i,trendsData:o,legendData:this.legend,columnsCount:this.columnsCount,margins:this.margins,keyColumn:s,mainTitle:this.mainTitle,facetTitles:this.facetTitles,captionsSizes:this.captionsSizes,onlyPositive:c,layersData:A,aesGetters:k6t(h),onTooltipHintSwitch:C});this.component=I,($=this.reactRoot)==null||$.render(I)}renderError(e){var t;(t=this.reactRoot)==null||t.render(ie.jsx(Xv,{message:e}))}},P6t=M6t,H6t=class{constructor(e){Be(this,"type","dots");Be(this,"aes",{dotFill:Vt,dotShape:"21",dotSize:3,opacity:1});this.aes={...this.aes,...e.aes}}},D6t=class{constructor(e){Be(this,"type","curve");Be(this,"smoothing");Be(this,"aes",{lineColor:Vt,lineWidth:1,lineShape:"solid",opacity:1});this.smoothing=e.smoothing??!1,this.aes={...this.aes,...e.aes}}},IZ=class{constructor(e){Be(this,"id");Be(this,"type","scatterplot");Be(this,"keyColumn");Be(this,"facetSettings");Be(this,"x");Be(this,"y");Be(this,"facetBy");Be(this,"grouping");Be(this,"label");Be(this,"highlight");Be(this,"chartSettings");Be(this,"inheritedAes");Be(this,"trend");Be(this,"layers");var t,n,r,a;Q3t.parse(e),this.id=Zn.uniqueId("settings"),this.keyColumn=e.keyColumn,this.facetSettings={sharedX:!0,sharedY:!0,titlePosition:"left",...e.facetSettings},this.x=e.x,this.y=e.y,this.facetBy=e.facetBy??[],this.grouping=e.grouping??[],this.label=e.label??null,this.highlight=e.highlight??null,this.chartSettings={size:{width:((t=e==null?void 0:e.size)==null?void 0:t.width)??(this.facetBy.length?400:600),height:((n=e==null?void 0:e.size)==null?void 0:n.height)??(this.facetBy.length?250:350)},title:{position:"center",show:!0,...e.title,name:((r=e.title)==null?void 0:r.name)??"Chart"},yAxis:{title:e.y.label??e.y.value,scale:"linear",showGrid:!0,showTicks:!0,...e.yAxis},xAxis:{title:e.x.label??e.x.value,scale:"linear",showGrid:!0,showTicks:!0,...e.xAxis},frame:{type:((a=e.frame)==null?void 0:a.type)??"full"},legend:{show:!0,position:"right",...e.legend},tooltips:{show:!0,...e.tooltips}},this.inheritedAes=e.inheritedAes??{},this.trend=e!=null&&e.trend?{bounded:e.trend.bounded??!1,color:e.trend.color??Vt}:null,this.layers=e.layers.map(i=>{if(i.type==="dots")return new H6t(i);if(i.type==="curve")return new D6t(i);d1(i,"Unknown layer type")}).filter(Boolean)}},$6t=tpt(J5t()),LZ=.05;function I6t(e){let t=3.3871328727963665,n=133.14166789178438,r=1971.5909503065513,a=13731.69376550946,i=45921.95393154987,o=67265.7709270087,s=33430.57558358813,c=2509.0809287301227,f=42.31333070160091,A=687.1870074920579,h=5394.196021424751,v=21213.794301586597,g=39307.89580009271,C=28729.085735721943,b=5226.495278852854,B=1.4234371107496835,E=4.630337846156546,k=5.769497221460691,P=3.6478483247632045,I=1.2704582524523684,$=.2417807251774506,z=.022723844989269184,O=.0007745450142783414,K=2.053191626637759,te=1.6763848301838038,le=.6897673349851,G=.14810397642748008,Q=.015198666563616457,j=.0005475938084995345,Y=10507500716444169e-25,X=6.657904643501103,ee=5.463784911164114,pe=1.7848265399172913,ae=.29656057182850487,ge=.026532189526576124,me=.0012426609473880784,fe=27115555687434876e-21,Ce=20103343992922881e-23,De=.599832206555888,ke=.1369298809227358,$e=.014875361290850615,je=.0007868691311456133,Oe=18463183175100548e-21,ft=1421511758316446e-22,ze=20442631033899397e-31,Xe=e-.5,tt,qe;return Math.abs(Xe)<=.425?(tt=.180625-Xe*Xe,qe=Xe*(((((((c*tt+s)*tt+o)*tt+i)*tt+a)*tt+r)*tt+n)*tt+t)/(((((((b*tt+C)*tt+g)*tt+v)*tt+h)*tt+A)*tt+f)*tt+1),qe):(tt=e,tt=Math.sqrt(-Math.log(tt)),tt<=5?(tt+=-1.6,qe=(((((((O*tt+z)*tt+$)*tt+I)*tt+P)*tt+k)*tt+E)*tt+B)/(((((((Y*tt+j)*tt+Q)*tt+G)*tt+le)*tt+te)*tt+K)*tt+1)):(tt+=-5,qe=(((((((Ce*tt+fe)*tt+me)*tt+ge)*tt+ae)*tt+pe)*tt+ee)*tt+X)/(((((((ze*tt+ft)*tt+Oe)*tt+je)*tt+$e)*tt+ke)*tt+De)*tt+1)),qe=-qe,qe)}function RZ(e,t){let{sin:n,cos:r,sqrt:a,pow:i,exp:o,PI:s}=Math,c,f;if(t==1)return r(e*s/2)/n(e*s/2);if(t==2)return a(2/(e*(2-e))-2);let A=1/(t-.5),h=48/(A*A),v=((20700*A/h-98)*A-16)*A+96.36,g=((94.5/(h+v)-3)/h+1)*a(A*s*.5)*t;return c=g*e,f=i(c,2/t),f>.05+A?(c=I6t(e/2),f=c*c,t<5&&(v=v+.3*(t-4.5)*(c+.6)),v=(((.05*g*c-5)*c-7)*c-2)*c+h+v,f=(((((.4*f+6.3)*f+36)*f+94.5)/v-f-3)/h+1)*c,f=A*f*f,f>.002?f=o(f)-1:f=.5*f*f+f):f=((1/(((t+6)/(t*f)-.089*g-.822)*(t+2)*3)+.5/(t+4))*f-1)*(t+1)/(t+2)+1/f,a(t*f)}function L6t(e){let t=e.length,n=0,r=0,a=0,i=0;for(let c=0;c<e.length;++c){let f=e[c].x,A=e[c].y;if(!Number.isFinite(f)||!Number.isFinite(A)){--t;continue}n+=f,r+=A,a+=f*A,i+=f*f}let o=(t*a-n*r)/(t*i-n*n),s=(r-o*n)/t;return[o,s]}function R6t(e,t,n){let r=A=>A*t+n,a=e.length,i=lc(e,A=>A.x)/e.length,o=RZ(LZ,a-2),s=Math.sqrt(lc(e,A=>(A.y-r(A.x))**2)/(a-2)/lc(e,A=>(A.x-i)**2)),c=s*o,f=s*Math.sqrt(lc(e,A=>A.x**2)/a)*o;return{slope:t,intercept:n,slopeError:c,interceptError:f}}function V6t(e,t){let n=lc(e,s=>s.x)/e.length,r=0,a=0;for(let s=0;s<e.length;++s)r+=Math.pow(e[s].x-n,2),a+=Math.pow(e[s].y-t(e[s].x),2);let i=Math.sqrt(a/(e.length-2)),o=RZ(LZ,e.length-2);return function(s){let c=t(s),f=i*Math.sqrt(1/e.length+Math.pow(s-n,2)/r),A=c-o*f,h=c+o*f;return{x:s,y:c,left:isNaN(A)?c:A,right:isNaN(h)?c:h}}}function N6t(e){let t=e.length;return Math.pow((t*lc(e,n=>n.x*n.y)-lc(e,n=>n.x)*lc(e,n=>n.y))/(Math.sqrt(t*lc(e,n=>n.x*n.x)-Math.pow(lc(e,n=>n.x),2))*Math.sqrt(t*lc(e,n=>n.y*n.y)-Math.pow(lc(e,n=>n.y),2))),2)}function z6t(e,t){let n=Vs(e,t);return Vs(e.map(r=>(t(r)-n)**2))}function VZ(e,t){return Math.sqrt(z6t(e,t))}function O6t(e,t,n){let r=Vs(e,t),a=Vs(e,n),i=e.length;return lc(e,o=>(o.x-r)*(o.y-a))/i}function F6t(e){let t=O6t(e,a=>a.x,a=>a.y),n=VZ(e,a=>a.x),r=VZ(e,a=>a.y);return t/(n*r)}function Q6t(e,t){let n=e.length,r=1,a=1,i=n-r-1,o=Vs(e,v=>v.y),s=lc(e,v=>(t(v.x)-o)**2),c=lc(e,v=>(t(v.x)-v.y)**2),f=s/a,A=c/i,h=f/A;return 1-(0,$6t.default)(h,a,i)}function j6t(e,t,n,r,a){return a?t.reduce((i,o)=>{let s=e[o].dots;return i[o]=n.map(c=>{let f=s.filter(B=>r.every((E,k)=>String(B.data[E.value])===c[k])),[A=0,h=0]=H0(f,B=>B.x),[v,g]=L6t(f),C=B=>v*B+g,b=V6t(f,C);return{predict:C,getInterval:b,getArea:(B,E,k)=>XB().x(P=>B(P.x)).y0(P=>E(P.left)).y1(P=>E(P.right))(k.map(b))??"",color:a.color,bounded:a.bounded,data:f[0].data,showStats:!0,xBounds:[A,h],stats:{r2:N6t(f),r:F6t(f),pValue:Q6t(f,C),coefficients:R6t(f,v,g)}}}),i},{}):null}function NZ(e){if(!e.length)return[];let t=[[]];return e.forEach(n=>{let r=[];n.forEach(a=>{r.push(...t.map(i=>[...i,a]))}),t=r}),t}function zZ(e){return typeof e=="object"&&"type"in e&&e.type==="grouping"}function U6t(e,t,n,r){return t.reduce((a,i)=>{let o=h=>String(h[i.value]),s=h=>i.valueLabels?String(h[i.valueLabels]):o(h),c=new Set;n.forEach(h=>{h.aes&&Object.entries(h.aes).forEach(([v,g])=>{zZ(g)&&g.value===i.value&&c.add(v)})});let f={},A=[];if(c.has("dotFill")){let h=e.getColumnCategories(i.value);if(h.length>100)A=h,f={};else{let v=Zn.uniqBy(e.rows,g=>g[i.value]);f=v.reduce((g,C)=>(g[o(C)]=s(C),g),{}),A=v.map(o).sort((g,C)=>f[g].localeCompare(f[C],"en",{numeric:!0}))}}return a[i.value]={values:A,usedAes:[...c],aesMap:r[i.value],labels:f},a},{})}var G6t=class extends zm{constructor(t,n,r){super(t,n);Be(this,"settings");Be(this,"chartRenderer",new P6t);Be(this,"onTooltipHintSwitch",()=>{});Be(this,"calculatedData",null);this.settings=new IZ(n),r&&(this.onTooltipHintSwitch=r[1])}mount(t){try{this.chartRenderer.init(t),this._updateData(),this._updateChart()}catch(n){n instanceof Error&&this.chartRenderer.renderError(n.message)}}unmount(){this.chartRenderer.clear()}updateSettingsAndData(t,n){try{let r=this.settings,a=this.data;this.settings=new IZ(n),this.data=t,this._needUpdateCalculatedDataBySettings(r,this.settings)||this._needUpdateCalculatedDataByData(a,this.data)?this._updateData():this._updateAesInData(),this._updateChart()}catch(r){r instanceof Error&&this.chartRenderer.renderError(r.message)}}updateChartState(t,n){console.warn("no chart state for scatterplot")}export(){return this._updateChart(),w5(this.chartRenderer.component)}_needUpdateCalculatedDataBySettings(t,n){var r,a,i,o;return t.facetBy.some((s,c)=>{var f;return s.value!==((f=n.facetBy[c])==null?void 0:f.value)})||t.grouping.length!==n.grouping.length||t.grouping.some((s,c)=>{var f;return s.value!==((f=n.grouping[c])==null?void 0:f.value)})||(((r=t.label)==null?void 0:r.value)||((a=n.label)==null?void 0:a.value))&&((i=t.label)==null?void 0:i.value)!==((o=n.label)==null?void 0:o.value)||t.layers.length!==n.layers.length||t.layers.some((s,c)=>s.type!==n.layers[c].type)||!!t.trend!=!!n.trend}_needUpdateCalculatedDataByData(t,n){let r=Object.keys(t.data),a=Object.keys(n.data);return t.id!==n.id||r.length!==a.length||r.some(i=>{var o;return t.data[i].length!==((o=n.data[i])==null?void 0:o.length)})}_updateData(){let{x:t,y:n,facetBy:r,grouping:a,keyColumn:i,trend:o,layers:s,inheritedAes:c,label:f,highlight:A}=this.settings,h=this.data.getColumnCategories(i.value),v=r.map(O=>this.data.getColumnCategories(O.value)),g=a.map(O=>this.data.getColumnCategories(O.value)),C=v.length?NZ([...v]):[["null"]],b=g.length?NZ([...g]):[["null"]],B=r.map(O=>O.value)??null;this.data.setGrouping([...B,i.value]);let E={x:this.data.rows.every(O=>{let K=O[t.value];return K===null||!(Number(K)<0)}),y:this.data.rows.every(O=>{let K=O[n.value];return K===null||!(Number(K)<0)})},k=r6t(this.data,C,t,n,f,A,h),P=Object.keys(k),I=j6t(k,P,b,a,o),$=U6t(this.data,a,s,c),z=a6t(s,P,k,b,a);this.calculatedData={onlyPositive:E,dotsByFacets:k,facetKeys:P,facetKeysCombinations:C,trendsData:I,legendLabels:$,layersData:z}}_updateAesInData(){let t=this.calculatedData;if(!t)return;let{grouping:n,trend:r,layers:a,inheritedAes:i}=this.settings,{facetKeys:o,trendsData:s}=t;o.forEach(c=>{for(let f=0;f<a.length;f++)t.layersData[c][f].info=a[f]}),n.forEach(c=>{let f=new Set;a.forEach(A=>{A.aes&&Object.entries(A.aes).forEach(([h,v])=>{zZ(v)&&v.value===c.value&&f.add(h)})}),t.legendLabels[c.value].usedAes=[...f],t.legendLabels[c.value].aesMap=i[c.value]}),s&&r&&Object.keys(s).forEach(c=>{s[c].forEach(f=>{f.color=r.color,f.bounded=r.bounded})})}_updateChart(){if(!this.calculatedData)return;let{id:t,chartSettings:n,facetSettings:r,grouping:a,keyColumn:i,inheritedAes:o,layers:s}=this.settings;this.chartRenderer.render(t,n,r,this.calculatedData.facetKeys,this.calculatedData.facetKeysCombinations,this.calculatedData.dotsByFacets,this.calculatedData.trendsData,i,this.calculatedData.onlyPositive,this.calculatedData.legendLabels,this.calculatedData.layersData,o,a,s,this.onTooltipHintSwitch)}},hS={TOP:30,BOTTOM:30,LEFT:30,RIGHT:30},M9=20,OZ=4,FZ=24;function Y6t(e,t,n=[]){let r=e.data,a=[`x: ${Ka(e.x)}`,`y: ${Ka(e.y)}`];t!=null&&t.label&&a.unshift(`${t.label}: ${r[t.label]}`);for(let i of n)a.push(`${i.label}: ${r[i.valueLabels??i.value]}`);return a}function QZ(e){return typeof e=="string"?e:e.label??e.value}var jZ=b5().curve(C5);function W6t({scales:e,chartSettings:t,mainTitle:n,keyColumn:r,margins:a,chartSizes:i,onlyPositive:o,container:s,zoomStateKey:c,legendData:f,dotsByGrouping:A,layers:h,aesGetters:v,tooltipData:g}){var Q;let{title:C,xAxis:b,yAxis:B,frame:E,legend:k}=t,P=b.showTicks?OZ:0,I=B.showTicks?OZ:0,$=b.title,z=B.title,O={left:0,right:i.chartWidth,top:0,bottom:i.chartHeight};if(!s)return null;let K=h.find(j=>j.type==="curve"),[te,le]=tn.useState([]);function G(){let j=Object.entries(A).map(([Y,X])=>({key:Y,d:K!=null&&K.smoothing?jZ(X)??"":X.map(ee=>`${e.x(ee.x)},${e.y(ee.y)}`).join(" "),dot:X[0]}));le(j)}return tn.useEffect(()=>{K&&(jZ.x(j=>e.x(j.x)).y(j=>e.y(j.y)),G())},[c]),tn.useEffect(()=>{K&&G()},[K==null?void 0:K.smoothing]),ie.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${i.totalWidth} ${i.totalHeight}`,width:i.totalWidth,height:i.totalHeight,style:{pointerEvents:"none"},children:[ie.jsx("defs",{children:Qm}),ie.jsxs("g",{transform:`translate(${a.left},${a.top})`,fontFamily:"Manrope",children:[ie.jsx("clipPath",{id:"viewportClipPath",children:ie.jsx("rect",{x:"0",y:"0",width:i.chartWidth,height:i.chartHeight})}),ie.jsx(y3,{title:n,show:C.show,position:C.position,leftPadding:a.left,rightPadding:a.right,chartsWidth:i.chartWidth}),ie.jsxs("g",{dominantBaseline:"central",textAnchor:"middle",fontWeight:"500",fontSize:"14px",fill:Vt,children:[$&&ie.jsx("text",{x:i.chartWidth/2,y:i.chartHeight+a.bottom-M9/2,children:QZ($)}),z&&ie.jsx("text",{x:-a.left+M9/2,y:i.chartHeight/2,transform:`rotate(-90,${-a.left+M9/2},${i.chartHeight/2})`,children:QZ(z)})]}),ie.jsx(xZ,{width:i.chartWidth,height:i.chartHeight,scaleX:e.x,scaleY:e.y,axisX:b,axisY:B,updatingKey:c,frameType:E.type}),ie.jsx("g",{transform:`translate(0,${i.chartHeight})`,children:ie.jsx(AS,{scale:e.x,orient:"bottom",onlyPositive:o.x,tickSize:P})}),ie.jsx("g",{children:ie.jsx(AS,{scale:e.y,orient:"left",onlyPositive:o.y,tickSize:I})}),K&&K.smoothing&&ie.jsx("g",{clipPath:"url(#viewportClipPath)",children:te.map(({key:j,d:Y,dot:X})=>{var ee;return ie.jsx("path",{d:Y,fill:"none",stroke:v.dotFill(X.data),strokeWidth:(ee=K.aes)==null?void 0:ee.lineWidth,strokeDasharray:v.lineType(X.data)},j)})}),K&&!K.smoothing&&ie.jsx("g",{clipPath:"url(#viewportClipPath)",children:te.map(({key:j,d:Y,dot:X})=>{var ee;return ie.jsx("polyline",{points:Y,fill:"none",stroke:v.dotFill(X.data),strokeWidth:(ee=K.aes)==null?void 0:ee.lineWidth,strokeDasharray:v.lineType(X.data)},j)})}),g.selectedData&&ie.jsx(fu,{content:Y6t(g.selectedData,r,(Q=t.tooltips)==null?void 0:Q.content),x:e.x(g.selectedData.x),y:e.y(g.selectedData.y),active:!0,fixed:g.fixed,sideDistances:O,container:s,onClose:g.onClose}),k.show&&ie.jsx("g",{transform:`translate(${i.chartWidth+FZ},0)`,children:ie.jsx(w3,{legendData:f})})]})]})}var X6t=T8.memo(W6t),K6t=20;function Z6t({scales:e,chartSizes:t,disabled:n,onPolygonUpdate:r}){let[a,i]=tn.useState([]),[o,s]=tn.useState(null),[c,f]=tn.useState(null),A=tn.useRef(null),h=tn.useRef(null),v=tn.useRef(null),g=tn.useRef(a);function C(){A.current=null,h.current=null,v.current=null,g.current=[],i([]),s(null)}function b(k){n||k.key!=="Escape"||C()}tn.useEffect(()=>{n&&(A.current=null,h.current=null,v.current=null,s(null))},[n]),tn.useEffect(()=>(document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)),[]),tn.useEffect(()=>{if(o&&c)return;if(a.length===0){r([]);return}let k=a.map(P=>P[0]);k.push(a[a.length-1][1]),r(k)},[a]);function B(){if(!A.current||n)return;let k=[...A.current],P=e.x.invert(k[0]),I=e.y.invert(k[1]),$=g.current,z=v.current,O=h.current&&$.length>1?Math.sqrt((k[0]-h.current[0])**2+(k[1]-h.current[1])**2):1/0;v.current?v.current&&O>K6t?($=[...$,[v.current,[P,I]]],z=[P,I]):($=[...$,[v.current,[P,I]]],$.length>2&&($=[...$,[$[$.length-1][1],$[0][0]]]),z=null,$.length<=2?r([]):r($.map(K=>K[0])),h.current=null):(h.current=k,$=[],z=[P,I],r([])),i($),s(z),g.current=$,v.current=z}function E(k){let P=[k.nativeEvent.offsetX,k.nativeEvent.offsetY];f(P),A.current=P}return ie.jsxs("g",{children:[ie.jsx("rect",{fill:"transparent",width:t.chartWidth,height:t.chartHeight,onMouseMove:E,onClick:B}),a.map(([k,P],I)=>ie.jsx("line",{x1:e.x(k[0]),y1:e.y(k[1]),x2:e.x(P[0]),y2:e.y(P[1]),stroke:Vt,style:{pointerEvents:"none"}},I)),o&&c&&ie.jsx("line",{x1:e.x(o[0]),y1:e.y(o[1]),x2:c[0],y2:c[1],stroke:Vt,style:{pointerEvents:"none"}},"lastLine")]})}function J6t({scales:e,container:t,labels:n,aesGetters:r,chartSizes:a,onPolygonUpdate:i,lassoMode:o,tooltipData:s}){return t?ie.jsxs("g",{children:[n.map(c=>{let{name:f,height:A,bbox:h,width:v}=c;return ie.jsx("g",{children:ie.jsxs("g",{transform:`translate(${h.minX},${h.minY})`,children:[ie.jsx("rect",{x:"0",y:"0",width:v,height:A,fill:"transparent",stroke:"none"}),ie.jsx("text",{x:0,y:A/2,stroke:"white",strokeWidth:2,paintOrder:"stroke",style:{pointerEvents:"none"},fontFamily:"Manrope",fontSize:"16px",dominantBaseline:"middle",children:f})]})},c.dot.id)}),ie.jsx(Z6t,{scales:e,chartSizes:a,disabled:!o,onPolygonUpdate:i}),s.fixed&&ie.jsx("rect",{width:a.chartWidth,height:a.chartHeight,fill:"rgba(255,255,255,0.8)"}),s.selectedData&&ie.jsx("circle",{cx:e.x(s.selectedData.x),cy:e.y(s.selectedData.y),r:Math.max(r.dotSize(s.selectedData.data)*1.2,5),fill:r.dotFill(s.selectedData.data)})]}):null}var q6t=J6t;function ewt({settingsId:e,scales:t,chartSettings:n,mainTitle:r,keyColumn:a,margins:i,chartSizes:o,captionsSizes:s,onlyPositive:c,container:f,zoomStateKey:A,aesGetters:h,legendData:v,labels:g,onPolygonUpdate:C,onTooltipHintSwitch:b,lassoMode:B,dotsByGrouping:E,layers:k,selectedDot:P=null}){if(!f)return null;let I=h3(b);return tn.useEffect(()=>{P?I.onMouseOver(P):I.onMouseLeave()},[P]),ie.jsx("div",{children:ie.jsxs(g3,{dataId:e,children:[ie.jsx(X6t,{aesGetters:h,dotsByGrouping:E,layers:k,scales:t,keyColumn:a,margins:i,mainTitle:r,captionsSizes:s,chartSettings:n,chartSizes:o,onlyPositive:c,container:f,zoomStateKey:A,legendData:v,tooltipData:I}),cu.createPortal(ie.jsx(q6t,{scales:t,container:f,aesGetters:h,labels:g,chartSizes:o,selectedDot:P,onPolygonUpdate:C,lassoMode:B,tooltipData:I}),f)]})})}var UZ=e=>e.selection()!==e,GZ=(e,t)=>{e=e||"g";let n=(i,o)=>o,r=null,a=function(i,o){o=o||(g=>g);let s=i.selection(),c=UZ(i)?i:null,f=s.selectChildren(t==null?e:`${e}.${t}`).data(o,n),A=f.enter().append(e).attr("class",t),h=f.exit();f=f.merge(A);let v=c||r;return v&&(f=f.transition(v).style("opacity",1),A.style("opacity",1e-6),h=h.transition(v).style("opacity",1e-6)),h.remove(),f.enter=()=>A,f.exit=()=>h,f};return a.element=(...i)=>i.length?(e=i[0],a):e,a.className=(...i)=>i.length?(t=i[0],a):t,a.key=(...i)=>i.length?(n=i[0],a):n,a.transition=(...i)=>i.length?(r=i[0],a):r,a},YZ=(e,t,n)=>{let r=t[n];if(typeof r!="function")throw new Error(`Attempt to rebind ${n} which isn't a function on the source object`);return(...a)=>{var i=r.apply(t,a);return i===t?e:i}},WZ=(e,t,...n)=>{for(let r of n)e[r]=YZ(e,t,r);return e},twt=e=>t=>e.reduce((n,r)=>n&&r(n),t),GM=(e,t,...n)=>{let r=twt(n);for(let a of Object.keys(t)){let i=r(a);i&&(e[i]=YZ(e,t,a))}return e},nwt=e=>e.map(t=>typeof t=="string"?new RegExp(`^${t}$`):t),rwt=(...e)=>(e=nwt(e),t=>e.every(n=>!n.test(t))&&t),M3=e=>typeof e=="function"?e:()=>e;function awt(){let e=arguments;return function(t,n){for(let r=0,a=e.length;r<a;r++)if(e[r](t,n)==null)return!1;return!0}}var iwt=(e,t)=>{switch(e){case"left":return t/2;case"right":return-t/2;default:return 0}},XZ=e=>{let t=Object.assign({},e),n=()=>{};return Object.keys(t).forEach(r=>{n[r]=(...a)=>a.length?(t[r]=a[0],n):t[r]}),n},owt=()=>{let e=()=>0,t=s=>s.x,n=s=>s.y,r="center",a=()=>5,i="vertical",o=XZ({decorate:()=>{},defined:(s,c)=>awt(e,t,n)(s,c),xScale:sv(),yScale:sv()});return o.values=(s,c)=>{let f=a(s,c),A=iwt(r,f),h=o.xScale(),v=o.yScale();if(i==="vertical"){let g=v(n(s,c),c),C=v(e(s,c),c),b=h(t(s,c),c)+A;return{d:s,x:b,y:g,y0:C,width:f,height:g-C,origin:[b,g],baseOrigin:[b,C],transposedX:b,transposedY:g}}else{let g=h(n(s,c),c),C=h(e(s,c),c),b=v(t(s,c),c)+A;return{d:s,x:b,y:g,y0:C,width:f,height:g-C,origin:[g,b],baseOrigin:[C,b],transposedX:g,transposedY:b}}},o.xValues=()=>i==="vertical"?[t]:[e,n],o.yValues=()=>i!=="vertical"?[t]:[e,n],o.baseValue=(...s)=>s.length?(e=M3(s[0]),o):e,o.crossValue=(...s)=>s.length?(t=M3(s[0]),o):t,o.mainValue=(...s)=>s.length?(n=M3(s[0]),o):n,o.bandwidth=(...s)=>s.length?(a=M3(s[0]),o):a,o.align=(...s)=>s.length?(r=s[0],o):r,o.orient=(...s)=>s.length?(i=s[0],o):i,o},lwt=()=>{let e=owt(),t=M3(64),n=AN,r=l9(),a=l9(),i=l9().type(ih.UNSIGNED_SHORT),o=l9().type(ih.UNSIGNED_BYTE),s=Mht().crossValueAttribute(r).mainValueAttribute(a).sizeAttribute(i).definedAttribute(o),c=(C,b)=>!1,f=Vht,A=[],h=null,v=null,g=C=>{let b=f(e.xScale()),B=f(e.yScale()),E=!c(A,C);E&&(A=C,i.value((k,P)=>t(k,P)).data(C),o.value((k,P)=>e.defined()(k,P)).data(C)),(E||b.scale!==h)&&(h=b.scale,e.orient()==="vertical"?r.value((k,P)=>b.scale(e.crossValue()(k,P))).data(C):r.value((k,P)=>b.scale(e.mainValue()(k,P))).data(C)),(E||B.scale!==v)&&(v=B.scale,e.orient()==="vertical"?a.value((k,P)=>B.scale(e.mainValue()(k,P))).data(C):a.value((k,P)=>B.scale(e.crossValue()(k,P))).data(C)),s.xScale(b.webglScale).yScale(B.webglScale).type(Uht(n)).decorate(k=>e.decorate()(k,C,0)),s(C.length)};return g.size=(...C)=>C.length?(t=M3(C[0]),g):t,g.type=(...C)=>C.length?(n=C[0],g):n,g.equals=(...C)=>C.length?(c=C[0],g):c,g.scaleMapper=(...C)=>C.length?(f=C[0],g):f,GM(g,e,rwt("baseValue","bandwidth","align")),WZ(g,s,"context","pixelRatio"),g},KZ=()=>{let e=[],t=a=>a,n=(a,i)=>i,r=XZ({decorate:()=>{},xScale:sv(),yScale:sv()});return r.xValues=()=>e.map(a=>a.xValues()).reduce((a,i)=>a.concat(i)),r.yValues=()=>e.map(a=>a.yValues()).reduce((a,i)=>a.concat(i)),r.mapping=(...a)=>a.length?(t=a[0],r):t,r.key=(...a)=>a.length?(n=a[0],r):n,r.series=(...a)=>a.length?(e=a[0],r):e,r},swt=()=>{let e=KZ(),t=GZ("g"),n=GZ("g","multi"),r=a=>{UZ(a)&&(n.transition(a),t.transition(a));let i=e.mapping(),o=e.series(),s=e.xScale(),c=e.yScale();a.each((f,A,h)=>{let v=n(bs(h[A]),o);v.each((g,C,b)=>{g.xScale(s).yScale(c);let B=i(f,C,o);t(bs(b[C]),[B]).call(g)}),v.selection().order(),e.decorate()(v,f,A)})};return GM(r,e),WZ(r,n,"key"),r},uwt=()=>{let e=null,t=1,n=KZ(),r=a=>{let i=n.mapping(),o=n.series(),s=n.xScale(),c=n.yScale();o.forEach((f,A)=>{let h=i(a,A,o);f.context(e).pixelRatio(t).xScale(s).yScale(c);let v;f.decorate?(v=f.decorate(),f.decorate((g,C,b)=>{n.decorate()(g,a,A),v(g,C,b)})):n.decorate()(e,a,A),f(h),v&&f.decorate(v)})};return r.context=(...a)=>a.length?(e=a[0],r):e,r.pixelRatio=(...a)=>a.length?(t=a[0],r):t,GM(r,n),r};function ZZ(e){return e/2.35*(e/2.35)*64}function YM(e,t){return e+(1-e)*(1-t)}function WM(e,t){return[YM(e.r/255,t),YM(e.g/255,t),YM(e.b/255,t),1]}function cwt(e){return typeof e=="object"&&e!==null&&"type"in e&&"value"in e&&e.type==="grouping"}function XM(e={},t,n){return function(r){var a,i;if(cwt(n)){let o=n.value,s=r[o];return(i=((a=e[o])==null?void 0:a[String(s)])??m9)==null?void 0:i[t]}if(oh(n)&&t==="dotFill"){let{domain:o,range:s,type:c="linear"}=n,f=k9(s,o,c),A=r[n.columnName.value];return A===null?Gv.color:f(Number(A))}if(oh(n)&&t==="dotSize"){let{domain:o,range:s}=n,c=cv().domain(o).range(s)(Number(r[n.columnName.value]));return Math.max(1,c)}return n}}function JZ(e,t){let n=t.find(a=>a.type==="dots"),r=t.find(a=>a.type==="curve");return{dotFill:XM(e,"dotFill",(n==null?void 0:n.aes.dotFill)??Gv.color),dotSize:XM(e,"dotSize",(n==null?void 0:n.aes.dotSize)??Gv.size),lineType:XM(e,"lineShape",(r==null?void 0:r.aes.lineShape)??"solid")}}var fwt=class{constructor(){Be(this,"reactRoot",null);Be(this,"parentNode",null);Be(this,"rootNode",null);Be(this,"canvasNode",null);Be(this,"svgLayerElement",null);Be(this,"svgLayerComponent",ie.jsx(ie.Fragment,{}));Be(this,"aesGetters",{dotSize:()=>2,dotFill:()=>Vt,lineType:()=>"solid"});Be(this,"tools",null);Be(this,"margins",{top:Gc,bottom:Gc,left:Gc,right:Gc});Be(this,"chartSizes",{chartWidth:600,chartHeight:350,totalWidth:600,totalHeight:350});Be(this,"scales",{x:Zr().domain([0,10]).range([0,600]),y:Zr().domain([0,10]).range([350,0]),xOriginal:Zr().domain([0,10]).range([0,600]),yOriginal:Zr().domain([0,10]).range([350,0])});Be(this,"polygon",[]);Be(this,"onPolygonUpdateOutside",()=>{});Be(this,"onTooltipHintSwitch",()=>{});Be(this,"zoomStateKey","");Be(this,"selectedDot",null);Be(this,"captionsSizes",{xAxisCaptionsWidth:30,yAxisCaptionsWidth:100});Be(this,"mainTitle",[]);Be(this,"legend",{width:0,height:0,items:[]});Be(this,"notCalculatedProps",{});Be(this,"allDots",[]);Be(this,"allPossibleLabels",[]);Be(this,"visibleLabels",[]);Be(this,"lassoMode",!1);Be(this,"onPolygonUpdate",e=>{this.polygon=e,this.updateByLasso();let t=this.allDots.filter(n=>this.polygon.length>2&&RC(this.polygon,[n.x,n.y])).map(n=>n.idx);this.onPolygonUpdateOutside(t)})}clear(){var e,t;this.parentNode&&this.rootNode&&this.canvasNode&&((e=this.parentNode)==null||e.removeChild(this.rootNode),(t=this.parentNode)==null||t.removeChild(this.canvasNode),this.parentNode=null,this.rootNode=null,this.canvasNode=null,this.svgLayerElement=null,this.tools=null),setTimeout(()=>{var n;(n=this.reactRoot)==null||n.unmount(),this.reactRoot=null})}init(e){this.parentNode===null&&(this.parentNode=e,this.rootNode=document.createElement("div"),this.canvasNode=document.createElement("div"),this.parentNode.appendChild(this.rootNode),this.parentNode.appendChild(this.canvasNode),this.reactRoot=Wh(this.rootNode))}updateChartSizes(e){this.chartSizes.chartWidth=e.width,this.chartSizes.chartHeight=e.height}updateViewport(e,t,n){let r=e.scale==="log"?X2():Zr(),{minX:a,minY:i,maxX:o,maxY:s}=n;if(e.lowerValue!==void 0&&(a=Math.max(a,e.lowerValue)),e.upperValue!==void 0&&(o=Math.min(o,e.upperValue)),t.lowerValue!==void 0&&(i=Math.max(i,t.lowerValue)),t.upperValue!==void 0&&(s=Math.min(s,t.upperValue)),e.symmetricRange!==void 0){let g=e.symmetricRange;if(g>=a&&g<=o){let C=Math.max(g-a,o-g);a=g-C,o=g+C}}if(typeof t.symmetricRange<"u"){let g=t.symmetricRange;if(g>=i&&g<=s){let C=Math.max(g-i,s-g);i=g-C,s=g+C}}let c=[0,this.chartSizes.chartWidth],f=r.copy().domain([a,o]).range([hS.LEFT,this.chartSizes.chartWidth-hS.RIGHT]);r.domain([f.invert(0),f.invert(this.chartSizes.chartWidth)]).range(c).nice(),this.scales.x=r,this.scales.xOriginal=r.copy();let A=t.scale==="log"?X2():Zr(),h=[this.chartSizes.chartHeight,0],v=A.copy().domain([i,s]).range([this.chartSizes.chartHeight-hS.BOTTOM,hS.TOP]);A.domain([v.invert(this.chartSizes.chartHeight),v.invert(0)]).range(h).nice(),this.scales.y=A,this.scales.yOriginal=A.copy()}updateCaptionsSize(e){let t=new hc("600 14px Arial");function n(o){return Math.max(...o.map(s=>t.getTextWidth(s)))}let{ticks:r,format:a}=T9(this.scales.y,e),i=n(r.map(a));this.captionsSizes={xAxisCaptionsWidth:20,yAxisCaptionsWidth:i}}createMainTitle(e){this.mainTitle=Kv(e.name,this.chartSizes.totalWidth-this.margins.left-this.margins.right,20)}updateMargins(){let e=24*this.mainTitle.length,t=e>0?e+24*2:0;this.margins={top:Math.max(t,Gc),bottom:Gc+this.captionsSizes.xAxisCaptionsWidth+M9,left:Gc+this.captionsSizes.yAxisCaptionsWidth+M9,right:this.legend.width+Gc},this.chartSizes.totalWidth=this.margins.left+this.chartSizes.chartWidth+this.margins.right,this.chartSizes.totalHeight=this.margins.top+Math.max(this.chartSizes.chartHeight,this.legend.height)+this.margins.bottom,bs(this.canvasNode).style("width",this.chartSizes.chartWidth+"px").style("height",this.chartSizes.chartHeight+"px").style("top",this.margins.top+"px").style("left",this.margins.left+"px")}updateLegendSize(e,t,n,r){if(!e.show){this.legend={width:0,height:0,items:[]};return}let a=[],i={width:0,height:0,left:0,top:0};if(n.forEach(A=>{let h=t[A.value];if(h.usedAes.length===0||!h.aesMap)return;if(h.values.length>100){console.warn(`Too many values for discrete legend (${h.values.length})`);return}let v={};h.values.forEach(b=>{v[b]||(v[b]={...Gv}),h.usedAes.forEach(B=>{var E,k;B==="dotFill"&&(v[b].color=((E=h.aesMap[b])==null?void 0:E[B])??Vt),B==="dotSize"&&(v[b].size=((k=h.aesMap[b])==null?void 0:k[B])??3)})});let g=A.label??A.value,C=Qo().domain(h.values).range(h.values.map(b=>v[b]));a.push({...i,id:A.value,type:"dots",title:g,scale:C,values:h.values,labels:h.labels})}),r.forEach(A=>{if(A.type==="dots"&&oh(A.aes.dotFill)){let{domain:h,range:v,columnName:g,type:C="linear"}=A.aes.dotFill,b=g.label??g.value,B=k9(v,h,"linear"),E=(C==="log"?uv():Zr()).domain(h).range([this.chartSizes.chartHeight,0]),k=A3(E,h);a.push({...i,id:"dotFill",type:"continuous",title:b,scale:B,tickPositionScale:E,values:k})}if(A.type==="dots"&&oh(A.aes.dotSize)){let{columnName:h,domain:v,range:g}=A.aes.dotSize,C=h.label??h.value,b=cv(v,g),B=b.ticks(3),E=b.tickFormat(3),k=B.reduce((P,I)=>(P[String(I)]=E(I),P),{});a.push({...i,id:h.value,type:"size",title:C,scale:b,values:B,labels:k})}}),!a.length){this.legend={width:0,height:0,items:[]};return}let o=C3(a,this.chartSizes.chartHeight),s=o[o.length-1],c=s.left+s.width+FZ,f=this.chartSizes.chartHeight;this.legend={width:c,height:f,items:o}}initSettings(e,t,n,r,a,i,o,s){let{xAxis:c,yAxis:f,size:A,title:h,legend:v}=t;this.updateChartSizes(A),this.updateViewport(c,f,n),this.updateCaptionsSize(r.y),this.updateLegendSize(v,o,s,i),this.createMainTitle(h),this.updateMargins(),this.aesGetters=JZ(a,i);let g=Yht().data(e).value(P=>{let I=Ug(this.aesGetters.dotFill(P.data)),$=!P.dimmed&&(this.polygon.length<2||RC(this.polygon,[P.x,P.y]))?1:.4;return WM(I,$)}),C=lwt().equals((P,I)=>P===I).size(P=>ZZ(this.aesGetters.dotSize(P.data))).crossValue(P=>P.x).mainValue(P=>P.y).decorate(P=>g(P)),b=KAt().scaleExtent([.1,1e3]).filter(()=>!this.lassoMode).on("start",()=>{this.selectedDot=null}).on("zoom",P=>{let I=P.transform,$=I.rescaleX(this.scales.xOriginal),z=I.rescaleY(this.scales.yOriginal);this.scales.x.domain($.domain()),this.scales.y.domain(z.domain()),this.zoomStateKey=`${I.x}_${I.y}_${I.k}`,this.renderSvgLayer(),this.renderWebglLayer()}).on("end",()=>{this.allPossibleLabels.forEach(P=>{P.x=this.scales.x(P.dot.x),P.y=this.scales.y(P.dot.y)}),this.visibleLabels=dS(this.allPossibleLabels,this.chartSizes.chartWidth,this.chartSizes.chartHeight),this.renderSvgLayer()}),B=Gk().x(P=>P.x).y(P=>P.y).addAll(e),E=Wht().on("point",([P])=>{var K,te;if(!P){this.selectedDot=null,this.renderSvgLayer();return}let I=this.scales.x.invert(P.x),$=this.scales.y.invert(P.y),z=(K=this.tools)==null?void 0:K.qt.find(I,$),O=this.selectedDot&&!z||!this.selectedDot&&z||((te=this.selectedDot)==null?void 0:te.id)!==(z==null?void 0:z.id);this.selectedDot=z??null,O&&this.renderSvgLayer()}),k=xht({xScale:this.scales.x,yScale:this.scales.y}).xAxisHeight(()=>"0").yAxisWidth(()=>"0").svgPlotArea(swt()).webglPlotArea(uwt().series([C]).mapping(P=>P)).decorate(P=>{let I=P.enter();I&&!this.svgLayerElement&&(I.style("grid-template-columns","0 auto 1fr auto 0"),I.style("grid-template-rows","0 auto 1fr auto 0"),this.svgLayerElement=I.select(".svg-plot-area.plot-area svg").node()),I.select(".svg-plot-area.plot-area").call(b).call(E)});this.tools={webglChart:k,zoom:b,qt:B,fillColor:g,pointSeries:C},bs(this.canvasNode).datum(e).style("position","absolute").style("width",this.chartSizes.chartWidth+"px").style("height",this.chartSizes.chartHeight+"px").style("top",this.margins.top+"px").style("left",this.margins.left+"px")}updateAes(e,t){this.tools!==null&&(this.aesGetters=JZ(e,t),this.tools.fillColor.value(n=>{let r=this.aesGetters.dotFill??(()=>Vt),a=Ug(r(n.data)),i=!n.dimmed&&(this.polygon.length<2||RC(this.polygon,[n.x,n.y]))?1:.4;return WM(a,i)}))}updatePointSize(){this.tools!==null&&(bs(this.canvasNode).datum([...this.allDots]),this.tools.pointSeries.size(e=>ZZ(this.aesGetters.dotSize(e.data))))}updateByLasso(){var e;this.tools!==null&&((e=this.tools)==null||e.fillColor.value(t=>{let n=this.aesGetters.dotFill??(()=>Vt),r=Ug(n(t.data)),a=!t.dimmed&&(this.polygon.length<2||RC(this.polygon,[t.x,t.y]))?1:.4;return WM(r,a)}),this.renderWebglLayer())}updateData(e){this.tools!==null&&(bs(this.canvasNode).datum(e),this.tools.fillColor.data(e),this.tools.qt=Gk().x(t=>t.x).y(t=>t.y).addAll(e))}render(e,t,n,r,a,i,o,s,c,f,A,h,v,g,C){if(this.lassoMode=g,this.tools===null)this.initSettings(a,t,i,r,s,c,f,A),this.onPolygonUpdateOutside=v,this.onTooltipHintSwitch=C;else{let{title:b,legend:B}=t;this.updateLegendSize(B,f,A,c),this.createMainTitle(b),this.updateMargins(),this.updateAes(s,c)}this.allDots=a,this.allPossibleLabels=h,this.allPossibleLabels.forEach(b=>{b.x=this.scales.x(b.dot.x),b.y=this.scales.y(b.dot.y)}),this.visibleLabels=dS(this.allPossibleLabels,this.chartSizes.chartWidth,this.chartSizes.chartHeight),this.notCalculatedProps={settingsId:e,chartSettings:t,onlyPositive:r,keyColumn:n,dotsByGrouping:o,layers:c},this.renderWebglLayer(),this.renderSvgLayer()}renderWebglLayer(){var e,t;(e=this.tools)!=null&&e.webglChart&&bs(this.canvasNode).call((t=this.tools)==null?void 0:t.webglChart)}renderSvgLayer(){var t;this.visibleLabels.forEach(n=>{n.x=this.scales.x(n.dot.x),n.y=this.scales.y(n.dot.y)}),s6t(this.visibleLabels);let e={settingsId:this.notCalculatedProps.settingsId,chartSettings:this.notCalculatedProps.chartSettings,onlyPositive:this.notCalculatedProps.onlyPositive,keyColumn:this.notCalculatedProps.keyColumn,dotsByGrouping:this.notCalculatedProps.dotsByGrouping,layers:this.notCalculatedProps.layers,chartSizes:this.chartSizes,scales:this.scales,margins:this.margins,mainTitle:this.mainTitle,captionsSizes:this.captionsSizes,container:this.svgLayerElement,zoomStateKey:this.zoomStateKey,selectedDot:this.selectedDot,aesGetters:this.aesGetters,legendData:this.legend,labels:this.visibleLabels,onPolygonUpdate:this.onPolygonUpdate,onTooltipHintSwitch:this.onTooltipHintSwitch,lassoMode:this.lassoMode};this.svgLayerComponent=ie.jsx(ewt,{...e}),(t=this.reactRoot)==null||t.render(this.svgLayerComponent)}renderError(e){var t;(t=this.reactRoot)==null||t.render(ie.jsx(Xv,{message:e}))}},dwt=fwt,KM=D.object({type:D.literal("grouping"),value:D.string()}),Awt=D.object({type:D.literal("dots"),aes:D.optional(D.object({dotFill:D.optional(D.union([D.string(),KM,nA(D.string())])),dotShape:D.optional(D.union([kd,KM])),dotSize:D.optional(D.union([D.number(),nA(D.number())]))}))}),hwt=D.object({type:D.literal("curve"),smoothing:D.optional(D.boolean()),aes:D.optional(D.object({lineWidth:D.optional(D.number()),lineShape:D.optional(Z1),lineColor:D.optional(D.union([D.string(),KM,nA(D.string())])),opacity:D.optional(D.number())}))}),pwt=D.union([Awt,hwt]),vwt=D.object({type:D.literal("scatterplot-umap"),title:D.object({name:D.string(),show:D.optional(D.boolean()),position:D.optional(Wv)}),size:D.optional(D.object({width:D.optional(D.number()),height:D.optional(D.number())})),legend:D.optional(D.object({show:D.optional(D.boolean()),position:D.optional(Om)})),tooltips:D.optional(D.object({show:D.optional(D.boolean()),content:D.optional(D.array(Yn))})),frame:D.optional(D.object({type:D.optional(y9)})),keyColumn:D.optional(Yn),x:Yn,y:Yn,xAxis:D.optional(d3),yAxis:D.optional(d3),grouping:D.optional(D.array(Yn)),label:D.optional(Yn),highlight:D.optional(Yn),inheritedAes:D.optional(D.record(D.string(),f3)),layers:D.array(pwt),lassoMode:D.optional(D.boolean())}),mwt=class{constructor(e){Be(this,"type","dots");Be(this,"aes",{dotFill:Vt,dotShape:"21",dotSize:3,opacity:1});this.aes={...this.aes,...e.aes}}},gwt=class{constructor(e){Be(this,"type","curve");Be(this,"smoothing");Be(this,"aes",{lineColor:Vt,lineWidth:1,lineShape:"solid",opacity:1});this.smoothing=e.smoothing??!1,this.aes={...this.aes,...e.aes}}},qZ=class{constructor(e){Be(this,"id");Be(this,"type","scatterplot-umap");Be(this,"keyColumn");Be(this,"x");Be(this,"y");Be(this,"grouping");Be(this,"label");Be(this,"highlight");Be(this,"chartSettings");Be(this,"inheritedAes");Be(this,"layers");Be(this,"lassoMode");var t,n,r,a;vwt.parse(e),this.id=Zn.uniqueId("settings"),this.keyColumn=e.keyColumn??null,this.x=e.x,this.y=e.y,this.grouping=e.grouping??[],this.label=e.label??null,this.highlight=e.highlight??null,this.chartSettings={size:{width:((t=e==null?void 0:e.size)==null?void 0:t.width)??600,height:((n=e==null?void 0:e.size)==null?void 0:n.height)??350},title:{position:"center",show:!0,...e.title,name:((r=e.title)==null?void 0:r.name)??"Chart"},yAxis:{title:e.y.label??e.y.value,scale:"linear",showGrid:!0,showTicks:!0,...e.yAxis},xAxis:{title:e.x.label??e.x.value,scale:"linear",showGrid:!0,showTicks:!0,...e.xAxis},frame:{type:((a=e.frame)==null?void 0:a.type)??"full"},legend:{show:!0,position:"right",...e.legend},tooltips:{show:!0,...e.tooltips}},this.inheritedAes=e.inheritedAes??{},this.layers=e.layers.map(i=>{if(i.type==="dots")return new mwt(i);if(i.type==="curve")return new gwt(i);throw new Error("Unknown layer type")}).filter(Boolean),this.lassoMode=e.lassoMode??!1}};function eJ(e){return typeof e=="object"&&"type"in e&&e.type==="grouping"}function ywt(e,t,n,r){return t.reduce((a,i)=>{let o=h=>String(h[i.value]),s=h=>i.valueLabels?String(h[i.valueLabels]):o(h),c=new Set;n.forEach(h=>{h.aes&&Object.entries(h.aes).forEach(([v,g])=>{eJ(g)&&g.value===i.value&&c.add(v)})});let f={},A=[];if(c.has("dotFill")){let h=e.getColumnCategories(i.value);if(h.length>100)A=h,f={};else{let v=Zn.uniqBy(e.rows,g=>g[i.value]);f=v.reduce((g,C)=>(g[o(C)]=s(C),g),{}),A=v.map(o).sort((g,C)=>f[g].localeCompare(f[C],"en",{numeric:!0}))}}return a[i.value]={values:A,usedAes:[...c],aesMap:r[i.value],labels:f},a},{})}var wwt=10;function bwt(e){let t=[],n=new hc("16px Manrope");for(let r of e){let a=r.label;if(!a)continue;let i=n.getTextMetrics(String(a));t.push({name:String(a),width:(i==null?void 0:i.width)??0,height:((i==null?void 0:i.actualBoundingBoxAscent)??0)+((i==null?void 0:i.actualBoundingBoxDescent)??0),x:0,y:0,xPosition:"right",yPosition:"middle",bbox:{minX:0,maxX:0,minY:0,maxY:0},dot:r,padding:wwt})}return t}var Cwt=class extends zm{constructor(t,n,r){super(t,n);Be(this,"settings");Be(this,"chartRenderer",new dwt);Be(this,"onPolygonUpdate",()=>{});Be(this,"onTooltipHintSwitch",()=>{});Be(this,"calculatedData",null);this.settings=new qZ(n),r&&(this.onPolygonUpdate=r[0],this.onTooltipHintSwitch=r[1])}mount(t){try{this.chartRenderer.init(t),this._updateData(),this._updateChart()}catch(n){n instanceof Error&&this.chartRenderer.renderError(n.message)}}unmount(){this.chartRenderer.clear()}updateSettingsAndData(t,n){try{let r=this.settings,a=this.data;this.settings=new qZ(n),this.data=t,this._needUpdateCalculatedDataBySettings(r,this.settings)||this._needUpdateCalculatedDataByData(a,this.data)?this._updateData():this._updateAesInData();let i=r.layers.find(s=>s.type==="dots"),o=this.settings.layers.find(s=>s.type==="dots");i&&o&&i.aes.dotSize!==o.aes.dotSize&&typeof i.aes.dotSize=="number"&&typeof o.aes.dotSize=="number"&&this.chartRenderer.updatePointSize(),this._updateChart()}catch(r){r instanceof Error&&this.chartRenderer.renderError(r.message)}}updateChartState(t,n){t==="polygon"&&(this.chartRenderer.polygon=n,this._updateChart())}export(){return console.warn("export not implemented"),""}_needUpdateCalculatedDataBySettings(t,n){var r,a,i,o;return t.grouping.length!==n.grouping.length||t.grouping.some((s,c)=>{var f;return s.value!==((f=n.grouping[c])==null?void 0:f.value)})||(((r=t.label)==null?void 0:r.value)||((a=n.label)==null?void 0:a.value))&&((i=t.label)==null?void 0:i.value)!==((o=n.label)==null?void 0:o.value)}_needUpdateCalculatedDataByData(t,n){let r=Object.keys(t.data),a=Object.keys(n.data);return t.id!==n.id||r.length!==a.length||r.some(i=>{var o;return t.data[i].length!==((o=n.data[i])==null?void 0:o.length)})}_updateData(){let{x:t,y:n,label:r,highlight:a,grouping:i,layers:o,inheritedAes:s}=this.settings,c={x:!0,y:!0},f={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0},A=o.some(B=>B.type==="curve"),h=new Set,v={},g=this.data.rows.reduce((B,E,k)=>{if(E[t.value]===null||E[n.value]===null)return B;let P=Number(E[t.value]),I=Number(E[n.value]);c.x&&P!==null&&P<0&&(c.x=!1),c.y&&I!==null&&I<0&&(c.y=!1),P!==null&&P<f.minX&&(f.minX=P),P!==null&&P>f.maxX&&(f.maxX=P),I!==null&&I<f.minY&&(f.minY=I),I!==null&&I>f.maxY&&(f.maxY=I);let $=(r==null?void 0:r.valueLabels)??(r==null?void 0:r.value),z={x:P,y:I,id:String(k),idx:k,dimmed:a?!E[a.value]:!1,label:$&&E[$]?String(E[$]):null,data:E};if(A){let O=i.map(K=>E[K.value]).join("_");h.add(O),v[O]||(v[O]=[]),v[O].push(z)}return B.push(z),B},[]);a&&g.sort((B,E)=>Number(E.dimmed)-Number(B.dimmed));let C=[...h];A&&C.forEach(B=>{v[B].sort((E,k)=>E.x-k.x)});let b=ywt(this.data,i,o,s);this.calculatedData={onlyPositive:c,dots:g,dotsByGrouping:v,groupingKeys:C,allPossibleLabels:bwt(g),dotsExtents:f,legendLabels:b},this.chartRenderer.updateData(g)}_updateAesInData(){let t=this.calculatedData;if(!t)return;let{layers:n,inheritedAes:r,grouping:a}=this.settings;a.forEach(i=>{let o=new Set;n.forEach(s=>{s.aes&&Object.entries(s.aes).forEach(([c,f])=>{eJ(f)&&f.value===i.value&&o.add(c)})}),t.legendLabels[i.value].usedAes=[...o],t.legendLabels[i.value].aesMap=r[i.value]})}_updateChart(){if(!this.calculatedData)return;let{id:t,chartSettings:n,keyColumn:r,inheritedAes:a,layers:i,grouping:o,lassoMode:s}=this.settings;this.chartRenderer.render(t,n,r,this.calculatedData.onlyPositive,this.calculatedData.dots,this.calculatedData.dotsExtents,this.calculatedData.dotsByGrouping,a,i,this.calculatedData.legendLabels,o,this.calculatedData.allPossibleLabels,this.onPolygonUpdate,s,this.onTooltipHintSwitch)}},Swt=1e6;function xwt(e){let t=_I(e),n=Vs(e);return t===void 0||n===void 0||t===0?r=>r:r=>(r-n)/t}function Ewt(e){let t=Vs(e),[n,r]=H0(e);return t===void 0||n===void 0||r===void 0?a=>a:a=>(a-t)/(r-n)}function Bwt(e,t){return e==="standardScaling"?xwt(t):e==="meanNormalization"?Ewt(t):n=>n}function _wt(e,t,n,r,a,i,o,s,c){let f=o.map(b=>b.join("_")),A={meta:{facetKeys:f,xKeys:[],yKeys:[],xLabels:{},yLabels:{},facetKeyValues:f.reduce((b,B,E)=>(b[B]=o[E],b),{}),valueExtentSize:[1/0,-1/0],valueExtentColor:[1/0,-1/0]},facets:{}},h=new Set,v=new Set,g=t.valueLabels??t.value,C=n.valueLabels??n.value;if(e.rows.forEach(b=>{let B=i.length?i.map($=>b[$.value]).join("_"):"null",E=b[t.value],k=b[n.value],P=b[r.value]??c,I=b[a.value]??c;if(!(E===null||k===null||P===null||I===null)){if(A.facets[B]||(A.facets[B]={xKeys:[],yKeys:[],cells:{}}),A.facets[B].xKeys.push(E),A.facets[B].yKeys.push(k),h.has(E)||(h.add(E),A.meta.xKeys.push(E)),v.has(k)||(v.add(k),A.meta.yKeys.push(k)),A.facets[B].cells[E]||(A.facets[B].cells[E]={}),A.meta.valueExtentSize[0]=Math.min(P,A.meta.valueExtentSize[0]),A.meta.valueExtentSize[1]=Math.max(P,A.meta.valueExtentSize[1]),A.meta.valueExtentColor[0]=Math.min(I,A.meta.valueExtentColor[0]),A.meta.valueExtentColor[1]=Math.max(I,A.meta.valueExtentColor[1]),A.facets[B].cells[E][k])throw Error(`More than 1 value for x=${E}, y=${k}`);if(A.meta.xLabels[E]&&String(b[g])!==A.meta.xLabels[E])throw Error(`More than 1 x-label value for x=${E}`);if(A.meta.yLabels[k]&&String(b[C])!==A.meta.yLabels[k])throw Error(`More than 1 y-label value for y=${k}`);A.meta.xLabels[E]=String(b[g]),A.meta.yLabels[k]=String(b[C]),A.meta&&(A.facets[B].cells[E][k]={id:`${E}_${k}`,x:E,y:k,sizeValue:P,normalizedSizeValue:P,colorValue:I,normalizedColorValue:I,data:b})}}),A.meta.facetKeys=A.meta.facetKeys.filter(b=>A.facets[b]),A.meta.facetKeys.forEach(b=>{let B=A.facets[b];if(B.xKeys=Zn.uniq(B.xKeys),B.yKeys=Zn.uniq(B.yKeys),B.xKeys.length*B.yKeys.length>Swt)throw Error(`Too many cells for graph rendering (${B.xKeys.length*B.yKeys.length})`)}),s){let b=[1/0,-1/0];A.meta.facetKeys.forEach(B=>{if(!A.facets[B])return;let{xKeys:E,yKeys:k,cells:P}=A.facets[B],I=s.direction==="row"?E:k,$=s.direction==="row"?k:E,z=s.direction==="row"?(O,K)=>{var te;return(te=P[O])==null?void 0:te[K]}:(O,K)=>{var te;return(te=P[K])==null?void 0:te[O]};$.forEach(O=>{let K=[];I.forEach(le=>{var Q;let G=(Q=z(le,O))==null?void 0:Q.colorValue;G!==void 0&&K.push(G)});let te=Bwt(s.method,K);I.forEach(le=>{let G=z(le,O);G!==void 0&&(G.normalizedColorValue=te(G.colorValue),b[0]=Math.min(G.normalizedColorValue,b[0]),b[1]=Math.max(G.normalizedColorValue,b[1]))})})}),A.meta.valueExtentColor=b}return A.meta.valueExtentSize[0]===1/0&&(A.meta.valueExtentSize[0]=0),A.meta.valueExtentSize[1]===-1/0&&(A.meta.valueExtentSize[1]=0),A.meta.valueExtentColor[0]===1/0&&(A.meta.valueExtentColor[0]=0),A.meta.valueExtentColor[1]===-1/0&&(A.meta.valueExtentColor[1]=0),A}var Twt=15,Um=8,pS=30,kwt=48,Mwt=24,vS=16,P3=4,mS=4,tJ=20,Pwt=16,hp={left:["axis","axisTitle"],right:["axis","axisTitle"],top:["axis","axisTitle","facetTitle"],bottom:["axis","axisTitle"]};function Hwt(e,t,n,r,a,i,o){let s=r.includes(t.position),c=r.includes(e.position),f=a.length>1,A=e.showTicks?mS:0,h=t.showTicks?mS:0,v=c&&e.showTitle?pS:0,g=s&&t.showTitle?pS:0,C=c&&e.showAxisLabels&&i>vS?n.xAxisCaptions+A+P3:0,b=s&&t.showAxisLabels&&o>vS?n.yAxisCaptions+h+P3:0;return{left:{axisTitle:t.position==="left"?g:0,axis:t.position==="left"?b:0},right:{axisTitle:t.position==="right"?g:0,axis:t.position==="right"?b:0},top:{facetTitle:f?kwt:0,axisTitle:e.position==="top"?v:0,axis:e.position==="top"?C:0},bottom:{axisTitle:e.position==="bottom"?v:0,axis:e.position==="bottom"?C:0}}}function Dwt(e,t,n){return{left:hp.left.reduce((r,a,i)=>{let o=i>0?hp.left[i-1]:null,s=e.left[a];return r[a]={x:o?r[o].x-s:-s,y:0,width:s,height:n,isVisible:s>0},r},{}),right:hp.right.reduce((r,a,i)=>{let o=i>0?hp.right[i-1]:null,s=e.right[a];return r[a]={x:o?r[o].x+r[o].width:t,y:0,width:s,height:n,isVisible:s>0},r},{}),top:hp.top.reduce((r,a,i)=>{let o=i>0?hp.top[i-1]:null,s=e.top[a];return r[a]={x:0,y:o?r[o].y-s:-s,width:t,height:s,isVisible:s>0},r},{}),bottom:hp.bottom.reduce((r,a,i)=>{let o=i>0?hp.bottom[i-1]:null,s=e.bottom[a];return r[a]={x:0,y:o?r[o].y+r[o].height:n,width:t,height:s,isVisible:s>0},r},{})}}function $wt(e,t,n,r){let{xLabels:a,yLabels:i}=n.meta,o=e.xAxisLabels/180*Math.PI,s=e.yAxisLabels/180*Math.PI,c=0,f=0,A=e.xAxisLabels===45;if(A){let v=n.meta.xKeys,g=t.x,C=g>vS,b=a[v[0]];c=Math.max(c,(A&&C?r.getTextWidth(b)*Math.cos(o):0)-g/2)}let h=e.yAxisLabels===45;if(h){let v=n.meta.yKeys;if(v.length){let g=t.y,C=g>vS,b=i[v[v.length-1]];f=Math.max(f,(h&&C?r.getTextWidth(b)*Math.cos(s):0)-g/2)}}return{xCaptionTail:c,yCaptionTail:f}}function Iwt({sideElementBBoxes:e,debug:t,xKeys:n,yKeys:r,scales:a,xAxis:i,yAxis:o,stepX:s,stepY:c,labelAngles:f,xLabels:A,yLabels:h}){let v=i.showTicks?mS:0,g=o.showTicks?mS:0,C=e.top.axis.isVisible||e.bottom.axis.isVisible,b=e.top.axisTitle.isVisible?e.top.axisTitle:e.bottom.axisTitle,B=e.top.axis.isVisible?e.top.axis:e.bottom.axis,E=e.left.axis.isVisible||e.right.axis.isVisible,k=e.left.axisTitle.isVisible?e.left.axisTitle:e.right.axisTitle,P=e.left.axis.isVisible?e.left.axis:e.right.axis;return ie.jsxs("g",{children:[ie.jsxs("g",{children:[b.isVisible&&ie.jsxs("g",{transform:`translate(${b.x},${b.y})`,children:[ie.jsx("text",{x:b.width/2,y:b.height/2,textAnchor:"middle",dominantBaseline:"central",children:i.title}),t&&ie.jsx("rect",{width:b.width,height:b.height,stroke:Vt,fill:"none"})]}),C&&ie.jsxs("g",{fontSize:"14px",transform:`translate(${B.x},${B.y})`,children:[n.map(I=>{let $=f.xAxisLabels!==0,z=i.position==="bottom",O=z?0:B.height,K=z?O+v:O-v,te=z?K+P3:K-P3,le=a.x(I)+s/2,G=-f.xAxisLabels;return ie.jsxs("g",{children:[ie.jsx("line",{x1:le,x2:le,y1:O,y2:K,stroke:Vt}),ie.jsx("text",{x:le,y:te,textAnchor:$?z?"end":"start":"middle",transform:`rotate(${G},${le},${te})`,dominantBaseline:$?"central":z?"hanging":"auto",children:A[I]})]},I)}),t&&ie.jsx("rect",{width:B.width,height:B.height,stroke:Vt,fill:"none"})]})]}),ie.jsxs("g",{children:[k.isVisible&&ie.jsx("g",{transform:`translate(
|
|
15129
15129
|
${k.x+k.width/2},
|