@blueprint-chart/editor 0.1.23 → 0.1.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{CopyRedirect-MgJl1fAm.js → CopyRedirect-e-Xlyr0G.js} +1 -1
- package/dist/assets/{LandingPage-ZAReVK0Y.js → LandingPage-DPFEpXc-.js} +1 -1
- package/dist/assets/index-Bd6o-NHJ.js +859 -0
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/index-Dw1EfjOY.js +0 -859
|
@@ -0,0 +1,859 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LandingPage-DPFEpXc-.js","assets/LandingPage-Cg1ziJWU.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
var s9=Object.defineProperty;var a9=(t,e,n)=>e in t?s9(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var bn=(t,e,n)=>a9(t,typeof e!="symbol"?e+"":e,n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&o(s)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();/**
|
|
3
|
+
* @vue/shared v3.5.29
|
|
4
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
5
|
+
* @license MIT
|
|
6
|
+
**/function Yb(t){const e=Object.create(null);for(const n of t.split(","))e[n]=1;return n=>n in e}const Wt={},Oc=[],fi=()=>{},hS=()=>!1,V0=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),jb=t=>t.startsWith("onUpdate:"),Vn=Object.assign,Xb=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},l9=Object.prototype.hasOwnProperty,Kt=(t,e)=>l9.call(t,e),ut=Array.isArray,Bc=t=>wf(t)==="[object Map]",vu=t=>wf(t)==="[object Set]",Ux=t=>wf(t)==="[object Date]",vt=t=>typeof t=="function",vn=t=>typeof t=="string",bi=t=>typeof t=="symbol",jt=t=>t!==null&&typeof t=="object",pS=t=>(jt(t)||vt(t))&&vt(t.then)&&vt(t.catch),mS=Object.prototype.toString,wf=t=>mS.call(t),c9=t=>wf(t).slice(8,-1),gS=t=>wf(t)==="[object Object]",z0=t=>vn(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,md=Yb(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),H0=t=>{const e=Object.create(null);return(n=>e[n]||(e[n]=t(n)))},u9=/-\w/g,Sr=H0(t=>t.replace(u9,e=>e.slice(1).toUpperCase())),d9=/\B([A-Z])/g,Zs=H0(t=>t.replace(d9,"-$1").toLowerCase()),W0=H0(t=>t.charAt(0).toUpperCase()+t.slice(1)),Tg=H0(t=>t?`on${W0(t)}`:""),er=(t,e)=>!Object.is(t,e),Uh=(t,...e)=>{for(let n=0;n<t.length;n++)t[n](...e)},vS=(t,e,n,o=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:o,value:n})},U0=t=>{const e=parseFloat(t);return isNaN(e)?t:e},f9=t=>{const e=vn(t)?Number(t):NaN;return isNaN(e)?t:e};let Gx;const G0=()=>Gx||(Gx=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Pt(t){if(ut(t)){const e={};for(let n=0;n<t.length;n++){const o=t[n],r=vn(o)?g9(o):Pt(o);if(r)for(const i in r)e[i]=r[i]}return e}else if(vn(t)||jt(t))return t}const h9=/;(?![^(]*\))/g,p9=/:([^]+)/,m9=/\/\*[^]*?\*\//g;function g9(t){const e={};return t.replace(m9,"").split(h9).forEach(n=>{if(n){const o=n.split(p9);o.length>1&&(e[o[0].trim()]=o[1].trim())}}),e}function Te(t){let e="";if(vn(t))e=t;else if(ut(t))for(let n=0;n<t.length;n++){const o=Te(t[n]);o&&(e+=o+" ")}else if(jt(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}function Wn(t){if(!t)return null;let{class:e,style:n}=t;return e&&!vn(e)&&(t.class=Te(e)),n&&(t.style=Pt(n)),t}const v9="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",b9=Yb(v9);function bS(t){return!!t||t===""}function y9(t,e){if(t.length!==e.length)return!1;let n=!0;for(let o=0;n&&o<t.length;o++)n=Ta(t[o],e[o]);return n}function Ta(t,e){if(t===e)return!0;let n=Ux(t),o=Ux(e);if(n||o)return n&&o?t.getTime()===e.getTime():!1;if(n=bi(t),o=bi(e),n||o)return t===e;if(n=ut(t),o=ut(e),n||o)return n&&o?y9(t,e):!1;if(n=jt(t),o=jt(e),n||o){if(!n||!o)return!1;const r=Object.keys(t).length,i=Object.keys(e).length;if(r!==i)return!1;for(const s in t){const a=t.hasOwnProperty(s),l=e.hasOwnProperty(s);if(a&&!l||!a&&l||!Ta(t[s],e[s]))return!1}}return String(t)===String(e)}function Kb(t,e){return t.findIndex(n=>Ta(n,e))}const yS=t=>!!(t&&t.__v_isRef===!0),be=t=>vn(t)?t:t==null?"":ut(t)||jt(t)&&(t.toString===mS||!vt(t.toString))?yS(t)?be(t.value):JSON.stringify(t,xS,2):String(t),xS=(t,e)=>yS(e)?xS(t,e.value):Bc(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[o,r],i)=>(n[Mg(o,i)+" =>"]=r,n),{})}:vu(e)?{[`Set(${e.size})`]:[...e.values()].map(n=>Mg(n))}:bi(e)?Mg(e):jt(e)&&!ut(e)&&!gS(e)?String(e):e,Mg=(t,e="")=>{var n;return bi(t)?`Symbol(${(n=t.description)!=null?n:e})`:t};function x9(t){return t==null?"initial":typeof t=="string"?t===""?" ":t:String(t)}/**
|
|
7
|
+
* @vue/reactivity v3.5.29
|
|
8
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
9
|
+
* @license MIT
|
|
10
|
+
**/let go;class wS{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=go,!e&&go&&(this.index=(go.scopes||(go.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].pause();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].resume();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].resume()}}run(e){if(this._active){const n=go;try{return go=this,e()}finally{go=n}}}on(){++this._on===1&&(this.prevScope=go,go=this)}off(){this._on>0&&--this._on===0&&(go=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let n,o;for(n=0,o=this.effects.length;n<o;n++)this.effects[n].stop();for(this.effects.length=0,n=0,o=this.cleanups.length;n<o;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,o=this.scopes.length;n<o;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0}}}function q0(t){return new wS(t)}function ql(){return go}function Ma(t,e=!1){go&&go.cleanups.push(t)}let cn;const Og=new WeakSet;class _S{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,go&&go.active&&go.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Og.has(this)&&(Og.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||SS(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,qx(this),AS(this);const e=cn,n=hi;cn=this,hi=!0;try{return this.fn()}finally{CS(this),cn=e,hi=n,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Jb(e);this.deps=this.depsTail=void 0,qx(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Og.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Zv(this)&&this.run()}get dirty(){return Zv(this)}}let kS=0,gd,vd;function SS(t,e=!1){if(t.flags|=8,e){t.next=vd,vd=t;return}t.next=gd,gd=t}function Zb(){kS++}function Qb(){if(--kS>0)return;if(vd){let e=vd;for(vd=void 0;e;){const n=e.next;e.next=void 0,e.flags&=-9,e=n}}let t;for(;gd;){let e=gd;for(gd=void 0;e;){const n=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(o){t||(t=o)}e=n}}if(t)throw t}function AS(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function CS(t){let e,n=t.depsTail,o=n;for(;o;){const r=o.prevDep;o.version===-1?(o===n&&(n=r),Jb(o),w9(o)):e=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=r}t.deps=e,t.depsTail=n}function Zv(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&($S(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function $S(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===Nd)||(t.globalVersion=Nd,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!Zv(t))))return;t.flags|=2;const e=t.dep,n=cn,o=hi;cn=t,hi=!0;try{AS(t);const r=t.fn(t._value);(e.version===0||er(r,t._value))&&(t.flags|=128,t._value=r,e.version++)}catch(r){throw e.version++,r}finally{cn=n,hi=o,CS(t),t.flags&=-3}}function Jb(t,e=!1){const{dep:n,prevSub:o,nextSub:r}=t;if(o&&(o.nextSub=r,t.prevSub=void 0),r&&(r.prevSub=o,t.nextSub=void 0),n.subs===t&&(n.subs=o,!o&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)Jb(i,!0)}!e&&!--n.sc&&n.map&&n.map.delete(n.key)}function w9(t){const{prevDep:e,nextDep:n}=t;e&&(e.nextDep=n,t.prevDep=void 0),n&&(n.prevDep=e,t.nextDep=void 0)}let hi=!0;const TS=[];function Ws(){TS.push(hi),hi=!1}function Us(){const t=TS.pop();hi=t===void 0?!0:t}function qx(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const n=cn;cn=void 0;try{e()}finally{cn=n}}}let Nd=0;class _9{constructor(e,n){this.sub=e,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Y0{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!cn||!hi||cn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==cn)n=this.activeLink=new _9(cn,this),cn.deps?(n.prevDep=cn.depsTail,cn.depsTail.nextDep=n,cn.depsTail=n):cn.deps=cn.depsTail=n,MS(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const o=n.nextDep;o.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=o),n.prevDep=cn.depsTail,n.nextDep=void 0,cn.depsTail.nextDep=n,cn.depsTail=n,cn.deps===n&&(cn.deps=o)}return n}trigger(e){this.version++,Nd++,this.notify(e)}notify(e){Zb();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Qb()}}}function MS(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let o=e.deps;o;o=o.nextDep)MS(o)}const n=t.dep.subs;n!==t&&(t.prevSub=n,n&&(n.nextSub=t)),t.dep.subs=t}}const hp=new WeakMap,kl=Symbol(""),Qv=Symbol(""),Rd=Symbol("");function yo(t,e,n){if(hi&&cn){let o=hp.get(t);o||hp.set(t,o=new Map);let r=o.get(n);r||(o.set(n,r=new Y0),r.map=o,r.key=n),r.track()}}function Ms(t,e,n,o,r,i){const s=hp.get(t);if(!s){Nd++;return}const a=l=>{l&&l.trigger()};if(Zb(),e==="clear")s.forEach(a);else{const l=ut(t),c=l&&z0(n);if(l&&n==="length"){const u=Number(o);s.forEach((d,f)=>{(f==="length"||f===Rd||!bi(f)&&f>=u)&&a(d)})}else switch((n!==void 0||s.has(void 0))&&a(s.get(n)),c&&a(s.get(Rd)),e){case"add":l?c&&a(s.get("length")):(a(s.get(kl)),Bc(t)&&a(s.get(Qv)));break;case"delete":l||(a(s.get(kl)),Bc(t)&&a(s.get(Qv)));break;case"set":Bc(t)&&a(s.get(kl));break}}Qb()}function k9(t,e){const n=hp.get(t);return n&&n.get(e)}function cc(t){const e=Bt(t);return e===t?e:(yo(e,"iterate",Rd),wr(t)?e:e.map(yi))}function j0(t){return yo(t=Bt(t),"iterate",Rd),t}function pa(t,e){return Gs(t)?Gc(Ji(t)?yi(e):e):yi(e)}const S9={__proto__:null,[Symbol.iterator](){return Bg(this,Symbol.iterator,t=>pa(this,t))},concat(...t){return cc(this).concat(...t.map(e=>ut(e)?cc(e):e))},entries(){return Bg(this,"entries",t=>(t[1]=pa(this,t[1]),t))},every(t,e){return ms(this,"every",t,e,void 0,arguments)},filter(t,e){return ms(this,"filter",t,e,n=>n.map(o=>pa(this,o)),arguments)},find(t,e){return ms(this,"find",t,e,n=>pa(this,n),arguments)},findIndex(t,e){return ms(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return ms(this,"findLast",t,e,n=>pa(this,n),arguments)},findLastIndex(t,e){return ms(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return ms(this,"forEach",t,e,void 0,arguments)},includes(...t){return Lg(this,"includes",t)},indexOf(...t){return Lg(this,"indexOf",t)},join(t){return cc(this).join(t)},lastIndexOf(...t){return Lg(this,"lastIndexOf",t)},map(t,e){return ms(this,"map",t,e,void 0,arguments)},pop(){return Ru(this,"pop")},push(...t){return Ru(this,"push",t)},reduce(t,...e){return Yx(this,"reduce",t,e)},reduceRight(t,...e){return Yx(this,"reduceRight",t,e)},shift(){return Ru(this,"shift")},some(t,e){return ms(this,"some",t,e,void 0,arguments)},splice(...t){return Ru(this,"splice",t)},toReversed(){return cc(this).toReversed()},toSorted(t){return cc(this).toSorted(t)},toSpliced(...t){return cc(this).toSpliced(...t)},unshift(...t){return Ru(this,"unshift",t)},values(){return Bg(this,"values",t=>pa(this,t))}};function Bg(t,e,n){const o=j0(t),r=o[e]();return o!==t&&!wr(t)&&(r._next=r.next,r.next=()=>{const i=r._next();return i.done||(i.value=n(i.value)),i}),r}const A9=Array.prototype;function ms(t,e,n,o,r,i){const s=j0(t),a=s!==t&&!wr(t),l=s[e];if(l!==A9[e]){const d=l.apply(t,i);return a?yi(d):d}let c=n;s!==t&&(a?c=function(d,f){return n.call(this,pa(t,d),f,t)}:n.length>2&&(c=function(d,f){return n.call(this,d,f,t)}));const u=l.call(s,c,o);return a&&r?r(u):u}function Yx(t,e,n,o){const r=j0(t);let i=n;return r!==t&&(wr(t)?n.length>3&&(i=function(s,a,l){return n.call(this,s,a,l,t)}):i=function(s,a,l){return n.call(this,s,pa(t,a),l,t)}),r[e](i,...o)}function Lg(t,e,n){const o=Bt(t);yo(o,"iterate",Rd);const r=o[e](...n);return(r===-1||r===!1)&&Z0(n[0])?(n[0]=Bt(n[0]),o[e](...n)):r}function Ru(t,e,n=[]){Ws(),Zb();const o=Bt(t)[e].apply(t,n);return Qb(),Us(),o}const C9=Yb("__proto__,__v_isRef,__isVue"),OS=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(bi));function $9(t){bi(t)||(t=String(t));const e=Bt(this);return yo(e,"has",t),e.hasOwnProperty(t)}class BS{constructor(e=!1,n=!1){this._isReadonly=e,this._isShallow=n}get(e,n,o){if(n==="__v_skip")return e.__v_skip;const r=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return i;if(n==="__v_raw")return o===(r?i?NS:IS:i?ES:DS).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(o)?e:void 0;const s=ut(e);if(!r){let l;if(s&&(l=S9[n]))return l;if(n==="hasOwnProperty")return $9}const a=Reflect.get(e,n,Xe(e)?e:o);if((bi(n)?OS.has(n):C9(n))||(r||yo(e,"get",n),i))return a;if(Xe(a)){const l=s&&z0(n)?a:a.value;return r&&jt(l)?so(l):l}return jt(a)?r?so(a):lr(a):a}}class LS extends BS{constructor(e=!1){super(!1,e)}set(e,n,o,r){let i=e[n];const s=ut(e)&&z0(n);if(!this._isShallow){const c=Gs(i);if(!wr(o)&&!Gs(o)&&(i=Bt(i),o=Bt(o)),!s&&Xe(i)&&!Xe(o))return c||(i.value=o),!0}const a=s?Number(n)<e.length:Kt(e,n),l=Reflect.set(e,n,o,Xe(e)?e:r);return e===Bt(r)&&(a?er(o,i)&&Ms(e,"set",n,o):Ms(e,"add",n,o)),l}deleteProperty(e,n){const o=Kt(e,n);e[n];const r=Reflect.deleteProperty(e,n);return r&&o&&Ms(e,"delete",n,void 0),r}has(e,n){const o=Reflect.has(e,n);return(!bi(n)||!OS.has(n))&&yo(e,"has",n),o}ownKeys(e){return yo(e,"iterate",ut(e)?"length":kl),Reflect.ownKeys(e)}}class PS extends BS{constructor(e=!1){super(!0,e)}set(e,n){return!0}deleteProperty(e,n){return!0}}const T9=new LS,M9=new PS,O9=new LS(!0),B9=new PS(!0),Jv=t=>t,Xf=t=>Reflect.getPrototypeOf(t);function L9(t,e,n){return function(...o){const r=this.__v_raw,i=Bt(r),s=Bc(i),a=t==="entries"||t===Symbol.iterator&&s,l=t==="keys"&&s,c=r[t](...o),u=n?Jv:e?Gc:yi;return!e&&yo(i,"iterate",l?Qv:kl),Vn(Object.create(c),{next(){const{value:d,done:f}=c.next();return f?{value:d,done:f}:{value:a?[u(d[0]),u(d[1])]:u(d),done:f}}})}}function Kf(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function P9(t,e){const n={get(r){const i=this.__v_raw,s=Bt(i),a=Bt(r);t||(er(r,a)&&yo(s,"get",r),yo(s,"get",a));const{has:l}=Xf(s),c=e?Jv:t?Gc:yi;if(l.call(s,r))return c(i.get(r));if(l.call(s,a))return c(i.get(a));i!==s&&i.get(r)},get size(){const r=this.__v_raw;return!t&&yo(Bt(r),"iterate",kl),r.size},has(r){const i=this.__v_raw,s=Bt(i),a=Bt(r);return t||(er(r,a)&&yo(s,"has",r),yo(s,"has",a)),r===a?i.has(r):i.has(r)||i.has(a)},forEach(r,i){const s=this,a=s.__v_raw,l=Bt(a),c=e?Jv:t?Gc:yi;return!t&&yo(l,"iterate",kl),a.forEach((u,d)=>r.call(i,c(u),c(d),s))}};return Vn(n,t?{add:Kf("add"),set:Kf("set"),delete:Kf("delete"),clear:Kf("clear")}:{add(r){!e&&!wr(r)&&!Gs(r)&&(r=Bt(r));const i=Bt(this);return Xf(i).has.call(i,r)||(i.add(r),Ms(i,"add",r,r)),this},set(r,i){!e&&!wr(i)&&!Gs(i)&&(i=Bt(i));const s=Bt(this),{has:a,get:l}=Xf(s);let c=a.call(s,r);c||(r=Bt(r),c=a.call(s,r));const u=l.call(s,r);return s.set(r,i),c?er(i,u)&&Ms(s,"set",r,i):Ms(s,"add",r,i),this},delete(r){const i=Bt(this),{has:s,get:a}=Xf(i);let l=s.call(i,r);l||(r=Bt(r),l=s.call(i,r)),a&&a.call(i,r);const c=i.delete(r);return l&&Ms(i,"delete",r,void 0),c},clear(){const r=Bt(this),i=r.size!==0,s=r.clear();return i&&Ms(r,"clear",void 0,void 0),s}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=L9(r,t,e)}),n}function X0(t,e){const n=P9(t,e);return(o,r,i)=>r==="__v_isReactive"?!t:r==="__v_isReadonly"?t:r==="__v_raw"?o:Reflect.get(Kt(n,r)&&r in o?n:o,r,i)}const D9={get:X0(!1,!1)},E9={get:X0(!1,!0)},I9={get:X0(!0,!1)},N9={get:X0(!0,!0)},DS=new WeakMap,ES=new WeakMap,IS=new WeakMap,NS=new WeakMap;function R9(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function F9(t){return t.__v_skip||!Object.isExtensible(t)?0:R9(c9(t))}function lr(t){return Gs(t)?t:K0(t,!1,T9,D9,DS)}function RS(t){return K0(t,!1,O9,E9,ES)}function so(t){return K0(t,!0,M9,I9,IS)}function dl(t){return K0(t,!0,B9,N9,NS)}function K0(t,e,n,o,r){if(!jt(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const i=F9(t);if(i===0)return t;const s=r.get(t);if(s)return s;const a=new Proxy(t,i===2?o:n);return r.set(t,a),a}function Ji(t){return Gs(t)?Ji(t.__v_raw):!!(t&&t.__v_isReactive)}function Gs(t){return!!(t&&t.__v_isReadonly)}function wr(t){return!!(t&&t.__v_isShallow)}function Z0(t){return t?!!t.__v_raw:!1}function Bt(t){const e=t&&t.__v_raw;return e?Bt(e):t}function Me(t){return!Kt(t,"__v_skip")&&Object.isExtensible(t)&&vS(t,"__v_skip",!0),t}const yi=t=>jt(t)?lr(t):t,Gc=t=>jt(t)?so(t):t;function Xe(t){return t?t.__v_isRef===!0:!1}function ze(t){return FS(t,!1)}function Re(t){return FS(t,!0)}function FS(t,e){return Xe(t)?t:new V9(t,e)}class V9{constructor(e,n){this.dep=new Y0,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?e:Bt(e),this._value=n?e:yi(e),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(e){const n=this._rawValue,o=this.__v_isShallow||wr(e)||Gs(e);e=o?e:Bt(e),er(e,n)&&(this._rawValue=e,this._value=o?e:yi(e),this.dep.trigger())}}function p(t){return Xe(t)?t.value:t}function bt(t){return vt(t)?t():p(t)}const z9={get:(t,e,n)=>e==="__v_raw"?t:p(Reflect.get(t,e,n)),set:(t,e,n,o)=>{const r=t[e];return Xe(r)&&!Xe(n)?(r.value=n,!0):Reflect.set(t,e,n,o)}};function VS(t){return Ji(t)?t:new Proxy(t,z9)}class H9{constructor(e){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new Y0,{get:o,set:r}=e(n.track.bind(n),n.trigger.bind(n));this._get=o,this._set=r}get value(){return this._value=this._get()}set value(e){this._set(e)}}function zS(t){return new H9(t)}function Q0(t){const e=ut(t)?new Array(t.length):{};for(const n in t)e[n]=HS(t,n);return e}class W9{constructor(e,n,o){this._object=e,this._key=n,this._defaultValue=o,this.__v_isRef=!0,this._value=void 0,this._raw=Bt(e);let r=!0,i=e;if(!ut(e)||!z0(String(n)))do r=!Z0(i)||wr(i);while(r&&(i=i.__v_raw));this._shallow=r}get value(){let e=this._object[this._key];return this._shallow&&(e=p(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&Xe(this._raw[this._key])){const n=this._object[this._key];if(Xe(n)){n.value=e;return}}this._object[this._key]=e}get dep(){return k9(this._raw,this._key)}}class U9{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function zt(t,e,n){return Xe(t)?t:vt(t)?new U9(t):jt(t)&&arguments.length>1?HS(t,e,n):ze(t)}function HS(t,e,n){return new W9(t,e,n)}class G9{constructor(e,n,o){this.fn=e,this.setter=n,this._value=void 0,this.dep=new Y0(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Nd-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=o}notify(){if(this.flags|=16,!(this.flags&8)&&cn!==this)return SS(this,!0),!0}get value(){const e=this.dep.track();return $S(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function q9(t,e,n=!1){let o,r;return vt(t)?o=t:(o=t.get,r=t.set),new G9(o,r,n)}const Zf={},pp=new WeakMap;let fl;function Y9(t,e=!1,n=fl){if(n){let o=pp.get(n);o||pp.set(n,o=[]),o.push(t)}}function j9(t,e,n=Wt){const{immediate:o,deep:r,once:i,scheduler:s,augmentJob:a,call:l}=n,c=_=>r?_:wr(_)||r===!1||r===0?Os(_,1):Os(_);let u,d,f,h,g=!1,v=!1;if(Xe(t)?(d=()=>t.value,g=wr(t)):Ji(t)?(d=()=>c(t),g=!0):ut(t)?(v=!0,g=t.some(_=>Ji(_)||wr(_)),d=()=>t.map(_=>{if(Xe(_))return _.value;if(Ji(_))return c(_);if(vt(_))return l?l(_,2):_()})):vt(t)?e?d=l?()=>l(t,2):t:d=()=>{if(f){Ws();try{f()}finally{Us()}}const _=fl;fl=u;try{return l?l(t,3,[h]):t(h)}finally{fl=_}}:d=fi,e&&r){const _=d,k=r===!0?1/0:r;d=()=>Os(_(),k)}const m=ql(),b=()=>{u.stop(),m&&m.active&&Xb(m.effects,u)};if(i&&e){const _=e;e=(...k)=>{_(...k),b()}}let y=v?new Array(t.length).fill(Zf):Zf;const x=_=>{if(!(!(u.flags&1)||!u.dirty&&!_))if(e){const k=u.run();if(r||g||(v?k.some((E,L)=>er(E,y[L])):er(k,y))){f&&f();const E=fl;fl=u;try{const L=[k,y===Zf?void 0:v&&y[0]===Zf?[]:y,h];y=k,l?l(e,3,L):e(...L)}finally{fl=E}}}else u.run()};return a&&a(x),u=new _S(d),u.scheduler=s?()=>s(x,!1):x,h=_=>Y9(_,!1,u),f=u.onStop=()=>{const _=pp.get(u);if(_){if(l)l(_,4);else for(const k of _)k();pp.delete(u)}},e?o?x(!0):y=u.run():s?s(x.bind(null,!0),!0):u.run(),b.pause=u.pause.bind(u),b.resume=u.resume.bind(u),b.stop=b,b}function Os(t,e=1/0,n){if(e<=0||!jt(t)||t.__v_skip||(n=n||new Map,(n.get(t)||0)>=e))return t;if(n.set(t,e),e--,Xe(t))Os(t.value,e,n);else if(ut(t))for(let o=0;o<t.length;o++)Os(t[o],e,n);else if(vu(t)||Bc(t))t.forEach(o=>{Os(o,e,n)});else if(gS(t)){for(const o in t)Os(t[o],e,n);for(const o of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,o)&&Os(t[o],e,n)}return t}/**
|
|
11
|
+
* @vue/runtime-core v3.5.29
|
|
12
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
13
|
+
* @license MIT
|
|
14
|
+
**/function _f(t,e,n,o){try{return o?t(...o):t()}catch(r){J0(r,e,n)}}function xi(t,e,n,o){if(vt(t)){const r=_f(t,e,n,o);return r&&pS(r)&&r.catch(i=>{J0(i,e,n)}),r}if(ut(t)){const r=[];for(let i=0;i<t.length;i++)r.push(xi(t[i],e,n,o));return r}}function J0(t,e,n,o=!0){const r=e?e.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:s}=e&&e.appContext.config||Wt;if(e){let a=e.parent;const l=e.proxy,c=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const u=a.ec;if(u){for(let d=0;d<u.length;d++)if(u[d](t,l,c)===!1)return}a=a.parent}if(i){Ws(),_f(i,null,10,[t,l,c]),Us();return}}X9(t,n,r,o,s)}function X9(t,e,n,o=!0,r=!1){if(r)throw t;console.error(t)}const Vo=[];let Ui=-1;const Lc=[];let ma=null,xc=0;const WS=Promise.resolve();let mp=null;function wn(t){const e=mp||WS;return t?e.then(this?t.bind(this):t):e}function K9(t){let e=Ui+1,n=Vo.length;for(;e<n;){const o=e+n>>>1,r=Vo[o],i=Fd(r);i<t||i===t&&r.flags&2?e=o+1:n=o}return e}function ey(t){if(!(t.flags&1)){const e=Fd(t),n=Vo[Vo.length-1];!n||!(t.flags&2)&&e>=Fd(n)?Vo.push(t):Vo.splice(K9(e),0,t),t.flags|=1,US()}}function US(){mp||(mp=WS.then(YS))}function GS(t){ut(t)?Lc.push(...t):ma&&t.id===-1?ma.splice(xc+1,0,t):t.flags&1||(Lc.push(t),t.flags|=1),US()}function jx(t,e,n=Ui+1){for(;n<Vo.length;n++){const o=Vo[n];if(o&&o.flags&2){if(t&&o.id!==t.uid)continue;Vo.splice(n,1),n--,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function qS(t){if(Lc.length){const e=[...new Set(Lc)].sort((n,o)=>Fd(n)-Fd(o));if(Lc.length=0,ma){ma.push(...e);return}for(ma=e,xc=0;xc<ma.length;xc++){const n=ma[xc];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}ma=null,xc=0}}const Fd=t=>t.id==null?t.flags&2?-1:1/0:t.id;function YS(t){try{for(Ui=0;Ui<Vo.length;Ui++){const e=Vo[Ui];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),_f(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;Ui<Vo.length;Ui++){const e=Vo[Ui];e&&(e.flags&=-2)}Ui=-1,Vo.length=0,qS(),mp=null,(Vo.length||Lc.length)&&YS()}}let io=null,jS=null;function gp(t){const e=io;return io=t,jS=t&&t.type.__scopeId||null,e}function ee(t,e=io,n){if(!e||t._n)return t;const o=(...r)=>{o._d&&xp(-1);const i=gp(e);let s;try{s=t(...r)}finally{gp(i),o._d&&xp(1)}return s};return o._n=!0,o._c=!0,o._d=!0,o}function ar(t,e){if(io===null)return t;const n=lm(io),o=t.dirs||(t.dirs=[]);for(let r=0;r<e.length;r++){let[i,s,a,l=Wt]=e[r];i&&(vt(i)&&(i={mounted:i,updated:i}),i.deep&&Os(s),o.push({dir:i,instance:n,value:s,oldValue:void 0,arg:a,modifiers:l}))}return t}function rl(t,e,n,o){const r=t.dirs,i=e&&e.dirs;for(let s=0;s<r.length;s++){const a=r[s];i&&(a.oldValue=i[s].value);let l=a.dir[o];l&&(Ws(),xi(l,n,8,[t.el,a,t,e]),Us())}}function pi(t,e){if(_o){let n=_o.provides;const o=_o.parent&&_o.parent.provides;o===n&&(n=_o.provides=Object.create(o)),n[t]=e}}function Yt(t,e,n=!1){const o=Oo();if(o||Sl){let r=Sl?Sl._context.provides:o?o.parent==null||o.ce?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:void 0;if(r&&t in r)return r[t];if(arguments.length>1)return n&&vt(e)?e.call(o&&o.proxy):e}}function ty(){return!!(Oo()||Sl)}const Z9=Symbol.for("v-scx"),Q9=()=>Yt(Z9);function em(t,e){return tm(t,null,e)}function J9(t,e){return tm(t,null,{flush:"sync"})}function qe(t,e,n){return tm(t,e,n)}function tm(t,e,n=Wt){const{immediate:o,deep:r,flush:i,once:s}=n,a=Vn({},n),l=e&&o||!e&&i!=="post";let c;if(Wd){if(i==="sync"){const h=Q9();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!l){const h=()=>{};return h.stop=fi,h.resume=fi,h.pause=fi,h}}const u=_o;a.call=(h,g,v)=>xi(h,u,g,v);let d=!1;i==="post"?a.scheduler=h=>{mo(h,u&&u.suspense)}:i!=="sync"&&(d=!0,a.scheduler=(h,g)=>{g?h():ey(h)}),a.augmentJob=h=>{e&&(h.flags|=4),d&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const f=j9(t,e,a);return Wd&&(c?c.push(f):l&&f()),f}function eL(t,e,n){const o=this.proxy,r=vn(t)?t.includes(".")?XS(o,t):()=>o[t]:t.bind(o,o);let i;vt(e)?i=e:(i=e.handler,n=e);const s=kf(this),a=tm(r,i.bind(o),n);return s(),a}function XS(t,e){const n=e.split(".");return()=>{let o=t;for(let r=0;r<n.length&&o;r++)o=o[n[r]];return o}}const KS=Symbol("_vte"),ZS=t=>t.__isTeleport,bd=t=>t&&(t.disabled||t.disabled===""),Xx=t=>t&&(t.defer||t.defer===""),Kx=t=>typeof SVGElement<"u"&&t instanceof SVGElement,Zx=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,e1=(t,e)=>{const n=t&&t.to;return vn(n)?e?e(n):null:n},QS={name:"Teleport",__isTeleport:!0,process(t,e,n,o,r,i,s,a,l,c){const{mc:u,pc:d,pbc:f,o:{insert:h,querySelector:g,createText:v,createComment:m}}=c,b=bd(e.props);let{shapeFlag:y,children:x,dynamicChildren:_}=e;if(t==null){const k=e.el=v(""),E=e.anchor=v("");h(k,n,o),h(E,n,o);const L=(B,D)=>{y&16&&u(x,B,D,r,i,s,a,l)},S=()=>{const B=e.target=e1(e.props,g),D=t1(B,e,v,h);B&&(s!=="svg"&&Kx(B)?s="svg":s!=="mathml"&&Zx(B)&&(s="mathml"),r&&r.isCE&&(r.ce._teleportTargets||(r.ce._teleportTargets=new Set)).add(B),b||(L(B,D),Gh(e,!1)))};b&&(L(n,E),Gh(e,!0)),Xx(e.props)?(e.el.__isMounted=!1,mo(()=>{S(),delete e.el.__isMounted},i)):S()}else{if(Xx(e.props)&&t.el.__isMounted===!1){mo(()=>{QS.process(t,e,n,o,r,i,s,a,l,c)},i);return}e.el=t.el,e.targetStart=t.targetStart;const k=e.anchor=t.anchor,E=e.target=t.target,L=e.targetAnchor=t.targetAnchor,S=bd(t.props),B=S?n:E,D=S?k:L;if(s==="svg"||Kx(E)?s="svg":(s==="mathml"||Zx(E))&&(s="mathml"),_?(f(t.dynamicChildren,_,B,r,i,s,a),sy(t,e,!0)):l||d(t,e,B,D,r,i,s,a,!1),b)S?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):Qf(e,n,k,c,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const N=e.target=e1(e.props,g);N&&Qf(e,N,null,c,0)}else S&&Qf(e,E,L,c,1);Gh(e,b)}},remove(t,e,n,{um:o,o:{remove:r}},i){const{shapeFlag:s,children:a,anchor:l,targetStart:c,targetAnchor:u,target:d,props:f}=t;if(d&&(r(c),r(u)),i&&r(l),s&16){const h=i||!bd(f);for(let g=0;g<a.length;g++){const v=a[g];o(v,e,n,h,!!v.dynamicChildren)}}},move:Qf,hydrate:tL};function Qf(t,e,n,{o:{insert:o},m:r},i=2){i===0&&o(t.targetAnchor,e,n);const{el:s,anchor:a,shapeFlag:l,children:c,props:u}=t,d=i===2;if(d&&o(s,e,n),(!d||bd(u))&&l&16)for(let f=0;f<c.length;f++)r(c[f],e,n,2);d&&o(a,e,n)}function tL(t,e,n,o,r,i,{o:{nextSibling:s,parentNode:a,querySelector:l,insert:c,createText:u}},d){function f(m,b){let y=b;for(;y;){if(y&&y.nodeType===8){if(y.data==="teleport start anchor")e.targetStart=y;else if(y.data==="teleport anchor"){e.targetAnchor=y,m._lpa=e.targetAnchor&&s(e.targetAnchor);break}}y=s(y)}}function h(m,b){b.anchor=d(s(m),b,a(m),n,o,r,i)}const g=e.target=e1(e.props,l),v=bd(e.props);if(g){const m=g._lpa||g.firstChild;e.shapeFlag&16&&(v?(h(t,e),f(g,m),e.targetAnchor||t1(g,e,u,c,a(t)===g?t:null)):(e.anchor=s(t),f(g,m),e.targetAnchor||t1(g,e,u,c),d(m&&s(m),e,g,n,o,r,i))),Gh(e,v)}else v&&e.shapeFlag&16&&(h(t,e),e.targetStart=t,e.targetAnchor=s(t));return e.anchor&&s(e.anchor)}const ny=QS;function Gh(t,e){const n=t.ctx;if(n&&n.ut){let o,r;for(e?(o=t.el,r=t.anchor):(o=t.targetStart,r=t.targetAnchor);o&&o!==r;)o.nodeType===1&&o.setAttribute("data-v-owner",n.uid),o=o.nextSibling;n.ut()}}function t1(t,e,n,o,r=null){const i=e.targetStart=n(""),s=e.targetAnchor=n("");return i[KS]=s,t&&(o(i,t,r),o(s,t,r)),s}const Gi=Symbol("_leaveCb"),Fu=Symbol("_enterCb");function nL(){const t={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return fn(()=>{t.isMounted=!0}),qs(()=>{t.isUnmounting=!0}),t}const Ir=[Function,Array],JS={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ir,onEnter:Ir,onAfterEnter:Ir,onEnterCancelled:Ir,onBeforeLeave:Ir,onLeave:Ir,onAfterLeave:Ir,onLeaveCancelled:Ir,onBeforeAppear:Ir,onAppear:Ir,onAfterAppear:Ir,onAppearCancelled:Ir},e3=t=>{const e=t.subTree;return e.component?e3(e.component):e},oL={name:"BaseTransition",props:JS,setup(t,{slots:e}){const n=Oo(),o=nL();return()=>{const r=e.default&&o3(e.default(),!0);if(!r||!r.length)return;const i=t3(r),s=Bt(t),{mode:a}=s;if(o.isLeaving)return Pg(i);const l=Qx(i);if(!l)return Pg(i);let c=n1(l,s,o,n,d=>c=d);l.type!==wo&&Vd(l,c);let u=n.subTree&&Qx(n.subTree);if(u&&u.type!==wo&&!gl(u,l)&&e3(n).type!==wo){let d=n1(u,s,o,n);if(Vd(u,d),a==="out-in"&&l.type!==wo)return o.isLeaving=!0,d.afterLeave=()=>{o.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},Pg(i);a==="in-out"&&l.type!==wo?d.delayLeave=(f,h,g)=>{const v=n3(o,u);v[String(u.key)]=u,f[Gi]=()=>{h(),f[Gi]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{g(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function t3(t){let e=t[0];if(t.length>1){for(const n of t)if(n.type!==wo){e=n;break}}return e}const rL=oL;function n3(t,e){const{leavingVNodes:n}=t;let o=n.get(e.type);return o||(o=Object.create(null),n.set(e.type,o)),o}function n1(t,e,n,o,r){const{appear:i,mode:s,persisted:a=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:h,onAfterLeave:g,onLeaveCancelled:v,onBeforeAppear:m,onAppear:b,onAfterAppear:y,onAppearCancelled:x}=e,_=String(t.key),k=n3(n,t),E=(B,D)=>{B&&xi(B,o,9,D)},L=(B,D)=>{const N=D[1];E(B,D),ut(B)?B.every(C=>C.length<=1)&&N():B.length<=1&&N()},S={mode:s,persisted:a,beforeEnter(B){let D=l;if(!n.isMounted)if(i)D=m||l;else return;B[Gi]&&B[Gi](!0);const N=k[_];N&&gl(t,N)&&N.el[Gi]&&N.el[Gi](),E(D,[B])},enter(B){if(k[_]===t)return;let D=c,N=u,C=d;if(!n.isMounted)if(i)D=b||c,N=y||u,C=x||d;else return;let M=!1;B[Fu]=$=>{M||(M=!0,$?E(C,[B]):E(N,[B]),S.delayedLeave&&S.delayedLeave(),B[Fu]=void 0)};const P=B[Fu].bind(null,!1);D?L(D,[B,P]):P()},leave(B,D){const N=String(t.key);if(B[Fu]&&B[Fu](!0),n.isUnmounting)return D();E(f,[B]);let C=!1;B[Gi]=P=>{C||(C=!0,D(),P?E(v,[B]):E(g,[B]),B[Gi]=void 0,k[N]===t&&delete k[N])};const M=B[Gi].bind(null,!1);k[N]=t,h?L(h,[B,M]):M()},clone(B){const D=n1(B,e,n,o,r);return r&&r(D),D}};return S}function Pg(t){if(nm(t))return t=Oa(t),t.children=null,t}function Qx(t){if(!nm(t))return ZS(t.type)&&t.children?t3(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:e,children:n}=t;if(n){if(e&16)return n[0];if(e&32&&vt(n.default))return n.default()}}function Vd(t,e){t.shapeFlag&6&&t.component?(t.transition=e,Vd(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function o3(t,e=!1,n){let o=[],r=0;for(let i=0;i<t.length;i++){let s=t[i];const a=n==null?s.key:String(n)+String(s.key!=null?s.key:i);s.type===We?(s.patchFlag&128&&r++,o=o.concat(o3(s.children,e,a))):(e||s.type!==wo)&&o.push(a!=null?Oa(s,{key:a}):s)}if(r>1)for(let i=0;i<o.length;i++)o[i].patchFlag=-2;return o}function le(t,e){return vt(t)?Vn({name:t.name},e,{setup:t}):t}function r3(){const t=Oo();return t?(t.appContext.config.idPrefix||"v")+"-"+t.ids[0]+t.ids[1]++:""}function i3(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}function ht(t){const e=Oo(),n=Re(null);if(e){const r=e.refs===Wt?e.refs={}:e.refs;Object.defineProperty(r,t,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function Jx(t,e){let n;return!!((n=Object.getOwnPropertyDescriptor(t,e))&&!n.configurable)}const vp=new WeakMap;function yd(t,e,n,o,r=!1){if(ut(t)){t.forEach((v,m)=>yd(v,e&&(ut(e)?e[m]:e),n,o,r));return}if(Pc(o)&&!r){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&yd(t,e,n,o.component.subTree);return}const i=o.shapeFlag&4?lm(o.component):o.el,s=r?null:i,{i:a,r:l}=t,c=e&&e.r,u=a.refs===Wt?a.refs={}:a.refs,d=a.setupState,f=Bt(d),h=d===Wt?hS:v=>Jx(u,v)?!1:Kt(f,v),g=(v,m)=>!(m&&Jx(u,m));if(c!=null&&c!==l){if(ew(e),vn(c))u[c]=null,h(c)&&(d[c]=null);else if(Xe(c)){const v=e;g(c,v.k)&&(c.value=null),v.k&&(u[v.k]=null)}}if(vt(l))_f(l,a,12,[s,u]);else{const v=vn(l),m=Xe(l);if(v||m){const b=()=>{if(t.f){const y=v?h(l)?d[l]:u[l]:g()||!t.k?l.value:u[t.k];if(r)ut(y)&&Xb(y,i);else if(ut(y))y.includes(i)||y.push(i);else if(v)u[l]=[i],h(l)&&(d[l]=u[l]);else{const x=[i];g(l,t.k)&&(l.value=x),t.k&&(u[t.k]=x)}}else v?(u[l]=s,h(l)&&(d[l]=s)):m&&(g(l,t.k)&&(l.value=s),t.k&&(u[t.k]=s))};if(s){const y=()=>{b(),vp.delete(t)};y.id=-1,vp.set(t,y),mo(y,n)}else ew(t),b()}}}function ew(t){const e=vp.get(t);e&&(e.flags|=8,vp.delete(t))}G0().requestIdleCallback;G0().cancelIdleCallback;const Pc=t=>!!t.type.__asyncLoader,nm=t=>t.type.__isKeepAlive;function oy(t,e){a3(t,"a",e)}function s3(t,e){a3(t,"da",e)}function a3(t,e,n=_o){const o=t.__wdc||(t.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return t()});if(om(e,o,n),n){let r=n.parent;for(;r&&r.parent;)nm(r.parent.vnode)&&iL(o,e,n,r),r=r.parent}}function iL(t,e,n,o){const r=om(e,t,o,!0);Js(()=>{Xb(o[e],r)},n)}function om(t,e,n=_o,o=!1){if(n){const r=n[t]||(n[t]=[]),i=e.__weh||(e.__weh=(...s)=>{Ws();const a=kf(n),l=xi(e,n,t,s);return a(),Us(),l});return o?r.unshift(i):r.push(i),i}}const Qs=t=>(e,n=_o)=>{(!Wd||t==="sp")&&om(t,(...o)=>e(...o),n)},sL=Qs("bm"),fn=Qs("m"),l3=Qs("bu"),aL=Qs("u"),qs=Qs("bum"),Js=Qs("um"),lL=Qs("sp"),cL=Qs("rtg"),uL=Qs("rtc");function dL(t,e=_o){om("ec",t,e)}const c3="components";function rm(t,e){return d3(c3,t,!0,e)||t}const u3=Symbol.for("v-ndc");function Gt(t){return vn(t)?d3(c3,t,!1)||t:t||u3}function d3(t,e,n=!0,o=!1){const r=io||_o;if(r){const i=r.type;{const a=qL(i,!1);if(a&&(a===e||a===Sr(e)||a===W0(Sr(e))))return i}const s=tw(r[t]||i[t],e)||tw(r.appContext[t],e);return!s&&o?i:s}}function tw(t,e){return t&&(t[e]||t[Sr(e)]||t[W0(Sr(e))])}function mt(t,e,n,o){let r;const i=n,s=ut(t);if(s||vn(t)){const a=s&&Ji(t);let l=!1,c=!1;a&&(l=!wr(t),c=Gs(t),t=j0(t)),r=new Array(t.length);for(let u=0,d=t.length;u<d;u++)r[u]=e(l?c?Gc(yi(t[u])):yi(t[u]):t[u],u,void 0,i)}else if(typeof t=="number"){r=new Array(t);for(let a=0;a<t;a++)r[a]=e(a+1,a,void 0,i)}else if(jt(t))if(t[Symbol.iterator])r=Array.from(t,(a,l)=>e(a,l,void 0,i));else{const a=Object.keys(t);r=new Array(a.length);for(let l=0,c=a.length;l<c;l++){const u=a[l];r[l]=e(t[u],u,l,i)}}else r=[];return r}function wi(t,e){for(let n=0;n<e.length;n++){const o=e[n];if(ut(o))for(let r=0;r<o.length;r++)t[o[r].name]=o[r].fn;else o&&(t[o.name]=o.key?(...r)=>{const i=o.fn(...r);return i&&(i.key=o.key),i}:o.fn)}return t}function Ce(t,e,n={},o,r){if(io.ce||io.parent&&Pc(io.parent)&&io.parent.ce){const c=Object.keys(n).length>0;return e!=="default"&&(n.name=e),w(),Z(We,null,[H("slot",n,o&&o())],c?-2:64)}let i=t[e];i&&i._c&&(i._d=!1),w();const s=i&&f3(i(n)),a=n.key||s&&s.key,l=Z(We,{key:(a&&!bi(a)?a:`_${e}`)+(!s&&o?"_fb":"")},s||(o?o():[]),s&&t._===1?64:-2);return!r&&l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),i&&i._c&&(i._d=!0),l}function f3(t){return t.some(e=>Hd(e)?!(e.type===wo||e.type===We&&!f3(e.children)):!0)?t:null}const o1=t=>t?P3(t)?lm(t):o1(t.parent):null,xd=Vn(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>o1(t.parent),$root:t=>o1(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>m3(t),$forceUpdate:t=>t.f||(t.f=()=>{ey(t.update)}),$nextTick:t=>t.n||(t.n=wn.bind(t.proxy)),$watch:t=>eL.bind(t)}),Dg=(t,e)=>t!==Wt&&!t.__isScriptSetup&&Kt(t,e),fL={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:n,setupState:o,data:r,props:i,accessCache:s,type:a,appContext:l}=t;if(e[0]!=="$"){const f=s[e];if(f!==void 0)switch(f){case 1:return o[e];case 2:return r[e];case 4:return n[e];case 3:return i[e]}else{if(Dg(o,e))return s[e]=1,o[e];if(r!==Wt&&Kt(r,e))return s[e]=2,r[e];if(Kt(i,e))return s[e]=3,i[e];if(n!==Wt&&Kt(n,e))return s[e]=4,n[e];r1&&(s[e]=0)}}const c=xd[e];let u,d;if(c)return e==="$attrs"&&yo(t.attrs,"get",""),c(t);if((u=a.__cssModules)&&(u=u[e]))return u;if(n!==Wt&&Kt(n,e))return s[e]=4,n[e];if(d=l.config.globalProperties,Kt(d,e))return d[e]},set({_:t},e,n){const{data:o,setupState:r,ctx:i}=t;return Dg(r,e)?(r[e]=n,!0):o!==Wt&&Kt(o,e)?(o[e]=n,!0):Kt(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(i[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:o,appContext:r,props:i,type:s}},a){let l;return!!(n[a]||t!==Wt&&a[0]!=="$"&&Kt(t,a)||Dg(e,a)||Kt(i,a)||Kt(o,a)||Kt(xd,a)||Kt(r.config.globalProperties,a)||(l=s.__cssModules)&&l[a])},defineProperty(t,e,n){return n.get!=null?t._.accessCache[e]=0:Kt(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}};function cs(){return h3().slots}function im(){return h3().attrs}function h3(t){const e=Oo();return e.setupContext||(e.setupContext=E3(e))}function bp(t){return ut(t)?t.reduce((e,n)=>(e[n]=null,e),{}):t}function st(t,e){return!t||!e?t||e:ut(t)&&ut(e)?t.concat(e):Vn({},bp(t),bp(e))}let r1=!0;function hL(t){const e=m3(t),n=t.proxy,o=t.ctx;r1=!1,e.beforeCreate&&nw(e.beforeCreate,t,"bc");const{data:r,computed:i,methods:s,watch:a,provide:l,inject:c,created:u,beforeMount:d,mounted:f,beforeUpdate:h,updated:g,activated:v,deactivated:m,beforeDestroy:b,beforeUnmount:y,destroyed:x,unmounted:_,render:k,renderTracked:E,renderTriggered:L,errorCaptured:S,serverPrefetch:B,expose:D,inheritAttrs:N,components:C,directives:M,filters:P}=e;if(c&&pL(c,o,null),s)for(const V in s){const U=s[V];vt(U)&&(o[V]=U.bind(n))}if(r){const V=r.call(n,n);jt(V)&&(t.data=lr(V))}if(r1=!0,i)for(const V in i){const U=i[V],K=vt(U)?U.bind(n,n):vt(U.get)?U.get.bind(n,n):fi,ae=!vt(U)&&vt(U.set)?U.set.bind(n):fi,me=A({get:K,set:ae});Object.defineProperty(o,V,{enumerable:!0,configurable:!0,get:()=>me.value,set:de=>me.value=de})}if(a)for(const V in a)p3(a[V],o,n,V);if(l){const V=vt(l)?l.call(n):l;Reflect.ownKeys(V).forEach(U=>{pi(U,V[U])})}u&&nw(u,t,"c");function F(V,U){ut(U)?U.forEach(K=>V(K.bind(n))):U&&V(U.bind(n))}if(F(sL,d),F(fn,f),F(l3,h),F(aL,g),F(oy,v),F(s3,m),F(dL,S),F(uL,E),F(cL,L),F(qs,y),F(Js,_),F(lL,B),ut(D))if(D.length){const V=t.exposed||(t.exposed={});D.forEach(U=>{Object.defineProperty(V,U,{get:()=>n[U],set:K=>n[U]=K,enumerable:!0})})}else t.exposed||(t.exposed={});k&&t.render===fi&&(t.render=k),N!=null&&(t.inheritAttrs=N),C&&(t.components=C),M&&(t.directives=M),B&&i3(t)}function pL(t,e,n=fi){ut(t)&&(t=i1(t));for(const o in t){const r=t[o];let i;jt(r)?"default"in r?i=Yt(r.from||o,r.default,!0):i=Yt(r.from||o):i=Yt(r),Xe(i)?Object.defineProperty(e,o,{enumerable:!0,configurable:!0,get:()=>i.value,set:s=>i.value=s}):e[o]=i}}function nw(t,e,n){xi(ut(t)?t.map(o=>o.bind(e.proxy)):t.bind(e.proxy),e,n)}function p3(t,e,n,o){let r=o.includes(".")?XS(n,o):()=>n[o];if(vn(t)){const i=e[t];vt(i)&&qe(r,i)}else if(vt(t))qe(r,t.bind(n));else if(jt(t))if(ut(t))t.forEach(i=>p3(i,e,n,o));else{const i=vt(t.handler)?t.handler.bind(n):e[t.handler];vt(i)&&qe(r,i,t)}}function m3(t){const e=t.type,{mixins:n,extends:o}=e,{mixins:r,optionsCache:i,config:{optionMergeStrategies:s}}=t.appContext,a=i.get(e);let l;return a?l=a:!r.length&&!n&&!o?l=e:(l={},r.length&&r.forEach(c=>yp(l,c,s,!0)),yp(l,e,s)),jt(e)&&i.set(e,l),l}function yp(t,e,n,o=!1){const{mixins:r,extends:i}=e;i&&yp(t,i,n,!0),r&&r.forEach(s=>yp(t,s,n,!0));for(const s in e)if(!(o&&s==="expose")){const a=mL[s]||n&&n[s];t[s]=a?a(t[s],e[s]):e[s]}return t}const mL={data:ow,props:rw,emits:rw,methods:od,computed:od,beforeCreate:Io,created:Io,beforeMount:Io,mounted:Io,beforeUpdate:Io,updated:Io,beforeDestroy:Io,beforeUnmount:Io,destroyed:Io,unmounted:Io,activated:Io,deactivated:Io,errorCaptured:Io,serverPrefetch:Io,components:od,directives:od,watch:vL,provide:ow,inject:gL};function ow(t,e){return e?t?function(){return Vn(vt(t)?t.call(this,this):t,vt(e)?e.call(this,this):e)}:e:t}function gL(t,e){return od(i1(t),i1(e))}function i1(t){if(ut(t)){const e={};for(let n=0;n<t.length;n++)e[t[n]]=t[n];return e}return t}function Io(t,e){return t?[...new Set([].concat(t,e))]:e}function od(t,e){return t?Vn(Object.create(null),t,e):e}function rw(t,e){return t?ut(t)&&ut(e)?[...new Set([...t,...e])]:Vn(Object.create(null),bp(t),bp(e??{})):e}function vL(t,e){if(!t)return e;if(!e)return t;const n=Vn(Object.create(null),t);for(const o in e)n[o]=Io(t[o],e[o]);return n}function g3(){return{app:null,config:{isNativeTag:hS,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let bL=0;function yL(t,e){return function(o,r=null){vt(o)||(o=Vn({},o)),r!=null&&!jt(r)&&(r=null);const i=g3(),s=new WeakSet,a=[];let l=!1;const c=i.app={_uid:bL++,_component:o,_props:r,_container:null,_context:i,_instance:null,version:jL,get config(){return i.config},set config(u){},use(u,...d){return s.has(u)||(u&&vt(u.install)?(s.add(u),u.install(c,...d)):vt(u)&&(s.add(u),u(c,...d))),c},mixin(u){return i.mixins.includes(u)||i.mixins.push(u),c},component(u,d){return d?(i.components[u]=d,c):i.components[u]},directive(u,d){return d?(i.directives[u]=d,c):i.directives[u]},mount(u,d,f){if(!l){const h=c._ceVNode||H(o,r);return h.appContext=i,f===!0?f="svg":f===!1&&(f=void 0),t(h,u,f),l=!0,c._container=u,u.__vue_app__=c,lm(h.component)}},onUnmount(u){a.push(u)},unmount(){l&&(xi(a,c._instance,16),t(null,c._container),delete c._container.__vue_app__)},provide(u,d){return i.provides[u]=d,c},runWithContext(u){const d=Sl;Sl=c;try{return u()}finally{Sl=d}}};return c}}let Sl=null;function ft(t,e,n=Wt){const o=Oo(),r=Sr(e),i=Zs(e),s=v3(t,r),a=zS((l,c)=>{let u,d=Wt,f;return J9(()=>{const h=t[r];er(u,h)&&(u=h,c())}),{get(){return l(),n.get?n.get(u):u},set(h){const g=n.set?n.set(h):h;if(!er(g,u)&&!(d!==Wt&&er(h,d)))return;const v=o.vnode.props;v&&(e in v||r in v||i in v)&&(`onUpdate:${e}`in v||`onUpdate:${r}`in v||`onUpdate:${i}`in v)||(u=h,c()),o.emit(`update:${e}`,g),er(h,g)&&er(h,d)&&!er(g,f)&&c(),d=h,f=g}}});return a[Symbol.iterator]=()=>{let l=0;return{next(){return l<2?{value:l++?s||Wt:a,done:!1}:{done:!0}}}},a}const v3=(t,e)=>e==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${Sr(e)}Modifiers`]||t[`${Zs(e)}Modifiers`];function xL(t,e,...n){if(t.isUnmounted)return;const o=t.vnode.props||Wt;let r=n;const i=e.startsWith("update:"),s=i&&v3(o,e.slice(7));s&&(s.trim&&(r=n.map(u=>vn(u)?u.trim():u)),s.number&&(r=n.map(U0)));let a,l=o[a=Tg(e)]||o[a=Tg(Sr(e))];!l&&i&&(l=o[a=Tg(Zs(e))]),l&&xi(l,t,6,r);const c=o[a+"Once"];if(c){if(!t.emitted)t.emitted={};else if(t.emitted[a])return;t.emitted[a]=!0,xi(c,t,6,r)}}const wL=new WeakMap;function b3(t,e,n=!1){const o=n?wL:e.emitsCache,r=o.get(t);if(r!==void 0)return r;const i=t.emits;let s={},a=!1;if(!vt(t)){const l=c=>{const u=b3(c,e,!0);u&&(a=!0,Vn(s,u))};!n&&e.mixins.length&&e.mixins.forEach(l),t.extends&&l(t.extends),t.mixins&&t.mixins.forEach(l)}return!i&&!a?(jt(t)&&o.set(t,null),null):(ut(i)?i.forEach(l=>s[l]=null):Vn(s,i),jt(t)&&o.set(t,s),s)}function sm(t,e){return!t||!V0(e)?!1:(e=e.slice(2).replace(/Once$/,""),Kt(t,e[0].toLowerCase()+e.slice(1))||Kt(t,Zs(e))||Kt(t,e))}function iw(t){const{type:e,vnode:n,proxy:o,withProxy:r,propsOptions:[i],slots:s,attrs:a,emit:l,render:c,renderCache:u,props:d,data:f,setupState:h,ctx:g,inheritAttrs:v}=t,m=gp(t);let b,y;try{if(n.shapeFlag&4){const _=r||o,k=_;b=qi(c.call(k,_,u,d,h,f,g)),y=a}else{const _=e;b=qi(_.length>1?_(d,{attrs:a,slots:s,emit:l}):_(d,null)),y=e.props?a:_L(a)}}catch(_){_d.length=0,J0(_,t,1),b=H(wo)}let x=b;if(y&&v!==!1){const _=Object.keys(y),{shapeFlag:k}=x;_.length&&k&7&&(i&&_.some(jb)&&(y=kL(y,i)),x=Oa(x,y,!1,!0))}return n.dirs&&(x=Oa(x,null,!1,!0),x.dirs=x.dirs?x.dirs.concat(n.dirs):n.dirs),n.transition&&Vd(x,n.transition),b=x,gp(m),b}const _L=t=>{let e;for(const n in t)(n==="class"||n==="style"||V0(n))&&((e||(e={}))[n]=t[n]);return e},kL=(t,e)=>{const n={};for(const o in t)(!jb(o)||!(o.slice(9)in e))&&(n[o]=t[o]);return n};function SL(t,e,n){const{props:o,children:r,component:i}=t,{props:s,children:a,patchFlag:l}=e,c=i.emitsOptions;if(e.dirs||e.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return o?sw(o,s,c):!!s;if(l&8){const u=e.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(y3(s,o,f)&&!sm(c,f))return!0}}}else return(r||a)&&(!a||!a.$stable)?!0:o===s?!1:o?s?sw(o,s,c):!0:!!s;return!1}function sw(t,e,n){const o=Object.keys(e);if(o.length!==Object.keys(t).length)return!0;for(let r=0;r<o.length;r++){const i=o[r];if(y3(e,t,i)&&!sm(n,i))return!0}return!1}function y3(t,e,n){const o=t[n],r=e[n];return n==="style"&&jt(o)&&jt(r)?!Ta(o,r):o!==r}function AL({vnode:t,parent:e},n){for(;e;){const o=e.subTree;if(o.suspense&&o.suspense.activeBranch===t&&(o.el=t.el),o===t)(t=e.vnode).el=n,e=e.parent;else break}}const x3={},w3=()=>Object.create(x3),_3=t=>Object.getPrototypeOf(t)===x3;function CL(t,e,n,o=!1){const r={},i=w3();t.propsDefaults=Object.create(null),k3(t,e,r,i);for(const s in t.propsOptions[0])s in r||(r[s]=void 0);n?t.props=o?r:RS(r):t.type.props?t.props=r:t.props=i,t.attrs=i}function $L(t,e,n,o){const{props:r,attrs:i,vnode:{patchFlag:s}}=t,a=Bt(r),[l]=t.propsOptions;let c=!1;if((o||s>0)&&!(s&16)){if(s&8){const u=t.vnode.dynamicProps;for(let d=0;d<u.length;d++){let f=u[d];if(sm(t.emitsOptions,f))continue;const h=e[f];if(l)if(Kt(i,f))h!==i[f]&&(i[f]=h,c=!0);else{const g=Sr(f);r[g]=s1(l,a,g,h,t,!1)}else h!==i[f]&&(i[f]=h,c=!0)}}}else{k3(t,e,r,i)&&(c=!0);let u;for(const d in a)(!e||!Kt(e,d)&&((u=Zs(d))===d||!Kt(e,u)))&&(l?n&&(n[d]!==void 0||n[u]!==void 0)&&(r[d]=s1(l,a,d,void 0,t,!0)):delete r[d]);if(i!==a)for(const d in i)(!e||!Kt(e,d))&&(delete i[d],c=!0)}c&&Ms(t.attrs,"set","")}function k3(t,e,n,o){const[r,i]=t.propsOptions;let s=!1,a;if(e)for(let l in e){if(md(l))continue;const c=e[l];let u;r&&Kt(r,u=Sr(l))?!i||!i.includes(u)?n[u]=c:(a||(a={}))[u]=c:sm(t.emitsOptions,l)||(!(l in o)||c!==o[l])&&(o[l]=c,s=!0)}if(i){const l=Bt(n),c=a||Wt;for(let u=0;u<i.length;u++){const d=i[u];n[d]=s1(r,l,d,c[d],t,!Kt(c,d))}}return s}function s1(t,e,n,o,r,i){const s=t[n];if(s!=null){const a=Kt(s,"default");if(a&&o===void 0){const l=s.default;if(s.type!==Function&&!s.skipFactory&&vt(l)){const{propsDefaults:c}=r;if(n in c)o=c[n];else{const u=kf(r);o=c[n]=l.call(null,e),u()}}else o=l;r.ce&&r.ce._setProp(n,o)}s[0]&&(i&&!a?o=!1:s[1]&&(o===""||o===Zs(n))&&(o=!0))}return o}const TL=new WeakMap;function S3(t,e,n=!1){const o=n?TL:e.propsCache,r=o.get(t);if(r)return r;const i=t.props,s={},a=[];let l=!1;if(!vt(t)){const u=d=>{l=!0;const[f,h]=S3(d,e,!0);Vn(s,f),h&&a.push(...h)};!n&&e.mixins.length&&e.mixins.forEach(u),t.extends&&u(t.extends),t.mixins&&t.mixins.forEach(u)}if(!i&&!l)return jt(t)&&o.set(t,Oc),Oc;if(ut(i))for(let u=0;u<i.length;u++){const d=Sr(i[u]);aw(d)&&(s[d]=Wt)}else if(i)for(const u in i){const d=Sr(u);if(aw(d)){const f=i[u],h=s[d]=ut(f)||vt(f)?{type:f}:Vn({},f),g=h.type;let v=!1,m=!0;if(ut(g))for(let b=0;b<g.length;++b){const y=g[b],x=vt(y)&&y.name;if(x==="Boolean"){v=!0;break}else x==="String"&&(m=!1)}else v=vt(g)&&g.name==="Boolean";h[0]=v,h[1]=m,(v||Kt(h,"default"))&&a.push(d)}}const c=[s,a];return jt(t)&&o.set(t,c),c}function aw(t){return t[0]!=="$"&&!md(t)}const ry=t=>t==="_"||t==="_ctx"||t==="$stable",iy=t=>ut(t)?t.map(qi):[qi(t)],ML=(t,e,n)=>{if(e._n)return e;const o=ee((...r)=>iy(e(...r)),n);return o._c=!1,o},A3=(t,e,n)=>{const o=t._ctx;for(const r in t){if(ry(r))continue;const i=t[r];if(vt(i))e[r]=ML(r,i,o);else if(i!=null){const s=iy(i);e[r]=()=>s}}},C3=(t,e)=>{const n=iy(e);t.slots.default=()=>n},$3=(t,e,n)=>{for(const o in e)(n||!ry(o))&&(t[o]=e[o])},OL=(t,e,n)=>{const o=t.slots=w3();if(t.vnode.shapeFlag&32){const r=e._;r?($3(o,e,n),n&&vS(o,"_",r,!0)):A3(e,o)}else e&&C3(t,e)},BL=(t,e,n)=>{const{vnode:o,slots:r}=t;let i=!0,s=Wt;if(o.shapeFlag&32){const a=e._;a?n&&a===1?i=!1:$3(r,e,n):(i=!e.$stable,A3(e,r)),s=e}else e&&(C3(t,e),s={default:1});if(i)for(const a in r)!ry(a)&&s[a]==null&&delete r[a]},mo=IL;function LL(t){return PL(t)}function PL(t,e){const n=G0();n.__VUE__=!0;const{insert:o,remove:r,patchProp:i,createElement:s,createText:a,createComment:l,setText:c,setElementText:u,parentNode:d,nextSibling:f,setScopeId:h=fi,insertStaticContent:g}=t,v=(I,G,Y,se=null,fe=null,ne=null,Q=void 0,q=null,X=!!G.dynamicChildren)=>{if(I===G)return;I&&!gl(I,G)&&(se=J(I),de(I,fe,ne,!0),I=null),G.patchFlag===-2&&(X=!1,G.dynamicChildren=null);const{type:j,ref:ce,shapeFlag:ye}=G;switch(j){case am:m(I,G,Y,se);break;case wo:b(I,G,Y,se);break;case wd:I==null&&y(G,Y,se,Q);break;case We:C(I,G,Y,se,fe,ne,Q,q,X);break;default:ye&1?k(I,G,Y,se,fe,ne,Q,q,X):ye&6?M(I,G,Y,se,fe,ne,Q,q,X):(ye&64||ye&128)&&j.process(I,G,Y,se,fe,ne,Q,q,X,oe)}ce!=null&&fe?yd(ce,I&&I.ref,ne,G||I,!G):ce==null&&I&&I.ref!=null&&yd(I.ref,null,ne,I,!0)},m=(I,G,Y,se)=>{if(I==null)o(G.el=a(G.children),Y,se);else{const fe=G.el=I.el;G.children!==I.children&&c(fe,G.children)}},b=(I,G,Y,se)=>{I==null?o(G.el=l(G.children||""),Y,se):G.el=I.el},y=(I,G,Y,se)=>{[I.el,I.anchor]=g(I.children,G,Y,se,I.el,I.anchor)},x=({el:I,anchor:G},Y,se)=>{let fe;for(;I&&I!==G;)fe=f(I),o(I,Y,se),I=fe;o(G,Y,se)},_=({el:I,anchor:G})=>{let Y;for(;I&&I!==G;)Y=f(I),r(I),I=Y;r(G)},k=(I,G,Y,se,fe,ne,Q,q,X)=>{if(G.type==="svg"?Q="svg":G.type==="math"&&(Q="mathml"),I==null)E(G,Y,se,fe,ne,Q,q,X);else{const j=I.el&&I.el._isVueCE?I.el:null;try{j&&j._beginPatch(),B(I,G,fe,ne,Q,q,X)}finally{j&&j._endPatch()}}},E=(I,G,Y,se,fe,ne,Q,q)=>{let X,j;const{props:ce,shapeFlag:ye,transition:ue,dirs:ke}=I;if(X=I.el=s(I.type,ne,ce&&ce.is,ce),ye&8?u(X,I.children):ye&16&&S(I.children,X,null,se,fe,Eg(I,ne),Q,q),ke&&rl(I,null,se,"created"),L(X,I,I.scopeId,Q,se),ce){for(const Se in ce)Se!=="value"&&!md(Se)&&i(X,Se,null,ce[Se],ne,se);"value"in ce&&i(X,"value",null,ce.value,ne),(j=ce.onVnodeBeforeMount)&&Ri(j,se,I)}ke&&rl(I,null,se,"beforeMount");const Ie=DL(fe,ue);Ie&&ue.beforeEnter(X),o(X,G,Y),((j=ce&&ce.onVnodeMounted)||Ie||ke)&&mo(()=>{j&&Ri(j,se,I),Ie&&ue.enter(X),ke&&rl(I,null,se,"mounted")},fe)},L=(I,G,Y,se,fe)=>{if(Y&&h(I,Y),se)for(let ne=0;ne<se.length;ne++)h(I,se[ne]);if(fe){let ne=fe.subTree;if(G===ne||O3(ne.type)&&(ne.ssContent===G||ne.ssFallback===G)){const Q=fe.vnode;L(I,Q,Q.scopeId,Q.slotScopeIds,fe.parent)}}},S=(I,G,Y,se,fe,ne,Q,q,X=0)=>{for(let j=X;j<I.length;j++){const ce=I[j]=q?As(I[j]):qi(I[j]);v(null,ce,G,Y,se,fe,ne,Q,q)}},B=(I,G,Y,se,fe,ne,Q)=>{const q=G.el=I.el;let{patchFlag:X,dynamicChildren:j,dirs:ce}=G;X|=I.patchFlag&16;const ye=I.props||Wt,ue=G.props||Wt;let ke;if(Y&&il(Y,!1),(ke=ue.onVnodeBeforeUpdate)&&Ri(ke,Y,G,I),ce&&rl(G,I,Y,"beforeUpdate"),Y&&il(Y,!0),(ye.innerHTML&&ue.innerHTML==null||ye.textContent&&ue.textContent==null)&&u(q,""),j?D(I.dynamicChildren,j,q,Y,se,Eg(G,fe),ne):Q||U(I,G,q,null,Y,se,Eg(G,fe),ne,!1),X>0){if(X&16)N(q,ye,ue,Y,fe);else if(X&2&&ye.class!==ue.class&&i(q,"class",null,ue.class,fe),X&4&&i(q,"style",ye.style,ue.style,fe),X&8){const Ie=G.dynamicProps;for(let Se=0;Se<Ie.length;Se++){const Be=Ie[Se],Ze=ye[Be],ot=ue[Be];(ot!==Ze||Be==="value")&&i(q,Be,Ze,ot,fe,Y)}}X&1&&I.children!==G.children&&u(q,G.children)}else!Q&&j==null&&N(q,ye,ue,Y,fe);((ke=ue.onVnodeUpdated)||ce)&&mo(()=>{ke&&Ri(ke,Y,G,I),ce&&rl(G,I,Y,"updated")},se)},D=(I,G,Y,se,fe,ne,Q)=>{for(let q=0;q<G.length;q++){const X=I[q],j=G[q],ce=X.el&&(X.type===We||!gl(X,j)||X.shapeFlag&198)?d(X.el):Y;v(X,j,ce,null,se,fe,ne,Q,!0)}},N=(I,G,Y,se,fe)=>{if(G!==Y){if(G!==Wt)for(const ne in G)!md(ne)&&!(ne in Y)&&i(I,ne,G[ne],null,fe,se);for(const ne in Y){if(md(ne))continue;const Q=Y[ne],q=G[ne];Q!==q&&ne!=="value"&&i(I,ne,q,Q,fe,se)}"value"in Y&&i(I,"value",G.value,Y.value,fe)}},C=(I,G,Y,se,fe,ne,Q,q,X)=>{const j=G.el=I?I.el:a(""),ce=G.anchor=I?I.anchor:a("");let{patchFlag:ye,dynamicChildren:ue,slotScopeIds:ke}=G;ke&&(q=q?q.concat(ke):ke),I==null?(o(j,Y,se),o(ce,Y,se),S(G.children||[],Y,ce,fe,ne,Q,q,X)):ye>0&&ye&64&&ue&&I.dynamicChildren&&I.dynamicChildren.length===ue.length?(D(I.dynamicChildren,ue,Y,fe,ne,Q,q),(G.key!=null||fe&&G===fe.subTree)&&sy(I,G,!0)):U(I,G,Y,ce,fe,ne,Q,q,X)},M=(I,G,Y,se,fe,ne,Q,q,X)=>{G.slotScopeIds=q,I==null?G.shapeFlag&512?fe.ctx.activate(G,Y,se,Q,X):P(G,Y,se,fe,ne,Q,X):$(I,G,X)},P=(I,G,Y,se,fe,ne,Q)=>{const q=I.component=HL(I,se,fe);if(nm(I)&&(q.ctx.renderer=oe),WL(q,!1,Q),q.asyncDep){if(fe&&fe.registerDep(q,F,Q),!I.el){const X=q.subTree=H(wo);b(null,X,G,Y),I.placeholder=X.el}}else F(q,I,G,Y,fe,ne,Q)},$=(I,G,Y)=>{const se=G.component=I.component;if(SL(I,G,Y))if(se.asyncDep&&!se.asyncResolved){V(se,G,Y);return}else se.next=G,se.update();else G.el=I.el,se.vnode=G},F=(I,G,Y,se,fe,ne,Q)=>{const q=()=>{if(I.isMounted){let{next:ye,bu:ue,u:ke,parent:Ie,vnode:Se}=I;{const Tt=T3(I);if(Tt){ye&&(ye.el=Se.el,V(I,ye,Q)),Tt.asyncDep.then(()=>{mo(()=>{I.isUnmounted||j()},fe)});return}}let Be=ye,Ze;il(I,!1),ye?(ye.el=Se.el,V(I,ye,Q)):ye=Se,ue&&Uh(ue),(Ze=ye.props&&ye.props.onVnodeBeforeUpdate)&&Ri(Ze,Ie,ye,Se),il(I,!0);const ot=iw(I),pt=I.subTree;I.subTree=ot,v(pt,ot,d(pt.el),J(pt),I,fe,ne),ye.el=ot.el,Be===null&&AL(I,ot.el),ke&&mo(ke,fe),(Ze=ye.props&&ye.props.onVnodeUpdated)&&mo(()=>Ri(Ze,Ie,ye,Se),fe)}else{let ye;const{el:ue,props:ke}=G,{bm:Ie,m:Se,parent:Be,root:Ze,type:ot}=I,pt=Pc(G);il(I,!1),Ie&&Uh(Ie),!pt&&(ye=ke&&ke.onVnodeBeforeMount)&&Ri(ye,Be,G),il(I,!0);{Ze.ce&&Ze.ce._hasShadowRoot()&&Ze.ce._injectChildStyle(ot);const Tt=I.subTree=iw(I);v(null,Tt,Y,se,I,fe,ne),G.el=Tt.el}if(Se&&mo(Se,fe),!pt&&(ye=ke&&ke.onVnodeMounted)){const Tt=G;mo(()=>Ri(ye,Be,Tt),fe)}(G.shapeFlag&256||Be&&Pc(Be.vnode)&&Be.vnode.shapeFlag&256)&&I.a&&mo(I.a,fe),I.isMounted=!0,G=Y=se=null}};I.scope.on();const X=I.effect=new _S(q);I.scope.off();const j=I.update=X.run.bind(X),ce=I.job=X.runIfDirty.bind(X);ce.i=I,ce.id=I.uid,X.scheduler=()=>ey(ce),il(I,!0),j()},V=(I,G,Y)=>{G.component=I;const se=I.vnode.props;I.vnode=G,I.next=null,$L(I,G.props,se,Y),BL(I,G.children,Y),Ws(),jx(I),Us()},U=(I,G,Y,se,fe,ne,Q,q,X=!1)=>{const j=I&&I.children,ce=I?I.shapeFlag:0,ye=G.children,{patchFlag:ue,shapeFlag:ke}=G;if(ue>0){if(ue&128){ae(j,ye,Y,se,fe,ne,Q,q,X);return}else if(ue&256){K(j,ye,Y,se,fe,ne,Q,q,X);return}}ke&8?(ce&16&&we(j,fe,ne),ye!==j&&u(Y,ye)):ce&16?ke&16?ae(j,ye,Y,se,fe,ne,Q,q,X):we(j,fe,ne,!0):(ce&8&&u(Y,""),ke&16&&S(ye,Y,se,fe,ne,Q,q,X))},K=(I,G,Y,se,fe,ne,Q,q,X)=>{I=I||Oc,G=G||Oc;const j=I.length,ce=G.length,ye=Math.min(j,ce);let ue;for(ue=0;ue<ye;ue++){const ke=G[ue]=X?As(G[ue]):qi(G[ue]);v(I[ue],ke,Y,null,fe,ne,Q,q,X)}j>ce?we(I,fe,ne,!0,!1,ye):S(G,Y,se,fe,ne,Q,q,X,ye)},ae=(I,G,Y,se,fe,ne,Q,q,X)=>{let j=0;const ce=G.length;let ye=I.length-1,ue=ce-1;for(;j<=ye&&j<=ue;){const ke=I[j],Ie=G[j]=X?As(G[j]):qi(G[j]);if(gl(ke,Ie))v(ke,Ie,Y,null,fe,ne,Q,q,X);else break;j++}for(;j<=ye&&j<=ue;){const ke=I[ye],Ie=G[ue]=X?As(G[ue]):qi(G[ue]);if(gl(ke,Ie))v(ke,Ie,Y,null,fe,ne,Q,q,X);else break;ye--,ue--}if(j>ye){if(j<=ue){const ke=ue+1,Ie=ke<ce?G[ke].el:se;for(;j<=ue;)v(null,G[j]=X?As(G[j]):qi(G[j]),Y,Ie,fe,ne,Q,q,X),j++}}else if(j>ue)for(;j<=ye;)de(I[j],fe,ne,!0),j++;else{const ke=j,Ie=j,Se=new Map;for(j=Ie;j<=ue;j++){const Et=G[j]=X?As(G[j]):qi(G[j]);Et.key!=null&&Se.set(Et.key,j)}let Be,Ze=0;const ot=ue-Ie+1;let pt=!1,Tt=0;const Jt=new Array(ot);for(j=0;j<ot;j++)Jt[j]=0;for(j=ke;j<=ye;j++){const Et=I[j];if(Ze>=ot){de(Et,fe,ne,!0);continue}let Ft;if(Et.key!=null)Ft=Se.get(Et.key);else for(Be=Ie;Be<=ue;Be++)if(Jt[Be-Ie]===0&&gl(Et,G[Be])){Ft=Be;break}Ft===void 0?de(Et,fe,ne,!0):(Jt[Ft-Ie]=j+1,Ft>=Tt?Tt=Ft:pt=!0,v(Et,G[Ft],Y,null,fe,ne,Q,q,X),Ze++)}const pn=pt?EL(Jt):Oc;for(Be=pn.length-1,j=ot-1;j>=0;j--){const Et=Ie+j,Ft=G[Et],dn=G[Et+1],Sn=Et+1<ce?dn.el||M3(dn):se;Jt[j]===0?v(null,Ft,Y,Sn,fe,ne,Q,q,X):pt&&(Be<0||j!==pn[Be]?me(Ft,Y,Sn,2):Be--)}}},me=(I,G,Y,se,fe=null)=>{const{el:ne,type:Q,transition:q,children:X,shapeFlag:j}=I;if(j&6){me(I.component.subTree,G,Y,se);return}if(j&128){I.suspense.move(G,Y,se);return}if(j&64){Q.move(I,G,Y,oe);return}if(Q===We){o(ne,G,Y);for(let ye=0;ye<X.length;ye++)me(X[ye],G,Y,se);o(I.anchor,G,Y);return}if(Q===wd){x(I,G,Y);return}if(se!==2&&j&1&&q)if(se===0)q.beforeEnter(ne),o(ne,G,Y),mo(()=>q.enter(ne),fe);else{const{leave:ye,delayLeave:ue,afterLeave:ke}=q,Ie=()=>{I.ctx.isUnmounted?r(ne):o(ne,G,Y)},Se=()=>{ne._isLeaving&&ne[Gi](!0),ye(ne,()=>{Ie(),ke&&ke()})};ue?ue(ne,Ie,Se):Se()}else o(ne,G,Y)},de=(I,G,Y,se=!1,fe=!1)=>{const{type:ne,props:Q,ref:q,children:X,dynamicChildren:j,shapeFlag:ce,patchFlag:ye,dirs:ue,cacheIndex:ke}=I;if(ye===-2&&(fe=!1),q!=null&&(Ws(),yd(q,null,Y,I,!0),Us()),ke!=null&&(G.renderCache[ke]=void 0),ce&256){G.ctx.deactivate(I);return}const Ie=ce&1&&ue,Se=!Pc(I);let Be;if(Se&&(Be=Q&&Q.onVnodeBeforeUnmount)&&Ri(Be,G,I),ce&6)pe(I.component,Y,se);else{if(ce&128){I.suspense.unmount(Y,se);return}Ie&&rl(I,null,G,"beforeUnmount"),ce&64?I.type.remove(I,G,Y,oe,se):j&&!j.hasOnce&&(ne!==We||ye>0&&ye&64)?we(j,G,Y,!1,!0):(ne===We&&ye&384||!fe&&ce&16)&&we(X,G,Y),se&&ve(I)}(Se&&(Be=Q&&Q.onVnodeUnmounted)||Ie)&&mo(()=>{Be&&Ri(Be,G,I),Ie&&rl(I,null,G,"unmounted")},Y)},ve=I=>{const{type:G,el:Y,anchor:se,transition:fe}=I;if(G===We){te(Y,se);return}if(G===wd){_(I);return}const ne=()=>{r(Y),fe&&!fe.persisted&&fe.afterLeave&&fe.afterLeave()};if(I.shapeFlag&1&&fe&&!fe.persisted){const{leave:Q,delayLeave:q}=fe,X=()=>Q(Y,ne);q?q(I.el,ne,X):X()}else ne()},te=(I,G)=>{let Y;for(;I!==G;)Y=f(I),r(I),I=Y;r(G)},pe=(I,G,Y)=>{const{bum:se,scope:fe,job:ne,subTree:Q,um:q,m:X,a:j}=I;lw(X),lw(j),se&&Uh(se),fe.stop(),ne&&(ne.flags|=8,de(Q,I,G,Y)),q&&mo(q,G),mo(()=>{I.isUnmounted=!0},G)},we=(I,G,Y,se=!1,fe=!1,ne=0)=>{for(let Q=ne;Q<I.length;Q++)de(I[Q],G,Y,se,fe)},J=I=>{if(I.shapeFlag&6)return J(I.component.subTree);if(I.shapeFlag&128)return I.suspense.next();const G=f(I.anchor||I.el),Y=G&&G[KS];return Y?f(Y):G};let ge=!1;const re=(I,G,Y)=>{let se;I==null?G._vnode&&(de(G._vnode,null,null,!0),se=G._vnode.component):v(G._vnode||null,I,G,null,null,null,Y),G._vnode=I,ge||(ge=!0,jx(se),qS(),ge=!1)},oe={p:v,um:de,m:me,r:ve,mt:P,mc:S,pc:U,pbc:D,n:J,o:t};return{render:re,hydrate:void 0,createApp:yL(re)}}function Eg({type:t,props:e},n){return n==="svg"&&t==="foreignObject"||n==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:n}function il({effect:t,job:e},n){n?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function DL(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function sy(t,e,n=!1){const o=t.children,r=e.children;if(ut(o)&&ut(r))for(let i=0;i<o.length;i++){const s=o[i];let a=r[i];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=r[i]=As(r[i]),a.el=s.el),!n&&a.patchFlag!==-2&&sy(s,a)),a.type===am&&(a.patchFlag===-1&&(a=r[i]=As(a)),a.el=s.el),a.type===wo&&!a.el&&(a.el=s.el)}}function EL(t){const e=t.slice(),n=[0];let o,r,i,s,a;const l=t.length;for(o=0;o<l;o++){const c=t[o];if(c!==0){if(r=n[n.length-1],t[r]<c){e[o]=r,n.push(o);continue}for(i=0,s=n.length-1;i<s;)a=i+s>>1,t[n[a]]<c?i=a+1:s=a;c<t[n[i]]&&(i>0&&(e[o]=n[i-1]),n[i]=o)}}for(i=n.length,s=n[i-1];i-- >0;)n[i]=s,s=e[s];return n}function T3(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:T3(e)}function lw(t){if(t)for(let e=0;e<t.length;e++)t[e].flags|=8}function M3(t){if(t.placeholder)return t.placeholder;const e=t.component;return e?M3(e.subTree):null}const O3=t=>t.__isSuspense;function IL(t,e){e&&e.pendingBranch?ut(t)?e.effects.push(...t):e.effects.push(t):GS(t)}const We=Symbol.for("v-fgt"),am=Symbol.for("v-txt"),wo=Symbol.for("v-cmt"),wd=Symbol.for("v-stc"),_d=[];let yr=null;function w(t=!1){_d.push(yr=t?null:[])}function NL(){_d.pop(),yr=_d[_d.length-1]||null}let zd=1;function xp(t,e=!1){zd+=t,t<0&&yr&&e&&(yr.hasOnce=!0)}function B3(t){return t.dynamicChildren=zd>0?yr||Oc:null,NL(),zd>0&&yr&&yr.push(t),t}function R(t,e,n,o,r,i){return B3(T(t,e,n,o,r,i,!0))}function Z(t,e,n,o,r){return B3(H(t,e,n,o,r,!0))}function Hd(t){return t?t.__v_isVNode===!0:!1}function gl(t,e){return t.type===e.type&&t.key===e.key}const L3=({key:t})=>t??null,qh=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?vn(t)||Xe(t)||vt(t)?{i:io,r:t,k:e,f:!!n}:t:null);function T(t,e=null,n=null,o=0,r=null,i=t===We?0:1,s=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&L3(e),ref:e&&qh(e),scopeId:jS,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:o,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:io};return a?(ay(l,n),i&128&&t.normalize(l)):n&&(l.shapeFlag|=vn(n)?8:16),zd>0&&!s&&yr&&(l.patchFlag>0||i&6)&&l.patchFlag!==32&&yr.push(l),l}const H=RL;function RL(t,e=null,n=null,o=0,r=null,i=!1){if((!t||t===u3)&&(t=wo),Hd(t)){const a=Oa(t,e,!0);return n&&ay(a,n),zd>0&&!i&&yr&&(a.shapeFlag&6?yr[yr.indexOf(t)]=a:yr.push(a)),a.patchFlag=-2,a}if(YL(t)&&(t=t.__vccOpts),e){e=tr(e);let{class:a,style:l}=e;a&&!vn(a)&&(e.class=Te(a)),jt(l)&&(Z0(l)&&!ut(l)&&(l=Vn({},l)),e.style=Pt(l))}const s=vn(t)?1:O3(t)?128:ZS(t)?64:jt(t)?4:vt(t)?2:0;return T(t,e,n,o,r,s,i,!0)}function tr(t){return t?Z0(t)||_3(t)?Vn({},t):t:null}function Oa(t,e,n=!1,o=!1){const{props:r,ref:i,patchFlag:s,children:a,transition:l}=t,c=e?Ct(r||{},e):r,u={__v_isVNode:!0,__v_skip:!0,type:t.type,props:c,key:c&&L3(c),ref:e&&e.ref?n&&i?ut(i)?i.concat(qh(e)):[i,qh(e)]:qh(e):i,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:a,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==We?s===-1?16:s|16:s,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:l,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Oa(t.ssContent),ssFallback:t.ssFallback&&Oa(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return l&&o&&Vd(u,l.clone(u)),u}function Ye(t=" ",e=0){return H(am,null,t,e)}function FL(t,e){const n=H(wd,null,t);return n.staticCount=e,n}function ie(t="",e=!1){return e?(w(),Z(wo,null,t)):H(wo,null,t)}function qi(t){return t==null||typeof t=="boolean"?H(wo):ut(t)?H(We,null,t.slice()):Hd(t)?As(t):H(am,null,String(t))}function As(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Oa(t)}function ay(t,e){let n=0;const{shapeFlag:o}=t;if(e==null)e=null;else if(ut(e))n=16;else if(typeof e=="object")if(o&65){const r=e.default;r&&(r._c&&(r._d=!1),ay(t,r()),r._c&&(r._d=!0));return}else{n=32;const r=e._;!r&&!_3(e)?e._ctx=io:r===3&&io&&(io.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else vt(e)?(e={default:e,_ctx:io},n=32):(e=String(e),o&64?(n=16,e=[Ye(e)]):n=8);t.children=e,t.shapeFlag|=n}function Ct(...t){const e={};for(let n=0;n<t.length;n++){const o=t[n];for(const r in o)if(r==="class")e.class!==o.class&&(e.class=Te([e.class,o.class]));else if(r==="style")e.style=Pt([e.style,o.style]);else if(V0(r)){const i=e[r],s=o[r];s&&i!==s&&!(ut(i)&&i.includes(s))&&(e[r]=i?[].concat(i,s):s)}else r!==""&&(e[r]=o[r])}return e}function Ri(t,e,n,o=null){xi(t,e,7,[n,o])}const VL=g3();let zL=0;function HL(t,e,n){const o=t.type,r=(e?e.appContext:t.appContext)||VL,i={uid:zL++,vnode:t,type:o,parent:e,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new wS(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(r.provides),ids:e?e.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:S3(o,r),emitsOptions:b3(o,r),emit:null,emitted:null,propsDefaults:Wt,inheritAttrs:o.inheritAttrs,ctx:Wt,data:Wt,props:Wt,attrs:Wt,slots:Wt,refs:Wt,setupState:Wt,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=e?e.root:i,i.emit=xL.bind(null,i),t.ce&&t.ce(i),i}let _o=null;const Oo=()=>_o||io;let wp,a1;{const t=G0(),e=(n,o)=>{let r;return(r=t[n])||(r=t[n]=[]),r.push(o),i=>{r.length>1?r.forEach(s=>s(i)):r[0](i)}};wp=e("__VUE_INSTANCE_SETTERS__",n=>_o=n),a1=e("__VUE_SSR_SETTERS__",n=>Wd=n)}const kf=t=>{const e=_o;return wp(t),t.scope.on(),()=>{t.scope.off(),wp(e)}},cw=()=>{_o&&_o.scope.off(),wp(null)};function P3(t){return t.vnode.shapeFlag&4}let Wd=!1;function WL(t,e=!1,n=!1){e&&a1(e);const{props:o,children:r}=t.vnode,i=P3(t);CL(t,o,i,e),OL(t,r,n||e);const s=i?UL(t,e):void 0;return e&&a1(!1),s}function UL(t,e){const n=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,fL);const{setup:o}=n;if(o){Ws();const r=t.setupContext=o.length>1?E3(t):null,i=kf(t),s=_f(o,t,0,[t.props,r]),a=pS(s);if(Us(),i(),(a||t.sp)&&!Pc(t)&&i3(t),a){if(s.then(cw,cw),e)return s.then(l=>{uw(t,l)}).catch(l=>{J0(l,t,0)});t.asyncDep=s}else uw(t,s)}else D3(t)}function uw(t,e,n){vt(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:jt(e)&&(t.setupState=VS(e)),D3(t)}function D3(t,e,n){const o=t.type;t.render||(t.render=o.render||fi);{const r=kf(t);Ws();try{hL(t)}finally{Us(),r()}}}const GL={get(t,e){return yo(t,"get",""),t[e]}};function E3(t){const e=n=>{t.exposed=n||{}};return{attrs:new Proxy(t.attrs,GL),slots:t.slots,emit:t.emit,expose:e}}function lm(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(VS(Me(t.exposed)),{get(e,n){if(n in e)return e[n];if(n in xd)return xd[n](t)},has(e,n){return n in e||n in xd}})):t.proxy}function qL(t,e=!0){return vt(t)?t.displayName||t.name:t.name||e&&t.__name}function YL(t){return vt(t)&&"__vccOpts"in t}const A=(t,e)=>q9(t,e,Wd);function Vt(t,e,n){try{xp(-1);const o=arguments.length;return o===2?jt(e)&&!ut(e)?Hd(e)?H(t,null,[e]):H(t,e):H(t,null,e):(o>3?n=Array.prototype.slice.call(arguments,2):o===3&&Hd(n)&&(n=[n]),H(t,e,n))}finally{xp(1)}}const jL="3.5.29";/**
|
|
15
|
+
* @vue/runtime-dom v3.5.29
|
|
16
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
17
|
+
* @license MIT
|
|
18
|
+
**/let l1;const dw=typeof window<"u"&&window.trustedTypes;if(dw)try{l1=dw.createPolicy("vue",{createHTML:t=>t})}catch{}const I3=l1?t=>l1.createHTML(t):t=>t,XL="http://www.w3.org/2000/svg",KL="http://www.w3.org/1998/Math/MathML",ks=typeof document<"u"?document:null,fw=ks&&ks.createElement("template"),ZL={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,o)=>{const r=e==="svg"?ks.createElementNS(XL,t):e==="mathml"?ks.createElementNS(KL,t):n?ks.createElement(t,{is:n}):ks.createElement(t);return t==="select"&&o&&o.multiple!=null&&r.setAttribute("multiple",o.multiple),r},createText:t=>ks.createTextNode(t),createComment:t=>ks.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>ks.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,o,r,i){const s=n?n.previousSibling:e.lastChild;if(r&&(r===i||r.nextSibling))for(;e.insertBefore(r.cloneNode(!0),n),!(r===i||!(r=r.nextSibling)););else{fw.innerHTML=I3(o==="svg"?`<svg>${t}</svg>`:o==="mathml"?`<math>${t}</math>`:t);const a=fw.content;if(o==="svg"||o==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,n)}return[s?s.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}},ca="transition",Vu="animation",Ud=Symbol("_vtc"),N3={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},QL=Vn({},JS,N3),JL=t=>(t.displayName="Transition",t.props=QL,t),Bl=JL((t,{slots:e})=>Vt(rL,eP(t),e)),sl=(t,e=[])=>{ut(t)?t.forEach(n=>n(...e)):t&&t(...e)},hw=t=>t?ut(t)?t.some(e=>e.length>1):t.length>1:!1;function eP(t){const e={};for(const C in t)C in N3||(e[C]=t[C]);if(t.css===!1)return e;const{name:n="v",type:o,duration:r,enterFromClass:i=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=i,appearActiveClass:c=s,appearToClass:u=a,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=t,g=tP(r),v=g&&g[0],m=g&&g[1],{onBeforeEnter:b,onEnter:y,onEnterCancelled:x,onLeave:_,onLeaveCancelled:k,onBeforeAppear:E=b,onAppear:L=y,onAppearCancelled:S=x}=e,B=(C,M,P,$)=>{C._enterCancelled=$,al(C,M?u:a),al(C,M?c:s),P&&P()},D=(C,M)=>{C._isLeaving=!1,al(C,d),al(C,h),al(C,f),M&&M()},N=C=>(M,P)=>{const $=C?L:y,F=()=>B(M,C,P);sl($,[M,F]),pw(()=>{al(M,C?l:i),gs(M,C?u:a),hw($)||mw(M,o,v,F)})};return Vn(e,{onBeforeEnter(C){sl(b,[C]),gs(C,i),gs(C,s)},onBeforeAppear(C){sl(E,[C]),gs(C,l),gs(C,c)},onEnter:N(!1),onAppear:N(!0),onLeave(C,M){C._isLeaving=!0;const P=()=>D(C,M);gs(C,d),C._enterCancelled?(gs(C,f),bw(C)):(bw(C),gs(C,f)),pw(()=>{C._isLeaving&&(al(C,d),gs(C,h),hw(_)||mw(C,o,m,P))}),sl(_,[C,P])},onEnterCancelled(C){B(C,!1,void 0,!0),sl(x,[C])},onAppearCancelled(C){B(C,!0,void 0,!0),sl(S,[C])},onLeaveCancelled(C){D(C),sl(k,[C])}})}function tP(t){if(t==null)return null;if(jt(t))return[Ig(t.enter),Ig(t.leave)];{const e=Ig(t);return[e,e]}}function Ig(t){return f9(t)}function gs(t,e){e.split(/\s+/).forEach(n=>n&&t.classList.add(n)),(t[Ud]||(t[Ud]=new Set)).add(e)}function al(t,e){e.split(/\s+/).forEach(o=>o&&t.classList.remove(o));const n=t[Ud];n&&(n.delete(e),n.size||(t[Ud]=void 0))}function pw(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let nP=0;function mw(t,e,n,o){const r=t._endId=++nP,i=()=>{r===t._endId&&o()};if(n!=null)return setTimeout(i,n);const{type:s,timeout:a,propCount:l}=oP(t,e);if(!s)return o();const c=s+"end";let u=0;const d=()=>{t.removeEventListener(c,f),i()},f=h=>{h.target===t&&++u>=l&&d()};setTimeout(()=>{u<l&&d()},a+1),t.addEventListener(c,f)}function oP(t,e){const n=window.getComputedStyle(t),o=g=>(n[g]||"").split(", "),r=o(`${ca}Delay`),i=o(`${ca}Duration`),s=gw(r,i),a=o(`${Vu}Delay`),l=o(`${Vu}Duration`),c=gw(a,l);let u=null,d=0,f=0;e===ca?s>0&&(u=ca,d=s,f=i.length):e===Vu?c>0&&(u=Vu,d=c,f=l.length):(d=Math.max(s,c),u=d>0?s>c?ca:Vu:null,f=u?u===ca?i.length:l.length:0);const h=u===ca&&/\b(?:transform|all)(?:,|$)/.test(o(`${ca}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:h}}function gw(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max(...e.map((n,o)=>vw(n)+vw(t[o])))}function vw(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function bw(t){return(t?t.ownerDocument:document).body.offsetHeight}function rP(t,e,n){const o=t[Ud];o&&(e=(e?[e,...o]:[...o]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}const _p=Symbol("_vod"),R3=Symbol("_vsh"),qc={name:"show",beforeMount(t,{value:e},{transition:n}){t[_p]=t.style.display==="none"?"":t.style.display,n&&e?n.beforeEnter(t):zu(t,e)},mounted(t,{value:e},{transition:n}){n&&e&&n.enter(t)},updated(t,{value:e,oldValue:n},{transition:o}){!e!=!n&&(o?e?(o.beforeEnter(t),zu(t,!0),o.enter(t)):o.leave(t,()=>{zu(t,!1)}):zu(t,e))},beforeUnmount(t,{value:e}){zu(t,e)}};function zu(t,e){t.style.display=e?t[_p]:"none",t[R3]=!e}const F3=Symbol("");function V3(t){const e=Oo();if(!e)return;const n=e.ut=(r=t(e.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${e.uid}"]`)).forEach(i=>kp(i,r))},o=()=>{const r=t(e.proxy);e.ce?kp(e.ce,r):c1(e.subTree,r),n(r)};l3(()=>{GS(o)}),fn(()=>{qe(o,fi,{flush:"post"});const r=new MutationObserver(o);r.observe(e.subTree.el.parentNode,{childList:!0}),Js(()=>r.disconnect())})}function c1(t,e){if(t.shapeFlag&128){const n=t.suspense;t=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{c1(n.activeBranch,e)})}for(;t.component;)t=t.component.subTree;if(t.shapeFlag&1&&t.el)kp(t.el,e);else if(t.type===We)t.children.forEach(n=>c1(n,e));else if(t.type===wd){let{el:n,anchor:o}=t;for(;n&&(kp(n,e),n!==o);)n=n.nextSibling}}function kp(t,e){if(t.nodeType===1){const n=t.style;let o="";for(const r in e){const i=x9(e[r]);n.setProperty(`--${r}`,i),o+=`--${r}: ${i};`}n[F3]=o}}const iP=/(?:^|;)\s*display\s*:/;function sP(t,e,n){const o=t.style,r=vn(n);let i=!1;if(n&&!r){if(e)if(vn(e))for(const s of e.split(";")){const a=s.slice(0,s.indexOf(":")).trim();n[a]==null&&Yh(o,a,"")}else for(const s in e)n[s]==null&&Yh(o,s,"");for(const s in n)s==="display"&&(i=!0),Yh(o,s,n[s])}else if(r){if(e!==n){const s=o[F3];s&&(n+=";"+s),o.cssText=n,i=iP.test(n)}}else e&&t.removeAttribute("style");_p in t&&(t[_p]=i?o.display:"",t[R3]&&(o.display="none"))}const yw=/\s*!important$/;function Yh(t,e,n){if(ut(n))n.forEach(o=>Yh(t,e,o));else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const o=aP(t,e);yw.test(n)?t.setProperty(Zs(o),n.replace(yw,""),"important"):t[o]=n}}const xw=["Webkit","Moz","ms"],Ng={};function aP(t,e){const n=Ng[e];if(n)return n;let o=Sr(e);if(o!=="filter"&&o in t)return Ng[e]=o;o=W0(o);for(let r=0;r<xw.length;r++){const i=xw[r]+o;if(i in t)return Ng[e]=i}return e}const ww="http://www.w3.org/1999/xlink";function _w(t,e,n,o,r,i=b9(e)){o&&e.startsWith("xlink:")?n==null?t.removeAttributeNS(ww,e.slice(6,e.length)):t.setAttributeNS(ww,e,n):n==null||i&&!bS(n)?t.removeAttribute(e):t.setAttribute(e,i?"":bi(n)?String(n):n)}function kw(t,e,n,o,r){if(e==="innerHTML"||e==="textContent"){n!=null&&(t[e]=e==="innerHTML"?I3(n):n);return}const i=t.tagName;if(e==="value"&&i!=="PROGRESS"&&!i.includes("-")){const a=i==="OPTION"?t.getAttribute("value")||"":t.value,l=n==null?t.type==="checkbox"?"on":"":String(n);(a!==l||!("_value"in t))&&(t.value=l),n==null&&t.removeAttribute(e),t._value=n;return}let s=!1;if(n===""||n==null){const a=typeof t[e];a==="boolean"?n=bS(n):n==null&&a==="string"?(n="",s=!0):a==="number"&&(n=0,s=!0)}try{t[e]=n}catch{}s&&t.removeAttribute(r||e)}function Bs(t,e,n,o){t.addEventListener(e,n,o)}function lP(t,e,n,o){t.removeEventListener(e,n,o)}const Sw=Symbol("_vei");function cP(t,e,n,o,r=null){const i=t[Sw]||(t[Sw]={}),s=i[e];if(o&&s)s.value=o;else{const[a,l]=uP(e);if(o){const c=i[e]=hP(o,r);Bs(t,a,c,l)}else s&&(lP(t,a,s,l),i[e]=void 0)}}const Aw=/(?:Once|Passive|Capture)$/;function uP(t){let e;if(Aw.test(t)){e={};let o;for(;o=t.match(Aw);)t=t.slice(0,t.length-o[0].length),e[o[0].toLowerCase()]=!0}return[t[2]===":"?t.slice(3):Zs(t.slice(2)),e]}let Rg=0;const dP=Promise.resolve(),fP=()=>Rg||(dP.then(()=>Rg=0),Rg=Date.now());function hP(t,e){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;xi(pP(o,n.value),e,5,[o])};return n.value=t,n.attached=fP(),n}function pP(t,e){if(ut(e)){const n=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{n.call(t),t._stopped=!0},e.map(o=>r=>!r._stopped&&o&&o(r))}else return e}const Cw=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,mP=(t,e,n,o,r,i)=>{const s=r==="svg";e==="class"?rP(t,o,s):e==="style"?sP(t,n,o):V0(e)?jb(e)||cP(t,e,n,o,i):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):gP(t,e,o,s))?(kw(t,e,o),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&_w(t,e,o,s,i,e!=="value")):t._isVueCE&&(/[A-Z]/.test(e)||!vn(o))?kw(t,Sr(e),o,i,e):(e==="true-value"?t._trueValue=o:e==="false-value"&&(t._falseValue=o),_w(t,e,o,s))};function gP(t,e,n,o){if(o)return!!(e==="innerHTML"||e==="textContent"||e in t&&Cw(e)&&vt(n));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="sandbox"&&t.tagName==="IFRAME"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const r=t.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return Cw(e)&&vn(n)?!1:e in t}const Ba=t=>{const e=t.props["onUpdate:modelValue"]||!1;return ut(e)?n=>Uh(e,n):e};function vP(t){t.target.composing=!0}function $w(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const zr=Symbol("_assign");function Tw(t,e,n){return e&&(t=t.trim()),n&&(t=U0(t)),t}const Sp={created(t,{modifiers:{lazy:e,trim:n,number:o}},r){t[zr]=Ba(r);const i=o||r.props&&r.props.type==="number";Bs(t,e?"change":"input",s=>{s.target.composing||t[zr](Tw(t.value,n,i))}),(n||i)&&Bs(t,"change",()=>{t.value=Tw(t.value,n,i)}),e||(Bs(t,"compositionstart",vP),Bs(t,"compositionend",$w),Bs(t,"change",$w))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,oldValue:n,modifiers:{lazy:o,trim:r,number:i}},s){if(t[zr]=Ba(s),t.composing)return;const a=(i||t.type==="number")&&!/^0\d/.test(t.value)?U0(t.value):t.value,l=e??"";a!==l&&(document.activeElement===t&&t.type!=="range"&&(o&&e===n||r&&t.value.trim()===l)||(t.value=l))}},z3={deep:!0,created(t,e,n){t[zr]=Ba(n),Bs(t,"change",()=>{const o=t._modelValue,r=Yc(t),i=t.checked,s=t[zr];if(ut(o)){const a=Kb(o,r),l=a!==-1;if(i&&!l)s(o.concat(r));else if(!i&&l){const c=[...o];c.splice(a,1),s(c)}}else if(vu(o)){const a=new Set(o);i?a.add(r):a.delete(r),s(a)}else s(H3(t,i))})},mounted:Mw,beforeUpdate(t,e,n){t[zr]=Ba(n),Mw(t,e,n)}};function Mw(t,{value:e,oldValue:n},o){t._modelValue=e;let r;if(ut(e))r=Kb(e,o.props.value)>-1;else if(vu(e))r=e.has(o.props.value);else{if(e===n)return;r=Ta(e,H3(t,!0))}t.checked!==r&&(t.checked=r)}const bP={created(t,{value:e},n){t.checked=Ta(e,n.props.value),t[zr]=Ba(n),Bs(t,"change",()=>{t[zr](Yc(t))})},beforeUpdate(t,{value:e,oldValue:n},o){t[zr]=Ba(o),e!==n&&(t.checked=Ta(e,o.props.value))}},yP={deep:!0,created(t,{value:e,modifiers:{number:n}},o){const r=vu(e);Bs(t,"change",()=>{const i=Array.prototype.filter.call(t.options,s=>s.selected).map(s=>n?U0(Yc(s)):Yc(s));t[zr](t.multiple?r?new Set(i):i:i[0]),t._assigning=!0,wn(()=>{t._assigning=!1})}),t[zr]=Ba(o)},mounted(t,{value:e}){Ow(t,e)},beforeUpdate(t,e,n){t[zr]=Ba(n)},updated(t,{value:e}){t._assigning||Ow(t,e)}};function Ow(t,e){const n=t.multiple,o=ut(e);if(!(n&&!o&&!vu(e))){for(let r=0,i=t.options.length;r<i;r++){const s=t.options[r],a=Yc(s);if(n)if(o){const l=typeof a;l==="string"||l==="number"?s.selected=e.some(c=>String(c)===String(a)):s.selected=Kb(e,a)>-1}else s.selected=e.has(a);else if(Ta(Yc(s),e)){t.selectedIndex!==r&&(t.selectedIndex=r);return}}!n&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function Yc(t){return"_value"in t?t._value:t.value}function H3(t,e){const n=e?"_trueValue":"_falseValue";return n in t?t[n]:e}const xP=["ctrl","shift","alt","meta"],wP={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>xP.some(n=>t[`${n}Key`]&&!e.includes(n))},gn=(t,e)=>{if(!t)return t;const n=t._withMods||(t._withMods={}),o=e.join(".");return n[o]||(n[o]=((r,...i)=>{for(let s=0;s<e.length;s++){const a=wP[e[s]];if(a&&a(r,e))return}return t(r,...i)}))},_P={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},or=(t,e)=>{const n=t._withKeys||(t._withKeys={}),o=e.join(".");return n[o]||(n[o]=(r=>{if(!("key"in r))return;const i=Zs(r.key);if(e.some(s=>s===i||_P[s]===i))return t(r)}))},kP=Vn({patchProp:mP},ZL);let Bw;function SP(){return Bw||(Bw=LL(kP))}const AP=((...t)=>{const e=SP().createApp(...t),{mount:n}=e;return e.mount=o=>{const r=$P(o);if(!r)return;const i=e._component;!vt(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const s=n(r,!1,CP(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),s},e});function CP(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function $P(t){return vn(t)?document.querySelector(t):t}/*!
|
|
19
|
+
* pinia v3.0.4
|
|
20
|
+
* (c) 2025 Eduardo San Martin Morote
|
|
21
|
+
* @license MIT
|
|
22
|
+
*/let W3;const cm=t=>W3=t,U3=Symbol();function u1(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var kd;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(kd||(kd={}));function TP(){const t=q0(!0),e=t.run(()=>ze({}));let n=[],o=[];const r=Me({install(i){cm(r),r._a=i,i.provide(U3,r),i.config.globalProperties.$pinia=r,o.forEach(s=>n.push(s)),o=[]},use(i){return this._a?n.push(i):o.push(i),this},_p:n,_a:null,_e:t,_s:new Map,state:e});return r}const G3=()=>{};function Lw(t,e,n,o=G3){t.add(e);const r=()=>{t.delete(e)&&o()};return!n&&ql()&&Ma(r),r}function uc(t,...e){t.forEach(n=>{n(...e)})}const MP=t=>t(),Pw=Symbol(),Fg=Symbol();function d1(t,e){t instanceof Map&&e instanceof Map?e.forEach((n,o)=>t.set(o,n)):t instanceof Set&&e instanceof Set&&e.forEach(t.add,t);for(const n in e){if(!e.hasOwnProperty(n))continue;const o=e[n],r=t[n];u1(r)&&u1(o)&&t.hasOwnProperty(n)&&!Xe(o)&&!Ji(o)?t[n]=d1(r,o):t[n]=o}return t}const OP=Symbol();function BP(t){return!u1(t)||!Object.prototype.hasOwnProperty.call(t,OP)}const{assign:ha}=Object;function LP(t){return!!(Xe(t)&&t.effect)}function PP(t,e,n,o){const{state:r,actions:i,getters:s}=e,a=n.state.value[t];let l;function c(){a||(n.state.value[t]=r?r():{});const u=Q0(n.state.value[t]);return ha(u,i,Object.keys(s||{}).reduce((d,f)=>(d[f]=Me(A(()=>{cm(n);const h=n._s.get(t);return s[f].call(h,h)})),d),{}))}return l=q3(t,c,e,n,o,!0),l}function q3(t,e,n={},o,r,i){let s;const a=ha({actions:{}},n),l={deep:!0};let c,u,d=new Set,f=new Set,h;const g=o.state.value[t];!i&&!g&&(o.state.value[t]={});let v;function m(S){let B;c=u=!1,typeof S=="function"?(S(o.state.value[t]),B={type:kd.patchFunction,storeId:t,events:h}):(d1(o.state.value[t],S),B={type:kd.patchObject,payload:S,storeId:t,events:h});const D=v=Symbol();wn().then(()=>{v===D&&(c=!0)}),u=!0,uc(d,B,o.state.value[t])}const b=i?function(){const{state:B}=n,D=B?B():{};this.$patch(N=>{ha(N,D)})}:G3;function y(){s.stop(),d.clear(),f.clear(),o._s.delete(t)}const x=(S,B="")=>{if(Pw in S)return S[Fg]=B,S;const D=function(){cm(o);const N=Array.from(arguments),C=new Set,M=new Set;function P(V){C.add(V)}function $(V){M.add(V)}uc(f,{args:N,name:D[Fg],store:k,after:P,onError:$});let F;try{F=S.apply(this&&this.$id===t?this:k,N)}catch(V){throw uc(M,V),V}return F instanceof Promise?F.then(V=>(uc(C,V),V)).catch(V=>(uc(M,V),Promise.reject(V))):(uc(C,F),F)};return D[Pw]=!0,D[Fg]=B,D},_={_p:o,$id:t,$onAction:Lw.bind(null,f),$patch:m,$reset:b,$subscribe(S,B={}){const D=Lw(d,S,B.detached,()=>N()),N=s.run(()=>qe(()=>o.state.value[t],C=>{(B.flush==="sync"?u:c)&&S({storeId:t,type:kd.direct,events:h},C)},ha({},l,B)));return D},$dispose:y},k=lr(_);o._s.set(t,k);const L=(o._a&&o._a.runWithContext||MP)(()=>o._e.run(()=>(s=q0()).run(()=>e({action:x}))));for(const S in L){const B=L[S];if(Xe(B)&&!LP(B)||Ji(B))i||(g&&BP(B)&&(Xe(B)?B.value=g[S]:d1(B,g[S])),o.state.value[t][S]=B);else if(typeof B=="function"){const D=x(B,S);L[S]=D,a.actions[S]=B}}return ha(k,L),ha(Bt(k),L),Object.defineProperty(k,"$state",{get:()=>o.state.value[t],set:S=>{m(B=>{ha(B,S)})}}),o._p.forEach(S=>{ha(k,s.run(()=>S({store:k,app:o._a,pinia:o,options:a})))}),g&&i&&n.hydrate&&n.hydrate(k.$state,g),c=!0,u=!0,k}/*! #__NO_SIDE_EFFECTS__ */function Bo(t,e,n){let o;const r=typeof e=="function";o=r?n:e;function i(s,a){const l=ty();return s=s||(l?Yt(U3,null):null),s&&cm(s),s=W3,s._s.has(t)||(r?q3(t,e,o,s):PP(t,o,s)),s._s.get(t)}return i.$id=t,i}function $t(t){const e=Bt(t),n={};for(const o in e){const r=e[o];r.effect?n[o]=A({get:()=>t[o],set(i){t[o]=i}}):(Xe(r)||Ji(r))&&(n[o]=zt(t,o))}return n}function DP(t,e){if(t==null)return;let n=t;for(let o=0;o<e.length;o++){if(n===void 0||n[e[o]]===void 0)return;if(n===null||n[e[o]]===null)return null;n=n[e[o]]}return n}function ly(t,e,n){if(n.length===0)return e;const o=n[0];return n.length>1&&(e=ly(typeof t!="object"||t===null||!Object.prototype.hasOwnProperty.call(t,o)?Number.isInteger(Number(n[1]))?[]:{}:t[o],e,Array.prototype.slice.call(n,1))),Number.isInteger(Number(o))&&Array.isArray(t)?t.slice()[o]:Object.assign({},t,{[o]:e})}function Y3(t,e){if(t==null||e.length===0)return t;if(e.length===1){if(t==null)return t;if(Number.isInteger(e[0])&&Array.isArray(t))return Array.prototype.slice.call(t,0).splice(e[0],1);const n={};for(const o in t)n[o]=t[o];return delete n[e[0]],n}if(t[e[0]]==null){if(Number.isInteger(e[0])&&Array.isArray(t))return Array.prototype.concat.call([],t);const n={};for(const o in t)n[o]=t[o];return n}return ly(t,Y3(t[e[0]],Array.prototype.slice.call(e,1)),[e[0]])}function j3(t,e){return e.map(n=>n.split(".")).map(n=>[n,DP(t,n)]).filter(n=>n[1]!==void 0).reduce((n,o)=>ly(n,o[1],o[0]),{})}function X3(t,e){return e.map(n=>n.split(".")).reduce((n,o)=>Y3(n,o),t)}function Dw(t,{storage:e,serializer:n,key:o,debug:r,pick:i,omit:s,beforeHydrate:a,afterHydrate:l},c,u=!0){try{u&&(a==null||a(c));const d=e.getItem(o);if(d){const f=n.deserialize(d),h=i?j3(f,i):f,g=s?X3(h,s):h;t.$patch(g)}u&&(l==null||l(c))}catch(d){r&&console.error("[pinia-plugin-persistedstate]",d)}}function Ew(t,{storage:e,serializer:n,key:o,debug:r,pick:i,omit:s}){try{const a=i?j3(t,i):t,l=s?X3(a,s):a,c=n.serialize(l);e.setItem(o,c)}catch(a){r&&console.error("[pinia-plugin-persistedstate]",a)}}function EP(t,e){return typeof t=="function"?t(e):typeof t=="string"?t:e}function IP(t,e,n){const{pinia:o,store:r,options:{persist:i=n}}=t;if(!i)return;// v8 ignore if -- @preserve
|
|
23
|
+
if(!(r.$id in o.state.value)){const a=o._s.get(r.$id.replace("__hot:",""));a&&Promise.resolve().then(()=>a.$persist());return}const s=(Array.isArray(i)?i:i===!0?[{}]:[i]).map(e);r.$hydrate=({runHooks:a=!0}={})=>{s.forEach(l=>{Dw(r,l,t,a)})},r.$persist=()=>{s.forEach(a=>{Ew(r.$state,a)})},s.forEach(a=>{Dw(r,a,t),r.$subscribe((l,c)=>Ew(c,a),{detached:!0})})}function NP(t={}){return function(e){IP(e,n=>{const o=EP(n.key,e.store.$id);return{key:(t.key?t.key:r=>r)(o),debug:n.debug??t.debug??!1,serializer:n.serializer??t.serializer??{serialize:r=>JSON.stringify(r),deserialize:r=>JSON.parse(r)},storage:n.storage??t.storage??window.localStorage,beforeHydrate:n.beforeHydrate??t.beforeHydrate,afterHydrate:n.afterHydrate??t.afterHydrate,pick:n.pick,omit:n.omit}},t.auto??!1)}}var RP=NP();const cy=(t,e="")=>{const n=`${e}___`;return`___BVN__ID__${t}__${e?n:""}`},Ua=t=>cy(t),Ga=t=>cy(`${t}__plugin`),FP=Ua("checkboxGroup"),K3=Ua("radioGroup"),Z3=Ua("collapse"),Q3=Ga("globalShowHideStorage"),J3=Ua("dropdown"),e4=Ua("navbar"),VP=Ga("rtl"),zP=Ga("breadcrumbPlugin"),t4=Ga("modalManager"),jh=Ga("defaults"),HP=Ua("inputGroup"),n4=Ua("buttonGroup"),WP=Ga("toast"),UP=Ga("modalController"),GP=Ga("popover"),o4=Ua("formGroupPlugin");function Yl(t){return ql()?(Ma(t),!0):!1}function r4(t){let e=0,n,o;const r=()=>{e-=1,o&&e<=0&&(o.stop(),n=void 0,o=void 0)};return(...i)=>(e+=1,o||(o=q0(!0),n=o.run(()=>t(...i))),Yl(r),n)}function qP(t,e){if(typeof Symbol<"u"){const n={...t};return Object.defineProperty(n,Symbol.iterator,{enumerable:!1,value(){let o=0;return{next:()=>({value:e[o++],done:o>e.length})}}}),n}else return Object.assign([...e],t)}function ao(t){return typeof t=="function"?t():p(t)}const i4=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const YP=t=>t!=null,jP=Object.prototype.toString,XP=t=>jP.call(t)==="[object Object]",Ns=()=>{},f1=KP();function KP(){var t,e;return i4&&((t=window==null?void 0:window.navigator)==null?void 0:t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((e=window==null?void 0:window.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function s4(t,e){function n(...o){return new Promise((r,i)=>{Promise.resolve(t(()=>e.apply(this,o),{fn:e,thisArg:this,args:o})).then(r).catch(i)})}return n}function ZP(t,e={}){let n,o,r=Ns;const i=a=>{clearTimeout(a),r(),r=Ns};return a=>{const l=ao(t),c=ao(e.maxWait);return n&&i(n),l<=0||c!==void 0&&c<=0?(o&&(i(o),o=null),Promise.resolve(a())):new Promise((u,d)=>{r=e.rejectOnCancel?d:u,c&&!o&&(o=setTimeout(()=>{n&&i(n),o=null,u(a())},c)),n=setTimeout(()=>{o&&i(o),o=null,u(a())},l)})}}function QP(...t){let e=0,n,o=!0,r=Ns,i,s,a,l,c;!Xe(t[0])&&typeof t[0]=="object"?{delay:s,trailing:a=!0,leading:l=!0,rejectOnCancel:c=!1}=t[0]:[s,a=!0,l=!0,c=!1]=t;const u=()=>{n&&(clearTimeout(n),n=void 0,r(),r=Ns)};return f=>{const h=ao(s),g=Date.now()-e,v=()=>i=f();return u(),h<=0?(e=Date.now(),v()):(g>h&&(l||!o)?(e=Date.now(),v()):a&&(i=new Promise((m,b)=>{r=c?b:m,n=setTimeout(()=>{e=Date.now(),o=!0,m(v()),u()},Math.max(0,h-g))})),!l&&!n&&(n=setTimeout(()=>o=!0,h)),o=!1,i)}}function JP(t){const e=Object.create(null);return n=>e[n]||(e[n]=t(n))}const e7=/-(\w)/g,t7=JP(t=>t.replace(e7,(e,n)=>n?n.toUpperCase():""));function n7(t,e){var n;if(typeof t=="number")return t+e;const o=((n=t.match(/^-?\d+\.?\d*/))==null?void 0:n[0])||"",r=t.slice(o.length),i=Number.parseFloat(o)+e;return Number.isNaN(i)?t:i+r}function o7(...t){if(t.length!==1)return zt(...t);const e=t[0];return typeof e=="function"?so(zS(()=>({get:e,set:Ns}))):ze(e)}function r7(t,e=200,n={}){return s4(ZP(e,n),t)}function Iw(t,e=200,n=!1,o=!0,r=!1){return s4(QP(e,n,o,r),t)}function Ll(t,e={}){const{method:n="parseFloat",radix:o,nanToZero:r}=e;return A(()=>{let i=ao(t);return typeof i=="string"&&(i=Number[n](i,o)),r&&Number.isNaN(i)&&(i=0),i})}function Nw(t={}){const{inheritAttrs:e=!0}=t,n=Re(),o=le({setup(i,{slots:s}){return()=>{n.value=s.default}}}),r=le({inheritAttrs:e,setup(i,{attrs:s,slots:a}){return()=>{var l;n.value;const c=(l=n.value)==null?void 0:l.call(n,{...i7(s),$slots:a});return e&&(c==null?void 0:c.length)===1?c[0]:c}}});return qP({define:o,reuse:r},[o,r])}function i7(t){const e={};for(const n in t)e[t7(n)]=t[n];return e}const jl=i4?window:void 0;function wa(t){var e;const n=ao(t);return(e=n==null?void 0:n.$el)!=null?e:n}function Rr(...t){let e,n,o,r;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,o,r]=t,e=jl):[e,n,o,r]=t,!e)return Ns;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const i=[],s=()=>{i.forEach(u=>u()),i.length=0},a=(u,d,f,h)=>(u.addEventListener(d,f,h),()=>u.removeEventListener(d,f,h)),l=qe(()=>[wa(e),ao(r)],([u,d])=>{if(s(),!u)return;const f=XP(d)?{...d}:d;i.push(...n.flatMap(h=>o.map(g=>a(u,h,g,f))))},{immediate:!0,flush:"post"}),c=()=>{l(),s()};return Yl(c),c}let Rw=!1;function a4(t,e,n={}){const{window:o=jl,ignore:r=[],capture:i=!0,detectIframe:s=!1}=n;if(!o)return Ns;f1&&!Rw&&(Rw=!0,Array.from(o.document.body.children).forEach(v=>v.addEventListener("click",Ns)),o.document.documentElement.addEventListener("click",Ns));let a=!0;const l=v=>ao(r).some(m=>{if(typeof m=="string")return Array.from(o.document.querySelectorAll(m)).some(b=>b===v.target||v.composedPath().includes(b));{const b=wa(m);return b&&(v.target===b||v.composedPath().includes(b))}});function c(v){const m=ao(v);return m&&m.$.subTree.shapeFlag===16}function u(v,m){const b=ao(v),y=b.$.subTree&&b.$.subTree.children;return y==null||!Array.isArray(y)?!1:y.some(x=>x.el===m.target||m.composedPath().includes(x.el))}const d=v=>{const m=wa(t);if(v.target!=null&&!(!(m instanceof Element)&&c(t)&&u(t,v))&&!(!m||m===v.target||v.composedPath().includes(m))){if(v.detail===0&&(a=!l(v)),!a){a=!0;return}e(v)}};let f=!1;const h=[Rr(o,"click",v=>{f||(f=!0,setTimeout(()=>{f=!1},0),d(v))},{passive:!0,capture:i}),Rr(o,"pointerdown",v=>{const m=wa(t);a=!l(v)&&!!(m&&!v.composedPath().includes(m))},{passive:!0}),s&&Rr(o,"blur",v=>{setTimeout(()=>{var m;const b=wa(t);((m=o.document.activeElement)==null?void 0:m.tagName)==="IFRAME"&&!(b!=null&&b.contains(o.document.activeElement))&&e(v)},0)})].filter(Boolean);return()=>h.forEach(v=>v())}function s7(t){return typeof t=="function"?t:typeof t=="string"?e=>e.key===t:Array.isArray(t)?e=>t.includes(e.key):()=>!0}function Cs(...t){let e,n,o={};t.length===3?(e=t[0],n=t[1],o=t[2]):t.length===2?typeof t[1]=="object"?(e=!0,n=t[0],o=t[1]):(e=t[0],n=t[1]):(e=!0,n=t[0]);const{target:r=jl,eventName:i="keydown",passive:s=!1,dedupe:a=!1}=o,l=s7(e);return Rr(r,i,u=>{u.repeat&&ao(a)||l(u)&&n(u)},s)}function a7(){const t=ze(!1),e=Oo();return e&&fn(()=>{t.value=!0},e),t}function l4(t){const e=a7();return A(()=>(e.value,!!t()))}function l7(t,e,n={}){const{window:o=jl,...r}=n;let i;const s=l4(()=>o&&"MutationObserver"in o),a=()=>{i&&(i.disconnect(),i=void 0)},l=A(()=>{const f=ao(t),h=(Array.isArray(f)?f:[f]).map(wa).filter(YP);return new Set(h)}),c=qe(()=>l.value,f=>{a(),s.value&&f.size&&(i=new MutationObserver(e),f.forEach(h=>i.observe(h,r)))},{immediate:!0,flush:"post"}),u=()=>i==null?void 0:i.takeRecords(),d=()=>{c(),a()};return Yl(d),{isSupported:s,stop:d,takeRecords:u}}function Hu(t,e={}){const{window:n=jl}=e,o=l4(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function");let r;const i=ze(!1),s=c=>{i.value=c.matches},a=()=>{r&&("removeEventListener"in r?r.removeEventListener("change",s):r.removeListener(s))},l=em(()=>{o.value&&(a(),r=n.matchMedia(ao(t)),"addEventListener"in r?r.addEventListener("change",s):r.addListener(s),i.value=r.matches)});return Yl(()=>{l(),a(),r=void 0}),i}const c7={xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400};function u7(t,e={}){function n(u,d){let f=ao(t[ao(u)]);return d!=null&&(f=n7(f,d)),typeof f=="number"&&(f=`${f}px`),f}const{window:o=jl,strategy:r="min-width"}=e;function i(u){return o?o.matchMedia(u).matches:!1}const s=u=>Hu(()=>`(min-width: ${n(u)})`,e),a=u=>Hu(()=>`(max-width: ${n(u)})`,e),l=Object.keys(t).reduce((u,d)=>(Object.defineProperty(u,d,{get:()=>r==="min-width"?s(d):a(d),enumerable:!0,configurable:!0}),u),{});function c(){const u=Object.keys(t).map(d=>[d,s(d)]);return A(()=>u.filter(([,d])=>d.value).map(([d])=>d))}return Object.assign(l,{greaterOrEqual:s,smallerOrEqual:a,greater(u){return Hu(()=>`(min-width: ${n(u,.1)})`,e)},smaller(u){return Hu(()=>`(max-width: ${n(u,-.1)})`,e)},between(u,d){return Hu(()=>`(min-width: ${n(u)}) and (max-width: ${n(d,-.1)})`,e)},isGreater(u){return i(`(min-width: ${n(u,.1)})`)},isGreaterOrEqual(u){return i(`(min-width: ${n(u)})`)},isSmaller(u){return i(`(max-width: ${n(u,-.1)})`)},isSmallerOrEqual(u){return i(`(max-width: ${n(u)})`)},isInBetween(u,d){return i(`(min-width: ${n(u)}) and (max-width: ${n(d,-.1)})`)},current:c,active(){const u=c();return A(()=>u.value.length===0?"":u.value.at(-1))}})}const Jf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},eh="__vueuse_ssr_handlers__",d7=f7();function f7(){return eh in Jf||(Jf[eh]=Jf[eh]||{}),Jf[eh]}function h7(t,e){return d7[t]||e}function Xi(t,e={}){const{initialValue:n=!1,focusVisible:o=!1,preventScroll:r=!1}=e,i=ze(!1),s=A(()=>wa(t));Rr(s,"focus",l=>{var c,u;(!o||(u=(c=l.target).matches)!=null&&u.call(c,":focus-visible"))&&(i.value=!0)}),Rr(s,"blur",()=>i.value=!1);const a=A({get:()=>i.value,set(l){var c,u;!l&&i.value?(c=s.value)==null||c.blur():l&&!i.value&&((u=s.value)==null||u.focus({preventScroll:r}))}});return qe(s,()=>{a.value=n},{immediate:!0,flush:"post"}),{focused:a}}function Vg(t){return typeof Window<"u"&&t instanceof Window?t.document.documentElement:typeof Document<"u"&&t instanceof Document?t.documentElement:t}const p7={page:t=>[t.pageX,t.pageY],client:t=>[t.clientX,t.clientY],screen:t=>[t.screenX,t.screenY],movement:t=>t instanceof Touch?null:[t.movementX,t.movementY]};function m7(t={}){const{type:e="page",touch:n=!0,resetOnTouchEnds:o=!1,initialValue:r={x:0,y:0},window:i=jl,target:s=i,scroll:a=!0,eventFilter:l}=t;let c=null,u=0,d=0;const f=ze(r.x),h=ze(r.y),g=ze(null),v=typeof e=="function"?e:p7[e],m=L=>{const S=v(L);c=L,S&&([f.value,h.value]=S,g.value="mouse"),i&&(u=i.scrollX,d=i.scrollY)},b=L=>{if(L.touches.length>0){const S=v(L.touches[0]);S&&([f.value,h.value]=S,g.value="touch")}},y=()=>{if(!c||!i)return;const L=v(c);c instanceof MouseEvent&&L&&(f.value=L[0]+i.scrollX-u,h.value=L[1]+i.scrollY-d)},x=()=>{f.value=r.x,h.value=r.y},_=l?L=>l(()=>m(L),{}):L=>m(L),k=l?L=>l(()=>b(L),{}):L=>b(L),E=l?()=>l(()=>y(),{}):()=>y();if(s){const L={passive:!0};Rr(s,["mousemove","dragover"],_,L),n&&e!=="movement"&&(Rr(s,["touchstart","touchmove"],k,L),o&&Rr(s,"touchend",x,L)),a&&e==="page"&&Rr(i,"scroll",E,{passive:!0})}return{x:f,y:h,sourceType:g}}function c4(t){const e=window.getComputedStyle(t);if(e.overflowX==="scroll"||e.overflowY==="scroll"||e.overflowX==="auto"&&t.clientWidth<t.scrollWidth||e.overflowY==="auto"&&t.clientHeight<t.scrollHeight)return!0;{const n=t.parentNode;return!n||n.tagName==="BODY"?!1:c4(n)}}function g7(t){const e=t||window.event,n=e.target;return c4(n)?!1:e.touches.length>1?!0:(e.preventDefault&&e.preventDefault(),!1)}const zg=new WeakMap;function v7(t,e=!1){const n=ze(e);let o=null,r="";qe(o7(t),a=>{const l=Vg(ao(a));if(l){const c=l;if(zg.get(c)||zg.set(c,c.style.overflow),c.style.overflow!=="hidden"&&(r=c.style.overflow),c.style.overflow==="hidden")return n.value=!0;if(n.value)return c.style.overflow="hidden"}},{immediate:!0});const i=()=>{const a=Vg(ao(t));!a||n.value||(f1&&(o=Rr(a,"touchmove",l=>{g7(l)},{passive:!1})),a.style.overflow="hidden",n.value=!0)},s=()=>{const a=Vg(ao(t));!a||!n.value||(f1&&(o==null||o()),a.style.overflow=r,zg.delete(a),n.value=!1)};return Yl(s),A({get(){return n.value},set(a){a?i():s()}})}const Hg="modal-open",b7=()=>{const t=Yt(t4),e=o=>{t==null||t.removeStack(o),t==null||t.removeRegistry(o)},n=h7("updateHTMLAttrs",(o,r,i)=>{const s=typeof o=="string"?window==null?void 0:window.document.querySelector(o):wa(o);s&&(r==="class"?s.classList.toggle(Hg,i===Hg):s.setAttribute(r,i))});return Yl(()=>{n("body","class","")}),qe(()=>t==null?void 0:t.countStack.value,o=>{o!==void 0&&n("body","class",o>0?Hg:"")}),{...t,dispose:e}},y7=(t,e)=>{const{pushRegistry:n,pushStack:o,removeStack:r,stack:i,dispose:s,countStack:a}=b7(),l=Oo();if(!l||l.type.__name!=="BModal")throw new Error("useModalManager must only use in BModal component");n==null||n(l),Yl(()=>{s(l)});const c=(u,d)=>{u?o==null||o(l):d&&!u&&(r==null||r(l))};return c(e,e),qe(t,c),{activePosition:A(()=>i==null?void 0:i.value.findIndex(u=>{var d,f;return bt((d=u.exposed)==null?void 0:d.id)===bt((f=l.exposed)==null?void 0:f.id)})),activeModalCount:a,stackWithoutSelf:A(()=>(i==null?void 0:i.value.filter(u=>{var d,f;return bt((d=u.exposed)==null?void 0:d.id)!==bt((f=l.exposed)==null?void 0:f.id)}))??[])}},Ap=t=>{if(t)return typeof t=="string"?typeof document>"u"?void 0:document.getElementById(t)??document.querySelector(t)??void 0:t.$el??t},x7=/^[0-9]*\.?[0-9]+$/;function w7(t,e=u4("injectSelf")){const{provides:n}=e;if(n&&t in n)return n[t]}function u4(t,e){const n=Oo();if(!n)throw new Error(`[Bvn] ${t} must be called from inside a setup function`);return n}const _7=(t="")=>t.replace(/[^a-z]/gi,"-").replace(/\B([A-Z])/g,"-$1").toLowerCase(),Fw=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);function d4(t={},e={},n){const o={};for(const r in t)o[r]=t[r];for(const r in e){const i=t[r],s=e[r];if(Fw(i)&&Fw(s)){o[r]=d4(i,s);continue}o[r]=s}return o}const k7=(t,e)=>{var n,o;return typeof((n=t.props)==null?void 0:n[e])<"u"||typeof((o=t.props)==null?void 0:o[_7(e)])<"u"};function S7(t={},e){const n=Yt(jh,ze({})),o=u4("useDefaults");if(e=e??o.type.name??o.type.__name,!e)throw new Error("[Bvn] Could not determine component name");const r=A(()=>{var l;return(l=n.value)==null?void 0:l[t._as??e]}),i=new Proxy(t,{get(l,c){var u,d,f,h;const g=Reflect.get(l,c);return c==="class"||c==="style"?[(u=r.value)==null?void 0:u[c],g].filter(v=>v!=null):typeof c=="string"&&!k7(o.vnode,c)?((d=r.value)==null?void 0:d[c])??((h=(f=n.value)==null?void 0:f.global)==null?void 0:h[c])??g:g}}),s=Re();em(()=>{if(r.value){const l=Object.entries(r.value).filter(([c])=>c.startsWith(c[0].toUpperCase()));s.value=l.length?Object.fromEntries(l):void 0}else s.value=void 0});function a(){const l=w7(jh,o);pi(jh,A(()=>s.value?d4((l==null?void 0:l.value)??{},s.value):l==null?void 0:l.value))}return{props:i,provideSubDefaults:a}}function Ht(t,e){const{props:n,provideSubDefaults:o}=S7(t,e);return o(),n}const ko=(t,e)=>{const n=r3();return A(()=>bt(t)||cy(n||"",e))},um=le({name:"ConditionalTeleport",inheritAttrs:!1,slots:Object,props:{to:{type:[String,Object],default:null},disabled:{type:Boolean,required:!0}},setup(t,{slots:e}){return()=>{var n,o;return t.to?Vt(ny,{to:t.to,disabled:t.disabled||!t.to},[(o=e.default)==null?void 0:o.call(e,{})]):(n=e.default)==null?void 0:n.call(e,{})}}});var A7=Object.defineProperty,C7=(t,e,n)=>e in t?A7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ws=(t,e,n)=>C7(t,typeof e!="symbol"?e+"":e,n);class Cp{constructor(e,n={}){if(ws(this,"cancelable",!0),ws(this,"componentId",null),ws(this,"_defaultPrevented",!1),ws(this,"eventType",""),ws(this,"nativeEvent",null),ws(this,"_preventDefault"),ws(this,"relatedTarget",null),ws(this,"target",null),!e)throw new TypeError(`Failed to construct '${this.constructor.name}'. 1 argument required, ${arguments.length} given.`);Object.assign(this,Cp.Defaults,n,{eventType:e}),this._preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)}}get defaultPrevented(){return this._defaultPrevented}set defaultPrevented(e){this._defaultPrevented=e}get preventDefault(){return this._preventDefault}set preventDefault(e){this._preventDefault=e}static get Defaults(){return{cancelable:!0,componentId:null,eventType:"",nativeEvent:null,relatedTarget:null,target:null}}}class $7 extends Cp{constructor(e,n={}){super(e,n),ws(this,"trigger",null),Object.assign(this,Cp.Defaults,n,{eventType:e})}static get Defaults(){return{...super.Defaults,trigger:null}}}const Vw={name:"fade",enterActiveClass:"",enterFromClass:"showing",enterToClass:"",leaveActiveClass:"",leaveFromClass:"",leaveToClass:"showing",css:!0},dm=(t,e,n,o,r,i={transitionProps:{},showFn:()=>{},hideFn:()=>{}})=>{var s;let a=!1;const l=!!t.value&&!e.initialAnimation||e.visible||!1,c=ze(!1),u=ze(l),d=ze(l);let f=typeof t.value!="boolean";qe(t,()=>{if(f=typeof t.value!="boolean",a){a=!1;return}t.value?y():x()});const h=ze(l),g=ze(!1),v=A(()=>e.noAnimation||e.noFade||h.value||!1);fn(()=>{var te;if(!e.show&&l){const pe=m("show",{cancelable:!0});if(n("show",pe),pe.defaultPrevented){n("show-prevented",m("show-prevented"));return}h.value=!0,t.value||(a=!0,t.value=!0),u.value=!0,d.value=!0,C.value=!0,me.value=!0,de.value=!0,c.value=!0,(te=i.showFn)==null||te.call(i)}else(e.show||t.value&&e.initialAnimation)&&y()}),qe(()=>e.visible,te=>{h.value=!0,wn(()=>{te&&(C.value=!0),te?y():x()})}),qe(()=>e.show,te=>{te?y():x()}),Rr(o,"bv-toggle",()=>{t.value=!t.value});const m=(te,pe={})=>new $7(te,{cancelable:!1,target:(o==null?void 0:o.value)||null,relatedTarget:null,trigger:null,...pe,componentId:r==null?void 0:r.value});let b;const y=()=>{if(c.value)return;const te=m("show",{cancelable:!0});if(n("show",te),te.defaultPrevented){n("show-prevented",m("show-prevented")),C.value&&(C.value=!1),t.value&&!f&&(a=!0,wn(()=>{t.value=!1}));return}u.value=!0,d.value=!0,requestAnimationFrame(()=>{var pe;b=setTimeout(()=>{var we;c.value=!0,(we=i.showFn)==null||we.call(i),t.value||(a=!0,wn(()=>{t.value=!0}))},h.value?0:typeof e.delay=="number"?e.delay:((pe=e.delay)==null?void 0:pe.show)||0)})},x=te=>{var pe;if(!c.value)return;const we=m("hide",{cancelable:!0,trigger:te}),J=m(te||"ignore",{cancelable:!0,trigger:te});if(te==="backdrop"&&e.noCloseOnBackdrop||te==="esc"&&e.noCloseOnEsc){n("hide-prevented",m("hide-prevented"));return}if(b&&(clearTimeout(b),b=void 0),te&&n(te,J),n("hide",we),we.defaultPrevented||J.defaultPrevented){n("hide-prevented",m("hide-prevented")),t.value||wn(()=>{a=!0,t.value=!0});return}setTimeout(()=>{var ge;D.value=!0,c.value=!1,(ge=i.hideFn)==null||ge.call(i),t.value&&(a=!0,t.value=f?0:!1)},h.value?0:typeof e.delay=="number"?e.delay:((pe=e.delay)==null?void 0:pe.hide)||0)},_=Iw(te=>x(te),500),k=Iw(()=>y(),500),E=()=>{const te=m("toggle",{cancelable:!0});if(n("toggle",te),te.defaultPrevented){n("toggle-prevented",m("toggle-prevented"));return}c.value?x():y()},L=(s=Yt(Q3,void 0))==null?void 0:s({id:r.value,toggle:E,show:y,hide:x,value:so(c)});qs(()=>{L==null||L.unregister()});const S=ze(!1),B=()=>{e.lazy===!0&&(S.value=!0)},D=ze(!1),N=ze(!1),C=ze(!1),M=te=>{var pe,we,J,ge;(we=(pe=i.transitionProps)==null?void 0:pe.onBeforeEnter)==null||we.call(pe,te),(ge=(J=e.transitionProps)==null?void 0:J.onBeforeEnter)==null||ge.call(J,te),N.value=!0},P=te=>{var pe,we,J,ge;requestAnimationFrame(()=>{requestAnimationFrame(()=>{C.value=!0})}),(we=(pe=i.transitionProps)==null?void 0:pe.onEnter)==null||we.call(pe,te),(ge=(J=e.transitionProps)==null?void 0:J.onEnter)==null||ge.call(J,te)},$=te=>{var pe,we,J,ge;n("shown",m("shown")),B(),(we=(pe=i.transitionProps)==null?void 0:pe.onAfterEnter)==null||we.call(pe,te),(ge=(J=e.transitionProps)==null?void 0:J.onAfterEnter)==null||ge.call(J,te),h.value&&requestAnimationFrame(()=>{h.value=!1}),g.value&&(g.value=!1)},F=te=>{var pe,we,J,ge;D.value||(D.value=!0),(we=(pe=i.transitionProps)==null?void 0:pe.onBeforeLeave)==null||we.call(pe,te),(ge=(J=e.transitionProps)==null?void 0:J.onBeforeLeave)==null||ge.call(J,te)},V=te=>{var pe,we,J,ge;C.value=!1,(we=(pe=i.transitionProps)==null?void 0:pe.onLeave)==null||we.call(pe,te),(ge=(J=e.transitionProps)==null?void 0:J.onLeave)==null||ge.call(J,te)},U=te=>{var pe,we,J,ge;n("hidden",m("hidden")),(we=(pe=i.transitionProps)==null?void 0:pe.onAfterLeave)==null||we.call(pe,te),(ge=(J=e.transitionProps)==null?void 0:J.onAfterLeave)==null||ge.call(J,te),D.value=!1,N.value=!1,h.value&&requestAnimationFrame(()=>{h.value=!1}),requestAnimationFrame(()=>{g.value||(u.value=!1)})},K=A(()=>g.value===!0||N.value===!0||e.lazy===!1||e.lazy===!0&&S.value===!0&&e.unmountLazy===!1),ae=ze(!1);qe(C,te=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{setTimeout(()=>{ae.value=te},32)})})})})});const me=ze(!1),de=ze(!1),ve={...i.transitionProps,onBeforeEnter:M,onEnter:P,onAfterEnter:$,onBeforeLeave:F,onLeave:V,onAfterLeave:U};return{showRef:c,renderRef:u,renderBackdropRef:d,isVisible:C,isActive:N,trapActive:ae,show:y,hide:x,toggle:E,throttleHide:_,throttleShow:k,buildTriggerableEvent:m,computedNoAnimation:v,localNoAnimation:h,localTemporaryHide:g,isLeaving:D,transitionProps:{...Vw,...e.transitionProps,...ve},lazyLoadCompleted:S,markLazyLoadCompleted:B,contentShowing:K,backdropReady:de,backdropVisible:me,backdropTransitionProps:{...Vw,onBeforeEnter:()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{me.value=!0})}),de.value=!1},onAfterEnter:()=>{de.value=!0},onBeforeLeave:()=>{me.value=!1},onAfterLeave:()=>{de.value=!1,requestAnimationFrame(()=>{d.value=!1})}}}},fm=(t,e)=>{const n=t.__vccOpts||t;for(const[o,r]of e)n[o]=r;return n},f4=["top","right","bottom","left"],zw=["start","end"],Hw=f4.reduce((t,e)=>t.concat(e,e+"-"+zw[0],e+"-"+zw[1]),[]),_i=Math.min,xo=Math.max,$p=Math.round,th=Math.floor,es=t=>({x:t,y:t}),T7={left:"right",right:"left",bottom:"top",top:"bottom"},M7={start:"end",end:"start"};function h1(t,e,n){return xo(t,_i(e,n))}function ea(t,e){return typeof t=="function"?t(e):t}function qr(t){return t.split("-")[0]}function mi(t){return t.split("-")[1]}function h4(t){return t==="x"?"y":"x"}function uy(t){return t==="y"?"height":"width"}function La(t){return["top","bottom"].includes(qr(t))?"y":"x"}function dy(t){return h4(La(t))}function p4(t,e,n){n===void 0&&(n=!1);const o=mi(t),r=dy(t),i=uy(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=Mp(s)),[s,Mp(s)]}function O7(t){const e=Mp(t);return[Tp(t),e,Tp(e)]}function Tp(t){return t.replace(/start|end/g,e=>M7[e])}function B7(t,e,n){const o=["left","right"],r=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?r:o:e?o:r;case"left":case"right":return e?i:s;default:return[]}}function L7(t,e,n,o){const r=mi(t);let i=B7(qr(t),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),e&&(i=i.concat(i.map(Tp)))),i}function Mp(t){return t.replace(/left|right|bottom|top/g,e=>T7[e])}function P7(t){return{top:0,right:0,bottom:0,left:0,...t}}function fy(t){return typeof t!="number"?P7(t):{top:t,right:t,bottom:t,left:t}}function jc(t){const{x:e,y:n,width:o,height:r}=t;return{width:o,height:r,top:n,left:e,right:e+o,bottom:n+r,x:e,y:n}}function Ww(t,e,n){let{reference:o,floating:r}=t;const i=La(e),s=dy(e),a=uy(s),l=qr(e),c=i==="y",u=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,f=o[a]/2-r[a]/2;let h;switch(l){case"top":h={x:u,y:o.y-r.height};break;case"bottom":h={x:u,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:d};break;case"left":h={x:o.x-r.width,y:d};break;default:h={x:o.x,y:o.y}}switch(mi(e)){case"start":h[s]-=f*(n&&c?-1:1);break;case"end":h[s]+=f*(n&&c?-1:1);break}return h}const D7=async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:r}),{x:u,y:d}=Ww(c,o,l),f=o,h={},g=0;for(let v=0;v<a.length;v++){const{name:m,fn:b}=a[v],{x:y,y:x,data:_,reset:k}=await b({x:u,y:d,initialPlacement:o,placement:f,strategy:r,middlewareData:h,rects:c,platform:s,elements:{reference:t,floating:e}});u=y??u,d=x??d,h={...h,[m]:{...h[m],..._}},k&&g<=50&&(g++,typeof k=="object"&&(k.placement&&(f=k.placement),k.rects&&(c=k.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:r}):k.rects),{x:u,y:d}=Ww(c,f,l)),v=-1)}return{x:u,y:d,placement:f,strategy:r,middlewareData:h}};async function Xc(t,e){var n;e===void 0&&(e={});const{x:o,y:r,platform:i,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=ea(e,t),g=fy(h),m=a[f?d==="floating"?"reference":"floating":d],b=jc(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),y=d==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),_=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},k=jc(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:x,strategy:l}):y);return{top:(b.top-k.top+g.top)/_.y,bottom:(k.bottom-b.bottom+g.bottom)/_.y,left:(b.left-k.left+g.left)/_.x,right:(k.right-b.right+g.right)/_.x}}const E7=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:r,rects:i,platform:s,elements:a,middlewareData:l}=e,{element:c,padding:u=0}=ea(t,e)||{};if(c==null)return{};const d=fy(u),f={x:n,y:o},h=dy(r),g=uy(h),v=await s.getDimensions(c),m=h==="y",b=m?"top":"left",y=m?"bottom":"right",x=m?"clientHeight":"clientWidth",_=i.reference[g]+i.reference[h]-f[h]-i.floating[g],k=f[h]-i.reference[h],E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let L=E?E[x]:0;(!L||!await(s.isElement==null?void 0:s.isElement(E)))&&(L=a.floating[x]||i.floating[g]);const S=_/2-k/2,B=L/2-v[g]/2-1,D=_i(d[b],B),N=_i(d[y],B),C=D,M=L-v[g]-N,P=L/2-v[g]/2+S,$=h1(C,P,M),F=!l.arrow&&mi(r)!=null&&P!==$&&i.reference[g]/2-(P<C?D:N)-v[g]/2<0,V=F?P<C?P-C:P-M:0;return{[h]:f[h]+V,data:{[h]:$,centerOffset:P-$-V,...F&&{alignmentOffset:V}},reset:F}}});function I7(t,e,n){return(t?[...n.filter(r=>mi(r)===t),...n.filter(r=>mi(r)!==t)]:n.filter(r=>qr(r)===r)).filter(r=>t?mi(r)===t||(e?Tp(r)!==r:!1):!0)}const N7=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,r;const{rects:i,middlewareData:s,placement:a,platform:l,elements:c}=e,{crossAxis:u=!1,alignment:d,allowedPlacements:f=Hw,autoAlignment:h=!0,...g}=ea(t,e),v=d!==void 0||f===Hw?I7(d||null,h,f):f,m=await Xc(e,g),b=((n=s.autoPlacement)==null?void 0:n.index)||0,y=v[b];if(y==null)return{};const x=p4(y,i,await(l.isRTL==null?void 0:l.isRTL(c.floating)));if(a!==y)return{reset:{placement:v[0]}};const _=[m[qr(y)],m[x[0]],m[x[1]]],k=[...((o=s.autoPlacement)==null?void 0:o.overflows)||[],{placement:y,overflows:_}],E=v[b+1];if(E)return{data:{index:b+1,overflows:k},reset:{placement:E}};const L=k.map(D=>{const N=mi(D.placement);return[D.placement,N&&u?D.overflows.slice(0,2).reduce((C,M)=>C+M,0):D.overflows[0],D.overflows]}).sort((D,N)=>D[1]-N[1]),B=((r=L.filter(D=>D[2].slice(0,mi(D[0])?2:3).every(N=>N<=0))[0])==null?void 0:r[0])||L[0][0];return B!==a?{data:{index:b+1,overflows:k},reset:{placement:B}}:{}}}},R7=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...m}=ea(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const b=qr(r),y=La(a),x=qr(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(c.floating)),k=f||(x||!v?[Mp(a)]:O7(a)),E=g!=="none";!f&&E&&k.push(...L7(a,v,g,_));const L=[a,...k],S=await Xc(e,m),B=[];let D=((o=i.flip)==null?void 0:o.overflows)||[];if(u&&B.push(S[b]),d){const P=p4(r,s,_);B.push(S[P[0]],S[P[1]])}if(D=[...D,{placement:r,overflows:B}],!B.every(P=>P<=0)){var N,C;const P=(((N=i.flip)==null?void 0:N.index)||0)+1,$=L[P];if($)return{data:{index:P,overflows:D},reset:{placement:$}};let F=(C=D.filter(V=>V.overflows[0]<=0).sort((V,U)=>V.overflows[1]-U.overflows[1])[0])==null?void 0:C.placement;if(!F)switch(h){case"bestFit":{var M;const V=(M=D.filter(U=>{if(E){const K=La(U.placement);return K===y||K==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(K=>K>0).reduce((K,ae)=>K+ae,0)]).sort((U,K)=>U[1]-K[1])[0])==null?void 0:M[0];V&&(F=V);break}case"initialPlacement":F=a;break}if(r!==F)return{reset:{placement:F}}}return{}}}};function Uw(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Gw(t){return f4.some(e=>t[e]>=0)}const F7=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...r}=ea(t,e);switch(o){case"referenceHidden":{const i=await Xc(e,{...r,elementContext:"reference"}),s=Uw(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Gw(s)}}}case"escaped":{const i=await Xc(e,{...r,altBoundary:!0}),s=Uw(i,n.floating);return{data:{escapedOffsets:s,escaped:Gw(s)}}}default:return{}}}}};function m4(t){const e=_i(...t.map(i=>i.left)),n=_i(...t.map(i=>i.top)),o=xo(...t.map(i=>i.right)),r=xo(...t.map(i=>i.bottom));return{x:e,y:n,width:o-e,height:r-n}}function V7(t){const e=t.slice().sort((r,i)=>r.y-i.y),n=[];let o=null;for(let r=0;r<e.length;r++){const i=e[r];!o||i.y-o.y>o.height/2?n.push([i]):n[n.length-1].push(i),o=i}return n.map(r=>jc(m4(r)))}const z7=function(t){return t===void 0&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:o,rects:r,platform:i,strategy:s}=e,{padding:a=2,x:l,y:c}=ea(t,e),u=Array.from(await(i.getClientRects==null?void 0:i.getClientRects(o.reference))||[]),d=V7(u),f=jc(m4(u)),h=fy(a);function g(){if(d.length===2&&d[0].left>d[1].right&&l!=null&&c!=null)return d.find(m=>l>m.left-h.left&&l<m.right+h.right&&c>m.top-h.top&&c<m.bottom+h.bottom)||f;if(d.length>=2){if(La(n)==="y"){const D=d[0],N=d[d.length-1],C=qr(n)==="top",M=D.top,P=N.bottom,$=C?D.left:N.left,F=C?D.right:N.right,V=F-$,U=P-M;return{top:M,bottom:P,left:$,right:F,width:V,height:U,x:$,y:M}}const m=qr(n)==="left",b=xo(...d.map(D=>D.right)),y=_i(...d.map(D=>D.left)),x=d.filter(D=>m?D.left===y:D.right===b),_=x[0].top,k=x[x.length-1].bottom,E=y,L=b,S=L-E,B=k-_;return{top:_,bottom:k,left:E,right:L,width:S,height:B,x:E,y:_}}return f}const v=await i.getElementRects({reference:{getBoundingClientRect:g},floating:o.floating,strategy:s});return r.reference.x!==v.reference.x||r.reference.y!==v.reference.y||r.reference.width!==v.reference.width||r.reference.height!==v.reference.height?{reset:{rects:v}}:{}}}};async function H7(t,e){const{placement:n,platform:o,elements:r}=t,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=qr(n),a=mi(n),l=La(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=ea(e,t);let{mainAxis:f,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}const W7=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:r,y:i,placement:s,middlewareData:a}=e,l=await H7(e,t);return s===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:s}}}}},U7=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:r}=e,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:m=>{let{x:b,y}=m;return{x:b,y}}},...l}=ea(t,e),c={x:n,y:o},u=await Xc(e,l),d=La(qr(r)),f=h4(d);let h=c[f],g=c[d];if(i){const m=f==="y"?"top":"left",b=f==="y"?"bottom":"right",y=h+u[m],x=h-u[b];h=h1(y,h,x)}if(s){const m=d==="y"?"top":"left",b=d==="y"?"bottom":"right",y=g+u[m],x=g-u[b];g=h1(y,g,x)}const v=a.fn({...e,[f]:h,[d]:g});return{...v,data:{x:v.x-n,y:v.y-o,enabled:{[f]:i,[d]:s}}}}}},G7=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:r,rects:i,platform:s,elements:a}=e,{apply:l=()=>{},...c}=ea(t,e),u=await Xc(e,c),d=qr(r),f=mi(r),h=La(r)==="y",{width:g,height:v}=i.floating;let m,b;d==="top"||d==="bottom"?(m=d,b=f===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(b=d,m=f==="end"?"top":"bottom");const y=v-u.top-u.bottom,x=g-u.left-u.right,_=_i(v-u[m],y),k=_i(g-u[b],x),E=!e.middlewareData.shift;let L=_,S=k;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(S=x),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(L=y),E&&!f){const D=xo(u.left,0),N=xo(u.right,0),C=xo(u.top,0),M=xo(u.bottom,0);h?S=g-2*(D!==0||N!==0?D+N:xo(u.left,u.right)):L=v-2*(C!==0||M!==0?C+M:xo(u.top,u.bottom))}await l({...e,availableWidth:S,availableHeight:L});const B=await s.getDimensions(a.floating);return g!==B.width||v!==B.height?{reset:{rects:!0}}:{}}}};function hm(){return typeof window<"u"}function Xl(t){return hy(t)?(t.nodeName||"").toLowerCase():"#document"}function _r(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function us(t){var e;return(e=(hy(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function hy(t){return hm()?t instanceof Node||t instanceof _r(t).Node:!1}function ki(t){return hm()?t instanceof Element||t instanceof _r(t).Element:!1}function is(t){return hm()?t instanceof HTMLElement||t instanceof _r(t).HTMLElement:!1}function qw(t){return!hm()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof _r(t).ShadowRoot}function Sf(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=Si(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(r)}function q7(t){return["table","td","th"].includes(Xl(t))}function pm(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function py(t){const e=my(),n=ki(t)?Si(t):t;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Y7(t){let e=Pa(t);for(;is(e)&&!Kc(e);){if(py(e))return e;if(pm(e))return null;e=Pa(e)}return null}function my(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Kc(t){return["html","body","#document"].includes(Xl(t))}function Si(t){return _r(t).getComputedStyle(t)}function mm(t){return ki(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Pa(t){if(Xl(t)==="html")return t;const e=t.assignedSlot||t.parentNode||qw(t)&&t.host||us(t);return qw(e)?e.host:e}function g4(t){const e=Pa(t);return Kc(e)?t.ownerDocument?t.ownerDocument.body:t.body:is(e)&&Sf(e)?e:g4(e)}function Gd(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=g4(t),i=r===((o=t.ownerDocument)==null?void 0:o.body),s=_r(r);if(i){const a=p1(s);return e.concat(s,s.visualViewport||[],Sf(r)?r:[],a&&n?Gd(a):[])}return e.concat(r,Gd(r,[],n))}function p1(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function v4(t){const e=Si(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=is(t),i=r?t.offsetWidth:n,s=r?t.offsetHeight:o,a=$p(n)!==i||$p(o)!==s;return a&&(n=i,o=s),{width:n,height:o,$:a}}function gy(t){return ki(t)?t:t.contextElement}function Dc(t){const e=gy(t);if(!is(e))return es(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:i}=v4(e);let s=(i?$p(n.width):n.width)/o,a=(i?$p(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const j7=es(0);function b4(t){const e=_r(t);return!my()||!e.visualViewport?j7:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function X7(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==_r(t)?!1:e}function Pl(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=gy(t);let s=es(1);e&&(o?ki(o)&&(s=Dc(o)):s=Dc(t));const a=X7(i,n,o)?b4(i):es(0);let l=(r.left+a.x)/s.x,c=(r.top+a.y)/s.y,u=r.width/s.x,d=r.height/s.y;if(i){const f=_r(i),h=o&&ki(o)?_r(o):o;let g=f,v=p1(g);for(;v&&o&&h!==g;){const m=Dc(v),b=v.getBoundingClientRect(),y=Si(v),x=b.left+(v.clientLeft+parseFloat(y.paddingLeft))*m.x,_=b.top+(v.clientTop+parseFloat(y.paddingTop))*m.y;l*=m.x,c*=m.y,u*=m.x,d*=m.y,l+=x,c+=_,g=_r(v),v=p1(g)}}return jc({width:u,height:d,x:l,y:c})}function vy(t,e){const n=mm(t).scrollLeft;return e?e.left+n:Pl(us(t)).left+n}function y4(t,e,n){n===void 0&&(n=!1);const o=t.getBoundingClientRect(),r=o.left+e.scrollLeft-(n?0:vy(t,o)),i=o.top+e.scrollTop;return{x:r,y:i}}function K7(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const i=r==="fixed",s=us(o),a=e?pm(e.floating):!1;if(o===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=es(1);const u=es(0),d=is(o);if((d||!d&&!i)&&((Xl(o)!=="body"||Sf(s))&&(l=mm(o)),is(o))){const h=Pl(o);c=Dc(o),u.x=h.x+o.clientLeft,u.y=h.y+o.clientTop}const f=s&&!d&&!i?y4(s,l,!0):es(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}}function Z7(t){return Array.from(t.getClientRects())}function Q7(t){const e=us(t),n=mm(t),o=t.ownerDocument.body,r=xo(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=xo(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+vy(t);const a=-n.scrollTop;return Si(o).direction==="rtl"&&(s+=xo(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:a}}function J7(t,e){const n=_r(t),o=us(t),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,a=0,l=0;if(r){i=r.width,s=r.height;const c=my();(!c||c&&e==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}return{width:i,height:s,x:a,y:l}}function eD(t,e){const n=Pl(t,!0,e==="fixed"),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=is(t)?Dc(t):es(1),s=t.clientWidth*i.x,a=t.clientHeight*i.y,l=r*i.x,c=o*i.y;return{width:s,height:a,x:l,y:c}}function Yw(t,e,n){let o;if(e==="viewport")o=J7(t,n);else if(e==="document")o=Q7(us(t));else if(ki(e))o=eD(e,n);else{const r=b4(t);o={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return jc(o)}function x4(t,e){const n=Pa(t);return n===e||!ki(n)||Kc(n)?!1:Si(n).position==="fixed"||x4(n,e)}function tD(t,e){const n=e.get(t);if(n)return n;let o=Gd(t,[],!1).filter(a=>ki(a)&&Xl(a)!=="body"),r=null;const i=Si(t).position==="fixed";let s=i?Pa(t):t;for(;ki(s)&&!Kc(s);){const a=Si(s),l=py(s);!l&&a.position==="fixed"&&(r=null),(i?!l&&!r:!l&&a.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||Sf(s)&&!l&&x4(t,s))?o=o.filter(u=>u!==s):r=a,s=Pa(s)}return e.set(t,o),o}function nD(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const s=[...n==="clippingAncestors"?pm(e)?[]:tD(e,this._c):[].concat(n),o],a=s[0],l=s.reduce((c,u)=>{const d=Yw(e,u,r);return c.top=xo(d.top,c.top),c.right=_i(d.right,c.right),c.bottom=_i(d.bottom,c.bottom),c.left=xo(d.left,c.left),c},Yw(e,a,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function oD(t){const{width:e,height:n}=v4(t);return{width:e,height:n}}function rD(t,e,n){const o=is(e),r=us(e),i=n==="fixed",s=Pl(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const l=es(0);if(o||!o&&!i)if((Xl(e)!=="body"||Sf(r))&&(a=mm(e)),o){const f=Pl(e,!0,i,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else r&&(l.x=vy(r));const c=r&&!o&&!i?y4(r,a):es(0),u=s.left+a.scrollLeft-l.x-c.x,d=s.top+a.scrollTop-l.y-c.y;return{x:u,y:d,width:s.width,height:s.height}}function Wg(t){return Si(t).position==="static"}function jw(t,e){if(!is(t)||Si(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return us(t)===n&&(n=n.ownerDocument.body),n}function w4(t,e){const n=_r(t);if(pm(t))return n;if(!is(t)){let r=Pa(t);for(;r&&!Kc(r);){if(ki(r)&&!Wg(r))return r;r=Pa(r)}return n}let o=jw(t,e);for(;o&&q7(o)&&Wg(o);)o=jw(o,e);return o&&Kc(o)&&Wg(o)&&!py(o)?n:o||Y7(t)||n}const iD=async function(t){const e=this.getOffsetParent||w4,n=this.getDimensions,o=await n(t.floating);return{reference:rD(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function sD(t){return Si(t).direction==="rtl"}const aD={convertOffsetParentRelativeRectToViewportRelativeRect:K7,getDocumentElement:us,getClippingRect:nD,getOffsetParent:w4,getElementRects:iD,getClientRects:Z7,getDimensions:oD,getScale:Dc,isElement:ki,isRTL:sD};function lD(t,e){let n=null,o;const r=us(t);function i(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const{left:c,top:u,width:d,height:f}=t.getBoundingClientRect();if(a||e(),!d||!f)return;const h=th(u),g=th(r.clientWidth-(c+d)),v=th(r.clientHeight-(u+f)),m=th(c),y={rootMargin:-h+"px "+-g+"px "+-v+"px "+-m+"px",threshold:xo(0,_i(1,l))||1};let x=!0;function _(k){const E=k[0].intersectionRatio;if(E!==l){if(!x)return s();E?s(!1,E):o=setTimeout(()=>{s(!1,1e-7)},1e3)}x=!1}try{n=new IntersectionObserver(_,{...y,root:r.ownerDocument})}catch{n=new IntersectionObserver(_,y)}n.observe(t)}return s(!0),i}function _4(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,c=gy(t),u=r||i?[...c?Gd(c):[],...Gd(e)]:[];u.forEach(b=>{r&&b.addEventListener("scroll",n,{passive:!0}),i&&b.addEventListener("resize",n)});const d=c&&a?lD(c,n):null;let f=-1,h=null;s&&(h=new ResizeObserver(b=>{let[y]=b;y&&y.target===c&&h&&(h.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(e)})),n()}),c&&!l&&h.observe(c),h.observe(e));let g,v=l?Pl(t):null;l&&m();function m(){const b=Pl(t);v&&(b.x!==v.x||b.y!==v.y||b.width!==v.width||b.height!==v.height)&&n(),v=b,g=requestAnimationFrame(m)}return n(),()=>{var b;u.forEach(y=>{r&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),d==null||d(),(b=h)==null||b.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const k4=W7,cD=N7,S4=U7,A4=R7,C4=G7,uD=F7,dD=E7,fD=z7,hD=(t,e,n)=>{const o=new Map,r={platform:aD,...n},i={...r.platform,_c:o};return D7(t,e,{...r,platform:i})};function pD(t){return t!=null&&typeof t=="object"&&"$el"in t}function m1(t){if(pD(t)){const e=t.$el;return hy(e)&&Xl(e)==="#comment"?null:e}return t}function wc(t){return typeof t=="function"?t():p(t)}function mD(t){return{name:"arrow",options:t,fn(e){const n=m1(wc(t.element));return n==null?{}:dD({element:n,padding:t.padding}).fn(e)}}}function $4(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Xw(t,e){const n=$4(t);return Math.round(e*n)/n}function T4(t,e,n){n===void 0&&(n={});const o=n.whileElementsMounted,r=A(()=>{var L;return(L=wc(n.open))!=null?L:!0}),i=A(()=>wc(n.middleware)),s=A(()=>{var L;return(L=wc(n.placement))!=null?L:"bottom"}),a=A(()=>{var L;return(L=wc(n.strategy))!=null?L:"absolute"}),l=A(()=>{var L;return(L=wc(n.transform))!=null?L:!0}),c=A(()=>m1(t.value)),u=A(()=>m1(e.value)),d=ze(0),f=ze(0),h=ze(a.value),g=ze(s.value),v=Re({}),m=ze(!1),b=A(()=>{const L={position:h.value,left:"0",top:"0"};if(!u.value)return L;const S=Xw(u.value,d.value),B=Xw(u.value,f.value);return l.value?{...L,transform:"translate("+S+"px, "+B+"px)",...$4(u.value)>=1.5&&{willChange:"transform"}}:{position:h.value,left:S+"px",top:B+"px"}});let y;function x(){if(c.value==null||u.value==null)return;const L=r.value;hD(c.value,u.value,{middleware:i.value,placement:s.value,strategy:a.value}).then(S=>{d.value=S.x,f.value=S.y,h.value=S.strategy,g.value=S.placement,v.value=S.middlewareData,m.value=L!==!1})}function _(){typeof y=="function"&&(y(),y=void 0)}function k(){if(_(),o===void 0){x();return}if(c.value!=null&&u.value!=null){y=o(c.value,u.value,x);return}}function E(){r.value||(m.value=!1)}return qe([i,s,a,r],x,{flush:"sync"}),qe([c,u],k,{flush:"sync"}),qe(r,E,{flush:"sync"}),ql()&&Ma(_),{x:dl(d),y:dl(f),strategy:dl(h),placement:dl(g),middlewareData:dl(v),isPositioned:dl(m),floatingStyles:b,update:x}}const gD=r4(m7),vD=["id"],bD=["id"],yD=le({inheritAttrs:!1,__name:"BPopover",props:st({boundary:{default:"clippingAncestors"},boundaryPadding:{default:void 0},click:{type:Boolean,default:!1},closeOnHide:{type:Boolean,default:!1},content:{default:void 0},customClass:{default:""},delay:{default:()=>({show:100,hide:300})},floatingMiddleware:{default:void 0},hideMargin:{default:2},id:{default:void 0},inline:{type:Boolean,default:!1},manual:{type:Boolean,default:!1},noAutoClose:{type:Boolean,default:!1},noFlip:{type:Boolean,default:!1},noHide:{type:Boolean,default:!1},noShift:{type:Boolean,default:!1},noSize:{type:Boolean,default:!1},noninteractive:{type:Boolean,default:!1},offset:{default:null},placement:{default:"top"},realtime:{type:Boolean,default:!1},reference:{default:null},strategy:{default:"absolute"},target:{default:null},title:{default:void 0},tooltip:{type:Boolean,default:!1},variant:{default:null},teleportDisabled:{type:Boolean,default:!1},teleportTo:{default:void 0},initialAnimation:{type:Boolean,default:!1},noAnimation:{type:Boolean},noFade:{type:Boolean,default:!1},lazy:{type:Boolean,default:!1},unmountLazy:{type:Boolean,default:!1},show:{type:Boolean,default:!1},transProps:{},visible:{type:Boolean,default:!1}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:st(["pointerleave","blur","click-outside","close-on-hide","hide","hide-prevented","hidden","show","show-prevented","shown","toggle","toggle-prevented"],["update:modelValue"]),setup(t,{expose:e,emit:n}){const r=Ht(t,"BPopover"),i=n,s=cs(),a=ft(t,"modelValue"),l=ko(()=>r.id,"popover"),c=ze(!1),u=ht("_element"),d=ht("_content"),f=ht("_arrow"),h=ht("_placeholder"),g=ze(null),v=ze(null),m=A(()=>r.placement.startsWith("auto")),b=Ll(()=>r.offset??NaN),y=A(()=>by(r.boundary)?r.boundary:void 0),x=A(()=>O4(r.boundary)?r.boundary:void 0),_=ze({}),k=A(()=>{if(r.floatingMiddleware!==void 0)return r.floatingMiddleware;const G=r.offset!==null?b.value:r.tooltip?6:8,Y=[k4(G)];return r.noFlip===!1&&!m.value&&Y.push(A4({boundary:y.value,rootBoundary:x.value,padding:r.boundaryPadding})),m.value&&Y.push(cD({alignment:r.placement.split("-")[1]||void 0,boundary:y.value,rootBoundary:x.value,padding:r.boundaryPadding})),r.noShift===!1&&Y.push(S4({boundary:y.value,rootBoundary:x.value,padding:r.boundaryPadding})),r.noHide===!1&&Y.push(uD({boundary:y.value,rootBoundary:x.value,padding:r.boundaryPadding})),r.inline===!0&&Y.push(fD()),Y.push(mD({element:f,padding:10})),r.noSize===!1&&Y.push(C4({boundary:y.value,rootBoundary:x.value,padding:r.boundaryPadding,apply({availableWidth:se,availableHeight:fe}){var ne,Q;_.value={maxHeight:fe>=(((ne=d.value)==null?void 0:ne.scrollHeight)??0)?void 0:fe?`${Math.max(0,fe)}px`:void 0,maxWidth:se>=(((Q=d.value)==null?void 0:Q.scrollWidth)??0)?void 0:se?`${Math.max(0,se)}px`:void 0}}})),Y}),E=A(()=>m.value?void 0:r.placement),{floatingStyles:L,middlewareData:S,placement:B,update:D}=T4(g,u,{placement:E,middleware:k,strategy:zt(()=>r.strategy)}),N=ze({position:"absolute"});qe(S,G=>{var Y,se;if(r.noHide===!1&&((Y=G.hide)!=null&&Y.referenceHidden&&!c.value&&M.value?r.closeOnHide&&!r.noAutoClose&&!r.manual?V("close-on-hide"):(ve.value=!0,c.value=!0):ve.value&&!((se=G.hide)!=null&&se.referenceHidden)&&(ve.value=!1,c.value=!1)),G.arrow){const{x:fe,y:ne}=G.arrow;N.value={position:"absolute",top:ne?`${ne}px`:"",left:fe?`${fe}px`:""}}});let C;const{showRef:M,hide:P,show:$,toggle:F,throttleHide:V,computedNoAnimation:U,transitionProps:K,contentShowing:ae,isVisible:me,renderRef:de,localTemporaryHide:ve}=dm(a,r,i,u,l,{showFn:()=>{D(),wn(()=>{C=_4(g.value,u.value,D,{animationFrame:r.realtime})})},hideFn:()=>{C&&(C(),C=void 0)}}),te=A(()=>{const G=r.tooltip?"tooltip":"popover";return[G,`b-${G}`,{[`b-${G}-${r.variant}`]:r.variant!==null,show:me.value&&!c.value,fade:!U.value,[`${r.customClass}`]:r.customClass!==void 0,[`bs-${G}-${xD(B.value)}`]:B.value!==void 0}]}),{x:pe,y:we}=gD(),J=()=>{var G,Y;const se=(G=v.value)==null?void 0:G.getBoundingClientRect(),fe=(Y=u.value)==null?void 0:Y.getBoundingClientRect(),ne=parseInt(r.hideMargin,10)||0,Q=(window==null?void 0:window.scrollX)||0,q=(window==null?void 0:window.scrollY)||0,X=!se||pe.value<se.left+Q-ne||pe.value>se.right+Q+ne||we.value<se.top+q-ne||we.value>se.bottom+q+ne,j=!fe||pe.value<fe.left+Q-ne||pe.value>fe.right+Q+ne||we.value<fe.top+q-ne||we.value>fe.bottom+q+ne;return{triggerIsOutside:X,isOutside:j}};let ge;const re=G=>{var Y,se,fe;const ne=typeof r.delay=="number"?r.delay:((Y=r.delay)==null?void 0:Y.hide)||0,{triggerIsOutside:Q,isOutside:q}=J();!r.noninteractive&&q&&Q&&!((se=u.value)!=null&&se.contains(document==null?void 0:document.activeElement))&&!((fe=v.value)!=null&&fe.contains(document==null?void 0:document.activeElement))||r.noninteractive&&Q?P(G==null?void 0:G.type):(ge&&clearTimeout(ge),ge=setTimeout(()=>{re(G)},ne<50?50:ne))};qe(me,()=>{D()}),e({hide:P,show:$,toggle:F});const oe=G=>{M.value?P(G.type==="click"?"click":"toggle"):$()},he=()=>{var G;if(r.target){const Y=Ap(bt(r.target));Y?v.value=Y:console.warn("Target element not found",r.target)}else v.value=(G=h.value)==null?void 0:G.nextElementSibling;if(r.reference){const Y=Ap(bt(r.reference));Y?g.value=Y:console.warn("Reference element not found",r.reference)}else g.value=v.value;if(!(!v.value||r.manual)){if(r.click){v.value.addEventListener("click",oe);return}v.value.addEventListener("pointerenter",$),v.value.addEventListener("pointerleave",re),v.value.addEventListener("focus",$),v.value.addEventListener("blur",re)}},I=()=>{v.value&&(v.value.removeEventListener("click",oe),v.value.removeEventListener("pointerenter",$),v.value.removeEventListener("pointerleave",re),v.value.removeEventListener("focus",$),v.value.removeEventListener("blur",re))};return a4(u,()=>{M.value&&r.click&&!r.noAutoClose&&!r.manual&&P("click-outside")},{ignore:[v]}),qe([()=>r.click,()=>r.target,()=>r.reference],()=>{I(),he()}),fn(()=>{he(),wn(()=>{D()})}),qs(I),(G,Y)=>(w(),R(We,null,[T("span",{id:p(l)+"_placeholder",ref:"_placeholder",style:{display:"none"}},null,8,vD),Ce(G.$slots,"target",{show:p($),hide:p(P),toggle:p(F),visible:p(M)},void 0,!0),H(um,{to:p(r).teleportTo,disabled:!p(r).teleportTo||p(r).teleportDisabled},{default:ee(()=>[p(de)||p(ae)?(w(),Z(Bl,Ct({key:0},p(K),{appear:a.value||p(r).visible}),{default:ee(()=>[ar(T("div",Ct({id:p(l)},G.$attrs,{ref:"_element",class:te.value,role:"tooltip",tabindex:"-1",style:p(L)}),[T("div",{ref:"_arrow",class:Te(`${p(r).tooltip?"tooltip":"popover"}-arrow`),style:Pt(N.value),"data-popper-arrow":""},null,6),T("div",{ref:"_content",class:"overflow-auto",style:Pt(_.value)},[p(r).title||s.title?(w(),R("div",{key:0,class:Te(["position-sticky top-0",p(r).tooltip?"tooltip-inner":"popover-header"])},[Ce(G.$slots,"title",{},()=>[Ye(be(p(r).title),1)],!0)],2)):ie("",!0),p(r).tooltip&&!s.title&&!p(r).title||!p(r).tooltip?(w(),R("div",{key:1,class:Te(p(r).tooltip?"tooltip-inner":"popover-body")},[Ce(G.$slots,"default",{},()=>[Ye(be(p(r).content),1)],!0)],2)):ie("",!0)],4)],16,bD),[[qc,p(M)&&!c.value]])]),_:3},16,["appear"])):ie("",!0)]),_:3},8,["to","disabled"])],64))}}),M4=fm(yD,[["__scopeId","data-v-9445feff"]]),xD=t=>{const[e]=t.split("-");switch(e){case"left":return"start";case"right":return"end";default:return e}},wD=t=>{const[e]=t.split("-");switch(e){case"left":return"start";case"right":return"end";case"top":return"up";case"bottom":return"down";default:return e}},by=t=>t==="clippingAncestors"||t instanceof Element||Array.isArray(t),O4=t=>!by(t),_D=(t,e)=>[...e].reduce((n,o)=>(n[o]=t[o],n),{}),Wu=(t,e,n)=>{const o=e.split(/[.[\]]/g);let r=t;for(const i of o){if(r===null||r===void 0)return n;i.trim()!==""&&(r=r[i])}return r===void 0?n:r},kD=["type","disabled","aria-label"],B4=le({__name:"BCloseButton",props:{ariaLabel:{default:"Close"},disabled:{type:Boolean,default:!1},type:{default:"button"}},emits:["click"],setup(t,{emit:e}){const o=Ht(t,"BCloseButton"),r=e;return(i,s)=>(w(),R("button",{type:p(o).type,class:"btn-close",disabled:p(o).disabled,"aria-label":p(o).ariaLabel,onClick:s[0]||(s[0]=a=>r("click",a))},null,8,kD))}}),SD=(t=[])=>{const{activeElement:e}=document;return e&&!(t!=null&&t.some(n=>n===e))?e:null},AD=(t,e={})=>{const n=o=>o===SD();try{t.focus(e)}catch(o){console.error(o)}return n(t)},Zc=t=>((t==null?void 0:t())??[]).length===0,L4=t=>{if(t.getAttribute("display")==="none")return!1;const e=t.getBoundingClientRect();return!!(e&&e.height>0&&e.width>0)},Rs=t=>A(()=>{let e=bt(t);return e={variant:e.variant??null,bgVariant:e.bgVariant??null,textVariant:e.textVariant??null,borderVariant:e.borderVariant??null},{[`text-bg-${e.variant}`]:e.variant!==null,[`text-${e.textVariant}`]:e.textVariant!==null,[`bg-${e.bgVariant}`]:e.bgVariant!==null,[`border-${e.borderVariant}`]:e.borderVariant!==null}}),CD={key:0,class:"visually-hidden"},$D=le({__name:"BSpinner",props:{label:{default:void 0},role:{default:"status"},small:{type:Boolean,default:!1},tag:{default:"span"},type:{default:"border"},variant:{default:null}},setup(t){const n=Ht(t,"BSpinner"),o=cs(),r=Rs(A(()=>({textVariant:n.variant}))),i=A(()=>[`spinner-${n.type}`,r.value,{[`spinner-${n.type}-sm`]:n.small}]),s=A(()=>!Zc(o.label));return(a,l)=>(w(),Z(Gt(p(n).tag),{class:Te(i.value),role:p(n).label||s.value?p(n).role:null,"aria-hidden":p(n).label||s.value?null:!0},{default:ee(()=>[p(n).label||s.value?(w(),R("span",CD,[Ce(a.$slots,"label",{},()=>[Ye(be(p(n).label),1)])])):ie("",!0)]),_:3},8,["class","role","aria-hidden"]))}}),TD=t=>{const e=t.trim();return e.charAt(0).toUpperCase()+e.slice(1)},MD=t=>t.replace(/-./g,e=>e.charAt(1).toUpperCase()).replace(/\b\w/g,e=>e.toUpperCase()).replace(/\s+/g,""),OD=t=>!!(t.href||t.to),yy=(t,e)=>{const n=so(zt(e)),o=so(zt(t)),r=A(()=>OD(o.value)),i=A(()=>r.value?_D(o.value,n.value??["active","activeClass","append","href","rel","replace","routerComponentName","target","to","variant","opacity","opacityHover","underlineVariant","underlineOffset","underlineOffsetHover","underlineOpacity","underlineOpacityHover"]):{});return{computedLink:r,computedLinkProps:i}},BD=t=>{const e=Oo(),n=e==null?void 0:e.appContext.app.config.globalProperties.$router,o=e==null?void 0:e.appContext.app.config.globalProperties.$route,r=Gt("RouterLink"),i=typeof r=="string"?null:r.useLink,s=zt(t),a=zt(()=>s.value.to||""),l=zt(()=>s.value.replace),c=A(()=>MD(s.value.routerComponentName)),u=A(()=>!((e==null?void 0:e.appContext.app.component(c.value))!==void 0)||s.value.disabled||!s.value.to?"a":c.value),d=A(()=>u.value==="RouterLink"),f=A(()=>d.value&&typeof(e==null?void 0:e.appContext.app.$nuxt)<"u"),h=A(()=>u.value!=="a"&&!d.value&&!f.value),g=A(()=>d.value||f.value),v=A(()=>({to:a.value,replace:l.value})),m=i==null?void 0:i({to:a,replace:l}),b=A(()=>g.value?m:null),y=A(()=>{var x;if((x=b.value)!=null&&x.href.value)return b.value.href.value;const _="#";if(s.value.href)return s.value.href;if(typeof s.value.to=="string")return s.value.to||_;const{to:k}=s.value;if(k!==void 0&&"path"in k){const E=k.path||"",L=k.query?`?${Object.keys(k.query).map(B=>{var D;return`${B}=${(D=k.query)==null?void 0:D[B]}`}).join("=")}`:"",S=!k.hash||k.hash.charAt(0)==="#"?k.hash||"":`#${k.hash}`;return`${E}${L}${S}`||_}return _});return{isNonStandardTag:h,tag:u,isRouterLink:d,isNuxtLink:f,computedHref:y,routerName:c,router:n,route:o,link:b,linkProps:v}},P4=t=>A(()=>{const e=bt(t);return{[`link-${e.variant}`]:e.variant!==null,[`link-opacity-${e.opacity}`]:e.opacity!==void 0,[`link-opacity-${e.opacityHover}-hover`]:e.opacityHover!==void 0,[`link-underline-${e.underlineVariant}`]:e.underlineVariant!==null,[`link-offset-${e.underlineOffset}`]:e.underlineOffset!==void 0,[`link-offset-${e.underlineOffsetHover}-hover`]:e.underlineOffsetHover!==void 0,"link-underline":e.underlineVariant===null&&(e.underlineOpacity!==void 0||e.underlineOpacityHover!==void 0),[`link-underline-opacity-${e.underlineOpacity}`]:e.underlineOpacity!==void 0,[`link-underline-opacity-${e.underlineOpacityHover}-hover`]:e.underlineOpacityHover!==void 0,"icon-link":e.icon===!0}}),Kw="active",xy=le({__name:"BLink",props:{active:{type:Boolean,default:void 0},activeClass:{default:"router-link-active"},disabled:{type:Boolean,default:!1},exactActiveClass:{default:"router-link-exact-active"},href:{default:void 0},icon:{type:Boolean,default:!1},noRel:{type:Boolean,default:!1},opacity:{default:void 0},opacityHover:{default:void 0},prefetch:{type:Boolean,default:void 0},prefetchOn:{default:void 0},noPrefetch:{type:Boolean,default:void 0},prefetchedClass:{default:void 0},rel:{default:void 0},replace:{type:Boolean,default:!1},routerComponentName:{default:"router-link"},routerTag:{default:"a"},stretched:{type:Boolean,default:!1},target:{default:void 0},to:{default:void 0},underlineOffset:{default:void 0},underlineOffsetHover:{default:void 0},underlineOpacity:{default:void 0},underlineOpacityHover:{default:void 0},underlineVariant:{default:null},variant:{default:null}},emits:["click"],setup(t,{emit:e}){const o=Ht(t,"BLink"),r=e,i=im(),{computedHref:s,tag:a,link:l,isNuxtLink:c,isRouterLink:u,linkProps:d,isNonStandardTag:f}=BD(A(()=>({routerComponentName:o.routerComponentName,disabled:o.disabled,to:o.to,replace:o.replace,href:o.href}))),h=Yt(Z3,null),g=Yt(e4,null),v=P4(o),m=A(()=>{var L,S;return[v.value,i.class,b.value,{[Kw]:o.active,[o.activeClass]:((L=l.value)==null?void 0:L.isActive.value)||!1,[o.exactActiveClass]:((S=l.value)==null?void 0:S.isExactActive.value)||!1,"stretched-link":o.stretched===!0}]}),b=A(()=>({[Kw]:o.active,disabled:o.disabled})),y=L=>{var S,B,D;if(o.disabled){L.preventDefault(),L.stopImmediatePropagation();return}(((S=h==null?void 0:h.isNav)==null?void 0:S.value)===!0&&g===null||g!==null&&((B=g.autoClose)==null?void 0:B.value)===!0)&&((D=h==null?void 0:h.hide)==null||D.call(h)),r("click",L)},x=A(()=>o.target==="_blank"?!o.rel&&o.noRel?"noopener":o.rel:void 0),_=A(()=>o.disabled?"-1":typeof i.tabindex>"u"?null:i.tabindex),k=A(()=>({prefetch:o.prefetch,noPrefetch:o.noPrefetch,prefetchOn:o.prefetchOn,prefetchedClass:o.prefetchedClass,...d.value})),E=A(()=>({...u.value?d.value:void 0,...c.value||f.value?k.value:void 0}));return(L,S)=>(w(),Z(Gt(p(a)),Ct({class:m.value,target:p(o).target,href:p(s),rel:x.value,tabindex:_.value,"aria-disabled":p(o).disabled?!0:null},E.value,{onClick:S[0]||(S[0]=B=>{var D;y(B),(D=p(l))==null||D.navigate(B)})}),{default:ee(()=>[Ce(L.$slots,"default")]),_:3},16,["class","target","href","rel","tabindex","aria-disabled"]))}}),Ho=le({__name:"BButton",props:st({loading:{type:Boolean,default:!1},loadingFill:{type:Boolean,default:!1},loadingText:{default:"Loading..."},pill:{type:Boolean,default:!1},size:{default:"md"},squared:{type:Boolean,default:!1},tag:{default:"button"},type:{default:"button"},variant:{default:"secondary"},active:{type:Boolean,default:!1},activeClass:{default:void 0},disabled:{type:Boolean,default:void 0},exactActiveClass:{default:void 0},href:{default:void 0},icon:{type:Boolean,default:!1},noRel:{type:Boolean},opacity:{default:void 0},opacityHover:{default:void 0},prefetch:{type:Boolean},prefetchOn:{},noPrefetch:{type:Boolean},prefetchedClass:{},rel:{default:void 0},replace:{type:Boolean,default:void 0},routerComponentName:{default:void 0},routerTag:{default:void 0},stretched:{type:Boolean,default:!1},target:{default:void 0},to:{default:void 0},underlineOffset:{default:void 0},underlineOffsetHover:{default:void 0},underlineOpacity:{default:void 0},underlineOpacityHover:{default:void 0},underlineVariant:{default:null}},{pressed:{type:Boolean,default:void 0},pressedModifiers:{}}),emits:st(["click"],["update:pressed"]),setup(t,{emit:e}){const o=Ht(t,"BButton"),r=e,i=ht("_element"),s=ft(t,"pressed"),{computedLink:a,computedLinkProps:l}=yy(o,["active-class","exact-active-class","replace","routerComponentName","routerTag"]),c=A(()=>typeof s.value=="boolean"),u=A(()=>o.tag==="button"&&o.href===void 0&&o.to===void 0),d=A(()=>o.to!==void 0),f=A(()=>o.href!==void 0?!1:!u.value),h=A(()=>d.value?l.value:[]),g=A(()=>o.href==="#"&&o.disabled?!0:f.value?o.disabled:null),v=A(()=>{var k;return((k=o.variant)==null?void 0:k.startsWith("link"))||!1}),m=A(()=>{var k;return((k=o.variant)==null?void 0:k.startsWith("link-"))||!1}),b=P4(A(()=>{var k;return{...v.value?{icon:o.icon,opacity:o.opacity,opacityHover:o.opacityHover,underlineOffset:o.underlineOffset,underlineOffsetHover:o.underlineOffsetHover,underlineOpacity:o.underlineOpacity,underlineOpacityHover:o.underlineOpacityHover,underlineVariant:o.underlineVariant,variant:m.value===!0?(k=o.variant)==null?void 0:k.slice(5):null}:void 0}})),y=A(()=>[v.value===!0&&a.value===!1?b.value:void 0,[`btn-${o.size}`],{[`btn-${o.variant}`]:o.variant!==null&&m.value===!1,active:o.active||s.value,"rounded-pill":o.pill,"rounded-0":o.squared,disabled:o.disabled}]),x=A(()=>d.value?xy:o.href?"a":o.tag),_=k=>{if(o.disabled){k.preventDefault(),k.stopPropagation();return}r("click",k),c.value&&(s.value=!s.value)};return Cs([" ","enter"],k=>{var E;o.href==="#"&&(k.preventDefault(),(E=i.value)==null||E.click())},{target:i}),(k,E)=>(w(),Z(Gt(x.value),Ct({ref:"_element",class:"btn"},h.value,{class:y.value,"aria-disabled":g.value,"aria-pressed":c.value?s.value:null,autocomplete:c.value?"off":null,disabled:u.value?p(o).disabled:null,href:p(o).href,rel:p(a)?p(o).rel:null,role:f.value||p(a)?"button":null,target:p(a)?p(o).target:null,type:u.value?p(o).type:null,to:u.value?null:p(o).to,onClick:_}),{default:ee(()=>[p(o).loading?Ce(k.$slots,"loading",{key:0},()=>[p(o).loadingFill?ie("",!0):(w(),R(We,{key:0},[Ye(be(p(o).loadingText),1)],64)),Ce(k.$slots,"loading-spinner",{},()=>[H($D,{small:p(o).size!=="lg",label:p(o).loadingFill?p(o).loadingText:void 0},null,8,["small","label"])])]):Ce(k.$slots,"default",{key:1})]),_:3},16,["class","aria-disabled","aria-pressed","autocomplete","disabled","href","rel","role","target","type","to"]))}}),gm=le({name:"ConditionalWrapper",inheritAttrs:!1,slots:Object,props:{tag:{type:String,default:"div"},skip:{type:Boolean,required:!0}},setup(t,{slots:e,attrs:n}){return()=>{var o,r;return t.skip?(o=e.default)==null?void 0:o.call(e,{}):Vt(t.tag,{...n},[(r=e.default)==null?void 0:r.call(e,{})])}}}),wy=le({__name:"BBadge",props:{dotIndicator:{type:Boolean,default:!1},pill:{type:Boolean,default:!1},placement:{default:void 0},tag:{default:"span"},active:{type:Boolean,default:void 0},activeClass:{default:void 0},disabled:{type:Boolean,default:void 0},exactActiveClass:{default:void 0},href:{default:void 0},icon:{type:Boolean,default:void 0},noRel:{type:Boolean},opacity:{default:void 0},opacityHover:{default:void 0},prefetch:{type:Boolean},prefetchOn:{},noPrefetch:{type:Boolean},prefetchedClass:{},rel:{default:void 0},replace:{type:Boolean,default:void 0},routerComponentName:{default:void 0},stretched:{type:Boolean,default:!1},target:{default:void 0},to:{default:void 0},underlineOffset:{default:void 0},underlineOffsetHover:{default:void 0},underlineOpacity:{default:void 0},underlineOpacityHover:{default:void 0},underlineVariant:{default:void 0},variant:{default:"secondary"},bgVariant:{default:null},textVariant:{default:null}},setup(t){const n=Ht(t,"BBadge"),{computedLink:o,computedLinkProps:r}=yy(n,["active","activeClass","append","disabled","href","rel","replace","routerComponentName","target","to","opacity","opacityHover","underlineVariant","underlineOffset","underlineOffsetHover","underlineOpacity","underlineOpacityHover","icon"]),i=A(()=>o.value?xy:n.tag),s=A(()=>{const c=n.placement??(n.dotIndicator?"top-end":void 0);return["position-absolute","translate-middle",{"start-0 top-0":c==="top-start","start-0 top-50":c==="start","start-0 top-100":c==="bottom-start","start-50 top-0":c==="top","start-50 top-100":c==="bottom","start-100 top-0":c==="top-end","start-100 top-50":c==="end","start-100 top-100":c==="bottom-end"}]}),a=Rs(n),l=A(()=>[a.value,n.placement!==void 0||n.dotIndicator===!0?s.value:void 0,{active:n.active,disabled:n.disabled,"rounded-pill":n.pill,"p-2 border border-light rounded-circle":n.dotIndicator,"text-decoration-none":o.value}]);return(c,u)=>(w(),Z(Gt(i.value),Ct({class:["badge",l.value]},p(r)),{default:ee(()=>[H(gm,Ct({skip:p(n).dotIndicator!==!0,tag:"span"},p(n).dotIndicator?{class:"visually-hidden"}:{}),{default:ee(()=>[Ce(c.$slots,"default")]),_:3},16,["skip"])]),_:3},16,["class"]))}}),LD=(t,e="px")=>A(()=>{const n=bt(t),o=bt(e);return x7.test(String(n))?`${Number(n)}${o}`:n}),PD=le({__name:"BButtonGroup",props:{ariaLabel:{default:"Group"},size:{default:"md"},tag:{default:"div"},vertical:{type:Boolean,default:!1}},setup(t){pi(n4,!0);const n=Ht(t,"BButtonGroup"),o=A(()=>({"btn-group":!n.vertical,[`btn-group-${n.size}`]:n.size!=="md","btn-group-vertical":n.vertical}));return(r,i)=>(w(),Z(Gt(p(n).tag),{class:Te(o.value),role:"group","aria-label":p(n).ariaLabel},{default:ee(()=>[Ce(r.$slots,"default")]),_:3},8,["class","aria-label"]))}}),Ug=(t,e,n,o=n)=>e.reduce((r,i)=>(t[i]&&r.push([o,i.replace(n,""),t[i]].filter(s=>s&&typeof s!="boolean").join("-").toLowerCase()),r),[]),Zw=le({__name:"BCol",props:{alignSelf:{default:void 0},tag:{default:"div"},order:{default:void 0},offset:{default:void 0},cols:{default:void 0},col:{type:Boolean,default:!1},offsetSm:{default:void 0},offsetMd:{default:void 0},offsetLg:{default:void 0},offsetXl:{default:void 0},offsetXxl:{default:void 0},orderSm:{default:void 0},orderMd:{default:void 0},orderLg:{default:void 0},orderXl:{default:void 0},orderXxl:{default:void 0},sm:{type:[Boolean,Number,String],default:!1},md:{type:[Boolean,Number,String],default:!1},lg:{type:[Boolean,Number,String],default:!1},xl:{type:[Boolean,Number,String],default:!1},xxl:{type:[Boolean,Number,String],default:!1}},setup(t){const n=Ht(t,"BCol"),o=A(()=>[...Ug({sm:n.sm,md:n.md,lg:n.lg,xl:n.xl,xxl:n.xxl},["sm","md","lg","xl","xxl"],"col"),...Ug({order:n.order,orderLg:n.orderLg,orderMd:n.orderMd,orderSm:n.orderSm,orderXl:n.orderXl,orderXxl:n.orderXxl},["order","orderLg","orderMd","orderSm","orderXl","orderXxl"],"order"),...Ug({offset:n.offset,offsetLg:n.offsetLg,offsetMd:n.offsetMd,offsetSm:n.offsetSm,offsetXl:n.offsetXl,offsetXxl:n.offsetXxl},["offset","offsetLg","offsetMd","offsetSm","offsetXl","offsetXxl"],"offset")]),r=A(()=>[o.value,{col:n.col||!o.value.some(i=>i.startsWith("col-"))&&!n.cols,[`col-${n.cols}`]:n.cols!==void 0,[`offset-${n.offset}`]:n.offset!==void 0,[`order-${n.order}`]:n.order!==void 0,[`align-self-${n.alignSelf}`]:n.alignSelf!==void 0}]);return(i,s)=>(w(),Z(Gt(p(n).tag),{class:Te(r.value)},{default:ee(()=>[Ce(i.$slots,"default")]),_:3},8,["class"]))}}),DD={class:"visually-hidden"},ED=["id","aria-labelledby","role"],ID=le({__name:"BDropdown",props:st({ariaLabel:{default:void 0},autoClose:{type:[Boolean,String],default:!0},boundary:{default:"clippingAncestors"},boundaryPadding:{default:void 0},disabled:{type:Boolean,default:!1},floatingMiddleware:{default:void 0},id:{default:void 0},isNav:{type:Boolean,default:!1},menuClass:{default:void 0},noCaret:{type:Boolean,default:!1},noFlip:{type:Boolean,default:!1},noShift:{type:Boolean,default:!1},noSize:{type:Boolean,default:!1},offset:{default:0},role:{default:"menu"},size:{default:"md"},noWrapper:{type:Boolean,default:!1},split:{type:Boolean,default:!1},splitButtonType:{default:"button"},splitClass:{default:void 0},splitDisabled:{type:Boolean,default:void 0},splitHref:{default:void 0},splitTo:{default:void 0},splitVariant:{default:void 0},strategy:{default:"absolute"},text:{default:void 0},toggleClass:{default:void 0},toggleText:{default:"Toggle dropdown"},variant:{default:"secondary"},wrapperClass:{default:void 0},placement:{default:"bottom-start"},teleportDisabled:{type:Boolean,default:!1},teleportTo:{default:void 0},initialAnimation:{type:Boolean,default:!1},noAnimation:{type:Boolean},noFade:{type:Boolean,default:!1},lazy:{type:Boolean,default:!1},unmountLazy:{type:Boolean,default:!1},show:{type:Boolean,default:!1},transProps:{default:void 0},visible:{type:Boolean,default:!1}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:st(["split-click","hide","hide-prevented","hidden","show","show-prevented","shown","toggle","toggle-prevented"],["update:modelValue"]),setup(t,{expose:e,emit:n}){const r=Ht(t,"BDropdown"),i=n,s=ko(()=>r.id,"dropdown"),a=ft(t,"modelValue"),l=Yt(HP,!1),c=Yt(n4,!1),u=A(()=>typeof r.offset=="string"||typeof r.offset=="number"?r.offset:NaN),d=Ll(u),f=ht("_floating"),h=ht("_button"),g=ht("_splitButton"),v=A(()=>by(r.boundary)?r.boundary:void 0),m=A(()=>O4(r.boundary)?r.boundary:void 0),b=A(()=>r.split?h.value:g.value),{showRef:y,renderRef:x,hide:_,show:k,toggle:E,computedNoAnimation:L,transitionProps:S,contentShowing:B,isVisible:D}=dm(a,r,i,b,s),N=A(()=>[{show:D.value,fade:!L.value}]);Cs("Escape",()=>{var ve;_(),(ve=Ap(b.value))==null||ve.focus()},{target:b}),Cs("Escape",()=>{var ve;_(),(ve=Ap(b.value))==null||ve.focus()},{target:f});const C=(ve,te)=>{var pe,we,J,ge,re,oe,he;if((we=f.value)!=null&&we.contains((pe=ve.target)==null?void 0:pe.closest("form"))||/input|select|option|textarea|form/i.test((J=ve.target)==null?void 0:J.tagName))return;if(ve.preventDefault(),!y.value){k();const G=setInterval(()=>{D.value&&(clearInterval(G),wn(()=>C(ve,te)))},16);return}const I=(ge=f.value)==null?void 0:ge.querySelectorAll(".dropdown-item:not(.disabled):not(:disabled)");if(I)if((re=f.value)!=null&&re.contains(document.activeElement)){const G=f.value.querySelector(".dropdown-item:focus"),Y=Array.prototype.indexOf.call(I,G)+te;Y>=0&&Y<(I==null?void 0:I.length)&&((oe=I[Y])==null||oe.focus())}else(he=I[te===-1?I.length-1:0])==null||he.focus()};Cs("ArrowUp",ve=>C(ve,-1),{target:b}),Cs("ArrowDown",ve=>C(ve,1),{target:b}),Cs("ArrowUp",ve=>C(ve,-1),{target:f}),Cs("ArrowDown",ve=>C(ve,1),{target:f});const M=ze({}),P=A(()=>{if(r.floatingMiddleware!==void 0)return r.floatingMiddleware;const ve=typeof r.offset=="string"||typeof r.offset=="number"?d.value:r.offset,te=[k4(ve)];return r.noFlip===!1&&te.push(A4({boundary:v.value,rootBoundary:m.value,padding:r.boundaryPadding})),r.noShift===!1&&te.push(S4({boundary:v.value,rootBoundary:m.value,padding:r.boundaryPadding})),r.noSize===!1&&te.push(C4({boundary:v.value,rootBoundary:m.value,padding:r.boundaryPadding,apply({availableWidth:pe,availableHeight:we}){var J,ge;M.value={maxHeight:we>=(((J=f.value)==null?void 0:J.scrollHeight)??0)?void 0:we?`${Math.max(0,we)}px`:void 0,maxWidth:pe>=(((ge=f.value)==null?void 0:ge.scrollWidth)??0)?void 0:pe?`${Math.max(0,pe)}px`:void 0}}})),te}),{update:$,floatingStyles:F}=T4(b,f,{placement:()=>r.placement,middleware:P,strategy:zt(()=>r.strategy),whileElementsMounted:_4}),V=c?{class:"btn-group",role:"group"}:void 0,U=A(()=>[V==null?void 0:V.class,r.wrapperClass,{"btn-group":!r.wrapperClass&&r.split,[`drop${wD(r.placement)}`]:!r.wrapperClass,"position-static":r.boundary!=="clippingAncestors"&&!r.isNav}]),K=A(()=>[r.split?r.splitClass:r.toggleClass,{"nav-link":r.isNav,"dropdown-toggle":!r.split,"dropdown-toggle-no-caret":r.noCaret&&!r.split,show:r.split?void 0:y.value}]),ae=()=>{E()},me=ve=>{if(r.split){i("split-click",ve);return}ae()};a4(f,()=>{y.value&&(r.autoClose===!0||r.autoClose==="outside")&&_()},{ignore:[h,g]});const de=()=>{y.value&&(r.autoClose===!0||r.autoClose==="inside")&&_()};return qe(D,()=>{$()}),e({hide:_,show:k,toggle:E}),pi(J3,{id:s,show:k,hide:_,toggle:E,visible:zt(()=>y.value),isNav:zt(()=>r.isNav)}),(ve,te)=>{var pe;return w(),Z(gm,{skip:p(l)||p(r).noWrapper,class:Te(U.value),role:(pe=p(V))==null?void 0:pe.role},{default:ee(()=>[H(Ho,{id:p(s),ref:"_splitButton",variant:p(r).splitVariant||p(r).variant,size:p(r).size,class:Te(K.value),disabled:p(r).splitDisabled||p(r).disabled,type:p(r).splitButtonType,"aria-label":p(r).ariaLabel,"aria-expanded":p(r).split?void 0:p(y),"aria-haspopup":p(r).split?void 0:"menu",href:p(r).split?p(r).splitHref:void 0,to:p(r).split&&p(r).splitTo?p(r).splitTo:void 0,onClick:me},{default:ee(()=>[Ce(ve.$slots,"button-content",{},()=>[Ye(be(p(r).text),1)],!0)]),_:3},8,["id","variant","size","class","disabled","type","aria-label","aria-expanded","aria-haspopup","href","to"]),p(r).split?(w(),Z(Ho,{key:0,id:p(s)+"-split",ref:"_button",variant:p(r).variant,size:p(r).size,disabled:p(r).disabled,class:Te([[p(r).toggleClass,{show:p(y)}],"dropdown-toggle-split dropdown-toggle"]),"aria-expanded":p(y),"aria-haspopup":"menu",onClick:ae},{default:ee(()=>[T("span",DD,[Ce(ve.$slots,"toggle-text",{},()=>[Ye(be(p(r).toggleText),1)],!0)])]),_:3},8,["id","variant","size","disabled","class","aria-expanded"])):ie("",!0),H(um,{to:p(r).teleportTo,disabled:!p(r).teleportTo||p(r).teleportDisabled},{default:ee(()=>[p(x)||p(B)?(w(),Z(Bl,Ct({key:0},p(S),{appear:a.value||p(r).visible}),{default:ee(()=>[ar(T("ul",{id:p(s)+"-menu",ref:"_floating",style:Pt([p(F),M.value]),class:Te(["dropdown-menu overflow-auto",[p(r).menuClass,N.value]]),"aria-labelledby":p(s),role:p(r).role,onClick:de},[p(B)?Ce(ve.$slots,"default",{key:0,hide:p(_),show:p(k),visible:p(y)},void 0,!0):ie("",!0)],14,ED),[[qc,p(y)]])]),_:3},16,["appear"])):ie("",!0)]),_:3},8,["to","disabled"])]),_:3},8,["skip","class","role"])}}}),_y=fm(ID,[["__scopeId","data-v-8ac2524d"]]),ND=le({inheritAttrs:!1,__name:"BDropdownItem",props:{linkClass:{default:void 0},wrapperAttrs:{default:void 0},active:{type:Boolean,default:void 0},activeClass:{default:void 0},disabled:{type:Boolean,default:void 0},exactActiveClass:{default:void 0},href:{default:void 0},icon:{type:Boolean,default:void 0},noRel:{type:Boolean},opacity:{default:void 0},opacityHover:{default:void 0},prefetch:{type:Boolean},prefetchOn:{},noPrefetch:{type:Boolean},prefetchedClass:{},rel:{default:void 0},replace:{type:Boolean,default:void 0},routerComponentName:{default:void 0},stretched:{type:Boolean,default:!1},target:{default:void 0},to:{default:void 0},underlineOffset:{default:void 0},underlineOffsetHover:{default:void 0},underlineOpacity:{default:void 0},underlineOpacityHover:{default:void 0},underlineVariant:{default:void 0},variant:{default:null}},emits:["click"],setup(t,{emit:e}){const o=Ht(t,"BDropdownItem"),r=e,i=im(),s=A(()=>{const{class:m,...b}=i;return{wrapperClass:m,dropdownItemAttrs:b}}),{computedLink:a,computedLinkProps:l}=yy(o),c=Rs(A(()=>({textVariant:o.variant}))),u=A(()=>[o.linkClass,c.value,{active:o.active,disabled:o.disabled}]),d=A(()=>a.value?xy:o.href?"a":"button"),f=Yt(Z3,null),h=Yt(J3,null),g=Yt(e4,null),v=m=>{var b,y,x;r("click",m),g!==null&&((b=g==null?void 0:g.autoClose)==null?void 0:b.value)===!0&&((y=f==null?void 0:f.hide)==null||y.call(f)),(x=h==null?void 0:h.hide)==null||x.call(h)};return(m,b)=>(w(),R("li",Ct({role:"presentation",class:s.value.wrapperClass},p(o).wrapperAttrs),[(w(),Z(Gt(d.value),Ct({class:["dropdown-item",u.value],disabled:p(o).disabled,"aria-disabled":p(o).disabled?!0:null,"aria-current":p(o).active?!0:null,href:d.value==="a"?p(o).href:null,rel:p(o).rel,role:"menuitem",type:d.value==="button"?"button":null,target:p(o).target},{...p(l),...s.value.dropdownItemAttrs},{onClick:v}),{default:ee(()=>[Ce(m.$slots,"default")]),_:3},16,["class","disabled","aria-disabled","aria-current","href","rel","type","target"]))],16))}}),RD=["disabled"],D4=le({inheritAttrs:!1,__name:"BDropdownItemButton",props:{active:{type:Boolean,default:!1},activeClass:{default:"active"},buttonClass:{default:void 0},wrapperAttrs:{default:void 0},disabled:{type:Boolean,default:!1},variant:{default:null}},emits:["click"],setup(t,{emit:e}){const o=Ht(t,"BDropdownItemButton"),r=e,i=im(),s=A(()=>{const{class:u,...d}=i;return{wrapperClass:u,buttonAttrs:d}}),a=Rs(A(()=>({textVariant:o.variant}))),l=A(()=>[o.buttonClass,a.value,{[o.activeClass]:o.active,disabled:o.disabled}]),c=u=>{if(o.disabled){u.preventDefault(),u.stopPropagation();return}r("click",u)};return(u,d)=>(w(),R("li",Ct({role:"presentation",class:s.value.wrapperClass},p(o).wrapperAttrs),[T("button",Ct({role:"menu",type:"button",class:["dropdown-item",l.value],disabled:p(o).disabled},s.value.buttonAttrs,{onClick:c}),[Ce(u.$slots,"default")],16,RD)],16))}}),FD=["value","disabled"],E4=le({__name:"BFormSelectOption",props:{disabled:{type:Boolean,default:!1},value:{default:void 0}},setup(t){const n=Ht(t,"BFormSelectOption");return(o,r)=>(w(),R("option",{value:p(n).value,disabled:p(n).disabled},[Ce(o.$slots,"default")],8,FD))}}),I4=(t,e)=>{const n=s=>typeof s=="object"&&s!==null&&"label"in s,o=s=>{const a=bt(e);if(typeof s=="string")return{value:s,text:s};if(typeof s=="number")return{value:s,text:`${s}`};if(s instanceof Date)return{value:s,text:s.toLocaleString()};const l=Wu(s,a.valueField),c=Wu(s,a.textField),u=Wu(s,a.disabledField),d=a.optionsField?Wu(s,a.optionsField):void 0;return d!==void 0?{label:Wu(s,a.labelField)||c,options:d}:{...typeof s=="object"?s:void 0,value:l,text:c,disabled:u}},r=s=>s.map(a=>o(a));return{normalizedOptions:A(()=>r(bt(t))),isComplex:n}},VD=le({__name:"BFormInvalidFeedback",props:{ariaLive:{default:void 0},forceShow:{type:Boolean,default:!1},id:{default:void 0},role:{default:void 0},state:{type:[Boolean,null],default:null},tag:{default:"div"},text:{default:void 0},tooltip:{type:Boolean,default:!1}},setup(t){const n=Ht(t,"BFormInvalidFeedback"),o=A(()=>n.forceShow===!0||n.state===!1),r=A(()=>({"d-block":o.value,"invalid-feedback":!n.tooltip,"invalid-tooltip":n.tooltip}));return(i,s)=>(w(),Z(Gt(p(n).tag),{id:p(n).id,role:p(n).role,"aria-live":p(n).ariaLive,"aria-atomic":p(n).ariaLive?!0:void 0,class:Te(r.value)},{default:ee(()=>[Ce(i.$slots,"default",{},()=>[Ye(be(p(n).text),1)])]),_:3},8,["id","role","aria-live","aria-atomic","class"]))}}),zD=le({__name:"BFormRow",props:{tag:{default:"div"}},setup(t){const n=Ht(t,"BFormRow");return(o,r)=>(w(),Z(Gt(p(n).tag),{class:"row d-flex flex-wrap"},{default:ee(()=>[Ce(o.$slots,"default")]),_:3}))}}),HD=le({__name:"BFormText",props:{id:{default:void 0},inline:{type:Boolean,default:!1},tag:{default:"small"},text:{default:void 0},textVariant:{default:"body-secondary"}},setup(t){const n=Ht(t,"BFormText"),o=Rs(n),r=A(()=>[o.value,{"form-text":!n.inline}]);return(i,s)=>(w(),Z(Gt(p(n).tag),{id:p(n).id,class:Te(r.value)},{default:ee(()=>[Ce(i.$slots,"default",{},()=>[Ye(be(p(n).text),1)])]),_:3},8,["id","class"]))}}),WD=le({__name:"BFormValidFeedback",props:{ariaLive:{default:void 0},forceShow:{type:Boolean,default:!1},id:{default:void 0},role:{default:void 0},state:{type:[Boolean,null],default:null},tag:{default:"div"},text:{default:void 0},tooltip:{type:Boolean,default:!1}},setup(t){const n=Ht(t,"BFormInvalidFeedback"),o=A(()=>n.forceShow===!0||n.state===!0),r=A(()=>({"d-block":o.value,"valid-feedback":!n.tooltip,"valid-tooltip":n.tooltip}));return(i,s)=>(w(),Z(Gt(p(n).tag),{id:p(n).id,role:p(n).role,"aria-live":p(n).ariaLive,"aria-atomic":p(n).ariaLive?!0:void 0,class:Te(r.value)},{default:ee(()=>[Ce(i.$slots,"default",{},()=>[Ye(be(p(n).text),1)])]),_:3},8,["id","role","aria-live","aria-atomic","class"]))}}),vm=(t,e)=>A(()=>{const n=bt(t),o=bt(e);return n===!0?"true":typeof n=="string"?n:o===!1?"true":n===!1?"false":void 0}),bm=t=>A(()=>{const e=bt(t);return e===!0?"is-valid":e===!1?"is-invalid":null}),N4=t=>A(()=>{const e=bt(t);return{"form-check":e.plain===!1&&e.button===!1&&e.hasDefaultSlot,"form-check-reverse":e.reverse===!0,"form-check-inline":e.inline===!0,"form-switch":e.switch===!0,[`form-control-${e.size}`]:e.size!==void 0&&e.size!=="md"&&e.button===!1}}),R4=t=>{const e=so(zt(t)),n=bm(()=>e.value.state??null);return A(()=>[n.value,{"form-check-input":e.value.plain===!1&&e.value.button===!1,"btn-check":e.value.button===!0}])},F4=t=>A(()=>{const e=bt(t);return{"form-check-label":e.plain===!1&&e.button===!1,btn:e.button===!0,[`btn-${e.buttonVariant}`]:e.button===!0&&e.buttonVariant!==void 0&&e.buttonVariant!==null,[`btn-${e.size}`]:e.button&&e.size&&e.size!=="md"}}),UD=t=>{const e=so(zt(t)),n=vm(()=>e.value.ariaInvalid,()=>e.value.state);return A(()=>({"aria-invalid":n.value,"aria-required":e.value.required===!0?!0:void 0}))},GD=t=>A(()=>{const e=bt(t);return{"was-validated":e.validated===!0,"btn-group":e.buttons===!0&&e.stacked===!1,"btn-group-vertical":e.stacked===!0&&e.buttons===!0,[`btn-group-${e.size}`]:e.size!==void 0}}),qD=["id","disabled","required","name","form","aria-label","aria-labelledby","aria-required","value","true-value","false-value","indeterminate"],YD=["for"],Fs=le({inheritAttrs:!1,__name:"BFormCheckbox",props:st({ariaLabel:{default:void 0},ariaLabelledby:{default:void 0},autofocus:{type:Boolean,default:!1},button:{type:Boolean,default:!1},buttonGroup:{type:Boolean,default:!1},buttonVariant:{default:null},disabled:{type:Boolean,default:!1},form:{default:void 0},id:{default:void 0},inline:{type:Boolean,default:!1},name:{default:void 0},plain:{type:Boolean,default:!1},required:{type:Boolean,default:void 0},reverse:{type:Boolean,default:!1},size:{default:void 0},state:{type:[Boolean,null],default:null},switch:{type:Boolean,default:!1},uncheckedValue:{type:[Array,Set,String,Boolean,Object,Number,null],default:!1},wrapperAttrs:{default:void 0},inputClass:{default:void 0},value:{type:[String,Boolean,Array,Set,Object,Number,null],default:!0}},{modelValue:{type:[Array,Set,String,Boolean,Object,Number,null],default:void 0},modelModifiers:{},indeterminate:{type:Boolean,default:!1},indeterminateModifiers:{}}),emits:["update:modelValue","update:indeterminate"],setup(t,{expose:e}){const n=im(),o=A(()=>{const{class:L,...S}=n;return{wrapperClass:L,inputAttrs:S}}),i=Ht(t,"BFormCheckbox"),s=cs(),a=ft(t,"modelValue"),l=ft(t,"indeterminate"),c=ko(()=>i.id,"form-check"),u=Yt(FP,null),d=ht("_input"),{focused:f}=Xi(d,{initialValue:i.autofocus}),h=A(()=>!Zc(s.default)),g=A({get:()=>u?u.modelValue.value:a.value,set:L=>{if(L!==void 0){if(l.value=!1,u!==null&&Array.isArray(L)){u.modelValue.value=L;return}a.value=L}}}),v=A(()=>!!(i.name??(u==null?void 0:u.name.value))&&(i.required||(u==null?void 0:u.required.value))),m=A(()=>i.buttonGroup||((u==null?void 0:u.buttons.value)??!1)),b=A(()=>({plain:i.plain||((u==null?void 0:u.plain.value)??!1),button:i.button||((u==null?void 0:u.buttons.value)??!1),inline:i.inline||((u==null?void 0:u.inline.value)??!1),reverse:i.reverse||((u==null?void 0:u.reverse.value)??!1),switch:i.switch||((u==null?void 0:u.switch.value)??!1),state:i.state===!0||i.state===!1?i.state:(u==null?void 0:u.state.value)??null,size:i.size??(u==null?void 0:u.size.value)??"md",buttonVariant:i.buttonVariant??(u==null?void 0:u.buttonVariant.value)??"secondary",hasDefaultSlot:h.value})),y=N4(b),x=A(()=>[y.value,o.value.wrapperClass]),_=R4(b),k=A(()=>[_.value,i.inputClass]),E=F4(b);return e({blur:()=>{f.value=!1},element:d,focus:()=>{f.value=!0}}),(L,S)=>(w(),Z(gm,Ct({skip:m.value},p(i).wrapperAttrs,{class:x.value}),{default:ee(()=>{var B,D,N;return[ar(T("input",Ct({id:p(c),ref:"_input","onUpdate:modelValue":S[0]||(S[0]=C=>g.value=C),class:k.value,type:"checkbox",disabled:p(i).disabled||((B=p(u))==null?void 0:B.disabled.value),required:v.value||void 0,name:p(i).name||((D=p(u))==null?void 0:D.name.value),form:p(i).form||((N=p(u))==null?void 0:N.form.value),"aria-label":p(i).ariaLabel,"aria-labelledby":p(i).ariaLabelledby,"aria-required":v.value||void 0,value:p(i).value,"true-value":p(i).value,"false-value":p(i).uncheckedValue,indeterminate:l.value||void 0},o.value.inputAttrs),null,16,qD),[[z3,g.value]]),h.value||p(i).plain===!1?(w(),R("label",{key:0,for:p(c),class:Te(p(E))},[Ce(L.$slots,"default")],10,YD)):ie("",!0)]}),_:3},16,["skip","class"]))}}),Qw=(t,e)=>e+(t?TD(t):""),jD={key:0,ref:"_content",class:"form-floating"},On=le({__name:"BFormGroup",props:{contentCols:{type:[Boolean,String,Number],default:void 0},labelCols:{type:[Boolean,String,Number],default:void 0},labelAlign:{default:void 0},ariaInvalid:{type:[Boolean,String],default:void 0},description:{default:void 0},disabled:{type:Boolean,default:!1},feedbackAriaLive:{default:"assertive"},floating:{type:Boolean,default:!1},id:{default:void 0},invalidFeedback:{default:void 0},label:{default:void 0},labelClass:{default:void 0},labelFor:{default:void 0},labelSize:{default:void 0},labelVisuallyHidden:{type:Boolean,default:!1},state:{type:[Boolean,null],default:null},tooltip:{type:Boolean,default:!1},validFeedback:{default:void 0},validated:{type:Boolean,default:!1},contentColsSm:{type:[Boolean,String,Number],default:void 0},contentColsMd:{type:[Boolean,String,Number],default:void 0},contentColsLg:{type:[Boolean,String,Number],default:void 0},contentColsXl:{type:[Boolean,String,Number],default:void 0},labelColsSm:{type:[Boolean,String,Number],default:void 0},labelColsMd:{type:[Boolean,String,Number],default:void 0},labelColsLg:{type:[Boolean,String,Number],default:void 0},labelColsXl:{type:[Boolean,String,Number],default:void 0},labelAlignSm:{default:void 0},labelAlignMd:{default:void 0},labelAlignLg:{default:void 0},labelAlignXl:{default:void 0}},setup(t){const e=["input","select","textarea"],o=Ht(t,"BFormGroup"),r=cs(),i=Nw(),s=Nw(),a=zt(()=>o.state),l=ze([]);pi(o4,C=>(l.value=[C],{state:a}));const c=A(()=>o.labelFor!==void 0?o.labelFor:l.value[0]&&l.value[0].value?l.value[0].value:null),u=["xs","sm","md","lg","xl"],d=(C,M)=>u.reduce((P,$)=>{const F=Qw($==="xs"?"":$,`${M}Cols`);let V=C[F];if(V=V===""?!0:V||!1,typeof V!="boolean"&&V!=="auto"){const U=Number.parseInt(V);V=Number.isNaN(U)?0:U,V=V>0?V:!1}return V&&($==="xs"?P[typeof V=="boolean"?"col":"cols"]=V:P[$||(typeof V=="boolean"?"col":"cols")]=V),P},{}),f=ht("_content"),h=A(()=>d(o,"content")),g=A(()=>((C,M)=>u.reduce((P,$)=>{const F=Qw($==="xs"?"":$,`${M}Align`),V=C[F]||null;return V&&($==="xs"?P.push(`text-${V}`):P.push(`text-${$}-${V}`)),P},[]))(o,"label")),v=A(()=>d(o,"label")),m=A(()=>Object.keys(h.value).length>0||Object.keys(v.value).length>0),b=bm(a),y=vm(()=>o.ariaInvalid,a),x=C=>{if(c.value||f.value===null)return;const{target:M}=C,P=M?M.tagName:"";if([...e,"a","button","label"].indexOf(P)!==-1)return;const $=[...f.value.querySelectorAll(e.map(V=>`${V}:not([disabled])`).join())].filter(L4),[F]=$;$.length===1&&F instanceof HTMLElement&&AD(F)},_=ko(()=>o.id),k=ko(void 0,"_BV_label_"),E=A(()=>c.value?"label":"legend"),L=A(()=>[m.value?"col-form-label":"form-label",{"bv-no-focus-ring":!c.value,"col-form-label":m.value||!c.value,"pt-0":!m.value&&!c.value,"d-block":!m.value&&c.value,[`col-form-label-${o.labelSize}`]:!!o.labelSize,"visually-hidden":o.labelVisuallyHidden},g.value,o.labelClass]),S=ko(void 0,"_BV_feedback_invalid_"),B=ko(void 0,"_BV_feedback_valid_"),D=ko(void 0,"_BV_description_"),N=A(()=>!c.value);return(C,M)=>(w(),Z(Gt(N.value?"fieldset":"div"),{id:p(_),disabled:N.value?p(o).disabled:null,role:N.value?null:"group","aria-invalid":p(y),"aria-labelledby":N.value&&m.value?p(k):null,class:Te([[p(b),{"was-validated":p(o).validated}],"b-form-group"])},{default:ee(()=>[H(p(s).define,null,{default:ee(()=>[r["invalid-feedback"]||p(o).invalidFeedback?(w(),Z(VD,{key:0,id:p(S),"aria-live":p(o).feedbackAriaLive,state:a.value,tooltip:p(o).tooltip},{default:ee(()=>[Ce(C.$slots,"invalid-feedback",{},()=>[Ye(be(p(o).invalidFeedback),1)])]),_:3},8,["id","aria-live","state","tooltip"])):ie("",!0),r["valid-feedback"]||p(o).validFeedback?(w(),Z(WD,{key:1,id:p(B),"aria-live":p(o).feedbackAriaLive,state:a.value,tooltip:p(o).tooltip},{default:ee(()=>[Ce(C.$slots,"valid-feedback",{},()=>[Ye(be(p(o).validFeedback),1)])]),_:3},8,["id","aria-live","state","tooltip"])):ie("",!0),r.description||p(o).description?(w(),Z(HD,{key:2,id:p(D)},{default:ee(()=>[Ce(C.$slots,"description",{},()=>[Ye(be(p(o).description),1)])]),_:3},8,["id"])):ie("",!0)]),_:3}),H(p(i).define,null,{default:ee(()=>[r.label||p(o).label||m.value?(w(),R(We,{key:0},[m.value?(w(),Z(Zw,Wn(Ct({key:0},v.value)),{default:ee(()=>[(w(),Z(Gt(E.value),{id:p(k),for:c.value||null,tabindex:N.value?"-1":null,class:Te(L.value),onClick:M[0]||(M[0]=P=>N.value?x:null)},{default:ee(()=>[Ce(C.$slots,"label",{},()=>[Ye(be(p(o).label),1)])]),_:3},8,["id","for","tabindex","class"]))]),_:3},16)):(w(),Z(Gt(E.value),{key:1,id:p(k),for:c.value||null,tabindex:N.value?"-1":null,class:Te(L.value),onClick:M[1]||(M[1]=P=>N.value?x:null)},{default:ee(()=>[Ce(C.$slots,"label",{},()=>[Ye(be(p(o).label),1)])]),_:3},8,["id","for","tabindex","class"]))],64)):ie("",!0)]),_:3}),m.value?(w(),Z(zD,{key:0},{default:ee(()=>[H(p(i).reuse),H(Zw,Ct(h.value,{ref:"_content"}),{default:ee(()=>[Ce(C.$slots,"default",{id:p(_),ariaDescribedby:null,descriptionId:p(D),labelId:p(k)}),H(p(s).reuse)]),_:3},16)]),_:3})):(w(),R(We,{key:1},[p(o).floating&&!m.value?(w(),R("div",jD,[Ce(C.$slots,"default",{id:p(_),ariaDescribedby:null,descriptionId:p(D),labelId:p(k)}),H(p(i).reuse),H(p(s).reuse)],512)):(w(),R(We,{key:1},[H(p(i).reuse),Ce(C.$slots,"default",{id:p(_),ariaDescribedby:null,descriptionId:p(D),labelId:p(k)}),H(p(s).reuse)],64))],64))]),_:3},8,["id","disabled","role","aria-invalid","aria-labelledby","class"]))}}),V4=(t,e)=>{if(t===null)return;let n=t;if(e.number&&typeof n=="string"&&n!==""){const o=Number.parseFloat(n);n=Number.isNaN(o)?n:o}return n},z4=(t,e,n,o)=>{var r;const i=ze(0),s=ko(()=>t.id,"input"),a=Ll(()=>t.debounce??0),l=Ll(()=>t.debounceMaxWait??NaN),c=(r=Yt(o4,null))==null?void 0:r(s),u=A(()=>t.state!==void 0?t.state:(c==null?void 0:c.state.value)??null),d=vm(()=>t.ariaInvalid,u),f=bm(u),h=r7(E=>{n.value=E},()=>o.lazy===!0?0:a.value,{maxWait:()=>o.lazy===!0?NaN:l.value}),g=(E,L=!1)=>{o.lazy===!0&&L===!1||h(E)},{focused:v}=Xi(e,{initialValue:t.autofocus}),m=(E,L,S=!1)=>t.formatter!==void 0&&(!t.lazyFormatter||S)?t.formatter(E,L):E;return fn(()=>{var E;e.value&&(e.value.value=((E=n.value)==null?void 0:E.toString())??"")}),oy(()=>{wn(()=>{t.autofocus&&(v.value=!0)})}),{input:e,computedId:s,computedAriaInvalid:d,onInput:E=>{const{value:L}=E.target,S=m(L,E);if(E.defaultPrevented){E.preventDefault();return}g(S)},onChange:E=>{const{value:L}=E.target,S=m(L,E);if(E.defaultPrevented){E.preventDefault();return}const B=S;n.value!==B&&g(S,!0)},onBlur:E=>{if(!o.lazy&&!t.lazyFormatter&&!o.trim)return;const{value:L}=E.target,S=m(L,E,!0),B=o.trim?S.trim():S,D=B.length!==S.length;n.value!==B&&g(S,!0),o.trim&&D&&(i.value=i.value+1)},focus:()=>{t.disabled||(v.value=!0)},blur:()=>{t.disabled||(v.value=!1)},forceUpdateKey:i,stateClass:f}},XD=["id","value","name","form","type","disabled","placeholder","required","autocomplete","readonly","min","max","step","list","aria-required","aria-invalid"],ta=le({__name:"BFormInput",props:st({max:{default:void 0},min:{default:void 0},step:{default:void 0},type:{default:"text"},ariaInvalid:{type:[Boolean,String],default:void 0},autocomplete:{default:void 0},autofocus:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},form:{default:void 0},formatter:{type:Function,default:void 0},id:{default:void 0},lazyFormatter:{type:Boolean,default:!1},list:{default:void 0},name:{default:void 0},placeholder:{default:void 0},plaintext:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},size:{default:void 0},state:{type:[Boolean,null],default:void 0},debounce:{default:0},debounceMaxWait:{default:NaN}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(t,{expose:e}){const o=Ht(t,"BFormInput"),[r,i]=ft(t,"modelValue",{set:b=>V4(b,i)}),s=ht("_input"),{computedId:a,computedAriaInvalid:l,onInput:c,onChange:u,onBlur:d,stateClass:f,focus:h,blur:g,forceUpdateKey:v}=z4(o,s,r,i),m=A(()=>{const b=o.type==="range",y=o.type==="color";return[f.value,{"form-range":b,"form-control":y||!o.plaintext&&!b,"form-control-color":y,"form-control-plaintext":o.plaintext&&!b&&!y,[`form-control-${o.size}`]:!!o.size}]});return e({blur:g,element:s,focus:h}),(b,y)=>(w(),R("input",{id:p(a),ref:"_input",key:p(v),value:p(r),class:Te(m.value),name:p(o).name||void 0,form:p(o).form||void 0,type:p(o).type,disabled:p(o).disabled,placeholder:p(o).placeholder,required:p(o).required||void 0,autocomplete:p(o).autocomplete||void 0,readonly:p(o).readonly||p(o).plaintext,min:p(o).min,max:p(o).max,step:p(o).step,list:p(o).type!=="password"?p(o).list:void 0,"aria-required":p(o).required||void 0,"aria-invalid":p(l),onInput:y[0]||(y[0]=(...x)=>p(c)&&p(c)(...x)),onChange:y[1]||(y[1]=(...x)=>p(u)&&p(u)(...x)),onBlur:y[2]||(y[2]=(...x)=>p(d)&&p(d)(...x))},null,42,XD))}}),KD=["id","disabled","required","name","form","aria-label","aria-labelledby","value","aria-required"],ZD=["for"],QD=le({inheritAttrs:!1,__name:"BFormRadio",props:st({ariaLabel:{default:void 0},ariaLabelledby:{default:void 0},autofocus:{type:Boolean,default:!1},button:{type:Boolean,default:!1},buttonGroup:{type:Boolean,default:!1},buttonVariant:{default:null},disabled:{type:Boolean,default:!1},form:{default:void 0},id:{default:void 0},inline:{type:Boolean,default:!1},name:{default:void 0},plain:{type:Boolean,default:!1},required:{type:Boolean,default:!1},reverse:{type:Boolean,default:!1},size:{default:void 0},state:{type:[Boolean,null],default:null},value:{type:[Boolean,String,Array,Object,Number,null],default:!0}},{modelValue:{type:[Boolean,String,Array,Object,Number,null],default:void 0},modelModifiers:{}}),emits:["update:modelValue"],setup(t,{expose:e}){const o=Ht(t,"BFormRadio"),r=cs(),i=ft(t,"modelValue"),s=ko(()=>o.id,"form-check"),a=Yt(K3,null),l=ht("_input"),{focused:c}=Xi(l,{initialValue:o.autofocus}),u=A(()=>!Zc(r.default)),d=A({get:()=>a?a.modelValue.value:i.value,set:y=>{if(y!==void 0){if(a!==null){a.modelValue.value=y;return}i.value=y}}}),f=A(()=>!!(o.name??(a==null?void 0:a.name.value))&&(o.required||(a==null?void 0:a.required.value))),h=A(()=>o.buttonGroup||((a==null?void 0:a.buttons.value)??!1)),g=A(()=>({plain:o.plain||((a==null?void 0:a.plain.value)??!1),button:o.button||((a==null?void 0:a.buttons.value)??!1),inline:o.inline||((a==null?void 0:a.inline.value)??!1),state:o.state||(a==null?void 0:a.state.value),reverse:o.reverse||((a==null?void 0:a.reverse.value)??!1),size:o.size??(a==null?void 0:a.size.value)??"md",buttonVariant:o.buttonVariant??(a==null?void 0:a.buttonVariant.value)??"secondary",hasDefaultSlot:u.value})),v=N4(g),m=R4(g),b=F4(g);return e({blur:()=>{c.value=!1},element:l,focus:()=>{c.value=!0}}),(y,x)=>(w(),Z(gm,{skip:h.value,class:Te(p(v))},{default:ee(()=>{var _,k,E;return[ar(T("input",Ct({id:p(s)},y.$attrs,{ref:"_input","onUpdate:modelValue":x[0]||(x[0]=L=>d.value=L),class:p(m),type:"radio",disabled:p(o).disabled||((_=p(a))==null?void 0:_.disabled.value),required:f.value||void 0,name:p(o).name||((k=p(a))==null?void 0:k.name.value),form:p(o).form||((E=p(a))==null?void 0:E.form.value),"aria-label":p(o).ariaLabel,"aria-labelledby":p(o).ariaLabelledby,value:p(o).value,"aria-required":f.value||void 0}),null,16,KD),[[bP,d.value]]),u.value||p(o).plain===!1?(w(),R("label",{key:0,for:p(s),class:Te(p(b))},[Ce(y.$slots,"default")],10,ZD)):ie("",!0)]}),_:3},8,["skip","class"]))}}),JD=["id"],eE=le({__name:"BFormRadioGroup",props:st({ariaInvalid:{type:[Boolean,String],default:void 0},autofocus:{type:Boolean,default:!1},buttonVariant:{default:"secondary"},buttons:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},disabledField:{default:"disabled"},form:{default:void 0},id:{default:void 0},name:{default:void 0},options:{default:()=>[]},plain:{type:Boolean,default:!1},required:{type:Boolean,default:!1},reverse:{type:Boolean,default:!1},size:{default:"md"},stacked:{type:Boolean,default:!1},state:{type:[Boolean,null],default:null},textField:{default:"text"},validated:{type:Boolean,default:!1},valueField:{default:"value"}},{modelValue:{default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(t,{expose:e}){const o=Ht(t,"BFormRadioGroup"),r=ft(t,"modelValue"),i=ko(()=>o.id,"radio"),s=ko(()=>o.name,"checkbox"),a=ht("_element"),{focused:l}=Xi(a,{initialValue:o.autofocus});pi(K3,{modelValue:r,buttonVariant:zt(()=>o.buttonVariant),form:zt(()=>o.form),name:s,buttons:zt(()=>o.buttons),state:zt(()=>o.state),plain:zt(()=>o.plain),size:zt(()=>o.size),inline:zt(()=>!o.stacked),reverse:zt(()=>o.reverse),required:zt(()=>o.required),disabled:zt(()=>o.disabled)});const c=A(()=>o.options.map(h=>typeof h=="string"||typeof h=="number"?{value:h,disabled:o.disabled,text:h.toString()}:{value:h[o.valueField],disabled:h[o.disabledField],...h.props?h.props:void 0,text:h[o.textField]})),u=A(()=>({required:o.required,ariaInvalid:o.ariaInvalid,state:o.state,validated:o.validated,buttons:o.buttons,stacked:o.stacked,size:o.size})),d=UD(u),f=GD(u);return e({blur:()=>{l.value=!1},focus:()=>{l.value=!0}}),(h,g)=>(w(),R("div",Ct(p(d),{id:p(i),ref:"_element",role:"radiogroup",class:[p(f),"bv-no-focus-ring"],tabindex:"-1"}),[Ce(h.$slots,"first"),(w(!0),R(We,null,mt(c.value,(v,m)=>(w(),Z(QD,Ct({key:m,ref_for:!0},v),{default:ee(()=>[Ce(h.$slots,"option",Ct({ref_for:!0},v),()=>[Ye(be(v.text),1)])]),_:2},1040))),128)),Ce(h.$slots,"default")],16,JD))}}),tE=["label"],nE=le({__name:"BFormSelectOptionGroup",props:{disabledField:{default:"disabled"},label:{default:void 0},options:{default:()=>[]},textField:{default:"text"},valueField:{default:"value"}},setup(t){const n=Ht(t,"BFormSelectOptionGroup"),{normalizedOptions:o}=I4(()=>n.options,n),r=A(()=>o.value);return(i,s)=>(w(),R("optgroup",{label:p(n).label},[Ce(i.$slots,"first"),(w(!0),R(We,null,mt(r.value,(a,l)=>(w(),Z(E4,Ct({key:l,disabled:a.disabled,value:a.value,ref_for:!0},i.$attrs),{default:ee(()=>[Ce(i.$slots,"option",Ct({ref_for:!0},a),()=>[Ye(be(a.text),1)])]),_:2},1040,["disabled","value"]))),128)),Ce(i.$slots,"default")],8,tE))}}),oE=["id","name","form","multiple","size","disabled","required","aria-required","aria-invalid"],qa=le({__name:"BFormSelect",props:st({ariaInvalid:{type:[Boolean,String],default:void 0},autofocus:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},disabledField:{default:"disabled"},form:{default:void 0},id:{default:void 0},labelField:{default:"label"},multiple:{type:Boolean,default:!1},name:{default:void 0},options:{default:()=>[]},optionsField:{default:"options"},plain:{type:Boolean,default:!1},required:{type:Boolean,default:!1},selectSize:{default:0},size:{default:"md"},state:{type:[Boolean,null],default:null},textField:{default:"text"},valueField:{default:"value"}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(t,{expose:e}){const o=Ht(t,"BFormSelect"),r=ft(t,"modelValue"),i=ko(()=>o.id,"input"),s=Ll(()=>o.selectSize),a=bm(()=>o.state),l=ht("_input"),{focused:c}=Xi(l,{initialValue:o.autofocus}),u=A(()=>[a.value,{"form-control":o.plain,[`form-control-${o.size}`]:o.size!=="md"&&o.plain,"form-select":!o.plain,[`form-select-${o.size}`]:o.size!=="md"&&!o.plain}]),d=A(()=>s.value||o.plain?s.value:void 0),f=vm(()=>o.ariaInvalid,()=>o.state),{normalizedOptions:h,isComplex:g}=I4(()=>o.options,o),v=A(()=>h.value),m=A({get:()=>r.value,set:b=>{r.value=b}});return e({blur:()=>{c.value=!1},element:l,focus:()=>{c.value=!0}}),(b,y)=>ar((w(),R("select",{id:p(i),ref:"_input","onUpdate:modelValue":y[0]||(y[0]=x=>m.value=x),class:Te(u.value),name:p(o).name,form:p(o).form||void 0,multiple:p(o).multiple||void 0,size:d.value,disabled:p(o).disabled,required:p(o).required||void 0,"aria-required":p(o).required||void 0,"aria-invalid":p(f)},[Ce(b.$slots,"first"),(w(!0),R(We,null,mt(v.value,(x,_)=>(w(),R(We,{key:_},[p(g)(x)?(w(),Z(nE,{key:0,label:x.label,options:x.options,"value-field":p(o).valueField,"text-field":p(o).textField,"disabled-field":p(o).disabledField},null,8,["label","options","value-field","text-field","disabled-field"])):(w(),Z(E4,{key:1,value:x.value,disabled:x.disabled},{default:ee(()=>[Ce(b.$slots,"option",Ct({ref_for:!0},x),()=>[Ye(be(x.text),1)])]),_:2},1032,["value","disabled"]))],64))),128)),Ce(b.$slots,"default")],10,oE)),[[yP,m.value]])}}),rE=(t,e)=>{const n=ze(0),o=so(zt(e)),r=Ll(()=>o.value.maxRows||NaN,{method:"parseInt",nanToZero:!0}),i=Ll(()=>o.value.rows||NaN,{method:"parseInt",nanToZero:!0}),s=A(()=>Math.max(i.value||2,2)),a=A(()=>Math.max(s.value,r.value||0)),l=A(()=>s.value===a.value?s.value:null),c=async()=>{if(!t.value||!L4(t.value)){n.value=null;return}const d=getComputedStyle(t.value),f=Number.parseFloat(d.lineHeight)||1,h=(Number.parseFloat(d.borderTopWidth)||0)+(Number.parseFloat(d.borderBottomWidth)||0),g=(Number.parseFloat(d.paddingTop)||0)+(Number.parseFloat(d.paddingBottom)||0),v=h+g,m=f*s.value+v,b=t.value.style.height||d.height;n.value="auto",await wn();const{scrollHeight:y}=t.value;n.value=b,await wn();const x=Math.max((y-g)/f,2),_=Math.min(Math.max(x,s.value),a.value),k=Math.max(Math.ceil(_*f+v),m);if(o.value.noAutoShrink&&(Number.parseFloat(b.toString())||0)>k){n.value=b;return}n.value=`${k}px`};fn(c);const u=A(()=>({resize:"none",height:typeof n.value=="string"?n.value:n.value?`${n.value}px`:void 0}));return{onInput:c,computedStyles:u,computedRows:l}},iE=["id","name","form","value","disabled","placeholder","required","autocomplete","readonly","aria-required","aria-invalid","rows","wrap"],ky=le({__name:"BFormTextarea",props:st({noResize:{type:Boolean,default:!1},rows:{default:2},wrap:{default:"soft"},noAutoShrink:{type:Boolean,default:!1},maxRows:{default:void 0},ariaInvalid:{type:[Boolean,String],default:void 0},autocomplete:{default:void 0},autofocus:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},form:{default:void 0},formatter:{type:Function,default:void 0},id:{default:void 0},lazyFormatter:{type:Boolean,default:!1},list:{default:void 0},name:{default:void 0},placeholder:{default:void 0},plaintext:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},size:{default:void 0},state:{type:[Boolean,null],default:void 0},debounce:{default:0},debounceMaxWait:{default:NaN}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(t,{expose:e}){const o=Ht(t,"BFormTextarea"),[r,i]=ft(t,"modelValue",{set:k=>V4(k,i)}),s=ht("_input"),{computedId:a,forceUpdateKey:l,computedAriaInvalid:c,onInput:u,stateClass:d,onChange:f,onBlur:h,focus:g,blur:v}=z4(o,s,r,i),m=A(()=>[d.value,o.plaintext?"form-control-plaintext":"form-control",{[`form-control-${o.size}`]:!!o.size}]),{computedStyles:b,onInput:y,computedRows:x}=rE(s,A(()=>({maxRows:o.maxRows,rows:o.rows,noAutoShrink:o.noAutoShrink}))),_=A(()=>({resize:o.noResize?"none":void 0,...o.maxRows||o.noAutoShrink?b.value:void 0}));return e({blur:v,element:s,focus:g}),(k,E)=>(w(),R("textarea",{id:p(a),ref:"_input",key:p(l),class:Te(m.value),name:p(o).name||void 0,form:p(o).form||void 0,value:p(r)??void 0,disabled:p(o).disabled,placeholder:p(o).placeholder,required:p(o).required||void 0,autocomplete:p(o).autocomplete||void 0,readonly:p(o).readonly||p(o).plaintext,"aria-required":p(o).required||void 0,"aria-invalid":p(c),rows:p(x)||2,style:Pt(_.value),wrap:p(o).wrap||void 0,onInput:E[0]||(E[0]=L=>{p(u)(L),p(y)()}),onChange:E[1]||(E[1]=(...L)=>p(f)&&p(f)(...L)),onBlur:E[2]||(E[2]=(...L)=>p(h)&&p(h)(...L))},null,46,iE))}});function sE(t){return ql()?(Ma(t),!0):!1}function g1(t){return typeof t=="function"?t():p(t)}typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const aE=t=>t!=null;function lE(t){var e;const n=g1(t);return(e=n==null?void 0:n.$el)!=null?e:n}/*!
|
|
24
|
+
* tabbable 6.2.0
|
|
25
|
+
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
26
|
+
*/var H4=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Op=H4.join(","),W4=typeof Element>"u",Dl=W4?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Bp=!W4&&Element.prototype.getRootNode?function(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}:function(t){return t==null?void 0:t.ownerDocument},Lp=function t(e,n){var o;n===void 0&&(n=!0);var r=e==null||(o=e.getAttribute)===null||o===void 0?void 0:o.call(e,"inert"),i=r===""||r==="true",s=i||n&&e&&t(e.parentNode);return s},cE=function(e){var n,o=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"contenteditable");return o===""||o==="true"},U4=function(e,n,o){if(Lp(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Op));return n&&Dl.call(e,Op)&&r.unshift(e),r=r.filter(o),r},G4=function t(e,n,o){for(var r=[],i=Array.from(e);i.length;){var s=i.shift();if(!Lp(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),l=a.length?a:s.children,c=t(l,!0,o);o.flatten?r.push.apply(r,c):r.push({scopeParent:s,candidates:c})}else{var u=Dl.call(s,Op);u&&o.filter(s)&&(n||!e.includes(s))&&r.push(s);var d=s.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(s),f=!Lp(d,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(s));if(d&&f){var h=t(d===!0?s.children:d.children,!0,o);o.flatten?r.push.apply(r,h):r.push({scopeParent:s,candidates:h})}else i.unshift.apply(i,s.children)}}return r},q4=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},vl=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||cE(e))&&!q4(e)?0:e.tabIndex},uE=function(e,n){var o=vl(e);return o<0&&n&&!q4(e)?0:o},dE=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},Y4=function(e){return e.tagName==="INPUT"},fE=function(e){return Y4(e)&&e.type==="hidden"},hE=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(o){return o.tagName==="SUMMARY"});return n},pE=function(e,n){for(var o=0;o<e.length;o++)if(e[o].checked&&e[o].form===n)return e[o]},mE=function(e){if(!e.name)return!0;var n=e.form||Bp(e),o=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=o(window.CSS.escape(e.name));else try{r=o(e.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var i=pE(r,e.form);return!i||i===e},gE=function(e){return Y4(e)&&e.type==="radio"},vE=function(e){return gE(e)&&!mE(e)},bE=function(e){var n,o=e&&Bp(e),r=(n=o)===null||n===void 0?void 0:n.host,i=!1;if(o&&o!==e){var s,a,l;for(i=!!((s=r)!==null&&s!==void 0&&(a=s.ownerDocument)!==null&&a!==void 0&&a.contains(r)||e!=null&&(l=e.ownerDocument)!==null&&l!==void 0&&l.contains(e));!i&&r;){var c,u,d;o=Bp(r),r=(c=o)===null||c===void 0?void 0:c.host,i=!!((u=r)!==null&&u!==void 0&&(d=u.ownerDocument)!==null&&d!==void 0&&d.contains(r))}}return i},Jw=function(e){var n=e.getBoundingClientRect(),o=n.width,r=n.height;return o===0&&r===0},yE=function(e,n){var o=n.displayCheck,r=n.getShadowRoot;if(getComputedStyle(e).visibility==="hidden")return!0;var i=Dl.call(e,"details>summary:first-of-type"),s=i?e.parentElement:e;if(Dl.call(s,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="legacy-full"){if(typeof r=="function"){for(var a=e;e;){var l=e.parentElement,c=Bp(e);if(l&&!l.shadowRoot&&r(l)===!0)return Jw(e);e.assignedSlot?e=e.assignedSlot:!l&&c!==e.ownerDocument?e=c.host:e=l}e=a}if(bE(e))return!e.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return Jw(e);return!1},xE=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var n=e.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var o=0;o<n.children.length;o++){var r=n.children.item(o);if(r.tagName==="LEGEND")return Dl.call(n,"fieldset[disabled] *")?!0:!r.contains(e)}return!0}n=n.parentElement}return!1},Pp=function(e,n){return!(n.disabled||Lp(n)||fE(n)||yE(n,e)||hE(n)||xE(n))},v1=function(e,n){return!(vE(n)||vl(n)<0||!Pp(e,n))},wE=function(e){var n=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},_E=function t(e){var n=[],o=[];return e.forEach(function(r,i){var s=!!r.scopeParent,a=s?r.scopeParent:r,l=uE(a,s),c=s?t(r.candidates):a;l===0?s?n.push.apply(n,c):n.push(a):o.push({documentOrder:i,tabIndex:l,item:r,isScope:s,content:c})}),o.sort(dE).reduce(function(r,i){return i.isScope?r.push.apply(r,i.content):r.push(i.content),r},[]).concat(n)},kE=function(e,n){n=n||{};var o;return n.getShadowRoot?o=G4([e],n.includeContainer,{filter:v1.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:wE}):o=U4(e,n.includeContainer,v1.bind(null,n)),_E(o)},SE=function(e,n){n=n||{};var o;return n.getShadowRoot?o=G4([e],n.includeContainer,{filter:Pp.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):o=U4(e,n.includeContainer,Pp.bind(null,n)),o},dc=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return Dl.call(e,Op)===!1?!1:v1(n,e)},AE=H4.concat("iframe").join(","),Gg=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return Dl.call(e,AE)===!1?!1:Pp(n,e)};/*!
|
|
27
|
+
* focus-trap 7.6.2
|
|
28
|
+
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
29
|
+
*/function b1(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}function CE(t){if(Array.isArray(t))return b1(t)}function $E(t,e,n){return(e=LE(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function TE(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ME(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
30
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e_(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function t_(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?e_(Object(n),!0).forEach(function(o){$E(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e_(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function OE(t){return CE(t)||TE(t)||PE(t)||ME()}function BE(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function LE(t){var e=BE(t,"string");return typeof e=="symbol"?e:e+""}function PE(t,e){if(t){if(typeof t=="string")return b1(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b1(t,e):void 0}}var n_={activateTrap:function(e,n){if(e.length>0){var o=e[e.length-1];o!==n&&o.pause()}var r=e.indexOf(n);r===-1||e.splice(r,1),e.push(n)},deactivateTrap:function(e,n){var o=e.indexOf(n);o!==-1&&e.splice(o,1),e.length>0&&e[e.length-1].unpause()}},DE=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},EE=function(e){return(e==null?void 0:e.key)==="Escape"||(e==null?void 0:e.key)==="Esc"||(e==null?void 0:e.keyCode)===27},Sd=function(e){return(e==null?void 0:e.key)==="Tab"||(e==null?void 0:e.keyCode)===9},IE=function(e){return Sd(e)&&!e.shiftKey},NE=function(e){return Sd(e)&&e.shiftKey},o_=function(e){return setTimeout(e,0)},Uu=function(e){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return typeof e=="function"?e.apply(void 0,o):e},nh=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},RE=[],FE=function(e,n){var o=(n==null?void 0:n.document)||document,r=(n==null?void 0:n.trapStack)||RE,i=t_({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:IE,isKeyBackward:NE},n),s={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},a,l=function(M,P,$){return M&&M[P]!==void 0?M[P]:i[$||P]},c=function(M,P){var $=typeof(P==null?void 0:P.composedPath)=="function"?P.composedPath():void 0;return s.containerGroups.findIndex(function(F){var V=F.container,U=F.tabbableNodes;return V.contains(M)||($==null?void 0:$.includes(V))||U.find(function(K){return K===M})})},u=function(M){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},$=P.hasFallback,F=$===void 0?!1:$,V=P.params,U=V===void 0?[]:V,K=i[M];if(typeof K=="function"&&(K=K.apply(void 0,OE(U))),K===!0&&(K=void 0),!K){if(K===void 0||K===!1)return K;throw new Error("`".concat(M,"` was specified but was not a node, or did not return a node"))}var ae=K;if(typeof K=="string"){try{ae=o.querySelector(K)}catch(me){throw new Error("`".concat(M,'` appears to be an invalid selector; error="').concat(me.message,'"'))}if(!ae&&!F)throw new Error("`".concat(M,"` as selector refers to no known node"))}return ae},d=function(){var M=u("initialFocus",{hasFallback:!0});if(M===!1)return!1;if(M===void 0||M&&!Gg(M,i.tabbableOptions))if(c(o.activeElement)>=0)M=o.activeElement;else{var P=s.tabbableGroups[0],$=P&&P.firstTabbableNode;M=$||u("fallbackFocus")}else M===null&&(M=u("fallbackFocus"));if(!M)throw new Error("Your focus-trap needs to have at least one focusable element");return M},f=function(){if(s.containerGroups=s.containers.map(function(M){var P=kE(M,i.tabbableOptions),$=SE(M,i.tabbableOptions),F=P.length>0?P[0]:void 0,V=P.length>0?P[P.length-1]:void 0,U=$.find(function(me){return dc(me)}),K=$.slice().reverse().find(function(me){return dc(me)}),ae=!!P.find(function(me){return vl(me)>0});return{container:M,tabbableNodes:P,focusableNodes:$,posTabIndexesFound:ae,firstTabbableNode:F,lastTabbableNode:V,firstDomTabbableNode:U,lastDomTabbableNode:K,nextTabbableNode:function(de){var ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,te=P.indexOf(de);return te<0?ve?$.slice($.indexOf(de)+1).find(function(pe){return dc(pe)}):$.slice(0,$.indexOf(de)).reverse().find(function(pe){return dc(pe)}):P[te+(ve?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(M){return M.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!u("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(s.containerGroups.find(function(M){return M.posTabIndexesFound})&&s.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},h=function(M){var P=M.activeElement;if(P)return P.shadowRoot&&P.shadowRoot.activeElement!==null?h(P.shadowRoot):P},g=function(M){if(M!==!1&&M!==h(document)){if(!M||!M.focus){g(d());return}M.focus({preventScroll:!!i.preventScroll}),s.mostRecentlyFocusedNode=M,DE(M)&&M.select()}},v=function(M){var P=u("setReturnFocus",{params:[M]});return P||(P===!1?!1:M)},m=function(M){var P=M.target,$=M.event,F=M.isBackward,V=F===void 0?!1:F;P=P||nh($),f();var U=null;if(s.tabbableGroups.length>0){var K=c(P,$),ae=K>=0?s.containerGroups[K]:void 0;if(K<0)V?U=s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:U=s.tabbableGroups[0].firstTabbableNode;else if(V){var me=s.tabbableGroups.findIndex(function(J){var ge=J.firstTabbableNode;return P===ge});if(me<0&&(ae.container===P||Gg(P,i.tabbableOptions)&&!dc(P,i.tabbableOptions)&&!ae.nextTabbableNode(P,!1))&&(me=K),me>=0){var de=me===0?s.tabbableGroups.length-1:me-1,ve=s.tabbableGroups[de];U=vl(P)>=0?ve.lastTabbableNode:ve.lastDomTabbableNode}else Sd($)||(U=ae.nextTabbableNode(P,!1))}else{var te=s.tabbableGroups.findIndex(function(J){var ge=J.lastTabbableNode;return P===ge});if(te<0&&(ae.container===P||Gg(P,i.tabbableOptions)&&!dc(P,i.tabbableOptions)&&!ae.nextTabbableNode(P))&&(te=K),te>=0){var pe=te===s.tabbableGroups.length-1?0:te+1,we=s.tabbableGroups[pe];U=vl(P)>=0?we.firstTabbableNode:we.firstDomTabbableNode}else Sd($)||(U=ae.nextTabbableNode(P))}}else U=u("fallbackFocus");return U},b=function(M){var P=nh(M);if(!(c(P,M)>=0)){if(Uu(i.clickOutsideDeactivates,M)){a.deactivate({returnFocus:i.returnFocusOnDeactivate});return}Uu(i.allowOutsideClick,M)||M.preventDefault()}},y=function(M){var P=nh(M),$=c(P,M)>=0;if($||P instanceof Document)$&&(s.mostRecentlyFocusedNode=P);else{M.stopImmediatePropagation();var F,V=!0;if(s.mostRecentlyFocusedNode)if(vl(s.mostRecentlyFocusedNode)>0){var U=c(s.mostRecentlyFocusedNode),K=s.containerGroups[U].tabbableNodes;if(K.length>0){var ae=K.findIndex(function(me){return me===s.mostRecentlyFocusedNode});ae>=0&&(i.isKeyForward(s.recentNavEvent)?ae+1<K.length&&(F=K[ae+1],V=!1):ae-1>=0&&(F=K[ae-1],V=!1))}}else s.containerGroups.some(function(me){return me.tabbableNodes.some(function(de){return vl(de)>0})})||(V=!1);else V=!1;V&&(F=m({target:s.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(s.recentNavEvent)})),g(F||s.mostRecentlyFocusedNode||d())}s.recentNavEvent=void 0},x=function(M){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;s.recentNavEvent=M;var $=m({event:M,isBackward:P});$&&(Sd(M)&&M.preventDefault(),g($))},_=function(M){(i.isKeyForward(M)||i.isKeyBackward(M))&&x(M,i.isKeyBackward(M))},k=function(M){EE(M)&&Uu(i.escapeDeactivates,M)!==!1&&(M.preventDefault(),a.deactivate())},E=function(M){var P=nh(M);c(P,M)>=0||Uu(i.clickOutsideDeactivates,M)||Uu(i.allowOutsideClick,M)||(M.preventDefault(),M.stopImmediatePropagation())},L=function(){if(s.active)return n_.activateTrap(r,a),s.delayInitialFocusTimer=i.delayInitialFocus?o_(function(){g(d())}):g(d()),o.addEventListener("focusin",y,!0),o.addEventListener("mousedown",b,{capture:!0,passive:!1}),o.addEventListener("touchstart",b,{capture:!0,passive:!1}),o.addEventListener("click",E,{capture:!0,passive:!1}),o.addEventListener("keydown",_,{capture:!0,passive:!1}),o.addEventListener("keydown",k),a},S=function(){if(s.active)return o.removeEventListener("focusin",y,!0),o.removeEventListener("mousedown",b,!0),o.removeEventListener("touchstart",b,!0),o.removeEventListener("click",E,!0),o.removeEventListener("keydown",_,!0),o.removeEventListener("keydown",k),a},B=function(M){var P=M.some(function($){var F=Array.from($.removedNodes);return F.some(function(V){return V===s.mostRecentlyFocusedNode})});P&&g(d())},D=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(B):void 0,N=function(){D&&(D.disconnect(),s.active&&!s.paused&&s.containers.map(function(M){D.observe(M,{subtree:!0,childList:!0})}))};return a={get active(){return s.active},get paused(){return s.paused},activate:function(M){if(s.active)return this;var P=l(M,"onActivate"),$=l(M,"onPostActivate"),F=l(M,"checkCanFocusTrap");F||f(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=o.activeElement,P==null||P();var V=function(){F&&f(),L(),N(),$==null||$()};return F?(F(s.containers.concat()).then(V,V),this):(V(),this)},deactivate:function(M){if(!s.active)return this;var P=t_({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},M);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,S(),s.active=!1,s.paused=!1,N(),n_.deactivateTrap(r,a);var $=l(P,"onDeactivate"),F=l(P,"onPostDeactivate"),V=l(P,"checkCanReturnFocus"),U=l(P,"returnFocus","returnFocusOnDeactivate");$==null||$();var K=function(){o_(function(){U&&g(v(s.nodeFocusedBeforeActivation)),F==null||F()})};return U&&V?(V(v(s.nodeFocusedBeforeActivation)).then(K,K),this):(K(),this)},pause:function(M){if(s.paused||!s.active)return this;var P=l(M,"onPause"),$=l(M,"onPostPause");return s.paused=!0,P==null||P(),S(),N(),$==null||$(),this},unpause:function(M){if(!s.paused||!s.active)return this;var P=l(M,"onUnpause"),$=l(M,"onPostUnpause");return s.paused=!1,P==null||P(),f(),L(),N(),$==null||$(),this},updateContainerElements:function(M){var P=[].concat(M).filter(Boolean);return s.containers=P.map(function($){return typeof $=="string"?o.querySelector($):$}),s.active&&f(),N(),this}},a.updateContainerElements(e),a};function VE(t,e={}){let n;const{immediate:o,...r}=e,i=ze(!1),s=ze(!1),a=f=>n&&n.activate(f),l=f=>n&&n.deactivate(f),c=()=>{n&&(n.pause(),s.value=!0)},u=()=>{n&&(n.unpause(),s.value=!1)},d=A(()=>{const f=g1(t);return(Array.isArray(f)?f:[f]).map(h=>{const g=g1(h);return typeof g=="string"?g:lE(g)}).filter(aE)});return qe(d,f=>{f.length&&(n=FE(f,{...r,onActivate(){i.value=!0,e.onActivate&&e.onActivate()},onDeactivate(){i.value=!1,e.onDeactivate&&e.onDeactivate()}}),o&&a())},{flush:"post"}),sE(()=>l()),{hasFocus:i,isPaused:s,activate:a,deactivate:l,pause:c,unpause:u}}const j4=({element:t,isActive:e,noTrap:n,fallbackFocus:o},r={allowOutsideClick:!0,fallbackFocus:o.ref.value??void 0,escapeDeactivates:!1})=>{const i=so(zt(e)),s=so(zt(n)),a=()=>{var u;const d=(u=t.value)==null?void 0:u.querySelectorAll(`a, button, input, select, textarea, [tabindex]:not([tabindex="-1"]):not(.${o.classSelector})`);return!d||d.length===0},l=ze(a());fn(()=>{l7(t,()=>{l.value=a()},{childList:!0,subtree:!0})});const c=VE(t,r);return qe(i,async u=>{await wn(),u&&s.value===!1?c.activate():c.deactivate()}),qe(s,u=>{u===!0&&c.deactivate()}),{needsFallback:so(l)}},zE=r4(v7);let oh="";const ll=new Map,X4=(t,e)=>{const n=so(zt(t)),o=r3(),r=A(()=>!bt(e)),i=zE(typeof document<"u"?document.body:null,n.value&&r.value);fn(()=>{typeof document>"u"||(ll.set(o,!1),qe([n,r],([s,a])=>{const l=window.innerWidth-document.documentElement.clientWidth,c=Array.from(ll.values()).some(f=>f===!0),u=s&&a;ll.set(o,u),u&&!c&&!i.value&&(i.value=!0,l>0&&(oh=document.body.style.paddingRight,document.body.style.paddingRight=`${l+oh}px`));const d=Array.from(ll.values()).some(f=>f===!0);c&&!d&&(ll.set(o,!1),i.value=!1,document.body.style.paddingRight=oh)},{immediate:!0}))}),Js(()=>{ll.delete(o),Array.from(ll.values()).some(a=>a===!0)||(document.body.style.paddingRight=oh,i.value=!1)})},HE=["id","aria-labelledby","aria-describedby"],WE=["id"],r_="modal-fallback-focus",i_=1056,UE=le({inheritAttrs:!1,__name:"BModal",props:st({autofocus:{type:Boolean,default:!0},autofocusButton:{default:void 0},backdropFirst:{type:Boolean,default:!1},body:{default:void 0},bodyAttrs:{default:void 0},bodyBgVariant:{default:null},bodyClass:{default:null},bodyScrolling:{type:Boolean,default:!1},bodyTextVariant:{default:null},bodyVariant:{default:null},busy:{type:Boolean,default:!1},buttonSize:{default:"md"},cancelDisabled:{type:Boolean,default:!1},cancelTitle:{default:"Cancel"},cancelVariant:{default:"secondary"},centered:{type:Boolean,default:!1},contentClass:{default:void 0},dialogClass:{default:void 0},footerBgVariant:{default:null},footerBorderVariant:{default:null},footerClass:{default:void 0},footerTextVariant:{default:null},footerVariant:{default:null},fullscreen:{type:[Boolean,String],default:!1},headerBgVariant:{default:null},headerBorderVariant:{default:null},headerClass:{default:void 0},headerCloseClass:{default:void 0},headerCloseLabel:{default:"Close"},headerCloseVariant:{default:"secondary"},headerTextVariant:{default:null},headerVariant:{default:null},noBackdrop:{type:Boolean,default:!1},noFooter:{type:Boolean,default:!1},noHeader:{type:Boolean,default:!1},noHeaderClose:{type:Boolean,default:!1},id:{default:void 0},modalClass:{default:void 0},noCloseOnBackdrop:{type:Boolean,default:!1},noCloseOnEsc:{type:Boolean,default:!1},noTrap:{type:Boolean,default:!1},noStacking:{type:Boolean},okDisabled:{type:Boolean,default:!1},okOnly:{type:Boolean,default:!1},okTitle:{default:"OK"},okVariant:{default:"primary"},scrollable:{type:Boolean,default:!1},size:{default:"md"},title:{default:void 0},titleClass:{default:void 0},titleVisuallyHidden:{type:Boolean,default:!1},titleTag:{default:"h5"},teleportDisabled:{type:Boolean,default:!1},teleportTo:{default:"body"},initialAnimation:{type:Boolean,default:!1},noAnimation:{type:Boolean},noFade:{type:Boolean,default:!1},lazy:{type:Boolean,default:!1},unmountLazy:{type:Boolean,default:!1},show:{type:Boolean,default:!1},transProps:{default:void 0},visible:{type:Boolean,default:!1}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:st(["backdrop","cancel","close","esc","ok","hide","hide-prevented","hidden","show","show-prevented","shown","toggle","toggle-prevented"],["update:modelValue"]),setup(t,{expose:e,emit:n}){const r=Ht(t,"BModal"),i=n,s=cs(),a=ko(()=>r.id,"modal"),l=ft(t,"modelValue"),c=ht("_element"),u=ht("_fallbackFocusElement"),d=ht("_okButton"),f=ht("_cancelButton"),h=ht("_closeButton"),g=()=>{r.autofocus!==!1&&(r.autofocusButton==="ok"?V.value=!0:r.autofocusButton==="close"?K.value=!0:r.autofocusButton==="cancel"?U.value=!0:F.value=!0)},v=()=>{g()},{showRef:m,renderRef:b,renderBackdropRef:y,hide:x,show:_,toggle:k,computedNoAnimation:E,transitionProps:L,backdropTransitionProps:S,isLeaving:B,isVisible:D,trapActive:N,contentShowing:C,backdropReady:M,backdropVisible:P}=dm(l,r,i,c,a,{transitionProps:{onAfterEnter:v}}),{needsFallback:$}=j4({element:c,isActive:N,noTrap:()=>r.noTrap,fallbackFocus:{ref:u,classSelector:r_}});Cs("Escape",()=>{x("esc")},{target:c}),X4(m,()=>r.bodyScrolling);const{focused:F}=Xi(c,{initialValue:l.value&&r.autofocusButton===void 0&&r.autofocus===!0}),{focused:V}=Xi(d,{initialValue:l.value&&r.autofocusButton==="ok"&&r.autofocus===!0}),{focused:U}=Xi(f,{initialValue:l.value&&r.autofocusButton==="cancel"&&r.autofocus===!0}),{focused:K}=Xi(h,{initialValue:l.value&&r.autofocusButton==="close"&&r.autofocus===!0}),ae=A(()=>!Zc(s["header-close"])),me=A(()=>[r.dialogClass,{"modal-fullscreen":r.fullscreen===!0,[`modal-fullscreen-${r.fullscreen}-down`]:typeof r.fullscreen=="string",[`modal-${r.size}`]:r.size!=="md","modal-dialog-centered":r.centered,"modal-dialog-scrollable":r.scrollable}]),de=Rs(()=>({bgVariant:r.bodyBgVariant,textVariant:r.bodyTextVariant,variant:r.bodyVariant})),ve=A(()=>[r.bodyClass,de.value]),te=Rs(()=>({bgVariant:r.headerBgVariant,textVariant:r.headerTextVariant,variant:r.headerVariant,borderVariant:r.headerBorderVariant})),pe=A(()=>[r.headerClass,te.value]),we=A(()=>({variant:ae.value?r.headerCloseVariant:void 0,class:r.headerCloseClass})),J=Rs(()=>({bgVariant:r.footerBgVariant,textVariant:r.footerTextVariant,variant:r.footerVariant,borderVariant:r.footerBorderVariant})),ge=A(()=>[r.footerClass,J.value]),re=A(()=>[r.titleClass,{"visually-hidden":r.titleVisuallyHidden}]),oe=A(()=>r.cancelDisabled||r.busy),he=A(()=>r.okDisabled||r.busy),{activePosition:I,activeModalCount:G,stackWithoutSelf:Y}=y7(m,l.value);qe(Y,(q,X)=>{q.length>X.length&&m.value===!0&&r.noStacking===!0&&x()});const se=A(()=>m.value||B.value?i_-(((G==null?void 0:G.value)??0)*2-((I==null?void 0:I.value)??0)*2):i_),fe=A(()=>({"z-index":se.value})),ne=A(()=>({"z-index":se.value-1})),Q=A(()=>({cancel:()=>{x("cancel")},close:()=>{x("close")},hide:x,ok:()=>{x("ok")},active:m.value,visible:m.value}));return e({hide:x,id:a,show:_,toggle:k}),(q,X)=>(w(),Z(um,{to:p(r).teleportTo,disabled:p(r).teleportDisabled},{default:ee(()=>[p(b)||p(C)?(w(),Z(Bl,Ct({key:0},p(L),{appear:l.value||p(r).visible,onAfterEnter:v}),{default:ee(()=>[ar(T("div",Ct({id:p(a),ref:"_element",class:["modal",[p(r).modalClass,{fade:!p(E),show:p(D)}]],role:"dialog","aria-labelledby":p(r).noHeader?void 0:`${p(a)}-label`,"aria-describedby":`${p(a)}-body`,tabindex:"-1"},q.$attrs,{style:fe.value,onClick:X[4]||(X[4]=gn(j=>p(x)("backdrop"),["self"]))}),[T("div",{class:Te(["modal-dialog",me.value])},[p(C)?(w(),R("div",{key:0,class:Te(["modal-content",p(r).contentClass])},[p(r).noHeader?ie("",!0):(w(),R("div",{key:0,class:Te(["modal-header",pe.value])},[Ce(q.$slots,"header",Wn(tr(Q.value)),()=>[(w(),Z(Gt(p(r).titleTag),{id:`${p(a)}-label`,class:Te(["modal-title",re.value])},{default:ee(()=>[Ce(q.$slots,"title",Wn(tr(Q.value)),()=>[Ye(be(p(r).title),1)],!0)]),_:3},8,["id","class"])),p(r).noHeaderClose?ie("",!0):(w(),R(We,{key:0},[ae.value?(w(),Z(Ho,Ct({key:0},we.value,{onClick:X[0]||(X[0]=j=>p(x)("close"))}),{default:ee(()=>[Ce(q.$slots,"header-close",{},void 0,!0)]),_:3},16)):(w(),Z(B4,Ct({key:1,"aria-label":p(r).headerCloseLabel},we.value,{onClick:X[1]||(X[1]=j=>p(x)("close"))}),null,16,["aria-label"]))],64))],!0)],2)),T("div",Ct({id:`${p(a)}-body`,class:["modal-body",ve.value]},p(r).bodyAttrs),[Ce(q.$slots,"default",Wn(tr(Q.value)),()=>[Ye(be(p(r).body),1)],!0)],16,WE),p(r).noFooter?ie("",!0):(w(),R("div",{key:1,class:Te(["modal-footer",ge.value])},[Ce(q.$slots,"footer",Wn(tr(Q.value)),()=>[Ce(q.$slots,"cancel",Wn(tr(Q.value)),()=>[p(r).okOnly?ie("",!0):(w(),Z(Ho,{key:0,ref:"_cancelButton",disabled:oe.value,size:p(r).buttonSize,variant:p(r).cancelVariant,onClick:X[2]||(X[2]=j=>p(x)("cancel"))},{default:ee(()=>[Ye(be(p(r).cancelTitle),1)]),_:1},8,["disabled","size","variant"]))],!0),Ce(q.$slots,"ok",Wn(tr(Q.value)),()=>[H(Ho,{ref:"_okButton",disabled:he.value,size:p(r).buttonSize,variant:p(r).okVariant,onClick:X[3]||(X[3]=j=>p(x)("ok"))},{default:ee(()=>[Ye(be(p(r).okTitle),1)]),_:1},8,["disabled","size","variant"])],!0)],!0)],2))],2)):ie("",!0)],2),p($)?(w(),R("div",{key:0,ref:"_fallbackFocusElement",class:Te(r_),tabindex:"0",style:{width:"0",height:"0",overflow:"hidden"}},null,512)):ie("",!0)],16,HE),[[qc,p(m)&&(p(M)&&p(r).backdropFirst||!p(r).backdropFirst)]])]),_:3},16,["appear"])):ie("",!0),p(r).noBackdrop?ie("",!0):Ce(q.$slots,"backdrop",Wn(Ct({key:1},Q.value)),()=>[p(y)?(w(),Z(Bl,Wn(Ct({key:0},p(S))),{default:ee(()=>[ar(T("div",{class:Te(["modal-backdrop",{fade:!p(E),show:p(P)||p(E)}]),style:Pt(ne.value),onClick:X[5]||(X[5]=j=>p(x)("backdrop"))},null,6),[[qc,p(m)||p(B)&&p(r).backdropFirst&&!p(E)]])]),_:1},16)):ie("",!0)],!0)]),_:3},8,["to","disabled"]))}}),GE=fm(UE,[["__scopeId","data-v-93972863"]]),qE=["id","aria-labelledby"],YE=["id"],s_="offcanvas-fallback-focus",jE=le({inheritAttrs:!1,__name:"BOffcanvas",props:st({noBackdrop:{type:Boolean,default:!1},backdropFirst:{type:Boolean,default:!1},bodyAttrs:{default:void 0},bodyClass:{default:void 0},bodyScrolling:{type:Boolean,default:!1},footerClass:{default:void 0},headerClass:{default:void 0},headerCloseClass:{default:void 0},headerCloseLabel:{default:"Close"},headerCloseVariant:{default:"secondary"},id:{default:void 0},noCloseOnBackdrop:{type:Boolean,default:!1},noCloseOnEsc:{type:Boolean,default:!1},noFocus:{type:Boolean,default:!1},noHeader:{type:Boolean,default:!1},noTrap:{type:Boolean,default:!1},noHeaderClose:{type:Boolean,default:!1},placement:{default:"start"},shadow:{type:[String,Boolean],default:!1},title:{default:void 0},responsive:{},width:{default:void 0},teleportDisabled:{type:Boolean,default:!1},teleportTo:{default:"body"},initialAnimation:{type:Boolean,default:!1},noAnimation:{type:Boolean,default:!1},noFade:{type:Boolean},lazy:{type:Boolean,default:!1},unmountLazy:{type:Boolean,default:!1},show:{type:Boolean,default:!1},transProps:{},visible:{type:Boolean,default:!1}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:st(["close","esc","backdrop","breakpoint","hide","hide-prevented","hidden","show","show-prevented","shown","toggle","toggle-prevented"],["update:modelValue"]),setup(t,{expose:e,emit:n}){const r=Ht(t,"BOffcanvas"),i=n,s=cs(),a=ft(t,"modelValue"),l=ko(()=>r.id,"offcanvas"),c=ht("_element"),u=ht("_fallbackFocusElement"),d=()=>{wn(()=>{r.noFocus===!1&&!$.value&&(F.value=!0)})},{showRef:f,renderRef:h,renderBackdropRef:g,hide:v,show:m,toggle:b,computedNoAnimation:y,contentShowing:x,transitionProps:_,backdropReady:k,backdropTransitionProps:E,backdropVisible:L,isVisible:S,buildTriggerableEvent:B,localNoAnimation:D,isLeaving:N,trapActive:C}=dm(a,r,i,c,l,{transitionProps:{onAfterEnter:d,enterToClass:"showing",leaveToClass:"hiding",enterActiveClass:"",leaveActiveClass:"",enterFromClass:"",leaveFromClass:""}}),P=u7(c7).smallerOrEqual(()=>r.responsive??"xs"),$=ze(r.responsive!==void 0&&!P.value);fn(()=>{r.responsive!==void 0&&i("breakpoint",B("breakpoint"),$.value)}),X4(f,()=>r.bodyScrolling||$.value),Cs("Escape",()=>{v("esc")},{target:c});const{focused:F}=Xi(c,{initialValue:a.value&&r.noFocus===!1&&!$.value}),{needsFallback:V}=j4({element:c,isActive:C,noTrap:()=>r.noTrap||$.value,fallbackFocus:{classSelector:s_,ref:u}}),U=A(()=>(r.responsive===void 0||!$.value)&&r.noBackdrop===!1&&(f.value===!0||N.value&&r.backdropFirst&&!y.value)),K=A(()=>!Zc(s["header-close"])),ae=A(()=>[{"text-reset":!K.value},r.headerCloseClass]),me=A(()=>({variant:K.value?r.headerCloseVariant:void 0,class:ae.value})),de=A(()=>!Zc(s.footer)),ve=A(()=>[r.responsive===void 0?"offcanvas":`offcanvas-${r.responsive}`,`offcanvas-${r.placement}`,{show:S.value,[`shadow-${r.shadow}`]:!!r.shadow,"no-transition":y.value}]),te=A(()=>({width:r.width})),pe=A(()=>({visible:f.value,placement:r.placement,hide:v}));return qe(P,we=>{r.responsive!==void 0&&(we===!0?(D.value=!0,requestAnimationFrame(()=>{$.value=!1}),i("breakpoint",B("breakpoint"),!1),i("hide",B("hide"))):(D.value=!0,requestAnimationFrame(()=>{$.value=!0}),i("breakpoint",B("breakpoint"),!0),i("show",B("show"))))}),e({hide:v,show:m,toggle:b,isOpenByBreakpoint:$}),(we,J)=>(w(),Z(um,{to:p(r).teleportTo,disabled:p(r).teleportDisabled||$.value},{default:ee(()=>[p(h)||p(x)||$.value?(w(),Z(Bl,Ct({key:0},p(_),{appear:a.value||p(r).visible}),{default:ee(()=>[ar(T("div",Ct({id:p(l),ref:"_element","aria-modal":"true",role:"dialog",class:ve.value,style:te.value,tabindex:"-1","aria-labelledby":`${p(l)}-offcanvas-label`,"data-bs-backdrop":"false"},we.$attrs),[p(x)||$.value?(w(),R(We,{key:0},[p(r).noHeader?ie("",!0):(w(),R("div",{key:0,class:Te(["offcanvas-header",p(r).headerClass])},[Ce(we.$slots,"header",Wn(tr(pe.value)),()=>[T("h5",{id:`${p(l)}-offcanvas-label`,class:"offcanvas-title"},[Ce(we.$slots,"title",Wn(tr(pe.value)),()=>[Ye(be(p(r).title),1)],!0)],8,YE),p(r).noHeaderClose?ie("",!0):(w(),R(We,{key:0},[K.value?(w(),Z(Ho,Ct({key:0},me.value,{onClick:J[0]||(J[0]=ge=>p(v)("close"))}),{default:ee(()=>[Ce(we.$slots,"header-close",{},void 0,!0)]),_:3},16)):(w(),Z(B4,Ct({key:1,"aria-label":p(r).headerCloseLabel},me.value,{onClick:J[1]||(J[1]=ge=>p(v)("close"))}),null,16,["aria-label"]))],64))],!0)],2)),T("div",Ct({class:["offcanvas-body",p(r).bodyClass]},p(r).bodyAttrs),[Ce(we.$slots,"default",Wn(tr(pe.value)),void 0,!0)],16),de.value?(w(),R("div",{key:1,class:Te(p(r).footerClass)},[Ce(we.$slots,"footer",Wn(tr(pe.value)),void 0,!0)],2)):ie("",!0)],64)):ie("",!0),p(V)?(w(),R("div",{key:1,ref:"_fallbackFocusElement",class:Te(s_),tabindex:"0",style:{width:"0",height:"0",overflow:"hidden"}},null,512)):ie("",!0)],16,qE),[[qc,p(f)&&(p(k)&&p(r).backdropFirst||!p(r).backdropFirst)||$.value]])]),_:3},16,["appear"])):ie("",!0),p(r).noBackdrop?ie("",!0):Ce(we.$slots,"backdrop",Wn(Ct({key:1},pe.value)),()=>[p(g)?(w(),Z(Bl,Wn(Ct({key:0},p(E))),{default:ee(()=>[ar(T("div",{class:Te(["offcanvas-backdrop",{fade:!p(y),show:p(L)||p(y)}]),onClick:J[2]||(J[2]=ge=>p(v)("backdrop"))},null,2),[[qc,U.value]])]),_:1},16)):ie("",!0)],!0)]),_:3},8,["to","disabled"]))}}),XE=fm(jE,[["__scopeId","data-v-77d852fe"]]),KE="300px",ZE=le({__name:"BTableSimple",props:{bordered:{type:Boolean,default:!1},borderless:{type:Boolean,default:!1},borderVariant:{default:null},captionTop:{type:Boolean,default:!1},dark:{type:Boolean,default:!1},fixed:{type:Boolean,default:!1},hover:{type:Boolean,default:!1},id:{default:void 0},noBorderCollapse:{type:Boolean,default:!1},outlined:{type:Boolean,default:!1},responsive:{type:[Boolean,String],default:!1},small:{type:Boolean,default:!1},stacked:{type:[Boolean,String],default:!1},stickyHeader:{type:[Boolean,String,Number],default:!1},striped:{type:Boolean,default:!1},stripedColumns:{type:Boolean,default:!1},variant:{default:null},tableAttrs:{default:void 0},tableClass:{default:void 0}},setup(t){const n=Ht(t,"BTableSimple"),o=ko(()=>n.id),r=Rs(A(()=>({borderVariant:n.borderVariant}))),i=A(()=>[n.tableClass,"table","b-table",r.value,{border:n.outlined,"table-bordered":n.bordered,"table-borderless":n.borderless,"caption-top":n.captionTop,"table-dark":n.dark,"table-hover":n.hover,"b-table-stacked":n.stacked===!0,[`b-table-stacked-${n.stacked}`]:typeof n.stacked=="string","table-striped":n.striped,"table-sm":n.small,[`table-${n.variant}`]:n.variant!==null,"table-striped-columns":n.stripedColumns}]),s=A(()=>({id:o.value,class:i.value,...n.tableAttrs})),a=LD(A(()=>(n.stickyHeader===!0?KE:n.stickyHeader)||NaN)),l=A(()=>n.stickyHeader!==!1),c=A(()=>n.responsive!==!1||l.value),u=A(()=>l.value?{maxHeight:a.value}:void 0),d=A(()=>({"table-responsive":n.responsive===!0,[`table-responsive-${n.responsive}`]:typeof n.responsive=="string","b-table-sticky-header":l.value}));return(f,h)=>c.value?(w(),R("div",{key:0,class:Te(d.value),style:Pt(u.value)},[T("table",Wn(tr(s.value)),[Ce(f.$slots,"default")],16)],6)):(w(),R("table",Wn(Ct({key:1},s.value)),[Ce(f.$slots,"default")],16))}}),qd=le({__name:"BTooltip",props:st({interactive:{type:Boolean,default:void 0},boundary:{},boundaryPadding:{},click:{type:Boolean,default:void 0},closeOnHide:{type:Boolean},content:{default:void 0},customClass:{default:void 0},delay:{default:void 0},floatingMiddleware:{default:void 0},hideMargin:{},id:{default:void 0},inline:{type:Boolean,default:void 0},manual:{type:Boolean,default:void 0},noAutoClose:{type:Boolean,default:void 0},noFlip:{type:Boolean,default:void 0},noHide:{type:Boolean,default:void 0},noShift:{type:Boolean,default:void 0},noSize:{type:Boolean},noninteractive:{type:Boolean,default:void 0},offset:{default:void 0},placement:{default:void 0},realtime:{type:Boolean,default:void 0},reference:{default:void 0},strategy:{default:void 0},target:{default:void 0},title:{default:void 0},variant:{default:void 0},teleportDisabled:{type:Boolean,default:void 0},teleportTo:{default:void 0},initialAnimation:{type:Boolean,default:!1},noAnimation:{type:Boolean},noFade:{type:Boolean,default:void 0},lazy:{type:Boolean,default:void 0},unmountLazy:{type:Boolean,default:void 0},show:{type:Boolean,default:void 0},transProps:{},visible:{type:Boolean,default:void 0}},{modelValue:{type:Boolean,default:void 0},modelModifiers:{}}),emits:["update:modelValue"],setup(t,{expose:e}){const o=Ht(t,"BTooltip"),r=cs(),i=ft(t,"modelValue"),s=A(()=>{const{interactive:l,noninteractive:c,...u}=o;return{noninteractive:c!==void 0?c:!l,...u}}),a=ht("_popover");return e({hide:()=>{var l;(l=a.value)==null||l.hide()},show:()=>{var l;(l=a.value)==null||l.show()},toggle:()=>{var l;(l=a.value)==null||l.toggle()}}),(l,c)=>(w(),Z(M4,Ct({ref:"_popover"},s.value,{modelValue:i.value,"onUpdate:modelValue":c[0]||(c[0]=u=>i.value=u),tooltip:""}),wi({_:2},[r.default?{name:"default",fn:ee(()=>[Ce(l.$slots,"default")]),key:"0"}:void 0,r.target?{name:"target",fn:ee(u=>[Ce(l.$slots,"target",Wn(tr(u)))]),key:"1"}:void 0,r.title?{name:"title",fn:ee(()=>[Ce(l.$slots,"title")]),key:"2"}:void 0]),1040,["modelValue"]))}}),QE=le({__name:"BTbody",props:{variant:{default:null}},setup(t){const n=Ht(t,"BTbody"),o=A(()=>({[`thead-${n.variant}`]:n.variant!==null}));return(r,i)=>(w(),R("tbody",{class:Te(o.value)},[Ce(r.$slots,"default")],2))}}),JE=["scope","colspan","rowspan","data-label"],eI={key:0},a_=le({__name:"BTd",props:{colspan:{default:void 0},rowspan:{default:void 0},stackedHeading:{default:void 0},stickyColumn:{type:Boolean,default:!1},variant:{default:null}},setup(t){const n=Ht(t,"BTd"),o=A(()=>({[`table-${n.variant}`]:n.variant!==null,"b-table-sticky-column":n.stickyColumn,"table-b-table-default":n.stickyColumn&&n.variant===null})),r=A(()=>n.colspan?"colspan":n.rowspan?"rowspan":"col");return(i,s)=>(w(),R("td",{scope:r.value,class:Te(o.value),colspan:p(n).colspan,rowspan:p(n).rowspan,"data-label":p(n).stackedHeading},[p(n).stackedHeading?(w(),R("div",eI,[Ce(i.$slots,"default")])):Ce(i.$slots,"default",{key:1})],10,JE))}}),tI=["scope","colspan","rowspan","data-label"],nI={key:0},l_=le({__name:"BTh",props:{colspan:{default:void 0},rowspan:{default:void 0},stackedHeading:{default:void 0},stickyColumn:{type:Boolean,default:!1},variant:{default:null}},setup(t){const n=Ht(t,"BTh"),o=A(()=>({[`table-${n.variant}`]:n.variant!==null,"b-table-sticky-column":n.stickyColumn,"table-b-table-default":n.stickyColumn&&n.variant===null})),r=A(()=>n.colspan?"colspan":n.rowspan?"rowspan":"col");return(i,s)=>(w(),R("th",{scope:r.value,class:Te(o.value),colspan:p(n).colspan,rowspan:p(n).rowspan,"data-label":p(n).stackedHeading},[p(n).stackedHeading!==void 0?(w(),R("div",nI,[Ce(i.$slots,"default")])):Ce(i.$slots,"default",{key:1})],10,tI))}}),oI=le({__name:"BThead",props:{variant:{default:null}},setup(t){const n=Ht(t,"BThead"),o=A(()=>({[`table-${n.variant}`]:n.variant!==null}));return(r,i)=>(w(),R("thead",{class:Te(o.value)},[Ce(r.$slots,"default")],2))}}),c_=le({__name:"BTr",props:{variant:{default:null}},setup(t){const n=Ht(t,"BTr"),o=A(()=>({[`table-${n.variant}`]:n.variant!==null}));return(r,i)=>(w(),R("tr",{class:Te(o.value)},[Ce(r.$slots,"default")],2))}});Object.freeze(Object.keys({bordered:0,borderless:0,borderVariant:0,captionTop:0,dark:0,fixed:0,hover:0,id:0,noBorderCollapse:0,outlined:0,responsive:0,small:0,stacked:0,stickyHeader:0,striped:0,stripedColumns:0,variant:0,tableAttrs:0,tableClass:0}));Object.freeze(Object.keys({align:0,caption:0,detailsTdClass:0,fieldColumnClass:0,fields:0,footClone:0,footRowVariant:0,footVariant:0,headRowVariant:0,headVariant:0,items:0,labelStacked:0,modelValue:0,primaryKey:0,tbodyClass:0,tbodyTrAttrs:0,tbodyTrClass:0,tfootClass:0,tfootTrClass:0,theadClass:0,theadTrClass:0}));const K4={BAccordion:"/components/BAccordion",BAccordionItem:"/components/BAccordion",BAlert:"/components/BAlert",BAvatar:"/components/BAvatar",BAvatarGroup:"/components/BAvatar",BBadge:"/components/BBadge",BBreadcrumb:"/components/BBreadcrumb",BBreadcrumbItem:"/components/BBreadcrumb",BButton:"/components/BButton",BButtonGroup:"/components/BButton",BButtonToolbar:"/components/BButton",BCloseButton:"/components/BButton",BCard:"/components/BCard",BCardBody:"/components/BCard",BCardFooter:"/components/BCard",BCardGroup:"/components/BCard",BCardHeader:"/components/BCard",BCardImg:"/components/BCard",BCardSubtitle:"/components/BCard",BCardText:"/components/BCard",BCardTitle:"/components/BCard",BCarousel:"/components/BCarousel",BCarouselSlide:"/components/BCarousel",BCol:"/components/BContainer",BCollapse:"/components/BCollapse",BContainer:"/components/BContainer",BDropdown:"/components/BDropdown",BDropdownDivider:"/components/BDropdown",BDropdownForm:"/components/BDropdown",BDropdownGroup:"/components/BDropdown",BDropdownHeader:"/components/BDropdown",BDropdownItem:"/components/BDropdown",BDropdownItemButton:"/components/BDropdown",BDropdownText:"/components/BDropdown",BForm:"/components/BForm",BFormCheckbox:"/components/BFormCheckbox",BFormCheckboxGroup:"/components/BFormCheckbox",BFormDatalist:"/components/BForm",BFormFile:"/components/BFormFile",BFormFloatingLabel:"/components/BForm",BFormGroup:"/components/BFormGroup",BFormInput:"/components/BFormInput",BFormInvalidFeedback:"/components/BForm",BFormRadio:"/components/BFormRadio",BFormRadioGroup:"/components/BFormRadio",BFormRow:"/components/BForm",BFormSelect:"/components/BFormSelect",BFormSelectOption:"/components/BFormSelect",BFormSelectOptionGroup:"/components/BFormSelect",BFormSpinbutton:"/components/BFormSpinbutton",BFormTag:"/components/BFormTags",BFormTags:"/components/BFormTags",BFormText:"/components/BForm",BFormTextarea:"/components/BFormTextarea",BFormValidFeedback:"/components/BForm",BImg:"/components/BImg",BInput:"/components/BFormInput",BInputGroup:"/components/BInputGroup",BInputGroupText:"/components/BInputGroup",BListGroup:"/components/BListGroup",BListGroupItem:"/components/BListGroup",BModal:"/components/BModal",BModalOrchestrator:"/components/BModal",BNav:"/components/BNav",BNavForm:"/components/BNav",BNavItem:"/components/BNav",BNavItemDropdown:"/components/BNav",BNavText:"/components/BNav",BNavbar:"/components/BNavbar",BNavbarBrand:"/components/BNavbar",BNavbarNav:"/components/BNavbar",BNavbarToggle:"/components/BNavbar",BOffcanvas:"/components/BOffcanvas",BOverlay:"/components/BOverlay",BPagination:"/components/BPagination",BPlaceholder:"/components/BPlaceholder",BPlaceholderButton:"/components/BPlaceholder",BPlaceholderCard:"/components/BPlaceholder",BPlaceholderTable:"/components/BPlaceholder",BPlaceholderWrapper:"/components/BPlaceholder",BPopover:"/components/BPopover",BProgress:"/components/BProgress",BRow:"/components/BContainer",BSpinner:"/components/BSpinner",BTab:"/components/BTabs",BTabs:"/components/BTabs",BToast:"/components/BToast",BToastOrchestrator:"/components/BToast",BTooltip:"/components/BTooltip",BLink:"/components/BLink",BProgressBar:"/components/BProgress",BTableSimple:"/components/BTable",BTableLite:"/components/BTable",BTable:"/components/BTable",BTbody:"/components/BTable",BTd:"/components/BTable",BTh:"/components/BTable",BThead:"/components/BTable",BTfoot:"/components/BTable",BTr:"/components/BTable",BPopoverOrchestrator:"/components/BPopover"},rI=Object.freeze(Object.keys(K4)),Z4={vBColorMode:"/directives/BColorMode",vBModal:"/directives/BModal",vBPopover:"/directives/BPopover",vBScrollspy:"/directives/BScrollspy",vBToggle:"/directives/BToggle",vBTooltip:"/directives/BTooltip"},iI=Object.freeze(Object.keys(Z4)),sI={useBreadcrumb:"/composables/useBreadcrumb",useColorMode:"/composables/useColorMode",useModal:"/composables/useModal",useModalController:"/composables/useModalController",useScrollspy:"/composables/useScrollspy",useToastController:"/composables/useToastController",usePopoverController:"/composables/usePopoverController"};Object.freeze(Object.keys(sI));const u_="bootstrap-vue-next",d_=(t,e)=>{const{all:n,...o}=t,r={};n&&e.forEach(s=>{r[s]=n});const i={...r,...o};return Object.entries(i).filter(([s,a])=>!!a&&e.includes(s)).map(([s])=>s)},qg=new Set,f_=new Set;Object.assign(({aliases:t={},directives:e=!0,components:n=!0}={})=>{const r=d_(typeof n=="boolean"?{all:n}:n,rI).reduce((l,c)=>(l.set(c,`${u_}${K4[c]}`),l),new Map),s=d_(typeof e=="boolean"?{all:e}:e,iI).reduce((l,c)=>{const u=c.toLowerCase().startsWith("v")?c:`v${c}`;return l.set(u,`${u_}${Z4[u]}`),l},new Map);return[{type:"component",resolve(l){const c=r.get(l),u=r.get(t[l]);if(u){const d=t[l];return qg.add(d),{name:d,from:u}}if(c)return qg.add(l),{name:l,from:c}}},{type:"directive",resolve(l){const c=`v${l}`,u=s.get(c);if(u)return f_.add(c),{name:c,from:u}}}]},{__usedComponents:qg,__usedDirectives:f_});const aI={install(t,e){const n=(e==null?void 0:e.components)??{};t.provide(jh,ze(n))}},lI={install(t){const e=ze([]),n=()=>{e.value.splice(0,e.value.length)};t.provide(zP,{items:e,reset:n})}},cI={install(t){const e=ze(new Map),n=()=>{let l=()=>{};return{value:new Promise(u=>{l=u}),resolve:l}},o=l=>[n(),l||Symbol("Modals controller"),!0],r=(l={})=>{var c;const u=zt(l.props),[d,f,h]=o((c=u.value)==null?void 0:c.id);return e.value.set(f,{component:l.component?Me(l.component):void 0,props:{...u.value,_isConfirm:!1,_promise:d,_modelValue:h}}),qe(u,g=>{const v=e.value.get(f);v&&e.value.set(f,{component:l.component?Me(l.component):void 0,props:{...v.props,...g}})}),d.value},i=(l={})=>{var c;const u=zt(l.props),[d,f,h]=o((c=u.value)==null?void 0:c.id);return e.value.set(f,{component:l.component?Me(l.component):void 0,props:{...u.value,_isConfirm:!0,_promise:d,_modelValue:h}}),qe(u,g=>{const v=e.value.get(f);v&&e.value.set(f,{component:l.component?Me(l.component):void 0,props:{...v.props,...g}})}),d.value},s=l=>{const c=e.value.get(l);c!=null&&c.props&&(c.props={...c.props,_modelValue:!1})},a=l=>{e.value.delete(l)};t.provide(UP,{modals:e,remove:a,show:r,confirm:i,leave:s})}},uI={install(t){const e=ze(new Map),n=A(()=>e.value.size),o=A(()=>[...e.value.values()]),r=A(()=>o.value[o.value.length-1]),i=u=>{e.value.set(u.uid,u)},s=u=>{e.value.delete(u.uid)},a=ze(new Map),l=u=>{a.value.set(u.uid,u)},c=u=>{a.value.delete(u.uid)};t.provide(t4,{countStack:n,lastStack:r,registry:so(a),stack:o,pushStack:i,removeStack:s,pushRegistry:l,removeRegistry:c})}},dI={install(t){const e=ze(new Map),n=c=>{var u;const d=zt(c),f=((u=d.value)==null?void 0:u.id)||Symbol("Popover controller");return qe(d,h=>{e.value.set(f,{...h,...typeof h.modelValue<"u"&&Xe(c)?{"onUpdate:modelValue":g=>{var v;(v=h["onUpdate:modelValue"])==null||v.call(h,g),c.value.modelValue=g}}:{}})},{immediate:!0,deep:!0}),Ma(()=>e.value.delete(f),!0),f},o=(c,u)=>{const d=e.value.get(c);d&&e.value.set(c,{...d,...bt(u)})},r=c=>e.value.delete(c),i=ze(new Map),s=c=>{var u;const d=zt(c),f=((u=d.value)==null?void 0:u.id)||Symbol("Tooltip controller");return qe(d,h=>{e.value.set(f,{...h,...typeof h.modelValue<"u"&&Xe(c)?{"onUpdate:modelValue":g=>{var v;(v=h["onUpdate:modelValue"])==null||v.call(h,g),c.value.modelValue=g}}:{}})},{immediate:!0,deep:!0}),Ma(()=>i.value.delete(f),!0),f},a=(c,u)=>{const d=i.value.get(c);d&&i.value.set(c,{...d,...bt(u)})},l=c=>i.value.delete(c);t.provide(GP,{popovers:e,tooltips:i,tooltip:s,popover:n,setPopover:o,setTooltip:a,removePopover:r,removeTooltip:l})}},fI={install(t,e){var n,o;const s=typeof(e==null?void 0:e.rtl)=="boolean"?!1:((n=e==null?void 0:e.rtl)==null?void 0:n.rtlInitial)??!1,a=typeof(e==null?void 0:e.rtl)=="boolean"?void 0:((o=e==null?void 0:e.rtl)==null?void 0:o.localeInitial)??void 0,l=ze(s),c=ze(a);t.provide(VP,{isRtl:l,locale:c})}},hI="top-end",pI={install(t){const e=ze([]),n=ze(!1),o=a=>{n.value=a},r=(a={})=>{var l,c,u,d;const f=zt(a.props),h=((l=f.value)==null?void 0:l.id)||Symbol("Toast controller"),g={component:a.component?Me(a.component):void 0,props:{...f.value,pos:((c=f.value)==null?void 0:c.pos)||hI,_modelValue:((u=f.value)==null?void 0:u.value)||5e3,_self:h}};return(((d=f.value)==null?void 0:d.appendToast)!==void 0?f.value.appendToast:n.value)?e.value.push(g):e.value.unshift(g),qe(f,v=>{const m=e.value.findIndex(b=>b.props._self===h);m!==-1&&e.value.splice(m,1,{component:a.component?Me(a.component):void 0,props:{...e.value[m].props,...v,_modelValue:(v==null?void 0:v.value)||e.value[m].props._modelValue||5e3}})}),h},i=a=>{e.value=e.value.filter(l=>l.props._self!==a)},s=a=>{const l=e.value.findIndex(c=>c.props._self===a);l!==-1&&e.value.splice(l,1,{component:e.value[l].component?Me(e.value[l].component):void 0,props:{...e.value[l].props,_modelValue:!1}})};t.provide(WP,{_setIsAppend:o,toasts:e,show:r,remove:i,leave:s})}},mI={install(t){const e=lr({}),n=({id:o,value:r,toggle:i,show:s,hide:a})=>(e[o]=A(()=>({value:r.value,toggle:i,show:s,hide:a})),{unregister(){delete e[o]}});n.map=so(e),t.provide(Q3,n)}},gI=(t={})=>({install(e){(t.breadcrumb??!0)&&e.use(lI),(t.modalController??!0)&&e.use(cI),(t.modalManager??!0)&&e.use(uI),((t.rtl??!0)||typeof t.rtl=="object")&&e.use(fI,t),(t.toast??!0)&&e.use(pI),(t.popover??!0)&&e.use(dI),e.use(mI),e.use(aI,t)}});/*!
|
|
31
|
+
* vue-router v4.6.4
|
|
32
|
+
* (c) 2025 Eduardo San Martin Morote
|
|
33
|
+
* @license MIT
|
|
34
|
+
*/const _c=typeof document<"u";function Q4(t){return typeof t=="object"||"displayName"in t||"props"in t||"__vccOpts"in t}function vI(t){return t.__esModule||t[Symbol.toStringTag]==="Module"||t.default&&Q4(t.default)}const Xt=Object.assign;function Yg(t,e){const n={};for(const o in e){const r=e[o];n[o]=Ai(r)?r.map(t):t(r)}return n}const Ad=()=>{},Ai=Array.isArray;function h_(t,e){const n={};for(const o in t)n[o]=o in e?e[o]:t[o];return n}const J4=/#/g,bI=/&/g,yI=/\//g,xI=/=/g,wI=/\?/g,eA=/\+/g,_I=/%5B/g,kI=/%5D/g,tA=/%5E/g,SI=/%60/g,nA=/%7B/g,AI=/%7C/g,oA=/%7D/g,CI=/%20/g;function Sy(t){return t==null?"":encodeURI(""+t).replace(AI,"|").replace(_I,"[").replace(kI,"]")}function $I(t){return Sy(t).replace(nA,"{").replace(oA,"}").replace(tA,"^")}function y1(t){return Sy(t).replace(eA,"%2B").replace(CI,"+").replace(J4,"%23").replace(bI,"%26").replace(SI,"`").replace(nA,"{").replace(oA,"}").replace(tA,"^")}function TI(t){return y1(t).replace(xI,"%3D")}function MI(t){return Sy(t).replace(J4,"%23").replace(wI,"%3F")}function OI(t){return MI(t).replace(yI,"%2F")}function Yd(t){if(t==null)return null;try{return decodeURIComponent(""+t)}catch{}return""+t}const BI=/\/$/,LI=t=>t.replace(BI,"");function jg(t,e,n="/"){let o,r={},i="",s="";const a=e.indexOf("#");let l=e.indexOf("?");return l=a>=0&&l>a?-1:l,l>=0&&(o=e.slice(0,l),i=e.slice(l,a>0?a:e.length),r=t(i.slice(1))),a>=0&&(o=o||e.slice(0,a),s=e.slice(a,e.length)),o=II(o??e,n),{fullPath:o+i+s,path:o,query:r,hash:Yd(s)}}function PI(t,e){const n=e.query?t(e.query):"";return e.path+(n&&"?")+n+(e.hash||"")}function p_(t,e){return!e||!t.toLowerCase().startsWith(e.toLowerCase())?t:t.slice(e.length)||"/"}function DI(t,e,n){const o=e.matched.length-1,r=n.matched.length-1;return o>-1&&o===r&&Qc(e.matched[o],n.matched[r])&&rA(e.params,n.params)&&t(e.query)===t(n.query)&&e.hash===n.hash}function Qc(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function rA(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(!EI(t[n],e[n]))return!1;return!0}function EI(t,e){return Ai(t)?m_(t,e):Ai(e)?m_(e,t):(t==null?void 0:t.valueOf())===(e==null?void 0:e.valueOf())}function m_(t,e){return Ai(e)?t.length===e.length&&t.every((n,o)=>n===e[o]):t.length===1&&t[0]===e}function II(t,e){if(t.startsWith("/"))return t;if(!t)return e;const n=e.split("/"),o=t.split("/"),r=o[o.length-1];(r===".."||r===".")&&o.push("");let i=n.length-1,s,a;for(s=0;s<o.length;s++)if(a=o[s],a!==".")if(a==="..")i>1&&i--;else break;return n.slice(0,i).join("/")+"/"+o.slice(s).join("/")}const ua={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let x1=(function(t){return t.pop="pop",t.push="push",t})({}),Xg=(function(t){return t.back="back",t.forward="forward",t.unknown="",t})({});function NI(t){if(!t)if(_c){const e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^\w+:\/\/[^\/]+/,"")}else t="/";return t[0]!=="/"&&t[0]!=="#"&&(t="/"+t),LI(t)}const RI=/^[^#]+#/;function FI(t,e){return t.replace(RI,"#")+e}function VI(t,e){const n=document.documentElement.getBoundingClientRect(),o=t.getBoundingClientRect();return{behavior:e.behavior,left:o.left-n.left-(e.left||0),top:o.top-n.top-(e.top||0)}}const ym=()=>({left:window.scrollX,top:window.scrollY});function zI(t){let e;if("el"in t){const n=t.el,o=typeof n=="string"&&n.startsWith("#"),r=typeof n=="string"?o?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r)return;e=VI(r,t)}else e=t;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}function g_(t,e){return(history.state?history.state.position-e:-1)+t}const w1=new Map;function HI(t,e){w1.set(t,e)}function WI(t){const e=w1.get(t);return w1.delete(t),e}function UI(t){return typeof t=="string"||t&&typeof t=="object"}function iA(t){return typeof t=="string"||typeof t=="symbol"}let yn=(function(t){return t[t.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",t[t.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",t[t.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",t[t.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",t[t.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",t})({});const sA=Symbol("");yn.MATCHER_NOT_FOUND+"",yn.NAVIGATION_GUARD_REDIRECT+"",yn.NAVIGATION_ABORTED+"",yn.NAVIGATION_CANCELLED+"",yn.NAVIGATION_DUPLICATED+"";function Jc(t,e){return Xt(new Error,{type:t,[sA]:!0},e)}function vs(t,e){return t instanceof Error&&sA in t&&(e==null||!!(t.type&e))}const GI=["params","query","hash"];function qI(t){if(typeof t=="string")return t;if(t.path!=null)return t.path;const e={};for(const n of GI)n in t&&(e[n]=t[n]);return JSON.stringify(e,null,2)}function YI(t){const e={};if(t===""||t==="?")return e;const n=(t[0]==="?"?t.slice(1):t).split("&");for(let o=0;o<n.length;++o){const r=n[o].replace(eA," "),i=r.indexOf("="),s=Yd(i<0?r:r.slice(0,i)),a=i<0?null:Yd(r.slice(i+1));if(s in e){let l=e[s];Ai(l)||(l=e[s]=[l]),l.push(a)}else e[s]=a}return e}function v_(t){let e="";for(let n in t){const o=t[n];if(n=TI(n),o==null){o!==void 0&&(e+=(e.length?"&":"")+n);continue}(Ai(o)?o.map(r=>r&&y1(r)):[o&&y1(o)]).forEach(r=>{r!==void 0&&(e+=(e.length?"&":"")+n,r!=null&&(e+="="+r))})}return e}function jI(t){const e={};for(const n in t){const o=t[n];o!==void 0&&(e[n]=Ai(o)?o.map(r=>r==null?null:""+r):o==null?o:""+o)}return e}const aA=Symbol(""),b_=Symbol(""),xm=Symbol(""),Ay=Symbol(""),_1=Symbol("");function Gu(){let t=[];function e(o){return t.push(o),()=>{const r=t.indexOf(o);r>-1&&t.splice(r,1)}}function n(){t=[]}return{add:e,list:()=>t.slice(),reset:n}}function XI(t,e,n){const o=()=>{t[e].delete(n)};Js(o),s3(o),oy(()=>{t[e].add(n)}),t[e].add(n)}function KI(t){const e=Yt(aA,{}).value;e&&XI(e,"leaveGuards",t)}function ga(t,e,n,o,r,i=s=>s()){const s=o&&(o.enterCallbacks[r]=o.enterCallbacks[r]||[]);return()=>new Promise((a,l)=>{const c=f=>{f===!1?l(Jc(yn.NAVIGATION_ABORTED,{from:n,to:e})):f instanceof Error?l(f):UI(f)?l(Jc(yn.NAVIGATION_GUARD_REDIRECT,{from:e,to:f})):(s&&o.enterCallbacks[r]===s&&typeof f=="function"&&s.push(f),a())},u=i(()=>t.call(o&&o.instances[r],e,n,c));let d=Promise.resolve(u);t.length<3&&(d=d.then(c)),d.catch(f=>l(f))})}function Kg(t,e,n,o,r=i=>i()){const i=[];for(const s of t)for(const a in s.components){let l=s.components[a];if(!(e!=="beforeRouteEnter"&&!s.instances[a]))if(Q4(l)){const c=(l.__vccOpts||l)[e];c&&i.push(ga(c,n,o,s,a,r))}else{let c=l();i.push(()=>c.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${a}" at "${s.path}"`);const d=vI(u)?u.default:u;s.mods[a]=u,s.components[a]=d;const f=(d.__vccOpts||d)[e];return f&&ga(f,n,o,s,a,r)()}))}}return i}function ZI(t,e){const n=[],o=[],r=[],i=Math.max(e.matched.length,t.matched.length);for(let s=0;s<i;s++){const a=e.matched[s];a&&(t.matched.find(c=>Qc(c,a))?o.push(a):n.push(a));const l=t.matched[s];l&&(e.matched.find(c=>Qc(c,l))||r.push(l))}return[n,o,r]}/*!
|
|
35
|
+
* vue-router v4.6.4
|
|
36
|
+
* (c) 2025 Eduardo San Martin Morote
|
|
37
|
+
* @license MIT
|
|
38
|
+
*/let QI=()=>location.protocol+"//"+location.host;function lA(t,e){const{pathname:n,search:o,hash:r}=e,i=t.indexOf("#");if(i>-1){let s=r.includes(t.slice(i))?t.slice(i).length:1,a=r.slice(s);return a[0]!=="/"&&(a="/"+a),p_(a,"")}return p_(n,t)+o+r}function JI(t,e,n,o){let r=[],i=[],s=null;const a=({state:f})=>{const h=lA(t,location),g=n.value,v=e.value;let m=0;if(f){if(n.value=h,e.value=f,s&&s===g){s=null;return}m=v?f.position-v.position:0}else o(h);r.forEach(b=>{b(n.value,g,{delta:m,type:x1.pop,direction:m?m>0?Xg.forward:Xg.back:Xg.unknown})})};function l(){s=n.value}function c(f){r.push(f);const h=()=>{const g=r.indexOf(f);g>-1&&r.splice(g,1)};return i.push(h),h}function u(){if(document.visibilityState==="hidden"){const{history:f}=window;if(!f.state)return;f.replaceState(Xt({},f.state,{scroll:ym()}),"")}}function d(){for(const f of i)f();i=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",u)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",u),document.addEventListener("visibilitychange",u),{pauseListeners:l,listen:c,destroy:d}}function y_(t,e,n,o=!1,r=!1){return{back:t,current:e,forward:n,replaced:o,position:window.history.length,scroll:r?ym():null}}function eN(t){const{history:e,location:n}=window,o={value:lA(t,n)},r={value:e.state};r.value||i(o.value,{back:null,current:o.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function i(l,c,u){const d=t.indexOf("#"),f=d>-1?(n.host&&document.querySelector("base")?t:t.slice(d))+l:QI()+t+l;try{e[u?"replaceState":"pushState"](c,"",f),r.value=c}catch(h){console.error(h),n[u?"replace":"assign"](f)}}function s(l,c){i(l,Xt({},e.state,y_(r.value.back,l,r.value.forward,!0),c,{position:r.value.position}),!0),o.value=l}function a(l,c){const u=Xt({},r.value,e.state,{forward:l,scroll:ym()});i(u.current,u,!0),i(l,Xt({},y_(o.value,l,null),{position:u.position+1},c),!1),o.value=l}return{location:o,state:r,push:a,replace:s}}function tN(t){t=NI(t);const e=eN(t),n=JI(t,e.state,e.location,e.replace);function o(i,s=!0){s||n.pauseListeners(),history.go(i)}const r=Xt({location:"",base:t,go:o,createHref:FI.bind(null,t)},e,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>e.state.value}),r}function nN(t){return t=location.host?t||location.pathname+location.search:"",t.includes("#")||(t+="#"),tN(t)}let yl=(function(t){return t[t.Static=0]="Static",t[t.Param=1]="Param",t[t.Group=2]="Group",t})({});var Hn=(function(t){return t[t.Static=0]="Static",t[t.Param=1]="Param",t[t.ParamRegExp=2]="ParamRegExp",t[t.ParamRegExpEnd=3]="ParamRegExpEnd",t[t.EscapeNext=4]="EscapeNext",t})(Hn||{});const oN={type:yl.Static,value:""},rN=/[a-zA-Z0-9_]/;function iN(t){if(!t)return[[]];if(t==="/")return[[oN]];if(!t.startsWith("/"))throw new Error(`Invalid path "${t}"`);function e(h){throw new Error(`ERR (${n})/"${c}": ${h}`)}let n=Hn.Static,o=n;const r=[];let i;function s(){i&&r.push(i),i=[]}let a=0,l,c="",u="";function d(){c&&(n===Hn.Static?i.push({type:yl.Static,value:c}):n===Hn.Param||n===Hn.ParamRegExp||n===Hn.ParamRegExpEnd?(i.length>1&&(l==="*"||l==="+")&&e(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),i.push({type:yl.Param,value:c,regexp:u,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):e("Invalid state to consume buffer"),c="")}function f(){c+=l}for(;a<t.length;){if(l=t[a++],l==="\\"&&n!==Hn.ParamRegExp){o=n,n=Hn.EscapeNext;continue}switch(n){case Hn.Static:l==="/"?(c&&d(),s()):l===":"?(d(),n=Hn.Param):f();break;case Hn.EscapeNext:f(),n=o;break;case Hn.Param:l==="("?n=Hn.ParamRegExp:rN.test(l)?f():(d(),n=Hn.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case Hn.ParamRegExp:l===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+l:n=Hn.ParamRegExpEnd:u+=l;break;case Hn.ParamRegExpEnd:d(),n=Hn.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,u="";break;default:e("Unknown state");break}}return n===Hn.ParamRegExp&&e(`Unfinished custom RegExp for param "${c}"`),d(),s(),r}const x_="[^/]+?",sN={sensitive:!1,strict:!1,start:!0,end:!0};var No=(function(t){return t[t._multiplier=10]="_multiplier",t[t.Root=90]="Root",t[t.Segment=40]="Segment",t[t.SubSegment=30]="SubSegment",t[t.Static=40]="Static",t[t.Dynamic=20]="Dynamic",t[t.BonusCustomRegExp=10]="BonusCustomRegExp",t[t.BonusWildcard=-50]="BonusWildcard",t[t.BonusRepeatable=-20]="BonusRepeatable",t[t.BonusOptional=-8]="BonusOptional",t[t.BonusStrict=.7000000000000001]="BonusStrict",t[t.BonusCaseSensitive=.25]="BonusCaseSensitive",t})(No||{});const aN=/[.+*?^${}()[\]/\\]/g;function lN(t,e){const n=Xt({},sN,e),o=[];let r=n.start?"^":"";const i=[];for(const c of t){const u=c.length?[]:[No.Root];n.strict&&!c.length&&(r+="/");for(let d=0;d<c.length;d++){const f=c[d];let h=No.Segment+(n.sensitive?No.BonusCaseSensitive:0);if(f.type===yl.Static)d||(r+="/"),r+=f.value.replace(aN,"\\$&"),h+=No.Static;else if(f.type===yl.Param){const{value:g,repeatable:v,optional:m,regexp:b}=f;i.push({name:g,repeatable:v,optional:m});const y=b||x_;if(y!==x_){h+=No.BonusCustomRegExp;try{`${y}`}catch(_){throw new Error(`Invalid custom RegExp for param "${g}" (${y}): `+_.message)}}let x=v?`((?:${y})(?:/(?:${y}))*)`:`(${y})`;d||(x=m&&c.length<2?`(?:/${x})`:"/"+x),m&&(x+="?"),r+=x,h+=No.Dynamic,m&&(h+=No.BonusOptional),v&&(h+=No.BonusRepeatable),y===".*"&&(h+=No.BonusWildcard)}u.push(h)}o.push(u)}if(n.strict&&n.end){const c=o.length-1;o[c][o[c].length-1]+=No.BonusStrict}n.strict||(r+="/?"),n.end?r+="$":n.strict&&!r.endsWith("/")&&(r+="(?:/|$)");const s=new RegExp(r,n.sensitive?"":"i");function a(c){const u=c.match(s),d={};if(!u)return null;for(let f=1;f<u.length;f++){const h=u[f]||"",g=i[f-1];d[g.name]=h&&g.repeatable?h.split("/"):h}return d}function l(c){let u="",d=!1;for(const f of t){(!d||!u.endsWith("/"))&&(u+="/"),d=!1;for(const h of f)if(h.type===yl.Static)u+=h.value;else if(h.type===yl.Param){const{value:g,repeatable:v,optional:m}=h,b=g in c?c[g]:"";if(Ai(b)&&!v)throw new Error(`Provided param "${g}" is an array but it is not repeatable (* or + modifiers)`);const y=Ai(b)?b.join("/"):b;if(!y)if(m)f.length<2&&(u.endsWith("/")?u=u.slice(0,-1):d=!0);else throw new Error(`Missing required param "${g}"`);u+=y}}return u||"/"}return{re:s,score:o,keys:i,parse:a,stringify:l}}function cN(t,e){let n=0;for(;n<t.length&&n<e.length;){const o=e[n]-t[n];if(o)return o;n++}return t.length<e.length?t.length===1&&t[0]===No.Static+No.Segment?-1:1:t.length>e.length?e.length===1&&e[0]===No.Static+No.Segment?1:-1:0}function cA(t,e){let n=0;const o=t.score,r=e.score;for(;n<o.length&&n<r.length;){const i=cN(o[n],r[n]);if(i)return i;n++}if(Math.abs(r.length-o.length)===1){if(w_(o))return 1;if(w_(r))return-1}return r.length-o.length}function w_(t){const e=t[t.length-1];return t.length>0&&e[e.length-1]<0}const uN={strict:!1,end:!0,sensitive:!1};function dN(t,e,n){const o=lN(iN(t.path),n),r=Xt(o,{record:t,parent:e,children:[],alias:[]});return e&&!r.record.aliasOf==!e.record.aliasOf&&e.children.push(r),r}function fN(t,e){const n=[],o=new Map;e=h_(uN,e);function r(d){return o.get(d)}function i(d,f,h){const g=!h,v=k_(d);v.aliasOf=h&&h.record;const m=h_(e,d),b=[v];if("alias"in d){const _=typeof d.alias=="string"?[d.alias]:d.alias;for(const k of _)b.push(k_(Xt({},v,{components:h?h.record.components:v.components,path:k,aliasOf:h?h.record:v})))}let y,x;for(const _ of b){const{path:k}=_;if(f&&k[0]!=="/"){const E=f.record.path,L=E[E.length-1]==="/"?"":"/";_.path=f.record.path+(k&&L+k)}if(y=dN(_,f,m),h?h.alias.push(y):(x=x||y,x!==y&&x.alias.push(y),g&&d.name&&!S_(y)&&s(d.name)),uA(y)&&l(y),v.children){const E=v.children;for(let L=0;L<E.length;L++)i(E[L],y,h&&h.children[L])}h=h||y}return x?()=>{s(x)}:Ad}function s(d){if(iA(d)){const f=o.get(d);f&&(o.delete(d),n.splice(n.indexOf(f),1),f.children.forEach(s),f.alias.forEach(s))}else{const f=n.indexOf(d);f>-1&&(n.splice(f,1),d.record.name&&o.delete(d.record.name),d.children.forEach(s),d.alias.forEach(s))}}function a(){return n}function l(d){const f=mN(d,n);n.splice(f,0,d),d.record.name&&!S_(d)&&o.set(d.record.name,d)}function c(d,f){let h,g={},v,m;if("name"in d&&d.name){if(h=o.get(d.name),!h)throw Jc(yn.MATCHER_NOT_FOUND,{location:d});m=h.record.name,g=Xt(__(f.params,h.keys.filter(x=>!x.optional).concat(h.parent?h.parent.keys.filter(x=>x.optional):[]).map(x=>x.name)),d.params&&__(d.params,h.keys.map(x=>x.name))),v=h.stringify(g)}else if(d.path!=null)v=d.path,h=n.find(x=>x.re.test(v)),h&&(g=h.parse(v),m=h.record.name);else{if(h=f.name?o.get(f.name):n.find(x=>x.re.test(f.path)),!h)throw Jc(yn.MATCHER_NOT_FOUND,{location:d,currentLocation:f});m=h.record.name,g=Xt({},f.params,d.params),v=h.stringify(g)}const b=[];let y=h;for(;y;)b.unshift(y.record),y=y.parent;return{name:m,path:v,params:g,matched:b,meta:pN(b)}}t.forEach(d=>i(d));function u(){n.length=0,o.clear()}return{addRoute:i,resolve:c,removeRoute:s,clearRoutes:u,getRoutes:a,getRecordMatcher:r}}function __(t,e){const n={};for(const o of e)o in t&&(n[o]=t[o]);return n}function k_(t){const e={path:t.path,redirect:t.redirect,name:t.name,meta:t.meta||{},aliasOf:t.aliasOf,beforeEnter:t.beforeEnter,props:hN(t),children:t.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in t?t.components||null:t.component&&{default:t.component}};return Object.defineProperty(e,"mods",{value:{}}),e}function hN(t){const e={},n=t.props||!1;if("component"in t)e.default=n;else for(const o in t.components)e[o]=typeof n=="object"?n[o]:n;return e}function S_(t){for(;t;){if(t.record.aliasOf)return!0;t=t.parent}return!1}function pN(t){return t.reduce((e,n)=>Xt(e,n.meta),{})}function mN(t,e){let n=0,o=e.length;for(;n!==o;){const i=n+o>>1;cA(t,e[i])<0?o=i:n=i+1}const r=gN(t);return r&&(o=e.lastIndexOf(r,o-1)),o}function gN(t){let e=t;for(;e=e.parent;)if(uA(e)&&cA(t,e)===0)return e}function uA({record:t}){return!!(t.name||t.components&&Object.keys(t.components).length||t.redirect)}function A_(t){const e=Yt(xm),n=Yt(Ay),o=A(()=>{const l=p(t.to);return e.resolve(l)}),r=A(()=>{const{matched:l}=o.value,{length:c}=l,u=l[c-1],d=n.matched;if(!u||!d.length)return-1;const f=d.findIndex(Qc.bind(null,u));if(f>-1)return f;const h=C_(l[c-2]);return c>1&&C_(u)===h&&d[d.length-1].path!==h?d.findIndex(Qc.bind(null,l[c-2])):f}),i=A(()=>r.value>-1&&wN(n.params,o.value.params)),s=A(()=>r.value>-1&&r.value===n.matched.length-1&&rA(n.params,o.value.params));function a(l={}){if(xN(l)){const c=e[p(t.replace)?"replace":"push"](p(t.to)).catch(Ad);return t.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:o,href:A(()=>o.value.href),isActive:i,isExactActive:s,navigate:a}}function vN(t){return t.length===1?t[0]:t}const bN=le({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:A_,setup(t,{slots:e}){const n=lr(A_(t)),{options:o}=Yt(xm),r=A(()=>({[$_(t.activeClass,o.linkActiveClass,"router-link-active")]:n.isActive,[$_(t.exactActiveClass,o.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=e.default&&vN(e.default(n));return t.custom?i:Vt("a",{"aria-current":n.isExactActive?t.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},i)}}}),yN=bN;function xN(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&!(t.button!==void 0&&t.button!==0)){if(t.currentTarget&&t.currentTarget.getAttribute){const e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function wN(t,e){for(const n in e){const o=e[n],r=t[n];if(typeof o=="string"){if(o!==r)return!1}else if(!Ai(r)||r.length!==o.length||o.some((i,s)=>i.valueOf()!==r[s].valueOf()))return!1}return!0}function C_(t){return t?t.aliasOf?t.aliasOf.path:t.path:""}const $_=(t,e,n)=>t??e??n,_N=le({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(t,{attrs:e,slots:n}){const o=Yt(_1),r=A(()=>t.route||o.value),i=Yt(b_,0),s=A(()=>{let c=p(i);const{matched:u}=r.value;let d;for(;(d=u[c])&&!d.components;)c++;return c}),a=A(()=>r.value.matched[s.value]);pi(b_,A(()=>s.value+1)),pi(aA,a),pi(_1,r);const l=ze();return qe(()=>[l.value,a.value,t.name],([c,u,d],[f,h,g])=>{u&&(u.instances[d]=c,h&&h!==u&&c&&c===f&&(u.leaveGuards.size||(u.leaveGuards=h.leaveGuards),u.updateGuards.size||(u.updateGuards=h.updateGuards))),c&&u&&(!h||!Qc(u,h)||!f)&&(u.enterCallbacks[d]||[]).forEach(v=>v(c))},{flush:"post"}),()=>{const c=r.value,u=t.name,d=a.value,f=d&&d.components[u];if(!f)return T_(n.default,{Component:f,route:c});const h=d.props[u],g=h?h===!0?c.params:typeof h=="function"?h(c):h:null,m=Vt(f,Xt({},g,e,{onVnodeUnmounted:b=>{b.component.isUnmounted&&(d.instances[u]=null)},ref:l}));return T_(n.default,{Component:m,route:c})||m}}});function T_(t,e){if(!t)return null;const n=t(e);return n.length===1?n[0]:n}const kN=_N;function SN(t){const e=fN(t.routes,t),n=t.parseQuery||YI,o=t.stringifyQuery||v_,r=t.history,i=Gu(),s=Gu(),a=Gu(),l=Re(ua);let c=ua;_c&&t.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=Yg.bind(null,J=>""+J),d=Yg.bind(null,OI),f=Yg.bind(null,Yd);function h(J,ge){let re,oe;return iA(J)?(re=e.getRecordMatcher(J),oe=ge):oe=J,e.addRoute(oe,re)}function g(J){const ge=e.getRecordMatcher(J);ge&&e.removeRoute(ge)}function v(){return e.getRoutes().map(J=>J.record)}function m(J){return!!e.getRecordMatcher(J)}function b(J,ge){if(ge=Xt({},ge||l.value),typeof J=="string"){const Y=jg(n,J,ge.path),se=e.resolve({path:Y.path},ge),fe=r.createHref(Y.fullPath);return Xt(Y,se,{params:f(se.params),hash:Yd(Y.hash),redirectedFrom:void 0,href:fe})}let re;if(J.path!=null)re=Xt({},J,{path:jg(n,J.path,ge.path).path});else{const Y=Xt({},J.params);for(const se in Y)Y[se]==null&&delete Y[se];re=Xt({},J,{params:d(Y)}),ge.params=d(ge.params)}const oe=e.resolve(re,ge),he=J.hash||"";oe.params=u(f(oe.params));const I=PI(o,Xt({},J,{hash:$I(he),path:oe.path})),G=r.createHref(I);return Xt({fullPath:I,hash:he,query:o===v_?jI(J.query):J.query||{}},oe,{redirectedFrom:void 0,href:G})}function y(J){return typeof J=="string"?jg(n,J,l.value.path):Xt({},J)}function x(J,ge){if(c!==J)return Jc(yn.NAVIGATION_CANCELLED,{from:ge,to:J})}function _(J){return L(J)}function k(J){return _(Xt(y(J),{replace:!0}))}function E(J,ge){const re=J.matched[J.matched.length-1];if(re&&re.redirect){const{redirect:oe}=re;let he=typeof oe=="function"?oe(J,ge):oe;return typeof he=="string"&&(he=he.includes("?")||he.includes("#")?he=y(he):{path:he},he.params={}),Xt({query:J.query,hash:J.hash,params:he.path!=null?{}:J.params},he)}}function L(J,ge){const re=c=b(J),oe=l.value,he=J.state,I=J.force,G=J.replace===!0,Y=E(re,oe);if(Y)return L(Xt(y(Y),{state:typeof Y=="object"?Xt({},he,Y.state):he,force:I,replace:G}),ge||re);const se=re;se.redirectedFrom=ge;let fe;return!I&&DI(o,oe,re)&&(fe=Jc(yn.NAVIGATION_DUPLICATED,{to:se,from:oe}),me(oe,oe,!0,!1)),(fe?Promise.resolve(fe):D(se,oe)).catch(ne=>vs(ne)?vs(ne,yn.NAVIGATION_GUARD_REDIRECT)?ne:ae(ne):U(ne,se,oe)).then(ne=>{if(ne){if(vs(ne,yn.NAVIGATION_GUARD_REDIRECT))return L(Xt({replace:G},y(ne.to),{state:typeof ne.to=="object"?Xt({},he,ne.to.state):he,force:I}),ge||se)}else ne=C(se,oe,!0,G,he);return N(se,oe,ne),ne})}function S(J,ge){const re=x(J,ge);return re?Promise.reject(re):Promise.resolve()}function B(J){const ge=te.values().next().value;return ge&&typeof ge.runWithContext=="function"?ge.runWithContext(J):J()}function D(J,ge){let re;const[oe,he,I]=ZI(J,ge);re=Kg(oe.reverse(),"beforeRouteLeave",J,ge);for(const Y of oe)Y.leaveGuards.forEach(se=>{re.push(ga(se,J,ge))});const G=S.bind(null,J,ge);return re.push(G),we(re).then(()=>{re=[];for(const Y of i.list())re.push(ga(Y,J,ge));return re.push(G),we(re)}).then(()=>{re=Kg(he,"beforeRouteUpdate",J,ge);for(const Y of he)Y.updateGuards.forEach(se=>{re.push(ga(se,J,ge))});return re.push(G),we(re)}).then(()=>{re=[];for(const Y of I)if(Y.beforeEnter)if(Ai(Y.beforeEnter))for(const se of Y.beforeEnter)re.push(ga(se,J,ge));else re.push(ga(Y.beforeEnter,J,ge));return re.push(G),we(re)}).then(()=>(J.matched.forEach(Y=>Y.enterCallbacks={}),re=Kg(I,"beforeRouteEnter",J,ge,B),re.push(G),we(re))).then(()=>{re=[];for(const Y of s.list())re.push(ga(Y,J,ge));return re.push(G),we(re)}).catch(Y=>vs(Y,yn.NAVIGATION_CANCELLED)?Y:Promise.reject(Y))}function N(J,ge,re){a.list().forEach(oe=>B(()=>oe(J,ge,re)))}function C(J,ge,re,oe,he){const I=x(J,ge);if(I)return I;const G=ge===ua,Y=_c?history.state:{};re&&(oe||G?r.replace(J.fullPath,Xt({scroll:G&&Y&&Y.scroll},he)):r.push(J.fullPath,he)),l.value=J,me(J,ge,re,G),ae()}let M;function P(){M||(M=r.listen((J,ge,re)=>{if(!pe.listening)return;const oe=b(J),he=E(oe,pe.currentRoute.value);if(he){L(Xt(he,{replace:!0,force:!0}),oe).catch(Ad);return}c=oe;const I=l.value;_c&&HI(g_(I.fullPath,re.delta),ym()),D(oe,I).catch(G=>vs(G,yn.NAVIGATION_ABORTED|yn.NAVIGATION_CANCELLED)?G:vs(G,yn.NAVIGATION_GUARD_REDIRECT)?(L(Xt(y(G.to),{force:!0}),oe).then(Y=>{vs(Y,yn.NAVIGATION_ABORTED|yn.NAVIGATION_DUPLICATED)&&!re.delta&&re.type===x1.pop&&r.go(-1,!1)}).catch(Ad),Promise.reject()):(re.delta&&r.go(-re.delta,!1),U(G,oe,I))).then(G=>{G=G||C(oe,I,!1),G&&(re.delta&&!vs(G,yn.NAVIGATION_CANCELLED)?r.go(-re.delta,!1):re.type===x1.pop&&vs(G,yn.NAVIGATION_ABORTED|yn.NAVIGATION_DUPLICATED)&&r.go(-1,!1)),N(oe,I,G)}).catch(Ad)}))}let $=Gu(),F=Gu(),V;function U(J,ge,re){ae(J);const oe=F.list();return oe.length?oe.forEach(he=>he(J,ge,re)):console.error(J),Promise.reject(J)}function K(){return V&&l.value!==ua?Promise.resolve():new Promise((J,ge)=>{$.add([J,ge])})}function ae(J){return V||(V=!J,P(),$.list().forEach(([ge,re])=>J?re(J):ge()),$.reset()),J}function me(J,ge,re,oe){const{scrollBehavior:he}=t;if(!_c||!he)return Promise.resolve();const I=!re&&WI(g_(J.fullPath,0))||(oe||!re)&&history.state&&history.state.scroll||null;return wn().then(()=>he(J,ge,I)).then(G=>G&&zI(G)).catch(G=>U(G,J,ge))}const de=J=>r.go(J);let ve;const te=new Set,pe={currentRoute:l,listening:!0,addRoute:h,removeRoute:g,clearRoutes:e.clearRoutes,hasRoute:m,getRoutes:v,resolve:b,options:t,push:_,replace:k,go:de,back:()=>de(-1),forward:()=>de(1),beforeEach:i.add,beforeResolve:s.add,afterEach:a.add,onError:F.add,isReady:K,install(J){J.component("RouterLink",yN),J.component("RouterView",kN),J.config.globalProperties.$router=pe,Object.defineProperty(J.config.globalProperties,"$route",{enumerable:!0,get:()=>p(l)}),_c&&!ve&&l.value===ua&&(ve=!0,_(r.location).catch(oe=>{}));const ge={};for(const oe in ua)Object.defineProperty(ge,oe,{get:()=>l.value[oe],enumerable:!0});J.provide(xm,pe),J.provide(Ay,RS(ge)),J.provide(_1,l);const re=J.unmount;te.add(J),J.unmount=function(){te.delete(J),te.size<1&&(c=ua,M&&M(),M=null,l.value=ua,ve=!1,V=!1),re()}}};function we(J){return J.reduce((ge,re)=>ge.then(()=>B(re)),Promise.resolve())}return pe}function Cy(){return Yt(xm)}function Kl(t){return Yt(Ay)}function jd(t,e){return ql()?(Ma(t,e),!0):!1}const Zg=new WeakMap,AN=(...t)=>{var e;const n=t[0],o=(e=Oo())===null||e===void 0?void 0:e.proxy,r=o??ql();if(r==null&&!ty())throw new Error("injectLocal must be called in setup");return r&&Zg.has(r)&&n in Zg.get(r)?Zg.get(r)[n]:Yt(...t)},k1=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const CN=t=>t!=null,$N=Object.prototype.toString,TN=t=>$N.call(t)==="[object Object]",_a=()=>{};function dA(t,e){function n(...o){return new Promise((r,i)=>{Promise.resolve(t(()=>e.apply(this,o),{fn:e,thisArg:this,args:o})).then(r).catch(i)})}return n}function MN(t,e={}){let n,o,r=_a;const i=l=>{clearTimeout(l),r(),r=_a};let s;return l=>{const c=bt(t),u=bt(e.maxWait);return n&&i(n),c<=0||u!==void 0&&u<=0?(o&&(i(o),o=void 0),Promise.resolve(l())):new Promise((d,f)=>{r=e.rejectOnCancel?f:d,s=l,u&&!o&&(o=setTimeout(()=>{n&&i(n),o=void 0,d(s())},u)),n=setTimeout(()=>{o&&i(o),o=void 0,d(l())},c)})}}function ON(...t){let e=0,n,o=!0,r=_a,i,s,a,l,c;!Xe(t[0])&&typeof t[0]=="object"?{delay:s,trailing:a=!0,leading:l=!0,rejectOnCancel:c=!1}=t[0]:[s,a=!0,l=!0,c=!1]=t;const u=()=>{n&&(clearTimeout(n),n=void 0,r(),r=_a)};return f=>{const h=bt(s),g=Date.now()-e,v=()=>i=f();return u(),h<=0?(e=Date.now(),v()):(g>h?(e=Date.now(),(l||!o)&&v()):a&&(i=new Promise((m,b)=>{r=c?b:m,n=setTimeout(()=>{e=Date.now(),o=!0,m(v()),u()},Math.max(0,h-g))})),!l&&!n&&(n=setTimeout(()=>o=!0,h)),o=!1,i)}}function M_(t){return t.endsWith("rem")?Number.parseFloat(t)*16:Number.parseFloat(t)}function Cd(t){return Array.isArray(t)?t:[t]}function BN(t){return Oo()}function LN(t,e=200,n={}){return dA(MN(e,n),t)}function PN(t,e=200,n=!1,o=!0,r=!1){return dA(ON(e,n,o,r),t)}function $y(t,e=!0,n){BN()?fn(t,n):e?t():wn(t)}function S1(t,e=1e3,n={}){const{immediate:o=!0,immediateCallback:r=!1}=n;let i=null;const s=Re(!1);function a(){i&&(clearInterval(i),i=null)}function l(){s.value=!1,a()}function c(){const u=bt(e);u<=0||(s.value=!0,r&&t(),a(),s.value&&(i=setInterval(t,u)))}return o&&k1&&c(),(Xe(e)||typeof e=="function")&&jd(qe(e,()=>{s.value&&k1&&c()})),jd(l),{isActive:dl(s),pause:l,resume:c}}function DN(t,e,n){return qe(t,e,{...n,immediate:!0})}const Ya=k1?window:void 0;function rr(t){var e;const n=bt(t);return(e=n==null?void 0:n.$el)!==null&&e!==void 0?e:n}function Vs(...t){const e=(o,r,i,s)=>(o.addEventListener(r,i,s),()=>o.removeEventListener(r,i,s)),n=A(()=>{const o=Cd(bt(t[0])).filter(r=>r!=null);return o.every(r=>typeof r!="string")?o:void 0});return DN(()=>{var o,r;return[(o=(r=n.value)===null||r===void 0?void 0:r.map(i=>rr(i)))!==null&&o!==void 0?o:[Ya].filter(i=>i!=null),Cd(bt(n.value?t[1]:t[0])),Cd(p(n.value?t[2]:t[1])),bt(n.value?t[3]:t[2])]},([o,r,i,s],a,l)=>{if(!(o!=null&&o.length)||!(r!=null&&r.length)||!(i!=null&&i.length))return;const c=TN(s)?{...s}:s,u=o.flatMap(d=>r.flatMap(f=>i.map(h=>e(d,f,h,c))));l(()=>{u.forEach(d=>d())})},{flush:"post"})}function EN(t,e,n={}){const{window:o=Ya,ignore:r=[],capture:i=!0,detectIframe:s=!1,controls:a=!1}=n;if(!o)return a?{stop:_a,cancel:_a,trigger:_a}:_a;let l=!0;const c=m=>bt(r).some(b=>{if(typeof b=="string")return Array.from(o.document.querySelectorAll(b)).some(y=>y===m.target||m.composedPath().includes(y));{const y=rr(b);return y&&(m.target===y||m.composedPath().includes(y))}});function u(m){const b=bt(m);return b&&b.$.subTree.shapeFlag===16}function d(m,b){const y=bt(m),x=y.$.subTree&&y.$.subTree.children;return x==null||!Array.isArray(x)?!1:x.some(_=>_.el===b.target||b.composedPath().includes(_.el))}const f=m=>{const b=rr(t);if(m.target!=null&&!(!(b instanceof Element)&&u(t)&&d(t,m))&&!(!b||b===m.target||m.composedPath().includes(b))){if("detail"in m&&m.detail===0&&(l=!c(m)),!l){l=!0;return}e(m)}};let h=!1;const g=[Vs(o,"click",m=>{h||(h=!0,setTimeout(()=>{h=!1},0),f(m))},{passive:!0,capture:i}),Vs(o,"pointerdown",m=>{const b=rr(t);l=!c(m)&&!!(b&&!m.composedPath().includes(b))},{passive:!0}),s&&Vs(o,"blur",m=>{setTimeout(()=>{var b;const y=rr(t);((b=o.document.activeElement)===null||b===void 0?void 0:b.tagName)==="IFRAME"&&!(y!=null&&y.contains(o.document.activeElement))&&e(m)},0)},{passive:!0})].filter(Boolean),v=()=>g.forEach(m=>m());return a?{stop:v,cancel:()=>{l=!1},trigger:m=>{l=!0,f(m),l=!1}}:v}function IN(){const t=Re(!1),e=Oo();return e&&fn(()=>{t.value=!0},e),t}function Ty(t){const e=IN();return A(()=>(e.value,!!t()))}function NN(t,e,n={}){const{window:o=Ya,...r}=n;let i;const s=Ty(()=>o&&"MutationObserver"in o),a=()=>{i&&(i.disconnect(),i=void 0)},l=qe(A(()=>{const d=Cd(bt(t)).map(rr).filter(CN);return new Set(d)}),d=>{a(),s.value&&d.size&&(i=new MutationObserver(e),d.forEach(f=>i.observe(f,r)))},{immediate:!0,flush:"post"}),c=()=>i==null?void 0:i.takeRecords(),u=()=>{l(),a()};return jd(u),{isSupported:s,stop:u,takeRecords:c}}function O_(t,e={}){const{immediate:n=!0,fpsLimit:o=null,window:r=Ya,once:i=!1}=e,s=Re(!1),a=A(()=>{const h=bt(o);return h?1e3/h:null});let l=0,c=null;function u(h){if(!s.value||!r)return;l||(l=h);const g=h-l;if(a.value&&g<a.value){c=r.requestAnimationFrame(u);return}if(l=h,t({delta:g,timestamp:h}),i){s.value=!1,c=null;return}c=r.requestAnimationFrame(u)}function d(){!s.value&&r&&(s.value=!0,l=0,c=r.requestAnimationFrame(u))}function f(){s.value=!1,c!=null&&r&&(r.cancelAnimationFrame(c),c=null)}return n&&d(),jd(f),{isActive:so(s),pause:f,resume:d}}const RN=Symbol("vueuse-ssr-width");function FN(){const t=ty()?AN(RN,null):null;return typeof t=="number"?t:void 0}function My(t,e={}){const{window:n=Ya,ssrWidth:o=FN()}=e,r=Ty(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function"),i=Re(typeof o=="number"),s=Re(),a=Re(!1),l=c=>{a.value=c.matches};return em(()=>{if(i.value){i.value=!r.value,a.value=bt(t).split(",").some(c=>{const u=c.includes("not all"),d=c.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),f=c.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let h=!!(d||f);return d&&h&&(h=o>=M_(d[1])),f&&h&&(h=o<=M_(f[1])),u?!h:h});return}r.value&&(s.value=n.matchMedia(bt(t)),a.value=s.value.matches)}),Vs(s,"change",l,{passive:!0}),A(()=>a.value)}function ss(t,e,n={}){const{window:o=Ya,...r}=n;let i;const s=Ty(()=>o&&"ResizeObserver"in o),a=()=>{i&&(i.disconnect(),i=void 0)},l=qe(A(()=>{const u=bt(t);return Array.isArray(u)?u.map(d=>rr(d)):[rr(u)]}),u=>{if(a(),s.value&&o){i=new ResizeObserver(e);for(const d of u)d&&i.observe(d,r)}},{immediate:!0,flush:"post"}),c=()=>{a(),l()};return jd(c),{isSupported:s,stop:c}}function VN(t,e={}){const{reset:n=!0,windowResize:o=!0,windowScroll:r=!0,immediate:i=!0,updateTiming:s="sync"}=e,a=Re(0),l=Re(0),c=Re(0),u=Re(0),d=Re(0),f=Re(0),h=Re(0),g=Re(0);function v(){const b=rr(t);if(!b){n&&(a.value=0,l.value=0,c.value=0,u.value=0,d.value=0,f.value=0,h.value=0,g.value=0);return}const y=b.getBoundingClientRect();a.value=y.height,l.value=y.bottom,c.value=y.left,u.value=y.right,d.value=y.top,f.value=y.width,h.value=y.x,g.value=y.y}function m(){s==="sync"?v():s==="next-frame"&&requestAnimationFrame(()=>v())}return ss(t,m),qe(()=>rr(t),b=>!b&&m()),NN(t,m,{attributeFilter:["style","class"]}),r&&Vs("scroll",m,{capture:!0,passive:!0}),o&&Vs("resize",m,{passive:!0}),$y(()=>{i&&m()}),{height:a,bottom:l,left:c,right:u,top:d,width:f,x:h,y:g,update:m}}function zN(t,e={width:0,height:0},n={}){const{window:o=Ya,box:r="content-box"}=n,i=A(()=>{var d;return(d=rr(t))===null||d===void 0||(d=d.namespaceURI)===null||d===void 0?void 0:d.includes("svg")}),s=Re(e.width),a=Re(e.height),{stop:l}=ss(t,([d])=>{const f=r==="border-box"?d.borderBoxSize:r==="content-box"?d.contentBoxSize:d.devicePixelContentBoxSize;if(o&&i.value){const h=rr(t);if(h){const g=h.getBoundingClientRect();s.value=g.width,a.value=g.height}}else if(f){const h=Cd(f);s.value=h.reduce((g,{inlineSize:v})=>g+v,0),a.value=h.reduce((g,{blockSize:v})=>g+v,0)}else s.value=d.contentRect.width,a.value=d.contentRect.height},n);$y(()=>{const d=rr(t);d&&(s.value="offsetWidth"in d?d.offsetWidth:e.width,a.value="offsetHeight"in d?d.offsetHeight:e.height)});const c=qe(()=>rr(t),d=>{s.value=d?e.width:0,a.value=d?e.height:0});function u(){l(),c()}return{width:s,height:a,stop:u}}function HN(t){if("interval"in t||"immediate"in t){const{interval:e="requestAnimationFrame",immediate:n=!0}=t;return e==="requestAnimationFrame"?o=>O_(o,{immediate:n}):o=>S1(o,e,t)}return O_}function WN(t={}){const{controls:e=!1,scheduler:n=HN(t)}=t,o=ze(new Date),i=n(()=>o.value=new Date);return e?{now:o,...i}:o}const UN=[{max:6e4,value:1e3,name:"second"},{max:276e4,value:6e4,name:"minute"},{max:72e6,value:36e5,name:"hour"},{max:5184e5,value:864e5,name:"day"},{max:24192e5,value:6048e5,name:"week"},{max:28512e6,value:2592e6,name:"month"},{max:Number.POSITIVE_INFINITY,value:31536e6,name:"year"}],GN={justNow:"just now",past:t=>t.match(/\d/)?`${t} ago`:t,future:t=>t.match(/\d/)?`in ${t}`:t,month:(t,e)=>t===1?e?"last month":"next month":`${t} month${t>1?"s":""}`,year:(t,e)=>t===1?e?"last year":"next year":`${t} year${t>1?"s":""}`,day:(t,e)=>t===1?e?"yesterday":"tomorrow":`${t} day${t>1?"s":""}`,week:(t,e)=>t===1?e?"last week":"next week":`${t} week${t>1?"s":""}`,hour:t=>`${t} hour${t>1?"s":""}`,minute:t=>`${t} minute${t>1?"s":""}`,second:t=>`${t} second${t>1?"s":""}`,invalid:""};function qN(t){return t.toISOString().slice(0,10)}function YN(t){if("updateInterval"in t){const{updateInterval:e=3e4}=t;return n=>S1(n,e)}return e=>S1(e,3e4)}function jN(t,e={}){const{controls:n=!1,scheduler:o=YN(e)}=e,{now:r,...i}=WN({scheduler:o,controls:!0}),s=A(()=>XN(new Date(bt(t)),e,bt(r)));return n?{timeAgo:s,...i}:s}function XN(t,e={},n=Date.now()){const{max:o,messages:r=GN,fullDateFormatter:i=qN,units:s=UN,showSecond:a=!1,rounding:l="round"}=e,c=typeof l=="number"?m=>+m.toFixed(l):Math[l],u=+n-+t,d=Math.abs(u);function f(m,b){return c(Math.abs(m)/b.value)}function h(m,b){const y=f(m,b),x=m>0,_=g(b.name,y,x);return g(x?"past":"future",_,x)}function g(m,b,y){const x=r[m];return typeof x=="function"?x(b,y):x.replace("{0}",b.toString())}if(d<6e4&&!a)return r.justNow;if(typeof o=="number"&&d>o)return i(new Date(t));if(typeof o=="string"){var v;const m=(v=s.find(b=>b.name===o))===null||v===void 0?void 0:v.max;if(m&&d>m)return i(new Date(t))}for(const[m,b]of s.entries()){if(f(u,b)<=0&&s[m-1])return h(u,s[m-1]);if(d<b.max)return h(u,b)}return r.invalid}function KN(t={}){const{window:e=Ya,initialWidth:n=Number.POSITIVE_INFINITY,initialHeight:o=Number.POSITIVE_INFINITY,listenOrientation:r=!0,includeScrollbar:i=!0,type:s="inner"}=t,a=Re(n),l=Re(o),c=()=>{if(e)if(s==="outer")a.value=e.outerWidth,l.value=e.outerHeight;else if(s==="visual"&&e.visualViewport){const{width:d,height:f,scale:h}=e.visualViewport;a.value=Math.round(d*h),l.value=Math.round(f*h)}else i?(a.value=e.innerWidth,l.value=e.innerHeight):(a.value=e.document.documentElement.clientWidth,l.value=e.document.documentElement.clientHeight)};c(),$y(c);const u={passive:!0};return Vs("resize",c,u),e&&s==="visual"&&e.visualViewport&&Vs(e.visualViewport,"resize",c,u),r&&qe(My("(orientation: portrait)"),()=>c()),{width:a,height:l}}var rn=(t=>(t.BarVertical="bar-vertical",t.BarHorizontal="bar-horizontal",t.BarMulti="bar-multi",t.ColumnStacked="column-stacked",t.BarStacked="bar-stacked",t.BarSplit="bar-split",t.BarGrouped="bar-grouped",t.Line="line",t.LineMulti="line-multi",t.Area="area",t.AreaStacked="area-stacked",t.Donut="donut",t.Pie="pie",t))(rn||{});function Af(t){const e=new Map,n=ze([]);function o(){n.value=Array.from(e.values())}return pi(t,{register(i,s){e.set(i,s),o()},update(i,s){e.set(i,s),o()},unregister(i){e.delete(i),o()}}),{entries:n}}function fA(t,e){const n=Yt(t,null);if(!n)return;const o=Oo();if(!o)return;const r=o.uid;fn(()=>{n.register(r,e())}),qe(e,i=>{n.update(r,i)}),qs(()=>{n.unregister(r)})}const hA=Symbol("ButtonGroupEntries"),pA=Symbol("DropdownEntries"),ZN=Symbol("PaletteEntries"),QN=Symbol("IconRailEntries"),JN=Symbol("ToggleEntries"),eR={sm:576,md:768,lg:992,xl:1200,xxl:1400};function gi(t="md"){const e=typeof t=="number"?t:eR[t];return{isNarrow:My(`(max-width: ${e-1}px)`)}}const tR=le({__name:"ButtonIconCounter",props:{counter:{default:null},variant:{default:"secondary"}},setup(t){return(e,n)=>{const o=wy;return t.counter!=null?(w(),Z(o,{key:0,variant:t.variant,class:"button-icon-counter text-nowrap",pill:""},{default:ee(()=>[Ce(e.$slots,"default",{},()=>[Ye(be(t.counter),1)])]),_:3},8,["variant"])):ie("",!0)}}}),nR=le({__name:"AppIcon",props:{name:{default:void 0},size:{default:void 0},scale:{default:1},variant:{default:void 0},hoverVariant:{default:void 0},beat:{type:Boolean},beatDuration:{default:"1s"},fade:{type:Boolean},fadeDuration:{default:"1s"},spin:{type:Boolean},spinReverse:{type:Boolean},spinDuration:{default:"1s"},hover:{type:Boolean}},setup(t){const e=t,n=Re(!1);function o(){n.value=e.hover}qe(()=>e.hover,o,{immediate:!0});const r=A(()=>{let u="currentColor";return e.variant&&(u=`var(--bs-${e.variant}, currentColor)`),n.value&&e.hoverVariant&&(u=`var(--bs-${e.hoverVariant}, ${u})`),u}),i=A(()=>typeof e.size=="string"&&e.size.endsWith("%")),s=A(()=>!["2xs","xs","sm","md","lg","xl","2xl",void 0].includes(e.size)&&!i.value),a=A(()=>["2xs","xs","sm","md","lg","xl","2xl"].includes(e.size??"")),l=A(()=>({"--app-icon-color":r.value,"--app-icon-raw-size":s.value?e.size:void 0,"--app-icon-percent-size":i.value?e.size:void 0,"--app-icon-size":a.value?e.size:void 0,"--app-icon-scale":e.scale??1,"--app-icon-spin-duration":e.spinDuration,"--app-icon-beat-duration":e.beatDuration,"--app-icon-fade-duration":e.fadeDuration})),c=A(()=>({[`app-icon--size-${e.size}`]:a.value,"app-icon--has-size":a.value,"app-icon--raw-size":s.value,"app-icon--percent-size":i.value,"app-icon--hover":n.value,"app-icon--spin":e.spin,"app-icon--spin-reverse":e.spinReverse,"app-icon--beat":e.beat,"app-icon--fade":e.fade}));return(u,d)=>(w(),R("span",{class:Te(["app-icon",p(c)]),style:Pt(p(l)),onMouseenter:d[0]||(d[0]=f=>n.value=!0),onMouseleave:d[1]||(d[1]=f=>n.value=t.hover??!1)},[t.name?(w(),Z(Gt(t.name),{key:0})):Ce(u.$slots,"default",{key:1},void 0,!0)],38))}}),Oe=(t,e)=>{const n=t.__vccOpts||t;for(const[o,r]of e)n[o]=r;return n},Cf=Oe(nR,[["__scopeId","data-v-eaec91c1"]]),oR={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function rR(t,e){return w(),R("svg",oR,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M232 128a104 104 0 0 1-208 0c0-41 23.81-78.36 60.66-95.27a8 8 0 0 1 6.68 14.54C60.15 61.59 40 93.27 40 128a88 88 0 0 0 176 0c0-34.73-20.15-66.41-51.34-80.73a8 8 0 0 1 6.68-14.54C208.19 49.64 232 87 232 128"},null,-1)])])}const iR=Me({name:"ph-circle-notch",render:rR}),sR={key:1,class:"button-icon__label"},aR=le({__name:"ButtonIcon",props:{id:{},iconLeft:{},iconLeftVariant:{},iconLeftHoverVariant:{},iconLeftSize:{default:"1.25em"},iconRight:{},iconRightVariant:{},iconRightHoverVariant:{},iconRightSize:{default:"1.25em"},iconSpinner:{default:()=>iR},hideLabel:{type:Boolean,default:!1},hideTooltip:{type:Boolean,default:!1},label:{},square:{type:Boolean,default:!1},variant:{},size:{},block:{type:Boolean},pill:{type:Boolean},tag:{default:"button"},type:{default:"button"},loading:{type:Boolean},loadingDuration:{default:"1s"},loadingText:{},tooltipLabel:{},tooltipPlacement:{default:"top"},tooltipDelay:{default:()=>({show:0,hide:0})},showTooltipForce:{type:Boolean},hover:{type:Boolean},truncate:{type:Boolean},counter:{default:null},counterVariant:{},counterStyle:{}},emits:["click:icon-right"],setup(t,{emit:e}){let n=0;const o=Yt("variant","action"),r=Yt("size","md"),i=ht("element"),s=t,a=e;function l(y){a(`click:${y}`)}const c=Re(!1),u=A(()=>s.id??`button-icon-${++n}`),d=A(()=>({"button-icon--square":s.square,"button-icon--loading":s.loading,"button-icon--truncate":s.truncate,"button-icon--hover":c.value,"button-icon--use-injected-variant":!s.variant,"button-icon--use-injected-size":!s.size})),f=A(()=>s.loading?s.iconSpinner:s.iconLeft),h=A(()=>s.loading?s.iconSpinner:s.iconRight),g=A(()=>s.loading&&s.loadingText?s.loadingText:s.label),v=A(()=>s.tooltipLabel??s.label),m=A(()=>!!v.value&&!s.hideTooltip&&(s.showTooltipForce||s.hideLabel)),b=A(()=>({pill:s.pill,pressed:s.pressed,size:s.size??r,tag:s.tag,type:s.type,variant:s.variant??o}));return(y,x)=>{const _=Cf,k=tR,E=qd,L=Ho;return w(),Z(L,Ct(p(b),{id:p(u),ref:"element",class:["button-icon",p(d)],"aria-label":p(v),onMouseenter:x[1]||(x[1]=S=>c.value=!0),onMouseleave:x[2]||(x[2]=S=>c.value=!1)}),{default:ee(()=>[Ce(y.$slots,"start",{},void 0,!0),t.iconLeft||!t.iconLeft&&!t.iconRight&&t.loading?(w(),Z(_,{key:0,name:p(f),size:t.iconLeftSize,spin:t.loading,"spin-duration":t.loadingDuration,variant:t.iconLeftVariant,"hover-variant":t.iconLeftHoverVariant,hover:p(c),class:"button-icon__icon-left"},null,8,["name","size","spin","spin-duration","variant","hover-variant","hover"])):ie("",!0),t.hideLabel?ie("",!0):(w(),R("span",sR,[Ce(y.$slots,"default",Wn(tr({labelOrLoadingText:p(g)})),()=>[Ye(be(p(g)),1)],!0)])),t.iconRight?(w(),Z(_,{key:2,name:p(h),size:t.iconRightSize,spin:t.loading,"spin-duration":t.loadingDuration,variant:t.iconRightVariant,"hover-variant":t.iconRightHoverVariant,hover:p(c),class:"button-icon__icon-right",onClick:x[0]||(x[0]=S=>l("icon-right"))},null,8,["name","size","spin","spin-duration","variant","hover-variant","hover"])):ie("",!0),t.counter!==null?(w(),Z(k,{key:3,counter:t.counter,variant:t.counterVariant,style:Pt(t.counterStyle)},null,8,["counter","variant","style"])):ie("",!0),Ce(y.$slots,"end",{},void 0,!0),p(m)?(w(),Z(E,{key:4,"teleport-to":"body",delay:t.tooltipDelay,"boundary-padding":20,placement:t.tooltipPlacement,target:p(i),title:p(v)},null,8,["delay","placement","target","title"])):ie("",!0)]),_:3},16,["id","class","aria-label"])}}}),Kn=Oe(aR,[["__scopeId","data-v-7adc8c82"]]),lR={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function cR(t,e){return w(),R("svg",lR,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M216 32H88a8 8 0 0 0-8 8v40H40a8 8 0 0 0-8 8v128a8 8 0 0 0 8 8h128a8 8 0 0 0 8-8v-40h40a8 8 0 0 0 8-8V40a8 8 0 0 0-8-8m-56 176H48V96h112Zm48-48h-32V88a8 8 0 0 0-8-8H96V48h112Z"},null,-1)])])}const mA=Me({name:"ph-copy",render:cR}),uR={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function dR(t,e){return w(),R("svg",uR,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"m229.66 77.66l-128 128a8 8 0 0 1-11.32 0l-56-56a8 8 0 0 1 11.32-11.32L96 188.69L218.34 66.34a8 8 0 0 1 11.32 11.32"},null,-1)])])}const Oy=Me({name:"ph-check",render:dR}),B_=le({__name:"ActionCopyButton",props:{text:{},label:{default:"Copy"},variant:{default:"outline-secondary"},size:{default:"sm"}},setup(t){const e=t,n=Re(!1);let o;async function r(){try{await globalThis.navigator.clipboard.writeText(e.text),n.value=!0,clearTimeout(o),o=setTimeout(()=>{n.value=!1},1500)}catch{}}return(i,s)=>{const a=Kn;return w(),Z(a,{"icon-left":p(n)?p(Oy):p(mA),label:p(n)?"Copied!":t.label,variant:p(n)?"success":t.variant,size:t.size,onClick:r},null,8,["icon-left","label","variant","size"])}}}),nn=le({__name:"FormControlCheckbox",props:st({label:{}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=ft(t,"modelValue");return(n,o)=>{const r=Fs,i=On;return w(),Z(i,{class:"form-control-checkbox"},{default:ee(()=>[H(r,{"model-value":e.value,class:"form-control-checkbox__input",switch:"","onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s)},{default:ee(()=>[Ce(n.$slots,"default",{},()=>[Ye(be(t.label),1)])]),_:3},8,["model-value"]),e.value?Ce(n.$slots,"section",{key:0}):ie("",!0)]),_:3})}}});function Dp(t){"@babel/helpers - typeof";return Dp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dp(t)}var fR=/^\s+/,hR=/\s+$/;function et(t,e){if(t=t||"",e=e||{},t instanceof et)return t;if(!(this instanceof et))return new et(t,e);var n=pR(t);this._originalInput=t,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||n.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}et.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),e,n,o,r,i,s;return e=t.r/255,n=t.g/255,o=t.b/255,e<=.03928?r=e/12.92:r=Math.pow((e+.055)/1.055,2.4),n<=.03928?i=n/12.92:i=Math.pow((n+.055)/1.055,2.4),o<=.03928?s=o/12.92:s=Math.pow((o+.055)/1.055,2.4),.2126*r+.7152*i+.0722*s},setAlpha:function(t){return this._a=gA(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=P_(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=P_(this._r,this._g,this._b),e=Math.round(t.h*360),n=Math.round(t.s*100),o=Math.round(t.v*100);return this._a==1?"hsv("+e+", "+n+"%, "+o+"%)":"hsva("+e+", "+n+"%, "+o+"%, "+this._roundA+")"},toHsl:function(){var t=L_(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=L_(this._r,this._g,this._b),e=Math.round(t.h*360),n=Math.round(t.s*100),o=Math.round(t.l*100);return this._a==1?"hsl("+e+", "+n+"%, "+o+"%)":"hsla("+e+", "+n+"%, "+o+"%, "+this._roundA+")"},toHex:function(t){return D_(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return bR(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(mn(this._r,255)*100)+"%",g:Math.round(mn(this._g,255)*100)+"%",b:Math.round(mn(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(mn(this._r,255)*100)+"%, "+Math.round(mn(this._g,255)*100)+"%, "+Math.round(mn(this._b,255)*100)+"%)":"rgba("+Math.round(mn(this._r,255)*100)+"%, "+Math.round(mn(this._g,255)*100)+"%, "+Math.round(mn(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:OR[D_(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var e="#"+E_(this._r,this._g,this._b,this._a),n=e,o=this._gradientType?"GradientType = 1, ":"";if(t){var r=et(t);n="#"+E_(r._r,r._g,r._b,r._a)}return"progid:DXImageTransform.Microsoft.gradient("+o+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,o=this._a<1&&this._a>=0,r=!e&&o&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return r?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(n=this.toRgbString()),t==="prgb"&&(n=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(n=this.toHexString()),t==="hex3"&&(n=this.toHexString(!0)),t==="hex4"&&(n=this.toHex8String(!0)),t==="hex8"&&(n=this.toHex8String()),t==="name"&&(n=this.toName()),t==="hsl"&&(n=this.toHslString()),t==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},clone:function(){return et(this.toString())},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(_R,arguments)},brighten:function(){return this._applyModification(kR,arguments)},darken:function(){return this._applyModification(SR,arguments)},desaturate:function(){return this._applyModification(yR,arguments)},saturate:function(){return this._applyModification(xR,arguments)},greyscale:function(){return this._applyModification(wR,arguments)},spin:function(){return this._applyModification(AR,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(TR,arguments)},complement:function(){return this._applyCombination(CR,arguments)},monochromatic:function(){return this._applyCombination(MR,arguments)},splitcomplement:function(){return this._applyCombination($R,arguments)},triad:function(){return this._applyCombination(I_,[3])},tetrad:function(){return this._applyCombination(I_,[4])}};et.fromRatio=function(t,e){if(Dp(t)=="object"){var n={};for(var o in t)t.hasOwnProperty(o)&&(o==="a"?n[o]=t[o]:n[o]=rd(t[o]));t=n}return et(t,e)};function pR(t){var e={r:0,g:0,b:0},n=1,o=null,r=null,i=null,s=!1,a=!1;return typeof t=="string"&&(t=DR(t)),Dp(t)=="object"&&(bs(t.r)&&bs(t.g)&&bs(t.b)?(e=mR(t.r,t.g,t.b),s=!0,a=String(t.r).substr(-1)==="%"?"prgb":"rgb"):bs(t.h)&&bs(t.s)&&bs(t.v)?(o=rd(t.s),r=rd(t.v),e=vR(t.h,o,r),s=!0,a="hsv"):bs(t.h)&&bs(t.s)&&bs(t.l)&&(o=rd(t.s),i=rd(t.l),e=gR(t.h,o,i),s=!0,a="hsl"),t.hasOwnProperty("a")&&(n=t.a)),n=gA(n),{ok:s,format:t.format||a,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}function mR(t,e,n){return{r:mn(t,255)*255,g:mn(e,255)*255,b:mn(n,255)*255}}function L_(t,e,n){t=mn(t,255),e=mn(e,255),n=mn(n,255);var o=Math.max(t,e,n),r=Math.min(t,e,n),i,s,a=(o+r)/2;if(o==r)i=s=0;else{var l=o-r;switch(s=a>.5?l/(2-o-r):l/(o+r),o){case t:i=(e-n)/l+(e<n?6:0);break;case e:i=(n-t)/l+2;break;case n:i=(t-e)/l+4;break}i/=6}return{h:i,s,l:a}}function gR(t,e,n){var o,r,i;t=mn(t,360),e=mn(e,100),n=mn(n,100);function s(c,u,d){return d<0&&(d+=1),d>1&&(d-=1),d<1/6?c+(u-c)*6*d:d<1/2?u:d<2/3?c+(u-c)*(2/3-d)*6:c}if(e===0)o=r=i=n;else{var a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;o=s(l,a,t+1/3),r=s(l,a,t),i=s(l,a,t-1/3)}return{r:o*255,g:r*255,b:i*255}}function P_(t,e,n){t=mn(t,255),e=mn(e,255),n=mn(n,255);var o=Math.max(t,e,n),r=Math.min(t,e,n),i,s,a=o,l=o-r;if(s=o===0?0:l/o,o==r)i=0;else{switch(o){case t:i=(e-n)/l+(e<n?6:0);break;case e:i=(n-t)/l+2;break;case n:i=(t-e)/l+4;break}i/=6}return{h:i,s,v:a}}function vR(t,e,n){t=mn(t,360)*6,e=mn(e,100),n=mn(n,100);var o=Math.floor(t),r=t-o,i=n*(1-e),s=n*(1-r*e),a=n*(1-(1-r)*e),l=o%6,c=[n,s,i,i,a,n][l],u=[a,n,n,s,i,i][l],d=[i,i,a,n,n,s][l];return{r:c*255,g:u*255,b:d*255}}function D_(t,e,n,o){var r=[ai(Math.round(t).toString(16)),ai(Math.round(e).toString(16)),ai(Math.round(n).toString(16))];return o&&r[0].charAt(0)==r[0].charAt(1)&&r[1].charAt(0)==r[1].charAt(1)&&r[2].charAt(0)==r[2].charAt(1)?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")}function bR(t,e,n,o,r){var i=[ai(Math.round(t).toString(16)),ai(Math.round(e).toString(16)),ai(Math.round(n).toString(16)),ai(vA(o))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function E_(t,e,n,o){var r=[ai(vA(o)),ai(Math.round(t).toString(16)),ai(Math.round(e).toString(16)),ai(Math.round(n).toString(16))];return r.join("")}et.equals=function(t,e){return!t||!e?!1:et(t).toRgbString()==et(e).toRgbString()};et.random=function(){return et.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function yR(t,e){e=e===0?0:e||10;var n=et(t).toHsl();return n.s-=e/100,n.s=wm(n.s),et(n)}function xR(t,e){e=e===0?0:e||10;var n=et(t).toHsl();return n.s+=e/100,n.s=wm(n.s),et(n)}function wR(t){return et(t).desaturate(100)}function _R(t,e){e=e===0?0:e||10;var n=et(t).toHsl();return n.l+=e/100,n.l=wm(n.l),et(n)}function kR(t,e){e=e===0?0:e||10;var n=et(t).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(e/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(e/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(e/100)))),et(n)}function SR(t,e){e=e===0?0:e||10;var n=et(t).toHsl();return n.l-=e/100,n.l=wm(n.l),et(n)}function AR(t,e){var n=et(t).toHsl(),o=(n.h+e)%360;return n.h=o<0?360+o:o,et(n)}function CR(t){var e=et(t).toHsl();return e.h=(e.h+180)%360,et(e)}function I_(t,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var n=et(t).toHsl(),o=[et(t)],r=360/e,i=1;i<e;i++)o.push(et({h:(n.h+i*r)%360,s:n.s,l:n.l}));return o}function $R(t){var e=et(t).toHsl(),n=e.h;return[et(t),et({h:(n+72)%360,s:e.s,l:e.l}),et({h:(n+216)%360,s:e.s,l:e.l})]}function TR(t,e,n){e=e||6,n=n||30;var o=et(t).toHsl(),r=360/n,i=[et(t)];for(o.h=(o.h-(r*e>>1)+720)%360;--e;)o.h=(o.h+r)%360,i.push(et(o));return i}function MR(t,e){e=e||6;for(var n=et(t).toHsv(),o=n.h,r=n.s,i=n.v,s=[],a=1/e;e--;)s.push(et({h:o,s:r,v:i})),i=(i+a)%1;return s}et.mix=function(t,e,n){n=n===0?0:n||50;var o=et(t).toRgb(),r=et(e).toRgb(),i=n/100,s={r:(r.r-o.r)*i+o.r,g:(r.g-o.g)*i+o.g,b:(r.b-o.b)*i+o.b,a:(r.a-o.a)*i+o.a};return et(s)};et.readability=function(t,e){var n=et(t),o=et(e);return(Math.max(n.getLuminance(),o.getLuminance())+.05)/(Math.min(n.getLuminance(),o.getLuminance())+.05)};et.isReadable=function(t,e,n){var o=et.readability(t,e),r,i;switch(i=!1,r=ER(n),r.level+r.size){case"AAsmall":case"AAAlarge":i=o>=4.5;break;case"AAlarge":i=o>=3;break;case"AAAsmall":i=o>=7;break}return i};et.mostReadable=function(t,e,n){var o=null,r=0,i,s,a,l;n=n||{},s=n.includeFallbackColors,a=n.level,l=n.size;for(var c=0;c<e.length;c++)i=et.readability(t,e[c]),i>r&&(r=i,o=et(e[c]));return et.isReadable(t,o,{level:a,size:l})||!s?o:(n.includeFallbackColors=!1,et.mostReadable(t,["#fff","#000"],n))};var A1=et.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},OR=et.hexNames=BR(A1);function BR(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}function gA(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function mn(t,e){LR(t)&&(t="100%");var n=PR(t);return t=Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function wm(t){return Math.min(1,Math.max(0,t))}function pr(t){return parseInt(t,16)}function LR(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function PR(t){return typeof t=="string"&&t.indexOf("%")!=-1}function ai(t){return t.length==1?"0"+t:""+t}function rd(t){return t<=1&&(t=t*100+"%"),t}function vA(t){return Math.round(parseFloat(t)*255).toString(16)}function N_(t){return pr(t)/255}var ni=(function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",n="(?:"+e+")|(?:"+t+")",o="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+o),rgba:new RegExp("rgba"+r),hsl:new RegExp("hsl"+o),hsla:new RegExp("hsla"+r),hsv:new RegExp("hsv"+o),hsva:new RegExp("hsva"+r),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}})();function bs(t){return!!ni.CSS_UNIT.exec(t)}function DR(t){t=t.replace(fR,"").replace(hR,"").toLowerCase();var e=!1;if(A1[t])t=A1[t],e=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=ni.rgb.exec(t))?{r:n[1],g:n[2],b:n[3]}:(n=ni.rgba.exec(t))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=ni.hsl.exec(t))?{h:n[1],s:n[2],l:n[3]}:(n=ni.hsla.exec(t))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=ni.hsv.exec(t))?{h:n[1],s:n[2],v:n[3]}:(n=ni.hsva.exec(t))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=ni.hex8.exec(t))?{r:pr(n[1]),g:pr(n[2]),b:pr(n[3]),a:N_(n[4]),format:e?"name":"hex8"}:(n=ni.hex6.exec(t))?{r:pr(n[1]),g:pr(n[2]),b:pr(n[3]),format:e?"name":"hex"}:(n=ni.hex4.exec(t))?{r:pr(n[1]+""+n[1]),g:pr(n[2]+""+n[2]),b:pr(n[3]+""+n[3]),a:N_(n[4]+""+n[4]),format:e?"name":"hex8"}:(n=ni.hex3.exec(t))?{r:pr(n[1]+""+n[1]),g:pr(n[2]+""+n[2]),b:pr(n[3]+""+n[3]),format:e?"name":"hex"}:!1}function ER(t){var e,n;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:e,size:n}}const R_=(t,e,n=!1)=>{if(n)switch(e){case"rgb":return t.toRgb();case"prgb":return t.toPercentageRgb();case"hsl":return t.toHsl();case"hsv":return t.toHsv();default:return null}else{let o=e;e==="hex"&&t.getAlpha()<1&&(o="hex8");let r=t.toString(o);try{r=JSON.parse(r)}catch{}return r}},Qg=(t,e)=>!!(Object.prototype.hasOwnProperty.call(t,e)&&typeof t[e]<"u"),rh=t=>typeof t>"u",By=["update:tinyColor","update:modelValue","input"];function Ly(t,e,n){let o,r;const i=A({get:()=>{const{modelValue:a,tinyColor:l,value:c}=t,u=l??a??c;return rh(r)&&(rh(c)||(r=et(c).getFormat()),rh(a)||(r=et(a).getFormat())),rh(o)&&(typeof c=="object"&&!(c instanceof et)&&(o=!0),typeof a=="object"&&(o=!0)),et(u)},set:a=>{s(a)}}),s=a=>{const l=et(a);if(Qg(t,"tinyColor")&&e("update:tinyColor",l),Qg(t,"modelValue")){const c=R_(l,r,o);e("update:modelValue",c)}if(Qg(t,"value")){const c=R_(l,r,o);e("input",c)}};return i}const bA=t=>{var n,o,r,i;const e={x:0,y:0};return t instanceof MouseEvent&&(e.x=t.pageX,e.y=t.pageY),typeof TouchEvent<"u"&&t instanceof TouchEvent&&(e.x=(n=t.touches)!=null&&n[0]?t.touches[0].pageX:(o=t.changedTouches)!=null&&o[0]?t.changedTouches[0].pageX:0,e.y=(r=t.touches)!=null&&r[0]?t.touches[0].pageY:(i=t.changedTouches)!=null&&i[0]?t.changedTouches[0].pageY:0),e},IR=()=>{const t=window.scrollX||window.pageXOffset||document.documentElement.scrollLeft||0,e=window.scrollY||window.pageYOffset||document.documentElement.scrollTop||0;return{x:t,y:e}},yA=t=>{const{x:e,y:n}=IR(),o=t.getBoundingClientRect();return{x:o.left+e,y:o.top+n}},Py=t=>t.code==="ArrowUp"||t.keyCode===38?"up":t.code==="ArrowDown"||t.keyCode===40?"down":t.code==="ArrowLeft"||t.keyCode===37?"left":t.code==="ArrowRight"||t.keyCode===39?"right":null;function NR(t){const e=t.toString();return e.indexOf(".")!==-1?e.split(".")[1].length:0}function Jg(t,e,n){return Math.min(Math.max(t,e),n)}const xA=(t,e=20)=>{let n,o,r;return(...i)=>{n?(clearTimeout(o),o=setTimeout(()=>{Date.now()-r>=e&&(t(...i),r=Date.now())},Math.max(e-(Date.now()-r),0))):(t(...i),r=Date.now(),n=!0)}},RR=["aria-valuetext"],FR=le({__name:"SaturationSlider",props:{hue:{},tinyColor:{},modelValue:{},value:{}},emits:["change"].concat(By),setup(t,{emit:e}){const n=e,o=t,r=ze(0),i=Ly(o,n),s=A(()=>i.value.toHsv()),a=A(()=>o.hue??s.value.h),l=A(()=>`hsl(${a.value}, 100%, 50%)`),c=A(()=>-(s.value.v*100)+1+100+"%"),u=A(()=>s.value.v<=.01?r.value*100+"%":s.value.s*100+"%"),d=ze(null);function f(x){const _=d.value;if(!_)return;const k=_.clientWidth,E=_.clientHeight,{x:L,y:S}=yA(_),{x:B,y:D}=bA(x),N=Jg(B-L,0,k),C=Jg(D-S,0,E),M=N/k,P=Jg(1-C/E,0,1);r.value=M;let $=Math.round(M*100),F=Math.round(P*100);$===1&&($=.01),F===1&&(F=.01),h({h:a.value,s:$,v:F,a:s.value.a})}function h(x){i.value=x}const g=xA(f,20);function v(x){x.preventDefault(),x.type.startsWith("mouse")?(window.addEventListener("mousemove",g),window.addEventListener("mouseup",g),window.addEventListener("mouseup",m)):x.type.startsWith("touch")&&(window.addEventListener("touchmove",g),window.addEventListener("touchend",g),window.addEventListener("touchend",m))}function m(){b()}function b(){window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",g),window.removeEventListener("mouseup",m),window.removeEventListener("touchmove",g),window.removeEventListener("touchend",g),window.removeEventListener("touchend",m)}function y(x){switch(x.preventDefault(),Py(x)){case"left":{const _=s.value.s-.01;h({...s.value,s:_>=0?_:0});break}case"right":{const _=s.value.s+.01;h({...s.value,s:_>1?1:_});break}case"up":{const _=s.value.v+.01;h({...s.value,v:_>1?1:_});break}case"down":{const _=s.value.v-.01;h({...s.value,v:_<0?0:_});break}}}return Js(()=>{b()}),(x,_)=>(w(),R("div",{class:"vc-saturation-slider bg",style:Pt({background:l.value}),ref_key:"containerRef",ref:d,onMousedown:v,onTouchstart:v,role:"application","aria-label":"Saturation and brightness picker"},[_[1]||(_[1]=T("div",{class:"bg white"},null,-1)),_[2]||(_[2]=T("div",{class:"bg black"},null,-1)),T("div",{class:"picker-wrap",style:Pt({top:c.value,left:u.value}),role:"slider",tabindex:"0","aria-valuemin":"0","aria-valuemax":"1","aria-label":"press arrow to change saturation or brightness","aria-valuenow":"?","aria-valuetext":`saturation: ${s.value.s.toFixed(0)}%, brightness: ${s.value.v.toFixed(0)}%`,onKeydown:y},_[0]||(_[0]=[T("div",{class:"picker"},null,-1)]),44,RR)],36))}}),bu=(t,e)=>{const n=t.__vccOpts||t;for(const[o,r]of e)n[o]=r;return n},VR=bu(FR,[["__scopeId","data-v-4d048d6e"]]),C1=t=>typeof t<"u",zR={class:"vc-base-slider"},HR={key:0,class:"background"},WR=["aria-label","aria-valuemax","aria-valuenow"],UR=le({__name:"BaseSlider",props:{direction:{default:"horizontal"},modelValue:{default:0},value:{default:0},max:{default:100},step:{},ariaLabel:{default:"slider"}},emits:["input","update:modelValue"],setup(t,{emit:e}){const n=t,o=e,r=A(()=>n.modelValue??n.value),i=A(()=>{let g=r.value/n.max;return n.direction==="vertical"&&(g=1-g),100*g+"%"}),s=ze(null);function a(g){C1(g)&&(o("input",g),o("update:modelValue",g))}function l(g){const{direction:v,max:m}=n,b=s.value;if(!b)return;const y=b.clientWidth,x=b.clientHeight,{x:_,y:k}=yA(b),{x:E,y:L}=bA(g),S=E-_,B=L-k;let D;v==="vertical"?B<0?D=m:B>x?D=0:D=(1-B/x)*m:S<0?D=0:S>y?D=m:D=S/y*m,a(D)}const c=xA(l);function u(g){l(g),g.type.startsWith("mouse")?(window.addEventListener("mousemove",c),window.addEventListener("mouseup",d)):(window.addEventListener("touchmove",c),window.addEventListener("touchend",d))}function d(){f()}function f(){window.removeEventListener("mousemove",c),window.removeEventListener("mouseup",d),window.removeEventListener("touchmove",c),window.removeEventListener("touchend",d)}function h(g){g.preventDefault();const{direction:v,max:m}=n,b=Py(g),y=n.step??m/100,x=r.value;let _;switch(b){case"left":{if(v!=="horizontal")return;_=x-y<0?0:x-y;break}case"right":{if(v!=="horizontal")return;_=x+y>m?m:x+y;break}case"down":{if(v!=="vertical")return;_=x-y<0?0:x-y;break}case"up":{if(v!=="vertical")return;_=x+y>m?m:x+y;break}}a(_)}return Js(()=>{f()}),(g,v)=>(w(),R("div",zR,[g.$slots.background?(w(),R("div",HR,[Ce(g.$slots,"background",{},void 0,!0)])):ie("",!0),T("div",{class:Te({slider:!0,horizontal:g.direction==="horizontal",vertical:g.direction==="vertical"}),ref_key:"containerRef",ref:s,onMousedown:u,onTouchstart:u,role:"slider","aria-label":g.ariaLabel,"aria-valuemax":g.max,"aria-valuemin":"0","aria-valuenow":r.value.toFixed(1),tabindex:"0",onKeydown:h},[T("div",{class:"picker-wrap",style:Pt({left:g.direction==="horizontal"?i.value:0,top:g.direction==="vertical"?i.value:0}),role:"presentation"},[Ce(g.$slots,"picker",{},()=>[v[0]||(v[0]=T("div",{class:"picker"},null,-1))],!0)],4)],42,WR)]))}}),GR=bu(UR,[["__scopeId","data-v-972b0fad"]]),qR=le({__name:"HueSlider",props:{direction:{default:"horizontal"},modelValue:{default:0}},emits:["update:modelValue"],setup(t,{emit:e}){V3(u=>({"2f44f39d":r.value}));const n=t,o=e,r=A(()=>`linear-gradient(to ${n.direction==="horizontal"?"right":"top"}, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%)`),i=A(()=>{const u=Number(n.modelValue);return Number.isNaN(u)?0:u}),s=ze();qe(i,(u,d)=>{u!==0&&u-d>0&&(s.value="right"),u!==0&&u-d<0&&(s.value="left")});const a=A(()=>n.direction==="vertical"?i.value===0&&s.value==="right"?0:i.value:n.direction==="horizontal"?i.value===0&&s.value==="right"?360:i.value:0);function l(u){c(Math.round(u))}function c(u){o("update:modelValue",u)}return(u,d)=>(w(),Z(GR,{class:"vc-hue-slider",max:360,step:1,modelValue:a.value,direction:u.direction,"onUpdate:modelValue":l,"aria-label":"Hue"},{background:ee(()=>d[0]||(d[0]=[T("div",{class:"gradient"},null,-1)])),picker:ee(()=>[Ce(u.$slots,"default",{},void 0,!0)]),_:3},8,["modelValue","direction"]))}}),wA=bu(qR,[["__scopeId","data-v-5367c985"]]),YR={class:"vc-editable-input"},jR=["value","aria-label"],XR={key:0,class:"vc-input-desc","aria-hidden":"true"},KR=le({__name:"EditableInput",props:{value:{},label:{},desc:{},max:{},min:{},step:{default:1},a11y:{}},emits:["change","blur"],setup(t,{emit:e}){var u;const n=t,o=e,r=((u=n.a11y)==null?void 0:u.label)??n.label,i=`input__label__${r}__${Math.random().toString().slice(2,5)}`;function s(d){const{min:f,max:h}=n;if(C1(h)&&+d>h){o("change",h);return}if(C1(f)&&+d<f){o("change",f);return}o("change",d)}function a(d){var f;s((f=d.target)==null?void 0:f.value)}function l(d){o("blur",d)}function c(d){let f=Number(n.value);if(!isNaN(f)){let h=n.step;const g=NR(h),v=Py(d);v==="up"&&(s((f+h).toFixed(g)),d.preventDefault()),v==="down"&&(s((f-h).toFixed(g)),d.preventDefault())}}return(d,f)=>(w(),R("div",YR,[T("input",{class:"vc-input-input",value:n.value,onKeydown:c,onInput:a,onBlur:l,"aria-label":p(r),id:i},null,40,jR),T("label",{for:i,class:"vc-input-label","aria-hidden":"true"},be(n.label),1),d.desc?(w(),R("span",XR,be(d.desc),1)):ie("",!0)]))}}),hl=bu(KR,[["__scopeId","data-v-9c267b2b"]]),F_=t=>et(t).isValid(),_A=le({__name:"HexInput",props:{value:{},label:{},desc:{},a11y:{},type:{default:"hex"},withHash:{type:Boolean,default:!1}},emits:["change"],setup(t,{emit:e}){const n=t,o=e,r={label:n.type==="hex"?"Hex":"Hex with transparency",...n.a11y},i=(c,u="hex")=>{let d="";return u==="hex"&&(d=et(c).toHexString()),u==="hex8"&&(d=et(c).toHex8String()),n.withHash!==!0&&(d=d.replace("#","")),d},s=ze(i(n.value,n.type));qe(()=>n.value,c=>{et.equals(c,s.value)||(s.value=i(c,n.type))});const a=c=>{if(!c)return;s.value=c;let u=c.length;c[0]==="#"&&(u=u-1),!(n.type==="hex"&&u%3!==0&&u!==8)&&(n.type==="hex8"&&u!==8||F_(c)&&o("change",c))},l=()=>{let c=s.value.length;s.value[0]==="#"&&(c=c-1),!(F_(s.value)&&(n.type==="hex"&&c===6||n.type==="hex8"&&c===8))&&(s.value=i(n.value,n.type))};return(c,u)=>(w(),Z(hl,{label:n.label,a11y:r,value:s.value,onChange:a,onBlur:l},null,8,["label","value"]))}});function ZR(){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";return t.charAt(Math.floor(Math.random()*t.length))+t.charAt(Math.floor(Math.random()*t.length))}const QR=t=>{const e=ze(0),n=`__from__vc__hue__${ZR()}`;return qe(t,o=>{if(o[n])return;const r=o.toHsl().h;r===0&&e.value!==0||(e.value=r)},{immediate:!0}),{hueRef:e,updateHueRef:o=>{const r=et({...t.value.toHsl(),h:o});r[n]=!0,t.value=r,e.value=o}}},JR={class:"title","aria-hidden":"true"},eF={class:"body"},tF={class:"saturation"},nF={class:"hue"},oF={class:"preview"},rF={class:"preview-label","aria-hidden":"true"},iF={class:"preview-swatches"},sF=["aria-label"],aF=["aria-label"],lF={class:"preview-label","aria-hidden":"true"},cF={key:0,class:"actions"},uF=["aria-label"],dF={class:"fields"},fF=["aria-label"];By.concat(["ok","cancel","reset"]);const hF={class:"body",role:"listbox",tabindex:"0","aria-label":"Select a color"},pF=["onClick","aria-label","title","aria-selected","onKeydown"],mF=["#FF6900","#FCB900","#7BDCB5","#00D084","#8ED1FC","#0693E3","#ABB8C3","#EB144C","#F78DA7","#9900EF"],gF=le({__name:"TwitterPicker",props:{width:{default:276},presetColors:{default:()=>mF},triangle:{default:"top-left"},tinyColor:{},modelValue:{},value:{}},emits:By,setup(t,{emit:e}){const n=t,o=Ly(n,e),r=A(()=>o.value.toHexString()),i=l=>l.toLowerCase()===r.value.toLowerCase(),s=l=>{o.value=l},a=l=>{o.value=l};return(l,c)=>(w(),R("div",{class:Te(["vc-twitter-picker",{tri_hide:n.triangle==="hide",tri_top_left:n.triangle==="top-left",tri_top_right:n.triangle==="top-right"}]),style:Pt({width:typeof n.width=="number"?`${n.width}px`:n.width}),role:"application","aria-label":"Twitter color picker"},[c[2]||(c[2]=T("div",{class:"triangle_shadow"},null,-1)),c[3]||(c[3]=T("div",{class:"triangle"},null,-1)),T("div",hF,[(w(!0),R(We,null,mt(l.presetColors,(u,d)=>(w(),R("span",{key:d,class:"swatch",style:Pt({background:u,boxShadow:`0 0 4px ${i(u)?u:"transparent"}`}),onClick:f=>s(u),role:"option","aria-label":"color:"+u,title:u,"aria-selected":i(u),onKeydown:or(f=>s(u),["space"]),tabindex:"0"},null,44,pF))),128)),c[0]||(c[0]=T("div",{class:"hash","aria-hidden":"true"},"#",-1)),H(_A,{value:r.value,onChange:a},null,8,["value"]),c[1]||(c[1]=T("div",{class:"clear"},null,-1))])],6))}}),vF=bu(gF,[["__scopeId","data-v-e74ac697"]]),bF=le({__name:"HueSlider",props:{modelValue:{},value:{}},emits:["input","update:modelValue"],setup(t,{emit:e}){V3(a=>({"46ac36b6":s.value}));const n=e,o=t,r=A(()=>o.modelValue??o.value??0),i=a=>{n("input",a),n("update:modelValue",a)},s=A(()=>`hsl(${r.value}, 100%, 50%)`);return(a,l)=>(w(),Z(wA,Ct({class:"vc-hue-wrap"},a.$attrs,{modelValue:r.value,"onUpdate:modelValue":i}),null,16,["modelValue"]))}}),yF=bu(bF,[["__scopeId","data-v-b3ac1ab2"]]),kA=le({__name:"FormControlColorInputPopover",props:st({target:{},manual:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{},open:{type:Boolean,default:!1},openModifiers:{}}),emits:["update:modelValue","update:open"],setup(t){const e=ft(t,"modelValue"),n=t,o=ft(t,"open"),r=ht("contentRef");EN(r,()=>{n.manual&&(o.value=!1)},{detectIframe:!0,ignore:()=>[n.target]});const s=A(()=>et(e.value).toHsv().h);function a(l){const c=et({h:l,s:1,v:1}).toHexString();e.value=c}return(l,c)=>(w(),Z(p(M4),{modelValue:o.value,"onUpdate:modelValue":c[1]||(c[1]=u=>o.value=u),target:t.target,placement:"bottom","teleport-to":"body",strategy:"fixed",click:!t.manual,manual:t.manual,"custom-class":"color-picker-popover"},{default:ee(()=>[T("div",{ref_key:"contentRef",ref:r},[H(p(vF),{modelValue:e.value,"onUpdate:modelValue":c[0]||(c[0]=u=>e.value=u),triangle:"hide",class:"mb-3"},null,8,["modelValue"]),H(p(yF),{"model-value":p(s),class:"color-picker-popover__hue","onUpdate:modelValue":a},null,8,["model-value"])],512)]),_:1},8,["modelValue","target","click","manual"]))}}),xF={class:"form-control-color-input__wrapper"},wF=["id","value"],_F=le({__name:"FormControlColorInput",props:st({label:{},id:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=ft(t,"modelValue"),n=ht("swatchRef");function o(i){const s=i.target.value.trim();/^#[0-9a-fA-F]{6}$/.test(s)&&(e.value=s)}function r(i){const s=i.target.value.trim();/^#[0-9a-fA-F]{6}$/.test(s)?e.value=s:i.target.value=e.value}return(i,s)=>{const a=kA,l=On;return w(),Z(l,{class:"form-control-color-input",label:t.label,"label-for":t.id},{default:ee(()=>[T("div",xF,[T("button",{ref_key:"swatchRef",ref:n,type:"button",class:"form-control-color-input__wrapper__swatch",style:Pt({backgroundColor:e.value})},null,4),T("input",{id:t.id,class:"form-control form-control-color-input__wrapper__field",value:e.value,onInput:o,onChange:r},null,40,wF)]),H(a,{modelValue:e.value,"onUpdate:modelValue":s[0]||(s[0]=c=>e.value=c),target:p(n)},null,8,["modelValue","target"])]),_:1},8,["label","label-for"])}}}),Da=Oe(_F,[["__scopeId","data-v-166af452"]]),kF=["data-d","title"],SF=le({__name:"FormControlDirectionPickerHandle",props:{pos:{},label:{},shape:{},active:{type:Boolean}},emits:["select"],setup(t){const e=t,n=A(()=>`direction-picker-handle--${e.shape}`);return(o,r)=>(w(),R("button",{type:"button",class:Te(["direction-picker-handle",[p(n),{"direction-picker-handle--active":t.active}]]),"data-d":t.pos,title:t.label,onClick:r[0]||(r[0]=gn(i=>o.$emit("select"),["stop","prevent"]))},null,10,kF))}}),AF=Oe(SF,[["__scopeId","data-v-ef260532"]]),CF={class:"direction-picker-field"},$F=le({__name:"FormControlDirectionPickerField",props:{x:{},y:{}},setup(t){const e=t,n=A(()=>`${e.x*100}%`),o=A(()=>`${e.y*100}%`),r=A(()=>{let i,s;return e.x===0?i="-1px":e.x===1?i="calc(100% - var(--rect-w) + 1px)":i=`calc(var(--rect-pad) + ${e.x} * (100% - 2 * var(--rect-pad) - var(--rect-w)))`,e.y===0?s="-1px":e.y===1?s="calc(100% - var(--rect-h) + 1px)":s=`calc(var(--rect-pad) + ${e.y} * (100% - 2 * var(--rect-pad) - var(--rect-h)))`,{left:i,top:s}});return(i,s)=>(w(),R("div",CF,[T("div",{class:"direction-picker-field__crosshair-h",style:Pt({top:p(o)})},null,4),T("div",{class:"direction-picker-field__crosshair-v",style:Pt({left:p(n)})},null,4),T("div",{class:"direction-picker-field__rect",style:Pt(p(r))},null,4)]))}}),TF=Oe($F,[["__scopeId","data-v-2f06dda2"]]),MF=le({__name:"FormControlDirectionPicker",props:st({label:{},size:{default:"sm"}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=ft(t,"modelValue"),n=t,o=[{value:"NW",pos:"nw",label:"Top left",shape:"corner",x:0,y:0},{value:"N",pos:"n",label:"Top",shape:"edge-h",x:.5,y:0},{value:"NE",pos:"ne",label:"Top right",shape:"corner",x:1,y:0},{value:"W",pos:"w",label:"Left",shape:"edge-v",x:0,y:.5},{value:"center",pos:"c",label:"Center",shape:"center",x:.5,y:.5},{value:"E",pos:"e",label:"Right",shape:"edge-v",x:1,y:.5},{value:"SW",pos:"sw",label:"Bottom left",shape:"corner",x:0,y:1},{value:"S",pos:"s",label:"Bottom",shape:"edge-h",x:.5,y:1},{value:"SE",pos:"se",label:"Bottom right",shape:"corner",x:1,y:1}],r=A(()=>o.find(s=>s.value===e.value)??o[4]),i=A(()=>`direction-picker__anchor--${n.size}`);return(s,a)=>{const l=TF,c=AF,u=On;return w(),Z(u,{class:"direction-picker",label:t.label},{default:ee(()=>[T("div",{class:Te(["direction-picker__anchor",p(i)])},[H(l,{x:p(r).x,y:p(r).y},null,8,["x","y"]),(w(),R(We,null,mt(o,d=>H(c,{key:d.value,pos:d.pos,label:d.label,shape:d.shape,active:e.value===d.value,onSelect:f=>e.value=d.value},null,8,["pos","label","shape","active","onSelect"])),64))],2)]),_:1},8,["label"])}}}),SA=Oe(MF,[["__scopeId","data-v-37d271a9"]]),OF=le({__name:"DisplayColorSwatch",props:{color:{},bordered:{type:Boolean},size:{default:"md"}},setup(t){const e=t,n=A(()=>({"display-color-swatch--sm":e.size==="sm","display-color-swatch--bordered":e.bordered}));return(o,r)=>(w(),R("span",{class:Te(["display-color-swatch",p(n)]),style:Pt({backgroundColor:t.color})},null,6))}}),_m=Oe(OF,[["__scopeId","data-v-9e199d96"]]),BF={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function LF(t,e){return w(),R("svg",BF,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M224 128a8 8 0 0 1-8 8h-80v80a8 8 0 0 1-16 0v-80H40a8 8 0 0 1 0-16h80V40a8 8 0 0 1 16 0v80h80a8 8 0 0 1 8 8"},null,-1)])])}const Dy=Me({name:"ph-plus",render:LF}),PF=le({__name:"ButtonAdd",props:{label:{default:"Add"},size:{default:"default"}},emits:["click"],setup(t){return(e,n)=>{const o=Kn;return w(),Z(o,{"icon-left":p(Dy),label:t.label,variant:"outline-secondary",class:Te(["button-add",{"button-add--sm":t.size==="sm"}]),onClick:n[0]||(n[0]=r=>e.$emit("click"))},{default:ee(()=>[Ce(e.$slots,"default",{},void 0,!0)]),_:3},8,["icon-left","label","class"])}}}),Al=Oe(PF,[["__scopeId","data-v-fec65d28"]]),DF={class:"d-flex flex-wrap gap-1"},EF=["onClick"],IF={class:"form-control-colors-input__tag__hex"},NF=["aria-label","onClick"],RF=le({__name:"FormControlColorsInput",props:st({label:{},id:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=ft(t,"modelValue"),n=ht("addBtnRef"),o=Re("#4e79a7"),r=Re(-1),i=ze(null),s=Re(!1);function a(d,f){r.value=d,o.value=e.value[d],i.value=f.currentTarget,s.value=!0}function l(){var d;r.value=-1,o.value="#4e79a7",i.value=((d=n.value)==null?void 0:d.$el)??null,s.value=!0}function c(d){const f=[...e.value];f.splice(d,1),e.value=f}function u(d){if(o.value=d,r.value>=0&&r.value<e.value.length){const f=[...e.value];f[r.value]=d,e.value=f}else e.value=[...e.value,d],s.value=!1}return(d,f)=>{const h=_m,g=kA,v=On;return w(),Z(v,{class:"form-control-colors-input",label:t.label,"label-for":t.id},{default:ee(()=>[T("div",DF,[(w(!0),R(We,null,mt(e.value,(m,b)=>(w(),R("span",{key:b,class:"form-control-colors-input__tag"},[T("button",{type:"button",class:"form-control-colors-input__tag__swatch-btn",onClick:y=>a(b,y)},[H(h,{color:m,size:"sm"},null,8,["color"])],8,EF),T("span",IF,be(m),1),T("button",{type:"button",class:"form-control-colors-input__tag__remove","aria-label":`Remove ${m}`,onClick:y=>c(b)}," × ",8,NF)]))),128)),H(Al,{id:t.id,ref_key:"addBtnRef",ref:n,size:"sm",onClick:l},null,8,["id"])]),H(g,{open:p(s),"onUpdate:open":f[0]||(f[0]=m=>Xe(s)?s.value=m:null),"model-value":p(o),target:p(i),manual:"","onUpdate:modelValue":u},null,8,["open","model-value","target"])]),_:1},8,["label","label-for"])}}}),FF=Oe(RF,[["__scopeId","data-v-b39aae3e"]]),VF={class:"form-control-dropdown-item__content"},zF={class:"form-control-dropdown-item__content__text"},HF={key:1,class:"form-control-dropdown-item__content__visual"},WF=["src"],UF=le({__name:"FormControlDropdownItem",props:{label:{},description:{},visual:{},icon:{},active:{type:Boolean},lightLabel:{type:Boolean}},emits:["select"],setup(t){const e=t,n=A(()=>({"form-control-dropdown-item__content__text__label--bold":!e.lightLabel&&e.label&&e.description})),o=A(()=>({"text-white-50":e.active,"text-secondary":!e.active}));return(r,i)=>{const s=D4;return w(),Z(s,{class:"form-control-dropdown-item",active:t.active,"button-class":"form-control-dropdown-item__button",onClick:i[0]||(i[0]=a=>r.$emit("select"))},{default:ee(()=>[T("div",VF,[t.icon?(w(),Z(Gt(t.icon),{key:0,class:"form-control-dropdown-item__content__icon"})):ie("",!0),T("div",zF,[T("span",{class:Te(["form-control-dropdown-item__content__text__label",p(n)])},be(t.label),3),t.description?(w(),R("small",{key:0,class:Te(["form-control-dropdown-item__content__text__description",p(o)])},be(t.description),3)):ie("",!0)]),t.visual?(w(),R("div",HF,[typeof t.visual!="string"?(w(),Z(Gt(t.visual),{key:0,class:"form-control-dropdown-item__content__visual__image bg-body rounded-1"})):(w(),R("img",{key:1,src:t.visual,alt:"",class:"form-control-dropdown-item__content__visual__image"},null,8,WF))])):ie("",!0)])]),_:1},8,["active"])}}}),GF=Oe(UF,[["__scopeId","data-v-b5a1db22"]]),qF={key:0,class:"form-control-dropdown__toggle__content"},YF=le({__name:"FormControlDropdown",props:st({label:{default:void 0},id:{default:void 0},options:{default:()=>[]},block:{type:Boolean,default:!1},lightLabel:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},placeholder:{default:void 0},size:{default:"md"},autoClose:{type:[Boolean,String],default:!0},menuClass:{default:void 0},minMenuWidth:{default:0}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=ft(t,"modelValue"),n=t,{entries:o}=Af(pA),r=A(()=>o.value.length>0?o.value:n.options),i=ht("elementRef"),s=VN(i),a=ht("dropdownRef");function l(){var v,m;const{id:h=null}=((m=(v=a.value)==null?void 0:v.$el)==null?void 0:m.querySelector(".dropdown-toggle"))??{};if(!h)return;const g=document.getElementById(`${h}-menu`);g&&(g.style.width=`${Math.max(s.width.value,n.minMenuWidth)}px`)}qe(s.width,l);const c=A(()=>({"form-control-dropdown--light-label":n.lightLabel})),u=A(()=>({"form-control-dropdown__toggle--block":n.block})),d=A(()=>r.value.find(h=>h.value===e.value));function f(h){var g;e.value=h,(g=a.value)==null||g.hide()}return(h,g)=>{const v=GF,m=_y,b=On;return w(),Z(b,{ref_key:"elementRef",ref:i,class:Te(["form-control-dropdown",p(c)]),label:t.label,"label-for":t.id,size:t.size},{default:ee(()=>{var y;return[Ce(h.$slots,"default",{},void 0,!0),H(m,{ref_key:"dropdownRef",ref:a,class:Te(["form-control-dropdown__toggle",p(u)]),size:t.size,"menu-class":t.menuClass??"form-control-dropdown-menu",text:((y=p(d))==null?void 0:y.label)??t.placeholder??"",disabled:t.disabled,"teleport-to":"body",variant:"outline-secondary","auto-close":t.autoClose,onShow:l,onShown:l},{"button-content":ee(()=>[Ce(h.$slots,"button-content",{},()=>{var x,_;return[(x=p(d))!=null&&x.icon?(w(),R("span",qF,[(w(),Z(Gt(p(d).icon),{class:"form-control-dropdown__toggle__icon"})),Ye(" "+be(p(d).label),1)])):(w(),R(We,{key:1},[Ye(be(((_=p(d))==null?void 0:_.label)??t.placeholder??""),1)],64))]},!0)]),default:ee(()=>[Ce(h.$slots,"menu",{hide:()=>{var x;return(x=p(a))==null?void 0:x.hide()}},()=>[(w(!0),R(We,null,mt(p(r),x=>(w(),Z(v,{key:x.value,label:x.label,description:x.description,visual:x.visual,icon:x.icon,active:x.value===e.value,"light-label":t.lightLabel,onSelect:_=>f(x.value)},null,8,["label","description","visual","icon","active","light-label","onSelect"]))),128))],!0)]),_:3},8,["size","menu-class","class","text","disabled","auto-close"])]}),_:3},8,["class","label","label-for","size"])}}}),Rn=Oe(YF,[["__scopeId","data-v-5b435452"]]),jF={class:"form-control-button-group__container__buttons__visual bg-body rounded-1"},XF=["src"],KF=le({__name:"FormControlButtonGroup",props:st({label:{},options:{default:()=>[]},block:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=ft(t,"modelValue"),n=t,{entries:o}=Af(hA),r=A(()=>o.value.length>0?o.value:n.options),i=ht("containerRef"),s=Re(!1),a=A(()=>({"form-control-button-group__container--block":n.block,"form-control-button-group__container--collapsed":s.value})),l=A(()=>({"form-control-button-group__container__buttons--block":n.block})),c=A(()=>r.value.map(d=>({value:d.value,label:d.text,description:d.description,icon:d.icon,visual:d.visual})));function u(){const d=i.value;if(!d)return;const f=d.querySelectorAll(".btn"),h=Array.from(f).some(g=>g.scrollWidth>g.clientWidth+1);s.value=h||d.scrollWidth>d.clientWidth+1}return ss(i,u),(d,f)=>{const h=Rn,g=Kn,v=PD,m=On;return w(),Z(m,{class:"form-control-button-group",label:t.label},{default:ee(()=>[p(s)?(w(),Z(h,{key:0,modelValue:e.value,"onUpdate:modelValue":f[0]||(f[0]=b=>e.value=b),options:p(c),block:"","light-label":"",class:"form-control-button-group__dropdown"},null,8,["modelValue","options"])):ie("",!0),T("div",{ref_key:"containerRef",ref:i,class:Te(["form-control-button-group__container",p(a)])},[H(v,{class:Te(["form-control-button-group__container__buttons",p(l)])},{default:ee(()=>[(w(!0),R(We,null,mt(p(r),b=>(w(),Z(g,{key:b.value,"icon-left":b.icon??b.iconLeft,label:b.text,"hide-label":!b.icon&&!!b.iconLeft,"hide-tooltip":!b.description,"tooltip-label":b.description,"show-tooltip-force":!!b.description,variant:e.value===b.value?"primary":"outline-primary",tabindex:p(s)?-1:void 0,onClick:y=>e.value=b.value},wi({_:2},[b.visual?{name:"start",fn:ee(()=>[T("div",jF,[typeof b.visual!="string"?(w(),Z(Gt(b.visual),{key:0,class:"form-control-button-group__container__buttons__visual__content"})):(w(),R("img",{key:1,src:b.visual,alt:"",class:"form-control-button-group__container__buttons__visual__content"},null,8,XF))])]),key:"0"}:void 0]),1032,["icon-left","label","hide-label","hide-tooltip","tooltip-label","show-tooltip-force","variant","tabindex","onClick"]))),128))]),_:1},8,["class"])],2),Ce(d.$slots,"default",{},void 0,!0),Ce(d.$slots,`section:${e.value}`,{},void 0,!0)]),_:3},8,["label"])}}}),$n=Oe(KF,[["__scopeId","data-v-dfd21712"]]),ih=le({__name:"FormControlButtonGroupEntry",props:{value:{},text:{},iconLeft:{},description:{},visual:{},icon:{}},setup(t){const e=t,n=cs(),o=n["icon-left"]?Me(le({render:()=>n["icon-left"]()})):void 0;return fA(hA,()=>({value:e.value,text:e.text,iconLeft:e.iconLeft??o,description:e.description,visual:e.visual,icon:e.icon})),(r,i)=>Ce(r.$slots,"default")}}),ZF={class:"form-control-slider-input__row"},QF={key:0,class:"form-control-slider-input__row__suffix"},JF=le({__name:"FormControlSliderInput",props:st({label:{},id:{},min:{default:"0"},max:{default:"100"},step:{default:"1"},suffix:{default:void 0}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=ft(t,"modelValue");return(n,o)=>{const r=ta,i=On;return w(),Z(i,{class:"form-control-slider-input",label:t.label,"label-for":t.id},{default:ee(()=>[T("div",ZF,[H(r,{id:t.id,type:"range","model-value":e.value,min:t.min,max:t.max,step:t.step,class:"form-control-slider-input__row__range","onUpdate:modelValue":o[0]||(o[0]=s=>e.value=String(s))},null,8,["id","model-value","min","max","step"]),H(r,{"model-value":e.value,class:"form-control-slider-input__row__number",size:"sm","onUpdate:modelValue":o[1]||(o[1]=s=>e.value=String(s))},null,8,["model-value"]),Ce(n.$slots,"suffix",{},()=>[t.suffix?(w(),R("small",QF,be(t.suffix),1)):ie("",!0)],!0)])]),_:3},8,["label","label-for"])}}}),xr=Oe(JF,[["__scopeId","data-v-23b8b888"]]),eV={class:"form-control-units-input__row"},tV={class:"form-control-units-input__row__group"},nV=le({__name:"FormControlUnitsInput",props:st({label:{},id:{},units:{},min:{default:"0"},max:{default:"100"},step:{default:"1"},noSlider:{type:Boolean,default:!1},centerRelative:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=ft(t,"modelValue"),n=t;function o(c){const u=c.match(/^(-?\d*\.?\d+)\s*(%|[a-z]+)?$/i);return u?{num:u[1],unit:u[2]||n.units[0]}:{num:"0",unit:n.units[0]}}const r=A(()=>o(e.value).num),i=A(()=>o(e.value).unit),s=A(()=>i.value==="%"?"100":n.max);function a(c){e.value=`${String(c??"")}${i.value}`}function l(c){const u=i.value,d=parseFloat(r.value),f=parseFloat(n.max);let h=d;u!==c&&f>0&&(n.centerRelative?u==="px"&&c==="%"?h=+((d/f-.5)*100).toFixed(1):u==="%"&&c==="px"&&(h=Math.round((d/100+.5)*f)):u==="px"&&c==="%"?h=Math.round(d/f*100):u==="%"&&c==="px"&&(h=Math.round(d/100*f))),e.value=`${h}${c}`}return(c,u)=>{const d=ta,f=ND,h=_y,g=On;return w(),Z(g,{class:"form-control-units-input",label:t.label,"label-for":t.id},{default:ee(()=>[T("div",eV,[t.noSlider?ie("",!0):(w(),Z(d,{key:0,id:t.id,type:"range","model-value":p(r),min:t.min,max:p(s),step:t.step,class:"form-control-units-input__row__range","onUpdate:modelValue":a},null,8,["id","model-value","min","max","step"])),T("div",tV,[H(d,{"model-value":p(r),class:"form-control-units-input__row__group__number",size:"sm","onUpdate:modelValue":a},null,8,["model-value"]),H(h,{class:"form-control-units-input__row__group__dropdown",text:p(i),size:"sm",variant:"outline-secondary",end:""},{default:ee(()=>[(w(!0),R(We,null,mt(t.units,v=>(w(),Z(f,{key:v,active:v===p(i),onClick:m=>l(v)},{default:ee(()=>[Ye(be(v),1)]),_:2},1032,["active","onClick"]))),128))]),_:1},8,["text"])])])]),_:1},8,["label","label-for"])}}}),Xh=Oe(nV,[["__scopeId","data-v-21f940c0"]]),fc=le({__name:"FormControlDropdownEntry",props:{value:{},label:{},description:{},visual:{},icon:{}},setup(t){const e=t,n=cs(),o=n.icon?Me(le({render:()=>n.icon()})):void 0;return fA(pA,()=>({value:e.value,label:e.label,description:e.description,visual:e.visual,icon:e.icon??o})),(r,i)=>Ce(r.$slots,"default")}}),oV={class:"form-control-text-input__row"},rV={key:0,class:"form-control-text-input__row__suffix"},iV=le({__name:"FormControlTextInput",props:st({label:{},id:{},placeholder:{default:void 0},suffix:{default:void 0}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=ft(t,"modelValue");return(n,o)=>{const r=ta,i=On;return w(),Z(i,{class:"form-control-text-input",label:t.label,"label-for":t.id},{default:ee(()=>[T("div",oV,[H(r,{id:t.id,"model-value":e.value,placeholder:t.placeholder,class:"form-control-text-input__row__input","onUpdate:modelValue":o[0]||(o[0]=s=>e.value=String(s))},null,8,["id","model-value","placeholder"]),t.suffix?(w(),R("small",rV,be(t.suffix),1)):ie("",!0)])]),_:1},8,["label","label-for"])}}}),km=Oe(iV,[["__scopeId","data-v-f856cd26"]]),sV={class:"display-palette"},aV=le({__name:"DisplayPalette",props:{colors:{},bordered:{type:Boolean}},setup(t){return(e,n)=>{const o=_m;return w(),R("span",sV,[(w(!0),R(We,null,mt(t.colors,(r,i)=>(w(),Z(o,{key:i,color:r,bordered:t.bordered,size:"sm"},null,8,["color","bordered"]))),128))])}}}),lV=Oe(aV,[["__scopeId","data-v-329d58de"]]),cV={class:"form-control-palette__preview pe-1"},uV={class:"form-control-palette__preview__name flex-grow-1"},dV={class:"form-control-palette__item"},fV={class:"flex-grow-1"},hV=le({__name:"FormControlPalette",props:st({label:{default:void 0},id:{default:void 0},palettes:{default:()=>[]}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=ft(t,"modelValue"),n=t,{entries:o}=Af(ZN),r=A(()=>o.value.length>0?o.value:n.palettes),i=ht("dropdownRef");function s(){var f;const c=(f=i.value)==null?void 0:f.$el;if(!c)return;const u=c.querySelector(".dropdown-toggle");if(!(u!=null&&u.id))return;const d=document.getElementById(`${u.id}-menu`);d&&(d.style.width=`${u.offsetWidth}px`)}const a=A(()=>r.value.find(c=>c.value===e.value));function l(c){var u;e.value=c,(u=i.value)==null||u.hide()}return(c,u)=>{const d=lV,f=D4,h=_y,g=On;return w(),Z(g,{class:"form-control-palette",label:t.label,"label-for":t.id},{default:ee(()=>[Ce(c.$slots,"default",{},void 0,!0),H(h,{ref_key:"dropdownRef",ref:i,class:"form-control-palette__toggle","toggle-class":"d-flex align-items-center","menu-class":["form-control-dropdown-menu"],variant:"outline-secondary","teleport-to":"body",onShown:s},{"button-content":ee(()=>{var v;return[T("span",cV,[T("span",uV,be(((v=p(a))==null?void 0:v.label)??""),1),p(a)?(w(),Z(d,{key:0,colors:p(a).colors,bordered:""},null,8,["colors"])):ie("",!0)])]}),default:ee(()=>[(w(!0),R(We,null,mt(p(r),v=>(w(),Z(f,{key:v.value,active:e.value===v.value,onClick:m=>l(v.value)},{default:ee(()=>[T("span",dV,[T("span",fV,be(v.label),1),H(d,{colors:v.colors,bordered:""},null,8,["colors"])])]),_:2},1032,["active","onClick"]))),128))]),_:1},512)]),_:3},8,["label","label-for"])}}}),pV=Oe(hV,[["__scopeId","data-v-98c9538c"]]);function mV(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Ep(t,e){if(!isFinite(t)||t===0)return null;var n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"),o=t.slice(0,n);return[o.length>1?o[0]+o.slice(2):o,+t.slice(n+1)]}function eu(t){return t=Ep(Math.abs(t)),t?t[1]:NaN}function gV(t,e){return function(n,o){for(var r=n.length,i=[],s=0,a=t[0],l=0;r>0&&a>0&&(l+a+1>o&&(a=Math.max(1,o-l)),i.push(n.substring(r-=a,r+a)),!((l+=a+1)>o));)a=t[s=(s+1)%t.length];return i.reverse().join(e)}}function vV(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var bV=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ip(t){if(!(e=bV.exec(t)))throw new Error("invalid format: "+t);var e;return new Ey({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}Ip.prototype=Ey.prototype;function Ey(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}Ey.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 yV(t){e:for(var e=t.length,n=1,o=-1,r;n<e;++n)switch(t[n]){case".":o=r=n;break;case"0":o===0&&(o=n),r=n;break;default:if(!+t[n])break e;o>0&&(o=0);break}return o>0?t.slice(0,o)+t.slice(r+1):t}var Np;function xV(t,e){var n=Ep(t,e);if(!n)return Np=void 0,t.toPrecision(e);var o=n[0],r=n[1],i=r-(Np=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,s=o.length;return i===s?o:i>s?o+new Array(i-s+1).join("0"):i>0?o.slice(0,i)+"."+o.slice(i):"0."+new Array(1-i).join("0")+Ep(t,Math.max(0,e+i-1))[0]}function V_(t,e){var n=Ep(t,e);if(!n)return t+"";var o=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+o:o.length>r+1?o.slice(0,r+1)+"."+o.slice(r+1):o+new Array(r-o.length+2).join("0")}const z_={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:mV,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>V_(t*100,e),r:V_,s:xV,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function H_(t){return t}var W_=Array.prototype.map,U_=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function wV(t){var e=t.grouping===void 0||t.thousands===void 0?H_:gV(W_.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",o=t.currency===void 0?"":t.currency[1]+"",r=t.decimal===void 0?".":t.decimal+"",i=t.numerals===void 0?H_:vV(W_.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",a=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function c(d,f){d=Ip(d);var h=d.fill,g=d.align,v=d.sign,m=d.symbol,b=d.zero,y=d.width,x=d.comma,_=d.precision,k=d.trim,E=d.type;E==="n"?(x=!0,E="g"):z_[E]||(_===void 0&&(_=12),k=!0,E="g"),(b||h==="0"&&g==="=")&&(b=!0,h="0",g="=");var L=(f&&f.prefix!==void 0?f.prefix:"")+(m==="$"?n:m==="#"&&/[boxX]/.test(E)?"0"+E.toLowerCase():""),S=(m==="$"?o:/[%p]/.test(E)?s:"")+(f&&f.suffix!==void 0?f.suffix:""),B=z_[E],D=/[defgprs%]/.test(E);_=_===void 0?6:/[gprs]/.test(E)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function N(C){var M=L,P=S,$,F,V;if(E==="c")P=B(C)+P,C="";else{C=+C;var U=C<0||1/C<0;if(C=isNaN(C)?l:B(Math.abs(C),_),k&&(C=yV(C)),U&&+C==0&&v!=="+"&&(U=!1),M=(U?v==="("?v:a:v==="-"||v==="("?"":v)+M,P=(E==="s"&&!isNaN(C)&&Np!==void 0?U_[8+Np/3]:"")+P+(U&&v==="("?")":""),D){for($=-1,F=C.length;++$<F;)if(V=C.charCodeAt($),48>V||V>57){P=(V===46?r+C.slice($+1):C.slice($))+P,C=C.slice(0,$);break}}}x&&!b&&(C=e(C,1/0));var K=M.length+C.length+P.length,ae=K<y?new Array(y-K+1).join(h):"";switch(x&&b&&(C=e(ae+C,ae.length?y-P.length:1/0),ae=""),g){case"<":C=M+C+P+ae;break;case"=":C=M+ae+C+P;break;case"^":C=ae.slice(0,K=ae.length>>1)+M+C+P+ae.slice(K);break;default:C=ae+M+C+P;break}return i(C)}return N.toString=function(){return d+""},N}function u(d,f){var h=Math.max(-8,Math.min(8,Math.floor(eu(f)/3)))*3,g=Math.pow(10,-h),v=c((d=Ip(d),d.type="f",d),{suffix:U_[8+h/3]});return function(m){return v(g*m)}}return{format:c,formatPrefix:u}}var sh,yu,AA;_V({thousands:",",grouping:[3],currency:["$",""]});function _V(t){return sh=wV(t),yu=sh.format,AA=sh.formatPrefix,sh}function kV(t){return Math.max(0,-eu(Math.abs(t)))}function SV(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(eu(e)/3)))*3-eu(Math.abs(t)))}function AV(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,eu(e)-eu(t))+1}const CA={prefix:"",suffix:"",decimals:"2",scale:"none",negStyle:"minus",thousandsSep:!0};function Iy(t){let e="";return t.negStyle==="paren"&&(e+="("),t.thousandsSep&&(e+=","),t.decimals==="auto"?e+="~":e+=`.${t.decimals}`,e+=t.scale==="%"?"%":"f",e}function ev(t){const e=Iy(t);return t.prefix||t.suffix?`${t.prefix}|${e}|${t.suffix}`:e}function CV(t){const e={...CA};if(!t)return e;let n=t;if(t.includes("|")){const o=t.split("|");e.prefix=o[0]??"",n=o[1]??"",e.suffix=o[2]??""}else e.prefix="",e.suffix="";if(n.startsWith("(")&&(e.negStyle="paren",n=n.slice(1),n.endsWith(")")&&(n=n.slice(0,-1))),e.thousandsSep=n.includes(","),n=n.replace(",",""),n.includes("~"))e.decimals="auto";else{const o=n.match(/\.(\d+)/);o&&(e.decimals=o[1])}return n.endsWith("%")?e.scale="%":e.scale="none",e}function $V(t,e){try{const n=Iy(e),o=yu(n)(Math.abs(t)),r=`${e.prefix}${o}${e.suffix}`;return t<0?e.negStyle==="paren"?`(${r})`:`−${r}`:r}catch{return String(t)}}const TV={class:"form-control-number-format__popover"},MV={class:"form-control-number-format__popover__preview"},OV={class:"form-control-number-format__popover__preview__cell__label"},BV={class:"form-control-number-format__popover__body"},LV={class:"form-control-number-format__popover__body__chips"},PV=["onClick"],DV={class:"form-control-number-format__popover__body__grid-2"},EV={class:"form-control-number-format__popover__body__btn-group"},IV=["onClick"],NV={class:"form-control-number-format__popover__body__btn-group"},RV=["onClick"],FV={class:"form-control-number-format__popover__body__check-row"},VV={class:"form-control-number-format__popover__body__d3-row"},zV={class:"form-control-number-format__popover__body__d3-row__value"},HV=le({__name:"FormControlNumberFormat",props:st({label:{default:void 0},id:{default:void 0},block:{type:Boolean,default:!0}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=ft(t,"modelValue"),n=["0","1","2","3","auto"],o=[{id:"minus",label:"−1,234"},{id:"paren",label:"(1,234)"}],r=[{value:-1234.5,label:"neg",cls:"form-control-number-format__popover__preview__cell__value--neg"},{value:0,label:"zero",cls:"form-control-number-format__popover__preview__cell__value--zero"},{value:9876543,label:"pos",cls:""}],i=[{label:"1,234",config:{prefix:"",suffix:"",decimals:"0",scale:"none",negStyle:"minus",thousandsSep:!0}},{label:"1,234.56",config:{prefix:"",suffix:"",decimals:"2",scale:"none",negStyle:"minus",thousandsSep:!0}},{label:"1234",config:{prefix:"",suffix:"",decimals:"0",scale:"none",negStyle:"minus",thousandsSep:!1}},{label:"12%",config:{prefix:"",suffix:"%",decimals:"0",scale:"none",negStyle:"minus",thousandsSep:!1}},{label:"$1,234",config:{prefix:"$",suffix:"",decimals:"0",scale:"none",negStyle:"minus",thousandsSep:!0}},{label:"(1,234)",config:{prefix:"",suffix:"",decimals:"0",scale:"none",negStyle:"paren",thousandsSep:!0}}],s=lr({...CA}),a=Re(null);qe(()=>e.value,m=>{m!==ev(s)&&Object.assign(s,CV(m??""))},{immediate:!0});const l=A(()=>Iy(s)),c=A(()=>e.value||"auto");function u(){a.value=null,e.value=ev(s)}function d(m){s.decimals=m,u()}function f(m){s.negStyle=m,u()}function h(m){Object.assign(s,{...m.config}),a.value=m.label,e.value=ev(s)}function g(m){return $V(m,s)}const v=A(()=>r.map(m=>({...m,formatted:g(m.value)})));return(m,b)=>{const y=Rn;return w(),Z(y,{id:t.id,modelValue:e.value,"onUpdate:modelValue":b[4]||(b[4]=x=>e.value=x),label:t.label,block:t.block,placeholder:"auto","auto-close":"outside","menu-class":"form-control-number-format-menu","min-menu-width":260},{"button-content":ee(()=>[T("span",{class:Te(["form-control-number-format__trigger-text",{"text-secondary":!e.value}])},be(p(c)),3)]),menu:ee(()=>[T("div",TV,[T("div",MV,[(w(!0),R(We,null,mt(p(v),(x,_)=>(w(),R("div",{key:_,class:"form-control-number-format__popover__preview__cell"},[T("div",OV,be(x.label),1),T("div",{class:Te(["form-control-number-format__popover__preview__cell__value",x.cls])},be(x.formatted),3)]))),128))]),T("div",BV,[T("div",null,[b[5]||(b[5]=T("div",{class:"form-control-number-format__popover__body__section-label"}," Presets ",-1)),T("div",LV,[(w(),R(We,null,mt(i,x=>T("button",{key:x.label,class:Te(["form-control-number-format__popover__body__chips__chip",{"form-control-number-format__popover__body__chips__chip--active":p(a)===x.label}]),onClick:_=>h(x)},be(x.label),11,PV)),64))])]),b[12]||(b[12]=T("hr",{class:"form-control-number-format__popover__body__sep"},null,-1)),T("div",DV,[T("div",null,[b[6]||(b[6]=T("div",{class:"form-control-number-format__popover__body__grid-2__field-label"}," Prefix ",-1)),ar(T("input",{"onUpdate:modelValue":b[0]||(b[0]=x=>p(s).prefix=x),class:"form-control-number-format__popover__body__grid-2__input",placeholder:"e.g. $",onInput:u},null,544),[[Sp,p(s).prefix]])]),T("div",null,[b[7]||(b[7]=T("div",{class:"form-control-number-format__popover__body__grid-2__field-label"}," Suffix ",-1)),ar(T("input",{"onUpdate:modelValue":b[1]||(b[1]=x=>p(s).suffix=x),class:"form-control-number-format__popover__body__grid-2__input",placeholder:"e.g. %",onInput:u},null,544),[[Sp,p(s).suffix]])])]),T("div",null,[b[8]||(b[8]=T("div",{class:"form-control-number-format__popover__body__section-label"}," Decimal places ",-1)),T("div",EV,[(w(),R(We,null,mt(n,x=>T("button",{key:x,class:Te(["form-control-number-format__popover__body__btn-group__btn",{"form-control-number-format__popover__body__btn-group__btn--active":p(s).decimals===x}]),onClick:_=>d(x)},be(x),11,IV)),64))])]),T("div",null,[b[9]||(b[9]=T("div",{class:"form-control-number-format__popover__body__section-label"}," Negatives ",-1)),T("div",NV,[(w(),R(We,null,mt(o,x=>T("button",{key:x.id,class:Te(["form-control-number-format__popover__body__btn-group__btn",{"form-control-number-format__popover__body__btn-group__btn--active":p(s).negStyle===x.id}]),onClick:_=>f(x.id)},be(x.label),11,RV)),64))])]),T("label",FV,[ar(T("input",{"onUpdate:modelValue":b[2]||(b[2]=x=>p(s).thousandsSep=x),type:"checkbox",class:"form-control-number-format__popover__body__check-row__checkbox",onChange:b[3]||(b[3]=x=>u())},null,544),[[z3,p(s).thousandsSep]]),b[10]||(b[10]=T("span",null,"Thousands separator",-1))]),b[13]||(b[13]=T("hr",{class:"form-control-number-format__popover__body__sep"},null,-1)),T("div",VV,[b[11]||(b[11]=T("span",{class:"form-control-number-format__popover__body__d3-row__label"},"d3·fmt",-1)),T("span",zV,be(p(l)),1)])])])]),_:1},8,["id","modelValue","label","block"])}}}),WV=Oe(HV,[["__scopeId","data-v-959c1f3d"]]),tv=new Date,nv=new Date;function ds(t,e,n,o){function r(i){return t(i=arguments.length===0?new Date:new Date(+i)),i}return r.floor=i=>(t(i=new Date(+i)),i),r.ceil=i=>(t(i=new Date(i-1)),e(i,1),t(i),i),r.round=i=>{const s=r(i),a=r.ceil(i);return i-s<a-i?s:a},r.offset=(i,s)=>(e(i=new Date(+i),s==null?1:Math.floor(s)),i),r.range=(i,s,a)=>{const l=[];if(i=r.ceil(i),a=a==null?1:Math.floor(a),!(i<s)||!(a>0))return l;let c;do l.push(c=new Date(+i)),e(i,a),t(i);while(c<i&&i<s);return l},r.filter=i=>ds(s=>{if(s>=s)for(;t(s),!i(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;e(s,-1),!i(s););else for(;--a>=0;)for(;e(s,1),!i(s););}),n&&(r.count=(i,s)=>(tv.setTime(+i),nv.setTime(+s),t(tv),t(nv),Math.floor(n(tv,nv))),r.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?r.filter(o?s=>o(s)%i===0:s=>r.count(0,s)%i===0):r)),r}const UV=1e3,Ny=UV*60,GV=Ny*60,Xd=GV*24,$A=Xd*7,Ry=ds(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Ny)/Xd,t=>t.getDate()-1);Ry.range;const Fy=ds(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Xd,t=>t.getUTCDate()-1);Fy.range;const qV=ds(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Xd,t=>Math.floor(t/Xd));qV.range;function Zl(t){return ds(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*Ny)/$A)}const TA=Zl(0),Rp=Zl(1),YV=Zl(2),jV=Zl(3),tu=Zl(4),XV=Zl(5),KV=Zl(6);TA.range;Rp.range;YV.range;jV.range;tu.range;XV.range;KV.range;function Ql(t){return ds(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/$A)}const MA=Ql(0),Fp=Ql(1),ZV=Ql(2),QV=Ql(3),nu=Ql(4),JV=Ql(5),ez=Ql(6);MA.range;Fp.range;ZV.range;QV.range;nu.range;JV.range;ez.range;const El=ds(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());El.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ds(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});El.range;const Il=ds(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());Il.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ds(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});Il.range;function Kh(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function tz(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function OA(t){let e,n,o;t.length!==2?(e=Kh,n=(a,l)=>Kh(t(a),l),o=(a,l)=>t(a)-l):(e=t===Kh||t===tz?t:nz,n=t,o=t);function r(a,l,c=0,u=a.length){if(c<u){if(e(l,l)!==0)return u;do{const d=c+u>>>1;n(a[d],l)<0?c=d+1:u=d}while(c<u)}return c}function i(a,l,c=0,u=a.length){if(c<u){if(e(l,l)!==0)return u;do{const d=c+u>>>1;n(a[d],l)<=0?c=d+1:u=d}while(c<u)}return c}function s(a,l,c=0,u=a.length){const d=r(a,l,c,u-1);return d>c&&o(a[d-1],l)>-o(a[d],l)?d-1:d}return{left:r,center:s,right:i}}function nz(){return 0}function oz(t){return t===null?NaN:+t}const rz=OA(Kh),iz=rz.right,sz=OA(oz).center;class G_ extends Map{constructor(e,n=cz){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[o,r]of e)this.set(o,r)}get(e){return super.get(q_(this,e))}has(e){return super.has(q_(this,e))}set(e,n){return super.set(az(this,e),n)}delete(e){return super.delete(lz(this,e))}}function q_({_intern:t,_key:e},n){const o=e(n);return t.has(o)?t.get(o):n}function az({_intern:t,_key:e},n){const o=e(n);return t.has(o)?t.get(o):(t.set(o,n),n)}function lz({_intern:t,_key:e},n){const o=e(n);return t.has(o)&&(n=t.get(o),t.delete(o)),n}function cz(t){return t!==null&&typeof t=="object"?t.valueOf():t}const uz=Math.sqrt(50),dz=Math.sqrt(10),fz=Math.sqrt(2);function Vp(t,e,n){const o=(e-t)/Math.max(0,n),r=Math.floor(Math.log10(o)),i=o/Math.pow(10,r),s=i>=uz?10:i>=dz?5:i>=fz?2:1;let a,l,c;return r<0?(c=Math.pow(10,-r)/s,a=Math.round(t*c),l=Math.round(e*c),a/c<t&&++a,l/c>e&&--l,c=-c):(c=Math.pow(10,r)*s,a=Math.round(t/c),l=Math.round(e/c),a*c<t&&++a,l*c>e&&--l),l<a&&.5<=n&&n<2?Vp(t,e,n*2):[a,l,c]}function hz(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const o=e<t,[r,i,s]=o?Vp(e,t,n):Vp(t,e,n);if(!(i>=r))return[];const a=i-r+1,l=new Array(a);if(o)if(s<0)for(let c=0;c<a;++c)l[c]=(i-c)/-s;else for(let c=0;c<a;++c)l[c]=(i-c)*s;else if(s<0)for(let c=0;c<a;++c)l[c]=(r+c)/-s;else for(let c=0;c<a;++c)l[c]=(r+c)*s;return l}function $1(t,e,n){return e=+e,t=+t,n=+n,Vp(t,e,n)[2]}function pz(t,e,n){e=+e,t=+t,n=+n;const o=e<t,r=o?$1(e,t,n):$1(t,e,n);return(o?-1:1)*(r<0?1/-r:r)}function Kd(t,e){let n;if(e===void 0)for(const o of t)o!=null&&(n<o||n===void 0&&o>=o)&&(n=o);else{let o=-1;for(let r of t)(r=e(r,++o,t))!=null&&(n<r||n===void 0&&r>=r)&&(n=r)}return n}function mz(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var o=-1,r=Math.max(0,Math.ceil((e-t)/n))|0,i=new Array(r);++o<r;)i[o]=t+o*n;return i}function ov(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function rv(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function qu(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function gz(t){var e=t.dateTime,n=t.date,o=t.time,r=t.periods,i=t.days,s=t.shortDays,a=t.months,l=t.shortMonths,c=Yu(r),u=ju(r),d=Yu(i),f=ju(i),h=Yu(s),g=ju(s),v=Yu(a),m=ju(a),b=Yu(l),y=ju(l),x={a:V,A:U,b:K,B:ae,c:null,d:Q_,e:Q_,f:Fz,g:Xz,G:Zz,H:Iz,I:Nz,j:Rz,L:BA,m:Vz,M:zz,p:me,q:de,Q:t8,s:n8,S:Hz,u:Wz,U:Uz,V:Gz,w:qz,W:Yz,x:null,X:null,y:jz,Y:Kz,Z:Qz,"%":e8},_={a:ve,A:te,b:pe,B:we,c:null,d:J_,e:J_,f:nH,g:fH,G:pH,H:Jz,I:eH,j:tH,L:PA,m:oH,M:rH,p:J,q:ge,Q:t8,s:n8,S:iH,u:sH,U:aH,V:lH,w:cH,W:uH,x:null,X:null,y:dH,Y:hH,Z:mH,"%":e8},k={a:D,A:N,b:C,B:M,c:P,d:K_,e:K_,f:Lz,g:X_,G:j_,H:Z_,I:Z_,j:Tz,L:Bz,m:$z,M:Mz,p:B,q:Cz,Q:Dz,s:Ez,S:Oz,u:wz,U:_z,V:kz,w:xz,W:Sz,x:$,X:F,y:X_,Y:j_,Z:Az,"%":Pz};x.x=E(n,x),x.X=E(o,x),x.c=E(e,x),_.x=E(n,_),_.X=E(o,_),_.c=E(e,_);function E(re,oe){return function(he){var I=[],G=-1,Y=0,se=re.length,fe,ne,Q;for(he instanceof Date||(he=new Date(+he));++G<se;)re.charCodeAt(G)===37&&(I.push(re.slice(Y,G)),(ne=Y_[fe=re.charAt(++G)])!=null?fe=re.charAt(++G):ne=fe==="e"?" ":"0",(Q=oe[fe])&&(fe=Q(he,ne)),I.push(fe),Y=G+1);return I.push(re.slice(Y,G)),I.join("")}}function L(re,oe){return function(he){var I=qu(1900,void 0,1),G=S(I,re,he+="",0),Y,se;if(G!=he.length)return null;if("Q"in I)return new Date(I.Q);if("s"in I)return new Date(I.s*1e3+("L"in I?I.L:0));if(oe&&!("Z"in I)&&(I.Z=0),"p"in I&&(I.H=I.H%12+I.p*12),I.m===void 0&&(I.m="q"in I?I.q:0),"V"in I){if(I.V<1||I.V>53)return null;"w"in I||(I.w=1),"Z"in I?(Y=rv(qu(I.y,0,1)),se=Y.getUTCDay(),Y=se>4||se===0?Fp.ceil(Y):Fp(Y),Y=Fy.offset(Y,(I.V-1)*7),I.y=Y.getUTCFullYear(),I.m=Y.getUTCMonth(),I.d=Y.getUTCDate()+(I.w+6)%7):(Y=ov(qu(I.y,0,1)),se=Y.getDay(),Y=se>4||se===0?Rp.ceil(Y):Rp(Y),Y=Ry.offset(Y,(I.V-1)*7),I.y=Y.getFullYear(),I.m=Y.getMonth(),I.d=Y.getDate()+(I.w+6)%7)}else("W"in I||"U"in I)&&("w"in I||(I.w="u"in I?I.u%7:"W"in I?1:0),se="Z"in I?rv(qu(I.y,0,1)).getUTCDay():ov(qu(I.y,0,1)).getDay(),I.m=0,I.d="W"in I?(I.w+6)%7+I.W*7-(se+5)%7:I.w+I.U*7-(se+6)%7);return"Z"in I?(I.H+=I.Z/100|0,I.M+=I.Z%100,rv(I)):ov(I)}}function S(re,oe,he,I){for(var G=0,Y=oe.length,se=he.length,fe,ne;G<Y;){if(I>=se)return-1;if(fe=oe.charCodeAt(G++),fe===37){if(fe=oe.charAt(G++),ne=k[fe in Y_?oe.charAt(G++):fe],!ne||(I=ne(re,he,I))<0)return-1}else if(fe!=he.charCodeAt(I++))return-1}return I}function B(re,oe,he){var I=c.exec(oe.slice(he));return I?(re.p=u.get(I[0].toLowerCase()),he+I[0].length):-1}function D(re,oe,he){var I=h.exec(oe.slice(he));return I?(re.w=g.get(I[0].toLowerCase()),he+I[0].length):-1}function N(re,oe,he){var I=d.exec(oe.slice(he));return I?(re.w=f.get(I[0].toLowerCase()),he+I[0].length):-1}function C(re,oe,he){var I=b.exec(oe.slice(he));return I?(re.m=y.get(I[0].toLowerCase()),he+I[0].length):-1}function M(re,oe,he){var I=v.exec(oe.slice(he));return I?(re.m=m.get(I[0].toLowerCase()),he+I[0].length):-1}function P(re,oe,he){return S(re,e,oe,he)}function $(re,oe,he){return S(re,n,oe,he)}function F(re,oe,he){return S(re,o,oe,he)}function V(re){return s[re.getDay()]}function U(re){return i[re.getDay()]}function K(re){return l[re.getMonth()]}function ae(re){return a[re.getMonth()]}function me(re){return r[+(re.getHours()>=12)]}function de(re){return 1+~~(re.getMonth()/3)}function ve(re){return s[re.getUTCDay()]}function te(re){return i[re.getUTCDay()]}function pe(re){return l[re.getUTCMonth()]}function we(re){return a[re.getUTCMonth()]}function J(re){return r[+(re.getUTCHours()>=12)]}function ge(re){return 1+~~(re.getUTCMonth()/3)}return{format:function(re){var oe=E(re+="",x);return oe.toString=function(){return re},oe},parse:function(re){var oe=L(re+="",!1);return oe.toString=function(){return re},oe},utcFormat:function(re){var oe=E(re+="",_);return oe.toString=function(){return re},oe},utcParse:function(re){var oe=L(re+="",!0);return oe.toString=function(){return re},oe}}}var Y_={"-":"",_:" ",0:"0"},Qn=/^\s*\d+/,vz=/^%/,bz=/[\\^$*+?|[\]().{}]/g;function qt(t,e,n){var o=t<0?"-":"",r=(o?-t:t)+"",i=r.length;return o+(i<n?new Array(n-i+1).join(e)+r:r)}function yz(t){return t.replace(bz,"\\$&")}function Yu(t){return new RegExp("^(?:"+t.map(yz).join("|")+")","i")}function ju(t){return new Map(t.map((e,n)=>[e.toLowerCase(),n]))}function xz(t,e,n){var o=Qn.exec(e.slice(n,n+1));return o?(t.w=+o[0],n+o[0].length):-1}function wz(t,e,n){var o=Qn.exec(e.slice(n,n+1));return o?(t.u=+o[0],n+o[0].length):-1}function _z(t,e,n){var o=Qn.exec(e.slice(n,n+2));return o?(t.U=+o[0],n+o[0].length):-1}function kz(t,e,n){var o=Qn.exec(e.slice(n,n+2));return o?(t.V=+o[0],n+o[0].length):-1}function Sz(t,e,n){var o=Qn.exec(e.slice(n,n+2));return o?(t.W=+o[0],n+o[0].length):-1}function j_(t,e,n){var o=Qn.exec(e.slice(n,n+4));return o?(t.y=+o[0],n+o[0].length):-1}function X_(t,e,n){var o=Qn.exec(e.slice(n,n+2));return o?(t.y=+o[0]+(+o[0]>68?1900:2e3),n+o[0].length):-1}function Az(t,e,n){var o=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return o?(t.Z=o[1]?0:-(o[2]+(o[3]||"00")),n+o[0].length):-1}function Cz(t,e,n){var o=Qn.exec(e.slice(n,n+1));return o?(t.q=o[0]*3-3,n+o[0].length):-1}function $z(t,e,n){var o=Qn.exec(e.slice(n,n+2));return o?(t.m=o[0]-1,n+o[0].length):-1}function K_(t,e,n){var o=Qn.exec(e.slice(n,n+2));return o?(t.d=+o[0],n+o[0].length):-1}function Tz(t,e,n){var o=Qn.exec(e.slice(n,n+3));return o?(t.m=0,t.d=+o[0],n+o[0].length):-1}function Z_(t,e,n){var o=Qn.exec(e.slice(n,n+2));return o?(t.H=+o[0],n+o[0].length):-1}function Mz(t,e,n){var o=Qn.exec(e.slice(n,n+2));return o?(t.M=+o[0],n+o[0].length):-1}function Oz(t,e,n){var o=Qn.exec(e.slice(n,n+2));return o?(t.S=+o[0],n+o[0].length):-1}function Bz(t,e,n){var o=Qn.exec(e.slice(n,n+3));return o?(t.L=+o[0],n+o[0].length):-1}function Lz(t,e,n){var o=Qn.exec(e.slice(n,n+6));return o?(t.L=Math.floor(o[0]/1e3),n+o[0].length):-1}function Pz(t,e,n){var o=vz.exec(e.slice(n,n+1));return o?n+o[0].length:-1}function Dz(t,e,n){var o=Qn.exec(e.slice(n));return o?(t.Q=+o[0],n+o[0].length):-1}function Ez(t,e,n){var o=Qn.exec(e.slice(n));return o?(t.s=+o[0],n+o[0].length):-1}function Q_(t,e){return qt(t.getDate(),e,2)}function Iz(t,e){return qt(t.getHours(),e,2)}function Nz(t,e){return qt(t.getHours()%12||12,e,2)}function Rz(t,e){return qt(1+Ry.count(El(t),t),e,3)}function BA(t,e){return qt(t.getMilliseconds(),e,3)}function Fz(t,e){return BA(t,e)+"000"}function Vz(t,e){return qt(t.getMonth()+1,e,2)}function zz(t,e){return qt(t.getMinutes(),e,2)}function Hz(t,e){return qt(t.getSeconds(),e,2)}function Wz(t){var e=t.getDay();return e===0?7:e}function Uz(t,e){return qt(TA.count(El(t)-1,t),e,2)}function LA(t){var e=t.getDay();return e>=4||e===0?tu(t):tu.ceil(t)}function Gz(t,e){return t=LA(t),qt(tu.count(El(t),t)+(El(t).getDay()===4),e,2)}function qz(t){return t.getDay()}function Yz(t,e){return qt(Rp.count(El(t)-1,t),e,2)}function jz(t,e){return qt(t.getFullYear()%100,e,2)}function Xz(t,e){return t=LA(t),qt(t.getFullYear()%100,e,2)}function Kz(t,e){return qt(t.getFullYear()%1e4,e,4)}function Zz(t,e){var n=t.getDay();return t=n>=4||n===0?tu(t):tu.ceil(t),qt(t.getFullYear()%1e4,e,4)}function Qz(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+qt(e/60|0,"0",2)+qt(e%60,"0",2)}function J_(t,e){return qt(t.getUTCDate(),e,2)}function Jz(t,e){return qt(t.getUTCHours(),e,2)}function eH(t,e){return qt(t.getUTCHours()%12||12,e,2)}function tH(t,e){return qt(1+Fy.count(Il(t),t),e,3)}function PA(t,e){return qt(t.getUTCMilliseconds(),e,3)}function nH(t,e){return PA(t,e)+"000"}function oH(t,e){return qt(t.getUTCMonth()+1,e,2)}function rH(t,e){return qt(t.getUTCMinutes(),e,2)}function iH(t,e){return qt(t.getUTCSeconds(),e,2)}function sH(t){var e=t.getUTCDay();return e===0?7:e}function aH(t,e){return qt(MA.count(Il(t)-1,t),e,2)}function DA(t){var e=t.getUTCDay();return e>=4||e===0?nu(t):nu.ceil(t)}function lH(t,e){return t=DA(t),qt(nu.count(Il(t),t)+(Il(t).getUTCDay()===4),e,2)}function cH(t){return t.getUTCDay()}function uH(t,e){return qt(Fp.count(Il(t)-1,t),e,2)}function dH(t,e){return qt(t.getUTCFullYear()%100,e,2)}function fH(t,e){return t=DA(t),qt(t.getUTCFullYear()%100,e,2)}function hH(t,e){return qt(t.getUTCFullYear()%1e4,e,4)}function pH(t,e){var n=t.getUTCDay();return t=n>=4||n===0?nu(t):nu.ceil(t),qt(t.getUTCFullYear()%1e4,e,4)}function mH(){return"+0000"}function e8(){return"%"}function t8(t){return+t}function n8(t){return Math.floor(+t/1e3)}var hc,Zd;gH({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function gH(t){return hc=gz(t),Zd=hc.format,hc.parse,hc.utcFormat,hc.utcParse,hc}const $f=[{label:"(automatic)",fmt:"(automatic)"},{label:"Year only",fmt:"YYYY",d3:"%Y"},{label:"Short year",fmt:"'YY",d3:"'%y"},{label:"Quarter",fmt:"Q",d3:"%Y Q%q"},{label:"Month abbr.",fmt:"MMM",d3:"%b"},{label:"Month + year",fmt:"MMM 'YY",d3:"%b '%y"},{label:"Full month",fmt:"MMMM",d3:"%B"},{label:"Month + day",fmt:"MMMM D",d3:"%B %-d"},{label:"Full date",fmt:"MMMM D, YYYY",d3:"%B %-d, %Y"},{label:"MM/DD/YYYY",fmt:"MM/DD/YYYY",d3:"%m/%d/%Y"},{label:"DD/MM/YYYY",fmt:"DD/MM/YYYY",d3:"%d/%m/%Y"},{label:"ISO 8601",fmt:"YYYY-MM-DD",d3:"%Y-%m-%d"},{label:"(custom)",fmt:"(custom)"}],EA=[new Date(2015,0,1),new Date(2016,0,1),new Date(2017,0,1)];function IA(t,e){if(t.includes("%q")){const n=Math.floor(e.getMonth()/3)+1;return Zd(t.replace("%q",String(n)))(e)}return Zd(t)(e)}function o8(t){if(t==="(automatic)")return"auto — adapts to data";if(t==="(custom)")return null;const e=$f.find(n=>n.fmt===t);return e!=null&&e.d3?EA.map(n=>IA(e.d3,n)).join(" · "):null}function vH(t){if(t==="(automatic)")return"";const e=$f.find(n=>n.fmt===t);return(e==null?void 0:e.d3)??""}function bH(t){if(!t)return"";try{return EA.map(e=>IA(t,e)).join(" · ")}catch{return"(invalid format)"}}function yH(t,e,n){if(!t)return"(automatic)";if(e==="(custom)")return n||"(custom)";const o=$f.find(r=>r.d3===t);return(o==null?void 0:o.label)??t}function xH(t){if(!t)return{selectedPreset:"(automatic)",customStr:""};const e=$f.find(n=>n.d3===t);return e?{selectedPreset:e.fmt,customStr:""}:{selectedPreset:"(custom)",customStr:t}}const wH={class:"form-control-date-format__popover"},_H={class:"form-control-date-format__popover__list"},kH=["onClick"],SH={class:"form-control-date-format__popover__list__item__body"},AH={class:"form-control-date-format__popover__list__item__body__label"},CH={key:0,class:"form-control-date-format__popover__list__item__body__ticks"},$H={key:0,class:"form-control-date-format__popover__list__item__check"},TH={key:0,class:"form-control-date-format__popover__custom"},MH={class:"form-control-date-format__popover__custom__preview"},OH={class:"form-control-date-format__popover__custom__preview__value"},BH=le({__name:"FormControlDateFormat",props:st({label:{default:void 0},id:{default:void 0},block:{type:Boolean,default:!0}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=ft(t,"modelValue"),n=Re("(automatic)"),o=Re(""),r=A(()=>bH(o.value)),i=A(()=>yH(e.value,n.value,o.value));function s(l,c){n.value=l,l!=="(custom)"&&(e.value=vH(l),c())}function a(){e.value=o.value}return qe(()=>e.value,l=>{const c=xH(l);n.value=c.selectedPreset,o.value=c.customStr},{immediate:!0}),(l,c)=>{const u=Rn;return w(),Z(u,{id:t.id,modelValue:e.value,"onUpdate:modelValue":c[1]||(c[1]=d=>e.value=d),label:t.label,block:t.block,placeholder:"(automatic)","auto-close":"outside","menu-class":"form-control-date-format-menu","min-menu-width":260},{"button-content":ee(()=>[T("span",{class:Te(["form-control-date-format__trigger-text",{"text-secondary":!e.value}])},be(p(i)),3)]),menu:ee(({hide:d})=>[T("div",wH,[T("div",_H,[(w(!0),R(We,null,mt(p($f),f=>(w(),R("div",{key:f.fmt,class:Te(["form-control-date-format__popover__list__item",{"form-control-date-format__popover__list__item--active":p(n)===f.fmt}]),onClick:h=>s(f.fmt,d)},[T("div",SH,[T("div",AH,be(f.label),1),p(o8)(f.fmt)?(w(),R("div",CH,be(p(o8)(f.fmt)),1)):ie("",!0)]),p(n)===f.fmt?(w(),R("span",$H,"✓")):ie("",!0)],10,kH))),128))]),p(n)==="(custom)"?(w(),R("div",TH,[c[3]||(c[3]=T("div",{class:"form-control-date-format__popover__custom__section-label"}," Custom d3-time-format string ",-1)),ar(T("input",{"onUpdate:modelValue":c[0]||(c[0]=f=>Xe(o)?o.value=f:null),class:"form-control-date-format__popover__custom__input",placeholder:"e.g. %b %d, %Y",onInput:a},null,544),[[Sp,p(o)]]),T("div",MH,[c[2]||(c[2]=Ye(" Preview: ",-1)),T("span",OH,be(p(o)?p(r):"—"),1)])])):ie("",!0)])]),_:1},8,["id","modelValue","label","block"])}}}),LH=Oe(BH,[["__scopeId","data-v-710c73d8"]]),PH={class:"display-date"},DH=le({__name:"DisplayDate",props:{value:{},format:{default:"short"}},setup(t){const e=t,n=A(()=>{const o=new Date(e.value);return Number.isNaN(o.getTime())?e.value:e.format==="long"?o.toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"}):o.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})});return(o,r)=>(w(),R("span",PH,be(p(n)),1))}}),EH=Oe(DH,[["__scopeId","data-v-7da39ad7"]]),IH={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function NH(t,e){return w(),R("svg",IH,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M128 24a104 104 0 1 0 104 104A104.11 104.11 0 0 0 128 24m0 192a88 88 0 1 1 88-88a88.1 88.1 0 0 1-88 88m16-40a8 8 0 0 1-8 8a16 16 0 0 1-16-16v-40a8 8 0 0 1 0-16a16 16 0 0 1 16 16v40a8 8 0 0 1 8 8m-32-92a12 12 0 1 1 12 12a12 12 0 0 1-12-12"},null,-1)])])}const T1=Me({name:"ph-info",render:NH}),RH={class:"display-contrast-badge__ratio"},FH=le({__name:"DisplayContrastBadge",props:{level:{},ratio:{}},setup(t){const e=t,n=ht("badgeRef"),o=A(()=>({"display-contrast-badge--aaa":e.level==="AAA","display-contrast-badge--aa":e.level==="AA","display-contrast-badge--fail":e.level==="Fail"})),r=A(()=>{switch(e.level){case"AAA":return"WCAG AAA — Ratio ≥ 7:1. Enhanced contrast, meets the highest accessibility standard.";case"AA":return"WCAG AA — Ratio ≥ 4.5:1. Minimum contrast for normal text. Sufficient for most users.";default:return"Below WCAG AA — Ratio < 4.5:1. Insufficient contrast. May be hard to read for some users."}});return(i,s)=>(w(),R("span",{ref_key:"badgeRef",ref:n,class:Te(["display-contrast-badge",p(o)])},[Ye(be(t.level)+" ",1),T("span",RH,be(t.ratio),1),H(p(T1),{class:"display-contrast-badge__info"}),H(p(qd),{"teleport-to":"body",target:p(n),title:p(r),placement:"top"},null,8,["target","title"])],2))}}),r8=Oe(FH,[["__scopeId","data-v-2ff89f6d"]]),VH={[rn.BarVertical]:"Columns",[rn.BarHorizontal]:"Bars",[rn.BarMulti]:"Grouped Columns",[rn.ColumnStacked]:"Stacked Columns",[rn.BarStacked]:"Stacked Bars",[rn.BarSplit]:"Split Bars",[rn.BarGrouped]:"Grouped Bars",[rn.Line]:"Line",[rn.LineMulti]:"Lines",[rn.Area]:"Area",[rn.AreaStacked]:"Areas",[rn.Donut]:"Donut",[rn.Pie]:"Pie"};function NA(t){return VH[t]??t}const zH={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function HH(t,e){return w(),R("svg",zH,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M224 200h-8V40a8 8 0 0 0-8-8h-56a8 8 0 0 0-8 8v40H96a8 8 0 0 0-8 8v40H48a8 8 0 0 0-8 8v64h-8a8 8 0 0 0 0 16h192a8 8 0 0 0 0-16M160 48h40v152h-40Zm-56 48h40v104h-40Zm-48 48h32v56H56Z"},null,-1)])])}const Ps=Me({name:"ph-chart-bar",render:HH}),WH={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function UH(t,e){return w(),R("svg",WH,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M224 96h-40V56a8 8 0 0 0-8-8H56v-8a8 8 0 0 0-16 0v176a8 8 0 0 0 16 0v-8h88a8 8 0 0 0 8-8v-40h72a8 8 0 0 0 8-8v-48a8 8 0 0 0-8-8m-56-32v32H56V64Zm-32 128H56v-32h80Zm80-48H56v-32h160Z"},null,-1)])])}const id=Me({name:"ph-chart-bar-horizontal",render:UH}),GH={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function qH(t,e){return w(),R("svg",GH,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M232 208a8 8 0 0 1-8 8H32a8 8 0 0 1-8-8V48a8 8 0 0 1 16 0v108.69l50.34-50.35a8 8 0 0 1 11.32 0L128 132.69L180.69 80H160a8 8 0 0 1 0-16h40a8 8 0 0 1 8 8v40a8 8 0 0 1-16 0V91.31l-58.34 58.35a8 8 0 0 1-11.32 0L96 123.31l-56 56V200h184a8 8 0 0 1 8 8"},null,-1)])])}const sd=Me({name:"ph-chart-line-up",render:qH}),YH={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function jH(t,e){return w(),R("svg",YH,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M100 116.43a8 8 0 0 0 4-6.93v-72A8 8 0 0 0 93.34 30a104.06 104.06 0 0 0-67.61 117a8 8 0 0 0 4.52 5.81a7.9 7.9 0 0 0 3.35.74a8 8 0 0 0 4-1.07ZM88 49.62v55.26l-47.88 27.63C40 131 40 129.48 40 128a88.12 88.12 0 0 1 48-78.38M128 24a8 8 0 0 0-8 8v91.82l-78.81 45.91a8 8 0 0 0-2.87 11A104 104 0 1 0 128 24m0 192a88.47 88.47 0 0 1-71.49-36.68l75.52-44a8 8 0 0 0 4-6.92V40.36A88 88 0 0 1 128 216"},null,-1)])])}const RA=Me({name:"ph-chart-pie-slice",render:jH}),XH={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function KH(t,e){return w(),R("svg",XH,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M128 24a8 8 0 0 0-8 8v56a8 8 0 0 0 8 8a32 32 0 1 1-27.72 16a8 8 0 0 0-2.93-10.93l-48.5-28A8 8 0 0 0 37.92 76A104 104 0 1 0 128 24M48.09 91.1L83 111.26A48.1 48.1 0 0 0 80 128c0 1.53.08 3 .22 4.52L41.28 143a88.16 88.16 0 0 1 6.81-51.9m-2.67 67.31l39-10.44A48.1 48.1 0 0 0 120 175.32v40.31a88.2 88.2 0 0 1-74.58-57.22M136 215.63v-40.31a48 48 0 0 0 0-94.65V40.36a88 88 0 0 1 0 175.27"},null,-1)])])}const ZH=Me({name:"ph-chart-donut",render:KH}),QH=le({__name:"DisplayChartTypeBadge",props:{chartType:{},theme:{default:"light"}},setup(t){const e=t,n=A(()=>NA(e.chartType)),o=A(()=>e.theme==="dark"?"dark":"light"),r={[rn.BarVertical]:Ps,[rn.BarHorizontal]:id,[rn.BarMulti]:Ps,[rn.ColumnStacked]:Ps,[rn.BarStacked]:id,[rn.BarSplit]:id,[rn.BarGrouped]:id,[rn.Line]:sd,[rn.LineMulti]:sd,[rn.Area]:sd,[rn.AreaStacked]:sd,[rn.Donut]:ZH,[rn.Pie]:RA},i=A(()=>r[e.chartType]??Ps);return(s,a)=>(w(),Z(p(wy),{variant:p(o),pill:"",class:"display-chart-type-badge"},{default:ee(()=>[(w(),Z(Gt(p(i)),{class:"display-chart-type-badge__icon"})),Ye(" "+be(p(n)),1)]),_:1},8,["variant"]))}}),JH=Oe(QH,[["__scopeId","data-v-cb8f5582"]]),eW={class:"section-card"},tW={key:0,class:"section-card__label"},nW={key:1,class:"section-card__body"},oW=le({__name:"SectionCard",props:{label:{}},setup(t){return(e,n)=>(w(),R("div",eW,[t.label?(w(),R("div",tW,be(t.label),1)):ie("",!0),Ce(e.$slots,"header",{},void 0,!0),e.$slots.default?(w(),R("div",nW,[Ce(e.$slots,"default",{},void 0,!0)])):ie("",!0)]))}}),$d=Oe(oW,[["__scopeId","data-v-804cd08f"]]),rW={},iW={class:"settings-section-description"};function sW(t,e){return w(),R("p",iW,[Ce(t.$slots,"default",{},void 0,!0)])}const aW=Oe(rW,[["render",sW],["__scopeId","data-v-9caa49e3"]]),lW={},cW={class:"settings-section-title"};function uW(t,e){return w(),R("h6",cW,[Ce(t.$slots,"default",{},void 0,!0)])}const dW=Oe(lW,[["render",uW],["__scopeId","data-v-c5961a9d"]]),fW={class:"settings-section-icon"},hW=le({__name:"SettingsSectionIcon",props:{icon:{}},setup(t){return(e,n)=>{const o=Cf;return w(),R("div",fW,[H(o,{name:t.icon},null,8,["name"])])}}}),pW=Oe(hW,[["__scopeId","data-v-e8122360"]]),mW={class:"settings-section"},gW={class:"settings-section__header"},vW={class:"settings-section__header__text"},bW={key:1,class:"settings-section__body"},yW=le({__name:"SettingsSection",props:{title:{},icon:{default:void 0},description:{default:void 0}},setup(t){return(e,n)=>{const o=pW,r=dW,i=aW;return w(),R("section",mW,[T("div",gW,[t.icon?(w(),Z(o,{key:0,icon:t.icon},null,8,["icon"])):ie("",!0),T("div",vW,[H(r,null,{default:ee(()=>[Ye(be(t.title),1)]),_:1})])]),e.$slots.description||t.description?(w(),Z(i,{key:0},{default:ee(()=>[Ce(e.$slots,"description",{},()=>[Ye(be(t.description),1)],!0)]),_:3})):ie("",!0),e.$slots.default?(w(),R("div",bW,[Ce(e.$slots,"default",{},void 0,!0)])):ie("",!0)])}}}),zo=Oe(yW,[["__scopeId","data-v-91596f42"]]),xW={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function wW(t,e){return w(),R("svg",xW,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M205.66 194.34a8 8 0 0 1-11.32 11.32L128 139.31l-66.34 66.35a8 8 0 0 1-11.32-11.32L116.69 128L50.34 61.66a8 8 0 0 1 11.32-11.32L128 116.69l66.34-66.35a8 8 0 0 1 11.32 11.32L139.31 128Z"},null,-1)])])}const FA=Me({name:"ph-x",render:wW}),_W=le({__name:"ButtonClose",emits:["click"],setup(t){return(e,n)=>{const o=Kn;return w(),Z(o,{"icon-left":p(FA),label:"Close","hide-label":"",square:"",variant:"link",size:"sm",class:"button-panel-action",onClick:n[0]||(n[0]=r=>e.$emit("click"))},null,8,["icon-left"])}}}),VA=Oe(_W,[["__scopeId","data-v-d6bb5d7b"]]),kW={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function SW(t,e){return w(),R("svg",kW,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M240 56v48a8 8 0 0 1-8 8h-48a8 8 0 0 1 0-16h27.4l-26.59-24.36l-.25-.24a80 80 0 1 0-1.67 114.78a8 8 0 0 1 11 11.63A95.44 95.44 0 0 1 128 224h-1.32a96 96 0 1 1 69.07-164L224 85.8V56a8 8 0 1 1 16 0"},null,-1)])])}const AW=Me({name:"ph-arrow-clockwise",render:SW}),CW=le({__name:"ButtonRedo",props:{disabled:{type:Boolean,default:!1}},emits:["click"],setup(t){return(e,n)=>{const o=Kn;return w(),Z(o,{"icon-left":p(AW),label:"Redo","hide-label":"",square:"",variant:"outline-secondary",size:"sm",disabled:t.disabled,onClick:n[0]||(n[0]=r=>e.$emit("click"))},null,8,["icon-left","disabled"])}}}),$W={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function TW(t,e){return w(),R("svg",$W,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M224 128a96 96 0 0 1-94.71 96H128a95.38 95.38 0 0 1-65.9-26.2a8 8 0 0 1 11-11.63a80 80 0 1 0-1.67-114.78a3 3 0 0 1-.26.25L44.59 96H72a8 8 0 0 1 0 16H24a8 8 0 0 1-8-8V56a8 8 0 0 1 16 0v29.8L60.25 60A96 96 0 0 1 224 128"},null,-1)])])}const MW=Me({name:"ph-arrow-counter-clockwise",render:TW}),OW=le({__name:"ButtonUndo",props:{disabled:{type:Boolean,default:!1}},emits:["click"],setup(t){return(e,n)=>{const o=Kn;return w(),Z(o,{"icon-left":p(MW),label:"Undo","hide-label":"",square:"",variant:"outline-secondary",size:"sm",disabled:t.disabled,onClick:n[0]||(n[0]=r=>e.$emit("click"))},null,8,["icon-left","disabled"])}}}),BW={class:"feedback-empty-state"},LW={class:"feedback-empty-state__message"},PW=le({__name:"FeedbackEmptyState",props:{message:{}},setup(t){return(e,n)=>(w(),R("div",BW,[T("p",LW,[Ce(e.$slots,"default",{},()=>[Ye(be(t.message),1)],!0)])]))}}),DW=Oe(PW,[["__scopeId","data-v-dab82b40"]]),EW={key:0,class:"layout-bottom-drawer__header"},IW={class:"layout-bottom-drawer__header__title"},NW={class:"layout-bottom-drawer__body"},RW=80,FW=le({__name:"LayoutBottomDrawer",props:st({title:{}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=ft(t,"modelValue"),n=Re(0),o=Re(!1),r=A(()=>({"layout-bottom-drawer--dragging":o.value}));let i=0,s=!1;function a(d){i=d.clientY,n.value=0,s=!1,document.addEventListener("pointermove",l),document.addEventListener("pointerup",c,{once:!0}),document.addEventListener("pointercancel",c,{once:!0})}function l(d){const f=d.clientY-i;!o.value&&Math.abs(f)>4&&(o.value=!0),o.value&&(s=!0,n.value=Math.max(0,f))}function c(){document.removeEventListener("pointermove",l),document.removeEventListener("pointercancel",c),o.value&&n.value>=RW?e.value=!1:s||(e.value=!1),n.value=0,o.value=!1}const u=A(()=>n.value>0?{transform:`translateY(${n.value}px)`}:{});return(d,f)=>(w(),R(We,null,[H(Bl,{name:"drawer"},{default:ee(()=>[e.value?(w(),R("div",{key:0,class:Te(["layout-bottom-drawer",p(r)]),style:Pt(p(u))},[T("div",{class:"layout-bottom-drawer__handle",onPointerdown:a},[...f[1]||(f[1]=[T("div",{class:"layout-bottom-drawer__handle__bar"},null,-1)])],32),t.title?(w(),R("div",EW,[T("h2",IW,be(t.title),1)])):ie("",!0),T("div",NW,[Ce(d.$slots,"default",{},void 0,!0)])],6)):ie("",!0)]),_:3}),e.value?(w(),R("div",{key:0,class:"layout-bottom-drawer__backdrop",onClick:f[0]||(f[0]=h=>e.value=!1)})):ie("",!0)],64))}}),zA=Oe(FW,[["__scopeId","data-v-6b9a0111"]]),VW={class:"layout-panel"},zW={class:"layout-panel__header"},HW={class:"layout-panel__header__title"},WW={key:0,class:"layout-panel__header__actions"},UW={key:0,class:"layout-panel__toolbar"},GW={class:"layout-panel__body"},qW={key:1,class:"layout-panel__footer"},YW=le({__name:"LayoutPanel",props:{title:{}},setup(t){return(e,n)=>(w(),R("div",VW,[T("div",zW,[T("h2",HW,be(t.title),1),e.$slots.actions?(w(),R("div",WW,[Ce(e.$slots,"actions",{},void 0,!0)])):ie("",!0)]),e.$slots.toolbar?(w(),R("div",UW,[Ce(e.$slots,"toolbar",{},void 0,!0)])):ie("",!0),T("div",GW,[Ce(e.$slots,"default",{},void 0,!0)]),e.$slots.footer?(w(),R("div",qW,[Ce(e.$slots,"footer",{},void 0,!0)])):ie("",!0)]))}}),jW=Oe(YW,[["__scopeId","data-v-5b00db3c"]]),XW=["aria-label"],KW=["disabled","aria-current","onClick"],ZW={class:"navigation-segmented-control__option__label"},QW=le({__name:"NavigationSegmentedControl",props:{items:{},ariaLabel:{default:void 0},size:{default:"md"}},emits:["select"],setup(t,{emit:e}){const n=t,o=e,r=A(()=>`navigation-segmented-control--${n.size}`);function i(s){s.disabled||o("select",s.key)}return(s,a)=>(w(),R("nav",{class:Te(["navigation-segmented-control",p(r)]),"aria-label":t.ariaLabel},[Ce(s.$slots,"default",{},void 0,!0),(w(!0),R(We,null,mt(t.items,l=>(w(),R("button",{key:l.key,class:Te(["navigation-segmented-control__option",{"navigation-segmented-control__option--active":l.active,"navigation-segmented-control__option--disabled":l.disabled}]),disabled:l.disabled,"aria-current":l.active?"true":void 0,type:"button",onClick:c=>i(l)},[l.icon?(w(),Z(Gt(l.icon),{key:0,class:"navigation-segmented-control__option__icon"})):ie("",!0),T("span",ZW,be(l.text),1)],10,KW))),128))],10,XW))}}),HA=Oe(QW,[["__scopeId","data-v-7aaaef48"]]),JW=["aria-selected","aria-disabled","tabindex","title","onClick","onKeydown"],eU={key:0,class:"navigation-stepper-tabs__step__icon","aria-hidden":"true"},tU={class:"navigation-stepper-tabs__step__label"},nU={key:0,class:"navigation-stepper-tabs__sep","aria-hidden":"true"},oU=le({__name:"NavigationStepperTabs",props:st({steps:{},disabledSteps:{default:()=>[]},layout:{default:"inline"},separator:{type:Boolean,default:!0}},{currentStep:{required:!0},currentStepModifiers:{}}),emits:["update:currentStep"],setup(t){const e=t,n=ft(t,"currentStep");function o(l){return l<n.value?"done":l===n.value?"current":"pending"}function r(l){return e.disabledSteps.includes(l)}function i(l,c){return o(c)==="done"?Oy:l.icon}function s(l){r(l)||(n.value=l)}function a(l,c){var v;const u=[];for(let m=0;m<e.steps.length;m++)r(m)||u.push(m);if(u.length===0)return;const d=u.indexOf(c);let f=null;switch(l.key){case"ArrowRight":f=u[(d+1)%u.length];break;case"ArrowLeft":f=u[(d-1+u.length)%u.length];break;case"Home":f=u[0];break;case"End":f=u[u.length-1];break;default:return}if(l.preventDefault(),f===null)return;const h=l.currentTarget.closest('[role="tablist"]');if(!h)return;(v=h.querySelectorAll('[role="tab"]')[f])==null||v.focus()}return(l,c)=>(w(),R("div",{class:Te(["navigation-stepper-tabs",`navigation-stepper-tabs--${t.layout}`]),role:"tablist","aria-label":"Progress"},[(w(!0),R(We,null,mt(t.steps,(u,d)=>(w(),R(We,{key:u.key??d},[T("button",{type:"button",role:"tab","aria-selected":d===n.value?"true":"false","aria-disabled":r(d)||void 0,tabindex:r(d)?-1:0,class:Te(["navigation-stepper-tabs__step",`navigation-stepper-tabs__step--${o(d)}`,{"navigation-stepper-tabs__step--disabled":r(d)}]),title:u.label,onClick:f=>s(d),onKeydown:f=>a(f,d)},[i(u,d)?(w(),R("span",eU,[(w(),Z(Gt(i(u,d))))])):ie("",!0),T("span",tU,be(u.label),1)],42,JW),t.layout==="inline"&&t.separator&&d<t.steps.length-1?(w(),R("span",nU,"›")):ie("",!0)],64))),128))],2))}}),rU=Oe(oU,[["__scopeId","data-v-3dbb5c62"]]),iU=le({__name:"NavigationToggle",props:st({options:{default:()=>[]},size:{default:"md"}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=ft(t,"modelValue"),n=t,{entries:o}=Af(JN),r=A(()=>o.value.length>0?o.value:n.options),i=A(()=>r.value.map(a=>({key:a.value,text:a.text,icon:a.icon,active:a.value===e.value,disabled:a.disabled})));function s(a){e.value=a}return(a,l)=>(w(),Z(HA,{items:p(i),size:t.size,onSelect:s},{default:ee(()=>[Ce(a.$slots,"default")]),_:3},8,["items","size"]))}}),sU={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function aU(t,e){return w(),R("svg",sU,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"m229.66 218.34l-50.07-50.06a88.11 88.11 0 1 0-11.31 11.31l50.06 50.07a8 8 0 0 0 11.32-11.32M40 112a72 72 0 1 1 72 72a72.08 72.08 0 0 1-72-72"},null,-1)])])}const Vy=Me({name:"ph-magnifying-glass",render:aU}),lU=["aria-label"],cU={key:0,class:"navigation-command-bar__placeholder"},uU={key:1,class:"navigation-command-bar__kbd"},dU=le({__name:"NavigationCommandBar",props:{placeholder:{},shortcutLabel:{},collapsed:{type:Boolean,default:!1}},emits:["click"],setup(t){return(e,n)=>(w(),R("button",{type:"button",class:Te(["navigation-command-bar",{"navigation-command-bar--collapsed":t.collapsed}]),"aria-label":t.placeholder,onClick:n[0]||(n[0]=o=>e.$emit("click"))},[H(p(Vy),{class:"navigation-command-bar__icon","aria-hidden":"true"}),t.collapsed?ie("",!0):(w(),R("span",cU,be(t.placeholder),1)),t.shortcutLabel&&!t.collapsed?(w(),R("span",uU,be(t.shortcutLabel),1)):ie("",!0)],10,lU))}}),fU=Oe(dU,[["__scopeId","data-v-469a4437"]]),hU={class:"navigation-icon-rail"},pU={key:0,class:"navigation-icon-rail__footer"},mU=le({__name:"NavigationIconRail",props:st({items:{default:()=>[]}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=ft(t,"modelValue"),n=t,{entries:o}=Af(QN),r=A(()=>o.value.length>0?o.value:n.items);function i(s){return{"navigation-icon-rail__button--active":e.value===s}}return(s,a)=>{const l=Kn;return w(),R("nav",hU,[Ce(s.$slots,"default",{},void 0,!0),(w(!0),R(We,null,mt(p(r),c=>(w(),Z(l,{key:c.value,"icon-left":c.icon,label:c.tooltip,"tooltip-placement":"left","hide-label":"",square:"",size:"lg",variant:"link",class:Te(["navigation-icon-rail__button",i(c.value)]),"aria-pressed":e.value===c.value,onClick:u=>e.value=c.value},null,8,["icon-left","label","class","aria-pressed","onClick"]))),128)),a[0]||(a[0]=T("div",{class:"navigation-icon-rail__spacer"},null,-1)),s.$slots.footer?(w(),R("div",pU,[Ce(s.$slots,"footer",{},void 0,!0)])):ie("",!0)])}}}),gU=Oe(mU,[["__scopeId","data-v-0286a414"]]),vU={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function bU(t,e){return w(),R("svg",vU,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M224 104a8 8 0 0 1-16 0V59.32l-66.33 66.34a8 8 0 0 1-11.32-11.32L196.68 48H152a8 8 0 0 1 0-16h64a8 8 0 0 1 8 8Zm-40 24a8 8 0 0 0-8 8v72H48V80h72a8 8 0 0 0 0-16H48a16 16 0 0 0-16 16v128a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-72a8 8 0 0 0-8-8"},null,-1)])])}const zp=Me({name:"ph-arrow-square-out",render:bU}),yU=["aria-label"],xU={key:0,class:"navigation-sidebar__header"},wU={class:"navigation-sidebar__body"},_U=le({__name:"NavigationSidebar",props:{ariaLabel:{default:"Sidebar"}},setup(t){return(e,n)=>(w(),R("nav",{class:"navigation-sidebar","aria-label":t.ariaLabel},[e.$slots.header?(w(),R("div",xU,[Ce(e.$slots,"header",{},void 0,!0)])):ie("",!0),T("div",wU,[Ce(e.$slots,"default",{},void 0,!0)])],8,yU))}}),kU=Oe(_U,[["__scopeId","data-v-007c1edf"]]),SU={class:"navigation-sidebar-group"},AU={key:0,class:"navigation-sidebar-group__eyebrow"},CU={class:"navigation-sidebar-group__items"},$U=le({__name:"NavigationSidebarGroup",props:{eyebrow:{}},setup(t){return(e,n)=>(w(),R("div",SU,[t.eyebrow?(w(),R("div",AU,be(t.eyebrow),1)):ie("",!0),T("div",CU,[Ce(e.$slots,"default",{},void 0,!0)])]))}}),iv=Oe($U,[["__scopeId","data-v-794922fc"]]),TU=["href"],MU={class:"navigation-sidebar-item__icon"},OU={class:"navigation-sidebar-item__label"},BU={class:"navigation-sidebar-item__external","aria-hidden":"true"},LU=["href","aria-current","onClick"],PU={class:"navigation-sidebar-item__icon"},DU={class:"navigation-sidebar-item__label"},EU={key:0,class:"navigation-sidebar-item__count"},IU=le({__name:"NavigationSidebarItem",props:{to:{default:void 0},href:{default:void 0},label:{},active:{type:Boolean,default:!1},count:{default:void 0}},setup(t){const e=t,n=A(()=>e.href!==void 0);if(e.to===void 0&&e.href===void 0)throw new Error("NavigationSidebarItem requires either `to` or `href`.");if(e.to!==void 0&&e.href!==void 0)throw new Error("NavigationSidebarItem accepts `to` or `href`, not both.");function o(r){return{"navigation-sidebar-item":!0,"navigation-sidebar-item--active":e.active||r}}return(r,i)=>{const s=rm("router-link");return p(n)?(w(),R("a",{key:0,href:t.href,class:Te(o(!1)),target:"_blank",rel:"noopener noreferrer"},[T("span",MU,[Ce(r.$slots,"icon",{},void 0,!0)]),T("span",OU,be(t.label),1),T("span",BU,[H(p(zp))])],10,TU)):(w(),Z(s,{key:1,to:t.to,custom:""},{default:ee(({navigate:a,href:l,isActive:c})=>[T("a",{href:l,class:Te(o(c)),"aria-current":c||t.active?"page":void 0,onClick:a},[T("span",PU,[Ce(r.$slots,"icon",{},void 0,!0)]),T("span",DU,be(t.label),1),t.count!==void 0?(w(),R("span",EU,be(t.count),1)):ie("",!0)],10,LU)]),_:3},8,["to"]))}}}),Xu=Oe(IU,[["__scopeId","data-v-d6b18bde"]]),NU=["href","aria-label","onClick"],RU=["src","alt"],FU={key:1,class:"navigation-workspace-switcher__badge","aria-hidden":"true"},VU={key:2,class:"navigation-workspace-switcher__name"},zU=["aria-label"],HU=["src","alt"],WU={key:1,class:"navigation-workspace-switcher__badge","aria-hidden":"true"},UU={key:2,class:"navigation-workspace-switcher__name"},GU=le({__name:"NavigationWorkspaceSwitcher",props:{name:{},logoSrc:{default:void 0},hideName:{type:Boolean,default:!1},to:{default:void 0}},emits:["click"],setup(t){const e=t,n=A(()=>e.name.trim().charAt(0).toUpperCase());return(o,r)=>{const i=rm("router-link");return t.to?(w(),Z(i,{key:0,to:t.to,custom:""},{default:ee(({navigate:s,href:a})=>[T("a",{href:a,class:"navigation-workspace-switcher","aria-label":t.name,onClick:s},[t.logoSrc?(w(),R("img",{key:0,src:t.logoSrc,alt:t.name,class:"navigation-workspace-switcher__logo"},null,8,RU)):(w(),R("span",FU,be(n.value),1)),t.hideName?ie("",!0):(w(),R("span",VU,be(t.name),1))],8,NU)]),_:1},8,["to"])):(w(),R("button",{key:1,type:"button",class:"navigation-workspace-switcher","aria-label":t.name,onClick:r[0]||(r[0]=s=>o.$emit("click"))},[t.logoSrc?(w(),R("img",{key:0,src:t.logoSrc,alt:t.name,class:"navigation-workspace-switcher__logo"},null,8,HU)):(w(),R("span",WU,be(n.value),1)),t.hideName?ie("",!0):(w(),R("span",UU,be(t.name),1))],8,zU))}}}),WA=Oe(GU,[["__scopeId","data-v-c9a99b92"]]),qU={class:"list-item-row__label"},YU=le({__name:"ListItemRow",props:{label:{},active:{type:Boolean}},emits:["click"],setup(t){const e=t,n=A(()=>({"list-item-row--active":e.active}));return(o,r)=>(w(),R("div",{class:Te(["list-item-row",p(n)]),onClick:r[0]||(r[0]=i=>o.$emit("click",i))},[Ce(o.$slots,"leading",{},void 0,!0),T("span",qU,be(t.label),1),Ce(o.$slots,"actions",{},void 0,!0)],2))}}),UA=Oe(YU,[["__scopeId","data-v-51fbb4a2"]]),jU={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function XU(t,e){return w(),R("svg",jU,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M216 48h-40v-8a24 24 0 0 0-24-24h-48a24 24 0 0 0-24 24v8H40a8 8 0 0 0 0 16h8v144a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16V64h8a8 8 0 0 0 0-16M96 40a8 8 0 0 1 8-8h48a8 8 0 0 1 8 8v8H96Zm96 168H64V64h128Zm-80-104v64a8 8 0 0 1-16 0v-64a8 8 0 0 1 16 0m48 0v64a8 8 0 0 1-16 0v-64a8 8 0 0 1 16 0"},null,-1)])])}const GA=Me({name:"ph-trash",render:XU}),KU={class:"list-item-actions"},ZU=le({__name:"ListItemActions",props:{actions:{default:()=>["duplicate","remove"]}},emits:["duplicate","remove"],setup(t){return(e,n)=>{const o=Ho,r=Cf;return w(),R("div",KU,[t.actions.includes("duplicate")?(w(),Z(o,{key:0,variant:"link",size:"sm",class:"list-item-actions__btn text-body-secondary",title:"Duplicate",onClick:n[0]||(n[0]=gn(i=>e.$emit("duplicate"),["stop"]))},{default:ee(()=>[...n[2]||(n[2]=[T("span",{"aria-hidden":"true"},"⧉",-1)])]),_:1})):ie("",!0),t.actions.includes("remove")?(w(),Z(o,{key:1,variant:"link",size:"sm",class:"list-item-actions__btn text-danger",title:"Remove",onClick:n[1]||(n[1]=gn(i=>e.$emit("remove"),["stop"]))},{default:ee(()=>[H(r,{name:p(GA)},null,8,["name"])]),_:1})):ie("",!0)])}}}),QU=Oe(ZU,[["__scopeId","data-v-29b731f9"]]),JU={class:"border rounded overflow-hidden bg-body-tertiary p-2"},eG={class:"d-flex gap-1 mb-2"},zy=le({__name:"ListSelectPanel",props:st({items:{},maxHeight:{default:"220px"},onItemClick:{type:Function,default:void 0}},{selected:{required:!0},selectedModifiers:{}}),emits:["update:selected"],setup(t){const e=ft(t,"selected"),n=t;function o(l,c,u){n.onItemClick?n.onItemClick(l,c,u):r(l)}function r(l){e.value.indexOf(l)>=0?e.value=e.value.filter(u=>u!==l):e.value=[...e.value,l]}function i(){e.value=[...n.items]}function s(){e.value=[]}function a(){e.value=n.items.filter(l=>!e.value.includes(l))}return(l,c)=>{const u=UA;return w(),R("div",JU,[T("div",eG,[H(p(Ho),{variant:"outline-secondary",size:"sm",onClick:i},{default:ee(()=>[...c[0]||(c[0]=[Ye(" All ",-1)])]),_:1}),H(p(Ho),{variant:"outline-secondary",size:"sm",onClick:s},{default:ee(()=>[...c[1]||(c[1]=[Ye(" None ",-1)])]),_:1}),H(p(Ho),{variant:"outline-secondary",size:"sm",onClick:a},{default:ee(()=>[...c[2]||(c[2]=[Ye(" Invert ",-1)])]),_:1})]),T("div",{style:Pt({maxHeight:t.maxHeight,overflowY:"auto"})},[(w(!0),R(We,null,mt(t.items,(d,f)=>(w(),Z(u,{key:d,label:d,active:e.value.includes(d),onClick:h=>o(d,f,h)},wi({_:2},[l.$slots["item-leading"]?{name:"leading",fn:ee(()=>[Ce(l.$slots,"item-leading",{item:d,index:f})]),key:"0"}:void 0,l.$slots["item-actions"]?{name:"actions",fn:ee(()=>[Ce(l.$slots,"item-actions",{item:d,index:f})]),key:"1"}:void 0]),1032,["label","active","onClick"]))),128))],4)])}}}),tG=["data-bs-theme"],nG=["src"],oG={class:"gallery-card__meta"},rG={key:0,class:"gallery-card__meta__subtitle"},iG={key:1,class:"gallery-card__meta__footer"},sG=le({__name:"GalleryCard",props:{title:{},subtitle:{},thumbSrc:{},selected:{type:Boolean},layout:{},forceLightThumb:{type:Boolean},serifTitle:{type:Boolean}},emits:["click"],setup(t){const e=t,n=A(()=>({"gallery-card--selected":e.selected,"gallery-card--row":e.layout==="row"}));return(o,r)=>(w(),R("div",{class:Te(["gallery-card",p(n)]),role:"button",tabindex:"0",onClick:r[1]||(r[1]=i=>o.$emit("click")),onKeydown:[r[2]||(r[2]=or(i=>o.$emit("click"),["enter"])),r[3]||(r[3]=or(gn(i=>o.$emit("click"),["prevent"]),["space"]))]},[T("div",{class:"gallery-card__thumb","data-bs-theme":t.forceLightThumb?"light":void 0},[t.thumbSrc?(w(),R("img",{key:0,src:t.thumbSrc,alt:"",class:"gallery-card__thumb__img"},null,8,nG)):ie("",!0),o.$slots.actions?(w(),R("div",{key:1,class:"gallery-card__thumb__actions",onClick:r[0]||(r[0]=gn(()=>{},["stop"]))},[Ce(o.$slots,"actions",{},void 0,!0)])):ie("",!0)],8,tG),T("div",oG,[T("div",{class:Te(["gallery-card__meta__title",{"bc-display":t.serifTitle}])},be(t.title),3),t.subtitle?(w(),R("div",rG,be(t.subtitle),1)):ie("",!0),o.$slots.footer?(w(),R("div",iG,[Ce(o.$slots,"footer",{},void 0,!0)])):ie("",!0)])],34))}}),aG=Oe(sG,[["__scopeId","data-v-48e157d8"]]),lG=le({__name:"GalleryGrid",props:{layout:{default:"grid"}},setup(t){const e=t,n=A(()=>({"gallery-grid--row":e.layout==="row"}));return(o,r)=>(w(),R("div",{class:Te(["gallery-grid",p(n)])},[Ce(o.$slots,"default",{},void 0,!0)],2))}}),cG=Oe(lG,[["__scopeId","data-v-7c69b740"]]),uG={class:"scene-timeline-item__label"},dG=["innerHTML"],fG={key:1,class:"scene-timeline-item__name"},hG=le({__name:"SceneTimelineItem",props:{name:{},index:{},active:{type:Boolean,default:!1},thumbnail:{default:null},removable:{type:Boolean,default:!0}},emits:["select","remove"],setup(t){return(e,n)=>(w(),R("button",{class:Te(["scene-timeline-item",{"scene-timeline-item--active":t.active}]),type:"button",onClick:n[1]||(n[1]=o=>e.$emit("select"))},[t.removable?(w(),R("span",{key:0,class:"scene-timeline-item__remove",role:"button","aria-label":"Remove scene",onClick:n[0]||(n[0]=gn(o=>e.$emit("remove"),["stop"]))}," × ")):ie("",!0),T("span",uG,"Scene "+be(t.index+1),1),T("span",{class:"scene-timeline-item__preview",innerHTML:t.thumbnail},null,8,dG),t.name?(w(),R("span",fG,be(t.name),1)):ie("",!0)],2))}}),pG=Oe(hG,[["__scopeId","data-v-e9323b3b"]]),mG={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function gG(t,e){return w(),R("svg",mG,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M240 128a15.74 15.74 0 0 1-7.6 13.51L88.32 229.65a16 16 0 0 1-16.2.3A15.86 15.86 0 0 1 64 216.13V39.87a15.86 15.86 0 0 1 8.12-13.82a16 16 0 0 1 16.2.3l144.08 88.14A15.74 15.74 0 0 1 240 128"},null,-1)])])}const vG=Me({name:"ph-play-fill",render:gG}),bG={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function yG(t,e){return w(),R("svg",bG,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M216 48v160a16 16 0 0 1-16 16h-40a16 16 0 0 1-16-16V48a16 16 0 0 1 16-16h40a16 16 0 0 1 16 16M96 32H56a16 16 0 0 0-16 16v160a16 16 0 0 0 16 16h40a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16"},null,-1)])])}const xG=Me({name:"ph-pause-fill",render:yG}),wG={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function _G(t,e){return w(),R("svg",wG,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M165.66 202.34a8 8 0 0 1-11.32 11.32l-80-80a8 8 0 0 1 0-11.32l80-80a8 8 0 0 1 11.32 11.32L91.31 128Z"},null,-1)])])}const qA=Me({name:"ph-caret-left",render:_G}),kG={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function SG(t,e){return w(),R("svg",kG,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"m181.66 133.66l-80 80a8 8 0 0 1-11.32-11.32L164.69 128L90.34 53.66a8 8 0 0 1 11.32-11.32l80 80a8 8 0 0 1 0 11.32"},null,-1)])])}const YA=Me({name:"ph-caret-right",render:SG}),AG={class:"scene-timeline-controls"},CG=["disabled"],$G=["aria-label","disabled"],TG=["disabled"],MG={key:0,class:"scene-timeline-controls__counter"},OG=le({__name:"SceneTimelineControls",props:st({total:{},playing:{type:Boolean,default:!1},hideCounter:{type:Boolean,default:!1}},{activeIndex:{default:-1},activeIndexModifiers:{}}),emits:st(["play","pause"],["update:activeIndex"]),setup(t){const e=ft(t,"activeIndex"),n=t,o=A(()=>n.total===0),r=A(()=>e.value<0?1:e.value+1),i=A(()=>n.total===0?0:e.value<=0?n.total-1:e.value-1),s=A(()=>n.total===0||e.value>=n.total-1?0:e.value+1);return(a,l)=>{const c=Cf;return w(),R("div",AG,[T("button",{class:"scene-timeline-controls__nav-btn",type:"button","aria-label":"Previous scene",disabled:p(o),onClick:l[0]||(l[0]=u=>e.value=p(i))},[H(c,{name:p(qA),size:"1em"},null,8,["name"])],8,CG),T("button",{class:"scene-timeline-controls__play-btn",type:"button","aria-label":t.playing?"Pause":"Play",disabled:p(o),onClick:l[1]||(l[1]=u=>t.playing?a.$emit("pause"):a.$emit("play"))},[H(c,{name:t.playing?p(xG):p(vG),size:"1em"},null,8,["name"])],8,$G),T("button",{class:"scene-timeline-controls__nav-btn",type:"button","aria-label":"Next scene",disabled:p(o),onClick:l[2]||(l[2]=u=>e.value=p(s))},[H(c,{name:p(YA),size:"1em"},null,8,["name"])],8,TG),!p(o)&&!t.hideCounter?(w(),R("span",MG,be(p(r))+" / "+be(t.total),1)):ie("",!0)])}}}),Hy=Oe(OG,[["__scopeId","data-v-469c0735"]]),BG={class:"scene-timeline__items"},LG={class:"scene-timeline__items__add"},PG=le({__name:"SceneTimeline",props:st({scenes:{},playing:{type:Boolean,default:!1},floating:{type:Boolean,default:!1}},{activeIndex:{default:-1},activeIndexModifiers:{}}),emits:st(["add","remove","play","pause"],["update:activeIndex"]),setup(t){const e=ft(t,"activeIndex");return(n,o)=>{const r=Hy,i=pG,s=Al;return w(),R("div",{class:Te(["scene-timeline",{"scene-timeline--floating":t.floating}])},[H(r,{"active-index":e.value,"onUpdate:activeIndex":o[0]||(o[0]=a=>e.value=a),total:t.scenes.length,playing:t.playing,onPlay:o[1]||(o[1]=a=>n.$emit("play")),onPause:o[2]||(o[2]=a=>n.$emit("pause"))},null,8,["active-index","total","playing"]),T("div",BG,[(w(!0),R(We,null,mt(t.scenes,a=>(w(),Z(i,{key:a.index,name:a.name,index:a.index,active:a.index===e.value,thumbnail:a.thumbnail??null,removable:a.removable??!0,onSelect:l=>e.value=a.index,onRemove:l=>n.$emit("remove",a.index)},null,8,["name","index","active","thumbnail","removable","onSelect","onRemove"]))),128)),T("div",LG,[H(s,{onClick:o[3]||(o[3]=a=>n.$emit("add"))})])])],2)}}}),DG=Oe(PG,[["__scopeId","data-v-a0977ad2"]]),EG={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function IG(t,e){return w(),R("svg",EG,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M213.66 165.66a8 8 0 0 1-11.32 0L128 91.31l-74.34 74.35a8 8 0 0 1-11.32-11.32l80-80a8 8 0 0 1 11.32 0l80 80a8 8 0 0 1 0 11.32"},null,-1)])])}const NG=Me({name:"ph-caret-up",render:IG}),RG={class:"scene-timeline-compact"},FG=["title"],VG={class:"scene-timeline-compact__counter"},zG=le({__name:"SceneTimelineCompact",props:st({scenes:{},playing:{type:Boolean,default:!1},expanded:{type:Boolean,default:!1}},{activeIndex:{default:-1},activeIndexModifiers:{}}),emits:st(["play","pause","expand"],["update:activeIndex"]),setup(t){const e=ft(t,"activeIndex"),n=t,o=A(()=>e.value<0?null:n.scenes.find(a=>a.index===e.value)??null),r=A(()=>{var a;return((a=o.value)==null?void 0:a.name)||" "}),i=A(()=>n.scenes.length),s=A(()=>e.value<0||i.value===0?1:Math.max(1,Math.min(i.value,e.value+1)));return(a,l)=>(w(),R("div",RG,[H(Hy,{"active-index":e.value,"onUpdate:activeIndex":l[0]||(l[0]=c=>e.value=c),total:p(i),playing:t.playing,"hide-counter":"",onPlay:l[1]||(l[1]=c=>a.$emit("play")),onPause:l[2]||(l[2]=c=>a.$emit("pause"))},null,8,["active-index","total","playing"]),T("div",{class:"scene-timeline-compact__name",title:p(r)},be(p(r)),9,FG),T("div",VG,be(p(s))+" of "+be(p(i)),1),H(Kn,{class:"scene-timeline-compact__expand","icon-left":p(NG),label:"Show scenes","hide-label":"",square:"",variant:"link",size:"sm","aria-expanded":t.expanded,onClick:l[3]||(l[3]=c=>a.$emit("expand"))},null,8,["icon-left","aria-expanded"])]))}}),HG=Oe(zG,[["__scopeId","data-v-6874749a"]]),WG=["aria-current"],UG=["innerHTML"],GG={key:1,class:"scene-list-item__thumb scene-list-item__thumb--empty","aria-hidden":"true"},qG={class:"scene-list-item__body"},YG={class:"scene-list-item__label"},jG={key:0,class:"scene-list-item__name"},XG={key:1,class:"scene-list-item__hint"},KG=le({__name:"SceneListItem",props:{index:{},name:{},thumbnail:{},hint:{},active:{type:Boolean,default:!1},removable:{type:Boolean,default:!0}},emits:["select","remove"],setup(t){return(e,n)=>(w(),R("li",{class:Te(["scene-list-item-row",{"scene-list-item-row--active":t.active}])},[T("button",{type:"button",class:Te(["scene-list-item",{"scene-list-item--active":t.active}]),"aria-current":t.active?"true":void 0,onClick:n[0]||(n[0]=o=>e.$emit("select"))},[t.thumbnail?(w(),R("span",{key:0,class:"scene-list-item__thumb",innerHTML:t.thumbnail},null,8,UG)):(w(),R("span",GG)),T("span",qG,[T("span",YG,"SCENE "+be(t.index),1),t.name?(w(),R("span",jG,be(t.name),1)):ie("",!0),t.hint?(w(),R("span",XG,be(t.hint),1)):ie("",!0)])],10,WG),t.removable?(w(),R("button",{key:0,type:"button",class:"scene-list-item__remove","aria-label":"Remove scene",onClick:n[1]||(n[1]=gn(o=>e.$emit("remove"),["stop"]))},[H(p(FA))])):ie("",!0)],2))}}),ZG=Oe(KG,[["__scopeId","data-v-4d17a115"]]),QG={class:"scene-list"},JG={class:"scene-list__items",role:"list"},eq=le({__name:"SceneList",props:st({scenes:{},playing:{type:Boolean,default:!1}},{activeIndex:{default:-1},activeIndexModifiers:{}}),emits:st(["add","remove","play","pause"],["update:activeIndex"]),setup(t,{emit:e}){const n=ft(t,"activeIndex"),o=e;function r(s){n.value=s}function i(s){o("remove",s)}return(s,a)=>(w(),R("div",QG,[H(Hy,{"active-index":n.value,"onUpdate:activeIndex":a[0]||(a[0]=l=>n.value=l),total:t.scenes.length,playing:t.playing,onPlay:a[1]||(a[1]=l=>s.$emit("play")),onPause:a[2]||(a[2]=l=>s.$emit("pause"))},null,8,["active-index","total","playing"]),T("ul",JG,[(w(!0),R(We,null,mt(t.scenes,l=>(w(),Z(ZG,{key:l.index,index:l.index,name:l.name,thumbnail:l.thumbnail??null,hint:l.hint??null,active:l.index===n.value,removable:l.removable??!0,onSelect:c=>r(l.index),onRemove:c=>i(l.index)},null,8,["index","name","thumbnail","hint","active","removable","onSelect","onRemove"]))),128))]),T("button",{type:"button",class:"scene-list__add",onClick:a[3]||(a[3]=l=>s.$emit("add"))}," + Add scene ")]))}}),tq=Oe(eq,[["__scopeId","data-v-a9466f90"]]),nq={class:"bc-scene-player bc-scene-player--progress-bar","data-scene-player":""},oq=["aria-label"],rq={key:0,width:"10",height:"10",viewBox:"0 0 12 12",fill:"currentColor"},iq={key:1,width:"10",height:"10",viewBox:"0 0 12 12",fill:"currentColor"},sq={class:"bc-scene-player__segments"},aq=["aria-label","aria-current","onClick"],lq={class:"bc-scene-player__counter"},cq=le({__name:"ScenePlayerProgressBar",props:st({total:{},playing:{type:Boolean,default:!1},position:{default:"center"}},{current:{required:!0},currentModifiers:{}}),emits:st(["play","pause"],["update:current"]),setup(t){const e=ft(t,"current");return(n,o)=>(w(),R("div",nq,[T("button",{type:"button",class:"bc-scene-player__play-btn","aria-label":t.playing?"Pause":"Play",onClick:o[0]||(o[0]=r=>t.playing?n.$emit("pause"):n.$emit("play"))},[t.playing?(w(),R("svg",rq,[...o[1]||(o[1]=[T("rect",{x:"1.5",y:"1",width:"3",height:"10",rx:"0.8"},null,-1),T("rect",{x:"7.5",y:"1",width:"3",height:"10",rx:"0.8"},null,-1)])])):(w(),R("svg",iq,[...o[2]||(o[2]=[T("path",{d:"M2.5 1v10l8-5z"},null,-1)])]))],8,oq),T("div",sq,[(w(!0),R(We,null,mt(t.total,r=>(w(),R("button",{key:r,type:"button",class:Te(["bc-scene-player__segments__segment",{"bc-scene-player__segments__segment--active":r===e.value,"bc-scene-player__segments__segment--completed":r<e.value}]),"aria-label":`Scene ${r} of ${t.total}`,"aria-current":r===e.value?"step":void 0,onClick:i=>e.value=r},null,10,aq))),128))]),T("span",lq,be(e.value)+"/"+be(t.total),1)]))}}),jA=Oe(cq,[["__scopeId","data-v-be507f24"]]),uq=["disabled"],dq=["aria-label"],fq={key:0,width:"11",height:"11",viewBox:"0 0 12 12",fill:"currentColor"},hq={key:1,width:"11",height:"11",viewBox:"0 0 12 12",fill:"currentColor"},pq={class:"bc-scene-player__dots"},mq=["aria-label","aria-current","onClick"],gq=["disabled"],vq=le({__name:"ScenePlayerDotStepper",props:st({total:{},playing:{type:Boolean,default:!1},position:{default:"center"}},{current:{required:!0},currentModifiers:{}}),emits:st(["play","pause","previous","next"],["update:current"]),setup(t){const e=ft(t,"current");return(n,o)=>(w(),R("div",{class:Te(["bc-scene-player bc-scene-player--dot-stepper",`bc-scene-player--${t.position}`]),"data-scene-player":""},[T("button",{type:"button",class:"bc-scene-player__nav-btn",disabled:e.value<=1,"aria-label":"Previous scene",onClick:o[0]||(o[0]=r=>n.$emit("previous"))},[...o[3]||(o[3]=[T("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round"},[T("path",{d:"M6.5 2L3.5 5l3 3"})],-1)])],8,uq),T("button",{type:"button",class:"bc-scene-player__play-btn","aria-label":t.playing?"Pause":"Play",onClick:o[1]||(o[1]=r=>t.playing?n.$emit("pause"):n.$emit("play"))},[t.playing?(w(),R("svg",fq,[...o[4]||(o[4]=[T("rect",{x:"1.5",y:"1",width:"3",height:"10",rx:"0.8"},null,-1),T("rect",{x:"7.5",y:"1",width:"3",height:"10",rx:"0.8"},null,-1)])])):(w(),R("svg",hq,[...o[5]||(o[5]=[T("path",{d:"M2.5 1v10l8-5z"},null,-1)])]))],8,dq),T("div",pq,[(w(!0),R(We,null,mt(t.total,r=>(w(),R("button",{key:r,type:"button",class:Te(["bc-scene-player__dots__dot",{"bc-scene-player__dots__dot--active":r===e.value,"bc-scene-player__dots__dot--completed":r<e.value}]),"aria-label":`Scene ${r} of ${t.total}`,"aria-current":r===e.value?"step":void 0,onClick:i=>e.value=r},null,10,mq))),128))]),T("button",{type:"button",class:"bc-scene-player__nav-btn",disabled:e.value>=t.total,"aria-label":"Next scene",onClick:o[2]||(o[2]=r=>n.$emit("next"))},[...o[6]||(o[6]=[T("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round"},[T("path",{d:"M3.5 2L6.5 5l-3 3"})],-1)])],8,gq)],2))}}),XA=Oe(vq,[["__scopeId","data-v-3499fe9e"]]),bq={key:0,class:"bc-scene-player__counter"},yq=["disabled"],xq=["aria-label"],wq={key:0,width:"9",height:"9",viewBox:"0 0 12 12",fill:"currentColor"},_q={key:1,width:"9",height:"9",viewBox:"0 0 12 12",fill:"currentColor"},kq=["disabled"],Sq={key:1,class:"bc-scene-player__counter bc-scene-player__counter--end"},Aq=le({__name:"ScenePlayerMinimalArrows",props:st({total:{},playing:{type:Boolean,default:!1},position:{default:"center"},wrap:{type:Boolean,default:!1},showCounter:{type:Boolean,default:!0},order:{default:"counter-first"}},{current:{required:!0},currentModifiers:{}}),emits:st(["play","pause","previous","next"],["update:current"]),setup(t){const e=ft(t,"current");return(n,o)=>(w(),R("div",{class:Te(["bc-scene-player bc-scene-player--minimal-arrows",`bc-scene-player--${t.position}`]),"data-scene-player":""},[t.showCounter&&t.order==="counter-first"?(w(),R("span",bq,be(e.value)+"/"+be(t.total),1)):ie("",!0),T("button",{type:"button",class:"bc-scene-player__nav-btn",disabled:!t.wrap&&e.value<=1,"aria-label":"Previous scene",onClick:o[0]||(o[0]=r=>n.$emit("previous"))},[...o[3]||(o[3]=[T("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round"},[T("path",{d:"M6.5 2L3.5 5l3 3"})],-1)])],8,yq),T("button",{type:"button",class:"bc-scene-player__play-btn","aria-label":t.playing?"Pause":"Play",onClick:o[1]||(o[1]=r=>t.playing?n.$emit("pause"):n.$emit("play"))},[t.playing?(w(),R("svg",wq,[...o[4]||(o[4]=[T("rect",{x:"1.5",y:"1",width:"3",height:"10",rx:"0.8"},null,-1),T("rect",{x:"7.5",y:"1",width:"3",height:"10",rx:"0.8"},null,-1)])])):(w(),R("svg",_q,[...o[5]||(o[5]=[T("path",{d:"M2.5 1v10l8-5z"},null,-1)])]))],8,xq),T("button",{type:"button",class:"bc-scene-player__nav-btn",disabled:!t.wrap&&e.value>=t.total,"aria-label":"Next scene",onClick:o[2]||(o[2]=r=>n.$emit("next"))},[...o[6]||(o[6]=[T("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round"},[T("path",{d:"M3.5 2L6.5 5l-3 3"})],-1)])],8,kq),t.showCounter&&t.order==="controls-first"?(w(),R("span",Sq,be(e.value)+"/"+be(t.total),1)):ie("",!0)],2))}}),KA=Oe(Aq,[["__scopeId","data-v-74dd9698"]]),Cq={class:"bc-scene-player__btn-group"},$q=["disabled"],Tq=["disabled"],Mq={class:"bc-scene-player__counter"},Oq=le({__name:"ScenePlayerButtons",props:st({total:{},playing:{type:Boolean,default:!1},position:{default:"left"}},{current:{required:!0},currentModifiers:{}}),emits:st(["play","pause","previous","next"],["update:current"]),setup(t){const e=ft(t,"current");return(n,o)=>(w(),R("div",{class:Te(["bc-scene-player bc-scene-player--buttons",`bc-scene-player--${t.position}`]),"data-scene-player":""},[T("div",Cq,[T("button",{type:"button",class:Te(["bc-scene-player__btn-group__btn",{"bc-scene-player__btn-group__btn--disabled":e.value<=1}]),disabled:e.value<=1,"aria-label":"Previous scene",onClick:o[0]||(o[0]=gn(r=>n.$emit("previous"),["stop"]))},[...o[2]||(o[2]=[T("svg",{width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},[T("path",{d:"M5.5 1.5L1.5 6l4 4.5"})],-1),Ye(" Back ",-1)])],10,$q),T("button",{type:"button",class:Te(["bc-scene-player__btn-group__btn bc-scene-player__btn-group__btn--next",{"bc-scene-player__btn-group__btn--disabled":e.value>=t.total}]),disabled:e.value>=t.total,"aria-label":"Next scene",onClick:o[1]||(o[1]=gn(r=>n.$emit("next"),["stop"]))},[...o[3]||(o[3]=[Ye(" Next ",-1),T("svg",{width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},[T("path",{d:"M2.5 1.5L6.5 6l-4 4.5"})],-1)])],10,Tq)]),T("span",Mq,be(e.value)+" / "+be(t.total),1)],2))}}),M1=Oe(Oq,[["__scopeId","data-v-9b2f8f87"]]),Bq=Bo("theme",()=>{const t=Re("light"),e=My("(prefers-color-scheme: dark)"),n=A(()=>t.value==="dark"||t.value==="auto"&&e.value?"dark":"light");qe(n,r=>{document.documentElement.setAttribute("data-bs-theme",r)},{immediate:!0});function o(){const r=["light","dark","auto"],i=r.indexOf(t.value);t.value=r[(i+1)%r.length]}return{theme:t,resolvedTheme:n,cycleTheme:o}},{persist:{key:"bc-theme",pick:["theme"]}});function Tf(){const t=Bq(),{theme:e,resolvedTheme:n}=$t(t);return{theme:e,resolvedTheme:n,cycleTheme:t.cycleTheme}}function Lq(){return typeof navigator>"u"?!1:/Mac|iPhone|iPod|iPad/i.test(navigator.platform)}function ZA(t){const e=t.toUpperCase(),n=Lq(),o=n?`⌘ ${e}`:`Ctrl ${e}`,r=n?`Meta+${e}`:`Control+${e}`;function i(a){return a.key.toLowerCase()!==t.toLowerCase()?!1:n?a.metaKey&&!a.ctrlKey:a.ctrlKey&&!a.metaKey}function s(){typeof document>"u"||document.dispatchEvent(new KeyboardEvent("keydown",{key:t,code:`Key${e}`,metaKey:n,ctrlKey:!n,bubbles:!0}))}return{keyLabel:o,keys:r,matches:i,trigger:s}}const Pq={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Dq(t,e){return w(),R("svg",Pq,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M120 40V16a8 8 0 0 1 16 0v24a8 8 0 0 1-16 0m72 88a64 64 0 1 1-64-64a64.07 64.07 0 0 1 64 64m-16 0a48 48 0 1 0-48 48a48.05 48.05 0 0 0 48-48M58.34 69.66a8 8 0 0 0 11.32-11.32l-16-16a8 8 0 0 0-11.32 11.32Zm0 116.68l-16 16a8 8 0 0 0 11.32 11.32l16-16a8 8 0 0 0-11.32-11.32M192 72a8 8 0 0 0 5.66-2.34l16-16a8 8 0 0 0-11.32-11.32l-16 16A8 8 0 0 0 192 72m5.66 114.34a8 8 0 0 0-11.32 11.32l16 16a8 8 0 0 0 11.32-11.32ZM48 128a8 8 0 0 0-8-8H16a8 8 0 0 0 0 16h24a8 8 0 0 0 8-8m80 80a8 8 0 0 0-8 8v24a8 8 0 0 0 16 0v-24a8 8 0 0 0-8-8m112-88h-24a8 8 0 0 0 0 16h24a8 8 0 0 0 0-16"},null,-1)])])}const Eq=Me({name:"ph-sun",render:Dq}),Iq={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Nq(t,e){return w(),R("svg",Iq,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M233.54 142.23a8 8 0 0 0-8-2a88.08 88.08 0 0 1-109.8-109.8a8 8 0 0 0-10-10a104.84 104.84 0 0 0-52.91 37A104 104 0 0 0 136 224a103.1 103.1 0 0 0 62.52-20.88a104.84 104.84 0 0 0 37-52.91a8 8 0 0 0-1.98-7.98m-44.64 48.11A88 88 0 0 1 65.66 67.11a89 89 0 0 1 31.4-26A106 106 0 0 0 96 56a104.11 104.11 0 0 0 104 104a106 106 0 0 0 14.92-1.06a89 89 0 0 1-26.02 31.4"},null,-1)])])}const Rq=Me({name:"ph-moon",render:Nq}),Fq={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Vq(t,e){return w(),R("svg",Fq,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M128 24a104 104 0 1 0 104 104A104.11 104.11 0 0 0 128 24m8 16.37a86.4 86.4 0 0 1 16 3v169.3a86.4 86.4 0 0 1-16 3Zm32 9.26a87.8 87.8 0 0 1 16 10.54v135.66a87.8 87.8 0 0 1-16 10.54ZM40 128a88.11 88.11 0 0 1 80-87.63v175.26A88.11 88.11 0 0 1 40 128m160 50.54V77.46a87.82 87.82 0 0 1 0 101.08"},null,-1)])])}const zq=Me({name:"ph-circle-half",render:Vq}),Hq={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Wq(t,e){return w(),R("svg",Hq,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M224 128a8 8 0 0 1-8 8H40a8 8 0 0 1 0-16h176a8 8 0 0 1 8 8M40 72h176a8 8 0 0 0 0-16H40a8 8 0 0 0 0 16m176 112H40a8 8 0 0 0 0 16h176a8 8 0 0 0 0-16"},null,-1)])])}const QA=Me({name:"ph-list",render:Wq}),JA="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2048.042969%2090.607422'%20width='48.042969'%20height='90.607422'%3e%3ctitle%3eBlueprint%20Chart%3c/title%3e%3cpath%20fill='%234B90CF'%20d='M%2020.042969%2034.607422%20A%2028%2028%200%200%201%2023.072266%2034.779297%20A%2028%2028%200%200%200%2020.042969%2034.607422%20z%20M%2023.34375%2034.810547%20A%2028%2028%200%200%201%2026.171875%2035.292969%20A%2028%2028%200%200%200%2023.34375%2034.810547%20z%20M%2016.570312%2034.84375%20A%2028%2028%200%200%200%2015.474609%2035.033203%20A%2028%2028%200%200%201%2016.570312%2034.84375%20z%20M%2026.390625%2035.341797%20A%2028%2028%200%200%201%2029.316406%2036.189453%20A%2028%2028%200%200%200%2026.390625%2035.341797%20z%20M%2013.128906%2035.511719%20A%2028%2028%200%200%200%2011.904297%2035.873047%20A%2028%2028%200%200%201%2013.128906%2035.511719%20z%20M%2029.373047%2036.210938%20A%2028%2028%200%200%201%2032.103516%2037.347656%20A%2028%2028%200%200%200%2029.373047%2036.210938%20z%20M%209.7832031%2036.609375%20A%2028%2028%200%200%200%208.5820312%2037.117188%20A%2028%2028%200%200%201%209.7832031%2036.609375%20z%20M%2032.392578%2037.486328%20A%2028%2028%200%200%201%2034.939453%2038.90625%20A%2028%2028%200%200%200%2032.392578%2037.486328%20z%20M%206.5742188%2038.128906%20A%2028%2028%200%200%200%205.4511719%2038.765625%20A%2028%2028%200%200%201%206.5742188%2038.128906%20z%20M%2035.041016%2038.966797%20A%2028%2028%200%200%201%2037.523438%2040.738281%20A%2028%2028%200%200%200%2035.041016%2038.966797%20z%20M%203.5273438%2040.080078%20A%2028%2028%200%200%200%202.5761719%2040.771484%20A%2028%2028%200%200%201%203.5273438%2040.080078%20z%20M%2037.658203%2040.851562%20A%2028%2028%200%200%201%2039.804688%2042.783203%20A%2028%2028%200%200%200%2037.658203%2040.851562%20z%20M%2040.011719%2042.990234%20A%2028%2028%200%200%201%2042.013672%2045.251953%20A%2028%2028%200%200%200%2040.011719%2042.990234%20z%20M%2042.013672%2045.251953%20A%2028%2028%200%200%201%2020.042969%2056%20A%2028%2028%200%200%201%2014.232422%2055.3125%20A%2016%2016%200%200%201%2016%2062.607422%20A%2016%2016%200%200%201%200%2078.607422%20L%200%2082.121094%20A%2028%2028%200%200%200%2020.042969%2090.607422%20A%2028%2028%200%200%200%2048.042969%2062.607422%20A%2028%2028%200%200%200%2042.013672%2045.251953%20z%20M%201.3007812%2046.667969%20A%2016%2016%200%200%201%201.6191406%2046.697266%20A%2016%2016%200%200%200%201.3007812%2046.667969%20z%20M%204.2558594%2047.189453%20A%2016%2016%200%200%201%204.4355469%2047.242188%20A%2016%2016%200%200%200%204.2558594%2047.189453%20z%20'/%3e%3cpath%20fill='%23163A65'%20d='M%206.0637516%2038.376047%20A%2028%2028%200%200%201%2020.042969%2034.615234%20A%2028%2028%200%200%201%2042.013672%2045.259765%20A%2028%2028%200%200%200%2048.042969%2028.007812%20A%2028%2028%200%200%200%2020.042969%200.0078125%20A%2028%2028%200%200%200%200%208.4941407%20L%200%2016.007812%20A%2012%2012%200%200%201%2012%2028.007812%20A%2012%2012%200%200%201%206.0613693%2038.364443%20'/%3e%3cpath%20fill='%23A3C9E8'%20d='M%2020.042969%2034.607422%20A%2028%2028%200%200%200%205.0878906%2038.970703%20A%2028%2028%200%200%201%206.0644531%2038.376953%20L%206.0605469%2038.365234%20A%2012%2012%200%200%201%200%2040.007812%20L%200%2043.09375%20L%200%2043.101562%20L%200%2046.607422%20A%2016%2016%200%200%201%202.8847656%2046.873047%20A%2016%2016%200%200%201%202.9199219%2046.878906%20A%2016%2016%200%200%201%205.7011719%2047.662109%20A%2016%2016%200%200%201%205.7324219%2047.673828%20A%2016%2016%200%200%201%208.3300781%2048.955078%20A%2016%2016%200%200%201%208.3398438%2048.958984%20A%2016%2016%200%200%201%208.3457031%2048.962891%20A%2016%2016%200%200%201%2010.662109%2050.6875%20A%2016%2016%200%200%201%2010.697266%2050.71875%20A%2016%2016%200%200%201%2012.660156%2052.837891%20A%2016%2016%200%200%201%2012.667969%2052.845703%20A%2016%2016%200%200%201%2012.673828%2052.855469%20A%2016%2016%200%200%201%2014.228516%2055.306641%20A%2016%2016%200%200%201%2014.232422%2055.3125%20A%2028%2028%200%200%200%2020.042969%2056%20A%2028%2028%200%200%200%2042.013672%2045.251953%20A%2028%2028%200%200%200%2020.042969%2034.607422%20z%20M%204.7695312%2039.177734%20A%2028%2028%200%200%200%202.5390625%2040.798828%20A%2028%2028%200%200%201%204.7695312%2039.177734%20z%20M%202.1816406%2041.091797%20A%2028%2028%200%200%200%200.11914062%2042.984375%20A%2028%2028%200%200%201%202.1816406%2041.091797%20z%20'/%3e%3c/svg%3e",eC="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2048.042969%2090.607422'%20width='48.042969'%20height='90.607422'%3e%3ctitle%3eBlueprint%20Chart%3c/title%3e%3cpath%20fill='%234B90CF'%20d='M%2020.042969%2034.607422%20A%2028%2028%200%200%201%2023.072266%2034.779297%20A%2028%2028%200%200%200%2020.042969%2034.607422%20z%20M%2023.34375%2034.810547%20A%2028%2028%200%200%201%2026.171875%2035.292969%20A%2028%2028%200%200%200%2023.34375%2034.810547%20z%20M%2016.570312%2034.84375%20A%2028%2028%200%200%200%2015.474609%2035.033203%20A%2028%2028%200%200%201%2016.570312%2034.84375%20z%20M%2026.390625%2035.341797%20A%2028%2028%200%200%201%2029.316406%2036.189453%20A%2028%2028%200%200%200%2026.390625%2035.341797%20z%20M%2013.128906%2035.511719%20A%2028%2028%200%200%200%2011.904297%2035.873047%20A%2028%2028%200%200%201%2013.128906%2035.511719%20z%20M%2029.373047%2036.210938%20A%2028%2028%200%200%201%2032.103516%2037.347656%20A%2028%2028%200%200%200%2029.373047%2036.210938%20z%20M%209.7832031%2036.609375%20A%2028%2028%200%200%200%208.5820312%2037.117188%20A%2028%2028%200%200%201%209.7832031%2036.609375%20z%20M%2032.392578%2037.486328%20A%2028%2028%200%200%201%2034.939453%2038.90625%20A%2028%2028%200%200%200%2032.392578%2037.486328%20z%20M%206.5742188%2038.128906%20A%2028%2028%200%200%200%205.4511719%2038.765625%20A%2028%2028%200%200%201%206.5742188%2038.128906%20z%20M%2035.041016%2038.966797%20A%2028%2028%200%200%201%2037.523438%2040.738281%20A%2028%2028%200%200%200%2035.041016%2038.966797%20z%20M%203.5273438%2040.080078%20A%2028%2028%200%200%200%202.5761719%2040.771484%20A%2028%2028%200%200%201%203.5273438%2040.080078%20z%20M%2037.658203%2040.851562%20A%2028%2028%200%200%201%2039.804688%2042.783203%20A%2028%2028%200%200%200%2037.658203%2040.851562%20z%20M%2040.011719%2042.990234%20A%2028%2028%200%200%201%2042.013672%2045.251953%20A%2028%2028%200%200%200%2040.011719%2042.990234%20z%20M%2042.013672%2045.251953%20A%2028%2028%200%200%201%2020.042969%2056%20A%2028%2028%200%200%201%2014.232422%2055.3125%20A%2016%2016%200%200%201%2016%2062.607422%20A%2016%2016%200%200%201%200%2078.607422%20L%200%2082.121094%20A%2028%2028%200%200%200%2020.042969%2090.607422%20A%2028%2028%200%200%200%2048.042969%2062.607422%20A%2028%2028%200%200%200%2042.013672%2045.251953%20z%20M%201.3007812%2046.667969%20A%2016%2016%200%200%201%201.6191406%2046.697266%20A%2016%2016%200%200%200%201.3007812%2046.667969%20z%20M%204.2558594%2047.189453%20A%2016%2016%200%200%201%204.4355469%2047.242188%20A%2016%2016%200%200%200%204.2558594%2047.189453%20z%20'/%3e%3cpath%20fill='%23163A65'%20d='M%206.0637516%2038.376047%20A%2028%2028%200%200%201%2020.042969%2034.615234%20A%2028%2028%200%200%201%2042.013672%2045.259765%20A%2028%2028%200%200%200%2048.042969%2028.007812%20A%2028%2028%200%200%200%2020.042969%200.0078125%20A%2028%2028%200%200%200%200%208.4941407%20L%200%2016.007812%20A%2012%2012%200%200%201%2012%2028.007812%20A%2012%2012%200%200%201%206.0613693%2038.364443%20'/%3e%3cpath%20fill='%23A3C9E8'%20d='M%2020.042969%2034.607422%20A%2028%2028%200%200%200%205.0878906%2038.970703%20A%2028%2028%200%200%201%206.0644531%2038.376953%20L%206.0605469%2038.365234%20A%2012%2012%200%200%201%200%2040.007812%20L%200%2043.09375%20L%200%2043.101562%20L%200%2046.607422%20A%2016%2016%200%200%201%202.8847656%2046.873047%20A%2016%2016%200%200%201%202.9199219%2046.878906%20A%2016%2016%200%200%201%205.7011719%2047.662109%20A%2016%2016%200%200%201%205.7324219%2047.673828%20A%2016%2016%200%200%201%208.3300781%2048.955078%20A%2016%2016%200%200%201%208.3398438%2048.958984%20A%2016%2016%200%200%201%208.3457031%2048.962891%20A%2016%2016%200%200%201%2010.662109%2050.6875%20A%2016%2016%200%200%201%2010.697266%2050.71875%20A%2016%2016%200%200%201%2012.660156%2052.837891%20A%2016%2016%200%200%201%2012.667969%2052.845703%20A%2016%2016%200%200%201%2012.673828%2052.855469%20A%2016%2016%200%200%201%2014.228516%2055.306641%20A%2016%2016%200%200%201%2014.232422%2055.3125%20A%2028%2028%200%200%200%2020.042969%2056%20A%2028%2028%200%200%200%2042.013672%2045.251953%20A%2028%2028%200%200%200%2020.042969%2034.607422%20z%20M%204.7695312%2039.177734%20A%2028%2028%200%200%200%202.5390625%2040.798828%20A%2028%2028%200%200%201%204.7695312%2039.177734%20z%20M%202.1816406%2041.091797%20A%2028%2028%200%200%200%200.11914062%2042.984375%20A%2028%2028%200%200%201%202.1816406%2041.091797%20z%20'/%3e%3c/svg%3e",Uq={class:"layout-navbar"},Gq={class:"layout-navbar__lead d-xl-none"},qq=le({__name:"LayoutNavbar",props:{sidebarOpen:{type:Boolean}},emits:["searchClick","toggleSidebar"],setup(t){const{theme:e,cycleTheme:n,resolvedTheme:o}=Tf(),{isNarrow:r}=gi(),i=ZA("k"),s={light:Eq,dark:Rq,auto:zq},a=A(()=>s[e.value]),l=A(()=>r.value?"Search…":"Search or jump to…"),c=A(()=>o.value==="dark"?eC:JA);return(u,d)=>(w(),R("header",Uq,[T("div",Gq,[H(p(Kn),{"icon-left":p(QA),label:"Open navigation","hide-label":"",square:"",size:"sm",variant:"outline-secondary","aria-haspopup":"dialog","aria-expanded":t.sidebarOpen?"true":"false","aria-controls":"layout-sidebar-offcanvas",onClick:d[0]||(d[0]=f=>u.$emit("toggleSidebar"))},null,8,["icon-left","aria-expanded"]),H(p(WA),{name:"Blueprint Chart","logo-src":c.value,to:"/"},null,8,["logo-src"])]),H(p(fU),{placeholder:l.value,"shortcut-label":p(i).keyLabel,collapsed:p(r),class:"layout-navbar__search",onClick:d[1]||(d[1]=f=>u.$emit("searchClick"))},null,8,["placeholder","shortcut-label","collapsed"]),d[2]||(d[2]=T("div",{class:"layout-navbar__spacer"},null,-1)),H(p(Kn),{"icon-left":a.value,label:"Toggle theme","hide-label":"",square:"",variant:"outline-secondary",size:"sm",class:"layout-navbar__theme",onClick:p(n)},null,8,["icon-left","onClick"])]))}}),Yq=Oe(qq,[["__scopeId","data-v-06653289"]]);var Le=(t=>(t.BarVertical="bar-vertical",t.BarHorizontal="bar-horizontal",t.BarMulti="bar-multi",t.ColumnStacked="column-stacked",t.BarStacked="bar-stacked",t.BarSplit="bar-split",t.BarGrouped="bar-grouped",t.Line="line",t.LineMulti="line-multi",t.Area="area",t.AreaStacked="area-stacked",t.Donut="donut",t.Pie="pie",t.VerticalBar="vertical-bar",t.HorizontalBar="horizontal-bar",t))(Le||{}),ri=(t=>(t.Left="left",t.Right="right",t))(ri||{}),ou=(t=>(t.Linear="linear",t.Log="log",t))(ou||{}),Gn=(t=>(t.Solid="solid",t.Dashed="dashed",t.Dotted="dotted",t.None="none",t))(Gn||{}),on=(t=>(t.Auto="auto",t.Inside="inside",t.Outside="outside",t.Off="off",t))(on||{}),Td=(t=>(t.Auto="auto",t.Horizontal="horizontal",t.Vertical="vertical",t))(Td||{}),En=(t=>(t.NW="NW",t.N="N",t.NE="NE",t.E="E",t.SE="SE",t.S="S",t.SW="SW",t.W="W",t.Center="center",t))(En||{}),So=(t=>(t.Direct="direct",t.CurveLeft="curve-left",t.CurveRight="curve-right",t.Elbow="elbow",t))(So||{}),Hp=(t=>(t.Solid="solid",t.Dotted="dotted",t.Dashed="dashed",t))(Hp||{}),Lt=(t=>(t.Point="point",t.Range="range",t.Free="free",t))(Lt||{}),tC=(t=>(t.Hide="hide",t.Show="show",t))(tC||{}),nC=(t=>(t.Start="start",t.Center="center",t.End="end",t))(nC||{}),jn=(t=>(t.Vertical="vertical",t.Horizontal="horizontal",t))(jn||{}),mr=(t=>(t.Circle="circle",t.Square="square",t.Diamond="diamond",t.Triangle="triangle",t.TriangleDown="triangleDown",t.Cross="cross",t.Star="star",t))(mr||{}),vr=(t=>(t.All="all",t.First="first",t.Last="last",t.FirstLast="firstLast",t))(vr||{}),Ro=(t=>(t.Filled="filled",t.Hollow="hollow",t))(Ro||{}),Qt=(t=>(t.Ascending="ascending",t.Descending="descending",t.None="none",t))(Qt||{}),li=(t=>(t.Total="total",t.WithinGroups="within-groups",t.None="none",t))(li||{}),kc=(t=>(t.Top="top",t.Bottom="bottom",t.Left="left",t.Right="right",t))(kc||{}),Ds=(t=>(t.Start="start",t.Middle="middle",t.End="end",t))(Ds||{}),yt=(t=>(t.Inside="inside",t.Outside="outside",t.Auto="auto",t))(yt||{}),Ao=(t=>(t.Both="both",t.Vertical="vertical",t.Horizontal="horizontal",t))(Ao||{}),ci=(t=>(t.Solid="solid",t.Dashed="dashed",t.Dotted="dotted",t))(ci||{}),Cl=(t=>(t.Normal="normal",t.Percent="percent",t))(Cl||{}),Ke=(t=>(t.Colors="colors",t.Boolean="boolean",t.Select="select",t.Text="text",t.NumberFormat="numberFormat",t.DateFormat="dateFormat",t))(Ke||{}),Co=(t=>(t.Off="",t.Auto="auto",t.Outside="outside",t.Inside="inside",t))(Co||{}),oi=(t=>(t.Linear="linear",t.MonotoneX="monotoneX",t.Step="step",t.StepBefore="stepBefore",t.StepAfter="stepAfter",t.Basis="basis",t.Cardinal="cardinal",t.CatmullRom="catmullRom",t))(oi||{});function jq(t){return t}var Zh=1,Qh=2,O1=3,ad=4,i8=1e-6;function Xq(t){return"translate("+t+",0)"}function Kq(t){return"translate(0,"+t+")"}function Zq(t){return e=>+t(e)}function Qq(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function Jq(){return!this.__axis}function Sm(t,e){var n=[],o=null,r=null,i=6,s=6,a=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,c=t===Zh||t===ad?-1:1,u=t===ad||t===Qh?"x":"y",d=t===Zh||t===O1?Xq:Kq;function f(h){var g=o??(e.ticks?e.ticks.apply(e,n):e.domain()),v=r??(e.tickFormat?e.tickFormat.apply(e,n):jq),m=Math.max(i,0)+a,b=e.range(),y=+b[0]+l,x=+b[b.length-1]+l,_=(e.bandwidth?Qq:Zq)(e.copy(),l),k=h.selection?h.selection():h,E=k.selectAll(".domain").data([null]),L=k.selectAll(".tick").data(g,e).order(),S=L.exit(),B=L.enter().append("g").attr("class","tick"),D=L.select("line"),N=L.select("text");E=E.merge(E.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),L=L.merge(B),D=D.merge(B.append("line").attr("stroke","currentColor").attr(u+"2",c*i)),N=N.merge(B.append("text").attr("fill","currentColor").attr(u,c*m).attr("dy",t===Zh?"0em":t===O1?"0.71em":"0.32em")),h!==k&&(E=E.transition(h),L=L.transition(h),D=D.transition(h),N=N.transition(h),S=S.transition(h).attr("opacity",i8).attr("transform",function(C){return isFinite(C=_(C))?d(C+l):this.getAttribute("transform")}),B.attr("opacity",i8).attr("transform",function(C){var M=this.parentNode.__axis;return d((M&&isFinite(M=M(C))?M:_(C))+l)})),S.remove(),E.attr("d",t===ad||t===Qh?s?"M"+c*s+","+y+"H"+l+"V"+x+"H"+c*s:"M"+l+","+y+"V"+x:s?"M"+y+","+c*s+"V"+l+"H"+x+"V"+c*s:"M"+y+","+l+"H"+x),L.attr("opacity",1).attr("transform",function(C){return d(_(C)+l)}),D.attr(u+"2",c*i),N.attr(u,c*m).text(v),k.filter(Jq).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===Qh?"start":t===ad?"end":"middle"),k.each(function(){this.__axis=_})}return f.scale=function(h){return arguments.length?(e=h,f):e},f.ticks=function(){return n=Array.from(arguments),f},f.tickArguments=function(h){return arguments.length?(n=h==null?[]:Array.from(h),f):n.slice()},f.tickValues=function(h){return arguments.length?(o=h==null?null:Array.from(h),f):o&&o.slice()},f.tickFormat=function(h){return arguments.length?(r=h,f):r},f.tickSize=function(h){return arguments.length?(i=s=+h,f):i},f.tickSizeInner=function(h){return arguments.length?(i=+h,f):i},f.tickSizeOuter=function(h){return arguments.length?(s=+h,f):s},f.tickPadding=function(h){return arguments.length?(a=+h,f):a},f.offset=function(h){return arguments.length?(l=+h,f):l},f}function eY(t){return Sm(Zh,t)}function s8(t){return Sm(Qh,t)}function tY(t){return Sm(O1,t)}function a8(t){return Sm(ad,t)}var nY={value:()=>{}};function Wy(){for(var t=0,e=arguments.length,n={},o;t<e;++t){if(!(o=arguments[t]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new Jh(n)}function Jh(t){this._=t}function oY(t,e){return t.trim().split(/^|\s+/).map(function(n){var o="",r=n.indexOf(".");if(r>=0&&(o=n.slice(r+1),n=n.slice(0,r)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}Jh.prototype=Wy.prototype={constructor:Jh,on:function(t,e){var n=this._,o=oY(t+"",n),r,i=-1,s=o.length;if(arguments.length<2){for(;++i<s;)if((r=(t=o[i]).type)&&(r=rY(n[r],t.name)))return r;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++i<s;)if(r=(t=o[i]).type)n[r]=l8(n[r],t.name,e);else if(e==null)for(r in n)n[r]=l8(n[r],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Jh(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var n=new Array(r),o=0,r,i;o<r;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=this._[t],o=0,r=i.length;o<r;++o)i[o].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)}};function rY(t,e){for(var n=0,o=t.length,r;n<o;++n)if((r=t[n]).name===e)return r.value}function l8(t,e,n){for(var o=0,r=t.length;o<r;++o)if(t[o].name===e){t[o]=nY,t=t.slice(0,o).concat(t.slice(o+1));break}return n!=null&&t.push({name:e,value:n}),t}var B1="http://www.w3.org/1999/xhtml";const c8={svg:"http://www.w3.org/2000/svg",xhtml:B1,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Am(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),c8.hasOwnProperty(e)?{space:c8[e],local:t}:t}function iY(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===B1&&e.documentElement.namespaceURI===B1?e.createElement(t):e.createElementNS(n,t)}}function sY(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function oC(t){var e=Am(t);return(e.local?sY:iY)(e)}function aY(){}function Uy(t){return t==null?aY:function(){return this.querySelector(t)}}function lY(t){typeof t!="function"&&(t=Uy(t));for(var e=this._groups,n=e.length,o=new Array(n),r=0;r<n;++r)for(var i=e[r],s=i.length,a=o[r]=new Array(s),l,c,u=0;u<s;++u)(l=i[u])&&(c=t.call(l,l.__data__,u,i))&&("__data__"in l&&(c.__data__=l.__data__),a[u]=c);return new Ar(o,this._parents)}function cY(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function uY(){return[]}function rC(t){return t==null?uY:function(){return this.querySelectorAll(t)}}function dY(t){return function(){return cY(t.apply(this,arguments))}}function fY(t){typeof t=="function"?t=dY(t):t=rC(t);for(var e=this._groups,n=e.length,o=[],r=[],i=0;i<n;++i)for(var s=e[i],a=s.length,l,c=0;c<a;++c)(l=s[c])&&(o.push(t.call(l,l.__data__,c,s)),r.push(l));return new Ar(o,r)}function iC(t){return function(){return this.matches(t)}}function sC(t){return function(e){return e.matches(t)}}var hY=Array.prototype.find;function pY(t){return function(){return hY.call(this.children,t)}}function mY(){return this.firstElementChild}function gY(t){return this.select(t==null?mY:pY(typeof t=="function"?t:sC(t)))}var vY=Array.prototype.filter;function bY(){return Array.from(this.children)}function yY(t){return function(){return vY.call(this.children,t)}}function xY(t){return this.selectAll(t==null?bY:yY(typeof t=="function"?t:sC(t)))}function wY(t){typeof t!="function"&&(t=iC(t));for(var e=this._groups,n=e.length,o=new Array(n),r=0;r<n;++r)for(var i=e[r],s=i.length,a=o[r]=[],l,c=0;c<s;++c)(l=i[c])&&t.call(l,l.__data__,c,i)&&a.push(l);return new Ar(o,this._parents)}function aC(t){return new Array(t.length)}function _Y(){return new Ar(this._enter||this._groups.map(aC),this._parents)}function Wp(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Wp.prototype={constructor:Wp,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function kY(t){return function(){return t}}function SY(t,e,n,o,r,i){for(var s=0,a,l=e.length,c=i.length;s<c;++s)(a=e[s])?(a.__data__=i[s],o[s]=a):n[s]=new Wp(t,i[s]);for(;s<l;++s)(a=e[s])&&(r[s]=a)}function AY(t,e,n,o,r,i,s){var a,l,c=new Map,u=e.length,d=i.length,f=new Array(u),h;for(a=0;a<u;++a)(l=e[a])&&(f[a]=h=s.call(l,l.__data__,a,e)+"",c.has(h)?r[a]=l:c.set(h,l));for(a=0;a<d;++a)h=s.call(t,i[a],a,i)+"",(l=c.get(h))?(o[a]=l,l.__data__=i[a],c.delete(h)):n[a]=new Wp(t,i[a]);for(a=0;a<u;++a)(l=e[a])&&c.get(f[a])===l&&(r[a]=l)}function CY(t){return t.__data__}function $Y(t,e){if(!arguments.length)return Array.from(this,CY);var n=e?AY:SY,o=this._parents,r=this._groups;typeof t!="function"&&(t=kY(t));for(var i=r.length,s=new Array(i),a=new Array(i),l=new Array(i),c=0;c<i;++c){var u=o[c],d=r[c],f=d.length,h=TY(t.call(u,u&&u.__data__,c,o)),g=h.length,v=a[c]=new Array(g),m=s[c]=new Array(g),b=l[c]=new Array(f);n(u,d,v,m,b,h,e);for(var y=0,x=0,_,k;y<g;++y)if(_=v[y]){for(y>=x&&(x=y+1);!(k=m[x])&&++x<g;);_._next=k||null}}return s=new Ar(s,o),s._enter=a,s._exit=l,s}function TY(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function MY(){return new Ar(this._exit||this._groups.map(aC),this._parents)}function OY(t,e,n){var o=this.enter(),r=this,i=this.exit();return typeof t=="function"?(o=t(o),o&&(o=o.selection())):o=o.append(t+""),e!=null&&(r=e(r),r&&(r=r.selection())),n==null?i.remove():n(i),o&&r?o.merge(r).order():r}function BY(t){for(var e=t.selection?t.selection():t,n=this._groups,o=e._groups,r=n.length,i=o.length,s=Math.min(r,i),a=new Array(r),l=0;l<s;++l)for(var c=n[l],u=o[l],d=c.length,f=a[l]=new Array(d),h,g=0;g<d;++g)(h=c[g]||u[g])&&(f[g]=h);for(;l<r;++l)a[l]=n[l];return new Ar(a,this._parents)}function LY(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var o=t[e],r=o.length-1,i=o[r],s;--r>=0;)(s=o[r])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function PY(t){t||(t=DY);function e(d,f){return d&&f?t(d.__data__,f.__data__):!d-!f}for(var n=this._groups,o=n.length,r=new Array(o),i=0;i<o;++i){for(var s=n[i],a=s.length,l=r[i]=new Array(a),c,u=0;u<a;++u)(c=s[u])&&(l[u]=c);l.sort(e)}return new Ar(r,this._parents).order()}function DY(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function EY(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function IY(){return Array.from(this)}function NY(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o=t[e],r=0,i=o.length;r<i;++r){var s=o[r];if(s)return s}return null}function RY(){let t=0;for(const e of this)++t;return t}function FY(){return!this.node()}function VY(t){for(var e=this._groups,n=0,o=e.length;n<o;++n)for(var r=e[n],i=0,s=r.length,a;i<s;++i)(a=r[i])&&t.call(a,a.__data__,i,r);return this}function zY(t){return function(){this.removeAttribute(t)}}function HY(t){return function(){this.removeAttributeNS(t.space,t.local)}}function WY(t,e){return function(){this.setAttribute(t,e)}}function UY(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function GY(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function qY(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function YY(t,e){var n=Am(t);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((e==null?n.local?HY:zY:typeof e=="function"?n.local?qY:GY:n.local?UY:WY)(n,e))}function lC(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function jY(t){return function(){this.style.removeProperty(t)}}function XY(t,e,n){return function(){this.style.setProperty(t,e,n)}}function KY(t,e,n){return function(){var o=e.apply(this,arguments);o==null?this.style.removeProperty(t):this.style.setProperty(t,o,n)}}function ZY(t,e,n){return arguments.length>1?this.each((e==null?jY:typeof e=="function"?KY:XY)(t,e,n??"")):ru(this.node(),t)}function ru(t,e){return t.style.getPropertyValue(e)||lC(t).getComputedStyle(t,null).getPropertyValue(e)}function QY(t){return function(){delete this[t]}}function JY(t,e){return function(){this[t]=e}}function ej(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function tj(t,e){return arguments.length>1?this.each((e==null?QY:typeof e=="function"?ej:JY)(t,e)):this.node()[t]}function cC(t){return t.trim().split(/^|\s+/)}function Gy(t){return t.classList||new uC(t)}function uC(t){this._node=t,this._names=cC(t.getAttribute("class")||"")}uC.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function dC(t,e){for(var n=Gy(t),o=-1,r=e.length;++o<r;)n.add(e[o])}function fC(t,e){for(var n=Gy(t),o=-1,r=e.length;++o<r;)n.remove(e[o])}function nj(t){return function(){dC(this,t)}}function oj(t){return function(){fC(this,t)}}function rj(t,e){return function(){(e.apply(this,arguments)?dC:fC)(this,t)}}function ij(t,e){var n=cC(t+"");if(arguments.length<2){for(var o=Gy(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each((typeof e=="function"?rj:e?nj:oj)(n,e))}function sj(){this.textContent=""}function aj(t){return function(){this.textContent=t}}function lj(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function cj(t){return arguments.length?this.each(t==null?sj:(typeof t=="function"?lj:aj)(t)):this.node().textContent}function uj(){this.innerHTML=""}function dj(t){return function(){this.innerHTML=t}}function fj(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function hj(t){return arguments.length?this.each(t==null?uj:(typeof t=="function"?fj:dj)(t)):this.node().innerHTML}function pj(){this.nextSibling&&this.parentNode.appendChild(this)}function mj(){return this.each(pj)}function gj(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function vj(){return this.each(gj)}function bj(t){var e=typeof t=="function"?t:oC(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function yj(){return null}function xj(t,e){var n=typeof t=="function"?t:oC(t),o=e==null?yj:typeof e=="function"?e:Uy(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function wj(){var t=this.parentNode;t&&t.removeChild(this)}function _j(){return this.each(wj)}function kj(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Sj(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Aj(t){return this.select(t?Sj:kj)}function Cj(t){return arguments.length?this.property("__data__",t):this.node().__data__}function $j(t){return function(e){t.call(this,e,this.__data__)}}function Tj(t){return t.trim().split(/^|\s+/).map(function(e){var n="",o=e.indexOf(".");return o>=0&&(n=e.slice(o+1),e=e.slice(0,o)),{type:e,name:n}})}function Mj(t){return function(){var e=this.__on;if(e){for(var n=0,o=-1,r=e.length,i;n<r;++n)i=e[n],(!t.type||i.type===t.type)&&i.name===t.name?this.removeEventListener(i.type,i.listener,i.options):e[++o]=i;++o?e.length=o:delete this.__on}}}function Oj(t,e,n){return function(){var o=this.__on,r,i=$j(e);if(o){for(var s=0,a=o.length;s<a;++s)if((r=o[s]).type===t.type&&r.name===t.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=e;return}}this.addEventListener(t.type,i,n),r={type:t.type,name:t.name,value:e,listener:i,options:n},o?o.push(r):this.__on=[r]}}function Bj(t,e,n){var o=Tj(t+""),r,i=o.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,c=a.length,u;l<c;++l)for(r=0,u=a[l];r<i;++r)if((s=o[r]).type===u.type&&s.name===u.name)return u.value}return}for(a=e?Oj:Mj,r=0;r<i;++r)this.each(a(o[r],e,n));return this}function hC(t,e,n){var o=lC(t),r=o.CustomEvent;typeof r=="function"?r=new r(e,n):(r=o.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function Lj(t,e){return function(){return hC(this,t,e)}}function Pj(t,e){return function(){return hC(this,t,e.apply(this,arguments))}}function Dj(t,e){return this.each((typeof e=="function"?Pj:Lj)(t,e))}function*Ej(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o=t[e],r=0,i=o.length,s;r<i;++r)(s=o[r])&&(yield s)}var pC=[null];function Ar(t,e){this._groups=t,this._parents=e}function xu(){return new Ar([[document.documentElement]],pC)}function Ij(){return this}Ar.prototype=xu.prototype={constructor:Ar,select:lY,selectAll:fY,selectChild:gY,selectChildren:xY,filter:wY,data:$Y,enter:_Y,exit:MY,join:OY,merge:BY,selection:Ij,order:LY,sort:PY,call:EY,nodes:IY,node:NY,size:RY,empty:FY,each:VY,attr:YY,style:ZY,property:tj,classed:ij,text:cj,html:hj,raise:mj,lower:vj,append:bj,insert:xj,remove:_j,clone:Aj,datum:Cj,on:Bj,dispatch:Dj,[Symbol.iterator]:Ej};function Ae(t){return typeof t=="string"?new Ar([[document.querySelector(t)]],[document.documentElement]):new Ar([[t]],pC)}function Nj(t){let e;for(;e=t.sourceEvent;)t=e;return t}function Rj(t,e){if(t=Nj(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=t.clientX,o.y=t.clientY,o=o.matrixTransform(e.getScreenCTM().inverse()),[o.x,o.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}function qy(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function mC(t,e){var n=Object.create(t.prototype);for(var o in e)n[o]=e[o];return n}function Mf(){}var Qd=.7,Up=1/Qd,Ec="\\s*([+-]?\\d+)\\s*",Jd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ts="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Fj=/^#([0-9a-f]{3,8})$/,Vj=new RegExp(`^rgb\\(${Ec},${Ec},${Ec}\\)$`),zj=new RegExp(`^rgb\\(${ts},${ts},${ts}\\)$`),Hj=new RegExp(`^rgba\\(${Ec},${Ec},${Ec},${Jd}\\)$`),Wj=new RegExp(`^rgba\\(${ts},${ts},${ts},${Jd}\\)$`),Uj=new RegExp(`^hsl\\(${Jd},${ts},${ts}\\)$`),Gj=new RegExp(`^hsla\\(${Jd},${ts},${ts},${Jd}\\)$`),u8={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};qy(Mf,Nl,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:d8,formatHex:d8,formatHex8:qj,formatHsl:Yj,formatRgb:f8,toString:f8});function d8(){return this.rgb().formatHex()}function qj(){return this.rgb().formatHex8()}function Yj(){return gC(this).formatHsl()}function f8(){return this.rgb().formatRgb()}function Nl(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Fj.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?h8(e):n===3?new ir(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?ah(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?ah(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Vj.exec(t))?new ir(e[1],e[2],e[3],1):(e=zj.exec(t))?new ir(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Hj.exec(t))?ah(e[1],e[2],e[3],e[4]):(e=Wj.exec(t))?ah(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Uj.exec(t))?g8(e[1],e[2]/100,e[3]/100,1):(e=Gj.exec(t))?g8(e[1],e[2]/100,e[3]/100,e[4]):u8.hasOwnProperty(t)?h8(u8[t]):t==="transparent"?new ir(NaN,NaN,NaN,0):null}function h8(t){return new ir(t>>16&255,t>>8&255,t&255,1)}function ah(t,e,n,o){return o<=0&&(t=e=n=NaN),new ir(t,e,n,o)}function jj(t){return t instanceof Mf||(t=Nl(t)),t?(t=t.rgb(),new ir(t.r,t.g,t.b,t.opacity)):new ir}function L1(t,e,n,o){return arguments.length===1?jj(t):new ir(t,e,n,o??1)}function ir(t,e,n,o){this.r=+t,this.g=+e,this.b=+n,this.opacity=+o}qy(ir,L1,mC(Mf,{brighter(t){return t=t==null?Up:Math.pow(Up,t),new ir(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Qd:Math.pow(Qd,t),new ir(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ir($l(this.r),$l(this.g),$l(this.b),Gp(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:p8,formatHex:p8,formatHex8:Xj,formatRgb:m8,toString:m8}));function p8(){return`#${xl(this.r)}${xl(this.g)}${xl(this.b)}`}function Xj(){return`#${xl(this.r)}${xl(this.g)}${xl(this.b)}${xl((isNaN(this.opacity)?1:this.opacity)*255)}`}function m8(){const t=Gp(this.opacity);return`${t===1?"rgb(":"rgba("}${$l(this.r)}, ${$l(this.g)}, ${$l(this.b)}${t===1?")":`, ${t})`}`}function Gp(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function $l(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function xl(t){return t=$l(t),(t<16?"0":"")+t.toString(16)}function g8(t,e,n,o){return o<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new ii(t,e,n,o)}function gC(t){if(t instanceof ii)return new ii(t.h,t.s,t.l,t.opacity);if(t instanceof Mf||(t=Nl(t)),!t)return new ii;if(t instanceof ii)return t;t=t.rgb();var e=t.r/255,n=t.g/255,o=t.b/255,r=Math.min(e,n,o),i=Math.max(e,n,o),s=NaN,a=i-r,l=(i+r)/2;return a?(e===i?s=(n-o)/a+(n<o)*6:n===i?s=(o-e)/a+2:s=(e-n)/a+4,a/=l<.5?i+r:2-i-r,s*=60):a=l>0&&l<1?0:s,new ii(s,a,l,t.opacity)}function Kj(t,e,n,o){return arguments.length===1?gC(t):new ii(t,e,n,o??1)}function ii(t,e,n,o){this.h=+t,this.s=+e,this.l=+n,this.opacity=+o}qy(ii,Kj,mC(Mf,{brighter(t){return t=t==null?Up:Math.pow(Up,t),new ii(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Qd:Math.pow(Qd,t),new ii(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*e,r=2*n-o;return new ir(sv(t>=240?t-240:t+120,r,o),sv(t,r,o),sv(t<120?t+240:t-120,r,o),this.opacity)},clamp(){return new ii(v8(this.h),lh(this.s),lh(this.l),Gp(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Gp(this.opacity);return`${t===1?"hsl(":"hsla("}${v8(this.h)}, ${lh(this.s)*100}%, ${lh(this.l)*100}%${t===1?")":`, ${t})`}`}}));function v8(t){return t=(t||0)%360,t<0?t+360:t}function lh(t){return Math.max(0,Math.min(1,t||0))}function sv(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const Yy=t=>()=>t;function Zj(t,e){return function(n){return t+n*e}}function Qj(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(o){return Math.pow(t+o*e,n)}}function Jj(t){return(t=+t)==1?vC:function(e,n){return n-e?Qj(e,n,t):Yy(isNaN(e)?n:e)}}function vC(t,e){var n=e-t;return n?Zj(t,n):Yy(isNaN(t)?e:t)}const qp=(function t(e){var n=Jj(e);function o(r,i){var s=n((r=L1(r)).r,(i=L1(i)).r),a=n(r.g,i.g),l=n(r.b,i.b),c=vC(r.opacity,i.opacity);return function(u){return r.r=s(u),r.g=a(u),r.b=l(u),r.opacity=c(u),r+""}}return o.gamma=t,o})(1);function eX(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,o=e.slice(),r;return function(i){for(r=0;r<n;++r)o[r]=t[r]*(1-i)+e[r]*i;return o}}function tX(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function nX(t,e){var n=e?e.length:0,o=t?Math.min(n,t.length):0,r=new Array(o),i=new Array(n),s;for(s=0;s<o;++s)r[s]=jy(t[s],e[s]);for(;s<n;++s)i[s]=e[s];return function(a){for(s=0;s<o;++s)i[s]=r[s](a);return i}}function oX(t,e){var n=new Date;return t=+t,e=+e,function(o){return n.setTime(t*(1-o)+e*o),n}}function oo(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Md(t,e){var n={},o={},r;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(r in e)r in t?n[r]=jy(t[r],e[r]):o[r]=e[r];return function(i){for(r in n)o[r]=n[r](i);return o}}var P1=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,av=new RegExp(P1.source,"g");function rX(t){return function(){return t}}function iX(t){return function(e){return t(e)+""}}function bC(t,e){var n=P1.lastIndex=av.lastIndex=0,o,r,i,s=-1,a=[],l=[];for(t=t+"",e=e+"";(o=P1.exec(t))&&(r=av.exec(e));)(i=r.index)>n&&(i=e.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(o=o[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,l.push({i:s,x:oo(o,r)})),n=av.lastIndex;return n<e.length&&(i=e.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?iX(l[0].x):rX(e):(e=l.length,function(c){for(var u=0,d;u<e;++u)a[(d=l[u]).i]=d.x(c);return a.join("")})}function jy(t,e){var n=typeof e,o;return e==null||n==="boolean"?Yy(e):(n==="number"?oo:n==="string"?(o=Nl(e))?(e=o,qp):bC:e instanceof Nl?qp:e instanceof Date?oX:tX(e)?eX:Array.isArray(e)?nX:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Md:oo)(t,e)}function sX(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var b8=180/Math.PI,D1={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function yC(t,e,n,o,r,i){var s,a,l;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(l=t*n+e*o)&&(n-=t*l,o-=e*l),(a=Math.sqrt(n*n+o*o))&&(n/=a,o/=a,l/=a),t*o<e*n&&(t=-t,e=-e,l=-l,s=-s),{translateX:r,translateY:i,rotate:Math.atan2(e,t)*b8,skewX:Math.atan(l)*b8,scaleX:s,scaleY:a}}var ch;function aX(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?D1:yC(e.a,e.b,e.c,e.d,e.e,e.f)}function lX(t){return t==null||(ch||(ch=document.createElementNS("http://www.w3.org/2000/svg","g")),ch.setAttribute("transform",t),!(t=ch.transform.baseVal.consolidate()))?D1:(t=t.matrix,yC(t.a,t.b,t.c,t.d,t.e,t.f))}function xC(t,e,n,o){function r(c){return c.length?c.pop()+" ":""}function i(c,u,d,f,h,g){if(c!==d||u!==f){var v=h.push("translate(",null,e,null,n);g.push({i:v-4,x:oo(c,d)},{i:v-2,x:oo(u,f)})}else(d||f)&&h.push("translate("+d+e+f+n)}function s(c,u,d,f){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),f.push({i:d.push(r(d)+"rotate(",null,o)-2,x:oo(c,u)})):u&&d.push(r(d)+"rotate("+u+o)}function a(c,u,d,f){c!==u?f.push({i:d.push(r(d)+"skewX(",null,o)-2,x:oo(c,u)}):u&&d.push(r(d)+"skewX("+u+o)}function l(c,u,d,f,h,g){if(c!==d||u!==f){var v=h.push(r(h)+"scale(",null,",",null,")");g.push({i:v-4,x:oo(c,d)},{i:v-2,x:oo(u,f)})}else(d!==1||f!==1)&&h.push(r(h)+"scale("+d+","+f+")")}return function(c,u){var d=[],f=[];return c=t(c),u=t(u),i(c.translateX,c.translateY,u.translateX,u.translateY,d,f),s(c.rotate,u.rotate,d,f),a(c.skewX,u.skewX,d,f),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,f),c=u=null,function(h){for(var g=-1,v=f.length,m;++g<v;)d[(m=f[g]).i]=m.x(h);return d.join("")}}}var cX=xC(aX,"px, ","px)","deg)"),uX=xC(lX,", ",")",")"),iu=0,ld=0,Ku=0,wC=1e3,Yp,cd,jp=0,Rl=0,Cm=0,ef=typeof performance=="object"&&performance.now?performance:Date,_C=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Xy(){return Rl||(_C(dX),Rl=ef.now()+Cm)}function dX(){Rl=0}function Xp(){this._call=this._time=this._next=null}Xp.prototype=kC.prototype={constructor:Xp,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Xy():+n)+(e==null?0:+e),!this._next&&cd!==this&&(cd?cd._next=this:Yp=this,cd=this),this._call=t,this._time=n,E1()},stop:function(){this._call&&(this._call=null,this._time=1/0,E1())}};function kC(t,e,n){var o=new Xp;return o.restart(t,e,n),o}function fX(){Xy(),++iu;for(var t=Yp,e;t;)(e=Rl-t._time)>=0&&t._call.call(void 0,e),t=t._next;--iu}function y8(){Rl=(jp=ef.now())+Cm,iu=ld=0;try{fX()}finally{iu=0,pX(),Rl=0}}function hX(){var t=ef.now(),e=t-jp;e>wC&&(Cm-=e,jp=t)}function pX(){for(var t,e=Yp,n,o=1/0;e;)e._call?(o>e._time&&(o=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Yp=n);cd=t,E1(o)}function E1(t){if(!iu){ld&&(ld=clearTimeout(ld));var e=t-Rl;e>24?(t<1/0&&(ld=setTimeout(y8,t-ef.now()-Cm)),Ku&&(Ku=clearInterval(Ku))):(Ku||(jp=ef.now(),Ku=setInterval(hX,wC)),iu=1,_C(y8))}}function x8(t,e,n){var o=new Xp;return e=e==null?0:+e,o.restart(r=>{o.stop(),t(r+e)},e,n),o}var mX=Wy("start","end","cancel","interrupt"),gX=[],SC=0,w8=1,I1=2,ep=3,_8=4,N1=5,tp=6;function $m(t,e,n,o,r,i){var s=t.__transition;if(!s)t.__transition={};else if(n in s)return;vX(t,n,{name:e,index:o,group:r,on:mX,tween:gX,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:SC})}function Ky(t,e){var n=Bi(t,e);if(n.state>SC)throw new Error("too late; already scheduled");return n}function fs(t,e){var n=Bi(t,e);if(n.state>ep)throw new Error("too late; already running");return n}function Bi(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function vX(t,e,n){var o=t.__transition,r;o[e]=n,n.timer=kC(i,0,n.time);function i(c){n.state=w8,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var u,d,f,h;if(n.state!==w8)return l();for(u in o)if(h=o[u],h.name===n.name){if(h.state===ep)return x8(s);h.state===_8?(h.state=tp,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete o[u]):+u<e&&(h.state=tp,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete o[u])}if(x8(function(){n.state===ep&&(n.state=_8,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=I1,n.on.call("start",t,t.__data__,n.index,n.group),n.state===I1){for(n.state=ep,r=new Array(f=n.tween.length),u=0,d=-1;u<f;++u)(h=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(r[++d]=h);r.length=d+1}}function a(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=N1,1),d=-1,f=r.length;++d<f;)r[d].call(t,u);n.state===N1&&(n.on.call("end",t,t.__data__,n.index,n.group),l())}function l(){n.state=tp,n.timer.stop(),delete o[e];for(var c in o)return;delete t.__transition}}function bX(t,e){var n=t.__transition,o,r,i=!0,s;if(n){e=e==null?null:e+"";for(s in n){if((o=n[s]).name!==e){i=!1;continue}r=o.state>I1&&o.state<N1,o.state=tp,o.timer.stop(),o.on.call(r?"interrupt":"cancel",t,t.__data__,o.index,o.group),delete n[s]}i&&delete t.__transition}}function yX(t){return this.each(function(){bX(this,t)})}function xX(t,e){var n,o;return function(){var r=fs(this,t),i=r.tween;if(i!==n){o=n=i;for(var s=0,a=o.length;s<a;++s)if(o[s].name===e){o=o.slice(),o.splice(s,1);break}}r.tween=o}}function wX(t,e,n){var o,r;if(typeof n!="function")throw new Error;return function(){var i=fs(this,t),s=i.tween;if(s!==o){r=(o=s).slice();for(var a={name:e,value:n},l=0,c=r.length;l<c;++l)if(r[l].name===e){r[l]=a;break}l===c&&r.push(a)}i.tween=r}}function _X(t,e){var n=this._id;if(t+="",arguments.length<2){for(var o=Bi(this.node(),n).tween,r=0,i=o.length,s;r<i;++r)if((s=o[r]).name===t)return s.value;return null}return this.each((e==null?xX:wX)(n,t,e))}function Zy(t,e,n){var o=t._id;return t.each(function(){var r=fs(this,o);(r.value||(r.value={}))[e]=n.apply(this,arguments)}),function(r){return Bi(r,o).value[e]}}function AC(t,e){var n;return(typeof e=="number"?oo:e instanceof Nl?qp:(n=Nl(e))?(e=n,qp):bC)(t,e)}function kX(t){return function(){this.removeAttribute(t)}}function SX(t){return function(){this.removeAttributeNS(t.space,t.local)}}function AX(t,e,n){var o,r=n+"",i;return function(){var s=this.getAttribute(t);return s===r?null:s===o?i:i=e(o=s,n)}}function CX(t,e,n){var o,r=n+"",i;return function(){var s=this.getAttributeNS(t.space,t.local);return s===r?null:s===o?i:i=e(o=s,n)}}function $X(t,e,n){var o,r,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(t):(s=this.getAttribute(t),l=a+"",s===l?null:s===o&&l===r?i:(r=l,i=e(o=s,a)))}}function TX(t,e,n){var o,r,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(t.space,t.local):(s=this.getAttributeNS(t.space,t.local),l=a+"",s===l?null:s===o&&l===r?i:(r=l,i=e(o=s,a)))}}function MX(t,e){var n=Am(t),o=n==="transform"?uX:AC;return this.attrTween(t,typeof e=="function"?(n.local?TX:$X)(n,o,Zy(this,"attr."+t,e)):e==null?(n.local?SX:kX)(n):(n.local?CX:AX)(n,o,e))}function OX(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function BX(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function LX(t,e){var n,o;function r(){var i=e.apply(this,arguments);return i!==o&&(n=(o=i)&&BX(t,i)),n}return r._value=e,r}function PX(t,e){var n,o;function r(){var i=e.apply(this,arguments);return i!==o&&(n=(o=i)&&OX(t,i)),n}return r._value=e,r}function DX(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var o=Am(t);return this.tween(n,(o.local?LX:PX)(o,e))}function EX(t,e){return function(){Ky(this,t).delay=+e.apply(this,arguments)}}function IX(t,e){return e=+e,function(){Ky(this,t).delay=e}}function NX(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?EX:IX)(e,t)):Bi(this.node(),e).delay}function RX(t,e){return function(){fs(this,t).duration=+e.apply(this,arguments)}}function FX(t,e){return e=+e,function(){fs(this,t).duration=e}}function VX(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?RX:FX)(e,t)):Bi(this.node(),e).duration}function zX(t,e){if(typeof e!="function")throw new Error;return function(){fs(this,t).ease=e}}function HX(t){var e=this._id;return arguments.length?this.each(zX(e,t)):Bi(this.node(),e).ease}function WX(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;fs(this,t).ease=n}}function UX(t){if(typeof t!="function")throw new Error;return this.each(WX(this._id,t))}function GX(t){typeof t!="function"&&(t=iC(t));for(var e=this._groups,n=e.length,o=new Array(n),r=0;r<n;++r)for(var i=e[r],s=i.length,a=o[r]=[],l,c=0;c<s;++c)(l=i[c])&&t.call(l,l.__data__,c,i)&&a.push(l);return new Ys(o,this._parents,this._name,this._id)}function qX(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,o=e.length,r=n.length,i=Math.min(o,r),s=new Array(o),a=0;a<i;++a)for(var l=e[a],c=n[a],u=l.length,d=s[a]=new Array(u),f,h=0;h<u;++h)(f=l[h]||c[h])&&(d[h]=f);for(;a<o;++a)s[a]=e[a];return new Ys(s,this._parents,this._name,this._id)}function YX(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function jX(t,e,n){var o,r,i=YX(e)?Ky:fs;return function(){var s=i(this,t),a=s.on;a!==o&&(r=(o=a).copy()).on(e,n),s.on=r}}function XX(t,e){var n=this._id;return arguments.length<2?Bi(this.node(),n).on.on(t):this.each(jX(n,t,e))}function KX(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function ZX(){return this.on("end.remove",KX(this._id))}function QX(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Uy(t));for(var o=this._groups,r=o.length,i=new Array(r),s=0;s<r;++s)for(var a=o[s],l=a.length,c=i[s]=new Array(l),u,d,f=0;f<l;++f)(u=a[f])&&(d=t.call(u,u.__data__,f,a))&&("__data__"in u&&(d.__data__=u.__data__),c[f]=d,$m(c[f],e,n,f,c,Bi(u,n)));return new Ys(i,this._parents,e,n)}function JX(t){var e=this._name,n=this._id;typeof t!="function"&&(t=rC(t));for(var o=this._groups,r=o.length,i=[],s=[],a=0;a<r;++a)for(var l=o[a],c=l.length,u,d=0;d<c;++d)if(u=l[d]){for(var f=t.call(u,u.__data__,d,l),h,g=Bi(u,n),v=0,m=f.length;v<m;++v)(h=f[v])&&$m(h,e,n,v,f,g);i.push(f),s.push(u)}return new Ys(i,s,e,n)}var eK=xu.prototype.constructor;function tK(){return new eK(this._groups,this._parents)}function nK(t,e){var n,o,r;return function(){var i=ru(this,t),s=(this.style.removeProperty(t),ru(this,t));return i===s?null:i===n&&s===o?r:r=e(n=i,o=s)}}function CC(t){return function(){this.style.removeProperty(t)}}function oK(t,e,n){var o,r=n+"",i;return function(){var s=ru(this,t);return s===r?null:s===o?i:i=e(o=s,n)}}function rK(t,e,n){var o,r,i;return function(){var s=ru(this,t),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(t),ru(this,t))),s===l?null:s===o&&l===r?i:(r=l,i=e(o=s,a))}}function iK(t,e){var n,o,r,i="style."+e,s="end."+i,a;return function(){var l=fs(this,t),c=l.on,u=l.value[i]==null?a||(a=CC(e)):void 0;(c!==n||r!==u)&&(o=(n=c).copy()).on(s,r=u),l.on=o}}function sK(t,e,n){var o=(t+="")=="transform"?cX:AC;return e==null?this.styleTween(t,nK(t,o)).on("end.style."+t,CC(t)):typeof e=="function"?this.styleTween(t,rK(t,o,Zy(this,"style."+t,e))).each(iK(this._id,t)):this.styleTween(t,oK(t,o,e),n).on("end.style."+t,null)}function aK(t,e,n){return function(o){this.style.setProperty(t,e.call(this,o),n)}}function lK(t,e,n){var o,r;function i(){var s=e.apply(this,arguments);return s!==r&&(o=(r=s)&&aK(t,s,n)),o}return i._value=e,i}function cK(t,e,n){var o="style."+(t+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(e==null)return this.tween(o,null);if(typeof e!="function")throw new Error;return this.tween(o,lK(t,e,n??""))}function uK(t){return function(){this.textContent=t}}function dK(t){return function(){var e=t(this);this.textContent=e??""}}function fK(t){return this.tween("text",typeof t=="function"?dK(Zy(this,"text",t)):uK(t==null?"":t+""))}function hK(t){return function(e){this.textContent=t.call(this,e)}}function pK(t){var e,n;function o(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&hK(r)),e}return o._value=t,o}function mK(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,pK(t))}function gK(){for(var t=this._name,e=this._id,n=TC(),o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,l,c=0;c<a;++c)if(l=s[c]){var u=Bi(l,e);$m(l,t,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Ys(o,this._parents,t,n)}function vK(){var t,e,n=this,o=n._id,r=n.size();return new Promise(function(i,s){var a={value:s},l={value:function(){--r===0&&i()}};n.each(function(){var c=fs(this,o),u=c.on;u!==t&&(e=(t=u).copy(),e._.cancel.push(a),e._.interrupt.push(a),e._.end.push(l)),c.on=e}),r===0&&i()})}var bK=0;function Ys(t,e,n,o){this._groups=t,this._parents=e,this._name=n,this._id=o}function $C(t){return xu().transition(t)}function TC(){return++bK}var ys=xu.prototype;Ys.prototype=$C.prototype={constructor:Ys,select:QX,selectAll:JX,selectChild:ys.selectChild,selectChildren:ys.selectChildren,filter:GX,merge:qX,selection:tK,transition:gK,call:ys.call,nodes:ys.nodes,node:ys.node,size:ys.size,empty:ys.empty,each:ys.each,on:XX,attr:MX,attrTween:DX,style:sK,styleTween:cK,text:fK,textTween:mK,remove:ZX,tween:_X,delay:NX,duration:VX,ease:HX,easeVarying:UX,end:vK,[Symbol.iterator]:ys[Symbol.iterator]};function uh(t){return--t*t*t+1}function Kp(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var yK={time:null,delay:0,duration:250,ease:Kp};function xK(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function wK(t){var e,n;t instanceof Ys?(e=t._id,t=t._name):(e=TC(),(n=yK).time=Xy(),t=t==null?null:t+"");for(var o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,l,c=0;c<a;++c)(l=s[c])&&$m(l,t,e,c,s,n||xK(l,e));return new Ys(o,this._parents,t,e)}xu.prototype.interrupt=yX;xu.prototype.transition=wK;const R1=Math.PI,F1=2*R1,pl=1e-6,_K=F1-pl;function MC(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function kK(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return MC;const n=10**e;return function(o){this._+=o[0];for(let r=1,i=o.length;r<i;++r)this._+=Math.round(arguments[r]*n)/n+o[r]}}class SK{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?MC:kK(e)}moveTo(e,n){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,n){this._append`L${this._x1=+e},${this._y1=+n}`}quadraticCurveTo(e,n,o,r){this._append`Q${+e},${+n},${this._x1=+o},${this._y1=+r}`}bezierCurveTo(e,n,o,r,i,s){this._append`C${+e},${+n},${+o},${+r},${this._x1=+i},${this._y1=+s}`}arcTo(e,n,o,r,i){if(e=+e,n=+n,o=+o,r=+r,i=+i,i<0)throw new Error(`negative radius: ${i}`);let s=this._x1,a=this._y1,l=o-e,c=r-n,u=s-e,d=a-n,f=u*u+d*d;if(this._x1===null)this._append`M${this._x1=e},${this._y1=n}`;else if(f>pl)if(!(Math.abs(d*l-c*u)>pl)||!i)this._append`L${this._x1=e},${this._y1=n}`;else{let h=o-s,g=r-a,v=l*l+c*c,m=h*h+g*g,b=Math.sqrt(v),y=Math.sqrt(f),x=i*Math.tan((R1-Math.acos((v+f-m)/(2*b*y)))/2),_=x/y,k=x/b;Math.abs(_-1)>pl&&this._append`L${e+_*u},${n+_*d}`,this._append`A${i},${i},0,0,${+(d*h>u*g)},${this._x1=e+k*l},${this._y1=n+k*c}`}}arc(e,n,o,r,i,s){if(e=+e,n=+n,o=+o,s=!!s,o<0)throw new Error(`negative radius: ${o}`);let a=o*Math.cos(r),l=o*Math.sin(r),c=e+a,u=n+l,d=1^s,f=s?r-i:i-r;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>pl||Math.abs(this._y1-u)>pl)&&this._append`L${c},${u}`,o&&(f<0&&(f=f%F1+F1),f>_K?this._append`A${o},${o},0,1,${d},${e-a},${n-l}A${o},${o},0,1,${d},${this._x1=c},${this._y1=u}`:f>pl&&this._append`A${o},${o},0,${+(f>=R1)},${d},${this._x1=e+o*Math.cos(i)},${this._y1=n+o*Math.sin(i)}`)}rect(e,n,o,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${o=+o}v${+r}h${-o}Z`}toString(){return this._}}function Tm(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}const k8=Symbol("implicit");function Qy(){var t=new G_,e=[],n=[],o=k8;function r(i){let s=t.get(i);if(s===void 0){if(o!==k8)return o;t.set(i,s=e.push(i)-1)}return n[s%n.length]}return r.domain=function(i){if(!arguments.length)return e.slice();e=[],t=new G_;for(const s of i)t.has(s)||t.set(s,e.push(s)-1);return r},r.range=function(i){return arguments.length?(n=Array.from(i),r):n.slice()},r.unknown=function(i){return arguments.length?(o=i,r):o},r.copy=function(){return Qy(e,n).unknown(o)},Tm.apply(r,arguments),r}function Zn(){var t=Qy().unknown(void 0),e=t.domain,n=t.range,o=0,r=1,i,s,a=!1,l=0,c=0,u=.5;delete t.unknown;function d(){var f=e().length,h=r<o,g=h?r:o,v=h?o:r;i=(v-g)/Math.max(1,f-l+c*2),a&&(i=Math.floor(i)),g+=(v-g-i*(f-l))*u,s=i*(1-l),a&&(g=Math.round(g),s=Math.round(s));var m=mz(f).map(function(b){return g+i*b});return n(h?m.reverse():m)}return t.domain=function(f){return arguments.length?(e(f),d()):e()},t.range=function(f){return arguments.length?([o,r]=f,o=+o,r=+r,d()):[o,r]},t.rangeRound=function(f){return[o,r]=f,o=+o,r=+r,a=!0,d()},t.bandwidth=function(){return s},t.step=function(){return i},t.round=function(f){return arguments.length?(a=!!f,d()):a},t.padding=function(f){return arguments.length?(l=Math.min(1,c=+f),d()):l},t.paddingInner=function(f){return arguments.length?(l=Math.min(1,f),d()):l},t.paddingOuter=function(f){return arguments.length?(c=+f,d()):c},t.align=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),d()):u},t.copy=function(){return Zn(e(),[o,r]).round(a).paddingInner(l).paddingOuter(c).align(u)},Tm.apply(d(),arguments)}function OC(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return OC(e())},t}function Mm(){return OC(Zn.apply(null,arguments).paddingInner(1))}function AK(t){return function(){return t}}function CK(t){return+t}var S8=[0,1];function Sc(t){return t}function V1(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:AK(isNaN(e)?NaN:.5)}function $K(t,e){var n;return t>e&&(n=t,t=e,e=n),function(o){return Math.max(t,Math.min(e,o))}}function TK(t,e,n){var o=t[0],r=t[1],i=e[0],s=e[1];return r<o?(o=V1(r,o),i=n(s,i)):(o=V1(o,r),i=n(i,s)),function(a){return i(o(a))}}function MK(t,e,n){var o=Math.min(t.length,e.length)-1,r=new Array(o),i=new Array(o),s=-1;for(t[o]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<o;)r[s]=V1(t[s],t[s+1]),i[s]=n(e[s],e[s+1]);return function(a){var l=iz(t,a,1,o)-1;return i[l](r[l](a))}}function BC(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function LC(){var t=S8,e=S8,n=jy,o,r,i,s=Sc,a,l,c;function u(){var f=Math.min(t.length,e.length);return s!==Sc&&(s=$K(t[0],t[f-1])),a=f>2?MK:TK,l=c=null,d}function d(f){return f==null||isNaN(f=+f)?i:(l||(l=a(t.map(o),e,n)))(o(s(f)))}return d.invert=function(f){return s(r((c||(c=a(e,t.map(o),oo)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,CK),u()):t.slice()},d.range=function(f){return arguments.length?(e=Array.from(f),u()):e.slice()},d.rangeRound=function(f){return e=Array.from(f),n=sX,u()},d.clamp=function(f){return arguments.length?(s=f?!0:Sc,u()):s!==Sc},d.interpolate=function(f){return arguments.length?(n=f,u()):n},d.unknown=function(f){return arguments.length?(i=f,d):i},function(f,h){return o=f,r=h,u()}}function OK(){return LC()(Sc,Sc)}function BK(t,e,n,o){var r=pz(t,e,n),i;switch(o=Ip(o??",f"),o.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return o.precision==null&&!isNaN(i=SV(r,s))&&(o.precision=i),AA(o,s)}case"":case"e":case"g":case"p":case"r":{o.precision==null&&!isNaN(i=AV(r,Math.max(Math.abs(t),Math.abs(e))))&&(o.precision=i-(o.type==="e"));break}case"f":case"%":{o.precision==null&&!isNaN(i=kV(r))&&(o.precision=i-(o.type==="%")*2);break}}return yu(o)}function PC(t){var e=t.domain;return t.ticks=function(n){var o=e();return hz(o[0],o[o.length-1],n??10)},t.tickFormat=function(n,o){var r=e();return BK(r[0],r[r.length-1],n??10,o)},t.nice=function(n){n==null&&(n=10);var o=e(),r=0,i=o.length-1,s=o[r],a=o[i],l,c,u=10;for(a<s&&(c=s,s=a,a=c,c=r,r=i,i=c);u-- >0;){if(c=$1(s,a,n),c===l)return o[r]=s,o[i]=a,e(o);if(c>0)s=Math.floor(s/c)*c,a=Math.ceil(a/c)*c;else if(c<0)s=Math.ceil(s*c)/c,a=Math.floor(a*c)/c;else break;l=c}return t},t}function Bn(){var t=OK();return t.copy=function(){return BC(t,Bn())},Tm.apply(t,arguments),PC(t)}function A8(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function C8(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function LK(t){var e=1,n=t(A8(e),C8(e));return n.constant=function(o){return arguments.length?t(A8(e=+o),C8(e)):e},PC(n)}function ja(){var t=LK(LC());return t.copy=function(){return BC(t,ja()).constant(t.constant())},Tm.apply(t,arguments)}function At(t){return function(){return t}}const $8=Math.abs,ho=Math.atan2,Ss=Math.cos,PK=Math.max,lv=Math.min,Jo=Math.sin,$o=Math.sqrt,po=1e-12,Ea=Math.PI,Zp=Ea/2,Ca=2*Ea;function DK(t){return t>1?0:t<-1?Ea:Math.acos(t)}function T8(t){return t>=1?Zp:t<=-1?-Zp:Math.asin(t)}function Om(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const o=Math.floor(n);if(!(o>=0))throw new RangeError(`invalid digits: ${n}`);e=o}return t},()=>new SK(e)}function EK(t){return t.innerRadius}function IK(t){return t.outerRadius}function NK(t){return t.startAngle}function RK(t){return t.endAngle}function FK(t){return t&&t.padAngle}function VK(t,e,n,o,r,i,s,a){var l=n-t,c=o-e,u=s-r,d=a-i,f=d*l-u*c;if(!(f*f<po))return f=(u*(e-i)-d*(t-r))/f,[t+f*l,e+f*c]}function dh(t,e,n,o,r,i,s){var a=t-n,l=e-o,c=(s?i:-i)/$o(a*a+l*l),u=c*l,d=-c*a,f=t+u,h=e+d,g=n+u,v=o+d,m=(f+g)/2,b=(h+v)/2,y=g-f,x=v-h,_=y*y+x*x,k=r-i,E=f*v-g*h,L=(x<0?-1:1)*$o(PK(0,k*k*_-E*E)),S=(E*x-y*L)/_,B=(-E*y-x*L)/_,D=(E*x+y*L)/_,N=(-E*y+x*L)/_,C=S-m,M=B-b,P=D-m,$=N-b;return C*C+M*M>P*P+$*$&&(S=D,B=N),{cx:S,cy:B,x01:-u,y01:-d,x11:S*(r/k-1),y11:B*(r/k-1)}}function zK(){var t=EK,e=IK,n=At(0),o=null,r=NK,i=RK,s=FK,a=null,l=Om(c);function c(){var u,d,f=+t.apply(this,arguments),h=+e.apply(this,arguments),g=r.apply(this,arguments)-Zp,v=i.apply(this,arguments)-Zp,m=$8(v-g),b=v>g;if(a||(a=u=l()),h<f&&(d=h,h=f,f=d),!(h>po))a.moveTo(0,0);else if(m>Ca-po)a.moveTo(h*Ss(g),h*Jo(g)),a.arc(0,0,h,g,v,!b),f>po&&(a.moveTo(f*Ss(v),f*Jo(v)),a.arc(0,0,f,v,g,b));else{var y=g,x=v,_=g,k=v,E=m,L=m,S=s.apply(this,arguments)/2,B=S>po&&(o?+o.apply(this,arguments):$o(f*f+h*h)),D=lv($8(h-f)/2,+n.apply(this,arguments)),N=D,C=D,M,P;if(B>po){var $=T8(B/f*Jo(S)),F=T8(B/h*Jo(S));(E-=$*2)>po?($*=b?1:-1,_+=$,k-=$):(E=0,_=k=(g+v)/2),(L-=F*2)>po?(F*=b?1:-1,y+=F,x-=F):(L=0,y=x=(g+v)/2)}var V=h*Ss(y),U=h*Jo(y),K=f*Ss(k),ae=f*Jo(k);if(D>po){var me=h*Ss(x),de=h*Jo(x),ve=f*Ss(_),te=f*Jo(_),pe;if(m<Ea)if(pe=VK(V,U,ve,te,me,de,K,ae)){var we=V-pe[0],J=U-pe[1],ge=me-pe[0],re=de-pe[1],oe=1/Jo(DK((we*ge+J*re)/($o(we*we+J*J)*$o(ge*ge+re*re)))/2),he=$o(pe[0]*pe[0]+pe[1]*pe[1]);N=lv(D,(f-he)/(oe-1)),C=lv(D,(h-he)/(oe+1))}else N=C=0}L>po?C>po?(M=dh(ve,te,V,U,h,C,b),P=dh(me,de,K,ae,h,C,b),a.moveTo(M.cx+M.x01,M.cy+M.y01),C<D?a.arc(M.cx,M.cy,C,ho(M.y01,M.x01),ho(P.y01,P.x01),!b):(a.arc(M.cx,M.cy,C,ho(M.y01,M.x01),ho(M.y11,M.x11),!b),a.arc(0,0,h,ho(M.cy+M.y11,M.cx+M.x11),ho(P.cy+P.y11,P.cx+P.x11),!b),a.arc(P.cx,P.cy,C,ho(P.y11,P.x11),ho(P.y01,P.x01),!b))):(a.moveTo(V,U),a.arc(0,0,h,y,x,!b)):a.moveTo(V,U),!(f>po)||!(E>po)?a.lineTo(K,ae):N>po?(M=dh(K,ae,me,de,f,-N,b),P=dh(V,U,ve,te,f,-N,b),a.lineTo(M.cx+M.x01,M.cy+M.y01),N<D?a.arc(M.cx,M.cy,N,ho(M.y01,M.x01),ho(P.y01,P.x01),!b):(a.arc(M.cx,M.cy,N,ho(M.y01,M.x01),ho(M.y11,M.x11),!b),a.arc(0,0,f,ho(M.cy+M.y11,M.cx+M.x11),ho(P.cy+P.y11,P.cx+P.x11),b),a.arc(P.cx,P.cy,N,ho(P.y11,P.x11),ho(P.y01,P.x01),!b))):a.arc(0,0,f,k,_,b)}if(a.closePath(),u)return a=null,u+""||null}return c.centroid=function(){var u=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,d=(+r.apply(this,arguments)+ +i.apply(this,arguments))/2-Ea/2;return[Ss(d)*u,Jo(d)*u]},c.innerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:At(+u),c):t},c.outerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:At(+u),c):e},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:At(+u),c):n},c.padRadius=function(u){return arguments.length?(o=u==null?null:typeof u=="function"?u:At(+u),c):o},c.startAngle=function(u){return arguments.length?(r=typeof u=="function"?u:At(+u),c):r},c.endAngle=function(u){return arguments.length?(i=typeof u=="function"?u:At(+u),c):i},c.padAngle=function(u){return arguments.length?(s=typeof u=="function"?u:At(+u),c):s},c.context=function(u){return arguments.length?(a=u??null,c):a},c}function Bm(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function DC(t){this._context=t}DC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function wu(t){return new DC(t)}function EC(t){return t[0]}function IC(t){return t[1]}function Ci(t,e){var n=At(!0),o=null,r=wu,i=null,s=Om(a);t=typeof t=="function"?t:t===void 0?EC:At(t),e=typeof e=="function"?e:e===void 0?IC:At(e);function a(l){var c,u=(l=Bm(l)).length,d,f=!1,h;for(o==null&&(i=r(h=s())),c=0;c<=u;++c)!(c<u&&n(d=l[c],c,l))===f&&((f=!f)?i.lineStart():i.lineEnd()),f&&i.point(+t(d,c,l),+e(d,c,l));if(h)return i=null,h+""||null}return a.x=function(l){return arguments.length?(t=typeof l=="function"?l:At(+l),a):t},a.y=function(l){return arguments.length?(e=typeof l=="function"?l:At(+l),a):e},a.defined=function(l){return arguments.length?(n=typeof l=="function"?l:At(!!l),a):n},a.curve=function(l){return arguments.length?(r=l,o!=null&&(i=r(o)),a):r},a.context=function(l){return arguments.length?(l==null?o=i=null:i=r(o=l),a):o},a}function js(t,e,n){var o=null,r=At(!0),i=null,s=wu,a=null,l=Om(c);t=typeof t=="function"?t:t===void 0?EC:At(+t),e=typeof e=="function"?e:At(e===void 0?0:+e),n=typeof n=="function"?n:n===void 0?IC:At(+n);function c(d){var f,h,g,v=(d=Bm(d)).length,m,b=!1,y,x=new Array(v),_=new Array(v);for(i==null&&(a=s(y=l())),f=0;f<=v;++f){if(!(f<v&&r(m=d[f],f,d))===b)if(b=!b)h=f,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),g=f-1;g>=h;--g)a.point(x[g],_[g]);a.lineEnd(),a.areaEnd()}b&&(x[f]=+t(m,f,d),_[f]=+e(m,f,d),a.point(o?+o(m,f,d):x[f],n?+n(m,f,d):_[f]))}if(y)return a=null,y+""||null}function u(){return Ci().defined(r).curve(s).context(i)}return c.x=function(d){return arguments.length?(t=typeof d=="function"?d:At(+d),o=null,c):t},c.x0=function(d){return arguments.length?(t=typeof d=="function"?d:At(+d),c):t},c.x1=function(d){return arguments.length?(o=d==null?null:typeof d=="function"?d:At(+d),c):o},c.y=function(d){return arguments.length?(e=typeof d=="function"?d:At(+d),n=null,c):e},c.y0=function(d){return arguments.length?(e=typeof d=="function"?d:At(+d),c):e},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:At(+d),c):n},c.lineX0=c.lineY0=function(){return u().x(t).y(e)},c.lineY1=function(){return u().x(t).y(n)},c.lineX1=function(){return u().x(o).y(e)},c.defined=function(d){return arguments.length?(r=typeof d=="function"?d:At(!!d),c):r},c.curve=function(d){return arguments.length?(s=d,i!=null&&(a=s(i)),c):s},c.context=function(d){return arguments.length?(d==null?i=a=null:a=s(i=d),c):i},c}function HK(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function WK(t){return t}function UK(){var t=WK,e=HK,n=null,o=At(0),r=At(Ca),i=At(0);function s(a){var l,c=(a=Bm(a)).length,u,d,f=0,h=new Array(c),g=new Array(c),v=+o.apply(this,arguments),m=Math.min(Ca,Math.max(-Ca,r.apply(this,arguments)-v)),b,y=Math.min(Math.abs(m)/c,i.apply(this,arguments)),x=y*(m<0?-1:1),_;for(l=0;l<c;++l)(_=g[h[l]=l]=+t(a[l],l,a))>0&&(f+=_);for(e!=null?h.sort(function(k,E){return e(g[k],g[E])}):n!=null&&h.sort(function(k,E){return n(a[k],a[E])}),l=0,d=f?(m-c*x)/f:0;l<c;++l,v=b)u=h[l],_=g[u],b=v+(_>0?_*d:0)+x,g[u]={data:a[u],index:l,value:_,startAngle:v,endAngle:b,padAngle:y};return g}return s.value=function(a){return arguments.length?(t=typeof a=="function"?a:At(+a),s):t},s.sortValues=function(a){return arguments.length?(e=a,n=null,s):e},s.sort=function(a){return arguments.length?(n=a,e=null,s):n},s.startAngle=function(a){return arguments.length?(o=typeof a=="function"?a:At(+a),s):o},s.endAngle=function(a){return arguments.length?(r=typeof a=="function"?a:At(+a),s):r},s.padAngle=function(a){return arguments.length?(i=typeof a=="function"?a:At(+a),s):i},s}const Jy={draw(t,e){const n=$o(e/Ea);t.moveTo(n,0),t.arc(0,0,n,0,Ca)}},GK={draw(t,e){const n=$o(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},NC=$o(1/3),qK=NC*2,YK={draw(t,e){const n=$o(e/qK),o=n*NC;t.moveTo(0,-n),t.lineTo(o,0),t.lineTo(0,n),t.lineTo(-o,0),t.closePath()}},jK={draw(t,e){const n=$o(e),o=-n/2;t.rect(o,o,n,n)}},XK=.8908130915292852,RC=Jo(Ea/10)/Jo(7*Ea/10),KK=Jo(Ca/10)*RC,ZK=-Ss(Ca/10)*RC,QK={draw(t,e){const n=$o(e*XK),o=KK*n,r=ZK*n;t.moveTo(0,-n),t.lineTo(o,r);for(let i=1;i<5;++i){const s=Ca*i/5,a=Ss(s),l=Jo(s);t.lineTo(l*n,-a*n),t.lineTo(a*o-l*r,l*o+a*r)}t.closePath()}},cv=$o(3),FC={draw(t,e){const n=-$o(e/(cv*3));t.moveTo(0,n*2),t.lineTo(-cv*n,-n),t.lineTo(cv*n,-n),t.closePath()}},JK=$o(3),eZ={draw(t,e){const n=$o(e)*.6824,o=n/2,r=n*JK/2;t.moveTo(0,-n),t.lineTo(r,o),t.lineTo(-r,o),t.closePath()}};function tZ(t,e){let n=null,o=Om(r);t=typeof t=="function"?t:At(t||Jy),e=typeof e=="function"?e:At(e===void 0?64:+e);function r(){let i;if(n||(n=i=o()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),i)return n=null,i+""||null}return r.type=function(i){return arguments.length?(t=typeof i=="function"?i:At(i),r):t},r.size=function(i){return arguments.length?(e=typeof i=="function"?i:At(+i),r):e},r.context=function(i){return arguments.length?(n=i??null,r):n},r}function M8(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function VC(t){this._context=t}VC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:M8(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:M8(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function nZ(t){return new VC(t)}function O8(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function e2(t,e){this._context=t,this._k=(1-e)/6}e2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:O8(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:O8(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const oZ=(function t(e){function n(o){return new e2(o,e)}return n.tension=function(o){return t(+o)},n})(0);function rZ(t,e,n){var o=t._x1,r=t._y1,i=t._x2,s=t._y2;if(t._l01_a>po){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);o=(o*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,r=(r*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>po){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);i=(i*c+t._x1*t._l23_2a-e*t._l12_2a)/u,s=(s*c+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(o,r,i,s,t._x2,t._y2)}function zC(t,e){this._context=t,this._alpha=e}zC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,o=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+o*o,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:rZ(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const iZ=(function t(e){function n(o){return e?new zC(o,e):new e2(o,0)}return n.alpha=function(o){return t(+o)},n})(.5);function B8(t){return t<0?-1:1}function L8(t,e,n){var o=t._x1-t._x0,r=e-t._x1,i=(t._y1-t._y0)/(o||r<0&&-0),s=(n-t._y1)/(r||o<0&&-0),a=(i*r+s*o)/(o+r);return(B8(i)+B8(s))*Math.min(Math.abs(i),Math.abs(s),.5*Math.abs(a))||0}function P8(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function uv(t,e,n){var o=t._x0,r=t._y0,i=t._x1,s=t._y1,a=(i-o)/3;t._context.bezierCurveTo(o+a,r+a*e,i-a,s-a*n,i,s)}function Qp(t){this._context=t}Qp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:uv(this,this._t0,P8(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,uv(this,P8(this,n=L8(this,t,e)),n);break;default:uv(this,this._t0,n=L8(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};Object.create(Qp.prototype).point=function(t,e){Qp.prototype.point.call(this,e,t)};function t2(t){return new Qp(t)}function Lm(t,e){this._context=t,this._t=e}Lm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function sZ(t){return new Lm(t,.5)}function aZ(t){return new Lm(t,0)}function lZ(t){return new Lm(t,1)}function Jp(t,e){if((s=t.length)>1)for(var n=1,o,r,i=t[e[0]],s,a=i.length;n<s;++n)for(r=i,i=t[e[n]],o=0;o<a;++o)i[o][1]+=i[o][0]=isNaN(r[o][1])?r[o][0]:r[o][1]}function e0(t){for(var e=t.length,n=new Array(e);--e>=0;)n[e]=e;return n}function cZ(t,e){return t[e]}function uZ(t){const e=[];return e.key=t,e}function HC(){var t=At([]),e=e0,n=Jp,o=cZ;function r(i){var s=Array.from(t.apply(this,arguments),uZ),a,l=s.length,c=-1,u;for(const d of i)for(a=0,++c;a<l;++a)(s[a][c]=[0,+o(d,s[a].key,c,i)]).data=d;for(a=0,u=Bm(e(s));a<l;++a)s[u[a]].index=a;return n(s,u),s}return r.keys=function(i){return arguments.length?(t=typeof i=="function"?i:At(Array.from(i)),r):t},r.value=function(i){return arguments.length?(o=typeof i=="function"?i:At(+i),r):o},r.order=function(i){return arguments.length?(e=i==null?e0:typeof i=="function"?i:At(Array.from(i)),r):e},r.offset=function(i){return arguments.length?(n=i??Jp,r):n},r}function dZ(t,e){if((o=t.length)>0){for(var n,o,r=0,i=t[0].length,s;r<i;++r){for(s=n=0;n<o;++n)s+=t[n][r][1]||0;if(s)for(n=0;n<o;++n)t[n][r][1]/=s}Jp(t,e)}}function fZ(t,e){if((l=t.length)>0)for(var n,o=0,r,i,s,a,l,c=t[e[0]].length;o<c;++o)for(s=a=0,n=0;n<l;++n)(i=(r=t[e[n]][o])[1]-r[0])>0?(r[0]=s,r[1]=s+=i):i<0?(r[1]=a,r[0]=a+=i):(r[0]=0,r[1]=i)}function ud(t,e,n){this.k=t,this.x=e,this.y=n}ud.prototype={constructor:ud,scale:function(t){return t===1?this:new ud(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new ud(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};ud.prototype;function z1(t,e){if(!t)throw new Error(`[d3-blueprint] ${e}`)}class hZ{constructor(){bn(this,"properties",new Map)}define(e,n){z1(!this.properties.has(e),`config "${e}" is already defined`);const{defaultValue:o,getter:r,setter:i}=n,s=i?i(o):o;return this.properties.set(e,{value:s,getter:r,setter:i}),this}get(e){const n=this.getProperty(e),{value:o,getter:r}=n;return r?r(o):o}set(e,n){const o=this.getProperty(e);return o.value=o.setter?o.setter(n):n,this}setBatch(e){for(const[n,o]of Object.entries(e))this.set(n,o);return this}getAll(){const e={};for(const[n]of this.properties)e[n]=this.get(n);return e}has(e){return this.properties.has(e)}getProperty(e){const n=this.properties.get(e);return z1(n,`config "${e}" is not defined`),n}}const H1=["update","enter","merge","exit"],WC=new Set([...H1,...H1.map(t=>`${t}:transition`)]);function pZ(t){return WC.has(t)}function D8(t){z1(pZ(t),`"${t}" is not a valid lifecycle event. Expected one of: ${[...WC].join(", ")}`)}function mZ(t,e,n){const o=t.exit(),r={update:t,enter:e,merge:e.merge(t),exit:o};return H1.map(i=>{const s=r[i],a=n.get(i)??[],l=n.get(`${i}:transition`)??[];return{name:i,selection:s,handlers:a,transitionHandlers:l}})}function gZ(t,e){for(const n of e)n(t)}function vZ(t,e){return e.map(n=>{const o=t.transition();return n(o),bZ(o)})}function bZ(t){return t.end().then(()=>{},()=>{})}class yZ{constructor(e,n){bn(this,"base");bn(this,"dataBindFn");bn(this,"insertFn");bn(this,"handlers",new Map);if(this.base=e,this.dataBindFn=n.dataBind,this.insertFn=n.insert,n.events)for(const[o,r]of Object.entries(n.events))r&&this.on(o,r)}on(e,n){D8(e);const o=this.handlers.get(e)??[];return o.push(n),this.handlers.set(e,o),this}off(e,n){if(D8(e),!n)return this.handlers.delete(e),this;const o=this.handlers.get(e);if(o){const r=o.indexOf(n);r!==-1&&o.splice(r,1)}return this}draw(e){const n=this.dataBindFn(this.base,e),o=n.enter(),r=this.insertFn(o),i=mZ(n,r,this.handlers),s=[];for(const a of i){gZ(a.selection,a.handlers);const l=vZ(a.selection,a.transitionHandlers);s.push(...l)}return Promise.all(s).then(()=>{})}}function xZ(t,e,n,o){if(n&&o){const i=new yZ(n,o);return t.set(e,i),i}const r=t.get(e);if(!r)throw new Error(`[d3-blueprint] layer "${e}" is not defined`);return r}function wZ(t,e,n,o){return typeof n=="string"&&o===void 0?t.get(n):typeof n=="string"?(t.set(n,o),e):(t.setBatch(n),e)}function _Z(t,e){const n=[];for(const o of t.values())n.push(o.draw(e));return n}function kZ(t,e){const n=[];for(const o of t.values()){const r=o.draw(e);r&&n.push(r)}return n}const SZ=["preDraw","postDraw","postTransition"];class lo{constructor(e){bn(this,"base");bn(this,"layers",new Map);bn(this,"attachments",new Map);bn(this,"configs",new hZ);bn(this,"dispatcher");bn(this,"attached",new Proxy({},{get:(e,n)=>{const o=this.attachments.get(n);if(!o)throw new Error(`[d3-blueprint] attachment "${n}" is not defined`);return o},has:(e,n)=>this.attachments.has(n)}));this.base=e,this.dispatcher=Wy(...SZ),this.initialize()}initialize(){}transform(e){return e}preDraw(e){}postDraw(e){}postTransition(e){}layer(e,n,o){return xZ(this.layers,e,n,o)}attach(e,n,o){if(o!==void 0){const r=n;this.attachments.set(e,new r(o))}else this.attachments.set(e,n);return this}config(e,n){return wZ(this.configs,this,e,n)}configDefine(e,n){return this.configs.define(e,n),this}on(e,n){return this.dispatcher.on(e,n),this}off(e){return this.dispatcher.on(e,null),this}use(e,n){const o=n||e.name||"plugin";if(e.install(this),e.preDraw&&this.on(`preDraw.${o}`,r=>e.preDraw(this,r)),e.postDraw&&this.on(`postDraw.${o}`,r=>e.postDraw(this,r)),e.postTransition&&this.on(`postTransition.${o}`,r=>e.postTransition(this,r)),e.destroy){const r=this.destroy.bind(this);this.destroy=()=>{e.destroy(this),r()}}return this}async draw(e){const n=this.transform(e);this.preDraw(n),this.dispatcher.call("preDraw",this,n);const o=_Z(this.layers,n),r=kZ(this.attachments,n);this.postDraw(n),this.dispatcher.call("postDraw",this,n),await Promise.all([...o,...r]),this.postTransition(n),this.dispatcher.call("postTransition",this,n)}destroy(){this.layers.clear(),this.attachments.clear()}}class AZ extends lo{initialize(){const e=this.base.append("div").attr("class","bc-frame"),n=e.append("div").attr("class","bc-frame-header");e.append("div").attr("class","bc-frame-body"),e.append("p").attr("class","bc-frame-note");const o=e.append("div").attr("class","bc-frame-footer").style("display","flex").style("justify-content","space-between").style("align-items","center").style("flex-wrap","wrap").style("gap","0.25rem 1rem"),r=o.append("div").attr("class","bc-frame-footer-left").style("display","flex").style("flex-wrap","wrap").style("gap","0.25rem 0.75rem"),i=o.append("div").attr("class","bc-frame-footer-right").style("display","flex").style("align-items","center");this.layer("headerItems",n,{dataBind:(s,a)=>s.selectAll(".bc-frame-header-item").data(a.headerItems,l=>l.className),insert:s=>s.append(a=>document.createElement(a.tag)),events:{enter:s=>{s.attr("class",a=>a.className).text(a=>a.text)},merge:s=>{s.attr("class",a=>a.className).text(a=>a.text)},exit:s=>{s.remove()}}}),this.layer("footerLeftItems",r,{dataBind:(s,a)=>s.selectAll(".bc-frame-footer-item").data(a.footerLeftItems,l=>l.className),insert:s=>s.append(a=>document.createElement(a.tag)),events:{enter:s=>{s.attr("class",a=>a.className).each(function(a){if(this.textContent="",a.prefix){const l=document.createElement("span");l.className="bc-frame-source-prefix",l.textContent=a.prefix,this.appendChild(l)}if(a.href){const l=document.createElement("a");l.className="bc-frame-source-link",l.href=a.href,l.textContent=a.text,this.appendChild(l)}else this.appendChild(document.createTextNode(a.text))})},merge:s=>{s.attr("class",a=>a.className).each(function(a){if(this.textContent="",a.prefix){const l=document.createElement("span");l.className="bc-frame-source-prefix",l.textContent=a.prefix,this.appendChild(l)}if(a.href){const l=document.createElement("a");l.className="bc-frame-source-link",l.href=a.href,l.textContent=a.text,this.appendChild(l)}else this.appendChild(document.createTextNode(a.text))})},exit:s=>{s.remove()}}}),this.layer("footerRightItems",i,{dataBind:(s,a)=>s.selectAll(".bc-frame-footer-item").data(a.footerRightItems,l=>l.className),insert:s=>s.append(a=>document.createElement(a.tag)),events:{enter:s=>{s.attr("class",a=>a.className).each(function(a){if(a.html){const c=document.createRange().createContextualFragment(a.html);this.appendChild(c)}else this.textContent=a.text}),s.filter(a=>!!a.href).attr("href",a=>a.href),s.filter(a=>!!a.target).attr("target",a=>a.target),s.filter(a=>!!a.rel).attr("rel",a=>a.rel)},merge:s=>{s.attr("class",a=>a.className).each(function(a){if(this.textContent="",a.html){const c=document.createRange().createContextualFragment(a.html);this.appendChild(c)}else this.textContent=a.text}),s.filter(a=>!!a.href).attr("href",a=>a.href),s.filter(a=>!!a.target).attr("target",a=>a.target),s.filter(a=>!!a.rel).attr("rel",a=>a.rel)},exit:s=>{s.remove()}}})}}function CZ(t){const e=[];return t.title&&e.push({tag:"h3",className:"bc-frame-title",text:t.title}),t.description&&e.push({tag:"p",className:"bc-frame-description",text:t.description}),e}function $Z(t){const e=[];return t.byline&&e.push({tag:"span",className:"bc-frame-byline",text:t.byline}),t.source&&e.push({tag:"span",className:"bc-frame-source",text:t.source,prefix:"Source: ",href:t.sourceUrl||void 0}),e}const TZ='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48.042969 90.607422" width="10" height="18" style="vertical-align:-3px;margin-right:3px"><path fill="currentColor" opacity="0.55" d="M 20.042969 34.607422 A 28 28 0 0 1 23.072266 34.779297 A 28 28 0 0 0 20.042969 34.607422 z M 23.34375 34.810547 A 28 28 0 0 1 26.171875 35.292969 A 28 28 0 0 0 23.34375 34.810547 z M 16.570312 34.84375 A 28 28 0 0 0 15.474609 35.033203 A 28 28 0 0 1 16.570312 34.84375 z M 26.390625 35.341797 A 28 28 0 0 1 29.316406 36.189453 A 28 28 0 0 0 26.390625 35.341797 z M 13.128906 35.511719 A 28 28 0 0 0 11.904297 35.873047 A 28 28 0 0 1 13.128906 35.511719 z M 29.373047 36.210938 A 28 28 0 0 1 32.103516 37.347656 A 28 28 0 0 0 29.373047 36.210938 z M 9.7832031 36.609375 A 28 28 0 0 0 8.5820312 37.117188 A 28 28 0 0 1 9.7832031 36.609375 z M 32.392578 37.486328 A 28 28 0 0 1 34.939453 38.90625 A 28 28 0 0 0 32.392578 37.486328 z M 6.5742188 38.128906 A 28 28 0 0 0 5.4511719 38.765625 A 28 28 0 0 1 6.5742188 38.128906 z M 35.041016 38.966797 A 28 28 0 0 1 37.523438 40.738281 A 28 28 0 0 0 35.041016 38.966797 z M 3.5273438 40.080078 A 28 28 0 0 0 2.5761719 40.771484 A 28 28 0 0 1 3.5273438 40.080078 z M 37.658203 40.851562 A 28 28 0 0 1 39.804688 42.783203 A 28 28 0 0 0 37.658203 40.851562 z M 40.011719 42.990234 A 28 28 0 0 1 42.013672 45.251953 A 28 28 0 0 0 40.011719 42.990234 z M 42.013672 45.251953 A 28 28 0 0 1 20.042969 56 A 28 28 0 0 1 14.232422 55.3125 A 16 16 0 0 1 16 62.607422 A 16 16 0 0 1 0 78.607422 L 0 82.121094 A 28 28 0 0 0 20.042969 90.607422 A 28 28 0 0 0 48.042969 62.607422 A 28 28 0 0 0 42.013672 45.251953 z M 1.3007812 46.667969 A 16 16 0 0 1 1.6191406 46.697266 A 16 16 0 0 0 1.3007812 46.667969 z M 4.2558594 47.189453 A 16 16 0 0 1 4.4355469 47.242188 A 16 16 0 0 0 4.2558594 47.189453 z "/><path fill="currentColor" opacity="0.85" d="M 6.0637516 38.376047 A 28 28 0 0 1 20.042969 34.615234 A 28 28 0 0 1 42.013672 45.259765 A 28 28 0 0 0 48.042969 28.007812 A 28 28 0 0 0 20.042969 0.0078125 A 28 28 0 0 0 0 8.4941407 L 0 16.007812 A 12 12 0 0 1 12 28.007812 A 12 12 0 0 1 6.0613693 38.364443 "/><path fill="currentColor" d="M 20.042969 34.607422 A 28 28 0 0 0 5.0878906 38.970703 A 28 28 0 0 1 6.0644531 38.376953 L 6.0605469 38.365234 A 12 12 0 0 1 0 40.007812 L 0 43.09375 L 0 43.101562 L 0 46.607422 A 16 16 0 0 1 2.8847656 46.873047 A 16 16 0 0 1 2.9199219 46.878906 A 16 16 0 0 1 5.7011719 47.662109 A 16 16 0 0 1 5.7324219 47.673828 A 16 16 0 0 1 8.3300781 48.955078 A 16 16 0 0 1 8.3398438 48.958984 A 16 16 0 0 1 8.3457031 48.962891 A 16 16 0 0 1 10.662109 50.6875 A 16 16 0 0 1 10.697266 50.71875 A 16 16 0 0 1 12.660156 52.837891 A 16 16 0 0 1 12.667969 52.845703 A 16 16 0 0 1 12.673828 52.855469 A 16 16 0 0 1 14.228516 55.306641 A 16 16 0 0 1 14.232422 55.3125 A 28 28 0 0 0 20.042969 56 A 28 28 0 0 0 42.013672 45.251953 A 28 28 0 0 0 20.042969 34.607422 z M 4.7695312 39.177734 A 28 28 0 0 0 2.5390625 40.798828 A 28 28 0 0 1 4.7695312 39.177734 z M 2.1816406 41.091797 A 28 28 0 0 0 0.11914062 42.984375 A 28 28 0 0 1 2.1816406 41.091797 z "/></svg>';function MZ(){return[{tag:"a",className:"bc-frame-credit",text:"Blueprint Chart",html:TZ+"Blueprint Chart",href:"/",target:"_blank",rel:"noopener noreferrer"}]}function Xr(t,e){if(e===null)return{wrapper:t,header:t,body:t,footer:t};const n=e??{};new AZ(Ae(t)).draw({headerItems:CZ(n),footerLeftItems:$Z(n),footerRightItems:MZ()});const r=t.querySelector(".bc-frame"),i=r.querySelector(".bc-frame-header"),s=r.querySelector(".bc-frame-body"),a=r.querySelector(".bc-frame-note"),l=r.querySelector(".bc-frame-footer");if(n.padding&&r.style.setProperty("--bc-frame-padding",n.padding),n.transparentBackground&&r.style.setProperty("--bc-frame-bg","transparent"),n.note?a.textContent=n.note:a.style.display="none",t.isConnected){const c=getComputedStyle(t),u=c.aspectRatio&&c.aspectRatio!=="auto"&&c.aspectRatio!=="",d=c.display==="flex"&&c.flexDirection==="column";if(u||d){const f=i.offsetHeight,h=l.offsetHeight,g=a.style.display!=="none"?a.offsetHeight:0;r.classList.add("bc-frame--constrained"),s.dataset.headerH=String(f);const v=t;s.dataset.footerH=String(v.__bcFooterH??h+g),requestAnimationFrame(()=>{v.__bcFooterH=l.offsetHeight+(a.style.display!=="none"?a.offsetHeight:0)})}}return{wrapper:r,header:i,body:s,footer:l}}function E8(t){return t&&(t.startsWith("(")&&t.endsWith(")")?t.slice(0,-1):t)}function OZ(t){if(!t)return{prefix:"",d3Spec:"",suffix:""};if(t.includes("|")){const e=t.split("|");return{prefix:e[0]??"",d3Spec:E8(e[1]??""),suffix:e[2]??""}}return{prefix:"",d3Spec:E8(t),suffix:""}}function Ia(t){if(!t)return null;const{prefix:e,d3Spec:n,suffix:o}=OZ(t);if(!n)return null;const r=yu(n);return!e&&!o?r:i=>`${e}${r(i)}${o}`}function Li(t,e){if(!t)return;const n=t.stableTop??t.top,o=e.stableTop??e.top;return{dx:t.left-e.left,dy:n-o}}const BZ={top:12,right:20,bottom:24,left:50},UC=600,GC=400;class LZ extends lo{initialize(){this.configDefine("totalWidth",{defaultValue:UC}),this.configDefine("totalHeight",{defaultValue:GC}),this.layer("svg",this.base,{dataBind:(e,n)=>e.selectAll("svg").data(n),insert:e=>e.append("svg"),events:{enter:e=>{const n=this.config("totalWidth"),o=this.config("totalHeight");e.attr("width",n).attr("height",o).append("g").attr("transform",r=>`translate(${r.left},${r.top})`)}}})}}const PZ=400,I8=2,t0=2,n0=9;function Jl(t,e,n,o){const r=Math.min(0,...t),i=Math.max(0,...t),s=(e==null?void 0:e.min)??r,a=(e==null?void 0:e.max)??i,l=o==="log"?ja().domain([s,a]).nice():Bn().domain([s,a]).nice(),c=l.ticks(),u=n?Ia(n)??l.tickFormat():l.tickFormat(),d=c.map(h=>u(h));if(d.length===0)return 0;try{const g=document.createElement("canvas").getContext("2d");if(g){g.font="10px sans-serif";let v=0;for(const m of d){const b=g.measureText(m).width;b>v&&(v=b)}return Math.ceil(v)+t0+n0}}catch{}return Math.max(...d.map(h=>h.length))*6+t0+n0}function Pm(t){if(t.length===0)return 0;try{const o=document.createElement("canvas").getContext("2d");if(o){o.font="10px sans-serif";let r=0;for(const i of t){const s=o.measureText(i).width;s>r&&(r=s)}return Math.ceil(r)+t0+n0}}catch{}return Math.max(...t.map(n=>n.length))*6+t0+n0}function Pi(t,e,n,o,r,i){const s={},a=r??50,l=o??"left",c=e??"auto",u=c==="auto"?t>0&&t<PZ?"inside":"outside":c,d=u==="inside",f=u==="off";return l==="right"?(s.left=0,d?s.right=I8:f?s.right=0:s.right=a):(s.right=i!==!1?15:0,d?s.left=I8:f?s.left=0:s.left=a),d&&(s.top=35),(i===!1||n==="inside"||n==="off")&&(s.bottom=5),s}function cr(t){const e=t.getBoundingClientRect(),n=getComputedStyle(t);return{width:e.width-(parseFloat(n.paddingLeft)||0)-(parseFloat(n.paddingRight)||0),height:e.height-(parseFloat(n.paddingTop)||0)-(parseFloat(n.paddingBottom)||0)}}function Kr(t,e){const n={...BZ,...e},o=t.closest(".bc-frame--constrained")!=null;if(o){const f=parseFloat(t.dataset.headerH||"0"),h=parseFloat(t.dataset.footerH||"0"),g=n.top;n.top=f+g,n.bottom+=h,n.stableTop=g}const r=cr(t),i=r.width>0?r.width:UC,s=r.height>0?r.height:GC,a=i-n.left-n.right,l=s-n.top-n.bottom,c=new LZ(Ae(t));c.config({totalWidth:i,totalHeight:s}),c.draw([n]);const u=t.querySelector("svg"),d=u.querySelector("g");return o&&(u.setAttribute("viewBox",`0 0 ${i} ${s}`),u.setAttribute("preserveAspectRatio","none"),u.removeAttribute("width"),u.removeAttribute("height"),u.style.width="100%",u.style.height="100%",u.style.display="block"),{svg:u,chartArea:d,width:a,height:l,margin:n}}function ec(t){return typeof window>"u"||typeof window.matchMedia!="function"?t:window.matchMedia("(prefers-reduced-motion: reduce)").matches?0:t}const _u=500;let qC=0;function Zr(t){qC=t?_u:0}function _t(){return ec(qC)}function Wo(t,e,n,o){if(e.length===0)return;if(n===0&&o===0){e.forEach(s=>t.appendChild(s));return}const r=document.createElementNS("http://www.w3.org/2000/svg","g");r.setAttribute("transform",`translate(${n},${o})`),e.forEach(s=>r.appendChild(s)),t.appendChild(r);const i=_t();if(i>0)Ae(r).transition().duration(i).attrTween("transform",()=>{const s=oo(n,0),a=oo(o,0);return l=>`translate(${s(l)},${a(l)})`}).on("end",()=>{for(;r.firstChild;)t.appendChild(r.firstChild);r.remove()});else{for(;r.firstChild;)t.appendChild(r.firstChild);r.remove()}}function Tr(t,e){const n=ec(_u);n<=0||typeof t.animate!="function"||t.animate([{opacity:0},{opacity:1}],{duration:n,easing:"ease-in-out"})}function Mr(t,e){const n=ec(_u);if(t.querySelectorAll("[data-bc-fade-overlay]").forEach(r=>{typeof r.getAnimations=="function"&&r.getAnimations().forEach(i=>i.cancel()),r.remove()}),n<=0||t.children.length===0)return null;const o=document.createElement("div");return o.style.position="absolute",o.style.inset="0",o.style.pointerEvents="none",o.style.display="flex",o.style.flexDirection="column",o.dataset.bcFadeOverlay="true",Array.from(t.childNodes).forEach(r=>{o.appendChild(r.cloneNode(!0))}),o.querySelectorAll(".bc-axis-vertical, .bc-axis-horizontal").forEach(r=>{r.remove()}),o.querySelectorAll(".bc-frame-footer, .bc-frame-note").forEach(r=>{r.remove()}),o.querySelectorAll("[data-bc-fade-overlay], .bc-frame--fade-snapshot").forEach(r=>{r.remove()}),o.querySelectorAll(".bc-frame").forEach(r=>{r.classList.remove("bc-frame"),r.classList.add("bc-frame--fade-snapshot")}),o}function Or(t,e,n){const o=ec(_u);if(getComputedStyle(t).position==="static"&&(t.style.position="relative"),t.appendChild(e),o>0&&typeof e.animate=="function"){const i=e.animate([{opacity:1},{opacity:0}],{duration:o,easing:"ease-in-out"});i.onfinish=()=>e.remove()}else e.remove()}const N8=30;class DZ extends lo{initialize(){this.configDefine("scale",{defaultValue:Bn()}),this.configDefine("direction",{defaultValue:ri.Left}),this.configDefine("showAxis",{defaultValue:!0}),this.configDefine("showTicks",{defaultValue:!1}),this.configDefine("gridStyle",{defaultValue:Gn.Dashed}),this.configDefine("gridWidth",{defaultValue:0}),this.configDefine("height",{defaultValue:0}),this.configDefine("ticks",{defaultValue:null}),this.configDefine("numberFormat",{defaultValue:null}),this.configDefine("labelPosition",{defaultValue:on.Auto}),this.configDefine("topPadding",{defaultValue:0}),this.configDefine("tickFormat",{defaultValue:null});const e=this.base.append("g");this.layer("axis",e,{dataBind:(n,o)=>n.selectAll(".bc-axis-vertical").data(o),insert:n=>n.append("g").attr("class","bc-axis bc-axis-vertical"),events:{"merge:transition":n=>{const o=this.config("scale"),r=this.config("direction"),i=this.config("showAxis"),s=this.config("showTicks"),a=this.config("labelPosition"),l=this.config("gridWidth"),c=this.config("height"),u=r===ri.Right?s8(o):a8(o);s||u.tickSizeOuter(0);const d=this.config("ticks");if(d)u.tickValues(d);else if(c>0){const v=Math.max(2,Math.floor(c/N8));u.ticks(v)}const f=this.config("tickFormat");if(f)u.tickFormat(f);else{const v=this.config("numberFormat"),m=v?Ia(v):null;m&&u.tickFormat(m)}const h=_t(),g=n.node();if(g){h>0?n.duration(h).call(u):Ae(g).call(u),i||Ae(g).select(".domain").remove(),s||Ae(g).selectAll(".tick line").attr("opacity",0);const m=a===on.Auto?l>0&&l<400?on.Inside:on.Outside:a;if(m===on.Inside){const b=i?4:0,y=h>0?n.selectAll(".tick text"):Ae(g).selectAll(".tick text");r===ri.Right?y.attr("x",-b).attr("dy","-0.4em").attr("text-anchor","end"):y.attr("x",b).attr("dy","-0.4em").attr("text-anchor","start")}else m===on.Off&&Ae(g).selectAll(".tick text").attr("opacity",0)}},exit:n=>{n.remove()},enter:n=>{const o=this.config("scale"),r=this.config("direction"),i=this.config("labelPosition"),s=this.config("gridWidth"),a=this.config("height"),l=this.config("topPadding"),c=r===ri.Right?s8(o):a8(o);this.config("showTicks")||c.tickSizeOuter(0);const u=this.config("ticks");if(u)c.tickValues(u);else if(a>0){const m=Math.max(2,Math.floor(a/N8));c.ticks(m)}const d=this.config("tickFormat");if(d)c.tickFormat(d);else{const m=this.config("numberFormat"),b=m?Ia(m):null;b&&c.tickFormat(b)}n.call(c);const f=this.config("showAxis"),h=this.config("showTicks");f||n.select(".domain").remove();const v=i===on.Auto?s>0&&s<400?on.Inside:on.Outside:i;if(v===on.Inside){const m=f?4:0;if(r===ri.Right?n.selectAll(".tick text").attr("x",-m).attr("dy","-0.4em").attr("text-anchor","end"):n.selectAll(".tick text").attr("x",m).attr("dy","-0.4em").attr("text-anchor","start"),h?n.selectAll(".tick line").attr("x2",r===ri.Right?-6:6):n.selectAll(".tick line").remove(),l>0&&f){const b=n.select(".domain");if(!b.empty()){const y=b.attr("d"),x=y.replace(/V[\d.]+/,`V${-l}`);x!==y&&b.attr("d",x)}}}else h||n.selectAll(".tick line").remove(),v===on.Off&&n.selectAll(".tick text").remove()}}})}postDraw(){const e=this.config("gridStyle"),n=this.config("gridWidth"),o=this.config("direction"),r=this.base.select(".bc-axis-vertical").node();if(r&&e!==Gn.None&&n>0){const i=o===ri.Right?-n:n;EZ(r,e,i)}}}function EZ(t,e,n){var a;const o=((a=t.ownerSVGElement)==null?void 0:a.parentElement)??document.documentElement,i=getComputedStyle(o).getPropertyValue("--bc-grid-color").trim()||"#ccc";Ae(t).selectAll(".tick").each(function(){const c=Ae(this).append("line").attr("class","bc-grid-line").attr("x1",0).attr("x2",n).attr("y1",0).attr("y2",0).attr("stroke",i).attr("stroke-width",1);e===Gn.Dashed?c.attr("stroke-dasharray","4,4"):e===Gn.Dotted&&c.attr("stroke-dasharray","1,3")})}function YC(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var np={exports:{}},IZ=np.exports,R8;function NZ(){return R8||(R8=1,(function(t,e){(function(n,o){t.exports=o()})(IZ,(function(){var n=1e3,o=6e4,r=36e5,i="millisecond",s="second",a="minute",l="hour",c="day",u="week",d="month",f="quarter",h="year",g="date",v="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(P){var $=["th","st","nd","rd"],F=P%100;return"["+P+($[(F-20)%10]||$[F]||$[0])+"]"}},x=function(P,$,F){var V=String(P);return!V||V.length>=$?P:""+Array($+1-V.length).join(F)+P},_={s:x,z:function(P){var $=-P.utcOffset(),F=Math.abs($),V=Math.floor(F/60),U=F%60;return($<=0?"+":"-")+x(V,2,"0")+":"+x(U,2,"0")},m:function P($,F){if($.date()<F.date())return-P(F,$);var V=12*(F.year()-$.year())+(F.month()-$.month()),U=$.clone().add(V,d),K=F-U<0,ae=$.clone().add(V+(K?-1:1),d);return+(-(V+(F-U)/(K?U-ae:ae-U))||0)},a:function(P){return P<0?Math.ceil(P)||0:Math.floor(P)},p:function(P){return{M:d,y:h,w:u,d:c,D:g,h:l,m:a,s,ms:i,Q:f}[P]||String(P||"").toLowerCase().replace(/s$/,"")},u:function(P){return P===void 0}},k="en",E={};E[k]=y;var L="$isDayjsObject",S=function(P){return P instanceof C||!(!P||!P[L])},B=function P($,F,V){var U;if(!$)return k;if(typeof $=="string"){var K=$.toLowerCase();E[K]&&(U=K),F&&(E[K]=F,U=K);var ae=$.split("-");if(!U&&ae.length>1)return P(ae[0])}else{var me=$.name;E[me]=$,U=me}return!V&&U&&(k=U),U||!V&&k},D=function(P,$){if(S(P))return P.clone();var F=typeof $=="object"?$:{};return F.date=P,F.args=arguments,new C(F)},N=_;N.l=B,N.i=S,N.w=function(P,$){return D(P,{locale:$.$L,utc:$.$u,x:$.$x,$offset:$.$offset})};var C=(function(){function P(F){this.$L=B(F.locale,null,!0),this.parse(F),this.$x=this.$x||F.x||{},this[L]=!0}var $=P.prototype;return $.parse=function(F){this.$d=(function(V){var U=V.date,K=V.utc;if(U===null)return new Date(NaN);if(N.u(U))return new Date;if(U instanceof Date)return new Date(U);if(typeof U=="string"&&!/Z$/i.test(U)){var ae=U.match(m);if(ae){var me=ae[2]-1||0,de=(ae[7]||"0").substring(0,3);return K?new Date(Date.UTC(ae[1],me,ae[3]||1,ae[4]||0,ae[5]||0,ae[6]||0,de)):new Date(ae[1],me,ae[3]||1,ae[4]||0,ae[5]||0,ae[6]||0,de)}}return new Date(U)})(F),this.init()},$.init=function(){var F=this.$d;this.$y=F.getFullYear(),this.$M=F.getMonth(),this.$D=F.getDate(),this.$W=F.getDay(),this.$H=F.getHours(),this.$m=F.getMinutes(),this.$s=F.getSeconds(),this.$ms=F.getMilliseconds()},$.$utils=function(){return N},$.isValid=function(){return this.$d.toString()!==v},$.isSame=function(F,V){var U=D(F);return this.startOf(V)<=U&&U<=this.endOf(V)},$.isAfter=function(F,V){return D(F)<this.startOf(V)},$.isBefore=function(F,V){return this.endOf(V)<D(F)},$.$g=function(F,V,U){return N.u(F)?this[V]:this.set(U,F)},$.unix=function(){return Math.floor(this.valueOf()/1e3)},$.valueOf=function(){return this.$d.getTime()},$.startOf=function(F,V){var U=this,K=!!N.u(V)||V,ae=N.p(F),me=function(re,oe){var he=N.w(U.$u?Date.UTC(U.$y,oe,re):new Date(U.$y,oe,re),U);return K?he:he.endOf(c)},de=function(re,oe){return N.w(U.toDate()[re].apply(U.toDate("s"),(K?[0,0,0,0]:[23,59,59,999]).slice(oe)),U)},ve=this.$W,te=this.$M,pe=this.$D,we="set"+(this.$u?"UTC":"");switch(ae){case h:return K?me(1,0):me(31,11);case d:return K?me(1,te):me(0,te+1);case u:var J=this.$locale().weekStart||0,ge=(ve<J?ve+7:ve)-J;return me(K?pe-ge:pe+(6-ge),te);case c:case g:return de(we+"Hours",0);case l:return de(we+"Minutes",1);case a:return de(we+"Seconds",2);case s:return de(we+"Milliseconds",3);default:return this.clone()}},$.endOf=function(F){return this.startOf(F,!1)},$.$set=function(F,V){var U,K=N.p(F),ae="set"+(this.$u?"UTC":""),me=(U={},U[c]=ae+"Date",U[g]=ae+"Date",U[d]=ae+"Month",U[h]=ae+"FullYear",U[l]=ae+"Hours",U[a]=ae+"Minutes",U[s]=ae+"Seconds",U[i]=ae+"Milliseconds",U)[K],de=K===c?this.$D+(V-this.$W):V;if(K===d||K===h){var ve=this.clone().set(g,1);ve.$d[me](de),ve.init(),this.$d=ve.set(g,Math.min(this.$D,ve.daysInMonth())).$d}else me&&this.$d[me](de);return this.init(),this},$.set=function(F,V){return this.clone().$set(F,V)},$.get=function(F){return this[N.p(F)]()},$.add=function(F,V){var U,K=this;F=Number(F);var ae=N.p(V),me=function(te){var pe=D(K);return N.w(pe.date(pe.date()+Math.round(te*F)),K)};if(ae===d)return this.set(d,this.$M+F);if(ae===h)return this.set(h,this.$y+F);if(ae===c)return me(1);if(ae===u)return me(7);var de=(U={},U[a]=o,U[l]=r,U[s]=n,U)[ae]||1,ve=this.$d.getTime()+F*de;return N.w(ve,this)},$.subtract=function(F,V){return this.add(-1*F,V)},$.format=function(F){var V=this,U=this.$locale();if(!this.isValid())return U.invalidDate||v;var K=F||"YYYY-MM-DDTHH:mm:ssZ",ae=N.z(this),me=this.$H,de=this.$m,ve=this.$M,te=U.weekdays,pe=U.months,we=U.meridiem,J=function(oe,he,I,G){return oe&&(oe[he]||oe(V,K))||I[he].slice(0,G)},ge=function(oe){return N.s(me%12||12,oe,"0")},re=we||function(oe,he,I){var G=oe<12?"AM":"PM";return I?G.toLowerCase():G};return K.replace(b,(function(oe,he){return he||(function(I){switch(I){case"YY":return String(V.$y).slice(-2);case"YYYY":return N.s(V.$y,4,"0");case"M":return ve+1;case"MM":return N.s(ve+1,2,"0");case"MMM":return J(U.monthsShort,ve,pe,3);case"MMMM":return J(pe,ve);case"D":return V.$D;case"DD":return N.s(V.$D,2,"0");case"d":return String(V.$W);case"dd":return J(U.weekdaysMin,V.$W,te,2);case"ddd":return J(U.weekdaysShort,V.$W,te,3);case"dddd":return te[V.$W];case"H":return String(me);case"HH":return N.s(me,2,"0");case"h":return ge(1);case"hh":return ge(2);case"a":return re(me,de,!0);case"A":return re(me,de,!1);case"m":return String(de);case"mm":return N.s(de,2,"0");case"s":return String(V.$s);case"ss":return N.s(V.$s,2,"0");case"SSS":return N.s(V.$ms,3,"0");case"Z":return ae}return null})(oe)||ae.replace(":","")}))},$.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},$.diff=function(F,V,U){var K,ae=this,me=N.p(V),de=D(F),ve=(de.utcOffset()-this.utcOffset())*o,te=this-de,pe=function(){return N.m(ae,de)};switch(me){case h:K=pe()/12;break;case d:K=pe();break;case f:K=pe()/3;break;case u:K=(te-ve)/6048e5;break;case c:K=(te-ve)/864e5;break;case l:K=te/r;break;case a:K=te/o;break;case s:K=te/n;break;default:K=te}return U?K:N.a(K)},$.daysInMonth=function(){return this.endOf(d).$D},$.$locale=function(){return E[this.$L]},$.locale=function(F,V){if(!F)return this.$L;var U=this.clone(),K=B(F,V,!0);return K&&(U.$L=K),U},$.clone=function(){return N.w(this.$d,this)},$.toDate=function(){return new Date(this.valueOf())},$.toJSON=function(){return this.isValid()?this.toISOString():null},$.toISOString=function(){return this.$d.toISOString()},$.toString=function(){return this.$d.toUTCString()},P})(),M=C.prototype;return D.prototype=M,[["$ms",i],["$s",s],["$m",a],["$H",l],["$W",c],["$M",d],["$y",h],["$D",g]].forEach((function(P){M[P[1]]=function($){return this.$g($,P[0],P[1])}})),D.extend=function(P,$){return P.$i||(P($,C,D),P.$i=!0),D},D.locale=B,D.isDayjs=S,D.unix=function(P){return D(1e3*P)},D.en=E[k],D.Ls=E,D.p={},D}))})(np)),np.exports}var RZ=NZ();const Ic=YC(RZ);var op={exports:{}},FZ=op.exports,F8;function VZ(){return F8||(F8=1,(function(t,e){(function(n,o){t.exports=o()})(FZ,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},o=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,i=/\d\d/,s=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,l={},c=function(m){return(m=+m)+(m>68?1900:2e3)},u=function(m){return function(b){this[m]=+b}},d=[/[+-]\d\d:?(\d\d)?|Z/,function(m){(this.zone||(this.zone={})).offset=(function(b){if(!b||b==="Z")return 0;var y=b.match(/([+-]|\d\d)/g),x=60*y[1]+(+y[2]||0);return x===0?0:y[0]==="+"?-x:x})(m)}],f=function(m){var b=l[m];return b&&(b.indexOf?b:b.s.concat(b.f))},h=function(m,b){var y,x=l.meridiem;if(x){for(var _=1;_<=24;_+=1)if(m.indexOf(x(_,0,b))>-1){y=_>12;break}}else y=m===(b?"pm":"PM");return y},g={A:[a,function(m){this.afternoon=h(m,!1)}],a:[a,function(m){this.afternoon=h(m,!0)}],Q:[r,function(m){this.month=3*(m-1)+1}],S:[r,function(m){this.milliseconds=100*+m}],SS:[i,function(m){this.milliseconds=10*+m}],SSS:[/\d{3}/,function(m){this.milliseconds=+m}],s:[s,u("seconds")],ss:[s,u("seconds")],m:[s,u("minutes")],mm:[s,u("minutes")],H:[s,u("hours")],h:[s,u("hours")],HH:[s,u("hours")],hh:[s,u("hours")],D:[s,u("day")],DD:[i,u("day")],Do:[a,function(m){var b=l.ordinal,y=m.match(/\d+/);if(this.day=y[0],b)for(var x=1;x<=31;x+=1)b(x).replace(/\[|\]/g,"")===m&&(this.day=x)}],w:[s,u("week")],ww:[i,u("week")],M:[s,u("month")],MM:[i,u("month")],MMM:[a,function(m){var b=f("months"),y=(f("monthsShort")||b.map((function(x){return x.slice(0,3)}))).indexOf(m)+1;if(y<1)throw new Error;this.month=y%12||y}],MMMM:[a,function(m){var b=f("months").indexOf(m)+1;if(b<1)throw new Error;this.month=b%12||b}],Y:[/[+-]?\d+/,u("year")],YY:[i,function(m){this.year=c(m)}],YYYY:[/\d{4}/,u("year")],Z:d,ZZ:d};function v(m){var b,y;b=m,y=l&&l.formats;for(var x=(m=b.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(D,N,C){var M=C&&C.toUpperCase();return N||y[C]||n[C]||y[M].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(P,$,F){return $||F.slice(1)}))}))).match(o),_=x.length,k=0;k<_;k+=1){var E=x[k],L=g[E],S=L&&L[0],B=L&&L[1];x[k]=B?{regex:S,parser:B}:E.replace(/^\[|\]$/g,"")}return function(D){for(var N={},C=0,M=0;C<_;C+=1){var P=x[C];if(typeof P=="string")M+=P.length;else{var $=P.regex,F=P.parser,V=D.slice(M),U=$.exec(V)[0];F.call(N,U),D=D.replace(U,"")}}return(function(K){var ae=K.afternoon;if(ae!==void 0){var me=K.hours;ae?me<12&&(K.hours+=12):me===12&&(K.hours=0),delete K.afternoon}})(N),N}}return function(m,b,y){y.p.customParseFormat=!0,m&&m.parseTwoDigitYear&&(c=m.parseTwoDigitYear);var x=b.prototype,_=x.parse;x.parse=function(k){var E=k.date,L=k.utc,S=k.args;this.$u=L;var B=S[1];if(typeof B=="string"){var D=S[2]===!0,N=S[3]===!0,C=D||N,M=S[2];N&&(M=S[2]),l=this.$locale(),!D&&M&&(l=y.Ls[M]),this.$d=(function(V,U,K,ae){try{if(["x","X"].indexOf(U)>-1)return new Date((U==="X"?1e3:1)*V);var me=v(U)(V),de=me.year,ve=me.month,te=me.day,pe=me.hours,we=me.minutes,J=me.seconds,ge=me.milliseconds,re=me.zone,oe=me.week,he=new Date,I=te||(de||ve?1:he.getDate()),G=de||he.getFullYear(),Y=0;de&&!ve||(Y=ve>0?ve-1:he.getMonth());var se,fe=pe||0,ne=we||0,Q=J||0,q=ge||0;return re?new Date(Date.UTC(G,Y,I,fe,ne,Q,q+60*re.offset*1e3)):K?new Date(Date.UTC(G,Y,I,fe,ne,Q,q)):(se=new Date(G,Y,I,fe,ne,Q,q),oe&&(se=ae(se).week(oe).toDate()),se)}catch{return new Date("")}})(E,B,L,y),this.init(),M&&M!==!0&&(this.$L=this.locale(M).$L),C&&E!=this.format(B)&&(this.$d=new Date("")),l={}}else if(B instanceof Array)for(var P=B.length,$=1;$<=P;$+=1){S[1]=B[$-1];var F=y.apply(this,S);if(F.isValid()){this.$d=F.$d,this.$L=F.$L,this.init();break}$===P&&(this.$d=new Date(""))}else _.call(this,k)}}}))})(op)),op.exports}var zZ=VZ();const HZ=YC(zZ);Ic.extend(HZ);const jC=["YYYY-MM-DDTHH:mm:ss","YYYY-MM-DD HH:mm","YYYY-MM-DD","YYYY/MM/DD","MM/DD/YYYY","M/D/YYYY","M/D/YY","DD/MM/YYYY","DD.MM.YYYY","MMM D, YYYY","MMMM D, YYYY","MMM YYYY","MMMM YYYY","YYYY-MM","YYYY/MM","YYYY"];function WZ(t){return t.includes("HH")||t.includes("mm")||t.includes("ss")?"datetime":t.includes("DD")||new RegExp("(?<![MA-Z])D(?!D)").test(t)?"day":t==="YYYY"?"year":t.includes("MM")||t.includes("MMM")||t.includes("MMMM")||t.includes("M/")?"month":"day"}function o0(t){return new Date(Date.UTC(t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()))}function UZ(t){const e=t.trim();if(!e)return null;if(/^\d{4}$/.test(e)){const n=Ic(e,"YYYY",!0);return n.isValid()?o0(n):null}for(const n of jC){if(n==="YYYY")continue;const o=Ic(e,n,!0);if(o.isValid())return o0(o)}return null}function tf(t){const e=t.trim();if(!e)return;const n=UZ(e);if(n)return n.getTime();const o=parseFloat(e);if(!isNaN(o))return o}function Dm(t){if(t.length===0)return null;const e=[];let n=null;const o=t[0].trim();if(!o)return null;if(/^\d{4}$/.test(o)){for(const i of t){const s=i.trim();if(!/^\d{4}$/.test(s))return null;const a=Ic(s,"YYYY",!0);if(!a.isValid())return null;e.push(o0(a))}return{dates:e,granularity:"year"}}const r=[];for(const i of jC)i!=="YYYY"&&Ic(o,i,!0).isValid()&&r.push(i);if(r.length===0)return null;for(const i of r){const s=[];let a=!0;for(const l of t){const c=Ic(l.trim(),i,!0);if(!c.isValid()){a=!1;break}s.push(o0(c))}if(a){n=i,e.push(...s);break}}return n?{dates:e,granularity:WZ(n)}:null}const GZ=60,Od=10,n2=1.3,qZ=12,YZ=3,jZ=14,XZ=10;function KZ(t,e,n=YZ){if(t==="")return[""];if(t.length*Od<=e)return[t];const o=t.split(/\s+/).filter(Boolean);if(o.length===0)return null;const r=[];let i="";for(const s of o){if(s.length*Od>e)return null;const a=i?`${i} ${s}`:s;if(a.length*Od<=e)i=a;else if(r.push(i),i=s,r.length>=n)return null}return i&&r.push(i),r.length>n?null:r}const ZZ={year:"%Y",month:"%b %Y",day:"%b %-d, %Y",datetime:"%b %-d, %Y %H:%M"};function QZ(t){return typeof t.step=="function"}function XC(t,e){const n=Dm(e);if(t&&t.includes("%")){if(n){const o=Zd(t),r=new Map;return e.forEach((i,s)=>r.set(i,n.dates[s])),i=>{if(i instanceof Date)return o(i);const s=r.get(String(i));return s?o(s):String(i)}}return null}if(t)return Ia(t)??yu(t);if(n){const o=Zd(ZZ[n.granularity]??"%Y-%m-%d"),r=new Map;return e.forEach((i,s)=>r.set(i,n.dates[s])),i=>{if(i instanceof Date)return o(i);const s=r.get(String(i));return s?o(s):String(i)}}return null}function Of(t,e){let n=0;for(const o of t){const i=(e?e(o):o).length*Od;i>n&&(n=i)}return n}function JZ(t,e,n){if(t.length<=1)return t;const o=n?Of(t,n):t.reduce((c,u)=>Math.max(c,u.length),0)*Od,r=Math.max(16,Math.ceil(o)+8),i=Math.max(2,Math.floor(e/r));if(t.length<=i)return t;const s=Math.ceil(t.length/i),a=t.filter((c,u)=>u%s===0),l=t[t.length-1];return a[a.length-1]!==l&&a.push(l),a}function eQ(t,e,n,o){if(t.length<=1||e<=0||n==="horizontal")return!1;if(n==="vertical")return!0;if(Dm(t))return!1;const r=Of(t,o??null),i=e/t.length;return r>i*n2}function tQ(t,e){if(t.length===0)return 0;const n=Of(t,e??null);return Math.ceil(n)+qZ}function nQ(t){let e=1;for(const n of t)n.length>e&&(e=n.length);return e<=1?0:e*jZ+XZ}function o2(t,e,n={},o=24){if(t.length===0||e<=0||n.labelPosition==="off"||n.labelPosition==="inside")return;const r=n.tickFormat?n.tickFormat:XC(n.numberFormat??null,t),i=n.labelRotation??"auto";if(!(i!=="vertical"&&Dm(t)!==null)&&t.length>1){const u=e/t.length*n2,f=Of(t,r)>u;if(i!=="vertical"&&f){const h=KC(t,u,r);if(h){const g=nQ(Array.from(h.values()));return g>o?g:void 0}}}if(!eQ(t,e,i,r))return;const l=tQ(t,r);return l>o?l:void 0}function KC(t,e,n){const o=new Map;let r=!1;for(const i of t){const s=n?n(i):i,a=KZ(s,e);if(a===null)return null;o.set(i,a),a.length>1&&(r=!0)}return r?o:null}function oQ(t,e){t.selectAll(".tick").each(function(){const n=Ae(this),o=n.datum(),r=o instanceof Date?o.toISOString():String(o),i=e.get(r);if(!i||i.length<=1)return;const s=n.select("text");s.empty()||(s.attr("dy",null).text(null),i.forEach((a,l)=>{s.append("tspan").attr("x",0).attr("dy",l===0?"0.71em":"1em").text(a)}))})}class rQ extends lo{initialize(){this.configDefine("scale",{defaultValue:Zn()}),this.configDefine("height",{defaultValue:0}),this.configDefine("tickPosition",{defaultValue:"below"}),this.configDefine("showAxis",{defaultValue:!0}),this.configDefine("showTicks",{defaultValue:!1}),this.configDefine("gridStyle",{defaultValue:"dashed"}),this.configDefine("ticks",{defaultValue:null}),this.configDefine("numberFormat",{defaultValue:null}),this.configDefine("width",{defaultValue:0}),this.configDefine("labels",{defaultValue:[]}),this.configDefine("labelPosition",{defaultValue:"auto"}),this.configDefine("labelRotation",{defaultValue:"auto"}),this.configDefine("zeroY",{defaultValue:null}),this.configDefine("tickFormat",{defaultValue:null});const e=this.base.append("g");this.layer("axis",e,{dataBind:(n,o)=>n.selectAll(".bc-axis-horizontal").data(o),insert:n=>n.append("g").attr("class","bc-axis bc-axis-horizontal"),events:{"merge:transition":n=>{this.applyAxis(n,"merge")},exit:n=>{n.remove()},enter:n=>{this.applyAxis(n,"enter")}}})}applyAxis(e,n){const o=this.config("scale"),r=this.config("scale"),i=this.config("tickPosition"),s=this.config("height"),a=this.config("labelPosition"),l=this.config("labelRotation"),c=this.config("width"),u=this.config("numberFormat"),d=this.config("labels"),f=this.config("tickFormat"),h=i==="above"?eY(o):tY(o);this.config("showTicks")||h.tickSizeOuter(0);const g=f||XC(u,d);g&&h.tickFormat(g);const v=QZ(r),m=v?r.domain():[],b=v&&l!=="vertical"&&Dm(m)!==null;let y=null,x=!1;if(v&&!b&&m.length>1&&c>0){const N=c/m.length*n2,M=Of(m,g)>N;l==="vertical"?x=!0:M&&(y=KC(m,N,g),!y&&l==="auto"&&(x=!0))}let _=this.config("ticks");if(!_&&c>0)if(v){if(b){const D=JZ(m,c,g);D.length<m.length&&(_=D)}}else{const D=Math.max(2,Math.floor(c/GZ));h.ticks(D)}_&&h.tickValues(_);const k=i==="above"?0:s,E=e.node(),L=n==="merge"?_t():0;if(n==="merge"){if(!E)return;L>0?(e.attr("transform",`translate(0,${k})`),e.duration(L).call(h)):Ae(E).attr("transform",`translate(0,${k})`).call(h)}else e.attr("transform",`translate(0,${k})`),e.call(h);const S=L>0?e:E?Ae(E):e;if(!this.config("showAxis"))S.select(".domain").remove();else if(n==="enter"){const D=this.config("zeroY");if(D!=null){const N=D-(i==="above"?0:s);S.select(".domain").attr("transform",`translate(0,${N})`)}}this.config("showTicks")||S.selectAll(".tick line").remove();const B=a==="auto"?"outside":a;B==="off"?S.selectAll(".tick text").remove():B==="inside"&&S.selectAll(".tick text").attr("y",0).attr("dy","-0.6em"),x&&B!=="off"?S.selectAll(".tick text").attr("transform","rotate(-90)").attr("text-anchor","end").attr("x",i==="above"?9:-9).attr("y",0).attr("dy","0.32em"):S.selectAll(".tick text").attr("transform",null),y&&B!=="off"&&oQ(S,y)}postDraw(){const e=this.config("gridStyle"),n=this.config("height"),o=this.base.select(".bc-axis-horizontal").node();o&&e!=="none"&&n>0&&iQ(o,e,n)}}function iQ(t,e,n){var a;const o=((a=t.ownerSVGElement)==null?void 0:a.parentElement)??document.documentElement,i=getComputedStyle(o).getPropertyValue("--bc-grid-color").trim()||"#ccc";Ae(t).selectAll(".tick").each(function(){const c=Ae(this).append("line").attr("class","bc-grid-line").attr("x1",0).attr("x2",0).attr("y1",0).attr("y2",-n).attr("stroke",i).attr("stroke-width",1);e==="dashed"?c.attr("stroke-dasharray","4,4"):e==="dotted"&&c.attr("stroke-dasharray","1,3")})}const ZC=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"],sQ=200,V8=.2;class aQ extends lo{initialize(){this.configDefine("colors",{defaultValue:ZC}),this.configDefine("yOffset",{defaultValue:-10}),this.configDefine("layout",{defaultValue:"horizontal"}),this.configDefine("valueSuffixes",{defaultValue:[]}),this.configDefine("maxWidth",{defaultValue:0});const e=this.base.append("g").attr("class","bc-legend"),n=o=>{var f,h;const r=this.config("colors"),i=this.config("layout"),s=this.config("valueSuffixes"),a=((h=(f=this.base.node())==null?void 0:f.ownerSVGElement)==null?void 0:h.parentElement)??document.documentElement,l=getComputedStyle(a).getPropertyValue("--bc-text-color").trim()||"#555",c=this.config("maxWidth");let u=0,d=0;o.each(function(g,v){const m=Ae(this),b=s[v],x=16+(b?g.length+1+b.length:g.length)*7+12;i==="horizontal"&&c>0&&u>0&&u+x>c&&(u=0,d+=20),m.attr("transform",`translate(${u},${d})`).attr("data-series",g).style("cursor","default");let _=m.select("rect");_.empty()&&(_=m.append("rect").attr("width",12).attr("height",12)),_.attr("fill",r[v%r.length]);let k=m.select("text");k.empty()&&(k=m.append("text").attr("x",16).attr("y",10).attr("font-size","12px")),k.attr("fill",l),k.selectAll("tspan").remove(),b?(k.text(null),k.append("tspan").attr("font-weight","bold").text(g),k.append("tspan").text(` ${b}`)):k.text(g),i==="vertical"?d+=20:u+=x})};this.layer("items",e,{dataBind:(o,r)=>o.selectAll(".bc-legend-item").data(r,i=>i),insert:o=>o.append("g").attr("class","bc-legend-item"),events:{enter:n,update:n}})}preDraw(){const e=this.config("yOffset");this.base.select(".bc-legend").attr("transform",`translate(0,${e})`)}}function lQ(t){const e=Ae(t).selectAll(".bc-legend-item");if(e.empty())return;let n=null,o=null;function r(s){o=s,e.each(function(){const l=Ae(this),c=l.attr("data-series")===s;l.transition().duration(150).style("opacity",c?1:V8)}),Ae(t).selectAll("[data-series]").filter(function(){return!this.closest(".bc-legend")}).each(function(){const l=Ae(this),c=l.attr("data-series")===s,u=this.classList.contains("bc-direct-label")||this.classList.contains("bc-value-label");l.transition().duration(150).style("opacity",c?1:u?0:V8)})}function i(){o=null,e.transition().duration(150).style("opacity",1),Ae(t).selectAll("[data-series]").filter(function(){return!this.closest(".bc-legend")}).transition().duration(150).style("opacity",null)}e.on("mouseenter.bcHighlight",null).on("mouseleave.bcHighlight",null).on("mouseenter.bcHighlight",function(){const s=Ae(this).attr("data-series")??"";n&&clearTimeout(n),n=setTimeout(()=>r(s),ec(sQ))}).on("mouseleave.bcHighlight",()=>{n&&(clearTimeout(n),n=null),o!==null&&i()})}function Xa(t,e,n=ZC,o=-10,r="top",i="start",s=0,a=0,l=0,c=[],u={}){const d=r==="left"||r==="right"?"vertical":"horizontal",f=new aQ(Ae(t));f.config({colors:n,yOffset:o,layout:d,valueSuffixes:c,maxWidth:s}),f.draw(e);const h=t.querySelector(".bc-legend");if(h){let g=0,v=0;const m=e.map((k,E)=>{const L=c[E];return L?k.length+1+L.length:k.length});if(d==="horizontal"){const k=m.map(B=>16+B*7+12);let E=1,L=0,S=0;for(const B of k)s>0&&L>0&&L+B>s?(S=Math.max(S,L),E++,L=B):L+=B;S=Math.max(S,L),g=S,v=E*20}else g=Math.max(...m)*7+16+8,v=e.length*20;const b=u.left??0,y=u.right??0;let x=l,_=o;d==="horizontal"?i==="middle"?x+=-b+(s+b+y-g)/2:i==="end"?x+=s+y-g:x+=-b:i==="middle"?_+=(a-v)/2:i==="end"&&(_+=a-v),h.setAttribute("transform",`translate(${x},${_})`)}return lQ(t),h}const QC=[{name:"Blueprint",label:"Blueprint",colors:["#2563A0","#D4A63A","#C94044","#2D8659","#4B90CF","#163A65"]},{name:"JosefAlbers",label:"Albers",colors:["#c00559","#de1f6c","#f3a20d","#f07a13","#de6716"]},{name:"Durorthod",label:"Amber",colors:["#2c0c00","#803c15","#c6782c","#ffa91d","#fff3ad"]},{name:"X41",label:"Berry",colors:["#411f6b","#623976","#be3979","#db928a","#e2c6a6"]},{name:"Bright",label:"Bright",colors:["#462255","#ff8811","#9dd9d2","#046e8f","#d44d5c"]},{name:"Cancri",label:"Cancri",colors:["#343854","#8c384d","#cf2438","#d95e31","#f0c742","#f8f0e5"]},{name:"Ceres",label:"Ceres",colors:["#181d20","#4a5f71","#6f8ba0","#f8f9fa"]},{name:"MarcChagall",label:"Chagall",colors:["#3f6f76","#69b7ce","#c65840","#f4ce4b","#62496f"]},{name:"Pelewensis",label:"Coral",colors:["#e2b000","#f7f656","#2449a2","#809098","#0d1115"]},{name:"Deathmasks",label:"Deathmasks",colors:["#926159","#87876e","#c7d2d8","#62b7c8","#43535c","#23313c"]},{name:"Leucosternon",label:"Deep Sea",colors:["#071140","#0e34b2","#207cf5","#9ec8ff","#fbfb53"]},{name:"Deelite",label:"Deelite",colors:["#48448e","#8ccc58","#fc4d97","#b82578"]},{name:"X10",label:"Dusk",colors:["#2a2432","#4f3855","#846d86","#efefcf","#d5b77d","#a89e5e"]},{name:"Vitrixerand",label:"Earth",colors:["#281b27","#723f27","#9b6044","#b5804c","#facd9a"]},{name:"Egypt",label:"Egypt",colors:["#dd5129","#0f7ba2","#43b284","#fab255"]},{name:"ElectronicNight",label:"Electric Night",colors:["#cb54d6","#3e45c4","#21191a","#362f78","#57b4ae"]},{name:"LutjanusSebae",label:"Emperor",colors:["#e5e9ea","#a2bac5","#ce3d21","#992216","#490d07"]},{name:"Enara",label:"Enara",colors:["#262626","#3d5983","#5a8a54","#cfb023"]},{name:"Camo871",label:"Fiesta",colors:["#ffff14","#fea31d","#ce2d41","#3a3fa3"]},{name:"Folklore",label:"Folklore",colors:["#272727","#5c5c5c","#bababa","#f8f8f8"]},{name:"Fritsch",label:"Fritsch",colors:["#0f8d7b","#8942bd","#1e1a1a","#eadd17"]},{name:"AgSunset",label:"Glow",colors:["#4b2991","#872ca2","#c0369d","#ea4f88","#fa7876","#f6a97a","#edd9a3"]},{name:"Harvey",label:"Harvey",colors:["#c6d4d6","#274c4f","#a4432d","#b17c51"]},{name:"Heep",label:"Heep",colors:["#466e9a","#e84d45","#21201c","#a1baac"]},{name:"Imperator",label:"Imperator",colors:["#04093a","#0527b4","#555dfe","#faf830","#b8980f"]},{name:"Klimt",label:"Klimt",colors:["#df9ed4","#c93f55","#eacc62","#469d76","#3c4b99","#924099"]},{name:"KnickCity",label:"Knick City",colors:["#0c2340","#ff6720","#707372","#c8c9c7"]},{name:"London",label:"London",colors:["#bd241e","#e56b1e","#ffcd22","#15274d"]},{name:"Lover",label:"Lover",colors:["#b8396b","#ffd1d7","#fff5cc","#76bae0","#b28f81","#54483e"]},{name:"Maya",label:"Maya",colors:["#3d5a80","#98c1d9","#e0fbfc","#ee6c4d","#293241"]},{name:"X24",label:"Mocha",colors:["#2b1917","#7e5945","#bc927b","#f1e6e1"]},{name:"Camo873",label:"Neon",colors:["#132f8a","#5a56c8","#fc7ead","#ffca3e"]},{name:"NetsCity",label:"Nets City",colors:["#010101","#ffb81c","#da291c","#004c97","#418fde"]},{name:"Nodoubt",label:"No Doubt",colors:["#385581","#6dbac6","#dac190","#c9052c"]},{name:"ClaesOldenburg",label:"Oldenburg",colors:["#95b1c9","#263656","#698946","#f8d440","#c82720"]},{name:"Peacesells",label:"Peace Sells",colors:["#9a5155","#483943","#ecc463","#a497b2"]},{name:"PabloPicasso",label:"Picasso",colors:["#4e7989","#a9011b","#e4a826","#80944e","#dcd6b2"]},{name:"Bifasciatum",label:"Reef",colors:["#080214","#16407b","#2b7ff9","#b1fcfc","#6cbe50"]},{name:"SiameseDream",label:"Siamese Dream",colors:["#f0e9e0","#2f1f16","#a34d2c","#cd8e40"]},{name:"X115",label:"Sienna",colors:["#001a29","#633633","#834a39","#e3b571","#eee6a6"]},{name:"Sixers",label:"Sixers",colors:["#888b8d","#e4d5d3","#003da5","#d50032"]},{name:"SolLeWitt",label:"Sol LeWitt",colors:["#0a71b6","#f9c40a","#190506","#eb5432","#eaf2f0"]},{name:"Sunset",label:"Sunset",colors:["#41476b","#675478","#9e6374","#c67b6f","#de9b71","#efbc82","#fbdfa2"]},{name:"Sunset2",label:"Sunset II",colors:["#1d457f","#61599d","#c36377","#eb7f54","#f2af4a"]},{name:"Sunset3",label:"Sunset III",colors:["#390e40","#701c34","#a63228","#c7662a","#eba42b"]},{name:"Pal9",label:"Tropical",colors:["#273b5b","#c1c243","#e73e26","#2e6657","#e8f5b3","#24a99c"]},{name:"Salvelinus",label:"Trout",colors:["#e6452e","#e49a36","#f9dd4c","#5b4a4c","#01040e"]},{name:"TheovanDoesburg",label:"Van Doesburg",colors:["#bd748f","#3d578e","#bfab68","#dad7d0","#272928"]},{name:"Wizards",label:"Wizards",colors:["#c8102e","#0c2340","#8d9093","#c8c9c7"]},{name:"FrancescoXanto",label:"Xanto",colors:["#2c6aa5","#d9ae2c","#ddc655","#d88c27","#64894d"]},{name:"Zeppelin",label:"Zeppelin",colors:["#efdb15","#739c9c","#0d484c","#c71a08"]}],cQ=Object.fromEntries(QC.map(t=>[t.name,t.colors]));function JC(t){if(!t)return;const e=cQ[t];return e?[...e]:void 0}function e5(){return QC}function Em(t,e){if(!e||e.min===void 0&&e.max===void 0)return t.map((o,r)=>r);const n=[];for(let o=0;o<t.length;o++){const r=tf(t[o]);if(r===void 0){n.push(o);continue}e.min!==void 0&&r<e.min||e.max!==void 0&&r>e.max||n.push(o)}return n}const nf=60;function tc(t){const e=Number.isFinite(t)?Math.max(0,Math.min(100,t)):nf;return e/(e+100)}function ku(t,e,n){let o=0,r=0,i=1/0,s=!0,a=!1;for(const u of t)Number.isFinite(u)&&(a=!0,u<o&&(o=u),u>r&&(r=u),u<=0?s=!1:u<i&&(i=u));n===ou.Log&&a&&s&&(o=i);let l=(e==null?void 0:e.min)??o,c=(e==null?void 0:e.max)??r;if(l>c&&([l,c]=[c,l]),l===c)if(l===0)c=1;else{const u=Math.abs(l)*.1;l=l-u,c=c+u}return[l,c]}function uQ(t){return typeof t.step=="function"}const fh=new WeakMap;class Br{constructor(e){bn(this,"vGroup",null);bn(this,"hGroup",null);bn(this,"vChart",null);bn(this,"hChart",null);bn(this,"container");bn(this,"initialized",!1);this.container=e}static for(e){let n=fh.get(e);return n||(n=new Br(e),fh.set(e,n)),n}static clear(e){fh.delete(e)}detach(){var e,n;(e=this.vGroup)!=null&&e.parentNode&&(Ae(this.vGroup).interrupt().selectAll("*").interrupt(),this.vGroup.querySelectorAll(".bc-grid-line").forEach(o=>o.remove()),this.vGroup.remove()),(n=this.hGroup)!=null&&n.parentNode&&(Ae(this.hGroup).interrupt().selectAll("*").interrupt(),this.hGroup.querySelectorAll(".bc-grid-line").forEach(o=>o.remove()),this.hGroup.remove())}attach(e,n){if(!this.initialized)this.vGroup=document.createElementNS("http://www.w3.org/2000/svg","g"),this.vGroup.setAttribute("class","bc-axis-service-v"),this.hGroup=document.createElementNS("http://www.w3.org/2000/svg","g"),this.hGroup.setAttribute("class","bc-axis-service-h"),e.appendChild(this.vGroup),e.appendChild(this.hGroup),this.vChart=new DZ(Ae(this.vGroup)),this.hChart=new rQ(Ae(this.hGroup)),this.initialized=!0;else{for(const r of[this.vGroup,this.hGroup])Ae(r).selectAll(".tick").interrupt();e.appendChild(this.vGroup),e.appendChild(this.hGroup);const o=1;if(n&&(Math.abs(n.dx)>=o||Math.abs(n.dy)>=o)){const{dx:r,dy:i}=n;for(const s of[this.vGroup,this.hGroup]){s.setAttribute("transform",`translate(${r},${i})`);const a=_t();a>0?Ae(s).transition().duration(a).attrTween("transform",()=>{const l=oo(r,0),c=oo(i,0);return u=>`translate(${l(u)},${c(u)})`}):s.removeAttribute("transform")}}}}update(e){const n=e.order??"vertical-first";n==="horizontal-first"?(this.updateHorizontal(e.horizontal),this.updateVertical(e.vertical)):(this.updateVertical(e.vertical),this.updateHorizontal(e.horizontal)),n==="horizontal-first"?this.hGroup&&this.vGroup&&this.hGroup.parentNode&&this.hGroup.parentNode.insertBefore(this.hGroup,this.vGroup):this.vGroup&&this.hGroup&&this.vGroup.parentNode&&this.vGroup.parentNode.insertBefore(this.vGroup,this.hGroup)}updateVertical(e){if(!this.vChart||!this.vGroup)return;if(!e){this.vGroup.style.display="none";return}this.vGroup.style.display="";const n=e.options;this.vChart.config({scale:e.scale,direction:n.direction??"left",showAxis:n.showAxis??!0,showTicks:n.showTicks??!1,gridStyle:n.gridStyle??"dashed",gridWidth:n.gridWidth??0,height:e.height,ticks:n.ticks??null,numberFormat:n.numberFormat??null,labelPosition:n.labelPosition??"auto",topPadding:n.topPadding??0,tickFormat:n.tickFormat??null}),this.vChart.draw([{placeholder:!0}]);const o=this.vGroup.querySelector(".bc-axis-vertical");o&&(n.direction??"left")==="right"?o.setAttribute("transform",`translate(${n.gridWidth??0},0)`):o&&o.removeAttribute("transform")}updateHorizontal(e){if(!this.hChart||!this.hGroup)return;if(!e){this.hGroup.style.display="none";return}this.hGroup.style.display="";const n=e.options,o=e.scale,r=uQ(o)?o.domain():[];this.hChart.config({scale:o,height:e.height,tickPosition:n.tickPosition??"below",showAxis:n.showAxis??!0,showTicks:n.showTicks??!1,gridStyle:n.gridStyle??"dashed",ticks:n.ticks??null,numberFormat:n.numberFormat??null,width:n.width??0,labels:r,labelPosition:n.labelPosition??"auto",labelRotation:n.labelRotation??"auto",zeroY:n.zeroY??null,tickFormat:n.tickFormat??null}),this.hChart.draw([{placeholder:!0}])}destroy(){this.detach(),this.vChart=null,this.hChart=null,this.vGroup=null,this.hGroup=null,this.initialized=!1,fh.delete(this.container)}}const W1=Math.min,Nc=Math.max,r0=Math.round,ns=t=>({x:t,y:t}),dQ={left:"right",right:"left",bottom:"top",top:"bottom"},fQ={start:"end",end:"start"};function z8(t,e,n){return Nc(t,W1(e,n))}function Im(t,e){return typeof t=="function"?t(e):t}function Fl(t){return t.split("-")[0]}function Nm(t){return t.split("-")[1]}function t5(t){return t==="x"?"y":"x"}function n5(t){return t==="y"?"height":"width"}const hQ=new Set(["top","bottom"]);function ka(t){return hQ.has(Fl(t))?"y":"x"}function o5(t){return t5(ka(t))}function pQ(t,e,n){n===void 0&&(n=!1);const o=Nm(t),r=o5(t),i=n5(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=i0(s)),[s,i0(s)]}function mQ(t){const e=i0(t);return[U1(t),e,U1(e)]}function U1(t){return t.replace(/start|end/g,e=>fQ[e])}const H8=["left","right"],W8=["right","left"],gQ=["top","bottom"],vQ=["bottom","top"];function bQ(t,e,n){switch(t){case"top":case"bottom":return n?e?W8:H8:e?H8:W8;case"left":case"right":return e?gQ:vQ;default:return[]}}function yQ(t,e,n,o){const r=Nm(t);let i=bQ(Fl(t),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),e&&(i=i.concat(i.map(U1)))),i}function i0(t){return t.replace(/left|right|bottom|top/g,e=>dQ[e])}function xQ(t){return{top:0,right:0,bottom:0,left:0,...t}}function wQ(t){return typeof t!="number"?xQ(t):{top:t,right:t,bottom:t,left:t}}function s0(t){const{x:e,y:n,width:o,height:r}=t;return{width:o,height:r,top:n,left:e,right:e+o,bottom:n+r,x:e,y:n}}function U8(t,e,n){let{reference:o,floating:r}=t;const i=ka(e),s=o5(e),a=n5(s),l=Fl(e),c=i==="y",u=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,f=o[a]/2-r[a]/2;let h;switch(l){case"top":h={x:u,y:o.y-r.height};break;case"bottom":h={x:u,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:d};break;case"left":h={x:o.x-r.width,y:d};break;default:h={x:o.x,y:o.y}}switch(Nm(e)){case"start":h[s]-=f*(n&&c?-1:1);break;case"end":h[s]+=f*(n&&c?-1:1);break}return h}async function _Q(t,e){var n;e===void 0&&(e={});const{x:o,y:r,platform:i,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Im(e,t),g=wQ(h),m=a[f?d==="floating"?"reference":"floating":d],b=s0(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),y=d==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),_=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},k=s0(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:x,strategy:l}):y);return{top:(b.top-k.top+g.top)/_.y,bottom:(k.bottom-b.bottom+g.bottom)/_.y,left:(b.left-k.left+g.left)/_.x,right:(k.right-b.right+g.right)/_.x}}const kQ=async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:r}),{x:u,y:d}=U8(c,o,l),f=o,h={},g=0;for(let m=0;m<a.length;m++){var v;const{name:b,fn:y}=a[m],{x,y:_,data:k,reset:E}=await y({x:u,y:d,initialPlacement:o,placement:f,strategy:r,middlewareData:h,rects:c,platform:{...s,detectOverflow:(v=s.detectOverflow)!=null?v:_Q},elements:{reference:t,floating:e}});u=x??u,d=_??d,h={...h,[b]:{...h[b],...k}},E&&g<=50&&(g++,typeof E=="object"&&(E.placement&&(f=E.placement),E.rects&&(c=E.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:r}):E.rects),{x:u,y:d}=U8(c,f,l)),m=-1)}return{x:u,y:d,placement:f,strategy:r,middlewareData:h}},SQ=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...m}=Im(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const b=Fl(r),y=ka(a),x=Fl(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(c.floating)),k=f||(x||!v?[i0(a)]:mQ(a)),E=g!=="none";!f&&E&&k.push(...yQ(a,v,g,_));const L=[a,...k],S=await l.detectOverflow(e,m),B=[];let D=((o=i.flip)==null?void 0:o.overflows)||[];if(u&&B.push(S[b]),d){const P=pQ(r,s,_);B.push(S[P[0]],S[P[1]])}if(D=[...D,{placement:r,overflows:B}],!B.every(P=>P<=0)){var N,C;const P=(((N=i.flip)==null?void 0:N.index)||0)+1,$=L[P];if($&&(!(d==="alignment"?y!==ka($):!1)||D.every(U=>ka(U.placement)===y?U.overflows[0]>0:!0)))return{data:{index:P,overflows:D},reset:{placement:$}};let F=(C=D.filter(V=>V.overflows[0]<=0).sort((V,U)=>V.overflows[1]-U.overflows[1])[0])==null?void 0:C.placement;if(!F)switch(h){case"bestFit":{var M;const V=(M=D.filter(U=>{if(E){const K=ka(U.placement);return K===y||K==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(K=>K>0).reduce((K,ae)=>K+ae,0)]).sort((U,K)=>U[1]-K[1])[0])==null?void 0:M[0];V&&(F=V);break}case"initialPlacement":F=a;break}if(r!==F)return{reset:{placement:F}}}return{}}}},AQ=new Set(["left","top"]);async function CQ(t,e){const{placement:n,platform:o,elements:r}=t,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=Fl(n),a=Nm(n),l=ka(n)==="y",c=AQ.has(s)?-1:1,u=i&&l?-1:1,d=Im(e,t);let{mainAxis:f,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}const $Q=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:r,y:i,placement:s,middlewareData:a}=e,l=await CQ(e,t);return s===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:s}}}}},TQ=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:r,platform:i}=e,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:b=>{let{x:y,y:x}=b;return{x:y,y:x}}},...c}=Im(t,e),u={x:n,y:o},d=await i.detectOverflow(e,c),f=ka(Fl(r)),h=t5(f);let g=u[h],v=u[f];if(s){const b=h==="y"?"top":"left",y=h==="y"?"bottom":"right",x=g+d[b],_=g-d[y];g=z8(x,g,_)}if(a){const b=f==="y"?"top":"left",y=f==="y"?"bottom":"right",x=v+d[b],_=v-d[y];v=z8(x,v,_)}const m=l.fn({...e,[h]:g,[f]:v});return{...m,data:{x:m.x-n,y:m.y-o,enabled:{[h]:s,[f]:a}}}}}};function Rm(){return typeof window<"u"}function Su(t){return r5(t)?(t.nodeName||"").toLowerCase():"#document"}function kr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function na(t){var e;return(e=(r5(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function r5(t){return Rm()?t instanceof Node||t instanceof kr(t).Node:!1}function $i(t){return Rm()?t instanceof Element||t instanceof kr(t).Element:!1}function as(t){return Rm()?t instanceof HTMLElement||t instanceof kr(t).HTMLElement:!1}function G8(t){return!Rm()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof kr(t).ShadowRoot}const MQ=new Set(["inline","contents"]);function Bf(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=Ti(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!MQ.has(r)}const OQ=new Set(["table","td","th"]);function BQ(t){return OQ.has(Su(t))}const LQ=[":popover-open",":modal"];function Fm(t){return LQ.some(e=>{try{return t.matches(e)}catch{return!1}})}const PQ=["transform","translate","scale","rotate","perspective"],DQ=["transform","translate","scale","rotate","perspective","filter"],EQ=["paint","layout","strict","content"];function r2(t){const e=i2(),n=$i(t)?Ti(t):t;return PQ.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||DQ.some(o=>(n.willChange||"").includes(o))||EQ.some(o=>(n.contain||"").includes(o))}function IQ(t){let e=Na(t);for(;as(e)&&!su(e);){if(r2(e))return e;if(Fm(e))return null;e=Na(e)}return null}function i2(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const NQ=new Set(["html","body","#document"]);function su(t){return NQ.has(Su(t))}function Ti(t){return kr(t).getComputedStyle(t)}function Vm(t){return $i(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Na(t){if(Su(t)==="html")return t;const e=t.assignedSlot||t.parentNode||G8(t)&&t.host||na(t);return G8(e)?e.host:e}function i5(t){const e=Na(t);return su(e)?t.ownerDocument?t.ownerDocument.body:t.body:as(e)&&Bf(e)?e:i5(e)}function s5(t,e,n){var o;e===void 0&&(e=[]);const r=i5(t),i=r===((o=t.ownerDocument)==null?void 0:o.body),s=kr(r);return i?(G1(s),e.concat(s,s.visualViewport||[],Bf(r)?r:[],[])):e.concat(r,s5(r,[]))}function G1(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function a5(t){const e=Ti(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=as(t),i=r?t.offsetWidth:n,s=r?t.offsetHeight:o,a=r0(n)!==i||r0(o)!==s;return a&&(n=i,o=s),{width:n,height:o,$:a}}function l5(t){return $i(t)?t:t.contextElement}function Rc(t){const e=l5(t);if(!as(e))return ns(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:i}=a5(e);let s=(i?r0(n.width):n.width)/o,a=(i?r0(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const RQ=ns(0);function c5(t){const e=kr(t);return!i2()||!e.visualViewport?RQ:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function FQ(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==kr(t)?!1:e}function of(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=l5(t);let s=ns(1);e&&(o?$i(o)&&(s=Rc(o)):s=Rc(t));const a=FQ(i,n,o)?c5(i):ns(0);let l=(r.left+a.x)/s.x,c=(r.top+a.y)/s.y,u=r.width/s.x,d=r.height/s.y;if(i){const f=kr(i),h=o&&$i(o)?kr(o):o;let g=f,v=G1(g);for(;v&&o&&h!==g;){const m=Rc(v),b=v.getBoundingClientRect(),y=Ti(v),x=b.left+(v.clientLeft+parseFloat(y.paddingLeft))*m.x,_=b.top+(v.clientTop+parseFloat(y.paddingTop))*m.y;l*=m.x,c*=m.y,u*=m.x,d*=m.y,l+=x,c+=_,g=kr(v),v=G1(g)}}return s0({width:u,height:d,x:l,y:c})}function zm(t,e){const n=Vm(t).scrollLeft;return e?e.left+n:of(na(t)).left+n}function u5(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-zm(t,n),r=n.top+e.scrollTop;return{x:o,y:r}}function VQ(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const i=r==="fixed",s=na(o),a=e?Fm(e.floating):!1;if(o===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=ns(1);const u=ns(0),d=as(o);if((d||!d&&!i)&&((Su(o)!=="body"||Bf(s))&&(l=Vm(o)),as(o))){const h=of(o);c=Rc(o),u.x=h.x+o.clientLeft,u.y=h.y+o.clientTop}const f=s&&!d&&!i?u5(s,l):ns(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}}function zQ(t){return Array.from(t.getClientRects())}function HQ(t){const e=na(t),n=Vm(t),o=t.ownerDocument.body,r=Nc(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=Nc(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+zm(t);const a=-n.scrollTop;return Ti(o).direction==="rtl"&&(s+=Nc(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:a}}const q8=25;function WQ(t,e){const n=kr(t),o=na(t),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,a=0,l=0;if(r){i=r.width,s=r.height;const u=i2();(!u||u&&e==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}const c=zm(o);if(c<=0){const u=o.ownerDocument,d=u.body,f=getComputedStyle(d),h=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,g=Math.abs(o.clientWidth-d.clientWidth-h);g<=q8&&(i-=g)}else c<=q8&&(i+=c);return{width:i,height:s,x:a,y:l}}const UQ=new Set(["absolute","fixed"]);function GQ(t,e){const n=of(t,!0,e==="fixed"),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=as(t)?Rc(t):ns(1),s=t.clientWidth*i.x,a=t.clientHeight*i.y,l=r*i.x,c=o*i.y;return{width:s,height:a,x:l,y:c}}function Y8(t,e,n){let o;if(e==="viewport")o=WQ(t,n);else if(e==="document")o=HQ(na(t));else if($i(e))o=GQ(e,n);else{const r=c5(t);o={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return s0(o)}function d5(t,e){const n=Na(t);return n===e||!$i(n)||su(n)?!1:Ti(n).position==="fixed"||d5(n,e)}function qQ(t,e){const n=e.get(t);if(n)return n;let o=s5(t,[]).filter(a=>$i(a)&&Su(a)!=="body"),r=null;const i=Ti(t).position==="fixed";let s=i?Na(t):t;for(;$i(s)&&!su(s);){const a=Ti(s),l=r2(s);!l&&a.position==="fixed"&&(r=null),(i?!l&&!r:!l&&a.position==="static"&&!!r&&UQ.has(r.position)||Bf(s)&&!l&&d5(t,s))?o=o.filter(u=>u!==s):r=a,s=Na(s)}return e.set(t,o),o}function YQ(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const s=[...n==="clippingAncestors"?Fm(e)?[]:qQ(e,this._c):[].concat(n),o],a=s[0],l=s.reduce((c,u)=>{const d=Y8(e,u,r);return c.top=Nc(d.top,c.top),c.right=W1(d.right,c.right),c.bottom=W1(d.bottom,c.bottom),c.left=Nc(d.left,c.left),c},Y8(e,a,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function jQ(t){const{width:e,height:n}=a5(t);return{width:e,height:n}}function XQ(t,e,n){const o=as(e),r=na(e),i=n==="fixed",s=of(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const l=ns(0);function c(){l.x=zm(r)}if(o||!o&&!i)if((Su(e)!=="body"||Bf(r))&&(a=Vm(e)),o){const h=of(e,!0,i,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}else r&&c();i&&!o&&r&&c();const u=r&&!o&&!i?u5(r,a):ns(0),d=s.left+a.scrollLeft-l.x-u.x,f=s.top+a.scrollTop-l.y-u.y;return{x:d,y:f,width:s.width,height:s.height}}function dv(t){return Ti(t).position==="static"}function j8(t,e){if(!as(t)||Ti(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return na(t)===n&&(n=n.ownerDocument.body),n}function f5(t,e){const n=kr(t);if(Fm(t))return n;if(!as(t)){let r=Na(t);for(;r&&!su(r);){if($i(r)&&!dv(r))return r;r=Na(r)}return n}let o=j8(t,e);for(;o&&BQ(o)&&dv(o);)o=j8(o,e);return o&&su(o)&&dv(o)&&!r2(o)?n:o||IQ(t)||n}const KQ=async function(t){const e=this.getOffsetParent||f5,n=this.getDimensions,o=await n(t.floating);return{reference:XQ(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function ZQ(t){return Ti(t).direction==="rtl"}const QQ={convertOffsetParentRelativeRectToViewportRelativeRect:VQ,getDocumentElement:na,getClippingRect:YQ,getOffsetParent:f5,getElementRects:KQ,getClientRects:zQ,getDimensions:jQ,getScale:Rc,isElement:$i,isRTL:ZQ},h5=$Q,p5=TQ,m5=SQ,g5=(t,e,n)=>{const o=new Map,r={platform:QQ,...n},i={...r.platform,_c:o};return kQ(t,e,{...r,platform:i})},v5="bc-tooltip";function JQ(){if(document.getElementById("bc-tooltip-styles"))return;const t=document.createElement("style");t.id="bc-tooltip-styles",t.textContent=`
|
|
39
|
+
.${v5} {
|
|
40
|
+
position: absolute;
|
|
41
|
+
pointer-events: none;
|
|
42
|
+
background: var(--bs-body-bg, #fff);
|
|
43
|
+
color: var(--bs-body-color, #212529);
|
|
44
|
+
border: 1px solid var(--bs-border-color, #dee2e6);
|
|
45
|
+
border-radius: 4px;
|
|
46
|
+
padding: 6px 10px;
|
|
47
|
+
font-size: 13px;
|
|
48
|
+
box-shadow: 0 2px 8px rgba(0,0,0,0.12);
|
|
49
|
+
z-index: 9999;
|
|
50
|
+
display: none;
|
|
51
|
+
}
|
|
52
|
+
`,document.head.appendChild(t)}function eJ(t){const e=t?Ia(t):null,n=o=>typeof o=="number"&&e?e(o):String(o);return o=>{if(o&&typeof o=="object"){if("data"in o&&typeof o.data=="number")return n(o.data);const r=o;if("label"in r&&"value"in r)return`${r.label}: ${n(r.value)}`;if("series"in r&&"value"in r)return`${r.series}: ${n(r.value)}`;if("value"in r)return n(r.value)}return String(o)}}function Ka(t){const e=(t==null?void 0:t.format)??eJ(t==null?void 0:t.numberFormat);let n=null;const o=[];return{name:"tooltip",install(){JQ(),n=document.createElement("div"),n.className=v5,document.body.appendChild(n)},postDraw(r){r.base.selectAll(".bc-bar, .bc-dot, .bc-arc").each(function(){const a=this,l=()=>{if(!n)return;const u=Ae(a).datum();n.textContent=e(u),n.style.display="block",g5(a,n,{placement:"top",middleware:[h5(8),m5(),p5()]}).then(({x:d,y:f})=>{n&&(n.style.left=`${d}px`,n.style.top=`${f}px`)})},c=()=>{n&&(n.style.display="none")};a.addEventListener("mouseenter",l),a.addEventListener("mouseleave",c),o.push(()=>{a.removeEventListener("mouseenter",l),a.removeEventListener("mouseleave",c)})})},destroy(){for(const r of o)r();o.length=0,n&&(n.remove(),n=null)}}}function tJ(t){switch(t){case ci.Solid:return"none";case ci.Dotted:return"2,2";case ci.Dashed:default:return"4,3"}}function nc(t){const e=(t==null?void 0:t.color)??"#999",n=(t==null?void 0:t.dashArray)??tJ(t==null?void 0:t.style),o=(t==null?void 0:t.direction)??Ao.Both,r=(t==null?void 0:t.orientation)??jn.Vertical,i=[];return{name:"crosshair",install(){},postDraw(s){const a=s.base,l=(t==null?void 0:t.width)??0,c=(t==null?void 0:t.height)??0,u=o===Ao.Both||o===Ao.Vertical,d=o===Ao.Both||o===Ao.Horizontal,f=u?a.append("line").attr("class","bc-crosshair bc-crosshair-v").attr("y1",0).attr("y2",c).attr("stroke",e).attr("stroke-width",1).style("stroke-dasharray",n).attr("pointer-events","none").style("display","none"):null,h=d?a.append("line").attr("class","bc-crosshair bc-crosshair-h").attr("x1",0).attr("x2",l).attr("stroke",e).attr("stroke-width",1).style("stroke-dasharray",n).attr("pointer-events","none").style("display","none"):null;a.selectAll(".bc-dot, .bc-bar").each(function(){const v=this,m=()=>{const y=Ae(v);let x,_;if(v.tagName==="circle")x=parseFloat(y.attr("cx")),_=parseFloat(y.attr("cy"));else{const k=parseFloat(y.attr("x")),E=parseFloat(y.attr("width")),L=parseFloat(y.attr("y")),S=parseFloat(y.attr("height"));r===jn.Horizontal?(x=k+E,_=L+S/2):(x=k+E/2,_=L)}f&&f.attr("x1",x).attr("x2",x).style("display",null),h&&h.attr("y1",_).attr("y2",_).style("display",null)},b=()=>{f&&f.style("display","none"),h&&h.style("display","none")};v.addEventListener("mouseenter",m),v.addEventListener("mouseleave",b),i.push(()=>{v.removeEventListener("mouseenter",m),v.removeEventListener("mouseleave",b)})})},destroy(){for(const s of i)s();i.length=0}}}function s2(t){const e=t.querySelector(".bc-annotation-line");if(!(!e||!e.hasAttribute("data-line-style")))return{style:e.getAttribute("data-line-style"),fromX:parseFloat(e.getAttribute("data-line-from-x")||"0"),fromY:parseFloat(e.getAttribute("data-line-from-y")||"0"),toX:parseFloat(e.getAttribute("data-line-to-x")||"0"),toY:parseFloat(e.getAttribute("data-line-to-y")||"0"),departVertical:e.getAttribute("data-line-depart-vertical")==="true"}}function ur(t){const e=new Map,n=t.querySelectorAll("g[data-annotation-id]");for(const o of n){const r=o.getAttribute("data-annotation-id"),i=s2(o);try{const s=o.getBBox();e.set(r,{id:r,element:o,rect:{x:s.x,y:s.y,width:s.width,height:s.height},line:i})}catch{e.set(r,{id:r,element:o,rect:{x:0,y:0,width:0,height:0},line:i})}}return e}const Ra={N:{dx:0,dy:-1},NE:{dx:.707,dy:-.707},E:{dx:1,dy:0},SE:{dx:.707,dy:.707},S:{dx:0,dy:1},SW:{dx:-.707,dy:.707},W:{dx:-1,dy:0},NW:{dx:-.707,dy:-.707},center:{dx:0,dy:0}},X8={N:{nx:0,ny:-1},NE:{nx:1,ny:-1},E:{nx:1,ny:0},SE:{nx:1,ny:1},S:{nx:0,ny:1},SW:{nx:-1,ny:1},W:{nx:-1,ny:0},NW:{nx:-1,ny:-1},center:{nx:0,ny:0}};En.N+"",En.W,En.NE+"",En.NW,En.E+"",En.N,En.SE+"",En.NE,En.S+"",En.E,En.SW+"",En.SE,En.W+"",En.S,En.NW+"",En.SW,En.Center+"",En.Center;function nJ(t,e){const n=Ra[t]??Ra.NW;return{dx:n.dx*e,dy:n.dy*e}}function a2(t){return"step"in t&&!("bandwidth"in t)}function b5(t){if("bandwidth"in t||a2(t))return!1;const e=t.domain();return e.length>0&&e[0]instanceof Date}function y5(t,e){if("bandwidth"in t){const n=t;return(n(e)??0)+n.bandwidth()/2}return a2(t)?t(e)??0:b5(t)?t(new Date(e)):t(Number(e))}function K8(t,e){const n=(e.left+e.right)/2,o=(e.top+e.bottom)/2,r=X8[t]??X8.N;return{x:n+r.nx*(e.right-e.left)/2,y:o+r.ny*(e.bottom-e.top)/2}}function oJ(t,e,n,o,r){if("bandwidth"in e){const c=e,u=c(t.label)??0,d=c.bandwidth(),f=n(t.value),h=n(0);return r==="horizontal"?K8(o,{left:h,right:f,top:u,bottom:u+d}):K8(o,{left:u,right:u+d,top:f,bottom:h})}const i=y5(e,t.label),s=n(t.value),a=2,l=Ra[o]??Ra.N;return{x:i+l.dx*a,y:s+l.dy*a}}function rJ(t,e,n,o=4){const r=t.x+t.width/2,i=t.y+t.height/2;if(e===r&&n===i)return{x:r,y:i};const s=e>=t.x&&e<=t.x+t.width,a=n>=t.y&&n<=t.y+t.height,l=[];if(s&&(n<i?l.push({x:r,y:t.y-o,dist:Math.abs(i-n)}):l.push({x:r,y:t.y+t.height+o,dist:Math.abs(n-i)})),a&&(e>r?l.push({x:t.x+t.width+o,y:i,dist:Math.abs(e-r)}):l.push({x:t.x-o,y:i,dist:Math.abs(r-e)})),l.length>0){l.sort((g,v)=>g.dist-v.dist);const{x:f,y:h}=l[0];return{x:f,y:h}}const c=[{x:r,y:t.y-o},{x:r,y:t.y+t.height+o},{x:t.x+t.width+o,y:i},{x:t.x-o,y:i}];let u=c[0],d=(u.x-e)**2+(u.y-n)**2;for(let f=1;f<c.length;f++){const h=(c[f].x-e)**2+(c[f].y-n)**2;h<d&&(u=c[f],d=h)}return u}function l2(t,e){if(!t)return"bc-arrow";const n=e??"#666",o=`bc-arrow-${n.replace(/[^a-zA-Z0-9]/g,"")}`;return t.querySelector(`#${o}`)||(Ae(t).select("defs").empty()?Ae(t).append("defs"):Ae(t).select("defs")).append("marker").attr("id",o).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",8).attr("markerHeight",8).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 1 1 L 9 5 L 1 9").attr("fill","none").attr("stroke",n).attr("stroke-width",1.5).attr("stroke-linecap","round").attr("stroke-linejoin","round"),o}function iJ(t){switch(t){case Hp.Dotted:return"2,3";case Hp.Dashed:return"5,4";default:return""}}function sJ(t,e,n,o={}){const r=t.append("circle").attr("class","bc-annotation-circle").attr("cx",e).attr("cy",n).attr("r",o.size??4).attr("fill","none").attr("stroke",o.color??"#666").attr("stroke-width",1.5),i=iJ(o.style??Hp.Solid);i&&r.attr("stroke-dasharray",i)}const Z8=1/Math.tan(40*Math.PI/180);function aJ(t,e,n){if(n){const i=e.y>=t.y?1:-1,s=Math.max(Math.abs(e.y-t.y)-Math.abs(e.x-t.x)*Z8,12);return{x:t.x,y:t.y+i*s}}const o=e.x>=t.x?1:-1,r=Math.max(Math.abs(e.x-t.x)-Math.abs(e.y-t.y)*Z8,12);return{x:t.x+o*r,y:t.y}}function lJ(t,e,n){const o=aJ(t,e,n);return`M ${t.x} ${t.y} L ${o.x} ${o.y} L ${e.x} ${e.y}`}function cJ(t,e,n,o=So.Direct,r={}){var l;let i;switch(o){case So.CurveLeft:case So.CurveRight:{const c=n.x-e.x,u=n.y-e.y,f=Math.sqrt(c*c+u*u)*.8,h=o===So.CurveRight?1:0;i=`M ${e.x} ${e.y} A ${f} ${f} 0 0 ${h} ${n.x} ${n.y}`;break}case So.Elbow:{i=lJ(e,n,r.departVertical??!1);break}default:i=`M ${e.x} ${e.y} L ${n.x} ${n.y}`}const s=r.color??"#666",a=t.append("path").attr("class","bc-annotation-line").attr("d",i).attr("fill","none").attr("stroke",s).attr("stroke-width",r.lineWeight??1).attr("pathLength","1").attr("data-line-style",o).attr("data-line-from-x",String(e.x)).attr("data-line-from-y",String(e.y)).attr("data-line-to-x",String(n.x)).attr("data-line-to-y",String(n.y)).attr("data-line-depart-vertical",String(r.departVertical??!1));if(r.showArrow===!0){const c=((l=t.node())==null?void 0:l.ownerSVGElement)??null,u=l2(c,s);a.attr("marker-end",`url(#${u})`)}}function c2(t,e,n,o,r={}){const i=r.textAnchor??"middle",s=r.textOutline!==!1,a=t.append("text").attr("class","bc-annotation-text").attr("x",n).attr("y",o).attr("text-anchor",i).attr("font-size","12px").attr("fill",r.textColor??"currentColor");s&&a.attr("stroke",r.backgroundColor??"#fff").attr("stroke-width",3).attr("paint-order","stroke");const l=e.split(`
|
|
53
|
+
`);if(l.length>1||r.maxWidth&&r.maxWidth>0)if(r.maxWidth&&r.maxWidth>0)uJ(a,e,r.maxWidth);else for(let c=0;c<l.length;c++)a.append("tspan").attr("x",a.attr("x")).attr("dy",c===0?"0":"1.2em").text(l[c]);else a.text(e)}function uJ(t,e,n){const o=e.split(/\s+/);let r="",i=0;for(const s of o){const a=r?`${r} ${s}`:s;r&&a.length*7>n?(t.append("tspan").attr("x",t.attr("x")).attr("dy",i===0?"0":"1.2em").text(r),r=s,i++):r=a}r&&t.append("tspan").attr("x",t.attr("x")).attr("dy",i===0?"0":"1.2em").text(r)}function hh(t,e,n=nC.Center){if("bandwidth"in e){const o=e,r=o(String(t))??0,i=o.bandwidth(),s=o.step()-i;return n==="start"?r-s/2:n==="end"?r+i+s/2:r+i/2}if(a2(e)){const o=e(String(t))??0,r=e.step()/2;return n==="start"?o-r:n==="end"?o+r:o}return b5(e)?e(new Date(String(t))):e(Number(t))}function ph(t,e){return e(Number(t))}function Q8(t,e){if(typeof t=="number")return e/2+t/100*e;const n=String(t);return n.endsWith("%")?e/2+parseFloat(n)/100*e:parseFloat(n)||0}function u2(t,e){if(t==null)return;if(typeof t=="number")return t||void 0;const n=String(t);return n.endsWith("%")?parseFloat(n)/100*e:parseFloat(n)||void 0}function dJ(t){return t<-4?"end":t>4?"start":"middle"}function J8(t,e,n){if("bandwidth"in e){const o=e;return{x:(o(t.label)??0)+o.bandwidth()/2,y:n(t.value)}}return{x:y5(e,t.label),y:n(t.value)}}function x5(t,e,n,o){const r="target"in e?e.target:void 0;if(!r)return;const i=n.data.find(x=>x.label===r);if(!i)return;const s=t.append("g").attr("data-annotation-index",String(o));e.id&&s.attr("data-annotation-id",e.id);const a=e,l=a.anchorDirection??En.N,c=oJ(i,n.scaleX,n.scaleY,l,n.orientation);let u,d;const f=e;if(f.dx!=null||f.dy!=null){const{x,y:_}=J8(i,n.scaleX,n.scaleY);u=x+(Number(f.dx)||40),d=_+(Number(f.dy)||-40)}else if(f.direction!=null&&f.textOffsetX==null){const{x,y:_}=J8(i,n.scaleX,n.scaleY),k=f.direction,E=f.anchorDistance??60,L=nJ(k,E);u=x+L.dx,d=_+L.dy}else u=c.x+(a.textOffsetX??-42),d=c.y+(a.textOffsetY??-42);const h=e.circleColor??"#666",g=e;g.showCircle&&sJ(s,c.x,c.y,{size:g.circleSize,style:g.circleStyle,color:h});const v=Math.max(4,Math.min(u,n.width-4)),m=Math.max(4,Math.min(d,n.height-4));if(e.text){const x=dJ(u-c.x);c2(s,e.text,v,m-4,{textColor:e.textColor,maxWidth:u2(e.maxWidth,n.width),textAnchor:x,backgroundColor:n.backgroundColor,textOutline:e.textOutline})}if(f.dx!=null||f.dy!=null?a.showLine!==!1:a.showLine===!0||a.showArrow===!0){let x={x:v,y:m},_=!1;const k=s.select(".bc-annotation-text").node();if(k)try{const B=k.getBBox();if(B.width>0&&B.height>0){x=rJ(B,c.x,c.y);const D=B.x+B.width/2;_=Math.abs(x.x-D)<1}}catch{}const E=a.showCircle?(a.circleSize??4)+(a.lineTargetDistance??5):a.lineTargetDistance??0;let L=c.x,S=c.y;if(E>0){const B=c.x-x.x,D=c.y-x.y,N=Math.sqrt(B*B+D*D);if(N>0){const C=c.x-B/N*E,M=c.y-D/N*E,P=Ra[l]??Ra.N;L=Math.abs(P.dx)>.01?C:c.x,S=Math.abs(P.dy)>.01?M:c.y}}cJ(s,x,{x:L,y:S},a.lineStyle??So.Direct,{showArrow:a.showArrow,lineWeight:a.lineWeight,color:h,departVertical:_})}}function w5(t,e,n,o,r){if(e.kind!==Lt.Range)return;const i=t.append("g").attr("data-annotation-index",String(o));e.id&&i.attr("data-annotation-id",e.id);const s=e.orientation??jn.Vertical;let a,l,c,u;if(n.orientation===jn.Horizontal)if(s===jn.Vertical){const d=hh(e.start,n.scaleX,e.startAnchor),f=hh(e.end,n.scaleX,e.endAnchor);l=Math.min(d,f),u=Math.abs(f-d),a=0,c=n.width}else{const d=ph(e.start,n.scaleY),f=ph(e.end,n.scaleY);a=Math.min(d,f),c=Math.abs(f-d),l=0,u=n.height}else if(s===jn.Vertical){const d=hh(e.start,n.scaleX,e.startAnchor),f=hh(e.end,n.scaleX,e.endAnchor);a=Math.min(d,f),c=Math.abs(f-d),l=0,u=n.height}else{const d=ph(e.start,n.scaleY),f=ph(e.end,n.scaleY);l=Math.min(d,f),u=Math.abs(f-d),a=0,c=n.width}if(i.append("rect").attr("class","bc-annotation-range").attr("x",a).attr("y",l).attr("width",c).attr("height",u).attr("fill",e.bgColor??"#ccc").attr("opacity",(e.bgOpacity??20)/100),e.text){const d=s===jn.Vertical?c:u,f=u2(e.maxWidth,n.width)??Math.max(d,50),h=e.direction??"center",g=4,v=Ra[h]??Ra.center,m=.5+v.dx*.5,b=.5+v.dy*.5,y=Math.max(g,Math.min(a+c*m,n.width-g));let x="middle";m<.25?x="start":m>.75&&(x="end");const k=l+g+12,E=r?r.append("g").attr("data-annotation-index",String(o)):i;if(c2(E,e.text,y,k,{textColor:e.textColor,maxWidth:f,textAnchor:x,backgroundColor:n.backgroundColor,textOutline:e.textOutline}),b>.25){const L=E.select(".bc-annotation-text").node();if(L)try{const S=L.getBBox();let B=0;b>.75?B=l+u-g-(S.y+S.height):B=l+u/2-(S.y+S.height/2),Math.abs(B)>.5&&L.setAttribute("transform",`translate(0, ${B})`)}catch{}}}}function _5(t,e,n,o){if(e.kind!=="free")return;const r=t.append("g").attr("data-annotation-index",String(o));e.id&&r.attr("data-annotation-id",e.id);const i=Q8(e.x,n.width),s=Q8(e.y,n.height);if(e.text){c2(r,e.text,i,s,{textColor:e.textColor,maxWidth:u2(e.maxWidth,n.width),textAnchor:"middle",backgroundColor:n.backgroundColor,textOutline:e.textOutline});const a=r.select(".bc-annotation-text").node();if(a)try{const l=a.getBBox(),c=s-(l.y+l.height/2);Math.abs(c)>.5&&a.setAttribute("transform",`translate(0, ${c})`)}catch{}}}function q1(t,e,n,o){const r=n+.45*(t-n);return`M ${t} ${e} L ${r} ${e} L ${n} ${o}`}function fJ(t,e){const n=t.hasAttribute("marker-end"),o=s2(t.parentElement);if(n&&o){const r=Ae(t),i=t.getAttribute("d"),s=`M ${o.fromX} ${o.fromY} L ${o.fromX} ${o.fromY}`;if(r.attr("d",s),o.style===So.Elbow){const a={tipX:o.toX,tipY:o.toY,calloutX:o.fromX,calloutY:o.fromY},l={tipX:o.fromX,tipY:o.fromY,calloutX:o.fromX,calloutY:o.fromY};r.transition().duration(e).ease(uh).attrTween("d",()=>{const c=Md(l,a);return u=>{const d=c(u);return q1(d.calloutX,d.calloutY,d.tipX,d.tipY)}})}else if(o.style===So.CurveLeft||o.style===So.CurveRight){const a={x:o.fromX,y:o.fromY},l={x:o.toX,y:o.toY},c=l.x-a.x,u=l.y-a.y,d=Math.sqrt(c*c+u*u),f=d*.8,h=o.style===So.CurveRight?1:0,g=d/2,v=g<f?Math.sqrt(f*f-g*g):0,m=(a.x+l.x)/2,b=(a.y+l.y)/2,y=d>0?-u/d:0,x=d>0?c/d:0,_=h===1?1:-1,k=m+_*v*y,E=b+_*v*x,L=Math.atan2(a.y-E,a.x-k);let B=Math.atan2(l.y-E,l.x-k)-L;h===1&&B<=0&&(B+=2*Math.PI),h===0&&B>=0&&(B-=2*Math.PI),r.transition().duration(e).ease(uh).attrTween("d",()=>D=>{if(D>=.98)return i;const N=L+D*B,C=k+f*Math.cos(N),M=E+f*Math.sin(N);return`M ${a.x} ${a.y} A ${f} ${f} 0 0 ${h} ${C} ${M}`})}else r.transition().duration(e).ease(uh).attrTween("d",()=>{const a=oo(o.fromX,o.toX),l=oo(o.fromY,o.toY);return c=>`M ${o.fromX} ${o.fromY} L ${a(c)} ${l(c)}`})}else t.setAttribute("stroke-dasharray","1"),t.setAttribute("stroke-dashoffset","1"),Ae(t).transition().duration(e).ease(uh).attr("stroke-dashoffset","0").on("end",()=>{t.removeAttribute("stroke-dasharray"),t.removeAttribute("stroke-dashoffset")})}const mh=1;function hJ(t,e){return t.style!==e.style||t.departVertical!==e.departVertical?!1:Math.abs(t.fromX-e.fromX)<=mh&&Math.abs(t.fromY-e.fromY)<=mh&&Math.abs(t.toX-e.toX)<=mh&&Math.abs(t.toY-e.toY)<=mh}function pJ(t,e,n){const o=s2(t.parentElement);if(!o||hJ(e,o))return;const r=Ae(t);if(e.style===So.Elbow&&o.style===So.Elbow){const i={tipX:e.toX,tipY:e.toY,calloutX:e.fromX,calloutY:e.fromY},s={tipX:o.toX,tipY:o.toY,calloutX:o.fromX,calloutY:o.fromY};r.attr("d",q1(i.calloutX,i.calloutY,i.tipX,i.tipY)),r.transition().duration(n).ease(Kp).attrTween("d",()=>{const a=Md(i,s);return l=>{const c=a(l);return q1(c.calloutX,c.calloutY,c.tipX,c.tipY)}})}else{const i={x:e.fromX,y:e.fromY},s={x:e.toX,y:e.toY},a={x:o.fromX,y:o.fromY},l={x:o.toX,y:o.toY},c=t.getAttribute("d"),u=`M ${i.x} ${i.y} L ${s.x} ${s.y}`;r.attr("d",u),r.transition().duration(n).ease(Kp).attrTween("d",()=>{const d=Md(i,a),f=Md(s,l);return h=>{if(h>=.98)return c;const g=d(h),v=f(h);if(o.style===So.Direct||e.style===So.Direct)return`M ${g.x} ${g.y} L ${v.x} ${v.y}`;const m=v.x-g.x,b=v.y-g.y,x=Math.sqrt(m*m+b*b)*.8,_=o.style===So.CurveRight?1:0;return`M ${g.x} ${g.y} A ${x} ${x} 0 0 ${_} ${v.x} ${v.y}`}})}}function k5(t,e,n,o){if(o<=0)return;const r=[...t.querySelectorAll("g[data-annotation-id]"),...e.querySelectorAll("g[data-annotation-id]")],i=new Set;for(const s of r){const a=s.getAttribute("data-annotation-id");i.add(a);const l=n.get(a);if(l){const c=s.querySelector(".bc-annotation-line");c&&l.line&&pJ(c,l.line,o);try{const u=s.getBBox(),d=l.rect.x-u.x,f=l.rect.y-u.y;if(Math.abs(d)>.5||Math.abs(f)>.5){const h=s.querySelectorAll(".bc-annotation-text, .bc-annotation-circle");for(const g of h){const v=g;v.style.transition="none",v.setAttribute("transform",`translate(${d}, ${f})`),v.getBoundingClientRect(),v.style.transition=`transform ${o}ms ease`,v.setAttribute("transform","translate(0, 0)")}}}catch{}}else{const c=s.querySelector(".bc-annotation-line");c&&fJ(c,o);const u=s.querySelectorAll(".bc-annotation-text, .bc-annotation-circle");for(const d of u){const f=d;f.style.opacity="0",f.getBoundingClientRect(),f.style.transition=`opacity ${o}ms ease`,f.style.opacity="1"}}}for(const[s,a]of n)if(!i.has(s)){const l=a.element.cloneNode(!0);t.appendChild(l),l.style.opacity="1",l.getBoundingClientRect(),l.style.transition=`opacity ${o}ms ease`,l.style.opacity="0",setTimeout(()=>l.remove(),o)}}function S5(t){if(!t)return;const e=parseFloat(t.getAttribute("width")||"0"),n=parseFloat(t.getAttribute("height")||"0");if(!e||!n)return;const o=t.getBBox();if(o.width===0&&o.height===0)return;const r=8,i=o.x,s=o.y,a=o.x+o.width,l=o.y+o.height,c=i<0?i-r:0,u=s<0?s-r:0,d=a>e?a+r:e,f=l>n?l+r:n;(c<0||u<0||d>e||f>n)&&Ae(t).attr("viewBox",`${c} ${u} ${d-c} ${f-u}`).attr("preserveAspectRatio","xMidYMid meet")}function Hm(t,e,n){const o=t.ownerSVGElement??t;Ae(o).style("overflow","visible"),l2(o);const r=Ae(t);let i;if(n.transition)if(n.priorAnnotations&&n.priorAnnotations.size>0)i=n.priorAnnotations;else{const l=t.querySelector(".bc-annotations"),c=t.querySelector(".bc-annotations-range");if(l||c){if(i=new Map,l)for(const[u,d]of ur(l))i.set(u,d);if(c)for(const[u,d]of ur(c))i.set(u,d)}}t.querySelectorAll(".bc-annotations, .bc-annotations-range").forEach(l=>l.remove());const s=r.insert("g",":first-child").attr("class","bc-annotations-range"),a=r.append("g").attr("class","bc-annotations").attr("data-ctx-width",String(n.width)).attr("data-ctx-height",String(n.height));for(let l=0;l<e.length;l++){const c=e[l];switch(c.kind??Lt.Point){case Lt.Point:x5(a,c,n,l);break;case Lt.Range:w5(s,c,n,l,a);break;case Lt.Free:_5(a,c,n,l);break}}if(n.transition){const l=ec(_u);k5(a.node(),s.node(),i??new Map,l)}S5(o)}function Au(t,e){return{name:"annotations",install(){},postDraw(n){var f;const o=n.base,r=((f=o.node())==null?void 0:f.ownerSVGElement)??o.node();r&&Ae(r).style("overflow","visible"),l2(r);const i=o.node(),s=i==null?void 0:i.parentNode,a=s&&s!==r?Ae(s):o,l=a.node();let c;if(e.transition){if(e.priorAnnotations&&e.priorAnnotations.size>0)c=e.priorAnnotations;else if(l){const h=l.querySelector(".bc-annotations"),g=l.querySelector(".bc-annotations-range");if(h||g){if(c=new Map,h)for(const[v,m]of ur(h))c.set(v,m);if(g)for(const[v,m]of ur(g))c.set(v,m)}}}l&&l.querySelectorAll(".bc-annotations, .bc-annotations-range").forEach(h=>h.remove());const u=a.insert("g",":first-child").attr("class","bc-annotations-range"),d=a.append("g").attr("class","bc-annotations").attr("data-ctx-width",String(e.width)).attr("data-ctx-height",String(e.height));for(let h=0;h<t.length;h++){const g=t[h];switch(g.kind??Lt.Point){case Lt.Point:x5(d,g,e,h);break;case Lt.Range:w5(u,g,e,h,d);break;case Lt.Free:_5(d,g,e,h);break}}if(e.transition){const h=ec(_u);k5(d.node(),u.node(),c??new Map,h)}S5(r)}}}const{min:mJ,max:gJ}=Math,Tl=(t,e=0,n=1)=>mJ(gJ(e,t),n),d2=t=>{t._clipped=!1,t._unclipped=t.slice(0);for(let e=0;e<=3;e++)e<3?((t[e]<0||t[e]>255)&&(t._clipped=!0),t[e]=Tl(t[e],0,255)):e===3&&(t[e]=Tl(t[e],0,1));return t},A5={};for(let t of["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])A5[`[object ${t}]`]=t.toLowerCase();function Mt(t){return A5[Object.prototype.toString.call(t)]||"object"}const St=(t,e=null)=>t.length>=3?Array.prototype.slice.call(t):Mt(t[0])=="object"&&e?e.split("").filter(n=>t[0][n]!==void 0).map(n=>t[0][n]):t[0].slice(0),Cu=t=>{if(t.length<2)return null;const e=t.length-1;return Mt(t[e])=="string"?t[e].toLowerCase():null},{PI:Wm,min:C5,max:$5}=Math,Hr=t=>Math.round(t*100)/100,Y1=t=>Math.round(t*100)/100,$s=Wm*2,fv=Wm/3,vJ=Wm/180,bJ=180/Wm;function T5(t){return[...t.slice(0,3).reverse(),...t.slice(3)]}const wt={format:{},autodetect:[]};class Ve{constructor(...e){const n=this;if(Mt(e[0])==="object"&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];let o=Cu(e),r=!1;if(!o){r=!0,wt.sorted||(wt.autodetect=wt.autodetect.sort((i,s)=>s.p-i.p),wt.sorted=!0);for(let i of wt.autodetect)if(o=i.test(...e),o)break}if(wt.format[o]){const i=wt.format[o].apply(null,r?e:e.slice(0,-1));n._rgb=d2(i)}else throw new Error("unknown format: "+e);n._rgb.length===3&&n._rgb.push(1)}toString(){return Mt(this.hex)=="function"?this.hex():`[${this._rgb.join(",")}]`}}const yJ="3.2.0",nt=(...t)=>new Ve(...t);nt.version=yJ;const au={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},xJ=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,wJ=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,M5=t=>{if(t.match(xJ)){(t.length===4||t.length===7)&&(t=t.substr(1)),t.length===3&&(t=t.split(""),t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);const e=parseInt(t,16),n=e>>16,o=e>>8&255,r=e&255;return[n,o,r,1]}if(t.match(wJ)){(t.length===5||t.length===9)&&(t=t.substr(1)),t.length===4&&(t=t.split(""),t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]);const e=parseInt(t,16),n=e>>24&255,o=e>>16&255,r=e>>8&255,i=Math.round((e&255)/255*100)/100;return[n,o,r,i]}throw new Error(`unknown hex color: ${t}`)},{round:gh}=Math,O5=(...t)=>{let[e,n,o,r]=St(t,"rgba"),i=Cu(t)||"auto";r===void 0&&(r=1),i==="auto"&&(i=r<1?"rgba":"rgb"),e=gh(e),n=gh(n),o=gh(o);let a="000000"+(e<<16|n<<8|o).toString(16);a=a.substr(a.length-6);let l="0"+gh(r*255).toString(16);switch(l=l.substr(l.length-2),i.toLowerCase()){case"rgba":return`#${a}${l}`;case"argb":return`#${l}${a}`;default:return`#${a}`}};Ve.prototype.name=function(){const t=O5(this._rgb,"rgb");for(let e of Object.keys(au))if(au[e]===t)return e.toLowerCase();return t};wt.format.named=t=>{if(t=t.toLowerCase(),au[t])return M5(au[t]);throw new Error("unknown color name: "+t)};wt.autodetect.push({p:5,test:(t,...e)=>{if(!e.length&&Mt(t)==="string"&&au[t.toLowerCase()])return"named"}});Ve.prototype.alpha=function(t,e=!1){return t!==void 0&&Mt(t)==="number"?e?(this._rgb[3]=t,this):new Ve([this._rgb[0],this._rgb[1],this._rgb[2],t],"rgb"):this._rgb[3]};Ve.prototype.clipped=function(){return this._rgb._clipped||!1};const os={Kn:18,labWhitePoint:"d65",Xn:.95047,Yn:1,Zn:1.08883,kE:216/24389,kKE:8,kK:24389/27,RefWhiteRGB:{X:.95047,Y:1,Z:1.08883},MtxRGB2XYZ:{m00:.4124564390896922,m01:.21267285140562253,m02:.0193338955823293,m10:.357576077643909,m11:.715152155287818,m12:.11919202588130297,m20:.18043748326639894,m21:.07217499330655958,m22:.9503040785363679},MtxXYZ2RGB:{m00:3.2404541621141045,m01:-.9692660305051868,m02:.055643430959114726,m10:-1.5371385127977166,m11:1.8760108454466942,m12:-.2040259135167538,m20:-.498531409556016,m21:.041556017530349834,m22:1.0572251882231791},As:.9414285350000001,Bs:1.040417467,Cs:1.089532651,MtxAdaptMa:{m00:.8951,m01:-.7502,m02:.0389,m10:.2664,m11:1.7135,m12:-.0685,m20:-.1614,m21:.0367,m22:1.0296},MtxAdaptMaI:{m00:.9869929054667123,m01:.43230526972339456,m02:-.008528664575177328,m10:-.14705425642099013,m11:.5183602715367776,m12:.04004282165408487,m20:.15996265166373125,m21:.0492912282128556,m22:.9684866957875502}},_J=new Map([["a",[1.0985,.35585]],["b",[1.0985,.35585]],["c",[.98074,1.18232]],["d50",[.96422,.82521]],["d55",[.95682,.92149]],["d65",[.95047,1.08883]],["e",[1,1,1]],["f2",[.99186,.67393]],["f7",[.95041,1.08747]],["f11",[1.00962,.6435]],["icc",[.96422,.82521]]]);function Es(t){const e=_J.get(String(t).toLowerCase());if(!e)throw new Error("unknown Lab illuminant "+t);os.labWhitePoint=t,os.Xn=e[0],os.Zn=e[1]}function rf(){return os.labWhitePoint}const f2=(...t)=>{t=St(t,"lab");const[e,n,o]=t,[r,i,s]=kJ(e,n,o),[a,l,c]=B5(r,i,s);return[a,l,c,t.length>3?t[3]:1]},kJ=(t,e,n)=>{const{kE:o,kK:r,kKE:i,Xn:s,Yn:a,Zn:l}=os,c=(t+16)/116,u=.002*e+c,d=c-.005*n,f=u*u*u,h=d*d*d,g=f>o?f:(116*u-16)/r,v=t>i?Math.pow((t+16)/116,3):t/r,m=h>o?h:(116*d-16)/r,b=g*s,y=v*a,x=m*l;return[b,y,x]},hv=t=>{const e=Math.sign(t);return t=Math.abs(t),(t<=.0031308?t*12.92:1.055*Math.pow(t,1/2.4)-.055)*e},B5=(t,e,n)=>{const{MtxAdaptMa:o,MtxAdaptMaI:r,MtxXYZ2RGB:i,RefWhiteRGB:s,Xn:a,Yn:l,Zn:c}=os,u=a*o.m00+l*o.m10+c*o.m20,d=a*o.m01+l*o.m11+c*o.m21,f=a*o.m02+l*o.m12+c*o.m22,h=s.X*o.m00+s.Y*o.m10+s.Z*o.m20,g=s.X*o.m01+s.Y*o.m11+s.Z*o.m21,v=s.X*o.m02+s.Y*o.m12+s.Z*o.m22,m=(t*o.m00+e*o.m10+n*o.m20)*(h/u),b=(t*o.m01+e*o.m11+n*o.m21)*(g/d),y=(t*o.m02+e*o.m12+n*o.m22)*(v/f),x=m*r.m00+b*r.m10+y*r.m20,_=m*r.m01+b*r.m11+y*r.m21,k=m*r.m02+b*r.m12+y*r.m22,E=hv(x*i.m00+_*i.m10+k*i.m20),L=hv(x*i.m01+_*i.m11+k*i.m21),S=hv(x*i.m02+_*i.m12+k*i.m22);return[E*255,L*255,S*255]},h2=(...t)=>{const[e,n,o,...r]=St(t,"rgb"),[i,s,a]=L5(e,n,o),[l,c,u]=SJ(i,s,a);return[l,c,u,...r.length>0&&r[0]<1?[r[0]]:[]]};function SJ(t,e,n){const{Xn:o,Yn:r,Zn:i,kE:s,kK:a}=os,l=t/o,c=e/r,u=n/i,d=l>s?Math.pow(l,1/3):(a*l+16)/116,f=c>s?Math.pow(c,1/3):(a*c+16)/116,h=u>s?Math.pow(u,1/3):(a*u+16)/116;return[116*f-16,500*(d-f),200*(f-h)]}function pv(t){const e=Math.sign(t);return t=Math.abs(t),(t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4))*e}const L5=(t,e,n)=>{t=pv(t/255),e=pv(e/255),n=pv(n/255);const{MtxRGB2XYZ:o,MtxAdaptMa:r,MtxAdaptMaI:i,Xn:s,Yn:a,Zn:l,As:c,Bs:u,Cs:d}=os;let f=t*o.m00+e*o.m10+n*o.m20,h=t*o.m01+e*o.m11+n*o.m21,g=t*o.m02+e*o.m12+n*o.m22;const v=s*r.m00+a*r.m10+l*r.m20,m=s*r.m01+a*r.m11+l*r.m21,b=s*r.m02+a*r.m12+l*r.m22;let y=f*r.m00+h*r.m10+g*r.m20,x=f*r.m01+h*r.m11+g*r.m21,_=f*r.m02+h*r.m12+g*r.m22;return y*=v/c,x*=m/u,_*=b/d,f=y*i.m00+x*i.m10+_*i.m20,h=y*i.m01+x*i.m11+_*i.m21,g=y*i.m02+x*i.m12+_*i.m22,[f,h,g]};Ve.prototype.lab=function(){return h2(this._rgb)};const AJ=(...t)=>new Ve(...t,"lab");Object.assign(nt,{lab:AJ,getLabWhitePoint:rf,setLabWhitePoint:Es});wt.format.lab=f2;wt.autodetect.push({p:2,test:(...t)=>{if(t=St(t,"lab"),Mt(t)==="array"&&t.length===3)return"lab"}});Ve.prototype.darken=function(t=1){const e=this,n=e.lab();return n[0]-=os.Kn*t,new Ve(n,"lab").alpha(e.alpha(),!0)};Ve.prototype.brighten=function(t=1){return this.darken(-t)};Ve.prototype.darker=Ve.prototype.darken;Ve.prototype.brighter=Ve.prototype.brighten;Ve.prototype.get=function(t){const[e,n]=t.split("."),o=this[e]();if(n){const r=e.indexOf(n)-(e.substr(0,2)==="ok"?2:0);if(r>-1)return o[r];throw new Error(`unknown channel ${n} in mode ${e}`)}else return o};const{pow:CJ}=Math,$J=1e-7,TJ=20;Ve.prototype.luminance=function(t,e="rgb"){if(t!==void 0&&Mt(t)==="number"){if(t===0)return new Ve([0,0,0,this._rgb[3]],"rgb");if(t===1)return new Ve([255,255,255,this._rgb[3]],"rgb");let n=this.luminance(),o=TJ;const r=(s,a)=>{const l=s.interpolate(a,.5,e),c=l.luminance();return Math.abs(t-c)<$J||!o--?l:c>t?r(s,l):r(l,a)},i=(n>t?r(new Ve([0,0,0]),this):r(this,new Ve([255,255,255]))).rgb();return new Ve([...i,this._rgb[3]])}return MJ(...this._rgb.slice(0,3))};const MJ=(t,e,n)=>(t=mv(t),e=mv(e),n=mv(n),.2126*t+.7152*e+.0722*n),mv=t=>(t/=255,t<=.03928?t/12.92:CJ((t+.055)/1.055,2.4)),To={},lu=(t,e,n=.5,...o)=>{let r=o[0]||"lrgb";if(!To[r]&&!o.length&&(r=Object.keys(To)[0]),!To[r])throw new Error(`interpolation mode ${r} is not defined`);return Mt(t)!=="object"&&(t=new Ve(t)),Mt(e)!=="object"&&(e=new Ve(e)),To[r](t,e,n).alpha(t.alpha()+n*(e.alpha()-t.alpha()))};Ve.prototype.mix=Ve.prototype.interpolate=function(t,e=.5,...n){return lu(this,t,e,...n)};Ve.prototype.premultiply=function(t=!1){const e=this._rgb,n=e[3];return t?(this._rgb=[e[0]*n,e[1]*n,e[2]*n,n],this):new Ve([e[0]*n,e[1]*n,e[2]*n,n],"rgb")};const{sin:OJ,cos:BJ}=Math,P5=(...t)=>{let[e,n,o]=St(t,"lch");return isNaN(o)&&(o=0),o=o*vJ,[e,BJ(o)*n,OJ(o)*n]},p2=(...t)=>{t=St(t,"lch");const[e,n,o]=t,[r,i,s]=P5(e,n,o),[a,l,c]=f2(r,i,s);return[a,l,c,t.length>3?t[3]:1]},LJ=(...t)=>{const e=T5(St(t,"hcl"));return p2(...e)},{sqrt:PJ,atan2:DJ,round:EJ}=Math,D5=(...t)=>{const[e,n,o]=St(t,"lab"),r=PJ(n*n+o*o);let i=(DJ(o,n)*bJ+360)%360;return EJ(r*1e4)===0&&(i=Number.NaN),[e,r,i]},m2=(...t)=>{const[e,n,o,...r]=St(t,"rgb"),[i,s,a]=h2(e,n,o),[l,c,u]=D5(i,s,a);return[l,c,u,...r.length>0&&r[0]<1?[r[0]]:[]]};Ve.prototype.lch=function(){return m2(this._rgb)};Ve.prototype.hcl=function(){return T5(m2(this._rgb))};const IJ=(...t)=>new Ve(...t,"lch"),NJ=(...t)=>new Ve(...t,"hcl");Object.assign(nt,{lch:IJ,hcl:NJ});wt.format.lch=p2;wt.format.hcl=LJ;["lch","hcl"].forEach(t=>wt.autodetect.push({p:2,test:(...e)=>{if(e=St(e,t),Mt(e)==="array"&&e.length===3)return t}}));Ve.prototype.saturate=function(t=1){const e=this,n=e.lch();return n[1]+=os.Kn*t,n[1]<0&&(n[1]=0),new Ve(n,"lch").alpha(e.alpha(),!0)};Ve.prototype.desaturate=function(t=1){return this.saturate(-t)};Ve.prototype.set=function(t,e,n=!1){const[o,r]=t.split("."),i=this[o]();if(r){const s=o.indexOf(r)-(o.substr(0,2)==="ok"?2:0);if(s>-1){if(Mt(e)=="string")switch(e.charAt(0)){case"+":i[s]+=+e;break;case"-":i[s]+=+e;break;case"*":i[s]*=+e.substr(1);break;case"/":i[s]/=+e.substr(1);break;default:i[s]=+e}else if(Mt(e)==="number")i[s]=e;else throw new Error("unsupported value for Color.set");const a=new Ve(i,o);return n?(this._rgb=a._rgb,this):a}throw new Error(`unknown channel ${r} in mode ${o}`)}else return i};Ve.prototype.tint=function(t=.5,...e){return lu(this,"white",t,...e)};Ve.prototype.shade=function(t=.5,...e){return lu(this,"black",t,...e)};const RJ=(t,e,n)=>{const o=t._rgb,r=e._rgb;return new Ve(o[0]+n*(r[0]-o[0]),o[1]+n*(r[1]-o[1]),o[2]+n*(r[2]-o[2]),"rgb")};To.rgb=RJ;const{sqrt:gv,pow:pc}=Math,FJ=(t,e,n)=>{const[o,r,i]=t._rgb,[s,a,l]=e._rgb;return new Ve(gv(pc(o,2)*(1-n)+pc(s,2)*n),gv(pc(r,2)*(1-n)+pc(a,2)*n),gv(pc(i,2)*(1-n)+pc(l,2)*n),"rgb")};To.lrgb=FJ;const VJ=(t,e,n)=>{const o=t.lab(),r=e.lab();return new Ve(o[0]+n*(r[0]-o[0]),o[1]+n*(r[1]-o[1]),o[2]+n*(r[2]-o[2]),"lab")};To.lab=VJ;const $u=(t,e,n,o)=>{let r,i;o==="hsl"?(r=t.hsl(),i=e.hsl()):o==="hsv"?(r=t.hsv(),i=e.hsv()):o==="hcg"?(r=t.hcg(),i=e.hcg()):o==="hsi"?(r=t.hsi(),i=e.hsi()):o==="lch"||o==="hcl"?(o="hcl",r=t.hcl(),i=e.hcl()):o==="oklch"&&(r=t.oklch().reverse(),i=e.oklch().reverse());let s,a,l,c,u,d;(o.substr(0,1)==="h"||o==="oklch")&&([s,l,u]=r,[a,c,d]=i);let f,h,g,v;return!isNaN(s)&&!isNaN(a)?(a>s&&a-s>180?v=a-(s+360):a<s&&s-a>180?v=a+360-s:v=a-s,h=s+n*v):isNaN(s)?isNaN(a)?h=Number.NaN:(h=a,(u==1||u==0)&&o!="hsv"&&(f=c)):(h=s,(d==1||d==0)&&o!="hsv"&&(f=l)),f===void 0&&(f=l+n*(c-l)),g=u+n*(d-u),o==="oklch"?new Ve([g,f,h],o):new Ve([h,f,g],o)},E5=(t,e,n)=>$u(t,e,n,"lch");To.lch=E5;To.hcl=E5;const zJ=t=>{if(Mt(t)=="number"&&t>=0&&t<=16777215){const e=t>>16,n=t>>8&255,o=t&255;return[e,n,o,1]}throw new Error("unknown num color: "+t)},HJ=(...t)=>{const[e,n,o]=St(t,"rgb");return(e<<16)+(n<<8)+o};Ve.prototype.num=function(){return HJ(this._rgb)};const WJ=(...t)=>new Ve(...t,"num");Object.assign(nt,{num:WJ});wt.format.num=zJ;wt.autodetect.push({p:5,test:(...t)=>{if(t.length===1&&Mt(t[0])==="number"&&t[0]>=0&&t[0]<=16777215)return"num"}});const UJ=(t,e,n)=>{const o=t.num(),r=e.num();return new Ve(o+n*(r-o),"num")};To.num=UJ;const{floor:GJ}=Math,qJ=(...t)=>{t=St(t,"hcg");let[e,n,o]=t,r,i,s;o=o*255;const a=n*255;if(n===0)r=i=s=o;else{e===360&&(e=0),e>360&&(e-=360),e<0&&(e+=360),e/=60;const l=GJ(e),c=e-l,u=o*(1-n),d=u+a*(1-c),f=u+a*c,h=u+a;switch(l){case 0:[r,i,s]=[h,f,u];break;case 1:[r,i,s]=[d,h,u];break;case 2:[r,i,s]=[u,h,f];break;case 3:[r,i,s]=[u,d,h];break;case 4:[r,i,s]=[f,u,h];break;case 5:[r,i,s]=[h,u,d];break}}return[r,i,s,t.length>3?t[3]:1]},YJ=(...t)=>{const[e,n,o]=St(t,"rgb"),r=C5(e,n,o),i=$5(e,n,o),s=i-r,a=s*100/255,l=r/(255-s)*100;let c;return s===0?c=Number.NaN:(e===i&&(c=(n-o)/s),n===i&&(c=2+(o-e)/s),o===i&&(c=4+(e-n)/s),c*=60,c<0&&(c+=360)),[c,a,l]};Ve.prototype.hcg=function(){return YJ(this._rgb)};const jJ=(...t)=>new Ve(...t,"hcg");nt.hcg=jJ;wt.format.hcg=qJ;wt.autodetect.push({p:1,test:(...t)=>{if(t=St(t,"hcg"),Mt(t)==="array"&&t.length===3)return"hcg"}});const XJ=(t,e,n)=>$u(t,e,n,"hcg");To.hcg=XJ;const{cos:mc}=Math,KJ=(...t)=>{t=St(t,"hsi");let[e,n,o]=t,r,i,s;return isNaN(e)&&(e=0),isNaN(n)&&(n=0),e>360&&(e-=360),e<0&&(e+=360),e/=360,e<1/3?(s=(1-n)/3,r=(1+n*mc($s*e)/mc(fv-$s*e))/3,i=1-(s+r)):e<2/3?(e-=1/3,r=(1-n)/3,i=(1+n*mc($s*e)/mc(fv-$s*e))/3,s=1-(r+i)):(e-=2/3,i=(1-n)/3,s=(1+n*mc($s*e)/mc(fv-$s*e))/3,r=1-(i+s)),r=Tl(o*r*3),i=Tl(o*i*3),s=Tl(o*s*3),[r*255,i*255,s*255,t.length>3?t[3]:1]},{min:ZJ,sqrt:QJ,acos:JJ}=Math,eee=(...t)=>{let[e,n,o]=St(t,"rgb");e/=255,n/=255,o/=255;let r;const i=ZJ(e,n,o),s=(e+n+o)/3,a=s>0?1-i/s:0;return a===0?r=NaN:(r=(e-n+(e-o))/2,r/=QJ((e-n)*(e-n)+(e-o)*(n-o)),r=JJ(r),o>n&&(r=$s-r),r/=$s),[r*360,a,s]};Ve.prototype.hsi=function(){return eee(this._rgb)};const tee=(...t)=>new Ve(...t,"hsi");nt.hsi=tee;wt.format.hsi=KJ;wt.autodetect.push({p:2,test:(...t)=>{if(t=St(t,"hsi"),Mt(t)==="array"&&t.length===3)return"hsi"}});const nee=(t,e,n)=>$u(t,e,n,"hsi");To.hsi=nee;const j1=(...t)=>{t=St(t,"hsl");const[e,n,o]=t;let r,i,s;if(n===0)r=i=s=o*255;else{const a=[0,0,0],l=[0,0,0],c=o<.5?o*(1+n):o+n-o*n,u=2*o-c,d=e/360;a[0]=d+1/3,a[1]=d,a[2]=d-1/3;for(let f=0;f<3;f++)a[f]<0&&(a[f]+=1),a[f]>1&&(a[f]-=1),6*a[f]<1?l[f]=u+(c-u)*6*a[f]:2*a[f]<1?l[f]=c:3*a[f]<2?l[f]=u+(c-u)*(2/3-a[f])*6:l[f]=u;[r,i,s]=[l[0]*255,l[1]*255,l[2]*255]}return t.length>3?[r,i,s,t[3]]:[r,i,s,1]},I5=(...t)=>{t=St(t,"rgba");let[e,n,o]=t;e/=255,n/=255,o/=255;const r=C5(e,n,o),i=$5(e,n,o),s=(i+r)/2;let a,l;return i===r?(a=0,l=Number.NaN):a=s<.5?(i-r)/(i+r):(i-r)/(2-i-r),e==i?l=(n-o)/(i-r):n==i?l=2+(o-e)/(i-r):o==i&&(l=4+(e-n)/(i-r)),l*=60,l<0&&(l+=360),t.length>3&&t[3]!==void 0?[l,a,s,t[3]]:[l,a,s]};Ve.prototype.hsl=function(){return I5(this._rgb)};const oee=(...t)=>new Ve(...t,"hsl");nt.hsl=oee;wt.format.hsl=j1;wt.autodetect.push({p:2,test:(...t)=>{if(t=St(t,"hsl"),Mt(t)==="array"&&t.length===3)return"hsl"}});const ree=(t,e,n)=>$u(t,e,n,"hsl");To.hsl=ree;const{floor:iee}=Math,see=(...t)=>{t=St(t,"hsv");let[e,n,o]=t,r,i,s;if(o*=255,n===0)r=i=s=o;else{e===360&&(e=0),e>360&&(e-=360),e<0&&(e+=360),e/=60;const a=iee(e),l=e-a,c=o*(1-n),u=o*(1-n*l),d=o*(1-n*(1-l));switch(a){case 0:[r,i,s]=[o,d,c];break;case 1:[r,i,s]=[u,o,c];break;case 2:[r,i,s]=[c,o,d];break;case 3:[r,i,s]=[c,u,o];break;case 4:[r,i,s]=[d,c,o];break;case 5:[r,i,s]=[o,c,u];break}}return[r,i,s,t.length>3?t[3]:1]},{min:aee,max:lee}=Math,cee=(...t)=>{t=St(t,"rgb");let[e,n,o]=t;const r=aee(e,n,o),i=lee(e,n,o),s=i-r;let a,l,c;return c=i/255,i===0?(a=Number.NaN,l=0):(l=s/i,e===i&&(a=(n-o)/s),n===i&&(a=2+(o-e)/s),o===i&&(a=4+(e-n)/s),a*=60,a<0&&(a+=360)),[a,l,c]};Ve.prototype.hsv=function(){return cee(this._rgb)};const uee=(...t)=>new Ve(...t,"hsv");nt.hsv=uee;wt.format.hsv=see;wt.autodetect.push({p:2,test:(...t)=>{if(t=St(t,"hsv"),Mt(t)==="array"&&t.length===3)return"hsv"}});const dee=(t,e,n)=>$u(t,e,n,"hsv");To.hsv=dee;function a0(t,e){let n=t.length;Array.isArray(t[0])||(t=[t]),Array.isArray(e[0])||(e=e.map(s=>[s]));let o=e[0].length,r=e[0].map((s,a)=>e.map(l=>l[a])),i=t.map(s=>r.map(a=>Array.isArray(s)?s.reduce((l,c,u)=>l+c*(a[u]||0),0):a.reduce((l,c)=>l+c*s,0)));return n===1&&(i=i[0]),o===1?i.map(s=>s[0]):i}const g2=(...t)=>{t=St(t,"lab");const[e,n,o,...r]=t,[i,s,a]=fee([e,n,o]),[l,c,u]=B5(i,s,a);return[l,c,u,...r.length>0&&r[0]<1?[r[0]]:[]]};function fee(t){var e=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],n=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],o=a0(n,t);return a0(e,o.map(r=>r**3))}const v2=(...t)=>{const[e,n,o,...r]=St(t,"rgb"),i=L5(e,n,o);return[...hee(i),...r.length>0&&r[0]<1?[r[0]]:[]]};function hee(t){const e=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],n=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],o=a0(e,t);return a0(n,o.map(r=>Math.cbrt(r)))}Ve.prototype.oklab=function(){return v2(this._rgb)};const pee=(...t)=>new Ve(...t,"oklab");Object.assign(nt,{oklab:pee});wt.format.oklab=g2;wt.autodetect.push({p:2,test:(...t)=>{if(t=St(t,"oklab"),Mt(t)==="array"&&t.length===3)return"oklab"}});const mee=(t,e,n)=>{const o=t.oklab(),r=e.oklab();return new Ve(o[0]+n*(r[0]-o[0]),o[1]+n*(r[1]-o[1]),o[2]+n*(r[2]-o[2]),"oklab")};To.oklab=mee;const gee=(t,e,n)=>$u(t,e,n,"oklch");To.oklch=gee;const{pow:vv,sqrt:bv,PI:yv,cos:e6,sin:t6,atan2:vee}=Math,bee=(t,e="lrgb",n=null)=>{const o=t.length;n||(n=Array.from(new Array(o)).map(()=>1));const r=o/n.reduce(function(d,f){return d+f});if(n.forEach((d,f)=>{n[f]*=r}),t=t.map(d=>new Ve(d)),e==="lrgb")return yee(t,n);const i=t.shift(),s=i.get(e),a=[];let l=0,c=0;for(let d=0;d<s.length;d++)if(s[d]=(s[d]||0)*n[0],a.push(isNaN(s[d])?0:n[0]),e.charAt(d)==="h"&&!isNaN(s[d])){const f=s[d]/180*yv;l+=e6(f)*n[0],c+=t6(f)*n[0]}let u=i.alpha()*n[0];t.forEach((d,f)=>{const h=d.get(e);u+=d.alpha()*n[f+1];for(let g=0;g<s.length;g++)if(!isNaN(h[g]))if(a[g]+=n[f+1],e.charAt(g)==="h"){const v=h[g]/180*yv;l+=e6(v)*n[f+1],c+=t6(v)*n[f+1]}else s[g]+=h[g]*n[f+1]});for(let d=0;d<s.length;d++)if(e.charAt(d)==="h"){let f=vee(c/a[d],l/a[d])/yv*180;for(;f<0;)f+=360;for(;f>=360;)f-=360;s[d]=f}else s[d]=s[d]/a[d];return u/=o,new Ve(s,e).alpha(u>.99999?1:u,!0)},yee=(t,e)=>{const n=t.length,o=[0,0,0,0];for(let r=0;r<t.length;r++){const i=t[r],s=e[r]/n,a=i._rgb;o[0]+=vv(a[0],2)*s,o[1]+=vv(a[1],2)*s,o[2]+=vv(a[2],2)*s,o[3]+=a[3]*s}return o[0]=bv(o[0]),o[1]=bv(o[1]),o[2]=bv(o[2]),o[3]>.9999999&&(o[3]=1),new Ve(d2(o))},{pow:xee}=Math;function l0(t){let e="rgb",n=nt("#ccc"),o=0,r=[0,1],i=[0,1],s=[],a=[0,0],l=!1,c=[],u=!1,d=0,f=1,h=!1,g={},v=!0,m=1;const b=function(S){if(S=S||["#fff","#000"],S&&Mt(S)==="string"&&nt.brewer&&nt.brewer[S.toLowerCase()]&&(S=nt.brewer[S.toLowerCase()]),Mt(S)==="array"){S.length===1&&(S=[S[0],S[0]]),S=S.slice(0);for(let B=0;B<S.length;B++)S[B]=nt(S[B]);s.length=0;for(let B=0;B<S.length;B++)s.push(B/(S.length-1))}return E(),c=S},y=function(S){if(l!=null){const B=l.length-1;let D=0;for(;D<B&&S>=l[D];)D++;return D-1}return 0};let x=S=>S,_=S=>S;const k=function(S,B){let D,N;if(B==null&&(B=!1),isNaN(S)||S===null)return n;B?N=S:l&&l.length>2?N=y(S)/(l.length-2):f!==d?N=(S-d)/(f-d):N=1,N=_(N),B||(N=x(N)),m!==1&&(N=xee(N,m)),N=a[0]+N*(1-a[0]-a[1]),N=Tl(N,0,1);const C=Math.floor(N*1e4);if(v&&g[C])D=g[C];else{if(Mt(c)==="array")for(let M=0;M<s.length;M++){const P=s[M];if(N<=P){D=c[M];break}if(N>=P&&M===s.length-1){D=c[M];break}if(N>P&&N<s[M+1]){N=(N-P)/(s[M+1]-P),D=nt.interpolate(c[M],c[M+1],N,e);break}}else Mt(c)==="function"&&(D=c(N));v&&(g[C]=D)}return D};var E=()=>g={};b(t);const L=function(S){const B=nt(k(S));return u&&B[u]?B[u]():B};return L.classes=function(S){if(S!=null){if(Mt(S)==="array")l=S,r=[S[0],S[S.length-1]];else{const B=nt.analyze(r);S===0?l=[B.min,B.max]:l=nt.limits(B,"e",S)}return L}return l},L.domain=function(S){if(!arguments.length)return i;i=S.slice(0),d=S[0],f=S[S.length-1],s=[];const B=c.length;if(S.length===B&&d!==f)for(let D of Array.from(S))s.push((D-d)/(f-d));else{for(let D=0;D<B;D++)s.push(D/(B-1));if(S.length>2){const D=S.map((C,M)=>M/(S.length-1)),N=S.map(C=>(C-d)/(f-d));N.every((C,M)=>D[M]===C)||(_=C=>{if(C<=0||C>=1)return C;let M=0;for(;C>=N[M+1];)M++;const P=(C-N[M])/(N[M+1]-N[M]);return D[M]+P*(D[M+1]-D[M])})}}return r=[d,f],L},L.mode=function(S){return arguments.length?(e=S,E(),L):e},L.range=function(S,B){return b(S),L},L.out=function(S){return u=S,L},L.spread=function(S){return arguments.length?(o=S,L):o},L.correctLightness=function(S){return S==null&&(S=!0),h=S,E(),h?x=function(B){const D=k(0,!0).lab()[0],N=k(1,!0).lab()[0],C=D>N;let M=k(B,!0).lab()[0];const P=D+(N-D)*B;let $=M-P,F=0,V=1,U=20;for(;Math.abs($)>.01&&U-- >0;)(function(){return C&&($*=-1),$<0?(F=B,B+=(V-B)*.5):(V=B,B+=(F-B)*.5),M=k(B,!0).lab()[0],$=M-P})();return B}:x=B=>B,L},L.padding=function(S){return S!=null?(Mt(S)==="number"&&(S=[S,S]),a=S,L):a},L.colors=function(S,B){arguments.length<2&&(B="hex");let D=[];if(arguments.length===0)D=c.slice(0);else if(S===1)D=[L(.5)];else if(S>1){const N=r[0],C=r[1]-N;D=wee(0,S).map(M=>L(N+M/(S-1)*C))}else{t=[];let N=[];if(l&&l.length>2)for(let C=1,M=l.length,P=1<=M;P?C<M:C>M;P?C++:C--)N.push((l[C-1]+l[C])*.5);else N=r;D=N.map(C=>L(C))}return nt[B]&&(D=D.map(N=>N[B]())),D},L.cache=function(S){return S!=null?(v=S,L):v},L.gamma=function(S){return S!=null?(m=S,L):m},L.nodata=function(S){return S!=null?(n=nt(S),L):n},L}function wee(t,e,n){let o=[],r=t<e,i=e;for(let s=t;r?s<i:s>i;r?s++:s--)o.push(s);return o}const _ee=function(t){let e=[1,1];for(let n=1;n<t;n++){let o=[1];for(let r=1;r<=e.length;r++)o[r]=(e[r]||0)+e[r-1];e=o}return e},kee=function(t){let e,n,o,r;if(t=t.map(i=>new Ve(i)),t.length===2)[n,o]=t.map(i=>i.lab()),e=function(i){const s=[0,1,2].map(a=>n[a]+i*(o[a]-n[a]));return new Ve(s,"lab")};else if(t.length===3)[n,o,r]=t.map(i=>i.lab()),e=function(i){const s=[0,1,2].map(a=>(1-i)*(1-i)*n[a]+2*(1-i)*i*o[a]+i*i*r[a]);return new Ve(s,"lab")};else if(t.length===4){let i;[n,o,r,i]=t.map(s=>s.lab()),e=function(s){const a=[0,1,2].map(l=>(1-s)*(1-s)*(1-s)*n[l]+3*(1-s)*(1-s)*s*o[l]+3*(1-s)*s*s*r[l]+s*s*s*i[l]);return new Ve(a,"lab")}}else if(t.length>=5){let i,s,a;i=t.map(l=>l.lab()),a=t.length-1,s=_ee(a),e=function(l){const c=1-l,u=[0,1,2].map(d=>i.reduce((f,h,g)=>f+s[g]*c**(a-g)*l**g*h[d],0));return new Ve(u,"lab")}}else throw new RangeError("No point in running bezier with only one color.");return e},See=t=>{const e=kee(t);return e.scale=()=>l0(e),e},{round:N5}=Math;Ve.prototype.rgb=function(t=!0){return t===!1?this._rgb.slice(0,3):this._rgb.slice(0,3).map(N5)};Ve.prototype.rgba=function(t=!0){return this._rgb.slice(0,4).map((e,n)=>n<3?t===!1?e:N5(e):e)};const Aee=(...t)=>new Ve(...t,"rgb");Object.assign(nt,{rgb:Aee});wt.format.rgb=(...t)=>{const e=St(t,"rgba");return e[3]===void 0&&(e[3]=1),e};wt.autodetect.push({p:3,test:(...t)=>{if(t=St(t,"rgba"),Mt(t)==="array"&&(t.length===3||t.length===4&&Mt(t[3])=="number"&&t[3]>=0&&t[3]<=1))return"rgb"}});const Mi=(t,e,n)=>{if(!Mi[n])throw new Error("unknown blend mode "+n);return Mi[n](t,e)},Za=t=>(e,n)=>{const o=nt(n).rgb(),r=nt(e).rgb();return nt.rgb(t(o,r))},Qa=t=>(e,n)=>{const o=[];return o[0]=t(e[0],n[0]),o[1]=t(e[1],n[1]),o[2]=t(e[2],n[2]),o},Cee=t=>t,$ee=(t,e)=>t*e/255,Tee=(t,e)=>t>e?e:t,Mee=(t,e)=>t>e?t:e,Oee=(t,e)=>255*(1-(1-t/255)*(1-e/255)),Bee=(t,e)=>e<128?2*t*e/255:255*(1-2*(1-t/255)*(1-e/255)),Lee=(t,e)=>255*(1-(1-e/255)/(t/255)),Pee=(t,e)=>t===255?255:(t=255*(e/255)/(1-t/255),t>255?255:t);Mi.normal=Za(Qa(Cee));Mi.multiply=Za(Qa($ee));Mi.screen=Za(Qa(Oee));Mi.overlay=Za(Qa(Bee));Mi.darken=Za(Qa(Tee));Mi.lighten=Za(Qa(Mee));Mi.dodge=Za(Qa(Pee));Mi.burn=Za(Qa(Lee));const{pow:Dee,sin:Eee,cos:Iee}=Math;function Nee(t=300,e=-1.5,n=1,o=1,r=[0,1]){let i=0,s;Mt(r)==="array"?s=r[1]-r[0]:(s=0,r=[r,r]);const a=function(l){const c=$s*((t+120)/360+e*l),u=Dee(r[0]+s*l,o),f=(i!==0?n[0]+l*i:n)*u*(1-u)/2,h=Iee(c),g=Eee(c),v=u+f*(-.14861*h+1.78277*g),m=u+f*(-.29227*h-.90649*g),b=u+f*(1.97294*h);return nt(d2([v*255,m*255,b*255,1]))};return a.start=function(l){return l==null?t:(t=l,a)},a.rotations=function(l){return l==null?e:(e=l,a)},a.gamma=function(l){return l==null?o:(o=l,a)},a.hue=function(l){return l==null?n:(n=l,Mt(n)==="array"?(i=n[1]-n[0],i===0&&(n=n[1])):i=0,a)},a.lightness=function(l){return l==null?r:(Mt(l)==="array"?(r=l,s=l[1]-l[0]):(r=[l,l],s=0),a)},a.scale=()=>nt.scale(a),a.hue(n),a}const Ree="0123456789abcdef",{floor:Fee,random:Vee}=Math,zee=(t=Vee)=>{let e="#";for(let n=0;n<6;n++)e+=Ree.charAt(Fee(t()*16));return new Ve(e,"hex")},{log:n6,pow:Hee,floor:Wee,abs:Uee}=Math;function R5(t,e=null){const n={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return Mt(t)==="object"&&(t=Object.values(t)),t.forEach(o=>{e&&Mt(o)==="object"&&(o=o[e]),o!=null&&!isNaN(o)&&(n.values.push(o),n.sum+=o,o<n.min&&(n.min=o),o>n.max&&(n.max=o),n.count+=1)}),n.domain=[n.min,n.max],n.limits=(o,r)=>F5(n,o,r),n}function F5(t,e="equal",n=7){Mt(t)=="array"&&(t=R5(t));const{min:o,max:r}=t,i=t.values.sort((a,l)=>a-l);if(n===1)return[o,r];const s=[];if(e.substr(0,1)==="c"&&(s.push(o),s.push(r)),e.substr(0,1)==="e"){s.push(o);for(let a=1;a<n;a++)s.push(o+a/n*(r-o));s.push(r)}else if(e.substr(0,1)==="l"){if(o<=0)throw new Error("Logarithmic scales are only possible for values > 0");const a=Math.LOG10E*n6(o),l=Math.LOG10E*n6(r);s.push(o);for(let c=1;c<n;c++)s.push(Hee(10,a+c/n*(l-a)));s.push(r)}else if(e.substr(0,1)==="q"){s.push(o);for(let a=1;a<n;a++){const l=(i.length-1)*a/n,c=Wee(l);if(c===l)s.push(i[c]);else{const u=l-c;s.push(i[c]*(1-u)+i[c+1]*u)}}s.push(r)}else if(e.substr(0,1)==="k"){let a;const l=i.length,c=new Array(l),u=new Array(n);let d=!0,f=0,h=null;h=[],h.push(o);for(let m=1;m<n;m++)h.push(o+m/n*(r-o));for(h.push(r);d;){for(let b=0;b<n;b++)u[b]=0;for(let b=0;b<l;b++){const y=i[b];let x=Number.MAX_VALUE,_;for(let k=0;k<n;k++){const E=Uee(h[k]-y);E<x&&(x=E,_=k),u[_]++,c[b]=_}}const m=new Array(n);for(let b=0;b<n;b++)m[b]=null;for(let b=0;b<l;b++)a=c[b],m[a]===null?m[a]=i[b]:m[a]+=i[b];for(let b=0;b<n;b++)m[b]*=1/u[b];d=!1;for(let b=0;b<n;b++)if(m[b]!==h[b]){d=!0;break}h=m,f++,f>200&&(d=!1)}const g={};for(let m=0;m<n;m++)g[m]=[];for(let m=0;m<l;m++)a=c[m],g[a].push(i[m]);let v=[];for(let m=0;m<n;m++)v.push(g[m][0]),v.push(g[m][g[m].length-1]);v=v.sort((m,b)=>m-b),s.push(v[0]);for(let m=1;m<v.length;m+=2){const b=v[m];!isNaN(b)&&s.indexOf(b)===-1&&s.push(b)}}return s}const Gee=(t,e)=>{t=new Ve(t),e=new Ve(e);const n=t.luminance(),o=e.luminance();return n>o?(n+.05)/(o+.05):(o+.05)/(n+.05)};/**
|
|
54
|
+
* @license
|
|
55
|
+
*
|
|
56
|
+
* The APCA contrast prediction algorithm is based of the formulas published
|
|
57
|
+
* in the APCA-1.0.98G specification by Myndex. The specification is available at:
|
|
58
|
+
* https://raw.githubusercontent.com/Myndex/apca-w3/master/images/APCAw3_0.1.17_APCA0.0.98G.svg
|
|
59
|
+
*
|
|
60
|
+
* Note that the APCA implementation is still beta, so please update to
|
|
61
|
+
* future versions of chroma.js when they become available.
|
|
62
|
+
*
|
|
63
|
+
* You can read more about the APCA Readability Criterion at
|
|
64
|
+
* https://readtech.org/ARC/
|
|
65
|
+
*/const o6=.027,qee=5e-4,Yee=.1,r6=1.14,vh=.022,i6=1.414,jee=(t,e)=>{t=new Ve(t),e=new Ve(e),t.alpha()<1&&(t=lu(e,t,t.alpha(),"rgb"));const n=s6(...t.rgb()),o=s6(...e.rgb()),r=n>=vh?n:n+Math.pow(vh-n,i6),i=o>=vh?o:o+Math.pow(vh-o,i6),s=Math.pow(i,.56)-Math.pow(r,.57),a=Math.pow(i,.65)-Math.pow(r,.62),l=Math.abs(i-r)<qee?0:r<i?s*r6:a*r6;return(Math.abs(l)<Yee?0:l>0?l-o6:l+o6)*100};function s6(t,e,n){return .2126729*Math.pow(t/255,2.4)+.7151522*Math.pow(e/255,2.4)+.072175*Math.pow(n/255,2.4)}const{sqrt:xs,pow:Pn,min:Xee,max:Kee,atan2:a6,abs:l6,cos:bh,sin:c6,exp:Zee,PI:u6}=Math;function Qee(t,e,n=1,o=1,r=1){var i=function(ve){return 360*ve/(2*u6)},s=function(ve){return 2*u6*ve/360};t=new Ve(t),e=new Ve(e);const[a,l,c]=Array.from(t.lab()),[u,d,f]=Array.from(e.lab()),h=(a+u)/2,g=xs(Pn(l,2)+Pn(c,2)),v=xs(Pn(d,2)+Pn(f,2)),m=(g+v)/2,b=.5*(1-xs(Pn(m,7)/(Pn(m,7)+Pn(25,7)))),y=l*(1+b),x=d*(1+b),_=xs(Pn(y,2)+Pn(c,2)),k=xs(Pn(x,2)+Pn(f,2)),E=(_+k)/2,L=i(a6(c,y)),S=i(a6(f,x)),B=L>=0?L:L+360,D=S>=0?S:S+360,N=l6(B-D)>180?(B+D+360)/2:(B+D)/2,C=1-.17*bh(s(N-30))+.24*bh(s(2*N))+.32*bh(s(3*N+6))-.2*bh(s(4*N-63));let M=D-B;M=l6(M)<=180?M:D<=B?M+360:M-360,M=2*xs(_*k)*c6(s(M)/2);const P=u-a,$=k-_,F=1+.015*Pn(h-50,2)/xs(20+Pn(h-50,2)),V=1+.045*E,U=1+.015*E*C,K=30*Zee(-Pn((N-275)/25,2)),me=-(2*xs(Pn(E,7)/(Pn(E,7)+Pn(25,7))))*c6(2*s(K)),de=xs(Pn(P/(n*F),2)+Pn($/(o*V),2)+Pn(M/(r*U),2)+me*($/(o*V))*(M/(r*U)));return Kee(0,Xee(100,de))}function Jee(t,e,n="lab"){t=new Ve(t),e=new Ve(e);const o=t.get(n),r=e.get(n);let i=0;for(let s in o){const a=(o[s]||0)-(r[s]||0);i+=a*a}return Math.sqrt(i)}const ete=(...t)=>{try{return new Ve(...t),!0}catch{return!1}},tte={cool(){return l0([nt.hsl(180,1,.9),nt.hsl(250,.7,.4)])},hot(){return l0(["#000","#f00","#ff0","#fff"]).mode("rgb")}},X1={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},V5=Object.keys(X1),d6=new Map(V5.map(t=>[t.toLowerCase(),t])),nte=typeof Proxy=="function"?new Proxy(X1,{get(t,e){const n=e.toLowerCase();if(d6.has(n))return t[d6.get(n)]},getOwnPropertyNames(){return Object.getOwnPropertyNames(V5)}}):X1,ote=(...t)=>{t=St(t,"cmyk");const[e,n,o,r]=t,i=t.length>4?t[4]:1;return r===1?[0,0,0,i]:[e>=1?0:255*(1-e)*(1-r),n>=1?0:255*(1-n)*(1-r),o>=1?0:255*(1-o)*(1-r),i]},{max:f6}=Math,rte=(...t)=>{let[e,n,o]=St(t,"rgb");e=e/255,n=n/255,o=o/255;const r=1-f6(e,f6(n,o)),i=r<1?1/(1-r):0,s=(1-e-r)*i,a=(1-n-r)*i,l=(1-o-r)*i;return[s,a,l,r]};Ve.prototype.cmyk=function(){return rte(this._rgb)};const ite=(...t)=>new Ve(...t,"cmyk");Object.assign(nt,{cmyk:ite});wt.format.cmyk=ote;wt.autodetect.push({p:2,test:(...t)=>{if(t=St(t,"cmyk"),Mt(t)==="array"&&t.length===4)return"cmyk"}});const ste=(...t)=>{const e=St(t,"hsla");let n=Cu(t)||"lsa";return e[0]=Hr(e[0]||0)+"deg",e[1]=Hr(e[1]*100)+"%",e[2]=Hr(e[2]*100)+"%",n==="hsla"||e.length>3&&e[3]<1?(e[3]="/ "+(e.length>3?e[3]:1),n="hsla"):e.length=3,`${n.substr(0,3)}(${e.join(" ")})`},ate=(...t)=>{const e=St(t,"lab");let n=Cu(t)||"lab";return e[0]=Hr(e[0])+"%",e[1]=Hr(e[1]),e[2]=Hr(e[2]),n==="laba"||e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`lab(${e.join(" ")})`},lte=(...t)=>{const e=St(t,"lch");let n=Cu(t)||"lab";return e[0]=Hr(e[0])+"%",e[1]=Hr(e[1]),e[2]=isNaN(e[2])?"none":Hr(e[2])+"deg",n==="lcha"||e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`lch(${e.join(" ")})`},cte=(...t)=>{const e=St(t,"lab");return e[0]=Hr(e[0]*100)+"%",e[1]=Y1(e[1]),e[2]=Y1(e[2]),e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`oklab(${e.join(" ")})`},z5=(...t)=>{const[e,n,o,...r]=St(t,"rgb"),[i,s,a]=v2(e,n,o),[l,c,u]=D5(i,s,a);return[l,c,u,...r.length>0&&r[0]<1?[r[0]]:[]]},ute=(...t)=>{const e=St(t,"lch");return e[0]=Hr(e[0]*100)+"%",e[1]=Y1(e[1]),e[2]=isNaN(e[2])?"none":Hr(e[2])+"deg",e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`oklch(${e.join(" ")})`},{round:xv}=Math,dte=(...t)=>{const e=St(t,"rgba");let n=Cu(t)||"rgb";if(n.substr(0,3)==="hsl")return ste(I5(e),n);if(n.substr(0,3)==="lab"){const o=rf();Es("d50");const r=ate(h2(e),n);return Es(o),r}if(n.substr(0,3)==="lch"){const o=rf();Es("d50");const r=lte(m2(e),n);return Es(o),r}return n.substr(0,5)==="oklab"?cte(v2(e)):n.substr(0,5)==="oklch"?ute(z5(e)):(e[0]=xv(e[0]),e[1]=xv(e[1]),e[2]=xv(e[2]),(n==="rgba"||e.length>3&&e[3]<1)&&(e[3]="/ "+(e.length>3?e[3]:1),n="rgba"),`${n.substr(0,3)}(${e.slice(0,n==="rgb"?3:4).join(" ")})`)},H5=(...t)=>{t=St(t,"lch");const[e,n,o,...r]=t,[i,s,a]=P5(e,n,o),[l,c,u]=g2(i,s,a);return[l,c,u,...r.length>0&&r[0]<1?[r[0]]:[]]},zs=/((?:-?\d+)|(?:-?\d+(?:\.\d+)?)%|none)/.source,vi=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%?)|none)/.source,c0=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%)|none)/.source,Yr=/\s*/.source,Tu=/\s+/.source,b2=/\s*,\s*/.source,Um=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?)|none)/.source,Mu=/\s*(?:\/\s*((?:[01]|[01]?\.\d+)|\d+(?:\.\d+)?%))?/.source,W5=new RegExp("^rgba?\\("+Yr+[zs,zs,zs].join(Tu)+Mu+"\\)$"),U5=new RegExp("^rgb\\("+Yr+[zs,zs,zs].join(b2)+Yr+"\\)$"),G5=new RegExp("^rgba\\("+Yr+[zs,zs,zs,vi].join(b2)+Yr+"\\)$"),q5=new RegExp("^hsla?\\("+Yr+[Um,c0,c0].join(Tu)+Mu+"\\)$"),Y5=new RegExp("^hsl?\\("+Yr+[Um,c0,c0].join(b2)+Yr+"\\)$"),j5=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,X5=new RegExp("^lab\\("+Yr+[vi,vi,vi].join(Tu)+Mu+"\\)$"),K5=new RegExp("^lch\\("+Yr+[vi,vi,Um].join(Tu)+Mu+"\\)$"),Z5=new RegExp("^oklab\\("+Yr+[vi,vi,vi].join(Tu)+Mu+"\\)$"),Q5=new RegExp("^oklch\\("+Yr+[vi,vi,Um].join(Tu)+Mu+"\\)$"),{round:J5}=Math,gc=t=>t.map((e,n)=>n<=2?Tl(J5(e),0,255):e),Dn=(t,e=0,n=100,o=!1)=>(typeof t=="string"&&t.endsWith("%")&&(t=parseFloat(t.substring(0,t.length-1))/100,o?t=e+(t+1)*.5*(n-e):t=e+t*(n-e)),+t),Do=(t,e)=>t==="none"?e:t,y2=t=>{if(t=t.toLowerCase().trim(),t==="transparent")return[0,0,0,0];let e;if(wt.format.named)try{return wt.format.named(t)}catch{}if((e=t.match(W5))||(e=t.match(U5))){let n=e.slice(1,4);for(let r=0;r<3;r++)n[r]=+Dn(Do(n[r],0),0,255);n=gc(n);const o=e[4]!==void 0?+Dn(e[4],0,1):1;return n[3]=o,n}if(e=t.match(G5)){const n=e.slice(1,5);for(let o=0;o<4;o++)n[o]=+Dn(n[o],0,255);return n}if((e=t.match(q5))||(e=t.match(Y5))){const n=e.slice(1,4);n[0]=+Do(n[0].replace("deg",""),0),n[1]=+Dn(Do(n[1],0),0,100)*.01,n[2]=+Dn(Do(n[2],0),0,100)*.01;const o=gc(j1(n)),r=e[4]!==void 0?+Dn(e[4],0,1):1;return o[3]=r,o}if(e=t.match(j5)){const n=e.slice(1,4);n[1]*=.01,n[2]*=.01;const o=j1(n);for(let r=0;r<3;r++)o[r]=J5(o[r]);return o[3]=+e[4],o}if(e=t.match(X5)){const n=e.slice(1,4);n[0]=Dn(Do(n[0],0),0,100),n[1]=Dn(Do(n[1],0),-125,125,!0),n[2]=Dn(Do(n[2],0),-125,125,!0);const o=rf();Es("d50");const r=gc(f2(n));Es(o);const i=e[4]!==void 0?+Dn(e[4],0,1):1;return r[3]=i,r}if(e=t.match(K5)){const n=e.slice(1,4);n[0]=Dn(n[0],0,100),n[1]=Dn(Do(n[1],0),0,150,!1),n[2]=+Do(n[2].replace("deg",""),0);const o=rf();Es("d50");const r=gc(p2(n));Es(o);const i=e[4]!==void 0?+Dn(e[4],0,1):1;return r[3]=i,r}if(e=t.match(Z5)){const n=e.slice(1,4);n[0]=Dn(Do(n[0],0),0,1),n[1]=Dn(Do(n[1],0),-.4,.4,!0),n[2]=Dn(Do(n[2],0),-.4,.4,!0);const o=gc(g2(n)),r=e[4]!==void 0?+Dn(e[4],0,1):1;return o[3]=r,o}if(e=t.match(Q5)){const n=e.slice(1,4);n[0]=Dn(Do(n[0],0),0,1),n[1]=Dn(Do(n[1],0),0,.4,!1),n[2]=+Do(n[2].replace("deg",""),0);const o=gc(H5(n)),r=e[4]!==void 0?+Dn(e[4],0,1):1;return o[3]=r,o}};y2.test=t=>W5.test(t)||q5.test(t)||X5.test(t)||K5.test(t)||Z5.test(t)||Q5.test(t)||U5.test(t)||G5.test(t)||Y5.test(t)||j5.test(t)||t==="transparent";Ve.prototype.css=function(t){return dte(this._rgb,t)};const fte=(...t)=>new Ve(...t,"css");nt.css=fte;wt.format.css=y2;wt.autodetect.push({p:5,test:(t,...e)=>{if(!e.length&&Mt(t)==="string"&&y2.test(t))return"css"}});wt.format.gl=(...t)=>{const e=St(t,"rgba");return e[0]*=255,e[1]*=255,e[2]*=255,e};const hte=(...t)=>new Ve(...t,"gl");nt.gl=hte;Ve.prototype.gl=function(){const t=this._rgb;return[t[0]/255,t[1]/255,t[2]/255,t[3]]};Ve.prototype.hex=function(t){return O5(this._rgb,t)};const pte=(...t)=>new Ve(...t,"hex");nt.hex=pte;wt.format.hex=M5;wt.autodetect.push({p:4,test:(t,...e)=>{if(!e.length&&Mt(t)==="string"&&[3,4,5,6,7,8,9].indexOf(t.length)>=0)return"hex"}});const{log:yh}=Math,e$=t=>{const e=t/100;let n,o,r;return e<66?(n=255,o=e<6?0:-155.25485562709179-.44596950469579133*(o=e-2)+104.49216199393888*yh(o),r=e<20?0:-254.76935184120902+.8274096064007395*(r=e-10)+115.67994401066147*yh(r)):(n=351.97690566805693+.114206453784165*(n=e-55)-40.25366309332127*yh(n),o=325.4494125711974+.07943456536662342*(o=e-50)-28.0852963507957*yh(o),r=255),[n,o,r,1]},{round:mte}=Math,gte=(...t)=>{const e=St(t,"rgb"),n=e[0],o=e[2];let r=1e3,i=4e4;const s=.4;let a;for(;i-r>s;){a=(i+r)*.5;const l=e$(a);l[2]/l[0]>=o/n?i=a:r=a}return mte(a)};Ve.prototype.temp=Ve.prototype.kelvin=Ve.prototype.temperature=function(){return gte(this._rgb)};const wv=(...t)=>new Ve(...t,"temp");Object.assign(nt,{temp:wv,kelvin:wv,temperature:wv});wt.format.temp=wt.format.kelvin=wt.format.temperature=e$;Ve.prototype.oklch=function(){return z5(this._rgb)};const vte=(...t)=>new Ve(...t,"oklch");Object.assign(nt,{oklch:vte});wt.format.oklch=H5;wt.autodetect.push({p:2,test:(...t)=>{if(t=St(t,"oklch"),Mt(t)==="array"&&t.length===3)return"oklch"}});Object.assign(nt,{analyze:R5,average:bee,bezier:See,blend:Mi,brewer:nte,Color:Ve,colors:au,contrast:Gee,contrastAPCA:jee,cubehelix:Nee,deltaE:Qee,distance:Jee,input:wt,interpolate:lu,limits:F5,mix:lu,random:zee,scale:l0,scales:tte,valid:ete});function t$(t,e){if(!nt.valid(t))return e;try{return nt(t)}catch{return e}}function Cr(t){return nt.valid(t)&&nt.contrast(t,"#fff")>=nt.contrast(t,"#333")?"#fff":"#333"}function bte(t,e){return!nt.valid(t)||!nt.valid(e)?1:nt.contrast(t,e)}function yte(t){return t>=7?"AAA":t>=4.5?"AA":"Fail"}const sf=4.5;function $r(t){let e=t;for(;e&&e instanceof Element;){const n=getComputedStyle(e).backgroundColor;if(n&&n!=="rgba(0, 0, 0, 0)"&&n!=="transparent")return n;e=e.parentElement}return"#fff"}function n$(t,e="#fff"){if(!nt.valid(t))return nt.valid(e)?Cr(e):"#333";let n=nt(t);const o=t$(e,nt("#fff"));if(nt.contrast(n,o)>=sf)return n.hex();const r=o.luminance()>.5;for(let i=0;i<20&&(n=r?n.darken(.3):n.brighten(.3),!(nt.contrast(n,o)>=sf));i++);return n.hex()}const x2=12,u0=.25,o$=20;function r$(t,e){if(t.length===0)return[];const n=t$(e,nt("#fff")),o=nt.valid(e)?e:"#fff",r=n.luminance()>.5,i=t.map(s=>nt.valid(s)?xte(nt(s),o,r):nt("#000"));for(let s=1;s<i.length;s++)nt.deltaE(i[s],i[s-1])>=x2||(i[s]=wte(i[s],i[s-1],o,r));return i.map(s=>s.hex())}function xte(t,e,n){for(let o=0;o<o$;o++){if(nt.contrast(t,e)>=sf)return t;t=n?t.darken(u0):t.brighten(u0)}return t}function wte(t,e,n,o){const r=h6(t,e,n,o);if(nt.deltaE(r,e)>=x2)return r;const i=h6(t,e,n,!o);return nt.deltaE(i,e)>nt.deltaE(r,e)&&nt.contrast(i,n)>=sf?i:r}function h6(t,e,n,o){let r=t,i=nt.deltaE(t,e),s=t;for(let a=0;a<o$;a++){s=o?s.darken(u0):s.brighten(u0);const l=nt.deltaE(s,e);if(l>i&&nt.contrast(s,n)>=sf&&(r=s,i=l),i>=x2)break}return r}const i$=new WeakMap;function Qr(t){return i$.get(t)}function Jr(t,e){i$.set(t,e)}let _te=0;const p6=new WeakMap;function Di(t,e,n,o){let r=p6.get(e);r||(r=new Map,p6.set(e,r));let i=r.get(n);i||(i=`bc-clip-${++_te}`,r.set(n,i));const s=Ae(t).select("defs").empty()?Ae(t).append("defs"):Ae(t).select("defs"),a=s.select(`#${i}`);return a.empty()?s.append("clipPath").attr("id",i).append("rect").attr("x",o.x).attr("y",o.y).attr("width",o.width).attr("height",o.height):a.select("rect").attr("x",o.x).attr("y",o.y).attr("width",o.width).attr("height",o.height),i}const rp="bc-scene",kte=500,m6=new Set,K1=new WeakMap;function oc(t){let e=K1.get(t);return e||(e=new Ate(t),K1.set(t,e)),e}function Ste(t){K1.delete(t)}class Ate{constructor(e){bn(this,"container");bn(this,"_state","idle");bn(this,"_transition",null);bn(this,"_buffer",[]);this.container=e}register(e){this._buffer.push(e)}get state(){return this._state}get activeTransition(){return this._transition}beginCommit(){(this._state==="committing"||this._state==="animating")&&this.interrupt(),this._state="committing"}commit(e={}){if(this._state!=="committing"){console.warn(`[blueprint-chart] commit() called from state '${this._state}' — call beginCommit() first; ignored.`);return}const n=e.mode??"transform";if(n!=="transform"){m6.has(n)||(m6.add(n),console.warn(`[blueprint-chart] transition mode '${n}' is not yet implemented; falling back to snap.`));const a=this._buffer;this._buffer=[],this._state="animating";for(const l of a)try{l()}catch(c){console.warn("[blueprint-chart] feature flush failed:",c)}this._state="idle";return}const o=e.duration??kte,r=this.effectiveDuration(o),i=this._buffer;if(this._buffer=[],r<=0){this._state="animating";for(const a of i)try{a()}catch(l){console.warn("[blueprint-chart] feature flush failed:",l)}this._state="idle";return}this._state="animating";const s=$C(rp).duration(r).ease(Kp);this._transition=s;for(const a of i)try{a()}catch(l){console.warn("[blueprint-chart] feature flush failed:",l)}s.on("end",()=>{this._transition===s&&(this._transition=null,this._state="idle")}),s.on("interrupt",()=>{this._transition===s&&(this._transition=null,this._state="idle")})}effectiveDuration(e){return e<=0?0:typeof window>"u"||typeof window.matchMedia!="function"?e:window.matchMedia("(prefers-reduced-motion: reduce)").matches?0:e}interrupt(){this._buffer=[],this._transition=null,Ae(this.container).interrupt(rp),Ae(this.container).selectAll("*").interrupt(rp),this._state="idle"}run(e,n={}){this.beginCommit();try{e()}catch(o){console.warn("[blueprint-chart] scene-transition commit failed:",o),this._state="idle";return}this.commit(n)}destroy(){this.interrupt(),Ste(this.container)}}function Cte(t,e){const n=new Map;return t.querySelectorAll(`[data-bc-role="${e}"]`).forEach(r=>{const i=r.getAttribute("data-bc-key");i!=null&&n.set(i,r)}),n}function $te(t,e){return t.tagName===e.tagName}function g6(t,e){Ae(t).interrupt(rp);const n={};for(const o of e){const r=t.getAttribute(o);r!==null&&(n[o]=r)}return n}const Tte={opacity:0};function Ou(t,e){if(t.state==="idle"||t.state==="animating"){Mte(e);return}t.register(()=>Ote(t,e))}function Mte(t){const n=Ae(t.parent).selectAll(t.selector).data(t.data,i=>t.key(i));n.exit().remove();const o=t.insert(n.enter());s$(o,t),o.merge(n).each(function(i){dd(this,t.attrs(i))})}function Ote(t,e){const n=t.activeTransition,r=Ae(e.parent).selectAll(e.selector).data(e.data,c=>e.key(c)),i=Bte(e),s=r.exit();n?s.each(function(){const c=this,u=Ae(c).datum(),d=e.exitTo?e.exitTo(u):Tte;xh(c,d,n).on("end.featureJoin-exit",()=>{var f;return(f=c.parentNode)==null?void 0:f.removeChild(c)})}):s.remove();const a=Cte(t.container,e.role),l=e.insert(r.enter());s$(l,e),l.each(function(c){const u=this,d=e.attrs(c);if(n){const f=e.key(c),h=a.get(f);if(h&&$te(h,u)){const v=g6(h,i);dd(u,v),xh(u,d,n);return}const g=e.enterFrom?e.enterFrom(c):d;dd(u,g),xh(u,d,n)}else dd(u,d)}),r.each(function(c){const u=this,d=e.attrs(c);n?(g6(u,i),xh(u,d,n)):dd(u,d)})}function s$(t,e){t.attr("data-bc-role",e.role),t.attr("data-bc-key",n=>e.key(n))}function Bte(t){return t.data.length===0?[]:Object.keys(t.attrs(t.data[0]))}function dd(t,e){for(const[n,o]of Object.entries(e))t.setAttribute(n,String(o))}function xh(t,e,n){const o=Ae(t).transition(n);for(const[r,i]of Object.entries(e))o.attr(r,String(i));return o}const Lte=.35;function Bu(t){return new Set((t??[]).map(e=>e.target))}function In(t,e,n=1){return t.size===0||t.has(e)?n:Lte}const vc=["#4e79a7"],v6=13;class Pte extends lo{initialize(){}}function a$(t,e,n={},o=!1){var ge,re,oe,he,I,G,Y,se,fe,ne,Q,q,X,j;Zr(o);let r=null,i,s;const a=Br.for(t);if(o){const ce=Qr(t);s=ce==null?void 0:ce.margin,a.detach(),ce&&ce.chartType!=="bar-vertical"&&(r=Mr(t)),i=new Map;for(const ye of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[ue,ke]of ur(ye))i.set(ue,ke);t.replaceChildren()}const{body:l}=Xr(t,n.frame),c=cr(l).width,u=n.categoryLabelLine===!0,d=Jl(e.values,(ge=n.verticalAxis)==null?void 0:ge.range,(re=n.verticalAxis)==null?void 0:re.numberFormat,(oe=n.verticalAxis)==null?void 0:oe.scaleType),f=u?on.Off:(he=n.horizontalAxis)==null?void 0:he.labelPosition,h=Pi(c,(I=n.verticalAxis)==null?void 0:I.labelPosition,f,(G=n.verticalAxis)==null?void 0:G.direction,d);if(!u){const ce=Math.max(0,c-(h.left??50)-(h.right??20)),ye=o2(e.labels,ce,n.horizontalAxis);ye!==void 0&&(h.bottom=ye)}const{chartArea:g,width:v,height:m,margin:b}=Kr(l,h),x=m-(u?v6:0),_=Li(s,b),k=Ite(e,n),E=k.map(ce=>({label:ce,value:e.values[e.labels.indexOf(ce)]})),L=n.swapLabelValue===!0,S=n.waterfall===!0,B=[];if(S){let ce=0;for(const ye of E){const ue=ce;ce+=ye.value,B.push({label:ye.label,value:ye.value,y0:ue,y1:ce,isTotal:!1})}n.waterfallTotal&&B.push({label:"Total",value:ce,y0:0,y1:ce,isTotal:!0})}const D=S?B.map(ce=>ce.label):k,N=Zn().domain(D).range([0,v]).padding(tc(n.barGap)),C=((Y=n.verticalAxis)==null?void 0:Y.scaleType)==="log",M=S?B.flatMap(ce=>[ce.y0,ce.y1]):E.map(ce=>ce.value);let[P,$]=ku(M,(se=n.verticalAxis)==null?void 0:se.range,(fe=n.verticalAxis)==null?void 0:fe.scaleType);if(n.valueLabels&&P<0&&((Q=(ne=n.verticalAxis)==null?void 0:ne.range)==null?void 0:Q.min)==null){const ce=$-P;P-=ce*.1}const F=C?ja().domain([P,$]).nice().range([x,0]):Bn().domain([P,$]).nice().range([x,0]);a.attach(g,_);const V=L&&n.valueLabels&&!S?(()=>{const ce=new Map(E.map(ye=>[ye.label,ye.value]));return{...n.horizontalAxis,width:v,tickFormat:ye=>String(ce.get(ye)??ye)}})():{...n.horizontalAxis,width:v},U=u?{...V,labelPosition:on.Off}:V;a.update({vertical:{scale:F,height:m,options:{...n.verticalAxis,gridWidth:v,topPadding:b.top}},horizontal:{scale:N,height:m,options:U}}),!C&&P<0&&$>0&&Ae(g).append("line").attr("class","bc-zero-baseline").attr("x1",0).attr("x2",v).attr("y1",F(0)).attr("y2",F(0)).attr("stroke","#666").attr("stroke-width",1);const K=new Map((n.colorizes??[]).map(ce=>[ce.target,ce.color])),ae=new Set((n.highlights??[]).map(ce=>ce.target)),me=g.ownerSVGElement,de=Di(me,t,"bars",{x:0,y:0,width:v,height:x}),ve=Ae(me).select("defs"),te=de.replace(/^bc-clip-/,""),pe=Ae(g).append("g").attr("clip-path",`url(#${de})`);if(n.barBackground){const ce=(n.colors??vc)[0],ye=S?D:E.map(ue=>ue.label);pe.selectAll(".bc-bar-bg").data(ye,ue=>ue).enter().append("rect").attr("class","bc-bar-bg").attr("x",ue=>N(ue)??0).attr("y",0).attr("width",N.bandwidth()).attr("height",x).attr("fill",ce).attr("opacity",.18)}const we=S?D:E.map(ce=>ce.label);if(n.barSeparators&&we.length>1){const ce=N.step();for(let ye=1;ye<we.length;ye++){const ue=(N(we[ye-1])??0)+N.bandwidth()+(ce-N.bandwidth())/2;pe.append("line").attr("class","bc-bar-separator").attr("x1",ue).attr("x2",ue).attr("y1",0).attr("y2",x).attr("stroke","currentColor").attr("opacity",.15)}}if(!S&&n.connectedColumns&&E.length>1){const ce=n.colors??vc,ye=n.connectionsOpacity??.15;for(let ue=0;ue<E.length-1;ue++){const ke=E[ue],Ie=E[ue+1];if(ke.value==null||Ie.value==null||Number.isNaN(ke.value)||Number.isNaN(Ie.value)||ke.value===0||Ie.value===0)continue;const Se=(N(ke.label)??0)+N.bandwidth(),Be=N(Ie.label)??0,Ze=Math.min(F(0),F(ke.value)),ot=Math.min(F(0),F(Ie.value)),pt=F(0),Tt=K.get(ke.label)??ce[0],Jt=K.get(Ie.label)??ce[0];let pn;if(Tt===Jt)pn=Tt;else{const Et=`bc-conn-grad-${te}-${ue}`,Ft=ve.append("linearGradient").attr("id",Et).attr("x1","0%").attr("x2","100%").attr("y1","0%").attr("y2","0%");Ft.append("stop").attr("offset","0%").attr("stop-color",Tt),Ft.append("stop").attr("offset","100%").attr("stop-color",Jt),pn=`url(#${Et})`}pe.append("polygon").attr("class","bc-bar-connection").attr("points",`${Se},${Ze} ${Be},${ot} ${Be},${pt} ${Se},${pt}`).attr("fill",pn).attr("opacity",ye).attr("pointer-events","none")}}const J=Ae(g).append("g");if(S){const ce=n.colors??vc,ye="#333";if(n.connectedColumns&&B.length>1){const ue=n.colors??vc,ke=n.connectionsOpacity??.15;for(let Ie=0;Ie<B.length-1;Ie++){const Se=B[Ie],Be=B[Ie+1];if(Be.isTotal||Se.value==null||Be.value==null||Number.isNaN(Se.value)||Number.isNaN(Be.value)||Se.value===0||Be.value===0)continue;const Ze=(N(Se.label)??0)+N.bandwidth(),ot=N(Be.label)??0,pt=F(Se.y1),Tt=F(Be.y1),Jt=F(Se.y0),pn=F(Be.y0),Et=K.get(Se.label)??ue[0],Ft=K.get(Be.label)??ue[0];let dn;if(Et===Ft)dn=Et;else{const Sn=`bc-conn-grad-${te}-${Ie}`,Jn=ve.append("linearGradient").attr("id",Sn).attr("x1","0%").attr("x2","100%").attr("y1","0%").attr("y2","0%");Jn.append("stop").attr("offset","0%").attr("stop-color",Et),Jn.append("stop").attr("offset","100%").attr("stop-color",Ft),dn=`url(#${Sn})`}pe.append("polygon").attr("class","bc-bar-connection").attr("points",`${Ze},${pt} ${ot},${Tt} ${ot},${pn} ${Ze},${Jt}`).attr("fill",dn).attr("opacity",ke).attr("pointer-events","none")}}for(let ue=0;ue<B.length-1;ue++){const ke=B[ue],Ie=B[ue+1];if(Ie.isTotal)break;pe.append("line").attr("class","bc-waterfall-connector").attr("x1",(N(ke.label)??0)+N.bandwidth()).attr("x2",N(Ie.label)??0).attr("y1",F(ke.y1)).attr("y2",F(ke.y1)).attr("stroke","currentColor").attr("stroke-dasharray","2,2").attr("opacity",.3)}if(pe.selectAll(".bc-bar").data(B,ue=>ue.label).enter().append("rect").attr("class","bc-bar").attr("x",ue=>N(ue.label)??0).attr("y",ue=>Math.min(F(ue.y0),F(ue.y1))).attr("width",N.bandwidth()).attr("height",ue=>Math.abs(F(ue.y0)-F(ue.y1))).attr("fill",ue=>ue.isTotal?ye:K.get(ue.label)??ce[0]).attr("opacity",ue=>ae.size>0?In(ae,ue.label):null),n.valueLabels){const ue=n.valueLabelPosition??yt.Auto,ke=Ia(((q=n.verticalAxis)==null?void 0:q.numberFormat)??""),Ie=Se=>ke?ke(Se):String(Se);J.selectAll(".bc-value-label").data(B,Se=>Se.label).enter().append("text").attr("class","bc-value-label").attr("font-size","11px").attr("x",Se=>(N(Se.label)??0)+N.bandwidth()/2).attr("y",Se=>{const Be=Math.min(F(Se.y0),F(Se.y1)),Ze=Math.abs(F(Se.y0)-F(Se.y1));return ue===yt.Inside?Be+Ze/2:Be-4}).attr("text-anchor","middle").attr("dominant-baseline",ue===yt.Inside?"central":"auto").attr("fill",Se=>ue===yt.Inside?Cr(Se.isTotal?ye:K.get(Se.label)??ce[0]):"currentColor").text(Se=>L?Se.label:Ie(Se.isTotal?Se.y1:Se.value))}}else{const ce=oc(t),ye=pe.append("g").node();Ou(ce,{role:"mark-per-category",parent:ye,selector:".bc-bar",data:E,key:ke=>ke.label,insert:ke=>ke.append("rect").attr("class","bc-bar"),attrs:ke=>({x:N(ke.label)??0,y:Math.min(F(0),F(ke.value)),width:N.bandwidth(),height:Math.abs(F(ke.value)-F(0)),fill:K.get(ke.label)??(n.colors??vc)[0],opacity:In(ae,ke.label)})});const ue=new Pte(pe);n.tooltips&&ue.use(Ka({numberFormat:(X=n.verticalAxis)==null?void 0:X.numberFormat})),n.crosshair&&ue.use(nc({width:v,height:x,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor})),(j=n.annotations)!=null&&j.length&&ue.use(Au(n.annotations,{scaleX:N,scaleY:F,data:E,width:v,height:x,backgroundColor:$r(t),transition:o,priorAnnotations:i})),ue.draw(E),n.valueLabels&&Ete(J,E,N,F,{position:n.valueLabelPosition,colorOverrides:K,colors:n.colors??vc,swapLabelValue:L})}if(u){const ce=Ae(g).append("g").attr("class","bc-category-labels");for(const ye of D)ce.append("text").attr("class","bc-category-label").attr("x",(N(ye)??0)+N.bandwidth()/2).attr("y",x+v6/2).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size","10px").attr("font-weight","600").attr("fill","currentColor").text(ye)}Jr(t,{chartType:"bar-vertical",margin:b}),r&&(Tr(pe.node()),Or(t,r))}function Dte(t,e,n,o){const r=Math.abs(n(t.value)-n(0)),i=o===yt.Inside,s=(e(t.label)??0)+e.bandwidth()/2,a="middle";let l,c;return t.value<0?i?(l=n(t.value)-r/2,c="central"):(l=n(t.value)+4,c="hanging"):i?(l=n(t.value)+r/2,c="central"):(l=n(t.value)-4,c="auto"),{tx:s,ty:l,anchor:a,baseline:c,isInside:i}}function Ete(t,e,n,o,r){const i=r.position??yt.Auto,s=d=>r.swapLabelValue?d.label:String(d.value);let a=t.select(".bc-value-label-group");a.empty()&&(a=t.append("g").attr("class","bc-value-label-group"));const l=t.node().ownerSVGElement,c=l==null?void 0:l.parentElement,u=oc(c);Ou(u,{role:"value-label",parent:a.node(),selector:".bc-value-label",data:e,key:d=>d.label,insert:d=>d.append("text").attr("class","bc-value-label").attr("font-size","11px"),attrs:d=>{const f=Dte(d,n,o,i);return{x:f.tx,y:f.ty,"text-anchor":f.anchor,"dominant-baseline":f.baseline,fill:f.isInside?Cr(r.colorOverrides.get(d.label)??r.colors[0]):"currentColor"}}}),a.selectAll(".bc-value-label").data(e,d=>d.label).text(s)}function Ite(t,e){const n=t.labels.map((o,r)=>({label:o,value:t.values[r]}));return e.sort===Qt.Ascending?n.sort((o,r)=>o.value-r.value):e.sort===Qt.Descending&&n.sort((o,r)=>r.value-o.value),n.map(o=>o.label)}const bc=["#4e79a7"],b6=13,Nte="11px sans-serif",_v=4;class Rte extends lo{initialize(){}}function kv(t){try{const n=document.createElement("canvas").getContext("2d");if(n)return n.font=Nte,Math.ceil(n.measureText(t).width)}catch{}return t.length*6.5}function l$(t,e,n={},o=!1){var ge,re,oe,he,I,G,Y,se,fe,ne,Q;Zr(o);let r=null,i,s;const a=Br.for(t);if(o){const q=Qr(t);s=q==null?void 0:q.margin,a.detach(),q&&q.chartType!=="bar-horizontal"&&(r=Mr(t)),i=new Map;for(const X of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[j,ce]of ur(X))i.set(j,ce);t.replaceChildren()}const{body:l}=Xr(t,n.frame),c=cr(l).width,u=c>0&&c<400&&((ge=n.verticalAxis)==null?void 0:ge.labelPosition)!=="outside",d=n.categoryLabelLine===!0||u,f=Pm(e.labels),h=d?on.Off:(re=n.verticalAxis)==null?void 0:re.labelPosition,g=Pi(c,h,(oe=n.horizontalAxis)==null?void 0:oe.labelPosition,(he=n.verticalAxis)==null?void 0:he.direction,f,(I=n.horizontalAxis)==null?void 0:I.showAxis),v=n.valueLabelPosition??yt.Auto,m=n.swapLabelValue===!0;if(n.valueLabels&&v!==yt.Inside)if(m){const q=e.labels.reduce((j,ce)=>j.length>ce.length?j:ce,""),X=kv(q)+_v;g.right=Math.max(g.right??15,X)}else{const q=Math.max(...e.values),X=Math.min(...e.values),j=q>0?kv(String(q))+_v:0,ce=X<0?kv(String(X))+_v:0;g.right=Math.max(g.right??15,j),ce>0&&(g.left=(g.left??50)+ce)}const{chartArea:b,width:y,height:x,margin:_}=Kr(l,g),k=d?b6:0,E=Li(s,_),L=zte(e,n),S=L.map(q=>({label:q,value:e.values[e.labels.indexOf(q)]})),B=n.waterfall===!0,D=[];if(B){let q=0;for(const X of S){const j=q;q+=X.value,D.push({label:X.label,value:X.value,x0:j,x1:q,isTotal:!1})}n.waterfallTotal&&D.push({label:"Total",value:q,x0:0,x1:q,isTotal:!0})}const N=((G=n.horizontalAxis)==null?void 0:G.scaleType)==="log",C=B?D.flatMap(q=>[q.x0,q.x1]):S.map(q=>q.value),[M,P]=ku(C,(Y=n.horizontalAxis)==null?void 0:Y.range,(se=n.horizontalAxis)==null?void 0:se.scaleType),$=N?ja().domain([M,P]).nice().range([0,y]):Bn().domain([M,P]).nice().range([0,y]),F=B?D.map(q=>q.label):L,V=Zn().domain(F).range([0,x]).padding(tc(n.barGap)),U=m&&n.valueLabels&&!B?(()=>{const q=new Map(S.map(X=>[X.label,X.value]));return{...n.verticalAxis,topPadding:_.top,tickFormat:X=>String(q.get(X)??X)}})():{...n.verticalAxis,topPadding:_.top},K=d?{...U,labelPosition:on.Off,...u?{showAxis:!1}:{}}:U;a.attach(b,E),a.update({horizontal:{scale:$,height:x,options:{...n.horizontalAxis,width:y}},vertical:{scale:V,height:x,options:K},order:"horizontal-first"}),!N&&M<0&&P>0&&Ae(b).append("line").attr("class","bc-zero-baseline").attr("x1",$(0)).attr("x2",$(0)).attr("y1",0).attr("y2",x).attr("stroke","#666").attr("stroke-width",1);const ae=new Map((n.colorizes??[]).map(q=>[q.target,q.color])),me=new Set((n.highlights??[]).map(q=>q.target)),de=b.ownerSVGElement,ve=Di(de,t,"bars",{x:0,y:0,width:y,height:x}),te=Ae(de).select("defs"),pe=ve.replace(/^bc-clip-/,""),we=Ae(b).append("g").attr("clip-path",`url(#${ve})`);if(n.barBackground){const q=(n.colors??bc)[0],X=B?F:S.map(j=>j.label);we.selectAll(".bc-bar-bg").data(X,j=>j).enter().append("rect").attr("class","bc-bar-bg").attr("x",0).attr("y",j=>(V(j)??0)+k).attr("width",y).attr("height",V.bandwidth()-k).attr("fill",q).attr("opacity",.18)}const J=B?F:S.map(q=>q.label);if(n.barSeparators&&J.length>1){const q=V.step();for(let X=1;X<J.length;X++){const j=(V(J[X-1])??0)+V.bandwidth()+(q-V.bandwidth())/2;we.append("line").attr("class","bc-bar-separator").attr("x1",0).attr("x2",y).attr("y1",j).attr("y2",j).attr("stroke","currentColor").attr("opacity",.15)}}if(!B&&n.connectedColumns&&S.length>1){const q=n.colors??bc,X=n.connectionsOpacity??.15;for(let j=0;j<S.length-1;j++){const ce=S[j],ye=S[j+1];if(ce.value==null||ye.value==null||Number.isNaN(ce.value)||Number.isNaN(ye.value)||ce.value===0||ye.value===0)continue;const ue=(V(ce.label)??0)+V.bandwidth(),ke=(V(ye.label)??0)+k,Ie=Math.max($(0),$(ce.value)),Se=Math.max($(0),$(ye.value)),Be=$(0),Ze=ae.get(ce.label)??q[0],ot=ae.get(ye.label)??q[0];let pt;if(Ze===ot)pt=Ze;else{const Tt=`bc-conn-grad-${pe}-${j}`,Jt=te.append("linearGradient").attr("id",Tt).attr("x1","0%").attr("x2","0%").attr("y1","0%").attr("y2","100%");Jt.append("stop").attr("offset","0%").attr("stop-color",Ze),Jt.append("stop").attr("offset","100%").attr("stop-color",ot),pt=`url(#${Tt})`}we.append("polygon").attr("class","bc-bar-connection").attr("points",`${Ie},${ue} ${Se},${ke} ${Be},${ke} ${Be},${ue}`).attr("fill",pt).attr("opacity",X).attr("pointer-events","none")}}if(B){const q=n.colors??bc,X="#333";if(n.connectedColumns&&D.length>1){const j=n.colors??bc,ce=n.connectionsOpacity??.15;for(let ye=0;ye<D.length-1;ye++){const ue=D[ye],ke=D[ye+1];if(ke.isTotal||ue.value==null||ke.value==null||Number.isNaN(ue.value)||Number.isNaN(ke.value)||ue.value===0||ke.value===0)continue;const Ie=(V(ue.label)??0)+V.bandwidth(),Se=(V(ke.label)??0)+k,Be=$(ue.x1),Ze=$(ke.x1),ot=$(ue.x0),pt=$(ke.x0),Tt=ae.get(ue.label)??j[0],Jt=ae.get(ke.label)??j[0];let pn;if(Tt===Jt)pn=Tt;else{const Et=`bc-conn-grad-${pe}-${ye}`,Ft=te.append("linearGradient").attr("id",Et).attr("x1","0%").attr("x2","0%").attr("y1","0%").attr("y2","100%");Ft.append("stop").attr("offset","0%").attr("stop-color",Tt),Ft.append("stop").attr("offset","100%").attr("stop-color",Jt),pn=`url(#${Et})`}we.append("polygon").attr("class","bc-bar-connection").attr("points",`${Be},${Ie} ${Ze},${Se} ${pt},${Se} ${ot},${Ie}`).attr("fill",pn).attr("opacity",ce).attr("pointer-events","none")}}for(let j=0;j<D.length-1;j++){const ce=D[j],ye=D[j+1];if(ye.isTotal)break;we.append("line").attr("class","bc-waterfall-connector").attr("x1",$(ce.x1)).attr("x2",$(ce.x1)).attr("y1",(V(ce.label)??0)+V.bandwidth()).attr("y2",(V(ye.label)??0)+k).attr("stroke","currentColor").attr("stroke-dasharray","2,2").attr("opacity",.3)}if(we.selectAll(".bc-bar").data(D,j=>j.label).enter().append("rect").attr("class","bc-bar").attr("x",j=>Math.min($(j.x0),$(j.x1))).attr("y",j=>(V(j.label)??0)+k).attr("width",j=>Math.abs($(j.x1)-$(j.x0))).attr("height",V.bandwidth()-k).attr("fill",j=>j.isTotal?X:ae.get(j.label)??q[0]).attr("opacity",j=>me.size>0?In(me,j.label):null),n.valueLabels){const j=v,ce=Ia(((fe=n.horizontalAxis)==null?void 0:fe.numberFormat)??""),ye=ke=>ce?ce(ke):String(ke);Ae(b).append("g").selectAll(".bc-value-label").data(D,ke=>ke.label).enter().append("text").attr("class","bc-value-label").attr("font-size","11px").attr("dominant-baseline","central").attr("y",ke=>(V(ke.label)??0)+k+(V.bandwidth()-k)/2).attr("x",ke=>{const Ie=Math.max($(ke.x0),$(ke.x1));return j===yt.Inside?Ie-4:Ie+4}).attr("text-anchor",j===yt.Inside?"end":"start").attr("fill",ke=>j===yt.Inside?Cr(ke.isTotal?X:ae.get(ke.label)??q[0]):"currentColor").text(ke=>m?ke.label:ye(ke.isTotal?ke.x1:ke.value))}}else{const q=oc(t),X=we.append("g").node();Ou(q,{role:"mark-per-category",parent:X,selector:".bc-bar",data:S,key:ce=>ce.label,insert:ce=>ce.append("rect").attr("class","bc-bar"),attrs:ce=>({x:Math.min($(0),$(ce.value)),y:(V(ce.label)??0)+k,width:Math.abs($(ce.value)-$(0)),height:V.bandwidth()-k,fill:ae.get(ce.label)??(n.colors??bc)[0],opacity:In(me,ce.label)})});const j=new Rte(we);if(n.tooltips&&j.use(Ka({numberFormat:(ne=n.horizontalAxis)==null?void 0:ne.numberFormat})),n.crosshair&&j.use(nc({width:y,height:x,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor,orientation:jn.Horizontal})),(Q=n.annotations)!=null&&Q.length&&j.use(Au(n.annotations,{scaleX:V,scaleY:$,data:S,width:y,height:x,backgroundColor:$r(t),orientation:jn.Horizontal,transition:o,priorAnnotations:i})),j.draw(S),n.valueLabels){const ce=Ae(b).append("g");Vte(ce,S,$,V,{position:v,colorOverrides:ae,colors:n.colors??bc,swapLabelValue:m,categoryLabelOffset:k})}}if(d){const q=Ae(b).append("g").attr("class","bc-category-labels");for(const X of F){const j=V(X)??0;q.append("text").attr("class","bc-category-label").attr("x",2).attr("y",j+b6/2).attr("text-anchor","start").attr("dominant-baseline","central").attr("font-size","10px").attr("font-weight","600").attr("fill","currentColor").text(X)}}Jr(t,{chartType:"bar-horizontal",margin:_}),r&&(Tr(we.node()),Or(t,r))}function Fte(t,e,n,o,r=0){const i=o===yt.Inside,s=(n(t.label)??0)+r+(n.bandwidth()-r)/2;let a,l;if(t.value<0){const c=Math.min(e(0),e(t.value));i?(a=c+4,l="start"):(a=c-4,l="end")}else{const c=e(t.value);i?(a=c-4,l="end"):(a=c+4,l="start")}return{tx:a,ty:s,anchor:l,isInside:i}}function Vte(t,e,n,o,r){const i=r.position??yt.Auto,s=r.categoryLabelOffset??0,a=f=>r.swapLabelValue?f.label:String(f.value);let l=t.select(".bc-value-label-group");l.empty()&&(l=t.append("g").attr("class","bc-value-label-group"));const c=t.node().ownerSVGElement,u=c==null?void 0:c.parentElement,d=oc(u);Ou(d,{role:"value-label",parent:l.node(),selector:".bc-value-label",data:e,key:f=>f.label,insert:f=>f.append("text").attr("class","bc-value-label").attr("font-size","11px").attr("dominant-baseline","central"),attrs:f=>{const h=Fte(f,n,o,i,s);return{x:h.tx,y:h.ty,"text-anchor":h.anchor,fill:h.isInside?Cr(r.colorOverrides.get(f.label)??r.colors[0]):"currentColor"}}}),l.selectAll(".bc-value-label").data(e,f=>f.label).text(a)}function zte(t,e){const n=t.labels.map((o,r)=>({label:o,value:t.values[r]}));return e.sort===Qt.Ascending?n.sort((o,r)=>o.value-r.value):e.sort===Qt.Descending&&n.sort((o,r)=>r.value-o.value),n.map(o=>o.label)}function Ja(t,e,n){if(t.length===0)return{width:0,height:0};if(e==="left"||e==="right"){const u=Math.max(...t.map(f=>f.length))*7+16+8,d=t.length*20;return{width:u,height:d}}const r=20,i=t.map(c=>16+c.length*7+12);if(!n||n<=0)return{width:i.reduce((u,d)=>u+d,0),height:r};let s=1,a=0,l=0;for(const c of i)a>0&&a+c>n?(l=Math.max(l,a),s++,a=c):a+=c;return l=Math.max(l,a),{width:l,height:s*r}}function c$(t){return t.length===0?0:Math.max(...t.map(n=>n.length))*7+10}function oa(t,e){return e==null?void 0:e.find(n=>n.name===t)}function an(t,e,n,o){const r=oa(t,o);return(r==null?void 0:r.color)??n[e%n.length]}function Hte(t,e){const n=oa(t,e);return(n==null?void 0:n.dash)??"solid"}function Wte(t,e){const n=oa(t,e);return(n==null?void 0:n.lineWidth)??2}function w2(t,e,n){const o=oa(t,n);return!(o!=null&&o.interpolation)||o.interpolation==="global"?e:o.interpolation}function el(t,e){const n=oa(t,e);return(n==null?void 0:n.hidden)??!1}function $a(t,e,n){const o=oa(t,n);return!(o!=null&&o.labelMode)||o.labelMode==="global"?e:o.labelMode}function Lu(t,e,n){const o=oa(t,n);return(o==null?void 0:o.valueLabels)!==void 0?o.valueLabels:e}function Lf(t,e){const n=oa(t,e);return(n==null?void 0:n.opacity)??1}function Ute(t,e,n){const o=oa(t,n);if((o==null?void 0:o.lineSymbols)!==!1&&((o==null?void 0:o.lineSymbols)===!0||e))return{name:t,symbolShape:(o==null?void 0:o.symbolShape)??(e==null?void 0:e.symbolShape),symbolShowOn:(o==null?void 0:o.symbolShowOn)??(e==null?void 0:e.symbolShowOn),symbolStyle:(o==null?void 0:o.symbolStyle)??(e==null?void 0:e.symbolStyle),symbolSize:(o==null?void 0:o.symbolSize)??(e==null?void 0:e.symbolSize),symbolOpacity:(o==null?void 0:o.symbolOpacity)??(e==null?void 0:e.symbolOpacity),lineSymbols:!0}}const Gte=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"];class qte extends lo{initialize(){}}function Yte(t,e,n={},o=!1){var Ze,ot,pt,Tt,Jt,pn,Et,Ft,dn,Sn,Jn,Pr,tt;Zr(o);let r=null,i,s;const a=Br.for(t);if(o){const $e=Qr(t);s=$e==null?void 0:$e.margin,a.detach(),$e&&$e.chartType!=="bar-multi"&&(r=Mr(t)),i=new Map;for(const Qe of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[Fe,at]of ur(Qe))i.set(Fe,at);t.replaceChildren()}const{body:l}=Xr(t,n.frame),c=e.series??[],u=c.filter($e=>!el($e.name,n.seriesOverrides)),d=u.map($e=>$e.name),f=n.colors??Gte,h=n.seriesOverrides,g=n.directLabelling===!0||n.directLabelling==="auto"&&n.legend!==!0||!!n.directLabelling&&n.directLabelling!=="auto",v=g?"direct":n.legend!==!1?"legend":"none",m=n.legend!==!1&&!g,b=cr(l).width,y=350,x=n.legendPosition??"top",_=b>0&&b<y&&(x==="left"||x==="right")?"top":x,k=n.legendAnchor??"start",E=u.flatMap($e=>$e.values),L=Jl(E,(Ze=n.verticalAxis)==null?void 0:Ze.range,(ot=n.verticalAxis)==null?void 0:ot.numberFormat,(pt=n.verticalAxis)==null?void 0:pt.scaleType),S=Pi(b,(Tt=n.verticalAxis)==null?void 0:Tt.labelPosition,(Jt=n.horizontalAxis)==null?void 0:Jt.labelPosition,(pn=n.verticalAxis)==null?void 0:pn.direction,L),B=Math.max(0,b-(S.left??50)-(S.right??20)),D=o2(e.labels,B,n.horizontalAxis);D!==void 0&&(S.bottom=D);const N=S.top!=null,C=Math.max(0,b-(S.left??50)-(S.right??20)),M=m?Ja(d,_,C):{width:0,height:0},P=m?M.height+15:0,$={...S};if(m&&_==="top"){const $e=N?15:0;$.top=P+$e}m&&_==="bottom"&&($.bottom=($.bottom??24)+P),m&&_==="left"&&($.left=($.left??50)+M.width+10),m&&_==="right"&&($.right=($.right??20)+M.width+10);const{chartArea:F,width:V,height:U,margin:K}=Kr(l,$),ae=Li(s,K);let[me,de]=ku(E,(Et=n.verticalAxis)==null?void 0:Et.range,(Ft=n.verticalAxis)==null?void 0:Ft.scaleType);if(n.valueLabels&&me<0&&((Sn=(dn=n.verticalAxis)==null?void 0:dn.range)==null?void 0:Sn.min)==null){const $e=de-me;me-=$e*.1}let ve=e.labels;if(n.sortMode==="total"){const $e=e.labels.map((Qe,Fe)=>({label:Qe,index:Fe,total:u.reduce((at,ln)=>at+(ln.values[Fe]??0),0)}));$e.sort((Qe,Fe)=>Fe.total-Qe.total),ve=$e.map(Qe=>Qe.label)}const te=Zn().domain(ve).range([0,V]).padding(tc(n.barGap)),pe=Zn().domain(d).range([0,te.bandwidth()]).padding(.05),we=((Jn=n.verticalAxis)==null?void 0:Jn.scaleType)==="log",J=we?ja().domain([me,de]).nice().range([U,0]):Bn().domain([me,de]).nice().range([U,0]);a.attach(F,ae),a.update({vertical:{scale:J,height:U,options:{...n.verticalAxis,gridWidth:V,topPadding:K.top}},horizontal:{scale:te,height:U,options:{...n.horizontalAxis,width:V}}}),!we&&me<0&&de>0&&Ae(F).append("line").attr("class","bc-zero-baseline").attr("x1",0).attr("x2",V).attr("y1",J(0)).attr("y2",J(0)).attr("stroke","#666").attr("stroke-width",1);const ge=new Map;n.sortMode==="within-groups"&&e.labels.forEach(($e,Qe)=>{const Fe=u.map(at=>({name:at.name,value:at.values[Qe]}));Fe.sort((at,ln)=>ln.value-at.value),Fe.forEach((at,ln)=>{ge.set(`${$e}\0${at.name}`,d[ln])})});const re=[];e.labels.forEach(($e,Qe)=>{u.forEach(Fe=>{const at=c.findIndex(Yn=>Yn.name===Fe.name),ln=n.sortMode==="within-groups"?ge.get(`${$e}\0${Fe.name}`)??Fe.name:Fe.name;re.push({label:$e,series:ln,seriesName:Fe.name,value:Fe.values[Qe],seriesIndex:at})})});const oe=n.valueLabels??!1,he=F.ownerSVGElement,I=Di(he,t,"bars",{x:0,y:0,width:V,height:U}),G=Ae(F).append("g").attr("clip-path",`url(#${I})`),Y=oc(t),se=Bu(n.highlights),fe=G.append("g").node();Ou(Y,{role:"mark-per-cell",parent:fe,selector:".bc-bar-multi",data:re,key:$e=>`${$e.label}\0${$e.seriesName}`,insert:$e=>$e.append("rect").attr("class","bc-bar bc-bar-multi"),attrs:$e=>{const Qe=an($e.seriesName,$e.seriesIndex,f,h),Fe=Lf($e.seriesName,h),at={"data-series":$e.seriesName,x:(te($e.label)??0)+(pe($e.series)??0),y:Math.min(J(0),J($e.value)),width:pe.bandwidth(),height:Math.abs(J($e.value)-J(0)),fill:Qe,opacity:In(se,$e.seriesName)};return Fe<1&&(at["fill-opacity"]=Fe),at}});const ne=new qte(G);if(n.tooltips&&ne.use(Ka({numberFormat:(Pr=n.verticalAxis)==null?void 0:Pr.numberFormat})),n.crosshair&&ne.use(nc({width:V,height:U,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor})),(tt=n.annotations)!=null&&tt.length){const $e=e.labels.map((Qe,Fe)=>({label:Qe,value:Math.max(...u.map(at=>at.values[Fe]??0))}));ne.use(Au(n.annotations,{scaleX:te,scaleY:J,data:$e,width:V,height:U,backgroundColor:$r(t),transition:o,priorAnnotations:i}))}ne.draw(re),Jr(t,{chartType:"bar-multi",margin:K}),r&&(Tr(G.node()),Or(t,r));const Q=new Set;u.forEach($e=>{$a($e.name,v,h)==="direct"&&Q.add($e.name)});const q=Q.size>0,X=$r(t),j=typeof n.directLabelling=="string"?n.directLabelling:n.directLabelling?Co.Auto:Co.Off,ce=n.directLabelAnchor??"middle",ye=n.valueLabelPosition??yt.Auto;function ue(){return ye===yt.Inside?yt.Inside:(ye===yt.Outside,yt.Outside)}function ke($e){return j===Co.Inside?yt.Inside:j===Co.Outside?yt.Outside:oe?ue():yt.Outside}function Ie($e,Qe,Fe){return Fe==="start"?$e+12:Fe==="end"?$e+Qe-4:$e+Qe/2}const Se=Ae(F).append("g").attr("class","bc-value-labels");re.forEach($e=>{if(!Lu($e.seriesName,oe,h))return;const Qe=(te($e.label)??0)+(pe($e.series)??0)+pe.bandwidth()/2,Fe=Math.min(J(0),J($e.value)),at=Math.abs(J($e.value)-J(0)),ln=ue(),Yn=q&&Q.has($e.seriesName),Po=$e.value<0,zn=Fe+at;let Zo,Dr,ps;if(ln===yt.Inside){const Ge=an($e.seriesName,$e.seriesIndex,f,h);Dr=Cr(Ge),ps="central",Yn&&ke()===yt.Inside?Zo=Ie(Fe,at,ce)+14:Zo=Fe+at/2}else Dr="currentColor",Po?(Zo=Yn&&ke()===yt.Outside?zn+16:zn+4,ps="hanging"):(Zo=Yn&&ke()===yt.Outside?Fe-16:Fe-4,ps="auto");Se.append("text").attr("class","bc-value-label").attr("data-series",$e.seriesName).attr("x",Qe).attr("y",Zo).attr("text-anchor","middle").attr("dominant-baseline",ps).attr("font-size","11px").attr("fill",Dr).text(String($e.value))}),re.forEach($e=>{var Zo;if(!Q.has($e.seriesName))return;const Qe=(te($e.label)??0)+(pe($e.series)??0)+pe.bandwidth()/2,Fe=Math.min(J(0),J($e.value)),at=Math.abs(J($e.value)-J(0)),ln=((Zo=h==null?void 0:h.find(Dr=>Dr.name===$e.seriesName))==null?void 0:Zo.labelText)||$e.seriesName,Yn=ke(),Po=an($e.seriesName,$e.seriesIndex,f,h),zn=Ae(F).append("text").attr("class","bc-direct-label").attr("data-series",$e.seriesName).attr("x",Qe).attr("text-anchor","middle").attr("font-size","10px").text(ln);if(Yn===yt.Inside){const Dr=Ie(Fe,at,ce);zn.attr("y",Dr).attr("fill",Cr(Po)),ce==="middle"&&zn.attr("dominant-baseline","central")}else zn.attr("y",Fe-4).attr("fill",n$(Po,X))});const Be=d.filter($e=>$a($e,v,h)==="legend");if(m&&Be.length>0){const $e=Be.map(at=>{const ln=c.findIndex(Yn=>Yn.name===at);return an(at,ln,f,h)});let Qe=0,Fe=0;if(_==="top"){const at=N?15:0;Fe=-(M.height+10+at)}else _==="bottom"?Fe=U+25:_==="left"?Qe=-(M.width+10):_==="right"&&(Qe=V+10);Xa(F,Be,$e,Fe,_,k,V,U,Qe,[],{left:K.left,right:K.right})}}const jte={linear:wu,monotoneX:t2,step:sZ,stepBefore:aZ,stepAfter:lZ,basis:nZ,cardinal:oZ,catmullRom:iZ};function Vl(t){return t&&jte[t]||wu}function u$(t){const e=(t==null?void 0:t.position)??yt.Auto,n=(t==null?void 0:t.orientation)??jn.Vertical,o=t!=null&&t.format?yu(t.format):r=>String(r);return{name:"value-labels",install(){},postDraw(r){const i=r.base;i.selectAll(".bc-bar").each(function(s){const a=Ae(this),l=parseFloat(a.attr("x")),c=parseFloat(a.attr("y")),u=parseFloat(a.attr("width")),d=parseFloat(a.attr("height")),f=s.value<0;let h,g,v,m,b;if(n===jn.Horizontal)if(b=e===yt.Inside,g=c+d/2,m="central",f)b?(h=l+4,v="start"):(h=l-4,v="end");else{const k=l+u;b?(h=k-4,v="end"):(h=k+4,v="start")}else b=e===yt.Inside,h=l+u/2,v="middle",f?b?(g=c+d/2,m="central"):(g=c+d+4,m="hanging"):b?(g=c+d/2,m="central"):(g=c-4,m="auto");const y=a.attr("fill")||"#ccc",x=b?Cr(y):"currentColor";Ae(this.parentNode).append("text").attr("class","bc-value-label").attr("x",h).attr("y",g).attr("text-anchor",v).attr("dominant-baseline",m).attr("font-size","11px").attr("fill",x).text(o(s.value))}),i.selectAll(".bc-dot").each(function(s){const a=Ae(this),l=parseFloat(a.attr("cx")),c=parseFloat(a.attr("cy"));Ae(this.parentNode).append("text").attr("class","bc-value-label").attr("x",l).attr("y",c-8).attr("text-anchor","middle").attr("font-size","11px").attr("fill","currentColor").text(o(s.value))})}}}const d$="bc-tooltip",Ac=new WeakMap;function Gm(t){const e=Ac.get(t);e&&(Ac.delete(t),e())}function Xte(){if(document.getElementById("bc-tooltip-styles"))return;const t=document.createElement("style");t.id="bc-tooltip-styles",t.textContent=`
|
|
66
|
+
.${d$} {
|
|
67
|
+
position: absolute;
|
|
68
|
+
pointer-events: none;
|
|
69
|
+
background: var(--bs-body-bg, #fff);
|
|
70
|
+
color: var(--bs-body-color, #212529);
|
|
71
|
+
border: 1px solid var(--bs-border-color, #dee2e6);
|
|
72
|
+
border-radius: 4px;
|
|
73
|
+
padding: 6px 10px;
|
|
74
|
+
font-size: 13px;
|
|
75
|
+
box-shadow: 0 2px 8px rgba(0,0,0,0.12);
|
|
76
|
+
z-index: 9999;
|
|
77
|
+
display: none;
|
|
78
|
+
}
|
|
79
|
+
`,document.head.appendChild(t)}function Kte(t){const e=t?Ia(t):null,n=o=>e?e(o):String(o);return o=>o.series?`${o.series} – ${o.label}: ${n(o.value)}`:`${o.label}: ${n(o.value)}`}function qm(t,e){const{width:n,height:o,points:r,tooltip:i=!0,crosshair:s=!1,crosshairDirection:a=Ao.Both,crosshairStyle:l=ci.Dashed,crosshairColor:c="#999",format:u=Kte(e.numberFormat),container:d}=e;if(r.length===0){const P=()=>{};return d&&Ac.set(d,P),P}const f=l===ci.Solid?"none":l===ci.Dotted?"2,2":"4,3",h=[...new Set(r.map(P=>P.cx))].sort((P,$)=>P-$),g=Ae(t);let v=null;i&&(Xte(),v=document.createElement("div"),v.className=d$,document.body.appendChild(v));const m=".bc-annotations",b=!g.select(m).empty(),y=P=>b?g.insert(P,m):g.append(P),x=s&&(a===Ao.Both||a===Ao.Vertical),_=s&&(a===Ao.Both||a===Ao.Horizontal);let k=null,E=null;x&&(k=y("line").attr("class","bc-crosshair bc-crosshair-v").attr("y1",0).attr("y2",o).attr("stroke",c).attr("stroke-width",1).style("stroke-dasharray",f).attr("pointer-events","none").style("display","none")),_&&(E=y("line").attr("class","bc-crosshair bc-crosshair-h").attr("x1",0).attr("x2",n).attr("stroke",c).attr("stroke-width",1).style("stroke-dasharray",f).attr("pointer-events","none").style("display","none"));const L=y("circle").attr("class","bc-proximity-dot").attr("r",6).attr("fill","none").attr("stroke","#333").attr("stroke-width",1).attr("opacity",.45).attr("pointer-events","none").style("display","none"),S=y("rect").attr("class","bc-proximity-overlay").attr("width",n).attr("height",o).attr("fill","none").attr("pointer-events","all");function B(P,$){if(h.length===0)return null;const F=sz(h,P),V=h[F],U=r.filter(me=>me.cx===V);if(U.length===0)return null;let K=U[0],ae=Math.abs(U[0].cy-$);for(let me=1;me<U.length;me++){const de=Math.abs(U[me].cy-$);de<ae&&(K=U[me],ae=de)}return K}const D=P=>{const[$,F]=Rj(P,t),V=B($,F);V&&(L.attr("cx",V.cx).attr("cy",V.cy).attr("stroke",V.color).style("display",null),v&&(v.textContent=u(V),v.style.display="block",g5(L.node(),v,{placement:"top",middleware:[h5(8),m5(),p5()]}).then(({x:U,y:K})=>{v&&(v.style.left=`${U}px`,v.style.top=`${K}px`)})),k&&k.attr("x1",V.cx).attr("x2",V.cx).style("display",null),E&&E.attr("y1",V.cy).attr("y2",V.cy).style("display",null))},N=()=>{L.style("display","none"),v&&(v.style.display="none"),k&&k.style("display","none"),E&&E.style("display","none")},C=S.node();C.addEventListener("mousemove",D),C.addEventListener("mouseleave",N);const M=()=>{C.removeEventListener("mousemove",D),C.removeEventListener("mouseleave",N),S.remove(),L.remove(),v&&(v.remove(),v=null),k&&k.remove(),E&&E.remove(),d&&Ac.get(d)===M&&Ac.delete(d)};return d&&Ac.set(d,M),M}const Zte=eZ??FC,Qte={circle:Jy,square:jK,diamond:YK,triangle:FC,triangleDown:Zte,cross:GK,star:QK};function Jte(t,e,n){switch(n){case vr.First:return t===0;case vr.Last:return t===e-1;case vr.FirstLast:return t===0||t===e-1;case vr.All:default:return!0}}function _2(t,e,n,o,r=!1){const i=o.symbol??mr.Circle,s=o.showOn??vr.FirstLast,a=o.style??Ro.Filled,l=o.size??3.5,c=o.opacity??1,u="var(--bs-body-bg, #fff)",d=e.filter(h=>Jte(h.index,n,s)),f=r?_t():0;if(i===mr.Circle){t.selectAll("path.bc-symbol").remove();const h=t.selectAll("circle.bc-symbol").data(d).join(v=>v.append("circle").attr("class","bc-symbol").attr("cx",m=>m.cx).attr("cy",m=>m.cy).attr("r",l).attr("fill",m=>a===Ro.Filled?m.color:u).attr("stroke",m=>m.color).attr("stroke-width",a===Ro.Hollow?1.5:0).attr("opacity",c),v=>v,v=>v.remove());(r?h.transition().duration(f):h).attr("cx",v=>v.cx).attr("cy",v=>v.cy).attr("r",l).attr("fill",v=>a===Ro.Filled?v.color:u).attr("stroke",v=>v.color).attr("stroke-width",a===Ro.Hollow?1.5:0).attr("opacity",c)}else{const h=Qte[i]??Jy,g=Math.PI*l*l,v=tZ().type(h).size(g);t.selectAll("circle.bc-symbol").remove();const m=t.selectAll("path.bc-symbol").data(d).join(y=>y.append("path").attr("class","bc-symbol").attr("transform",x=>`translate(${x.cx},${x.cy})`).attr("d",v).attr("fill",x=>a===Ro.Filled?x.color:u).attr("stroke",x=>x.color).attr("stroke-width",a===Ro.Hollow?1.5:0).attr("opacity",c),y=>y,y=>y.remove());(r?m.transition().duration(f):m).attr("transform",y=>`translate(${y.cx},${y.cy})`).attr("d",v).attr("fill",y=>a===Ro.Filled?y.color:u).attr("stroke",y=>y.color).attr("stroke-width",a===Ro.Hollow?1.5:0).attr("opacity",c)}}const f$="#4e79a7";class ene extends lo{initialize(){this.configDefine("xPos",{defaultValue:(r,i)=>0}),this.configDefine("y",{defaultValue:Bn()}),this.configDefine("color",{defaultValue:f$}),this.configDefine("curve",{defaultValue:wu}),this.configDefine("areaFill",{defaultValue:!1}),this.configDefine("areaFillOpacity",{defaultValue:.2}),this.configDefine("height",{defaultValue:0});const e=this.base.append("g"),n=this.base.append("g"),o=this.base.append("g");this.layer("area",e,{dataBind:(r,i)=>r.selectAll(".bc-area").data(this.config("areaFill")?[i]:[]),insert:r=>r.append("path").attr("class","bc-area"),events:{enter:r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("color"),l=this.config("curve"),c=this.config("height"),u=this.config("areaFillOpacity"),d=js().curve(l).x((f,h)=>i(f,h)).y0(c).y1(f=>s(f.value));r.attr("fill",a).attr("opacity",u).attr("d",d)},"merge:transition":r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("color"),l=this.config("curve"),c=this.config("height"),u=this.config("areaFillOpacity"),d=js().curve(l).x((f,h)=>i(f,h)).y0(c).y1(f=>s(f.value));r.duration(_t()).attr("fill",a).attr("opacity",u).attr("d",d)},"exit:transition":r=>{r.duration(_t()).attr("opacity",0).remove()}}}),this.layer("line",n,{dataBind:(r,i)=>r.selectAll(".bc-line").data([i]),insert:r=>r.append("path").attr("class","bc-line"),events:{enter:r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("color"),l=this.config("curve"),c=Ci().curve(l).x((u,d)=>i(u,d)).y(u=>s(u.value));r.attr("fill","none").attr("stroke",a).attr("d",c)},"merge:transition":r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("color"),l=this.config("curve"),c=Ci().curve(l).x((u,d)=>i(u,d)).y(u=>s(u.value));r.duration(_t()).attr("fill","none").attr("stroke",a).attr("d",c)},"exit:transition":r=>{r.duration(_t()).attr("opacity",0).remove()}}}),this.layer("dots",o,{dataBind:(r,i)=>r.selectAll(".bc-dot").data(i,s=>s.label),insert:r=>r.append("circle").attr("class","bc-dot"),events:{enter:r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("color");r.attr("cx",(l,c)=>i(l,c)).attr("cy",l=>s(l.value)).attr("r",3).attr("fill",a)},"merge:transition":r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("color");r.duration(_t()).attr("cx",(l,c)=>i(l,c)).attr("cy",l=>s(l.value)).attr("r",3).attr("fill",a)},"exit:transition":r=>{r.duration(_t()).attr("opacity",0).remove()}}})}}function tne(t,e,n={},o=!1){var we,J,ge,re,oe,he,I,G,Y,se,fe,ne,Q;Zr(o),Gm(t);let r=[],i=[],s=[],a=null,l=null,c,u;const d=Br.for(t);if(o){const q=Qr(t);u=q==null?void 0:q.margin,d.detach(),(q==null?void 0:q.chartType)==="line"?(r=Array.from(t.querySelectorAll(".bc-frame .bc-area")),i=Array.from(t.querySelectorAll(".bc-frame .bc-line")),s=Array.from(t.querySelectorAll(".bc-frame .bc-dot")),a=t.querySelector(".bc-frame .bc-symbols")):q&&(l=Mr(t)),c=new Map;for(const X of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[j,ce]of ur(X))c.set(j,ce);t.replaceChildren()}const{body:f}=Xr(t,n.frame),h=cr(f).width,g=Jl(e.values,(we=n.verticalAxis)==null?void 0:we.range,(J=n.verticalAxis)==null?void 0:J.numberFormat,(ge=n.verticalAxis)==null?void 0:ge.scaleType),v=Pi(h,(re=n.verticalAxis)==null?void 0:re.labelPosition,(oe=n.horizontalAxis)==null?void 0:oe.labelPosition,(he=n.verticalAxis)==null?void 0:he.direction,g),{chartArea:m,width:b,height:y,margin:x}=Kr(f,v),_=Li(u,x),k=Em(e.labels,(I=n.horizontalAxis)==null?void 0:I.range),E=k.map(q=>e.labels[q]),L=k.map(q=>e.values[q]),S=E.map((q,X)=>({label:q,value:L[X]})),B=Mm().domain(E).range([0,b]).padding(n.edgePadding?.6:0),D=B,N=q=>B(q.label)??0,C=((G=n.verticalAxis)==null?void 0:G.scaleType)==="log",[M,P]=ku(L,(Y=n.verticalAxis)==null?void 0:Y.range,(se=n.verticalAxis)==null?void 0:se.scaleType),$=C?ja().domain([M,P]).nice().range([y,0]):Bn().domain([M,P]).nice().range([y,0]),F=$.domain(),V=F[0]<0&&F[1]>0?$(0):void 0;d.attach(m,_),d.update({vertical:{scale:$,height:y,options:{...n.verticalAxis,gridWidth:b,topPadding:x.top}},horizontal:{scale:D,height:y,options:{...n.horizontalAxis,width:b,zeroY:V}}});const U=m.ownerSVGElement,K=Di(U,t,"plot",{x:-1,y:-1,width:b+2,height:y+2}),ae=Ae(m).append("g").attr("clip-path",`url(#${K})`),me=ae.node(),de=((fe=n.colors)==null?void 0:fe[0])??f$,ve=Vl(n.interpolation),te=n.lineSymbols,pe=new ene(Ae(me));if(pe.config({xPos:N,y:$,color:de,curve:ve,areaFill:n.areaFill??!1,areaFillOpacity:n.areaFillOpacity??.2,height:y}),i.length>0||r.length>0||s.length>0){const q=(_==null?void 0:_.dx)??0,X=(_==null?void 0:_.dy)??0,j=me.querySelectorAll(":scope > g");j[0]&&Wo(j[0],r,q,X),j[1]&&Wo(j[1],i,q,X),j[2]&&Wo(j[2],s,q,X)}if(n.valueLabels&&pe.use(u$({position:n.valueLabelPosition,orientation:jn.Vertical})),pe.draw(S),(ne=n.annotations)!=null&&ne.length&&Hm(m,n.annotations,{scaleX:D,scaleY:$,data:S,width:b,height:y,backgroundColor:$r(t),transition:o,priorAnnotations:c}),Ae(me).selectAll(".bc-dot").attr("fill-opacity",0).attr("stroke-opacity",0).attr("pointer-events","none"),n.tooltips||n.crosshair){const q=S.map(X=>({cx:N(X),cy:$(X.value),label:X.label,value:X.value,color:de}));qm(m,{width:b,height:y,points:q,tooltip:n.tooltips,crosshair:n.crosshair,crosshairDirection:n.crosshairDirection,crosshairStyle:n.crosshairStyle,crosshairColor:n.crosshairColor,numberFormat:(Q=n.verticalAxis)==null?void 0:Q.numberFormat,container:t})}if(te){const q=S.map((j,ce)=>({cx:N(j),cy:$(j.value),color:de,index:ce}));let X;a?(m.appendChild(a),X=Ae(a)):X=Ae(m).append("g").attr("class","bc-symbols"),_2(X,q,S.length,te,o)}Jr(t,{chartType:"line",margin:x}),l&&(Tr(ae.node()),Or(t,l))}const k2=28,h$=18,p$=20;function S2(t,e,n,o=k2){if(t.length===0)return[];if(t.length===1)return[Math.max(e,Math.min(n,t[0]))];const r=t.length,i=n-e,a=(r-1)*o>i?Math.max(0,i/(r-1)):o,l=[...t];for(let c=0;c<10;c++){for(let u=1;u<l.length;u++)l[u]-l[u-1]<a&&(l[u]=l[u-1]+a);l[l.length-1]>n&&(l[l.length-1]=n);for(let u=l.length-2;u>=0;u--)l[u+1]-l[u]<a&&(l[u]=l[u+1]-a);l[0]<e&&(l[0]=e)}return l}function m$(t,e,n){const{outerRadius:o,fontSize:r=12,bgColor:i="#fff"}=n,s=o+2,a=s+h$,l=k2/a,c=[],u=[];for(const f of e){const h=(f.startAngle+f.endAngle)/2;h<Math.PI?u.push({...f,midAngle:h}):c.push({...f,midAngle:h})}function d(f,h){if(f.length===0)return;f.sort((_,k)=>_.midAngle-k.midAngle);const g=h?.05:Math.PI+.05,v=h?Math.PI-.05:2*Math.PI-.05,m=f.map(_=>_.midAngle),b=S2(m,g,v,l),y=h?1:-1,x=t.append("g").attr("class","bc-arc-labels");f.forEach((_,k)=>{const E=_.showLabel!==!1,L=_.showValue!==!1;if(!E&&!L)return;const B=b[k]-Math.PI/2,D=Math.cos(B)*s,N=Math.sin(B)*s,C=Math.cos(B)*a,M=Math.sin(B)*a,P=C+y*p$;x.append("polyline").attr("class","bc-arc-label-line").attr("points",`${D},${N} ${C},${M} ${P},${M}`).attr("fill","none").attr("stroke","var(--bc-text-color, #999)").attr("stroke-width",1).attr("opacity",.5);const $=P+y*4,F=x.append("text").attr("class","bc-arc-direct-label").attr("x",$).attr("y",M).attr("text-anchor",h?"start":"end").attr("font-size",`${r}px`);if(E&&F.append("tspan").attr("x",$).attr("dy",L?"-0.1em":"0.35em").attr("font-weight","bold").attr("fill",n$(_.color,i)).text(_.label),L){const V=_.displayAsPercentage&&_.percentage!=null?`${Math.round(_.percentage)}%`:String(_.value);F.append("tspan").attr("x",$).attr("dy",E?"1.2em":"0.35em").attr("fill","var(--bc-text-color, #666)").text(V)}})}d(u,!0),d(c,!1)}const g$=.3;function v$(t,e,n){const{outerRadius:o,innerRadius:r=0,fontSize:i=12}=n,s=(r+o)/2,a=t.append("g").attr("class","bc-arc-labels-inside");for(const l of e){if(l.endAngle-l.startAngle<g$)continue;const u=l.showLabel!==!1,d=l.showValue!==!1;if(!u&&!d)continue;const f=(l.startAngle+l.endAngle)/2-Math.PI/2,h=Math.cos(f)*s,g=Math.sin(f)*s,v=a.append("text").attr("class","bc-arc-inside-label").attr("x",h).attr("y",g).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",`${i}px`),m=Cr(l.color);if(u&&v.append("tspan").attr("x",h).attr("dy",d?"-0.5em":"0em").attr("font-weight","bold").attr("fill",m).text(l.label),d){const b=l.displayAsPercentage&&l.percentage!=null?`${Math.round(l.percentage)}%`:String(l.value);v.append("tspan").attr("x",h).attr("dy",u?"1.2em":"0em").attr("fill",m).attr("opacity",.85).text(b)}}}function nne(t,e,n){const{outerRadius:o,innerRadius:r=0,fontSize:i=12,bgColor:s}=n,a=(r+o)/2,l=[],c=[];for(const u of e){const d=u.endAngle-u.startAngle,f=d*a,h=u.label.length*7;f>h*1.2&&d>=g$?l.push(u):c.push(u)}l.length>0&&v$(t,l,{outerRadius:o,innerRadius:r,fontSize:i}),c.length>0&&m$(t,c,{outerRadius:o,fontSize:i,bgColor:s})}function one(t,e){if(t.length===0)return{left:0,right:0,top:0,bottom:0};const n=Math.max(...t.map(a=>a.length)),o=h$+p$+6+4+n*7+6,i=t.length*k2/2,s=Math.max(10,i-e+20);return{left:o,right:o,top:s,bottom:s}}const b$=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"];class rne extends lo{initialize(){this.configDefine("xPos",{defaultValue:r=>0}),this.configDefine("y",{defaultValue:Bn()}),this.configDefine("colors",{defaultValue:b$}),this.configDefine("labels",{defaultValue:[]}),this.configDefine("curve",{defaultValue:wu}),this.configDefine("areaFill",{defaultValue:!1}),this.configDefine("areaFillOpacity",{defaultValue:.2}),this.configDefine("height",{defaultValue:0}),this.configDefine("dots",{defaultValue:[]}),this.configDefine("highlightTargets",{defaultValue:new Set});const e=this.base.append("g"),n=this.base.append("g"),o=this.base.append("g");this.layer("areas",e,{dataBind:(r,i)=>r.selectAll(".bc-area").data(this.config("areaFill")?i:[],s=>s.name),insert:r=>r.append("path").attr("class","bc-area"),events:{enter:r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("colors"),l=this.config("curve"),c=this.config("height"),u=this.config("areaFillOpacity");r.attr("data-series",d=>d.colorIndex).attr("fill",d=>a[d.colorIndex%a.length]).attr("opacity",u).attr("d",d=>js().curve(l).x((h,g)=>i(g)).y0(c).y1(h=>s(h))(d.values))},"merge:transition":r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("colors"),l=this.config("curve"),c=this.config("height"),u=this.config("areaFillOpacity");r.duration(_t()).attr("data-series",d=>d.colorIndex).attr("fill",d=>a[d.colorIndex%a.length]).attr("opacity",u).attr("d",d=>js().curve(l).x((h,g)=>i(g)).y0(c).y1(h=>s(h))(d.values))},"exit:transition":r=>{r.duration(_t()).attr("opacity",0).remove()}}}),this.layer("lines",n,{dataBind:(r,i)=>r.selectAll(".bc-line").data(i,s=>s.name),insert:r=>r.append("path").attr("class","bc-line"),events:{enter:r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("colors"),l=this.config("highlightTargets"),c=l.size>0;r.attr("data-series",u=>u.colorIndex).attr("fill","none").attr("stroke",u=>a[u.colorIndex%a.length]).attr("stroke-width",2).attr("opacity",u=>c?In(l,u.name,1):null).attr("d",u=>{const d=this.config("curve");return Ci().curve(d).x((h,g)=>i(g)).y(h=>s(h))(u.values)})},"merge:transition":r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("colors"),l=this.config("highlightTargets"),c=l.size>0;r.duration(_t()).attr("data-series",u=>u.colorIndex).attr("fill","none").attr("stroke",u=>a[u.colorIndex%a.length]).attr("stroke-width",2).attr("opacity",u=>c?In(l,u.name,1):null).attr("d",u=>{const d=this.config("curve");return Ci().curve(d).x((h,g)=>i(g)).y(h=>s(h))(u.values)})},"exit:transition":r=>{r.duration(_t()).attr("opacity",0).remove()}}}),this.layer("dots",o,{dataBind:r=>r.selectAll(".bc-dot").data(this.config("dots"),i=>i.label+"\0"+i.series),insert:r=>r.append("circle").attr("class","bc-dot"),events:{enter:r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("colors"),l=this.config("labels");r.attr("data-series",c=>c.colorIndex).attr("cx",c=>i(l.indexOf(c.label))).attr("cy",c=>s(c.value)).attr("r",3).attr("fill",c=>a[c.colorIndex%a.length])},"merge:transition":r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("colors"),l=this.config("labels");r.duration(_t()).attr("data-series",c=>c.colorIndex).attr("cx",c=>i(l.indexOf(c.label))).attr("cy",c=>s(c.value)).attr("r",3).attr("fill",c=>a[c.colorIndex%a.length])},"exit:transition":r=>{r.duration(_t()).attr("opacity",0).remove()}}})}}function ine(t,e,n={},o=!1){var Pr,tt,$e,Qe,Fe,at,ln,Yn,Po,zn,Zo,Dr,ps;Zr(o),Gm(t);let r=e,i=[],s=[],a=[],l=[],c=null,u,d;const f=Br.for(t);if(o){const Ge=Qr(t);d=Ge==null?void 0:Ge.margin,f.detach(),(Ge==null?void 0:Ge.chartType)==="line-multi"?(i=Array.from(t.querySelectorAll(".bc-frame .bc-area")),s=Array.from(t.querySelectorAll(".bc-frame .bc-line")),a=Array.from(t.querySelectorAll(".bc-frame .bc-dot")),l=Array.from(t.querySelectorAll(".bc-frame .bc-symbols"))):Ge&&(c=Mr(t)),u=new Map;for(const lt of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[Ot,It]of ur(lt))u.set(Ot,It);t.replaceChildren()}const{body:h}=Xr(t,n.frame),g=r.series??[];let v=g.filter(Ge=>!el(Ge.name,n.seriesOverrides));(n.sortMode==="total"||n.sortMode==="within-groups")&&(v=[...v].sort((Ge,lt)=>{const Ot=Ge.values.reduce((Ln,eo)=>Ln+eo,0);return lt.values.reduce((Ln,eo)=>Ln+eo,0)-Ot}));const m=n.colors??b$,b=v.map(Ge=>Ge.name),y=n.seriesOverrides,x=n.directLabelling===!0||n.directLabelling==="auto"&&n.legend!==!0||!!n.directLabelling&&n.directLabelling!=="auto",_=x?"direct":n.legend!==!1?"legend":"none",k=b.filter(Ge=>$a(Ge,_,y)==="direct"),E=n.legend!==!1&&!x,L=cr(h).width,S=350,B=n.legendPosition??"top",D=L>0&&L<S&&(B==="left"||B==="right")?"top":B,N=n.legendAnchor??"start",C=Em(r.labels,(Pr=n.horizontalAxis)==null?void 0:Pr.range),M=C.map(Ge=>r.labels[Ge]);v=v.map(Ge=>({...Ge,values:C.map(lt=>Ge.values[lt])})),r={...r,labels:M,series:v};const P=v.flatMap(Ge=>Ge.values),$=Jl(P,(tt=n.verticalAxis)==null?void 0:tt.range,($e=n.verticalAxis)==null?void 0:$e.numberFormat,(Qe=n.verticalAxis)==null?void 0:Qe.scaleType),F=Pi(L,(Fe=n.verticalAxis)==null?void 0:Fe.labelPosition,(at=n.horizontalAxis)==null?void 0:at.labelPosition,(ln=n.verticalAxis)==null?void 0:ln.direction,$),V=k.length>0?c$(k):0,U=F.top!=null,K=Math.max(0,L-(F.left??50)-(F.right??20)-V),ae=E?Ja(b,D,K):{width:0,height:0},me=E?ae.height+15:0,de={...F};if(E&&D==="top"){const Ge=U?15:0;de.top=me+Ge}E&&D==="bottom"&&(de.bottom=(de.bottom??24)+me),E&&D==="left"&&(de.left=(de.left??50)+ae.width+10),E&&D==="right"&&(de.right=(de.right??20)+ae.width+10),V>0&&(de.right=(de.right??20)+V);const{chartArea:ve,width:te,height:pe,margin:we}=Kr(h,de),J=Li(d,we),[ge,re]=ku(P,(Yn=n.verticalAxis)==null?void 0:Yn.range,(Po=n.verticalAxis)==null?void 0:Po.scaleType),oe=Mm().domain(r.labels).range([0,te]).padding(n.edgePadding?.6:0),he=oe,I=Ge=>oe(r.labels[Ge])??0,Y=((zn=n.verticalAxis)==null?void 0:zn.scaleType)==="log"?ja().domain([ge,re]).nice().range([pe,0]):Bn().domain([ge,re]).nice().range([pe,0]),se=Y.domain(),fe=se[0]<0&&se[1]>0?Y(0):void 0;f.attach(ve,J),f.update({vertical:{scale:Y,height:pe,options:{...n.verticalAxis,gridWidth:te,topPadding:we.top}},horizontal:{scale:he,height:pe,options:{...n.horizontalAxis,width:te,zeroY:fe}}});const ne=ve.ownerSVGElement,Q=Di(ne,t,"plot",{x:0,y:0,width:te,height:pe}),q=Ae(ve).append("g").attr("clip-path",`url(#${Q})`),X=q.node(),j=v.map(Ge=>({name:Ge.name,values:Ge.values,colorIndex:g.findIndex(lt=>lt.name===Ge.name)})),ce=Vl(n.interpolation);(Zo=n.areaFills)!=null&&Zo.length&&sne(X,n.areaFills,v,I,r.labels.length,Y,ce);const ye=[];v.forEach((Ge,lt)=>{r.labels.forEach((Ot,It)=>{ye.push({label:Ot,value:Ge.values[It],series:Ge.name,colorIndex:lt})})});const ue=n.lineSymbols,ke={solid:"",dotted:"2,4",dashed:"8,4","dash-dot":"8,4,2,4"},Ie=n.valueLabels??!1,Se=new Set((n.highlights??[]).map(Ge=>Ge.target)),Be=new rne(Ae(X));Be.config({xPos:I,y:Y,colors:m,labels:r.labels,curve:ce,areaFill:n.areaFill??!1,areaFillOpacity:n.areaFillOpacity??.2,height:pe,dots:ye,highlightTargets:Se});const Ze=new Set(j.map(Ge=>Ge.name)),ot=i.filter(Ge=>{var lt;return Ze.has(((lt=Ge.__data__)==null?void 0:lt.name)??"")}),pt=s.filter(Ge=>{var lt;return Ze.has(((lt=Ge.__data__)==null?void 0:lt.name)??"")}),Tt=a.filter(Ge=>{var lt;return Ze.has(((lt=Ge.__data__)==null?void 0:lt.series)??"")});if(pt.length>0||ot.length>0||Tt.length>0){const Ge=(J==null?void 0:J.dx)??0,lt=(J==null?void 0:J.dy)??0,Ot=X.querySelectorAll(":scope > g");Ot[0]&&Wo(Ot[0],ot,Ge,lt),Ot[1]&&Wo(Ot[1],pt,Ge,lt),Ot[2]&&Wo(Ot[2],Tt,Ge,lt)}if(Be.draw(j),(Dr=n.annotations)!=null&&Dr.length){const Ge=r.labels.map((lt,Ot)=>{var It;return{label:lt,value:((It=v[0])==null?void 0:It.values[Ot])??0}});Hm(ve,n.annotations,{scaleX:he,scaleY:Y,data:Ge,width:te,height:pe,backgroundColor:$r(t),transition:o,priorAnnotations:u})}const Jt=Ae(X).append("g").attr("class","bc-value-labels");if(ye.forEach(Ge=>{if(!Lu(Ge.series,Ie,y))return;const lt=I(r.labels.indexOf(Ge.label)),Ot=Y(Ge.value);Jt.append("text").attr("class","bc-value-label").attr("data-series",Ge.colorIndex).attr("x",lt).attr("y",Ot-8).attr("text-anchor","middle").attr("font-size","11px").attr("fill","currentColor").text(String(Ge.value))}),Ae(X).selectAll(".bc-line").each(function(Ge){const lt=Ge,Ot=an(lt.name,lt.colorIndex,m,y),It=Wte(lt.name,y),Ln=Hte(lt.name,y),eo=w2(lt.name,n.interpolation??"linear",y),Er=o?Ae(this).transition().duration(_t()):Ae(this);if(Er.attr("stroke",Ot).attr("stroke-width",It),Er.attr("opacity",In(Se,lt.name,1)),Ln!=="solid"&&Ae(this).attr("stroke-dasharray",ke[Ln]??""),eo!==(n.interpolation??"linear")){const sc=Vl(eo),aa=Ci().curve(sc).x((la,ac)=>I(ac)).y(la=>Y(la));Er.attr("d",aa(lt.values))}}),Ae(X).selectAll(".bc-area").each(function(Ge){const lt=Ge,Ot=an(lt.name,lt.colorIndex,m,y),It=o?Ae(this).transition().duration(_t()):Ae(this);It.attr("fill",Ot),It.attr("opacity",In(Se,lt.name,n.areaFillOpacity??.2))}),Ae(X).selectAll(".bc-dot").attr("fill-opacity",0).attr("stroke-opacity",0).attr("pointer-events","none"),n.tooltips||n.crosshair){const Ge=ye.map(lt=>({cx:I(r.labels.indexOf(lt.label)),cy:Y(lt.value),label:lt.label,value:lt.value,series:lt.series,color:an(lt.series,lt.colorIndex,m,y)}));qm(ve,{width:te,height:pe,points:Ge,tooltip:n.tooltips,crosshair:n.crosshair,crosshairDirection:n.crosshairDirection,crosshairStyle:n.crosshairStyle,crosshairColor:n.crosshairColor,numberFormat:(ps=n.verticalAxis)==null?void 0:ps.numberFormat,container:t})}const pn=ue?{symbolShape:ue.symbol,symbolShowOn:ue.showOn,symbolStyle:ue.style,symbolSize:ue.size,symbolOpacity:ue.opacity}:void 0,Et=r.labels.length;v.forEach((Ge,lt)=>{const Ot=Ute(Ge.name,pn,y);if(!Ot)return;const It={symbol:Ot.symbolShape??(ue==null?void 0:ue.symbol)??mr.Circle,showOn:Ot.symbolShowOn??(ue==null?void 0:ue.showOn)??vr.FirstLast,style:Ot.symbolStyle??(ue==null?void 0:ue.style)??Ro.Filled,size:Ot.symbolSize??(ue==null?void 0:ue.size)??3.5,opacity:Ot.symbolOpacity??(ue==null?void 0:ue.opacity)??1},Ln=r.labels.map((aa,la)=>({cx:I(la),cy:Y(Ge.values[la]),color:an(Ge.name,lt,m,y),index:la})),eo=l.find(aa=>aa.getAttribute("data-series-name")===Ge.name);let Er,sc=!1;eo?(ve.appendChild(eo),Er=Ae(eo),sc=!0):Er=Ae(ve).append("g").attr("class","bc-symbols").attr("data-series",lt).attr("data-series-name",Ge.name),_2(Er,Ln,Et,It,o&&sc)});const Ft=r.labels.length-1,dn=I(Ft)+6,Sn=[];if(v.forEach((Ge,lt)=>{var eo;if($a(Ge.name,_,y)!=="direct")return;const It=Ge.values[Ft],Ln=((eo=y==null?void 0:y.find(Er=>Er.name===Ge.name))==null?void 0:eo.labelText)||Ge.name;Sn.push({name:Ge.name,index:lt,naturalY:Y(It),text:Ln})}),Sn.length>0){Sn.sort((It,Ln)=>It.naturalY-Ln.naturalY);const Ge=Sn.map(It=>It.naturalY),Ot=S2(Ge,0,pe,14);Sn.forEach((It,Ln)=>{Ae(ve).append("text").attr("class","bc-direct-label").attr("data-series",It.index).attr("x",dn).attr("y",Ot[Ln]).attr("dy","0.35em").attr("font-size","11px").attr("fill",an(It.name,It.index,m,y)).text(It.text)})}const Jn=b.filter(Ge=>$a(Ge,_,y)==="legend");if(E&&Jn.length>0){const Ge=Jn.map(It=>{const Ln=g.findIndex(eo=>eo.name===It);return an(It,Ln,m,y)});let lt=0,Ot=0;if(D==="top"){const It=U?15:0;Ot=-(ae.height+10+It)}else D==="bottom"?Ot=pe+25:D==="left"?lt=-(ae.width+10):D==="right"&&(lt=te+10);Xa(ve,Jn,Ge,Ot,D,N,te,pe,lt,[],{left:we.left,right:we.right})}Jr(t,{chartType:"line-multi",margin:we}),c&&(Tr(q.node()),Or(t,c))}function sne(t,e,n,o,r,i,s){const a=Ae(t).append("g").attr("class","bc-area-fills");for(const l of e){const c=n.find(v=>v.name===l.from),u=n.find(v=>v.name===l.to);if(!c||!u)continue;const d=l.interpolation?Vl(l.interpolation):s,f=(l.opacity??30)/100,h=l.color??"#ccc",g=l.negativeColor;if(g)lne(a,c.values,u.values,o,i,d,h,g,f);else{const v=js().curve(d).x((m,b)=>o(b)).y0((m,b)=>i(u.values[b])).y1(m=>i(m));a.append("path").attr("class","bc-area-fill").attr("d",v(c.values)??"").attr("fill",h).attr("opacity",f)}}}function ane(t,e,n,o){const r=t-n,i=e-o;if(r===0&&i===0||r>0&&i>0||r<0&&i<0)return null;const s=i-r;if(s===0)return null;const a=-r/s;return a<0||a>1?null:a}function lne(t,e,n,o,r,i,s,a,l){const c=e.length;if(c===0)return;const u=[];for(let g=0;g<c;g++){const v=o(g),m=r(e[g]),b=r(n[g]);if(u.push({x:v,fromY:m,toY:b}),g<c-1){const y=r(e[g+1]),x=r(n[g+1]),_=ane(m,y,b,x);if(_!==null&&_>0&&_<1){const k=v+_*(o(g+1)-v),E=m+_*(y-m),L=b+_*(x-b);u.push({x:k,fromY:E,toY:L})}}}const d=[];let f=[],h=null;for(const g of u){const v=g.fromY-g.toY,m=v<0;h===null?(h=v===0?null:m,f.push(g)):v===0?(f.push(g),f.length>=2&&d.push({points:f,positive:h}),f=[g],h=null):h===m?f.push(g):(f.push(g),f.length>=2&&d.push({points:f,positive:h}),f=[g],h=m)}f.length>=2&&h!==null&&d.push({points:f,positive:h});for(const g of d){const v=g.points;let m=`M${v[0].x},${v[0].fromY}`;for(let b=1;b<v.length;b++)m+=`L${v[b].x},${v[b].fromY}`;for(let b=v.length-1;b>=0;b--)m+=`L${v[b].x},${v[b].toY}`;m+="Z",t.append("path").attr("class",`bc-area-fill ${g.positive?"bc-area-fill-pos":"bc-area-fill-neg"}`).attr("d",m).attr("fill",g.positive?s:a).attr("opacity",l)}}const cne=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"];class une extends lo{initialize(){}}function dne(t,e,n={},o=!1){y$(t,e,n,.6,o)}function y$(t,e,n,o,r=!1){var re;Zr(r);let i=null,s;if(r){const oe=Qr(t),he=o>0?"donut":"pie";oe&&oe.chartType!==he&&(i=Mr(t)),s=new Map;for(const I of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[G,Y]of ur(I))s.set(G,Y);t.replaceChildren()}const{body:a}=Xr(t,n.frame);let l=[...e.labels],c=[...e.values];if(n.sort===Qt.Ascending||n.sort===Qt.Descending){const oe=l.map((he,I)=>({label:he,value:c[I]}));oe.sort((he,I)=>n.sort===Qt.Ascending?he.value-I.value:I.value-he.value),l=oe.map(he=>he.label),c=oe.map(he=>he.value)}if(n.sliceMax&&n.sliceMax>0&&l.length>n.sliceMax){const oe=n.sliceMax-1,he=l.slice(0,oe),I=c.slice(0,oe),G=c.slice(oe).reduce((Y,se)=>Y+se,0);he.push(n.sliceGroupLabel??"Others"),I.push(G),l=he,c=I}const u=c.reduce((oe,he)=>oe+he,0),d=c.map(oe=>u>0?oe/u*100:0),f=n.colors??cne,h=f.length<l.length&&f.length>=2?nt.scale(f).mode("lch").colors(l.length):f,g=typeof n.directLabelling=="string"?n.directLabelling:n.directLabelling?Co.Auto:Co.Off,v=!!g&&!(g===Co.Auto&&n.legend===!0),b=(n.showValues??!0)&&!v?c.map((oe,he)=>`(${n.displayAsPercentage?`${Math.round(d[he])}%`:String(oe)})`):[],y=n.legend!==!1&&!v,x=cr(a).width,_=350,k=n.legendPosition??"top",E=x>0&&x<_&&(k==="left"||k==="right")?"top":k,L=n.legendAnchor??"start",S=b.length>0?l.map((oe,he)=>`${oe} ${b[he]}`):l,B=Math.max(0,x-50-20),D=y?Ja(S,E,B):{width:0,height:0},N=y?D.height+15:0,C={};if(y&&E==="top"&&(C.top=N),y&&E==="bottom"&&(C.bottom=24+N),y&&E==="left"&&(C.left=50+D.width+10),y&&E==="right"&&(C.right=20+D.width+10),v){const oe=cr(a),he=20,I=oe.width-2*he,G=(oe.height>0?oe.height:400)-2*he,Y=Math.min(I,G)/2,se=one(l,Y);C.left=(C.left??he)+se.left,C.right=(C.right??he)+se.right,C.top=(C.top??he)+se.top,C.bottom=(C.bottom??he)+se.bottom}const{chartArea:M,width:P,height:$,margin:F}=Kr(a,C),V=Math.min(P,$)/2,U=V*o,K=Qy().domain(l).range(h),ae=UK().sort(null),me=zK().innerRadius(U).outerRadius(V),de=Ae(M).append("g").attr("transform",`translate(${P/2},${$/2})`),ve=ae(c),te=ve.map((oe,he)=>({label:l[he],arc:oe,color:K(l[he])})),pe=oc(t),we=Bu(n.highlights),J=de.append("g").node();Ou(pe,{role:"mark-per-category",parent:J,selector:".bc-arc",data:te,key:oe=>oe.label,insert:oe=>oe.append("path").attr("class","bc-arc"),attrs:oe=>({d:me(oe.arc)??"",fill:oe.color,opacity:In(we,oe.label)})});const ge=new une(de);if(n.tooltips&&ge.use(Ka()),ge.draw(te),(re=n.annotations)!=null&&re.length){const oe=n.annotations.filter(he=>he.kind==="free");oe.length&&Au(oe,{scaleX:Zn().domain([]).range([0,P]),scaleY:Bn().domain([0,1]).range([$,0]),data:[],width:P,height:$,backgroundColor:$r(t),transition:r,priorAnnotations:s}).postDraw({base:Ae(M)},void 0)}if(v){const oe=ve.map((Y,se)=>({label:l[se],value:Y.data,startAngle:Y.startAngle,endAngle:Y.endAngle,color:K(l[se]),percentage:d[se],displayAsPercentage:n.displayAsPercentage,showLabel:n.showLabels??!0,showValue:n.showValues??!0})),he=de,I=$r(t),G={outerRadius:V,innerRadius:U,bgColor:I};g===Co.Inside?v$(he,oe,G):g===Co.Auto?nne(he,oe,G):m$(he,oe,G)}if(n.showTotal&&o>0&&!n.displayAsPercentage){const oe=String(u);de.append("text").attr("class","bc-arc-total-label").attr("text-anchor","middle").attr("dy","-0.3em").attr("font-size","11px").attr("fill","var(--bc-text-color, #555)").attr("opacity",.7).text("Total"),de.append("text").attr("class","bc-arc-total-value").attr("text-anchor","middle").attr("dy","1em").attr("font-size","18px").attr("font-weight","bold").attr("fill","var(--bc-text-color, #555)").text(oe)}if(y){let oe=0,he=0;E==="top"?he=-(D.height+10):E==="bottom"?he=$+25:E==="left"?oe=-(D.width+10):E==="right"&&(oe=P+10),Xa(M,l,h,he,E,L,P,$,oe,b,{left:F.left,right:F.right})}Jr(t,{chartType:o>0?"donut":"pie"}),i&&(Tr(de.node()),Or(t,i))}function fne(t,e,n={},o=!1){y$(t,e,n,0,o)}const x$="#4e79a7";class hne extends lo{initialize(){this.configDefine("xPos",{defaultValue:(r,i)=>0}),this.configDefine("y",{defaultValue:Bn()}),this.configDefine("color",{defaultValue:x$}),this.configDefine("curve",{defaultValue:t2}),this.configDefine("areaFillOpacity",{defaultValue:.25}),this.configDefine("height",{defaultValue:0});const e=this.base.append("g"),n=this.base.append("g"),o=this.base.append("g");this.layer("area",e,{dataBind:(r,i)=>r.selectAll(".bc-area").data([i]),insert:r=>r.append("path").attr("class","bc-area"),events:{enter:r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("color"),l=this.config("curve"),c=this.config("height"),u=this.config("areaFillOpacity"),d=js().curve(l).x((f,h)=>i(f,h)).y0(c).y1(f=>s(f.value));r.attr("fill",a).attr("opacity",u).attr("d",d)},"merge:transition":r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("color"),l=this.config("curve"),c=this.config("height"),u=this.config("areaFillOpacity"),d=js().curve(l).x((f,h)=>i(f,h)).y0(c).y1(f=>s(f.value));r.duration(_t()).attr("fill",a).attr("opacity",u).attr("d",d)},"exit:transition":r=>{r.duration(_t()).attr("opacity",0).remove()}}}),this.layer("line",n,{dataBind:(r,i)=>r.selectAll(".bc-line").data([i]),insert:r=>r.append("path").attr("class","bc-line"),events:{enter:r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("color"),l=this.config("curve"),c=Ci().curve(l).x((u,d)=>i(u,d)).y(u=>s(u.value));r.attr("fill","none").attr("stroke",a).attr("stroke-width",2).attr("d",c)},"merge:transition":r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("color"),l=this.config("curve"),c=Ci().curve(l).x((u,d)=>i(u,d)).y(u=>s(u.value));r.duration(_t()).attr("fill","none").attr("stroke",a).attr("stroke-width",2).attr("d",c)},"exit:transition":r=>{r.duration(_t()).attr("opacity",0).remove()}}}),this.layer("dots",o,{dataBind:(r,i)=>r.selectAll(".bc-dot").data(i,s=>s.label),insert:r=>r.append("circle").attr("class","bc-dot"),events:{enter:r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("color");r.attr("cx",(l,c)=>i(l,c)).attr("cy",l=>s(l.value)).attr("r",3).attr("fill",a)},"merge:transition":r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("color");r.duration(_t()).attr("cx",(l,c)=>i(l,c)).attr("cy",l=>s(l.value)).attr("r",3).attr("fill",a)},"exit:transition":r=>{r.duration(_t()).attr("opacity",0).remove()}}})}}function pne(t,e,n={},o=!1){var we,J,ge,re,oe,he,I,G,Y,se,fe,ne,Q;Zr(o),Gm(t);let r=[],i=[],s=[],a=null,l=null,c,u;const d=Br.for(t);if(o){const q=Qr(t);u=q==null?void 0:q.margin,d.detach(),(q==null?void 0:q.chartType)==="area"?(r=Array.from(t.querySelectorAll(".bc-frame .bc-area")),i=Array.from(t.querySelectorAll(".bc-frame .bc-line")),s=Array.from(t.querySelectorAll(".bc-frame .bc-dot")),a=t.querySelector(".bc-frame .bc-symbols")):q&&(l=Mr(t)),c=new Map;for(const X of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[j,ce]of ur(X))c.set(j,ce);t.replaceChildren()}const{body:f}=Xr(t,n.frame),h=cr(f).width,g=Jl(e.values,(we=n.verticalAxis)==null?void 0:we.range,(J=n.verticalAxis)==null?void 0:J.numberFormat,(ge=n.verticalAxis)==null?void 0:ge.scaleType),v=Pi(h,(re=n.verticalAxis)==null?void 0:re.labelPosition,(oe=n.horizontalAxis)==null?void 0:oe.labelPosition,(he=n.verticalAxis)==null?void 0:he.direction,g),{chartArea:m,width:b,height:y,margin:x}=Kr(f,v),_=Li(u,x),k=Em(e.labels,(I=n.horizontalAxis)==null?void 0:I.range),E=k.map(q=>e.labels[q]),L=k.map(q=>e.values[q]),S=E.map((q,X)=>({label:q,value:L[X]})),B=Mm().domain(E).range([0,b]).padding(n.edgePadding?.6:0),D=B,N=q=>B(q.label)??0,C=((G=n.verticalAxis)==null?void 0:G.scaleType)==="log",[M,P]=ku(L,(Y=n.verticalAxis)==null?void 0:Y.range,(se=n.verticalAxis)==null?void 0:se.scaleType),$=C?ja().domain([M,P]).nice().range([y,0]):Bn().domain([M,P]).nice().range([y,0]),F=$.domain(),V=F[0]<0&&F[1]>0?$(0):void 0;d.attach(m,_),d.update({vertical:{scale:$,height:y,options:{...n.verticalAxis,gridWidth:b,topPadding:x.top}},horizontal:{scale:D,height:y,options:{...n.horizontalAxis,width:b,zeroY:V}}});const U=m.ownerSVGElement,K=Di(U,t,"plot",{x:0,y:0,width:b,height:y}),ae=Ae(m).append("g").attr("clip-path",`url(#${K})`),me=ae.node(),de=((fe=n.colors)==null?void 0:fe[0])??x$,ve=Vl(n.interpolation??"monotoneX"),te=n.lineSymbols,pe=new hne(Ae(me));if(pe.config({xPos:N,y:$,color:de,curve:ve,areaFillOpacity:n.areaFillOpacity??.25,height:y}),i.length>0||r.length>0||s.length>0){const q=(_==null?void 0:_.dx)??0,X=(_==null?void 0:_.dy)??0,j=me.querySelectorAll(":scope > g");j[0]&&Wo(j[0],r,q,X),j[1]&&Wo(j[1],i,q,X),j[2]&&Wo(j[2],s,q,X)}if(n.valueLabels&&pe.use(u$({position:n.valueLabelPosition,orientation:jn.Vertical})),pe.draw(S),(ne=n.annotations)!=null&&ne.length&&Hm(m,n.annotations,{scaleX:D,scaleY:$,data:S,width:b,height:y,backgroundColor:$r(t),transition:o,priorAnnotations:c}),Ae(me).selectAll(".bc-dot").attr("fill-opacity",0).attr("stroke-opacity",0).attr("pointer-events","none"),n.tooltips||n.crosshair){const q=S.map(X=>({cx:N(X),cy:$(X.value),label:X.label,value:X.value,color:de}));qm(m,{width:b,height:y,points:q,tooltip:n.tooltips,crosshair:n.crosshair,crosshairDirection:n.crosshairDirection,crosshairStyle:n.crosshairStyle,crosshairColor:n.crosshairColor,numberFormat:(Q=n.verticalAxis)==null?void 0:Q.numberFormat,container:t})}if(te){const q=S.map((j,ce)=>({cx:N(j),cy:$(j.value),color:de,index:ce}));let X;a?(m.appendChild(a),X=Ae(a)):X=Ae(m).append("g").attr("class","bc-symbols"),_2(X,q,S.length,te,o)}Jr(t,{chartType:"area",margin:x}),l&&(Tr(ae.node()),Or(t,l))}function A2(t){const e=t.series??[];if(e.length===0)return[];const n=e.map(s=>s.name);let o=!1;const r=t.labels.map((s,a)=>{const l={_index:a};return e.forEach(c=>{const u=c.values[a]??0;u<0&&(o=!0),l[c.name]=u}),l});return HC().keys(n).order(e0).offset(o?fZ:Jp)(r)}function C2(t){const e=t.series??[];if(e.length===0)return[];const n=e.map(s=>s.name),o=t.labels.map((s,a)=>{const l={_index:a};return e.forEach(c=>{l[c.name]=c.values[a]??0}),l}),i=HC().keys(n).order(e0).offset(dZ)(o);for(const s of i)for(const a of s)a[0]*=100,a[1]*=100;return i}const w$=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"];class mne extends lo{initialize(){this.configDefine("xPos",{defaultValue:o=>0}),this.configDefine("colors",{defaultValue:w$}),this.configDefine("curve",{defaultValue:t2}),this.configDefine("areaFillOpacity",{defaultValue:.85}),this.configDefine("highlightTargets",{defaultValue:new Set});const e=this.base.append("g"),n=this.base.append("g");this.layer("stacked-areas",e,{dataBind:(o,r)=>o.selectAll(".bc-area").data(r,i=>i.name),insert:o=>o.append("path").attr("class","bc-area"),events:{enter:o=>{const r=this.config("xPos"),i=this.config("colors"),s=this.config("curve"),a=this.config("areaFillOpacity"),l=this.config("highlightTargets"),c=l.size>0;o.attr("data-series",u=>u.colorIndex).attr("fill",u=>i[u.colorIndex%i.length]).attr("opacity",u=>c?In(l,u.name,a):a).attr("d",u=>js().curve(s).x((f,h)=>r(h)).y0(f=>f[0]).y1(f=>f[1])(u.points))},"merge:transition":o=>{const r=this.config("xPos"),i=this.config("colors"),s=this.config("curve"),a=this.config("areaFillOpacity"),l=this.config("highlightTargets"),c=l.size>0;o.duration(_t()).attr("data-series",u=>u.colorIndex).attr("fill",u=>i[u.colorIndex%i.length]).attr("opacity",u=>c?In(l,u.name,a):a).attr("d",u=>js().curve(s).x((f,h)=>r(h)).y0(f=>f[0]).y1(f=>f[1])(u.points))},"exit:transition":o=>{o.duration(_t()).attr("opacity",0).remove()}}}),this.layer("line-edges",n,{dataBind:(o,r)=>o.selectAll(".bc-line").data(r,i=>i.name),insert:o=>o.append("path").attr("class","bc-line"),events:{enter:o=>{const r=this.config("xPos"),i=this.config("colors"),s=this.config("curve"),a=this.config("highlightTargets"),l=a.size>0;o.attr("data-series",c=>c.colorIndex).attr("fill","none").attr("stroke",c=>i[c.colorIndex%i.length]).attr("stroke-width",1).attr("opacity",c=>l?In(a,c.name,1):null).attr("d",c=>Ci().curve(s).x((d,f)=>r(f)).y(d=>d[1])(c.points))},"merge:transition":o=>{const r=this.config("xPos"),i=this.config("colors"),s=this.config("curve"),a=this.config("highlightTargets"),l=a.size>0;o.duration(_t()).attr("data-series",c=>c.colorIndex).attr("fill","none").attr("stroke",c=>i[c.colorIndex%i.length]).attr("stroke-width",1).attr("opacity",c=>l?In(a,c.name,1):null).attr("d",c=>Ci().curve(s).x((d,f)=>r(f)).y(d=>d[1])(c.points))},"exit:transition":o=>{o.duration(_t()).attr("opacity",0).remove()}}})}}function gne(t,e,n={},o=!1){var Tt,Jt,pn,Et,Ft,dn,Sn,Jn,Pr;Zr(o),Gm(t);let r=e,i=[],s=[],a=null,l,c;const u=Br.for(t);if(o){const tt=Qr(t);c=tt==null?void 0:tt.margin,u.detach(),(tt==null?void 0:tt.chartType)==="area-stacked"?(i=Array.from(t.querySelectorAll(".bc-frame .bc-area")),s=Array.from(t.querySelectorAll(".bc-frame .bc-line"))):tt&&(a=Mr(t)),l=new Map;for(const $e of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[Qe,Fe]of ur($e))l.set(Qe,Fe);t.replaceChildren()}const{body:d}=Xr(t,n.frame),f=Em(r.labels,(Tt=n.horizontalAxis)==null?void 0:Tt.range);if(f.length<r.labels.length){const tt=f.map(Qe=>r.labels[Qe]),$e=(r.series??[]).map(Qe=>({...Qe,values:f.map(Fe=>Qe.values[Fe])}));r={labels:tt,values:f.map(Qe=>r.values[Qe]),series:$e}}const h=r.series??[],g=h.filter(tt=>!el(tt.name,n.seriesOverrides)),v=n.colors??w$,m=g.map(tt=>tt.name),b=n.seriesOverrides,y=n.directLabelling===!0||n.directLabelling==="auto"&&n.legend!==!0||!!n.directLabelling&&n.directLabelling!=="auto",x=y?"direct":n.legend!==!1?"legend":"none",_=m.filter(tt=>$a(tt,x,b)==="direct"),k=n.legend!==!1&&!y,E=cr(d).width,L=350,S=n.legendPosition??"top",B=E>0&&E<L&&(S==="left"||S==="right")?"top":S,D=n.legendAnchor??"start",N=n.stacked!==!1,C=n.stackPercent===!0||n.stackMode===Cl.Percent,M=n.areaSortMode??Qt.None,P=n.areaLines!==!1,$=[...g];if(M!==Qt.None){const tt=new Map($.map($e=>[$e.name,$e.values.reduce((Qe,Fe)=>Qe+Fe,0)]));$.sort(($e,Qe)=>{const Fe=(tt.get($e.name)??0)-(tt.get(Qe.name)??0);return M===Qt.Ascending?Fe:-Fe})}const F={labels:r.labels,values:r.values,series:$},V=C?C2(F):A2(F);let U=0;if(N)for(const tt of V)for(const $e of tt)$e[1]>U&&(U=$e[1]);else for(const tt of $)for(const $e of tt.values)$e>U&&(U=$e);C&&(U=100);const K=[0,U],ae=((Jt=n.verticalAxis)==null?void 0:Jt.numberFormat)??(C?"|d|%":void 0),me=Jl(K,(pn=n.verticalAxis)==null?void 0:pn.range,ae,(Et=n.verticalAxis)==null?void 0:Et.scaleType),de=Pi(E,(Ft=n.verticalAxis)==null?void 0:Ft.labelPosition,(dn=n.horizontalAxis)==null?void 0:dn.labelPosition,(Sn=n.verticalAxis)==null?void 0:Sn.direction,me),ve=_.length>0?c$(_):0,te=de.top!=null,pe=Math.max(0,E-(de.left??50)-(de.right??20)-ve),we=k?Ja(m,B,pe):{width:0,height:0},J=k?we.height+15:0,ge={...de};if(k&&B==="top"){const tt=te?15:0;ge.top=J+tt}k&&B==="bottom"&&(ge.bottom=(ge.bottom??24)+J),k&&B==="left"&&(ge.left=(ge.left??50)+we.width+10),k&&B==="right"&&(ge.right=(ge.right??20)+we.width+10),ve>0&&(ge.right=(ge.right??20)+ve);const{chartArea:re,width:oe,height:he,margin:I}=Kr(d,ge),G=Li(c,I),Y=Mm().domain(r.labels).range([0,oe]).padding(n.edgePadding?.6:0),se=Y,fe=tt=>Y(r.labels[tt])??0,ne=Bn().domain([0,U]).nice().range([he,0]);u.attach(re,G),u.update({vertical:{scale:ne,height:he,options:{...n.verticalAxis,numberFormat:ae,gridWidth:oe,topPadding:I.top}},horizontal:{scale:se,height:he,options:{...n.horizontalAxis,width:oe}}});const Q=re.ownerSVGElement,q=Di(Q,t,"plot",{x:0,y:0,width:oe,height:he}),X=Ae(re).append("g").attr("clip-path",`url(#${q})`),j=X.node(),ce=Vl(n.interpolation??"monotoneX"),ye=V.map(tt=>{const $e=h.findIndex(Fe=>Fe.name===tt.key);let Qe;if(N)Qe=Array.from(tt).map(Fe=>[ne(Fe[0]),ne(Fe[1])]);else{const Fe=$.find(at=>at.name===tt.key);Qe=((Fe==null?void 0:Fe.values)??[]).map(at=>[ne(0),ne(at)])}return{name:tt.key,points:Qe,colorIndex:$e>=0?$e:0}}),ue=new Set((n.highlights??[]).map(tt=>tt.target)),ke=ue.size>0,Ie=n.areaFillOpacity!=null?n.areaFillOpacity:.85,Se=new mne(Ae(j));if(Se.config({xPos:fe,colors:v,curve:ce,areaFillOpacity:Ie,highlightTargets:ue}),i.length>0||s.length>0){const tt=(G==null?void 0:G.dx)??0,$e=(G==null?void 0:G.dy)??0,Qe=j.querySelectorAll(":scope > g");Qe[0]&&Wo(Qe[0],i,tt,$e),Qe[1]&&Wo(Qe[1],s,tt,$e)}if(Se.draw(ye),Ae(j).selectAll(".bc-area").each(function(tt){const $e=tt,Qe=an($e.name,$e.colorIndex,v,b),Fe=o?Ae(this).transition().duration(_t()):Ae(this);Fe.attr("fill",Qe),ke&&Fe.attr("opacity",In(ue,$e.name,Ie))}),P||Ae(j).selectAll(".bc-line").attr("display","none"),Ae(j).selectAll(".bc-line").each(function(tt){const $e=tt,Qe=an($e.name,$e.colorIndex,v,b),Fe=w2($e.name,n.interpolation??"monotoneX",b),at=o?Ae(this).transition().duration(_t()):Ae(this);if(at.attr("stroke",Qe),ke&&at.attr("opacity",In(ue,$e.name,1)),Fe!==(n.interpolation??"monotoneX")){const ln=Vl(Fe),Yn=Ci().curve(ln).x((Po,zn)=>fe(zn)).y(Po=>Po[1]);at.attr("d",Yn($e.points))}}),(Jn=n.annotations)!=null&&Jn.length){const tt=r.labels.map(($e,Qe)=>{var Fe;return{label:$e,value:((Fe=g[0])==null?void 0:Fe.values[Qe])??0}});Hm(re,n.annotations,{scaleX:se,scaleY:ne,data:tt,width:oe,height:he,backgroundColor:$r(t),transition:o,priorAnnotations:l})}if(n.tooltips||n.crosshair){const tt=[];V.forEach($e=>{const Qe=h.findIndex(Fe=>Fe.name===$e.key);Array.from($e).forEach((Fe,at)=>{const ln=Fe[1]-Fe[0];tt.push({cx:fe(at),cy:ne(Fe[1]),label:r.labels[at],value:Math.round(ln*100)/100,series:$e.key,color:an($e.key,Qe,v,b)})})}),qm(re,{width:oe,height:he,points:tt,tooltip:n.tooltips,crosshair:n.crosshair,crosshairDirection:n.crosshairDirection,crosshairStyle:n.crosshairStyle,crosshairColor:n.crosshairColor,numberFormat:(Pr=n.verticalAxis)==null?void 0:Pr.numberFormat,container:t})}const Be=r.labels.length-1,Ze=fe(Be)+6,ot=[];if(g.forEach((tt,$e)=>{var Po;if($a(tt.name,x,b)!=="direct")return;const Fe=V.find(zn=>zn.key===tt.name);if(!Fe)return;const at=Fe[Be],ln=ne((at[0]+at[1])/2),Yn=((Po=b==null?void 0:b.find(zn=>zn.name===tt.name))==null?void 0:Po.labelText)||tt.name;ot.push({name:tt.name,index:$e,naturalY:ln,text:Yn})}),ot.length>0){ot.sort((Fe,at)=>Fe.naturalY-at.naturalY);const tt=ot.map(Fe=>Fe.naturalY),Qe=S2(tt,0,he,14);ot.forEach((Fe,at)=>{Ae(re).append("text").attr("class","bc-direct-label").attr("data-series",Fe.index).attr("x",Ze).attr("y",Qe[at]).attr("dy","0.35em").attr("font-size","11px").attr("fill",an(Fe.name,Fe.index,v,b)).text(Fe.text)})}const pt=m.filter(tt=>$a(tt,x,b)==="legend");if(k&&pt.length>0){const tt=pt.map(Fe=>{const at=h.findIndex(ln=>ln.name===Fe);return an(Fe,at,v,b)});let $e=0,Qe=0;if(B==="top"){const Fe=te?15:0;Qe=-(we.height+10+Fe)}else B==="bottom"?Qe=he+25:B==="left"?$e=-(we.width+10):B==="right"&&($e=oe+10);Xa(re,pt,tt,Qe,B,D,oe,he,$e,[],{left:I.left,right:I.right})}Jr(t,{chartType:"area-stacked",margin:I}),a&&(Tr(X.node()),Or(t,a))}const _$=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"];class vne extends lo{initialize(){this.configDefine("x",{defaultValue:Zn()}),this.configDefine("y",{defaultValue:Bn()}),this.configDefine("colors",{defaultValue:_$});const e=this.base.append("g");this.layer("bars",e,{dataBind:(n,o)=>n.selectAll(".bc-bar-stacked").data(o,r=>r.label+"\0"+r.seriesName),insert:n=>n.append("rect").attr("class","bc-bar bc-bar-stacked"),events:{enter:n=>{const o=this.config("x"),r=this.config("y"),i=this.config("colors");n.attr("data-series",s=>s.seriesName).attr("x",s=>o(s.label)??0).attr("y",s=>r(s.y1)).attr("width",o.bandwidth()).attr("height",s=>r(s.y0)-r(s.y1)).attr("fill",s=>i[s.seriesIndex%i.length])},"merge:transition":n=>{const o=this.config("x"),r=this.config("y"),i=this.config("colors");n.duration(_t()).attr("data-series",s=>s.seriesName).attr("x",s=>o(s.label)??0).attr("y",s=>r(s.y1)).attr("width",o.bandwidth()).attr("height",s=>r(s.y0)-r(s.y1)).attr("fill",s=>i[s.seriesIndex%i.length])},"exit:transition":n=>{n.duration(_t()).attr("opacity",0).remove()}}})}}function bne(t,e,n){const o=[];for(const r of t){const i=r.key,s=n.findIndex(a=>a.name===i);for(let a=0;a<r.length;a++){const l=r[a];o.push({label:e[a],seriesName:i,seriesIndex:s,y0:l[0],y1:l[1],value:l[1]-l[0]})}}return o}function yne(t,e,n={},o=!1){var fe,ne,Q,q,X,j,ce,ye;Zr(o);let r=[],i=null,s,a;const l=Br.for(t);if(o){const ue=Qr(t);a=ue==null?void 0:ue.margin,l.detach(),(ue==null?void 0:ue.chartType)==="column-stacked"?r=Array.from(t.querySelectorAll(".bc-frame .bc-bar-stacked")):ue&&(i=Mr(t)),s=new Map;for(const ke of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[Ie,Se]of ur(ke))s.set(Ie,Se);t.replaceChildren()}const{body:c}=Xr(t,n.frame),u=e.series??[],d=u.filter(ue=>!el(ue.name,n.seriesOverrides)),f=d.map(ue=>ue.name),h=n.colors??_$,g=n.seriesOverrides,v=n.legend!==!1,m=cr(c).width,b=350,y=n.legendPosition??"top",x=m>0&&m<b&&(y==="left"||y==="right")?"top":y,_=n.legendAnchor??"start",k={labels:e.labels,values:e.values,series:d},E=n.stackMode===Cl.Percent,L=E?C2(k):A2(k),S=bne(L,e.labels,u),B=E?100:Kd(S,ue=>ue.y1)??0,N=Jl([0,B],(fe=n.verticalAxis)==null?void 0:fe.range,(ne=n.verticalAxis)==null?void 0:ne.numberFormat,(Q=n.verticalAxis)==null?void 0:Q.scaleType),C=Pi(m,(q=n.verticalAxis)==null?void 0:q.labelPosition,(X=n.horizontalAxis)==null?void 0:X.labelPosition,(j=n.verticalAxis)==null?void 0:j.direction,N),M=Math.max(0,m-(C.left??50)-(C.right??20)),P=o2(e.labels,M,n.horizontalAxis);P!==void 0&&(C.bottom=P);const $=C.top!=null,F=Math.max(0,m-(C.left??50)-(C.right??20)),V=v?Ja(f,x,F):{width:0,height:0},U=v?V.height+15:0,K={...C};if(v&&x==="top"){const ue=$?15:0;K.top=U+ue}v&&x==="bottom"&&(K.bottom=(K.bottom??24)+U),v&&x==="left"&&(K.left=(K.left??50)+V.width+10),v&&x==="right"&&(K.right=(K.right??20)+V.width+10);const{chartArea:ae,width:me,height:de,margin:ve}=Kr(c,K),te=Li(a,ve);let pe=e.labels;if(n.sortMode==="total"){const ue=e.labels.map((ke,Ie)=>({label:ke,index:Ie,total:d.reduce((Se,Be)=>Se+(Be.values[Ie]??0),0)}));ue.sort((ke,Ie)=>Ie.total-ke.total),pe=ue.map(ke=>ke.label)}const we=Zn().domain(pe).range([0,me]).padding(tc(n.barGap)),J=Bn().domain([0,B]).nice().range([de,0]);l.attach(ae,te),l.update({vertical:{scale:J,height:de,options:{...n.verticalAxis,gridWidth:me,topPadding:ve.top}},horizontal:{scale:we,height:de,options:{...n.horizontalAxis,width:me}}});const ge=ae.ownerSVGElement,re=Di(ge,t,"bars",{x:0,y:0,width:me,height:de}),oe=Ae(ae).append("g").attr("clip-path",`url(#${re})`),he=pe===e.labels?S:pe.flatMap(ue=>S.filter(ke=>ke.label===ue)),I=new vne(oe);if(I.config({x:we,y:J,colors:h}),r.length>0){const ue=oe.node().querySelector("g");Wo(ue,r,(te==null?void 0:te.dx)??0,(te==null?void 0:te.dy)??0)}if(n.tooltips&&I.use(Ka({numberFormat:(ce=n.verticalAxis)==null?void 0:ce.numberFormat})),n.crosshair&&I.use(nc({width:me,height:de,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor})),(ye=n.annotations)!=null&&ye.length){const ue=e.labels.map((ke,Ie)=>({label:ke,value:d.reduce((Se,Be)=>Se+(Be.values[Ie]??0),0)}));I.use(Au(n.annotations,{scaleX:we,scaleY:J,data:ue,width:me,height:de,backgroundColor:$r(t),transition:o,priorAnnotations:s}))}I.draw(he),Jr(t,{chartType:"column-stacked",margin:ve}),i&&(Tr(oe.node()),Or(t,i));const G=Bu(n.highlights);Ae(ae).selectAll(".bc-bar-stacked").each(function(ue){const ke=ue,Ie=an(ke.seriesName,ke.seriesIndex,h,g),Se=Lf(ke.seriesName,g),Be=o?Ae(this).transition().duration(_t()):Ae(this);Be.attr("fill",Ie),Se<1&&Be.attr("fill-opacity",Se),G.size>0&&Be.attr("opacity",In(G,ke.seriesName))});const Y=n.valueLabels??!1,se=Ae(ae).append("g").attr("class","bc-value-labels");if(he.forEach(ue=>{if(!Lu(ue.seriesName,Y,g))return;const ke=(we(ue.label)??0)+we.bandwidth()/2,Ie=J(ue.y0)-(J(ue.y0)-J(ue.y1))/2;se.append("text").attr("class","bc-value-label").attr("data-series",ue.seriesName).attr("x",ke).attr("y",Ie).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size","11px").attr("fill","currentColor").text(E?`${Math.round(ue.value)}%`:String(Math.round(ue.value*100)/100))}),v&&f.length>0){const ue=f.map(Se=>{const Be=u.findIndex(Ze=>Ze.name===Se);return an(Se,Be,h,g)});let ke=0,Ie=0;if(x==="top"){const Se=$?15:0;Ie=-(V.height+10+Se)}else x==="bottom"?Ie=de+25:x==="left"?ke=-(V.width+10):x==="right"&&(ke=me+10);Xa(ae,f,ue,Ie,x,_,me,de,ke,[],{left:ve.left,right:ve.right})}}const k$=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"],y6=13;class xne extends lo{initialize(){this.configDefine("x",{defaultValue:Bn()}),this.configDefine("y",{defaultValue:Zn()}),this.configDefine("colors",{defaultValue:k$}),this.configDefine("categoryLabelOffset",{defaultValue:0});const e=this.base.append("g");this.layer("bars",e,{dataBind:(n,o)=>n.selectAll(".bc-bar-stacked").data(o,r=>r.label+"\0"+r.seriesName),insert:n=>n.append("rect").attr("class","bc-bar bc-bar-stacked"),events:{enter:n=>{const o=this.config("x"),r=this.config("y"),i=this.config("colors"),s=this.config("categoryLabelOffset");n.attr("data-series",a=>a.seriesName).attr("x",a=>o(a.y0)).attr("y",a=>(r(a.label)??0)+s).attr("width",a=>o(a.y1)-o(a.y0)).attr("height",Math.max(0,r.bandwidth()-s)).attr("fill",a=>i[a.seriesIndex%i.length])},"merge:transition":n=>{const o=this.config("x"),r=this.config("y"),i=this.config("colors"),s=this.config("categoryLabelOffset");n.duration(_t()).attr("data-series",a=>a.seriesName).attr("x",a=>o(a.y0)).attr("y",a=>(r(a.label)??0)+s).attr("width",a=>o(a.y1)-o(a.y0)).attr("height",Math.max(0,r.bandwidth()-s)).attr("fill",a=>i[a.seriesIndex%i.length])},"exit:transition":n=>{n.duration(_t()).attr("opacity",0).remove()}}})}}function wne(t,e,n){const o=[];for(const r of t){const i=r.key,s=n.findIndex(a=>a.name===i);for(let a=0;a<r.length;a++){const l=r[a];o.push({label:e[a],seriesName:i,seriesIndex:s,y0:l[0],y1:l[1],value:l[1]-l[0]})}}return o}function _ne(t,e,n={},o=!1){var X,j,ce,ye,ue,ke,Ie;Zr(o);let r=[],i=null,s,a;const l=Br.for(t);if(o){const Se=Qr(t);a=Se==null?void 0:Se.margin,l.detach(),(Se==null?void 0:Se.chartType)==="bar-stacked"?r=Array.from(t.querySelectorAll(".bc-frame .bc-bar-stacked")):Se&&(i=Mr(t)),s=new Map;for(const Be of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[Ze,ot]of ur(Be))s.set(Ze,ot);t.replaceChildren()}const{body:c}=Xr(t,n.frame),u=e.series??[],d=u.filter(Se=>!el(Se.name,n.seriesOverrides)),f=d.map(Se=>Se.name),h=n.colors??k$,g=n.seriesOverrides,v=n.legend!==!1,m=cr(c).width,b=350,y=n.legendPosition??"top",x=m>0&&m<b&&(y==="left"||y==="right")?"top":y,_=n.legendAnchor??"start",k={labels:e.labels,values:e.values,series:d},E=n.stackMode===Cl.Percent,L=E?C2(k):A2(k),S=wne(L,e.labels,u),B=E?100:Kd(S,Se=>Se.y1)??0,D=n.categoryLabelLine===!0,N=Pm(e.labels),C=D?on.Off:(X=n.verticalAxis)==null?void 0:X.labelPosition,M=Pi(m,C,(j=n.horizontalAxis)==null?void 0:j.labelPosition,(ce=n.verticalAxis)==null?void 0:ce.direction,N,(ye=n.horizontalAxis)==null?void 0:ye.showAxis),P=M.top!=null,$=Math.max(0,m-(M.left??50)-(M.right??20)),F=v?Ja(f,x,$):{width:0,height:0},V=v?F.height+15:0,U={...M};if(v&&x==="top"){const Se=P?15:0;U.top=V+Se}v&&x==="bottom"&&(U.bottom=(U.bottom??24)+V),v&&x==="left"&&(U.left=(U.left??50)+F.width+10),v&&x==="right"&&(U.right=(U.right??20)+F.width+10);const{chartArea:K,width:ae,height:me,margin:de}=Kr(c,U),ve=Li(a,de);let te=e.labels;if(n.sortMode==="total"){const Se=e.labels.map((Be,Ze)=>({label:Be,index:Ze,total:d.reduce((ot,pt)=>ot+(pt.values[Ze]??0),0)}));Se.sort((Be,Ze)=>Ze.total-Be.total),te=Se.map(Be=>Be.label)}const pe=Bn().domain([0,B]).nice().range([0,ae]),we=Zn().domain(te).range([0,me]).padding(tc(n.barGap));l.attach(K,ve),l.update({horizontal:{scale:pe,height:me,options:{...n.horizontalAxis,width:ae}},vertical:{scale:we,height:me,options:{...n.verticalAxis,labelPosition:D?on.Off:(ue=n.verticalAxis)==null?void 0:ue.labelPosition,topPadding:de.top}},order:"horizontal-first"});const J=K.ownerSVGElement,ge=Di(J,t,"bars",{x:0,y:0,width:ae,height:me}),re=Ae(K).append("g").attr("clip-path",`url(#${ge})`),oe=te===e.labels?S:te.flatMap(Se=>S.filter(Be=>Be.label===Se)),he=D?y6:0,I=new xne(re);if(I.config({x:pe,y:we,colors:h,categoryLabelOffset:he}),r.length>0){const Se=re.node().querySelector("g");Wo(Se,r,(ve==null?void 0:ve.dx)??0,(ve==null?void 0:ve.dy)??0)}if(n.tooltips&&I.use(Ka({numberFormat:(ke=n.verticalAxis)==null?void 0:ke.numberFormat})),n.crosshair&&I.use(nc({width:ae,height:me,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor,orientation:jn.Horizontal})),(Ie=n.annotations)!=null&&Ie.length){const Se=e.labels.map((Be,Ze)=>({label:Be,value:d.reduce((ot,pt)=>ot+(pt.values[Ze]??0),0)}));I.use(Au(n.annotations,{scaleX:we,scaleY:pe,data:Se,width:ae,height:me,backgroundColor:$r(t),orientation:jn.Horizontal,transition:o,priorAnnotations:s}))}I.draw(oe),Jr(t,{chartType:"bar-stacked",margin:de}),i&&(Tr(re.node()),Or(t,i));const G=Bu(n.highlights);if(Ae(K).selectAll(".bc-bar-stacked").each(function(Se){const Be=Se,Ze=an(Be.seriesName,Be.seriesIndex,h,g),ot=Lf(Be.seriesName,g),pt=o?Ae(this).transition().duration(_t()):Ae(this);pt.attr("fill",Ze),ot<1&&pt.attr("fill-opacity",ot),G.size>0&&pt.attr("opacity",In(G,Be.seriesName))}),D){const Se=Ae(K).append("g").attr("class","bc-category-labels");for(const Be of te){const Ze=we(Be)??0;Se.append("text").attr("class","bc-category-label").attr("x",2).attr("y",Ze+y6/2).attr("text-anchor","start").attr("dominant-baseline","central").attr("font-size","10px").attr("font-weight","600").attr("fill","currentColor").text(Be)}}const Y=n.valueLabels??!1,se=n.valueLabelPosition??yt.Auto,fe=new Set,ne=new Map;for(const Se of te){const Be=oe.filter(Ze=>Ze.label===Se).sort((Ze,ot)=>Ze.y1-ot.y1);if(Be.length>0){const Ze=Be[Be.length-1];fe.add(Ze.label+"\0"+Ze.seriesName);for(let ot=0;ot<Be.length-1;ot++){const pt=Be[ot].label+"\0"+Be[ot].seriesName;ne.set(pt,pe(Be[ot+1].y1)-pe(Be[ot].y1))}}}const Q=new Map,q=Ae(K).append("g").attr("class","bc-value-labels");if(oe.forEach(Se=>{if(!Lu(Se.seriesName,Y,g))return;const Be=E?`${Math.round(Se.value)}%`:String(Math.round(Se.value*100)/100),Ze=pe(Se.y1)-pe(Se.y0),ot=Be.length*6.5+8,pt=Ze>=ot,Tt=(we(Se.label)??0)+he+(we.bandwidth()-he)/2,Jt=an(Se.seriesName,Se.seriesIndex,h,g),pn=fe.has(Se.label+"\0"+Se.seriesName),Et=se===yt.Outside||se===yt.Auto&&!pt&&pn,Ft=()=>{const dn=pe(Se.y0)+Ze/2;q.append("text").attr("class","bc-value-label").attr("data-series",Se.seriesName).attr("opacity",0).attr("x",dn).attr("y",Tt).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size","11px").attr("fill",Cr(Jt)).text(Be)};if(Et)if(se===yt.Inside)Ft();else{const dn=pe(Se.y1)+4,Sn=Q.get(Se.label)??0,Jn=ne.get(Se.label+"\0"+Se.seriesName),Pr=dn<Sn,tt=Jn!==void 0&&ot+4>Jn,$e=ae+de.right-2,Qe=dn+ot>$e;Pr||tt||Qe?Ft():(Q.set(Se.label,dn+ot),q.append("text").attr("class","bc-value-label").attr("data-series",Se.seriesName).attr("x",dn).attr("y",Tt).attr("text-anchor","start").attr("dominant-baseline","central").attr("font-size","11px").attr("fill","currentColor").text(Be))}else if(!pt)Ft();else{const dn=pe(Se.y0)+Ze/2;q.append("text").attr("class","bc-value-label").attr("data-series",Se.seriesName).attr("x",dn).attr("y",Tt).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size","11px").attr("fill",Cr(Jt)).text(Be)}}),v&&f.length>0){const Se=f.map(ot=>{const pt=u.findIndex(Tt=>Tt.name===ot);return an(ot,pt,h,g)});let Be=0,Ze=0;if(x==="top"){const ot=P?15:0;Ze=-(F.height+10+ot)}else x==="bottom"?Ze=me+25:x==="left"?Be=-(F.width+10):x==="right"&&(Be=ae+10);Xa(K,f,Se,Ze,x,_,ae,me,Be,[],{left:de.left,right:de.right})}}const S$=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"],x6=16,wh=20,w6=13;class kne extends lo{initialize(){this.configDefine("y",{defaultValue:Zn()}),this.configDefine("colors",{defaultValue:S$}),this.configDefine("categoryLabelOffset",{defaultValue:0});const e=this.base.append("g");this.layer("bars",e,{dataBind:(n,o)=>n.selectAll(".bc-bar-split").data(o,r=>r.label+"\0"+r.seriesName),insert:n=>n.append("rect").attr("class","bc-bar bc-bar-split"),events:{enter:n=>{const o=this.config("y"),r=this.config("colors"),i=this.config("categoryLabelOffset");n.attr("data-series",s=>s.seriesName).attr("x",s=>s.xPos).attr("y",s=>(o(s.label)??0)+i).attr("width",s=>s.barWidth).attr("height",Math.max(0,o.bandwidth()-i)).attr("fill",s=>r[s.seriesIndex%r.length])},"merge:transition":n=>{const o=this.config("y"),r=this.config("colors"),i=this.config("categoryLabelOffset");n.duration(_t()).attr("data-series",s=>s.seriesName).attr("x",s=>s.xPos).attr("y",s=>(o(s.label)??0)+i).attr("width",s=>s.barWidth).attr("height",Math.max(0,o.bandwidth()-i)).attr("fill",s=>r[s.seriesIndex%r.length])},"exit:transition":n=>{n.duration(_t()).attr("opacity",0).remove()}}})}}function Sne(t,e,n,o){const r=t.length;if(r===0)return[];const i=Math.max(0,(n-(r-1)*x6)/r),s=o?Kd(t.flatMap(a=>a.values))??0:0;return t.map((a,l)=>{const c=o?s:Kd(a.values)??0,u=Bn().domain([0,c]).nice().range([0,i]);return{seriesName:a.name,seriesIndex:e.findIndex(d=>d.name===a.name),xOffset:l*(i+x6),panelWidth:i,xScale:u}})}function Ane(t,e,n,o){const r=[];for(const i of t){const s=o.find(a=>a.name===i.seriesName);if(s)for(const a of e){const l=n.indexOf(a),c=l>=0?s.values[l]??0:0,u=Math.max(0,i.xScale(c)-i.xScale(0));r.push({label:a,seriesName:i.seriesName,seriesIndex:i.seriesIndex,value:c,xPos:i.xOffset,barWidth:u})}}return r}function Cne(t,e,n={},o=!1){var I,G,Y,se,fe,ne;Zr(o);let r=[],i=null,s;const a=Br.for(t);if(o){const Q=Qr(t);s=Q==null?void 0:Q.margin,a.detach(),(Q==null?void 0:Q.chartType)==="bar-split"?r=Array.from(t.querySelectorAll(".bc-frame .bc-bar-split")):Q&&(i=Mr(t)),t.replaceChildren()}const{body:l}=Xr(t,n.frame),c=e.series??[],u=c.filter(Q=>!el(Q.name,n.seriesOverrides)),d=u.map(Q=>Q.name),f=n.colors??S$,h=n.seriesOverrides,g=n.legend!==!1,v=cr(l).width,m=350,b=n.legendPosition??"top",y=v>0&&v<m&&(b==="left"||b==="right")?"top":b,x=n.legendAnchor??"start",_=n.categoryLabelLine===!0,k=Pm(e.labels),E=_?on.Off:(I=n.verticalAxis)==null?void 0:I.labelPosition,L=Pi(v,E,(G=n.horizontalAxis)==null?void 0:G.labelPosition,(Y=n.verticalAxis)==null?void 0:Y.direction,k,(se=n.horizontalAxis)==null?void 0:se.showAxis);L.top=(L.top??12)+wh;const S=Math.max(0,v-(L.left??50)-(L.right??20)),B=g?Ja(d,y,S):{width:0,height:0},D=g?B.height+15:0,N={...L};g&&y==="top"&&(N.top=D+wh),g&&y==="bottom"&&(N.bottom=(N.bottom??24)+D),g&&y==="left"&&(N.left=(N.left??50)+B.width+10),g&&y==="right"&&(N.right=(N.right??20)+B.width+10);const{chartArea:C,width:M,height:P,margin:$}=Kr(l,N),F=Li(s,$);let V=e.labels;if(n.sortMode==="total"){const Q=e.labels.map((q,X)=>({label:q,total:u.reduce((j,ce)=>j+(ce.values[X]??0),0)}));Q.sort((q,X)=>X.total-q.total),V=Q.map(q=>q.label)}const U=Zn().domain(V).range([0,P]).padding(tc(n.barGap)),K=_?w6:0;a.attach(C,F),a.update({vertical:{scale:U,height:P,options:{...n.verticalAxis,labelPosition:_?on.Off:(fe=n.verticalAxis)==null?void 0:fe.labelPosition,topPadding:$.top}},order:"horizontal-first"});const ae=n.sharedScale===!0,me=Sne(u,c,M,ae),de=C.ownerSVGElement,ve=Di(de,t,"bars",{x:0,y:0,width:M,height:P}),te=Ae(C).append("g").attr("clip-path",`url(#${ve})`),pe=Ae(C).append("g").attr("class","bc-split-headers");for(const Q of me)pe.append("text").attr("class","bc-split-header").attr("x",Q.xOffset+Q.panelWidth/2).attr("y",-wh/2).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size","11px").attr("font-weight","600").attr("fill","currentColor").text(Q.seriesName);const we=Ane(me,V,e.labels,c),J=new kne(te);if(J.config({y:U,colors:f,categoryLabelOffset:K}),r.length>0){const Q=te.node().querySelector("g");Wo(Q,r,(F==null?void 0:F.dx)??0,(F==null?void 0:F.dy)??0)}n.tooltips&&J.use(Ka({numberFormat:(ne=n.verticalAxis)==null?void 0:ne.numberFormat})),n.crosshair&&J.use(nc({width:M,height:P,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor,orientation:jn.Horizontal})),J.draw(we);const ge=Bu(n.highlights);if(Jr(t,{chartType:"bar-split",margin:$}),i&&(Tr(te.node()),Or(t,i)),Ae(C).selectAll(".bc-bar-split").each(function(Q){const q=Q,X=an(q.seriesName,q.seriesIndex,f,h),j=Lf(q.seriesName,h),ce=o?Ae(this).transition().duration(_t()):Ae(this);ce.attr("fill",X),j<1&&ce.attr("fill-opacity",j),ge.size>0&&ce.attr("opacity",In(ge,q.seriesName))}),_){const Q=Ae(C).append("g").attr("class","bc-category-labels");for(const q of V){const X=U(q)??0;Q.append("text").attr("class","bc-category-label").attr("x",2).attr("y",X+w6/2).attr("text-anchor","start").attr("dominant-baseline","central").attr("font-size","10px").attr("font-weight","600").attr("fill","currentColor").text(q)}}const re=n.valueLabels??!0,oe=n.valueLabelPosition??yt.Auto,he=Ae(C).append("g").attr("class","bc-value-labels");if(we.forEach(Q=>{if(!Lu(Q.seriesName,re,h))return;const q=me.find(Be=>Be.seriesName===Q.seriesName);if(!q)return;const X=an(Q.seriesName,Q.seriesIndex,f,h),j=Q.xPos+Q.barWidth,ce=Math.max(0,U.bandwidth()-K),ye=(U(Q.label)??0)+K+ce/2,ue=oe===yt.Inside||oe===yt.Auto&&Q.barWidth>30;let ke,Ie,Se;if(ue)ke=j-4,Ie="end",Se=Cr(X);else{const Be=j+4,Ze=q.xOffset+q.panelWidth;Be+20>Ze?(ke=Q.xPos-4,Ie="end"):(ke=Be,Ie="start"),Se="currentColor"}he.append("text").attr("class","bc-value-label").attr("data-series",Q.seriesName).attr("x",ke).attr("y",ye).attr("text-anchor",Ie).attr("dominant-baseline","central").attr("font-size","11px").attr("fill",Se).text(String(Q.value))}),g&&d.length>0){const Q=d.map(j=>{const ce=c.findIndex(ye=>ye.name===j);return an(j,ce,f,h)});let q=0,X=0;y==="top"?X=-(B.height+10+wh):y==="bottom"?X=P+25:y==="left"?q=-(B.width+10):y==="right"&&(q=M+10),Xa(C,d,Q,X,y,x,M,P,q,[],{left:$.left,right:$.right})}}const Z1=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"],_6=13;class $ne extends lo{initialize(){this.configDefine("x",{defaultValue:Bn()}),this.configDefine("y0",{defaultValue:Zn()}),this.configDefine("y1",{defaultValue:Zn()}),this.configDefine("colors",{defaultValue:Z1}),this.configDefine("categoryLabelOffset",{defaultValue:0});const e=this.base.append("g");this.layer("bars",e,{dataBind:(n,o)=>n.selectAll(".bc-bar-grouped").data(o,r=>r.label+"\0"+r.seriesName),insert:n=>n.append("rect").attr("class","bc-bar bc-bar-grouped"),events:{enter:n=>{const o=this.config("x"),r=this.config("y0"),i=this.config("y1"),s=this.config("colors"),a=this.config("categoryLabelOffset");n.attr("data-series",l=>l.seriesName).attr("x",o(0)).attr("y",l=>(r(l.label)??0)+a+(i(l.seriesName)??0)).attr("width",l=>Math.max(0,o(l.value)-o(0))).attr("height",i.bandwidth()).attr("fill",l=>s[l.seriesIndex%s.length])},"merge:transition":n=>{const o=this.config("x"),r=this.config("y0"),i=this.config("y1"),s=this.config("colors"),a=this.config("categoryLabelOffset");n.duration(_t()).attr("data-series",l=>l.seriesName).attr("x",o(0)).attr("y",l=>(r(l.label)??0)+a+(i(l.seriesName)??0)).attr("width",l=>Math.max(0,o(l.value)-o(0))).attr("height",i.bandwidth()).attr("fill",l=>s[l.seriesIndex%s.length])},"exit:transition":n=>{n.duration(_t()).attr("opacity",0).remove()}}})}}function Tne(t,e,n={},o=!1){var G,Y,se,fe,ne,Q;Zr(o);let r=[],i=null,s;const a=Br.for(t);if(o){const q=Qr(t);s=q==null?void 0:q.margin,a.detach(),(q==null?void 0:q.chartType)==="bar-grouped"?r=Array.from(t.querySelectorAll(".bc-frame .bc-bar-grouped")):q&&(i=Mr(t)),t.replaceChildren()}const{body:l}=Xr(t,n.frame),c=e.series??[],u=c.filter(q=>!el(q.name,n.seriesOverrides)),d=u.map(q=>q.name),f=n.colors??Z1,h=n.seriesOverrides,g=n.legend!==!1,v=cr(l).width,m=350,b=n.legendPosition??"top",y=v>0&&v<m&&(b==="left"||b==="right")?"top":b,x=n.legendAnchor??"start",_=n.categoryLabelLine===!0,k=Pm(e.labels),E=_?on.Off:(G=n.verticalAxis)==null?void 0:G.labelPosition,L=Pi(v,E,(Y=n.horizontalAxis)==null?void 0:Y.labelPosition,(se=n.verticalAxis)==null?void 0:se.direction,k,(fe=n.horizontalAxis)==null?void 0:fe.showAxis),S=Math.max(0,v-(L.left??50)-(L.right??20)),B=g?Ja(d,y,S):{width:0,height:0},D=g?B.height+15:0,N={...L};g&&y==="top"&&(N.top=D),g&&y==="bottom"&&(N.bottom=(N.bottom??24)+D),g&&y==="left"&&(N.left=(N.left??50)+B.width+10),g&&y==="right"&&(N.right=(N.right??20)+B.width+10);const{chartArea:C,width:M,height:P,margin:$}=Kr(l,N),F=Li(s,$);let V=e.labels;if(n.sortMode==="total"){const q=e.labels.map((X,j)=>({label:X,total:u.reduce((ce,ye)=>ce+(ye.values[j]??0),0)}));q.sort((X,j)=>j.total-X.total),V=q.map(X=>X.label)}const U=Zn().domain(V).range([0,P]).paddingInner(tc(n.barGap)).paddingOuter(.05),K=_?_6:0,ae=Math.max(0,U.bandwidth()-K),me=Zn().domain(d).range([0,ae]).padding(.05),de=Kd(u.flatMap(q=>q.values))??0,ve=Bn().domain([0,de]).nice().range([0,M]);a.attach(C,F),a.update({vertical:{scale:U,height:P,options:{...n.verticalAxis,labelPosition:_?on.Off:(ne=n.verticalAxis)==null?void 0:ne.labelPosition,topPadding:$.top}},horizontal:{scale:ve,height:P,options:{...n.horizontalAxis,width:M}},order:"horizontal-first"});const te=C.ownerSVGElement,pe=Di(te,t,"bars",{x:0,y:0,width:M,height:P}),we=Ae(C).append("g").attr("clip-path",`url(#${pe})`);if(n.barBackground){const q=(n.colors??Z1)[0];we.selectAll(".bc-bar-bg").data(V,X=>X).enter().append("rect").attr("class","bc-bar-bg").attr("x",0).attr("y",X=>(U(X)??0)+K).attr("width",M).attr("height",U.bandwidth()-K).attr("fill",q).attr("opacity",.18)}if(n.barSeparators&&V.length>1){const q=U.step();for(let X=1;X<V.length;X++){const j=(U(V[X-1])??0)+U.bandwidth()+(q-U.bandwidth())/2;we.append("line").attr("class","bc-bar-separator").attr("x1",0).attr("x2",M).attr("y1",j).attr("y2",j).attr("stroke","currentColor").attr("opacity",.15)}}const J=[];for(const q of V){const X=e.labels.indexOf(q);for(const j of u){const ce=c.findIndex(ye=>ye.name===j.name);J.push({label:q,seriesName:j.name,seriesIndex:ce,value:X>=0?j.values[X]??0:0})}}const ge=new $ne(we);ge.config({x:ve,y0:U,y1:me,colors:f,categoryLabelOffset:K});const re=Bu(n.highlights);if(r.length>0){const q=we.node().querySelector("g");Wo(q,r,(F==null?void 0:F.dx)??0,(F==null?void 0:F.dy)??0)}if(n.tooltips&&ge.use(Ka({numberFormat:(Q=n.verticalAxis)==null?void 0:Q.numberFormat})),n.crosshair&&ge.use(nc({width:M,height:P,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor,orientation:jn.Horizontal})),ge.draw(J),Jr(t,{chartType:"bar-grouped",margin:$}),i&&(Tr(we.node()),Or(t,i)),Ae(C).selectAll(".bc-bar-grouped").each(function(q){const X=q,j=an(X.seriesName,X.seriesIndex,f,h),ce=Lf(X.seriesName,h),ye=o?Ae(this).transition().duration(_t()):Ae(this);ye.attr("fill",j),ce<1&&ye.attr("fill-opacity",ce),re.size>0&&ye.attr("opacity",In(re,X.seriesName))}),_){const q=Ae(C).append("g").attr("class","bc-category-labels");for(const X of V){const j=U(X)??0;q.append("text").attr("class","bc-category-label").attr("x",2).attr("y",j+_6/2).attr("text-anchor","start").attr("dominant-baseline","central").attr("font-size","10px").attr("font-weight","600").attr("fill","currentColor").text(X)}}const oe=n.valueLabels??!0,he=n.valueLabelPosition??yt.Auto,I=Ae(C).append("g").attr("class","bc-value-labels");if(J.forEach(q=>{if(!Lu(q.seriesName,oe,h))return;const X=an(q.seriesName,q.seriesIndex,f,h),j=Math.max(0,ve(q.value)-ve(0)),ce=ve(0)+j,ye=(U(q.label)??0)+K+(me(q.seriesName)??0)+me.bandwidth()/2,ue=he===yt.Inside||he===yt.Auto&&j>30;let ke,Ie,Se;ue?(ke=ce-4,Ie="end",Se=Cr(X)):(ke=ce+4,Ie="start",Se="currentColor"),I.append("text").attr("class","bc-value-label").attr("data-series",q.seriesName).attr("x",ke).attr("y",ye).attr("text-anchor",Ie).attr("dominant-baseline","central").attr("font-size","11px").attr("fill",Se).text(String(q.value))}),g&&d.length>0){const q=d.map(ce=>{const ye=c.findIndex(ue=>ue.name===ce);return an(ce,ye,f,h)});let X=0,j=0;y==="top"?j=-(B.height+10):y==="bottom"?j=P+25:y==="left"?X=-(B.width+10):y==="right"&&(X=M+10),Xa(C,d,q,j,y,x,M,P,X,[],{left:$.left,right:$.right})}}const $2=new Map;function Go(t,e,n){$2.set(t,{renderer:e,options:n})}function Mne(t){var e;return(e=$2.get(t))==null?void 0:e.renderer}function cu(t){var e;return((e=$2.get(t))==null?void 0:e.options)??[]}const k6=[{value:Gn.Solid,text:"Solid"},{value:Gn.Dashed,text:"Dashed"},{value:Gn.Dotted,text:"Dotted"},{value:Gn.None,text:"None"}],qo={key:"colors",type:Ke.Colors,label:"Colors"},Yo={key:"colorPalette",type:Ke.Select,label:"Color palette",default:"Blueprint",choices:[{value:"",text:"Custom"},...e5().map(t=>({value:t.name,text:t.label}))]},jo={key:"autoContrast",type:Ke.Boolean,label:"Auto-adjust contrast",default:!1},Xo={key:"allowDarkMode",type:Ke.Boolean,label:"Allow dark mode",default:!0},Pu={key:"legend",type:Ke.Boolean,label:"Show legend",default:!0},ra={key:"legendPosition",type:Ke.Select,label:"Legend position",default:kc.Top,choices:[{value:kc.Top,text:"Top"},{value:kc.Bottom,text:"Bottom"},{value:kc.Left,text:"Left"},{value:kc.Right,text:"Right"}]},ia={key:"legendAnchor",type:Ke.Select,label:"Legend anchor",default:Ds.Start,choices:[{value:Ds.Start,text:"Start"},{value:Ds.Middle,text:"Middle"},{value:Ds.End,text:"End"}]},Ym={key:"directLabelling",type:Ke.Select,label:"Direct labelling",default:Co.Off,choices:[{value:Co.Off,text:"Off"},{value:Co.Auto,text:"Auto"},{value:Co.Outside,text:"Outside"},{value:Co.Inside,text:"Inside"}]},T2={key:"directLabelAnchor",type:Ke.Select,label:"Label anchor",default:Ds.Middle,choices:[{value:Ds.Start,text:"Start"},{value:Ds.Middle,text:"Middle"},{value:Ds.End,text:"End"}]},jm={key:"valueLabels",type:Ke.Boolean,label:"Value labels",default:!1},Xm={key:"valueLabelPosition",type:Ke.Select,label:"Label position",default:yt.Auto,choices:[{value:yt.Auto,text:"Auto"},{value:yt.Outside,text:"Outside"},{value:yt.Inside,text:"Inside"}]},sa={key:"tooltips",type:Ke.Boolean,label:"Tooltips",default:!1},A$={key:"crosshair",type:Ke.Boolean,label:"Crosshair",default:!1},C$={key:"crosshairDirection",type:Ke.Select,label:"Crosshair direction",default:Ao.Both,choices:[{value:Ao.Both,text:"Both"},{value:Ao.Vertical,text:"Vertical"},{value:Ao.Horizontal,text:"Horizontal"}]},$$={key:"crosshairStyle",type:Ke.Select,label:"Crosshair style",default:ci.Dashed,choices:[{value:ci.Solid,text:"Solid"},{value:ci.Dashed,text:"Dashed"},{value:ci.Dotted,text:"Dotted"}]},T$={key:"crosshairColor",type:Ke.Text,label:"Crosshair color",default:"#999",placeholder:"#999"},M$={key:"lineSymbols",type:Ke.Boolean,label:"Show line symbols",default:!1},O$={key:"lineSymbolShape",type:Ke.Select,label:"Symbol",default:mr.Circle,choices:[{value:mr.Circle,text:"Circle"},{value:mr.Square,text:"Square"},{value:mr.Diamond,text:"Diamond"},{value:mr.Triangle,text:"Triangle Up"},{value:mr.TriangleDown,text:"Triangle Down"},{value:mr.Cross,text:"Cross"},{value:mr.Star,text:"Star"}]},B$={key:"lineSymbolShowOn",type:Ke.Select,label:"Show on",default:vr.FirstLast,choices:[{value:vr.FirstLast,text:"First & Last"},{value:vr.First,text:"First"},{value:vr.Last,text:"Last"},{value:vr.All,text:"All"}]},L$={key:"lineSymbolStyle",type:Ke.Select,label:"Style",default:Ro.Filled,choices:[{value:Ro.Filled,text:"Filled"},{value:Ro.Hollow,text:"Hollow"}]},P$={key:"lineSymbolSize",type:Ke.Text,label:"Size",default:"3.5",placeholder:"3.5"},D$={key:"lineSymbolOpacity",type:Ke.Text,label:"Opacity",default:"1",placeholder:"1"},Pf={key:"sortMode",type:Ke.Select,label:"Sort mode",default:li.None,choices:[{value:li.None,text:"None"},{value:li.Total,text:"By total"},{value:li.WithinGroups,text:"Within groups"}]},Km={key:"edgePadding",type:Ke.Boolean,label:"Edge padding",default:!1},Zm={key:"waterfall",type:Ke.Boolean,label:"Waterfall",default:!1},Qm={key:"waterfallTotal",type:Ke.Boolean,label:"Waterfall total",default:!1},Df={key:"barBackground",type:Ke.Boolean,label:"Bar background",default:!1},Jm={key:"barGap",type:Ke.Text,label:"Bar gap",default:String(nf),placeholder:String(nf)},Ef={key:"barSeparators",type:Ke.Boolean,label:"Bar separators",default:!1},eg={key:"connectedColumns",type:Ke.Boolean,label:"Connected columns",default:!1},tg={key:"connectionsOpacity",type:Ke.Text,label:"Opacity",default:"0.15",placeholder:"0.15"},ng={key:"swapLabelValue",type:Ke.Boolean,label:"Swap labels and values",default:!1},E$={key:"stackMode",type:Ke.Select,label:"Stack mode",default:Cl.Normal,choices:[{value:Cl.Normal,text:"Normal"},{value:Cl.Percent,text:"Percentage (100%)"}]},One={key:"sharedScale",type:Ke.Boolean,label:"Shared scale",default:!1},rc={key:"categoryLabelLine",type:Ke.Boolean,label:"Labels on separate line",default:!1},I$={key:"displayAsPercentage",type:Ke.Boolean,label:"Display as percentage",default:!1},N$={key:"showTotal",type:Ke.Boolean,label:"Show total",default:!1},R$={key:"showLabels",type:Ke.Boolean,label:"Show labels",default:!0},F$={key:"showValues",type:Ke.Boolean,label:"Show values",default:!0},V$={key:"sliceMax",type:Ke.Text,label:"Max slices",default:"6"},z$={key:"sliceGroupLabel",type:Ke.Text,label:"Group label",default:"Others",placeholder:"Others"},Bne={key:"areaFillOpacity",type:Ke.Text,label:"Opacity",default:"0.85",placeholder:"0.85"},Lne={key:"stacked",type:Ke.Boolean,label:"Stack areas",default:!0},Pne={key:"stackPercent",type:Ke.Boolean,label:"Stack to 100%",default:!1},Dne={key:"areaLines",type:Ke.Boolean,label:"Separate areas with lines",default:!0},Ene={key:"areaSortMode",type:Ke.Select,label:"Sort areas",default:Qt.None,choices:[{value:Qt.None,text:"Keep order"},{value:Qt.Ascending,text:"Smallest first"},{value:Qt.Descending,text:"Largest first"}]},Ine={key:"interpolation",type:Ke.Select,label:"Line interpolation",default:oi.Linear,choices:[{value:oi.Linear,text:"Linear"},{value:oi.MonotoneX,text:"Monotone"},{value:oi.Step,text:"Step"},{value:oi.StepBefore,text:"Step (before)"},{value:oi.StepAfter,text:"Step (after)"},{value:oi.Basis,text:"Basis"},{value:oi.Cardinal,text:"Cardinal"},{value:oi.CatmullRom,text:"Catmull-Rom"}]},S6=[{value:ou.Linear,text:"Linear"},{value:ou.Log,text:"Logarithmic"}],A6=[{value:on.Auto,text:"Auto"},{value:on.Inside,text:"Inside"},{value:on.Outside,text:"Outside"},{value:on.Off,text:"Off"}],Nne=[{value:Td.Auto,text:"Auto"},{value:Td.Horizontal,text:"Horizontal"},{value:Td.Vertical,text:"Vertical"}];function If(t){return[{key:"showVerticalAxis",type:Ke.Boolean,label:"Show vertical axis",default:t.showVerticalAxis??!0},{key:"verticalAxisDirection",type:Ke.Select,label:"Vertical axis side",default:ri.Left,choices:[{value:ri.Left,text:"Left"},{value:ri.Right,text:"Right"}]},{key:"showVerticalTicks",type:Ke.Boolean,label:"Show vertical ticks",default:t.showVerticalTicks},{key:"verticalLabelPosition",type:Ke.Select,label:"Vertical labels",default:on.Auto,choices:A6},{key:"verticalGridStyle",type:Ke.Select,label:"Vertical grid style",default:t.verticalGrid,choices:k6},{key:"verticalNumberFormat",type:Ke.NumberFormat,label:"Vertical number format"},...t.valueAxis==="vertical"?[{key:"verticalScaleType",type:Ke.Select,label:"Vertical scale",default:ou.Linear,choices:S6},t.valueAxisZeroBaseline?{key:"verticalRangeMin",type:Ke.Text,label:"Vertical min",default:"0",placeholder:"auto"}:{key:"verticalRangeMin",type:Ke.Text,label:"Vertical min",placeholder:"auto"},{key:"verticalRangeMax",type:Ke.Text,label:"Vertical max",placeholder:"auto"}]:[],{key:"showHorizontalAxis",type:Ke.Boolean,label:"Show horizontal axis",default:!0},{key:"showHorizontalTicks",type:Ke.Boolean,label:"Show horizontal ticks",default:t.showHorizontalTicks},{key:"horizontalLabelPosition",type:Ke.Select,label:"Horizontal labels",default:on.Auto,choices:A6},{key:"horizontalLabelRotation",type:Ke.Select,label:"Horizontal label rotation",default:Td.Horizontal,choices:Nne},{key:"horizontalGridStyle",type:Ke.Select,label:"Horizontal grid style",default:t.horizontalGrid,choices:k6},{key:"horizontalNumberFormat",type:Ke.NumberFormat,label:"Horizontal number format"},...t.valueAxis==="horizontal"?[{key:"horizontalScaleType",type:Ke.Select,label:"Horizontal scale",default:ou.Linear,choices:S6},t.valueAxisZeroBaseline?{key:"horizontalRangeMin",type:Ke.Text,label:"Horizontal min",default:"0",placeholder:"auto"}:{key:"horizontalRangeMin",type:Ke.Text,label:"Horizontal min",placeholder:"auto"},{key:"horizontalRangeMax",type:Ke.Text,label:"Horizontal max",placeholder:"auto"}]:[],...t.horizontalRange?[{key:"horizontalRangeMin",type:Ke.Text,label:"Horizontal min",placeholder:"auto"},{key:"horizontalRangeMax",type:Ke.Text,label:"Horizontal max",placeholder:"auto"}]:[]]}const og=If({verticalGrid:Gn.Dashed,horizontalGrid:Gn.None,showVerticalTicks:!1,showHorizontalTicks:!1,showVerticalAxis:!1,valueAxis:"vertical",valueAxisZeroBaseline:!0}),Nf=If({verticalGrid:Gn.None,horizontalGrid:Gn.Dashed,showVerticalTicks:!1,showHorizontalTicks:!1,valueAxis:"horizontal",valueAxisZeroBaseline:!0}),H$=If({verticalGrid:Gn.Dashed,horizontalGrid:Gn.None,showVerticalTicks:!1,showHorizontalTicks:!1,showVerticalAxis:!1,valueAxis:"vertical",horizontalRange:!0}),Rne=If({verticalGrid:Gn.Dashed,horizontalGrid:Gn.None,showVerticalTicks:!1,showHorizontalTicks:!1,showVerticalAxis:!1,valueAxis:"vertical",horizontalRange:!0,valueAxisZeroBaseline:!0}),rg={...Ine,default:oi.MonotoneX},Fne={...C$,default:Ao.Vertical},Vne={...A$,default:!0},zne={...M$,default:!0},W$={...Pf,default:li.Total},M2={...jm,default:!0},Hne={...I$,default:!0},Wne={...V$,default:"5"},Une={...N$,default:!0},ig={...Ym,default:Co.Auto},sg={...Pu,default:!1},ag=[A$,C$,$$,T$],O2=[Vne,Fne,$$,T$],lg=[jm,Xm,sa,...ag],B2=[M2,Xm,sa,...ag],Gne=[M$,O$,B$,L$,P$,D$],qne=[zne,O$,B$,L$,P$,D$],U$=[jm,sa,...O2,...Gne],Yne=[jm,sa,...O2,...qne],jne=[Hne,N$,R$,F$,Wne,z$],Xne=[I$,Une,R$,F$,V$,z$];Go(Le.BarVertical,a$,[qo,Yo,jo,Xo,ng,Df,Ef,Jm,eg,tg,Zm,Qm,rc,...og,...lg]);Go(Le.BarHorizontal,l$,[qo,Yo,jo,Xo,ng,Df,Ef,Jm,eg,tg,Zm,Qm,rc,...Nf,...B2]);Go(Le.BarMulti,Yte,[qo,Yo,jo,Xo,W$,sg,ia,ra,ig,T2,...og,...lg]);Go(Le.Line,tne,[qo,Yo,jo,Xo,rg,Km,...H$,...U$]);Go(Le.LineMulti,ine,[qo,Yo,jo,Xo,rg,Km,Pf,sg,ia,ra,ig,...H$,...Yne]);Go(Le.Donut,dne,[qo,Yo,jo,Xo,sg,ia,ra,ig,sa,...Xne]);Go(Le.Pie,fne,[qo,Yo,jo,Xo,sg,ia,ra,ig,sa,...jne]);Go(Le.Area,pne,[qo,Yo,jo,Xo,rg,Km,...Rne,...U$]);const Kne=If({verticalGrid:Gn.Dashed,horizontalGrid:Gn.None,showVerticalTicks:!1,showHorizontalTicks:!1,showVerticalAxis:!1,valueAxis:"vertical",horizontalRange:!0,valueAxisZeroBaseline:!0});Go(Le.AreaStacked,gne,[qo,Yo,jo,Xo,Bne,rg,Km,Ene,Lne,Pne,Dne,Pu,ia,ra,Ym,...Kne,sa,...O2]);Go(Le.ColumnStacked,yne,[qo,Yo,jo,Xo,E$,Pf,Pu,ia,ra,Ym,T2,...og,...lg]);Go(Le.BarStacked,_ne,[qo,Yo,jo,Xo,E$,Pf,Pu,ia,ra,Ym,T2,rc,...Nf,...B2]);Go(Le.BarSplit,Cne,[qo,Yo,jo,Xo,One,Pf,Pu,ia,ra,rc,...Nf,M2,Xm,sa,...ag]);Go(Le.BarGrouped,Tne,[qo,Yo,jo,Xo,W$,Pu,ia,ra,Df,Ef,rc,...Nf,M2,Xm,sa,...ag]);Go(Le.VerticalBar,a$,[qo,Yo,jo,Xo,ng,Df,Ef,Jm,eg,tg,Zm,Qm,rc,...og,...lg]);Go(Le.HorizontalBar,l$,[qo,Yo,jo,Xo,ng,Df,Ef,Jm,eg,tg,Zm,Qm,rc,...Nf,...B2]);function C6(t){const e=t==null?void 0:t.trim();if(!e)return;const n=Number.parseFloat(e);return Number.isFinite(n)?n:void 0}function hs(t){var i;const e=t.split(`
|
|
80
|
+
`).map(s=>s.trim()).filter(Boolean),n=[],o=[],r=(i=e[0])==null?void 0:i.match(/^_series\s*=\s*(.+)$/);if(r){const s=r[1].trim(),a=s.includes('","')?s.split(",").map(u=>u.trim().replace(/^"|"$/g,"")):s.replace(/^"|"$/g,"").split(",").map(u=>u.trim()),l=a.map(()=>[]);for(let u=1;u<e.length;u++){const d=e[u].match(/^"([^"]+)"\s*=\s*([^"]+)$/),h=e[u].match(/^"([^"]+)"\s*=\s*"([^"]*)"$/)??d;if(h){n.push(h[1]);const g=h[2].split(",");for(let v=0;v<a.length;v++)l[v].push(C6(g[v]))}}const c=a.map((u,d)=>({name:u,values:l[d]}));return{labels:n,values:l[0]??[],series:c}}for(const s of e){const a=s.match(/^"([^"]+)"\s*=\s*(.+)$/);a&&(n.push(a[1]),o.push(C6(a[2])))}return{labels:n,values:o}}function Zne(t,e){const n={},o=JC(t.colorPalette);return o?n.colors=o:t.colors&&t.colors.length>0&&(n.colors=t.colors),t.autoContrast&&e&&n.colors&&(n.colors=r$(n.colors,e)),t.allowDarkMode!==void 0&&(n.allowDarkMode=t.allowDarkMode),n}function Qne(t){const e={};return t.legend!==void 0&&(e.legend=t.legend),t.legendPosition!==void 0&&(e.legendPosition=t.legendPosition),t.legendAnchor!==void 0&&(e.legendAnchor=t.legendAnchor),t.directLabelling!==void 0&&(e.directLabelling=t.directLabelling),t.directLabelAnchor!==void 0&&(e.directLabelAnchor=t.directLabelAnchor),e}function Jne(t){if(!(t.showVerticalTicks!==void 0||t.verticalGridStyle!==void 0||t.verticalNumberFormat!==void 0||t.showVerticalAxis!==void 0||t.verticalAxisDirection!==void 0||t.verticalScaleType!==void 0||t.verticalLabelPosition!==void 0||t.verticalRangeMin||t.verticalRangeMax))return{};const n={};t.showVerticalTicks!==void 0&&(n.showTicks=t.showVerticalTicks),t.verticalAxisDirection!==void 0&&(n.direction=t.verticalAxisDirection),t.verticalGridStyle!==void 0&&(n.gridStyle=t.verticalGridStyle),t.verticalNumberFormat!==void 0&&(n.numberFormat=t.verticalNumberFormat),t.showVerticalAxis!==void 0&&(n.showAxis=t.showVerticalAxis),t.verticalScaleType!==void 0&&(n.scaleType=t.verticalScaleType),t.verticalLabelPosition!==void 0&&(n.labelPosition=t.verticalLabelPosition);const o=tf(t.verticalRangeMin??""),r=tf(t.verticalRangeMax??"");return(o!==void 0||r!==void 0)&&(n.range={},o!==void 0&&(n.range.min=o),r!==void 0&&(n.range.max=r)),{verticalAxis:n}}function eoe(t){if(!(t.showHorizontalTicks!==void 0||t.horizontalGridStyle!==void 0||t.horizontalNumberFormat!==void 0||t.showHorizontalAxis!==void 0||t.horizontalScaleType!==void 0||t.horizontalLabelPosition!==void 0||t.horizontalLabelRotation!==void 0||t.horizontalRangeMin||t.horizontalRangeMax))return{};const n={};t.showHorizontalTicks!==void 0&&(n.showTicks=t.showHorizontalTicks),t.horizontalGridStyle!==void 0&&(n.gridStyle=t.horizontalGridStyle),t.horizontalNumberFormat!==void 0&&(n.numberFormat=t.horizontalNumberFormat),t.showHorizontalAxis!==void 0&&(n.showAxis=t.showHorizontalAxis),t.horizontalScaleType!==void 0&&(n.scaleType=t.horizontalScaleType),t.horizontalLabelPosition!==void 0&&(n.labelPosition=t.horizontalLabelPosition),t.horizontalLabelRotation!==void 0&&(n.labelRotation=t.horizontalLabelRotation);const o=tf(t.horizontalRangeMin??""),r=tf(t.horizontalRangeMax??"");return(o!==void 0||r!==void 0)&&(n.range={},o!==void 0&&(n.range.min=o),r!==void 0&&(n.range.max=r)),{horizontalAxis:n}}function toe(t){return t.lineSymbols?{lineSymbols:{symbol:t.lineSymbolShape??mr.Circle,showOn:t.lineSymbolShowOn??vr.FirstLast,style:t.lineSymbolStyle??Ro.Filled,size:parseFloat(t.lineSymbolSize??"3.5")||3.5,opacity:parseFloat(t.lineSymbolOpacity??"1")||1}}:{}}function G$(t,e){const n={...Zne(t,e),...Qne(t),...Jne(t),...eoe(t),...toe(t)};t.interpolation!==void 0&&(n.interpolation=t.interpolation),t.valueLabels!==void 0&&(n.valueLabels=t.valueLabels),t.valueLabelPosition!==void 0&&(n.valueLabelPosition=t.valueLabelPosition),t.tooltips!==void 0&&(n.tooltips=t.tooltips),t.crosshair!==void 0&&(n.crosshair=t.crosshair),t.crosshairDirection&&(n.crosshairDirection=t.crosshairDirection),t.crosshairStyle&&(n.crosshairStyle=t.crosshairStyle),t.crosshairColor&&(n.crosshairColor=t.crosshairColor),t.displayAsPercentage!==void 0&&(n.displayAsPercentage=t.displayAsPercentage),t.showTotal!==void 0&&(n.showTotal=t.showTotal),t.showLabels!==void 0&&(n.showLabels=t.showLabels),t.showValues!==void 0&&(n.showValues=t.showValues),t.swapLabelValue!==void 0&&(n.swapLabelValue=t.swapLabelValue);const o=parseInt(t.sliceMax??"",10);!isNaN(o)&&o>0&&(n.sliceMax=o),t.sliceGroupLabel!==void 0&&(n.sliceGroupLabel=t.sliceGroupLabel),t.barBackground!==void 0&&(n.barBackground=t.barBackground),t.barSeparators!==void 0&&(n.barSeparators=t.barSeparators);const r=parseFloat(t.barGap??"");isNaN(r)||(n.barGap=Math.max(0,Math.min(100,r))),t.connectedColumns!==void 0&&(n.connectedColumns=t.connectedColumns);const i=parseFloat(t.connectionsOpacity??"");isNaN(i)||(n.connectionsOpacity=Math.max(0,Math.min(1,i))),t.stackMode!==void 0&&(n.stackMode=t.stackMode),t.stacked!==void 0&&(n.stacked=t.stacked),t.stackPercent!==void 0&&(n.stackPercent=t.stackPercent),t.areaSortMode!==void 0&&(n.areaSortMode=t.areaSortMode),t.areaLines!==void 0&&(n.areaLines=t.areaLines);const s=parseFloat(t.areaFillOpacity??"");return isNaN(s)||(n.areaFillOpacity=s),t.edgePadding!==void 0&&(n.edgePadding=t.edgePadding),t.waterfall!==void 0&&(n.waterfall=t.waterfall),t.waterfallTotal!==void 0&&(n.waterfallTotal=t.waterfallTotal),t.categoryLabelLine!==void 0&&(n.categoryLabelLine=t.categoryLabelLine),n}const noe={[Le.BarVertical]:"Vertical Bar Chart",[Le.BarHorizontal]:"Horizontal Bar Chart",[Le.BarMulti]:"Grouped Bar Chart",[Le.Line]:"Line Chart",[Le.LineMulti]:"Multi-Line Chart",[Le.Pie]:"Pie Chart",[Le.Donut]:"Donut Chart"};function ooe(t,e){if(t.length===0)return[];const n=t.filter(a=>a==="string").length,o=t.filter(a=>a==="number").length,r=t.filter(a=>a==="date").length,i=[],s=(a,l,c)=>i.push({chartType:a,label:noe[a]??a,fitness:l,reason:c});return r===1&&o>=1?o===1?(s(Le.Line,"best","1 date + 1 numeric column — ideal for trend"),s(Le.BarVertical,"alternative","Can also show as bars")):(s(Le.LineMulti,"best",`1 date + ${o} numeric columns — compare trends`),s(Le.BarMulti,"alternative","Can also show as grouped bars")):n===1&&o===1?(s(Le.BarVertical,"best","1 categorical + 1 numeric — classic bar chart"),s(Le.BarHorizontal,"good","Horizontal bars work well for long labels"),e<=8&&(s(Le.Donut,"good",`${e} items — suitable for part-of-whole`),s(Le.Pie,"alternative","Pie chart for part-of-whole"))):n===1&&o>1?(s(Le.BarMulti,"best",`1 categorical + ${o} numeric columns — compare groups`),s(Le.LineMulti,"good","Can also show as multi-line chart")):o>=1&&(n>=1||r>=1)&&s(Le.BarVertical,"good","Default bar chart recommendation"),i}const Sv=Object.create(null);function q$(t){if(!Sv[t]){const e={};for(const n of cu(t))n.default!==void 0&&(e[n.key]=n.default);Sv[t]=e}return Sv[t]}function d0(t,e){var r;const n=q$(t);return((r=e.colors)==null?void 0:r.length)?{...n,colorPalette:void 0,...e}:{...n,...e}}const roe={protanopia:"Protanopia (no red)",deuteranopia:"Deuteranopia (no green)",tritanopia:"Tritanopia (no blue)"},Y$={protanopia:[.152286,1.052583,-.204868,0,0,.114503,.786281,.099216,0,0,-.003882,-.048116,1.051998,0,0,0,0,0,1,0],deuteranopia:[.367322,.860646,-.227968,0,0,.280085,.672501,.047413,0,0,-.01182,.04294,.968881,0,0,0,0,0,1,0],tritanopia:[1.255528,-.076749,-.178779,0,0,-.078411,.930809,.147602,0,0,.004733,.691367,.3039,0,0,0,0,0,1,0]};function j$(t){return`bc-cvd-${t}`}function ioe(t){const e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"filter");n.setAttribute("id",j$(t)),n.setAttribute("color-interpolation-filters","linearRGB");const o=document.createElementNS(e,"feColorMatrix");return o.setAttribute("type","matrix"),o.setAttribute("values",Y$[t].join(" ")),n.appendChild(o),n}function soe(t){return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function Av(t){return t<=.0031308?12.92*t:1.055*t**(1/2.4)-.055}function aoe(t,e){const[n,o,r]=nt(t).rgb().map(u=>soe(u/255)),i=Y$[e],s=Av(i[0]*n+i[1]*o+i[2]*r),a=Av(i[5]*n+i[6]*o+i[7]*r),l=Av(i[10]*n+i[11]*o+i[12]*r),c=u=>Math.min(255,Math.max(0,Math.round(u*255)));return nt(c(s),c(a),c(l)).hex()}const loe=10;function coe(t){if(t.length<2)return[];const e=["protanopia","deuteranopia","tritanopia"],n=[];for(const o of e){const r=t.map(s=>aoe(s,o)),i=[];for(let s=0;s<r.length;s++)for(let a=s+1;a<r.length;a++){const l=nt.deltaE(r[s],r[a]);l<loe&&i.push({a:t[s],b:t[a],deltaE:l})}i.length>0&&n.push({type:o,label:roe[o],pairs:i})}return n}function uoe(t){const e={properties:[],data:null,colorizes:[],highlights:[],areaFills:[],annotations:[],annotationVisibility:[],series:[],scenes:[],transforms:[]};for(const n of t)switch(n.type){case"property":e.properties.push(n);break;case"data":if(e.data!==null)throw new SyntaxError("duplicate data block");e.data=n;break;case"colorize":e.colorizes.push(n);break;case"highlight":e.highlights.push(n);break;case"areafill":e.areaFills.push(n);break;case"annotation":e.annotations.push(n);break;case"annotation-visibility":e.annotationVisibility.push(n);break;case"series":e.series.push(n);break;case"scene":e.scenes.push(n);break;case"transform":e.transforms.push(n);break}return e}function doe(t){const e={properties:[],data:null,colorizes:[],highlights:[],areaFills:[],annotations:[],annotationVisibility:[],series:[],transforms:[]};for(const n of t)switch(n.type){case"property":e.properties.push(n);break;case"data":if(e.data!==null)throw new SyntaxError("duplicate data block");e.data=n;break;case"colorize":e.colorizes.push(n);break;case"highlight":e.highlights.push(n);break;case"areafill":e.areaFills.push(n);break;case"annotation":e.annotations.push(n);break;case"annotation-visibility":e.annotationVisibility.push(n);break;case"series":e.series.push(n);break;case"transform":e.transforms.push(n);break}return e}function foe(t,e){function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n}function Ml(t,e,n,o){var r=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(r,Ml.prototype),r.expected=e,r.found=n,r.location=o,r.name="SyntaxError",r}foe(Ml,Error);function Cv(t,e,n){return n=n||" ",t.length>e?t:(e-=t.length,n+=n.repeat(e),t+n.slice(0,e))}Ml.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var n=null,o;for(o=0;o<t.length;o++)if(t[o].source===this.location.source){n=t[o].text.split(/\r\n|\n|\r/g);break}var r=this.location.start,i=this.location.source&&typeof this.location.source.offset=="function"?this.location.source.offset(r):r,s=this.location.source+":"+i.line+":"+i.column;if(n){var a=this.location.end,l=Cv("",i.line.toString().length," "),c=n[r.line-1],u=r.line===a.line?a.column:c.length+1,d=u-r.column||1;e+=`
|
|
81
|
+
--> `+s+`
|
|
82
|
+
`+l+` |
|
|
83
|
+
`+i.line+" | "+c+`
|
|
84
|
+
`+l+" | "+Cv("",r.column-1," ")+Cv("",d,"^")}else e+=`
|
|
85
|
+
at `+s}return e};Ml.buildMessage=function(t,e){var n={literal:function(c){return'"'+r(c.text)+'"'},class:function(c){var u=c.parts.map(function(d){return Array.isArray(d)?i(d[0])+"-"+i(d[1]):i(d)});return"["+(c.inverted?"^":"")+u.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(c){return c.description}};function o(c){return c.charCodeAt(0).toString(16).toUpperCase()}function r(c){return c.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(u){return"\\x0"+o(u)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(u){return"\\x"+o(u)})}function i(c){return c.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(u){return"\\x0"+o(u)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(u){return"\\x"+o(u)})}function s(c){return n[c.type](c)}function a(c){var u=c.map(s),d,f;if(u.sort(),u.length>0){for(d=1,f=1;d<u.length;d++)u[d-1]!==u[d]&&(u[f]=u[d],f++);u.length=f}switch(u.length){case 1:return u[0];case 2:return u[0]+" or "+u[1];default:return u.slice(0,-1).join(", ")+", or "+u[u.length-1]}}function l(c){return c?'"'+r(c)+'"':"end of input"}return"Expected "+a(t)+" but "+l(e)+" found."};function hoe(t,e){e=e!==void 0?e:{};var n={},o=e.grammarSource,r={Chart:wx},i=wx,s="chart",a="{",l="}",c="data",u="=",d=",",f=" ",h="colorize",g="highlight",v="areafill",m="annotation",b="range",y="note",x="series",_="scene",k="step",E="transform",L="hide_annotation",S="hide_range",B="hide_note",D="show_annotation",N="show_range",C="show_note",M="%",P="-",$=".",F='"',V="\\",U="n",K="r",ae="t",me="u",de="//",ve="/*",te="*/",pe=/^[^\t\n\r{}=]/,we=/^[a-zA-Z_#]/,J=/^[a-zA-Z0-9_#\-]/,ge=/^[0-9]/,re=/^[eE]/,oe=/^[+\-]/,he=/^[^"\\]/,I=/^[0-9a-fA-F]/,G=/^[^\n]/,Y=/^[ \t\n\r]/,se=Nt("chart",!1),fe=Nt("{",!1),ne=Nt("}",!1),Q=Nt("data",!1),q=Nt("=",!1),X=Nt(",",!1),j=Nt(" ",!1),ce=Ni([" ",`
|
|
86
|
+
`,"\r","{","}","="],!0,!1),ye=Nt("colorize",!1),ue=Nt("highlight",!1),ke=Nt("areafill",!1),Ie=Nt("annotation",!1),Se=Nt("range",!1),Be=Nt("note",!1),Ze=Nt("series",!1),ot=Nt("scene",!1),pt=Nt("step",!1),Tt=Nt("transform",!1),Jt=Nt("hide_annotation",!1),pn=Nt("hide_range",!1),Et=Nt("hide_note",!1),Ft=Nt("show_annotation",!1),dn=Nt("show_range",!1),Sn=Nt("show_note",!1),Jn=Nt("%",!1),Pr=Gf("identifier"),tt=Ni([["a","z"],["A","Z"],"_","#"],!1,!1),$e=Ni([["a","z"],["A","Z"],["0","9"],"_","#","-"],!1,!1),Qe=Nt("-",!1),Fe=Nt(".",!1),at=Ni([["0","9"]],!1,!1),ln=Ni(["e","E"],!1,!1),Yn=Ni(["+","-"],!1,!1),Po=Gf("string"),zn=Nt('"',!1),Zo=Nt("\\",!1),Dr=Ni(['"',"\\"],!0,!1),ps=Nt("n",!1),Ge=Nt("r",!1),lt=Nt("t",!1),Ot=Nt("u",!1),It=Ni([["0","9"],["a","f"],["A","F"]],!1,!1),Ln=ZB(),eo=Nt("//",!1),Er=Ni([`
|
|
87
|
+
`],!0,!1),sc=Nt("/*",!1),aa=Nt("*/",!1),la=Gf("whitespace"),ac=Ni([" "," ",`
|
|
88
|
+
`,"\r"],!1,!1),cB=Gf("optional whitespace"),uB=function(O,W){const _e=uoe(W);return{type:"chart",chartType:O,properties:_e.properties,data:_e.data,colorizes:_e.colorizes,highlights:_e.highlights,areaFills:_e.areaFills,annotations:_e.annotations,annotationVisibility:_e.annotationVisibility,series:_e.series,scenes:_e.scenes,transforms:_e.transforms}},dB=function(O){return O},fB=function(O){return{type:"data",entries:O}},yx=function(O,W,_e){return _e},hB=function(O,W,_e){const xe=[W,..._e];return{type:"property",key:O,value:xe[0].value,isPercentage:!1,values:xe.map(Pe=>Pe.value)}},pB=function(O){return O},mB=function(O,W){return{type:"property",key:O,value:W.value,isPercentage:W.isPercentage}},gB=function(O){return O.trim()},vB=function(O,W){return{type:"colorize",target:O,properties:W}},bB=function(O,W){return{type:"colorize",target:O,properties:W,fromHighlight:!0}},yB=function(O){return{type:"highlight",target:O,properties:[]}},xB=function(O,W,_e){return{type:"areafill",from:O,to:W,properties:_e}},wB=function(O,W){return{type:"annotation",kind:"point",target:O,properties:W}},_B=function(O){return{type:"annotation",kind:"range",properties:O}},kB=function(O){return{type:"annotation",kind:"free",properties:O}},SB=function(O,W){return{type:"series",name:O,properties:W}},AB=function(O,W){const _e=doe(W);return{type:"scene",name:O??null,properties:_e.properties,data:_e.data,colorizes:_e.colorizes,highlights:_e.highlights,areaFills:_e.areaFills,annotations:_e.annotations,annotationVisibility:_e.annotationVisibility,series:_e.series,transforms:_e.transforms}},CB=function(O,W){return{type:"transform",transformType:O,properties:W}},$B=function(O){return{type:"annotation-visibility",action:"hide",kind:"point",id:O}},TB=function(O){return{type:"annotation-visibility",action:"hide",kind:"range",id:O}},MB=function(O){return{type:"annotation-visibility",action:"hide",kind:"free",id:O}},OB=function(O){return{type:"annotation-visibility",action:"show",kind:"point",id:O}},BB=function(O){return{type:"annotation-visibility",action:"show",kind:"range",id:O}},LB=function(O){return{type:"annotation-visibility",action:"show",kind:"free",id:O}},PB=function(O){return O},DB=function(O){return O},EB=function(O,W){return{type:"property",key:O,value:W.value,isPercentage:W.isPercentage}},IB=function(O){return{value:O,isPercentage:!0}},NB=function(O){return{value:O,isPercentage:!1}},RB=function(O){return{value:O,isPercentage:!1}},FB=function(O){return{value:O,isPercentage:!1}},VB=function(O){return parseFloat(O)},zB=function(O){return O.join("")},HB=function(O){return O},WB=function(){return'"'},UB=function(){return"\\"},GB=function(){return`
|
|
89
|
+
`},qB=function(){return"\r"},YB=function(){return" "},jB=function(O){return String.fromCharCode(parseInt(O,16))},XB=function(O){KB("Unknown escape sequence \\"+O)},z=e.peg$currPos|0,xt=z,lc=[{line:1,column:1}],ti=z,Uf=e.peg$maxFailExpected||[],De=e.peg$silentFails|0,Iu;if(e.startRule){if(!(e.startRule in r))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');i=r[e.startRule]}function KB(O,W){throw W=W!==void 0?W:$g(xt,z),JB(O,W)}function Nt(O,W){return{type:"literal",text:O,ignoreCase:W}}function Ni(O,W,_e){return{type:"class",parts:O,inverted:W,ignoreCase:_e}}function ZB(){return{type:"any"}}function QB(){return{type:"end"}}function Gf(O){return{type:"other",description:O}}function xx(O){var W=lc[O],_e;if(W)return W;if(O>=lc.length)_e=lc.length-1;else for(_e=O;!lc[--_e];);for(W=lc[_e],W={line:W.line,column:W.column};_e<O;)t.charCodeAt(_e)===10?(W.line++,W.column=1):W.column++,_e++;return lc[O]=W,W}function $g(O,W,_e){var xe=xx(O),Pe=xx(W),Ee={source:o,start:{offset:O,line:xe.line,column:xe.column},end:{offset:W,line:Pe.line,column:Pe.column}};return Ee}function Ne(O){z<ti||(z>ti&&(ti=z,Uf=[]),Uf.push(O))}function JB(O,W){return new Ml(O,null,null,W)}function e9(O,W,_e){return new Ml(Ml.buildMessage(O,W),O,W,_e)}function wx(){var O,W,_e,xe,Pe,Ee,Ue,rt;if(O=z,dt(),t.substr(z,5)===s?(W=s,z+=5):(W=n,De===0&&Ne(se)),W!==n)if(_e=fo(),_e!==n)if(xe=Yf(),xe!==n)if(dt(),t.charCodeAt(z)===123?(Pe=a,z++):(Pe=n,De===0&&Ne(fe)),Pe!==n){for(dt(),Ee=[],Ue=_x();Ue!==n;)Ee.push(Ue),Ue=_x();Ue=dt(),t.charCodeAt(z)===125?(rt=l,z++):(rt=n,De===0&&Ne(ne)),rt!==n?(dt(),xt=O,O=uB(xe,Ee)):(z=O,O=n)}else z=O,O=n;else z=O,O=n;else z=O,O=n;else z=O,O=n;return O}function _x(){var O,W;return O=z,dt(),W=kx(),W===n&&(W=Cx(),W===n&&(W=$x(),W===n&&(W=Tx(),W===n&&(W=Ox(),W===n&&(W=Bx(),W===n&&(W=Mx(),W===n&&(W=Dx(),W===n&&(W=Ex(),W===n&&(W=Ix(),W===n&&(W=Nx(),W===n&&(W=Rx(),W===n&&(W=Fx(),W===n&&(W=Lx(),W===n&&(W=n9(),W===n&&(W=Px(),W===n&&(W=qf())))))))))))))))),W!==n?(dt(),xt=O,O=dB(W)):(z=O,O=n),O}function kx(){var O,W,_e,xe,Pe,Ee;if(O=z,t.substr(z,4)===c?(W=c,z+=4):(W=n,De===0&&Ne(Q)),W!==n)if(dt(),t.charCodeAt(z)===123?(_e=a,z++):(_e=n,De===0&&Ne(fe)),_e!==n){for(dt(),xe=[],Pe=Ax(),Pe===n&&(Pe=Sx());Pe!==n;)xe.push(Pe),Pe=Ax(),Pe===n&&(Pe=Sx());Pe=dt(),t.charCodeAt(z)===125?(Ee=l,z++):(Ee=n,De===0&&Ne(ne)),Ee!==n?(xt=O,O=fB(xe)):(z=O,O=n)}else z=O,O=n;else z=O,O=n;return O}function Sx(){var O,W,_e,xe,Pe,Ee,Ue,rt;if(O=z,dt(),W=zx(),W!==n)if(dt(),t.charCodeAt(z)===61?(_e=u,z++):(_e=n,De===0&&Ne(q)),_e!==n)if(dt(),xe=Nu(),xe!==n){if(Pe=[],Ee=z,t.charCodeAt(z)===44?(Ue=d,z++):(Ue=n,De===0&&Ne(X)),Ue!==n?(dt(),rt=Nu(),rt!==n?(xt=Ee,Ee=yx(W,xe,rt)):(z=Ee,Ee=n)):(z=Ee,Ee=n),Ee!==n)for(;Ee!==n;)Pe.push(Ee),Ee=z,t.charCodeAt(z)===44?(Ue=d,z++):(Ue=n,De===0&&Ne(X)),Ue!==n?(dt(),rt=Nu(),rt!==n?(xt=Ee,Ee=yx(W,xe,rt)):(z=Ee,Ee=n)):(z=Ee,Ee=n);else Pe=n;Pe!==n?(Ee=dt(),xt=O,O=hB(W,xe,Pe)):(z=O,O=n)}else z=O,O=n;else z=O,O=n;else z=O,O=n;return O===n&&(O=z,dt(),W=qf(),W!==n?(dt(),xt=O,O=pB(W)):(z=O,O=n)),O}function Ax(){var O,W,_e,xe;return O=z,dt(),W=t9(),W!==n?(t.charCodeAt(z)===9?(_e=f,z++):(_e=n,De===0&&Ne(j)),_e!==n?(dt(),xe=Nu(),xe!==n?(dt(),xt=O,O=mB(W,xe)):(z=O,O=n)):(z=O,O=n)):(z=O,O=n),O}function t9(){var O,W,_e,xe;if(O=z,W=z,_e=[],xe=t.charAt(z),pe.test(xe)?z++:(xe=n,De===0&&Ne(ce)),xe!==n)for(;xe!==n;)_e.push(xe),xe=t.charAt(z),pe.test(xe)?z++:(xe=n,De===0&&Ne(ce));else _e=n;return _e!==n?W=t.substring(W,z):W=_e,W!==n&&(xt=O,W=gB(W)),O=W,O}function Cx(){var O,W,_e,xe,Pe,Ee,Ue,rt;if(O=z,t.substr(z,8)===h?(W=h,z+=8):(W=n,De===0&&Ne(ye)),W!==n)if(_e=fo(),_e!==n)if(xe=uo(),xe!==n)if(dt(),t.charCodeAt(z)===123?(Pe=a,z++):(Pe=n,De===0&&Ne(fe)),Pe!==n){for(dt(),Ee=[],Ue=co();Ue!==n;)Ee.push(Ue),Ue=co();Ue=dt(),t.charCodeAt(z)===125?(rt=l,z++):(rt=n,De===0&&Ne(ne)),rt!==n?(xt=O,O=vB(xe,Ee)):(z=O,O=n)}else z=O,O=n;else z=O,O=n;else z=O,O=n;else z=O,O=n;return O}function $x(){var O,W,_e,xe,Pe,Ee,Ue,rt;if(O=z,t.substr(z,9)===g?(W=g,z+=9):(W=n,De===0&&Ne(ue)),W!==n)if(_e=fo(),_e!==n)if(xe=uo(),xe!==n)if(dt(),t.charCodeAt(z)===123?(Pe=a,z++):(Pe=n,De===0&&Ne(fe)),Pe!==n){for(dt(),Ee=[],Ue=co();Ue!==n;)Ee.push(Ue),Ue=co();Ue=dt(),t.charCodeAt(z)===125?(rt=l,z++):(rt=n,De===0&&Ne(ne)),rt!==n?(xt=O,O=bB(xe,Ee)):(z=O,O=n)}else z=O,O=n;else z=O,O=n;else z=O,O=n;else z=O,O=n;return O===n&&(O=z,t.substr(z,9)===g?(W=g,z+=9):(W=n,De===0&&Ne(ue)),W!==n?(_e=fo(),_e!==n?(xe=uo(),xe!==n?(xt=O,O=yB(xe)):(z=O,O=n)):(z=O,O=n)):(z=O,O=n)),O}function Tx(){var O,W,_e,xe,Pe,Ee,Ue,rt,Qo,An;if(O=z,t.substr(z,8)===v?(W=v,z+=8):(W=n,De===0&&Ne(ke)),W!==n)if(_e=fo(),_e!==n)if(xe=uo(),xe!==n)if(Pe=fo(),Pe!==n)if(Ee=uo(),Ee!==n)if(dt(),t.charCodeAt(z)===123?(Ue=a,z++):(Ue=n,De===0&&Ne(fe)),Ue!==n){for(dt(),rt=[],Qo=co();Qo!==n;)rt.push(Qo),Qo=co();Qo=dt(),t.charCodeAt(z)===125?(An=l,z++):(An=n,De===0&&Ne(ne)),An!==n?(xt=O,O=xB(xe,Ee,rt)):(z=O,O=n)}else z=O,O=n;else z=O,O=n;else z=O,O=n;else z=O,O=n;else z=O,O=n;else z=O,O=n;return O}function Mx(){var O,W,_e,xe,Pe,Ee,Ue,rt;if(O=z,t.substr(z,10)===m?(W=m,z+=10):(W=n,De===0&&Ne(Ie)),W!==n)if(_e=fo(),_e!==n)if(xe=uo(),xe!==n)if(dt(),t.charCodeAt(z)===123?(Pe=a,z++):(Pe=n,De===0&&Ne(fe)),Pe!==n){for(dt(),Ee=[],Ue=co();Ue!==n;)Ee.push(Ue),Ue=co();Ue=dt(),t.charCodeAt(z)===125?(rt=l,z++):(rt=n,De===0&&Ne(ne)),rt!==n?(xt=O,O=wB(xe,Ee)):(z=O,O=n)}else z=O,O=n;else z=O,O=n;else z=O,O=n;else z=O,O=n;return O}function Ox(){var O,W,_e,xe,Pe,Ee;if(O=z,t.substr(z,5)===b?(W=b,z+=5):(W=n,De===0&&Ne(Se)),W!==n)if(dt(),t.charCodeAt(z)===123?(_e=a,z++):(_e=n,De===0&&Ne(fe)),_e!==n){for(dt(),xe=[],Pe=co();Pe!==n;)xe.push(Pe),Pe=co();Pe=dt(),t.charCodeAt(z)===125?(Ee=l,z++):(Ee=n,De===0&&Ne(ne)),Ee!==n?(xt=O,O=_B(xe)):(z=O,O=n)}else z=O,O=n;else z=O,O=n;return O}function Bx(){var O,W,_e,xe,Pe,Ee;if(O=z,t.substr(z,4)===y?(W=y,z+=4):(W=n,De===0&&Ne(Be)),W!==n)if(dt(),t.charCodeAt(z)===123?(_e=a,z++):(_e=n,De===0&&Ne(fe)),_e!==n){for(dt(),xe=[],Pe=co();Pe!==n;)xe.push(Pe),Pe=co();Pe=dt(),t.charCodeAt(z)===125?(Ee=l,z++):(Ee=n,De===0&&Ne(ne)),Ee!==n?(xt=O,O=kB(xe)):(z=O,O=n)}else z=O,O=n;else z=O,O=n;return O}function Lx(){var O,W,_e,xe,Pe,Ee,Ue,rt;if(O=z,t.substr(z,6)===x?(W=x,z+=6):(W=n,De===0&&Ne(Ze)),W!==n)if(_e=fo(),_e!==n)if(xe=uo(),xe!==n)if(dt(),t.charCodeAt(z)===123?(Pe=a,z++):(Pe=n,De===0&&Ne(fe)),Pe!==n){for(dt(),Ee=[],Ue=co();Ue!==n;)Ee.push(Ue),Ue=co();Ue=dt(),t.charCodeAt(z)===125?(rt=l,z++):(rt=n,De===0&&Ne(ne)),rt!==n?(xt=O,O=SB(xe,Ee)):(z=O,O=n)}else z=O,O=n;else z=O,O=n;else z=O,O=n;else z=O,O=n;return O}function n9(){var O,W,_e,xe,Pe,Ee,Ue,rt;if(O=z,t.substr(z,5)===_?(W=_,z+=5):(W=n,De===0&&Ne(ot)),W===n&&(t.substr(z,4)===k?(W=k,z+=4):(W=n,De===0&&Ne(pt))),W!==n)if(_e=fo(),_e!==n)if(xe=uo(),xe===n&&(xe=null),dt(),t.charCodeAt(z)===123?(Pe=a,z++):(Pe=n,De===0&&Ne(fe)),Pe!==n){for(dt(),Ee=[],Ue=Vx();Ue!==n;)Ee.push(Ue),Ue=Vx();Ue=dt(),t.charCodeAt(z)===125?(rt=l,z++):(rt=n,De===0&&Ne(ne)),rt!==n?(xt=O,O=AB(xe,Ee)):(z=O,O=n)}else z=O,O=n;else z=O,O=n;else z=O,O=n;return O}function Px(){var O,W,_e,xe,Pe,Ee,Ue,rt;if(O=z,t.substr(z,9)===E?(W=E,z+=9):(W=n,De===0&&Ne(Tt)),W!==n)if(_e=fo(),_e!==n)if(xe=Yf(),xe!==n)if(dt(),t.charCodeAt(z)===123?(Pe=a,z++):(Pe=n,De===0&&Ne(fe)),Pe!==n){for(dt(),Ee=[],Ue=co();Ue!==n;)Ee.push(Ue),Ue=co();Ue=dt(),t.charCodeAt(z)===125?(rt=l,z++):(rt=n,De===0&&Ne(ne)),rt!==n?(xt=O,O=CB(xe,Ee)):(z=O,O=n)}else z=O,O=n;else z=O,O=n;else z=O,O=n;else z=O,O=n;return O}function Dx(){var O,W,_e,xe;return O=z,t.substr(z,15)===L?(W=L,z+=15):(W=n,De===0&&Ne(Jt)),W!==n?(_e=fo(),_e!==n?(xe=uo(),xe!==n?(xt=O,O=$B(xe)):(z=O,O=n)):(z=O,O=n)):(z=O,O=n),O}function Ex(){var O,W,_e,xe;return O=z,t.substr(z,10)===S?(W=S,z+=10):(W=n,De===0&&Ne(pn)),W!==n?(_e=fo(),_e!==n?(xe=uo(),xe!==n?(xt=O,O=TB(xe)):(z=O,O=n)):(z=O,O=n)):(z=O,O=n),O}function Ix(){var O,W,_e,xe;return O=z,t.substr(z,9)===B?(W=B,z+=9):(W=n,De===0&&Ne(Et)),W!==n?(_e=fo(),_e!==n?(xe=uo(),xe!==n?(xt=O,O=MB(xe)):(z=O,O=n)):(z=O,O=n)):(z=O,O=n),O}function Nx(){var O,W,_e,xe;return O=z,t.substr(z,15)===D?(W=D,z+=15):(W=n,De===0&&Ne(Ft)),W!==n?(_e=fo(),_e!==n?(xe=uo(),xe!==n?(xt=O,O=OB(xe)):(z=O,O=n)):(z=O,O=n)):(z=O,O=n),O}function Rx(){var O,W,_e,xe;return O=z,t.substr(z,10)===N?(W=N,z+=10):(W=n,De===0&&Ne(dn)),W!==n?(_e=fo(),_e!==n?(xe=uo(),xe!==n?(xt=O,O=BB(xe)):(z=O,O=n)):(z=O,O=n)):(z=O,O=n),O}function Fx(){var O,W,_e,xe;return O=z,t.substr(z,9)===C?(W=C,z+=9):(W=n,De===0&&Ne(Sn)),W!==n?(_e=fo(),_e!==n?(xe=uo(),xe!==n?(xt=O,O=LB(xe)):(z=O,O=n)):(z=O,O=n)):(z=O,O=n),O}function Vx(){var O,W;return O=z,dt(),W=kx(),W===n&&(W=Cx(),W===n&&(W=$x(),W===n&&(W=Tx(),W===n&&(W=Ox(),W===n&&(W=Bx(),W===n&&(W=Mx(),W===n&&(W=Dx(),W===n&&(W=Ex(),W===n&&(W=Ix(),W===n&&(W=Nx(),W===n&&(W=Rx(),W===n&&(W=Fx(),W===n&&(W=Lx(),W===n&&(W=Px(),W===n&&(W=qf()))))))))))))))),W!==n?(dt(),xt=O,O=PB(W)):(z=O,O=n),O}function co(){var O,W;return O=z,dt(),W=qf(),W!==n?(dt(),xt=O,O=DB(W)):(z=O,O=n),O}function qf(){var O,W,_e,xe;return O=z,W=zx(),W!==n?(dt(),t.charCodeAt(z)===61?(_e=u,z++):(_e=n,De===0&&Ne(q)),_e!==n?(dt(),xe=Nu(),xe!==n?(xt=O,O=EB(W,xe)):(z=O,O=n)):(z=O,O=n)):(z=O,O=n),O}function zx(){var O;return O=uo(),O===n&&(O=Yf()),O}function Nu(){var O,W,_e;return O=z,W=Hx(),W!==n?(t.charCodeAt(z)===37?(_e=M,z++):(_e=n,De===0&&Ne(Jn)),_e!==n?(xt=O,O=IB(W)):(z=O,O=n)):(z=O,O=n),O===n&&(O=z,W=Hx(),W!==n&&(xt=O,W=NB(W)),O=W,O===n&&(O=z,W=uo(),W!==n&&(xt=O,W=RB(W)),O=W,O===n&&(O=z,W=Yf(),W!==n&&(xt=O,W=FB(W)),O=W))),O}function Yf(){var O,W,_e,xe,Pe;if(De++,O=z,W=z,_e=t.charAt(z),we.test(_e)?z++:(_e=n,De===0&&Ne(tt)),_e!==n){for(xe=[],Pe=t.charAt(z),J.test(Pe)?z++:(Pe=n,De===0&&Ne($e));Pe!==n;)xe.push(Pe),Pe=t.charAt(z),J.test(Pe)?z++:(Pe=n,De===0&&Ne($e));_e=[_e,xe],W=_e}else z=W,W=n;return W!==n?O=t.substring(O,z):O=W,De--,O===n&&(W=n,De===0&&Ne(Pr)),O}function Hx(){var O,W,_e,xe,Pe,Ee,Ue,rt,Qo,An;if(O=z,W=z,_e=z,t.charCodeAt(z)===45?(xe=P,z++):(xe=n,De===0&&Ne(Qe)),xe===n&&(xe=null),Pe=z,t.charCodeAt(z)===46?(Ee=$,z++):(Ee=n,De===0&&Ne(Fe)),Ee!==n){if(Ue=[],rt=t.charAt(z),ge.test(rt)?z++:(rt=n,De===0&&Ne(at)),rt!==n)for(;rt!==n;)Ue.push(rt),rt=t.charAt(z),ge.test(rt)?z++:(rt=n,De===0&&Ne(at));else Ue=n;Ue!==n?(Ee=[Ee,Ue],Pe=Ee):(z=Pe,Pe=n)}else z=Pe,Pe=n;if(Pe===n){if(Pe=z,Ee=[],Ue=t.charAt(z),ge.test(Ue)?z++:(Ue=n,De===0&&Ne(at)),Ue!==n)for(;Ue!==n;)Ee.push(Ue),Ue=t.charAt(z),ge.test(Ue)?z++:(Ue=n,De===0&&Ne(at));else Ee=n;if(Ee!==n){if(Ue=z,t.charCodeAt(z)===46?(rt=$,z++):(rt=n,De===0&&Ne(Fe)),rt!==n){for(Qo=[],An=t.charAt(z),ge.test(An)?z++:(An=n,De===0&&Ne(at));An!==n;)Qo.push(An),An=t.charAt(z),ge.test(An)?z++:(An=n,De===0&&Ne(at));rt=[rt,Qo],Ue=rt}else z=Ue,Ue=n;Ue===n&&(Ue=null),Ee=[Ee,Ue],Pe=Ee}else z=Pe,Pe=n}if(Pe!==n){if(Ee=z,Ue=t.charAt(z),re.test(Ue)?z++:(Ue=n,De===0&&Ne(ln)),Ue!==n){if(rt=t.charAt(z),oe.test(rt)?z++:(rt=n,De===0&&Ne(Yn)),rt===n&&(rt=null),Qo=[],An=t.charAt(z),ge.test(An)?z++:(An=n,De===0&&Ne(at)),An!==n)for(;An!==n;)Qo.push(An),An=t.charAt(z),ge.test(An)?z++:(An=n,De===0&&Ne(at));else Qo=n;Qo!==n?(Ue=[Ue,rt,Qo],Ee=Ue):(z=Ee,Ee=n)}else z=Ee,Ee=n;Ee===n&&(Ee=null),xe=[xe,Pe,Ee],_e=xe}else z=_e,_e=n;return _e!==n?W=t.substring(W,z):W=_e,W!==n&&(xt=O,W=VB(W)),O=W,O}function uo(){var O,W,_e,xe;if(De++,O=z,t.charCodeAt(z)===34?(W=F,z++):(W=n,De===0&&Ne(zn)),W!==n){for(_e=[],xe=Wx();xe!==n;)_e.push(xe),xe=Wx();t.charCodeAt(z)===34?(xe=F,z++):(xe=n,De===0&&Ne(zn)),xe!==n?(xt=O,O=zB(_e)):(z=O,O=n)}else z=O,O=n;return De--,O===n&&(W=n,De===0&&Ne(Po)),O}function Wx(){var O,W,_e;return O=z,t.charCodeAt(z)===92?(W=V,z++):(W=n,De===0&&Ne(Zo)),W!==n?(_e=o9(),_e!==n?(xt=O,O=HB(_e)):(z=O,O=n)):(z=O,O=n),O===n&&(O=t.charAt(z),he.test(O)?z++:(O=n,De===0&&Ne(Dr))),O}function o9(){var O,W,_e,xe,Pe,Ee,Ue,rt;return O=z,t.charCodeAt(z)===34?(W=F,z++):(W=n,De===0&&Ne(zn)),W!==n&&(xt=O,W=WB()),O=W,O===n&&(O=z,t.charCodeAt(z)===92?(W=V,z++):(W=n,De===0&&Ne(Zo)),W!==n&&(xt=O,W=UB()),O=W,O===n&&(O=z,t.charCodeAt(z)===110?(W=U,z++):(W=n,De===0&&Ne(ps)),W!==n&&(xt=O,W=GB()),O=W,O===n&&(O=z,t.charCodeAt(z)===114?(W=K,z++):(W=n,De===0&&Ne(Ge)),W!==n&&(xt=O,W=qB()),O=W,O===n&&(O=z,t.charCodeAt(z)===116?(W=ae,z++):(W=n,De===0&&Ne(lt)),W!==n&&(xt=O,W=YB()),O=W,O===n&&(O=z,t.charCodeAt(z)===117?(W=me,z++):(W=n,De===0&&Ne(Ot)),W!==n?(_e=z,xe=z,Pe=t.charAt(z),I.test(Pe)?z++:(Pe=n,De===0&&Ne(It)),Pe!==n?(Ee=t.charAt(z),I.test(Ee)?z++:(Ee=n,De===0&&Ne(It)),Ee!==n?(Ue=t.charAt(z),I.test(Ue)?z++:(Ue=n,De===0&&Ne(It)),Ue!==n?(rt=t.charAt(z),I.test(rt)?z++:(rt=n,De===0&&Ne(It)),rt!==n?(Pe=[Pe,Ee,Ue,rt],xe=Pe):(z=xe,xe=n)):(z=xe,xe=n)):(z=xe,xe=n)):(z=xe,xe=n),xe!==n?_e=t.substring(_e,z):_e=xe,_e!==n?(xt=O,O=jB(_e)):(z=O,O=n)):(z=O,O=n),O===n&&(O=z,t.length>z?(W=t.charAt(z),z++):(W=n,De===0&&Ne(Ln)),W!==n&&(xt=O,W=XB(W)),O=W)))))),O}function jf(){var O;return O=r9(),O===n&&(O=i9()),O}function r9(){var O,W,_e,xe;if(O=z,t.substr(z,2)===de?(W=de,z+=2):(W=n,De===0&&Ne(eo)),W!==n){for(_e=[],xe=t.charAt(z),G.test(xe)?z++:(xe=n,De===0&&Ne(Er));xe!==n;)_e.push(xe),xe=t.charAt(z),G.test(xe)?z++:(xe=n,De===0&&Ne(Er));W=[W,_e],O=W}else z=O,O=n;return O}function i9(){var O,W,_e,xe,Pe,Ee;if(O=z,t.substr(z,2)===ve?(W=ve,z+=2):(W=n,De===0&&Ne(sc)),W!==n){for(_e=[],xe=z,Pe=z,De++,t.substr(z,2)===te?(Ee=te,z+=2):(Ee=n,De===0&&Ne(aa)),De--,Ee===n?Pe=void 0:(z=Pe,Pe=n),Pe!==n?(t.length>z?(Ee=t.charAt(z),z++):(Ee=n,De===0&&Ne(Ln)),Ee!==n?(Pe=[Pe,Ee],xe=Pe):(z=xe,xe=n)):(z=xe,xe=n);xe!==n;)_e.push(xe),xe=z,Pe=z,De++,t.substr(z,2)===te?(Ee=te,z+=2):(Ee=n,De===0&&Ne(aa)),De--,Ee===n?Pe=void 0:(z=Pe,Pe=n),Pe!==n?(t.length>z?(Ee=t.charAt(z),z++):(Ee=n,De===0&&Ne(Ln)),Ee!==n?(Pe=[Pe,Ee],xe=Pe):(z=xe,xe=n)):(z=xe,xe=n);t.substr(z,2)===te?(xe=te,z+=2):(xe=n,De===0&&Ne(aa)),xe!==n?(W=[W,_e,xe],O=W):(z=O,O=n)}else z=O,O=n;return O}function fo(){var O,W;if(De++,O=[],W=t.charAt(z),Y.test(W)?z++:(W=n,De===0&&Ne(ac)),W===n&&(W=jf()),W!==n)for(;W!==n;)O.push(W),W=t.charAt(z),Y.test(W)?z++:(W=n,De===0&&Ne(ac)),W===n&&(W=jf());else O=n;return De--,O===n&&(W=n,De===0&&Ne(la)),O}function dt(){var O,W;for(De++,O=[],W=t.charAt(z),Y.test(W)?z++:(W=n,De===0&&Ne(ac)),W===n&&(W=jf());W!==n;)O.push(W),W=t.charAt(z),Y.test(W)?z++:(W=n,De===0&&Ne(ac)),W===n&&(W=jf());return De--,W=n,De===0&&Ne(cB),O}if(Iu=i(),e.peg$library)return{peg$result:Iu,peg$currPos:z,peg$FAILED:n,peg$maxFailExpected:Uf,peg$maxFailPos:ti};if(Iu!==n&&z===t.length)return Iu;throw Iu!==n&&z<t.length&&Ne(QB()),e9(Uf,ti<t.length?t.charAt(ti):null,ti<t.length?$g(ti,ti+1):$g(ti,ti))}function cg(t){try{return hoe(t)}catch(e){if(e instanceof Error&&"location"in e){const n=e.location;throw new SyntaxError(`${e.message} at ${n.start.line}:${n.start.column}`)}throw e}}function Wr(t){return new Map(t.map(e=>[e.key,e.value]))}function ug(t,e){const n=Wr(e),o=cu(t),r=new Set(o.map(s=>s.key)),i={};for(const s of o){const a=n.get(s.key);a!==void 0&&r.has(s.key)&&(s.type===Ke.Colors?i[s.key]=String(a).split(",").map(l=>l.trim()).filter(Boolean):s.type===Ke.Boolean?i[s.key]=a==="true"||a===!0:i[s.key]=String(a))}return i}function poe(t){return!(/^-?\d+(\.\d+)?$/.test(t)||/^-?\d+(\.\d+)?%$/.test(t)||/^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(t))}function f0(t){return t.entries.map(e=>{if(e.values&&e.values.length>1){if(e.key==="_series")return`_series = ${e.values.map(r=>`"${r}"`).join(",")}`;const o=e.values.join(",");return`"${e.key}" = ${o}`}const n=e.isPercentage?`${e.value}%`:String(e.value);return e.key==="_series"?`_series = "${n}"`:typeof e.value=="string"&&poe(n)?`"${e.key}" = "${n}"`:`"${e.key}" = ${n}`}).join(`
|
|
90
|
+
`)}function moe(t,e){const n=Wr(t.properties),o=n.get("type"),r=o??e;return{name:t.name,chartType:o,properties:n,data:t.data,chartTypeOptions:ug(r,t.properties),colorizes:t.colorizes,highlights:t.highlights,areaFills:t.areaFills,annotations:t.annotations,annotationVisibility:t.annotationVisibility??[],series:t.series,transforms:t.transforms}}function $6(t,e){const n=t.find(o=>o.key===e);return n?String(n.value):void 0}function T6(t,e){const n=t.find(o=>o.key===e);if(n)return n.isPercentage,n.value}function M6(t){const e=t.find(n=>n.key==="maxWidth");if(e)return e.isPercentage?`${e.value}%`:e.value}const ya=t=>t==="true"||t===!0;function h0(t){return t.map(e=>({target:e.target,color:$6(e.properties,"color")??"#e15759",label:$6(e.properties,"label")}))}function p0(t){return t.map(e=>({target:e.target}))}function m0(t){return t.map(e=>{const n=Wr(e.properties);return{from:e.from,to:e.to,color:n.has("color")?String(n.get("color")):void 0,negativeColor:n.has("negativeColor")?String(n.get("negativeColor")):void 0,opacity:n.has("opacity")?Number(n.get("opacity")):void 0,interpolation:n.has("interpolation")?String(n.get("interpolation")):void 0}})}function g0(t){return t.map(e=>{const n=Wr(e.properties),o=e.kind??Lt.Point;if(o===Lt.Range){const a={kind:Lt.Range,start:n.has("start")?isNaN(Number(n.get("start")))?String(n.get("start")):Number(n.get("start")):0,end:n.has("end")?isNaN(Number(n.get("end")))?String(n.get("end")):Number(n.get("end")):0};return n.has("id")&&(a.id=String(n.get("id"))),n.has("orientation")&&(a.orientation=String(n.get("orientation"))),n.has("startAnchor")&&(a.startAnchor=String(n.get("startAnchor"))),n.has("endAnchor")&&(a.endAnchor=String(n.get("endAnchor"))),n.has("bgColor")&&(a.bgColor=String(n.get("bgColor"))),n.has("bgOpacity")&&(a.bgOpacity=Number(n.get("bgOpacity"))),n.has("direction")&&(a.direction=String(n.get("direction"))),n.has("text")&&(a.text=String(n.get("text"))),n.has("textColor")&&(a.textColor=String(n.get("textColor"))),a}if(o===Lt.Free){const a={kind:Lt.Free,text:String(n.get("text")??""),x:T6(e.properties,"x")??0,y:T6(e.properties,"y")??0};n.has("id")&&(a.id=String(n.get("id"))),n.has("textColor")&&(a.textColor=String(n.get("textColor")));const l=M6(e.properties);return l!==void 0&&(a.maxWidth=l),n.has("textOutline")&&(a.textOutline=ya(n.get("textOutline"))),a}const r="target"in e?e.target:"",i={kind:Lt.Point,target:r,text:String(n.get("text")??"")};n.has("id")&&(i.id=String(n.get("id"))),n.has("textColor")&&(i.textColor=String(n.get("textColor")));const s=M6(e.properties);return s!==void 0&&(i.maxWidth=s),n.has("textOutline")&&(i.textOutline=ya(n.get("textOutline"))),n.has("showLine")&&(i.showLine=ya(n.get("showLine"))),n.has("anchorDirection")&&(i.anchorDirection=String(n.get("anchorDirection"))),n.has("textOffsetX")&&(i.textOffsetX=Number(n.get("textOffsetX"))),n.has("textOffsetY")&&(i.textOffsetY=Number(n.get("textOffsetY"))),n.has("lineStyle")&&(i.lineStyle=String(n.get("lineStyle"))),n.has("lineWeight")&&(i.lineWeight=Number(n.get("lineWeight"))),n.has("showArrow")&&(i.showArrow=ya(n.get("showArrow"))),n.has("lineTargetDistance")&&(i.lineTargetDistance=Number(n.get("lineTargetDistance"))),n.has("showCircle")&&(i.showCircle=ya(n.get("showCircle"))),n.has("circleSize")&&(i.circleSize=Number(n.get("circleSize"))),n.has("circleStyle")&&(i.circleStyle=String(n.get("circleStyle"))),n.has("circleColor")&&(i.circleColor=String(n.get("circleColor"))),i})}function v0(t){return t.map(e=>{const n=Wr(e.properties),o={name:e.name};return n.has("color")&&(o.color=String(n.get("color"))),n.has("lineWidth")&&(o.lineWidth=Number(n.get("lineWidth"))),n.has("dash")&&(o.dash=String(n.get("dash"))),n.has("interpolation")&&(o.interpolation=String(n.get("interpolation"))),n.has("labelMode")&&(o.labelMode=String(n.get("labelMode"))),n.has("labelText")&&(o.labelText=String(n.get("labelText"))),n.has("valueLabels")&&(o.valueLabels=ya(n.get("valueLabels"))),n.has("lineSymbols")&&(o.lineSymbols=ya(n.get("lineSymbols"))),n.has("hidden")&&(o.hidden=ya(n.get("hidden"))),n.has("symbolShape")&&(o.symbolShape=String(n.get("symbolShape"))),n.has("symbolShowOn")&&(o.symbolShowOn=String(n.get("symbolShowOn"))),n.has("symbolStyle")&&(o.symbolStyle=String(n.get("symbolStyle"))),n.has("symbolSize")&&(o.symbolSize=Number(n.get("symbolSize"))),n.has("symbolOpacity")&&(o.symbolOpacity=Number(n.get("symbolOpacity"))),o})}const goe=`chart bar-vertical {
|
|
91
|
+
title = "E is the most frequent letter in English"
|
|
92
|
+
description = "How often each letter appears in typical English text"
|
|
93
|
+
byline = "Pierre Romera"
|
|
94
|
+
source = "Lewand, Cryptological Mathematics"
|
|
95
|
+
sourceUrl = "https://en.wikipedia.org/wiki/Letter_frequency"
|
|
96
|
+
note = "Based on analysis of 40,000 words from English prose"
|
|
97
|
+
colorPalette = "London"
|
|
98
|
+
sort = descending
|
|
99
|
+
valueLabels = true
|
|
100
|
+
verticalLabelPosition = off
|
|
101
|
+
verticalGridStyle = none
|
|
102
|
+
|
|
103
|
+
highlight "E"
|
|
104
|
+
|
|
105
|
+
data {
|
|
106
|
+
"E" = 12.70
|
|
107
|
+
"T" = 9.06
|
|
108
|
+
"A" = 8.17
|
|
109
|
+
"O" = 7.51
|
|
110
|
+
"I" = 6.97
|
|
111
|
+
"N" = 6.75
|
|
112
|
+
"S" = 6.33
|
|
113
|
+
"H" = 6.09
|
|
114
|
+
"R" = 5.99
|
|
115
|
+
"D" = 4.25
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
`,voe=`chart bar-vertical {
|
|
119
|
+
title = "China emits more CO₂ than the US and India combined"
|
|
120
|
+
description = "Annual emissions in billion tonnes, 2023"
|
|
121
|
+
source = "Global Carbon Project"
|
|
122
|
+
sourceUrl = "https://globalcarbonproject.org"
|
|
123
|
+
verticalLabelPosition = "off"
|
|
124
|
+
verticalGridStyle = "none"
|
|
125
|
+
valueLabels = true
|
|
126
|
+
|
|
127
|
+
data {
|
|
128
|
+
"China" = 11.9
|
|
129
|
+
"United States" = 4.78
|
|
130
|
+
"India" = 2.88
|
|
131
|
+
"Russia" = 1.78
|
|
132
|
+
"Japan" = 1.02
|
|
133
|
+
"Germany" = 0.64
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
highlight "China"
|
|
137
|
+
|
|
138
|
+
annotation "India" {
|
|
139
|
+
text = "Surpassed EU in 2023"
|
|
140
|
+
showLine = true
|
|
141
|
+
anchorDirection = N
|
|
142
|
+
textOffsetX = 66
|
|
143
|
+
textOffsetY = -41
|
|
144
|
+
lineStyle = curve-left
|
|
145
|
+
showArrow = true
|
|
146
|
+
lineTargetDistance = 26
|
|
147
|
+
showCircle = false
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
`,boe=`chart bar-horizontal {
|
|
151
|
+
title = "Mandarin has nearly twice as many native speakers as Spanish"
|
|
152
|
+
description = "Number of native speakers worldwide, in millions"
|
|
153
|
+
source = "Ethnologue"
|
|
154
|
+
sourceUrl = "https://ethnologue.com"
|
|
155
|
+
byline = "Pierre Romera"
|
|
156
|
+
sort = descending
|
|
157
|
+
horizontalLabelPosition = off
|
|
158
|
+
horizontalGridStyle = none
|
|
159
|
+
|
|
160
|
+
highlight "Mandarin"
|
|
161
|
+
|
|
162
|
+
data {
|
|
163
|
+
"Mandarin" = 920
|
|
164
|
+
"Spanish" = 475
|
|
165
|
+
"English" = 373
|
|
166
|
+
"Hindi" = 344
|
|
167
|
+
"Bengali" = 234
|
|
168
|
+
"Portuguese" = 232
|
|
169
|
+
"Russian" = 154
|
|
170
|
+
"Japanese" = 125
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
`,yoe=`chart bar-multi {
|
|
174
|
+
title = "Software overtakes hardware as the top revenue driver"
|
|
175
|
+
description = "USD billions"
|
|
176
|
+
byline = "Pierre Romera"
|
|
177
|
+
source = "Company filings"
|
|
178
|
+
note = "Figures are illustrative and do not represent actual company data"
|
|
179
|
+
tooltips = true
|
|
180
|
+
colorPalette = "Egypt"
|
|
181
|
+
|
|
182
|
+
data {
|
|
183
|
+
_series = "Hardware","Software","Services"
|
|
184
|
+
"Q1 2024" = 14.2,9.8,7.4
|
|
185
|
+
"Q2 2024" = 13.8,11.0,8.1
|
|
186
|
+
"Q3 2024" = 15.5,12.1,8.9
|
|
187
|
+
"Q4 2024" = 18.9,13.4,10.2
|
|
188
|
+
"Q1 2025" = 14.8,14.0,9.5
|
|
189
|
+
"Q2 2025" = 16.2,15.5,10.8
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
`,xoe=`chart bar-multi {
|
|
193
|
+
title = "USA tops Paris 2024 with 126 medals across all categories"
|
|
194
|
+
description = "2024 Paris Summer Games — top six nations"
|
|
195
|
+
source = "Olympics.com"
|
|
196
|
+
sourceUrl = "https://olympics.com"
|
|
197
|
+
colors = "#eeca3b, #c0c0c0, #cd7f32"
|
|
198
|
+
valueLabels = true
|
|
199
|
+
verticalGridStyle = none
|
|
200
|
+
verticalLabelPosition = off
|
|
201
|
+
sort = descending
|
|
202
|
+
|
|
203
|
+
data {
|
|
204
|
+
_series = "Gold","Silver","Bronze"
|
|
205
|
+
"USA" = 40,44,42
|
|
206
|
+
"China" = 38,32,18
|
|
207
|
+
"Japan" = 27,14,17
|
|
208
|
+
"Great Britain" = 22,21,22
|
|
209
|
+
"Australia" = 17,7,22
|
|
210
|
+
"France" = 16,20,23
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
`,woe=`chart line {
|
|
214
|
+
title = "2024 was the hottest year on record"
|
|
215
|
+
description = "Deviation from the 1951–1980 average, in °C"
|
|
216
|
+
source = "NASA GISS"
|
|
217
|
+
sourceUrl = "https://data.giss.nasa.gov/gistemp/"
|
|
218
|
+
tooltips = true
|
|
219
|
+
crosshair = false
|
|
220
|
+
lineSymbols = true
|
|
221
|
+
|
|
222
|
+
data {
|
|
223
|
+
"1980" = 0.26
|
|
224
|
+
"1985" = 0.12
|
|
225
|
+
"1990" = 0.45
|
|
226
|
+
"1995" = 0.45
|
|
227
|
+
"2000" = 0.42
|
|
228
|
+
"2005" = 0.68
|
|
229
|
+
"2010" = 0.72
|
|
230
|
+
"2015" = 0.9
|
|
231
|
+
"2020" = 1.02
|
|
232
|
+
"2024" = 1.29
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
annotation "2015" {
|
|
236
|
+
id = "2o3cx"
|
|
237
|
+
text = "2015 Paris Agreement to limit global warming to 1.5°C "
|
|
238
|
+
maxWidth = 224
|
|
239
|
+
showLine = true
|
|
240
|
+
lineStyle = curve-right
|
|
241
|
+
showArrow = true
|
|
242
|
+
showCircle = true
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
`,_oe=`chart line-multi {
|
|
246
|
+
title = "Detroit's unemployment hit 16% during the Great Recession"
|
|
247
|
+
description = "Percent of labour force, 2000–2014"
|
|
248
|
+
source = "Bureau of Labor Statistics"
|
|
249
|
+
sourceUrl = "https://bls.gov"
|
|
250
|
+
note = "Not seasonally adjusted. Metro area definitions may vary across years."
|
|
251
|
+
colorPalette = "Maya"
|
|
252
|
+
tooltips = true
|
|
253
|
+
|
|
254
|
+
annotation "2009" {
|
|
255
|
+
text = "Great Recession peak"
|
|
256
|
+
dy = -10
|
|
257
|
+
showArrow = true
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
data {
|
|
261
|
+
_series = "New York","Los Angeles","Chicago","Detroit"
|
|
262
|
+
"2000" = 5.0,5.6,4.5,3.8
|
|
263
|
+
"2002" = 7.3,7.5,6.8,7.0
|
|
264
|
+
"2004" = 6.5,6.4,6.5,7.3
|
|
265
|
+
"2006" = 5.0,4.8,5.0,6.8
|
|
266
|
+
"2008" = 6.2,7.5,7.1,9.4
|
|
267
|
+
"2009" = 9.5,12.4,11.2,16.2
|
|
268
|
+
"2010" = 9.4,12.7,10.8,15.8
|
|
269
|
+
"2012" = 8.2,10.6,9.3,10.4
|
|
270
|
+
"2014" = 6.5,8.0,7.1,8.2
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
`,koe=`chart pie {
|
|
274
|
+
title = "Asia is home to nearly 60% of the world's population"
|
|
275
|
+
description = "Estimated share, 2024"
|
|
276
|
+
source = "United Nations"
|
|
277
|
+
sourceUrl = "https://population.un.org"
|
|
278
|
+
colorPalette = "Klimt"
|
|
279
|
+
legendPosition = "right"
|
|
280
|
+
tooltips = true
|
|
281
|
+
|
|
282
|
+
data {
|
|
283
|
+
"Asia" = 59.4
|
|
284
|
+
"Africa" = 18.3
|
|
285
|
+
"Europe" = 9.3
|
|
286
|
+
"Latin America" = 8.2
|
|
287
|
+
"North America" = 4.8
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
`,Soe=`chart bar-vertical {
|
|
291
|
+
title = "Brazil produces more coffee than the next three countries combined"
|
|
292
|
+
description = "Million 60-kg bags, 2023/24 crop year"
|
|
293
|
+
source = "International Coffee Organization"
|
|
294
|
+
sourceUrl = "https://ico.org"
|
|
295
|
+
colorPalette = "Harvey"
|
|
296
|
+
verticalLabelPosition = "off"
|
|
297
|
+
verticalGridStyle = "none"
|
|
298
|
+
valueLabels = true
|
|
299
|
+
|
|
300
|
+
data {
|
|
301
|
+
"Brazil" = 66.4
|
|
302
|
+
"Vietnam" = 29
|
|
303
|
+
"Colombia" = 11.4
|
|
304
|
+
"Indonesia" = 9.9
|
|
305
|
+
"Ethiopia" = 8.7
|
|
306
|
+
"Honduras" = 6.3
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
highlight "Brazil"
|
|
310
|
+
|
|
311
|
+
transform sort {
|
|
312
|
+
column = "value"
|
|
313
|
+
direction = descending
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
`,Aoe=`chart donut {
|
|
317
|
+
title = "Chrome dominates with two-thirds of the desktop browser market"
|
|
318
|
+
description = "Worldwide, January 2025"
|
|
319
|
+
source = "StatCounter"
|
|
320
|
+
sourceUrl = "https://gs.statcounter.com"
|
|
321
|
+
colorPalette = "Heep"
|
|
322
|
+
legendPosition = "right"
|
|
323
|
+
tooltips = true
|
|
324
|
+
displayAsPercentage = true
|
|
325
|
+
|
|
326
|
+
data {
|
|
327
|
+
"Chrome" = 65.7
|
|
328
|
+
"Edge" = 13.1
|
|
329
|
+
"Safari" = 8.9
|
|
330
|
+
"Firefox" = 6.3
|
|
331
|
+
"Opera" = 3.1
|
|
332
|
+
"Others" = 2.9
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
`,Coe=`chart area {
|
|
336
|
+
title = "Apple stock climbed 36 % through 2024"
|
|
337
|
+
description = "Monthly closing price in USD"
|
|
338
|
+
source = "Yahoo Finance"
|
|
339
|
+
sourceUrl = "https://finance.yahoo.com"
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
data {
|
|
343
|
+
"Jan" = 183
|
|
344
|
+
"Feb" = 182
|
|
345
|
+
"Mar" = 171
|
|
346
|
+
"Apr" = 170
|
|
347
|
+
"May" = 192
|
|
348
|
+
"Jun" = 210
|
|
349
|
+
"Jul" = 222
|
|
350
|
+
"Aug" = 229
|
|
351
|
+
"Sep" = 233
|
|
352
|
+
"Oct" = 225
|
|
353
|
+
"Nov" = 237
|
|
354
|
+
"Dec" = 249
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
`,$oe=`chart area-stacked {
|
|
358
|
+
title = "Renewables rose from 18 % to 23 % of global energy since 2000"
|
|
359
|
+
description = "Share of primary energy by source, 2000–2023"
|
|
360
|
+
source = "Our World in Data"
|
|
361
|
+
sourceUrl = "https://ourworldindata.org/energy-mix"
|
|
362
|
+
stackPercent = true
|
|
363
|
+
areaSortMode = descending
|
|
364
|
+
|
|
365
|
+
data {
|
|
366
|
+
_series = "Coal","Oil","Gas","Renewables"
|
|
367
|
+
"2000" = 25,36,21,18
|
|
368
|
+
"2005" = 27,35,22,16
|
|
369
|
+
"2010" = 29,33,23,15
|
|
370
|
+
"2015" = 28,32,24,16
|
|
371
|
+
"2020" = 26,30,25,19
|
|
372
|
+
"2023" = 24,29,24,23
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
`,Toe=`chart column-stacked {
|
|
376
|
+
title = "Software revenue grew steadily while hardware spiked in Q4"
|
|
377
|
+
description = "Quarterly revenue in millions, 2024"
|
|
378
|
+
source = "Annual report"
|
|
379
|
+
|
|
380
|
+
data {
|
|
381
|
+
_series = "Hardware","Software","Services"
|
|
382
|
+
"Q1" = 120,85,45
|
|
383
|
+
"Q2" = 135,92,48
|
|
384
|
+
"Q3" = 128,98,52
|
|
385
|
+
"Q4" = 155,105,58
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
`,Moe=`chart bar-stacked {
|
|
389
|
+
title = "India's working-age population now surpasses China's"
|
|
390
|
+
description = "Millions of people, 2023"
|
|
391
|
+
source = "UN Population Division"
|
|
392
|
+
sourceUrl = "https://population.un.org"
|
|
393
|
+
horizontalGridStyle = none
|
|
394
|
+
horizontalLabelPosition = off
|
|
395
|
+
|
|
396
|
+
data {
|
|
397
|
+
_series = "0-14","15-64","65+"
|
|
398
|
+
"China" = 249,987,191
|
|
399
|
+
"India" = 365,948,100
|
|
400
|
+
"USA" = 60,215,58
|
|
401
|
+
"Indonesia" = 66,191,18
|
|
402
|
+
"Brazil" = 42,150,22
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
`,Ooe=`chart area-stacked {
|
|
406
|
+
title = "EU subsidies to new members surged after enlargement"
|
|
407
|
+
description = "Agricultural subsidies to post-socialist EU members, million euros"
|
|
408
|
+
source = "Eurostat"
|
|
409
|
+
sourceUrl = "https://ec.europa.eu/eurostat"
|
|
410
|
+
interpolation = "linear"
|
|
411
|
+
heightMode = "aspect-ratio"
|
|
412
|
+
aspectRatio = "1:1"
|
|
413
|
+
|
|
414
|
+
data {
|
|
415
|
+
_series = "Indirect subsidies","Direct subsidies"
|
|
416
|
+
"2000" = 370,800
|
|
417
|
+
"2001" = 445,896
|
|
418
|
+
"2002" = 567,816
|
|
419
|
+
"2003" = 641,950
|
|
420
|
+
"2004" = 1908,2434
|
|
421
|
+
"2005" = 2234,3509
|
|
422
|
+
"2006" = 2576,4356
|
|
423
|
+
"2007" = 2467,5429
|
|
424
|
+
"2008" = 2672,6655
|
|
425
|
+
"2009" = 2474,7195
|
|
426
|
+
"2010" = 2117,8207
|
|
427
|
+
"2011" = 1863,9230
|
|
428
|
+
"2012" = 1528,9191
|
|
429
|
+
"2013" = 1251,10252
|
|
430
|
+
"2014" = 1132,10987
|
|
431
|
+
"2015" = 1687,10145
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
scene "Indirect subsidies shrank" {
|
|
435
|
+
title = "Indirect subsidies were cut under WTO pressure"
|
|
436
|
+
description = "Subsidies tied to specific crops fell foul of World Trade Organization rules"
|
|
437
|
+
|
|
438
|
+
highlight "Indirect subsidies"
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
scene "Direct subsidies dominate" {
|
|
442
|
+
title = "Direct per-hectare payments now dominate"
|
|
443
|
+
description = "The larger the fields, the more money farmers receive"
|
|
444
|
+
|
|
445
|
+
highlight "Direct subsidies"
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
scene "Bulgaria: subsidies explode" {
|
|
449
|
+
title = "Subsidies to Bulgarian farmers, million euros"
|
|
450
|
+
description = "85% of Bulgarian subsidies are direct payments — the highest share among new members"
|
|
451
|
+
|
|
452
|
+
data {
|
|
453
|
+
_series = "Indirect subsidies","Direct subsidies"
|
|
454
|
+
"2000" = 0,5
|
|
455
|
+
"2001" = 0,33
|
|
456
|
+
"2002" = 0,48
|
|
457
|
+
"2003" = 0,69
|
|
458
|
+
"2004" = 0,67
|
|
459
|
+
"2005" = 0,87
|
|
460
|
+
"2006" = 0,57
|
|
461
|
+
"2007" = 59,250
|
|
462
|
+
"2008" = 75,484
|
|
463
|
+
"2009" = 97,415
|
|
464
|
+
"2010" = 79,466
|
|
465
|
+
"2011" = 94,458
|
|
466
|
+
"2012" = 120,617
|
|
467
|
+
"2013" = 132,852
|
|
468
|
+
"2014" = 143,821
|
|
469
|
+
"2015" = 213,677
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
highlight "Direct subsidies"
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
scene "Bulgarian farms grew" {
|
|
476
|
+
title = "Average farm size in Bulgaria quadrupled"
|
|
477
|
+
description = "Average farm size in hectares"
|
|
478
|
+
type = line
|
|
479
|
+
|
|
480
|
+
data {
|
|
481
|
+
"2005" = 5
|
|
482
|
+
"2007" = 6
|
|
483
|
+
"2010" = 12
|
|
484
|
+
"2013" = 18
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
scene "Production rose" {
|
|
489
|
+
title = "Bulgarian farm production rose from 3 to 4 billion euros"
|
|
490
|
+
description = "Total production of Bulgarian farms, million euros"
|
|
491
|
+
type = area
|
|
492
|
+
|
|
493
|
+
data {
|
|
494
|
+
"2000" = 2933
|
|
495
|
+
"2001" = 3240
|
|
496
|
+
"2002" = 3051
|
|
497
|
+
"2003" = 2816
|
|
498
|
+
"2004" = 3049
|
|
499
|
+
"2005" = 3011
|
|
500
|
+
"2006" = 3111
|
|
501
|
+
"2007" = 3038
|
|
502
|
+
"2008" = 4148
|
|
503
|
+
"2009" = 3437
|
|
504
|
+
"2010" = 3486
|
|
505
|
+
"2011" = 4038
|
|
506
|
+
"2012" = 4161
|
|
507
|
+
"2013" = 4115
|
|
508
|
+
"2014" = 4138
|
|
509
|
+
"2015" = 3915
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
scene "Cash crops replaced vegetables" {
|
|
514
|
+
title = "Cash crops replaced vegetables in Bulgaria"
|
|
515
|
+
description = "Production of Bulgarian farms, million euros"
|
|
516
|
+
type = area-stacked
|
|
517
|
+
|
|
518
|
+
data {
|
|
519
|
+
_series = "Vegetables","Cash crops","Other production"
|
|
520
|
+
"2000" = 464,615,1854
|
|
521
|
+
"2001" = 458,777,2005
|
|
522
|
+
"2002" = 577,850,1624
|
|
523
|
+
"2003" = 539,818,1459
|
|
524
|
+
"2004" = 483,1103,1463
|
|
525
|
+
"2005" = 492,994,1525
|
|
526
|
+
"2006" = 510,1083,1518
|
|
527
|
+
"2007" = 436,936,1666
|
|
528
|
+
"2008" = 541,2045,1563
|
|
529
|
+
"2009" = 243,1553,1641
|
|
530
|
+
"2010" = 184,2173,1128
|
|
531
|
+
"2011" = 120,2853,1065
|
|
532
|
+
"2012" = 117,2900,1144
|
|
533
|
+
"2013" = 139,2802,1174
|
|
534
|
+
"2014" = 143,3082,914
|
|
535
|
+
"2015" = 144,2986,785
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
highlight "Cash crops"
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
scene "Vegetables collapsed" {
|
|
542
|
+
title = "Vegetable production fell by a factor of four"
|
|
543
|
+
description = "A traditional Bulgarian cultivation shrank as subsidies favoured large fields"
|
|
544
|
+
|
|
545
|
+
highlight "Vegetables"
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
scene "Every vegetable declined" {
|
|
549
|
+
title = "Bulgarian vegetable production collapsed across the board"
|
|
550
|
+
description = "Production volume indexed to 2001 = 100"
|
|
551
|
+
type = line-multi
|
|
552
|
+
lineSymbols = false
|
|
553
|
+
|
|
554
|
+
data {
|
|
555
|
+
_series = "Cabbages","Tomatoes","Watermelons","Carrots","Onions","Garlic","Strawberries"
|
|
556
|
+
"2001" = 100,100,100,100,100,100,100
|
|
557
|
+
"2002" = 79,90,124,64,106,95,100
|
|
558
|
+
"2003" = 100,157,177,142,118,98,72
|
|
559
|
+
"2004" = 84,87,83,245,124,138,74
|
|
560
|
+
"2005" = 50,46,62,30,40,93,42
|
|
561
|
+
"2006" = 52,78,113,95,56,80,56
|
|
562
|
+
"2007" = 36,49,64,74,29,30,38
|
|
563
|
+
"2008" = 47,49,66,97,44,29,55
|
|
564
|
+
"2009" = 28,38,74,105,23,39,55
|
|
565
|
+
"2010" = 57,42,51,76,53,57,37
|
|
566
|
+
"2011" = 32,38,56,86,47,43,45
|
|
567
|
+
"2012" = 34,34,46,69,29,43,31
|
|
568
|
+
"2013" = 33,43,53,39,36,40,24
|
|
569
|
+
"2014" = 31,44,28,69,37,8,27
|
|
570
|
+
"2015" = 31,45,50,57,25,18,32
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
scene "Jobs disappeared" {
|
|
575
|
+
title = "Seasonal farm workers vanished while salaried jobs held steady"
|
|
576
|
+
description = "EU agricultural employment, thousands of full-time equivalents"
|
|
577
|
+
type = line-multi
|
|
578
|
+
lineSymbols = false
|
|
579
|
+
|
|
580
|
+
data {
|
|
581
|
+
_series = "Salaried workers","Non-salaried workers"
|
|
582
|
+
"2000" = 2678,12194
|
|
583
|
+
"2001" = 2598,11586
|
|
584
|
+
"2002" = 2658,10795
|
|
585
|
+
"2003" = 2563,10609
|
|
586
|
+
"2004" = 2560,9999
|
|
587
|
+
"2005" = 2501,10047
|
|
588
|
+
"2006" = 2499,9782
|
|
589
|
+
"2007" = 2437,9231
|
|
590
|
+
"2008" = 2416,8971
|
|
591
|
+
"2009" = 2348,8672
|
|
592
|
+
"2010" = 2335,7808
|
|
593
|
+
"2011" = 2322,7551
|
|
594
|
+
"2012" = 2325,7501
|
|
595
|
+
"2013" = 2297,7425
|
|
596
|
+
"2014" = 2366,7183
|
|
597
|
+
"2015" = 2413,6928
|
|
598
|
+
"2016" = 2457,6741
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
highlight "Non-salaried workers"
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
`,Boe=`chart bar-split {
|
|
605
|
+
title = "CDU/CSU led German polls at 29 % ahead of the 2021 election"
|
|
606
|
+
description = "How Germany would vote in the September 2021 federal election, according to polling in the previous June"
|
|
607
|
+
source = "FG Wahlen"
|
|
608
|
+
sourceUrl = "https://www.forschungsgruppe.de"
|
|
609
|
+
note = "Margin of error at 10%: +/- 2 percentage points; at 40%: +/- 3 percentage points"
|
|
610
|
+
|
|
611
|
+
data {
|
|
612
|
+
_series = "Poll","High","Low"
|
|
613
|
+
"CDU/CSU" = 29,32,27
|
|
614
|
+
"Greens" = 22,25,20
|
|
615
|
+
"SPD" = 14,16,12
|
|
616
|
+
"AfD" = 10,12,8
|
|
617
|
+
"FDP" = 10,12,8
|
|
618
|
+
"Left" = 7,9,5
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
`,Loe=`chart bar-grouped {
|
|
622
|
+
title = "Asia Pacific holds more renewable capacity than all other regions combined"
|
|
623
|
+
description = "Installed capacity in gigawatts (GW)"
|
|
624
|
+
source = "IRENA"
|
|
625
|
+
sourceUrl = "https://www.irena.org"
|
|
626
|
+
|
|
627
|
+
data {
|
|
628
|
+
_series = "Solar","Wind","Hydro"
|
|
629
|
+
"Asia Pacific" = 680,540,840
|
|
630
|
+
"Europe" = 250,300,200
|
|
631
|
+
"North America" = 200,180,190
|
|
632
|
+
"Latin America" = 30,50,200
|
|
633
|
+
"Africa" = 15,10,40
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
`;function O6(t,e){const n=t.properties.find(o=>o.key===e);return n?String(n.value):""}function Poe(t){if(!t.data)return"";const e=t.data.entries,n=e.find(i=>i.key==="_series");if(n){const s=["category",...String(n.value).split(",")].join(" "),a=e.filter(l=>l.key!=="_series").map(l=>{const c=String(l.value).split(",");return[l.key,...c].join(" ")});return[s,...a].join(`
|
|
637
|
+
`)}const o=["label","value"].join(" "),r=e.map(i=>[i.key,String(i.value)].join(" "));return[o,...r].join(`
|
|
638
|
+
`)}function Doe(t){if(!t.data)return"";const e=t.data.entries,n=e.find(o=>o.key==="_series");if(n){const o=`_series = "${String(n.value)}"`,r=e.filter(i=>i.key!=="_series").map(i=>`"${i.key}" = "${String(i.value)}"`);return[o,...r].join(`
|
|
639
|
+
`)}return e.map(o=>`"${o.key}" = ${String(o.value)}`).join(`
|
|
640
|
+
`)}function to(t,e){const n=cg(e);return{id:t,title:O6(n,"title"),description:O6(n,"description"),chartType:n.chartType,tsvData:Poe(n),serializedData:Doe(n),dsl:e}}const B6=[to("letter-frequency",goe),to("co2-emissions",voe),to("coffee-production",Soe),to("spoken-languages",boe),to("quarterly-revenue",yoe),to("medal-count",xoe),to("temperature-anomaly",woe),to("unemployment-rates",_oe),to("browser-market",Aoe),to("world-population",koe),to("stock-price-area",Coe),to("energy-mix-stacked-area",$oe),to("quarterly-stacked-columns",Toe),to("population-stacked-bar",Moe),to("election-polls",Boe),to("renewable-capacity",Loe),to("farm-compass",Ooe)],L6=new Set;function Eoe(t,e,n){let o=e;for(const r of t)r.transformType==="sort"?o=li.Total:L6.has(r.transformType)||(L6.add(r.transformType),console.warn(`[blueprint-chart] Unknown transform "${r.transformType}" in ${n}; ignored.`));return o}function Ioe(t){const e=i=>{const s=t.get(i);return s==null?void 0:String(s)||void 0},n=t.get("transparentBackground"),o={title:e("title"),description:e("description"),source:e("source"),sourceUrl:e("sourceUrl"),byline:e("byline"),note:e("note"),padding:e("padding"),transparentBackground:n===!0||n==="true"||void 0};return Object.values(o).some(i=>i!==void 0)?o:void 0}function Noe(t){const e=Wr(t.properties),n=t.data?f0(t.data):"",o=hs(n),r=e.get("sort"),i=r==null?void 0:String(r),s=i===Qt.Ascending||i===Qt.Descending?i:void 0,a=e.get("theme"),l=e.get("sortMode");let c;return(l===li.Total||l===li.WithinGroups||l===li.None)&&(c=l),c=Eoe(t.transforms,c,"chart"),{chartType:t.chartType,data:o,properties:t.properties,frame:Ioe(e),colorizes:h0(t.colorizes),highlights:p0(t.highlights),areaFills:m0(t.areaFills),annotations:g0(t.annotations),seriesOverrides:v0(t.series),scenes:t.scenes,sort:s,sortMode:c,theme:a==null?void 0:String(a)||void 0}}const P6=new Set;function Roe(t,e,n){let o=e;for(const r of t)r.transformType==="sort"?o=li.Total:P6.has(r.transformType)||(P6.add(r.transformType),console.warn(`[blueprint-chart] Unknown transform "${r.transformType}" in ${n}; ignored.`));return o}function Foe(){return{properties:new Map,chartTypeOptions:{},colorizes:[],highlights:[],areaFills:[],annotations:[],seriesOverrides:[],hiddenAnnotationIds:new Set,transforms:[]}}function Voe(t,e,n){const o=Foe();for(let r=0;r<=e;r++){const i=t[r],s=Wr(i.properties),a=s.get("type");a&&(o.chartType=a);const l=o.chartType??n;i.data&&(o.data=i.data);const c=ug(l,i.properties);if(o.chartTypeOptions={...o.chartTypeOptions,...c},i.colorizes.length>0?o.colorizes=i.colorizes:i.data&&(o.colorizes=[]),r===e&&(o.highlights=i.highlights),i.areaFills.length>0&&(o.areaFills=i.areaFills),i.annotations.length>0){const u=[...o.annotations];for(const d of i.annotations){const f=Wr(d.properties).get("id");if(f!=null){const h=u.findIndex(g=>Wr(g.properties).get("id")===f);if(h>=0){u[h]=d;continue}}u.push(d)}o.annotations=u}for(const u of i.annotationVisibility)u.action===tC.Hide?o.hiddenAnnotationIds.add(u.id):o.hiddenAnnotationIds.delete(u.id);i.series.length>0&&(o.seriesOverrides=i.series),i.transforms.length>0&&(o.transforms=[...o.transforms,...i.transforms]);for(const[u,d]of s)o.properties.set(u,d)}return o}function zoe(t,e){const n=t.options??(t.properties?d0(t.chartType,ug(t.chartType,t.properties)):{}),o={chartType:t.chartType,data:t.data,options:n,frame:t.frame,colorizes:t.colorizes??[],highlights:t.highlights??[],areaFills:t.areaFills??[],annotations:t.annotations??[],seriesOverrides:t.seriesOverrides??[],sort:t.sort,sortMode:t.sortMode,theme:t.theme};if(e==null||!t.scenes||e<0||e>=t.scenes.length)return o;const r=Voe(t.scenes,e,t.chartType),i=r.chartType??t.chartType,s=r.data?hs(f0(r.data)):o.data,a=Object.keys(r.chartTypeOptions).length>0?d0(i,{...n,...r.chartTypeOptions}):n,l=r.colorizes.length>0?h0(r.colorizes):r.data?[]:o.colorizes,c=e!=null?p0(r.highlights):o.highlights,u=r.areaFills.length>0?m0(r.areaFills):o.areaFills,d=r.annotations.length>0?g0(r.annotations):[],f=[...o.annotations,...d],h=r.hiddenAnnotationIds.size>0?f.filter(x=>!x.id||!r.hiddenAnnotationIds.has(x.id)):f,g=r.seriesOverrides.length>0?v0(r.seriesOverrides):o.seriesOverrides,v=Roe(r.transforms,o.sortMode,`scene ${e}`),m=["title","description","source","sourceUrl","byline","note"],b={};for(const x of m){const _=r.properties.get(x);typeof _=="string"&&(b[x]=_)}const y=Object.keys(b).length>0?{...o.frame,...b}:o.frame;return{...o,chartType:i,data:s,options:a,frame:y,colorizes:l,highlights:c,areaFills:u,annotations:h,seriesOverrides:g,sortMode:v}}const Q1=new WeakMap;function Hoe(t){const e=Q1.get(t);if(!(!e||e.size===0)){for(const n of e)t.style[n]="";e.clear()}}function yc(t,e){let n=Q1.get(t);n||(n=new Set,Q1.set(t,n)),n.add(e)}function Woe(t,e,n){if(Hoe(t),n.ignoreLayout||!e)return{constrained:!1};const o=Wr(e),r=o.get("heightMode"),i=o.get("aspectRatio"),s=o.get("fixedHeight");let a=!1;if(r==="aspect-ratio"&&i){const l=String(i).split(":").map(Number);l.length===2&&l[0]>0&&l[1]>0&&(t.style.aspectRatio=`${l[0]} / ${l[1]}`,t.style.height="auto",yc(t,"aspectRatio"),yc(t,"height"),a=!0)}else r==="fixed"&&s&&(t.style.height=`${s}px`,yc(t,"height"),a=!0);return a&&(t.style.display="flex",t.style.flexDirection="column",t.style.overflow="hidden",yc(t,"display"),yc(t,"flexDirection"),yc(t,"overflow")),{constrained:a}}const L2=new WeakMap;function X$(t){t.querySelectorAll("[data-bc-fade-overlay]").forEach(e=>{typeof e.getAnimations=="function"&&e.getAnimations().forEach(n=>n.cancel()),e.remove()})}function Uoe(t,e,n){if(!n)return null;const o=L2.get(t);return!o||o===e?null:(X$(t),Mr(t))}function Goe(t,e,n){if(L2.set(t,e),n){const o=t.querySelector(".bc-frame .bc-frame-body");o&&Tr(o),Or(t,n)}}function D6(t){L2.delete(t),X$(t)}function qoe(t,e,n){const o=t.querySelector(".bc-frame");if(!o)return;const r=[];o.classList.forEach(i=>{i.startsWith("bc-theme-")&&r.push(i)});for(const i of r)o.classList.remove(i);e.theme&&o.classList.add(`bc-theme-${e.theme}`),n.constrained&&o.classList.add("bc-frame--constrained")}function P2(t,e,n={}){var h;if(n.transition||(t.replaceChildren(),D6(t)),e.data.labels.length===0){n.transition&&(t.replaceChildren(),D6(t));return}let o=e;if(n.stripColors){const g={...e};if(e.properties&&(g.properties=e.properties.filter(v=>v.key!=="colors"&&v.key!=="colorPalette")),e.options){const{colors:v,colorPalette:m,...b}=e.options;g.options=b}o=g}const r=Woe(t,o.properties,n),i=zoe(o,n.sceneIndex),s=Mne(i.chartType);if(!s)return;const a=Uoe(t,i.chartType,!!n.transition);a&&t.replaceChildren();const l=$r(t),c=G$(i.options,l);let u;if(n.thumbnail)u=null;else{const g=((h=i.frame)==null?void 0:h.padding)??n.padding??"16px";u={...i.frame??{},padding:g}}const d=oc(t);n.transition&&d.beginCommit(),s(t,i.data,{frame:u,sort:i.sort,sortMode:i.sortMode,...c,colorizes:i.colorizes.length>0?i.colorizes:void 0,highlights:i.highlights.length>0?i.highlights:void 0,areaFills:i.areaFills.length>0?i.areaFills:void 0,annotations:i.annotations.length>0?i.annotations:void 0,seriesOverrides:i.seriesOverrides.length>0?i.seriesOverrides:void 0},!!n.transition),n.transition&&d.commit({mode:n.transitionMode});const f=n.theme??i.theme;qoe(t,{theme:f},r),Goe(t,i.chartType,a)}function K$(t,e,n){if(!e){n!=null&&n.transition||t.replaceChildren();return}const o=cg(e),r=Noe(o);P2(t,r,n)}const E6="abcdefghijklmnopqrstuvwxyz0123456789";function Yoe(){let t="";for(let e=0;e<8;e++)t+=E6[Math.floor(Math.random()*E6.length)];return t}const joe=Bo("scenes",()=>{const t=ze([]),e=Re(-1),n=Re(!1);let o=null;const r=A(()=>e.value<0||e.value>=t.value.length?null:t.value[e.value]);function i(){const b=Yoe();return t.value.push({id:b,name:null}),b}function s(b){b<0||b>=t.value.length||(t.value.splice(b,1),e.value>=t.value.length&&(e.value=t.value.length>0?t.value.length-1:-1),t.value.length===0&&(e.value=-1))}function a(b,y){b<0||b>=t.value.length||(t.value[b]={...t.value[b],...y})}function l(b){b!==e.value&&(b===-1||b>=0&&b<t.value.length)&&(e.value=b)}function c(){l(e.value+1)}function u(){l(e.value-1)}function d(b,y){if(b<0||b>=t.value.length||y<0||y>=t.value.length)return;const[x]=t.value.splice(b,1);t.value.splice(y,0,x),e.value===b?e.value=y:b<e.value&&y>=e.value?e.value--:b>e.value&&y<=e.value&&e.value++}function f(){n.value||(n.value=!0,t.value.length!==0&&(e.value=-1,o=setInterval(()=>{e.value<t.value.length-1?e.value++:h()},3e3)))}function h(){n.value=!1,o!==null&&(clearInterval(o),o=null)}function g(){h(),t.value=[],e.value=-1}function v(){return{scenes:t.value.map(b=>({...b})),activeIndex:e.value}}function m(b){h(),t.value=b.scenes.map(y=>({...y})),e.value=b.activeIndex}return{scenes:t,activeIndex:e,playing:n,activeScene:r,add:i,remove:s,update:a,setActive:l,nextScene:c,previousScene:u,reorder:d,startPlayback:f,stopPlayback:h,reset:g,snapshot:v,hydrate:m}});function _n(){const t=joe(),{scenes:e,activeIndex:n,playing:o,activeScene:r}=$t(t);return{scenes:e,activeIndex:n,playing:o,activeScene:r,add:t.add,remove:t.remove,update:t.update,setActive:t.setActive,nextScene:t.nextScene,previousScene:t.previousScene,reorder:t.reorder,startPlayback:t.startPlayback,stopPlayback:t.stopPlayback,reset:t.reset,snapshot:t.snapshot,hydrate:t.hydrate}}function b0(t,e){if(t===e)return!0;if(t==null||e==null)return!1;if(Array.isArray(t)&&Array.isArray(e))return t.length!==e.length?!1:t.every((n,o)=>b0(n,e[o]));if(typeof t=="object"&&typeof e=="object"){const n=Object.keys(t),o=Object.keys(e);return n.length!==o.length?!1:n.every(r=>b0(t[r],e[r]))}return!1}function Z$(t){return!(t===void 0||Array.isArray(t)&&t.length===0)}function I6(t,e,n,o){for(let r=o-1;r>=0;r--){const i=n[r];if(i&&e in i&&Z$(i[e]))return i[e]}return t}function N6(t,e,n,o){for(let r=o-1;r>=0;r--){const i=n[r];if(i!=null&&i.properties&&e in i.properties)return String(i.properties[e])}return t}const af={sizing:"max-width",fixedWidth:600,maxWidth:660,heightMode:"auto",fixedHeight:400,aspectRatio:"16:9",padding:16,transparentBackground:!1,playerType:"buttons",playerPosition:"left"},R6={chartType:Le.BarVertical,title:"",description:"",byline:"",source:"",sourceUrl:"",note:"",sort:Qt.None,sortMode:"none",data:"",selectedColumn:"",colorizes:[],highlights:[],areaFills:[],annotations:[],seriesOverrides:[],layout:{...af}};function cl(t,e){return A({get(){const{activeScene:n,activeIndex:o,scenes:r}=_n(),i=n.value;return i&&e in i&&Z$(i[e])?i[e]:o.value>=0?I6(t.value,e,r.value,o.value):t.value},set(n){const{activeIndex:o,activeScene:r,update:i,scenes:s}=_n();if(o.value>=0&&r.value){const a=I6(t.value,e,s.value,o.value);if(b0(n,a)){const l={...r.value};delete l[e],s.value[o.value]=l}else i(o.value,{[e]:n});return}t.value=n}})}function da(t,e){return A({get(){const{activeScene:n,activeIndex:o,scenes:r}=_n(),i=n.value;return i!=null&&i.properties&&e in i.properties?String(i.properties[e]):o.value>=0?N6(t.value,e,r.value,o.value):t.value},set(n){const{activeIndex:o,activeScene:r,update:i,scenes:s}=_n();if(o.value>=0&&r.value){const a=N6(t.value,e,s.value,o.value);if(n===a){const l={...r.value.properties};delete l[e];const c=Object.keys(l).length>0?l:void 0,u={...r.value,properties:c};c||delete u.properties,s.value[o.value]=u}else{const l=r.value.properties??{};i(o.value,{properties:{...l,[e]:n}})}return}t.value=n}})}const Xoe=Bo("chartConfig",()=>{const t=lr({...R6}),e=Q0(t),n=cl(e.chartType,"chartType"),o=cl(e.data,"data"),r=cl(e.colorizes,"colorizes"),i=cl(e.highlights,"highlights"),s=cl(e.areaFills,"areaFills"),a=cl(e.annotations,"annotations"),l=cl(e.seriesOverrides,"seriesOverrides"),c=da(e.title,"title"),u=da(e.description,"description"),d=da(e.byline,"byline"),f=da(e.source,"source"),h=da(e.sourceUrl,"sourceUrl"),g=da(e.note,"note"),v=da(e.sort,"sort"),m=da(e.sortMode,"sortMode");function b(){Object.assign(t,{...R6,colorizes:[],highlights:[],areaFills:[],annotations:[],seriesOverrides:[],layout:{...af}})}function y(x){Object.assign(t,{...x,layout:{...af,...x.layout}})}return{chartType:n,data:o,colorizes:r,highlights:i,areaFills:s,annotations:a,seriesOverrides:l,title:c,description:u,byline:d,source:f,sourceUrl:h,note:g,sort:v,sortMode:m,layout:e.layout,selectedColumn:e.selectedColumn,_base:Me(e),reset:b,hydrate:y}});function hn(){const t=Xoe(),e=$t(t);return{chartType:e.chartType,data:e.data,colorizes:e.colorizes,highlights:e.highlights,areaFills:e.areaFills,annotations:e.annotations,seriesOverrides:e.seriesOverrides,title:e.title,description:e.description,byline:e.byline,source:e.source,sourceUrl:e.sourceUrl,note:e.note,sort:e.sort,sortMode:e.sortMode,layout:e.layout,selectedColumn:e.selectedColumn,_base:t._base,reset:t.reset,hydrate:t.hydrate}}function Koe(t){const e=t.split(`
|
|
641
|
+
`)[0]??"",n=(e.match(/\t/g)??[]).length,o=(e.match(/,/g)??[]).length;return n>=o?" ":","}function _h(t,e){if(e===" ")return t.split(" ").map(i=>i.trim());const n=[];let o="",r=!1;for(let i=0;i<t.length;i++){const s=t[i];s==='"'?r&&t[i+1]==='"'?(o+='"',i++):r=!r:s===e&&!r?(n.push(o.trim()),o=""):o+=s}return n.push(o.trim()),n}const Zoe=[/^\d{4}-\d{2}-\d{2}$/,/^\d{4}-\d{2}$/,/^\d{4}$/,/^\d{1,2}\/\d{1,2}\/\d{2,4}$/,/^\d{1,2}-\d{1,2}-\d{2,4}$/,/^(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s+\d{1,2},?\s+\d{4}$/i,/^\d{4}\/\d{2}\/\d{2}$/,/^\d{4}\/\d{2}$/,/^Q[1-4]\s+\d{4}$/];function Qoe(t){if(!t)return!1;for(const e of Zoe)if(e.test(t))return/^\d{4}(-\d{2})?$/.test(t)||/^\d{4}\/\d{2}$/.test(t)||/^Q[1-4]\s+\d{4}$/.test(t)?!0:!Number.isNaN(Date.parse(t));return!1}function Q$(t){const e=t.match(/^[<>≤≥~]\s*(.+)$/);if(e){const n=e[1].replace(/[,%$€£¥₹]/g,"").trim();if(n.length>0&&!Number.isNaN(Number(n)))return e[1].trim()}return t}function Joe(t){if(!t)return!1;const e=Q$(t).replace(/[,%$€£¥₹]/g,"").trim();return e.length>0&&!Number.isNaN(Number(e))}function J1(t,e){return t.map((n,o)=>{const r=e.map(i=>i[o]??"").filter(i=>i.length>0);return r.length===0?"string":r.every(Qoe)?"date":r.every(Joe)?"number":"string"})}function J$(t){var s;const e=t.split(`
|
|
642
|
+
`).map(a=>a.trim()).filter(Boolean);if(e.length===0)return{columns:[],rows:[],columnTypes:[]};const n=(s=e[0])==null?void 0:s.match(/^_series\s*=\s*(.+)$/);if(n){const a=n[1].trim(),c=["label",...a.includes('","')?a.split(",").map(f=>f.trim().replace(/^"|"$/g,"")):a.replace(/^"|"$/g,"").split(",").map(f=>f.trim())],u=[];for(let f=1;f<e.length;f++){const h=e[f].match(/^"([^"]+)"\s*=\s*([^"]+)$/),v=e[f].match(/^"([^"]+)"\s*=\s*"([^"]*)"$/)??h;v&&u.push([v[1],...v[2].split(",").map(m=>m.trim())])}const d=J1(c,u);return{columns:c,rows:u,columnTypes:d}}const o=["label","value"],r=[];for(const a of e){const l=a.match(/^"([^"]+)"\s*=\s*(.+)$/);l&&r.push([l[1],l[2].replace(/%$/,"").trim()])}const i=J1(o,r);return{columns:o,rows:r,columnTypes:i}}function F6(t,e,n=" "){const o=s=>n===" "?s:s.includes(n)||s.includes('"')||s.includes(`
|
|
643
|
+
`)?`"${s.replace(/"/g,'""')}"`:s,r=t.map(o).join(n),i=e.map(s=>s.map(o).join(n));return[r,...i].join(`
|
|
644
|
+
`)}function eb(t,e){const n=e??{},o=n.trimWhitespace!==!1,r=t.split(`
|
|
645
|
+
`).filter(u=>u.trim().length>0);if(r.length===0)return{columns:[],rows:[],columnTypes:[]};const i=n.delimiter&&n.delimiter!=="auto"?n.delimiter:Koe(t),s=n.firstRowIsHeader!==!1;let a,l;s?(a=_h(r[0],i),l=r.slice(1).map(u=>_h(u,i))):(a=_h(r[0],i).map((d,f)=>`Column ${f+1}`),l=r.map(d=>_h(d,i))),o&&(a=a.map(u=>u.trim()),l=l.map(u=>u.map(d=>d.trim()))),n.decimalSeparator===","&&(l=l.map(u=>u.map(d=>/^\d+,\d+$/.test(d)?d.replace(",","."):d))),l=l.map(u=>u.map(Q$));const c=J1(a,l);return{columns:a,rows:l,columnTypes:c}}var Je=(t=>(t.Sort="sort",t.Filter="filter",t.HideColumns="hide-columns",t.Transpose="transpose",t.Parse="parse",t.Rename="rename",t.GroupBy="group-by",t.Computed="computed",t))(Je||{}),vo=(t=>(t.Equals="equals",t.NotEquals="not-equals",t.Contains="contains",t.GreaterThan="greater-than",t.LessThan="less-than",t))(vo||{}),Rt=(t=>(t.Type="type",t.String="string",t.Numeric="numeric",t.Date="date",t))(Rt||{});const Eo=["string","number","date"],ip=[{id:"to-number",label:"To Number",description:"Strip non-numeric characters and convert to number",category:Rt.Type,accepts:Eo,outputType:"number"},{id:"to-string",label:"To String",description:"Keep value as plain text",category:Rt.Type,accepts:Eo,outputType:"string"},{id:"to-date",label:"To Date",description:"Parse text into an ISO date",category:Rt.Type,accepts:Eo,outputType:"date"},{id:"to-boolean",label:"To Boolean",description:"Map yes/no, true/false, 1/0 to boolean",category:Rt.Type,accepts:Eo,outputType:"string"},{id:"parse-json",label:"Parse JSON",description:"Parse JSON string and optionally extract a key",category:Rt.Type,accepts:["string"],outputType:"string",params:["key"]},{id:"trim",label:"Trim",description:"Remove leading and trailing whitespace",category:Rt.String,accepts:Eo,outputType:"string"},{id:"lowercase",label:"Lowercase",description:"Convert all characters to lowercase",category:Rt.String,accepts:Eo,outputType:"string"},{id:"uppercase",label:"Uppercase",description:"Convert all characters to uppercase",category:Rt.String,accepts:Eo,outputType:"string"},{id:"title-case",label:"Title Case",description:"Capitalize the first letter of each word",category:Rt.String,accepts:Eo,outputType:"string"},{id:"slugify",label:"Slugify",description:"Lowercase and replace non-alphanumeric with hyphens",category:Rt.String,accepts:Eo,outputType:"string"},{id:"regex-replace",label:"Regex Replace",description:"Find and replace using a regular expression",category:Rt.String,accepts:Eo,outputType:"string",params:["pattern","replacement"]},{id:"extract",label:"Extract Substring",description:"Extract a portion of text by character position",category:Rt.String,accepts:Eo,outputType:"string",params:["start","end"]},{id:"pad-start",label:"Pad Start",description:"Pad the beginning to a fixed length",category:Rt.String,accepts:Eo,outputType:"string",params:["length","char"]},{id:"pad-end",label:"Pad End",description:"Pad the end to a fixed length",category:Rt.String,accepts:Eo,outputType:"string",params:["length","char"]},{id:"remove-diacritics",label:"Remove Diacritics",description:"Strip accents and diacritical marks",category:Rt.String,accepts:Eo,outputType:"string"},{id:"split",label:"Split into Columns",description:"Split values by a separator into new columns",category:Rt.String,accepts:Eo,outputType:"string",params:["separator","limit"]},{id:"round",label:"Round",description:"Round to a number of decimal places",category:Rt.Numeric,accepts:["number"],outputType:"number",params:["decimals"]},{id:"floor",label:"Floor",description:"Round down to the nearest integer",category:Rt.Numeric,accepts:["number"],outputType:"number"},{id:"ceil",label:"Ceiling",description:"Round up to the nearest integer",category:Rt.Numeric,accepts:["number"],outputType:"number"},{id:"abs",label:"Absolute Value",description:"Remove the sign (make positive)",category:Rt.Numeric,accepts:["number"],outputType:"number"},{id:"clamp",label:"Clamp",description:"Constrain values between a min and max",category:Rt.Numeric,accepts:["number"],outputType:"number",params:["min","max"]},{id:"log",label:"Logarithm",description:"Natural log — compress wide-range values for charting",category:Rt.Numeric,accepts:["number"],outputType:"number"},{id:"exp",label:"Exponential",description:"Raise e to the power of each value",category:Rt.Numeric,accepts:["number"],outputType:"number"},{id:"normalize",label:"Normalize (0–1)",description:"Scale values to 0–1 range for cross-series comparison",category:Rt.Numeric,accepts:["number"],outputType:"number"},{id:"standardize",label:"Standardize (z-score)",description:"Center around mean, scale by std deviation",category:Rt.Numeric,accepts:["number"],outputType:"number"},{id:"bin",label:"Bin/Bucket",description:"Group values into fixed-size buckets",category:Rt.Numeric,accepts:["number"],outputType:"number",params:["size"]},{id:"extract-year",label:"Extract Year",description:"Get the four-digit year as a number",category:Rt.Date,accepts:["date"],outputType:"number"},{id:"extract-month",label:"Extract Month",description:"Get the month (1–12) as a number",category:Rt.Date,accepts:["date"],outputType:"number"},{id:"extract-day",label:"Extract Day",description:"Get the day of the month as a number",category:Rt.Date,accepts:["date"],outputType:"number"},{id:"extract-weekday",label:"Extract Weekday",description:"Get the day name (Monday, Tuesday, …)",category:Rt.Date,accepts:["date"],outputType:"string"},{id:"extract-hour",label:"Extract Hour",description:"Get the hour (0–23) as a number",category:Rt.Date,accepts:["date"],outputType:"number"},{id:"shift-date",label:"Shift Date",description:"Add or subtract days, months, or years",category:Rt.Date,accepts:["date"],outputType:"date",params:["amount","unit"]},{id:"truncate-date",label:"Truncate to Period",description:"Round down to start of week, month, quarter, or year",category:Rt.Date,accepts:["date"],outputType:"date",params:["period"]},{id:"date-diff",label:"Duration Since",description:"Days between each date and a reference date",category:Rt.Date,accepts:["date"],outputType:"number",params:["reference"]}],D2=new Map(ip.map(t=>[t.id,t]));function eT(t,e){const n=D2.get(t);return n?n.accepts.includes(e):!1}function ere(t){var e;return((e=D2.get(t))==null?void 0:e.outputType)??"string"}function fa(t,e){const n=parseFloat(t);if(Number.isNaN(n))return t;const o=e(n);return Number.isNaN(o)?t:String(o)}function _s(t,e){const n=new Date(t);return Number.isNaN(n.getTime())?t:e(n)}function tre(t,e,n){switch(e){case"to-number":{const o=Number(t.replace(/[^0-9.\-+eE]/g,""));return Number.isNaN(o)?"":String(o)}case"to-string":return t;case"to-date":return _s(t,o=>o.toISOString());case"to-boolean":{const o=t.toLowerCase().trim();return["true","1","yes","on","y"].includes(o)?"true":["false","0","no","off","n",""].includes(o)?"false":t}case"parse-json":try{const o=JSON.parse(t);return n.key?String(o[n.key]??""):JSON.stringify(o)}catch{return t}default:return t}}function nre(t,e,n){switch(e){case"trim":return t.trim();case"lowercase":return t.toLowerCase();case"uppercase":return t.toUpperCase();case"title-case":return t.replace(/\w\S*/g,o=>o.charAt(0).toUpperCase()+o.slice(1).toLowerCase());case"slugify":return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");case"regex-replace":{if(!n.pattern)return t;try{return t.replace(new RegExp(n.pattern,"g"),n.replacement??"")}catch{return t}}case"extract":return t.slice(Number(n.start)||0,n.end?Number(n.end):void 0);case"pad-start":return t.padStart(Number(n.length)||0,n.char||" ");case"pad-end":return t.padEnd(Number(n.length)||0,n.char||" ");case"remove-diacritics":return t.normalize("NFD").replace(/[\u0300-\u036f]/g,"");default:return t}}function ore(t,e,n){switch(e){case"round":{const r=10**(Number(n.decimals)||0);return fa(t,i=>Math.round(i*r)/r)}case"floor":return fa(t,Math.floor);case"ceil":return fa(t,Math.ceil);case"abs":return fa(t,Math.abs);case"clamp":{const o=n.min?Number(n.min):-1/0,r=n.max?Number(n.max):1/0;return fa(t,i=>Math.min(Math.max(i,o),r))}case"log":return fa(t,o=>o>0?Math.log(o):NaN);case"exp":return fa(t,Math.exp);case"bin":{const o=Number(n.size)||1;return fa(t,r=>Math.floor(r/o)*o)}default:return t}}function rre(t,e,n){switch(e){case"extract-year":return _s(t,o=>String(o.getFullYear()));case"extract-month":return _s(t,o=>String(o.getMonth()+1));case"extract-day":return _s(t,o=>String(o.getDate()));case"extract-weekday":return _s(t,o=>o.toLocaleDateString("en",{weekday:"long"}));case"extract-hour":return _s(t,o=>String(o.getHours()));case"shift-date":return _s(t,o=>{const r=Number(n.amount)||0,i=n.unit||"days";return i==="years"?o.setFullYear(o.getFullYear()+r):i==="months"?o.setMonth(o.getMonth()+r):o.setDate(o.getDate()+r),o.toISOString()});case"truncate-date":return _s(t,o=>{const r=n.period||"month";return r==="year"?new Date(o.getFullYear(),0,1).toISOString():r==="quarter"?new Date(o.getFullYear(),Math.floor(o.getMonth()/3)*3,1).toISOString():r==="month"?new Date(o.getFullYear(),o.getMonth(),1).toISOString():(r==="week"&&(o.setDate(o.getDate()-o.getDay()),o.setHours(0,0,0,0)),o.toISOString())});case"date-diff":{const o=new Date(n.reference||new Date().toISOString());return Number.isNaN(o.getTime())?t:_s(t,r=>String(Math.round((r.getTime()-o.getTime())/(1e3*60*60*24))))}default:return t}}function ire(t,e,n){return e.startsWith("to-")||e==="parse-json"?tre(t,e,n):new Set(["round","floor","ceil","abs","clamp","log","exp","bin"]).has(e)?ore(t,e,n):e.startsWith("extract-")||e.startsWith("shift-")||e.startsWith("truncate-")||e==="date-diff"?rre(t,e,n):nre(t,e,n)}const sre="";function are(t,e){const n=t.rows.map(o=>{const r=[...o];return r[e]=sre,r});return{columns:[...t.columns],rows:n,columnTypes:[...t.columnTypes]}}function lre(t,e,n){const o=n.separator||",",r=n.limit?Number(n.limit):void 0;let i=0;const s=t.rows.map(d=>{const f=d[e].split(o),h=r?f.slice(0,r):f;return i=Math.max(i,h.length),h}),a=[...t.columns],l=[...t.columnTypes],c=[];for(let d=0;d<i;d++)c.push(`${n.column}_${d+1}`);a.splice(e,1,...c),l.splice(e,1,...Array(i).fill("string"));const u=t.rows.map((d,f)=>{const h=s[f],g=[...d],v=[...h,...Array(i-h.length).fill("")];return g.splice(e,1,...v),g});return{columns:a,rows:u,columnTypes:l}}function cre(t,e,n){const o=t.rows.map(s=>parseFloat(s[e])).filter(s=>!Number.isNaN(s));if(o.length===0)return t;const r=t.rows.map(s=>[...s]),i=[...t.columnTypes];if(i[e]="number",n==="normalize"){const s=Math.min(...o),l=Math.max(...o)-s;for(const c of r){const u=parseFloat(c[e]);c[e]=Number.isNaN(u)?c[e]:String(l===0?0:(u-s)/l)}}else{const s=o.reduce((c,u)=>c+u,0)/o.length,a=o.reduce((c,u)=>c+(u-s)**2,0)/o.length,l=Math.sqrt(a);for(const c of r){const u=parseFloat(c[e]);c[e]=Number.isNaN(u)?c[e]:String(l===0?0:(u-s)/l)}}return{columns:[...t.columns],rows:r,columnTypes:i}}function ure(t,e){const n=t.columns.indexOf(e.column);if(n<0||!e.column||!e.operation)return t;const o=e.operation,r=t.columnTypes[n];if(!eT(o,r))return are(t,n);if(o==="split")return lre(t,n,e);if(o==="normalize"||o==="standardize")return cre(t,n,o);const i=t.rows.map(a=>[...a]);for(const a of i)a[n]=ire(a[n],o,e);const s=[...t.columnTypes];return s[n]=ere(o),{columns:[...t.columns],rows:i,columnTypes:s}}function lf(t){return Number(t.replace(/[,%$€£¥₹]/g,"").trim())||0}function dre(t,e,n){if(n==="number")return lf(t)-lf(e);if(n==="date"){const o=Date.parse(t)||0,r=Date.parse(e)||0;return o-r}return t.localeCompare(e)}function E2(t){return t.columns?t.columns.split(",").map(e=>e.trim()).filter(Boolean):t.column?[t.column]:[]}function fre(t,e){const n=E2(e);if(n.length===0)return t;const o=n.map(a=>t.columns.indexOf(a)).filter(a=>a>=0);if(o.length===0)return t;const r=e.direction===Qt.Descending?-1:1,i=e.operation;if(i&&o.length>1){const a=[...t.rows].sort((l,c)=>{const u=o.map(g=>lf(l[g]??"")),d=o.map(g=>lf(c[g]??""));let f,h;return i==="avg"?(f=u.reduce((g,v)=>g+v,0)/u.length,h=d.reduce((g,v)=>g+v,0)/d.length):(f=u.reduce((g,v)=>g+v,0),h=d.reduce((g,v)=>g+v,0)),r*(f-h)});return{...t,rows:a}}const s=[...t.rows].sort((a,l)=>{for(const c of o){const u=t.columnTypes[c]??"string",d=dre(a[c]??"",l[c]??"",u);if(d!==0)return r*d}return 0});return{...t,rows:s}}function hre(t,e,n){if(!n&&e!==vo.Equals&&e!==vo.NotEquals)return!0;switch(e){case vo.Equals:return t===n;case vo.NotEquals:return t!==n;case vo.Contains:return t.toLowerCase().includes(n.toLowerCase());case vo.GreaterThan:{const o=Number(t.replace(/[,%$€£¥₹]/g,"").trim()),r=Number(n);return!Number.isNaN(o)&&!Number.isNaN(r)&&o>r}case vo.LessThan:{const o=Number(t.replace(/[,%$€£¥₹]/g,"").trim()),r=Number(n);return!Number.isNaN(o)&&!Number.isNaN(r)&&o<r}default:return!0}}function pre(t,e){const n=t.columns.indexOf(e.column);if(n<0||!e.column)return t;const o=t.rows.filter(r=>hre(r[n]??"",e.condition??vo.Equals,e.value??""));return{...t,rows:o}}function mre(t,e){const n=E2(e);if(n.length===0)return t;const o=t.columns.map((r,i)=>n.includes(r)?-1:i).filter(r=>r>=0);return o.length===t.columns.length?t:{columns:o.map(r=>t.columns[r]),rows:t.rows.map(r=>o.map(i=>r[i])),columnTypes:o.map(r=>t.columnTypes[r])}}function gre(t){if(t.rows.length===0||t.columns.length===0)return t;const e=["Field",...t.rows.map(r=>r[0]??"")],n=[],o=["string"];for(let r=1;r<t.columns.length;r++){const i=[t.columns[r]];for(let s=0;s<t.rows.length;s++)i.push(t.rows[s][r]??"");n.push(i)}for(let r=0;r<t.rows.length;r++){const i=n.map(s=>s[r+1]??"").filter(s=>s.length>0);i.length>0&&i.every(s=>!Number.isNaN(Number(s.replace(/[,%$€£¥₹]/g,"").trim()))&&s.trim().length>0)?o.push("number"):o.push("string")}return{columns:e,rows:n,columnTypes:o}}function vre(t,e){const n=t.columns.indexOf(e.column);if(n<0||!e.column||!e.newName)return t;const o=[...t.columns];return o[n]=e.newName,{...t,columns:o}}const tT={sum:t=>t.reduce((e,n)=>e+n,0),avg:t=>t.reduce((e,n)=>e+n,0)/t.length,min:t=>Math.min(...t),max:t=>Math.max(...t)};function bre(t,e){return t.split(",").map(n=>n.trim()).filter(Boolean).map(n=>{const o=n.lastIndexOf(":");if(o<0)return null;const r=n.slice(0,o),i=n.slice(o+1);if(i!=="count"&&!tT[i])return null;const s=i==="count"?-1:e.indexOf(r);return i!=="count"&&s<0?null:{col:r,fn:i,colIndex:s}}).filter(n=>n!==null)}function yre(t,e,n){if(t==="count")return String(e.length);const o=e.map(r=>lf(r[n]??""));return String(tT[t](o))}function xre(t,e){const n=E2({columns:e.groupColumns}).map(i=>t.columns.indexOf(i)).filter(i=>i>=0);if(n.length===0||!e.aggregates)return t;const o=bre(e.aggregates,t.columns);if(o.length===0)return t;const r=new Map;for(const i of t.rows){const s=n.map(c=>i[c]??""),a=s.join("\0"),l=r.get(a);l?l.rows.push(i):r.set(a,{key:s,rows:[i]})}return{columns:[...n.map(i=>t.columns[i]),...o.map(i=>`${i.col}_${i.fn}`)],columnTypes:[...n.map(i=>t.columnTypes[i]),...o.map(()=>"number")],rows:[...r.values()].map(({key:i,rows:s})=>[...i,...o.map(a=>yre(a.fn,s,a.colIndex))])}}const wre=Bo("dataTransforms",()=>{const t=ze([]);let e=1;function n(h,g={}){const v=String(e++);return t.value.push({id:v,type:h,config:g}),v}function o(h){const g=t.value.findIndex(v=>v.id===h);g>=0&&t.value.splice(g,1)}function r(h,g){const v=t.value.find(m=>m.id===h);v&&(v.config={...g})}function i(h,g){const v=t.value.findIndex(b=>b.id===h);if(v<0||g<0||g>=t.value.length)return;const[m]=t.value.splice(v,1);t.value.splice(g,0,m)}function s(h,g,v,m){let b={columns:[...g],rows:v.map(y=>[...y]),columnTypes:[...m]};for(const y of h)switch(y.type){case Je.Sort:b=fre(b,y.config);break;case Je.Filter:b=pre(b,y.config);break;case Je.HideColumns:b=mre(b,y.config);break;case Je.Transpose:b=gre(b);break;case Je.Parse:b=ure(b,y.config);break;case Je.Rename:b=vre(b,y.config);break;case Je.GroupBy:b=xre(b,y.config);break}return b}function a(h,g,v){return s(t.value,h,g,v)}function l(h,g,v,m){const b=t.value.slice(0,h);return s(b,g,v,m)}function c(h,g,v){const{config:m}=h;if(m.column&&!g.includes(m.column))return`Column "${m.column}" not found`;if(h.type===Je.Parse&&m.column&&m.operation){const b=g.indexOf(m.column);if(b>=0&&!eT(m.operation,v[b])){const y=D2.get(m.operation);return`${(y==null?void 0:y.label)??m.operation} requires ${y==null?void 0:y.accepts.join(" or ")} column, got ${v[b]}`}}return h.type===Je.Rename?m.column?m.newName?null:"New name is required":"No column selected":h.type===Je.Filter&&!m.column||h.type===Je.Sort&&!m.column&&!m.columns?"No column selected":h.type===Je.GroupBy?m.groupColumns?m.aggregates?null:"No aggregates defined":"No group columns selected":null}function u(){t.value=[],e=1}function d(h){t.value=h.map(g=>({...g,config:{...g.config}})),e=h.reduce((g,v)=>Math.max(g,Number(v.id)||0),0)+1}function f(){return t.value.map(h=>({id:h.id,type:h.type,config:{...h.config}}))}return{steps:t,addStep:n,removeStep:o,updateStep:r,moveStep:i,applyStepList:s,applyTransforms:a,getColumnsAtStep:l,validateStep:c,reset:u,hydrate:d,snapshot:f}});function Lr(){const t=wre(),{steps:e}=$t(t);return{steps:e,addStep:t.addStep,removeStep:t.removeStep,updateStep:t.updateStep,moveStep:t.moveStep,applyStepList:t.applyStepList,applyTransforms:t.applyTransforms,getColumnsAtStep:t.getColumnsAtStep,validateStep:t.validateStep,reset:t.reset,hydrate:t.hydrate,snapshot:t.snapshot}}function Fa(t,e){if(e<0||e>=t.length)return null;const n={id:t[e].id,name:t[e].name},o=new Set;for(let r=0;r<=e;r++){const i=t[r];if(i.chartType!==void 0&&(n.chartType=i.chartType),i.data!==void 0&&(n.data=i.data),i.chartTypeOptions!==void 0&&(n.chartTypeOptions=n.chartTypeOptions?{...n.chartTypeOptions,...i.chartTypeOptions}:{...i.chartTypeOptions}),i.colorizes!==void 0&&i.colorizes.length>0?n.colorizes=i.colorizes:i.data!==void 0&&(n.colorizes=[]),r===e&&(n.highlights=i.highlights),i.areaFills!==void 0&&i.areaFills.length>0&&(n.areaFills=i.areaFills),i.annotations!==void 0&&i.annotations.length>0&&(n.annotations=i.annotations),i.annotationVisibility)for(const s of i.annotationVisibility)s.action==="hide"?o.add(s.id):o.delete(s.id);i.seriesOverrides!==void 0&&i.seriesOverrides.length>0&&(n.seriesOverrides=i.seriesOverrides),i.transforms!==void 0&&(n.transforms=i.transforms),i.properties!==void 0&&(n.properties=n.properties?{...n.properties,...i.properties}:{...i.properties})}return o.size>0&&(n.hiddenAnnotationIds=o),n}function nT(t,e){var n;if(e<0||e>=t.length)return-1;for(let o=e;o>=0;o--)if(((n=t[o])==null?void 0:n.data)!==void 0)return o;return-1}function oT(t){var e,n;if((e=t==null?void 0:t.transforms)!=null&&e.length){for(let o=t.transforms.length-1;o>=0;o--)if(t.transforms[o].type===Je.Sort)return((n=t.transforms[o].config)==null?void 0:n.direction)??Qt.Ascending}}function V6(t){return/^-?\d+(\.\d+)?%?$/.test(t)?t:`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function dg(t,e){if(t.length<=2)return e.map(i=>{const s=i[0]??"",a=i[1]??"";return`"${s}" = ${V6(a)}`}).join(`
|
|
646
|
+
`);const o=`_series = ${t.slice(1).map(i=>`"${i}"`).join(",")}`,r=e.map(i=>{const s=i[0]??"",a=i.slice(1).map(l=>V6(l??"")).join(",");return`"${s}" = ${a}`});return[o,...r].join(`
|
|
647
|
+
`)}const _re=Bo("dataTable",()=>{const t=lr({columns:[],rows:[],rawInput:"",columnTypes:[]}),e=Re("delimited"),n=Re(""),o=Re(null),{steps:r,applyTransforms:i,applyStepList:s}=Lr(),{activeIndex:a,scenes:l}=_n(),c=A(()=>{var k;if(a.value>=0){const E=Fa(l.value,a.value);if(E!=null&&E.data)return J$(E.data)}let _={columns:t.columns,rows:t.rows,columnTypes:t.columnTypes};if(r.value.length>0&&(_=i(t.columns,t.rows,t.columnTypes)),a.value>=0&&_.columns.length>0){const E=Fa(l.value,a.value);(k=E==null?void 0:E.transforms)!=null&&k.length&&(_=s(E.transforms,_.columns,_.rows,_.columnTypes))}return _}),u=A(()=>c.value.columns),d=A(()=>c.value.rows),f=A(()=>c.value.columnTypes),h=A(()=>r.value.length>0);function g(_,k){t.columns=[..._.columns],t.rows=_.rows.map(E=>[...E]),t.columnTypes=_.columnTypes?[..._.columnTypes]:_.columns.map(()=>"string"),o.value=Date.now(),k!=null&&k.label&&(n.value=k.label)}function v(_,k){_>=0&&_<t.columns.length&&(t.columns[_]=k)}function m(_,k){_>=0&&_<t.columnTypes.length&&(t.columnTypes[_]=k)}function b(){return dg(u.value,d.value)}function y(){t.columns=[],t.rows=[],t.rawInput="",t.columnTypes=[],n.value="",o.value=null}function x(_){t.columns=_.columns,t.rows=_.rows,t.rawInput=_.rawInput,t.columnTypes=_.columnTypes??_.columns.map(()=>"string")}return{...Q0(t),sourceFormat:e,sourceLabel:n,loadedAt:o,displayColumns:u,displayRows:d,displayColumnTypes:f,hasTransforms:h,loadParsed:g,renameColumn:v,setColumnType:m,serialize:b,reset:y,hydrate:x}});function Ko(){const t=_re(),{columns:e,rows:n,rawInput:o,columnTypes:r,sourceFormat:i,sourceLabel:s,loadedAt:a,displayColumns:l,displayRows:c,displayColumnTypes:u,hasTransforms:d}=$t(t);return{columns:e,rows:n,rawInput:o,columnTypes:r,sourceFormat:i,sourceLabel:s,loadedAt:a,displayColumns:l,displayRows:c,displayColumnTypes:u,hasTransforms:d,loadParsed:t.loadParsed,renameColumn:t.renameColumn,setColumnType:t.setColumnType,serialize:t.serialize,reset:t.reset,hydrate:t.hydrate}}const kre=Bo("chartTypeOptions",()=>{const t=lr({});function e(d){q$(d),t[d]||(t[d]={})}const{chartType:n,_base:o}=hn(),r=A(()=>{var m,b;const d=t[n.value]??{},f=d0(n.value,d),{activeScene:h,activeIndex:g,scenes:v}=_n();if(g.value>=0){let y={...f};for(let x=0;x<=g.value;x++){const _=(m=v.value[x])==null?void 0:m.chartTypeOptions;_&&(y={...y,..._})}return y}return(b=h.value)!=null&&b.chartTypeOptions?{...f,...h.value.chartTypeOptions}:f}),i=A(()=>{const d=t[o.chartType.value]??{};return d0(o.chartType.value,d)}),s=A(()=>cu(n.value)),a=A(()=>s.value.map(d=>d.key));function l(d,f){var m;const{activeIndex:h,activeScene:g,scenes:v}=_n();if(h.value>=0&&g.value){let y=(t[n.value]??{})[d];for(let x=h.value-1;x>=0;x--){const _=(m=v.value[x])==null?void 0:m.chartTypeOptions;if(_&&d in _){y=_[d];break}}if(b0(f,y)){const x={...g.value.chartTypeOptions};delete x[d];const _=Object.keys(x).length>0?x:void 0,k={...g.value};_?k.chartTypeOptions=_:delete k.chartTypeOptions,v.value[h.value]=k}else{const x=g.value.chartTypeOptions??{};v.value[h.value]={...g.value,chartTypeOptions:{...x,[d]:f}}}return}t[n.value]||(t[n.value]={}),t[n.value][d]=f}qe(n,(d,f)=>{var _;e(d);const{activeIndex:h,activeScene:g,scenes:v}=_n(),m=h.value>=0&&g.value!=null;let b;if(m){let k={...t[f]??{}};for(let E=0;E<=h.value;E++){const L=(_=v.value[E])==null?void 0:_.chartTypeOptions;L&&(k={...k,...L})}b=k}else b=t[f]??{};if(Object.keys(b).length===0)return;const y=cu(d).map(k=>k.key);if(y.length===0)return;const x=t[d]??{};for(const k of y)if(k in b){if(m){const E=g.value.chartTypeOptions??{};if(!(k in E)&&!(k in x)){const L=b[k],S=Array.isArray(L)?[...L]:L;v.value[h.value]={...g.value,chartTypeOptions:{...E,[k]:S}}}}else if(!(k in x)){const E=b[k],L=t[d];Array.isArray(E)?L[k]=[...E]:L[k]=E}}},{flush:"sync"});function c(){for(const d of Object.keys(t))delete t[d]}function u(d){c();for(const[f,h]of Object.entries(d))t[f]=h}return{currentOptions:r,baseOptions:i,availableOptionKeys:a,optionDefs:s,setOption:l,ensureDefaults:e,reset:c,hydrate:u,store:t}});function kn(){const t=kre(),{currentOptions:e,baseOptions:n,availableOptionKeys:o,optionDefs:r}=$t(t);return{currentOptions:e,baseOptions:n,availableOptionKeys:o,optionDefs:r,setOption:t.setOption,ensureDefaults:t.ensureDefaults,reset:t.reset,hydrate:t.hydrate,store:t.store}}const rT=[{value:"blueprint",label:"Blueprint",description:"The default Blueprint Chart theme"},{value:"blueprint-framed",label:"Blueprint Framed",description:"Adds borders and a tinted footer"}],I2=Bo("chartTheme",()=>{const t=Re("blueprint");function e(){t.value="blueprint"}return{chartTheme:t,chartThemeOptions:rT,reset:e}});function iT(){const t=I2(),{chartTheme:e}=$t(t);return{chartTheme:e,availableThemes:rT,reset:t.reset}}const Sre=new Set([Je.Sort,Je.Filter,Je.HideColumns,Je.Transpose,Je.Parse,Je.GroupBy,Je.Computed,"pivot"]);function Fc(){const t=hn(),e=I2(),n=$t(e).chartTheme,{store:o,ensureDefaults:r}=kn(),i=Lr(),s=_n();function a(l){var c,u;try{const d=cg(l);s.setActive(-1),t.chartType.value=d.chartType;const f=Wr(d.properties);t.title.value=String(f.get("title")??""),t.description.value=String(f.get("description")??""),t.byline.value=String(f.get("byline")??""),t.source.value=String(f.get("source")??""),t.sourceUrl.value=String(f.get("sourceUrl")??"");const h=f.get("theme");n.value=h?String(h):"blueprint";const g={},v=f.get("sizing");v&&["responsive","fixed","max-width"].includes(String(v))&&(g.sizing=String(v));const b=f.get("fixedWidth");b!==void 0&&(g.fixedWidth=Number(b));const y=f.get("maxWidth");y!==void 0&&(g.maxWidth=Number(y));const x=f.get("heightMode");x&&["auto","fixed","aspect-ratio"].includes(String(x))&&(g.heightMode=String(x));const k=f.get("fixedHeight");k!==void 0&&(g.fixedHeight=Number(k));const E=f.get("aspectRatio");E!==void 0&&(g.aspectRatio=String(E));const L=f.get("padding");L!==void 0&&(g.padding=Number(L));const S=f.get("transparentBackground");S!==void 0&&(g.transparentBackground=S===!0||S==="true");const B=f.get("player");B&&["buttons","progress-bar","dot-stepper","minimal-arrows","none"].includes(String(B))&&(g.playerType=String(B));const N=f.get("playerPosition");N&&["left","center","right"].includes(String(N))&&(g.playerPosition=String(N)),t.layout.value={...af,...g};const M=f.get("sort");M===Qt.Ascending||M===Qt.Descending?t.sort.value=M:t.sort.value=Qt.None;const P=d.data?f0(d.data):"";if(t.data.value=P,P){const $=Ko(),F=J$(P);$.loadParsed(F),$.rawInput.value=P,$.sourceFormat.value="bpc"}if(o[d.chartType]=ug(d.chartType,d.properties),r(d.chartType),t.colorizes.value=d.colorizes?h0(d.colorizes):[],t.highlights.value=d.highlights?p0(d.highlights):[],t.areaFills.value=d.areaFills?m0(d.areaFills):[],t.annotations.value=d.annotations?g0(d.annotations):[],t.seriesOverrides.value=d.series?v0(d.series):[],(c=d.transforms)!=null&&c.length){i.reset();for(const $ of d.transforms){if(!Sre.has($.transformType))continue;const F=Wr($.properties),V={};for(const[U,K]of F)V[U]=String(K);if($.transformType===Je.Sort&&F.has("direction")){const U=String(F.get("direction"));(U===Qt.Ascending||U===Qt.Descending)&&(t.sort.value=U)}i.addStep($.transformType,V)}}else i.reset();if((u=d.scenes)!=null&&u.length){const $=d.scenes.map(F=>{const V=moe(F,d.chartType),U={id:Math.random().toString(36).slice(2,10),name:V.name};V.chartType&&(U.chartType=V.chartType),V.data&&(U.data=f0(V.data)),Object.keys(V.chartTypeOptions).length>0&&(U.chartTypeOptions=V.chartTypeOptions),V.colorizes.length>0&&(U.colorizes=h0(V.colorizes)),V.highlights.length>0&&(U.highlights=p0(V.highlights)),V.areaFills.length>0&&(U.areaFills=m0(V.areaFills)),V.annotations.length>0&&(U.annotations=g0(V.annotations)),V.series.length>0&&(U.seriesOverrides=v0(V.series)),V.annotationVisibility.length>0&&(U.annotationVisibility=V.annotationVisibility.map(ae=>({action:ae.action,kind:ae.kind,id:ae.id}))),V.transforms.length>0&&(U.transforms=V.transforms.map((ae,me)=>({id:String(me),type:ae.transformType,config:Object.fromEntries(ae.properties.map(de=>[de.key,String(de.value)]))})));const K=Object.fromEntries([...V.properties.entries()].filter(([ae])=>!["type"].includes(ae)));return Object.keys(K).length>0&&(U.properties=K),U});s.hydrate({scenes:$,activeIndex:-1})}else s.reset();return{success:!0}}catch(d){return{success:!1,error:d instanceof Error?d.message:String(d)}}}return{applyDsl:a}}function kh(t){if(typeof t=="number")return String(t);const e=String(t);return e.endsWith("%")?String(parseFloat(e)):`"${e}"`}function Zu(t){if(typeof t=="number")return String(t);const e=String(t);return e.endsWith("%")?`"${e}"`:String(parseFloat(e))}function Rf(){const e=hn()._base,n=$t(I2()).chartTheme,{baseOptions:o}=kn(),{steps:r}=Lr(),{scenes:i}=_n(),s=Ko(),a=Re(!1);function l(){let u=`chart ${e.chartType.value} {
|
|
648
|
+
`;e.title.value&&(u+=` title = "${e.title.value}"
|
|
649
|
+
`),e.description.value&&(u+=` description = "${e.description.value}"
|
|
650
|
+
`),e.byline.value&&(u+=` byline = "${e.byline.value}"
|
|
651
|
+
`),e.source.value&&(u+=` source = "${e.source.value}"
|
|
652
|
+
`),e.sourceUrl.value&&(u+=` sourceUrl = "${e.sourceUrl.value}"
|
|
653
|
+
`),n.value&&n.value!=="blueprint"&&(u+=` theme = "${n.value}"
|
|
654
|
+
`);const d=cu(e.chartType.value),f=d.map(m=>m.key),h=new Map(d.filter(m=>m.default!==void 0).map(m=>[m.key,String(m.default)])),g=o.value;for(const m of f){const b=g[m];b!==void 0&&(a.value&&h.has(m)&&String(b)===h.get(m)||(m==="colors"&&Array.isArray(b)&&b.length>0?u+=` colors = "${b.join(", ")}"
|
|
655
|
+
`:typeof b=="boolean"?u+=` ${m} = ${b}
|
|
656
|
+
`:typeof b=="string"&&b!==""&&(u+=` ${m} = "${b}"
|
|
657
|
+
`)))}const v=Bt(e.layout.value);if(v.sizing!=="max-width"&&(u+=` sizing = "${v.sizing}"
|
|
658
|
+
`),v.sizing==="fixed"&&v.fixedWidth!==600&&(u+=` fixedWidth = ${v.fixedWidth}
|
|
659
|
+
`),v.sizing==="max-width"&&v.maxWidth!==660&&(u+=` maxWidth = ${Zu(v.maxWidth)}
|
|
660
|
+
`),v.heightMode!=="auto"&&(u+=` heightMode = "${v.heightMode}"
|
|
661
|
+
`),v.heightMode==="fixed"&&v.fixedHeight!==400&&(u+=` fixedHeight = ${v.fixedHeight}
|
|
662
|
+
`),v.heightMode==="aspect-ratio"&&v.aspectRatio!=="16:9"&&(u+=` aspectRatio = "${v.aspectRatio}"
|
|
663
|
+
`),v.padding!==16&&(u+=` padding = ${v.padding}
|
|
664
|
+
`),v.transparentBackground&&(u+=` transparentBackground = true
|
|
665
|
+
`),v.playerType&&v.playerType!=="buttons"&&(u+=` player = "${v.playerType}"
|
|
666
|
+
`),v.playerPosition!=="left"&&(u+=` playerPosition = "${v.playerPosition}"
|
|
667
|
+
`),e.data.value){u+=`
|
|
668
|
+
data {
|
|
669
|
+
`;const m=e.data.value.split(`
|
|
670
|
+
`).map(b=>b.trim()).filter(Boolean);u+=m.map(b=>` ${b}`).join(`
|
|
671
|
+
`),u+=`
|
|
672
|
+
}
|
|
673
|
+
`}for(const m of e.colorizes.value)m.target&&(u+=`
|
|
674
|
+
colorize "${m.target}" {
|
|
675
|
+
`,m.color&&(u+=` color = "${m.color}"
|
|
676
|
+
`),m.label&&(u+=` label = "${m.label}"
|
|
677
|
+
`),u+=` }
|
|
678
|
+
`);for(const m of e.highlights.value)m.target&&(u+=`
|
|
679
|
+
highlight "${m.target}"
|
|
680
|
+
`);for(const m of e.areaFills.value)!m.from||!m.to||(u+=`
|
|
681
|
+
areafill "${m.from}" "${m.to}" {
|
|
682
|
+
`,m.color&&(u+=` color = "${m.color}"
|
|
683
|
+
`),m.negativeColor&&(u+=` negativeColor = "${m.negativeColor}"
|
|
684
|
+
`),m.opacity!==void 0&&(u+=` opacity = ${m.opacity}
|
|
685
|
+
`),m.interpolation&&(u+=` interpolation = "${m.interpolation}"
|
|
686
|
+
`),u+=` }
|
|
687
|
+
`);for(const m of e.annotations.value){const b=m.kind??Lt.Point;if(b===Lt.Point){if(!("target"in m)||!m.target)continue;u+=`
|
|
688
|
+
annotation "${m.target}" {
|
|
689
|
+
`,m.id&&(u+=` id = "${m.id}"
|
|
690
|
+
`),m.text&&(u+=` text = "${m.text}"
|
|
691
|
+
`),m.textColor&&(u+=` textColor = "${m.textColor}"
|
|
692
|
+
`),m.maxWidth!==void 0&&(u+=` maxWidth = ${Zu(m.maxWidth)}
|
|
693
|
+
`),m.textOutline!==void 0&&(u+=` textOutline = ${m.textOutline}
|
|
694
|
+
`),m.showLine!==void 0&&(u+=` showLine = ${m.showLine}
|
|
695
|
+
`),m.anchorDirection&&(u+=` anchorDirection = ${m.anchorDirection}
|
|
696
|
+
`),m.textOffsetX!==void 0&&(u+=` textOffsetX = ${m.textOffsetX}
|
|
697
|
+
`),m.textOffsetY!==void 0&&(u+=` textOffsetY = ${m.textOffsetY}
|
|
698
|
+
`),m.lineStyle&&(u+=` lineStyle = ${m.lineStyle}
|
|
699
|
+
`),m.lineWeight!==void 0&&(u+=` lineWeight = ${m.lineWeight}
|
|
700
|
+
`),m.showArrow!==void 0&&(u+=` showArrow = ${m.showArrow}
|
|
701
|
+
`),m.lineTargetDistance!==void 0&&(u+=` lineTargetDistance = ${m.lineTargetDistance}
|
|
702
|
+
`),m.showCircle!==void 0&&(u+=` showCircle = ${m.showCircle}
|
|
703
|
+
`),m.circleSize!==void 0&&(u+=` circleSize = ${m.circleSize}
|
|
704
|
+
`),m.circleStyle&&(u+=` circleStyle = ${m.circleStyle}
|
|
705
|
+
`),m.circleColor&&(u+=` circleColor = "${m.circleColor}"
|
|
706
|
+
`),u+=` }
|
|
707
|
+
`}else if(b===Lt.Range){const y=m;u+=`
|
|
708
|
+
range {
|
|
709
|
+
`,y.id&&(u+=` id = "${y.id}"
|
|
710
|
+
`),y.start!==void 0&&(u+=` start = ${typeof y.start=="string"?`"${y.start}"`:y.start}
|
|
711
|
+
`),y.end!==void 0&&(u+=` end = ${typeof y.end=="string"?`"${y.end}"`:y.end}
|
|
712
|
+
`),y.orientation&&(u+=` orientation = ${y.orientation}
|
|
713
|
+
`),y.startAnchor&&y.startAnchor!=="center"&&(u+=` startAnchor = ${y.startAnchor}
|
|
714
|
+
`),y.endAnchor&&y.endAnchor!=="center"&&(u+=` endAnchor = ${y.endAnchor}
|
|
715
|
+
`),y.bgColor&&(u+=` bgColor = "${y.bgColor}"
|
|
716
|
+
`),y.bgOpacity!==void 0&&(u+=` bgOpacity = ${y.bgOpacity}
|
|
717
|
+
`),y.direction&&(u+=` direction = ${y.direction}
|
|
718
|
+
`),y.text&&(u+=` text = "${y.text}"
|
|
719
|
+
`),y.textColor&&(u+=` textColor = "${y.textColor}"
|
|
720
|
+
`),u+=` }
|
|
721
|
+
`}else if(b===Lt.Free){const y=m;u+=`
|
|
722
|
+
note {
|
|
723
|
+
`,y.id&&(u+=` id = "${y.id}"
|
|
724
|
+
`),y.text&&(u+=` text = "${y.text}"
|
|
725
|
+
`),y.x!==void 0&&(u+=` x = ${kh(y.x)}
|
|
726
|
+
`),y.y!==void 0&&(u+=` y = ${kh(y.y)}
|
|
727
|
+
`),y.textColor&&(u+=` textColor = "${y.textColor}"
|
|
728
|
+
`),y.maxWidth!==void 0&&(u+=` maxWidth = ${Zu(y.maxWidth)}
|
|
729
|
+
`),y.textOutline!==void 0&&(u+=` textOutline = ${y.textOutline}
|
|
730
|
+
`),u+=` }
|
|
731
|
+
`}}for(const m of r.value){u+=`
|
|
732
|
+
transform ${m.type} {
|
|
733
|
+
`;for(const[b,y]of Object.entries(m.config))y!==void 0&&y!==""&&(u+=` ${b} = "${y}"
|
|
734
|
+
`);u+=` }
|
|
735
|
+
`}if(e.sort.value!==Qt.None){const m=s.displayColumns.value,b=m.length>2?m.slice(1):m.length>1?[m[1]]:[m[0]??""];u+=`
|
|
736
|
+
transform ${Je.Sort} {
|
|
737
|
+
`,b.length>1?(u+=` columns = "${b.join(",")}"
|
|
738
|
+
`,u+=` operation = sum
|
|
739
|
+
`):u+=` column = "${b[0]}"
|
|
740
|
+
`,u+=` direction = ${e.sort.value}
|
|
741
|
+
`,u+=` }
|
|
742
|
+
`}for(const m of e.seriesOverrides.value)m.name&&(u+=`
|
|
743
|
+
series "${m.name}" {
|
|
744
|
+
`,m.color&&(u+=` color = "${m.color}"
|
|
745
|
+
`),m.lineWidth!==void 0&&(u+=` lineWidth = ${m.lineWidth}
|
|
746
|
+
`),m.dash&&(u+=` dash = "${m.dash}"
|
|
747
|
+
`),m.interpolation&&(u+=` interpolation = "${m.interpolation}"
|
|
748
|
+
`),m.labelMode&&(u+=` labelMode = "${m.labelMode}"
|
|
749
|
+
`),m.labelText&&(u+=` labelText = "${m.labelText}"
|
|
750
|
+
`),m.valueLabels!==void 0&&(u+=` valueLabels = ${m.valueLabels}
|
|
751
|
+
`),m.lineSymbols!==void 0&&(u+=` lineSymbols = ${m.lineSymbols}
|
|
752
|
+
`),m.hidden!==void 0&&(u+=` hidden = ${m.hidden}
|
|
753
|
+
`),m.symbolShape&&(u+=` symbolShape = "${m.symbolShape}"
|
|
754
|
+
`),m.symbolShowOn&&(u+=` symbolShowOn = "${m.symbolShowOn}"
|
|
755
|
+
`),m.symbolStyle&&(u+=` symbolStyle = "${m.symbolStyle}"
|
|
756
|
+
`),m.symbolSize!==void 0&&(u+=` symbolSize = ${m.symbolSize}
|
|
757
|
+
`),m.symbolOpacity!==void 0&&(u+=` symbolOpacity = ${m.symbolOpacity}
|
|
758
|
+
`),u+=` }
|
|
759
|
+
`);for(const m of Bt(i.value)){if(m.name!==null?u+=`
|
|
760
|
+
scene "${m.name}" {
|
|
761
|
+
`:u+=`
|
|
762
|
+
scene {
|
|
763
|
+
`,m.chartType&&(u+=` type = ${m.chartType}
|
|
764
|
+
`),m.properties)for(const[b,y]of Object.entries(m.properties))typeof y=="string"?u+=` ${b} = "${y}"
|
|
765
|
+
`:u+=` ${b} = ${y}
|
|
766
|
+
`;if(m.chartTypeOptions){const b=m.chartType||e.chartType.value,x=cu(b).map(_=>_.key);for(const _ of x){const k=m.chartTypeOptions[_];k!==void 0&&(_==="colors"&&Array.isArray(k)&&k.length>0?u+=` colors = "${k.join(", ")}"
|
|
767
|
+
`:typeof k=="boolean"?u+=` ${_} = ${k}
|
|
768
|
+
`:typeof k=="string"&&k!==""&&(u+=` ${_} = "${k}"
|
|
769
|
+
`))}}if(m.data){u+=`
|
|
770
|
+
data {
|
|
771
|
+
`;const b=m.data.split(`
|
|
772
|
+
`).map(y=>y.trim()).filter(Boolean);u+=b.map(y=>` ${y}`).join(`
|
|
773
|
+
`),u+=`
|
|
774
|
+
}
|
|
775
|
+
`}if(m.colorizes)for(const b of m.colorizes)b.target&&(u+=`
|
|
776
|
+
colorize "${b.target}" {
|
|
777
|
+
`,b.color&&(u+=` color = "${b.color}"
|
|
778
|
+
`),b.label&&(u+=` label = "${b.label}"
|
|
779
|
+
`),u+=` }
|
|
780
|
+
`);if(m.highlights)for(const b of m.highlights)b.target&&(u+=`
|
|
781
|
+
highlight "${b.target}"
|
|
782
|
+
`);if(m.areaFills)for(const b of m.areaFills)!b.from||!b.to||(u+=`
|
|
783
|
+
areafill "${b.from}" "${b.to}" {
|
|
784
|
+
`,b.color&&(u+=` color = "${b.color}"
|
|
785
|
+
`),u+=` }
|
|
786
|
+
`);if(m.annotations)for(const b of m.annotations){const y=b.kind??Lt.Point;if(y===Lt.Point){if(!("target"in b)||!b.target)continue;u+=`
|
|
787
|
+
annotation "${b.target}" {
|
|
788
|
+
`,b.id&&(u+=` id = "${b.id}"
|
|
789
|
+
`),b.text&&(u+=` text = "${b.text}"
|
|
790
|
+
`),b.textColor&&(u+=` textColor = "${b.textColor}"
|
|
791
|
+
`),b.maxWidth!==void 0&&(u+=` maxWidth = ${Zu(b.maxWidth)}
|
|
792
|
+
`),b.textOutline!==void 0&&(u+=` textOutline = ${b.textOutline}
|
|
793
|
+
`),b.showLine!==void 0&&(u+=` showLine = ${b.showLine}
|
|
794
|
+
`),b.anchorDirection&&(u+=` anchorDirection = ${b.anchorDirection}
|
|
795
|
+
`),b.textOffsetX!==void 0&&(u+=` textOffsetX = ${b.textOffsetX}
|
|
796
|
+
`),b.textOffsetY!==void 0&&(u+=` textOffsetY = ${b.textOffsetY}
|
|
797
|
+
`),b.lineStyle&&(u+=` lineStyle = ${b.lineStyle}
|
|
798
|
+
`),b.lineWeight!==void 0&&(u+=` lineWeight = ${b.lineWeight}
|
|
799
|
+
`),b.showArrow!==void 0&&(u+=` showArrow = ${b.showArrow}
|
|
800
|
+
`),b.lineTargetDistance!==void 0&&(u+=` lineTargetDistance = ${b.lineTargetDistance}
|
|
801
|
+
`),b.showCircle!==void 0&&(u+=` showCircle = ${b.showCircle}
|
|
802
|
+
`),b.circleSize!==void 0&&(u+=` circleSize = ${b.circleSize}
|
|
803
|
+
`),b.circleStyle&&(u+=` circleStyle = ${b.circleStyle}
|
|
804
|
+
`),b.circleColor&&(u+=` circleColor = "${b.circleColor}"
|
|
805
|
+
`),u+=` }
|
|
806
|
+
`}else if(y===Lt.Range){const x=b;u+=`
|
|
807
|
+
range {
|
|
808
|
+
`,x.id&&(u+=` id = "${x.id}"
|
|
809
|
+
`),x.start!==void 0&&(u+=` start = ${typeof x.start=="string"?`"${x.start}"`:x.start}
|
|
810
|
+
`),x.end!==void 0&&(u+=` end = ${typeof x.end=="string"?`"${x.end}"`:x.end}
|
|
811
|
+
`),x.orientation&&(u+=` orientation = ${x.orientation}
|
|
812
|
+
`),x.startAnchor&&x.startAnchor!=="center"&&(u+=` startAnchor = ${x.startAnchor}
|
|
813
|
+
`),x.endAnchor&&x.endAnchor!=="center"&&(u+=` endAnchor = ${x.endAnchor}
|
|
814
|
+
`),x.bgColor&&(u+=` bgColor = "${x.bgColor}"
|
|
815
|
+
`),x.bgOpacity!==void 0&&(u+=` bgOpacity = ${x.bgOpacity}
|
|
816
|
+
`),x.direction&&(u+=` direction = ${x.direction}
|
|
817
|
+
`),x.text&&(u+=` text = "${x.text}"
|
|
818
|
+
`),x.textColor&&(u+=` textColor = "${x.textColor}"
|
|
819
|
+
`),u+=` }
|
|
820
|
+
`}else if(y===Lt.Free){const x=b;u+=`
|
|
821
|
+
note {
|
|
822
|
+
`,x.id&&(u+=` id = "${x.id}"
|
|
823
|
+
`),x.text&&(u+=` text = "${x.text}"
|
|
824
|
+
`),x.x!==void 0&&(u+=` x = ${kh(x.x)}
|
|
825
|
+
`),x.y!==void 0&&(u+=` y = ${kh(x.y)}
|
|
826
|
+
`),x.textColor&&(u+=` textColor = "${x.textColor}"
|
|
827
|
+
`),x.maxWidth!==void 0&&(u+=` maxWidth = ${Zu(x.maxWidth)}
|
|
828
|
+
`),x.textOutline!==void 0&&(u+=` textOutline = ${x.textOutline}
|
|
829
|
+
`),u+=` }
|
|
830
|
+
`}}if(m.annotationVisibility){const b={[Lt.Point]:"annotation",[Lt.Range]:"range",[Lt.Free]:"note"};for(const y of m.annotationVisibility)u+=` ${y.action}_${b[y.kind]} "${y.id}"
|
|
831
|
+
`}if(m.seriesOverrides)for(const b of m.seriesOverrides)b.name&&(u+=`
|
|
832
|
+
series "${b.name}" {
|
|
833
|
+
`,b.color&&(u+=` color = "${b.color}"
|
|
834
|
+
`),u+=` }
|
|
835
|
+
`);if(m.transforms)for(const b of m.transforms){u+=`
|
|
836
|
+
transform ${b.type} {
|
|
837
|
+
`;for(const[y,x]of Object.entries(b.config))x!==void 0&&x!==""&&(u+=` ${y} = "${x}"
|
|
838
|
+
`);u+=` }
|
|
839
|
+
`}u+=` }
|
|
840
|
+
`}return u+=`}
|
|
841
|
+
`,u}const c=Re("");return em(()=>{c.value=l()},{flush:"post"}),{dsl:c,compact:a,generateDsl:l}}function Cc(t){return`data:image/svg+xml;base64,${globalThis.btoa(unescape(encodeURIComponent(t)))}`}function sT(){return document.documentElement.getAttribute("data-bs-theme")??"light"}const aT=t=>`blueprint-chart:${t}:thumbnail:${sT()}`,lT=t=>`blueprint-chart:${t}:preview:${sT()}`;function cT(t){for(const e of t.querySelectorAll("*")){if(!(e instanceof SVGElement))continue;const n=globalThis.getComputedStyle(e),o=n.fill;if(o&&o!=="none"){const i=e.getAttribute("fill");(!i||i==="currentColor"||i.startsWith("var("))&&e.setAttribute("fill",o)}const r=n.stroke;if(r&&r!=="none"){const i=e.getAttribute("stroke");(!i||i==="currentColor"||i.startsWith("var("))&&e.setAttribute("stroke",r)}}}function uT(t){const e=t.querySelector("svg");if(!e)return null;const n=e.getAttribute("width"),o=e.getAttribute("height");return n&&o&&!e.getAttribute("viewBox")&&e.setAttribute("viewBox",`0 0 ${n} ${o}`),e.removeAttribute("width"),e.removeAttribute("height"),e.getAttribute("xmlns")||e.setAttribute("xmlns","http://www.w3.org/2000/svg"),cT(e),e.outerHTML}function Are(t){const e=t.querySelector(".bc-frame");if(!e)return null;const n=e.querySelector("svg");if(!n)return null;const o=e.getBoundingClientRect(),r=globalThis.getComputedStyle(e).backgroundColor||"#ffffff",i=[],s=".bc-frame-title, .bc-frame-description, .bc-frame-byline, .bc-frame-source, .bc-frame-credit";for(const x of e.querySelectorAll(s)){const _=x.getBoundingClientRect();if(_.width===0)continue;const k=globalThis.getComputedStyle(x);i.push({text:x.textContent??"",x:_.left-o.left,y:_.top-o.top+parseFloat(k.fontSize),fontSize:parseFloat(k.fontSize),fontWeight:k.fontWeight,fontFamily:k.fontFamily,fill:k.color,fontStyle:k.fontStyle!=="normal"?k.fontStyle:void 0})}const a=n.getBoundingClientRect(),l=a.left-o.left,c=a.top-o.top,u=a.width,d=a.height;cT(n);const f=n.cloneNode(!0);f.removeAttribute("width"),f.removeAttribute("height");const g=new XMLSerializer().serializeToString(f),v=Math.ceil(o.width),m=Math.ceil(o.height),b=x=>x.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),y=i.map(x=>`<text x="${x.x}" y="${x.y}" font-size="${x.fontSize}px" font-weight="${x.fontWeight}" font-family="${b(x.fontFamily)}" fill="${x.fill}"${x.fontStyle?` font-style="${x.fontStyle}"`:""}>${b(x.text)}</text>`).join(`
|
|
842
|
+
`);return[`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 ${v} ${m}">`,` <rect width="100%" height="100%" fill="${r}" />`,` ${y}`,` <g transform="translate(${l},${c})">`,` <svg width="${u}" height="${d}"${f.getAttribute("viewBox")?` viewBox="${f.getAttribute("viewBox")}"`:""}>`,g.replace(/^<svg[^>]*>/,"").replace(/<\/svg>$/,"")," </svg>"," </g>","</svg>"].join(`
|
|
843
|
+
`)}function N2(t,e,n,o,r,i){const s=document.createElement("div"),a=n?`height:${n}px;`:"";s.style.cssText=`position:fixed;left:-9999px;top:0;width:${e}px;${a}overflow:hidden;`,s.id=t,i!=null&&i.forceLightTheme&&s.setAttribute("data-bs-theme","light");const l=document.createElement("style");l.textContent=o,document.head.appendChild(l),document.body.appendChild(s);try{return r(s)}finally{document.body.removeChild(s),document.head.removeChild(l)}}function Cre(t){const e=t.match(/allowDarkMode\s*=\s*(true|false)/);return e?e[1]==="true":!0}const dT=600,R2=400,fT=[`#__bc_thumb .bc-frame { height:${R2}px; display:flex; flex-direction:column; }`,"#__bc_thumb .bc-frame-header, #__bc_thumb .bc-frame-footer { display:none; }","#__bc_thumb .bc-frame-body { flex:1; min-height:0; }"].join(`
|
|
844
|
+
`);function hT(t){return document.documentElement.getAttribute("data-bs-theme")==="dark"&&!Cre(t)}function pT(t){const e=hT(t);return N2("__bc_thumb",dT,R2,fT,n=>(K$(n,t,{thumbnail:!0}),uT(n)),{forceLightTheme:e})}function F2(t,e,n,o,r){return e.labels.length===0?null:N2("__bc_thumb",dT,R2,fT,i=>(P2(i,{chartType:t,data:e,options:n,sort:o,colorizes:r==null?void 0:r.colorizes,seriesOverrides:r==null?void 0:r.seriesOverrides},{thumbnail:!0}),uT(i)))}const $re=600,Tre=500,Mre=["#__bc_preview .bc-frame { display:flex; flex-direction:column; }",`#__bc_preview .bc-frame-body { height:${Tre}px; min-height:0; }`].join(`
|
|
845
|
+
`);function mT(t){const e=hT(t);return N2("__bc_preview",$re,null,Mre,n=>(K$(n,t,{padding:"12px"}),Are(n)),{forceLightTheme:e})}function tb(t){return localStorage.getItem(aT(t))}function nb(t,e){localStorage.setItem(aT(t),e)}function gT(t){localStorage.removeItem(`blueprint-chart:${t}:thumbnail:light`),localStorage.removeItem(`blueprint-chart:${t}:thumbnail:dark`),localStorage.removeItem(`blueprint-chart:${t}:thumbnail`)}function Ore(t){return localStorage.getItem(lT(t))}function vT(t,e){localStorage.setItem(lT(t),e)}function Bre(t){localStorage.removeItem(`blueprint-chart:${t}:preview:light`),localStorage.removeItem(`blueprint-chart:${t}:preview:dark`),localStorage.removeItem(`blueprint-chart:${t}:preview`)}function bT(t){return t.trimStart().startsWith("{")}function yT(t){if(!bT(t))return pT(t);const e=JSON.parse(t);if(!e.chartConfig)return null;const{chartConfig:n,chartTypeOptions:o}=e,r=hs(n.data),i=[Le.BarVertical,Le.BarHorizontal,Le.Line,Le.VerticalBar,Le.HorizontalBar];if(r.series&&r.series.length>0&&i.includes(n.chartType)){const a=r.series.find(l=>l.name===n.selectedColumn);a&&(r.values=a.values),delete r.series}const s=(o??{})[n.chartType]??{};return F2(n.chartType,r,s,n.sort)}function Lre(t){return bT(t)?yT(t):mT(t)}function Pre(){const t=hn(),{currentOptions:e}=kn(),{sessionId:n}=Xs();if(!n.value||!t.data.value)return;const o=hs(t.data.value),r=[Le.BarVertical,Le.BarHorizontal,Le.Line,Le.VerticalBar,Le.HorizontalBar];if(o.series&&o.series.length>0&&r.includes(t.chartType.value)){const l=o.series.find(c=>c.name===t.selectedColumn.value);l&&(o.values=l.values),delete o.series}const i=F2(t.chartType.value,o,e.value,t.sort.value,{colorizes:t.colorizes.value.length>0?t.colorizes.value:void 0,seriesOverrides:t.seriesOverrides.value.length>0?t.seriesOverrides.value:void 0});i&&nb(n.value,i);const{generateDsl:s}=Rf(),a=s();if(a){const l=mT(a);l&&vT(n.value,l)}}const z6="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";function sp(){let t="";for(let e=0;e<11;e++)t+=z6[Math.floor(Math.random()*z6.length)];return t}function $v(t){return`blueprint-chart:${t}`}function Sh(t){return`blueprint-chart:${t}:meta`}function H6(t){return t.trimStart().startsWith("{")}const Dre=Bo("chartSession",()=>{const t=Re(""),e=Re(null),n=ze(null),o=ze(""),r=hn(),i=Ko(),s=Lr(),a=kn(),l=_n();function c(){if(!t.value)return;const{generateDsl:L}=Rf();localStorage.setItem($v(t.value),L());const S=new Date().toISOString(),B={savedAt:S,sheetNumber:n.value,sheetId:o.value};i.sourceFormat.value==="delimited"&&i.rawInput.value&&(B.rawInput=i.rawInput.value,B.sourceLabel=i.sourceLabel.value,B.sourceFormat="delimited"),localStorage.setItem(Sh(t.value),JSON.stringify(B)),e.value=S}function u(L){const S=localStorage.getItem($v(L));if(!S)return!1;try{if(H6(S)){const M=JSON.parse(S);if(M.chartConfig)return d(L,M)}const{applyDsl:B}=Fc();if(!B(S).success)return!1;const N=localStorage.getItem(Sh(L));let C;return N&&(C=JSON.parse(N),C.sourceFormat==="delimited"&&C.rawInput&&(i.rawInput.value=C.rawInput,i.sourceFormat.value="delimited",C.sourceLabel&&(i.sourceLabel.value=C.sourceLabel))),t.value=L,e.value=(C==null?void 0:C.savedAt)??null,n.value=(C==null?void 0:C.sheetNumber)??null,o.value=(C==null?void 0:C.sheetId)??crypto.randomUUID(),!0}catch{return!1}}function d(L,S){try{return r.hydrate(S.chartConfig),S.dataTable&&i.hydrate(S.dataTable),t.value=L,n.value=null,o.value=crypto.randomUUID(),!0}catch{return!1}}function f(){r.reset(),i.reset(),s.reset(),a.reset(),l.reset(),t.value=""}function h(){f(),e.value=null,n.value=null,o.value=crypto.randomUUID()}function g(){if(n.value!==null)return;const L=Object.keys(localStorage).filter(B=>B.startsWith("blueprint-chart:")&&B.endsWith(":meta"));let S=0;for(const B of L)try{const D=JSON.parse(localStorage.getItem(B)||"{}");if(D.sheetNumber){const N=parseInt(D.sheetNumber,10);Number.isFinite(N)&&N>S&&(S=N)}}catch{}n.value=String(S+1).padStart(3,"0"),c()}function v(){return t.value=sp(),c(),_(),t.value}function m(){f(),t.value=sp(),n.value=null,o.value=crypto.randomUUID()}function b(L){i.rawInput.value=L.tsvData;const S=eb(L.tsvData);i.loadParsed(S),r.data.value=i.serialize();const{applyDsl:B}=Fc();B(L.dsl)}function y(L){return u(L)}function x(L){if(!L)return null;try{cg(L)}catch{return null}f();const{applyDsl:S}=Fc();return S(L).success?(t.value=sp(),n.value=null,o.value=crypto.randomUUID(),c(),_(),t.value):(f(),null)}function _(){qe([r.chartType,r.title,r.description,r.byline,r.note,r.source,r.sourceUrl,r.sort,r.data,r.selectedColumn,r.colorizes,r.highlights,r.areaFills,r.annotations,r.seriesOverrides,r.layout,i.columns,i.rows,i.rawInput,i.columnTypes,s.steps,l.scenes,l.activeIndex,()=>a.store],c,{deep:!0,flush:"post"})}function k(){var B;const L=[],S="blueprint-chart:";for(let D=0;D<localStorage.length;D++){const N=localStorage.key(D);if(!N||!N.startsWith(S))continue;const C=N.slice(S.length);if(C.includes(":"))continue;const M=localStorage.getItem(N);if(M)try{if(H6(M)){const te=JSON.parse(M);if(te.chartConfig){L.push({id:C,title:te.chartConfig.title||"",description:te.chartConfig.description||"",chartType:te.chartConfig.chartType||"",savedAt:te.savedAt??null,sceneCount:((B=te.chartConfig.scenes)==null?void 0:B.length)??0,rowCount:te.chartConfig.data?te.chartConfig.data.split(`
|
|
846
|
+
`).filter(pe=>pe.trim()).length-1:0,allowDarkMode:te.chartConfig.allowDarkMode??!0,sheetNumber:null,sheetId:""});continue}}const P=M.match(/title\s*=\s*"([^"]*)"/),$=M.match(/description\s*=\s*"([^"]*)"/),F=M.match(/^chart\s+(\S+)/),V=M.match(/\bscene\s+"/g),U=M.match(/data\s*\{([^}]*)\}/),K=U?U[1].split(`
|
|
847
|
+
`).filter(te=>te.trim()&&te.includes("=")).length:0,ae=M.match(/allowDarkMode\s*=\s*(true|false)/),me=localStorage.getItem(Sh(C)),de=me?JSON.parse(me):null,ve=(de==null?void 0:de.savedAt)??null;L.push({id:C,title:(P==null?void 0:P[1])??"",description:($==null?void 0:$[1])??"",chartType:(F==null?void 0:F[1])??"",savedAt:ve,sceneCount:(V==null?void 0:V.length)??0,rowCount:K,allowDarkMode:ae?ae[1]==="true":!0,sheetNumber:(de==null?void 0:de.sheetNumber)??null,sheetId:(de==null?void 0:de.sheetId)??""})}catch{}}return L.sort((D,N)=>!D.savedAt&&!N.savedAt?0:D.savedAt?N.savedAt?N.savedAt.localeCompare(D.savedAt):-1:1),L}function E(L){localStorage.removeItem($v(L)),localStorage.removeItem(Sh(L)),gT(L)}return{sessionId:t,lastSavedAt:e,sheetNumber:n,sheetId:o,save:c,load:u,prepareNew:h,assignSheetNumber:g,createSession:v,newChart:m,loadSample:b,loadChart:y,createFromDsl:x,startAutoSave:_,listSavedCharts:k,deleteChart:E}});function Xs(){const t=Dre(),{sessionId:e,lastSavedAt:n,sheetNumber:o,sheetId:r}=$t(t);return{sessionId:e,lastSavedAt:n,sheetNumber:o,sheetId:r,save:t.save,load:t.load,prepareNew:t.prepareNew,assignSheetNumber:t.assignSheetNumber,createSession:t.createSession,newChart:t.newChart,loadSample:t.loadSample,loadChart:t.loadChart,createFromDsl:t.createFromDsl,startAutoSave:t.startAutoSave,listSavedCharts:t.listSavedCharts,deleteChart:t.deleteChart}}const ob=260,W6=660,xT=220,Ere=ob+xT,rb=.22,Du=Bo("panel",()=>{const t=Re("docked"),e=Re(rb),n=Re("docked"),o=Re(!1),r=Re(!1);function i(){t.value="docked",o.value||(n.value="docked")}function s(){t.value="closed",o.value||(n.value="closed")}function a(){t.value==="closed"&&(t.value="docked",o.value||(n.value="docked"))}function l(){t.value!=="drawer"&&(n.value=t.value),t.value="drawer"}function c(){t.value=n.value}function u(){t.value==="docked"?s():t.value==="closed"&&(t.value="docked",o.value||(n.value="docked"))}function d(m){if(!Number.isFinite(m)||m<=0){e.value=rb;return}e.value=Math.min(1,m)}function f(m){o.value=m,m?t.value!=="drawer"&&(t.value="drawer"):t.value==="drawer"&&(t.value=n.value)}function h(m){o.value!==m&&(o.value=m,m?(t.value!=="drawer"&&(n.value=t.value),t.value="drawer"):t.value=n.value)}function g(m){r.value=m,m&&t.value!=="closed"&&t.value!=="drawer"&&(t.value="closed")}function v(m){r.value!==m&&(r.value=m,!o.value&&(m?(t.value!=="closed"&&t.value!=="drawer"&&(n.value=t.value),t.value="closed"):t.value==="closed"&&(t.value=n.value)))}return{mode:t,dockedWidth:e,lastDesktopMode:n,narrow:o,cramped:r,dock:i,close:s,open:a,openDrawer:l,closeDrawer:c,toggleMode:u,setDockedWidth:d,initBreakpoint:f,syncBreakpoint:h,initCramped:g,syncCramped:v}},{persist:{key:"blueprint-chart:panel:v3",pick:["mode","dockedWidth","lastDesktopMode"]}});function ic(){const t=Du(),{mode:e,dockedWidth:n,lastDesktopMode:o,narrow:r,cramped:i}=$t(t);return{mode:e,dockedWidth:n,lastDesktopMode:o,narrow:r,cramped:i,dock:t.dock,close:t.close,open:t.open,openDrawer:t.openDrawer,closeDrawer:t.closeDrawer,toggleMode:t.toggleMode,setDockedWidth:t.setDockedWidth,initBreakpoint:t.initBreakpoint,syncBreakpoint:t.syncBreakpoint,initCramped:t.initCramped,syncCramped:t.syncCramped}}const Ire=Bo("dashboardPanel",()=>{const t=Re(null);function e(o){if(t.value===o){t.value=null;return}t.value=o;const r=Du();r.mode==="closed"&&r.open()}function n(){t.value=null}return{selectedChartId:t,selectChart:e,reset:n}});function wT(){const t=Ire(),{selectedChartId:e}=$t(t);return{selectedChartId:e,selectChart:t.selectChart,reset:t.reset}}function _T(){const{listSavedCharts:t,deleteChart:e}=Xs(),{selectedChartId:n}=wT(),{resolvedTheme:o}=Tf(),r=ze([]),i=lr({}),s=lr({}),a=Re("date-desc"),l=A(()=>{const v=[...r.value];return a.value==="date-desc"?v.sort((m,b)=>(b.savedAt??"").localeCompare(m.savedAt??"")):a.value==="date-asc"?v.sort((m,b)=>(m.savedAt??"").localeCompare(b.savedAt??"")):a.value==="name-asc"&&v.sort((m,b)=>(m.title||"").localeCompare(b.title||"")),v}),c=A(()=>r.value.find(v=>v.id===n.value)??null);function u(){r.value=t(),d()}function d(){for(const v of r.value){const m=tb(v.id),b=Ore(v.id);if(m&&(i[v.id]=Cc(m)),b&&(s[v.id]=Cc(b)),m&&b)continue;const y=localStorage.getItem(`blueprint-chart:${v.id}`);if(y)try{if(!m){const x=yT(y);x&&(nb(v.id,x),i[v.id]=Cc(x))}if(!b){const x=Lre(y);x&&(vT(v.id,x),s[v.id]=Cc(x))}}catch{}}}function f(v){const m=localStorage.getItem(`blueprint-chart:${v}`);if(!m)return null;const b=sp();localStorage.setItem(`blueprint-chart:${b}`,m);const y=localStorage.getItem(`blueprint-chart:${v}:meta`);y&&localStorage.setItem(`blueprint-chart:${b}:meta`,y);const x=tb(v);return x&&nb(b,x),u(),b}function h(v){n.value=null,e(v),delete i[v],delete s[v],u()}function g(){for(const v of r.value)gT(v.id),Bre(v.id),delete i[v.id],delete s[v.id];d()}return qe(o,()=>{g()}),{charts:r,sortedCharts:l,selectedChart:c,thumbnails:i,previews:s,sortValue:a,refresh:u,duplicateChart:f,removeChart:h}}const Nre={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Rre(t,e){return w(),R("svg",Nre,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"m219.31 108.68l-80-80a16 16 0 0 0-22.62 0l-80 80A15.87 15.87 0 0 0 32 120v96a8 8 0 0 0 8 8h64a8 8 0 0 0 8-8v-56h32v56a8 8 0 0 0 8 8h64a8 8 0 0 0 8-8v-96a15.87 15.87 0 0 0-4.69-11.32M208 208h-48v-56a8 8 0 0 0-8-8h-48a8 8 0 0 0-8 8v56H48v-88l80-80l80 80Z"},null,-1)])])}const Fre=Me({name:"ph-house",render:Rre}),Vre={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function zre(t,e){return w(),R("svg",Vre,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M104 40H56a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h48a16 16 0 0 0 16-16V56a16 16 0 0 0-16-16m0 64H56V56h48zm96-64h-48a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h48a16 16 0 0 0 16-16V56a16 16 0 0 0-16-16m0 64h-48V56h48zm-96 32H56a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h48a16 16 0 0 0 16-16v-48a16 16 0 0 0-16-16m0 64H56v-48h48zm96-64h-48a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h48a16 16 0 0 0 16-16v-48a16 16 0 0 0-16-16m0 64h-48v-48h48z"},null,-1)])])}const kT=Me({name:"ph-squares-four",render:zre}),Hre={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Wre(t,e){return w(),R("svg",Hre,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M208.31 75.68A59.78 59.78 0 0 0 202.93 28a8 8 0 0 0-6.93-4a59.75 59.75 0 0 0-48 24h-24a59.75 59.75 0 0 0-48-24a8 8 0 0 0-6.93 4a59.78 59.78 0 0 0-5.38 47.68A58.14 58.14 0 0 0 56 104v8a56.06 56.06 0 0 0 48.44 55.47A39.8 39.8 0 0 0 96 192v8H72a24 24 0 0 1-24-24a40 40 0 0 0-40-40a8 8 0 0 0 0 16a24 24 0 0 1 24 24a40 40 0 0 0 40 40h24v16a8 8 0 0 0 16 0v-40a24 24 0 0 1 48 0v40a8 8 0 0 0 16 0v-40a39.8 39.8 0 0 0-8.44-24.53A56.06 56.06 0 0 0 216 112v-8a58.14 58.14 0 0 0-7.69-28.32M200 112a40 40 0 0 1-40 40h-48a40 40 0 0 1-40-40v-8a41.74 41.74 0 0 1 6.9-22.48a8 8 0 0 0 1.1-7.69a43.8 43.8 0 0 1 .79-33.58a43.88 43.88 0 0 1 32.32 20.06a8 8 0 0 0 6.71 3.69h32.35a8 8 0 0 0 6.74-3.69a43.87 43.87 0 0 1 32.32-20.06a43.8 43.8 0 0 1 .77 33.58a8.09 8.09 0 0 0 1 7.65a41.7 41.7 0 0 1 7 22.52Z"},null,-1)])])}const Ure=Me({name:"ph-github-logo",render:Wre}),Gre={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function qre(t,e){return w(),R("svg",Gre,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M232 48h-72a40 40 0 0 0-32 16a40 40 0 0 0-32-16H24a8 8 0 0 0-8 8v144a8 8 0 0 0 8 8h72a24 24 0 0 1 24 24a8 8 0 0 0 16 0a24 24 0 0 1 24-24h72a8 8 0 0 0 8-8V56a8 8 0 0 0-8-8M96 192H32V64h64a24 24 0 0 1 24 24v112a39.8 39.8 0 0 0-24-8m128 0h-64a39.8 39.8 0 0 0-24 8V88a24 24 0 0 1 24-24h64Z"},null,-1)])])}const Yre=Me({name:"ph-book-open",render:qre}),jre={class:"layout-sidebar__header"},Xre=le({__name:"LayoutSidebar",setup(t){const e=Kl(),{sortedCharts:n}=_T(),{resolvedTheme:o}=Tf(),r=A(()=>n.value.slice(0,5)),i=A(()=>e.path==="/"),s=A(()=>e.path.startsWith("/charts")),a=A(()=>o.value==="dark"?eC:JA);return(l,c)=>(w(),Z(p(kU),{"aria-label":"Workspace navigation"},{header:ee(()=>[T("div",jre,[H(p(WA),{name:"Blueprint Chart","logo-src":a.value,to:"/"},null,8,["logo-src"]),Ce(l.$slots,"trailing",{},void 0,!0)])]),default:ee(()=>[H(p(iv),{eyebrow:"Workspace"},{default:ee(()=>[H(p(Xu),{to:"/",label:"Home",active:i.value},{icon:ee(()=>[H(p(Fre))]),_:1},8,["active"]),H(p(Xu),{to:"/charts",label:"My Charts",active:s.value,count:p(n).length||void 0},{icon:ee(()=>[H(p(kT))]),_:1},8,["active","count"])]),_:1}),r.value.length?(w(),Z(p(iv),{key:0,eyebrow:"Recent"},{default:ee(()=>[(w(!0),R(We,null,mt(r.value,u=>(w(),Z(p(Xu),{key:u.id,to:`/edit/${u.id}`,label:u.title||"Untitled"},null,8,["to","label"]))),128))]),_:1})):ie("",!0),H(p(iv),{eyebrow:"Resources"},{default:ee(()=>[H(p(Xu),{href:"https://docs.blueprintchart.com",label:"Documentation"},{icon:ee(()=>[H(p(Yre))]),_:1}),H(p(Xu),{href:"https://github.com/blueprint-chart/blueprint-chart",label:"GitHub"},{icon:ee(()=>[H(p(Ure))]),_:1})]),_:1})]),_:3}))}}),U6=Oe(Xre,[["__scopeId","data-v-34084162"]]),Kre={class:"command-palette-modal"},Zre={class:"command-palette-modal__input-row"},Qre={key:0,class:"command-palette-modal__results",role:"listbox","aria-label":"Chart results"},Jre=["aria-selected","onClick","onMousemove"],eie=["src"],tie={class:"command-palette-modal__meta"},nie={class:"command-palette-modal__title"},oie={class:"command-palette-modal__desc"},rie={key:1,class:"command-palette-modal__empty"},iie=le({__name:"CommandPaletteModal",props:{open:{type:Boolean,required:!0},openModifiers:{}},emits:["update:open"],setup(t){const e=ft(t,"open"),n=Cy(),o=Kl(),{listSavedCharts:r}=Xs(),i=ze(""),s=ze(0),a=ht("inputRef"),l=ze([]),c=A(()=>{const m=i.value.trim().toLowerCase();return m?l.value.filter(b=>{var y,x;return((y=b.title)==null?void 0:y.toLowerCase().includes(m))||((x=b.description)==null?void 0:x.toLowerCase().includes(m))}):l.value.slice(0,5)}),u=A(()=>{const m={};for(const b of l.value){const y=tb(b.id);y&&(m[b.id]=Cc(y))}return m});qe(i,()=>{s.value=0}),qe(()=>o.path,()=>{e.value&&(e.value=!1)}),qe(e,m=>{m?l.value=r():(i.value="",s.value=0)},{immediate:!0});function d(){var m;(m=a.value)==null||m.focus()}function f(m){const b=c.value.length-1;if(b<0)return;let y=s.value+m;y<0&&(y=b),y>b&&(y=0),s.value=y}function h(){const m=c.value[s.value];m&&g(m.id)}function g(m){e.value=!1,n.push(`/edit/${m}`)}function v(m){return{"command-palette-modal__result":!0,"command-palette-modal__result--active":m===s.value}}return(m,b)=>(w(),Z(p(GE),{modelValue:e.value,"onUpdate:modelValue":b[4]||(b[4]=y=>e.value=y),size:"lg",centered:"","no-header":"","no-footer":"",autofocus:!1,"body-class":"command-palette-modal__body","no-close-on-esc":"",onShown:d},{default:ee(()=>[T("div",Kre,[T("div",Zre,[H(p(Vy),{class:"command-palette-modal__icon"}),H(p(ta),{ref_key:"inputRef",ref:a,modelValue:p(i),"onUpdate:modelValue":b[0]||(b[0]=y=>Xe(i)?i.value=y:null),"aria-label":"Search charts",placeholder:"Search charts…",autofocus:"",onKeydown:[b[1]||(b[1]=or(gn(y=>e.value=!1,["prevent"]),["escape"])),b[2]||(b[2]=or(gn(y=>f(1),["prevent"]),["down"])),b[3]||(b[3]=or(gn(y=>f(-1),["prevent"]),["up"])),or(gn(h,["prevent"]),["enter"])]},null,8,["modelValue","onKeydown"])]),p(c).length>0?(w(),R("div",Qre,[(w(!0),R(We,null,mt(p(c),(y,x)=>(w(),R("div",{key:y.id,class:Te(v(x)),role:"option",tabindex:"-1","aria-selected":x===p(s),onClick:_=>g(y.id),onMousemove:_=>s.value=x},[p(u)[y.id]?(w(),R("img",{key:0,src:p(u)[y.id],class:"command-palette-modal__thumb",alt:""},null,8,eie)):ie("",!0),T("div",tie,[T("span",nie,be(y.title||"Untitled"),1),T("span",oie,be(y.description),1)])],42,Jre))),128))])):p(i).trim()?(w(),R("div",rie,' No charts match "'+be(p(i))+'" ',1)):ie("",!0)])]),_:1},8,["modelValue"]))}}),G6=Oe(iie,[["__scopeId","data-v-09e7b11e"]]);function sie(){const{isNarrow:t}=gi(),e=Du();e.initBreakpoint(t.value),qe(t,n=>{e.syncBreakpoint(n)})}const aie={key:0,class:"layout-shell layout-shell--landing"},lie={key:1,class:"layout-shell layout-shell--app"},cie={class:"layout-shell__sidebar"},uie={class:"layout-shell__topbar"},die={class:"layout-shell__main"},fie=le({__name:"LayoutShell",setup(t){sie();const e=Kl(),n=A(()=>e.path==="/"),o=Re(!1),r=ZA("k"),{isNarrow:i}=gi("xl"),s=ze(!1);return qe(()=>e.fullPath,()=>{s.value=!1}),qe(i,a=>{a||(s.value=!1)}),Vs(document,"keydown",a=>{r.matches(a)&&(a.preventDefault(),o.value=!0)}),(a,l)=>{const c=XE;return n.value?(w(),R("div",aie,[Ce(a.$slots,"default",{},void 0,!0),H(G6,{open:o.value,"onUpdate:open":l[0]||(l[0]=u=>o.value=u)},null,8,["open"])])):(w(),R("div",lie,[T("aside",cie,[H(U6)]),T("div",uie,[H(Yq,{"sidebar-open":s.value,onSearchClick:l[1]||(l[1]=u=>o.value=!0),onToggleSidebar:l[2]||(l[2]=u=>s.value=!s.value)},null,8,["sidebar-open"])]),T("main",die,[Ce(a.$slots,"default",{},void 0,!0)]),p(i)?(w(),Z(c,{key:0,id:"layout-sidebar-offcanvas",modelValue:s.value,"onUpdate:modelValue":l[4]||(l[4]=u=>s.value=u),placement:"start","no-header":"","aria-label":"Workspace navigation",class:"layout-shell__sidebar-offcanvas"},{default:ee(()=>[H(U6,null,{trailing:ee(()=>[H(p(VA),{onClick:l[3]||(l[3]=u=>s.value=!1)})]),_:1})]),_:1},8,["modelValue"])):ie("",!0),H(G6,{open:o.value,"onUpdate:open":l[5]||(l[5]=u=>o.value=u)},null,8,["open"])]))}}}),hie=Oe(fie,[["__scopeId","data-v-e550b95e"]]),pie=le({__name:"App",setup(t){const e=Kl();return(n,o)=>{const r=rm("router-view"),i=hie;return p(e).meta.bare?(w(),Z(r,{key:0})):(w(),Z(i,{key:1},{default:ee(()=>[H(r)]),_:1}))}}}),mie="modulepreload",gie=function(t){return"/"+t},q6={},Y6=function(e,n,o){let r=Promise.resolve();if(n&&n.length>0){let s=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));r=s(n.map(c=>{if(c=gie(c),c in q6)return;q6[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":mie,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((h,g)=>{f.addEventListener("load",h),f.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return r.then(s=>{for(const a of s||[])a.status==="rejected"&&i(a.reason);return e().catch(i)})},vie=le({__name:"PanelDocked",props:st({collapsed:{type:Boolean},title:{},initialWidth:{default:rb},showClose:{type:Boolean,default:!0},canvasWidth:{default:void 0}},{modelValue:{},modelModifiers:{}}),emits:st(["close"],["update:modelValue"]),setup(t){const e=t,n=ft(t,"modelValue"),o=Re(n.value??e.initialWidth);qe(n,u=>{u!==void 0&&(o.value=u)});const r=Re(!1),{width:i}=KN(),s=A(()=>({"panel-docked--collapsed":e.collapsed,"panel-docked--resizing":r.value})),a=A(()=>e.canvasWidth===void 0||e.canvasWidth<=0?W6:Math.min(W6,e.canvasWidth-xT)),l=A(()=>{const u=o.value*i.value;return Math.max(ob,Math.min(u,a.value))});function c(u){const d=u.clientX,f=o.value*i.value,h=u.currentTarget;h.setPointerCapture(u.pointerId),r.value=!0;function g(m){const b=d-m.clientX,y=f+b,x=Math.min(a.value,Math.max(ob,y)),_=i.value||window.innerWidth;o.value=_>0?x/_:o.value,n.value=o.value}function v(){r.value=!1,h.removeEventListener("pointermove",g),h.removeEventListener("pointerup",v)}h.addEventListener("pointermove",g),h.addEventListener("pointerup",v)}return(u,d)=>(w(),R("div",{class:Te(["panel-docked",p(s)]),style:Pt({width:t.collapsed?void 0:`${p(l)}px`})},[T("div",{class:"panel-docked__resize-handle",onPointerdown:c},null,32),H(p(jW),{title:t.title},wi({actions:ee(()=>[t.showClose?(w(),Z(p(VA),{key:0,onClick:d[0]||(d[0]=f=>u.$emit("close"))})):ie("",!0)]),default:ee(()=>[Ce(u.$slots,"default",{},void 0,!0)]),_:2},[u.$slots.toolbar?{name:"toolbar",fn:ee(()=>[Ce(u.$slots,"toolbar",{},void 0,!0)]),key:"0"}:void 0,u.$slots.footer?{name:"footer",fn:ee(()=>[Ce(u.$slots,"footer",{},void 0,!0)]),key:"1"}:void 0]),1032,["title"])],6))}}),bie=Oe(vie,[["__scopeId","data-v-02f78f79"]]),yie={class:"panel-drawer__body"},xie=le({__name:"PanelDrawer",props:st({title:{}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=ft(t,"modelValue");return(n,o)=>(w(),Z(p(zA),{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=r=>e.value=r),title:t.title},{default:ee(()=>[Ce(n.$slots,"header",{},void 0,!0),T("div",yie,[Ce(n.$slots,"default",{},void 0,!0)])]),_:3},8,["modelValue","title"]))}}),wie=Oe(xie,[["__scopeId","data-v-46314d76"]]);function _ie(t){const{width:e}=zN(t),n=Du(),o=A(()=>e.value>0&&e.value<Ere);return n.initCramped(o.value),qe(o,r=>{n.syncCramped(r)}),{canvasWidth:e}}const fg=le({__name:"PanelShell",props:st({title:{},containerRef:{default:null},showClose:{type:Boolean,default:!0}},{drawerOpen:{type:Boolean,default:!1},drawerOpenModifiers:{}}),emits:st(["close"],["update:drawerOpen"]),setup(t,{emit:e}){const n=t,o=e,r=ft(t,"drawerOpen"),i=Du(),{mode:s,dockedWidth:a}=$t(i),{close:l}=i,c=A(()=>{var f;return((f=n.containerRef)==null?void 0:f.parentElement)??null}),{canvasWidth:u}=_ie(c);function d(){l(),o("close")}return(f,h)=>{const g=wie,v=bie;return p(s)==="drawer"?(w(),Z(g,{key:0,modelValue:r.value,"onUpdate:modelValue":h[0]||(h[0]=m=>r.value=m),title:t.title},wi({default:ee(()=>[Ce(f.$slots,"default")]),_:2},[f.$slots.tabs||f.$slots.header?{name:"header",fn:ee(()=>[Ce(f.$slots,"tabs"),Ce(f.$slots,"header")]),key:"0"}:void 0]),1032,["modelValue","title"])):p(s)==="docked"?(w(),Z(v,{key:1,modelValue:p(a),"onUpdate:modelValue":h[1]||(h[1]=m=>Xe(a)?a.value=m:null),collapsed:!1,title:t.title,"show-close":t.showClose,"canvas-width":p(u),onClose:d},wi({default:ee(()=>[Ce(f.$slots,"default")]),_:2},[f.$slots.header?{name:"toolbar",fn:ee(()=>[Ce(f.$slots,"header")]),key:"0"}:void 0,f.$slots.footer?{name:"footer",fn:ee(()=>[Ce(f.$slots,"footer")]),key:"1"}:void 0]),1032,["modelValue","title","show-close","canvas-width"])):ie("",!0)}}}),kie={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Sie(t,e){return w(),R("svg",kie,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M88 24v-8a8 8 0 0 1 16 0v8a8 8 0 0 1-16 0m-72 80h8a8 8 0 0 0 0-16h-8a8 8 0 0 0 0 16m108.42-64.84a8 8 0 0 0 10.74-3.58l8-16a8 8 0 0 0-14.31-7.16l-8 16a8 8 0 0 0 3.57 10.74m-96 81.69l-16 8a8 8 0 0 0 7.16 14.31l16-8a8 8 0 1 0-7.16-14.31M219.31 184a16 16 0 0 1 0 22.63l-12.68 12.68a16 16 0 0 1-22.63 0L132.7 168L115 214.09c0 .1-.08.21-.13.32a15.83 15.83 0 0 1-14.6 9.59h-.79a15.83 15.83 0 0 1-14.41-11L32.8 52.92A16 16 0 0 1 52.92 32.8L213 85.07a16 16 0 0 1 1.41 29.8l-.32.13L168 132.69ZM208 195.31L156.69 144a16 16 0 0 1 4.93-26l.32-.14l45.95-17.64L48 48l52.2 159.86l17.65-46c0-.11.08-.22.13-.33a16 16 0 0 1 11.69-9.34a16.7 16.7 0 0 1 3-.28a16 16 0 0 1 11.3 4.69l51.34 51.4Z"},null,-1)])])}const ST=Me({name:"ph-cursor-click",render:Sie}),Aie={class:"dashboard-empty-state"},Cie=le({__name:"DashboardEmptyState",setup(t){return(e,n)=>(w(),R("div",Aie,[H(p(ST),{class:"dashboard-empty-state__icon"}),n[0]||(n[0]=T("p",{class:"dashboard-empty-state__text"}," Select a chart to see its details ",-1))]))}}),$ie=Oe(Cie,[["__scopeId","data-v-f6c24334"]]),Tie={class:"dashboard-action-row__label"},Mie={key:0,class:"dashboard-action-row__description"},Oie=le({__name:"DashboardActionRow",props:{icon:{},label:{},description:{},danger:{type:Boolean}},emits:["click"],setup(t){const e=t,n=A(()=>({"dashboard-action-row--danger":e.danger}));return(o,r)=>(w(),R("button",{class:Te(["dashboard-action-row",p(n)]),onClick:r[0]||(r[0]=i=>o.$emit("click"))},[(w(),Z(Gt(t.icon),{class:"dashboard-action-row__icon"})),T("div",null,[T("div",Tie,be(t.label),1),t.description?(w(),R("div",Mie,be(t.description),1)):ie("",!0)])],2))}}),Bie=Oe(Oie,[["__scopeId","data-v-0f47d7d3"]]),Lie={class:"dashboard-detail-actions"},Pie={class:"dashboard-detail-actions__list"},Die=le({__name:"DashboardDetailActions",emits:["duplicate","delete"],setup(t){return(e,n)=>{const o=Bie;return w(),R("div",Lie,[n[2]||(n[2]=T("div",{class:"dashboard-detail-actions__title"}," Actions ",-1)),T("div",Pie,[H(o,{icon:p(mA),label:"Duplicate",description:"Create a copy to edit",onClick:n[0]||(n[0]=r=>e.$emit("duplicate"))},null,8,["icon"]),H(o,{icon:p(GA),label:"Delete chart",description:"This cannot be undone",danger:"",onClick:n[1]||(n[1]=r=>e.$emit("delete"))},null,8,["icon"])])])}}}),Eie=Oe(Die,[["__scopeId","data-v-de396b53"]]),Iie={class:"dashboard-meta-chip"},Nie={class:"dashboard-meta-chip__label"},Rie={class:"dashboard-meta-chip__value"},Fie=le({__name:"DashboardMetaChip",props:{label:{},value:{}},setup(t){return(e,n)=>(w(),R("div",Iie,[T("div",Nie,be(t.label),1),T("div",Rie,be(t.value),1)]))}}),Vie=Oe(Fie,[["__scopeId","data-v-a1903aff"]]),zie={class:"dashboard-detail-meta"},Hie={class:"dashboard-detail-meta__grid"},Wie=le({__name:"DashboardDetailMeta",props:{chartType:{},savedAt:{},sceneCount:{},rowCount:{}},setup(t){const e=t,n=A(()=>NA(e.chartType)),o=A(()=>{if(!e.savedAt)return"—";const r=new Date(e.savedAt);return Number.isNaN(r.getTime())?e.savedAt:r.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})});return(r,i)=>{const s=Vie;return w(),R("div",zie,[i[0]||(i[0]=T("div",{class:"dashboard-detail-meta__title"}," Details ",-1)),T("div",Hie,[H(s,{label:"Chart type",value:p(n)},null,8,["value"]),H(s,{label:"Last edited",value:p(o)},null,8,["value"]),H(s,{label:"Scenes",value:String(t.sceneCount)},null,8,["value"]),H(s,{label:"Data rows",value:String(t.rowCount)},null,8,["value"])])])}}}),Uie=Oe(Wie,[["__scopeId","data-v-533a4b72"]]),Gie=["data-bs-theme"],qie=["src"],Yie=le({__name:"DashboardDetailPreview",props:{src:{},forceLightTheme:{type:Boolean}},setup(t){return(e,n)=>t.src?(w(),R("div",{key:0,class:"dashboard-detail-preview","data-bs-theme":t.forceLightTheme?"light":void 0},[T("img",{src:t.src,alt:"",class:"dashboard-detail-preview__img"},null,8,qie)],8,Gie)):ie("",!0)}}),jie=Oe(Yie,[["__scopeId","data-v-ddbd95be"]]),Xie={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Kie(t,e){return w(),R("svg",Xie,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"m227.31 73.37l-44.68-44.69a16 16 0 0 0-22.63 0L36.69 152A15.86 15.86 0 0 0 32 163.31V208a16 16 0 0 0 16 16h44.69a15.86 15.86 0 0 0 11.31-4.69L227.31 96a16 16 0 0 0 0-22.63M92.69 208H48v-44.69l88-88L180.69 120ZM192 108.68L147.31 64l24-24L216 84.68Z"},null,-1)])])}const V2=Me({name:"ph-pencil-simple",render:Kie}),Zie={class:"dashboard-detail-content"},Qie={key:0,class:"dashboard-detail-content__subtitle"},Jie=le({__name:"DashboardDetailContent",props:{title:{},subtitle:{},previewSrc:{},forceLightTheme:{type:Boolean},chartType:{},savedAt:{},sceneCount:{},rowCount:{}},emits:["edit","duplicate","delete"],setup(t){return(e,n)=>{const o=jie,r=Uie,i=Eie;return w(),R("div",Zie,[t.subtitle?(w(),R("div",Qie,be(t.subtitle),1)):ie("",!0),H(p(Kn),{"icon-left":p(V2),label:"Edit chart",variant:"primary",block:"",onClick:n[0]||(n[0]=s=>e.$emit("edit"))},null,8,["icon-left"]),H(o,{src:t.previewSrc,"force-light-theme":t.forceLightTheme},null,8,["src","force-light-theme"]),H(r,{"chart-type":t.chartType,"saved-at":t.savedAt,"scene-count":t.sceneCount,"row-count":t.rowCount},null,8,["chart-type","saved-at","scene-count","row-count"]),H(i,{onDuplicate:n[1]||(n[1]=s=>e.$emit("duplicate")),onDelete:n[2]||(n[2]=s=>e.$emit("delete"))})])}}}),ese=Oe(Jie,[["__scopeId","data-v-3d8b1e29"]]),tse=le({__name:"DashboardChartCard",props:{chart:{},thumbSrc:{},selected:{type:Boolean},layout:{}},emits:["select","edit"],setup(t){const{resolvedTheme:e}=Tf();return(n,o)=>(w(),Z(p(aG),{title:t.chart.title||"Untitled",subtitle:t.chart.description,"thumb-src":t.thumbSrc,selected:t.selected,layout:t.layout,"force-light-thumb":!t.chart.allowDarkMode,"serif-title":!0,onClick:o[1]||(o[1]=r=>n.$emit("select",t.chart.id))},{actions:ee(()=>[H(p(Kn),{"icon-left":p(V2),label:"Edit","hide-label":"",square:"",variant:"primary",size:"sm",class:"dashboard-chart-card__edit-btn",onClick:o[0]||(o[0]=r=>n.$emit("edit",t.chart.id))},null,8,["icon-left"])]),footer:ee(()=>[H(p(JH),{"chart-type":t.chart.chartType,theme:p(e)},null,8,["chart-type","theme"]),t.chart.savedAt?(w(),Z(p(EH),{key:0,value:t.chart.savedAt},null,8,["value"])):ie("",!0)]),_:1},8,["title","subtitle","thumb-src","selected","layout","force-light-thumb"]))}}),nse=le({__name:"DashboardNewCard",props:{layout:{default:"grid"}},emits:["click"],setup(t){const e=t,n=A(()=>({"dashboard-new-card--row":e.layout==="row"}));return(o,r)=>(w(),R("div",{class:Te(["dashboard-new-card",p(n)]),role:"button",tabindex:"0",onClick:r[0]||(r[0]=i=>o.$emit("click")),onKeydown:[r[1]||(r[1]=or(i=>o.$emit("click"),["enter"])),r[2]||(r[2]=or(gn(i=>o.$emit("click"),["prevent"]),["space"]))]},[H(p(Dy),{class:"dashboard-new-card__icon"}),r[3]||(r[3]=T("span",{class:"dashboard-new-card__label"},"New Chart",-1))],34))}}),ose=Oe(nse,[["__scopeId","data-v-ef746b42"]]),rse=le({__name:"DashboardGallery",props:{charts:{},thumbnails:{},selectedId:{},layout:{}},emits:["select","edit","new"],setup(t){return(e,n)=>{const o=ose,r=tse;return w(),Z(p(cG),{layout:t.layout},{default:ee(()=>[H(o,{layout:t.layout,onClick:n[0]||(n[0]=i=>e.$emit("new"))},null,8,["layout"]),(w(!0),R(We,null,mt(t.charts,i=>(w(),Z(r,{key:i.id,chart:i,"thumb-src":t.thumbnails[i.id],selected:t.selectedId===i.id,layout:t.layout,onSelect:n[1]||(n[1]=s=>e.$emit("select",s)),onEdit:n[2]||(n[2]=s=>e.$emit("edit",s))},null,8,["chart","thumb-src","selected","layout"]))),128)),t.charts.length===0?(w(),Z(p(DW),{key:0,message:"No saved charts yet. Create a new chart to get started."})):ie("",!0)]),_:1},8,["layout"])}}}),ise={},sse={class:"layout-page-header"},ase={class:"layout-page-header__start"},lse={class:"layout-page-header__center"},cse={class:"layout-page-header__end"};function use(t,e){return w(),R("div",sse,[T("div",ase,[Ce(t.$slots,"start",{},void 0,!0)]),T("div",lse,[Ce(t.$slots,"center",{},void 0,!0)]),T("div",cse,[Ce(t.$slots,"end",{},void 0,!0)])])}const AT=Oe(ise,[["render",use],["__scopeId","data-v-c99b9b81"]]),dse={key:0,class:"layout-breadcrumb","aria-label":"Breadcrumb"},fse=["aria-current"],hse={key:2,class:"layout-breadcrumb__crumb-sep","aria-hidden":"true"},pse=le({__name:"LayoutBreadcrumb",setup(t){const e=Kl(),n=hn(),o=A(()=>{const r=e.path;if(r.startsWith("/edit/")){const i=n._base.title.value||"Untitled";return[{label:"My Charts",to:"/charts"},{label:i}]}return r.startsWith("/charts")?[{label:"My Charts"}]:r==="/new"?[{label:"My Charts",to:"/charts"},{label:"New chart"}]:[]});return(r,i)=>{const s=rm("router-link");return o.value.length?(w(),R("nav",dse,[(w(!0),R(We,null,mt(o.value,(a,l)=>(w(),R(We,{key:l},[a.to?(w(),Z(s,{key:0,to:a.to,class:"layout-breadcrumb__crumb"},{default:ee(()=>[Ye(be(a.label),1)]),_:2},1032,["to"])):(w(),R("span",{key:1,class:"layout-breadcrumb__crumb layout-breadcrumb__crumb--active","aria-current":l===o.value.length-1?"page":void 0},be(a.label),9,fse)),l<o.value.length-1?(w(),R("span",hse,"/")):ie("",!0)],64))),128))])):ie("",!0)}}}),CT=Oe(pse,[["__scopeId","data-v-73a5f2ae"]]),mse={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function gse(t,e){return w(),R("svg",mse,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M208 136H48a16 16 0 0 0-16 16v40a16 16 0 0 0 16 16h160a16 16 0 0 0 16-16v-40a16 16 0 0 0-16-16m0 56H48v-40h160zm0-144H48a16 16 0 0 0-16 16v40a16 16 0 0 0 16 16h160a16 16 0 0 0 16-16V64a16 16 0 0 0-16-16m0 56H48V64h160z"},null,-1)])])}const vse=Me({name:"ph-rows",render:gse}),bse={class:"dashboard-toolbar__count"},yse=le({__name:"DashboardToolbar",props:{chartCount:{},sortValue:{},layout:{}},emits:["update:sortValue","update:layout","new"],setup(t){const e=t,n=[{value:"date-desc",label:"Last edited"},{value:"date-asc",label:"Oldest first"},{value:"name-asc",label:"Name A–Z"}],o=A(()=>[{key:"grid",text:"Grid",icon:kT,active:e.layout==="grid"},{key:"row",text:"List",icon:vse,active:e.layout==="row"}]);return(r,i)=>(w(),Z(AT,{class:"dashboard-toolbar"},{start:ee(()=>[H(CT),T("span",bse,be(t.chartCount)+" "+be(t.chartCount===1?"chart":"charts"),1)]),end:ee(()=>[H(p(HA),{items:p(o),"aria-label":"View layout",onSelect:i[0]||(i[0]=s=>r.$emit("update:layout",s))},null,8,["items"]),H(p(Rn),{"model-value":t.sortValue,options:n,"onUpdate:modelValue":i[1]||(i[1]=s=>r.$emit("update:sortValue",s))},null,8,["model-value"]),H(p(Kn),{"icon-left":p(Dy),label:"New chart",variant:"primary",onClick:i[2]||(i[2]=s=>r.$emit("new"))},null,8,["icon-left"])]),_:1}))}}),xse=Oe(yse,[["__scopeId","data-v-de771377"]]),wse={class:"dashboard-page-wrapper d-flex flex-column flex-grow-1"},_se=le({__name:"DashboardPage",setup(t){const e=Cy(),{isNarrow:n}=gi(),{selectedChartId:o,selectChart:r}=wT(),{mode:i}=$t(Du()),{sortedCharts:s,selectedChart:a,thumbnails:l,previews:c,sortValue:u,refresh:d,duplicateChart:f,removeChart:h}=_T(),g=ht("galleryRef"),v=Re("grid"),m=A(()=>({"dashboard-page":!0,"dashboard-page--narrow":n.value})),b=A(()=>a.value?a.value.title||"Untitled":"Chart details");function y(){o.value=null}const x=A({get:()=>o.value!==null,set:S=>{S||(o.value=null)}});function _(){o.value&&e.push(`/edit/${o.value}`)}function k(){if(o.value){const S=f(o.value);S&&e.push(`/edit/${S}`)}}function E(){o.value&&h(o.value)}function L(S){S.key==="Escape"&&(o.value=null)}return fn(()=>{d(),document.addEventListener("keydown",L)}),Js(()=>{document.removeEventListener("keydown",L)}),(S,B)=>{const D=xse,N=rse,C=ese,M=$ie,P=fg;return w(),R("div",wse,[H(D,{"chart-count":p(s).length,"sort-value":p(u),layout:p(v),"onUpdate:sortValue":B[0]||(B[0]=$=>u.value=$),"onUpdate:layout":B[1]||(B[1]=$=>v.value=$),onNew:B[2]||(B[2]=$=>p(e).push("/new"))},null,8,["chart-count","sort-value","layout"]),T("div",{class:Te(p(m))},[T("div",{ref_key:"galleryRef",ref:g,class:"dashboard-page__gallery"},[H(N,{charts:p(s),thumbnails:p(l),"selected-id":p(o),layout:p(v),onSelect:p(r),onEdit:B[3]||(B[3]=$=>p(e).push(`/edit/${$}`)),onNew:B[4]||(B[4]=$=>p(e).push("/new"))},null,8,["charts","thumbnails","selected-id","layout","onSelect"])],512),H(P,{"drawer-open":p(x),"onUpdate:drawerOpen":B[5]||(B[5]=$=>Xe(x)?x.value=$:null),title:p(b),"container-ref":p(g),"show-close":!1,onClose:y},{default:ee(()=>[p(a)?(w(),Z(C,{key:0,title:p(a).title||"Untitled",subtitle:p(a).description,"preview-src":p(o)?p(c)[p(o)]:void 0,"force-light-theme":p(a)?!p(a).allowDarkMode:!1,"chart-type":p(a).chartType,"saved-at":p(a).savedAt??void 0,"scene-count":p(a).sceneCount,"row-count":p(a).rowCount,onEdit:_,onDuplicate:k,onDelete:E},null,8,["title","subtitle","preview-src","force-light-theme","chart-type","saved-at","scene-count","row-count"])):p(i)==="docked"?(w(),Z(M,{key:1})):ie("",!0)]),_:1},8,["drawer-open","title","container-ref"])],2)])}}}),kse=Oe(_se,[["__scopeId","data-v-fe7a5a93"]]),Sse={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Ase(t,e){return w(),R("svg",Sse,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M216 40H40a16 16 0 0 0-16 16v144a16 16 0 0 0 16 16h176a16 16 0 0 0 16-16V56a16 16 0 0 0-16-16M40 56h40v144H40Zm176 144H96V56h120z"},null,-1)])])}const $T=Me({name:"ph-sidebar-simple",render:Ase}),z2=le({__name:"PanelIconRail",props:{activeTab:{},items:{}},emits:["select","toggle-mode"],setup(t,{emit:e}){const n=e,{mode:o,open:r}=ic();function i(a){o.value==="closed"&&r(),n("select",a)}const s=A(()=>o.value==="closed"?"Open panel":"Close panel");return(a,l)=>(w(),Z(p(gU),{"model-value":t.activeTab,items:t.items,"onUpdate:modelValue":i},{footer:ee(()=>[H(p(Kn),{"icon-left":p($T),label:p(s),"hide-label":"",square:"",variant:"link",size:"sm",onClick:l[0]||(l[0]=c=>a.$emit("toggle-mode"))},null,8,["icon-left","label"])]),_:1},8,["model-value","items"]))}}),Cse=Bo("exportPanel",()=>{const t=Re("embed"),e=Re("png"),n=Re(2),o=Re(!1),r=Re(!1),i=Re(!0),s=Re(!1),a=Re("embed");function l(f){t.value=f}function c(f){e.value=f}function u(f){a.value=f}function d(){t.value="embed",e.value="png",n.value=2,o.value=!1,r.value=!1,i.value=!0,s.value=!1,a.value="embed"}return{exportTab:t,selectedFormat:e,pngScale:n,svgInlineFonts:o,svgMinify:r,bpcIncludeData:i,bpcCompact:s,lastNarrowExportTab:a,setExportTab:l,setSelectedFormat:c,setLastNarrowExportTab:u,reset:d}});function hg(){const t=Cse(),{exportTab:e,selectedFormat:n,pngScale:o,svgInlineFonts:r,svgMinify:i,bpcIncludeData:s,bpcCompact:a,lastNarrowExportTab:l}=$t(t);return{exportTab:e,selectedFormat:n,pngScale:o,svgInlineFonts:r,svgMinify:i,bpcIncludeData:s,bpcCompact:a,lastNarrowExportTab:l,setExportTab:t.setExportTab,setSelectedFormat:t.setSelectedFormat,setLastNarrowExportTab:t.setLastNarrowExportTab,reset:t.reset}}const $se={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Tse(t,e){return w(),R("svg",$se,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M69.12 94.15L28.5 128l40.62 33.85a8 8 0 1 1-10.24 12.29l-48-40a8 8 0 0 1 0-12.29l48-40a8 8 0 0 1 10.24 12.3m176 27.7l-48-40a8 8 0 1 0-10.24 12.3L227.5 128l-40.62 33.85a8 8 0 1 0 10.24 12.29l48-40a8 8 0 0 0 0-12.29m-82.39-89.37a8 8 0 0 0-10.25 4.79l-64 176a8 8 0 0 0 4.79 10.26A8.1 8.1 0 0 0 96 224a8 8 0 0 0 7.52-5.27l64-176a8 8 0 0 0-4.79-10.25"},null,-1)])])}const Mse=Me({name:"ph-code",render:Tse}),Ose={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Bse(t,e){return w(),R("svg",Ose,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M224 144v64a8 8 0 0 1-8 8H40a8 8 0 0 1-8-8v-64a8 8 0 0 1 16 0v56h160v-56a8 8 0 0 1 16 0m-101.66 5.66a8 8 0 0 0 11.32 0l40-40a8 8 0 0 0-11.32-11.32L136 124.69V32a8 8 0 0 0-16 0v92.69L93.66 98.34a8 8 0 0 0-11.32 11.32Z"},null,-1)])])}const TT=Me({name:"ph-download-simple",render:Bse});function MT(){return{sections:[{key:"embed",label:"Embed",icon:Mse},{key:"download",label:"Download",icon:TT}]}}const Lse=le({__name:"ExportIconRail",setup(t){const{mode:e,toggleMode:n}=ic(),o=hg(),{exportTab:r}=$t(o),{setExportTab:i}=o,{sections:s}=MT(),a=A(()=>s.map(c=>({value:c.key,icon:c.icon,tooltip:c.tooltip??c.label})));function l(c){i(c),e.value==="closed"&&n()}return(c,u)=>{const d=z2;return w(),Z(d,{"active-tab":p(r),items:p(a),onSelect:l,onToggleMode:p(n)},null,8,["active-tab","items","onToggleMode"])}}}),Fi=[{label:"Data",key:"data"},{label:"Visualize",key:"edit"},{label:"Export",key:"export"}];function Pse(t){return t.endsWith("/export")?"export":t.endsWith("/visualize")?"edit":(t.endsWith("/data"),"data")}function Dse(t,e){return e==="edit"?`/edit/${t}/visualize`:`/edit/${t}/${e}`}const Tv=ze(null);function H2(){const t=Kl(),e=Cy(),n=A(()=>{const h=Pse((t==null?void 0:t.path)??"/new");return Fi.find(g=>g.key===h)??Fi[0]}),o=A({get:()=>Fi.indexOf(n.value),set:h=>{u(h)}}),r=A(()=>o.value===0),i=A(()=>o.value===Fi.length-1);function s(){var g;const h=(g=t==null?void 0:t.params)==null?void 0:g.id;return h||(Tv.value?Tv.value():null)}function a(h){const g=s();g&&e&&e.replace(Dse(g,h))}function l(){const h=o.value;h<Fi.length-1&&a(Fi[h+1].key)}function c(){const h=o.value;h>0&&a(Fi[h-1].key)}function u(h){h>=0&&h<Fi.length&&a(Fi[h].key)}function d(){}function f(h){Tv.value=h}return{currentIndex:o,steps:Fi,currentStep:n,isFirst:r,isLast:i,next:l,back:c,goTo:u,reset:d,registerCreateSession:f}}const Ese={class:"panel-stepper-footer"},Ise=le({__name:"PanelStepperFooter",setup(t){const{steps:e,currentIndex:n,isFirst:o,isLast:r,next:i,back:s}=H2(),a=A(()=>{var c;return((c=e[n.value-1])==null?void 0:c.label)??"Previous"}),l=A(()=>{var c;return((c=e[n.value+1])==null?void 0:c.label)??"Next"});return(c,u)=>(w(),R("div",Ese,[p(o)?ie("",!0):(w(),Z(p(Kn),{key:0,"icon-left":p(qA),"icon-left-size":"1em",label:p(a),variant:"outline-secondary",size:"sm",onClick:p(s)},null,8,["icon-left","label","onClick"])),p(r)?ie("",!0):(w(),Z(p(Kn),{key:1,"icon-right":p(YA),"icon-right-size":"1em",label:p(l),variant:"primary",size:"sm",class:"ms-auto",onClick:p(i)},null,8,["icon-right","label","onClick"]))]))}}),W2=Oe(Ise,[["__scopeId","data-v-52b4dceb"]]),Nse={class:"format-card__header"},Rse={class:"format-card__header__text"},Fse={class:"format-card__header__text__label"},Vse={class:"format-card__header__text__desc"},zse={key:0,class:"format-card__options"},Hse=le({__name:"ExportDownloadFormatCard",props:{selected:{type:Boolean},icon:{},label:{},description:{},iconBg:{},iconColor:{}},emits:["select","download"],setup(t){return(e,n)=>(w(),R("div",{class:Te(["format-card",{"format-card--selected":t.selected}]),onClick:n[1]||(n[1]=o=>e.$emit("select"))},[T("div",Nse,[T("span",{class:"format-card__header__icon",style:Pt({background:t.iconBg,color:t.iconColor})},[(w(),Z(Gt(t.icon)))],4),T("div",Rse,[T("div",Fse,be(t.label),1),T("div",Vse,be(t.description),1)]),H(p(Kn),{"icon-left":p(TT),label:"Download","hide-label":"",variant:"primary",size:"sm",square:"",onClick:n[0]||(n[0]=gn(o=>e.$emit("download"),["stop"]))},null,8,["icon-left"])]),t.selected&&e.$slots.default?(w(),R("div",zse,[Ce(e.$slots,"default",{},void 0,!0)])):ie("",!0)],2))}}),Wse=Oe(Hse,[["__scopeId","data-v-f26129ef"]]);function Ff(t,e){const n=URL.createObjectURL(t),o=document.createElement("a");o.href=n,o.download=e,o.click(),URL.revokeObjectURL(n)}function Use(t,e="chart.svg"){const o=new XMLSerializer().serializeToString(t),r=new Blob([o],{type:"image/svg+xml;charset=utf-8"});Ff(r,e)}function Gse(t,e,n,o="chart.png"){const i=new XMLSerializer().serializeToString(t),s=new Blob([i],{type:"image/svg+xml;charset=utf-8"}),a=URL.createObjectURL(s);return new Promise((l,c)=>{const u=new Image;u.onload=()=>{const d=document.createElement("canvas");d.width=e,d.height=n;const f=d.getContext("2d");if(!f){URL.revokeObjectURL(a),c(new Error("Could not get canvas context"));return}f.drawImage(u,0,0,e,n),d.toBlob(h=>{if(URL.revokeObjectURL(a),!h){c(new Error("Could not create PNG blob"));return}Ff(h,o),l()},"image/png")},u.onerror=()=>{URL.revokeObjectURL(a),c(new Error("Failed to load SVG image"))},u.src=a})}function OT(t,e){const n=globalThis.getComputedStyle(t),o=e;if(o.style)for(let s=0;s<n.length;s++){const a=n[s];o.style.setProperty(a,n.getPropertyValue(a))}const r=t.children,i=e.children;for(let s=0;s<r.length;s++)i[s]&&OT(r[s],i[s])}function qse(t){const e=globalThis.getComputedStyle(t);return{top:parseFloat(e.paddingTop)||0,right:parseFloat(e.paddingRight)||0,bottom:parseFloat(e.paddingBottom)||0,left:parseFloat(e.paddingLeft)||0}}function Yse(t,e=2,n="chart.png",o,r){const{width:i,height:s}=t.getBoundingClientRect(),a=r??{top:0,right:0,bottom:0,left:0},l=i+a.left+a.right,c=s+a.top+a.bottom,u=Math.ceil(l*e),d=Math.ceil(c*e),f=t.cloneNode(!0);OT(t,f),f.querySelectorAll("[data-scene-player]").forEach(k=>k.remove()),f.style.setProperty("pointer-events","auto"),f.style.setProperty("transition","none"),f.style.setProperty("animation","none");const g=new XMLSerializer().serializeToString(f),v=a.left,m=a.top,b=o?`<rect width="${l}" height="${c}" fill="${o}" />`:"",y=[`<svg xmlns="http://www.w3.org/2000/svg" width="${u}" height="${d}">`,`<g transform="scale(${e})">`,b,`<foreignObject x="${v}" y="${m}" width="${i}" height="${s}">`,g,"</foreignObject>","</g>","</svg>"].join(""),x=new Blob([y],{type:"image/svg+xml;charset=utf-8"}),_=URL.createObjectURL(x);return new Promise((k,E)=>{const L=new Image;L.onload=()=>{const S=document.createElement("canvas");S.width=u,S.height=d;const B=S.getContext("2d");if(!B){URL.revokeObjectURL(_),E(new Error("Could not get canvas context"));return}B.drawImage(L,0,0,u,d),S.toBlob(D=>{if(URL.revokeObjectURL(_),!D){E(new Error("Could not create PNG blob"));return}Ff(D,n),k()},"image/png")},L.onerror=()=>{URL.revokeObjectURL(_),E(new Error("Failed to render frame as image"))},L.src=_})}function Mv(t){const e=globalThis.getComputedStyle(t);return{fontSize:parseFloat(e.fontSize),fontWeight:e.fontWeight,fontFamily:e.fontFamily,fill:e.color,fontStyle:e.fontStyle}}function BT(t){let e=t;for(;e;){const n=globalThis.getComputedStyle(e).backgroundColor;if(n&&n!=="transparent"&&n!=="rgba(0, 0, 0, 0)")return n;e=e.parentElement}return"#ffffff"}function jse(t,e="chart.svg"){const n=t.querySelector("svg");if(!n)return;const o=t.getBoundingClientRect(),r=BT(t),i=new XMLSerializer,s=[],a=t.querySelectorAll(".bc-frame-title, .bc-frame-description");for(const L of a){const S=L.getBoundingClientRect(),B=Mv(L);s.push({text:L.textContent??"",x:S.left-o.left,y:S.top-o.top+B.fontSize,...B})}const l=t.querySelector(".bc-frame-note");if(l&&l.textContent&&l.style.display!=="none"){const L=l.getBoundingClientRect(),S=Mv(l);s.push({text:l.textContent,x:L.left-o.left,y:L.top-o.top+S.fontSize,...S})}const c=t.querySelectorAll(".bc-frame-byline, .bc-frame-source, .bc-frame-credit");for(const L of c){const S=L.getBoundingClientRect();if(S.width===0)continue;const B=Mv(L);s.push({text:L.textContent??"",x:S.left-o.left,y:S.top-o.top+B.fontSize,...B})}const u=n.getBoundingClientRect(),d=u.left-o.left,f=u.top-o.top,h=u.width,g=u.height,v=n.cloneNode(!0);v.removeAttribute("width"),v.removeAttribute("height");const m=i.serializeToString(v),b=Math.ceil(o.width),y=Math.ceil(o.height),x=L=>L.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),_=s.map(L=>`<text x="${L.x}" y="${L.y}" font-size="${L.fontSize}px" font-weight="${L.fontWeight}" font-family="${x(L.fontFamily)}" fill="${L.fill}"${L.fontStyle&&L.fontStyle!=="normal"?` font-style="${L.fontStyle}"`:""}>${x(L.text)}</text>`).join(`
|
|
848
|
+
`),k=[`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="${b}" height="${y}" viewBox="0 0 ${b} ${y}">`,` <rect width="100%" height="100%" fill="${r}" />`,` ${_}`,` <g transform="translate(${d},${f})">`,` <svg width="${h}" height="${g}"${v.getAttribute("viewBox")?` viewBox="${v.getAttribute("viewBox")}"`:""}>`,m.replace(/^<svg[^>]*>/,"").replace(/<\/svg>$/,"")," </svg>"," </g>","</svg>"].join(`
|
|
849
|
+
`),E=new Blob([k],{type:"image/svg+xml;charset=utf-8"});Ff(E,e)}const Xse={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Kse(t,e){return w(),R("svg",Xse,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M216 40H40a16 16 0 0 0-16 16v144a16 16 0 0 0 16 16h176a16 16 0 0 0 16-16V56a16 16 0 0 0-16-16m0 16v102.75l-26.07-26.06a16 16 0 0 0-22.63 0l-20 20l-44-44a16 16 0 0 0-22.62 0L40 149.37V56ZM40 172l52-52l80 80H40Zm176 28h-21.37l-36-36l20-20L216 181.38zm-72-100a12 12 0 1 1 12 12a12 12 0 0 1-12-12"},null,-1)])])}const Zse=Me({name:"ph-image",render:Kse}),Qse={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Jse(t,e){return w(),R("svg",Qse,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M181.66 146.34a8 8 0 0 1 0 11.32l-24 24a8 8 0 0 1-11.32-11.32L164.69 152l-18.35-18.34a8 8 0 0 1 11.32-11.32Zm-72-24a8 8 0 0 0-11.32 0l-24 24a8 8 0 0 0 0 11.32l24 24a8 8 0 0 0 11.32-11.32L91.31 152l18.35-18.34a8 8 0 0 0 0-11.32M216 88v128a16 16 0 0 1-16 16H56a16 16 0 0 1-16-16V40a16 16 0 0 1 16-16h96a8 8 0 0 1 5.66 2.34l56 56A8 8 0 0 1 216 88m-56-8h28.69L160 51.31Zm40 136V96h-48a8 8 0 0 1-8-8V40H56v176z"},null,-1)])])}const eae=Me({name:"ph-file-code",render:Jse}),tae={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function nae(t,e){return w(),R("svg",tae,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"m213.66 82.34l-56-56A8 8 0 0 0 152 24H56a16 16 0 0 0-16 16v176a16 16 0 0 0 16 16h144a16 16 0 0 0 16-16V88a8 8 0 0 0-2.34-5.66M160 51.31L188.69 80H160ZM200 216H56V40h88v48a8 8 0 0 0 8 8h48zm-32-80a8 8 0 0 1-8 8H96a8 8 0 0 1 0-16h64a8 8 0 0 1 8 8m0 32a8 8 0 0 1-8 8H96a8 8 0 0 1 0-16h64a8 8 0 0 1 8 8"},null,-1)])])}const LT=Me({name:"ph-file-text",render:nae}),oae={class:"export-download-panel"},rae=le({__name:"ExportDownloadPanel",emits:["download-png","download-svg"],setup(t,{emit:e}){const n=hg(),{selectedFormat:o,pngScale:r,svgInlineFonts:i,svgMinify:s,bpcCompact:a}=$t(n),{setSelectedFormat:l}=n,{dsl:c}=Rf(),u=e;function d(){u("download-png",r.value)}function f(){u("download-svg")}function h(){Ff(new globalThis.Blob([c.value],{type:"text/plain"}),"chart.bpc")}return(g,v)=>{const m=Wse,b=Fs;return w(),R("div",oae,[H(m,{selected:p(o)==="png",icon:p(Zse),label:"PNG",description:"Raster image, best for presentations","icon-bg":"var(--bs-info-bg-subtle)","icon-color":"var(--bs-info-text-emphasis)",onSelect:v[1]||(v[1]=y=>p(l)("png")),onDownload:d},{default:ee(()=>[H(p(xr),{id:"png-scale","model-value":p(r),label:"Scale",min:1,max:4,step:1,"onUpdate:modelValue":v[0]||(v[0]=y=>r.value=y)},null,8,["model-value"])]),_:1},8,["selected","icon"]),H(m,{selected:p(o)==="svg",icon:p(eae),label:"SVG",description:"Vector image, best for print and web","icon-bg":"var(--bs-success-bg-subtle)","icon-color":"var(--bs-success-text-emphasis)",onSelect:v[4]||(v[4]=y=>p(l)("svg")),onDownload:f},{default:ee(()=>[H(b,{modelValue:p(i),"onUpdate:modelValue":v[2]||(v[2]=y=>Xe(i)?i.value=y:null),switch:""},{default:ee(()=>[...v[7]||(v[7]=[Ye(" Inline fonts ",-1)])]),_:1},8,["modelValue"]),H(b,{modelValue:p(s),"onUpdate:modelValue":v[3]||(v[3]=y=>Xe(s)?s.value=y:null),switch:""},{default:ee(()=>[...v[8]||(v[8]=[Ye(" Minify ",-1)])]),_:1},8,["modelValue"])]),_:1},8,["selected","icon"]),H(m,{selected:p(o)==="bpc",icon:p(LT),label:"BPC",description:"Blueprint Chart DSL file","icon-bg":"var(--bs-warning-bg-subtle)","icon-color":"var(--bs-warning-text-emphasis)",onSelect:v[6]||(v[6]=y=>p(l)("bpc")),onDownload:h},{default:ee(()=>[H(b,{modelValue:p(a),"onUpdate:modelValue":v[5]||(v[5]=y=>Xe(a)?a.value=y:null),switch:""},{default:ee(()=>[...v[9]||(v[9]=[Ye(" Compact ",-1)])]),_:1},8,["modelValue"])]),_:1},8,["selected","icon"])])}}}),iae=Oe(rae,[["__scopeId","data-v-f6670dcb"]]),sae={class:"export-embed-panel"},aae={class:"export-embed-panel__code-block"},lae={class:"export-embed-panel__code-block__header"},cae={class:"export-embed-panel__code-block__pre"},uae=["href"],dae=le({__name:"ExportEmbedPanel",setup(t){const{dsl:e,generateDsl:n}=Rf(),{layout:o}=hn();function r(a){const l=new TextEncoder().encode(a);let c="";for(const u of l)c+=String.fromCharCode(u);return globalThis.btoa(c)}const i=A(()=>{const a=r(e.value||n());return`${window.location.origin}${window.location.pathname}#/render?bpc64=${encodeURIComponent(a)}`}),s=A(()=>{const a=Bt(o.value),l=a.heightMode==="fixed"?a.fixedHeight:400,c=[];return a.sizing==="responsive"?c.push(`width="100%" height="${l}"`):a.sizing==="max-width"?c.push(`style="width:100%;max-width:${a.maxWidth}px" height="${l}"`):c.push(`width="${a.fixedWidth}" height="${l}"`),`<iframe src="${i.value}" ${c.join(" ")} frameborder="0"></iframe>`});return(a,l)=>(w(),R("div",sae,[T("div",aae,[T("div",lae,[l[0]||(l[0]=T("span",{class:"export-embed-panel__code-block__label"},"Embed code",-1)),H(p(B_),{text:p(s),label:"Copy",variant:"outline-secondary",size:"sm"},null,8,["text"])]),T("pre",cae,[T("code",null,be(p(s)),1)])]),l[1]||(l[1]=T("div",{class:"export-embed-panel__info"}," Paste this iframe into your HTML page. The chart renders automatically. ",-1)),H(p(B_),{text:p(s),label:"Copy embed code",variant:"primary",size:"sm"},null,8,["text"]),T("a",{href:p(i),target:"_blank",rel:"noopener",class:"export-embed-panel__link"}," Preview in new tab ",8,uae)]))}}),fae=Oe(dae,[["__scopeId","data-v-030ab97a"]]),hae=["onClick"],pae=le({__name:"PanelTabBar",props:st({tabs:{},sticky:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=ft(t,"modelValue"),n=ht("tabsRef");let o=null;function r(){wn(()=>{o!=null&&o.scrollIntoView&&n.value&&o.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})})}return qe(()=>o,r),(i,s)=>(w(),R("div",{ref_key:"tabsRef",ref:n,class:Te(["panel-tab-bar",{"panel-tab-bar--sticky":t.sticky}])},[(w(!0),R(We,null,mt(t.tabs,a=>(w(),R("button",{key:a.key,ref_for:!0,ref:l=>{a.key===e.value&&(Xe(o)?o.value=l:o=l)},class:Te(["panel-tab-bar__tab",{"panel-tab-bar__tab--active":e.value===a.key}]),onClick:l=>e.value=a.key},[a.icon?(w(),Z(Gt(a.icon),{key:0,class:"panel-tab-bar__tab__icon","aria-hidden":"true"})):ie("",!0),Ye(" "+be(a.label),1)],10,hae))),128))],2))}}),U2=Oe(pae,[["__scopeId","data-v-1a1009cc"]]),mae=le({__name:"CanvasModePickerOptionSwatch",props:{mode:{}},setup(t){return(e,n)=>(w(),R("span",{class:Te(["canvas-mode-swatch",`canvas-mode-swatch--${t.mode}`])},null,2))}}),PT=Oe(mae,[["__scopeId","data-v-81dabc6c"]]),gae=Bo("editorPanel",()=>{const t=Re("type"),e=Re("preview"),n=Re("blueprint"),o=Re(!0),r=Re(null),i=Re("upload"),s=Re(""),a=Re(!1),l=Re(-1),c=Re("type"),u=Re("column");function d(S){t.value=S}function f(S){r.value=S,d("annotate")}function h(S){e.value=S}function g(S){n.value=S}function v(S){i.value=S,S==="structure"&&b("column")}function m(S){s.value=S}function b(S){s.value=S,a.value=!0}function y(){a.value=!1,s.value=""}function x(){a.value=!a.value}function _(S){if(l.value===S){l.value=-1;return}l.value=S,b("column")}function k(S){c.value=S}function E(S){u.value=S}function L(){t.value="type",e.value="preview",n.value="blueprint",o.value=!0,r.value=null,i.value="upload",s.value="",a.value=!1,l.value=-1,c.value="type",u.value="column"}return{activeTab:t,viewMode:e,canvasMode:n,showDimensions:o,pendingAnnotationIndex:r,dataView:i,dataPanelTab:s,dataPanelOpen:a,selectedColumnIndex:l,lastNarrowEditTab:c,lastNarrowDataTab:u,selectTab:d,selectAnnotation:f,setViewMode:h,setCanvasMode:g,setDataView:v,setDataPanelTab:m,openDataPanel:b,closeDataPanel:y,toggleDataPanel:x,selectColumn:_,setLastNarrowEditTab:k,setLastNarrowDataTab:E,reset:L}});function fr(){const t=gae(),{activeTab:e,viewMode:n,canvasMode:o,showDimensions:r,pendingAnnotationIndex:i,dataView:s,dataPanelTab:a,dataPanelOpen:l,selectedColumnIndex:c,lastNarrowEditTab:u,lastNarrowDataTab:d}=$t(t);return{activeTab:e,viewMode:n,canvasMode:o,showDimensions:r,pendingAnnotationIndex:i,dataView:s,dataPanelTab:a,dataPanelOpen:l,selectedColumnIndex:c,lastNarrowEditTab:u,lastNarrowDataTab:d,selectTab:t.selectTab,selectAnnotation:t.selectAnnotation,setViewMode:t.setViewMode,setCanvasMode:t.setCanvasMode,setDataView:t.setDataView,setDataPanelTab:t.setDataPanelTab,openDataPanel:t.openDataPanel,closeDataPanel:t.closeDataPanel,toggleDataPanel:t.toggleDataPanel,selectColumn:t.selectColumn,setLastNarrowEditTab:t.setLastNarrowEditTab,setLastNarrowDataTab:t.setLastNarrowDataTab,reset:t.reset}}const vae={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function bae(t,e){return w(),R("svg",vae,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"m235.32 73.37l-52.69-52.68a16 16 0 0 0-22.63 0L20.68 160a16 16 0 0 0 0 22.63l52.69 52.68a16 16 0 0 0 22.63 0L235.32 96a16 16 0 0 0 0-22.63M84.68 224L32 171.31l32-32l26.34 26.35a8 8 0 0 0 11.32-11.32L75.31 128L96 107.31l26.34 26.35a8 8 0 0 0 11.32-11.32L107.31 96L128 75.31l26.34 26.35a8 8 0 0 0 11.32-11.32L139.31 64l32-32L224 84.69Z"},null,-1)])])}const yae=Me({name:"ph-ruler",render:bae}),xae=le({__name:"CanvasDimensionsToggle",setup(t){const{showDimensions:e}=$t(fr());return(n,o)=>(w(),R("button",{class:Te(["canvas-dimensions-toggle",{"canvas-dimensions-toggle--active":p(e)}]),title:"Show dimensions",onClick:o[0]||(o[0]=r=>e.value=!p(e))},[H(p(yae))],2))}}),wae=Oe(xae,[["__scopeId","data-v-0920c699"]]),_ae=["title"],kae={class:"canvas-mode-picker-option__label"},Sae=le({__name:"CanvasModePickerOption",props:{mode:{},label:{},active:{type:Boolean}},emits:["select"],setup(t){return(e,n)=>{const o=PT;return w(),R("button",{class:Te(["canvas-mode-picker-option",{"canvas-mode-picker-option--active":t.active}]),title:t.label,onClick:n[0]||(n[0]=r=>e.$emit("select"))},[H(o,{mode:t.mode},null,8,["mode"]),T("span",kae,be(t.label),1)],10,_ae)}}}),Aae=Oe(Sae,[["__scopeId","data-v-b7a042b3"]]),Cae={class:"canvas-mode-picker__extra"},$ae={key:1,class:"canvas-mode-picker__trigger",title:"Canvas mode"},Tae=le({__name:"CanvasModePicker",setup(t){const e=fr(),{canvasMode:n}=$t(e),{setCanvasMode:o}=e,r=Re(!1),i=[{value:"blueprint",label:"Blueprint"},{value:"auto",label:"Auto"},{value:"light",label:"Light"},{value:"dark",label:"Dark"}];function s(a){o(a),r.value=!1}return(a,l)=>{const c=Aae,u=wae,d=PT;return w(),R("div",{class:"canvas-mode-picker",onMouseenter:l[0]||(l[0]=f=>r.value=!0),onMouseleave:l[1]||(l[1]=f=>r.value=!1)},[p(r)?(w(),R(We,{key:0},[(w(),R(We,null,mt(i,f=>H(c,{key:f.value,mode:f.value,label:f.label,active:p(n)===f.value,onSelect:h=>s(f.value)},null,8,["mode","label","active","onSelect"])),64)),l[3]||(l[3]=T("div",{class:"canvas-mode-picker__divider"},null,-1)),T("div",Cae,[H(u),l[2]||(l[2]=T("span",{class:"canvas-mode-picker__extra__label"},"Dims",-1))])],64)):(w(),R("button",$ae,[H(d,{mode:p(n)},null,8,["mode"])]))],32)}}}),DT=Oe(Tae,[["__scopeId","data-v-f05ed5f9"]]),Mae={transform:"translate(0.5, 0.5)"},Oae={class:"canvas-dimensions__line"},Bae=["x1","y1","x2","y2"],Lae=["x1","y1","x2","y2"],Pae=["x1","y1","x2","y2"],Dae=["x","y"],Eae={class:"canvas-dimensions__line"},Iae=["x1","y1","x2","y2"],Nae=["x1","y1","x2","y2"],Rae=["x1","y1","x2","y2"],Fae=["x","y"],Vae={class:"canvas-dimensions__line canvas-dimensions__line--padding"},zae=["x1","y1","x2","y2"],Hae=["x1","y1","x2","y2"],Wae=["x1","y1","x2","y2"],Uae=["x","y"],Gae=["x1","y1","x2","y2"],qae=["x1","y1","x2","y2"],Yae=["x1","y1","x2","y2"],jae=["x","y"],Xae={class:"canvas-dimensions__line canvas-dimensions__line--padding"},Kae=["x1","y1","x2","y2"],Zae=["x1","y1","x2","y2"],Qae=["x1","y1","x2","y2"],Jae=["x","y"],ele=["x1","y1","x2","y2"],tle=["x1","y1","x2","y2"],nle=["x1","y1","x2","y2"],ole=["x","y"],j6=20,en=3,Ah=4,X6=20,rle=le({__name:"CanvasDimensions",props:{cardRef:{},canvasRef:{},layout:{}},setup(t){const e=t,n=ze(null);function o(){const b=e.cardRef;if(!b){n.value=null;return}n.value={left:b.offsetLeft,top:b.offsetTop,width:b.offsetWidth,height:b.offsetHeight}}ss(()=>e.canvasRef,o),ss(()=>e.cardRef,o);const r=A(()=>({position:"absolute",inset:"0",width:"100%",height:"100%",pointerEvents:"none",overflow:"visible"})),i=A(()=>{const b=n.value;return{x1:b.left,x2:b.left+b.width,y:b.top+b.height+j6}}),s=A(()=>{const b=n.value;return{x:b.left-j6,y1:b.top,y2:b.top+b.height}}),a=A(()=>{const b=i.value,y=e.layout.padding;return y>0&&!c.value?{x1:b.x1+y+Ah,x2:b.x2-y-Ah}:{x1:b.x1,x2:b.x2}}),l=A(()=>{const b=s.value,y=e.layout.padding;return y>0&&!u.value?{y1:b.y1+y+Ah,y2:b.y2-y-Ah}:{y1:b.y1,y2:b.y2}}),c=A(()=>e.layout.sizing!=="responsive"),u=A(()=>e.layout.heightMode!=="auto"),d=A(()=>e.layout.padding>0),f=A(()=>`${e.layout.padding}px`),h=A(()=>i.value.y+X6),g=A(()=>s.value.x-X6),v=A(()=>{const b=e.layout;return b.sizing==="fixed"?`${b.fixedWidth}px`:b.sizing==="max-width"?`max ${b.maxWidth}px`:"auto"}),m=A(()=>{const b=e.layout;return b.heightMode==="fixed"?`${b.fixedHeight}px`:b.heightMode==="aspect-ratio"?b.aspectRatio:"auto"});return(b,y)=>p(n)?(w(),R("svg",{key:0,class:"canvas-dimensions",style:Pt(p(r))},[T("g",Mae,[T("g",Oae,[T("line",{x1:p(a).x1,y1:p(i).y,x2:p(a).x2,y2:p(i).y},null,8,Bae),T("line",{x1:p(a).x1,y1:p(i).y-en,x2:p(a).x1,y2:p(i).y+en},null,8,Lae),T("line",{x1:p(a).x2,y1:p(i).y-en,x2:p(a).x2,y2:p(i).y+en},null,8,Pae),T("text",{x:(p(i).x1+p(i).x2)/2,y:p(i).y+en+12,"text-anchor":"middle"},be(p(v)),9,Dae)]),T("g",Eae,[T("line",{x1:p(s).x,y1:p(l).y1,x2:p(s).x,y2:p(l).y2},null,8,Iae),T("line",{x1:p(s).x-en,y1:p(l).y1,x2:p(s).x+en,y2:p(l).y1},null,8,Nae),T("line",{x1:p(s).x-en,y1:p(l).y2,x2:p(s).x+en,y2:p(l).y2},null,8,Rae),T("text",{x:p(s).x-5,y:(p(s).y1+p(s).y2)/2,"text-anchor":"end","dominant-baseline":"central"},be(p(m)),9,Fae)]),p(d)?(w(),R(We,{key:0},[T("g",Vae,[T("line",{x1:p(i).x1,y1:p(c)?p(h):p(i).y,x2:p(i).x1+t.layout.padding,y2:p(c)?p(h):p(i).y},null,8,zae),T("line",{x1:p(i).x1,y1:(p(c)?p(h):p(i).y)-en,x2:p(i).x1,y2:(p(c)?p(h):p(i).y)+en},null,8,Hae),T("line",{x1:p(i).x1+t.layout.padding,y1:(p(c)?p(h):p(i).y)-en,x2:p(i).x1+t.layout.padding,y2:(p(c)?p(h):p(i).y)+en},null,8,Wae),T("text",{x:p(i).x1+t.layout.padding/2,y:(p(c)?p(h):p(i).y)+en+12,"text-anchor":"middle"},be(p(f)),9,Uae),T("line",{x1:p(i).x2-t.layout.padding,y1:p(c)?p(h):p(i).y,x2:p(i).x2,y2:p(c)?p(h):p(i).y},null,8,Gae),T("line",{x1:p(i).x2-t.layout.padding,y1:(p(c)?p(h):p(i).y)-en,x2:p(i).x2-t.layout.padding,y2:(p(c)?p(h):p(i).y)+en},null,8,qae),T("line",{x1:p(i).x2,y1:(p(c)?p(h):p(i).y)-en,x2:p(i).x2,y2:(p(c)?p(h):p(i).y)+en},null,8,Yae),T("text",{x:p(i).x2-t.layout.padding/2,y:(p(c)?p(h):p(i).y)+en+12,"text-anchor":"middle"},be(p(f)),9,jae)]),T("g",Xae,[T("line",{x1:p(u)?p(g):p(s).x,y1:p(s).y1,x2:p(u)?p(g):p(s).x,y2:p(s).y1+t.layout.padding},null,8,Kae),T("line",{x1:(p(u)?p(g):p(s).x)-en,y1:p(s).y1,x2:(p(u)?p(g):p(s).x)+en,y2:p(s).y1},null,8,Zae),T("line",{x1:(p(u)?p(g):p(s).x)-en,y1:p(s).y1+t.layout.padding,x2:(p(u)?p(g):p(s).x)+en,y2:p(s).y1+t.layout.padding},null,8,Qae),T("text",{x:(p(u)?p(g):p(s).x)-en-4,y:p(s).y1+t.layout.padding/2,"text-anchor":"end","dominant-baseline":"central"},be(p(f)),9,Jae),T("line",{x1:p(u)?p(g):p(s).x,y1:p(s).y2-t.layout.padding,x2:p(u)?p(g):p(s).x,y2:p(s).y2},null,8,ele),T("line",{x1:(p(u)?p(g):p(s).x)-en,y1:p(s).y2-t.layout.padding,x2:(p(u)?p(g):p(s).x)+en,y2:p(s).y2-t.layout.padding},null,8,tle),T("line",{x1:(p(u)?p(g):p(s).x)-en,y1:p(s).y2,x2:(p(u)?p(g):p(s).x)+en,y2:p(s).y2},null,8,nle),T("text",{x:(p(u)?p(g):p(s).x)-en-4,y:p(s).y2-t.layout.padding/2,"text-anchor":"end","dominant-baseline":"central"},be(p(f)),9,ole)])],64)):ie("",!0)])],4)):ie("",!0)}}),ET=Oe(rle,[["__scopeId","data-v-394e6d5d"]]);function ile(t){const e=t.split(":");if(e.length!==2)return;const n=Number(e[0]),o=Number(e[1]);return n&&o?n/o:void 0}function G2(t,e){const n=A(()=>t.value.heightMode==="fixed"||t.value.heightMode==="aspect-ratio"),o=A(()=>({[`${e}--fixed`]:t.value.sizing==="fixed",[`${e}--max-width`]:t.value.sizing==="max-width",[`${e}--transparent`]:t.value.transparentBackground,[`${e}--constrained-height`]:n.value})),r=A(()=>{const i=t.value,s={};if(i.sizing==="fixed"?s.width=`${i.fixedWidth}px`:i.sizing==="max-width"&&(s.maxWidth=`${i.maxWidth}px`,s.width="100%"),i.heightMode==="fixed")s.height=`${i.fixedHeight}px`;else if(i.heightMode==="aspect-ratio"){const a=ile(i.aspectRatio);a&&(s.aspectRatio=String(a))}return s});return{cardClass:o,cardStyle:r,hasConstrainedHeight:n}}function sle(t,e){t.replaceChildren();const n=document.createElement("div");n.className="text-center text-muted p-5",n.textContent=e,t.appendChild(n)}const ale=150;function q2(t){const e=hn(),{currentOptions:n}=kn(),{scenes:o,activeIndex:r,activeScene:i}=_n(),{columns:s,rows:a,columnTypes:l}=Ko(),{applyStepList:c}=Lr(),{theme:u}=Tf(),{chartTheme:d}=iT(),f=Symbol("unset");let h=f,g=!1;function v(){if(!(!t.value||g)){g=!0;try{m()}finally{g=!1}}}function m(){var te;if(!t.value)return;const _=i.value,k=Fa(o.value,r.value),E=(k==null?void 0:k.chartType)??e.chartType.value;let L;if((k==null?void 0:k.data)!==void 0)L=k.data;else if((te=k==null?void 0:k.transforms)!=null&&te.length&&s.value.length>0){const pe=c(k.transforms,s.value,a.value,l.value);L=dg(pe.columns,pe.rows)}else L=e.data.value;const S=hs(L),B=[Le.BarVertical,Le.BarHorizontal,Le.Line,Le.VerticalBar,Le.HorizontalBar];if(S.series&&S.series.length>0&&B.includes(E)){const pe=S.series.find(we=>we.name===e.selectedColumn.value);pe&&(S.values=pe.values),delete S.series}if(S.labels.length===0){sle(t.value,"No data to preview");return}const D=n.value.allowDarkMode??!0,N=t.value.parentElement;N&&(!D&&u.value!=="light"?N.setAttribute("data-bs-theme","light"):N.removeAttribute("data-bs-theme"));const C=h!==f&&_!==h,M=k!=null&&k.chartTypeOptions?{...n.value,...k.chartTypeOptions}:n.value,P=(k==null?void 0:k.colorizes)??e.colorizes.value,$=k?k.highlights??[]:e._base.highlights.value,F=(k==null?void 0:k.areaFills)??e.areaFills.value,V=e._base.annotations.value,U=(k==null?void 0:k.annotations)??[],K=[...V,...U],ae=k!=null&&k.hiddenAnnotationIds?K.filter(pe=>!pe.id||!k.hiddenAnnotationIds.has(pe.id)):K,me=(k==null?void 0:k.seriesOverrides)??e.seriesOverrides.value,de=k==null?void 0:k.properties,ve={title:(de==null?void 0:de.title)??(e.title.value||void 0),description:(de==null?void 0:de.description)??(e.description.value||void 0),byline:e.byline.value||void 0,note:e.note.value||void 0,source:(de==null?void 0:de.source)??(e.source.value||void 0),sourceUrl:(de==null?void 0:de.sourceUrl)??(e.sourceUrl.value||void 0),padding:`${e.layout.value.padding}px`,transparentBackground:e.layout.value.transparentBackground||void 0};P2(t.value,{chartType:E,data:S,options:M,frame:ve,colorizes:P,highlights:$,areaFills:F,annotations:ae,seriesOverrides:me,sort:oT(k)??e.sort.value,sortMode:e.sortMode.value!=="none"?e.sortMode.value:void 0,theme:d.value},{transition:C,ignoreLayout:!0}),h=_}ss(t,PN(v,ale));const y=A(()=>JSON.stringify(e.layout.value)),x=A(()=>JSON.stringify(n.value));return qe([t,e.chartType,e.title,e.data,e.sort,e.sortMode,e.description,e.byline,e.note,e.source,e.sourceUrl,e.selectedColumn,e.colorizes,e.highlights,e.areaFills,e.annotations,e.seriesOverrides,y,x,o,i,u,d],v,{immediate:!0,flush:"post"}),{config:e}}function lle(t,e){function n(){var s;return((s=t.value)==null?void 0:s.querySelector("svg"))??null}function o(){var s;return((s=t.value)==null?void 0:s.querySelector(".bc-frame"))??null}function r(){const s=(e==null?void 0:e.value)??o();if(s){jse(s);return}const a=n();a&&Use(a)}async function i(s=2){const a=o();if(a){const d=e!=null&&e.value?BT(e.value):void 0,f=e!=null&&e.value?qse(e.value):void 0;await Yse(a,s,"chart.png",d,f);return}const l=n();if(!l)return;const{width:c,height:u}=l.getBoundingClientRect();await Gse(l,c*s,u*s)}return{downloadSvg:r,downloadPng:i}}const cle=le({__name:"ExportPanel",setup(t){const e=fr(),{canvasMode:n,showDimensions:o}=$t(e),{setViewMode:r}=e,{mode:i}=ic();r("preview");const s=hg(),{exportTab:a}=$t(s),{setExportTab:l,setLastNarrowExportTab:c}=s,{isNarrow:u}=gi();qe(i,$=>{$==="drawer"&&a.value&&(c(a.value),l(""))},{immediate:!0});const{layout:d}=hn(),{cardClass:f,cardStyle:h}=G2(d,"export-panel__canvas__card"),g=ht("canvasRef"),v=ht("cardRef"),m=ht("previewRef");q2(m);const{downloadSvg:b,downloadPng:y}=lle(m,v),x=Re(0),_=Re(0);let k=0;function E(){globalThis.cancelAnimationFrame(k),k=globalThis.requestAnimationFrame(()=>{const $=v.value;if($){const F=$.offsetLeft,V=$.offsetTop;(F!==x.value||V!==_.value)&&(x.value=F,_.value=V)}})}ss(g,E),ss(v,E);const L=A(()=>({"--grid-offset-x":`${x.value}px`,"--grid-offset-y":`${_.value}px`})),{lastNarrowExportTab:S}=$t(s),B=A({get:()=>!!a.value,set:$=>{l($?S.value:"")}});function D($){c($),l($)}const{sections:N}=MT(),C={embed:"Embed",download:"Download"},M=A(()=>C[a.value]??"Export"),P=A(()=>({[`export-panel__canvas--${n.value}`]:n.value!=="blueprint"}));return($,F)=>{const V=ET,U=DT,K=U2,ae=fae,me=iae,de=W2,ve=fg,te=Lse;return w(),R("div",{class:Te(["export-panel",{"export-panel--narrow":p(u)}])},[T("div",{ref_key:"canvasRef",ref:g,class:Te(["export-panel__canvas",p(P)]),style:Pt(p(L))},[T("div",{ref_key:"cardRef",ref:v,class:Te(["export-panel__canvas__card",p(f)]),style:Pt(p(h))},[T("div",{ref_key:"previewRef",ref:m,class:"export-panel__canvas__preview w-100 h-100"},null,512)],6),p(o)?(w(),Z(V,{key:0,"card-ref":p(v),"canvas-ref":p(g),layout:p(d)},null,8,["card-ref","canvas-ref","layout"])):ie("",!0),H(U)],6),H(ve,{"drawer-open":p(B),"onUpdate:drawerOpen":F[0]||(F[0]=pe=>Xe(B)?B.value=pe:null),title:p(M),"container-ref":p(g)},wi({default:ee(()=>[p(a)==="embed"?(w(),Z(ae,{key:0})):p(a)==="download"?(w(),Z(me,{key:1,onDownloadPng:p(y),onDownloadSvg:p(b)},null,8,["onDownloadPng","onDownloadSvg"])):ie("",!0)]),_:2},[p(i)==="drawer"?{name:"tabs",fn:ee(()=>[H(K,{tabs:p(N),"model-value":p(a),sticky:"","onUpdate:modelValue":D},null,8,["tabs","model-value"])]),key:"0"}:void 0,p(i)!=="drawer"?{name:"footer",fn:ee(()=>[H(de)]),key:"1"}:void 0]),1032,["drawer-open","title","container-ref"]),p(u)?ie("",!0):(w(),Z(te,{key:0}))],2)}}}),ule=Oe(cle,[["__scopeId","data-v-6f293e9b"]]),dle={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function fle(t,e){return w(),R("svg",dle,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M87.24 52.59a8 8 0 0 0-14.48 0l-64 136a8 8 0 1 0 14.48 6.81L39.9 160h80.2l16.66 35.4a8 8 0 1 0 14.48-6.81ZM47.43 144L80 74.79L112.57 144ZM200 96c-12.76 0-22.73 3.47-29.63 10.32a8 8 0 0 0 11.26 11.36c3.8-3.77 10-5.68 18.37-5.68c13.23 0 24 9 24 20v3.22a42.76 42.76 0 0 0-24-7.22c-22.06 0-40 16.15-40 36s17.94 36 40 36a42.73 42.73 0 0 0 24-7.25a8 8 0 0 0 16-.75v-60c0-19.85-17.94-36-40-36m0 88c-13.23 0-24-9-24-20s10.77-20 24-20s24 9 24 20s-10.77 20-24 20"},null,-1)])])}const IT=Me({name:"ph-text-aa",render:fle}),hle={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function ple(t,e){return w(),R("svg",hle,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M200.77 53.89A103.27 103.27 0 0 0 128 24h-1.07A104 104 0 0 0 24 128c0 43 26.58 79.06 69.36 94.17A32 32 0 0 0 136 192a16 16 0 0 1 16-16h46.21a31.81 31.81 0 0 0 31.2-24.88a104.4 104.4 0 0 0 2.59-24a103.28 103.28 0 0 0-31.23-73.23m13 93.71a15.89 15.89 0 0 1-15.56 12.4H152a32 32 0 0 0-32 32a16 16 0 0 1-21.31 15.07C62.49 194.3 40 164 40 128a88 88 0 0 1 87.09-88h.9a88.35 88.35 0 0 1 88 87.25a89 89 0 0 1-2.18 20.35ZM140 76a12 12 0 1 1-12-12a12 12 0 0 1 12 12m-44 24a12 12 0 1 1-12-12a12 12 0 0 1 12 12m0 56a12 12 0 1 1-12-12a12 12 0 0 1 12 12m88-56a12 12 0 1 1-12-12a12 12 0 0 1 12 12"},null,-1)])])}const NT=Me({name:"ph-palette",render:ple}),mle={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function gle(t,e){return w(),R("svg",mle,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M220.27 158.54a8 8 0 0 0-7.7-.46a20 20 0 1 1 0-36.16a8 8 0 0 0 11.43-7.23V72a16 16 0 0 0-16-16h-36.22a35 35 0 0 0 .22-4a36.1 36.1 0 0 0-11.36-26.24a36 36 0 0 0-60.55 23.62a36.6 36.6 0 0 0 .14 6.62H64a16 16 0 0 0-16 16v32.22a35 35 0 0 0-4-.22a36.12 36.12 0 0 0-26.24 11.36a35.7 35.7 0 0 0-9.69 27a36.08 36.08 0 0 0 33.31 33.6a35.7 35.7 0 0 0 6.62-.14V208a16 16 0 0 0 16 16h144a16 16 0 0 0 16-16v-42.69a8 8 0 0 0-3.73-6.77M208 208H64v-42.69a8 8 0 0 0-11.43-7.23a20 20 0 1 1 0-36.16A8 8 0 0 0 64 114.69V72h46.69a8 8 0 0 0 7.23-11.43a20 20 0 1 1 36.16 0A8 8 0 0 0 161.31 72H208v32.23a35.7 35.7 0 0 0-6.62-.14A36 36 0 0 0 204 176a35 35 0 0 0 4-.22Z"},null,-1)])])}const vle=Me({name:"ph-puzzle-piece",render:gle}),ble={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function yle(t,e){return w(),R("svg",ble,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M222.16 177.25a8 8 0 0 1-1 11.25c-17.36 14.39-32.86 19.5-47 19.5c-18.58 0-34.82-8.82-49.93-17c-25.35-13.76-47.24-25.64-79.07.74a8 8 0 1 1-10.22-12.31c40.17-33.28 70.32-16.92 96.93-2.48c25.35 13.75 47.24 25.63 79.07-.74a8 8 0 0 1 11.22 1.04m-11.27-57c-31.83 26.38-53.72 14.5-79.07.74c-26.61-14.43-56.76-30.79-96.93 2.49a8 8 0 0 0 10.22 12.31c31.83-26.38 53.72-14.5 79.07-.74c15.11 8.19 31.35 17 49.93 17c14.14 0 29.64-5.11 47-19.5a8 8 0 1 0-10.22-12.31ZM45.11 79.8c31.83-26.37 53.72-14.49 79.07-.74c15.11 8.2 31.35 17 49.93 17c14.14 0 29.64-5.12 47-19.5a8 8 0 1 0-10.22-12.31c-31.83 26.38-53.72 14.5-79.07.74c-26.61-14.41-56.76-30.77-96.93 2.51a8 8 0 1 0 10.22 12.3"},null,-1)])])}const xle=Me({name:"ph-waves",render:yle}),wle={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function _le(t,e){return w(),R("svg",wle,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"m229.66 197.66l-32 32a8 8 0 0 1-11.32-11.32L204.69 200H80a8 8 0 0 1-8-8V59.31L53.66 77.66a8 8 0 0 1-11.32-11.32l32-32a8 8 0 0 1 11.32 0l32 32a8 8 0 0 1-11.32 11.32L88 59.31V184h116.69l-18.35-18.34a8 8 0 0 1 11.32-11.32l32 32a8 8 0 0 1 0 11.32"},null,-1)])])}const kle=Me({name:"ph-vector-two",render:_le}),Sle={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Ale(t,e){return w(),R("svg",Sle,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"m235.32 81.37l-60.69-60.68a16 16 0 0 0-22.63 0l-53.63 53.8c-10.66-3.34-35-7.37-60.4 13.14a16 16 0 0 0-1.29 23.78L85 159.71l-42.66 42.63a8 8 0 0 0 11.32 11.32L96.29 171l48.29 48.29A16 16 0 0 0 155.9 224h1.13a15.93 15.93 0 0 0 11.64-6.33c19.64-26.1 17.75-47.32 13.19-60L235.33 104a16 16 0 0 0-.01-22.63M224 92.69l-57.27 57.46a8 8 0 0 0-1.49 9.22c9.46 18.93-1.8 38.59-9.34 48.62L48 100.08c12.08-9.74 23.64-12.31 32.48-12.31A40.1 40.1 0 0 1 96.81 91a8 8 0 0 0 9.25-1.51L163.32 32L224 92.68Z"},null,-1)])])}const Cle=Me({name:"ph-push-pin",render:Ale}),$le=["showVerticalAxis","verticalAxisDirection","showVerticalTicks","verticalLabelPosition","verticalGridStyle","verticalNumberFormat","verticalScaleType","verticalRangeMin","verticalRangeMax","showHorizontalAxis","showHorizontalTicks","horizontalLabelPosition","horizontalGridStyle","horizontalNumberFormat","horizontalScaleType","horizontalRangeMin","horizontalRangeMax"];function RT(){const{chartType:t}=hn(),{availableOptionKeys:e}=kn(),{scenes:n}=_n(),o=A(()=>e.value.some(s=>$le.includes(s))),r=A(()=>e.value.includes("tooltips")||e.value.includes("crosshair")||n.value.length>=1);return{sections:A(()=>{const s=[{key:"type",label:"Type",icon:Ps,tooltip:"Chart Type"},{key:"text",label:"Text",icon:IT},{key:"style",label:"Style",icon:NT}];return["line-multi","bar-multi","bar-split"].includes(t.value)&&s.push({key:"series",label:"Series",icon:xle}),o.value&&s.push({key:"axes",label:"Axes",icon:kle}),s.push({key:"layout",label:"Layout",icon:vle}),s.push({key:"annotate",label:"Annotate",icon:Cle}),r.value&&s.push({key:"interactions",label:"Interactions",icon:ST}),s})}}const Tle=le({__name:"ChartEditIconRail",setup(t){const e=fr(),{activeTab:n}=$t(e),{selectTab:o}=e,{toggleMode:r}=ic(),{sections:i}=RT(),s=A(()=>i.value.map(a=>({value:a.key,icon:a.icon,tooltip:a.tooltip??a.label})));return(a,l)=>{const c=z2;return w(),Z(c,{"active-tab":p(n),items:p(s),onSelect:p(o),onToggleMode:p(r)},null,8,["active-tab","items","onSelect","onToggleMode"])}}}),Mle={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Ole(t,e){return w(),R("svg",Mle,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M90.34 61.66a8 8 0 0 1 0-11.32l32-32a8 8 0 0 1 11.32 0l32 32a8 8 0 0 1-11.32 11.32L136 43.31V96a8 8 0 0 1-16 0V43.31l-18.34 18.35a8 8 0 0 1-11.32 0m64 132.68L136 212.69V160a8 8 0 0 0-16 0v52.69l-18.34-18.35a8 8 0 0 0-11.32 11.32l32 32a8 8 0 0 0 11.32 0l32-32a8 8 0 0 0-11.32-11.32m83.32-72l-32-32a8 8 0 0 0-11.32 11.32L212.69 120H160a8 8 0 0 0 0 16h52.69l-18.35 18.34a8 8 0 0 0 11.32 11.32l32-32a8 8 0 0 0 0-11.32M43.31 136H96a8 8 0 0 0 0-16H43.31l18.35-18.34a8 8 0 0 0-11.32-11.32l-32 32a8 8 0 0 0 0 11.32l32 32a8 8 0 0 0 11.32-11.32Z"},null,-1)])])}const Ble=Me({name:"ph-arrows-out-cardinal",render:Ole}),Lle={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Ple(t,e){return w(),R("svg",Lle,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M165.66 194.34a8 8 0 0 1 0 11.32l-32 32a8 8 0 0 1-11.32 0l-32-32a8 8 0 0 1 11.32-11.32L120 212.69V43.31l-18.34 18.35a8 8 0 0 1-11.32-11.32l32-32a8 8 0 0 1 11.32 0l32 32a8 8 0 0 1-11.32 11.32L136 43.31v169.38l18.34-18.35a8 8 0 0 1 11.32 0"},null,-1)])])}const FT=Me({name:"ph-arrows-vertical",render:Ple}),Dle={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Ele(t,e){return w(),R("svg",Dle,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"m237.66 133.66l-32 32a8 8 0 0 1-11.32-11.32L212.69 136H43.31l18.35 18.34a8 8 0 0 1-11.32 11.32l-32-32a8 8 0 0 1 0-11.32l32-32a8 8 0 0 1 11.32 11.32L43.31 120h169.38l-18.35-18.34a8 8 0 0 1 11.32-11.32l32 32a8 8 0 0 1 0 11.32"},null,-1)])])}const VT=Me({name:"ph-arrows-horizontal",render:Ele}),Ile={viewBox:"0 0 20 20",width:"1.2em",height:"1.2em"};function Nle(t,e){return w(),R("svg",Ile,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M2 9.75A.75.75 0 0 1 2.75 9h14.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 9.75"},null,-1)])])}const Y2=Me({name:"fluent-line-horizontal-1-20-filled",render:Nle}),Rle={viewBox:"0 0 20 20",width:"1.2em",height:"1.2em"};function Fle(t,e){return w(),R("svg",Rle,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M2 9.75A.75.75 0 0 1 2.75 9h2.5a.75.75 0 0 1 0 1.5h-2.5A.75.75 0 0 1 2 9.75m6 0A.75.75 0 0 1 8.75 9h2.5a.75.75 0 0 1 0 1.5h-2.5A.75.75 0 0 1 8 9.75m6 0a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75"},null,-1)])])}const zT=Me({name:"fluent-line-horizontal-1-dashes-20-filled",render:Fle}),Vle={viewBox:"0 0 20 20",width:"1.2em",height:"1.2em"};function zle(t,e){return w(),R("svg",Vle,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M3.5 11a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3M8 11a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m4.5 0a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m6-1.5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0"},null,-1)])])}const HT=Me({name:"fluent-line-horizontal-1-dot-20-filled",render:zle}),Hle={class:"d-flex flex-column gap-3"},Wle=le({__name:"EditorInteractionSection",setup(t){const{currentOptions:e,availableOptionKeys:n,setOption:o}=kn(),{layout:r}=hn(),{scenes:i}=_n(),s=A(()=>n.value.includes("tooltips")),a=A(()=>n.value.includes("crosshair")),l=A(()=>i.value.length>=1),c=[{value:"both",text:"Both",icon:Ble},{value:"vertical",text:"Vertical",icon:FT},{value:"horizontal",text:"Horizontal",icon:VT}],u=[{value:"solid",text:"Solid",icon:Y2},{value:"dashed",text:"Dashed",icon:zT},{value:"dotted",text:"Dotted",icon:HT}],d=A({get:()=>r.value.playerType,set:v=>{r.value.playerType=v}}),f=A({get:()=>r.value.playerPosition,set:v=>{r.value.playerPosition=v}}),h=[{value:"buttons",label:"Buttons"},{value:"progress-bar",label:"Progress Bar"},{value:"dot-stepper",label:"Dot Stepper"},{value:"minimal-arrows",label:"Minimal Arrows"},{value:"none",label:"None"}],g=[{value:"left",text:"Left"},{value:"center",text:"Center"},{value:"right",text:"Right"}];return(v,m)=>(w(),R("div",Hle,[p(s)?(w(),Z(p(nn),{key:0,"model-value":p(e).tooltips??!1,label:"Tooltips","onUpdate:modelValue":m[0]||(m[0]=b=>p(o)("tooltips",b))},null,8,["model-value"])):ie("",!0),p(a)?(w(),Z(p(nn),{key:1,"model-value":p(e).crosshair??!1,label:"Crosshair","onUpdate:modelValue":m[1]||(m[1]=b=>p(o)("crosshair",b))},null,8,["model-value"])):ie("",!0),p(a)&&p(e).crosshair?(w(),R(We,{key:2},[H(p($n),{label:"Direction","model-value":p(e).crosshairDirection??"both",options:c,block:"","onUpdate:modelValue":m[2]||(m[2]=b=>p(o)("crosshairDirection",b))},null,8,["model-value"]),H(p($n),{label:"Line style","model-value":p(e).crosshairStyle??"dashed",options:u,block:"","onUpdate:modelValue":m[3]||(m[3]=b=>p(o)("crosshairStyle",b))},null,8,["model-value"]),H(p(Da),{id:"opt-crosshair-color",label:"Color","model-value":p(e).crosshairColor??"#999999","onUpdate:modelValue":m[4]||(m[4]=b=>p(o)("crosshairColor",b))},null,8,["model-value"])],64)):ie("",!0),p(l)?(w(),R(We,{key:3},[H(p(Rn),{id:"layout-player-type",modelValue:p(d),"onUpdate:modelValue":m[5]||(m[5]=b=>Xe(d)?d.value=b:null),label:"Scene player",options:h,block:""},null,8,["modelValue"]),p(d)==="buttons"||p(d)==="dot-stepper"||p(d)==="minimal-arrows"?(w(),Z(p($n),{key:0,modelValue:p(f),"onUpdate:modelValue":m[6]||(m[6]=b=>Xe(f)?f.value=b:null),label:"Player position",options:g,block:""},null,8,["modelValue"])):ie("",!0)],64)):ie("",!0)]))}}),Ule={},Gle={class:"d-flex flex-column gap-3"};function qle(t,e){const n=Wle;return w(),R("div",Gle,[H(n)])}const Yle=Oe(Ule,[["render",qle]]),jle={class:"border rounded overflow-hidden bg-body-tertiary"},Xle={class:"d-flex align-items-center justify-content-between px-2 py-1 border-bottom"},Kle={class:"fw-medium"},Zle={class:"p-2 d-flex flex-column gap-2"},Qle={class:"d-flex align-items-center gap-2"},Jle={class:"text-nowrap",style:{width:"3em"}},ece=le({__name:"EditorAreaFillItem",props:st({id:{},seriesNames:{}},{fill:{required:!0},fillModifiers:{}}),emits:st(["remove"],["update:fill"]),setup(t){const e=t,n=ft(t,"fill"),o=A(()=>e.seriesNames.map(s=>({value:s,text:s}))),r=[{value:"linear",text:"Linear"},{value:"monotoneX",text:"Monotone"},{value:"step",text:"Step"},{value:"basis",text:"Basis"},{value:"cardinal",text:"Cardinal"},{value:"catmullRom",text:"Catmull-Rom"}];function i(s,a){const l={...n.value};a===void 0?delete l[s]:l[s]=a,n.value=l}return(s,a)=>{const l=Ho,c=qa,u=On,d=ta,f=Fs;return w(),R("div",jle,[T("div",Xle,[T("small",Kle,be(n.value.from)+" – "+be(n.value.to),1),H(l,{variant:"link",size:"sm",class:"text-danger p-0",onClick:a[0]||(a[0]=h=>s.$emit("remove"))},{default:ee(()=>[...a[8]||(a[8]=[T("span",{"aria-hidden":"true"},"×",-1)])]),_:1})]),T("div",Zle,[H(u,{label:"From","label-for":`af-from-${t.id}`},{default:ee(()=>[H(c,{id:`af-from-${t.id}`,"model-value":n.value.from,options:p(o),"onUpdate:modelValue":a[1]||(a[1]=h=>i("from",h))},null,8,["id","model-value","options"])]),_:1},8,["label-for"]),H(u,{label:"To","label-for":`af-to-${t.id}`},{default:ee(()=>[H(c,{id:`af-to-${t.id}`,"model-value":n.value.to,options:p(o),"onUpdate:modelValue":a[2]||(a[2]=h=>i("to",h))},null,8,["id","model-value","options"])]),_:1},8,["label-for"]),H(u,{label:"Color","label-for":`af-color-${t.id}`},{default:ee(()=>[H(d,{id:`af-color-${t.id}`,type:"color","model-value":n.value.color??"#cccccc","onUpdate:modelValue":a[3]||(a[3]=h=>i("color",h))},null,8,["id","model-value"])]),_:1},8,["label-for"]),H(u,null,{default:ee(()=>[H(f,{"model-value":!!n.value.negativeColor,switch:"","onUpdate:modelValue":a[4]||(a[4]=h=>i("negativeColor",h?"#f28e2b":void 0))},{default:ee(()=>[...a[9]||(a[9]=[Ye(" Use different color for negative differences ",-1)])]),_:1},8,["model-value"])]),_:1}),n.value.negativeColor?(w(),Z(u,{key:0,label:"Negative color","label-for":`af-neg-color-${t.id}`},{default:ee(()=>[H(d,{id:`af-neg-color-${t.id}`,type:"color","model-value":n.value.negativeColor,"onUpdate:modelValue":a[5]||(a[5]=h=>i("negativeColor",h))},null,8,["id","model-value"])]),_:1},8,["label-for"])):ie("",!0),H(u,{label:"Opacity","label-for":`af-opacity-${t.id}`},{default:ee(()=>[T("div",Qle,[H(d,{id:`af-opacity-${t.id}`,type:"range","model-value":String(n.value.opacity??30),min:"0",max:"100",class:"flex-grow-1","onUpdate:modelValue":a[6]||(a[6]=h=>i("opacity",Number(h)))},null,8,["id","model-value"]),T("small",Jle,be(n.value.opacity??30)+"%",1)])]),_:1},8,["label-for"]),H(u,{label:"Interpolation","label-for":`af-interp-${t.id}`},{default:ee(()=>[H(c,{id:`af-interp-${t.id}`,"model-value":n.value.interpolation??"linear",options:r,"onUpdate:modelValue":a[7]||(a[7]=h=>i("interpolation",h))},null,8,["id","model-value"])]),_:1},8,["label-for"])])])}}}),tce={class:"d-flex flex-column gap-2"},nce=le({__name:"EditorAreaFills",props:st({seriesNames:{},seriesOverrides:{},globalInterpolation:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=ft(t,"modelValue"),o=A(()=>n.value);function r(a,l){const c=[...o.value];c[a]=l,n.value=c}function i(){const a=e.seriesNames[0]??"",l=e.seriesNames[1]??e.seriesNames[0]??"",c=w2(a,e.globalInterpolation,e.seriesOverrides);n.value=[...o.value,{from:a,to:l,color:"#cccccc",opacity:30,interpolation:c}]}function s(a){const l=[...o.value];l.splice(a,1),n.value=l}return(a,l)=>{const c=ece;return w(),R(We,null,[T("div",tce,[(w(!0),R(We,null,mt(p(o),(u,d)=>(w(),Z(c,{id:d,key:d,fill:u,"series-names":t.seriesNames,"onUpdate:fill":f=>r(d,f),onRemove:f=>s(d)},null,8,["id","fill","series-names","onUpdate:fill","onRemove"]))),128))]),H(p(Al),{label:"Add",onClick:i})],64)}}}),oce={class:"d-flex flex-column gap-3"},rce=le({__name:"EditorHighlightSection",setup(t){const{chartType:e,data:n,highlights:o}=hn(),r=A(()=>hs(n.value)),i=A(()=>[Le.LineMulti,Le.AreaStacked].includes(e.value)),s=A(()=>{var u;return i.value?((u=r.value.series)==null?void 0:u.map(d=>d.name))??[]:r.value.labels}),a=Re(o.value.length>0),l=A({get(){return o.value.map(u=>u.target)},set(u){o.value=u.map(d=>({target:d}))}});function c(u){a.value=u,u||(o.value=[])}return(u,d)=>(w(),R("div",oce,[H(p(nn),{"model-value":p(a),label:"Highlight specific items","onUpdate:modelValue":c},null,8,["model-value"]),p(a)?(w(),Z(p(zy),{key:0,selected:p(l),"onUpdate:selected":d[0]||(d[0]=f=>Xe(l)?l.value=f:null),items:p(s)},null,8,["selected","items"])):ie("",!0)]))}}),ice=Bo("previewContainer",()=>({containerRef:ze(null)}));function WT(){const t=ice();return $t(t)}const sce={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function ace(t,e){return w(),R("svg",sce,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M174 47.75a254.2 254.2 0 0 0-41.45-38.3a8 8 0 0 0-9.18 0A254.2 254.2 0 0 0 82 47.75C54.51 79.32 40 112.6 40 144a88 88 0 0 0 176 0c0-31.4-14.51-64.68-42-96.25M200 144a71 71 0 0 1-.46 8H136v-16h63.64q.36 4 .36 8m-16.61-56H136V72h36.89a176 176 0 0 1 10.5 16M136 200h37.19A71.67 71.67 0 0 1 136 215.54Zm0-16v-16h59.87a72 72 0 0 1-8 16Zm0-64v-16h55.39a117 117 0 0 1 5.45 16Zm23.89-64H136V32.6A257 257 0 0 1 159.89 56M56 144c0-50 42.26-92.71 64-111.4v182.94A72.08 72.08 0 0 1 56 144"},null,-1)])])}const lce=Me({name:"ph-drop-half",render:ace}),cce={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function uce(t,e){return w(),R("svg",cce,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M201.54 54.46A104 104 0 0 0 54.46 201.54A104 104 0 0 0 201.54 54.46M96 210v-58h64v58a88.33 88.33 0 0 1-64 0m48-74h-32v-35.06l32-16Zm46.22 54.22A88 88 0 0 1 176 201.77V152a16 16 0 0 0-16-16V72a8 8 0 0 0-11.58-7.16l-48 24A8 8 0 0 0 96 96v40a16 16 0 0 0-16 16v49.77a88 88 0 1 1 110.22-11.55"},null,-1)])])}const dce=Me({name:"ph-highlighter-circle",render:uce}),fce={class:"d-flex flex-column gap-2"},hce={class:"d-flex gap-2"},pce=le({__name:"EditorAnnotationFree",props:st({chartWidth:{},chartHeight:{}},{annotation:{required:!0},annotationModifiers:{}}),emits:["update:annotation"],setup(t){const e=ft(t,"annotation");function n(s){return typeof s=="number"?`${s}%`:String(s)}function o(s){return s==null?"150px":typeof s=="number"?`${s}px`:String(s)}function r(s,a){const l={...e.value};a===void 0?delete l[s]:l[s]=a,e.value=l}const i=ze(null);return fn(()=>{var a;const s=(a=i.value)==null?void 0:a.$el;s&&(s.focus(),s.select())}),(s,a)=>{const l=ky,c=On;return w(),R("div",fce,[H(c,{label:"Text"},{default:ee(()=>[H(l,{ref_key:"textRef",ref:i,"model-value":e.value.text,placeholder:"Annotation text",rows:"2","onUpdate:modelValue":a[0]||(a[0]=u=>r("text",u))},null,8,["model-value"])]),_:1}),T("div",hce,[H(p(Xh),{id:"ann-free-x","model-value":n(e.value.x),label:"X position",min:"-50",max:String(t.chartWidth??600),step:"0.1",units:["%","px"],"no-slider":"","center-relative":"",class:"flex-fill","onUpdate:modelValue":a[1]||(a[1]=u=>r("x",u))},null,8,["model-value","max"]),H(p(Xh),{id:"ann-free-y","model-value":n(e.value.y),label:"Y position",min:"-50",max:String(t.chartHeight??400),step:"0.1",units:["%","px"],"no-slider":"","center-relative":"",class:"flex-fill","onUpdate:modelValue":a[2]||(a[2]=u=>r("y",u))},null,8,["model-value","max"])]),H(p(Da),{id:"ann-free-text-color","model-value":e.value.textColor??"#000000",label:"Text color","onUpdate:modelValue":a[3]||(a[3]=u=>r("textColor",u))},null,8,["model-value"]),H(p(nn),{"model-value":e.value.textOutline??!0,label:"Text outline","onUpdate:modelValue":a[4]||(a[4]=u=>r("textOutline",u))},null,8,["model-value"]),H(p(Xh),{id:"ann-free-max-width","model-value":o(e.value.maxWidth),label:"Max width",min:"0",max:String(t.chartWidth??600),units:["px","%"],"onUpdate:modelValue":a[5]||(a[5]=u=>r("maxWidth",u))},null,8,["model-value","max"])])}}}),mce={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function gce(t,e){return w(),R("svg",mce,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M48 40v176a8 8 0 0 1-16 0V40a8 8 0 0 1 16 0m16 64V64a16 16 0 0 1 16-16h96a16 16 0 0 1 16 16v40a16 16 0 0 1-16 16H80a16 16 0 0 1-16-16m16 0h96V64H80Zm152 48v40a16 16 0 0 1-16 16H80a16 16 0 0 1-16-16v-40a16 16 0 0 1 16-16h136a16 16 0 0 1 16 16m-16 40v-40H80v40z"},null,-1)])])}const cf=Me({name:"ph-align-left",render:gce}),vce={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function bce(t,e){return w(),R("svg",vce,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M208 136h-72v-16h48a16 16 0 0 0 16-16V64a16 16 0 0 0-16-16h-48V32a8 8 0 0 0-16 0v16H72a16 16 0 0 0-16 16v40a16 16 0 0 0 16 16h48v16H48a16 16 0 0 0-16 16v40a16 16 0 0 0 16 16h72v16a8 8 0 0 0 16 0v-16h72a16 16 0 0 0 16-16v-40a16 16 0 0 0-16-16M72 64h112v40H72Zm136 128H48v-40h160z"},null,-1)])])}const y0=Me({name:"ph-align-center-horizontal",render:bce}),yce={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function xce(t,e){return w(),R("svg",yce,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M224 40v176a8 8 0 0 1-16 0V40a8 8 0 0 1 16 0m-32 24v40a16 16 0 0 1-16 16H80a16 16 0 0 1-16-16V64a16 16 0 0 1 16-16h96a16 16 0 0 1 16 16m-16 0H80v40h96Zm16 88v40a16 16 0 0 1-16 16H40a16 16 0 0 1-16-16v-40a16 16 0 0 1 16-16h136a16 16 0 0 1 16 16m-16 0H40v40h136Z"},null,-1)])])}const uf=Me({name:"ph-align-right",render:xce}),wce={class:"d-flex flex-column gap-2"},_ce={class:"d-flex gap-2"},kce={key:0,class:"d-flex gap-2"},Sce=le({__name:"EditorAnnotationRange",props:st({labels:{}},{annotation:{required:!0},annotationModifiers:{}}),emits:["update:annotation"],setup(t){const e=t,n=ft(t,"annotation"),o=[{value:"vertical",text:"Vertical"},{value:"horizontal",text:"Horizontal"}],r=A(()=>(n.value.orientation??"vertical")==="vertical"&&e.labels.length>0),i=A(()=>e.labels.map(l=>({value:l,text:l})));function s(l,c){const u={...n.value};c===void 0?delete u[l]:u[l]=c,n.value=u}const a=ze(null);return fn(()=>{var c;const l=(c=a.value)==null?void 0:c.$el;l&&(l.focus(),l.select())}),(l,c)=>{const u=ta,d=On,f=qa;return w(),R("div",wce,[H(d,{label:"Text"},{default:ee(()=>[H(u,{ref_key:"textRef",ref:a,"model-value":n.value.text??"",placeholder:"Optional label","onUpdate:modelValue":c[0]||(c[0]=h=>s("text",h||void 0))},null,8,["model-value"])]),_:1}),H(d,{label:"Orientation"},{default:ee(()=>[H(f,{"model-value":n.value.orientation??"vertical",options:o,"onUpdate:modelValue":c[1]||(c[1]=h=>s("orientation",h))},null,8,["model-value"])]),_:1}),T("div",_ce,[H(d,{label:"Start",class:"flex-fill"},{default:ee(()=>[p(r)?(w(),Z(f,{key:0,"model-value":String(n.value.start),options:p(i),"onUpdate:modelValue":c[2]||(c[2]=h=>s("start",h))},null,8,["model-value","options"])):(w(),Z(u,{key:1,"model-value":String(n.value.start),"onUpdate:modelValue":c[3]||(c[3]=h=>s("start",isNaN(Number(h))?h:Number(h)))},null,8,["model-value"]))]),_:1}),H(d,{label:"End",class:"flex-fill"},{default:ee(()=>[p(r)?(w(),Z(f,{key:0,"model-value":String(n.value.end),options:p(i),"onUpdate:modelValue":c[4]||(c[4]=h=>s("end",h))},null,8,["model-value","options"])):(w(),Z(u,{key:1,"model-value":String(n.value.end),"onUpdate:modelValue":c[5]||(c[5]=h=>s("end",isNaN(Number(h))?h:Number(h)))},null,8,["model-value"]))]),_:1})]),p(r)?(w(),R("div",kce,[H(p(Rn),{id:`ann-range-start-anchor-${l.$.uid}`,"model-value":n.value.startAnchor??"center",label:"Start anchor","light-label":"",block:"",class:"flex-fill","onUpdate:modelValue":c[6]||(c[6]=h=>s("startAnchor",h))},{default:ee(()=>[H(p(fc),{value:"start",label:"Start"},{icon:ee(()=>[H(p(cf))]),_:1}),H(p(fc),{value:"center",label:"Center"},{icon:ee(()=>[H(p(y0))]),_:1}),H(p(fc),{value:"end",label:"End"},{icon:ee(()=>[H(p(uf))]),_:1})]),_:1},8,["id","model-value"]),H(p(Rn),{id:`ann-range-end-anchor-${l.$.uid}`,"model-value":n.value.endAnchor??"center",label:"End anchor","light-label":"",block:"",class:"flex-fill","onUpdate:modelValue":c[7]||(c[7]=h=>s("endAnchor",h))},{default:ee(()=>[H(p(fc),{value:"start",label:"Start"},{icon:ee(()=>[H(p(cf))]),_:1}),H(p(fc),{value:"center",label:"Center"},{icon:ee(()=>[H(p(y0))]),_:1}),H(p(fc),{value:"end",label:"End"},{icon:ee(()=>[H(p(uf))]),_:1})]),_:1},8,["id","model-value"])])):ie("",!0),H(p(Da),{id:"ann-range-bg-color","model-value":n.value.bgColor??"#cccccc",label:"Background color","onUpdate:modelValue":c[8]||(c[8]=h=>s("bgColor",h))},null,8,["model-value"]),H(p(xr),{id:"ann-range-bg-opacity","model-value":String(n.value.bgOpacity??20),label:"Background opacity",min:"0",max:"100",suffix:"%","onUpdate:modelValue":c[9]||(c[9]=h=>s("bgOpacity",Number(h)))},null,8,["model-value"]),n.value.text?(w(),R(We,{key:1},[H(p(Da),{id:"ann-range-text-color","model-value":n.value.textColor??"#000000",label:"Text color","onUpdate:modelValue":c[10]||(c[10]=h=>s("textColor",h))},null,8,["model-value"]),H(p(SA),{"model-value":n.value.direction??"center",label:"Direction","onUpdate:modelValue":c[11]||(c[11]=h=>s("direction",h))},null,8,["model-value"])],64)):ie("",!0)])}}}),Ace={viewBox:"0 0 20 20",width:"1.2em",height:"1.2em"};function Cce(t,e){return w(),R("svg",Ace,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M6 15.25c0 .414.336.75.75.75h4.5c1.586 0 2.696-.621 3.53-1.588C15.6 13.46 16 12.216 16 11s-.3-2.46-1.12-3.412C14.046 6.621 12.836 6 11.25 6H6.56l2.22-2.22a.75.75 0 0 0-1.06-1.06l-3.5 3.5a.75.75 0 0 0 .02 1.08l3.5 3.25a.75.75 0 0 0 1.02-1.1L6.66 7.5h4.59c1.164 0 1.86.441 2.4 1.068c.554.642.85 1.523.85 2.432s-.296 1.79-.85 2.432c-.54.627-1.236 1.068-2.4 1.068h-4.5a.75.75 0 0 0-.75.75"},null,-1)])])}const $ce=Me({name:"fluent-arrow-hook-up-left-20-filled",render:Cce}),Tce={viewBox:"0 0 20 20",width:"1.2em",height:"1.2em"};function Mce(t,e){return w(),R("svg",Tce,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M9 6c.06 0-.06-.002 0 0c.023-.002.227 0 .25 0h4.393l-2.268-2.268a.75.75 0 1 1 1.061-1.06l3.353 3.352a.75.75 0 0 1 .212.639a.75.75 0 0 1-.215.443l-3.247 3.248a.75.75 0 1 1-1.06-1.061L13.27 7.5H9a3.5 3.5 0 1 0 0 7h4.25a.75.75 0 0 1 0 1.5H9A5 5 0 0 1 9 6"},null,-1)])])}const Oce=Me({name:"fluent-arrow-hook-up-right-20-filled",render:Mce}),Bce={viewBox:"0 0 20 20",width:"1.2em",height:"1.2em"};function Lce(t,e){return w(),R("svg",Bce,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M16.78 10.72a.75.75 0 0 1 0 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 1 1 1.06-1.06l2.72 2.72V7A1.5 1.5 0 0 0 10 5.5H3.75a.75.75 0 0 1 0-1.5H10a3 3 0 0 1 3 3v6.44l2.72-2.72a.75.75 0 0 1 1.06 0"},null,-1)])])}const Pce=Me({name:"fluent-arrow-turn-right-down-20-filled",render:Lce}),Dce={class:"d-flex flex-column gap-2"},Ece={class:"d-flex flex-column gap-2 mt-2"},Ice={class:"d-flex flex-column gap-2 mt-2"},Nce=le({__name:"EditorAnnotationPoint",props:st({labels:{},chartWidth:{}},{annotation:{required:!0},annotationModifiers:{}}),emits:["update:annotation"],setup(t){const e=t,n=ft(t,"annotation"),o=A(()=>e.labels.map(l=>({value:l,text:l}))),r=[{value:"solid",text:"Solid"},{value:"dotted",text:"Dotted"},{value:"dashed",text:"Dashed"}];function i(l){return l==null?"150px":typeof l=="number"?`${l}px`:String(l)}function s(l,c){const u={...n.value};c===void 0?delete u[l]:u[l]=c,n.value=u}const a=ze(null);return fn(()=>{var c;const l=(c=a.value)==null?void 0:c.$el;l&&(l.focus(),l.select())}),(l,c)=>{const u=ky,d=On,f=qa,h=ta,g=Fs;return w(),R("div",Dce,[H(d,{label:"Text"},{default:ee(()=>[H(u,{ref_key:"textRef",ref:a,"model-value":n.value.text,placeholder:"Annotation text",rows:"2","onUpdate:modelValue":c[0]||(c[0]=v=>s("text",v))},null,8,["model-value"])]),_:1}),H(d,{label:"Target"},{default:ee(()=>[H(f,{"model-value":n.value.target,options:p(o),"onUpdate:modelValue":c[1]||(c[1]=v=>s("target",v))},null,8,["model-value","options"])]),_:1}),H(p(Da),{id:"ann-point-text-color","model-value":n.value.textColor??"#000000",label:"Text color","onUpdate:modelValue":c[2]||(c[2]=v=>s("textColor",v))},null,8,["model-value"]),H(p(nn),{"model-value":n.value.textOutline??!0,label:"Text outline","onUpdate:modelValue":c[3]||(c[3]=v=>s("textOutline",v))},null,8,["model-value"]),H(p(Xh),{id:"ann-point-max-width","model-value":i(n.value.maxWidth),label:"Max width",min:"0",max:String(t.chartWidth??600),units:["px","%"],"onUpdate:modelValue":c[4]||(c[4]=v=>s("maxWidth",v))},null,8,["model-value","max"]),H(p(nn),{"model-value":n.value.showLine??!0,label:"Show line","onUpdate:modelValue":c[10]||(c[10]=v=>s("showLine",v))},wi({_:2},[n.value.showLine?{name:"section",fn:ee(()=>[T("div",Ece,[H(p($n),{"model-value":n.value.lineStyle??"direct",label:"Line style",block:"","onUpdate:modelValue":c[5]||(c[5]=v=>s("lineStyle",v))},{default:ee(()=>[H(p(ih),{value:"direct",text:"Direct","icon-left":p(Y2)},null,8,["icon-left"]),H(p(ih),{value:"curve-left",text:"Curve left","icon-left":p($ce)},null,8,["icon-left"]),H(p(ih),{value:"curve-right",text:"Curve right","icon-left":p(Oce)},null,8,["icon-left"]),H(p(ih),{value:"elbow",text:"Elbow","icon-left":p(Pce)},null,8,["icon-left"])]),_:1},8,["model-value"]),H(d,{label:"Line weight"},{default:ee(()=>[H(h,{"model-value":String(n.value.lineWeight??1),type:"number",min:"1",max:"10","onUpdate:modelValue":c[6]||(c[6]=v=>s("lineWeight",Number(v)))},null,8,["model-value"])]),_:1}),H(p(SA),{"model-value":n.value.anchorDirection??"N",label:"Anchor position","onUpdate:modelValue":c[7]||(c[7]=v=>s("anchorDirection",v))},null,8,["model-value"]),H(d,null,{default:ee(()=>[H(g,{"model-value":n.value.showArrow??!0,switch:"","onUpdate:modelValue":c[8]||(c[8]=v=>s("showArrow",v))},{default:ee(()=>[...c[14]||(c[14]=[Ye(" Show arrow ",-1)])]),_:1},8,["model-value"])]),_:1}),H(d,{label:"Line target distance"},{default:ee(()=>[H(h,{"model-value":String(n.value.lineTargetDistance??0),type:"number","onUpdate:modelValue":c[9]||(c[9]=v=>s("lineTargetDistance",Number(v)))},null,8,["model-value"])]),_:1})])]),key:"0"}:void 0]),1032,["model-value"]),H(p(nn),{"model-value":n.value.showCircle??!1,label:"Show circle","onUpdate:modelValue":c[13]||(c[13]=v=>s("showCircle",v))},wi({_:2},[n.value.showCircle?{name:"section",fn:ee(()=>[T("div",Ice,[H(d,{label:"Circle size"},{default:ee(()=>[H(h,{"model-value":String(n.value.circleSize??4),type:"number",min:"1","onUpdate:modelValue":c[11]||(c[11]=v=>s("circleSize",Number(v)))},null,8,["model-value"])]),_:1}),H(d,{label:"Circle style"},{default:ee(()=>[H(f,{"model-value":n.value.circleStyle??"solid",options:r,"onUpdate:modelValue":c[12]||(c[12]=v=>s("circleStyle",v))},null,8,["model-value"])]),_:1})])]),key:"0"}:void 0]),1032,["model-value"])])}}}),Rce={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Fce(t,e){return w(),R("svg",Rce,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M247.31 124.76c-.35-.79-8.82-19.58-27.65-38.41C194.57 61.26 162.88 48 128 48S61.43 61.26 36.34 86.35C17.51 105.18 9 124 8.69 124.76a8 8 0 0 0 0 6.5c.35.79 8.82 19.57 27.65 38.4C61.43 194.74 93.12 208 128 208s66.57-13.26 91.66-38.34c18.83-18.83 27.3-37.61 27.65-38.4a8 8 0 0 0 0-6.5M128 192c-30.78 0-57.67-11.19-79.93-33.25A133.5 133.5 0 0 1 25 128a133.3 133.3 0 0 1 23.07-30.75C70.33 75.19 97.22 64 128 64s57.67 11.19 79.93 33.25A133.5 133.5 0 0 1 231.05 128c-7.21 13.46-38.62 64-103.05 64m0-112a48 48 0 1 0 48 48a48.05 48.05 0 0 0-48-48m0 80a32 32 0 1 1 32-32a32 32 0 0 1-32 32"},null,-1)])])}const UT=Me({name:"ph-eye",render:Fce}),Vce={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function zce(t,e){return w(),R("svg",Vce,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M53.92 34.62a8 8 0 1 0-11.84 10.76l19.24 21.17C25 88.84 9.38 123.2 8.69 124.76a8 8 0 0 0 0 6.5c.35.79 8.82 19.57 27.65 38.4C61.43 194.74 93.12 208 128 208a127.1 127.1 0 0 0 52.07-10.83l22 24.21a8 8 0 1 0 11.84-10.76Zm47.33 75.84l41.67 45.85a32 32 0 0 1-41.67-45.85M128 192c-30.78 0-57.67-11.19-79.93-33.25A133.2 133.2 0 0 1 25 128c4.69-8.79 19.66-33.39 47.35-49.38l18 19.75a48 48 0 0 0 63.66 70l14.73 16.2A112 112 0 0 1 128 192m6-95.43a8 8 0 0 1 3-15.72a48.16 48.16 0 0 1 38.77 42.64a8 8 0 0 1-7.22 8.71a6 6 0 0 1-.75 0a8 8 0 0 1-8-7.26A32.09 32.09 0 0 0 134 96.57m113.28 34.69c-.42.94-10.55 23.37-33.36 43.8a8 8 0 1 1-10.67-11.92a132.8 132.8 0 0 0 27.8-35.14a133.2 133.2 0 0 0-23.12-30.77C185.67 75.19 158.78 64 128 64a118.4 118.4 0 0 0-19.36 1.57A8 8 0 1 1 106 49.79A134 134 0 0 1 128 48c34.88 0 66.57 13.26 91.66 38.35c18.83 18.83 27.3 37.62 27.65 38.41a8 8 0 0 1 0 6.5Z"},null,-1)])])}const df=Me({name:"ph-eye-slash",render:zce}),Hce={class:"badge bg-secondary-subtle text-secondary-emphasis"},Wce=le({__name:"EditorAnnotationHeader",props:{kindLabel:{},summary:{},collapsed:{type:Boolean},hidden:{type:Boolean},canToggleVisibility:{type:Boolean}},emits:["duplicate","remove","toggleCollapse","toggleVisibility"],setup(t){return(e,n)=>(w(),Z(p(UA),{label:t.summary,class:Te({"opacity-50":t.hidden}),onClick:n[3]||(n[3]=o=>e.$emit("toggleCollapse"))},{leading:ee(()=>[T("span",Hce,be(t.kindLabel),1)]),actions:ee(()=>[t.canToggleVisibility?(w(),Z(p(Ho),{key:0,variant:"link",size:"sm",class:"annotation-header__btn text-body-secondary",title:t.hidden?"Show in scene":"Hide in scene",onClick:n[0]||(n[0]=gn(o=>e.$emit("toggleVisibility"),["stop"]))},{default:ee(()=>[H(p(Cf),{name:t.hidden?p(df):p(UT)},null,8,["name"])]),_:1},8,["title"])):ie("",!0),H(p(QU),{onDuplicate:n[1]||(n[1]=o=>e.$emit("duplicate")),onRemove:n[2]||(n[2]=o=>e.$emit("remove"))})]),_:1},8,["label","class"]))}}),Uce=Oe(Wce,[["__scopeId","data-v-acf3aff5"]]),Gce={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function qce(t,e){return w(),R("svg",Gce,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M128 64a40 40 0 1 0 40 40a40 40 0 0 0-40-40m0 64a24 24 0 1 1 24-24a24 24 0 0 1-24 24m0-112a88.1 88.1 0 0 0-88 88c0 31.4 14.51 64.68 42 96.25a254.2 254.2 0 0 0 41.45 38.3a8 8 0 0 0 9.18 0a254.2 254.2 0 0 0 41.37-38.3c27.45-31.57 42-64.85 42-96.25a88.1 88.1 0 0 0-88-88m0 206c-16.53-13-72-60.75-72-118a72 72 0 0 1 144 0c0 57.23-55.47 105-72 118"},null,-1)])])}const Yce=Me({name:"ph-map-pin",render:qce}),jce={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Xce(t,e){return w(),R("svg",jce,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M136 40v176a8 8 0 0 1-16 0V40a8 8 0 0 1 16 0m-40 80H35.31l18.35-18.34a8 8 0 0 0-11.32-11.32l-32 32a8 8 0 0 0 0 11.32l32 32a8 8 0 0 0 11.32-11.32L35.31 136H96a8 8 0 0 0 0-16m149.66 2.34l-32-32a8 8 0 0 0-11.32 11.32L220.69 120H160a8 8 0 0 0 0 16h60.69l-18.35 18.34a8 8 0 0 0 11.32 11.32l32-32a8 8 0 0 0 0-11.32"},null,-1)])])}const Kce=Me({name:"ph-arrows-out-line-horizontal",render:Xce}),Zce={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Qce(t,e){return w(),R("svg",Zce,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M88 96a8 8 0 0 1 8-8h64a8 8 0 0 1 0 16H96a8 8 0 0 1-8-8m8 40h64a8 8 0 0 0 0-16H96a8 8 0 0 0 0 16m32 16H96a8 8 0 0 0 0 16h32a8 8 0 0 0 0-16m96-104v108.69a15.86 15.86 0 0 1-4.69 11.31L168 219.31a15.86 15.86 0 0 1-11.31 4.69H48a16 16 0 0 1-16-16V48a16 16 0 0 1 16-16h160a16 16 0 0 1 16 16M48 208h104v-48a8 8 0 0 1 8-8h48V48H48Zm120-40v28.7l28.69-28.7Z"},null,-1)])])}const Jce=Me({name:"ph-note",render:Qce}),eue={class:"d-flex flex-column gap-4"},tue={class:"d-flex flex-column gap-2"},nue={class:"d-flex flex-column gap-2"},oue={class:"d-flex flex-column gap-2"},K6="abcdefghijklmnopqrstuvwxyz0123456789",rue=le({__name:"EditorAnnotations",props:st({labels:{},chartType:{},chartWidth:{},chartHeight:{},hiddenAnnotationIds:{},canToggleVisibility:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:st(["toggle-visibility"],["update:modelValue"]),setup(t,{expose:e,emit:n}){const o=t,r=n,i=ft(t,"modelValue"),s=A(()=>i.value);function a(){let S="";for(let B=0;B<5;B++)S+=K6[Math.floor(Math.random()*K6.length)];return S}const l=A(()=>o.chartType===Le.Pie||o.chartType===Le.Donut),c=ze(null);function u(S){c.value=c.value===S?null:S}e({openIndex:c});const d=A(()=>s.value.map((S,B)=>({ann:S,index:B})).filter(({ann:S})=>S.kind===Lt.Point)),f=A(()=>s.value.map((S,B)=>({ann:S,index:B})).filter(({ann:S})=>S.kind===Lt.Range)),h=A(()=>s.value.map((S,B)=>({ann:S,index:B})).filter(({ann:S})=>S.kind===Lt.Free));function g(S){var B;return!!S.id&&!!((B=o.hiddenAnnotationIds)!=null&&B.has(S.id))}function v(S){S.id&&r("toggle-visibility",S.id,S.kind)}function m(S){return S.kind===Lt.Point?"Point":S.kind===Lt.Range?"Range":"Note"}function b(S){return S.kind===Lt.Point?S.text||S.target||"Empty":S.kind===Lt.Range?S.text||`${S.start} - ${S.end}`:S.text||"Empty"}function y(S,B){const D=s.value.map(N=>({...N}));D[S]=B,i.value=D}function x(){const S={kind:Lt.Point,id:a(),target:o.labels[0]??"",text:"Enter an annotation",showLine:!0,showArrow:!0},B=[...s.value,S];i.value=B,c.value=B.length-1}function _(){const S=o.labels.length>0,B={kind:Lt.Range,id:a(),start:S?o.labels[0]:0,end:S?o.labels[o.labels.length-1]:100},D=[...s.value,B];i.value=D,c.value=D.length-1}function k(){const S={kind:Lt.Free,id:a(),text:"Enter an annotation",x:0,y:0},B=[...s.value,S];i.value=B,c.value=B.length-1}function E(S){const B=[...s.value];B.splice(S+1,0,{...B[S],id:a()}),i.value=B}function L(S){const B=[...s.value];B.splice(S,1),i.value=B,c.value===S?c.value=null:c.value!==null&&c.value>S&&c.value--}return(S,B)=>{const D=Uce,N=Nce,C=Sce,M=pce;return w(),R("div",eue,[p(l)?ie("",!0):(w(),Z(p(zo),{key:0,title:"Points",icon:p(Yce)},{default:ee(()=>[T("div",tue,[(w(!0),R(We,null,mt(p(d),({ann:P,index:$})=>(w(),Z(p($d),{key:$},{header:ee(()=>[H(D,{"kind-label":m(P),summary:b(P),collapsed:p(c)!==$,hidden:g(P),"can-toggle-visibility":t.canToggleVisibility,onDuplicate:F=>E($),onRemove:F=>L($),onToggleCollapse:F=>u($),onToggleVisibility:F=>v(P)},null,8,["kind-label","summary","collapsed","hidden","can-toggle-visibility","onDuplicate","onRemove","onToggleCollapse","onToggleVisibility"])]),default:ee(()=>[p(c)===$?(w(),Z(N,{key:0,annotation:P,labels:t.labels,"chart-width":t.chartWidth,"onUpdate:annotation":F=>y($,F)},null,8,["annotation","labels","chart-width","onUpdate:annotation"])):ie("",!0)]),_:2},1024))),128))]),H(p(Al),{label:"Add",onClick:x})]),_:1},8,["icon"])),p(l)?ie("",!0):(w(),Z(p(zo),{key:1,title:"Ranges",icon:p(Kce)},{default:ee(()=>[T("div",nue,[(w(!0),R(We,null,mt(p(f),({ann:P,index:$})=>(w(),Z(p($d),{key:$},{header:ee(()=>[H(D,{"kind-label":m(P),summary:b(P),collapsed:p(c)!==$,hidden:g(P),"can-toggle-visibility":t.canToggleVisibility,onDuplicate:F=>E($),onRemove:F=>L($),onToggleCollapse:F=>u($),onToggleVisibility:F=>v(P)},null,8,["kind-label","summary","collapsed","hidden","can-toggle-visibility","onDuplicate","onRemove","onToggleCollapse","onToggleVisibility"])]),default:ee(()=>[p(c)===$?(w(),Z(C,{key:0,annotation:P,labels:t.labels,"onUpdate:annotation":F=>y($,F)},null,8,["annotation","labels","onUpdate:annotation"])):ie("",!0)]),_:2},1024))),128))]),H(p(Al),{label:"Add",onClick:_})]),_:1},8,["icon"])),H(p(zo),{title:"Notes",icon:p(Jce)},{default:ee(()=>[T("div",oue,[(w(!0),R(We,null,mt(p(h),({ann:P,index:$})=>(w(),Z(p($d),{key:$},{header:ee(()=>[H(D,{"kind-label":m(P),summary:b(P),collapsed:p(c)!==$,hidden:g(P),"can-toggle-visibility":t.canToggleVisibility,onDuplicate:F=>E($),onRemove:F=>L($),onToggleCollapse:F=>u($),onToggleVisibility:F=>v(P)},null,8,["kind-label","summary","collapsed","hidden","can-toggle-visibility","onDuplicate","onRemove","onToggleCollapse","onToggleVisibility"])]),default:ee(()=>[p(c)===$?(w(),Z(M,{key:0,annotation:P,"chart-width":t.chartWidth,"chart-height":t.chartHeight,"onUpdate:annotation":F=>y($,F)},null,8,["annotation","chart-width","chart-height","onUpdate:annotation"])):ie("",!0)]),_:2},1024))),128))]),H(p(Al),{label:"Add",onClick:k})]),_:1},8,["icon"])])}}});function iue(t,e,n,o){let r=null,i=null;function s(){r!=null&&r.parentNode&&r.parentNode.removeChild(r),r=null,i&&(i(),i=null)}function a(){s();const l=t.value,c=n.value;if(!l||c===null)return;const u=e.value[c];if(!u||u.kind==="range")return;const d=l.querySelector("svg");if(!d)return;const f=u.id,h=f?d.querySelector(`g[data-annotation-id="${f}"]`):d.querySelector(`g[data-annotation-index="${c}"]`);if(!h)return;const g=h.querySelector(".bc-annotation-text");if(!g)return;const v=h.querySelector(".bc-annotation-circle"),m=h.querySelector(".bc-annotation-line");let b=null,y=null,x=0;if(v&&(b=parseFloat(v.getAttribute("cx")||"0"),y=parseFloat(v.getAttribute("cy")||"0"),x=parseFloat(v.getAttribute("r")||"0")),b===null&&m){const I=(m.getAttribute("d")||"").split(/[MLA]\s*/).filter(Boolean);if(I.length>=2){const G=I[I.length-1].trim().split(/[\s,]+/);G.length>=2&&(b=parseFloat(G[G.length-2]),y=parseFloat(G[G.length-1]))}}const _=b!==null&&y!==null,k=(u&&"lineStyle"in u?u.lineStyle:"direct")||"direct",E=x>0?x+((u&&"lineTargetDistance"in u?u.lineTargetDistance:5)||5):0,L=parseFloat(g.getAttribute("x")||"0"),S=parseFloat(g.getAttribute("y")||"0"),B=g.getBBox(),N=(g.getAttribute("transform")||"").match(/translate\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*\)/),C=N?parseFloat(N[1]):0,M=N?parseFloat(N[2]):0,P={x:B.x+C,y:B.y+M,width:B.width,height:B.height},$=4,F=u?u.maxWidth:void 0;let V=P.width;if(F!=null){const he=parseFloat(d.getAttribute("width")||"0");if(typeof F=="number"&&F>0)V=F;else if(typeof F=="string")if(F.endsWith("%")&&he>0)V=parseFloat(F)/100*he;else{const I=parseFloat(F);I>0&&(V=I)}}const U=g.getAttribute("text-anchor")||"middle";let K;U==="middle"?K=L-V/2:U==="end"?K=L-V:K=L,r=document.createElementNS("http://www.w3.org/2000/svg","rect"),r.setAttribute("x",String(K-$)),r.setAttribute("y",String(P.y-$)),r.setAttribute("width",String(V+$*2)),r.setAttribute("height",String(P.height+$*2)),r.setAttribute("fill","rgba(255,245,157,0.4)"),r.setAttribute("rx","3"),r.style.cursor="grab",r.style.pointerEvents="all",h.appendChild(r);let ae=!1,me=0,de=0,ve=0,te=0,pe=0;function we(){return d.getScreenCTM()}function J(){const he=we();if(!he)return;const I=(te-me)/he.a,G=(pe-de)/he.d,Y=L+I,se=S+G;g.setAttribute("x",String(Y)),g.setAttribute("y",String(se));const fe=g.querySelectorAll("tspan");for(const j of fe)j.setAttribute("x",String(Y));const ne=g.getBBox(),Q={x:ne.x+C,y:ne.y+M,width:ne.width,height:ne.height};let q;const X=g.getAttribute("text-anchor")||"middle";if(X==="middle"?q=Y-V/2:X==="end"?q=Y-V:q=Y,r.setAttribute("x",String(q-$)),r.setAttribute("y",String(Q.y-$)),r.setAttribute("width",String(V+$*2)),r.setAttribute("height",String(Q.height+$*2)),m&&_){const j=bboxEdgeToward(Q,b,y),ce=E>0?shortenToward({x:b,y},j,E):{x:b,y},ye=Q.x+Q.width/2,ue=Math.abs(j.x-ye)<1;m.setAttribute("d",buildPathD(j,ce,k,ue))}ve=0}function ge(he){he.preventDefault(),he.stopPropagation(),ae=!0,me=he.clientX,de=he.clientY,te=he.clientX,pe=he.clientY,r.style.cursor="grabbing",r.setPointerCapture(he.pointerId)}function re(he){ae&&(he.preventDefault(),te=he.clientX,pe=he.clientY,ve||(ve=requestAnimationFrame(J)))}function oe(he){if(!ae)return;ae=!1,r.style.cursor="grab",ve&&(cancelAnimationFrame(ve),ve=0);const I=we();if(!I)return;const G=(he.clientX-me)/I.a,Y=(he.clientY-de)/I.d;if(Math.abs(G)<1&&Math.abs(Y)<1){g.setAttribute("x",String(L)),g.setAttribute("y",String(S));const ne=g.querySelectorAll("tspan");for(const Q of ne)Q.setAttribute("x",String(L));return}const se=e.value[c];if(!se)return;const fe={...se};if(se.kind==="free"){const ne=h.closest(".bc-annotations"),Q=parseFloat((ne==null?void 0:ne.getAttribute("data-ctx-width"))||"")||parseFloat(d.getAttribute("width")||"600"),q=parseFloat((ne==null?void 0:ne.getAttribute("data-ctx-height"))||"")||parseFloat(d.getAttribute("height")||"400"),X=se.x,j=se.y;if(typeof X=="number")fe.x=+(X+G/Q*100).toFixed(1);else{const ce=String(X);ce.endsWith("px")?fe.x=`${Math.round(parseFloat(ce)+G)}px`:fe.x=+((parseFloat(ce)||0)+G/Q*100).toFixed(1)}if(typeof j=="number")fe.y=+(j+Y/q*100).toFixed(1);else{const ce=String(j);ce.endsWith("px")?fe.y=`${Math.round(parseFloat(ce)+Y)}px`:fe.y=+((parseFloat(ce)||0)+Y/q*100).toFixed(1)}}else if(se.kind==="point"){const ne=fe.textOffsetX??-42,Q=fe.textOffsetY??-42;fe.textOffsetX=Math.round(ne+G),fe.textOffsetY=Math.round(Q+Y)}o(c,fe)}r.addEventListener("pointerdown",ge),r.addEventListener("pointermove",re),r.addEventListener("pointerup",oe),i=()=>{ve&&cancelAnimationFrame(ve),r==null||r.removeEventListener("pointerdown",ge),r==null||r.removeEventListener("pointermove",re),r==null||r.removeEventListener("pointerup",oe)}}qe(n,()=>{requestAnimationFrame(a)}),qe(e,()=>{n.value!==null&&requestAnimationFrame(a)},{deep:!0}),Ma(s)}const sue={class:"d-flex flex-column gap-4"},aue=le({__name:"EditorAnnotateTab",setup(t){const e=hn(),{chartType:n,data:o,areaFills:r,seriesOverrides:i}=e,{currentOptions:s}=kn(),a=A(()=>s.value.interpolation??"linear"),{pendingAnnotationIndex:l}=$t(fr()),{scenes:c,activeIndex:u,activeScene:d,update:f}=_n(),h=A(()=>u.value>=0),g=[Le.BarVertical,Le.BarHorizontal,Le.LineMulti,Le.AreaStacked],v=A(()=>g.includes(n.value)),m=A({get(){const $=e._base.annotations.value;if(u.value>=0){const F=Fa(c.value,u.value),V=(F==null?void 0:F.annotations)??[];return[...$,...V]}return $},set($){if(u.value>=0&&d.value){const F=new Set(e._base.annotations.value.map(K=>K.id).filter(Boolean)),V=$.filter(K=>K.id&&F.has(K.id)),U=$.filter(K=>!K.id||!F.has(K.id));e._base.annotations.value=V,f(u.value,{annotations:U.length>0?U:void 0});return}e._base.annotations.value=$}}),b=A(()=>{if(u.value<0)return;const $=Fa(c.value,u.value);return $==null?void 0:$.hiddenAnnotationIds});function y($,F){var ae;if(u.value<0)return;const V=d.value;if(!V)return;const U=V.annotationVisibility??[];((ae=b.value)==null?void 0:ae.has($))?U.find(de=>de.id===$&&de.action==="hide")?f(u.value,{annotationVisibility:U.filter(de=>!(de.id===$&&de.action==="hide"))}):f(u.value,{annotationVisibility:[...U,{action:"show",kind:F,id:$}]}):U.find(de=>de.id===$&&de.action==="show")?f(u.value,{annotationVisibility:U.filter(de=>!(de.id===$&&de.action==="show"))}):f(u.value,{annotationVisibility:[...U,{action:"hide",kind:F,id:$}]})}const x=A(()=>n.value===Le.LineMulti),_=A(()=>hs(o.value)),k=A(()=>_.value.labels),E=A(()=>{var $;return(($=_.value.series)==null?void 0:$.map(F=>F.name))??[]}),L=ze(null),S=A(()=>{var $;return(($=L.value)==null?void 0:$.openIndex)??null}),{containerRef:B}=WT(),D=Re(600),N=Re(400);function C(){var F;const $=(F=B.value)==null?void 0:F.querySelector("svg");$&&(D.value=parseFloat($.getAttribute("width")||"600")||600,N.value=parseFloat($.getAttribute("height")||"400")||400)}let M;fn(()=>{C(),M=new ResizeObserver(C),B.value&&M.observe(B.value)}),qs(()=>M==null?void 0:M.disconnect());function P($,F){const V=m.value.map(U=>({...U}));V[$]=F,m.value=V}return iue(B,m,S,P),qe(l,async $=>{if($!==null&&(await wn(),L.value)){const F=typeof $=="string"?m.value.findIndex(V=>V.id===$):$;if(F<0){l.value=null;return}L.value.openIndex=L.value.openIndex===F?null:F,l.value=null}},{immediate:!0}),($,F)=>{const V=rce,U=nce;return w(),R("div",sue,[p(v)?(w(),Z(p(zo),{key:0,title:"Highlight",icon:p(dce)},{default:ee(()=>[H(V)]),_:1},8,["icon"])):ie("",!0),H(rue,{ref_key:"annotationsRef",ref:L,modelValue:p(m),"onUpdate:modelValue":F[0]||(F[0]=K=>Xe(m)?m.value=K:null),labels:p(k),"chart-type":p(n),"chart-width":p(D),"chart-height":p(N),"hidden-annotation-ids":p(b),"can-toggle-visibility":p(h),onToggleVisibility:y},null,8,["modelValue","labels","chart-type","chart-width","chart-height","hidden-annotation-ids","can-toggle-visibility"]),p(x)?(w(),Z(p(zo),{key:1,title:"Area Fills",icon:p(lce)},{default:ee(()=>[H(U,{modelValue:p(r),"onUpdate:modelValue":F[1]||(F[1]=K=>Xe(r)?r.value=K:null),"series-names":p(E),"series-overrides":p(i),"global-interpolation":p(a)},null,8,["modelValue","series-names","series-overrides","global-interpolation"])]),_:1},8,["icon"])):ie("",!0)])}}}),lue={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function cue(t,e){return w(),R("svg",lue,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M243.31 136L144 36.69A15.86 15.86 0 0 0 132.69 32H40a8 8 0 0 0-8 8v92.69A15.86 15.86 0 0 0 36.69 144L136 243.31a16 16 0 0 0 22.63 0l84.68-84.68a16 16 0 0 0 0-22.63m-96 96L48 132.69V48h84.69L232 147.31ZM96 84a12 12 0 1 1-12-12a12 12 0 0 1 12 12"},null,-1)])])}const uue=Me({name:"ph-tag",render:cue}),due={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function fue(t,e){return w(),R("svg",due,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M48 64a8 8 0 0 1 8-8h16V40a8 8 0 0 1 16 0v16h16a8 8 0 0 1 0 16H88v16a8 8 0 0 1-16 0V72H56a8 8 0 0 1-8-8m136 128h-8v-8a8 8 0 0 0-16 0v8h-8a8 8 0 0 0 0 16h8v8a8 8 0 0 0 16 0v-8h8a8 8 0 0 0 0-16m56-48h-16v-16a8 8 0 0 0-16 0v16h-16a8 8 0 0 0 0 16h16v16a8 8 0 0 0 16 0v-16h16a8 8 0 0 0 0-16m-20.69-64L80 219.31a16 16 0 0 1-22.62 0l-20.7-20.68a16 16 0 0 1 0-22.63L176 36.69a16 16 0 0 1 22.63 0l20.68 20.68a16 16 0 0 1 0 22.63m-54.63 32L144 91.31l-96 96L68.68 208ZM208 68.69L187.31 48l-32 32L176 100.69Z"},null,-1)])])}const ib=Me({name:"ph-magic-wand",render:fue}),hue={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function pue(t,e){return w(),R("svg",hue,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M205.66 138.34a8 8 0 0 1-11.32 11.32L136 91.31V224a8 8 0 0 1-16 0V91.31l-58.34 58.35a8 8 0 0 1-11.32-11.32l72-72a8 8 0 0 1 11.32 0ZM216 32H40a8 8 0 0 0 0 16h176a8 8 0 0 0 0-16"},null,-1)])])}const mue=Me({name:"ph-arrow-line-up",render:pue}),gue={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function vue(t,e){return w(),R("svg",gue,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M50.34 117.66a8 8 0 0 1 11.32-11.32L120 164.69V32a8 8 0 0 1 16 0v132.69l58.34-58.35a8 8 0 0 1 11.32 11.32l-72 72a8 8 0 0 1-11.32 0ZM216 208H40a8 8 0 0 0 0 16h176a8 8 0 0 0 0-16"},null,-1)])])}const bue=Me({name:"ph-arrow-line-down",render:vue}),yue={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function xue(t,e){return w(),R("svg",yue,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M232 128a8 8 0 0 1-8 8H91.31l58.35 58.34a8 8 0 0 1-11.32 11.32l-72-72a8 8 0 0 1 0-11.32l72-72a8 8 0 0 1 11.32 11.32L91.31 120H224a8 8 0 0 1 8 8M40 32a8 8 0 0 0-8 8v176a8 8 0 0 0 16 0V40a8 8 0 0 0-8-8"},null,-1)])])}const wue=Me({name:"ph-arrow-line-left",render:xue}),_ue={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function kue(t,e){return w(),R("svg",_ue,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M189.66 122.34a8 8 0 0 1 0 11.32l-72 72a8 8 0 0 1-11.32-11.32L164.69 136H32a8 8 0 0 1 0-16h132.69l-58.35-58.34a8 8 0 0 1 11.32-11.32ZM216 32a8 8 0 0 0-8 8v176a8 8 0 0 0 16 0V40a8 8 0 0 0-8-8"},null,-1)])])}const Sue=Me({name:"ph-arrow-line-right",render:kue}),Aue={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Cue(t,e){return w(),R("svg",Aue,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M128 136v64a8 8 0 0 1-16 0v-44.68l-66.34 66.34a8 8 0 0 1-11.32-11.32L100.68 144H56a8 8 0 0 1 0-16h64a8 8 0 0 1 8 8m80-104H80a16 16 0 0 0-16 16v48a8 8 0 0 0 16 0V48h128v128h-48a8 8 0 0 0 0 16h48a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16"},null,-1)])])}const sb=Me({name:"ph-arrow-square-in",render:Cue}),$ue={class:"d-flex flex-column gap-3"},Tue=le({__name:"EditorLegendSection",setup(t){const{currentOptions:e,availableOptionKeys:n,setOption:o}=kn(),r=A(()=>n.value.includes("legend")),i=A(()=>n.value.includes("legendPosition")),s=A(()=>n.value.includes("legendAnchor")),a=A(()=>n.value.includes("directLabelling")),l=A(()=>a.value),c=A(()=>n.value.includes("directLabelAnchor")),u=A(()=>e.value.directLabelling?"direct":e.value.legend===!1?"none":"legend"),d=A(()=>{const b=[{value:"legend",text:"Legend",icon:QA},{value:"none",text:"None",icon:df}];return a.value&&b.splice(1,0,{value:"direct",text:"Direct labelling",icon:uue}),b});function f(b){b==="legend"?(o("legend",!0),o("directLabelling","")):b==="direct"?(o("legend",!1),o("directLabelling","auto")):(o("legend",!1),o("directLabelling",""))}const h=[{value:"auto",text:"Auto",icon:ib},{value:"outside",text:"Outside",icon:zp},{value:"inside",text:"Inside",icon:sb}],g=[{value:"start",text:"Start",icon:cf},{value:"middle",text:"Middle",icon:y0},{value:"end",text:"End",icon:uf}],v=[{value:"top",text:"Top",icon:mue},{value:"bottom",text:"Bottom",icon:bue},{value:"left",text:"Left",icon:wue},{value:"right",text:"Right",icon:Sue}],m=[{value:"start",text:"Start",icon:cf},{value:"middle",text:"Middle",icon:y0},{value:"end",text:"End",icon:uf}];return(b,y)=>(w(),R("div",$ue,[p(r)?(w(),Z(p($n),{key:0,label:"Labels","model-value":p(u),options:p(d),block:"","onUpdate:modelValue":f},null,8,["model-value","options"])):ie("",!0),p(l)&&p(u)==="direct"?(w(),Z(p($n),{key:1,label:"Direct label style","model-value":p(e).directLabelling||"auto",options:h,block:"","onUpdate:modelValue":y[0]||(y[0]=x=>p(o)("directLabelling",x))},null,8,["model-value"])):ie("",!0),p(c)&&p(u)==="direct"&&p(e).directLabelling==="inside"?(w(),Z(p($n),{key:2,label:"Label anchor","model-value":p(e).directLabelAnchor||"middle",options:g,block:"","onUpdate:modelValue":y[1]||(y[1]=x=>p(o)("directLabelAnchor",x))},null,8,["model-value"])):ie("",!0),p(i)&&p(u)==="legend"?(w(),Z(p($n),{key:3,label:"Legend position","model-value":p(e).legendPosition??"top",options:v,block:"","onUpdate:modelValue":y[2]||(y[2]=x=>p(o)("legendPosition",x))},null,8,["model-value"])):ie("",!0),p(s)&&p(u)==="legend"?(w(),Z(p($n),{key:4,label:"Legend anchor","model-value":p(e).legendAnchor??"start",options:m,block:"","onUpdate:modelValue":y[3]||(y[3]=x=>p(o)("legendAnchor",x))},null,8,["model-value"])):ie("",!0)]))}}),Mue={class:"d-flex flex-column gap-3"},Oue={class:"pt-2"},Bue={class:"pt-2"},Lue={class:"pt-2"},Pue={class:"pt-2"},Due=le({__name:"EditorLayoutSection",setup(t){const{layout:e}=hn(),n=A({get:()=>e.value.sizing,set:h=>{e.value.sizing=h}}),o=A({get:()=>e.value.heightMode,set:h=>{e.value.heightMode=h}}),r=A({get:()=>String(e.value.fixedWidth),set:h=>{e.value.fixedWidth=Number(h)||600}}),i=A({get:()=>String(e.value.fixedHeight),set:h=>{e.value.fixedHeight=Number(h)||400}}),s=A({get:()=>String(e.value.padding),set:h=>{e.value.padding=Number(h)||0}}),a=A({get:()=>e.value.aspectRatio,set:h=>{e.value.aspectRatio=h}}),l=A({get:()=>e.value.transparentBackground,set:h=>{e.value.transparentBackground=h}}),c=A({get:()=>String(e.value.maxWidth),set:h=>{e.value.maxWidth=Number(h)||660}}),u=[{value:"responsive",text:"Responsive"},{value:"max-width",text:"Max width"},{value:"fixed",text:"Fixed"}],d=[{value:"auto",text:"Auto"},{value:"fixed",text:"Fixed"},{value:"aspect-ratio",text:"Aspect ratio"}],f=[{value:"16:9",label:"16:9"},{value:"4:3",label:"4:3"},{value:"3:2",label:"3:2"},{value:"1:1",label:"1:1"},{value:"2:3",label:"2:3"},{value:"9:16",label:"9:16"}];return(h,g)=>(w(),R("div",Mue,[H(p($n),{modelValue:p(n),"onUpdate:modelValue":g[2]||(g[2]=v=>Xe(n)?n.value=v:null),label:"Width",options:u,block:""},{"section:fixed":ee(()=>[T("div",Oue,[H(p(xr),{id:"layout-fixed-width",modelValue:p(r),"onUpdate:modelValue":g[0]||(g[0]=v=>Xe(r)?r.value=v:null),label:"",min:"200",max:"1200",suffix:"px"},null,8,["modelValue"])])]),"section:max-width":ee(()=>[T("div",Bue,[H(p(xr),{id:"layout-max-width",modelValue:p(c),"onUpdate:modelValue":g[1]||(g[1]=v=>Xe(c)?c.value=v:null),label:"",min:"200",max:"1200",suffix:"px"},null,8,["modelValue"])])]),_:1},8,["modelValue"]),H(p($n),{modelValue:p(o),"onUpdate:modelValue":g[5]||(g[5]=v=>Xe(o)?o.value=v:null),label:"Height",options:d,block:""},{"section:fixed":ee(()=>[T("div",Lue,[H(p(xr),{id:"layout-fixed-height",modelValue:p(i),"onUpdate:modelValue":g[3]||(g[3]=v=>Xe(i)?i.value=v:null),label:"",min:"100",max:"800",suffix:"px"},null,8,["modelValue"])])]),"section:aspect-ratio":ee(()=>[T("div",Pue,[H(p(Rn),{id:"layout-aspect-ratio",modelValue:p(a),"onUpdate:modelValue":g[4]||(g[4]=v=>Xe(a)?a.value=v:null),options:f,block:""},null,8,["modelValue"])])]),_:1},8,["modelValue"]),H(p(xr),{id:"layout-padding",modelValue:p(s),"onUpdate:modelValue":g[6]||(g[6]=v=>Xe(s)?s.value=v:null),label:"Padding",min:"0",max:"80",suffix:"px"},null,8,["modelValue"]),H(p(nn),{modelValue:p(l),"onUpdate:modelValue":g[7]||(g[7]=v=>Xe(l)?l.value=v:null),label:"Transparent background"},null,8,["modelValue"])]))}}),Eue={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Iue(t,e){return w(),R("svg",Eue,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M80 64a8 8 0 0 1 8-8h128a8 8 0 0 1 0 16H88a8 8 0 0 1-8-8m136 56H88a8 8 0 0 0 0 16h128a8 8 0 0 0 0-16m0 64H88a8 8 0 0 0 0 16h128a8 8 0 0 0 0-16M44 52a12 12 0 1 0 12 12a12 12 0 0 0-12-12m0 64a12 12 0 1 0 12 12a12 12 0 0 0-12-12m0 64a12 12 0 1 0 12 12a12 12 0 0 0-12-12"},null,-1)])])}const Nue=Me({name:"ph-list-bullets",render:Iue}),Rue={class:"d-flex flex-column gap-4"},Fue=le({__name:"EditorLayoutTab",setup(t){const{availableOptionKeys:e}=kn(),n=A(()=>e.value.includes("legend"));return(o,r)=>{const i=Due,s=Tue;return w(),R("div",Rue,[H(i),p(n)?(w(),Z(p(zo),{key:0,title:"Legend",icon:p(Nue)},{default:ee(()=>[H(s)]),_:1},8,["icon"])):ie("",!0)])}}}),Vue={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function zue(t,e){return w(),R("svg",Vue,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M239.24 131.4c-22 46.8-41.4 68.6-61.2 68.6c-25.1 0-40.73-33.32-57.28-68.6C107.7 103.56 92.9 72 78 72c-16.4 0-36.31 37.21-46.72 59.4a8 8 0 0 1-14.48-6.8C38.71 77.8 58.16 56 78 56c25.1 0 40.73 33.32 57.28 68.6C148.3 152.44 163.1 184 178 184c16.4 0 36.31-37.21 46.72-59.4a8 8 0 0 1 14.48 6.8Z"},null,-1)])])}const Hue=Me({name:"ph-wave-sine",render:zue}),Wue={key:0,class:"d-flex flex-column gap-4"},Uue={class:"d-flex flex-column gap-2"},Gue={key:1,class:"text-muted small"},que=le({__name:"EditorAxisOptions",setup(t){const e=A(()=>l.value.includes("valueLabels")),n=A(()=>l.value.includes("swapLabelValue")),o=[{value:"auto",text:"Auto",icon:ib},{value:"outside",text:"Outside",icon:zp},{value:"inside",text:"Inside",icon:sb}],r=new Set(["showVerticalAxis","verticalAxisDirection","showVerticalTicks","verticalLabelPosition","verticalGridStyle","verticalNumberFormat","verticalScaleType","verticalRangeMin","verticalRangeMax"]),i=new Set(["showHorizontalAxis","showHorizontalTicks","horizontalLabelPosition","horizontalGridStyle","horizontalNumberFormat","horizontalScaleType","horizontalRangeMin","horizontalRangeMax"]),{currentOptions:s,optionDefs:a,availableOptionKeys:l,setOption:c}=kn();function u(M,P){c(M,P)}const{displayColumnTypes:d}=Ko(),f=A(()=>d.value[0]??"string"),h=A(()=>d.value[1]??"number"),g=A(()=>a.value.some(M=>M.key==="verticalScaleType"));function v(M){return M.replace(/^(Show\s+)?(vertical|horizontal)\s+/i,(P,$)=>$??"").replace(/^./,P=>P.toUpperCase())}function m(M){return(M?!g.value:g.value)?h.value:f.value}function b(M,P){if(M.type!=="numberFormat")return M;const $=m(P);return $==="date"?{...M,type:"dateFormat",label:M.label.replace(/number\s+format/i,"Date format")}:$==="string"?{...M,type:"__hidden"}:M}const y=A(()=>a.value.filter(M=>r.has(M.key)).map(M=>b({...M,label:v(M.label)},!1)).filter(M=>M.type!=="__hidden")),x=A(()=>a.value.filter(M=>i.has(M.key)).map(M=>b({...M,label:v(M.label)},!0)).filter(M=>M.type!=="__hidden")),_={solid:Y2,dashed:zT,dotted:HT,none:df},k={auto:ib,inside:sb,outside:zp,off:df},E={left:cf,right:uf},L={linear:sd,log:Hue},S={verticalGridStyle:_,horizontalGridStyle:_,verticalLabelPosition:k,horizontalLabelPosition:k,verticalAxisDirection:E,verticalScaleType:L,horizontalScaleType:L},B=(M,{emit:P})=>{const{def:$,value:F}=M;if($.type==="boolean")return Vt(nn,{label:$.label,modelValue:F??$.default??!1,"onUpdate:modelValue":V=>P("update",V)});if($.type==="select"&&$.choices){const V=S[$.key],U=$.choices.map(K=>({value:K.value,text:K.text,...V!=null&&V[K.value]?{icon:V[K.value]}:{}}));return Vt($n,{label:$.label,options:U,block:!0,modelValue:F??$.default??"","onUpdate:modelValue":K=>P("update",K)})}return $.type==="text"?Vt(km,{label:$.label,id:`opt-${$.key}`,placeholder:$.placeholder??"",modelValue:F??"","onUpdate:modelValue":V=>P("update",V)}):$.type==="numberFormat"?Vt(WV,{label:$.label,id:`opt-${$.key}`,modelValue:F??"","onUpdate:modelValue":V=>P("update",V)}):$.type==="dateFormat"?Vt(LH,{label:$.label,id:`opt-${$.key}`,modelValue:F??"","onUpdate:modelValue":V=>P("update",V)}):null};B.props=["def","value"],B.emits=["update"];function D(M){return M.endsWith("RangeMin")}function N(M){return M.endsWith("RangeMax")}const C=(M,{emit:P})=>{const $=[],{defs:F,currentOptions:V}=M;let U=0;for(;U<F.length;){const K=F[U];if(D(K.key)&&U+1<F.length&&N(F[U+1].key)){const ae=F[U+1];$.push(Vt("div",{class:"d-flex gap-2",key:K.key},[Vt("div",{class:"flex-fill",style:"min-width:0"},[Vt(B,{def:K,value:V[K.key],onUpdate:me=>P("update",K.key,me)})]),Vt("div",{class:"flex-fill",style:"min-width:0"},[Vt(B,{def:ae,value:V[ae.key],onUpdate:me=>P("update",ae.key,me)})])])),U+=2}else $.push(Vt(B,{key:K.key,def:K,value:V[K.key],onUpdate:ae=>P("update",K.key,ae)})),U++}return Vt("div",{class:"d-flex flex-column gap-2"},$)};return C.props=["defs","currentOptions"],C.emits=["update"],(M,P)=>p(e)||p(y).length>0||p(x).length>0?(w(),R("div",Wue,[p(e)?(w(),Z(p(zo),{key:0,title:"Value Labels",icon:p(IT)},{default:ee(()=>[T("div",Uue,[H(p(nn),{"model-value":p(s).valueLabels??!1,label:"Show value labels","onUpdate:modelValue":P[0]||(P[0]=$=>u("valueLabels",$))},null,8,["model-value"]),p(s).valueLabels?(w(),Z(p($n),{key:0,label:"Position","model-value":p(s).valueLabelPosition??"auto",options:o,block:"","onUpdate:modelValue":P[1]||(P[1]=$=>u("valueLabelPosition",$))},null,8,["model-value"])):ie("",!0),p(s).valueLabels&&p(n)?(w(),Z(p(nn),{key:1,"model-value":p(s).swapLabelValue??!1,label:"Swap labels and values","onUpdate:modelValue":P[2]||(P[2]=$=>u("swapLabelValue",$))},null,8,["model-value"])):ie("",!0)])]),_:1},8,["icon"])):ie("",!0),p(y).length>0?(w(),Z(p(zo),{key:1,title:"Vertical Axis",icon:p(FT)},{default:ee(()=>[H(C,{defs:p(y),"current-options":p(s),onUpdate:u},null,8,["defs","current-options"])]),_:1},8,["icon"])):ie("",!0),p(x).length>0?(w(),Z(p(zo),{key:2,title:"Horizontal Axis",icon:p(VT)},{default:ee(()=>[H(C,{defs:p(x),"current-options":p(s),onUpdate:u},null,8,["defs","current-options"])]),_:1},8,["icon"])):ie("",!0)])):(w(),R("p",Gue," No axis options for this chart type. "))}}),Yue={class:"d-flex flex-column gap-3"},GT=le({__name:"EditorSymbolOptions",props:{shape:{},showOn:{},style:{},size:{},opacity:{},idPrefix:{default:"symbol"}},emits:["update:shape","update:showOn","update:style","update:size","update:opacity"],setup(t){const e=[{value:"circle",text:"Circle"},{value:"square",text:"Square"},{value:"diamond",text:"Diamond"},{value:"triangle",text:"Triangle Up"},{value:"triangleDown",text:"Triangle Down"},{value:"cross",text:"Cross"},{value:"star",text:"Star"}],n=[{value:"firstLast",text:"First & Last"},{value:"first",text:"First"},{value:"last",text:"Last"},{value:"all",text:"All"}],o=[{value:"filled",text:"Filled"},{value:"hollow",text:"Hollow"}];return(r,i)=>{const s=qa,a=On;return w(),R("div",Yue,[H(a,{label:"Symbol","label-for":`${t.idPrefix}-shape`},{default:ee(()=>[H(s,{id:`${t.idPrefix}-shape`,"model-value":t.shape,options:e,"onUpdate:modelValue":i[0]||(i[0]=l=>r.$emit("update:shape",l))},null,8,["id","model-value"])]),_:1},8,["label-for"]),H(p($n),{label:"Show on","model-value":t.showOn,options:n,"onUpdate:modelValue":i[1]||(i[1]=l=>r.$emit("update:showOn",l))},null,8,["model-value"]),H(p($n),{label:"Style","model-value":t.style,options:o,"onUpdate:modelValue":i[2]||(i[2]=l=>r.$emit("update:style",l))},null,8,["model-value"]),H(p(xr),{id:`${t.idPrefix}-size`,label:"Size","model-value":t.size,min:"0.5",max:"10",step:"0.5","onUpdate:modelValue":i[3]||(i[3]=l=>r.$emit("update:size",l))},null,8,["id","model-value"]),H(p(xr),{id:`${t.idPrefix}-opacity`,label:"Opacity","model-value":t.opacity,min:"0",max:"1",step:"0.1","onUpdate:modelValue":i[4]||(i[4]=l=>r.$emit("update:opacity",l))},null,8,["id","model-value"])])}}}),jue={class:"d-flex flex-column gap-3"},Xue={class:"d-flex gap-2 justify-content-end"},Kue=le({__name:"EditorSeriesOptions",props:{selected:{},overrides:{},colors:{},chartType:{}},emits:["update:overrides"],setup(t,{emit:e}){const n=t,o=e;function r(C){return n.overrides.find(M=>M.name===C)}function i(){return n.selected.length>0?r(n.selected[0]):void 0}const s=A(()=>n.chartType==="bar-multi"),a=A(()=>n.chartType==="line-multi"),l=A(()=>{var C;return((C=i())==null?void 0:C.color)??"#4e79a7"}),c=A(()=>{var C;return String(((C=i())==null?void 0:C.opacity)??1)}),u=A(()=>{var C;return String(((C=i())==null?void 0:C.lineWidth)??2)}),d=A(()=>{var C;return((C=i())==null?void 0:C.dash)??"solid"}),f=A(()=>{var C;return((C=i())==null?void 0:C.interpolation)??"global"}),h=A(()=>{var C;return((C=i())==null?void 0:C.labelMode)??"global"}),g=A(()=>{var C;return((C=i())==null?void 0:C.valueLabels)??!1}),v=A(()=>{var C;return((C=i())==null?void 0:C.lineSymbols)??!1}),m=A(()=>{var C;return((C=i())==null?void 0:C.symbolShape)??"circle"}),b=A(()=>{var C;return((C=i())==null?void 0:C.symbolShowOn)??"firstLast"}),y=A(()=>{var C;return((C=i())==null?void 0:C.symbolStyle)??"filled"}),x=A(()=>{var C;return String(((C=i())==null?void 0:C.symbolSize)??3.5)}),_=A(()=>{var C;return String(((C=i())==null?void 0:C.symbolOpacity)??1)});function k(C,M){const P=n.overrides.map($=>({...$}));for(const $ of n.selected){let F=P.find(V=>V.name===$);F||(F={name:$},P.push(F)),F[C]=M}o("update:overrides",P)}function E(){if(n.selected.length<2)return;const C=r(n.selected[0]);if(!C)return;const M=n.overrides.map(P=>({...P}));for(let P=1;P<n.selected.length;P++){const $=n.selected[P];let F=M.find(V=>V.name===$);F||(F={name:$},M.push(F)),Object.assign(F,{...C,name:$})}o("update:overrides",M)}function L(){const C=new Set(n.selected),M=n.overrides.filter(P=>!C.has(P.name));o("update:overrides",M)}const S=[{value:"1",text:"1"},{value:"2",text:"2"},{value:"3",text:"3"},{value:"4",text:"4"},{value:"5",text:"5"}],B=[{value:"solid",text:"Solid"},{value:"dotted",text:"Dotted"},{value:"dashed",text:"Dashed"},{value:"dash-dot",text:"Dash-dot"}],D=[{value:"global",text:"Global"},{value:"linear",text:"Linear"},{value:"monotoneX",text:"Monotone"},{value:"step",text:"Step"},{value:"stepBefore",text:"Step (before)"},{value:"stepAfter",text:"Step (after)"},{value:"basis",text:"Basis"},{value:"cardinal",text:"Cardinal"},{value:"catmullRom",text:"Catmull-Rom"}],N=[{value:"global",text:"Global"},{value:"legend",text:"Legend"},{value:"direct",text:"Direct"},{value:"none",text:"None"}];return(C,M)=>{const P=qa,$=On,F=GT,V=Ho;return w(),R("div",jue,[H(p(Da),{id:"series-color",label:"Color","model-value":p(l),"onUpdate:modelValue":M[0]||(M[0]=U=>k("color",U))},null,8,["model-value"]),H(p($n),{label:"Label mode","model-value":p(h),options:N,block:"","onUpdate:modelValue":M[1]||(M[1]=U=>k("labelMode",U))},null,8,["model-value"]),H(p(nn),{"model-value":p(g),label:"Value labels","onUpdate:modelValue":M[2]||(M[2]=U=>k("valueLabels",U))},null,8,["model-value"]),p(s)?(w(),Z(p(xr),{key:0,id:"series-opacity",label:"Opacity","model-value":p(c),min:"0",max:"1",step:"0.1","onUpdate:modelValue":M[3]||(M[3]=U=>k("opacity",Number(U)))},null,8,["model-value"])):ie("",!0),p(a)?(w(),R(We,{key:1},[H(p($n),{label:"Line width","model-value":p(u),options:S,"onUpdate:modelValue":M[4]||(M[4]=U=>k("lineWidth",Number(U)))},null,8,["model-value"]),H(p($n),{label:"Dash style","model-value":p(d),options:B,"onUpdate:modelValue":M[5]||(M[5]=U=>k("dash",U))},null,8,["model-value"]),H($,{label:"Interpolation","label-for":"series-interpolation"},{default:ee(()=>[H(P,{id:"series-interpolation","model-value":p(f),options:D,"onUpdate:modelValue":M[6]||(M[6]=U=>k("interpolation",U))},null,8,["model-value"])]),_:1}),H(p(nn),{"model-value":p(v),label:"Line symbols","onUpdate:modelValue":M[7]||(M[7]=U=>k("lineSymbols",U))},null,8,["model-value"]),p(v)?(w(),Z(F,{key:0,"id-prefix":"series-symbol",shape:p(m),"show-on":p(b),style:Pt(p(y)),size:p(x),opacity:p(_),"onUpdate:shape":M[8]||(M[8]=U=>k("symbolShape",U)),"onUpdate:showOn":M[9]||(M[9]=U=>k("symbolShowOn",U)),"onUpdate:style":M[10]||(M[10]=U=>k("symbolStyle",U)),"onUpdate:size":M[11]||(M[11]=U=>k("symbolSize",Number(U))),"onUpdate:opacity":M[12]||(M[12]=U=>k("symbolOpacity",Number(U)))},null,8,["shape","show-on","style","size","opacity"])):ie("",!0)],64)):ie("",!0),T("div",Xue,[t.selected.length>1?(w(),Z(V,{key:0,variant:"outline-secondary",size:"sm",onClick:E},{default:ee(()=>[...M[13]||(M[13]=[Ye(" Copy from first ",-1)])]),_:1})):ie("",!0),H(V,{variant:"outline-danger",size:"sm",onClick:L},{default:ee(()=>[...M[14]||(M[14]=[Ye(" Reset to default ",-1)])]),_:1})])])}}}),Zue=le({__name:"EditorSeriesList",props:{seriesNames:{},selected:{},colors:{},overrides:{}},emits:["update:selected","toggleVisibility"],setup(t){const e=t;function n(r,i){return an(r,i,e.colors,e.overrides)}function o(r){return el(r,e.overrides)}return(r,i)=>{const s=Fs;return w(),Z(p(zy),{items:t.seriesNames,selected:t.selected,"onUpdate:selected":i[1]||(i[1]=a=>r.$emit("update:selected",a))},{"item-leading":ee(({item:a,index:l})=>[H(p(_m),{color:n(a,l)},null,8,["color"])]),"item-actions":ee(({item:a})=>[H(s,{"model-value":!o(a),switch:"",size:"sm",onClick:i[0]||(i[0]=gn(()=>{},["stop"])),"onUpdate:modelValue":l=>r.$emit("toggleVisibility",a,!l)},null,8,["model-value","onUpdate:modelValue"])]),_:1},8,["items","selected"])}}}),Que={class:"d-flex flex-column gap-3"},Jue=le({__name:"EditorSeriesPanel",setup(t){const{chartType:e,data:n,seriesOverrides:o}=hn(),{currentOptions:r}=kn(),i=ze([]),s=A(()=>{var u;return((u=hs(n.value).series)==null?void 0:u.map(d=>d.name))??[]}),a=A(()=>G$(r.value).colors??["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"]);function l(c,u){const d=o.value.map(h=>({...h}));let f=d.find(h=>h.name===c);f||(f={name:c},d.push(f)),f.hidden=u,o.value=d}return(c,u)=>{const d=Zue,f=Kue;return w(),R("div",Que,[u[2]||(u[2]=T("h6",{class:"fw-bold mb-0"}," Series ",-1)),H(d,{"series-names":p(s),selected:p(i),colors:p(a),overrides:p(o),"onUpdate:selected":u[0]||(u[0]=h=>i.value=h),onToggleVisibility:l},null,8,["series-names","selected","colors","overrides"]),p(i).length>0?(w(),Z(p($d),{key:0,label:"Editing "+p(i).length+" "+(p(i).length===1?"series: "+p(i)[0]:"series")},{default:ee(()=>[H(f,{selected:p(i),overrides:p(o),colors:p(a),"chart-type":p(e),"onUpdate:overrides":u[1]||(u[1]=h=>o.value=h)},null,8,["selected","overrides","colors","chart-type"])]),_:1},8,["label"])):ie("",!0)])}}}),ede={class:"d-flex flex-column gap-3"},tde={class:"bc-area-stack-options"},nde=le({__name:"EditorAreaSection",setup(t){const{currentOptions:e,setOption:n}=kn(),o=[{value:"linear",text:"Linear"},{value:"monotoneX",text:"Monotone"},{value:"step",text:"Step"},{value:"stepBefore",text:"Step (before)"},{value:"stepAfter",text:"Step (after)"},{value:"basis",text:"Basis"},{value:"cardinal",text:"Cardinal"},{value:"catmullRom",text:"Catmull-Rom"}],r=[{value:"none",text:"Keep order"},{value:"ascending",text:"Smallest first"},{value:"descending",text:"Largest first"}];return(i,s)=>{const a=qa,l=On,c=eE,u=Fs;return w(),R("div",ede,[H(p(xr),{id:"opt-area-opacity","model-value":String(p(e).areaFillOpacity??"0.85"),label:"Opacity",min:"0",max:"1",step:"0.05","onUpdate:modelValue":s[0]||(s[0]=d=>p(n)("areaFillOpacity",d))},null,8,["model-value"]),H(l,{label:"Interpolation","label-for":"opt-area-interpolation"},{default:ee(()=>[H(a,{id:"opt-area-interpolation","model-value":p(e).interpolation??"monotoneX",options:o,"onUpdate:modelValue":s[1]||(s[1]=d=>p(n)("interpolation",String(d)))},null,8,["model-value"])]),_:1}),H(l,{label:"Sort areas"},{default:ee(()=>[H(c,{"model-value":p(e).areaSortMode??"none",options:r,stacked:"","onUpdate:modelValue":s[2]||(s[2]=d=>p(n)("areaSortMode",String(d)))},null,8,["model-value"])]),_:1}),H(p(nn),{"model-value":p(e).stacked!==!1,label:"Stack areas","onUpdate:modelValue":s[5]||(s[5]=d=>p(n)("stacked",d))},{section:ee(()=>[T("div",tde,[H(u,{"model-value":p(e).stackPercent??!1,"onUpdate:modelValue":s[3]||(s[3]=d=>p(n)("stackPercent",d))},{default:ee(()=>[...s[6]||(s[6]=[Ye(" Stack to 100% ",-1)])]),_:1},8,["model-value"]),H(u,{"model-value":p(e).areaLines!==!1,"onUpdate:modelValue":s[4]||(s[4]=d=>p(n)("areaLines",d))},{default:ee(()=>[...s[7]||(s[7]=[Ye(" Separate areas with lines ",-1)])]),_:1},8,["model-value"])])]),_:1},8,["model-value"])])}}}),ode=Oe(nde,[["__scopeId","data-v-3bf56010"]]),rde={class:"d-flex flex-column gap-3"},ide=le({__name:"EditorSliceSection",setup(t){const{currentOptions:e,availableOptionKeys:n,setOption:o}=kn();function r(i){return n.value.includes(i)}return(i,s)=>{const a=ta,l=On;return w(),R("div",rde,[r("displayAsPercentage")?(w(),Z(p(nn),{key:0,"model-value":p(e).displayAsPercentage??!1,label:"Display as percentage","onUpdate:modelValue":s[0]||(s[0]=c=>p(o)("displayAsPercentage",c))},null,8,["model-value"])):ie("",!0),r("showTotal")?(w(),Z(p(nn),{key:1,"model-value":p(e).showTotal??!1,label:"Show total","onUpdate:modelValue":s[1]||(s[1]=c=>p(o)("showTotal",c))},null,8,["model-value"])):ie("",!0),r("showLabels")?(w(),Z(p(nn),{key:2,"model-value":p(e).showLabels??!0,label:"Show labels","onUpdate:modelValue":s[2]||(s[2]=c=>p(o)("showLabels",c))},null,8,["model-value"])):ie("",!0),r("showValues")?(w(),Z(p(nn),{key:3,"model-value":p(e).showValues??!0,label:"Show values","onUpdate:modelValue":s[3]||(s[3]=c=>p(o)("showValues",c))},null,8,["model-value"])):ie("",!0),r("sliceMax")?(w(),Z(p(xr),{key:4,id:"opt-sliceMax",label:"Max slices","model-value":p(e).sliceMax??"6",min:"2",max:"20","onUpdate:modelValue":s[4]||(s[4]=c=>p(o)("sliceMax",String(c)))},null,8,["model-value"])):ie("",!0),r("sliceGroupLabel")?(w(),Z(l,{key:5,label:"Group label","label-for":"opt-sliceGroupLabel"},{default:ee(()=>[H(a,{id:"opt-sliceGroupLabel","model-value":p(e).sliceGroupLabel??"Others",placeholder:"Others","onUpdate:modelValue":s[5]||(s[5]=c=>p(o)("sliceGroupLabel",c))},null,8,["model-value"])]),_:1})):ie("",!0)])}}}),sde={class:"d-flex flex-column gap-3"},Z6=.15,ade=le({__name:"EditorBarStyleSection",setup(t){const{currentOptions:e,availableOptionKeys:n,setOption:o}=kn(),r=A(()=>n.value.includes("barBackground")),i=A(()=>n.value.includes("barSeparators")),s=A(()=>n.value.includes("barGap")),a=A(()=>n.value.includes("connectedColumns")),l=A(()=>n.value.includes("waterfall")),c=A(()=>n.value.includes("waterfallTotal")),u=A(()=>n.value.includes("categoryLabelLine"));function d(y){return Math.max(0,Math.min(100,y))}const f=A(()=>{const y=parseFloat(e.value.barGap??""),x=isNaN(y)?nf:y;return String(d(x))});function h(y){const x=parseFloat(y),_=isNaN(x)?nf:x;o("barGap",String(d(_)))}function g(y){const x=parseFloat(y??""),_=isNaN(x)?Z6:x,k=Math.max(0,Math.min(1,_));return String(Math.round(k*100))}function v(y){const x=parseFloat(y);if(isNaN(x))return String(Z6);const _=Math.max(0,Math.min(100,x));return String(_/100)}const m=A(()=>g(e.value.connectionsOpacity));function b(y){o("connectionsOpacity",v(y))}return(y,x)=>(w(),R("div",sde,[p(r)?(w(),Z(p(nn),{key:0,"model-value":p(e).barBackground??!1,label:"Bar background","onUpdate:modelValue":x[0]||(x[0]=_=>p(o)("barBackground",_))},null,8,["model-value"])):ie("",!0),p(i)?(w(),Z(p(nn),{key:1,"model-value":p(e).barSeparators??!1,label:"Bar separators","onUpdate:modelValue":x[1]||(x[1]=_=>p(o)("barSeparators",_))},null,8,["model-value"])):ie("",!0),p(s)?(w(),Z(p(xr),{key:2,id:"opt-bar-gap","model-value":p(f),label:"Bar gap",min:"0",max:"100",step:"1",suffix:"%","onUpdate:modelValue":h},null,8,["model-value"])):ie("",!0),p(a)?(w(),Z(p(nn),{key:3,"model-value":p(e).connectedColumns??!1,label:"Connected columns","onUpdate:modelValue":x[2]||(x[2]=_=>p(o)("connectedColumns",_))},null,8,["model-value"])):ie("",!0),p(a)&&p(e).connectedColumns?(w(),Z(p(xr),{key:4,id:"opt-connections-opacity","model-value":p(m),label:"Opacity",min:"0",max:"100",step:"1",suffix:"%","onUpdate:modelValue":b},null,8,["model-value"])):ie("",!0),p(l)?(w(),Z(p(nn),{key:5,"model-value":p(e).waterfall??!1,label:"Waterfall","onUpdate:modelValue":x[3]||(x[3]=_=>p(o)("waterfall",_))},null,8,["model-value"])):ie("",!0),p(c)&&p(e).waterfall?(w(),Z(p(nn),{key:6,"model-value":p(e).waterfallTotal??!1,label:"Waterfall total","onUpdate:modelValue":x[4]||(x[4]=_=>p(o)("waterfallTotal",_))},null,8,["model-value"])):ie("",!0),p(u)?(w(),Z(p(nn),{key:7,"model-value":p(e).categoryLabelLine??!1,label:"Labels on separate line","onUpdate:modelValue":x[5]||(x[5]=_=>p(o)("categoryLabelLine",_))},null,8,["model-value"])):ie("",!0)]))}}),lde={class:"d-flex flex-column gap-3"},cde=le({__name:"EditorLineSymbols",setup(t){const{currentOptions:e,setOption:n}=kn();return(o,r)=>{const i=GT;return w(),R("div",lde,[H(p(nn),{"model-value":p(e).lineSymbols??!1,label:"Show line symbols","onUpdate:modelValue":r[0]||(r[0]=s=>p(n)("lineSymbols",s))},null,8,["model-value"]),p(e).lineSymbols?(w(),Z(i,{key:0,"id-prefix":"opt-line-symbol",shape:p(e).lineSymbolShape??"circle","show-on":p(e).lineSymbolShowOn??"firstLast",style:Pt(p(e).lineSymbolStyle??"filled"),size:p(e).lineSymbolSize??"3.5",opacity:p(e).lineSymbolOpacity??"1","onUpdate:shape":r[1]||(r[1]=s=>p(n)("lineSymbolShape",s)),"onUpdate:showOn":r[2]||(r[2]=s=>p(n)("lineSymbolShowOn",s)),"onUpdate:style":r[3]||(r[3]=s=>p(n)("lineSymbolStyle",s)),"onUpdate:size":r[4]||(r[4]=s=>p(n)("lineSymbolSize",s)),"onUpdate:opacity":r[5]||(r[5]=s=>p(n)("lineSymbolOpacity",s))},null,8,["shape","show-on","style","size","opacity"])):ie("",!0)])}}}),ude={class:"d-flex flex-column gap-3"},dde=le({__name:"EditorLineSection",setup(t){const{currentOptions:e,availableOptionKeys:n,setOption:o}=kn(),r=A(()=>n.value.includes("interpolation")),i=A(()=>n.value.includes("edgePadding")),s=A(()=>n.value.includes("lineSymbols")),a=[{value:"linear",text:"Linear"},{value:"monotoneX",text:"Monotone"},{value:"step",text:"Step"},{value:"stepBefore",text:"Step (before)"},{value:"stepAfter",text:"Step (after)"},{value:"basis",text:"Basis"},{value:"cardinal",text:"Cardinal"},{value:"catmullRom",text:"Catmull-Rom"}];return(l,c)=>{const u=qa,d=On,f=cde;return w(),R("div",ude,[p(r)?(w(),Z(d,{key:0,label:"Line interpolation","label-for":"opt-interpolation"},{default:ee(()=>[H(u,{id:"opt-interpolation","model-value":p(e).interpolation??"linear",options:a,"onUpdate:modelValue":c[0]||(c[0]=h=>p(o)("interpolation",h))},null,8,["model-value"])]),_:1})):ie("",!0),p(i)?(w(),Z(p(nn),{key:1,"model-value":p(e).edgePadding??!1,label:"Edge padding","onUpdate:modelValue":c[1]||(c[1]=h=>p(o)("edgePadding",h))},null,8,["model-value"])):ie("",!0),p(s)?(w(),Z(f,{key:2})):ie("",!0)])}}}),fde={class:"d-flex flex-column gap-3"},hde=le({__name:"EditorBarAppearance",props:{labels:{},colorizes:{},baseColor:{}},emits:["update:colorizes","update:baseColor"],setup(t,{emit:e}){const n=t,o=e,r=ze([]),i=Re(n.colorizes.length>0),s=A(()=>{const h=new Map;for(const g of n.colorizes)h.set(g.target,g.color);return h});function a(h){return s.value.get(h)??n.baseColor}const l=A(()=>r.value.length===0?n.baseColor:s.value.get(r.value[0])??n.baseColor);function c(h,g,v){v.ctrlKey||v.metaKey?r.value.indexOf(h)>=0?r.value=r.value.filter(b=>b!==h):r.value=[...r.value,h]:r.value.length===1&&r.value[0]===h?r.value=[]:r.value=[h]}function u(h){const g=new Map(n.colorizes.map(v=>[v.target,v]));for(const v of r.value)g.set(v,{target:v,color:h,label:""});o("update:colorizes",[...g.values()])}function d(){o("update:colorizes",[]),r.value=[]}function f(h){i.value=h,h||(o("update:colorizes",[]),r.value=[])}return(h,g)=>(w(),R("div",fde,[H(p(Da),{id:"bar-base-color",label:"Base color","model-value":t.baseColor,"onUpdate:modelValue":g[0]||(g[0]=v=>h.$emit("update:baseColor",v))},null,8,["model-value"]),H(p(nn),{"model-value":p(i),label:"Customize colors","onUpdate:modelValue":f},null,8,["model-value"]),p(i)?(w(),R(We,{key:0},[H(p(zy),{items:t.labels,selected:p(r),"on-item-click":c,"onUpdate:selected":g[1]||(g[1]=v=>r.value=v)},{"item-leading":ee(({item:v})=>[H(p(_m),{color:a(v)},null,8,["color"])]),_:1},8,["items","selected"]),p(r).length>0?(w(),Z(p($d),{key:0,label:"Editing "+p(r).length+" "+(p(r).length===1?"label":"labels")},{default:ee(()=>[H(p(Da),{id:"bar-highlight-color",label:"Color for selected","model-value":p(l),"onUpdate:modelValue":u},null,8,["model-value"]),t.colorizes.length>0?(w(),Z(p(Ho),{key:0,variant:"outline-danger",size:"sm",onClick:d},{default:ee(()=>[...g[2]||(g[2]=[Ye(" Reset all changes ",-1)])]),_:1})):ie("",!0)]),_:1},8,["label"])):ie("",!0)],64)):ie("",!0)]))}}),pde=Bo("cvdMode",()=>({cvdMode:Re("")}));function qT(){const t=pde(),{cvdMode:e}=$t(t);return{cvdMode:e}}const mde="#ffffff",gde="#1a1a1a",vde={protanopia:"Protan",deuteranopia:"Deutan",tritanopia:"Tritan"};function Q6(t,e,n){const r=(n?r$(t,e):t).map(s=>bte(s,e)),i=Math.min(...r);return{level:yte(i),ratio:`${i.toFixed(1)}:1`}}function bde(t,e,n){const o=A(()=>{const s=bt(t);return s.length===0?null:Q6(s,mde,bt(e))}),r=A(()=>{const s=bt(t);return s.length===0||!bt(n)?null:Q6(s,gde,bt(e))}),i=A(()=>{const s=bt(t);if(s.length===0)return null;const a=s.length>=2?coe(s):[];return a.length===0?{safe:!0,issues:[]}:{safe:!1,issues:a.map(l=>({type:l.type,shortLabel:vde[l.type],tooltip:`${l.label}: ${l.pairs.length} color ${l.pairs.length===1?"pair":"pairs"} may be hard to distinguish.`}))}});return{lightContrastInfo:o,darkContrastInfo:r,cvdInfo:i}}const yde={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 48 36" xmlns="http://www.w3.org/2000/svg"><rect x="5.30" y="9.00" width="11.22" height="25.00" fill="#2563A0" rx="0.5"/><rect x="17.77" y="14.00" width="11.22" height="20.00" fill="#D4A63A" rx="0.5"/><rect x="30.23" y="4.00" width="11.22" height="30.00" fill="#C94044" rx="0.5"/></svg>',style:"width:100%;height:100%"})}},xde={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 48 36" xmlns="http://www.w3.org/2000/svg"><rect x="5.30" y="9.00" width="11.22" height="25.00" fill="#4767a2" rx="0.5"/><rect x="17.77" y="14.00" width="11.22" height="20.00" fill="#baa62a" rx="0.5"/><rect x="30.23" y="4.00" width="11.22" height="30.00" fill="#655e43" rx="0.5"/></svg>',style:"width:100%;height:100%"})}},wde={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 48 36" xmlns="http://www.w3.org/2000/svg"><rect x="5.30" y="9.00" width="11.22" height="25.00" fill="#345b9f" rx="0.5"/><rect x="17.77" y="14.00" width="11.22" height="20.00" fill="#c5b23f" rx="0.5"/><rect x="30.23" y="4.00" width="11.22" height="30.00" fill="#887c40" rx="0.5"/></svg>',style:"width:100%;height:100%"})}},_de={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 48 36" xmlns="http://www.w3.org/2000/svg"><rect x="5.30" y="9.00" width="11.22" height="25.00" fill="#00717a" rx="0.5"/><rect x="17.77" y="14.00" width="11.22" height="20.00" fill="#e69790" rx="0.5"/><rect x="30.23" y="4.00" width="11.22" height="30.00" fill="#dc1a43" rx="0.5"/></svg>',style:"width:100%;height:100%"})}},kde={class:"d-flex flex-column gap-3"},Sde={key:4,class:"d-flex align-items-center gap-2"},Ade={key:5,class:"d-flex align-items-center gap-2"},Cde={key:6,class:"d-flex align-items-center gap-2"},$de=le({__name:"EditorColorSection",setup(t){const{chartType:e,data:n,colorizes:o}=hn(),{currentOptions:r,availableOptionKeys:i,setOption:s}=kn(),{cvdMode:a}=$t(qT()),l=A(()=>[Le.BarVertical,Le.BarHorizontal,Le.VerticalBar,Le.HorizontalBar].includes(e.value)),c=A(()=>i.value.includes("colors")),u=A(()=>i.value.includes("colorPalette")),d=A(()=>hs(n.value)),f=A(()=>d.value.labels),h=A(()=>{const B=r.value.colorPalette;return B?JC(B)??[]:r.value.colors??[]}),g=A(()=>h.value[0]??"#4e79a7");function v(B){r.value.colorPalette&&s("colorPalette",""),s("colors",[B])}const m=A(()=>{if(l.value){const B=o.value.map(N=>N.color),D=g.value;return B.length>0?[D,...B]:[D]}return h.value}),{lightContrastInfo:b,darkContrastInfo:y,cvdInfo:x}=bde(m,()=>!!r.value.autoContrast,()=>r.value.allowDarkMode??!0),_=ht("cvdSafeBadgeRef"),k=ht("cvdBadgeRefs");function E(B){var N;const D=((N=x.value)==null?void 0:N.issues.findIndex(C=>C.type===B))??-1;return D>=0?k.value[D]:void 0}const L=[{value:"",text:"None",description:"Normal color vision",visual:Me(yde)},{value:"protanopia",text:"Protanopia",description:"No red cones (1% of males)",visual:Me(xde)},{value:"deuteranopia",text:"Deuteranopia",description:"No green cones (1% of males)",visual:Me(wde)},{value:"tritanopia",text:"Tritanopia",description:"No blue cones (very rare)",visual:Me(_de)}],S=[{value:"",label:"Custom",colors:[]},...e5().map(B=>({value:B.name,label:B.label,colors:[...B.colors]}))];return(B,D)=>{const N=hde;return w(),R("div",kde,[p(l)?(w(),Z(N,{key:0,labels:p(f),colorizes:p(o),"base-color":p(g),"onUpdate:colorizes":D[0]||(D[0]=C=>o.value=C),"onUpdate:baseColor":v},null,8,["labels","colorizes","base-color"])):(w(),R(We,{key:1},[p(u)?(w(),Z(p(pV),{key:0,id:"opt-palette",label:"Color palette","model-value":p(r).colorPalette??"",palettes:S,"onUpdate:modelValue":D[1]||(D[1]=C=>p(s)("colorPalette",C))},null,8,["model-value"])):ie("",!0),p(c)&&!p(r).colorPalette?(w(),Z(p(FF),{key:1,id:"opt-colors",label:"Colors","model-value":p(r).colors??[],"onUpdate:modelValue":D[2]||(D[2]=C=>p(s)("colors",C))},null,8,["model-value"])):ie("",!0)],64)),p(u)||p(c)?(w(),Z(p(nn),{key:2,id:"opt-allow-dark-mode",label:"Allow dark mode","model-value":p(r).allowDarkMode??!0,"onUpdate:modelValue":D[3]||(D[3]=C=>p(s)("allowDarkMode",C))},null,8,["model-value"])):ie("",!0),p(u)||p(c)?(w(),Z(p(nn),{key:3,id:"opt-auto-contrast",label:"Auto-adjust contrast","model-value":p(r).autoContrast??!1,"onUpdate:modelValue":D[4]||(D[4]=C=>p(s)("autoContrast",C))},null,8,["model-value"])):ie("",!0),p(b)?(w(),R("div",Sde,[D[6]||(D[6]=T("span",{class:"form-label mb-0"},"Light contrast",-1)),H(p(r8),{level:p(b).level,ratio:p(b).ratio},null,8,["level","ratio"])])):ie("",!0),p(y)?(w(),R("div",Ade,[D[7]||(D[7]=T("span",{class:"form-label mb-0"},"Dark contrast",-1)),H(p(r8),{level:p(y).level,ratio:p(y).ratio},null,8,["level","ratio"])])):ie("",!0),p(x)?(w(),R("div",Cde,[D[9]||(D[9]=T("span",{class:"form-label mb-0"},"Colorblind",-1)),p(x).safe?(w(),R("span",{key:0,ref_key:"cvdSafeBadgeRef",ref:_,class:"editor-color-section__cvd-badge editor-color-section__cvd-badge--safe"},[H(p(Oy)),D[8]||(D[8]=Ye(" Safe ",-1)),H(p(T1),{class:"editor-color-section__cvd-badge__info"}),H(p(qd),{"teleport-to":"body",target:p(_),title:"All colors remain distinguishable under protanopia, deuteranopia, and tritanopia simulations.",placement:"top"},null,8,["target"])],512)):(w(!0),R(We,{key:1},mt(p(x).issues,C=>(w(),R("span",{key:C.type,ref_for:!0,ref_key:"cvdBadgeRefs",ref:k,class:"editor-color-section__cvd-badge editor-color-section__cvd-badge--warn"},[H(p(UT)),Ye(" "+be(C.shortLabel)+" ",1),H(p(T1),{class:"editor-color-section__cvd-badge__info"}),H(p(qd),{"teleport-to":"body",target:()=>E(C.type),title:C.tooltip,placement:"top"},null,8,["target","title"])]))),128))])):ie("",!0),H(p($n),{modelValue:p(a),"onUpdate:modelValue":D[5]||(D[5]=C=>Xe(a)?a.value=C:null),label:"Colorblind simulation",options:L,block:""},null,8,["modelValue"])])}}}),Tde=Oe($de,[["__scopeId","data-v-bbe9fd0a"]]),Mde=le({__name:"EditorThemeSection",setup(t){const{chartTheme:e,availableThemes:n}=iT();return(o,r)=>(w(),Z(p(Rn),{modelValue:p(e),"onUpdate:modelValue":r[0]||(r[0]=i=>Xe(e)?e.value=i:null),label:"Chart Theme",options:p(n),block:""},null,8,["modelValue","options"]))}}),Ode={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Bde(t,e){return w(),R("svg",Ode,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M238.64 33.36a32 32 0 0 0-45.26 0a32 32 0 0 0 0 45.26c.29.29.6.57.9.85l-26.63 49.46a32.2 32.2 0 0 0-23.9 3.5l-20.18-20.18a32 32 0 0 0-50.2-38.89a32 32 0 0 0 0 45.26c.29.29.59.57.89.85l-26.63 49.47a32 32 0 0 0-30.27 8.44a32 32 0 1 0 45.26 0c-.29-.29-.6-.57-.9-.85l26.63-49.46A32.4 32.4 0 0 0 96 128a32 32 0 0 0 16.25-4.41l20.18 20.18a32 32 0 1 0 50.2-6.38c-.29-.29-.59-.57-.89-.85l26.63-49.46A32.3 32.3 0 0 0 216 88a32 32 0 0 0 22.63-54.62ZM51.3 211.33a16 16 0 0 1-22.63-22.64a16 16 0 1 1 22.63 22.64m33.38-104a16 16 0 0 1 0-22.63a16 16 0 1 1 0 22.63m86.64 64a16 16 0 0 1-22.63-22.63a16 16 0 0 1 22.63 22.63m56-104a16 16 0 1 1-22.62-22.66a16 16 0 0 1 22.63 22.64Z"},null,-1)])])}const Lde=Me({name:"ph-line-segments",render:Bde}),Pde={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Dde(t,e){return w(),R("svg",Pde,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M232 32a8 8 0 0 0-8-8c-44.08 0-89.31 49.71-114.43 82.63A60 60 0 0 0 32 164c0 30.88-19.54 44.73-20.47 45.37A8 8 0 0 0 16 224h76a60 60 0 0 0 57.37-77.57C182.3 121.31 232 76.08 232 32M92 208H34.63C41.38 198.41 48 183.92 48 164a44 44 0 1 1 44 44m32.42-94.45q5.14-6.66 10.09-12.55A76.2 76.2 0 0 1 155 121.49q-5.9 4.94-12.55 10.09a60.5 60.5 0 0 0-18.03-18.03m42.7-2.68a92.6 92.6 0 0 0-22-22c31.78-34.53 55.75-45 69.9-47.91c-2.85 14.16-13.37 38.13-47.9 69.91"},null,-1)])])}const Ede=Me({name:"ph-paint-brush",render:Dde}),Ide={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Nde(t,e){return w(),R("svg",Ide,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M232 208a8 8 0 0 1-8 8H32a8 8 0 0 1-8-8V48a8 8 0 0 1 16 0v94.37L90.73 98a8 8 0 0 1 10.07-.38l58.81 44.11L218.73 90a8 8 0 1 1 10.54 12l-64 56a8 8 0 0 1-10.07.38l-58.81-44.09L40 163.63V200h184a8 8 0 0 1 8 8"},null,-1)])])}const Rde=Me({name:"ph-chart-line",render:Nde}),Fde={class:"d-flex flex-column gap-4"},Vde=le({__name:"EditorAppearanceTab",setup(t){const{chartType:e}=hn(),{availableOptionKeys:n}=kn(),o=A(()=>e.value.includes("horizontal")||e.value===Le.BarStacked||e.value===Le.BarSplit||e.value===Le.BarGrouped?id:Ps),r=A(()=>n.value.includes("stacked")),i=A(()=>n.value.includes("interpolation")||n.value.includes("lineSymbols")),s=A(()=>!r.value&&i.value),a=A(()=>n.value.includes("barBackground")||n.value.includes("barSeparators")||n.value.includes("barGap")||n.value.includes("connectedColumns")||n.value.includes("categoryLabelLine")),l=A(()=>n.value.includes("displayAsPercentage"));return(c,u)=>{const d=Mde,f=Tde,h=dde,g=ade,v=ide,m=ode;return w(),R("div",Fde,[H(p(zo),{title:"Theme",icon:p(Ede)},{default:ee(()=>[H(d)]),_:1},8,["icon"]),H(p(zo),{title:"Colors",icon:p(NT)},{default:ee(()=>[H(f)]),_:1},8,["icon"]),p(s)?(w(),Z(p(zo),{key:0,title:"Line Style",icon:p(Lde)},{default:ee(()=>[H(h)]),_:1},8,["icon"])):ie("",!0),p(a)?(w(),Z(p(zo),{key:1,title:"Bar Style",icon:p(o)},{default:ee(()=>[H(g)]),_:1},8,["icon"])):ie("",!0),p(l)?(w(),Z(p(zo),{key:2,title:"Slices",icon:p(RA)},{default:ee(()=>[H(v)]),_:1},8,["icon"])):ie("",!0),p(r)?(w(),Z(p(zo),{key:3,title:"Areas",icon:p(Rde)},{default:ee(()=>[H(m)]),_:1},8,["icon"])):ie("",!0)])}}}),zde={class:"d-flex flex-column gap-3"},Hde=le({__name:"EditorPropertyForm",setup(t){const{title:e,description:n,byline:o,note:r,source:i,sourceUrl:s}=hn();return(a,l)=>{const c=ta,u=On,d=ky;return w(),R("div",zde,[H(u,{label:"Title","label-for":"prop-title"},{default:ee(()=>[H(c,{id:"prop-title",modelValue:p(e),"onUpdate:modelValue":l[0]||(l[0]=f=>Xe(e)?e.value=f:null),placeholder:"Chart title"},null,8,["modelValue"])]),_:1}),H(u,{label:"Description","label-for":"prop-description"},{default:ee(()=>[H(d,{id:"prop-description",modelValue:p(n),"onUpdate:modelValue":l[1]||(l[1]=f=>Xe(n)?n.value=f:null),placeholder:"Short description",rows:"2","max-rows":"5"},null,8,["modelValue"])]),_:1}),H(u,{label:"Byline","label-for":"prop-byline"},{default:ee(()=>[H(c,{id:"prop-byline",modelValue:p(o),"onUpdate:modelValue":l[2]||(l[2]=f=>Xe(o)?o.value=f:null),placeholder:"Author or byline"},null,8,["modelValue"])]),_:1}),H(u,{label:"Note","label-for":"prop-note"},{default:ee(()=>[H(d,{id:"prop-note",modelValue:p(r),"onUpdate:modelValue":l[3]||(l[3]=f=>Xe(r)?r.value=f:null),placeholder:"Additional note or caveat",rows:"2","max-rows":"4"},null,8,["modelValue"])]),_:1}),H(u,{label:"Source","label-for":"prop-source"},{default:ee(()=>[H(c,{id:"prop-source",modelValue:p(i),"onUpdate:modelValue":l[4]||(l[4]=f=>Xe(i)?i.value=f:null),placeholder:"Data source"},null,8,["modelValue"])]),_:1}),H(u,{label:"Source URL","label-for":"prop-source-url"},{default:ee(()=>[H(c,{id:"prop-source-url",modelValue:p(s),"onUpdate:modelValue":l[5]||(l[5]=f=>Xe(s)?s.value=f:null),type:"url",placeholder:"https://..."},null,8,["modelValue"])]),_:1})])}}}),YT={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 48 36" xmlns="http://www.w3.org/2000/svg"><rect x="3.466666666666666" y="20.666666666666668" width="11.733333333333334" height="13.333333333333332" fill="#2563A0" rx="0.5"/><rect x="18.13333333333333" y="4" width="11.733333333333334" height="30" fill="#2563A0" rx="0.5"/><rect x="32.8" y="14" width="11.733333333333334" height="20" fill="#2563A0" rx="0.5"/></svg>',style:"width:100%;height:100%"})}},jT={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 48 36" xmlns="http://www.w3.org/2000/svg"><rect x="2" y="2.8" width="26.727272727272727" height="6.4" fill="#2563A0" rx="0.5"/><rect x="2" y="10.8" width="42" height="6.4" fill="#2563A0" rx="0.5"/><rect x="2" y="18.8" width="17.181818181818183" height="6.4" fill="#2563A0" rx="0.5"/><rect x="2" y="26.8" width="34.36363636363637" height="6.4" fill="#2563A0" rx="0.5"/></svg>',style:"width:100%;height:100%"})}},XT={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 48 36" xmlns="http://www.w3.org/2000/svg"><rect x="3.65" y="17.64" width="5.61" height="16.36" fill="#2563A0" rx="0.5"/><rect x="9.88" y="23.09" width="5.61" height="10.91" fill="#D4A63A" rx="0.5"/><rect x="16.12" y="13.55" width="5.61" height="20.45" fill="#C94044" rx="0.5"/><rect x="25.65" y="9.45" width="5.61" height="24.55" fill="#2563A0" rx="0.5"/><rect x="31.88" y="4.00" width="5.61" height="30.00" fill="#D4A63A" rx="0.5"/><rect x="38.12" y="20.36" width="5.61" height="13.64" fill="#C94044" rx="0.5"/></svg>',style:"width:100%;height:100%"})}},KT={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 48 36" xmlns="http://www.w3.org/2000/svg"><polyline points="2.00,32.00 10.80,21.50 19.60,26.75 28.40,11.00 37.20,16.25 46.00,4.00" fill="none" stroke="#2563A0" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',style:"width:100%;height:100%"})}},ZT={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 48 36" xmlns="http://www.w3.org/2000/svg"><polyline points="2.00,32.00 13.00,20.00 24.00,26.00 35.00,8.00 46.00,14.00" fill="none" stroke="#2563A0" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><polyline points="2.00,12.00 13.00,18.00 24.00,4.00 35.00,22.00 46.00,8.00" fill="none" stroke="#D4A63A" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><polyline points="2.00,24.00 13.00,16.00 24.00,20.00 35.00,10.00 46.00,4.00" fill="none" stroke="#C94044" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',style:"width:100%;height:100%"})}},Wde={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 48 36" xmlns="http://www.w3.org/2000/svg"><path d="M 2.00,22.67 L 13.00,10.22 L 24.00,16.44 L 35.00,4.00 L 46.00,13.33 L 46.00,34 L 2.00,34 Z" fill="#2563A0" opacity="0.3"/><polyline points="2.00,22.67 13.00,10.22 24.00,16.44 35.00,4.00 46.00,13.33" fill="none" stroke="#2563A0" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',style:"width:100%;height:100%"})}},Ude={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 48 36" xmlns="http://www.w3.org/2000/svg"><path d="M 2.00,16.92 L 13.00,8.31 L 24.00,12.62 L 35.00,4.00 L 46.00,12.62 L 46.00,23.38 L 35.00,16.92 L 24.00,21.23 L 13.00,19.08 L 2.00,23.38 Z" fill="#D4A63A" opacity="0.7"/><path d="M 2.00,23.38 L 13.00,19.08 L 24.00,21.23 L 35.00,16.92 L 46.00,23.38 L 46.00,34 L 35.00,34 L 24.00,34 L 13.00,34 L 2.00,34 Z" fill="#2563A0" opacity="0.7"/></svg>',style:"width:100%;height:100%"})}},Gde={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 48 36" xmlns="http://www.w3.org/2000/svg"><rect x="3.10" y="24.77" width="8.80" height="9.23" fill="#2563A0" rx="0.5"/><rect x="3.10" y="17.85" width="8.80" height="6.92" fill="#D4A63A" rx="0.5"/><rect x="14.10" y="20.15" width="8.80" height="13.85" fill="#2563A0" rx="0.5"/><rect x="14.10" y="8.62" width="8.80" height="11.54" fill="#D4A63A" rx="0.5"/><rect x="25.10" y="22.46" width="8.80" height="11.54" fill="#2563A0" rx="0.5"/><rect x="25.10" y="13.23" width="8.80" height="9.23" fill="#D4A63A" rx="0.5"/><rect x="36.10" y="17.85" width="8.80" height="16.15" fill="#2563A0" rx="0.5"/><rect x="36.10" y="4.00" width="8.80" height="13.85" fill="#D4A63A" rx="0.5"/></svg>',style:"width:100%;height:100%"})}},qde={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 48 36" xmlns="http://www.w3.org/2000/svg"><rect x="2.00" y="2.80" width="12.92" height="6.40" fill="#2563A0" rx="0.5"/><rect x="14.92" y="2.80" width="9.69" height="6.40" fill="#D4A63A" rx="0.5"/><rect x="2.00" y="10.80" width="19.38" height="6.40" fill="#2563A0" rx="0.5"/><rect x="21.38" y="10.80" width="16.15" height="6.40" fill="#D4A63A" rx="0.5"/><rect x="2.00" y="18.80" width="16.15" height="6.40" fill="#2563A0" rx="0.5"/><rect x="18.15" y="18.80" width="12.92" height="6.40" fill="#D4A63A" rx="0.5"/><rect x="2.00" y="26.80" width="22.62" height="6.40" fill="#2563A0" rx="0.5"/><rect x="24.62" y="26.80" width="19.38" height="6.40" fill="#D4A63A" rx="0.5"/></svg>',style:"width:100%;height:100%"})}},Yde={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 48 36" xmlns="http://www.w3.org/2000/svg"><rect x="2.00" y="2.80" width="12.08" height="6.40" fill="#6878E8" rx="0.5"/><rect x="2.00" y="10.80" width="9.17" height="6.40" fill="#6878E8" rx="0.5"/><rect x="2.00" y="18.80" width="5.83" height="6.40" fill="#6878E8" rx="0.5"/><rect x="2.00" y="26.80" width="4.17" height="6.40" fill="#6878E8" rx="0.5"/><rect x="17.33" y="2.80" width="13.33" height="6.40" fill="#E07B38" rx="0.5"/><rect x="17.33" y="10.80" width="10.42" height="6.40" fill="#E07B38" rx="0.5"/><rect x="17.33" y="18.80" width="6.67" height="6.40" fill="#E07B38" rx="0.5"/><rect x="17.33" y="26.80" width="5.00" height="6.40" fill="#E07B38" rx="0.5"/><rect x="32.67" y="2.80" width="11.25" height="6.40" fill="#B83B5E" rx="0.5"/><rect x="32.67" y="10.80" width="8.33" height="6.40" fill="#B83B5E" rx="0.5"/><rect x="32.67" y="18.80" width="5.00" height="6.40" fill="#B83B5E" rx="0.5"/><rect x="32.67" y="26.80" width="3.33" height="6.40" fill="#B83B5E" rx="0.5"/></svg>',style:"width:100%;height:100%"})}},jde={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 48 36" xmlns="http://www.w3.org/2000/svg"><rect x="2" y="2.60" width="38.06" height="2.04" fill="#6878E8" rx="0.5"/><rect x="2" y="4.87" width="28.88" height="2.04" fill="#E07B38" rx="0.5"/><rect x="2" y="7.13" width="18.38" height="2.04" fill="#B83B5E" rx="0.5"/><rect x="2" y="10.60" width="42.00" height="2.04" fill="#6878E8" rx="0.5"/><rect x="2" y="12.87" width="32.81" height="2.04" fill="#E07B38" rx="0.5"/><rect x="2" y="15.13" width="21.00" height="2.04" fill="#B83B5E" rx="0.5"/><rect x="2" y="18.60" width="35.44" height="2.04" fill="#6878E8" rx="0.5"/><rect x="2" y="20.87" width="26.25" height="2.04" fill="#E07B38" rx="0.5"/><rect x="2" y="23.13" width="15.75" height="2.04" fill="#B83B5E" rx="0.5"/><rect x="2" y="26.60" width="15.75" height="2.04" fill="#6878E8" rx="0.5"/><rect x="2" y="28.87" width="10.50" height="2.04" fill="#E07B38" rx="0.5"/><rect x="2" y="31.13" width="6.56" height="2.04" fill="#B83B5E" rx="0.5"/></svg>',style:"width:100%;height:100%"})}},QT={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"><path d="M 20.000 2.000 A 18 18 0 0 1 34.562 30.580 L 28.737 26.348 A 10.799999999999999 10.799999999999999 0 0 0 20.000 9.200 Z" fill="#2563A0"/><path d="M 34.562 30.580 A 18 18 0 0 1 9.420 34.562 L 13.652 28.737 A 10.799999999999999 10.799999999999999 0 0 0 28.737 26.348 Z" fill="#D4A63A"/><path d="M 9.420 34.562 A 18 18 0 0 1 3.713 12.336 L 10.228 15.402 A 10.799999999999999 10.799999999999999 0 0 0 13.652 28.737 Z" fill="#C94044"/><path d="M 3.713 12.336 A 18 18 0 0 1 20.000 2.000 L 20.000 9.200 A 10.799999999999999 10.799999999999999 0 0 0 10.228 15.402 Z" fill="#2D8659"/></svg>',style:"width:100%;height:100%"})}},JT={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"><path d="M 20 20 L 20.000 2.000 A 18 18 0 0 1 34.562 30.580 Z" fill="#2563A0"/><path d="M 20 20 L 34.562 30.580 A 18 18 0 0 1 9.420 34.562 Z" fill="#D4A63A"/><path d="M 20 20 L 9.420 34.562 A 18 18 0 0 1 3.713 12.336 Z" fill="#C94044"/><path d="M 20 20 L 3.713 12.336 A 18 18 0 0 1 20.000 2.000 Z" fill="#2D8659"/></svg>',style:"width:100%;height:100%"})}},Xde=le({__name:"EditorChartTypePicker",setup(t){const{chartType:e,selectedColumn:n}=hn(),{currentOptions:o,availableOptionKeys:r,setOption:i}=kn(),s=Ko(),a=A(()=>r.value.includes("stackMode")),l=[{value:"normal",text:"Normal"},{value:"percent",text:"Percentage (100%)"}],c=[{value:Le.BarVertical,label:"Columns",description:"Compare values across categories",visual:Me(YT)},{value:Le.BarHorizontal,label:"Bars",description:"Compare values with long labels",visual:Me(jT)},{value:Le.BarMulti,label:"Grouped Columns",description:"Compare multiple series side by side",visual:Me(XT)},{value:Le.ColumnStacked,label:"Stacked Columns",description:"Compare stacked totals",visual:Me(Gde)},{value:Le.BarStacked,label:"Stacked Bars",description:"Compare stacked totals horizontally",visual:Me(qde)},{value:Le.BarSplit,label:"Split Bars",description:"Compare multiple metrics in separate bar panels",visual:Me(Yde)},{value:Le.BarGrouped,label:"Grouped Bars",description:"Compare multiple series side by side horizontally",visual:Me(jde)},{value:Le.Line,label:"Line",description:"Show trends over time",visual:Me(KT)},{value:Le.LineMulti,label:"Lines",description:"Compare trends across series",visual:Me(ZT)},{value:Le.Area,label:"Area",description:"Show magnitude over time",visual:Me(Wde)},{value:Le.AreaStacked,label:"Areas",description:"Compare and stack multiple area series",visual:Me(Ude)},{value:Le.Donut,label:"Donut",description:"Show proportions with a center space",visual:Me(QT)},{value:Le.Pie,label:"Pie",description:"Show parts of a whole",visual:Me(JT)}],u=[Le.BarVertical,Le.BarHorizontal,Le.Line,Le.Area,Le.VerticalBar,Le.HorizontalBar],d=A(()=>u.includes(e.value)&&s.columns.value.length>2),f=A(()=>s.columns.value.slice(1).map(h=>({value:h,text:h})));return qe([e,()=>s.columns.value],()=>{d.value&&!n.value&&s.columns.value.length>2&&(n.value=s.columns.value[1])},{immediate:!0}),(h,g)=>{const v=On,m=qa;return w(),R(We,null,[H(v,{label:"Chart type","label-for":"chart-type-select"},{default:ee(()=>[H(p(Rn),{id:"chart-type-select",modelValue:p(e),"onUpdate:modelValue":g[0]||(g[0]=b=>Xe(e)?e.value=b:null),block:"",options:c},null,8,["modelValue"])]),_:1}),p(d)?(w(),Z(v,{key:0,label:"Data column","label-for":"column-select",class:"mt-3"},{default:ee(()=>[H(m,{id:"column-select",modelValue:p(n),"onUpdate:modelValue":g[1]||(g[1]=b=>Xe(n)?n.value=b:null),options:p(f)},null,8,["modelValue","options"])]),_:1})):ie("",!0),p(a)?(w(),Z(v,{key:1,label:"Stack mode","label-for":"opt-stack-mode",class:"mt-3"},{default:ee(()=>[H(m,{id:"opt-stack-mode","model-value":p(o).stackMode??"normal",options:l,"onUpdate:modelValue":g[2]||(g[2]=b=>p(i)("stackMode",b))},null,8,["model-value"])]),_:1})):ie("",!0)],64)}}}),Kde=100,Zde=Bo("chartHistory",()=>{const t=new Map,e=Re(!1),n=Re(!1);let o="",r=!1,i=!1;function s(d){let f=t.get(d);return f||(f={undoStack:[],redoStack:[],currentState:""},t.set(d,f)),f}function a(d,f){const h={config:{chartType:d.chartType,title:d.title,description:d.description,byline:d.byline,note:d.note,source:d.source,sourceUrl:d.sourceUrl,sort:d.sort,data:d.data,selectedColumn:d.selectedColumn,colorizes:JSON.parse(JSON.stringify(d.colorizes)),highlights:JSON.parse(JSON.stringify(d.highlights)),areaFills:JSON.parse(JSON.stringify(d.areaFills)),annotations:JSON.parse(JSON.stringify(d.annotations)),seriesOverrides:JSON.parse(JSON.stringify(d.seriesOverrides??[])),layout:JSON.parse(JSON.stringify(d.layout??af))},typeOptions:JSON.parse(JSON.stringify(f))};return JSON.stringify(h)}function l(){const d=t.get(o);e.value=d?d.undoStack.length>0:!1,n.value=d?d.redoStack.length>0:!1}function c(d){const f=s(o);d!==f.currentState&&(f.undoStack.push(f.currentState),f.undoStack.length>Kde&&f.undoStack.shift(),f.redoStack.length=0,f.currentState=d,l())}function u(){const d=hn(),{store:f,hydrate:h}=kn(),{sessionId:g}=Xs();function v(){return a({chartType:d.chartType.value,title:d.title.value,description:d.description.value,byline:d.byline.value,note:d.note.value,source:d.source.value,sourceUrl:d.sourceUrl.value,sort:d.sort.value,data:d.data.value,selectedColumn:d.selectedColumn.value,colorizes:d.colorizes.value,highlights:d.highlights.value,areaFills:d.areaFills.value,annotations:d.annotations.value,seriesOverrides:d.seriesOverrides.value,layout:d.layout.value},f)}i||(i=!0,q0(!0).run(()=>{qe(g,_=>{if(r=!0,o=_,_){const k=s(_);k.currentState||(k.currentState=v())}l(),wn(()=>{r=!1})},{immediate:!0,flush:"sync"}),qe([d.chartType,d.title,d.description,d.byline,d.note,d.source,d.sourceUrl,d.sort,d.data,d.selectedColumn,d.colorizes,d.highlights,d.areaFills,d.annotations,d.layout,()=>JSON.stringify(f)],()=>{r||!o||c(v())},{deep:!0})}));function m(x){r=!0;const _=JSON.parse(x);d.hydrate(_.config),h(_.typeOptions),wn(()=>{r=!1})}function b(){const x=t.get(o);!x||x.undoStack.length===0||(x.redoStack.push(x.currentState),x.currentState=x.undoStack.pop(),l(),m(x.currentState))}function y(){const x=t.get(o);!x||x.redoStack.length===0||(x.undoStack.push(x.currentState),x.currentState=x.redoStack.pop(),l(),m(x.currentState))}return{undo:b,redo:y}}return{canUndo:A(()=>e.value),canRedo:A(()=>n.value),init:u}});function Qde(){const t=Zde(),{canUndo:e,canRedo:n}=$t(t),{undo:o,redo:r}=t.init();return{canUndo:e,canRedo:n,undo:o,redo:r}}const Jde={class:"chart-edit-toolbar"},efe=le({__name:"ChartEditToolbar",setup(t){const e=fr(),{viewMode:n}=$t(e),{setViewMode:o}=e,{canUndo:r,canRedo:i,undo:s,redo:a}=Qde(),l=A({get:()=>n.value,set:u=>o(u)}),c=[{value:"preview",text:"Preview"},{value:"dsl",text:"DSL"}];return(u,d)=>(w(),R("div",Jde,[H(p(OW),{disabled:!p(r),onClick:p(s)},null,8,["disabled","onClick"]),H(p(CW),{disabled:!p(i),onClick:p(a)},null,8,["disabled","onClick"]),H(p(iU),{modelValue:p(l),"onUpdate:modelValue":d[0]||(d[0]=f=>Xe(l)?l.value=f:null),options:c,size:"sm"},null,8,["modelValue"])]))}}),tfe=Oe(efe,[["__scopeId","data-v-de044834"]]);let ab=[],eM=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?eM:ab).push(n=n+t[e])})();function nfe(t){if(t<768)return!1;for(let e=0,n=ab.length;;){let o=e+n>>1;if(t<ab[o])n=o;else if(t>=eM[o])e=o+1;else return!0;if(e==n)return!1}}function J6(t){return t>=127462&&t<=127487}const ek=8205;function ofe(t,e,n=!0,o=!0){return(n?tM:rfe)(t,e,o)}function tM(t,e,n){if(e==t.length)return e;e&&nM(t.charCodeAt(e))&&oM(t.charCodeAt(e-1))&&e--;let o=Ov(t,e);for(e+=tk(o);e<t.length;){let r=Ov(t,e);if(o==ek||r==ek||n&&nfe(r))e+=tk(r),o=r;else if(J6(r)){let i=0,s=e-2;for(;s>=0&&J6(Ov(t,s));)i++,s-=2;if(i%2==0)break;e+=2}else break}return e}function rfe(t,e,n){for(;e>0;){let o=tM(t,e-2,n);if(o<e)return o;e--}return 0}function Ov(t,e){let n=t.charCodeAt(e);if(!oM(n)||e+1==t.length)return n;let o=t.charCodeAt(e+1);return nM(o)?(n-55296<<10)+(o-56320)+65536:n}function nM(t){return t>=56320&&t<57344}function oM(t){return t>=55296&&t<56320}function tk(t){return t<65536?1:2}class Ut{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,o){[e,n]=uu(this,e,n);let r=[];return this.decompose(0,e,r,2),o.length&&o.decompose(0,o.length,r,3),this.decompose(n,this.length,r,1),Yi.from(r,this.length-(n-e)+o.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=uu(this,e,n);let o=[];return this.decompose(e,n,o,0),Yi.from(o,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),o=this.length-this.scanIdentical(e,-1),r=new Bd(this),i=new Bd(e);for(let s=n,a=n;;){if(r.next(s),i.next(s),s=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=o)return!0}}iter(e=1){return new Bd(this,e)}iterRange(e,n=this.length){return new rM(this,e,n)}iterLines(e,n){let o;if(e==null)o=this.iter();else{n==null&&(n=this.lines+1);let r=this.line(e).from;o=this.iterRange(r,Math.max(r,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new iM(o)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Ut.empty:e.length<=32?new Cn(e):Yi.from(Cn.split(e,[]))}}class Cn extends Ut{constructor(e,n=ife(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,o,r){for(let i=0;;i++){let s=this.text[i],a=r+s.length;if((n?o:a)>=e)return new sfe(r,a,o,s);r=a+1,o++}}decompose(e,n,o,r){let i=e<=0&&n>=this.length?this:new Cn(nk(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(r&1){let s=o.pop(),a=ap(i.text,s.text.slice(),0,i.length);if(a.length<=32)o.push(new Cn(a,s.length+i.length));else{let l=a.length>>1;o.push(new Cn(a.slice(0,l)),new Cn(a.slice(l)))}}else o.push(i)}replace(e,n,o){if(!(o instanceof Cn))return super.replace(e,n,o);[e,n]=uu(this,e,n);let r=ap(this.text,ap(o.text,nk(this.text,0,e)),n),i=this.length+o.length-(n-e);return r.length<=32?new Cn(r,i):Yi.from(Cn.split(r,[]),i)}sliceString(e,n=this.length,o=`
|
|
850
|
+
`){[e,n]=uu(this,e,n);let r="";for(let i=0,s=0;i<=n&&s<this.text.length;s++){let a=this.text[s],l=i+a.length;i>e&&s&&(r+=o),e<l&&n>i&&(r+=a.slice(Math.max(0,e-i),n-i)),i=l+1}return r}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let o=[],r=-1;for(let i of e)o.push(i),r+=i.length+1,o.length==32&&(n.push(new Cn(o,r)),o=[],r=-1);return r>-1&&n.push(new Cn(o,r)),n}}class Yi extends Ut{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let o of e)this.lines+=o.lines}lineInner(e,n,o,r){for(let i=0;;i++){let s=this.children[i],a=r+s.length,l=o+s.lines-1;if((n?l:a)>=e)return s.lineInner(e,n,o,r);r=a+1,o=l+1}}decompose(e,n,o,r){for(let i=0,s=0;s<=n&&i<this.children.length;i++){let a=this.children[i],l=s+a.length;if(e<=l&&n>=s){let c=r&((s<=e?1:0)|(l>=n?2:0));s>=e&&l<=n&&!c?o.push(a):a.decompose(e-s,n-s,o,c)}s=l+1}}replace(e,n,o){if([e,n]=uu(this,e,n),o.lines<this.lines)for(let r=0,i=0;r<this.children.length;r++){let s=this.children[r],a=i+s.length;if(e>=i&&n<=a){let l=s.replace(e-i,n-i,o),c=this.lines-s.lines+l.lines;if(l.lines<c>>4&&l.lines>c>>6){let u=this.children.slice();return u[r]=l,new Yi(u,this.length-(n-e)+o.length)}return super.replace(i,a,l)}i=a+1}return super.replace(e,n,o)}sliceString(e,n=this.length,o=`
|
|
851
|
+
`){[e,n]=uu(this,e,n);let r="";for(let i=0,s=0;i<this.children.length&&s<=n;i++){let a=this.children[i],l=s+a.length;s>e&&i&&(r+=o),e<l&&n>s&&(r+=a.sliceString(e-s,n-s,o)),s=l+1}return r}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof Yi))return 0;let o=0,[r,i,s,a]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=n,i+=n){if(r==s||i==a)return o;let l=this.children[r],c=e.children[i];if(l!=c)return o+l.scanIdentical(c,n);o+=l.length+1}}static from(e,n=e.reduce((o,r)=>o+r.length+1,-1)){let o=0;for(let h of e)o+=h.lines;if(o<32){let h=[];for(let g of e)g.flatten(h);return new Cn(h,n)}let r=Math.max(32,o>>5),i=r<<1,s=r>>1,a=[],l=0,c=-1,u=[];function d(h){let g;if(h.lines>i&&h instanceof Yi)for(let v of h.children)d(v);else h.lines>s&&(l>s||!l)?(f(),a.push(h)):h instanceof Cn&&l&&(g=u[u.length-1])instanceof Cn&&h.lines+g.lines<=32?(l+=h.lines,c+=h.length+1,u[u.length-1]=new Cn(g.text.concat(h.text),g.length+1+h.length)):(l+h.lines>r&&f(),l+=h.lines,c+=h.length+1,u.push(h))}function f(){l!=0&&(a.push(u.length==1?u[0]:Yi.from(u,c)),c=-1,l=u.length=0)}for(let h of e)d(h);return f(),a.length==1?a[0]:new Yi(a,n)}}Ut.empty=new Cn([""],0);function ife(t){let e=-1;for(let n of t)e+=n.length+1;return e}function ap(t,e,n=0,o=1e9){for(let r=0,i=0,s=!0;i<t.length&&r<=o;i++){let a=t[i],l=r+a.length;l>=n&&(l>o&&(a=a.slice(0,o-r)),r<n&&(a=a.slice(n-r)),s?(e[e.length-1]+=a,s=!1):e.push(a)),r=l+1}return e}function nk(t,e,n){return ap(t,[""],e,n)}class Bd{constructor(e,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?1:(e instanceof Cn?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let o=this.nodes.length-1,r=this.nodes[o],i=this.offsets[o],s=i>>1,a=r instanceof Cn?r.text.length:r.children.length;if(s==(n>0?a:0)){if(o==0)return this.done=!0,this.value="",this;n>0&&this.offsets[o-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(n>0?0:1)){if(this.offsets[o]+=n,e==0)return this.lineBreak=!0,this.value=`
|
|
852
|
+
`,this;e--}else if(r instanceof Cn){let l=r.text[s+(n<0?-1:0)];if(this.offsets[o]+=n,l.length>Math.max(0,e))return this.value=e==0?l:n>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=r.children[s+(n<0?-1:0)];e>l.length?(e-=l.length,this.offsets[o]+=n):(n<0&&this.offsets[o]--,this.nodes.push(l),this.offsets.push(n>0?1:(l instanceof Cn?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class rM{constructor(e,n,o){this.value="",this.done=!1,this.cursor=new Bd(e,n>o?-1:1),this.pos=n>o?e.length:0,this.from=Math.min(n,o),this.to=Math.max(n,o)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let o=n<0?this.pos-this.from:this.to-this.pos;e>o&&(e=o),o-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*n,this.value=r.length<=o?r:n<0?r.slice(r.length-o):r.slice(0,o),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class iM{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:o,value:r}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):o?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Ut.prototype[Symbol.iterator]=function(){return this.iter()},Bd.prototype[Symbol.iterator]=rM.prototype[Symbol.iterator]=iM.prototype[Symbol.iterator]=function(){return this});class sfe{constructor(e,n,o,r){this.from=e,this.to=n,this.number=o,this.text=r}get length(){return this.to-this.from}}function uu(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function Mo(t,e,n=!0,o=!0){return ofe(t,e,n,o)}function afe(t){return t>=56320&&t<57344}function lfe(t){return t>=55296&&t<56320}function cfe(t,e){let n=t.charCodeAt(e);if(!lfe(n)||e+1==t.length)return n;let o=t.charCodeAt(e+1);return afe(o)?(n-55296<<10)+(o-56320)+65536:n}function ufe(t){return t<65536?1:2}const lb=/\r\n?|\n/;var br=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(br||(br={}));class rs{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let o=this.sections[n+1];e+=o<0?this.sections[n]:o}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,o=0,r=0;n<this.sections.length;){let i=this.sections[n++],s=this.sections[n++];s<0?(e(o,r,i),r+=i):r+=s,o+=i}}iterChangedRanges(e,n=!1){cb(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let o=this.sections[n++],r=this.sections[n++];r<0?e.push(o,r):e.push(r,o)}return new rs(e)}composeDesc(e){return this.empty?e:e.empty?this:sM(this,e)}mapDesc(e,n=!1){return e.empty?this:ub(this,e,n)}mapPos(e,n=-1,o=br.Simple){let r=0,i=0;for(let s=0;s<this.sections.length;){let a=this.sections[s++],l=this.sections[s++],c=r+a;if(l<0){if(c>e)return i+(e-r);i+=a}else{if(o!=br.Simple&&c>=e&&(o==br.TrackDel&&r<e&&c>e||o==br.TrackBefore&&r<e||o==br.TrackAfter&&c>e))return null;if(c>e||c==e&&n<0&&!a)return e==r||n<0?i:i+l;i+=l}r=c}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return i}touchesRange(e,n=e){for(let o=0,r=0;o<this.sections.length&&r<=n;){let i=this.sections[o++],s=this.sections[o++],a=r+i;if(s>=0&&r<=n&&a>=e)return r<e&&a>n?"cover":!0;r=a}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let o=this.sections[n++],r=this.sections[n++];e+=(e?" ":"")+o+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new rs(e)}static create(e){return new rs(e)}}class Un extends rs{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return cb(this,(n,o,r,i,s)=>e=e.replace(r,r+(o-n),s),!1),e}mapDesc(e,n=!1){return ub(this,e,n,!0)}invert(e){let n=this.sections.slice(),o=[];for(let r=0,i=0;r<n.length;r+=2){let s=n[r],a=n[r+1];if(a>=0){n[r]=a,n[r+1]=s;let l=r>>1;for(;o.length<l;)o.push(Ut.empty);o.push(s?e.slice(i,i+s):Ut.empty)}i+=s}return new Un(n,o)}compose(e){return this.empty?e:e.empty?this:sM(this,e,!0)}map(e,n=!1){return e.empty?this:ub(this,e,n,!0)}iterChanges(e,n=!1){cb(this,e,n)}get desc(){return rs.create(this.sections)}filter(e){let n=[],o=[],r=[],i=new ff(this);e:for(let s=0,a=0;;){let l=s==e.length?1e9:e[s++];for(;a<l||a==l&&i.len==0;){if(i.done)break e;let u=Math.min(i.len,l-a);bo(r,u,-1);let d=i.ins==-1?-1:i.off==0?i.ins:0;bo(n,u,d),d>0&&Sa(o,n,i.text),i.forward(u),a+=u}let c=e[s++];for(;a<c;){if(i.done)break e;let u=Math.min(i.len,c-a);bo(n,u,-1),bo(r,u,i.ins==-1?-1:i.off==0?i.ins:0),i.forward(u),a+=u}}return{changes:new Un(n,o),filtered:rs.create(r)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let o=this.sections[n],r=this.sections[n+1];r<0?e.push(o):r==0?e.push([o]):e.push([o].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,o){let r=[],i=[],s=0,a=null;function l(u=!1){if(!u&&!r.length)return;s<n&&bo(r,n-s,-1);let d=new Un(r,i);a=a?a.compose(d.map(a)):d,r=[],i=[],s=0}function c(u){if(Array.isArray(u))for(let d of u)c(d);else if(u instanceof Un){if(u.length!=n)throw new RangeError(`Mismatched change set length (got ${u.length}, expected ${n})`);l(),a=a?a.compose(u.map(a)):u}else{let{from:d,to:f=d,insert:h}=u;if(d>f||d<0||f>n)throw new RangeError(`Invalid change range ${d} to ${f} (in doc of length ${n})`);let g=h?typeof h=="string"?Ut.of(h.split(o||lb)):h:Ut.empty,v=g.length;if(d==f&&v==0)return;d<s&&l(),d>s&&bo(r,d-s,-1),bo(r,f-d,v),Sa(i,r,g),s=f}}return c(e),l(!a),a}static empty(e){return new Un(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],o=[];for(let r=0;r<e.length;r++){let i=e[r];if(typeof i=="number")n.push(i,-1);else{if(!Array.isArray(i)||typeof i[0]!="number"||i.some((s,a)=>a&&typeof s!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(i.length==1)n.push(i[0],0);else{for(;o.length<r;)o.push(Ut.empty);o[r]=Ut.of(i.slice(1)),n.push(i[0],o[r].length)}}}return new Un(n,o)}static createSet(e,n){return new Un(e,n)}}function bo(t,e,n,o=!1){if(e==0&&n<=0)return;let r=t.length-2;r>=0&&n<=0&&n==t[r+1]?t[r]+=e:r>=0&&e==0&&t[r]==0?t[r+1]+=n:o?(t[r]+=e,t[r+1]+=n):t.push(e,n)}function Sa(t,e,n){if(n.length==0)return;let o=e.length-2>>1;if(o<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<o;)t.push(Ut.empty);t.push(n)}}function cb(t,e,n){let o=t.inserted;for(let r=0,i=0,s=0;s<t.sections.length;){let a=t.sections[s++],l=t.sections[s++];if(l<0)r+=a,i+=a;else{let c=r,u=i,d=Ut.empty;for(;c+=a,u+=l,l&&o&&(d=d.append(o[s-2>>1])),!(n||s==t.sections.length||t.sections[s+1]<0);)a=t.sections[s++],l=t.sections[s++];e(r,c,i,u,d),r=c,i=u}}}function ub(t,e,n,o=!1){let r=[],i=o?[]:null,s=new ff(t),a=new ff(e);for(let l=-1;;){if(s.done&&a.len||a.done&&s.len)throw new Error("Mismatched change set lengths");if(s.ins==-1&&a.ins==-1){let c=Math.min(s.len,a.len);bo(r,c,-1),s.forward(c),a.forward(c)}else if(a.ins>=0&&(s.ins<0||l==s.i||s.off==0&&(a.len<s.len||a.len==s.len&&!n))){let c=a.len;for(bo(r,a.ins,-1);c;){let u=Math.min(s.len,c);s.ins>=0&&l<s.i&&s.len<=u&&(bo(r,0,s.ins),i&&Sa(i,r,s.text),l=s.i),s.forward(u),c-=u}a.next()}else if(s.ins>=0){let c=0,u=s.len;for(;u;)if(a.ins==-1){let d=Math.min(u,a.len);c+=d,u-=d,a.forward(d)}else if(a.ins==0&&a.len<u)u-=a.len,a.next();else break;bo(r,c,l<s.i?s.ins:0),i&&l<s.i&&Sa(i,r,s.text),l=s.i,s.forward(s.len-u)}else{if(s.done&&a.done)return i?Un.createSet(r,i):rs.create(r);throw new Error("Mismatched change set lengths")}}}function sM(t,e,n=!1){let o=[],r=n?[]:null,i=new ff(t),s=new ff(e);for(let a=!1;;){if(i.done&&s.done)return r?Un.createSet(o,r):rs.create(o);if(i.ins==0)bo(o,i.len,0,a),i.next();else if(s.len==0&&!s.done)bo(o,0,s.ins,a),r&&Sa(r,o,s.text),s.next();else{if(i.done||s.done)throw new Error("Mismatched change set lengths");{let l=Math.min(i.len2,s.len),c=o.length;if(i.ins==-1){let u=s.ins==-1?-1:s.off?0:s.ins;bo(o,l,u,a),r&&u&&Sa(r,o,s.text)}else s.ins==-1?(bo(o,i.off?0:i.len,l,a),r&&Sa(r,o,i.textBit(l))):(bo(o,i.off?0:i.len,s.off?0:s.ins,a),r&&!s.off&&Sa(r,o,s.text));a=(i.ins>l||s.ins>=0&&s.len>l)&&(a||o.length>c),i.forward2(l),s.forward(l)}}}}class ff{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length?Ut.empty:e[n]}textBit(e){let{inserted:n}=this.set,o=this.i-2>>1;return o>=n.length&&!e?Ut.empty:n[o].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class wl{constructor(e,n,o){this.from=e,this.to=n,this.flags=o}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let o,r;return this.empty?o=r=e.mapPos(this.from,n):(o=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),o==this.from&&r==this.to?this:new wl(o,r,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return He.range(e,n);let o=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return He.range(this.anchor,o)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return He.range(e.anchor,e.head)}static create(e,n,o){return new wl(e,n,o)}}class He{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:He.create(this.ranges.map(o=>o.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let o=0;o<this.ranges.length;o++)if(!this.ranges[o].eq(e.ranges[o],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new He([this.main],0)}addRange(e,n=!0){return He.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let o=this.ranges.slice();return o[n]=e,He.create(o,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new He(e.ranges.map(n=>wl.fromJSON(n)),e.main)}static single(e,n=e){return new He([He.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let o=0,r=0;r<e.length;r++){let i=e[r];if(i.empty?i.from<=o:i.from<o)return He.normalized(e.slice(),n);o=i.to}return new He(e,n)}static cursor(e,n=0,o,r){return wl.create(e,e,(n==0?0:n<0?8:16)|(o==null?7:Math.min(6,o))|(r??16777215)<<6)}static range(e,n,o,r){let i=(o??16777215)<<6|(r==null?7:Math.min(6,r));return n<e?wl.create(n,e,48|i):wl.create(e,n,(n>e?8:0)|i)}static normalized(e,n=0){let o=e[n];e.sort((r,i)=>r.from-i.from),n=e.indexOf(o);for(let r=1;r<e.length;r++){let i=e[r],s=e[r-1];if(i.empty?i.from<=s.to:i.from<s.to){let a=s.from,l=Math.max(i.to,s.to);r<=n&&n--,e.splice(--r,2,i.anchor>i.head?He.range(l,a):He.range(a,l))}}return new He(e,n)}}function aM(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let j2=0;class gt{constructor(e,n,o,r,i){this.combine=e,this.compareInput=n,this.compare=o,this.isStatic=r,this.id=j2++,this.default=e([]),this.extensions=typeof i=="function"?i(this):i}get reader(){return this}static define(e={}){return new gt(e.combine||(n=>n),e.compareInput||((n,o)=>n===o),e.compare||(e.combine?(n,o)=>n===o:X2),!!e.static,e.enables)}of(e){return new lp([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new lp(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new lp(e,this,2,n)}from(e,n){return n||(n=o=>o),this.compute([e],o=>n(o.field(e)))}}function X2(t,e){return t==e||t.length==e.length&&t.every((n,o)=>n===e[o])}class lp{constructor(e,n,o,r){this.dependencies=e,this.facet=n,this.type=o,this.value=r,this.id=j2++}dynamicSlot(e){var n;let o=this.value,r=this.facet.compareInput,i=this.id,s=e[i]>>1,a=this.type==2,l=!1,c=!1,u=[];for(let d of this.dependencies)d=="doc"?l=!0:d=="selection"?c=!0:(((n=e[d.id])!==null&&n!==void 0?n:1)&1)==0&&u.push(e[d.id]);return{create(d){return d.values[s]=o(d),1},update(d,f){if(l&&f.docChanged||c&&(f.docChanged||f.selection)||db(d,u)){let h=o(d);if(a?!ok(h,d.values[s],r):!r(h,d.values[s]))return d.values[s]=h,1}return 0},reconfigure:(d,f)=>{let h,g=f.config.address[i];if(g!=null){let v=w0(f,g);if(this.dependencies.every(m=>m instanceof gt?f.facet(m)===d.facet(m):m instanceof tl?f.field(m,!1)==d.field(m,!1):!0)||(a?ok(h=o(d),v,r):r(h=o(d),v)))return d.values[s]=v,0}else h=o(d);return d.values[s]=h,1}}}}function ok(t,e,n){if(t.length!=e.length)return!1;for(let o=0;o<t.length;o++)if(!n(t[o],e[o]))return!1;return!0}function db(t,e){let n=!1;for(let o of e)Ld(t,o)&1&&(n=!0);return n}function dfe(t,e,n){let o=n.map(l=>t[l.id]),r=n.map(l=>l.type),i=o.filter(l=>!(l&1)),s=t[e.id]>>1;function a(l){let c=[];for(let u=0;u<o.length;u++){let d=w0(l,o[u]);if(r[u]==2)for(let f of d)c.push(f);else c.push(d)}return e.combine(c)}return{create(l){for(let c of o)Ld(l,c);return l.values[s]=a(l),1},update(l,c){if(!db(l,i))return 0;let u=a(l);return e.compare(u,l.values[s])?0:(l.values[s]=u,1)},reconfigure(l,c){let u=db(l,o),d=c.config.facets[e.id],f=c.facet(e);if(d&&!u&&X2(n,d))return l.values[s]=f,0;let h=a(l);return e.compare(h,f)?(l.values[s]=f,0):(l.values[s]=h,1)}}}const Ch=gt.define({static:!0});class tl{constructor(e,n,o,r,i){this.id=e,this.createF=n,this.updateF=o,this.compareF=r,this.spec=i,this.provides=void 0}static define(e){let n=new tl(j2++,e.create,e.update,e.compare||((o,r)=>o===r),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(Ch).find(o=>o.field==this);return((n==null?void 0:n.create)||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:o=>(o.values[n]=this.create(o),1),update:(o,r)=>{let i=o.values[n],s=this.updateF(i,r);return this.compareF(i,s)?0:(o.values[n]=s,1)},reconfigure:(o,r)=>{let i=o.facet(Ch),s=r.facet(Ch),a;return(a=i.find(l=>l.field==this))&&a!=s.find(l=>l.field==this)?(o.values[n]=a.create(o),1):r.config.address[this.id]!=null?(o.values[n]=r.field(this),0):(o.values[n]=this.create(o),1)}}}init(e){return[this,Ch.of({field:this,create:e})]}get extension(){return this}}const bl={lowest:4,low:3,default:2,high:1,highest:0};function Qu(t){return e=>new lM(e,t)}const K2={highest:Qu(bl.highest),high:Qu(bl.high),default:Qu(bl.default),low:Qu(bl.low),lowest:Qu(bl.lowest)};class lM{constructor(e,n){this.inner=e,this.prec=n}}class pg{of(e){return new fb(this,e)}reconfigure(e){return pg.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class fb{constructor(e,n){this.compartment=e,this.inner=n}}class x0{constructor(e,n,o,r,i,s){for(this.base=e,this.compartments=n,this.dynamicSlots=o,this.address=r,this.staticValues=i,this.facets=s,this.statusTemplate=[];this.statusTemplate.length<o.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>1]}static resolve(e,n,o){let r=[],i=Object.create(null),s=new Map;for(let f of ffe(e,n,s))f instanceof tl?r.push(f):(i[f.facet.id]||(i[f.facet.id]=[])).push(f);let a=Object.create(null),l=[],c=[];for(let f of r)a[f.id]=c.length<<1,c.push(h=>f.slot(h));let u=o==null?void 0:o.config.facets;for(let f in i){let h=i[f],g=h[0].facet,v=u&&u[f]||[];if(h.every(m=>m.type==0))if(a[g.id]=l.length<<1|1,X2(v,h))l.push(o.facet(g));else{let m=g.combine(h.map(b=>b.value));l.push(o&&g.compare(m,o.facet(g))?o.facet(g):m)}else{for(let m of h)m.type==0?(a[m.id]=l.length<<1|1,l.push(m.value)):(a[m.id]=c.length<<1,c.push(b=>m.dynamicSlot(b)));a[g.id]=c.length<<1,c.push(m=>dfe(m,g,h))}}let d=c.map(f=>f(a));return new x0(e,s,d,a,l,i)}}function ffe(t,e,n){let o=[[],[],[],[],[]],r=new Map;function i(s,a){let l=r.get(s);if(l!=null){if(l<=a)return;let c=o[l].indexOf(s);c>-1&&o[l].splice(c,1),s instanceof fb&&n.delete(s.compartment)}if(r.set(s,a),Array.isArray(s))for(let c of s)i(c,a);else if(s instanceof fb){if(n.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(s.compartment)||s.inner;n.set(s.compartment,c),i(c,a)}else if(s instanceof lM)i(s.inner,s.prec);else if(s instanceof tl)o[a].push(s),s.provides&&i(s.provides,a);else if(s instanceof lp)o[a].push(s),s.facet.extensions&&i(s.facet.extensions,bl.default);else{let c=s.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);i(c,a)}}return i(t,bl.default),o.reduce((s,a)=>s.concat(a))}function Ld(t,e){if(e&1)return 2;let n=e>>1,o=t.status[n];if(o==4)throw new Error("Cyclic dependency between fields and/or facets");if(o&2)return o;t.status[n]=4;let r=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|r}function w0(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const cM=gt.define(),hb=gt.define({combine:t=>t.some(e=>e),static:!0}),uM=gt.define({combine:t=>t.length?t[0]:void 0,static:!0}),dM=gt.define(),fM=gt.define(),hM=gt.define(),pM=gt.define({combine:t=>t.length?t[0]:!1});class nl{constructor(e,n){this.type=e,this.value=n}static define(){return new hfe}}class hfe{of(e){return new nl(this,e)}}class pfe{constructor(e){this.map=e}of(e){return new Tn(this,e)}}class Tn{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new Tn(this.type,n)}is(e){return this.type==e}static define(e={}){return new pfe(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let o=[];for(let r of e){let i=r.map(n);i&&o.push(i)}return o}}Tn.reconfigure=Tn.define();Tn.appendConfig=Tn.define();class qn{constructor(e,n,o,r,i,s){this.startState=e,this.changes=n,this.selection=o,this.effects=r,this.annotations=i,this.scrollIntoView=s,this._doc=null,this._state=null,o&&aM(o,n.newLength),i.some(a=>a.type==qn.time)||(this.annotations=i.concat(qn.time.of(Date.now())))}static create(e,n,o,r,i,s){return new qn(e,n,o,r,i,s)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(qn.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}qn.time=nl.define();qn.userEvent=nl.define();qn.addToHistory=nl.define();qn.remote=nl.define();function mfe(t,e){let n=[];for(let o=0,r=0;;){let i,s;if(o<t.length&&(r==e.length||e[r]>=t[o]))i=t[o++],s=t[o++];else if(r<e.length)i=e[r++],s=e[r++];else return n;!n.length||n[n.length-1]<i?n.push(i,s):n[n.length-1]<s&&(n[n.length-1]=s)}}function mM(t,e,n){var o;let r,i,s;return n?(r=e.changes,i=Un.empty(e.changes.length),s=t.changes.compose(e.changes)):(r=e.changes.map(t.changes),i=t.changes.mapDesc(e.changes,!0),s=t.changes.compose(r)),{changes:s,selection:e.selection?e.selection.map(i):(o=t.selection)===null||o===void 0?void 0:o.map(r),effects:Tn.mapEffects(t.effects,r).concat(Tn.mapEffects(e.effects,i)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function pb(t,e,n){let o=e.selection,r=Vc(e.annotations);return e.userEvent&&(r=r.concat(qn.userEvent.of(e.userEvent))),{changes:e.changes instanceof Un?e.changes:Un.of(e.changes||[],n,t.facet(uM)),selection:o&&(o instanceof He?o:He.single(o.anchor,o.head)),effects:Vc(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function gM(t,e,n){let o=pb(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let i=1;i<e.length;i++){e[i].filter===!1&&(n=!1);let s=!!e[i].sequential;o=mM(o,pb(t,e[i],s?o.changes.newLength:t.doc.length),s)}let r=qn.create(t,o.changes,o.selection,o.effects,o.annotations,o.scrollIntoView);return vfe(n?gfe(r):r)}function gfe(t){let e=t.startState,n=!0;for(let r of e.facet(dM)){let i=r(t);if(i===!1){n=!1;break}Array.isArray(i)&&(n=n===!0?i:mfe(n,i))}if(n!==!0){let r,i;if(n===!1)i=t.changes.invertedDesc,r=Un.empty(e.doc.length);else{let s=t.changes.filter(n);r=s.changes,i=s.filtered.mapDesc(s.changes).invertedDesc}t=qn.create(e,r,t.selection&&t.selection.map(i),Tn.mapEffects(t.effects,i),t.annotations,t.scrollIntoView)}let o=e.facet(fM);for(let r=o.length-1;r>=0;r--){let i=o[r](t);i instanceof qn?t=i:Array.isArray(i)&&i.length==1&&i[0]instanceof qn?t=i[0]:t=gM(e,Vc(i),!1)}return t}function vfe(t){let e=t.startState,n=e.facet(hM),o=t;for(let r=n.length-1;r>=0;r--){let i=n[r](t);i&&Object.keys(i).length&&(o=mM(o,pb(e,i,t.changes.newLength),!0))}return o==t?t:qn.create(e,t.changes,t.selection,o.effects,o.annotations,o.scrollIntoView)}const bfe=[];function Vc(t){return t==null?bfe:Array.isArray(t)?t:[t]}var Is=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(Is||(Is={}));const yfe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let mb;try{mb=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function xfe(t){if(mb)return mb.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||yfe.test(n)))return!0}return!1}function wfe(t){return e=>{if(!/\S/.test(e))return Is.Space;if(xfe(e))return Is.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return Is.Word;return Is.Other}}class Zt{constructor(e,n,o,r,i,s){this.config=e,this.doc=n,this.selection=o,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=i,s&&(s._state=this);for(let a=0;a<this.config.dynamicSlots.length;a++)Ld(this,a<<1);this.computeSlot=null}field(e,n=!0){let o=this.config.address[e.id];if(o==null){if(n)throw new RangeError("Field is not present in this state");return}return Ld(this,o),w0(this,o)}update(...e){return gM(this,e,!0)}applyTransaction(e){let n=this.config,{base:o,compartments:r}=n;for(let a of e.effects)a.is(pg.reconfigure)?(n&&(r=new Map,n.compartments.forEach((l,c)=>r.set(c,l)),n=null),r.set(a.value.compartment,a.value.extension)):a.is(Tn.reconfigure)?(n=null,o=a.value):a.is(Tn.appendConfig)&&(n=null,o=Vc(o).concat(a.value));let i;n?i=e.startState.values.slice():(n=x0.resolve(o,r,this),i=new Zt(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(l,c)=>c.reconfigure(l,this),null).values);let s=e.startState.facet(hb)?e.newSelection:e.newSelection.asSingle();new Zt(n,e.newDoc,s,i,(a,l)=>l.update(a,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:He.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,o=e(n.ranges[0]),r=this.changes(o.changes),i=[o.range],s=Vc(o.effects);for(let a=1;a<n.ranges.length;a++){let l=e(n.ranges[a]),c=this.changes(l.changes),u=c.map(r);for(let f=0;f<a;f++)i[f]=i[f].map(u);let d=r.mapDesc(c,!0);i.push(l.range.map(d)),r=r.compose(u),s=Tn.mapEffects(s,u).concat(Tn.mapEffects(Vc(l.effects),d))}return{changes:r,selection:He.create(i,n.mainIndex),effects:s}}changes(e=[]){return e instanceof Un?e:Un.of(e,this.doc.length,this.facet(Zt.lineSeparator))}toText(e){return Ut.of(e.split(this.facet(Zt.lineSeparator)||lb))}sliceDoc(e=0,n=this.doc.length){return this.doc.sliceString(e,n,this.lineBreak)}facet(e){let n=this.config.address[e.id];return n==null?e.default:(Ld(this,n),w0(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let o in e){let r=e[o];r instanceof tl&&this.config.address[r.id]!=null&&(n[o]=r.spec.toJSON(this.field(e[o]),this))}return n}static fromJSON(e,n={},o){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(o){for(let i in o)if(Object.prototype.hasOwnProperty.call(e,i)){let s=o[i],a=e[i];r.push(s.init(l=>s.spec.fromJSON(a,l)))}}return Zt.create({doc:e.doc,selection:He.fromJSON(e.selection),extensions:n.extensions?r.concat([n.extensions]):r})}static create(e={}){let n=x0.resolve(e.extensions||[],new Map),o=e.doc instanceof Ut?e.doc:Ut.of((e.doc||"").split(n.staticFacet(Zt.lineSeparator)||lb)),r=e.selection?e.selection instanceof He?e.selection:He.single(e.selection.anchor,e.selection.head):He.single(0);return aM(r,o.length),n.staticFacet(hb)||(r=r.asSingle()),new Zt(n,o,r,n.dynamicSlots.map(()=>null),(i,s)=>s.create(i),null)}get tabSize(){return this.facet(Zt.tabSize)}get lineBreak(){return this.facet(Zt.lineSeparator)||`
|
|
853
|
+
`}get readOnly(){return this.facet(pM)}phrase(e,...n){for(let o of this.facet(Zt.phrases))if(Object.prototype.hasOwnProperty.call(o,e)){e=o[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(o,r)=>{if(r=="$")return"$";let i=+(r||1);return!i||i>n.length?o:n[i-1]})),e}languageDataAt(e,n,o=-1){let r=[];for(let i of this.facet(cM))for(let s of i(this,n,o))Object.prototype.hasOwnProperty.call(s,e)&&r.push(s[e]);return r}charCategorizer(e){let n=this.languageDataAt("wordChars",e);return wfe(n.length?n[0]:"")}wordAt(e){let{text:n,from:o,length:r}=this.doc.lineAt(e),i=this.charCategorizer(e),s=e-o,a=e-o;for(;s>0;){let l=Mo(n,s,!1);if(i(n.slice(l,s))!=Is.Word)break;s=l}for(;a<r;){let l=Mo(n,a);if(i(n.slice(a,l))!=Is.Word)break;a=l}return s==a?null:He.range(s+o,a+o)}}Zt.allowMultipleSelections=hb;Zt.tabSize=gt.define({combine:t=>t.length?t[0]:4});Zt.lineSeparator=uM;Zt.readOnly=pM;Zt.phrases=gt.define({compare(t,e){let n=Object.keys(t),o=Object.keys(e);return n.length==o.length&&n.every(r=>t[r]==e[r])}});Zt.languageData=cM;Zt.changeFilter=dM;Zt.transactionFilter=fM;Zt.transactionExtender=hM;pg.reconfigure=Tn.define();function _fe(t,e,n={}){let o={};for(let r of t)for(let i of Object.keys(r)){let s=r[i],a=o[i];if(a===void 0)o[i]=s;else if(!(a===s||s===void 0))if(Object.hasOwnProperty.call(n,i))o[i]=n[i](a,s);else throw new Error("Config merge conflict for field "+i)}for(let r in e)o[r]===void 0&&(o[r]=e[r]);return o}class zl{eq(e){return this==e}range(e,n=e){return gb.create(e,n,this)}}zl.prototype.startSide=zl.prototype.endSide=0;zl.prototype.point=!1;zl.prototype.mapMode=br.TrackDel;function Z2(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let gb=class vM{constructor(e,n,o){this.from=e,this.to=n,this.value=o}static create(e,n,o){return new vM(e,n,o)}};function vb(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class Q2{constructor(e,n,o,r){this.from=e,this.to=n,this.value=o,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,n,o,r=0){let i=o?this.to:this.from;for(let s=r,a=i.length;;){if(s==a)return s;let l=s+a>>1,c=i[l]-e||(o?this.value[l].endSide:this.value[l].startSide)-n;if(l==s)return c>=0?s:a;c>=0?a=l:s=l+1}}between(e,n,o,r){for(let i=this.findIndex(n,-1e9,!0),s=this.findIndex(o,1e9,!1,i);i<s;i++)if(r(this.from[i]+e,this.to[i]+e,this.value[i])===!1)return!1}map(e,n){let o=[],r=[],i=[],s=-1,a=-1;for(let l=0;l<this.value.length;l++){let c=this.value[l],u=this.from[l]+e,d=this.to[l]+e,f,h;if(u==d){let g=n.mapPos(u,c.startSide,c.mapMode);if(g==null||(f=h=g,c.startSide!=c.endSide&&(h=n.mapPos(u,c.endSide),h<f)))continue}else if(f=n.mapPos(u,c.startSide),h=n.mapPos(d,c.endSide),f>h||f==h&&c.startSide>0&&c.endSide<=0)continue;(h-f||c.endSide-c.startSide)<0||(s<0&&(s=f),c.point&&(a=Math.max(a,h-f)),o.push(c),r.push(f-s),i.push(h-s))}return{mapped:o.length?new Q2(r,i,o,a):null,pos:s}}}class tn{constructor(e,n,o,r){this.chunkPos=e,this.chunk=n,this.nextLayer=o,this.maxPoint=r}static create(e,n,o,r){return new tn(e,n,o,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:o=!1,filterFrom:r=0,filterTo:i=this.length}=e,s=e.filter;if(n.length==0&&!s)return this;if(o&&(n=n.slice().sort(vb)),this.isEmpty)return n.length?tn.of(n):this;let a=new bM(this,null,-1).goto(0),l=0,c=[],u=new hf;for(;a.value||l<n.length;)if(l<n.length&&(a.from-n[l].from||a.startSide-n[l].value.startSide)>=0){let d=n[l++];u.addInner(d.from,d.to,d.value)||c.push(d)}else a.rangeIndex==1&&a.chunkIndex<this.chunk.length&&(l==n.length||this.chunkEnd(a.chunkIndex)<n[l].from)&&(!s||r>this.chunkEnd(a.chunkIndex)||i<this.chunkPos[a.chunkIndex])&&u.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!s||r>a.to||i<a.from||s(a.from,a.to,a.value))&&(u.addInner(a.from,a.to,a.value)||c.push(gb.create(a.from,a.to,a.value))),a.next());return u.finishInner(this.nextLayer.isEmpty&&!c.length?tn.empty:this.nextLayer.update({add:c,filter:s,filterFrom:r,filterTo:i}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],o=[],r=-1;for(let s=0;s<this.chunk.length;s++){let a=this.chunkPos[s],l=this.chunk[s],c=e.touchesRange(a,a+l.length);if(c===!1)r=Math.max(r,l.maxPoint),n.push(l),o.push(e.mapPos(a));else if(c===!0){let{mapped:u,pos:d}=l.map(a,e);u&&(r=Math.max(r,u.maxPoint),n.push(u),o.push(d))}}let i=this.nextLayer.map(e);return n.length==0?i:new tn(o,n,i||tn.empty,r)}between(e,n,o){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let i=this.chunkPos[r],s=this.chunk[r];if(n>=i&&e<=i+s.length&&s.between(i,e-i,n-i,o)===!1)return}this.nextLayer.between(e,n,o)}}iter(e=0){return pf.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return pf.from(e).goto(n)}static compare(e,n,o,r,i=-1){let s=e.filter(d=>d.maxPoint>0||!d.isEmpty&&d.maxPoint>=i),a=n.filter(d=>d.maxPoint>0||!d.isEmpty&&d.maxPoint>=i),l=rk(s,a,o),c=new Ju(s,l,i),u=new Ju(a,l,i);o.iterGaps((d,f,h)=>ik(c,d,u,f,h,r)),o.empty&&o.length==0&&ik(c,0,u,0,0,r)}static eq(e,n,o=0,r){r==null&&(r=999999999);let i=e.filter(u=>!u.isEmpty&&n.indexOf(u)<0),s=n.filter(u=>!u.isEmpty&&e.indexOf(u)<0);if(i.length!=s.length)return!1;if(!i.length)return!0;let a=rk(i,s),l=new Ju(i,a,0).goto(o),c=new Ju(s,a,0).goto(o);for(;;){if(l.to!=c.to||!bb(l.active,c.active)||l.point&&(!c.point||!Z2(l.point,c.point)))return!1;if(l.to>r)return!0;l.next(),c.next()}}static spans(e,n,o,r,i=-1){let s=new Ju(e,null,i).goto(n),a=n,l=s.openStart;for(;;){let c=Math.min(s.to,o);if(s.point){let u=s.activeForPoint(s.to),d=s.pointFrom<n?u.length+1:s.point.startSide<0?u.length:Math.min(u.length,l);r.point(a,c,s.point,u,d,s.pointRank),l=Math.min(s.openEnd(c),u.length)}else c>a&&(r.span(a,c,s.active,l),l=s.openEnd(c));if(s.to>o)return l+(s.point&&s.to>o?1:0);a=s.to,s.next()}}static of(e,n=!1){let o=new hf;for(let r of e instanceof gb?[e]:n?kfe(e):e)o.add(r.from,r.to,r.value);return o.finish()}static join(e){if(!e.length)return tn.empty;let n=e[e.length-1];for(let o=e.length-2;o>=0;o--)for(let r=e[o];r!=tn.empty;r=r.nextLayer)n=new tn(r.chunkPos,r.chunk,n,Math.max(r.maxPoint,n.maxPoint));return n}}tn.empty=new tn([],[],null,-1);function kfe(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let o=t[n];if(vb(e,o)>0)return t.slice().sort(vb);e=o}return t}tn.empty.nextLayer=tn.empty;class hf{finishChunk(e){this.chunks.push(new Q2(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,o){this.addInner(e,n,o)||(this.nextLayer||(this.nextLayer=new hf)).add(e,n,o)}addInner(e,n,o){let r=e-this.lastTo||o.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||o.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=o,this.lastFrom=e,this.lastTo=n,this.value.push(o),o.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let o=n.value.length-1;return this.last=n.value[o],this.lastFrom=n.from[o]+e,this.lastTo=n.to[o]+e,!0}finish(){return this.finishInner(tn.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=tn.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function rk(t,e,n){let o=new Map;for(let i of t)for(let s=0;s<i.chunk.length;s++)i.chunk[s].maxPoint<=0&&o.set(i.chunk[s],i.chunkPos[s]);let r=new Set;for(let i of e)for(let s=0;s<i.chunk.length;s++){let a=o.get(i.chunk[s]);a!=null&&(n?n.mapPos(a):a)==i.chunkPos[s]&&!(n!=null&&n.touchesRange(a,a+i.chunk[s].length))&&r.add(i.chunk[s])}return r}class bM{constructor(e,n,o,r=0){this.layer=e,this.skip=n,this.minPoint=o,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,n,!1),this}gotoInner(e,n,o){for(;this.chunkIndex<this.layer.chunk.length;){let r=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(r)||this.layer.chunkEnd(this.chunkIndex)<e||r.maxPoint<this.minPoint))break;this.chunkIndex++,o=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!o||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,n){(this.to-e||this.endSide-n)<0&&this.gotoInner(e,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],o=e+n.from[this.rangeIndex];if(this.from=o,this.to=e+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class pf{constructor(e){this.heap=e}static from(e,n=null,o=-1){let r=[];for(let i=0;i<e.length;i++)for(let s=e[i];!s.isEmpty;s=s.nextLayer)s.maxPoint>=o&&r.push(new bM(s,n,o,i));return r.length==1?r[0]:new pf(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let o of this.heap)o.goto(e,n);for(let o=this.heap.length>>1;o>=0;o--)Bv(this.heap,o);return this.next(),this}forward(e,n){for(let o of this.heap)o.forward(e,n);for(let o=this.heap.length>>1;o>=0;o--)Bv(this.heap,o);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Bv(this.heap,0)}}}function Bv(t,e){for(let n=t[e];;){let o=(e<<1)+1;if(o>=t.length)break;let r=t[o];if(o+1<t.length&&r.compare(t[o+1])>=0&&(r=t[o+1],o++),n.compare(r)<0)break;t[o]=n,t[e]=r,e=o}}class Ju{constructor(e,n,o){this.minPoint=o,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=pf.from(e,n,o)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){$h(this.active,e),$h(this.activeTo,e),$h(this.activeRank,e),this.minActive=sk(this.active,this.activeTo)}addActive(e){let n=0,{value:o,to:r,rank:i}=this.cursor;for(;n<this.activeRank.length&&(i-this.activeRank[n]||r-this.activeTo[n])>0;)n++;Th(this.active,n,o),Th(this.activeTo,n,r),Th(this.activeRank,n,i),e&&Th(e,n,this.cursor.from),this.minActive=sk(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let o=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),o&&$h(o,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let i=this.cursor.value;if(!i.point)this.addActive(o),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=i,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=i.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(o){this.openStart=0;for(let r=o.length-1;r>=0&&o[r]<e;r--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let o=this.active.length-1;o>=0&&!(this.activeRank[o]<this.pointRank);o--)(this.activeTo[o]>e||this.activeTo[o]==e&&this.active[o].endSide>=this.point.endSide)&&n.push(this.active[o]);return n.reverse()}openEnd(e){let n=0;for(let o=this.activeTo.length-1;o>=0&&this.activeTo[o]>e;o--)n++;return n}}function ik(t,e,n,o,r,i){t.goto(e),n.goto(o);let s=o+r,a=o,l=o-e,c=!!i.boundChange;for(let u=!1;;){let d=t.to+l-n.to,f=d||t.endSide-n.endSide,h=f<0?t.to+l:n.to,g=Math.min(h,s);if(t.point||n.point?(t.point&&n.point&&Z2(t.point,n.point)&&bb(t.activeForPoint(t.to),n.activeForPoint(n.to))||i.comparePoint(a,g,t.point,n.point),u=!1):(u&&i.boundChange(a),g>a&&!bb(t.active,n.active)&&i.compareRange(a,g,t.active,n.active),c&&g<s&&(d||t.openEnd(h)!=n.openEnd(h))&&(u=!0)),h>s)break;a=h,f<=0&&t.next(),f>=0&&n.next()}}function bb(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!Z2(t[n],e[n]))return!1;return!0}function $h(t,e){for(let n=e,o=t.length-1;n<o;n++)t[n]=t[n+1];t.pop()}function Th(t,e,n){for(let o=t.length-1;o>=e;o--)t[o+1]=t[o];t[e]=n}function sk(t,e){let n=-1,o=1e9;for(let r=0;r<e.length;r++)(e[r]-o||t[r].endSide-t[n].endSide)<0&&(n=r,o=e[r]);return n}function mg(t,e,n=t.length){let o=0;for(let r=0;r<n&&r<t.length;)t.charCodeAt(r)==9?(o+=e-o%e,r++):(o++,r=Mo(t,r));return o}function Sfe(t,e,n,o){for(let r=0,i=0;;){if(i>=e)return r;if(r==t.length)break;i+=t.charCodeAt(r)==9?n-i%n:1,r=Mo(t,r)}return t.length}const yb="ͼ",ak=typeof Symbol>"u"?"__"+yb:Symbol.for(yb),xb=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),lk=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Va{constructor(e,n){this.rules=[];let{finish:o}=n||{};function r(s){return/^@/.test(s)?[s]:s.split(/,\s*/)}function i(s,a,l,c){let u=[],d=/^@(\w+)\b/.exec(s[0]),f=d&&d[1]=="keyframes";if(d&&a==null)return l.push(s[0]+";");for(let h in a){let g=a[h];if(/&/.test(h))i(h.split(/,\s*/).map(v=>s.map(m=>v.replace(/&/,m))).reduce((v,m)=>v.concat(m)),g,l);else if(g&&typeof g=="object"){if(!d)throw new RangeError("The value of a property ("+h+") should be a primitive value.");i(r(h),g,u,f)}else g!=null&&u.push(h.replace(/_.*/,"").replace(/[A-Z]/g,v=>"-"+v.toLowerCase())+": "+g+";")}(u.length||f)&&l.push((o&&!d&&!c?s.map(o):s).join(", ")+" {"+u.join(" ")+"}")}for(let s in e)i(r(s),e[s],this.rules)}getRules(){return this.rules.join(`
|
|
854
|
+
`)}static newName(){let e=lk[ak]||1;return lk[ak]=e+1,yb+e.toString(36)}static mount(e,n,o){let r=e[xb],i=o&&o.nonce;r?i&&r.setNonce(i):r=new Afe(e,i),r.mount(Array.isArray(n)?n:[n],e)}}let ck=new Map;class Afe{constructor(e,n){let o=e.ownerDocument||e,r=o.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let i=ck.get(o);if(i)return e[xb]=i;this.sheet=new r.CSSStyleSheet,ck.set(o,this)}else this.styleTag=o.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[xb]=this}mount(e,n){let o=this.sheet,r=0,i=0;for(let s=0;s<e.length;s++){let a=e[s],l=this.modules.indexOf(a);if(l<i&&l>-1&&(this.modules.splice(l,1),i--,l=-1),l==-1){if(this.modules.splice(i++,0,a),o)for(let c=0;c<a.rules.length;c++)o.insertRule(a.rules[c],r++)}else{for(;i<l;)r+=this.modules[i++].rules.length;r+=a.rules.length,i++}}if(o)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let s="";for(let l=0;l<this.modules.length;l++)s+=this.modules[l].getRules()+`
|
|
855
|
+
`;this.styleTag.textContent=s;let a=n.head||n;this.styleTag.parentNode!=a&&a.insertBefore(this.styleTag,a.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var za={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},mf={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Cfe=typeof navigator<"u"&&/Mac/.test(navigator.platform),$fe=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var ro=0;ro<10;ro++)za[48+ro]=za[96+ro]=String(ro);for(var ro=1;ro<=24;ro++)za[ro+111]="F"+ro;for(var ro=65;ro<=90;ro++)za[ro]=String.fromCharCode(ro+32),mf[ro]=String.fromCharCode(ro);for(var Lv in za)mf.hasOwnProperty(Lv)||(mf[Lv]=za[Lv]);function Tfe(t){var e=Cfe&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||$fe&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?mf:za)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}let Fo=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},wb=typeof document<"u"?document:{documentElement:{style:{}}};const _b=/Edge\/(\d+)/.exec(Fo.userAgent),yM=/MSIE \d/.test(Fo.userAgent),kb=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Fo.userAgent),gg=!!(yM||kb||_b),uk=!gg&&/gecko\/(\d+)/i.test(Fo.userAgent),Pv=!gg&&/Chrome\/(\d+)/.exec(Fo.userAgent),Mfe="webkitFontSmoothing"in wb.documentElement.style,Sb=!gg&&/Apple Computer/.test(Fo.vendor),dk=Sb&&(/Mobile\/\w+/.test(Fo.userAgent)||Fo.maxTouchPoints>2);var it={mac:dk||/Mac/.test(Fo.platform),windows:/Win/.test(Fo.platform),linux:/Linux|X11/.test(Fo.platform),ie:gg,ie_version:yM?wb.documentMode||6:kb?+kb[1]:_b?+_b[1]:0,gecko:uk,gecko_version:uk?+(/Firefox\/(\d+)/.exec(Fo.userAgent)||[0,0])[1]:0,chrome:!!Pv,chrome_version:Pv?+Pv[1]:0,ios:dk,android:/Android\b/.test(Fo.userAgent),webkit_version:Mfe?+(/\bAppleWebKit\/(\d+)/.exec(Fo.userAgent)||[0,0])[1]:0,safari:Sb,safari_version:Sb?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Fo.userAgent)||[0,0])[1]:0,tabSize:wb.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function J2(t,e){for(let n in t)n=="class"&&e.class?e.class+=" "+t.class:n=="style"&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}const _0=Object.create(null);function ex(t,e,n){if(t==e)return!0;t||(t=_0),e||(e=_0);let o=Object.keys(t),r=Object.keys(e);if(o.length-0!=r.length-0)return!1;for(let i of o)if(i!=n&&(r.indexOf(i)==-1||t[i]!==e[i]))return!1;return!0}function Ofe(t,e){for(let n=t.attributes.length-1;n>=0;n--){let o=t.attributes[n].name;e[o]==null&&t.removeAttribute(o)}for(let n in e){let o=e[n];n=="style"?t.style.cssText=o:t.getAttribute(n)!=o&&t.setAttribute(n,o)}}function fk(t,e,n){let o=!1;if(e)for(let r in e)n&&r in n||(o=!0,r=="style"?t.style.cssText="":t.removeAttribute(r));if(n)for(let r in n)e&&e[r]==n[r]||(o=!0,r=="style"?t.style.cssText=n[r]:t.setAttribute(r,n[r]));return o}function Bfe(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let o=t.attributes[n];e[o.name]=o.value}return e}class vg{eq(e){return!1}updateDOM(e,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,o){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var Ur=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(Ur||(Ur={}));class Xn extends zl{constructor(e,n,o,r){super(),this.startSide=e,this.endSide=n,this.widget=o,this.spec=r}get heightRelevant(){return!1}static mark(e){return new Vf(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),o=!!e.block;return n+=o&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new Hl(e,n,n,o,e.widget||null,!1)}static replace(e){let n=!!e.block,o,r;if(e.isBlockGap)o=-5e8,r=4e8;else{let{start:i,end:s}=xM(e,n);o=(i?n?-3e8:-1:5e8)-1,r=(s?n?2e8:1:-6e8)+1}return new Hl(e,o,r,n,e.widget||null,!0)}static line(e){return new zf(e)}static set(e,n=!1){return tn.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Xn.none=tn.empty;class Vf extends Xn{constructor(e){let{start:n,end:o}=xM(e);super(n?-1:5e8,o?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?J2(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||_0}eq(e){return this==e||e instanceof Vf&&this.tagName==e.tagName&&ex(this.attrs,e.attrs)}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}Vf.prototype.point=!1;class zf extends Xn{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof zf&&this.spec.class==e.spec.class&&ex(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}zf.prototype.mapMode=br.TrackBefore;zf.prototype.point=!0;class Hl extends Xn{constructor(e,n,o,r,i,s){super(n,o,i,e),this.block=r,this.isReplace=s,this.mapMode=r?n<=0?br.TrackBefore:br.TrackAfter:br.TrackDel}get type(){return this.startSide!=this.endSide?Ur.WidgetRange:this.startSide<=0?Ur.WidgetBefore:Ur.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Hl&&Lfe(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}Hl.prototype.point=!0;function xM(t,e=!1){let{inclusiveStart:n,inclusiveEnd:o}=t;return n==null&&(n=t.inclusive),o==null&&(o=t.inclusive),{start:n??e,end:o??e}}function Lfe(t,e){return t==e||!!(t&&e&&t.compare(e))}function zc(t,e,n,o=0){let r=n.length-1;r>=0&&n[r]+o>=t?n[r]=Math.max(n[r],e):n.push(t,e)}class gf extends zl{constructor(e,n){super(),this.tagName=e,this.attributes=n}eq(e){return e==this||e instanceof gf&&this.tagName==e.tagName&&ex(this.attributes,e.attributes)}static create(e){return new gf(e.tagName,e.attributes||_0)}static set(e,n=!1){return tn.of(e,n)}}gf.prototype.startSide=gf.prototype.endSide=-1;function vf(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function Ab(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function Pd(t,e){if(!e.anchorNode)return!1;try{return Ab(t,e.anchorNode)}catch{return!1}}function cp(t){return t.nodeType==3?bf(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function Dd(t,e,n,o){return n?hk(t,e,n,o,-1)||hk(t,e,n,o,1):!1}function Ha(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function k0(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function hk(t,e,n,o,r){for(;;){if(t==n&&e==o)return!0;if(e==(r<0?0:Ks(t))){if(t.nodeName=="DIV")return!1;let i=t.parentNode;if(!i||i.nodeType!=1)return!1;e=Ha(t)+(r<0?0:1),t=i}else if(t.nodeType==1){if(t=t.childNodes[e+(r<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=r<0?Ks(t):0}else return!1}}function Ks(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function S0(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function Pfe(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function wM(t,e){let n=e.width/t.offsetWidth,o=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(o>.995&&o<1.005||!isFinite(o)||Math.abs(e.height-t.offsetHeight)<1)&&(o=1),{scaleX:n,scaleY:o}}function Dfe(t,e,n,o,r,i,s,a){let l=t.ownerDocument,c=l.defaultView||window;for(let u=t,d=!1;u&&!d;)if(u.nodeType==1){let f,h=u==l.body,g=1,v=1;if(h)f=Pfe(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(d=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let y=u.getBoundingClientRect();({scaleX:g,scaleY:v}=wM(u,y)),f={left:y.left,right:y.left+u.clientWidth*g,top:y.top,bottom:y.top+u.clientHeight*v}}let m=0,b=0;if(r=="nearest")e.top<f.top?(b=e.top-(f.top+s),n>0&&e.bottom>f.bottom+b&&(b=e.bottom-f.bottom+s)):e.bottom>f.bottom&&(b=e.bottom-f.bottom+s,n<0&&e.top-b<f.top&&(b=e.top-(f.top+s)));else{let y=e.bottom-e.top,x=f.bottom-f.top;b=(r=="center"&&y<=x?e.top+y/2-x/2:r=="start"||r=="center"&&n<0?e.top-s:e.bottom-x+s)-f.top}if(o=="nearest"?e.left<f.left?(m=e.left-(f.left+i),n>0&&e.right>f.right+m&&(m=e.right-f.right+i)):e.right>f.right&&(m=e.right-f.right+i,n<0&&e.left<f.left+m&&(m=e.left-(f.left+i))):m=(o=="center"?e.left+(e.right-e.left)/2-(f.right-f.left)/2:o=="start"==a?e.left-i:e.right-(f.right-f.left)+i)-f.left,m||b)if(h)c.scrollBy(m,b);else{let y=0,x=0;if(b){let _=u.scrollTop;u.scrollTop+=b/v,x=(u.scrollTop-_)*v}if(m){let _=u.scrollLeft;u.scrollLeft+=m/g,y=(u.scrollLeft-_)*g}e={left:e.left-y,top:e.top-x,right:e.right-y,bottom:e.bottom-x},y&&Math.abs(y-m)<1&&(o="nearest"),x&&Math.abs(x-b)<1&&(r="nearest")}if(h)break;(e.top<f.top||e.bottom>f.bottom||e.left<f.left||e.right>f.right)&&(e={left:Math.max(e.left,f.left),right:Math.min(e.right,f.right),top:Math.max(e.top,f.top),bottom:Math.min(e.bottom,f.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function Efe(t){let e=t.ownerDocument,n,o;for(let r=t.parentNode;r&&!(r==e.body||n&&o);)if(r.nodeType==1)!o&&r.scrollHeight>r.clientHeight&&(o=r),!n&&r.scrollWidth>r.clientWidth&&(n=r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;return{x:n,y:o}}class Ife{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:o}=e;this.set(n,Math.min(e.anchorOffset,n?Ks(n):0),o,Math.min(e.focusOffset,o?Ks(o):0))}set(e,n,o,r){this.anchorNode=e,this.anchorOffset=n,this.focusNode=o,this.focusOffset=r}}let ml=null;it.safari&&it.safari_version>=26&&(ml=!1);function _M(t){if(t.setActive)return t.setActive();if(ml)return t.focus(ml);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(ml==null?{get preventScroll(){return ml={preventScroll:!0},!0}}:void 0),!ml){ml=!1;for(let n=0;n<e.length;){let o=e[n++],r=e[n++],i=e[n++];o.scrollTop!=r&&(o.scrollTop=r),o.scrollLeft!=i&&(o.scrollLeft=i)}}}let pk;function bf(t,e,n=e){let o=pk||(pk=document.createRange());return o.setEnd(t,n),o.setStart(t,e),o}function Hc(t,e,n,o){let r={key:e,code:e,keyCode:n,which:n,cancelable:!0};o&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=o);let i=new KeyboardEvent("keydown",r);i.synthetic=!0,t.dispatchEvent(i);let s=new KeyboardEvent("keyup",r);return s.synthetic=!0,t.dispatchEvent(s),i.defaultPrevented||s.defaultPrevented}function Nfe(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function Rfe(t,e){let n=e.focusNode,o=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=o)return!1;for(o=Math.min(o,Ks(n));;)if(o){if(n.nodeType!=1)return!1;let r=n.childNodes[o-1];r.contentEditable=="false"?o--:(n=r,o=Ks(n))}else{if(n==t)return!0;o=Ha(n),n=n.parentNode}}function kM(t){return t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function SM(t,e){for(let n=t,o=e;;){if(n.nodeType==3&&o>0)return{node:n,offset:o};if(n.nodeType==1&&o>0){if(n.contentEditable=="false")return null;n=n.childNodes[o-1],o=Ks(n)}else if(n.parentNode&&!k0(n))o=Ha(n),n=n.parentNode;else return null}}function AM(t,e){for(let n=t,o=e;;){if(n.nodeType==3&&o<n.nodeValue.length)return{node:n,offset:o};if(n.nodeType==1&&o<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[o],o=0}else if(n.parentNode&&!k0(n))o=Ha(n)+1,n=n.parentNode;else return null}}class ui{constructor(e,n,o=!0){this.node=e,this.offset=n,this.precise=o}static before(e,n){return new ui(e.parentNode,Ha(e),n)}static after(e,n){return new ui(e.parentNode,Ha(e)+1,n)}}var Nn=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(Nn||(Nn={}));const Wl=Nn.LTR,tx=Nn.RTL;function CM(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const Ffe=CM("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),Vfe=CM("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Cb=Object.create(null),Vi=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);Cb[e]=n,Cb[n]=-e}function $M(t){return t<=247?Ffe[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?Vfe[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const zfe=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Ki{get dir(){return this.level%2?tx:Wl}constructor(e,n,o){this.from=e,this.to=n,this.level=o}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,o,r){let i=-1;for(let s=0;s<e.length;s++){let a=e[s];if(a.from<=n&&a.to>=n){if(a.level==o)return s;(i<0||(r!=0?r<0?a.from<n:a.to>n:e[i].level>a.level))&&(i=s)}}if(i<0)throw new RangeError("Index out of range");return i}}function TM(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let o=t[n],r=e[n];if(o.from!=r.from||o.to!=r.to||o.direction!=r.direction||!TM(o.inner,r.inner))return!1}return!0}const sn=[];function Hfe(t,e,n,o,r){for(let i=0;i<=o.length;i++){let s=i?o[i-1].to:e,a=i<o.length?o[i].from:n,l=i?256:r;for(let c=s,u=l,d=l;c<a;c++){let f=$M(t.charCodeAt(c));f==512?f=u:f==8&&d==4&&(f=16),sn[c]=f==4?2:f,f&7&&(d=f),u=f}for(let c=s,u=l,d=l;c<a;c++){let f=sn[c];if(f==128)c<a-1&&u==sn[c+1]&&u&24?f=sn[c]=u:sn[c]=256;else if(f==64){let h=c+1;for(;h<a&&sn[h]==64;)h++;let g=c&&u==8||h<n&&sn[h]==8?d==1?1:8:256;for(let v=c;v<h;v++)sn[v]=g;c=h-1}else f==8&&d==1&&(sn[c]=1);u=f,f&7&&(d=f)}}}function Wfe(t,e,n,o,r){let i=r==1?2:1;for(let s=0,a=0,l=0;s<=o.length;s++){let c=s?o[s-1].to:e,u=s<o.length?o[s].from:n;for(let d=c,f,h,g;d<u;d++)if(h=Cb[f=t.charCodeAt(d)])if(h<0){for(let v=a-3;v>=0;v-=3)if(Vi[v+1]==-h){let m=Vi[v+2],b=m&2?r:m&4?m&1?i:r:0;b&&(sn[d]=sn[Vi[v]]=b),a=v;break}}else{if(Vi.length==189)break;Vi[a++]=d,Vi[a++]=f,Vi[a++]=l}else if((g=sn[d])==2||g==1){let v=g==r;l=v?0:1;for(let m=a-3;m>=0;m-=3){let b=Vi[m+2];if(b&2)break;if(v)Vi[m+2]|=2;else{if(b&4)break;Vi[m+2]|=4}}}}}function Ufe(t,e,n,o){for(let r=0,i=o;r<=n.length;r++){let s=r?n[r-1].to:t,a=r<n.length?n[r].from:e;for(let l=s;l<a;){let c=sn[l];if(c==256){let u=l+1;for(;;)if(u==a){if(r==n.length)break;u=n[r++].to,a=r<n.length?n[r].from:e}else if(sn[u]==256)u++;else break;let d=i==1,f=(u<e?sn[u]:o)==1,h=d==f?d?1:2:o;for(let g=u,v=r,m=v?n[v-1].to:t;g>l;)g==m&&(g=n[--v].from,m=v?n[v-1].to:t),sn[--g]=h;l=u}else i=c,l++}}}function $b(t,e,n,o,r,i,s){let a=o%2?2:1;if(o%2==r%2)for(let l=e,c=0;l<n;){let u=!0,d=!1;if(c==i.length||l<i[c].from){let v=sn[l];v!=a&&(u=!1,d=v==16)}let f=!u&&a==1?[]:null,h=u?o:o+1,g=l;e:for(;;)if(c<i.length&&g==i[c].from){if(d)break e;let v=i[c];if(!u)for(let m=v.to,b=c+1;;){if(m==n)break e;if(b<i.length&&i[b].from==m)m=i[b++].to;else{if(sn[m]==a)break e;break}}if(c++,f)f.push(v);else{v.from>l&&s.push(new Ki(l,v.from,h));let m=v.direction==Wl!=!(h%2);Tb(t,m?o+1:o,r,v.inner,v.from,v.to,s),l=v.to}g=v.to}else{if(g==n||(u?sn[g]!=a:sn[g]==a))break;g++}f?$b(t,l,g,o+1,r,f,s):l<g&&s.push(new Ki(l,g,h)),l=g}else for(let l=n,c=i.length;l>e;){let u=!0,d=!1;if(!c||l>i[c-1].to){let v=sn[l-1];v!=a&&(u=!1,d=v==16)}let f=!u&&a==1?[]:null,h=u?o:o+1,g=l;e:for(;;)if(c&&g==i[c-1].to){if(d)break e;let v=i[--c];if(!u)for(let m=v.from,b=c;;){if(m==e)break e;if(b&&i[b-1].to==m)m=i[--b].from;else{if(sn[m-1]==a)break e;break}}if(f)f.push(v);else{v.to<l&&s.push(new Ki(v.to,l,h));let m=v.direction==Wl!=!(h%2);Tb(t,m?o+1:o,r,v.inner,v.from,v.to,s),l=v.from}g=v.from}else{if(g==e||(u?sn[g-1]!=a:sn[g-1]==a))break;g--}f?$b(t,g,l,o+1,r,f,s):g<l&&s.push(new Ki(g,l,h)),l=g}}function Tb(t,e,n,o,r,i,s){let a=e%2?2:1;Hfe(t,r,i,o,a),Wfe(t,r,i,o,a),Ufe(r,i,o,a),$b(t,r,i,e,n,o,s)}function Gfe(t,e,n){if(!t)return[new Ki(0,0,e==tx?1:0)];if(e==Wl&&!n.length&&!zfe.test(t))return MM(t.length);if(n.length)for(;t.length>sn.length;)sn[sn.length]=256;let o=[],r=e==Wl?0:1;return Tb(t,r,r,n,0,t.length,o),o}function MM(t){return[new Ki(0,t,0)]}let OM="";function qfe(t,e,n,o,r){var i;let s=o.head-t.from,a=Ki.find(e,s,(i=o.bidiLevel)!==null&&i!==void 0?i:-1,o.assoc),l=e[a],c=l.side(r,n);if(s==c){let f=a+=r?1:-1;if(f<0||f>=e.length)return null;l=e[a=f],s=l.side(!r,n),c=l.side(r,n)}let u=Mo(t.text,s,l.forward(r,n));(u<l.from||u>l.to)&&(u=c),OM=t.text.slice(Math.min(s,u),Math.max(s,u));let d=a==(r?e.length-1:0)?null:e[a+(r?1:-1)];return d&&u==c&&d.level+(r?0:1)<l.level?He.cursor(d.side(!r,n)+t.from,d.forward(r,n)?1:-1,d.level):He.cursor(u+t.from,l.forward(r,n)?-1:1,l.level)}function Yfe(t,e,n){for(let o=e;o<n;o++){let r=$M(t.charCodeAt(o));if(r==1)return Wl;if(r==2||r==4)return tx}return Wl}const BM=gt.define(),LM=gt.define(),PM=gt.define(),DM=gt.define(),Mb=gt.define(),EM=gt.define(),IM=gt.define(),nx=gt.define(),ox=gt.define(),NM=gt.define({combine:t=>t.some(e=>e)}),jfe=gt.define({combine:t=>t.some(e=>e)}),RM=gt.define();class Wc{constructor(e,n="nearest",o="nearest",r=5,i=5,s=!1){this.range=e,this.y=n,this.x=o,this.yMargin=r,this.xMargin=i,this.isSnapshot=s}map(e){return e.empty?this:new Wc(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Wc(He.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Mh=Tn.define({map:(t,e)=>t.map(e)}),FM=Tn.define();function Zi(t,e,n){let o=t.facet(DM);o.length?o[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}const Ls=gt.define({combine:t=>t.length?t[0]:!0});let Xfe=0;const $c=gt.define({combine(t){return t.filter((e,n)=>{for(let o=0;o<n;o++)if(t[o].plugin==e.plugin)return!1;return!0})}});class Ul{constructor(e,n,o,r,i){this.id=e,this.create=n,this.domEventHandlers=o,this.domEventObservers=r,this.baseExtensions=i(this),this.extension=this.baseExtensions.concat($c.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat($c.of({plugin:this,arg:e}))}static define(e,n){const{eventHandlers:o,eventObservers:r,provide:i,decorations:s}=n||{};return new Ul(Xfe++,e,o,r,a=>{let l=[];return s&&l.push(bg.of(c=>{let u=c.plugin(a);return u?s(u):Xn.none})),i&&l.push(i(a)),l})}static fromClass(e,n){return Ul.define((o,r)=>new e(o,r),n)}}class Dv{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(o){if(Zi(n.state,o,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){Zi(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(o){Zi(e.state,o,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const VM=gt.define(),rx=gt.define(),bg=gt.define(),zM=gt.define(),ix=gt.define(),Hf=gt.define(),HM=gt.define();function mk(t,e){let n=t.state.facet(HM);if(!n.length)return n;let o=n.map(i=>i instanceof Function?i(t):i),r=[];return tn.spans(o,e.from,e.to,{point(){},span(i,s,a,l){let c=i-e.from,u=s-e.from,d=r;for(let f=a.length-1;f>=0;f--,l--){let h=a[f].spec.bidiIsolate,g;if(h==null&&(h=Yfe(e.text,c,u)),l>0&&d.length&&(g=d[d.length-1]).to==c&&g.direction==h)g.to=u,d=g.inner;else{let v={from:c,to:u,direction:h,inner:[]};d.push(v),d=v.inner}}}}),r}const WM=gt.define();function UM(t){let e=0,n=0,o=0,r=0;for(let i of t.state.facet(WM)){let s=i(t);s&&(s.left!=null&&(e=Math.max(e,s.left)),s.right!=null&&(n=Math.max(n,s.right)),s.top!=null&&(o=Math.max(o,s.top)),s.bottom!=null&&(r=Math.max(r,s.bottom)))}return{left:e,right:n,top:o,bottom:r}}const fd=gt.define();class Fr{constructor(e,n,o,r){this.fromA=e,this.toA=n,this.fromB=o,this.toB=r}join(e){return new Fr(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,o=this;for(;n>0;n--){let r=e[n-1];if(!(r.fromA>o.toA)){if(r.toA<o.fromA)break;o=o.join(r),e.splice(n-1,1)}}return e.splice(n,0,o),e}static extendWithRanges(e,n){if(n.length==0)return e;let o=[];for(let r=0,i=0,s=0;;){let a=r<e.length?e[r].fromB:1e9,l=i<n.length?n[i]:1e9,c=Math.min(a,l);if(c==1e9)break;let u=c+s,d=c,f=u;for(;;)if(i<n.length&&n[i]<=d){let h=n[i+1];i+=2,d=Math.max(d,h);for(let g=r;g<e.length&&e[g].fromB<=d;g++)s=e[g].toA-e[g].toB;f=Math.max(f,h+s)}else if(r<e.length&&e[r].fromB<=d){let h=e[r++];d=Math.max(d,h.toB),f=Math.max(f,h.toA),s=h.toA-h.toB}else break;o.push(new Fr(u,f,c,d))}return o}}class A0{constructor(e,n,o){this.view=e,this.state=n,this.transactions=o,this.flags=0,this.startState=e.state,this.changes=Un.empty(this.startState.doc.length);for(let i of o)this.changes=this.changes.compose(i.changes);let r=[];this.changes.iterChangedRanges((i,s,a,l)=>r.push(new Fr(i,s,a,l))),this.changedRanges=r}static create(e,n,o){return new A0(e,n,o)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const Kfe=[];class Fn{constructor(e,n,o=0){this.dom=e,this.length=n,this.flags=o,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return Kfe}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&Ofe(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,n=this.posAtStart){let o=n;for(let r of this.children){if(r==e)return o;o+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,n){return null}domPosFor(e,n){let o=Ha(this.dom),r=this.length?e>0:n>0;return new ui(this.parent.dom,o+(r?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof xg)return e;return null}static get(e){return e.cmTile}}class yg extends Fn{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let n=this.dom,o=null,r,i=(e==null?void 0:e.node)==n?e:null,s=0;for(let a of this.children){if(a.sync(e),s+=a.length+a.breakAfter,r=o?o.nextSibling:n.firstChild,i&&r!=a.dom&&(i.written=!0),a.dom.parentNode==n)for(;r&&r!=a.dom;)r=gk(r);else n.insertBefore(a.dom,r);o=a.dom}for(r=o?o.nextSibling:n.firstChild,i&&r&&(i.written=!0);r;)r=gk(r);this.length=s}}function gk(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class xg extends yg{constructor(e,n){super(n),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let n=Fn.get(e);if(n&&this.owns(n))return n;e=e.parentNode}}blockTiles(e){for(let n=[],o=this,r=0,i=0;;)if(r==o.children.length){if(!n.length)return;o=o.parent,o.breakAfter&&i++,r=n.pop()}else{let s=o.children[r++];if(s instanceof Hs)n.push(r),o=s,r=0;else{let a=i+s.length,l=e(s,i);if(l!==void 0)return l;i=a+s.breakAfter}}}resolveBlock(e,n){let o,r=-1,i,s=-1;if(this.blockTiles((a,l)=>{let c=l+a.length;if(e>=l&&e<=c){if(a.isWidget()&&n>=-1&&n<=1){if(a.flags&32)return!0;a.flags&16&&(o=void 0)}(l<e||e==c&&(n<-1?a.length:a.covers(1)))&&(!o||!a.isWidget()&&o.isWidget())&&(o=a,r=e-l),(c>e||e==l&&(n>1?a.length:a.covers(-1)))&&(!i||!a.isWidget()&&i.isWidget())&&(i=a,s=e-l)}}),!o&&!i)throw new Error("No tile at position "+e);return o&&n<0||!i?{tile:o,offset:r}:{tile:i,offset:s}}}class Hs extends yg{constructor(e,n){super(e),this.wrapper=n}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,n){let o=new Hs(n||document.createElement(e.tagName),e);return n||(o.flags|=4),o}}class du extends yg{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,o){let r=new du(n||document.createElement("div"),e);return(!n||!o)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(e,n,o){let r=null,i=-1,s=null,a=-1;function l(u,d){for(let f=0,h=0;f<u.children.length&&h<=d;f++){let g=u.children[f],v=h+g.length;v>=d&&(g.isComposite()?l(g,d-h):(!s||s.isHidden&&(n>0||o&&Qfe(s,g)))&&(v>d||g.flags&32)?(s=g,a=d-h):(h<d||g.flags&16&&!g.isHidden)&&(r=g,i=d-h)),h=v}}l(this,e);let c=(n<0?r:s)||r||s;return c?{tile:c,offset:c==r?i:a}:null}coordsIn(e,n){let o=this.resolveInline(e,n,!0);return o?o.tile.coordsIn(Math.max(0,o.offset),n):Zfe(this)}domIn(e,n){let o=this.resolveInline(e,n);if(o){let{tile:r,offset:i}=o;if(this.dom.contains(r.dom))return r.isText()?new ui(r.dom,Math.min(r.dom.nodeValue.length,i)):r.domPosFor(i,r.flags&16?1:r.flags&32?-1:n);let s=o.tile.parent,a=!1;for(let l of s.children){if(a)return new ui(l.dom,0);l==o.tile&&(a=!0)}}return new ui(this.dom,0)}}function Zfe(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=cp(e);return n[n.length-1]||null}function Qfe(t,e){let n=t.coordsIn(0,1),o=e.coordsIn(0,1);return n&&o&&o.top<n.bottom}class nr extends yg{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let o=new nr(n||document.createElement(e.tagName),e);return n||(o.flags|=4),o}}class _l extends Fn{constructor(e,n){super(e,n.length),this.text=n}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,n){let o=this.dom.nodeValue.length;e>o&&(e=o);let r=e,i=e,s=0;e==0&&n<0||e==o&&n>=0?it.chrome||it.gecko||(e?(r--,s=1):i<o&&(i++,s=-1)):n<0?r--:i<o&&i++;let a=bf(this.dom,r,i).getClientRects();if(!a.length)return null;let l=a[(s?s<0:n>=0)?0:a.length-1];return it.safari&&!s&&l.width==0&&(l=Array.prototype.find.call(a,c=>c.width)||l),s?S0(l,s<0):l||null}static of(e,n){let o=new _l(n||document.createTextNode(e),e);return n||(o.flags|=2),o}}class Gl extends Fn{constructor(e,n,o,r){super(e,n,r),this.widget=o}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,n){return this.coordsInWidget(e,n,!1)}coordsInWidget(e,n,o){let r=this.widget.coordsAt(this.dom,e,n);if(r)return r;if(o)return S0(this.dom.getBoundingClientRect(),this.length?e==0:n<=0);{let i=this.dom.getClientRects(),s=null;if(!i.length)return null;let a=this.flags&16?!0:this.flags&32?!1:e>0;for(let l=a?i.length-1:0;s=i[l],!(e>0?l==0:l==i.length-1||s.top<s.bottom);l+=a?-1:1);return S0(s,!a)}}get overrideDOMText(){if(!this.length)return Ut.empty;let{root:e}=this;if(!e)return Ut.empty;let n=this.posAtStart;return e.view.state.doc.slice(n,n+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,n,o,r,i){return i||(i=e.toDOM(n),e.editable||(i.contentEditable="false")),new Gl(i,o,e,r)}}class C0 extends Fn{constructor(e){let n=document.createElement("img");n.className="cm-widgetBuffer",n.setAttribute("aria-hidden","true"),super(n,0,e)}get isHidden(){return!0}get overrideDOMText(){return Ut.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class Jfe{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,n,o){let{tile:r,index:i,beforeBreak:s,parents:a}=this;for(;e||n>0;)if(r.isComposite())if(s){if(!e)break;o&&o.break(),e--,s=!1}else if(i==r.children.length){if(!e&&!a.length)break;o&&o.leave(r),s=!!r.breakAfter,{tile:r,index:i}=a.pop(),i++}else{let l=r.children[i],c=l.breakAfter;(n>0?l.length<=e:l.length<e)&&(!o||o.skip(l,0,l.length)!==!1||!l.isComposite)?(s=!!c,i++,e-=l.length):(a.push({tile:r,index:i}),r=l,i=0,o&&l.isComposite()&&o.enter(l))}else if(i==r.length)s=!!r.breakAfter,{tile:r,index:i}=a.pop(),i++;else if(e){let l=Math.min(e,r.length-i);o&&o.skip(r,i,i+l),e-=l,i+=l}else break;return this.tile=r,this.index=i,this.beforeBreak=s,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class ehe{constructor(e,n,o,r){this.from=e,this.to=n,this.wrapper=o,this.rank=r}}class the{constructor(e,n,o){this.cache=e,this.root=n,this.blockWrappers=o,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,n,o,r){var i;this.flushBuffer();let s=this.ensureMarks(n,o),a=s.lastChild;if(a&&a.isText()&&!(a.flags&8)&&a.length+e.length<512){this.cache.reused.set(a,2);let l=s.children[s.children.length-1]=new _l(a.dom,a.text+e);l.parent=s}else s.append(r||_l.of(e,(i=this.cache.find(_l))===null||i===void 0?void 0:i.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,n){let o=this.curLine;o.dom!=n.line.dom&&(o.setDOM(this.cache.reused.has(n.line)?Ev(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let r=o;for(let a=n.marks.length-1;a>=0;a--){let l=n.marks[a],c=r.lastChild;if(c instanceof nr&&c.mark.eq(l.mark))c.dom!=l.dom&&c.setDOM(Ev(l.dom)),r=c;else{if(this.cache.reused.get(l)){let d=Fn.get(l.dom);d&&d.setDOM(Ev(l.dom))}let u=nr.of(l.mark,l.dom);r.append(u),r=u}this.cache.reused.set(l,2)}let i=Fn.get(e.text);i&&this.cache.reused.set(i,2);let s=new _l(e.text,e.text.nodeValue);s.flags|=8,r.append(s)}addInlineWidget(e,n,o){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let i=this.ensureMarks(n,o);!r&&!(e.flags&16)&&i.append(this.getBuffer(1)),i.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,n,o){this.flushBuffer(),this.ensureMarks(n,o).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let n=this.afterWidget||this.lastBlock;n.length+=e,this.pos+=e}addLineStart(e,n){var o;e||(e=GM);let r=du.start(e,n||((o=this.cache.find(du))===null||o===void 0?void 0:o.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,n){var o;let r=this.curLine;for(let i=e.length-1;i>=0;i--){let s=e[i],a;if(n>0&&(a=r.lastChild)&&a instanceof nr&&a.mark.eq(s))r=a,n--;else{let l=nr.of(s,(o=this.cache.find(nr,c=>c.mark.eq(s)))===null||o===void 0?void 0:o.dom);r.append(l),r=l,n=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!vk(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(it.ios&&vk(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(Iv,0,32)||new Gl(Iv.toDOM(),0,Iv,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let n=new ehe(e.from,e.to,e.value,e.rank),o=this.wrappers.length;for(;o>0&&(this.wrappers[o-1].rank-n.rank||this.wrappers[o-1].to-n.to)<0;)o--;this.wrappers.splice(o,0,n)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let n=this.root;for(let o of this.wrappers){let r=n.lastChild;if(o.from<this.pos&&r instanceof Hs&&r.wrapper.eq(o.wrapper))n=r;else{let i=Hs.of(o.wrapper,(e=this.cache.find(Hs,s=>s.wrapper.eq(o.wrapper)))===null||e===void 0?void 0:e.dom);n.append(i),n=i}}return n}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let n=2|(e<0?16:32),o=this.cache.find(C0,void 0,1);return o&&(o.flags=n),o||new C0(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class nhe{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:r,lineBreak:i,done:s}=this.cursor.next(this.skipCount);if(this.skipCount=0,s)throw new Error("Ran out of text content when drawing inline views");this.text=r;let a=this.textOff=Math.min(e,r.length);return i?null:r.slice(0,a)}let n=Math.min(this.text.length,this.textOff+e),o=this.text.slice(this.textOff,n);return this.textOff=n,o}}const $0=[Gl,du,_l,nr,C0,Hs,xg];for(let t=0;t<$0.length;t++)$0[t].bucket=t;class ohe{constructor(e){this.view=e,this.buckets=$0.map(()=>[]),this.index=$0.map(()=>0),this.reused=new Map}add(e){let n=e.constructor.bucket,o=this.buckets[n];o.length<6?o.push(e):o[this.index[n]=(this.index[n]+1)%6]=e}find(e,n,o=2){let r=e.bucket,i=this.buckets[r],s=this.index[r];for(let a=i.length-1;a>=0;a--){let l=(a+s)%i.length,c=i[l];if((!n||n(c))&&!this.reused.has(c))return i.splice(l,1),l<s&&this.index[r]--,this.reused.set(c,o),c}return null}findWidget(e,n,o){let r=this.buckets[0];if(r.length)for(let i=0,s=0;;i++){if(i==r.length){if(s)return null;s=1,i=0}let a=r[i];if(!this.reused.has(a)&&(s==0?a.widget.compare(e):a.widget.constructor==e.constructor&&e.updateDOM(a.dom,this.view)))return r.splice(i,1),i<this.index[0]&&this.index[0]--,a.widget==e&&a.length==n&&(a.flags&497)==o?(this.reused.set(a,1),a):(this.reused.set(a,2),new Gl(a.dom,n,e,a.flags&-498|o))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,n=2){if(!this.reused.has(e))return this.reused.set(e,n),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class rhe{constructor(e,n,o,r,i){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=i,this.openWidget=!1,this.openMarks=0,this.cache=new ohe(e),this.text=new nhe(e.state.doc),this.builder=new the(this.cache,new xg(e,e.contentDOM),tn.iter(o)),this.cache.reused.set(n,2),this.old=new Jfe(n),this.reuseWalker={skip:(s,a,l)=>{if(this.cache.add(s),s.isComposite())return!1},enter:s=>this.cache.add(s),leave:()=>{},break:()=>{}}}run(e,n){let o=n&&this.getCompositionContext(n.text);for(let r=0,i=0,s=0;;){let a=s<e.length?e[s++]:null,l=a?a.fromA:this.old.root.length;if(l>r){let c=l-r;this.preserve(c,!s,!a),r=l,i+=c}if(!a)break;n&&a.fromA<=n.range.fromA&&a.toA>=n.range.toA?(this.forward(a.fromA,n.range.fromA,n.range.fromA<n.range.toA?1:-1),this.emit(i,n.range.fromB),this.cache.clear(),this.builder.addComposition(n,o),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,a.toA),this.emit(n.range.toB,a.toB)):(this.forward(a.fromA,a.toA),this.emit(i,a.toB)),i=a.toB,r=a.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,n,o){let r=ahe(this.old),i=this.openMarks;this.old.advance(e,o?1:-1,{skip:(s,a,l)=>{if(s.isWidget())if(this.openWidget)this.builder.continueWidget(l-a);else{let c=l>0||a<s.length?Gl.of(s.widget,this.view,l-a,s.flags&496,this.cache.maybeReuse(s)):this.cache.reuse(s);c.flags&256?(c.flags&=-2,this.builder.addBlockWidget(c)):(this.builder.ensureLine(null),this.builder.addInlineWidget(c,r,i),i=r.length)}else if(s.isText())this.builder.ensureLine(null),!a&&l==s.length?this.builder.addText(s.text,r,i,this.cache.reuse(s)):(this.cache.add(s),this.builder.addText(s.text.slice(a,l),r,i)),i=r.length;else if(s.isLine())s.flags&=-2,this.cache.reused.set(s,1),this.builder.addLine(s);else if(s instanceof C0)this.cache.add(s);else if(s instanceof nr)this.builder.ensureLine(null),this.builder.addMark(s,r,i),this.cache.reused.set(s,1),i=r.length;else return!1;this.openWidget=!1},enter:s=>{s.isLine()?this.builder.addLineStart(s.attrs,this.cache.maybeReuse(s)):(this.cache.add(s),s instanceof nr&&r.unshift(s.mark)),this.openWidget=!1},leave:s=>{s.isLine()?r.length&&(r.length=i=0):s instanceof nr&&(r.shift(),i=Math.min(i,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,n){let o=null,r=this.builder,i=0,s=tn.spans(this.decorations,e,n,{point:(a,l,c,u,d,f)=>{if(c instanceof Hl){if(this.disallowBlockEffectsFor[f]){if(c.block)throw new RangeError("Block decorations may not be specified via plugins");if(l>this.view.state.doc.lineAt(a).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(i=u.length,d>u.length)r.continueWidget(l-a);else{let h=c.widget||(c.block?fu.block:fu.inline),g=ihe(c),v=this.cache.findWidget(h,l-a,g)||Gl.of(h,this.view,l-a,g);c.block?(c.startSide>0&&r.addLineStartIfNotCovered(o),r.addBlockWidget(v)):(r.ensureLine(o),r.addInlineWidget(v,u,d))}o=null}else o=she(o,c);l>a&&this.text.skip(l-a)},span:(a,l,c,u)=>{for(let d=a;d<l;){let f=this.text.next(Math.min(512,l-d));f==null?(r.addLineStartIfNotCovered(o),r.addBreak(),d++):(r.ensureLine(o),r.addText(f,c,d==a?u:c.length),d+=f.length),o=null}}});r.addLineStartIfNotCovered(o),this.openWidget=s>i,this.openMarks=s}forward(e,n,o=1){n-e<=10?this.old.advance(n-e,o,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-e-10,-1),this.old.advance(5,o,this.reuseWalker))}getCompositionContext(e){let n=[],o=null;for(let r=e.parentNode;;r=r.parentNode){let i=Fn.get(r);if(r==this.view.contentDOM)break;i instanceof nr?n.push(i):i!=null&&i.isLine()?o=i:i instanceof Hs||(r.nodeName=="DIV"&&!o&&r!=this.view.contentDOM?o=new du(r,GM):o||n.push(nr.of(new Vf({tagName:r.nodeName.toLowerCase(),attributes:Bfe(r)}),r)))}return{line:o,marks:n}}}function vk(t,e){let n=o=>{for(let r of o.children)if((e?r.isText():r.length)||n(r))return!0;return!1};return n(t)}function ihe(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;return t.block&&(e|=256),e}const GM={class:"cm-line"};function she(t,e){let n=e.spec.attributes,o=e.spec.class;return!n&&!o||(t||(t={class:"cm-line"}),n&&J2(n,t),o&&(t.class+=" "+o)),t}function ahe(t){let e=[];for(let n=t.parents.length;n>1;n--){let o=n==t.parents.length?t.tile:t.parents[n].tile;o instanceof nr&&e.push(o.mark)}return e}function Ev(t){let e=Fn.get(t);return e&&e.setDOM(t.cloneNode()),t}class fu extends vg{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}fu.inline=new fu("span");fu.block=new fu("div");const Iv=new class extends vg{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class bk{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Xn.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new xg(e,e.contentDOM),this.updateInner([new Fr(0,0,0,e.state.doc.length)],null)}update(e){var n;let o=e.changedRanges;this.minWidth>0&&o.length&&(o.every(({fromA:u,toA:d})=>d<this.minWidthFrom||u>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?r=this.domChanged.newSel.head:!ghe(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let i=r>-1?che(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:u,to:d}=this.hasComposition;o=new Fr(u,d,e.changes.mapPos(u,-1),e.changes.mapPos(d,1)).addToSet(o.slice())}this.hasComposition=i?{from:i.range.fromB,to:i.range.toB}:null,(it.ie||it.chrome)&&!i&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let s=this.decorations,a=this.blockWrappers;this.updateDeco();let l=fhe(s,this.decorations,e.changes);l.length&&(o=Fr.extendWithRanges(o,l));let c=phe(a,this.blockWrappers,e.changes);return c.length&&(o=Fr.extendWithRanges(o,c)),i&&!o.some(u=>u.fromA<=i.range.fromA&&u.toA>=i.range.toA)&&(o=i.range.addToSet(o.slice())),this.tile.flags&2&&o.length==0?!1:(this.updateInner(o,i),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n){this.view.viewState.mustMeasureContent=!0;let{observer:o}=this.view;o.ignore(()=>{if(n||e.length){let s=this.tile,a=new rhe(this.view,s,this.blockWrappers,this.decorations,this.dynamicDecorationMap);this.tile=a.run(e,n),Ob(s,a.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let i=it.chrome||it.ios?{node:o.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(i),i&&(i.written||o.selectionRange.focusNode!=i.node||!this.tile.dom.contains(i.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let i of this.tile.children)i.isWidget()&&i.widget instanceof Nv&&r.push(i.dom);o.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let o of n.effects)o.is(FM)&&(this.editContextFormatting=o.value)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:o}=this.tile,r=this.view.root.activeElement,i=r==o,s=!i&&!(this.view.state.facet(Ls)||o.tabIndex>-1)&&Pd(o,this.view.observer.selectionRange)&&!(r&&o.contains(r));if(!(i||n||s))return;let a=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,c,u;if(l.empty?u=c=this.inlineDOMNearPos(l.anchor,l.assoc||1):(u=this.inlineDOMNearPos(l.head,l.head==l.from?1:-1),c=this.inlineDOMNearPos(l.anchor,l.anchor==l.from?1:-1)),it.gecko&&l.empty&&!this.hasComposition&&lhe(c)){let f=document.createTextNode("");this.view.observer.ignore(()=>c.node.insertBefore(f,c.node.childNodes[c.offset]||null)),c=u=new ui(f,0),a=!0}let d=this.view.observer.selectionRange;(a||!d.focusNode||(!Dd(c.node,c.offset,d.anchorNode,d.anchorOffset)||!Dd(u.node,u.offset,d.focusNode,d.focusOffset))&&!this.suppressWidgetCursorChange(d,l))&&(this.view.observer.ignore(()=>{it.android&&it.chrome&&o.contains(d.focusNode)&&mhe(d.focusNode,o)&&(o.blur(),o.focus({preventScroll:!0}));let f=vf(this.view.root);if(f)if(l.empty){if(it.gecko){let h=uhe(c.node,c.offset);if(h&&h!=3){let g=(h==1?SM:AM)(c.node,c.offset);g&&(c=new ui(g.node,g.offset))}}f.collapse(c.node,c.offset),l.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=l.bidiLevel)}else if(f.extend){f.collapse(c.node,c.offset);try{f.extend(u.node,u.offset)}catch{}}else{let h=document.createRange();l.anchor>l.head&&([c,u]=[u,c]),h.setEnd(u.node,u.offset),h.setStart(c.node,c.offset),f.removeAllRanges(),f.addRange(h)}s&&this.view.root.activeElement==o&&(o.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(c,u)),this.impreciseAnchor=c.precise?null:new ui(d.anchorNode,d.anchorOffset),this.impreciseHead=u.precise?null:new ui(d.focusNode,d.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&Dd(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,o=vf(e.root),{anchorNode:r,anchorOffset:i}=e.observer.selectionRange;if(!o||!n.empty||!n.assoc||!o.modify)return;let s=this.lineAt(n.head,n.assoc);if(!s)return;let a=s.posAtStart;if(n.head==a||n.head==a+s.length)return;let l=this.coordsAt(n.head,-1),c=this.coordsAt(n.head,1);if(!l||!c||l.bottom>c.top)return;let u=this.domAtPos(n.head+n.assoc,n.assoc);o.collapse(u.node,u.offset),o.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let d=e.observer.selectionRange;e.docView.posFromDOM(d.anchorNode,d.anchorOffset)!=n.from&&o.collapse(r,i)}posFromDOM(e,n){let o=this.tile.nearest(e);if(!o)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=o.posAtStart;if(o.isComposite()){let i;if(e==o.dom)i=o.dom.childNodes[n];else{let s=Ks(e)==0?0:n==0?-1:1;for(;;){let a=e.parentNode;if(a==o.dom)break;s==0&&a.firstChild!=a.lastChild&&(e==a.firstChild?s=-1:s=1),e=a}s<0?i=e:i=e.nextSibling}if(i==o.dom.firstChild)return r;for(;i&&!Fn.get(i);)i=i.nextSibling;if(!i)return r+o.length;for(let s=0,a=r;;s++){let l=o.children[s];if(l.dom==i)return a;a+=l.length+l.breakAfter}}else return o.isText()?e==o.dom?r+n:r+(n?o.length:0):r}domAtPos(e,n){let{tile:o,offset:r}=this.tile.resolveBlock(e,n);return o.isWidget()?o.domPosFor(e,n):o.domIn(r,n)}inlineDOMNearPos(e,n){let o,r=-1,i=!1,s,a=-1,l=!1;return this.tile.blockTiles((c,u)=>{if(c.isWidget()){if(c.flags&32&&u>=e)return!0;c.flags&16&&(i=!0)}else{let d=u+c.length;if(u<=e&&(o=c,r=e-u,i=d<e),d>=e&&!s&&(s=c,a=e-u,l=u>e),u>e&&s)return!0}}),!o&&!s?this.domAtPos(e,n):(i&&s?o=null:l&&o&&(s=null),o&&n<0||!s?o.domIn(r,n):s.domIn(a,n))}coordsAt(e,n){let{tile:o,offset:r}=this.tile.resolveBlock(e,n);return o.isWidget()?o.widget instanceof Nv?null:o.coordsInWidget(r,n,!0):o.coordsIn(r,n)}lineAt(e,n){let{tile:o}=this.tile.resolveBlock(e,n);return o.isLine()?o:null}coordsForChar(e){let{tile:n,offset:o}=this.tile.resolveBlock(e,1);if(!n.isLine())return null;function r(i,s){if(i.isComposite())for(let a of i.children){if(a.length>=s){let l=r(a,s);if(l)return l}if(s-=a.length,s<0)break}else if(i.isText()&&s<i.length){let a=Mo(i.text,s);if(a==s)return null;let l=bf(i.dom,s,a).getClientRects();for(let c=0;c<l.length;c++){let u=l[c];if(c==l.length-1||u.top<u.bottom&&u.left<u.right)return u}}return null}return r(n,o)}measureVisibleLineHeights(e){let n=[],{from:o,to:r}=e,i=this.view.contentDOM.clientWidth,s=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==Nn.LTR,c=0,u=(d,f,h)=>{for(let g=0;g<d.children.length&&!(f>r);g++){let v=d.children[g],m=f+v.length,b=v.dom.getBoundingClientRect(),{height:y}=b;if(h&&!g&&(c+=b.top-h.top),v instanceof Hs)m>o&&u(v,f,b);else if(f>=o&&(c>0&&n.push(-c),n.push(y+c),c=0,s)){let x=v.dom.lastChild,_=x?cp(x):[];if(_.length){let k=_[_.length-1],E=l?k.right-b.left:b.right-k.left;E>a&&(a=E,this.minWidth=i,this.minWidthFrom=f,this.minWidthTo=m)}}h&&g==d.children.length-1&&(c+=h.bottom-b.bottom),f=m+v.breakAfter}};return u(this.tile,0,null),n}textDirectionAt(e){let{tile:n}=this.tile.resolveBlock(e,1);return getComputedStyle(n.dom).direction=="rtl"?Nn.RTL:Nn.LTR}measureTextSize(){let e=this.tile.blockTiles(s=>{if(s.isLine()&&s.children.length&&s.length<=20){let a=0,l;for(let c of s.children){if(!c.isText()||/[^ -~]/.test(c.text))return;let u=cp(c.dom);if(u.length!=1)return;a+=u[0].width,l=u[0].height}if(a)return{lineHeight:s.dom.getBoundingClientRect().height,charWidth:a/s.length,textHeight:l}}});if(e)return e;let n=document.createElement("div"),o,r,i;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let s=cp(n.firstChild)[0];o=n.getBoundingClientRect().height,r=s&&s.width?s.width/27:7,i=s&&s.height?s.height:o,n.remove()}),{lineHeight:o,charWidth:r,textHeight:i}}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let o=0,r=0;;r++){let i=r==n.viewports.length?null:n.viewports[r],s=i?i.from-1:this.view.state.doc.length;if(s>o){let a=(n.lineBlockAt(s).bottom-n.lineBlockAt(o).top)/this.view.scaleY;e.push(Xn.replace({widget:new Nv(a),block:!0,inclusive:!0,isBlockGap:!0}).range(o,s))}if(!i)break;o=i.to+1}return Xn.set(e)}updateDeco(){let e=1,n=this.view.state.facet(bg).map(i=>(this.dynamicDecorationMap[e++]=typeof i=="function")?i(this.view):i),o=!1,r=this.view.state.facet(ix).map((i,s)=>{let a=typeof i=="function";return a&&(o=!0),a?i(this.view):i});for(r.length&&(this.dynamicDecorationMap[e++]=o,n.push(tn.join(r))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(zM).map(i=>typeof i=="function"?i(this.view):i)}scrollIntoView(e){if(e.isSnapshot){let c=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=c.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let c of this.view.state.facet(RM))try{if(c(this.view,e.range,e))return!0}catch(u){Zi(this.view.state,u,"scroll handler")}let{range:n}=e,o=this.coordsAt(n.head,n.empty?n.assoc:n.head>n.anchor?-1:1),r;if(!o)return;!n.empty&&(r=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(o={left:Math.min(o.left,r.left),top:Math.min(o.top,r.top),right:Math.max(o.right,r.right),bottom:Math.max(o.bottom,r.bottom)});let i=UM(this.view),s={left:o.left-i.left,top:o.top-i.top,right:o.right+i.right,bottom:o.bottom+i.bottom},{offsetWidth:a,offsetHeight:l}=this.view.scrollDOM;if(Dfe(this.view.scrollDOM,s,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,a),-a),Math.max(Math.min(e.yMargin,l),-l),this.view.textDirection==Nn.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(o.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||o.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let c=this.view.docView.lineAt(n.head,1);c&&c.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let n=o=>o.isWidget()||o.children.some(n);return n(this.tile.resolveBlock(e,1).tile)}destroy(){Ob(this.tile)}}function Ob(t,e){let n=e==null?void 0:e.get(t);if(n!=1){n==null&&t.destroy();for(let o of t.children)Ob(o,e)}}function lhe(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function qM(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let o=SM(n.focusNode,n.focusOffset),r=AM(n.focusNode,n.focusOffset),i=o||r;if(r&&o&&r.node!=o.node){let a=Fn.get(r.node);if(!a||a.isText()&&a.text!=r.node.nodeValue)i=r;else if(t.docView.lastCompositionAfterCursor){let l=Fn.get(o.node);!l||l.isText()&&l.text!=o.node.nodeValue||(i=r)}}if(t.docView.lastCompositionAfterCursor=i!=o,!i)return null;let s=e-i.offset;return{from:s,to:s+i.node.nodeValue.length,node:i.node}}function che(t,e,n){let o=qM(t,n);if(!o)return null;let{node:r,from:i,to:s}=o,a=r.nodeValue;if(/[\n\r]/.test(a)||t.state.doc.sliceString(o.from,o.to)!=a)return null;let l=e.invertedDesc;return{range:new Fr(l.mapPos(i),l.mapPos(s),i,s),text:r}}function uhe(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}let dhe=class{constructor(){this.changes=[]}compareRange(e,n){zc(e,n,this.changes)}comparePoint(e,n){zc(e,n,this.changes)}boundChange(e){zc(e,e,this.changes)}};function fhe(t,e,n){let o=new dhe;return tn.compare(t,e,n,o),o.changes}class hhe{constructor(){this.changes=[]}compareRange(e,n){zc(e,n,this.changes)}comparePoint(){}boundChange(e){zc(e,e,this.changes)}}function phe(t,e,n){let o=new hhe;return tn.compare(t,e,n,o),o.changes}function mhe(t,e){for(let n=t;n&&n!=e;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function ghe(t,e){let n=!1;return e&&t.iterChangedRanges((o,r)=>{o<e.to&&r>e.from&&(n=!0)}),n}class Nv extends vg{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function vhe(t,e,n=1){let o=t.charCategorizer(e),r=t.doc.lineAt(e),i=e-r.from;if(r.length==0)return He.cursor(e);i==0?n=1:i==r.length&&(n=-1);let s=i,a=i;n<0?s=Mo(r.text,i,!1):a=Mo(r.text,i);let l=o(r.text.slice(s,a));for(;s>0;){let c=Mo(r.text,s,!1);if(o(r.text.slice(c,s))!=l)break;s=c}for(;a<r.length;){let c=Mo(r.text,a);if(o(r.text.slice(a,c))!=l)break;a=c}return He.range(s+r.from,a+r.from)}function bhe(t,e,n,o,r){let i=Math.round((o-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let a=t.viewState.heightOracle.textHeight,l=Math.floor((r-n.top-(t.defaultLineHeight-a)*.5)/a);i+=l*t.viewState.heightOracle.lineLength}let s=t.state.sliceDoc(n.from,n.to);return n.from+Sfe(s,i,t.state.tabSize)}function yhe(t,e,n){let o=t.lineBlockAt(e);if(Array.isArray(o.type)){let r;for(let i of o.type){if(i.from>e)break;if(!(i.to<e)){if(i.from<e&&i.to>e)return i;(!r||i.type==Ur.Text&&(r.type!=i.type||(n<0?i.from<e:i.to>e)))&&(r=i)}}return r||o}return o}function xhe(t,e,n,o){let r=yhe(t,e.head,e.assoc||-1),i=!o||r.type!=Ur.Text||!(t.lineWrapping||r.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(i){let s=t.dom.getBoundingClientRect(),a=t.textDirectionAt(r.from),l=t.posAtCoords({x:n==(a==Nn.LTR)?s.right-1:s.left+1,y:(i.top+i.bottom)/2});if(l!=null)return He.cursor(l,n?-1:1)}return He.cursor(n?r.to:r.from,n?-1:1)}function yk(t,e,n,o){let r=t.state.doc.lineAt(e.head),i=t.bidiSpans(r),s=t.textDirectionAt(r.from);for(let a=e,l=null;;){let c=qfe(r,i,s,a,n),u=OM;if(!c){if(r.number==(n?t.state.doc.lines:1))return a;u=`
|
|
856
|
+
`,r=t.state.doc.line(r.number+(n?1:-1)),i=t.bidiSpans(r),c=t.visualLineSide(r,!n)}if(l){if(!l(u))return a}else{if(!o)return c;l=o(u)}a=c}}function whe(t,e,n){let o=t.state.charCategorizer(e),r=o(n);return i=>{let s=o(i);return r==Is.Space&&(r=s),r==s}}function _he(t,e,n,o){let r=e.head,i=n?1:-1;if(r==(n?t.state.doc.length:0))return He.cursor(r,e.assoc);let s=e.goalColumn,a,l=t.contentDOM.getBoundingClientRect(),c=t.coordsAtPos(r,(e.empty?e.assoc:0)||(n?1:-1)),u=t.documentTop;if(c)s==null&&(s=c.left-l.left),a=i<0?c.top:c.bottom;else{let g=t.viewState.lineBlockAt(r);s==null&&(s=Math.min(l.right-l.left,t.defaultCharacterWidth*(r-g.from))),a=(i<0?g.top:g.bottom)+u}let d=l.left+s,f=o??t.viewState.heightOracle.textHeight>>1,h=Bb(t,{x:d,y:a+f*i},!1,i);return He.cursor(h.pos,h.assoc,void 0,s)}function Ed(t,e,n){for(;;){let o=0;for(let r of t)r.between(e-1,e+1,(i,s,a)=>{if(e>i&&e<s){let l=o||n||(e-i<s-e?-1:1);e=l<0?i:s,o=l}});if(!o)return e}}function YM(t,e){let n=null;for(let o=0;o<e.ranges.length;o++){let r=e.ranges[o],i=null;if(r.empty){let s=Ed(t,r.from,0);s!=r.from&&(i=He.cursor(s,-1))}else{let s=Ed(t,r.from,-1),a=Ed(t,r.to,1);(s!=r.from||a!=r.to)&&(i=He.range(r.from==r.anchor?s:a,r.from==r.head?s:a))}i&&(n||(n=e.ranges.slice()),n[o]=i)}return n?He.create(n,e.mainIndex):e}function Rv(t,e,n){let o=Ed(t.state.facet(Hf).map(r=>r(t)),n.from,e.head>n.from?-1:1);return o==n.from?n:He.cursor(o,o<n.from?1:-1)}class ji{constructor(e,n){this.pos=e,this.assoc=n}}function Bb(t,e,n,o){let r=t.contentDOM.getBoundingClientRect(),i=r.top+t.viewState.paddingTop,{x:s,y:a}=e,l=a-i,c;for(;;){if(l<0)return new ji(0,1);if(l>t.viewState.docHeight)return new ji(t.state.doc.length,-1);if(c=t.elementAtHeight(l),o==null)break;if(c.type==Ur.Text){if(o<0?c.to<t.viewport.from:c.from>t.viewport.to)break;let f=t.docView.coordsAt(o<0?c.from:c.to,o>0?-1:1);if(f&&(o<0?f.top<=l+i:f.bottom>=l+i))break}let d=t.viewState.heightOracle.textHeight/2;l=o>0?c.bottom+d:c.top-d}if(t.viewport.from>=c.to||t.viewport.to<=c.from){if(n)return null;if(c.type==Ur.Text){let d=bhe(t,r,c,s,a);return new ji(d,d==c.from?1:-1)}}if(c.type!=Ur.Text)return l<(c.top+c.bottom)/2?new ji(c.from,1):new ji(c.to,-1);let u=t.docView.lineAt(c.from,2);return(!u||u.length!=c.length)&&(u=t.docView.lineAt(c.from,-2)),new khe(t,s,a,t.textDirectionAt(c.from)).scanTile(u,c.from)}class khe{constructor(e,n,o,r){this.view=e,this.x=n,this.y=o,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,n){let{line:o,spans:r}=this.bidiSpansAt(e);return r[Ki.find(r,e-o.from,-1,n)].level==this.baseDir}dirAt(e,n){let{line:o,spans:r}=this.bidiSpansAt(e);return r[Ki.find(r,e-o.from,-1,n)].dir}bidiIn(e,n){let{spans:o,line:r}=this.bidiSpansAt(e);return o.length>1||o.length&&(o[0].level!=this.baseDir||o[0].to+r.from<n)}scan(e,n){let o=0,r=e.length-1,i=new Set,s=this.bidiIn(e[0],e[r]),a,l,c=-1,u=1e9,d;e:for(;o<r;){let h=r-o,g=o+r>>1;t:if(i.has(g)){let m=o+Math.floor(Math.random()*h);for(let b=0;b<h;b++){if(!i.has(m)){g=m;break t}m++,m==r&&(m=o)}break e}i.add(g);let v=n(g);if(v)for(let m=0;m<v.length;m++){let b=v[m],y=0;if(b.bottom<this.y)(!a||a.bottom<b.bottom)&&(a=b),y=1;else if(b.top>this.y)(!l||l.top>b.top)&&(l=b),y=-1;else{let x=b.left>this.x?this.x-b.left:b.right<this.x?this.x-b.right:0,_=Math.abs(x);_<u&&(c=g,u=_,d=b),x&&(y=x<0==(this.baseDir==Nn.LTR)?-1:1)}y==-1&&(!s||this.baseDirAt(e[g],1))?r=g:y==1&&(!s||this.baseDirAt(e[g+1],-1))&&(o=g+1)}}if(!d){let h=a&&(!l||this.y-a.bottom<l.top-this.y)?a:l;return this.y=(h.top+h.bottom)/2,this.scan(e,n)}let f=(s?this.dirAt(e[c],1):this.baseDir)==Nn.LTR;return{i:c,after:this.x>(d.left+d.right)/2==f}}scanText(e,n){let o=[];for(let i=0;i<e.length;i=Mo(e.text,i))o.push(n+i);o.push(n+e.length);let r=this.scan(o,i=>{let s=o[i]-n,a=o[i+1]-n;return bf(e.dom,s,a).getClientRects()});return r.after?new ji(o[r.i+1],-1):new ji(o[r.i],1)}scanTile(e,n){if(!e.length)return new ji(n,1);if(e.children.length==1){let a=e.children[0];if(a.isText())return this.scanText(a,n);if(a.isComposite())return this.scanTile(a,n)}let o=[n];for(let a=0,l=n;a<e.children.length;a++)o.push(l+=e.children[a].length);let r=this.scan(o,a=>{let l=e.children[a];return l.flags&48?null:(l.dom.nodeType==1?l.dom:bf(l.dom,0,l.length)).getClientRects()}),i=e.children[r.i],s=o[r.i];return i.isText()?this.scanText(i,s):i.isComposite()?this.scanTile(i,s):r.after?new ji(o[r.i+1],-1):new ji(s,1)}}const hd="";class She{constructor(e,n){this.points=e,this.view=n,this.text="",this.lineSeparator=n.state.facet(Zt.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=hd}readRange(e,n){if(!e)return this;let o=e.parentNode;for(let r=e;;){this.findPointBefore(o,r);let i=this.text.length;this.readNode(r);let s=Fn.get(r),a=r.nextSibling;if(a==n){s!=null&&s.breakAfter&&!a&&o!=this.view.contentDOM&&this.lineBreak();break}let l=Fn.get(a);(s&&l?s.breakAfter:(s?s.breakAfter:k0(r))||k0(a)&&(r.nodeName!="BR"||s!=null&&s.isWidget())&&this.text.length>i)&&!Che(a,n)&&this.lineBreak(),r=a}return this.findPointBefore(o,n),this}readTextNode(e){let n=e.nodeValue;for(let o of this.points)o.node==e&&(o.pos=this.text.length+Math.min(o.offset,n.length));for(let o=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,s=1,a;if(this.lineSeparator?(i=n.indexOf(this.lineSeparator,o),s=this.lineSeparator.length):(a=r.exec(n))&&(i=a.index,s=a[0].length),this.append(n.slice(o,i<0?n.length:i)),i<0)break;if(this.lineBreak(),s>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=s-1);o=i+s}}readNode(e){let n=Fn.get(e),o=n&&n.overrideDOMText;if(o!=null){this.findPointInside(e,o.length);for(let r=o.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let o of this.points)o.node==e&&e.childNodes[o.offset]==n&&(o.pos=this.text.length)}findPointInside(e,n){for(let o of this.points)(e.nodeType==3?o.node==e:e.contains(o.node))&&(o.pos=this.text.length+(Ahe(e,o.node,o.offset)?n:0))}}function Ahe(t,e,n){for(;;){if(!e||n<Ks(e))return!1;if(e==t)return!0;n=Ha(e)+1,e=e.parentNode}}function Che(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let o=Fn.get(t);if(!(o!=null&&o.isWidget()))return!1;o&&(n||(n=[])).push(o)}if(n)for(let o of n){let r=o.overrideDOMText;if(r!=null&&r.length)return!1}return!0}class xk{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class $he{constructor(e,n,o,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:i,impreciseAnchor:s}=e.docView;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=jM(e.docView.tile,n,o,0))){let a=i||s?[]:Mhe(e),l=new She(a,e);l.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=l.text,this.newSel=Ohe(a,this.bounds.from)}else{let a=e.observer.selectionRange,l=i&&i.node==a.focusNode&&i.offset==a.focusOffset||!Ab(e.contentDOM,a.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),c=s&&s.node==a.anchorNode&&s.offset==a.anchorOffset||!Ab(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),u=e.viewport;if((it.ios||it.chrome)&&e.state.selection.main.empty&&l!=c&&(u.from>0||u.to<e.state.doc.length)){let d=Math.min(l,c),f=Math.max(l,c),h=u.from-d,g=u.to-f;(h==0||h==1||d==0)&&(g==0||g==-1||f==e.state.doc.length)&&(l=0,c=e.state.doc.length)}e.inputState.composing>-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(He.range(c,l)):this.newSel=He.single(c,l)}}}function jM(t,e,n,o){if(t.isComposite()){let r=-1,i=-1,s=-1,a=-1;for(let l=0,c=o,u=o;l<t.children.length;l++){let d=t.children[l],f=c+d.length;if(c<e&&f>n)return jM(d,e,n,c);if(f>=e&&r==-1&&(r=l,i=c),c>n&&d.dom.parentNode==t.dom){s=l,a=u;break}u=f,c=f+d.breakAfter}return{from:i,to:a<0?o+t.length:a,startDOM:(r?t.children[r-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:s<t.children.length&&s>=0?t.children[s].dom:null}}else return t.isText()?{from:o,to:o+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function XM(t,e){let n,{newSel:o}=e,r=t.state.selection.main,i=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:s,to:a}=e.bounds,l=r.from,c=null;(i===8||it.android&&e.text.length<a-s)&&(l=r.to,c="end");let u=KM(t.state.doc.sliceString(s,a,hd),e.text,l-s,c);u&&(it.chrome&&i==13&&u.toB==u.from+2&&e.text.slice(u.from,u.toB)==hd+hd&&u.toB--,n={from:s+u.from,to:s+u.toA,insert:Ut.of(e.text.slice(u.from,u.toB).split(hd))})}else o&&(!t.hasFocus&&t.state.facet(Ls)||T0(o,r))&&(o=null);if(!n&&!o)return!1;if(!n&&e.typeOver&&!r.empty&&o&&o.main.empty?n={from:r.from,to:r.to,insert:t.state.doc.slice(r.from,r.to)}:(it.mac||it.android)&&n&&n.from==n.to&&n.from==r.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(o&&n.insert.length==2&&(o=He.single(o.main.anchor-1,o.main.head-1)),n={from:n.from,to:n.to,insert:Ut.of([n.insert.toString().replace("."," ")])}):n&&n.from>=r.from&&n.to<=r.to&&(n.from!=r.from||n.to!=r.to)&&r.to-r.from-(n.to-n.from)<=4?n={from:r.from,to:r.to,insert:t.state.doc.slice(r.from,n.from).append(n.insert).append(t.state.doc.slice(n.to,r.to))}:t.state.doc.lineAt(r.from).to<r.to&&t.docView.lineHasWidget(r.to)&&t.inputState.insertingTextAt>Date.now()-50?n={from:r.from,to:r.to,insert:t.state.toText(t.inputState.insertingText)}:it.chrome&&n&&n.from==n.to&&n.from==r.head&&n.insert.toString()==`
|
|
857
|
+
`&&t.lineWrapping&&(o&&(o=He.single(o.main.anchor-1,o.main.head-1)),n={from:r.from,to:r.to,insert:Ut.of([" "])}),n)return sx(t,n,o,i);if(o&&!T0(o,r)){let s=!1,a="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(s=!0),a=t.inputState.lastSelectionOrigin,a=="select.pointer"&&(o=YM(t.state.facet(Hf).map(l=>l(t)),o))),t.dispatch({selection:o,scrollIntoView:s,userEvent:a}),!0}else return!1}function sx(t,e,n,o=-1){if(it.ios&&t.inputState.flushIOSKey(e))return!0;let r=t.state.selection.main;if(it.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&t.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Hc(t.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||o==8&&e.insert.length<e.to-e.from&&e.to>r.head)&&Hc(t.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&Hc(t.contentDOM,"Delete",46)))return!0;let i=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let s,a=()=>s||(s=The(t,e,n));return t.state.facet(EM).some(l=>l(t,e.from,e.to,i,a))||t.dispatch(a()),!0}function The(t,e,n){let o,r=t.state,i=r.selection.main,s=-1;if(e.from==e.to&&e.from<i.from||e.from>i.to){let l=e.from<i.from?-1:1,c=l<0?i.from:i.to,u=Ed(r.facet(Hf).map(d=>d(t)),c,l);e.from==u&&(s=u)}if(s>-1)o={changes:e,selection:He.cursor(e.from+e.insert.length,-1)};else if(e.from>=i.from&&e.to<=i.to&&e.to-e.from>=(i.to-i.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let l=i.from<e.from?r.sliceDoc(i.from,e.from):"",c=i.to>e.to?r.sliceDoc(e.to,i.to):"";o=r.replaceSelection(t.state.toText(l+e.insert.sliceString(0,void 0,t.state.lineBreak)+c))}else{let l=r.changes(e),c=n&&n.main.to<=l.newLength?n.main:void 0;if(r.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=i.to+10&&e.to>=i.to-10){let u=t.state.sliceDoc(e.from,e.to),d,f=n&&qM(t,n.main.head);if(f){let g=e.insert.length-(e.to-e.from);d={from:f.from,to:f.to-g}}else d=t.state.doc.lineAt(i.head);let h=i.to-e.to;o=r.changeByRange(g=>{if(g.from==i.from&&g.to==i.to)return{changes:l,range:c||g.map(l)};let v=g.to-h,m=v-u.length;if(t.state.sliceDoc(m,v)!=u||v>=d.from&&m<=d.to)return{range:g};let b=r.changes({from:m,to:v,insert:e.insert}),y=g.to-i.to;return{changes:b,range:c?He.range(Math.max(0,c.anchor+y),Math.max(0,c.head+y)):g.map(b)}})}else o={changes:l,selection:c&&r.selection.replaceRange(c)}}let a="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,a+=".compose",t.inputState.compositionFirstChange&&(a+=".start",t.inputState.compositionFirstChange=!1)),r.update(o,{userEvent:a,scrollIntoView:!0})}function KM(t,e,n,o){let r=Math.min(t.length,e.length),i=0;for(;i<r&&t.charCodeAt(i)==e.charCodeAt(i);)i++;if(i==r&&t.length==e.length)return null;let s=t.length,a=e.length;for(;s>0&&a>0&&t.charCodeAt(s-1)==e.charCodeAt(a-1);)s--,a--;if(o=="end"){let l=Math.max(0,i-Math.min(s,a));n-=s+l-i}if(s<i&&t.length<e.length){let l=n<=i&&n>=s?i-n:0;i-=l,a=i+(a-s),s=i}else if(a<i){let l=n<=i&&n>=a?i-n:0;i-=l,s=i+(s-a),a=i}return{from:i,toA:s,toB:a}}function Mhe(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:o,focusNode:r,focusOffset:i}=t.observer.selectionRange;return n&&(e.push(new xk(n,o)),(r!=n||i!=o)&&e.push(new xk(r,i))),e}function Ohe(t,e){if(t.length==0)return null;let n=t[0].pos,o=t.length==2?t[1].pos:n;return n>-1&&o>-1?He.single(n+e,o+e):null}function T0(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class Bhe{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,it.safari&&e.contentDOM.addEventListener("input",()=>null),it.gecko&&qhe(e.contentDOM.ownerDocument)}handleEvent(e){!Fhe(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let o=this.handlers[e];if(o){for(let r of o.observers)r(this.view,n);for(let r of o.handlers){if(n.defaultPrevented)break;if(r(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=Lhe(e),o=this.handlers,r=this.view.contentDOM;for(let i in n)if(i!="scroll"){let s=!n[i].handlers.length,a=o[i];a&&s!=!a.handlers.length&&(r.removeEventListener(i,this.handleEvent),a=null),a||r.addEventListener(i,this.handleEvent,{passive:s})}for(let i in o)i!="scroll"&&!n[i]&&r.removeEventListener(i,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&QM.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),it.android&&it.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return it.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((n=ZM.find(o=>o.keyCode==e.keyCode))&&!e.ctrlKey||Phe.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,Hc(this.view.contentDOM,n.key,n.keyCode,n instanceof KeyboardEvent?n:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:it.safari&&!it.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function wk(t,e){return(n,o)=>{try{return e.call(t,o,n)}catch(r){Zi(n.state,r)}}}function Lhe(t){let e=Object.create(null);function n(o){return e[o]||(e[o]={observers:[],handlers:[]})}for(let o of t){let r=o.spec,i=r&&r.plugin.domEventHandlers,s=r&&r.plugin.domEventObservers;if(i)for(let a in i){let l=i[a];l&&n(a).handlers.push(wk(o.value,l))}if(s)for(let a in s){let l=s[a];l&&n(a).observers.push(wk(o.value,l))}}for(let o in Oi)n(o).handlers.push(Oi[o]);for(let o in jr)n(o).observers.push(jr[o]);return e}const ZM=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Phe="dthko",QM=[16,17,18,20,91,92,224,225],Oh=6;function Bh(t){return Math.max(0,t)*.7+8}function Dhe(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class Ehe{constructor(e,n,o,r){this.view=e,this.startEvent=n,this.style=o,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=Efe(e.contentDOM),this.atoms=e.state.facet(Hf).map(s=>s(e));let i=e.contentDOM.ownerDocument;i.addEventListener("mousemove",this.move=this.move.bind(this)),i.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(Zt.allowMultipleSelections)&&Ihe(e,n),this.dragging=Rhe(e,n)&&tO(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Dhe(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,o=0,r=0,i=0,s=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:s}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:i,bottom:a}=this.scrollParents.y.getBoundingClientRect());let l=UM(this.view);e.clientX-l.left<=r+Oh?n=-Bh(r-e.clientX):e.clientX+l.right>=s-Oh&&(n=Bh(e.clientX-s)),e.clientY-l.top<=i+Oh?o=-Bh(i-e.clientY):e.clientY+l.bottom>=a-Oh&&(o=Bh(e.clientY-a)),this.setScrollSpeed(n,o)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,o=YM(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!o.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:o,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Ihe(t,e){let n=t.state.facet(BM);return n.length?n[0](e):it.mac?e.metaKey:e.ctrlKey}function Nhe(t,e){let n=t.state.facet(LM);return n.length?n[0](e):it.mac?!e.altKey:!e.ctrlKey}function Rhe(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let o=vf(t.root);if(!o||o.rangeCount==0)return!0;let r=o.getRangeAt(0).getClientRects();for(let i=0;i<r.length;i++){let s=r[i];if(s.left<=e.clientX&&s.right>=e.clientX&&s.top<=e.clientY&&s.bottom>=e.clientY)return!0}return!1}function Fhe(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,o;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(o=Fn.get(n))&&o.isWidget()&&!o.isHidden&&o.widget.ignoreEvent(e))return!1;return!0}const Oi=Object.create(null),jr=Object.create(null),JM=it.ie&&it.ie_version<15||it.ios&&it.webkit_version<604;function Vhe(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),eO(t,n.value)},50)}function wg(t,e,n){for(let o of t.facet(e))n=o(n,t);return n}function eO(t,e){e=wg(t.state,nx,e);let{state:n}=t,o,r=1,i=n.toText(e),s=i.lines==n.selection.ranges.length;if(Lb!=null&&n.selection.ranges.every(l=>l.empty)&&Lb==i.toString()){let l=-1;o=n.changeByRange(c=>{let u=n.doc.lineAt(c.from);if(u.from==l)return{range:c};l=u.from;let d=n.toText((s?i.line(r++).text:e)+n.lineBreak);return{changes:{from:u.from,insert:d},range:He.cursor(c.from+d.length)}})}else s?o=n.changeByRange(l=>{let c=i.line(r++);return{changes:{from:l.from,to:l.to,insert:c.text},range:He.cursor(l.from+c.length)}}):o=n.replaceSelection(i);t.dispatch(o,{userEvent:"input.paste",scrollIntoView:!0})}jr.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};Oi.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);jr.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};jr.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Oi.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let o of t.state.facet(PM))if(n=o(t,e),n)break;if(!n&&e.button==0&&(n=Hhe(t,e)),n){let o=!t.hasFocus;t.inputState.startMouseSelection(new Ehe(t,e,n,o)),o&&t.observer.ignore(()=>{_M(t.contentDOM);let i=t.root.activeElement;i&&!i.contains(t.contentDOM)&&i.blur()});let r=t.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function _k(t,e,n,o){if(o==1)return He.cursor(e,n);if(o==2)return vhe(t.state,e,n);{let r=t.docView.lineAt(e,n),i=t.state.doc.lineAt(r?r.posAtEnd:e),s=r?r.posAtStart:i.from,a=r?r.posAtEnd:i.to;return a<t.state.doc.length&&a==i.to&&a++,He.range(s,a)}}const zhe=it.ie&&it.ie_version<=11;let kk=null,Sk=0,Ak=0;function tO(t){if(!zhe)return t.detail;let e=kk,n=Ak;return kk=t,Ak=Date.now(),Sk=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(Sk+1)%3:1}function Hhe(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),o=tO(e),r=t.state.selection;return{update(i){i.docChanged&&(n.pos=i.changes.mapPos(n.pos),r=r.map(i.changes))},get(i,s,a){let l=t.posAndSideAtCoords({x:i.clientX,y:i.clientY},!1),c,u=_k(t,l.pos,l.assoc,o);if(n.pos!=l.pos&&!s){let d=_k(t,n.pos,n.assoc,o),f=Math.min(d.from,u.from),h=Math.max(d.to,u.to);u=f<u.from?He.range(f,h):He.range(h,f)}return s?r.replaceRange(r.main.extend(u.from,u.to)):a&&o==1&&r.ranges.length>1&&(c=Whe(r,l.pos))?c:a?r.addRange(u):He.create([u])}}}function Whe(t,e){for(let n=0;n<t.ranges.length;n++){let{from:o,to:r}=t.ranges[n];if(o<=e&&r>=e)return He.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}Oi.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let r=t.docView.tile.nearest(e.target);if(r&&r.isWidget()){let i=r.posAtStart,s=i+r.length;(i>=n.to||s<=n.from)&&(n=He.range(i,s))}}let{inputState:o}=t;return o.mouseSelection&&(o.mouseSelection.dragging=!0),o.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",wg(t.state,ox,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Oi.dragend=t=>(t.inputState.draggedContent=null,!1);function Ck(t,e,n,o){if(n=wg(t.state,nx,n),!n)return;let r=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:i}=t.inputState,s=o&&i&&Nhe(t,e)?{from:i.from,to:i.to}:null,a={from:r,insert:n},l=t.state.changes(s?[s,a]:a);t.focus(),t.dispatch({changes:l,selection:{anchor:l.mapPos(r,-1),head:l.mapPos(r,1)},userEvent:s?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Oi.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let o=Array(n.length),r=0,i=()=>{++r==n.length&&Ck(t,e,o.filter(s=>s!=null).join(t.state.lineBreak),!1)};for(let s=0;s<n.length;s++){let a=new FileReader;a.onerror=i,a.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(o[s]=a.result),i()},a.readAsText(n[s])}return!0}else{let o=e.dataTransfer.getData("Text");if(o)return Ck(t,e,o,!0),!0}return!1};Oi.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=JM?null:e.clipboardData;return n?(eO(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(Vhe(t),!1)};function Uhe(t,e){let n=t.dom.parentNode;if(!n)return;let o=n.appendChild(document.createElement("textarea"));o.style.cssText="position: fixed; left: -10000px; top: 10px",o.value=e,o.focus(),o.selectionEnd=e.length,o.selectionStart=0,setTimeout(()=>{o.remove(),t.focus()},50)}function Ghe(t){let e=[],n=[],o=!1;for(let r of t.selection.ranges)r.empty||(e.push(t.sliceDoc(r.from,r.to)),n.push(r));if(!e.length){let r=-1;for(let{from:i}of t.selection.ranges){let s=t.doc.lineAt(i);s.number>r&&(e.push(s.text),n.push({from:s.from,to:Math.min(t.doc.length,s.to+1)})),r=s.number}o=!0}return{text:wg(t,ox,e.join(t.lineBreak)),ranges:n,linewise:o}}let Lb=null;Oi.copy=Oi.cut=(t,e)=>{if(!Pd(t.contentDOM,t.observer.selectionRange))return!1;let{text:n,ranges:o,linewise:r}=Ghe(t.state);if(!n&&!r)return!1;Lb=r?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:o,scrollIntoView:!0,userEvent:"delete.cut"});let i=JM?null:e.clipboardData;return i?(i.clearData(),i.setData("text/plain",n),!0):(Uhe(t,n),!1)};const nO=nl.define();function oO(t,e){let n=[];for(let o of t.facet(IM)){let r=o(t,e);r&&n.push(r)}return n.length?t.update({effects:n,annotations:nO.of(!0)}):null}function rO(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=oO(t.state,e);n?t.dispatch(n):t.update([])}},10)}jr.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),rO(t)};jr.blur=t=>{t.observer.clearSelectionRange(),rO(t)};jr.compositionstart=jr.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};jr.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,it.chrome&&it.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};jr.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};Oi.beforeinput=(t,e)=>{var n,o;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let i=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),s=e.getTargetRanges();if(i&&s.length){let a=s[0],l=t.posAtDOM(a.startContainer,a.startOffset),c=t.posAtDOM(a.endContainer,a.endOffset);return sx(t,{from:l,to:c,insert:t.state.toText(i)},null),!0}}let r;if(it.chrome&&it.android&&(r=ZM.find(i=>i.inputType==e.inputType))&&(t.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let i=((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0;setTimeout(()=>{var s;(((s=window.visualViewport)===null||s===void 0?void 0:s.height)||0)>i+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return it.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),it.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>jr.compositionend(t,e),20),!1};const $k=new Set;function qhe(t){$k.has(t)||($k.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const Tk=["pre-wrap","normal","pre-line","break-spaces"];let hu=!1;function Mk(){hu=!1}class Yhe{constructor(e){this.lineWrapping=e,this.doc=Ut.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let o=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(o+=Math.max(0,Math.ceil((n-e-o*this.lineLength*.5)/this.lineLength))),this.lineHeight*o}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Tk.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let o=0;o<e.length;o++){let r=e[o];r<0?o++:this.heightSamples[Math.floor(r*10)]||(n=!0,this.heightSamples[Math.floor(r*10)]=!0)}return n}refresh(e,n,o,r,i,s){let a=Tk.indexOf(e)>-1,l=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=a||Math.abs(o-this.charWidth)>.1;if(this.lineWrapping=a,this.lineHeight=n,this.charWidth=o,this.textHeight=r,this.lineLength=i,l){this.heightSamples={};for(let c=0;c<s.length;c++){let u=s[c];u<0?c++:this.heightSamples[Math.floor(u*10)]=!0}}return l}}class jhe{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class si{constructor(e,n,o,r,i){this.from=e,this.length=n,this.top=o,this.height=r,this._content=i}get type(){return typeof this._content=="number"?Ur.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof Hl?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new si(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var un=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(un||(un={}));const up=.001;class Uo{constructor(e,n,o=2){this.length=e,this.height=n,this.flags=o}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>up&&(hu=!0),this.height=e)}replace(e,n,o){return Uo.of(o)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,o,r){let i=this,s=o.doc;for(let a=r.length-1;a>=0;a--){let{fromA:l,toA:c,fromB:u,toB:d}=r[a],f=i.lineAt(l,un.ByPosNoHeight,o.setDoc(n),0,0),h=f.to>=c?f:i.lineAt(c,un.ByPosNoHeight,o,0,0);for(d+=h.to-c,c=h.to;a>0&&f.from<=r[a-1].toA;)l=r[a-1].fromA,u=r[a-1].fromB,a--,l<f.from&&(f=i.lineAt(l,un.ByPosNoHeight,o,0,0));u+=f.from-l,l=f.from;let g=ax.build(o.setDoc(s),e,u,d);i=M0(i,i.replace(l,c,g))}return i.updateHeight(o,0)}static empty(){return new gr(0,0,0)}static of(e){if(e.length==1)return e[0];let n=0,o=e.length,r=0,i=0;for(;;)if(n==o)if(r>i*2){let a=e[n-1];a.break?e.splice(--n,1,a.left,null,a.right):e.splice(--n,1,a.left,a.right),o+=1+a.break,r-=a.size}else if(i>r*2){let a=e[o];a.break?e.splice(o,1,a.left,null,a.right):e.splice(o,1,a.left,a.right),o+=2+a.break,i-=a.size}else break;else if(r<i){let a=e[n++];a&&(r+=a.size)}else{let a=e[--o];a&&(i+=a.size)}let s=0;return e[n-1]==null?(s=1,n--):e[n]==null&&(s=1,o++),new Khe(Uo.of(e.slice(0,n)),s,Uo.of(e.slice(o)))}}function M0(t,e){return t==e?t:(t.constructor!=e.constructor&&(hu=!0),e)}Uo.prototype.size=1;const Xhe=Xn.replace({});class iO extends Uo{constructor(e,n,o){super(e,n),this.deco=o,this.spaceAbove=0}mainBlock(e,n){return new si(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,n,o,r){return this.spaceAbove&&e<o+this.spaceAbove?new si(r,0,o,this.spaceAbove,Xhe):this.mainBlock(o,r)}lineAt(e,n,o,r,i){let s=this.mainBlock(r,i);return this.spaceAbove?this.blockAt(0,o,r,i).join(s):s}forEachLine(e,n,o,r,i,s){e<=i+this.length&&n>=i&&s(this.lineAt(0,un.ByPos,o,r,i))}setMeasuredHeight(e){let n=e.heights[e.index++];n<0?(this.spaceAbove=-n,n=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(e,n=0,o=!1,r){return r&&r.from<=n&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class gr extends iO{constructor(e,n,o){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=o}mainBlock(e,n){return new si(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,n,o){let r=o[0];return o.length==1&&(r instanceof gr||r instanceof no&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof no?r=new gr(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):Uo.of(o)}updateHeight(e,n=0,o=!1,r){return r&&r.from<=n&&r.more?this.setMeasuredHeight(r):(o||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class no extends Uo{constructor(e){super(e,0)}heightMetrics(e,n){let o=e.doc.lineAt(n).number,r=e.doc.lineAt(n+this.length).number,i=r-o+1,s,a=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*i);s=l/i,this.length>i+1&&(a=(this.height-l)/(this.length-i-1))}else s=this.height/i;return{firstLine:o,lastLine:r,perLine:s,perChar:a}}blockAt(e,n,o,r){let{firstLine:i,lastLine:s,perLine:a,perChar:l}=this.heightMetrics(n,r);if(n.lineWrapping){let c=r+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-o)/this.height))*this.length)),u=n.doc.lineAt(c),d=a+u.length*l,f=Math.max(o,e-d/2);return new si(u.from,u.length,f,d,0)}else{let c=Math.max(0,Math.min(s-i,Math.floor((e-o)/a))),{from:u,length:d}=n.doc.line(i+c);return new si(u,d,o+a*c,a,0)}}lineAt(e,n,o,r,i){if(n==un.ByHeight)return this.blockAt(e,o,r,i);if(n==un.ByPosNoHeight){let{from:h,to:g}=o.doc.lineAt(e);return new si(h,g-h,0,0,0)}let{firstLine:s,perLine:a,perChar:l}=this.heightMetrics(o,i),c=o.doc.lineAt(e),u=a+c.length*l,d=c.number-s,f=r+a*d+l*(c.from-i-d);return new si(c.from,c.length,Math.max(r,Math.min(f,r+this.height-u)),u,0)}forEachLine(e,n,o,r,i,s){e=Math.max(e,i),n=Math.min(n,i+this.length);let{firstLine:a,perLine:l,perChar:c}=this.heightMetrics(o,i);for(let u=e,d=r;u<=n;){let f=o.doc.lineAt(u);if(u==e){let g=f.number-a;d+=l*g+c*(e-i-g)}let h=l+c*f.length;s(new si(f.from,f.length,d,h,0)),d+=h,u=f.to+1}}replace(e,n,o){let r=this.length-n;if(r>0){let i=o[o.length-1];i instanceof no?o[o.length-1]=new no(i.length+r):o.push(null,new no(r-1))}if(e>0){let i=o[0];i instanceof no?o[0]=new no(e+i.length):o.unshift(new no(e-1),null)}return Uo.of(o)}decomposeLeft(e,n){n.push(new no(e-1),null)}decomposeRight(e,n){n.push(null,new no(this.length-e-1))}updateHeight(e,n=0,o=!1,r){let i=n+this.length;if(r&&r.from<=n+this.length&&r.more){let s=[],a=Math.max(n,r.from),l=-1;for(r.from>n&&s.push(new no(r.from-n-1).updateHeight(e,n));a<=i&&r.more;){let u=e.doc.lineAt(a).length;s.length&&s.push(null);let d=r.heights[r.index++],f=0;d<0&&(f=-d,d=r.heights[r.index++]),l==-1?l=d:Math.abs(d-l)>=up&&(l=-2);let h=new gr(u,d,f);h.outdated=!1,s.push(h),a+=u+1}a<=i&&s.push(null,new no(i-a).updateHeight(e,a));let c=Uo.of(s);return(l<0||Math.abs(c.height-this.height)>=up||Math.abs(l-this.heightMetrics(e,n).perLine)>=up)&&(hu=!0),M0(this,c)}else(o||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class Khe extends Uo{constructor(e,n,o){super(e.length+n+o.length,e.height+o.height,n|(e.outdated||o.outdated?2:0)),this.left=e,this.right=o,this.size=e.size+o.size}get break(){return this.flags&1}blockAt(e,n,o,r){let i=o+this.left.height;return e<i?this.left.blockAt(e,n,o,r):this.right.blockAt(e,n,i,r+this.left.length+this.break)}lineAt(e,n,o,r,i){let s=r+this.left.height,a=i+this.left.length+this.break,l=n==un.ByHeight?e<s:e<a,c=l?this.left.lineAt(e,n,o,r,i):this.right.lineAt(e,n,o,s,a);if(this.break||(l?c.to<a:c.from>a))return c;let u=n==un.ByPosNoHeight?un.ByPosNoHeight:un.ByPos;return l?c.join(this.right.lineAt(a,u,o,s,a)):this.left.lineAt(a,u,o,r,i).join(c)}forEachLine(e,n,o,r,i,s){let a=r+this.left.height,l=i+this.left.length+this.break;if(this.break)e<l&&this.left.forEachLine(e,n,o,r,i,s),n>=l&&this.right.forEachLine(e,n,o,a,l,s);else{let c=this.lineAt(l,un.ByPos,o,r,i);e<c.from&&this.left.forEachLine(e,c.from-1,o,r,i,s),c.to>=e&&c.from<=n&&s(c),n>c.to&&this.right.forEachLine(c.to+1,n,o,a,l,s)}}replace(e,n,o){let r=this.left.length+this.break;if(n<r)return this.balanced(this.left.replace(e,n,o),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,n-r,o));let i=[];e>0&&this.decomposeLeft(e,i);let s=i.length;for(let a of o)i.push(a);if(e>0&&Ok(i,s-1),n<this.length){let a=i.length;this.decomposeRight(n,i),Ok(i,a)}return Uo.of(i)}decomposeLeft(e,n){let o=this.left.length;if(e<=o)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(o++,e>=o&&n.push(null)),e>o&&this.right.decomposeLeft(e-o,n)}decomposeRight(e,n){let o=this.left.length,r=o+this.break;if(e>=r)return this.right.decomposeRight(e-r,n);e<o&&this.left.decomposeRight(e,n),this.break&&e<r&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?Uo.of(this.break?[e,null,n]:[e,n]):(this.left=M0(this.left,e),this.right=M0(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,o=!1,r){let{left:i,right:s}=this,a=n+i.length+this.break,l=null;return r&&r.from<=n+i.length&&r.more?l=i=i.updateHeight(e,n,o,r):i.updateHeight(e,n,o),r&&r.from<=a+s.length&&r.more?l=s=s.updateHeight(e,a,o,r):s.updateHeight(e,a,o),l?this.balanced(i,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Ok(t,e){let n,o;t[e]==null&&(n=t[e-1])instanceof no&&(o=t[e+1])instanceof no&&t.splice(e-1,3,new no(n.length+1+o.length))}const Zhe=5;class ax{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let o=Math.min(n,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof gr?r.length+=o-this.pos:(o>this.pos||!this.isCovered)&&this.nodes.push(new gr(o-this.pos,-1,0)),this.writtenTo=o,n>o&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,o){if(e<n||o.heightRelevant){let r=o.widget?o.widget.estimatedHeight:0,i=o.widget?o.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let s=n-e;o.block?this.addBlock(new iO(s,r,o)):(s||i||r>=Zhe)&&this.addLineDeco(r,i,s)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new gr(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let o=new no(n-e);return this.oracle.doc.lineAt(e).to==n&&(o.flags|=4),o}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof gr)return e;let n=new gr(0,-1,0);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,o){let r=this.ensureLine();r.length+=o,r.collapsed+=o,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=n,this.writtenTo=this.pos=this.pos+o}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof gr)&&!this.isCovered?this.nodes.push(new gr(0,-1,0)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let o=e;for(let r of this.nodes)r instanceof gr&&r.updateHeight(this.oracle,o),o+=r?r.length:1;return this.nodes}static build(e,n,o,r){let i=new ax(o,e);return tn.spans(n,o,r,i,0),i.finish(o)}}function Qhe(t,e,n){let o=new Jhe;return tn.compare(t,e,n,o,0),o.changes}class Jhe{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,o,r){(e<n||o&&o.heightRelevant||r&&r.heightRelevant)&&zc(e,n,this.changes,5)}}function epe(t,e){let n=t.getBoundingClientRect(),o=t.ownerDocument,r=o.defaultView||window,i=Math.max(0,n.left),s=Math.min(r.innerWidth,n.right),a=Math.max(0,n.top),l=Math.min(r.innerHeight,n.bottom);for(let c=t.parentNode;c&&c!=o.body;)if(c.nodeType==1){let u=c,d=window.getComputedStyle(u);if((u.scrollHeight>u.clientHeight||u.scrollWidth>u.clientWidth)&&d.overflow!="visible"){let f=u.getBoundingClientRect();i=Math.max(i,f.left),s=Math.min(s,f.right),a=Math.max(a,f.top),l=Math.min(c==t.parentNode?r.innerHeight:l,f.bottom)}c=d.position=="absolute"||d.position=="fixed"?u.offsetParent:u.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:i-n.left,right:Math.max(i,s)-n.left,top:a-(n.top+e),bottom:Math.max(a,l)-(n.top+e)}}function tpe(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left<n.innerWidth&&e.right>0&&e.top<n.innerHeight&&e.bottom>0}function npe(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class Fv{constructor(e,n,o,r){this.from=e,this.to=n,this.size=o,this.displaySize=r}static same(e,n){if(e.length!=n.length)return!1;for(let o=0;o<e.length;o++){let r=e[o],i=n[o];if(r.from!=i.from||r.to!=i.to||r.size!=i.size)return!1}return!0}draw(e,n){return Xn.replace({widget:new ope(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class ope extends vg{constructor(e,n){super(),this.size=e,this.vertical=n}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class Bk{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=Lk,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Nn.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=e.facet(rx).some(o=>typeof o!="function"&&o.class=="cm-lineWrapping");this.heightOracle=new Yhe(n),this.stateDeco=Pk(e),this.heightMap=Uo.empty().applyChanges(this.stateDeco,Ut.empty,this.heightOracle.setDoc(e.doc),[new Fr(0,0,0,e.doc.length)]);for(let o=0;o<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());o++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Xn.set(this.lineGaps.map(o=>o.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let o=0;o<=1;o++){let r=o?n.head:n.anchor;if(!e.some(({from:i,to:s})=>r>=i&&r<=s)){let{from:i,to:s}=this.lineBlockAt(r);e.push(new Lh(i,s))}}return this.viewports=e.sort((o,r)=>o.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Lk:new lx(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(pd(e,this.scaler))})}update(e,n=null){this.state=e.state;let o=this.stateDeco;this.stateDeco=Pk(this.state);let r=e.changedRanges,i=Fr.extendWithRanges(r,Qhe(o,this.stateDeco,e?e.changes:Un.empty(this.state.doc.length))),s=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);Mk(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),i),(this.heightMap.height!=s||hu)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=s);let l=i.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.head<l.from||n.range.head>l.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,n));let c=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(jfe)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,o=window.getComputedStyle(n),r=this.heightOracle,i=o.whiteSpace;this.defaultTextDirection=o.direction=="rtl"?Nn.RTL:Nn.LTR;let s=this.heightOracle.mustRefreshForWrapping(i)||this.mustMeasureContent==="refresh",a=n.getBoundingClientRect(),l=s||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let c=0,u=0;if(a.width&&a.height){let{scaleX:_,scaleY:k}=wM(n,a);(_>.005&&Math.abs(this.scaleX-_)>.005||k>.005&&Math.abs(this.scaleY-k)>.005)&&(this.scaleX=_,this.scaleY=k,c|=16,s=l=!0)}let d=(parseInt(o.paddingTop)||0)*this.scaleY,f=(parseInt(o.paddingBottom)||0)*this.scaleY;(this.paddingTop!=d||this.paddingBottom!=f)&&(this.paddingTop=d,this.paddingBottom=f,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let h=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=h&&(this.scrollAnchorHeight=-1,this.scrollTop=h),this.scrolledToBottom=kM(e.scrollDOM);let g=(this.printing?npe:epe)(n,this.paddingTop),v=g.top-this.pixelViewport.top,m=g.bottom-this.pixelViewport.bottom;this.pixelViewport=g;let b=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(b!=this.inView&&(this.inView=b,b&&(l=!0)),!this.inView&&!this.scrollTarget&&!tpe(e.dom))return 0;let y=a.width;if((this.contentDOMWidth!=y||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),l){let _=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(_)&&(s=!0),s||r.lineWrapping&&Math.abs(y-this.contentDOMWidth)>r.charWidth){let{lineHeight:k,charWidth:E,textHeight:L}=e.docView.measureTextSize();s=k>0&&r.refresh(i,k,E,L,Math.max(5,y/E),_),s&&(e.docView.minWidth=0,c|=16)}v>0&&m>0?u=Math.max(v,m):v<0&&m<0&&(u=Math.min(v,m)),Mk();for(let k of this.viewports){let E=k.from==this.viewport.from?_:e.docView.measureVisibleLineHeights(k);this.heightMap=(s?Uo.empty().applyChanges(this.stateDeco,Ut.empty,this.heightOracle,[new Fr(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,s,new jhe(k.from,E))}hu&&(c|=2)}let x=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return x&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(u,this.scrollTarget),c|=this.updateForViewport()),(c&2||x)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(s?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let o=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,i=this.heightOracle,{visibleTop:s,visibleBottom:a}=this,l=new Lh(r.lineAt(s-o*1e3,un.ByHeight,i,0,0).from,r.lineAt(a+(1-o)*1e3,un.ByHeight,i,0,0).to);if(n){let{head:c}=n.range;if(c<l.from||c>l.to){let u=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),d=r.lineAt(c,un.ByPos,i,0,0),f;n.y=="center"?f=(d.top+d.bottom)/2-u/2:n.y=="start"||n.y=="nearest"&&c<l.from?f=d.top:f=d.bottom-u,l=new Lh(r.lineAt(f-1e3/2,un.ByHeight,i,0,0).from,r.lineAt(f+u+1e3/2,un.ByHeight,i,0,0).to)}}return l}mapViewport(e,n){let o=n.mapPos(e.from,-1),r=n.mapPos(e.to,1);return new Lh(this.heightMap.lineAt(o,un.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,un.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},o=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,un.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(n,un.ByPos,this.heightOracle,0,0),{visibleTop:s,visibleBottom:a}=this;return(e==0||r<=s-Math.max(10,Math.min(-o,250)))&&(n==this.state.doc.length||i>=a+Math.max(10,Math.min(o,250)))&&r>s-2*1e3&&i<a+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let o=[];for(let r of e)n.touchesRange(r.from,r.to)||o.push(new Fv(n.mapPos(r.from),n.mapPos(r.to),r.size,r.displaySize));return o}ensureLineGaps(e,n){let o=this.heightOracle.lineWrapping,r=o?1e4:2e3,i=r>>1,s=r<<1;if(this.defaultTextDirection!=Nn.LTR&&!o)return[];let a=[],l=(u,d,f,h)=>{if(d-u<i)return;let g=this.state.selection.main,v=[g.from];g.empty||v.push(g.to);for(let b of v)if(b>u&&b<d){l(u,b-10,f,h),l(b+10,d,f,h);return}let m=ipe(e,b=>b.from>=f.from&&b.to<=f.to&&Math.abs(b.from-u)<i&&Math.abs(b.to-d)<i&&!v.some(y=>b.from<y&&b.to>y));if(!m){if(d<f.to&&n&&o&&n.visibleRanges.some(x=>x.from<=d&&x.to>=d)){let x=n.moveToLineBoundary(He.cursor(d),!1,!0).head;x>u&&(d=x)}let b=this.gapSize(f,u,d,h),y=o||b<2e6?b:2e6;m=new Fv(u,d,b,y)}a.push(m)},c=u=>{if(u.length<s||u.type!=Ur.Text)return;let d=rpe(u.from,u.to,this.stateDeco);if(d.total<s)return;let f=this.scrollTarget?this.scrollTarget.range.head:null,h,g;if(o){let v=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,m,b;if(f!=null){let y=Dh(d,f),x=((this.visibleBottom-this.visibleTop)/2+v)/u.height;m=y-x,b=y+x}else m=(this.visibleTop-u.top-v)/u.height,b=(this.visibleBottom-u.top+v)/u.height;h=Ph(d,m),g=Ph(d,b)}else{let v=d.total*this.heightOracle.charWidth,m=r*this.heightOracle.charWidth,b=0;if(v>2e6)for(let E of e)E.from>=u.from&&E.from<u.to&&E.size!=E.displaySize&&E.from*this.heightOracle.charWidth+b<this.pixelViewport.left&&(b=E.size-E.displaySize);let y=this.pixelViewport.left+b,x=this.pixelViewport.right+b,_,k;if(f!=null){let E=Dh(d,f),L=((x-y)/2+m)/v;_=E-L,k=E+L}else _=(y-m)/v,k=(x+m)/v;h=Ph(d,_),g=Ph(d,k)}h>u.from&&l(u.from,h,u,d),g<u.to&&l(g,u.to,u,d)};for(let u of this.viewportLines)Array.isArray(u.type)?u.type.forEach(c):c(u);return a}gapSize(e,n,o,r){let i=Dh(r,o)-Dh(r,n);return this.heightOracle.lineWrapping?e.height*i:r.total*this.heightOracle.charWidth*i}updateLineGaps(e){Fv.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Xn.set(e.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let o=[];tn.spans(n,this.viewport.from,this.viewport.to,{span(i,s){o.push({from:i,to:s})},point(){}},20);let r=0;if(o.length!=this.visibleRanges.length)r=12;else for(let i=0;i<o.length&&!(r&8);i++){let s=this.visibleRanges[i],a=o[i];(s.from!=a.from||s.to!=a.to)&&(r|=4,e&&e.mapPos(s.from,-1)==a.from&&e.mapPos(s.to,1)==a.to||(r|=8))}return this.visibleRanges=o,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||pd(this.heightMap.lineAt(e,un.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||pd(this.heightMap.lineAt(this.scaler.fromDOM(e),un.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return pd(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Lh{constructor(e,n){this.from=e,this.to=n}}function rpe(t,e,n){let o=[],r=t,i=0;return tn.spans(n,t,e,{span(){},point(s,a){s>r&&(o.push({from:r,to:s}),i+=s-r),r=a}},20),r<e&&(o.push({from:r,to:e}),i+=e-r),{total:i,ranges:o}}function Ph({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let o=Math.floor(t*n);for(let r=0;;r++){let{from:i,to:s}=e[r],a=s-i;if(o<=a)return i+o;o-=a}}function Dh(t,e){let n=0;for(let{from:o,to:r}of t.ranges){if(e<=r){n+=e-o;break}n+=r-o}return n/t.total}function ipe(t,e){for(let n of t)if(e(n))return n}const Lk={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function Pk(t){let e=t.facet(bg).filter(o=>typeof o!="function"),n=t.facet(ix).filter(o=>typeof o!="function");return n.length&&e.push(tn.join(n)),e}class lx{constructor(e,n,o){let r=0,i=0,s=0;this.viewports=o.map(({from:a,to:l})=>{let c=n.lineAt(a,un.ByPos,e,0,0).top,u=n.lineAt(l,un.ByPos,e,0,0).bottom;return r+=u-c,{from:a,to:l,top:c,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(n.height-r);for(let a of this.viewports)a.domTop=s+(a.top-i)*this.scale,s=a.domBottom=a.domTop+(a.bottom-a.top),i=a.bottom}toDOM(e){for(let n=0,o=0,r=0;;n++){let i=n<this.viewports.length?this.viewports[n]:null;if(!i||e<i.top)return r+(e-o)*this.scale;if(e<=i.bottom)return i.domTop+(e-i.top);o=i.bottom,r=i.domBottom}}fromDOM(e){for(let n=0,o=0,r=0;;n++){let i=n<this.viewports.length?this.viewports[n]:null;if(!i||e<i.domTop)return o+(e-r)/this.scale;if(e<=i.domBottom)return i.top+(e-i.domTop);o=i.bottom,r=i.domBottom}}eq(e){return e instanceof lx?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,o)=>n.from==e.viewports[o].from&&n.to==e.viewports[o].to):!1}}function pd(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),o=e.toDOM(t.bottom);return new si(t.from,t.length,n,o-n,Array.isArray(t._content)?t._content.map(r=>pd(r,e)):t._content)}const Eh=gt.define({combine:t=>t.join(" ")}),Pb=gt.define({combine:t=>t.indexOf(!0)>-1}),Db=Va.newName(),sO=Va.newName(),aO=Va.newName(),lO={"&light":"."+sO,"&dark":"."+aO};function Eb(t,e,n){return new Va(e,{finish(o){return/&/.test(o)?o.replace(/&\w*/,r=>{if(r=="&")return t;if(!n||!n[r])throw new RangeError(`Unsupported selector: ${r}`);return n[r]}):t+" "+o}})}const spe=Eb("."+Db,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},lO),ape={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Vv=it.ie&&it.ie_version<=11;class lpe{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Ife,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let o of n)this.queue.push(o);(it.ie&&it.ie_version<=11||it.ios&&e.composing)&&n.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&it.android&&e.constructor.EDIT_CONTEXT!==!1&&!(it.chrome&&it.chrome_version<126)&&(this.editContext=new upe(e),e.state.facet(Ls)&&(e.contentDOM.editContext=this.editContext.editContext)),Vv&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(n=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,o)=>n!=e[o]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:o}=this,r=this.selectionRange;if(o.state.facet(Ls)?o.root.activeElement!=this.dom:!Pd(this.dom,r))return;let i=r.anchorNode&&o.docView.tile.nearest(r.anchorNode);if(i&&i.isWidget()&&i.widget.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(it.ie&&it.ie_version<=11||it.android&&it.chrome)&&!o.state.selection.main.empty&&r.focusNode&&Dd(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=vf(e.root);if(!n)return!1;let o=it.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&cpe(this.view,n)||n;if(!o||this.selectionRange.eq(o))return!1;let r=Pd(this.dom,o);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&Rfe(this.dom,o)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(o),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,n){this.selectionRange.set(e.node,e.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,n=null;for(let o=this.dom;o;)if(o.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==o?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(o),o=o.assignedSlot||o.parentNode;else if(o.nodeType==11)o=o.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let o of this.scrollTargets)o.removeEventListener("scroll",this.onScroll);for(let o of this.scrollTargets=n)o.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,ape),Vv&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Vv&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var o;if(!this.delayedAndroidKey){let r=()=>{let i=this.delayedAndroidKey;i&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=i.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&i.force&&Hc(this.dom,i.key,i.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((o=this.delayedAndroidKey)===null||o===void 0)&&o.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,o=-1,r=!1;for(let i of e){let s=this.readMutation(i);s&&(s.typeOver&&(r=!0),n==-1?{from:n,to:o}=s:(n=Math.min(s.from,n),o=Math.max(s.to,o)))}return{from:n,to:o,typeOver:r}}readChange(){let{from:e,to:n,typeOver:o}=this.processRecords(),r=this.selectionChanged&&Pd(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let i=new $he(this.view,e,n,o);return this.view.docView.domChanged={newSel:i.newSel?i.newSel.main:null},i}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let o=this.view.state,r=XM(this.view,n);return this.view.state==o&&(n.domChanged||n.newSel&&!T0(this.view.state.selection,n.newSel.main))&&this.view.update([]),r}readMutation(e){let n=this.view.docView.tile.nearest(e.target);if(!n||n.isWidget())return null;if(n.markDirty(e.type=="attributes"),e.type=="childList"){let o=Dk(n,e.previousSibling||e.target.previousSibling,-1),r=Dk(n,e.nextSibling||e.target.nextSibling,1);return{from:o?n.posAfter(o):n.posAtStart,to:r?n.posBefore(r):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Ls)!=e.state.facet(Ls)&&(e.view.contentDOM.editContext=e.state.facet(Ls)?this.editContext.editContext:null))}destroy(){var e,n,o;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(o=this.resizeScroll)===null||o===void 0||o.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function Dk(t,e,n){for(;e;){let o=Fn.get(e);if(o&&o.parent==t)return o;let r=e.parentNode;e=r!=t.dom?r:n>0?e.nextSibling:e.previousSibling}return null}function Ek(t,e){let n=e.startContainer,o=e.startOffset,r=e.endContainer,i=e.endOffset,s=t.docView.domAtPos(t.state.selection.main.anchor,1);return Dd(s.node,s.offset,r,i)&&([n,o,r,i]=[r,i,n,o]),{anchorNode:n,anchorOffset:o,focusNode:r,focusOffset:i}}function cpe(t,e){if(e.getComposedRanges){let r=e.getComposedRanges(t.root)[0];if(r)return Ek(t,r)}let n=null;function o(r){r.preventDefault(),r.stopImmediatePropagation(),n=r.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",o,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",o,!0),n?Ek(t,n):null}class upe{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=o=>{let r=e.state.selection.main,{anchor:i,head:s}=r,a=this.toEditorPos(o.updateRangeStart),l=this.toEditorPos(o.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:o.updateRangeStart,editorBase:a,drifted:!1});let c=l-a>o.text.length;a==this.from&&i<this.from?a=i:l==this.to&&i>this.to&&(l=i);let u=KM(e.state.sliceDoc(a,l),o.text,(c?r.from:r.to)-a,c?"end":null);if(!u){let f=He.single(this.toEditorPos(o.selectionStart),this.toEditorPos(o.selectionEnd));T0(f,r)||e.dispatch({selection:f,userEvent:"select"});return}let d={from:u.from+a,to:u.toA+a,insert:Ut.of(o.text.slice(u.from,u.toB).split(`
|
|
858
|
+
`))};if((it.mac||it.android)&&d.from==s-1&&/^\. ?$/.test(o.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(d={from:a,to:l,insert:Ut.of([o.text.replace("."," ")])}),this.pendingContextChange=d,!e.state.readOnly){let f=this.to-this.from+(d.to-d.from+d.insert.length);sx(e,d,He.single(this.toEditorPos(o.selectionStart,f),this.toEditorPos(o.selectionEnd,f)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),d.from<d.to&&!d.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,o.updateRangeStart-1),Math.min(n.text.length,o.updateRangeStart+1)))&&this.handlers.compositionend(o)},this.handlers.characterboundsupdate=o=>{let r=[],i=null;for(let s=this.toEditorPos(o.rangeStart),a=this.toEditorPos(o.rangeEnd);s<a;s++){let l=e.coordsForChar(s);i=l&&new DOMRect(l.left,l.top,l.right-l.left,l.bottom-l.top)||i||new DOMRect,r.push(i)}n.updateCharacterBounds(o.rangeStart,r)},this.handlers.textformatupdate=o=>{let r=[];for(let i of o.getTextFormats()){let s=i.underlineStyle,a=i.underlineThickness;if(!/none/i.test(s)&&!/none/i.test(a)){let l=this.toEditorPos(i.rangeStart),c=this.toEditorPos(i.rangeEnd);if(l<c){let u=`text-decoration: underline ${/^[a-z]/.test(s)?s+" ":s=="Dashed"?"dashed ":s=="Squiggle"?"wavy ":""}${/thin/i.test(a)?1:2}px`;r.push(Xn.mark({attributes:{style:u}}).range(l,c))}}}e.dispatch({effects:FM.of(Xn.set(r))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:o}=this.composing;this.composing=null,o&&this.reset(e.state)}};for(let o in this.handlers)n.addEventListener(o,this.handlers[o]);this.measureReq={read:o=>{this.editContext.updateControlBounds(o.contentDOM.getBoundingClientRect());let r=vf(o.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,o=!1,r=this.pendingContextChange;return e.changes.iterChanges((i,s,a,l,c)=>{if(o)return;let u=c.length-(s-i);if(r&&s>=r.to)if(r.from==i&&r.to==s&&r.insert.eq(c)){r=this.pendingContextChange=null,n+=u,this.to+=u;return}else r=null,this.revertPending(e.state);if(i+=n,s+=n,s<=this.from)this.from+=u,this.to+=u;else if(i<this.to){if(i<this.from||s>this.to||this.to-this.from+c.length>3e4){o=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(s),c.toString()),this.to+=u}n+=u}),r&&!o&&this.revertPending(e.state),!o}update(e){let n=this.pendingContextChange,o=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(o.from,o.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,o=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),r=this.toContextPos(n.head);(this.editContext.selectionStart!=o||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(o,r)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to<e.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let o=this.composing;return o&&o.drifted?o.editorBase+(e-o.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class kt{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:o}=e;this.dispatchTransactions=e.dispatchTransactions||o&&(r=>r.forEach(i=>o(i,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||Nfe(e.parent)||document,this.viewState=new Bk(e.state||Zt.create(e)),e.scrollTo&&e.scrollTo.is(Mh)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet($c).map(r=>new Dv(r));for(let r of this.plugins)r.update(this);this.observer=new lpe(this),this.inputState=new Bhe(this),this.inputState.ensureHandlers(this.plugins),this.docView=new bk(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let n=e.length==1&&e[0]instanceof qn?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,o=!1,r,i=this.state;for(let f of e){if(f.startState!=i)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");i=f.state}if(this.destroyed){this.viewState.state=i;return}let s=this.hasFocus,a=0,l=null;e.some(f=>f.annotation(nO))?(this.inputState.notifiedFocused=s,a=1):s!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=s,l=oO(i,s),l||(a=1));let c=this.observer.delayedAndroidKey,u=null;if(c?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(i.doc)||!this.state.selection.eq(i.selection))&&(u=null)):this.observer.clear(),i.facet(Zt.phrases)!=this.state.facet(Zt.phrases))return this.setState(i);r=A0.create(this,i,e),r.flags|=a;let d=this.viewState.scrollTarget;try{this.updateState=2;for(let f of e){if(d&&(d=d.map(f.changes)),f.scrollIntoView){let{main:h}=f.state.selection;d=new Wc(h.empty?h:He.cursor(h.head,h.head>h.anchor?-1:1))}for(let h of f.effects)h.is(Mh)&&(d=h.value.clip(this.state))}this.viewState.update(r,d),this.bidiCache=O0.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),n=this.docView.update(r),this.state.facet(fd)!=this.styleModules&&this.mountStyles(),o=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(f=>f.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(Eh)!=r.state.facet(Eh)&&(this.viewState.mustMeasureContent=!0),(n||o||d||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!r.empty)for(let f of this.state.facet(Mb))try{f(r)}catch(h){Zi(this.state,h,"update listener")}(l||u)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),u&&!XM(this,u)&&c.force&&Hc(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let o of this.plugins)o.destroy(this);this.viewState=new Bk(e),this.plugins=e.facet($c).map(o=>new Dv(o)),this.pluginMap.clear();for(let o of this.plugins)o.update(this);this.docView.destroy(),this.docView=new bk(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet($c),o=e.state.facet($c);if(n!=o){let r=[];for(let i of o){let s=n.indexOf(i);if(s<0)r.push(new Dv(i));else{let a=this.plugins[s];a.mustUpdate=e,r.push(a)}}for(let i of this.plugins)i.mustUpdate!=e&&i.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r<this.plugins.length;r++)this.plugins[r].update(this);n!=o&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let n=e.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(o){Zi(this.state,o,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,o=this.scrollDOM,r=o.scrollTop*this.scaleY,{scrollAnchorPos:i,scrollAnchorHeight:s}=this.viewState;Math.abs(r-this.viewState.scrollTop)>1&&(s=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(s<0)if(kM(o))i=-1,s=this.viewState.heightMap.height;else{let h=this.viewState.scrollAnchorAt(r);i=h.from,s=h.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];l&4||([this.measureRequests,c]=[c,this.measureRequests]);let u=c.map(h=>{try{return h.read(this)}catch(g){return Zi(this.state,g),Ik}}),d=A0.create(this,this.state,[]),f=!1;d.flags|=l,n?n.flags|=l:n=d,this.updateState=2,d.empty||(this.updatePlugins(d),this.inputState.update(d),this.updateAttrs(),f=this.docView.update(d),f&&this.docViewUpdate());for(let h=0;h<c.length;h++)if(u[h]!=Ik)try{let g=c[h];g.write&&g.write(u[h],this)}catch(g){Zi(this.state,g)}if(f&&this.docView.updateSelection(!0),!d.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,s=-1;continue}else{let g=(i<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(i).top)-s;if(g>1||g<-1){r=r+g,o.scrollTop=r/this.scaleY,s=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let a of this.state.facet(Mb))a(n)}get themeClasses(){return Db+" "+(this.state.facet(Pb)?aO:sO)+" "+this.state.facet(Eh)}updateAttrs(){let e=Nk(this,VM,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Ls)?"true":"false",class:"cm-content",style:`${it.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),Nk(this,rx,n);let o=this.observer.ignore(()=>{let r=fk(this.contentDOM,this.contentAttrs,n),i=fk(this.dom,this.editorAttrs,e);return r||i});return this.editorAttrs=e,this.contentAttrs=n,o}showAnnouncements(e){let n=!0;for(let o of e)for(let r of o.effects)if(r.is(kt.announce)){n&&(this.announceDOM.textContent=""),n=!1;let i=this.announceDOM.appendChild(document.createElement("div"));i.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(fd);let e=this.state.facet(kt.cspNonce);Va.mount(this.root,this.styleModules.concat(spe).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===e.key){this.measureRequests[n]=e;return}}this.measureRequests.push(e)}}plugin(e){let n=this.pluginMap.get(e);return(n===void 0||n&&n.plugin!=e)&&this.pluginMap.set(e,n=this.plugins.find(o=>o.plugin==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,o){return Rv(this,e,yk(this,e,n,o))}moveByGroup(e,n){return Rv(this,e,yk(this,e,n,o=>whe(this,e.head,o)))}visualLineSide(e,n){let o=this.bidiSpans(e),r=this.textDirectionAt(e.from),i=o[n?o.length-1:0];return He.cursor(i.side(n,r)+e.from,i.forward(!n,r)?1:-1)}moveToLineBoundary(e,n,o=!0){return xhe(this,e,n,o)}moveVertically(e,n,o){return Rv(this,e,_he(this,e,n,o))}domAtPos(e,n=1){return this.docView.domAtPos(e,n)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){this.readMeasured();let o=Bb(this,e,n);return o&&o.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),Bb(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let o=this.docView.coordsAt(e,n);if(!o||o.left==o.right)return o;let r=this.state.doc.lineAt(e),i=this.bidiSpans(r),s=i[Ki.find(i,e-r.from,-1,n)];return S0(o,s.dir==Nn.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(NM)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>dpe)return MM(e.length);let n=this.textDirectionAt(e.from),o;for(let i of this.bidiCache)if(i.from==e.from&&i.dir==n&&(i.fresh||TM(i.isolates,o=mk(this,e))))return i.order;o||(o=mk(this,e));let r=Gfe(e.text,n,o);return this.bidiCache.push(new O0(e.from,e.to,n,o,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||it.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{_M(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){return Mh.of(new Wc(typeof e=="number"?He.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,o=this.viewState.scrollAnchorAt(e);return Mh.of(new Wc(He.cursor(o.from),"start","start",o.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Ul.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Ul.define(()=>({}),{eventObservers:e})}static theme(e,n){let o=Va.newName(),r=[Eh.of(o),fd.of(Eb(`.${o}`,e))];return n&&n.dark&&r.push(Pb.of(!0)),r}static baseTheme(e){return K2.lowest(fd.of(Eb("."+Db,e,lO)))}static findFromDOM(e){var n;let o=e.querySelector(".cm-content"),r=o&&Fn.get(o)||Fn.get(e);return((n=r==null?void 0:r.root)===null||n===void 0?void 0:n.view)||null}}kt.styleModule=fd;kt.inputHandler=EM;kt.clipboardInputFilter=nx;kt.clipboardOutputFilter=ox;kt.scrollHandler=RM;kt.focusChangeEffect=IM;kt.perLineTextDirection=NM;kt.exceptionSink=DM;kt.updateListener=Mb;kt.editable=Ls;kt.mouseSelectionStyle=PM;kt.dragMovesSelection=LM;kt.clickAddsSelectionRange=BM;kt.decorations=bg;kt.blockWrappers=zM;kt.outerDecorations=ix;kt.atomicRanges=Hf;kt.bidiIsolatedRanges=HM;kt.scrollMargins=WM;kt.darkTheme=Pb;kt.cspNonce=gt.define({combine:t=>t.length?t[0]:""});kt.contentAttributes=rx;kt.editorAttributes=VM;kt.lineWrapping=kt.contentAttributes.of({class:"cm-lineWrapping"});kt.announce=Tn.define();const dpe=4096,Ik={};class O0{constructor(e,n,o,r,i,s){this.from=e,this.to=n,this.dir=o,this.isolates=r,this.fresh=i,this.order=s}static update(e,n){if(n.empty&&!e.some(i=>i.fresh))return e;let o=[],r=e.length?e[e.length-1].dir:Nn.LTR;for(let i=Math.max(0,e.length-10);i<e.length;i++){let s=e[i];s.dir==r&&!n.touchesRange(s.from,s.to)&&o.push(new O0(n.mapPos(s.from,1),n.mapPos(s.to,-1),s.dir,s.isolates,!1,s.order))}return o}}function Nk(t,e,n){for(let o=t.state.facet(e),r=o.length-1;r>=0;r--){let i=o[r],s=typeof i=="function"?i(t):i;s&&J2(s,n)}return n}const fpe=it.mac?"mac":it.windows?"win":it.linux?"linux":"key";function hpe(t,e){const n=t.split(/-(?!$)/);let o=n[n.length-1];o=="Space"&&(o=" ");let r,i,s,a;for(let l=0;l<n.length-1;++l){const c=n[l];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))s=!0;else if(/^mod$/i.test(c))e=="mac"?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+c)}return r&&(o="Alt-"+o),i&&(o="Ctrl-"+o),a&&(o="Meta-"+o),s&&(o="Shift-"+o),o}function Ih(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n!==!1&&e.shiftKey&&(t="Shift-"+t),t}const ppe=K2.default(kt.domEventHandlers({keydown(t,e){return bpe(mpe(e.state),t,e,"editor")}})),cO=gt.define({enables:ppe}),Rk=new WeakMap;function mpe(t){let e=t.facet(cO),n=Rk.get(e);return n||Rk.set(e,n=vpe(e.reduce((o,r)=>o.concat(r),[]))),n}let xa=null;const gpe=4e3;function vpe(t,e=fpe){let n=Object.create(null),o=Object.create(null),r=(s,a)=>{let l=o[s];if(l==null)o[s]=a;else if(l!=a)throw new Error("Key binding "+s+" is used both as a regular binding and as a multi-stroke prefix")},i=(s,a,l,c,u)=>{var d,f;let h=n[s]||(n[s]=Object.create(null)),g=a.split(/ (?!$)/).map(b=>hpe(b,e));for(let b=1;b<g.length;b++){let y=g.slice(0,b).join(" ");r(y,!0),h[y]||(h[y]={preventDefault:!0,stopPropagation:!1,run:[x=>{let _=xa={view:x,prefix:y,scope:s};return setTimeout(()=>{xa==_&&(xa=null)},gpe),!0}]})}let v=g.join(" ");r(v,!1);let m=h[v]||(h[v]={preventDefault:!1,stopPropagation:!1,run:((f=(d=h._any)===null||d===void 0?void 0:d.run)===null||f===void 0?void 0:f.slice())||[]});l&&m.run.push(l),c&&(m.preventDefault=!0),u&&(m.stopPropagation=!0)};for(let s of t){let a=s.scope?s.scope.split(" "):["editor"];if(s.any)for(let c of a){let u=n[c]||(n[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:d}=s;for(let f in u)u[f].run.push(h=>d(h,Ib))}let l=s[e]||s.key;if(l)for(let c of a)i(c,l,s.run,s.preventDefault,s.stopPropagation),s.shift&&i(c,"Shift-"+l,s.shift,s.preventDefault,s.stopPropagation)}return n}let Ib=null;function bpe(t,e,n,o){Ib=e;let r=Tfe(e),i=cfe(r,0),s=ufe(i)==r.length&&r!=" ",a="",l=!1,c=!1,u=!1;xa&&xa.view==n&&xa.scope==o&&(a=xa.prefix+" ",QM.indexOf(e.keyCode)<0&&(c=!0,xa=null));let d=new Set,f=m=>{if(m){for(let b of m.run)if(!d.has(b)&&(d.add(b),b(n)))return m.stopPropagation&&(u=!0),!0;m.preventDefault&&(m.stopPropagation&&(u=!0),c=!0)}return!1},h=t[o],g,v;return h&&(f(h[a+Ih(r,e,!s)])?l=!0:s&&(e.altKey||e.metaKey||e.ctrlKey)&&!(it.windows&&e.ctrlKey&&e.altKey)&&!(it.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(g=za[e.keyCode])&&g!=r?(f(h[a+Ih(g,e,!0)])||e.shiftKey&&(v=mf[e.keyCode])!=r&&v!=g&&f(h[a+Ih(v,e,!1)]))&&(l=!0):s&&e.shiftKey&&f(h[a+Ih(r,e,!0)])&&(l=!0),!l&&f(h._any)&&(l=!0)),c&&(l=!0),l&&u&&e.stopPropagation(),Ib=null,l}class pu extends zl{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}pu.prototype.elementClass="";pu.prototype.toDOM=void 0;pu.prototype.mapMode=br.TrackBefore;pu.prototype.startSide=pu.prototype.endSide=-1;pu.prototype.point=!0;const uO=1024;let ype=0;class zv{constructor(e,n){this.from=e,this.to=n}}class Dt{constructor(e={}){this.id=ype++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=dr.match(e)),n=>{let o=e(n);return o===void 0?null:[this,o]}}}Dt.closedBy=new Dt({deserialize:t=>t.split(" ")});Dt.openedBy=new Dt({deserialize:t=>t.split(" ")});Dt.group=new Dt({deserialize:t=>t.split(" ")});Dt.isolate=new Dt({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Dt.contextHash=new Dt({perNode:!0});Dt.lookAhead=new Dt({perNode:!0});Dt.mounted=new Dt({perNode:!0});class Id{constructor(e,n,o,r=!1){this.tree=e,this.overlay=n,this.parser=o,this.bracketed=r}static get(e){return e&&e.props&&e.props[Dt.mounted.id]}}const xpe=Object.create(null);class dr{constructor(e,n,o,r=0){this.name=e,this.props=n,this.id=o,this.flags=r}static define(e){let n=e.props&&e.props.length?Object.create(null):xpe,o=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new dr(e.name||"",n,e.id,o);if(e.props){for(let i of e.props)if(Array.isArray(i)||(i=i(r)),i){if(i[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[i[0].id]=i[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(Dt.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let o in e)for(let r of o.split(" "))n[r]=e[o];return o=>{for(let r=o.prop(Dt.group),i=-1;i<(r?r.length:0);i++){let s=n[i<0?o.name:r[i]];if(s)return s}}}}dr.none=new dr("",Object.create(null),0,8);class cx{constructor(e){this.types=e;for(let n=0;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let n=[];for(let o of this.types){let r=null;for(let i of e){let s=i(o);if(s){r||(r=Object.assign({},o.props));let a=s[1],l=s[0];l.combine&&l.id in r&&(a=l.combine(r[l.id],a)),r[l.id]=a}}n.push(r?new dr(o.name,r,o.id,o.flags):o)}return new cx(n)}}const Nh=new WeakMap,Fk=new WeakMap;var xn;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays",t[t.EnterBracketed=16]="EnterBracketed"})(xn||(xn={}));class Mn{constructor(e,n,o,r,i){if(this.type=e,this.children=n,this.positions=o,this.length=r,this.props=null,i&&i.length){this.props=Object.create(null);for(let[s,a]of i)this.props[typeof s=="number"?s:s.id]=a}}toString(){let e=Id.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let o of this.children){let r=o.toString();r&&(n&&(n+=","),n+=r)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new Rb(this.topNode,e)}cursorAt(e,n=0,o=0){let r=Nh.get(this)||this.topNode,i=new Rb(r);return i.moveTo(e,n),Nh.set(this,i._tree),i}get topNode(){return new Gr(this,0,0,null)}resolve(e,n=0){let o=yf(Nh.get(this)||this.topNode,e,n,!1);return Nh.set(this,o),o}resolveInner(e,n=0){let o=yf(Fk.get(this)||this.topNode,e,n,!0);return Fk.set(this,o),o}resolveStack(e,n=0){return kpe(this,e,n)}iterate(e){let{enter:n,leave:o,from:r=0,to:i=this.length}=e,s=e.mode||0,a=(s&xn.IncludeAnonymous)>0;for(let l=this.cursor(s|xn.IncludeAnonymous);;){let c=!1;if(l.from<=i&&l.to>=r&&(!a&&l.type.isAnonymous||n(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&o&&(a||!l.type.isAnonymous)&&o(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:fx(dr.none,this.children,this.positions,0,this.children.length,0,this.length,(n,o,r)=>new Mn(this.type,n,o,r,this.propValues),e.makeTree||((n,o,r)=>new Mn(dr.none,n,o,r)))}static build(e){return Spe(e)}}Mn.empty=new Mn(dr.none,[],[],0);class ux{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new ux(this.buffer,this.index)}}class Wa{constructor(e,n,o){this.buffer=e,this.length=n,this.set=o}get type(){return dr.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],o=this.buffer[e+3],r=this.set.types[n],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),e+=4,o==e)return i;let s=[];for(;e<o;)s.push(this.childString(e)),e=this.buffer[e+3];return i+"("+s.join(",")+")"}findChild(e,n,o,r,i){let{buffer:s}=this,a=-1;for(let l=e;l!=n&&!(dO(i,r,s[l+1],s[l+2])&&(a=l,o>0));l=s[l+3]);return a}slice(e,n,o){let r=this.buffer,i=new Uint16Array(n-e),s=0;for(let a=e,l=0;a<n;){i[l++]=r[a++],i[l++]=r[a++]-o;let c=i[l++]=r[a++]-o;i[l++]=r[a++]-e,s=Math.max(s,c)}return new Wa(i,s,this.set)}}function dO(t,e,n,o){switch(t){case-2:return n<e;case-1:return o>=e&&n<e;case 0:return n<e&&o>e;case 1:return n<=e&&o>e;case 2:return o>e;case 4:return!0}}function yf(t,e,n,o){for(var r;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let s=!o&&t instanceof Gr&&t.index<0?null:t.parent;if(!s)return t;t=s}let i=o?0:xn.IgnoreOverlays;if(o)for(let s=t,a=s.parent;a;s=a,a=s.parent)s instanceof Gr&&s.index<0&&((r=a.enter(e,n,i))===null||r===void 0?void 0:r.from)!=s.from&&(t=a);for(;;){let s=t.enter(e,n,i);if(!s)return t;t=s}}class fO{cursor(e=0){return new Rb(this,e)}getChild(e,n=null,o=null){let r=Vk(this,e,n,o);return r.length?r[0]:null}getChildren(e,n=null,o=null){return Vk(this,e,n,o)}resolve(e,n=0){return yf(this,e,n,!1)}resolveInner(e,n=0){return yf(this,e,n,!0)}matchContext(e){return Nb(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),o=this;for(;n;){let r=n.lastChild;if(!r||r.to!=n.to)break;r.type.isError&&r.from==r.to?(o=n,n=r.prevSibling):n=r}return o}get node(){return this}get next(){return this.parent}}class Gr extends fO{constructor(e,n,o,r){super(),this._tree=e,this.from=n,this.index=o,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,o,r,i=0){for(let s=this;;){for(let{children:a,positions:l}=s._tree,c=n>0?a.length:-1;e!=c;e+=n){let u=a[e],d=l[e]+s.from,f;if(!(!(i&xn.EnterBracketed&&u instanceof Mn&&(f=Id.get(u))&&!f.overlay&&f.bracketed&&o>=d&&o<=d+u.length)&&!dO(r,o,d,d+u.length))){if(u instanceof Wa){if(i&xn.ExcludeBuffers)continue;let h=u.findChild(0,u.buffer.length,n,o-d,r);if(h>-1)return new Aa(new wpe(s,u,e,d),null,h)}else if(i&xn.IncludeAnonymous||!u.type.isAnonymous||dx(u)){let h;if(!(i&xn.IgnoreMounts)&&(h=Id.get(u))&&!h.overlay)return new Gr(h.tree,d,e,s);let g=new Gr(u,d,e,s);return i&xn.IncludeAnonymous||!g.type.isAnonymous?g:g.nextChild(n<0?u.children.length-1:0,n,o,r,i)}}}if(i&xn.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?e=s.index+n:e=n<0?-1:s._parent._tree.children.length,s=s._parent,!s))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,n,o=0){let r;if(!(o&xn.IgnoreOverlays)&&(r=Id.get(this._tree))&&r.overlay){let i=e-this.from,s=o&xn.EnterBracketed&&r.bracketed;for(let{from:a,to:l}of r.overlay)if((n>0||s?a<=i:a<i)&&(n<0||s?l>=i:l>i))return new Gr(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,o)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Vk(t,e,n,o){let r=t.cursor(),i=[];if(!r.firstChild())return i;if(n!=null){for(let s=!1;!s;)if(s=r.type.is(n),!r.nextSibling())return i}for(;;){if(o!=null&&r.type.is(o))return i;if(r.type.is(e)&&i.push(r.node),!r.nextSibling())return o==null?i:[]}}function Nb(t,e,n=e.length-1){for(let o=t;n>=0;o=o.parent){if(!o)return!1;if(!o.type.isAnonymous){if(e[n]&&e[n]!=o.name)return!1;n--}}return!0}class wpe{constructor(e,n,o,r){this.parent=e,this.buffer=n,this.index=o,this.start=r}}class Aa extends fO{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,o){super(),this.context=e,this._parent=n,this.index=o,this.type=e.buffer.set.types[e.buffer.buffer[o]]}child(e,n,o){let{buffer:r}=this.context,i=r.findChild(this.index+4,r.buffer[this.index+3],e,n-this.context.start,o);return i<0?null:new Aa(this.context,this,i)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,n,o=0){if(o&xn.ExcludeBuffers)return null;let{buffer:r}=this.context,i=r.findChild(this.index+4,r.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return i<0?null:new Aa(this.context,this,i)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Aa(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new Aa(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:o}=this.context,r=this.index+4,i=o.buffer[this.index+3];if(i>r){let s=o.buffer[this.index+1];e.push(o.slice(r,i,s)),n.push(0)}return new Mn(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function hO(t){if(!t.length)return null;let e=0,n=t[0];for(let i=1;i<t.length;i++){let s=t[i];(s.from>n.from||s.to<n.to)&&(n=s,e=i)}let o=n instanceof Gr&&n.index<0?null:n.parent,r=t.slice();return o?r[e]=o:r.splice(e,1),new _pe(r,n)}class _pe{constructor(e,n){this.heads=e,this.node=n}get next(){return hO(this.heads)}}function kpe(t,e,n){let o=t.resolveInner(e,n),r=null;for(let i=o instanceof Gr?o:o.context.parent;i;i=i.parent)if(i.index<0){let s=i.parent;(r||(r=[o])).push(s.resolve(e,n)),i=s}else{let s=Id.get(i.tree);if(s&&s.overlay&&s.overlay[0].from<=e&&s.overlay[s.overlay.length-1].to>=e){let a=new Gr(s.tree,s.overlay[0].from+i.from,-1,i);(r||(r=[o])).push(yf(a,e,n,!1))}}return r?hO(r):o}class Rb{get name(){return this.type.name}constructor(e,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~xn.EnterBracketed,e instanceof Gr)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let o=e._parent;o;o=o._parent)this.stack.unshift(o.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:o,buffer:r}=this.buffer;return this.type=n||r.set.types[r.buffer[e]],this.from=o+r.buffer[e+1],this.to=o+r.buffer[e+2],!0}yield(e){return e?e instanceof Gr?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,o){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,o,this.mode));let{buffer:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,n-this.buffer.start,o);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,o=this.mode){return this.buffer?o&xn.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,o))}parent(){if(!this.buffer)return this.yieldNode(this.mode&xn.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&xn.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,o=this.stack.length-1;if(e<0){let r=o<0?0:this.stack[o]+4;if(this.index!=r)return this.yieldBuf(n.findChild(r,this.index,-1,0,4))}else{let r=n.buffer[this.index+3];if(r<(o<0?n.buffer.length:n.buffer[this.stack[o]+3]))return this.yieldBuf(r)}return o<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,o,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let i=0;i<this.index;i++)if(r.buffer.buffer[i+3]<this.index)return!1;({index:n,parent:o}=r)}else({index:n,_parent:o}=this._tree);for(;o;{index:n,_parent:o}=o)if(n>-1)for(let i=n+e,s=e<0?-1:o._tree.children.length;i!=s;i+=e){let a=o._tree.children[i];if(this.mode&xn.IncludeAnonymous||a instanceof Wa||!a.type.isAnonymous||dx(a))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,o=0;if(e&&e.context==this.buffer)e:for(let r=this.index,i=this.stack.length;i>=0;){for(let s=e;s;s=s._parent)if(s.index==r){if(r==this.index)return s;n=s,o=i+1;break e}r=this.stack[--i]}for(let r=o;r<this.stack.length;r++)n=new Aa(this.buffer,n,this.stack[r]);return this.bufferNode=new Aa(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let o=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){o++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&n&&n(this),r=this.type.isAnonymous,!o)return;if(this.nextSibling())break;this.parent(),o--,r=!0}}}matchContext(e){if(!this.buffer)return Nb(this.node.parent,e);let{buffer:n}=this.buffer,{types:o}=n.set;for(let r=e.length-1,i=this.stack.length-1;r>=0;i--){if(i<0)return Nb(this._tree,e,r);let s=o[n.buffer[this.stack[i]]];if(!s.isAnonymous){if(e[r]&&e[r]!=s.name)return!1;r--}}return!0}}function dx(t){return t.children.some(e=>e instanceof Wa||!e.type.isAnonymous||dx(e))}function Spe(t){var e;let{buffer:n,nodeSet:o,maxBufferLength:r=uO,reused:i=[],minRepeatType:s=o.types.length}=t,a=Array.isArray(n)?new ux(n,n.length):n,l=o.types,c=0,u=0;function d(k,E,L,S,B,D){let{id:N,start:C,end:M,size:P}=a,$=u,F=c;if(P<0)if(a.next(),P==-1){let me=i[N];L.push(me),S.push(C-k);return}else if(P==-3){c=N;return}else if(P==-4){u=N;return}else throw new RangeError(`Unrecognized record size: ${P}`);let V=l[N],U,K,ae=C-k;if(M-C<=r&&(K=m(a.pos-E,B))){let me=new Uint16Array(K.size-K.skip),de=a.pos-K.size,ve=me.length;for(;a.pos>de;)ve=b(K.start,me,ve);U=new Wa(me,M-K.start,o),ae=K.start-k}else{let me=a.pos-P;a.next();let de=[],ve=[],te=N>=s?N:-1,pe=0,we=M;for(;a.pos>me;)te>=0&&a.id==te&&a.size>=0?(a.end<=we-r&&(g(de,ve,C,pe,a.end,we,te,$,F),pe=de.length,we=a.end),a.next()):D>2500?f(C,me,de,ve):d(C,me,de,ve,te,D+1);if(te>=0&&pe>0&&pe<de.length&&g(de,ve,C,pe,C,we,te,$,F),de.reverse(),ve.reverse(),te>-1&&pe>0){let J=h(V,F);U=fx(V,de,ve,0,de.length,0,M-C,J,J)}else U=v(V,de,ve,M-C,$-M,F)}L.push(U),S.push(ae)}function f(k,E,L,S){let B=[],D=0,N=-1;for(;a.pos>E;){let{id:C,start:M,end:P,size:$}=a;if($>4)a.next();else{if(N>-1&&M<N)break;N<0&&(N=P-r),B.push(C,M,P),D++,a.next()}}if(D){let C=new Uint16Array(D*4),M=B[B.length-2];for(let P=B.length-3,$=0;P>=0;P-=3)C[$++]=B[P],C[$++]=B[P+1]-M,C[$++]=B[P+2]-M,C[$++]=$;L.push(new Wa(C,B[2]-M,o)),S.push(M-k)}}function h(k,E){return(L,S,B)=>{let D=0,N=L.length-1,C,M;if(N>=0&&(C=L[N])instanceof Mn){if(!N&&C.type==k&&C.length==B)return C;(M=C.prop(Dt.lookAhead))&&(D=S[N]+C.length+M)}return v(k,L,S,B,D,E)}}function g(k,E,L,S,B,D,N,C,M){let P=[],$=[];for(;k.length>S;)P.push(k.pop()),$.push(E.pop()+L-B);k.push(v(o.types[N],P,$,D-B,C-D,M)),E.push(B-L)}function v(k,E,L,S,B,D,N){if(D){let C=[Dt.contextHash,D];N=N?[C].concat(N):[C]}if(B>25){let C=[Dt.lookAhead,B];N=N?[C].concat(N):[C]}return new Mn(k,E,L,S,N)}function m(k,E){let L=a.fork(),S=0,B=0,D=0,N=L.end-r,C={size:0,start:0,skip:0};e:for(let M=L.pos-k;L.pos>M;){let P=L.size;if(L.id==E&&P>=0){C.size=S,C.start=B,C.skip=D,D+=4,S+=4,L.next();continue}let $=L.pos-P;if(P<0||$<M||L.start<N)break;let F=L.id>=s?4:0,V=L.start;for(L.next();L.pos>$;){if(L.size<0)if(L.size==-3||L.size==-4)F+=4;else break e;else L.id>=s&&(F+=4);L.next()}B=V,S+=P,D+=F}return(E<0||S==k)&&(C.size=S,C.start=B,C.skip=D),C.size>4?C:void 0}function b(k,E,L){let{id:S,start:B,end:D,size:N}=a;if(a.next(),N>=0&&S<s){let C=L;if(N>4){let M=a.pos-(N-4);for(;a.pos>M;)L=b(k,E,L)}E[--L]=C,E[--L]=D-k,E[--L]=B-k,E[--L]=S}else N==-3?c=S:N==-4&&(u=S);return L}let y=[],x=[];for(;a.pos>0;)d(t.start||0,t.bufferStart||0,y,x,-1,0);let _=(e=t.length)!==null&&e!==void 0?e:y.length?x[0]+y[0].length:0;return new Mn(l[t.topID],y.reverse(),x.reverse(),_)}const zk=new WeakMap;function dp(t,e){if(!t.isAnonymous||e instanceof Wa||e.type!=t)return 1;let n=zk.get(e);if(n==null){n=1;for(let o of e.children){if(o.type!=t||!(o instanceof Mn)){n=1;break}n+=dp(t,o)}zk.set(e,n)}return n}function fx(t,e,n,o,r,i,s,a,l){let c=0;for(let g=o;g<r;g++)c+=dp(t,e[g]);let u=Math.ceil(c*1.5/8),d=[],f=[];function h(g,v,m,b,y){for(let x=m;x<b;){let _=x,k=v[x],E=dp(t,g[x]);for(x++;x<b;x++){let L=dp(t,g[x]);if(E+L>=u)break;E+=L}if(x==_+1){if(E>u){let L=g[_];h(L.children,L.positions,0,L.children.length,v[_]+y);continue}d.push(g[_])}else{let L=v[x-1]+g[x-1].length-k;d.push(fx(t,g,v,_,x,k,L,null,l))}f.push(k+y-i)}}return h(e,n,o,r,0),(a||l)(d,f,s)}class Ol{constructor(e,n,o,r,i=!1,s=!1){this.from=e,this.to=n,this.tree=o,this.offset=r,this.open=(i?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],o=!1){let r=[new Ol(0,e.length,e,0,!1,o)];for(let i of n)i.to>e.length&&r.push(i);return r}static applyChanges(e,n,o=128){if(!n.length)return e;let r=[],i=1,s=e.length?e[0]:null;for(let a=0,l=0,c=0;;a++){let u=a<n.length?n[a]:null,d=u?u.fromA:1e9;if(d-l>=o)for(;s&&s.from<d;){let f=s;if(l>=f.from||d<=f.to||c){let h=Math.max(f.from,l)-c,g=Math.min(f.to,d)-c;f=h>=g?null:new Ol(h,g,f.tree,f.offset+c,a>0,!!u)}if(f&&r.push(f),s.to>d)break;s=i<e.length?e[i++]:null}if(!u)break;l=u.toA,c=u.toA-u.toB}return r}}class pO{startParse(e,n,o){return typeof e=="string"&&(e=new Ape(e)),o=o?o.length?o.map(r=>new zv(r.from,r.to)):[new zv(0,0)]:[new zv(0,e.length)],this.createParse(e,n||[],o)}parse(e,n,o){let r=this.startParse(e,n,o);for(;;){let i=r.advance();if(i)return i}}}class Ape{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}new Dt({perNode:!0});let Cpe=0;class Nr{constructor(e,n,o,r){this.name=e,this.set=n,this.base=o,this.modified=r,this.id=Cpe++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let o=typeof e=="string"?e:"?";if(e instanceof Nr&&(n=e),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let r=new Nr(o,[],null,[]);if(r.set.push(r),n)for(let i of n.set)r.set.push(i);return r}static defineModifier(e){let n=new B0(e);return o=>o.modified.indexOf(n)>-1?o:B0.get(o.base||o,o.modified.concat(n).sort((r,i)=>r.id-i.id))}}let $pe=0;class B0{constructor(e){this.name=e,this.instances=[],this.id=$pe++}static get(e,n){if(!n.length)return e;let o=n[0].instances.find(a=>a.base==e&&Tpe(n,a.modified));if(o)return o;let r=[],i=new Nr(e.name,r,e,n);for(let a of n)a.instances.push(i);let s=Mpe(n);for(let a of e.set)if(!a.modified.length)for(let l of s)r.push(B0.get(a,l));return i}}function Tpe(t,e){return t.length==e.length&&t.every((n,o)=>n==e[o])}function Mpe(t){let e=[[]];for(let n=0;n<t.length;n++)for(let o=0,r=e.length;o<r;o++)e.push(e[o].concat(t[n]));return e.sort((n,o)=>o.length-n.length)}function mO(t){let e=Object.create(null);for(let n in t){let o=t[n];Array.isArray(o)||(o=[o]);for(let r of n.split(" "))if(r){let i=[],s=2,a=r;for(let d=0;;){if(a=="..."&&d>0&&d+3==r.length){s=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!f)throw new RangeError("Invalid path: "+r);if(i.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),d+=f[0].length,d==r.length)break;let h=r[d++];if(d==r.length&&h=="!"){s=0;break}if(h!="/")throw new RangeError("Invalid path: "+r);a=r.slice(d)}let l=i.length-1,c=i[l];if(!c)throw new RangeError("Invalid path: "+r);let u=new xf(o,s,l>0?i.slice(0,l):null);e[c]=u.sort(e[c])}}return gO.add(e)}const gO=new Dt({combine(t,e){let n,o,r;for(;t||e;){if(!t||e&&t.depth>=e.depth?(r=e,e=e.next):(r=t,t=t.next),n&&n.mode==r.mode&&!r.context&&!n.context)continue;let i=new xf(r.tags,r.mode,r.context);n?n.next=i:o=i,n=i}return o}});class xf{constructor(e,n,o,r){this.tags=e,this.mode=n,this.context=o,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}xf.empty=new xf([],2,null);function vO(t,e){let n=Object.create(null);for(let i of t)if(!Array.isArray(i.tag))n[i.tag.id]=i.class;else for(let s of i.tag)n[s.id]=i.class;let{scope:o,all:r=null}=e||{};return{style:i=>{let s=r;for(let a of i)for(let l of a.set){let c=n[l.id];if(c){s=s?s+" "+c:c;break}}return s},scope:o}}function Ope(t,e){let n=null;for(let o of t){let r=o.style(e);r&&(n=n?n+" "+r:r)}return n}function bO(t,e,n,o=0,r=t.length){let i=new Bpe(o,Array.isArray(e)?e:[e],n);i.highlightRange(t.cursor(),o,r,"",i.highlighters),i.flush(r)}class Bpe{constructor(e,n,o){this.at=e,this.highlighters=n,this.span=o,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,o,r,i){let{type:s,from:a,to:l}=e;if(a>=o||l<=n)return;s.isTop&&(i=this.highlighters.filter(h=>!h.scope||h.scope(s)));let c=r,u=Lpe(e)||xf.empty,d=Ope(i,u.tags);if(d&&(c&&(c+=" "),c+=d,u.mode==1&&(r+=(r?" ":"")+d)),this.startSpan(Math.max(n,a),c),u.opaque)return;let f=e.tree&&e.tree.prop(Dt.mounted);if(f&&f.overlay){let h=e.node.enter(f.overlay[0].from+a,1),g=this.highlighters.filter(m=>!m.scope||m.scope(f.tree.type)),v=e.firstChild();for(let m=0,b=a;;m++){let y=m<f.overlay.length?f.overlay[m]:null,x=y?y.from+a:l,_=Math.max(n,b),k=Math.min(o,x);if(_<k&&v)for(;e.from<k&&(this.highlightRange(e,_,k,r,i),this.startSpan(Math.min(k,e.to),c),!(e.to>=x||!e.nextSibling())););if(!y||x>o)break;b=y.to+a,b>n&&(this.highlightRange(h.cursor(),Math.max(n,y.from+a),Math.min(o,b),"",g),this.startSpan(Math.min(o,b),c))}v&&e.parent()}else if(e.firstChild()){f&&(r="");do if(!(e.to<=n)){if(e.from>=o)break;this.highlightRange(e,n,o,r,i),this.startSpan(Math.min(o,e.to),c)}while(e.nextSibling());e.parent()}}}function Lpe(t){let e=t.type.prop(gO);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const je=Nr.define,Rh=je(),va=je(),Hk=je(va),Wk=je(va),ba=je(),Fh=je(ba),Hv=je(ba),Wi=je(),ul=je(Wi),zi=je(),Hi=je(),Fb=je(),ed=je(Fb),Vh=je(),ct={comment:Rh,lineComment:je(Rh),blockComment:je(Rh),docComment:je(Rh),name:va,variableName:je(va),typeName:Hk,tagName:je(Hk),propertyName:Wk,attributeName:je(Wk),className:je(va),labelName:je(va),namespace:je(va),macroName:je(va),literal:ba,string:Fh,docString:je(Fh),character:je(Fh),attributeValue:je(Fh),number:Hv,integer:je(Hv),float:je(Hv),bool:je(ba),regexp:je(ba),escape:je(ba),color:je(ba),url:je(ba),keyword:zi,self:je(zi),null:je(zi),atom:je(zi),unit:je(zi),modifier:je(zi),operatorKeyword:je(zi),controlKeyword:je(zi),definitionKeyword:je(zi),moduleKeyword:je(zi),operator:Hi,derefOperator:je(Hi),arithmeticOperator:je(Hi),logicOperator:je(Hi),bitwiseOperator:je(Hi),compareOperator:je(Hi),updateOperator:je(Hi),definitionOperator:je(Hi),typeOperator:je(Hi),controlOperator:je(Hi),punctuation:Fb,separator:je(Fb),bracket:ed,angleBracket:je(ed),squareBracket:je(ed),paren:je(ed),brace:je(ed),content:Wi,heading:ul,heading1:je(ul),heading2:je(ul),heading3:je(ul),heading4:je(ul),heading5:je(ul),heading6:je(ul),contentSeparator:je(Wi),list:je(Wi),quote:je(Wi),emphasis:je(Wi),strong:je(Wi),link:je(Wi),monospace:je(Wi),strikethrough:je(Wi),inserted:je(),deleted:je(),changed:je(),invalid:je(),meta:Vh,documentMeta:je(Vh),annotation:je(Vh),processingInstruction:je(Vh),definition:Nr.defineModifier("definition"),constant:Nr.defineModifier("constant"),function:Nr.defineModifier("function"),standard:Nr.defineModifier("standard"),local:Nr.defineModifier("local"),special:Nr.defineModifier("special")};for(let t in ct){let e=ct[t];e instanceof Nr&&(e.name=t)}const yO=vO([{tag:ct.link,class:"tok-link"},{tag:ct.heading,class:"tok-heading"},{tag:ct.emphasis,class:"tok-emphasis"},{tag:ct.strong,class:"tok-strong"},{tag:ct.keyword,class:"tok-keyword"},{tag:ct.atom,class:"tok-atom"},{tag:ct.bool,class:"tok-bool"},{tag:ct.url,class:"tok-url"},{tag:ct.labelName,class:"tok-labelName"},{tag:ct.inserted,class:"tok-inserted"},{tag:ct.deleted,class:"tok-deleted"},{tag:ct.literal,class:"tok-literal"},{tag:ct.string,class:"tok-string"},{tag:ct.number,class:"tok-number"},{tag:[ct.regexp,ct.escape,ct.special(ct.string)],class:"tok-string2"},{tag:ct.variableName,class:"tok-variableName"},{tag:ct.local(ct.variableName),class:"tok-variableName tok-local"},{tag:ct.definition(ct.variableName),class:"tok-variableName tok-definition"},{tag:ct.special(ct.variableName),class:"tok-variableName2"},{tag:ct.definition(ct.propertyName),class:"tok-propertyName tok-definition"},{tag:ct.typeName,class:"tok-typeName"},{tag:ct.namespace,class:"tok-namespace"},{tag:ct.className,class:"tok-className"},{tag:ct.macroName,class:"tok-macroName"},{tag:ct.propertyName,class:"tok-propertyName"},{tag:ct.operator,class:"tok-operator"},{tag:ct.comment,class:"tok-comment"},{tag:ct.meta,class:"tok-meta"},{tag:ct.invalid,class:"tok-invalid"},{tag:ct.punctuation,class:"tok-punctuation"}]);var Wv;const Tc=new Dt;function Ppe(t){return gt.define({combine:t?e=>e.concat(t):void 0})}const Dpe=new Dt;class di{constructor(e,n,o=[],r=""){this.data=e,this.name=r,Zt.prototype.hasOwnProperty("tree")||Object.defineProperty(Zt.prototype,"tree",{get(){return ls(this)}}),this.parser=n,this.extension=[gu.of(this),Zt.languageData.of((i,s,a)=>{let l=Uk(i,s,a),c=l.type.prop(Tc);if(!c)return[];let u=i.facet(c),d=l.type.prop(Dpe);if(d){let f=l.resolve(s-l.from,a);for(let h of d)if(h.test(f,i)){let g=i.facet(h.facet);return h.type=="replace"?g:g.concat(u)}}return u})].concat(o)}isActiveAt(e,n,o=-1){return Uk(e,n,o).type.prop(Tc)==this.data}findRegions(e){let n=e.facet(gu);if((n==null?void 0:n.data)==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let o=[],r=(i,s)=>{if(i.prop(Tc)==this.data){o.push({from:s,to:s+i.length});return}let a=i.prop(Dt.mounted);if(a){if(a.tree.prop(Tc)==this.data){if(a.overlay)for(let l of a.overlay)o.push({from:l.from+s,to:l.to+s});else o.push({from:s,to:s+i.length});return}else if(a.overlay){let l=o.length;if(r(a.tree,a.overlay[0].from+s),o.length>l)return}}for(let l=0;l<i.children.length;l++){let c=i.children[l];c instanceof Mn&&r(c,i.positions[l]+s)}};return r(ls(e),0),o}get allowsNesting(){return!0}}di.setState=Tn.define();function Uk(t,e,n){let o=t.facet(gu),r=ls(t).topNode;if(!o||o.allowsNesting)for(let i=r;i;i=i.enter(e,n,xn.ExcludeBuffers|xn.EnterBracketed))i.type.isTop&&(r=i);return r}class L0 extends di{constructor(e,n,o){super(e,n,[],o),this.parser=n}static define(e){let n=Ppe(e.languageData);return new L0(n,e.parser.configure({props:[Tc.add(o=>o.isTop?n:void 0)]}),e.name)}configure(e,n){return new L0(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function ls(t){let e=t.field(di.state,!1);return e?e.tree:Mn.empty}class Epe{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let o=this.cursorPos-this.string.length;return e<o||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-o,n-o)}}let td=null;class P0{constructor(e,n,o=[],r,i,s,a,l){this.parser=e,this.state=n,this.fragments=o,this.tree=r,this.treeLen=i,this.viewport=s,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,n,o){return new P0(e,n,[],Mn.empty,0,o,[],null)}startParse(){return this.parser.startParse(new Epe(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Mn.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var o;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let r=this.parse.advance();if(r)if(this.fragments=this.withoutTempSkipped(Ol.addTree(r,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(o=this.parse.stoppedAt)!==null&&o!==void 0?o:this.state.doc.length,this.tree=r,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(Ol.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=td;td=this;try{return e()}finally{td=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=Gk(e,n.from,n.to);return e}changes(e,n){let{fragments:o,tree:r,treeLen:i,viewport:s,skipped:a}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((c,u,d,f)=>l.push({fromA:c,toA:u,fromB:d,toB:f})),o=Ol.applyChanges(o,l),r=Mn.empty,i=0,s={from:e.mapPos(s.from,-1),to:e.mapPos(s.to,1)},this.skipped.length){a=[];for(let c of this.skipped){let u=e.mapPos(c.from,1),d=e.mapPos(c.to,-1);u<d&&a.push({from:u,to:d})}}}return new P0(this.parser,n,o,r,i,s,a,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let o=0;o<this.skipped.length;o++){let{from:r,to:i}=this.skipped[o];r<e.to&&i>e.from&&(this.fragments=Gk(this.fragments,r,i),this.skipped.splice(o--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends pO{createParse(n,o,r){let i=r[0].from,s=r[r.length-1].to;return{parsedPos:i,advance(){let l=td;if(l){for(let c of r)l.tempSkipped.push(c);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=s,new Mn(dr.none,[],[],s-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return td}}function Gk(t,e,n){return Ol.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class mu{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),o=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,o)||n.takeTree(),new mu(n)}static init(e){let n=Math.min(3e3,e.doc.length),o=P0.create(e.facet(gu).parser,e,{from:0,to:n});return o.work(20,n)||o.takeTree(),new mu(o)}}di.state=tl.define({create:mu.init,update(t,e){for(let n of e.effects)if(n.is(di.setState))return n.value;return e.startState.facet(gu)!=e.state.facet(gu)?mu.init(e.state):t.apply(e)}});let xO=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(xO=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const Uv=typeof navigator<"u"&&(!((Wv=navigator.scheduling)===null||Wv===void 0)&&Wv.isInputPending)?()=>navigator.scheduling.isInputPending():null,Ipe=Ul.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(di.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(di.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=xO(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:o,viewport:{to:r}}=this.view,i=o.field(di.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let s=Date.now()+Math.min(this.chunkBudget,100,e&&!Uv?Math.max(25,e.timeRemaining()-5):1e9),a=i.context.treeLen<r&&o.doc.length>r+1e3,l=i.context.work(()=>Uv&&Uv()||Date.now()>s,r+(a?0:1e5));this.chunkBudget-=Date.now()-n,(l||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:di.setState.of(new mu(i.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Zi(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),gu=gt.define({combine(t){return t.length?t[0]:null},enables:t=>[di.state,Ipe,kt.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class Npe{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}const Rpe=gt.define(),hx=gt.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function D0(t){let e=t.facet(hx);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function E0(t,e){let n="",o=t.tabSize,r=t.facet(hx)[0];if(r==" "){for(;e>=o;)n+=" ",e-=o;r=" "}for(let i=0;i<e;i++)n+=r;return n}function wO(t,e){t instanceof Zt&&(t=new _g(t));for(let o of t.state.facet(Rpe)){let r=o(t,e);if(r!==void 0)return r}let n=ls(t.state);return n.length>=e?Vpe(t,n,e):null}class _g{constructor(e,n={}){this.state=e,this.options=n,this.unit=D0(e)}lineAt(e,n=1){let o=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:i}=this.options;return r!=null&&r>=o.from&&r<=o.to?i&&r==e?{text:"",from:e}:(n<0?r<e:r<=e)?{text:o.text.slice(r-o.from),from:r}:{text:o.text.slice(0,r-o.from),from:o.from}:o}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:o,from:r}=this.lineAt(e,n);return o.slice(e-r,Math.min(o.length,e+100-r))}column(e,n=1){let{text:o,from:r}=this.lineAt(e,n),i=this.countColumn(o,e-r),s=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return s>-1&&(i+=s-this.countColumn(o,o.search(/\S|$/))),i}countColumn(e,n=e.length){return mg(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:o,from:r}=this.lineAt(e,n),i=this.options.overrideIndentation;if(i){let s=i(r);if(s>-1)return s}return this.countColumn(o,o.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Fpe=new Dt;function Vpe(t,e,n){let o=e.resolveStack(n),r=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(r!=o.node){let i=[];for(let s=r;s&&!(s.from<o.node.from||s.to>o.node.to||s.from==o.node.from&&s.type==o.node.type);s=s.parent)i.push(s);for(let s=i.length-1;s>=0;s--)o={node:i[s],next:o}}return _O(o,t,n)}function _O(t,e,n){for(let o=t;o;o=o.next){let r=Hpe(o.node);if(r)return r(px.create(e,n,o))}return 0}function zpe(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function Hpe(t){let e=t.type.prop(Fpe);if(e)return e;let n=t.firstChild,o;if(n&&(o=n.type.prop(Dt.closedBy))){let r=t.lastChild,i=r&&o.indexOf(r.name)>-1;return s=>qpe(s,!0,1,void 0,i&&!zpe(s)?r.from:void 0)}return t.parent==null?Wpe:null}function Wpe(){return 0}class px extends _g{constructor(e,n,o){super(e.state,e.options),this.base=e,this.pos=n,this.context=o}get node(){return this.context.node}static create(e,n,o){return new px(e,n,o)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let o=e.resolve(n.from);for(;o.parent&&o.parent.from==o.from;)o=o.parent;if(Upe(o,e))break;n=this.state.doc.lineAt(o.from)}return this.lineIndent(n.from)}continue(){return _O(this.context.next,this.base,this.pos)}}function Upe(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function Gpe(t){let e=t.node,n=e.childAfter(e.from),o=e.lastChild;if(!n)return null;let r=t.options.simulateBreak,i=t.state.doc.lineAt(n.from),s=r==null||r<=i.from?i.to:Math.min(i.to,r);for(let a=n.to;;){let l=e.childAfter(a);if(!l||l==o)return null;if(!l.type.isSkipped){if(l.from>=s)return null;let c=/^ */.exec(i.text.slice(n.to-i.from))[0].length;return{from:n.from,to:n.to+c}}a=l.to}}function qpe(t,e,n,o,r){let i=t.textAfter,s=i.match(/^\s*/)[0].length,a=o&&i.slice(s,s+o.length)==o||r==t.pos+s,l=Gpe(t);return l?a?t.column(l.from):t.column(l.to):t.baseIndent+(a?0:t.unit*n)}class mx{constructor(e,n){this.specs=e;let o;function r(a){let l=Va.newName();return(o||(o=Object.create(null)))["."+l]=a,l}const i=typeof n.all=="string"?n.all:n.all?r(n.all):void 0,s=n.scope;this.scope=s instanceof di?a=>a.prop(Tc)==s.data:s?a=>a==s:void 0,this.style=vO(e.map(a=>({tag:a.tag,class:a.class||r(Object.assign({},a,{tag:null}))})),{all:i}).style,this.module=o?new Va(o):null,this.themeType=n.themeType}static define(e,n){return new mx(e,n||{})}}const Vb=gt.define(),Ype=gt.define({combine(t){return t.length?[t[0]]:null}});function Gv(t){let e=t.facet(Vb);return e.length?e:t.facet(Ype)}function jpe(t,e){let n=[Kpe],o;return t instanceof mx&&(t.module&&n.push(kt.styleModule.of(t.module)),o=t.themeType),o?n.push(Vb.computeN([kt.darkTheme],r=>r.facet(kt.darkTheme)==(o=="dark")?[t]:[])):n.push(Vb.of(t)),n}class Xpe{constructor(e){this.markCache=Object.create(null),this.tree=ls(e.state),this.decorations=this.buildDeco(e,Gv(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=ls(e.state),o=Gv(e.state),r=o!=Gv(e.startState),{viewport:i}=e.view,s=e.changes.mapPos(this.decoratedTo,1);n.length<i.to&&!r&&n.type==this.tree.type&&s>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=s):(n!=this.tree||e.viewportChanged||r)&&(this.tree=n,this.decorations=this.buildDeco(e.view,o),this.decoratedTo=i.to)}buildDeco(e,n){if(!n||!this.tree.length)return Xn.none;let o=new hf;for(let{from:r,to:i}of e.visibleRanges)bO(this.tree,n,(s,a,l)=>{o.add(s,a,this.markCache[l]||(this.markCache[l]=Xn.mark({class:l})))},r,i);return o.finish()}}const Kpe=K2.high(Ul.fromClass(Xpe,{decorations:t=>t.decorations})),Zpe=1e4,Qpe="()[]{}",Jpe=new Dt;function zb(t,e,n){let o=t.prop(e<0?Dt.openedBy:Dt.closedBy);if(o)return o;if(t.name.length==1){let r=n.indexOf(t.name);if(r>-1&&r%2==(e<0?1:0))return[n[r+e]]}return null}function Hb(t){let e=t.type.prop(Jpe);return e?e(t.node):t}function Mc(t,e,n,o={}){let r=o.maxScanDistance||Zpe,i=o.brackets||Qpe,s=ls(t),a=s.resolveInner(e,n);for(let l=a;l;l=l.parent){let c=zb(l.type,n,i);if(c&&l.from<l.to){let u=Hb(l);if(u&&(n>0?e>=u.from&&e<u.to:e>u.from&&e<=u.to))return e0e(t,e,n,l,u,c,i)}}return t0e(t,e,n,s,a.type,r,i)}function e0e(t,e,n,o,r,i,s){let a=o.parent,l={from:r.from,to:r.to},c=0,u=a==null?void 0:a.cursor();if(u&&(n<0?u.childBefore(o.from):u.childAfter(o.to)))do if(n<0?u.to<=o.from:u.from>=o.to){if(c==0&&i.indexOf(u.type.name)>-1&&u.from<u.to){let d=Hb(u);return{start:l,end:d?{from:d.from,to:d.to}:void 0,matched:!0}}else if(zb(u.type,n,s))c++;else if(zb(u.type,-n,s)){if(c==0){let d=Hb(u);return{start:l,end:d&&d.from<d.to?{from:d.from,to:d.to}:void 0,matched:!1}}c--}}while(n<0?u.prevSibling():u.nextSibling());return{start:l,matched:!1}}function t0e(t,e,n,o,r,i,s){let a=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),l=s.indexOf(a);if(l<0||l%2==0!=n>0)return null;let c={from:n<0?e-1:e,to:n>0?e+1:e},u=t.doc.iterRange(e,n>0?t.doc.length:0),d=0;for(let f=0;!u.next().done&&f<=i;){let h=u.value;n<0&&(f+=h.length);let g=e+f*n;for(let v=n>0?0:h.length-1,m=n>0?h.length:-1;v!=m;v+=n){let b=s.indexOf(h[v]);if(!(b<0||o.resolveInner(g+v,1).type!=r))if(b%2==0==n>0)d++;else{if(d==1)return{start:c,end:{from:g+v,to:g+v+1},matched:b>>1==l>>1};d--}}n>0&&(f+=h.length)}return u.done?{start:c,matched:!1}:null}const n0e=Object.create(null),qk=[dr.none],Yk=[],jk=Object.create(null),o0e=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])o0e[t]=r0e(n0e,e);function qv(t,e){Yk.indexOf(t)>-1||(Yk.push(t),console.warn(e))}function r0e(t,e){let n=[];for(let a of e.split(" ")){let l=[];for(let c of a.split(".")){let u=t[c]||ct[c];u?typeof u=="function"?l.length?l=l.map(u):qv(c,`Modifier ${c} used at start of tag`):l.length?qv(c,`Tag ${c} used as modifier`):l=Array.isArray(u)?u:[u]:qv(c,`Unknown highlighting tag ${c}`)}for(let c of l)n.push(c)}if(!n.length)return 0;let o=e.replace(/ /g,"_"),r=o+" "+n.map(a=>a.id),i=jk[r];if(i)return i.id;let s=jk[r]=dr.define({id:qk.length,name:o,props:[mO({[o]:n})]});return qk.push(s),s.id}Nn.RTL,Nn.LTR;const i0e=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),o=vx(t.state,n.from);return o.line?s0e(t):o.block?l0e(t):!1};function gx(t,e){return({state:n,dispatch:o})=>{if(n.readOnly)return!1;let r=t(e,n);return r?(o(n.update(r)),!0):!1}}const s0e=gx(d0e,0),a0e=gx(kO,0),l0e=gx((t,e)=>kO(t,e,u0e(e)),0);function vx(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const nd=50;function c0e(t,{open:e,close:n},o,r){let i=t.sliceDoc(o-nd,o),s=t.sliceDoc(r,r+nd),a=/\s*$/.exec(i)[0].length,l=/^\s*/.exec(s)[0].length,c=i.length-a;if(i.slice(c-e.length,c)==e&&s.slice(l,l+n.length)==n)return{open:{pos:o-a,margin:a&&1},close:{pos:r+l,margin:l&&1}};let u,d;r-o<=2*nd?u=d=t.sliceDoc(o,r):(u=t.sliceDoc(o,o+nd),d=t.sliceDoc(r-nd,r));let f=/^\s*/.exec(u)[0].length,h=/\s*$/.exec(d)[0].length,g=d.length-h-n.length;return u.slice(f,f+e.length)==e&&d.slice(g,g+n.length)==n?{open:{pos:o+f+e.length,margin:/\s/.test(u.charAt(f+e.length))?1:0},close:{pos:r-h-n.length,margin:/\s/.test(d.charAt(g-1))?1:0}}:null}function u0e(t){let e=[];for(let n of t.selection.ranges){let o=t.doc.lineAt(n.from),r=n.to<=o.to?o:t.doc.lineAt(n.to);r.from>o.from&&r.from==n.to&&(r=n.to==o.to+1?o:t.doc.lineAt(n.to-1));let i=e.length-1;i>=0&&e[i].to>o.from?e[i].to=r.to:e.push({from:o.from+/^\s*/.exec(o.text)[0].length,to:r.to})}return e}function kO(t,e,n=e.selection.ranges){let o=n.map(i=>vx(e,i.from).block);if(!o.every(i=>i))return null;let r=n.map((i,s)=>c0e(e,o[s],i.from,i.to));if(t!=2&&!r.every(i=>i))return{changes:e.changes(n.map((i,s)=>r[s]?[]:[{from:i.from,insert:o[s].open+" "},{from:i.to,insert:" "+o[s].close}]))};if(t!=1&&r.some(i=>i)){let i=[];for(let s=0,a;s<r.length;s++)if(a=r[s]){let l=o[s],{open:c,close:u}=a;i.push({from:c.pos-l.open.length,to:c.pos+c.margin},{from:u.pos-u.margin,to:u.pos+l.close.length})}return{changes:i}}return null}function d0e(t,e,n=e.selection.ranges){let o=[],r=-1;e:for(let{from:i,to:s}of n){let a=o.length,l=1e9,c;for(let u=i;u<=s;){let d=e.doc.lineAt(u);if(c==null&&(c=vx(e,d.from).line,!c))continue e;if(d.from>r&&(i==s||s>d.from)){r=d.from;let f=/^\s*/.exec(d.text)[0].length,h=f==d.length,g=d.text.slice(f,f+c.length)==c?f:-1;f<d.text.length&&f<l&&(l=f),o.push({line:d,comment:g,token:c,indent:f,empty:h,single:!1})}u=d.to+1}if(l<1e9)for(let u=a;u<o.length;u++)o[u].indent<o[u].line.text.length&&(o[u].indent=l);o.length==a+1&&(o[a].single=!0)}if(t!=2&&o.some(i=>i.comment<0&&(!i.empty||i.single))){let i=[];for(let{line:a,token:l,indent:c,empty:u,single:d}of o)(d||!u)&&i.push({from:a.from+c,insert:l+" "});let s=e.changes(i);return{changes:s,selection:e.selection.map(s,1)}}else if(t!=1&&o.some(i=>i.comment>=0)){let i=[];for(let{line:s,comment:a,token:l}of o)if(a>=0){let c=s.from+a,u=c+l.length;s.text[u-s.from]==" "&&u++,i.push({from:c,to:u})}return{changes:i}}return null}const Wb=nl.define(),f0e=nl.define(),h0e=gt.define(),SO=gt.define({combine(t){return _fe(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(o,r)=>e(o,r)||n(o,r)})}}),AO=tl.define({create(){return Qi.empty},update(t,e){let n=e.state.facet(SO),o=e.annotation(Wb);if(o){let l=sr.fromTransaction(e,o.selection),c=o.side,u=c==0?t.undone:t.done;return l?u=I0(u,u.length,n.minDepth,l):u=TO(u,e.startState.selection),new Qi(c==0?o.rest:u,c==0?u:o.rest)}let r=e.annotation(f0e);if((r=="full"||r=="before")&&(t=t.isolate()),e.annotation(qn.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let i=sr.fromTransaction(e),s=e.annotation(qn.time),a=e.annotation(qn.userEvent);return i?t=t.addChanges(i,s,a,n,e):e.selection&&(t=t.addSelection(e.startState.selection,s,a,n.newGroupDelay)),(r=="full"||r=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new Qi(t.done.map(sr.fromJSON),t.undone.map(sr.fromJSON))}});function p0e(t={}){return[AO,SO.of(t),kt.domEventHandlers({beforeinput(e,n){let o=e.inputType=="historyUndo"?CO:e.inputType=="historyRedo"?Ub:null;return o?(e.preventDefault(),o(n)):!1}})]}function kg(t,e){return function({state:n,dispatch:o}){if(!e&&n.readOnly)return!1;let r=n.field(AO,!1);if(!r)return!1;let i=r.pop(t,n,e);return i?(o(i),!0):!1}}const CO=kg(0,!1),Ub=kg(1,!1),m0e=kg(0,!0),g0e=kg(1,!0);class sr{constructor(e,n,o,r,i){this.changes=e,this.effects=n,this.mapped=o,this.startSelection=r,this.selectionsAfter=i}setSelAfter(e){return new sr(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,o;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(o=this.startSelection)===null||o===void 0?void 0:o.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new sr(e.changes&&Un.fromJSON(e.changes),[],e.mapped&&rs.fromJSON(e.mapped),e.startSelection&&He.fromJSON(e.startSelection),e.selectionsAfter.map(He.fromJSON))}static fromTransaction(e,n){let o=Vr;for(let r of e.startState.facet(h0e)){let i=r(e);i.length&&(o=o.concat(i))}return!o.length&&e.changes.empty?null:new sr(e.changes.invert(e.startState.doc),o,void 0,n||e.startState.selection,Vr)}static selection(e){return new sr(void 0,Vr,void 0,void 0,e)}}function I0(t,e,n,o){let r=e+1>n+20?e-n-1:0,i=t.slice(r,e);return i.push(o),i}function v0e(t,e){let n=[],o=!1;return t.iterChangedRanges((r,i)=>n.push(r,i)),e.iterChangedRanges((r,i,s,a)=>{for(let l=0;l<n.length;){let c=n[l++],u=n[l++];a>=c&&s<=u&&(o=!0)}}),o}function b0e(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,o)=>n.empty!=e.ranges[o].empty).length===0}function $O(t,e){return t.length?e.length?t.concat(e):t:e}const Vr=[],y0e=200;function TO(t,e){if(t.length){let n=t[t.length-1],o=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-y0e));return o.length&&o[o.length-1].eq(e)?t:(o.push(e),I0(t,t.length-1,1e9,n.setSelAfter(o)))}else return[sr.selection([e])]}function x0e(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function Yv(t,e){if(!t.length)return t;let n=t.length,o=Vr;for(;n;){let r=w0e(t[n-1],e,o);if(r.changes&&!r.changes.empty||r.effects.length){let i=t.slice(0,n);return i[n-1]=r,i}else e=r.mapped,n--,o=r.selectionsAfter}return o.length?[sr.selection(o)]:Vr}function w0e(t,e,n){let o=$O(t.selectionsAfter.length?t.selectionsAfter.map(a=>a.map(e)):Vr,n);if(!t.changes)return sr.selection(o);let r=t.changes.map(e),i=e.mapDesc(t.changes,!0),s=t.mapped?t.mapped.composeDesc(i):i;return new sr(r,Tn.mapEffects(t.effects,e),s,t.startSelection.map(i),o)}const _0e=/^(input\.type|delete)($|\.)/;class Qi{constructor(e,n,o=0,r=void 0){this.done=e,this.undone=n,this.prevTime=o,this.prevUserEvent=r}isolate(){return this.prevTime?new Qi(this.done,this.undone):this}addChanges(e,n,o,r,i){let s=this.done,a=s[s.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!o||_0e.test(o))&&(!a.selectionsAfter.length&&n-this.prevTime<r.newGroupDelay&&r.joinToEvent(i,v0e(a.changes,e.changes))||o=="input.type.compose")?s=I0(s,s.length-1,r.minDepth,new sr(e.changes.compose(a.changes),$O(Tn.mapEffects(e.effects,a.changes),a.effects),a.mapped,a.startSelection,Vr)):s=I0(s,s.length,r.minDepth,e),new Qi(s,Vr,n,o)}addSelection(e,n,o,r){let i=this.done.length?this.done[this.done.length-1].selectionsAfter:Vr;return i.length>0&&n-this.prevTime<r&&o==this.prevUserEvent&&o&&/^select($|\.)/.test(o)&&b0e(i[i.length-1],e)?this:new Qi(TO(this.done,e),this.undone,n,o)}addMapping(e){return new Qi(Yv(this.done,e),Yv(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,o){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],s=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):n.selection);if(o&&i.selectionsAfter.length)return n.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:Wb.of({side:e,rest:x0e(r),selection:s}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(i.changes){let a=r.length==1?Vr:r.slice(0,r.length-1);return i.mapped&&(a=Yv(a,i.mapped)),n.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:Wb.of({side:e,rest:a,selection:s}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}Qi.empty=new Qi(Vr,Vr);const k0e=[{key:"Mod-z",run:CO,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Ub,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Ub,preventDefault:!0},{key:"Mod-u",run:m0e,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:g0e,preventDefault:!0}];function Eu(t,e){return He.create(t.ranges.map(e),t.mainIndex)}function Ei(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Ii({state:t,dispatch:e},n){let o=Eu(t.selection,n);return o.eq(t.selection,!0)?!1:(e(Ei(t,o)),!0)}function Sg(t,e){return He.cursor(e?t.to:t.from)}function MO(t,e){return Ii(t,n=>n.empty?t.moveByChar(n,e):Sg(n,e))}function Lo(t){return t.textDirectionAt(t.state.selection.main.head)==Nn.LTR}const OO=t=>MO(t,!Lo(t)),BO=t=>MO(t,Lo(t));function LO(t,e){return Ii(t,n=>n.empty?t.moveByGroup(n,e):Sg(n,e))}const S0e=t=>LO(t,!Lo(t)),A0e=t=>LO(t,Lo(t));function C0e(t,e,n){if(e.type.prop(n))return!0;let o=e.to-e.from;return o&&(o>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function Ag(t,e,n){let o=ls(t).resolveInner(e.head),r=n?Dt.closedBy:Dt.openedBy;for(let l=e.head;;){let c=n?o.childAfter(l):o.childBefore(l);if(!c)break;C0e(t,c,r)?o=c:l=n?c.to:c.from}let i=o.type.prop(r),s,a;return i&&(s=n?Mc(t,o.from,1):Mc(t,o.to,-1))&&s.matched?a=n?s.end.to:s.end.from:a=n?o.to:o.from,He.cursor(a,n?-1:1)}const $0e=t=>Ii(t,e=>Ag(t.state,e,!Lo(t))),T0e=t=>Ii(t,e=>Ag(t.state,e,Lo(t)));function PO(t,e){return Ii(t,n=>{if(!n.empty)return Sg(n,e);let o=t.moveVertically(n,e);return o.head!=n.head?o:t.moveToLineBoundary(n,e)})}const DO=t=>PO(t,!1),EO=t=>PO(t,!0);function IO(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,o=0,r;if(e){for(let i of t.state.facet(kt.scrollMargins)){let s=i(t);s!=null&&s.top&&(n=Math.max(s==null?void 0:s.top,n)),s!=null&&s.bottom&&(o=Math.max(s==null?void 0:s.bottom,o))}r=t.scrollDOM.clientHeight-n-o}else r=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:o,selfScroll:e,height:Math.max(t.defaultLineHeight,r-5)}}function NO(t,e){let n=IO(t),{state:o}=t,r=Eu(o.selection,s=>s.empty?t.moveVertically(s,e,n.height):Sg(s,e));if(r.eq(o.selection))return!1;let i;if(n.selfScroll){let s=t.coordsAtPos(o.selection.main.head),a=t.scrollDOM.getBoundingClientRect(),l=a.top+n.marginTop,c=a.bottom-n.marginBottom;s&&s.top>l&&s.bottom<c&&(i=kt.scrollIntoView(r.main.head,{y:"start",yMargin:s.top-l}))}return t.dispatch(Ei(o,r),{effects:i}),!0}const Xk=t=>NO(t,!1),Gb=t=>NO(t,!0);function ol(t,e,n){let o=t.lineBlockAt(e.head),r=t.moveToLineBoundary(e,n);if(r.head==e.head&&r.head!=(n?o.to:o.from)&&(r=t.moveToLineBoundary(e,n,!1)),!n&&r.head==o.from&&o.length){let i=/^\s*/.exec(t.state.sliceDoc(o.from,Math.min(o.from+100,o.to)))[0].length;i&&e.head!=o.from+i&&(r=He.cursor(o.from+i))}return r}const M0e=t=>Ii(t,e=>ol(t,e,!0)),O0e=t=>Ii(t,e=>ol(t,e,!1)),B0e=t=>Ii(t,e=>ol(t,e,!Lo(t))),L0e=t=>Ii(t,e=>ol(t,e,Lo(t))),P0e=t=>Ii(t,e=>He.cursor(t.lineBlockAt(e.head).from,1)),D0e=t=>Ii(t,e=>He.cursor(t.lineBlockAt(e.head).to,-1));function E0e(t,e,n){let o=!1,r=Eu(t.selection,i=>{let s=Mc(t,i.head,-1)||Mc(t,i.head,1)||i.head>0&&Mc(t,i.head-1,1)||i.head<t.doc.length&&Mc(t,i.head+1,-1);if(!s||!s.end)return i;o=!0;let a=s.start.from==i.head?s.end.to:s.end.from;return He.cursor(a)});return o?(e(Ei(t,r)),!0):!1}const I0e=({state:t,dispatch:e})=>E0e(t,e);function ei(t,e){let n=Eu(t.state.selection,o=>{let r=e(o);return He.range(o.anchor,r.head,r.goalColumn,r.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch(Ei(t.state,n)),!0)}function RO(t,e){return ei(t,n=>t.moveByChar(n,e))}const FO=t=>RO(t,!Lo(t)),VO=t=>RO(t,Lo(t));function zO(t,e){return ei(t,n=>t.moveByGroup(n,e))}const N0e=t=>zO(t,!Lo(t)),R0e=t=>zO(t,Lo(t)),F0e=t=>ei(t,e=>Ag(t.state,e,!Lo(t))),V0e=t=>ei(t,e=>Ag(t.state,e,Lo(t)));function HO(t,e){return ei(t,n=>t.moveVertically(n,e))}const WO=t=>HO(t,!1),UO=t=>HO(t,!0);function GO(t,e){return ei(t,n=>t.moveVertically(n,e,IO(t).height))}const Kk=t=>GO(t,!1),Zk=t=>GO(t,!0),z0e=t=>ei(t,e=>ol(t,e,!0)),H0e=t=>ei(t,e=>ol(t,e,!1)),W0e=t=>ei(t,e=>ol(t,e,!Lo(t))),U0e=t=>ei(t,e=>ol(t,e,Lo(t))),G0e=t=>ei(t,e=>He.cursor(t.lineBlockAt(e.head).from)),q0e=t=>ei(t,e=>He.cursor(t.lineBlockAt(e.head).to)),Qk=({state:t,dispatch:e})=>(e(Ei(t,{anchor:0})),!0),Jk=({state:t,dispatch:e})=>(e(Ei(t,{anchor:t.doc.length})),!0),eS=({state:t,dispatch:e})=>(e(Ei(t,{anchor:t.selection.main.anchor,head:0})),!0),tS=({state:t,dispatch:e})=>(e(Ei(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),Y0e=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),j0e=({state:t,dispatch:e})=>{let n=Cg(t).map(({from:o,to:r})=>He.range(o,Math.min(r+1,t.doc.length)));return e(t.update({selection:He.create(n),userEvent:"select"})),!0},X0e=({state:t,dispatch:e})=>{let n=Eu(t.selection,o=>{let r=ls(t),i=r.resolveStack(o.from,1);if(o.empty){let s=r.resolveStack(o.from,-1);s.node.from>=i.node.from&&s.node.to<=i.node.to&&(i=s)}for(let s=i;s;s=s.next){let{node:a}=s;if((a.from<o.from&&a.to>=o.to||a.to>o.to&&a.from<=o.from)&&s.next)return He.range(a.to,a.from)}return o});return n.eq(t.selection)?!1:(e(Ei(t,n)),!0)};function qO(t,e){let{state:n}=t,o=n.selection,r=n.selection.ranges.slice();for(let i of n.selection.ranges){let s=n.doc.lineAt(i.head);if(e?s.to<t.state.doc.length:s.from>0)for(let a=i;;){let l=t.moveVertically(a,e);if(l.head<s.from||l.head>s.to){r.some(c=>c.head==l.head)||r.push(l);break}else{if(l.head==a.head)break;a=l}}}return r.length==o.ranges.length?!1:(t.dispatch(Ei(n,He.create(r,r.length-1))),!0)}const K0e=t=>qO(t,!1),Z0e=t=>qO(t,!0),Q0e=({state:t,dispatch:e})=>{let n=t.selection,o=null;return n.ranges.length>1?o=He.create([n.main]):n.main.empty||(o=He.create([He.cursor(n.main.head)])),o?(e(Ei(t,o)),!0):!1};function Wf(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:o}=t,r=o.changeByRange(i=>{let{from:s,to:a}=i;if(s==a){let l=e(i);l<s?(n="delete.backward",l=zh(t,l,!1)):l>s&&(n="delete.forward",l=zh(t,l,!0)),s=Math.min(s,l),a=Math.max(a,l)}else s=zh(t,s,!1),a=zh(t,a,!0);return s==a?{range:i}:{changes:{from:s,to:a},range:He.cursor(s,s<i.head?-1:1)}});return r.changes.empty?!1:(t.dispatch(o.update(r,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?kt.announce.of(o.phrase("Selection deleted")):void 0})),!0)}function zh(t,e,n){if(t instanceof kt)for(let o of t.state.facet(kt.atomicRanges).map(r=>r(t)))o.between(e,e,(r,i)=>{r<e&&i>e&&(e=n?i:r)});return e}const YO=(t,e,n)=>Wf(t,o=>{let r=o.from,{state:i}=t,s=i.doc.lineAt(r),a,l;if(n&&!e&&r>s.from&&r<s.from+200&&!/[^ \t]/.test(a=s.text.slice(0,r-s.from))){if(a[a.length-1]==" ")return r-1;let c=mg(a,i.tabSize),u=c%D0(i)||D0(i);for(let d=0;d<u&&a[a.length-1-d]==" ";d++)r--;l=r}else l=Mo(s.text,r-s.from,e,e)+s.from,l==r&&s.number!=(e?i.doc.lines:1)?l+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(s.text.slice(l-s.from,r-s.from))&&(l=Mo(s.text,l-s.from,!1,!1)+s.from);return l}),qb=t=>YO(t,!1,!0),jO=t=>YO(t,!0,!1),XO=(t,e)=>Wf(t,n=>{let o=n.head,{state:r}=t,i=r.doc.lineAt(o),s=r.charCategorizer(o);for(let a=null;;){if(o==(e?i.to:i.from)){o==n.head&&i.number!=(e?r.doc.lines:1)&&(o+=e?1:-1);break}let l=Mo(i.text,o-i.from,e)+i.from,c=i.text.slice(Math.min(o,l)-i.from,Math.max(o,l)-i.from),u=s(c);if(a!=null&&u!=a)break;(c!=" "||o!=n.head)&&(a=u),o=l}return o}),KO=t=>XO(t,!1),J0e=t=>XO(t,!0),eme=t=>Wf(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),tme=t=>Wf(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),nme=t=>Wf(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),ome=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(o=>({changes:{from:o.from,to:o.to,insert:Ut.of(["",""])},range:He.cursor(o.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},rme=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(o=>{if(!o.empty||o.from==0||o.from==t.doc.length)return{range:o};let r=o.from,i=t.doc.lineAt(r),s=r==i.from?r-1:Mo(i.text,r-i.from,!1)+i.from,a=r==i.to?r+1:Mo(i.text,r-i.from,!0)+i.from;return{changes:{from:s,to:a,insert:t.doc.slice(r,a).append(t.doc.slice(s,r))},range:He.cursor(a)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Cg(t){let e=[],n=-1;for(let o of t.selection.ranges){let r=t.doc.lineAt(o.from),i=t.doc.lineAt(o.to);if(!o.empty&&o.to==i.from&&(i=t.doc.lineAt(o.to-1)),n>=r.number){let s=e[e.length-1];s.to=i.to,s.ranges.push(o)}else e.push({from:r.from,to:i.to,ranges:[o]});n=i.number+1}return e}function ZO(t,e,n){if(t.readOnly)return!1;let o=[],r=[];for(let i of Cg(t)){if(n?i.to==t.doc.length:i.from==0)continue;let s=t.doc.lineAt(n?i.to+1:i.from-1),a=s.length+1;if(n){o.push({from:i.to,to:s.to},{from:i.from,insert:s.text+t.lineBreak});for(let l of i.ranges)r.push(He.range(Math.min(t.doc.length,l.anchor+a),Math.min(t.doc.length,l.head+a)))}else{o.push({from:s.from,to:i.from},{from:i.to,insert:t.lineBreak+s.text});for(let l of i.ranges)r.push(He.range(l.anchor-a,l.head-a))}}return o.length?(e(t.update({changes:o,scrollIntoView:!0,selection:He.create(r,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const ime=({state:t,dispatch:e})=>ZO(t,e,!1),sme=({state:t,dispatch:e})=>ZO(t,e,!0);function QO(t,e,n){if(t.readOnly)return!1;let o=[];for(let i of Cg(t))n?o.push({from:i.from,insert:t.doc.slice(i.from,i.to)+t.lineBreak}):o.push({from:i.to,insert:t.lineBreak+t.doc.slice(i.from,i.to)});let r=t.changes(o);return e(t.update({changes:r,selection:t.selection.map(r,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const ame=({state:t,dispatch:e})=>QO(t,e,!1),lme=({state:t,dispatch:e})=>QO(t,e,!0),cme=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(Cg(e).map(({from:r,to:i})=>(r>0?r--:i<e.doc.length&&i++,{from:r,to:i}))),o=Eu(e.selection,r=>{let i;if(t.lineWrapping){let s=t.lineBlockAt(r.head),a=t.coordsAtPos(r.head,r.assoc||1);a&&(i=s.bottom+t.documentTop-a.bottom+t.defaultLineHeight/2)}return t.moveVertically(r,!0,i)}).map(n);return t.dispatch({changes:n,selection:o,scrollIntoView:!0,userEvent:"delete.line"}),!0};function ume(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=ls(t).resolveInner(e),o=n.childBefore(e),r=n.childAfter(e),i;return o&&r&&o.to<=e&&r.from>=e&&(i=o.type.prop(Dt.closedBy))&&i.indexOf(r.name)>-1&&t.doc.lineAt(o.to).from==t.doc.lineAt(r.from).from&&!/\S/.test(t.sliceDoc(o.to,r.from))?{from:o.to,to:r.from}:null}const nS=JO(!1),dme=JO(!0);function JO(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let o=e.changeByRange(r=>{let{from:i,to:s}=r,a=e.doc.lineAt(i),l=!t&&i==s&&ume(e,i);t&&(i=s=(s<=a.to?a:e.doc.lineAt(s)).to);let c=new _g(e,{simulateBreak:i,simulateDoubleBreak:!!l}),u=wO(c,i);for(u==null&&(u=mg(/^\s*/.exec(e.doc.lineAt(i).text)[0],e.tabSize));s<a.to&&/\s/.test(a.text[s-a.from]);)s++;l?{from:i,to:s}=l:i>a.from&&i<a.from+100&&!/\S/.test(a.text.slice(0,i))&&(i=a.from);let d=["",E0(e,u)];return l&&d.push(E0(e,c.lineIndent(a.from,-1))),{changes:{from:i,to:s,insert:Ut.of(d)},range:He.cursor(i+1+d[1].length)}});return n(e.update(o,{scrollIntoView:!0,userEvent:"input"})),!0}}function bx(t,e){let n=-1;return t.changeByRange(o=>{let r=[];for(let s=o.from;s<=o.to;){let a=t.doc.lineAt(s);a.number>n&&(o.empty||o.to>a.from)&&(e(a,r,o),n=a.number),s=a.to+1}let i=t.changes(r);return{changes:r,range:He.range(i.mapPos(o.anchor,1),i.mapPos(o.head,1))}})}const fme=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),o=new _g(t,{overrideIndentation:i=>{let s=n[i];return s??-1}}),r=bx(t,(i,s,a)=>{let l=wO(o,i.from);if(l==null)return;/\S/.test(i.text)||(l=0);let c=/^\s*/.exec(i.text)[0],u=E0(t,l);(c!=u||a.from<i.from+c.length)&&(n[i.from]=l,s.push({from:i.from,to:i.from+c.length,insert:u}))});return r.changes.empty||e(t.update(r,{userEvent:"indent"})),!0},hme=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(bx(t,(n,o)=>{o.push({from:n.from,insert:t.facet(hx)})}),{userEvent:"input.indent"})),!0),pme=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(bx(t,(n,o)=>{let r=/^\s*/.exec(n.text)[0];if(!r)return;let i=mg(r,t.tabSize),s=0,a=E0(t,Math.max(0,i-D0(t)));for(;s<r.length&&s<a.length&&r.charCodeAt(s)==a.charCodeAt(s);)s++;o.push({from:n.from+s,to:n.from+r.length,insert:a.slice(s)})}),{userEvent:"delete.dedent"})),!0),mme=t=>(t.setTabFocusMode(),!0),gme=[{key:"Ctrl-b",run:OO,shift:FO,preventDefault:!0},{key:"Ctrl-f",run:BO,shift:VO},{key:"Ctrl-p",run:DO,shift:WO},{key:"Ctrl-n",run:EO,shift:UO},{key:"Ctrl-a",run:P0e,shift:G0e},{key:"Ctrl-e",run:D0e,shift:q0e},{key:"Ctrl-d",run:jO},{key:"Ctrl-h",run:qb},{key:"Ctrl-k",run:eme},{key:"Ctrl-Alt-h",run:KO},{key:"Ctrl-o",run:ome},{key:"Ctrl-t",run:rme},{key:"Ctrl-v",run:Gb}],vme=[{key:"ArrowLeft",run:OO,shift:FO,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:S0e,shift:N0e,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:B0e,shift:W0e,preventDefault:!0},{key:"ArrowRight",run:BO,shift:VO,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:A0e,shift:R0e,preventDefault:!0},{mac:"Cmd-ArrowRight",run:L0e,shift:U0e,preventDefault:!0},{key:"ArrowUp",run:DO,shift:WO,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Qk,shift:eS},{mac:"Ctrl-ArrowUp",run:Xk,shift:Kk},{key:"ArrowDown",run:EO,shift:UO,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Jk,shift:tS},{mac:"Ctrl-ArrowDown",run:Gb,shift:Zk},{key:"PageUp",run:Xk,shift:Kk},{key:"PageDown",run:Gb,shift:Zk},{key:"Home",run:O0e,shift:H0e,preventDefault:!0},{key:"Mod-Home",run:Qk,shift:eS},{key:"End",run:M0e,shift:z0e,preventDefault:!0},{key:"Mod-End",run:Jk,shift:tS},{key:"Enter",run:nS,shift:nS},{key:"Mod-a",run:Y0e},{key:"Backspace",run:qb,shift:qb,preventDefault:!0},{key:"Delete",run:jO,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:KO,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:J0e,preventDefault:!0},{mac:"Mod-Backspace",run:tme,preventDefault:!0},{mac:"Mod-Delete",run:nme,preventDefault:!0}].concat(gme.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),bme=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:$0e,shift:F0e},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:T0e,shift:V0e},{key:"Alt-ArrowUp",run:ime},{key:"Shift-Alt-ArrowUp",run:ame},{key:"Alt-ArrowDown",run:sme},{key:"Shift-Alt-ArrowDown",run:lme},{key:"Mod-Alt-ArrowUp",run:K0e},{key:"Mod-Alt-ArrowDown",run:Z0e},{key:"Escape",run:Q0e},{key:"Mod-Enter",run:dme},{key:"Alt-l",mac:"Ctrl-l",run:j0e},{key:"Mod-i",run:X0e,preventDefault:!0},{key:"Mod-[",run:pme},{key:"Mod-]",run:hme},{key:"Mod-Alt-\\",run:fme},{key:"Shift-Mod-k",run:cme},{key:"Shift-Mod-\\",run:I0e},{key:"Mod-/",run:i0e},{key:"Alt-A",run:a0e},{key:"Ctrl-m",mac:"Shift-Alt-m",run:mme}].concat(vme);var oS={};class N0{constructor(e,n,o,r,i,s,a,l,c,u=0,d){this.p=e,this.stack=n,this.state=o,this.reducePos=r,this.pos=i,this.score=s,this.buffer=a,this.bufferBase=l,this.curContext=c,this.lookAhead=u,this.parent=d}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,o=0){let r=e.parser.context;return new N0(e,[],n,o,o,0,[],0,r?new rS(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let o=e>>19,r=e&65535,{parser:i}=this.p,s=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=i.dynamicPrecedence(r);if(a&&(this.score+=a),o==0){this.pushState(i.getGoto(this.state,r,!0),this.reducePos),r<i.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,s?8:4,!0),this.reduceContext(r,this.reducePos);return}let l=this.stack.length-(o-1)*3-(e&262144?6:0),c=l?this.stack[l-2]:this.p.ranges[0].from,u=this.reducePos-c;u>=2e3&&!(!((n=this.p.parser.nodeSet.types[r])===null||n===void 0)&&n.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=c,this.p.lastBigReductionSize=u));let d=l?this.stack[l-1]:0,f=this.bufferBase+this.buffer.length-d;if(r<i.minRepeatTerm||e&131072){let h=i.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,c,h,f+4,!0)}if(e&262144)this.state=this.stack[l];else{let h=this.stack[l-3];this.state=i.getGoto(h,r,!0)}for(;this.stack.length>l;)this.stack.pop();this.reduceContext(r,c)}storeNode(e,n,o,r=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let s=this,a=this.buffer.length;if(a==0&&s.parent&&(a=s.bufferBase-s.parent.bufferBase,s=s.parent),a>0&&s.buffer[a-4]==0&&s.buffer[a-1]>-1){if(n==o)return;if(s.buffer[a-2]>=n){s.buffer[a-2]=o;return}}}if(!i||this.pos==o)this.buffer.push(e,n,o,r);else{let s=this.buffer.length;if(s>0&&(this.buffer[s-4]!=0||this.buffer[s-1]<0)){let a=!1;for(let l=s;l>0&&this.buffer[l-2]>o;l-=4)if(this.buffer[l-1]>=0){a=!0;break}if(a)for(;s>0&&this.buffer[s-2]>o;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,r>4&&(r-=4)}this.buffer[s]=e,this.buffer[s+1]=n,this.buffer[s+2]=o,this.buffer[s+3]=r}}shift(e,n,o,r){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let i=e,{parser:s}=this.p;this.pos=r;let a=s.stateFlag(i,1);!a&&(r>o||n<=s.maxNode)&&(this.reducePos=r),this.pushState(i,a?o:Math.min(o,this.reducePos)),this.shiftContext(n,o),n<=s.maxNode&&this.buffer.push(n,o,r,4)}else this.pos=r,this.shiftContext(n,o),n<=this.p.parser.maxNode&&this.buffer.push(n,o,r,4)}apply(e,n,o,r){e&65536?this.reduce(e):this.shift(e,n,o,r)}useNode(e,n){let o=this.p.reused.length-1;(o<0||this.p.reused[o]!=e)&&(this.p.reused.push(e),o++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(n,r),this.buffer.push(o,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(;n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let o=e.buffer.slice(n),r=e.bufferBase+n;for(;e&&r==e.bufferBase;)e=e.parent;return new N0(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,o,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let o=e<=this.p.parser.maxNode;o&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,o?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new yme(this);;){let o=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(o==0)return!1;if((o&65536)==0)return!0;n.reduce(o)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let r=[];for(let i=0,s;i<n.length;i+=2)(s=n[i+1])!=this.state&&this.p.parser.hasAction(s,e)&&r.push(n[i],s);if(this.stack.length<120)for(let i=0;r.length<8&&i<n.length;i+=2){let s=n[i+1];r.some((a,l)=>l&1&&a==s)||r.push(n[i],s)}n=r}let o=[];for(let r=0;r<n.length&&o.length<4;r+=2){let i=n[r+1];if(i==this.state)continue;let s=this.split();s.pushState(i,this.pos),s.storeNode(0,s.pos,s.pos,4,!0),s.shiftContext(n[r],this.pos),s.reducePos=this.pos,s.score-=200,o.push(s)}return o}forceReduce(){let{parser:e}=this.p,n=e.stateSlot(this.state,5);if((n&65536)==0)return!1;if(!e.validAction(this.state,n)){let o=n>>19,r=n&65535,i=this.stack.length-o*3;if(i<0||e.getGoto(this.stack[i],r,!1)<0){let s=this.findForcedReduction();if(s==null)return!1;n=s}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],o=(r,i)=>{if(!n.includes(r))return n.push(r),e.allActions(r,s=>{if(!(s&393216))if(s&65536){let a=(s>>19)-i;if(a>1){let l=s&65535,c=this.stack.length-a*3;if(c>=0&&e.getGoto(this.stack[c],l,!1)>=0)return a<<19|65536|l}}else{let a=o(s,i+1);if(a!=null)return a}})};return o(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;n<this.stack.length;n+=3)if(this.stack[n]!=e.stack[n])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(n)))}reduceContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(n)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let n=new rS(this.curContext.tracker,e);n.hash!=this.curContext.hash&&this.emitContext(),this.curContext=n}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class rS{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class yme{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,o=e>>19;o==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(o-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=r}}class R0{constructor(e,n,o){this.stack=e,this.pos=n,this.index=o,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new R0(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new R0(this.stack,this.pos,this.index)}}function Hh(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let o=0,r=0;o<t.length;){let i=0;for(;;){let s=t.charCodeAt(o++),a=!1;if(s==126){i=65535;break}s>=92&&s--,s>=34&&s--;let l=s-32;if(l>=46&&(l-=46,a=!0),i+=l,a)break;i*=46}n?n[r++]=i:n=new e(i)}return n}class fp{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const iS=new fp;class xme{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=iS,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let o=this.range,r=this.rangeIndex,i=this.pos+e;for(;i<o.from;){if(!r)return null;let s=this.ranges[--r];i-=o.from-s.to,o=s}for(;n<0?i>o.to:i>=o.to;){if(r==this.ranges.length-1)return null;let s=this.ranges[++r];i+=s.from-o.to,o=s}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let n of this.ranges)if(n.to>e)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,o,r;if(n>=0&&n<this.chunk.length)o=this.pos+e,r=this.chunk.charCodeAt(n);else{let i=this.resolveOffset(e,1);if(i==null)return-1;if(o=i,o>=this.chunk2Pos&&o<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(o-this.chunk2Pos);else{let s=this.rangeIndex,a=this.range;for(;a.to<=o;)a=this.ranges[++s];this.chunk2=this.input.chunk(this.chunk2Pos=o),o+this.chunk2.length>a.to&&(this.chunk2=this.chunk2.slice(0,a.to-o)),r=this.chunk2.charCodeAt(0)}}return o>=this.token.lookAhead&&(this.token.lookAhead=o+1),r}acceptToken(e,n=0){let o=n?this.resolveOffset(n,-1):this.pos;if(o==null||o<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=o}acceptTokenTo(e,n){this.token.value=e,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:n}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=n,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),n=this.pos+e.length;this.chunk=n>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=iS,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,n){if(e>=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let o="";for(let r of this.ranges){if(r.from>=n)break;r.to>e&&(o+=this.input.read(Math.max(r.from,e),Math.min(r.to,n)))}return o}}class Uc{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:o}=n.p;wme(this.data,e,n,this.id,o.data,o.tokenPrecTable)}}Uc.prototype.contextual=Uc.prototype.fallback=Uc.prototype.extend=!1;Uc.prototype.fallback=Uc.prototype.extend=!1;function wme(t,e,n,o,r,i){let s=0,a=1<<o,{dialect:l}=n.p.parser;e:for(;(a&t[s])!=0;){let c=t[s+1];for(let h=s+3;h<c;h+=2)if((t[h+1]&a)>0){let g=t[h];if(l.allows(g)&&(e.token.value==-1||e.token.value==g||_me(g,e.token.value,r,i))){e.acceptToken(g);break}}let u=e.next,d=0,f=t[s+2];if(e.next<0&&f>d&&t[c+f*3-3]==65535){s=t[c+f*3-1];continue e}for(;d<f;){let h=d+f>>1,g=c+h+(h<<1),v=t[g],m=t[g+1]||65536;if(u<v)f=h;else if(u>=m)d=h+1;else{s=t[g+2],e.advance();continue e}}break}}function sS(t,e,n){for(let o=e,r;(r=t[o])!=65535;o++)if(r==n)return o-e;return-1}function _me(t,e,n,o){let r=sS(n,o,e);return r<0||sS(n,o,t)<r}const hr=typeof process<"u"&&oS&&/\bparse\b/.test(oS.LOG);let jv=null;function aS(t,e,n){let o=t.cursor(xn.IncludeAnonymous);for(o.moveTo(e);;)if(!(n<0?o.childBefore(e):o.childAfter(e)))for(;;){if((n<0?o.to<e:o.from>e)&&!o.type.isError)return n<0?Math.max(0,Math.min(o.to-1,e-25)):Math.min(t.length,Math.max(o.from+1,e+25));if(n<0?o.prevSibling():o.nextSibling())break;if(!o.parent())return n<0?0:t.length}}class kme{constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?aS(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?aS(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let o=this.trees[n],r=this.index[n];if(r==o.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=o.children[r],s=this.start[n]+o.positions[r];if(s>e)return this.nextStart=s,null;if(i instanceof Mn){if(s==e){if(s<this.safeFrom)return null;let a=s+i.length;if(a<=this.safeTo){let l=i.prop(Dt.lookAhead);if(!l||a+l<this.fragment.to)return i}}this.index[n]++,s+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(s),this.index.push(0))}else this.index[n]++,this.nextStart=s+i.length}}}class Sme{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(o=>new fp)}getActions(e){let n=0,o=null,{parser:r}=e.p,{tokenizers:i}=r,s=r.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,l=0;for(let c=0;c<i.length;c++){if((1<<c&s)==0)continue;let u=i[c],d=this.tokens[c];if(!(o&&!u.fallback)&&((u.contextual||d.start!=e.pos||d.mask!=s||d.context!=a)&&(this.updateCachedToken(d,u,e),d.mask=s,d.context=a),d.lookAhead>d.end+25&&(l=Math.max(d.lookAhead,l)),d.value!=0)){let f=n;if(d.extended>-1&&(n=this.addActions(e,d.extended,d.end,n)),n=this.addActions(e,d.value,d.end,n),!u.extend&&(o=d,n>f))break}}for(;this.actions.length>n;)this.actions.pop();return l&&e.setLookAhead(l),!o&&e.pos==this.stream.end&&(o=new fp,o.value=e.p.parser.eofTerm,o.start=o.end=e.pos,n=this.addActions(e,o.value,o.end,n)),this.mainToken=o,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new fp,{pos:o,p:r}=e;return n.start=o,n.end=Math.min(o+1,r.stream.end),n.value=o==r.stream.end?r.parser.eofTerm:0,n}updateCachedToken(e,n,o){let r=this.stream.clipPos(o.pos);if(n.token(this.stream.reset(r,e),o),e.value>-1){let{parser:i}=o.p;for(let s=0;s<i.specialized.length;s++)if(i.specialized[s]==e.value){let a=i.specializers[s](this.stream.read(e.start,e.end),o);if(a>=0&&o.p.parser.dialect.allows(a>>1)){(a&1)==0?e.value=a>>1:e.extended=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,n,o,r){for(let i=0;i<r;i+=3)if(this.actions[i]==e)return r;return this.actions[r++]=e,this.actions[r++]=n,this.actions[r++]=o,r}addActions(e,n,o,r){let{state:i}=e,{parser:s}=e.p,{data:a}=s;for(let l=0;l<2;l++)for(let c=s.stateSlot(i,l?2:1);;c+=3){if(a[c]==65535)if(a[c+1]==1)c=Ts(a,c+2);else{r==0&&a[c+1]==2&&(r=this.putAction(Ts(a,c+2),n,o,r));break}a[c]==n&&(r=this.putAction(Ts(a,c+1),n,o,r))}return r}}class Ame{constructor(e,n,o,r){this.parser=e,this.input=n,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new xme(n,r),this.tokens=new Sme(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[N0.start(this,e.top[0],i)],this.fragments=o.length&&this.stream.end-i>e.bufferLength*4?new kme(o,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,o=this.stacks=[],r,i;if(this.bigReductionCount>300&&e.length==1){let[s]=e;for(;s.forceReduce()&&s.stack.length&&s.stack[s.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;s<e.length;s++){let a=e[s];for(;;){if(this.tokens.mainToken=null,a.pos>n)o.push(a);else{if(this.advanceStack(a,o,e))continue;{r||(r=[],i=[]),r.push(a);let l=this.tokens.getMainToken(a);i.push(l.value,l.end)}}break}}if(!o.length){let s=r&&$me(r);if(s)return hr&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw hr&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&r){let s=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,i,o);if(s)return hr&&console.log("Force-finish "+this.stackID(s)),this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(o.length>s)for(o.sort((a,l)=>l.score-a.score);o.length>s;)o.pop();o.some(a=>a.reducePos>n)&&this.recovering--}else if(o.length>1){e:for(let s=0;s<o.length-1;s++){let a=o[s];for(let l=s+1;l<o.length;l++){let c=o[l];if(a.sameState(c)||a.buffer.length>500&&c.buffer.length>500)if((a.score-c.score||a.buffer.length-c.buffer.length)>0)o.splice(l--,1);else{o.splice(s--,1);continue e}}}o.length>12&&(o.sort((s,a)=>a.score-s.score),o.splice(12,o.length-12))}this.minStackPos=o[0].pos;for(let s=1;s<o.length;s++)o[s].pos<this.minStackPos&&(this.minStackPos=o[s].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,n,o){let r=e.pos,{parser:i}=this,s=hr?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,u=c?e.curContext.hash:0;for(let d=this.fragments.nodeAt(r);d;){let f=this.parser.nodeSet.types[d.type.id]==d.type?i.getGoto(e.state,d.type.id):-1;if(f>-1&&d.length&&(!c||(d.prop(Dt.contextHash)||0)==u))return e.useNode(d,f),hr&&console.log(s+this.stackID(e)+` (via reuse of ${i.getName(d.type.id)})`),!0;if(!(d instanceof Mn)||d.children.length==0||d.positions[0]>0)break;let h=d.children[0];if(h instanceof Mn&&d.positions[0]==0)d=h;else break}}let a=i.stateSlot(e.state,4);if(a>0)return e.reduce(a),hr&&console.log(s+this.stackID(e)+` (via always-reduce ${i.getName(a&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let c=0;c<l.length;){let u=l[c++],d=l[c++],f=l[c++],h=c==l.length||!o,g=h?e:e.split(),v=this.tokens.mainToken;if(g.apply(u,d,v?v.start:g.pos,f),hr&&console.log(s+this.stackID(g)+` (via ${(u&65536)==0?"shift":`reduce of ${i.getName(u&65535)}`} for ${i.getName(d)} @ ${r}${g==e?"":", split"})`),h)return!0;g.pos>r?n.push(g):o.push(g)}return!1}advanceFully(e,n){let o=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>o)return lS(e,n),!0}}runRecovery(e,n,o){let r=null,i=!1;for(let s=0;s<e.length;s++){let a=e[s],l=n[s<<1],c=n[(s<<1)+1],u=hr?this.stackID(a)+" -> ":"";if(a.deadEnd&&(i||(i=!0,a.restart(),hr&&console.log(u+this.stackID(a)+" (restarted)"),this.advanceFully(a,o))))continue;let d=a.split(),f=u;for(let h=0;h<10&&d.forceReduce()&&(hr&&console.log(f+this.stackID(d)+" (via force-reduce)"),!this.advanceFully(d,o));h++)hr&&(f=this.stackID(d)+" -> ");for(let h of a.recoverByInsert(l))hr&&console.log(u+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,o);this.stream.end>a.pos?(c==a.pos&&(c++,l=0),a.recoverByDelete(l,c),hr&&console.log(u+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),lS(a,o)):(!r||r.score<d.score)&&(r=d)}return r}stackToTree(e){return e.close(),Mn.build({buffer:R0.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let n=(jv||(jv=new WeakMap)).get(e);return n||jv.set(e,n=String.fromCodePoint(this.nextStackID++)),n+e}}function lS(t,e){for(let n=0;n<e.length;n++){let o=e[n];if(o.pos==t.pos&&o.sameState(t)){e[n].score<t.score&&(e[n]=t);return}}e.push(t)}class Cme{constructor(e,n,o){this.source=e,this.flags=n,this.disabled=o}allows(e){return!this.disabled||this.disabled[e]==0}}class F0 extends pO{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let a=0;a<e.repeatNodeCount;a++)n.push("");let o=Object.keys(e.topRules).map(a=>e.topRules[a][1]),r=[];for(let a=0;a<n.length;a++)r.push([]);function i(a,l,c){r[a].push([l,l.deserialize(String(c))])}if(e.nodeProps)for(let a of e.nodeProps){let l=a[0];typeof l=="string"&&(l=Dt[l]);for(let c=1;c<a.length;){let u=a[c++];if(u>=0)i(u,l,a[c++]);else{let d=a[c+-u];for(let f=-u;f>0;f--)i(a[c++],l,d);c++}}}this.nodeSet=new cx(n.map((a,l)=>dr.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:r[l],top:o.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=uO;let s=Hh(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;a<this.specializerSpecs.length;a++)this.specialized[a]=this.specializerSpecs[a].term;this.specializers=this.specializerSpecs.map(cS),this.states=Hh(e.states,Uint32Array),this.data=Hh(e.stateData),this.goto=Hh(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(a=>typeof a=="number"?new Uc(s,a):a),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,o){let r=new Ame(this,e,n,o);for(let i of this.wrappers)r=i(r,e,n,o);return r}getGoto(e,n,o=!1){let r=this.goto;if(n>=r[0])return-1;for(let i=r[n+1];;){let s=r[i++],a=s&1,l=r[i++];if(a&&o)return l;for(let c=i+(s>>1);i<c;i++)if(r[i]==e)return l;if(a)return-1}}hasAction(e,n){let o=this.data;for(let r=0;r<2;r++)for(let i=this.stateSlot(e,r?2:1),s;;i+=3){if((s=o[i])==65535)if(o[i+1]==1)s=o[i=Ts(o,i+2)];else{if(o[i+1]==2)return Ts(o,i+2);break}if(s==n||s==0)return Ts(o,i+1)}return 0}stateSlot(e,n){return this.states[e*6+n]}stateFlag(e,n){return(this.stateSlot(e,0)&n)>0}validAction(e,n){return!!this.allActions(e,o=>o==n?!0:null)}allActions(e,n){let o=this.stateSlot(e,4),r=o?n(o):void 0;for(let i=this.stateSlot(e,1);r==null;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=Ts(this.data,i+2);else break;r=n(Ts(this.data,i+1))}return r}nextStates(e){let n=[];for(let o=this.stateSlot(e,1);;o+=3){if(this.data[o]==65535)if(this.data[o+1]==1)o=Ts(this.data,o+2);else break;if((this.data[o+2]&1)==0){let r=this.data[o+1];n.some((i,s)=>s&1&&i==r)||n.push(this.data[o],r)}}return n}configure(e){let n=Object.assign(Object.create(F0.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let o=this.topRules[e.top];if(!o)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=o}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(o=>{let r=e.tokenizers.find(i=>i.from==o);return r?r.to:o})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((o,r)=>{let i=e.specializers.find(a=>a.from==o.external);if(!i)return o;let s=Object.assign(Object.assign({},o),{external:i.to});return n.specializers[r]=cS(s),s})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),o=n.map(()=>!1);if(e)for(let i of e.split(" ")){let s=n.indexOf(i);s>=0&&(o[s]=!0)}let r=null;for(let i=0;i<n.length;i++)if(!o[i])for(let s=this.dialects[n[i]],a;(a=this.data[s++])!=65535;)(r||(r=new Uint8Array(this.maxTerm+1)))[a]=1;return new Cme(e,o,r)}static deserialize(e){return new F0(e)}}function Ts(t,e){return t[e]|t[e+1]<<16}function $me(t){let e=null;for(let n of t){let o=n.p.stoppedAt;(n.pos==n.p.stream.end||o!=null&&n.pos>o)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.score<n.score)&&(e=n)}return e}function cS(t){if(t.external){let e=t.extend?1:0;return(n,o)=>t.external(n,o)<<1|e}return t.get}const Tme={__proto__:null,chart:10,data:16,colorize:38,highlight:40,areafill:44,range:48,note:52,annotation:56,series:60,scene:64,step:66,transform:72},Mme=F0.deserialize({version:14,states:",`OYQPOOQOQPOOO_QPO'#C_OdQPO,58yO!dQPO1G.eOOQO'#Cf'#CfO!kQPO'#CmOOQO'#Cb'#CbOOQO'#DR'#DRO!pQPO7+$PO!wQPO'#CcO!|QPO'#CnO#RQPO'#CqO#WQPO'#CsO#]QPO'#CuO#bQPO'#CwO#gQPO'#CyO#lQPO'#DPO#qQPO'#C{OOQO7+$P7+$PO#yQPO,59XOOQO-E7P-E7POOQO<<Gk<<GkO$XQPO,58}O$dQPO,59YO$iQPO,59]O$nQPO,59_O$yQPO,59aO%UQPO,59cO%ZQPO,59eO%`QPO,59kO&YQPO,59gO&aQPO,59gOOQO'#Cj'#CjOOQO1G.s1G.sO&fQPO'#CmOOQO'#Ce'#CeOOQO'#DS'#DSO&kQPO1G.iOOQO1G.i1G.iO&vQPO1G.tO'RQPO1G.wOOQO'#DU'#DUO'WQPO1G.yOOQO1G.y1G.yO'cQPO1G.{OOQO1G.{1G.{O'nQPO1G.}O'yQPO1G/PO(UQPO1G/VOOQO'#DO'#DOOOQO'#DV'#DVO(aQPO1G/ROOQO1G/R1G/RO(aQPO1G/RO#yQPO,59XOOQO-E7Q-E7QOOQO7+$T7+$TO(hQPO7+$`OOQO7+$`7+$`O(sQPO7+$cOOQO-E7S-E7SOOQO7+$e7+$eOOQO7+$g7+$gO)OQPO7+$iOOQO7+$i7+$iO)ZQPO7+$kOOQO7+$k7+$kO)fQPO7+$qOOQO7+$q7+$qOOQO-E7T-E7TOOQO7+$m7+$mO)qQPO7+$mO)xQPO1G.sOOQO1G.k1G.kOOQO<<Gz<<GzO*WQPO<<G}OOQO<<G}<<G}OOQO<<HT<<HTOOQO<<HV<<HVOOQO<<H]<<H]OOQO<<HX<<HXO#yQPO'#DTO*cQPO,59TOOQOAN=iAN=iOOQO,59o,59oOOQO-E7R-E7R",stateData:"*w~O|OSPOS~OTQO~OSRO~O}SO~OSTOWYOZTOcZOdZOf[Oh]Oj^Ol_On`OpbOqbOtaO~O!PcO~PiO[dO~O!PfO~PiO}gO~OZhO~OZiO~O}jO~O}kO~OZlO~OZmO~OSnO~OZpO}oO~OSqOZqO_qO`qO~OSTOZTO!PwO~O}xO~OZyO~OSTOZTO!P|O~OSTOZTO!P!OO~O}!PO~O}!QO~O}!RO~OSTOWYOZTOcZOdZOf[Oh]Oj^Ol_On`OtaO~O!P!VO~P%eO}!WO~O[!XO~OSTOZTO!P!ZO~OSTOZTO!P!]O~O}!^O~OSTOZTO!P!`O~OSTOZTO!P!aO~OSTOZTO!P!cO~OSTOZTO!P!eO~OSTOZTO!P!gO~O!P!iO~P%eOSTOZTO!P!mO~OSTOZTO!P!oO~OSTOZTO!P!pO~OSTOZTO!P!qO~OSTOZTO!P!rO~O!P!sO~P%eO!O!tOSaiZai!Pai~OSTOZTO!P!vO~O!O!tOS]aZ]a!P]a~O_`PSP~",goto:"%`zPPP{PP!O!SP!^!bPP!|#PPP#Y!SPP!SP!SP!SP!SP!SP#xPP#|!SP$S$Y$`$f%URPOTWSXSVSXX!So!U!W!jTugvxUSXjkox{}!P!Q!R!U!W![!^!b!d!f!j!nTsgvR!l!XQrdQ!k!XR!w!tSVSXStgvlzjkx{}!P!Q!R![!^!b!d!f!nX!So!U!W!jTVSXX!To!U!W!jQXSReXQvgR!YvQ!u!kR!x!uQ{jQ}kQ![x^!_{}![!b!d!f!nQ!b!PQ!d!QQ!f!RR!n!^Q!UoS!h!U!jR!j!W",nodeNames:"⚠ LineComment Chart ChartDecl Identifier chart ChartMember DataBlock data DataEntry PropertyKey String Equals ValueList PropertyValue Percentage Number Property Colorize colorize highlight AreaFill areafill RangeAnnotation range NoteAnnotation note Annotation annotation Series series Scene scene step SceneMember Transform transform",maxTerm:47,skippedNodes:[0,1],repeatNodeCount:5,tokenData:"']~RfX^!gpq!grs#[st$u|}%^}!O%c!P!Q&_!Q![%i!_!`&|!c!}$u#R#S$u#T#o$u#o#p'R#q#r'W#y#z!g$f$g!g#BY#BZ!g$IS$I_!g$I|$JO!g$JT$JU!g$KV$KW!g&FU&FV!g~!lY|~X^!gpq!g#y#z!g$f$g!g#BY#BZ!g$IS$I_!g$I|$JO!g$JT$JU!g$KV$KW!g&FU&FV!g~#_VOr#[rs#ts#O#[#O#P#y#P;'S#[;'S;=`$o<%lO#[~#yOZ~~#|ZOr#[rs#[s#O#[#O#P#[#P#b#[#b#c#[#c#h#[#h#i#[#i;'S#[;'S;=`$o<%lO#[~$rP;=`<%l#[~$zUS~st$u}!O$u!Q![$u!c!}$u#R#S$u#T#o$u~%cO!O~~%fP!Q![%i~%nR`~uv%w!O!P%|!Q![%i~%|O_~~&PP!Q![&S~&XQ`~uv%w!Q![&S~&bP!P!Q&e~&jSP~OY&eZ;'S&e;'S;=`&v<%lO&e~&yP;=`<%l&e~'RO[~~'WO}~~']O!P~",tokenizers:[0],topRules:{Chart:[0,2]},specialized:[{term:4,get:t=>Tme[t]||-1}],tokenPrec:447}),eB=Mme.configure({props:[mO({chart:ct.keyword,data:ct.keyword,colorize:ct.keyword,highlight:ct.keyword,areafill:ct.keyword,annotation:ct.keyword,range:ct.keyword,note:ct.keyword,series:ct.keyword,scene:ct.keyword,step:ct.keyword,transform:ct.keyword,Identifier:ct.variableName,String:ct.string,Number:ct.number,Percentage:ct.number,Equals:ct.operator,LineComment:ct.lineComment,"{ }":ct.brace})]}),Ome=L0.define({parser:eB,languageData:{commentTokens:{line:"//"}}}),Bme=jpe(yO);function Lme(){return new Npe(Ome)}function Xv(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function _be(t){const e=eB.parse(t);let n=0,o="";return bO(e,yO,(r,i,s)=>{r>n&&(o+=Xv(t.slice(n,r))),o+=`<span class="${s}">${Xv(t.slice(r,i))}</span>`,n=i}),n<t.length&&(o+=Xv(t.slice(n))),o}const Pme={class:"d-flex flex-column h-100"},Dme={key:0,class:"text-danger small mt-1"},Eme=le({__name:"ChartEditDsl",setup(t){const{dsl:e}=Rf(),{applyDsl:n}=Fc(),o=ht("editorEl"),r=ze();let i,s=!1;function a(l){if(!l.docChanged||s)return;const c=l.state.doc.toString(),u=n(c);u.success?r.value=void 0:r.value=u.error}return fn(()=>{const l=Zt.create({doc:e.value,extensions:[cO.of([...bme,...k0e]),p0e(),Lme(),Bme,kt.updateListener.of(a),kt.theme({"&":{height:"100%",backgroundColor:"var(--bc-tile-bg-elevated)"},".cm-scroller":{overflow:"auto"},".cm-content":{fontFamily:"var(--bs-font-monospace)"},".cm-gutters":{backgroundColor:"var(--bc-tile-bg-elevated)",color:"var(--bs-secondary-color)",borderRight:"1px solid var(--bs-border-color)"}})]});i=new kt({state:l,parent:o.value})}),qe(e,l=>{!i||i.state.doc.toString()===l||(s=!0,i.dispatch({changes:{from:0,to:i.state.doc.length,insert:l}}),s=!1)}),Js(()=>{i==null||i.destroy(),i=void 0}),(l,c)=>(w(),R("div",Pme,[T("div",{ref_key:"editorEl",ref:o,class:"flex-grow-1 overflow-auto"},null,512),p(r)?(w(),R("div",Dme,be(p(r)),1)):ie("",!0)]))}}),Ime={key:1,class:"position-absolute",width:"0",height:"0","aria-hidden":"true"},Nme=le({__name:"PreviewChart",setup(t){const e=ht("containerRef");q2(e);const{containerRef:n}=WT();qe(e,D=>{n.value=D},{immediate:!0});const{selectAnnotation:o}=fr();function r(D){var $;const C=D.target.closest("g[data-annotation-index]");if(!C)return;D.preventDefault(),($=window.getSelection())==null||$.removeAllRanges();const M=C.getAttribute("data-annotation-id");if(M){o(M);return}const P=parseInt(C.getAttribute("data-annotation-index")||"",10);isNaN(P)||o(P)}fn(()=>{var D;(D=e.value)==null||D.addEventListener("dblclick",r)}),qs(()=>{var D;(D=e.value)==null||D.removeEventListener("dblclick",r)});const{cvdMode:i}=$t(qT()),s=ht("cvdDefsRef");qe([i,s],([D,N])=>{if(N){for(;N.firstChild;)N.removeChild(N.firstChild);D&&N.appendChild(ioe(D))}},{immediate:!0});const a=A(()=>{if(i.value)return{filter:`url(#${j$(i.value)})`}}),{layout:l}=hn(),{scenes:c,activeIndex:u,playing:d,setActive:f,nextScene:h,previousScene:g,startPlayback:v,stopPlayback:m}=_n(),b=ze(null),y={buttons:M1,"progress-bar":jA,"dot-stepper":XA,"minimal-arrows":KA},x=A(()=>y[l.value.playerType]),_=A(()=>c.value.length+1),k=A(()=>u.value+2),E=A(()=>c.value.length>=1&&l.value.playerType!=="none");function L(D){f(D-2)}let S=null;function B(){const D=e.value;return D?D.querySelector(".bc-frame-footer"):null}return qe(e,D=>{if(S&&(S.disconnect(),S=null),!D){b.value=null;return}b.value=B(),S=new MutationObserver(()=>{b.value=B()}),S.observe(D,{childList:!0,subtree:!0})},{immediate:!0}),qs(()=>{S&&(S.disconnect(),S=null)}),(D,N)=>(w(),R(We,null,[T("div",{ref_key:"containerRef",ref:e,class:"w-100 h-100",style:Pt(p(a))},null,4),p(b)&&p(E)?(w(),Z(ny,{key:0,to:p(b)},[(w(),Z(Gt(p(x)),{total:p(_),current:p(k),playing:p(d),position:p(l).playerPosition,"onUpdate:current":L,onPrevious:p(g),onNext:p(h),onPlay:p(v),onPause:p(m)},null,40,["total","current","playing","position","onPrevious","onNext","onPlay","onPause"]))],8,["to"])):ie("",!0),p(i)?(w(),R("svg",Ime,[T("defs",{ref_key:"cvdDefsRef",ref:s},null,512)])):ie("",!0)],64))}}),tB=Symbol("sceneTimeline"),Rme={key:0,class:"floating-scene-timeline"},Fme=le({__name:"FloatingSceneTimeline",setup(t){const e=Yt(tB,null),{isNarrow:n}=gi();return(o,r)=>p(e)&&!p(n)&&p(e).showTimeline.value?(w(),R("div",Rme,[H(p(DG),{scenes:p(e).scenes.value,"active-index":p(e).activeIndex.value,playing:p(e).playing.value,floating:"","onUpdate:activeIndex":p(e).onSelect,onAdd:p(e).onAdd,onRemove:p(e).onRemove,onPlay:p(e).onPlay,onPause:p(e).onPause},null,8,["scenes","active-index","playing","onUpdate:activeIndex","onAdd","onRemove","onPlay","onPause"])])):ie("",!0)}}),nB=Oe(Fme,[["__scopeId","data-v-05a62bbc"]]),Vme={class:"chart-edit-panel__canvas-frame"},zme=le({__name:"ChartEditPanel",setup(t){const e=fr(),{viewMode:n,activeTab:o,canvasMode:r,showDimensions:i}=$t(e),{selectTab:s,setLastNarrowEditTab:a}=e,{mode:l}=ic(),{isNarrow:c}=gi(),{layout:u}=hn(),{cardClass:d,cardStyle:f}=G2(u,"chart-edit-panel__canvas__card"),{sections:h}=RT(),g=A({get:()=>!!o.value,set:N=>{N||s("")}});qe(l,N=>{N==="drawer"&&o.value&&(a(o.value),s(""))},{immediate:!0});function v(N){a(N),s(N)}const m=A(()=>h.value.map(N=>({key:N.key,label:N.label,icon:N.icon}))),b=A(()=>({"chart-edit-panel--narrow":c.value})),y=A(()=>({[`chart-edit-panel__canvas--${r.value}`]:r.value!=="blueprint","chart-edit-panel__canvas--dsl":n.value!=="preview","chart-edit-panel__canvas--dimensions":n.value==="preview"&&i.value})),x={type:"Chart Type",text:"Text",style:"Style",layout:"Layout",series:"Series",axes:"Axes",annotate:"Annotate",interactions:"Interactions"},_=A(()=>x[o.value]??"Panel"),k=ht("canvasRef"),E=ht("cardRef"),L=Re(0),S=Re(0);function B(){const N=E.value;N&&(L.value=N.offsetLeft,S.value=N.offsetTop)}ss(k,B),ss(E,B);const D=A(()=>({"--grid-offset-x":`${L.value}px`,"--grid-offset-y":`${S.value}px`}));return(N,C)=>{const M=Nme,P=Eme,$=ET,F=DT,V=U2,U=tfe,K=Xde,ae=Hde,me=Vde,de=Jue,ve=que,te=Fue,pe=aue,we=Yle,J=W2,ge=fg,re=Tle;return w(),R("div",{class:Te(["chart-edit-panel",p(b)])},[T("div",Vme,[T("div",{ref_key:"canvasRef",ref:k,class:Te(["chart-edit-panel__canvas",p(y)]),style:Pt(p(D))},[p(n)==="preview"?(w(),R("div",{key:0,ref_key:"cardRef",ref:E,class:Te(["chart-edit-panel__canvas__card",p(d)]),style:Pt(p(f))},[H(M)],6)):(w(),Z(P,{key:1,class:"chart-edit-panel__canvas__dsl"})),p(n)==="preview"&&p(i)?(w(),Z($,{key:2,"card-ref":p(E),"canvas-ref":p(k),layout:p(u)},null,8,["card-ref","canvas-ref","layout"])):ie("",!0),H(nB)],6),p(n)==="preview"?(w(),Z(F,{key:0})):ie("",!0)]),H(ge,{"drawer-open":p(g),"onUpdate:drawerOpen":C[0]||(C[0]=oe=>Xe(g)?g.value=oe:null),title:p(_),"container-ref":p(k),onClose:C[1]||(C[1]=oe=>p(s)(""))},wi({default:ee(()=>[p(o)==="type"?(w(),Z(K,{key:0})):p(o)==="text"?(w(),Z(ae,{key:1})):p(o)==="style"?(w(),Z(me,{key:2})):p(o)==="series"?(w(),Z(de,{key:3})):p(o)==="axes"?(w(),Z(ve,{key:4})):p(o)==="layout"?(w(),Z(te,{key:5})):p(o)==="annotate"?(w(),Z(pe,{key:6})):p(o)==="interactions"?(w(),Z(we,{key:7})):ie("",!0)]),_:2},[p(l)==="drawer"?{name:"tabs",fn:ee(()=>[H(V,{tabs:p(m),"model-value":p(o),sticky:"","onUpdate:modelValue":v},null,8,["tabs","model-value"])]),key:"0"}:void 0,p(l)!=="drawer"?{name:"header",fn:ee(()=>[H(U)]),key:"1"}:void 0,p(l)!=="drawer"?{name:"footer",fn:ee(()=>[H(J)]),key:"2"}:void 0]),1032,["drawer-open","title","container-ref"]),p(c)?ie("",!0):(w(),Z(re,{key:0}))],2)}}}),Hme=Oe(zme,[["__scopeId","data-v-9b66c576"]]),Wme={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Ume(t,e){return w(),R("svg",Wme,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M104 32H64a16 16 0 0 0-16 16v160a16 16 0 0 0 16 16h40a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16m0 176H64V48h40Zm88-176h-40a16 16 0 0 0-16 16v160a16 16 0 0 0 16 16h40a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16m0 176h-40V48h40Z"},null,-1)])])}const Gme=Me({name:"ph-columns",render:Ume}),qme={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Yme(t,e){return w(),R("svg",qme,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"m245.66 74.34l-32-32a8 8 0 0 0-11.32 11.32L220.69 72H208c-49.33 0-61.05 28.12-71.38 52.92c-9.38 22.51-16.92 40.59-49.48 42.84a40 40 0 1 0 .1 16c43.26-2.65 54.34-29.15 64.14-52.69C161.41 107 169.33 88 208 88h12.69l-18.35 18.34a8 8 0 0 0 11.32 11.32l32-32a8 8 0 0 0 0-11.32M48 200a24 24 0 1 1 24-24a24 24 0 0 1-24 24"},null,-1)])])}const jme=Me({name:"ph-flow-arrow",render:Yme}),Xme={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Kme(t,e){return w(),R("svg",Xme,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M176 232a8 8 0 0 1-8 8H88a8 8 0 0 1 0-16h80a8 8 0 0 1 8 8m40-128a87.55 87.55 0 0 1-33.64 69.21A16.24 16.24 0 0 0 176 186v6a16 16 0 0 1-16 16H96a16 16 0 0 1-16-16v-6a16 16 0 0 0-6.23-12.66A87.59 87.59 0 0 1 40 104.49C39.74 56.83 78.26 17.14 125.88 16A88 88 0 0 1 216 104m-16 0a72 72 0 0 0-73.74-72c-39 .92-70.47 33.39-70.26 72.39a71.65 71.65 0 0 0 27.64 56.3A32 32 0 0 1 96 186v6h64v-6a32.15 32.15 0 0 1 12.47-25.35A71.65 71.65 0 0 0 200 104m-16.11-9.34a57.6 57.6 0 0 0-46.56-46.55a8 8 0 0 0-2.66 15.78c16.57 2.79 30.63 16.85 33.44 33.45A8 8 0 0 0 176 104a9 9 0 0 0 1.35-.11a8 8 0 0 0 6.54-9.23"},null,-1)])])}const Zme=Me({name:"ph-lightbulb",render:Kme});function oB(){return{sections:[{key:"column",label:"Columns",icon:Gme},{key:"transforms",label:"Transforms",icon:jme},{key:"parsing",label:"Parsing",icon:LT},{key:"reco",label:"Recommendations",icon:Zme}]}}const Qme=le({__name:"DataSideIconRail",props:{disabledTabs:{default:()=>[]}},setup(t){const e=t,n=fr(),{dataPanelTab:o}=$t(n),{openDataPanel:r}=n,{mode:i,toggleMode:s}=ic(),{sections:a}=oB(),l=A(()=>a.filter(d=>!e.disabledTabs.includes(d.key)).map(d=>({value:d.key,icon:d.icon,tooltip:d.tooltip??d.label})));function c(d){r(d)}function u(){i.value==="closed"&&r(o.value||"column"),s()}return(d,f)=>{const h=z2;return w(),Z(h,{"active-tab":p(o),items:p(l),onSelect:c,onToggleMode:u},null,8,["active-tab","items"])}}}),Jme={class:"reco-card__preview"},ege={class:"reco-card__body"},tge={class:"reco-card__body__title"},nge={class:"reco-card__body__reason"},oge=le({__name:"DataRecommendationCard",props:{chartType:{},label:{},fitness:{},reason:{}},emits:["select"],setup(t){const e={[Le.BarVertical]:Me(YT),[Le.BarHorizontal]:Me(jT),[Le.BarMulti]:Me(XT),[Le.Line]:Me(KT),[Le.LineMulti]:Me(ZT),[Le.Donut]:Me(QT),[Le.Pie]:Me(JT)},n=t,o=A(()=>e[n.chartType]),r=A(()=>n.fitness==="best"?"reco-card__body__title__badge--best":n.fitness==="good"?"reco-card__body__title__badge--good":"reco-card__body__title__badge--alt"),i=A(()=>n.fitness==="best"?"Best match":n.fitness==="good"?"Good fit":"Alternative");return(s,a)=>(w(),R("button",{class:Te(["reco-card",{"reco-card--best":t.fitness==="best"}]),onClick:a[0]||(a[0]=l=>s.$emit("select",t.chartType))},[T("div",Jme,[p(o)?(w(),Z(Gt(p(o)),{key:0,class:"reco-card__preview__thumb-svg"})):ie("",!0)]),T("div",ege,[T("div",tge,[Ye(be(t.label)+" ",1),T("span",{class:Te(["reco-card__body__title__badge",p(r)])},be(p(i)),3)]),T("div",nge,be(t.reason),1)])],2))}}),rge=Oe(oge,[["__scopeId","data-v-0e22d5d1"]]);function ige(){const{displayRows:t,displayColumnTypes:e}=Ko(),n=A(()=>{const r=e.value,i=r.filter(c=>c==="string").length,s=r.filter(c=>c==="number").length,a=r.filter(c=>c==="date").length,l=[];return i>0&&l.push(`${i} categorical`),a>0&&l.push(`${a} date`),s>0&&l.push(`${s} numeric`),l.length>0?`${l.join(" + ")} column${r.length!==1?"s":""}`:"No data"});return{recommendations:A(()=>ooe(e.value,t.value.length)),dataSummary:n}}const sge={class:"data-recommendations"},age={class:"data-recommendations__summary"},lge={key:0,class:"text-muted text-center py-3"},cge=le({__name:"DataRecommendations",setup(t){const{recommendations:e,dataSummary:n}=ige(),o=hn();function r(i){o.chartType.value=i}return(i,s)=>{const a=rge;return w(),R("div",sge,[T("p",age," Based on your data: "+be(p(n)),1),p(e).length===0?(w(),R("div",lge," Load data to see recommendations ")):ie("",!0),(w(!0),R(We,null,mt(p(e),l=>(w(),Z(a,{key:l.chartType,"chart-type":l.chartType,label:l.label,fitness:l.fitness,reason:l.reason,onSelect:r},null,8,["chart-type","label","fitness","reason"]))),128))])}}}),uge=Oe(cge,[["__scopeId","data-v-47bbaf64"]]),uS={firstRowIsHeader:!0,delimiter:"auto",decimalSeparator:".",treatEmptyAsNull:!0,trimWhitespace:!0},dge=Bo("parseOptions",()=>{const t=lr({...uS});function e(o,r){t[o]=r}function n(){Object.assign(t,{...uS})}return{...Q0(t),setOption:e,reset:n}});function rB(){const t=dge(),{firstRowIsHeader:e,delimiter:n,decimalSeparator:o,treatEmptyAsNull:r,trimWhitespace:i}=$t(t);return{firstRowIsHeader:e,delimiter:n,decimalSeparator:o,treatEmptyAsNull:r,trimWhitespace:i,setOption:t.setOption,reset:t.reset}}const fge={class:"data-parse-settings"},hge={class:"data-parse-settings__field"},pge={class:"data-parse-settings__field"},mge=le({__name:"DataParseSettings",setup(t){const e=rB(),{firstRowIsHeader:n,delimiter:o,decimalSeparator:r,treatEmptyAsNull:i,trimWhitespace:s}=$t(e),{setOption:a}=e,{sourceFormat:l}=Ko(),c=A(()=>l.value!=="delimited"),u=A({get:()=>n.value,set:b=>a("firstRowIsHeader",b)}),d=A({get:()=>o.value,set:b=>a("delimiter",b)}),f=A({get:()=>r.value,set:b=>a("decimalSeparator",b)}),h=A({get:()=>i.value,set:b=>a("treatEmptyAsNull",b)}),g=A({get:()=>s.value,set:b=>a("trimWhitespace",b)}),v=[{value:"auto",label:"Auto-detect"},{value:",",label:"Comma (,)"},{value:" ",label:"Tab"},{value:";",label:"Semicolon (;)"},{value:"|",label:"Pipe (|)"}],m=[{value:".",label:"Period (.)"},{value:",",label:"Comma (,)"}];return(b,y)=>(w(),R("div",fge,[H(p(Fs),{modelValue:p(u),"onUpdate:modelValue":y[0]||(y[0]=x=>Xe(u)?u.value=x:null),switch:""},{default:ee(()=>[...y[5]||(y[5]=[Ye(" First row is header ",-1)])]),_:1},8,["modelValue"]),T("div",hge,[y[6]||(y[6]=T("div",{class:"data-parse-settings__field__label"}," Delimiter ",-1)),H(p(Rn),{modelValue:p(d),"onUpdate:modelValue":y[1]||(y[1]=x=>Xe(d)?d.value=x:null),label:"",options:v,disabled:p(c),block:""},null,8,["modelValue","disabled"])]),T("div",pge,[y[7]||(y[7]=T("div",{class:"data-parse-settings__field__label"}," Decimal Separator ",-1)),H(p(Rn),{modelValue:p(f),"onUpdate:modelValue":y[2]||(y[2]=x=>Xe(f)?f.value=x:null),label:"",options:m,block:""},null,8,["modelValue"])]),H(p(Fs),{modelValue:p(h),"onUpdate:modelValue":y[3]||(y[3]=x=>Xe(h)?h.value=x:null),switch:""},{default:ee(()=>[...y[8]||(y[8]=[Ye(" Treat empty as null ",-1)])]),_:1},8,["modelValue"]),H(p(Fs),{modelValue:p(g),"onUpdate:modelValue":y[4]||(y[4]=x=>Xe(g)?g.value=x:null),switch:""},{default:ee(()=>[...y[9]||(y[9]=[Ye(" Trim whitespace ",-1)])]),_:1},8,["modelValue"])]))}}),gge=Oe(mge,[["__scopeId","data-v-872473d2"]]),vge={class:"output-block"},bge={class:"output-block__meta"},yge=le({__name:"DataTransformOutputBlock",props:{columns:{},rows:{}},setup(t){return(e,n)=>(w(),R("div",vge,[n[0]||(n[0]=T("span",{class:"output-block__icon"},[T("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",width:"14",height:"14"},[T("path",{d:"M20 6L9 17l-5-5"})])],-1)),n[1]||(n[1]=T("span",null,"Output",-1)),T("span",bge,be(t.columns)+" cols · "+be(t.rows)+" rows",1)]))}}),xge=Oe(yge,[["__scopeId","data-v-b1080d62"]]),wge={class:"add-wrap"},_ge={key:0,class:"add-wrap__dropdown"},kge=["disabled","onClick"],Sge={class:"add-wrap__dropdown__item__text"},Age={class:"add-wrap__dropdown__item__text__name"},Cge={class:"add-wrap__dropdown__item__text__desc"},$ge=le({__name:"DataTransformAddButton",emits:["add"],setup(t,{emit:e}){const n=e,o=Re(!1),r=[{value:Je.Sort,label:"Sort",desc:"Reorder rows by column values",disabled:!1},{value:Je.Filter,label:"Filter",desc:"Keep or exclude rows by condition",disabled:!1},{value:Je.HideColumns,label:"Hide Columns",desc:"Remove columns from output",disabled:!1},{value:Je.Transpose,label:"Transpose",desc:"Swap rows and columns",disabled:!1},{value:Je.Parse,label:"Parse",desc:"Transform column values",disabled:!1},{value:Je.Rename,label:"Rename Column",desc:"Change a column name",disabled:!1},{value:Je.GroupBy,label:"Group By",desc:"Aggregate rows by column values",disabled:!1},{value:Je.Computed,label:"Computed Column",desc:"Derive new column (coming soon)",disabled:!0}];function i(l){return{[Je.Sort]:"add-wrap__dropdown__item__icon--sort",[Je.Filter]:"add-wrap__dropdown__item__icon--filter",[Je.HideColumns]:"add-wrap__dropdown__item__icon--hide-columns",[Je.Transpose]:"add-wrap__dropdown__item__icon--transpose",[Je.Parse]:"add-wrap__dropdown__item__icon--parse",[Je.Rename]:"add-wrap__dropdown__item__icon--rename",[Je.GroupBy]:"add-wrap__dropdown__item__icon--group",[Je.Computed]:"add-wrap__dropdown__item__icon--computed"}[l]??""}function s(l){return{[Je.Sort]:"S",[Je.Filter]:"F",[Je.HideColumns]:"H",[Je.Transpose]:"T",[Je.Parse]:"P",[Je.Rename]:"R",[Je.GroupBy]:"G",[Je.Computed]:"C"}[l]??"?"}function a(l){n("add",l),o.value=!1}return(l,c)=>(w(),R("div",wge,[H(p(Al),{label:"Add",onClick:c[0]||(c[0]=u=>o.value=!p(o))}),p(o)?(w(),R("div",_ge,[(w(),R(We,null,mt(r,u=>T("button",{key:u.value,class:"add-wrap__dropdown__item",disabled:u.disabled,onClick:d=>a(u.value)},[T("span",{class:Te(["add-wrap__dropdown__item__icon",i(u.value)])},be(s(u.value)),3),T("div",Sge,[T("div",Age,be(u.label),1),T("div",Cge,be(u.desc),1)])],8,kge)),64))])):ie("",!0)]))}}),Tge=Oe($ge,[["__scopeId","data-v-ac055819"]]),Mge={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Oge(t,e){return w(),R("svg",Mge,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M128 128a8 8 0 0 1-8 8H48a8 8 0 0 1 0-16h72a8 8 0 0 1 8 8M48 72h136a8 8 0 0 0 0-16H48a8 8 0 0 0 0 16m56 112H48a8 8 0 0 0 0 16h56a8 8 0 0 0 0-16m125.66-21.66a8 8 0 0 0-11.32 0L192 188.69V112a8 8 0 0 0-16 0v76.69l-26.34-26.35a8 8 0 0 0-11.32 11.32l40 40a8 8 0 0 0 11.32 0l40-40a8 8 0 0 0 0-11.32"},null,-1)])])}const Bge=Me({name:"ph-sort-ascending",render:Oge}),Lge={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Pge(t,e){return w(),R("svg",Lge,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M230.6 49.53A15.81 15.81 0 0 0 216 40H40a16 16 0 0 0-11.81 26.76l.08.09L96 139.17V216a16 16 0 0 0 24.87 13.32l32-21.34a16 16 0 0 0 7.13-13.32v-55.49l67.74-72.32l.08-.09a15.8 15.8 0 0 0 2.78-17.23m-84.42 81.05A8 8 0 0 0 144 136v58.66L112 216v-80a8 8 0 0 0-2.16-5.47L40 56h176Z"},null,-1)])])}const Dge=Me({name:"ph-funnel",render:Pge}),Ege={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Ige(t,e){return w(),R("svg",Ege,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M224 48v48a8 8 0 0 1-8 8h-48a8 8 0 0 1 0-16h28.69l-14.63-14.63a79.56 79.56 0 0 0-56.13-23.43h-.45a79.52 79.52 0 0 0-55.89 22.77a8 8 0 0 1-11.18-11.44a96 96 0 0 1 135 .79L208 76.69V48a8 8 0 0 1 16 0m-37.59 135.29a80 80 0 0 1-112.47-.66L59.31 168H88a8 8 0 0 0 0-16H40a8 8 0 0 0-8 8v48a8 8 0 0 0 16 0v-28.69l14.63 14.63A95.43 95.43 0 0 0 130 222.06h.53a95.36 95.36 0 0 0 67.07-27.33a8 8 0 0 0-11.18-11.44Z"},null,-1)])])}const iB=Me({name:"ph-arrows-clockwise",render:Ige}),Nge={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Rge(t,e){return w(),R("svg",Nge,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M226.76 69a8 8 0 0 0-12.84-2.88l-40.3 37.19l-17.23-3.7l-3.7-17.23l37.19-40.3A8 8 0 0 0 187 29.24A72 72 0 0 0 88 96a72.3 72.3 0 0 0 6 28.94L33.79 177c-.15.12-.29.26-.43.39a32 32 0 0 0 45.26 45.26c.13-.13.27-.28.39-.42L131.06 162A72 72 0 0 0 232 96a71.6 71.6 0 0 0-5.24-27M160 152a56.14 56.14 0 0 1-27.07-7a8 8 0 0 0-9.92 1.77l-55.9 64.74a16 16 0 0 1-22.62-22.62L109.18 133a8 8 0 0 0 1.77-9.93a56 56 0 0 1 58.36-82.31l-31.2 33.81a8 8 0 0 0-1.94 7.1l5.66 26.33a8 8 0 0 0 6.14 6.14l26.35 5.66a8 8 0 0 0 7.1-1.94l33.81-31.2A56.06 56.06 0 0 1 160 152"},null,-1)])])}const Fge=Me({name:"ph-wrench",render:Rge}),Vge={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function zge(t,e){return w(),R("svg",Vge,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M230.91 172a8 8 0 0 1-2.91 10.91l-96 56a8 8 0 0 1-8.06 0l-96-56A8 8 0 0 1 36 169.09l92 53.65l92-53.65a8 8 0 0 1 10.91 2.91M220 121.09l-92 53.65l-92-53.65a8 8 0 0 0-8 13.82l96 56a8 8 0 0 0 8.06 0l96-56a8 8 0 1 0-8.06-13.82M24 80a8 8 0 0 1 4-6.91l96-56a8 8 0 0 1 8.06 0l96 56a8 8 0 0 1 0 13.82l-96 56a8 8 0 0 1-8.06 0l-96-56A8 8 0 0 1 24 80m23.88 0L128 126.74L208.12 80L128 33.26Z"},null,-1)])])}const Hge=Me({name:"ph-stack",render:zge}),Wge={[Je.Sort]:{iconClass:"step-card__body__icon--sort",iconComponent:Bge,fallback:"S",label:"Sort"},[Je.Filter]:{iconClass:"step-card__body__icon--filter",iconComponent:Dge,fallback:"F",label:"Filter"},[Je.HideColumns]:{iconClass:"step-card__body__icon--hide-columns",iconComponent:df,fallback:"H",label:"Hide Columns"},[Je.Transpose]:{iconClass:"step-card__body__icon--transpose",iconComponent:iB,fallback:"T",label:"Transpose"},[Je.Parse]:{iconClass:"step-card__body__icon--parse",iconComponent:Fge,fallback:"P",label:"Parse"},[Je.Rename]:{iconClass:"step-card__body__icon--rename",iconComponent:V2,fallback:"R",label:"Rename"},[Je.GroupBy]:{iconClass:"step-card__body__icon--group",iconComponent:Hge,fallback:"G",label:"Group By"},[Je.Computed]:{iconClass:"step-card__body__icon--computed",fallback:"C",label:"Computed"}},Uge={class:"step-card__number"},Gge={class:"step-card__body"},qge={key:1},Yge={class:"step-card__body__text"},jge={class:"step-card__body__text__name"},Xge={class:"step-card__actions"},Kge=le({__name:"DataTransformStepCard",props:{step:{},index:{},active:{type:Boolean},error:{}},emits:["select","delete"],setup(t){const e=t,n=A(()=>Wge[e.step.type]),o=A(()=>n.value.iconClass),r=A(()=>n.value.iconComponent??null),i=A(()=>n.value.fallback),s=A(()=>n.value.label),a=A(()=>{const{step:l}=e;if(l.type===Je.Sort&&l.config.column)return`${l.config.column} ${l.config.direction??Qt.Ascending}`;if(l.type===Je.Filter&&l.config.column)return`${l.config.column} ${l.config.condition??vo.Equals} ${l.config.value??""}`;if(l.type===Je.HideColumns){const c=l.config.columns?l.config.columns.split(",").map(u=>u.trim()).filter(Boolean):[];return c.length>0?`Hiding ${c.join(", ")}`:"Configure..."}if(l.type===Je.Transpose)return"Swap rows ↔ columns";if(l.type===Je.Parse&&l.config.column&&l.config.operation)return`${l.config.column} → ${l.config.operation}`;if(l.type===Je.Rename&&l.config.column&&l.config.newName)return`${l.config.column} → ${l.config.newName}`;if(l.type===Je.GroupBy&&l.config.groupColumns&&l.config.aggregates){const c=l.config.groupColumns.split(",").map(d=>d.trim()).filter(Boolean).join(", "),u=l.config.aggregates.split(",").map(d=>{const f=d.lastIndexOf(":");return f<0?d.trim():`${d.slice(f+1).trim()}(${d.slice(0,f).trim()})`}).join(", ");return`Group by ${c} — ${u}`}return"Configure..."});return(l,c)=>(w(),R("div",{class:Te(["step-card",{"step-card--active":t.active,"step-card--error":t.error}]),onClick:c[2]||(c[2]=u=>l.$emit("select"))},[T("div",Uge,be(t.index+1),1),T("div",Gge,[T("span",{class:Te(["step-card__body__icon",p(o)])},[p(r)?(w(),Z(Gt(p(r)),{key:0})):(w(),R("span",qge,be(p(i)),1))],2),T("div",Yge,[T("div",jge,be(p(s)),1),T("div",{class:Te(["step-card__body__text__desc",{"step-card__body__text__desc--error":t.error}])},be(t.error||p(a)),3)])]),T("div",Xge,[T("button",{class:"step-card__actions__btn","aria-label":"Remove step",onClick:c[0]||(c[0]=gn(u=>l.$emit("delete"),["stop"]))},[...c[3]||(c[3]=[T("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[T("path",{d:"M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})],-1)])])]),t.active&&l.$slots.default?(w(),R("div",{key:0,class:"step-card__config",onClick:c[1]||(c[1]=gn(()=>{},["stop"]))},[Ce(l.$slots,"default",{},void 0,!0)])):ie("",!0)],2))}}),Zge=Oe(Kge,[["__scopeId","data-v-4ba65e45"]]),Qge={class:"group-by-step"},Jge={class:"group-by-step__field"},eve={class:"group-by-step__field__columns"},tve=["checked","onChange"],nve={key:0,class:"group-by-step__field"},ove={class:"group-by-step__field__agg-list"},rve={class:"group-by-step__field__agg-list__row"},ive={class:"group-by-step__field__agg-list__row__check"},sve=["checked"],ave={class:"group-by-step__field__agg-list__row__check"},lve=["checked","onChange"],cve=["value","onChange"],uve=le({__name:"DataTransformStepGroupBy",props:{step:{},columns:{},columnTypes:{}},setup(t){const e=t,{updateStep:n}=Lr(),o=A(()=>e.step.config.groupColumns?e.step.config.groupColumns.split(",").map(v=>v.trim()).filter(Boolean):[]),r=A(()=>e.columns.filter(v=>!o.value.includes(v))),i=A(()=>e.step.config.aggregates?e.step.config.aggregates.split(",").map(v=>v.trim()).filter(Boolean).map(v=>{const m=v.lastIndexOf(":");return m<0?null:{col:v.slice(0,m),fn:v.slice(m+1)}}).filter(v=>v!==null):[]),s=A(()=>i.value.some(v=>v.fn==="count"));function a(v){return i.value.some(m=>m.col===v&&m.fn!=="count")}function l(v){const m=i.value.find(b=>b.col===v&&b.fn!=="count");return(m==null?void 0:m.fn)??"sum"}function c(v){return v.map(m=>`${m.col}:${m.fn}`).join(",")}function u(v,m){const b={...e.step.config};v.length>0?b.groupColumns=v.join(","):delete b.groupColumns,m.length>0?b.aggregates=c(m):delete b.aggregates,n(e.step.id,b)}function d(v){const m=[...o.value],b=m.indexOf(v);b>=0?m.splice(b,1):m.push(v);const y=i.value.filter(x=>x.fn==="count"||!m.includes(x.col));u(m,y)}function f(){const v=[...i.value],m=v.findIndex(b=>b.fn==="count");m>=0?v.splice(m,1):v.push({col:"rows",fn:"count"}),u(o.value,v)}function h(v){const m=[...i.value],b=m.findIndex(y=>y.col===v&&y.fn!=="count");b>=0?m.splice(b,1):m.push({col:v,fn:"sum"}),u(o.value,m)}function g(v,m){const b=i.value.map(y=>y.col===v&&y.fn!=="count"?{...y,fn:m}:y);u(o.value,b)}return(v,m)=>(w(),R("div",Qge,[T("div",Jge,[m[0]||(m[0]=T("label",{class:"group-by-step__field__label"},"Group by",-1)),T("div",eve,[(w(!0),R(We,null,mt(t.columns,b=>(w(),R("label",{key:b,class:"group-by-step__field__columns__column"},[T("input",{type:"checkbox",checked:p(o).includes(b),onChange:y=>d(b)},null,40,tve),Ye(" "+be(b),1)]))),128))])]),p(r).length>0||p(o).length>0?(w(),R("div",nve,[m[4]||(m[4]=T("label",{class:"group-by-step__field__label"},"Aggregates",-1)),T("div",ove,[T("div",rve,[T("label",ive,[T("input",{type:"checkbox",checked:p(s),onChange:f},null,40,sve),m[1]||(m[1]=Ye(" Row count ",-1))]),m[2]||(m[2]=T("span",{class:"group-by-step__field__agg-list__row__fn-label"},"count",-1))]),(w(!0),R(We,null,mt(p(r),b=>(w(),R("div",{key:b,class:"group-by-step__field__agg-list__row"},[T("label",ave,[T("input",{type:"checkbox",checked:a(b),onChange:y=>h(b)},null,40,lve),Ye(" "+be(b),1)]),a(b)?(w(),R("select",{key:0,class:"group-by-step__field__agg-list__row__fn",value:l(b),onChange:y=>g(b,y.target.value)},[...m[3]||(m[3]=[T("option",{value:"sum"}," Sum ",-1),T("option",{value:"avg"}," Average ",-1),T("option",{value:"min"}," Min ",-1),T("option",{value:"max"}," Max ",-1)])],40,cve)):ie("",!0)]))),128))])])):ie("",!0)]))}}),dve=Oe(uve,[["__scopeId","data-v-c53de076"]]),fve={class:"data-transform-step-rename"},hve=le({__name:"DataTransformStepRename",props:{step:{},columns:{}},setup(t){const e=t,{updateStep:n}=Lr(),o=A(()=>e.columns.map(i=>({value:i,label:i})));function r(i,s){n(e.step.id,{...e.step.config,[i]:s})}return(i,s)=>(w(),R("div",fve,[H(p(Rn),{"model-value":t.step.config.column??"",label:"Column",placeholder:"Select a column",options:p(o),block:"","onUpdate:modelValue":s[0]||(s[0]=a=>r("column",a))},null,8,["model-value","options"]),H(p(km),{id:"rename-new-name","model-value":t.step.config.newName??"",label:"New Name",placeholder:"Enter new column name","onUpdate:modelValue":s[1]||(s[1]=a=>r("newName",a))},null,8,["model-value"])]))}}),pve=Oe(hve,[["__scopeId","data-v-5f4cb34e"]]),mve={class:"data-transform-step-parse"},gve=le({__name:"DataTransformStepParse",props:{step:{},columns:{}},setup(t){var v;const e=t,{updateStep:n}=Lr(),o=A(()=>e.columns.map(m=>({value:m,label:m}))),r=[{value:"type",label:"Type Conversions"},{value:"string",label:"String"},{value:"numeric",label:"Numeric"},{value:"date",label:"Date/Time"}],i=A(()=>ip.find(m=>m.id===e.step.config.operation)),s=Re(((v=i.value)==null?void 0:v.category)??"type");qe(()=>e.step.config.operation,m=>{if(m){const b=ip.find(y=>y.id===m);b&&(s.value=b.category)}});const a=A(()=>ip.filter(m=>m.category===s.value).map(m=>({value:m.id,label:m.label,description:m.description}))),l=A(()=>{var m;return((m=i.value)==null?void 0:m.params)??[]}),c={decimals:"Decimal places",pattern:"Regex pattern",replacement:"Replacement",start:"Start index",end:"End index",length:"Length",char:"Pad character",separator:"Separator",limit:"Limit",min:"Minimum",max:"Maximum",size:"Bucket size",key:"JSON key",amount:"Amount",unit:"Unit",period:"Period",reference:"Reference date"},u={decimals:"0",pattern:"\\d+",replacement:"",start:"0",end:"",length:"10",char:" ",separator:",",limit:"",min:"0",max:"100",size:"10",key:"",amount:"1",unit:"days",period:"month",reference:"YYYY-MM-DD"};function d(m){return c[m]??m}function f(m){return u[m]??""}function h(m){s.value=m;const b={...e.step.config};delete b.operation,n(e.step.id,b)}function g(m,b){n(e.step.id,{...e.step.config,[m]:b})}return(m,b)=>(w(),R("div",mve,[H(p(Rn),{"model-value":t.step.config.column??"",label:"Column",placeholder:"Select a column",options:p(o),block:"","onUpdate:modelValue":b[0]||(b[0]=y=>g("column",y))},null,8,["model-value","options"]),H(p(Rn),{"model-value":p(s),label:"Category",options:r,block:"","onUpdate:modelValue":h},null,8,["model-value"]),H(p(Rn),{"model-value":t.step.config.operation??"",label:"Operation",placeholder:"Select an operation",options:p(a),block:"","onUpdate:modelValue":b[1]||(b[1]=y=>g("operation",y))},null,8,["model-value","options"]),p(l).length>0?(w(!0),R(We,{key:0},mt(p(l),y=>(w(),Z(p(km),{id:`parse-${y}`,key:y,"model-value":t.step.config[y]??"",label:d(y),placeholder:f(y),"onUpdate:modelValue":x=>g(y,x)},null,8,["id","model-value","label","placeholder","onUpdate:modelValue"]))),128)):ie("",!0)]))}}),vve=Oe(gve,[["__scopeId","data-v-37e3f025"]]),bve={class:"data-transform-step-hide-columns"},yve={class:"data-transform-step-hide-columns__field"},xve={class:"data-transform-step-hide-columns__field__columns"},wve=["checked","onChange"],_ve=le({__name:"DataTransformStepHideColumns",props:{step:{},columns:{}},setup(t){const e=t,{updateStep:n}=Lr(),o=A(()=>e.step.config.columns?e.step.config.columns.split(",").map(i=>i.trim()).filter(Boolean):e.step.config.column?[e.step.config.column]:[]);function r(i){const s=[...o.value],a=s.indexOf(i);a>=0?s.splice(a,1):s.push(i);const l={...e.step.config};delete l.column,s.length===0?delete l.columns:l.columns=s.join(","),n(e.step.id,l)}return(i,s)=>(w(),R("div",bve,[T("div",yve,[s[0]||(s[0]=T("label",{class:"data-transform-step-hide-columns__field__label"},"Hide columns",-1)),T("div",xve,[(w(!0),R(We,null,mt(t.columns,a=>(w(),R("label",{key:a,class:"data-transform-step-hide-columns__field__columns__column"},[T("input",{type:"checkbox",checked:p(o).includes(a),onChange:l=>r(a)},null,40,wve),Ye(" "+be(a),1)]))),128))])])]))}}),kve=Oe(_ve,[["__scopeId","data-v-a74ff0f2"]]),Sve={class:"data-transform-step-filter"},Ave=le({__name:"DataTransformStepFilter",props:{step:{},columns:{}},setup(t){const e=t,{updateStep:n}=Lr(),o=A(()=>e.columns.map(s=>({value:s,label:s}))),r=[{value:vo.Equals,label:"Equals"},{value:vo.NotEquals,label:"Not equals"},{value:vo.Contains,label:"Contains"},{value:vo.GreaterThan,label:"Greater than"},{value:vo.LessThan,label:"Less than"}];function i(s,a){n(e.step.id,{...e.step.config,[s]:a})}return(s,a)=>(w(),R("div",Sve,[H(p(Rn),{"model-value":t.step.config.column??"",label:"Column",placeholder:"Select a column",options:p(o),block:"","onUpdate:modelValue":a[0]||(a[0]=l=>i("column",l))},null,8,["model-value","options"]),H(p(Rn),{"model-value":t.step.config.condition??p(vo).Equals,label:"Condition",options:r,block:"","onUpdate:modelValue":a[1]||(a[1]=l=>i("condition",l))},null,8,["model-value"]),H(p(km),{id:"filter-value","model-value":t.step.config.value??"",label:"Value",placeholder:"Filter value","onUpdate:modelValue":a[2]||(a[2]=l=>i("value",l))},null,8,["model-value"])]))}}),Cve=Oe(Ave,[["__scopeId","data-v-65704d71"]]),$ve={class:"data-transform-step-sort"},Tve={class:"data-transform-step-sort__field"},Mve={class:"data-transform-step-sort__field__columns"},Ove=["checked","onChange"],Bve=le({__name:"DataTransformStepSort",props:{step:{},columns:{},columnTypes:{}},setup(t){const e=t,{updateStep:n}=Lr(),o=A(()=>e.step.config.columns?e.step.config.columns.split(",").map(c=>c.trim()).filter(Boolean):e.step.config.column?[e.step.config.column]:[]),r=A(()=>o.value.every(c=>{const u=e.columns.indexOf(c);return u>=0&&e.columnTypes[u]==="number"}));function i(c){const u=[...o.value],d=u.indexOf(c);d>=0?u.splice(d,1):u.push(c);const f={...e.step.config};delete f.column,u.length===0?delete f.columns:f.columns=u.join(",");const h=u.every(g=>{const v=e.columns.indexOf(g);return v>=0&&e.columnTypes[v]==="number"});(u.length<=1||!h)&&delete f.operation,n(e.step.id,f)}const s=[{value:"",text:"None"},{value:"sum",text:"Sum"},{value:"avg",text:"Avg"}],a=[{value:Qt.Ascending,text:"Ascending"},{value:Qt.Descending,text:"Descending"}];function l(c,u){n(e.step.id,{...e.step.config,[c]:u})}return(c,u)=>(w(),R("div",$ve,[T("div",Tve,[u[2]||(u[2]=T("label",{class:"data-transform-step-sort__field__label"},"Sort by",-1)),T("div",Mve,[(w(!0),R(We,null,mt(t.columns,d=>(w(),R("label",{key:d,class:"data-transform-step-sort__field__columns__column"},[T("input",{type:"checkbox",checked:p(o).includes(d),onChange:f=>i(d)},null,40,Ove),Ye(" "+be(d),1)]))),128))])]),p(o).length>1&&p(r)?(w(),Z(p($n),{key:0,"model-value":t.step.config.operation??"",label:"Operation",options:s,block:"","onUpdate:modelValue":u[0]||(u[0]=d=>l("operation",d))},null,8,["model-value"])):ie("",!0),H(p($n),{"model-value":t.step.config.direction??p(Qt).Ascending,label:"Direction",options:a,block:"","onUpdate:modelValue":u[1]||(u[1]=d=>l("direction",d))},null,8,["model-value"])]))}}),Lve=Oe(Bve,[["__scopeId","data-v-73ae8834"]]),Pve={},Dve={class:"pipeline-connector"};function Eve(t,e){return w(),R("div",Dve)}const Ive=Oe(Pve,[["render",Eve],["__scopeId","data-v-a3406500"]]),Nve={class:"source-block"},Rve={class:"source-block__meta"},Fve=le({__name:"DataTransformSourceBlock",props:{columns:{},rows:{},label:{default:"Raw Data"}},setup(t){return(e,n)=>(w(),R("div",Nve,[n[0]||(n[0]=T("span",{class:"source-block__icon"},[T("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",width:"14",height:"14"},[T("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),T("path",{d:"M3 9h18M9 21V9"})])],-1)),T("span",null,be(t.label),1),T("span",Rve,be(t.columns)+" cols · "+be(t.rows)+" rows",1)]))}}),Vve=Oe(Fve,[["__scopeId","data-v-6b491dca"]]),zve={class:"pipeline","data-testid":"transform-pipeline"},Hve={key:6,class:"pipeline__config-info"},Wve={key:7,class:"text-muted text-center py-3"},Uve=le({__name:"DataTransformPipeline",setup(t){const{columns:e,rows:n,columnTypes:o}=Ko(),{steps:r,addStep:i,removeStep:s,applyTransforms:a,getColumnsAtStep:l,validateStep:c}=Lr(),{activeScene:u,activeIndex:d,scenes:f}=_n(),h=A(()=>{if(!u.value)return"Raw Data";if(d.value<=0)return"Data from Scene 1";const N=f.value[d.value-1];return`Data from ${(N==null?void 0:N.name)||`Scene ${d.value}`}`}),g=Re(""),v=ze(new Set),m=A(()=>r.value.findIndex(N=>N.id===g.value)),b=A(()=>m.value<0?{columns:[],columnTypes:[]}:l(m.value,e.value,n.value,o.value)),y=A(()=>b.value.columns),x=A(()=>b.value.columnTypes),_=A(()=>{const N={};for(let C=0;C<r.value.length;C++){const M=r.value[C];if(v.value.has(M.id)){N[M.id]=null;continue}const P=l(C,e.value,n.value,o.value);N[M.id]=c(M,P.columns,P.columnTypes)}return N}),k=A(()=>a(e.value,n.value,o.value)),E=A(()=>k.value.columns.length),L=A(()=>k.value.rows.length);function S(N){const C=g.value;C&&C!==N&&v.value.delete(C),g.value=N}function B(N){const C=i(N);v.value.add(C),S(C)}function D(N){v.value.delete(N),s(N),g.value===N&&(g.value=r.value.length>0?r.value[r.value.length-1].id:"")}return(N,C)=>{const M=Vve,P=Ive,$=Lve,F=Cve,V=kve,U=vve,K=pve,ae=dve,me=Zge,de=Tge,ve=xge;return w(),R("div",zve,[H(M,{columns:p(e).length,rows:p(n).length,label:p(h)},null,8,["columns","rows","label"]),(w(!0),R(We,null,mt(p(r),(te,pe)=>(w(),R(We,{key:te.id},[H(P),H(me,{step:te,index:pe,active:p(g)===te.id,error:p(_)[te.id],onSelect:we=>S(te.id),onDelete:we=>D(te.id)},{default:ee(()=>[te.type===p(Je).Sort?(w(),Z($,{key:0,step:te,columns:p(y),"column-types":p(x)},null,8,["step","columns","column-types"])):te.type===p(Je).Filter?(w(),Z(F,{key:1,step:te,columns:p(y)},null,8,["step","columns"])):te.type===p(Je).HideColumns?(w(),Z(V,{key:2,step:te,columns:p(y)},null,8,["step","columns"])):te.type===p(Je).Parse?(w(),Z(U,{key:3,step:te,columns:p(y)},null,8,["step","columns"])):te.type===p(Je).Rename?(w(),Z(K,{key:4,step:te,columns:p(y)},null,8,["step","columns"])):te.type===p(Je).GroupBy?(w(),Z(ae,{key:5,step:te,columns:p(y),"column-types":p(x)},null,8,["step","columns","column-types"])):te.type===p(Je).Transpose?(w(),R("div",Hve," Transpose swaps rows and columns. The first column values become headers and column headers become the first column. ")):(w(),R("div",Wve," Coming soon "))]),_:2},1032,["step","index","active","error","onSelect","onDelete"])],64))),128)),H(P),H(de,{onAdd:B}),H(P),H(ve,{columns:p(E),rows:p(L)},null,8,["columns","rows"])])}}}),Gve=Oe(Uve,[["__scopeId","data-v-b653c7ed"]]),qve=[0,.30103,.17609,.12494,.09691,.07918,.06695,.05799,.05115,.04576],sB=10,Yve=.1;function jve(t){const e=parseFloat(t);if(!Number.isFinite(e)||e===0)return null;const o=Math.abs(e).toExponential(),r=parseInt(o[0],10);return r>=1&&r<=9?r:null}function Xve(t,e,n){if(t==="number")return!0;let o=0;for(const r of e){const i=r[n];if(i!=null&&i!==""){const s=parseFloat(i);Number.isFinite(s)&&o++}}return o>=sB}function aB(t,e,n){const o=[];let r=!1;for(let i=0;i<t.length;i++){if(!Xve(n[i],e,i))continue;const s=new Array(10).fill(0);let a=0;for(const c of e){const u=jve(c[i]);u!==null&&(s[u]++,a++)}if(a<sB)continue;r=!0;let l=!1;for(let c=1;c<=9;c++){const u=s[c]/a;if(Math.abs(u-qve[c])>Yve){l=!0;break}}l&&o.push(t[i])}return{pass:o.length===0,suspicious:o,eligible:r}}const Kve={class:"data-column-settings"},Zve={class:"data-column-settings__field"},Qve={class:"data-column-settings__section"},Jve={class:"data-column-settings__section__detections"},e1e={class:"data-column-settings__section__detections__item data-column-settings__section__detections__item--success"},t1e={class:"data-column-settings__section__detections__item data-column-settings__section__detections__item--info"},n1e={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},o1e={key:0,d:"M20 6L9 17l-5-5"},r1e={key:1,d:"M12 9v4M12 17h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"},i1e={key:1,class:"data-column-settings__picker"},s1e=le({__name:"DataColumnSettings",setup(t){const e=fr(),{selectedColumnIndex:n}=$t(e),{selectColumn:o}=e,{columns:r,rows:i,columnTypes:s,setColumnType:a}=Ko(),l=Re("string"),c=[{value:"string",label:"String"},{value:"number",label:"Number"},{value:"date",label:"Date"}];qe(n,b=>{b>=0&&b<r.value.length&&(l.value=s.value[b]??"string")},{immediate:!0});function u(b){a(n.value,b)}const d=A(()=>r.value.map((b,y)=>({value:String(y),label:b})));function f(b){o(parseInt(b,10))}const h=A(()=>{const b=n.value;if(b<0)return{unique:0,total:0};const y=i.value.map(_=>_[b]??"").filter(_=>_.length>0);return{unique:new Set(y).size,total:y.length}}),g=A(()=>{const{unique:b,total:y}=h.value;return b===y?`${b} unique values — no duplicates`:`${y-b} duplicates found`}),v=A(()=>{const b=s.value[n.value];return b==="number"?"Numeric measure detected":b==="date"?"Date axis detected":"Categorical dimension detected"}),m=A(()=>{const b=n.value;if(b<0)return null;const y=r.value[b],x=aB([y],i.value.map(_=>[_[b]]),[s.value[b]]);return x.eligible?{pass:x.pass,label:x.pass?"Follows Benford's law":"Doesn't follow Benford's law"}:null});return(b,y)=>(w(),R("div",Kve,[p(n)>=0&&p(n)<p(r).length?(w(),R(We,{key:0},[T("div",Zve,[y[1]||(y[1]=T("div",{class:"data-column-settings__field__label"}," Type ",-1)),H(p(Rn),{modelValue:p(l),"onUpdate:modelValue":[y[0]||(y[0]=x=>Xe(l)?l.value=x:null),u],label:"",options:c,block:""},null,8,["modelValue"])]),y[5]||(y[5]=T("hr",{class:"data-column-settings__divider"},null,-1)),T("div",Qve,[y[4]||(y[4]=T("div",{class:"data-column-settings__section__title"}," Detections ",-1)),T("div",Jve,[T("span",e1e,[y[2]||(y[2]=T("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[T("path",{d:"M20 6L9 17l-5-5"})],-1)),Ye(" "+be(p(g)),1)]),T("span",t1e,[y[3]||(y[3]=T("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[T("circle",{cx:"12",cy:"12",r:"10"}),T("path",{d:"M12 16v-4M12 8h.01"})],-1)),Ye(" "+be(p(v)),1)]),p(m)?(w(),R("span",{key:0,class:Te(["data-column-settings__section__detections__item",p(m).pass?"data-column-settings__section__detections__item--success":"data-column-settings__section__detections__item--warn"])},[(w(),R("svg",n1e,[p(m).pass?(w(),R("path",o1e)):(w(),R("path",r1e))])),Ye(" "+be(p(m).label),1)],2)):ie("",!0)])])],64)):(w(),R("div",i1e,[y[6]||(y[6]=T("div",{class:"data-column-settings__picker__label"}," Column ",-1)),H(p(Rn),{"model-value":"",label:"",options:p(d),block:"",placeholder:"Select a column…","onUpdate:modelValue":f},null,8,["options"])]))]))}}),a1e=Oe(s1e,[["__scopeId","data-v-fadb97cc"]]),l1e={key:0,class:"data-check-empty"},c1e={key:1,class:"data-check-table"},u1e={class:"data-check-table__col-header__name"},d1e={class:"data-check-table__col-header__type"},f1e=le({__name:"DataCheckTable",setup(t){const e=fr(),{selectedColumnIndex:n}=$t(e),{selectColumn:o}=e,{displayColumns:r,displayRows:i,displayColumnTypes:s}=Ko(),a=A(()=>i.value.length===0);return(l,c)=>p(a)?(w(),R("div",l1e,[H(p(Vy),{class:"data-check-empty__icon"}),c[0]||(c[0]=T("p",null,"No rows match your filters",-1))])):(w(),R("div",c1e,[H(p(ZE),{hover:"",bordered:""},{default:ee(()=>[H(p(oI),null,{default:ee(()=>[H(p(c_),null,{default:ee(()=>[H(p(l_),{class:"data-check-table__row-num"},{default:ee(()=>[...c[1]||(c[1]=[Ye(" # ",-1)])]),_:1}),(w(!0),R(We,null,mt(p(r),(u,d)=>(w(),Z(p(l_),{key:d,class:Te(["data-check-table__col-header",{"data-check-table__col--selected":d===p(n)}]),onClick:f=>p(o)(d)},{default:ee(()=>[T("div",u1e,be(u),1),T("div",d1e,be(p(s)[d]??"string"),1)]),_:2},1032,["class","onClick"]))),128))]),_:1})]),_:1}),H(p(QE),null,{default:ee(()=>[(w(!0),R(We,null,mt(p(i),(u,d)=>(w(),Z(p(c_),{key:d},{default:ee(()=>[H(p(a_),{class:"data-check-table__row-num"},{default:ee(()=>[Ye(be(d+1),1)]),_:2},1024),(w(!0),R(We,null,mt(u,(f,h)=>(w(),Z(p(a_),{key:h,class:Te({"data-check-table__col--selected":h===p(n),"data-check-table__cell--numeric":p(s)[h]==="number"})},{default:ee(()=>[Ye(be(f),1)]),_:2},1032,["class"]))),128))]),_:2},1024))),128))]),_:1})]),_:1})]))}}),h1e=Oe(f1e,[["__scopeId","data-v-670500db"]]),p1e={class:"data-insight-badges"},m1e={class:"data-insight-badge data-insight-badge--shape"},g1e={class:"data-insight-badge__icon"},v1e={class:"data-insight-badge__icon"},b1e=le({__name:"DataInsightBadges",props:{columns:{},rows:{},columnTypes:{}},setup(t){const e=t,n=ht("benfordBadgeRef"),o=A(()=>{let d=0;for(const f of e.rows)for(let h=0;h<e.columns.length;h++){const g=f[h];(g==null||g==="")&&d++}return d}),r=A(()=>o.value===0?"✓":"⚠"),i=A(()=>o.value===0?"No missing values":`${o.value} missing value${o.value===1?"":"s"}`),s=A(()=>o.value===0?"data-insight-badge--quality-ok":"data-insight-badge--quality-warn"),a=A(()=>{const d=aB(e.columns,e.rows,e.columnTypes);return d.eligible?d:null}),l=A(()=>{var d;return(d=a.value)!=null&&d.pass?"✓":"⚠"}),c=A(()=>{var d;return(d=a.value)!=null&&d.pass?"data-insight-badge--benford-ok":"data-insight-badge--benford-warn"}),u=A(()=>a.value?a.value.pass?"All numeric columns follow Benford's Law — the expected distribution of leading digits in real-world data.":`Column(s) ${a.value.suspicious.join(", ")} don't follow Benford's Law — the expected distribution of leading digits. This may indicate fabricated or anomalous data.`:"");return(d,f)=>(w(),R("div",p1e,[T("span",m1e,be(t.columns.length)+" cols · "+be(t.rows.length)+" rows ",1),T("span",{class:Te(["data-insight-badge",p(s)])},[T("span",g1e,be(p(r)),1),Ye(" "+be(p(i)),1)],2),p(a)?(w(),R("span",{key:0,ref_key:"benfordBadgeRef",ref:n,class:Te(["data-insight-badge",p(c)])},[T("span",v1e,be(p(l)),1),f[0]||(f[0]=Ye(" Benford's law ",-1)),H(p(qd),{"teleport-to":"body",target:p(n),title:p(u),placement:"top"},null,8,["target","title"])],2)):ie("",!0)]))}}),y1e=Oe(b1e,[["__scopeId","data-v-d0fa5a33"]]),x1e={class:"data-structure-panel__main__pills-bar"},w1e={key:0,class:"data-structure-panel__main__scene-banner"},_1e=le({__name:"DataStructurePanel",setup(t){const{columns:e,rows:n,columnTypes:o}=Ko(),r=fr(),{dataPanelOpen:i,dataPanelTab:s}=$t(r),{openDataPanel:a,closeDataPanel:l,setDataView:c,setLastNarrowDataTab:u}=r,{mode:d}=ic(),{activeScene:f,activeIndex:h,scenes:g}=_n(),v=A(()=>f.value!==null);qe(d,P=>{P==="drawer"&&s.value&&(u(s.value),l())},{immediate:!0});const m=A(()=>nT(g.value,h.value)),b=A(()=>{const P=m.value;if(P===h.value)return"Custom data on this scene.";if(P>=0){const $=g.value[P];return`Data inherited from ${($==null?void 0:$.name)||`Scene ${P+1}`}.`}return"Scene override active."}),y=A(()=>{const P=m.value;return P===h.value?"This scene uses its own data, independent of the base dataset.":P>=0?"Replace data to set different data for this scene.":"The table below shows the base data. Replace data to set custom data for this scene."});function x(){c("upload")}function _(P){u(P),a(P)}const{isNarrow:k}=gi(),E=ht("mainRef"),{sections:L}=oB(),S=A(()=>v.value?["parsing"]:[]),B=A(()=>v.value?L.filter(P=>P.key!=="parsing"):L),D=A({get:()=>!!s.value,set:P=>{P||l()}}),N={column:"Column Settings",transforms:"Transforms",parsing:"Parsing",reco:"Recommendations"},C=A(()=>N[s.value]??"Panel"),M=A(()=>({"data-structure-panel--narrow":k.value}));return(P,$)=>{const F=y1e,V=h1e,U=U2,K=a1e,ae=Gve,me=gge,de=uge,ve=W2,te=fg,pe=Qme;return w(),R("div",{class:Te(["data-structure-panel",p(M)])},[T("div",{ref_key:"mainRef",ref:E,class:"data-structure-panel__main"},[T("div",x1e,[p(v)?(w(),R("div",w1e,[T("strong",null,be(p(b)),1),Ye(" "+be(p(y)),1)])):(w(),Z(F,{key:1,columns:p(e),rows:p(n),"column-types":p(o)},null,8,["columns","rows","column-types"])),H(p(Kn),{"icon-left":p(iB),label:"Replace data",variant:"outline-primary",size:"sm",onClick:x},null,8,["icon-left"])]),H(V),H(nB)],512),p(i)?(w(),Z(te,{key:0,"drawer-open":p(D),"onUpdate:drawerOpen":$[0]||($[0]=we=>Xe(D)?D.value=we:null),title:p(C),"container-ref":p(E),onClose:p(l)},wi({default:ee(()=>[p(s)==="column"?(w(),Z(K,{key:0})):p(s)==="transforms"?(w(),Z(ae,{key:1})):p(s)==="parsing"?(w(),Z(me,{key:2})):p(s)==="reco"?(w(),Z(de,{key:3})):ie("",!0)]),_:2},[p(d)==="drawer"?{name:"tabs",fn:ee(()=>[H(U,{tabs:p(B),"model-value":p(s),sticky:"","onUpdate:modelValue":_},null,8,["tabs","model-value"])]),key:"0"}:void 0,p(d)!=="drawer"?{name:"footer",fn:ee(()=>[H(ve)]),key:"1"}:void 0]),1032,["drawer-open","title","container-ref","onClose"])):ie("",!0),p(k)?ie("",!0):(w(),Z(pe,{key:1,"disabled-tabs":p(S)},null,8,["disabled-tabs"]))],2)}}}),k1e=Oe(_1e,[["__scopeId","data-v-3f93b45b"]]),S1e={class:"samples-grid"},A1e=["onClick","onKeydown"],C1e={class:"sample-card__thumb"},$1e=["src","alt"],T1e={class:"sample-card__info"},M1e={class:"sample-card__info__name"},O1e={class:"sample-card__info__meta"},B1e=le({__name:"DataUploadSamples",emits:["select"],setup(t){const e={[Le.BarVertical]:"Columns",[Le.BarHorizontal]:"Bars",[Le.BarMulti]:"Grouped Columns",[Le.Line]:"Line",[Le.LineMulti]:"Lines",[Le.Donut]:"Donut",[Le.Pie]:"Pie",[Le.Area]:"Area",[Le.AreaStacked]:"Stacked Area",[Le.ColumnStacked]:"Stacked Columns",[Le.BarStacked]:"Stacked Bars",[Le.BarSplit]:"Split Bars",[Le.BarGrouped]:"Grouped Bars"};function n(i){const s=i.split(`
|
|
859
|
+
`).filter(a=>a.trim().length>0);return Math.max(0,s.length-1)}const o=lr(new Map),r=A(()=>B6.map(i=>({...i,typeLabel:e[i.chartType]??i.chartType,rowCount:n(i.tsvData),thumbSrc:o.get(i.id)})));return fn(()=>{for(const i of B6)if(i.dsl){const s=pT(i.dsl);s&&o.set(i.id,Cc(s))}}),(i,s)=>(w(),R("div",S1e,[(w(!0),R(We,null,mt(p(r),a=>(w(),R("div",{key:a.id,class:"sample-card",role:"button",tabindex:"0",onClick:l=>i.$emit("select",a),onKeydown:or(l=>i.$emit("select",a),["enter"])},[T("div",C1e,[a.thumbSrc?(w(),R("img",{key:0,class:"sample-card__thumb__img",src:a.thumbSrc,alt:a.title},null,8,$1e)):ie("",!0)]),T("div",T1e,[T("div",M1e,be(a.title),1),T("div",O1e,[Ye(be(a.typeLabel)+" ",1),s[0]||(s[0]=T("span",{class:"sample-card__info__meta__sep"},"·",-1)),Ye(" "+be(a.rowCount)+" rows ",1)])])],40,A1e))),128))]))}}),L1e=Oe(B1e,[["__scopeId","data-v-23920b61"]]),P1e=le({__name:"DataUploadFileDrop",emits:["loaded","bpc","dragState"],setup(t,{emit:e}){const n=e,o=ze(null),r=Re(!1);function i(f){r.value=f,n("dragState",f)}function s(){i(!0)}function a(){i(!1)}function l(f){return f.name.toLowerCase().endsWith(".bpc")}function c(f){const h=new globalThis.FileReader;h.onload=()=>{typeof h.result=="string"&&n(l(f)?"bpc":"loaded",h.result,f.name)},h.readAsText(f)}function u(f){var g;i(!1);const h=(g=f.dataTransfer)==null?void 0:g.files[0];h&&c(h)}function d(f){var v;const h=f.target,g=(v=h.files)==null?void 0:v[0];g&&c(g),h.value=""}return(f,h)=>(w(),R("div",{class:Te(["file-drop",{"file-drop--active":p(r)}]),onDragover:gn(s,["prevent"]),onDragleave:gn(a,["prevent"]),onDrop:gn(u,["prevent"]),onClick:h[1]||(h[1]=g=>{var v;return(v=p(o))==null?void 0:v.click()})},[h[2]||(h[2]=FL('<div class="file-drop__icon" data-v-f6ebbbc1><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" data-v-f6ebbbc1><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12" data-v-f6ebbbc1></path></svg></div><div class="file-drop__title" data-v-f6ebbbc1> Drag & drop your file here </div><div class="file-drop__or" data-v-f6ebbbc1> or </div>',3)),T("button",{class:"file-drop__btn",onClick:h[0]||(h[0]=gn(g=>{var v;return(v=p(o))==null?void 0:v.click()},["stop"]))}," Browse files "),h[3]||(h[3]=T("div",{class:"file-drop__formats"},[T("span",{class:"file-drop__formats__tag"},".csv"),T("span",{class:"file-drop__formats__tag"},".tsv"),T("span",{class:"file-drop__formats__tag"},".bpc")],-1)),T("input",{ref_key:"fileInput",ref:o,type:"file",accept:".csv,.tsv,.txt,.bpc",class:"file-drop__input",onChange:d},null,544)],34))}}),D1e=Oe(P1e,[["__scopeId","data-v-f6ebbbc1"]]),E1e={class:"upload-card"},I1e={class:"input-card__tabs"},N1e=["onClick"],R1e={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},F1e={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},V1e={key:2,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},z1e={key:1,class:"upload-card__paste"},H1e={class:"upload-card__paste__wrap"},W1e={key:0,class:"upload-card__paste__wrap__placeholder"},U1e={class:"upload-card__paste__footer"},G1e=["disabled"],q1e=le({__name:"DataUploadCard",emits:["loaded","bpc","sample","cancel"],setup(t){const{rawInput:e,sourceFormat:n,columns:o,rows:r,displayColumns:i,displayRows:s}=Ko(),{activeIndex:a,scenes:l}=_n();function c(){if(a.value<0)return!1;const b=Fa(l.value,a.value);return!!(b!=null&&b.data)}function u(){return c()?F6(i.value,s.value):(n==null?void 0:n.value)==="bpc"&&o.value.length>0?F6(o.value,r.value):e.value}const d=Re("paste"),f=Re(u()),h=ht("pasteArea"),g=Re(!1);function v(b){var x;const y=(x=b.clipboardData)==null?void 0:x.getData("text/plain");y&&(b.preventDefault(),f.value=y,wn(()=>{h.value&&h.value.focus()}))}const m=[{value:"file",text:"File"},{value:"paste",text:"Paste"},{value:"samples",text:"Samples"}];return(b,y)=>{const x=D1e,_=L1e;return w(),R("div",E1e,[y[12]||(y[12]=T("h2",{class:"upload-card__title"}," Add your data ",-1)),y[13]||(y[13]=T("p",{class:"upload-card__subtitle"}," Drop a file, paste from a spreadsheet, or pick a sample dataset ",-1)),p(o).length>0?(w(),R("button",{key:0,class:"upload-card__back",onClick:y[0]||(y[0]=k=>b.$emit("cancel"))}," ← Back to table ")):ie("",!0),T("div",{class:Te(["input-card",{"input-card--drag-over":p(g)}])},[T("div",I1e,[(w(),R(We,null,mt(m,k=>T("button",{key:k.value,class:Te(["input-card__tabs__tab",{"input-card__tabs__tab--active":p(d)===k.value}]),onClick:E=>d.value=k.value},[k.value==="file"?(w(),R("svg",R1e,[...y[7]||(y[7]=[T("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12"},null,-1)])])):k.value==="paste"?(w(),R("svg",F1e,[...y[8]||(y[8]=[T("rect",{x:"8",y:"2",width:"8",height:"4",rx:"1"},null,-1),T("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"},null,-1)])])):(w(),R("svg",V1e,[...y[9]||(y[9]=[T("path",{d:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20"},null,-1),T("path",{d:"M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"},null,-1)])])),Ye(" "+be(k.text),1)],10,N1e)),64))]),p(d)==="file"?(w(),Z(x,{key:0,onLoaded:y[1]||(y[1]=(k,E)=>b.$emit("loaded",k,E)),onBpc:y[2]||(y[2]=(k,E)=>b.$emit("bpc",k,E)),onDragState:y[3]||(y[3]=k=>g.value=k)})):p(d)==="paste"?(w(),R("div",z1e,[T("div",H1e,[p(f)?ie("",!0):(w(),R("div",W1e,[...y[10]||(y[10]=[Ye(" category Gold Silver Bronze",-1),T("br",null,null,-1),Ye(" USA 40 44 42",-1),T("br",null,null,-1),Ye(" China 38 32 19 ",-1)])])),ar(T("textarea",{ref_key:"pasteArea",ref:h,"onUpdate:modelValue":y[4]||(y[4]=k=>Xe(f)?f.value=k:null),class:"upload-card__paste__wrap__area",spellcheck:"false",onPaste:v},null,544),[[Sp,p(f)]])]),T("div",U1e,[y[11]||(y[11]=T("div",{class:"upload-card__paste__footer__hint"},[T("span",{class:"upload-card__paste__footer__hint__kbd"},"⌘"),T("span",{class:"upload-card__paste__footer__hint__kbd"},"V"),Ye(" paste from spreadsheet ")],-1)),T("button",{class:"upload-card__paste__footer__btn",disabled:!p(f).trim(),onClick:y[5]||(y[5]=k=>b.$emit("loaded",p(f),"Pasted"))}," Load data ",8,G1e)])])):p(d)==="samples"?(w(),Z(_,{key:2,onSelect:y[6]||(y[6]=k=>b.$emit("sample",k))})):ie("",!0)],2)])}}}),Y1e=Oe(q1e,[["__scopeId","data-v-b501779f"]]),j1e=le({__name:"DataPanel",setup(t){const e=fr(),{dataView:n}=$t(e),{setDataView:o}=e,r=Ko(),{applyDsl:i}=Fc(),{loadSample:s}=Xs(),{next:a}=H2(),l=$t(rB()),{activeScene:c,activeIndex:u,update:d}=_n(),f=A(()=>c.value!==null);fn(()=>{r.columns.value.length>0?o("structure"):o("upload")});function h(){if(!r.rawInput.value||r.sourceFormat.value!=="delimited")return;const b=eb(r.rawInput.value,{firstRowIsHeader:l.firstRowIsHeader.value,delimiter:l.delimiter.value,decimalSeparator:l.decimalSeparator.value,trimWhitespace:l.trimWhitespace.value});r.loadParsed(b)}function g(b,y){if(f.value&&u.value>=0){const x=eb(b,{firstRowIsHeader:l.firstRowIsHeader.value,delimiter:l.delimiter.value,decimalSeparator:l.decimalSeparator.value,trimWhitespace:l.trimWhitespace.value}),_=dg(x.columns,x.rows);d(u.value,{data:_}),o("structure");return}r.rawInput.value=b,r.sourceFormat.value="delimited",r.sourceLabel.value=y||"Pasted",h(),o("structure")}function v(b,y){i(b),r.sourceLabel.value=y||"Blueprint file",a()}function m(b){if(f.value&&u.value>=0){d(u.value,{data:b.serializedData}),o("structure");return}s(b),a()}return qe([()=>l.firstRowIsHeader.value,()=>l.delimiter.value,()=>l.decimalSeparator.value,()=>l.trimWhitespace.value],()=>{r.rawInput.value&&n.value==="structure"&&h()}),(b,y)=>{const x=Y1e,_=k1e;return w(),R("div",{class:Te(["data-panel",{"data-panel--structure":p(n)==="structure"}])},[p(n)==="upload"?(w(),Z(x,{key:0,onLoaded:g,onBpc:v,onSample:m,onCancel:y[0]||(y[0]=k=>p(o)("structure"))})):(w(),Z(_,{key:1}))],2)}}}),X1e=Oe(j1e,[["__scopeId","data-v-4fa651c7"]]),K1e=["aria-label","aria-disabled","disabled"],Z1e={class:"panel-open-button__label"},Q1e=le({__name:"PanelOpenButton",props:{label:{},icon:{default:()=>$T},disabled:{type:Boolean,default:!1}},emits:["open"],setup(t,{emit:e}){const n=e;function o(){n("open")}return(r,i)=>(w(),R("button",{class:"panel-open-button",type:"button","aria-label":t.label,"aria-disabled":t.disabled?"true":void 0,disabled:t.disabled,onClick:o},[(w(),Z(Gt(t.icon),{class:"panel-open-button__icon","aria-hidden":"true"})),T("span",Z1e,be(t.label),1)],8,K1e))}}),J1e=Oe(Q1e,[["__scopeId","data-v-218f5209"]]),ebe={class:"layout-narrow-dock",role:"toolbar","aria-label":"Wizard controls"},tbe={class:"layout-narrow-dock__timeline"},nbe={class:"layout-narrow-dock__action"},obe=le({__name:"LayoutNarrowDock",props:{showTimeline:{type:Boolean},scenes:{},activeIndex:{},playing:{type:Boolean},panelLabel:{},panelIcon:{default:void 0},panelDisabled:{type:Boolean,default:!1},scenesSheetOpen:{type:Boolean,default:!1}},emits:["update:activeIndex","play","pause","expand-timeline","open-panel"],setup(t,{emit:e}){const n=e;function o(r){n("update:activeIndex",r)}return(r,i)=>(w(),R("div",ebe,[T("div",tbe,[t.showTimeline?(w(),Z(p(HG),{key:0,scenes:t.scenes,"active-index":t.activeIndex,playing:t.playing,expanded:t.scenesSheetOpen,"onUpdate:activeIndex":o,onPlay:i[0]||(i[0]=s=>n("play")),onPause:i[1]||(i[1]=s=>n("pause")),onExpand:i[2]||(i[2]=s=>n("expand-timeline"))},null,8,["scenes","active-index","playing","expanded"])):ie("",!0)]),T("div",nbe,[H(J1e,{label:t.panelLabel,icon:t.panelIcon,disabled:t.panelDisabled,onOpen:i[3]||(i[3]=s=>n("open-panel"))},null,8,["label","icon","disabled"])])]))}}),rbe=Oe(obe,[["__scopeId","data-v-cc656101"]]),ibe={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function sbe(t,e){return w(),R("svg",ibe,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M224 48H32a8 8 0 0 0-8 8v136a16 16 0 0 0 16 16h176a16 16 0 0 0 16-16V56a8 8 0 0 0-8-8M40 112h40v32H40Zm56 0h120v32H96Zm120-48v32H40V64ZM40 160h40v32H40Zm176 32H96v-32h120z"},null,-1)])])}const dS=Me({name:"ph-table",render:sbe}),abe={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function lbe(t,e){return w(),R("svg",abe,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M216 112v96a16 16 0 0 1-16 16H56a16 16 0 0 1-16-16v-96a16 16 0 0 1 16-16h24a8 8 0 0 1 0 16H56v96h144v-96h-24a8 8 0 0 1 0-16h24a16 16 0 0 1 16 16M93.66 69.66L120 43.31V136a8 8 0 0 0 16 0V43.31l26.34 26.35a8 8 0 0 0 11.32-11.32l-40-40a8 8 0 0 0-11.32 0l-40 40a8 8 0 0 0 11.32 11.32"},null,-1)])])}const fS=Me({name:"ph-export",render:lbe}),cbe={class:"wizard-shell"},ube=["title","aria-label"],dbe={class:"wizard-shell__main"},fbe={class:"wizard-shell__content"},hbe=le({__name:"WizardShell",setup(t){const{currentStep:e,currentIndex:n,steps:o,registerCreateSession:r}=H2(),i=Ko(),s=hn(),{sessionId:a,createSession:l,lastSavedAt:c}=Xs(),u=_n(),{scenes:d,activeIndex:f,activeScene:h,playing:g,startPlayback:v,stopPlayback:m}=u,b=A(()=>h.value!==null),{baseOptions:y}=kn(),x=Lr(),_=ze([]),k=A(()=>c.value?new Date(c.value):""),E=jN(k),L=A(()=>k.value?`saved ${E.value}`:null),{isNarrow:S}=gi("lg"),{isNarrow:B}=gi("md"),{isNarrow:D}=gi(),N=fr(),{dataView:C}=$t(N),M=hg(),P=ze(!1),$=A(()=>{switch(e.value.key){case"data":return"Data panel";case"edit":return"Edit panel";case"export":return"Export panel";default:return"Open panel"}}),F=A(()=>{switch(e.value.key){case"data":return dS;case"edit":return Ps;case"export":return fS;default:return Ps}}),V=A(()=>e.value.key==="data"&&i.rows.value.length===0);function U(){if(!V.value)if(e.value.key==="data"){let Q=N.lastNarrowDataTab.value;b.value&&Q==="parsing"&&(Q="column"),N.openDataPanel(Q)}else e.value.key==="edit"?N.selectTab(N.lastNarrowEditTab.value):e.value.key==="export"&&M.setExportTab(M.lastNarrowExportTab.value)}function K(){P.value=!0}function ae(Q){Y(Q),P.value=!1}const me={data:dS,edit:Ps,export:fS},de=o.map(Q=>({label:Q.label,key:Q.key,icon:me[Q.key]})),ve=A(()=>i.rows.value.length>0?[]:[1,2]);function te(){u.add(),u.setActive(d.value.length-1)}const pe=ze({}),we=[Le.BarVertical,Le.BarHorizontal,Le.Line,Le.VerticalBar,Le.HorizontalBar];function J(Q){var X,j,ce;const q=hs(Q.dataStr);if((X=q.series)!=null&&X.length&&we.includes(Q.chartType)){const ye=q.series.find(ue=>ue.name===s._base.selectedColumn.value);ye&&(q.values=ye.values),delete q.series}return F2(Q.chartType,q,Q.typeOpts,Q.sort,{colorizes:(j=Q.colorizes)!=null&&j.length?Q.colorizes:void 0,seriesOverrides:(ce=Q.seriesOverrides)!=null&&ce.length?Q.seriesOverrides:void 0})}function ge(Q,q){var X;if((Q==null?void 0:Q.data)!==void 0)return Q.data;if((X=Q==null?void 0:Q.transforms)!=null&&X.length&&i.columns.value.length>0){const j=x.applyStepList(Q.transforms,i.columns.value,i.rows.value,i.columnTypes.value);return dg(j.columns,j.rows)}return q}function re(){const Q=s._base,q={};q[0]=J({chartType:Q.chartType.value,dataStr:Q.data.value,typeOpts:y.value,sort:Q.sort.value,colorizes:Q.colorizes.value,seriesOverrides:Q.seriesOverrides.value});for(let X=0;X<d.value.length;X++){const j=Fa(d.value,X);q[X+1]=J({chartType:(j==null?void 0:j.chartType)??Q.chartType.value,dataStr:ge(j,Q.data.value),typeOpts:j!=null&&j.chartTypeOptions?{...y.value,...j.chartTypeOptions}:y.value,sort:oT(j)??Q.sort.value,colorizes:(j==null?void 0:j.colorizes)??Q.colorizes.value,seriesOverrides:(j==null?void 0:j.seriesOverrides)??Q.seriesOverrides.value})}pe.value=q}const oe=LN(re,300);qe([()=>d.value,s._base.chartType,s._base.data,s._base.sort,s._base.colorizes,s._base.seriesOverrides,s._base.selectedColumn,y,e],()=>{e.value.key==="edit"&&oe()},{deep:!0});function he(Q){var ce;const q=s._base.title.value;if(Q<0)return q||" ";const X=Fa(d.value,Q),j=(ce=X==null?void 0:X.properties)==null?void 0:ce.title;return j!==void 0?j||" ":q||" "}const I=A(()=>{const Q={name:he(-1),index:0,removable:!1,thumbnail:pe.value[0]??null,hint:"base scene"},q=d.value.map((X,j)=>{const ce=j+1,ye=nT(d.value,j);let ue;return ye===j?ue="custom data":ye<0?ue="inherits base":ue=`inherits ${he(ye)||`Scene ${ye+1}`}`,{name:he(j),index:ce,removable:!0,thumbnail:pe.value[ce]??null,hint:ue}});return[Q,...q]}),G=A(()=>f.value+1);function Y(Q){u.setActive(Q-1)}function se(Q){Q<=0||u.remove(Q-1)}const fe=A(()=>{const Q=e.value.key;return Q==="export"||Q==="data"&&C.value==="upload"?!1:Q==="edit"?!0:d.value.length>=1});pi(tB,{scenes:I,activeIndex:G,playing:g,showTimeline:fe,onSelect:Y,onAdd:te,onRemove:se,onPlay:v,onPause:m}),qe(f,(Q,q)=>{var X,j;e.value.key==="data"&&(q===-1&&Q>=0?(_.value=x.snapshot(),x.hydrate(((X=d.value[Q])==null?void 0:X.transforms)??[])):q>=0&&Q===-1?(u.update(q,{transforms:x.snapshot()}),x.hydrate(_.value)):q>=0&&Q>=0&&(u.update(q,{transforms:x.snapshot()}),x.hydrate(((j=d.value[Q])==null?void 0:j.transforms)??[])))}),fn(()=>{e.value.key==="edit"&&s._base.data.value&&re()});function ne(){f.value>=0&&(u.update(f.value,{transforms:x.snapshot()}),x.hydrate(_.value),u.setActive(-1)),s._base.data.value=i.serialize();const Q=s._base.chartType.value,q=Q.includes("multi")||Q.includes("stacked")||Q===Le.BarSplit||Q===Le.BarGrouped;if(i.columns.value.length>2&&!q){const X=i.columnTypes.value[0]==="date";s._base.chartType.value=X?Le.LineMulti:Le.BarMulti}}return r(()=>(ne(),l())),qe(()=>e.value.key,(Q,q)=>{q==="data"&&Q==="edit"&&a.value&&ne()}),KI(()=>{Pre()}),(Q,q)=>{const X=X1e,j=Hme,ce=ule;return w(),R("div",cbe,[H(AT,{class:"wizard-shell__header"},{start:ee(()=>[H(CT),p(L)&&p(S)?(w(),R("span",{key:0,class:"wizard-shell__saved-dot",role:"status","aria-live":"polite",title:p(L),"aria-label":p(L)},null,8,ube)):ie("",!0)]),center:ee(()=>[H(p(rU),{"current-step":p(n),"onUpdate:currentStep":q[0]||(q[0]=ye=>Xe(n)?n.value=ye:null),steps:p(de),"disabled-steps":p(ve),layout:p(B)?"stacked":"inline"},null,8,["current-step","steps","disabled-steps","layout"])]),end:ee(()=>[p(L)&&!p(S)?(w(),Z(p(wy),{key:0,variant:"success",pill:"",class:"wizard-shell__saved",role:"status","aria-live":"polite"},{default:ee(()=>[q[2]||(q[2]=T("span",{class:"wizard-shell__saved__dot"},null,-1)),Ye(" "+be(p(L)),1)]),_:1})):ie("",!0)]),_:1}),T("div",dbe,[T("div",fbe,[p(e).key==="data"?(w(),Z(X,{key:0})):p(e).key==="edit"?(w(),Z(j,{key:1})):p(e).key==="export"?(w(),Z(ce,{key:2})):ie("",!0)]),p(D)?(w(),Z(rbe,{key:0,"show-timeline":p(fe),scenes:p(I),"active-index":p(G),playing:p(g),"panel-label":p($),"panel-icon":p(F),"panel-disabled":p(V),"scenes-sheet-open":p(P),"onUpdate:activeIndex":Y,onPlay:p(v),onPause:p(m),onExpandTimeline:K,onOpenPanel:U},null,8,["show-timeline","scenes","active-index","playing","panel-label","panel-icon","panel-disabled","scenes-sheet-open","onPlay","onPause"])):ie("",!0),p(D)?(w(),Z(p(zA),{key:1,modelValue:p(P),"onUpdate:modelValue":q[1]||(q[1]=ye=>Xe(P)?P.value=ye:null),title:"Scenes"},{default:ee(()=>[H(p(tq),{scenes:p(I),"active-index":p(G),playing:p(g),"onUpdate:activeIndex":ae,onAdd:te,onRemove:se,onPlay:p(v),onPause:p(m)},null,8,["scenes","active-index","playing","onPlay","onPause"])]),_:1},8,["modelValue"])):ie("",!0)])])}}}),Wh=Oe(hbe,[["__scopeId","data-v-7fff2056"]]),pbe={class:"render-page"},mbe=le({__name:"RenderPage",setup(t){const e=Kl(),n=ht("containerRef"),{applyDsl:o}=Fc();q2(n);const{layout:r}=hn(),{cardClass:i,cardStyle:s}=G2(r,"render-page__card"),{scenes:a,activeIndex:l,playing:c,setActive:u,nextScene:d,previousScene:f,startPlayback:h,stopPlayback:g}=_n(),v={buttons:M1,"progress-bar":jA,"dot-stepper":XA,"minimal-arrows":KA},m=A(()=>v[r.value.playerType]||M1),b=A(()=>a.value.length+1),y=A(()=>l.value+2),x=A(()=>a.value.length>=1);function _(S){u(S-2)}const k=ze(null);function E(){var S;return((S=n.value)==null?void 0:S.querySelector(".bc-frame-footer"))??null}let L=null;return qe(n,S=>{if(L&&(L.disconnect(),L=null),!S){k.value=null;return}k.value=E(),L=new MutationObserver(()=>{k.value=E()}),L.observe(S,{childList:!0,subtree:!0})},{immediate:!0}),qs(()=>{L&&(L.disconnect(),L=null)}),fn(()=>{const S=e.query.bpc64;if(S)try{const B=globalThis.atob(S),D=Uint8Array.from(B,C=>C.charCodeAt(0)),N=new TextDecoder().decode(D);o(N)}catch{}}),(S,B)=>(w(),R("div",pbe,[T("div",{ref_key:"containerRef",ref:n,class:Te(["render-page__card",p(i)]),style:Pt(p(s))},null,6),p(k)&&p(x)?(w(),Z(ny,{key:0,to:p(k)},[(w(),Z(Gt(p(m)),{total:p(b),current:p(y),playing:p(c),position:p(r).playerPosition,"onUpdate:current":_,onPrevious:p(f),onNext:p(d),onPlay:p(h),onPause:p(g)},null,40,["total","current","playing","position","onPrevious","onNext","onPlay","onPause"]))],8,["to"])):ie("",!0)]))}}),gbe=Oe(mbe,[["__scopeId","data-v-76a513dd"]]);function Kv(t){const{sessionId:e,loadChart:n,startAutoSave:o}=Xs();if(e.value===t.params.id)return;if(!n(t.params.id))return"/charts";o()}function vbe(t){if(!t)return null;try{const e=t.replace(/-/g,"+").replace(/_/g,"/"),n=e.length%4===0?"":"=".repeat(4-e.length%4),o=atob(e+n),r=new Uint8Array(o.length);for(let i=0;i<o.length;i++)r[i]=o.charCodeAt(i);return new TextDecoder().decode(r)}catch{return null}}const bbe=SN({history:nN(),scrollBehavior(t,e,n){return n||(t.hash?{el:t.hash,behavior:"smooth"}:{top:0})},routes:[{path:"/",component:()=>Y6(()=>import("./LandingPage-DPFEpXc-.js"),__vite__mapDeps([0,1]))},{path:"/charts",component:kse},{path:"/new",component:Wh,beforeEnter:()=>{const{prepareNew:t}=Xs();t()}},{path:"/edit/:id",redirect:t=>`/edit/${t.params.id}/visualize`},{path:"/copy",component:()=>Y6(()=>import("./CopyRedirect-e-Xlyr0G.js"),[]),meta:{bare:!0},beforeEnter:t=>{const e=t.query.bpc64,n=vbe(typeof e=="string"?e:"");if(!n)return"/";const{createFromDsl:o}=Xs(),r=o(n);if(!r)return"/";t.meta.copyTarget=`/edit/${r}/visualize`}},{path:"/edit/:id/data",component:Wh,beforeEnter:Kv},{path:"/edit/:id/visualize",component:Wh,beforeEnter:Kv},{path:"/edit/:id/export",component:Wh,beforeEnter:Kv},{path:"/render",component:gbe,meta:{bare:!0}}]}),lB=TP();lB.use(RP);AP(pie).use(lB).use(bbe).use(gI()).mount("#app");export{ny as $,Cf as A,Kn as B,PN as C,K$ as D,ht as E,zt as F,B6 as G,wy as H,Ure as I,Dy as J,We as K,mt as L,be as M,fU as N,Me as O,Te as P,bue as Q,IT as R,NT as S,Fge as T,V2 as U,iB as V,Re as W,_be as X,qs as Y,Mse as Z,Oe as _,T as a,M1 as a0,Kl as a1,Cy as a2,ie as b,R as c,le as d,My as e,Z as f,p as g,H as h,Ye as i,ZA as j,A as k,rm as l,eC as m,JA as n,w as o,zq as p,Rq as q,Ce as r,Eq as s,qe as t,Tf as u,ss as v,ee as w,cg as x,ze as y,Xe as z};
|