@milaboratories/graph-maker 1.1.112 → 1.1.113

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.
@@ -33,7 +33,7 @@ function print() { __p += __j.call(arguments, '') }
33
33
  <rect x="3" y="3" width="18" height="18" rx="2" fill="#110529"/>
34
34
  <path fill-rule="evenodd" clip-rule="evenodd" d="M17.5431 8.51739L10.3333 16.0877L6.45691 12.0174L7.54312 10.9829L10.3333 13.9127L16.4569 7.48291L17.5431 8.51739Z" fill="white"/>
35
35
  </svg>
36
- `,_ue=["innerHTML"],Due={class:"dropdown-list-item__title-container"},Pue={class:"dropdown-list-item__title text-s"},Mue={key:0,class:"dropdown-list-item__description text-description"},Hue={key:1,class:"dropdown-list-item__icon flex-self-start"},Iue=d.defineComponent({__name:"DropdownListItem",props:{option:{},isSelected:{type:Boolean,default:!1},size:{default:"small"},isHovered:{type:Boolean,default:!1},useCheckbox:{type:Boolean,default:!1}},setup(e){const t=e,n=d.computed(()=>{const i=[];return t.size==="small"&&i.push("dropdown-list-item__small"),t.isSelected&&i.push("dropdown-list-item__selected"),t.isHovered&&i.push("hovered-item"),i.join(" ")}),r=d.computed(()=>{const i=["dropdown-list-item__checkbox","flex-self-start"];return t.isSelected&&i.push("checked"),i.join(" ")}),a=d.computed(()=>t.isSelected?Tue:kue);return(i,o)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass([n.value,"dropdown-list-item"])},[t.useCheckbox?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(r.value),innerHTML:a.value},null,10,_ue)):d.createCommentVNode("",!0),o[1]||(o[1]=d.createTextVNode()),d.createElementVNode("div",Due,[d.createElementVNode("div",Pue,d.toDisplayString(i.option.label),1),o[0]||(o[0]=d.createTextVNode()),i.option.description?(d.openBlock(),d.createElementBlock("div",Mue,d.toDisplayString(i.option.description),1)):d.createCommentVNode("",!0)]),o[2]||(o[2]=d.createTextVNode()),!t.useCheckbox&&t.isSelected?(d.openBlock(),d.createElementBlock("div",Hue)):d.createCommentVNode("",!0)],2))}});function Rue(e){return e()}function Nue(e){let t=!1;return function(...n){t||(requestAnimationFrame(()=>{e(...n),t=!1}),t=!0)}}function Lue(e){return new Promise(t=>setTimeout(t,e))}function $ue(e,t){const n=setTimeout(e,t);return()=>{clearTimeout(n)}}function Fue(e){return function(t){return 1-e(1-t)}}function Vue(e){const{duration:t,draw:n,timing:r}=e,a=performance.now();let i=!1;return requestAnimationFrame(function o(s){let c=(s-a)/t;(c>1||i)&&(c=1);const f=r(c);n(f),c<1&&requestAnimationFrame(o)}),function(){i=!0}}function Oue(e,t,n=!0){let r=0,a;return function(...i){a=()=>{e.apply(this,i),r=new Date().getTime()+t,a=null,n&&setTimeout(()=>{a==null||a()},t)},new Date().getTime()>r&&a()}}function sL(e){if(!Array.isArray(e))throw Error("Invalid component options: "+String(e));return e.map(t=>({label:"label"in t?t.label:t.text,value:t.value,description:t.description}))}function uL(e,t){const n=Nue(()=>{if(e.value){const{scrollTop:r,scrollLeft:a,scrollHeight:i,scrollWidth:o,clientHeight:s,clientWidth:c}=document.documentElement,f=e.value.getBoundingClientRect();t({scrollTop:r,scrollLeft:a,scrollHeight:i,scrollWidth:o,clientHeight:s,clientWidth:c,offsetY:r+f.y,offsetX:a+f.x,top:f.top,right:f.right,bottom:f.bottom,left:f.left,width:f.width,height:f.height,x:f.x,y:f.y})}});d.onMounted(n),UC(window,"scroll",n,{capture:!0,passive:!0}),UC(window,"resize",n,{passive:!0}),UC(window,"adjust",n,!0)}const Que=d.defineComponent({__name:"PlMaskIcon16",props:{name:{},size:{}},setup(e){const t=e,n=d.computed(()=>t.size==="large"?"--mask-size: 24px":""),r=d.computed(()=>`mask-16 mask-${t.name}`);return(a,i)=>(d.openBlock(),d.createElementBlock("i",{style:d.normalizeStyle(n.value),class:d.normalizeClass([r.value,a.$style.icon])},null,6))}}),zue="_icon_1ugxm_2",Uue={icon:zue},Gue={$style:Uue},cL=l5(Que,[["__cssModules",Gue]]),jue=d.defineComponent({__name:"PlMaskIcon24",props:{name:{},size:{}},setup(e){const t=e,n=d.computed(()=>`mask-24 mask-${t.name}`);return(r,a)=>(d.openBlock(),d.createElementBlock("i",{class:d.normalizeClass([n.value,r.$style.icon])},null,2))}}),Yue="_icon_1ugxm_2",Wue={icon:Yue},Xue={$style:Wue},Kue=l5(jue,[["__cssModules",Xue]]);function Zue(e,t){const n=d.ref();return uL(e,r=>{n.value=r}),d.computed(()=>{const r=d.unref(n),a=d.unref(t),i=a.position??"top",o=a.gap??8;if(!r)return"";const s=r.offsetY+Math.floor(r.height/2),c=r.offsetX+Math.floor(r.width/2);return i==="top-left"?`left: ${r.offsetX}px; top: ${r.offsetY-o}px;`:i==="top"?`left: ${c}px; top: ${r.offsetY-o}px;`:i==="right"?`left: ${r.offsetX+r.width+o}px; top: ${s}px;`:i==="left"?`right: ${r.scrollWidth-r.x+o}px; top: ${s}px;`:i==="southwest"?`left: ${r.offsetX+r.width}px; top: ${r.offsetY+r.height+o}px;`:""})}function fL(e,t){return t(e)}function dL(e,t){if(e!=null)return t(e)}function Jue(e){return Array.isArray(e)?e:[e]}function que(e,t){UC(document,"click",n=>{document.contains(n.target)&&(Jue(e).map(r=>r.value).filter(r=>!!r).some(r=>r==null?void 0:r.contains(n.target))||t())})}const ece={},tce={class:"beak",width:"5",height:"9",viewBox:"0 0 3 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function nce(e,t){return d.openBlock(),d.createElementBlock("svg",tce,t[0]||(t[0]=[d.createElementVNode("path",{d:"M4.00222 8.00933L0 4.00711L4.00222 0.00488281L4.00222 8.00933Z",fill:"#24223D"},null,-1)]))}const rce=l5(ece,[["render",nce]]),jS=new Map,ace={name:"PlTooltip"},ice=d.defineComponent({...ace,props:{openDelay:{default:100},closeDelay:{default:1e3},position:{default:"top"},hide:{type:Boolean},gap:{default:8},element:{default:"div"},maxWidth:{default:"300px"}},emits:["tooltip:close"],setup(e,{emit:t}){const n=t,r=Symbol(),a=e,i=d.reactive({open:!1,over:!1,tooltipOpen:!1,key:Symbol()});jS.set(r,()=>f()),d.watch(()=>i.open,x=>{requestAnimationFrame(()=>{i.tooltipOpen=x})});let o=()=>{};const s=Oue(()=>window.dispatchEvent(new CustomEvent("adjust")),1e3),c=()=>{i.open=!0;for(const[x,k]of jS.entries())x!==r&&k()},f=()=>{i.open=!1,n("tooltip:close")},A=async()=>{a.hide||(s(),i.over=!0,o(),await Lue(100),i.over&&c())},p=()=>{i.over=!1,o=$ue(()=>{i.over||f()},a.closeDelay)};d.watch(()=>a.hide,x=>{x&&f()});const v=d.ref(),y=d.ref(),b=Zue(v,d.toRef(a));que([v,y],()=>f());const C=d.computed(()=>({"--pl-tooltip-max-width":a.maxWidth}));return d.onUnmounted(()=>{jS.delete(r)}),(x,k)=>(d.openBlock(),d.createBlock(d.resolveDynamicComponent(x.element),d.mergeProps(x.$attrs,{ref_key:"rootRef",ref:v,onClick:A,onMouseover:A,onMouseleave:p}),{default:d.withCtx(()=>[d.renderSlot(x.$slots,"default"),k[1]||(k[1]=d.createTextVNode()),x.$slots.tooltip&&i.open?(d.openBlock(),d.createBlock(d.Teleport,{key:0,to:"body"},[d.createVNode(d.Transition,{name:"tooltip-transition"},{default:d.withCtx(()=>[i.tooltipOpen?(d.openBlock(),d.createElementBlock("div",{key:0,class:"pl-tooltip__container",style:d.normalizeStyle(d.unref(b))},[d.createElementVNode("div",{ref_key:"tooltip",ref:y,class:d.normalizeClass(["pl-tooltip",x.position]),style:d.normalizeStyle(C.value),onMouseover:A,onMouseleave:p},[d.createElementVNode("div",null,[d.renderSlot(x.$slots,"tooltip")]),k[0]||(k[0]=d.createTextVNode()),d.createVNode(rce)],38)],4)):d.createCommentVNode("",!0)]),_:3})])):d.createCommentVNode("",!0)]),_:3},16))}}),oce={inheritAttrs:!1},lce={class:"double-contour"};function sce(e,t,n,r,a,i){return d.openBlock(),d.createElementBlock("div",lce,[d.createElementVNode("div",d.normalizeProps(d.guardReactiveProps(e.$attrs)),[d.renderSlot(e.$slots,"default")],16)])}const uce=l5(oce,[["render",sce]]);function cce(e){d.onMounted(e),d.onUpdated(e)}const YS=new WeakMap,WS=new ResizeObserver(e=>{for(const t of e)dL(YS.get(t.target),n=>n(t))});function fce(e,t){YS.set(e,t),WS.unobserve(e),WS.observe(e)}function dce(e){WS.unobserve(e),YS.delete(e)}const Ace=8,AL=4;function pce(e,t="label"){const n=new Set;cce(()=>{dL(e==null?void 0:e.value,r=>{const a=r.querySelector(t);a&&(n.add(a),fce(a,()=>{const i=Rue(()=>a.getBoundingClientRect().width+fL(Ace,o=>Number.isNaN(o)?AL:o+AL));r.style.getPropertyValue("--label-offset-right-x")!==`${i}px`&&r.style.setProperty("--label-offset-right-x",`${i}px`)}))})}),d.onBeforeUnmount(()=>{Array.from(n.values()).map(r=>dce(r))})}const hce=d.defineComponent({__name:"PlIcon16",props:{name:{},size:{}},setup(e){const t=e,n=d.computed(()=>t.size==="large"?"--icon-size: 24px":""),r=d.computed(()=>`icon-16 icon-${t.name}`);return(a,i)=>(d.openBlock(),d.createElementBlock("i",{style:d.normalizeStyle(n.value),class:d.normalizeClass([r.value,a.$style.icon])},null,6))}}),vce="_icon_1ugxm_2",mce={icon:vce},gce={$style:mce},s5=l5(hce,[["__cssModules",gce]]);function pL(e){return e!==null&&typeof e=="object"}function ny(e,t){return pL(e)&&pL(t)?Object.keys(e).length!==Object.keys(t).length?!1:Object.keys(e).every(n=>ny(e[n],t[n])):e===t}const yce=d.defineComponent({__name:"LongText",setup(e){d.useCssVars(A=>({"5deba9de":o.value}));const t=d.ref(!1),n=d.ref(),r=d.ref(!1),a=d.computed(()=>r.value&&t.value?"ui-lt-animate":""),i=gue(A=>r.value=A,500),o=d.computed(()=>{var A;return n.value?`${((A=n.value)==null?void 0:A.innerHTML.length)*.4}s`:"5s"});function s(){const A=lL(n.value,"span cannot be empty");t.value=A.clientWidth<A.scrollWidth}function c(){s(),i(!0)}function f(){i(!1)}return(A,p)=>(d.openBlock(),d.createElementBlock("div",d.mergeProps(A.$attrs,{class:"ui-lt-container"}),[d.createElementVNode("span",{onMouseover:c,onMouseleave:f},[d.createElementVNode("span",{ref_key:"span",ref:n,class:d.normalizeClass(a.value)},[d.renderSlot(A.$slots,"default")],2)],32)],16))}});function wce(e,t){const n=e.scrollTop,r=e.getBoundingClientRect().height,a=t.offsetTop,i=t.getBoundingClientRect().height;return a+i<r+n&&a>n}function Cce(e,t){const n=e.scrollTop,r=e.getBoundingClientRect().height,a=t.offsetTop,i=t.getBoundingClientRect().height;return a+i<r+n?"ceil":a>n?"floor":"visible"}function bce(e,t,n={}){const r=e.scrollTop,a=e.getBoundingClientRect().height,i=t.getBoundingClientRect().height,o=t.offsetTop,s=Cce(e,t);if(s==="visible")return;const c=f=>{const A=s==="floor"?o-(a-i):o;e.scrollTop=r+f*(A-r)};wce(e,t)||Vue({duration:n.duration||100,timing:Fue(f=>f),draw:c})}const Ece=d.defineComponent({__name:"DropdownOverlay",props:{root:{},gap:{}},setup(e,{expose:t}){const n=e,r=d.reactive({optionsHeight:0}),a=d.reactive({top:"0px",left:"0px",width:"0px"}),i=d.toRef(n,"root"),o=d.ref();return t({scrollIntoActive:()=>{const s=o.value;s&&mue(s.querySelector(".hovered-item"),c=>{bce(s,c)})},listRef:o}),d.watch(o,s=>{s&&requestAnimationFrame(()=>{const c=s.getBoundingClientRect();r.optionsHeight=c.height,window.dispatchEvent(new CustomEvent("adjust"))})}),uL(i,s=>{const c=document.body.getBoundingClientRect(),f=s.top-c.top,A=s.left-c.left,p=n.gap??0,v=f+s.height+p;v+r.optionsHeight>s.clientHeight?a.top=f-r.optionsHeight-p+"px":a.top=v+"px",a.left=A+"px",a.width=s.width+"px"}),(s,c)=>(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[d.createElementVNode("div",d.mergeProps({ref_key:"listRef",ref:o},s.$attrs,{style:a,tabindex:"-1"}),[d.renderSlot(s.$slots,"default",{ref:"list"})],16)]))}});typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const hL=()=>{};function xce(e,t){function n(...r){return new Promise((a,i)=>{Promise.resolve(e(()=>t.apply(this,r),{fn:t,thisArg:this,args:r})).then(a).catch(i)})}return n}function Sce(e,t={}){let n,r,a=hL;const i=o=>{clearTimeout(o),a(),a=hL};return o=>{const s=d.toValue(e),c=d.toValue(t.maxWait);return n&&i(n),s<=0||c!==void 0&&c<=0?(r&&(i(r),r=null),Promise.resolve(o())):new Promise((f,A)=>{a=t.rejectOnCancel?A:f,c&&!r&&(r=setTimeout(()=>{n&&i(n),r=null,f(o())},c)),n=setTimeout(()=>{r&&i(r),r=null,f(o())},s)})}}function Bce(e,t=200,n={}){return xce(Sce(t,n),e)}function kce(e,t=200,n={}){const r=d.ref(e.value),a=Bce(()=>{r.value=e.value},t,n);return d.watch(e,()=>a()),r}var li;(function(e){e.assertEqual=a=>a;function t(a){}e.assertIs=t;function n(a){throw new Error}e.assertNever=n,e.arrayToEnum=a=>{const i={};for(const o of a)i[o]=o;return i},e.getValidEnumValues=a=>{const i=e.objectKeys(a).filter(s=>typeof a[a[s]]!="number"),o={};for(const s of i)o[s]=a[s];return e.objectValues(o)},e.objectValues=a=>e.objectKeys(a).map(function(i){return a[i]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&i.push(o);return i},e.find=(a,i)=>{for(const o of a)if(i(o))return o},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function r(a,i=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}e.joinValues=r,e.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(li||(li={}));var XS;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(XS||(XS={}));const vn=li.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),uv=e=>{switch(typeof e){case"undefined":return vn.undefined;case"string":return vn.string;case"number":return isNaN(e)?vn.nan:vn.number;case"boolean":return vn.boolean;case"function":return vn.function;case"bigint":return vn.bigint;case"symbol":return vn.symbol;case"object":return Array.isArray(e)?vn.array:e===null?vn.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?vn.promise:typeof Map<"u"&&e instanceof Map?vn.map:typeof Set<"u"&&e instanceof Set?vn.set:typeof Date<"u"&&e instanceof Date?vn.date:vn.object;default:return vn.unknown}},Ut=li.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Tce=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");let Ip=class ite extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(i){return i.message},r={_errors:[]},a=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let s=r,c=0;for(;c<o.path.length;){const f=o.path[c];c===o.path.length-1?(s[f]=s[f]||{_errors:[]},s[f]._errors.push(n(o))):s[f]=s[f]||{_errors:[]},s=s[f],c++}}};return a(this),r}static assert(t){if(!(t instanceof ite))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,li.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const a of this.issues)a.path.length>0?(n[a.path[0]]=n[a.path[0]]||[],n[a.path[0]].push(t(a))):r.push(t(a));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};Ip.create=e=>new Ip(e);const ry=(e,t)=>{let n;switch(e.code){case Ut.invalid_type:e.received===vn.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Ut.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,li.jsonStringifyReplacer)}`;break;case Ut.unrecognized_keys:n=`Unrecognized key(s) in object: ${li.joinValues(e.keys,", ")}`;break;case Ut.invalid_union:n="Invalid input";break;case Ut.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${li.joinValues(e.options)}`;break;case Ut.invalid_enum_value:n=`Invalid enum value. Expected ${li.joinValues(e.options)}, received '${e.received}'`;break;case Ut.invalid_arguments:n="Invalid function arguments";break;case Ut.invalid_return_type:n="Invalid function return type";break;case Ut.invalid_date:n="Invalid date";break;case Ut.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:li.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Ut.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Ut.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Ut.custom:n="Invalid input";break;case Ut.invalid_intersection_types:n="Intersection results could not be merged";break;case Ut.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Ut.not_finite:n="Number must be finite";break;default:n=t.defaultError,li.assertNever(e)}return{message:n}};let vL=ry;function _ce(e){vL=e}function GC(){return vL}const jC=e=>{const{data:t,path:n,errorMaps:r,issueData:a}=e,i=[...n,...a.path||[]],o={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let s="";const c=r.filter(f=>!!f).slice().reverse();for(const f of c)s=f(o,{data:t,defaultError:s}).message;return{...a,path:i,message:s}},Dce=[];function cn(e,t){const n=GC(),r=jC({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===ry?void 0:ry].filter(a=>!!a)});e.common.issues.push(r)}let gd=class ote{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const a of n){if(a.status==="aborted")return _r;a.status==="dirty"&&t.dirty(),r.push(a.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const a of n){const i=await a.key,o=await a.value;r.push({key:i,value:o})}return ote.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const a of n){const{key:i,value:o}=a;if(i.status==="aborted"||o.status==="aborted")return _r;i.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(r[i.value]=o.value)}return{status:t.value,value:r}}};const _r=Object.freeze({status:"aborted"}),YC=e=>({status:"dirty",value:e}),kf=e=>({status:"valid",value:e}),KS=e=>e.status==="aborted",ZS=e=>e.status==="dirty",u5=e=>e.status==="valid",c5=e=>typeof Promise<"u"&&e instanceof Promise;function WC(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function mL(e,t,n,r,a){if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var jn;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(jn||(jn={}));var f5,d5;let R0=class{constructor(t,n,r,a){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};const gL=(e,t)=>{if(u5(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Ip(e.common.issues);return this._error=n,this._error}}};function Jr(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:a}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:(i,o)=>{var s,c;const{message:f}=e;return i.code==="invalid_enum_value"?{message:f??o.defaultError}:typeof o.data>"u"?{message:(s=f??r)!==null&&s!==void 0?s:o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:(c=f??n)!==null&&c!==void 0?c:o.defaultError}},description:a}}let da=class{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return uv(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:uv(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new gd,ctx:{common:t.parent.common,data:t.data,parsedType:uv(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(c5(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const a={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:uv(t)},i=this._parseSync({data:t,path:a.path,parent:a});return gL(a,i)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:uv(t)},a=this._parse({data:t,path:r.path,parent:r}),i=await(c5(a)?a:Promise.resolve(a));return gL(r,i)}refine(t,n){const r=a=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(a):n;return this._refinement((a,i)=>{const o=t(a),s=()=>i.addIssue({code:Ut.custom,...r(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(t,n){return this._refinement((r,a)=>t(r)?!0:(a.addIssue(typeof n=="function"?n(r,a):n),!1))}_refinement(t){return new Np({schema:this,typeName:wr.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return N0.create(this,this._def)}nullable(){return dv.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return qm.create(this,this._def)}promise(){return oy.create(this,this._def)}or(t){return y5.create([this,t],this._def)}and(t){return w5.create(this,t,this._def)}transform(t){return new Np({...Jr(this._def),schema:this,typeName:wr.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new B5({...Jr(this._def),innerType:this,defaultValue:n,typeName:wr.ZodDefault})}brand(){return new eB({typeName:wr.ZodBranded,type:this,...Jr(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new k5({...Jr(this._def),innerType:this,catchValue:n,typeName:wr.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return tB.create(this,t)}readonly(){return T5.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};const Pce=/^c[^\s-]{8,}$/i,Mce=/^[0-9a-z]+$/,Hce=/^[0-9A-HJKMNP-TV-Z]{26}$/,Ice=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Rce=/^[a-z0-9_-]{21}$/i,Nce=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Lce=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,$ce="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let JS;const Fce=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Vce=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Oce=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,yL="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Qce=new RegExp(`^${yL}$`);function wL(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function zce(e){return new RegExp(`^${wL(e)}$`)}function CL(e){let t=`${yL}T${wL(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function Uce(e,t){return!!((t==="v4"||!t)&&Fce.test(e)||(t==="v6"||!t)&&Vce.test(e))}class Rp extends da{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==vn.string){const a=this._getOrReturnCtx(t);return cn(a,{code:Ut.invalid_type,expected:vn.string,received:a.parsedType}),_r}const n=new gd;let r;for(const a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(r=this._getOrReturnCtx(t,r),cn(r,{code:Ut.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")t.data.length>a.value&&(r=this._getOrReturnCtx(t,r),cn(r,{code:Ut.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const i=t.data.length>a.value,o=t.data.length<a.value;(i||o)&&(r=this._getOrReturnCtx(t,r),i?cn(r,{code:Ut.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&cn(r,{code:Ut.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")Lce.test(t.data)||(r=this._getOrReturnCtx(t,r),cn(r,{validation:"email",code:Ut.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")JS||(JS=new RegExp($ce,"u")),JS.test(t.data)||(r=this._getOrReturnCtx(t,r),cn(r,{validation:"emoji",code:Ut.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")Ice.test(t.data)||(r=this._getOrReturnCtx(t,r),cn(r,{validation:"uuid",code:Ut.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")Rce.test(t.data)||(r=this._getOrReturnCtx(t,r),cn(r,{validation:"nanoid",code:Ut.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")Pce.test(t.data)||(r=this._getOrReturnCtx(t,r),cn(r,{validation:"cuid",code:Ut.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")Mce.test(t.data)||(r=this._getOrReturnCtx(t,r),cn(r,{validation:"cuid2",code:Ut.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")Hce.test(t.data)||(r=this._getOrReturnCtx(t,r),cn(r,{validation:"ulid",code:Ut.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),cn(r,{validation:"url",code:Ut.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),cn(r,{validation:"regex",code:Ut.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(r=this._getOrReturnCtx(t,r),cn(r,{code:Ut.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(r=this._getOrReturnCtx(t,r),cn(r,{code:Ut.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(r=this._getOrReturnCtx(t,r),cn(r,{code:Ut.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?CL(a).test(t.data)||(r=this._getOrReturnCtx(t,r),cn(r,{code:Ut.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?Qce.test(t.data)||(r=this._getOrReturnCtx(t,r),cn(r,{code:Ut.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?zce(a).test(t.data)||(r=this._getOrReturnCtx(t,r),cn(r,{code:Ut.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?Nce.test(t.data)||(r=this._getOrReturnCtx(t,r),cn(r,{validation:"duration",code:Ut.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?Uce(t.data,a.version)||(r=this._getOrReturnCtx(t,r),cn(r,{validation:"ip",code:Ut.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?Oce.test(t.data)||(r=this._getOrReturnCtx(t,r),cn(r,{validation:"base64",code:Ut.invalid_string,message:a.message}),n.dirty()):li.assertNever(a);return{status:n.value,value:t.data}}_regex(t,n,r){return this.refinement(a=>t.test(a),{validation:n,code:Ut.invalid_string,...jn.errToObj(r)})}_addCheck(t){return new Rp({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...jn.errToObj(t)})}url(t){return this._addCheck({kind:"url",...jn.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...jn.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...jn.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...jn.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...jn.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...jn.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...jn.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...jn.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...jn.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...jn.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...jn.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...jn.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...jn.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...jn.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...jn.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...jn.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...jn.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...jn.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...jn.errToObj(n)})}nonempty(t){return this.min(1,jn.errToObj(t))}trim(){return new Rp({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Rp({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Rp({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Rp.create=e=>{var t;return new Rp({checks:[],typeName:wr.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Jr(e)})};function Gce(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,a=n>r?n:r,i=parseInt(e.toFixed(a).replace(".","")),o=parseInt(t.toFixed(a).replace(".",""));return i%o/Math.pow(10,a)}let A5=class $I extends da{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==vn.number){const a=this._getOrReturnCtx(t);return cn(a,{code:Ut.invalid_type,expected:vn.number,received:a.parsedType}),_r}let n;const r=new gd;for(const a of this._def.checks)a.kind==="int"?li.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),cn(n,{code:Ut.invalid_type,expected:"integer",received:"float",message:a.message}),r.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),cn(n,{code:Ut.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),cn(n,{code:Ut.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):a.kind==="multipleOf"?Gce(t.data,a.value)!==0&&(n=this._getOrReturnCtx(t,n),cn(n,{code:Ut.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),cn(n,{code:Ut.not_finite,message:a.message}),r.dirty()):li.assertNever(a);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,jn.toString(n))}gt(t,n){return this.setLimit("min",t,!1,jn.toString(n))}lte(t,n){return this.setLimit("max",t,!0,jn.toString(n))}lt(t,n){return this.setLimit("max",t,!1,jn.toString(n))}setLimit(t,n,r,a){return new $I({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:jn.toString(a)}]})}_addCheck(t){return new $I({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:jn.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:jn.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:jn.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:jn.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:jn.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:jn.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:jn.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:jn.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:jn.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&li.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}};A5.create=e=>new A5({checks:[],typeName:wr.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Jr(e)});let p5=class FI extends da{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==vn.bigint){const a=this._getOrReturnCtx(t);return cn(a,{code:Ut.invalid_type,expected:vn.bigint,received:a.parsedType}),_r}let n;const r=new gd;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),cn(n,{code:Ut.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),cn(n,{code:Ut.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),cn(n,{code:Ut.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):li.assertNever(a);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,jn.toString(n))}gt(t,n){return this.setLimit("min",t,!1,jn.toString(n))}lte(t,n){return this.setLimit("max",t,!0,jn.toString(n))}lt(t,n){return this.setLimit("max",t,!1,jn.toString(n))}setLimit(t,n,r,a){return new FI({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:jn.toString(a)}]})}_addCheck(t){return new FI({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:jn.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:jn.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:jn.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:jn.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:jn.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};p5.create=e=>{var t;return new p5({checks:[],typeName:wr.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Jr(e)})};let h5=class extends da{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==vn.boolean){const n=this._getOrReturnCtx(t);return cn(n,{code:Ut.invalid_type,expected:vn.boolean,received:n.parsedType}),_r}return kf(t.data)}};h5.create=e=>new h5({typeName:wr.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Jr(e)});let v5=class lte extends da{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==vn.date){const a=this._getOrReturnCtx(t);return cn(a,{code:Ut.invalid_type,expected:vn.date,received:a.parsedType}),_r}if(isNaN(t.data.getTime())){const a=this._getOrReturnCtx(t);return cn(a,{code:Ut.invalid_date}),_r}const n=new gd;let r;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(r=this._getOrReturnCtx(t,r),cn(r,{code:Ut.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(r=this._getOrReturnCtx(t,r),cn(r,{code:Ut.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):li.assertNever(a);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new lte({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:jn.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:jn.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};v5.create=e=>new v5({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:wr.ZodDate,...Jr(e)});let XC=class extends da{_parse(t){if(this._getType(t)!==vn.symbol){const n=this._getOrReturnCtx(t);return cn(n,{code:Ut.invalid_type,expected:vn.symbol,received:n.parsedType}),_r}return kf(t.data)}};XC.create=e=>new XC({typeName:wr.ZodSymbol,...Jr(e)});class m5 extends da{_parse(t){if(this._getType(t)!==vn.undefined){const n=this._getOrReturnCtx(t);return cn(n,{code:Ut.invalid_type,expected:vn.undefined,received:n.parsedType}),_r}return kf(t.data)}}m5.create=e=>new m5({typeName:wr.ZodUndefined,...Jr(e)});class g5 extends da{_parse(t){if(this._getType(t)!==vn.null){const n=this._getOrReturnCtx(t);return cn(n,{code:Ut.invalid_type,expected:vn.null,received:n.parsedType}),_r}return kf(t.data)}}g5.create=e=>new g5({typeName:wr.ZodNull,...Jr(e)});let ay=class extends da{constructor(){super(...arguments),this._any=!0}_parse(t){return kf(t.data)}};ay.create=e=>new ay({typeName:wr.ZodAny,...Jr(e)});let Jm=class extends da{constructor(){super(...arguments),this._unknown=!0}_parse(t){return kf(t.data)}};Jm.create=e=>new Jm({typeName:wr.ZodUnknown,...Jr(e)});class Oh extends da{_parse(t){const n=this._getOrReturnCtx(t);return cn(n,{code:Ut.invalid_type,expected:vn.never,received:n.parsedType}),_r}}Oh.create=e=>new Oh({typeName:wr.ZodNever,...Jr(e)});class KC extends da{_parse(t){if(this._getType(t)!==vn.undefined){const n=this._getOrReturnCtx(t);return cn(n,{code:Ut.invalid_type,expected:vn.void,received:n.parsedType}),_r}return kf(t.data)}}KC.create=e=>new KC({typeName:wr.ZodVoid,...Jr(e)});let qm=class Jx extends da{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),a=this._def;if(n.parsedType!==vn.array)return cn(n,{code:Ut.invalid_type,expected:vn.array,received:n.parsedType}),_r;if(a.exactLength!==null){const o=n.data.length>a.exactLength.value,s=n.data.length<a.exactLength.value;(o||s)&&(cn(n,{code:o?Ut.too_big:Ut.too_small,minimum:s?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&n.data.length<a.minLength.value&&(cn(n,{code:Ut.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&n.data.length>a.maxLength.value&&(cn(n,{code:Ut.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,s)=>a.type._parseAsync(new R0(n,o,n.path,s)))).then(o=>gd.mergeArray(r,o));const i=[...n.data].map((o,s)=>a.type._parseSync(new R0(n,o,n.path,s)));return gd.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new Jx({...this._def,minLength:{value:t,message:jn.toString(n)}})}max(t,n){return new Jx({...this._def,maxLength:{value:t,message:jn.toString(n)}})}length(t,n){return new Jx({...this._def,exactLength:{value:t,message:jn.toString(n)}})}nonempty(t){return this.min(1,t)}};qm.create=(e,t)=>new qm({type:e,minLength:null,maxLength:null,exactLength:null,typeName:wr.ZodArray,...Jr(t)});function iy(e){if(e instanceof IA){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=N0.create(iy(r))}return new IA({...e._def,shape:()=>t})}else return e instanceof qm?new qm({...e._def,type:iy(e.element)}):e instanceof N0?N0.create(iy(e.unwrap())):e instanceof dv?dv.create(iy(e.unwrap())):e instanceof fv?fv.create(e.items.map(t=>iy(t))):e}let IA=class B0 extends da{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=li.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==vn.object){const c=this._getOrReturnCtx(t);return cn(c,{code:Ut.invalid_type,expected:vn.object,received:c.parsedType}),_r}const{status:n,ctx:r}=this._processInputParams(t),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof Oh&&this._def.unknownKeys==="strip"))for(const c in r.data)i.includes(c)||o.push(c);const s=[];for(const c of i){const f=a[c],A=r.data[c];s.push({key:{status:"valid",value:c},value:f._parse(new R0(r,A,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof Oh){const c=this._def.unknownKeys;if(c==="passthrough")for(const f of o)s.push({key:{status:"valid",value:f},value:{status:"valid",value:r.data[f]}});else if(c==="strict")o.length>0&&(cn(r,{code:Ut.unrecognized_keys,keys:o}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const f of o){const A=r.data[f];s.push({key:{status:"valid",value:f},value:c._parse(new R0(r,A,r.path,f)),alwaysSet:f in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const c=[];for(const f of s){const A=await f.key,p=await f.value;c.push({key:A,value:p,alwaysSet:f.alwaysSet})}return c}).then(c=>gd.mergeObjectSync(n,c)):gd.mergeObjectSync(n,s)}get shape(){return this._def.shape()}strict(t){return jn.errToObj,new B0({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var a,i,o,s;const c=(o=(i=(a=this._def).errorMap)===null||i===void 0?void 0:i.call(a,n,r).message)!==null&&o!==void 0?o:r.defaultError;return n.code==="unrecognized_keys"?{message:(s=jn.errToObj(t).message)!==null&&s!==void 0?s:c}:{message:c}}}:{}})}strip(){return new B0({...this._def,unknownKeys:"strip"})}passthrough(){return new B0({...this._def,unknownKeys:"passthrough"})}extend(t){return new B0({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new B0({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:wr.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new B0({...this._def,catchall:t})}pick(t){const n={};return li.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new B0({...this._def,shape:()=>n})}omit(t){const n={};return li.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new B0({...this._def,shape:()=>n})}deepPartial(){return iy(this)}partial(t){const n={};return li.objectKeys(this.shape).forEach(r=>{const a=this.shape[r];t&&!t[r]?n[r]=a:n[r]=a.optional()}),new B0({...this._def,shape:()=>n})}required(t){const n={};return li.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof N0;)a=a._def.innerType;n[r]=a}}),new B0({...this._def,shape:()=>n})}keyof(){return EL(li.objectKeys(this.shape))}};IA.create=(e,t)=>new IA({shape:()=>e,unknownKeys:"strip",catchall:Oh.create(),typeName:wr.ZodObject,...Jr(t)}),IA.strictCreate=(e,t)=>new IA({shape:()=>e,unknownKeys:"strict",catchall:Oh.create(),typeName:wr.ZodObject,...Jr(t)}),IA.lazycreate=(e,t)=>new IA({shape:e,unknownKeys:"strip",catchall:Oh.create(),typeName:wr.ZodObject,...Jr(t)});class y5 extends da{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function a(i){for(const s of i)if(s.result.status==="valid")return s.result;for(const s of i)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;const o=i.map(s=>new Ip(s.ctx.common.issues));return cn(n,{code:Ut.invalid_union,unionErrors:o}),_r}if(n.common.async)return Promise.all(r.map(async i=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(a);{let i;const o=[];for(const c of r){const f={...n,common:{...n.common,issues:[]},parent:null},A=c._parseSync({data:n.data,path:n.path,parent:f});if(A.status==="valid")return A;A.status==="dirty"&&!i&&(i={result:A,ctx:f}),f.common.issues.length&&o.push(f.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const s=o.map(c=>new Ip(c));return cn(n,{code:Ut.invalid_union,unionErrors:s}),_r}}get options(){return this._def.options}}y5.create=(e,t)=>new y5({options:e,typeName:wr.ZodUnion,...Jr(t)});const cv=e=>e instanceof b5?cv(e.schema):e instanceof Np?cv(e.innerType()):e instanceof E5?[e.value]:e instanceof x5?e.options:e instanceof S5?li.objectValues(e.enum):e instanceof B5?cv(e._def.innerType):e instanceof m5?[void 0]:e instanceof g5?[null]:e instanceof N0?[void 0,...cv(e.unwrap())]:e instanceof dv?[null,...cv(e.unwrap())]:e instanceof eB||e instanceof T5?cv(e.unwrap()):e instanceof k5?cv(e._def.innerType):[];class ZC extends da{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==vn.object)return cn(n,{code:Ut.invalid_type,expected:vn.object,received:n.parsedType}),_r;const r=this.discriminator,a=n.data[r],i=this.optionsMap.get(a);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(cn(n,{code:Ut.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),_r)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const a=new Map;for(const i of n){const o=cv(i.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const s of o){if(a.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);a.set(s,i)}}return new ZC({typeName:wr.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:a,...Jr(r)})}}function qS(e,t){const n=uv(e),r=uv(t);if(e===t)return{valid:!0,data:e};if(n===vn.object&&r===vn.object){const a=li.objectKeys(t),i=li.objectKeys(e).filter(s=>a.indexOf(s)!==-1),o={...e,...t};for(const s of i){const c=qS(e[s],t[s]);if(!c.valid)return{valid:!1};o[s]=c.data}return{valid:!0,data:o}}else if(n===vn.array&&r===vn.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let i=0;i<e.length;i++){const o=e[i],s=t[i],c=qS(o,s);if(!c.valid)return{valid:!1};a.push(c.data)}return{valid:!0,data:a}}else return n===vn.date&&r===vn.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class w5 extends da{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=(i,o)=>{if(KS(i)||KS(o))return _r;const s=qS(i.value,o.value);return s.valid?((ZS(i)||ZS(o))&&n.dirty(),{status:n.value,value:s.data}):(cn(r,{code:Ut.invalid_intersection_types}),_r)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,o])=>a(i,o)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}w5.create=(e,t,n)=>new w5({left:e,right:t,typeName:wr.ZodIntersection,...Jr(n)});let fv=class ste extends da{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==vn.array)return cn(r,{code:Ut.invalid_type,expected:vn.array,received:r.parsedType}),_r;if(r.data.length<this._def.items.length)return cn(r,{code:Ut.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_r;!this._def.rest&&r.data.length>this._def.items.length&&(cn(r,{code:Ut.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const a=[...r.data].map((i,o)=>{const s=this._def.items[o]||this._def.rest;return s?s._parse(new R0(r,i,r.path,o)):null}).filter(i=>!!i);return r.common.async?Promise.all(a).then(i=>gd.mergeArray(n,i)):gd.mergeArray(n,a)}get items(){return this._def.items}rest(t){return new ste({...this._def,rest:t})}};fv.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new fv({items:e,typeName:wr.ZodTuple,rest:null,...Jr(t)})};class C5 extends da{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==vn.object)return cn(r,{code:Ut.invalid_type,expected:vn.object,received:r.parsedType}),_r;const a=[],i=this._def.keyType,o=this._def.valueType;for(const s in r.data)a.push({key:i._parse(new R0(r,s,r.path,s)),value:o._parse(new R0(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?gd.mergeObjectAsync(n,a):gd.mergeObjectSync(n,a)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof da?new C5({keyType:t,valueType:n,typeName:wr.ZodRecord,...Jr(r)}):new C5({keyType:Rp.create(),valueType:t,typeName:wr.ZodRecord,...Jr(n)})}}let JC=class extends da{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==vn.map)return cn(r,{code:Ut.invalid_type,expected:vn.map,received:r.parsedType}),_r;const a=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([s,c],f)=>({key:a._parse(new R0(r,s,r.path,[f,"key"])),value:i._parse(new R0(r,c,r.path,[f,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const c of o){const f=await c.key,A=await c.value;if(f.status==="aborted"||A.status==="aborted")return _r;(f.status==="dirty"||A.status==="dirty")&&n.dirty(),s.set(f.value,A.value)}return{status:n.value,value:s}})}else{const s=new Map;for(const c of o){const f=c.key,A=c.value;if(f.status==="aborted"||A.status==="aborted")return _r;(f.status==="dirty"||A.status==="dirty")&&n.dirty(),s.set(f.value,A.value)}return{status:n.value,value:s}}}};JC.create=(e,t,n)=>new JC({valueType:t,keyType:e,typeName:wr.ZodMap,...Jr(n)});class eg extends da{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==vn.set)return cn(r,{code:Ut.invalid_type,expected:vn.set,received:r.parsedType}),_r;const a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(cn(r,{code:Ut.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),n.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(cn(r,{code:Ut.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),n.dirty());const i=this._def.valueType;function o(c){const f=new Set;for(const A of c){if(A.status==="aborted")return _r;A.status==="dirty"&&n.dirty(),f.add(A.value)}return{status:n.value,value:f}}const s=[...r.data.values()].map((c,f)=>i._parse(new R0(r,c,r.path,f)));return r.common.async?Promise.all(s).then(c=>o(c)):o(s)}min(t,n){return new eg({...this._def,minSize:{value:t,message:jn.toString(n)}})}max(t,n){return new eg({...this._def,maxSize:{value:t,message:jn.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}eg.create=(e,t)=>new eg({valueType:e,minSize:null,maxSize:null,typeName:wr.ZodSet,...Jr(t)});let bL=class qx extends da{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==vn.function)return cn(n,{code:Ut.invalid_type,expected:vn.function,received:n.parsedType}),_r;function r(s,c){return jC({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,GC(),ry].filter(f=>!!f),issueData:{code:Ut.invalid_arguments,argumentsError:c}})}function a(s,c){return jC({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,GC(),ry].filter(f=>!!f),issueData:{code:Ut.invalid_return_type,returnTypeError:c}})}const i={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof oy){const s=this;return kf(async function(...c){const f=new Ip([]),A=await s._def.args.parseAsync(c,i).catch(v=>{throw f.addIssue(r(c,v)),f}),p=await Reflect.apply(o,this,A);return await s._def.returns._def.type.parseAsync(p,i).catch(v=>{throw f.addIssue(a(p,v)),f})})}else{const s=this;return kf(function(...c){const f=s._def.args.safeParse(c,i);if(!f.success)throw new Ip([r(c,f.error)]);const A=Reflect.apply(o,this,f.data),p=s._def.returns.safeParse(A,i);if(!p.success)throw new Ip([a(A,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new qx({...this._def,args:fv.create(t).rest(Jm.create())})}returns(t){return new qx({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new qx({args:t||fv.create([]).rest(Jm.create()),returns:n||Jm.create(),typeName:wr.ZodFunction,...Jr(r)})}};class b5 extends da{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}b5.create=(e,t)=>new b5({getter:e,typeName:wr.ZodLazy,...Jr(t)});class E5 extends da{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return cn(n,{received:n.data,code:Ut.invalid_literal,expected:this._def.value}),_r}return{status:"valid",value:t.data}}get value(){return this._def.value}}E5.create=(e,t)=>new E5({value:e,typeName:wr.ZodLiteral,...Jr(t)});function EL(e,t){return new x5({values:e,typeName:wr.ZodEnum,...Jr(t)})}let x5=class VI extends da{constructor(){super(...arguments),f5.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return cn(n,{expected:li.joinValues(r),received:n.parsedType,code:Ut.invalid_type}),_r}if(WC(this,f5)||mL(this,f5,new Set(this._def.values)),!WC(this,f5).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return cn(n,{received:n.data,code:Ut.invalid_enum_value,options:r}),_r}return kf(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return VI.create(t,{...this._def,...n})}exclude(t,n=this._def){return VI.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}};f5=new WeakMap,x5.create=EL;let S5=class extends da{constructor(){super(...arguments),d5.set(this,void 0)}_parse(t){const n=li.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==vn.string&&r.parsedType!==vn.number){const a=li.objectValues(n);return cn(r,{expected:li.joinValues(a),received:r.parsedType,code:Ut.invalid_type}),_r}if(WC(this,d5)||mL(this,d5,new Set(li.getValidEnumValues(this._def.values))),!WC(this,d5).has(t.data)){const a=li.objectValues(n);return cn(r,{received:r.data,code:Ut.invalid_enum_value,options:a}),_r}return kf(t.data)}get enum(){return this._def.values}};d5=new WeakMap,S5.create=(e,t)=>new S5({values:e,typeName:wr.ZodNativeEnum,...Jr(t)});class oy extends da{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==vn.promise&&n.common.async===!1)return cn(n,{code:Ut.invalid_type,expected:vn.promise,received:n.parsedType}),_r;const r=n.parsedType===vn.promise?n.data:Promise.resolve(n.data);return kf(r.then(a=>this._def.type.parseAsync(a,{path:n.path,errorMap:n.common.contextualErrorMap})))}}oy.create=(e,t)=>new oy({type:e,typeName:wr.ZodPromise,...Jr(t)});let Np=class extends da{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===wr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=this._def.effect||null,i={addIssue:o=>{cn(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const o=a.transform(r.data,i);if(r.common.async)return Promise.resolve(o).then(async s=>{if(n.value==="aborted")return _r;const c=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return c.status==="aborted"?_r:c.status==="dirty"||n.value==="dirty"?YC(c.value):c});{if(n.value==="aborted")return _r;const s=this._def.schema._parseSync({data:o,path:r.path,parent:r});return s.status==="aborted"?_r:s.status==="dirty"||n.value==="dirty"?YC(s.value):s}}if(a.type==="refinement"){const o=s=>{const c=a.refinement(s,i);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?_r:(s.status==="dirty"&&n.dirty(),o(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?_r:(s.status==="dirty"&&n.dirty(),o(s.value).then(()=>({status:n.value,value:s.value}))))}if(a.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!u5(o))return o;const s=a.transform(o.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>u5(o)?Promise.resolve(a.transform(o.value,i)).then(s=>({status:n.value,value:s})):o);li.assertNever(a)}};Np.create=(e,t,n)=>new Np({schema:e,typeName:wr.ZodEffects,effect:t,...Jr(n)}),Np.createWithPreprocess=(e,t,n)=>new Np({schema:t,effect:{type:"preprocess",transform:e},typeName:wr.ZodEffects,...Jr(n)});let N0=class extends da{_parse(t){return this._getType(t)===vn.undefined?kf(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};N0.create=(e,t)=>new N0({innerType:e,typeName:wr.ZodOptional,...Jr(t)});class dv extends da{_parse(t){return this._getType(t)===vn.null?kf(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}dv.create=(e,t)=>new dv({innerType:e,typeName:wr.ZodNullable,...Jr(t)});let B5=class extends da{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===vn.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};B5.create=(e,t)=>new B5({innerType:e,typeName:wr.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Jr(t)});class k5 extends da{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return c5(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ip(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Ip(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}k5.create=(e,t)=>new k5({innerType:e,typeName:wr.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Jr(t)});class qC extends da{_parse(t){if(this._getType(t)!==vn.nan){const n=this._getOrReturnCtx(t);return cn(n,{code:Ut.invalid_type,expected:vn.nan,received:n.parsedType}),_r}return{status:"valid",value:t.data}}}qC.create=e=>new qC({typeName:wr.ZodNaN,...Jr(e)});const jce=Symbol("zod_brand");class eB extends da{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}let tB=class ute extends da{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?_r:a.status==="dirty"?(n.dirty(),YC(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?_r:a.status==="dirty"?(n.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(t,n){return new ute({in:t,out:n,typeName:wr.ZodPipeline})}},T5=class extends da{_parse(t){const n=this._def.innerType._parse(t),r=a=>(u5(a)&&(a.value=Object.freeze(a.value)),a);return c5(n)?n.then(a=>r(a)):r(n)}unwrap(){return this._def.innerType}};T5.create=(e,t)=>new T5({innerType:e,typeName:wr.ZodReadonly,...Jr(t)});function xL(e,t={},n){return e?ay.create().superRefine((r,a)=>{var i,o;if(!e(r)){const s=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,c=(o=(i=s.fatal)!==null&&i!==void 0?i:n)!==null&&o!==void 0?o:!0,f=typeof s=="string"?{message:s}:s;a.addIssue({code:"custom",...f,fatal:c})}}):ay.create()}const Yce={object:IA.lazycreate};var wr;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(wr||(wr={}));const Wce=(e,t={message:`Input not instance of ${e.name}`})=>xL(n=>n instanceof e,t),SL=Rp.create,BL=A5.create,Xce=qC.create,Kce=p5.create,kL=h5.create,Zce=v5.create,Jce=XC.create,qce=m5.create,efe=g5.create,tfe=ay.create,nfe=Jm.create,rfe=Oh.create,afe=KC.create,ife=qm.create,ofe=IA.create,lfe=IA.strictCreate,sfe=y5.create,ufe=ZC.create,cfe=w5.create,ffe=fv.create,dfe=C5.create,Afe=JC.create,pfe=eg.create,hfe=bL.create,vfe=b5.create,mfe=E5.create,gfe=x5.create,yfe=S5.create,wfe=oy.create,TL=Np.create,Cfe=N0.create,bfe=dv.create,Efe=Np.createWithPreprocess,xfe=tB.create;var qa=Object.freeze({__proto__:null,defaultErrorMap:ry,setErrorMap:_ce,getErrorMap:GC,makeIssue:jC,EMPTY_PATH:Dce,addIssueToContext:cn,ParseStatus:gd,INVALID:_r,DIRTY:YC,OK:kf,isAborted:KS,isDirty:ZS,isValid:u5,isAsync:c5,get util(){return li},get objectUtil(){return XS},ZodParsedType:vn,getParsedType:uv,ZodType:da,datetimeRegex:CL,ZodString:Rp,ZodNumber:A5,ZodBigInt:p5,ZodBoolean:h5,ZodDate:v5,ZodSymbol:XC,ZodUndefined:m5,ZodNull:g5,ZodAny:ay,ZodUnknown:Jm,ZodNever:Oh,ZodVoid:KC,ZodArray:qm,ZodObject:IA,ZodUnion:y5,ZodDiscriminatedUnion:ZC,ZodIntersection:w5,ZodTuple:fv,ZodRecord:C5,ZodMap:JC,ZodSet:eg,ZodFunction:bL,ZodLazy:b5,ZodLiteral:E5,ZodEnum:x5,ZodNativeEnum:S5,ZodPromise:oy,ZodEffects:Np,ZodTransformer:Np,ZodOptional:N0,ZodNullable:dv,ZodDefault:B5,ZodCatch:k5,ZodNaN:qC,BRAND:jce,ZodBranded:eB,ZodPipeline:tB,ZodReadonly:T5,custom:xL,Schema:da,ZodSchema:da,late:Yce,get ZodFirstPartyTypeKind(){return wr},coerce:{string:e=>Rp.create({...e,coerce:!0}),number:e=>A5.create({...e,coerce:!0}),boolean:e=>h5.create({...e,coerce:!0}),bigint:e=>p5.create({...e,coerce:!0}),date:e=>v5.create({...e,coerce:!0})},any:tfe,array:ife,bigint:Kce,boolean:kL,date:Zce,discriminatedUnion:ufe,effect:TL,enum:gfe,function:hfe,instanceof:Wce,intersection:cfe,lazy:vfe,literal:mfe,map:Afe,nan:Xce,nativeEnum:yfe,never:rfe,null:efe,nullable:bfe,number:BL,object:ofe,oboolean:()=>kL().optional(),onumber:()=>BL().optional(),optional:Cfe,ostring:()=>SL().optional(),pipeline:xfe,preprocess:Efe,promise:wfe,record:dfe,set:pfe,strictObject:lfe,string:SL,symbol:Jce,transformer:TL,tuple:ffe,undefined:qce,union:sfe,unknown:nfe,void:afe,NEVER:_r,ZodIssueCode:Ut,quotelessJson:Tce,ZodError:Ip});qa.object({__isRef:qa.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:qa.string().describe("Upstream block id"),name:qa.string().describe("Name of the output provided to the upstream block's output context"),requireEnrichments:qa.literal(!0).optional().describe("True if current block that stores this reference in its args, may need enrichments for the references value originating from the blocks in between current and referenced block")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").readonly(),qa.string().length(24).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");var _L={exports:{}};(function(e,t){t=e.exports=n,t.getSerialize=r;function n(a,i,o,s){return JSON.stringify(a,r(i,s),o)}function r(a,i){var o=[],s=[];return i==null&&(i=function(c,f){return o[0]===f?"[Circular ~]":"[Circular ~."+s.slice(0,o.indexOf(f)).join(".")+"]"}),function(c,f){if(o.length>0){var A=o.indexOf(this);~A?o.splice(A+1):o.push(this),~A?s.splice(A,1/0,c):s.push(c),~o.indexOf(f)&&(f=i.call(this,c,f))}else o.push(f);return a==null?f:a.call(this,c,f)}}})(_L,_L.exports);const Sfe=qa.object({type:qa.literal("PlError"),name:qa.string(),message:qa.string(),fullMessage:qa.string().optional(),stack:qa.string().optional()}),Bfe=Sfe.extend({cause:qa.lazy(()=>e6).optional(),errors:qa.lazy(()=>e6.array()).optional()}),kfe=qa.object({type:qa.literal("StandardError"),name:qa.string(),message:qa.string(),stack:qa.string().optional()}),Tfe=kfe.extend({cause:qa.lazy(()=>e6).optional(),errors:qa.lazy(()=>e6.array()).optional()}),e6=qa.union([Tfe,Bfe]),_fe=qa.object({name:qa.string(),message:qa.string(),fullMessage:qa.string().optional(),stack:qa.string().optional()}),DL=_fe.extend({cause:qa.lazy(()=>DL).optional(),errors:qa.lazy(()=>DL.array()).optional()}),Dfe=qa.object({type:qa.string(),importance:qa.number().optional(),id:qa.string().optional(),label:qa.string()});qa.array(Dfe);function PL(e,t,n){const r=d.ref(0),a=d.reactive({loading:d.computed(()=>r.value>0),loadingRef:r,value:void 0,error:void 0}),i=yue(t);return d.watch(e,async o=>{a.error=void 0,r.value++,i(o).then(s=>{s.ok&&(a.value=s.value)}).catch(s=>{a.value=void 0,a.error=s}).finally(()=>{r.value--})},Object.assign({immediate:!0,deep:!0},{})),a}const Pfe=["tabindex"],Mfe={class:"pl-autocomplete__container"},Hfe={class:"pl-autocomplete__field"},Ife=["disabled","placeholder"],Rfe={key:0,class:"input-value"},Nfe={class:"pl-autocomplete__controls"},Lfe={key:2,class:"arrow-icon arrow-icon-default"},$fe={key:0},Ffe={key:0,class:"required-icon"},Vfe={key:0,class:"nothing-found"},Ofe={key:0,class:"pl-autocomplete__error"},Qfe={key:1,class:"pl-autocomplete__helper"},zfe={key:2,class:"pl-autocomplete__helper"},Ufe={name:"PlAutocomplete"},t6=d.defineComponent({...Ufe,props:d.mergeModels({optionsSearch:{},modelSearch:{type:Function,default:void 0},label:{default:""},helper:{default:void 0},loadingOptionsHelper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},clearable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},arrowIcon:{default:void 0},arrowIconLarge:{default:void 0},optionSize:{default:"small"},formatValue:{type:Function,default:e=>String(e)}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=d.useModel(e,"modelValue"),n=e,r=d.useSlots(),a=d.ref(),i=d.ref(),o=d.useTemplateRef("overlay"),s=d.ref(null),c=d.reactive({activeIndex:-1,open:!1}),f=()=>fL(y.value.findIndex(he=>ny(he.value,t.value)),he=>he<0?0:he),A=()=>c.activeIndex=f(),p=d.ref([]),v=d.ref(),y=d.computed(()=>sL(p.value).map((he,ae)=>({...he,index:ae,isSelected:ae===k.value,isActive:ae===c.activeIndex}))),b=d.ref(!0),C=d.ref(!1),x=d.computed(()=>n.disabled),k=d.computed(()=>p.value.findIndex(he=>ny(he.value,t.value))),_=d.computed(()=>{if(!b.value){if(n.error)return n.error;if(C.value)return"Data loading error"}}),P=d.computed(()=>{const he=d.unref(v),ae=d.unref(y),ge=he??ae.find(me=>ny(me.value,t.value))??ae.find(me=>ny(me.value,t.value));return(ge==null?void 0:ge.label)||(t.value?n.formatValue(t.value):"")}),N=d.computed(()=>!c.open&&t.value?"":t.value?String(P.value):n.placeholder),I=d.computed(()=>t.value!==void 0&&t.value!==null),F=d.computed(()=>x.value?void 0:"0"),Q=he=>{var ae;t.value=he==null?void 0:he.value,v.value=he,s.value=null,c.open=!1,(ae=a==null?void 0:a.value)==null||ae.focus()},Z=()=>{t.value=void 0,v.value=void 0},ee=()=>{var he;return(he=i.value)==null?void 0:he.focus()},le=()=>{c.open=!c.open};d.watch(()=>c.open,he=>{s.value=he?"":null});const z=()=>{c.open=!0},U=he=>{var ae,ge,me;const fe=he.relatedTarget;!((ae=a.value)!=null&&ae.contains(fe))&&!((me=(ge=o.value)==null?void 0:ge.listRef)!=null&&me.contains(fe))&&(s.value=null,c.open=!1)},G=he=>{var ae;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(he.code))he.preventDefault();else return;const{open:ge,activeIndex:me}=c;if(!ge){he.code==="Enter"&&(c.open=!0,s.value="");return}he.code==="Escape"&&(c.open=!1,s.value=null,(ae=a.value)==null||ae.focus());const fe=d.unref(y),{length:be}=fe;if(!be)return;he.code==="Enter"&&Q(fe.find(Ue=>Ue.index===me));const He=fe.findIndex(Ue=>Ue.index===me)??-1,_e=he.code==="ArrowDown"?1:he.code==="ArrowUp"?-1:0,Ie=Math.abs(He+_e+be)%be;c.activeIndex=y.value[Ie].index??-1};pce(a),d.watch(()=>t.value,A,{immediate:!0}),d.watch(()=>c.open,he=>{var ae;return he?(ae=i.value)==null?void 0:ae.focus():""}),d.watchPostEffect(()=>{var he;s.value,c.activeIndex>=0&&c.open&&((he=o.value)==null||he.scrollIntoActive())});const Y=kce(s,300,{maxWait:1e3}),X=PL(()=>Y.value,async he=>he!==null?n.optionsSearch(he):[]),te=PL(()=>t.value,async he=>{var ae,ge;return he&&!ny((ae=v.value)==null?void 0:ae.value,he)?n.modelSearch?n.modelSearch(he):(ge=await n.optionsSearch(String(he)))==null?void 0:ge[0]:v.value});return d.watch(()=>X.value,he=>{he&&(p.value=he,s.value!==null&&(C.value=!1))}),d.watch(()=>te.value,he=>{he&&(v.value=sL([he])[0])}),d.watch(()=>X.error,he=>{he&&(C.value=!!he)}),d.watch(()=>X.loading||te.loading,he=>{b.value=he}),(he,ae)=>(d.openBlock(),d.createElementBlock("div",{class:"pl-autocomplete__envelope",onClick:d.withModifiers(ee,["stop"])},[d.createElementVNode("div",{ref_key:"rootRef",ref:a,tabindex:F.value,class:d.normalizeClass(["pl-autocomplete",{open:c.open,error:!!_.value,disabled:x.value}]),onKeydown:G,onFocusout:U},[d.createElementVNode("div",Mfe,[d.createElementVNode("div",Hfe,[d.withDirectives(d.createElementVNode("input",{ref_key:"input",ref:i,"onUpdate:modelValue":ae[0]||(ae[0]=ge=>s.value=ge),type:"text",tabindex:"-1",disabled:x.value,placeholder:N.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:z},null,40,Ife),[[d.vModelText,s.value]]),ae[4]||(ae[4]=d.createTextVNode()),c.open?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",Rfe,[d.createVNode(yce,null,{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(P.value),1)]),_:1})])),ae[5]||(ae[5]=d.createTextVNode()),d.createElementVNode("div",Nfe,[b.value?(d.openBlock(),d.createBlock(d.unref(Kue),{key:0,name:"loading"})):d.createCommentVNode("",!0),ae[1]||(ae[1]=d.createTextVNode()),he.clearable&&I.value?(d.openBlock(),d.createBlock(d.unref(s5),{key:1,name:"delete-clear",onClick:d.withModifiers(Z,["stop"])})):d.createCommentVNode("",!0),ae[2]||(ae[2]=d.createTextVNode()),d.renderSlot(he.$slots,"append"),ae[3]||(ae[3]=d.createTextVNode()),d.createElementVNode("div",{class:"pl-autocomplete__arrow-wrapper",onClick:d.withModifiers(le,["stop"])},[he.arrowIconLarge?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["arrow-icon",[`icon-24 ${he.arrowIconLarge}`]])},null,2)):he.arrowIcon?(d.openBlock(),d.createElementBlock("div",{key:1,class:d.normalizeClass(["arrow-icon",[`icon-16 ${he.arrowIcon}`]])},null,2)):(d.openBlock(),d.createElementBlock("div",Lfe))])])]),ae[9]||(ae[9]=d.createTextVNode()),he.label?(d.openBlock(),d.createElementBlock("label",$fe,[he.required?(d.openBlock(),d.createElementBlock("i",Ffe)):d.createCommentVNode("",!0),ae[6]||(ae[6]=d.createTextVNode()),d.createElementVNode("span",null,d.toDisplayString(he.label),1),ae[7]||(ae[7]=d.createTextVNode()),d.unref(r).tooltip?(d.openBlock(),d.createBlock(d.unref(ice),{key:1,class:"info",position:"top"},{tooltip:d.withCtx(()=>[d.renderSlot(he.$slots,"tooltip")]),_:3})):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0),ae[10]||(ae[10]=d.createTextVNode()),c.open?(d.openBlock(),d.createBlock(d.unref(Ece),{key:1,ref:"overlay",root:a.value,class:"pl-autocomplete__options",tabindex:"-1",gap:3},{default:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(y.value,(ge,me)=>(d.openBlock(),d.createBlock(Iue,{key:me,option:ge,"is-selected":ge.isSelected,"is-hovered":ge.isActive,size:he.optionSize,onClick:d.withModifiers(fe=>Q(ge),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),ae[8]||(ae[8]=d.createTextVNode()),y.value.length?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",Vfe,"Nothing found"))]),_:1},8,["root"])):d.createCommentVNode("",!0),ae[11]||(ae[11]=d.createTextVNode()),d.createVNode(uce,{class:"pl-autocomplete__contour"})])],42,Pfe),ae[12]||(ae[12]=d.createTextVNode()),_.value?(d.openBlock(),d.createElementBlock("div",Ofe,d.toDisplayString(_.value),1)):b.value&&he.loadingOptionsHelper?(d.openBlock(),d.createElementBlock("div",Qfe,d.toDisplayString(he.loadingOptionsHelper),1)):he.helper?(d.openBlock(),d.createElementBlock("div",zfe,d.toDisplayString(he.helper),1)):d.createCommentVNode("",!0)]))}});function n6(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Gfe(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function ML(e){let t,n,r;e.length!==2?(t=n6,n=(s,c)=>n6(e(s),c),r=(s,c)=>e(s)-c):(t=e===n6||e===Gfe?e:jfe,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 p=f+A>>>1;n(s[p],c)<0?f=p+1:A=p}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 p=f+A>>>1;n(s[p],c)<=0?f=p+1:A=p}while(f<A)}return f}function o(s,c,f=0,A=s.length){const p=a(s,c,f,A-1);return p>f&&r(s[p-1],c)>-r(s[p],c)?p-1:p}return{left:a,center:o,right:i}}function jfe(){return 0}function Yfe(e){return e===null?NaN:+e}ML(n6),ML(Yfe).center;var Wfe={value:()=>{}};function HL(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new r6(n)}function r6(e){this._=e}function Xfe(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",a=n.indexOf(".");if(a>=0&&(r=n.slice(a+1),n=n.slice(0,a)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}r6.prototype=HL.prototype={constructor:r6,on:function(e,t){var n=this._,r=Xfe(e+"",n),a,i=-1,o=r.length;if(arguments.length<2){for(;++i<o;)if((a=(e=r[i]).type)&&(a=Kfe(n[a],e.name)))return a;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<o;)if(a=(e=r[i]).type)n[a]=IL(n[a],e.name,t);else if(t==null)for(a in n)n[a]=IL(n[a],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new r6(e)},call:function(e,t){if((a=arguments.length-2)>0)for(var n=new Array(a),r=0,a,i;r<a;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,a=i.length;r<a;++r)i[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],a=0,i=r.length;a<i;++a)r[a].value.apply(t,n)}};function Kfe(e,t){for(var n=0,r=e.length,a;n<r;++n)if((a=e[n]).name===t)return a.value}function IL(e,t,n){for(var r=0,a=e.length;r<a;++r)if(e[r].name===t){e[r]=Wfe,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var nB="http://www.w3.org/1999/xhtml";const RL={svg:"http://www.w3.org/2000/svg",xhtml:nB,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function a6(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),RL.hasOwnProperty(t)?{space:RL[t],local:e}:e}function Zfe(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===nB&&t.documentElement.namespaceURI===nB?t.createElement(e):t.createElementNS(n,e)}}function Jfe(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function NL(e){var t=a6(e);return(t.local?Jfe:Zfe)(t)}function qfe(){}function rB(e){return e==null?qfe:function(){return this.querySelector(e)}}function ede(e){typeof e!="function"&&(e=rB(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var i=t[a],o=i.length,s=r[a]=new Array(o),c,f,A=0;A<o;++A)(c=i[A])&&(f=e.call(c,c.__data__,A,i))&&("__data__"in c&&(f.__data__=c.__data__),s[A]=f);return new Lp(r,this._parents)}function tde(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function nde(){return[]}function LL(e){return e==null?nde:function(){return this.querySelectorAll(e)}}function rde(e){return function(){return tde(e.apply(this,arguments))}}function ade(e){typeof e=="function"?e=rde(e):e=LL(e);for(var t=this._groups,n=t.length,r=[],a=[],i=0;i<n;++i)for(var o=t[i],s=o.length,c,f=0;f<s;++f)(c=o[f])&&(r.push(e.call(c,c.__data__,f,o)),a.push(c));return new Lp(r,a)}function $L(e){return function(){return this.matches(e)}}function FL(e){return function(t){return t.matches(e)}}var ide=Array.prototype.find;function ode(e){return function(){return ide.call(this.children,e)}}function lde(){return this.firstElementChild}function sde(e){return this.select(e==null?lde:ode(typeof e=="function"?e:FL(e)))}var ude=Array.prototype.filter;function cde(){return Array.from(this.children)}function fde(e){return function(){return ude.call(this.children,e)}}function dde(e){return this.selectAll(e==null?cde:fde(typeof e=="function"?e:FL(e)))}function Ade(e){typeof e!="function"&&(e=$L(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var i=t[a],o=i.length,s=r[a]=[],c,f=0;f<o;++f)(c=i[f])&&e.call(c,c.__data__,f,i)&&s.push(c);return new Lp(r,this._parents)}function VL(e){return new Array(e.length)}function pde(){return new Lp(this._enter||this._groups.map(VL),this._parents)}function i6(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}i6.prototype={constructor:i6,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function hde(e){return function(){return e}}function vde(e,t,n,r,a,i){for(var o=0,s,c=t.length,f=i.length;o<f;++o)(s=t[o])?(s.__data__=i[o],r[o]=s):n[o]=new i6(e,i[o]);for(;o<c;++o)(s=t[o])&&(a[o]=s)}function mde(e,t,n,r,a,i,o){var s,c,f=new Map,A=t.length,p=i.length,v=new Array(A),y;for(s=0;s<A;++s)(c=t[s])&&(v[s]=y=o.call(c,c.__data__,s,t)+"",f.has(y)?a[s]=c:f.set(y,c));for(s=0;s<p;++s)y=o.call(e,i[s],s,i)+"",(c=f.get(y))?(r[s]=c,c.__data__=i[s],f.delete(y)):n[s]=new i6(e,i[s]);for(s=0;s<A;++s)(c=t[s])&&f.get(v[s])===c&&(a[s]=c)}function gde(e){return e.__data__}function yde(e,t){if(!arguments.length)return Array.from(this,gde);var n=t?mde:vde,r=this._parents,a=this._groups;typeof e!="function"&&(e=hde(e));for(var i=a.length,o=new Array(i),s=new Array(i),c=new Array(i),f=0;f<i;++f){var A=r[f],p=a[f],v=p.length,y=wde(e.call(A,A&&A.__data__,f,r)),b=y.length,C=s[f]=new Array(b),x=o[f]=new Array(b),k=c[f]=new Array(v);n(A,p,C,x,k,y,t);for(var _=0,P=0,N,I;_<b;++_)if(N=C[_]){for(_>=P&&(P=_+1);!(I=x[P])&&++P<b;);N._next=I||null}}return o=new Lp(o,r),o._enter=s,o._exit=c,o}function wde(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Cde(){return new Lp(this._exit||this._groups.map(VL),this._parents)}function bde(e,t,n){var r=this.enter(),a=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(a=t(a),a&&(a=a.selection())),n==null?i.remove():n(i),r&&a?r.merge(a).order():a}function Ede(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,a=n.length,i=r.length,o=Math.min(a,i),s=new Array(a),c=0;c<o;++c)for(var f=n[c],A=r[c],p=f.length,v=s[c]=new Array(p),y,b=0;b<p;++b)(y=f[b]||A[b])&&(v[b]=y);for(;c<a;++c)s[c]=n[c];return new Lp(s,this._parents)}function xde(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],a=r.length-1,i=r[a],o;--a>=0;)(o=r[a])&&(i&&o.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(o,i),i=o);return this}function Sde(e){e||(e=Bde);function t(p,v){return p&&v?e(p.__data__,v.__data__):!p-!v}for(var n=this._groups,r=n.length,a=new Array(r),i=0;i<r;++i){for(var o=n[i],s=o.length,c=a[i]=new Array(s),f,A=0;A<s;++A)(f=o[A])&&(c[A]=f);c.sort(t)}return new Lp(a,this._parents).order()}function Bde(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function kde(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Tde(){return Array.from(this)}function _de(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,i=r.length;a<i;++a){var o=r[a];if(o)return o}return null}function Dde(){let e=0;for(const t of this)++e;return e}function Pde(){return!this.node()}function Mde(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var a=t[n],i=0,o=a.length,s;i<o;++i)(s=a[i])&&e.call(s,s.__data__,i,a);return this}function Hde(e){return function(){this.removeAttribute(e)}}function Ide(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Rde(e,t){return function(){this.setAttribute(e,t)}}function Nde(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Lde(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function $de(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Fde(e,t){var n=a6(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Ide:Hde:typeof t=="function"?n.local?$de:Lde:n.local?Nde:Rde)(n,t))}function OL(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Vde(e){return function(){this.style.removeProperty(e)}}function Ode(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Qde(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function zde(e,t,n){return arguments.length>1?this.each((t==null?Vde:typeof t=="function"?Qde:Ode)(e,t,n??"")):ly(this.node(),e)}function ly(e,t){return e.style.getPropertyValue(t)||OL(e).getComputedStyle(e,null).getPropertyValue(t)}function Ude(e){return function(){delete this[e]}}function Gde(e,t){return function(){this[e]=t}}function jde(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Yde(e,t){return arguments.length>1?this.each((t==null?Ude:typeof t=="function"?jde:Gde)(e,t)):this.node()[e]}function QL(e){return e.trim().split(/^|\s+/)}function aB(e){return e.classList||new zL(e)}function zL(e){this._node=e,this._names=QL(e.getAttribute("class")||"")}zL.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function UL(e,t){for(var n=aB(e),r=-1,a=t.length;++r<a;)n.add(t[r])}function GL(e,t){for(var n=aB(e),r=-1,a=t.length;++r<a;)n.remove(t[r])}function Wde(e){return function(){UL(this,e)}}function Xde(e){return function(){GL(this,e)}}function Kde(e,t){return function(){(t.apply(this,arguments)?UL:GL)(this,e)}}function Zde(e,t){var n=QL(e+"");if(arguments.length<2){for(var r=aB(this.node()),a=-1,i=n.length;++a<i;)if(!r.contains(n[a]))return!1;return!0}return this.each((typeof t=="function"?Kde:t?Wde:Xde)(n,t))}function Jde(){this.textContent=""}function qde(e){return function(){this.textContent=e}}function eAe(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function tAe(e){return arguments.length?this.each(e==null?Jde:(typeof e=="function"?eAe:qde)(e)):this.node().textContent}function nAe(){this.innerHTML=""}function rAe(e){return function(){this.innerHTML=e}}function aAe(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function iAe(e){return arguments.length?this.each(e==null?nAe:(typeof e=="function"?aAe:rAe)(e)):this.node().innerHTML}function oAe(){this.nextSibling&&this.parentNode.appendChild(this)}function lAe(){return this.each(oAe)}function sAe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function uAe(){return this.each(sAe)}function cAe(e){var t=typeof e=="function"?e:NL(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function fAe(){return null}function dAe(e,t){var n=typeof e=="function"?e:NL(e),r=t==null?fAe:typeof t=="function"?t:rB(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function AAe(){var e=this.parentNode;e&&e.removeChild(this)}function pAe(){return this.each(AAe)}function hAe(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function vAe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function mAe(e){return this.select(e?vAe:hAe)}function gAe(e){return arguments.length?this.property("__data__",e):this.node().__data__}function yAe(e){return function(t){e.call(this,t,this.__data__)}}function wAe(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function CAe(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,a=t.length,i;n<a;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function bAe(e,t,n){return function(){var r=this.__on,a,i=yAe(t);if(r){for(var o=0,s=r.length;o<s;++o)if((a=r[o]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=i,a.options=n),a.value=t;return}}this.addEventListener(e.type,i,n),a={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(a):this.__on=[a]}}function EAe(e,t,n){var r=wAe(e+""),a,i=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,f=s.length,A;c<f;++c)for(a=0,A=s[c];a<i;++a)if((o=r[a]).type===A.type&&o.name===A.name)return A.value}return}for(s=t?bAe:CAe,a=0;a<i;++a)this.each(s(r[a],t,n));return this}function jL(e,t,n){var r=OL(e),a=r.CustomEvent;typeof a=="function"?a=new a(t,n):(a=r.document.createEvent("Event"),n?(a.initEvent(t,n.bubbles,n.cancelable),a.detail=n.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function xAe(e,t){return function(){return jL(this,e,t)}}function SAe(e,t){return function(){return jL(this,e,t.apply(this,arguments))}}function BAe(e,t){return this.each((typeof t=="function"?SAe:xAe)(e,t))}function*kAe(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,i=r.length,o;a<i;++a)(o=r[a])&&(yield o)}var TAe=[null];function Lp(e,t){this._groups=e,this._parents=t}function _5(){return new Lp([[document.documentElement]],TAe)}function _Ae(){return this}Lp.prototype=_5.prototype={constructor:Lp,select:ede,selectAll:ade,selectChild:sde,selectChildren:dde,filter:Ade,data:yde,enter:pde,exit:Cde,join:bde,merge:Ede,selection:_Ae,order:xde,sort:Sde,call:kde,nodes:Tde,node:_de,size:Dde,empty:Pde,each:Mde,attr:Fde,style:zde,property:Yde,classed:Zde,text:tAe,html:iAe,raise:lAe,lower:uAe,append:cAe,insert:dAe,remove:pAe,clone:mAe,datum:gAe,on:EAe,dispatch:BAe,[Symbol.iterator]:kAe};function iB(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function YL(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function D5(){}var P5=.7,o6=1/P5,sy="\\s*([+-]?\\d+)\\s*",M5="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",L0="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",DAe=/^#([0-9a-f]{3,8})$/,PAe=new RegExp(`^rgb\\(${sy},${sy},${sy}\\)$`),MAe=new RegExp(`^rgb\\(${L0},${L0},${L0}\\)$`),HAe=new RegExp(`^rgba\\(${sy},${sy},${sy},${M5}\\)$`),IAe=new RegExp(`^rgba\\(${L0},${L0},${L0},${M5}\\)$`),RAe=new RegExp(`^hsl\\(${M5},${L0},${L0}\\)$`),NAe=new RegExp(`^hsla\\(${M5},${L0},${L0},${M5}\\)$`),WL={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};iB(D5,H5,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:XL,formatHex:XL,formatHex8:LAe,formatHsl:$Ae,formatRgb:KL,toString:KL});function XL(){return this.rgb().formatHex()}function LAe(){return this.rgb().formatHex8()}function $Ae(){return t$(this).formatHsl()}function KL(){return this.rgb().formatRgb()}function H5(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=DAe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?ZL(t):n===3?new yd(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?l6(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?l6(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=PAe.exec(e))?new yd(t[1],t[2],t[3],1):(t=MAe.exec(e))?new yd(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=HAe.exec(e))?l6(t[1],t[2],t[3],t[4]):(t=IAe.exec(e))?l6(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=RAe.exec(e))?e$(t[1],t[2]/100,t[3]/100,1):(t=NAe.exec(e))?e$(t[1],t[2]/100,t[3]/100,t[4]):WL.hasOwnProperty(e)?ZL(WL[e]):e==="transparent"?new yd(NaN,NaN,NaN,0):null}function ZL(e){return new yd(e>>16&255,e>>8&255,e&255,1)}function l6(e,t,n,r){return r<=0&&(e=t=n=NaN),new yd(e,t,n,r)}function FAe(e){return e instanceof D5||(e=H5(e)),e?(e=e.rgb(),new yd(e.r,e.g,e.b,e.opacity)):new yd}function oB(e,t,n,r){return arguments.length===1?FAe(e):new yd(e,t,n,r??1)}function yd(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}iB(yd,oB,YL(D5,{brighter(e){return e=e==null?o6:Math.pow(o6,e),new yd(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?P5:Math.pow(P5,e),new yd(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new yd(tg(this.r),tg(this.g),tg(this.b),s6(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:JL,formatHex:JL,formatHex8:VAe,formatRgb:qL,toString:qL}));function JL(){return`#${ng(this.r)}${ng(this.g)}${ng(this.b)}`}function VAe(){return`#${ng(this.r)}${ng(this.g)}${ng(this.b)}${ng((isNaN(this.opacity)?1:this.opacity)*255)}`}function qL(){const e=s6(this.opacity);return`${e===1?"rgb(":"rgba("}${tg(this.r)}, ${tg(this.g)}, ${tg(this.b)}${e===1?")":`, ${e})`}`}function s6(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function tg(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ng(e){return e=tg(e),(e<16?"0":"")+e.toString(16)}function e$(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new $p(e,t,n,r)}function t$(e){if(e instanceof $p)return new $p(e.h,e.s,e.l,e.opacity);if(e instanceof D5||(e=H5(e)),!e)return new $p;if(e instanceof $p)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 $p(o,s,c,e.opacity)}function OAe(e,t,n,r){return arguments.length===1?t$(e):new $p(e,t,n,r??1)}function $p(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}iB($p,OAe,YL(D5,{brighter(e){return e=e==null?o6:Math.pow(o6,e),new $p(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?P5:Math.pow(P5,e),new $p(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 yd(lB(e>=240?e-240:e+120,a,r),lB(e,a,r),lB(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new $p(n$(this.h),u6(this.s),u6(this.l),s6(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=s6(this.opacity);return`${e===1?"hsl(":"hsla("}${n$(this.h)}, ${u6(this.s)*100}%, ${u6(this.l)*100}%${e===1?")":`, ${e})`}`}}));function n$(e){return e=(e||0)%360,e<0?e+360:e}function u6(e){return Math.max(0,Math.min(1,e||0))}function lB(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 r$=e=>()=>e;function QAe(e,t){return function(n){return e+n*t}}function zAe(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 UAe(e){return(e=+e)==1?a$:function(t,n){return n-t?zAe(t,n,e):r$(isNaN(t)?n:t)}}function a$(e,t){var n=t-e;return n?QAe(e,n):r$(isNaN(e)?t:e)}const i$=function e(t){var n=UAe(t);function r(a,i){var o=n((a=oB(a)).r,(i=oB(i)).r),s=n(a.g,i.g),c=n(a.b,i.b),f=a$(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 Av(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var sB=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,uB=new RegExp(sB.source,"g");function GAe(e){return function(){return e}}function jAe(e){return function(t){return e(t)+""}}function YAe(e,t){var n=sB.lastIndex=uB.lastIndex=0,r,a,i,o=-1,s=[],c=[];for(e=e+"",t=t+"";(r=sB.exec(e))&&(a=uB.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:Av(r,a)})),n=uB.lastIndex;return n<t.length&&(i=t.slice(n),s[o]?s[o]+=i:s[++o]=i),s.length<2?c[0]?jAe(c[0].x):GAe(t):(t=c.length,function(f){for(var A=0,p;A<t;++A)s[(p=c[A]).i]=p.x(f);return s.join("")})}var o$=180/Math.PI,l$={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function s$(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)*o$,skewX:Math.atan(c)*o$,scaleX:o,scaleY:s}}var c6;function WAe(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?l$:s$(t.a,t.b,t.c,t.d,t.e,t.f)}function XAe(e){return e==null||(c6||(c6=document.createElementNS("http://www.w3.org/2000/svg","g")),c6.setAttribute("transform",e),!(e=c6.transform.baseVal.consolidate()))?l$:(e=e.matrix,s$(e.a,e.b,e.c,e.d,e.e,e.f))}function u$(e,t,n,r){function a(f){return f.length?f.pop()+" ":""}function i(f,A,p,v,y,b){if(f!==p||A!==v){var C=y.push("translate(",null,t,null,n);b.push({i:C-4,x:Av(f,p)},{i:C-2,x:Av(A,v)})}else(p||v)&&y.push("translate("+p+t+v+n)}function o(f,A,p,v){f!==A?(f-A>180?A+=360:A-f>180&&(f+=360),v.push({i:p.push(a(p)+"rotate(",null,r)-2,x:Av(f,A)})):A&&p.push(a(p)+"rotate("+A+r)}function s(f,A,p,v){f!==A?v.push({i:p.push(a(p)+"skewX(",null,r)-2,x:Av(f,A)}):A&&p.push(a(p)+"skewX("+A+r)}function c(f,A,p,v,y,b){if(f!==p||A!==v){var C=y.push(a(y)+"scale(",null,",",null,")");b.push({i:C-4,x:Av(f,p)},{i:C-2,x:Av(A,v)})}else(p!==1||v!==1)&&y.push(a(y)+"scale("+p+","+v+")")}return function(f,A){var p=[],v=[];return f=e(f),A=e(A),i(f.translateX,f.translateY,A.translateX,A.translateY,p,v),o(f.rotate,A.rotate,p,v),s(f.skewX,A.skewX,p,v),c(f.scaleX,f.scaleY,A.scaleX,A.scaleY,p,v),f=A=null,function(y){for(var b=-1,C=v.length,x;++b<C;)p[(x=v[b]).i]=x.x(y);return p.join("")}}}var KAe=u$(WAe,"px, ","px)","deg)"),ZAe=u$(XAe,", ",")",")"),uy=0,I5=0,R5=0,c$=1e3,f6,N5,d6=0,rg=0,A6=0,L5=typeof performance=="object"&&performance.now?performance:Date,f$=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function cB(){return rg||(f$(JAe),rg=L5.now()+A6)}function JAe(){rg=0}function p6(){this._call=this._time=this._next=null}p6.prototype=d$.prototype={constructor:p6,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?cB():+n)+(t==null?0:+t),!this._next&&N5!==this&&(N5?N5._next=this:f6=this,N5=this),this._call=e,this._time=n,fB()},stop:function(){this._call&&(this._call=null,this._time=1/0,fB())}};function d$(e,t,n){var r=new p6;return r.restart(e,t,n),r}function qAe(){cB(),++uy;for(var e=f6,t;e;)(t=rg-e._time)>=0&&e._call.call(void 0,t),e=e._next;--uy}function A$(){rg=(d6=L5.now())+A6,uy=I5=0;try{qAe()}finally{uy=0,tpe(),rg=0}}function epe(){var e=L5.now(),t=e-d6;t>c$&&(A6-=t,d6=e)}function tpe(){for(var e,t=f6,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:f6=n);N5=e,fB(r)}function fB(e){if(!uy){I5&&(I5=clearTimeout(I5));var t=e-rg;t>24?(e<1/0&&(I5=setTimeout(A$,e-L5.now()-A6)),R5&&(R5=clearInterval(R5))):(R5||(d6=L5.now(),R5=setInterval(epe,c$)),uy=1,f$(A$))}}function p$(e,t,n){var r=new p6;return t=t==null?0:+t,r.restart(a=>{r.stop(),e(a+t)},t,n),r}var npe=HL("start","end","cancel","interrupt"),rpe=[],h$=0,v$=1,dB=2,h6=3,m$=4,AB=5,v6=6;function m6(e,t,n,r,a,i){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;ape(e,n,{name:t,index:r,group:a,on:npe,tween:rpe,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:h$})}function pB(e,t){var n=Fp(e,t);if(n.state>h$)throw new Error("too late; already scheduled");return n}function $0(e,t){var n=Fp(e,t);if(n.state>h6)throw new Error("too late; already running");return n}function Fp(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function ape(e,t,n){var r=e.__transition,a;r[t]=n,n.timer=d$(i,0,n.time);function i(f){n.state=v$,n.timer.restart(o,n.delay,n.time),n.delay<=f&&o(f-n.delay)}function o(f){var A,p,v,y;if(n.state!==v$)return c();for(A in r)if(y=r[A],y.name===n.name){if(y.state===h6)return p$(o);y.state===m$?(y.state=v6,y.timer.stop(),y.on.call("interrupt",e,e.__data__,y.index,y.group),delete r[A]):+A<t&&(y.state=v6,y.timer.stop(),y.on.call("cancel",e,e.__data__,y.index,y.group),delete r[A])}if(p$(function(){n.state===h6&&(n.state=m$,n.timer.restart(s,n.delay,n.time),s(f))}),n.state=dB,n.on.call("start",e,e.__data__,n.index,n.group),n.state===dB){for(n.state=h6,a=new Array(v=n.tween.length),A=0,p=-1;A<v;++A)(y=n.tween[A].value.call(e,e.__data__,n.index,n.group))&&(a[++p]=y);a.length=p+1}}function s(f){for(var A=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(c),n.state=AB,1),p=-1,v=a.length;++p<v;)a[p].call(e,A);n.state===AB&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=v6,n.timer.stop(),delete r[t];for(var f in r)return;delete e.__transition}}function ipe(e,t){var n=e.__transition,r,a,i=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((r=n[o]).name!==t){i=!1;continue}a=r.state>dB&&r.state<AB,r.state=v6,r.timer.stop(),r.on.call(a?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[o]}i&&delete e.__transition}}function ope(e){return this.each(function(){ipe(this,e)})}function lpe(e,t){var n,r;return function(){var a=$0(this,e),i=a.tween;if(i!==n){r=n=i;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}a.tween=r}}function spe(e,t,n){var r,a;if(typeof n!="function")throw new Error;return function(){var i=$0(this,e),o=i.tween;if(o!==r){a=(r=o).slice();for(var s={name:t,value:n},c=0,f=a.length;c<f;++c)if(a[c].name===t){a[c]=s;break}c===f&&a.push(s)}i.tween=a}}function upe(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Fp(this.node(),n).tween,a=0,i=r.length,o;a<i;++a)if((o=r[a]).name===e)return o.value;return null}return this.each((t==null?lpe:spe)(n,e,t))}function hB(e,t,n){var r=e._id;return e.each(function(){var a=$0(this,r);(a.value||(a.value={}))[t]=n.apply(this,arguments)}),function(a){return Fp(a,r).value[t]}}function g$(e,t){var n;return(typeof t=="number"?Av:t instanceof H5?i$:(n=H5(t))?(t=n,i$):YAe)(e,t)}function cpe(e){return function(){this.removeAttribute(e)}}function fpe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function dpe(e,t,n){var r,a=n+"",i;return function(){var o=this.getAttribute(e);return o===a?null:o===r?i:i=t(r=o,n)}}function Ape(e,t,n){var r,a=n+"",i;return function(){var o=this.getAttributeNS(e.space,e.local);return o===a?null:o===r?i:i=t(r=o,n)}}function ppe(e,t,n){var r,a,i;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+"",o===c?null:o===r&&c===a?i:(a=c,i=t(r=o,s)))}}function hpe(e,t,n){var r,a,i;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+"",o===c?null:o===r&&c===a?i:(a=c,i=t(r=o,s)))}}function vpe(e,t){var n=a6(e),r=n==="transform"?ZAe:g$;return this.attrTween(e,typeof t=="function"?(n.local?hpe:ppe)(n,r,hB(this,"attr."+e,t)):t==null?(n.local?fpe:cpe)(n):(n.local?Ape:dpe)(n,r,t))}function mpe(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function gpe(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function ype(e,t){var n,r;function a(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&gpe(e,i)),n}return a._value=t,a}function wpe(e,t){var n,r;function a(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&mpe(e,i)),n}return a._value=t,a}function Cpe(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=a6(e);return this.tween(n,(r.local?ype:wpe)(r,t))}function bpe(e,t){return function(){pB(this,e).delay=+t.apply(this,arguments)}}function Epe(e,t){return t=+t,function(){pB(this,e).delay=t}}function xpe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?bpe:Epe)(t,e)):Fp(this.node(),t).delay}function Spe(e,t){return function(){$0(this,e).duration=+t.apply(this,arguments)}}function Bpe(e,t){return t=+t,function(){$0(this,e).duration=t}}function kpe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Spe:Bpe)(t,e)):Fp(this.node(),t).duration}function Tpe(e,t){if(typeof t!="function")throw new Error;return function(){$0(this,e).ease=t}}function _pe(e){var t=this._id;return arguments.length?this.each(Tpe(t,e)):Fp(this.node(),t).ease}function Dpe(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;$0(this,e).ease=n}}function Ppe(e){if(typeof e!="function")throw new Error;return this.each(Dpe(this._id,e))}function Mpe(e){typeof e!="function"&&(e=$L(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var i=t[a],o=i.length,s=r[a]=[],c,f=0;f<o;++f)(c=i[f])&&e.call(c,c.__data__,f,i)&&s.push(c);return new Qh(r,this._parents,this._name,this._id)}function Hpe(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,a=n.length,i=Math.min(r,a),o=new Array(r),s=0;s<i;++s)for(var c=t[s],f=n[s],A=c.length,p=o[s]=new Array(A),v,y=0;y<A;++y)(v=c[y]||f[y])&&(p[y]=v);for(;s<r;++s)o[s]=t[s];return new Qh(o,this._parents,this._name,this._id)}function Ipe(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function Rpe(e,t,n){var r,a,i=Ipe(t)?pB:$0;return function(){var o=i(this,e),s=o.on;s!==r&&(a=(r=s).copy()).on(t,n),o.on=a}}function Npe(e,t){var n=this._id;return arguments.length<2?Fp(this.node(),n).on.on(e):this.each(Rpe(n,e,t))}function Lpe(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function $pe(){return this.on("end.remove",Lpe(this._id))}function Fpe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=rB(e));for(var r=this._groups,a=r.length,i=new Array(a),o=0;o<a;++o)for(var s=r[o],c=s.length,f=i[o]=new Array(c),A,p,v=0;v<c;++v)(A=s[v])&&(p=e.call(A,A.__data__,v,s))&&("__data__"in A&&(p.__data__=A.__data__),f[v]=p,m6(f[v],t,n,v,f,Fp(A,n)));return new Qh(i,this._parents,t,n)}function Vpe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=LL(e));for(var r=this._groups,a=r.length,i=[],o=[],s=0;s<a;++s)for(var c=r[s],f=c.length,A,p=0;p<f;++p)if(A=c[p]){for(var v=e.call(A,A.__data__,p,c),y,b=Fp(A,n),C=0,x=v.length;C<x;++C)(y=v[C])&&m6(y,t,n,C,v,b);i.push(v),o.push(A)}return new Qh(i,o,t,n)}var Ope=_5.prototype.constructor;function Qpe(){return new Ope(this._groups,this._parents)}function zpe(e,t){var n,r,a;return function(){var i=ly(this,e),o=(this.style.removeProperty(e),ly(this,e));return i===o?null:i===n&&o===r?a:a=t(n=i,r=o)}}function y$(e){return function(){this.style.removeProperty(e)}}function Upe(e,t,n){var r,a=n+"",i;return function(){var o=ly(this,e);return o===a?null:o===r?i:i=t(r=o,n)}}function Gpe(e,t,n){var r,a,i;return function(){var o=ly(this,e),s=n(this),c=s+"";return s==null&&(c=s=(this.style.removeProperty(e),ly(this,e))),o===c?null:o===r&&c===a?i:(a=c,i=t(r=o,s))}}function jpe(e,t){var n,r,a,i="style."+t,o="end."+i,s;return function(){var c=$0(this,e),f=c.on,A=c.value[i]==null?s||(s=y$(t)):void 0;(f!==n||a!==A)&&(r=(n=f).copy()).on(o,a=A),c.on=r}}function Ype(e,t,n){var r=(e+="")=="transform"?KAe:g$;return t==null?this.styleTween(e,zpe(e,r)).on("end.style."+e,y$(e)):typeof t=="function"?this.styleTween(e,Gpe(e,r,hB(this,"style."+e,t))).each(jpe(this._id,e)):this.styleTween(e,Upe(e,r,t),n).on("end.style."+e,null)}function Wpe(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Xpe(e,t,n){var r,a;function i(){var o=t.apply(this,arguments);return o!==a&&(r=(a=o)&&Wpe(e,o,n)),r}return i._value=t,i}function Kpe(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,Xpe(e,t,n??""))}function Zpe(e){return function(){this.textContent=e}}function Jpe(e){return function(){var t=e(this);this.textContent=t??""}}function qpe(e){return this.tween("text",typeof e=="function"?Jpe(hB(this,"text",e)):Zpe(e==null?"":e+""))}function e0e(e){return function(t){this.textContent=e.call(this,t)}}function t0e(e){var t,n;function r(){var a=e.apply(this,arguments);return a!==n&&(t=(n=a)&&e0e(a)),t}return r._value=e,r}function n0e(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,t0e(e))}function r0e(){for(var e=this._name,t=this._id,n=w$(),r=this._groups,a=r.length,i=0;i<a;++i)for(var o=r[i],s=o.length,c,f=0;f<s;++f)if(c=o[f]){var A=Fp(c,t);m6(c,e,n,f,o,{time:A.time+A.delay+A.duration,delay:0,duration:A.duration,ease:A.ease})}return new Qh(r,this._parents,e,n)}function a0e(){var e,t,n=this,r=n._id,a=n.size();return new Promise(function(i,o){var s={value:o},c={value:function(){--a===0&&i()}};n.each(function(){var f=$0(this,r),A=f.on;A!==e&&(t=(e=A).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),f.on=t}),a===0&&i()})}var i0e=0;function Qh(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function w$(){return++i0e}var zh=_5.prototype;Qh.prototype={constructor:Qh,select:Fpe,selectAll:Vpe,selectChild:zh.selectChild,selectChildren:zh.selectChildren,filter:Mpe,merge:Hpe,selection:Qpe,transition:r0e,call:zh.call,nodes:zh.nodes,node:zh.node,size:zh.size,empty:zh.empty,each:zh.each,on:Npe,attr:vpe,attrTween:Cpe,style:Ype,styleTween:Kpe,text:qpe,textTween:n0e,remove:$pe,tween:upe,delay:xpe,duration:kpe,ease:_pe,easeVarying:Ppe,end:a0e,[Symbol.iterator]:zh[Symbol.iterator]};function o0e(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var l0e={time:null,delay:0,duration:250,ease:o0e};function s0e(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function u0e(e){var t,n;e instanceof Qh?(t=e._id,e=e._name):(t=w$(),(n=l0e).time=cB(),e=e==null?null:e+"");for(var r=this._groups,a=r.length,i=0;i<a;++i)for(var o=r[i],s=o.length,c,f=0;f<s;++f)(c=o[f])&&m6(c,e,t,f,o,n||s0e(c,t));return new Qh(r,this._parents,e,t)}_5.prototype.interrupt=ope,_5.prototype.transition=u0e;function c0e(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function g6(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 f0e(e){return e=g6(Math.abs(e)),e?e[1]:NaN}function d0e(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 A0e(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var p0e=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function vB(e){if(!(t=p0e.exec(e)))throw new Error("invalid format: "+e);var t;return new mB({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]})}vB.prototype=mB.prototype;function mB(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+""}mB.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 h0e(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 C$;function v0e(e,t){var n=g6(e,t);if(!n)return e+"";var r=n[0],a=n[1],i=a-(C$=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")+g6(e,Math.max(0,t+i-1))[0]}function b$(e,t){var n=g6(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 E$={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:c0e,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)=>b$(e*100,t),r:b$,s:v0e,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function x$(e){return e}var S$=Array.prototype.map,B$=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function m0e(e){var t=e.grouping===void 0||e.thousands===void 0?x$:d0e(S$.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?x$:A0e(S$.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(p){p=vB(p);var v=p.fill,y=p.align,b=p.sign,C=p.symbol,x=p.zero,k=p.width,_=p.comma,P=p.precision,N=p.trim,I=p.type;I==="n"?(_=!0,I="g"):E$[I]||(P===void 0&&(P=12),N=!0,I="g"),(x||v==="0"&&y==="=")&&(x=!0,v="0",y="=");var F=C==="$"?n:C==="#"&&/[boxX]/.test(I)?"0"+I.toLowerCase():"",Q=C==="$"?r:/[%p]/.test(I)?o:"",Z=E$[I],ee=/[defgprs%]/.test(I);P=P===void 0?6:/[gprs]/.test(I)?Math.max(1,Math.min(21,P)):Math.max(0,Math.min(20,P));function le(z){var U=F,G=Q,Y,X,te;if(I==="c")G=Z(z)+G,z="";else{z=+z;var he=z<0||1/z<0;if(z=isNaN(z)?c:Z(Math.abs(z),P),N&&(z=h0e(z)),he&&+z==0&&b!=="+"&&(he=!1),U=(he?b==="("?b:s:b==="-"||b==="("?"":b)+U,G=(I==="s"?B$[8+C$/3]:"")+G+(he&&b==="("?")":""),ee){for(Y=-1,X=z.length;++Y<X;)if(te=z.charCodeAt(Y),48>te||te>57){G=(te===46?a+z.slice(Y+1):z.slice(Y))+G,z=z.slice(0,Y);break}}}_&&!x&&(z=t(z,1/0));var ae=U.length+z.length+G.length,ge=ae<k?new Array(k-ae+1).join(v):"";switch(_&&x&&(z=t(ge+z,ge.length?k-G.length:1/0),ge=""),y){case"<":z=U+z+G+ge;break;case"=":z=U+ge+z+G;break;case"^":z=ge.slice(0,ae=ge.length>>1)+U+z+G+ge.slice(ae);break;default:z=ge+U+z+G;break}return i(z)}return le.toString=function(){return p+""},le}function A(p,v){var y=f((p=vB(p),p.type="f",p)),b=Math.max(-8,Math.min(8,Math.floor(f0e(v)/3)))*3,C=Math.pow(10,-b),x=B$[8+b/3];return function(k){return y(C*k)+x}}return{format:f,formatPrefix:A}}var y6;g0e({thousands:",",grouping:[3],currency:["$",""]});function g0e(e){return y6=m0e(e),y6.format,y6.formatPrefix,y6}function $5(e,t,n){this.k=e,this.x=t,this.y=n}$5.prototype={constructor:$5,scale:function(e){return e===1?this:new $5(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new $5(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},$5.prototype;const y0e={ref:"chipRoot",class:"dnd-double-chip__group"},w0e={class:"dnd-double-chip__top"},C0e={key:0,class:"dnd-basket-chip__handler"},b0e=["title"],E0e={class:"dnd-double-chip__title"},x0e=["innerHTML"],S0e={class:"dnd-double-chip__bottom"},B0e={key:0,class:"dnd-basket-chip__fixed-axes-block"},k0e=d.defineComponent({__name:"DndDoubleChip",props:d.mergeModels({info:{},error:{type:Boolean},searchOptions:{type:Function},sortable:{type:Boolean}},{filter:{required:!0},filterModifiers:{},fixedAxes:{default:{}},fixedAxesModifiers:{}}),emits:d.mergeModels(["close-chip","update:filter","update:fixedAxes"],["update:filter","update:fixedAxes"]),setup(e,{emit:t}){var c;const n=e,r=t,a=Tr(),i=d.useModel(e,"filter"),o=d.useModel(e,"fixedAxes"),s=d.ref((c=a.value.uniqueValuesData.value[n.info.id])==null?void 0:c.options);return d.watch(()=>a.value.uniqueValuesData.value,f=>{var p;const A=(p=f[n.info.id])==null?void 0:p.options;A&&(s.value=A),n.info.axesToBeFixed.forEach(v=>{o.value[v].axisValue===void 0&&f[v]&&(o.value[v].axisValue=f[v].list[0],r("update:fixedAxes",o.value))})},{immediate:!0}),d.watch(()=>s.value,async f=>{!f||!f.length||i.value===void 0&&(i.value=f[0].value)},{immediate:!0}),(f,A)=>(d.openBlock(),d.createElementBlock("div",y0e,[d.createElementVNode("div",{class:d.normalizeClass([{error:f.error,sortable:f.sortable},"dnd-double-chip"])},[d.createElementVNode("div",w0e,[d.createElementVNode("div",{class:d.normalizeClass(["dnd-double-chip__icon",{error:f.error}])},[f.error?(d.openBlock(),d.createBlock(d.unref(rt.PlMaskIcon16),{key:0,name:"warning"})):(d.openBlock(),d.createBlock(d.unref(s5),{key:1,name:f.info.isSubsetFilter?"cell-type-subset":f.info.type==="String"?"cell-type-txt":"cell-type-num"},null,8,["name"]))],2),f.sortable?(d.openBlock(),d.createElementBlock("div",C0e)):d.createCommentVNode("",!0),d.createVNode(d.unref(rt.PlMaskIcon16),{name:"drag-dots"}),d.createElementVNode("div",{class:"dnd-double-chip__title-wrapper",title:f.info.title},[d.createElementVNode("div",E0e,d.toDisplayString(f.info.title),1)],8,b0e),d.createElementVNode("div",{innerHTML:d.unref(US),class:"dnd-double-chip__icon-close",onClick:A[0]||(A[0]=p=>f.$emit("close-chip",n.info.id))},null,8,x0e)]),d.createElementVNode("div",S0e,[s.value===void 0||s.value.length<1e3?(d.openBlock(),d.createBlock(d.unref(rt.PlDropdown),{key:0,modelValue:i.value,"onUpdate:modelValue":A[1]||(A[1]=p=>i.value=p),options:s.value},null,8,["modelValue","options"])):(d.openBlock(),d.createBlock(d.unref(t6),{key:1,modelValue:i.value,"onUpdate:modelValue":A[2]||(A[2]=p=>i.value=p),"options-search":p=>f.searchOptions(n.info.id,p)},null,8,["modelValue","options-search"]))])],2),f.info.axesToBeFixed.length>0?(d.openBlock(),d.createElementBlock("div",B0e,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(f.info.axesToBeFixed,p=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:p},[o.value[p]?(d.openBlock(),d.createBlock(d.unref(t6),{key:0,modelValue:o.value[p].axisValue,"onUpdate:modelValue":[v=>o.value[p].axisValue=v,A[3]||(A[3]=v=>f.$emit("update:fixedAxes",o.value))],"options-search":v=>f.searchOptions(p,v),label:f.info.axesToBeFixedInfo[p].title},null,8,["modelValue","onUpdate:modelValue","options-search","label"])):d.createCommentVNode("",!0)],64))),128))])):d.createCommentVNode("",!0)],512))}}),T0e={key:0,class:"dnd-basket-chip__handler"},_0e={class:"dnd-basket-chip__title-wrapper"},D0e=["title"],P0e=["title"],M0e=["innerHTML"],H0e={key:0,class:"dnd-basket-chip__fixed-axes-block"},I0e=d.defineComponent({__name:"DnDBasketChip",props:d.mergeModels({error:{type:Boolean},info:{},sortable:{type:Boolean},searchOptions:{type:Function}},{modelValue:{default:{}},modelModifiers:{}}),emits:d.mergeModels(["close-chip","update:modelValue"],["update:modelValue"]),setup(e,{emit:t}){const n=e,r=Tr(),a=d.useModel(e,"modelValue"),i=t,o=d.ref(),s=d.computed(()=>n.info.uniqueValues.join("/"));function c(){i("close-chip",n.info.id)}return d.watch(()=>r.value.uniqueValuesData.value,f=>{n.info.axesToBeFixed.forEach(A=>{a.value[A].axisValue===void 0&&f[A]&&(a.value[A].axisValue=f[A].list[0],i("update:modelValue",a.value))})},{immediate:!0}),(f,A)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"chipRoot",ref:o,class:"dnd-basket-chip__group"},[d.createElementVNode("div",{class:d.normalizeClass([{error:f.error,sortable:f.sortable},"dnd-basket-chip"])},[d.createElementVNode("div",{class:d.normalizeClass(["dnd-basket-chip__icon",{error:f.error}])},[f.error?(d.openBlock(),d.createBlock(d.unref(cL),{key:0,name:"warning"})):(d.openBlock(),d.createBlock(d.unref(s5),{key:1,name:f.info.isSubsetFilter?"cell-type-subset":f.info.type==="String"?"cell-type-txt":"cell-type-num"},null,8,["name"]))],2),f.sortable?(d.openBlock(),d.createElementBlock("div",T0e)):d.createCommentVNode("",!0),d.createVNode(d.unref(cL),{name:"drag-dots"}),d.createElementVNode("div",_0e,[d.createElementVNode("div",{class:"dnd-basket-chip__title",title:f.info.title},d.toDisplayString(f.info.title),9,D0e),f.info.nonHomogenous?(d.openBlock(),d.createElementBlock("div",{key:0,class:"dnd-basket-chip__sub-title",title:s.value},d.toDisplayString(s.value),9,P0e)):d.createCommentVNode("",!0)]),d.createElementVNode("div",{innerHTML:d.unref(US),class:"dnd-basket-chip__icon-close",onClick:c},null,8,M0e)],2),f.info.axesToBeFixed.length>0?(d.openBlock(),d.createElementBlock("div",H0e,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(f.info.axesToBeFixed,p=>(d.openBlock(),d.createBlock(d.unref(t6),{key:p,modelValue:a.value[p].axisValue,"onUpdate:modelValue":[v=>a.value[p].axisValue=v,A[0]||(A[0]=v=>f.$emit("update:modelValue",a.value))],"options-search":v=>f.searchOptions(p,v),label:f.info.axesToBeFixedInfo[p].title},null,8,["modelValue","onUpdate:modelValue","options-search","label"]))),128))])):d.createCommentVNode("",!0)],512))}}),R0e={ref:"chipRoot",class:"dnd-double-chip__group"},N0e={class:"dnd-double-chip__top"},L0e={class:"dnd-double-chip__icon"},$0e=["title"],F0e={class:"dnd-double-chip__title"},V0e=["innerHTML"],O0e={class:"dnd-double-chip__bottom-range"},Q0e={class:"dnd-double-chip__bottom-range-row"},z0e={class:"dnd-double-chip__bottom-range-row"},U0e={key:0,class:"dnd-basket-chip__fixed-axes-block"},G0e=d.defineComponent({__name:"DnDRangeChip",props:d.mergeModels({info:{},error:{type:Boolean},searchOptions:{type:Function}},{filter:{required:!0},filterModifiers:{},fixedAxes:{required:!0},fixedAxesModifiers:{}}),emits:d.mergeModels(["close-chip","update:fixedAxes"],["update:filter","update:fixedAxes"]),setup(e,{emit:t}){var c,f;const n=e,r=Tr(),a=t,i=d.useModel(e,"filter"),o=d.useModel(e,"fixedAxes"),s=d.reactive({min:(c=i.value)==null?void 0:c[0],max:(f=i.value)==null?void 0:f[1]});return d.watch(()=>s,A=>{i.value=A},{deep:!0}),d.watch(()=>r.value.uniqueValuesData.value,A=>{n.info.axesToBeFixed.forEach(p=>{o.value[p].axisValue===void 0&&A[p]&&(o.value[p].axisValue=A[p].list[0],a("update:fixedAxes",o.value))})},{immediate:!0}),(A,p)=>(d.openBlock(),d.createElementBlock("div",R0e,[d.createElementVNode("div",{class:d.normalizeClass([{error:A.error},"dnd-double-chip"])},[d.createElementVNode("div",N0e,[d.createElementVNode("div",L0e,[d.createVNode(d.unref(s5),{name:"cell-type-num"})]),d.createElementVNode("div",{class:"dnd-double-chip__title-wrapper",title:A.info.title},[d.createElementVNode("div",F0e,d.toDisplayString(A.info.title),1)],8,$0e),d.createElementVNode("div",{innerHTML:d.unref(US),class:"dnd-double-chip__icon-close",onClick:p[0]||(p[0]=v=>A.$emit("close-chip",n.info.id))},null,8,V0e)]),d.createElementVNode("div",O0e,[d.createElementVNode("div",Q0e,[d.createVNode(d.unref(rt.PlNumberField),{label:"Min",modelValue:s.min,"onUpdate:modelValue":p[1]||(p[1]=v=>s.min=v),updateOnEnterOrClickOutside:!0,useIncrementButtons:!1},null,8,["modelValue"])]),d.createElementVNode("div",z0e,[d.createVNode(d.unref(rt.PlNumberField),{label:"Max",modelValue:s.max,"onUpdate:modelValue":p[2]||(p[2]=v=>s.max=v),updateOnEnterOrClickOutside:!0,useIncrementButtons:!1},null,8,["modelValue"])])])],2),A.info.axesToBeFixed.length>0?(d.openBlock(),d.createElementBlock("div",U0e,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(A.info.axesToBeFixed,v=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:v},[o.value[v]?(d.openBlock(),d.createBlock(d.unref(t6),{key:0,modelValue:o.value[v].axisValue,"onUpdate:modelValue":[y=>o.value[v].axisValue=y,p[3]||(p[3]=y=>A.$emit("update:fixedAxes",o.value))],"options-search":y=>A.searchOptions(v,y),label:A.info.axesToBeFixedInfo[v].title},null,8,["modelValue","onUpdate:modelValue","options-search","label"])):d.createCommentVNode("",!0)],64))),128))])):d.createCommentVNode("",!0)],512))}}),j0e={class:"dnd-basket__title"},Y0e={key:0,class:"dnd-basket__required"},W0e={class:"dnd-basket__drop-container"},X0e={key:0,class:"dnd-basket__placeholder"},K0e=100,ag=d.defineComponent({__name:"DndBasket",props:{id:{},title:{},multiple:{type:Boolean},isFilter:{type:Boolean},required:{type:Boolean},disabled:{type:Boolean},readonly:{type:Boolean},consistency:{},labelsInfo:{},droppedIds:{},availableIds:{},selectedFilters:{},selectedRanges:{},fixedAxes:{},info:{},draggedId:{},sortable:{type:Boolean}},emits:["drop-item","remove-item","select-filter-value","select-filter-range","select-fixed-axis-value","reorder"],setup(e,{emit:t}){const n=e,r=t,a=d.ref(),i=d.ref(),o=d.ref(0);let s=d.reactive(n.selectedFilters??{}),c=d.reactive(n.selectedRanges??{}),f=d.reactive(n.fixedAxes??{});const A=d.computed(()=>!(n.disabled||!n.multiple&&n.droppedIds.length>0)),p=d.computed(()=>n.disabled?"1 true":!A.value&&n.draggedId?"2 true":!1);d.watch(()=>n.selectedFilters,()=>{s=d.reactive(n.selectedFilters??{})}),d.watch(()=>n.fixedAxes,()=>{f=d.reactive(n.fixedAxes??{})}),d.watch(()=>n.droppedIds,()=>{o.value++},{deep:!0}),n.sortable&&rt.useSortable(i,{handle:".dnd-basket-chip__handler",onChange(_){r("reorder",_.map(P=>n.droppedIds[P]))}});function v(){a.value&&!n.disabled&&A.value&&a.value.classList.add("active")}function y(){a.value&&a.value.classList.remove("active")}function b(_){_.stopPropagation(),A.value&&(n.draggedId&&r("drop-item",{draggedId:n.draggedId,id:n.id}),y())}function C(_){_.preventDefault()}function x(_){_.preventDefault(),v()}const k=async(_,P)=>{var F;const N=((F=n.labelsInfo[_])==null?void 0:F.options)??[],I=P.toLowerCase();return N.filter(Q=>Q.value.toLowerCase().includes(I)||Q.label.toLowerCase().includes(I)).slice(0,K0e)};return(_,P)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"basketRoot",ref:a,class:d.normalizeClass([{disabled:p.value,empty:_.droppedIds.length===0,readonly:_.readonly},"dnd-basket"]),dropzone:"true",onDrop:b,onDragenter:C,onDragover:x,onDragleave:y},[d.createElementVNode("div",j0e,[_.required?(d.openBlock(),d.createElementBlock("span",Y0e,P[0]||(P[0]=[d.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"6",height:"16",viewBox:"0 0 6 16",fill:"none"},[d.createElementVNode("path",{d:"M2.01685 6.8L3 5.34159L3.97612 6.8L4.89607 6.12743L3.81461 4.7469L5.5 4.25133L5.14888 3.16106L3.50562 3.77699L3.56882 2H2.43118L2.49438 3.77699L0.851124 3.16106L0.5 4.25133L2.18539 4.7469L1.09691 6.12743L2.01685 6.8Z",fill:"#F1222F"})],-1)]))):d.createCommentVNode("",!0),d.createTextVNode(" "+d.toDisplayString(_.title),1)]),d.createElementVNode("div",W0e,[_.droppedIds.length?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",X0e," Drop dimensions here ")),(d.openBlock(),d.createElementBlock("div",{ref_key:"listRef",ref:i,key:o.value,class:"dnd-basket__chip-wrapper"},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(_.droppedIds,(N,I)=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:N},[!_.isFilter||_.info[N].isSubsetFilter?(d.openBlock(),d.createBlock(I0e,{key:0,modelValue:d.unref(f)[N],"onUpdate:modelValue":[F=>d.unref(f)[N]=F,F=>_.$emit("select-fixed-axis-value",{v:F,idx:I})],sortable:_.sortable,error:_.consistency[N]===!1,info:_.info[N],"search-options":k,onCloseChip:F=>_.$emit("remove-item",{chipId:N,basketId:_.id})},null,8,["modelValue","onUpdate:modelValue","sortable","error","info","onCloseChip"])):_.info[N].isDiscreteFilter?(d.openBlock(),d.createBlock(k0e,{key:1,filter:d.unref(s)[N],"onUpdate:filter":[F=>d.unref(s)[N]=F,F=>_.$emit("select-filter-value",{v:F,idx:I})],"fixed-axes":d.unref(f)[N],"onUpdate:fixedAxes":[F=>d.unref(f)[N]=F,F=>_.$emit("select-fixed-axis-value",{v:F,idx:I})],info:_.info[N],error:_.consistency[N]===!1,sortable:_.sortable,"search-options":k,onCloseChip:F=>_.$emit("remove-item",{chipId:N,basketId:_.id})},null,8,["filter","onUpdate:filter","fixed-axes","onUpdate:fixedAxes","info","error","sortable","onCloseChip"])):(d.openBlock(),d.createBlock(G0e,{key:2,filter:d.unref(c)[N],"onUpdate:filter":[F=>d.unref(c)[N]=F,F=>_.$emit("select-filter-range",{v:F,idx:I})],"fixed-axes":d.unref(f)[N],"onUpdate:fixedAxes":[F=>d.unref(f)[N]=F,F=>_.$emit("select-fixed-axis-value",{v:F,idx:I})],info:_.info[N],error:_.consistency[N]===!1,"search-options":k,onCloseChip:F=>_.$emit("remove-item",{chipId:N,basketId:_.id})},null,8,["filter","onUpdate:filter","fixed-axes","onUpdate:fixedAxes","info","error","onCloseChip"]))],64))),128))]))])],34))}}),Z0e={class:"inputs-block"},J0e={class:"separator"},q0e={class:"arrow-circle"},ehe={class:"inputs-block"},ig=d.defineComponent({__name:"FormLayout",setup(e){return(t,n)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createElementVNode("div",{class:"left-block",onClick:n[0]||(n[0]=r=>r.stopPropagation())},[n[2]||(n[2]=d.createElementVNode("h3",null," Data Mapping ",-1)),d.createElementVNode("div",Z0e,[d.renderSlot(t.$slots,"dataInputs"),d.renderSlot(t.$slots,"mandatoryOptions"),d.renderSlot(t.$slots,"metadataOptions")])]),d.createElementVNode("div",J0e,[d.createElementVNode("div",q0e,[d.createVNode(d.unref(rt.PlIcon16),{name:"arrow-right"})])]),d.createElementVNode("div",{class:"right-block",onClick:n[1]||(n[1]=r=>r.stopPropagation())},[n[3]||(n[3]=d.createElementVNode("h3",null," Chart variables ",-1)),d.createElementVNode("div",ehe,[d.renderSlot(t.$slots,"chartVar")])])],64))}}),the={class:"dnd-chip__icon"},nhe={class:"dnd-chip__title-wrapper"},rhe=["title"],ahe=["title"],w6=d.defineComponent({__name:"DndChip",props:{info:{}},emits:["dragstart","dragend"],setup(e,{emit:t}){const n=e,r=t,a=d.ref(),i=d.computed(()=>n.info.uniqueValues.join("/"));function o(c){var f,A;(f=c.dataTransfer)==null||f.clearData(),(A=c.dataTransfer)==null||A.setData("text/plain",n.info.id),r("dragstart",n.info.id),c.target.style.opacity="0.4",a.value&&a.value.classList.toggle("drag-active")}function s(c){r("dragend",n.info.id),c.target.style.opacity="1",a.value&&a.value.classList.toggle("drag-active")}return(c,f)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"chipRoot",ref:a,draggable:"true",class:"dnd-chip",onDragstart:o,onDragend:s},[d.createElementVNode("div",the,[d.createVNode(d.unref(s5),{name:c.info.isSubsetFilter?"cell-type-subset":c.info.type==="String"?"cell-type-txt":"cell-type-num"},null,8,["name"])]),d.createElementVNode("div",nhe,[d.createElementVNode("div",{class:"dnd-chip__title",title:c.info.title},d.toDisplayString(c.info.title),9,rhe),c.info.nonHomogenous?(d.openBlock(),d.createElementBlock("div",{key:0,class:"dnd-chip__sub-title",title:i.value},d.toDisplayString(i.value),9,ahe)):d.createCommentVNode("",!0)])],544))}}),ihe={key:0,class:"metadata-block"},ohe={class:"title"},lhe={class:"metadata-block__search"},she={class:"metadata-block__items"},cy=d.defineComponent({__name:"OptionsList",props:{options:{},chipInfo:{},title:{default:"Metadata"}},emits:["dragged-id-update"],setup(e,{emit:t}){const n=e,r=d.computed(()=>n.options.length===0),a=d.ref(),i=d.computed(()=>{var s;const o=((s=a.value)==null?void 0:s.toLowerCase())??"";return n.options.filter(c=>{const f=n.chipInfo[c.id].title??"";return f==null?void 0:f.toLowerCase().includes(o)})});return(o,s)=>r.value?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",ihe,[d.createElementVNode("div",ohe,d.toDisplayString(o.title),1),d.createElementVNode("div",lhe,[d.createVNode(d.unref(rt.PlSearchField),{modelValue:a.value,"onUpdate:modelValue":s[0]||(s[0]=c=>a.value=c),placeholder:"Find...",clearable:""},null,8,["modelValue"])]),d.createElementVNode("div",she,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(i.value,({id:c})=>(d.openBlock(),d.createBlock(w6,{key:c,info:o.chipInfo[c],onDragstart:s[1]||(s[1]=f=>o.$emit("dragged-id-update",f)),onDragend:s[2]||(s[2]=f=>o.$emit("dragged-id-update",null))},null,8,["info"]))),128))])]))}}),uhe={key:0,class:"metadata-block",style:{flexShrink:0}},che={class:"title"},fhe={class:"metadata-block__items"},fy=d.defineComponent({__name:"MandatoryOptions",props:{options:{},chipInfo:{},title:{default:"Drag to build the chart"}},emits:["dragged-id-update"],setup(e,{emit:t}){const n=e,r=d.computed(()=>n.options.length===0);return(a,i)=>r.value?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",uhe,[d.createElementVNode("div",che,d.toDisplayString(a.title),1),d.createElementVNode("div",fhe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.options,({id:o})=>(d.openBlock(),d.createBlock(w6,{key:o,info:a.chipInfo[o],onDragstart:i[0]||(i[0]=s=>a.$emit("dragged-id-update",s)),onDragend:i[1]||(i[1]=s=>a.$emit("dragged-id-update",null))},null,8,["info"]))),128))])]))}});function dy(e,t,n,r,a,i){const o=e.value.reactive.optionsState,s=d.toRef(e.value.reactive,"optionsState"),c=d.computed(()=>e.value.inputGuide.value),f=d.computed(()=>e.value.uniqueValuesData.value);function A(X){return rL(s,X,e.value.controller,e.value.columnsDataStore)}function p(X){return nL(s,X,e.value.controller,e.value.columnsDataStore,c)}function v(X){return tL(s,X,e.value.controller,e.value.columnsDataStore,c)}const y=d.ref({...t.reduce((X,te)=>(X[te]=A(te),X),{})}),b=d.ref({...n.reduce((X,te)=>(X[te]=v(te),X),{}),...r.reduce((X,te)=>(X[te]=p(te),X),{})}),C=d.computed(()=>aL(o,c)),x=d.computed(()=>pue(c,a)),k=d.computed(()=>hue(c,a)),_=d.ref(null),P=d.computed(()=>{const X=new Set;return a.forEach(te=>{C.value[te].forEach(he=>{X.add(he.value)}),o.components[te].selectorStates.forEach(he=>{X.add(he.selectedSource)})}),oL(c.value,e.value.uniqueValuesData.value,[...X])});function N(X){return o.components[X].selectorStates.reduce((te,he)=>(he.type!=="range"&&(te[he.selectedSource]=he.selectedFilterValue),te),{})}function I(X){return o.components[X].selectorStates.reduce((te,he)=>(te[he.selectedSource]=he.selectedFilterRange?[he.selectedFilterRange.min,he.selectedFilterRange.max]:he.selectedFilterValue?[Number(he.selectedFilterValue),Number(he.selectedFilterValue)]:[0,0],te),{})}function F(X){return o.components[X].selectorStates.reduce((te,he)=>{const ae=c.value.getSourceInfo(he.selectedSource);return ae.kind==="axis"||(te[he.selectedSource]=ae.axesToBeFixed.reduce((ge,me)=>{var fe;return ge[me]=((fe=he.fixedAxes)==null?void 0:fe.find(be=>be.axisSource===me))??{axisSource:me,axisValue:void 0,axisIdx:ae.axesToBeFixedIndexes[me]},ge},{})??{}),te},{})}function Q(X){b.value[X.id]=[...b.value[X.id],X.draggedId],_.value=null}function Z(X){b.value[X.basketId]=b.value[X.basketId].filter(te=>te!==X.chipId)}function ee(X,te){b.value[te]=X}function le(X){return new Set(c.value.components[X].options.map(te=>te.value))}function z(X){return c.value.components[X].stateConsistency}function U(X){return!c.value.readyData||C.value[X].length===0||_.value!==null&&!P.value[_.value].availableBasketIds.has(X)}const G=d.computed(()=>a.map(X=>{var ge;const te=c.value.components[X],he=X==="filters"||X==="highlight",ae={id:X,title:i[X],isFilter:he,sortable:X==="tooltipContent",multiple:te.multipleSelectors,required:te.required,disabled:U(X),readonly:((ge=e.value.readonlyInputs)==null?void 0:ge.includes(X))??!1,consistency:z(X),draggedId:_.value,availableIds:le(X),droppedIds:b.value[X],info:P.value,fixedAxes:F(X),labelsInfo:f.value,listeners:{"drop-item":Q,"remove-item":Z,reorder:me=>ee(me,X),"select-fixed-axis-value":me=>{const fe=o.components[X].selectorStates[me.idx];fe.fixedAxes=Object.values(me.v);for(const be of Object.values(o.components))for(const He of be.selectorStates)fe.fixedAxes.forEach(_e=>{He.fixedAxes&&(He.fixedAxes=He.fixedAxes.map(Ie=>({...Ie,axisValue:_e.axisSource===Ie.axisSource?_e.axisValue:Ie.axisValue})))})}}};return he&&(ae.selectedFilters=N(X),ae.selectedRanges=I(X),ae.listeners["select-filter-value"]=me=>{const fe=o.components[X].selectorStates[me.idx];fe.type="equals",fe.selectedFilterValue=me.v},ae.listeners["select-filter-range"]=me=>{const fe=o.components[X].selectorStates[me.idx];fe.type="range",fe.selectedFilterRange=me.v}),ae}));function Y(){_.value=null}return{draggedId:_,cleanDraggedId:Y,basketsData:G,freeMetaOptions:x,freeMandatoryOptions:k,chipInfo:P,dataStateValues:y,dataOptions:C}}const dhe={class:"data-form-input-item"},Ahe=d.defineComponent({__name:"DiscreteForm",setup(e){const t=Tr();d.watch(()=>t.value.commonHelpersData.primaryGroups.value,FS(t));const n=["filters","primaryGrouping","secondaryGrouping","tabBy","facetBy"],r={filters:"Filter",primaryGrouping:"Primary grouping",secondaryGrouping:"Secondary grouping",tabBy:"Tab by",facetBy:"Facet by"},{draggedId:a,basketsData:i,freeMetaOptions:o,freeMandatoryOptions:s,chipInfo:c,dataStateValues:f,dataOptions:A}=dy(t,["y"],["filters","tabBy"],["primaryGrouping","secondaryGrouping","facetBy"],n,r),p=d.computed(()=>{var v;return((v=t.value.readonlyInputs)==null?void 0:v.includes("y"))??!1});return(v,y)=>(d.openBlock(),d.createBlock(ig,null,{dataInputs:d.withCtx(()=>[d.createElementVNode("div",dhe,[d.createVNode(d.unref(rt.PlDropdown),{modelValue:d.unref(f).y,"onUpdate:modelValue":y[0]||(y[0]=b=>d.unref(f).y=b),options:d.unref(A).y,disabled:p.value,error:d.unref(ty)("y",d.unref(t).inputGuide.value),label:"Y:",clearable:!p.value},null,8,["modelValue","options","disabled","error","clearable"])])]),mandatoryOptions:d.withCtx(()=>[d.createVNode(fy,{options:d.unref(s),chipInfo:d.unref(c),onDraggedIdUpdate:y[1]||(y[1]=b=>a.value=b)},null,8,["options","chipInfo"])]),metadataOptions:d.withCtx(()=>[d.createVNode(cy,{options:d.unref(o),chipInfo:d.unref(c),onDraggedIdUpdate:y[2]||(y[2]=b=>a.value=b)},null,8,["options","chipInfo"])]),chartVar:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(i),b=>(d.openBlock(),d.createElementBlock("div",{key:b.id,class:"data-form-input-item"},[d.createVNode(ag,d.mergeProps({ref_for:!0},b,d.toHandlers(b.listeners)),null,16)]))),128))]),_:1}))}}),phe={class:"data-form-input-item"},hhe={class:"data-form-input-item",style:{"margin-top":"10px"}},vhe=d.defineComponent({__name:"ScatterplotForm",setup(e){const t=Tr(),n=["filters","highlight","grouping","size","shape","tooltipContent","label","tabBy","facetBy"],r={filters:"Filter",highlight:"Highlight",grouping:"Grouping / Color",size:"Size",shape:"Shape",tooltipContent:"Tooltip",label:"Label",tabBy:"Tab by",facetBy:"Facet by"},{draggedId:a,basketsData:i,freeMetaOptions:o,freeMandatoryOptions:s,chipInfo:c,dataStateValues:f,dataOptions:A}=dy(t,["x","y"],["filters","tabBy","highlight"],["grouping","size","shape","tooltipContent","label","facetBy"],n,r),p=d.computed(()=>{var y;return((y=t.value.readonlyInputs)==null?void 0:y.includes("x"))??!1}),v=d.computed(()=>{var y;return((y=t.value.readonlyInputs)==null?void 0:y.includes("y"))??!1});return(y,b)=>(d.openBlock(),d.createBlock(ig,null,{dataInputs:d.withCtx(()=>[d.createElementVNode("div",phe,[d.createVNode(d.unref(rt.PlDropdown),{label:"X:",clearable:"",modelValue:d.unref(f).x,"onUpdate:modelValue":b[0]||(b[0]=C=>d.unref(f).x=C),options:d.unref(A).x,disabled:p.value},null,8,["modelValue","options","disabled"])]),d.createElementVNode("div",hhe,[d.createVNode(d.unref(rt.PlDropdown),{label:"Y:",clearable:"",modelValue:d.unref(f).y,"onUpdate:modelValue":b[1]||(b[1]=C=>d.unref(f).y=C),options:d.unref(A).y,disabled:v.value},null,8,["modelValue","options","disabled"])])]),mandatoryOptions:d.withCtx(()=>[d.createVNode(fy,{options:d.unref(s),chipInfo:d.unref(c),onDraggedIdUpdate:b[2]||(b[2]=C=>a.value=C)},null,8,["options","chipInfo"])]),metadataOptions:d.withCtx(()=>[d.createVNode(cy,{options:d.unref(o),chipInfo:d.unref(c),onDraggedIdUpdate:b[3]||(b[3]=C=>a.value=C)},null,8,["options","chipInfo"])]),chartVar:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(i),C=>(d.openBlock(),d.createElementBlock("div",{key:C.id,class:"data-form-input-item"},[d.createVNode(ag,d.mergeProps({ref_for:!0},C,d.toHandlers(C.listeners)),null,16)]))),128))]),_:1}))}}),mhe={class:"data-form-input-item"},ghe={class:"data-form-input-item",style:{"margin-top":"10px"}},yhe=d.defineComponent({__name:"ScatterplotUmapForm",setup(e){const t=Tr(),n=["filters","highlight","grouping","size","tabBy","tooltipContent","label"],r={filters:"Filter",highlight:"Highlight",grouping:"Grouping / Color",size:"Size",tabBy:"Tab by",tooltipContent:"Tooltip",label:"Label"},{draggedId:a,basketsData:i,freeMetaOptions:o,freeMandatoryOptions:s,chipInfo:c,dataStateValues:f,dataOptions:A}=dy(t,["x","y"],["filters","tabBy","highlight"],["grouping","size","tooltipContent","label"],n,r),p=d.computed(()=>{var y;return((y=t.value.readonlyInputs)==null?void 0:y.includes("x"))??!1}),v=d.computed(()=>{var y;return((y=t.value.readonlyInputs)==null?void 0:y.includes("y"))??!1});return(y,b)=>(d.openBlock(),d.createBlock(ig,null,{dataInputs:d.withCtx(()=>[d.createElementVNode("div",mhe,[d.createVNode(d.unref(rt.PlDropdown),{label:"X:",clearable:"",modelValue:d.unref(f).x,"onUpdate:modelValue":b[0]||(b[0]=C=>d.unref(f).x=C),options:d.unref(A).x,disabled:p.value},null,8,["modelValue","options","disabled"])]),d.createElementVNode("div",ghe,[d.createVNode(d.unref(rt.PlDropdown),{label:"Y:",clearable:"",modelValue:d.unref(f).y,"onUpdate:modelValue":b[1]||(b[1]=C=>d.unref(f).y=C),options:d.unref(A).y,disabled:v.value},null,8,["modelValue","options","disabled"])])]),mandatoryOptions:d.withCtx(()=>[d.createVNode(fy,{options:d.unref(s),chipInfo:d.unref(c),onDraggedIdUpdate:b[2]||(b[2]=C=>a.value=C)},null,8,["options","chipInfo"])]),metadataOptions:d.withCtx(()=>[d.createVNode(cy,{options:d.unref(o),chipInfo:d.unref(c),onDraggedIdUpdate:b[3]||(b[3]=C=>a.value=C)},null,8,["options","chipInfo"])]),chartVar:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(i),C=>(d.openBlock(),d.createElementBlock("div",{key:C.id,class:"data-form-input-item"},[d.createVNode(ag,d.mergeProps({ref_for:!0},C,d.toHandlers(C.listeners)),null,16)]))),128))]),_:1}))}}),whe={class:"data-form-input-item"},Che=d.defineComponent({__name:"HeatmapForm",setup(e){const t=Tr(),n=["filters","x","y","xGroupBy","yGroupBy","tooltipContent","tabBy","facetBy","annotationsX","annotationsY"],r={filters:"Filter",x:"X",y:"Y",xGroupBy:"X group",yGroupBy:"Y group",tooltipContent:"Tooltip",tabBy:"Tab by",facetBy:"Facet by",annotationsX:"Annotations X",annotationsY:"Annotations Y"},{draggedId:a,basketsData:i,freeMetaOptions:o,freeMandatoryOptions:s,chipInfo:c,dataStateValues:f,dataOptions:A}=dy(t,["value"],["filters","tabBy"],["x","y","xGroupBy","yGroupBy","tooltipContent","facetBy","annotationsX","annotationsY"],n,r),p=d.computed(()=>{var v;return((v=t.value.readonlyInputs)==null?void 0:v.includes("value"))??!1});return(v,y)=>(d.openBlock(),d.createBlock(ig,null,{dataInputs:d.withCtx(()=>[d.createElementVNode("div",whe,[d.createVNode(d.unref(rt.PlDropdown),{label:"Data source:",clearable:"",modelValue:d.unref(f).value,"onUpdate:modelValue":y[0]||(y[0]=b=>d.unref(f).value=b),options:d.unref(A).value,disabled:p.value,error:d.unref(ty)("value",d.unref(t).inputGuide.value)},null,8,["modelValue","options","disabled","error"])])]),mandatoryOptions:d.withCtx(()=>[d.createVNode(fy,{options:d.unref(s),chipInfo:d.unref(c),onDraggedIdUpdate:y[1]||(y[1]=b=>a.value=b)},null,8,["options","chipInfo"])]),metadataOptions:d.withCtx(()=>[d.createVNode(cy,{options:d.unref(o),chipInfo:d.unref(c),onDraggedIdUpdate:y[2]||(y[2]=b=>a.value=b)},null,8,["options","chipInfo"])]),chartVar:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(i),b=>(d.openBlock(),d.createElementBlock("div",{key:b.id,class:"data-form-input-item"},[d.createVNode(ag,d.mergeProps({ref_for:!0},b,d.toHandlers(b.listeners)),null,16)]))),128))]),_:1}))}}),bhe={class:"data-form-input-item"},Ehe={key:0,class:"metadata-block"},xhe={class:"metadata-block__items"},She={key:1,class:"metadata-block"},Bhe={class:"metadata-block__items"},khe={key:0,class:"data-form-input-item"},The=d.defineComponent({__name:"DendroForm",setup(e){const t=Tr(),n=t.value.reactive.optionsState,r=d.toRef(t.value.reactive,"optionsState"),a=d.computed(()=>t.value.inputGuide.value),i=d.computed(()=>t.value.uniqueValuesData.value);function o(G){return rL(r,G,t.value.controller,t.value.columnsDataStore)}function s(G){return nL(r,G,t.value.controller,t.value.columnsDataStore,a)}function c(G){return tL(r,G,t.value.controller,t.value.columnsDataStore,a)}const f=d.ref({value:o("value"),tableContent:s("tableContent"),heatmapAnnotation:s("heatmapAnnotation"),heatmapForSequence:s("heatmapForSequence"),filters:c("filters"),tabBy:c("tabBy"),height:s("height"),labels:s("labels"),nodeShape:s("nodeShape"),nodeColor:s("nodeColor"),nodeSize:s("nodeSize"),lineColor:s("lineColor"),heatmapAxis:s("heatmapAxis"),heatmapGroup:s("heatmapGroup")});d.watch(()=>f.value.nodeShape,G=>{t.value.reactive.layersSettings.dendro.dotShape=G.length?{type:"nodeShape",value:G[0]}:X3}),d.watch(()=>f.value.nodeColor,G=>{t.value.reactive.layersSettings.dendro.dotFill=G.length?{type:"nodeColor",value:G[0]}:gi}),d.watch(()=>f.value.lineColor,G=>{t.value.reactive.layersSettings.dendro.lineColor=G.length?{type:"lineColor",value:G[0]}:gi});const A=d.computed(()=>aL(n,a)),p=d.computed(()=>zS(a,y)),v=d.computed(()=>p.value.filter(G=>G.info.kind==="axis")),y=["height","tableContent","labels","heatmapAnnotation","heatmapAxis","heatmapGroup","heatmapForSequence","nodeShape","nodeColor","nodeSize","lineColor"],b={height:"Connections length",tableContent:"Table/tooltip content",labels:"Labels",heatmapAnnotation:"Heatmap annotation",heatmapAxis:"Heatmap axis",heatmapGroup:"Heatmap group",heatmapForSequence:"Alignment data",nodeShape:"Node shape",nodeColor:"Node color",nodeSize:"Node size",lineColor:"Line color"},C=d.ref(null),x=d.computed(()=>{const G=new Set;return y.forEach(Y=>{A.value[Y].forEach(X=>{G.add(X.value)}),n.components[Y].selectorStates.forEach(X=>{G.add(X.selectedSource)})}),oL(a.value,i.value,[...G])});function k(G){return n.components[G].selectorStates.reduce((Y,X)=>{const te=a.value.getSourceInfo(X.selectedSource);return te.kind==="axis"||(Y[X.selectedSource]=te.axesToBeFixed.reduce((he,ae)=>{var ge;return he[ae]=((ge=X.fixedAxes)==null?void 0:ge.find(me=>me.axisSource===ae))??{axisSource:ae,axisValue:void 0,axisIdx:te.axesToBeFixedIndexes[ae]},he},{})??{}),Y},{})}function _(G){f.value[G.id]=[...f.value[G.id],G.draggedId],C.value=null}function P(G,Y){f.value[Y]=G}function N(G){f.value[G.basketId]=f.value[G.basketId].filter(Y=>Y!==G.chipId)}function I(G){return new Set(a.value.components[G].options.map(Y=>Y.value))}function F(G){return a.value.components[G].stateConsistency}function Q(G){return!a.value.readyData||A.value[G].length===0||C.value!==null&&!x.value[C.value].availableBasketIds.has(G)}const Z=d.computed(()=>y.map(G=>{var te;const Y=a.value.components[G];return{id:G,title:b[G],isFilter:!1,sortable:G==="tableContent",multiple:Y.multipleSelectors,required:Y.required,disabled:Q(G),readonly:((te=t.value.readonlyInputs)==null?void 0:te.includes(G))??!1,consistency:F(G),draggedId:C.value,availableIds:I(G),droppedIds:f.value[G],info:x.value,labelsInfo:i.value,listeners:{"drop-item":_,"remove-item":N,reorder:he=>P(he,G),"select-fixed-axis-value":he=>{const ae=n.components[G].selectorStates[he.idx];ae.fixedAxes=Object.values(he.v);for(const ge of Object.values(n.components))for(const me of ge.selectorStates)ae.fixedAxes.forEach(fe=>{me.fixedAxes&&(me.fixedAxes=me.fixedAxes.map(be=>({...be,axisValue:fe.axisSource===be.axisSource?fe.axisValue:be.axisValue})))})}},fixedAxes:k(G)}}));function ee(G){return G==="heatmapAxis"||G==="heatmapGroup"?f.value.heatmapAnnotation!==null:!0}function le(){C.value=null}["value"].forEach(G=>{d.watch([()=>f.value[G],()=>A.value],([Y,X])=>{(typeof Y>"u"||iL("value",a.value))&&X[G]&&X[G].length&&t.value.controller.changeSelected(G,t.value.columnsDataStore,t.value.reactive.optionsState,[{selectedSource:X[G][0].value}])},{immediate:!0})});const U=d.computed(()=>{var G;return((G=t.value.readonlyInputs)==null?void 0:G.includes("value"))??!1});return(G,Y)=>(d.openBlock(),d.createBlock(ig,null,{dataInputs:d.withCtx(()=>[d.createElementVNode("div",bhe,[d.createVNode(d.unref(rt.PlDropdown),{label:"Data source:",modelValue:f.value.value,"onUpdate:modelValue":Y[0]||(Y[0]=X=>f.value.value=X),options:A.value.value,disabled:U.value,error:d.unref(ty)("value",a.value)},null,8,["modelValue","options","disabled","error"])]),v.value.length>0?(d.openBlock(),d.createElementBlock("div",Ehe,[Y[3]||(Y[3]=d.createElementVNode("div",{class:"title"},"Drag to build the chart",-1)),d.createElementVNode("div",xhe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(v.value,({id:X})=>(d.openBlock(),d.createBlock(w6,{key:X,info:x.value[X],onDragstart:Y[1]||(Y[1]=te=>C.value=te),onDragend:le},null,8,["info"]))),128))])])):d.createCommentVNode("",!0),p.value.length>0?(d.openBlock(),d.createElementBlock("div",She,[Y[4]||(Y[4]=d.createElementVNode("div",{class:"title"},"Metadata",-1)),d.createElementVNode("div",Bhe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(p.value,({id:X})=>(d.openBlock(),d.createBlock(w6,{key:X,info:x.value[X],onDragstart:Y[2]||(Y[2]=te=>C.value=te),onDragend:le},null,8,["info"]))),128))])])):d.createCommentVNode("",!0)]),chartVar:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(Z.value,X=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:X.id},[ee(X.id)?(d.openBlock(),d.createElementBlock("div",khe,[d.createVNode(ag,d.mergeProps({ref_for:!0},X,d.toHandlers(X.listeners)),null,16)])):d.createCommentVNode("",!0)],64))),128))]),_:1}))}}),_he={class:"data-form-input-item"},Dhe=d.defineComponent({__name:"HistogramForm",setup(e){const t=Tr(),n=["filters","grouping","tabBy","facetBy"],r={filters:"Filter",grouping:"Grouping",tabBy:"Tab by",facetBy:"Facet by"},{draggedId:a,basketsData:i,freeMetaOptions:o,freeMandatoryOptions:s,chipInfo:c,dataStateValues:f,dataOptions:A}=dy(t,["value"],["filters","tabBy"],["facetBy","grouping"],n,r),p=d.computed(()=>{var v;return((v=t.value.readonlyInputs)==null?void 0:v.includes("value"))??!1});return(v,y)=>(d.openBlock(),d.createBlock(ig,null,{dataInputs:d.withCtx(()=>[d.createElementVNode("div",_he,[d.createVNode(d.unref(rt.PlDropdown),{modelValue:d.unref(f).value,"onUpdate:modelValue":y[0]||(y[0]=b=>d.unref(f).value=b),options:d.unref(A).value,disabled:p.value,error:d.unref(ty)("value",d.unref(t).inputGuide.value),label:"Data value:",clearable:!p.value},null,8,["modelValue","options","disabled","error","clearable"])])]),mandatoryOptions:d.withCtx(()=>[d.createVNode(fy,{options:d.unref(s),chipInfo:d.unref(c),onDraggedIdUpdate:y[1]||(y[1]=b=>a.value=b)},null,8,["options","chipInfo"])]),metadataOptions:d.withCtx(()=>[d.createVNode(cy,{options:d.unref(o),chipInfo:d.unref(c),onDraggedIdUpdate:y[2]||(y[2]=b=>a.value=b)},null,8,["options","chipInfo"])]),chartVar:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(i),b=>(d.openBlock(),d.createElementBlock("div",{key:b.id,class:"data-form-input-item"},[d.createVNode(ag,d.mergeProps({ref_for:!0},b,d.toHandlers(b.listeners)),null,16)]))),128))]),_:1}))}}),Phe={class:"data-form-input-item"},Mhe={class:"data-form-input-item",style:{"margin-top":"10px"}},Hhe=d.defineComponent({__name:"BubbleForm",setup(e){const t=Tr(),n=["filters","x","y","tooltipContent","tabBy","facetBy"],r={filters:"Filter",x:"X",y:"Y",tooltipContent:"Tooltip",tabBy:"Tab by",facetBy:"Facet by"},{draggedId:a,basketsData:i,freeMetaOptions:o,freeMandatoryOptions:s,chipInfo:c,dataStateValues:f,dataOptions:A}=dy(t,["valueColor","valueSize"],["filters","tabBy"],["x","y","tooltipContent","facetBy"],n,r),p=d.computed(()=>{var y;return((y=t.value.readonlyInputs)==null?void 0:y.includes("valueColor"))??!1}),v=d.computed(()=>{var y;return((y=t.value.readonlyInputs)==null?void 0:y.includes("valueSize"))??!1});return(y,b)=>(d.openBlock(),d.createBlock(ig,null,{dataInputs:d.withCtx(()=>[d.createElementVNode("div",Phe,[d.createVNode(d.unref(rt.PlDropdown),{label:"Data source for color:",clearable:"",modelValue:d.unref(f).valueColor,"onUpdate:modelValue":b[0]||(b[0]=C=>d.unref(f).valueColor=C),disabled:p.value,options:d.unref(A).valueColor,error:d.unref(ty)("valueColor",d.unref(t).inputGuide.value)},null,8,["modelValue","disabled","options","error"])]),d.createElementVNode("div",Mhe,[d.createVNode(d.unref(rt.PlDropdown),{label:"Data source for size:",clearable:"",modelValue:d.unref(f).valueSize,"onUpdate:modelValue":b[1]||(b[1]=C=>d.unref(f).valueSize=C),disabled:v.value,options:d.unref(A).valueSize,error:d.unref(ty)("valueSize",d.unref(t).inputGuide.value)},null,8,["modelValue","disabled","options","error"])])]),mandatoryOptions:d.withCtx(()=>[d.createVNode(fy,{options:d.unref(s),chipInfo:d.unref(c),onDraggedIdUpdate:b[2]||(b[2]=C=>a.value=C)},null,8,["options","chipInfo"])]),metadataOptions:d.withCtx(()=>[d.createVNode(cy,{options:d.unref(o),chipInfo:d.unref(c),onDraggedIdUpdate:b[3]||(b[3]=C=>a.value=C)},null,8,["options","chipInfo"])]),chartVar:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(i),C=>(d.openBlock(),d.createElementBlock("div",{key:C.id,class:"data-form-input-item"},[d.createVNode(ag,d.mergeProps({ref_for:!0},C,d.toHandlers(C.listeners)),null,16)]))),128))]),_:1}))}}),Ihe={class:"data-form"},Rhe=d.defineComponent({__name:"index",setup(e){const t=Tr();return(n,r)=>(d.openBlock(),d.createElementBlock("div",Ihe,[d.unref(t).reactive.chartType==="discrete"?(d.openBlock(),d.createBlock(Ahe,{key:0})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="scatterplot"?(d.openBlock(),d.createBlock(vhe,{key:1})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="scatterplot-umap"?(d.openBlock(),d.createBlock(yhe,{key:2})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="heatmap"?(d.openBlock(),d.createBlock(Che,{key:3})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="dendro"?(d.openBlock(),d.createBlock(The,{key:4})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="histogram"?(d.openBlock(),d.createBlock(Dhe,{key:5})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="bubble"?(d.openBlock(),d.createBlock(Hhe,{key:6})):d.createCommentVNode("",!0)]))}}),Nhe={class:"collapsable-block-content"},Pl=d.defineComponent({__name:"CollapsableBlock",props:{iconOpen:{},icon:{},title:{},settings:{}},setup(e){var i,o,s,c,f;const t=e,n=d.ref(((i=t.settings)==null?void 0:i.defaultState)!=="open"),r={},a={};return(o=t.settings)!=null&&o.height&&(a["--title-height"]=`${(s=t.settings)==null?void 0:s.height}px`),(c=t.settings)!=null&&c.horizontalPadding&&(r.padding=`0 ${(f=t.settings)==null?void 0:f.horizontalPadding}px`),(A,p)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["collapsable-block-container",{minimized:n.value,maximized:!n.value}]),style:a},[d.createElementVNode("div",{class:"collapsable-block-title",onClick:p[0]||(p[0]=v=>n.value=!n.value),style:r},[t.icon?(d.openBlock(),d.createBlock(d.resolveDynamicComponent(!n.value&&t.iconOpen?t.iconOpen:t.icon),{key:0})):d.createCommentVNode("",!0),d.createElementVNode("span",null,d.toDisplayString(t.title),1)]),d.createElementVNode("div",Nhe,[d.renderSlot(A.$slots,"default")])],2))}}),Lhe={},$he={class:"inline-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Fhe(e,t){return d.openBlock(),d.createElementBlock("svg",$he,t[0]||(t[0]=[d.createElementVNode("path",{d:"M6 11.3773C6 11.8102 6.51272 12.0386 6.83448 11.749L10.5871 8.37165C10.8077 8.17303 10.8077 7.82697 10.5871 7.62835L6.83448 4.25103C6.51272 3.96145 6 4.1898 6 4.62268V11.3773Z",fill:"#CFD1DB"},null,-1)]))}const Tf=mr(Lhe,[["render",Fhe]]),Vhe={},Ohe={class:"inline-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Qhe(e,t){return d.openBlock(),d.createElementBlock("svg",Ohe,t[0]||(t[0]=[d.createElementVNode("path",{d:"M4.70711 6.00018C4.26165 6.00018 4.03857 6.53875 4.35355 6.85374L7.64645 10.1466C7.84171 10.3419 8.15829 10.3419 8.35355 10.1466L11.6464 6.85374C11.9614 6.53875 11.7383 6.00018 11.2929 6.00018H4.70711Z",fill:"#CFD1DB"},null,-1)]))}const _f=mr(Vhe,[["render",Qhe]]),zhe=["tabindex","onKeydown","onClick"],Df=d.defineComponent({__name:"BtnIconGroup",props:{modelValue:{},options:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){d.useSlots();const n=t,r=a=>n("update:modelValue",a);return(a,i)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["btn-icon-group",{disabled:a.disabled}])},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.options,(o,s)=>(d.openBlock(),d.createElementBlock("div",{key:o.value+":"+s,class:d.normalizeClass(["btn-icon-group__option",{active:a.modelValue===o.value}]),tabindex:a.modelValue===o.value||a.disabled?void 0:0,onKeydown:d.withKeys(c=>r(o.value),["enter"]),onClick:c=>r(o.value)},[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(o.icon)))],42,zhe))),128))],2))}}),Uhe={},Ghe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function jhe(e,t){return d.openBlock(),d.createElementBlock("svg",Ghe,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3 4.5L21 4.5V6L3 6V4.5ZM3 9L11 9V10.5L3 10.5V9ZM3 15V13.5L19 13.5V15L3 15ZM3 18H13V19.5H3V18Z",fill:"currentColor"},null,-1)]))}const F5=mr(Uhe,[["render",jhe]]),Yhe={},Whe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function Xhe(e,t){return d.openBlock(),d.createElementBlock("svg",Whe,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3 4.5L21 4.5V6L3 6V4.5ZM8 9L16 9V10.5L8 10.5V9ZM4 13.5L20 13.5V15L4 15L4 13.5ZM7 18H17V19.5H7V18Z",fill:"currentColor"},null,-1)]))}const V5=mr(Yhe,[["render",Xhe]]),Khe={},Zhe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function Jhe(e,t){return d.openBlock(),d.createElementBlock("svg",Zhe,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3 4.5L21 4.5V6L3 6V4.5ZM13 9L21 9V10.5L13 10.5V9ZM5 15V13.5L21 13.5V15L5 15ZM11 18H21V19.5H11V18Z",fill:"currentColor"},null,-1)]))}const O5=mr(Khe,[["render",Jhe]]),qhe={},e1e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function t1e(e,t){return d.openBlock(),d.createElementBlock("svg",e1e,t[0]||(t[0]=[d.createElementVNode("path",{d:"M4 19L4 5C4 4.44772 4.44772 4 5 4L19 4C19.5523 4 20 4.44772 20 5L20 19C20 19.5523 19.5523 20 19 20L5 20C4.44772 20 4 19.5523 4 19Z",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"square"},null,-1)]))}const Q5=mr(qhe,[["render",t1e]]),n1e={},r1e={width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function a1e(e,t){return d.openBlock(),d.createElementBlock("svg",r1e,t[0]||(t[0]=[d.createStaticVNode('<path d="M4.25 1H5.75" stroke="currentColor" stroke-width="1.5"></path><path d="M8.25 1H9.75" stroke="currentColor" stroke-width="1.5"></path><path d="M12.25 1H13.75" stroke="currentColor" stroke-width="1.5"></path><path d="M16.25 1H17.75" stroke="currentColor" stroke-width="1.5"></path><path d="M0.25 17H1.75" stroke="currentColor" stroke-width="1.5"></path><path d="M4.25 17H5.75" stroke="currentColor" stroke-width="1.5"></path><path d="M8.25 17H9.75" stroke="currentColor" stroke-width="1.5"></path><path d="M12.25 17H13.75" stroke="currentColor" stroke-width="1.5"></path><path d="M16.25 17H17.75" stroke="currentColor" stroke-width="1.5"></path><path d="M17 0.25L17 1.75" stroke="currentColor" stroke-width="1.5"></path><path d="M17 4.25L17 5.75" stroke="currentColor" stroke-width="1.5"></path><path d="M17 8.25L17 9.75" stroke="currentColor" stroke-width="1.5"></path><path d="M17 12.25L17 13.75" stroke="currentColor" stroke-width="1.5"></path><path d="M1 0.25L1 1.75" stroke="currentColor" stroke-width="1.5"></path><path d="M1 4.25L1 5.75" stroke="currentColor" stroke-width="1.5"></path><path d="M1 8.25L1 9.75" stroke="currentColor" stroke-width="1.5"></path><path d="M1 12.25L1 13.75" stroke="currentColor" stroke-width="1.5"></path>',17)]))}const z5=mr(n1e,[["render",a1e]]),i1e={},o1e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function l1e(e,t){return d.openBlock(),d.createElementBlock("svg",o1e,t[0]||(t[0]=[d.createElementVNode("path",{d:"M8.8148 18.2251C6.6173 18.2251 5.0498 16.6576 5.0498 14.4601V10.7401C5.0498 8.5426 6.6173 6.9751 8.8148 6.9751C11.0123 6.9751 12.5798 8.5426 12.5798 10.7401V14.4601C12.5798 16.6576 11.0123 18.2251 8.8148 18.2251ZM6.6473 14.5576C6.6473 15.7651 7.60731 16.7251 8.8148 16.7251C10.0223 16.7251 10.9823 15.7651 10.9823 14.5576V10.6276C10.9823 9.4276 10.0223 8.4676 8.8148 8.4676C7.60731 8.4676 6.6473 9.4276 6.6473 10.6276V14.5576Z",fill:"currentColor"},null,-1),d.createElementVNode("path",{d:"M15.8738 12.3751C14.3888 12.3751 13.1738 11.1751 13.1738 9.6751C13.1738 8.2051 14.4338 6.9751 15.8738 6.9751C17.3588 6.9751 18.5738 8.1751 18.5738 9.6751C18.5738 11.1751 17.3588 12.3751 15.8738 12.3751ZM14.5313 9.6751C14.5313 10.4026 15.1463 11.0176 15.8738 11.0176C16.6013 11.0176 17.2163 10.4026 17.2163 9.6751C17.2163 8.9476 16.6013 8.3326 15.8738 8.3326C15.1463 8.3326 14.5313 8.9476 14.5313 9.6751Z",fill:"currentColor"},null,-1)]))}const gB=mr(i1e,[["render",l1e]]),s1e={},u1e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function c1e(e,t){return d.openBlock(),d.createElementBlock("svg",u1e,t[0]||(t[0]=[d.createElementVNode("path",{d:"M5.75684 18.0001V16.1176H0.881836V14.6326L4.39184 7.2001H6.18434L2.67434 14.6326H5.75684V11.7076H7.34684V14.6326H8.41934V16.1176H7.34684V18.0001H5.75684Z",fill:"currentColor"},null,-1),d.createElementVNode("path",{d:"M12.5224 18.2251C10.8574 18.2251 9.46242 17.1226 9.01992 15.5476L10.5274 15.1426C10.7749 16.1026 11.6674 16.7101 12.5674 16.7101C13.7524 16.7101 14.6899 15.7576 14.6899 14.6026C14.6899 13.4176 13.7224 12.4876 12.5674 12.4876C11.6824 12.4876 11.0749 12.9076 10.7374 13.3576L9.37242 12.8776L9.70242 7.2001H15.5299V8.6776H11.1049L10.9249 11.6476C11.4574 11.2651 12.1324 11.0626 12.7699 11.0626C14.7874 11.0626 16.2724 12.5776 16.2724 14.6026C16.2724 16.6126 14.5399 18.2251 12.5224 18.2251Z",fill:"currentColor"},null,-1),d.createElementVNode("path",{d:"M19.265 12.3751C17.78 12.3751 16.565 11.1751 16.565 9.6751C16.565 8.2051 17.825 6.9751 19.265 6.9751C20.75 6.9751 21.965 8.1751 21.965 9.6751C21.965 11.1751 20.75 12.3751 19.265 12.3751ZM17.9225 9.6751C17.9225 10.4026 18.5375 11.0176 19.265 11.0176C19.9925 11.0176 20.6075 10.4026 20.6075 9.6751C20.6075 8.9476 19.9925 8.3326 19.265 8.3326C18.5375 8.3326 17.9225 8.9476 17.9225 9.6751Z",fill:"currentColor"},null,-1)]))}const yB=mr(s1e,[["render",c1e]]),f1e={},d1e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function A1e(e,t){return d.openBlock(),d.createElementBlock("svg",d1e,t[0]||(t[0]=[d.createElementVNode("path",{d:"M4.6132 6.9826C6.7057 6.9826 8.3257 8.6026 8.3257 10.8301V14.2726C8.3257 16.6351 6.7432 18.2251 4.4557 18.2251C3.3157 18.2251 2.2882 17.7901 1.5532 16.9426L2.7007 15.8701C3.1132 16.4026 3.7582 16.7401 4.4557 16.7401C5.7982 16.7401 6.7282 15.6601 6.7282 14.4751V13.1851C6.1207 13.7926 5.2957 14.1526 4.4032 14.1526C2.3857 14.1526 0.908203 12.6226 0.908203 10.6051C0.908203 8.5801 2.5957 6.9826 4.6132 6.9826ZM2.4982 10.6051C2.4982 11.7751 3.4357 12.7201 4.6057 12.7201C5.7757 12.7201 6.7282 11.7751 6.7282 10.6051C6.7282 9.4501 5.7832 8.4901 4.6132 8.4901C3.4432 8.4901 2.4982 9.4351 2.4982 10.6051Z",fill:"currentColor"},null,-1),d.createElementVNode("path",{d:"M13.2846 18.2251C11.0871 18.2251 9.51961 16.6576 9.51961 14.4601V10.7401C9.51961 8.5426 11.0871 6.9751 13.2846 6.9751C15.4821 6.9751 17.0496 8.5426 17.0496 10.7401V14.4601C17.0496 16.6576 15.4821 18.2251 13.2846 18.2251ZM11.1171 14.5576C11.1171 15.7651 12.0771 16.7251 13.2846 16.7251C14.4921 16.7251 15.4521 15.7651 15.4521 14.5576V10.6276C15.4521 9.4276 14.4921 8.4676 13.2846 8.4676C12.0771 8.4676 11.1171 9.4276 11.1171 10.6276V14.5576Z",fill:"currentColor"},null,-1),d.createElementVNode("path",{d:"M20.3436 12.3751C18.8586 12.3751 17.6436 11.1751 17.6436 9.6751C17.6436 8.2051 18.9036 6.9751 20.3436 6.9751C21.8286 6.9751 23.0436 8.1751 23.0436 9.6751C23.0436 11.1751 21.8286 12.3751 20.3436 12.3751ZM19.0011 9.6751C19.0011 10.4026 19.6161 11.0176 20.3436 11.0176C21.0711 11.0176 21.6861 10.4026 21.6861 9.6751C21.6861 8.9476 21.0711 8.3326 20.3436 8.3326C19.6161 8.3326 19.0011 8.9476 19.0011 9.6751Z",fill:"currentColor"},null,-1)]))}const wB=mr(f1e,[["render",A1e]]),p1e={},h1e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function v1e(e,t){return d.openBlock(),d.createElementBlock("svg",h1e,t[0]||(t[0]=[d.createStaticVNode('<path d="M4 4L4 20" stroke="currentColor" stroke-width="1.5" stroke-linecap="square"></path><path d="M7.25 4H8.75" stroke="currentColor" stroke-width="1.5"></path><path d="M11.25 4H12.75" stroke="currentColor" stroke-width="1.5"></path><path d="M15.25 4H16.75" stroke="currentColor" stroke-width="1.5"></path><path d="M19.25 4H20.75" stroke="currentColor" stroke-width="1.5"></path><path d="M7.25 20H8.75" stroke="currentColor" stroke-width="1.5"></path><path d="M11.25 20H12.75" stroke="currentColor" stroke-width="1.5"></path><path d="M15.25 20H16.75" stroke="currentColor" stroke-width="1.5"></path><path d="M19.25 20H20.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 3.25L20 4.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 7.25L20 8.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 11.25L20 12.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 15.25L20 16.75" stroke="currentColor" stroke-width="1.5"></path>',13)]))}const CB=mr(p1e,[["render",v1e]]),m1e={},g1e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function y1e(e,t){return d.openBlock(),d.createElementBlock("svg",g1e,t[0]||(t[0]=[d.createStaticVNode('<path d="M20 20L4 20" stroke="currentColor" stroke-width="1.5" stroke-linecap="square"></path><path d="M7.25 4H8.75" stroke="currentColor" stroke-width="1.5"></path><path d="M11.25 4H12.75" stroke="currentColor" stroke-width="1.5"></path><path d="M15.25 4H16.75" stroke="currentColor" stroke-width="1.5"></path><path d="M19.25 4H20.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 3.25L20 4.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 7.25L20 8.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 11.25L20 12.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 15.25L20 16.75" stroke="currentColor" stroke-width="1.5"></path><path d="M4 3.25L4 4.75" stroke="currentColor" stroke-width="1.5"></path><path d="M4 7.25L4 8.75" stroke="currentColor" stroke-width="1.5"></path><path d="M4 11.25L4 12.75" stroke="currentColor" stroke-width="1.5"></path><path d="M4 15.25L4 16.75" stroke="currentColor" stroke-width="1.5"></path>',13)]))}const bB=mr(m1e,[["render",y1e]]),w1e={},C1e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function b1e(e,t){return d.openBlock(),d.createElementBlock("svg",C1e,t[0]||(t[0]=[d.createStaticVNode('<path d="M4 4L4 19C4 19.5523 4.44772 20 5 20L20 20" stroke="currentColor" stroke-width="1.5" stroke-linecap="square"></path><path d="M7.25 4H8.75" stroke="currentColor" stroke-width="1.5"></path><path d="M11.25 4H12.75" stroke="currentColor" stroke-width="1.5"></path><path d="M15.25 4H16.75" stroke="currentColor" stroke-width="1.5"></path><path d="M19.25 4H20.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 3.25L20 4.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 7.25L20 8.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 11.25L20 12.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 15.25L20 16.75" stroke="currentColor" stroke-width="1.5"></path>',9)]))}const EB=mr(w1e,[["render",b1e]]),E1e={inheritAttrs:!1},x1e={class:"double-contour-temp"};function S1e(e,t,n,r,a,i){return d.openBlock(),d.createElementBlock("div",x1e,[d.createElementVNode("div",d.normalizeProps(d.guardReactiveProps(e.$attrs)),[d.renderSlot(e.$slots,"default")],16)])}const xB=mr(E1e,[["render",S1e]]),B1e={},k1e={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function T1e(e,t){return d.openBlock(),d.createElementBlock("svg",k1e,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.5951 8.76689C9.7962 8.43389 8.91957 8.25 8 8.25C4.27208 8.25 1.25 11.2721 1.25 15C1.25 18.7279 4.27208 21.75 8 21.75C11.7279 21.75 14.75 18.7279 14.75 15C14.75 12.7693 13.6679 10.7913 12 9.56231C11.5866 9.86693 11.2092 10.2176 10.8753 10.6067C12.3055 11.5446 13.25 13.162 13.25 15C13.25 17.8995 10.8995 20.25 8 20.25C5.10051 20.25 2.75 17.8995 2.75 15C2.75 12.1005 5.10051 9.75 8 9.75C8.51 9.75 9.00302 9.82272 9.46924 9.95836C9.80438 9.52487 10.1817 9.12566 10.5951 8.76689Z",fill:"#110529"},null,-1),d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 2.75C9.10051 2.75 6.75 5.10051 6.75 8C6.75 10.8995 9.10051 13.25 12 13.25C14.8995 13.25 17.25 10.8995 17.25 8C17.25 5.10051 14.8995 2.75 12 2.75ZM5.25 8C5.25 4.27208 8.27208 1.25 12 1.25C15.7279 1.25 18.75 4.27208 18.75 8C18.75 11.7279 15.7279 14.75 12 14.75C8.27208 14.75 5.25 11.7279 5.25 8Z",fill:"#07AD3E"},null,-1),d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M21.25 15C21.25 12.9441 20.0683 11.1643 18.3471 10.3026C18.5192 9.82834 18.6396 9.32933 18.7016 8.81237C21.0847 9.85434 22.75 12.2327 22.75 15C22.75 18.7279 19.7279 21.75 16 21.75C13.9499 21.75 12.1132 20.836 10.8753 19.3933C11.2961 19.1174 11.6749 18.7825 12 18.4005C12.963 19.5322 14.3977 20.25 16 20.25C18.8995 20.25 21.25 17.8995 21.25 15ZM11.1556 17.0269C10.8943 16.4032 10.75 15.7185 10.75 15C10.75 12.1005 13.1005 9.75 16 9.75C16.3146 9.75 16.6227 9.77767 16.922 9.83069C17.0939 9.36877 17.2026 8.87611 17.2376 8.36321C16.8364 8.28886 16.4227 8.25 16 8.25C12.2721 8.25 9.25 11.2721 9.25 15C9.25 16.139 9.53213 17.2122 10.0303 18.1534C10.481 17.8626 10.8653 17.4779 11.1556 17.0269Z",fill:"#110529"},null,-1)]))}const _1e=mr(B1e,[["render",T1e]]),D1e={key:4,class:"size"},U5=d.defineComponent({__name:"AesButton",props:{data:{}},emits:["ref"],setup(e,{emit:t}){const n=e,r=n.data.type==="fill"||n.data.type==="stroke",a=d.computed(()=>({icon__white:r&&n.data.value.toLowerCase()==="#ffffff",icon__empty:r&&n.data.value.toLowerCase()==="transparent"})),i=d.computed(()=>n.data.type==="fill"?{"background-color":n.data.value}:n.data.type==="stroke"&&!a.value.icon__empty&&!a.value.icon__white?{"border-color":n.data.value}:{});return(o,s)=>(d.openBlock(),d.createElementBlock("div",{class:"ui-aes-button",ref:c=>o.$emit("ref",c)},[d.createVNode(xB,{class:"ui-multiselect-button__contour"}),o.data.type==="fill"?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["icon icon__fill",a.value]),style:d.normalizeStyle(i.value)},null,6)):o.data.type==="stroke"?(d.openBlock(),d.createElementBlock("div",{key:1,class:d.normalizeClass(["icon icon__stroke",a.value]),style:d.normalizeStyle(i.value)},null,6)):o.data.type==="dotShape"?(d.openBlock(),d.createElementBlock("div",{key:2,class:d.normalizeClass(["icon dot",{[`dot__${o.data.value}`]:!0}])},null,2)):o.data.type==="lineType"?(d.openBlock(),d.createElementBlock("div",{key:3,class:d.normalizeClass(["icon icon__line",{[`line__${o.data.value}`]:!0}])},null,2)):o.data.type==="size"?(d.openBlock(),d.createElementBlock("span",D1e,d.toDisplayString(o.data.value),1)):o.data.type==="data"?(d.openBlock(),d.createBlock(d.resolveDynamicComponent(_1e),{key:5,class:"icon"})):d.createCommentVNode("",!0)],512))}}),P1e={},M1e={class:"inline-icon",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"};function H1e(e,t){return d.openBlock(),d.createElementBlock("svg",M1e,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 8L7.53033 13.5303L8.59099 12.4697L4.87132 8.75L14.0607 8.75L14.0607 7.25L4.87132 7.25L8.59099 3.53033L7.53033 2.46967L2 8Z",fill:"#110529"},null,-1)]))}const I1e=mr(P1e,[["render",H1e]]),R1e={ref:"root",class:"aes-settings-form"},N1e={class:"aes-settings-form__header"},Uh=d.defineComponent({__name:"FormWrapper",props:{title:{},backTitle:{}},emits:["form:close"],setup(e,{emit:t}){return(n,r)=>(d.openBlock(),d.createBlock(d.Teleport,{to:"#graph-settings-modal"},[d.createElementVNode("div",R1e,[d.createElementVNode("div",N1e,[d.createElementVNode("div",{onClick:r[0]||(r[0]=d.withModifiers(a=>n.$emit("form:close"),["stop"])),class:"back-link"},[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(I1e))),d.createTextVNode(" "+d.toDisplayString(`Back to ${n.backTitle}`),1)]),d.createElementVNode("h3",null,d.toDisplayString(n.title),1)]),d.renderSlot(n.$slots,"default")],512)]))}}),L1e={class:"ui-multiselect-button__content"},$1e={key:0,class:"title"},F1e={key:1,class:"gradient"},V1e=6,Ay=d.defineComponent({__name:"MultiselectButton",props:{label:{},title:{},palette:{}},emits:["button-click"],setup(e,{emit:t}){const n=d.ref(void 0);rt.useLabelNotch(n);function r(a){const i=100/(a.length-1);return`background: linear-gradient(to right, ${a.map((o,s)=>`${o} ${s*i}%`).join(", ")})`}return(a,i)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"root",ref:n,class:"ui-multiselect-button",onClick:i[0]||(i[0]=d.withModifiers(o=>a.$emit("button-click"),["stop"]))},[a.label?(d.openBlock(),d.createElementBlock("label",{key:0,ref:"label"},d.toDisplayString(a.label),513)):d.createCommentVNode("",!0),d.createVNode(xB,{class:"ui-multiselect-button__contour"}),d.createElementVNode("div",L1e,[a.title?(d.openBlock(),d.createElementBlock("div",$1e,d.toDisplayString(a.title),1)):d.createCommentVNode("",!0),a.palette&&d.unref(uS)(a.palette)?(d.openBlock(),d.createElementBlock("div",F1e,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(Gi)[a.palette].colors.slice(0,V1e),o=>(d.openBlock(),d.createElementBlock("div",{class:"gradient__item",style:d.normalizeStyle({background:o})},null,4))),256))])):a.palette?(d.openBlock(),d.createElementBlock("div",{key:2,class:"gradient",style:d.normalizeStyle(r(d.unref(Gi)[a.palette].colors))},null,4)):(d.openBlock(),d.createBlock(d.unref(rt.PlIcon16),{key:3,class:"icon",name:"chevron-right"}))])],512))}}),O1e={class:"palettes-groups"},Q1e={class:"palettes-list"},z1e=["onClick"],U1e={class:"palette-gradient"},G1e={class:"palettes-list"},j1e=["onClick"],Y1e={class:"palettes-list"},W1e=["onClick"],X1e=9,py=d.defineComponent({__name:"PalettesForm",props:{selected:{},categorical:{type:Boolean,default:!0},sequential:{type:Boolean,default:!0},diverging:{type:Boolean,default:!0}},emits:["select"],setup(e,{emit:t}){const n=t;function r(i){n("select",i)}function a(i){const o=100/(i.length-1);return`background: linear-gradient(to right, ${i.map((s,c)=>`${s} ${c*o}%`).join(", ")})`}return(i,o)=>(d.openBlock(),d.createElementBlock("div",O1e,[i.categorical?(d.openBlock(),d.createElementBlock(d.Fragment,{key:0},[o[0]||(o[0]=d.createElementVNode("div",{class:"section-title"},[d.createElementVNode("span",null,"CATEGORICAL")],-1)),o[1]||(o[1]=d.createElementVNode("div",{class:"section-description"}," Best to representing categorical data ",-1)),d.createElementVNode("div",Q1e,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(yR),s=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["palettes-list__palette",{selected:i.selected===s}]),onClick:d.withModifiers(c=>r(s),["stop"])},[d.createElementVNode("div",null,d.toDisplayString(d.unref(Gi)[s].title),1),d.createElementVNode("div",U1e,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(Gi)[s].colors.slice(0,X1e),c=>(d.openBlock(),d.createElementBlock("div",{class:"palette-gradient__item",style:d.normalizeStyle({background:c})},null,4))),256))])],10,z1e))),256))])],64)):d.createCommentVNode("",!0),i.sequential?(d.openBlock(),d.createElementBlock(d.Fragment,{key:1},[o[2]||(o[2]=d.createElementVNode("div",{class:"section-title"},[d.createElementVNode("span",null,"SEQUENTIAL")],-1)),o[3]||(o[3]=d.createElementVNode("div",{class:"section-description"}," Best to representing sequential data ",-1)),d.createElementVNode("div",G1e,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(Nae),s=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["palettes-list__palette",{selected:i.selected===s}]),onClick:d.withModifiers(c=>r(s),["stop"])},[d.createElementVNode("div",null,d.toDisplayString(d.unref(Gi)[s].title),1),d.createElementVNode("div",{class:"palette-gradient",style:d.normalizeStyle(a(d.unref(Gi)[s].colors))},null,4)],10,j1e))),256))])],64)):d.createCommentVNode("",!0),i.diverging?(d.openBlock(),d.createElementBlock(d.Fragment,{key:2},[o[4]||(o[4]=d.createElementVNode("div",{class:"section-title"},[d.createElementVNode("span",null,"DIVERGING")],-1)),o[5]||(o[5]=d.createElementVNode("div",{class:"section-description"}," Best to representing diverging data ",-1)),d.createElementVNode("div",Y1e,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(Lae),s=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["palettes-list__palette",{selected:i.selected===s}]),onClick:d.withModifiers(c=>r(s),["stop"])},[d.createElementVNode("div",null,d.toDisplayString(d.unref(Gi)[s].title),1),d.createElementVNode("div",{class:"palette-gradient",style:d.normalizeStyle(a(d.unref(Gi)[s].colors))},null,4)],10,W1e))),256))])],64)):d.createCommentVNode("",!0)]))}}),K1e=["onClick"],k$=d.defineComponent({__name:"FixedColorsList",props:{modelValue:{},colorUsing:{default:"fill"},colorsList:{default:()=>N3}},emits:["update:modelValue"],setup(e,{emit:t}){return(n,r)=>(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.colorsList,a=>(d.openBlock(),d.createElementBlock("div",{key:a.color,class:d.normalizeClass(["color-item",{border:n.colorUsing==="stroke",white:a.name==="White",empty:a.name==="None",selected:a.color===n.modelValue}]),style:d.normalizeStyle(a.name!=="White"&&a.name!=="None"?`${n.colorUsing==="fill"?"background":"border-color"}: ${a.color};`:""),onClick:i=>n.$emit("update:modelValue",a.color)},r[0]||(r[0]=[d.createElementVNode("div",{class:"checkmark"},null,-1)]),14,K1e))),128))}}),Z1e=["onClick"],J1e={class:"row-item__title"},C6=d.defineComponent({__name:"FixedLineTypeList",props:{modelValue:{},list:{default:()=>$3}},emits:["update:modelValue"],setup(e,{emit:t}){return(n,r)=>(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.list,a=>(d.openBlock(),d.createElementBlock("div",{key:a,class:d.normalizeClass(["row-item",{"row-item__selected":a===n.modelValue,[`line__${a}`]:!0}]),onClick:i=>n.$emit("update:modelValue",a)},[d.createElementVNode("div",J1e,d.toDisplayString(d.unref(Fae)[a].title),1),(d.openBlock(),d.createElementBlock("svg",{class:d.normalizeClass(["row-item__line line",{[`line__${a}`]:!0}])},r[0]||(r[0]=[d.createElementVNode("line",{x1:"0",x2:"100%",y1:"50%",y2:"50%"},null,-1)]),2))],10,Z1e))),128))}}),q1e=["onClick"],T$=d.defineComponent({__name:"FixedDotShapeList",props:{modelValue:{},list:{default:()=>G7}},emits:["update:modelValue"],setup(e,{emit:t}){return(n,r)=>(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.list,a=>(d.openBlock(),d.createElementBlock("div",{key:a,class:d.normalizeClass(["color-item dot",{selected:a===n.modelValue,[`dot__${a}`]:!0}]),onClick:i=>n.$emit("update:modelValue",a)},null,10,q1e))),128))}}),b6=d.defineComponent({__name:"Popup",props:{gap:{default:8},targetRef:{},width:{default:258},height:{}},emits:["popup:close"],setup(e,{emit:t}){const n=t,r=e;function a(){n("popup:close")}const i=d.ref(),o=d.ref(r.targetRef),s=d.ref("bottom"),c=d.ref(""),f=d.ref("");function A(p,v=8){rt.usePosition(p,y=>{if(r.height&&y.offsetY+y.height+3*v+r.height>y.clientHeight){const C=y.right-y.width-v;if(y.clientHeight-y.offsetY>r.height+v){const x=y.offsetY;c.value=`left: ${C}px; top: ${x}px;`,f.value="top: 16px;",s.value="left-bottom"}else{const x=y.clientHeight-r.height-2*v;c.value=`left: ${C}px; top: ${x}px;`;const k=y.offsetY+2*Math.floor(y.height/2),_=y.clientHeight-k;f.value=`bottom: ${_}px;`,s.value="left-bottom"}}else c.value=`left: ${y.right}px; top: ${y.offsetY+y.height+v}px;`,f.value="",s.value="bottom"})}return A(o,r.gap),rt.useClickOutside([o,i],()=>a()),(p,v)=>(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[d.createElementVNode("div",{class:"popup",style:d.normalizeStyle(c.value),onClick:v[0]||(v[0]=y=>y.stopPropagation())},[d.createElementVNode("div",{ref_key:"popup",ref:i,class:d.normalizeClass(["popup__content",s.value]),style:d.normalizeStyle({width:`${p.width}px`})},[d.createElementVNode("div",null,[d.renderSlot(p.$slots,"default")]),(d.openBlock(),d.createElementBlock("svg",{style:d.normalizeStyle(f.value),class:"beak",width:"5",height:"9",viewBox:"0 0 3 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v[1]||(v[1]=[d.createElementVNode("path",{d:"M4 8L0 4L4 0L4 8 Z"},null,-1),d.createElementVNode("polyline",{points:"4,8 0,4 4,0"},null,-1)]),4))],6)],4)]))}}),eve={},tve={xmlns:"http://www.w3.org/2000/svg",width:"8",height:"12",viewBox:"0 0 8 12",fill:"none"};function nve(e,t){return d.openBlock(),d.createElementBlock("svg",tve,t[0]||(t[0]=[d.createStaticVNode('<path d="M2.5 0H0.5V2H2.5V0Z" fill="#CFD1DB"></path><path d="M2.5 5H0.5V7H2.5V5Z" fill="#CFD1DB"></path><path d="M0.5 10H2.5V12H0.5V10Z" fill="#CFD1DB"></path><path d="M7.5 0H5.5V2H7.5V0Z" fill="#CFD1DB"></path><path d="M5.5 5H7.5V7H5.5V5Z" fill="#CFD1DB"></path><path d="M7.5 10H5.5V12H7.5V10Z" fill="#CFD1DB"></path>',6)]))}const rve=mr(eve,[["render",nve]]),E6=1,ave=d.defineComponent({__name:"PlColorSliderThumb",props:{barRef:{},modelValue:{},min:{default:0},max:{default:100},getColorForPercent:{},padding:{default:16},isActive:{type:Boolean}},emits:["update:modelValue","active"],setup(e,{emit:t}){const n=e,r=t,a=d.ref(),i=d.ref(),o=d.ref(!1),s=n.min,c=n.max;let f=d.ref(0);const A=c-s,p=n.padding/n.barRef.getBoundingClientRect().width*100/2,v=d.computed(()=>i5.clamp((n.modelValue??0)+f.value,Math.ceil(s+p),Math.ceil(c-p))),y=d.computed(()=>({right:`calc(${Math.ceil((1-b.value)*100)}%) `})),b=d.computed(()=>(v.value-s)/A);function C(N){const I=i5.clamp(N,s,c);return Math.round((I+Number.EPSILON)*(1/E6))/(1/E6)}function x(){o.value=!1}function k(N){N?(document.addEventListener("mouseup",x),document.addEventListener("focusout",x)):(document.removeEventListener("mouseup",x),document.removeEventListener("focusout",x)),o.value=N,r("active",N)}rt.useMouseCapture(a,N=>{var I;i5.tapIf((I=d.unref(n.barRef))==null?void 0:I.getBoundingClientRect(),F=>{const{dx:Q}=N;f.value=Q/F.width*A,N.stop&&(r("update:modelValue",C(v.value)),f.value=0)})});function _(N){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(N.code)&&N.preventDefault(),N.code==="ArrowLeft"&&r("update:modelValue",i5.clamp(n.modelValue-E6,s,c)),N.code==="ArrowRight"&&r("update:modelValue",i5.clamp(n.modelValue+E6,s,c))}function P(N){var I,F;N?(I=i.value)==null||I.classList.add("pl-color-slider__top-index"):(F=i.value)==null||F.classList.remove("pl-color-slider__top-index")}return(N,I)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"wrapper",ref:i,style:d.normalizeStyle(y.value),class:d.normalizeClass([{"active-thumb":o.value||N.isActive},"pl-color-slider__thumb"]),tabindex:"0",onMousedown:I[2]||(I[2]=F=>k(!0)),onMouseup:I[3]||(I[3]=F=>k(!1)),onKeydown:_,onFocus:I[4]||(I[4]=F=>k(!0))},[d.createElementVNode("div",{ref_key:"thumb",ref:a,class:d.normalizeClass([{active:o.value},"pl-color-slider__thumb-roof"]),onMouseover:I[0]||(I[0]=F=>P(!0)),onMouseout:I[1]||(I[1]=F=>P(!1))},[d.createElementVNode("div",{class:"pl-color-slider__thumb-color-indicator",style:d.normalizeStyle({backgroundColor:N.getColorForPercent(v.value)})},null,4)],34)],38))}}),ive={class:"pl-color-slider"},ove={class:"pl-color-slider__wrapper"},lve={class:"pl-color-slider__thumbs-contaier"},sve=d.defineComponent({__name:"PlColorSlider",props:{colors:{},modelValue:{},getColorForPercent:{type:Function},active:{}},emits:["update:modelValue","active"],setup(e,{emit:t}){const n=e,r=t,a=d.ref(),i=d.reactive({}),o=d.ref(-1);d.watch(()=>n.modelValue,()=>{n.modelValue.forEach((A,p)=>i[p]=A)},{immediate:!0});const s=d.computed(()=>Math.floor(o.value!==-1?0-o.value:0)),c=d.computed(()=>Math.floor(o.value!==-1?100+o.value:100));d.watch(()=>i,A=>{r("update:modelValue",Object.values(A))},{deep:!0});const f=d.computed(()=>{const A=100/(n.colors.length-1);return`linear-gradient(to right, ${n.colors.map((v,y)=>`${v} ${A*y}%`).join(", ")})`});return d.onMounted(()=>{let A=16,p=a.value.getBoundingClientRect().width-A*2;o.value=A/p*100}),(A,p)=>(d.openBlock(),d.createElementBlock("div",ive,[d.createElementVNode("div",ove,[d.createElementVNode("div",{ref_key:"barRef",ref:a,class:"pl-color-slider__color-contaier"},[d.createElementVNode("div",{style:d.normalizeStyle({background:f.value}),class:"pl-color-slider__gradient"},null,4)],512),d.createElementVNode("div",lve,[a.value?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(A.modelValue,(v,y)=>(d.openBlock(),d.createBlock(ave,{modelValue:i[y],"onUpdate:modelValue":b=>i[y]=b,"is-active":A.active===y,key:y,min:s.value,max:c.value,"bar-ref":a.value,"get-color-for-percent":A.getColorForPercent,class:"pl-color-slider__thumb",tabindex:"0",onActive:b=>A.$emit("active",{index:y,status:b})},null,8,["modelValue","onUpdate:modelValue","is-active","min","max","bar-ref","get-color-for-percent","onActive"]))),128)):d.createCommentVNode("",!0)])])]))}});function _$(e,t){if(t==="lineType")return e*32+16*2;if(t==="dotShape"||t==="color")return Math.ceil(e/6)*36+20*2}const uve={class:"aes-mapping-block"},cve={style:{margin:"0 24px"}},fve={class:"section-title"},dve={style:{margin:"24px 0"}},Ave={key:0,style:{margin:"24px 0"}},pve={key:0,class:"aes-settings-hint"},hve={key:0,class:"column-value__reorder-icon"},vve={class:"column-value__title"},mve={class:"column-value__aes-group"},gve=["onClick"],yve=["onClick"],wve=["onClick"],SB=d.defineComponent({__name:"AesDataMappingDiscrete",props:{dataColumnLabel:{},columnValueLabels:{},usedAesInMapping:{},modelValue:{},allowReordering:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,a=d.ref(!1),i=d.ref(n.modelValue.palette),o=d.computed(()=>uS(i.value)),s=d.ref(null),c=d.computed(()=>s.value===null?null:n.modelValue.order.indexOf(s.value)),f=d.ref(null),A=d.computed(()=>n.modelValue.order.map(le=>{var U;const z=(U=n.modelValue.mapping[le])==null?void 0:U.aes;return{text:n.columnValueLabels[le],value:le,dotShape:z==null?void 0:z.dotShape,color:z==null?void 0:z.color,lineType:z==null?void 0:z.lineShape}}));function p(le){i.value=le,a.value=!1,r("update:modelValue",DN(le,n.modelValue.order))}function v(le,z,U){r("update:modelValue",{...n.modelValue,mapping:{...n.modelValue.mapping,[le]:{...n.modelValue.mapping[le],aes:{...n.modelValue.mapping[le].aes,[z]:U}}}})}const y=d.reactive({color:{},dotShape:{},lineType:{}});function b(le,z,U){U&&!y[le][z.value]&&(y[le][z.value]=U)}function C(le,z){const U=s.value===le.value&&f.value===z;s.value=U?null:le.value,f.value=U?null:z}function x(){s.value=null,f.value=null}const k=d.computed(()=>Gi[i.value].colors.map(le=>({color:le,name:le}))),_=d.computed(()=>f.value?_$(f.value==="lineType"?$3.length:f.value==="dotShape"?G7.length:k.value.length,f.value):0),P=d.ref();n.allowReordering&&rt.useSortable(P,{handle:".column-value__reorder-icon",onChange(le){r("update:modelValue",{...n.modelValue,order:le.map(z=>n.modelValue.order[z])})}});function N(le,z,U=0,G=1){const Y=1/(le.length-1),X=Zr().domain(le.map((te,he)=>U+he*Y*(G-U))).range(le);return te=>te>G||te<U?z:X(te)}const I=d.computed(()=>N(Gi[i.value].colors,gC)),F=d.computed(()=>N(Gi[i.value].colors,gC,0,100)),Q=d.ref(n.modelValue.order.map(le=>n.modelValue.mapping[le].colorIdx*100));d.watch(()=>n.modelValue,le=>{Q.value=le.order.map(z=>le.mapping[z].colorIdx*100)});function Z(le){le.forEach((z,U)=>{const G=n.modelValue.order[U],Y=z/100;n.modelValue.mapping[G].colorIdx!==Y&&r("update:modelValue",{...n.modelValue,mapping:{...n.modelValue.mapping,[G]:{colorIdx:Y,aes:{...n.modelValue.mapping[G].aes,color:I.value(Y)}}}})})}function ee(le){f.value="color",s.value=le.status?n.modelValue.order[le.index]:null}return(le,z)=>(d.openBlock(),d.createElementBlock("div",uve,[d.createElementVNode("div",cve,[d.createElementVNode("div",fve,[d.createElementVNode("span",null,d.toDisplayString(le.dataColumnLabel),1)]),d.createElementVNode("div",dve,[d.createVNode(Ay,{label:"Color Palette ",icon:"chevron-right",title:d.unref(Gi)[i.value].title,palette:i.value,onButtonClick:z[0]||(z[0]=U=>{a.value=!0,x()})},null,8,["title","palette"])]),o.value?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",Ave,[d.createVNode(sve,{modelValue:Q.value,"onUpdate:modelValue":[z[1]||(z[1]=U=>Q.value=U),Z],colors:d.unref(Gi)[i.value].colors,"get-color-for-percent":F.value,active:c.value,onActive:ee},null,8,["modelValue","colors","get-color-for-percent","active"])])),a.value?(d.openBlock(),d.createBlock(Uh,{key:1,title:"Color Palette","back-title":"Color mapping","onForm:close":z[2]||(z[2]=U=>a.value=!1)},{default:d.withCtx(()=>[d.createVNode(py,{selected:i.value,onSelect:p},null,8,["selected"])]),_:1})):d.createCommentVNode("",!0)]),le.allowReordering?(d.openBlock(),d.createElementBlock("div",pve," Drag the rows to reorder ")):d.createCommentVNode("",!0),d.createElementVNode("div",{class:"column-values-list",ref_key:"optionsListRef",ref:P},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(A.value,U=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["column-value",{"column-value__with-reorder":le.allowReordering}])},[le.allowReordering?(d.openBlock(),d.createElementBlock("div",hve,[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(rve)))])):d.createCommentVNode("",!0),d.createElementVNode("div",vve,d.toDisplayString(U.text),1),d.createElementVNode("div",mve,[le.usedAesInMapping.lineType?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["column-value__aes",{aes__selected:s.value===U.value&&f.value==="lineType"}]),ref_for:!0,ref:G=>b("lineType",U,G),onClick:d.withModifiers(G=>C(U,"lineType"),["stop"])},[d.createElementVNode("div",{class:d.normalizeClass(["icon__line line",{[`line__${U.lineType}`]:!0}])},null,2)],10,gve)):d.createCommentVNode("",!0),le.usedAesInMapping.dotShape?(d.openBlock(),d.createElementBlock("div",{key:1,class:d.normalizeClass(["column-value__aes",{aes__selected:s.value===U.value&&f.value==="dotShape"}]),ref_for:!0,ref:G=>b("dotShape",U,G),onClick:d.withModifiers(G=>C(U,"dotShape"),["stop"])},[d.createElementVNode("div",{class:d.normalizeClass(["dot",{[`dot__${U.dotShape}`]:!0}])},null,2)],10,yve)):d.createCommentVNode("",!0),le.usedAesInMapping.fill||le.usedAesInMapping.stroke?(d.openBlock(),d.createElementBlock("div",{key:2,class:d.normalizeClass(["column-value__aes",{aes__selected:s.value===U.value&&f.value==="color"}]),ref_for:!0,ref:G=>b("color",U,G),onClick:d.withModifiers(G=>C(U,"color"),["stop"])},[d.createElementVNode("div",{class:"column-value__color",style:d.normalizeStyle({background:U.color})},null,4)],10,wve)):d.createCommentVNode("",!0),(f.value!=="color"||o.value)&&f.value!==null&&s.value===U.value?(d.openBlock(),d.createBlock(b6,{key:`${f.value}_${s.value}`,targetRef:y[f.value][s.value],"onPopup:close":x,height:_.value},{default:d.withCtx(()=>[d.createElementVNode("div",{class:d.normalizeClass(["fixed-aes-list",{"fixed-aes-list__rows":!1}])},[f.value==="lineType"?(d.openBlock(),d.createBlock(C6,{key:0,"onUpdate:modelValue":[G=>v(U.value,"lineShape",G),G=>U.lineType=G],modelValue:U.lineType},null,8,["onUpdate:modelValue","modelValue"])):d.createCommentVNode("",!0),f.value==="dotShape"?(d.openBlock(),d.createBlock(T$,{key:1,"onUpdate:modelValue":[G=>v(U.value,"dotShape",G),G=>U.dotShape=G],modelValue:U.dotShape},null,8,["onUpdate:modelValue","modelValue"])):d.createCommentVNode("",!0),f.value==="color"?(d.openBlock(),d.createBlock(k$,{key:2,"colors-list":k.value,"onUpdate:modelValue":[G=>v(U.value,"color",G),G=>U.color=G],modelValue:U.color},null,8,["colors-list","onUpdate:modelValue","modelValue"])):d.createCommentVNode("",!0)])]),_:2},1032,["targetRef","height"])):d.createCommentVNode("",!0)])],2))),256))],512)]))}}),Cve={class:"axes-settings-list"},bve={class:"axes-settings-options-row block"},Eve={key:0,class:"axes-settings-input"},xve={class:"axes-settings-options-row"},Sve={key:0,class:"axes-settings-options-row"},Bve={key:1,class:"axes-settings-options-row"},kve={key:2,class:"axes-settings-options-row"},Tve={class:"axes-settings-options-row block"},_ve={key:3},Dve={class:"axes-settings-options-row table"},Pve={class:"axes-settings-options-row table"},Mve={class:"axes-settings-options-row table"},Hve={class:"axes-settings-options-row block"},Ive={key:0},Rve={class:"axes-settings-options-row block"},Nve={class:"axes-settings-options-row table"},Lve={class:"axes-settings-options-row table"},$ve={class:"other"},Fve={class:"axes-settings-options-row"},Vve={class:"axes-settings-options-row"},Ove={class:"axes-settings-options-row"},Qve={class:"axes-settings-options-row block"},zve=d.defineComponent({__name:"DiscreteAxesSettingsForm",setup(e){const t=Tr(),n=t.value.reactive.axesSettings,r={height:40,horizontalPadding:12,defaultState:"open"},a=[{value:"left",icon:F5},{value:"center",icon:V5},{value:"right",icon:O5}],i=[{value:"center",icon:gB},{value:"45deg",icon:yB},{value:"90deg",icon:wB}],o=[{value:"auto",text:"Auto"},{value:"custom",text:"Custom"},{value:"hidden",text:"Hide"}],s=[{value:"linear",text:"Linear"},{value:"log",text:"Log"}],c=[{value:"empty",icon:z5},{value:"left",icon:CB},{value:"bottom",icon:bB},{value:"left-bottom",icon:EB},{value:"full",icon:Q5}],f=d.computed(()=>t.value.inputGuide.value),A=d.computed(()=>t.value.uniqueValuesData.value),p=d.ref(!1),v=d.ref(!1),y=d.computed(()=>{var le,z;return(z=(le=t.value.reactive.optionsState.components.primaryGrouping)==null?void 0:le.selectorStates[0])==null?void 0:z.selectedSource}),b=d.computed(()=>{var le,z;return(z=(le=t.value.reactive.optionsState.components.secondaryGrouping)==null?void 0:le.selectorStates[0])==null?void 0:z.selectedSource}),C=d.computed(()=>t.value.commonHelpersData.primaryGroups.value),x=d.computed(()=>t.value.commonHelpersData.secondaryGroups.value),k=d.computed(()=>t.value.commonHelpersData.usedAesInMapping.value),_=d.ref(t.value.reactive.dataBindAes[y.value]??Km(C.value)),P=d.ref(t.value.reactive.dataBindAes[b.value]??Km(x.value)),N=d.computed(()=>{var le;if(y.value){const z=f.value.getSourceInfo(y.value)??null,U=((le=A.value[y.value])==null?void 0:le.labels)??null;return{selectedSourceInfo:z,labels:C.value.reduce((G,Y)=>(G[Y]=(U==null?void 0:U[Y])??String(Y),G),{})}}}),I=d.computed(()=>{var le;if(b.value){const z=f.value.getSourceInfo(b.value)??null,U=((le=A.value[b.value])==null?void 0:le.labels)??null;return{selectedSourceInfo:z,labels:x.value.reduce((G,Y)=>(G[Y]=(U==null?void 0:U[Y])??String(Y),G),{})}}});function F(le,z){t.value.reactive.dataBindAes[z]=le}const Q=[{text:"X",value:"x"},{text:"Y",value:"y"},{text:"XY",value:"xy"},{text:"None",value:"none"}],Z=d.computed(()=>A.value[y.value]),ee=d.computed({get(){var le;return UN(n.axisX.labelsRotation,(le=Z.value)==null?void 0:le.options)},set(le){n.axisX.labelsRotation=le}});return(le,z)=>(d.openBlock(),d.createElementBlock("div",{class:"axes-form",onClick:z[26]||(z[26]=U=>U.stopPropagation())},[z[38]||(z[38]=d.createElementVNode("h3",{class:"axes-title"}," Axes ",-1)),d.createElementVNode("div",Cve,[d.createVNode(Pl,{title:"Title",settings:r,icon:Tf,"icon-open":_f},{default:d.withCtx(()=>[d.createElementVNode("div",bve,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).title.mode,"onUpdate:modelValue":z[0]||(z[0]=U=>d.unref(n).title.mode=U)},null,8,["modelValue"])]),d.unref(n).title.mode==="custom"?(d.openBlock(),d.createElementBlock("div",Eve,[d.createVNode(d.unref(rt.PlTextField),{label:"Chart title",placeholder:"Chart title",modelValue:d.unref(n).title.value,"onUpdate:modelValue":z[1]||(z[1]=U=>d.unref(n).title.value=U)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",xve,[z[27]||(z[27]=d.createElementVNode("span",null,"Alignment",-1)),d.createVNode(Df,{options:a,modelValue:d.unref(n).title.position,"onUpdate:modelValue":z[2]||(z[2]=U=>d.unref(n).title.position=U)},null,8,["modelValue"])])]),_:1}),d.createVNode(Pl,{title:"X-axis",settings:r,icon:Tf,"icon-open":_f},{default:d.withCtx(()=>[C.value.length>1?(d.openBlock(),d.createElementBlock("div",Sve,[z[28]||(z[28]=d.createElementVNode("span",null,"Primary groups order: ",-1)),d.createVNode(U5,{data:{type:"data",value:null},onClick:z[3]||(z[3]=U=>{p.value=!0})}),p.value&&N.value?(d.openBlock(),d.createBlock(Uh,{key:0,title:"Reorder primary groups","back-title":"Axes Settings","onForm:close":z[6]||(z[6]=U=>p.value=!1)},{default:d.withCtx(()=>{var U;return[d.createVNode(SB,{"column-value-labels":N.value.labels,"data-column-label":((U=N.value.selectedSourceInfo)==null?void 0:U.label)??"","used-aes-in-mapping":k.value[y.value],"allow-reordering":"",modelValue:_.value,"onUpdate:modelValue":[z[4]||(z[4]=G=>_.value=G),z[5]||(z[5]=G=>F(G,y.value))]},null,8,["column-value-labels","data-column-label","used-aes-in-mapping","modelValue"])]}),_:1})):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0),x.value.length>1?(d.openBlock(),d.createElementBlock("div",Bve,[z[29]||(z[29]=d.createElementVNode("span",null,"Secondary groups order: ",-1)),d.createVNode(U5,{data:{type:"data",value:null},onClick:z[7]||(z[7]=U=>{v.value=!0})}),v.value&&I.value?(d.openBlock(),d.createBlock(Uh,{key:0,title:"Reorder secondary groups","back-title":"Axes Settings","onForm:close":z[10]||(z[10]=U=>v.value=!1)},{default:d.withCtx(()=>{var U;return[d.createVNode(SB,{"column-value-labels":I.value.labels,"data-column-label":((U=I.value.selectedSourceInfo)==null?void 0:U.label)??"","used-aes-in-mapping":k.value[b.value],"allow-reordering":"",modelValue:P.value,"onUpdate:modelValue":[z[8]||(z[8]=G=>P.value=G),z[9]||(z[9]=G=>F(G,b.value))]},null,8,["column-value-labels","data-column-label","used-aes-in-mapping","modelValue"])]}),_:1})):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="discrete"?(d.openBlock(),d.createElementBlock("div",kve,[z[30]||(z[30]=d.createElementVNode("span",null,"Labels rotation",-1)),d.createVNode(Df,{options:i,modelValue:ee.value,"onUpdate:modelValue":z[11]||(z[11]=U=>ee.value=U)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",Tve,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).axisX.titleMode,"onUpdate:modelValue":z[12]||(z[12]=U=>d.unref(n).axisX.titleMode=U)},null,8,["modelValue"])]),d.unref(n).axisX.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",_ve,[d.createVNode(d.unref(rt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisX.customTitle,"onUpdate:modelValue":z[13]||(z[13]=U=>d.unref(n).axisX.customTitle=U)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",Dve,[z[31]||(z[31]=d.createElementVNode("span",null,"Gridlines",-1)),d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:d.unref(n).axisX.gridlines,"onUpdate:modelValue":z[14]||(z[14]=U=>d.unref(n).axisX.gridlines=U)},null,8,["modelValue"])]),d.createElementVNode("div",Pve,[z[32]||(z[32]=d.createElementVNode("span",null,"Lines between categories",-1)),d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:d.unref(n).axisX.linesBetweenCategories,"onUpdate:modelValue":z[15]||(z[15]=U=>d.unref(n).axisX.linesBetweenCategories=U)},null,8,["modelValue"])]),d.createElementVNode("div",Mve,[z[33]||(z[33]=d.createElementVNode("span",null,"Ticks",-1)),d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:d.unref(n).axisX.ticks,"onUpdate:modelValue":z[16]||(z[16]=U=>d.unref(n).axisX.ticks=U)},null,8,["modelValue"])])]),_:1}),d.createVNode(Pl,{title:"Y-axis",settings:r,icon:Tf,"icon-open":_f},{default:d.withCtx(()=>[d.createElementVNode("div",Hve,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).axisY.titleMode,"onUpdate:modelValue":z[17]||(z[17]=U=>d.unref(n).axisY.titleMode=U)},null,8,["modelValue"])]),d.unref(n).axisY.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",Ive,[d.createVNode(d.unref(rt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisY.customTitle,"onUpdate:modelValue":z[18]||(z[18]=U=>d.unref(n).axisY.customTitle=U)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",Rve,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Scale",options:s,modelValue:d.unref(n).axisY.scale,"onUpdate:modelValue":z[19]||(z[19]=U=>d.unref(n).axisY.scale=U)},null,8,["modelValue"])]),d.createElementVNode("div",Nve,[z[34]||(z[34]=d.createElementVNode("span",null,"Gridlines",-1)),d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:d.unref(n).axisY.gridlines,"onUpdate:modelValue":z[20]||(z[20]=U=>d.unref(n).axisY.gridlines=U)},null,8,["modelValue"])]),d.createElementVNode("div",Lve,[z[35]||(z[35]=d.createElementVNode("span",null,"Ticks",-1)),d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:d.unref(n).axisY.ticks,"onUpdate:modelValue":z[21]||(z[21]=U=>d.unref(n).axisY.ticks=U)},null,8,["modelValue"])])]),_:1}),d.createElementVNode("div",$ve,[d.createElementVNode("div",Fve,[z[36]||(z[36]=d.createElementVNode("span",null,"Frame",-1)),d.createVNode(Df,{options:c,modelValue:d.unref(n).other.frame,"onUpdate:modelValue":z[22]||(z[22]=U=>d.unref(n).other.frame=U)},null,8,["modelValue"])]),d.createElementVNode("div",Vve,[z[37]||(z[37]=d.createElementVNode("span",null,"Reverse axes",-1)),d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:d.unref(n).other.reverse,"onUpdate:modelValue":z[23]||(z[23]=U=>d.unref(n).other.reverse=U)},null,8,["modelValue"])]),d.createElementVNode("div",Ove,[d.createVNode(d.unref(rt.Slider),{style:{width:"100%"},label:"Facet column count",min:1,max:6,step:1,breakpoints:!0,mode:"input",modelValue:d.unref(n).other.facetColumns,"onUpdate:modelValue":z[24]||(z[24]=U=>d.unref(n).other.facetColumns=U)},null,8,["modelValue"])]),d.createElementVNode("div",Qve,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Facet shared by",options:Q,modelValue:d.unref(n).other.facetSharedBy,"onUpdate:modelValue":z[25]||(z[25]=U=>d.unref(n).other.facetSharedBy=U)},null,8,["modelValue"])])])])]))}}),Uve={class:"axes-settings-list"},Gve={class:"axes-settings-options-row block"},jve={key:0,class:"axes-settings-input"},Yve={class:"axes-settings-options-row"},Wve={class:"axes-settings-options-row block"},Xve={key:0},Kve={class:"axes-settings-options-row block"},Zve={class:"axes-settings-options-row table"},Jve={class:"axes-settings-options-row table"},qve={class:"axes-settings-options-row"},eme={class:"fixed-aes-list fixed-aes-list__rows"},tme={class:"axes-settings-options-row block"},nme={key:0},rme={class:"axes-settings-options-row block"},ame={class:"axes-settings-options-row table"},ime={class:"axes-settings-options-row table"},ome={class:"axes-settings-options-row"},lme={class:"fixed-aes-list fixed-aes-list__rows"},sme={key:0,class:"other"},ume={class:"axes-settings-options-row"},cme={class:"axes-settings-options-row"},fme={class:"axes-settings-options-row block"},dme=d.defineComponent({__name:"ScatterplotAxesSettingsForm",setup(e){const t=Tr(),n=t.value.reactive.axesSettings,r=d.computed(()=>t.value.reactive.chartType),a={height:40,horizontalPadding:12,defaultState:"open"},i=[{value:"left",icon:F5},{value:"center",icon:V5},{value:"right",icon:O5}],o=[{value:"auto",text:"Auto"},{value:"custom",text:"Custom"},{value:"hidden",text:"Hide"}],s=[{value:"linear",text:"Linear"},{value:"log",text:"Log"}],c=[{value:"empty",icon:z5},{value:"left",icon:CB},{value:"bottom",icon:bB},{value:"left-bottom",icon:EB},{value:"full",icon:Q5}],f=[{text:"X",value:"x"},{text:"Y",value:"y"},{text:"XY",value:"xy"},{text:"None",value:"none"}],A=d.ref(n.axisX.significantLinesStyle),p=d.ref(n.axisY.significantLinesStyle),v=d.computed(()=>_$($3.length,"lineType")),y=d.ref(),b=d.ref(),C=d.ref(!1),x=d.ref(!1);return(k,_)=>(d.openBlock(),d.createElementBlock("div",{class:"axes-form",onClick:_[26]||(_[26]=P=>P.stopPropagation())},[_[35]||(_[35]=d.createElementVNode("h3",{class:"axes-title"}," Axes ",-1)),d.createElementVNode("div",Uve,[d.createVNode(Pl,{title:"Title",settings:a,icon:Tf,"icon-open":_f},{default:d.withCtx(()=>[d.createElementVNode("div",Gve,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).title.mode,"onUpdate:modelValue":_[0]||(_[0]=P=>d.unref(n).title.mode=P)},null,8,["modelValue"])]),d.unref(n).title.mode==="custom"?(d.openBlock(),d.createElementBlock("div",jve,[d.createVNode(d.unref(rt.PlTextField),{label:"Chart title",placeholder:"Chart title",modelValue:d.unref(n).title.value,"onUpdate:modelValue":_[1]||(_[1]=P=>d.unref(n).title.value=P)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",Yve,[_[27]||(_[27]=d.createElementVNode("span",null,"Alignment",-1)),d.createVNode(Df,{options:i,modelValue:d.unref(n).title.position,"onUpdate:modelValue":_[2]||(_[2]=P=>d.unref(n).title.position=P)},null,8,["modelValue"])])]),_:1}),d.createVNode(Pl,{title:"X-axis",settings:a,icon:Tf,"icon-open":_f},{default:d.withCtx(()=>[d.createElementVNode("div",Wve,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).axisX.titleMode,"onUpdate:modelValue":_[3]||(_[3]=P=>d.unref(n).axisX.titleMode=P)},null,8,["modelValue"])]),d.unref(n).axisX.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",Xve,[d.createVNode(d.unref(rt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisX.customTitle,"onUpdate:modelValue":_[4]||(_[4]=P=>d.unref(n).axisX.customTitle=P)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",Kve,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Scale",options:s,modelValue:d.unref(n).axisX.scale,"onUpdate:modelValue":_[5]||(_[5]=P=>d.unref(n).axisX.scale=P)},null,8,["modelValue"])]),d.createElementVNode("div",Zve,[_[28]||(_[28]=d.createElementVNode("span",null,"Gridlines",-1)),d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:d.unref(n).axisX.gridlines,"onUpdate:modelValue":_[6]||(_[6]=P=>d.unref(n).axisX.gridlines=P)},null,8,["modelValue"])]),d.createElementVNode("div",Jve,[_[29]||(_[29]=d.createElementVNode("span",null,"Ticks",-1)),d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:d.unref(n).axisX.ticks,"onUpdate:modelValue":_[7]||(_[7]=P=>d.unref(n).axisX.ticks=P)},null,8,["modelValue"])]),d.createElementVNode("div",qve,[_[30]||(_[30]=d.createElementVNode("span",null,"Significant lines style",-1)),d.createVNode(U5,{data:{type:"lineType",value:A.value},onClick:_[8]||(_[8]=P=>C.value=!C.value),onRef:_[9]||(_[9]=P=>y.value=P)},null,8,["data"]),C.value?(d.openBlock(),d.createBlock(b6,{key:0,height:v.value,targetRef:y.value,"onPopup:close":_[12]||(_[12]=P=>C.value=!1)},{default:d.withCtx(()=>[d.createElementVNode("div",eme,[d.createVNode(C6,{modelValue:A.value,"onUpdate:modelValue":[_[10]||(_[10]=P=>A.value=P),_[11]||(_[11]=P=>d.unref(n).axisX.significantLinesStyle=P)]},null,8,["modelValue"])])]),_:1},8,["height","targetRef"])):d.createCommentVNode("",!0)])]),_:1}),d.createVNode(Pl,{title:"Y-axis",settings:a,icon:Tf,"icon-open":_f},{default:d.withCtx(()=>[d.createElementVNode("div",tme,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).axisY.titleMode,"onUpdate:modelValue":_[13]||(_[13]=P=>d.unref(n).axisY.titleMode=P)},null,8,["modelValue"])]),d.unref(n).axisY.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",nme,[d.createVNode(d.unref(rt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisY.customTitle,"onUpdate:modelValue":_[14]||(_[14]=P=>d.unref(n).axisY.customTitle=P)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",rme,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Scale",options:s,modelValue:d.unref(n).axisY.scale,"onUpdate:modelValue":_[15]||(_[15]=P=>d.unref(n).axisY.scale=P)},null,8,["modelValue"])]),d.createElementVNode("div",ame,[_[31]||(_[31]=d.createElementVNode("span",null,"Gridlines",-1)),d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:d.unref(n).axisY.gridlines,"onUpdate:modelValue":_[16]||(_[16]=P=>d.unref(n).axisY.gridlines=P)},null,8,["modelValue"])]),d.createElementVNode("div",ime,[_[32]||(_[32]=d.createElementVNode("span",null,"Ticks",-1)),d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:d.unref(n).axisY.ticks,"onUpdate:modelValue":_[17]||(_[17]=P=>d.unref(n).axisY.ticks=P)},null,8,["modelValue"])]),d.createElementVNode("div",ome,[_[33]||(_[33]=d.createElementVNode("span",null,"Significant lines style",-1)),d.createVNode(U5,{data:{type:"lineType",value:p.value},onClick:_[18]||(_[18]=P=>x.value=!x.value),onRef:_[19]||(_[19]=P=>b.value=P)},null,8,["data"]),x.value?(d.openBlock(),d.createBlock(b6,{key:0,height:v.value,targetRef:b.value,"onPopup:close":_[22]||(_[22]=P=>x.value=!1)},{default:d.withCtx(()=>[d.createElementVNode("div",lme,[d.createVNode(C6,{modelValue:p.value,"onUpdate:modelValue":[_[20]||(_[20]=P=>p.value=P),_[21]||(_[21]=P=>d.unref(n).axisY.significantLinesStyle=P)]},null,8,["modelValue"])])]),_:1},8,["height","targetRef"])):d.createCommentVNode("",!0)])]),_:1}),r.value==="scatterplot"?(d.openBlock(),d.createElementBlock("div",sme,[d.createElementVNode("div",ume,[_[34]||(_[34]=d.createElementVNode("span",null,"Frame",-1)),d.createVNode(Df,{options:c,modelValue:d.unref(n).other.frame,"onUpdate:modelValue":_[23]||(_[23]=P=>d.unref(n).other.frame=P)},null,8,["modelValue"])]),d.createElementVNode("div",cme,[d.createVNode(d.unref(rt.Slider),{style:{width:"100%"},label:"Facet column count",min:1,max:6,step:1,breakpoints:!0,mode:"input",modelValue:d.unref(n).other.facetColumns,"onUpdate:modelValue":_[24]||(_[24]=P=>d.unref(n).other.facetColumns=P)},null,8,["modelValue"])]),d.createElementVNode("div",fme,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Facet shared by",options:f,modelValue:d.unref(n).other.facetSharedBy,"onUpdate:modelValue":_[25]||(_[25]=P=>d.unref(n).other.facetSharedBy=P)},null,8,["modelValue"])])])):d.createCommentVNode("",!0)])]))}}),Ame={class:"axes-settings-list"},pme={class:"axes-settings-options-row block"},hme={key:0,class:"axes-settings-input"},vme={class:"axes-settings-options-row"},mme={class:"axes-settings-options-row"},gme={class:"axes-settings-options-row block"},yme={key:0},wme={class:"axes-settings-options-row block"},Cme={class:"axes-settings-options-row"},bme={class:"axes-settings-options-row block"},Eme={key:0},xme={class:"axes-settings-options-row block"},Sme={class:"other"},Bme={class:"axes-settings-options-row"},kme={class:"axes-settings-options-row"},Tme={class:"axes-settings-options-row block"},_me=d.defineComponent({__name:"HeatmapAxesSettingsForm",setup(e){const t=Tr(),n=t.value.reactive.axesSettings,r={height:40,horizontalPadding:12,defaultState:"open"},a=[{value:"left",icon:F5},{value:"center",icon:V5},{value:"right",icon:O5}],i=[{value:0,icon:gB},{value:45,icon:yB},{value:90,icon:wB}],o=[{value:"auto",text:"Auto"},{value:"custom",text:"Custom"},{value:"hidden",text:"Hide"}],s=[{value:"none",icon:z5},{value:"full",icon:Q5}],c=[{text:"X",value:"x"},{text:"Y",value:"y"},{text:"XY",value:"xy"},{text:"None",value:"none"}],f=[{text:"ascending",value:"asc"},{text:"descending",value:"desc"}],A=d.computed(()=>t.value.reactive.layersSettings.heatmapClustered),p=d.computed(()=>c.filter(v=>t.value.reactive.template!=="heatmapClustered"?!0:A.value.dendrogramX&&A.value.dendrogramY?v.value!=="x"&&v.value!=="xy"&&v.value!=="y":A.value.dendrogramX?v.value!=="x"&&v.value!=="xy":A.value.dendrogramY?v.value!=="y"&&v.value!=="xy":!0));return(v,y)=>(d.openBlock(),d.createElementBlock("div",{class:"axes-form",onClick:y[14]||(y[14]=b=>b.stopPropagation())},[y[19]||(y[19]=d.createElementVNode("h3",{class:"axes-title"}," Axes ",-1)),d.createElementVNode("div",Ame,[d.createVNode(Pl,{title:"Title",settings:r,icon:Tf,"icon-open":_f},{default:d.withCtx(()=>[d.createElementVNode("div",pme,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).title.mode,"onUpdate:modelValue":y[0]||(y[0]=b=>d.unref(n).title.mode=b)},null,8,["modelValue"])]),d.unref(n).title.mode==="custom"?(d.openBlock(),d.createElementBlock("div",hme,[d.createVNode(d.unref(rt.PlTextField),{label:"Chart title",placeholder:"Chart title",modelValue:d.unref(n).title.value,"onUpdate:modelValue":y[1]||(y[1]=b=>d.unref(n).title.value=b)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",vme,[y[15]||(y[15]=d.createElementVNode("span",null,"Alignment",-1)),d.createVNode(Df,{options:a,modelValue:d.unref(n).title.position,"onUpdate:modelValue":y[2]||(y[2]=b=>d.unref(n).title.position=b)},null,8,["modelValue"])])]),_:1}),d.createVNode(Pl,{title:"X-axis",settings:r,icon:Tf,"icon-open":_f},{default:d.withCtx(()=>[d.createElementVNode("div",mme,[y[16]||(y[16]=d.createElementVNode("span",null,"Labels rotation",-1)),d.createVNode(Df,{options:i,modelValue:d.unref(n).axisX.axisLabelsAngle,"onUpdate:modelValue":y[3]||(y[3]=b=>d.unref(n).axisX.axisLabelsAngle=b)},null,8,["modelValue"])]),d.createElementVNode("div",gme,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).axisX.titleMode,"onUpdate:modelValue":y[4]||(y[4]=b=>d.unref(n).axisX.titleMode=b)},null,8,["modelValue"])]),d.unref(n).axisX.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",yme,[d.createVNode(d.unref(rt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisX.customTitle,"onUpdate:modelValue":y[5]||(y[5]=b=>d.unref(n).axisX.customTitle=b)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",wme,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Sorting",options:f,modelValue:d.unref(n).axisX.sorting,"onUpdate:modelValue":y[6]||(y[6]=b=>d.unref(n).axisX.sorting=b)},null,8,["modelValue"])])]),_:1}),d.createVNode(Pl,{title:"Y-axis",settings:r,icon:Tf,"icon-open":_f},{default:d.withCtx(()=>[d.createElementVNode("div",Cme,[y[17]||(y[17]=d.createElementVNode("span",null,"Labels rotation",-1)),d.createVNode(Df,{options:i,modelValue:d.unref(n).axisY.axisLabelsAngle,"onUpdate:modelValue":y[7]||(y[7]=b=>d.unref(n).axisY.axisLabelsAngle=b)},null,8,["modelValue"])]),d.createElementVNode("div",bme,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).axisY.titleMode,"onUpdate:modelValue":y[8]||(y[8]=b=>d.unref(n).axisY.titleMode=b)},null,8,["modelValue"])]),d.unref(n).axisY.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",Eme,[d.createVNode(d.unref(rt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisY.customTitle,"onUpdate:modelValue":y[9]||(y[9]=b=>d.unref(n).axisY.customTitle=b)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",xme,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Sorting",options:f,modelValue:d.unref(n).axisY.sorting,"onUpdate:modelValue":y[10]||(y[10]=b=>d.unref(n).axisY.sorting=b)},null,8,["modelValue"])])]),_:1}),d.createElementVNode("div",Sme,[d.createElementVNode("div",Bme,[y[18]||(y[18]=d.createElementVNode("span",null,"Frame",-1)),d.createVNode(Df,{options:s,modelValue:d.unref(n).other.frame,"onUpdate:modelValue":y[11]||(y[11]=b=>d.unref(n).other.frame=b)},null,8,["modelValue"])]),d.createElementVNode("div",kme,[d.createVNode(d.unref(rt.Slider),{style:{width:"100%"},label:"Facet column count",min:1,max:6,step:1,breakpoints:!0,mode:"input",modelValue:d.unref(n).other.facetColumns,"onUpdate:modelValue":y[12]||(y[12]=b=>d.unref(n).other.facetColumns=b)},null,8,["modelValue"])]),d.createElementVNode("div",Tme,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Facet shared by",options:p.value,modelValue:d.unref(n).other.facetSharedBy,"onUpdate:modelValue":y[13]||(y[13]=b=>d.unref(n).other.facetSharedBy=b)},null,8,["options","modelValue"])])])])]))}}),Dme={class:"axes-settings-list"},Pme={style:{padding:"0 24px 8px"}},Mme={class:"axes-settings-options-row block"},Hme={key:0,class:"axes-settings-input"},Ime={class:"axes-settings-options-row"},Rme={class:"axes-settings-options-row block"},Nme={key:0},Lme={class:"axes-settings-options-row block"},$me={class:"axes-settings-options-row table"},Fme={class:"axes-settings-options-row table"},Vme={class:"axes-settings-options-row block"},Ome={class:"axes-settings-options-row table"},Qme={class:"axes-settings-options-row table"},zme={class:"other"},Ume={class:"axes-settings-options-row"},Gme={class:"axes-settings-options-row"},jme={class:"axes-settings-options-row"},Yme={class:"axes-settings-options-row"},Wme={class:"axes-settings-options-row block"},Xme=d.defineComponent({__name:"HistogramAxesSettingsForm",setup(e){const n=Tr().value.reactive.axesSettings,r={height:40,horizontalPadding:12,defaultState:"open"},a=[{value:"left",icon:F5},{value:"center",icon:V5},{value:"right",icon:O5}],i=[{value:"auto",text:"Auto"},{value:"custom",text:"Custom"},{value:"hidden",text:"Hide"}],o=[{value:"linear",text:"Linear"},{value:"log",text:"Log"}],s=[{value:"empty",icon:z5},{value:"left",icon:CB},{value:"bottom",icon:bB},{value:"left-bottom",icon:EB},{value:"full",icon:Q5}],c=[{text:"X",value:"x"},{text:"Y",value:"y"},{text:"XY",value:"xy"},{text:"None",value:"none"}];return(f,A)=>(d.openBlock(),d.createElementBlock("div",{class:"axes-form",onClick:A[17]||(A[17]=p=>p.stopPropagation())},[A[24]||(A[24]=d.createElementVNode("h3",{class:"axes-title"}," Axes ",-1)),d.createElementVNode("div",Dme,[d.createElementVNode("div",Pme,[d.createVNode(d.unref(rt.Slider),{style:{width:"100%"},label:"Bins count",min:3,max:100,step:1,breakpoints:!1,mode:"input",modelValue:d.unref(n).other.binsCount,"onUpdate:modelValue":A[0]||(A[0]=p=>d.unref(n).other.binsCount=p)},null,8,["modelValue"])]),d.createVNode(Pl,{title:"Title",settings:r,icon:Tf,"icon-open":_f},{default:d.withCtx(()=>[d.createElementVNode("div",Mme,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Title",options:i,modelValue:d.unref(n).title.mode,"onUpdate:modelValue":A[1]||(A[1]=p=>d.unref(n).title.mode=p)},null,8,["modelValue"])]),d.unref(n).title.mode==="custom"?(d.openBlock(),d.createElementBlock("div",Hme,[d.createVNode(d.unref(rt.PlTextField),{label:"Chart title",placeholder:"Chart title",modelValue:d.unref(n).title.value,"onUpdate:modelValue":A[2]||(A[2]=p=>d.unref(n).title.value=p)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",Ime,[A[18]||(A[18]=d.createElementVNode("span",null,"Alignment",-1)),d.createVNode(Df,{options:a,modelValue:d.unref(n).title.position,"onUpdate:modelValue":A[3]||(A[3]=p=>d.unref(n).title.position=p)},null,8,["modelValue"])])]),_:1}),d.createVNode(Pl,{title:"X-axis",settings:r,icon:Tf,"icon-open":_f},{default:d.withCtx(()=>[d.createElementVNode("div",Rme,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Title",options:i,modelValue:d.unref(n).axisX.titleMode,"onUpdate:modelValue":A[4]||(A[4]=p=>d.unref(n).axisX.titleMode=p)},null,8,["modelValue"])]),d.unref(n).axisX.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",Nme,[d.createVNode(d.unref(rt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisX.customTitle,"onUpdate:modelValue":A[5]||(A[5]=p=>d.unref(n).axisX.customTitle=p)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",Lme,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Scale",options:o,modelValue:d.unref(n).axisX.scale,"onUpdate:modelValue":A[6]||(A[6]=p=>d.unref(n).axisX.scale=p)},null,8,["modelValue"])]),d.createElementVNode("div",$me,[A[19]||(A[19]=d.createElementVNode("span",null,"Gridlines",-1)),d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:d.unref(n).axisX.gridlines,"onUpdate:modelValue":A[7]||(A[7]=p=>d.unref(n).axisX.gridlines=p)},null,8,["modelValue"])]),d.createElementVNode("div",Fme,[A[20]||(A[20]=d.createElementVNode("span",null,"Ticks",-1)),d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:d.unref(n).axisX.ticks,"onUpdate:modelValue":A[8]||(A[8]=p=>d.unref(n).axisX.ticks=p)},null,8,["modelValue"])])]),_:1}),d.createVNode(Pl,{title:"Y-axis",settings:r,icon:Tf,"icon-open":_f},{default:d.withCtx(()=>[d.createElementVNode("div",Vme,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Scale",options:o,modelValue:d.unref(n).axisY.scale,"onUpdate:modelValue":A[9]||(A[9]=p=>d.unref(n).axisY.scale=p)},null,8,["modelValue"])]),d.createElementVNode("div",Ome,[A[21]||(A[21]=d.createElementVNode("span",null,"Gridlines",-1)),d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:d.unref(n).axisY.gridlines,"onUpdate:modelValue":A[10]||(A[10]=p=>d.unref(n).axisY.gridlines=p)},null,8,["modelValue"])]),d.createElementVNode("div",Qme,[A[22]||(A[22]=d.createElementVNode("span",null,"Ticks",-1)),d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:d.unref(n).axisY.ticks,"onUpdate:modelValue":A[11]||(A[11]=p=>d.unref(n).axisY.ticks=p)},null,8,["modelValue"])])]),_:1}),d.createElementVNode("div",zme,[d.createElementVNode("div",Ume,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Grouping direction",options:[{value:"straight",label:"Straight"},{value:"reverse",label:"Reverse"}],modelValue:d.unref(n).other.groupingDirection,"onUpdate:modelValue":A[12]||(A[12]=p=>d.unref(n).other.groupingDirection=p)},null,8,["modelValue"])]),d.createElementVNode("div",Gme,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Stack mode",options:[{value:"vertical",label:"Vertical"},{value:"horizontal",label:"Horizontal"}],modelValue:d.unref(n).other.groupingStack,"onUpdate:modelValue":A[13]||(A[13]=p=>d.unref(n).other.groupingStack=p)},null,8,["modelValue"])]),d.createElementVNode("div",jme,[A[23]||(A[23]=d.createElementVNode("span",null,"Frame",-1)),d.createVNode(Df,{options:s,modelValue:d.unref(n).other.frame,"onUpdate:modelValue":A[14]||(A[14]=p=>d.unref(n).other.frame=p)},null,8,["modelValue"])]),d.createElementVNode("div",Yme,[d.createVNode(d.unref(rt.Slider),{style:{width:"100%"},label:"Facet column count",min:1,max:6,step:1,breakpoints:!0,mode:"input",modelValue:d.unref(n).other.facetColumns,"onUpdate:modelValue":A[15]||(A[15]=p=>d.unref(n).other.facetColumns=p)},null,8,["modelValue"])]),d.createElementVNode("div",Wme,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Facet shared by",options:c,modelValue:d.unref(n).other.facetSharedBy,"onUpdate:modelValue":A[16]||(A[16]=p=>d.unref(n).other.facetSharedBy=p)},null,8,["modelValue"])])])])]))}}),Kme={class:"axes-settings-list"},Zme={class:"axes-settings-options-row block"},Jme={key:0,class:"axes-settings-input"},qme={class:"axes-settings-options-row"},ege={class:"axes-settings-options-row"},tge={class:"axes-settings-options-row block"},nge={key:0},rge={class:"axes-settings-options-row block"},age={class:"axes-settings-options-row"},ige={class:"axes-settings-options-row block"},oge={key:0},lge={class:"axes-settings-options-row block"},sge={class:"other"},uge={class:"axes-settings-options-row"},cge={class:"axes-settings-options-row"},fge=d.defineComponent({__name:"BubbleAxesSettingsForm",setup(e){const n=Tr().value.reactive.axesSettings,r={height:40,horizontalPadding:12,defaultState:"open"},a=[{value:"left",icon:F5},{value:"center",icon:V5},{value:"right",icon:O5}],i=[{value:0,icon:gB},{value:45,icon:yB},{value:90,icon:wB}],o=[{value:"auto",text:"Auto"},{value:"custom",text:"Custom"},{value:"hidden",text:"Hide"}],s=[{value:"none",icon:z5},{value:"full",icon:Q5}],c=[{text:"ascending",value:"asc"},{text:"descending",value:"desc"}];return(f,A)=>(d.openBlock(),d.createElementBlock("div",{class:"axes-form",onClick:A[13]||(A[13]=p=>p.stopPropagation())},[A[18]||(A[18]=d.createElementVNode("h3",{class:"axes-title"}," Axes ",-1)),d.createElementVNode("div",Kme,[d.createVNode(Pl,{title:"Title",settings:r,icon:Tf,"icon-open":_f},{default:d.withCtx(()=>[d.createElementVNode("div",Zme,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).title.mode,"onUpdate:modelValue":A[0]||(A[0]=p=>d.unref(n).title.mode=p)},null,8,["modelValue"])]),d.unref(n).title.mode==="custom"?(d.openBlock(),d.createElementBlock("div",Jme,[d.createVNode(d.unref(rt.PlTextField),{label:"Chart title",placeholder:"Chart title",modelValue:d.unref(n).title.value,"onUpdate:modelValue":A[1]||(A[1]=p=>d.unref(n).title.value=p)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",qme,[A[14]||(A[14]=d.createElementVNode("span",null,"Alignment",-1)),d.createVNode(Df,{options:a,modelValue:d.unref(n).title.position,"onUpdate:modelValue":A[2]||(A[2]=p=>d.unref(n).title.position=p)},null,8,["modelValue"])])]),_:1}),d.createVNode(Pl,{title:"X-axis",settings:r,icon:Tf,"icon-open":_f},{default:d.withCtx(()=>[d.createElementVNode("div",ege,[A[15]||(A[15]=d.createElementVNode("span",null,"Labels rotation",-1)),d.createVNode(Df,{options:i,modelValue:d.unref(n).axisX.axisLabelsAngle,"onUpdate:modelValue":A[3]||(A[3]=p=>d.unref(n).axisX.axisLabelsAngle=p)},null,8,["modelValue"])]),d.createElementVNode("div",tge,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).axisX.titleMode,"onUpdate:modelValue":A[4]||(A[4]=p=>d.unref(n).axisX.titleMode=p)},null,8,["modelValue"])]),d.unref(n).axisX.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",nge,[d.createVNode(d.unref(rt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisX.customTitle,"onUpdate:modelValue":A[5]||(A[5]=p=>d.unref(n).axisX.customTitle=p)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",rge,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Sorting",options:c,modelValue:d.unref(n).axisX.sorting,"onUpdate:modelValue":A[6]||(A[6]=p=>d.unref(n).axisX.sorting=p)},null,8,["modelValue"])])]),_:1}),d.createVNode(Pl,{title:"Y-axis",settings:r,icon:Tf,"icon-open":_f},{default:d.withCtx(()=>[d.createElementVNode("div",age,[A[16]||(A[16]=d.createElementVNode("span",null,"Labels rotation",-1)),d.createVNode(Df,{options:i,modelValue:d.unref(n).axisY.axisLabelsAngle,"onUpdate:modelValue":A[7]||(A[7]=p=>d.unref(n).axisY.axisLabelsAngle=p)},null,8,["modelValue"])]),d.createElementVNode("div",ige,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).axisY.titleMode,"onUpdate:modelValue":A[8]||(A[8]=p=>d.unref(n).axisY.titleMode=p)},null,8,["modelValue"])]),d.unref(n).axisY.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",oge,[d.createVNode(d.unref(rt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisY.customTitle,"onUpdate:modelValue":A[9]||(A[9]=p=>d.unref(n).axisY.customTitle=p)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",lge,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Sorting",options:c,modelValue:d.unref(n).axisY.sorting,"onUpdate:modelValue":A[10]||(A[10]=p=>d.unref(n).axisY.sorting=p)},null,8,["modelValue"])])]),_:1}),d.createElementVNode("div",sge,[d.createElementVNode("div",uge,[A[17]||(A[17]=d.createElementVNode("span",null,"Frame",-1)),d.createVNode(Df,{options:s,modelValue:d.unref(n).other.frame,"onUpdate:modelValue":A[11]||(A[11]=p=>d.unref(n).other.frame=p)},null,8,["modelValue"])]),d.createElementVNode("div",cge,[d.createVNode(d.unref(rt.Slider),{style:{width:"100%"},label:"Facet column count",min:1,max:6,step:1,breakpoints:!0,mode:"input",modelValue:d.unref(n).other.facetColumns,"onUpdate:modelValue":A[12]||(A[12]=p=>d.unref(n).other.facetColumns=p)},null,8,["modelValue"])])])])]))}}),dge={class:"data-form"},Age=d.defineComponent({__name:"index",setup(e){const t=Tr();return(n,r)=>(d.openBlock(),d.createElementBlock("div",dge,[d.unref(t).reactive.chartType==="discrete"?(d.openBlock(),d.createBlock(zve,{key:0})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="scatterplot"||d.unref(t).reactive.chartType==="scatterplot-umap"?(d.openBlock(),d.createBlock(dme,{key:1})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="heatmap"?(d.openBlock(),d.createBlock(_me,{key:2})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="histogram"?(d.openBlock(),d.createBlock(Xme,{key:3})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="bubble"?(d.openBlock(),d.createBlock(fge,{key:4})):d.createCommentVNode("",!0)]))}});function Uc(e,t,n,r=!1){const a=t.components.primaryGrouping.selectorStates.length>0,i=t.components.secondaryGrouping.selectorStates.length>0;return e===null?i?{type:"secondaryGrouping"}:a&&!r?{type:"primaryGrouping"}:n:e}const pge={class:"aes-mapping-block"},hge={style:{margin:"0 24px"}},vge={class:"section-title"},mge={style:{margin:"24px 0"}},gge={style:{margin:"24px 0"}},yge={style:{margin:"24px 0"}},wge={style:{display:"flex",marginTop:"16px",gap:"8px"}},Cge=d.defineComponent({__name:"AesDataMappingContinuous",props:{dataColumnLabel:{},modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){var b,C;const n=e,r=t,a=d.ref(!1),i=d.ref(n.modelValue.palette);function o(x){i.value=x,a.value=!1,r("update:modelValue",Xm(x))}const s=[{value:"auto",label:"Auto"},{value:"custom",label:"Custom"}],c=d.ref(n.modelValue.range?"custom":"auto"),f=[{value:"linear",label:"Linear"},{value:"log",label:"Log"}],A=d.ref(n.modelValue.log?"log":"linear"),p=d.ref(((b=n.modelValue.range)==null?void 0:b.minValue)??void 0),v=d.ref(((C=n.modelValue.range)==null?void 0:C.maxValue)??void 0),y=d.ref(n.modelValue.midPoint??void 0);return d.watch(()=>c.value,x=>{x==="custom"&&r("update:modelValue",{...n.modelValue,range:{minValue:p.value??null,maxValue:v.value??null}}),x==="auto"&&r("update:modelValue",{...n.modelValue,range:null})}),d.watch(()=>p.value,x=>{r("update:modelValue",{...n.modelValue,range:{...n.modelValue.range,minValue:x}})}),d.watch(()=>v.value,x=>{r("update:modelValue",{...n.modelValue,range:{...n.modelValue.range,maxValue:x}})}),d.watch(()=>y.value,x=>{r("update:modelValue",{...n.modelValue,midPoint:x??null})}),d.watch(()=>A.value,x=>{r("update:modelValue",{...n.modelValue,log:x==="log"})}),(x,k)=>(d.openBlock(),d.createElementBlock("div",pge,[d.createElementVNode("div",hge,[d.createElementVNode("div",vge,[d.createElementVNode("span",null,d.toDisplayString(x.dataColumnLabel),1)]),d.createElementVNode("div",mge,[d.createVNode(Ay,{label:"Color Palette ",title:d.unref(Gi)[i.value].title,palette:i.value,onButtonClick:k[0]||(k[0]=_=>{a.value=!0})},null,8,["title","palette"])]),d.createElementVNode("div",gge,[d.createVNode(d.unref(rt.PlBtnGroup),{options:f,modelValue:A.value,"onUpdate:modelValue":k[1]||(k[1]=_=>A.value=_)},null,8,["modelValue"])]),d.createElementVNode("div",yge,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Gradient range",options:s,modelValue:c.value,"onUpdate:modelValue":k[2]||(k[2]=_=>c.value=_)},null,8,["modelValue"])]),d.createElementVNode("div",wge,[c.value==="custom"?(d.openBlock(),d.createBlock(d.unref(rt.PlNumberField),{key:0,label:"From",updateOnEnterOrClickOutside:!0,useIncrementButtons:!1,modelValue:p.value,"onUpdate:modelValue":k[3]||(k[3]=_=>p.value=_)},null,8,["modelValue"])):d.createCommentVNode("",!0),d.createVNode(d.unref(rt.PlNumberField),{label:"Mid point",updateOnEnterOrClickOutside:!0,useIncrementButtons:!1,style:{flexGrow:1},modelValue:y.value,"onUpdate:modelValue":k[4]||(k[4]=_=>y.value=_)},null,8,["modelValue"]),c.value==="custom"?(d.openBlock(),d.createBlock(d.unref(rt.PlNumberField),{key:1,label:"To",updateOnEnterOrClickOutside:!0,useIncrementButtons:!1,modelValue:v.value,"onUpdate:modelValue":k[5]||(k[5]=_=>v.value=_)},null,8,["modelValue"])):d.createCommentVNode("",!0)]),a.value?(d.openBlock(),d.createBlock(Uh,{key:0,title:"Color Palette","back-title":"Color mapping","onForm:close":k[6]||(k[6]=_=>a.value=!1)},{default:d.withCtx(()=>[d.createVNode(py,{selected:i.value,categorical:!1,onSelect:o},null,8,["selected"])]),_:1})):d.createCommentVNode("",!0)])]))}}),bge={class:"aes-input-row"},ei=d.defineComponent({__name:"AesSelector",props:{label:{},type:{},selected:{},formTitle:{},formBackTitle:{},possibleAesSourceInputs:{},withoutFixed:{type:Boolean},disabled:{type:Boolean}},emits:["aes-update","aes-selector-close"],setup(e,{emit:t}){var ee,le;const n=e,r=Tr(),a=d.computed(()=>r.value.reactive.chartType),i=t,o={discrete:["primaryGrouping","secondaryGrouping"],scatterplot:["grouping"],"scatterplot-umap":["grouping"],dendro:[],heatmap:[],histogram:["grouping"],bubble:[]},s=n.possibleAesSourceInputs??o[a.value],c=d.computed(()=>{const z=r.value.commonHelpersData.usedAesInMapping.value;return console.log(z,"used aes in mappign"),z});function f(z){return typeof z=="string"?z:a.value==="scatterplot"?`grouping_${z.value}`:a.value==="dendro"?`${z.type}_${z.value}`:z.type}const A=d.ref(J3(n.selected)?f(n.selected):"fix"),p={fill:N3[0].color,stroke:N3[0].color,dotShape:D0,lineType:yC,size:""},v=d.computed(()=>r.value.inputGuide.value),y=d.computed(()=>r.value.uniqueValuesData.value),b=new Set(["scatterplot","scatterplot-umap","heatmap"]),C=d.computed(()=>{const z={},U=r.value.reactive.optionsState.components;function G(Y,X){const te=v.value.getSourceInfo(X),he=y.value[X],ae=(he==null?void 0:he.list)??[],ge=(he==null?void 0:he.labels)??{},me=f({type:Y,value:X});if(b.has(a.value)&&te.type==="String"||!b.has(a.value)){const fe=r.value.reactive.dataBindAes[X]??Km(ae);z[me]={type:"dataCategorical",value:me,initialData:fe,inputName:Y,selectedSource:X,selectedSourceInfo:te,selectedSourceValues:ae,labels:fe.order.reduce((be,He)=>(be[He]=ge[He]??String(He),be),{})}}else{const fe=r.value.reactive.dataBindAes[X]??Xm(nv);z[me]={type:"dataContinuous",value:me,initialData:fe,inputName:Y,selectedSource:X,selectedSourceInfo:te,selectedSourceValues:ae}}}return s.forEach(Y=>{var X;(X=U==null?void 0:U[Y])!=null&&X.selectorStates.length&&U[Y].selectorStates.forEach(({selectedSource:te})=>{G(Y,te)})}),n.withoutFixed||(z.fix={type:"fix",value:"fix",initialData:J3(n.selected)?p[n.type]:n.selected}),z}),x=d.computed(()=>C.value[A.value]??null);function k(z,U){var G,Y,X,te;return z.type==="fix"?"Fixed":U===z.value?`${(G=z.selectedSourceInfo)==null?void 0:G.label}`:a.value==="discrete"?`${z.value==="primaryGrouping"?"Primary":"Secondary"} grouping: ${(Y=z.selectedSourceInfo)==null?void 0:Y.label}`:a.value==="scatterplot"||a.value==="dendro"?`Grouping: ${(X=z.selectedSourceInfo)==null?void 0:X.label}`:((te=z.selectedSourceInfo)==null?void 0:te.label)??""}const _=d.computed(()=>{const z=[],U=r.value.reactive.optionsState.components;function G(Y,X){const te=f({type:Y==="shape"?"grouping":Y,value:X});C.value[te]&&z.push({text:k(C.value[te],A.value),value:te})}if(s.forEach(Y=>{var X;(X=U==null?void 0:U[Y])!=null&&X.selectorStates.length&&U[Y].selectorStates.forEach(({selectedSource:te})=>{G(Y,te)})}),!C.value[A.value]){let Y="Not consistent (grouping)";a.value==="discrete"&&(Y=`${A.value==="primaryGrouping"?"Primary":"Secondary"} grouping (not selected)`),z.push({text:Y,value:A.value})}return n.withoutFixed||z.push({text:"Fixed",value:"fix"}),z}),P=d.ref(!1),N=d.ref(C.value.fix?C.value.fix.initialData:null),I=d.ref(((ee=x.value)==null?void 0:ee.type)==="dataCategorical"?x.value.initialData:null),F=d.ref(((le=x.value)==null?void 0:le.type)==="dataContinuous"?x.value.initialData:null);d.watch(()=>A.value,z=>{const U=C.value[z];U.type==="fix"?i("aes-update",N.value,U):U.type==="dataCategorical"?(I.value=U.initialData,i("aes-update",U.initialData,U)):U.type==="dataContinuous"&&(F.value=U.initialData,i("aes-update",U.initialData,U))});const Q=d.ref(),Z=d.computed(()=>{if(n.type==="lineType")return $3.length*32+16*2;if(n.type==="dotShape")return Math.ceil(G7.length/6)*36+20*2;if(n.type==="fill"||n.type==="stroke")return Math.ceil(N3.length/6)*36+20*2});return(z,U)=>{var G,Y;return d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createElementVNode("div",bge,[d.createElementVNode("div",{class:"aes-input-select",onClick:U[1]||(U[1]=d.withModifiers(()=>{},["stop"]))},[d.createVNode(d.unref(rt.PlDropdown),{disabled:z.disabled||_.value.length<2,label:z.label,options:_.value,modelValue:A.value,"onUpdate:modelValue":U[0]||(U[0]=X=>A.value=X)},null,8,["disabled","label","options","modelValue"])]),d.createVNode(U5,{data:{type:A.value==="fix"?z.type:"data",value:A.value==="fix"?z.type==="size"?Number(z.selected):z.selected:null},onClick:U[2]||(U[2]=X=>P.value=!P.value),onRef:U[3]||(U[3]=X=>Q.value=X)},null,8,["data"]),A.value==="fix"&&P.value&&N.value?(d.openBlock(),d.createBlock(b6,{key:0,height:Z.value,targetRef:Q.value,"onPopup:close":U[10]||(U[10]=X=>P.value=!1)},{default:d.withCtx(()=>[d.createElementVNode("div",{class:d.normalizeClass(["fixed-aes-list",{"fixed-aes-list__rows":z.type==="lineType"}])},[z.type==="fill"||z.type==="stroke"?(d.openBlock(),d.createBlock(k$,{key:0,"color-using":z.type,modelValue:N.value,"onUpdate:modelValue":[U[4]||(U[4]=X=>N.value=X),U[5]||(U[5]=X=>z.$emit("aes-update",X,C.value.fix))]},null,8,["color-using","modelValue"])):d.createCommentVNode("",!0),z.type==="dotShape"?(d.openBlock(),d.createBlock(T$,{key:1,modelValue:N.value,"onUpdate:modelValue":[U[6]||(U[6]=X=>N.value=X),U[7]||(U[7]=X=>z.$emit("aes-update",X,C.value.fix))]},null,8,["modelValue"])):d.createCommentVNode("",!0),z.type==="lineType"?(d.openBlock(),d.createBlock(C6,{key:2,modelValue:N.value,"onUpdate:modelValue":[U[8]||(U[8]=X=>N.value=X),U[9]||(U[9]=X=>z.$emit("aes-update",X,C.value.fix))]},null,8,["modelValue"])):d.createCommentVNode("",!0)],2)]),_:1},8,["height","targetRef"])):d.createCommentVNode("",!0)]),(((G=x.value)==null?void 0:G.type)==="dataCategorical"&&I.value||((Y=x.value)==null?void 0:Y.type)==="dataContinuous"&&F.value)&&P.value?(d.openBlock(),d.createBlock(Uh,{key:0,title:z.formTitle,"back-title":z.formBackTitle,"onForm:close":U[15]||(U[15]=X=>P.value=!1)},{default:d.withCtx(()=>{var X,te,he,ae;return[((X=x.value)==null?void 0:X.type)==="dataCategorical"&&I.value?(d.openBlock(),d.createBlock(SB,{key:0,"column-value-labels":x.value.labels,"data-column-label":((te=x.value.selectedSourceInfo)==null?void 0:te.label)??"","used-aes-in-mapping":c.value[x.value.selectedSource],"allow-reordering":a.value==="discrete"||a.value==="histogram",modelValue:I.value,"onUpdate:modelValue":[U[11]||(U[11]=ge=>I.value=ge),U[12]||(U[12]=ge=>z.$emit("aes-update",ge,x.value))]},null,8,["column-value-labels","data-column-label","used-aes-in-mapping","allow-reordering","modelValue"])):d.createCommentVNode("",!0),((he=x.value)==null?void 0:he.type)==="dataContinuous"&&F.value?(d.openBlock(),d.createBlock(Cge,{key:1,"data-column-label":((ae=x.value.selectedSourceInfo)==null?void 0:ae.label)??"",modelValue:F.value,"onUpdate:modelValue":[U[13]||(U[13]=ge=>F.value=ge),U[14]||(U[14]=ge=>z.$emit("aes-update",ge,x.value))]},null,8,["data-column-label","modelValue"])):d.createCommentVNode("",!0)]}),_:1},8,["title","back-title"])):d.createCommentVNode("",!0)],64)}}}),Ege={class:"checkbox-item"},og="box",xge=d.defineComponent({__name:"Boxplot",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.layersSettings[og]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>Uc(n.value.fillColor,r.value,L3)),i=d.computed(()=>Uc(n.value.lineColor,r.value,gi)),o=d.computed(()=>n.value.dotShape),s=d.computed(()=>n.value.lineType);function c(v,y,b){y.type==="dataCategorical"?t.value.reactive.layersSettings[og][b]={type:y.inputName}:t.value.reactive.layersSettings[og][b]=v,y.type==="dataCategorical"&&typeof v!="string"&&(t.value.reactive.dataBindAes[y.selectedSource]=v)}function f(v,y,b){y.type==="dataCategorical"?t.value.reactive.layersSettings[og][b]={type:y.inputName}:t.value.reactive.layersSettings[og][b]=v,y.type==="dataCategorical"&&typeof v=="object"&&(t.value.reactive.dataBindAes[y.selectedSource]=v)}function A(v,y,b){y.type==="dataCategorical"?t.value.reactive.layersSettings[og][b]={type:y.inputName}:t.value.reactive.layersSettings[og][b]=v,y.type==="dataCategorical"&&typeof v=="object"&&(t.value.reactive.dataBindAes[y.selectedSource]=v)}const p=d.computed({get:()=>n.value.opacity*100,set:v=>{n.value.opacity=v/100}});return(v,y)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(ei,{label:"Fill color","form-title":"Fill Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,onAesUpdate:y[0]||(y[0]=(b,C)=>c(b,C,"fillColor"))},null,8,["selected"]),d.createVNode(ei,{label:"Stroke color","form-title":"Stroke Color Settings","form-back-title":"Layers",type:"stroke",selected:i.value,onAesUpdate:y[1]||(y[1]=(b,C)=>c(b,C,"lineColor"))},null,8,["selected"]),d.createVNode(ei,{label:"Line Type","form-title":"Line Type Settings","form-back-title":"Layers",type:"lineType","possible-aes-source-inputs":[],selected:s.value,onAesUpdate:y[2]||(y[2]=(b,C)=>A(b,C,"lineType"))},null,8,["selected"]),d.createVNode(d.unref(rt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:p.value,"onUpdate:modelValue":y[3]||(y[3]=b=>p.value=b)},null,8,["modelValue"]),d.createElementVNode("div",Ege,[d.createVNode(d.unref(rt.PlCheckbox),{modelValue:n.value.showOutliers,"onUpdate:modelValue":y[4]||(y[4]=b=>n.value.showOutliers=b)},null,8,["modelValue"]),y[6]||(y[6]=d.createElementVNode("span",null,"Show outliers",-1))]),n.value.showOutliers?(d.openBlock(),d.createBlock(ei,{key:0,label:"Outlier shape","form-title":"Outlier Shape Settings","form-back-title":"Layers",type:"dotShape","possible-aes-source-inputs":[],selected:o.value,onAesUpdate:y[5]||(y[5]=(b,C)=>f(b,C,"dotShape"))},null,8,["selected"])):d.createCommentVNode("",!0)],64))}}),Sge={class:"checkbox-item"},BB="binnedDots",Bge=d.defineComponent({__name:"BinnedDots",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.layersSettings[BB]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>Uc(n.value.fillColor,r.value,L3)),i=d.computed(()=>Uc(n.value.lineColor,r.value,gi));function o(c,f,A){f.type==="dataCategorical"?t.value.reactive.layersSettings[BB][A]={type:f.inputName}:t.value.reactive.layersSettings[BB][A]=c,f.type==="dataCategorical"&&typeof c!="string"&&(t.value.reactive.dataBindAes[f.selectedSource]=c)}const s=d.computed({get:()=>n.value.opacity*100,set:c=>{n.value.opacity=c/100}});return(c,f)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(ei,{label:"Fill color","form-title":"Fill Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,onAesUpdate:f[0]||(f[0]=(A,p)=>o(A,p,"fillColor"))},null,8,["selected"]),d.createVNode(ei,{label:"Stroke color","form-title":"Stroke Color Settings","form-back-title":"Layers",type:"stroke",selected:i.value,onAesUpdate:f[1]||(f[1]=(A,p)=>o(A,p,"lineColor"))},null,8,["selected"]),d.createVNode(d.unref(rt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:s.value,"onUpdate:modelValue":f[2]||(f[2]=A=>s.value=A)},null,8,["modelValue"]),d.createElementVNode("div",Sge,[d.createVNode(d.unref(rt.PlCheckbox),{modelValue:n.value.showOutliers,"onUpdate:modelValue":f[3]||(f[3]=A=>n.value.showOutliers=A)},null,8,["modelValue"]),f[4]||(f[4]=d.createElementVNode("span",null,"Show outliers",-1))])],64))}}),kge={class:"checkbox-item"},G5="jitteredDots",Tge=d.defineComponent({__name:"JitteredDots",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.layersSettings[G5]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>Uc(n.value.dotFill,r.value,gi));function i(c,f,A){f.type==="dataCategorical"?t.value.reactive.layersSettings[G5][A]={type:f.inputName}:t.value.reactive.layersSettings[G5][A]=c,f.type==="dataCategorical"&&typeof c!="string"&&(t.value.reactive.dataBindAes[f.selectedSource]=c)}function o(c,f,A){f.type==="dataCategorical"?t.value.reactive.layersSettings[G5][A]={type:f.inputName}:t.value.reactive.layersSettings[G5][A]=c,f.type==="dataCategorical"&&typeof c=="object"&&(t.value.reactive.dataBindAes[f.selectedSource]=c)}const s=d.computed({get:()=>n.value.opacity*100,set:c=>{n.value.opacity=c/100}});return(c,f)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(ei,{label:"Fill color","form-title":"Fill Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,onAesUpdate:f[0]||(f[0]=(A,p)=>i(A,p,"dotFill"))},null,8,["selected"]),d.createVNode(ei,{label:"Dot shape","form-title":"Dot Shape Settings","form-back-title":"Layers",type:"dotShape",selected:n.value.dotShape,onAesUpdate:f[1]||(f[1]=(A,p)=>o(A,p,"dotShape"))},null,8,["selected"]),d.createVNode(d.unref(rt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:s.value,"onUpdate:modelValue":f[2]||(f[2]=A=>s.value=A)},null,8,["modelValue"]),d.createElementVNode("div",kge,[d.createVNode(d.unref(rt.PlCheckbox),{modelValue:n.value.showOutliers,"onUpdate:modelValue":f[3]||(f[3]=A=>n.value.showOutliers=A)},null,8,["modelValue"]),f[4]||(f[4]=d.createElementVNode("span",null,"Show outliers",-1))])],64))}}),_ge={class:"checkbox-item"},Dge={class:"checkbox-item"},Pge={key:0},hy="violin",Mge=d.defineComponent({__name:"Violin",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.layersSettings[hy]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>Uc(n.value.fillColor,r.value,L3)),i=d.computed(()=>Uc(n.value.lineColor,r.value,gi)),o=d.computed(()=>n.value.lineType),s=d.computed(()=>n.value.medianLineStyle),c=d.computed(()=>n.value.quartilesLineStyle);function f(v,y,b){y.type==="dataCategorical"?t.value.reactive.layersSettings[hy][b]={type:y.inputName}:t.value.reactive.layersSettings[hy][b]=v,y.type==="dataCategorical"&&typeof v!="string"&&(t.value.reactive.dataBindAes[y.selectedSource]=v)}function A(v,y,b){t.value.reactive.layersSettings[hy][b]=typeof v=="object"?{type:y.value}:v,y.type==="dataCategorical"&&typeof v=="object"&&(t.value.reactive.dataBindAes[y.selectedSource]=v)}const p=d.computed({get:()=>n.value.opacity*100,set:v=>{n.value.opacity=v/100}});return(v,y)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(ei,{label:"Fill color","form-title":"Fill Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,onAesUpdate:y[0]||(y[0]=(b,C)=>f(b,C,"fillColor"))},null,8,["selected"]),d.createVNode(ei,{label:"Stroke color","form-title":"Stroke Color Settings","form-back-title":"Layers",type:"stroke",selected:i.value,onAesUpdate:y[1]||(y[1]=(b,C)=>f(b,C,"lineColor"))},null,8,["selected"]),d.createVNode(ei,{label:"Line Type","form-title":"Line Type Settings","form-back-title":"Layers",type:"lineType","possible-aes-source-inputs":[],selected:o.value,onAesUpdate:y[2]||(y[2]=(b,C)=>A(b,C,"lineType"))},null,8,["selected"]),d.createElementVNode("div",_ge,[d.createVNode(d.unref(rt.PlCheckbox),{modelValue:n.value.trim,"onUpdate:modelValue":y[3]||(y[3]=b=>n.value.trim=b)},null,8,["modelValue"]),y[8]||(y[8]=d.createElementVNode("span",null,"Trim",-1))]),d.createElementVNode("div",Dge,[d.createVNode(d.unref(rt.PlCheckbox),{modelValue:n.value.showQuartiles,"onUpdate:modelValue":y[4]||(y[4]=b=>n.value.showQuartiles=b)},null,8,["modelValue"]),y[9]||(y[9]=d.createElementVNode("span",null,"Show median and quartiles",-1))]),n.value.showQuartiles?(d.openBlock(),d.createElementBlock("div",Pge,[d.createVNode(ei,{label:"Madian Line Type","form-title":"Line Type Settings","form-back-title":"Layers",type:"lineType","possible-aes-source-inputs":[],selected:s.value,onAesUpdate:y[5]||(y[5]=b=>d.unref(t).reactive.layersSettings[hy].medianLineStyle=b)},null,8,["selected"]),d.createVNode(ei,{label:"Quartiles Line Type","form-title":"Line Type Settings","form-back-title":"Layers",type:"lineType","possible-aes-source-inputs":[],selected:c.value,onAesUpdate:y[6]||(y[6]=b=>d.unref(t).reactive.layersSettings[hy].quartilesLineStyle=b)},null,8,["selected"])])):d.createCommentVNode("",!0),d.createVNode(d.unref(rt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:p.value,"onUpdate:modelValue":y[7]||(y[7]=b=>p.value=b)},null,8,["modelValue"])],64))}}),kB="bar",Hge=d.defineComponent({__name:"Bar",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.layersSettings[kB]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>Uc(n.value.fillColor,r.value,L3)),i=d.computed(()=>Uc(n.value.lineColor,r.value,gi));function o(f,A,p){A.type==="dataCategorical"?t.value.reactive.layersSettings[kB][p]={type:A.inputName}:t.value.reactive.layersSettings[kB][p]=f,A.type==="dataCategorical"&&typeof f!="string"&&(t.value.reactive.dataBindAes[A.selectedSource]=f)}const s=[{text:"Min",value:"min"},{text:"Max",value:"max"},{text:"Mean",value:"mean"},{text:"Median",value:"median"}],c=d.computed({get:()=>n.value.opacity*100,set:f=>{n.value.opacity=f/100}});return(f,A)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(ei,{label:"Fill color","form-title":"Fill Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,onAesUpdate:A[0]||(A[0]=(p,v)=>o(p,v,"fillColor"))},null,8,["selected"]),d.createVNode(ei,{label:"Stroke color","form-title":"Stroke Color Settings","form-back-title":"Layers",type:"stroke",selected:i.value,onAesUpdate:A[1]||(A[1]=(p,v)=>o(p,v,"lineColor"))},null,8,["selected"]),d.createElementVNode("div",{class:"input-item",onClick:A[3]||(A[3]=d.withModifiers(()=>{},["stop"]))},[d.createVNode(d.unref(rt.PlDropdown),{label:"Height",options:s,modelValue:n.value.height,"onUpdate:modelValue":A[2]||(A[2]=p=>n.value.height=p)},null,8,["modelValue"])]),d.createVNode(d.unref(rt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:c.value,"onUpdate:modelValue":A[4]||(A[4]=p=>c.value=p)},null,8,["modelValue"])],64))}}),Ige={class:"checkbox-item"},TB="stackedBar",Rge=d.defineComponent({__name:"StackedBar",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.layersSettings[TB]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>Uc(n.value.fillColor,r.value,L3)),i=d.computed(()=>Uc(n.value.lineColor,r.value,gi));function o(c,f,A){f.type==="dataCategorical"?t.value.reactive.layersSettings[TB][A]={type:f.inputName}:t.value.reactive.layersSettings[TB][A]=c,f.type==="dataCategorical"&&typeof c!="string"&&(t.value.reactive.dataBindAes[f.selectedSource]=c)}const s=d.computed({get:()=>n.value.opacity*100,set:c=>{n.value.opacity=c/100}});return(c,f)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(ei,{label:"Fill color","form-title":"Fill Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,onAesUpdate:f[0]||(f[0]=(A,p)=>o(A,p,"fillColor"))},null,8,["selected"]),d.createVNode(ei,{label:"Stroke color","form-title":"Stroke Color Settings","form-back-title":"Layers",type:"stroke",selected:i.value,onAesUpdate:f[1]||(f[1]=(A,p)=>o(A,p,"lineColor"))},null,8,["selected"]),d.createVNode(d.unref(rt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:s.value,"onUpdate:modelValue":f[2]||(f[2]=A=>s.value=A)},null,8,["modelValue"]),d.createElementVNode("div",Ige,[d.createVNode(d.unref(rt.PlCheckbox),{modelValue:n.value.normalize,"onUpdate:modelValue":f[3]||(f[3]=A=>n.value.normalize=A)},null,8,["modelValue"]),f[4]||(f[4]=d.createElementVNode("span",null,"Normalize",-1))])],64))}}),lg="line",Nge=d.defineComponent({__name:"Line",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.layersSettings[lg]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>Uc(n.value.lineColor,r.value,gi,!0)),i=d.computed(()=>Uc(n.value.dotFill,r.value,gi,!0)),o=d.computed(()=>n.value.lineType);function s(v,y,b){y.type==="dataCategorical"?t.value.reactive.layersSettings[lg][b]={type:y.inputName}:t.value.reactive.layersSettings[lg][b]=v,y.type==="dataCategorical"&&typeof v!="string"&&(t.value.reactive.dataBindAes[y.selectedSource]=v)}function c(v,y,b){y.type==="dataCategorical"?t.value.reactive.layersSettings[lg][b]={type:y.inputName}:t.value.reactive.layersSettings[lg][b]=v,y.type==="dataCategorical"&&typeof v=="object"&&(t.value.reactive.dataBindAes[y.selectedSource]=v)}function f(v,y,b){y.type==="dataCategorical"?t.value.reactive.layersSettings[lg][b]={type:y.inputName}:t.value.reactive.layersSettings[lg][b]=v,y.type==="dataCategorical"&&typeof v=="object"&&(t.value.reactive.dataBindAes[y.selectedSource]=v)}const A=[{text:"Mean",value:"mean"},{text:"Median",value:"median"}],p=d.computed({get:()=>n.value.opacity*100,set:v=>{n.value.opacity=v/100}});return(v,y)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(ei,{label:"Stroke color","form-title":"Stroke Color Settings","form-back-title":"Layers",type:"stroke",selected:a.value,"possible-aes-source-inputs":["secondaryGrouping"],onAesUpdate:y[0]||(y[0]=(b,C)=>s(b,C,"lineColor"))},null,8,["selected"]),d.createVNode(ei,{label:"Line Type","form-title":"Line Type Settings","form-back-title":"Layers",type:"lineType","possible-aes-source-inputs":["secondaryGrouping"],selected:o.value,onAesUpdate:y[1]||(y[1]=(b,C)=>f(b,C,"lineType"))},null,8,["selected"]),d.createVNode(ei,{label:"Dot fill","form-title":"Dot Fill Settings","form-back-title":"Layers",type:"fill",selected:i.value,"possible-aes-source-inputs":["secondaryGrouping"],onAesUpdate:y[2]||(y[2]=(b,C)=>s(b,C,"dotFill"))},null,8,["selected"]),d.createVNode(ei,{label:"Dot shape","form-title":"Dot Shape Settings","form-back-title":"Layers",type:"dotShape",selected:n.value.dotShape,"possible-aes-source-inputs":["secondaryGrouping"],onAesUpdate:y[3]||(y[3]=(b,C)=>c(b,C,"dotShape"))},null,8,["selected"]),d.createElementVNode("div",{class:"input-item",onClick:y[5]||(y[5]=d.withModifiers(()=>{},["stop"]))},[d.createVNode(d.unref(rt.PlDropdown),{label:"Point value",options:A,modelValue:n.value.pointsValues,"onUpdate:modelValue":y[4]||(y[4]=b=>n.value.pointsValues=b)},null,8,["modelValue"])]),d.createVNode(d.unref(rt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:p.value,"onUpdate:modelValue":y[6]||(y[6]=b=>p.value=b)},null,8,["modelValue"])],64))}}),j5="errorbar",Lge=d.defineComponent({__name:"Errorbar",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.layersSettings[j5]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>Uc(n.value.lineColor,r.value,gi,!0)),i=d.computed(()=>Uc(n.value.dotFill,r.value,gi,!0));function o(p,v,y){v.type==="dataCategorical"?t.value.reactive.layersSettings[j5][y]={type:v.inputName}:t.value.reactive.layersSettings[j5][y]=p,v.type==="dataCategorical"&&typeof p!="string"&&(t.value.reactive.dataBindAes[v.selectedSource]=p)}function s(p,v,y){v.type==="dataCategorical"?t.value.reactive.layersSettings[j5][y]={type:v.inputName}:t.value.reactive.layersSettings[j5][y]=p,v.type==="dataCategorical"&&typeof p=="object"&&(t.value.reactive.dataBindAes[v.selectedSource]=p)}const c=[{text:"Standard deviation",value:"sd"},{text:"Standard error",value:"se"},{text:"Confident interval",value:"ci"}],f=[{text:"Mean",value:"mean"},{text:"Median",value:"median"}],A=d.computed({get:()=>n.value.opacity*100,set:p=>{n.value.opacity=p/100}});return(p,v)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(ei,{label:"Stroke color","form-title":"Stroke Color Settings","form-back-title":"Layers",type:"stroke",selected:a.value,"possible-aes-source-inputs":["secondaryGrouping"],onAesUpdate:v[0]||(v[0]=(y,b)=>o(y,b,"lineColor"))},null,8,["selected"]),d.createVNode(ei,{label:"Dot fill","form-title":"Dot Fill Settings","form-back-title":"Layers",type:"fill",selected:i.value,"possible-aes-source-inputs":["secondaryGrouping"],onAesUpdate:v[1]||(v[1]=(y,b)=>o(y,b,"dotFill"))},null,8,["selected"]),d.createVNode(ei,{label:"Dot shape","form-title":"Dot Shape Settings","form-back-title":"Layers",type:"dotShape",selected:n.value.dotShape,"possible-aes-source-inputs":["secondaryGrouping"],onAesUpdate:v[2]||(v[2]=(y,b)=>s(y,b,"dotShape"))},null,8,["selected"]),d.createElementVNode("div",{class:"input-item",onClick:v[4]||(v[4]=d.withModifiers(()=>{},["stop"]))},[d.createVNode(d.unref(rt.PlDropdown),{label:"Point value",options:f,modelValue:n.value.pointsValues,"onUpdate:modelValue":v[3]||(v[3]=y=>n.value.pointsValues=y)},null,8,["modelValue"])]),d.createElementVNode("div",{class:"input-item",onClick:v[6]||(v[6]=d.withModifiers(()=>{},["stop"]))},[d.createVNode(d.unref(rt.PlDropdown),{label:"Interval",options:c,modelValue:n.value.interval,"onUpdate:modelValue":v[5]||(v[5]=y=>n.value.interval=y)},null,8,["modelValue"])]),d.createVNode(d.unref(rt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:A.value,"onUpdate:modelValue":v[7]||(v[7]=y=>A.value=y)},null,8,["modelValue"])],64))}}),Y5="sina",$ge=d.defineComponent({__name:"Sina",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.layersSettings[Y5]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>Uc(n.value.dotFill,r.value,gi));function i(c,f,A){f.type==="dataCategorical"?t.value.reactive.layersSettings[Y5][A]={type:f.inputName}:t.value.reactive.layersSettings[Y5][A]=c,f.type==="dataCategorical"&&typeof c!="string"&&(t.value.reactive.dataBindAes[f.selectedSource]=c)}function o(c,f,A){f.type==="dataCategorical"?t.value.reactive.layersSettings[Y5][A]={type:f.inputName}:t.value.reactive.layersSettings[Y5][A]=c,f.type==="dataCategorical"&&typeof c=="object"&&(t.value.reactive.dataBindAes[f.selectedSource]=c)}const s=d.computed({get:()=>n.value.opacity*100,set:c=>{n.value.opacity=c/100}});return(c,f)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(ei,{label:"Fill color","form-title":"Fill Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,onAesUpdate:f[0]||(f[0]=(A,p)=>i(A,p,"dotFill"))},null,8,["selected"]),d.createVNode(ei,{label:"Dot shape","form-title":"Dot Shape Settings","form-back-title":"Layers",type:"dotShape",selected:n.value.dotShape,onAesUpdate:f[1]||(f[1]=(A,p)=>o(A,p,"dotShape"))},null,8,["selected"]),d.createVNode(d.unref(rt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:s.value,"onUpdate:modelValue":f[2]||(f[2]=A=>s.value=A)},null,8,["modelValue"])],64))}}),Fge={class:"checkbox-item"},Vge="logo",Oge=d.defineComponent({__name:"Logo",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.layersSettings[Vge]),r=d.computed({get:()=>n.value.opacity*100,set:a=>{n.value.opacity=a/100}});return(a,i)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(d.unref(rt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=o=>r.value=o)},null,8,["modelValue"]),d.createElementVNode("div",Fge,[d.createVNode(d.unref(rt.PlCheckbox),{modelValue:n.value.normalize,"onUpdate:modelValue":i[1]||(i[1]=o=>n.value.normalize=o)},null,8,["modelValue"]),i[2]||(i[2]=d.createElementVNode("span",null,"Normalize",-1))])],64))}}),Qge={class:"button-group-item"},zge={class:"button-group-item"},Uge={class:"button-group-item",style:{display:"flex",alignItems:"end"}},Gge=d.defineComponent({__name:"Heatmap",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.layersSettings.heatmap),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>t.value.inputGuide.value),i=d.computed(()=>{var C;return(C=r.value.components.value.selectorStates[0])==null?void 0:C.selectedSource}),o=d.computed(()=>{var C;return i.value?(C=t.value.reactive.dataBindAes[i.value])==null?void 0:C.palette:void 0}),s=d.ref(!1),c=d.ref(o.value??nv);function f(C){c.value=C,s.value=!1,i.value&&(t.value.reactive.dataBindAes[i.value]=Xm(C))}const A=[{label:"None",value:null},{label:"Columns",value:"column"},{label:"Rows",value:"row"}],p=[{label:"z-score",value:"standardScaling"},{label:"Min-max",value:"meanNormalization"}],v=[{label:"empty",value:null},{label:"Special value",value:"custom"}],y=d.ref(n.value.NAValueAs===null?null:"custom"),b=d.ref(n.value.NAValueAs??0);return(C,x)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(Ay,{label:"Color Palette ",title:d.unref(Gi)[c.value].title,palette:c.value,onButtonClick:x[0]||(x[0]=k=>{s.value=!0})},null,8,["title","palette"]),s.value?(d.openBlock(),d.createBlock(Uh,{key:0,title:"Color Palette","back-title":"Color mapping","onForm:close":x[1]||(x[1]=k=>s.value=!1)},{default:d.withCtx(()=>[d.createVNode(py,{selected:c.value,categorical:i.value?a.value.getSourceInfo(i.value).type==="String":!1,onSelect:f},null,8,["selected","categorical"])]),_:1})):d.createCommentVNode("",!0),d.createElementVNode("div",Qge,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Normalize by",options:A,compact:!0,modelValue:n.value.normalizationDirection,"onUpdate:modelValue":x[2]||(x[2]=k=>n.value.normalizationDirection=k)},null,8,["modelValue"])]),d.createElementVNode("div",zge,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Normalization method",options:p,compact:!0,modelValue:n.value.normalizationMethod,"onUpdate:modelValue":x[3]||(x[3]=k=>n.value.normalizationMethod=k)},null,8,["modelValue"])]),d.createElementVNode("div",Uge,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Treat NA value as:",options:v,compact:!0,modelValue:y.value,"onUpdate:modelValue":[x[4]||(x[4]=k=>y.value=k),x[5]||(x[5]=k=>{k==="custom"?n.value.NAValueAs=b.value:n.value.NAValueAs=k})]},null,8,["modelValue"]),d.createVNode(d.unref(rt.PlNumberField),{style:{height:"33px",marginLeft:"16px",width:"75px"},disabled:y.value!=="custom",label:"NA value",useIncrementButtons:!1,modelValue:b.value,"onUpdate:modelValue":[x[6]||(x[6]=k=>b.value=k),x[7]||(x[7]=k=>{k!==void 0&&(n.value.NAValueAs=k)})]},null,8,["disabled","modelValue"])])],64))}}),jge={class:"checkbox-item"},Yge={class:"checkbox-item"},W5="dendro",Wge=d.defineComponent({__name:"Dendro",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.layersSettings[W5]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>n.value.dotFill),i=d.computed(()=>n.value.dotShape),o=d.computed(()=>n.value.lineColor);function s(y,b,C){typeof y=="string"?t.value.reactive.layersSettings[W5][C]=y:b.type==="dataCategorical"&&(t.value.reactive.layersSettings[W5][C]={type:b.inputName,value:b.selectedSource}),b.type==="dataCategorical"&&typeof y!="string"&&(t.value.reactive.dataBindAes[b.selectedSource]=y)}function c(y,b,C){typeof y=="string"?t.value.reactive.layersSettings[W5][C]=y:b.type==="dataCategorical"&&(t.value.reactive.layersSettings[W5][C]={type:b.inputName,value:b.selectedSource}),b.type==="dataCategorical"&&typeof y!="string"&&(t.value.reactive.dataBindAes[b.selectedSource]=y)}const f=d.ref(n.value.leavesMode==="alignLeavesToLine"),A=d.computed({get(){return n.value.showLegend??!0},set(y){n.value.showLegend=y}}),p=d.computed({get(){return LS(n.value.dotSize)?[n.value.dotSize.min,n.value.dotSize.max]:[3,10]},set([y,b]){n.value.dotSize={min:y,max:b}}}),v=d.computed({get(){return LS(n.value.dotSize)?3:n.value.dotSize},set(y){n.value.dotSize=y}});return(y,b)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(ei,{label:"Node color","form-title":"Node Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,"possible-aes-source-inputs":["nodeColor"],"without-fixed":r.value.components.nodeColor.selectorStates.length>0,onAesUpdate:b[0]||(b[0]=(C,x)=>s(C,x,"dotFill"))},null,8,["selected","without-fixed"]),d.createVNode(ei,{label:"Node shape","form-title":"Node Shape Settings","form-back-title":"Layers",type:"dotShape",selected:i.value,"possible-aes-source-inputs":["nodeShape"],"without-fixed":r.value.components.nodeShape.selectorStates.length>0,onAesUpdate:b[1]||(b[1]=(C,x)=>c(C,x,"dotShape"))},null,8,["selected","without-fixed"]),d.createVNode(ei,{label:"Line color","form-title":"Line Color Settings","form-back-title":"Layers",type:"fill",selected:o.value,"possible-aes-source-inputs":["lineColor"],"without-fixed":r.value.components.lineColor.selectorStates.length>0,onAesUpdate:b[2]||(b[2]=(C,x)=>s(C,x,"lineColor"))},null,8,["selected","without-fixed"]),d.createElementVNode("div",null,[r.value.components.nodeSize.selectorStates.length>0?(d.openBlock(),d.createBlock(d.unref(rt.SliderRange),{key:0,min:3,max:10,breakpoints:!0,label:"Node size range",modelValue:p.value,"onUpdate:modelValue":b[3]||(b[3]=C=>p.value=C)},null,8,["modelValue"])):(d.openBlock(),d.createBlock(d.unref(rt.Slider),{key:1,min:3,max:10,step:1,breakpoints:!0,label:"Node size",modelValue:v.value,"onUpdate:modelValue":b[4]||(b[4]=C=>v.value=C)},null,8,["modelValue"]))]),d.createElementVNode("div",jge,[d.createVNode(d.unref(rt.PlCheckbox),{modelValue:f.value,"onUpdate:modelValue":[b[5]||(b[5]=C=>f.value=C),b[6]||(b[6]=C=>{n.value.leavesMode=C?"alignLeavesToLine":"normal"})]},null,8,["modelValue"]),b[8]||(b[8]=d.createElementVNode("span",null,"Move leaves to the right",-1))]),d.createElementVNode("div",Yge,[d.createVNode(d.unref(rt.PlCheckbox),{modelValue:A.value,"onUpdate:modelValue":b[7]||(b[7]=C=>A.value=C)},null,8,["modelValue"]),b[9]||(b[9]=d.createElementVNode("span",null,"Show legend",-1))])],64))}}),Xge={class:"dot-size-selector"},Kge={class:"dot-size-selector__row"},Zge={class:"dot-size-selector-row"},D$=d.defineComponent({__name:"DotSizeSelector",props:{selected:{},min:{default:3},max:{default:10},possibleAesSourceInputs:{}},emits:["aes-update","aes-selector-close"],setup(e,{emit:t}){const n=e,r=Tr(),a=d.computed(()=>r.value.reactive.chartType),i=t,o={discrete:["primaryGrouping","secondaryGrouping"],scatterplot:["size"],"scatterplot-umap":["size"],dendro:[],heatmap:[],histogram:[],bubble:[]},s=n.possibleAesSourceInputs??o[a.value],c=d.ref(Vh(n.selected)?n.selected.column:"fix"),f=d.computed(()=>r.value.inputGuide.value);function A(b){const C=f.value.getSourceInfo(b);return a.value==="scatterplot"||a.value==="dendro"?`Grouping: ${C==null?void 0:C.label}`:C?(C==null?void 0:C.label)??"":"Not consistent (grouping)"}const p=d.computed(()=>{const b=[],C=r.value.reactive.optionsState.components;return s.forEach(x=>{var k;(k=C==null?void 0:C[x])!=null&&k.selectorStates.length&&C[x].selectorStates.forEach(({selectedSource:_})=>{f.value.getSourceInfo(_).type!=="String"&&b.push({text:A(_),value:_})})}),b.length?b:[{text:"Fixed",value:"fix"}]}),v=d.ref(Vh(n.selected)?H0:n.selected??H0),y=d.ref(Vh(n.selected)?[n.selected.range.min,n.selected.range.max]:[Wm.min,Wm.max]);return d.watch(()=>c.value,b=>{if(b==="fix")i("aes-update",v.value);else{const C={column:b,range:{min:y.value[0],max:y.value[1]}};i("aes-update",C)}}),d.watch(()=>v.value,b=>{c.value==="fix"&&i("aes-update",b)}),d.watch(()=>y.value,b=>{if(c.value!=="fix"){const C={column:c.value,range:{min:b[0],max:b[1]}};i("aes-update",C)}}),(b,C)=>(d.openBlock(),d.createElementBlock("div",Xge,[d.createElementVNode("div",Kge,[d.createElementVNode("div",{class:"aes-input-select",onClick:C[1]||(C[1]=d.withModifiers(()=>{},["stop"]))},[d.createVNode(d.unref(rt.PlDropdown),{disabled:p.value.length<2&&p.value[0].value===c.value,label:"Dot size source",options:p.value,modelValue:c.value,"onUpdate:modelValue":C[0]||(C[0]=x=>c.value=x)},null,8,["disabled","options","modelValue"])])]),d.createElementVNode("div",Zge,[c.value!=="fix"?(d.openBlock(),d.createBlock(d.unref(rt.SliderRange),{key:0,min:b.min,max:b.max,breakpoints:!0,label:"Dot size range",modelValue:y.value,"onUpdate:modelValue":C[2]||(C[2]=x=>y.value=x)},null,8,["min","max","modelValue"])):(d.openBlock(),d.createBlock(d.unref(rt.Slider),{key:1,min:b.min,max:b.max,step:1,breakpoints:!0,label:"Dot size",modelValue:v.value,"onUpdate:modelValue":C[3]||(C[3]=x=>v.value=x)},null,8,["min","max","modelValue"]))])]))}}),vy="dots",Jge=d.defineComponent({__name:"Scatter",setup(e){const t=Tr(),n=t.value.reactive.optionsState,r=d.computed(()=>t.value.inputGuide.value),a=d.computed(()=>t.value.reactive.layersSettings[vy]);function i(y){return y!==null&&typeof y=="object"&&"type"in y}const o=d.computed(()=>{const y=a.value.dotFill,b=n.components.grouping.selectorStates.map(C=>C.selectedSource);return i(y)&&b.length?b.includes(y.value)?y:{type:"grouping",value:b[0]}:b.length?{type:"grouping",value:b[0]}:i(y)?gi:y??gi}),s=d.computed(()=>{const y=a.value.dotShape,b=n.components.shape.selectorStates.map(C=>C.selectedSource);return i(y)&&b.length?y.value===b[0]?y:{type:"shape",value:b[0]}:b.length?{type:"shape",value:b[0]}:i(y)?D0:y??D0}),c=d.computed(()=>{const y=a.value.dotSize,b=n.components.size.selectorStates.map(C=>C.selectedSource);return b.length?Vh(y)?y:{column:b[0],range:Wm}:Vh(y)?H0:y??H0});function f(y,b,C){typeof y=="string"?t.value.reactive.layersSettings[vy][C]=y:(b.type==="dataCategorical"||b.type==="dataContinuous")&&(t.value.reactive.layersSettings[vy][C]={type:"grouping",value:b.selectedSource}),TN(y)&&b.type!=="fix"&&(t.value.reactive.dataBindAes[b.selectedSource]=y)}function A(y,b,C){typeof y=="string"?t.value.reactive.layersSettings[vy][C]=y:b.type==="dataCategorical"&&(t.value.reactive.layersSettings[vy][C]={type:"grouping",value:b.selectedSource}),b.type==="dataCategorical"&&typeof y!="string"&&(t.value.reactive.dataBindAes[b.selectedSource]=y)}function p(y){t.value.reactive.layersSettings[vy].dotSize=y}const v=d.computed(()=>{if(n.components.grouping.selectorStates.length){const y=n.components.grouping.selectorStates[0].selectedSource,b=r.value.getSourceInfo(y).annotations;if(b!=null&&b[K3])return!0}return!1});return(y,b)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(ei,{label:"Dot color","form-title":"Dot color Settings","form-back-title":"Layers",type:"fill",selected:o.value,"possible-aes-source-inputs":["grouping"],disabled:v.value,withoutFixed:typeof o.value=="object",onAesUpdate:b[0]||(b[0]=(C,x)=>f(C,x,"dotFill"))},null,8,["selected","disabled","withoutFixed"]),d.createVNode(ei,{label:"Dot shape","form-title":"Dot shape Settings","form-back-title":"Layers",type:"dotShape","possible-aes-source-inputs":["shape"],selected:s.value,withoutFixed:typeof s.value=="object",onAesUpdate:b[1]||(b[1]=(C,x)=>A(C,x,"dotShape"))},null,8,["selected","withoutFixed"]),d.createVNode(D$,{selected:c.value,onAesUpdate:p},null,8,["selected"])],64))}}),x6="dots",qge=d.defineComponent({__name:"Scatter",setup(e){const t=Tr(),n=t.value.reactive.optionsState,r=d.computed(()=>t.value.inputGuide.value),a=d.computed(()=>t.value.reactive.layersSettings[x6]);function i(p){return p!==null&&typeof p=="object"&&"type"in p}const o=d.computed(()=>{const p=a.value.dotFill,v=n.components.grouping.selectorStates.map(y=>y.selectedSource);return i(p)&&v.length?v.includes(p.value)?p:{type:"grouping",value:v[0]}:v.length?{type:"grouping",value:v[0]}:i(p)?gi:p??gi});function s(p,v,y){typeof p=="string"?t.value.reactive.layersSettings[x6][y]=p:(v.type==="dataCategorical"||v.type==="dataContinuous")&&(t.value.reactive.layersSettings[x6][y]={type:"grouping",value:v.selectedSource}),TN(p)&&v.type!=="fix"&&(t.value.reactive.dataBindAes[v.selectedSource]=p)}const c=d.computed(()=>{if(n.components.grouping.selectorStates.length){const p=n.components.grouping.selectorStates[0].selectedSource,v=r.value.getSourceInfo(p).annotations;if(v!=null&&v[K3])return!0}return!1}),f=d.computed(()=>{const p=a.value.dotSize,v=n.components.size.selectorStates.map(y=>y.selectedSource);return v.length?Vh(p)?p:{column:v[0],range:Wm}:Vh(p)?RS:p??RS});function A(p){t.value.reactive.layersSettings[x6].dotSize=p}return(p,v)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(ei,{label:"Dot color","form-title":"Dot color Settings1","form-back-title":"Layers",type:"fill",selected:o.value,"possible-aes-source-inputs":["grouping"],disabled:c.value,withoutFixed:typeof o.value=="object",onAesUpdate:v[0]||(v[0]=(y,b)=>s(y,b,"dotFill"))},null,8,["selected","disabled","withoutFixed"]),d.createVNode(D$,{selected:f.value,onAesUpdate:A,min:2},null,8,["selected"])],64))}}),e3e={class:"input-item",style:{display:"flex","justify-content":"space-between","align-items":"center"}},_B="curve",P$=d.defineComponent({__name:"Curve",setup(e){const t=Tr(),n=t.value.reactive.optionsState,r=d.computed(()=>t.value.reactive.layersSettings[_B]);function a(s){return s!==null&&typeof s=="object"&&"type"in s}const i=d.computed(()=>{const s=r.value.lineColor,c=n.components.grouping.selectorStates.map(f=>f.selectedSource);return a(s)&&c.length?c.includes(s.value)?s:{type:"grouping",value:c[0]}:c.length?{type:"grouping",value:c[0]}:a(s)?gi:s??gi});function o(s,c,f){typeof s=="string"?t.value.reactive.layersSettings[_B][f]=s:c.type==="dataCategorical"&&(t.value.reactive.layersSettings[_B][f]={type:c.inputName,value:c.selectedSource}),c.type==="dataCategorical"&&typeof s!="string"&&(t.value.reactive.dataBindAes[c.selectedSource]=s)}return(s,c)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(ei,{label:"Color","form-title":"Color Settings","form-back-title":"Layers",type:"stroke",selected:i.value,withoutFixed:typeof i.value=="object","possible-aes-source-inputs":["grouping"],onAesUpdate:c[0]||(c[0]=(f,A)=>o(f,A,"lineColor"))},null,8,["selected","withoutFixed"]),d.createElementVNode("div",e3e,[c[2]||(c[2]=d.createElementVNode("span",null,"Smoothing",-1)),d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:d.unref(t).reactive.layersSettings.curve.smoothing,"onUpdate:modelValue":c[1]||(c[1]=f=>d.unref(t).reactive.layersSettings.curve.smoothing=f)},null,8,["modelValue"])])],64))}}),t3e={class:"checkbox-item"},n3e={key:1,class:"checkbox-item"},r3e={class:"checkbox-item"},a3e={key:2,class:"checkbox-item"},i3e={class:"button-group-item"},o3e={class:"button-group-item"},l3e={class:"button-group-item",style:{display:"flex",alignItems:"end"}},s3e=d.defineComponent({__name:"HeatmapClustered",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.layersSettings.heatmapClustered),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>t.value.inputGuide.value),i=d.computed(()=>{var C;return(C=r.value.components.value.selectorStates[0])==null?void 0:C.selectedSource}),o=d.computed(()=>{var C;return i.value?(C=t.value.reactive.dataBindAes[i.value])==null?void 0:C.palette:void 0}),s=d.ref(!1),c=d.ref(o.value??nv);function f(C){c.value=C,s.value=!1,i.value&&(t.value.reactive.dataBindAes[i.value]=Xm(C))}const A=[{label:"None",value:null},{label:"Columns",value:"column"},{label:"Rows",value:"row"}],p=[{label:"z-score",value:"standardScaling"},{label:"Min-max",value:"meanNormalization"}],v=[{label:"empty",value:null},{label:"Special value",value:"custom"}],y=d.ref(n.value.NAValueAs!==null?"custom":n.value.NAValueAs),b=d.ref(n.value.NAValueAs??0);return(C,x)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(Ay,{label:"Color Palette ",title:d.unref(Gi)[c.value].title,palette:c.value,onButtonClick:x[0]||(x[0]=k=>{s.value=!0})},null,8,["title","palette"]),s.value?(d.openBlock(),d.createBlock(Uh,{key:0,title:"Color Palette","back-title":"Color mapping","onForm:close":x[1]||(x[1]=k=>s.value=!1)},{default:d.withCtx(()=>[d.createVNode(py,{selected:c.value,categorical:i.value?a.value.getSourceInfo(i.value).type==="String":!1,onSelect:f},null,8,["selected","categorical"])]),_:1})):d.createCommentVNode("",!0),d.createElementVNode("div",t3e,[d.createVNode(d.unref(rt.PlCheckbox),{modelValue:n.value.disableClusteringX,"onUpdate:modelValue":x[2]||(x[2]=k=>n.value.disableClusteringX=k)},null,8,["modelValue"]),x[12]||(x[12]=d.createElementVNode("span",null,"Disable clustering for X axis",-1))]),n.value.disableClusteringX?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",n3e,[d.createVNode(d.unref(rt.PlCheckbox),{modelValue:n.value.dendrogramX,"onUpdate:modelValue":x[3]||(x[3]=k=>n.value.dendrogramX=k)},null,8,["modelValue"]),x[13]||(x[13]=d.createElementVNode("span",null,"Show dendrogram for X axis",-1))])),d.createElementVNode("div",r3e,[d.createVNode(d.unref(rt.PlCheckbox),{modelValue:n.value.disableClusteringY,"onUpdate:modelValue":x[4]||(x[4]=k=>n.value.disableClusteringY=k)},null,8,["modelValue"]),x[14]||(x[14]=d.createElementVNode("span",null,"Disable clustering for Y axis",-1))]),n.value.disableClusteringY?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",a3e,[d.createVNode(d.unref(rt.PlCheckbox),{modelValue:n.value.dendrogramY,"onUpdate:modelValue":x[5]||(x[5]=k=>n.value.dendrogramY=k)},null,8,["modelValue"]),x[15]||(x[15]=d.createElementVNode("span",null,"Show dendrogram for Y axis",-1))])),d.createElementVNode("div",i3e,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Normalize by",options:A,compact:!0,modelValue:n.value.normalizationDirection,"onUpdate:modelValue":x[6]||(x[6]=k=>n.value.normalizationDirection=k)},null,8,["modelValue"])]),d.createElementVNode("div",o3e,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Normalization method",options:p,compact:!0,modelValue:n.value.normalizationMethod,"onUpdate:modelValue":x[7]||(x[7]=k=>n.value.normalizationMethod=k)},null,8,["modelValue"])]),d.createElementVNode("div",l3e,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Treat NA value as:",options:v,compact:!0,modelValue:y.value,"onUpdate:modelValue":[x[8]||(x[8]=k=>y.value=k),x[9]||(x[9]=k=>{k==="custom"?n.value.NAValueAs=b.value:n.value.NAValueAs=k})]},null,8,["modelValue"]),d.createVNode(d.unref(rt.PlNumberField),{style:{height:"33px",marginLeft:"16px",width:"75px"},disabled:y.value!=="custom",label:"NA value",useIncrementButtons:!1,modelValue:b.value,"onUpdate:modelValue":[x[10]||(x[10]=k=>b.value=k),x[11]||(x[11]=k=>{k!==void 0&&(n.value.NAValueAs=k)})]},null,8,["disabled","modelValue"])])],64))}}),u3e={class:"section-title"},c3e=d.defineComponent({__name:"HeatmapAnnotations",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.optionsState),r=d.computed(()=>t.value.inputGuide.value),a=d.computed(()=>{const A=n.value.components.annotationsX.selectorStates.map(v=>v.selectedSource),p=n.value.components.annotationsY.selectorStates.map(v=>v.selectedSource);return[...A,...p]}),i=d.computed(()=>a.value.reduce((A,p)=>(A[p]=r.value.getSourceInfo(p),A),{})),o=d.reactive(a.value.reduce((A,p)=>{var b,C;const y=((b=i.value[p])==null?void 0:b.type)==="String"?wR:nv;return A[p]=((C=t.value.reactive.dataBindAes[p])==null?void 0:C.palette)??y,A},{})),s=d.ref(null),c=d.ref(null);function f(A){const p=c.value;p&&(o[p]=A,t.value.reactive.dataBindAes[p]=Xm(A)),s.value=p}return(A,p)=>(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.value,v=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createElementVNode("div",u3e,[d.createElementVNode("span",null,d.toDisplayString(i.value[v].label),1)]),d.createVNode(Ay,{label:"Color Palette ",title:d.unref(Gi)[o[v]].title,palette:o[v],style:{marginBottom:"24px"},onButtonClick:y=>{s.value=v,c.value=v}},null,8,["title","palette","onButtonClick"]),s.value===v?(d.openBlock(),d.createBlock(Uh,{key:0,title:"Color Palette","back-title":"Color mapping","onForm:close":p[0]||(p[0]=y=>s.value=null)},{default:d.withCtx(()=>[d.createVNode(py,{selected:o[v],categorical:i.value[v].type==="String",onSelect:f},null,8,["selected","categorical"])]),_:2},1024)):d.createCommentVNode("",!0)],64))),256))}}),f3e={},d3e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function A3e(e,t){return d.openBlock(),d.createElementBlock("svg",d3e,t[0]||(t[0]=[d.createStaticVNode('<path fill-rule="evenodd" clip-rule="evenodd" d="M9.25 13.5C9.25 14.1904 9.80964 14.75 10.5 14.75L13.5 14.75C14.1904 14.75 14.75 14.1904 14.75 13.5V10.5C14.75 9.80964 14.1904 9.25 13.5 9.25H10.5C9.80964 9.25 9.25 9.80964 9.25 10.5V13.5ZM10.75 13.25V10.75H13.25V13.25H10.75Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M9.25 20.5C9.25 21.1904 9.80964 21.75 10.5 21.75H13.5C14.1904 21.75 14.75 21.1904 14.75 20.5V17.5C14.75 16.8096 14.1904 16.25 13.5 16.25H10.5C9.80964 16.25 9.25 16.8096 9.25 17.5L9.25 20.5ZM10.75 20.25V17.75H13.25V20.25H10.75Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 13.5C2.25 14.1904 2.80964 14.75 3.5 14.75H6.5C7.19036 14.75 7.75 14.1904 7.75 13.5L7.75 10.5C7.75 9.80964 7.19036 9.25 6.5 9.25H3.5C2.80964 9.25 2.25 9.80964 2.25 10.5L2.25 13.5ZM3.75 13.25L3.75 10.75H6.25V13.25H3.75Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 20.5C2.25 21.1904 2.80964 21.75 3.5 21.75H6.5C7.19036 21.75 7.75 21.1904 7.75 20.5L7.75 17.5C7.75 16.8096 7.19036 16.25 6.5 16.25H3.5C2.80964 16.25 2.25 16.8096 2.25 17.5L2.25 20.5ZM3.75 20.25L3.75 17.75H6.25V20.25H3.75Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M16.25 20.5C16.25 21.1904 16.8096 21.75 17.5 21.75H20.5C21.1904 21.75 21.75 21.1904 21.75 20.5L21.75 10.5C21.75 9.80964 21.1904 9.25 20.5 9.25H17.5C16.8096 9.25 16.25 9.80964 16.25 10.5L16.25 20.5ZM17.75 20.25L17.75 10.75L20.25 10.75L20.25 20.25H17.75Z" fill="#07AD3E"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 6.5C2.25 7.19036 2.80964 7.75 3.5 7.75L13.5 7.75C14.1904 7.75 14.75 7.19036 14.75 6.5V3.5C14.75 2.80964 14.1904 2.25 13.5 2.25L3.5 2.25C2.80964 2.25 2.25 2.80964 2.25 3.5L2.25 6.5ZM3.75 6.25L3.75 3.75L13.25 3.75V6.25L3.75 6.25Z" fill="#07AD3E"></path>',6)]))}const p3e=mr(f3e,[["render",A3e]]),DB="bins",h3e=d.defineComponent({__name:"Bins",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.layersSettings[DB]);function r(s,c,f){const A=c.components.grouping.selectorStates.length>0;return s===null?A?{type:"grouping",value:c.components.grouping.selectorStates[0].selectedSource}:f:s}const a=d.computed(()=>r(n.value.fillColor,t.value.reactive.optionsState,L3));function i(s,c,f){c.type==="dataCategorical"?t.value.reactive.layersSettings[DB][f]={type:c.inputName}:t.value.reactive.layersSettings[DB][f]=s,c.type==="dataCategorical"&&typeof s!="string"&&(t.value.reactive.dataBindAes[c.selectedSource]=s)}const o=d.computed({get:()=>n.value.opacity*100,set:s=>{n.value.opacity=s/100}});return(s,c)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(ei,{label:"Fill color","form-title":"Fill Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,withoutFixed:typeof a.value=="object",onAesUpdate:c[0]||(c[0]=(f,A)=>i(f,A,"fillColor"))},null,8,["selected","withoutFixed"]),d.createVNode(d.unref(rt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:o.value,"onUpdate:modelValue":c[1]||(c[1]=f=>o.value=f)},null,8,["modelValue"])],64))}}),v3e={class:"input-item"},m3e={class:"button-group-item"},g3e={class:"button-group-item"},y3e={class:"button-group-item",style:{display:"flex",alignItems:"end"}},w3e=d.defineComponent({__name:"Bubble",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.layersSettings.bubble),r=d.computed(()=>t.value.reactive.optionsState);d.computed(()=>t.value.inputGuide.value);const a=d.computed(()=>{var C;return(C=r.value.components.valueColor.selectorStates[0])==null?void 0:C.selectedSource}),i=d.computed(()=>{var C;return a.value?(C=t.value.reactive.dataBindAes[a.value])==null?void 0:C.palette:void 0}),o=d.ref(!1),s=d.ref(i.value??nv);function c(C){s.value=C,o.value=!1,a.value&&(t.value.reactive.dataBindAes[a.value]=Xm(C))}const f=[{label:"None",value:null},{label:"Columns",value:"column"},{label:"Rows",value:"row"}],A=[{label:"z-score",value:"standardScaling"},{label:"Min-max",value:"meanNormalization"}],p=d.computed({get:()=>n.value.strokeColor??gi,set:C=>{n.value.strokeColor=C}}),v=[{label:"empty",value:null},{label:"Special value",value:"custom"}],y=d.ref(n.value.NAValueAs!==null?"custom":n.value.NAValueAs),b=d.ref(n.value.NAValueAs??0);return(C,x)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(Ay,{label:"Color Palette ",title:d.unref(Gi)[s.value].title,palette:s.value,onButtonClick:x[0]||(x[0]=k=>{o.value=!0})},null,8,["title","palette"]),o.value?(d.openBlock(),d.createBlock(Uh,{key:0,title:"Color Palette","back-title":"Color mapping","onForm:close":x[1]||(x[1]=k=>o.value=!1)},{default:d.withCtx(()=>[d.createVNode(py,{selected:s.value,categorical:!1,onSelect:c},null,8,["selected"])]),_:1})):d.createCommentVNode("",!0),d.createElementVNode("div",v3e,[d.createVNode(ei,{label:"Stroke color","form-title":"Stroke Color Settings","form-back-title":"Layers",type:"stroke","possible-aes-source-inputs":[],selected:p.value,onAesUpdate:x[2]||(x[2]=k=>p.value=k)},null,8,["selected"])]),d.createElementVNode("div",m3e,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Normalize by",options:f,compact:!0,modelValue:n.value.normalizationDirection,"onUpdate:modelValue":x[3]||(x[3]=k=>n.value.normalizationDirection=k)},null,8,["modelValue"])]),d.createElementVNode("div",g3e,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Normalization method",options:A,compact:!0,modelValue:n.value.normalizationMethod,"onUpdate:modelValue":x[4]||(x[4]=k=>n.value.normalizationMethod=k)},null,8,["modelValue"])]),d.createElementVNode("div",y3e,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Treat NA value as:",options:v,compact:!0,modelValue:y.value,"onUpdate:modelValue":[x[5]||(x[5]=k=>y.value=k),x[6]||(x[6]=k=>{k==="custom"?n.value.NAValueAs=b.value:n.value.NAValueAs=k})]},null,8,["modelValue"]),d.createVNode(d.unref(rt.PlNumberField),{style:{height:"33px",marginLeft:"16px",width:"75px"},disabled:y.value!=="custom",label:"NA value",useIncrementButtons:!1,modelValue:b.value,"onUpdate:modelValue":[x[7]||(x[7]=k=>b.value=k),x[8]||(x[8]=k=>{k!==void 0&&(n.value.NAValueAs=k)})]},null,8,["disabled","modelValue"])])],64))}}),C3e={class:"layers-form",id:"layers-form"},b3e={class:"layers-list"},E3e=d.defineComponent({__name:"index",setup(e){const t=Tr(),n={box:xge,binnedDots:Bge,jitteredDots:Tge,violin:Mge,bar:Hge,stackedBar:Rge,line:Nge,errorbar:Lge,sina:$ge,logo:Oge},r={dots:Jge,curve:P$},a={dots:qge,curve:P$},i={heatmap:Gge,heatmapClustered:s3e};return(o,s)=>(d.openBlock(),d.createElementBlock("div",C3e,[s[0]||(s[0]=d.createElementVNode("div",{class:"layers-title"},[d.createElementVNode("h3",null," Layers ")],-1)),d.createElementVNode("div",b3e,[d.unref(t).reactive.chartType==="discrete"?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(Z3)[d.unref(t).reactive.template],c=>(d.openBlock(),d.createBlock(Pl,{icon:d.unref(Bf)[c],title:d.unref(I0)[c],settings:{defaultState:d.unref(Z3)[d.unref(t).reactive.template].length>1?"close":"open"}},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(n[c])))]),_:2},1032,["icon","title","settings"]))),256)):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="scatterplot"?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:1},d.renderList(d.unref(Zm)[d.unref(t).reactive.template],c=>(d.openBlock(),d.createBlock(Pl,{icon:d.unref(Bf)[c],title:d.unref(I0)[c],settings:{defaultState:d.unref(Zm)[d.unref(t).reactive.template].length>1?"close":"open"}},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(r[c])))]),_:2},1032,["icon","title","settings"]))),256)):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="scatterplot-umap"?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:2},d.renderList(d.unref(IN)[d.unref(t).reactive.template],c=>(d.openBlock(),d.createBlock(Pl,{icon:d.unref(Bf)[c],title:d.unref(I0)[c],settings:{defaultState:d.unref(Zm)[d.unref(t).reactive.template].length>1?"close":"open"}},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(a[c])))]),_:2},1032,["icon","title","settings"]))),256)):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="heatmap"?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:3},d.renderList(d.unref(Hle)[d.unref(t).reactive.template],c=>(d.openBlock(),d.createBlock(Pl,{icon:d.unref(Bf)[c],title:d.unref(I0)[c],settings:{defaultState:"open"}},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(i[c])))]),_:2},1032,["icon","title"]))),256)):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="heatmap"?(d.openBlock(),d.createBlock(Pl,{key:4,icon:p3e,title:"Annotations",settings:{defaultState:"open"}},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(c3e)))]),_:1})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="dendro"?(d.openBlock(),d.createBlock(Pl,{key:5,icon:d.unref(Bf).dendro,title:d.unref(I0).dendro,settings:{defaultState:"open"}},{default:d.withCtx(()=>[d.createVNode(Wge)]),_:1},8,["icon","title"])):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="histogram"?(d.openBlock(),d.createBlock(Pl,{key:6,icon:d.unref(Bf).bins,title:d.unref(I0).bins,settings:{defaultState:"open"}},{default:d.withCtx(()=>[d.createVNode(h3e)]),_:1},8,["icon","title"])):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="bubble"?(d.openBlock(),d.createBlock(Pl,{key:7,icon:d.unref(Bf).bubble,title:d.unref(I0).bubble,settings:{defaultState:"open"}},{default:d.withCtx(()=>[d.createVNode(w3e)]),_:1},8,["icon","title"])):d.createCommentVNode("",!0)])]))}});function x3e(e,{slots:t}){return d.h("div",Object.assign({},e,{class:"non-found-component"}),t.default&&t.default())}function S3e(e,t){return d.computed(()=>{const n=d.unref(t);return n&&e[n]?e[n]:x3e})}const B3e={},k3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function T3e(e,t){return d.openBlock(),d.createElementBlock("svg",k3e,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14.5 7.5V4.5H19.5V7.5H14.5ZM13 4C13 3.44772 13.4477 3 14 3H20C20.5523 3 21 3.44772 21 4V8C21 8.55228 20.5523 9 20 9H14C13.4477 9 13 8.55228 13 8V4ZM4.5 19.5V16.5H9.5V19.5H4.5ZM3 16C3 15.4477 3.44772 15 4 15H10C10.5523 15 11 15.4477 11 16V20C11 20.5523 10.5523 21 10 21H4C3.44772 21 3 20.5523 3 20V16Z",fill:"#07AD3E"},null,-1),d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4.5 11.5V4.5H9.5V11.5H4.5ZM3 4C3 3.44772 3.44772 3 4 3H10C10.5523 3 11 3.44772 11 4V12C11 12.5523 10.5523 13 10 13H4C3.44772 13 3 12.5523 3 12V4ZM14.5 19.5V12.5H19.5V19.5H14.5ZM13 12C13 11.4477 13.4477 11 14 11H20C20.5523 11 21 11.4477 21 12V20C21 20.5523 20.5523 21 20 21H14C13.4477 21 13 20.5523 13 20V12Z",fill:"#110529"},null,-1)]))}const _3e=mr(B3e,[["render",T3e]]),D3e={},P3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function M3e(e,t){return d.openBlock(),d.createElementBlock("svg",P3e,t[0]||(t[0]=[d.createStaticVNode('<g clip-path="url(#clip0_8849_14901)"><path fill-rule="evenodd" clip-rule="evenodd" d="M11.2214 15.2215L13.5701 12.8728C15.2298 11.2131 15.2298 8.5221 13.5701 6.86237C11.9104 5.20264 9.21943 5.20264 7.5597 6.86237L3.31706 11.105C1.65733 12.7647 1.65733 15.4557 3.31706 17.1154C4.38616 18.1845 5.88312 18.565 7.25674 18.2568L8.45258 19.4526C6.38303 20.2767 3.93151 19.8512 2.2564 18.1761C0.0108876 15.9306 0.0108879 12.2899 2.2564 10.0444L6.49904 5.80171C8.74456 3.5562 12.3853 3.5562 14.6308 5.80171C16.8763 8.04723 16.8763 11.6879 14.6308 13.9334L12.2821 16.2821L11.2214 15.2215Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M17.4594 18.1761C15.2139 20.4216 11.5732 20.4216 9.32769 18.1761C7.08218 15.9306 7.08218 12.2899 9.32769 10.0444L11.686 7.68604L12.7467 8.7467L10.3884 11.105C8.72862 12.7647 8.72862 15.4557 10.3884 17.1154C12.0481 18.7751 14.739 18.7751 16.3988 17.1154L20.6414 12.8728C22.3011 11.2131 22.3011 8.5221 20.6414 6.86237C19.5764 5.79737 18.0868 5.41575 16.7175 5.71752L15.5197 4.51971C17.5863 3.70299 20.0307 4.13032 21.7021 5.80171C23.9476 8.04723 23.9476 11.6879 21.7021 13.9334L17.4594 18.1761Z" fill="#07AD3E"></path></g><defs><clipPath id="clip0_8849_14901"><rect width="24" height="24" fill="white"></rect></clipPath></defs>',2)]))}const H3e=mr(D3e,[["render",M3e]]),I3e={},R3e={width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function N3e(e,t){return d.openBlock(),d.createElementBlock("svg",R3e,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M23.25 17.75V14H24.75V17.75H26V19.25H24.75V23.25H28.75V22H30.25V23.25H34V24.75H30.25V26H28.75V24.75H24.75V28.75H26V30.25H24.75V34H23.25V30.25H22V28.75H23.25V24.75H19.25V26H17.75V24.75H14V23.25H17.75V22H19.25V23.25H23.25V19.25H22V17.75H23.25Z",fill:"#110529"},null,-1),d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.4697 15.5303L17.7501 17.8107V20H19.2501V17.8107L21.5304 15.5303L20.4697 14.4697L18.5001 16.4393L16.5304 14.4697L15.4697 15.5303ZM27.4697 28.5303L29.4394 30.5L27.4697 32.4697L28.5304 33.5303L30.5001 31.5607L32.4697 33.5303L33.5304 32.4697L31.5607 30.5L33.5304 28.5303L32.4697 27.4697L30.5001 29.4393L28.5304 27.4697L27.4697 28.5303Z",fill:"#07AD3E"},null,-1)]))}const L3e=mr(I3e,[["render",N3e]]),$3e={},F3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function V3e(e,t){return d.openBlock(),d.createElementBlock("svg",F3e,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M20.5 12C20.5 10.3189 20.0015 8.67547 19.0675 7.27766C18.1335 5.87984 16.806 4.79037 15.2528 4.14703C13.6996 3.50368 11.9906 3.33536 10.3417 3.66333C8.6929 3.9913 7.17834 4.80085 5.9896 5.9896C4.80085 7.17834 3.9913 8.6929 3.66333 10.3417C3.33536 11.9906 3.50368 13.6996 4.14703 15.2528C4.79037 16.806 5.87984 18.1335 7.27766 19.0675C8.18407 19.6731 9.19374 20.0957 10.25 20.3179V12.75H7V11.25H10.25V8C10.25 6.48122 11.4812 5.25 13 5.25C14.5188 5.25 15.75 6.48122 15.75 8V8.5H14.25V8C14.25 7.30964 13.6904 6.75 13 6.75C12.3096 6.75 11.75 7.30964 11.75 8V11.25H15V12.75H11.75V20.4963V21.5V21.9969C9.85961 21.9496 8.01943 21.3672 6.4443 20.3147C4.79981 19.2159 3.51809 17.6541 2.76121 15.8268C2.00433 13.9996 1.8063 11.9889 2.19215 10.0491C2.578 8.10929 3.53041 6.32746 4.92894 4.92894C6.32746 3.53041 8.10929 2.578 10.0491 2.19215C11.9889 1.8063 13.9996 2.00433 15.8268 2.76121C17.6541 3.51809 19.2159 4.79981 20.3147 6.4443C21.4135 8.08879 22 10.0222 22 12H20.5Z",fill:"#110529"},null,-1),d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M19.0607 18L21.5304 15.5303L20.4697 14.4697L18.0001 16.9393L15.5304 14.4697L14.4697 15.5303L16.9394 18L14.4697 20.4697L15.5304 21.5303L18.0001 19.0607L20.4697 21.5303L21.5304 20.4697L19.0607 18Z",fill:"#07AD3E"},null,-1)]))}const O3e=mr($3e,[["render",V3e]]),Q3e={},z3e={class:"layers-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function U3e(e,t){return d.openBlock(),d.createElementBlock("svg",z3e,t[0]||(t[0]=[d.createElementVNode("g",{id:"24: layers"},[d.createElementVNode("path",{id:"Subtract","fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.37549 15.1251L12.0003 21.25L21.6255 15.1249L21.6749 15.1563C22.2924 15.5493 22.2924 16.4507 21.6749 16.8436L12.5375 22.6583C12.21 22.8668 11.7913 22.8668 11.4638 22.6583L2.32641 16.8436C1.70891 16.4507 1.70891 15.5493 2.32641 15.1563L2.37549 15.1251Z",fill:"#07AD3E"}),d.createElementVNode("path",{id:"Union","fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.32641 7.15633C1.70891 7.54929 1.70891 8.4507 2.32641 8.84366L11.4638 14.6583C11.7913 14.8668 12.21 14.8668 12.5375 14.6583L21.6749 8.84365C22.2924 8.4507 22.2924 7.54929 21.6749 7.15633L12.5375 1.34164C12.21 1.13319 11.7913 1.13319 11.4638 1.34164L2.32641 7.15633ZM3.75 7.99997L12 13.25L20.25 7.99997L12 2.74997L3.75 7.99997ZM12.0003 17.25L2.37549 11.1251L2.32641 11.1563C1.70891 11.5493 1.70891 12.4507 2.32641 12.8436L11.4638 18.6583C11.7913 18.8668 12.21 18.8668 12.5375 18.6583L21.6749 12.8436C22.2924 12.4507 22.2924 11.5493 21.6749 11.1563L21.6255 11.1249L12.0003 17.25Z",fill:"#110529"})],-1)]))}const G3e=mr(Q3e,[["render",U3e]]),j3e=d.defineComponent({__name:"SettingsIcon",setup(e){return(t,n)=>(d.openBlock(),d.createBlock(d.unref(rt.PlIcon24),{name:"settings"}))}}),Y3e={},W3e={class:"export-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function X3e(e,t){return d.openBlock(),d.createElementBlock("svg",W3e,t[0]||(t[0]=[d.createElementVNode("g",{id:"Icon"},[d.createElementVNode("path",{id:"Rectangle 4179",d:"M3 17V18C3 19.6569 4.34315 21 6 21H18C19.6569 21 21 19.6569 21 18V17",stroke:"#07AD3E","stroke-width":"1.5"}),d.createElementVNode("path",{id:"Vector 1335",d:"M18 10L12 16M12 16L6 10M12 16L12 2",stroke:"black","stroke-width":"1.5"})],-1)]))}const K3e=mr(Y3e,[["render",X3e]]),Z3e={class:"input-item"},J3e={class:"input-item"},q3e={class:"input-item"},eye={class:"input-item"},tye={class:"input-item",style:{"z-index":"0"}},nye={class:"checkbox-item"},rye={class:"input-item"},aye={class:"input-item"},iye={class:"input-item",style:{"z-index":"0"}},oye={class:"checkbox-item"},lye=d.defineComponent({__name:"DiscreteStatisticsForm",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.statisticsSettings),r=d.computed(()=>t.value.commonHelpersData.primaryGroups.value),a=d.computed(()=>WN(r.value)),i=d.computed(()=>XN(r.value)),o=(y,b)=>d.computed({get(){return y[b]??void 0},set(C){y[b]=C??null}}),s=o(n.value.overall.data,"testMethod"),c=o(n.value.referenceGroup.data,"testMethod"),f=o(n.value.referenceGroup.data,"referenceGroup"),A=o(n.value.referenceGroup.data,"correctionMethod"),p=o(n.value.pairwise.data,"testMethod"),v=o(n.value.pairwise.data,"correctionMethod");return FS(t)(),d.watch([()=>n.value.overall.data.testMethod,()=>n.value.referenceGroup.data.referenceGroup],FS(t)),(y,b)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[b[12]||(b[12]=d.createElementVNode("h3",null," Statistics ",-1)),b[13]||(b[13]=d.createElementVNode("div",{class:"section-title"},[d.createElementVNode("span",null,"overall p-value")],-1)),d.createElementVNode("div",Z3e,[d.createVNode(d.unref(rt.PlDropdown),{label:"Method",clearable:"",placeholder:"Choose",modelValue:d.unref(s),"onUpdate:modelValue":b[0]||(b[0]=C=>d.isRef(s)?s.value=C:null),options:i.value,error:n.value.overall.validity.testMethod?"":" "},null,8,["modelValue","options","error"])]),b[14]||(b[14]=d.createElementVNode("div",{class:"section-title"},[d.createElementVNode("span",null,"reference group")],-1)),d.createElementVNode("div",J3e,[d.createVNode(d.unref(rt.PlDropdown),{label:"Reference from...",clearable:"",placeholder:"Choose",modelValue:d.unref(f),"onUpdate:modelValue":b[1]||(b[1]=C=>d.isRef(f)?f.value=C:null),options:a.value,error:n.value.referenceGroup.validity.referenceGroup?"":" "},null,8,["modelValue","options","error"])]),d.createElementVNode("div",q3e,[d.createVNode(d.unref(rt.PlDropdown),{label:"Method",clearable:"",placeholder:"Choose",modelValue:d.unref(c),"onUpdate:modelValue":b[2]||(b[2]=C=>d.isRef(c)?c.value=C:null),options:d.unref(VC)},null,8,["modelValue","options"])]),d.createElementVNode("div",eye,[d.createVNode(d.unref(rt.PlDropdown),{label:"Correction method",placeholder:"Choose",modelValue:d.unref(A),"onUpdate:modelValue":b[3]||(b[3]=C=>d.isRef(A)?A.value=C:null),options:d.unref(NN)},null,8,["modelValue","options"])]),d.createElementVNode("div",tye,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Show",modelValue:n.value.referenceGroup.data.format,"onUpdate:modelValue":b[4]||(b[4]=C=>n.value.referenceGroup.data.format=C),options:d.unref(LN)},null,8,["modelValue","options"])]),d.createElementVNode("div",nye,[d.createVNode(d.unref(rt.PlCheckbox),{modelValue:n.value.referenceGroup.data.ns,"onUpdate:modelValue":b[5]||(b[5]=C=>n.value.referenceGroup.data.ns=C)},null,8,["modelValue"]),b[10]||(b[10]=d.createElementVNode("span",null,"Non-significant",-1))]),b[15]||(b[15]=d.createElementVNode("div",{class:"section-title"},[d.createElementVNode("span",null,"pairwise p-value")],-1)),d.createElementVNode("div",rye,[d.createVNode(d.unref(rt.PlDropdown),{label:"Method",clearable:"",placeholder:"Choose",modelValue:d.unref(p),"onUpdate:modelValue":b[6]||(b[6]=C=>d.isRef(p)?p.value=C:null),options:d.unref(VC)},null,8,["modelValue","options"])]),d.createElementVNode("div",aye,[d.createVNode(d.unref(rt.PlDropdown),{label:"Correction method",placeholder:"Choose",modelValue:d.unref(v),"onUpdate:modelValue":b[7]||(b[7]=C=>d.isRef(v)?v.value=C:null),options:d.unref(NN)},null,8,["modelValue","options"])]),d.createElementVNode("div",iye,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Show",modelValue:n.value.pairwise.data.format,"onUpdate:modelValue":b[8]||(b[8]=C=>n.value.pairwise.data.format=C),options:d.unref(LN)},null,8,["modelValue","options"])]),d.createElementVNode("div",oye,[d.createVNode(d.unref(rt.PlCheckbox),{modelValue:n.value.pairwise.data.ns,"onUpdate:modelValue":b[9]||(b[9]=C=>n.value.pairwise.data.ns=C)},null,8,["modelValue"]),b[11]||(b[11]=d.createElementVNode("span",null,"Non-significant",-1))])],64))}}),sye={class:"checkbox-item"},uye=d.defineComponent({__name:"ScatterplotStatisticsForm",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.statisticsSettings);return(r,a)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[a[1]||(a[1]=d.createElementVNode("h3",null,"Statistics",-1)),a[2]||(a[2]=d.createElementVNode("div",{class:"section-title"},[d.createElementVNode("span",null,"trends")],-1)),d.createElementVNode("div",sye,[d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:n.value.trend.on,"onUpdate:modelValue":a[0]||(a[0]=i=>n.value.trend.on=i),label:"Build trend",disabled:d.unref(t).reactive.template==="curve"},null,8,["modelValue","disabled"])])],64))}}),cye=d.defineComponent({__name:"index",setup(e){const t=Tr();return(n,r)=>(d.openBlock(),d.createElementBlock("div",{class:"stat-form",onClick:r[0]||(r[0]=a=>a.stopPropagation())},[d.unref(t).reactive.chartType==="discrete"?(d.openBlock(),d.createBlock(lye,{key:0})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="scatterplot"?(d.openBlock(),d.createBlock(uye,{key:1})):d.createCommentVNode("",!0)]))}}),fye={},dye={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function Aye(e,t){return d.openBlock(),d.createElementBlock("svg",dye,t[0]||(t[0]=[d.createStaticVNode('<path fill-rule="evenodd" clip-rule="evenodd" d="M7.5 3.75002C7.5 3.05967 8.05964 2.50002 8.75 2.50002L15.25 2.5C15.9404 2.5 16.5 3.05964 16.5 3.75V5.50004L20.5 5.50006V7.00006L19 7.00006H17.5L6.5 7.00004H5L3.5 7V5.5L7.5 5.50006V3.75002ZM9 5.50006L15 5.50004V4L9 4.00002V5.50006Z" fill="#110529"></path><path d="M17.5 7.00006V12.5H19V7.00006H17.5Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M6.5 17.75C6.5 18.9926 7.50736 20 8.75 20H12V21.5H8.75C6.67893 21.5 5 19.8211 5 17.75V8.50006H6.5V17.75Z" fill="#110529"></path><path d="M6.5 7.00004H5V8.50006H6.5V7.00004Z" fill="#110529"></path><path d="M14.75 14.5L18.25 18M21.75 21.5L18.25 18M18.25 18L21.75 14.5M18.25 18L14.75 21.5" stroke="#07AD3E" stroke-width="1.5"></path>',5)]))}const pye=mr(fye,[["render",Aye]]),hye={},vye={class:"settings-list"};function mye(e,t){return d.openBlock(),d.createElementBlock("div",{class:"settings-form",onClick:t[0]||(t[0]=n=>n.stopPropagation())},[t[1]||(t[1]=d.createElementVNode("div",{class:"settings-title"},[d.createElementVNode("h3",null," Settings ")],-1)),d.createElementVNode("div",vye,[d.renderSlot(e.$slots,"default"),d.renderSlot(e.$slots,"settingsSlot")])])}const S6={settings:{icon:j3e,component:mr(hye,[["render",mye]]),title:"Settings"},template:{icon:_3e,component:due,title:"Template"},dataMapping:{icon:H3e,component:Rhe,title:"Data mapping"},axes:{icon:L3e,component:Age,title:"Axes settings"},statistics:{icon:O3e,component:cye,title:"Statistics"},layers:{icon:G3e,component:E3e,title:"Layers"},delete:{icon:pye,component:null,title:"Delete graph"},export:{icon:K3e,component:null,title:"Export"}};function gye(){return Object.keys(S6)}function yye(e){return S6[e].icon??""}function wye(e){return S6[e].title??""}function Cye(e){const t=Object.entries(S6).reduce((n,[r,a])=>rue.setProp(n,r,a.component),{});return S3e(t,e)}const bye={class:"settings-tabs"},Eye={style:{"font-family":"var(--font-family-base)"}},xye=d.defineComponent({__name:"index",props:{chartType:{},graphStatus:{},allowDeleting:{type:Boolean},hasSettingsSlot:{type:Boolean},modelValue:{}},emits:["update:modelValue","export","delete"],setup(e,{emit:t}){const n=t,r=e,a=d.computed(()=>gye().filter(o=>!(o==="settings"&&!r.hasSettingsSlot)&&!(o==="statistics"&&r.chartType!=="discrete"&&r.chartType!=="scatterplot")&&!(o==="delete"&&r.allowDeleting)));function i(o){n("update:modelValue",o===r.modelValue?null:o)}return(o,s)=>(d.openBlock(),d.createElementBlock("div",bye,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.value,c=>(d.openBlock(),d.createBlock(d.unref(rt.PlTooltip),{key:c,"open-delay":100,"close-delay":100,class:d.normalizeClass(["has-inline-icon",{active:o.modelValue===c,"temp-inactive":c==="export"&&(o.graphStatus!=="ready"||o.chartType==="scatterplot-umap"),[c]:!0}]),position:"left",hide:o.modelValue===c,onClick:f=>{f.stopPropagation(),c==="export"?o.$emit("export"):c==="delete"?o.$emit("delete"):i(c)}},{tooltip:d.withCtx(()=>[d.createElementVNode("span",Eye,d.toDisplayString(d.unref(wye)(c)),1)]),default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(d.unref(yye)(c))))]),_:2},1032,["class","hide","onClick"]))),128))]))}}),Sye=d.defineComponent({__name:"TransitionSlidePanel",setup(e){function t(){window.dispatchEvent(new CustomEvent("adjust"))}function n(){window.dispatchEvent(new CustomEvent("adjust"))}return(r,a)=>(d.openBlock(),d.createBlock(d.Transition,{name:"slide-panel",onAfterEnter:t,onAfterLeave:n},{default:d.withCtx(()=>[d.renderSlot(r.$slots,"default")]),_:3}))}}),Bye=d.defineComponent({__name:"PanelModal",emits:["close"],setup(e,{emit:t}){const n=t,r=d.ref();return rt.useClickOutside([r],()=>n("close")),(a,i)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"rootRef",ref:r,class:"panel-modal"},[d.createVNode(d.unref(rt.PlCloseModalBtn),{class:"close-panel-modal",onClick:i[0]||(i[0]=o=>n("close"))}),d.renderSlot(a.$slots,"default",{ref:"contentRef"})],512))}}),kye={},Tye={xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"};function _ye(e,t){return d.openBlock(),d.createElementBlock("svg",Tye,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.75 2.25V7.25H13.75V8.75H8.75V13.75H7.25V8.75H2.25V7.25H7.25V2.25H8.75Z",fill:"#110529"},null,-1)]))}const Dye=mr(kye,[["render",_ye]]),Pye={},Mye={xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"};function Hye(e,t){return d.openBlock(),d.createElementBlock("svg",Mye,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.25 7.25H13.75V8.75H2.25V7.25Z",fill:"#110529"},null,-1)]))}const Iye=mr(Pye,[["render",Hye]]),Rye={class:"zoom-text-field"},Nye=d.defineComponent({__name:"ZoomInput",props:{modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,r=e,a=d.ref(),i=d.ref(!1),o=d.ref(String(r.modelValue)),s=d.computed({get(){const c=o.value??"100";return i.value?c:c+"%"},set(c){return o.value=c,c}});return d.watch(()=>i.value,c=>{if(!c){let f=Number(o.value);isNaN(f)?o.value=String(r.modelValue):n("update:modelValue",f)}}),d.watch(()=>r.modelValue,c=>{o.value=String(c)}),(c,f)=>(d.openBlock(),d.createElementBlock("div",{class:"zoom-text-field__envelope zoom-input",onFocusin:f[1]||(f[1]=A=>i.value=!0),onFocusout:f[2]||(f[2]=A=>i.value=!1),onKeyup:f[3]||(f[3]=d.withKeys(A=>{var p;return(p=a.value)==null?void 0:p.blur()},["enter"]))},[d.createElementVNode("div",Rye,[d.withDirectives(d.createElementVNode("input",{ref_key:"input",ref:a,"onUpdate:modelValue":f[0]||(f[0]=A=>s.value=A),type:"text"},null,512),[[d.vModelText,s.value]]),d.createVNode(xB,{style:{"z-index":"1"},class:"zoom-text-field__contour"})])],32))}}),Lye={class:"zoom-container"},$ye=20,Fye=400,M$=10,Vye=d.defineComponent({__name:"index",setup(e){const t=Tr();function n(i){return Math.max($ye,Math.min(Fye,i))}function r(){t.value.reactive.chartScale=n(t.value.reactive.chartScale-M$)}function a(){t.value.reactive.chartScale=n(t.value.reactive.chartScale+M$)}return(i,o)=>(d.openBlock(),d.createElementBlock("div",Lye,[o[1]||(o[1]=d.createElementVNode("div",{class:"zoom-border"},null,-1)),d.createVNode(d.unref(rt.PlBtnGhost),{onClick:r},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(Iye)))]),_:1}),d.createVNode(Nye,{modelValue:d.unref(t).reactive.chartScale,"onUpdate:modelValue":o[0]||(o[0]=s=>d.unref(t).reactive.chartScale=n(s))},null,8,["modelValue"]),d.createVNode(d.unref(rt.PlBtnGhost),{onClick:a},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(Dye)))]),_:1})]))}}),Oye=d.defineComponent({__name:"DendroTable",props:{chartData:{}},emits:["row-select"],setup(e,{emit:t}){const n=Tr(),r=e,a=d.ref(100),i=d.shallowRef(),o=d.computed(()=>["id",...n.value.reactive.optionsState.components.tableContent.selectorStates.map(y=>y.selectedSource)]),s=d.ref([]);d.watch(()=>{var y;return(y=r.chartData)==null?void 0:y.hierarchy},y=>{if(y){const b=y.leaves().map(C=>C.data.rawData.id);(b.length!==s.value.length||b.some((C,x)=>C!==s.value[x]))&&(s.value=b)}else s.value=[]},{immediate:!0});const c=d.ref([]),f=d.ref([]);d.watch([()=>s.value,()=>o.value,()=>n.value.commonHelpersData.dendroTableData.value],([y,b,C])=>{if(C===null){f.value=[],c.value=[];return}if(b.some(k=>!C[k]))return;const x=C.id.data.reduce((k,_,P)=>{const N=_;return k[N]&&console.warn(`More than 1 value for node id ${N} in dendro table`),k[N]=b.reduce((I,F)=>{const Q=C[F];return Q&&(I[F]=Q.data[P]),I},{}),k},{});f.value=b.map(k=>({headerName:C[k].label,field:k,sortable:!1,resizable:!1})),c.value=y.map(k=>x[k]??null),v()},{immediate:!0});const A=d.computed(()=>{var b,C;const y=(C=(b=r.chartData)==null?void 0:b.chartSizes)==null?void 0:C.treeHeight;return s.value.length?y/s.value.length:0}),p=y=>{i.value=y.api,v()};function v(){if(i.value&&!i.value.isDestroyed()){i.value.autoSizeAllColumns();const y=i.value.getColumns();y&&(a.value=y.reduce((b,C)=>b+C.getActualWidth(),2))}}return d.watch(()=>n.value.reactive.dendroSelectedNodeId,y=>{i.value&&(y===null?i.value.deselectAll():i.value.forEachNode(b=>{b.data.id===y&&b.setSelected(!0,!0)}))}),(y,b)=>(d.openBlock(),d.createElementBlock("div",{class:"dendro-table",style:d.normalizeStyle({width:a.value+"px"})},[d.createVNode(d.unref(cte.AgGridVue),{theme:d.unref(rt.AgGridTheme),gridApi:i.value,onGridReady:p,defaultColDef:{suppressHeaderMenuButton:!0},rowData:c.value,columnDefs:f.value,rowHeight:A.value,autoSizeStrategy:{type:"fitCellContents"},onGridColumnsChanged:b[0]||(b[0]=()=>{v()}),domLayout:"autoHeight"},null,8,["theme","gridApi","rowData","columnDefs","rowHeight"])],4))}}),Qye={},zye={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function Uye(e,t){return d.openBlock(),d.createElementBlock("svg",zye,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M19.091 3.53035C18.2123 2.65166 16.7877 2.65167 15.909 3.53037L3.90901 15.5304C3.48705 15.9524 3.25 16.5246 3.25 17.1214V20.0001C3.25 20.4143 3.58579 20.7501 4 20.7501H6.87868C7.47542 20.7501 8.04771 20.513 8.46967 20.0911L20.4697 8.09099C21.3484 7.21231 21.3484 5.7877 20.4697 4.90903L19.091 3.53035ZM16.9697 4.59101C17.2626 4.29811 17.7374 4.29811 18.0303 4.59101L19.409 5.96969C19.7019 6.26258 19.7019 6.73745 19.409 7.03034L18.5 7.9394L16.0607 5.50006L16.9697 4.59101ZM15 6.56073L17.4393 9.00007L7.40901 19.0304C7.26836 19.171 7.07759 19.2501 6.87868 19.2501H4.75V17.1214C4.75 16.9225 4.82902 16.7317 4.96967 16.5911L15 6.56073Z",fill:"#CFD1DB"},null,-1),d.createElementVNode("path",{d:"M12 20.7501L20 20.7501L20 19.2501L12 19.2501L12 20.7501Z",fill:"#CFD1DB"},null,-1)]))}const Gye=mr(Qye,[["render",Uye]]),H$=d.defineComponent({__name:"Loading",props:{top:{default:0},left:{default:0},right:{default:0},bottom:{default:0}},setup(e){return(t,n)=>(d.openBlock(),d.createElementBlock("div",{class:"graph-maker__loading",style:d.normalizeStyle({top:`${t.top}px`,bottom:`${t.bottom}px`,right:`${t.right}px`,left:`${t.left}px`})},n[0]||(n[0]=[d.createStaticVNode('<div class="loading-picture"><svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 80 80" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M36.0197 2.29384C37.0053 1.76506 37.7157 1.45481 38.4537 1.29931C39.4734 1.08447 40.5266 1.08447 41.5463 1.29931C42.2843 1.45481 42.9947 1.76506 43.9803 2.29384C44.7026 2.66301 45.5542 3.14998 46.6565 3.78023L68.4201 16.2247C69.3757 16.7711 70.1409 17.2086 70.7708 17.5978C71.8362 18.2367 72.5158 18.7183 73.0579 19.3166C73.7667 20.0989 74.3023 21.0219 74.6298 22.0253C75 23.1595 75 24.4276 75 26.9639V53.0362C75 55.5725 75 56.8407 74.6298 57.9748C74.3023 58.9782 73.7667 59.9012 73.0579 60.6835C72.5154 61.2822 71.8353 61.764 70.7688 62.4035C70.1393 62.7924 69.3748 63.2295 68.4203 63.7753L46.6565 76.2198C45.555 76.8497 44.7037 77.3364 43.9817 77.7055C42.9954 78.2347 42.2847 78.5452 41.5463 78.7008C40.5266 78.9156 39.4734 78.9156 38.4537 78.7008C37.7153 78.5452 37.0045 78.2347 36.0182 77.7054C35.2962 77.3364 34.445 76.8497 33.3436 76.2199L11.5799 63.7754C10.6253 63.2295 9.86069 62.7924 9.23115 62.4035C8.16466 61.764 7.48457 61.2822 6.94208 60.6835C6.23334 59.9012 5.6977 58.9782 5.37018 57.9748C5 56.8407 5 55.5725 5 53.0362V26.9639C5 24.4276 5 23.1595 5.37018 22.0253C5.6977 21.0219 6.23334 20.0989 6.94208 19.3166C7.48422 18.7183 8.16379 18.2367 9.22911 17.5978C9.85904 17.2086 10.6242 16.7711 11.5799 16.2247L33.3435 3.78023C34.4457 3.14998 35.2974 2.663 36.0197 2.29384ZM10 34.9971V24.9907H37.4546V34.9971H10ZM10 45.0036V40.0003H37.4546V45.0036H10ZM37.4546 72.9139L10 57.1541V50.0069H37.4546V72.9139ZM65.0189 60.0134L42.5455 72.9138V60.0134H65.0189ZM70 24.9907V55.0101H42.5455V24.9907H70ZM14.98 19.9874L40 5.62505L65.0201 19.9874H14.98Z" fill="#E1E3EB"></path></svg><div class="loading-progress-bar"><div class="moving-dash"></div></div></div>',1)]),4))}}),jye={class:"graph-info-tooltip-title"},Yye=["title"],Wye={key:1,class:"graph-info-tooltip-sequence-row"},Xye=["title"],Kye={key:0,class:"graph-info-tooltip-icon"},Zye={key:0,"data-theme":"dark",class:"graph-info-tooltip-button"},Jye=48,qye=62.5,e2e=26,t2e=16,I$=24,n2e=20,r2e=d.defineComponent({__name:"DendroTooltip",props:{info:{},tooltipBtn:{},containerRef:{}},emits:["close","tooltip-btn-click"],setup(e,{emit:t}){const n=e,r=Tr(),a=t,i=d.ref();rt.useClickOutside([i],()=>a("close"));const o=d.computed(()=>{const b=k=>r.value.reactive.optionsState.components[k].selectorStates.map(_=>_.selectedSource),C=["tableContent","labels","nodeColor","nodeSize","nodeShape","lineColor"],x=["id"];return C.forEach(k=>{b(k).forEach(P=>{x.includes(P)||x.push(P)})}),x}),s=d.computed(()=>n.info.info[0]),c=d.computed(()=>{var b;return(b=s.value)==null?void 0:b.id}),f=d.computed(()=>{const b=r.value.commonHelpersData.dendroTableData.value;if(!b)return[];const C=b.id.data.findIndex(x=>String(x)===String(c.value));return C!==-1?o.value.map(x=>{var k,_;return{label:b[x].label,value:b[x].data[C],isSequence:((_=(k=b[x].spec)==null?void 0:k.annotations)==null?void 0:_["pl7.app/type"])==="sequence"}}):[]}),A=d.computed(()=>f.value.reduce((b,C)=>b+(C.isSequence?qye:e2e),0)+t2e*2+(n.tooltipBtn?Jye:0)),p=d.computed(()=>({left:n.info.x+n2e+"px",top:n.info.y+I$+"px"})),v=d.computed(()=>{const b=n.containerRef.scrollHeight,C=A.value/2,x=n.info.y+I$;return x<C?-x:b-C<x?-(A.value-(b-x)):-C});function y(b){var C;(C=window==null?void 0:window.navigator)==null||C.clipboard.writeText(b)}return(b,C)=>(d.openBlock(),d.createElementBlock("div",{class:"graph-info-tooltip__container",ref:"",style:d.normalizeStyle(p.value)},[C[3]||(C[3]=d.createElementVNode("div",{class:"graph-info-tooltip__tail"},null,-1)),d.createElementVNode("div",{class:"graph-info-tooltip",ref_key:"rootRef",ref:i,style:d.normalizeStyle({transform:`translate(0,${v.value}px)`}),onClick:C[2]||(C[2]=x=>x.stopPropagation())},[d.createVNode(d.unref(rt.PlMaskIcon24),{class:"graph-info-tooltip-close",name:"close",onClick:C[0]||(C[0]=x=>a("close"))}),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(f.value,x=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["graph-info-tooltip-row",{"graph-info-tooltip-row__sequence":x.isSequence}])},[d.createElementVNode("div",jye,d.toDisplayString(x.label+":"),1),x.isSequence?(d.openBlock(),d.createElementBlock("div",Wye,[d.createElementVNode("div",{class:"graph-info-tooltip-value",title:String(x.value)},d.toDisplayString(x.value),9,Xye),x.isSequence?(d.openBlock(),d.createElementBlock("div",Kye,[d.createVNode(d.unref(rt.PlMaskIcon16),{class:"graph-info-tooltip-clipboard",name:"clipboard",onClick:()=>y(String(x.value))},null,8,["onClick"])])):d.createCommentVNode("",!0)])):(d.openBlock(),d.createElementBlock("div",{key:0,class:"graph-info-tooltip-value",title:String(x.value)},d.toDisplayString(x.value),9,Yye))],2))),256)),b.tooltipBtn?(d.openBlock(),d.createElementBlock("div",Zye,[d.createVNode(d.unref(rt.PlBtnSecondary),{icon:"arrow-right",size:"small",onClick:C[1]||(C[1]=()=>a("tooltip-btn-click",c.value))},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(b.tooltipBtn),1)]),_:1})])):d.createCommentVNode("",!0)],4)],4))}}),a2e={class:"chart_container"},i2e={class:"chart_header"},o2e=["value"],l2e={class:"chart_titleLineSlot"},s2e={key:0,class:"chart_tabBy"},u2e={key:2,style:{position:"absolute",left:"10px",bottom:"10px"}},c2e=d.defineComponent({__name:"Chart",props:{graphStatus:{},graphTitle:{},dendroTooltipButton:{},chartData:{}},emits:["graph-title-update","dendro-node-select","dendro-tooltip-btn-click"],setup(e,{emit:t}){const n=t,r=Tr(),a=e,i=d.ref(a.graphTitle);d.watch(()=>a.graphTitle,x=>{i.value=x});const o=d.computed(()=>{var x;return(x=r.value.reactive.optionsState.components.tabBy)==null?void 0:x.selectorStates[0]}),s=d.computed(()=>{var x;return(x=o.value)==null?void 0:x.selectedSource}),c=d.computed(()=>{var x;return(x=o.value)==null?void 0:x.selectedFilterValue}),f=d.ref(c.value);d.watch(()=>s.value,(x,k)=>{x!==k&&(f.value=c.value)},{immediate:!0});const A=d.computed(()=>r.value.uniqueValuesData.value),p=d.computed(()=>{var x;if(s.value){const k=(x=A.value[s.value])==null?void 0:x.options;return k&&k.sort((_,P)=>_.label>P.label?1:-1),k}else return});d.watch(()=>p.value,x=>{if(x&&x.length&&f.value===void 0){const k=x[0].value;f.value=k,v(k)}},{immediate:!0});function v(x){const k=r.value.reactive.optionsState.components.tabBy.selectorStates;k.length&&(r.value.reactive.optionsState.components.tabBy.selectorStates=[{...k[0],type:"equals",selectedFilterValue:x}])}function y(x){const k=x.currentTarget;i.value=k.value,n("graph-title-update",k.value)}function b(x){n("dendro-node-select",x)}const C=d.ref();return(x,k)=>(d.openBlock(),d.createElementBlock("div",a2e,[d.createElementVNode("div",i2e,[d.createElementVNode("input",{class:"chart_title",value:i.value,onChange:y,onKeyup:k[0]||(k[0]=d.withKeys(_=>{var P;(P=_.target)==null||P.blur()},["enter"]))},null,40,o2e),(d.openBlock(),d.createBlock(d.resolveDynamicComponent(Gye),{class:"chart_titleEdit"})),d.createElementVNode("div",l2e,[d.renderSlot(x.$slots,"default")])]),d.createVNode(d.unref(rt.PlNotificationAlert),{type:"success",modelValue:d.unref(r).reactive.showTooltipHint,"onUpdate:modelValue":k[1]||(k[1]=_=>d.unref(r).reactive.showTooltipHint=_),class:"chart_tooltipHint",width:"170px"},{default:d.withCtx(()=>k[7]||(k[7]=[d.createTextVNode(" Hit enter to pin tooltip ")])),_:1},8,["modelValue"]),s.value?(d.openBlock(),d.createElementBlock("div",s2e,[d.createVNode(d.unref(rt.PlDropdown),{label:"Show for",modelValue:f.value,"onUpdate:modelValue":[k[2]||(k[2]=_=>f.value=_),k[3]||(k[3]=_=>v(_))],options:p.value},null,8,["modelValue","options"])])):d.createCommentVNode("",!0),d.createElementVNode("div",{class:d.normalizeClass(["chart_main-content",{"chart_main-content__dendro":d.unref(r).reactive.chartType==="dendro"}]),ref_key:"chartContainerRef",ref:C},[d.createElementVNode("div",{id:"chartSvgContainer",class:d.normalizeClass({chart_loading:d.unref(r).loading.initialCharts&&x.graphStatus==="ready",chart_noDataMapping:x.graphStatus==="notReady",chart_emptyData:x.graphStatus==="empty",chart_inconsistent:x.graphStatus==="inconsistent"})},[d.unref(r).loading.initialCharts&&x.graphStatus==="ready"?(d.openBlock(),d.createBlock(H$,{key:0})):d.createCommentVNode("",!0)],2),d.unref(r).reactive.chartType==="dendro"&&x.chartData&&d.unref(r).reactive.layersSettings.dendro.showTable?(d.openBlock(),d.createBlock(Oye,{key:0,chartData:x.chartData,onRowSelect:b},null,8,["chartData"])):d.createCommentVNode("",!0),d.unref(r).reactive.dendroInfoByClick?(d.openBlock(),d.createBlock(r2e,{key:1,info:d.unref(r).reactive.dendroInfoByClick,containerRef:C.value,tooltipBtn:x.dendroTooltipButton,onTooltipBtnClick:k[4]||(k[4]=_=>x.$emit("dendro-tooltip-btn-click",_)),onClose:k[5]||(k[5]=_=>{d.unref(r).reactive.dendroInfoByClick=null,x.$emit("dendro-node-select",null)})},null,8,["info","containerRef","tooltipBtn"])):d.createCommentVNode("",!0)],2),x.graphStatus!=="empty"&&d.unref(r).reactive.chartType!=="scatterplot-umap"?(d.openBlock(),d.createBlock(Vye,{key:1})):d.createCommentVNode("",!0),x.graphStatus!=="empty"&&d.unref(r).reactive.chartType==="scatterplot-umap"?(d.openBlock(),d.createElementBlock("div",u2e,[d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:d.unref(r).reactive.lassoMode,"onUpdate:modelValue":k[6]||(k[6]=_=>d.unref(r).reactive.lassoMode=_),label:"Lasso mode"},null,8,["modelValue"])])):d.createCommentVNode("",!0)]))}});function f2e(e,t){return e.parent===t.parent?1:2}function d2e(e){return e.reduce(A2e,0)/e.length}function A2e(e,t){return e+t.x}function p2e(e){return 1+e.reduce(h2e,0)}function h2e(e,t){return Math.max(e,t.y)}function v2e(e){for(var t;t=e.children;)e=t[0];return e}function m2e(e){for(var t;t=e.children;)e=t[t.length-1];return e}function PB(){var e=f2e,t=1,n=1,r=!1;function a(i){var o,s=0;i.eachAfter(function(v){var y=v.children;y?(v.x=d2e(y),v.y=p2e(y)):(v.x=o?s+=e(v,o):0,v.y=0,o=v)});var c=v2e(i),f=m2e(i),A=c.x-e(c,f)/2,p=f.x+e(f,c)/2;return i.eachAfter(r?function(v){v.x=(v.x-i.x)*t,v.y=(i.y-v.y)*n}:function(v){v.x=(v.x-A)/(p-A)*t,v.y=(1-(i.y?v.y/i.y:1))*n})}return a.separation=function(i){return arguments.length?(e=i,a):e},a.size=function(i){return arguments.length?(r=!1,t=+i[0],n=+i[1],a):r?null:[t,n]},a.nodeSize=function(i){return arguments.length?(r=!0,t=+i[0],n=+i[1],a):r?[t,n]:null},a}function g2e(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function y2e(){return this.eachAfter(g2e)}function w2e(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function C2e(e,t){for(var n=this,r=[n],a,i,o=-1;n=r.pop();)if(e.call(t,n,++o,this),a=n.children)for(i=a.length-1;i>=0;--i)r.push(a[i]);return this}function b2e(e,t){for(var n=this,r=[n],a=[],i,o,s,c=-1;n=r.pop();)if(a.push(n),i=n.children)for(o=0,s=i.length;o<s;++o)r.push(i[o]);for(;n=a.pop();)e.call(t,n,++c,this);return this}function E2e(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function x2e(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,a=r&&r.length;--a>=0;)n+=r[a].value;t.value=n})}function S2e(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function B2e(e){for(var t=this,n=k2e(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var a=r.length;e!==n;)r.splice(a,0,e),e=e.parent;return r}function k2e(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),a=null;for(e=n.pop(),t=r.pop();e===t;)a=e,e=n.pop(),t=r.pop();return a}function T2e(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function _2e(){return Array.from(this)}function D2e(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function P2e(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*M2e(){var e=this,t,n=[e],r,a,i;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(a=0,i=r.length;a<i;++a)n.push(r[a]);while(n.length)}function B6(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=R2e)):t===void 0&&(t=I2e);for(var n=new X5(e),r,a=[n],i,o,s,c;r=a.pop();)if((o=t(r.data))&&(c=(o=Array.from(o)).length))for(r.children=o,s=c-1;s>=0;--s)a.push(i=o[s]=new X5(o[s])),i.parent=r,i.depth=r.depth+1;return n.eachBefore(R$)}function H2e(){return B6(this).eachBefore(N2e)}function I2e(e){return e.children}function R2e(e){return Array.isArray(e)?e[1]:null}function N2e(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function R$(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function X5(e){this.data=e,this.depth=this.height=0,this.parent=null}X5.prototype=B6.prototype={constructor:X5,count:y2e,each:w2e,eachAfter:b2e,eachBefore:C2e,find:E2e,sum:x2e,sort:S2e,path:B2e,ancestors:T2e,descendants:_2e,leaves:D2e,links:P2e,copy:H2e,[Symbol.iterator]:M2e};function MB(e){return e==null?null:L2e(e)}function L2e(e){if(typeof e!="function")throw new Error;return e}var $2e={depth:-1},N$={},HB={};function F2e(e){return e.id}function V2e(e){return e.parentId}function L$(){var e=F2e,t=V2e,n;function r(a){var i=Array.from(a),o=e,s=t,c,f,A,p,v,y,b,C,x=new Map;if(n!=null){const k=i.map((N,I)=>O2e(n(N,I,a))),_=k.map($$),P=new Set(k).add("");for(const N of _)P.has(N)||(P.add(N),k.push(N),_.push($$(N)),i.push(HB));o=(N,I)=>k[I],s=(N,I)=>_[I]}for(A=0,c=i.length;A<c;++A)f=i[A],y=i[A]=new X5(f),(b=o(f,A,a))!=null&&(b+="")&&(C=y.id=b,x.set(C,x.has(C)?N$:y)),(b=s(f,A,a))!=null&&(b+="")&&(y.parent=b);for(A=0;A<c;++A)if(y=i[A],b=y.parent){if(v=x.get(b),!v)throw new Error("missing: "+b);if(v===N$)throw new Error("ambiguous: "+b);v.children?v.children.push(y):v.children=[y],y.parent=v}else{if(p)throw new Error("multiple roots");p=y}if(!p)throw new Error("no root");if(n!=null){for(;p.data===HB&&p.children.length===1;)p=p.children[0],--c;for(let k=i.length-1;k>=0&&(y=i[k],y.data===HB);--k)y.data=null}if(p.parent=$2e,p.eachBefore(function(k){k.depth=k.parent.depth+1,--c}).eachBefore(R$),p.parent=null,c>0)throw new Error("cycle");return p}return r.id=function(a){return arguments.length?(e=MB(a),r):e},r.parentId=function(a){return arguments.length?(t=MB(a),r):t},r.path=function(a){return arguments.length?(n=MB(a),r):n},r}function O2e(e){e=`${e}`;let t=e.length;return IB(e,t-1)&&!IB(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function $$(e){let t=e.length;if(t<2)return"";for(;--t>1&&!IB(e,t););return e.slice(0,t)}function IB(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}var sg={},RB={exports:{}},Ia={};/**
36
+ `,_ue=["innerHTML"],Due={class:"dropdown-list-item__title-container"},Pue={class:"dropdown-list-item__title text-s"},Mue={key:0,class:"dropdown-list-item__description text-description"},Hue={key:1,class:"dropdown-list-item__icon flex-self-start"},Iue=d.defineComponent({__name:"DropdownListItem",props:{option:{},isSelected:{type:Boolean,default:!1},size:{default:"small"},isHovered:{type:Boolean,default:!1},useCheckbox:{type:Boolean,default:!1}},setup(e){const t=e,n=d.computed(()=>{const i=[];return t.size==="small"&&i.push("dropdown-list-item__small"),t.isSelected&&i.push("dropdown-list-item__selected"),t.isHovered&&i.push("hovered-item"),i.join(" ")}),r=d.computed(()=>{const i=["dropdown-list-item__checkbox","flex-self-start"];return t.isSelected&&i.push("checked"),i.join(" ")}),a=d.computed(()=>t.isSelected?Tue:kue);return(i,o)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass([n.value,"dropdown-list-item"])},[t.useCheckbox?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(r.value),innerHTML:a.value},null,10,_ue)):d.createCommentVNode("",!0),o[1]||(o[1]=d.createTextVNode()),d.createElementVNode("div",Due,[d.createElementVNode("div",Pue,d.toDisplayString(i.option.label),1),o[0]||(o[0]=d.createTextVNode()),i.option.description?(d.openBlock(),d.createElementBlock("div",Mue,d.toDisplayString(i.option.description),1)):d.createCommentVNode("",!0)]),o[2]||(o[2]=d.createTextVNode()),!t.useCheckbox&&t.isSelected?(d.openBlock(),d.createElementBlock("div",Hue)):d.createCommentVNode("",!0)],2))}});function Rue(e){return e()}function Nue(e){let t=!1;return function(...n){t||(requestAnimationFrame(()=>{e(...n),t=!1}),t=!0)}}function Lue(e){return new Promise(t=>setTimeout(t,e))}function $ue(e,t){const n=setTimeout(e,t);return()=>{clearTimeout(n)}}function Fue(e){return function(t){return 1-e(1-t)}}function Vue(e){const{duration:t,draw:n,timing:r}=e,a=performance.now();let i=!1;return requestAnimationFrame(function o(s){let c=(s-a)/t;(c>1||i)&&(c=1);const f=r(c);n(f),c<1&&requestAnimationFrame(o)}),function(){i=!0}}function Oue(e,t,n=!0){let r=0,a;return function(...i){a=()=>{e.apply(this,i),r=new Date().getTime()+t,a=null,n&&setTimeout(()=>{a==null||a()},t)},new Date().getTime()>r&&a()}}function sL(e){if(!Array.isArray(e))throw Error("Invalid component options: "+String(e));return e.map(t=>({label:"label"in t?t.label:t.text,value:t.value,description:t.description}))}function uL(e,t){const n=Nue(()=>{if(e.value){const{scrollTop:r,scrollLeft:a,scrollHeight:i,scrollWidth:o,clientHeight:s,clientWidth:c}=document.documentElement,f=e.value.getBoundingClientRect();t({scrollTop:r,scrollLeft:a,scrollHeight:i,scrollWidth:o,clientHeight:s,clientWidth:c,offsetY:r+f.y,offsetX:a+f.x,top:f.top,right:f.right,bottom:f.bottom,left:f.left,width:f.width,height:f.height,x:f.x,y:f.y})}});d.onMounted(n),UC(window,"scroll",n,{capture:!0,passive:!0}),UC(window,"resize",n,{passive:!0}),UC(window,"adjust",n,!0)}const Que=d.defineComponent({__name:"PlMaskIcon16",props:{name:{},size:{}},setup(e){const t=e,n=d.computed(()=>t.size==="large"?"--mask-size: 24px":""),r=d.computed(()=>`mask-16 mask-${t.name}`);return(a,i)=>(d.openBlock(),d.createElementBlock("i",{style:d.normalizeStyle(n.value),class:d.normalizeClass([r.value,a.$style.icon])},null,6))}}),zue="_icon_1ugxm_2",Uue={icon:zue},Gue={$style:Uue},cL=l5(Que,[["__cssModules",Gue]]),jue=d.defineComponent({__name:"PlMaskIcon24",props:{name:{},size:{}},setup(e){const t=e,n=d.computed(()=>`mask-24 mask-${t.name}`);return(r,a)=>(d.openBlock(),d.createElementBlock("i",{class:d.normalizeClass([n.value,r.$style.icon])},null,2))}}),Yue="_icon_1ugxm_2",Wue={icon:Yue},Xue={$style:Wue},Kue=l5(jue,[["__cssModules",Xue]]);function Zue(e,t){const n=d.ref();return uL(e,r=>{n.value=r}),d.computed(()=>{const r=d.unref(n),a=d.unref(t),i=a.position??"top",o=a.gap??8;if(!r)return"";const s=r.offsetY+Math.floor(r.height/2),c=r.offsetX+Math.floor(r.width/2);return i==="top-left"?`left: ${r.offsetX}px; top: ${r.offsetY-o}px;`:i==="top"?`left: ${c}px; top: ${r.offsetY-o}px;`:i==="right"?`left: ${r.offsetX+r.width+o}px; top: ${s}px;`:i==="left"?`right: ${r.scrollWidth-r.x+o}px; top: ${s}px;`:i==="southwest"?`left: ${r.offsetX+r.width}px; top: ${r.offsetY+r.height+o}px;`:""})}function fL(e,t){return t(e)}function dL(e,t){if(e!=null)return t(e)}function Jue(e){return Array.isArray(e)?e:[e]}function que(e,t){UC(document,"click",n=>{document.contains(n.target)&&(Jue(e).map(r=>r.value).filter(r=>!!r).some(r=>r==null?void 0:r.contains(n.target))||t())})}const ece={},tce={class:"beak",width:"5",height:"9",viewBox:"0 0 3 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function nce(e,t){return d.openBlock(),d.createElementBlock("svg",tce,t[0]||(t[0]=[d.createElementVNode("path",{d:"M4.00222 8.00933L0 4.00711L4.00222 0.00488281L4.00222 8.00933Z",fill:"#24223D"},null,-1)]))}const rce=l5(ece,[["render",nce]]),jS=new Map,ace={name:"PlTooltip"},ice=d.defineComponent({...ace,props:{openDelay:{default:100},closeDelay:{default:1e3},position:{default:"top"},hide:{type:Boolean},gap:{default:8},element:{default:"div"},maxWidth:{default:"300px"}},emits:["tooltip:close"],setup(e,{emit:t}){const n=t,r=Symbol(),a=e,i=d.reactive({open:!1,over:!1,tooltipOpen:!1,key:Symbol()});jS.set(r,()=>f()),d.watch(()=>i.open,x=>{requestAnimationFrame(()=>{i.tooltipOpen=x})});let o=()=>{};const s=Oue(()=>window.dispatchEvent(new CustomEvent("adjust")),1e3),c=()=>{i.open=!0;for(const[x,k]of jS.entries())x!==r&&k()},f=()=>{i.open=!1,n("tooltip:close")},A=async()=>{a.hide||(s(),i.over=!0,o(),await Lue(100),i.over&&c())},p=()=>{i.over=!1,o=$ue(()=>{i.over||f()},a.closeDelay)};d.watch(()=>a.hide,x=>{x&&f()});const v=d.ref(),y=d.ref(),b=Zue(v,d.toRef(a));que([v,y],()=>f());const C=d.computed(()=>({"--pl-tooltip-max-width":a.maxWidth}));return d.onUnmounted(()=>{jS.delete(r)}),(x,k)=>(d.openBlock(),d.createBlock(d.resolveDynamicComponent(x.element),d.mergeProps(x.$attrs,{ref_key:"rootRef",ref:v,onClick:A,onMouseover:A,onMouseleave:p}),{default:d.withCtx(()=>[d.renderSlot(x.$slots,"default"),k[1]||(k[1]=d.createTextVNode()),x.$slots.tooltip&&i.open?(d.openBlock(),d.createBlock(d.Teleport,{key:0,to:"body"},[d.createVNode(d.Transition,{name:"tooltip-transition"},{default:d.withCtx(()=>[i.tooltipOpen?(d.openBlock(),d.createElementBlock("div",{key:0,class:"pl-tooltip__container",style:d.normalizeStyle(d.unref(b))},[d.createElementVNode("div",{ref_key:"tooltip",ref:y,class:d.normalizeClass(["pl-tooltip",x.position]),style:d.normalizeStyle(C.value),onMouseover:A,onMouseleave:p},[d.createElementVNode("div",null,[d.renderSlot(x.$slots,"tooltip")]),k[0]||(k[0]=d.createTextVNode()),d.createVNode(rce)],38)],4)):d.createCommentVNode("",!0)]),_:3})])):d.createCommentVNode("",!0)]),_:3},16))}}),oce={inheritAttrs:!1},lce={class:"double-contour"};function sce(e,t,n,r,a,i){return d.openBlock(),d.createElementBlock("div",lce,[d.createElementVNode("div",d.normalizeProps(d.guardReactiveProps(e.$attrs)),[d.renderSlot(e.$slots,"default")],16)])}const uce=l5(oce,[["render",sce]]);function cce(e){d.onMounted(e),d.onUpdated(e)}const YS=new WeakMap,WS=new ResizeObserver(e=>{for(const t of e)dL(YS.get(t.target),n=>n(t))});function fce(e,t){YS.set(e,t),WS.unobserve(e),WS.observe(e)}function dce(e){WS.unobserve(e),YS.delete(e)}const Ace=8,AL=4;function pce(e,t="label"){const n=new Set;cce(()=>{dL(e==null?void 0:e.value,r=>{const a=r.querySelector(t);a&&(n.add(a),fce(a,()=>{const i=Rue(()=>a.getBoundingClientRect().width+fL(Ace,o=>Number.isNaN(o)?AL:o+AL));r.style.getPropertyValue("--label-offset-right-x")!==`${i}px`&&r.style.setProperty("--label-offset-right-x",`${i}px`)}))})}),d.onBeforeUnmount(()=>{Array.from(n.values()).map(r=>dce(r))})}const hce=d.defineComponent({__name:"PlIcon16",props:{name:{},size:{}},setup(e){const t=e,n=d.computed(()=>t.size==="large"?"--icon-size: 24px":""),r=d.computed(()=>`icon-16 icon-${t.name}`);return(a,i)=>(d.openBlock(),d.createElementBlock("i",{style:d.normalizeStyle(n.value),class:d.normalizeClass([r.value,a.$style.icon])},null,6))}}),vce="_icon_1ugxm_2",mce={icon:vce},gce={$style:mce},s5=l5(hce,[["__cssModules",gce]]);function pL(e){return e!==null&&typeof e=="object"}function ny(e,t){return pL(e)&&pL(t)?Object.keys(e).length!==Object.keys(t).length?!1:Object.keys(e).every(n=>ny(e[n],t[n])):e===t}const yce=d.defineComponent({__name:"LongText",setup(e){d.useCssVars(A=>({"5deba9de":o.value}));const t=d.ref(!1),n=d.ref(),r=d.ref(!1),a=d.computed(()=>r.value&&t.value?"ui-lt-animate":""),i=gue(A=>r.value=A,500),o=d.computed(()=>{var A;return n.value?`${((A=n.value)==null?void 0:A.innerHTML.length)*.4}s`:"5s"});function s(){const A=lL(n.value,"span cannot be empty");t.value=A.clientWidth<A.scrollWidth}function c(){s(),i(!0)}function f(){i(!1)}return(A,p)=>(d.openBlock(),d.createElementBlock("div",d.mergeProps(A.$attrs,{class:"ui-lt-container"}),[d.createElementVNode("span",{onMouseover:c,onMouseleave:f},[d.createElementVNode("span",{ref_key:"span",ref:n,class:d.normalizeClass(a.value)},[d.renderSlot(A.$slots,"default")],2)],32)],16))}});function wce(e,t){const n=e.scrollTop,r=e.getBoundingClientRect().height,a=t.offsetTop,i=t.getBoundingClientRect().height;return a+i<r+n&&a>n}function Cce(e,t){const n=e.scrollTop,r=e.getBoundingClientRect().height,a=t.offsetTop,i=t.getBoundingClientRect().height;return a+i<r+n?"ceil":a>n?"floor":"visible"}function bce(e,t,n={}){const r=e.scrollTop,a=e.getBoundingClientRect().height,i=t.getBoundingClientRect().height,o=t.offsetTop,s=Cce(e,t);if(s==="visible")return;const c=f=>{const A=s==="floor"?o-(a-i):o;e.scrollTop=r+f*(A-r)};wce(e,t)||Vue({duration:n.duration||100,timing:Fue(f=>f),draw:c})}const Ece=d.defineComponent({__name:"DropdownOverlay",props:{root:{},gap:{}},setup(e,{expose:t}){const n=e,r=d.reactive({optionsHeight:0}),a=d.reactive({top:"0px",left:"0px",width:"0px"}),i=d.toRef(n,"root"),o=d.ref();return t({scrollIntoActive:()=>{const s=o.value;s&&mue(s.querySelector(".hovered-item"),c=>{bce(s,c)})},listRef:o}),d.watch(o,s=>{s&&requestAnimationFrame(()=>{const c=s.getBoundingClientRect();r.optionsHeight=c.height,window.dispatchEvent(new CustomEvent("adjust"))})}),uL(i,s=>{const c=document.body.getBoundingClientRect(),f=s.top-c.top,A=s.left-c.left,p=n.gap??0,v=f+s.height+p;v+r.optionsHeight>s.clientHeight?a.top=f-r.optionsHeight-p+"px":a.top=v+"px",a.left=A+"px",a.width=s.width+"px"}),(s,c)=>(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[d.createElementVNode("div",d.mergeProps({ref_key:"listRef",ref:o},s.$attrs,{style:a,tabindex:"-1"}),[d.renderSlot(s.$slots,"default",{ref:"list"})],16)]))}});typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const hL=()=>{};function xce(e,t){function n(...r){return new Promise((a,i)=>{Promise.resolve(e(()=>t.apply(this,r),{fn:t,thisArg:this,args:r})).then(a).catch(i)})}return n}function Sce(e,t={}){let n,r,a=hL;const i=o=>{clearTimeout(o),a(),a=hL};return o=>{const s=d.toValue(e),c=d.toValue(t.maxWait);return n&&i(n),s<=0||c!==void 0&&c<=0?(r&&(i(r),r=null),Promise.resolve(o())):new Promise((f,A)=>{a=t.rejectOnCancel?A:f,c&&!r&&(r=setTimeout(()=>{n&&i(n),r=null,f(o())},c)),n=setTimeout(()=>{r&&i(r),r=null,f(o())},s)})}}function Bce(e,t=200,n={}){return xce(Sce(t,n),e)}function kce(e,t=200,n={}){const r=d.ref(e.value),a=Bce(()=>{r.value=e.value},t,n);return d.watch(e,()=>a()),r}var li;(function(e){e.assertEqual=a=>a;function t(a){}e.assertIs=t;function n(a){throw new Error}e.assertNever=n,e.arrayToEnum=a=>{const i={};for(const o of a)i[o]=o;return i},e.getValidEnumValues=a=>{const i=e.objectKeys(a).filter(s=>typeof a[a[s]]!="number"),o={};for(const s of i)o[s]=a[s];return e.objectValues(o)},e.objectValues=a=>e.objectKeys(a).map(function(i){return a[i]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&i.push(o);return i},e.find=(a,i)=>{for(const o of a)if(i(o))return o},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function r(a,i=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}e.joinValues=r,e.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(li||(li={}));var XS;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(XS||(XS={}));const vn=li.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),uv=e=>{switch(typeof e){case"undefined":return vn.undefined;case"string":return vn.string;case"number":return isNaN(e)?vn.nan:vn.number;case"boolean":return vn.boolean;case"function":return vn.function;case"bigint":return vn.bigint;case"symbol":return vn.symbol;case"object":return Array.isArray(e)?vn.array:e===null?vn.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?vn.promise:typeof Map<"u"&&e instanceof Map?vn.map:typeof Set<"u"&&e instanceof Set?vn.set:typeof Date<"u"&&e instanceof Date?vn.date:vn.object;default:return vn.unknown}},Ut=li.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Tce=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");let Ip=class ite extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(i){return i.message},r={_errors:[]},a=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let s=r,c=0;for(;c<o.path.length;){const f=o.path[c];c===o.path.length-1?(s[f]=s[f]||{_errors:[]},s[f]._errors.push(n(o))):s[f]=s[f]||{_errors:[]},s=s[f],c++}}};return a(this),r}static assert(t){if(!(t instanceof ite))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,li.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const a of this.issues)a.path.length>0?(n[a.path[0]]=n[a.path[0]]||[],n[a.path[0]].push(t(a))):r.push(t(a));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};Ip.create=e=>new Ip(e);const ry=(e,t)=>{let n;switch(e.code){case Ut.invalid_type:e.received===vn.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Ut.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,li.jsonStringifyReplacer)}`;break;case Ut.unrecognized_keys:n=`Unrecognized key(s) in object: ${li.joinValues(e.keys,", ")}`;break;case Ut.invalid_union:n="Invalid input";break;case Ut.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${li.joinValues(e.options)}`;break;case Ut.invalid_enum_value:n=`Invalid enum value. Expected ${li.joinValues(e.options)}, received '${e.received}'`;break;case Ut.invalid_arguments:n="Invalid function arguments";break;case Ut.invalid_return_type:n="Invalid function return type";break;case Ut.invalid_date:n="Invalid date";break;case Ut.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:li.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Ut.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Ut.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Ut.custom:n="Invalid input";break;case Ut.invalid_intersection_types:n="Intersection results could not be merged";break;case Ut.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Ut.not_finite:n="Number must be finite";break;default:n=t.defaultError,li.assertNever(e)}return{message:n}};let vL=ry;function _ce(e){vL=e}function GC(){return vL}const jC=e=>{const{data:t,path:n,errorMaps:r,issueData:a}=e,i=[...n,...a.path||[]],o={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let s="";const c=r.filter(f=>!!f).slice().reverse();for(const f of c)s=f(o,{data:t,defaultError:s}).message;return{...a,path:i,message:s}},Dce=[];function cn(e,t){const n=GC(),r=jC({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===ry?void 0:ry].filter(a=>!!a)});e.common.issues.push(r)}let gd=class ote{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const a of n){if(a.status==="aborted")return _r;a.status==="dirty"&&t.dirty(),r.push(a.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const a of n){const i=await a.key,o=await a.value;r.push({key:i,value:o})}return ote.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const a of n){const{key:i,value:o}=a;if(i.status==="aborted"||o.status==="aborted")return _r;i.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(r[i.value]=o.value)}return{status:t.value,value:r}}};const _r=Object.freeze({status:"aborted"}),YC=e=>({status:"dirty",value:e}),kf=e=>({status:"valid",value:e}),KS=e=>e.status==="aborted",ZS=e=>e.status==="dirty",u5=e=>e.status==="valid",c5=e=>typeof Promise<"u"&&e instanceof Promise;function WC(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function mL(e,t,n,r,a){if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var jn;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(jn||(jn={}));var f5,d5;let R0=class{constructor(t,n,r,a){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};const gL=(e,t)=>{if(u5(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Ip(e.common.issues);return this._error=n,this._error}}};function Jr(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:a}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:(i,o)=>{var s,c;const{message:f}=e;return i.code==="invalid_enum_value"?{message:f??o.defaultError}:typeof o.data>"u"?{message:(s=f??r)!==null&&s!==void 0?s:o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:(c=f??n)!==null&&c!==void 0?c:o.defaultError}},description:a}}let da=class{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return uv(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:uv(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new gd,ctx:{common:t.parent.common,data:t.data,parsedType:uv(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(c5(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const a={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:uv(t)},i=this._parseSync({data:t,path:a.path,parent:a});return gL(a,i)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:uv(t)},a=this._parse({data:t,path:r.path,parent:r}),i=await(c5(a)?a:Promise.resolve(a));return gL(r,i)}refine(t,n){const r=a=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(a):n;return this._refinement((a,i)=>{const o=t(a),s=()=>i.addIssue({code:Ut.custom,...r(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(t,n){return this._refinement((r,a)=>t(r)?!0:(a.addIssue(typeof n=="function"?n(r,a):n),!1))}_refinement(t){return new Np({schema:this,typeName:wr.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return N0.create(this,this._def)}nullable(){return dv.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return qm.create(this,this._def)}promise(){return oy.create(this,this._def)}or(t){return y5.create([this,t],this._def)}and(t){return w5.create(this,t,this._def)}transform(t){return new Np({...Jr(this._def),schema:this,typeName:wr.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new B5({...Jr(this._def),innerType:this,defaultValue:n,typeName:wr.ZodDefault})}brand(){return new eB({typeName:wr.ZodBranded,type:this,...Jr(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new k5({...Jr(this._def),innerType:this,catchValue:n,typeName:wr.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return tB.create(this,t)}readonly(){return T5.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};const Pce=/^c[^\s-]{8,}$/i,Mce=/^[0-9a-z]+$/,Hce=/^[0-9A-HJKMNP-TV-Z]{26}$/,Ice=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Rce=/^[a-z0-9_-]{21}$/i,Nce=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Lce=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,$ce="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let JS;const Fce=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Vce=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Oce=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,yL="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Qce=new RegExp(`^${yL}$`);function wL(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function zce(e){return new RegExp(`^${wL(e)}$`)}function CL(e){let t=`${yL}T${wL(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function Uce(e,t){return!!((t==="v4"||!t)&&Fce.test(e)||(t==="v6"||!t)&&Vce.test(e))}class Rp extends da{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==vn.string){const a=this._getOrReturnCtx(t);return cn(a,{code:Ut.invalid_type,expected:vn.string,received:a.parsedType}),_r}const n=new gd;let r;for(const a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(r=this._getOrReturnCtx(t,r),cn(r,{code:Ut.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")t.data.length>a.value&&(r=this._getOrReturnCtx(t,r),cn(r,{code:Ut.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const i=t.data.length>a.value,o=t.data.length<a.value;(i||o)&&(r=this._getOrReturnCtx(t,r),i?cn(r,{code:Ut.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&cn(r,{code:Ut.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")Lce.test(t.data)||(r=this._getOrReturnCtx(t,r),cn(r,{validation:"email",code:Ut.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")JS||(JS=new RegExp($ce,"u")),JS.test(t.data)||(r=this._getOrReturnCtx(t,r),cn(r,{validation:"emoji",code:Ut.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")Ice.test(t.data)||(r=this._getOrReturnCtx(t,r),cn(r,{validation:"uuid",code:Ut.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")Rce.test(t.data)||(r=this._getOrReturnCtx(t,r),cn(r,{validation:"nanoid",code:Ut.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")Pce.test(t.data)||(r=this._getOrReturnCtx(t,r),cn(r,{validation:"cuid",code:Ut.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")Mce.test(t.data)||(r=this._getOrReturnCtx(t,r),cn(r,{validation:"cuid2",code:Ut.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")Hce.test(t.data)||(r=this._getOrReturnCtx(t,r),cn(r,{validation:"ulid",code:Ut.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),cn(r,{validation:"url",code:Ut.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),cn(r,{validation:"regex",code:Ut.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(r=this._getOrReturnCtx(t,r),cn(r,{code:Ut.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(r=this._getOrReturnCtx(t,r),cn(r,{code:Ut.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(r=this._getOrReturnCtx(t,r),cn(r,{code:Ut.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?CL(a).test(t.data)||(r=this._getOrReturnCtx(t,r),cn(r,{code:Ut.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?Qce.test(t.data)||(r=this._getOrReturnCtx(t,r),cn(r,{code:Ut.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?zce(a).test(t.data)||(r=this._getOrReturnCtx(t,r),cn(r,{code:Ut.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?Nce.test(t.data)||(r=this._getOrReturnCtx(t,r),cn(r,{validation:"duration",code:Ut.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?Uce(t.data,a.version)||(r=this._getOrReturnCtx(t,r),cn(r,{validation:"ip",code:Ut.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?Oce.test(t.data)||(r=this._getOrReturnCtx(t,r),cn(r,{validation:"base64",code:Ut.invalid_string,message:a.message}),n.dirty()):li.assertNever(a);return{status:n.value,value:t.data}}_regex(t,n,r){return this.refinement(a=>t.test(a),{validation:n,code:Ut.invalid_string,...jn.errToObj(r)})}_addCheck(t){return new Rp({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...jn.errToObj(t)})}url(t){return this._addCheck({kind:"url",...jn.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...jn.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...jn.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...jn.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...jn.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...jn.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...jn.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...jn.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...jn.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...jn.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...jn.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...jn.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...jn.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...jn.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...jn.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...jn.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...jn.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...jn.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...jn.errToObj(n)})}nonempty(t){return this.min(1,jn.errToObj(t))}trim(){return new Rp({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Rp({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Rp({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Rp.create=e=>{var t;return new Rp({checks:[],typeName:wr.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Jr(e)})};function Gce(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,a=n>r?n:r,i=parseInt(e.toFixed(a).replace(".","")),o=parseInt(t.toFixed(a).replace(".",""));return i%o/Math.pow(10,a)}let A5=class $I extends da{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==vn.number){const a=this._getOrReturnCtx(t);return cn(a,{code:Ut.invalid_type,expected:vn.number,received:a.parsedType}),_r}let n;const r=new gd;for(const a of this._def.checks)a.kind==="int"?li.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),cn(n,{code:Ut.invalid_type,expected:"integer",received:"float",message:a.message}),r.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),cn(n,{code:Ut.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),cn(n,{code:Ut.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):a.kind==="multipleOf"?Gce(t.data,a.value)!==0&&(n=this._getOrReturnCtx(t,n),cn(n,{code:Ut.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),cn(n,{code:Ut.not_finite,message:a.message}),r.dirty()):li.assertNever(a);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,jn.toString(n))}gt(t,n){return this.setLimit("min",t,!1,jn.toString(n))}lte(t,n){return this.setLimit("max",t,!0,jn.toString(n))}lt(t,n){return this.setLimit("max",t,!1,jn.toString(n))}setLimit(t,n,r,a){return new $I({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:jn.toString(a)}]})}_addCheck(t){return new $I({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:jn.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:jn.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:jn.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:jn.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:jn.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:jn.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:jn.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:jn.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:jn.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&li.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}};A5.create=e=>new A5({checks:[],typeName:wr.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Jr(e)});let p5=class FI extends da{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==vn.bigint){const a=this._getOrReturnCtx(t);return cn(a,{code:Ut.invalid_type,expected:vn.bigint,received:a.parsedType}),_r}let n;const r=new gd;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),cn(n,{code:Ut.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),cn(n,{code:Ut.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),cn(n,{code:Ut.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):li.assertNever(a);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,jn.toString(n))}gt(t,n){return this.setLimit("min",t,!1,jn.toString(n))}lte(t,n){return this.setLimit("max",t,!0,jn.toString(n))}lt(t,n){return this.setLimit("max",t,!1,jn.toString(n))}setLimit(t,n,r,a){return new FI({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:jn.toString(a)}]})}_addCheck(t){return new FI({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:jn.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:jn.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:jn.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:jn.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:jn.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};p5.create=e=>{var t;return new p5({checks:[],typeName:wr.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Jr(e)})};let h5=class extends da{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==vn.boolean){const n=this._getOrReturnCtx(t);return cn(n,{code:Ut.invalid_type,expected:vn.boolean,received:n.parsedType}),_r}return kf(t.data)}};h5.create=e=>new h5({typeName:wr.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Jr(e)});let v5=class lte extends da{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==vn.date){const a=this._getOrReturnCtx(t);return cn(a,{code:Ut.invalid_type,expected:vn.date,received:a.parsedType}),_r}if(isNaN(t.data.getTime())){const a=this._getOrReturnCtx(t);return cn(a,{code:Ut.invalid_date}),_r}const n=new gd;let r;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(r=this._getOrReturnCtx(t,r),cn(r,{code:Ut.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(r=this._getOrReturnCtx(t,r),cn(r,{code:Ut.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):li.assertNever(a);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new lte({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:jn.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:jn.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};v5.create=e=>new v5({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:wr.ZodDate,...Jr(e)});let XC=class extends da{_parse(t){if(this._getType(t)!==vn.symbol){const n=this._getOrReturnCtx(t);return cn(n,{code:Ut.invalid_type,expected:vn.symbol,received:n.parsedType}),_r}return kf(t.data)}};XC.create=e=>new XC({typeName:wr.ZodSymbol,...Jr(e)});class m5 extends da{_parse(t){if(this._getType(t)!==vn.undefined){const n=this._getOrReturnCtx(t);return cn(n,{code:Ut.invalid_type,expected:vn.undefined,received:n.parsedType}),_r}return kf(t.data)}}m5.create=e=>new m5({typeName:wr.ZodUndefined,...Jr(e)});class g5 extends da{_parse(t){if(this._getType(t)!==vn.null){const n=this._getOrReturnCtx(t);return cn(n,{code:Ut.invalid_type,expected:vn.null,received:n.parsedType}),_r}return kf(t.data)}}g5.create=e=>new g5({typeName:wr.ZodNull,...Jr(e)});let ay=class extends da{constructor(){super(...arguments),this._any=!0}_parse(t){return kf(t.data)}};ay.create=e=>new ay({typeName:wr.ZodAny,...Jr(e)});let Jm=class extends da{constructor(){super(...arguments),this._unknown=!0}_parse(t){return kf(t.data)}};Jm.create=e=>new Jm({typeName:wr.ZodUnknown,...Jr(e)});class Oh extends da{_parse(t){const n=this._getOrReturnCtx(t);return cn(n,{code:Ut.invalid_type,expected:vn.never,received:n.parsedType}),_r}}Oh.create=e=>new Oh({typeName:wr.ZodNever,...Jr(e)});class KC extends da{_parse(t){if(this._getType(t)!==vn.undefined){const n=this._getOrReturnCtx(t);return cn(n,{code:Ut.invalid_type,expected:vn.void,received:n.parsedType}),_r}return kf(t.data)}}KC.create=e=>new KC({typeName:wr.ZodVoid,...Jr(e)});let qm=class Jx extends da{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),a=this._def;if(n.parsedType!==vn.array)return cn(n,{code:Ut.invalid_type,expected:vn.array,received:n.parsedType}),_r;if(a.exactLength!==null){const o=n.data.length>a.exactLength.value,s=n.data.length<a.exactLength.value;(o||s)&&(cn(n,{code:o?Ut.too_big:Ut.too_small,minimum:s?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&n.data.length<a.minLength.value&&(cn(n,{code:Ut.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&n.data.length>a.maxLength.value&&(cn(n,{code:Ut.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,s)=>a.type._parseAsync(new R0(n,o,n.path,s)))).then(o=>gd.mergeArray(r,o));const i=[...n.data].map((o,s)=>a.type._parseSync(new R0(n,o,n.path,s)));return gd.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new Jx({...this._def,minLength:{value:t,message:jn.toString(n)}})}max(t,n){return new Jx({...this._def,maxLength:{value:t,message:jn.toString(n)}})}length(t,n){return new Jx({...this._def,exactLength:{value:t,message:jn.toString(n)}})}nonempty(t){return this.min(1,t)}};qm.create=(e,t)=>new qm({type:e,minLength:null,maxLength:null,exactLength:null,typeName:wr.ZodArray,...Jr(t)});function iy(e){if(e instanceof IA){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=N0.create(iy(r))}return new IA({...e._def,shape:()=>t})}else return e instanceof qm?new qm({...e._def,type:iy(e.element)}):e instanceof N0?N0.create(iy(e.unwrap())):e instanceof dv?dv.create(iy(e.unwrap())):e instanceof fv?fv.create(e.items.map(t=>iy(t))):e}let IA=class B0 extends da{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=li.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==vn.object){const c=this._getOrReturnCtx(t);return cn(c,{code:Ut.invalid_type,expected:vn.object,received:c.parsedType}),_r}const{status:n,ctx:r}=this._processInputParams(t),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof Oh&&this._def.unknownKeys==="strip"))for(const c in r.data)i.includes(c)||o.push(c);const s=[];for(const c of i){const f=a[c],A=r.data[c];s.push({key:{status:"valid",value:c},value:f._parse(new R0(r,A,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof Oh){const c=this._def.unknownKeys;if(c==="passthrough")for(const f of o)s.push({key:{status:"valid",value:f},value:{status:"valid",value:r.data[f]}});else if(c==="strict")o.length>0&&(cn(r,{code:Ut.unrecognized_keys,keys:o}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const f of o){const A=r.data[f];s.push({key:{status:"valid",value:f},value:c._parse(new R0(r,A,r.path,f)),alwaysSet:f in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const c=[];for(const f of s){const A=await f.key,p=await f.value;c.push({key:A,value:p,alwaysSet:f.alwaysSet})}return c}).then(c=>gd.mergeObjectSync(n,c)):gd.mergeObjectSync(n,s)}get shape(){return this._def.shape()}strict(t){return jn.errToObj,new B0({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var a,i,o,s;const c=(o=(i=(a=this._def).errorMap)===null||i===void 0?void 0:i.call(a,n,r).message)!==null&&o!==void 0?o:r.defaultError;return n.code==="unrecognized_keys"?{message:(s=jn.errToObj(t).message)!==null&&s!==void 0?s:c}:{message:c}}}:{}})}strip(){return new B0({...this._def,unknownKeys:"strip"})}passthrough(){return new B0({...this._def,unknownKeys:"passthrough"})}extend(t){return new B0({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new B0({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:wr.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new B0({...this._def,catchall:t})}pick(t){const n={};return li.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new B0({...this._def,shape:()=>n})}omit(t){const n={};return li.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new B0({...this._def,shape:()=>n})}deepPartial(){return iy(this)}partial(t){const n={};return li.objectKeys(this.shape).forEach(r=>{const a=this.shape[r];t&&!t[r]?n[r]=a:n[r]=a.optional()}),new B0({...this._def,shape:()=>n})}required(t){const n={};return li.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof N0;)a=a._def.innerType;n[r]=a}}),new B0({...this._def,shape:()=>n})}keyof(){return EL(li.objectKeys(this.shape))}};IA.create=(e,t)=>new IA({shape:()=>e,unknownKeys:"strip",catchall:Oh.create(),typeName:wr.ZodObject,...Jr(t)}),IA.strictCreate=(e,t)=>new IA({shape:()=>e,unknownKeys:"strict",catchall:Oh.create(),typeName:wr.ZodObject,...Jr(t)}),IA.lazycreate=(e,t)=>new IA({shape:e,unknownKeys:"strip",catchall:Oh.create(),typeName:wr.ZodObject,...Jr(t)});class y5 extends da{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function a(i){for(const s of i)if(s.result.status==="valid")return s.result;for(const s of i)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;const o=i.map(s=>new Ip(s.ctx.common.issues));return cn(n,{code:Ut.invalid_union,unionErrors:o}),_r}if(n.common.async)return Promise.all(r.map(async i=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(a);{let i;const o=[];for(const c of r){const f={...n,common:{...n.common,issues:[]},parent:null},A=c._parseSync({data:n.data,path:n.path,parent:f});if(A.status==="valid")return A;A.status==="dirty"&&!i&&(i={result:A,ctx:f}),f.common.issues.length&&o.push(f.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const s=o.map(c=>new Ip(c));return cn(n,{code:Ut.invalid_union,unionErrors:s}),_r}}get options(){return this._def.options}}y5.create=(e,t)=>new y5({options:e,typeName:wr.ZodUnion,...Jr(t)});const cv=e=>e instanceof b5?cv(e.schema):e instanceof Np?cv(e.innerType()):e instanceof E5?[e.value]:e instanceof x5?e.options:e instanceof S5?li.objectValues(e.enum):e instanceof B5?cv(e._def.innerType):e instanceof m5?[void 0]:e instanceof g5?[null]:e instanceof N0?[void 0,...cv(e.unwrap())]:e instanceof dv?[null,...cv(e.unwrap())]:e instanceof eB||e instanceof T5?cv(e.unwrap()):e instanceof k5?cv(e._def.innerType):[];class ZC extends da{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==vn.object)return cn(n,{code:Ut.invalid_type,expected:vn.object,received:n.parsedType}),_r;const r=this.discriminator,a=n.data[r],i=this.optionsMap.get(a);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(cn(n,{code:Ut.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),_r)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const a=new Map;for(const i of n){const o=cv(i.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const s of o){if(a.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);a.set(s,i)}}return new ZC({typeName:wr.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:a,...Jr(r)})}}function qS(e,t){const n=uv(e),r=uv(t);if(e===t)return{valid:!0,data:e};if(n===vn.object&&r===vn.object){const a=li.objectKeys(t),i=li.objectKeys(e).filter(s=>a.indexOf(s)!==-1),o={...e,...t};for(const s of i){const c=qS(e[s],t[s]);if(!c.valid)return{valid:!1};o[s]=c.data}return{valid:!0,data:o}}else if(n===vn.array&&r===vn.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let i=0;i<e.length;i++){const o=e[i],s=t[i],c=qS(o,s);if(!c.valid)return{valid:!1};a.push(c.data)}return{valid:!0,data:a}}else return n===vn.date&&r===vn.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class w5 extends da{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=(i,o)=>{if(KS(i)||KS(o))return _r;const s=qS(i.value,o.value);return s.valid?((ZS(i)||ZS(o))&&n.dirty(),{status:n.value,value:s.data}):(cn(r,{code:Ut.invalid_intersection_types}),_r)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,o])=>a(i,o)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}w5.create=(e,t,n)=>new w5({left:e,right:t,typeName:wr.ZodIntersection,...Jr(n)});let fv=class ste extends da{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==vn.array)return cn(r,{code:Ut.invalid_type,expected:vn.array,received:r.parsedType}),_r;if(r.data.length<this._def.items.length)return cn(r,{code:Ut.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_r;!this._def.rest&&r.data.length>this._def.items.length&&(cn(r,{code:Ut.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const a=[...r.data].map((i,o)=>{const s=this._def.items[o]||this._def.rest;return s?s._parse(new R0(r,i,r.path,o)):null}).filter(i=>!!i);return r.common.async?Promise.all(a).then(i=>gd.mergeArray(n,i)):gd.mergeArray(n,a)}get items(){return this._def.items}rest(t){return new ste({...this._def,rest:t})}};fv.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new fv({items:e,typeName:wr.ZodTuple,rest:null,...Jr(t)})};class C5 extends da{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==vn.object)return cn(r,{code:Ut.invalid_type,expected:vn.object,received:r.parsedType}),_r;const a=[],i=this._def.keyType,o=this._def.valueType;for(const s in r.data)a.push({key:i._parse(new R0(r,s,r.path,s)),value:o._parse(new R0(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?gd.mergeObjectAsync(n,a):gd.mergeObjectSync(n,a)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof da?new C5({keyType:t,valueType:n,typeName:wr.ZodRecord,...Jr(r)}):new C5({keyType:Rp.create(),valueType:t,typeName:wr.ZodRecord,...Jr(n)})}}let JC=class extends da{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==vn.map)return cn(r,{code:Ut.invalid_type,expected:vn.map,received:r.parsedType}),_r;const a=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([s,c],f)=>({key:a._parse(new R0(r,s,r.path,[f,"key"])),value:i._parse(new R0(r,c,r.path,[f,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const c of o){const f=await c.key,A=await c.value;if(f.status==="aborted"||A.status==="aborted")return _r;(f.status==="dirty"||A.status==="dirty")&&n.dirty(),s.set(f.value,A.value)}return{status:n.value,value:s}})}else{const s=new Map;for(const c of o){const f=c.key,A=c.value;if(f.status==="aborted"||A.status==="aborted")return _r;(f.status==="dirty"||A.status==="dirty")&&n.dirty(),s.set(f.value,A.value)}return{status:n.value,value:s}}}};JC.create=(e,t,n)=>new JC({valueType:t,keyType:e,typeName:wr.ZodMap,...Jr(n)});class eg extends da{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==vn.set)return cn(r,{code:Ut.invalid_type,expected:vn.set,received:r.parsedType}),_r;const a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(cn(r,{code:Ut.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),n.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(cn(r,{code:Ut.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),n.dirty());const i=this._def.valueType;function o(c){const f=new Set;for(const A of c){if(A.status==="aborted")return _r;A.status==="dirty"&&n.dirty(),f.add(A.value)}return{status:n.value,value:f}}const s=[...r.data.values()].map((c,f)=>i._parse(new R0(r,c,r.path,f)));return r.common.async?Promise.all(s).then(c=>o(c)):o(s)}min(t,n){return new eg({...this._def,minSize:{value:t,message:jn.toString(n)}})}max(t,n){return new eg({...this._def,maxSize:{value:t,message:jn.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}eg.create=(e,t)=>new eg({valueType:e,minSize:null,maxSize:null,typeName:wr.ZodSet,...Jr(t)});let bL=class qx extends da{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==vn.function)return cn(n,{code:Ut.invalid_type,expected:vn.function,received:n.parsedType}),_r;function r(s,c){return jC({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,GC(),ry].filter(f=>!!f),issueData:{code:Ut.invalid_arguments,argumentsError:c}})}function a(s,c){return jC({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,GC(),ry].filter(f=>!!f),issueData:{code:Ut.invalid_return_type,returnTypeError:c}})}const i={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof oy){const s=this;return kf(async function(...c){const f=new Ip([]),A=await s._def.args.parseAsync(c,i).catch(v=>{throw f.addIssue(r(c,v)),f}),p=await Reflect.apply(o,this,A);return await s._def.returns._def.type.parseAsync(p,i).catch(v=>{throw f.addIssue(a(p,v)),f})})}else{const s=this;return kf(function(...c){const f=s._def.args.safeParse(c,i);if(!f.success)throw new Ip([r(c,f.error)]);const A=Reflect.apply(o,this,f.data),p=s._def.returns.safeParse(A,i);if(!p.success)throw new Ip([a(A,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new qx({...this._def,args:fv.create(t).rest(Jm.create())})}returns(t){return new qx({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new qx({args:t||fv.create([]).rest(Jm.create()),returns:n||Jm.create(),typeName:wr.ZodFunction,...Jr(r)})}};class b5 extends da{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}b5.create=(e,t)=>new b5({getter:e,typeName:wr.ZodLazy,...Jr(t)});class E5 extends da{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return cn(n,{received:n.data,code:Ut.invalid_literal,expected:this._def.value}),_r}return{status:"valid",value:t.data}}get value(){return this._def.value}}E5.create=(e,t)=>new E5({value:e,typeName:wr.ZodLiteral,...Jr(t)});function EL(e,t){return new x5({values:e,typeName:wr.ZodEnum,...Jr(t)})}let x5=class VI extends da{constructor(){super(...arguments),f5.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return cn(n,{expected:li.joinValues(r),received:n.parsedType,code:Ut.invalid_type}),_r}if(WC(this,f5)||mL(this,f5,new Set(this._def.values)),!WC(this,f5).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return cn(n,{received:n.data,code:Ut.invalid_enum_value,options:r}),_r}return kf(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return VI.create(t,{...this._def,...n})}exclude(t,n=this._def){return VI.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}};f5=new WeakMap,x5.create=EL;let S5=class extends da{constructor(){super(...arguments),d5.set(this,void 0)}_parse(t){const n=li.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==vn.string&&r.parsedType!==vn.number){const a=li.objectValues(n);return cn(r,{expected:li.joinValues(a),received:r.parsedType,code:Ut.invalid_type}),_r}if(WC(this,d5)||mL(this,d5,new Set(li.getValidEnumValues(this._def.values))),!WC(this,d5).has(t.data)){const a=li.objectValues(n);return cn(r,{received:r.data,code:Ut.invalid_enum_value,options:a}),_r}return kf(t.data)}get enum(){return this._def.values}};d5=new WeakMap,S5.create=(e,t)=>new S5({values:e,typeName:wr.ZodNativeEnum,...Jr(t)});class oy extends da{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==vn.promise&&n.common.async===!1)return cn(n,{code:Ut.invalid_type,expected:vn.promise,received:n.parsedType}),_r;const r=n.parsedType===vn.promise?n.data:Promise.resolve(n.data);return kf(r.then(a=>this._def.type.parseAsync(a,{path:n.path,errorMap:n.common.contextualErrorMap})))}}oy.create=(e,t)=>new oy({type:e,typeName:wr.ZodPromise,...Jr(t)});let Np=class extends da{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===wr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=this._def.effect||null,i={addIssue:o=>{cn(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const o=a.transform(r.data,i);if(r.common.async)return Promise.resolve(o).then(async s=>{if(n.value==="aborted")return _r;const c=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return c.status==="aborted"?_r:c.status==="dirty"||n.value==="dirty"?YC(c.value):c});{if(n.value==="aborted")return _r;const s=this._def.schema._parseSync({data:o,path:r.path,parent:r});return s.status==="aborted"?_r:s.status==="dirty"||n.value==="dirty"?YC(s.value):s}}if(a.type==="refinement"){const o=s=>{const c=a.refinement(s,i);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?_r:(s.status==="dirty"&&n.dirty(),o(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?_r:(s.status==="dirty"&&n.dirty(),o(s.value).then(()=>({status:n.value,value:s.value}))))}if(a.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!u5(o))return o;const s=a.transform(o.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>u5(o)?Promise.resolve(a.transform(o.value,i)).then(s=>({status:n.value,value:s})):o);li.assertNever(a)}};Np.create=(e,t,n)=>new Np({schema:e,typeName:wr.ZodEffects,effect:t,...Jr(n)}),Np.createWithPreprocess=(e,t,n)=>new Np({schema:t,effect:{type:"preprocess",transform:e},typeName:wr.ZodEffects,...Jr(n)});let N0=class extends da{_parse(t){return this._getType(t)===vn.undefined?kf(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};N0.create=(e,t)=>new N0({innerType:e,typeName:wr.ZodOptional,...Jr(t)});class dv extends da{_parse(t){return this._getType(t)===vn.null?kf(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}dv.create=(e,t)=>new dv({innerType:e,typeName:wr.ZodNullable,...Jr(t)});let B5=class extends da{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===vn.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};B5.create=(e,t)=>new B5({innerType:e,typeName:wr.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Jr(t)});class k5 extends da{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return c5(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ip(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Ip(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}k5.create=(e,t)=>new k5({innerType:e,typeName:wr.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Jr(t)});class qC extends da{_parse(t){if(this._getType(t)!==vn.nan){const n=this._getOrReturnCtx(t);return cn(n,{code:Ut.invalid_type,expected:vn.nan,received:n.parsedType}),_r}return{status:"valid",value:t.data}}}qC.create=e=>new qC({typeName:wr.ZodNaN,...Jr(e)});const jce=Symbol("zod_brand");class eB extends da{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}let tB=class ute extends da{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?_r:a.status==="dirty"?(n.dirty(),YC(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?_r:a.status==="dirty"?(n.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(t,n){return new ute({in:t,out:n,typeName:wr.ZodPipeline})}},T5=class extends da{_parse(t){const n=this._def.innerType._parse(t),r=a=>(u5(a)&&(a.value=Object.freeze(a.value)),a);return c5(n)?n.then(a=>r(a)):r(n)}unwrap(){return this._def.innerType}};T5.create=(e,t)=>new T5({innerType:e,typeName:wr.ZodReadonly,...Jr(t)});function xL(e,t={},n){return e?ay.create().superRefine((r,a)=>{var i,o;if(!e(r)){const s=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,c=(o=(i=s.fatal)!==null&&i!==void 0?i:n)!==null&&o!==void 0?o:!0,f=typeof s=="string"?{message:s}:s;a.addIssue({code:"custom",...f,fatal:c})}}):ay.create()}const Yce={object:IA.lazycreate};var wr;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(wr||(wr={}));const Wce=(e,t={message:`Input not instance of ${e.name}`})=>xL(n=>n instanceof e,t),SL=Rp.create,BL=A5.create,Xce=qC.create,Kce=p5.create,kL=h5.create,Zce=v5.create,Jce=XC.create,qce=m5.create,efe=g5.create,tfe=ay.create,nfe=Jm.create,rfe=Oh.create,afe=KC.create,ife=qm.create,ofe=IA.create,lfe=IA.strictCreate,sfe=y5.create,ufe=ZC.create,cfe=w5.create,ffe=fv.create,dfe=C5.create,Afe=JC.create,pfe=eg.create,hfe=bL.create,vfe=b5.create,mfe=E5.create,gfe=x5.create,yfe=S5.create,wfe=oy.create,TL=Np.create,Cfe=N0.create,bfe=dv.create,Efe=Np.createWithPreprocess,xfe=tB.create;var qa=Object.freeze({__proto__:null,defaultErrorMap:ry,setErrorMap:_ce,getErrorMap:GC,makeIssue:jC,EMPTY_PATH:Dce,addIssueToContext:cn,ParseStatus:gd,INVALID:_r,DIRTY:YC,OK:kf,isAborted:KS,isDirty:ZS,isValid:u5,isAsync:c5,get util(){return li},get objectUtil(){return XS},ZodParsedType:vn,getParsedType:uv,ZodType:da,datetimeRegex:CL,ZodString:Rp,ZodNumber:A5,ZodBigInt:p5,ZodBoolean:h5,ZodDate:v5,ZodSymbol:XC,ZodUndefined:m5,ZodNull:g5,ZodAny:ay,ZodUnknown:Jm,ZodNever:Oh,ZodVoid:KC,ZodArray:qm,ZodObject:IA,ZodUnion:y5,ZodDiscriminatedUnion:ZC,ZodIntersection:w5,ZodTuple:fv,ZodRecord:C5,ZodMap:JC,ZodSet:eg,ZodFunction:bL,ZodLazy:b5,ZodLiteral:E5,ZodEnum:x5,ZodNativeEnum:S5,ZodPromise:oy,ZodEffects:Np,ZodTransformer:Np,ZodOptional:N0,ZodNullable:dv,ZodDefault:B5,ZodCatch:k5,ZodNaN:qC,BRAND:jce,ZodBranded:eB,ZodPipeline:tB,ZodReadonly:T5,custom:xL,Schema:da,ZodSchema:da,late:Yce,get ZodFirstPartyTypeKind(){return wr},coerce:{string:e=>Rp.create({...e,coerce:!0}),number:e=>A5.create({...e,coerce:!0}),boolean:e=>h5.create({...e,coerce:!0}),bigint:e=>p5.create({...e,coerce:!0}),date:e=>v5.create({...e,coerce:!0})},any:tfe,array:ife,bigint:Kce,boolean:kL,date:Zce,discriminatedUnion:ufe,effect:TL,enum:gfe,function:hfe,instanceof:Wce,intersection:cfe,lazy:vfe,literal:mfe,map:Afe,nan:Xce,nativeEnum:yfe,never:rfe,null:efe,nullable:bfe,number:BL,object:ofe,oboolean:()=>kL().optional(),onumber:()=>BL().optional(),optional:Cfe,ostring:()=>SL().optional(),pipeline:xfe,preprocess:Efe,promise:wfe,record:dfe,set:pfe,strictObject:lfe,string:SL,symbol:Jce,transformer:TL,tuple:ffe,undefined:qce,union:sfe,unknown:nfe,void:afe,NEVER:_r,ZodIssueCode:Ut,quotelessJson:Tce,ZodError:Ip});qa.object({__isRef:qa.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:qa.string().describe("Upstream block id"),name:qa.string().describe("Name of the output provided to the upstream block's output context"),requireEnrichments:qa.literal(!0).optional().describe("True if current block that stores this reference in its args, may need enrichments for the references value originating from the blocks in between current and referenced block")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").readonly(),qa.string().length(24).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");var _L={exports:{}};(function(e,t){t=e.exports=n,t.getSerialize=r;function n(a,i,o,s){return JSON.stringify(a,r(i,s),o)}function r(a,i){var o=[],s=[];return i==null&&(i=function(c,f){return o[0]===f?"[Circular ~]":"[Circular ~."+s.slice(0,o.indexOf(f)).join(".")+"]"}),function(c,f){if(o.length>0){var A=o.indexOf(this);~A?o.splice(A+1):o.push(this),~A?s.splice(A,1/0,c):s.push(c),~o.indexOf(f)&&(f=i.call(this,c,f))}else o.push(f);return a==null?f:a.call(this,c,f)}}})(_L,_L.exports);const Sfe=qa.object({type:qa.literal("PlError"),name:qa.string(),message:qa.string(),fullMessage:qa.string().optional(),stack:qa.string().optional()}),Bfe=Sfe.extend({cause:qa.lazy(()=>e6).optional(),errors:qa.lazy(()=>e6.array()).optional()}),kfe=qa.object({type:qa.literal("StandardError"),name:qa.string(),message:qa.string(),stack:qa.string().optional()}),Tfe=kfe.extend({cause:qa.lazy(()=>e6).optional(),errors:qa.lazy(()=>e6.array()).optional()}),e6=qa.union([Tfe,Bfe]),_fe=qa.object({name:qa.string(),message:qa.string(),fullMessage:qa.string().optional(),stack:qa.string().optional()}),DL=_fe.extend({cause:qa.lazy(()=>DL).optional(),errors:qa.lazy(()=>DL.array()).optional()}),Dfe=qa.object({type:qa.string(),importance:qa.number().optional(),id:qa.string().optional(),label:qa.string()});qa.array(Dfe);function PL(e,t,n){const r=d.ref(0),a=d.reactive({loading:d.computed(()=>r.value>0),loadingRef:r,value:void 0,error:void 0}),i=yue(t);return d.watch(e,async o=>{a.error=void 0,r.value++,i(o).then(s=>{s.ok&&(a.value=s.value)}).catch(s=>{a.value=void 0,a.error=s}).finally(()=>{r.value--})},Object.assign({immediate:!0,deep:!0},{})),a}const Pfe=["tabindex"],Mfe={class:"pl-autocomplete__container"},Hfe={class:"pl-autocomplete__field"},Ife=["disabled","placeholder"],Rfe={key:0,class:"input-value"},Nfe={class:"pl-autocomplete__controls"},Lfe={key:2,class:"arrow-icon arrow-icon-default"},$fe={key:0},Ffe={key:0,class:"required-icon"},Vfe={key:0,class:"nothing-found"},Ofe={key:0,class:"pl-autocomplete__error"},Qfe={key:1,class:"pl-autocomplete__helper"},zfe={key:2,class:"pl-autocomplete__helper"},Ufe={name:"PlAutocomplete"},t6=d.defineComponent({...Ufe,props:d.mergeModels({optionsSearch:{},modelSearch:{type:Function,default:void 0},label:{default:""},helper:{default:void 0},loadingOptionsHelper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},clearable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},arrowIcon:{default:void 0},arrowIconLarge:{default:void 0},optionSize:{default:"small"},formatValue:{type:Function,default:e=>String(e)}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=d.useModel(e,"modelValue"),n=e,r=d.useSlots(),a=d.ref(),i=d.ref(),o=d.useTemplateRef("overlay"),s=d.ref(null),c=d.reactive({activeIndex:-1,open:!1}),f=()=>fL(y.value.findIndex(he=>ny(he.value,t.value)),he=>he<0?0:he),A=()=>c.activeIndex=f(),p=d.ref([]),v=d.ref(),y=d.computed(()=>sL(p.value).map((he,ae)=>({...he,index:ae,isSelected:ae===k.value,isActive:ae===c.activeIndex}))),b=d.ref(!0),C=d.ref(!1),x=d.computed(()=>n.disabled),k=d.computed(()=>p.value.findIndex(he=>ny(he.value,t.value))),_=d.computed(()=>{if(!b.value){if(n.error)return n.error;if(C.value)return"Data loading error"}}),P=d.computed(()=>{const he=d.unref(v),ae=d.unref(y),ge=he??ae.find(me=>ny(me.value,t.value))??ae.find(me=>ny(me.value,t.value));return(ge==null?void 0:ge.label)||(t.value?n.formatValue(t.value):"")}),N=d.computed(()=>!c.open&&t.value?"":t.value?String(P.value):n.placeholder),I=d.computed(()=>t.value!==void 0&&t.value!==null),F=d.computed(()=>x.value?void 0:"0"),Q=he=>{var ae;t.value=he==null?void 0:he.value,v.value=he,s.value=null,c.open=!1,(ae=a==null?void 0:a.value)==null||ae.focus()},Z=()=>{t.value=void 0,v.value=void 0},ee=()=>{var he;return(he=i.value)==null?void 0:he.focus()},le=()=>{c.open=!c.open};d.watch(()=>c.open,he=>{s.value=he?"":null});const z=()=>{c.open=!0},U=he=>{var ae,ge,me;const fe=he.relatedTarget;!((ae=a.value)!=null&&ae.contains(fe))&&!((me=(ge=o.value)==null?void 0:ge.listRef)!=null&&me.contains(fe))&&(s.value=null,c.open=!1)},G=he=>{var ae;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(he.code))he.preventDefault();else return;const{open:ge,activeIndex:me}=c;if(!ge){he.code==="Enter"&&(c.open=!0,s.value="");return}he.code==="Escape"&&(c.open=!1,s.value=null,(ae=a.value)==null||ae.focus());const fe=d.unref(y),{length:be}=fe;if(!be)return;he.code==="Enter"&&Q(fe.find(Ue=>Ue.index===me));const He=fe.findIndex(Ue=>Ue.index===me)??-1,_e=he.code==="ArrowDown"?1:he.code==="ArrowUp"?-1:0,Ie=Math.abs(He+_e+be)%be;c.activeIndex=y.value[Ie].index??-1};pce(a),d.watch(()=>t.value,A,{immediate:!0}),d.watch(()=>c.open,he=>{var ae;return he?(ae=i.value)==null?void 0:ae.focus():""}),d.watchPostEffect(()=>{var he;s.value,c.activeIndex>=0&&c.open&&((he=o.value)==null||he.scrollIntoActive())});const Y=kce(s,300,{maxWait:1e3}),X=PL(()=>Y.value,async he=>he!==null?n.optionsSearch(he):[]),te=PL(()=>t.value,async he=>{var ae,ge;return he&&!ny((ae=v.value)==null?void 0:ae.value,he)?n.modelSearch?n.modelSearch(he):(ge=await n.optionsSearch(String(he)))==null?void 0:ge[0]:v.value});return d.watch(()=>X.value,he=>{he&&(p.value=he,s.value!==null&&(C.value=!1))}),d.watch(()=>te.value,he=>{he&&(v.value=sL([he])[0])}),d.watch(()=>X.error,he=>{he&&(C.value=!!he)}),d.watch(()=>X.loading||te.loading,he=>{b.value=he}),(he,ae)=>(d.openBlock(),d.createElementBlock("div",{class:"pl-autocomplete__envelope",onClick:d.withModifiers(ee,["stop"])},[d.createElementVNode("div",{ref_key:"rootRef",ref:a,tabindex:F.value,class:d.normalizeClass(["pl-autocomplete",{open:c.open,error:!!_.value,disabled:x.value}]),onKeydown:G,onFocusout:U},[d.createElementVNode("div",Mfe,[d.createElementVNode("div",Hfe,[d.withDirectives(d.createElementVNode("input",{ref_key:"input",ref:i,"onUpdate:modelValue":ae[0]||(ae[0]=ge=>s.value=ge),type:"text",tabindex:"-1",disabled:x.value,placeholder:N.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:z},null,40,Ife),[[d.vModelText,s.value]]),ae[4]||(ae[4]=d.createTextVNode()),c.open?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",Rfe,[d.createVNode(yce,null,{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(P.value),1)]),_:1})])),ae[5]||(ae[5]=d.createTextVNode()),d.createElementVNode("div",Nfe,[b.value?(d.openBlock(),d.createBlock(d.unref(Kue),{key:0,name:"loading"})):d.createCommentVNode("",!0),ae[1]||(ae[1]=d.createTextVNode()),he.clearable&&I.value?(d.openBlock(),d.createBlock(d.unref(s5),{key:1,name:"delete-clear",onClick:d.withModifiers(Z,["stop"])})):d.createCommentVNode("",!0),ae[2]||(ae[2]=d.createTextVNode()),d.renderSlot(he.$slots,"append"),ae[3]||(ae[3]=d.createTextVNode()),d.createElementVNode("div",{class:"pl-autocomplete__arrow-wrapper",onClick:d.withModifiers(le,["stop"])},[he.arrowIconLarge?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["arrow-icon",[`icon-24 ${he.arrowIconLarge}`]])},null,2)):he.arrowIcon?(d.openBlock(),d.createElementBlock("div",{key:1,class:d.normalizeClass(["arrow-icon",[`icon-16 ${he.arrowIcon}`]])},null,2)):(d.openBlock(),d.createElementBlock("div",Lfe))])])]),ae[9]||(ae[9]=d.createTextVNode()),he.label?(d.openBlock(),d.createElementBlock("label",$fe,[he.required?(d.openBlock(),d.createElementBlock("i",Ffe)):d.createCommentVNode("",!0),ae[6]||(ae[6]=d.createTextVNode()),d.createElementVNode("span",null,d.toDisplayString(he.label),1),ae[7]||(ae[7]=d.createTextVNode()),d.unref(r).tooltip?(d.openBlock(),d.createBlock(d.unref(ice),{key:1,class:"info",position:"top"},{tooltip:d.withCtx(()=>[d.renderSlot(he.$slots,"tooltip")]),_:3})):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0),ae[10]||(ae[10]=d.createTextVNode()),c.open?(d.openBlock(),d.createBlock(d.unref(Ece),{key:1,ref:"overlay",root:a.value,class:"pl-autocomplete__options",tabindex:"-1",gap:3},{default:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(y.value,(ge,me)=>(d.openBlock(),d.createBlock(Iue,{key:me,option:ge,"is-selected":ge.isSelected,"is-hovered":ge.isActive,size:he.optionSize,onClick:d.withModifiers(fe=>Q(ge),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),ae[8]||(ae[8]=d.createTextVNode()),y.value.length?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",Vfe,"Nothing found"))]),_:1},8,["root"])):d.createCommentVNode("",!0),ae[11]||(ae[11]=d.createTextVNode()),d.createVNode(uce,{class:"pl-autocomplete__contour"})])],42,Pfe),ae[12]||(ae[12]=d.createTextVNode()),_.value?(d.openBlock(),d.createElementBlock("div",Ofe,d.toDisplayString(_.value),1)):b.value&&he.loadingOptionsHelper?(d.openBlock(),d.createElementBlock("div",Qfe,d.toDisplayString(he.loadingOptionsHelper),1)):he.helper?(d.openBlock(),d.createElementBlock("div",zfe,d.toDisplayString(he.helper),1)):d.createCommentVNode("",!0)]))}});function n6(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Gfe(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function ML(e){let t,n,r;e.length!==2?(t=n6,n=(s,c)=>n6(e(s),c),r=(s,c)=>e(s)-c):(t=e===n6||e===Gfe?e:jfe,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 p=f+A>>>1;n(s[p],c)<0?f=p+1:A=p}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 p=f+A>>>1;n(s[p],c)<=0?f=p+1:A=p}while(f<A)}return f}function o(s,c,f=0,A=s.length){const p=a(s,c,f,A-1);return p>f&&r(s[p-1],c)>-r(s[p],c)?p-1:p}return{left:a,center:o,right:i}}function jfe(){return 0}function Yfe(e){return e===null?NaN:+e}ML(n6),ML(Yfe).center;var Wfe={value:()=>{}};function HL(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new r6(n)}function r6(e){this._=e}function Xfe(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",a=n.indexOf(".");if(a>=0&&(r=n.slice(a+1),n=n.slice(0,a)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}r6.prototype=HL.prototype={constructor:r6,on:function(e,t){var n=this._,r=Xfe(e+"",n),a,i=-1,o=r.length;if(arguments.length<2){for(;++i<o;)if((a=(e=r[i]).type)&&(a=Kfe(n[a],e.name)))return a;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<o;)if(a=(e=r[i]).type)n[a]=IL(n[a],e.name,t);else if(t==null)for(a in n)n[a]=IL(n[a],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new r6(e)},call:function(e,t){if((a=arguments.length-2)>0)for(var n=new Array(a),r=0,a,i;r<a;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,a=i.length;r<a;++r)i[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],a=0,i=r.length;a<i;++a)r[a].value.apply(t,n)}};function Kfe(e,t){for(var n=0,r=e.length,a;n<r;++n)if((a=e[n]).name===t)return a.value}function IL(e,t,n){for(var r=0,a=e.length;r<a;++r)if(e[r].name===t){e[r]=Wfe,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var nB="http://www.w3.org/1999/xhtml";const RL={svg:"http://www.w3.org/2000/svg",xhtml:nB,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function a6(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),RL.hasOwnProperty(t)?{space:RL[t],local:e}:e}function Zfe(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===nB&&t.documentElement.namespaceURI===nB?t.createElement(e):t.createElementNS(n,e)}}function Jfe(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function NL(e){var t=a6(e);return(t.local?Jfe:Zfe)(t)}function qfe(){}function rB(e){return e==null?qfe:function(){return this.querySelector(e)}}function ede(e){typeof e!="function"&&(e=rB(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var i=t[a],o=i.length,s=r[a]=new Array(o),c,f,A=0;A<o;++A)(c=i[A])&&(f=e.call(c,c.__data__,A,i))&&("__data__"in c&&(f.__data__=c.__data__),s[A]=f);return new Lp(r,this._parents)}function tde(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function nde(){return[]}function LL(e){return e==null?nde:function(){return this.querySelectorAll(e)}}function rde(e){return function(){return tde(e.apply(this,arguments))}}function ade(e){typeof e=="function"?e=rde(e):e=LL(e);for(var t=this._groups,n=t.length,r=[],a=[],i=0;i<n;++i)for(var o=t[i],s=o.length,c,f=0;f<s;++f)(c=o[f])&&(r.push(e.call(c,c.__data__,f,o)),a.push(c));return new Lp(r,a)}function $L(e){return function(){return this.matches(e)}}function FL(e){return function(t){return t.matches(e)}}var ide=Array.prototype.find;function ode(e){return function(){return ide.call(this.children,e)}}function lde(){return this.firstElementChild}function sde(e){return this.select(e==null?lde:ode(typeof e=="function"?e:FL(e)))}var ude=Array.prototype.filter;function cde(){return Array.from(this.children)}function fde(e){return function(){return ude.call(this.children,e)}}function dde(e){return this.selectAll(e==null?cde:fde(typeof e=="function"?e:FL(e)))}function Ade(e){typeof e!="function"&&(e=$L(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var i=t[a],o=i.length,s=r[a]=[],c,f=0;f<o;++f)(c=i[f])&&e.call(c,c.__data__,f,i)&&s.push(c);return new Lp(r,this._parents)}function VL(e){return new Array(e.length)}function pde(){return new Lp(this._enter||this._groups.map(VL),this._parents)}function i6(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}i6.prototype={constructor:i6,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function hde(e){return function(){return e}}function vde(e,t,n,r,a,i){for(var o=0,s,c=t.length,f=i.length;o<f;++o)(s=t[o])?(s.__data__=i[o],r[o]=s):n[o]=new i6(e,i[o]);for(;o<c;++o)(s=t[o])&&(a[o]=s)}function mde(e,t,n,r,a,i,o){var s,c,f=new Map,A=t.length,p=i.length,v=new Array(A),y;for(s=0;s<A;++s)(c=t[s])&&(v[s]=y=o.call(c,c.__data__,s,t)+"",f.has(y)?a[s]=c:f.set(y,c));for(s=0;s<p;++s)y=o.call(e,i[s],s,i)+"",(c=f.get(y))?(r[s]=c,c.__data__=i[s],f.delete(y)):n[s]=new i6(e,i[s]);for(s=0;s<A;++s)(c=t[s])&&f.get(v[s])===c&&(a[s]=c)}function gde(e){return e.__data__}function yde(e,t){if(!arguments.length)return Array.from(this,gde);var n=t?mde:vde,r=this._parents,a=this._groups;typeof e!="function"&&(e=hde(e));for(var i=a.length,o=new Array(i),s=new Array(i),c=new Array(i),f=0;f<i;++f){var A=r[f],p=a[f],v=p.length,y=wde(e.call(A,A&&A.__data__,f,r)),b=y.length,C=s[f]=new Array(b),x=o[f]=new Array(b),k=c[f]=new Array(v);n(A,p,C,x,k,y,t);for(var _=0,P=0,N,I;_<b;++_)if(N=C[_]){for(_>=P&&(P=_+1);!(I=x[P])&&++P<b;);N._next=I||null}}return o=new Lp(o,r),o._enter=s,o._exit=c,o}function wde(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Cde(){return new Lp(this._exit||this._groups.map(VL),this._parents)}function bde(e,t,n){var r=this.enter(),a=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(a=t(a),a&&(a=a.selection())),n==null?i.remove():n(i),r&&a?r.merge(a).order():a}function Ede(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,a=n.length,i=r.length,o=Math.min(a,i),s=new Array(a),c=0;c<o;++c)for(var f=n[c],A=r[c],p=f.length,v=s[c]=new Array(p),y,b=0;b<p;++b)(y=f[b]||A[b])&&(v[b]=y);for(;c<a;++c)s[c]=n[c];return new Lp(s,this._parents)}function xde(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],a=r.length-1,i=r[a],o;--a>=0;)(o=r[a])&&(i&&o.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(o,i),i=o);return this}function Sde(e){e||(e=Bde);function t(p,v){return p&&v?e(p.__data__,v.__data__):!p-!v}for(var n=this._groups,r=n.length,a=new Array(r),i=0;i<r;++i){for(var o=n[i],s=o.length,c=a[i]=new Array(s),f,A=0;A<s;++A)(f=o[A])&&(c[A]=f);c.sort(t)}return new Lp(a,this._parents).order()}function Bde(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function kde(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Tde(){return Array.from(this)}function _de(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,i=r.length;a<i;++a){var o=r[a];if(o)return o}return null}function Dde(){let e=0;for(const t of this)++e;return e}function Pde(){return!this.node()}function Mde(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var a=t[n],i=0,o=a.length,s;i<o;++i)(s=a[i])&&e.call(s,s.__data__,i,a);return this}function Hde(e){return function(){this.removeAttribute(e)}}function Ide(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Rde(e,t){return function(){this.setAttribute(e,t)}}function Nde(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Lde(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function $de(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Fde(e,t){var n=a6(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Ide:Hde:typeof t=="function"?n.local?$de:Lde:n.local?Nde:Rde)(n,t))}function OL(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Vde(e){return function(){this.style.removeProperty(e)}}function Ode(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Qde(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function zde(e,t,n){return arguments.length>1?this.each((t==null?Vde:typeof t=="function"?Qde:Ode)(e,t,n??"")):ly(this.node(),e)}function ly(e,t){return e.style.getPropertyValue(t)||OL(e).getComputedStyle(e,null).getPropertyValue(t)}function Ude(e){return function(){delete this[e]}}function Gde(e,t){return function(){this[e]=t}}function jde(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Yde(e,t){return arguments.length>1?this.each((t==null?Ude:typeof t=="function"?jde:Gde)(e,t)):this.node()[e]}function QL(e){return e.trim().split(/^|\s+/)}function aB(e){return e.classList||new zL(e)}function zL(e){this._node=e,this._names=QL(e.getAttribute("class")||"")}zL.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function UL(e,t){for(var n=aB(e),r=-1,a=t.length;++r<a;)n.add(t[r])}function GL(e,t){for(var n=aB(e),r=-1,a=t.length;++r<a;)n.remove(t[r])}function Wde(e){return function(){UL(this,e)}}function Xde(e){return function(){GL(this,e)}}function Kde(e,t){return function(){(t.apply(this,arguments)?UL:GL)(this,e)}}function Zde(e,t){var n=QL(e+"");if(arguments.length<2){for(var r=aB(this.node()),a=-1,i=n.length;++a<i;)if(!r.contains(n[a]))return!1;return!0}return this.each((typeof t=="function"?Kde:t?Wde:Xde)(n,t))}function Jde(){this.textContent=""}function qde(e){return function(){this.textContent=e}}function eAe(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function tAe(e){return arguments.length?this.each(e==null?Jde:(typeof e=="function"?eAe:qde)(e)):this.node().textContent}function nAe(){this.innerHTML=""}function rAe(e){return function(){this.innerHTML=e}}function aAe(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function iAe(e){return arguments.length?this.each(e==null?nAe:(typeof e=="function"?aAe:rAe)(e)):this.node().innerHTML}function oAe(){this.nextSibling&&this.parentNode.appendChild(this)}function lAe(){return this.each(oAe)}function sAe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function uAe(){return this.each(sAe)}function cAe(e){var t=typeof e=="function"?e:NL(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function fAe(){return null}function dAe(e,t){var n=typeof e=="function"?e:NL(e),r=t==null?fAe:typeof t=="function"?t:rB(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function AAe(){var e=this.parentNode;e&&e.removeChild(this)}function pAe(){return this.each(AAe)}function hAe(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function vAe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function mAe(e){return this.select(e?vAe:hAe)}function gAe(e){return arguments.length?this.property("__data__",e):this.node().__data__}function yAe(e){return function(t){e.call(this,t,this.__data__)}}function wAe(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function CAe(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,a=t.length,i;n<a;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function bAe(e,t,n){return function(){var r=this.__on,a,i=yAe(t);if(r){for(var o=0,s=r.length;o<s;++o)if((a=r[o]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=i,a.options=n),a.value=t;return}}this.addEventListener(e.type,i,n),a={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(a):this.__on=[a]}}function EAe(e,t,n){var r=wAe(e+""),a,i=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,f=s.length,A;c<f;++c)for(a=0,A=s[c];a<i;++a)if((o=r[a]).type===A.type&&o.name===A.name)return A.value}return}for(s=t?bAe:CAe,a=0;a<i;++a)this.each(s(r[a],t,n));return this}function jL(e,t,n){var r=OL(e),a=r.CustomEvent;typeof a=="function"?a=new a(t,n):(a=r.document.createEvent("Event"),n?(a.initEvent(t,n.bubbles,n.cancelable),a.detail=n.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function xAe(e,t){return function(){return jL(this,e,t)}}function SAe(e,t){return function(){return jL(this,e,t.apply(this,arguments))}}function BAe(e,t){return this.each((typeof t=="function"?SAe:xAe)(e,t))}function*kAe(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,i=r.length,o;a<i;++a)(o=r[a])&&(yield o)}var TAe=[null];function Lp(e,t){this._groups=e,this._parents=t}function _5(){return new Lp([[document.documentElement]],TAe)}function _Ae(){return this}Lp.prototype=_5.prototype={constructor:Lp,select:ede,selectAll:ade,selectChild:sde,selectChildren:dde,filter:Ade,data:yde,enter:pde,exit:Cde,join:bde,merge:Ede,selection:_Ae,order:xde,sort:Sde,call:kde,nodes:Tde,node:_de,size:Dde,empty:Pde,each:Mde,attr:Fde,style:zde,property:Yde,classed:Zde,text:tAe,html:iAe,raise:lAe,lower:uAe,append:cAe,insert:dAe,remove:pAe,clone:mAe,datum:gAe,on:EAe,dispatch:BAe,[Symbol.iterator]:kAe};function iB(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function YL(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function D5(){}var P5=.7,o6=1/P5,sy="\\s*([+-]?\\d+)\\s*",M5="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",L0="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",DAe=/^#([0-9a-f]{3,8})$/,PAe=new RegExp(`^rgb\\(${sy},${sy},${sy}\\)$`),MAe=new RegExp(`^rgb\\(${L0},${L0},${L0}\\)$`),HAe=new RegExp(`^rgba\\(${sy},${sy},${sy},${M5}\\)$`),IAe=new RegExp(`^rgba\\(${L0},${L0},${L0},${M5}\\)$`),RAe=new RegExp(`^hsl\\(${M5},${L0},${L0}\\)$`),NAe=new RegExp(`^hsla\\(${M5},${L0},${L0},${M5}\\)$`),WL={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};iB(D5,H5,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:XL,formatHex:XL,formatHex8:LAe,formatHsl:$Ae,formatRgb:KL,toString:KL});function XL(){return this.rgb().formatHex()}function LAe(){return this.rgb().formatHex8()}function $Ae(){return t$(this).formatHsl()}function KL(){return this.rgb().formatRgb()}function H5(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=DAe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?ZL(t):n===3?new yd(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?l6(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?l6(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=PAe.exec(e))?new yd(t[1],t[2],t[3],1):(t=MAe.exec(e))?new yd(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=HAe.exec(e))?l6(t[1],t[2],t[3],t[4]):(t=IAe.exec(e))?l6(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=RAe.exec(e))?e$(t[1],t[2]/100,t[3]/100,1):(t=NAe.exec(e))?e$(t[1],t[2]/100,t[3]/100,t[4]):WL.hasOwnProperty(e)?ZL(WL[e]):e==="transparent"?new yd(NaN,NaN,NaN,0):null}function ZL(e){return new yd(e>>16&255,e>>8&255,e&255,1)}function l6(e,t,n,r){return r<=0&&(e=t=n=NaN),new yd(e,t,n,r)}function FAe(e){return e instanceof D5||(e=H5(e)),e?(e=e.rgb(),new yd(e.r,e.g,e.b,e.opacity)):new yd}function oB(e,t,n,r){return arguments.length===1?FAe(e):new yd(e,t,n,r??1)}function yd(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}iB(yd,oB,YL(D5,{brighter(e){return e=e==null?o6:Math.pow(o6,e),new yd(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?P5:Math.pow(P5,e),new yd(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new yd(tg(this.r),tg(this.g),tg(this.b),s6(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:JL,formatHex:JL,formatHex8:VAe,formatRgb:qL,toString:qL}));function JL(){return`#${ng(this.r)}${ng(this.g)}${ng(this.b)}`}function VAe(){return`#${ng(this.r)}${ng(this.g)}${ng(this.b)}${ng((isNaN(this.opacity)?1:this.opacity)*255)}`}function qL(){const e=s6(this.opacity);return`${e===1?"rgb(":"rgba("}${tg(this.r)}, ${tg(this.g)}, ${tg(this.b)}${e===1?")":`, ${e})`}`}function s6(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function tg(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ng(e){return e=tg(e),(e<16?"0":"")+e.toString(16)}function e$(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new $p(e,t,n,r)}function t$(e){if(e instanceof $p)return new $p(e.h,e.s,e.l,e.opacity);if(e instanceof D5||(e=H5(e)),!e)return new $p;if(e instanceof $p)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 $p(o,s,c,e.opacity)}function OAe(e,t,n,r){return arguments.length===1?t$(e):new $p(e,t,n,r??1)}function $p(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}iB($p,OAe,YL(D5,{brighter(e){return e=e==null?o6:Math.pow(o6,e),new $p(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?P5:Math.pow(P5,e),new $p(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 yd(lB(e>=240?e-240:e+120,a,r),lB(e,a,r),lB(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new $p(n$(this.h),u6(this.s),u6(this.l),s6(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=s6(this.opacity);return`${e===1?"hsl(":"hsla("}${n$(this.h)}, ${u6(this.s)*100}%, ${u6(this.l)*100}%${e===1?")":`, ${e})`}`}}));function n$(e){return e=(e||0)%360,e<0?e+360:e}function u6(e){return Math.max(0,Math.min(1,e||0))}function lB(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 r$=e=>()=>e;function QAe(e,t){return function(n){return e+n*t}}function zAe(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 UAe(e){return(e=+e)==1?a$:function(t,n){return n-t?zAe(t,n,e):r$(isNaN(t)?n:t)}}function a$(e,t){var n=t-e;return n?QAe(e,n):r$(isNaN(e)?t:e)}const i$=function e(t){var n=UAe(t);function r(a,i){var o=n((a=oB(a)).r,(i=oB(i)).r),s=n(a.g,i.g),c=n(a.b,i.b),f=a$(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 Av(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var sB=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,uB=new RegExp(sB.source,"g");function GAe(e){return function(){return e}}function jAe(e){return function(t){return e(t)+""}}function YAe(e,t){var n=sB.lastIndex=uB.lastIndex=0,r,a,i,o=-1,s=[],c=[];for(e=e+"",t=t+"";(r=sB.exec(e))&&(a=uB.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:Av(r,a)})),n=uB.lastIndex;return n<t.length&&(i=t.slice(n),s[o]?s[o]+=i:s[++o]=i),s.length<2?c[0]?jAe(c[0].x):GAe(t):(t=c.length,function(f){for(var A=0,p;A<t;++A)s[(p=c[A]).i]=p.x(f);return s.join("")})}var o$=180/Math.PI,l$={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function s$(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)*o$,skewX:Math.atan(c)*o$,scaleX:o,scaleY:s}}var c6;function WAe(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?l$:s$(t.a,t.b,t.c,t.d,t.e,t.f)}function XAe(e){return e==null||(c6||(c6=document.createElementNS("http://www.w3.org/2000/svg","g")),c6.setAttribute("transform",e),!(e=c6.transform.baseVal.consolidate()))?l$:(e=e.matrix,s$(e.a,e.b,e.c,e.d,e.e,e.f))}function u$(e,t,n,r){function a(f){return f.length?f.pop()+" ":""}function i(f,A,p,v,y,b){if(f!==p||A!==v){var C=y.push("translate(",null,t,null,n);b.push({i:C-4,x:Av(f,p)},{i:C-2,x:Av(A,v)})}else(p||v)&&y.push("translate("+p+t+v+n)}function o(f,A,p,v){f!==A?(f-A>180?A+=360:A-f>180&&(f+=360),v.push({i:p.push(a(p)+"rotate(",null,r)-2,x:Av(f,A)})):A&&p.push(a(p)+"rotate("+A+r)}function s(f,A,p,v){f!==A?v.push({i:p.push(a(p)+"skewX(",null,r)-2,x:Av(f,A)}):A&&p.push(a(p)+"skewX("+A+r)}function c(f,A,p,v,y,b){if(f!==p||A!==v){var C=y.push(a(y)+"scale(",null,",",null,")");b.push({i:C-4,x:Av(f,p)},{i:C-2,x:Av(A,v)})}else(p!==1||v!==1)&&y.push(a(y)+"scale("+p+","+v+")")}return function(f,A){var p=[],v=[];return f=e(f),A=e(A),i(f.translateX,f.translateY,A.translateX,A.translateY,p,v),o(f.rotate,A.rotate,p,v),s(f.skewX,A.skewX,p,v),c(f.scaleX,f.scaleY,A.scaleX,A.scaleY,p,v),f=A=null,function(y){for(var b=-1,C=v.length,x;++b<C;)p[(x=v[b]).i]=x.x(y);return p.join("")}}}var KAe=u$(WAe,"px, ","px)","deg)"),ZAe=u$(XAe,", ",")",")"),uy=0,I5=0,R5=0,c$=1e3,f6,N5,d6=0,rg=0,A6=0,L5=typeof performance=="object"&&performance.now?performance:Date,f$=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function cB(){return rg||(f$(JAe),rg=L5.now()+A6)}function JAe(){rg=0}function p6(){this._call=this._time=this._next=null}p6.prototype=d$.prototype={constructor:p6,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?cB():+n)+(t==null?0:+t),!this._next&&N5!==this&&(N5?N5._next=this:f6=this,N5=this),this._call=e,this._time=n,fB()},stop:function(){this._call&&(this._call=null,this._time=1/0,fB())}};function d$(e,t,n){var r=new p6;return r.restart(e,t,n),r}function qAe(){cB(),++uy;for(var e=f6,t;e;)(t=rg-e._time)>=0&&e._call.call(void 0,t),e=e._next;--uy}function A$(){rg=(d6=L5.now())+A6,uy=I5=0;try{qAe()}finally{uy=0,tpe(),rg=0}}function epe(){var e=L5.now(),t=e-d6;t>c$&&(A6-=t,d6=e)}function tpe(){for(var e,t=f6,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:f6=n);N5=e,fB(r)}function fB(e){if(!uy){I5&&(I5=clearTimeout(I5));var t=e-rg;t>24?(e<1/0&&(I5=setTimeout(A$,e-L5.now()-A6)),R5&&(R5=clearInterval(R5))):(R5||(d6=L5.now(),R5=setInterval(epe,c$)),uy=1,f$(A$))}}function p$(e,t,n){var r=new p6;return t=t==null?0:+t,r.restart(a=>{r.stop(),e(a+t)},t,n),r}var npe=HL("start","end","cancel","interrupt"),rpe=[],h$=0,v$=1,dB=2,h6=3,m$=4,AB=5,v6=6;function m6(e,t,n,r,a,i){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;ape(e,n,{name:t,index:r,group:a,on:npe,tween:rpe,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:h$})}function pB(e,t){var n=Fp(e,t);if(n.state>h$)throw new Error("too late; already scheduled");return n}function $0(e,t){var n=Fp(e,t);if(n.state>h6)throw new Error("too late; already running");return n}function Fp(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function ape(e,t,n){var r=e.__transition,a;r[t]=n,n.timer=d$(i,0,n.time);function i(f){n.state=v$,n.timer.restart(o,n.delay,n.time),n.delay<=f&&o(f-n.delay)}function o(f){var A,p,v,y;if(n.state!==v$)return c();for(A in r)if(y=r[A],y.name===n.name){if(y.state===h6)return p$(o);y.state===m$?(y.state=v6,y.timer.stop(),y.on.call("interrupt",e,e.__data__,y.index,y.group),delete r[A]):+A<t&&(y.state=v6,y.timer.stop(),y.on.call("cancel",e,e.__data__,y.index,y.group),delete r[A])}if(p$(function(){n.state===h6&&(n.state=m$,n.timer.restart(s,n.delay,n.time),s(f))}),n.state=dB,n.on.call("start",e,e.__data__,n.index,n.group),n.state===dB){for(n.state=h6,a=new Array(v=n.tween.length),A=0,p=-1;A<v;++A)(y=n.tween[A].value.call(e,e.__data__,n.index,n.group))&&(a[++p]=y);a.length=p+1}}function s(f){for(var A=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(c),n.state=AB,1),p=-1,v=a.length;++p<v;)a[p].call(e,A);n.state===AB&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=v6,n.timer.stop(),delete r[t];for(var f in r)return;delete e.__transition}}function ipe(e,t){var n=e.__transition,r,a,i=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((r=n[o]).name!==t){i=!1;continue}a=r.state>dB&&r.state<AB,r.state=v6,r.timer.stop(),r.on.call(a?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[o]}i&&delete e.__transition}}function ope(e){return this.each(function(){ipe(this,e)})}function lpe(e,t){var n,r;return function(){var a=$0(this,e),i=a.tween;if(i!==n){r=n=i;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}a.tween=r}}function spe(e,t,n){var r,a;if(typeof n!="function")throw new Error;return function(){var i=$0(this,e),o=i.tween;if(o!==r){a=(r=o).slice();for(var s={name:t,value:n},c=0,f=a.length;c<f;++c)if(a[c].name===t){a[c]=s;break}c===f&&a.push(s)}i.tween=a}}function upe(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Fp(this.node(),n).tween,a=0,i=r.length,o;a<i;++a)if((o=r[a]).name===e)return o.value;return null}return this.each((t==null?lpe:spe)(n,e,t))}function hB(e,t,n){var r=e._id;return e.each(function(){var a=$0(this,r);(a.value||(a.value={}))[t]=n.apply(this,arguments)}),function(a){return Fp(a,r).value[t]}}function g$(e,t){var n;return(typeof t=="number"?Av:t instanceof H5?i$:(n=H5(t))?(t=n,i$):YAe)(e,t)}function cpe(e){return function(){this.removeAttribute(e)}}function fpe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function dpe(e,t,n){var r,a=n+"",i;return function(){var o=this.getAttribute(e);return o===a?null:o===r?i:i=t(r=o,n)}}function Ape(e,t,n){var r,a=n+"",i;return function(){var o=this.getAttributeNS(e.space,e.local);return o===a?null:o===r?i:i=t(r=o,n)}}function ppe(e,t,n){var r,a,i;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+"",o===c?null:o===r&&c===a?i:(a=c,i=t(r=o,s)))}}function hpe(e,t,n){var r,a,i;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+"",o===c?null:o===r&&c===a?i:(a=c,i=t(r=o,s)))}}function vpe(e,t){var n=a6(e),r=n==="transform"?ZAe:g$;return this.attrTween(e,typeof t=="function"?(n.local?hpe:ppe)(n,r,hB(this,"attr."+e,t)):t==null?(n.local?fpe:cpe)(n):(n.local?Ape:dpe)(n,r,t))}function mpe(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function gpe(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function ype(e,t){var n,r;function a(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&gpe(e,i)),n}return a._value=t,a}function wpe(e,t){var n,r;function a(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&mpe(e,i)),n}return a._value=t,a}function Cpe(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=a6(e);return this.tween(n,(r.local?ype:wpe)(r,t))}function bpe(e,t){return function(){pB(this,e).delay=+t.apply(this,arguments)}}function Epe(e,t){return t=+t,function(){pB(this,e).delay=t}}function xpe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?bpe:Epe)(t,e)):Fp(this.node(),t).delay}function Spe(e,t){return function(){$0(this,e).duration=+t.apply(this,arguments)}}function Bpe(e,t){return t=+t,function(){$0(this,e).duration=t}}function kpe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Spe:Bpe)(t,e)):Fp(this.node(),t).duration}function Tpe(e,t){if(typeof t!="function")throw new Error;return function(){$0(this,e).ease=t}}function _pe(e){var t=this._id;return arguments.length?this.each(Tpe(t,e)):Fp(this.node(),t).ease}function Dpe(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;$0(this,e).ease=n}}function Ppe(e){if(typeof e!="function")throw new Error;return this.each(Dpe(this._id,e))}function Mpe(e){typeof e!="function"&&(e=$L(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var i=t[a],o=i.length,s=r[a]=[],c,f=0;f<o;++f)(c=i[f])&&e.call(c,c.__data__,f,i)&&s.push(c);return new Qh(r,this._parents,this._name,this._id)}function Hpe(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,a=n.length,i=Math.min(r,a),o=new Array(r),s=0;s<i;++s)for(var c=t[s],f=n[s],A=c.length,p=o[s]=new Array(A),v,y=0;y<A;++y)(v=c[y]||f[y])&&(p[y]=v);for(;s<r;++s)o[s]=t[s];return new Qh(o,this._parents,this._name,this._id)}function Ipe(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function Rpe(e,t,n){var r,a,i=Ipe(t)?pB:$0;return function(){var o=i(this,e),s=o.on;s!==r&&(a=(r=s).copy()).on(t,n),o.on=a}}function Npe(e,t){var n=this._id;return arguments.length<2?Fp(this.node(),n).on.on(e):this.each(Rpe(n,e,t))}function Lpe(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function $pe(){return this.on("end.remove",Lpe(this._id))}function Fpe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=rB(e));for(var r=this._groups,a=r.length,i=new Array(a),o=0;o<a;++o)for(var s=r[o],c=s.length,f=i[o]=new Array(c),A,p,v=0;v<c;++v)(A=s[v])&&(p=e.call(A,A.__data__,v,s))&&("__data__"in A&&(p.__data__=A.__data__),f[v]=p,m6(f[v],t,n,v,f,Fp(A,n)));return new Qh(i,this._parents,t,n)}function Vpe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=LL(e));for(var r=this._groups,a=r.length,i=[],o=[],s=0;s<a;++s)for(var c=r[s],f=c.length,A,p=0;p<f;++p)if(A=c[p]){for(var v=e.call(A,A.__data__,p,c),y,b=Fp(A,n),C=0,x=v.length;C<x;++C)(y=v[C])&&m6(y,t,n,C,v,b);i.push(v),o.push(A)}return new Qh(i,o,t,n)}var Ope=_5.prototype.constructor;function Qpe(){return new Ope(this._groups,this._parents)}function zpe(e,t){var n,r,a;return function(){var i=ly(this,e),o=(this.style.removeProperty(e),ly(this,e));return i===o?null:i===n&&o===r?a:a=t(n=i,r=o)}}function y$(e){return function(){this.style.removeProperty(e)}}function Upe(e,t,n){var r,a=n+"",i;return function(){var o=ly(this,e);return o===a?null:o===r?i:i=t(r=o,n)}}function Gpe(e,t,n){var r,a,i;return function(){var o=ly(this,e),s=n(this),c=s+"";return s==null&&(c=s=(this.style.removeProperty(e),ly(this,e))),o===c?null:o===r&&c===a?i:(a=c,i=t(r=o,s))}}function jpe(e,t){var n,r,a,i="style."+t,o="end."+i,s;return function(){var c=$0(this,e),f=c.on,A=c.value[i]==null?s||(s=y$(t)):void 0;(f!==n||a!==A)&&(r=(n=f).copy()).on(o,a=A),c.on=r}}function Ype(e,t,n){var r=(e+="")=="transform"?KAe:g$;return t==null?this.styleTween(e,zpe(e,r)).on("end.style."+e,y$(e)):typeof t=="function"?this.styleTween(e,Gpe(e,r,hB(this,"style."+e,t))).each(jpe(this._id,e)):this.styleTween(e,Upe(e,r,t),n).on("end.style."+e,null)}function Wpe(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Xpe(e,t,n){var r,a;function i(){var o=t.apply(this,arguments);return o!==a&&(r=(a=o)&&Wpe(e,o,n)),r}return i._value=t,i}function Kpe(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,Xpe(e,t,n??""))}function Zpe(e){return function(){this.textContent=e}}function Jpe(e){return function(){var t=e(this);this.textContent=t??""}}function qpe(e){return this.tween("text",typeof e=="function"?Jpe(hB(this,"text",e)):Zpe(e==null?"":e+""))}function e0e(e){return function(t){this.textContent=e.call(this,t)}}function t0e(e){var t,n;function r(){var a=e.apply(this,arguments);return a!==n&&(t=(n=a)&&e0e(a)),t}return r._value=e,r}function n0e(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,t0e(e))}function r0e(){for(var e=this._name,t=this._id,n=w$(),r=this._groups,a=r.length,i=0;i<a;++i)for(var o=r[i],s=o.length,c,f=0;f<s;++f)if(c=o[f]){var A=Fp(c,t);m6(c,e,n,f,o,{time:A.time+A.delay+A.duration,delay:0,duration:A.duration,ease:A.ease})}return new Qh(r,this._parents,e,n)}function a0e(){var e,t,n=this,r=n._id,a=n.size();return new Promise(function(i,o){var s={value:o},c={value:function(){--a===0&&i()}};n.each(function(){var f=$0(this,r),A=f.on;A!==e&&(t=(e=A).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),f.on=t}),a===0&&i()})}var i0e=0;function Qh(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function w$(){return++i0e}var zh=_5.prototype;Qh.prototype={constructor:Qh,select:Fpe,selectAll:Vpe,selectChild:zh.selectChild,selectChildren:zh.selectChildren,filter:Mpe,merge:Hpe,selection:Qpe,transition:r0e,call:zh.call,nodes:zh.nodes,node:zh.node,size:zh.size,empty:zh.empty,each:zh.each,on:Npe,attr:vpe,attrTween:Cpe,style:Ype,styleTween:Kpe,text:qpe,textTween:n0e,remove:$pe,tween:upe,delay:xpe,duration:kpe,ease:_pe,easeVarying:Ppe,end:a0e,[Symbol.iterator]:zh[Symbol.iterator]};function o0e(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var l0e={time:null,delay:0,duration:250,ease:o0e};function s0e(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function u0e(e){var t,n;e instanceof Qh?(t=e._id,e=e._name):(t=w$(),(n=l0e).time=cB(),e=e==null?null:e+"");for(var r=this._groups,a=r.length,i=0;i<a;++i)for(var o=r[i],s=o.length,c,f=0;f<s;++f)(c=o[f])&&m6(c,e,t,f,o,n||s0e(c,t));return new Qh(r,this._parents,e,t)}_5.prototype.interrupt=ope,_5.prototype.transition=u0e;function c0e(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function g6(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 f0e(e){return e=g6(Math.abs(e)),e?e[1]:NaN}function d0e(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 A0e(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var p0e=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function vB(e){if(!(t=p0e.exec(e)))throw new Error("invalid format: "+e);var t;return new mB({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]})}vB.prototype=mB.prototype;function mB(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+""}mB.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 h0e(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 C$;function v0e(e,t){var n=g6(e,t);if(!n)return e+"";var r=n[0],a=n[1],i=a-(C$=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")+g6(e,Math.max(0,t+i-1))[0]}function b$(e,t){var n=g6(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 E$={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:c0e,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)=>b$(e*100,t),r:b$,s:v0e,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function x$(e){return e}var S$=Array.prototype.map,B$=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function m0e(e){var t=e.grouping===void 0||e.thousands===void 0?x$:d0e(S$.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?x$:A0e(S$.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(p){p=vB(p);var v=p.fill,y=p.align,b=p.sign,C=p.symbol,x=p.zero,k=p.width,_=p.comma,P=p.precision,N=p.trim,I=p.type;I==="n"?(_=!0,I="g"):E$[I]||(P===void 0&&(P=12),N=!0,I="g"),(x||v==="0"&&y==="=")&&(x=!0,v="0",y="=");var F=C==="$"?n:C==="#"&&/[boxX]/.test(I)?"0"+I.toLowerCase():"",Q=C==="$"?r:/[%p]/.test(I)?o:"",Z=E$[I],ee=/[defgprs%]/.test(I);P=P===void 0?6:/[gprs]/.test(I)?Math.max(1,Math.min(21,P)):Math.max(0,Math.min(20,P));function le(z){var U=F,G=Q,Y,X,te;if(I==="c")G=Z(z)+G,z="";else{z=+z;var he=z<0||1/z<0;if(z=isNaN(z)?c:Z(Math.abs(z),P),N&&(z=h0e(z)),he&&+z==0&&b!=="+"&&(he=!1),U=(he?b==="("?b:s:b==="-"||b==="("?"":b)+U,G=(I==="s"?B$[8+C$/3]:"")+G+(he&&b==="("?")":""),ee){for(Y=-1,X=z.length;++Y<X;)if(te=z.charCodeAt(Y),48>te||te>57){G=(te===46?a+z.slice(Y+1):z.slice(Y))+G,z=z.slice(0,Y);break}}}_&&!x&&(z=t(z,1/0));var ae=U.length+z.length+G.length,ge=ae<k?new Array(k-ae+1).join(v):"";switch(_&&x&&(z=t(ge+z,ge.length?k-G.length:1/0),ge=""),y){case"<":z=U+z+G+ge;break;case"=":z=U+ge+z+G;break;case"^":z=ge.slice(0,ae=ge.length>>1)+U+z+G+ge.slice(ae);break;default:z=ge+U+z+G;break}return i(z)}return le.toString=function(){return p+""},le}function A(p,v){var y=f((p=vB(p),p.type="f",p)),b=Math.max(-8,Math.min(8,Math.floor(f0e(v)/3)))*3,C=Math.pow(10,-b),x=B$[8+b/3];return function(k){return y(C*k)+x}}return{format:f,formatPrefix:A}}var y6;g0e({thousands:",",grouping:[3],currency:["$",""]});function g0e(e){return y6=m0e(e),y6.format,y6.formatPrefix,y6}function $5(e,t,n){this.k=e,this.x=t,this.y=n}$5.prototype={constructor:$5,scale:function(e){return e===1?this:new $5(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new $5(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},$5.prototype;const y0e={ref:"chipRoot",class:"dnd-double-chip__group"},w0e={class:"dnd-double-chip__top"},C0e={key:0,class:"dnd-basket-chip__handler"},b0e=["title"],E0e={class:"dnd-double-chip__title"},x0e=["innerHTML"],S0e={class:"dnd-double-chip__bottom"},B0e={key:0,class:"dnd-basket-chip__fixed-axes-block"},k0e=d.defineComponent({__name:"DndDoubleChip",props:d.mergeModels({info:{},error:{type:Boolean},searchOptions:{type:Function},sortable:{type:Boolean}},{filter:{required:!0},filterModifiers:{},fixedAxes:{default:{}},fixedAxesModifiers:{}}),emits:d.mergeModels(["close-chip","update:filter","update:fixedAxes"],["update:filter","update:fixedAxes"]),setup(e,{emit:t}){var c;const n=e,r=t,a=Tr(),i=d.useModel(e,"filter"),o=d.useModel(e,"fixedAxes"),s=d.ref((c=a.value.uniqueValuesData.value[n.info.id])==null?void 0:c.options);return d.watch(()=>a.value.uniqueValuesData.value,f=>{var p;const A=(p=f[n.info.id])==null?void 0:p.options;A&&(s.value=A),n.info.axesToBeFixed.forEach(v=>{o.value[v].axisValue===void 0&&f[v]&&(o.value[v].axisValue=f[v].list[0],r("update:fixedAxes",o.value))})},{immediate:!0}),d.watch(()=>s.value,async f=>{!f||!f.length||i.value===void 0&&(i.value=f[0].value)},{immediate:!0}),(f,A)=>(d.openBlock(),d.createElementBlock("div",y0e,[d.createElementVNode("div",{class:d.normalizeClass([{error:f.error,sortable:f.sortable},"dnd-double-chip"])},[d.createElementVNode("div",w0e,[d.createElementVNode("div",{class:d.normalizeClass(["dnd-double-chip__icon",{error:f.error}])},[f.error?(d.openBlock(),d.createBlock(d.unref(rt.PlMaskIcon16),{key:0,name:"warning"})):(d.openBlock(),d.createBlock(d.unref(s5),{key:1,name:f.info.isSubsetFilter?"cell-type-subset":f.info.type==="String"?"cell-type-txt":"cell-type-num"},null,8,["name"]))],2),f.sortable?(d.openBlock(),d.createElementBlock("div",C0e)):d.createCommentVNode("",!0),d.createVNode(d.unref(rt.PlMaskIcon16),{name:"drag-dots"}),d.createElementVNode("div",{class:"dnd-double-chip__title-wrapper",title:f.info.title},[d.createElementVNode("div",E0e,d.toDisplayString(f.info.title),1)],8,b0e),d.createElementVNode("div",{innerHTML:d.unref(US),class:"dnd-double-chip__icon-close",onClick:A[0]||(A[0]=p=>f.$emit("close-chip",n.info.id))},null,8,x0e)]),d.createElementVNode("div",S0e,[s.value===void 0||s.value.length<1e3?(d.openBlock(),d.createBlock(d.unref(rt.PlDropdown),{key:0,modelValue:i.value,"onUpdate:modelValue":A[1]||(A[1]=p=>i.value=p),options:s.value},null,8,["modelValue","options"])):(d.openBlock(),d.createBlock(d.unref(t6),{key:1,modelValue:i.value,"onUpdate:modelValue":A[2]||(A[2]=p=>i.value=p),"options-search":p=>f.searchOptions(n.info.id,p)},null,8,["modelValue","options-search"]))])],2),f.info.axesToBeFixed.length>0?(d.openBlock(),d.createElementBlock("div",B0e,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(f.info.axesToBeFixed,p=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:p},[o.value[p]?(d.openBlock(),d.createBlock(d.unref(t6),{key:0,modelValue:o.value[p].axisValue,"onUpdate:modelValue":[v=>o.value[p].axisValue=v,A[3]||(A[3]=v=>f.$emit("update:fixedAxes",o.value))],"options-search":v=>f.searchOptions(p,v),label:f.info.axesToBeFixedInfo[p].title},null,8,["modelValue","onUpdate:modelValue","options-search","label"])):d.createCommentVNode("",!0)],64))),128))])):d.createCommentVNode("",!0)],512))}}),T0e={key:0,class:"dnd-basket-chip__handler"},_0e={class:"dnd-basket-chip__title-wrapper"},D0e=["title"],P0e=["title"],M0e=["innerHTML"],H0e={key:0,class:"dnd-basket-chip__fixed-axes-block"},I0e=d.defineComponent({__name:"DnDBasketChip",props:d.mergeModels({error:{type:Boolean},info:{},sortable:{type:Boolean},searchOptions:{type:Function}},{modelValue:{default:{}},modelModifiers:{}}),emits:d.mergeModels(["close-chip","update:modelValue"],["update:modelValue"]),setup(e,{emit:t}){const n=e,r=Tr(),a=d.useModel(e,"modelValue"),i=t,o=d.ref(),s=d.computed(()=>n.info.uniqueValues.join("/"));function c(){i("close-chip",n.info.id)}return d.watch(()=>r.value.uniqueValuesData.value,f=>{n.info.axesToBeFixed.forEach(A=>{a.value[A].axisValue===void 0&&f[A]&&(a.value[A].axisValue=f[A].list[0],i("update:modelValue",a.value))})},{immediate:!0}),(f,A)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"chipRoot",ref:o,class:"dnd-basket-chip__group"},[d.createElementVNode("div",{class:d.normalizeClass([{error:f.error,sortable:f.sortable},"dnd-basket-chip"])},[d.createElementVNode("div",{class:d.normalizeClass(["dnd-basket-chip__icon",{error:f.error}])},[f.error?(d.openBlock(),d.createBlock(d.unref(cL),{key:0,name:"warning"})):(d.openBlock(),d.createBlock(d.unref(s5),{key:1,name:f.info.isSubsetFilter?"cell-type-subset":f.info.type==="String"?"cell-type-txt":"cell-type-num"},null,8,["name"]))],2),f.sortable?(d.openBlock(),d.createElementBlock("div",T0e)):d.createCommentVNode("",!0),d.createVNode(d.unref(cL),{name:"drag-dots"}),d.createElementVNode("div",_0e,[d.createElementVNode("div",{class:"dnd-basket-chip__title",title:f.info.title},d.toDisplayString(f.info.title),9,D0e),f.info.nonHomogenous?(d.openBlock(),d.createElementBlock("div",{key:0,class:"dnd-basket-chip__sub-title",title:s.value},d.toDisplayString(s.value),9,P0e)):d.createCommentVNode("",!0)]),d.createElementVNode("div",{innerHTML:d.unref(US),class:"dnd-basket-chip__icon-close",onClick:c},null,8,M0e)],2),f.info.axesToBeFixed.length>0?(d.openBlock(),d.createElementBlock("div",H0e,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(f.info.axesToBeFixed,p=>(d.openBlock(),d.createBlock(d.unref(t6),{key:p,modelValue:a.value[p].axisValue,"onUpdate:modelValue":[v=>a.value[p].axisValue=v,A[0]||(A[0]=v=>f.$emit("update:modelValue",a.value))],"options-search":v=>f.searchOptions(p,v),label:f.info.axesToBeFixedInfo[p].title},null,8,["modelValue","onUpdate:modelValue","options-search","label"]))),128))])):d.createCommentVNode("",!0)],512))}}),R0e={ref:"chipRoot",class:"dnd-double-chip__group"},N0e={class:"dnd-double-chip__top"},L0e={class:"dnd-double-chip__icon"},$0e=["title"],F0e={class:"dnd-double-chip__title"},V0e=["innerHTML"],O0e={class:"dnd-double-chip__bottom-range"},Q0e={class:"dnd-double-chip__bottom-range-row"},z0e={class:"dnd-double-chip__bottom-range-row"},U0e={key:0,class:"dnd-basket-chip__fixed-axes-block"},G0e=d.defineComponent({__name:"DnDRangeChip",props:d.mergeModels({info:{},error:{type:Boolean},searchOptions:{type:Function}},{filter:{required:!0},filterModifiers:{},fixedAxes:{required:!0},fixedAxesModifiers:{}}),emits:d.mergeModels(["close-chip","update:fixedAxes"],["update:filter","update:fixedAxes"]),setup(e,{emit:t}){var c,f;const n=e,r=Tr(),a=t,i=d.useModel(e,"filter"),o=d.useModel(e,"fixedAxes"),s=d.reactive({min:(c=i.value)==null?void 0:c[0],max:(f=i.value)==null?void 0:f[1]});return d.watch(()=>s,A=>{i.value=A},{deep:!0}),d.watch(()=>r.value.uniqueValuesData.value,A=>{n.info.axesToBeFixed.forEach(p=>{o.value[p].axisValue===void 0&&A[p]&&(o.value[p].axisValue=A[p].list[0],a("update:fixedAxes",o.value))})},{immediate:!0}),(A,p)=>(d.openBlock(),d.createElementBlock("div",R0e,[d.createElementVNode("div",{class:d.normalizeClass([{error:A.error},"dnd-double-chip"])},[d.createElementVNode("div",N0e,[d.createElementVNode("div",L0e,[d.createVNode(d.unref(s5),{name:"cell-type-num"})]),d.createElementVNode("div",{class:"dnd-double-chip__title-wrapper",title:A.info.title},[d.createElementVNode("div",F0e,d.toDisplayString(A.info.title),1)],8,$0e),d.createElementVNode("div",{innerHTML:d.unref(US),class:"dnd-double-chip__icon-close",onClick:p[0]||(p[0]=v=>A.$emit("close-chip",n.info.id))},null,8,V0e)]),d.createElementVNode("div",O0e,[d.createElementVNode("div",Q0e,[d.createVNode(d.unref(rt.PlNumberField),{label:"Min",modelValue:s.min,"onUpdate:modelValue":p[1]||(p[1]=v=>s.min=v),updateOnEnterOrClickOutside:!0,useIncrementButtons:!1},null,8,["modelValue"])]),d.createElementVNode("div",z0e,[d.createVNode(d.unref(rt.PlNumberField),{label:"Max",modelValue:s.max,"onUpdate:modelValue":p[2]||(p[2]=v=>s.max=v),updateOnEnterOrClickOutside:!0,useIncrementButtons:!1},null,8,["modelValue"])])])],2),A.info.axesToBeFixed.length>0?(d.openBlock(),d.createElementBlock("div",U0e,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(A.info.axesToBeFixed,v=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:v},[o.value[v]?(d.openBlock(),d.createBlock(d.unref(t6),{key:0,modelValue:o.value[v].axisValue,"onUpdate:modelValue":[y=>o.value[v].axisValue=y,p[3]||(p[3]=y=>A.$emit("update:fixedAxes",o.value))],"options-search":y=>A.searchOptions(v,y),label:A.info.axesToBeFixedInfo[v].title},null,8,["modelValue","onUpdate:modelValue","options-search","label"])):d.createCommentVNode("",!0)],64))),128))])):d.createCommentVNode("",!0)],512))}}),j0e={class:"dnd-basket__title"},Y0e={key:0,class:"dnd-basket__required"},W0e={class:"dnd-basket__drop-container"},X0e={key:0,class:"dnd-basket__placeholder"},K0e=100,ag=d.defineComponent({__name:"DndBasket",props:{id:{},title:{},multiple:{type:Boolean},isFilter:{type:Boolean},required:{type:Boolean},disabled:{type:Boolean},readonly:{type:Boolean},consistency:{},labelsInfo:{},droppedIds:{},availableIds:{},selectedFilters:{},selectedRanges:{},fixedAxes:{},info:{},draggedId:{},sortable:{type:Boolean}},emits:["drop-item","remove-item","select-filter-value","select-filter-range","select-fixed-axis-value","reorder"],setup(e,{emit:t}){const n=e,r=t,a=d.ref(),i=d.ref(),o=d.ref(0);let s=d.reactive(n.selectedFilters??{}),c=d.reactive(n.selectedRanges??{}),f=d.reactive(n.fixedAxes??{});const A=d.computed(()=>!(n.disabled||!n.multiple&&n.droppedIds.length>0)),p=d.computed(()=>n.disabled?"1 true":!A.value&&n.draggedId?"2 true":!1);d.watch(()=>n.selectedFilters,()=>{s=d.reactive(n.selectedFilters??{})}),d.watch(()=>n.fixedAxes,()=>{f=d.reactive(n.fixedAxes??{})}),d.watch(()=>n.droppedIds,()=>{o.value++},{deep:!0}),n.sortable&&rt.useSortable(i,{handle:".dnd-basket-chip__handler",onChange(_){r("reorder",_.map(P=>n.droppedIds[P]))}});function v(){a.value&&!n.disabled&&A.value&&a.value.classList.add("active")}function y(){a.value&&a.value.classList.remove("active")}function b(_){_.stopPropagation(),A.value&&(n.draggedId&&r("drop-item",{draggedId:n.draggedId,id:n.id}),y())}function C(_){_.preventDefault()}function x(_){_.preventDefault(),v()}const k=async(_,P)=>{var F;const N=((F=n.labelsInfo[_])==null?void 0:F.options)??[],I=P.toLowerCase();return N.filter(Q=>Q.value.toLowerCase().includes(I)||Q.label.toLowerCase().includes(I)).slice(0,K0e)};return(_,P)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"basketRoot",ref:a,class:d.normalizeClass([{disabled:p.value,empty:_.droppedIds.length===0,readonly:_.readonly},"dnd-basket"]),dropzone:"true",onDrop:b,onDragenter:C,onDragover:x,onDragleave:y},[d.createElementVNode("div",j0e,[_.required?(d.openBlock(),d.createElementBlock("span",Y0e,P[0]||(P[0]=[d.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"6",height:"16",viewBox:"0 0 6 16",fill:"none"},[d.createElementVNode("path",{d:"M2.01685 6.8L3 5.34159L3.97612 6.8L4.89607 6.12743L3.81461 4.7469L5.5 4.25133L5.14888 3.16106L3.50562 3.77699L3.56882 2H2.43118L2.49438 3.77699L0.851124 3.16106L0.5 4.25133L2.18539 4.7469L1.09691 6.12743L2.01685 6.8Z",fill:"#F1222F"})],-1)]))):d.createCommentVNode("",!0),d.createTextVNode(" "+d.toDisplayString(_.title),1)]),d.createElementVNode("div",W0e,[_.droppedIds.length?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",X0e," Drop dimensions here ")),(d.openBlock(),d.createElementBlock("div",{ref_key:"listRef",ref:i,key:o.value,class:"dnd-basket__chip-wrapper"},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(_.droppedIds,(N,I)=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:N},[!_.isFilter||_.info[N].isSubsetFilter?(d.openBlock(),d.createBlock(I0e,{key:0,modelValue:d.unref(f)[N],"onUpdate:modelValue":[F=>d.unref(f)[N]=F,F=>_.$emit("select-fixed-axis-value",{v:F,idx:I})],sortable:_.sortable,error:_.consistency[N]===!1,info:_.info[N],"search-options":k,onCloseChip:F=>_.$emit("remove-item",{chipId:N,basketId:_.id})},null,8,["modelValue","onUpdate:modelValue","sortable","error","info","onCloseChip"])):_.info[N].isDiscreteFilter?(d.openBlock(),d.createBlock(k0e,{key:1,filter:d.unref(s)[N],"onUpdate:filter":[F=>d.unref(s)[N]=F,F=>_.$emit("select-filter-value",{v:F,idx:I})],"fixed-axes":d.unref(f)[N],"onUpdate:fixedAxes":[F=>d.unref(f)[N]=F,F=>_.$emit("select-fixed-axis-value",{v:F,idx:I})],info:_.info[N],error:_.consistency[N]===!1,sortable:_.sortable,"search-options":k,onCloseChip:F=>_.$emit("remove-item",{chipId:N,basketId:_.id})},null,8,["filter","onUpdate:filter","fixed-axes","onUpdate:fixedAxes","info","error","sortable","onCloseChip"])):(d.openBlock(),d.createBlock(G0e,{key:2,filter:d.unref(c)[N],"onUpdate:filter":[F=>d.unref(c)[N]=F,F=>_.$emit("select-filter-range",{v:F,idx:I})],"fixed-axes":d.unref(f)[N],"onUpdate:fixedAxes":[F=>d.unref(f)[N]=F,F=>_.$emit("select-fixed-axis-value",{v:F,idx:I})],info:_.info[N],error:_.consistency[N]===!1,"search-options":k,onCloseChip:F=>_.$emit("remove-item",{chipId:N,basketId:_.id})},null,8,["filter","onUpdate:filter","fixed-axes","onUpdate:fixedAxes","info","error","onCloseChip"]))],64))),128))]))])],34))}}),Z0e={class:"inputs-block"},J0e={class:"separator"},q0e={class:"arrow-circle"},ehe={class:"inputs-block"},ig=d.defineComponent({__name:"FormLayout",setup(e){return(t,n)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createElementVNode("div",{class:"left-block",onClick:n[0]||(n[0]=r=>r.stopPropagation())},[n[2]||(n[2]=d.createElementVNode("h3",null," Data Mapping ",-1)),d.createElementVNode("div",Z0e,[d.renderSlot(t.$slots,"dataInputs"),d.renderSlot(t.$slots,"mandatoryOptions"),d.renderSlot(t.$slots,"metadataOptions")])]),d.createElementVNode("div",J0e,[d.createElementVNode("div",q0e,[d.createVNode(d.unref(rt.PlIcon16),{name:"arrow-right"})])]),d.createElementVNode("div",{class:"right-block",onClick:n[1]||(n[1]=r=>r.stopPropagation())},[n[3]||(n[3]=d.createElementVNode("h3",null," Chart variables ",-1)),d.createElementVNode("div",ehe,[d.renderSlot(t.$slots,"chartVar")])])],64))}}),the={class:"dnd-chip__icon"},nhe={class:"dnd-chip__title-wrapper"},rhe=["title"],ahe=["title"],w6=d.defineComponent({__name:"DndChip",props:{info:{}},emits:["dragstart","dragend"],setup(e,{emit:t}){const n=e,r=t,a=d.ref(),i=d.computed(()=>n.info.uniqueValues.join("/"));function o(c){var f,A;(f=c.dataTransfer)==null||f.clearData(),(A=c.dataTransfer)==null||A.setData("text/plain",n.info.id),r("dragstart",n.info.id),c.target.style.opacity="0.4",a.value&&a.value.classList.toggle("drag-active")}function s(c){r("dragend",n.info.id),c.target.style.opacity="1",a.value&&a.value.classList.toggle("drag-active")}return(c,f)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"chipRoot",ref:a,draggable:"true",class:"dnd-chip",onDragstart:o,onDragend:s},[d.createElementVNode("div",the,[d.createVNode(d.unref(s5),{name:c.info.isSubsetFilter?"cell-type-subset":c.info.type==="String"?"cell-type-txt":"cell-type-num"},null,8,["name"])]),d.createElementVNode("div",nhe,[d.createElementVNode("div",{class:"dnd-chip__title",title:c.info.title},d.toDisplayString(c.info.title),9,rhe),c.info.nonHomogenous?(d.openBlock(),d.createElementBlock("div",{key:0,class:"dnd-chip__sub-title",title:i.value},d.toDisplayString(i.value),9,ahe)):d.createCommentVNode("",!0)])],544))}}),ihe={key:0,class:"metadata-block"},ohe={class:"title"},lhe={class:"metadata-block__search"},she={class:"metadata-block__items"},cy=d.defineComponent({__name:"OptionsList",props:{options:{},chipInfo:{},title:{default:"Metadata"}},emits:["dragged-id-update"],setup(e,{emit:t}){const n=e,r=d.computed(()=>n.options.length===0),a=d.ref(),i=d.computed(()=>{var s;const o=((s=a.value)==null?void 0:s.toLowerCase())??"";return n.options.filter(c=>{const f=n.chipInfo[c.id].title??"";return f==null?void 0:f.toLowerCase().includes(o)})});return(o,s)=>r.value?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",ihe,[d.createElementVNode("div",ohe,d.toDisplayString(o.title),1),d.createElementVNode("div",lhe,[d.createVNode(d.unref(rt.PlSearchField),{modelValue:a.value,"onUpdate:modelValue":s[0]||(s[0]=c=>a.value=c),placeholder:"Find...",clearable:""},null,8,["modelValue"])]),d.createElementVNode("div",she,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(i.value,({id:c})=>(d.openBlock(),d.createBlock(w6,{key:c,info:o.chipInfo[c],onDragstart:s[1]||(s[1]=f=>o.$emit("dragged-id-update",f)),onDragend:s[2]||(s[2]=f=>o.$emit("dragged-id-update",null))},null,8,["info"]))),128))])]))}}),uhe={key:0,class:"metadata-block",style:{flexShrink:0}},che={class:"title"},fhe={class:"metadata-block__items"},fy=d.defineComponent({__name:"MandatoryOptions",props:{options:{},chipInfo:{},title:{default:"Drag to build the chart"}},emits:["dragged-id-update"],setup(e,{emit:t}){const n=e,r=d.computed(()=>n.options.length===0);return(a,i)=>r.value?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",uhe,[d.createElementVNode("div",che,d.toDisplayString(a.title),1),d.createElementVNode("div",fhe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.options,({id:o})=>(d.openBlock(),d.createBlock(w6,{key:o,info:a.chipInfo[o],onDragstart:i[0]||(i[0]=s=>a.$emit("dragged-id-update",s)),onDragend:i[1]||(i[1]=s=>a.$emit("dragged-id-update",null))},null,8,["info"]))),128))])]))}});function dy(e,t,n,r,a,i){const o=e.value.reactive.optionsState,s=d.toRef(e.value.reactive,"optionsState"),c=d.computed(()=>e.value.inputGuide.value),f=d.computed(()=>e.value.uniqueValuesData.value);function A(X){return rL(s,X,e.value.controller,e.value.columnsDataStore)}function p(X){return nL(s,X,e.value.controller,e.value.columnsDataStore,c)}function v(X){return tL(s,X,e.value.controller,e.value.columnsDataStore,c)}const y=d.ref({...t.reduce((X,te)=>(X[te]=A(te),X),{})}),b=d.ref({...n.reduce((X,te)=>(X[te]=v(te),X),{}),...r.reduce((X,te)=>(X[te]=p(te),X),{})}),C=d.computed(()=>aL(o,c)),x=d.computed(()=>pue(c,a)),k=d.computed(()=>hue(c,a)),_=d.ref(null),P=d.computed(()=>{const X=new Set;return a.forEach(te=>{C.value[te].forEach(he=>{X.add(he.value)}),o.components[te].selectorStates.forEach(he=>{X.add(he.selectedSource)})}),oL(c.value,e.value.uniqueValuesData.value,[...X])});function N(X){return o.components[X].selectorStates.reduce((te,he)=>(he.type!=="range"&&(te[he.selectedSource]=he.selectedFilterValue),te),{})}function I(X){return o.components[X].selectorStates.reduce((te,he)=>(te[he.selectedSource]=he.selectedFilterRange?[he.selectedFilterRange.min,he.selectedFilterRange.max]:he.selectedFilterValue?[Number(he.selectedFilterValue),Number(he.selectedFilterValue)]:[0,0],te),{})}function F(X){return o.components[X].selectorStates.reduce((te,he)=>{const ae=c.value.getSourceInfo(he.selectedSource);return ae.kind==="axis"||(te[he.selectedSource]=ae.axesToBeFixed.reduce((ge,me)=>{var fe;return ge[me]=((fe=he.fixedAxes)==null?void 0:fe.find(be=>be.axisSource===me))??{axisSource:me,axisValue:void 0,axisIdx:ae.axesToBeFixedIndexes[me]},ge},{})??{}),te},{})}function Q(X){b.value[X.id]=[...b.value[X.id],X.draggedId],_.value=null}function Z(X){b.value[X.basketId]=b.value[X.basketId].filter(te=>te!==X.chipId)}function ee(X,te){b.value[te]=X}function le(X){return new Set(c.value.components[X].options.map(te=>te.value))}function z(X){return c.value.components[X].stateConsistency}function U(X){return!c.value.readyData||C.value[X].length===0||_.value!==null&&!P.value[_.value].availableBasketIds.has(X)}const G=d.computed(()=>a.map(X=>{var ge;const te=c.value.components[X],he=X==="filters"||X==="highlight",ae={id:X,title:i[X],isFilter:he,sortable:X==="tooltipContent",multiple:te.multipleSelectors,required:te.required,disabled:U(X),readonly:((ge=e.value.readonlyInputs)==null?void 0:ge.includes(X))??!1,consistency:z(X),draggedId:_.value,availableIds:le(X),droppedIds:b.value[X],info:P.value,fixedAxes:F(X),labelsInfo:f.value,listeners:{"drop-item":Q,"remove-item":Z,reorder:me=>ee(me,X),"select-fixed-axis-value":me=>{const fe=o.components[X].selectorStates[me.idx];fe.fixedAxes=Object.values(me.v);for(const be of Object.values(o.components))for(const He of be.selectorStates)fe.fixedAxes.forEach(_e=>{He.fixedAxes&&(He.fixedAxes=He.fixedAxes.map(Ie=>({...Ie,axisValue:_e.axisSource===Ie.axisSource?_e.axisValue:Ie.axisValue})))})}}};return he&&(ae.selectedFilters=N(X),ae.selectedRanges=I(X),ae.listeners["select-filter-value"]=me=>{const fe=o.components[X].selectorStates[me.idx];fe.type="equals",fe.selectedFilterValue=me.v},ae.listeners["select-filter-range"]=me=>{const fe=o.components[X].selectorStates[me.idx];fe.type="range",fe.selectedFilterRange=me.v}),ae}));function Y(){_.value=null}return{draggedId:_,cleanDraggedId:Y,basketsData:G,freeMetaOptions:x,freeMandatoryOptions:k,chipInfo:P,dataStateValues:y,dataOptions:C}}const dhe={class:"data-form-input-item"},Ahe=d.defineComponent({__name:"DiscreteForm",setup(e){const t=Tr();d.watch(()=>t.value.commonHelpersData.primaryGroups.value,FS(t));const n=["filters","primaryGrouping","secondaryGrouping","tabBy","facetBy"],r={filters:"Filter",primaryGrouping:"Primary grouping",secondaryGrouping:"Secondary grouping",tabBy:"Tab by",facetBy:"Facet by"},{draggedId:a,basketsData:i,freeMetaOptions:o,freeMandatoryOptions:s,chipInfo:c,dataStateValues:f,dataOptions:A}=dy(t,["y"],["filters","tabBy"],["primaryGrouping","secondaryGrouping","facetBy"],n,r),p=d.computed(()=>{var v;return((v=t.value.readonlyInputs)==null?void 0:v.includes("y"))??!1});return(v,y)=>(d.openBlock(),d.createBlock(ig,null,{dataInputs:d.withCtx(()=>[d.createElementVNode("div",dhe,[d.createVNode(d.unref(rt.PlDropdown),{modelValue:d.unref(f).y,"onUpdate:modelValue":y[0]||(y[0]=b=>d.unref(f).y=b),options:d.unref(A).y,disabled:p.value,error:d.unref(ty)("y",d.unref(t).inputGuide.value),label:"Y:",clearable:!p.value},null,8,["modelValue","options","disabled","error","clearable"])])]),mandatoryOptions:d.withCtx(()=>[d.createVNode(fy,{options:d.unref(s),chipInfo:d.unref(c),onDraggedIdUpdate:y[1]||(y[1]=b=>a.value=b)},null,8,["options","chipInfo"])]),metadataOptions:d.withCtx(()=>[d.createVNode(cy,{options:d.unref(o),chipInfo:d.unref(c),onDraggedIdUpdate:y[2]||(y[2]=b=>a.value=b)},null,8,["options","chipInfo"])]),chartVar:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(i),b=>(d.openBlock(),d.createElementBlock("div",{key:b.id,class:"data-form-input-item"},[d.createVNode(ag,d.mergeProps({ref_for:!0},b,d.toHandlers(b.listeners)),null,16)]))),128))]),_:1}))}}),phe={class:"data-form-input-item"},hhe={class:"data-form-input-item",style:{"margin-top":"10px"}},vhe=d.defineComponent({__name:"ScatterplotForm",setup(e){const t=Tr(),n=["filters","highlight","grouping","size","shape","tooltipContent","label","tabBy","facetBy"],r={filters:"Filter",highlight:"Highlight",grouping:"Grouping / Color",size:"Size",shape:"Shape",tooltipContent:"Tooltip",label:"Label",tabBy:"Tab by",facetBy:"Facet by"},{draggedId:a,basketsData:i,freeMetaOptions:o,freeMandatoryOptions:s,chipInfo:c,dataStateValues:f,dataOptions:A}=dy(t,["x","y"],["filters","tabBy","highlight"],["grouping","size","shape","tooltipContent","label","facetBy"],n,r),p=d.computed(()=>{var y;return((y=t.value.readonlyInputs)==null?void 0:y.includes("x"))??!1}),v=d.computed(()=>{var y;return((y=t.value.readonlyInputs)==null?void 0:y.includes("y"))??!1});return(y,b)=>(d.openBlock(),d.createBlock(ig,null,{dataInputs:d.withCtx(()=>[d.createElementVNode("div",phe,[d.createVNode(d.unref(rt.PlDropdown),{label:"X:",clearable:"",modelValue:d.unref(f).x,"onUpdate:modelValue":b[0]||(b[0]=C=>d.unref(f).x=C),options:d.unref(A).x,disabled:p.value},null,8,["modelValue","options","disabled"])]),d.createElementVNode("div",hhe,[d.createVNode(d.unref(rt.PlDropdown),{label:"Y:",clearable:"",modelValue:d.unref(f).y,"onUpdate:modelValue":b[1]||(b[1]=C=>d.unref(f).y=C),options:d.unref(A).y,disabled:v.value},null,8,["modelValue","options","disabled"])])]),mandatoryOptions:d.withCtx(()=>[d.createVNode(fy,{options:d.unref(s),chipInfo:d.unref(c),onDraggedIdUpdate:b[2]||(b[2]=C=>a.value=C)},null,8,["options","chipInfo"])]),metadataOptions:d.withCtx(()=>[d.createVNode(cy,{options:d.unref(o),chipInfo:d.unref(c),onDraggedIdUpdate:b[3]||(b[3]=C=>a.value=C)},null,8,["options","chipInfo"])]),chartVar:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(i),C=>(d.openBlock(),d.createElementBlock("div",{key:C.id,class:"data-form-input-item"},[d.createVNode(ag,d.mergeProps({ref_for:!0},C,d.toHandlers(C.listeners)),null,16)]))),128))]),_:1}))}}),mhe={class:"data-form-input-item"},ghe={class:"data-form-input-item",style:{"margin-top":"10px"}},yhe=d.defineComponent({__name:"ScatterplotUmapForm",setup(e){const t=Tr(),n=["filters","highlight","grouping","size","tabBy","tooltipContent","label"],r={filters:"Filter",highlight:"Highlight",grouping:"Grouping / Color",size:"Size",tabBy:"Tab by",tooltipContent:"Tooltip",label:"Label"},{draggedId:a,basketsData:i,freeMetaOptions:o,freeMandatoryOptions:s,chipInfo:c,dataStateValues:f,dataOptions:A}=dy(t,["x","y"],["filters","tabBy","highlight"],["grouping","size","tooltipContent","label"],n,r),p=d.computed(()=>{var y;return((y=t.value.readonlyInputs)==null?void 0:y.includes("x"))??!1}),v=d.computed(()=>{var y;return((y=t.value.readonlyInputs)==null?void 0:y.includes("y"))??!1});return(y,b)=>(d.openBlock(),d.createBlock(ig,null,{dataInputs:d.withCtx(()=>[d.createElementVNode("div",mhe,[d.createVNode(d.unref(rt.PlDropdown),{label:"X:",clearable:"",modelValue:d.unref(f).x,"onUpdate:modelValue":b[0]||(b[0]=C=>d.unref(f).x=C),options:d.unref(A).x,disabled:p.value},null,8,["modelValue","options","disabled"])]),d.createElementVNode("div",ghe,[d.createVNode(d.unref(rt.PlDropdown),{label:"Y:",clearable:"",modelValue:d.unref(f).y,"onUpdate:modelValue":b[1]||(b[1]=C=>d.unref(f).y=C),options:d.unref(A).y,disabled:v.value},null,8,["modelValue","options","disabled"])])]),mandatoryOptions:d.withCtx(()=>[d.createVNode(fy,{options:d.unref(s),chipInfo:d.unref(c),onDraggedIdUpdate:b[2]||(b[2]=C=>a.value=C)},null,8,["options","chipInfo"])]),metadataOptions:d.withCtx(()=>[d.createVNode(cy,{options:d.unref(o),chipInfo:d.unref(c),onDraggedIdUpdate:b[3]||(b[3]=C=>a.value=C)},null,8,["options","chipInfo"])]),chartVar:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(i),C=>(d.openBlock(),d.createElementBlock("div",{key:C.id,class:"data-form-input-item"},[d.createVNode(ag,d.mergeProps({ref_for:!0},C,d.toHandlers(C.listeners)),null,16)]))),128))]),_:1}))}}),whe={class:"data-form-input-item"},Che=d.defineComponent({__name:"HeatmapForm",setup(e){const t=Tr(),n=["filters","x","y","xGroupBy","yGroupBy","tooltipContent","tabBy","facetBy","annotationsX","annotationsY"],r={filters:"Filter",x:"X",y:"Y",xGroupBy:"X group",yGroupBy:"Y group",tooltipContent:"Tooltip",tabBy:"Tab by",facetBy:"Facet by",annotationsX:"Annotations X",annotationsY:"Annotations Y"},{draggedId:a,basketsData:i,freeMetaOptions:o,freeMandatoryOptions:s,chipInfo:c,dataStateValues:f,dataOptions:A}=dy(t,["value"],["filters","tabBy"],["x","y","xGroupBy","yGroupBy","tooltipContent","facetBy","annotationsX","annotationsY"],n,r),p=d.computed(()=>{var v;return((v=t.value.readonlyInputs)==null?void 0:v.includes("value"))??!1});return(v,y)=>(d.openBlock(),d.createBlock(ig,null,{dataInputs:d.withCtx(()=>[d.createElementVNode("div",whe,[d.createVNode(d.unref(rt.PlDropdown),{label:"Data source:",clearable:"",modelValue:d.unref(f).value,"onUpdate:modelValue":y[0]||(y[0]=b=>d.unref(f).value=b),options:d.unref(A).value,disabled:p.value,error:d.unref(ty)("value",d.unref(t).inputGuide.value)},null,8,["modelValue","options","disabled","error"])])]),mandatoryOptions:d.withCtx(()=>[d.createVNode(fy,{options:d.unref(s),chipInfo:d.unref(c),onDraggedIdUpdate:y[1]||(y[1]=b=>a.value=b)},null,8,["options","chipInfo"])]),metadataOptions:d.withCtx(()=>[d.createVNode(cy,{options:d.unref(o),chipInfo:d.unref(c),onDraggedIdUpdate:y[2]||(y[2]=b=>a.value=b)},null,8,["options","chipInfo"])]),chartVar:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(i),b=>(d.openBlock(),d.createElementBlock("div",{key:b.id,class:"data-form-input-item"},[d.createVNode(ag,d.mergeProps({ref_for:!0},b,d.toHandlers(b.listeners)),null,16)]))),128))]),_:1}))}}),bhe={class:"data-form-input-item"},Ehe={key:0,class:"metadata-block"},xhe={class:"metadata-block__items"},She={key:1,class:"metadata-block"},Bhe={class:"metadata-block__items"},khe={key:0,class:"data-form-input-item"},The=d.defineComponent({__name:"DendroForm",setup(e){const t=Tr(),n=t.value.reactive.optionsState,r=d.toRef(t.value.reactive,"optionsState"),a=d.computed(()=>t.value.inputGuide.value),i=d.computed(()=>t.value.uniqueValuesData.value);function o(G){return rL(r,G,t.value.controller,t.value.columnsDataStore)}function s(G){return nL(r,G,t.value.controller,t.value.columnsDataStore,a)}function c(G){return tL(r,G,t.value.controller,t.value.columnsDataStore,a)}const f=d.ref({value:o("value"),tableContent:s("tableContent"),heatmapAnnotation:s("heatmapAnnotation"),heatmapForSequence:s("heatmapForSequence"),filters:c("filters"),tabBy:c("tabBy"),height:s("height"),labels:s("labels"),nodeShape:s("nodeShape"),nodeColor:s("nodeColor"),nodeSize:s("nodeSize"),lineColor:s("lineColor"),heatmapAxis:s("heatmapAxis"),heatmapGroup:s("heatmapGroup")});d.watch(()=>f.value.nodeShape,G=>{t.value.reactive.layersSettings.dendro.dotShape=G.length?{type:"nodeShape",value:G[0]}:X3}),d.watch(()=>f.value.nodeColor,G=>{t.value.reactive.layersSettings.dendro.dotFill=G.length?{type:"nodeColor",value:G[0]}:gi}),d.watch(()=>f.value.lineColor,G=>{t.value.reactive.layersSettings.dendro.lineColor=G.length?{type:"lineColor",value:G[0]}:gi});const A=d.computed(()=>aL(n,a)),p=d.computed(()=>zS(a,y)),v=d.computed(()=>p.value.filter(G=>G.info.kind==="axis")),y=["height","tableContent","labels","heatmapAnnotation","heatmapAxis","heatmapGroup","heatmapForSequence","nodeShape","nodeColor","nodeSize","lineColor"],b={height:"Connections length",tableContent:"Table/tooltip content",labels:"Labels",heatmapAnnotation:"Heatmap annotation",heatmapAxis:"Heatmap axis",heatmapGroup:"Heatmap group",heatmapForSequence:"Alignment data",nodeShape:"Node shape",nodeColor:"Node color",nodeSize:"Node size",lineColor:"Line color"},C=d.ref(null),x=d.computed(()=>{const G=new Set;return y.forEach(Y=>{A.value[Y].forEach(X=>{G.add(X.value)}),n.components[Y].selectorStates.forEach(X=>{G.add(X.selectedSource)})}),oL(a.value,i.value,[...G])});function k(G){return n.components[G].selectorStates.reduce((Y,X)=>{const te=a.value.getSourceInfo(X.selectedSource);return te.kind==="axis"||(Y[X.selectedSource]=te.axesToBeFixed.reduce((he,ae)=>{var ge;return he[ae]=((ge=X.fixedAxes)==null?void 0:ge.find(me=>me.axisSource===ae))??{axisSource:ae,axisValue:void 0,axisIdx:te.axesToBeFixedIndexes[ae]},he},{})??{}),Y},{})}function _(G){f.value[G.id]=[...f.value[G.id],G.draggedId],C.value=null}function P(G,Y){f.value[Y]=G}function N(G){f.value[G.basketId]=f.value[G.basketId].filter(Y=>Y!==G.chipId)}function I(G){return new Set(a.value.components[G].options.map(Y=>Y.value))}function F(G){return a.value.components[G].stateConsistency}function Q(G){return!a.value.readyData||A.value[G].length===0||C.value!==null&&!x.value[C.value].availableBasketIds.has(G)}const Z=d.computed(()=>y.map(G=>{var te;const Y=a.value.components[G];return{id:G,title:b[G],isFilter:!1,sortable:G==="tableContent",multiple:Y.multipleSelectors,required:Y.required,disabled:Q(G),readonly:((te=t.value.readonlyInputs)==null?void 0:te.includes(G))??!1,consistency:F(G),draggedId:C.value,availableIds:I(G),droppedIds:f.value[G],info:x.value,labelsInfo:i.value,listeners:{"drop-item":_,"remove-item":N,reorder:he=>P(he,G),"select-fixed-axis-value":he=>{const ae=n.components[G].selectorStates[he.idx];ae.fixedAxes=Object.values(he.v);for(const ge of Object.values(n.components))for(const me of ge.selectorStates)ae.fixedAxes.forEach(fe=>{me.fixedAxes&&(me.fixedAxes=me.fixedAxes.map(be=>({...be,axisValue:fe.axisSource===be.axisSource?fe.axisValue:be.axisValue})))})}},fixedAxes:k(G)}}));function ee(G){return G==="heatmapAxis"||G==="heatmapGroup"?f.value.heatmapAnnotation!==null:!0}function le(){C.value=null}["value"].forEach(G=>{d.watch([()=>f.value[G],()=>A.value],([Y,X])=>{(typeof Y>"u"||iL("value",a.value))&&X[G]&&X[G].length&&t.value.controller.changeSelected(G,t.value.columnsDataStore,t.value.reactive.optionsState,[{selectedSource:X[G][0].value}])},{immediate:!0})});const U=d.computed(()=>{var G;return((G=t.value.readonlyInputs)==null?void 0:G.includes("value"))??!1});return(G,Y)=>(d.openBlock(),d.createBlock(ig,null,{dataInputs:d.withCtx(()=>[d.createElementVNode("div",bhe,[d.createVNode(d.unref(rt.PlDropdown),{label:"Data source:",modelValue:f.value.value,"onUpdate:modelValue":Y[0]||(Y[0]=X=>f.value.value=X),options:A.value.value,disabled:U.value,error:d.unref(ty)("value",a.value)},null,8,["modelValue","options","disabled","error"])]),v.value.length>0?(d.openBlock(),d.createElementBlock("div",Ehe,[Y[3]||(Y[3]=d.createElementVNode("div",{class:"title"},"Drag to build the chart",-1)),d.createElementVNode("div",xhe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(v.value,({id:X})=>(d.openBlock(),d.createBlock(w6,{key:X,info:x.value[X],onDragstart:Y[1]||(Y[1]=te=>C.value=te),onDragend:le},null,8,["info"]))),128))])])):d.createCommentVNode("",!0),p.value.length>0?(d.openBlock(),d.createElementBlock("div",She,[Y[4]||(Y[4]=d.createElementVNode("div",{class:"title"},"Metadata",-1)),d.createElementVNode("div",Bhe,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(p.value,({id:X})=>(d.openBlock(),d.createBlock(w6,{key:X,info:x.value[X],onDragstart:Y[2]||(Y[2]=te=>C.value=te),onDragend:le},null,8,["info"]))),128))])])):d.createCommentVNode("",!0)]),chartVar:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(Z.value,X=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:X.id},[ee(X.id)?(d.openBlock(),d.createElementBlock("div",khe,[d.createVNode(ag,d.mergeProps({ref_for:!0},X,d.toHandlers(X.listeners)),null,16)])):d.createCommentVNode("",!0)],64))),128))]),_:1}))}}),_he={class:"data-form-input-item"},Dhe=d.defineComponent({__name:"HistogramForm",setup(e){const t=Tr(),n=["filters","grouping","tabBy","facetBy"],r={filters:"Filter",grouping:"Grouping",tabBy:"Tab by",facetBy:"Facet by"},{draggedId:a,basketsData:i,freeMetaOptions:o,freeMandatoryOptions:s,chipInfo:c,dataStateValues:f,dataOptions:A}=dy(t,["value"],["filters","tabBy"],["facetBy","grouping"],n,r),p=d.computed(()=>{var v;return((v=t.value.readonlyInputs)==null?void 0:v.includes("value"))??!1});return(v,y)=>(d.openBlock(),d.createBlock(ig,null,{dataInputs:d.withCtx(()=>[d.createElementVNode("div",_he,[d.createVNode(d.unref(rt.PlDropdown),{modelValue:d.unref(f).value,"onUpdate:modelValue":y[0]||(y[0]=b=>d.unref(f).value=b),options:d.unref(A).value,disabled:p.value,error:d.unref(ty)("value",d.unref(t).inputGuide.value),label:"Data value:",clearable:!p.value},null,8,["modelValue","options","disabled","error","clearable"])])]),mandatoryOptions:d.withCtx(()=>[d.createVNode(fy,{options:d.unref(s),chipInfo:d.unref(c),onDraggedIdUpdate:y[1]||(y[1]=b=>a.value=b)},null,8,["options","chipInfo"])]),metadataOptions:d.withCtx(()=>[d.createVNode(cy,{options:d.unref(o),chipInfo:d.unref(c),onDraggedIdUpdate:y[2]||(y[2]=b=>a.value=b)},null,8,["options","chipInfo"])]),chartVar:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(i),b=>(d.openBlock(),d.createElementBlock("div",{key:b.id,class:"data-form-input-item"},[d.createVNode(ag,d.mergeProps({ref_for:!0},b,d.toHandlers(b.listeners)),null,16)]))),128))]),_:1}))}}),Phe={class:"data-form-input-item"},Mhe={class:"data-form-input-item",style:{"margin-top":"10px"}},Hhe=d.defineComponent({__name:"BubbleForm",setup(e){const t=Tr(),n=["filters","x","y","tooltipContent","tabBy","facetBy"],r={filters:"Filter",x:"X",y:"Y",tooltipContent:"Tooltip",tabBy:"Tab by",facetBy:"Facet by"},{draggedId:a,basketsData:i,freeMetaOptions:o,freeMandatoryOptions:s,chipInfo:c,dataStateValues:f,dataOptions:A}=dy(t,["valueColor","valueSize"],["filters","tabBy"],["x","y","tooltipContent","facetBy"],n,r),p=d.computed(()=>{var y;return((y=t.value.readonlyInputs)==null?void 0:y.includes("valueColor"))??!1}),v=d.computed(()=>{var y;return((y=t.value.readonlyInputs)==null?void 0:y.includes("valueSize"))??!1});return(y,b)=>(d.openBlock(),d.createBlock(ig,null,{dataInputs:d.withCtx(()=>[d.createElementVNode("div",Phe,[d.createVNode(d.unref(rt.PlDropdown),{label:"Data source for color:",clearable:"",modelValue:d.unref(f).valueColor,"onUpdate:modelValue":b[0]||(b[0]=C=>d.unref(f).valueColor=C),disabled:p.value,options:d.unref(A).valueColor,error:d.unref(ty)("valueColor",d.unref(t).inputGuide.value)},null,8,["modelValue","disabled","options","error"])]),d.createElementVNode("div",Mhe,[d.createVNode(d.unref(rt.PlDropdown),{label:"Data source for size:",clearable:"",modelValue:d.unref(f).valueSize,"onUpdate:modelValue":b[1]||(b[1]=C=>d.unref(f).valueSize=C),disabled:v.value,options:d.unref(A).valueSize,error:d.unref(ty)("valueSize",d.unref(t).inputGuide.value)},null,8,["modelValue","disabled","options","error"])])]),mandatoryOptions:d.withCtx(()=>[d.createVNode(fy,{options:d.unref(s),chipInfo:d.unref(c),onDraggedIdUpdate:b[2]||(b[2]=C=>a.value=C)},null,8,["options","chipInfo"])]),metadataOptions:d.withCtx(()=>[d.createVNode(cy,{options:d.unref(o),chipInfo:d.unref(c),onDraggedIdUpdate:b[3]||(b[3]=C=>a.value=C)},null,8,["options","chipInfo"])]),chartVar:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(i),C=>(d.openBlock(),d.createElementBlock("div",{key:C.id,class:"data-form-input-item"},[d.createVNode(ag,d.mergeProps({ref_for:!0},C,d.toHandlers(C.listeners)),null,16)]))),128))]),_:1}))}}),Ihe={class:"data-form"},Rhe=d.defineComponent({__name:"index",setup(e){const t=Tr();return(n,r)=>(d.openBlock(),d.createElementBlock("div",Ihe,[d.unref(t).reactive.chartType==="discrete"?(d.openBlock(),d.createBlock(Ahe,{key:0})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="scatterplot"?(d.openBlock(),d.createBlock(vhe,{key:1})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="scatterplot-umap"?(d.openBlock(),d.createBlock(yhe,{key:2})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="heatmap"?(d.openBlock(),d.createBlock(Che,{key:3})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="dendro"?(d.openBlock(),d.createBlock(The,{key:4})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="histogram"?(d.openBlock(),d.createBlock(Dhe,{key:5})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="bubble"?(d.openBlock(),d.createBlock(Hhe,{key:6})):d.createCommentVNode("",!0)]))}}),Nhe={class:"collapsable-block-content"},Pl=d.defineComponent({__name:"CollapsableBlock",props:{iconOpen:{},icon:{},title:{},settings:{}},setup(e){var i,o,s,c,f;const t=e,n=d.ref(((i=t.settings)==null?void 0:i.defaultState)!=="open"),r={},a={};return(o=t.settings)!=null&&o.height&&(a["--title-height"]=`${(s=t.settings)==null?void 0:s.height}px`),(c=t.settings)!=null&&c.horizontalPadding&&(r.padding=`0 ${(f=t.settings)==null?void 0:f.horizontalPadding}px`),(A,p)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["collapsable-block-container",{minimized:n.value,maximized:!n.value}]),style:a},[d.createElementVNode("div",{class:"collapsable-block-title",onClick:p[0]||(p[0]=v=>n.value=!n.value),style:r},[t.icon?(d.openBlock(),d.createBlock(d.resolveDynamicComponent(!n.value&&t.iconOpen?t.iconOpen:t.icon),{key:0})):d.createCommentVNode("",!0),d.createElementVNode("span",null,d.toDisplayString(t.title),1)]),d.createElementVNode("div",Nhe,[d.renderSlot(A.$slots,"default")])],2))}}),Lhe={},$he={class:"inline-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Fhe(e,t){return d.openBlock(),d.createElementBlock("svg",$he,t[0]||(t[0]=[d.createElementVNode("path",{d:"M6 11.3773C6 11.8102 6.51272 12.0386 6.83448 11.749L10.5871 8.37165C10.8077 8.17303 10.8077 7.82697 10.5871 7.62835L6.83448 4.25103C6.51272 3.96145 6 4.1898 6 4.62268V11.3773Z",fill:"#CFD1DB"},null,-1)]))}const Tf=mr(Lhe,[["render",Fhe]]),Vhe={},Ohe={class:"inline-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Qhe(e,t){return d.openBlock(),d.createElementBlock("svg",Ohe,t[0]||(t[0]=[d.createElementVNode("path",{d:"M4.70711 6.00018C4.26165 6.00018 4.03857 6.53875 4.35355 6.85374L7.64645 10.1466C7.84171 10.3419 8.15829 10.3419 8.35355 10.1466L11.6464 6.85374C11.9614 6.53875 11.7383 6.00018 11.2929 6.00018H4.70711Z",fill:"#CFD1DB"},null,-1)]))}const _f=mr(Vhe,[["render",Qhe]]),zhe=["tabindex","onKeydown","onClick"],Df=d.defineComponent({__name:"BtnIconGroup",props:{modelValue:{},options:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){d.useSlots();const n=t,r=a=>n("update:modelValue",a);return(a,i)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["btn-icon-group",{disabled:a.disabled}])},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.options,(o,s)=>(d.openBlock(),d.createElementBlock("div",{key:o.value+":"+s,class:d.normalizeClass(["btn-icon-group__option",{active:a.modelValue===o.value}]),tabindex:a.modelValue===o.value||a.disabled?void 0:0,onKeydown:d.withKeys(c=>r(o.value),["enter"]),onClick:c=>r(o.value)},[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(o.icon)))],42,zhe))),128))],2))}}),Uhe={},Ghe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function jhe(e,t){return d.openBlock(),d.createElementBlock("svg",Ghe,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3 4.5L21 4.5V6L3 6V4.5ZM3 9L11 9V10.5L3 10.5V9ZM3 15V13.5L19 13.5V15L3 15ZM3 18H13V19.5H3V18Z",fill:"currentColor"},null,-1)]))}const F5=mr(Uhe,[["render",jhe]]),Yhe={},Whe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function Xhe(e,t){return d.openBlock(),d.createElementBlock("svg",Whe,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3 4.5L21 4.5V6L3 6V4.5ZM8 9L16 9V10.5L8 10.5V9ZM4 13.5L20 13.5V15L4 15L4 13.5ZM7 18H17V19.5H7V18Z",fill:"currentColor"},null,-1)]))}const V5=mr(Yhe,[["render",Xhe]]),Khe={},Zhe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function Jhe(e,t){return d.openBlock(),d.createElementBlock("svg",Zhe,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3 4.5L21 4.5V6L3 6V4.5ZM13 9L21 9V10.5L13 10.5V9ZM5 15V13.5L21 13.5V15L5 15ZM11 18H21V19.5H11V18Z",fill:"currentColor"},null,-1)]))}const O5=mr(Khe,[["render",Jhe]]),qhe={},e1e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function t1e(e,t){return d.openBlock(),d.createElementBlock("svg",e1e,t[0]||(t[0]=[d.createElementVNode("path",{d:"M4 19L4 5C4 4.44772 4.44772 4 5 4L19 4C19.5523 4 20 4.44772 20 5L20 19C20 19.5523 19.5523 20 19 20L5 20C4.44772 20 4 19.5523 4 19Z",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"square"},null,-1)]))}const Q5=mr(qhe,[["render",t1e]]),n1e={},r1e={width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function a1e(e,t){return d.openBlock(),d.createElementBlock("svg",r1e,t[0]||(t[0]=[d.createStaticVNode('<path d="M4.25 1H5.75" stroke="currentColor" stroke-width="1.5"></path><path d="M8.25 1H9.75" stroke="currentColor" stroke-width="1.5"></path><path d="M12.25 1H13.75" stroke="currentColor" stroke-width="1.5"></path><path d="M16.25 1H17.75" stroke="currentColor" stroke-width="1.5"></path><path d="M0.25 17H1.75" stroke="currentColor" stroke-width="1.5"></path><path d="M4.25 17H5.75" stroke="currentColor" stroke-width="1.5"></path><path d="M8.25 17H9.75" stroke="currentColor" stroke-width="1.5"></path><path d="M12.25 17H13.75" stroke="currentColor" stroke-width="1.5"></path><path d="M16.25 17H17.75" stroke="currentColor" stroke-width="1.5"></path><path d="M17 0.25L17 1.75" stroke="currentColor" stroke-width="1.5"></path><path d="M17 4.25L17 5.75" stroke="currentColor" stroke-width="1.5"></path><path d="M17 8.25L17 9.75" stroke="currentColor" stroke-width="1.5"></path><path d="M17 12.25L17 13.75" stroke="currentColor" stroke-width="1.5"></path><path d="M1 0.25L1 1.75" stroke="currentColor" stroke-width="1.5"></path><path d="M1 4.25L1 5.75" stroke="currentColor" stroke-width="1.5"></path><path d="M1 8.25L1 9.75" stroke="currentColor" stroke-width="1.5"></path><path d="M1 12.25L1 13.75" stroke="currentColor" stroke-width="1.5"></path>',17)]))}const z5=mr(n1e,[["render",a1e]]),i1e={},o1e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function l1e(e,t){return d.openBlock(),d.createElementBlock("svg",o1e,t[0]||(t[0]=[d.createElementVNode("path",{d:"M8.8148 18.2251C6.6173 18.2251 5.0498 16.6576 5.0498 14.4601V10.7401C5.0498 8.5426 6.6173 6.9751 8.8148 6.9751C11.0123 6.9751 12.5798 8.5426 12.5798 10.7401V14.4601C12.5798 16.6576 11.0123 18.2251 8.8148 18.2251ZM6.6473 14.5576C6.6473 15.7651 7.60731 16.7251 8.8148 16.7251C10.0223 16.7251 10.9823 15.7651 10.9823 14.5576V10.6276C10.9823 9.4276 10.0223 8.4676 8.8148 8.4676C7.60731 8.4676 6.6473 9.4276 6.6473 10.6276V14.5576Z",fill:"currentColor"},null,-1),d.createElementVNode("path",{d:"M15.8738 12.3751C14.3888 12.3751 13.1738 11.1751 13.1738 9.6751C13.1738 8.2051 14.4338 6.9751 15.8738 6.9751C17.3588 6.9751 18.5738 8.1751 18.5738 9.6751C18.5738 11.1751 17.3588 12.3751 15.8738 12.3751ZM14.5313 9.6751C14.5313 10.4026 15.1463 11.0176 15.8738 11.0176C16.6013 11.0176 17.2163 10.4026 17.2163 9.6751C17.2163 8.9476 16.6013 8.3326 15.8738 8.3326C15.1463 8.3326 14.5313 8.9476 14.5313 9.6751Z",fill:"currentColor"},null,-1)]))}const gB=mr(i1e,[["render",l1e]]),s1e={},u1e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function c1e(e,t){return d.openBlock(),d.createElementBlock("svg",u1e,t[0]||(t[0]=[d.createElementVNode("path",{d:"M5.75684 18.0001V16.1176H0.881836V14.6326L4.39184 7.2001H6.18434L2.67434 14.6326H5.75684V11.7076H7.34684V14.6326H8.41934V16.1176H7.34684V18.0001H5.75684Z",fill:"currentColor"},null,-1),d.createElementVNode("path",{d:"M12.5224 18.2251C10.8574 18.2251 9.46242 17.1226 9.01992 15.5476L10.5274 15.1426C10.7749 16.1026 11.6674 16.7101 12.5674 16.7101C13.7524 16.7101 14.6899 15.7576 14.6899 14.6026C14.6899 13.4176 13.7224 12.4876 12.5674 12.4876C11.6824 12.4876 11.0749 12.9076 10.7374 13.3576L9.37242 12.8776L9.70242 7.2001H15.5299V8.6776H11.1049L10.9249 11.6476C11.4574 11.2651 12.1324 11.0626 12.7699 11.0626C14.7874 11.0626 16.2724 12.5776 16.2724 14.6026C16.2724 16.6126 14.5399 18.2251 12.5224 18.2251Z",fill:"currentColor"},null,-1),d.createElementVNode("path",{d:"M19.265 12.3751C17.78 12.3751 16.565 11.1751 16.565 9.6751C16.565 8.2051 17.825 6.9751 19.265 6.9751C20.75 6.9751 21.965 8.1751 21.965 9.6751C21.965 11.1751 20.75 12.3751 19.265 12.3751ZM17.9225 9.6751C17.9225 10.4026 18.5375 11.0176 19.265 11.0176C19.9925 11.0176 20.6075 10.4026 20.6075 9.6751C20.6075 8.9476 19.9925 8.3326 19.265 8.3326C18.5375 8.3326 17.9225 8.9476 17.9225 9.6751Z",fill:"currentColor"},null,-1)]))}const yB=mr(s1e,[["render",c1e]]),f1e={},d1e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function A1e(e,t){return d.openBlock(),d.createElementBlock("svg",d1e,t[0]||(t[0]=[d.createElementVNode("path",{d:"M4.6132 6.9826C6.7057 6.9826 8.3257 8.6026 8.3257 10.8301V14.2726C8.3257 16.6351 6.7432 18.2251 4.4557 18.2251C3.3157 18.2251 2.2882 17.7901 1.5532 16.9426L2.7007 15.8701C3.1132 16.4026 3.7582 16.7401 4.4557 16.7401C5.7982 16.7401 6.7282 15.6601 6.7282 14.4751V13.1851C6.1207 13.7926 5.2957 14.1526 4.4032 14.1526C2.3857 14.1526 0.908203 12.6226 0.908203 10.6051C0.908203 8.5801 2.5957 6.9826 4.6132 6.9826ZM2.4982 10.6051C2.4982 11.7751 3.4357 12.7201 4.6057 12.7201C5.7757 12.7201 6.7282 11.7751 6.7282 10.6051C6.7282 9.4501 5.7832 8.4901 4.6132 8.4901C3.4432 8.4901 2.4982 9.4351 2.4982 10.6051Z",fill:"currentColor"},null,-1),d.createElementVNode("path",{d:"M13.2846 18.2251C11.0871 18.2251 9.51961 16.6576 9.51961 14.4601V10.7401C9.51961 8.5426 11.0871 6.9751 13.2846 6.9751C15.4821 6.9751 17.0496 8.5426 17.0496 10.7401V14.4601C17.0496 16.6576 15.4821 18.2251 13.2846 18.2251ZM11.1171 14.5576C11.1171 15.7651 12.0771 16.7251 13.2846 16.7251C14.4921 16.7251 15.4521 15.7651 15.4521 14.5576V10.6276C15.4521 9.4276 14.4921 8.4676 13.2846 8.4676C12.0771 8.4676 11.1171 9.4276 11.1171 10.6276V14.5576Z",fill:"currentColor"},null,-1),d.createElementVNode("path",{d:"M20.3436 12.3751C18.8586 12.3751 17.6436 11.1751 17.6436 9.6751C17.6436 8.2051 18.9036 6.9751 20.3436 6.9751C21.8286 6.9751 23.0436 8.1751 23.0436 9.6751C23.0436 11.1751 21.8286 12.3751 20.3436 12.3751ZM19.0011 9.6751C19.0011 10.4026 19.6161 11.0176 20.3436 11.0176C21.0711 11.0176 21.6861 10.4026 21.6861 9.6751C21.6861 8.9476 21.0711 8.3326 20.3436 8.3326C19.6161 8.3326 19.0011 8.9476 19.0011 9.6751Z",fill:"currentColor"},null,-1)]))}const wB=mr(f1e,[["render",A1e]]),p1e={},h1e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function v1e(e,t){return d.openBlock(),d.createElementBlock("svg",h1e,t[0]||(t[0]=[d.createStaticVNode('<path d="M4 4L4 20" stroke="currentColor" stroke-width="1.5" stroke-linecap="square"></path><path d="M7.25 4H8.75" stroke="currentColor" stroke-width="1.5"></path><path d="M11.25 4H12.75" stroke="currentColor" stroke-width="1.5"></path><path d="M15.25 4H16.75" stroke="currentColor" stroke-width="1.5"></path><path d="M19.25 4H20.75" stroke="currentColor" stroke-width="1.5"></path><path d="M7.25 20H8.75" stroke="currentColor" stroke-width="1.5"></path><path d="M11.25 20H12.75" stroke="currentColor" stroke-width="1.5"></path><path d="M15.25 20H16.75" stroke="currentColor" stroke-width="1.5"></path><path d="M19.25 20H20.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 3.25L20 4.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 7.25L20 8.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 11.25L20 12.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 15.25L20 16.75" stroke="currentColor" stroke-width="1.5"></path>',13)]))}const CB=mr(p1e,[["render",v1e]]),m1e={},g1e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function y1e(e,t){return d.openBlock(),d.createElementBlock("svg",g1e,t[0]||(t[0]=[d.createStaticVNode('<path d="M20 20L4 20" stroke="currentColor" stroke-width="1.5" stroke-linecap="square"></path><path d="M7.25 4H8.75" stroke="currentColor" stroke-width="1.5"></path><path d="M11.25 4H12.75" stroke="currentColor" stroke-width="1.5"></path><path d="M15.25 4H16.75" stroke="currentColor" stroke-width="1.5"></path><path d="M19.25 4H20.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 3.25L20 4.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 7.25L20 8.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 11.25L20 12.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 15.25L20 16.75" stroke="currentColor" stroke-width="1.5"></path><path d="M4 3.25L4 4.75" stroke="currentColor" stroke-width="1.5"></path><path d="M4 7.25L4 8.75" stroke="currentColor" stroke-width="1.5"></path><path d="M4 11.25L4 12.75" stroke="currentColor" stroke-width="1.5"></path><path d="M4 15.25L4 16.75" stroke="currentColor" stroke-width="1.5"></path>',13)]))}const bB=mr(m1e,[["render",y1e]]),w1e={},C1e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function b1e(e,t){return d.openBlock(),d.createElementBlock("svg",C1e,t[0]||(t[0]=[d.createStaticVNode('<path d="M4 4L4 19C4 19.5523 4.44772 20 5 20L20 20" stroke="currentColor" stroke-width="1.5" stroke-linecap="square"></path><path d="M7.25 4H8.75" stroke="currentColor" stroke-width="1.5"></path><path d="M11.25 4H12.75" stroke="currentColor" stroke-width="1.5"></path><path d="M15.25 4H16.75" stroke="currentColor" stroke-width="1.5"></path><path d="M19.25 4H20.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 3.25L20 4.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 7.25L20 8.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 11.25L20 12.75" stroke="currentColor" stroke-width="1.5"></path><path d="M20 15.25L20 16.75" stroke="currentColor" stroke-width="1.5"></path>',9)]))}const EB=mr(w1e,[["render",b1e]]),E1e={inheritAttrs:!1},x1e={class:"double-contour-temp"};function S1e(e,t,n,r,a,i){return d.openBlock(),d.createElementBlock("div",x1e,[d.createElementVNode("div",d.normalizeProps(d.guardReactiveProps(e.$attrs)),[d.renderSlot(e.$slots,"default")],16)])}const xB=mr(E1e,[["render",S1e]]),B1e={},k1e={class:"inline-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function T1e(e,t){return d.openBlock(),d.createElementBlock("svg",k1e,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.5951 8.76689C9.7962 8.43389 8.91957 8.25 8 8.25C4.27208 8.25 1.25 11.2721 1.25 15C1.25 18.7279 4.27208 21.75 8 21.75C11.7279 21.75 14.75 18.7279 14.75 15C14.75 12.7693 13.6679 10.7913 12 9.56231C11.5866 9.86693 11.2092 10.2176 10.8753 10.6067C12.3055 11.5446 13.25 13.162 13.25 15C13.25 17.8995 10.8995 20.25 8 20.25C5.10051 20.25 2.75 17.8995 2.75 15C2.75 12.1005 5.10051 9.75 8 9.75C8.51 9.75 9.00302 9.82272 9.46924 9.95836C9.80438 9.52487 10.1817 9.12566 10.5951 8.76689Z",fill:"#110529"},null,-1),d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 2.75C9.10051 2.75 6.75 5.10051 6.75 8C6.75 10.8995 9.10051 13.25 12 13.25C14.8995 13.25 17.25 10.8995 17.25 8C17.25 5.10051 14.8995 2.75 12 2.75ZM5.25 8C5.25 4.27208 8.27208 1.25 12 1.25C15.7279 1.25 18.75 4.27208 18.75 8C18.75 11.7279 15.7279 14.75 12 14.75C8.27208 14.75 5.25 11.7279 5.25 8Z",fill:"#07AD3E"},null,-1),d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M21.25 15C21.25 12.9441 20.0683 11.1643 18.3471 10.3026C18.5192 9.82834 18.6396 9.32933 18.7016 8.81237C21.0847 9.85434 22.75 12.2327 22.75 15C22.75 18.7279 19.7279 21.75 16 21.75C13.9499 21.75 12.1132 20.836 10.8753 19.3933C11.2961 19.1174 11.6749 18.7825 12 18.4005C12.963 19.5322 14.3977 20.25 16 20.25C18.8995 20.25 21.25 17.8995 21.25 15ZM11.1556 17.0269C10.8943 16.4032 10.75 15.7185 10.75 15C10.75 12.1005 13.1005 9.75 16 9.75C16.3146 9.75 16.6227 9.77767 16.922 9.83069C17.0939 9.36877 17.2026 8.87611 17.2376 8.36321C16.8364 8.28886 16.4227 8.25 16 8.25C12.2721 8.25 9.25 11.2721 9.25 15C9.25 16.139 9.53213 17.2122 10.0303 18.1534C10.481 17.8626 10.8653 17.4779 11.1556 17.0269Z",fill:"#110529"},null,-1)]))}const _1e=mr(B1e,[["render",T1e]]),D1e={key:4,class:"size"},U5=d.defineComponent({__name:"AesButton",props:{data:{}},emits:["ref"],setup(e,{emit:t}){const n=e,r=n.data.type==="fill"||n.data.type==="stroke",a=d.computed(()=>({icon__white:r&&n.data.value.toLowerCase()==="#ffffff",icon__empty:r&&n.data.value.toLowerCase()==="transparent"})),i=d.computed(()=>n.data.type==="fill"?{"background-color":n.data.value}:n.data.type==="stroke"&&!a.value.icon__empty&&!a.value.icon__white?{"border-color":n.data.value}:{});return(o,s)=>(d.openBlock(),d.createElementBlock("div",{class:"ui-aes-button",ref:c=>o.$emit("ref",c)},[d.createVNode(xB,{class:"ui-multiselect-button__contour"}),o.data.type==="fill"?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["icon icon__fill",a.value]),style:d.normalizeStyle(i.value)},null,6)):o.data.type==="stroke"?(d.openBlock(),d.createElementBlock("div",{key:1,class:d.normalizeClass(["icon icon__stroke",a.value]),style:d.normalizeStyle(i.value)},null,6)):o.data.type==="dotShape"?(d.openBlock(),d.createElementBlock("div",{key:2,class:d.normalizeClass(["icon dot",{[`dot__${o.data.value}`]:!0}])},null,2)):o.data.type==="lineType"?(d.openBlock(),d.createElementBlock("div",{key:3,class:d.normalizeClass(["icon icon__line",{[`line__${o.data.value}`]:!0}])},null,2)):o.data.type==="size"?(d.openBlock(),d.createElementBlock("span",D1e,d.toDisplayString(o.data.value),1)):o.data.type==="data"?(d.openBlock(),d.createBlock(d.resolveDynamicComponent(_1e),{key:5,class:"icon"})):d.createCommentVNode("",!0)],512))}}),P1e={},M1e={class:"inline-icon",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"};function H1e(e,t){return d.openBlock(),d.createElementBlock("svg",M1e,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2 8L7.53033 13.5303L8.59099 12.4697L4.87132 8.75L14.0607 8.75L14.0607 7.25L4.87132 7.25L8.59099 3.53033L7.53033 2.46967L2 8Z",fill:"#110529"},null,-1)]))}const I1e=mr(P1e,[["render",H1e]]),R1e={ref:"root",class:"aes-settings-form"},N1e={class:"aes-settings-form__header"},Uh=d.defineComponent({__name:"FormWrapper",props:{title:{},backTitle:{}},emits:["form:close"],setup(e,{emit:t}){return(n,r)=>(d.openBlock(),d.createBlock(d.Teleport,{to:"#graph-settings-modal"},[d.createElementVNode("div",R1e,[d.createElementVNode("div",N1e,[d.createElementVNode("div",{onClick:r[0]||(r[0]=d.withModifiers(a=>n.$emit("form:close"),["stop"])),class:"back-link"},[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(I1e))),d.createTextVNode(" "+d.toDisplayString(`Back to ${n.backTitle}`),1)]),d.createElementVNode("h3",null,d.toDisplayString(n.title),1)]),d.renderSlot(n.$slots,"default")],512)]))}}),L1e={class:"ui-multiselect-button__content"},$1e={key:0,class:"title"},F1e={key:1,class:"gradient"},V1e=6,Ay=d.defineComponent({__name:"MultiselectButton",props:{label:{},title:{},palette:{}},emits:["button-click"],setup(e,{emit:t}){const n=d.ref(void 0);rt.useLabelNotch(n);function r(a){const i=100/(a.length-1);return`background: linear-gradient(to right, ${a.map((o,s)=>`${o} ${s*i}%`).join(", ")})`}return(a,i)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"root",ref:n,class:"ui-multiselect-button",onClick:i[0]||(i[0]=d.withModifiers(o=>a.$emit("button-click"),["stop"]))},[a.label?(d.openBlock(),d.createElementBlock("label",{key:0,ref:"label"},d.toDisplayString(a.label),513)):d.createCommentVNode("",!0),d.createVNode(xB,{class:"ui-multiselect-button__contour"}),d.createElementVNode("div",L1e,[a.title?(d.openBlock(),d.createElementBlock("div",$1e,d.toDisplayString(a.title),1)):d.createCommentVNode("",!0),a.palette&&d.unref(uS)(a.palette)?(d.openBlock(),d.createElementBlock("div",F1e,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(Gi)[a.palette].colors.slice(0,V1e),o=>(d.openBlock(),d.createElementBlock("div",{class:"gradient__item",style:d.normalizeStyle({background:o})},null,4))),256))])):a.palette?(d.openBlock(),d.createElementBlock("div",{key:2,class:"gradient",style:d.normalizeStyle(r(d.unref(Gi)[a.palette].colors))},null,4)):(d.openBlock(),d.createBlock(d.unref(rt.PlIcon16),{key:3,class:"icon",name:"chevron-right"}))])],512))}}),O1e={class:"palettes-groups"},Q1e={class:"palettes-list"},z1e=["onClick"],U1e={class:"palette-gradient"},G1e={class:"palettes-list"},j1e=["onClick"],Y1e={class:"palettes-list"},W1e=["onClick"],X1e=9,py=d.defineComponent({__name:"PalettesForm",props:{selected:{},categorical:{type:Boolean,default:!0},sequential:{type:Boolean,default:!0},diverging:{type:Boolean,default:!0}},emits:["select"],setup(e,{emit:t}){const n=t;function r(i){n("select",i)}function a(i){const o=100/(i.length-1);return`background: linear-gradient(to right, ${i.map((s,c)=>`${s} ${c*o}%`).join(", ")})`}return(i,o)=>(d.openBlock(),d.createElementBlock("div",O1e,[i.categorical?(d.openBlock(),d.createElementBlock(d.Fragment,{key:0},[o[0]||(o[0]=d.createElementVNode("div",{class:"section-title"},[d.createElementVNode("span",null,"CATEGORICAL")],-1)),o[1]||(o[1]=d.createElementVNode("div",{class:"section-description"}," Best to representing categorical data ",-1)),d.createElementVNode("div",Q1e,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(yR),s=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["palettes-list__palette",{selected:i.selected===s}]),onClick:d.withModifiers(c=>r(s),["stop"])},[d.createElementVNode("div",null,d.toDisplayString(d.unref(Gi)[s].title),1),d.createElementVNode("div",U1e,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(Gi)[s].colors.slice(0,X1e),c=>(d.openBlock(),d.createElementBlock("div",{class:"palette-gradient__item",style:d.normalizeStyle({background:c})},null,4))),256))])],10,z1e))),256))])],64)):d.createCommentVNode("",!0),i.sequential?(d.openBlock(),d.createElementBlock(d.Fragment,{key:1},[o[2]||(o[2]=d.createElementVNode("div",{class:"section-title"},[d.createElementVNode("span",null,"SEQUENTIAL")],-1)),o[3]||(o[3]=d.createElementVNode("div",{class:"section-description"}," Best to representing sequential data ",-1)),d.createElementVNode("div",G1e,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(Nae),s=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["palettes-list__palette",{selected:i.selected===s}]),onClick:d.withModifiers(c=>r(s),["stop"])},[d.createElementVNode("div",null,d.toDisplayString(d.unref(Gi)[s].title),1),d.createElementVNode("div",{class:"palette-gradient",style:d.normalizeStyle(a(d.unref(Gi)[s].colors))},null,4)],10,j1e))),256))])],64)):d.createCommentVNode("",!0),i.diverging?(d.openBlock(),d.createElementBlock(d.Fragment,{key:2},[o[4]||(o[4]=d.createElementVNode("div",{class:"section-title"},[d.createElementVNode("span",null,"DIVERGING")],-1)),o[5]||(o[5]=d.createElementVNode("div",{class:"section-description"}," Best to representing diverging data ",-1)),d.createElementVNode("div",Y1e,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(Lae),s=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["palettes-list__palette",{selected:i.selected===s}]),onClick:d.withModifiers(c=>r(s),["stop"])},[d.createElementVNode("div",null,d.toDisplayString(d.unref(Gi)[s].title),1),d.createElementVNode("div",{class:"palette-gradient",style:d.normalizeStyle(a(d.unref(Gi)[s].colors))},null,4)],10,W1e))),256))])],64)):d.createCommentVNode("",!0)]))}}),K1e=["onClick"],k$=d.defineComponent({__name:"FixedColorsList",props:{modelValue:{},colorUsing:{default:"fill"},colorsList:{default:()=>N3}},emits:["update:modelValue"],setup(e,{emit:t}){return(n,r)=>(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.colorsList,a=>(d.openBlock(),d.createElementBlock("div",{key:a.color,class:d.normalizeClass(["color-item",{border:n.colorUsing==="stroke",white:a.name==="White",empty:a.name==="None",selected:a.color===n.modelValue}]),style:d.normalizeStyle(a.name!=="White"&&a.name!=="None"?`${n.colorUsing==="fill"?"background":"border-color"}: ${a.color};`:""),onClick:i=>n.$emit("update:modelValue",a.color)},r[0]||(r[0]=[d.createElementVNode("div",{class:"checkmark"},null,-1)]),14,K1e))),128))}}),Z1e=["onClick"],J1e={class:"row-item__title"},C6=d.defineComponent({__name:"FixedLineTypeList",props:{modelValue:{},list:{default:()=>$3}},emits:["update:modelValue"],setup(e,{emit:t}){return(n,r)=>(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.list,a=>(d.openBlock(),d.createElementBlock("div",{key:a,class:d.normalizeClass(["row-item",{"row-item__selected":a===n.modelValue,[`line__${a}`]:!0}]),onClick:i=>n.$emit("update:modelValue",a)},[d.createElementVNode("div",J1e,d.toDisplayString(d.unref(Fae)[a].title),1),(d.openBlock(),d.createElementBlock("svg",{class:d.normalizeClass(["row-item__line line",{[`line__${a}`]:!0}])},r[0]||(r[0]=[d.createElementVNode("line",{x1:"0",x2:"100%",y1:"50%",y2:"50%"},null,-1)]),2))],10,Z1e))),128))}}),q1e=["onClick"],T$=d.defineComponent({__name:"FixedDotShapeList",props:{modelValue:{},list:{default:()=>G7}},emits:["update:modelValue"],setup(e,{emit:t}){return(n,r)=>(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.list,a=>(d.openBlock(),d.createElementBlock("div",{key:a,class:d.normalizeClass(["color-item dot",{selected:a===n.modelValue,[`dot__${a}`]:!0}]),onClick:i=>n.$emit("update:modelValue",a)},null,10,q1e))),128))}}),b6=d.defineComponent({__name:"Popup",props:{gap:{default:8},targetRef:{},width:{default:258},height:{}},emits:["popup:close"],setup(e,{emit:t}){const n=t,r=e;function a(){n("popup:close")}const i=d.ref(),o=d.ref(r.targetRef),s=d.ref("bottom"),c=d.ref(""),f=d.ref("");function A(p,v=8){rt.usePosition(p,y=>{if(r.height&&y.offsetY+y.height+3*v+r.height>y.clientHeight){const C=y.right-y.width-v;if(y.clientHeight-y.offsetY>r.height+v){const x=y.offsetY;c.value=`left: ${C}px; top: ${x}px;`,f.value="top: 16px;",s.value="left-bottom"}else{const x=y.clientHeight-r.height-2*v;c.value=`left: ${C}px; top: ${x}px;`;const k=y.offsetY+2*Math.floor(y.height/2),_=y.clientHeight-k;f.value=`bottom: ${_}px;`,s.value="left-bottom"}}else c.value=`left: ${y.right}px; top: ${y.offsetY+y.height+v}px;`,f.value="",s.value="bottom"})}return A(o,r.gap),rt.useClickOutside([o,i],()=>a()),(p,v)=>(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[d.createElementVNode("div",{class:"popup",style:d.normalizeStyle(c.value),onClick:v[0]||(v[0]=y=>y.stopPropagation())},[d.createElementVNode("div",{ref_key:"popup",ref:i,class:d.normalizeClass(["popup__content",s.value]),style:d.normalizeStyle({width:`${p.width}px`})},[d.createElementVNode("div",null,[d.renderSlot(p.$slots,"default")]),(d.openBlock(),d.createElementBlock("svg",{style:d.normalizeStyle(f.value),class:"beak",width:"5",height:"9",viewBox:"0 0 3 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v[1]||(v[1]=[d.createElementVNode("path",{d:"M4 8L0 4L4 0L4 8 Z"},null,-1),d.createElementVNode("polyline",{points:"4,8 0,4 4,0"},null,-1)]),4))],6)],4)]))}}),eve={},tve={xmlns:"http://www.w3.org/2000/svg",width:"8",height:"12",viewBox:"0 0 8 12",fill:"none"};function nve(e,t){return d.openBlock(),d.createElementBlock("svg",tve,t[0]||(t[0]=[d.createStaticVNode('<path d="M2.5 0H0.5V2H2.5V0Z" fill="#CFD1DB"></path><path d="M2.5 5H0.5V7H2.5V5Z" fill="#CFD1DB"></path><path d="M0.5 10H2.5V12H0.5V10Z" fill="#CFD1DB"></path><path d="M7.5 0H5.5V2H7.5V0Z" fill="#CFD1DB"></path><path d="M5.5 5H7.5V7H5.5V5Z" fill="#CFD1DB"></path><path d="M7.5 10H5.5V12H7.5V10Z" fill="#CFD1DB"></path>',6)]))}const rve=mr(eve,[["render",nve]]),E6=1,ave=d.defineComponent({__name:"PlColorSliderThumb",props:{barRef:{},modelValue:{},min:{default:0},max:{default:100},getColorForPercent:{},padding:{default:16},isActive:{type:Boolean}},emits:["update:modelValue","active"],setup(e,{emit:t}){const n=e,r=t,a=d.ref(),i=d.ref(),o=d.ref(!1),s=n.min,c=n.max;let f=d.ref(0);const A=c-s,p=n.padding/n.barRef.getBoundingClientRect().width*100/2,v=d.computed(()=>i5.clamp((n.modelValue??0)+f.value,Math.ceil(s+p),Math.ceil(c-p))),y=d.computed(()=>({right:`calc(${Math.ceil((1-b.value)*100)}%) `})),b=d.computed(()=>(v.value-s)/A);function C(N){const I=i5.clamp(N,s,c);return Math.round((I+Number.EPSILON)*(1/E6))/(1/E6)}function x(){o.value=!1}function k(N){N?(document.addEventListener("mouseup",x),document.addEventListener("focusout",x)):(document.removeEventListener("mouseup",x),document.removeEventListener("focusout",x)),o.value=N,r("active",N)}rt.useMouseCapture(a,N=>{var I;i5.tapIf((I=d.unref(n.barRef))==null?void 0:I.getBoundingClientRect(),F=>{const{dx:Q}=N;f.value=Q/F.width*A,N.stop&&(r("update:modelValue",C(v.value)),f.value=0)})});function _(N){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(N.code)&&N.preventDefault(),N.code==="ArrowLeft"&&r("update:modelValue",i5.clamp(n.modelValue-E6,s,c)),N.code==="ArrowRight"&&r("update:modelValue",i5.clamp(n.modelValue+E6,s,c))}function P(N){var I,F;N?(I=i.value)==null||I.classList.add("pl-color-slider__top-index"):(F=i.value)==null||F.classList.remove("pl-color-slider__top-index")}return(N,I)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"wrapper",ref:i,style:d.normalizeStyle(y.value),class:d.normalizeClass([{"active-thumb":o.value||N.isActive},"pl-color-slider__thumb"]),tabindex:"0",onMousedown:I[2]||(I[2]=F=>k(!0)),onMouseup:I[3]||(I[3]=F=>k(!1)),onKeydown:_,onFocus:I[4]||(I[4]=F=>k(!0))},[d.createElementVNode("div",{ref_key:"thumb",ref:a,class:d.normalizeClass([{active:o.value},"pl-color-slider__thumb-roof"]),onMouseover:I[0]||(I[0]=F=>P(!0)),onMouseout:I[1]||(I[1]=F=>P(!1))},[d.createElementVNode("div",{class:"pl-color-slider__thumb-color-indicator",style:d.normalizeStyle({backgroundColor:N.getColorForPercent(v.value)})},null,4)],34)],38))}}),ive={class:"pl-color-slider"},ove={class:"pl-color-slider__wrapper"},lve={class:"pl-color-slider__thumbs-contaier"},sve=d.defineComponent({__name:"PlColorSlider",props:{colors:{},modelValue:{},getColorForPercent:{type:Function},active:{}},emits:["update:modelValue","active"],setup(e,{emit:t}){const n=e,r=t,a=d.ref(),i=d.reactive({}),o=d.ref(-1);d.watch(()=>n.modelValue,()=>{n.modelValue.forEach((A,p)=>i[p]=A)},{immediate:!0});const s=d.computed(()=>Math.floor(o.value!==-1?0-o.value:0)),c=d.computed(()=>Math.floor(o.value!==-1?100+o.value:100));d.watch(()=>i,A=>{r("update:modelValue",Object.values(A))},{deep:!0});const f=d.computed(()=>{const A=100/(n.colors.length-1);return`linear-gradient(to right, ${n.colors.map((v,y)=>`${v} ${A*y}%`).join(", ")})`});return d.onMounted(()=>{let A=16,p=a.value.getBoundingClientRect().width-A*2;o.value=A/p*100}),(A,p)=>(d.openBlock(),d.createElementBlock("div",ive,[d.createElementVNode("div",ove,[d.createElementVNode("div",{ref_key:"barRef",ref:a,class:"pl-color-slider__color-contaier"},[d.createElementVNode("div",{style:d.normalizeStyle({background:f.value}),class:"pl-color-slider__gradient"},null,4)],512),d.createElementVNode("div",lve,[a.value?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(A.modelValue,(v,y)=>(d.openBlock(),d.createBlock(ave,{modelValue:i[y],"onUpdate:modelValue":b=>i[y]=b,"is-active":A.active===y,key:y,min:s.value,max:c.value,"bar-ref":a.value,"get-color-for-percent":A.getColorForPercent,class:"pl-color-slider__thumb",tabindex:"0",onActive:b=>A.$emit("active",{index:y,status:b})},null,8,["modelValue","onUpdate:modelValue","is-active","min","max","bar-ref","get-color-for-percent","onActive"]))),128)):d.createCommentVNode("",!0)])])]))}});function _$(e,t){if(t==="lineType")return e*32+16*2;if(t==="dotShape"||t==="color")return Math.ceil(e/6)*36+20*2}const uve={class:"aes-mapping-block"},cve={style:{margin:"0 24px"}},fve={class:"section-title"},dve={style:{margin:"24px 0"}},Ave={key:0,style:{margin:"24px 0"}},pve={key:0,class:"aes-settings-hint"},hve={key:0,class:"column-value__reorder-icon"},vve={class:"column-value__title"},mve={class:"column-value__aes-group"},gve=["onClick"],yve=["onClick"],wve=["onClick"],SB=d.defineComponent({__name:"AesDataMappingDiscrete",props:{dataColumnLabel:{},columnValueLabels:{},usedAesInMapping:{},modelValue:{},allowReordering:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,a=d.ref(!1),i=d.ref(n.modelValue.palette),o=d.computed(()=>uS(i.value)),s=d.ref(null),c=d.computed(()=>s.value===null?null:n.modelValue.order.indexOf(s.value)),f=d.ref(null),A=d.computed(()=>n.modelValue.order.map(le=>{var U;const z=(U=n.modelValue.mapping[le])==null?void 0:U.aes;return{text:n.columnValueLabels[le],value:le,dotShape:z==null?void 0:z.dotShape,color:z==null?void 0:z.color,lineType:z==null?void 0:z.lineShape}}));function p(le){i.value=le,a.value=!1,r("update:modelValue",DN(le,n.modelValue.order))}function v(le,z,U){r("update:modelValue",{...n.modelValue,mapping:{...n.modelValue.mapping,[le]:{...n.modelValue.mapping[le],aes:{...n.modelValue.mapping[le].aes,[z]:U}}}})}const y=d.reactive({color:{},dotShape:{},lineType:{}});function b(le,z,U){U&&!y[le][z.value]&&(y[le][z.value]=U)}function C(le,z){const U=s.value===le.value&&f.value===z;s.value=U?null:le.value,f.value=U?null:z}function x(){s.value=null,f.value=null}const k=d.computed(()=>Gi[i.value].colors.map(le=>({color:le,name:le}))),_=d.computed(()=>f.value?_$(f.value==="lineType"?$3.length:f.value==="dotShape"?G7.length:k.value.length,f.value):0),P=d.ref();n.allowReordering&&rt.useSortable(P,{handle:".column-value__reorder-icon",onChange(le){r("update:modelValue",{...n.modelValue,order:le.map(z=>n.modelValue.order[z])})}});function N(le,z,U=0,G=1){const Y=1/(le.length-1),X=Zr().domain(le.map((te,he)=>U+he*Y*(G-U))).range(le);return te=>te>G||te<U?z:X(te)}const I=d.computed(()=>N(Gi[i.value].colors,gC)),F=d.computed(()=>N(Gi[i.value].colors,gC,0,100)),Q=d.ref(n.modelValue.order.map(le=>n.modelValue.mapping[le].colorIdx*100));d.watch(()=>n.modelValue,le=>{Q.value=le.order.map(z=>le.mapping[z].colorIdx*100)});function Z(le){le.forEach((z,U)=>{const G=n.modelValue.order[U],Y=z/100;n.modelValue.mapping[G].colorIdx!==Y&&r("update:modelValue",{...n.modelValue,mapping:{...n.modelValue.mapping,[G]:{colorIdx:Y,aes:{...n.modelValue.mapping[G].aes,color:I.value(Y)}}}})})}function ee(le){f.value="color",s.value=le.status?n.modelValue.order[le.index]:null}return(le,z)=>(d.openBlock(),d.createElementBlock("div",uve,[d.createElementVNode("div",cve,[d.createElementVNode("div",fve,[d.createElementVNode("span",null,d.toDisplayString(le.dataColumnLabel),1)]),d.createElementVNode("div",dve,[d.createVNode(Ay,{label:"Color Palette ",icon:"chevron-right",title:d.unref(Gi)[i.value].title,palette:i.value,onButtonClick:z[0]||(z[0]=U=>{a.value=!0,x()})},null,8,["title","palette"])]),o.value?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",Ave,[d.createVNode(sve,{modelValue:Q.value,"onUpdate:modelValue":[z[1]||(z[1]=U=>Q.value=U),Z],colors:d.unref(Gi)[i.value].colors,"get-color-for-percent":F.value,active:c.value,onActive:ee},null,8,["modelValue","colors","get-color-for-percent","active"])])),a.value?(d.openBlock(),d.createBlock(Uh,{key:1,title:"Color Palette","back-title":"Color mapping","onForm:close":z[2]||(z[2]=U=>a.value=!1)},{default:d.withCtx(()=>[d.createVNode(py,{selected:i.value,onSelect:p},null,8,["selected"])]),_:1})):d.createCommentVNode("",!0)]),le.allowReordering?(d.openBlock(),d.createElementBlock("div",pve," Drag the rows to reorder ")):d.createCommentVNode("",!0),d.createElementVNode("div",{class:"column-values-list",ref_key:"optionsListRef",ref:P},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(A.value,U=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["column-value",{"column-value__with-reorder":le.allowReordering}])},[le.allowReordering?(d.openBlock(),d.createElementBlock("div",hve,[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(rve)))])):d.createCommentVNode("",!0),d.createElementVNode("div",vve,d.toDisplayString(U.text),1),d.createElementVNode("div",mve,[le.usedAesInMapping.lineType?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["column-value__aes",{aes__selected:s.value===U.value&&f.value==="lineType"}]),ref_for:!0,ref:G=>b("lineType",U,G),onClick:d.withModifiers(G=>C(U,"lineType"),["stop"])},[d.createElementVNode("div",{class:d.normalizeClass(["icon__line line",{[`line__${U.lineType}`]:!0}])},null,2)],10,gve)):d.createCommentVNode("",!0),le.usedAesInMapping.dotShape?(d.openBlock(),d.createElementBlock("div",{key:1,class:d.normalizeClass(["column-value__aes",{aes__selected:s.value===U.value&&f.value==="dotShape"}]),ref_for:!0,ref:G=>b("dotShape",U,G),onClick:d.withModifiers(G=>C(U,"dotShape"),["stop"])},[d.createElementVNode("div",{class:d.normalizeClass(["dot",{[`dot__${U.dotShape}`]:!0}])},null,2)],10,yve)):d.createCommentVNode("",!0),le.usedAesInMapping.fill||le.usedAesInMapping.stroke?(d.openBlock(),d.createElementBlock("div",{key:2,class:d.normalizeClass(["column-value__aes",{aes__selected:s.value===U.value&&f.value==="color"}]),ref_for:!0,ref:G=>b("color",U,G),onClick:d.withModifiers(G=>C(U,"color"),["stop"])},[d.createElementVNode("div",{class:"column-value__color",style:d.normalizeStyle({background:U.color})},null,4)],10,wve)):d.createCommentVNode("",!0),(f.value!=="color"||o.value)&&f.value!==null&&s.value===U.value?(d.openBlock(),d.createBlock(b6,{key:`${f.value}_${s.value}`,targetRef:y[f.value][s.value],"onPopup:close":x,height:_.value},{default:d.withCtx(()=>[d.createElementVNode("div",{class:d.normalizeClass(["fixed-aes-list",{"fixed-aes-list__rows":!1}])},[f.value==="lineType"?(d.openBlock(),d.createBlock(C6,{key:0,"onUpdate:modelValue":[G=>v(U.value,"lineShape",G),G=>U.lineType=G],modelValue:U.lineType},null,8,["onUpdate:modelValue","modelValue"])):d.createCommentVNode("",!0),f.value==="dotShape"?(d.openBlock(),d.createBlock(T$,{key:1,"onUpdate:modelValue":[G=>v(U.value,"dotShape",G),G=>U.dotShape=G],modelValue:U.dotShape},null,8,["onUpdate:modelValue","modelValue"])):d.createCommentVNode("",!0),f.value==="color"?(d.openBlock(),d.createBlock(k$,{key:2,"colors-list":k.value,"onUpdate:modelValue":[G=>v(U.value,"color",G),G=>U.color=G],modelValue:U.color},null,8,["colors-list","onUpdate:modelValue","modelValue"])):d.createCommentVNode("",!0)])]),_:2},1032,["targetRef","height"])):d.createCommentVNode("",!0)])],2))),256))],512)]))}}),Cve={class:"axes-settings-list"},bve={class:"axes-settings-options-row block"},Eve={key:0,class:"axes-settings-input"},xve={class:"axes-settings-options-row"},Sve={key:0,class:"axes-settings-options-row"},Bve={key:1,class:"axes-settings-options-row"},kve={key:2,class:"axes-settings-options-row"},Tve={class:"axes-settings-options-row block"},_ve={key:3},Dve={class:"axes-settings-options-row table"},Pve={class:"axes-settings-options-row table"},Mve={class:"axes-settings-options-row table"},Hve={class:"axes-settings-options-row block"},Ive={key:0},Rve={class:"axes-settings-options-row block"},Nve={class:"axes-settings-options-row table"},Lve={class:"axes-settings-options-row table"},$ve={class:"other"},Fve={class:"axes-settings-options-row"},Vve={class:"axes-settings-options-row"},Ove={class:"axes-settings-options-row"},Qve={class:"axes-settings-options-row block"},zve=d.defineComponent({__name:"DiscreteAxesSettingsForm",setup(e){const t=Tr(),n=t.value.reactive.axesSettings,r={height:40,horizontalPadding:12,defaultState:"open"},a=[{value:"left",icon:F5},{value:"center",icon:V5},{value:"right",icon:O5}],i=[{value:"center",icon:gB},{value:"45deg",icon:yB},{value:"90deg",icon:wB}],o=[{value:"auto",text:"Auto"},{value:"custom",text:"Custom"},{value:"hidden",text:"Hide"}],s=[{value:"linear",text:"Linear"},{value:"log",text:"Log"}],c=[{value:"empty",icon:z5},{value:"left",icon:CB},{value:"bottom",icon:bB},{value:"left-bottom",icon:EB},{value:"full",icon:Q5}],f=d.computed(()=>t.value.inputGuide.value),A=d.computed(()=>t.value.uniqueValuesData.value),p=d.ref(!1),v=d.ref(!1),y=d.computed(()=>{var le,z;return(z=(le=t.value.reactive.optionsState.components.primaryGrouping)==null?void 0:le.selectorStates[0])==null?void 0:z.selectedSource}),b=d.computed(()=>{var le,z;return(z=(le=t.value.reactive.optionsState.components.secondaryGrouping)==null?void 0:le.selectorStates[0])==null?void 0:z.selectedSource}),C=d.computed(()=>t.value.commonHelpersData.primaryGroups.value),x=d.computed(()=>t.value.commonHelpersData.secondaryGroups.value),k=d.computed(()=>t.value.commonHelpersData.usedAesInMapping.value),_=d.ref(t.value.reactive.dataBindAes[y.value]??Km(C.value)),P=d.ref(t.value.reactive.dataBindAes[b.value]??Km(x.value)),N=d.computed(()=>{var le;if(y.value){const z=f.value.getSourceInfo(y.value)??null,U=((le=A.value[y.value])==null?void 0:le.labels)??null;return{selectedSourceInfo:z,labels:C.value.reduce((G,Y)=>(G[Y]=(U==null?void 0:U[Y])??String(Y),G),{})}}}),I=d.computed(()=>{var le;if(b.value){const z=f.value.getSourceInfo(b.value)??null,U=((le=A.value[b.value])==null?void 0:le.labels)??null;return{selectedSourceInfo:z,labels:x.value.reduce((G,Y)=>(G[Y]=(U==null?void 0:U[Y])??String(Y),G),{})}}});function F(le,z){t.value.reactive.dataBindAes[z]=le}const Q=[{text:"X",value:"x"},{text:"Y",value:"y"},{text:"XY",value:"xy"},{text:"None",value:"none"}],Z=d.computed(()=>A.value[y.value]),ee=d.computed({get(){var le;return UN(n.axisX.labelsRotation,(le=Z.value)==null?void 0:le.options)},set(le){n.axisX.labelsRotation=le}});return(le,z)=>(d.openBlock(),d.createElementBlock("div",{class:"axes-form",onClick:z[26]||(z[26]=U=>U.stopPropagation())},[z[38]||(z[38]=d.createElementVNode("h3",{class:"axes-title"}," Axes ",-1)),d.createElementVNode("div",Cve,[d.createVNode(Pl,{title:"Title",settings:r,icon:Tf,"icon-open":_f},{default:d.withCtx(()=>[d.createElementVNode("div",bve,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).title.mode,"onUpdate:modelValue":z[0]||(z[0]=U=>d.unref(n).title.mode=U)},null,8,["modelValue"])]),d.unref(n).title.mode==="custom"?(d.openBlock(),d.createElementBlock("div",Eve,[d.createVNode(d.unref(rt.PlTextField),{label:"Chart title",placeholder:"Chart title",modelValue:d.unref(n).title.value,"onUpdate:modelValue":z[1]||(z[1]=U=>d.unref(n).title.value=U)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",xve,[z[27]||(z[27]=d.createElementVNode("span",null,"Alignment",-1)),d.createVNode(Df,{options:a,modelValue:d.unref(n).title.position,"onUpdate:modelValue":z[2]||(z[2]=U=>d.unref(n).title.position=U)},null,8,["modelValue"])])]),_:1}),d.createVNode(Pl,{title:"X-axis",settings:r,icon:Tf,"icon-open":_f},{default:d.withCtx(()=>[C.value.length>1?(d.openBlock(),d.createElementBlock("div",Sve,[z[28]||(z[28]=d.createElementVNode("span",null,"Primary groups order: ",-1)),d.createVNode(U5,{data:{type:"data",value:null},onClick:z[3]||(z[3]=U=>{p.value=!0})}),p.value&&N.value?(d.openBlock(),d.createBlock(Uh,{key:0,title:"Reorder primary groups","back-title":"Axes Settings","onForm:close":z[6]||(z[6]=U=>p.value=!1)},{default:d.withCtx(()=>{var U;return[d.createVNode(SB,{"column-value-labels":N.value.labels,"data-column-label":((U=N.value.selectedSourceInfo)==null?void 0:U.label)??"","used-aes-in-mapping":k.value[y.value],"allow-reordering":"",modelValue:_.value,"onUpdate:modelValue":[z[4]||(z[4]=G=>_.value=G),z[5]||(z[5]=G=>F(G,y.value))]},null,8,["column-value-labels","data-column-label","used-aes-in-mapping","modelValue"])]}),_:1})):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0),x.value.length>1?(d.openBlock(),d.createElementBlock("div",Bve,[z[29]||(z[29]=d.createElementVNode("span",null,"Secondary groups order: ",-1)),d.createVNode(U5,{data:{type:"data",value:null},onClick:z[7]||(z[7]=U=>{v.value=!0})}),v.value&&I.value?(d.openBlock(),d.createBlock(Uh,{key:0,title:"Reorder secondary groups","back-title":"Axes Settings","onForm:close":z[10]||(z[10]=U=>v.value=!1)},{default:d.withCtx(()=>{var U;return[d.createVNode(SB,{"column-value-labels":I.value.labels,"data-column-label":((U=I.value.selectedSourceInfo)==null?void 0:U.label)??"","used-aes-in-mapping":k.value[b.value],"allow-reordering":"",modelValue:P.value,"onUpdate:modelValue":[z[8]||(z[8]=G=>P.value=G),z[9]||(z[9]=G=>F(G,b.value))]},null,8,["column-value-labels","data-column-label","used-aes-in-mapping","modelValue"])]}),_:1})):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="discrete"?(d.openBlock(),d.createElementBlock("div",kve,[z[30]||(z[30]=d.createElementVNode("span",null,"Labels rotation",-1)),d.createVNode(Df,{options:i,modelValue:ee.value,"onUpdate:modelValue":z[11]||(z[11]=U=>ee.value=U)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",Tve,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).axisX.titleMode,"onUpdate:modelValue":z[12]||(z[12]=U=>d.unref(n).axisX.titleMode=U)},null,8,["modelValue"])]),d.unref(n).axisX.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",_ve,[d.createVNode(d.unref(rt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisX.customTitle,"onUpdate:modelValue":z[13]||(z[13]=U=>d.unref(n).axisX.customTitle=U)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",Dve,[z[31]||(z[31]=d.createElementVNode("span",null,"Gridlines",-1)),d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:d.unref(n).axisX.gridlines,"onUpdate:modelValue":z[14]||(z[14]=U=>d.unref(n).axisX.gridlines=U)},null,8,["modelValue"])]),d.createElementVNode("div",Pve,[z[32]||(z[32]=d.createElementVNode("span",null,"Lines between categories",-1)),d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:d.unref(n).axisX.linesBetweenCategories,"onUpdate:modelValue":z[15]||(z[15]=U=>d.unref(n).axisX.linesBetweenCategories=U)},null,8,["modelValue"])]),d.createElementVNode("div",Mve,[z[33]||(z[33]=d.createElementVNode("span",null,"Ticks",-1)),d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:d.unref(n).axisX.ticks,"onUpdate:modelValue":z[16]||(z[16]=U=>d.unref(n).axisX.ticks=U)},null,8,["modelValue"])])]),_:1}),d.createVNode(Pl,{title:"Y-axis",settings:r,icon:Tf,"icon-open":_f},{default:d.withCtx(()=>[d.createElementVNode("div",Hve,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).axisY.titleMode,"onUpdate:modelValue":z[17]||(z[17]=U=>d.unref(n).axisY.titleMode=U)},null,8,["modelValue"])]),d.unref(n).axisY.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",Ive,[d.createVNode(d.unref(rt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisY.customTitle,"onUpdate:modelValue":z[18]||(z[18]=U=>d.unref(n).axisY.customTitle=U)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",Rve,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Scale",options:s,modelValue:d.unref(n).axisY.scale,"onUpdate:modelValue":z[19]||(z[19]=U=>d.unref(n).axisY.scale=U)},null,8,["modelValue"])]),d.createElementVNode("div",Nve,[z[34]||(z[34]=d.createElementVNode("span",null,"Gridlines",-1)),d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:d.unref(n).axisY.gridlines,"onUpdate:modelValue":z[20]||(z[20]=U=>d.unref(n).axisY.gridlines=U)},null,8,["modelValue"])]),d.createElementVNode("div",Lve,[z[35]||(z[35]=d.createElementVNode("span",null,"Ticks",-1)),d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:d.unref(n).axisY.ticks,"onUpdate:modelValue":z[21]||(z[21]=U=>d.unref(n).axisY.ticks=U)},null,8,["modelValue"])])]),_:1}),d.createElementVNode("div",$ve,[d.createElementVNode("div",Fve,[z[36]||(z[36]=d.createElementVNode("span",null,"Frame",-1)),d.createVNode(Df,{options:c,modelValue:d.unref(n).other.frame,"onUpdate:modelValue":z[22]||(z[22]=U=>d.unref(n).other.frame=U)},null,8,["modelValue"])]),d.createElementVNode("div",Vve,[z[37]||(z[37]=d.createElementVNode("span",null,"Reverse axes",-1)),d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:d.unref(n).other.reverse,"onUpdate:modelValue":z[23]||(z[23]=U=>d.unref(n).other.reverse=U)},null,8,["modelValue"])]),d.createElementVNode("div",Ove,[d.createVNode(d.unref(rt.Slider),{style:{width:"100%"},label:"Facet column count",min:1,max:6,step:1,breakpoints:!0,mode:"input",modelValue:d.unref(n).other.facetColumns,"onUpdate:modelValue":z[24]||(z[24]=U=>d.unref(n).other.facetColumns=U)},null,8,["modelValue"])]),d.createElementVNode("div",Qve,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Facet shared by",options:Q,modelValue:d.unref(n).other.facetSharedBy,"onUpdate:modelValue":z[25]||(z[25]=U=>d.unref(n).other.facetSharedBy=U)},null,8,["modelValue"])])])])]))}}),Uve={class:"axes-settings-list"},Gve={class:"axes-settings-options-row block"},jve={key:0,class:"axes-settings-input"},Yve={class:"axes-settings-options-row"},Wve={class:"axes-settings-options-row block"},Xve={key:0},Kve={class:"axes-settings-options-row block"},Zve={class:"axes-settings-options-row table"},Jve={class:"axes-settings-options-row table"},qve={class:"axes-settings-options-row"},eme={class:"fixed-aes-list fixed-aes-list__rows"},tme={class:"axes-settings-options-row block"},nme={key:0},rme={class:"axes-settings-options-row block"},ame={class:"axes-settings-options-row table"},ime={class:"axes-settings-options-row table"},ome={class:"axes-settings-options-row"},lme={class:"fixed-aes-list fixed-aes-list__rows"},sme={key:0,class:"other"},ume={class:"axes-settings-options-row"},cme={class:"axes-settings-options-row"},fme={class:"axes-settings-options-row block"},dme=d.defineComponent({__name:"ScatterplotAxesSettingsForm",setup(e){const t=Tr(),n=t.value.reactive.axesSettings,r=d.computed(()=>t.value.reactive.chartType),a={height:40,horizontalPadding:12,defaultState:"open"},i=[{value:"left",icon:F5},{value:"center",icon:V5},{value:"right",icon:O5}],o=[{value:"auto",text:"Auto"},{value:"custom",text:"Custom"},{value:"hidden",text:"Hide"}],s=[{value:"linear",text:"Linear"},{value:"log",text:"Log"}],c=[{value:"empty",icon:z5},{value:"left",icon:CB},{value:"bottom",icon:bB},{value:"left-bottom",icon:EB},{value:"full",icon:Q5}],f=[{text:"X",value:"x"},{text:"Y",value:"y"},{text:"XY",value:"xy"},{text:"None",value:"none"}],A=d.ref(n.axisX.significantLinesStyle),p=d.ref(n.axisY.significantLinesStyle),v=d.computed(()=>_$($3.length,"lineType")),y=d.ref(),b=d.ref(),C=d.ref(!1),x=d.ref(!1);return(k,_)=>(d.openBlock(),d.createElementBlock("div",{class:"axes-form",onClick:_[26]||(_[26]=P=>P.stopPropagation())},[_[35]||(_[35]=d.createElementVNode("h3",{class:"axes-title"}," Axes ",-1)),d.createElementVNode("div",Uve,[d.createVNode(Pl,{title:"Title",settings:a,icon:Tf,"icon-open":_f},{default:d.withCtx(()=>[d.createElementVNode("div",Gve,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).title.mode,"onUpdate:modelValue":_[0]||(_[0]=P=>d.unref(n).title.mode=P)},null,8,["modelValue"])]),d.unref(n).title.mode==="custom"?(d.openBlock(),d.createElementBlock("div",jve,[d.createVNode(d.unref(rt.PlTextField),{label:"Chart title",placeholder:"Chart title",modelValue:d.unref(n).title.value,"onUpdate:modelValue":_[1]||(_[1]=P=>d.unref(n).title.value=P)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",Yve,[_[27]||(_[27]=d.createElementVNode("span",null,"Alignment",-1)),d.createVNode(Df,{options:i,modelValue:d.unref(n).title.position,"onUpdate:modelValue":_[2]||(_[2]=P=>d.unref(n).title.position=P)},null,8,["modelValue"])])]),_:1}),d.createVNode(Pl,{title:"X-axis",settings:a,icon:Tf,"icon-open":_f},{default:d.withCtx(()=>[d.createElementVNode("div",Wve,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).axisX.titleMode,"onUpdate:modelValue":_[3]||(_[3]=P=>d.unref(n).axisX.titleMode=P)},null,8,["modelValue"])]),d.unref(n).axisX.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",Xve,[d.createVNode(d.unref(rt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisX.customTitle,"onUpdate:modelValue":_[4]||(_[4]=P=>d.unref(n).axisX.customTitle=P)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",Kve,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Scale",options:s,modelValue:d.unref(n).axisX.scale,"onUpdate:modelValue":_[5]||(_[5]=P=>d.unref(n).axisX.scale=P)},null,8,["modelValue"])]),d.createElementVNode("div",Zve,[_[28]||(_[28]=d.createElementVNode("span",null,"Gridlines",-1)),d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:d.unref(n).axisX.gridlines,"onUpdate:modelValue":_[6]||(_[6]=P=>d.unref(n).axisX.gridlines=P)},null,8,["modelValue"])]),d.createElementVNode("div",Jve,[_[29]||(_[29]=d.createElementVNode("span",null,"Ticks",-1)),d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:d.unref(n).axisX.ticks,"onUpdate:modelValue":_[7]||(_[7]=P=>d.unref(n).axisX.ticks=P)},null,8,["modelValue"])]),d.createElementVNode("div",qve,[_[30]||(_[30]=d.createElementVNode("span",null,"Significant lines style",-1)),d.createVNode(U5,{data:{type:"lineType",value:A.value},onClick:_[8]||(_[8]=P=>C.value=!C.value),onRef:_[9]||(_[9]=P=>y.value=P)},null,8,["data"]),C.value?(d.openBlock(),d.createBlock(b6,{key:0,height:v.value,targetRef:y.value,"onPopup:close":_[12]||(_[12]=P=>C.value=!1)},{default:d.withCtx(()=>[d.createElementVNode("div",eme,[d.createVNode(C6,{modelValue:A.value,"onUpdate:modelValue":[_[10]||(_[10]=P=>A.value=P),_[11]||(_[11]=P=>d.unref(n).axisX.significantLinesStyle=P)]},null,8,["modelValue"])])]),_:1},8,["height","targetRef"])):d.createCommentVNode("",!0)])]),_:1}),d.createVNode(Pl,{title:"Y-axis",settings:a,icon:Tf,"icon-open":_f},{default:d.withCtx(()=>[d.createElementVNode("div",tme,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).axisY.titleMode,"onUpdate:modelValue":_[13]||(_[13]=P=>d.unref(n).axisY.titleMode=P)},null,8,["modelValue"])]),d.unref(n).axisY.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",nme,[d.createVNode(d.unref(rt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisY.customTitle,"onUpdate:modelValue":_[14]||(_[14]=P=>d.unref(n).axisY.customTitle=P)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",rme,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Scale",options:s,modelValue:d.unref(n).axisY.scale,"onUpdate:modelValue":_[15]||(_[15]=P=>d.unref(n).axisY.scale=P)},null,8,["modelValue"])]),d.createElementVNode("div",ame,[_[31]||(_[31]=d.createElementVNode("span",null,"Gridlines",-1)),d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:d.unref(n).axisY.gridlines,"onUpdate:modelValue":_[16]||(_[16]=P=>d.unref(n).axisY.gridlines=P)},null,8,["modelValue"])]),d.createElementVNode("div",ime,[_[32]||(_[32]=d.createElementVNode("span",null,"Ticks",-1)),d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:d.unref(n).axisY.ticks,"onUpdate:modelValue":_[17]||(_[17]=P=>d.unref(n).axisY.ticks=P)},null,8,["modelValue"])]),d.createElementVNode("div",ome,[_[33]||(_[33]=d.createElementVNode("span",null,"Significant lines style",-1)),d.createVNode(U5,{data:{type:"lineType",value:p.value},onClick:_[18]||(_[18]=P=>x.value=!x.value),onRef:_[19]||(_[19]=P=>b.value=P)},null,8,["data"]),x.value?(d.openBlock(),d.createBlock(b6,{key:0,height:v.value,targetRef:b.value,"onPopup:close":_[22]||(_[22]=P=>x.value=!1)},{default:d.withCtx(()=>[d.createElementVNode("div",lme,[d.createVNode(C6,{modelValue:p.value,"onUpdate:modelValue":[_[20]||(_[20]=P=>p.value=P),_[21]||(_[21]=P=>d.unref(n).axisY.significantLinesStyle=P)]},null,8,["modelValue"])])]),_:1},8,["height","targetRef"])):d.createCommentVNode("",!0)])]),_:1}),r.value==="scatterplot"?(d.openBlock(),d.createElementBlock("div",sme,[d.createElementVNode("div",ume,[_[34]||(_[34]=d.createElementVNode("span",null,"Frame",-1)),d.createVNode(Df,{options:c,modelValue:d.unref(n).other.frame,"onUpdate:modelValue":_[23]||(_[23]=P=>d.unref(n).other.frame=P)},null,8,["modelValue"])]),d.createElementVNode("div",cme,[d.createVNode(d.unref(rt.Slider),{style:{width:"100%"},label:"Facet column count",min:1,max:6,step:1,breakpoints:!0,mode:"input",modelValue:d.unref(n).other.facetColumns,"onUpdate:modelValue":_[24]||(_[24]=P=>d.unref(n).other.facetColumns=P)},null,8,["modelValue"])]),d.createElementVNode("div",fme,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Facet shared by",options:f,modelValue:d.unref(n).other.facetSharedBy,"onUpdate:modelValue":_[25]||(_[25]=P=>d.unref(n).other.facetSharedBy=P)},null,8,["modelValue"])])])):d.createCommentVNode("",!0)])]))}}),Ame={class:"axes-settings-list"},pme={class:"axes-settings-options-row block"},hme={key:0,class:"axes-settings-input"},vme={class:"axes-settings-options-row"},mme={class:"axes-settings-options-row"},gme={class:"axes-settings-options-row block"},yme={key:0},wme={class:"axes-settings-options-row block"},Cme={class:"axes-settings-options-row"},bme={class:"axes-settings-options-row block"},Eme={key:0},xme={class:"axes-settings-options-row block"},Sme={class:"other"},Bme={class:"axes-settings-options-row"},kme={class:"axes-settings-options-row"},Tme={class:"axes-settings-options-row block"},_me=d.defineComponent({__name:"HeatmapAxesSettingsForm",setup(e){const t=Tr(),n=t.value.reactive.axesSettings,r={height:40,horizontalPadding:12,defaultState:"open"},a=[{value:"left",icon:F5},{value:"center",icon:V5},{value:"right",icon:O5}],i=[{value:0,icon:gB},{value:45,icon:yB},{value:90,icon:wB}],o=[{value:"auto",text:"Auto"},{value:"custom",text:"Custom"},{value:"hidden",text:"Hide"}],s=[{value:"none",icon:z5},{value:"full",icon:Q5}],c=[{text:"X",value:"x"},{text:"Y",value:"y"},{text:"XY",value:"xy"},{text:"None",value:"none"}],f=[{text:"ascending",value:"asc"},{text:"descending",value:"desc"}],A=d.computed(()=>t.value.reactive.layersSettings.heatmapClustered),p=d.computed(()=>c.filter(v=>t.value.reactive.template!=="heatmapClustered"?!0:A.value.dendrogramX&&A.value.dendrogramY?v.value!=="x"&&v.value!=="xy"&&v.value!=="y":A.value.dendrogramX?v.value!=="x"&&v.value!=="xy":A.value.dendrogramY?v.value!=="y"&&v.value!=="xy":!0));return(v,y)=>(d.openBlock(),d.createElementBlock("div",{class:"axes-form",onClick:y[14]||(y[14]=b=>b.stopPropagation())},[y[19]||(y[19]=d.createElementVNode("h3",{class:"axes-title"}," Axes ",-1)),d.createElementVNode("div",Ame,[d.createVNode(Pl,{title:"Title",settings:r,icon:Tf,"icon-open":_f},{default:d.withCtx(()=>[d.createElementVNode("div",pme,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).title.mode,"onUpdate:modelValue":y[0]||(y[0]=b=>d.unref(n).title.mode=b)},null,8,["modelValue"])]),d.unref(n).title.mode==="custom"?(d.openBlock(),d.createElementBlock("div",hme,[d.createVNode(d.unref(rt.PlTextField),{label:"Chart title",placeholder:"Chart title",modelValue:d.unref(n).title.value,"onUpdate:modelValue":y[1]||(y[1]=b=>d.unref(n).title.value=b)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",vme,[y[15]||(y[15]=d.createElementVNode("span",null,"Alignment",-1)),d.createVNode(Df,{options:a,modelValue:d.unref(n).title.position,"onUpdate:modelValue":y[2]||(y[2]=b=>d.unref(n).title.position=b)},null,8,["modelValue"])])]),_:1}),d.createVNode(Pl,{title:"X-axis",settings:r,icon:Tf,"icon-open":_f},{default:d.withCtx(()=>[d.createElementVNode("div",mme,[y[16]||(y[16]=d.createElementVNode("span",null,"Labels rotation",-1)),d.createVNode(Df,{options:i,modelValue:d.unref(n).axisX.axisLabelsAngle,"onUpdate:modelValue":y[3]||(y[3]=b=>d.unref(n).axisX.axisLabelsAngle=b)},null,8,["modelValue"])]),d.createElementVNode("div",gme,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).axisX.titleMode,"onUpdate:modelValue":y[4]||(y[4]=b=>d.unref(n).axisX.titleMode=b)},null,8,["modelValue"])]),d.unref(n).axisX.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",yme,[d.createVNode(d.unref(rt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisX.customTitle,"onUpdate:modelValue":y[5]||(y[5]=b=>d.unref(n).axisX.customTitle=b)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",wme,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Sorting",options:f,modelValue:d.unref(n).axisX.sorting,"onUpdate:modelValue":y[6]||(y[6]=b=>d.unref(n).axisX.sorting=b)},null,8,["modelValue"])])]),_:1}),d.createVNode(Pl,{title:"Y-axis",settings:r,icon:Tf,"icon-open":_f},{default:d.withCtx(()=>[d.createElementVNode("div",Cme,[y[17]||(y[17]=d.createElementVNode("span",null,"Labels rotation",-1)),d.createVNode(Df,{options:i,modelValue:d.unref(n).axisY.axisLabelsAngle,"onUpdate:modelValue":y[7]||(y[7]=b=>d.unref(n).axisY.axisLabelsAngle=b)},null,8,["modelValue"])]),d.createElementVNode("div",bme,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).axisY.titleMode,"onUpdate:modelValue":y[8]||(y[8]=b=>d.unref(n).axisY.titleMode=b)},null,8,["modelValue"])]),d.unref(n).axisY.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",Eme,[d.createVNode(d.unref(rt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisY.customTitle,"onUpdate:modelValue":y[9]||(y[9]=b=>d.unref(n).axisY.customTitle=b)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",xme,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Sorting",options:f,modelValue:d.unref(n).axisY.sorting,"onUpdate:modelValue":y[10]||(y[10]=b=>d.unref(n).axisY.sorting=b)},null,8,["modelValue"])])]),_:1}),d.createElementVNode("div",Sme,[d.createElementVNode("div",Bme,[y[18]||(y[18]=d.createElementVNode("span",null,"Frame",-1)),d.createVNode(Df,{options:s,modelValue:d.unref(n).other.frame,"onUpdate:modelValue":y[11]||(y[11]=b=>d.unref(n).other.frame=b)},null,8,["modelValue"])]),d.createElementVNode("div",kme,[d.createVNode(d.unref(rt.Slider),{style:{width:"100%"},label:"Facet column count",min:1,max:6,step:1,breakpoints:!0,mode:"input",modelValue:d.unref(n).other.facetColumns,"onUpdate:modelValue":y[12]||(y[12]=b=>d.unref(n).other.facetColumns=b)},null,8,["modelValue"])]),d.createElementVNode("div",Tme,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Facet shared by",options:p.value,modelValue:d.unref(n).other.facetSharedBy,"onUpdate:modelValue":y[13]||(y[13]=b=>d.unref(n).other.facetSharedBy=b)},null,8,["options","modelValue"])])])])]))}}),Dme={class:"axes-settings-list"},Pme={style:{padding:"0 24px 8px"}},Mme={class:"axes-settings-options-row block"},Hme={key:0,class:"axes-settings-input"},Ime={class:"axes-settings-options-row"},Rme={class:"axes-settings-options-row block"},Nme={key:0},Lme={class:"axes-settings-options-row block"},$me={class:"axes-settings-options-row table"},Fme={class:"axes-settings-options-row table"},Vme={class:"axes-settings-options-row block"},Ome={class:"axes-settings-options-row table"},Qme={class:"axes-settings-options-row table"},zme={class:"other"},Ume={class:"axes-settings-options-row"},Gme={class:"axes-settings-options-row"},jme={class:"axes-settings-options-row"},Yme={class:"axes-settings-options-row"},Wme={class:"axes-settings-options-row block"},Xme=d.defineComponent({__name:"HistogramAxesSettingsForm",setup(e){const n=Tr().value.reactive.axesSettings,r={height:40,horizontalPadding:12,defaultState:"open"},a=[{value:"left",icon:F5},{value:"center",icon:V5},{value:"right",icon:O5}],i=[{value:"auto",text:"Auto"},{value:"custom",text:"Custom"},{value:"hidden",text:"Hide"}],o=[{value:"linear",text:"Linear"},{value:"log",text:"Log"}],s=[{value:"empty",icon:z5},{value:"left",icon:CB},{value:"bottom",icon:bB},{value:"left-bottom",icon:EB},{value:"full",icon:Q5}],c=[{text:"X",value:"x"},{text:"Y",value:"y"},{text:"XY",value:"xy"},{text:"None",value:"none"}];return(f,A)=>(d.openBlock(),d.createElementBlock("div",{class:"axes-form",onClick:A[17]||(A[17]=p=>p.stopPropagation())},[A[24]||(A[24]=d.createElementVNode("h3",{class:"axes-title"}," Axes ",-1)),d.createElementVNode("div",Dme,[d.createElementVNode("div",Pme,[d.createVNode(d.unref(rt.Slider),{style:{width:"100%"},label:"Bins count",min:3,max:100,step:1,breakpoints:!1,mode:"input",modelValue:d.unref(n).other.binsCount,"onUpdate:modelValue":A[0]||(A[0]=p=>d.unref(n).other.binsCount=p)},null,8,["modelValue"])]),d.createVNode(Pl,{title:"Title",settings:r,icon:Tf,"icon-open":_f},{default:d.withCtx(()=>[d.createElementVNode("div",Mme,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Title",options:i,modelValue:d.unref(n).title.mode,"onUpdate:modelValue":A[1]||(A[1]=p=>d.unref(n).title.mode=p)},null,8,["modelValue"])]),d.unref(n).title.mode==="custom"?(d.openBlock(),d.createElementBlock("div",Hme,[d.createVNode(d.unref(rt.PlTextField),{label:"Chart title",placeholder:"Chart title",modelValue:d.unref(n).title.value,"onUpdate:modelValue":A[2]||(A[2]=p=>d.unref(n).title.value=p)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",Ime,[A[18]||(A[18]=d.createElementVNode("span",null,"Alignment",-1)),d.createVNode(Df,{options:a,modelValue:d.unref(n).title.position,"onUpdate:modelValue":A[3]||(A[3]=p=>d.unref(n).title.position=p)},null,8,["modelValue"])])]),_:1}),d.createVNode(Pl,{title:"X-axis",settings:r,icon:Tf,"icon-open":_f},{default:d.withCtx(()=>[d.createElementVNode("div",Rme,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Title",options:i,modelValue:d.unref(n).axisX.titleMode,"onUpdate:modelValue":A[4]||(A[4]=p=>d.unref(n).axisX.titleMode=p)},null,8,["modelValue"])]),d.unref(n).axisX.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",Nme,[d.createVNode(d.unref(rt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisX.customTitle,"onUpdate:modelValue":A[5]||(A[5]=p=>d.unref(n).axisX.customTitle=p)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",Lme,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Scale",options:o,modelValue:d.unref(n).axisX.scale,"onUpdate:modelValue":A[6]||(A[6]=p=>d.unref(n).axisX.scale=p)},null,8,["modelValue"])]),d.createElementVNode("div",$me,[A[19]||(A[19]=d.createElementVNode("span",null,"Gridlines",-1)),d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:d.unref(n).axisX.gridlines,"onUpdate:modelValue":A[7]||(A[7]=p=>d.unref(n).axisX.gridlines=p)},null,8,["modelValue"])]),d.createElementVNode("div",Fme,[A[20]||(A[20]=d.createElementVNode("span",null,"Ticks",-1)),d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:d.unref(n).axisX.ticks,"onUpdate:modelValue":A[8]||(A[8]=p=>d.unref(n).axisX.ticks=p)},null,8,["modelValue"])])]),_:1}),d.createVNode(Pl,{title:"Y-axis",settings:r,icon:Tf,"icon-open":_f},{default:d.withCtx(()=>[d.createElementVNode("div",Vme,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Scale",options:o,modelValue:d.unref(n).axisY.scale,"onUpdate:modelValue":A[9]||(A[9]=p=>d.unref(n).axisY.scale=p)},null,8,["modelValue"])]),d.createElementVNode("div",Ome,[A[21]||(A[21]=d.createElementVNode("span",null,"Gridlines",-1)),d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:d.unref(n).axisY.gridlines,"onUpdate:modelValue":A[10]||(A[10]=p=>d.unref(n).axisY.gridlines=p)},null,8,["modelValue"])]),d.createElementVNode("div",Qme,[A[22]||(A[22]=d.createElementVNode("span",null,"Ticks",-1)),d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:d.unref(n).axisY.ticks,"onUpdate:modelValue":A[11]||(A[11]=p=>d.unref(n).axisY.ticks=p)},null,8,["modelValue"])])]),_:1}),d.createElementVNode("div",zme,[d.createElementVNode("div",Ume,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Grouping direction",options:[{value:"straight",label:"Straight"},{value:"reverse",label:"Reverse"}],modelValue:d.unref(n).other.groupingDirection,"onUpdate:modelValue":A[12]||(A[12]=p=>d.unref(n).other.groupingDirection=p)},null,8,["modelValue"])]),d.createElementVNode("div",Gme,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Stack mode",options:[{value:"vertical",label:"Vertical"},{value:"horizontal",label:"Horizontal"}],modelValue:d.unref(n).other.groupingStack,"onUpdate:modelValue":A[13]||(A[13]=p=>d.unref(n).other.groupingStack=p)},null,8,["modelValue"])]),d.createElementVNode("div",jme,[A[23]||(A[23]=d.createElementVNode("span",null,"Frame",-1)),d.createVNode(Df,{options:s,modelValue:d.unref(n).other.frame,"onUpdate:modelValue":A[14]||(A[14]=p=>d.unref(n).other.frame=p)},null,8,["modelValue"])]),d.createElementVNode("div",Yme,[d.createVNode(d.unref(rt.Slider),{style:{width:"100%"},label:"Facet column count",min:1,max:6,step:1,breakpoints:!0,mode:"input",modelValue:d.unref(n).other.facetColumns,"onUpdate:modelValue":A[15]||(A[15]=p=>d.unref(n).other.facetColumns=p)},null,8,["modelValue"])]),d.createElementVNode("div",Wme,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Facet shared by",options:c,modelValue:d.unref(n).other.facetSharedBy,"onUpdate:modelValue":A[16]||(A[16]=p=>d.unref(n).other.facetSharedBy=p)},null,8,["modelValue"])])])])]))}}),Kme={class:"axes-settings-list"},Zme={class:"axes-settings-options-row block"},Jme={key:0,class:"axes-settings-input"},qme={class:"axes-settings-options-row"},ege={class:"axes-settings-options-row"},tge={class:"axes-settings-options-row block"},nge={key:0},rge={class:"axes-settings-options-row block"},age={class:"axes-settings-options-row"},ige={class:"axes-settings-options-row block"},oge={key:0},lge={class:"axes-settings-options-row block"},sge={class:"other"},uge={class:"axes-settings-options-row"},cge={class:"axes-settings-options-row"},fge=d.defineComponent({__name:"BubbleAxesSettingsForm",setup(e){const n=Tr().value.reactive.axesSettings,r={height:40,horizontalPadding:12,defaultState:"open"},a=[{value:"left",icon:F5},{value:"center",icon:V5},{value:"right",icon:O5}],i=[{value:0,icon:gB},{value:45,icon:yB},{value:90,icon:wB}],o=[{value:"auto",text:"Auto"},{value:"custom",text:"Custom"},{value:"hidden",text:"Hide"}],s=[{value:"none",icon:z5},{value:"full",icon:Q5}],c=[{text:"ascending",value:"asc"},{text:"descending",value:"desc"}];return(f,A)=>(d.openBlock(),d.createElementBlock("div",{class:"axes-form",onClick:A[13]||(A[13]=p=>p.stopPropagation())},[A[18]||(A[18]=d.createElementVNode("h3",{class:"axes-title"}," Axes ",-1)),d.createElementVNode("div",Kme,[d.createVNode(Pl,{title:"Title",settings:r,icon:Tf,"icon-open":_f},{default:d.withCtx(()=>[d.createElementVNode("div",Zme,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).title.mode,"onUpdate:modelValue":A[0]||(A[0]=p=>d.unref(n).title.mode=p)},null,8,["modelValue"])]),d.unref(n).title.mode==="custom"?(d.openBlock(),d.createElementBlock("div",Jme,[d.createVNode(d.unref(rt.PlTextField),{label:"Chart title",placeholder:"Chart title",modelValue:d.unref(n).title.value,"onUpdate:modelValue":A[1]||(A[1]=p=>d.unref(n).title.value=p)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",qme,[A[14]||(A[14]=d.createElementVNode("span",null,"Alignment",-1)),d.createVNode(Df,{options:a,modelValue:d.unref(n).title.position,"onUpdate:modelValue":A[2]||(A[2]=p=>d.unref(n).title.position=p)},null,8,["modelValue"])])]),_:1}),d.createVNode(Pl,{title:"X-axis",settings:r,icon:Tf,"icon-open":_f},{default:d.withCtx(()=>[d.createElementVNode("div",ege,[A[15]||(A[15]=d.createElementVNode("span",null,"Labels rotation",-1)),d.createVNode(Df,{options:i,modelValue:d.unref(n).axisX.axisLabelsAngle,"onUpdate:modelValue":A[3]||(A[3]=p=>d.unref(n).axisX.axisLabelsAngle=p)},null,8,["modelValue"])]),d.createElementVNode("div",tge,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).axisX.titleMode,"onUpdate:modelValue":A[4]||(A[4]=p=>d.unref(n).axisX.titleMode=p)},null,8,["modelValue"])]),d.unref(n).axisX.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",nge,[d.createVNode(d.unref(rt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisX.customTitle,"onUpdate:modelValue":A[5]||(A[5]=p=>d.unref(n).axisX.customTitle=p)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",rge,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Sorting",options:c,modelValue:d.unref(n).axisX.sorting,"onUpdate:modelValue":A[6]||(A[6]=p=>d.unref(n).axisX.sorting=p)},null,8,["modelValue"])])]),_:1}),d.createVNode(Pl,{title:"Y-axis",settings:r,icon:Tf,"icon-open":_f},{default:d.withCtx(()=>[d.createElementVNode("div",age,[A[16]||(A[16]=d.createElementVNode("span",null,"Labels rotation",-1)),d.createVNode(Df,{options:i,modelValue:d.unref(n).axisY.axisLabelsAngle,"onUpdate:modelValue":A[7]||(A[7]=p=>d.unref(n).axisY.axisLabelsAngle=p)},null,8,["modelValue"])]),d.createElementVNode("div",ige,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Title",options:o,modelValue:d.unref(n).axisY.titleMode,"onUpdate:modelValue":A[8]||(A[8]=p=>d.unref(n).axisY.titleMode=p)},null,8,["modelValue"])]),d.unref(n).axisY.titleMode==="custom"?(d.openBlock(),d.createElementBlock("div",oge,[d.createVNode(d.unref(rt.PlTextField),{label:"Text",placeholder:"Type",modelValue:d.unref(n).axisY.customTitle,"onUpdate:modelValue":A[9]||(A[9]=p=>d.unref(n).axisY.customTitle=p)},null,8,["modelValue"])])):d.createCommentVNode("",!0),d.createElementVNode("div",lge,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Sorting",options:c,modelValue:d.unref(n).axisY.sorting,"onUpdate:modelValue":A[10]||(A[10]=p=>d.unref(n).axisY.sorting=p)},null,8,["modelValue"])])]),_:1}),d.createElementVNode("div",sge,[d.createElementVNode("div",uge,[A[17]||(A[17]=d.createElementVNode("span",null,"Frame",-1)),d.createVNode(Df,{options:s,modelValue:d.unref(n).other.frame,"onUpdate:modelValue":A[11]||(A[11]=p=>d.unref(n).other.frame=p)},null,8,["modelValue"])]),d.createElementVNode("div",cge,[d.createVNode(d.unref(rt.Slider),{style:{width:"100%"},label:"Facet column count",min:1,max:6,step:1,breakpoints:!0,mode:"input",modelValue:d.unref(n).other.facetColumns,"onUpdate:modelValue":A[12]||(A[12]=p=>d.unref(n).other.facetColumns=p)},null,8,["modelValue"])])])])]))}}),dge={class:"data-form"},Age=d.defineComponent({__name:"index",setup(e){const t=Tr();return(n,r)=>(d.openBlock(),d.createElementBlock("div",dge,[d.unref(t).reactive.chartType==="discrete"?(d.openBlock(),d.createBlock(zve,{key:0})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="scatterplot"||d.unref(t).reactive.chartType==="scatterplot-umap"?(d.openBlock(),d.createBlock(dme,{key:1})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="heatmap"?(d.openBlock(),d.createBlock(_me,{key:2})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="histogram"?(d.openBlock(),d.createBlock(Xme,{key:3})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="bubble"?(d.openBlock(),d.createBlock(fge,{key:4})):d.createCommentVNode("",!0)]))}});function Uc(e,t,n,r=!1){const a=t.components.primaryGrouping.selectorStates.length>0,i=t.components.secondaryGrouping.selectorStates.length>0;return e===null?i?{type:"secondaryGrouping"}:a&&!r?{type:"primaryGrouping"}:n:e}const pge={class:"aes-mapping-block"},hge={style:{margin:"0 24px"}},vge={class:"section-title"},mge={style:{margin:"24px 0"}},gge={style:{margin:"24px 0"}},yge={style:{margin:"24px 0"}},wge={style:{display:"flex",marginTop:"16px",gap:"8px"}},Cge=d.defineComponent({__name:"AesDataMappingContinuous",props:{dataColumnLabel:{},modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){var b,C;const n=e,r=t,a=d.ref(!1),i=d.ref(n.modelValue.palette);function o(x){i.value=x,a.value=!1,r("update:modelValue",Xm(x))}const s=[{value:"auto",label:"Auto"},{value:"custom",label:"Custom"}],c=d.ref(n.modelValue.range?"custom":"auto"),f=[{value:"linear",label:"Linear"},{value:"log",label:"Log"}],A=d.ref(n.modelValue.log?"log":"linear"),p=d.ref(((b=n.modelValue.range)==null?void 0:b.minValue)??void 0),v=d.ref(((C=n.modelValue.range)==null?void 0:C.maxValue)??void 0),y=d.ref(n.modelValue.midPoint??void 0);return d.watch(()=>c.value,x=>{x==="custom"&&r("update:modelValue",{...n.modelValue,range:{minValue:p.value??null,maxValue:v.value??null}}),x==="auto"&&r("update:modelValue",{...n.modelValue,range:null})}),d.watch(()=>p.value,x=>{r("update:modelValue",{...n.modelValue,range:{...n.modelValue.range,minValue:x}})}),d.watch(()=>v.value,x=>{r("update:modelValue",{...n.modelValue,range:{...n.modelValue.range,maxValue:x}})}),d.watch(()=>y.value,x=>{r("update:modelValue",{...n.modelValue,midPoint:x??null})}),d.watch(()=>A.value,x=>{r("update:modelValue",{...n.modelValue,log:x==="log"})}),(x,k)=>(d.openBlock(),d.createElementBlock("div",pge,[d.createElementVNode("div",hge,[d.createElementVNode("div",vge,[d.createElementVNode("span",null,d.toDisplayString(x.dataColumnLabel),1)]),d.createElementVNode("div",mge,[d.createVNode(Ay,{label:"Color Palette ",title:d.unref(Gi)[i.value].title,palette:i.value,onButtonClick:k[0]||(k[0]=_=>{a.value=!0})},null,8,["title","palette"])]),d.createElementVNode("div",gge,[d.createVNode(d.unref(rt.PlBtnGroup),{options:f,modelValue:A.value,"onUpdate:modelValue":k[1]||(k[1]=_=>A.value=_)},null,8,["modelValue"])]),d.createElementVNode("div",yge,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Gradient range",options:s,modelValue:c.value,"onUpdate:modelValue":k[2]||(k[2]=_=>c.value=_)},null,8,["modelValue"])]),d.createElementVNode("div",wge,[c.value==="custom"?(d.openBlock(),d.createBlock(d.unref(rt.PlNumberField),{key:0,label:"From",updateOnEnterOrClickOutside:!0,useIncrementButtons:!1,modelValue:p.value,"onUpdate:modelValue":k[3]||(k[3]=_=>p.value=_)},null,8,["modelValue"])):d.createCommentVNode("",!0),d.createVNode(d.unref(rt.PlNumberField),{label:"Mid point",updateOnEnterOrClickOutside:!0,useIncrementButtons:!1,style:{flexGrow:1},modelValue:y.value,"onUpdate:modelValue":k[4]||(k[4]=_=>y.value=_)},null,8,["modelValue"]),c.value==="custom"?(d.openBlock(),d.createBlock(d.unref(rt.PlNumberField),{key:1,label:"To",updateOnEnterOrClickOutside:!0,useIncrementButtons:!1,modelValue:v.value,"onUpdate:modelValue":k[5]||(k[5]=_=>v.value=_)},null,8,["modelValue"])):d.createCommentVNode("",!0)]),a.value?(d.openBlock(),d.createBlock(Uh,{key:0,title:"Color Palette","back-title":"Color mapping","onForm:close":k[6]||(k[6]=_=>a.value=!1)},{default:d.withCtx(()=>[d.createVNode(py,{selected:i.value,categorical:!1,onSelect:o},null,8,["selected"])]),_:1})):d.createCommentVNode("",!0)])]))}}),bge={class:"aes-input-row"},ei=d.defineComponent({__name:"AesSelector",props:{label:{},type:{},selected:{},formTitle:{},formBackTitle:{},possibleAesSourceInputs:{},withoutFixed:{type:Boolean},disabled:{type:Boolean}},emits:["aes-update","aes-selector-close"],setup(e,{emit:t}){var ee,le;const n=e,r=Tr(),a=d.computed(()=>r.value.reactive.chartType),i=t,o={discrete:["primaryGrouping","secondaryGrouping"],scatterplot:["grouping"],"scatterplot-umap":["grouping"],dendro:[],heatmap:[],histogram:["grouping"],bubble:[]},s=n.possibleAesSourceInputs??o[a.value],c=d.computed(()=>{const z=r.value.commonHelpersData.usedAesInMapping.value;return console.log(z,"used aes in mappign"),z});function f(z){return typeof z=="string"?z:a.value==="scatterplot"?`grouping_${z.value}`:a.value==="dendro"?`${z.type}_${z.value}`:z.type}const A=d.ref(J3(n.selected)?f(n.selected):"fix"),p={fill:N3[0].color,stroke:N3[0].color,dotShape:D0,lineType:yC,size:""},v=d.computed(()=>r.value.inputGuide.value),y=d.computed(()=>r.value.uniqueValuesData.value),b=new Set(["scatterplot","scatterplot-umap","heatmap"]),C=d.computed(()=>{const z={},U=r.value.reactive.optionsState.components;function G(Y,X){const te=v.value.getSourceInfo(X),he=y.value[X],ae=(he==null?void 0:he.list)??[],ge=(he==null?void 0:he.labels)??{},me=f({type:Y,value:X});if(b.has(a.value)&&te.type==="String"||!b.has(a.value)){const fe=r.value.reactive.dataBindAes[X]??Km(ae);z[me]={type:"dataCategorical",value:me,initialData:fe,inputName:Y,selectedSource:X,selectedSourceInfo:te,selectedSourceValues:ae,labels:fe.order.reduce((be,He)=>(be[He]=ge[He]??String(He),be),{})}}else{const fe=r.value.reactive.dataBindAes[X]??Xm(nv);z[me]={type:"dataContinuous",value:me,initialData:fe,inputName:Y,selectedSource:X,selectedSourceInfo:te,selectedSourceValues:ae}}}return s.forEach(Y=>{var X;(X=U==null?void 0:U[Y])!=null&&X.selectorStates.length&&U[Y].selectorStates.forEach(({selectedSource:te})=>{G(Y,te)})}),n.withoutFixed||(z.fix={type:"fix",value:"fix",initialData:J3(n.selected)?p[n.type]:n.selected}),z}),x=d.computed(()=>C.value[A.value]??null);function k(z,U){var G,Y,X,te;return z.type==="fix"?"Fixed":U===z.value?`${(G=z.selectedSourceInfo)==null?void 0:G.label}`:a.value==="discrete"?`${z.value==="primaryGrouping"?"Primary":"Secondary"} grouping: ${(Y=z.selectedSourceInfo)==null?void 0:Y.label}`:a.value==="scatterplot"||a.value==="dendro"?`Grouping: ${(X=z.selectedSourceInfo)==null?void 0:X.label}`:((te=z.selectedSourceInfo)==null?void 0:te.label)??""}const _=d.computed(()=>{const z=[],U=r.value.reactive.optionsState.components;function G(Y,X){const te=f({type:Y==="shape"?"grouping":Y,value:X});C.value[te]&&z.push({text:k(C.value[te],A.value),value:te})}if(s.forEach(Y=>{var X;(X=U==null?void 0:U[Y])!=null&&X.selectorStates.length&&U[Y].selectorStates.forEach(({selectedSource:te})=>{G(Y,te)})}),!C.value[A.value]){let Y="Not consistent (grouping)";a.value==="discrete"&&(Y=`${A.value==="primaryGrouping"?"Primary":"Secondary"} grouping (not selected)`),z.push({text:Y,value:A.value})}return n.withoutFixed||z.push({text:"Fixed",value:"fix"}),z}),P=d.ref(!1),N=d.ref(C.value.fix?C.value.fix.initialData:null),I=d.ref(((ee=x.value)==null?void 0:ee.type)==="dataCategorical"?x.value.initialData:null),F=d.ref(((le=x.value)==null?void 0:le.type)==="dataContinuous"?x.value.initialData:null);d.watch(()=>A.value,z=>{const U=C.value[z];U.type==="fix"?i("aes-update",N.value,U):U.type==="dataCategorical"?(I.value=U.initialData,i("aes-update",U.initialData,U)):U.type==="dataContinuous"&&(F.value=U.initialData,i("aes-update",U.initialData,U))});const Q=d.ref(),Z=d.computed(()=>{if(n.type==="lineType")return $3.length*32+16*2;if(n.type==="dotShape")return Math.ceil(G7.length/6)*36+20*2;if(n.type==="fill"||n.type==="stroke")return Math.ceil(N3.length/6)*36+20*2});return(z,U)=>{var G,Y;return d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createElementVNode("div",bge,[d.createElementVNode("div",{class:"aes-input-select",onClick:U[1]||(U[1]=d.withModifiers(()=>{},["stop"]))},[d.createVNode(d.unref(rt.PlDropdown),{disabled:z.disabled||_.value.length<2,label:z.label,options:_.value,modelValue:A.value,"onUpdate:modelValue":U[0]||(U[0]=X=>A.value=X)},null,8,["disabled","label","options","modelValue"])]),d.createVNode(U5,{data:{type:A.value==="fix"?z.type:"data",value:A.value==="fix"?z.type==="size"?Number(z.selected):z.selected:null},onClick:U[2]||(U[2]=X=>P.value=!P.value),onRef:U[3]||(U[3]=X=>Q.value=X)},null,8,["data"]),A.value==="fix"&&P.value&&N.value?(d.openBlock(),d.createBlock(b6,{key:0,height:Z.value,targetRef:Q.value,"onPopup:close":U[10]||(U[10]=X=>P.value=!1)},{default:d.withCtx(()=>[d.createElementVNode("div",{class:d.normalizeClass(["fixed-aes-list",{"fixed-aes-list__rows":z.type==="lineType"}])},[z.type==="fill"||z.type==="stroke"?(d.openBlock(),d.createBlock(k$,{key:0,"color-using":z.type,modelValue:N.value,"onUpdate:modelValue":[U[4]||(U[4]=X=>N.value=X),U[5]||(U[5]=X=>z.$emit("aes-update",X,C.value.fix))]},null,8,["color-using","modelValue"])):d.createCommentVNode("",!0),z.type==="dotShape"?(d.openBlock(),d.createBlock(T$,{key:1,modelValue:N.value,"onUpdate:modelValue":[U[6]||(U[6]=X=>N.value=X),U[7]||(U[7]=X=>z.$emit("aes-update",X,C.value.fix))]},null,8,["modelValue"])):d.createCommentVNode("",!0),z.type==="lineType"?(d.openBlock(),d.createBlock(C6,{key:2,modelValue:N.value,"onUpdate:modelValue":[U[8]||(U[8]=X=>N.value=X),U[9]||(U[9]=X=>z.$emit("aes-update",X,C.value.fix))]},null,8,["modelValue"])):d.createCommentVNode("",!0)],2)]),_:1},8,["height","targetRef"])):d.createCommentVNode("",!0)]),(((G=x.value)==null?void 0:G.type)==="dataCategorical"&&I.value||((Y=x.value)==null?void 0:Y.type)==="dataContinuous"&&F.value)&&P.value?(d.openBlock(),d.createBlock(Uh,{key:0,title:z.formTitle,"back-title":z.formBackTitle,"onForm:close":U[15]||(U[15]=X=>P.value=!1)},{default:d.withCtx(()=>{var X,te,he,ae;return[((X=x.value)==null?void 0:X.type)==="dataCategorical"&&I.value?(d.openBlock(),d.createBlock(SB,{key:0,"column-value-labels":x.value.labels,"data-column-label":((te=x.value.selectedSourceInfo)==null?void 0:te.label)??"","used-aes-in-mapping":c.value[x.value.selectedSource],"allow-reordering":a.value==="discrete"||a.value==="histogram",modelValue:I.value,"onUpdate:modelValue":[U[11]||(U[11]=ge=>I.value=ge),U[12]||(U[12]=ge=>z.$emit("aes-update",ge,x.value))]},null,8,["column-value-labels","data-column-label","used-aes-in-mapping","allow-reordering","modelValue"])):d.createCommentVNode("",!0),((he=x.value)==null?void 0:he.type)==="dataContinuous"&&F.value?(d.openBlock(),d.createBlock(Cge,{key:1,"data-column-label":((ae=x.value.selectedSourceInfo)==null?void 0:ae.label)??"",modelValue:F.value,"onUpdate:modelValue":[U[13]||(U[13]=ge=>F.value=ge),U[14]||(U[14]=ge=>z.$emit("aes-update",ge,x.value))]},null,8,["data-column-label","modelValue"])):d.createCommentVNode("",!0)]}),_:1},8,["title","back-title"])):d.createCommentVNode("",!0)],64)}}}),Ege={class:"checkbox-item"},og="box",xge=d.defineComponent({__name:"Boxplot",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.layersSettings[og]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>Uc(n.value.fillColor,r.value,L3)),i=d.computed(()=>Uc(n.value.lineColor,r.value,gi)),o=d.computed(()=>n.value.dotShape),s=d.computed(()=>n.value.lineType);function c(v,y,b){y.type==="dataCategorical"?t.value.reactive.layersSettings[og][b]={type:y.inputName}:t.value.reactive.layersSettings[og][b]=v,y.type==="dataCategorical"&&typeof v!="string"&&(t.value.reactive.dataBindAes[y.selectedSource]=v)}function f(v,y,b){y.type==="dataCategorical"?t.value.reactive.layersSettings[og][b]={type:y.inputName}:t.value.reactive.layersSettings[og][b]=v,y.type==="dataCategorical"&&typeof v=="object"&&(t.value.reactive.dataBindAes[y.selectedSource]=v)}function A(v,y,b){y.type==="dataCategorical"?t.value.reactive.layersSettings[og][b]={type:y.inputName}:t.value.reactive.layersSettings[og][b]=v,y.type==="dataCategorical"&&typeof v=="object"&&(t.value.reactive.dataBindAes[y.selectedSource]=v)}const p=d.computed({get:()=>n.value.opacity*100,set:v=>{n.value.opacity=v/100}});return(v,y)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(ei,{label:"Fill color","form-title":"Fill Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,onAesUpdate:y[0]||(y[0]=(b,C)=>c(b,C,"fillColor"))},null,8,["selected"]),d.createVNode(ei,{label:"Stroke color","form-title":"Stroke Color Settings","form-back-title":"Layers",type:"stroke",selected:i.value,onAesUpdate:y[1]||(y[1]=(b,C)=>c(b,C,"lineColor"))},null,8,["selected"]),d.createVNode(ei,{label:"Line Type","form-title":"Line Type Settings","form-back-title":"Layers",type:"lineType","possible-aes-source-inputs":[],selected:s.value,onAesUpdate:y[2]||(y[2]=(b,C)=>A(b,C,"lineType"))},null,8,["selected"]),d.createVNode(d.unref(rt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:p.value,"onUpdate:modelValue":y[3]||(y[3]=b=>p.value=b)},null,8,["modelValue"]),d.createElementVNode("div",Ege,[d.createVNode(d.unref(rt.PlCheckbox),{modelValue:n.value.showOutliers,"onUpdate:modelValue":y[4]||(y[4]=b=>n.value.showOutliers=b)},null,8,["modelValue"]),y[6]||(y[6]=d.createElementVNode("span",null,"Show outliers",-1))]),n.value.showOutliers?(d.openBlock(),d.createBlock(ei,{key:0,label:"Outlier shape","form-title":"Outlier Shape Settings","form-back-title":"Layers",type:"dotShape","possible-aes-source-inputs":[],selected:o.value,onAesUpdate:y[5]||(y[5]=(b,C)=>f(b,C,"dotShape"))},null,8,["selected"])):d.createCommentVNode("",!0)],64))}}),Sge={class:"checkbox-item"},BB="binnedDots",Bge=d.defineComponent({__name:"BinnedDots",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.layersSettings[BB]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>Uc(n.value.fillColor,r.value,L3)),i=d.computed(()=>Uc(n.value.lineColor,r.value,gi));function o(c,f,A){f.type==="dataCategorical"?t.value.reactive.layersSettings[BB][A]={type:f.inputName}:t.value.reactive.layersSettings[BB][A]=c,f.type==="dataCategorical"&&typeof c!="string"&&(t.value.reactive.dataBindAes[f.selectedSource]=c)}const s=d.computed({get:()=>n.value.opacity*100,set:c=>{n.value.opacity=c/100}});return(c,f)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(ei,{label:"Fill color","form-title":"Fill Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,onAesUpdate:f[0]||(f[0]=(A,p)=>o(A,p,"fillColor"))},null,8,["selected"]),d.createVNode(ei,{label:"Stroke color","form-title":"Stroke Color Settings","form-back-title":"Layers",type:"stroke",selected:i.value,onAesUpdate:f[1]||(f[1]=(A,p)=>o(A,p,"lineColor"))},null,8,["selected"]),d.createVNode(d.unref(rt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:s.value,"onUpdate:modelValue":f[2]||(f[2]=A=>s.value=A)},null,8,["modelValue"]),d.createElementVNode("div",Sge,[d.createVNode(d.unref(rt.PlCheckbox),{modelValue:n.value.showOutliers,"onUpdate:modelValue":f[3]||(f[3]=A=>n.value.showOutliers=A)},null,8,["modelValue"]),f[4]||(f[4]=d.createElementVNode("span",null,"Show outliers",-1))])],64))}}),kge={class:"checkbox-item"},G5="jitteredDots",Tge=d.defineComponent({__name:"JitteredDots",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.layersSettings[G5]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>Uc(n.value.dotFill,r.value,gi));function i(c,f,A){f.type==="dataCategorical"?t.value.reactive.layersSettings[G5][A]={type:f.inputName}:t.value.reactive.layersSettings[G5][A]=c,f.type==="dataCategorical"&&typeof c!="string"&&(t.value.reactive.dataBindAes[f.selectedSource]=c)}function o(c,f,A){f.type==="dataCategorical"?t.value.reactive.layersSettings[G5][A]={type:f.inputName}:t.value.reactive.layersSettings[G5][A]=c,f.type==="dataCategorical"&&typeof c=="object"&&(t.value.reactive.dataBindAes[f.selectedSource]=c)}const s=d.computed({get:()=>n.value.opacity*100,set:c=>{n.value.opacity=c/100}});return(c,f)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(ei,{label:"Fill color","form-title":"Fill Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,onAesUpdate:f[0]||(f[0]=(A,p)=>i(A,p,"dotFill"))},null,8,["selected"]),d.createVNode(ei,{label:"Dot shape","form-title":"Dot Shape Settings","form-back-title":"Layers",type:"dotShape",selected:n.value.dotShape,onAesUpdate:f[1]||(f[1]=(A,p)=>o(A,p,"dotShape"))},null,8,["selected"]),d.createVNode(d.unref(rt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:s.value,"onUpdate:modelValue":f[2]||(f[2]=A=>s.value=A)},null,8,["modelValue"]),d.createElementVNode("div",kge,[d.createVNode(d.unref(rt.PlCheckbox),{modelValue:n.value.showOutliers,"onUpdate:modelValue":f[3]||(f[3]=A=>n.value.showOutliers=A)},null,8,["modelValue"]),f[4]||(f[4]=d.createElementVNode("span",null,"Show outliers",-1))])],64))}}),_ge={class:"checkbox-item"},Dge={class:"checkbox-item"},Pge={key:0},hy="violin",Mge=d.defineComponent({__name:"Violin",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.layersSettings[hy]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>Uc(n.value.fillColor,r.value,L3)),i=d.computed(()=>Uc(n.value.lineColor,r.value,gi)),o=d.computed(()=>n.value.lineType),s=d.computed(()=>n.value.medianLineStyle),c=d.computed(()=>n.value.quartilesLineStyle);function f(v,y,b){y.type==="dataCategorical"?t.value.reactive.layersSettings[hy][b]={type:y.inputName}:t.value.reactive.layersSettings[hy][b]=v,y.type==="dataCategorical"&&typeof v!="string"&&(t.value.reactive.dataBindAes[y.selectedSource]=v)}function A(v,y,b){t.value.reactive.layersSettings[hy][b]=typeof v=="object"?{type:y.value}:v,y.type==="dataCategorical"&&typeof v=="object"&&(t.value.reactive.dataBindAes[y.selectedSource]=v)}const p=d.computed({get:()=>n.value.opacity*100,set:v=>{n.value.opacity=v/100}});return(v,y)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(ei,{label:"Fill color","form-title":"Fill Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,onAesUpdate:y[0]||(y[0]=(b,C)=>f(b,C,"fillColor"))},null,8,["selected"]),d.createVNode(ei,{label:"Stroke color","form-title":"Stroke Color Settings","form-back-title":"Layers",type:"stroke",selected:i.value,onAesUpdate:y[1]||(y[1]=(b,C)=>f(b,C,"lineColor"))},null,8,["selected"]),d.createVNode(ei,{label:"Line Type","form-title":"Line Type Settings","form-back-title":"Layers",type:"lineType","possible-aes-source-inputs":[],selected:o.value,onAesUpdate:y[2]||(y[2]=(b,C)=>A(b,C,"lineType"))},null,8,["selected"]),d.createElementVNode("div",_ge,[d.createVNode(d.unref(rt.PlCheckbox),{modelValue:n.value.trim,"onUpdate:modelValue":y[3]||(y[3]=b=>n.value.trim=b)},null,8,["modelValue"]),y[8]||(y[8]=d.createElementVNode("span",null,"Trim",-1))]),d.createElementVNode("div",Dge,[d.createVNode(d.unref(rt.PlCheckbox),{modelValue:n.value.showQuartiles,"onUpdate:modelValue":y[4]||(y[4]=b=>n.value.showQuartiles=b)},null,8,["modelValue"]),y[9]||(y[9]=d.createElementVNode("span",null,"Show median and quartiles",-1))]),n.value.showQuartiles?(d.openBlock(),d.createElementBlock("div",Pge,[d.createVNode(ei,{label:"Madian Line Type","form-title":"Line Type Settings","form-back-title":"Layers",type:"lineType","possible-aes-source-inputs":[],selected:s.value,onAesUpdate:y[5]||(y[5]=b=>d.unref(t).reactive.layersSettings[hy].medianLineStyle=b)},null,8,["selected"]),d.createVNode(ei,{label:"Quartiles Line Type","form-title":"Line Type Settings","form-back-title":"Layers",type:"lineType","possible-aes-source-inputs":[],selected:c.value,onAesUpdate:y[6]||(y[6]=b=>d.unref(t).reactive.layersSettings[hy].quartilesLineStyle=b)},null,8,["selected"])])):d.createCommentVNode("",!0),d.createVNode(d.unref(rt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:p.value,"onUpdate:modelValue":y[7]||(y[7]=b=>p.value=b)},null,8,["modelValue"])],64))}}),kB="bar",Hge=d.defineComponent({__name:"Bar",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.layersSettings[kB]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>Uc(n.value.fillColor,r.value,L3)),i=d.computed(()=>Uc(n.value.lineColor,r.value,gi));function o(f,A,p){A.type==="dataCategorical"?t.value.reactive.layersSettings[kB][p]={type:A.inputName}:t.value.reactive.layersSettings[kB][p]=f,A.type==="dataCategorical"&&typeof f!="string"&&(t.value.reactive.dataBindAes[A.selectedSource]=f)}const s=[{text:"Min",value:"min"},{text:"Max",value:"max"},{text:"Mean",value:"mean"},{text:"Median",value:"median"}],c=d.computed({get:()=>n.value.opacity*100,set:f=>{n.value.opacity=f/100}});return(f,A)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(ei,{label:"Fill color","form-title":"Fill Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,onAesUpdate:A[0]||(A[0]=(p,v)=>o(p,v,"fillColor"))},null,8,["selected"]),d.createVNode(ei,{label:"Stroke color","form-title":"Stroke Color Settings","form-back-title":"Layers",type:"stroke",selected:i.value,onAesUpdate:A[1]||(A[1]=(p,v)=>o(p,v,"lineColor"))},null,8,["selected"]),d.createElementVNode("div",{class:"input-item",onClick:A[3]||(A[3]=d.withModifiers(()=>{},["stop"]))},[d.createVNode(d.unref(rt.PlDropdown),{label:"Height",options:s,modelValue:n.value.height,"onUpdate:modelValue":A[2]||(A[2]=p=>n.value.height=p)},null,8,["modelValue"])]),d.createVNode(d.unref(rt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:c.value,"onUpdate:modelValue":A[4]||(A[4]=p=>c.value=p)},null,8,["modelValue"])],64))}}),Ige={class:"checkbox-item"},TB="stackedBar",Rge=d.defineComponent({__name:"StackedBar",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.layersSettings[TB]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>Uc(n.value.fillColor,r.value,L3)),i=d.computed(()=>Uc(n.value.lineColor,r.value,gi));function o(c,f,A){f.type==="dataCategorical"?t.value.reactive.layersSettings[TB][A]={type:f.inputName}:t.value.reactive.layersSettings[TB][A]=c,f.type==="dataCategorical"&&typeof c!="string"&&(t.value.reactive.dataBindAes[f.selectedSource]=c)}const s=d.computed({get:()=>n.value.opacity*100,set:c=>{n.value.opacity=c/100}});return(c,f)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(ei,{label:"Fill color","form-title":"Fill Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,onAesUpdate:f[0]||(f[0]=(A,p)=>o(A,p,"fillColor"))},null,8,["selected"]),d.createVNode(ei,{label:"Stroke color","form-title":"Stroke Color Settings","form-back-title":"Layers",type:"stroke",selected:i.value,onAesUpdate:f[1]||(f[1]=(A,p)=>o(A,p,"lineColor"))},null,8,["selected"]),d.createVNode(d.unref(rt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:s.value,"onUpdate:modelValue":f[2]||(f[2]=A=>s.value=A)},null,8,["modelValue"]),d.createElementVNode("div",Ige,[d.createVNode(d.unref(rt.PlCheckbox),{modelValue:n.value.normalize,"onUpdate:modelValue":f[3]||(f[3]=A=>n.value.normalize=A)},null,8,["modelValue"]),f[4]||(f[4]=d.createElementVNode("span",null,"Normalize",-1))])],64))}}),lg="line",Nge=d.defineComponent({__name:"Line",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.layersSettings[lg]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>Uc(n.value.lineColor,r.value,gi,!0)),i=d.computed(()=>Uc(n.value.dotFill,r.value,gi,!0)),o=d.computed(()=>n.value.lineType);function s(v,y,b){y.type==="dataCategorical"?t.value.reactive.layersSettings[lg][b]={type:y.inputName}:t.value.reactive.layersSettings[lg][b]=v,y.type==="dataCategorical"&&typeof v!="string"&&(t.value.reactive.dataBindAes[y.selectedSource]=v)}function c(v,y,b){y.type==="dataCategorical"?t.value.reactive.layersSettings[lg][b]={type:y.inputName}:t.value.reactive.layersSettings[lg][b]=v,y.type==="dataCategorical"&&typeof v=="object"&&(t.value.reactive.dataBindAes[y.selectedSource]=v)}function f(v,y,b){y.type==="dataCategorical"?t.value.reactive.layersSettings[lg][b]={type:y.inputName}:t.value.reactive.layersSettings[lg][b]=v,y.type==="dataCategorical"&&typeof v=="object"&&(t.value.reactive.dataBindAes[y.selectedSource]=v)}const A=[{text:"Mean",value:"mean"},{text:"Median",value:"median"}],p=d.computed({get:()=>n.value.opacity*100,set:v=>{n.value.opacity=v/100}});return(v,y)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(ei,{label:"Stroke color","form-title":"Stroke Color Settings","form-back-title":"Layers",type:"stroke",selected:a.value,"possible-aes-source-inputs":["secondaryGrouping"],onAesUpdate:y[0]||(y[0]=(b,C)=>s(b,C,"lineColor"))},null,8,["selected"]),d.createVNode(ei,{label:"Line Type","form-title":"Line Type Settings","form-back-title":"Layers",type:"lineType","possible-aes-source-inputs":["secondaryGrouping"],selected:o.value,onAesUpdate:y[1]||(y[1]=(b,C)=>f(b,C,"lineType"))},null,8,["selected"]),d.createVNode(ei,{label:"Dot fill","form-title":"Dot Fill Settings","form-back-title":"Layers",type:"fill",selected:i.value,"possible-aes-source-inputs":["secondaryGrouping"],onAesUpdate:y[2]||(y[2]=(b,C)=>s(b,C,"dotFill"))},null,8,["selected"]),d.createVNode(ei,{label:"Dot shape","form-title":"Dot Shape Settings","form-back-title":"Layers",type:"dotShape",selected:n.value.dotShape,"possible-aes-source-inputs":["secondaryGrouping"],onAesUpdate:y[3]||(y[3]=(b,C)=>c(b,C,"dotShape"))},null,8,["selected"]),d.createElementVNode("div",{class:"input-item",onClick:y[5]||(y[5]=d.withModifiers(()=>{},["stop"]))},[d.createVNode(d.unref(rt.PlDropdown),{label:"Point value",options:A,modelValue:n.value.pointsValues,"onUpdate:modelValue":y[4]||(y[4]=b=>n.value.pointsValues=b)},null,8,["modelValue"])]),d.createVNode(d.unref(rt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:p.value,"onUpdate:modelValue":y[6]||(y[6]=b=>p.value=b)},null,8,["modelValue"])],64))}}),j5="errorbar",Lge=d.defineComponent({__name:"Errorbar",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.layersSettings[j5]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>Uc(n.value.lineColor,r.value,gi,!0)),i=d.computed(()=>Uc(n.value.dotFill,r.value,gi,!0));function o(p,v,y){v.type==="dataCategorical"?t.value.reactive.layersSettings[j5][y]={type:v.inputName}:t.value.reactive.layersSettings[j5][y]=p,v.type==="dataCategorical"&&typeof p!="string"&&(t.value.reactive.dataBindAes[v.selectedSource]=p)}function s(p,v,y){v.type==="dataCategorical"?t.value.reactive.layersSettings[j5][y]={type:v.inputName}:t.value.reactive.layersSettings[j5][y]=p,v.type==="dataCategorical"&&typeof p=="object"&&(t.value.reactive.dataBindAes[v.selectedSource]=p)}const c=[{text:"Standard deviation",value:"sd"},{text:"Standard error",value:"se"},{text:"Confident interval",value:"ci"}],f=[{text:"Mean",value:"mean"},{text:"Median",value:"median"}],A=d.computed({get:()=>n.value.opacity*100,set:p=>{n.value.opacity=p/100}});return(p,v)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(ei,{label:"Stroke color","form-title":"Stroke Color Settings","form-back-title":"Layers",type:"stroke",selected:a.value,"possible-aes-source-inputs":["secondaryGrouping"],onAesUpdate:v[0]||(v[0]=(y,b)=>o(y,b,"lineColor"))},null,8,["selected"]),d.createVNode(ei,{label:"Dot fill","form-title":"Dot Fill Settings","form-back-title":"Layers",type:"fill",selected:i.value,"possible-aes-source-inputs":["secondaryGrouping"],onAesUpdate:v[1]||(v[1]=(y,b)=>o(y,b,"dotFill"))},null,8,["selected"]),d.createVNode(ei,{label:"Dot shape","form-title":"Dot Shape Settings","form-back-title":"Layers",type:"dotShape",selected:n.value.dotShape,"possible-aes-source-inputs":["secondaryGrouping"],onAesUpdate:v[2]||(v[2]=(y,b)=>s(y,b,"dotShape"))},null,8,["selected"]),d.createElementVNode("div",{class:"input-item",onClick:v[4]||(v[4]=d.withModifiers(()=>{},["stop"]))},[d.createVNode(d.unref(rt.PlDropdown),{label:"Point value",options:f,modelValue:n.value.pointsValues,"onUpdate:modelValue":v[3]||(v[3]=y=>n.value.pointsValues=y)},null,8,["modelValue"])]),d.createElementVNode("div",{class:"input-item",onClick:v[6]||(v[6]=d.withModifiers(()=>{},["stop"]))},[d.createVNode(d.unref(rt.PlDropdown),{label:"Interval",options:c,modelValue:n.value.interval,"onUpdate:modelValue":v[5]||(v[5]=y=>n.value.interval=y)},null,8,["modelValue"])]),d.createVNode(d.unref(rt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:A.value,"onUpdate:modelValue":v[7]||(v[7]=y=>A.value=y)},null,8,["modelValue"])],64))}}),Y5="sina",$ge=d.defineComponent({__name:"Sina",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.layersSettings[Y5]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>Uc(n.value.dotFill,r.value,gi));function i(c,f,A){f.type==="dataCategorical"?t.value.reactive.layersSettings[Y5][A]={type:f.inputName}:t.value.reactive.layersSettings[Y5][A]=c,f.type==="dataCategorical"&&typeof c!="string"&&(t.value.reactive.dataBindAes[f.selectedSource]=c)}function o(c,f,A){f.type==="dataCategorical"?t.value.reactive.layersSettings[Y5][A]={type:f.inputName}:t.value.reactive.layersSettings[Y5][A]=c,f.type==="dataCategorical"&&typeof c=="object"&&(t.value.reactive.dataBindAes[f.selectedSource]=c)}const s=d.computed({get:()=>n.value.opacity*100,set:c=>{n.value.opacity=c/100}});return(c,f)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(ei,{label:"Fill color","form-title":"Fill Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,onAesUpdate:f[0]||(f[0]=(A,p)=>i(A,p,"dotFill"))},null,8,["selected"]),d.createVNode(ei,{label:"Dot shape","form-title":"Dot Shape Settings","form-back-title":"Layers",type:"dotShape",selected:n.value.dotShape,onAesUpdate:f[1]||(f[1]=(A,p)=>o(A,p,"dotShape"))},null,8,["selected"]),d.createVNode(d.unref(rt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:s.value,"onUpdate:modelValue":f[2]||(f[2]=A=>s.value=A)},null,8,["modelValue"])],64))}}),Fge={class:"checkbox-item"},Vge="logo",Oge=d.defineComponent({__name:"Logo",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.layersSettings[Vge]),r=d.computed({get:()=>n.value.opacity*100,set:a=>{n.value.opacity=a/100}});return(a,i)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(d.unref(rt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=o=>r.value=o)},null,8,["modelValue"]),d.createElementVNode("div",Fge,[d.createVNode(d.unref(rt.PlCheckbox),{modelValue:n.value.normalize,"onUpdate:modelValue":i[1]||(i[1]=o=>n.value.normalize=o)},null,8,["modelValue"]),i[2]||(i[2]=d.createElementVNode("span",null,"Normalize",-1))])],64))}}),Qge={class:"button-group-item"},zge={class:"button-group-item"},Uge={class:"button-group-item",style:{display:"flex",alignItems:"end"}},Gge=d.defineComponent({__name:"Heatmap",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.layersSettings.heatmap),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>t.value.inputGuide.value),i=d.computed(()=>{var C;return(C=r.value.components.value.selectorStates[0])==null?void 0:C.selectedSource}),o=d.computed(()=>{var C;return i.value?(C=t.value.reactive.dataBindAes[i.value])==null?void 0:C.palette:void 0}),s=d.ref(!1),c=d.ref(o.value??nv);function f(C){c.value=C,s.value=!1,i.value&&(t.value.reactive.dataBindAes[i.value]=Xm(C))}const A=[{label:"None",value:null},{label:"Columns",value:"column"},{label:"Rows",value:"row"}],p=[{label:"z-score",value:"standardScaling"},{label:"Min-max",value:"meanNormalization"}],v=[{label:"empty",value:null},{label:"Special value",value:"custom"}],y=d.ref(n.value.NAValueAs===null?null:"custom"),b=d.ref(n.value.NAValueAs??0);return(C,x)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(Ay,{label:"Color Palette ",title:d.unref(Gi)[c.value].title,palette:c.value,onButtonClick:x[0]||(x[0]=k=>{s.value=!0})},null,8,["title","palette"]),s.value?(d.openBlock(),d.createBlock(Uh,{key:0,title:"Color Palette","back-title":"Color mapping","onForm:close":x[1]||(x[1]=k=>s.value=!1)},{default:d.withCtx(()=>[d.createVNode(py,{selected:c.value,categorical:i.value?a.value.getSourceInfo(i.value).type==="String":!1,onSelect:f},null,8,["selected","categorical"])]),_:1})):d.createCommentVNode("",!0),d.createElementVNode("div",Qge,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Normalize by",options:A,compact:!0,modelValue:n.value.normalizationDirection,"onUpdate:modelValue":x[2]||(x[2]=k=>n.value.normalizationDirection=k)},null,8,["modelValue"])]),d.createElementVNode("div",zge,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Normalization method",options:p,compact:!0,modelValue:n.value.normalizationMethod,"onUpdate:modelValue":x[3]||(x[3]=k=>n.value.normalizationMethod=k)},null,8,["modelValue"])]),d.createElementVNode("div",Uge,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Treat NA value as:",options:v,compact:!0,modelValue:y.value,"onUpdate:modelValue":[x[4]||(x[4]=k=>y.value=k),x[5]||(x[5]=k=>{k==="custom"?n.value.NAValueAs=b.value:n.value.NAValueAs=k})]},null,8,["modelValue"]),d.createVNode(d.unref(rt.PlNumberField),{style:{height:"33px",marginLeft:"16px",width:"75px"},disabled:y.value!=="custom",label:"NA value",useIncrementButtons:!1,modelValue:b.value,"onUpdate:modelValue":[x[6]||(x[6]=k=>b.value=k),x[7]||(x[7]=k=>{k!==void 0&&(n.value.NAValueAs=k)})]},null,8,["disabled","modelValue"])])],64))}}),jge={class:"checkbox-item"},Yge={class:"checkbox-item"},W5="dendro",Wge=d.defineComponent({__name:"Dendro",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.layersSettings[W5]),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>n.value.dotFill),i=d.computed(()=>n.value.dotShape),o=d.computed(()=>n.value.lineColor);function s(y,b,C){typeof y=="string"?t.value.reactive.layersSettings[W5][C]=y:b.type==="dataCategorical"&&(t.value.reactive.layersSettings[W5][C]={type:b.inputName,value:b.selectedSource}),b.type==="dataCategorical"&&typeof y!="string"&&(t.value.reactive.dataBindAes[b.selectedSource]=y)}function c(y,b,C){typeof y=="string"?t.value.reactive.layersSettings[W5][C]=y:b.type==="dataCategorical"&&(t.value.reactive.layersSettings[W5][C]={type:b.inputName,value:b.selectedSource}),b.type==="dataCategorical"&&typeof y!="string"&&(t.value.reactive.dataBindAes[b.selectedSource]=y)}const f=d.ref(n.value.leavesMode==="alignLeavesToLine"),A=d.computed({get(){return n.value.showLegend??!0},set(y){n.value.showLegend=y}}),p=d.computed({get(){return LS(n.value.dotSize)?[n.value.dotSize.min,n.value.dotSize.max]:[3,10]},set([y,b]){n.value.dotSize={min:y,max:b}}}),v=d.computed({get(){return LS(n.value.dotSize)?3:n.value.dotSize},set(y){n.value.dotSize=y}});return(y,b)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(ei,{label:"Node color","form-title":"Node Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,"possible-aes-source-inputs":["nodeColor"],"without-fixed":r.value.components.nodeColor.selectorStates.length>0,onAesUpdate:b[0]||(b[0]=(C,x)=>s(C,x,"dotFill"))},null,8,["selected","without-fixed"]),d.createVNode(ei,{label:"Node shape","form-title":"Node Shape Settings","form-back-title":"Layers",type:"dotShape",selected:i.value,"possible-aes-source-inputs":["nodeShape"],"without-fixed":r.value.components.nodeShape.selectorStates.length>0,onAesUpdate:b[1]||(b[1]=(C,x)=>c(C,x,"dotShape"))},null,8,["selected","without-fixed"]),d.createVNode(ei,{label:"Line color","form-title":"Line Color Settings","form-back-title":"Layers",type:"fill",selected:o.value,"possible-aes-source-inputs":["lineColor"],"without-fixed":r.value.components.lineColor.selectorStates.length>0,onAesUpdate:b[2]||(b[2]=(C,x)=>s(C,x,"lineColor"))},null,8,["selected","without-fixed"]),d.createElementVNode("div",null,[r.value.components.nodeSize.selectorStates.length>0?(d.openBlock(),d.createBlock(d.unref(rt.SliderRange),{key:0,min:3,max:10,breakpoints:!0,label:"Node size range",modelValue:p.value,"onUpdate:modelValue":b[3]||(b[3]=C=>p.value=C)},null,8,["modelValue"])):(d.openBlock(),d.createBlock(d.unref(rt.Slider),{key:1,min:3,max:10,step:1,breakpoints:!0,label:"Node size",modelValue:v.value,"onUpdate:modelValue":b[4]||(b[4]=C=>v.value=C)},null,8,["modelValue"]))]),d.createElementVNode("div",jge,[d.createVNode(d.unref(rt.PlCheckbox),{modelValue:f.value,"onUpdate:modelValue":[b[5]||(b[5]=C=>f.value=C),b[6]||(b[6]=C=>{n.value.leavesMode=C?"alignLeavesToLine":"normal"})]},null,8,["modelValue"]),b[8]||(b[8]=d.createElementVNode("span",null,"Move leaves to the right",-1))]),d.createElementVNode("div",Yge,[d.createVNode(d.unref(rt.PlCheckbox),{modelValue:A.value,"onUpdate:modelValue":b[7]||(b[7]=C=>A.value=C)},null,8,["modelValue"]),b[9]||(b[9]=d.createElementVNode("span",null,"Show legend",-1))])],64))}}),Xge={class:"dot-size-selector"},Kge={class:"dot-size-selector__row"},Zge={class:"dot-size-selector-row"},D$=d.defineComponent({__name:"DotSizeSelector",props:{selected:{},min:{default:3},max:{default:10},possibleAesSourceInputs:{}},emits:["aes-update","aes-selector-close"],setup(e,{emit:t}){const n=e,r=Tr(),a=d.computed(()=>r.value.reactive.chartType),i=t,o={discrete:["primaryGrouping","secondaryGrouping"],scatterplot:["size"],"scatterplot-umap":["size"],dendro:[],heatmap:[],histogram:[],bubble:[]},s=n.possibleAesSourceInputs??o[a.value],c=d.ref(Vh(n.selected)?n.selected.column:"fix"),f=d.computed(()=>r.value.inputGuide.value);function A(b){const C=f.value.getSourceInfo(b);return a.value==="scatterplot"||a.value==="dendro"?`Grouping: ${C==null?void 0:C.label}`:C?(C==null?void 0:C.label)??"":"Not consistent (grouping)"}const p=d.computed(()=>{const b=[],C=r.value.reactive.optionsState.components;return s.forEach(x=>{var k;(k=C==null?void 0:C[x])!=null&&k.selectorStates.length&&C[x].selectorStates.forEach(({selectedSource:_})=>{f.value.getSourceInfo(_).type!=="String"&&b.push({text:A(_),value:_})})}),b.length?b:[{text:"Fixed",value:"fix"}]}),v=d.ref(Vh(n.selected)?H0:n.selected??H0),y=d.ref(Vh(n.selected)?[n.selected.range.min,n.selected.range.max]:[Wm.min,Wm.max]);return d.watch(()=>c.value,b=>{if(b==="fix")i("aes-update",v.value);else{const C={column:b,range:{min:y.value[0],max:y.value[1]}};i("aes-update",C)}}),d.watch(()=>v.value,b=>{c.value==="fix"&&i("aes-update",b)}),d.watch(()=>y.value,b=>{if(c.value!=="fix"){const C={column:c.value,range:{min:b[0],max:b[1]}};i("aes-update",C)}}),(b,C)=>(d.openBlock(),d.createElementBlock("div",Xge,[d.createElementVNode("div",Kge,[d.createElementVNode("div",{class:"aes-input-select",onClick:C[1]||(C[1]=d.withModifiers(()=>{},["stop"]))},[d.createVNode(d.unref(rt.PlDropdown),{disabled:p.value.length<2&&p.value[0].value===c.value,label:"Dot size source",options:p.value,modelValue:c.value,"onUpdate:modelValue":C[0]||(C[0]=x=>c.value=x)},null,8,["disabled","options","modelValue"])])]),d.createElementVNode("div",Zge,[c.value!=="fix"?(d.openBlock(),d.createBlock(d.unref(rt.SliderRange),{key:0,min:b.min,max:b.max,breakpoints:!0,label:"Dot size range",modelValue:y.value,"onUpdate:modelValue":C[2]||(C[2]=x=>y.value=x)},null,8,["min","max","modelValue"])):(d.openBlock(),d.createBlock(d.unref(rt.Slider),{key:1,min:b.min,max:b.max,step:1,breakpoints:!0,label:"Dot size",modelValue:v.value,"onUpdate:modelValue":C[3]||(C[3]=x=>v.value=x)},null,8,["min","max","modelValue"]))])]))}}),vy="dots",Jge=d.defineComponent({__name:"Scatter",setup(e){const t=Tr(),n=t.value.reactive.optionsState,r=d.computed(()=>t.value.inputGuide.value),a=d.computed(()=>t.value.reactive.layersSettings[vy]);function i(y){return y!==null&&typeof y=="object"&&"type"in y}const o=d.computed(()=>{const y=a.value.dotFill,b=n.components.grouping.selectorStates.map(C=>C.selectedSource);return i(y)&&b.length?b.includes(y.value)?y:{type:"grouping",value:b[0]}:b.length?{type:"grouping",value:b[0]}:i(y)?gi:y??gi}),s=d.computed(()=>{const y=a.value.dotShape,b=n.components.shape.selectorStates.map(C=>C.selectedSource);return i(y)&&b.length?y.value===b[0]?y:{type:"shape",value:b[0]}:b.length?{type:"shape",value:b[0]}:i(y)?D0:y??D0}),c=d.computed(()=>{const y=a.value.dotSize,b=n.components.size.selectorStates.map(C=>C.selectedSource);return b.length?{column:b[0],range:Vh(y)?y.range:Wm}:Vh(y)?H0:y??H0});function f(y,b,C){typeof y=="string"?t.value.reactive.layersSettings[vy][C]=y:(b.type==="dataCategorical"||b.type==="dataContinuous")&&(t.value.reactive.layersSettings[vy][C]={type:"grouping",value:b.selectedSource}),TN(y)&&b.type!=="fix"&&(t.value.reactive.dataBindAes[b.selectedSource]=y)}function A(y,b,C){typeof y=="string"?t.value.reactive.layersSettings[vy][C]=y:b.type==="dataCategorical"&&(t.value.reactive.layersSettings[vy][C]={type:"grouping",value:b.selectedSource}),b.type==="dataCategorical"&&typeof y!="string"&&(t.value.reactive.dataBindAes[b.selectedSource]=y)}function p(y){t.value.reactive.layersSettings[vy].dotSize=y}const v=d.computed(()=>{if(n.components.grouping.selectorStates.length){const y=n.components.grouping.selectorStates[0].selectedSource,b=r.value.getSourceInfo(y).annotations;if(b!=null&&b[K3])return!0}return!1});return(y,b)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(ei,{label:"Dot color","form-title":"Dot color Settings","form-back-title":"Layers",type:"fill",selected:o.value,"possible-aes-source-inputs":["grouping"],disabled:v.value,withoutFixed:typeof o.value=="object",onAesUpdate:b[0]||(b[0]=(C,x)=>f(C,x,"dotFill"))},null,8,["selected","disabled","withoutFixed"]),d.createVNode(ei,{label:"Dot shape","form-title":"Dot shape Settings","form-back-title":"Layers",type:"dotShape","possible-aes-source-inputs":["shape"],selected:s.value,withoutFixed:typeof s.value=="object",onAesUpdate:b[1]||(b[1]=(C,x)=>A(C,x,"dotShape"))},null,8,["selected","withoutFixed"]),d.createVNode(D$,{selected:c.value,onAesUpdate:p},null,8,["selected"])],64))}}),x6="dots",qge=d.defineComponent({__name:"Scatter",setup(e){const t=Tr(),n=t.value.reactive.optionsState,r=d.computed(()=>t.value.inputGuide.value),a=d.computed(()=>t.value.reactive.layersSettings[x6]);function i(p){return p!==null&&typeof p=="object"&&"type"in p}const o=d.computed(()=>{const p=a.value.dotFill,v=n.components.grouping.selectorStates.map(y=>y.selectedSource);return i(p)&&v.length?v.includes(p.value)?p:{type:"grouping",value:v[0]}:v.length?{type:"grouping",value:v[0]}:i(p)?gi:p??gi});function s(p,v,y){typeof p=="string"?t.value.reactive.layersSettings[x6][y]=p:(v.type==="dataCategorical"||v.type==="dataContinuous")&&(t.value.reactive.layersSettings[x6][y]={type:"grouping",value:v.selectedSource}),TN(p)&&v.type!=="fix"&&(t.value.reactive.dataBindAes[v.selectedSource]=p)}const c=d.computed(()=>{if(n.components.grouping.selectorStates.length){const p=n.components.grouping.selectorStates[0].selectedSource,v=r.value.getSourceInfo(p).annotations;if(v!=null&&v[K3])return!0}return!1}),f=d.computed(()=>{const p=a.value.dotSize,v=n.components.size.selectorStates.map(y=>y.selectedSource);return v.length?{column:v[0],range:Vh(p)?p.range:Wm}:Vh(p)?RS:p??RS});function A(p){t.value.reactive.layersSettings[x6].dotSize=p}return(p,v)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(ei,{label:"Dot color","form-title":"Dot color Settings1","form-back-title":"Layers",type:"fill",selected:o.value,"possible-aes-source-inputs":["grouping"],disabled:c.value,withoutFixed:typeof o.value=="object",onAesUpdate:v[0]||(v[0]=(y,b)=>s(y,b,"dotFill"))},null,8,["selected","disabled","withoutFixed"]),d.createVNode(D$,{selected:f.value,onAesUpdate:A,min:2},null,8,["selected"])],64))}}),e3e={class:"input-item",style:{display:"flex","justify-content":"space-between","align-items":"center"}},_B="curve",P$=d.defineComponent({__name:"Curve",setup(e){const t=Tr(),n=t.value.reactive.optionsState,r=d.computed(()=>t.value.reactive.layersSettings[_B]);function a(s){return s!==null&&typeof s=="object"&&"type"in s}const i=d.computed(()=>{const s=r.value.lineColor,c=n.components.grouping.selectorStates.map(f=>f.selectedSource);return a(s)&&c.length?c.includes(s.value)?s:{type:"grouping",value:c[0]}:c.length?{type:"grouping",value:c[0]}:a(s)?gi:s??gi});function o(s,c,f){typeof s=="string"?t.value.reactive.layersSettings[_B][f]=s:c.type==="dataCategorical"&&(t.value.reactive.layersSettings[_B][f]={type:c.inputName,value:c.selectedSource}),c.type==="dataCategorical"&&typeof s!="string"&&(t.value.reactive.dataBindAes[c.selectedSource]=s)}return(s,c)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(ei,{label:"Color","form-title":"Color Settings","form-back-title":"Layers",type:"stroke",selected:i.value,withoutFixed:typeof i.value=="object","possible-aes-source-inputs":["grouping"],onAesUpdate:c[0]||(c[0]=(f,A)=>o(f,A,"lineColor"))},null,8,["selected","withoutFixed"]),d.createElementVNode("div",e3e,[c[2]||(c[2]=d.createElementVNode("span",null,"Smoothing",-1)),d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:d.unref(t).reactive.layersSettings.curve.smoothing,"onUpdate:modelValue":c[1]||(c[1]=f=>d.unref(t).reactive.layersSettings.curve.smoothing=f)},null,8,["modelValue"])])],64))}}),t3e={class:"checkbox-item"},n3e={key:1,class:"checkbox-item"},r3e={class:"checkbox-item"},a3e={key:2,class:"checkbox-item"},i3e={class:"button-group-item"},o3e={class:"button-group-item"},l3e={class:"button-group-item",style:{display:"flex",alignItems:"end"}},s3e=d.defineComponent({__name:"HeatmapClustered",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.layersSettings.heatmapClustered),r=d.computed(()=>t.value.reactive.optionsState),a=d.computed(()=>t.value.inputGuide.value),i=d.computed(()=>{var C;return(C=r.value.components.value.selectorStates[0])==null?void 0:C.selectedSource}),o=d.computed(()=>{var C;return i.value?(C=t.value.reactive.dataBindAes[i.value])==null?void 0:C.palette:void 0}),s=d.ref(!1),c=d.ref(o.value??nv);function f(C){c.value=C,s.value=!1,i.value&&(t.value.reactive.dataBindAes[i.value]=Xm(C))}const A=[{label:"None",value:null},{label:"Columns",value:"column"},{label:"Rows",value:"row"}],p=[{label:"z-score",value:"standardScaling"},{label:"Min-max",value:"meanNormalization"}],v=[{label:"empty",value:null},{label:"Special value",value:"custom"}],y=d.ref(n.value.NAValueAs!==null?"custom":n.value.NAValueAs),b=d.ref(n.value.NAValueAs??0);return(C,x)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(Ay,{label:"Color Palette ",title:d.unref(Gi)[c.value].title,palette:c.value,onButtonClick:x[0]||(x[0]=k=>{s.value=!0})},null,8,["title","palette"]),s.value?(d.openBlock(),d.createBlock(Uh,{key:0,title:"Color Palette","back-title":"Color mapping","onForm:close":x[1]||(x[1]=k=>s.value=!1)},{default:d.withCtx(()=>[d.createVNode(py,{selected:c.value,categorical:i.value?a.value.getSourceInfo(i.value).type==="String":!1,onSelect:f},null,8,["selected","categorical"])]),_:1})):d.createCommentVNode("",!0),d.createElementVNode("div",t3e,[d.createVNode(d.unref(rt.PlCheckbox),{modelValue:n.value.disableClusteringX,"onUpdate:modelValue":x[2]||(x[2]=k=>n.value.disableClusteringX=k)},null,8,["modelValue"]),x[12]||(x[12]=d.createElementVNode("span",null,"Disable clustering for X axis",-1))]),n.value.disableClusteringX?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",n3e,[d.createVNode(d.unref(rt.PlCheckbox),{modelValue:n.value.dendrogramX,"onUpdate:modelValue":x[3]||(x[3]=k=>n.value.dendrogramX=k)},null,8,["modelValue"]),x[13]||(x[13]=d.createElementVNode("span",null,"Show dendrogram for X axis",-1))])),d.createElementVNode("div",r3e,[d.createVNode(d.unref(rt.PlCheckbox),{modelValue:n.value.disableClusteringY,"onUpdate:modelValue":x[4]||(x[4]=k=>n.value.disableClusteringY=k)},null,8,["modelValue"]),x[14]||(x[14]=d.createElementVNode("span",null,"Disable clustering for Y axis",-1))]),n.value.disableClusteringY?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",a3e,[d.createVNode(d.unref(rt.PlCheckbox),{modelValue:n.value.dendrogramY,"onUpdate:modelValue":x[5]||(x[5]=k=>n.value.dendrogramY=k)},null,8,["modelValue"]),x[15]||(x[15]=d.createElementVNode("span",null,"Show dendrogram for Y axis",-1))])),d.createElementVNode("div",i3e,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Normalize by",options:A,compact:!0,modelValue:n.value.normalizationDirection,"onUpdate:modelValue":x[6]||(x[6]=k=>n.value.normalizationDirection=k)},null,8,["modelValue"])]),d.createElementVNode("div",o3e,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Normalization method",options:p,compact:!0,modelValue:n.value.normalizationMethod,"onUpdate:modelValue":x[7]||(x[7]=k=>n.value.normalizationMethod=k)},null,8,["modelValue"])]),d.createElementVNode("div",l3e,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Treat NA value as:",options:v,compact:!0,modelValue:y.value,"onUpdate:modelValue":[x[8]||(x[8]=k=>y.value=k),x[9]||(x[9]=k=>{k==="custom"?n.value.NAValueAs=b.value:n.value.NAValueAs=k})]},null,8,["modelValue"]),d.createVNode(d.unref(rt.PlNumberField),{style:{height:"33px",marginLeft:"16px",width:"75px"},disabled:y.value!=="custom",label:"NA value",useIncrementButtons:!1,modelValue:b.value,"onUpdate:modelValue":[x[10]||(x[10]=k=>b.value=k),x[11]||(x[11]=k=>{k!==void 0&&(n.value.NAValueAs=k)})]},null,8,["disabled","modelValue"])])],64))}}),u3e={class:"section-title"},c3e=d.defineComponent({__name:"HeatmapAnnotations",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.optionsState),r=d.computed(()=>t.value.inputGuide.value),a=d.computed(()=>{const A=n.value.components.annotationsX.selectorStates.map(v=>v.selectedSource),p=n.value.components.annotationsY.selectorStates.map(v=>v.selectedSource);return[...A,...p]}),i=d.computed(()=>a.value.reduce((A,p)=>(A[p]=r.value.getSourceInfo(p),A),{})),o=d.reactive(a.value.reduce((A,p)=>{var b,C;const y=((b=i.value[p])==null?void 0:b.type)==="String"?wR:nv;return A[p]=((C=t.value.reactive.dataBindAes[p])==null?void 0:C.palette)??y,A},{})),s=d.ref(null),c=d.ref(null);function f(A){const p=c.value;p&&(o[p]=A,t.value.reactive.dataBindAes[p]=Xm(A)),s.value=p}return(A,p)=>(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.value,v=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createElementVNode("div",u3e,[d.createElementVNode("span",null,d.toDisplayString(i.value[v].label),1)]),d.createVNode(Ay,{label:"Color Palette ",title:d.unref(Gi)[o[v]].title,palette:o[v],style:{marginBottom:"24px"},onButtonClick:y=>{s.value=v,c.value=v}},null,8,["title","palette","onButtonClick"]),s.value===v?(d.openBlock(),d.createBlock(Uh,{key:0,title:"Color Palette","back-title":"Color mapping","onForm:close":p[0]||(p[0]=y=>s.value=null)},{default:d.withCtx(()=>[d.createVNode(py,{selected:o[v],categorical:i.value[v].type==="String",onSelect:f},null,8,["selected","categorical"])]),_:2},1024)):d.createCommentVNode("",!0)],64))),256))}}),f3e={},d3e={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function A3e(e,t){return d.openBlock(),d.createElementBlock("svg",d3e,t[0]||(t[0]=[d.createStaticVNode('<path fill-rule="evenodd" clip-rule="evenodd" d="M9.25 13.5C9.25 14.1904 9.80964 14.75 10.5 14.75L13.5 14.75C14.1904 14.75 14.75 14.1904 14.75 13.5V10.5C14.75 9.80964 14.1904 9.25 13.5 9.25H10.5C9.80964 9.25 9.25 9.80964 9.25 10.5V13.5ZM10.75 13.25V10.75H13.25V13.25H10.75Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M9.25 20.5C9.25 21.1904 9.80964 21.75 10.5 21.75H13.5C14.1904 21.75 14.75 21.1904 14.75 20.5V17.5C14.75 16.8096 14.1904 16.25 13.5 16.25H10.5C9.80964 16.25 9.25 16.8096 9.25 17.5L9.25 20.5ZM10.75 20.25V17.75H13.25V20.25H10.75Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 13.5C2.25 14.1904 2.80964 14.75 3.5 14.75H6.5C7.19036 14.75 7.75 14.1904 7.75 13.5L7.75 10.5C7.75 9.80964 7.19036 9.25 6.5 9.25H3.5C2.80964 9.25 2.25 9.80964 2.25 10.5L2.25 13.5ZM3.75 13.25L3.75 10.75H6.25V13.25H3.75Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 20.5C2.25 21.1904 2.80964 21.75 3.5 21.75H6.5C7.19036 21.75 7.75 21.1904 7.75 20.5L7.75 17.5C7.75 16.8096 7.19036 16.25 6.5 16.25H3.5C2.80964 16.25 2.25 16.8096 2.25 17.5L2.25 20.5ZM3.75 20.25L3.75 17.75H6.25V20.25H3.75Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M16.25 20.5C16.25 21.1904 16.8096 21.75 17.5 21.75H20.5C21.1904 21.75 21.75 21.1904 21.75 20.5L21.75 10.5C21.75 9.80964 21.1904 9.25 20.5 9.25H17.5C16.8096 9.25 16.25 9.80964 16.25 10.5L16.25 20.5ZM17.75 20.25L17.75 10.75L20.25 10.75L20.25 20.25H17.75Z" fill="#07AD3E"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 6.5C2.25 7.19036 2.80964 7.75 3.5 7.75L13.5 7.75C14.1904 7.75 14.75 7.19036 14.75 6.5V3.5C14.75 2.80964 14.1904 2.25 13.5 2.25L3.5 2.25C2.80964 2.25 2.25 2.80964 2.25 3.5L2.25 6.5ZM3.75 6.25L3.75 3.75L13.25 3.75V6.25L3.75 6.25Z" fill="#07AD3E"></path>',6)]))}const p3e=mr(f3e,[["render",A3e]]),DB="bins",h3e=d.defineComponent({__name:"Bins",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.layersSettings[DB]);function r(s,c,f){const A=c.components.grouping.selectorStates.length>0;return s===null?A?{type:"grouping",value:c.components.grouping.selectorStates[0].selectedSource}:f:s}const a=d.computed(()=>r(n.value.fillColor,t.value.reactive.optionsState,L3));function i(s,c,f){c.type==="dataCategorical"?t.value.reactive.layersSettings[DB][f]={type:c.inputName}:t.value.reactive.layersSettings[DB][f]=s,c.type==="dataCategorical"&&typeof s!="string"&&(t.value.reactive.dataBindAes[c.selectedSource]=s)}const o=d.computed({get:()=>n.value.opacity*100,set:s=>{n.value.opacity=s/100}});return(s,c)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(ei,{label:"Fill color","form-title":"Fill Color Settings","form-back-title":"Layers",type:"fill",selected:a.value,withoutFixed:typeof a.value=="object",onAesUpdate:c[0]||(c[0]=(f,A)=>i(f,A,"fillColor"))},null,8,["selected","withoutFixed"]),d.createVNode(d.unref(rt.Slider),{label:"Opacity",min:0,max:100,step:1,breakpoints:!1,measure:"%",modelValue:o.value,"onUpdate:modelValue":c[1]||(c[1]=f=>o.value=f)},null,8,["modelValue"])],64))}}),v3e={class:"input-item"},m3e={class:"button-group-item"},g3e={class:"button-group-item"},y3e={class:"button-group-item",style:{display:"flex",alignItems:"end"}},w3e=d.defineComponent({__name:"Bubble",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.layersSettings.bubble),r=d.computed(()=>t.value.reactive.optionsState);d.computed(()=>t.value.inputGuide.value);const a=d.computed(()=>{var C;return(C=r.value.components.valueColor.selectorStates[0])==null?void 0:C.selectedSource}),i=d.computed(()=>{var C;return a.value?(C=t.value.reactive.dataBindAes[a.value])==null?void 0:C.palette:void 0}),o=d.ref(!1),s=d.ref(i.value??nv);function c(C){s.value=C,o.value=!1,a.value&&(t.value.reactive.dataBindAes[a.value]=Xm(C))}const f=[{label:"None",value:null},{label:"Columns",value:"column"},{label:"Rows",value:"row"}],A=[{label:"z-score",value:"standardScaling"},{label:"Min-max",value:"meanNormalization"}],p=d.computed({get:()=>n.value.strokeColor??gi,set:C=>{n.value.strokeColor=C}}),v=[{label:"empty",value:null},{label:"Special value",value:"custom"}],y=d.ref(n.value.NAValueAs!==null?"custom":n.value.NAValueAs),b=d.ref(n.value.NAValueAs??0);return(C,x)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(Ay,{label:"Color Palette ",title:d.unref(Gi)[s.value].title,palette:s.value,onButtonClick:x[0]||(x[0]=k=>{o.value=!0})},null,8,["title","palette"]),o.value?(d.openBlock(),d.createBlock(Uh,{key:0,title:"Color Palette","back-title":"Color mapping","onForm:close":x[1]||(x[1]=k=>o.value=!1)},{default:d.withCtx(()=>[d.createVNode(py,{selected:s.value,categorical:!1,onSelect:c},null,8,["selected"])]),_:1})):d.createCommentVNode("",!0),d.createElementVNode("div",v3e,[d.createVNode(ei,{label:"Stroke color","form-title":"Stroke Color Settings","form-back-title":"Layers",type:"stroke","possible-aes-source-inputs":[],selected:p.value,onAesUpdate:x[2]||(x[2]=k=>p.value=k)},null,8,["selected"])]),d.createElementVNode("div",m3e,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Normalize by",options:f,compact:!0,modelValue:n.value.normalizationDirection,"onUpdate:modelValue":x[3]||(x[3]=k=>n.value.normalizationDirection=k)},null,8,["modelValue"])]),d.createElementVNode("div",g3e,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Normalization method",options:A,compact:!0,modelValue:n.value.normalizationMethod,"onUpdate:modelValue":x[4]||(x[4]=k=>n.value.normalizationMethod=k)},null,8,["modelValue"])]),d.createElementVNode("div",y3e,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Treat NA value as:",options:v,compact:!0,modelValue:y.value,"onUpdate:modelValue":[x[5]||(x[5]=k=>y.value=k),x[6]||(x[6]=k=>{k==="custom"?n.value.NAValueAs=b.value:n.value.NAValueAs=k})]},null,8,["modelValue"]),d.createVNode(d.unref(rt.PlNumberField),{style:{height:"33px",marginLeft:"16px",width:"75px"},disabled:y.value!=="custom",label:"NA value",useIncrementButtons:!1,modelValue:b.value,"onUpdate:modelValue":[x[7]||(x[7]=k=>b.value=k),x[8]||(x[8]=k=>{k!==void 0&&(n.value.NAValueAs=k)})]},null,8,["disabled","modelValue"])])],64))}}),C3e={class:"layers-form",id:"layers-form"},b3e={class:"layers-list"},E3e=d.defineComponent({__name:"index",setup(e){const t=Tr(),n={box:xge,binnedDots:Bge,jitteredDots:Tge,violin:Mge,bar:Hge,stackedBar:Rge,line:Nge,errorbar:Lge,sina:$ge,logo:Oge},r={dots:Jge,curve:P$},a={dots:qge,curve:P$},i={heatmap:Gge,heatmapClustered:s3e};return(o,s)=>(d.openBlock(),d.createElementBlock("div",C3e,[s[0]||(s[0]=d.createElementVNode("div",{class:"layers-title"},[d.createElementVNode("h3",null," Layers ")],-1)),d.createElementVNode("div",b3e,[d.unref(t).reactive.chartType==="discrete"?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(d.unref(Z3)[d.unref(t).reactive.template],c=>(d.openBlock(),d.createBlock(Pl,{icon:d.unref(Bf)[c],title:d.unref(I0)[c],settings:{defaultState:d.unref(Z3)[d.unref(t).reactive.template].length>1?"close":"open"}},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(n[c])))]),_:2},1032,["icon","title","settings"]))),256)):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="scatterplot"?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:1},d.renderList(d.unref(Zm)[d.unref(t).reactive.template],c=>(d.openBlock(),d.createBlock(Pl,{icon:d.unref(Bf)[c],title:d.unref(I0)[c],settings:{defaultState:d.unref(Zm)[d.unref(t).reactive.template].length>1?"close":"open"}},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(r[c])))]),_:2},1032,["icon","title","settings"]))),256)):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="scatterplot-umap"?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:2},d.renderList(d.unref(IN)[d.unref(t).reactive.template],c=>(d.openBlock(),d.createBlock(Pl,{icon:d.unref(Bf)[c],title:d.unref(I0)[c],settings:{defaultState:d.unref(Zm)[d.unref(t).reactive.template].length>1?"close":"open"}},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(a[c])))]),_:2},1032,["icon","title","settings"]))),256)):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="heatmap"?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:3},d.renderList(d.unref(Hle)[d.unref(t).reactive.template],c=>(d.openBlock(),d.createBlock(Pl,{icon:d.unref(Bf)[c],title:d.unref(I0)[c],settings:{defaultState:"open"}},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(i[c])))]),_:2},1032,["icon","title"]))),256)):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="heatmap"?(d.openBlock(),d.createBlock(Pl,{key:4,icon:p3e,title:"Annotations",settings:{defaultState:"open"}},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(c3e)))]),_:1})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="dendro"?(d.openBlock(),d.createBlock(Pl,{key:5,icon:d.unref(Bf).dendro,title:d.unref(I0).dendro,settings:{defaultState:"open"}},{default:d.withCtx(()=>[d.createVNode(Wge)]),_:1},8,["icon","title"])):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="histogram"?(d.openBlock(),d.createBlock(Pl,{key:6,icon:d.unref(Bf).bins,title:d.unref(I0).bins,settings:{defaultState:"open"}},{default:d.withCtx(()=>[d.createVNode(h3e)]),_:1},8,["icon","title"])):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="bubble"?(d.openBlock(),d.createBlock(Pl,{key:7,icon:d.unref(Bf).bubble,title:d.unref(I0).bubble,settings:{defaultState:"open"}},{default:d.withCtx(()=>[d.createVNode(w3e)]),_:1},8,["icon","title"])):d.createCommentVNode("",!0)])]))}});function x3e(e,{slots:t}){return d.h("div",Object.assign({},e,{class:"non-found-component"}),t.default&&t.default())}function S3e(e,t){return d.computed(()=>{const n=d.unref(t);return n&&e[n]?e[n]:x3e})}const B3e={},k3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function T3e(e,t){return d.openBlock(),d.createElementBlock("svg",k3e,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14.5 7.5V4.5H19.5V7.5H14.5ZM13 4C13 3.44772 13.4477 3 14 3H20C20.5523 3 21 3.44772 21 4V8C21 8.55228 20.5523 9 20 9H14C13.4477 9 13 8.55228 13 8V4ZM4.5 19.5V16.5H9.5V19.5H4.5ZM3 16C3 15.4477 3.44772 15 4 15H10C10.5523 15 11 15.4477 11 16V20C11 20.5523 10.5523 21 10 21H4C3.44772 21 3 20.5523 3 20V16Z",fill:"#07AD3E"},null,-1),d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4.5 11.5V4.5H9.5V11.5H4.5ZM3 4C3 3.44772 3.44772 3 4 3H10C10.5523 3 11 3.44772 11 4V12C11 12.5523 10.5523 13 10 13H4C3.44772 13 3 12.5523 3 12V4ZM14.5 19.5V12.5H19.5V19.5H14.5ZM13 12C13 11.4477 13.4477 11 14 11H20C20.5523 11 21 11.4477 21 12V20C21 20.5523 20.5523 21 20 21H14C13.4477 21 13 20.5523 13 20V12Z",fill:"#110529"},null,-1)]))}const _3e=mr(B3e,[["render",T3e]]),D3e={},P3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function M3e(e,t){return d.openBlock(),d.createElementBlock("svg",P3e,t[0]||(t[0]=[d.createStaticVNode('<g clip-path="url(#clip0_8849_14901)"><path fill-rule="evenodd" clip-rule="evenodd" d="M11.2214 15.2215L13.5701 12.8728C15.2298 11.2131 15.2298 8.5221 13.5701 6.86237C11.9104 5.20264 9.21943 5.20264 7.5597 6.86237L3.31706 11.105C1.65733 12.7647 1.65733 15.4557 3.31706 17.1154C4.38616 18.1845 5.88312 18.565 7.25674 18.2568L8.45258 19.4526C6.38303 20.2767 3.93151 19.8512 2.2564 18.1761C0.0108876 15.9306 0.0108879 12.2899 2.2564 10.0444L6.49904 5.80171C8.74456 3.5562 12.3853 3.5562 14.6308 5.80171C16.8763 8.04723 16.8763 11.6879 14.6308 13.9334L12.2821 16.2821L11.2214 15.2215Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M17.4594 18.1761C15.2139 20.4216 11.5732 20.4216 9.32769 18.1761C7.08218 15.9306 7.08218 12.2899 9.32769 10.0444L11.686 7.68604L12.7467 8.7467L10.3884 11.105C8.72862 12.7647 8.72862 15.4557 10.3884 17.1154C12.0481 18.7751 14.739 18.7751 16.3988 17.1154L20.6414 12.8728C22.3011 11.2131 22.3011 8.5221 20.6414 6.86237C19.5764 5.79737 18.0868 5.41575 16.7175 5.71752L15.5197 4.51971C17.5863 3.70299 20.0307 4.13032 21.7021 5.80171C23.9476 8.04723 23.9476 11.6879 21.7021 13.9334L17.4594 18.1761Z" fill="#07AD3E"></path></g><defs><clipPath id="clip0_8849_14901"><rect width="24" height="24" fill="white"></rect></clipPath></defs>',2)]))}const H3e=mr(D3e,[["render",M3e]]),I3e={},R3e={width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function N3e(e,t){return d.openBlock(),d.createElementBlock("svg",R3e,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M23.25 17.75V14H24.75V17.75H26V19.25H24.75V23.25H28.75V22H30.25V23.25H34V24.75H30.25V26H28.75V24.75H24.75V28.75H26V30.25H24.75V34H23.25V30.25H22V28.75H23.25V24.75H19.25V26H17.75V24.75H14V23.25H17.75V22H19.25V23.25H23.25V19.25H22V17.75H23.25Z",fill:"#110529"},null,-1),d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.4697 15.5303L17.7501 17.8107V20H19.2501V17.8107L21.5304 15.5303L20.4697 14.4697L18.5001 16.4393L16.5304 14.4697L15.4697 15.5303ZM27.4697 28.5303L29.4394 30.5L27.4697 32.4697L28.5304 33.5303L30.5001 31.5607L32.4697 33.5303L33.5304 32.4697L31.5607 30.5L33.5304 28.5303L32.4697 27.4697L30.5001 29.4393L28.5304 27.4697L27.4697 28.5303Z",fill:"#07AD3E"},null,-1)]))}const L3e=mr(I3e,[["render",N3e]]),$3e={},F3e={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function V3e(e,t){return d.openBlock(),d.createElementBlock("svg",F3e,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M20.5 12C20.5 10.3189 20.0015 8.67547 19.0675 7.27766C18.1335 5.87984 16.806 4.79037 15.2528 4.14703C13.6996 3.50368 11.9906 3.33536 10.3417 3.66333C8.6929 3.9913 7.17834 4.80085 5.9896 5.9896C4.80085 7.17834 3.9913 8.6929 3.66333 10.3417C3.33536 11.9906 3.50368 13.6996 4.14703 15.2528C4.79037 16.806 5.87984 18.1335 7.27766 19.0675C8.18407 19.6731 9.19374 20.0957 10.25 20.3179V12.75H7V11.25H10.25V8C10.25 6.48122 11.4812 5.25 13 5.25C14.5188 5.25 15.75 6.48122 15.75 8V8.5H14.25V8C14.25 7.30964 13.6904 6.75 13 6.75C12.3096 6.75 11.75 7.30964 11.75 8V11.25H15V12.75H11.75V20.4963V21.5V21.9969C9.85961 21.9496 8.01943 21.3672 6.4443 20.3147C4.79981 19.2159 3.51809 17.6541 2.76121 15.8268C2.00433 13.9996 1.8063 11.9889 2.19215 10.0491C2.578 8.10929 3.53041 6.32746 4.92894 4.92894C6.32746 3.53041 8.10929 2.578 10.0491 2.19215C11.9889 1.8063 13.9996 2.00433 15.8268 2.76121C17.6541 3.51809 19.2159 4.79981 20.3147 6.4443C21.4135 8.08879 22 10.0222 22 12H20.5Z",fill:"#110529"},null,-1),d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M19.0607 18L21.5304 15.5303L20.4697 14.4697L18.0001 16.9393L15.5304 14.4697L14.4697 15.5303L16.9394 18L14.4697 20.4697L15.5304 21.5303L18.0001 19.0607L20.4697 21.5303L21.5304 20.4697L19.0607 18Z",fill:"#07AD3E"},null,-1)]))}const O3e=mr($3e,[["render",V3e]]),Q3e={},z3e={class:"layers-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function U3e(e,t){return d.openBlock(),d.createElementBlock("svg",z3e,t[0]||(t[0]=[d.createElementVNode("g",{id:"24: layers"},[d.createElementVNode("path",{id:"Subtract","fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.37549 15.1251L12.0003 21.25L21.6255 15.1249L21.6749 15.1563C22.2924 15.5493 22.2924 16.4507 21.6749 16.8436L12.5375 22.6583C12.21 22.8668 11.7913 22.8668 11.4638 22.6583L2.32641 16.8436C1.70891 16.4507 1.70891 15.5493 2.32641 15.1563L2.37549 15.1251Z",fill:"#07AD3E"}),d.createElementVNode("path",{id:"Union","fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.32641 7.15633C1.70891 7.54929 1.70891 8.4507 2.32641 8.84366L11.4638 14.6583C11.7913 14.8668 12.21 14.8668 12.5375 14.6583L21.6749 8.84365C22.2924 8.4507 22.2924 7.54929 21.6749 7.15633L12.5375 1.34164C12.21 1.13319 11.7913 1.13319 11.4638 1.34164L2.32641 7.15633ZM3.75 7.99997L12 13.25L20.25 7.99997L12 2.74997L3.75 7.99997ZM12.0003 17.25L2.37549 11.1251L2.32641 11.1563C1.70891 11.5493 1.70891 12.4507 2.32641 12.8436L11.4638 18.6583C11.7913 18.8668 12.21 18.8668 12.5375 18.6583L21.6749 12.8436C22.2924 12.4507 22.2924 11.5493 21.6749 11.1563L21.6255 11.1249L12.0003 17.25Z",fill:"#110529"})],-1)]))}const G3e=mr(Q3e,[["render",U3e]]),j3e=d.defineComponent({__name:"SettingsIcon",setup(e){return(t,n)=>(d.openBlock(),d.createBlock(d.unref(rt.PlIcon24),{name:"settings"}))}}),Y3e={},W3e={class:"export-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function X3e(e,t){return d.openBlock(),d.createElementBlock("svg",W3e,t[0]||(t[0]=[d.createElementVNode("g",{id:"Icon"},[d.createElementVNode("path",{id:"Rectangle 4179",d:"M3 17V18C3 19.6569 4.34315 21 6 21H18C19.6569 21 21 19.6569 21 18V17",stroke:"#07AD3E","stroke-width":"1.5"}),d.createElementVNode("path",{id:"Vector 1335",d:"M18 10L12 16M12 16L6 10M12 16L12 2",stroke:"black","stroke-width":"1.5"})],-1)]))}const K3e=mr(Y3e,[["render",X3e]]),Z3e={class:"input-item"},J3e={class:"input-item"},q3e={class:"input-item"},eye={class:"input-item"},tye={class:"input-item",style:{"z-index":"0"}},nye={class:"checkbox-item"},rye={class:"input-item"},aye={class:"input-item"},iye={class:"input-item",style:{"z-index":"0"}},oye={class:"checkbox-item"},lye=d.defineComponent({__name:"DiscreteStatisticsForm",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.statisticsSettings),r=d.computed(()=>t.value.commonHelpersData.primaryGroups.value),a=d.computed(()=>WN(r.value)),i=d.computed(()=>XN(r.value)),o=(y,b)=>d.computed({get(){return y[b]??void 0},set(C){y[b]=C??null}}),s=o(n.value.overall.data,"testMethod"),c=o(n.value.referenceGroup.data,"testMethod"),f=o(n.value.referenceGroup.data,"referenceGroup"),A=o(n.value.referenceGroup.data,"correctionMethod"),p=o(n.value.pairwise.data,"testMethod"),v=o(n.value.pairwise.data,"correctionMethod");return FS(t)(),d.watch([()=>n.value.overall.data.testMethod,()=>n.value.referenceGroup.data.referenceGroup],FS(t)),(y,b)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[b[12]||(b[12]=d.createElementVNode("h3",null," Statistics ",-1)),b[13]||(b[13]=d.createElementVNode("div",{class:"section-title"},[d.createElementVNode("span",null,"overall p-value")],-1)),d.createElementVNode("div",Z3e,[d.createVNode(d.unref(rt.PlDropdown),{label:"Method",clearable:"",placeholder:"Choose",modelValue:d.unref(s),"onUpdate:modelValue":b[0]||(b[0]=C=>d.isRef(s)?s.value=C:null),options:i.value,error:n.value.overall.validity.testMethod?"":" "},null,8,["modelValue","options","error"])]),b[14]||(b[14]=d.createElementVNode("div",{class:"section-title"},[d.createElementVNode("span",null,"reference group")],-1)),d.createElementVNode("div",J3e,[d.createVNode(d.unref(rt.PlDropdown),{label:"Reference from...",clearable:"",placeholder:"Choose",modelValue:d.unref(f),"onUpdate:modelValue":b[1]||(b[1]=C=>d.isRef(f)?f.value=C:null),options:a.value,error:n.value.referenceGroup.validity.referenceGroup?"":" "},null,8,["modelValue","options","error"])]),d.createElementVNode("div",q3e,[d.createVNode(d.unref(rt.PlDropdown),{label:"Method",clearable:"",placeholder:"Choose",modelValue:d.unref(c),"onUpdate:modelValue":b[2]||(b[2]=C=>d.isRef(c)?c.value=C:null),options:d.unref(VC)},null,8,["modelValue","options"])]),d.createElementVNode("div",eye,[d.createVNode(d.unref(rt.PlDropdown),{label:"Correction method",placeholder:"Choose",modelValue:d.unref(A),"onUpdate:modelValue":b[3]||(b[3]=C=>d.isRef(A)?A.value=C:null),options:d.unref(NN)},null,8,["modelValue","options"])]),d.createElementVNode("div",tye,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Show",modelValue:n.value.referenceGroup.data.format,"onUpdate:modelValue":b[4]||(b[4]=C=>n.value.referenceGroup.data.format=C),options:d.unref(LN)},null,8,["modelValue","options"])]),d.createElementVNode("div",nye,[d.createVNode(d.unref(rt.PlCheckbox),{modelValue:n.value.referenceGroup.data.ns,"onUpdate:modelValue":b[5]||(b[5]=C=>n.value.referenceGroup.data.ns=C)},null,8,["modelValue"]),b[10]||(b[10]=d.createElementVNode("span",null,"Non-significant",-1))]),b[15]||(b[15]=d.createElementVNode("div",{class:"section-title"},[d.createElementVNode("span",null,"pairwise p-value")],-1)),d.createElementVNode("div",rye,[d.createVNode(d.unref(rt.PlDropdown),{label:"Method",clearable:"",placeholder:"Choose",modelValue:d.unref(p),"onUpdate:modelValue":b[6]||(b[6]=C=>d.isRef(p)?p.value=C:null),options:d.unref(VC)},null,8,["modelValue","options"])]),d.createElementVNode("div",aye,[d.createVNode(d.unref(rt.PlDropdown),{label:"Correction method",placeholder:"Choose",modelValue:d.unref(v),"onUpdate:modelValue":b[7]||(b[7]=C=>d.isRef(v)?v.value=C:null),options:d.unref(NN)},null,8,["modelValue","options"])]),d.createElementVNode("div",iye,[d.createVNode(d.unref(rt.PlBtnGroup),{label:"Show",modelValue:n.value.pairwise.data.format,"onUpdate:modelValue":b[8]||(b[8]=C=>n.value.pairwise.data.format=C),options:d.unref(LN)},null,8,["modelValue","options"])]),d.createElementVNode("div",oye,[d.createVNode(d.unref(rt.PlCheckbox),{modelValue:n.value.pairwise.data.ns,"onUpdate:modelValue":b[9]||(b[9]=C=>n.value.pairwise.data.ns=C)},null,8,["modelValue"]),b[11]||(b[11]=d.createElementVNode("span",null,"Non-significant",-1))])],64))}}),sye={class:"checkbox-item"},uye=d.defineComponent({__name:"ScatterplotStatisticsForm",setup(e){const t=Tr(),n=d.computed(()=>t.value.reactive.statisticsSettings);return(r,a)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[a[1]||(a[1]=d.createElementVNode("h3",null,"Statistics",-1)),a[2]||(a[2]=d.createElementVNode("div",{class:"section-title"},[d.createElementVNode("span",null,"trends")],-1)),d.createElementVNode("div",sye,[d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:n.value.trend.on,"onUpdate:modelValue":a[0]||(a[0]=i=>n.value.trend.on=i),label:"Build trend",disabled:d.unref(t).reactive.template==="curve"},null,8,["modelValue","disabled"])])],64))}}),cye=d.defineComponent({__name:"index",setup(e){const t=Tr();return(n,r)=>(d.openBlock(),d.createElementBlock("div",{class:"stat-form",onClick:r[0]||(r[0]=a=>a.stopPropagation())},[d.unref(t).reactive.chartType==="discrete"?(d.openBlock(),d.createBlock(lye,{key:0})):d.createCommentVNode("",!0),d.unref(t).reactive.chartType==="scatterplot"?(d.openBlock(),d.createBlock(uye,{key:1})):d.createCommentVNode("",!0)]))}}),fye={},dye={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function Aye(e,t){return d.openBlock(),d.createElementBlock("svg",dye,t[0]||(t[0]=[d.createStaticVNode('<path fill-rule="evenodd" clip-rule="evenodd" d="M7.5 3.75002C7.5 3.05967 8.05964 2.50002 8.75 2.50002L15.25 2.5C15.9404 2.5 16.5 3.05964 16.5 3.75V5.50004L20.5 5.50006V7.00006L19 7.00006H17.5L6.5 7.00004H5L3.5 7V5.5L7.5 5.50006V3.75002ZM9 5.50006L15 5.50004V4L9 4.00002V5.50006Z" fill="#110529"></path><path d="M17.5 7.00006V12.5H19V7.00006H17.5Z" fill="#110529"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M6.5 17.75C6.5 18.9926 7.50736 20 8.75 20H12V21.5H8.75C6.67893 21.5 5 19.8211 5 17.75V8.50006H6.5V17.75Z" fill="#110529"></path><path d="M6.5 7.00004H5V8.50006H6.5V7.00004Z" fill="#110529"></path><path d="M14.75 14.5L18.25 18M21.75 21.5L18.25 18M18.25 18L21.75 14.5M18.25 18L14.75 21.5" stroke="#07AD3E" stroke-width="1.5"></path>',5)]))}const pye=mr(fye,[["render",Aye]]),hye={},vye={class:"settings-list"};function mye(e,t){return d.openBlock(),d.createElementBlock("div",{class:"settings-form",onClick:t[0]||(t[0]=n=>n.stopPropagation())},[t[1]||(t[1]=d.createElementVNode("div",{class:"settings-title"},[d.createElementVNode("h3",null," Settings ")],-1)),d.createElementVNode("div",vye,[d.renderSlot(e.$slots,"default"),d.renderSlot(e.$slots,"settingsSlot")])])}const S6={settings:{icon:j3e,component:mr(hye,[["render",mye]]),title:"Settings"},template:{icon:_3e,component:due,title:"Template"},dataMapping:{icon:H3e,component:Rhe,title:"Data mapping"},axes:{icon:L3e,component:Age,title:"Axes settings"},statistics:{icon:O3e,component:cye,title:"Statistics"},layers:{icon:G3e,component:E3e,title:"Layers"},delete:{icon:pye,component:null,title:"Delete graph"},export:{icon:K3e,component:null,title:"Export"}};function gye(){return Object.keys(S6)}function yye(e){return S6[e].icon??""}function wye(e){return S6[e].title??""}function Cye(e){const t=Object.entries(S6).reduce((n,[r,a])=>rue.setProp(n,r,a.component),{});return S3e(t,e)}const bye={class:"settings-tabs"},Eye={style:{"font-family":"var(--font-family-base)"}},xye=d.defineComponent({__name:"index",props:{chartType:{},graphStatus:{},allowDeleting:{type:Boolean},hasSettingsSlot:{type:Boolean},modelValue:{}},emits:["update:modelValue","export","delete"],setup(e,{emit:t}){const n=t,r=e,a=d.computed(()=>gye().filter(o=>!(o==="settings"&&!r.hasSettingsSlot)&&!(o==="statistics"&&r.chartType!=="discrete"&&r.chartType!=="scatterplot")&&!(o==="delete"&&r.allowDeleting)));function i(o){n("update:modelValue",o===r.modelValue?null:o)}return(o,s)=>(d.openBlock(),d.createElementBlock("div",bye,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.value,c=>(d.openBlock(),d.createBlock(d.unref(rt.PlTooltip),{key:c,"open-delay":100,"close-delay":100,class:d.normalizeClass(["has-inline-icon",{active:o.modelValue===c,"temp-inactive":c==="export"&&(o.graphStatus!=="ready"||o.chartType==="scatterplot-umap"),[c]:!0}]),position:"left",hide:o.modelValue===c,onClick:f=>{f.stopPropagation(),c==="export"?o.$emit("export"):c==="delete"?o.$emit("delete"):i(c)}},{tooltip:d.withCtx(()=>[d.createElementVNode("span",Eye,d.toDisplayString(d.unref(wye)(c)),1)]),default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(d.unref(yye)(c))))]),_:2},1032,["class","hide","onClick"]))),128))]))}}),Sye=d.defineComponent({__name:"TransitionSlidePanel",setup(e){function t(){window.dispatchEvent(new CustomEvent("adjust"))}function n(){window.dispatchEvent(new CustomEvent("adjust"))}return(r,a)=>(d.openBlock(),d.createBlock(d.Transition,{name:"slide-panel",onAfterEnter:t,onAfterLeave:n},{default:d.withCtx(()=>[d.renderSlot(r.$slots,"default")]),_:3}))}}),Bye=d.defineComponent({__name:"PanelModal",emits:["close"],setup(e,{emit:t}){const n=t,r=d.ref();return rt.useClickOutside([r],()=>n("close")),(a,i)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"rootRef",ref:r,class:"panel-modal"},[d.createVNode(d.unref(rt.PlCloseModalBtn),{class:"close-panel-modal",onClick:i[0]||(i[0]=o=>n("close"))}),d.renderSlot(a.$slots,"default",{ref:"contentRef"})],512))}}),kye={},Tye={xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"};function _ye(e,t){return d.openBlock(),d.createElementBlock("svg",Tye,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.75 2.25V7.25H13.75V8.75H8.75V13.75H7.25V8.75H2.25V7.25H7.25V2.25H8.75Z",fill:"#110529"},null,-1)]))}const Dye=mr(kye,[["render",_ye]]),Pye={},Mye={xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"};function Hye(e,t){return d.openBlock(),d.createElementBlock("svg",Mye,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.25 7.25H13.75V8.75H2.25V7.25Z",fill:"#110529"},null,-1)]))}const Iye=mr(Pye,[["render",Hye]]),Rye={class:"zoom-text-field"},Nye=d.defineComponent({__name:"ZoomInput",props:{modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,r=e,a=d.ref(),i=d.ref(!1),o=d.ref(String(r.modelValue)),s=d.computed({get(){const c=o.value??"100";return i.value?c:c+"%"},set(c){return o.value=c,c}});return d.watch(()=>i.value,c=>{if(!c){let f=Number(o.value);isNaN(f)?o.value=String(r.modelValue):n("update:modelValue",f)}}),d.watch(()=>r.modelValue,c=>{o.value=String(c)}),(c,f)=>(d.openBlock(),d.createElementBlock("div",{class:"zoom-text-field__envelope zoom-input",onFocusin:f[1]||(f[1]=A=>i.value=!0),onFocusout:f[2]||(f[2]=A=>i.value=!1),onKeyup:f[3]||(f[3]=d.withKeys(A=>{var p;return(p=a.value)==null?void 0:p.blur()},["enter"]))},[d.createElementVNode("div",Rye,[d.withDirectives(d.createElementVNode("input",{ref_key:"input",ref:a,"onUpdate:modelValue":f[0]||(f[0]=A=>s.value=A),type:"text"},null,512),[[d.vModelText,s.value]]),d.createVNode(xB,{style:{"z-index":"1"},class:"zoom-text-field__contour"})])],32))}}),Lye={class:"zoom-container"},$ye=20,Fye=400,M$=10,Vye=d.defineComponent({__name:"index",setup(e){const t=Tr();function n(i){return Math.max($ye,Math.min(Fye,i))}function r(){t.value.reactive.chartScale=n(t.value.reactive.chartScale-M$)}function a(){t.value.reactive.chartScale=n(t.value.reactive.chartScale+M$)}return(i,o)=>(d.openBlock(),d.createElementBlock("div",Lye,[o[1]||(o[1]=d.createElementVNode("div",{class:"zoom-border"},null,-1)),d.createVNode(d.unref(rt.PlBtnGhost),{onClick:r},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(Iye)))]),_:1}),d.createVNode(Nye,{modelValue:d.unref(t).reactive.chartScale,"onUpdate:modelValue":o[0]||(o[0]=s=>d.unref(t).reactive.chartScale=n(s))},null,8,["modelValue"]),d.createVNode(d.unref(rt.PlBtnGhost),{onClick:a},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(Dye)))]),_:1})]))}}),Oye=d.defineComponent({__name:"DendroTable",props:{chartData:{}},emits:["row-select"],setup(e,{emit:t}){const n=Tr(),r=e,a=d.ref(100),i=d.shallowRef(),o=d.computed(()=>["id",...n.value.reactive.optionsState.components.tableContent.selectorStates.map(y=>y.selectedSource)]),s=d.ref([]);d.watch(()=>{var y;return(y=r.chartData)==null?void 0:y.hierarchy},y=>{if(y){const b=y.leaves().map(C=>C.data.rawData.id);(b.length!==s.value.length||b.some((C,x)=>C!==s.value[x]))&&(s.value=b)}else s.value=[]},{immediate:!0});const c=d.ref([]),f=d.ref([]);d.watch([()=>s.value,()=>o.value,()=>n.value.commonHelpersData.dendroTableData.value],([y,b,C])=>{if(C===null){f.value=[],c.value=[];return}if(b.some(k=>!C[k]))return;const x=C.id.data.reduce((k,_,P)=>{const N=_;return k[N]&&console.warn(`More than 1 value for node id ${N} in dendro table`),k[N]=b.reduce((I,F)=>{const Q=C[F];return Q&&(I[F]=Q.data[P]),I},{}),k},{});f.value=b.map(k=>({headerName:C[k].label,field:k,sortable:!1,resizable:!1})),c.value=y.map(k=>x[k]??null),v()},{immediate:!0});const A=d.computed(()=>{var b,C;const y=(C=(b=r.chartData)==null?void 0:b.chartSizes)==null?void 0:C.treeHeight;return s.value.length?y/s.value.length:0}),p=y=>{i.value=y.api,v()};function v(){if(i.value&&!i.value.isDestroyed()){i.value.autoSizeAllColumns();const y=i.value.getColumns();y&&(a.value=y.reduce((b,C)=>b+C.getActualWidth(),2))}}return d.watch(()=>n.value.reactive.dendroSelectedNodeId,y=>{i.value&&(y===null?i.value.deselectAll():i.value.forEachNode(b=>{b.data.id===y&&b.setSelected(!0,!0)}))}),(y,b)=>(d.openBlock(),d.createElementBlock("div",{class:"dendro-table",style:d.normalizeStyle({width:a.value+"px"})},[d.createVNode(d.unref(cte.AgGridVue),{theme:d.unref(rt.AgGridTheme),gridApi:i.value,onGridReady:p,defaultColDef:{suppressHeaderMenuButton:!0},rowData:c.value,columnDefs:f.value,rowHeight:A.value,autoSizeStrategy:{type:"fitCellContents"},onGridColumnsChanged:b[0]||(b[0]=()=>{v()}),domLayout:"autoHeight"},null,8,["theme","gridApi","rowData","columnDefs","rowHeight"])],4))}}),Qye={},zye={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"};function Uye(e,t){return d.openBlock(),d.createElementBlock("svg",zye,t[0]||(t[0]=[d.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M19.091 3.53035C18.2123 2.65166 16.7877 2.65167 15.909 3.53037L3.90901 15.5304C3.48705 15.9524 3.25 16.5246 3.25 17.1214V20.0001C3.25 20.4143 3.58579 20.7501 4 20.7501H6.87868C7.47542 20.7501 8.04771 20.513 8.46967 20.0911L20.4697 8.09099C21.3484 7.21231 21.3484 5.7877 20.4697 4.90903L19.091 3.53035ZM16.9697 4.59101C17.2626 4.29811 17.7374 4.29811 18.0303 4.59101L19.409 5.96969C19.7019 6.26258 19.7019 6.73745 19.409 7.03034L18.5 7.9394L16.0607 5.50006L16.9697 4.59101ZM15 6.56073L17.4393 9.00007L7.40901 19.0304C7.26836 19.171 7.07759 19.2501 6.87868 19.2501H4.75V17.1214C4.75 16.9225 4.82902 16.7317 4.96967 16.5911L15 6.56073Z",fill:"#CFD1DB"},null,-1),d.createElementVNode("path",{d:"M12 20.7501L20 20.7501L20 19.2501L12 19.2501L12 20.7501Z",fill:"#CFD1DB"},null,-1)]))}const Gye=mr(Qye,[["render",Uye]]),H$=d.defineComponent({__name:"Loading",props:{top:{default:0},left:{default:0},right:{default:0},bottom:{default:0}},setup(e){return(t,n)=>(d.openBlock(),d.createElementBlock("div",{class:"graph-maker__loading",style:d.normalizeStyle({top:`${t.top}px`,bottom:`${t.bottom}px`,right:`${t.right}px`,left:`${t.left}px`})},n[0]||(n[0]=[d.createStaticVNode('<div class="loading-picture"><svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 80 80" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M36.0197 2.29384C37.0053 1.76506 37.7157 1.45481 38.4537 1.29931C39.4734 1.08447 40.5266 1.08447 41.5463 1.29931C42.2843 1.45481 42.9947 1.76506 43.9803 2.29384C44.7026 2.66301 45.5542 3.14998 46.6565 3.78023L68.4201 16.2247C69.3757 16.7711 70.1409 17.2086 70.7708 17.5978C71.8362 18.2367 72.5158 18.7183 73.0579 19.3166C73.7667 20.0989 74.3023 21.0219 74.6298 22.0253C75 23.1595 75 24.4276 75 26.9639V53.0362C75 55.5725 75 56.8407 74.6298 57.9748C74.3023 58.9782 73.7667 59.9012 73.0579 60.6835C72.5154 61.2822 71.8353 61.764 70.7688 62.4035C70.1393 62.7924 69.3748 63.2295 68.4203 63.7753L46.6565 76.2198C45.555 76.8497 44.7037 77.3364 43.9817 77.7055C42.9954 78.2347 42.2847 78.5452 41.5463 78.7008C40.5266 78.9156 39.4734 78.9156 38.4537 78.7008C37.7153 78.5452 37.0045 78.2347 36.0182 77.7054C35.2962 77.3364 34.445 76.8497 33.3436 76.2199L11.5799 63.7754C10.6253 63.2295 9.86069 62.7924 9.23115 62.4035C8.16466 61.764 7.48457 61.2822 6.94208 60.6835C6.23334 59.9012 5.6977 58.9782 5.37018 57.9748C5 56.8407 5 55.5725 5 53.0362V26.9639C5 24.4276 5 23.1595 5.37018 22.0253C5.6977 21.0219 6.23334 20.0989 6.94208 19.3166C7.48422 18.7183 8.16379 18.2367 9.22911 17.5978C9.85904 17.2086 10.6242 16.7711 11.5799 16.2247L33.3435 3.78023C34.4457 3.14998 35.2974 2.663 36.0197 2.29384ZM10 34.9971V24.9907H37.4546V34.9971H10ZM10 45.0036V40.0003H37.4546V45.0036H10ZM37.4546 72.9139L10 57.1541V50.0069H37.4546V72.9139ZM65.0189 60.0134L42.5455 72.9138V60.0134H65.0189ZM70 24.9907V55.0101H42.5455V24.9907H70ZM14.98 19.9874L40 5.62505L65.0201 19.9874H14.98Z" fill="#E1E3EB"></path></svg><div class="loading-progress-bar"><div class="moving-dash"></div></div></div>',1)]),4))}}),jye={class:"graph-info-tooltip-title"},Yye=["title"],Wye={key:1,class:"graph-info-tooltip-sequence-row"},Xye=["title"],Kye={key:0,class:"graph-info-tooltip-icon"},Zye={key:0,"data-theme":"dark",class:"graph-info-tooltip-button"},Jye=48,qye=62.5,e2e=26,t2e=16,I$=24,n2e=20,r2e=d.defineComponent({__name:"DendroTooltip",props:{info:{},tooltipBtn:{},containerRef:{}},emits:["close","tooltip-btn-click"],setup(e,{emit:t}){const n=e,r=Tr(),a=t,i=d.ref();rt.useClickOutside([i],()=>a("close"));const o=d.computed(()=>{const b=k=>r.value.reactive.optionsState.components[k].selectorStates.map(_=>_.selectedSource),C=["tableContent","labels","nodeColor","nodeSize","nodeShape","lineColor"],x=["id"];return C.forEach(k=>{b(k).forEach(P=>{x.includes(P)||x.push(P)})}),x}),s=d.computed(()=>n.info.info[0]),c=d.computed(()=>{var b;return(b=s.value)==null?void 0:b.id}),f=d.computed(()=>{const b=r.value.commonHelpersData.dendroTableData.value;if(!b)return[];const C=b.id.data.findIndex(x=>String(x)===String(c.value));return C!==-1?o.value.map(x=>{var k,_;return{label:b[x].label,value:b[x].data[C],isSequence:((_=(k=b[x].spec)==null?void 0:k.annotations)==null?void 0:_["pl7.app/type"])==="sequence"}}):[]}),A=d.computed(()=>f.value.reduce((b,C)=>b+(C.isSequence?qye:e2e),0)+t2e*2+(n.tooltipBtn?Jye:0)),p=d.computed(()=>({left:n.info.x+n2e+"px",top:n.info.y+I$+"px"})),v=d.computed(()=>{const b=n.containerRef.scrollHeight,C=A.value/2,x=n.info.y+I$;return x<C?-x:b-C<x?-(A.value-(b-x)):-C});function y(b){var C;(C=window==null?void 0:window.navigator)==null||C.clipboard.writeText(b)}return(b,C)=>(d.openBlock(),d.createElementBlock("div",{class:"graph-info-tooltip__container",ref:"",style:d.normalizeStyle(p.value)},[C[3]||(C[3]=d.createElementVNode("div",{class:"graph-info-tooltip__tail"},null,-1)),d.createElementVNode("div",{class:"graph-info-tooltip",ref_key:"rootRef",ref:i,style:d.normalizeStyle({transform:`translate(0,${v.value}px)`}),onClick:C[2]||(C[2]=x=>x.stopPropagation())},[d.createVNode(d.unref(rt.PlMaskIcon24),{class:"graph-info-tooltip-close",name:"close",onClick:C[0]||(C[0]=x=>a("close"))}),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(f.value,x=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["graph-info-tooltip-row",{"graph-info-tooltip-row__sequence":x.isSequence}])},[d.createElementVNode("div",jye,d.toDisplayString(x.label+":"),1),x.isSequence?(d.openBlock(),d.createElementBlock("div",Wye,[d.createElementVNode("div",{class:"graph-info-tooltip-value",title:String(x.value)},d.toDisplayString(x.value),9,Xye),x.isSequence?(d.openBlock(),d.createElementBlock("div",Kye,[d.createVNode(d.unref(rt.PlMaskIcon16),{class:"graph-info-tooltip-clipboard",name:"clipboard",onClick:()=>y(String(x.value))},null,8,["onClick"])])):d.createCommentVNode("",!0)])):(d.openBlock(),d.createElementBlock("div",{key:0,class:"graph-info-tooltip-value",title:String(x.value)},d.toDisplayString(x.value),9,Yye))],2))),256)),b.tooltipBtn?(d.openBlock(),d.createElementBlock("div",Zye,[d.createVNode(d.unref(rt.PlBtnSecondary),{icon:"arrow-right",size:"small",onClick:C[1]||(C[1]=()=>a("tooltip-btn-click",c.value))},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(b.tooltipBtn),1)]),_:1})])):d.createCommentVNode("",!0)],4)],4))}}),a2e={class:"chart_container"},i2e={class:"chart_header"},o2e=["value"],l2e={class:"chart_titleLineSlot"},s2e={key:0,class:"chart_tabBy"},u2e={key:2,style:{position:"absolute",left:"10px",bottom:"10px"}},c2e=d.defineComponent({__name:"Chart",props:{graphStatus:{},graphTitle:{},dendroTooltipButton:{},chartData:{}},emits:["graph-title-update","dendro-node-select","dendro-tooltip-btn-click"],setup(e,{emit:t}){const n=t,r=Tr(),a=e,i=d.ref(a.graphTitle);d.watch(()=>a.graphTitle,x=>{i.value=x});const o=d.computed(()=>{var x;return(x=r.value.reactive.optionsState.components.tabBy)==null?void 0:x.selectorStates[0]}),s=d.computed(()=>{var x;return(x=o.value)==null?void 0:x.selectedSource}),c=d.computed(()=>{var x;return(x=o.value)==null?void 0:x.selectedFilterValue}),f=d.ref(c.value);d.watch(()=>s.value,(x,k)=>{x!==k&&(f.value=c.value)},{immediate:!0});const A=d.computed(()=>r.value.uniqueValuesData.value),p=d.computed(()=>{var x;if(s.value){const k=(x=A.value[s.value])==null?void 0:x.options;return k&&k.sort((_,P)=>_.label>P.label?1:-1),k}else return});d.watch(()=>p.value,x=>{if(x&&x.length&&f.value===void 0){const k=x[0].value;f.value=k,v(k)}},{immediate:!0});function v(x){const k=r.value.reactive.optionsState.components.tabBy.selectorStates;k.length&&(r.value.reactive.optionsState.components.tabBy.selectorStates=[{...k[0],type:"equals",selectedFilterValue:x}])}function y(x){const k=x.currentTarget;i.value=k.value,n("graph-title-update",k.value)}function b(x){n("dendro-node-select",x)}const C=d.ref();return(x,k)=>(d.openBlock(),d.createElementBlock("div",a2e,[d.createElementVNode("div",i2e,[d.createElementVNode("input",{class:"chart_title",value:i.value,onChange:y,onKeyup:k[0]||(k[0]=d.withKeys(_=>{var P;(P=_.target)==null||P.blur()},["enter"]))},null,40,o2e),(d.openBlock(),d.createBlock(d.resolveDynamicComponent(Gye),{class:"chart_titleEdit"})),d.createElementVNode("div",l2e,[d.renderSlot(x.$slots,"default")])]),d.createVNode(d.unref(rt.PlNotificationAlert),{type:"success",modelValue:d.unref(r).reactive.showTooltipHint,"onUpdate:modelValue":k[1]||(k[1]=_=>d.unref(r).reactive.showTooltipHint=_),class:"chart_tooltipHint",width:"170px"},{default:d.withCtx(()=>k[7]||(k[7]=[d.createTextVNode(" Hit enter to pin tooltip ")])),_:1},8,["modelValue"]),s.value?(d.openBlock(),d.createElementBlock("div",s2e,[d.createVNode(d.unref(rt.PlDropdown),{label:"Show for",modelValue:f.value,"onUpdate:modelValue":[k[2]||(k[2]=_=>f.value=_),k[3]||(k[3]=_=>v(_))],options:p.value},null,8,["modelValue","options"])])):d.createCommentVNode("",!0),d.createElementVNode("div",{class:d.normalizeClass(["chart_main-content",{"chart_main-content__dendro":d.unref(r).reactive.chartType==="dendro"}]),ref_key:"chartContainerRef",ref:C},[d.createElementVNode("div",{id:"chartSvgContainer",class:d.normalizeClass({chart_loading:d.unref(r).loading.initialCharts&&x.graphStatus==="ready",chart_noDataMapping:x.graphStatus==="notReady",chart_emptyData:x.graphStatus==="empty",chart_inconsistent:x.graphStatus==="inconsistent"})},[d.unref(r).loading.initialCharts&&x.graphStatus==="ready"?(d.openBlock(),d.createBlock(H$,{key:0})):d.createCommentVNode("",!0)],2),d.unref(r).reactive.chartType==="dendro"&&x.chartData&&d.unref(r).reactive.layersSettings.dendro.showTable?(d.openBlock(),d.createBlock(Oye,{key:0,chartData:x.chartData,onRowSelect:b},null,8,["chartData"])):d.createCommentVNode("",!0),d.unref(r).reactive.dendroInfoByClick?(d.openBlock(),d.createBlock(r2e,{key:1,info:d.unref(r).reactive.dendroInfoByClick,containerRef:C.value,tooltipBtn:x.dendroTooltipButton,onTooltipBtnClick:k[4]||(k[4]=_=>x.$emit("dendro-tooltip-btn-click",_)),onClose:k[5]||(k[5]=_=>{d.unref(r).reactive.dendroInfoByClick=null,x.$emit("dendro-node-select",null)})},null,8,["info","containerRef","tooltipBtn"])):d.createCommentVNode("",!0)],2),x.graphStatus!=="empty"&&d.unref(r).reactive.chartType!=="scatterplot-umap"?(d.openBlock(),d.createBlock(Vye,{key:1})):d.createCommentVNode("",!0),x.graphStatus!=="empty"&&d.unref(r).reactive.chartType==="scatterplot-umap"?(d.openBlock(),d.createElementBlock("div",u2e,[d.createVNode(d.unref(rt.PlToggleSwitch),{modelValue:d.unref(r).reactive.lassoMode,"onUpdate:modelValue":k[6]||(k[6]=_=>d.unref(r).reactive.lassoMode=_),label:"Lasso mode"},null,8,["modelValue"])])):d.createCommentVNode("",!0)]))}});function f2e(e,t){return e.parent===t.parent?1:2}function d2e(e){return e.reduce(A2e,0)/e.length}function A2e(e,t){return e+t.x}function p2e(e){return 1+e.reduce(h2e,0)}function h2e(e,t){return Math.max(e,t.y)}function v2e(e){for(var t;t=e.children;)e=t[0];return e}function m2e(e){for(var t;t=e.children;)e=t[t.length-1];return e}function PB(){var e=f2e,t=1,n=1,r=!1;function a(i){var o,s=0;i.eachAfter(function(v){var y=v.children;y?(v.x=d2e(y),v.y=p2e(y)):(v.x=o?s+=e(v,o):0,v.y=0,o=v)});var c=v2e(i),f=m2e(i),A=c.x-e(c,f)/2,p=f.x+e(f,c)/2;return i.eachAfter(r?function(v){v.x=(v.x-i.x)*t,v.y=(i.y-v.y)*n}:function(v){v.x=(v.x-A)/(p-A)*t,v.y=(1-(i.y?v.y/i.y:1))*n})}return a.separation=function(i){return arguments.length?(e=i,a):e},a.size=function(i){return arguments.length?(r=!1,t=+i[0],n=+i[1],a):r?null:[t,n]},a.nodeSize=function(i){return arguments.length?(r=!0,t=+i[0],n=+i[1],a):r?[t,n]:null},a}function g2e(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function y2e(){return this.eachAfter(g2e)}function w2e(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function C2e(e,t){for(var n=this,r=[n],a,i,o=-1;n=r.pop();)if(e.call(t,n,++o,this),a=n.children)for(i=a.length-1;i>=0;--i)r.push(a[i]);return this}function b2e(e,t){for(var n=this,r=[n],a=[],i,o,s,c=-1;n=r.pop();)if(a.push(n),i=n.children)for(o=0,s=i.length;o<s;++o)r.push(i[o]);for(;n=a.pop();)e.call(t,n,++c,this);return this}function E2e(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function x2e(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,a=r&&r.length;--a>=0;)n+=r[a].value;t.value=n})}function S2e(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function B2e(e){for(var t=this,n=k2e(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var a=r.length;e!==n;)r.splice(a,0,e),e=e.parent;return r}function k2e(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),a=null;for(e=n.pop(),t=r.pop();e===t;)a=e,e=n.pop(),t=r.pop();return a}function T2e(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function _2e(){return Array.from(this)}function D2e(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function P2e(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*M2e(){var e=this,t,n=[e],r,a,i;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(a=0,i=r.length;a<i;++a)n.push(r[a]);while(n.length)}function B6(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=R2e)):t===void 0&&(t=I2e);for(var n=new X5(e),r,a=[n],i,o,s,c;r=a.pop();)if((o=t(r.data))&&(c=(o=Array.from(o)).length))for(r.children=o,s=c-1;s>=0;--s)a.push(i=o[s]=new X5(o[s])),i.parent=r,i.depth=r.depth+1;return n.eachBefore(R$)}function H2e(){return B6(this).eachBefore(N2e)}function I2e(e){return e.children}function R2e(e){return Array.isArray(e)?e[1]:null}function N2e(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function R$(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function X5(e){this.data=e,this.depth=this.height=0,this.parent=null}X5.prototype=B6.prototype={constructor:X5,count:y2e,each:w2e,eachAfter:b2e,eachBefore:C2e,find:E2e,sum:x2e,sort:S2e,path:B2e,ancestors:T2e,descendants:_2e,leaves:D2e,links:P2e,copy:H2e,[Symbol.iterator]:M2e};function MB(e){return e==null?null:L2e(e)}function L2e(e){if(typeof e!="function")throw new Error;return e}var $2e={depth:-1},N$={},HB={};function F2e(e){return e.id}function V2e(e){return e.parentId}function L$(){var e=F2e,t=V2e,n;function r(a){var i=Array.from(a),o=e,s=t,c,f,A,p,v,y,b,C,x=new Map;if(n!=null){const k=i.map((N,I)=>O2e(n(N,I,a))),_=k.map($$),P=new Set(k).add("");for(const N of _)P.has(N)||(P.add(N),k.push(N),_.push($$(N)),i.push(HB));o=(N,I)=>k[I],s=(N,I)=>_[I]}for(A=0,c=i.length;A<c;++A)f=i[A],y=i[A]=new X5(f),(b=o(f,A,a))!=null&&(b+="")&&(C=y.id=b,x.set(C,x.has(C)?N$:y)),(b=s(f,A,a))!=null&&(b+="")&&(y.parent=b);for(A=0;A<c;++A)if(y=i[A],b=y.parent){if(v=x.get(b),!v)throw new Error("missing: "+b);if(v===N$)throw new Error("ambiguous: "+b);v.children?v.children.push(y):v.children=[y],y.parent=v}else{if(p)throw new Error("multiple roots");p=y}if(!p)throw new Error("no root");if(n!=null){for(;p.data===HB&&p.children.length===1;)p=p.children[0],--c;for(let k=i.length-1;k>=0&&(y=i[k],y.data===HB);--k)y.data=null}if(p.parent=$2e,p.eachBefore(function(k){k.depth=k.parent.depth+1,--c}).eachBefore(R$),p.parent=null,c>0)throw new Error("cycle");return p}return r.id=function(a){return arguments.length?(e=MB(a),r):e},r.parentId=function(a){return arguments.length?(t=MB(a),r):t},r.path=function(a){return arguments.length?(n=MB(a),r):n},r}function O2e(e){e=`${e}`;let t=e.length;return IB(e,t-1)&&!IB(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function $$(e){let t=e.length;if(t<2)return"";for(;--t>1&&!IB(e,t););return e.slice(0,t)}function IB(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}var sg={},RB={exports:{}},Ia={};/**
37
37
  * @license React
38
38
  * react.production.min.js
39
39
  *
@@ -15124,7 +15124,7 @@ void main() {
15124
15124
  `)),_(!0)}let Z=ie.jsxs("g",{className:aK,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:X2t(v,c),d:j2t(A,p,v,y,b),fill:$t}),ie.jsxs("g",{fontSize:"14px",fontFamily:"Manrope",fill:"white",transform:W2t(v,A,p,c,y,b),children:[e.map((ee,le)=>ie.jsx("text",{x:Zb,y:Kb+SD*le+SD/2,dominantBaseline:"central",children:ee},le)),a&&ie.jsxs("g",{transform:C,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?nK:rK}),ie.jsx("rect",{x:"-8",y:"-8",width:"24",height:"24",fill:"transparent",onClick:s,onMouseOver:()=>N(!0),onMouseLeave:()=>N(!1),style:{cursor:"pointer"}})]}),a&&ie.jsxs("g",{transform:x,children:[k?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:I?nK:rK})}),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:Q,onMouseOver:()=>F(!0),onMouseLeave:()=>F(!1),style:{cursor:"pointer"}})]})]})]});return i===null?Z:uu.createPortal(Z,i)}function J2t(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 q2t(e,t){return[`X: ${t[e.x]}`,`Node: ${e.y}`,`Value: ${J2t(e.value)}`]}function e7t({heatmapData:e,scales:t,step:n,colorScale:r,tooltipsContainer:a,chartSizes:i,selectedNode:o,labels:s}){let{xKeys:c,yKeys:f,cells:A,meta:p}=e,[v,y]=tn.useState(null),b={left:i.treeWidth+30+Qu.LEFT,right:i.heatmapWidth+Qu.RIGHT,top:Qu.TOP,bottom:i.heatmapHeight+Qu.BOTTOM};return ie.jsxs("g",{onMouseLeave:()=>y(null),children:[s.length&&ie.jsx("g",{transform:"translate(0,-8)",children:c.map((C,x)=>ie.jsxs("text",{x:t.x(C)+2,fontWeight:"500",children:[ie.jsx("title",{children:p.xLabels[C]}),s[x]]},C))}),c.map(C=>f.map(x=>{var _;let k=(_=A==null?void 0:A[C])==null?void 0:_[x];return ie.jsx("rect",{x:t.x(C),y:t.y(x),width:n.x,height:n.y,stroke:"white",strokeWidth:"1px",fill:k?r(k==null?void 0:k.value):Dyt,onMouseOver:()=>{(k==null?void 0:k.value)!==null&&typeof(k==null?void 0:k.value)<"u"?y(k):y(null)},opacity:o&&o.data.rawData[0].id!==(k==null?void 0:k.data.id)?yD:1},k?k.id:`${C}_${x}`)})),s.length&&ie.jsx("line",{x1:"0",x2:i.heatmapWidth,y1:"0",y2:"0",stroke:$t,strokeWidth:"1px"}),v&&a&&ie.jsx(cu,{content:q2t(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:b,container:a})]})}function t7t(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"?s7e(i?i7e:a7e).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 iK({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:t7t(o,t,n),stroke:i?Pyt:a.lineColor(f),strokeWidth:i?2:1,fill:"none"},`${o.source.id},${o.target.id}`)})})}function y4(e){return Zr().domain([0,1]).range([e,$t])(.25)}var Jb=1.4;function jc(e,t=6,n=$t,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*Jb;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*Jb;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
15125
15125
  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*Jb;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??y4(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??y4(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??y4(n)});case"23":{let a=t*Jb;return ie.jsx("path",{d:`M0,-${a}L ${a},0 L 0,${a} L -${a},0z`,fill:n,stroke:r??y4(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??y4(n)});default:uA(e,`Unknown point shape ${e}`)}}var n7t=12;function oK({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(p=>{let v=p.data.rawData[0],y=a.nodeSize(v),b=a.nodeColor(v),C=c?p.x:p.y,x=c?p.y:p.x;return ie.jsx("g",{transform:`translate(${C},${x})`,style:{cursor:"pointer"},onClick:k=>{k.stopPropagation(),o({x:C+Qu.LEFT,y:x+Qu.TOP,info:p.data.rawData}),s(p)},children:ie.jsx("g",{children:ie.jsx("circle",{cx:0,cy:0,r:y+n7t,fill:i===p.id?UX:f===p.id?b:"transparent",opacity:yD,onMouseOver:()=>A(p.id??null),onMouseLeave:()=>A(null)})})},p.id)})}),ie.jsx("g",{children:e.map(p=>{let v=p.data.rawData[0],y=a.nodeShape(v),b=a.nodeSize(v),C=a.nodeColor(v),x=c?p.x:p.y,k=c?p.y:p.x;return ie.jsx("g",{transform:`translate(${x},${k})`,style:{cursor:"pointer"},onClick:_=>{_.stopPropagation(),o({x:x+Qu.LEFT,y:k+Qu.TOP,info:p.data.rawData}),s(p)},children:ie.jsx("g",{onMouseOver:()=>A(p.id??null),onMouseLeave:()=>A(null),children:jc(y,b,i===p.id?UX:C)})},p.id)})}),ie.jsx("g",{children:e.map(p=>{let v=p.data.rawData[0],y=a.nodeSize(v),b=c?p.x:p.y,C=c?p.y:p.x;return ie.jsx("g",{transform:`translate(${b},${C})`,style:{pointerEvents:"none"},children:(r&&p.children||n&&!p.children)&&ie.jsx("text",{x:y+4,y:"4",paintOrder:"stroke",stroke:"white",strokeWidth:"3",children:p.data.label})},p.id)})})]})}var lK=14,qb=12,w4=12,eE=-12;function r7t({aes:e,label:t}){let n=jc(e.shape,e.size,e.color);return ie.jsxs("g",{children:[ie.jsx("g",{transform:`translate(${w4/2},${w4/2})`,children:n}),ie.jsx("text",{x:w4+8,y:w4/2,dominantBaseline:"central",fontWeight:500,children:t})]})}function a7t({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:eE,children:n.title}),ie.jsx("rect",{x:"0",y:"0",width:lK,height:n.height,stroke:$t,fill:`url(#${n.id})`}),ie.jsx("g",{transform:`translate(${lK},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:$t}),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:eE,children:n.title}),n.values.map((r,a)=>ie.jsxs("g",{transform:`translate(0, ${a*(qb+4)})`,children:[ie.jsx("rect",{x:"0",y:"0",width:qb,height:qb,fill:n.scale(r),rx:"1",ry:"1"}),ie.jsx("text",{x:qb+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:eE,children:n.title}),n.values.map((r,a)=>ie.jsx("g",{transform:`translate(0, ${a*(w4+4)})`,children:ie.jsx(r7t,{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:eE,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:$t}),ie.jsx("text",{x:r+4,y:r/2,alignmentBaseline:"central",children:n.labels[a]})]},a)}),!1]},n.id)}})]})}function sK(e){if(!e)return null;let t=new Set,n=e;for(;n;)t.add(n.id),n=n.parent;return t}function i7t({chartSettings:e,chartSizes:t,nodes:n,links:r,connectionType:a,rootPosition:i,edgeInheritance:o,showNodes:s,showEdges:c,showLeavesLabels:f,showNodesLabels:A,aesGetters:p,labels:v,heatmapData:y,heatmapScales:b,heatmapStep:C,heatmapColor:x,heatmapLabels:k,legendData:_,onClick:P}){let N=tn.useRef(null),[I,F]=tn.useState(null),Q=tn.useRef(null);tn.useEffect(()=>{Q.current&&F(Q.current);function X(){ee(null),z(null)}function te(he){Object.entries(he.detail).forEach(([ae,ge])=>{if(ae==="selectedNode"){let me=n.find(fe=>fe.data.rawData[0].id===ge)??null;ee(sK(me)),z(me)}})}return document.addEventListener("click",X),document.addEventListener(wD,te),()=>{document.removeEventListener("click",X),document.removeEventListener(wD,te)}},[]);let[Z,ee]=k6.useState(null),[le,z]=k6.useState(null),U=Z!==null,G={connectionType:a,rootPosition:i,edgeInheritance:o,aesGetters:p},Y={rootPosition:i,showLeavesLabels:f,showNodesLabels:A,aesGetters:p,labels:v,onClick:P,selectedNodeId:le==null?void 0:le.id,onSelectedUpdate:X=>{ee(sK(X)),z(X)}};return ie.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${t.totalWidth} ${t.totalHeight}`,ref:N,width:t.totalWidth,height:t.totalHeight,children:[ie.jsx("defs",{children:$g}),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:U?yD:1,children:[c&&ie.jsx(iK,{links:r.filter(X=>{let{source:te,target:he}=X;return!Z||!(Z.has(te.id??"")&&Z.has(he.id??""))}),selected:!1,...G}),s&&ie.jsx(oK,{nodes:n.filter(X=>!X.data.isFake&&!(Z!=null&&Z.has(X.id??""))),...Y})]}),U&&ie.jsxs("g",{children:[c&&ie.jsx(iK,{links:r.filter(X=>{let{source:te,target:he}=X;return Z.has(te.id??"")&&Z.has(he.id??"")}),selected:!0,...G}),s&&ie.jsx(oK,{nodes:n.filter(X=>!X.data.isFake&&(Z==null?void 0:Z.has(X.id??""))),...Y})]}),y!==null&&ie.jsx("g",{transform:`translate(${t.treeWidth+30},0)`,children:ie.jsx(e7t,{heatmapData:y,scales:b,step:C,colorScale:x,chartSizes:t,labels:k,selectedNode:le,tooltipsContainer:I})}),e.legend.show&&ie.jsx("g",{transform:`translate(${t.treeWidth+30+t.heatmapWidth+30},0)`,children:ie.jsx(a7t,{legendData:_})})]}),ie.jsx("g",{ref:Q})]})}function zv({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 C4(e){if(jX(e))return t=>e.valuesMap[String(t[e.columnName.value])];if(rh(e)){let{domain:t,range:n}=e,r=iv().domain(t).range(n);return a=>{let i=r(Number(a[e.columnName.value]));return Math.max(1,i)}}return t=>e}function o7t(e){return{nodeShape:C4(e.nodeShape),nodeColor:C4(e.nodeColor),nodeSize:C4(e.nodeSize),lineShape:C4(e.lineShape),lineColor:C4(e.lineColor)}}var l7t=(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 s7t(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 u7t=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:zo().domain(["null"]).range([1]),y:zo().domain(["null"]).range([1])});Be(this,"heatmapStep",{x:0,y:0});Be(this,"heatmapColorScale",{scale:zo([]),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=Gh(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(x=>r[x].length),f=c.reduce((x,k)=>x+k,0),A=this.chartSizes.treeHeight/o.length,p=Math.min(Math.max((400-(c.filter(x=>x>0).length-1)*s)/f,n.minCellWidth),n.maxCellWidth),v=[],y=0;a.forEach(x=>{let k=r[x];k.forEach(()=>{v.push(y),y+=p}),k.length>0&&(y+=s)}),this.heatmapScales.x=zo().domain(i).range(v),this.heatmapScales.y=zo().domain(o).range(o.map((x,k)=>k*A)),this.heatmapStep.x=p,this.heatmapStep.y=A;let{colorsList:b,colorsMap:C}=t.aes;if(t.valueType==="continuous"&&b){let x=Zr().domain(l7t(b.length,e.meta.valueExtent)).range(b);this.heatmapColorScale={scale:x,getter:k=>x(k)}}if(t.valueType==="discrete"&&C){let x=Object.keys(C).filter(k=>e.meta.uniqueValues.has(k));this.heatmapColorScale={scale:zo(x,x.map(k=>C[k])).unknown(h4),getter:k=>k?C[k]??h4:h4}}if(t.valueType==="stringSource"&&b){let x=[...e.meta.uniqueValues],k=zo(x,x.map((_,P)=>b[P%b.length])).unknown(h4);this.heatmapColorScale={scale:k,getter:_=>_?k(_):h4}}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 Ac("600 14px Arial"),s=16,c=48,f=20,A=24;function p(N,I){return Math.max(...N.map(F=>o.getTextWidth(String(F))+f),o.getTextWidth(I))}let v=[];[n.nodeColor,n.nodeShape,n.lineColor].filter(jX).map(N=>N.columnName).forEach(N=>{let I=t[N.value];if(I.usedAes.length===0||!I.aesMap)return;let F=N.label??N.value,Q=I.values,Z={};Q.forEach(ee=>{Z[ee]||(Z[ee]={...bD}),I.usedAes.forEach(le=>{var z,U,G;(le==="dotFill"||le==="lineColor")&&(Z[ee].color=((z=I.aesMap[ee])==null?void 0:z[le])??$t),le==="dotShape"&&(Z[ee].shape=((U=I.aesMap[ee])==null?void 0:U[le])??"21"),le==="dotSize"&&(Z[ee].size=((G=I.aesMap[ee])==null?void 0:G[le])??3)})}),v.push({columnKey:F,data:Z,values:I.values,labels:I.labels})});let y=[],b=0,C=0,x=0,k=Math.min(this.chartSizes.treeHeight,400);if(r&&a){let N=i.valueType,I=r.label??r.value;if(N==="continuous"){let F=this.heatmapColorScale.scale,Q=c2(F,a.meta.valueExtent,4),Z={id:"heatmapValue",type:"continuous",width:eK(Q,I),height:k,left:0,top:0,title:I,scale:F,values:Q,labels:{}};y.push(Z),C=Z.height+c,b=Z.width}else{let F=this.heatmapColorScale.scale,Q=L2t(F,I),Z=F.domain(),ee=Z.length*s,le={id:"heatmapValue",type:"discrete",width:Q,height:ee,left:0,top:0,title:I,scale:F,values:Z,labels:{}};y.push(le),C=le.height+c,b=le.width}}if(v.map(({columnKey:N,labels:I,values:F,data:Q})=>{C>k&&(C=0,x+=b+A);let Z=N,ee=p(F.map(Y=>I[Y]),Z),le=F.length*s;le>k&&(k=le);let z=zo().domain(F).range(F.map(Y=>Q[Y])),U=x,G=C;y.push({id:N,type:"nodes",width:ee,height:le,left:U,top:G,title:Z,scale:z,values:F,labels:I}),b=ee,C+=le+c}),rh(n.nodeSize)){C>k&&(C=0,x+=b+A);let{columnName:N,domain:I,range:F}=n.nodeSize,Q=N.label??N.value,Z=iv(I,F),ee=Z.ticks(3),le=Z.tickFormat(3),z=ee.reduce((te,he)=>(te[String(he)]=le(he),te),{}),U=p(ee.map(te=>z[te]),Q),G=(Z(Math.max(...ee))*2+4)*ee.length;G>k&&(k=G);let Y=x,X=C;y.push({id:N.value,type:"size",width:U,height:G,left:Y,top:X,title:Q,scale:Z,values:ee,labels:z}),b=U,C+=G+c}let _=x+b+2*jb,P=k;this.legend={width:_,height:P,items:y}}updateChartSizes(e,t,n){let r=n.leaves().length;this.chartSizes.treeWidth=t?e.width/2:e.width;let a=s7t(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 Ac("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 Ac("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,p,v,y,b,C,x){var I;this.updateChartSizes(e.size,v,t),this.updateHeatmapScales(v,y,e.size),this.updateLegendSize(e.legend,b,f,p,v,y),this.prepareTableLabels(v);let k=r==="top"?[this.chartSizes.treeWidth,this.chartSizes.treeHeight]:[this.chartSizes.treeHeight,this.chartSizes.treeWidth];PB().size(k).separation(()=>1)(t);let _=t;Nyt(_,r==="top"?this.chartSizes.treeHeight:this.chartSizes.treeWidth,C==="alignLeavesToLine"),Lyt(_),this.addLabelsWidthToTreeArea(_,s),this.updateTotalSizes(v);let P=o7t(f),N=ie.jsx(i7t,{chartSizes:this.chartSizes,chartSettings:e,nodes:_.descendants(),links:_.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:x});this.component=N,(I=this.reactRoot)==null||I.render(N)}renderError(e){var t;(t=this.reactRoot)==null||t.render(ie.jsx(zv,{message:e}))}},c7t=u7t,uK=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:$t,nodeSize:3,lineShape:"solid",lineColor:$t});var t,n,r,a,i,o,s,c,f,A;k2t.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)??Tyt,maxCellWidth:((i=e==null?void 0:e.size)==null?void 0:i.maxCellWidth)??_yt,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 tE(e){return typeof e!="object"?!1:"valuesMap"in e}function cK(e,t){let{nodeColor:n,nodeShape:r,lineColor:a}=t,i=[n,r,a].filter(tE);return Zn.uniqBy(i,o=>o.columnName.value).reduce((o,s)=>{let{columnName:c}=s,f=Zn.uniqBy(e.rows,b=>b[c.value]),A=b=>String(b[c.value]),p=b=>c.valueLabels?String(b[c.valueLabels]):A(b),v=new Set,y=f.reduce((b,C)=>{let x=A(C);return b[x]||(b[x]={}),b},{});return tE(n)&&c.value===n.columnName.value&&(v.add("dotFill"),f.forEach(b=>{let C=A(b);y[C].dotFill=n.valuesMap[C]})),tE(r)&&c.value===r.columnName.value&&(v.add("dotShape"),f.forEach(b=>{let C=A(b);y[C].dotShape=r.valuesMap[C]})),tE(a)&&c.value===a.columnName.value&&(v.add("lineColor"),f.forEach(b=>{let C=A(b);y[C].lineColor=a.valuesMap[C]})),o[c.value]={values:f.map(A).sort(),usedAes:[...v],aesMap:y,labels:f.reduce((b,C)=>(b[A(C)]=p(C),b),{})},o},{})}var f7t=class extends Rg{constructor(t,n,r){super(t,n);Be(this,"settings");Be(this,"onClick",()=>uC);Be(this,"chartRenderer",new c7t);Be(this,"calculatedData",null);this.settings=new uK(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 uK(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(wD,{detail:{[t]:n}});document.dispatchEvent(r)}}export(){return this._updateChart(),my(this.chartRenderer.component)}_needUpdateCalculatedDataBySettings(t,n){var A,p;let{mode:r,id:a,parentId:i,heatmapAnnotation:o,heatmapAxis:s,heatmapGroup:c}=n;function f(v,y){return v.length!==y.length||v.some((b,C)=>b.value!==y[C].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)||((p=t.heatmapAxis)==null?void 0:p.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,p=Ryt(n.value,r.value,(f==null?void 0:f.value)??null,A.valueLabels??A.value??null,this.data.rows,t==="useAllNodesAsLeaves"),v=Myt(this.data,c.valueType,i,o,s,n,p),y=cK(this.data,a);this.calculatedData={chartSizes:this.chartRenderer.chartSizes,hierarchy:p,heatmapData:v,legendLabels:y}}_updateAesInData(){this.calculatedData&&(this.calculatedData.legendLabels=cK(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:p,heatmapSettings:v,leavesMode:y}=this.settings;this.chartRenderer.render(n,this.calculatedData.hierarchy,r,i,a,o,s,c,f,A,p,t,this.calculatedData.heatmapData,v,this.calculatedData.legendLabels,y,this.onClick)}};function d7t(e,t,n,r,a,i){let o=-1/0;return{type:"logo",geoms:t.reduce((s,c)=>{let f=c.join("_");return s[f]=[],n.forEach(A=>{let p=0,v={};r.forEach(b=>{let C=a.getRowsByGrouping([...c,A,b]);if(!C.length)return;let x=oc(C,k=>Number(k[i.value]));v[b]={height:x,key:b},p+=x});let y=p;e.normalize&&r.forEach(b=>{v[b]&&(v[b].height=v[b].height/y*100)}),o=Math.max(o,p),s[f].push({key:`logo_${A}`,valuesMap:v,primaryGrouping:A,boundsY:{min:0,max:e.normalize?y:100}})}),s},{}),meta:{minY:0,maxY:e.normalize?100:o,normalize:e.normalize},aes:e.aes}}var A7t={TOP:30,BOTTOM:30},u1=30,p7t=6,b4=20,kD=15,h7t=24,d2=25,v7t=12,fK={fillColor:"white",lineColor:$t,lineWidth:1,lineShape:"solid",dotSize:3,dotFill:$t,dotShape:"21"},TD=20,dK=4,Ff=4,AK=36,pK=25;function m7t(e){return`translate(${e},0)`}function g7t(e){return`translate(0,${e})`}var E4=21;function y7t(e,t){if(e==="45deg"){let n=t==="left"?-E4/2:0,r=t==="bottom"?E4/2:-E4/2;return`translate(${n},${r}) rotate(-45)`}return e==="90deg"&&t==="bottom"?`translate(${-E4/2},${Ff+E4/2}) rotate(-90)`:t==="bottom"?`translate(0,${Ff})`:`translate(${-Ff},0)`}function w7t(e,t){return t==="left"||t==="bottom"&&e==="90deg"?"central":e==="center"?"hanging":"auto"}function C7t(e,t){return t==="left"||t==="bottom"&&e!=="center"?"end":"middle"}var hK=({scale:e,tickSize:t=6,tickPadding:n=Ff,orient:r="bottom",labelsPosition:a="center",labels:i={},offset:o=typeof window<"u"&&window.devicePixelRatio>1?0:.5})=>{function s(x,k){return x.bandwidth&&(k=Math.max(0,x.bandwidth()-k*2)/2),x!=null&&x.round()&&(k=Math.round(k)),_=>{let P=x(_);return P===void 0?0:P+k}}let c=e.domain(),f=x=>i[x]??[],A=Math.max(t,0)+n,p=s(e.copy(),o),v=r==="bottom"?m7t:g7t,y=r==="left"?-1:1,b={[(r==="left"?"x":"y")+"2"]:y*t},C={[r==="left"?"x":"y"]:y*A};return ie.jsx("g",{children:c.map((x,k)=>ie.jsxs("g",{className:"tick",transform:v(p(x)+o),children:[ie.jsx("line",{stroke:$t,...b}),ie.jsx("g",{transform:y7t(a,r),children:f(x).map((_,P)=>ie.jsx("text",{fill:$t,fontSize:"14px",fontWeight:"500",fontFamily:"Manrope",dominantBaseline:w7t(a,r),textAnchor:C7t(a,r),dy:20*P,...C,children:_},`${_}_${P}`))})]},k))})};function vK(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 b7t({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=vK(e,"lineColor",r.lineColor,n),A=vK(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 ni(e){return isNaN(e)?"?":e===0?"0":Math.abs(e)<.01?q7(".1e")(e):q7(".2f")(e)}function mK(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 E7t({facetKey:e,scales:t,orientation:n,geom:r,aes:a,min:i,max:o,binsCount:s,hasKeyFromColumn:c,sideDistances:f,showTooltips:A,activeElementContainer:p,tooltipsContainer:v,tooltipsData:y}){let b=n==="vertical",C=(t.xPrimary(r.primaryGrouping)??0)+(t.xSecondary(r.secondaryGrouping)??0)+t.xSecondary.bandwidth()/2,x=mK(t,"lineColor",a.lineColor,r),k=mK(t,"fillColor",a.fillColor,r),_=r.bins,P=a.dotSize?a.dotSize:Math.abs(t.y(o)-t.y(i))/s/2,N=p&&y.fixed;return ie.jsx("g",{children:_.map(({x:I,count:F,dots:Q})=>ie.jsx("g",{children:Q.map((Z,ee)=>{let le=(ee-F/2)*2*P+P,z=b?le:0,U=b?0:le,G=`binnedDot_${r.key}_${Z.key}`,Y=y.selectedData===G&&y.currentFacet===e&&N,X=ie.jsxs("g",{transform:b?`translate(${C},${t.y(I)})`:`translate(${t.y(I)},${C})`,stroke:x,fill:k,strokeWidth:a.lineWidth,children:[ie.jsx("circle",{opacity:a.opacity,cx:z,cy:U,r:P,onMouseOver:()=>y.onMouseOver(G,e),onMouseLeave:()=>y.onMouseLeave()}),A&&ie.jsx(cu,{content:c?[Z.key,ni(Z.value)]:[ni(Z.value)],x:(b?C:t.y(I))+z,y:(b?t.y(I):C)+U,sideDistances:f,horizontal:b,offset:P,active:G===y.selectedData&&y.currentFacet===e,fixed:y.fixed,onClose:y.onClose,container:v})]},Z.key);return Y?uu.createPortal(X,p):X})},I))})}function Vf(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:uA(e,`Unknown line shape ${e}`)}}function nE(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 x7t(e,t){return t?[e.id,`${ni(e.y)}`]:[`${ni(e.y)}`]}function S7t({facetKey:e,scales:t,orientation:n,box:r,aes:a,hasKeyFromColumn:i,sideDistances:o,showTooltips:s,elementsAmount:c,activeElementContainer:f,tooltipsContainer:A,tooltipsData:p}){let v=n==="vertical",y=(t.xPrimary(r.primaryGrouping)??0)+(t.xSecondary(r.secondaryGrouping)??0)+t.xSecondary.bandwidth()/2,b=t.xSecondary.bandwidth(),C=a.boxWidth==="auto"?b*.8:Math.min(b,a.boxWidth),x=Math.abs(t.y(r.lower)-t.y(r.upper)),k=nE(t,"lineColor",a.lineColor,r),_=nE(t,"fillColor",a.fillColor,r),P=nE(t,"dotShape",a.dotShape,r),N=nE(t,"dotSize",a.dotSize,r),I=jc(P,N,k),F=Math.abs(t.y.range()[0]-t.y.range()[1]),Q=f&&p.fixed,Z=p.selectedData===r&&Q,ee=ie.jsxs("g",{transform:v?`translate(${y},0)`:`translate(0, ${y})`,opacity:a.opacity,stroke:k,strokeWidth:a.lineWidth,strokeDasharray:Vf(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?C:x,height:v?x:C,x:v?-C/2:t.y(r.lower),y:v?t.y(r.upper):-C/2,fill:_}),ie.jsx("line",{x1:v?-C/2:t.y(r.middle),x2:v?C/2:t.y(r.middle),y1:v?t.y(r.middle):-C/2,y2:v?t.y(r.middle):C/2}),s&&A&&ie.jsx("rect",{onMouseOver:()=>p.onMouseOver(r,e),onMouseLeave:p.onMouseLeave,width:v?b:F,x:v?-b/2:0,y:v?0:-b/2,height:v?F:b,fill:"transparent",stroke:"none"}),a.showOutliers&&r.outliers.map(le=>{let z=p.selectedData===le&&p.currentFacet===e&&Q,U=v?z?y:0:t.y(le.y),G=v?t.y(le.y):z?y:0,Y=ie.jsxs("g",{transform:`translate(${U},${G})`,strokeDasharray:"0",children:[I,s&&A&&ie.jsx("circle",{onMouseOver:()=>p.onMouseOver(le,e),onMouseLeave:p.onMouseLeave,r:"15",fill:"transparent",stroke:"none"}),s&&ie.jsx(cu,{content:x7t(le,i),x:v?y:t.y(le.y),y:v?t.y(le.y):y,sideDistances:o,horizontal:!0,active:p.selectedData===le&&p.currentFacet===e,onClose:p.onClose,fixed:p.fixed,container:A})]},le.id);return z?uu.createPortal(Y,f):Y}),s&&ie.jsx(cu,{content:[`Max = ${ni(r.max)}`,`Upper = ${ni(r.upper)}`,`Median = ${ni(r.middle)}`,`Lower = ${ni(r.lower)}`,`Min = ${ni(r.min)}`],x:v?y:t.y(r.middle),y:v?t.y(r.middle):y,sideDistances:o,horizontal:v,active:p.active&&p.selectedData===r&&p.currentFacet===e,fixed:p.fixed,onClose:p.onClose,offset:c>1?b/2:b/4,container:A})]});return Z?uu.createPortal(ee,f):ee}function _D(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 B7t(e,t,n){return n?[t,`${ni(e)}`]:[`${ni(e)}`]}function k7t({facetKey:e,scales:t,orientation:n,geom:r,aes:a,hasKeyFromColumn:i,sideDistances:o,showTooltips:s,activeElementContainer:c,tooltipsContainer:f,tooltipsData:A}){let p=n==="vertical",v=(t.xPrimary(r.primaryGrouping)??0)+(t.xSecondary(r.secondaryGrouping)??0)+t.xSecondary.bandwidth()/2,y=t.xSecondary.bandwidth()*a.jitter,b=N=>(1-N*2)*(y/2),C=_D(t,"lineColor",a.lineColor,r),x=_D(t,"dotFill",a.dotFill,r),k=_D(t,"dotShape",a.dotShape,r),_=jc(k,a.dotSize,x),P=c&&A.fixed;return ie.jsx("g",{transform:p?`translate(${v},0)`:`translate(0, ${v})`,stroke:C,children:r.values.map(N=>{let{jitter:I,id:F}=N,Q=A.selectedData===N&&P,Z=b(I),ee=p?Q?v+Z:Z:t.y(N.y),le=p?t.y(N.y):Q?v+Z:Z,z=ie.jsxs("g",{opacity:a.opacity,transform:`translate(${ee},${le})`,children:[_,s&&f&&ie.jsx("circle",{onMouseOver:()=>A.onMouseOver(N,e),onMouseLeave:()=>A.onMouseLeave(),r:"4",fill:"transparent",stroke:"none"}),s&&ie.jsx(cu,{content:B7t(N.y,F,i),x:v+b(I),y:le,active:A.active&&A.selectedData===N&&A.currentFacet===e,fixed:A.fixed,onClose:A.onClose,sideDistances:o,container:f})]},F);return Q?uu.createPortal(z,c):z})})}function DD(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 T7t({facetKey:e,scales:t,orientation:n,errorBar:r,aes:a,sideDistances:i,showTooltips:o,activeElementContainer:s,tooltipsContainer:c,tooltipsData:f}){let A=n==="vertical",p=DD(t,"lineColor",a.lineColor,r),v=DD(t,"fillColor",a.fillColor,r),y=DD(t,"dotShape",a.dotShape,r),b=(t.xPrimary(r.primaryGrouping)??0)+t.xPrimary.bandwidth()/2,C=a.width==="auto"?t.xPrimary.bandwidth()*.2:a.width,x=t.y(r.min),k=t.y(r.max),_=t.y(r.value),P=jc(y,a.dotSize,v),N=s&&f.fixed,I=f.selectedData===r&&N,F=a.showDots?ie.jsxs("g",{transform:A?`translate(${b},${_})`:`translate(${_},${b})`,children:[P,o&&c&&ie.jsx("circle",{onMouseOver:()=>f.onMouseOver(r,e),onMouseLeave:()=>f.onMouseLeave(),r:"15",fill:"transparent",stroke:"none"}),o&&ie.jsx(cu,{content:[ni(r.value)],x:A?b:_,y:A?_:b,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:p,fill:"none",strokeWidth:a.lineWidth,children:[ie.jsxs("g",{transform:A?`translate(${b},0)`:`translate(0,${b})`,children:[ie.jsx("line",{x1:A?0:x,x2:A?0:k,y1:A?x:0,y2:A?k:0}),ie.jsx("line",{x1:A?-C/2:x,x2:A?C/2:x,y1:A?x:-C/2,y2:A?x:C/2}),ie.jsx("line",{x1:A?-C/2:k,x2:A?C/2:k,y1:A?k:-C/2,y2:A?k:C/2})]}),I?uu.createPortal(F,s):F]})}function rE(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 _7t(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 D7t({facetKey:e,scales:t,orientation:n,line:r,aes:a,sideDistances:i,showTooltips:o,secondaryGrouping:s,activeElementContainer:c,tooltipsContainer:f,tooltipsData:A}){let p=n==="vertical",v=rE(t,"lineColor",a.lineColor,r),y=rE(t,"dotFill",a.fillColor,r),b=rE(t,"lineShape",a.lineShape,r),C=rE(t,"dotShape",a.dotShape,r),x=_7t(r.dots,t.xPrimary.domain(),t),k=jc(C,a.dotSize,y),_=c&&A.fixed;return ie.jsxs("g",{opacity:a.opacity,stroke:v,strokeDasharray:Vf(b),strokeWidth:a.lineWidth,children:[ie.jsx("polyline",{points:x.map(([P,N])=>p?[P,N]:[N,P]).join(" "),stroke:v,fill:"none"},r.key),a.dotShape!==null&&ie.jsx("g",{children:x.map(P=>{let[N,I,F,Q]=P,Z=A.selectedData,ee=Z&&e===A.currentFacet&&Z.every((U,G)=>U===P[G]),le=ee&&_,z=ie.jsxs("g",{transform:p?`translate(${N},${I})`:`translate(${I},${N})`,strokeDasharray:"none",stroke:"none",children:[k,o&&f&&ie.jsx("circle",{onMouseOver:()=>A.onMouseOver(P,e),onMouseLeave:()=>A.onMouseLeave(),r:"15",fill:"transparent",stroke:"none"}),o&&ie.jsx(cu,{content:[s.valueLabels[r.key],ni(Q)],x:p?N:I,y:p?I:N,sideDistances:i,horizontal:!0,active:ee,fixed:A.fixed,onClose:A.onClose,container:f})]},F);return le?uu.createPortal(z,c):z})})]})}var gK={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"},P7t=()=>ie.jsx("path",{d:"M 0 49 h 100 v 2 h -100 z"});function M7t({facetKey:e,scales:t,orientation:n,geom:r,aes:a,sideDistances:i,showTooltips:o,elementsAmount:s,normalize:c,activeElementContainer:f,tooltipsContainer:A,tooltipsData:p}){let v=n==="vertical",y=t.xPrimary.bandwidth(),b=(t.xPrimary(r.primaryGrouping)??0)+y/2,C=a.width==="auto"?y*.95:Math.min(y,a.width),x=(y-C)/2,k=[...t.xSecondary.domain()].filter(I=>r.valuesMap[I]).sort((I,F)=>{let Q=r.valuesMap[I],Z=r.valuesMap[F];return Q.height-Z.height}),_={},P=0;k.forEach(I=>{if(!r.valuesMap[I])return;let F=r.valuesMap[I].height;_[I]={y1:P,y2:P+F},P+=F});let N=f&&p.fixed;return ie.jsx("g",{opacity:a.opacity,children:k.map(I=>{if(!r.valuesMap[I])return null;let{y1:F,y2:Q}=_[I],Z=t.y(F),ee=t.y(Q),le=Math.abs(Z-ee)-2*x,z=typeof a.fillColor=="string"?a.fillColor:a.fillColor[I],U=v?-C/2:Math.min(Z,ee)+x,G=v?Math.min(Z,ee)+x:-C/2,Y=I==="-";if(!Y&&!gK[I])return;let X=`logo_${r.key}_${I}`,te=p.currentFacet===e&&p.selectedData===X&&N,he=ie.jsxs("g",{transform:v?`translate(${b},0)`:`translate(0, ${b})`,children:[ie.jsx("g",{transform:`translate(${U},${G})`,children:Y?ie.jsx("g",{transform:v?`scale(${C/100},1) translate(0,${le/2-50})`:`scale(${le/100},1) translate(0,${C/2-50}) `,children:P7t()}):ie.jsx("g",{transform:v?`scale(${C/100},${le/100})`:`scale(${le/100},${C/100})`,fill:z,onMouseOver:()=>p.onMouseOver(X,e),onMouseLeave:()=>p.onMouseLeave(),children:ie.jsx("path",{d:gK[I],fillRule:"evenodd",clipRule:"evenodd"})})}),o&&ie.jsx(cu,{content:[I,ni(r.valuesMap[I].height)+(c?"%":"")],x:v?b:(Z+ee)/2,y:v?(Z+ee)/2:b,sideDistances:i,horizontal:v,offset:s>1?y/2:y/4,active:X===p.selectedData&&p.currentFacet===e,fixed:p.fixed,onClose:p.onClose,container:A})]},I);return te?uu.createPortal(he,f):he})})}function A2(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 H7t({facetKey:e,scales:t,orientation:n,geom:r,aes:a,sideDistances:i,showTooltips:o,activeElementContainer:s,tooltipsContainer:c,tooltipsData:f}){let A=n==="vertical",p=A2(t,"lineColor",a.lineColor,r.id),v=A2(t,"lineShape",a.lineShape,r.id),y=A2(t,"fillColor",a.dotFill,r.key1),b=A2(t,"dotShape",a.dotShape,r.key1),C=A2(t,"fillColor",a.dotFill,r.key2),x=A2(t,"dotShape",a.dotShape,r.key2),k=jc(b,a.dotSize,y),_=jc(x,a.dotSize,C);function P(I){return r.grouping==="primary"?(t.xPrimary(I)??0)+t.xPrimary.bandwidth()/2:(t.xPrimary(r.id)??0)+(t.xSecondary(I)??0)+t.xSecondary.bandwidth()/2}let N=s&&f.fixed;return ie.jsx("g",{opacity:a.opacity,children:r.pairs.map(I=>{let F=A?P(r.key1):t.y(I.key1.value),Q=A?P(r.key2):t.y(I.key2.value),Z=A?t.y(I.key1.value):P(r.key1),ee=A?t.y(I.key2.value):P(r.key2),le=`pairedPoints_${I.id}_${I.key1.id}`,z=`pairedPoints_${I.id}_${I.key2.id}`,U=f.currentFacet===e&&f.selectedData===le&&N,G=f.currentFacet===e&&f.selectedData===z&&N,Y=ie.jsxs("g",{transform:`translate(${F},${Z})`,children:[k,o&&c&&ie.jsx("circle",{onMouseOver:()=>f.onMouseOver(le,e),onMouseLeave:()=>f.onMouseLeave(),r:"15",fill:"transparent",stroke:"none"}),o&&ie.jsx(cu,{content:[I.id,ni(I.key1.value)],x:F,y:Z,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(${Q},${ee})`,children:[_,o&&c&&ie.jsx("circle",{onMouseOver:()=>f.onMouseOver(z,e),onMouseLeave:()=>f.onMouseLeave(),r:"15",fill:"transparent",stroke:"none"}),o&&ie.jsx(cu,{content:[I.id,ni(I.key2.value)],x:Q,y:ee,sideDistances:i,horizontal:!0,active:z===f.selectedData&&f.currentFacet===e,fixed:f.fixed,onClose:f.onClose,container:c})]});return ie.jsxs("g",{children:[ie.jsx("line",{x1:F,y1:Z,x2:Q,y2:ee,stroke:p,strokeDasharray:Vf(v),strokeWidth:a.lineWidth,fill:"none"}),U?uu.createPortal(Y,s):Y,G?uu.createPortal(Y,s):X]},I.id)})})}function yK(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 I7t(e,t,n){return n?[t,`${ni(e)}`]:[`${ni(e)}`]}function R7t({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",p=(e.xPrimary(n.primaryGrouping)??0)+(e.xSecondary(n.secondaryGrouping)??0)+e.xSecondary.bandwidth()/2,v=e.xSecondary.bandwidth(),y=r.width==="auto"?v*.8:Math.min(v,r.width),b=_=>(1-_*2)*(y/2),C=yK(e,"dotFill",r.dotFill,n),x=yK(e,"dotShape",r.dotShape,n),k=jc(x,r.dotSize,C);return ie.jsx("g",{transform:A?`translate(${p},0)`:`translate(0, ${p})`,children:n.points.map(({x:_,y:P,jitter:N,id:I})=>{let F=A?P*b(N):e.y(_),Q=A?e.y(_):P*b(N);return ie.jsxs("g",{opacity:r.opacity,transform:`translate(${F},${Q})`,children:[k,o&&s&&ie.jsx("circle",{onMouseOver:()=>f(I),onMouseLeave:()=>f(null),r:"4",fill:"transparent",stroke:"none"}),o&&ie.jsx(cu,{content:I7t(P,I,a),x:p+F,y:Q,active:c===I,fixed:!1,sideDistances:i,container:s})]},I)})})}function wK(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 N7t({facetKey:e,scales:t,orientation:n,geom:r,aes:a,sideDistances:i,showTooltips:o,elementsAmount:s,normalize:c,secondaryGrouping:f,activeElementContainer:A,tooltipsContainer:p,tooltipsData:v}){let y=n==="vertical",b=t.xPrimary.bandwidth(),C=(t.xPrimary(r.primaryGrouping)??0)+b/2,x=a.width==="auto"?b*.8:Math.min(b,a.width),k=t.xSecondary.domain().reverse(),_={},P=0;k.forEach(I=>{if(!r.valuesMap[I])return;let F=r.valuesMap[I].height;_[I]={y1:P,y2:P+F},P+=F});let N=A&&v.fixed;return ie.jsx("g",{opacity:a.opacity,strokeWidth:a.lineWidth,children:k.map(I=>{if(!r.valuesMap[I])return null;let{y1:F,y2:Q}=_[I],Z=t.y(F),ee=t.y(Q),le=Math.abs(Z-ee),z=wK(t,"lineColor",a.lineColor,r.primaryGrouping,I),U=wK(t,"fillColor",a.fillColor,r.primaryGrouping,I),G=`stackedBar_${r.primaryGrouping}_${I}`,Y=ie.jsx("rect",{width:y?x:le,height:y?le:x,x:y?C-x/2:Math.min(Z,ee),y:y?Math.min(Z,ee):C-x/2,fill:U,stroke:z,onMouseOver:()=>v.onMouseOver(G,e),onMouseLeave:()=>v.onMouseLeave()}),X=v.selectedData===G&&e===v.currentFacet&&N;return ie.jsxs("g",{children:[X?uu.createPortal(Y,A):Y,o&&ie.jsx(cu,{content:[f.valueLabels[I],ni(r.valuesMap[I].height)+(c?"%":"")],x:y?C:(Z+ee)/2,y:y?(Z+ee)/2:C,sideDistances:i,horizontal:y,offset:s>1?b/2:b/4,active:G===v.selectedData&&e===v.currentFacet,fixed:v.fixed,onClose:v.onClose,container:p})]},I)})})}function CK(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 L7t(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 bK(e,t,n,r){let a=t.reduce((o,s,c)=>(o[s]=c,o),{}),i=[];return CK(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 $7t={ttest:"TTest",anova:"ANOVA",kruskalWallis:"Kruskal-Wallis",wilcoxon:"Wilcoxon"};function F7t(e,t){return e<=t.three?"***":e<=t.two?"**":e<=t.one?"*":"ns"}function PD(e,t,n,r){return!r&&e>n.one?"":t==="significance"?F7t(e,n):ni(e)}var p2=18,MD=12;function V7t({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=k=>(t.xPrimary(k)??0)+t.xPrimary.bandwidth()/2,A=e==="vertical",p=Math.abs(t.xPrimary.range()[1]-t.xPrimary.range()[0]),v=Math.abs(t.y.range()[1]-t.y.range()[0]),y=t.xPrimary.domain(),b=a==="pairwise"?CK(r,y,s,!o):r,C=a==="pairwise"?L7t(b,y):[],x=Math.max(...C);return ie.jsxs("g",{fontSize:"14px",transform:A?`translate(0,${c})`:`translate(${v-c},0)`,children:[a==="overall"&&ie.jsx("text",{x:A?p/2:-p2,y:A?p2:p/2,transform:A?"":`rotate(90,${-p2},${p/2})`,textAnchor:"middle",children:`${$7t[n]}, p = ${PD(r[0][1],"pValue",s,!0)}`}),a==="referenceGroup"&&ie.jsx("g",{children:r.map(([[k],_])=>ie.jsx("text",{x:A?f(k):-p2,y:A?p2:f(k),transform:A?"":`rotate(90,${-p2},${f(k)})`,textAnchor:"middle",children:PD(_,i,s,o)},k))}),a==="pairwise"&&ie.jsx("g",{children:b.map(([[k,_],P],N)=>{let I=f(k),F=f(_),Q=(I+F)/2;return ie.jsxs("g",{transform:A?`translate(0,${(x-C[N])*d2})`:`translate(${-(x-C[N])*d2},0)`,children:[ie.jsx("text",{x:A?Q:-MD,y:A?MD:Q,transform:A?"":`rotate(90,${-MD},${Q})`,textAnchor:"middle",children:PD(P,i,s,o)}),ie.jsx("path",{d:A?`M ${I},21 v-4 h ${F-I} v4`:`M -21,${I} h 4 v ${F-I} h-4`,fill:"none",stroke:$t})]},`${k}_${_}`)})})]})}function O7t(e){return`translate(${e},0)`}function Q7t(e){return`translate(0,${e})`}function z7t(e){return e==="bottom"?`translate(0,${Ff})`:`translate(${-Ff},0)`}function U7t(e){return e==="bottom"?"hanging":"central"}function G7t(e){return e==="bottom"?"middle":"end"}var EK=({scale:e,tickSize:t=6,tickPadding:n=Ff,orient:r="bottom",onlyPositive:a=!1,offset:i=typeof window<"u"&&window.devicePixelRatio>1?0:.5,hiddenLabels:o=!1})=>{function s(P){return N=>{let I=P(N);return I===void 0?0:+I}}let c=Math.abs(e.range()[0]-e.range()[1]),f=Math.min(Math.floor(c/pK),10),A=o?[]:e.ticks(f).filter(P=>a&&P>=0||!a),p=A.some(P=>Math.abs(P)<1e-4&&P!==0||P>1e4)?",e":",f",v=P=>e.tickFormat(f,p)(P),y=Math.max(t,0)+n,b=s(e.copy()),C=r==="bottom"?O7t:Q7t,x=r==="left"?-1:1,k={[(r==="left"?"x":"y")+"2"]:x*t},_={[r==="left"?"x":"y"]:x*y};return ie.jsx("g",{children:A.map((P,N)=>ie.jsxs("g",{className:"tick",transform:C(b(P)+i),children:[ie.jsx("line",{stroke:$t,...k}),ie.jsx("g",{transform:z7t(r),children:ie.jsx("text",{fill:$t,fontSize:"14px",fontWeight:"500",fontFamily:"Manrope",dominantBaseline:U7t(r),textAnchor:G7t(r),..._,children:v(P)})})]},N))})};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 j7t({facetKey:e,scales:t,orientation:n,violin:r,aes:a,maxViolinDensity:i,showTooltips:o,sideDistances:s,elementsAmount:c,activeElementContainer:f,tooltipsContainer:A,tooltipsData:p}){let v=n==="vertical",y=(t.xPrimary(r.primaryGrouping)??0)+(t.xSecondary(r.secondaryGrouping)??0)+t.xSecondary.bandwidth()/2,b=t.xSecondary.bandwidth(),C=a.width==="auto"?b*.8:Math.min(b,a.width),x=xK(t,"lineColor",a.lineColor,r),k=xK(t,"fillColor",a.fillColor,r),_=r.getArea(n,t.y,C,i)??"",P=r.getLine(n,t.y,C,i)??"",N=Math.abs(t.y.range()[0]-t.y.range()[1]),I=f&&p.fixed,F=p.selectedData===r&&I,Q=ie.jsxs("g",{transform:v?`translate(${y},0)`:`translate(0, ${y})`,opacity:a.opacity,stroke:x,fill:k,strokeWidth:a.lineWidth,strokeDasharray:Vf(a.lineShape),children:[ie.jsx("clipPath",{id:`violin_${r.key}`,children:ie.jsx("path",{d:_})}),ie.jsx("path",{d:_,stroke:"none"}),a.showQuartiles&&ie.jsxs("g",{clipPath:`url(#violin_${r.key})`,strokeWidth:a.lineWidth,stroke:x,children:[ie.jsx("line",{x1:v?-C/2:t.y(r.quartiles.q1),x2:v?C/2:t.y(r.quartiles.q1),y1:v?t.y(r.quartiles.q1):-C/2,y2:v?t.y(r.quartiles.q1):C/2,strokeDasharray:Vf(a.quartilesLineStyle)}),ie.jsx("line",{x1:v?-C/2:t.y(r.quartiles.q2),x2:v?C/2:t.y(r.quartiles.q2),y1:v?t.y(r.quartiles.q2):-C/2,y2:v?t.y(r.quartiles.q2):C/2,strokeDasharray:Vf(a.medianLineStyle)}),ie.jsx("line",{x1:v?-C/2:t.y(r.quartiles.q3),x2:v?C/2:t.y(r.quartiles.q3),y1:v?t.y(r.quartiles.q3):-C/2,y2:v?t.y(r.quartiles.q3):C/2,strokeDasharray:Vf(a.quartilesLineStyle)})]}),ie.jsx("path",{d:P,fill:"none"}),o&&A&&ie.jsx("rect",{onMouseOver:()=>p.onMouseOver(r,e),onMouseLeave:p.onMouseLeave,width:v?b:N,x:v?-b/2:0,y:v?0:-b/2,height:v?N:b,fill:"transparent",stroke:"none"}),o&&ie.jsx(cu,{content:[`Quartile 3 = ${ni(r.quartiles.q3)}`,`Median = ${ni(r.quartiles.q2)}`,`Quartile 1 = ${ni(r.quartiles.q1)}`],x:v?y:t.y(r.quartiles.q2),y:v?t.y(r.quartiles.q2):y,sideDistances:s,horizontal:v,active:p.active&&p.selectedData===r&&p.currentFacet===e,fixed:p.fixed,offset:c>1?C/2:C/4,onClose:p.onClose,container:A})]});return F?uu.createPortal(Q,f):Q}var Y7t=1;function W7t({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]),p=Math.min(Math.floor(A/pK),10),[v,y]=tn.useState(t.ticks(p)),b=e.bandwidth()/2,C=_=>(e(_)??0)+b,x=_=>t(_),k=n==="vertical";return tn.useEffect(()=>{let _=e.domain(),P=t.ticks(p);f(_),y(P)},[e,t]),ie.jsxs("g",{stroke:$f,children:[i.showGrid&&c.map(_=>{let P=C(_)+(i.linesBetweenCategories?b:0);return ie.jsx("line",{x1:k?P:0,x2:k?P:r,y1:k?0:P,y2:k?a:P},`x_${_}`)}),o.showGrid&&v.map(_=>{let P=x(_);return ie.jsx("line",{x1:k?0:P,x2:k?r:P,y1:k?P:0,y2:k?P:a},`y_${_}`)}),s!=="empty"&&ie.jsxs("g",{strokeWidth:Y7t,children:[(i.showGrid||s!=="left")&&ie.jsx("line",{stroke:s==="left"?$f:$t,x1:"0",x2:r,y1:a,y2:a}),(i.showGrid||s!=="bottom")&&ie.jsx("line",{stroke:s==="bottom"?$f:$t,x1:"0",x2:"0",y1:"0",y2:a}),(i.showGrid||s==="full")&&ie.jsx("line",{stroke:s==="full"?$t:$f,x1:r,x2:r,y1:"0",y2:a}),(o.showGrid||s==="full")&&ie.jsx("line",{stroke:s==="full"?$t:$f,x1:"0",x2:r,y1:"0",y2:"0"})]})]})}function X7t(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=bK(i.values[n],t,i.meta.significanceLevels,i.meta.ns);r.push(r[r.length-1]+d2*o)}else r.push(r[r.length-1]+d2)}return r}function SK(e){return typeof e=="string"?e:e.value}function K7t({facetSettings:e,facetTitle:t,dimensions:n,scales:r,orientation:a,layersData:i,statsData:o,facetKey:s,xAxis:c,yAxis:f,frameType:A,tooltips:p,tooltipsContainer:v,keyColumn:y,chartSizes:b,margins:C,xLabels:x,onlyPositive:k,secondaryGrouping:_,tooltipsData:P}){let[N,I]=tn.useState(),F=a==="vertical",Q=X7t(o,r.xPrimary.domain(),s),Z=c.showTicks?dK:0,ee=f.showTicks?dK:0,le=SK(c.title),z=SK(f.title),U=n.chartEdgeSides.includes("left")||F&&!(e!=null&&e.sharedY)||!F&&!(e!=null&&e.sharedX),G=n.chartEdgeSides.includes("bottom")||F&&!(e!=null&&e.sharedX)||!F&&!(e!=null&&e.sharedY),Y=n.chartEdgeSides.includes("left"),X=n.chartEdgeSides.includes("bottom"),{width:te,height:he}=n.inner,{left:ae,top:ge,padding:me}=n,fe={left:C.left+ae+me.left,right:b.totalWidth-(C.left+ae+me.left),top:C.top+ge+me.top,bottom:b.totalHeight-(C.top+ge+me.top)},be=`translate(${ae+me.left},${ge+me.top})`,He=!1;return ie.jsxs("g",{transform:be,children:[He,t.length&&ie.jsxs("g",{children:[A==="full"&&ie.jsx("rect",{x:"0",y:-me.top,height:me.top,width:te,fill:"#F7F8FA",stroke:$t}),t.map((_e,Ie)=>{let Ue=t.length,Oe=(me.top-b4*Ue)/2;return ie.jsx("text",{fontSize:"14px",fontWeight:"500",fill:$t,x:te/2,dy:Oe+b4/2-me.top,y:Ie*b4,textAnchor:"middle",dominantBaseline:"central",children:_e},Ie)})]}),ie.jsxs("g",{dominantBaseline:"central",textAnchor:"middle",fontWeight:"500",fontSize:"14px",fill:$t,children:[X&&ie.jsx("text",{x:te/2,y:he+me.bottom-u1/2,children:F?le:z}),X&&He&&ie.jsx("rect",{x:"0",y:he+me.bottom-u1,width:te,height:u1,fill:"none",stroke:"black"}),Y&&ie.jsx("text",{x:-me.left+u1/2,y:he/2,transform:`rotate(-90,${-me.left+u1/2},${he/2})`,children:F?z:le}),Y&&He&&ie.jsx("rect",{x:-me.left,y:"0",width:u1,height:he,fill:"none",stroke:"black"})]}),ie.jsx(W7t,{orientation:a,width:te,height:he,scaleX:r.xPrimary,scaleY:r.y,axisX:c,axisY:f,frameType:A}),G&&ie.jsx("g",{transform:`translate(0,${he})`,children:F?ie.jsx(hK,{scale:r.xPrimary,orient:"bottom",labelsPosition:c.labelsPosition,tickSize:Z,labels:x}):ie.jsx(EK,{scale:r.y,onlyPositive:k,orient:"bottom",tickSize:ee,hiddenLabels:f.hiddenLabels})}),U&&ie.jsx("g",{children:F?ie.jsx(EK,{scale:r.y,onlyPositive:k,orient:"left",tickSize:ee,hiddenLabels:f.hiddenLabels}):ie.jsx(hK,{scale:r.xPrimary,orient:"left",labelsPosition:c.labelsPosition,tickSize:Z,labels:x})}),ie.jsxs("g",{children:[i.map(_e=>ie.jsxs("g",{children:[_e.type==="box"&&_e.geoms[s].map(Ie=>ie.jsx(S7t,{facetKey:s,box:Ie,elementsAmount:_e.geoms[s].length,scales:r,orientation:a,aes:_e.aes,hasKeyFromColumn:y!==null,sideDistances:fe,showTooltips:p.box.show,tooltipsData:P,activeElementContainer:N,tooltipsContainer:v},Ie.key)),_e.type==="violin"&&_e.geoms[s].map(Ie=>ie.jsx(j7t,{facetKey:s,violin:Ie,elementsAmount:_e.geoms[s].length,scales:r,orientation:a,maxViolinDensity:_e.meta.maxDensity,aes:_e.aes,sideDistances:fe,showTooltips:p.violin.show,tooltipsData:P,activeElementContainer:N,tooltipsContainer:v},Ie.key)),_e.type==="dot"&&_e.geoms[s].map(Ie=>ie.jsx(k7t,{facetKey:s,geom:Ie,scales:r,orientation:a,aes:_e.aes,hasKeyFromColumn:y!==null,sideDistances:fe,showTooltips:p.dot.show,tooltipsData:P,activeElementContainer:N,tooltipsContainer:v},Ie.key)),_e.type==="line"&&_e.geoms[s].map(Ie=>ie.jsx(D7t,{facetKey:s,line:Ie,scales:r,orientation:a,sideDistances:fe,aes:_e.aes,showTooltips:p.line.show,secondaryGrouping:_,tooltipsData:P,activeElementContainer:N,tooltipsContainer:v},Ie.key)),_e.type==="errorbar"&&_e.geoms[s].map(Ie=>ie.jsx(T7t,{facetKey:s,errorBar:Ie,scales:r,orientation:a,aes:_e.aes,sideDistances:fe,showTooltips:p.errorBar.show,tooltipsData:P,activeElementContainer:N,tooltipsContainer:v},Ie.key)),_e.type==="bar"&&_e.geoms[s].map(Ie=>ie.jsx(b7t,{bar:Ie,scales:r,orientation:a,aes:_e.aes},Ie.key)),_e.type==="stackedBar"&&_e.geoms[s].map(Ie=>ie.jsx(N7t,{facetKey:s,geom:Ie,elementsAmount:_e.geoms[s].length,scales:r,orientation:a,aes:_e.aes,normalize:_e.meta.normalize,sideDistances:fe,showTooltips:p.stackedBar.show,secondaryGrouping:_,tooltipsData:P,activeElementContainer:N,tooltipsContainer:v},Ie.key)),_e.type==="binnedDots"&&_e.geoms[s].map(Ie=>ie.jsx(E7t,{facetKey:s,geom:Ie,scales:r,orientation:a,aes:_e.aes,binsCount:_e.meta.binsCount,min:_e.meta.minY,max:_e.meta.maxY,hasKeyFromColumn:_e.meta.hasKeyFromColumn,sideDistances:fe,showTooltips:p.stackedBar.show,tooltipsData:P,activeElementContainer:N,tooltipsContainer:v},Ie.key)),_e.type==="pairedPoints"&&_e.geoms[s].map(Ie=>ie.jsx(H7t,{facetKey:s,geom:Ie,scales:r,orientation:a,sideDistances:fe,aes:_e.aes,showTooltips:p.pairedPoints.show,tooltipsData:P,activeElementContainer:N,tooltipsContainer:v},Ie.id)),_e.type==="sina"&&_e.geoms[s].map(Ie=>ie.jsx(R7t,{geom:Ie,scales:r,orientation:a,sideDistances:fe,aes:_e.aes,hasKeyFromColumn:y!==null,showTooltips:!1,tooltipsContainer:v},Ie.key)),_e.type==="logo"&&_e.geoms[s].map(Ie=>ie.jsx(M7t,{facetKey:s,geom:Ie,elementsAmount:_e.geoms[s].length,scales:r,orientation:a,aes:_e.aes,normalize:_e.meta.normalize,sideDistances:fe,showTooltips:p.logo.show,tooltipsData:P,activeElementContainer:N,tooltipsContainer:v},Ie.key))]},_e.type)),o.map((_e,Ie)=>ie.jsx(V7t,{yShift:Q[Ie],scales:r,orientation:a,statType:_e.meta.statType,values:_e.values[s],testMethod:_e.meta.testMethod,format:_e.meta.format,ns:_e.meta.ns,significanceLevels:_e.meta.significanceLevels},`${_e.meta.statType}_${_e.meta.testMethod}`))]}),ie.jsxs("g",{children:[P.fixed&&ie.jsx("rect",{width:b.chartWidth,height:b.chartHeight,fill:"rgba(255, 255, 255, 0.8)"}),ie.jsx("g",{ref:_e=>{_e&&!N&&I(_e)}})]})]})}var h2=class extends k6.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(zv,{message:this.state.message}):this.props.children}};function Z7t(e,t,n,r){return e==="left"?n:e==="right"?t-r:(t-(n+r))/2+n}function J7t(e){return e==="left"?"start":e==="right"?"end":"middle"}function v2({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:Z7t(t,r,a,i),textAnchor:J7t(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,x4=-12,BK=14;function q7t(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 e5t=3,t5t=24;function n5t({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?jc(e.dotShape??"21",e5t,i?$t:e.dotFill??$t):null,s=(a&&r?2*pc:0)-6,c=r?s+t5t+8:pc+8;return ie.jsxs("g",{children:[i&&ie.jsx("rect",{width:pc,height:pc,stroke: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:q7t(e.lineShape),fill:e.lineColor}),ie.jsx("text",{x:c,y:pc/2,dominantBaseline:"central",fontWeight:500,children:t})]})}function r5t({aes:e,label:t}){let n=jc(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 m2({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:x4,children:n.title}),ie.jsx("rect",{x:"0",y:"0",width:BK,height:n.height,stroke:$t,fill:`url(#${n.id})`}),ie.jsx("g",{transform:`translate(${BK},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:$t}),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:x4,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:$t}),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:x4,children:n.title}),n.values.map((r,a)=>ie.jsx("g",{transform:`translate(0, ${a*(pc+4)})`,children:ie.jsx(n5t,{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:x4,children:n.title}),n.values.map((r,a)=>ie.jsx("g",{transform:`translate(0, ${a*(pc+4)})`,children:ie.jsx(r5t,{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:x4,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:$t}),ie.jsx("text",{x:r+4,y:r/2,alignmentBaseline:"central",children:n.labels[a]})]},a)}),!1]},n.id)}})]})}function a5t({settingsId:e,chartSettings:t,chartSizes:n,chartsDimensions:r,facetKeys:a,facetTitles:i,facetSettings:o,scales:s,layersData:c,statsData:f,legendData:A,margins:p,columnsCount:v,keyColumn:y,xLabels:b,chartTitle:C,onlyPositive:x,secondaryGrouping:k,onTooltipHintSwitch:_}){let[P,N]=tn.useState(),I=f2(_),{orientation:F,xAxis:Q,yAxis:Z,title:ee,legend:le,frame:z}=t,U=r[a[0]].padding,G=r[a[v-1]].padding,Y=n.chartsWidth+AK,X=U.top;return ie.jsx(h2,{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:$g}),ie.jsxs("g",{transform:`translate(${p.left},${p.top})`,fontFamily:"Manrope",children:[ie.jsx(v2,{title:C,show:ee.show,position:ee.position,leftPadding:U.left,rightPadding:G.right,chartsWidth:n.chartsWidth}),a.map(te=>ie.jsx(K7t,{facetKey:te,facetTitle:i[te],facetSettings:o,orientation:F,scales:{...s,xPrimary:s.xPrimary[te],xSecondary:s.xSecondary[te],y:s.y[te]},chartSizes:n,margins:p,dimensions:r[te],layersData:c,statsData:f,xAxis:Q,yAxis:Z,frameType:z.type,tooltips:t.tooltips,tooltipsContainer:P,keyColumn:y,xLabels:b[te],onlyPositive:x,secondaryGrouping:k,tooltipsData:I},te)),le.show&&ie.jsx("g",{transform:`translate(${Y},${X})`,children:ie.jsx(m2,{legendData:A})})]}),ie.jsx("g",{style:{outline:"none"},ref:te=>{te&&!P&&N(te)}})]})})}function kK(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=>bK(c,t,o.meta.significanceLevels,o.meta.ns));return i+d2*Math.max(...s)}return(o.meta.ns?t.length>0:r.some(s=>o.values[s].some(([,c])=>c<o.meta.significanceLevels.one)))?i+d2:i},v7t):0;return Math.max(n,a)}function g2(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,p)=>A-p),o=Dp(i,.25),s=Dp(i,.75),c=s-o,f=1.5;return[a(o-f*c),a(s+f*c)]}function i5t(e,t,n,r=14){let a=new Ac(`600 ${r}px Manrope`),i=[];e.split(new RegExp("(?=[_-])|(?<=[_-])")).forEach(p=>{a.getTextWidth(p)>n?i.push(...p.split("")):i.push(p)});let o="",s=0,c=0,f="";for(;s<=t;){let p=a.getTextWidth(o+i[c]);p<t&&(o+=i[c],f=o,c++),s=p}o="",s=0;let A=[];for(c;c<i.length;c++){let p=a.getTextWidth(o+i[c]);p<n?(o+=i[c],s=p):(A.push(o),o=i[c],s=a.getTextWidth(i[c]))}return{firstPart:f,lines:A,lastPart:o,lastPartLength:s}}function Uv(e,t,n){let r=new Ac(`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 p=r.getTextWidth(a[c]);if(p>t){let{firstPart:v,lines:y,lastPart:b,lastPartLength:C}=i5t(a[c],t-s,t,n);i.push(`${o} ${v}`),i.push(...y),o=b,s=C}else i.push(o),o=a[c],s=p}}return i.push(o),i.filter(c=>c.length>0)}var TK=new Ac("600 14px Manrope"),o5t=16,HD=48,l5t=20,Fg=24;function ID(e,t){return Math.max(...e.map(n=>TK.getTextWidth(String(n))+l5t),TK.getTextWidth(t))}function s5t(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 y2(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:p,id:v,scale:y}=c;if(f==="continuous"){let b=eK(A,p),C=r;t-i<C&&(o+=a+Fg,a=0,i=0);let x=o,k=i;b>a&&(a=b),i+=C+HD,i>=t&&(o+=a+Fg,a=0,i=0),s.push({...c,width:b,height:C,left:x,top:k})}else if(f==="size"){let{labels:b}=c,C=y(Math.max(...A))*2+4,x=ID(A.map(N=>b[N]),p),k=A.length*C;t-i<k&&(o+=a+Fg,a=0,i=0);let _=o,P=i;x>a&&(a=x),i+=k+HD,i>=t&&(o+=a+Fg,a=0,i=0),s.push({...c,width:x,height:k,left:_,top:P})}else{let{labels:b}=c,C=o5t,x=t-i;x<C&&(x=t,o+=a+Fg,a=0,i=0);let k=s5t(A,x,t,C),_=ID([],p),P=a===0,N=o+_+Fg;k.forEach((I,F)=>{let Q=F===k.length-1,Z=F>0?"":p,ee=F>0?`${v}_${F}`:v,le=ID(I.map(Y=>b[Y]),P&&!Q?"":Z),z=I.length*C,U=o,G=i;le>a&&(a=le),Q?i+=z+HD:i=t,i>=t&&(o+=a+Fg,P&&Q&&o<N&&(o=N),a=0,i=0),s.push({...c,id:ee,title:Z,width:le,height:z,left:U,top:G,values:I})})}}),s}function u5t(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 c5t(e,t,n,r,a,i,o,s,c,f,A){let p=e==="vertical",v=o.includes("left")||p&&!(s!=null&&s.sharedY)||!p&&!(s!=null&&s.sharedX),y=o.includes("left")&&n.title!=="",b=o.includes("bottom")||p&&!(s!=null&&s.sharedX)||!p&&!(s!=null&&s.sharedY),C=o.includes("bottom")&&t.title!=="",x=r.yAxisCaptionsWidth,k=(n.showTicks?l2:0)+(n.hiddenLabels?0:Ff),_=y?u1:0,P=r.xAxisCaptionsWidthByRows[p?c:f],N=(t.showTicks?l2:0)+(t.hiddenLabels?0:Ff),I=C?u1:0,F=p?x+k+_:P+N+I,Q=p?N+P+I:k+2*u1,Z=Math.max(...a.map(ee=>i[ee].length));return{left:v?F:kD,top:Z===0?0:p7t*2+Z*b4,bottom:b?Q:kD,right:A?0:kD}}function f5t(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 _K(e,t,n){let r=[];for(let a=0;a<t;a++)r.push(e.slice(a*n,a*n+n));return r}function d5t(e,t){let n=Math.floor(e/t),r=e-n*t;return[n,r]}function A5t(e){return typeof e=="object"&&"type"in e}var p5t=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:Y7().range([0,600]).domain(["1"])},xSecondary:{null:Y7().range([0,600]).domain(["1"])},y:{null:Zr().domain([0,10]).range([350,0]).nice()},xPrimaryAes:zo().unknown(fK),xSecondaryAes:zo().unknown(fK)});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=Gh(this.rootNode))}updateChartSize(e,t,n,r,a,i){let o=e.innerOffset,s=e.innerOffset,c=kK(i,r,e.innerOffset),f=t.length,A=Math.min((n==null?void 0:n.nRows)??f,f),p=Math.min((n==null?void 0:n.nCols)??f,f);this.columnsCount=n!=null&&n.nRows?Math.ceil(f/A):p,this.rowsCount=Math.ceil(f/this.columnsCount);let{width:v,height:y}=e;a==="vertical"&&c>o&&(y+=c),a==="horizontal"&&c>s&&(v+=c),this.chartSizes.chartWidth=v,this.chartSizes.chartHeight=y}updateChartDimensions(e,t,n,r,a){let{chartWidth:i,chartHeight:o}=this.chartSizes,s=0,c=0;this.chartsDimensions=e.reduce((p,v,y)=>{let[b,C]=d5t(y,this.columnsCount),x=u5t(y,e.length,this.columnsCount,this.rowsCount),k=c5t(n,r,a,this.captionsSizes,_K(e,this.rowsCount,this.columnsCount)[b],this.facetTitles,x,t,b,C,C===this.columnsCount-1),_=i+k.left+k.right,P=o+k.top+k.bottom;return p[v]={left:s,top:c,chartEdgeSides:x,padding:k,inner:{width:i,height:o},outer:{width:_,height:P}},s+=_,C===this.columnsCount-1&&(s=0,c+=P),p},{});let f=Math.max(...e.map(p=>this.chartsDimensions[p].outer.width+this.chartsDimensions[p].left)),A=Math.max(...e.map(p=>this.chartsDimensions[p].outer.height+this.chartsDimensions[p].top));this.chartSizes.chartsWidth=f,this.chartSizes.chartsHeight=A}updateViewport(e,t,n,r,a,i,o,s,c,f){let A=c.innerOffset,p=e==="vertical",v=kK(s,t,c.innerOffset),y=a===null||a.sharedX,b=a===null||a.sharedY,{chartHeight:C,chartWidth:x}=this.chartSizes;r.forEach(k=>{let _=i.scale==="log"?Um():Zr(),P=Math.min(...b?o.map(({meta:Q})=>Q.minY):o.map(({geoms:Q})=>Math.min(...Q[k].map(({boundsY:Z})=>Z.min)))),N=Math.max(...b?o.map(({meta:Q})=>Q.maxY):o.map(({geoms:Q})=>Math.max(...Q[k].map(({boundsY:Z})=>Z.max)))),I=_.copy().domain([P,N]).range(p?[C-A,v]:[A,x-v]);_.domain([I.invert(p?C:0),I.invert(p?0:x)]).range(p?[C,0]:[0,x]),this.scales.y[k]=_;let F=y?t:f[k];this.scales.xPrimary[k]=Y7().domain(F).range(p?[0,x]:[C,0]),this.scales.xSecondary[k]=Y7().domain(n).range([0,this.scales.xPrimary[k].bandwidth()])})}createFacetTitles(e,t){this.facetTitles=e.reduce((n,r,a)=>(t[a].length===1&&t[a][0]==="null"?n[r]=[]:n[r]=Uv(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=Uv(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)/TD:c/TD)}this.axisLabelsX=e.reduce((s,c)=>{let f=this.scales.xPrimary[c],A=f.bandwidth(),p=a[t.labelsPosition],v=t.labelsPosition==="center"?Math.min(p,A):p,y=n.valueLabels;return s[c]=f.domain().reduce((b,C)=>{if(t.hiddenLabels)return b[C]=[],b;let x=y[C];if(!i)b[C]=[x];else{let k=o(t.labelsPosition,A),_=Uv(x,v,14);b[C]=_.length>k?[x]:_}return b},{}),s},{})}updateAesScales(e,t){if(e.inheritedAes){let{inheritedAes:n,keys:r}=e;this.scales.xPrimaryAes.domain(r).range(r.map(a=>n[a]))}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]))}else this.scales.xSecondaryAes.domain([]).range([])}updateCaptionsSize(e,t,n,r){let a=new Ac("600 14px Manrope"),i=e==="vertical";function o(b){return b.length?Math.max(...b.map(C=>a.getTextWidth(C))):0}function s(b){return b.length?Math.max(...b.map(o)):0}let c=[],f=0,A=_K(t,this.rowsCount,this.columnsCount),p=f5t(t,this.rowsCount,this.columnsCount);if(!i)c=p.map(b=>Math.max(...b.map(C=>s(this.scales.xPrimary[C].domain().map(x=>this.axisLabelsX[C][x])))));else{if(n.labelsPosition==="center"&&(c=A.map(b=>Math.max(...b.map(C=>Math.max(...this.scales.xPrimary[C].domain().map(x=>x?this.axisLabelsX[C][x].length*TD:0)))))),n.labelsPosition==="45deg"){let b=Math.sin(Math.PI/4);c=A.map(C=>Math.max(...C.map(x=>{let k=this.scales.xPrimary[x].domain().map(P=>this.axisLabelsX[x][P]),_=s(k);return _>0?_*b+14:0}))),f=Math.max(...p[0].map(C=>{let x=this.scales.xPrimary[C].domain(),k=this.axisLabelsX[C][x[0]];return Math.max(o(k)*b-this.scales.xPrimary[C].bandwidth()/2+14,0)}))}n.labelsPosition==="90deg"&&(c=A.map(b=>Math.max(...b.map(C=>s(this.scales.xPrimary[C].domain().map(x=>this.axisLabelsX[C][x]))))))}let v=Zn.flatten(t.map(b=>{if(r.hiddenLabels)return[];let C=this.scales.y[b],x=C.ticks(),k=x.some(P=>Math.abs(P)<1e-4&&P!==0||P>1e4)?",e":",f",_=C.tickFormat(10,k);return x.map(_)})),y=o(v);this.captionsSizes={xCaptionsTail:f,xAxisCaptionsWidthByRows:c,yAxisCaptionsWidth:y}}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(b,C){return r.some(x=>{let k=x.aes[C];return k&&A5t(k)&&k.type===b})}function c(b){return{dotFill:s(b,"dotFill"),fillColor:s(b,"fillColor"),lineColor:s(b,"lineColor"),dotShape:s(b,"dotShape"),lineShape:s(b,"lineShape")}}let f=c("primaryGrouping"),A=c("secondaryGrouping");if(Object.values(f).some(b=>b)&&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(b=>b)&&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 p=y2(o,this.chartSizes.chartHeight),v=p[p.length-1],y=v.left+v.width+AK;this.legend={width:y,height:a,items:p}}render(e,t,n,r,a,i,o,s,c,f,A,p,v){var _;let{orientation:y,xAxis:b,yAxis:C,size:x}=t;this.updateChartSize(x,i,a,n.keys,y,c),this.updateViewport(y,n.keys,r.keys,i,a,C,s,c,x,A),this.createAxisLabels(i,b,n,y),this.createFacetTitles(i,o),this.updateCaptionsSize(y,i,b,C),this.updateChartDimensions(i,a,y,b,C),this.updateLegendSize(t.legend,n,r,s),this.createMainTitle(i,t.title),this.updateMargins(y,i,x),this.updateAesScales(n,r);let k=ie.jsx(a5t,{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:p,secondaryGrouping:r,onTooltipHintSwitch:v});this.component=k,(_=this.reactRoot)==null||_.render(k)}renderError(e){var t;(t=this.reactRoot)==null||t.render(ie.jsx(zv,{message:e}))}},h5t=p5t;function v5t(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 m5t=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 p=I=>Number(I[t]);this.primaryGrouping=a===null?"":String(a),this.secondaryGrouping=i===null?"":String(i),this.key=`box_${this.primaryGrouping}_${this.secondaryGrouping}`;let v=I=>r==="log"?Math.log10(I):I,y=I=>r==="log"?Math.pow(10,I):I,b=v5t(e,p,v,r==="log"),C=Dp(b,o),x=Dp(b,s),k=Dp(b,c),_=k-C;this.upper=y(k),this.middle=y(x),this.lower=y(C),this.min=Math.max(bC(e,p),y(C-f*_)),this.max=Math.min(Rh(e,p),y(k+f*_)),this.outliers=e.filter(I=>p(I)<this.min||p(I)>this.max).map((I,F)=>({y:p(I),data:I,id:String(n?I[n]:F)}));let[P=1/0,N=-1/0]=_p(this.outliers,I=>I.y);this.boundsY={min:A?Math.min(this.min,P):this.min,max:A?Math.max(this.max,N):this.max}}};function g5t(e,t,n,r,a,i,o,s){let c=1/0,f=-1/0;return{type:"box",geoms:t.reduce((A,p)=>{let v=p.join("_");return A[v]=[],n.forEach(y=>{r.forEach(b=>{let C=a.getRowsByGrouping([...p,y,b]);if(!C.length)return;let x=new m5t(C,i.value,(o==null?void 0:o.value)??null,s.scale,y,b,e.stat.lower,e.stat.medium,e.stat.upper,e.stat.k,e.aes.showOutliers);x.boundsY.min<c&&(c=x.boundsY.min),x.boundsY.max>f&&(f=x.boundsY.max),A[v].push(x)})}),A},{}),meta:{minY:c,maxY:f},aes:e.aes}}var DK=40;function y5t(e,t){return function(n){return t.map(function(r){return[r,Ls(n,a=>e(r-a))]})}}function w5t(e){return function(t){return 1/Math.sqrt(2*Math.PI)*Math.pow(Math.E,-.5*Math.pow(t/e,2))}}function C5t(e){let t=Ls(e);return Ls(e.map(n=>Math.pow(n-t,2)))}function b5t(e){return Math.sqrt(C5t(e))}function E5t(e,t,n){let r=(n-t)/1.34,a=b5t(e);return 1.06*Math.min(a,r)*Math.pow(e.length,-1/5)}var x5t=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=a===null?"":String(a),this.secondaryGrouping=i===null?"":String(i),this.key=`violin_${this.primaryGrouping}_${this.secondaryGrouping}`;let o=I=>t==="log"?Math.log10(I):I,s=I=>t==="log"?Math.pow(10,I):I,c=e.filter(I=>t==="log"&&Number(I)===0?(console.warn("Value = 0 on chart with log scale, it was removed from calculation"),!1):!0).map(o).sort((I,F)=>I-F),f=c[0],A=c[c.length-1],p=A-f,v=Dp(c,.25),y=Dp(c,.5),b=Dp(c,.75);this.quartiles={q1:s(v),q2:s(y),q3:s(b)};let C=E5t(c,v,b),x=r!=="auto"?r:C/3>p/DK?DK:p/(C/3),k=n?f:f-3*C,_=n?A:A+3*C,P=Zr().domain([k,_]).ticks(x);this.boundsY={min:s(P[0]),max:s(P[P.length-1])};let N=y5t(w5t(C),P)(c).map(([I,F])=>[s(I),F]);this.maxDensity=Rh(N,([,I])=>I),this.getArea=(I,F,Q,Z)=>{let ee=I==="vertical",le=Z??this.maxDensity,z=Zr().domain([-le,le]).range([-Q/2,Q/2]);return ee?jB().curve(yy).x0(U=>z(U[1])).x1(U=>z(-U[1])).y(U=>F(U[0]))(N):jB().curve(yy).y0(U=>z(U[1])).y1(U=>z(-U[1])).x(U=>F(U[0]))(N)},this.getLine=(I,F,Q,Z)=>{let ee=I==="vertical",le=Z??this.maxDensity,z=Zr().domain([-le,le]).range([-Q/2,Q/2]);return gy().curve(yy).x(ee?U=>z(U[1]):U=>F(U[0])).y(ee?U=>F(U[0]):U=>z(U[1]))(N)+" "+gy().curve(yy).x(ee?U=>z(-U[1]):U=>F(U[0])).y(ee?U=>F(U[0]):U=>z(-U[1]))(N)}}};function S5t(e,t,n,r,a,i,o){let s=0,c=1/0,f=-1/0;return{type:"violin",geoms:t.reduce((A,p)=>{let v=p.join("_");return A[v]=[],n.forEach(y=>{r.forEach(b=>{let C=a.getColumnByGrouping([...p,y,b],i.value);if(!C.length)return;let x=new x5t(C,o.scale,e.stat.trim,e.stat.stepsCount,y,b);x.maxDensity>s&&(s=x.maxDensity),x.boundsY.min<c&&(c=x.boundsY.min),x.boundsY.max>f&&(f=x.boundsY.max),A[v].push(x)})}),A},{}),meta:{maxDensity:s,minY:c,maxY:f},aes:e.aes}}var B5t=30;function k5t(e,t){return function(n){return t.map(function(r){return Ls(n,a=>e(r-a))})}}function T5t(e){return function(t){return 1/Math.sqrt(2*Math.PI)*Math.pow(Math.E,-.5*Math.pow(t/e,2))}}function _5t(e){let t=Ls(e);return Ls(e.map(n=>Math.pow(n-t,2)))}function D5t(e){return Math.sqrt(_5t(e))}function P5t(e){let t=Dp(e,.25),n=(Dp(e,.75)-t)/1.34,r=D5t(e);return 1.06*Math.min(r,n)*Math.pow(e.length,-1/5)}var M5t=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=B5t;if(e.length===0)throw Error("Unable to calculate sina on empty data");this.primaryGrouping=r===null?"":String(r),this.secondaryGrouping=a===null?"":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,N)=>s(f(P))-s(f(N))),p=A.map(P=>s(f(P))),v=p[0],y=p[A.length-1],b=(y-v)/o,C=P5t(p),x=Zn.range(v+b,y,b);this.boundsY={min:c(v),max:c(y)};let k=k5t(T5t(C),x)(p),_=Zr().domain(x).range(k).clamp(!0);this.maxDensity=Rh(k),this.points=A.map((P,N)=>({x:f(P),y:_(s(f(P)))/this.maxDensity,id:String(N),jitter:i(),data:P}))}};function H5t(e,t,n,r,a,i,o){let s=0,c=1/0,f=-1/0,A=AF(1);return{type:"sina",geoms:t.reduce((p,v)=>{let y=v.join("_");return p[y]=[],n.forEach(b=>{r.forEach(C=>{let x=a.getRowsByGrouping([...v,b,C]);if(!x.length)return;let k=x;if(!e.aes.showOutliers){let P=F=>Number(F[i.value]),[N,I]=g2(x,o.scale,P);k=x.filter(F=>{let Q=P(F);return Q>=N&&Q<=I})}let _=new M5t(k,i,o.scale,b,C,A);_.maxDensity>s&&(s=_.maxDensity),_.boundsY.min<c&&(c=_.boundsY.min),_.boundsY.max>f&&(f=_.boundsY.max),p[y].push(_)})}),p},{}),meta:{maxDensity:s,minY:c,maxY:f},aes:e.aes}}function I5t(e,t,n,r,a,i,o,s){let c=1/0,f=-1/0,A=AF(1);return{type:"dot",geoms:t.reduce((p,v)=>{let y=v.join("_");return p[y]=[],n.forEach(b=>{r.forEach(C=>{let x=a.getRowsByGrouping([...v,b,C]);if(!x.length)return;let k=I=>Number(I[i.value]),_=x.map((I,F)=>({y:k(I),jitter:A(),id:String(s?I[s.value]:F),data:I}));if(!e.aes.showOutliers){let[I,F]=g2(x,o.scale,k);_=_.filter(({y:Q})=>Q>=I&&Q<=F)}let[P=1/0,N=-1/0]=_p(_,I=>I.y);P<c&&(c=P),N>f&&(f=N),p[y].push({key:`dots_${b}_${C}`,values:_,primaryGrouping:b,secondaryGrouping:C,boundsY:{min:P,max:N}})})}),p},{}),meta:{minY:c,maxY:f},aes:e.aes}}function R5t(e,t){if(t==="median")return _R(e,.5);if(t==="mean")return Ls(e);uA(t,`Unknown line points calculation for dot layer: ${t}`)}function N5t(e,t,n,r,a,i,o){let s=1/0,c=-1/0;return{type:"line",geoms:t.reduce((f,A)=>{let p=A.join("_");f[p]=[];let v=-1/0,y=1/0;return e.aes.showOutliers||([v,y]=g2(a.getColumnByGrouping([...A],i.value),o.scale)),r.forEach(b=>{let C={key:`${b}`,boundsY:{min:1/0,max:-1/0},dots:{}},x=!1,k=P=>o.scale==="log"?Math.log10(P):P,_=P=>o.scale==="log"?Math.pow(10,P):P;n.forEach(P=>{let N=a.getColumnByGrouping([...A,P,b],i.value);if(!N.length){x=!0;return}let I=N;if(e.aes.showOutliers||(I=N.filter(Q=>Q>=v&&Q<=y)),!I.length){x=!0;return}let F=_(R5t(I.map(k),e.pointsValues));C.dots[P]=F,F<s&&(s=F),F>c&&(c=F),F<C.boundsY.min&&(C.boundsY.min=F),F>C.boundsY.max&&(C.boundsY.max=F)}),x||f[p].push(C)}),f},{}),meta:{minY:s,maxY:c},aes:e.aes}}function L5t(e){let t=Ls(e);return Ls(e.map(n=>Math.pow(n-t,2)))}function RD(e){return Math.sqrt(L5t(e))}function $5t(e){return RD(e)/Math.sqrt(e.length)}function F5t(e){return 1.96*RD(e)}function V5t(e,t){if(t==="median")return _R(e,.5);if(t==="mean")return Ls(e);uA(t,"Unknown points calculation")}function O5t(e,t){if(t==="sd")return RD(e);if(t==="se")return $5t(e);if(t==="ci")return F5t(e);uA(t,"Unknown error interval calculation")}function Q5t(e,t,n,r,a,i,o){let s=1/0,c=-1/0;return{type:"errorbar",geoms:t.reduce((f,A)=>{let p=A.join("_");f[p]=[];let v=b=>o.scale==="log"?Math.log10(b):b,y=b=>o.scale==="log"?Math.pow(10,b):b;return n.forEach(b=>{r.forEach(C=>{let x=a.getColumnByGrouping([...A,b,C],i.value);if(!x.length)return;let k=x.map(v),_=y(V5t(k,e.pointsValues)),P=y(O5t(k,e.interval)),N=_-P,I=_+P;N<s&&(s=N),I>c&&(c=I),f[p].push({key:`errorbar_${b}_${C}`,primaryGrouping:b,secondaryGrouping:C,value:_,min:N,max:I,boundsY:{min:N,max:I}})})}),f},{}),meta:{minY:s,maxY:c},aes:e.aes}}function z5t(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 Rh(e,o)??o(e[0]);case"min":return bC(e,o)??o(e[0]);case"median":{let s=e.map(c=>Number(c[n])).map(a).sort((c,f)=>c-f);return i(Dp(s,.5))}case"mean":return Ls(e,o)??o(e[0]);default:uA(r,`Unknown bar height function ${r}`)}}function U5t(e,t,n,r,a,i,o){let s=-1/0,c=1/0;return{type:"bar",geoms:t.reduce((f,A)=>{let p=A.join("_");return f[p]=[],n.forEach(v=>{r.forEach(y=>{let b=a.getRowsByGrouping([...A,v,y]);if(!b.length)return;let C=z5t(b,o.scale,i.value,e.height);s=Math.max(s,C,0),c=Math.min(c,C,0),f[p].push({key:`bar_${v}_${y}`,value:C,primaryGrouping:v,secondaryGrouping:y,boundsY:{min:Math.min(0,C),max:Math.max(0,C)}})})}),f},{}),meta:{minY:c,maxY:s},aes:e.aes}}function G5t(e,t,n,r,a,i){let o=-1/0,s=1/0;return{type:"stackedBar",geoms:t.reduce((c,f)=>{let A=f.join("_");return c[A]=[],n.forEach(p=>{let v=0,y={};r.forEach(x=>{let k=a.getRowsByGrouping([...f,p,x]);if(!k.length)return;let _=oc(k,P=>Number(P[i.value]));y[x]={height:_,key:x},v+=_});let b=v;e.normalize&&r.forEach(x=>{y[x]&&(y[x].height=y[x].height/b*100)}),o=Math.max(o,0,v),s=Math.min(s,0,v);let C=e.normalize?100:b;c[A].push({key:`stackedBar_${p}`,valuesMap:y,primaryGrouping:p,boundsY:{min:Math.min(C,0),max:Math.max(C,0)}})}),c},{}),meta:{minY:e.normalize?0:s,maxY:e.normalize?100:o,normalize:e.normalize},aes:e.aes}}var PK=30;function j5t(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,y){return{key:i(v,y),value:a(v)}}let p=0;for(let v=1;v<s;++v){let y=o[p],b=o[v],C=o[v-1];if(b>=y+t){let x=Math.min((y+C)/2,b-t);o.fill(x,p,v),f.push({x:r(x),count:v-p,dots:c.slice(p,v)}),p=v}}return o.fill((o[p]+o[s-1])/2,p,s),f.push({x:r((o[p]+o[s-1])/2),count:s-p,dots:c.slice(p,s)}),f}var Y5t=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=n===null?"":String(n),this.secondaryGrouping=r===null?"":String(r),this.key=`binnedDots_${this.primaryGrouping}_${this.secondaryGrouping}`;let A=e.filter(p=>s(p)===0&&c==="log"?(console.warn(`Item with ${t} = 0 is not shown on chart with log scale`),!1):!0).sort((p,v)=>i(s(p))-i(s(v)));this.bins=j5t(A,a,i,o,s,(p,v)=>String(f?p[f.value]:v)),this.boundsY={min:this.bins[0].x,max:this.bins[this.bins.length-1].x}}};function W5t(e,t,n,r,a,i,o){let s=x=>o.scale==="log"?Math.log10(x):x,c=x=>o.scale==="log"?Math.pow(10,x):x,f=x=>Number(x[i.value]),A=1/0,p=-1/0,v=a.getRowsByGrouping([]),[y=f(v[0]),b=f(v[0])]=_p(v.filter(x=>Number(x[i.value])===0&&o.scale==="log"?(console.warn(`Item with ${i.value} = 0 is not shown on chart with log scale`),!1):!0),x=>Number(x[i.value])),C=Math.abs(s(y)-s(b))/PK;return{type:"binnedDots",geoms:t.reduce((x,k)=>{let _=k.join("_");return x[_]=[],n.forEach(P=>{r.forEach(N=>{let I=a.getRowsByGrouping([...k,P,N]);if(!I.length)return;let F=I;if(!e.aes.showOutliers){let[Z,ee]=g2(I,o.scale,f);F=I.filter(le=>{let z=f(le);return z>=Z&&z<=ee})}let Q=new Y5t(F,i.value,P,N,C,s,c,f,o.scale,e.keyColumn);Q.boundsY.min<A&&(A=Q.boundsY.min),Q.boundsY.max>p&&(p=Q.boundsY.max),x[_].push(Q)})}),x},{}),meta:{minY:Math.min(y,b,A),maxY:Math.max(y,b,p),binsCount:PK,hasKeyFromColumn:e.keyColumn!==null},aes:e.aes}}function X5t(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 MK(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]),p=Object.keys(f),v=Object.keys(A);if(Zn.uniq(p).length!==p.length||Zn.uniq(v).length!==v.length)throw Error(`Non unique keys in groups ${e}, ${t} for paired points layer`);if(p.length!==v.length||Zn.intersection(p,v).length!==p.length)throw Error(`Keys in groups ${e}, ${t} not match for paired points layer`);let y=P=>Number(P[i.value]),b=1/0,C=-1/0,x=!1,k=c==="log",_=p.map(P=>{let N=f[P][0],I=A[P][0],F=y(N),Q=y(I);return(F===0||Q===0)&&(x=!0),b=Math.min(b,k&&F===0?1/0:F,k&&Q===0?1/0:Q),C=Math.max(C,k&&F===0?-1/0:F,k&&Q===0?-1/0:Q),{id:P,key1:{id:`${P}_${e}`,value:F,data:N},key2:{id:`${P}_${t}`,value:Q,data:I}}});if(!s){b=1/0,C=-1/0;let[P,N]=g2(n,c,y),[I,F]=g2(r,c,y);_=_.filter(({key1:Q,key2:Z})=>Q.value<P||Q.value>N||Z.value<I||Z.value>F?!1:(b=Math.min(b,k&&Q.value===0?1/0:Q.value,k&&Z.value===0?1/0:Z.value),C=Math.max(C,k&&Q.value===0?-1/0:Q.value,k&&Z.value===0?-1/0:Z.value),!0))}return b=x?b/10:b,C=Math.max(C,b),{id:`${e}_${t}`,key1:e,key2:t,pairs:_.map(P=>({...P,key1:{...P.key1,value:P.key1.value===0?b:P.key1.value},key2:{...P.key2,value:P.key2.value===0?b:P.key2.value}})),grouping:o,boundsY:{min:b,max:C}}}function K5t(e,t,n,r,a,i,o){let s=X5t(n,r),c=1/0,f=-1/0;return{type:"pairedPoints",geoms:t.reduce((A,p)=>{let v=p.join("_");if(A[v]=[],s==="primary"){let[y,b]=n,C=a.getRowsByGrouping([...p,y]),x=a.getRowsByGrouping([...p,b]),k=MK(y,b,C,x,e.linkColumn,i,s,e.aes.showOutliers,o.scale);c=Math.min(c,k.boundsY.min),f=Math.max(f,k.boundsY.max),A[v].push(k)}else s==="secondary"&&n.forEach(y=>{let[b,C]=r,x=a.getRowsByGrouping([...p,y,b]),k=a.getRowsByGrouping([...p,y,C]),_=MK(b,C,x,k,e.linkColumn,i,s,e.aes.showOutliers,o.scale);c=Math.min(c,_.boundsY.min),f=Math.max(f,_.boundsY.max),A[v].push(_)});return A},{}),meta:{minY:c,maxY:f},aes:e.aes}}function HK(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 w2(e,t){return Zn.orderBy(e.map((n,r)=>[n,r]),([n])=>n,[t?"desc":"asc"]).map(([,n])=>n)}function Z5t(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 J5t(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 IK(e,t){if(e.length<1)throw new Error("pmin requires at least one element");return e.map(n=>Math.min(n,t))}function q5t(e){if(e.length<1)throw new Error("pAdjust requires at least one element");return Math.min(...e)}function e9t(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 t9t(e){let t=e.length;if(t<1)throw new Error("pAdjust requires at least one element");let n=w2(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=w2(r,!1),o=J5t(a),s=IK(o,1),c=new Array(t);for(let f=0;f<t;++f)c[f]=s[i[f]];return c}function n9t(e){let t=e.length;if(t<1)throw new Error("pAdjust requires at least one element");let n=HK(t,t),r=w2(e,!1),a=new Array(t);for(let p=0;p<t;++p)a[p]=e[r[p]];let i=r.slice(),o=w2(i,!1),s=new Array(t),c=new Array(t),f=new Array(t);for(let p=0;p<t;++p)f[p]=a[p]*t/n[p];let A=q5t(f);s.fill(A),c.fill(A);for(let p=t;p>=2;--p){let v=HK(1,t-p+1);for(let x=0;x<t-p+1;++x)v[x]--;let y=p-1,b=new Array(y);for(let x=0;x<y;++x)b[x]=t-p+2+x-1;let C=p*a[b[0]]/2;for(let x=1;x<y;++x){let k=a[b[x]]*p/(2+x);k<C&&(C=k)}for(let x=0;x<t-p+1;++x)s[v[x]]=Math.min(a[v[x]]*p,C);for(let x=0;x<y;++x)s[b[x]]=s[t-p];for(let x=0;x<t;++x)c[x]<s[x]&&(c[x]=s[x])}for(let p=0;p<t;++p)s[p]=c[o[p]];return s}var r9t=class{constructor(e,t,n){this.ni=e,this.o=t,this.ro=n}result(e){let t=Z5t(e),n=IK(t,1),r=new Array(e.length);for(let a=0;a<e.length;++a)r[a]=n[this.ro[a]];return r}};function ND(e){let t=e.length,n=new Array(t),r=w2(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=w2(r,!1);return new r9t(n,r,a)}function a9t(e){let t=e.length;if(t<1)throw new Error("pAdjust requires at least one element");let n=ND(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 i9t(e){let t=e.length;if(t<1)throw new Error("pAdjust requires at least one element");let n=ND(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 o9t(e){let t=e.length;if(t<1)throw new Error("pAdjust requires at least one element");let n=ND(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 RK(e,t){switch(t){case"BenjaminiHochberg":return a9t(e);case"BenjaminiYekutieli":return i9t(e);case"Bonferroni":return e9t(e);case"Hochberg":return o9t(e);case"Holm":return t9t(e);case"Hommel":return n9t(e);case null:return e;default:throw new Error(`Unknown p-value correction method: ${t}`)}}function l9t(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 s9t(e){return .5*l9t(-e/Math.sqrt(2))}var u9t=class{constructor(e,t){this.value=e,this.position=t}getValue(){return this.value}getPosition(){return this.position}};function c9t(e){let t=new Array(e.length);for(let o=0;o<e.length;o++)t[o]=new u9t(e[o],o);let n=d9t(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&&NK(r,i),i=[]),i.push(t[o].getPosition()),r[t[o].getPosition()]=a;return i.length>1&&NK(r,i),f9t(r,n),r}function NK(e,t){let n=(2*e[t[0]]+t.length-1)/2;t.forEach(r=>{e[r]=n})}function f9t(e,t){t.forEach(n=>{e[n]=NaN})}function d9t(e){let t=[];for(let n=0;n<e.length;n++)isNaN(e[n].getValue())&&t.push(n);return t}var A9t=class{constructor(){Be(this,"SMALL_SAMPLE_SIZE",50)}mannWhitneyU(e,t){let n=[...e,...t],r=c9t(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*s9t(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 p=1;p<=f;p++){A++,c=c-1;let v=a[p]+i[p];a[p]=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 LD(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 Lot(e[0],e[1]).pValue}let r=tlt(e[0],e[1]).pValue;return isNaN(r)?1:r}case"anova":{let r=QGe(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 A9t().mannWhitneyUTest(e[0],e[1]);return isNaN(r)?1:r}case"kruskalWallis":{let r=Ect(...e).pValue;return isNaN(r)?1:r}default:throw new Error("Unknown test method")}}function p9t(e){return e.slice(0,-1).reduce((t,n,r)=>t.concat(e.slice(r+1).map(a=>[n,a])),[])}function h9t(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=LD(c,e.testMethod,e.paired);s=[[["overall"],f]];break}case"referenceGroup":{let c=e.referenceGroup===null?null:String(e.referenceGroup);if(c!==null&&!n.includes(c))throw new Error(`Reference group ${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 p=RK(A.map(([,v])=>LD([f,v],e.testMethod,e.paired)),e.correctionMethod);s=A.map(([v],y)=>[[v],p[y]]);break}case"pairwise":{let c=p9t(n).map(([A,p])=>[[A,p],[a.getColumnByGrouping([...o,A],r.value),a.getColumnByGrouping([...o,p],r.value)]]).filter(([,[A,p]])=>A.length&&p.length);if(c.length<1)break;let f=RK(c.map(([,A])=>LD(A,e.testMethod,e.paired)),e.correctionMethod);s=c.map(([A],p)=>[A,f[p]]);break}default:throw new Error("Unknown statType")}return i[o.join("_")]=s,i},{}),meta:{statType:e.statType,testMethod:e.testMethod,format:e.format,ns:e.ns,significanceLevels:e.significanceLevels}}}var S4="#3e9838",C2="21",b2=3,KA=class{},LK=class extends KA{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:C2,dotFill:$t,dotSize:b2,lineColor:$t,fillColor:S4,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])}},$K=class extends KA{constructor(t){super();Be(this,"type","violin");Be(this,"stat",{bandwidth:"auto",stepsCount:40,trim:!0});Be(this,"aes",{width:"auto",lineColor:$t,fillColor:S4,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)}},FK=class extends KA{constructor(t){super();Be(this,"type","dot");Be(this,"aes",{showOutliers:!0,jitter:.8,lineColor:"none",dotFill:$t,dotShape:C2,dotSize:b2,opacity:1});this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="dot"&&this.aes.showOutliers===t.aes.showOutliers}},VK=class extends KA{constructor(t){super();Be(this,"type","line");Be(this,"pointsValues");Be(this,"aes",{showOutliers:!0,lineWidth:1,lineShape:"solid",fillColor:"none",lineColor:$t,dotShape:C2,dotSize:b2,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 KA{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:$t,dotShape:C2,dotSize:b2,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}},QK=class extends KA{constructor(t){super();Be(this,"type","bar");Be(this,"height");Be(this,"aes",{width:"auto",lineWidth:1,fillColor:"none",lineColor:$t,opacity:1});this.height=t.height??"max",this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="bar"&&this.height===t.height}},zK=class extends KA{constructor(t){super();Be(this,"type","stackedBar");Be(this,"normalize",!1);Be(this,"aes",{width:"auto",lineWidth:1,fillColor:S4,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}},UK=class extends KA{constructor(t){super();Be(this,"type","logo");Be(this,"normalize",!1);Be(this,"aes",{width:"auto",fillColor:S4,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}},GK=class extends KA{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:$t,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)}},jK=class extends KA{constructor(t){super();Be(this,"type","pairedPoints");Be(this,"linkColumn");Be(this,"aes",{showOutliers:!0,lineWidth:1,lineColor:$t,lineShape:"solid",dotFill:$t,dotSize:b2,dotShape:C2,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 KA{constructor(t){super();Be(this,"type","sina");Be(this,"aes",{showOutliers:!0,width:"auto",dotFill:S4,dotSize:b2,dotShape:C2,opacity:1});this.aes={...this.aes,...t.aes}}isEqualForCalculation(t){return t.type==="sina"&&this.aes.showOutliers===t.aes.showOutliers}},aE=class extends KA{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;p2t.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)??h7t,innerOffset:((a=e==null?void 0:e.size)==null?void 0:a.innerOffset)??A7t.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(p=>{if(p.type==="box")return new LK(p);if(p.type==="violin")return new $K(p);if(p.type==="dot")return new FK(p);if(p.type==="line")return new VK(p);if(p.type==="errorbar")return new OK(p);if(p.type==="bar")return new QK(p);if(p.type==="stackedBar")return new zK(p);if(p.type==="stat")return new aE(p);if(p.type==="binnedDots")return new GK(p);if(p.type==="pairedPoints")return new jK(p);if(p.type==="sina")return new YK(p);if(p.type==="logo")return new UK(p);uA(p,"Unknown layer type")}).filter(Boolean)}};function XK(e,t=null,n=null){let r=(t==null?void 0:t.value)??null,a=r===null?["null"]:e.getColumnCategories(r);return Zn.intersection(n??a,a).map(String)}function KK(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 iE(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=r.map(a),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 v9t=class extends Rg{constructor(t,n,r){super(t,n);Be(this,"settings");Be(this,"chartRenderer",new h5t);Be(this,"onTooltipHintSwitch",()=>{});Be(this,"calculatedData",null);this.settings=new WK(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 WK(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 discrete")}export(){return this._updateChart(),my(this.chartRenderer.component)}_needUpdateCalculatedDataBySettings(t,n){var r,a,i,o;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)??"")||t.facetBy.some((s,c)=>{var f;return s.value!==((f=n.facetBy[c])==null?void 0:f.value)})||t.layers.length!==n.layers.length||t.layers.some((s,c)=>!s.isEqualForCalculation(n.layers[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{chartSettings:t,y:n,keyColumn:r,facetBy:a,layers:i,facetSettings:o}=this.settings,{yAxis:s}=t,c=this.data.rows.every(x=>{let k=x[n.value];return k===null||!(Number(k)<0)}),f=iE(this.data,this.settings.primaryGrouping),A=iE(this.data,this.settings.secondaryGrouping),p=a.map(x=>x.value)??null,v=a.length?KK(a.map(x=>{var k;return XK(this.data,x,(k=o==null?void 0:o.order)==null?void 0:k[x.value])})):[["null"]];this.data.setGrouping([...p,f.value,A.value]);let y=v.reduce((x,k)=>(x[k.join("_")]=f.keys.filter(_=>this.data.getRowsByGrouping([...k,_]).length>0),x),{}),b=i.filter(x=>!(x instanceof aE)).map(x=>{if(x instanceof LK)return g5t(x,v,f.keys,A.keys,this.data,n,r,s);if(x instanceof $K)return S5t(x,v,f.keys,A.keys,this.data,n,s);if(x instanceof FK)return I5t(x,v,f.keys,A.keys,this.data,n,s,r);if(x instanceof VK)return N5t(x,v,f.keys,A.keys,this.data,n,s);if(x instanceof OK)return Q5t(x,v,f.keys,A.keys,this.data,n,s);if(x instanceof QK)return U5t(x,v,f.keys,A.keys,this.data,n,s);if(x instanceof zK)return G5t(x,v,f.keys,A.keys,this.data,n);if(x instanceof GK)return W5t(x,v,f.keys,A.keys,this.data,n,s);if(x instanceof jK)return K5t(x,v,f.keys,A.keys,this.data,n,s);if(x instanceof YK)return H5t(x,v,f.keys,A.keys,this.data,n,s);if(x instanceof UK)return d7t(x,v,f.keys,A.keys,this.data,n);throw new Error("Unknown layer type")}),C=i.filter(x=>x instanceof aE).map(x=>{if(f.value===null)throw new Error("Cannot calculate p-value without data grouping");return h9t(x,v,f.keys,n,this.data)});this.calculatedData={layersData:b,statsLayersData:C,primaryGrouping:f,secondaryGrouping:A,facetKeyLists:v,nonEmptyGroupsByFacets:y,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 aE));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=iE(this.data,r),this.calculatedData.secondaryGrouping=iE(this.data,a),this.calculatedData.facetKeyLists=n.length?KK(n.map(s=>{var c;return XK(this.data,s,(c=i==null?void 0:i.order)==null?void 0:c[s.value])})):[["null"]]}_updateChart(){if(!this.calculatedData)return;let{id:t,chartSettings:n,keyColumn:r,facetSettings:a}=this.settings;this.chartRenderer.render(t,n,this.calculatedData.primaryGrouping,this.calculatedData.secondaryGrouping,a,this.calculatedData.facetKeyLists.map(i=>i.join("_")),this.calculatedData.facetKeyLists,this.calculatedData.layersData,this.calculatedData.statsLayersData,r,this.calculatedData.nonEmptyGroupsByFacets,this.calculatedData.onlyPositive,this.onTooltipHintSwitch)}},m9t=1e6;function g9t(e){let t=ER(e),n=Ls(e);return t===void 0||n===void 0||t===0?r=>r:r=>(r-n)/t}function y9t(e){let t=Ls(e),[n,r]=_p(e);return t===void 0||n===void 0||r===void 0||r===n?a=>a:a=>(a-t)/(r-n)}function w9t(e,t){return e==="standardScaling"?g9t(t):e==="meanNormalization"?y9t(t):n=>n}function $D(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 C9t(e,t,n,r,a,i,o,s,c,f,A,p){let v=a.length?a.map(Y=>e.getColumnCategories(Y.value)):[["null"]],y=i.length?i.map(Y=>e.getColumnCategories(Y.value)):[["null"]],b=o.length?o.map(Y=>e.getColumnCategories(Y.value)):[["null"]],C=$D(v),x=$D(y),k=$D(b),_=C.map(Y=>Y.join("_")),P=x.map(Y=>Y.join("_")),N=k.map(Y=>Y.join("_")),I={meta:{facetKeys:_,xGroupKeys:P,yGroupKeys:N,xKeysByGroups:{},yKeysByGroups:{},xLabels:{},yLabels:{},xGroupLabels:{},yGroupLabels:{},xDataByKeys:{},yDataByKeys:{},facetKeyValues:_.reduce((Y,X,te)=>(Y[X]=C[te],Y),{}),xGroupKeyValues:P.reduce((Y,X,te)=>(Y[X]=x[te],Y),{}),yGroupKeyValues:N.reduce((Y,X,te)=>(Y[X]=k[te],Y),{}),valueExtent:[1/0,-1/0]},facets:{}},F=t.valueLabels??t.value,Q=n.valueLabels??n.value,Z=s.filter(Y=>Y.axis==="x").map(Y=>Y.valueColumn.value),ee=s.filter(Y=>Y.axis==="y").map(Y=>Y.valueColumn.value),le=Object.values(c??{}).map(Y=>Y.value),z=Object.values(f??{}).map(Y=>Y.value),U=Zn.uniq([...Z,...le,F]),G=Zn.uniq([...ee,...z,Q]);if(e.rows.forEach(Y=>{let X=a.length?a.map(He=>Y[He.value]).join("_"):"null",te=i.length?i.map(He=>Y[He.value]).join("_"):"null",he=o.length?o.map(He=>Y[He.value]).join("_"):"null",ae=i.length?i.map(He=>Y[He.valueLabels??He.value]).join(", "):"",ge=o.length?o.map(He=>Y[He.valueLabels??He.value]).join(", "):"";I.meta.xGroupLabels[te]=ae,I.meta.yGroupLabels[te]=ge;let me=Y[t.value],fe=Y[n.value],be=Y[r.value]??p;if(!(me===null||fe===null||be===null)){if(I.facets[X]||(I.facets[X]={xKeys:[],yKeys:[],xKeysByGroups:{},yKeysByGroups:{},cells:{}}),I.facets[X].xKeysByGroups[te]||(I.facets[X].xKeysByGroups[te]=[]),I.facets[X].yKeysByGroups[he]||(I.facets[X].yKeysByGroups[he]=[]),I.facets[X].xKeys.push(me),I.facets[X].yKeys.push(fe),I.facets[X].xKeysByGroups[te].push(me),I.facets[X].yKeysByGroups[he].push(fe),I.facets[X].cells[me]||(I.facets[X].cells[me]={}),I.meta.valueExtent[0]=Math.min(be,I.meta.valueExtent[0]),I.meta.valueExtent[1]=Math.max(be,I.meta.valueExtent[1]),I.facets[X].cells[me][fe])throw Error(`More than 1 value for x=${me}, y=${fe}`);if(I.meta.xLabels[me]&&String(Y[F])!==I.meta.xLabels[me])throw Error(`More than 1 x-label value for x=${me}`);if(I.meta.yLabels[fe]&&String(Y[Q])!==I.meta.yLabels[fe])throw Error(`More than 1 y-label value for y=${fe}`);I.meta.xLabels[me]=String(Y[F]),I.meta.yLabels[fe]=String(Y[Q]),U.forEach(He=>{let _e=typeof I.meta.xDataByKeys[He]<"u",Ie=_e&&typeof I.meta.xDataByKeys[He][me]<"u";if(_e||(I.meta.xDataByKeys[He]={}),Ie&&I.meta.xDataByKeys[He][me]!==Y[He])throw Error(`More than 1 value for x = ${me} and column = ${He}`);Ie||(I.meta.xDataByKeys[He][me]=Y[He])}),G.forEach(He=>{let _e=typeof I.meta.yDataByKeys[He]<"u",Ie=_e&&typeof I.meta.yDataByKeys[He][fe]<"u";if(_e||(I.meta.yDataByKeys[He]={}),Ie&&I.meta.yDataByKeys[He][fe]!==Y[He])throw Error(`More than 1 value for y = ${fe} and column = ${He}`);Ie||(I.meta.yDataByKeys[He][fe]=Y[He])}),I.facets[X].cells[me][fe]={id:`${me}_${fe}`,x:me,y:fe,value:be,normalizedValue:be,data:Y}}}),I.meta.facetKeys=I.meta.facetKeys.filter(Y=>I.facets[Y]),I.meta.facetKeys.forEach(Y=>{let X=I.facets[Y];if(X.xKeys=Zn.uniq(X.xKeys),X.yKeys=Zn.uniq(X.yKeys),X.xKeys.length*X.yKeys.length>m9t)throw Error(`Too many cells for graph rendering (${X.xKeys.length*X.yKeys.length})`);P.forEach(te=>{I.facets[Y].xKeysByGroups[te]=Zn.uniq(I.facets[Y].xKeysByGroups[te])}),N.forEach(te=>{I.facets[Y].yKeysByGroups[te]=Zn.uniq(I.facets[Y].yKeysByGroups[te])})}),A){let Y=[1/0,-1/0];I.meta.facetKeys.forEach(X=>{let{xKeys:te,yKeys:he,cells:ae}=I.facets[X],ge=A.direction==="row"?te:he,me=A.direction==="row"?he:te,fe=A.direction==="row"?(be,He)=>{var _e;return(_e=ae[be])==null?void 0:_e[He]}:(be,He)=>{var _e;return(_e=ae[He])==null?void 0:_e[be]};me.forEach(be=>{let He=[];ge.forEach(Ie=>{var Oe;let Ue=(Oe=fe(Ie,be))==null?void 0:Oe.value;Ue!==void 0&&He.push(Ue)});let _e=w9t(A.method,He);ge.forEach(Ie=>{let Ue=fe(Ie,be);Ue!==void 0&&(Ue.normalizedValue=_e(Ue.value),Y[0]=Math.min(Ue.normalizedValue,Y[0]),Y[1]=Math.max(Ue.normalizedValue,Y[1]))})})}),I.meta.valueExtent=Y}return I.meta.xKeysByGroups=P.reduce((Y,X)=>(Y[X]=Zn.uniq(Zn.flatten(I.meta.facetKeys.map(te=>I.facets[te].xKeysByGroups[X]))),Y),{}),I.meta.yKeysByGroups=N.reduce((Y,X)=>(Y[X]=Zn.uniq(Zn.flatten(I.meta.facetKeys.map(te=>I.facets[te].yKeysByGroups[X]))),Y),{}),I.meta.valueExtent[0]===1/0&&(I.meta.valueExtent[0]=0),I.meta.valueExtent[1]===-1/0&&(I.meta.valueExtent[1]=0),I}function ZK(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 JK(e,t){return Math.sqrt(ZK(e,t))}var qK=(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},b9t=(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},E9t=(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 x9t(e){switch(e){case"average":return qK;case"complete":return b9t;case"single":return E9t;default:return qK}}function S9t(e){switch(e){case"euclidean":return JK;case"squaredEuclidean":return ZK;default:return JK}}function eZ(e=[],t,n="euclidean",r="average"){let a=S9t(n),i=x9t(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,p=0;for(let y=0;y<s.length;y++)for(let b=y+1;b<s.length;b++){let C=i(s[y].indexes,s[b].indexes,o);C<f&&(f=C,A=y,p=b)}let v={keys:[...s[A].keys,...s[p].keys],indexes:[...s[A].indexes,...s[p].indexes],height:f,children:[s[A],s[p]]};s.splice(Math.max(A,p),1),s.splice(Math.min(A,p),1),s.push(v)}return s[0]}function B9t(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 p=[],v=[];i.forEach(y=>{let b=A.xKeysByGroups[y],C=A.yKeys,x=eZ(b,b.map(k=>C.map(_=>{var P;return((P=A.cells[k][_])==null?void 0:P.normalizedValue)??t.fillNA})),t.distance,t.linkage);e.facets[c].xKeysByGroups[y]=x.keys,v.push(...x.keys),p.push(x)}),e.facets[c].xKeys=v,f.hierarchyX=p.map(y=>B6(y))}if(n){let p=[],v=[];o.forEach(y=>{let b=A.yKeysByGroups[y],C=A.xKeys,x=eZ(b,b.map(k=>C.map(_=>{var P;return((P=A.cells[_][k])==null?void 0:P.normalizedValue)??n.fillNA})),n.distance,n.linkage);e.facets[c].yKeysByGroups[y]=x.keys,v.push(...x.keys),p.push(x)}),e.facets[c].yKeys=v,f.hierarchyY=p.map(y=>B6(y))}s[c]=f}),s}var k9t=15,Gv=8,jv=30,T9t=48,_9t=24,E2=16,x2=4,oE=4,FD=20,D9t=16,Yc=16,S2=8,c1={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"]},tZ={fillColor:"white",lineColor:$t,lineWidth:1,lineShape:"solid",dotSize:3,dotFill:$t,dotShape:"21"};function P9t(e,t,n,r,a,i,o,s,c,f,A,p,v,y){let b=p.length>1&&(!c||o.includes(t.groupingPosition)),C=!c||o.includes(t.position),x=A.length>1&&(!s||o.includes(e.groupingPosition)),k=!s||o.includes(e.position),_=f.length>1,P=r.filter(te=>o.includes(te.position)||!s&&["left","right"].includes(te.position)||!c&&["top","bottom"].includes(te.position)),N=P.filter(te=>te.position==="left").length,I=P.filter(te=>te.position==="right").length,F=P.filter(te=>te.position==="top").length,Q=P.filter(te=>te.position==="bottom").length,Z=e.showTicks?oE:0,ee=t.showTicks?oE:0,le=k&&e.showTitle?jv:0,z=C&&t.showTitle?jv:0,U=k&&e.showAxisLabels&&v>E2?n.xAxisCaptions+Z+x2:0,G=C&&t.showAxisLabels&&y>E2?n.yAxisCaptions+ee+x2:0,Y=x&&e.showGroupLabels?n.xGroupCaptions:0,X=b&&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"?z:0,groups:t.groupingPosition==="left"?X:0,axis:t.position==="left"?G:0,annotations:N*Yc+(N&&S2)},right:{dendro:!(i!=null&&i.hidden)&&(i==null?void 0:i.position)==="right"?i.size:0,axisTitle:t.position==="right"?z:0,groups:t.groupingPosition==="right"?X:0,axis:t.position==="right"?G:0,annotations:I*Yc+(I&&S2)},top:{facetTitle:_?T9t: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"?U:0,annotations:F*Yc+(F&&S2)},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"?U:0,annotations:Q*Yc+(Q&&S2)}}}function M9t(e,t,n){return{left:c1.left.reduce((r,a,i)=>{let o=i>0?c1.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:c1.right.reduce((r,a,i)=>{let o=i>0?c1.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:c1.top.reduce((r,a,i)=>{let o=i>0?c1.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:c1.bottom.reduce((r,a,i)=>{let o=i>0?c1.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 VD(e,t,n){let r=(t-e)/n,a=Zn.range(e,t-r/2,r);return a.push(t),a}function nZ(e,t){let n=VD(0,1,e.length-1),r=Zr().domain(n).range(e),a=VD(0,1,t.length-1).map(i=>r(i));return zo().domain(t).range(a).unknown("#ccc")}function H9t(e,t,n,r,a,i){let o=VD(0,1,e.length-1),s=Zr().domain(o).range(e),c=[r,...o.filter(C=>C>r&&C<a),a],f=[a,...o.filter(C=>C>a&&C<i),i],A=(n-t)/2,p=c.map(C=>t+A*(C-r)/(a-r)),v=f.map(C=>(t+n)/2+A*(C-a)/(i-a)),y=c.map(C=>s(C)),b=f.map(C=>s(C));return Zr().domain(p.concat(v.slice(1))).range(y.concat(b.slice(1)))}var I9t=new Ac("bold 14px Arial");function lE(e){let t=0;for(let n of e){let r=I9t.getTextWidth(n);r>t&&(t=r)}return t}function R9t(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:lE(i),right:lE(o),top:lE(s),bottom:lE(c)}}function N9t(e,t,n,r,a){let{facetKeys:i,xGroupKeys:o,yGroupKeys:s,xKeysByGroups:c,yKeysByGroups:f,xLabels:A,yLabels:p}=r.meta,v=e.xGroupLabels/180*Math.PI,y=e.yGroupLabels/180*Math.PI,b=e.xAxisLabels/180*Math.PI,C=e.yAxisLabels/180*Math.PI,x=0,k=0,_=e.xGroupLabels===45,P=e.xAxisLabels===45;if(_||P)if(!t.sharedX)i.forEach(F=>{let Q=o.find(G=>r.facets[F].xKeysByGroups[G].length>0);if(!Q)return;let Z=r.facets[F].xKeysByGroups[Q],ee=n.x[F],le=ee>E2,z=Z.length*ee/2,U=A[Z[0]];x=Math.max(x,(_?a.getTextWidth(Q)*Math.cos(v):0)-z,(P&&le?a.getTextWidth(U)*Math.cos(b):0)-ee/2)});else{let F=o[0],Q=i[0];if(F){let Z=c[F],ee=n.x[Q],le=ee>E2,z=Z.length*ee/2,U=A[Z[0]];x=Math.max(x,(_?a.getTextWidth(F)*Math.cos(v):0)-z,(P&&le?a.getTextWidth(U)*Math.cos(b):0)-ee/2)}}let N=e.yGroupLabels===45,I=e.yAxisLabels===45;if(N||I)if(!t.sharedY)i.forEach(F=>{let Q=Zn.findLast(s,G=>r.facets[F].yKeysByGroups[G].length>0);if(!Q)return;let Z=r.facets[F].yKeysByGroups[Q],ee=n.y[F],le=ee>E2,z=Z.length*ee/2,U=p[Z[Z.length-1]];k=Math.max(k,(N?a.getTextWidth(Q)*Math.cos(y):0)-z,(I&&le?a.getTextWidth(U)*Math.cos(C):0)-ee/2)});else{let F=s[s.length-1],Q=i[0];if(F){let Z=f[F],ee=n.y[Q],le=ee>E2,z=Z.length*ee/2,U=p[Z[Z.length-1]];k=Math.max(k,(N?a.getTextWidth(F)*Math.cos(y):0)-z,(I&&le?a.getTextWidth(U)*Math.cos(C):0)-ee/2)}}return{xCaptionTail:x,yCaptionTail:k}}function rZ(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 L9t(e,t,n,r,a){if(e){let s=Yc/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=Yc/2;return{x:i,y:o,rotate:0,anchor:n==="right"?"start":"end"}}function $9t(e){return e!==null&&!("data"in e)}function sE({facetKey:e,data:t,scales:n,stepX:r,stepY:a,x:i,y:o,annotation:s,showTitle:c,width:f,height:A,colorScale:p,aes:v,frame:y,xGroupKeys:b,yGroupKeys:C,xKeysByGroups:x,yKeysByGroups:k,tooltipsData:_,activeElementContainer:P}){let{position:N,titlePosition:I,valueColumn:F}=s,Q=N==="left"||N==="right",Z=(Q?n.y:n.x).domain(),ee=L9t(Q,N,I,f,A),le=_.fixed&&P;return ie.jsxs("g",{children:[Z.map(z=>{let U=t==null?void 0:t[z],G=p.type==="continuous"?p.scale(Number(U)):p.scale(String(U)),Y=i+(Q?0:n.x(z)),X=o+(Q?n.y(z):0),te=Q?Yc:r,he=Q?a:Yc,ae=Q?null:z,ge=Q?z:null,me=le&&$9t(_.selectedData)&&_.selectedData.xKey===ae&&_.selectedData.yKey===ge&&e===_.currentFacet,fe=ie.jsx("rect",{x:Y,y:X,width:te,height:he,fill:G,stroke:v.cellStrokeColor,onMouseOver:()=>_.onMouseOver({x:Y+te,y:X+he/2,xKey:ae,yKey:ge,value:U,title:F.label??F.value},e),onMouseLeave:()=>_.onMouseLeave()},z);return me?uu.createPortal(fe,P):fe}),_.fixed&&!Q&&b.map(z=>{let U=x[z].length;if(U===0)return null;let G=U*r,Y=n.x(x[z][0]);return ie.jsx("rect",{x:Y+i,y:o,width:G,height:Yc,stroke:"none",fill:"rgba(255, 255, 255, 0.8)"},`${Y}_${o}`)}),_.fixed&&Q&&C.map(z=>{let U=k[z].length;if(U===0)return null;let G=U*a,Y=n.y(k[z][0]);return ie.jsx("rect",{x:i,y:Y+o,width:Yc,height:G,stroke:"none",fill:"rgba(255, 255, 255, 0.8)"},`${i}_${Y}`)}),y.type==="groups"&&!Q&&b.map(z=>{let U=x[z].length;if(U===0)return null;let G=U*r,Y=n.x(x[z][0]);return ie.jsx("rect",{x:Y+i,y:o,width:G,height:Yc,stroke:$t,fill:"none"},`${Y}_${o}`)}),y.type==="groups"&&Q&&C.map(z=>{let U=k[z].length;if(U===0)return null;let G=U*a,Y=n.y(k[z][0]);return ie.jsx("rect",{x:i,y:Y+o,width:Yc,height:G,stroke:$t,fill:"none"},`${i}_${Y}`)}),c&&ie.jsx("g",{fontWeight:"500",fontSize:"14px",transform:`translate(${i+ee.x},${o+ee.y}) rotate(${ee.rotate})`,children:ie.jsx("text",{textAnchor:ee.anchor,dominantBaseline:"central",children:F.label??F.value})})]})}function uE(e,t){return e.showTitle&&t.includes(e.titlePosition)}function F9t({facetKey:e,sideElementBBoxes:t,annotations:n,annotationColorScales:r,cellsMeta:a,chartEdgeSides:i,sharedX:o,sharedY:s,width:c,height:f,scales:A,stepX:p,stepY:v,aes:y,frame:b,xGroupKeys:C,yGroupKeys:x,xKeysByGroups:k,yKeysByGroups:_,tooltipsData:P,activeElementContainer:N}){let I=n.filter(G=>i.includes(G.position)||!o&&["left","right"].includes(G.position)||!s&&["top","bottom"].includes(G.position)),F=I.filter(G=>G.position==="left"),Q=I.filter(G=>G.position==="right"),Z=I.filter(G=>G.position==="top"),ee=I.filter(G=>G.position==="bottom"),{xDataByKeys:le,yDataByKeys:z}=a,U={facetKey:e,scales:A,stepX:p,stepY:v,width:c,height:f,aes:y,frame:b,xGroupKeys:C,yGroupKeys:x,xKeysByGroups:k,yKeysByGroups:_,tooltipsData:P,activeElementContainer:N};return ie.jsxs("g",{children:[F.map((G,Y)=>ie.jsx(sE,{annotation:G,colorScale:r[G.id],data:z[G.valueColumn.value],showTitle:uE(G,i),x:t.left.annotations.x+Y*Yc,y:t.left.annotations.y,...U},G.id)),Q.map((G,Y)=>ie.jsx(sE,{annotation:G,colorScale:r[G.id],data:z[G.valueColumn.value],showTitle:uE(G,i),x:t.right.annotations.x+Y*Yc+S2,y:t.right.annotations.y,...U},G.id)),Z.map((G,Y)=>ie.jsx(sE,{annotation:G,colorScale:r[G.id],data:le[G.valueColumn.value],showTitle:uE(G,i),x:t.top.annotations.x,y:t.top.annotations.y+Y*Yc,...U},G.id)),ee.map((G,Y)=>ie.jsx(sE,{annotation:G,colorScale:r[G.id],data:le[G.valueColumn.value],showTitle:uE(G,i),x:t.bottom.annotations.x,y:t.bottom.annotations.y+Y*Yc+S2,...U},G.id))]})}function V9t({sideElementBBoxes:e,xGroupKeys:t,yGroupKeys:n,xKeysByGroups:r,yKeysByGroups:a,xGroupLabels:i,yGroupLabels:o,scales:s,stepX:c,stepY:f,xAxis:A,yAxis:p,labelAngles:v,debug:y}){let b=e.top.groups.isVisible||e.bottom.groups.isVisible,C=e.top.groups.isVisible?e.top.groups:e.bottom.groups,x=e.left.groups.isVisible||e.right.groups.isVisible,k=e.left.groups.isVisible?e.left.groups:e.right.groups;return ie.jsxs("g",{children:[b&&ie.jsx("g",{transform:`translate(${C.x},${C.y})`,children:t.map(_=>{let P=r[_].length;if(P===0)return null;let N=v.xGroupLabels!==0,I=A.groupingPosition==="top",F=P*c,Q=s.x(r[_][0])+F/2,Z=N?I?C.height:0:C.height/2,ee=-v.xGroupLabels,le=N?I?"start":"end":"middle";return ie.jsxs("g",{transform:`translate(${Q},${Z})`,children:[ie.jsx("text",{transform:`rotate(${ee})`,dominantBaseline:"central",textAnchor:le,children:i[_]}),y&&ie.jsx("rect",{x:-F/2,width:F,height:C.height,stroke:"black",fill:"none"})]},_)})}),x&&ie.jsx("g",{transform:`translate(${k.x},${k.y})`,children:n.map(_=>{let P=a[_].length;if(P===0)return null;let N=P*f,I=p.groupingPosition==="left",F=I?k.width:0,Q=s.y(a[_][0])+N/2,Z=v.yGroupLabels!==0,ee=v.yGroupLabels===45?-45:(I?-1:1)*(90-v.yGroupLabels),le=Z?I?"end":"start":"middle";return ie.jsxs("g",{transform:`translate(${F},${Q})`,children:[ie.jsx("text",{y:Z?0:-k.width/2,transform:`rotate(${ee})`,dominantBaseline:"central",textAnchor:le,children:o[_]}),y&&ie.jsx("rect",{x:-k.width/2,y:-N/2,width:k.width,height:N,stroke:"black",fill:"none"})]},_)})})]})}function O9t({sideElementBBoxes:e,debug:t,xKeys:n,yKeys:r,scales:a,xAxis:i,yAxis:o,stepX:s,stepY:c,labelAngles:f,xLabels:A,yLabels:p}){let v=i.showTicks?oE:0,y=o.showTicks?oE:0,b=e.top.axis.isVisible||e.bottom.axis.isVisible,C=e.top.axisTitle.isVisible?e.top.axisTitle:e.bottom.axisTitle,x=e.top.axis.isVisible?e.top.axis:e.bottom.axis,k=e.left.axis.isVisible||e.right.axis.isVisible,_=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:[C.isVisible&&ie.jsxs("g",{transform:`translate(${C.x},${C.y})`,children:[ie.jsx("text",{x:C.width/2,y:C.height/2,textAnchor:"middle",dominantBaseline:"central",children:i.title}),t&&ie.jsx("rect",{width:C.width,height:C.height,stroke:$t,fill:"none"})]}),b&&ie.jsxs("g",{fontSize:"14px",transform:`translate(${x.x},${x.y})`,children:[n.map(N=>{let I=f.xAxisLabels!==0,F=i.position==="bottom",Q=F?0:x.height,Z=F?Q+v:Q-v,ee=F?Z+x2:Z-x2,le=a.x(N)+s/2,z=-f.xAxisLabels;return ie.jsxs("g",{children:[ie.jsx("line",{x1:le,x2:le,y1:Q,y2:Z,stroke:$t}),ie.jsx("text",{x:le,y:ee,textAnchor:I?F?"end":"start":"middle",transform:`rotate(${z},${le},${ee})`,dominantBaseline:I?"central":F?"hanging":"auto",children:A[N]})]},N)}),t&&ie.jsx("rect",{width:x.width,height:x.height,stroke:$t,fill:"none"})]})]}),ie.jsxs("g",{children:[_.isVisible&&ie.jsx("g",{transform:`translate(
15126
15126
  ${_.x+_.width/2},
15127
- ${_.y+_.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:_.x,y:_.y,width:_.width,height:_.height,stroke:$t,fill:"none"}),k&&ie.jsx("g",{fontSize:"14px",transform:`translate(${P.x},${P.y})`,children:r.map(N=>{let I=f.yAxisLabels!==0,F=o.position==="left",Q=-(90-f.yAxisLabels),Z=f.yAxisLabels===0?"middle":F?"end":"start",ee=I?"central":F?"auto":"hanging",le=F?P.width:0,z=F?le-y:le+y,U=F?z-x2:z+x2,G=a.y(N)+c/2;return ie.jsxs("g",{children:[ie.jsx("line",{x1:le,x2:z,y1:G,y2:G,stroke:$t}),ie.jsx("text",{x:U,y:G,textAnchor:Z,transform:`rotate(${Q},${U},${G})`,dominantBaseline:ee,children:p[N]})]},N)})}),t&&ie.jsx("rect",{x:P.x,y:P.y,height:P.height,width:P.width,stroke:$t,fill:"none"})]})]})}function Q9t({sideElementBBoxes:e,debug:t,xKeys:n,yKeys:r,scales:a,xAxis:i,yAxis:o,stepX:s,stepY:c,xGroupKeys:f,yGroupKeys:A,xKeysByGroups:p,yKeysByGroups:v,labelAngles:y,xLabels:b,yLabels:C,xGroupLabels:x,yGroupLabels:k}){return ie.jsxs("g",{fontWeight:"500",children:[ie.jsx(O9t,{sideElementBBoxes:e,xKeys:n,yKeys:r,scales:a,xAxis:i,yAxis:o,stepX:s,stepY:c,labelAngles:y,xLabels:b,yLabels:C,debug:t}),ie.jsx(V9t,{sideElementBBoxes:e,xGroupKeys:f,yGroupKeys:A,xKeysByGroups:p,yKeysByGroups:v,xGroupLabels:x,yGroupLabels:k,scales:a,stepX:s,stepY:c,xAxis:i,yAxis:o,labelAngles:y,debug:t})]})}function aZ(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 iZ(e,t,n,r,a){if(!n)return"";let i=n.aes[e];if(!g4(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 oZ={x:0,y:0,width:0,height:0};function z9t({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:oZ,c=o?t[o.position].dendro:oZ;function f(p,v){return iZ(p,v,i,n,a)}function A(p,v){return iZ(p,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((p,v)=>{let y=p.links(),b=p.descendants();return ie.jsxs("g",{children:[y.map(C=>{let x=i.edgeInheritance==="up"?C.source:C.target;return ie.jsx("path",{d:aZ(C,i.position),stroke:f("lineColor",x),strokeWidth:f("lineWidth",x),strokeDasharray:Vf(f("lineShape",x)),fill:"none"},`${C.source.x},${C.source.y},${C.target.x},${C.target.y}`)}),i.showNodes&&b.map(C=>ie.jsx("g",{transform:`translate(${C.x},${C.y})`,children:jc(f("dotShape",C),f("dotSize",C),f("dotFill",C))},`${C.x},${C.y}`))]},v)})}),ie.jsx("g",{transform:`translate(${c.x},${c.y})`,children:o&&!o.hidden&&e.y.trees.map((p,v)=>{let y=p.links(),b=p.descendants();return ie.jsxs("g",{children:[y.map(C=>{let x=o.edgeInheritance==="up"?C.source:C.target;return ie.jsx("path",{d:aZ(C,o.position),stroke:A("lineColor",x),strokeWidth:A("lineWidth",x),strokeDasharray:Vf(A("lineShape",x)),fill:"none"},`${C.source.x},${C.source.y},${C.target.x},${C.target.y}`)}),o.showNodes&&b.map(C=>ie.jsx("g",{transform:`translate(${C.x},${C.y})`,children:jc(A("dotShape",C),A("dotSize",C),A("dotFill",C))},`${C.x},${C.y}`))]},v)})})]})}function U9t({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:$t,x:"0",y:"0",width:t,height:n}),e.type==="groups"&&r.map(A=>{let p=i[A].length;if(p===0)return null;let v=p*c,y=s.x(i[A][0]);return a.map(b=>{let C=o[b].length;if(C===0)return null;let x=C*f,k=s.y(o[b][0]);return ie.jsx("rect",{x:y,y:k,width:v,height:x,stroke:$t,fill:"none"},`${y}_${k}`)})})]})}function OD(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 G9t(e,t,n=[]){let r=e.data,a=[`X: ${t.xLabels[e.x]}`,`Y: ${t.yLabels[e.y]}`,`Value: ${OD(e.value)}${e.value!==e.normalizedValue?` (${OD(e.normalizedValue)})`:""}`];for(let i of n)a.push(`${i.label}: ${r[i.valueLabels??i.value]}`);return a}function j9t(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}: ${OD(e.value)}`),n}function Y9t(e){return e!==null&&!("data"in e)}function lZ(e){return e!==null&&"data"in e}function W9t({dendrograms:e,facetKey:t,dimensions:n,scales:r,cells:a,xGroupKeys:i,yGroupKeys:o,xKeysByGroups:s,yKeysByGroups:c,colorScale:f,chartSettings:A,cellsMeta:p,stepX:v,stepY:y,sharedX:b,sharedY:C,annotations:x,annotationColorScales:k,dendrogramAesScales:_,aes:P,labelAngles:N,chartSizes:I,margins:F,tooltipsContainer:Q,tooltipsData:Z}){let[ee,le]=tn.useState(),{xAxis:z,yAxis:U,tooltips:G}=A,{width:Y,height:X}=n.inner,{padding:te,chartEdgeSides:he,sideElementBBoxes:ae}=n,{xGroupLabels:ge,yGroupLabels:me,xLabels:fe,yLabels:be}=p,He=r.x.domain(),_e=r.y.domain(),Ie={left:F.left+n.left+te.left,right:I.totalWidth-(F.left+n.left+te.left),top:F.top+n.top+te.top,bottom:I.totalHeight-(F.top+n.top+te.top)},Ue=!1,Oe=ee&&Z.fixed;return ie.jsxs("g",{transform:`translate(${n.left},${n.top})`,fontSize:D9t,children:[ie.jsxs("g",{transform:`translate(${te.left},${te.top})`,children:[ie.jsx(F9t,{facetKey:t,sideElementBBoxes:ae,annotations:x,cellsMeta:p,annotationColorScales:k,sharedX:b,sharedY:C,chartEdgeSides:he,width:Y,height:X,scales:r,stepX:v,stepY:y,aes:P,frame:A.frame,xGroupKeys:i,yGroupKeys:o,xKeysByGroups:s,yKeysByGroups:c,tooltipsData:Z,activeElementContainer:ee}),ie.jsx(z9t,{dendrograms:e,sideElementBBoxes:ae,xDataByKeys:p.xDataByKeys,yDataByKeys:p.yDataByKeys,aesScales:_}),ae.top.facetTitle.isVisible&&ie.jsx("text",{x:ae.top.facetTitle.x,y:ae.top.facetTitle.y+ae.top.facetTitle.height-_9t,fontWeight:"500",fontSize:"20px",children:p.facetKeyValues[t].join(", ")}),Ue,He.map(ft=>_e.map(Ve=>{var gt;let Xe=(gt=a==null?void 0:a[ft])==null?void 0:gt[Ve],tt=Oe&&lZ(Z.selectedData)&&(Xe==null?void 0:Xe.id)===Z.selectedData.id,qe=Xe?ie.jsx("rect",{x:r.x(ft),y:r.y(Ve),width:v,height:y,stroke:P.cellStrokeColor,fill:Xe.value===null?P.emptyCellColor:f(Xe.normalizedValue),onMouseOver:()=>Z.onMouseOver(Xe,t),onMouseLeave:()=>Z.onMouseLeave()},Xe?Xe.id:`${ft}_${Ve}`):null;return tt?uu.createPortal(qe,ee):qe})),ie.jsx(U9t,{frame:A.frame,xGroupKeys:i,yGroupKeys:o,xKeysByGroups:s,yKeysByGroups:c,scales:r,stepX:v,stepY:y,width:Y,height:X}),ie.jsx(Q9t,{xAxis:z,yAxis:U,scales:r,stepX:v,stepY:y,debug:Ue,sideElementBBoxes:ae,xKeys:He,yKeys:_e,xGroupKeys:i,yGroupKeys:o,xKeysByGroups:s,yKeysByGroups:c,xGroupLabels:ge,yGroupLabels:me,labelAngles:N,xLabels:fe,yLabels:be})]}),A.tooltips.show&&lZ(Z.selectedData)&&Z.currentFacet===t&&ie.jsx(cu,{content:G9t(Z.selectedData,p,G==null?void 0:G.content),x:r.x(String(Z.selectedData.x))+v/2,y:r.y(String(Z.selectedData.y))+y/2,offset:He.length>1?v/2:0,active:!0,sideDistances:Ie,fixed:Z.fixed,onClose:Z.onClose,container:Q}),A.tooltips.show&&Y9t(Z.selectedData)&&Z.currentFacet===t&&ie.jsx(cu,{content:j9t(Z.selectedData,p),x:Z.selectedData.x,y:Z.selectedData.y,offset:0,active:!0,sideDistances:Ie,fixed:Z.fixed,onClose:Z.onClose,container:Q}),ie.jsxs("g",{transform:`translate(${te.left},${te.top})`,children:[Z.fixed&&ie.jsx("rect",{width:I.chartWidth,height:I.chartHeight,fill:"rgba(255, 255, 255, 0.8)"}),ie.jsx("g",{ref:ft=>{ft&&!ee&&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:p,groupedCells:v,cellsMeta:y,step:b,annotations:C,annotationColorScales:x,legend:k,aes:_,dendrograms:P,dendrogramAesScales:N,columnsCount:I,labelAngles:F,onTooltipHintSwitch:Q}){let[Z,ee]=tn.useState(),le=f2(Q),z=tn.useRef(null);tn.useEffect(()=>{z.current&&ee(z.current)},[]);let U=i[o[0]].padding,G=i[o[I-1]].padding,Y=e.left+a.chartsWidth+FD,X=e.top+U.top;return ie.jsx(h2,{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:$g}),ie.jsxs("g",{transform:`translate(${e.left},${e.top})`,children:[ie.jsx(v2,{title:[r.title.name],show:r.title.show,position:r.title.position,leftPadding:U.left,rightPadding:G.right,chartsWidth:a.chartsWidth}),o.map(te=>{let{cells:he,xKeysByGroups:ae,yKeysByGroups:ge}=v[te];return ie.jsx(W9t,{dendrograms:P[te],captionsSizes:t,facetKey:te,dimensions:i[te],xGroupKeys:c,yGroupKeys:f,xKeysByGroups:s.sharedX?y.xKeysByGroups:ae,yKeysByGroups:s.sharedY?y.yKeysByGroups:ge,sharedX:s.sharedX,sharedY:s.sharedY,scales:{x:A.x[te],y:A.y[te]},cells:he,cellsMeta:y,stepX:b.x[te],stepY:b.y[te],colorScale:p,chartSettings:r,aes:_,annotations:C,annotationColorScales:x,dendrogramAesScales:N,labelAngles:F,margins:e,chartSizes:a,tooltipsContainer:Z,tooltipsData:le},te)})]}),ie.jsx("g",{transform:`translate(${Y},${X})`,children:ie.jsx(m2,{legendData:k})}),ie.jsx("g",{ref:z,style:{outline:"none"}})]})})}function sZ(e,t,n){function r(a){a[n]=t(a.data.height),a.children&&a.children.forEach(r)}r(e)}function uZ(e,t,n,r=n){function a(i){i[r]=i[n]+t,i.children&&i.children.forEach(a)}a(e)}var K9t=(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 cZ(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])),K9t(t,r)}var Z9t=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:Gv,bottom:Gv,left:Gv,right:Gv});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:zo().domain(["null"]).range([1])},y:{null:zo().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=Gh(this.rootNode))}updateMargins(e){this.margins={top:e.show?24+24*2:Gv,bottom:Gv,left:Gv,right:this.legend.width+Gv},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((y,b)=>(y[b]=String(b),y),{});if(e==="continuous"){let v=this.colorScale,y=c2(v,a),b=Zr([y[0],y[y.length-1]],[i,0]),C=r.label??r.value;o.push({...s,type:"continuous",id:"heatmapValue",scale:v,values:y,title:C,tickPositionScale:b})}else if(e==="discrete"){let v=this.colorScale,y=r.label??r.value,b=v.domain(),C=c(b);o.push({...s,type:"discreteColor",id:"heatmapValue",title:y,scale:v,values:b,labels:C})}if(n.forEach(v=>{let y=v.valueColumn.label??v.valueColumn.value;if(v.type==="continuous"){let b=this.annotationColorScales[v.id].scale,C=c2(b,a),x=Zr([C[0],C[C.length-1]],[i,0]);o.push({...s,type:"continuous",id:v.id,tickPositionScale:x,title:y,scale:b,values:C})}if(v.type==="discrete"){let b=this.annotationColorScales[v.id].scale,C=b.domain(),x=c(C);o.push({...s,type:"discreteColor",id:v.id,title:y,scale:b,values:C,labels:x})}}),!o.length){this.legend={width:0,height:0,items:[]};return}let f=y2(o,this.chartSizes.chartHeight),A=f[f.length-1],p=A.left+A.width+FD;this.legend={width:p,height:i,items:f}}updateCaptionsSize(e,t,n,r){let a=new Ac("bold 14px Arial"),{xGroupKeys:i,yGroupKeys:o,xGroupLabels:s,yGroupLabels:c,xKeysByGroups:f,yKeysByGroups:A,xLabels:p,yLabels:v}=e.meta;this.labelAngles={xAxisLabels:t.axisLabelsAngle,yAxisLabels:n.axisLabelsAngle,xGroupLabels:t.groupLabelsAngle,yGroupLabels:n.groupLabelsAngle};function y(le,z){let U=0;for(let G of le){let Y=a.getTextWidth(z[G]);Y>U&&(U=Y)}return U}let b=Zn.flatten(Object.values(f)),C=Zn.flatten(Object.values(A)),x=y(b,p),k=y(C,v),_=y(i,s),P=y(o,c),{xCaptionTail:N,yCaptionTail:I}=N9t(this.labelAngles,r,this.step,e,a),F=this.labelAngles.xGroupLabels/180*Math.PI,Q=this.labelAngles.yGroupLabels/180*Math.PI,Z=this.labelAngles.xAxisLabels/180*Math.PI,ee=this.labelAngles.yAxisLabels/180*Math.PI;this.captionsSizes={xCaptionTail:N,yCaptionTail:I,xGroupCaptions:_*Math.sin(F)||jv,yGroupCaptions:P*Math.sin(Q)||jv,xAxisCaptions:x*Math.sin(Z)||jv,yAxisCaptions:k*Math.sin(ee)||jv}}updateChartDimensions(e,t,n,r,a,i,o,s,c,f){let A=t.length,p=Math.min(a.nRows??A,A),v=Math.min(a.nCols??A,A);this.columnsCount=a.nRows?Math.ceil(A/p):v,this.rowsCount=Math.ceil(A/this.columnsCount);let{width:y,height:b}=e,{sharedX:C,sharedY:x}=a;this.chartsDimensions={};let k=0,_=0;t.forEach((I,F)=>{let Q=F%this.columnsCount+1,Z=rZ(F,t.length,this.columnsCount,this.rowsCount),ee=this.step.x[I],le=this.step.y[I],z=P9t(i,o,this.captionsSizes,s,c,f,Z,C,x,t,n,r,ee,le),U=R9t(s,Z,C,x);function G(ae){return Math.max(c1[ae].reduce((ge,me)=>ge+z[ae][me],0),U[ae],k9t)}let Y={left:G("left"),right:G("right"),top:G("top"),bottom:G("bottom")};Y.left<this.captionsSizes.xCaptionTail&&(Y.left=this.captionsSizes.xCaptionTail),Y.bottom<this.captionsSizes.yCaptionTail&&(Y.bottom=this.captionsSizes.yCaptionTail);let X=M9t(z,y,b),te=y+Y.left+Y.right,he=b+Y.top+Y.bottom;this.chartsDimensions[I]={left:k,top:_,inner:{width:y,height:b},outer:{width:te,height:he},padding:Y,sideElementBBoxes:X,chartEdgeSides:Z},k+=te,Q===this.columnsCount&&(k=0,_+=he)});let P=t.slice(0,this.columnsCount).reduce((I,F)=>I+this.chartsDimensions[F].outer.width,0),N=t.filter((I,F)=>F%this.columnsCount===0).reduce((I,F)=>I+this.chartsDimensions[F].outer.height,0);this.chartSizes.chartsWidth=P,this.chartSizes.chartsHeight=N}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:p,facets:v}=t,{sharedX:y,sharedY:b}=r,C=(k,_={})=>k.sort((P,N)=>i.sorting==="asc"?(_[P]??P).localeCompare(_[N]??N,"en",{numeric:!0}):(_[N]??N).localeCompare(_[P]??P,"en",{numeric:!0})),x=(k,_={})=>k.sort((P,N)=>o.sorting==="asc"?(_[P]??P).localeCompare(_[N]??N,"en",{numeric:!0}):(_[N]??N).localeCompare(_[P]??P,"en",{numeric:!0}));e.forEach(k=>{let _=v[k],P=C(p.xGroupKeys),N=x(p.yGroupKeys),{xKeysByGroups:I}=y?p:_,{yKeysByGroups:F}=b?p:_,Q=P.map(ge=>I[ge].length),Z=N.map(ge=>F[ge].length),ee=Q.reduce((ge,me)=>ge+me,0),le=Z.reduce((ge,me)=>ge+me,0),z=(f-(Q.filter(ge=>ge>0).length-1)*n)/ee,U=(A-(Z.filter(ge=>ge>0).length-1)*n)/le,G=[],Y=[],X=0;P.forEach(ge=>{let me=s?I[ge]:C(I[ge],p.xLabels);Y.push(...me),me.forEach(()=>{G.push(X),X+=z}),me.length>0&&(X+=n)});let te=[],he=[],ae=0;N.forEach(ge=>{let me=c?F[ge]:x(F[ge],p.yLabels);he.push(...me),me.forEach(()=>{te.push(ae),ae+=U}),me.length>0&&(ae+=n)}),this.scales.x[k]=zo().domain(Y).range(G),this.scales.y[k]=zo().domain(he).range(te),this.step.x[k]=z,this.step.y[k]=U})}updateAesScale(e,t,n,r,a,i,o){if(e==="continuous")n.valueColors?this.colorScale=Zr().domain(n.valuesByColors??cZ(o,n.valueColors.length,t)).range(n.valueColors):n.colorsList&&(this.colorScale=Zr().domain(cZ(o,n.colorsList.length,t)).range(n.colorsList));else if(n.colorsMap){let f=Object.entries(n.colorsMap);this.colorScale=zo().domain(f.map(A=>A[0])).range(f.map(A=>A[1])).unknown("#ccc")}else n.colorsList&&(this.colorScale=nZ(n.colorsList,i.map(String)));let{xDataByKeys:s,yDataByKeys:c}=a.meta;r.forEach(f=>{let{colors:A,type:p,axis:v,valueColumn:y}=f,b=(v==="x"?s:c)[y.value];if(p==="discrete"){let C=Zn.uniq(Object.values(b).map(String)).sort();this.annotationColorScales[f.id]={type:"discrete",scale:nZ(A,C)}}else{let C=Object.values(b).map(Number);if(!C.length)return;let[x=C[0],k=C[0]]=_p(C);this.annotationColorScales[f.id]={type:"continuous",scale:H9t(A,x,k,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:p}=a[s],v=Math.max(...A.map(b=>b.data.height)),y=Math.max(...p.map(b=>b.data.height));i&&(this.dendrograms[s].x.trees=A.map((b,C)=>{let x=t[C],k=c[x];PB().separation(()=>1).size([k.length*this.step.x[s],i.size])(b);let _=b,P=Zr().domain(i.position==="top"?[0,v]:[v,0]).range([i.size,0]);return sZ(_,P,"y"),uZ(_,this.scales.x[s](k[0]),"x"),_}),this.dendrograms[s].x.data=i),o&&(this.dendrograms[s].y.trees=p.map((b,C)=>{let x=n[C],k=f[x];PB().separation(()=>1).size([k.length*this.step.y[s],o.size])(b);let _=b,P=Zr().domain(o.position==="left"?[0,y]:[y,0]).range([o.size,0]);return uZ(_,this.scales.y[s](k[0]),"x","y"),sZ(_,P,"x"),_}),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]=zo().domain(i).range(i.map(o=>({...tZ,...a[o]}))).unknown(tZ),n},{})}render(e,t,n,r,a,i,o,s,c,f,A,p,v,y){var le;let{meta:b,facets:C}=a,{facetKeys:x,xGroupKeys:k,yGroupKeys:_,valueExtent:P}=b,{xAxis:N,yAxis:I,title:F,size:Q,valueType:Z}=t;this.updateChartsSizes(Q),this.updateAesScale(Z,P,r,i,a,p,v),this.updateScales(x,a,r.groupGap,n,Q,t.xAxis,t.yAxis,s,c),this.updateCaptionsSize(a,N,I,n),this.updateChartDimensions(Q,x,k,_,n,N,I,i,s,c),this.updateLegendSize(Z,t.legend,i,o,P),this.updateMargins(F),this.updateDendrogram(x,k,_,C,f,s,c),this.updateDendrogramAesScales(A);let ee=ie.jsx(X9t,{aes:r,annotations:i,annotationColorScales:this.annotationColorScales,captionsSizes:this.captionsSizes,cellsMeta:b,columnsCount:this.columnsCount,chartsDimensions:this.chartsDimensions,chartSettings:t,chartSizes:this.chartSizes,colorScale:this.colorScale,dendrogramAesScales:this.dendrogramAesScales,dendrograms:this.dendrograms,facetKeys:x,facetSettings:n,groupedCells:C,labelAngles:this.labelAngles,legend:this.legend,margins:this.margins,scales:this.scales,settingsId:e,step:this.step,xGroupKeys:k,yGroupKeys:_,onTooltipHintSwitch:y});this.component=ee,(le=this.reactRoot)==null||le.render(ee)}renderError(e){var t;(t=this.reactRoot)==null||t.render(ie.jsx(zv,{message:e}))}},J9t=Z9t,QD={lineColor:$t,dotShape:"21",dotFill:$t,dotSize:3,lineShape:"solid",lineWidth:1},fZ={size:150,distance:"euclidean",linkage:"average",fillNA:0,showNodes:!0,hidden:!1,edgeInheritance:"up",aes:QD},dZ=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,p,v,y;if(S2t.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:((p=e.aes)==null?void 0:p.emptyCellColor)??"white"},this.annotations=(e.annotations??[]).map(b=>b.axis==="x"?{id:Zn.uniqueId("annotation"),axis:"x",valueColumn:b.valueColumn,position:b.position??this.chartSettings.xAxis.position,titlePosition:b.titlePosition??"right",showTitle:b.showTitle??!0,type:b.type,colors:b.colors??["white","black"]}:{id:Zn.uniqueId("annotation"),axis:"y",valueColumn:b.valueColumn,position:b.position??this.chartSettings.yAxis.position,titlePosition:b.titlePosition??"top",showTitle:b.showTitle??!0,type:b.type,colors:b.colors??["white","black"]}),e.valueType==="discrete"&&(e.dendrogramX||e.dendrogramY))throw Error("Dendrogram is not available with discrete cells values");this.dendrogramX=e.dendrogramX?{...fZ,position:"top",...e.dendrogramX,aes:{...QD,...(v=e.dendrogramX)==null?void 0:v.aes}}:null,this.dendrogramY=e.dendrogramY?{...fZ,position:"left",...e.dendrogramY,aes:{...QD,...(y=e.dendrogramY)==null?void 0:y.aes}}:null,this.inheritedDendrogramAes=e.inheritedDendrogramAes??null}},q9t=class extends Rg{constructor(t,n,r){super(t,n);Be(this,"settings");Be(this,"chartRenderer",new J9t);Be(this,"onTooltipHintSwitch",()=>{});Be(this,"calculatedData",null);this.settings=new dZ(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 dZ(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(),my(this.chartRenderer.component)}_needUpdateCalculatedDataBySettings(t,n){var I,F,Q,Z,ee,le,z,U,G,Y,X,te;let{xColumn:r,yColumn:a,valueColumn:i,xGroupBy:o,yGroupBy:s,facetBy:c,annotations:f,chartSettings:A,facetSettings:p,dendrogramX:v,dendrogramY:y,normalization:b,NAValueAs:C}=n,x=Object.values(((I=t.dendrogramX)==null?void 0:I.aes)||{}).filter(g4),k=Object.values((v==null?void 0:v.aes)||{}).filter(g4),_=Object.values(((F=t.dendrogramY)==null?void 0:F.aes)||{}).filter(g4),P=Object.values((y==null?void 0:y.aes)||{}).filter(g4);function N(he,ae){return he.length!==ae.length||he.some((ge,me)=>ge.value!==ae[me].value)}return t.xColumn.value!==r.value||t.yColumn.value!==a.value||t.valueColumn.value!==i.value||N(t.xGroupBy,o)||N(t.yGroupBy,s)||N(t.facetBy,c)||N(t.annotations.map(he=>he.valueColumn),f.map(he=>he.valueColumn))||N(x,k)||N(_,P)||(n.dendrogramX||t.dendrogramX)&&(((Q=t.dendrogramX)==null?void 0:Q.distance)!==((Z=n.dendrogramX)==null?void 0:Z.distance)||((ee=t.dendrogramX)==null?void 0:ee.linkage)!==((le=n.dendrogramX)==null?void 0:le.linkage))||(n.dendrogramY||t.dendrogramY)&&(((z=t.dendrogramY)==null?void 0:z.distance)!==((U=n.dendrogramY)==null?void 0:U.distance)||((G=t.dendrogramY)==null?void 0:G.linkage)!==((Y=n.dendrogramY)==null?void 0:Y.linkage))||t.chartSettings.valueType!==A.valueType||t.facetSettings.sharedX!==p.sharedX||t.facetSettings.sharedY!==p.sharedY||((X=t.normalization)==null?void 0:X.method)!==(b==null?void 0:b.method)||((te=t.normalization)==null?void 0:te.direction)!==(b==null?void 0:b.direction)||t.NAValueAs!==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{xColumn:t,yColumn:n,valueColumn:r,xGroupBy:a,yGroupBy:i,facetBy:o,chartSettings:s,facetSettings:c,annotations:f,dendrogramX:A,dendrogramY:p,normalization:v,NAValueAs:y}=this.settings,b=C9t(this.data,t,n,r,o,a,i,f,A,p,v,y),C=B9t(b,A,p,c),x=s.valueType==="discrete"?this.data.getColumnCategories(r.value):[];this.calculatedData={groupedCellsData:b,dendrogramsData:C,cellUniqValues:x}}_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)}},AZ=(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 pZ(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 e4t(e,t,n,r,a,i){let o=AZ(n,r),s=kR().domain(r).thresholds(o).value(c=>c[t.value])(e);return{bins:pZ(s,a,i),maxCount:Rh(s,c=>c.length)??0}}function t4t(e,t,n,r,a,i){let o=AZ(n,r),s=av().domain(r).range(r),c=o.map(A=>s.invert(A)),f=kR().domain(r).thresholds(c).value(A=>A[t.value])(e);return{bins:pZ(f,a,i),maxCount:Rh(f,A=>A.length)??0}}function n4t(e,t,n,r,a,i){let o={};return t.forEach(s=>{var C,x;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,p]=_p(f,k=>k[r.value]);A=A??((C=f[0])==null?void 0:C[r.value])??0,p=p??((x=f[0])==null?void 0:x[r.value])??0;let v=[A,p],y=[...n].reverse();y.forEach((k,_)=>{let P=e.getRowsByGrouping([...s,k]),N=i==="linear"?e4t(P,r,a,v,k,_):t4t(P,r,a,v,k,_);o[c].histogramByGroupingKey[k]=N,o[c].minX=v[0],o[c].maxX=v[1],o[c].maxCountFromGroups=Math.max(o[c].maxCountFromGroups,N.maxCount);let I=_>0?y[_-1]:null,F=I!==null?o[c].histogramByGroupingKey[I]:null;N.bins.forEach((Q,Z)=>{Q.y.straight=((F==null?void 0:F.bins[Z].y.straight)??0)+Q.count,o[c].maxCount=Math.max(o[c].maxCount,Q.y.straight)})});let b=n;b.forEach((k,_)=>{let P=_>0?b[_-1]:null,N=o[c].histogramByGroupingKey[k],I=P!==null?o[c].histogramByGroupingKey[P]:null;N.bins.forEach((F,Q)=>{F.y.reverse=((I==null?void 0:I.bins[Q].y.reverse)??0)+F.count})})}),o}var r4t={TOP:30,BOTTOM:0,LEFT:10,RIGHT:10};function B4(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 hZ=(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 a4t(e,t,n){if(n==="linear")return hZ(e,t);if(n==="log"){let r=hZ(e,t),a=av(t,t),i=r.map(o=>a.invert(o));return i[0]=t[0],i[i.length-1]=t[1],i}return[]}function k4(e,t,n){return(n==="log"?av():Zr()).domain(a4t(e.length,t,n)).range(e)}function i4t(e){return`translate(${e},0)`}function o4t(e){return`translate(0,${e})`}function l4t(e){return e==="bottom"?`translate(0,${Ff})`:`translate(${-Ff},0)`}function s4t(e){return e==="bottom"?"hanging":"central"}function u4t(e){return e==="bottom"?"middle":"end"}var vZ=({scale:e,tickSize:t=6,tickPadding:n=Ff,orient:r="bottom",onlyPositive:a=!1,hiddenLabels:i=!1,offset:o=typeof window<"u"&&window.devicePixelRatio>1?0:.5})=>{function s(x){return k=>{let _=x(k);return _===void 0?0:+_}}let{ticks:c,format:f}=i?{ticks:[],format:x=>x}:B4(e,a,r==="bottom"),A=Math.max(t,0)+n,p=s(e.copy()),v=r==="bottom"?i4t:o4t,y=r==="left"?-1:1,b={[(r==="left"?"x":"y")+"2"]:y*t},C={[r==="left"?"x":"y"]:y*A};return ie.jsx("g",{children:c.map((x,k)=>ie.jsxs("g",{className:"tick",transform:v(p(x)+o),children:[ie.jsx("line",{stroke:$t,...b}),ie.jsx("g",{transform:l4t(r),children:ie.jsx("text",{fill:$t,fontSize:"14px",fontWeight:"500",fontFamily:"Manrope",dominantBaseline:s4t(r),textAnchor:u4t(r),...C,children:f(x)})})]},k))})},c4t=1;function mZ({scaleX:e,scaleY:t,width:n,height:r,axisX:a,axisY:i,frameType:o,updatingKey:s=""}){let[c,f]=tn.useState(e.ticks()),[A,p]=tn.useState(t.ticks()),{significantLines:v=[]}=a,{significantLines:y=[]}=i;return tn.useEffect(()=>{let b=e.ticks().filter(x=>!v.includes(x)),C=t.ticks().filter(x=>!y.includes(x));f(b),p(C)},[e,t,s]),ie.jsxs("g",{stroke:$f,children:[a.showGrid&&c.map(b=>{let C=e(b);return ie.jsx("line",{x1:C,x2:C,y1:0,y2:r},`x_${C}_${r}`)}),i.showGrid&&A.map(b=>{let C=t(b);return ie.jsx("line",{x1:0,x2:n,y1:C,y2:C},`y_${C}_${n}`)}),ie.jsx("g",{strokeDasharray:Vf(a.significantLinesStyle),stroke:$t,children:v.map(b=>{let C=e(b);return C<0||C>n?null:ie.jsx("line",{x1:C,x2:C,y1:0,y2:r},`significant_${C}_${r}`)})}),ie.jsx("g",{strokeDasharray:Vf(i.significantLinesStyle),stroke:$t,children:y.map(b=>{let C=t(b);return C<0||C>r?null:ie.jsx("line",{x1:0,x2:n,y1:C,y2:C},`significant_${C}_${n}`)})}),o!=="empty"&&ie.jsxs("g",{strokeWidth:c4t,children:[(a.showGrid||o!=="left")&&ie.jsx("line",{stroke:o==="left"?$f:$t,x1:"0",x2:n,y1:r,y2:r}),(a.showGrid||o!=="bottom")&&ie.jsx("line",{stroke:o==="bottom"?$f:$t,x1:"0",x2:"0",y1:"0",y2:r}),(a.showGrid||o==="full")&&ie.jsx("line",{stroke:o==="full"?$t:$f,x1:n,x2:n,y1:"0",y2:r}),(i.showGrid||o==="full")&&ie.jsx("line",{stroke:o==="full"?$t:$f,x1:"0",x2:n,y1:"0",y2:"0"})]})]})}function f4t(e){return typeof e=="string"?e:e.value}function d4t(e,t){let n=[`Amount: ${e.count}`,`(from ${ni(e.x)}, to ${ni(e.x+e.width)})`];return e.groupingKey!=="null"&&n.push(`${t[e.groupingKey]??e.groupingKey}`),n}function gZ(e,t,n,r){return t==="vertical"?e:e+n*r}function yZ(e,t,n,r){return t(n==="vertical"?r==="straight"?e.y.straight:e.y.reverse:e.count)}function A4t({facetKey:e,width:t,height:n,dimensions:r,scales:a,xAxis:i,yAxis:o,frameType:s,histogramData:c,facetSettings:f,captionsSizes:A,facetTitle:p,layers:v,aesColorGetter:y,groupingDirection:b,groupingStack:C,groupingLabels:x,chartSizes:k,margins:_,tooltipsContainer:P,tooltipsData:N}){let[I,F]=tn.useState(),{padding:Q}=r,Z=i.showTicks?4:0,ee=o.showTicks?4:0,le=r.chartEdgeSides.includes("left")||!(f!=null&&f.sharedY),z=r.chartEdgeSides.includes("bottom")||!(f!=null&&f.sharedX),U=r.chartEdgeSides.includes("bottom"),G=c.groupingKeys,Y=c.histogramByGroupingKey[G[0]].bins[0],X=a.x(Y.width)-a.x(0),te=C==="vertical"?X:X/G.length,he={left:_.left+r.left+Q.left,right:k.totalWidth-(_.left+r.left+Q.left),top:_.top+r.top+Q.top,bottom:k.totalHeight-(_.top+r.top+Q.top)},ae=I&&N.fixed,ge=!1;return ie.jsxs("g",{transform:`translate(${r.left+Q.left},${r.top+Q.top})`,children:[ge,p.length&&ie.jsxs("g",{children:[s==="full"&&ie.jsx("rect",{x:"0",y:-Q.top,height:Q.top,width:t,fill:"#F7F8FA",stroke:$t}),p.map((me,fe)=>{let be=p.length,He=(Q.top-20*be)/2;return ie.jsx("text",{fontSize:"14px",fontWeight:"500",fill:$t,x:t/2,dy:He+20/2-Q.top,y:fe*20,textAnchor:"middle",dominantBaseline:"central",children:me},fe)})]}),ie.jsxs("g",{dominantBaseline:"central",textAnchor:"middle",fontWeight:"500",fontSize:"14px",fill:$t,children:[U&&i.title&&ie.jsx("text",{x:t/2,y:n+Q.bottom-20/2,children:f4t(i.title)}),ge]}),ie.jsx(mZ,{width:t,height:n,scaleX:a.x,scaleY:a.y,axisX:i,axisY:o,frameType:s}),z&&ie.jsxs("g",{transform:`translate(0,${n})`,children:[ie.jsx(vZ,{scale:a.x,orient:"bottom",tickSize:Z,hiddenLabels:i.hiddenLabels}),ge]}),le&&ie.jsxs("g",{children:[ie.jsx(vZ,{scale:a.y,orient:"left",tickSize:ee,hiddenLabels:o.hiddenLabels}),ge]}),v.map(me=>G.map((fe,be)=>c.histogramByGroupingKey[fe].bins.map(He=>{let _e=ae&&N.selectedData===He,Ie=ie.jsx("rect",{x:gZ(a.x(He.x),C,be,te),y:yZ(He,a.y,C,b),fill:He.rows[0]?y(me.aes.fillColor,He.rows[0],He.count):"",stroke:me.aes.lineColor,width:te,height:a.y(0)-a.y(He.count),opacity:me.aes.opacity??1,onMouseOver:()=>N.onMouseOver(He,e),onMouseLeave:()=>N.onMouseLeave()},He.x);return _e?uu.createPortal(Ie,I):Ie}))),N.fixed&&ie.jsx("rect",{width:k.chartWidth,height:k.chartHeight,fill:"rgba(255,255,255,0.8)"}),ie.jsx("g",{ref:me=>{me&&!I&&F(me)}}),N.selectedData&&N.currentFacet===e&&ie.jsx(cu,{content:d4t(N.selectedData,x),x:gZ(a.x(N.selectedData.x),C,N.selectedData.groupingKeyIdx,te)+te,y:yZ(N.selectedData,a.y,C,b)+a.y(0)-a.y(N.selectedData.count/2),offset:0,active:!0,fixed:N.fixed,sideDistances:he,container:P,onClose:N.onClose})]})}function p4t({settingsId:e,chartSettings:t,chartSizes:n,chartsDimensions:r,columnsCount:a,facetKeys:i,facetSettings:o,scales:s,margins:c,mainTitle:f,facetTitles:A,captionsSizes:p,histogramDataByFacets:v,layers:y,aesColorGetter:b,groupingDirection:C,groupingStack:x,groupingLabels:k,legend:_,onTooltipHintSwitch:P}){let N=f2(P),{xAxis:I,yAxis:F,title:Q,frame:Z}=t,ee=r[i[0]].padding,le=r[i[a-1]].padding,[z,U]=tn.useState(),G=tn.useRef(null);tn.useEffect(()=>{G.current&&U(G.current)},[]);let Y=c.left+n.chartsWidth+FD,X=c.top+ee.top;return ie.jsx(h2,{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:$g}),ie.jsxs("g",{transform:`translate(${c.left},${c.top})`,fontFamily:"Manrope",children:[ie.jsx(v2,{title:f,show:Q.show,position:Q.position,leftPadding:ee.left,rightPadding:le.right,chartsWidth:n.chartsWidth}),i.map(te=>ie.jsx(A4t,{facetKey:te,scales:{x:s.x[te],y:s.y[te]},width:n.chartWidth,height:n.chartHeight,dimensions:r[te],margins:c,chartSizes:n,facetSettings:o,xAxis:I,yAxis:F,frameType:Z.type,facetTitle:A[te],captionsSizes:p,histogramData:v[te],layers:y,aesColorGetter:b,groupingDirection:C,groupingStack:x,groupingLabels:k,tooltipsContainer:z,tooltipsData:N},te))]}),ie.jsx("g",{transform:`translate(${Y},${X})`,children:ie.jsx(m2,{legendData:_})}),ie.jsx("g",{ref:G,style:{outline:"none"}})]})})}function h4t(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 v4t(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!=="",p=n.yAxisCaptionsWidth,v=(t.showTicks?4:0)+(t.hiddenLabels?0:6),y=n.xAxisCaptionsWidth,b=(e.showTicks?4:0)+(e.hiddenLabels?0:6),C=A?20:0,x=p+v,k=b+y+C,_=Math.max(...r.map(P=>a[P].length));return{left:c?x:12,top:_===0?0:6*2+_*20,bottom:f?k:12,right:o?0:12}}function m4t(e,t,n){let r=[];for(let a=0;a<t;a++)r.push(e.slice(a*n,a*n+n));return r}function g4t(e,t){let n=Math.floor(e/t),r=e-n*t;return[n,r]}function wZ(e){return typeof e=="object"&&e!==null&&"type"in e&&"value"in e&&e.type==="grouping"}function y4t(e){return typeof e=="object"&&e!==null&&"range"in e}function w4t(e,t,n){return function(r,a,i){var o,s;if(y4t(r)){let{domain:c=n,range:f,type:A="linear"}=r,p=k4(f,c,A);return p.clamp(!0),p(i)}if(wZ(r)){let c=r.value;return(s=((o=e[c])==null?void 0:o[String(a[c])])??CD)==null?void 0:s[t]}return r}}var C4t=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=Gh(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,p,v)=>{let[y,b]=g4t(v,this.columnsCount),C=h4t(v,e.length,this.columnsCount,this.rowsCount),x=v4t(n,r,this.captionsSizes,m4t(e,this.rowsCount,this.columnsCount)[y],this.facetTitles,C,b===this.columnsCount-1,t),k=a+x.left+x.right,_=i+x.top+x.bottom;return A[p]={left:o,top:s,chartEdgeSides:C,padding:x,inner:{width:a,height:i},outer:{width:k,height:_}},o+=k,b===this.columnsCount-1&&(o=0,s+=_),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,p]=[1/0,-1/0],v=-1/0,y=e.reduce((b,C)=>{let x=a[C],{minX:k,maxX:_,maxCount:P,maxCountFromGroups:N}=x;return A=Math.min(A,k),p=Math.max(p,_),v=Math.max(v,o==="vertical"?P:N),b[C]={minX:k,maxX:_,maxY:o==="vertical"?P:N},b},{});e.forEach(b=>{let C=n.scale==="log"?av():Zr(),x=y[b],k=t.sharedX?A:x.minX,_=t.sharedX?p:x.maxX;C.domain([k,_]).range([0,this.chartSizes.chartWidth]),this.scales.x[b]=C}),e.forEach(b=>{let C=r.scale==="log"?av():Zr(),x=y[b],k=0,_=t.sharedY?v:x.maxY,P=[this.chartSizes.chartHeight,0],N=C.copy().domain([k,_]).range([this.chartSizes.chartHeight,i.innerOffset]);C.domain([N.invert(this.chartSizes.chartHeight),N.invert(0)]).range(P),this.scales.y[b]=C})}updateCaptionsSize(e,t){let n=new Ac("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}=B4(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=Uv(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]=Uv(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(wZ(A.aes.fillColor)&&n){let p=A.aes.fillColor.value,v=t[n.value],y=n.label??n.value,b=zo().domain(v.values).range(v.values.map(C=>v.aesMap[C].fillColor));a.push({...i,id:p,type:"discreteColor",title:y,scale:b,values:v.values,labels:v.labels})}}),!a.length){this.legend={width:0,height:0,items:[]};return}let o=y2(a,this.chartSizes.chartHeight),s=o[o.length-1],c=s.left+s.width+jb,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,p,v){var N;let{xAxis:y,yAxis:b,size:C,title:x}=t;this.updateChartSizes(C),this.updateViewport(r,n,y,b,i,C,A),this.updateCaptionsSize(y,b),this.createFacetTitles(r,a),this.updateChartDimensions(r,n,y,b),this.createMainTitle(r,x),this.updateLegendSize(t.legend,o,f,s),this.updateMargins(C);let k=r.reduce((I,F)=>Math.min(I,i[F].minX),1/0),_=r.reduce((I,F)=>Math.max(I,i[F].maxX),-1/0),P=ie.jsx(p4t,{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:w4t(c,"fillColor",[k,_]),groupingDirection:p,groupingStack:A,groupingLabels:f?o[f.value].labels:{},legend:this.legend,onTooltipHintSwitch:v});this.component=P,(N=this.reactRoot)==null||N.render(P)}renderError(e){var t;(t=this.reactRoot)==null||t.render(ie.jsx(zv,{message:e}))}},b4t=C4t,E4t=10,x4t=class{constructor(e){Be(this,"type","bins");Be(this,"aes",{fillColor:"white",lineColor:$t,opacity:1});this.aes={...this.aes,...e.aes}}},S4t=class{constructor(e){Be(this,"type","binsLine");Be(this,"aes",{opacity:1});this.aes={...this.aes,...e.aes}}},CZ=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,p;H2t.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??E4t,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)??r4t.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:((p=e.frame)==null?void 0:p.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 x4t(v);if(v.type==="binsLine")return new S4t(v);uA(v,"Unknown layer type")}).filter(Boolean)}};function bZ(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 B4t(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 k4t=class extends Rg{constructor(t,n,r){super(t,n);Be(this,"settings");Be(this,"chartRenderer",new b4t);Be(this,"onTooltipHintSwitch",()=>{});Be(this,"calculatedData",null);this.settings=new CZ(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 CZ(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(),my(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(b=>this.data.getColumnCategories(b.value)),f=c.length?bZ([...c]):[["null"]],A=n.map(b=>b.value)??null,p=r?[r.value]:[],v=r?this.data.getColumnCategories(r.value):["null"];s&&(v=Zn.intersection(s,v)),this.data.setGrouping([...A,...p]);let y=n4t(this.data,f,v,t,a,i.xAxis.scale);this.calculatedData={facetKeys:f.map(b=>b.join(", ")),facetKeysCombinations:f,histogramDataByFacets:y,legendInfo:B4t(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 T4t(e,t,n,r,a,i,o){let s={};return t.forEach(c=>{let f=[],A=1/0,p=1/0,v=-1/0,y=-1/0;o.forEach(b=>{e.getRowsByGrouping([...c,b]).forEach(C=>{let x=C[n.value],k=C[r.value];A=Math.min(A,x),p=Math.min(p,k),v=Math.max(v,x),y=Math.max(y,k),x!==null&&k!==null&&f.push({id:`${Object.values(C)}`,x,y:k,label:a?C[a.valueLabels??a.value]:null,dimmed:i?!C[i.value]:!1,data:C})})}),f.sort((b,C)=>b.x-C.x),s[c.join("_")]={minX:A,maxX:v,minY:p,maxY:y,dots:f}}),s}function _4t(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((y,b)=>v.data[y.value]===f[b])),p=a.reduce((v,y,b)=>(v[y.value]=f[b],v),{});return{dots:A,data:p}})};if(c.type==="dots")return{type:"dots",info:c,geoms:s};uA(c,"Unknown scatterplot layer type")}),i},{})}function zD(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 EZ(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 D4t(e,t){return zD(e)-t}function P4t(e,t){return EZ(e)-t}function xZ(e){let t=zD(e),n=t+e.width,r=EZ(e),a=r+e.height;return{minX:t,maxX:n,minY:r,maxY:a}}function SZ(e,t,n){let r=D4t(e,n),a=zD(e)+e.width+n,i=P4t(e,t),o=i+e.height+2*t;return{minX:r,maxX:a,minY:i,maxY:o}}function M4t(e,t,n){return e.minX>=0&&e.maxX<=t&&e.minY>=0&&e.maxY<=n}var cE=2;function H4t(e,t=cE,n=cE){e.forEach(r=>{r.bbox=xZ(r),r.outerBBox=SZ(r,t,n)})}function fE(e,t,n,r=cE,a=cE){let i=[],o=new ndt,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 p={...c,yPosition:f,xPosition:A};if(p.bbox=xZ(p),p.outerBBox=SZ(p,r,a),M4t(p.outerBBox,t,n)&&!o.collides(p.outerBBox)){i.push(p),o.insert(p.outerBBox);break}}return i}function I4t(e){return`translate(${e},0)`}function R4t(e){return`translate(0,${e})`}function N4t(e){return e==="bottom"?`translate(0,${Ff})`:`translate(${-Ff},0)`}function L4t(e){return e==="bottom"?"hanging":"central"}function $4t(e){return e==="bottom"?"middle":"end"}var dE=({scale:e,tickSize:t=6,tickPadding:n=Ff,orient:r="bottom",onlyPositive:a=!1,offset:i=typeof window<"u"&&window.devicePixelRatio>1?0:.5})=>{function o(C){return x=>{let k=C(x);return k===void 0?0:+k}}let{ticks:s,format:c}=B4(e,a,r==="bottom"),f=Math.max(t,0)+n,A=o(e.copy()),p=r==="bottom"?I4t:R4t,v=r==="left"?-1:1,y={[(r==="left"?"x":"y")+"2"]:v*t},b={[r==="left"?"x":"y"]:v*f};return ie.jsx("g",{children:s.map((C,x)=>ie.jsxs("g",{className:"tick",transform:p(A(C)+i),children:[ie.jsx("line",{stroke:$t,...y}),ie.jsx("g",{transform:N4t(r),children:ie.jsx("text",{fill:$t,fontSize:"14px",fontWeight:"500",fontFamily:"Manrope",dominantBaseline:L4t(r),textAnchor:$4t(r),...b,children:c(C)})})]},x))})},F4t=1;function V4t({scaleX:e,scaleY:t,width:n,height:r,axisX:a,axisY:i,frameType:o,updatingKey:s=""}){let[c,f]=tn.useState(e.ticks()),[A,p]=tn.useState(t.ticks()),{significantLines:v=[]}=a,{significantLines:y=[]}=i;return tn.useEffect(()=>{let b=e.ticks().filter(x=>!v.includes(x)),C=t.ticks().filter(x=>!y.includes(x));f(b),p(C)},[e,t,s]),ie.jsxs("g",{stroke:$f,children:[a.showGrid&&c.map(b=>{let C=e(b);return ie.jsx("line",{x1:C,x2:C,y1:0,y2:r},`x_${C}_${r}`)}),i.showGrid&&A.map(b=>{let C=t(b);return ie.jsx("line",{x1:0,x2:n,y1:C,y2:C},`y_${C}_${n}`)}),ie.jsx("g",{strokeDasharray:Vf(a.significantLinesStyle),stroke:$t,children:v.map(b=>{let C=e(b);return ie.jsx("line",{x1:C,x2:C,y1:0,y2:r},`significant_${C}_${r}`)})}),ie.jsx("g",{strokeDasharray:Vf(i.significantLinesStyle),stroke:$t,children:y.map(b=>{let C=t(b);return ie.jsx("line",{x1:0,x2:n,y1:C,y2:C},`significant_${C}_${n}`)})}),o!=="empty"&&ie.jsxs("g",{strokeWidth:F4t,children:[(a.showGrid||o!=="left")&&ie.jsx("line",{stroke:o==="left"?$f:$t,x1:"0",x2:n,y1:r,y2:r}),(a.showGrid||o!=="bottom")&&ie.jsx("line",{stroke:o==="bottom"?$f:$t,x1:"0",x2:"0",y1:"0",y2:r}),(a.showGrid||o==="full")&&ie.jsx("line",{stroke:o==="full"?$t:$f,x1:n,x2:n,y1:"0",y2:r}),(i.showGrid||o==="full")&&ie.jsx("line",{stroke:o==="full"?$t:$f,x1:"0",x2:n,y1:"0",y2:"0"})]})]})}var O4t=new Ac("16px Manrope");function BZ(e,t){return typeof e=="string"?e:t.length?t[0].data[e.value]:""}function Q4t(e,t,n=[]){let r=e.data,a=[`x: ${ni(e.x)}`,`y: ${ni(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 z4t(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:` = ${ni(e.r2)}`})]})}function U4t(e){return typeof e.pValue>"u"?null:ie.jsx("tspan",{children:`p-value = ${ni(e.pValue)}`})}function G4t(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 = ${ni(t)} ± ${ni(n)}, intercept = ${ni(r)} ± ${ni(a)}`})})}function j4t(e){let t=[z4t(e),U4t(e),G4t(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 UD=3;function kZ(e,t,n,r){if(!r)return[];let a=[];for(let i of e){let o=i.label;if(!o)continue;let s=O4t.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)+UD})}return a}function Y4t({facetKey:e,width:t,height:n,dimensions:r,scales:a,xAxis:i,yAxis:o,frameType:s,dotsData:c,facetSettings:f,trendsData:A,keyColumn:p,margins:v,chartSizes:y,tooltips:b,tooltipsContainer:C,captionsSizes:x,facetTitle:k,onlyPositive:_,layersData:P,aesGetters:N,tooltipsData:I}){let[F,Q]=tn.useState(),{padding:Z}=r,{dots:ee}=c,le=i.showTicks?l2:0,z=o.showTicks?l2:0,U=BZ(i.title,ee),G=BZ(o.title,ee),Y=r.chartEdgeSides.includes("left")||!(f!=null&&f.sharedY),X=r.chartEdgeSides.includes("bottom")||!(f!=null&&f.sharedX),te=r.chartEdgeSides.includes("left"),he=r.chartEdgeSides.includes("bottom"),ae={left:v.left+r.left+Z.left,right:y.totalWidth-(v.left+r.left+Z.left),top:v.top+r.top+Z.top,bottom:y.totalHeight-(v.top+r.top+Z.top)},ge=!1,[me,fe]=tn.useState(()=>kZ(ee,a,N,P.find(Oe=>Oe.type==="dots"))),[be,He]=tn.useState(()=>fE(me,t,n,UD,UD)),[_e,Ie]=tn.useState(null);tn.useEffect(()=>{fe(kZ(ee,a,N,P.find(Oe=>Oe.type==="dots")))},[ee,a,N,P]),tn.useEffect(()=>{let Oe=fE(me,t,n);He(Oe)},[me,t,n]);let Ue=F&&I.fixed;return ie.jsxs("g",{transform:`translate(${r.left+Z.left},${r.top+Z.top})`,children:[ge,k.length&&ie.jsxs("g",{children:[s==="full"&&ie.jsx("rect",{x:"0",y:-Z.top,height:Z.top,width:t,fill:"#F7F8FA",stroke:$t}),k.map((Oe,ft)=>{let Ve=k.length,Xe=(Z.top-ED*Ve)/2;return ie.jsx("text",{fontSize:"14px",fontWeight:"500",fill:$t,x:t/2,dy:Xe+ED/2-Z.top,y:ft*ED,textAnchor:"middle",dominantBaseline:"central",children:Oe},ft)})]}),ie.jsxs("g",{dominantBaseline:"central",textAnchor:"middle",fontWeight:"500",fontSize:"14px",fill:$t,children:[he&&ie.jsx("text",{x:t/2,y:n+Z.bottom-Ov-v4/2,children:U}),ge,te&&ie.jsx("text",{x:-Z.left+Ov+v4/2,y:n/2,transform:`rotate(-90,${-Z.left+Ov+v4/2},${n/2})`,children:G}),ge]}),ie.jsx(V4t,{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(dE,{scale:a.x,orient:"bottom",onlyPositive:_.x,tickSize:le}),ge]}),Y&&ie.jsxs("g",{children:[ie.jsx(dE,{scale:a.y,orient:"left",onlyPositive:_.y,tickSize:z}),ge]}),A&&A.map(({predict:Oe,getArea:ft,color:Ve,data:Xe,bounded:tt,xBounds:qe,stats:gt},wt)=>{let[Xt,rr]=tt?qe:a.x.domain(),sr=(rr-Xt)/15,ra=Oe(Xt),vi=Oe(rr);if(isNaN(ra)||isNaN(vi))return null;let ea=N.dotColor(Ve,Xe);return ie.jsxs("g",{children:[ie.jsx("text",{y:wt*20+20,fill:ea,x:t-8,textAnchor:"end",children:j4t(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(vi),stroke:ea})]},wt)}),P.map((Oe,ft)=>{if(Oe.type==="dots")return ie.jsxs("g",{children:[ee.map(Ve=>{let Xe=Ue&&I.selectedData===Ve,tt=ie.jsx("g",{transform:`translate(${a.x(Ve.x)},${a.y(Ve.y)})`,opacity:Ve.dimmed?.3:1,onMouseOver:()=>I.onMouseOver(Ve,e),onMouseLeave:()=>I.onMouseLeave(),children:jc(N.dotShape(Oe.info.aes.dotShape,Ve.data),N.dotSize(Oe.info.aes.dotSize,Ve.data),N.dotColor(Oe.info.aes.dotFill,Ve.data))},Ve.id);return Xe?uu.createPortal(tt,F):tt}),be.map(Ve=>{let{name:Xe,height:tt,bbox:qe,width:gt}=Ve;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:()=>Ie(Ve.dot),onMouseLeave:()=>Ie(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})]})},Ve.dot.id)}),_e&&ie.jsxs("g",{transform:`translate(${a.x(_e.x)},${a.y(_e.y)})`,children:[jc(N.dotShape(Oe.info.aes.dotShape,_e.data),N.dotSize(Oe.info.aes.dotSize,_e.data)+1,"white","white"),jc(N.dotShape(Oe.info.aes.dotShape,_e.data),N.dotSize(Oe.info.aes.dotSize,_e.data),N.dotColor(Oe.info.aes.dotFill,_e.data))]},"activeDot")]},ft);if(Oe.type==="curve"&&!Oe.info.smoothing)return Oe.geoms.map((Ve,Xe)=>ie.jsx("g",{children:ie.jsx("polyline",{points:Ve.dots.map(tt=>`${a.x(tt.x)},${a.y(tt.y)}`).join(" "),fill:"none",stroke:N.lineColor(Oe.info.aes.lineColor,Ve.data),strokeWidth:Oe.info.aes.lineWidth,strokeDasharray:Vf(Oe.info.aes.lineShape)})},Xe));if(Oe.type==="curve"&&Oe.info.smoothing)return Oe.geoms.map((Ve,Xe)=>ie.jsx("g",{children:ie.jsx("path",{d:gy().curve(yy).x(tt=>a.x(tt.x)).y(tt=>a.y(tt.y))(Ve.dots)??"",fill:"none",stroke:N.lineColor(Oe.info.aes.lineColor,Ve.data),strokeWidth:Oe.info.aes.lineWidth,strokeDasharray:Vf(Oe.info.aes.lineShape)})},Xe))}),b.show&&I.selectedData&&I.currentFacet===e&&ie.jsx(cu,{content:Q4t(I.selectedData,p,b==null?void 0:b.content),x:a.x(I.selectedData.x),y:a.y(I.selectedData.y),active:!0,sideDistances:ae,fixed:I.fixed,onClose:I.onClose,container:C}),ie.jsxs("g",{children:[I.fixed&&ie.jsx("rect",{width:y.chartWidth,height:y.chartHeight,fill:"rgba(255, 255, 255, 0.8)"}),ie.jsx("g",{ref:Oe=>{Oe&&!F&&Q(Oe)}})]})]})}function W4t({settingsId:e,chartSettings:t,chartSizes:n,chartsDimensions:r,facetKeys:a,facetSettings:i,scales:o,groupedDots:s,legendData:c,trendsData:f,columnsCount:A,margins:p,keyColumn:v,mainTitle:y,facetTitles:b,captionsSizes:C,onlyPositive:x,layersData:k,aesGetters:_,onTooltipHintSwitch:P}){let N=f2(P),[I,F]=tn.useState(),Q=tn.useRef(null);tn.useEffect(()=>{Q.current&&F(Q.current)},[]);let{xAxis:Z,yAxis:ee,title:le,frame:z,legend:U,tooltips:G}=t,Y=r[a[0]].padding,X=r[a[A-1]].padding,te=n.chartsWidth+jb,he=Y.top;return ie.jsx(h2,{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:$g}),ie.jsxs("g",{transform:`translate(${p.left},${p.top})`,fontFamily:"Manrope",children:[ie.jsx(v2,{title:y,show:le.show,position:le.position,leftPadding:Y.left,rightPadding:X.right,chartsWidth:n.chartsWidth}),a.map(ae=>ie.jsx(Y4t,{facetKey:ae,scales:{x:o.x[ae],y:o.y[ae]},width:n.chartWidth,height:n.chartHeight,dimensions:r[ae],margins:p,chartSizes:n,facetSettings:i,xAxis:Z,yAxis:ee,frameType:z.type,dotsData:s[ae],trendsData:f?f[ae]:null,tooltips:G,tooltipsContainer:I,keyColumn:v,facetTitle:b[ae],captionsSizes:C,layersData:k[ae],onlyPositive:x,aesGetters:_,tooltipsData:N},ae)),U.show&&ie.jsx("g",{transform:`translate(${te},${he})`,children:ie.jsx(m2,{legendData:c})})]}),ie.jsx("g",{ref:Q,style:{outline:"none"}})]})})}function X4t(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 K4t(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!=="",p=n.yAxisCaptionsWidth+2*xD,v=(t.showTicks?l2:0)+xD,y=c?v4+Ov:0,b=n.xAxisCaptionsWidth+2*xD,C=e.showTicks?l2:0,x=A?v4+Ov:0,k=p+v+y+GX,_=b+C+x+GX,P=Math.max(...r.map(N=>a[N].length));return{left:s?k:Ov,top:P===0?0:$yt*2+P*b4,bottom:f?_+8:Ov,right:Ov}}function Z4t(e,t,n){let r=[];for(let a=0;a<t;a++)r.push(e.slice(a*n,a*n+n));return r}function J4t(e,t){let n=Math.floor(e/t),r=e-n*t;return[n,r]}function q4t(e){return typeof e=="object"&&e!==null&&"type"in e&&"value"in e&&e.type==="grouping"}function B2(e,t){return function(n,r){var a,i;if(rh(n)&&t==="dotSize"){let{domain:o,range:s}=n,c=iv().domain(o).range(s)(Number(r[n.columnName.value]));return Math.max(1,c)}if(rh(n)&&(t==="dotFill"||t==="lineColor")){let{domain:o,range:s,type:c="linear"}=n;return k4(s,o,c)(Number(r[n.columnName.value]))}if(q4t(n)){let o=n.value;return(i=((a=e[o])==null?void 0:a[String(r[o])])??CD)==null?void 0:i[t]}return n}}function ewt(e){return{dotShape:B2(e,"dotShape"),dotColor:B2(e,"dotFill"),dotSize:B2(e,"dotSize"),lineShape:B2(e,"lineShape"),lineColor:B2(e,"lineColor"),trendColor:B2(e,"dotFill")}}var twt=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=Gh(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,p,v)=>{let[y,b]=J4t(v,this.columnsCount),C=X4t(v,e.length,this.columnsCount,this.rowsCount),x=K4t(n,r,this.captionsSizes,Z4t(e,this.rowsCount,this.columnsCount)[y],this.facetTitles,C,t),k=a+x.left+x.right,_=i+x.top+x.bottom;return A[p]={left:o,top:s,chartEdgeSides:C,padding:x,inner:{width:a,height:i},outer:{width:k,height:_}},o+=k,b===this.columnsCount-1&&(o=0,s+=_),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],[p,v]=[1/0,-1/0],y=e.reduce((C,x)=>{let k=a[x],{minX:_,minY:P,maxX:N,maxY:I}=k;return f=Math.min(f,_),p=Math.min(p,P),A=Math.max(A,N),v=Math.max(v,I),C[x]={minX:_,maxX:N,minY:P,maxY:I},C},{});e.forEach(C=>{let x=n.scale==="log"?Um():Zr(),k=y[C],_=n.lowerValue?Number(n.lowerValue):t.sharedX?f:k.minX,P=n.upperValue?Number(n.upperValue):t.sharedX?A:k.maxX;if(typeof n.symmetricRange<"u"){let F=n.symmetricRange;if(F>=_&&F<=P){let Q=Math.max(F-_,P-F);_=F-Q,P=F+Q}}let N=[0,this.chartSizes.chartWidth],I=x.copy().domain([_,P]).range([Gb.LEFT,this.chartSizes.chartWidth-Gb.RIGHT]);x.domain([I.invert(0),I.invert(this.chartSizes.chartWidth)]).range(N).nice(),this.scales.x[C]=x});let b=e.reduce((C,x)=>{let k=i?i[x]:[];return C[x]=k.reduce((_,P)=>{let N=P.bounded?P.xBounds:this.scales.x[x].domain(),I=P.getInterval(N[0]),F=P.getInterval(N[1]);return _.minY=Math.min(_.minY,isNaN(I.left)?_.minY:I.left,isNaN(F.left)?_.minY:F.left),_.maxY=Math.max(_.maxY,isNaN(I.right)?_.maxY:I.right,isNaN(F.right)?_.maxY:F.right),_},{minY:1/0,maxY:-1/0}),p=Math.min(p,C[x].minY),v=Math.max(v,C[x].maxY),C},{});e.forEach(C=>{let x=r.scale==="log"?Um():Zr(),k=y[C],_=b[C],P=r.lowerValue?Number(r.lowerValue):t.sharedY?p:Math.min(k.minY,_.minY),N=r.upperValue?Number(r.upperValue):t.sharedY?v:Math.max(k.maxY,_.maxY);if(typeof r.symmetricRange<"u"){let Q=r.symmetricRange;if(Q>=P&&Q<=N){let Z=Math.max(Q-P,N-Q);P=Q-Z,N=Q+Z}}let I=[this.chartSizes.chartHeight,0],F=x.copy().domain([P,N]).range([this.chartSizes.chartHeight-Gb.BOTTOM,Gb.TOP]);x.domain([F.invert(this.chartSizes.chartHeight),F.invert(0)]).range(I).nice(),this.scales.y[C]=x})}updateCaptionsSize(e){let t=new Ac("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}=B4(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=Uv(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]=Uv(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 p=t[A.value];if(p.usedAes.length===0||!p.aesMap)return;let v={};p.values.forEach(C=>{v[C]||(v[C]={...bD}),p.usedAes.forEach(x=>{var k,_,P;(x==="dotFill"||x==="lineColor")&&(v[C].color=((k=p.aesMap[C])==null?void 0:k[x])??$t),x==="dotShape"&&(v[C].shape=((_=p.aesMap[C])==null?void 0:_[x])??"21"),x==="dotSize"&&(v[C].size=((P=p.aesMap[C])==null?void 0:P[x])??3)})});let y=A.label??A.value,b=zo().domain(p.values).range(p.values.map(C=>v[C]));a.push({...i,id:A.value,type:"dots",title:y,scale:b,values:p.values,labels:p.labels})}),r.forEach(A=>{if(A.type==="dots"&&rh(A.aes.dotFill)){let{domain:p,range:v,columnName:y,type:b="linear"}=A.aes.dotFill,C=y.label??y.value,x=k4(v,p,"linear"),k=(b==="log"?av():Zr()).domain(p).range([this.chartSizes.chartHeight,0]),_=c2(k,p);a.push({...i,id:"dotFill",type:"continuous",title:C,scale:x,tickPositionScale:k,values:_})}if(A.type==="dots"&&rh(A.aes.dotSize)){let{columnName:p,domain:v,range:y}=A.aes.dotSize,b=p.label??p.value,C=iv(v,y),x=C.ticks(3),k=C.tickFormat(3),_=x.reduce((P,N)=>(P[String(N)]=k(N),P),{});a.push({...i,id:p.value,type:"size",title:b,scale:C,values:x,labels:_})}}),!a.length){this.legend={width:0,height:0,items:[]};return}let o=y2(a,this.chartSizes.chartHeight),s=o[o.length-1],c=s.left+s.width+jb,f=this.chartSizes.chartHeight;this.legend={width:c,height:f,items:o}}render(e,t,n,r,a,i,o,s,c,f,A,p,v,y,b){var I;let{xAxis:C,yAxis:x,size:k,title:_,legend:P}=t;this.updateChartSizes(k),this.updateViewport(r,n,C,x,i,o),this.updateCaptionsSize(c.y),this.createFacetTitles(r,a),this.updateChartDimensions(r,n,C,x),this.updateLegendSize(P,f,v,y),this.createMainTitle(r,_),this.updateMargins();let N=ie.jsx(W4t,{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:ewt(p),onTooltipHintSwitch:b});this.component=N,(I=this.reactRoot)==null||I.render(N)}renderError(e){var t;(t=this.reactRoot)==null||t.render(ie.jsx(zv,{message:e}))}},nwt=twt,rwt=class{constructor(e){Be(this,"type","dots");Be(this,"aes",{dotFill:$t,dotShape:"21",dotSize:3,opacity:1});this.aes={...this.aes,...e.aes}}},awt=class{constructor(e){Be(this,"type","curve");Be(this,"smoothing");Be(this,"aes",{lineColor:$t,lineWidth:1,lineShape:"solid",opacity:1});this.smoothing=e.smoothing??!1,this.aes={...this.aes,...e.aes}}},TZ=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;g2t.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??$t}:null,this.layers=e.layers.map(i=>{if(i.type==="dots")return new rwt(i);if(i.type==="curve")return new awt(i);uA(i,"Unknown layer type")}).filter(Boolean)}},iwt=Dht(kyt()),_Z=.05;function owt(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,p=5394.196021424751,v=21213.794301586597,y=39307.89580009271,b=28729.085735721943,C=5226.495278852854,x=1.4234371107496835,k=4.630337846156546,_=5.769497221460691,P=3.6478483247632045,N=1.2704582524523684,I=.2417807251774506,F=.022723844989269184,Q=.0007745450142783414,Z=2.053191626637759,ee=1.6763848301838038,le=.6897673349851,z=.14810397642748008,U=.015198666563616457,G=.0005475938084995345,Y=10507500716444169e-25,X=6.657904643501103,te=5.463784911164114,he=1.7848265399172913,ae=.29656057182850487,ge=.026532189526576124,me=.0012426609473880784,fe=27115555687434876e-21,be=20103343992922881e-23,He=.599832206555888,_e=.1369298809227358,Ie=.014875361290850615,Ue=.0007868691311456133,Oe=18463183175100548e-21,ft=1421511758316446e-22,Ve=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)/(((((((C*tt+b)*tt+y)*tt+v)*tt+p)*tt+A)*tt+f)*tt+1),qe):(tt=e,tt=Math.sqrt(-Math.log(tt)),tt<=5?(tt+=-1.6,qe=(((((((Q*tt+F)*tt+I)*tt+N)*tt+P)*tt+_)*tt+k)*tt+x)/(((((((Y*tt+G)*tt+U)*tt+z)*tt+le)*tt+ee)*tt+Z)*tt+1)):(tt+=-5,qe=(((((((be*tt+fe)*tt+me)*tt+ge)*tt+ae)*tt+he)*tt+te)*tt+X)/(((((((Ve*tt+ft)*tt+Oe)*tt+Ue)*tt+Ie)*tt+_e)*tt+He)*tt+1)),qe=-qe,qe)}function DZ(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),p=48/(A*A),v=((20700*A/p-98)*A-16)*A+96.36,y=((94.5/(p+v)-3)/p+1)*a(A*s*.5)*t;return c=y*e,f=i(c,2/t),f>.05+A?(c=owt(e/2),f=c*c,t<5&&(v=v+.3*(t-4.5)*(c+.6)),v=(((.05*y*c-5)*c-7)*c-2)*c+p+v,f=(((((.4*f+6.3)*f+36)*f+94.5)/v-f-3)/p+1)*c,f=A*f*f,f>.002?f=o(f)-1:f=.5*f*f+f):f=((1/(((t+6)/(t*f)-.089*y-.822)*(t+2)*3)+.5/(t+4))*f-1)*(t+1)/(t+2)+1/f,a(t*f)}function lwt(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 swt(e,t,n){let r=A=>A*t+n,a=e.length,i=oc(e,A=>A.x)/e.length,o=DZ(_Z,a-2),s=Math.sqrt(oc(e,A=>(A.y-r(A.x))**2)/(a-2)/oc(e,A=>(A.x-i)**2)),c=s*o,f=s*Math.sqrt(oc(e,A=>A.x**2)/a)*o;return{slope:t,intercept:n,slopeError:c,interceptError:f}}function uwt(e,t){let n=oc(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=DZ(_Z,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,p=c+o*f;return{x:s,y:c,left:isNaN(A)?c:A,right:isNaN(p)?c:p}}}function cwt(e){let t=e.length;return Math.pow((t*oc(e,n=>n.x*n.y)-oc(e,n=>n.x)*oc(e,n=>n.y))/(Math.sqrt(t*oc(e,n=>n.x*n.x)-Math.pow(oc(e,n=>n.x),2))*Math.sqrt(t*oc(e,n=>n.y*n.y)-Math.pow(oc(e,n=>n.y),2))),2)}function fwt(e,t){let n=Ls(e,t);return Ls(e.map(r=>(t(r)-n)**2))}function PZ(e,t){return Math.sqrt(fwt(e,t))}function dwt(e,t,n){let r=Ls(e,t),a=Ls(e,n),i=e.length;return oc(e,o=>(o.x-r)*(o.y-a))/i}function Awt(e){let t=dwt(e,a=>a.x,a=>a.y),n=PZ(e,a=>a.x),r=PZ(e,a=>a.y);return t/(n*r)}function pwt(e,t){let n=e.length,r=1,a=1,i=n-r-1,o=Ls(e,v=>v.y),s=oc(e,v=>(t(v.x)-o)**2),c=oc(e,v=>(t(v.x)-v.y)**2),f=s/a,A=c/i,p=f/A;return 1-(0,iwt.default)(p,a,i)}function hwt(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(x=>r.every((k,_)=>String(x.data[k.value])===c[_])),[A=0,p=0]=_p(f,x=>x.x),[v,y]=lwt(f),b=x=>v*x+y,C=uwt(f,b);return{predict:b,getInterval:C,getArea:(x,k,_)=>jB().x(P=>x(P.x)).y0(P=>k(P.left)).y1(P=>k(P.right))(_.map(C))??"",color:a.color,bounded:a.bounded,data:f[0].data,showStats:!0,xBounds:[A,p],stats:{r2:cwt(f),r:Awt(f),pValue:pwt(f,b),coefficients:swt(f,v,y)}}}),i},{}):null}function MZ(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 HZ(e){return typeof e=="object"&&"type"in e&&e.type==="grouping"}function vwt(e,t,n,r){return t.reduce((a,i)=>{let o=Zn.uniqBy(e.rows,p=>p[i.value]),s=p=>String(p[i.value]),c=p=>i.valueLabels?String(p[i.valueLabels]):s(p),f=new Set;n.forEach(p=>{p.aes&&Object.entries(p.aes).forEach(([v,y])=>{HZ(y)&&y.value===i.value&&f.add(v)})});let A=o.reduce((p,v)=>(p[s(v)]=c(v),p),{});return a[i.value]={values:o.map(s).filter(p=>p!=="null").sort((p,v)=>A[p].localeCompare(A[v],"en",{numeric:!0})),usedAes:[...f],aesMap:r[i.value],labels:A},a},{})}var mwt=class extends Rg{constructor(t,n,r){super(t,n);Be(this,"settings");Be(this,"chartRenderer",new nwt);Be(this,"onTooltipHintSwitch",()=>{});Be(this,"calculatedData",null);this.settings=new TZ(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 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 scatterplot")}export(){return this._updateChart(),my(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,p=this.data.getColumnCategories(i.value),v=r.map(Q=>this.data.getColumnCategories(Q.value)),y=a.map(Q=>this.data.getColumnCategories(Q.value)),b=v.length?MZ([...v]):[["null"]],C=y.length?MZ([...y]):[["null"]],x=r.map(Q=>Q.value)??null;this.data.setGrouping([...x,i.value]);let k={x:this.data.rows.every(Q=>{let Z=Q[t.value];return Z===null||!(Number(Z)<0)}),y:this.data.rows.every(Q=>{let Z=Q[n.value];return Z===null||!(Number(Z)<0)})},_=T4t(this.data,b,t,n,f,A,p),P=Object.keys(_),N=hwt(_,P,C,a,o),I=vwt(this.data,a,s,c),F=_4t(s,P,_,C,a);this.calculatedData={onlyPositive:k,dotsByFacets:_,facetKeys:P,facetKeysCombinations:b,trendsData:N,legendLabels:I,layersData:F}}_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(([p,v])=>{HZ(v)&&v.value===c.value&&f.add(p)})}),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)}},AE={TOP:30,BOTTOM:30,LEFT:30,RIGHT:30},T4=20,IZ=4,RZ=24;function gwt(e,t,n=[]){let r=e.data,a=[`x: ${ni(e.x)}`,`y: ${ni(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 NZ(e){return typeof e=="string"?e:e.label??e.value}var LZ=gy().curve(yy);function ywt({scales:e,chartSettings:t,mainTitle:n,keyColumn:r,margins:a,chartSizes:i,onlyPositive:o,container:s,zoomStateKey:c,legendData:f,dotsByGrouping:A,layers:p,aesGetters:v,tooltipData:y}){var U;let{title:b,xAxis:C,yAxis:x,frame:k,legend:_}=t,P=C.showTicks?IZ:0,N=x.showTicks?IZ:0,I=C.title,F=x.title,Q={left:0,right:i.chartWidth,top:0,bottom:i.chartHeight};if(!s)return null;let Z=p.find(G=>G.type==="curve"),[ee,le]=tn.useState([]);function z(){let G=Object.entries(A).map(([Y,X])=>({key:Y,d:Z!=null&&Z.smoothing?LZ(X)??"":X.map(te=>`${e.x(te.x)},${e.y(te.y)}`).join(" "),dot:X[0]}));le(G)}return tn.useEffect(()=>{Z&&(LZ.x(G=>e.x(G.x)).y(G=>e.y(G.y)),z())},[c]),tn.useEffect(()=>{Z&&z()},[Z==null?void 0:Z.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:$g}),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(v2,{title:n,show:b.show,position:b.position,leftPadding:a.left,rightPadding:a.right,chartsWidth:i.chartWidth}),ie.jsxs("g",{dominantBaseline:"central",textAnchor:"middle",fontWeight:"500",fontSize:"14px",fill:$t,children:[I&&ie.jsx("text",{x:i.chartWidth/2,y:i.chartHeight+a.bottom-T4/2,children:NZ(I)}),F&&ie.jsx("text",{x:-a.left+T4/2,y:i.chartHeight/2,transform:`rotate(-90,${-a.left+T4/2},${i.chartHeight/2})`,children:NZ(F)})]}),ie.jsx(mZ,{width:i.chartWidth,height:i.chartHeight,scaleX:e.x,scaleY:e.y,axisX:C,axisY:x,updatingKey:c,frameType:k.type}),ie.jsx("g",{transform:`translate(0,${i.chartHeight})`,children:ie.jsx(dE,{scale:e.x,orient:"bottom",onlyPositive:o.x,tickSize:P})}),ie.jsx("g",{children:ie.jsx(dE,{scale:e.y,orient:"left",onlyPositive:o.y,tickSize:N})}),Z&&Z.smoothing&&ie.jsx("g",{clipPath:"url(#viewportClipPath)",children:ee.map(({key:G,d:Y,dot:X})=>{var te;return ie.jsx("path",{d:Y,fill:"none",stroke:v.dotFill(X.data),strokeWidth:(te=Z.aes)==null?void 0:te.lineWidth,strokeDasharray:v.lineType(X.data)},G)})}),Z&&!Z.smoothing&&ie.jsx("g",{clipPath:"url(#viewportClipPath)",children:ee.map(({key:G,d:Y,dot:X})=>{var te;return ie.jsx("polyline",{points:Y,fill:"none",stroke:v.dotFill(X.data),strokeWidth:(te=Z.aes)==null?void 0:te.lineWidth,strokeDasharray:v.lineType(X.data)},G)})}),y.selectedData&&ie.jsx(cu,{content:gwt(y.selectedData,r,(U=t.tooltips)==null?void 0:U.content),x:e.x(y.selectedData.x),y:e.y(y.selectedData.y),active:!0,fixed:y.fixed,sideDistances:Q,container:s,onClose:y.onClose}),_.show&&ie.jsx("g",{transform:`translate(${i.chartWidth+RZ},0)`,children:ie.jsx(m2,{legendData:f})})]})]})}var wwt=k6.memo(ywt),Cwt=20;function bwt({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),p=tn.useRef(null),v=tn.useRef(null),y=tn.useRef(a);function b(){A.current=null,p.current=null,v.current=null,y.current=[],i([]),s(null)}function C(_){n||_.key!=="Escape"||b()}tn.useEffect(()=>{n&&(A.current=null,p.current=null,v.current=null,s(null))},[n]),tn.useEffect(()=>(document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)),[]),tn.useEffect(()=>{if(o&&c)return;if(a.length===0){r([]);return}let _=a.map(P=>P[0]);_.push(a[a.length-1][1]),r(_)},[a]);function x(){if(!A.current||n)return;let _=[...A.current],P=e.x.invert(_[0]),N=e.y.invert(_[1]),I=y.current,F=v.current,Q=p.current&&I.length>1?Math.sqrt((_[0]-p.current[0])**2+(_[1]-p.current[1])**2):1/0;v.current?v.current&&Q>Cwt?(I=[...I,[v.current,[P,N]]],F=[P,N]):(I=[...I,[v.current,[P,N]]],I.length>2&&(I=[...I,[I[I.length-1][1],I[0][0]]]),F=null,I.length<=2?r([]):r(I.map(Z=>Z[0])),p.current=null):(p.current=_,I=[],F=[P,N],r([])),i(I),s(F),y.current=I,v.current=F}function k(_){let P=[_.nativeEvent.offsetX,_.nativeEvent.offsetY];f(P),A.current=P}return ie.jsxs("g",{children:[ie.jsx("rect",{fill:"transparent",width:t.chartWidth,height:t.chartHeight,onMouseMove:k,onClick:x}),a.map(([_,P],N)=>ie.jsx("line",{x1:e.x(_[0]),y1:e.y(_[1]),x2:e.x(P[0]),y2:e.y(P[1]),stroke:$t,style:{pointerEvents:"none"}},N)),o&&c&&ie.jsx("line",{x1:e.x(o[0]),y1:e.y(o[1]),x2:c[0],y2:c[1],stroke:$t,style:{pointerEvents:"none"}},"lastLine")]})}function Ewt({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:p,width:v}=c;return ie.jsx("g",{children:ie.jsxs("g",{transform:`translate(${p.minX},${p.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(bwt,{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 xwt=Ewt;function Swt({settingsId:e,scales:t,chartSettings:n,mainTitle:r,keyColumn:a,margins:i,chartSizes:o,captionsSizes:s,onlyPositive:c,container:f,zoomStateKey:A,aesGetters:p,legendData:v,labels:y,onPolygonUpdate:b,onTooltipHintSwitch:C,lassoMode:x,dotsByGrouping:k,layers:_,selectedDot:P=null}){if(!f)return null;let N=f2(C);return tn.useEffect(()=>{P?N.onMouseOver(P):N.onMouseLeave()},[P]),ie.jsx("div",{children:ie.jsxs(h2,{dataId:e,children:[ie.jsx(wwt,{aesGetters:p,dotsByGrouping:k,layers:_,scales:t,keyColumn:a,margins:i,mainTitle:r,captionsSizes:s,chartSettings:n,chartSizes:o,onlyPositive:c,container:f,zoomStateKey:A,legendData:v,tooltipData:N}),uu.createPortal(ie.jsx(xwt,{scales:t,container:f,aesGetters:p,labels:y,chartSizes:o,selectedDot:P,onPolygonUpdate:b,lassoMode:x,tooltipData:N}),f)]})})}var $Z=e=>e.selection()!==e,FZ=(e,t)=>{e=e||"g";let n=(i,o)=>o,r=null,a=function(i,o){o=o||(y=>y);let s=i.selection(),c=$Z(i)?i:null,f=s.selectChildren(t==null?e:`${e}.${t}`).data(o,n),A=f.enter().append(e).attr("class",t),p=f.exit();f=f.merge(A);let v=c||r;return v&&(f=f.transition(v).style("opacity",1),A.style("opacity",1e-6),p=p.transition(v).style("opacity",1e-6)),p.remove(),f.enter=()=>A,f.exit=()=>p,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},VZ=(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}},OZ=(e,t,...n)=>{for(let r of n)e[r]=VZ(e,t,r);return e},Bwt=e=>t=>e.reduce((n,r)=>n&&r(n),t),GD=(e,t,...n)=>{let r=Bwt(n);for(let a of Object.keys(t)){let i=r(a);i&&(e[i]=VZ(e,t,a))}return e},kwt=e=>e.map(t=>typeof t=="string"?new RegExp(`^${t}$`):t),Twt=(...e)=>(e=kwt(e),t=>e.every(n=>!n.test(t))&&t),k2=e=>typeof e=="function"?e:()=>e;function _wt(){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 Dwt=(e,t)=>{switch(e){case"left":return t/2;case"right":return-t/2;default:return 0}},QZ=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},Pwt=()=>{let e=()=>0,t=s=>s.x,n=s=>s.y,r="center",a=()=>5,i="vertical",o=QZ({decorate:()=>{},defined:(s,c)=>_wt(e,t,n)(s,c),xScale:rv(),yScale:rv()});return o.values=(s,c)=>{let f=a(s,c),A=Dwt(r,f),p=o.xScale(),v=o.yScale();if(i==="vertical"){let y=v(n(s,c),c),b=v(e(s,c),c),C=p(t(s,c),c)+A;return{d:s,x:C,y,y0:b,width:f,height:y-b,origin:[C,y],baseOrigin:[C,b],transposedX:C,transposedY:y}}else{let y=p(n(s,c),c),b=p(e(s,c),c),C=v(t(s,c),c)+A;return{d:s,x:C,y,y0:b,width:f,height:y-b,origin:[y,C],baseOrigin:[b,C],transposedX:y,transposedY:C}}},o.xValues=()=>i==="vertical"?[t]:[e,n],o.yValues=()=>i!=="vertical"?[t]:[e,n],o.baseValue=(...s)=>s.length?(e=k2(s[0]),o):e,o.crossValue=(...s)=>s.length?(t=k2(s[0]),o):t,o.mainValue=(...s)=>s.length?(n=k2(s[0]),o):n,o.bandwidth=(...s)=>s.length?(a=k2(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},Mwt=()=>{let e=Pwt(),t=k2(64),n=lF,r=o4(),a=o4(),i=o4().type(nh.UNSIGNED_SHORT),o=o4().type(nh.UNSIGNED_BYTE),s=iht().crossValueAttribute(r).mainValueAttribute(a).sizeAttribute(i).definedAttribute(o),c=(b,C)=>!1,f=Aht,A=[],p=null,v=null,y=b=>{let C=f(e.xScale()),x=f(e.yScale()),k=!c(A,b);k&&(A=b,i.value((_,P)=>t(_,P)).data(b),o.value((_,P)=>e.defined()(_,P)).data(b)),(k||C.scale!==p)&&(p=C.scale,e.orient()==="vertical"?r.value((_,P)=>C.scale(e.crossValue()(_,P))).data(b):r.value((_,P)=>C.scale(e.mainValue()(_,P))).data(b)),(k||x.scale!==v)&&(v=x.scale,e.orient()==="vertical"?a.value((_,P)=>x.scale(e.mainValue()(_,P))).data(b):a.value((_,P)=>x.scale(e.crossValue()(_,P))).data(b)),s.xScale(C.webglScale).yScale(x.webglScale).type(wht(n)).decorate(_=>e.decorate()(_,b,0)),s(b.length)};return y.size=(...b)=>b.length?(t=k2(b[0]),y):t,y.type=(...b)=>b.length?(n=b[0],y):n,y.equals=(...b)=>b.length?(c=b[0],y):c,y.scaleMapper=(...b)=>b.length?(f=b[0],y):f,GD(y,e,Twt("baseValue","bandwidth","align")),OZ(y,s,"context","pixelRatio"),y},zZ=()=>{let e=[],t=a=>a,n=(a,i)=>i,r=QZ({decorate:()=>{},xScale:rv(),yScale:rv()});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},Hwt=()=>{let e=zZ(),t=FZ("g"),n=FZ("g","multi"),r=a=>{$Z(a)&&(n.transition(a),t.transition(a));let i=e.mapping(),o=e.series(),s=e.xScale(),c=e.yScale();a.each((f,A,p)=>{let v=n(ws(p[A]),o);v.each((y,b,C)=>{y.xScale(s).yScale(c);let x=i(f,b,o);t(ws(C[b]),[x]).call(y)}),v.selection().order(),e.decorate()(v,f,A)})};return GD(r,e),OZ(r,n,"key"),r},Iwt=()=>{let e=null,t=1,n=zZ(),r=a=>{let i=n.mapping(),o=n.series(),s=n.xScale(),c=n.yScale();o.forEach((f,A)=>{let p=i(a,A,o);f.context(e).pixelRatio(t).xScale(s).yScale(c);let v;f.decorate?(v=f.decorate(),f.decorate((y,b,C)=>{n.decorate()(y,a,A),v(y,b,C)})):n.decorate()(e,a,A),f(p),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,GD(r,n),r};function UZ(e){return e/2.35*(e/2.35)*64}function jD(e,t){return e+(1-e)*(1-t)}function YD(e,t){return[jD(e.r/255,t),jD(e.g/255,t),jD(e.b/255,t),1]}function Rwt(e){return typeof e=="object"&&e!==null&&"type"in e&&"value"in e&&e.type==="grouping"}function WD(e={},t,n){return function(r){var a,i;if(Rwt(n)){let o=n.value,s=r[o];return(i=((a=e[o])==null?void 0:a[String(s)])??CD)==null?void 0:i[t]}if(rh(n)&&t==="dotFill"){let{domain:o,range:s,type:c="linear"}=n;return k4(s,o,c)(Number(r[n.columnName.value]))}if(rh(n)&&t==="dotSize"){let{domain:o,range:s}=n,c=iv().domain(o).range(s)(Number(r[n.columnName.value]));return Math.max(1,c)}return n}}function GZ(e,t){let n=t.find(a=>a.type==="dots"),r=t.find(a=>a.type==="curve");return{dotFill:WD(e,"dotFill",n.aes.dotFill),dotSize:WD(e,"dotSize",n.aes.dotSize),lineType:WD(e,"lineShape",(r==null?void 0:r.aes.lineShape)??"solid")}}var Nwt=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:()=>$t,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&&Nb(this.polygon,[n.x,n.y])).map(n=>n.data.key);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=Gh(this.rootNode))}updateChartSizes(e){this.chartSizes.chartWidth=e.width,this.chartSizes.chartHeight=e.height}updateViewport(e,t,n){let r=e.scale==="log"?Um():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 y=e.symmetricRange;if(y>=a&&y<=o){let b=Math.max(y-a,o-y);a=y-b,o=y+b}}if(typeof t.symmetricRange<"u"){let y=t.symmetricRange;if(y>=i&&y<=s){let b=Math.max(y-i,s-y);i=y-b,s=y+b}}let c=[0,this.chartSizes.chartWidth],f=r.copy().domain([a,o]).range([AE.LEFT,this.chartSizes.chartWidth-AE.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"?Um():Zr(),p=[this.chartSizes.chartHeight,0],v=A.copy().domain([i,s]).range([this.chartSizes.chartHeight-AE.BOTTOM,AE.TOP]);A.domain([v.invert(this.chartSizes.chartHeight),v.invert(0)]).range(p).nice(),this.scales.y=A,this.scales.yOriginal=A.copy()}updateCaptionsSize(e){let t=new Ac("600 14px Arial");function n(o){return Math.max(...o.map(s=>t.getTextWidth(s)))}let{ticks:r,format:a}=B4(this.scales.y,e),i=n(r.map(a));this.captionsSizes={xAxisCaptionsWidth:20,yAxisCaptionsWidth:i}}createMainTitle(e){this.mainTitle=Uv(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+T4,left:Gc+this.captionsSizes.yAxisCaptionsWidth+T4,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,ws(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 p=t[A.value];if(p.usedAes.length===0||!p.aesMap)return;let v={};p.values.forEach(C=>{v[C]||(v[C]={...bD}),p.usedAes.forEach(x=>{var k,_;x==="dotFill"&&(v[C].color=((k=p.aesMap[C])==null?void 0:k[x])??$t),x==="dotSize"&&(v[C].size=((_=p.aesMap[C])==null?void 0:_[x])??3)})});let y=A.label??A.value,b=zo().domain(p.values).range(p.values.map(C=>v[C]));a.push({...i,id:A.value,type:"dots",title:y,scale:b,values:p.values,labels:p.labels})}),r.forEach(A=>{if(A.type==="dots"&&rh(A.aes.dotFill)){let{domain:p,range:v,columnName:y,type:b="linear"}=A.aes.dotFill,C=y.label??y.value,x=k4(v,p,"linear"),k=(b==="log"?av():Zr()).domain(p).range([this.chartSizes.chartHeight,0]),_=c2(k,p);a.push({...i,id:"dotFill",type:"continuous",title:C,scale:x,tickPositionScale:k,values:_})}if(A.type==="dots"&&rh(A.aes.dotSize)){let{columnName:p,domain:v,range:y}=A.aes.dotSize,b=p.label??p.value,C=iv(v,y),x=C.ticks(3),k=C.tickFormat(3),_=x.reduce((P,N)=>(P[String(N)]=k(N),P),{});a.push({...i,id:p.value,type:"size",title:b,scale:C,values:x,labels:_})}}),!a.length){this.legend={width:0,height:0,items:[]};return}let o=y2(a,this.chartSizes.chartHeight),s=o[o.length-1],c=s.left+s.width+RZ,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:p,legend:v}=t;this.updateChartSizes(A),this.updateViewport(c,f,n),this.updateCaptionsSize(r.y),this.updateLegendSize(v,o,s,i),this.createMainTitle(p),this.updateMargins(),this.aesGetters=GZ(a,i);let y=bht().data(e).value(P=>{let N=Q3(this.aesGetters.dotFill(P.data)),I=!P.dimmed&&(this.polygon.length<2||Nb(this.polygon,[P.x,P.y]))?1:.4;return YD(N,I)}),b=Mwt().equals((P,N)=>P===N).size(P=>UZ(this.aesGetters.dotSize(P.data))).crossValue(P=>P.x).mainValue(P=>P.y).decorate(P=>y(P)),C=S0t().scaleExtent([.1,1e3]).filter(()=>!this.lassoMode).on("start",()=>{this.selectedDot=null}).on("zoom",P=>{let N=P.transform,I=N.rescaleX(this.scales.xOriginal),F=N.rescaleY(this.scales.yOriginal);this.scales.x.domain(I.domain()),this.scales.y.domain(F.domain()),this.zoomStateKey=`${N.x}_${N.y}_${N.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=fE(this.allPossibleLabels,this.chartSizes.chartWidth,this.chartSizes.chartHeight),this.renderSvgLayer()}),x=z_().x(P=>P.x).y(P=>P.y).addAll(e),k=Eht().on("point",([P])=>{var Z,ee;if(!P){this.selectedDot=null,this.renderSvgLayer();return}let N=this.scales.x.invert(P.x),I=this.scales.y.invert(P.y),F=(Z=this.tools)==null?void 0:Z.qt.find(N,I),Q=this.selectedDot&&!F||!this.selectedDot&&F||((ee=this.selectedDot)==null?void 0:ee.id)!==(F==null?void 0:F.id);this.selectedDot=F??null,Q&&this.renderSvgLayer()}),_=q0t({xScale:this.scales.x,yScale:this.scales.y}).xAxisHeight(()=>"0").yAxisWidth(()=>"0").svgPlotArea(Hwt()).webglPlotArea(Iwt().series([b]).mapping(P=>P)).decorate(P=>{let N=P.enter();N&&!this.svgLayerElement&&(N.style("grid-template-columns","0 auto 1fr auto 0"),N.style("grid-template-rows","0 auto 1fr auto 0"),this.svgLayerElement=N.select(".svg-plot-area.plot-area svg").node()),N.select(".svg-plot-area.plot-area").call(C).call(k)});this.tools={webglChart:_,zoom:C,qt:x,fillColor:y,pointSeries:b},ws(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=GZ(e,t),this.tools.fillColor.value(n=>{let r=this.aesGetters.dotFill??(()=>$t),a=Q3(r(n.data)),i=!n.dimmed&&(this.polygon.length<2||Nb(this.polygon,[n.x,n.y]))?1:.4;return YD(a,i)}))}updatePointSize(){this.tools!==null&&(this.tools.pointSeries.size(e=>UZ(this.aesGetters.dotSize(e.data))),ws(this.canvasNode).datum([...this.allDots]))}updateByLasso(){var e;this.tools!==null&&((e=this.tools)==null||e.fillColor.value(t=>{let n=this.aesGetters.dotFill??(()=>$t),r=Q3(n(t.data)),a=!t.dimmed&&(this.polygon.length<2||Nb(this.polygon,[t.x,t.y]))?1:.4;return YD(r,a)}),this.renderWebglLayer())}updateData(e){this.tools!==null&&(ws(this.canvasNode).datum(e),this.tools.fillColor.data(e),this.tools.qt=z_().x(t=>t.x).y(t=>t.y).addAll(e))}render(e,t,n,r,a,i,o,s,c,f,A,p,v,y,b){if(this.lassoMode=y,this.tools===null)this.initSettings(a,t,i,r,s,c,f,A),this.onPolygonUpdateOutside=v,this.onTooltipHintSwitch=b;else{let{title:C,legend:x}=t;this.updateLegendSize(x,f,A,c),this.createMainTitle(C),this.updateMargins(),this.updateAes(s,c)}this.allDots=a,this.allPossibleLabels=p,this.allPossibleLabels.forEach(C=>{C.x=this.scales.x(C.dot.x),C.y=this.scales.y(C.dot.y)}),this.visibleLabels=fE(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&&ws(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)}),H4t(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(Swt,{...e}),(t=this.reactRoot)==null||t.render(this.svgLayerComponent)}renderError(e){var t;(t=this.reactRoot)==null||t.render(ie.jsx(zv,{message:e}))}},Lwt=Nwt,XD=H.object({type:H.literal("grouping"),value:H.string()}),$wt=H.object({type:H.literal("dots"),aes:H.optional(H.object({dotFill:H.optional(H.union([H.string(),XD,Jp(H.string())])),dotShape:H.optional(H.union([Td,XD])),dotSize:H.optional(H.union([H.number(),Jp(H.number())]))}))}),Fwt=H.object({type:H.literal("curve"),smoothing:H.optional(H.boolean()),aes:H.optional(H.object({lineWidth:H.optional(H.number()),lineShape:H.optional(XA),lineColor:H.optional(H.union([H.string(),XD,Jp(H.string())])),opacity:H.optional(H.number())}))}),Vwt=H.union([$wt,Fwt]),Owt=H.object({type:H.literal("scatterplot-umap"),title:H.object({name:H.string(),show:H.optional(H.boolean()),position:H.optional(Qv)}),size:H.optional(H.object({width:H.optional(H.number()),height:H.optional(H.number())})),legend:H.optional(H.object({show:H.optional(H.boolean()),position:H.optional(Ng)})),tooltips:H.optional(H.object({show:H.optional(H.boolean()),content:H.optional(H.array(Yn))})),frame:H.optional(H.object({type:H.optional(m4)})),keyColumn:Yn,x:Yn,y:Yn,xAxis:H.optional(u2),yAxis:H.optional(u2),grouping:H.optional(H.array(Yn)),label:H.optional(Yn),highlight:H.optional(Yn),inheritedAes:H.optional(H.record(H.string(),s2)),layers:H.array(Vwt),lassoMode:H.optional(H.boolean())}),Qwt=class{constructor(e){Be(this,"type","dots");Be(this,"aes",{dotFill:$t,dotShape:"21",dotSize:3,opacity:1});this.aes={...this.aes,...e.aes}}},zwt=class{constructor(e){Be(this,"type","curve");Be(this,"smoothing");Be(this,"aes",{lineColor:$t,lineWidth:1,lineShape:"solid",opacity:1});this.smoothing=e.smoothing??!1,this.aes={...this.aes,...e.aes}}},jZ=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;Owt.parse(e),this.id=Zn.uniqueId("settings"),this.keyColumn=e.keyColumn,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 Qwt(i);if(i.type==="curve")return new zwt(i);throw new Error("Unknown layer type")}).filter(Boolean),this.lassoMode=e.lassoMode??!1}};function YZ(e){return typeof e=="object"&&"type"in e&&e.type==="grouping"}function Uwt(e,t,n,r){return t.reduce((a,i)=>{let o=Zn.uniqBy(e.rows,p=>p[i.value]),s=p=>String(p[i.value]),c=p=>i.valueLabels?String(p[i.valueLabels]):s(p),f=new Set;n.forEach(p=>{p.aes&&Object.entries(p.aes).forEach(([v,y])=>{YZ(y)&&y.value===i.value&&f.add(v)})});let A=o.reduce((p,v)=>(p[s(v)]=c(v),p),{});return a[i.value]={values:o.map(s).sort((p,v)=>A[p].localeCompare(A[v],"en",{numeric:!0})),usedAes:[...f],aesMap:r[i.value],labels:A},a},{})}var Gwt=10;function jwt(e){let t=[],n=new Ac("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:Gwt})}return t}var Ywt=class extends Rg{constructor(t,n,r){super(t,n);Be(this,"settings");Be(this,"chartRenderer",new Lwt);Be(this,"onPolygonUpdate",()=>uC);Be(this,"onTooltipHintSwitch",()=>uC);Be(this,"calculatedData",null);this.settings=new jZ(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 jZ(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&&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,keyColumn:r,label:a,highlight:i,grouping:o,layers:s,inheritedAes:c}=this.settings,f={x:!0,y:!0},A={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0},p=s.some(k=>k.type==="curve"),v=new Set,y={},b=this.data.rows.reduce((k,_)=>{if(_[t.value]===null||_[n.value]===null)return k;let P=Number(_[t.value]),N=Number(_[n.value]);f.x&&P!==null&&P<0&&(f.x=!1),f.y&&N!==null&&N<0&&(f.y=!1),P!==null&&P<A.minX&&(A.minX=P),P!==null&&P>A.maxX&&(A.maxX=P),N!==null&&N<A.minY&&(A.minY=N),N!==null&&N>A.maxY&&(A.maxY=N);let I={x:P,y:N,id:String(_[r.value]),dimmed:i?!_[i.value]:!1,label:a&&_[a.value]?String(_[a.value]):null,data:_};if(p){let F=o.map(Q=>_[Q.value]).join("_");v.add(F),y[F]||(y[F]=[]),y[F].push(I)}return k.push(I),k},[]);b.sort((k,_)=>Number(_.dimmed)-Number(k.dimmed));let C=[...v];p&&C.forEach(k=>{y[k].sort((_,P)=>_.x-P.x)});let x=Uwt(this.data,o,s,c);this.calculatedData={onlyPositive:f,dots:b,dotsByGrouping:y,groupingKeys:C,allPossibleLabels:jwt(b),dotsExtents:A,legendLabels:x},this.chartRenderer.updateData(b)}_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])=>{YZ(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)}},Wwt=1e6;function Xwt(e){let t=ER(e),n=Ls(e);return t===void 0||n===void 0||t===0?r=>r:r=>(r-n)/t}function Kwt(e){let t=Ls(e),[n,r]=_p(e);return t===void 0||n===void 0||r===void 0?a=>a:a=>(a-t)/(r-n)}function Zwt(e,t){return e==="standardScaling"?Xwt(t):e==="meanNormalization"?Kwt(t):n=>n}function Jwt(e,t,n,r,a,i,o,s,c){let f=o.map(C=>C.join("_")),A={meta:{facetKeys:f,xKeys:[],yKeys:[],xLabels:{},yLabels:{},facetKeyValues:f.reduce((C,x,k)=>(C[x]=o[k],C),{}),valueExtentSize:[1/0,-1/0],valueExtentColor:[1/0,-1/0]},facets:{}},p=new Set,v=new Set,y=t.valueLabels??t.value,b=n.valueLabels??n.value;if(e.rows.forEach(C=>{let x=i.length?i.map(I=>C[I.value]).join("_"):"null",k=C[t.value],_=C[n.value],P=C[r.value]??c,N=C[a.value]??c;if(!(k===null||_===null||P===null||N===null)){if(A.facets[x]||(A.facets[x]={xKeys:[],yKeys:[],cells:{}}),A.facets[x].xKeys.push(k),A.facets[x].yKeys.push(_),p.has(k)||(p.add(k),A.meta.xKeys.push(k)),v.has(_)||(v.add(_),A.meta.yKeys.push(_)),A.facets[x].cells[k]||(A.facets[x].cells[k]={}),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(N,A.meta.valueExtentColor[0]),A.meta.valueExtentColor[1]=Math.max(N,A.meta.valueExtentColor[1]),A.facets[x].cells[k][_])throw Error(`More than 1 value for x=${k}, y=${_}`);if(A.meta.xLabels[k]&&String(C[y])!==A.meta.xLabels[k])throw Error(`More than 1 x-label value for x=${k}`);if(A.meta.yLabels[_]&&String(C[b])!==A.meta.yLabels[_])throw Error(`More than 1 y-label value for y=${_}`);A.meta.xLabels[k]=String(C[y]),A.meta.yLabels[_]=String(C[b]),A.meta&&(A.facets[x].cells[k][_]={id:`${k}_${_}`,x:k,y:_,sizeValue:P,normalizedSizeValue:P,colorValue:N,normalizedColorValue:N,data:C})}}),A.meta.facetKeys=A.meta.facetKeys.filter(C=>A.facets[C]),A.meta.facetKeys.forEach(C=>{let x=A.facets[C];if(x.xKeys=Zn.uniq(x.xKeys),x.yKeys=Zn.uniq(x.yKeys),x.xKeys.length*x.yKeys.length>Wwt)throw Error(`Too many cells for graph rendering (${x.xKeys.length*x.yKeys.length})`)}),s){let C=[1/0,-1/0];A.meta.facetKeys.forEach(x=>{if(!A.facets[x])return;let{xKeys:k,yKeys:_,cells:P}=A.facets[x],N=s.direction==="row"?k:_,I=s.direction==="row"?_:k,F=s.direction==="row"?(Q,Z)=>{var ee;return(ee=P[Q])==null?void 0:ee[Z]}:(Q,Z)=>{var ee;return(ee=P[Z])==null?void 0:ee[Q]};I.forEach(Q=>{let Z=[];N.forEach(le=>{var U;let z=(U=F(le,Q))==null?void 0:U.colorValue;z!==void 0&&Z.push(z)});let ee=Zwt(s.method,Z);N.forEach(le=>{let z=F(le,Q);z!==void 0&&(z.normalizedColorValue=ee(z.colorValue),C[0]=Math.min(z.normalizedColorValue,C[0]),C[1]=Math.max(z.normalizedColorValue,C[1]))})})}),A.meta.valueExtentColor=C}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 qwt=15,Vg=8,pE=30,eCt=48,tCt=24,hE=16,T2=4,vE=4,WZ=20,nCt=16,f1={left:["axis","axisTitle"],right:["axis","axisTitle"],top:["axis","axisTitle","facetTitle"],bottom:["axis","axisTitle"]};function rCt(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?vE:0,p=t.showTicks?vE:0,v=c&&e.showTitle?pE:0,y=s&&t.showTitle?pE:0,b=c&&e.showAxisLabels&&i>hE?n.xAxisCaptions+A+T2:0,C=s&&t.showAxisLabels&&o>hE?n.yAxisCaptions+p+T2:0;return{left:{axisTitle:t.position==="left"?y:0,axis:t.position==="left"?C:0},right:{axisTitle:t.position==="right"?y:0,axis:t.position==="right"?C:0},top:{facetTitle:f?eCt:0,axisTitle:e.position==="top"?v:0,axis:e.position==="top"?b:0},bottom:{axisTitle:e.position==="bottom"?v:0,axis:e.position==="bottom"?b:0}}}function aCt(e,t,n){return{left:f1.left.reduce((r,a,i)=>{let o=i>0?f1.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:f1.right.reduce((r,a,i)=>{let o=i>0?f1.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:f1.top.reduce((r,a,i)=>{let o=i>0?f1.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:f1.bottom.reduce((r,a,i)=>{let o=i>0?f1.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 iCt(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,y=t.x,b=y>hE,C=a[v[0]];c=Math.max(c,(A&&b?r.getTextWidth(C)*Math.cos(o):0)-y/2)}let p=e.yAxisLabels===45;if(p){let v=n.meta.yKeys;if(v.length){let y=t.y,b=y>hE,C=i[v[v.length-1]];f=Math.max(f,(p&&b?r.getTextWidth(C)*Math.cos(s):0)-y/2)}}return{xCaptionTail:c,yCaptionTail:f}}function oCt({sideElementBBoxes:e,debug:t,xKeys:n,yKeys:r,scales:a,xAxis:i,yAxis:o,stepX:s,stepY:c,labelAngles:f,xLabels:A,yLabels:p}){let v=i.showTicks?vE:0,y=o.showTicks?vE:0,b=e.top.axis.isVisible||e.bottom.axis.isVisible,C=e.top.axisTitle.isVisible?e.top.axisTitle:e.bottom.axisTitle,x=e.top.axis.isVisible?e.top.axis:e.bottom.axis,k=e.left.axis.isVisible||e.right.axis.isVisible,_=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:[C.isVisible&&ie.jsxs("g",{transform:`translate(${C.x},${C.y})`,children:[ie.jsx("text",{x:C.width/2,y:C.height/2,textAnchor:"middle",dominantBaseline:"central",children:i.title}),t&&ie.jsx("rect",{width:C.width,height:C.height,stroke:$t,fill:"none"})]}),b&&ie.jsxs("g",{fontSize:"14px",transform:`translate(${x.x},${x.y})`,children:[n.map(N=>{let I=f.xAxisLabels!==0,F=i.position==="bottom",Q=F?0:x.height,Z=F?Q+v:Q-v,ee=F?Z+T2:Z-T2,le=a.x(N)+s/2,z=-f.xAxisLabels;return ie.jsxs("g",{children:[ie.jsx("line",{x1:le,x2:le,y1:Q,y2:Z,stroke:$t}),ie.jsx("text",{x:le,y:ee,textAnchor:I?F?"end":"start":"middle",transform:`rotate(${z},${le},${ee})`,dominantBaseline:I?"central":F?"hanging":"auto",children:A[N]})]},N)}),t&&ie.jsx("rect",{width:x.width,height:x.height,stroke:$t,fill:"none"})]})]}),ie.jsxs("g",{children:[_.isVisible&&ie.jsx("g",{transform:`translate(
15127
+ ${_.y+_.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:_.x,y:_.y,width:_.width,height:_.height,stroke:$t,fill:"none"}),k&&ie.jsx("g",{fontSize:"14px",transform:`translate(${P.x},${P.y})`,children:r.map(N=>{let I=f.yAxisLabels!==0,F=o.position==="left",Q=-(90-f.yAxisLabels),Z=f.yAxisLabels===0?"middle":F?"end":"start",ee=I?"central":F?"auto":"hanging",le=F?P.width:0,z=F?le-y:le+y,U=F?z-x2:z+x2,G=a.y(N)+c/2;return ie.jsxs("g",{children:[ie.jsx("line",{x1:le,x2:z,y1:G,y2:G,stroke:$t}),ie.jsx("text",{x:U,y:G,textAnchor:Z,transform:`rotate(${Q},${U},${G})`,dominantBaseline:ee,children:p[N]})]},N)})}),t&&ie.jsx("rect",{x:P.x,y:P.y,height:P.height,width:P.width,stroke:$t,fill:"none"})]})]})}function Q9t({sideElementBBoxes:e,debug:t,xKeys:n,yKeys:r,scales:a,xAxis:i,yAxis:o,stepX:s,stepY:c,xGroupKeys:f,yGroupKeys:A,xKeysByGroups:p,yKeysByGroups:v,labelAngles:y,xLabels:b,yLabels:C,xGroupLabels:x,yGroupLabels:k}){return ie.jsxs("g",{fontWeight:"500",children:[ie.jsx(O9t,{sideElementBBoxes:e,xKeys:n,yKeys:r,scales:a,xAxis:i,yAxis:o,stepX:s,stepY:c,labelAngles:y,xLabels:b,yLabels:C,debug:t}),ie.jsx(V9t,{sideElementBBoxes:e,xGroupKeys:f,yGroupKeys:A,xKeysByGroups:p,yKeysByGroups:v,xGroupLabels:x,yGroupLabels:k,scales:a,stepX:s,stepY:c,xAxis:i,yAxis:o,labelAngles:y,debug:t})]})}function aZ(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 iZ(e,t,n,r,a){if(!n)return"";let i=n.aes[e];if(!g4(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 oZ={x:0,y:0,width:0,height:0};function z9t({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:oZ,c=o?t[o.position].dendro:oZ;function f(p,v){return iZ(p,v,i,n,a)}function A(p,v){return iZ(p,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((p,v)=>{let y=p.links(),b=p.descendants();return ie.jsxs("g",{children:[y.map(C=>{let x=i.edgeInheritance==="up"?C.source:C.target;return ie.jsx("path",{d:aZ(C,i.position),stroke:f("lineColor",x),strokeWidth:f("lineWidth",x),strokeDasharray:Vf(f("lineShape",x)),fill:"none"},`${C.source.x},${C.source.y},${C.target.x},${C.target.y}`)}),i.showNodes&&b.map(C=>ie.jsx("g",{transform:`translate(${C.x},${C.y})`,children:jc(f("dotShape",C),f("dotSize",C),f("dotFill",C))},`${C.x},${C.y}`))]},v)})}),ie.jsx("g",{transform:`translate(${c.x},${c.y})`,children:o&&!o.hidden&&e.y.trees.map((p,v)=>{let y=p.links(),b=p.descendants();return ie.jsxs("g",{children:[y.map(C=>{let x=o.edgeInheritance==="up"?C.source:C.target;return ie.jsx("path",{d:aZ(C,o.position),stroke:A("lineColor",x),strokeWidth:A("lineWidth",x),strokeDasharray:Vf(A("lineShape",x)),fill:"none"},`${C.source.x},${C.source.y},${C.target.x},${C.target.y}`)}),o.showNodes&&b.map(C=>ie.jsx("g",{transform:`translate(${C.x},${C.y})`,children:jc(A("dotShape",C),A("dotSize",C),A("dotFill",C))},`${C.x},${C.y}`))]},v)})})]})}function U9t({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:$t,x:"0",y:"0",width:t,height:n}),e.type==="groups"&&r.map(A=>{let p=i[A].length;if(p===0)return null;let v=p*c,y=s.x(i[A][0]);return a.map(b=>{let C=o[b].length;if(C===0)return null;let x=C*f,k=s.y(o[b][0]);return ie.jsx("rect",{x:y,y:k,width:v,height:x,stroke:$t,fill:"none"},`${y}_${k}`)})})]})}function OD(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 G9t(e,t,n=[]){let r=e.data,a=[`X: ${t.xLabels[e.x]}`,`Y: ${t.yLabels[e.y]}`,`Value: ${OD(e.value)}${e.value!==e.normalizedValue?` (${OD(e.normalizedValue)})`:""}`];for(let i of n)a.push(`${i.label}: ${r[i.valueLabels??i.value]}`);return a}function j9t(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}: ${OD(e.value)}`),n}function Y9t(e){return e!==null&&!("data"in e)}function lZ(e){return e!==null&&"data"in e}function W9t({dendrograms:e,facetKey:t,dimensions:n,scales:r,cells:a,xGroupKeys:i,yGroupKeys:o,xKeysByGroups:s,yKeysByGroups:c,colorScale:f,chartSettings:A,cellsMeta:p,stepX:v,stepY:y,sharedX:b,sharedY:C,annotations:x,annotationColorScales:k,dendrogramAesScales:_,aes:P,labelAngles:N,chartSizes:I,margins:F,tooltipsContainer:Q,tooltipsData:Z}){let[ee,le]=tn.useState(),{xAxis:z,yAxis:U,tooltips:G}=A,{width:Y,height:X}=n.inner,{padding:te,chartEdgeSides:he,sideElementBBoxes:ae}=n,{xGroupLabels:ge,yGroupLabels:me,xLabels:fe,yLabels:be}=p,He=r.x.domain(),_e=r.y.domain(),Ie={left:F.left+n.left+te.left,right:I.totalWidth-(F.left+n.left+te.left),top:F.top+n.top+te.top,bottom:I.totalHeight-(F.top+n.top+te.top)},Ue=!1,Oe=ee&&Z.fixed;return ie.jsxs("g",{transform:`translate(${n.left},${n.top})`,fontSize:D9t,children:[ie.jsxs("g",{transform:`translate(${te.left},${te.top})`,children:[ie.jsx(F9t,{facetKey:t,sideElementBBoxes:ae,annotations:x,cellsMeta:p,annotationColorScales:k,sharedX:b,sharedY:C,chartEdgeSides:he,width:Y,height:X,scales:r,stepX:v,stepY:y,aes:P,frame:A.frame,xGroupKeys:i,yGroupKeys:o,xKeysByGroups:s,yKeysByGroups:c,tooltipsData:Z,activeElementContainer:ee}),ie.jsx(z9t,{dendrograms:e,sideElementBBoxes:ae,xDataByKeys:p.xDataByKeys,yDataByKeys:p.yDataByKeys,aesScales:_}),ae.top.facetTitle.isVisible&&ie.jsx("text",{x:ae.top.facetTitle.x,y:ae.top.facetTitle.y+ae.top.facetTitle.height-_9t,fontWeight:"500",fontSize:"20px",children:p.facetKeyValues[t].join(", ")}),Ue,He.map(ft=>_e.map(Ve=>{var gt;let Xe=(gt=a==null?void 0:a[ft])==null?void 0:gt[Ve],tt=Oe&&lZ(Z.selectedData)&&(Xe==null?void 0:Xe.id)===Z.selectedData.id,qe=Xe?ie.jsx("rect",{x:r.x(ft),y:r.y(Ve),width:v,height:y,stroke:P.cellStrokeColor,fill:Xe.value===null?P.emptyCellColor:f(Xe.normalizedValue),onMouseOver:()=>Z.onMouseOver(Xe,t),onMouseLeave:()=>Z.onMouseLeave()},Xe?Xe.id:`${ft}_${Ve}`):null;return tt?uu.createPortal(qe,ee):qe})),ie.jsx(U9t,{frame:A.frame,xGroupKeys:i,yGroupKeys:o,xKeysByGroups:s,yKeysByGroups:c,scales:r,stepX:v,stepY:y,width:Y,height:X}),ie.jsx(Q9t,{xAxis:z,yAxis:U,scales:r,stepX:v,stepY:y,debug:Ue,sideElementBBoxes:ae,xKeys:He,yKeys:_e,xGroupKeys:i,yGroupKeys:o,xKeysByGroups:s,yKeysByGroups:c,xGroupLabels:ge,yGroupLabels:me,labelAngles:N,xLabels:fe,yLabels:be})]}),A.tooltips.show&&lZ(Z.selectedData)&&Z.currentFacet===t&&ie.jsx(cu,{content:G9t(Z.selectedData,p,G==null?void 0:G.content),x:r.x(String(Z.selectedData.x))+v/2,y:r.y(String(Z.selectedData.y))+y/2,offset:He.length>1?v/2:0,active:!0,sideDistances:Ie,fixed:Z.fixed,onClose:Z.onClose,container:Q}),A.tooltips.show&&Y9t(Z.selectedData)&&Z.currentFacet===t&&ie.jsx(cu,{content:j9t(Z.selectedData,p),x:Z.selectedData.x,y:Z.selectedData.y,offset:0,active:!0,sideDistances:Ie,fixed:Z.fixed,onClose:Z.onClose,container:Q}),ie.jsxs("g",{transform:`translate(${te.left},${te.top})`,children:[Z.fixed&&ie.jsx("rect",{width:I.chartWidth,height:I.chartHeight,fill:"rgba(255, 255, 255, 0.8)"}),ie.jsx("g",{ref:ft=>{ft&&!ee&&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:p,groupedCells:v,cellsMeta:y,step:b,annotations:C,annotationColorScales:x,legend:k,aes:_,dendrograms:P,dendrogramAesScales:N,columnsCount:I,labelAngles:F,onTooltipHintSwitch:Q}){let[Z,ee]=tn.useState(),le=f2(Q),z=tn.useRef(null);tn.useEffect(()=>{z.current&&ee(z.current)},[]);let U=i[o[0]].padding,G=i[o[I-1]].padding,Y=e.left+a.chartsWidth+FD,X=e.top+U.top;return ie.jsx(h2,{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:$g}),ie.jsxs("g",{transform:`translate(${e.left},${e.top})`,children:[ie.jsx(v2,{title:[r.title.name],show:r.title.show,position:r.title.position,leftPadding:U.left,rightPadding:G.right,chartsWidth:a.chartsWidth}),o.map(te=>{let{cells:he,xKeysByGroups:ae,yKeysByGroups:ge}=v[te];return ie.jsx(W9t,{dendrograms:P[te],captionsSizes:t,facetKey:te,dimensions:i[te],xGroupKeys:c,yGroupKeys:f,xKeysByGroups:s.sharedX?y.xKeysByGroups:ae,yKeysByGroups:s.sharedY?y.yKeysByGroups:ge,sharedX:s.sharedX,sharedY:s.sharedY,scales:{x:A.x[te],y:A.y[te]},cells:he,cellsMeta:y,stepX:b.x[te],stepY:b.y[te],colorScale:p,chartSettings:r,aes:_,annotations:C,annotationColorScales:x,dendrogramAesScales:N,labelAngles:F,margins:e,chartSizes:a,tooltipsContainer:Z,tooltipsData:le},te)})]}),ie.jsx("g",{transform:`translate(${Y},${X})`,children:ie.jsx(m2,{legendData:k})}),ie.jsx("g",{ref:z,style:{outline:"none"}})]})})}function sZ(e,t,n){function r(a){a[n]=t(a.data.height),a.children&&a.children.forEach(r)}r(e)}function uZ(e,t,n,r=n){function a(i){i[r]=i[n]+t,i.children&&i.children.forEach(a)}a(e)}var K9t=(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 cZ(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])),K9t(t,r)}var Z9t=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:Gv,bottom:Gv,left:Gv,right:Gv});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:zo().domain(["null"]).range([1])},y:{null:zo().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=Gh(this.rootNode))}updateMargins(e){this.margins={top:e.show?24+24*2:Gv,bottom:Gv,left:Gv,right:this.legend.width+Gv},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((y,b)=>(y[b]=String(b),y),{});if(e==="continuous"){let v=this.colorScale,y=c2(v,a),b=Zr([y[0],y[y.length-1]],[i,0]),C=r.label??r.value;o.push({...s,type:"continuous",id:"heatmapValue",scale:v,values:y,title:C,tickPositionScale:b})}else if(e==="discrete"){let v=this.colorScale,y=r.label??r.value,b=v.domain(),C=c(b);o.push({...s,type:"discreteColor",id:"heatmapValue",title:y,scale:v,values:b,labels:C})}if(n.forEach(v=>{let y=v.valueColumn.label??v.valueColumn.value;if(v.type==="continuous"){let b=this.annotationColorScales[v.id].scale,C=c2(b,a),x=Zr([C[0],C[C.length-1]],[i,0]);o.push({...s,type:"continuous",id:v.id,tickPositionScale:x,title:y,scale:b,values:C})}if(v.type==="discrete"){let b=this.annotationColorScales[v.id].scale,C=b.domain(),x=c(C);o.push({...s,type:"discreteColor",id:v.id,title:y,scale:b,values:C,labels:x})}}),!o.length){this.legend={width:0,height:0,items:[]};return}let f=y2(o,this.chartSizes.chartHeight),A=f[f.length-1],p=A.left+A.width+FD;this.legend={width:p,height:i,items:f}}updateCaptionsSize(e,t,n,r){let a=new Ac("bold 14px Arial"),{xGroupKeys:i,yGroupKeys:o,xGroupLabels:s,yGroupLabels:c,xKeysByGroups:f,yKeysByGroups:A,xLabels:p,yLabels:v}=e.meta;this.labelAngles={xAxisLabels:t.axisLabelsAngle,yAxisLabels:n.axisLabelsAngle,xGroupLabels:t.groupLabelsAngle,yGroupLabels:n.groupLabelsAngle};function y(le,z){let U=0;for(let G of le){let Y=a.getTextWidth(z[G]);Y>U&&(U=Y)}return U}let b=Zn.flatten(Object.values(f)),C=Zn.flatten(Object.values(A)),x=y(b,p),k=y(C,v),_=y(i,s),P=y(o,c),{xCaptionTail:N,yCaptionTail:I}=N9t(this.labelAngles,r,this.step,e,a),F=this.labelAngles.xGroupLabels/180*Math.PI,Q=this.labelAngles.yGroupLabels/180*Math.PI,Z=this.labelAngles.xAxisLabels/180*Math.PI,ee=this.labelAngles.yAxisLabels/180*Math.PI;this.captionsSizes={xCaptionTail:N,yCaptionTail:I,xGroupCaptions:_*Math.sin(F)||jv,yGroupCaptions:P*Math.sin(Q)||jv,xAxisCaptions:x*Math.sin(Z)||jv,yAxisCaptions:k*Math.sin(ee)||jv}}updateChartDimensions(e,t,n,r,a,i,o,s,c,f){let A=t.length,p=Math.min(a.nRows??A,A),v=Math.min(a.nCols??A,A);this.columnsCount=a.nRows?Math.ceil(A/p):v,this.rowsCount=Math.ceil(A/this.columnsCount);let{width:y,height:b}=e,{sharedX:C,sharedY:x}=a;this.chartsDimensions={};let k=0,_=0;t.forEach((I,F)=>{let Q=F%this.columnsCount+1,Z=rZ(F,t.length,this.columnsCount,this.rowsCount),ee=this.step.x[I],le=this.step.y[I],z=P9t(i,o,this.captionsSizes,s,c,f,Z,C,x,t,n,r,ee,le),U=R9t(s,Z,C,x);function G(ae){return Math.max(c1[ae].reduce((ge,me)=>ge+z[ae][me],0),U[ae],k9t)}let Y={left:G("left"),right:G("right"),top:G("top"),bottom:G("bottom")};Y.left<this.captionsSizes.xCaptionTail&&(Y.left=this.captionsSizes.xCaptionTail),Y.bottom<this.captionsSizes.yCaptionTail&&(Y.bottom=this.captionsSizes.yCaptionTail);let X=M9t(z,y,b),te=y+Y.left+Y.right,he=b+Y.top+Y.bottom;this.chartsDimensions[I]={left:k,top:_,inner:{width:y,height:b},outer:{width:te,height:he},padding:Y,sideElementBBoxes:X,chartEdgeSides:Z},k+=te,Q===this.columnsCount&&(k=0,_+=he)});let P=t.slice(0,this.columnsCount).reduce((I,F)=>I+this.chartsDimensions[F].outer.width,0),N=t.filter((I,F)=>F%this.columnsCount===0).reduce((I,F)=>I+this.chartsDimensions[F].outer.height,0);this.chartSizes.chartsWidth=P,this.chartSizes.chartsHeight=N}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:p,facets:v}=t,{sharedX:y,sharedY:b}=r,C=(k,_={})=>k.sort((P,N)=>i.sorting==="asc"?(_[P]??P).localeCompare(_[N]??N,"en",{numeric:!0}):(_[N]??N).localeCompare(_[P]??P,"en",{numeric:!0})),x=(k,_={})=>k.sort((P,N)=>o.sorting==="asc"?(_[P]??P).localeCompare(_[N]??N,"en",{numeric:!0}):(_[N]??N).localeCompare(_[P]??P,"en",{numeric:!0}));e.forEach(k=>{let _=v[k],P=C(p.xGroupKeys),N=x(p.yGroupKeys),{xKeysByGroups:I}=y?p:_,{yKeysByGroups:F}=b?p:_,Q=P.map(ge=>I[ge].length),Z=N.map(ge=>F[ge].length),ee=Q.reduce((ge,me)=>ge+me,0),le=Z.reduce((ge,me)=>ge+me,0),z=(f-(Q.filter(ge=>ge>0).length-1)*n)/ee,U=(A-(Z.filter(ge=>ge>0).length-1)*n)/le,G=[],Y=[],X=0;P.forEach(ge=>{let me=s?I[ge]:C(I[ge],p.xLabels);Y.push(...me),me.forEach(()=>{G.push(X),X+=z}),me.length>0&&(X+=n)});let te=[],he=[],ae=0;N.forEach(ge=>{let me=c?F[ge]:x(F[ge],p.yLabels);he.push(...me),me.forEach(()=>{te.push(ae),ae+=U}),me.length>0&&(ae+=n)}),this.scales.x[k]=zo().domain(Y).range(G),this.scales.y[k]=zo().domain(he).range(te),this.step.x[k]=z,this.step.y[k]=U})}updateAesScale(e,t,n,r,a,i,o){if(e==="continuous")n.valueColors?this.colorScale=Zr().domain(n.valuesByColors??cZ(o,n.valueColors.length,t)).range(n.valueColors):n.colorsList&&(this.colorScale=Zr().domain(cZ(o,n.colorsList.length,t)).range(n.colorsList));else if(n.colorsMap){let f=Object.entries(n.colorsMap);this.colorScale=zo().domain(f.map(A=>A[0])).range(f.map(A=>A[1])).unknown("#ccc")}else n.colorsList&&(this.colorScale=nZ(n.colorsList,i.map(String)));let{xDataByKeys:s,yDataByKeys:c}=a.meta;r.forEach(f=>{let{colors:A,type:p,axis:v,valueColumn:y}=f,b=(v==="x"?s:c)[y.value];if(p==="discrete"){let C=Zn.uniq(Object.values(b).map(String)).sort();this.annotationColorScales[f.id]={type:"discrete",scale:nZ(A,C)}}else{let C=Object.values(b).map(Number);if(!C.length)return;let[x=C[0],k=C[0]]=_p(C);this.annotationColorScales[f.id]={type:"continuous",scale:H9t(A,x,k,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:p}=a[s],v=Math.max(...A.map(b=>b.data.height)),y=Math.max(...p.map(b=>b.data.height));i&&(this.dendrograms[s].x.trees=A.map((b,C)=>{let x=t[C],k=c[x];PB().separation(()=>1).size([k.length*this.step.x[s],i.size])(b);let _=b,P=Zr().domain(i.position==="top"?[0,v]:[v,0]).range([i.size,0]);return sZ(_,P,"y"),uZ(_,this.scales.x[s](k[0]),"x"),_}),this.dendrograms[s].x.data=i),o&&(this.dendrograms[s].y.trees=p.map((b,C)=>{let x=n[C],k=f[x];PB().separation(()=>1).size([k.length*this.step.y[s],o.size])(b);let _=b,P=Zr().domain(o.position==="left"?[0,y]:[y,0]).range([o.size,0]);return uZ(_,this.scales.y[s](k[0]),"x","y"),sZ(_,P,"x"),_}),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]=zo().domain(i).range(i.map(o=>({...tZ,...a[o]}))).unknown(tZ),n},{})}render(e,t,n,r,a,i,o,s,c,f,A,p,v,y){var le;let{meta:b,facets:C}=a,{facetKeys:x,xGroupKeys:k,yGroupKeys:_,valueExtent:P}=b,{xAxis:N,yAxis:I,title:F,size:Q,valueType:Z}=t;this.updateChartsSizes(Q),this.updateAesScale(Z,P,r,i,a,p,v),this.updateScales(x,a,r.groupGap,n,Q,t.xAxis,t.yAxis,s,c),this.updateCaptionsSize(a,N,I,n),this.updateChartDimensions(Q,x,k,_,n,N,I,i,s,c),this.updateLegendSize(Z,t.legend,i,o,P),this.updateMargins(F),this.updateDendrogram(x,k,_,C,f,s,c),this.updateDendrogramAesScales(A);let ee=ie.jsx(X9t,{aes:r,annotations:i,annotationColorScales:this.annotationColorScales,captionsSizes:this.captionsSizes,cellsMeta:b,columnsCount:this.columnsCount,chartsDimensions:this.chartsDimensions,chartSettings:t,chartSizes:this.chartSizes,colorScale:this.colorScale,dendrogramAesScales:this.dendrogramAesScales,dendrograms:this.dendrograms,facetKeys:x,facetSettings:n,groupedCells:C,labelAngles:this.labelAngles,legend:this.legend,margins:this.margins,scales:this.scales,settingsId:e,step:this.step,xGroupKeys:k,yGroupKeys:_,onTooltipHintSwitch:y});this.component=ee,(le=this.reactRoot)==null||le.render(ee)}renderError(e){var t;(t=this.reactRoot)==null||t.render(ie.jsx(zv,{message:e}))}},J9t=Z9t,QD={lineColor:$t,dotShape:"21",dotFill:$t,dotSize:3,lineShape:"solid",lineWidth:1},fZ={size:150,distance:"euclidean",linkage:"average",fillNA:0,showNodes:!0,hidden:!1,edgeInheritance:"up",aes:QD},dZ=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,p,v,y;if(S2t.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:((p=e.aes)==null?void 0:p.emptyCellColor)??"white"},this.annotations=(e.annotations??[]).map(b=>b.axis==="x"?{id:Zn.uniqueId("annotation"),axis:"x",valueColumn:b.valueColumn,position:b.position??this.chartSettings.xAxis.position,titlePosition:b.titlePosition??"right",showTitle:b.showTitle??!0,type:b.type,colors:b.colors??["white","black"]}:{id:Zn.uniqueId("annotation"),axis:"y",valueColumn:b.valueColumn,position:b.position??this.chartSettings.yAxis.position,titlePosition:b.titlePosition??"top",showTitle:b.showTitle??!0,type:b.type,colors:b.colors??["white","black"]}),e.valueType==="discrete"&&(e.dendrogramX||e.dendrogramY))throw Error("Dendrogram is not available with discrete cells values");this.dendrogramX=e.dendrogramX?{...fZ,position:"top",...e.dendrogramX,aes:{...QD,...(v=e.dendrogramX)==null?void 0:v.aes}}:null,this.dendrogramY=e.dendrogramY?{...fZ,position:"left",...e.dendrogramY,aes:{...QD,...(y=e.dendrogramY)==null?void 0:y.aes}}:null,this.inheritedDendrogramAes=e.inheritedDendrogramAes??null}},q9t=class extends Rg{constructor(t,n,r){super(t,n);Be(this,"settings");Be(this,"chartRenderer",new J9t);Be(this,"onTooltipHintSwitch",()=>{});Be(this,"calculatedData",null);this.settings=new dZ(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 dZ(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(),my(this.chartRenderer.component)}_needUpdateCalculatedDataBySettings(t,n){var I,F,Q,Z,ee,le,z,U,G,Y,X,te;let{xColumn:r,yColumn:a,valueColumn:i,xGroupBy:o,yGroupBy:s,facetBy:c,annotations:f,chartSettings:A,facetSettings:p,dendrogramX:v,dendrogramY:y,normalization:b,NAValueAs:C}=n,x=Object.values(((I=t.dendrogramX)==null?void 0:I.aes)||{}).filter(g4),k=Object.values((v==null?void 0:v.aes)||{}).filter(g4),_=Object.values(((F=t.dendrogramY)==null?void 0:F.aes)||{}).filter(g4),P=Object.values((y==null?void 0:y.aes)||{}).filter(g4);function N(he,ae){return he.length!==ae.length||he.some((ge,me)=>ge.value!==ae[me].value)}return t.xColumn.value!==r.value||t.yColumn.value!==a.value||t.valueColumn.value!==i.value||N(t.xGroupBy,o)||N(t.yGroupBy,s)||N(t.facetBy,c)||N(t.annotations.map(he=>he.valueColumn),f.map(he=>he.valueColumn))||N(x,k)||N(_,P)||(n.dendrogramX||t.dendrogramX)&&(((Q=t.dendrogramX)==null?void 0:Q.distance)!==((Z=n.dendrogramX)==null?void 0:Z.distance)||((ee=t.dendrogramX)==null?void 0:ee.linkage)!==((le=n.dendrogramX)==null?void 0:le.linkage))||(n.dendrogramY||t.dendrogramY)&&(((z=t.dendrogramY)==null?void 0:z.distance)!==((U=n.dendrogramY)==null?void 0:U.distance)||((G=t.dendrogramY)==null?void 0:G.linkage)!==((Y=n.dendrogramY)==null?void 0:Y.linkage))||t.chartSettings.valueType!==A.valueType||t.facetSettings.sharedX!==p.sharedX||t.facetSettings.sharedY!==p.sharedY||((X=t.normalization)==null?void 0:X.method)!==(b==null?void 0:b.method)||((te=t.normalization)==null?void 0:te.direction)!==(b==null?void 0:b.direction)||t.NAValueAs!==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{xColumn:t,yColumn:n,valueColumn:r,xGroupBy:a,yGroupBy:i,facetBy:o,chartSettings:s,facetSettings:c,annotations:f,dendrogramX:A,dendrogramY:p,normalization:v,NAValueAs:y}=this.settings,b=C9t(this.data,t,n,r,o,a,i,f,A,p,v,y),C=B9t(b,A,p,c),x=s.valueType==="discrete"?this.data.getColumnCategories(r.value):[];this.calculatedData={groupedCellsData:b,dendrogramsData:C,cellUniqValues:x}}_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)}},AZ=(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 pZ(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 e4t(e,t,n,r,a,i){let o=AZ(n,r),s=kR().domain(r).thresholds(o).value(c=>c[t.value])(e);return{bins:pZ(s,a,i),maxCount:Rh(s,c=>c.length)??0}}function t4t(e,t,n,r,a,i){let o=AZ(n,r),s=av().domain(r).range(r),c=o.map(A=>s.invert(A)),f=kR().domain(r).thresholds(c).value(A=>A[t.value])(e);return{bins:pZ(f,a,i),maxCount:Rh(f,A=>A.length)??0}}function n4t(e,t,n,r,a,i){let o={};return t.forEach(s=>{var C,x;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,p]=_p(f,k=>k[r.value]);A=A??((C=f[0])==null?void 0:C[r.value])??0,p=p??((x=f[0])==null?void 0:x[r.value])??0;let v=[A,p],y=[...n].reverse();y.forEach((k,_)=>{let P=e.getRowsByGrouping([...s,k]),N=i==="linear"?e4t(P,r,a,v,k,_):t4t(P,r,a,v,k,_);o[c].histogramByGroupingKey[k]=N,o[c].minX=v[0],o[c].maxX=v[1],o[c].maxCountFromGroups=Math.max(o[c].maxCountFromGroups,N.maxCount);let I=_>0?y[_-1]:null,F=I!==null?o[c].histogramByGroupingKey[I]:null;N.bins.forEach((Q,Z)=>{Q.y.straight=((F==null?void 0:F.bins[Z].y.straight)??0)+Q.count,o[c].maxCount=Math.max(o[c].maxCount,Q.y.straight)})});let b=n;b.forEach((k,_)=>{let P=_>0?b[_-1]:null,N=o[c].histogramByGroupingKey[k],I=P!==null?o[c].histogramByGroupingKey[P]:null;N.bins.forEach((F,Q)=>{F.y.reverse=((I==null?void 0:I.bins[Q].y.reverse)??0)+F.count})})}),o}var r4t={TOP:30,BOTTOM:0,LEFT:10,RIGHT:10};function B4(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 hZ=(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 a4t(e,t,n){if(n==="linear")return hZ(e,t);if(n==="log"){let r=hZ(e,t),a=av(t,t),i=r.map(o=>a.invert(o));return i[0]=t[0],i[i.length-1]=t[1],i}return[]}function k4(e,t,n){return(n==="log"?av():Zr()).domain(a4t(e.length,t,n)).range(e)}function i4t(e){return`translate(${e},0)`}function o4t(e){return`translate(0,${e})`}function l4t(e){return e==="bottom"?`translate(0,${Ff})`:`translate(${-Ff},0)`}function s4t(e){return e==="bottom"?"hanging":"central"}function u4t(e){return e==="bottom"?"middle":"end"}var vZ=({scale:e,tickSize:t=6,tickPadding:n=Ff,orient:r="bottom",onlyPositive:a=!1,hiddenLabels:i=!1,offset:o=typeof window<"u"&&window.devicePixelRatio>1?0:.5})=>{function s(x){return k=>{let _=x(k);return _===void 0?0:+_}}let{ticks:c,format:f}=i?{ticks:[],format:x=>x}:B4(e,a,r==="bottom"),A=Math.max(t,0)+n,p=s(e.copy()),v=r==="bottom"?i4t:o4t,y=r==="left"?-1:1,b={[(r==="left"?"x":"y")+"2"]:y*t},C={[r==="left"?"x":"y"]:y*A};return ie.jsx("g",{children:c.map((x,k)=>ie.jsxs("g",{className:"tick",transform:v(p(x)+o),children:[ie.jsx("line",{stroke:$t,...b}),ie.jsx("g",{transform:l4t(r),children:ie.jsx("text",{fill:$t,fontSize:"14px",fontWeight:"500",fontFamily:"Manrope",dominantBaseline:s4t(r),textAnchor:u4t(r),...C,children:f(x)})})]},k))})},c4t=1;function mZ({scaleX:e,scaleY:t,width:n,height:r,axisX:a,axisY:i,frameType:o,updatingKey:s=""}){let[c,f]=tn.useState(e.ticks()),[A,p]=tn.useState(t.ticks()),{significantLines:v=[]}=a,{significantLines:y=[]}=i;return tn.useEffect(()=>{let b=e.ticks().filter(x=>!v.includes(x)),C=t.ticks().filter(x=>!y.includes(x));f(b),p(C)},[e,t,s]),ie.jsxs("g",{stroke:$f,children:[a.showGrid&&c.map(b=>{let C=e(b);return ie.jsx("line",{x1:C,x2:C,y1:0,y2:r},`x_${C}_${r}`)}),i.showGrid&&A.map(b=>{let C=t(b);return ie.jsx("line",{x1:0,x2:n,y1:C,y2:C},`y_${C}_${n}`)}),ie.jsx("g",{strokeDasharray:Vf(a.significantLinesStyle),stroke:$t,children:v.map(b=>{let C=e(b);return C<0||C>n?null:ie.jsx("line",{x1:C,x2:C,y1:0,y2:r},`significant_${C}_${r}`)})}),ie.jsx("g",{strokeDasharray:Vf(i.significantLinesStyle),stroke:$t,children:y.map(b=>{let C=t(b);return C<0||C>r?null:ie.jsx("line",{x1:0,x2:n,y1:C,y2:C},`significant_${C}_${n}`)})}),o!=="empty"&&ie.jsxs("g",{strokeWidth:c4t,children:[(a.showGrid||o!=="left")&&ie.jsx("line",{stroke:o==="left"?$f:$t,x1:"0",x2:n,y1:r,y2:r}),(a.showGrid||o!=="bottom")&&ie.jsx("line",{stroke:o==="bottom"?$f:$t,x1:"0",x2:"0",y1:"0",y2:r}),(a.showGrid||o==="full")&&ie.jsx("line",{stroke:o==="full"?$t:$f,x1:n,x2:n,y1:"0",y2:r}),(i.showGrid||o==="full")&&ie.jsx("line",{stroke:o==="full"?$t:$f,x1:"0",x2:n,y1:"0",y2:"0"})]})]})}function f4t(e){return typeof e=="string"?e:e.value}function d4t(e,t){let n=[`Amount: ${e.count}`,`(from ${ni(e.x)}, to ${ni(e.x+e.width)})`];return e.groupingKey!=="null"&&n.push(`${t[e.groupingKey]??e.groupingKey}`),n}function gZ(e,t,n,r){return t==="vertical"?e:e+n*r}function yZ(e,t,n,r){return t(n==="vertical"?r==="straight"?e.y.straight:e.y.reverse:e.count)}function A4t({facetKey:e,width:t,height:n,dimensions:r,scales:a,xAxis:i,yAxis:o,frameType:s,histogramData:c,facetSettings:f,captionsSizes:A,facetTitle:p,layers:v,aesColorGetter:y,groupingDirection:b,groupingStack:C,groupingLabels:x,chartSizes:k,margins:_,tooltipsContainer:P,tooltipsData:N}){let[I,F]=tn.useState(),{padding:Q}=r,Z=i.showTicks?4:0,ee=o.showTicks?4:0,le=r.chartEdgeSides.includes("left")||!(f!=null&&f.sharedY),z=r.chartEdgeSides.includes("bottom")||!(f!=null&&f.sharedX),U=r.chartEdgeSides.includes("bottom"),G=c.groupingKeys,Y=c.histogramByGroupingKey[G[0]].bins[0],X=a.x(Y.width)-a.x(0),te=C==="vertical"?X:X/G.length,he={left:_.left+r.left+Q.left,right:k.totalWidth-(_.left+r.left+Q.left),top:_.top+r.top+Q.top,bottom:k.totalHeight-(_.top+r.top+Q.top)},ae=I&&N.fixed,ge=!1;return ie.jsxs("g",{transform:`translate(${r.left+Q.left},${r.top+Q.top})`,children:[ge,p.length&&ie.jsxs("g",{children:[s==="full"&&ie.jsx("rect",{x:"0",y:-Q.top,height:Q.top,width:t,fill:"#F7F8FA",stroke:$t}),p.map((me,fe)=>{let be=p.length,He=(Q.top-20*be)/2;return ie.jsx("text",{fontSize:"14px",fontWeight:"500",fill:$t,x:t/2,dy:He+20/2-Q.top,y:fe*20,textAnchor:"middle",dominantBaseline:"central",children:me},fe)})]}),ie.jsxs("g",{dominantBaseline:"central",textAnchor:"middle",fontWeight:"500",fontSize:"14px",fill:$t,children:[U&&i.title&&ie.jsx("text",{x:t/2,y:n+Q.bottom-20/2,children:f4t(i.title)}),ge]}),ie.jsx(mZ,{width:t,height:n,scaleX:a.x,scaleY:a.y,axisX:i,axisY:o,frameType:s}),z&&ie.jsxs("g",{transform:`translate(0,${n})`,children:[ie.jsx(vZ,{scale:a.x,orient:"bottom",tickSize:Z,hiddenLabels:i.hiddenLabels}),ge]}),le&&ie.jsxs("g",{children:[ie.jsx(vZ,{scale:a.y,orient:"left",tickSize:ee,hiddenLabels:o.hiddenLabels}),ge]}),v.map(me=>G.map((fe,be)=>c.histogramByGroupingKey[fe].bins.map(He=>{let _e=ae&&N.selectedData===He,Ie=ie.jsx("rect",{x:gZ(a.x(He.x),C,be,te),y:yZ(He,a.y,C,b),fill:He.rows[0]?y(me.aes.fillColor,He.rows[0],He.count):"",stroke:me.aes.lineColor,width:te,height:a.y(0)-a.y(He.count),opacity:me.aes.opacity??1,onMouseOver:()=>N.onMouseOver(He,e),onMouseLeave:()=>N.onMouseLeave()},He.x);return _e?uu.createPortal(Ie,I):Ie}))),N.fixed&&ie.jsx("rect",{width:k.chartWidth,height:k.chartHeight,fill:"rgba(255,255,255,0.8)"}),ie.jsx("g",{ref:me=>{me&&!I&&F(me)}}),N.selectedData&&N.currentFacet===e&&ie.jsx(cu,{content:d4t(N.selectedData,x),x:gZ(a.x(N.selectedData.x),C,N.selectedData.groupingKeyIdx,te)+te,y:yZ(N.selectedData,a.y,C,b)+a.y(0)-a.y(N.selectedData.count/2),offset:0,active:!0,fixed:N.fixed,sideDistances:he,container:P,onClose:N.onClose})]})}function p4t({settingsId:e,chartSettings:t,chartSizes:n,chartsDimensions:r,columnsCount:a,facetKeys:i,facetSettings:o,scales:s,margins:c,mainTitle:f,facetTitles:A,captionsSizes:p,histogramDataByFacets:v,layers:y,aesColorGetter:b,groupingDirection:C,groupingStack:x,groupingLabels:k,legend:_,onTooltipHintSwitch:P}){let N=f2(P),{xAxis:I,yAxis:F,title:Q,frame:Z}=t,ee=r[i[0]].padding,le=r[i[a-1]].padding,[z,U]=tn.useState(),G=tn.useRef(null);tn.useEffect(()=>{G.current&&U(G.current)},[]);let Y=c.left+n.chartsWidth+FD,X=c.top+ee.top;return ie.jsx(h2,{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:$g}),ie.jsxs("g",{transform:`translate(${c.left},${c.top})`,fontFamily:"Manrope",children:[ie.jsx(v2,{title:f,show:Q.show,position:Q.position,leftPadding:ee.left,rightPadding:le.right,chartsWidth:n.chartsWidth}),i.map(te=>ie.jsx(A4t,{facetKey:te,scales:{x:s.x[te],y:s.y[te]},width:n.chartWidth,height:n.chartHeight,dimensions:r[te],margins:c,chartSizes:n,facetSettings:o,xAxis:I,yAxis:F,frameType:Z.type,facetTitle:A[te],captionsSizes:p,histogramData:v[te],layers:y,aesColorGetter:b,groupingDirection:C,groupingStack:x,groupingLabels:k,tooltipsContainer:z,tooltipsData:N},te))]}),ie.jsx("g",{transform:`translate(${Y},${X})`,children:ie.jsx(m2,{legendData:_})}),ie.jsx("g",{ref:G,style:{outline:"none"}})]})})}function h4t(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 v4t(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!=="",p=n.yAxisCaptionsWidth,v=(t.showTicks?4:0)+(t.hiddenLabels?0:6),y=n.xAxisCaptionsWidth,b=(e.showTicks?4:0)+(e.hiddenLabels?0:6),C=A?20:0,x=p+v,k=b+y+C,_=Math.max(...r.map(P=>a[P].length));return{left:c?x:12,top:_===0?0:6*2+_*20,bottom:f?k:12,right:o?0:12}}function m4t(e,t,n){let r=[];for(let a=0;a<t;a++)r.push(e.slice(a*n,a*n+n));return r}function g4t(e,t){let n=Math.floor(e/t),r=e-n*t;return[n,r]}function wZ(e){return typeof e=="object"&&e!==null&&"type"in e&&"value"in e&&e.type==="grouping"}function y4t(e){return typeof e=="object"&&e!==null&&"range"in e}function w4t(e,t,n){return function(r,a,i){var o,s;if(y4t(r)){let{domain:c=n,range:f,type:A="linear"}=r,p=k4(f,c,A);return p.clamp(!0),p(i)}if(wZ(r)){let c=r.value;return(s=((o=e[c])==null?void 0:o[String(a[c])])??CD)==null?void 0:s[t]}return r}}var C4t=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=Gh(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,p,v)=>{let[y,b]=g4t(v,this.columnsCount),C=h4t(v,e.length,this.columnsCount,this.rowsCount),x=v4t(n,r,this.captionsSizes,m4t(e,this.rowsCount,this.columnsCount)[y],this.facetTitles,C,b===this.columnsCount-1,t),k=a+x.left+x.right,_=i+x.top+x.bottom;return A[p]={left:o,top:s,chartEdgeSides:C,padding:x,inner:{width:a,height:i},outer:{width:k,height:_}},o+=k,b===this.columnsCount-1&&(o=0,s+=_),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,p]=[1/0,-1/0],v=-1/0,y=e.reduce((b,C)=>{let x=a[C],{minX:k,maxX:_,maxCount:P,maxCountFromGroups:N}=x;return A=Math.min(A,k),p=Math.max(p,_),v=Math.max(v,o==="vertical"?P:N),b[C]={minX:k,maxX:_,maxY:o==="vertical"?P:N},b},{});e.forEach(b=>{let C=n.scale==="log"?av():Zr(),x=y[b],k=t.sharedX?A:x.minX,_=t.sharedX?p:x.maxX;C.domain([k,_]).range([0,this.chartSizes.chartWidth]),this.scales.x[b]=C}),e.forEach(b=>{let C=r.scale==="log"?av():Zr(),x=y[b],k=0,_=t.sharedY?v:x.maxY,P=[this.chartSizes.chartHeight,0],N=C.copy().domain([k,_]).range([this.chartSizes.chartHeight,i.innerOffset]);C.domain([N.invert(this.chartSizes.chartHeight),N.invert(0)]).range(P),this.scales.y[b]=C})}updateCaptionsSize(e,t){let n=new Ac("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}=B4(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=Uv(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]=Uv(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(wZ(A.aes.fillColor)&&n){let p=A.aes.fillColor.value,v=t[n.value],y=n.label??n.value,b=zo().domain(v.values).range(v.values.map(C=>v.aesMap[C].fillColor));a.push({...i,id:p,type:"discreteColor",title:y,scale:b,values:v.values,labels:v.labels})}}),!a.length){this.legend={width:0,height:0,items:[]};return}let o=y2(a,this.chartSizes.chartHeight),s=o[o.length-1],c=s.left+s.width+jb,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,p,v){var N;let{xAxis:y,yAxis:b,size:C,title:x}=t;this.updateChartSizes(C),this.updateViewport(r,n,y,b,i,C,A),this.updateCaptionsSize(y,b),this.createFacetTitles(r,a),this.updateChartDimensions(r,n,y,b),this.createMainTitle(r,x),this.updateLegendSize(t.legend,o,f,s),this.updateMargins(C);let k=r.reduce((I,F)=>Math.min(I,i[F].minX),1/0),_=r.reduce((I,F)=>Math.max(I,i[F].maxX),-1/0),P=ie.jsx(p4t,{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:w4t(c,"fillColor",[k,_]),groupingDirection:p,groupingStack:A,groupingLabels:f?o[f.value].labels:{},legend:this.legend,onTooltipHintSwitch:v});this.component=P,(N=this.reactRoot)==null||N.render(P)}renderError(e){var t;(t=this.reactRoot)==null||t.render(ie.jsx(zv,{message:e}))}},b4t=C4t,E4t=10,x4t=class{constructor(e){Be(this,"type","bins");Be(this,"aes",{fillColor:"white",lineColor:$t,opacity:1});this.aes={...this.aes,...e.aes}}},S4t=class{constructor(e){Be(this,"type","binsLine");Be(this,"aes",{opacity:1});this.aes={...this.aes,...e.aes}}},CZ=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,p;H2t.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??E4t,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)??r4t.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:((p=e.frame)==null?void 0:p.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 x4t(v);if(v.type==="binsLine")return new S4t(v);uA(v,"Unknown layer type")}).filter(Boolean)}};function bZ(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 B4t(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 k4t=class extends Rg{constructor(t,n,r){super(t,n);Be(this,"settings");Be(this,"chartRenderer",new b4t);Be(this,"onTooltipHintSwitch",()=>{});Be(this,"calculatedData",null);this.settings=new CZ(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 CZ(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(),my(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(b=>this.data.getColumnCategories(b.value)),f=c.length?bZ([...c]):[["null"]],A=n.map(b=>b.value)??null,p=r?[r.value]:[],v=r?this.data.getColumnCategories(r.value):["null"];s&&(v=Zn.intersection(s,v)),this.data.setGrouping([...A,...p]);let y=n4t(this.data,f,v,t,a,i.xAxis.scale);this.calculatedData={facetKeys:f.map(b=>b.join(", ")),facetKeysCombinations:f,histogramDataByFacets:y,legendInfo:B4t(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 T4t(e,t,n,r,a,i,o){let s={};return t.forEach(c=>{let f=[],A=1/0,p=1/0,v=-1/0,y=-1/0;o.forEach(b=>{e.getRowsByGrouping([...c,b]).forEach(C=>{let x=C[n.value],k=C[r.value];A=Math.min(A,x),p=Math.min(p,k),v=Math.max(v,x),y=Math.max(y,k),x!==null&&k!==null&&f.push({id:`${Object.values(C)}`,x,y:k,label:a?C[a.valueLabels??a.value]:null,dimmed:i?!C[i.value]:!1,data:C})})}),f.sort((b,C)=>b.x-C.x),s[c.join("_")]={minX:A,maxX:v,minY:p,maxY:y,dots:f}}),s}function _4t(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((y,b)=>v.data[y.value]===f[b])),p=a.reduce((v,y,b)=>(v[y.value]=f[b],v),{});return{dots:A,data:p}})};if(c.type==="dots")return{type:"dots",info:c,geoms:s};uA(c,"Unknown scatterplot layer type")}),i},{})}function zD(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 EZ(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 D4t(e,t){return zD(e)-t}function P4t(e,t){return EZ(e)-t}function xZ(e){let t=zD(e),n=t+e.width,r=EZ(e),a=r+e.height;return{minX:t,maxX:n,minY:r,maxY:a}}function SZ(e,t,n){let r=D4t(e,n),a=zD(e)+e.width+n,i=P4t(e,t),o=i+e.height+2*t;return{minX:r,maxX:a,minY:i,maxY:o}}function M4t(e,t,n){return e.minX>=0&&e.maxX<=t&&e.minY>=0&&e.maxY<=n}var cE=2;function H4t(e,t=cE,n=cE){e.forEach(r=>{r.bbox=xZ(r),r.outerBBox=SZ(r,t,n)})}function fE(e,t,n,r=cE,a=cE){let i=[],o=new ndt,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 p={...c,yPosition:f,xPosition:A};if(p.bbox=xZ(p),p.outerBBox=SZ(p,r,a),M4t(p.outerBBox,t,n)&&!o.collides(p.outerBBox)){i.push(p),o.insert(p.outerBBox);break}}return i}function I4t(e){return`translate(${e},0)`}function R4t(e){return`translate(0,${e})`}function N4t(e){return e==="bottom"?`translate(0,${Ff})`:`translate(${-Ff},0)`}function L4t(e){return e==="bottom"?"hanging":"central"}function $4t(e){return e==="bottom"?"middle":"end"}var dE=({scale:e,tickSize:t=6,tickPadding:n=Ff,orient:r="bottom",onlyPositive:a=!1,offset:i=typeof window<"u"&&window.devicePixelRatio>1?0:.5})=>{function o(C){return x=>{let k=C(x);return k===void 0?0:+k}}let{ticks:s,format:c}=B4(e,a,r==="bottom"),f=Math.max(t,0)+n,A=o(e.copy()),p=r==="bottom"?I4t:R4t,v=r==="left"?-1:1,y={[(r==="left"?"x":"y")+"2"]:v*t},b={[r==="left"?"x":"y"]:v*f};return ie.jsx("g",{children:s.map((C,x)=>ie.jsxs("g",{className:"tick",transform:p(A(C)+i),children:[ie.jsx("line",{stroke:$t,...y}),ie.jsx("g",{transform:N4t(r),children:ie.jsx("text",{fill:$t,fontSize:"14px",fontWeight:"500",fontFamily:"Manrope",dominantBaseline:L4t(r),textAnchor:$4t(r),...b,children:c(C)})})]},x))})},F4t=1;function V4t({scaleX:e,scaleY:t,width:n,height:r,axisX:a,axisY:i,frameType:o,updatingKey:s=""}){let[c,f]=tn.useState(e.ticks()),[A,p]=tn.useState(t.ticks()),{significantLines:v=[]}=a,{significantLines:y=[]}=i;return tn.useEffect(()=>{let b=e.ticks().filter(x=>!v.includes(x)),C=t.ticks().filter(x=>!y.includes(x));f(b),p(C)},[e,t,s]),ie.jsxs("g",{stroke:$f,children:[a.showGrid&&c.map(b=>{let C=e(b);return ie.jsx("line",{x1:C,x2:C,y1:0,y2:r},`x_${C}_${r}`)}),i.showGrid&&A.map(b=>{let C=t(b);return ie.jsx("line",{x1:0,x2:n,y1:C,y2:C},`y_${C}_${n}`)}),ie.jsx("g",{strokeDasharray:Vf(a.significantLinesStyle),stroke:$t,children:v.map(b=>{let C=e(b);return ie.jsx("line",{x1:C,x2:C,y1:0,y2:r},`significant_${C}_${r}`)})}),ie.jsx("g",{strokeDasharray:Vf(i.significantLinesStyle),stroke:$t,children:y.map(b=>{let C=t(b);return ie.jsx("line",{x1:0,x2:n,y1:C,y2:C},`significant_${C}_${n}`)})}),o!=="empty"&&ie.jsxs("g",{strokeWidth:F4t,children:[(a.showGrid||o!=="left")&&ie.jsx("line",{stroke:o==="left"?$f:$t,x1:"0",x2:n,y1:r,y2:r}),(a.showGrid||o!=="bottom")&&ie.jsx("line",{stroke:o==="bottom"?$f:$t,x1:"0",x2:"0",y1:"0",y2:r}),(a.showGrid||o==="full")&&ie.jsx("line",{stroke:o==="full"?$t:$f,x1:n,x2:n,y1:"0",y2:r}),(i.showGrid||o==="full")&&ie.jsx("line",{stroke:o==="full"?$t:$f,x1:"0",x2:n,y1:"0",y2:"0"})]})]})}var O4t=new Ac("16px Manrope");function BZ(e,t){return typeof e=="string"?e:t.length?t[0].data[e.value]:""}function Q4t(e,t,n=[]){let r=e.data,a=[`x: ${ni(e.x)}`,`y: ${ni(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 z4t(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:` = ${ni(e.r2)}`})]})}function U4t(e){return typeof e.pValue>"u"?null:ie.jsx("tspan",{children:`p-value = ${ni(e.pValue)}`})}function G4t(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 = ${ni(t)} ± ${ni(n)}, intercept = ${ni(r)} ± ${ni(a)}`})})}function j4t(e){let t=[z4t(e),U4t(e),G4t(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 UD=3;function kZ(e,t,n,r){if(!r)return[];let a=[];for(let i of e){let o=i.label;if(!o)continue;let s=O4t.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)+UD})}return a}function Y4t({facetKey:e,width:t,height:n,dimensions:r,scales:a,xAxis:i,yAxis:o,frameType:s,dotsData:c,facetSettings:f,trendsData:A,keyColumn:p,margins:v,chartSizes:y,tooltips:b,tooltipsContainer:C,captionsSizes:x,facetTitle:k,onlyPositive:_,layersData:P,aesGetters:N,tooltipsData:I}){let[F,Q]=tn.useState(),{padding:Z}=r,{dots:ee}=c,le=i.showTicks?l2:0,z=o.showTicks?l2:0,U=BZ(i.title,ee),G=BZ(o.title,ee),Y=r.chartEdgeSides.includes("left")||!(f!=null&&f.sharedY),X=r.chartEdgeSides.includes("bottom")||!(f!=null&&f.sharedX),te=r.chartEdgeSides.includes("left"),he=r.chartEdgeSides.includes("bottom"),ae={left:v.left+r.left+Z.left,right:y.totalWidth-(v.left+r.left+Z.left),top:v.top+r.top+Z.top,bottom:y.totalHeight-(v.top+r.top+Z.top)},ge=!1,[me,fe]=tn.useState(()=>kZ(ee,a,N,P.find(Oe=>Oe.type==="dots"))),[be,He]=tn.useState(()=>fE(me,t,n,UD,UD)),[_e,Ie]=tn.useState(null);tn.useEffect(()=>{fe(kZ(ee,a,N,P.find(Oe=>Oe.type==="dots")))},[ee,a,N,P]),tn.useEffect(()=>{let Oe=fE(me,t,n);He(Oe)},[me,t,n]);let Ue=F&&I.fixed;return ie.jsxs("g",{transform:`translate(${r.left+Z.left},${r.top+Z.top})`,children:[ge,k.length&&ie.jsxs("g",{children:[s==="full"&&ie.jsx("rect",{x:"0",y:-Z.top,height:Z.top,width:t,fill:"#F7F8FA",stroke:$t}),k.map((Oe,ft)=>{let Ve=k.length,Xe=(Z.top-ED*Ve)/2;return ie.jsx("text",{fontSize:"14px",fontWeight:"500",fill:$t,x:t/2,dy:Xe+ED/2-Z.top,y:ft*ED,textAnchor:"middle",dominantBaseline:"central",children:Oe},ft)})]}),ie.jsxs("g",{dominantBaseline:"central",textAnchor:"middle",fontWeight:"500",fontSize:"14px",fill:$t,children:[he&&ie.jsx("text",{x:t/2,y:n+Z.bottom-Ov-v4/2,children:U}),ge,te&&ie.jsx("text",{x:-Z.left+Ov+v4/2,y:n/2,transform:`rotate(-90,${-Z.left+Ov+v4/2},${n/2})`,children:G}),ge]}),ie.jsx(V4t,{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(dE,{scale:a.x,orient:"bottom",onlyPositive:_.x,tickSize:le}),ge]}),Y&&ie.jsxs("g",{children:[ie.jsx(dE,{scale:a.y,orient:"left",onlyPositive:_.y,tickSize:z}),ge]}),A&&A.map(({predict:Oe,getArea:ft,color:Ve,data:Xe,bounded:tt,xBounds:qe,stats:gt},wt)=>{let[Xt,rr]=tt?qe:a.x.domain(),sr=(rr-Xt)/15,ra=Oe(Xt),vi=Oe(rr);if(isNaN(ra)||isNaN(vi))return null;let ea=N.dotColor(Ve,Xe);return ie.jsxs("g",{children:[ie.jsx("text",{y:wt*20+20,fill:ea,x:t-8,textAnchor:"end",children:j4t(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(vi),stroke:ea})]},wt)}),P.map((Oe,ft)=>{if(Oe.type==="dots")return ie.jsxs("g",{children:[ee.map(Ve=>{let Xe=Ue&&I.selectedData===Ve,tt=ie.jsx("g",{transform:`translate(${a.x(Ve.x)},${a.y(Ve.y)})`,opacity:Ve.dimmed?.3:1,onMouseOver:()=>I.onMouseOver(Ve,e),onMouseLeave:()=>I.onMouseLeave(),children:jc(N.dotShape(Oe.info.aes.dotShape,Ve.data),N.dotSize(Oe.info.aes.dotSize,Ve.data),N.dotColor(Oe.info.aes.dotFill,Ve.data))},Ve.id);return Xe?uu.createPortal(tt,F):tt}),be.map(Ve=>{let{name:Xe,height:tt,bbox:qe,width:gt}=Ve;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:()=>Ie(Ve.dot),onMouseLeave:()=>Ie(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})]})},Ve.dot.id)}),_e&&ie.jsxs("g",{transform:`translate(${a.x(_e.x)},${a.y(_e.y)})`,children:[jc(N.dotShape(Oe.info.aes.dotShape,_e.data),N.dotSize(Oe.info.aes.dotSize,_e.data)+1,"white","white"),jc(N.dotShape(Oe.info.aes.dotShape,_e.data),N.dotSize(Oe.info.aes.dotSize,_e.data),N.dotColor(Oe.info.aes.dotFill,_e.data))]},"activeDot")]},ft);if(Oe.type==="curve"&&!Oe.info.smoothing)return Oe.geoms.map((Ve,Xe)=>ie.jsx("g",{children:ie.jsx("polyline",{points:Ve.dots.map(tt=>`${a.x(tt.x)},${a.y(tt.y)}`).join(" "),fill:"none",stroke:N.lineColor(Oe.info.aes.lineColor,Ve.data),strokeWidth:Oe.info.aes.lineWidth,strokeDasharray:Vf(Oe.info.aes.lineShape)})},Xe));if(Oe.type==="curve"&&Oe.info.smoothing)return Oe.geoms.map((Ve,Xe)=>ie.jsx("g",{children:ie.jsx("path",{d:gy().curve(yy).x(tt=>a.x(tt.x)).y(tt=>a.y(tt.y))(Ve.dots)??"",fill:"none",stroke:N.lineColor(Oe.info.aes.lineColor,Ve.data),strokeWidth:Oe.info.aes.lineWidth,strokeDasharray:Vf(Oe.info.aes.lineShape)})},Xe))}),b.show&&I.selectedData&&I.currentFacet===e&&ie.jsx(cu,{content:Q4t(I.selectedData,p,b==null?void 0:b.content),x:a.x(I.selectedData.x),y:a.y(I.selectedData.y),active:!0,sideDistances:ae,fixed:I.fixed,onClose:I.onClose,container:C}),ie.jsxs("g",{children:[I.fixed&&ie.jsx("rect",{width:y.chartWidth,height:y.chartHeight,fill:"rgba(255, 255, 255, 0.8)"}),ie.jsx("g",{ref:Oe=>{Oe&&!F&&Q(Oe)}})]})]})}function W4t({settingsId:e,chartSettings:t,chartSizes:n,chartsDimensions:r,facetKeys:a,facetSettings:i,scales:o,groupedDots:s,legendData:c,trendsData:f,columnsCount:A,margins:p,keyColumn:v,mainTitle:y,facetTitles:b,captionsSizes:C,onlyPositive:x,layersData:k,aesGetters:_,onTooltipHintSwitch:P}){let N=f2(P),[I,F]=tn.useState(),Q=tn.useRef(null);tn.useEffect(()=>{Q.current&&F(Q.current)},[]);let{xAxis:Z,yAxis:ee,title:le,frame:z,legend:U,tooltips:G}=t,Y=r[a[0]].padding,X=r[a[A-1]].padding,te=n.chartsWidth+jb,he=Y.top;return ie.jsx(h2,{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:$g}),ie.jsxs("g",{transform:`translate(${p.left},${p.top})`,fontFamily:"Manrope",children:[ie.jsx(v2,{title:y,show:le.show,position:le.position,leftPadding:Y.left,rightPadding:X.right,chartsWidth:n.chartsWidth}),a.map(ae=>ie.jsx(Y4t,{facetKey:ae,scales:{x:o.x[ae],y:o.y[ae]},width:n.chartWidth,height:n.chartHeight,dimensions:r[ae],margins:p,chartSizes:n,facetSettings:i,xAxis:Z,yAxis:ee,frameType:z.type,dotsData:s[ae],trendsData:f?f[ae]:null,tooltips:G,tooltipsContainer:I,keyColumn:v,facetTitle:b[ae],captionsSizes:C,layersData:k[ae],onlyPositive:x,aesGetters:_,tooltipsData:N},ae)),U.show&&ie.jsx("g",{transform:`translate(${te},${he})`,children:ie.jsx(m2,{legendData:c})})]}),ie.jsx("g",{ref:Q,style:{outline:"none"}})]})})}function X4t(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 K4t(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!=="",p=n.yAxisCaptionsWidth+2*xD,v=(t.showTicks?l2:0)+xD,y=c?v4+Ov:0,b=n.xAxisCaptionsWidth+2*xD,C=e.showTicks?l2:0,x=A?v4+Ov:0,k=p+v+y+GX,_=b+C+x+GX,P=Math.max(...r.map(N=>a[N].length));return{left:s?k:Ov,top:P===0?0:$yt*2+P*b4,bottom:f?_+8:Ov,right:Ov}}function Z4t(e,t,n){let r=[];for(let a=0;a<t;a++)r.push(e.slice(a*n,a*n+n));return r}function J4t(e,t){let n=Math.floor(e/t),r=e-n*t;return[n,r]}function q4t(e){return typeof e=="object"&&e!==null&&"type"in e&&"value"in e&&e.type==="grouping"}function B2(e,t){return function(n,r){var a,i;if(rh(n)&&t==="dotSize"){let{domain:o,range:s}=n,c=iv().domain(o).range(s)(Number(r[n.columnName.value]));return Math.max(1,c)}if(rh(n)&&(t==="dotFill"||t==="lineColor")){let{domain:o,range:s,type:c="linear"}=n;return k4(s,o,c)(Number(r[n.columnName.value]))}if(q4t(n)){let o=n.value;return(i=((a=e[o])==null?void 0:a[String(r[o])])??CD)==null?void 0:i[t]}return n}}function ewt(e){return{dotShape:B2(e,"dotShape"),dotColor:B2(e,"dotFill"),dotSize:B2(e,"dotSize"),lineShape:B2(e,"lineShape"),lineColor:B2(e,"lineColor"),trendColor:B2(e,"dotFill")}}var twt=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=Gh(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,p,v)=>{let[y,b]=J4t(v,this.columnsCount),C=X4t(v,e.length,this.columnsCount,this.rowsCount),x=K4t(n,r,this.captionsSizes,Z4t(e,this.rowsCount,this.columnsCount)[y],this.facetTitles,C,t),k=a+x.left+x.right,_=i+x.top+x.bottom;return A[p]={left:o,top:s,chartEdgeSides:C,padding:x,inner:{width:a,height:i},outer:{width:k,height:_}},o+=k,b===this.columnsCount-1&&(o=0,s+=_),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],[p,v]=[1/0,-1/0],y=e.reduce((C,x)=>{let k=a[x],{minX:_,minY:P,maxX:N,maxY:I}=k;return f=Math.min(f,_),p=Math.min(p,P),A=Math.max(A,N),v=Math.max(v,I),C[x]={minX:_,maxX:N,minY:P,maxY:I},C},{});e.forEach(C=>{let x=n.scale==="log"?Um():Zr(),k=y[C],_=n.lowerValue?Number(n.lowerValue):t.sharedX?f:k.minX,P=n.upperValue?Number(n.upperValue):t.sharedX?A:k.maxX;if(typeof n.symmetricRange<"u"){let F=n.symmetricRange;if(F>=_&&F<=P){let Q=Math.max(F-_,P-F);_=F-Q,P=F+Q}}let N=[0,this.chartSizes.chartWidth],I=x.copy().domain([_,P]).range([Gb.LEFT,this.chartSizes.chartWidth-Gb.RIGHT]);x.domain([I.invert(0),I.invert(this.chartSizes.chartWidth)]).range(N).nice(),this.scales.x[C]=x});let b=e.reduce((C,x)=>{let k=i?i[x]:[];return C[x]=k.reduce((_,P)=>{let N=P.bounded?P.xBounds:this.scales.x[x].domain(),I=P.getInterval(N[0]),F=P.getInterval(N[1]);return _.minY=Math.min(_.minY,isNaN(I.left)?_.minY:I.left,isNaN(F.left)?_.minY:F.left),_.maxY=Math.max(_.maxY,isNaN(I.right)?_.maxY:I.right,isNaN(F.right)?_.maxY:F.right),_},{minY:1/0,maxY:-1/0}),p=Math.min(p,C[x].minY),v=Math.max(v,C[x].maxY),C},{});e.forEach(C=>{let x=r.scale==="log"?Um():Zr(),k=y[C],_=b[C],P=r.lowerValue?Number(r.lowerValue):t.sharedY?p:Math.min(k.minY,_.minY),N=r.upperValue?Number(r.upperValue):t.sharedY?v:Math.max(k.maxY,_.maxY);if(typeof r.symmetricRange<"u"){let Q=r.symmetricRange;if(Q>=P&&Q<=N){let Z=Math.max(Q-P,N-Q);P=Q-Z,N=Q+Z}}let I=[this.chartSizes.chartHeight,0],F=x.copy().domain([P,N]).range([this.chartSizes.chartHeight-Gb.BOTTOM,Gb.TOP]);x.domain([F.invert(this.chartSizes.chartHeight),F.invert(0)]).range(I).nice(),this.scales.y[C]=x})}updateCaptionsSize(e){let t=new Ac("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}=B4(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=Uv(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]=Uv(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 p=t[A.value];if(p.usedAes.length===0||!p.aesMap)return;let v={};p.values.forEach(C=>{v[C]||(v[C]={...bD}),p.usedAes.forEach(x=>{var k,_,P;(x==="dotFill"||x==="lineColor")&&(v[C].color=((k=p.aesMap[C])==null?void 0:k[x])??$t),x==="dotShape"&&(v[C].shape=((_=p.aesMap[C])==null?void 0:_[x])??"21"),x==="dotSize"&&(v[C].size=((P=p.aesMap[C])==null?void 0:P[x])??3)})});let y=A.label??A.value,b=zo().domain(p.values).range(p.values.map(C=>v[C]));a.push({...i,id:A.value,type:"dots",title:y,scale:b,values:p.values,labels:p.labels})}),r.forEach(A=>{if(A.type==="dots"&&rh(A.aes.dotFill)){let{domain:p,range:v,columnName:y,type:b="linear"}=A.aes.dotFill,C=y.label??y.value,x=k4(v,p,"linear"),k=(b==="log"?av():Zr()).domain(p).range([this.chartSizes.chartHeight,0]),_=c2(k,p);a.push({...i,id:"dotFill",type:"continuous",title:C,scale:x,tickPositionScale:k,values:_})}if(A.type==="dots"&&rh(A.aes.dotSize)){let{columnName:p,domain:v,range:y}=A.aes.dotSize,b=p.label??p.value,C=iv(v,y),x=C.ticks(3),k=C.tickFormat(3),_=x.reduce((P,N)=>(P[String(N)]=k(N),P),{});a.push({...i,id:p.value,type:"size",title:b,scale:C,values:x,labels:_})}}),!a.length){this.legend={width:0,height:0,items:[]};return}let o=y2(a,this.chartSizes.chartHeight),s=o[o.length-1],c=s.left+s.width+jb,f=this.chartSizes.chartHeight;this.legend={width:c,height:f,items:o}}render(e,t,n,r,a,i,o,s,c,f,A,p,v,y,b){var I;let{xAxis:C,yAxis:x,size:k,title:_,legend:P}=t;this.updateChartSizes(k),this.updateViewport(r,n,C,x,i,o),this.updateCaptionsSize(c.y),this.createFacetTitles(r,a),this.updateChartDimensions(r,n,C,x),this.updateLegendSize(P,f,v,y),this.createMainTitle(r,_),this.updateMargins();let N=ie.jsx(W4t,{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:ewt(p),onTooltipHintSwitch:b});this.component=N,(I=this.reactRoot)==null||I.render(N)}renderError(e){var t;(t=this.reactRoot)==null||t.render(ie.jsx(zv,{message:e}))}},nwt=twt,rwt=class{constructor(e){Be(this,"type","dots");Be(this,"aes",{dotFill:$t,dotShape:"21",dotSize:3,opacity:1});this.aes={...this.aes,...e.aes}}},awt=class{constructor(e){Be(this,"type","curve");Be(this,"smoothing");Be(this,"aes",{lineColor:$t,lineWidth:1,lineShape:"solid",opacity:1});this.smoothing=e.smoothing??!1,this.aes={...this.aes,...e.aes}}},TZ=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;g2t.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??$t}:null,this.layers=e.layers.map(i=>{if(i.type==="dots")return new rwt(i);if(i.type==="curve")return new awt(i);uA(i,"Unknown layer type")}).filter(Boolean)}},iwt=Dht(kyt()),_Z=.05;function owt(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,p=5394.196021424751,v=21213.794301586597,y=39307.89580009271,b=28729.085735721943,C=5226.495278852854,x=1.4234371107496835,k=4.630337846156546,_=5.769497221460691,P=3.6478483247632045,N=1.2704582524523684,I=.2417807251774506,F=.022723844989269184,Q=.0007745450142783414,Z=2.053191626637759,ee=1.6763848301838038,le=.6897673349851,z=.14810397642748008,U=.015198666563616457,G=.0005475938084995345,Y=10507500716444169e-25,X=6.657904643501103,te=5.463784911164114,he=1.7848265399172913,ae=.29656057182850487,ge=.026532189526576124,me=.0012426609473880784,fe=27115555687434876e-21,be=20103343992922881e-23,He=.599832206555888,_e=.1369298809227358,Ie=.014875361290850615,Ue=.0007868691311456133,Oe=18463183175100548e-21,ft=1421511758316446e-22,Ve=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)/(((((((C*tt+b)*tt+y)*tt+v)*tt+p)*tt+A)*tt+f)*tt+1),qe):(tt=e,tt=Math.sqrt(-Math.log(tt)),tt<=5?(tt+=-1.6,qe=(((((((Q*tt+F)*tt+I)*tt+N)*tt+P)*tt+_)*tt+k)*tt+x)/(((((((Y*tt+G)*tt+U)*tt+z)*tt+le)*tt+ee)*tt+Z)*tt+1)):(tt+=-5,qe=(((((((be*tt+fe)*tt+me)*tt+ge)*tt+ae)*tt+he)*tt+te)*tt+X)/(((((((Ve*tt+ft)*tt+Oe)*tt+Ue)*tt+Ie)*tt+_e)*tt+He)*tt+1)),qe=-qe,qe)}function DZ(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),p=48/(A*A),v=((20700*A/p-98)*A-16)*A+96.36,y=((94.5/(p+v)-3)/p+1)*a(A*s*.5)*t;return c=y*e,f=i(c,2/t),f>.05+A?(c=owt(e/2),f=c*c,t<5&&(v=v+.3*(t-4.5)*(c+.6)),v=(((.05*y*c-5)*c-7)*c-2)*c+p+v,f=(((((.4*f+6.3)*f+36)*f+94.5)/v-f-3)/p+1)*c,f=A*f*f,f>.002?f=o(f)-1:f=.5*f*f+f):f=((1/(((t+6)/(t*f)-.089*y-.822)*(t+2)*3)+.5/(t+4))*f-1)*(t+1)/(t+2)+1/f,a(t*f)}function lwt(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 swt(e,t,n){let r=A=>A*t+n,a=e.length,i=oc(e,A=>A.x)/e.length,o=DZ(_Z,a-2),s=Math.sqrt(oc(e,A=>(A.y-r(A.x))**2)/(a-2)/oc(e,A=>(A.x-i)**2)),c=s*o,f=s*Math.sqrt(oc(e,A=>A.x**2)/a)*o;return{slope:t,intercept:n,slopeError:c,interceptError:f}}function uwt(e,t){let n=oc(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=DZ(_Z,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,p=c+o*f;return{x:s,y:c,left:isNaN(A)?c:A,right:isNaN(p)?c:p}}}function cwt(e){let t=e.length;return Math.pow((t*oc(e,n=>n.x*n.y)-oc(e,n=>n.x)*oc(e,n=>n.y))/(Math.sqrt(t*oc(e,n=>n.x*n.x)-Math.pow(oc(e,n=>n.x),2))*Math.sqrt(t*oc(e,n=>n.y*n.y)-Math.pow(oc(e,n=>n.y),2))),2)}function fwt(e,t){let n=Ls(e,t);return Ls(e.map(r=>(t(r)-n)**2))}function PZ(e,t){return Math.sqrt(fwt(e,t))}function dwt(e,t,n){let r=Ls(e,t),a=Ls(e,n),i=e.length;return oc(e,o=>(o.x-r)*(o.y-a))/i}function Awt(e){let t=dwt(e,a=>a.x,a=>a.y),n=PZ(e,a=>a.x),r=PZ(e,a=>a.y);return t/(n*r)}function pwt(e,t){let n=e.length,r=1,a=1,i=n-r-1,o=Ls(e,v=>v.y),s=oc(e,v=>(t(v.x)-o)**2),c=oc(e,v=>(t(v.x)-v.y)**2),f=s/a,A=c/i,p=f/A;return 1-(0,iwt.default)(p,a,i)}function hwt(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(x=>r.every((k,_)=>String(x.data[k.value])===c[_])),[A=0,p=0]=_p(f,x=>x.x),[v,y]=lwt(f),b=x=>v*x+y,C=uwt(f,b);return{predict:b,getInterval:C,getArea:(x,k,_)=>jB().x(P=>x(P.x)).y0(P=>k(P.left)).y1(P=>k(P.right))(_.map(C))??"",color:a.color,bounded:a.bounded,data:f[0].data,showStats:!0,xBounds:[A,p],stats:{r2:cwt(f),r:Awt(f),pValue:pwt(f,b),coefficients:swt(f,v,y)}}}),i},{}):null}function MZ(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 HZ(e){return typeof e=="object"&&"type"in e&&e.type==="grouping"}function vwt(e,t,n,r){return t.reduce((a,i)=>{let o=Zn.uniqBy(e.rows,p=>p[i.value]),s=p=>String(p[i.value]),c=p=>i.valueLabels?String(p[i.valueLabels]):s(p),f=new Set;n.forEach(p=>{p.aes&&Object.entries(p.aes).forEach(([v,y])=>{HZ(y)&&y.value===i.value&&f.add(v)})});let A=o.reduce((p,v)=>(p[s(v)]=c(v),p),{});return a[i.value]={values:o.map(s).filter(p=>p!=="null").sort((p,v)=>A[p].localeCompare(A[v],"en",{numeric:!0})),usedAes:[...f],aesMap:r[i.value],labels:A},a},{})}var mwt=class extends Rg{constructor(t,n,r){super(t,n);Be(this,"settings");Be(this,"chartRenderer",new nwt);Be(this,"onTooltipHintSwitch",()=>{});Be(this,"calculatedData",null);this.settings=new TZ(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 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 scatterplot")}export(){return this._updateChart(),my(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,p=this.data.getColumnCategories(i.value),v=r.map(Q=>this.data.getColumnCategories(Q.value)),y=a.map(Q=>this.data.getColumnCategories(Q.value)),b=v.length?MZ([...v]):[["null"]],C=y.length?MZ([...y]):[["null"]],x=r.map(Q=>Q.value)??null;this.data.setGrouping([...x,i.value]);let k={x:this.data.rows.every(Q=>{let Z=Q[t.value];return Z===null||!(Number(Z)<0)}),y:this.data.rows.every(Q=>{let Z=Q[n.value];return Z===null||!(Number(Z)<0)})},_=T4t(this.data,b,t,n,f,A,p),P=Object.keys(_),N=hwt(_,P,C,a,o),I=vwt(this.data,a,s,c),F=_4t(s,P,_,C,a);this.calculatedData={onlyPositive:k,dotsByFacets:_,facetKeys:P,facetKeysCombinations:b,trendsData:N,legendLabels:I,layersData:F}}_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(([p,v])=>{HZ(v)&&v.value===c.value&&f.add(p)})}),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)}},AE={TOP:30,BOTTOM:30,LEFT:30,RIGHT:30},T4=20,IZ=4,RZ=24;function gwt(e,t,n=[]){let r=e.data,a=[`x: ${ni(e.x)}`,`y: ${ni(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 NZ(e){return typeof e=="string"?e:e.label??e.value}var LZ=gy().curve(yy);function ywt({scales:e,chartSettings:t,mainTitle:n,keyColumn:r,margins:a,chartSizes:i,onlyPositive:o,container:s,zoomStateKey:c,legendData:f,dotsByGrouping:A,layers:p,aesGetters:v,tooltipData:y}){var U;let{title:b,xAxis:C,yAxis:x,frame:k,legend:_}=t,P=C.showTicks?IZ:0,N=x.showTicks?IZ:0,I=C.title,F=x.title,Q={left:0,right:i.chartWidth,top:0,bottom:i.chartHeight};if(!s)return null;let Z=p.find(G=>G.type==="curve"),[ee,le]=tn.useState([]);function z(){let G=Object.entries(A).map(([Y,X])=>({key:Y,d:Z!=null&&Z.smoothing?LZ(X)??"":X.map(te=>`${e.x(te.x)},${e.y(te.y)}`).join(" "),dot:X[0]}));le(G)}return tn.useEffect(()=>{Z&&(LZ.x(G=>e.x(G.x)).y(G=>e.y(G.y)),z())},[c]),tn.useEffect(()=>{Z&&z()},[Z==null?void 0:Z.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:$g}),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(v2,{title:n,show:b.show,position:b.position,leftPadding:a.left,rightPadding:a.right,chartsWidth:i.chartWidth}),ie.jsxs("g",{dominantBaseline:"central",textAnchor:"middle",fontWeight:"500",fontSize:"14px",fill:$t,children:[I&&ie.jsx("text",{x:i.chartWidth/2,y:i.chartHeight+a.bottom-T4/2,children:NZ(I)}),F&&ie.jsx("text",{x:-a.left+T4/2,y:i.chartHeight/2,transform:`rotate(-90,${-a.left+T4/2},${i.chartHeight/2})`,children:NZ(F)})]}),ie.jsx(mZ,{width:i.chartWidth,height:i.chartHeight,scaleX:e.x,scaleY:e.y,axisX:C,axisY:x,updatingKey:c,frameType:k.type}),ie.jsx("g",{transform:`translate(0,${i.chartHeight})`,children:ie.jsx(dE,{scale:e.x,orient:"bottom",onlyPositive:o.x,tickSize:P})}),ie.jsx("g",{children:ie.jsx(dE,{scale:e.y,orient:"left",onlyPositive:o.y,tickSize:N})}),Z&&Z.smoothing&&ie.jsx("g",{clipPath:"url(#viewportClipPath)",children:ee.map(({key:G,d:Y,dot:X})=>{var te;return ie.jsx("path",{d:Y,fill:"none",stroke:v.dotFill(X.data),strokeWidth:(te=Z.aes)==null?void 0:te.lineWidth,strokeDasharray:v.lineType(X.data)},G)})}),Z&&!Z.smoothing&&ie.jsx("g",{clipPath:"url(#viewportClipPath)",children:ee.map(({key:G,d:Y,dot:X})=>{var te;return ie.jsx("polyline",{points:Y,fill:"none",stroke:v.dotFill(X.data),strokeWidth:(te=Z.aes)==null?void 0:te.lineWidth,strokeDasharray:v.lineType(X.data)},G)})}),y.selectedData&&ie.jsx(cu,{content:gwt(y.selectedData,r,(U=t.tooltips)==null?void 0:U.content),x:e.x(y.selectedData.x),y:e.y(y.selectedData.y),active:!0,fixed:y.fixed,sideDistances:Q,container:s,onClose:y.onClose}),_.show&&ie.jsx("g",{transform:`translate(${i.chartWidth+RZ},0)`,children:ie.jsx(m2,{legendData:f})})]})]})}var wwt=k6.memo(ywt),Cwt=20;function bwt({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),p=tn.useRef(null),v=tn.useRef(null),y=tn.useRef(a);function b(){A.current=null,p.current=null,v.current=null,y.current=[],i([]),s(null)}function C(_){n||_.key!=="Escape"||b()}tn.useEffect(()=>{n&&(A.current=null,p.current=null,v.current=null,s(null))},[n]),tn.useEffect(()=>(document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)),[]),tn.useEffect(()=>{if(o&&c)return;if(a.length===0){r([]);return}let _=a.map(P=>P[0]);_.push(a[a.length-1][1]),r(_)},[a]);function x(){if(!A.current||n)return;let _=[...A.current],P=e.x.invert(_[0]),N=e.y.invert(_[1]),I=y.current,F=v.current,Q=p.current&&I.length>1?Math.sqrt((_[0]-p.current[0])**2+(_[1]-p.current[1])**2):1/0;v.current?v.current&&Q>Cwt?(I=[...I,[v.current,[P,N]]],F=[P,N]):(I=[...I,[v.current,[P,N]]],I.length>2&&(I=[...I,[I[I.length-1][1],I[0][0]]]),F=null,I.length<=2?r([]):r(I.map(Z=>Z[0])),p.current=null):(p.current=_,I=[],F=[P,N],r([])),i(I),s(F),y.current=I,v.current=F}function k(_){let P=[_.nativeEvent.offsetX,_.nativeEvent.offsetY];f(P),A.current=P}return ie.jsxs("g",{children:[ie.jsx("rect",{fill:"transparent",width:t.chartWidth,height:t.chartHeight,onMouseMove:k,onClick:x}),a.map(([_,P],N)=>ie.jsx("line",{x1:e.x(_[0]),y1:e.y(_[1]),x2:e.x(P[0]),y2:e.y(P[1]),stroke:$t,style:{pointerEvents:"none"}},N)),o&&c&&ie.jsx("line",{x1:e.x(o[0]),y1:e.y(o[1]),x2:c[0],y2:c[1],stroke:$t,style:{pointerEvents:"none"}},"lastLine")]})}function Ewt({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:p,width:v}=c;return ie.jsx("g",{children:ie.jsxs("g",{transform:`translate(${p.minX},${p.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(bwt,{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 xwt=Ewt;function Swt({settingsId:e,scales:t,chartSettings:n,mainTitle:r,keyColumn:a,margins:i,chartSizes:o,captionsSizes:s,onlyPositive:c,container:f,zoomStateKey:A,aesGetters:p,legendData:v,labels:y,onPolygonUpdate:b,onTooltipHintSwitch:C,lassoMode:x,dotsByGrouping:k,layers:_,selectedDot:P=null}){if(!f)return null;let N=f2(C);return tn.useEffect(()=>{P?N.onMouseOver(P):N.onMouseLeave()},[P]),ie.jsx("div",{children:ie.jsxs(h2,{dataId:e,children:[ie.jsx(wwt,{aesGetters:p,dotsByGrouping:k,layers:_,scales:t,keyColumn:a,margins:i,mainTitle:r,captionsSizes:s,chartSettings:n,chartSizes:o,onlyPositive:c,container:f,zoomStateKey:A,legendData:v,tooltipData:N}),uu.createPortal(ie.jsx(xwt,{scales:t,container:f,aesGetters:p,labels:y,chartSizes:o,selectedDot:P,onPolygonUpdate:b,lassoMode:x,tooltipData:N}),f)]})})}var $Z=e=>e.selection()!==e,FZ=(e,t)=>{e=e||"g";let n=(i,o)=>o,r=null,a=function(i,o){o=o||(y=>y);let s=i.selection(),c=$Z(i)?i:null,f=s.selectChildren(t==null?e:`${e}.${t}`).data(o,n),A=f.enter().append(e).attr("class",t),p=f.exit();f=f.merge(A);let v=c||r;return v&&(f=f.transition(v).style("opacity",1),A.style("opacity",1e-6),p=p.transition(v).style("opacity",1e-6)),p.remove(),f.enter=()=>A,f.exit=()=>p,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},VZ=(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}},OZ=(e,t,...n)=>{for(let r of n)e[r]=VZ(e,t,r);return e},Bwt=e=>t=>e.reduce((n,r)=>n&&r(n),t),GD=(e,t,...n)=>{let r=Bwt(n);for(let a of Object.keys(t)){let i=r(a);i&&(e[i]=VZ(e,t,a))}return e},kwt=e=>e.map(t=>typeof t=="string"?new RegExp(`^${t}$`):t),Twt=(...e)=>(e=kwt(e),t=>e.every(n=>!n.test(t))&&t),k2=e=>typeof e=="function"?e:()=>e;function _wt(){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 Dwt=(e,t)=>{switch(e){case"left":return t/2;case"right":return-t/2;default:return 0}},QZ=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},Pwt=()=>{let e=()=>0,t=s=>s.x,n=s=>s.y,r="center",a=()=>5,i="vertical",o=QZ({decorate:()=>{},defined:(s,c)=>_wt(e,t,n)(s,c),xScale:rv(),yScale:rv()});return o.values=(s,c)=>{let f=a(s,c),A=Dwt(r,f),p=o.xScale(),v=o.yScale();if(i==="vertical"){let y=v(n(s,c),c),b=v(e(s,c),c),C=p(t(s,c),c)+A;return{d:s,x:C,y,y0:b,width:f,height:y-b,origin:[C,y],baseOrigin:[C,b],transposedX:C,transposedY:y}}else{let y=p(n(s,c),c),b=p(e(s,c),c),C=v(t(s,c),c)+A;return{d:s,x:C,y,y0:b,width:f,height:y-b,origin:[y,C],baseOrigin:[b,C],transposedX:y,transposedY:C}}},o.xValues=()=>i==="vertical"?[t]:[e,n],o.yValues=()=>i!=="vertical"?[t]:[e,n],o.baseValue=(...s)=>s.length?(e=k2(s[0]),o):e,o.crossValue=(...s)=>s.length?(t=k2(s[0]),o):t,o.mainValue=(...s)=>s.length?(n=k2(s[0]),o):n,o.bandwidth=(...s)=>s.length?(a=k2(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},Mwt=()=>{let e=Pwt(),t=k2(64),n=lF,r=o4(),a=o4(),i=o4().type(nh.UNSIGNED_SHORT),o=o4().type(nh.UNSIGNED_BYTE),s=iht().crossValueAttribute(r).mainValueAttribute(a).sizeAttribute(i).definedAttribute(o),c=(b,C)=>!1,f=Aht,A=[],p=null,v=null,y=b=>{let C=f(e.xScale()),x=f(e.yScale()),k=!c(A,b);k&&(A=b,i.value((_,P)=>t(_,P)).data(b),o.value((_,P)=>e.defined()(_,P)).data(b)),(k||C.scale!==p)&&(p=C.scale,e.orient()==="vertical"?r.value((_,P)=>C.scale(e.crossValue()(_,P))).data(b):r.value((_,P)=>C.scale(e.mainValue()(_,P))).data(b)),(k||x.scale!==v)&&(v=x.scale,e.orient()==="vertical"?a.value((_,P)=>x.scale(e.mainValue()(_,P))).data(b):a.value((_,P)=>x.scale(e.crossValue()(_,P))).data(b)),s.xScale(C.webglScale).yScale(x.webglScale).type(wht(n)).decorate(_=>e.decorate()(_,b,0)),s(b.length)};return y.size=(...b)=>b.length?(t=k2(b[0]),y):t,y.type=(...b)=>b.length?(n=b[0],y):n,y.equals=(...b)=>b.length?(c=b[0],y):c,y.scaleMapper=(...b)=>b.length?(f=b[0],y):f,GD(y,e,Twt("baseValue","bandwidth","align")),OZ(y,s,"context","pixelRatio"),y},zZ=()=>{let e=[],t=a=>a,n=(a,i)=>i,r=QZ({decorate:()=>{},xScale:rv(),yScale:rv()});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},Hwt=()=>{let e=zZ(),t=FZ("g"),n=FZ("g","multi"),r=a=>{$Z(a)&&(n.transition(a),t.transition(a));let i=e.mapping(),o=e.series(),s=e.xScale(),c=e.yScale();a.each((f,A,p)=>{let v=n(ws(p[A]),o);v.each((y,b,C)=>{y.xScale(s).yScale(c);let x=i(f,b,o);t(ws(C[b]),[x]).call(y)}),v.selection().order(),e.decorate()(v,f,A)})};return GD(r,e),OZ(r,n,"key"),r},Iwt=()=>{let e=null,t=1,n=zZ(),r=a=>{let i=n.mapping(),o=n.series(),s=n.xScale(),c=n.yScale();o.forEach((f,A)=>{let p=i(a,A,o);f.context(e).pixelRatio(t).xScale(s).yScale(c);let v;f.decorate?(v=f.decorate(),f.decorate((y,b,C)=>{n.decorate()(y,a,A),v(y,b,C)})):n.decorate()(e,a,A),f(p),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,GD(r,n),r};function UZ(e){return e/2.35*(e/2.35)*64}function jD(e,t){return e+(1-e)*(1-t)}function YD(e,t){return[jD(e.r/255,t),jD(e.g/255,t),jD(e.b/255,t),1]}function Rwt(e){return typeof e=="object"&&e!==null&&"type"in e&&"value"in e&&e.type==="grouping"}function WD(e={},t,n){return function(r){var a,i;if(Rwt(n)){let o=n.value,s=r[o];return(i=((a=e[o])==null?void 0:a[String(s)])??CD)==null?void 0:i[t]}if(rh(n)&&t==="dotFill"){let{domain:o,range:s,type:c="linear"}=n;return k4(s,o,c)(Number(r[n.columnName.value]))}if(rh(n)&&t==="dotSize"){let{domain:o,range:s}=n,c=iv().domain(o).range(s)(Number(r[n.columnName.value]));return Math.max(1,c)}return n}}function GZ(e,t){let n=t.find(a=>a.type==="dots"),r=t.find(a=>a.type==="curve");return{dotFill:WD(e,"dotFill",n.aes.dotFill),dotSize:WD(e,"dotSize",n.aes.dotSize),lineType:WD(e,"lineShape",(r==null?void 0:r.aes.lineShape)??"solid")}}var Nwt=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:()=>$t,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&&Nb(this.polygon,[n.x,n.y])).map(n=>n.data.key);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=Gh(this.rootNode))}updateChartSizes(e){this.chartSizes.chartWidth=e.width,this.chartSizes.chartHeight=e.height}updateViewport(e,t,n){let r=e.scale==="log"?Um():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 y=e.symmetricRange;if(y>=a&&y<=o){let b=Math.max(y-a,o-y);a=y-b,o=y+b}}if(typeof t.symmetricRange<"u"){let y=t.symmetricRange;if(y>=i&&y<=s){let b=Math.max(y-i,s-y);i=y-b,s=y+b}}let c=[0,this.chartSizes.chartWidth],f=r.copy().domain([a,o]).range([AE.LEFT,this.chartSizes.chartWidth-AE.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"?Um():Zr(),p=[this.chartSizes.chartHeight,0],v=A.copy().domain([i,s]).range([this.chartSizes.chartHeight-AE.BOTTOM,AE.TOP]);A.domain([v.invert(this.chartSizes.chartHeight),v.invert(0)]).range(p).nice(),this.scales.y=A,this.scales.yOriginal=A.copy()}updateCaptionsSize(e){let t=new Ac("600 14px Arial");function n(o){return Math.max(...o.map(s=>t.getTextWidth(s)))}let{ticks:r,format:a}=B4(this.scales.y,e),i=n(r.map(a));this.captionsSizes={xAxisCaptionsWidth:20,yAxisCaptionsWidth:i}}createMainTitle(e){this.mainTitle=Uv(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+T4,left:Gc+this.captionsSizes.yAxisCaptionsWidth+T4,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,ws(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 p=t[A.value];if(p.usedAes.length===0||!p.aesMap)return;let v={};p.values.forEach(C=>{v[C]||(v[C]={...bD}),p.usedAes.forEach(x=>{var k,_;x==="dotFill"&&(v[C].color=((k=p.aesMap[C])==null?void 0:k[x])??$t),x==="dotSize"&&(v[C].size=((_=p.aesMap[C])==null?void 0:_[x])??3)})});let y=A.label??A.value,b=zo().domain(p.values).range(p.values.map(C=>v[C]));a.push({...i,id:A.value,type:"dots",title:y,scale:b,values:p.values,labels:p.labels})}),r.forEach(A=>{if(A.type==="dots"&&rh(A.aes.dotFill)){let{domain:p,range:v,columnName:y,type:b="linear"}=A.aes.dotFill,C=y.label??y.value,x=k4(v,p,"linear"),k=(b==="log"?av():Zr()).domain(p).range([this.chartSizes.chartHeight,0]),_=c2(k,p);a.push({...i,id:"dotFill",type:"continuous",title:C,scale:x,tickPositionScale:k,values:_})}if(A.type==="dots"&&rh(A.aes.dotSize)){let{columnName:p,domain:v,range:y}=A.aes.dotSize,b=p.label??p.value,C=iv(v,y),x=C.ticks(3),k=C.tickFormat(3),_=x.reduce((P,N)=>(P[String(N)]=k(N),P),{});a.push({...i,id:p.value,type:"size",title:b,scale:C,values:x,labels:_})}}),!a.length){this.legend={width:0,height:0,items:[]};return}let o=y2(a,this.chartSizes.chartHeight),s=o[o.length-1],c=s.left+s.width+RZ,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:p,legend:v}=t;this.updateChartSizes(A),this.updateViewport(c,f,n),this.updateCaptionsSize(r.y),this.updateLegendSize(v,o,s,i),this.createMainTitle(p),this.updateMargins(),this.aesGetters=GZ(a,i);let y=bht().data(e).value(P=>{let N=Q3(this.aesGetters.dotFill(P.data)),I=!P.dimmed&&(this.polygon.length<2||Nb(this.polygon,[P.x,P.y]))?1:.4;return YD(N,I)}),b=Mwt().equals((P,N)=>P===N).size(P=>UZ(this.aesGetters.dotSize(P.data))).crossValue(P=>P.x).mainValue(P=>P.y).decorate(P=>y(P)),C=S0t().scaleExtent([.1,1e3]).filter(()=>!this.lassoMode).on("start",()=>{this.selectedDot=null}).on("zoom",P=>{let N=P.transform,I=N.rescaleX(this.scales.xOriginal),F=N.rescaleY(this.scales.yOriginal);this.scales.x.domain(I.domain()),this.scales.y.domain(F.domain()),this.zoomStateKey=`${N.x}_${N.y}_${N.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=fE(this.allPossibleLabels,this.chartSizes.chartWidth,this.chartSizes.chartHeight),this.renderSvgLayer()}),x=z_().x(P=>P.x).y(P=>P.y).addAll(e),k=Eht().on("point",([P])=>{var Z,ee;if(!P){this.selectedDot=null,this.renderSvgLayer();return}let N=this.scales.x.invert(P.x),I=this.scales.y.invert(P.y),F=(Z=this.tools)==null?void 0:Z.qt.find(N,I),Q=this.selectedDot&&!F||!this.selectedDot&&F||((ee=this.selectedDot)==null?void 0:ee.id)!==(F==null?void 0:F.id);this.selectedDot=F??null,Q&&this.renderSvgLayer()}),_=q0t({xScale:this.scales.x,yScale:this.scales.y}).xAxisHeight(()=>"0").yAxisWidth(()=>"0").svgPlotArea(Hwt()).webglPlotArea(Iwt().series([b]).mapping(P=>P)).decorate(P=>{let N=P.enter();N&&!this.svgLayerElement&&(N.style("grid-template-columns","0 auto 1fr auto 0"),N.style("grid-template-rows","0 auto 1fr auto 0"),this.svgLayerElement=N.select(".svg-plot-area.plot-area svg").node()),N.select(".svg-plot-area.plot-area").call(C).call(k)});this.tools={webglChart:_,zoom:C,qt:x,fillColor:y,pointSeries:b},ws(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=GZ(e,t),this.tools.fillColor.value(n=>{let r=this.aesGetters.dotFill??(()=>$t),a=Q3(r(n.data)),i=!n.dimmed&&(this.polygon.length<2||Nb(this.polygon,[n.x,n.y]))?1:.4;return YD(a,i)}))}updatePointSize(){this.tools!==null&&(ws(this.canvasNode).datum([...this.allDots]),this.tools.pointSeries.size(e=>UZ(this.aesGetters.dotSize(e.data))))}updateByLasso(){var e;this.tools!==null&&((e=this.tools)==null||e.fillColor.value(t=>{let n=this.aesGetters.dotFill??(()=>$t),r=Q3(n(t.data)),a=!t.dimmed&&(this.polygon.length<2||Nb(this.polygon,[t.x,t.y]))?1:.4;return YD(r,a)}),this.renderWebglLayer())}updateData(e){this.tools!==null&&(ws(this.canvasNode).datum(e),this.tools.fillColor.data(e),this.tools.qt=z_().x(t=>t.x).y(t=>t.y).addAll(e))}render(e,t,n,r,a,i,o,s,c,f,A,p,v,y,b){if(this.lassoMode=y,this.tools===null)this.initSettings(a,t,i,r,s,c,f,A),this.onPolygonUpdateOutside=v,this.onTooltipHintSwitch=b;else{let{title:C,legend:x}=t;this.updateLegendSize(x,f,A,c),this.createMainTitle(C),this.updateMargins(),this.updateAes(s,c)}this.allDots=a,this.allPossibleLabels=p,this.allPossibleLabels.forEach(C=>{C.x=this.scales.x(C.dot.x),C.y=this.scales.y(C.dot.y)}),this.visibleLabels=fE(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&&ws(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)}),H4t(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(Swt,{...e}),(t=this.reactRoot)==null||t.render(this.svgLayerComponent)}renderError(e){var t;(t=this.reactRoot)==null||t.render(ie.jsx(zv,{message:e}))}},Lwt=Nwt,XD=H.object({type:H.literal("grouping"),value:H.string()}),$wt=H.object({type:H.literal("dots"),aes:H.optional(H.object({dotFill:H.optional(H.union([H.string(),XD,Jp(H.string())])),dotShape:H.optional(H.union([Td,XD])),dotSize:H.optional(H.union([H.number(),Jp(H.number())]))}))}),Fwt=H.object({type:H.literal("curve"),smoothing:H.optional(H.boolean()),aes:H.optional(H.object({lineWidth:H.optional(H.number()),lineShape:H.optional(XA),lineColor:H.optional(H.union([H.string(),XD,Jp(H.string())])),opacity:H.optional(H.number())}))}),Vwt=H.union([$wt,Fwt]),Owt=H.object({type:H.literal("scatterplot-umap"),title:H.object({name:H.string(),show:H.optional(H.boolean()),position:H.optional(Qv)}),size:H.optional(H.object({width:H.optional(H.number()),height:H.optional(H.number())})),legend:H.optional(H.object({show:H.optional(H.boolean()),position:H.optional(Ng)})),tooltips:H.optional(H.object({show:H.optional(H.boolean()),content:H.optional(H.array(Yn))})),frame:H.optional(H.object({type:H.optional(m4)})),keyColumn:Yn,x:Yn,y:Yn,xAxis:H.optional(u2),yAxis:H.optional(u2),grouping:H.optional(H.array(Yn)),label:H.optional(Yn),highlight:H.optional(Yn),inheritedAes:H.optional(H.record(H.string(),s2)),layers:H.array(Vwt),lassoMode:H.optional(H.boolean())}),Qwt=class{constructor(e){Be(this,"type","dots");Be(this,"aes",{dotFill:$t,dotShape:"21",dotSize:3,opacity:1});this.aes={...this.aes,...e.aes}}},zwt=class{constructor(e){Be(this,"type","curve");Be(this,"smoothing");Be(this,"aes",{lineColor:$t,lineWidth:1,lineShape:"solid",opacity:1});this.smoothing=e.smoothing??!1,this.aes={...this.aes,...e.aes}}},jZ=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;Owt.parse(e),this.id=Zn.uniqueId("settings"),this.keyColumn=e.keyColumn,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 Qwt(i);if(i.type==="curve")return new zwt(i);throw new Error("Unknown layer type")}).filter(Boolean),this.lassoMode=e.lassoMode??!1}};function YZ(e){return typeof e=="object"&&"type"in e&&e.type==="grouping"}function Uwt(e,t,n,r){return t.reduce((a,i)=>{let o=Zn.uniqBy(e.rows,p=>p[i.value]),s=p=>String(p[i.value]),c=p=>i.valueLabels?String(p[i.valueLabels]):s(p),f=new Set;n.forEach(p=>{p.aes&&Object.entries(p.aes).forEach(([v,y])=>{YZ(y)&&y.value===i.value&&f.add(v)})});let A=o.reduce((p,v)=>(p[s(v)]=c(v),p),{});return a[i.value]={values:o.map(s).sort((p,v)=>A[p].localeCompare(A[v],"en",{numeric:!0})),usedAes:[...f],aesMap:r[i.value],labels:A},a},{})}var Gwt=10;function jwt(e){let t=[],n=new Ac("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:Gwt})}return t}var Ywt=class extends Rg{constructor(t,n,r){super(t,n);Be(this,"settings");Be(this,"chartRenderer",new Lwt);Be(this,"onPolygonUpdate",()=>uC);Be(this,"onTooltipHintSwitch",()=>uC);Be(this,"calculatedData",null);this.settings=new jZ(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 jZ(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,keyColumn:r,label:a,highlight:i,grouping:o,layers:s,inheritedAes:c}=this.settings,f={x:!0,y:!0},A={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0},p=s.some(k=>k.type==="curve"),v=new Set,y={},b=this.data.rows.reduce((k,_)=>{if(_[t.value]===null||_[n.value]===null)return k;let P=Number(_[t.value]),N=Number(_[n.value]);f.x&&P!==null&&P<0&&(f.x=!1),f.y&&N!==null&&N<0&&(f.y=!1),P!==null&&P<A.minX&&(A.minX=P),P!==null&&P>A.maxX&&(A.maxX=P),N!==null&&N<A.minY&&(A.minY=N),N!==null&&N>A.maxY&&(A.maxY=N);let I={x:P,y:N,id:String(_[r.value]),dimmed:i?!_[i.value]:!1,label:a&&_[a.value]?String(_[a.value]):null,data:_};if(p){let F=o.map(Q=>_[Q.value]).join("_");v.add(F),y[F]||(y[F]=[]),y[F].push(I)}return k.push(I),k},[]);b.sort((k,_)=>Number(_.dimmed)-Number(k.dimmed));let C=[...v];p&&C.forEach(k=>{y[k].sort((_,P)=>_.x-P.x)});let x=Uwt(this.data,o,s,c);this.calculatedData={onlyPositive:f,dots:b,dotsByGrouping:y,groupingKeys:C,allPossibleLabels:jwt(b),dotsExtents:A,legendLabels:x},this.chartRenderer.updateData(b)}_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])=>{YZ(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)}},Wwt=1e6;function Xwt(e){let t=ER(e),n=Ls(e);return t===void 0||n===void 0||t===0?r=>r:r=>(r-n)/t}function Kwt(e){let t=Ls(e),[n,r]=_p(e);return t===void 0||n===void 0||r===void 0?a=>a:a=>(a-t)/(r-n)}function Zwt(e,t){return e==="standardScaling"?Xwt(t):e==="meanNormalization"?Kwt(t):n=>n}function Jwt(e,t,n,r,a,i,o,s,c){let f=o.map(C=>C.join("_")),A={meta:{facetKeys:f,xKeys:[],yKeys:[],xLabels:{},yLabels:{},facetKeyValues:f.reduce((C,x,k)=>(C[x]=o[k],C),{}),valueExtentSize:[1/0,-1/0],valueExtentColor:[1/0,-1/0]},facets:{}},p=new Set,v=new Set,y=t.valueLabels??t.value,b=n.valueLabels??n.value;if(e.rows.forEach(C=>{let x=i.length?i.map(I=>C[I.value]).join("_"):"null",k=C[t.value],_=C[n.value],P=C[r.value]??c,N=C[a.value]??c;if(!(k===null||_===null||P===null||N===null)){if(A.facets[x]||(A.facets[x]={xKeys:[],yKeys:[],cells:{}}),A.facets[x].xKeys.push(k),A.facets[x].yKeys.push(_),p.has(k)||(p.add(k),A.meta.xKeys.push(k)),v.has(_)||(v.add(_),A.meta.yKeys.push(_)),A.facets[x].cells[k]||(A.facets[x].cells[k]={}),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(N,A.meta.valueExtentColor[0]),A.meta.valueExtentColor[1]=Math.max(N,A.meta.valueExtentColor[1]),A.facets[x].cells[k][_])throw Error(`More than 1 value for x=${k}, y=${_}`);if(A.meta.xLabels[k]&&String(C[y])!==A.meta.xLabels[k])throw Error(`More than 1 x-label value for x=${k}`);if(A.meta.yLabels[_]&&String(C[b])!==A.meta.yLabels[_])throw Error(`More than 1 y-label value for y=${_}`);A.meta.xLabels[k]=String(C[y]),A.meta.yLabels[_]=String(C[b]),A.meta&&(A.facets[x].cells[k][_]={id:`${k}_${_}`,x:k,y:_,sizeValue:P,normalizedSizeValue:P,colorValue:N,normalizedColorValue:N,data:C})}}),A.meta.facetKeys=A.meta.facetKeys.filter(C=>A.facets[C]),A.meta.facetKeys.forEach(C=>{let x=A.facets[C];if(x.xKeys=Zn.uniq(x.xKeys),x.yKeys=Zn.uniq(x.yKeys),x.xKeys.length*x.yKeys.length>Wwt)throw Error(`Too many cells for graph rendering (${x.xKeys.length*x.yKeys.length})`)}),s){let C=[1/0,-1/0];A.meta.facetKeys.forEach(x=>{if(!A.facets[x])return;let{xKeys:k,yKeys:_,cells:P}=A.facets[x],N=s.direction==="row"?k:_,I=s.direction==="row"?_:k,F=s.direction==="row"?(Q,Z)=>{var ee;return(ee=P[Q])==null?void 0:ee[Z]}:(Q,Z)=>{var ee;return(ee=P[Z])==null?void 0:ee[Q]};I.forEach(Q=>{let Z=[];N.forEach(le=>{var U;let z=(U=F(le,Q))==null?void 0:U.colorValue;z!==void 0&&Z.push(z)});let ee=Zwt(s.method,Z);N.forEach(le=>{let z=F(le,Q);z!==void 0&&(z.normalizedColorValue=ee(z.colorValue),C[0]=Math.min(z.normalizedColorValue,C[0]),C[1]=Math.max(z.normalizedColorValue,C[1]))})})}),A.meta.valueExtentColor=C}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 qwt=15,Vg=8,pE=30,eCt=48,tCt=24,hE=16,T2=4,vE=4,WZ=20,nCt=16,f1={left:["axis","axisTitle"],right:["axis","axisTitle"],top:["axis","axisTitle","facetTitle"],bottom:["axis","axisTitle"]};function rCt(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?vE:0,p=t.showTicks?vE:0,v=c&&e.showTitle?pE:0,y=s&&t.showTitle?pE:0,b=c&&e.showAxisLabels&&i>hE?n.xAxisCaptions+A+T2:0,C=s&&t.showAxisLabels&&o>hE?n.yAxisCaptions+p+T2:0;return{left:{axisTitle:t.position==="left"?y:0,axis:t.position==="left"?C:0},right:{axisTitle:t.position==="right"?y:0,axis:t.position==="right"?C:0},top:{facetTitle:f?eCt:0,axisTitle:e.position==="top"?v:0,axis:e.position==="top"?b:0},bottom:{axisTitle:e.position==="bottom"?v:0,axis:e.position==="bottom"?b:0}}}function aCt(e,t,n){return{left:f1.left.reduce((r,a,i)=>{let o=i>0?f1.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:f1.right.reduce((r,a,i)=>{let o=i>0?f1.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:f1.top.reduce((r,a,i)=>{let o=i>0?f1.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:f1.bottom.reduce((r,a,i)=>{let o=i>0?f1.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 iCt(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,y=t.x,b=y>hE,C=a[v[0]];c=Math.max(c,(A&&b?r.getTextWidth(C)*Math.cos(o):0)-y/2)}let p=e.yAxisLabels===45;if(p){let v=n.meta.yKeys;if(v.length){let y=t.y,b=y>hE,C=i[v[v.length-1]];f=Math.max(f,(p&&b?r.getTextWidth(C)*Math.cos(s):0)-y/2)}}return{xCaptionTail:c,yCaptionTail:f}}function oCt({sideElementBBoxes:e,debug:t,xKeys:n,yKeys:r,scales:a,xAxis:i,yAxis:o,stepX:s,stepY:c,labelAngles:f,xLabels:A,yLabels:p}){let v=i.showTicks?vE:0,y=o.showTicks?vE:0,b=e.top.axis.isVisible||e.bottom.axis.isVisible,C=e.top.axisTitle.isVisible?e.top.axisTitle:e.bottom.axisTitle,x=e.top.axis.isVisible?e.top.axis:e.bottom.axis,k=e.left.axis.isVisible||e.right.axis.isVisible,_=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:[C.isVisible&&ie.jsxs("g",{transform:`translate(${C.x},${C.y})`,children:[ie.jsx("text",{x:C.width/2,y:C.height/2,textAnchor:"middle",dominantBaseline:"central",children:i.title}),t&&ie.jsx("rect",{width:C.width,height:C.height,stroke:$t,fill:"none"})]}),b&&ie.jsxs("g",{fontSize:"14px",transform:`translate(${x.x},${x.y})`,children:[n.map(N=>{let I=f.xAxisLabels!==0,F=i.position==="bottom",Q=F?0:x.height,Z=F?Q+v:Q-v,ee=F?Z+T2:Z-T2,le=a.x(N)+s/2,z=-f.xAxisLabels;return ie.jsxs("g",{children:[ie.jsx("line",{x1:le,x2:le,y1:Q,y2:Z,stroke:$t}),ie.jsx("text",{x:le,y:ee,textAnchor:I?F?"end":"start":"middle",transform:`rotate(${z},${le},${ee})`,dominantBaseline:I?"central":F?"hanging":"auto",children:A[N]})]},N)}),t&&ie.jsx("rect",{width:x.width,height:x.height,stroke:$t,fill:"none"})]})]}),ie.jsxs("g",{children:[_.isVisible&&ie.jsx("g",{transform:`translate(
15128
15128
  ${_.x+_.width/2},
15129
15129
  ${_.y+_.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:_.x,y:_.y,width:_.width,height:_.height,stroke:$t,fill:"none"}),k&&ie.jsx("g",{fontSize:"14px",transform:`translate(${P.x},${P.y})`,children:r.map(N=>{let I=f.yAxisLabels!==0,F=o.position==="left",Q=-(90-f.yAxisLabels),Z=f.yAxisLabels===0?"middle":F?"end":"start",ee=I?"central":F?"auto":"hanging",le=F?P.width:0,z=F?le-y:le+y,U=F?z-T2:z+T2,G=a.y(N)+c/2;return ie.jsxs("g",{children:[ie.jsx("line",{x1:le,x2:z,y1:G,y2:G,stroke:$t}),ie.jsx("text",{x:U,y:G,textAnchor:Z,transform:`rotate(${Q},${U},${G})`,dominantBaseline:ee,children:p[N]})]},N)})}),t&&ie.jsx("rect",{x:P.x,y:P.y,height:P.height,width:P.width,stroke:$t,fill:"none"})]})]})}function mE(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 lCt(e,t,n=[]){let r=e.data,a=[`X: ${t.xLabels[e.x]}`,`Y: ${t.yLabels[e.y]}`,`Value (color): ${mE(e.colorValue)}${e.colorValue!==e.normalizedColorValue?` (${mE(e.normalizedColorValue)})`:""}`,`Value (size): ${mE(e.sizeValue)}${e.sizeValue!==e.normalizedSizeValue?` (${mE(e.normalizedSizeValue)})`:""}`];for(let i of n)a.push(`${i.label}: ${r[i.valueLabels??i.value]}`);return a}function sCt({facetKey:e,dimensions:t,scales:n,cells:r,colorScale:a,sizeScale:i,chartSettings:o,cellsMeta:s,stepX:c,stepY:f,aes:A,labelAngles:p,chartSizes:v,margins:y,tooltipsContainer:b,tooltipsData:C}){let[x,k]=tn.useState(),{xAxis:_,yAxis:P,tooltips:N}=o,{width:I,height:F}=t.inner,{padding:Q,sideElementBBoxes:Z}=t,{xLabels:ee,yLabels:le}=s,z=n.x.domain(),U=n.y.domain(),G={left:y.left+t.left+Q.left,right:v.totalWidth-(y.left+t.left+Q.left),top:y.top+t.top+Q.top,bottom:v.totalHeight-(y.top+t.top+Q.top)},Y=!1,X=C.fixed&&x;return ie.jsxs("g",{transform:`translate(${t.left},${t.top})`,fontSize:nCt,children:[ie.jsxs("g",{transform:`translate(${Q.left},${Q.top})`,children:[Z.top.facetTitle.isVisible&&ie.jsx("text",{x:Z.top.facetTitle.x,y:Z.top.facetTitle.y+Z.top.facetTitle.height-tCt,fontWeight:"500",fontSize:"20px",children:s.facetKeyValues[e].join(", ")}),Y,z.map(te=>U.map(he=>{var fe;let ae=(fe=r==null?void 0:r[te])==null?void 0:fe[he],ge=X&&ae&&C.selectedData===ae,me=ae?ie.jsx("circle",{cx:n.x(te)+c/2,cy:n.y(he)+f/2,r:i(ae.normalizedSizeValue),stroke:A.cellStrokeColor,fill:ae.colorValue===null?A.emptyCellColor:a(ae.normalizedColorValue),onMouseOver:()=>C.onMouseOver(ae,e),onMouseLeave:()=>C.onMouseLeave()},ae?ae.id:`${te}_${he}`):null;return ge?uu.createPortal(me,x):me})),ie.jsx("g",{children:o.frame.type==="full"&&ie.jsx("rect",{fill:"none",stroke:$t,x:"0",y:"0",width:I,height:F})}),ie.jsx("g",{fontWeight:"500",children:ie.jsx(oCt,{sideElementBBoxes:Z,xKeys:z,yKeys:U,scales:n,xAxis:_,yAxis:P,stepX:c,stepY:f,labelAngles:p,xLabels:ee,yLabels:le,debug:Y})}),C.fixed&&ie.jsx("rect",{width:v.chartWidth,height:v.chartHeight,fill:"rgba(255,255,255,0.8)"}),ie.jsx("g",{ref:te=>{te&&!x&&k(te)}})]}),o.tooltips.show&&C.selectedData&&C.currentFacet===e&&ie.jsx(cu,{content:lCt(C.selectedData,s,N==null?void 0:N.content),x:n.x(String(C.selectedData.x))+c/2,y:n.y(String(C.selectedData.y))+f/2,offset:z.length>1?c/2:0,active:!0,sideDistances:G,container:b,onClose:C.onClose,fixed:C.fixed})]})}function uCt({margins:e,captionsSizes:t,settingsId:n,chartSettings:r,chartSizes:a,chartsDimensions:i,facetKeys:o,scales:s,colorScale:c,sizeScale:f,groupedCells:A,cellsMeta:p,step:v,legend:y,aes:b,columnsCount:C,labelAngles:x,onTooltipHintSwitch:k}){let _=f2(k),[P,N]=tn.useState(),I=tn.useRef(null);tn.useEffect(()=>{I.current&&N(I.current)},[]);let F=i[o[0]].padding,Q=i[o[C-1]].padding,Z=e.left+a.chartsWidth+WZ,ee=e.top+F.top;return ie.jsx(h2,{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:$g}),ie.jsxs("g",{transform:`translate(${e.left},${e.top})`,children:[ie.jsx(v2,{title:[r.title.name],show:r.title.show,position:r.title.position,leftPadding:F.left,rightPadding:Q.right,chartsWidth:a.chartsWidth}),o.map(le=>{let{cells:z}=A[le];return ie.jsx(sCt,{captionsSizes:t,facetKey:le,dimensions:i[le],scales:s,cells:z,cellsMeta:p,stepX:v.x,stepY:v.y,colorScale:c,sizeScale:f,chartSettings:r,aes:b,labelAngles:x,margins:e,chartSizes:a,tooltipsData:_,tooltipsContainer:P},le)})]}),ie.jsx("g",{transform:`translate(${Z},${ee})`,children:ie.jsx(m2,{legendData:y})}),ie.jsx("g",{ref:I,style:{outline:"none"}})]})})}var cCt=(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 fCt(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])),cCt(t,r)}var dCt=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:Vg,bottom:Vg,left:Vg,right:Vg});Be(this,"captionsSizes",{xAxisCaptions:100,yAxisCaptions:100,xCaptionTail:0,yCaptionTail:0});Be(this,"labelAngles",{xAxisLabels:0,yAxisLabels:0});Be(this,"columnsCount",1);Be(this,"rowsCount",1);Be(this,"scales",{x:zo().domain(["null"]).range([1]),y:zo().domain(["null"]).range([1])});Be(this,"step",{x:10,y:10});Be(this,"colorScale",Zr().domain([0,1]).range(["white","black"]));Be(this,"sizeScale",iv().domain([0,1]).range([3,20]));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=Gh(this.rootNode))}updateMargins(e){this.margins={top:e.show?24+24*2:Vg,bottom:Vg,left:Vg,right:this.legend.width},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=Math.min(Math.max(this.chartSizes.chartHeight,250),350),o=Math.max(this.chartSizes.chartHeight,i),s={width:0,height:0,left:0,top:0},c=this.colorScale.domain(),f=c2(this.colorScale,[c[0],c[c.length-1]]),A=t.label??t.value,p=Zr([f[0],f[f.length-1]],[i,0]);a.push({id:"colorValue",type:"continuous",scale:this.colorScale,tickPositionScale:p,values:f,title:A,...s});let v=n.label??n.value,y=this.sizeScale.ticks(3),b=this.sizeScale.tickFormat(3),C=y.reduce((N,I)=>(N[String(I)]=b(I),N),{});if(a.push({id:"sizeValue",type:"size",title:v,scale:this.sizeScale,values:y,labels:C,...s}),!a.length){this.legend={width:0,height:0,items:[]};return}let x=y2(a,o,i),k=x[x.length-1],_=k.left+k.width+2*WZ,P=this.chartsDimensions[r[0]].padding;this.legend={width:_,height:o+P.top,items:x}}updateCaptionsSize(e,t,n){let r=new Ac("bold 14px Arial"),{xKeys:a,yKeys:i,xLabels:o,yLabels:s}=e.meta;this.labelAngles={xAxisLabels:t.axisLabelsAngle,yAxisLabels:n.axisLabelsAngle};let c=0,f=0;for(let b of a){let C=r.getTextWidth(o[b]);C>c&&(c=C)}for(let b of i){let C=r.getTextWidth(s[b]);C>f&&(f=C)}let{xCaptionTail:A,yCaptionTail:p}=iCt(this.labelAngles,this.step,e,r),v=this.labelAngles.xAxisLabels/180*Math.PI,y=this.labelAngles.yAxisLabels/180*Math.PI;this.captionsSizes={xCaptionTail:A,yCaptionTail:p,xAxisCaptions:c*Math.sin(v)||pE,yAxisCaptions:f*Math.sin(y)||pE}}updateChartDimensions(e,t,n,r){let a=e.length,i=Math.min(t.nRows??a,a),o=Math.min(t.nCols??a,a);this.columnsCount=t.nRows?Math.ceil(a/i):o,this.rowsCount=Math.ceil(a/this.columnsCount),this.chartsDimensions={};let s=0,c=0;e.forEach((p,v)=>{let y=v%this.columnsCount+1,b=rZ(v,e.length,this.columnsCount,this.rowsCount),C=this.chartSizes.chartWidth,x=this.chartSizes.chartHeight,k=rCt(n,r,this.captionsSizes,b,e,this.step.x,this.step.y);function _(Q){return Math.max(f1[Q].reduce((Z,ee)=>Z+k[Q][ee],0),qwt)}let P={left:_("left"),right:_("right"),top:_("top"),bottom:_("bottom")};P.left<this.captionsSizes.xCaptionTail&&(P.left=this.captionsSizes.xCaptionTail),P.bottom<this.captionsSizes.yCaptionTail&&(P.bottom=this.captionsSizes.yCaptionTail);let N=aCt(k,C,x),I=C+P.left+P.right,F=x+P.top+P.bottom;this.chartsDimensions[p]={left:s,top:c,inner:{width:C,height:x},outer:{width:I,height:F},padding:P,sideElementBBoxes:N,chartEdgeSides:b},s+=I,y===this.columnsCount&&(s=0,c+=F)});let f=e.slice(0,this.columnsCount).reduce((p,v)=>p+this.chartsDimensions[v].outer.width,0),A=e.filter((p,v)=>v%this.columnsCount===0).reduce((p,v)=>p+this.chartsDimensions[v].outer.height,0);this.chartSizes.chartsWidth=f,this.chartSizes.chartsHeight=A}updateChartsSizes(e,t){let{width:n,height:r,cellSize:a}=t;a&&(this.chartSizes.chartWidth=e.meta.xKeys.length*a,this.chartSizes.chartHeight=e.meta.yKeys.length*a),n&&r&&(this.chartSizes.chartWidth=n,this.chartSizes.chartHeight=r)}updateScales(e,t,n,r){let{width:a,height:i,cellSize:o}=t,{meta:s}=e,c=(b,C={})=>[...b].sort((x,k)=>n.sorting==="asc"?(C[x]??x).localeCompare(C[k]??k,"en",{numeric:!0}):(C[k]??k).localeCompare(C[x]??x,"en",{numeric:!0})),f=(b,C={})=>[...b].sort((x,k)=>r.sorting==="asc"?(C[x]??x).localeCompare(C[k]??k,"en",{numeric:!0}):(C[k]??k).localeCompare(C[x]??x,"en",{numeric:!0})),A=c(s.xKeys,s.xLabels),p=f(s.yKeys,s.yLabels);o?(this.step.x=o,this.step.y=o):a&&i&&(this.step.x=a/A.length,this.step.y=i/p.length);let v=new Array(A.length).fill(null).map((b,C)=>C*this.step.x),y=new Array(p.length).fill(null).map((b,C)=>C*this.step.y);this.scales.x=zo().domain(A).range(v),this.scales.y=zo().domain(p).range(y)}updateAesScale(e,t,n,r){this.colorScale=Zr().domain(fCt(r,e.colorsList.length,n)).range(e.colorsList),this.sizeScale=iv(t,[e.minRadius,e.maxRadius])}render(e,t,n,r,a,i,o,s,c,f){var P;let{meta:A,facets:p}=a,{valueExtentSize:v,valueExtentColor:y}=A,{xAxis:b,yAxis:C,title:x,size:k}=t;this.updateChartsSizes(a,k),this.updateAesScale(c,v,y,s),this.updateScales(a,k,t.xAxis,t.yAxis),this.updateCaptionsSize(a,b,C),this.updateChartDimensions(r,n,b,C),this.updateLegendSize(t.legend,i,o,r),this.updateMargins(x);let _=ie.jsx(uCt,{aes:c,captionsSizes:this.captionsSizes,cellsMeta:A,columnsCount:this.columnsCount,chartsDimensions:this.chartsDimensions,chartSettings:t,chartSizes:this.chartSizes,sizeScale:this.sizeScale,colorScale:this.colorScale,facetKeys:r,facetSettings:n,groupedCells:p,labelAngles:this.labelAngles,legend:this.legend,margins:this.margins,scales:this.scales,settingsId:e,step:this.step,onTooltipHintSwitch:f});this.component=_,(P=this.reactRoot)==null||P.render(_)}renderError(e){var t;(t=this.reactRoot)==null||t.render(ie.jsx(zv,{message:e}))}},ACt=dCt,XZ=class{constructor(e){Be(this,"id");Be(this,"type","bubble");Be(this,"facetSettings");Be(this,"valueColumnSize");Be(this,"valueColumnColor");Be(this,"xColumn");Be(this,"yColumn");Be(this,"facetBy");Be(this,"normalization");Be(this,"NAValueAs");Be(this,"chartSettings");Be(this,"aes");var a,i,o,s,c,f,A,p,v,y;I2t.parse(e),this.id=Zn.uniqueId("settings"),this.facetSettings={titlePosition:"left",...e.facetSettings},this.facetBy=e.facetBy??[],this.valueColumnSize=e.valueSize,this.valueColumnColor=e.valueColor,this.xColumn=e.xColumn,this.yColumn=e.yColumn,this.NAValueAs=e.NAValueAs??null,this.normalization=e.normalization??null;let t=((a=e.size)==null?void 0:a.cellSize)??null,n=t?null:((i=e==null?void 0:e.size)==null?void 0:i.width)??(this.facetBy.length?400:600),r=t?null:((o=e==null?void 0:e.size)==null?void 0:o.height)??(this.facetBy.length?250:350);this.chartSettings={size:{width:n,height:r,cellSize:t},title:{position:"center",show:!0,...e.title,name:((s=e.title)==null?void 0:s.name)??"Chart"},yAxis:{title:e.yColumn.label??e.yColumn.value,showTicks:!0,showTitle:!0,showAxisLabels:!0,position:"left",axisLabelsAngle:90,sorting:"asc",...e.yAxis},xAxis:{title:e.xColumn.label??e.xColumn.value,showTicks:!0,showTitle:!0,showAxisLabels:!0,position:"bottom",axisLabelsAngle:90,sorting:"asc",...e.xAxis},frame:{type:((c=e.frame)==null?void 0:c.type)??"full"},legend:{show:!0,position:"right",...e.legend},tooltips:{show:!0,...e.tooltips}},this.aes={minRadius:((f=e.aes)==null?void 0:f.minRadius)??3,maxRadius:((A=e.aes)==null?void 0:A.maxRadius)??20,colorsList:((p=e.aes)==null?void 0:p.colorsList)??["black","white","red"],cellStrokeColor:((v=e.aes)==null?void 0:v.cellStrokeColor)??$t,emptyCellColor:((y=e.aes)==null?void 0:y.emptyCellColor)??"white"}}},pCt=class extends Rg{constructor(t,n,r){super(t,n);Be(this,"settings");Be(this,"chartRenderer",new ACt);Be(this,"onTooltipHintSwitch",()=>{});Be(this,"calculatedData",null);this.settings=new XZ(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 XZ(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 bubble chart")}export(){return this._updateChart(),my(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)})||((r=t.normalization)==null?void 0:r.method)!==((a=n.normalization)==null?void 0:a.method)||((i=t.normalization)==null?void 0:i.direction)!==((o=n.normalization)==null?void 0:o.direction)||t.xColumn.value!==n.xColumn.value||t.yColumn.value!==n.yColumn.value||t.valueColumnColor.value!==n.valueColumnColor.value||t.valueColumnSize.value!==n.valueColumnSize.value||t.NAValueAs!==n.NAValueAs}_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{facetBy:t,xColumn:n,yColumn:r,valueColumnSize:a,valueColumnColor:i,normalization:o,NAValueAs:s}=this.settings,c=t.map(v=>this.data.getColumnCategories(v.value)),f=c.length?bZ([...c]):[["null"]],A=t.map(v=>v.value)??null;this.data.setGrouping([...A]);let p=Jwt(this.data,n,r,a,i,t,f,o,s);this.calculatedData={facetKeys:p.meta.facetKeys,groupedCellsData:p}}_updateAesInData(){this.calculatedData}_updateChart(){if(!this.calculatedData)return;let{id:t,chartSettings:n,facetSettings:r,valueColumnColor:a,valueColumnSize:i,normalization:o,aes:s}=this.settings;this.chartRenderer.render(t,n,r,this.calculatedData.facetKeys,this.calculatedData.groupedCellsData,a,i,o,s,this.onTooltipHintSwitch)}};function hCt(e){return"type"in e&&e.type==="columns"}var KZ=class OI{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 OI)return t;if(hCt(t))return new OI(t.id,t.values);uA(t,"Unknown input data format")}get rows(){let t=this.columnNames,n=[];for(let r=0;r<this.rowsCount;r++)n.push(t.reduce((a,i)=>(a[i]=this.data[i][r],a),{}));return n}getColumn(t){return this.data[t]}getColumnCategories(t){if(!this.columnNames.includes(t))throw new Error(`Column ${t} does not exist`);return Zn.uniq(this.getColumn(t)).map(String)}setGrouping(t){let n={grouped:{},rows:this.rows},r=[n];t.forEach(a=>{let i=a===null?["null"]:this.getColumnCategories(a),o=[];r.forEach(s=>{if(a===null)s.grouped={null:{rows:s.rows,grouped:{}}},o.push(s.grouped.null);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??"null"];if(!a)return[];n=a}),n==null?void 0:n.rows}},vCt=class QI{constructor(t){Be(this,"node");Be(this,"chart");this.chart=t}static createChart(t,n,r){let{type:a}=n;if(a==="discrete")return new v9t(t,n,r);if(a==="dendro")return new f7t(t,n,r);if(a==="scatterplot")return new mwt(t,n,r);if(a==="scatterplot-umap")return new Ywt(t,n,r);if(a==="heatmap")return new q9t(t,n,r);if(a==="histogram")return new k4t(t,n,r);if(a==="bubble")return new pCt(t,n,r);uA(a,`Unknown chart type: ${a}`)}static newPlot(t,n,r){let a=KZ.from(t);return new this(QI.createChart(a,n,r))}get calculatedData(){return this.chart.calculatedData}mount(t){this.node=t,this.chart.mount(t)}unmount(){delete this.node,this.chart.unmount()}updateSettingsAndData(t,n){if(n.type!==this.chart.settings.type){let r=QI.createChart(this.chart.data,n);this.node?(this.chart.unmount(),this.chart=r,this.chart.mount(this.node)):this.chart=r}else this.chart.updateSettingsAndData(KZ.from(t),n)}updateChartState(t,n){this.chart.updateChartState(t,n)}export(){return this.chart.export()}};/*! Bundled license information:
15130
15130