@blueprint-chart/editor 0.1.5 → 0.1.8
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/README.md +2 -2
- package/dist/CNAME +1 -0
- package/dist/assets/CopyRedirect-CEpRBvCY.js +1 -0
- package/dist/assets/LandingPage-BSxJZaea.js +4 -0
- package/dist/assets/LandingPage-BgjMBa5n.css +1 -0
- package/dist/assets/dm-serif-display-latin-400-italic-BgxzcTJK.woff +0 -0
- package/dist/assets/dm-serif-display-latin-400-italic-DpcbibHm.woff2 +0 -0
- package/dist/assets/dm-serif-display-latin-400-normal-C5_t9oOD.woff2 +0 -0
- package/dist/assets/dm-serif-display-latin-400-normal-_kVFYEpx.woff +0 -0
- package/dist/assets/dm-serif-display-latin-ext-400-italic-D6UvgSoX.woff +0 -0
- package/dist/assets/dm-serif-display-latin-ext-400-italic-DiLdooSn.woff2 +0 -0
- package/dist/assets/dm-serif-display-latin-ext-400-normal-B1toqZab.woff +0 -0
- package/dist/assets/dm-serif-display-latin-ext-400-normal-p18AlW_x.woff2 +0 -0
- package/dist/assets/geist-cyrillic-wght-normal-CHSlOQsW.woff2 +0 -0
- package/dist/assets/geist-latin-ext-wght-normal-DMtmJ5ZE.woff2 +0 -0
- package/dist/assets/geist-latin-wght-normal-Dm3htQBi.woff2 +0 -0
- package/dist/assets/geist-mono-cyrillic-wght-normal-BZdD_g9V.woff2 +0 -0
- package/dist/assets/geist-mono-latin-ext-wght-normal-b6lpi8_2.woff2 +0 -0
- package/dist/assets/geist-mono-latin-wght-normal-Cjtb1TV-.woff2 +0 -0
- package/dist/assets/index-B5roretg.css +5 -0
- package/dist/assets/index-DB4Qiiq5.js +920 -0
- package/dist/index.html +9 -4
- package/package.json +8 -5
- package/dist/assets/LandingPage-CUHXTBOL.js +0 -6
- package/dist/assets/LandingPage-DRLkxzYH.css +0 -1
- package/dist/assets/index-BswGET7c.css +0 -5
- package/dist/assets/index-N5rdrXTN.js +0 -1405
|
@@ -0,0 +1,920 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LandingPage-BSxJZaea.js","assets/LandingPage-BgjMBa5n.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
var iB=Object.defineProperty;var sB=(t,e,n)=>e in t?iB(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var qn=(t,e,n)=>sB(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 Lb(t){const e=Object.create(null);for(const n of t.split(","))e[n]=1;return n=>n in e}const Wt={},wc=[],ai=()=>{},NS=()=>!1,Cp=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),Pb=t=>t.startsWith("onUpdate:"),In=Object.assign,Db=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},aB=Object.prototype.hasOwnProperty,Xt=(t,e)=>aB.call(t,e),lt=Array.isArray,_c=t=>ff(t)==="[object Map]",lu=t=>ff(t)==="[object Set]",_x=t=>ff(t)==="[object Date]",vt=t=>typeof t=="function",mn=t=>typeof t=="string",di=t=>typeof t=="symbol",qt=t=>t!==null&&typeof t=="object",FS=t=>(qt(t)||vt(t))&&vt(t.then)&&vt(t.catch),VS=Object.prototype.toString,ff=t=>VS.call(t),lB=t=>ff(t).slice(8,-1),zS=t=>ff(t)==="[object Object]",Ap=t=>mn(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,id=Lb(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),$p=t=>{const e=Object.create(null);return(n=>e[n]||(e[n]=t(n)))},cB=/-\w/g,Sr=$p(t=>t.replace(cB,e=>e.slice(1).toUpperCase())),uB=/\B([A-Z])/g,Fs=$p(t=>t.replace(uB,"-$1").toLowerCase()),Tp=$p(t=>t.charAt(0).toUpperCase()+t.slice(1)),hg=$p(t=>t?`on${Tp(t)}`:""),Qo=(t,e)=>!Object.is(t,e),Ph=(t,...e)=>{for(let n=0;n<t.length;n++)t[n](...e)},HS=(t,e,n,o=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:o,value:n})},Mp=t=>{const e=parseFloat(t);return isNaN(e)?t:e},dB=t=>{const e=mn(t)?Number(t):NaN;return isNaN(e)?t:e};let Sx;const Op=()=>Sx||(Sx=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Ot(t){if(lt(t)){const e={};for(let n=0;n<t.length;n++){const o=t[n],r=mn(o)?mB(o):Ot(o);if(r)for(const i in r)e[i]=r[i]}return e}else if(mn(t)||qt(t))return t}const fB=/;(?![^(]*\))/g,hB=/:([^]+)/,pB=/\/\*[^]*?\*\//g;function mB(t){const e={};return t.replace(pB,"").split(fB).forEach(n=>{if(n){const o=n.split(hB);o.length>1&&(e[o[0].trim()]=o[1].trim())}}),e}function Me(t){let e="";if(mn(t))e=t;else if(lt(t))for(let n=0;n<t.length;n++){const o=Me(t[n]);o&&(e+=o+" ")}else if(qt(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}function Vn(t){if(!t)return null;let{class:e,style:n}=t;return e&&!mn(e)&&(t.class=Me(e)),n&&(t.style=Ot(n)),t}const gB="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",vB=Lb(gB);function WS(t){return!!t||t===""}function bB(t,e){if(t.length!==e.length)return!1;let n=!0;for(let o=0;n&&o<t.length;o++)n=ba(t[o],e[o]);return n}function ba(t,e){if(t===e)return!0;let n=_x(t),o=_x(e);if(n||o)return n&&o?t.getTime()===e.getTime():!1;if(n=di(t),o=di(e),n||o)return t===e;if(n=lt(t),o=lt(e),n||o)return n&&o?bB(t,e):!1;if(n=qt(t),o=qt(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||!ba(t[s],e[s]))return!1}}return String(t)===String(e)}function Eb(t,e){return t.findIndex(n=>ba(n,e))}const US=t=>!!(t&&t.__v_isRef===!0),xe=t=>mn(t)?t:t==null?"":lt(t)||qt(t)&&(t.toString===VS||!vt(t.toString))?US(t)?xe(t.value):JSON.stringify(t,GS,2):String(t),GS=(t,e)=>US(e)?GS(t,e.value):_c(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[o,r],i)=>(n[pg(o,i)+" =>"]=r,n),{})}:lu(e)?{[`Set(${e.size})`]:[...e.values()].map(n=>pg(n))}:di(e)?pg(e):qt(e)&&!lt(e)&&!zS(e)?String(e):e,pg=(t,e="")=>{var n;return di(t)?`Symbol(${(n=t.description)!=null?n:e})`:t};function yB(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 mo;class qS{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=mo,!e&&mo&&(this.index=(mo.scopes||(mo.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=mo;try{return mo=this,e()}finally{mo=n}}}on(){++this._on===1&&(this.prevScope=mo,mo=this)}off(){this._on>0&&--this._on===0&&(mo=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 Bp(t){return new qS(t)}function Rl(){return mo}function ya(t,e=!1){mo&&mo.cleanups.push(t)}let un;const mg=new WeakSet;class YS{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,mo&&mo.active&&mo.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,mg.has(this)&&(mg.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||XS(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,kx(this),KS(this);const e=un,n=li;un=this,li=!0;try{return this.fn()}finally{ZS(this),un=e,li=n,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Nb(e);this.deps=this.depsTail=void 0,kx(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?mg.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Nv(this)&&this.run()}get dirty(){return Nv(this)}}let jS=0,sd,ad;function XS(t,e=!1){if(t.flags|=8,e){t.next=ad,ad=t;return}t.next=sd,sd=t}function Ib(){jS++}function Rb(){if(--jS>0)return;if(ad){let e=ad;for(ad=void 0;e;){const n=e.next;e.next=void 0,e.flags&=-9,e=n}}let t;for(;sd;){let e=sd;for(sd=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 KS(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function ZS(t){let e,n=t.depsTail,o=n;for(;o;){const r=o.prevDep;o.version===-1?(o===n&&(n=r),Nb(o),xB(o)):e=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=r}t.deps=e,t.depsTail=n}function Nv(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(QS(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function QS(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===$d)||(t.globalVersion=$d,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!Nv(t))))return;t.flags|=2;const e=t.dep,n=un,o=li;un=t,li=!0;try{KS(t);const r=t.fn(t._value);(e.version===0||Qo(r,t._value))&&(t.flags|=128,t._value=r,e.version++)}catch(r){throw e.version++,r}finally{un=n,li=o,ZS(t),t.flags&=-3}}function Nb(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)Nb(i,!0)}!e&&!--n.sc&&n.map&&n.map.delete(n.key)}function xB(t){const{prevDep:e,nextDep:n}=t;e&&(e.nextDep=n,t.prevDep=void 0),n&&(n.prevDep=e,t.nextDep=void 0)}let li=!0;const JS=[];function Bs(){JS.push(li),li=!1}function Ls(){const t=JS.pop();li=t===void 0?!0:t}function kx(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const n=un;un=void 0;try{e()}finally{un=n}}}let $d=0;class wB{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 Lp{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(!un||!li||un===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==un)n=this.activeLink=new wB(un,this),un.deps?(n.prevDep=un.depsTail,un.depsTail.nextDep=n,un.depsTail=n):un.deps=un.depsTail=n,ek(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=un.depsTail,n.nextDep=void 0,un.depsTail.nextDep=n,un.depsTail=n,un.deps===n&&(un.deps=o)}return n}trigger(e){this.version++,$d++,this.notify(e)}notify(e){Ib();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Rb()}}}function ek(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)ek(o)}const n=t.dep.subs;n!==t&&(t.prevSub=n,n&&(n.nextSub=t)),t.dep.subs=t}}const t0=new WeakMap,ml=Symbol(""),Fv=Symbol(""),Td=Symbol("");function bo(t,e,n){if(li&&un){let o=t0.get(t);o||t0.set(t,o=new Map);let r=o.get(n);r||(o.set(n,r=new Lp),r.map=o,r.key=n),r.track()}}function ys(t,e,n,o,r,i){const s=t0.get(t);if(!s){$d++;return}const a=l=>{l&&l.trigger()};if(Ib(),e==="clear")s.forEach(a);else{const l=lt(t),c=l&&Ap(n);if(l&&n==="length"){const u=Number(o);s.forEach((d,f)=>{(f==="length"||f===Td||!di(f)&&f>=u)&&a(d)})}else switch((n!==void 0||s.has(void 0))&&a(s.get(n)),c&&a(s.get(Td)),e){case"add":l?c&&a(s.get("length")):(a(s.get(ml)),_c(t)&&a(s.get(Fv)));break;case"delete":l||(a(s.get(ml)),_c(t)&&a(s.get(Fv)));break;case"set":_c(t)&&a(s.get(ml));break}}Rb()}function _B(t,e){const n=t0.get(t);return n&&n.get(e)}function nc(t){const e=Lt(t);return e===t?e:(bo(e,"iterate",Td),yr(t)?e:e.map(fi))}function Pp(t){return bo(t=Lt(t),"iterate",Td),t}function ra(t,e){return Ps(t)?Ic(Ui(t)?fi(e):e):fi(e)}const SB={__proto__:null,[Symbol.iterator](){return gg(this,Symbol.iterator,t=>ra(this,t))},concat(...t){return nc(this).concat(...t.map(e=>lt(e)?nc(e):e))},entries(){return gg(this,"entries",t=>(t[1]=ra(this,t[1]),t))},every(t,e){return is(this,"every",t,e,void 0,arguments)},filter(t,e){return is(this,"filter",t,e,n=>n.map(o=>ra(this,o)),arguments)},find(t,e){return is(this,"find",t,e,n=>ra(this,n),arguments)},findIndex(t,e){return is(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return is(this,"findLast",t,e,n=>ra(this,n),arguments)},findLastIndex(t,e){return is(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return is(this,"forEach",t,e,void 0,arguments)},includes(...t){return vg(this,"includes",t)},indexOf(...t){return vg(this,"indexOf",t)},join(t){return nc(this).join(t)},lastIndexOf(...t){return vg(this,"lastIndexOf",t)},map(t,e){return is(this,"map",t,e,void 0,arguments)},pop(){return Mu(this,"pop")},push(...t){return Mu(this,"push",t)},reduce(t,...e){return Cx(this,"reduce",t,e)},reduceRight(t,...e){return Cx(this,"reduceRight",t,e)},shift(){return Mu(this,"shift")},some(t,e){return is(this,"some",t,e,void 0,arguments)},splice(...t){return Mu(this,"splice",t)},toReversed(){return nc(this).toReversed()},toSorted(t){return nc(this).toSorted(t)},toSpliced(...t){return nc(this).toSpliced(...t)},unshift(...t){return Mu(this,"unshift",t)},values(){return gg(this,"values",t=>ra(this,t))}};function gg(t,e,n){const o=Pp(t),r=o[e]();return o!==t&&!yr(t)&&(r._next=r.next,r.next=()=>{const i=r._next();return i.done||(i.value=n(i.value)),i}),r}const kB=Array.prototype;function is(t,e,n,o,r,i){const s=Pp(t),a=s!==t&&!yr(t),l=s[e];if(l!==kB[e]){const d=l.apply(t,i);return a?fi(d):d}let c=n;s!==t&&(a?c=function(d,f){return n.call(this,ra(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 Cx(t,e,n,o){const r=Pp(t);let i=n;return r!==t&&(yr(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,ra(t,a),l,t)}),r[e](i,...o)}function vg(t,e,n){const o=Lt(t);bo(o,"iterate",Td);const r=o[e](...n);return(r===-1||r===!1)&&Ip(n[0])?(n[0]=Lt(n[0]),o[e](...n)):r}function Mu(t,e,n=[]){Bs(),Ib();const o=Lt(t)[e].apply(t,n);return Rb(),Ls(),o}const CB=Lb("__proto__,__v_isRef,__isVue"),tk=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(di));function AB(t){di(t)||(t=String(t));const e=Lt(this);return bo(e,"has",t),e.hasOwnProperty(t)}class nk{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?lk:ak:i?sk:ik).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(o)?e:void 0;const s=lt(e);if(!r){let l;if(s&&(l=SB[n]))return l;if(n==="hasOwnProperty")return AB}const a=Reflect.get(e,n,Ke(e)?e:o);if((di(n)?tk.has(n):CB(n))||(r||bo(e,"get",n),i))return a;if(Ke(a)){const l=s&&Ap(n)?a:a.value;return r&&qt(l)?ro(l):l}return qt(a)?r?ro(a):sr(a):a}}class ok extends nk{constructor(e=!1){super(!1,e)}set(e,n,o,r){let i=e[n];const s=lt(e)&&Ap(n);if(!this._isShallow){const c=Ps(i);if(!yr(o)&&!Ps(o)&&(i=Lt(i),o=Lt(o)),!s&&Ke(i)&&!Ke(o))return c||(i.value=o),!0}const a=s?Number(n)<e.length:Xt(e,n),l=Reflect.set(e,n,o,Ke(e)?e:r);return e===Lt(r)&&(a?Qo(o,i)&&ys(e,"set",n,o):ys(e,"add",n,o)),l}deleteProperty(e,n){const o=Xt(e,n);e[n];const r=Reflect.deleteProperty(e,n);return r&&o&&ys(e,"delete",n,void 0),r}has(e,n){const o=Reflect.has(e,n);return(!di(n)||!tk.has(n))&&bo(e,"has",n),o}ownKeys(e){return bo(e,"iterate",lt(e)?"length":ml),Reflect.ownKeys(e)}}class rk extends nk{constructor(e=!1){super(!0,e)}set(e,n){return!0}deleteProperty(e,n){return!0}}const $B=new ok,TB=new rk,MB=new ok(!0),OB=new rk(!0),Vv=t=>t,Vf=t=>Reflect.getPrototypeOf(t);function BB(t,e,n){return function(...o){const r=this.__v_raw,i=Lt(r),s=_c(i),a=t==="entries"||t===Symbol.iterator&&s,l=t==="keys"&&s,c=r[t](...o),u=n?Vv:e?Ic:fi;return!e&&bo(i,"iterate",l?Fv:ml),In(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 zf(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function LB(t,e){const n={get(r){const i=this.__v_raw,s=Lt(i),a=Lt(r);t||(Qo(r,a)&&bo(s,"get",r),bo(s,"get",a));const{has:l}=Vf(s),c=e?Vv:t?Ic:fi;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&&bo(Lt(r),"iterate",ml),r.size},has(r){const i=this.__v_raw,s=Lt(i),a=Lt(r);return t||(Qo(r,a)&&bo(s,"has",r),bo(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=Lt(a),c=e?Vv:t?Ic:fi;return!t&&bo(l,"iterate",ml),a.forEach((u,d)=>r.call(i,c(u),c(d),s))}};return In(n,t?{add:zf("add"),set:zf("set"),delete:zf("delete"),clear:zf("clear")}:{add(r){!e&&!yr(r)&&!Ps(r)&&(r=Lt(r));const i=Lt(this);return Vf(i).has.call(i,r)||(i.add(r),ys(i,"add",r,r)),this},set(r,i){!e&&!yr(i)&&!Ps(i)&&(i=Lt(i));const s=Lt(this),{has:a,get:l}=Vf(s);let c=a.call(s,r);c||(r=Lt(r),c=a.call(s,r));const u=l.call(s,r);return s.set(r,i),c?Qo(i,u)&&ys(s,"set",r,i):ys(s,"add",r,i),this},delete(r){const i=Lt(this),{has:s,get:a}=Vf(i);let l=s.call(i,r);l||(r=Lt(r),l=s.call(i,r)),a&&a.call(i,r);const c=i.delete(r);return l&&ys(i,"delete",r,void 0),c},clear(){const r=Lt(this),i=r.size!==0,s=r.clear();return i&&ys(r,"clear",void 0,void 0),s}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=BB(r,t,e)}),n}function Dp(t,e){const n=LB(t,e);return(o,r,i)=>r==="__v_isReactive"?!t:r==="__v_isReadonly"?t:r==="__v_raw"?o:Reflect.get(Xt(n,r)&&r in o?n:o,r,i)}const PB={get:Dp(!1,!1)},DB={get:Dp(!1,!0)},EB={get:Dp(!0,!1)},IB={get:Dp(!0,!0)},ik=new WeakMap,sk=new WeakMap,ak=new WeakMap,lk=new WeakMap;function RB(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function NB(t){return t.__v_skip||!Object.isExtensible(t)?0:RB(lB(t))}function sr(t){return Ps(t)?t:Ep(t,!1,$B,PB,ik)}function ck(t){return Ep(t,!1,MB,DB,sk)}function ro(t){return Ep(t,!0,TB,EB,ak)}function tl(t){return Ep(t,!0,OB,IB,lk)}function Ep(t,e,n,o,r){if(!qt(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const i=NB(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 Ui(t){return Ps(t)?Ui(t.__v_raw):!!(t&&t.__v_isReactive)}function Ps(t){return!!(t&&t.__v_isReadonly)}function yr(t){return!!(t&&t.__v_isShallow)}function Ip(t){return t?!!t.__v_raw:!1}function Lt(t){const e=t&&t.__v_raw;return e?Lt(e):t}function $e(t){return!Xt(t,"__v_skip")&&Object.isExtensible(t)&&HS(t,"__v_skip",!0),t}const fi=t=>qt(t)?sr(t):t,Ic=t=>qt(t)?ro(t):t;function Ke(t){return t?t.__v_isRef===!0:!1}function Ie(t){return uk(t,!1)}function De(t){return uk(t,!0)}function uk(t,e){return Ke(t)?t:new FB(t,e)}class FB{constructor(e,n){this.dep=new Lp,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?e:Lt(e),this._value=n?e:fi(e),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(e){const n=this._rawValue,o=this.__v_isShallow||yr(e)||Ps(e);e=o?e:Lt(e),Qo(e,n)&&(this._rawValue=e,this._value=o?e:fi(e),this.dep.trigger())}}function p(t){return Ke(t)?t.value:t}function bt(t){return vt(t)?t():p(t)}const VB={get:(t,e,n)=>e==="__v_raw"?t:p(Reflect.get(t,e,n)),set:(t,e,n,o)=>{const r=t[e];return Ke(r)&&!Ke(n)?(r.value=n,!0):Reflect.set(t,e,n,o)}};function dk(t){return Ui(t)?t:new Proxy(t,VB)}class zB{constructor(e){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new Lp,{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 fk(t){return new zB(t)}function Rp(t){const e=lt(t)?new Array(t.length):{};for(const n in t)e[n]=hk(t,n);return e}class HB{constructor(e,n,o){this._object=e,this._key=n,this._defaultValue=o,this.__v_isRef=!0,this._value=void 0,this._raw=Lt(e);let r=!0,i=e;if(!lt(e)||!Ap(String(n)))do r=!Ip(i)||yr(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&&Ke(this._raw[this._key])){const n=this._object[this._key];if(Ke(n)){n.value=e;return}}this._object[this._key]=e}get dep(){return _B(this._raw,this._key)}}class WB{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 Ft(t,e,n){return Ke(t)?t:vt(t)?new WB(t):qt(t)&&arguments.length>1?hk(t,e,n):Ie(t)}function hk(t,e,n){return new HB(t,e,n)}class UB{constructor(e,n,o){this.fn=e,this.setter=n,this._value=void 0,this.dep=new Lp(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=$d-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=o}notify(){if(this.flags|=16,!(this.flags&8)&&un!==this)return XS(this,!0),!0}get value(){const e=this.dep.track();return QS(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function GB(t,e,n=!1){let o,r;return vt(t)?o=t:(o=t.get,r=t.set),new UB(o,r,n)}const Hf={},n0=new WeakMap;let nl;function qB(t,e=!1,n=nl){if(n){let o=n0.get(n);o||n0.set(n,o=[]),o.push(t)}}function YB(t,e,n=Wt){const{immediate:o,deep:r,once:i,scheduler:s,augmentJob:a,call:l}=n,c=_=>r?_:yr(_)||r===!1||r===0?xs(_,1):xs(_);let u,d,f,h,m=!1,b=!1;if(Ke(t)?(d=()=>t.value,m=yr(t)):Ui(t)?(d=()=>c(t),m=!0):lt(t)?(b=!0,m=t.some(_=>Ui(_)||yr(_)),d=()=>t.map(_=>{if(Ke(_))return _.value;if(Ui(_))return c(_);if(vt(_))return l?l(_,2):_()})):vt(t)?e?d=l?()=>l(t,2):t:d=()=>{if(f){Bs();try{f()}finally{Ls()}}const _=nl;nl=u;try{return l?l(t,3,[h]):t(h)}finally{nl=_}}:d=ai,e&&r){const _=d,C=r===!0?1/0:r;d=()=>xs(_(),C)}const g=Rl(),v=()=>{u.stop(),g&&g.active&&Db(g.effects,u)};if(i&&e){const _=e;e=(...C)=>{_(...C),v()}}let y=b?new Array(t.length).fill(Hf):Hf;const x=_=>{if(!(!(u.flags&1)||!u.dirty&&!_))if(e){const C=u.run();if(r||m||(b?C.some((L,O)=>Qo(L,y[O])):Qo(C,y))){f&&f();const L=nl;nl=u;try{const O=[C,y===Hf?void 0:b&&y[0]===Hf?[]:y,h];y=C,l?l(e,3,O):e(...O)}finally{nl=L}}}else u.run()};return a&&a(x),u=new YS(d),u.scheduler=s?()=>s(x,!1):x,h=_=>qB(_,!1,u),f=u.onStop=()=>{const _=n0.get(u);if(_){if(l)l(_,4);else for(const C of _)C();n0.delete(u)}},e?o?x(!0):y=u.run():s?s(x.bind(null,!0),!0):u.run(),v.pause=u.pause.bind(u),v.resume=u.resume.bind(u),v.stop=v,v}function xs(t,e=1/0,n){if(e<=0||!qt(t)||t.__v_skip||(n=n||new Map,(n.get(t)||0)>=e))return t;if(n.set(t,e),e--,Ke(t))xs(t.value,e,n);else if(lt(t))for(let o=0;o<t.length;o++)xs(t[o],e,n);else if(lu(t)||_c(t))t.forEach(o=>{xs(o,e,n)});else if(zS(t)){for(const o in t)xs(t[o],e,n);for(const o of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,o)&&xs(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 hf(t,e,n,o){try{return o?t(...o):t()}catch(r){Np(r,e,n)}}function hi(t,e,n,o){if(vt(t)){const r=hf(t,e,n,o);return r&&FS(r)&&r.catch(i=>{Np(i,e,n)}),r}if(lt(t)){const r=[];for(let i=0;i<t.length;i++)r.push(hi(t[i],e,n,o));return r}}function Np(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){Bs(),hf(i,null,10,[t,l,c]),Ls();return}}jB(t,n,r,o,s)}function jB(t,e,n,o=!0,r=!1){if(r)throw t;console.error(t)}const zo=[];let Ei=-1;const Sc=[];let ia=null,uc=0;const pk=Promise.resolve();let o0=null;function _n(t){const e=o0||pk;return t?e.then(this?t.bind(this):t):e}function XB(t){let e=Ei+1,n=zo.length;for(;e<n;){const o=e+n>>>1,r=zo[o],i=Md(r);i<t||i===t&&r.flags&2?e=o+1:n=o}return e}function Fb(t){if(!(t.flags&1)){const e=Md(t),n=zo[zo.length-1];!n||!(t.flags&2)&&e>=Md(n)?zo.push(t):zo.splice(XB(e),0,t),t.flags|=1,mk()}}function mk(){o0||(o0=pk.then(bk))}function gk(t){lt(t)?Sc.push(...t):ia&&t.id===-1?ia.splice(uc+1,0,t):t.flags&1||(Sc.push(t),t.flags|=1),mk()}function Ax(t,e,n=Ei+1){for(;n<zo.length;n++){const o=zo[n];if(o&&o.flags&2){if(t&&o.id!==t.uid)continue;zo.splice(n,1),n--,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function vk(t){if(Sc.length){const e=[...new Set(Sc)].sort((n,o)=>Md(n)-Md(o));if(Sc.length=0,ia){ia.push(...e);return}for(ia=e,uc=0;uc<ia.length;uc++){const n=ia[uc];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}ia=null,uc=0}}const Md=t=>t.id==null?t.flags&2?-1:1/0:t.id;function bk(t){try{for(Ei=0;Ei<zo.length;Ei++){const e=zo[Ei];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),hf(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;Ei<zo.length;Ei++){const e=zo[Ei];e&&(e.flags&=-2)}Ei=-1,zo.length=0,vk(),o0=null,(zo.length||Sc.length)&&bk()}}let oo=null,yk=null;function r0(t){const e=oo;return oo=t,yk=t&&t.type.__scopeId||null,e}function Q(t,e=oo,n){if(!e||t._n)return t;const o=(...r)=>{o._d&&l0(-1);const i=r0(e);let s;try{s=t(...r)}finally{r0(i),o._d&&l0(1)}return s};return o._n=!0,o._c=!0,o._d=!0,o}function ir(t,e){if(oo===null)return t;const n=jp(oo),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&&xs(s),o.push({dir:i,instance:n,value:s,oldValue:void 0,arg:a,modifiers:l}))}return t}function ja(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&&(Bs(),hi(l,n,8,[t.el,a,t,e]),Ls())}}function Gi(t,e){if(wo){let n=wo.provides;const o=wo.parent&&wo.parent.provides;o===n&&(n=wo.provides=Object.create(o)),n[t]=e}}function Jt(t,e,n=!1){const o=Oo();if(o||gl){let r=gl?gl._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 Vb(){return!!(Oo()||gl)}const KB=Symbol.for("v-scx"),ZB=()=>Jt(KB);function Fp(t,e){return Vp(t,null,e)}function QB(t,e){return Vp(t,null,{flush:"sync"})}function He(t,e,n){return Vp(t,e,n)}function Vp(t,e,n=Wt){const{immediate:o,deep:r,flush:i,once:s}=n,a=In({},n),l=e&&o||!e&&i!=="post";let c;if(Pd){if(i==="sync"){const h=ZB();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!l){const h=()=>{};return h.stop=ai,h.resume=ai,h.pause=ai,h}}const u=wo;a.call=(h,m,b)=>hi(h,u,m,b);let d=!1;i==="post"?a.scheduler=h=>{po(h,u&&u.suspense)}:i!=="sync"&&(d=!0,a.scheduler=(h,m)=>{m?h():Fb(h)}),a.augmentJob=h=>{e&&(h.flags|=4),d&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const f=YB(t,e,a);return Pd&&(c?c.push(f):l&&f()),f}function JB(t,e,n){const o=this.proxy,r=mn(t)?t.includes(".")?xk(o,t):()=>o[t]:t.bind(o,o);let i;vt(e)?i=e:(i=e.handler,n=e);const s=pf(this),a=Vp(r,i.bind(o),n);return s(),a}function xk(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 wk=Symbol("_vte"),_k=t=>t.__isTeleport,ld=t=>t&&(t.disabled||t.disabled===""),$x=t=>t&&(t.defer||t.defer===""),Tx=t=>typeof SVGElement<"u"&&t instanceof SVGElement,Mx=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,zv=(t,e)=>{const n=t&&t.to;return mn(n)?e?e(n):null:n},Sk={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:m,createText:b,createComment:g}}=c,v=ld(e.props);let{shapeFlag:y,children:x,dynamicChildren:_}=e;if(t==null){const C=e.el=b(""),L=e.anchor=b("");h(C,n,o),h(L,n,o);const O=(M,D)=>{y&16&&u(x,M,D,r,i,s,a,l)},$=()=>{const M=e.target=zv(e.props,m),D=Hv(M,e,b,h);M&&(s!=="svg"&&Tx(M)?s="svg":s!=="mathml"&&Mx(M)&&(s="mathml"),r&&r.isCE&&(r.ce._teleportTargets||(r.ce._teleportTargets=new Set)).add(M),v||(O(M,D),Dh(e,!1)))};v&&(O(n,L),Dh(e,!0)),$x(e.props)?(e.el.__isMounted=!1,po(()=>{$(),delete e.el.__isMounted},i)):$()}else{if($x(e.props)&&t.el.__isMounted===!1){po(()=>{Sk.process(t,e,n,o,r,i,s,a,l,c)},i);return}e.el=t.el,e.targetStart=t.targetStart;const C=e.anchor=t.anchor,L=e.target=t.target,O=e.targetAnchor=t.targetAnchor,$=ld(t.props),M=$?n:L,D=$?C:O;if(s==="svg"||Tx(L)?s="svg":(s==="mathml"||Mx(L))&&(s="mathml"),_?(f(t.dynamicChildren,_,M,r,i,s,a),Ub(t,e,!0)):l||d(t,e,M,D,r,i,s,a,!1),v)$?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):Wf(e,n,C,c,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const N=e.target=zv(e.props,m);N&&Wf(e,N,null,c,0)}else $&&Wf(e,L,O,c,1);Dh(e,v)}},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||!ld(f);for(let m=0;m<a.length;m++){const b=a[m];o(b,e,n,h,!!b.dynamicChildren)}}},move:Wf,hydrate:e9};function Wf(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||ld(u))&&l&16)for(let f=0;f<c.length;f++)r(c[f],e,n,2);d&&o(a,e,n)}function e9(t,e,n,o,r,i,{o:{nextSibling:s,parentNode:a,querySelector:l,insert:c,createText:u}},d){function f(g,v){let y=v;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,g._lpa=e.targetAnchor&&s(e.targetAnchor);break}}y=s(y)}}function h(g,v){v.anchor=d(s(g),v,a(g),n,o,r,i)}const m=e.target=zv(e.props,l),b=ld(e.props);if(m){const g=m._lpa||m.firstChild;e.shapeFlag&16&&(b?(h(t,e),f(m,g),e.targetAnchor||Hv(m,e,u,c,a(t)===m?t:null)):(e.anchor=s(t),f(m,g),e.targetAnchor||Hv(m,e,u,c),d(g&&s(g),e,m,n,o,r,i))),Dh(e,b)}else b&&e.shapeFlag&16&&(h(t,e),e.targetStart=t,e.targetAnchor=s(t));return e.anchor&&s(e.anchor)}const zp=Sk;function Dh(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 Hv(t,e,n,o,r=null){const i=e.targetStart=n(""),s=e.targetAnchor=n("");return i[wk]=s,t&&(o(i,t,r),o(s,t,r)),s}const Ii=Symbol("_leaveCb"),Ou=Symbol("_enterCb");function t9(){const t={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return fn(()=>{t.isMounted=!0}),Ds(()=>{t.isUnmounting=!0}),t}const Br=[Function,Array],kk={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Br,onEnter:Br,onAfterEnter:Br,onEnterCancelled:Br,onBeforeLeave:Br,onLeave:Br,onAfterLeave:Br,onLeaveCancelled:Br,onBeforeAppear:Br,onAppear:Br,onAfterAppear:Br,onAppearCancelled:Br},Ck=t=>{const e=t.subTree;return e.component?Ck(e.component):e},n9={name:"BaseTransition",props:kk,setup(t,{slots:e}){const n=Oo(),o=t9();return()=>{const r=e.default&&Tk(e.default(),!0);if(!r||!r.length)return;const i=Ak(r),s=Lt(t),{mode:a}=s;if(o.isLeaving)return bg(i);const l=Ox(i);if(!l)return bg(i);let c=Wv(l,s,o,n,d=>c=d);l.type!==xo&&Od(l,c);let u=n.subTree&&Ox(n.subTree);if(u&&u.type!==xo&&!ll(u,l)&&Ck(n).type!==xo){let d=Wv(u,s,o,n);if(Od(u,d),a==="out-in"&&l.type!==xo)return o.isLeaving=!0,d.afterLeave=()=>{o.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},bg(i);a==="in-out"&&l.type!==xo?d.delayLeave=(f,h,m)=>{const b=$k(o,u);b[String(u.key)]=u,f[Ii]=()=>{h(),f[Ii]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{m(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function Ak(t){let e=t[0];if(t.length>1){for(const n of t)if(n.type!==xo){e=n;break}}return e}const o9=n9;function $k(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 Wv(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:m,onLeaveCancelled:b,onBeforeAppear:g,onAppear:v,onAfterAppear:y,onAppearCancelled:x}=e,_=String(t.key),C=$k(n,t),L=(M,D)=>{M&&hi(M,o,9,D)},O=(M,D)=>{const N=D[1];L(M,D),lt(M)?M.every(k=>k.length<=1)&&N():M.length<=1&&N()},$={mode:s,persisted:a,beforeEnter(M){let D=l;if(!n.isMounted)if(i)D=g||l;else return;M[Ii]&&M[Ii](!0);const N=C[_];N&&ll(t,N)&&N.el[Ii]&&N.el[Ii](),L(D,[M])},enter(M){if(C[_]===t)return;let D=c,N=u,k=d;if(!n.isMounted)if(i)D=v||c,N=y||u,k=x||d;else return;let A=!1;M[Ou]=P=>{A||(A=!0,P?L(k,[M]):L(N,[M]),$.delayedLeave&&$.delayedLeave(),M[Ou]=void 0)};const B=M[Ou].bind(null,!1);D?O(D,[M,B]):B()},leave(M,D){const N=String(t.key);if(M[Ou]&&M[Ou](!0),n.isUnmounting)return D();L(f,[M]);let k=!1;M[Ii]=B=>{k||(k=!0,D(),B?L(b,[M]):L(m,[M]),M[Ii]=void 0,C[N]===t&&delete C[N])};const A=M[Ii].bind(null,!1);C[N]=t,h?O(h,[M,A]):A()},clone(M){const D=Wv(M,e,n,o,r);return r&&r(D),D}};return $}function bg(t){if(Hp(t))return t=xa(t),t.children=null,t}function Ox(t){if(!Hp(t))return _k(t.type)&&t.children?Ak(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 Od(t,e){t.shapeFlag&6&&t.component?(t.transition=e,Od(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 Tk(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===Ne?(s.patchFlag&128&&r++,o=o.concat(Tk(s.children,e,a))):(e||s.type!==xo)&&o.push(a!=null?xa(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)?In({name:t.name},e,{setup:t}):t}function Mk(){const t=Oo();return t?(t.appContext.config.idPrefix||"v")+"-"+t.ids[0]+t.ids[1]++:""}function Ok(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}function ft(t){const e=Oo(),n=De(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 Bx(t,e){let n;return!!((n=Object.getOwnPropertyDescriptor(t,e))&&!n.configurable)}const i0=new WeakMap;function cd(t,e,n,o,r=!1){if(lt(t)){t.forEach((b,g)=>cd(b,e&&(lt(e)?e[g]:e),n,o,r));return}if(kc(o)&&!r){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&cd(t,e,n,o.component.subTree);return}const i=o.shapeFlag&4?jp(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=Lt(d),h=d===Wt?NS:b=>Bx(u,b)?!1:Xt(f,b),m=(b,g)=>!(g&&Bx(u,g));if(c!=null&&c!==l){if(Lx(e),mn(c))u[c]=null,h(c)&&(d[c]=null);else if(Ke(c)){const b=e;m(c,b.k)&&(c.value=null),b.k&&(u[b.k]=null)}}if(vt(l))hf(l,a,12,[s,u]);else{const b=mn(l),g=Ke(l);if(b||g){const v=()=>{if(t.f){const y=b?h(l)?d[l]:u[l]:m()||!t.k?l.value:u[t.k];if(r)lt(y)&&Db(y,i);else if(lt(y))y.includes(i)||y.push(i);else if(b)u[l]=[i],h(l)&&(d[l]=u[l]);else{const x=[i];m(l,t.k)&&(l.value=x),t.k&&(u[t.k]=x)}}else b?(u[l]=s,h(l)&&(d[l]=s)):g&&(m(l,t.k)&&(l.value=s),t.k&&(u[t.k]=s))};if(s){const y=()=>{v(),i0.delete(t)};y.id=-1,i0.set(t,y),po(y,n)}else Lx(t),v()}}}function Lx(t){const e=i0.get(t);e&&(e.flags|=8,i0.delete(t))}Op().requestIdleCallback;Op().cancelIdleCallback;const kc=t=>!!t.type.__asyncLoader,Hp=t=>t.type.__isKeepAlive;function zb(t,e){Lk(t,"a",e)}function Bk(t,e){Lk(t,"da",e)}function Lk(t,e,n=wo){const o=t.__wdc||(t.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return t()});if(Wp(e,o,n),n){let r=n.parent;for(;r&&r.parent;)Hp(r.parent.vnode)&&r9(o,e,n,r),r=r.parent}}function r9(t,e,n,o){const r=Wp(e,t,o,!0);zs(()=>{Db(o[e],r)},n)}function Wp(t,e,n=wo,o=!1){if(n){const r=n[t]||(n[t]=[]),i=e.__weh||(e.__weh=(...s)=>{Bs();const a=pf(n),l=hi(e,n,t,s);return a(),Ls(),l});return o?r.unshift(i):r.push(i),i}}const Vs=t=>(e,n=wo)=>{(!Pd||t==="sp")&&Wp(t,(...o)=>e(...o),n)},i9=Vs("bm"),fn=Vs("m"),Pk=Vs("bu"),s9=Vs("u"),Ds=Vs("bum"),zs=Vs("um"),a9=Vs("sp"),l9=Vs("rtg"),c9=Vs("rtc");function u9(t,e=wo){Wp("ec",t,e)}const Dk="components";function Up(t,e){return Ik(Dk,t,!0,e)||t}const Ek=Symbol.for("v-ndc");function on(t){return mn(t)?Ik(Dk,t,!1)||t:t||Ek}function Ik(t,e,n=!0,o=!1){const r=oo||wo;if(r){const i=r.type;{const a=G9(i,!1);if(a&&(a===e||a===Sr(e)||a===Tp(Sr(e))))return i}const s=Px(r[t]||i[t],e)||Px(r.appContext[t],e);return!s&&o?i:s}}function Px(t,e){return t&&(t[e]||t[Sr(e)]||t[Tp(Sr(e))])}function gt(t,e,n,o){let r;const i=n,s=lt(t);if(s||mn(t)){const a=s&&Ui(t);let l=!1,c=!1;a&&(l=!yr(t),c=Ps(t),t=Pp(t)),r=new Array(t.length);for(let u=0,d=t.length;u<d;u++)r[u]=e(l?c?Ic(fi(t[u])):fi(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(qt(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 xr(t,e){for(let n=0;n<e.length;n++){const o=e[n];if(lt(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 Se(t,e,n={},o,r){if(oo.ce||oo.parent&&kc(oo.parent)&&oo.parent.ce){const c=Object.keys(n).length>0;return e!=="default"&&(n.name=e),w(),K(Ne,null,[H("slot",n,o&&o())],c?-2:64)}let i=t[e];i&&i._c&&(i._d=!1),w();const s=i&&Rk(i(n)),a=n.key||s&&s.key,l=K(Ne,{key:(a&&!di(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 Rk(t){return t.some(e=>Ld(e)?!(e.type===xo||e.type===Ne&&!Rk(e.children)):!0)?t:null}const Uv=t=>t?r3(t)?jp(t):Uv(t.parent):null,ud=In(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=>Uv(t.parent),$root:t=>Uv(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>Vk(t),$forceUpdate:t=>t.f||(t.f=()=>{Fb(t.update)}),$nextTick:t=>t.n||(t.n=_n.bind(t.proxy)),$watch:t=>JB.bind(t)}),yg=(t,e)=>t!==Wt&&!t.__isScriptSetup&&Xt(t,e),d9={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(yg(o,e))return s[e]=1,o[e];if(r!==Wt&&Xt(r,e))return s[e]=2,r[e];if(Xt(i,e))return s[e]=3,i[e];if(n!==Wt&&Xt(n,e))return s[e]=4,n[e];Gv&&(s[e]=0)}}const c=ud[e];let u,d;if(c)return e==="$attrs"&&bo(t.attrs,"get",""),c(t);if((u=a.__cssModules)&&(u=u[e]))return u;if(n!==Wt&&Xt(n,e))return s[e]=4,n[e];if(d=l.config.globalProperties,Xt(d,e))return d[e]},set({_:t},e,n){const{data:o,setupState:r,ctx:i}=t;return yg(r,e)?(r[e]=n,!0):o!==Wt&&Xt(o,e)?(o[e]=n,!0):Xt(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]!=="$"&&Xt(t,a)||yg(e,a)||Xt(i,a)||Xt(o,a)||Xt(ud,a)||Xt(r.config.globalProperties,a)||(l=s.__cssModules)&&l[a])},defineProperty(t,e,n){return n.get!=null?t._.accessCache[e]=0:Xt(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}};function ts(){return Nk().slots}function Gp(){return Nk().attrs}function Nk(t){const e=Oo();return e.setupContext||(e.setupContext=s3(e))}function s0(t){return lt(t)?t.reduce((e,n)=>(e[n]=null,e),{}):t}function rt(t,e){return!t||!e?t||e:lt(t)&<(e)?t.concat(e):In({},s0(t),s0(e))}let Gv=!0;function f9(t){const e=Vk(t),n=t.proxy,o=t.ctx;Gv=!1,e.beforeCreate&&Dx(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:m,activated:b,deactivated:g,beforeDestroy:v,beforeUnmount:y,destroyed:x,unmounted:_,render:C,renderTracked:L,renderTriggered:O,errorCaptured:$,serverPrefetch:M,expose:D,inheritAttrs:N,components:k,directives:A,filters:B}=e;if(c&&h9(c,o,null),s)for(const z in s){const V=s[z];vt(V)&&(o[z]=V.bind(n))}if(r){const z=r.call(n,n);qt(z)&&(t.data=sr(z))}if(Gv=!0,i)for(const z in i){const V=i[z],G=vt(V)?V.bind(n,n):vt(V.get)?V.get.bind(n,n):ai,ie=!vt(V)&&vt(V.set)?V.set.bind(n):ai,ce=S({get:G,set:ie});Object.defineProperty(o,z,{enumerable:!0,configurable:!0,get:()=>ce.value,set:he=>ce.value=he})}if(a)for(const z in a)Fk(a[z],o,n,z);if(l){const z=vt(l)?l.call(n):l;Reflect.ownKeys(z).forEach(V=>{Gi(V,z[V])})}u&&Dx(u,t,"c");function F(z,V){lt(V)?V.forEach(G=>z(G.bind(n))):V&&z(V.bind(n))}if(F(i9,d),F(fn,f),F(Pk,h),F(s9,m),F(zb,b),F(Bk,g),F(u9,$),F(c9,L),F(l9,O),F(Ds,y),F(zs,_),F(a9,M),lt(D))if(D.length){const z=t.exposed||(t.exposed={});D.forEach(V=>{Object.defineProperty(z,V,{get:()=>n[V],set:G=>n[V]=G,enumerable:!0})})}else t.exposed||(t.exposed={});C&&t.render===ai&&(t.render=C),N!=null&&(t.inheritAttrs=N),k&&(t.components=k),A&&(t.directives=A),M&&Ok(t)}function h9(t,e,n=ai){lt(t)&&(t=qv(t));for(const o in t){const r=t[o];let i;qt(r)?"default"in r?i=Jt(r.from||o,r.default,!0):i=Jt(r.from||o):i=Jt(r),Ke(i)?Object.defineProperty(e,o,{enumerable:!0,configurable:!0,get:()=>i.value,set:s=>i.value=s}):e[o]=i}}function Dx(t,e,n){hi(lt(t)?t.map(o=>o.bind(e.proxy)):t.bind(e.proxy),e,n)}function Fk(t,e,n,o){let r=o.includes(".")?xk(n,o):()=>n[o];if(mn(t)){const i=e[t];vt(i)&&He(r,i)}else if(vt(t))He(r,t.bind(n));else if(qt(t))if(lt(t))t.forEach(i=>Fk(i,e,n,o));else{const i=vt(t.handler)?t.handler.bind(n):e[t.handler];vt(i)&&He(r,i,t)}}function Vk(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=>a0(l,c,s,!0)),a0(l,e,s)),qt(e)&&i.set(e,l),l}function a0(t,e,n,o=!1){const{mixins:r,extends:i}=e;i&&a0(t,i,n,!0),r&&r.forEach(s=>a0(t,s,n,!0));for(const s in e)if(!(o&&s==="expose")){const a=p9[s]||n&&n[s];t[s]=a?a(t[s],e[s]):e[s]}return t}const p9={data:Ex,props:Ix,emits:Ix,methods:ju,computed:ju,beforeCreate:Ro,created:Ro,beforeMount:Ro,mounted:Ro,beforeUpdate:Ro,updated:Ro,beforeDestroy:Ro,beforeUnmount:Ro,destroyed:Ro,unmounted:Ro,activated:Ro,deactivated:Ro,errorCaptured:Ro,serverPrefetch:Ro,components:ju,directives:ju,watch:g9,provide:Ex,inject:m9};function Ex(t,e){return e?t?function(){return In(vt(t)?t.call(this,this):t,vt(e)?e.call(this,this):e)}:e:t}function m9(t,e){return ju(qv(t),qv(e))}function qv(t){if(lt(t)){const e={};for(let n=0;n<t.length;n++)e[t[n]]=t[n];return e}return t}function Ro(t,e){return t?[...new Set([].concat(t,e))]:e}function ju(t,e){return t?In(Object.create(null),t,e):e}function Ix(t,e){return t?lt(t)&<(e)?[...new Set([...t,...e])]:In(Object.create(null),s0(t),s0(e??{})):e}function g9(t,e){if(!t)return e;if(!e)return t;const n=In(Object.create(null),t);for(const o in e)n[o]=Ro(t[o],e[o]);return n}function zk(){return{app:null,config:{isNativeTag:NS,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 v9=0;function b9(t,e){return function(o,r=null){vt(o)||(o=In({},o)),r!=null&&!qt(r)&&(r=null);const i=zk(),s=new WeakSet,a=[];let l=!1;const c=i.app={_uid:v9++,_component:o,_props:r,_container:null,_context:i,_instance:null,version:Y9,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,jp(h.component)}},onUnmount(u){a.push(u)},unmount(){l&&(hi(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=gl;gl=c;try{return u()}finally{gl=d}}};return c}}let gl=null;function ht(t,e,n=Wt){const o=Oo(),r=Sr(e),i=Fs(e),s=Hk(t,r),a=fk((l,c)=>{let u,d=Wt,f;return QB(()=>{const h=t[r];Qo(u,h)&&(u=h,c())}),{get(){return l(),n.get?n.get(u):u},set(h){const m=n.set?n.set(h):h;if(!Qo(m,u)&&!(d!==Wt&&Qo(h,d)))return;const b=o.vnode.props;b&&(e in b||r in b||i in b)&&(`onUpdate:${e}`in b||`onUpdate:${r}`in b||`onUpdate:${i}`in b)||(u=h,c()),o.emit(`update:${e}`,m),Qo(h,m)&&Qo(h,d)&&!Qo(m,f)&&c(),d=h,f=m}}});return a[Symbol.iterator]=()=>{let l=0;return{next(){return l<2?{value:l++?s||Wt:a,done:!1}:{done:!0}}}},a}const Hk=(t,e)=>e==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${Sr(e)}Modifiers`]||t[`${Fs(e)}Modifiers`];function y9(t,e,...n){if(t.isUnmounted)return;const o=t.vnode.props||Wt;let r=n;const i=e.startsWith("update:"),s=i&&Hk(o,e.slice(7));s&&(s.trim&&(r=n.map(u=>mn(u)?u.trim():u)),s.number&&(r=n.map(Mp)));let a,l=o[a=hg(e)]||o[a=hg(Sr(e))];!l&&i&&(l=o[a=hg(Fs(e))]),l&&hi(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,hi(c,t,6,r)}}const x9=new WeakMap;function Wk(t,e,n=!1){const o=n?x9: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=Wk(c,e,!0);u&&(a=!0,In(s,u))};!n&&e.mixins.length&&e.mixins.forEach(l),t.extends&&l(t.extends),t.mixins&&t.mixins.forEach(l)}return!i&&!a?(qt(t)&&o.set(t,null),null):(lt(i)?i.forEach(l=>s[l]=null):In(s,i),qt(t)&&o.set(t,s),s)}function qp(t,e){return!t||!Cp(e)?!1:(e=e.slice(2).replace(/Once$/,""),Xt(t,e[0].toLowerCase()+e.slice(1))||Xt(t,Fs(e))||Xt(t,e))}function Rx(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:m,inheritAttrs:b}=t,g=r0(t);let v,y;try{if(n.shapeFlag&4){const _=r||o,C=_;v=Ri(c.call(C,_,u,d,h,f,m)),y=a}else{const _=e;v=Ri(_.length>1?_(d,{attrs:a,slots:s,emit:l}):_(d,null)),y=e.props?a:w9(a)}}catch(_){fd.length=0,Np(_,t,1),v=H(xo)}let x=v;if(y&&b!==!1){const _=Object.keys(y),{shapeFlag:C}=x;_.length&&C&7&&(i&&_.some(Pb)&&(y=_9(y,i)),x=xa(x,y,!1,!0))}return n.dirs&&(x=xa(x,null,!1,!0),x.dirs=x.dirs?x.dirs.concat(n.dirs):n.dirs),n.transition&&Od(x,n.transition),v=x,r0(g),v}const w9=t=>{let e;for(const n in t)(n==="class"||n==="style"||Cp(n))&&((e||(e={}))[n]=t[n]);return e},_9=(t,e)=>{const n={};for(const o in t)(!Pb(o)||!(o.slice(9)in e))&&(n[o]=t[o]);return n};function S9(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?Nx(o,s,c):!!s;if(l&8){const u=e.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(Uk(s,o,f)&&!qp(c,f))return!0}}}else return(r||a)&&(!a||!a.$stable)?!0:o===s?!1:o?s?Nx(o,s,c):!0:!!s;return!1}function Nx(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(Uk(e,t,i)&&!qp(n,i))return!0}return!1}function Uk(t,e,n){const o=t[n],r=e[n];return n==="style"&&qt(o)&&qt(r)?!ba(o,r):o!==r}function k9({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 Gk={},qk=()=>Object.create(Gk),Yk=t=>Object.getPrototypeOf(t)===Gk;function C9(t,e,n,o=!1){const r={},i=qk();t.propsDefaults=Object.create(null),jk(t,e,r,i);for(const s in t.propsOptions[0])s in r||(r[s]=void 0);n?t.props=o?r:ck(r):t.type.props?t.props=r:t.props=i,t.attrs=i}function A9(t,e,n,o){const{props:r,attrs:i,vnode:{patchFlag:s}}=t,a=Lt(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(qp(t.emitsOptions,f))continue;const h=e[f];if(l)if(Xt(i,f))h!==i[f]&&(i[f]=h,c=!0);else{const m=Sr(f);r[m]=Yv(l,a,m,h,t,!1)}else h!==i[f]&&(i[f]=h,c=!0)}}}else{jk(t,e,r,i)&&(c=!0);let u;for(const d in a)(!e||!Xt(e,d)&&((u=Fs(d))===d||!Xt(e,u)))&&(l?n&&(n[d]!==void 0||n[u]!==void 0)&&(r[d]=Yv(l,a,d,void 0,t,!0)):delete r[d]);if(i!==a)for(const d in i)(!e||!Xt(e,d))&&(delete i[d],c=!0)}c&&ys(t.attrs,"set","")}function jk(t,e,n,o){const[r,i]=t.propsOptions;let s=!1,a;if(e)for(let l in e){if(id(l))continue;const c=e[l];let u;r&&Xt(r,u=Sr(l))?!i||!i.includes(u)?n[u]=c:(a||(a={}))[u]=c:qp(t.emitsOptions,l)||(!(l in o)||c!==o[l])&&(o[l]=c,s=!0)}if(i){const l=Lt(n),c=a||Wt;for(let u=0;u<i.length;u++){const d=i[u];n[d]=Yv(r,l,d,c[d],t,!Xt(c,d))}}return s}function Yv(t,e,n,o,r,i){const s=t[n];if(s!=null){const a=Xt(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=pf(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===Fs(n))&&(o=!0))}return o}const $9=new WeakMap;function Xk(t,e,n=!1){const o=n?$9: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]=Xk(d,e,!0);In(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 qt(t)&&o.set(t,wc),wc;if(lt(i))for(let u=0;u<i.length;u++){const d=Sr(i[u]);Fx(d)&&(s[d]=Wt)}else if(i)for(const u in i){const d=Sr(u);if(Fx(d)){const f=i[u],h=s[d]=lt(f)||vt(f)?{type:f}:In({},f),m=h.type;let b=!1,g=!0;if(lt(m))for(let v=0;v<m.length;++v){const y=m[v],x=vt(y)&&y.name;if(x==="Boolean"){b=!0;break}else x==="String"&&(g=!1)}else b=vt(m)&&m.name==="Boolean";h[0]=b,h[1]=g,(b||Xt(h,"default"))&&a.push(d)}}const c=[s,a];return qt(t)&&o.set(t,c),c}function Fx(t){return t[0]!=="$"&&!id(t)}const Hb=t=>t==="_"||t==="_ctx"||t==="$stable",Wb=t=>lt(t)?t.map(Ri):[Ri(t)],T9=(t,e,n)=>{if(e._n)return e;const o=Q((...r)=>Wb(e(...r)),n);return o._c=!1,o},Kk=(t,e,n)=>{const o=t._ctx;for(const r in t){if(Hb(r))continue;const i=t[r];if(vt(i))e[r]=T9(r,i,o);else if(i!=null){const s=Wb(i);e[r]=()=>s}}},Zk=(t,e)=>{const n=Wb(e);t.slots.default=()=>n},Qk=(t,e,n)=>{for(const o in e)(n||!Hb(o))&&(t[o]=e[o])},M9=(t,e,n)=>{const o=t.slots=qk();if(t.vnode.shapeFlag&32){const r=e._;r?(Qk(o,e,n),n&&HS(o,"_",r,!0)):Kk(e,o)}else e&&Zk(t,e)},O9=(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:Qk(r,e,n):(i=!e.$stable,Kk(e,r)),s=e}else e&&(Zk(t,e),s={default:1});if(i)for(const a in r)!Hb(a)&&s[a]==null&&delete r[a]},po=E9;function B9(t){return L9(t)}function L9(t,e){const n=Op();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=ai,insertStaticContent:m}=t,b=(I,W,j,ue=null,de=null,fe=null,pe=void 0,J=null,X=!!W.dynamicChildren)=>{if(I===W)return;I&&!ll(I,W)&&(ue=U(I),he(I,de,fe,!0),I=null),W.patchFlag===-2&&(X=!1,W.dynamicChildren=null);const{type:ee,ref:we,shapeFlag:ge}=W;switch(ee){case Yp:g(I,W,j,ue);break;case xo:v(I,W,j,ue);break;case dd:I==null&&y(W,j,ue,pe);break;case Ne:k(I,W,j,ue,de,fe,pe,J,X);break;default:ge&1?C(I,W,j,ue,de,fe,pe,J,X):ge&6?A(I,W,j,ue,de,fe,pe,J,X):(ge&64||ge&128)&&ee.process(I,W,j,ue,de,fe,pe,J,X,ve)}we!=null&&de?cd(we,I&&I.ref,fe,W||I,!W):we==null&&I&&I.ref!=null&&cd(I.ref,null,fe,I,!0)},g=(I,W,j,ue)=>{if(I==null)o(W.el=a(W.children),j,ue);else{const de=W.el=I.el;W.children!==I.children&&c(de,W.children)}},v=(I,W,j,ue)=>{I==null?o(W.el=l(W.children||""),j,ue):W.el=I.el},y=(I,W,j,ue)=>{[I.el,I.anchor]=m(I.children,W,j,ue,I.el,I.anchor)},x=({el:I,anchor:W},j,ue)=>{let de;for(;I&&I!==W;)de=f(I),o(I,j,ue),I=de;o(W,j,ue)},_=({el:I,anchor:W})=>{let j;for(;I&&I!==W;)j=f(I),r(I),I=j;r(W)},C=(I,W,j,ue,de,fe,pe,J,X)=>{if(W.type==="svg"?pe="svg":W.type==="math"&&(pe="mathml"),I==null)L(W,j,ue,de,fe,pe,J,X);else{const ee=I.el&&I.el._isVueCE?I.el:null;try{ee&&ee._beginPatch(),M(I,W,de,fe,pe,J,X)}finally{ee&&ee._endPatch()}}},L=(I,W,j,ue,de,fe,pe,J)=>{let X,ee;const{props:we,shapeFlag:ge,transition:be,dirs:ye}=I;if(X=I.el=s(I.type,fe,we&&we.is,we),ge&8?u(X,I.children):ge&16&&$(I.children,X,null,ue,de,xg(I,fe),pe,J),ye&&ja(I,null,ue,"created"),O(X,I,I.scopeId,pe,ue),we){for(const ke in we)ke!=="value"&&!id(ke)&&i(X,ke,null,we[ke],fe,ue);"value"in we&&i(X,"value",null,we.value,fe),(ee=we.onVnodeBeforeMount)&&Mi(ee,ue,I)}ye&&ja(I,null,ue,"beforeMount");const Oe=P9(de,be);Oe&&be.beforeEnter(X),o(X,W,j),((ee=we&&we.onVnodeMounted)||Oe||ye)&&po(()=>{ee&&Mi(ee,ue,I),Oe&&be.enter(X),ye&&ja(I,null,ue,"mounted")},de)},O=(I,W,j,ue,de)=>{if(j&&h(I,j),ue)for(let fe=0;fe<ue.length;fe++)h(I,ue[fe]);if(de){let fe=de.subTree;if(W===fe||t3(fe.type)&&(fe.ssContent===W||fe.ssFallback===W)){const pe=de.vnode;O(I,pe,pe.scopeId,pe.slotScopeIds,de.parent)}}},$=(I,W,j,ue,de,fe,pe,J,X=0)=>{for(let ee=X;ee<I.length;ee++){const we=I[ee]=J?ms(I[ee]):Ri(I[ee]);b(null,we,W,j,ue,de,fe,pe,J)}},M=(I,W,j,ue,de,fe,pe)=>{const J=W.el=I.el;let{patchFlag:X,dynamicChildren:ee,dirs:we}=W;X|=I.patchFlag&16;const ge=I.props||Wt,be=W.props||Wt;let ye;if(j&&Xa(j,!1),(ye=be.onVnodeBeforeUpdate)&&Mi(ye,j,W,I),we&&ja(W,I,j,"beforeUpdate"),j&&Xa(j,!0),(ge.innerHTML&&be.innerHTML==null||ge.textContent&&be.textContent==null)&&u(J,""),ee?D(I.dynamicChildren,ee,J,j,ue,xg(W,de),fe):pe||V(I,W,J,null,j,ue,xg(W,de),fe,!1),X>0){if(X&16)N(J,ge,be,j,de);else if(X&2&&ge.class!==be.class&&i(J,"class",null,be.class,de),X&4&&i(J,"style",ge.style,be.style,de),X&8){const Oe=W.dynamicProps;for(let ke=0;ke<Oe.length;ke++){const Ae=Oe[ke],je=ge[Ae],tt=be[Ae];(tt!==je||Ae==="value")&&i(J,Ae,je,tt,de,j)}}X&1&&I.children!==W.children&&u(J,W.children)}else!pe&&ee==null&&N(J,ge,be,j,de);((ye=be.onVnodeUpdated)||we)&&po(()=>{ye&&Mi(ye,j,W,I),we&&ja(W,I,j,"updated")},ue)},D=(I,W,j,ue,de,fe,pe)=>{for(let J=0;J<W.length;J++){const X=I[J],ee=W[J],we=X.el&&(X.type===Ne||!ll(X,ee)||X.shapeFlag&198)?d(X.el):j;b(X,ee,we,null,ue,de,fe,pe,!0)}},N=(I,W,j,ue,de)=>{if(W!==j){if(W!==Wt)for(const fe in W)!id(fe)&&!(fe in j)&&i(I,fe,W[fe],null,de,ue);for(const fe in j){if(id(fe))continue;const pe=j[fe],J=W[fe];pe!==J&&fe!=="value"&&i(I,fe,J,pe,de,ue)}"value"in j&&i(I,"value",W.value,j.value,de)}},k=(I,W,j,ue,de,fe,pe,J,X)=>{const ee=W.el=I?I.el:a(""),we=W.anchor=I?I.anchor:a("");let{patchFlag:ge,dynamicChildren:be,slotScopeIds:ye}=W;ye&&(J=J?J.concat(ye):ye),I==null?(o(ee,j,ue),o(we,j,ue),$(W.children||[],j,we,de,fe,pe,J,X)):ge>0&&ge&64&&be&&I.dynamicChildren&&I.dynamicChildren.length===be.length?(D(I.dynamicChildren,be,j,de,fe,pe,J),(W.key!=null||de&&W===de.subTree)&&Ub(I,W,!0)):V(I,W,j,we,de,fe,pe,J,X)},A=(I,W,j,ue,de,fe,pe,J,X)=>{W.slotScopeIds=J,I==null?W.shapeFlag&512?de.ctx.activate(W,j,ue,pe,X):B(W,j,ue,de,fe,pe,X):P(I,W,X)},B=(I,W,j,ue,de,fe,pe)=>{const J=I.component=z9(I,ue,de);if(Hp(I)&&(J.ctx.renderer=ve),H9(J,!1,pe),J.asyncDep){if(de&&de.registerDep(J,F,pe),!I.el){const X=J.subTree=H(xo);v(null,X,W,j),I.placeholder=X.el}}else F(J,I,W,j,de,fe,pe)},P=(I,W,j)=>{const ue=W.component=I.component;if(S9(I,W,j))if(ue.asyncDep&&!ue.asyncResolved){z(ue,W,j);return}else ue.next=W,ue.update();else W.el=I.el,ue.vnode=W},F=(I,W,j,ue,de,fe,pe)=>{const J=()=>{if(I.isMounted){let{next:ge,bu:be,u:ye,parent:Oe,vnode:ke}=I;{const $t=Jk(I);if($t){ge&&(ge.el=ke.el,z(I,ge,pe)),$t.asyncDep.then(()=>{po(()=>{I.isUnmounted||ee()},de)});return}}let Ae=ge,je;Xa(I,!1),ge?(ge.el=ke.el,z(I,ge,pe)):ge=ke,be&&Ph(be),(je=ge.props&&ge.props.onVnodeBeforeUpdate)&&Mi(je,Oe,ge,ke),Xa(I,!0);const tt=Rx(I),mt=I.subTree;I.subTree=tt,b(mt,tt,d(mt.el),U(mt),I,de,fe),ge.el=tt.el,Ae===null&&k9(I,tt.el),ye&&po(ye,de),(je=ge.props&&ge.props.onVnodeUpdated)&&po(()=>Mi(je,Oe,ge,ke),de)}else{let ge;const{el:be,props:ye}=W,{bm:Oe,m:ke,parent:Ae,root:je,type:tt}=I,mt=kc(W);Xa(I,!1),Oe&&Ph(Oe),!mt&&(ge=ye&&ye.onVnodeBeforeMount)&&Mi(ge,Ae,W),Xa(I,!0);{je.ce&&je.ce._hasShadowRoot()&&je.ce._injectChildStyle(tt);const $t=I.subTree=Rx(I);b(null,$t,j,ue,I,de,fe),W.el=$t.el}if(ke&&po(ke,de),!mt&&(ge=ye&&ye.onVnodeMounted)){const $t=W;po(()=>Mi(ge,Ae,$t),de)}(W.shapeFlag&256||Ae&&kc(Ae.vnode)&&Ae.vnode.shapeFlag&256)&&I.a&&po(I.a,de),I.isMounted=!0,W=j=ue=null}};I.scope.on();const X=I.effect=new YS(J);I.scope.off();const ee=I.update=X.run.bind(X),we=I.job=X.runIfDirty.bind(X);we.i=I,we.id=I.uid,X.scheduler=()=>Fb(we),Xa(I,!0),ee()},z=(I,W,j)=>{W.component=I;const ue=I.vnode.props;I.vnode=W,I.next=null,A9(I,W.props,ue,j),O9(I,W.children,j),Bs(),Ax(I),Ls()},V=(I,W,j,ue,de,fe,pe,J,X=!1)=>{const ee=I&&I.children,we=I?I.shapeFlag:0,ge=W.children,{patchFlag:be,shapeFlag:ye}=W;if(be>0){if(be&128){ie(ee,ge,j,ue,de,fe,pe,J,X);return}else if(be&256){G(ee,ge,j,ue,de,fe,pe,J,X);return}}ye&8?(we&16&&re(ee,de,fe),ge!==ee&&u(j,ge)):we&16?ye&16?ie(ee,ge,j,ue,de,fe,pe,J,X):re(ee,de,fe,!0):(we&8&&u(j,""),ye&16&&$(ge,j,ue,de,fe,pe,J,X))},G=(I,W,j,ue,de,fe,pe,J,X)=>{I=I||wc,W=W||wc;const ee=I.length,we=W.length,ge=Math.min(ee,we);let be;for(be=0;be<ge;be++){const ye=W[be]=X?ms(W[be]):Ri(W[be]);b(I[be],ye,j,null,de,fe,pe,J,X)}ee>we?re(I,de,fe,!0,!1,ge):$(W,j,ue,de,fe,pe,J,X,ge)},ie=(I,W,j,ue,de,fe,pe,J,X)=>{let ee=0;const we=W.length;let ge=I.length-1,be=we-1;for(;ee<=ge&&ee<=be;){const ye=I[ee],Oe=W[ee]=X?ms(W[ee]):Ri(W[ee]);if(ll(ye,Oe))b(ye,Oe,j,null,de,fe,pe,J,X);else break;ee++}for(;ee<=ge&&ee<=be;){const ye=I[ge],Oe=W[be]=X?ms(W[be]):Ri(W[be]);if(ll(ye,Oe))b(ye,Oe,j,null,de,fe,pe,J,X);else break;ge--,be--}if(ee>ge){if(ee<=be){const ye=be+1,Oe=ye<we?W[ye].el:ue;for(;ee<=be;)b(null,W[ee]=X?ms(W[ee]):Ri(W[ee]),j,Oe,de,fe,pe,J,X),ee++}}else if(ee>be)for(;ee<=ge;)he(I[ee],de,fe,!0),ee++;else{const ye=ee,Oe=ee,ke=new Map;for(ee=Oe;ee<=be;ee++){const Tt=W[ee]=X?ms(W[ee]):Ri(W[ee]);Tt.key!=null&&ke.set(Tt.key,ee)}let Ae,je=0;const tt=be-Oe+1;let mt=!1,$t=0;const Vt=new Array(tt);for(ee=0;ee<tt;ee++)Vt[ee]=0;for(ee=ye;ee<=ge;ee++){const Tt=I[ee];if(je>=tt){he(Tt,de,fe,!0);continue}let Rt;if(Tt.key!=null)Rt=ke.get(Tt.key);else for(Ae=Oe;Ae<=be;Ae++)if(Vt[Ae-Oe]===0&&ll(Tt,W[Ae])){Rt=Ae;break}Rt===void 0?he(Tt,de,fe,!0):(Vt[Rt-Oe]=ee+1,Rt>=$t?$t=Rt:mt=!0,b(Tt,W[Rt],j,null,de,fe,pe,J,X),je++)}const cn=mt?D9(Vt):wc;for(Ae=cn.length-1,ee=tt-1;ee>=0;ee--){const Tt=Oe+ee,Rt=W[Tt],en=W[Tt+1],kn=Tt+1<we?en.el||e3(en):ue;Vt[ee]===0?b(null,Rt,j,kn,de,fe,pe,J,X):mt&&(Ae<0||ee!==cn[Ae]?ce(Rt,j,kn,2):Ae--)}}},ce=(I,W,j,ue,de=null)=>{const{el:fe,type:pe,transition:J,children:X,shapeFlag:ee}=I;if(ee&6){ce(I.component.subTree,W,j,ue);return}if(ee&128){I.suspense.move(W,j,ue);return}if(ee&64){pe.move(I,W,j,ve);return}if(pe===Ne){o(fe,W,j);for(let ge=0;ge<X.length;ge++)ce(X[ge],W,j,ue);o(I.anchor,W,j);return}if(pe===dd){x(I,W,j);return}if(ue!==2&&ee&1&&J)if(ue===0)J.beforeEnter(fe),o(fe,W,j),po(()=>J.enter(fe),de);else{const{leave:ge,delayLeave:be,afterLeave:ye}=J,Oe=()=>{I.ctx.isUnmounted?r(fe):o(fe,W,j)},ke=()=>{fe._isLeaving&&fe[Ii](!0),ge(fe,()=>{Oe(),ye&&ye()})};be?be(fe,Oe,ke):ke()}else o(fe,W,j)},he=(I,W,j,ue=!1,de=!1)=>{const{type:fe,props:pe,ref:J,children:X,dynamicChildren:ee,shapeFlag:we,patchFlag:ge,dirs:be,cacheIndex:ye}=I;if(ge===-2&&(de=!1),J!=null&&(Bs(),cd(J,null,j,I,!0),Ls()),ye!=null&&(W.renderCache[ye]=void 0),we&256){W.ctx.deactivate(I);return}const Oe=we&1&&be,ke=!kc(I);let Ae;if(ke&&(Ae=pe&&pe.onVnodeBeforeUnmount)&&Mi(Ae,W,I),we&6)se(I.component,j,ue);else{if(we&128){I.suspense.unmount(j,ue);return}Oe&&ja(I,null,W,"beforeUnmount"),we&64?I.type.remove(I,W,j,ve,ue):ee&&!ee.hasOnce&&(fe!==Ne||ge>0&&ge&64)?re(ee,W,j,!1,!0):(fe===Ne&&ge&384||!de&&we&16)&&re(X,W,j),ue&&Z(I)}(ke&&(Ae=pe&&pe.onVnodeUnmounted)||Oe)&&po(()=>{Ae&&Mi(Ae,W,I),Oe&&ja(I,null,W,"unmounted")},j)},Z=I=>{const{type:W,el:j,anchor:ue,transition:de}=I;if(W===Ne){oe(j,ue);return}if(W===dd){_(I);return}const fe=()=>{r(j),de&&!de.persisted&&de.afterLeave&&de.afterLeave()};if(I.shapeFlag&1&&de&&!de.persisted){const{leave:pe,delayLeave:J}=de,X=()=>pe(j,fe);J?J(I.el,fe,X):X()}else fe()},oe=(I,W)=>{let j;for(;I!==W;)j=f(I),r(I),I=j;r(W)},se=(I,W,j)=>{const{bum:ue,scope:de,job:fe,subTree:pe,um:J,m:X,a:ee}=I;Vx(X),Vx(ee),ue&&Ph(ue),de.stop(),fe&&(fe.flags|=8,he(pe,I,W,j)),J&&po(J,W),po(()=>{I.isUnmounted=!0},W)},re=(I,W,j,ue=!1,de=!1,fe=0)=>{for(let pe=fe;pe<I.length;pe++)he(I[pe],W,j,ue,de)},U=I=>{if(I.shapeFlag&6)return U(I.component.subTree);if(I.shapeFlag&128)return I.suspense.next();const W=f(I.anchor||I.el),j=W&&W[wk];return j?f(j):W};let te=!1;const ne=(I,W,j)=>{let ue;I==null?W._vnode&&(he(W._vnode,null,null,!0),ue=W._vnode.component):b(W._vnode||null,I,W,null,null,null,j),W._vnode=I,te||(te=!0,Ax(ue),vk(),te=!1)},ve={p:b,um:he,m:ce,r:Z,mt:B,mc:$,pc:V,pbc:D,n:U,o:t};return{render:ne,hydrate:void 0,createApp:b9(ne)}}function xg({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 Xa({effect:t,job:e},n){n?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function P9(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function Ub(t,e,n=!1){const o=t.children,r=e.children;if(lt(o)&<(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]=ms(r[i]),a.el=s.el),!n&&a.patchFlag!==-2&&Ub(s,a)),a.type===Yp&&(a.patchFlag===-1&&(a=r[i]=ms(a)),a.el=s.el),a.type===xo&&!a.el&&(a.el=s.el)}}function D9(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 Jk(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:Jk(e)}function Vx(t){if(t)for(let e=0;e<t.length;e++)t[e].flags|=8}function e3(t){if(t.placeholder)return t.placeholder;const e=t.component;return e?e3(e.subTree):null}const t3=t=>t.__isSuspense;function E9(t,e){e&&e.pendingBranch?lt(t)?e.effects.push(...t):e.effects.push(t):gk(t)}const Ne=Symbol.for("v-fgt"),Yp=Symbol.for("v-txt"),xo=Symbol.for("v-cmt"),dd=Symbol.for("v-stc"),fd=[];let vr=null;function w(t=!1){fd.push(vr=t?null:[])}function I9(){fd.pop(),vr=fd[fd.length-1]||null}let Bd=1;function l0(t,e=!1){Bd+=t,t<0&&vr&&e&&(vr.hasOnce=!0)}function n3(t){return t.dynamicChildren=Bd>0?vr||wc:null,I9(),Bd>0&&vr&&vr.push(t),t}function R(t,e,n,o,r,i){return n3(T(t,e,n,o,r,i,!0))}function K(t,e,n,o,r){return n3(H(t,e,n,o,r,!0))}function Ld(t){return t?t.__v_isVNode===!0:!1}function ll(t,e){return t.type===e.type&&t.key===e.key}const o3=({key:t})=>t??null,Eh=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?mn(t)||Ke(t)||vt(t)?{i:oo,r:t,k:e,f:!!n}:t:null);function T(t,e=null,n=null,o=0,r=null,i=t===Ne?0:1,s=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&o3(e),ref:e&&Eh(e),scopeId:yk,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:oo};return a?(Gb(l,n),i&128&&t.normalize(l)):n&&(l.shapeFlag|=mn(n)?8:16),Bd>0&&!s&&vr&&(l.patchFlag>0||i&6)&&l.patchFlag!==32&&vr.push(l),l}const H=R9;function R9(t,e=null,n=null,o=0,r=null,i=!1){if((!t||t===Ek)&&(t=xo),Ld(t)){const a=xa(t,e,!0);return n&&Gb(a,n),Bd>0&&!i&&vr&&(a.shapeFlag&6?vr[vr.indexOf(t)]=a:vr.push(a)),a.patchFlag=-2,a}if(q9(t)&&(t=t.__vccOpts),e){e=Jo(e);let{class:a,style:l}=e;a&&!mn(a)&&(e.class=Me(a)),qt(l)&&(Ip(l)&&!lt(l)&&(l=In({},l)),e.style=Ot(l))}const s=mn(t)?1:t3(t)?128:_k(t)?64:qt(t)?4:vt(t)?2:0;return T(t,e,n,o,r,s,i,!0)}function Jo(t){return t?Ip(t)||Yk(t)?In({},t):t:null}function xa(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&&o3(c),ref:e&&e.ref?n&&i?lt(i)?i.concat(Eh(e)):[i,Eh(e)]:Eh(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!==Ne?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&&xa(t.ssContent),ssFallback:t.ssFallback&&xa(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return l&&o&&Od(u,l.clone(u)),u}function Ge(t=" ",e=0){return H(Yp,null,t,e)}function N9(t,e){const n=H(dd,null,t);return n.staticCount=e,n}function ae(t="",e=!1){return e?(w(),K(xo,null,t)):H(xo,null,t)}function Ri(t){return t==null||typeof t=="boolean"?H(xo):lt(t)?H(Ne,null,t.slice()):Ld(t)?ms(t):H(Yp,null,String(t))}function ms(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:xa(t)}function Gb(t,e){let n=0;const{shapeFlag:o}=t;if(e==null)e=null;else if(lt(e))n=16;else if(typeof e=="object")if(o&65){const r=e.default;r&&(r._c&&(r._d=!1),Gb(t,r()),r._c&&(r._d=!0));return}else{n=32;const r=e._;!r&&!Yk(e)?e._ctx=oo:r===3&&oo&&(oo.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else vt(e)?(e={default:e,_ctx:oo},n=32):(e=String(e),o&64?(n=16,e=[Ge(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=Me([e.class,o.class]));else if(r==="style")e.style=Ot([e.style,o.style]);else if(Cp(r)){const i=e[r],s=o[r];s&&i!==s&&!(lt(i)&&i.includes(s))&&(e[r]=i?[].concat(i,s):s)}else r!==""&&(e[r]=o[r])}return e}function Mi(t,e,n,o=null){hi(t,e,7,[n,o])}const F9=zk();let V9=0;function z9(t,e,n){const o=t.type,r=(e?e.appContext:t.appContext)||F9,i={uid:V9++,vnode:t,type:o,parent:e,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new qS(!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:Xk(o,r),emitsOptions:Wk(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=y9.bind(null,i),t.ce&&t.ce(i),i}let wo=null;const Oo=()=>wo||oo;let c0,jv;{const t=Op(),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)}};c0=e("__VUE_INSTANCE_SETTERS__",n=>wo=n),jv=e("__VUE_SSR_SETTERS__",n=>Pd=n)}const pf=t=>{const e=wo;return c0(t),t.scope.on(),()=>{t.scope.off(),c0(e)}},zx=()=>{wo&&wo.scope.off(),c0(null)};function r3(t){return t.vnode.shapeFlag&4}let Pd=!1;function H9(t,e=!1,n=!1){e&&jv(e);const{props:o,children:r}=t.vnode,i=r3(t);C9(t,o,i,e),M9(t,r,n||e);const s=i?W9(t,e):void 0;return e&&jv(!1),s}function W9(t,e){const n=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,d9);const{setup:o}=n;if(o){Bs();const r=t.setupContext=o.length>1?s3(t):null,i=pf(t),s=hf(o,t,0,[t.props,r]),a=FS(s);if(Ls(),i(),(a||t.sp)&&!kc(t)&&Ok(t),a){if(s.then(zx,zx),e)return s.then(l=>{Hx(t,l)}).catch(l=>{Np(l,t,0)});t.asyncDep=s}else Hx(t,s)}else i3(t)}function Hx(t,e,n){vt(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:qt(e)&&(t.setupState=dk(e)),i3(t)}function i3(t,e,n){const o=t.type;t.render||(t.render=o.render||ai);{const r=pf(t);Bs();try{f9(t)}finally{Ls(),r()}}}const U9={get(t,e){return bo(t,"get",""),t[e]}};function s3(t){const e=n=>{t.exposed=n||{}};return{attrs:new Proxy(t.attrs,U9),slots:t.slots,emit:t.emit,expose:e}}function jp(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(dk($e(t.exposed)),{get(e,n){if(n in e)return e[n];if(n in ud)return ud[n](t)},has(e,n){return n in e||n in ud}})):t.proxy}function G9(t,e=!0){return vt(t)?t.displayName||t.name:t.name||e&&t.__name}function q9(t){return vt(t)&&"__vccOpts"in t}const S=(t,e)=>GB(t,e,Pd);function Nt(t,e,n){try{l0(-1);const o=arguments.length;return o===2?qt(e)&&!lt(e)?Ld(e)?H(t,null,[e]):H(t,e):H(t,null,e):(o>3?n=Array.prototype.slice.call(arguments,2):o===3&&Ld(n)&&(n=[n]),H(t,e,n))}finally{l0(1)}}const Y9="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 Xv;const Wx=typeof window<"u"&&window.trustedTypes;if(Wx)try{Xv=Wx.createPolicy("vue",{createHTML:t=>t})}catch{}const a3=Xv?t=>Xv.createHTML(t):t=>t,j9="http://www.w3.org/2000/svg",X9="http://www.w3.org/1998/Math/MathML",hs=typeof document<"u"?document:null,Ux=hs&&hs.createElement("template"),K9={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"?hs.createElementNS(j9,t):e==="mathml"?hs.createElementNS(X9,t):n?hs.createElement(t,{is:n}):hs.createElement(t);return t==="select"&&o&&o.multiple!=null&&r.setAttribute("multiple",o.multiple),r},createText:t=>hs.createTextNode(t),createComment:t=>hs.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>hs.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{Ux.innerHTML=a3(o==="svg"?`<svg>${t}</svg>`:o==="mathml"?`<math>${t}</math>`:t);const a=Ux.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]}},Qs="transition",Bu="animation",Dd=Symbol("_vtc"),l3={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},Z9=In({},kk,l3),Q9=t=>(t.displayName="Transition",t.props=Z9,t),_l=Q9((t,{slots:e})=>Nt(o9,J9(t),e)),Ka=(t,e=[])=>{lt(t)?t.forEach(n=>n(...e)):t&&t(...e)},Gx=t=>t?lt(t)?t.some(e=>e.length>1):t.length>1:!1;function J9(t){const e={};for(const k in t)k in l3||(e[k]=t[k]);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,m=eL(r),b=m&&m[0],g=m&&m[1],{onBeforeEnter:v,onEnter:y,onEnterCancelled:x,onLeave:_,onLeaveCancelled:C,onBeforeAppear:L=v,onAppear:O=y,onAppearCancelled:$=x}=e,M=(k,A,B,P)=>{k._enterCancelled=P,Za(k,A?u:a),Za(k,A?c:s),B&&B()},D=(k,A)=>{k._isLeaving=!1,Za(k,d),Za(k,h),Za(k,f),A&&A()},N=k=>(A,B)=>{const P=k?O:y,F=()=>M(A,k,B);Ka(P,[A,F]),qx(()=>{Za(A,k?l:i),ss(A,k?u:a),Gx(P)||Yx(A,o,b,F)})};return In(e,{onBeforeEnter(k){Ka(v,[k]),ss(k,i),ss(k,s)},onBeforeAppear(k){Ka(L,[k]),ss(k,l),ss(k,c)},onEnter:N(!1),onAppear:N(!0),onLeave(k,A){k._isLeaving=!0;const B=()=>D(k,A);ss(k,d),k._enterCancelled?(ss(k,f),Kx(k)):(Kx(k),ss(k,f)),qx(()=>{k._isLeaving&&(Za(k,d),ss(k,h),Gx(_)||Yx(k,o,g,B))}),Ka(_,[k,B])},onEnterCancelled(k){M(k,!1,void 0,!0),Ka(x,[k])},onAppearCancelled(k){M(k,!0,void 0,!0),Ka($,[k])},onLeaveCancelled(k){D(k),Ka(C,[k])}})}function eL(t){if(t==null)return null;if(qt(t))return[wg(t.enter),wg(t.leave)];{const e=wg(t);return[e,e]}}function wg(t){return dB(t)}function ss(t,e){e.split(/\s+/).forEach(n=>n&&t.classList.add(n)),(t[Dd]||(t[Dd]=new Set)).add(e)}function Za(t,e){e.split(/\s+/).forEach(o=>o&&t.classList.remove(o));const n=t[Dd];n&&(n.delete(e),n.size||(t[Dd]=void 0))}function qx(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let tL=0;function Yx(t,e,n,o){const r=t._endId=++tL,i=()=>{r===t._endId&&o()};if(n!=null)return setTimeout(i,n);const{type:s,timeout:a,propCount:l}=nL(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 nL(t,e){const n=window.getComputedStyle(t),o=m=>(n[m]||"").split(", "),r=o(`${Qs}Delay`),i=o(`${Qs}Duration`),s=jx(r,i),a=o(`${Bu}Delay`),l=o(`${Bu}Duration`),c=jx(a,l);let u=null,d=0,f=0;e===Qs?s>0&&(u=Qs,d=s,f=i.length):e===Bu?c>0&&(u=Bu,d=c,f=l.length):(d=Math.max(s,c),u=d>0?s>c?Qs:Bu:null,f=u?u===Qs?i.length:l.length:0);const h=u===Qs&&/\b(?:transform|all)(?:,|$)/.test(o(`${Qs}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:h}}function jx(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max(...e.map((n,o)=>Xx(n)+Xx(t[o])))}function Xx(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function Kx(t){return(t?t.ownerDocument:document).body.offsetHeight}function oL(t,e,n){const o=t[Dd];o&&(e=(e?[e,...o]:[...o]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}const u0=Symbol("_vod"),c3=Symbol("_vsh"),Rc={name:"show",beforeMount(t,{value:e},{transition:n}){t[u0]=t.style.display==="none"?"":t.style.display,n&&e?n.beforeEnter(t):Lu(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),Lu(t,!0),o.enter(t)):o.leave(t,()=>{Lu(t,!1)}):Lu(t,e))},beforeUnmount(t,{value:e}){Lu(t,e)}};function Lu(t,e){t.style.display=e?t[u0]:"none",t[c3]=!e}const u3=Symbol("");function d3(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=>d0(i,r))},o=()=>{const r=t(e.proxy);e.ce?d0(e.ce,r):Kv(e.subTree,r),n(r)};Pk(()=>{gk(o)}),fn(()=>{He(o,ai,{flush:"post"});const r=new MutationObserver(o);r.observe(e.subTree.el.parentNode,{childList:!0}),zs(()=>r.disconnect())})}function Kv(t,e){if(t.shapeFlag&128){const n=t.suspense;t=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{Kv(n.activeBranch,e)})}for(;t.component;)t=t.component.subTree;if(t.shapeFlag&1&&t.el)d0(t.el,e);else if(t.type===Ne)t.children.forEach(n=>Kv(n,e));else if(t.type===dd){let{el:n,anchor:o}=t;for(;n&&(d0(n,e),n!==o);)n=n.nextSibling}}function d0(t,e){if(t.nodeType===1){const n=t.style;let o="";for(const r in e){const i=yB(e[r]);n.setProperty(`--${r}`,i),o+=`--${r}: ${i};`}n[u3]=o}}const rL=/(?:^|;)\s*display\s*:/;function iL(t,e,n){const o=t.style,r=mn(n);let i=!1;if(n&&!r){if(e)if(mn(e))for(const s of e.split(";")){const a=s.slice(0,s.indexOf(":")).trim();n[a]==null&&Ih(o,a,"")}else for(const s in e)n[s]==null&&Ih(o,s,"");for(const s in n)s==="display"&&(i=!0),Ih(o,s,n[s])}else if(r){if(e!==n){const s=o[u3];s&&(n+=";"+s),o.cssText=n,i=rL.test(n)}}else e&&t.removeAttribute("style");u0 in t&&(t[u0]=i?o.display:"",t[c3]&&(o.display="none"))}const Zx=/\s*!important$/;function Ih(t,e,n){if(lt(n))n.forEach(o=>Ih(t,e,o));else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const o=sL(t,e);Zx.test(n)?t.setProperty(Fs(o),n.replace(Zx,""),"important"):t[o]=n}}const Qx=["Webkit","Moz","ms"],_g={};function sL(t,e){const n=_g[e];if(n)return n;let o=Sr(e);if(o!=="filter"&&o in t)return _g[e]=o;o=Tp(o);for(let r=0;r<Qx.length;r++){const i=Qx[r]+o;if(i in t)return _g[e]=i}return e}const Jx="http://www.w3.org/1999/xlink";function ew(t,e,n,o,r,i=vB(e)){o&&e.startsWith("xlink:")?n==null?t.removeAttributeNS(Jx,e.slice(6,e.length)):t.setAttributeNS(Jx,e,n):n==null||i&&!WS(n)?t.removeAttribute(e):t.setAttribute(e,i?"":di(n)?String(n):n)}function tw(t,e,n,o,r){if(e==="innerHTML"||e==="textContent"){n!=null&&(t[e]=e==="innerHTML"?a3(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=WS(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 ws(t,e,n,o){t.addEventListener(e,n,o)}function aL(t,e,n,o){t.removeEventListener(e,n,o)}const nw=Symbol("_vei");function lL(t,e,n,o,r=null){const i=t[nw]||(t[nw]={}),s=i[e];if(o&&s)s.value=o;else{const[a,l]=cL(e);if(o){const c=i[e]=fL(o,r);ws(t,a,c,l)}else s&&(aL(t,a,s,l),i[e]=void 0)}}const ow=/(?:Once|Passive|Capture)$/;function cL(t){let e;if(ow.test(t)){e={};let o;for(;o=t.match(ow);)t=t.slice(0,t.length-o[0].length),e[o[0].toLowerCase()]=!0}return[t[2]===":"?t.slice(3):Fs(t.slice(2)),e]}let Sg=0;const uL=Promise.resolve(),dL=()=>Sg||(uL.then(()=>Sg=0),Sg=Date.now());function fL(t,e){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;hi(hL(o,n.value),e,5,[o])};return n.value=t,n.attached=dL(),n}function hL(t,e){if(lt(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 rw=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,pL=(t,e,n,o,r,i)=>{const s=r==="svg";e==="class"?oL(t,o,s):e==="style"?iL(t,n,o):Cp(e)?Pb(e)||lL(t,e,n,o,i):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):mL(t,e,o,s))?(tw(t,e,o),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&ew(t,e,o,s,i,e!=="value")):t._isVueCE&&(/[A-Z]/.test(e)||!mn(o))?tw(t,Sr(e),o,i,e):(e==="true-value"?t._trueValue=o:e==="false-value"&&(t._falseValue=o),ew(t,e,o,s))};function mL(t,e,n,o){if(o)return!!(e==="innerHTML"||e==="textContent"||e in t&&rw(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 rw(e)&&mn(n)?!1:e in t}const wa=t=>{const e=t.props["onUpdate:modelValue"]||!1;return lt(e)?n=>Ph(e,n):e};function gL(t){t.target.composing=!0}function iw(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const Ir=Symbol("_assign");function sw(t,e,n){return e&&(t=t.trim()),n&&(t=Mp(t)),t}const f0={created(t,{modifiers:{lazy:e,trim:n,number:o}},r){t[Ir]=wa(r);const i=o||r.props&&r.props.type==="number";ws(t,e?"change":"input",s=>{s.target.composing||t[Ir](sw(t.value,n,i))}),(n||i)&&ws(t,"change",()=>{t.value=sw(t.value,n,i)}),e||(ws(t,"compositionstart",gL),ws(t,"compositionend",iw),ws(t,"change",iw))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,oldValue:n,modifiers:{lazy:o,trim:r,number:i}},s){if(t[Ir]=wa(s),t.composing)return;const a=(i||t.type==="number")&&!/^0\d/.test(t.value)?Mp(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))}},f3={deep:!0,created(t,e,n){t[Ir]=wa(n),ws(t,"change",()=>{const o=t._modelValue,r=Nc(t),i=t.checked,s=t[Ir];if(lt(o)){const a=Eb(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(lu(o)){const a=new Set(o);i?a.add(r):a.delete(r),s(a)}else s(h3(t,i))})},mounted:aw,beforeUpdate(t,e,n){t[Ir]=wa(n),aw(t,e,n)}};function aw(t,{value:e,oldValue:n},o){t._modelValue=e;let r;if(lt(e))r=Eb(e,o.props.value)>-1;else if(lu(e))r=e.has(o.props.value);else{if(e===n)return;r=ba(e,h3(t,!0))}t.checked!==r&&(t.checked=r)}const vL={created(t,{value:e},n){t.checked=ba(e,n.props.value),t[Ir]=wa(n),ws(t,"change",()=>{t[Ir](Nc(t))})},beforeUpdate(t,{value:e,oldValue:n},o){t[Ir]=wa(o),e!==n&&(t.checked=ba(e,o.props.value))}},bL={deep:!0,created(t,{value:e,modifiers:{number:n}},o){const r=lu(e);ws(t,"change",()=>{const i=Array.prototype.filter.call(t.options,s=>s.selected).map(s=>n?Mp(Nc(s)):Nc(s));t[Ir](t.multiple?r?new Set(i):i:i[0]),t._assigning=!0,_n(()=>{t._assigning=!1})}),t[Ir]=wa(o)},mounted(t,{value:e}){lw(t,e)},beforeUpdate(t,e,n){t[Ir]=wa(n)},updated(t,{value:e}){t._assigning||lw(t,e)}};function lw(t,e){const n=t.multiple,o=lt(e);if(!(n&&!o&&!lu(e))){for(let r=0,i=t.options.length;r<i;r++){const s=t.options[r],a=Nc(s);if(n)if(o){const l=typeof a;l==="string"||l==="number"?s.selected=e.some(c=>String(c)===String(a)):s.selected=Eb(e,a)>-1}else s.selected=e.has(a);else if(ba(Nc(s),e)){t.selectedIndex!==r&&(t.selectedIndex=r);return}}!n&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function Nc(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 yL=["ctrl","shift","alt","meta"],xL={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)=>yL.some(n=>t[`${n}Key`]&&!e.includes(n))},vn=(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=xL[e[s]];if(a&&a(r,e))return}return t(r,...i)}))},wL={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},tr=(t,e)=>{const n=t._withKeys||(t._withKeys={}),o=e.join(".");return n[o]||(n[o]=(r=>{if(!("key"in r))return;const i=Fs(r.key);if(e.some(s=>s===i||wL[s]===i))return t(r)}))},_L=In({patchProp:pL},K9);let cw;function SL(){return cw||(cw=B9(_L))}const kL=((...t)=>{const e=SL().createApp(...t),{mount:n}=e;return e.mount=o=>{const r=AL(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,CL(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),s},e});function CL(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function AL(t){return mn(t)?document.querySelector(t):t}/*!
|
|
19
|
+
* pinia v3.0.4
|
|
20
|
+
* (c) 2025 Eduardo San Martin Morote
|
|
21
|
+
* @license MIT
|
|
22
|
+
*/let p3;const Xp=t=>p3=t,m3=Symbol();function Zv(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var hd;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(hd||(hd={}));function $L(){const t=Bp(!0),e=t.run(()=>Ie({}));let n=[],o=[];const r=$e({install(i){Xp(r),r._a=i,i.provide(m3,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 uw(t,e,n,o=g3){t.add(e);const r=()=>{t.delete(e)&&o()};return!n&&Rl()&&ya(r),r}function oc(t,...e){t.forEach(n=>{n(...e)})}const TL=t=>t(),dw=Symbol(),kg=Symbol();function Qv(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];Zv(r)&&Zv(o)&&t.hasOwnProperty(n)&&!Ke(o)&&!Ui(o)?t[n]=Qv(r,o):t[n]=o}return t}const ML=Symbol();function OL(t){return!Zv(t)||!Object.prototype.hasOwnProperty.call(t,ML)}const{assign:oa}=Object;function BL(t){return!!(Ke(t)&&t.effect)}function LL(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=Rp(n.state.value[t]);return oa(u,i,Object.keys(s||{}).reduce((d,f)=>(d[f]=$e(S(()=>{Xp(n);const h=n._s.get(t);return s[f].call(h,h)})),d),{}))}return l=v3(t,c,e,n,o,!0),l}function v3(t,e,n={},o,r,i){let s;const a=oa({actions:{}},n),l={deep:!0};let c,u,d=new Set,f=new Set,h;const m=o.state.value[t];!i&&!m&&(o.state.value[t]={});let b;function g($){let M;c=u=!1,typeof $=="function"?($(o.state.value[t]),M={type:hd.patchFunction,storeId:t,events:h}):(Qv(o.state.value[t],$),M={type:hd.patchObject,payload:$,storeId:t,events:h});const D=b=Symbol();_n().then(()=>{b===D&&(c=!0)}),u=!0,oc(d,M,o.state.value[t])}const v=i?function(){const{state:M}=n,D=M?M():{};this.$patch(N=>{oa(N,D)})}:g3;function y(){s.stop(),d.clear(),f.clear(),o._s.delete(t)}const x=($,M="")=>{if(dw in $)return $[kg]=M,$;const D=function(){Xp(o);const N=Array.from(arguments),k=new Set,A=new Set;function B(z){k.add(z)}function P(z){A.add(z)}oc(f,{args:N,name:D[kg],store:C,after:B,onError:P});let F;try{F=$.apply(this&&this.$id===t?this:C,N)}catch(z){throw oc(A,z),z}return F instanceof Promise?F.then(z=>(oc(k,z),z)).catch(z=>(oc(A,z),Promise.reject(z))):(oc(k,F),F)};return D[dw]=!0,D[kg]=M,D},_={_p:o,$id:t,$onAction:uw.bind(null,f),$patch:g,$reset:v,$subscribe($,M={}){const D=uw(d,$,M.detached,()=>N()),N=s.run(()=>He(()=>o.state.value[t],k=>{(M.flush==="sync"?u:c)&&$({storeId:t,type:hd.direct,events:h},k)},oa({},l,M)));return D},$dispose:y},C=sr(_);o._s.set(t,C);const O=(o._a&&o._a.runWithContext||TL)(()=>o._e.run(()=>(s=Bp()).run(()=>e({action:x}))));for(const $ in O){const M=O[$];if(Ke(M)&&!BL(M)||Ui(M))i||(m&&OL(M)&&(Ke(M)?M.value=m[$]:Qv(M,m[$])),o.state.value[t][$]=M);else if(typeof M=="function"){const D=x(M,$);O[$]=D,a.actions[$]=M}}return oa(C,O),oa(Lt(C),O),Object.defineProperty(C,"$state",{get:()=>o.state.value[t],set:$=>{g(M=>{oa(M,$)})}}),o._p.forEach($=>{oa(C,s.run(()=>$({store:C,app:o._a,pinia:o,options:a})))}),m&&i&&n.hydrate&&n.hydrate(C.$state,m),c=!0,u=!0,C}/*! #__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=Vb();return s=s||(l?Jt(m3,null):null),s&&Xp(s),s=p3,s._s.has(t)||(r?v3(t,e,o,s):LL(t,o,s)),s._s.get(t)}return i.$id=t,i}function At(t){const e=Lt(t),n={};for(const o in e){const r=e[o];r.effect?n[o]=S({get:()=>t[o],set(i){t[o]=i}}):(Ke(r)||Ui(r))&&(n[o]=Ft(t,o))}return n}function PL(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 qb(t,e,n){if(n.length===0)return e;const o=n[0];return n.length>1&&(e=qb(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 b3(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 qb(t,b3(t[e[0]],Array.prototype.slice.call(e,1)),[e[0]])}function y3(t,e){return e.map(n=>n.split(".")).map(n=>[n,PL(t,n)]).filter(n=>n[1]!==void 0).reduce((n,o)=>qb(n,o[1],o[0]),{})}function x3(t,e){return e.map(n=>n.split(".")).reduce((n,o)=>b3(n,o),t)}function fw(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?y3(f,i):f,m=s?x3(h,s):h;t.$patch(m)}u&&(l==null||l(c))}catch(d){r&&console.error("[pinia-plugin-persistedstate]",d)}}function hw(t,{storage:e,serializer:n,key:o,debug:r,pick:i,omit:s}){try{const a=i?y3(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 DL(t,e){return typeof t=="function"?t(e):typeof t=="string"?t:e}function EL(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=>{fw(r,l,t,a)})},r.$persist=()=>{s.forEach(a=>{hw(r.$state,a)})},s.forEach(a=>{fw(r,a,t),r.$subscribe((l,c)=>hw(c,a),{detached:!0})})}function IL(t={}){return function(e){EL(e,n=>{const o=DL(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 RL=IL();const Yb=(t,e="")=>{const n=`${e}___`;return`___BVN__ID__${t}__${e?n:""}`},Ea=t=>Yb(t),Ia=t=>Yb(`${t}__plugin`),NL=Ea("checkboxGroup"),w3=Ea("radioGroup"),_3=Ea("collapse"),S3=Ia("globalShowHideStorage"),k3=Ea("dropdown"),C3=Ea("navbar"),FL=Ia("rtl"),VL=Ia("breadcrumbPlugin"),A3=Ia("modalManager"),Rh=Ia("defaults"),zL=Ea("inputGroup"),$3=Ea("buttonGroup"),HL=Ia("toast"),WL=Ia("modalController"),UL=Ia("popover"),T3=Ea("formGroupPlugin");function Nl(t){return Rl()?(ya(t),!0):!1}function M3(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=Bp(!0),n=o.run(()=>t(...i))),Nl(r),n)}function GL(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 io(t){return typeof t=="function"?t():p(t)}const O3=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const qL=t=>t!=null,YL=Object.prototype.toString,jL=t=>YL.call(t)==="[object Object]",As=()=>{},Jv=XL();function XL(){var t,e;return O3&&((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 B3(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 KL(t,e={}){let n,o,r=As;const i=a=>{clearTimeout(a),r(),r=As};return a=>{const l=io(t),c=io(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 ZL(...t){let e=0,n,o=!0,r=As,i,s,a,l,c;!Ke(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=As)};return f=>{const h=io(s),m=Date.now()-e,b=()=>i=f();return u(),h<=0?(e=Date.now(),b()):(m>h&&(l||!o)?(e=Date.now(),b()):a&&(i=new Promise((g,v)=>{r=c?v:g,n=setTimeout(()=>{e=Date.now(),o=!0,g(b()),u()},Math.max(0,h-m))})),!l&&!n&&(n=setTimeout(()=>o=!0,h)),o=!1,i)}}function QL(t){const e=Object.create(null);return n=>e[n]||(e[n]=t(n))}const JL=/-(\w)/g,eP=QL(t=>t.replace(JL,(e,n)=>n?n.toUpperCase():""));function tP(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 nP(...t){if(t.length!==1)return Ft(...t);const e=t[0];return typeof e=="function"?ro(fk(()=>({get:e,set:As}))):Ie(e)}function oP(t,e=200,n={}){return B3(KL(e,n),t)}function pw(t,e=200,n=!1,o=!0,r=!1){return B3(ZL(e,n,o,r),t)}function Sl(t,e={}){const{method:n="parseFloat",radix:o,nanToZero:r}=e;return S(()=>{let i=io(t);return typeof i=="string"&&(i=Number[n](i,o)),r&&Number.isNaN(i)&&(i=0),i})}function mw(t={}){const{inheritAttrs:e=!0}=t,n=De(),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,{...rP(s),$slots:a});return e&&(c==null?void 0:c.length)===1?c[0]:c}}});return GL({define:o,reuse:r},[o,r])}function rP(t){const e={};for(const n in t)e[eP(n)]=t[n];return e}const Fl=O3?window:void 0;function da(t){var e;const n=io(t);return(e=n==null?void 0:n.$el)!=null?e:n}function Pr(...t){let e,n,o,r;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,o,r]=t,e=Fl):[e,n,o,r]=t,!e)return As;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=He(()=>[da(e),io(r)],([u,d])=>{if(s(),!u)return;const f=jL(d)?{...d}:d;i.push(...n.flatMap(h=>o.map(m=>a(u,h,m,f))))},{immediate:!0,flush:"post"}),c=()=>{l(),s()};return Nl(c),c}let gw=!1;function L3(t,e,n={}){const{window:o=Fl,ignore:r=[],capture:i=!0,detectIframe:s=!1}=n;if(!o)return As;Jv&&!gw&&(gw=!0,Array.from(o.document.body.children).forEach(b=>b.addEventListener("click",As)),o.document.documentElement.addEventListener("click",As));let a=!0;const l=b=>io(r).some(g=>{if(typeof g=="string")return Array.from(o.document.querySelectorAll(g)).some(v=>v===b.target||b.composedPath().includes(v));{const v=da(g);return v&&(b.target===v||b.composedPath().includes(v))}});function c(b){const g=io(b);return g&&g.$.subTree.shapeFlag===16}function u(b,g){const v=io(b),y=v.$.subTree&&v.$.subTree.children;return y==null||!Array.isArray(y)?!1:y.some(x=>x.el===g.target||g.composedPath().includes(x.el))}const d=b=>{const g=da(t);if(b.target!=null&&!(!(g instanceof Element)&&c(t)&&u(t,b))&&!(!g||g===b.target||b.composedPath().includes(g))){if(b.detail===0&&(a=!l(b)),!a){a=!0;return}e(b)}};let f=!1;const h=[Pr(o,"click",b=>{f||(f=!0,setTimeout(()=>{f=!1},0),d(b))},{passive:!0,capture:i}),Pr(o,"pointerdown",b=>{const g=da(t);a=!l(b)&&!!(g&&!b.composedPath().includes(g))},{passive:!0}),s&&Pr(o,"blur",b=>{setTimeout(()=>{var g;const v=da(t);((g=o.document.activeElement)==null?void 0:g.tagName)==="IFRAME"&&!(v!=null&&v.contains(o.document.activeElement))&&e(b)},0)})].filter(Boolean);return()=>h.forEach(b=>b())}function iP(t){return typeof t=="function"?t:typeof t=="string"?e=>e.key===t:Array.isArray(t)?e=>t.includes(e.key):()=>!0}function gs(...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=Fl,eventName:i="keydown",passive:s=!1,dedupe:a=!1}=o,l=iP(e);return Pr(r,i,u=>{u.repeat&&io(a)||l(u)&&n(u)},s)}function sP(){const t=Ie(!1),e=Oo();return e&&fn(()=>{t.value=!0},e),t}function P3(t){const e=sP();return S(()=>(e.value,!!t()))}function aP(t,e,n={}){const{window:o=Fl,...r}=n;let i;const s=P3(()=>o&&"MutationObserver"in o),a=()=>{i&&(i.disconnect(),i=void 0)},l=S(()=>{const f=io(t),h=(Array.isArray(f)?f:[f]).map(da).filter(qL);return new Set(h)}),c=He(()=>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 Nl(d),{isSupported:s,stop:d,takeRecords:u}}function Pu(t,e={}){const{window:n=Fl}=e,o=P3(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function");let r;const i=Ie(!1),s=c=>{i.value=c.matches},a=()=>{r&&("removeEventListener"in r?r.removeEventListener("change",s):r.removeListener(s))},l=Fp(()=>{o.value&&(a(),r=n.matchMedia(io(t)),"addEventListener"in r?r.addEventListener("change",s):r.addListener(s),i.value=r.matches)});return Nl(()=>{l(),a(),r=void 0}),i}const lP={xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400};function cP(t,e={}){function n(u,d){let f=io(t[io(u)]);return d!=null&&(f=tP(f,d)),typeof f=="number"&&(f=`${f}px`),f}const{window:o=Fl,strategy:r="min-width"}=e;function i(u){return o?o.matchMedia(u).matches:!1}const s=u=>Pu(()=>`(min-width: ${n(u)})`,e),a=u=>Pu(()=>`(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 S(()=>u.filter(([,d])=>d.value).map(([d])=>d))}return Object.assign(l,{greaterOrEqual:s,smallerOrEqual:a,greater(u){return Pu(()=>`(min-width: ${n(u,.1)})`,e)},smaller(u){return Pu(()=>`(max-width: ${n(u,-.1)})`,e)},between(u,d){return Pu(()=>`(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 S(()=>u.value.length===0?"":u.value.at(-1))}})}const Uf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Gf="__vueuse_ssr_handlers__",uP=dP();function dP(){return Gf in Uf||(Uf[Gf]=Uf[Gf]||{}),Uf[Gf]}function fP(t,e){return uP[t]||e}function Vi(t,e={}){const{initialValue:n=!1,focusVisible:o=!1,preventScroll:r=!1}=e,i=Ie(!1),s=S(()=>da(t));Pr(s,"focus",l=>{var c,u;(!o||(u=(c=l.target).matches)!=null&&u.call(c,":focus-visible"))&&(i.value=!0)}),Pr(s,"blur",()=>i.value=!1);const a=S({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 He(s,()=>{a.value=n},{immediate:!0,flush:"post"}),{focused:a}}function Cg(t){return typeof Window<"u"&&t instanceof Window?t.document.documentElement:typeof Document<"u"&&t instanceof Document?t.documentElement:t}const hP={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 pP(t={}){const{type:e="page",touch:n=!0,resetOnTouchEnds:o=!1,initialValue:r={x:0,y:0},window:i=Fl,target:s=i,scroll:a=!0,eventFilter:l}=t;let c=null,u=0,d=0;const f=Ie(r.x),h=Ie(r.y),m=Ie(null),b=typeof e=="function"?e:hP[e],g=O=>{const $=b(O);c=O,$&&([f.value,h.value]=$,m.value="mouse"),i&&(u=i.scrollX,d=i.scrollY)},v=O=>{if(O.touches.length>0){const $=b(O.touches[0]);$&&([f.value,h.value]=$,m.value="touch")}},y=()=>{if(!c||!i)return;const O=b(c);c instanceof MouseEvent&&O&&(f.value=O[0]+i.scrollX-u,h.value=O[1]+i.scrollY-d)},x=()=>{f.value=r.x,h.value=r.y},_=l?O=>l(()=>g(O),{}):O=>g(O),C=l?O=>l(()=>v(O),{}):O=>v(O),L=l?()=>l(()=>y(),{}):()=>y();if(s){const O={passive:!0};Pr(s,["mousemove","dragover"],_,O),n&&e!=="movement"&&(Pr(s,["touchstart","touchmove"],C,O),o&&Pr(s,"touchend",x,O)),a&&e==="page"&&Pr(i,"scroll",L,{passive:!0})}return{x:f,y:h,sourceType:m}}function D3(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:D3(n)}}function mP(t){const e=t||window.event,n=e.target;return D3(n)?!1:e.touches.length>1?!0:(e.preventDefault&&e.preventDefault(),!1)}const Ag=new WeakMap;function gP(t,e=!1){const n=Ie(e);let o=null,r="";He(nP(t),a=>{const l=Cg(io(a));if(l){const c=l;if(Ag.get(c)||Ag.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=Cg(io(t));!a||n.value||(Jv&&(o=Pr(a,"touchmove",l=>{mP(l)},{passive:!1})),a.style.overflow="hidden",n.value=!0)},s=()=>{const a=Cg(io(t));!a||!n.value||(Jv&&(o==null||o()),a.style.overflow=r,Ag.delete(a),n.value=!1)};return Nl(s),S({get(){return n.value},set(a){a?i():s()}})}const $g="modal-open",vP=()=>{const t=Jt(A3),e=o=>{t==null||t.removeStack(o),t==null||t.removeRegistry(o)},n=fP("updateHTMLAttrs",(o,r,i)=>{const s=typeof o=="string"?window==null?void 0:window.document.querySelector(o):da(o);s&&(r==="class"?s.classList.toggle($g,i===$g):s.setAttribute(r,i))});return Nl(()=>{n("body","class","")}),He(()=>t==null?void 0:t.countStack.value,o=>{o!==void 0&&n("body","class",o>0?$g:"")}),{...t,dispose:e}},bP=(t,e)=>{const{pushRegistry:n,pushStack:o,removeStack:r,stack:i,dispose:s,countStack:a}=vP(),l=Oo();if(!l||l.type.__name!=="BModal")throw new Error("useModalManager must only use in BModal component");n==null||n(l),Nl(()=>{s(l)});const c=(u,d)=>{u?o==null||o(l):d&&!u&&(r==null||r(l))};return c(e,e),He(t,c),{activePosition:S(()=>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:S(()=>(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)}))??[])}},h0=t=>{if(t)return typeof t=="string"?typeof document>"u"?void 0:document.getElementById(t)??document.querySelector(t)??void 0:t.$el??t},yP=/^[0-9]*\.?[0-9]+$/;function xP(t,e=E3("injectSelf")){const{provides:n}=e;if(n&&t in n)return n[t]}function E3(t,e){const n=Oo();if(!n)throw new Error(`[Bvn] ${t} must be called from inside a setup function`);return n}const wP=(t="")=>t.replace(/[^a-z]/gi,"-").replace(/\B([A-Z])/g,"-$1").toLowerCase(),vw=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);function I3(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(vw(i)&&vw(s)){o[r]=I3(i,s);continue}o[r]=s}return o}const _P=(t,e)=>{var n,o;return typeof((n=t.props)==null?void 0:n[e])<"u"||typeof((o=t.props)==null?void 0:o[wP(e)])<"u"};function SP(t={},e){const n=Jt(Rh,Ie({})),o=E3("useDefaults");if(e=e??o.type.name??o.type.__name,!e)throw new Error("[Bvn] Could not determine component name");const r=S(()=>{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 m=Reflect.get(l,c);return c==="class"||c==="style"?[(u=r.value)==null?void 0:u[c],m].filter(b=>b!=null):typeof c=="string"&&!_P(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])??m:m}}),s=De();Fp(()=>{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=xP(Rh,o);Gi(Rh,S(()=>s.value?I3((l==null?void 0:l.value)??{},s.value):l==null?void 0:l.value))}return{props:i,provideSubDefaults:a}}function zt(t,e){const{props:n,provideSubDefaults:o}=SP(t,e);return o(),n}const _o=(t,e)=>{const n=Mk();return S(()=>bt(t)||Yb(n||"",e))},Kp=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?Nt(zp,{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 kP=Object.defineProperty,CP=(t,e,n)=>e in t?kP(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ds=(t,e,n)=>CP(t,typeof e!="symbol"?e+"":e,n);class p0{constructor(e,n={}){if(ds(this,"cancelable",!0),ds(this,"componentId",null),ds(this,"_defaultPrevented",!1),ds(this,"eventType",""),ds(this,"nativeEvent",null),ds(this,"_preventDefault"),ds(this,"relatedTarget",null),ds(this,"target",null),!e)throw new TypeError(`Failed to construct '${this.constructor.name}'. 1 argument required, ${arguments.length} given.`);Object.assign(this,p0.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 AP extends p0{constructor(e,n={}){super(e,n),ds(this,"trigger",null),Object.assign(this,p0.Defaults,n,{eventType:e})}static get Defaults(){return{...super.Defaults,trigger:null}}}const bw={name:"fade",enterActiveClass:"",enterFromClass:"showing",enterToClass:"",leaveActiveClass:"",leaveFromClass:"",leaveToClass:"showing",css:!0},Zp=(t,e,n,o,r,i={transitionProps:{},showFn:()=>{},hideFn:()=>{}})=>{var s;let a=!1;const l=!!t.value&&!e.initialAnimation||e.visible||!1,c=Ie(!1),u=Ie(l),d=Ie(l);let f=typeof t.value!="boolean";He(t,()=>{if(f=typeof t.value!="boolean",a){a=!1;return}t.value?y():x()});const h=Ie(l),m=Ie(!1),b=S(()=>e.noAnimation||e.noFade||h.value||!1);fn(()=>{var oe;if(!e.show&&l){const se=g("show",{cancelable:!0});if(n("show",se),se.defaultPrevented){n("show-prevented",g("show-prevented"));return}h.value=!0,t.value||(a=!0,t.value=!0),u.value=!0,d.value=!0,k.value=!0,ce.value=!0,he.value=!0,c.value=!0,(oe=i.showFn)==null||oe.call(i)}else(e.show||t.value&&e.initialAnimation)&&y()}),He(()=>e.visible,oe=>{h.value=!0,_n(()=>{oe&&(k.value=!0),oe?y():x()})}),He(()=>e.show,oe=>{oe?y():x()}),Pr(o,"bv-toggle",()=>{t.value=!t.value});const g=(oe,se={})=>new AP(oe,{cancelable:!1,target:(o==null?void 0:o.value)||null,relatedTarget:null,trigger:null,...se,componentId:r==null?void 0:r.value});let v;const y=()=>{if(c.value)return;const oe=g("show",{cancelable:!0});if(n("show",oe),oe.defaultPrevented){n("show-prevented",g("show-prevented")),k.value&&(k.value=!1),t.value&&!f&&(a=!0,_n(()=>{t.value=!1}));return}u.value=!0,d.value=!0,requestAnimationFrame(()=>{var se;v=setTimeout(()=>{var re;c.value=!0,(re=i.showFn)==null||re.call(i),t.value||(a=!0,_n(()=>{t.value=!0}))},h.value?0:typeof e.delay=="number"?e.delay:((se=e.delay)==null?void 0:se.show)||0)})},x=oe=>{var se;if(!c.value)return;const re=g("hide",{cancelable:!0,trigger:oe}),U=g(oe||"ignore",{cancelable:!0,trigger:oe});if(oe==="backdrop"&&e.noCloseOnBackdrop||oe==="esc"&&e.noCloseOnEsc){n("hide-prevented",g("hide-prevented"));return}if(v&&(clearTimeout(v),v=void 0),oe&&n(oe,U),n("hide",re),re.defaultPrevented||U.defaultPrevented){n("hide-prevented",g("hide-prevented")),t.value||_n(()=>{a=!0,t.value=!0});return}setTimeout(()=>{var te;D.value=!0,c.value=!1,(te=i.hideFn)==null||te.call(i),t.value&&(a=!0,t.value=f?0:!1)},h.value?0:typeof e.delay=="number"?e.delay:((se=e.delay)==null?void 0:se.hide)||0)},_=pw(oe=>x(oe),500),C=pw(()=>y(),500),L=()=>{const oe=g("toggle",{cancelable:!0});if(n("toggle",oe),oe.defaultPrevented){n("toggle-prevented",g("toggle-prevented"));return}c.value?x():y()},O=(s=Jt(S3,void 0))==null?void 0:s({id:r.value,toggle:L,show:y,hide:x,value:ro(c)});Ds(()=>{O==null||O.unregister()});const $=Ie(!1),M=()=>{e.lazy===!0&&($.value=!0)},D=Ie(!1),N=Ie(!1),k=Ie(!1),A=oe=>{var se,re,U,te;(re=(se=i.transitionProps)==null?void 0:se.onBeforeEnter)==null||re.call(se,oe),(te=(U=e.transitionProps)==null?void 0:U.onBeforeEnter)==null||te.call(U,oe),N.value=!0},B=oe=>{var se,re,U,te;requestAnimationFrame(()=>{requestAnimationFrame(()=>{k.value=!0})}),(re=(se=i.transitionProps)==null?void 0:se.onEnter)==null||re.call(se,oe),(te=(U=e.transitionProps)==null?void 0:U.onEnter)==null||te.call(U,oe)},P=oe=>{var se,re,U,te;n("shown",g("shown")),M(),(re=(se=i.transitionProps)==null?void 0:se.onAfterEnter)==null||re.call(se,oe),(te=(U=e.transitionProps)==null?void 0:U.onAfterEnter)==null||te.call(U,oe),h.value&&requestAnimationFrame(()=>{h.value=!1}),m.value&&(m.value=!1)},F=oe=>{var se,re,U,te;D.value||(D.value=!0),(re=(se=i.transitionProps)==null?void 0:se.onBeforeLeave)==null||re.call(se,oe),(te=(U=e.transitionProps)==null?void 0:U.onBeforeLeave)==null||te.call(U,oe)},z=oe=>{var se,re,U,te;k.value=!1,(re=(se=i.transitionProps)==null?void 0:se.onLeave)==null||re.call(se,oe),(te=(U=e.transitionProps)==null?void 0:U.onLeave)==null||te.call(U,oe)},V=oe=>{var se,re,U,te;n("hidden",g("hidden")),(re=(se=i.transitionProps)==null?void 0:se.onAfterLeave)==null||re.call(se,oe),(te=(U=e.transitionProps)==null?void 0:U.onAfterLeave)==null||te.call(U,oe),D.value=!1,N.value=!1,h.value&&requestAnimationFrame(()=>{h.value=!1}),requestAnimationFrame(()=>{m.value||(u.value=!1)})},G=S(()=>m.value===!0||N.value===!0||e.lazy===!1||e.lazy===!0&&$.value===!0&&e.unmountLazy===!1),ie=Ie(!1);He(k,oe=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{setTimeout(()=>{ie.value=oe},32)})})})})});const ce=Ie(!1),he=Ie(!1),Z={...i.transitionProps,onBeforeEnter:A,onEnter:B,onAfterEnter:P,onBeforeLeave:F,onLeave:z,onAfterLeave:V};return{showRef:c,renderRef:u,renderBackdropRef:d,isVisible:k,isActive:N,trapActive:ie,show:y,hide:x,toggle:L,throttleHide:_,throttleShow:C,buildTriggerableEvent:g,computedNoAnimation:b,localNoAnimation:h,localTemporaryHide:m,isLeaving:D,transitionProps:{...bw,...e.transitionProps,...Z},lazyLoadCompleted:$,markLazyLoadCompleted:M,contentShowing:G,backdropReady:he,backdropVisible:ce,backdropTransitionProps:{...bw,onBeforeEnter:()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{ce.value=!0})}),he.value=!1},onAfterEnter:()=>{he.value=!0},onBeforeLeave:()=>{ce.value=!1},onAfterLeave:()=>{he.value=!1,requestAnimationFrame(()=>{d.value=!1})}}}},Qp=(t,e)=>{const n=t.__vccOpts||t;for(const[o,r]of e)n[o]=r;return n},R3=["top","right","bottom","left"],yw=["start","end"],xw=R3.reduce((t,e)=>t.concat(e,e+"-"+yw[0],e+"-"+yw[1]),[]),pi=Math.min,yo=Math.max,m0=Math.round,qf=Math.floor,qi=t=>({x:t,y:t}),$P={left:"right",right:"left",bottom:"top",top:"bottom"},TP={start:"end",end:"start"};function e1(t,e,n){return yo(t,pi(e,n))}function Hs(t,e){return typeof t=="function"?t(e):t}function Vr(t){return t.split("-")[0]}function ci(t){return t.split("-")[1]}function N3(t){return t==="x"?"y":"x"}function jb(t){return t==="y"?"height":"width"}function _a(t){return["top","bottom"].includes(Vr(t))?"y":"x"}function Xb(t){return N3(_a(t))}function F3(t,e,n){n===void 0&&(n=!1);const o=ci(t),r=Xb(t),i=jb(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=v0(s)),[s,v0(s)]}function MP(t){const e=v0(t);return[g0(t),e,g0(e)]}function g0(t){return t.replace(/start|end/g,e=>TP[e])}function OP(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 BP(t,e,n,o){const r=ci(t);let i=OP(Vr(t),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),e&&(i=i.concat(i.map(g0)))),i}function v0(t){return t.replace(/left|right|bottom|top/g,e=>$P[e])}function LP(t){return{top:0,right:0,bottom:0,left:0,...t}}function Kb(t){return typeof t!="number"?LP(t):{top:t,right:t,bottom:t,left:t}}function Fc(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=_a(e),s=Xb(e),a=jb(s),l=Vr(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(ci(e)){case"start":h[s]-=f*(n&&c?-1:1);break;case"end":h[s]+=f*(n&&c?-1:1);break}return h}const PP=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={},m=0;for(let b=0;b<a.length;b++){const{name:g,fn:v}=a[b],{x:y,y:x,data:_,reset:C}=await v({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,[g]:{...h[g],..._}},C&&m<=50&&(m++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(c=C.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:r}):C.rects),{x:u,y:d}=ww(c,f,l)),b=-1)}return{x:u,y:d,placement:f,strategy:r,middlewareData:h}};async function Vc(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}=Hs(e,t),m=Kb(h),g=a[f?d==="floating"?"reference":"floating":d],v=Fc(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(g)))==null||n?g:g.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},C=Fc(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:x,strategy:l}):y);return{top:(v.top-C.top+m.top)/_.y,bottom:(C.bottom-v.bottom+m.bottom)/_.y,left:(v.left-C.left+m.left)/_.x,right:(C.right-v.right+m.right)/_.x}}const DP=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}=Hs(t,e)||{};if(c==null)return{};const d=Kb(u),f={x:n,y:o},h=Xb(r),m=jb(h),b=await s.getDimensions(c),g=h==="y",v=g?"top":"left",y=g?"bottom":"right",x=g?"clientHeight":"clientWidth",_=i.reference[m]+i.reference[h]-f[h]-i.floating[m],C=f[h]-i.reference[h],L=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let O=L?L[x]:0;(!O||!await(s.isElement==null?void 0:s.isElement(L)))&&(O=a.floating[x]||i.floating[m]);const $=_/2-C/2,M=O/2-b[m]/2-1,D=pi(d[v],M),N=pi(d[y],M),k=D,A=O-b[m]-N,B=O/2-b[m]/2+$,P=e1(k,B,A),F=!l.arrow&&ci(r)!=null&&B!==P&&i.reference[m]/2-(B<k?D:N)-b[m]/2<0,z=F?B<k?B-k:B-A:0;return{[h]:f[h]+z,data:{[h]:P,centerOffset:B-P-z,...F&&{alignmentOffset:z}},reset:F}}});function EP(t,e,n){return(t?[...n.filter(r=>ci(r)===t),...n.filter(r=>ci(r)!==t)]:n.filter(r=>Vr(r)===r)).filter(r=>t?ci(r)===t||(e?g0(r)!==r:!1):!0)}const IP=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=xw,autoAlignment:h=!0,...m}=Hs(t,e),b=d!==void 0||f===xw?EP(d||null,h,f):f,g=await Vc(e,m),v=((n=s.autoPlacement)==null?void 0:n.index)||0,y=b[v];if(y==null)return{};const x=F3(y,i,await(l.isRTL==null?void 0:l.isRTL(c.floating)));if(a!==y)return{reset:{placement:b[0]}};const _=[g[Vr(y)],g[x[0]],g[x[1]]],C=[...((o=s.autoPlacement)==null?void 0:o.overflows)||[],{placement:y,overflows:_}],L=b[v+1];if(L)return{data:{index:v+1,overflows:C},reset:{placement:L}};const O=C.map(D=>{const N=ci(D.placement);return[D.placement,N&&u?D.overflows.slice(0,2).reduce((k,A)=>k+A,0):D.overflows[0],D.overflows]}).sort((D,N)=>D[1]-N[1]),M=((r=O.filter(D=>D[2].slice(0,ci(D[0])?2:3).every(N=>N<=0))[0])==null?void 0:r[0])||O[0][0];return M!==a?{data:{index:v+1,overflows:C},reset:{placement:M}}:{}}}},RP=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:m="none",flipAlignment:b=!0,...g}=Hs(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=Vr(r),y=_a(a),x=Vr(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=f||(x||!b?[v0(a)]:MP(a)),L=m!=="none";!f&&L&&C.push(...BP(a,b,m,_));const O=[a,...C],$=await Vc(e,g),M=[];let D=((o=i.flip)==null?void 0:o.overflows)||[];if(u&&M.push($[v]),d){const B=F3(r,s,_);M.push($[B[0]],$[B[1]])}if(D=[...D,{placement:r,overflows:M}],!M.every(B=>B<=0)){var N,k;const B=(((N=i.flip)==null?void 0:N.index)||0)+1,P=O[B];if(P)return{data:{index:B,overflows:D},reset:{placement:P}};let F=(k=D.filter(z=>z.overflows[0]<=0).sort((z,V)=>z.overflows[1]-V.overflows[1])[0])==null?void 0:k.placement;if(!F)switch(h){case"bestFit":{var A;const z=(A=D.filter(V=>{if(L){const G=_a(V.placement);return G===y||G==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(G=>G>0).reduce((G,ie)=>G+ie,0)]).sort((V,G)=>V[1]-G[1])[0])==null?void 0:A[0];z&&(F=z);break}case"initialPlacement":F=a;break}if(r!==F)return{reset:{placement:F}}}return{}}}};function _w(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Sw(t){return R3.some(e=>t[e]>=0)}const NP=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...r}=Hs(t,e);switch(o){case"referenceHidden":{const i=await Vc(e,{...r,elementContext:"reference"}),s=_w(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Sw(s)}}}case"escaped":{const i=await Vc(e,{...r,altBoundary:!0}),s=_w(i,n.floating);return{data:{escapedOffsets:s,escaped:Sw(s)}}}default:return{}}}}};function V3(t){const e=pi(...t.map(i=>i.left)),n=pi(...t.map(i=>i.top)),o=yo(...t.map(i=>i.right)),r=yo(...t.map(i=>i.bottom));return{x:e,y:n,width:o-e,height:r-n}}function FP(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=>Fc(V3(r)))}const VP=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}=Hs(t,e),u=Array.from(await(i.getClientRects==null?void 0:i.getClientRects(o.reference))||[]),d=FP(u),f=Fc(V3(u)),h=Kb(a);function m(){if(d.length===2&&d[0].left>d[1].right&&l!=null&&c!=null)return d.find(g=>l>g.left-h.left&&l<g.right+h.right&&c>g.top-h.top&&c<g.bottom+h.bottom)||f;if(d.length>=2){if(_a(n)==="y"){const D=d[0],N=d[d.length-1],k=Vr(n)==="top",A=D.top,B=N.bottom,P=k?D.left:N.left,F=k?D.right:N.right,z=F-P,V=B-A;return{top:A,bottom:B,left:P,right:F,width:z,height:V,x:P,y:A}}const g=Vr(n)==="left",v=yo(...d.map(D=>D.right)),y=pi(...d.map(D=>D.left)),x=d.filter(D=>g?D.left===y:D.right===v),_=x[0].top,C=x[x.length-1].bottom,L=y,O=v,$=O-L,M=C-_;return{top:_,bottom:C,left:L,right:O,width:$,height:M,x:L,y:_}}return f}const b=await i.getElementRects({reference:{getBoundingClientRect:m},floating:o.floating,strategy:s});return r.reference.x!==b.reference.x||r.reference.y!==b.reference.y||r.reference.width!==b.reference.width||r.reference.height!==b.reference.height?{reset:{rects:b}}:{}}}};async function zP(t,e){const{placement:n,platform:o,elements:r}=t,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=Vr(n),a=ci(n),l=_a(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=Hs(e,t);let{mainAxis:f,crossAxis:h,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof m=="number"&&(h=a==="end"?m*-1:m),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}const HP=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 zP(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}}}}},WP=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:g=>{let{x:v,y}=g;return{x:v,y}}},...l}=Hs(t,e),c={x:n,y:o},u=await Vc(e,l),d=_a(Vr(r)),f=N3(d);let h=c[f],m=c[d];if(i){const g=f==="y"?"top":"left",v=f==="y"?"bottom":"right",y=h+u[g],x=h-u[v];h=e1(y,h,x)}if(s){const g=d==="y"?"top":"left",v=d==="y"?"bottom":"right",y=m+u[g],x=m-u[v];m=e1(y,m,x)}const b=a.fn({...e,[f]:h,[d]:m});return{...b,data:{x:b.x-n,y:b.y-o,enabled:{[f]:i,[d]:s}}}}}},UP=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}=Hs(t,e),u=await Vc(e,c),d=Vr(r),f=ci(r),h=_a(r)==="y",{width:m,height:b}=i.floating;let g,v;d==="top"||d==="bottom"?(g=d,v=f===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,g=f==="end"?"top":"bottom");const y=b-u.top-u.bottom,x=m-u.left-u.right,_=pi(b-u[g],y),C=pi(m-u[v],x),L=!e.middlewareData.shift;let O=_,$=C;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&($=x),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(O=y),L&&!f){const D=yo(u.left,0),N=yo(u.right,0),k=yo(u.top,0),A=yo(u.bottom,0);h?$=m-2*(D!==0||N!==0?D+N:yo(u.left,u.right)):O=b-2*(k!==0||A!==0?k+A:yo(u.top,u.bottom))}await l({...e,availableWidth:$,availableHeight:O});const M=await s.getDimensions(a.floating);return m!==M.width||b!==M.height?{reset:{rects:!0}}:{}}}};function Jp(){return typeof window<"u"}function Vl(t){return Zb(t)?(t.nodeName||"").toLowerCase():"#document"}function wr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ns(t){var e;return(e=(Zb(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Zb(t){return Jp()?t instanceof Node||t instanceof wr(t).Node:!1}function mi(t){return Jp()?t instanceof Element||t instanceof wr(t).Element:!1}function Qi(t){return Jp()?t instanceof HTMLElement||t instanceof wr(t).HTMLElement:!1}function kw(t){return!Jp()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof wr(t).ShadowRoot}function mf(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=gi(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(r)}function GP(t){return["table","td","th"].includes(Vl(t))}function em(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function Qb(t){const e=Jb(),n=mi(t)?gi(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 qP(t){let e=Sa(t);for(;Qi(e)&&!zc(e);){if(Qb(e))return e;if(em(e))return null;e=Sa(e)}return null}function Jb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function zc(t){return["html","body","#document"].includes(Vl(t))}function gi(t){return wr(t).getComputedStyle(t)}function tm(t){return mi(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Sa(t){if(Vl(t)==="html")return t;const e=t.assignedSlot||t.parentNode||kw(t)&&t.host||ns(t);return kw(e)?e.host:e}function z3(t){const e=Sa(t);return zc(e)?t.ownerDocument?t.ownerDocument.body:t.body:Qi(e)&&mf(e)?e:z3(e)}function Ed(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=z3(t),i=r===((o=t.ownerDocument)==null?void 0:o.body),s=wr(r);if(i){const a=t1(s);return e.concat(s,s.visualViewport||[],mf(r)?r:[],a&&n?Ed(a):[])}return e.concat(r,Ed(r,[],n))}function t1(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function H3(t){const e=gi(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=Qi(t),i=r?t.offsetWidth:n,s=r?t.offsetHeight:o,a=m0(n)!==i||m0(o)!==s;return a&&(n=i,o=s),{width:n,height:o,$:a}}function ey(t){return mi(t)?t:t.contextElement}function Cc(t){const e=ey(t);if(!Qi(e))return qi(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:i}=H3(e);let s=(i?m0(n.width):n.width)/o,a=(i?m0(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const YP=qi(0);function W3(t){const e=wr(t);return!Jb()||!e.visualViewport?YP:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function jP(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==wr(t)?!1:e}function kl(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=ey(t);let s=qi(1);e&&(o?mi(o)&&(s=Cc(o)):s=Cc(t));const a=jP(i,n,o)?W3(i):qi(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=wr(i),h=o&&mi(o)?wr(o):o;let m=f,b=t1(m);for(;b&&o&&h!==m;){const g=Cc(b),v=b.getBoundingClientRect(),y=gi(b),x=v.left+(b.clientLeft+parseFloat(y.paddingLeft))*g.x,_=v.top+(b.clientTop+parseFloat(y.paddingTop))*g.y;l*=g.x,c*=g.y,u*=g.x,d*=g.y,l+=x,c+=_,m=wr(b),b=t1(m)}}return Fc({width:u,height:d,x:l,y:c})}function ty(t,e){const n=tm(t).scrollLeft;return e?e.left+n:kl(ns(t)).left+n}function U3(t,e,n){n===void 0&&(n=!1);const o=t.getBoundingClientRect(),r=o.left+e.scrollLeft-(n?0:ty(t,o)),i=o.top+e.scrollTop;return{x:r,y:i}}function XP(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const i=r==="fixed",s=ns(o),a=e?em(e.floating):!1;if(o===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=qi(1);const u=qi(0),d=Qi(o);if((d||!d&&!i)&&((Vl(o)!=="body"||mf(s))&&(l=tm(o)),Qi(o))){const h=kl(o);c=Cc(o),u.x=h.x+o.clientLeft,u.y=h.y+o.clientTop}const f=s&&!d&&!i?U3(s,l,!0):qi(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 KP(t){return Array.from(t.getClientRects())}function ZP(t){const e=ns(t),n=tm(t),o=t.ownerDocument.body,r=yo(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=yo(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+ty(t);const a=-n.scrollTop;return gi(o).direction==="rtl"&&(s+=yo(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:a}}function QP(t,e){const n=wr(t),o=ns(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=Jb();(!c||c&&e==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}return{width:i,height:s,x:a,y:l}}function JP(t,e){const n=kl(t,!0,e==="fixed"),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=Qi(t)?Cc(t):qi(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 Cw(t,e,n){let o;if(e==="viewport")o=QP(t,n);else if(e==="document")o=ZP(ns(t));else if(mi(e))o=JP(e,n);else{const r=W3(t);o={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return Fc(o)}function G3(t,e){const n=Sa(t);return n===e||!mi(n)||zc(n)?!1:gi(n).position==="fixed"||G3(n,e)}function e7(t,e){const n=e.get(t);if(n)return n;let o=Ed(t,[],!1).filter(a=>mi(a)&&Vl(a)!=="body"),r=null;const i=gi(t).position==="fixed";let s=i?Sa(t):t;for(;mi(s)&&!zc(s);){const a=gi(s),l=Qb(s);!l&&a.position==="fixed"&&(r=null),(i?!l&&!r:!l&&a.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||mf(s)&&!l&&G3(t,s))?o=o.filter(u=>u!==s):r=a,s=Sa(s)}return e.set(t,o),o}function t7(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const s=[...n==="clippingAncestors"?em(e)?[]:e7(e,this._c):[].concat(n),o],a=s[0],l=s.reduce((c,u)=>{const d=Cw(e,u,r);return c.top=yo(d.top,c.top),c.right=pi(d.right,c.right),c.bottom=pi(d.bottom,c.bottom),c.left=yo(d.left,c.left),c},Cw(e,a,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function n7(t){const{width:e,height:n}=H3(t);return{width:e,height:n}}function o7(t,e,n){const o=Qi(e),r=ns(e),i=n==="fixed",s=kl(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const l=qi(0);if(o||!o&&!i)if((Vl(e)!=="body"||mf(r))&&(a=tm(e)),o){const f=kl(e,!0,i,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else r&&(l.x=ty(r));const c=r&&!o&&!i?U3(r,a):qi(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 Tg(t){return gi(t).position==="static"}function Aw(t,e){if(!Qi(t)||gi(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return ns(t)===n&&(n=n.ownerDocument.body),n}function q3(t,e){const n=wr(t);if(em(t))return n;if(!Qi(t)){let r=Sa(t);for(;r&&!zc(r);){if(mi(r)&&!Tg(r))return r;r=Sa(r)}return n}let o=Aw(t,e);for(;o&&GP(o)&&Tg(o);)o=Aw(o,e);return o&&zc(o)&&Tg(o)&&!Qb(o)?n:o||qP(t)||n}const r7=async function(t){const e=this.getOffsetParent||q3,n=this.getDimensions,o=await n(t.floating);return{reference:o7(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function i7(t){return gi(t).direction==="rtl"}const s7={convertOffsetParentRelativeRectToViewportRelativeRect:XP,getDocumentElement:ns,getClippingRect:t7,getOffsetParent:q3,getElementRects:r7,getClientRects:KP,getDimensions:n7,getScale:Cc,isElement:mi,isRTL:i7};function a7(t,e){let n=null,o;const r=ns(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=qf(u),m=qf(r.clientWidth-(c+d)),b=qf(r.clientHeight-(u+f)),g=qf(c),y={rootMargin:-h+"px "+-m+"px "+-b+"px "+-g+"px",threshold:yo(0,pi(1,l))||1};let x=!0;function _(C){const L=C[0].intersectionRatio;if(L!==l){if(!x)return s();L?s(!1,L):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 Y3(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=ey(t),u=r||i?[...c?Ed(c):[],...Ed(e)]:[];u.forEach(v=>{r&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=c&&a?a7(c,n):null;let f=-1,h=null;s&&(h=new ResizeObserver(v=>{let[y]=v;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 m,b=l?kl(t):null;l&&g();function g(){const v=kl(t);b&&(v.x!==b.x||v.y!==b.y||v.width!==b.width||v.height!==b.height)&&n(),b=v,m=requestAnimationFrame(g)}return n(),()=>{var v;u.forEach(y=>{r&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),d==null||d(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(m)}}const j3=HP,l7=IP,X3=WP,K3=RP,Z3=UP,c7=NP,u7=DP,d7=VP,f7=(t,e,n)=>{const o=new Map,r={platform:s7,...n},i={...r.platform,_c:o};return PP(t,e,{...r,platform:i})};function h7(t){return t!=null&&typeof t=="object"&&"$el"in t}function n1(t){if(h7(t)){const e=t.$el;return Zb(e)&&Vl(e)==="#comment"?null:e}return t}function dc(t){return typeof t=="function"?t():p(t)}function p7(t){return{name:"arrow",options:t,fn(e){const n=n1(dc(t.element));return n==null?{}:u7({element:n,padding:t.padding}).fn(e)}}}function Q3(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function $w(t,e){const n=Q3(t);return Math.round(e*n)/n}function J3(t,e,n){n===void 0&&(n={});const o=n.whileElementsMounted,r=S(()=>{var O;return(O=dc(n.open))!=null?O:!0}),i=S(()=>dc(n.middleware)),s=S(()=>{var O;return(O=dc(n.placement))!=null?O:"bottom"}),a=S(()=>{var O;return(O=dc(n.strategy))!=null?O:"absolute"}),l=S(()=>{var O;return(O=dc(n.transform))!=null?O:!0}),c=S(()=>n1(t.value)),u=S(()=>n1(e.value)),d=Ie(0),f=Ie(0),h=Ie(a.value),m=Ie(s.value),b=De({}),g=Ie(!1),v=S(()=>{const O={position:h.value,left:"0",top:"0"};if(!u.value)return O;const $=$w(u.value,d.value),M=$w(u.value,f.value);return l.value?{...O,transform:"translate("+$+"px, "+M+"px)",...Q3(u.value)>=1.5&&{willChange:"transform"}}:{position:h.value,left:$+"px",top:M+"px"}});let y;function x(){if(c.value==null||u.value==null)return;const O=r.value;f7(c.value,u.value,{middleware:i.value,placement:s.value,strategy:a.value}).then($=>{d.value=$.x,f.value=$.y,h.value=$.strategy,m.value=$.placement,b.value=$.middlewareData,g.value=O!==!1})}function _(){typeof y=="function"&&(y(),y=void 0)}function C(){if(_(),o===void 0){x();return}if(c.value!=null&&u.value!=null){y=o(c.value,u.value,x);return}}function L(){r.value||(g.value=!1)}return He([i,s,a,r],x,{flush:"sync"}),He([c,u],C,{flush:"sync"}),He(r,L,{flush:"sync"}),Rl()&&ya(_),{x:tl(d),y:tl(f),strategy:tl(h),placement:tl(m),middlewareData:tl(b),isPositioned:tl(g),floatingStyles:v,update:x}}const m7=M3(pP),g7=["id"],v7=["id"],b7=le({inheritAttrs:!1,__name:"BPopover",props:rt({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:rt(["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=zt(t,"BPopover"),i=n,s=ts(),a=ht(t,"modelValue"),l=_o(()=>r.id,"popover"),c=Ie(!1),u=ft("_element"),d=ft("_content"),f=ft("_arrow"),h=ft("_placeholder"),m=Ie(null),b=Ie(null),g=S(()=>r.placement.startsWith("auto")),v=Sl(()=>r.offset??NaN),y=S(()=>ny(r.boundary)?r.boundary:void 0),x=S(()=>t4(r.boundary)?r.boundary:void 0),_=Ie({}),C=S(()=>{if(r.floatingMiddleware!==void 0)return r.floatingMiddleware;const W=r.offset!==null?v.value:r.tooltip?6:8,j=[j3(W)];return r.noFlip===!1&&!g.value&&j.push(K3({boundary:y.value,rootBoundary:x.value,padding:r.boundaryPadding})),g.value&&j.push(l7({alignment:r.placement.split("-")[1]||void 0,boundary:y.value,rootBoundary:x.value,padding:r.boundaryPadding})),r.noShift===!1&&j.push(X3({boundary:y.value,rootBoundary:x.value,padding:r.boundaryPadding})),r.noHide===!1&&j.push(c7({boundary:y.value,rootBoundary:x.value,padding:r.boundaryPadding})),r.inline===!0&&j.push(d7()),j.push(p7({element:f,padding:10})),r.noSize===!1&&j.push(Z3({boundary:y.value,rootBoundary:x.value,padding:r.boundaryPadding,apply({availableWidth:ue,availableHeight:de}){var fe,pe;_.value={maxHeight:de>=(((fe=d.value)==null?void 0:fe.scrollHeight)??0)?void 0:de?`${Math.max(0,de)}px`:void 0,maxWidth:ue>=(((pe=d.value)==null?void 0:pe.scrollWidth)??0)?void 0:ue?`${Math.max(0,ue)}px`:void 0}}})),j}),L=S(()=>g.value?void 0:r.placement),{floatingStyles:O,middlewareData:$,placement:M,update:D}=J3(m,u,{placement:L,middleware:C,strategy:Ft(()=>r.strategy)}),N=Ie({position:"absolute"});He($,W=>{var j,ue;if(r.noHide===!1&&((j=W.hide)!=null&&j.referenceHidden&&!c.value&&A.value?r.closeOnHide&&!r.noAutoClose&&!r.manual?z("close-on-hide"):(Z.value=!0,c.value=!0):Z.value&&!((ue=W.hide)!=null&&ue.referenceHidden)&&(Z.value=!1,c.value=!1)),W.arrow){const{x:de,y:fe}=W.arrow;N.value={position:"absolute",top:fe?`${fe}px`:"",left:de?`${de}px`:""}}});let k;const{showRef:A,hide:B,show:P,toggle:F,throttleHide:z,computedNoAnimation:V,transitionProps:G,contentShowing:ie,isVisible:ce,renderRef:he,localTemporaryHide:Z}=Zp(a,r,i,u,l,{showFn:()=>{D(),_n(()=>{k=Y3(m.value,u.value,D,{animationFrame:r.realtime})})},hideFn:()=>{k&&(k(),k=void 0)}}),oe=S(()=>{const W=r.tooltip?"tooltip":"popover";return[W,`b-${W}`,{[`b-${W}-${r.variant}`]:r.variant!==null,show:ce.value&&!c.value,fade:!V.value,[`${r.customClass}`]:r.customClass!==void 0,[`bs-${W}-${y7(M.value)}`]:M.value!==void 0}]}),{x:se,y:re}=m7(),U=()=>{var W,j;const ue=(W=b.value)==null?void 0:W.getBoundingClientRect(),de=(j=u.value)==null?void 0:j.getBoundingClientRect(),fe=parseInt(r.hideMargin,10)||0,pe=(window==null?void 0:window.scrollX)||0,J=(window==null?void 0:window.scrollY)||0,X=!ue||se.value<ue.left+pe-fe||se.value>ue.right+pe+fe||re.value<ue.top+J-fe||re.value>ue.bottom+J+fe,ee=!de||se.value<de.left+pe-fe||se.value>de.right+pe+fe||re.value<de.top+J-fe||re.value>de.bottom+J+fe;return{triggerIsOutside:X,isOutside:ee}};let te;const ne=W=>{var j,ue,de;const fe=typeof r.delay=="number"?r.delay:((j=r.delay)==null?void 0:j.hide)||0,{triggerIsOutside:pe,isOutside:J}=U();!r.noninteractive&&J&&pe&&!((ue=u.value)!=null&&ue.contains(document==null?void 0:document.activeElement))&&!((de=b.value)!=null&&de.contains(document==null?void 0:document.activeElement))||r.noninteractive&&pe?B(W==null?void 0:W.type):(te&&clearTimeout(te),te=setTimeout(()=>{ne(W)},fe<50?50:fe))};He(ce,()=>{D()}),e({hide:B,show:P,toggle:F});const ve=W=>{A.value?B(W.type==="click"?"click":"toggle"):P()},me=()=>{var W;if(r.target){const j=h0(bt(r.target));j?b.value=j:console.warn("Target element not found",r.target)}else b.value=(W=h.value)==null?void 0:W.nextElementSibling;if(r.reference){const j=h0(bt(r.reference));j?m.value=j:console.warn("Reference element not found",r.reference)}else m.value=b.value;if(!(!b.value||r.manual)){if(r.click){b.value.addEventListener("click",ve);return}b.value.addEventListener("pointerenter",P),b.value.addEventListener("pointerleave",ne),b.value.addEventListener("focus",P),b.value.addEventListener("blur",ne)}},I=()=>{b.value&&(b.value.removeEventListener("click",ve),b.value.removeEventListener("pointerenter",P),b.value.removeEventListener("pointerleave",ne),b.value.removeEventListener("focus",P),b.value.removeEventListener("blur",ne))};return L3(u,()=>{A.value&&r.click&&!r.noAutoClose&&!r.manual&&B("click-outside")},{ignore:[b]}),He([()=>r.click,()=>r.target,()=>r.reference],()=>{I(),me()}),fn(()=>{me(),_n(()=>{D()})}),Ds(I),(W,j)=>(w(),R(Ne,null,[T("span",{id:p(l)+"_placeholder",ref:"_placeholder",style:{display:"none"}},null,8,g7),Se(W.$slots,"target",{show:p(P),hide:p(B),toggle:p(F),visible:p(A)},void 0,!0),H(Kp,{to:p(r).teleportTo,disabled:!p(r).teleportTo||p(r).teleportDisabled},{default:Q(()=>[p(he)||p(ie)?(w(),K(_l,Ct({key:0},p(G),{appear:a.value||p(r).visible}),{default:Q(()=>[ir(T("div",Ct({id:p(l)},W.$attrs,{ref:"_element",class:oe.value,role:"tooltip",tabindex:"-1",style:p(O)}),[T("div",{ref:"_arrow",class:Me(`${p(r).tooltip?"tooltip":"popover"}-arrow`),style:Ot(N.value),"data-popper-arrow":""},null,6),T("div",{ref:"_content",class:"overflow-auto",style:Ot(_.value)},[p(r).title||s.title?(w(),R("div",{key:0,class:Me(["position-sticky top-0",p(r).tooltip?"tooltip-inner":"popover-header"])},[Se(W.$slots,"title",{},()=>[Ge(xe(p(r).title),1)],!0)],2)):ae("",!0),p(r).tooltip&&!s.title&&!p(r).title||!p(r).tooltip?(w(),R("div",{key:1,class:Me(p(r).tooltip?"tooltip-inner":"popover-body")},[Se(W.$slots,"default",{},()=>[Ge(xe(p(r).content),1)],!0)],2)):ae("",!0)],4)],16,v7),[[Rc,p(A)&&!c.value]])]),_:3},16,["appear"])):ae("",!0)]),_:3},8,["to","disabled"])],64))}}),e4=Qp(b7,[["__scopeId","data-v-9445feff"]]),y7=t=>{const[e]=t.split("-");switch(e){case"left":return"start";case"right":return"end";default:return e}},x7=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}},ny=t=>t==="clippingAncestors"||t instanceof Element||Array.isArray(t),t4=t=>!ny(t),w7=(t,e)=>[...e].reduce((n,o)=>(n[o]=t[o],n),{}),Du=(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},_7=["type","disabled","aria-label"],n4=le({__name:"BCloseButton",props:{ariaLabel:{default:"Close"},disabled:{type:Boolean,default:!1},type:{default:"button"}},emits:["click"],setup(t,{emit:e}){const o=zt(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,_7))}}),S7=(t=[])=>{const{activeElement:e}=document;return e&&!(t!=null&&t.some(n=>n===e))?e:null},k7=(t,e={})=>{const n=o=>o===S7();try{t.focus(e)}catch(o){console.error(o)}return n(t)},Hc=t=>((t==null?void 0:t())??[]).length===0,o4=t=>{if(t.getAttribute("display")==="none")return!1;const e=t.getBoundingClientRect();return!!(e&&e.height>0&&e.width>0)},$s=t=>S(()=>{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}}),C7={key:0,class:"visually-hidden"},A7=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=zt(t,"BSpinner"),o=ts(),r=$s(S(()=>({textVariant:n.variant}))),i=S(()=>[`spinner-${n.type}`,r.value,{[`spinner-${n.type}-sm`]:n.small}]),s=S(()=>!Hc(o.label));return(a,l)=>(w(),K(on(p(n).tag),{class:Me(i.value),role:p(n).label||s.value?p(n).role:null,"aria-hidden":p(n).label||s.value?null:!0},{default:Q(()=>[p(n).label||s.value?(w(),R("span",C7,[Se(a.$slots,"label",{},()=>[Ge(xe(p(n).label),1)])])):ae("",!0)]),_:3},8,["class","role","aria-hidden"]))}}),$7=t=>{const e=t.trim();return e.charAt(0).toUpperCase()+e.slice(1)},T7=t=>t.replace(/-./g,e=>e.charAt(1).toUpperCase()).replace(/\b\w/g,e=>e.toUpperCase()).replace(/\s+/g,""),M7=t=>!!(t.href||t.to),oy=(t,e)=>{const n=ro(Ft(e)),o=ro(Ft(t)),r=S(()=>M7(o.value)),i=S(()=>r.value?w7(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}},O7=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=on("RouterLink"),i=typeof r=="string"?null:r.useLink,s=Ft(t),a=Ft(()=>s.value.to||""),l=Ft(()=>s.value.replace),c=S(()=>T7(s.value.routerComponentName)),u=S(()=>!((e==null?void 0:e.appContext.app.component(c.value))!==void 0)||s.value.disabled||!s.value.to?"a":c.value),d=S(()=>u.value==="RouterLink"),f=S(()=>d.value&&typeof(e==null?void 0:e.appContext.app.$nuxt)<"u"),h=S(()=>u.value!=="a"&&!d.value&&!f.value),m=S(()=>d.value||f.value),b=S(()=>({to:a.value,replace:l.value})),g=i==null?void 0:i({to:a,replace:l}),v=S(()=>m.value?g:null),y=S(()=>{var x;if((x=v.value)!=null&&x.href.value)return v.value.href.value;const _="#";if(s.value.href)return s.value.href;if(typeof s.value.to=="string")return s.value.to||_;const{to:C}=s.value;if(C!==void 0&&"path"in C){const L=C.path||"",O=C.query?`?${Object.keys(C.query).map(M=>{var D;return`${M}=${(D=C.query)==null?void 0:D[M]}`}).join("=")}`:"",$=!C.hash||C.hash.charAt(0)==="#"?C.hash||"":`#${C.hash}`;return`${L}${O}${$}`||_}return _});return{isNonStandardTag:h,tag:u,isRouterLink:d,isNuxtLink:f,computedHref:y,routerName:c,router:n,route:o,link:v,linkProps:b}},r4=t=>S(()=>{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}}),Tw="active",ry=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=zt(t,"BLink"),r=e,i=Gp(),{computedHref:s,tag:a,link:l,isNuxtLink:c,isRouterLink:u,linkProps:d,isNonStandardTag:f}=O7(S(()=>({routerComponentName:o.routerComponentName,disabled:o.disabled,to:o.to,replace:o.replace,href:o.href}))),h=Jt(_3,null),m=Jt(C3,null),b=r4(o),g=S(()=>{var O,$;return[b.value,i.class,v.value,{[Tw]:o.active,[o.activeClass]:((O=l.value)==null?void 0:O.isActive.value)||!1,[o.exactActiveClass]:(($=l.value)==null?void 0:$.isExactActive.value)||!1,"stretched-link":o.stretched===!0}]}),v=S(()=>({[Tw]:o.active,disabled:o.disabled})),y=O=>{var $,M,D;if(o.disabled){O.preventDefault(),O.stopImmediatePropagation();return}((($=h==null?void 0:h.isNav)==null?void 0:$.value)===!0&&m===null||m!==null&&((M=m.autoClose)==null?void 0:M.value)===!0)&&((D=h==null?void 0:h.hide)==null||D.call(h)),r("click",O)},x=S(()=>o.target==="_blank"?!o.rel&&o.noRel?"noopener":o.rel:void 0),_=S(()=>o.disabled?"-1":typeof i.tabindex>"u"?null:i.tabindex),C=S(()=>({prefetch:o.prefetch,noPrefetch:o.noPrefetch,prefetchOn:o.prefetchOn,prefetchedClass:o.prefetchedClass,...d.value})),L=S(()=>({...u.value?d.value:void 0,...c.value||f.value?C.value:void 0}));return(O,$)=>(w(),K(on(p(a)),Ct({class:g.value,target:p(o).target,href:p(s),rel:x.value,tabindex:_.value,"aria-disabled":p(o).disabled?!0:null},L.value,{onClick:$[0]||($[0]=M=>{var D;y(M),(D=p(l))==null||D.navigate(M)})}),{default:Q(()=>[Se(O.$slots,"default")]),_:3},16,["class","target","href","rel","tabindex","aria-disabled"]))}}),Wo=le({__name:"BButton",props:rt({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:rt(["click"],["update:pressed"]),setup(t,{emit:e}){const o=zt(t,"BButton"),r=e,i=ft("_element"),s=ht(t,"pressed"),{computedLink:a,computedLinkProps:l}=oy(o,["active-class","exact-active-class","replace","routerComponentName","routerTag"]),c=S(()=>typeof s.value=="boolean"),u=S(()=>o.tag==="button"&&o.href===void 0&&o.to===void 0),d=S(()=>o.to!==void 0),f=S(()=>o.href!==void 0?!1:!u.value),h=S(()=>d.value?l.value:[]),m=S(()=>o.href==="#"&&o.disabled?!0:f.value?o.disabled:null),b=S(()=>{var C;return((C=o.variant)==null?void 0:C.startsWith("link"))||!1}),g=S(()=>{var C;return((C=o.variant)==null?void 0:C.startsWith("link-"))||!1}),v=r4(S(()=>{var C;return{...b.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:g.value===!0?(C=o.variant)==null?void 0:C.slice(5):null}:void 0}})),y=S(()=>[b.value===!0&&a.value===!1?v.value:void 0,[`btn-${o.size}`],{[`btn-${o.variant}`]:o.variant!==null&&g.value===!1,active:o.active||s.value,"rounded-pill":o.pill,"rounded-0":o.squared,disabled:o.disabled}]),x=S(()=>d.value?ry:o.href?"a":o.tag),_=C=>{if(o.disabled){C.preventDefault(),C.stopPropagation();return}r("click",C),c.value&&(s.value=!s.value)};return gs([" ","enter"],C=>{var L;o.href==="#"&&(C.preventDefault(),(L=i.value)==null||L.click())},{target:i}),(C,L)=>(w(),K(on(x.value),Ct({ref:"_element",class:"btn"},h.value,{class:y.value,"aria-disabled":m.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:Q(()=>[p(o).loading?Se(C.$slots,"loading",{key:0},()=>[p(o).loadingFill?ae("",!0):(w(),R(Ne,{key:0},[Ge(xe(p(o).loadingText),1)],64)),Se(C.$slots,"loading-spinner",{},()=>[H(A7,{small:p(o).size!=="lg",label:p(o).loadingFill?p(o).loadingText:void 0},null,8,["small","label"])])]):Se(C.$slots,"default",{key:1})]),_:3},16,["class","aria-disabled","aria-pressed","autocomplete","disabled","href","rel","role","target","type","to"]))}}),nm=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,{}):Nt(t.tag,{...n},[(r=e.default)==null?void 0:r.call(e,{})])}}}),iy=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=zt(t,"BBadge"),{computedLink:o,computedLinkProps:r}=oy(n,["active","activeClass","append","disabled","href","rel","replace","routerComponentName","target","to","opacity","opacityHover","underlineVariant","underlineOffset","underlineOffsetHover","underlineOpacity","underlineOpacityHover","icon"]),i=S(()=>o.value?ry:n.tag),s=S(()=>{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=$s(n),l=S(()=>[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(),K(on(i.value),Ct({class:["badge",l.value]},p(r)),{default:Q(()=>[H(nm,Ct({skip:p(n).dotIndicator!==!0,tag:"span"},p(n).dotIndicator?{class:"visually-hidden"}:{}),{default:Q(()=>[Se(c.$slots,"default")]),_:3},16,["skip"])]),_:3},16,["class"]))}}),B7=(t,e="px")=>S(()=>{const n=bt(t),o=bt(e);return yP.test(String(n))?`${Number(n)}${o}`:n}),L7=le({__name:"BButtonGroup",props:{ariaLabel:{default:"Group"},size:{default:"md"},tag:{default:"div"},vertical:{type:Boolean,default:!1}},setup(t){Gi($3,!0);const n=zt(t,"BButtonGroup"),o=S(()=>({"btn-group":!n.vertical,[`btn-group-${n.size}`]:n.size!=="md","btn-group-vertical":n.vertical}));return(r,i)=>(w(),K(on(p(n).tag),{class:Me(o.value),role:"group","aria-label":p(n).ariaLabel},{default:Q(()=>[Se(r.$slots,"default")]),_:3},8,["class","aria-label"]))}}),Mg=(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),[]),Mw=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=zt(t,"BCol"),o=S(()=>[...Mg({sm:n.sm,md:n.md,lg:n.lg,xl:n.xl,xxl:n.xxl},["sm","md","lg","xl","xxl"],"col"),...Mg({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"),...Mg({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=S(()=>[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(),K(on(p(n).tag),{class:Me(r.value)},{default:Q(()=>[Se(i.$slots,"default")]),_:3},8,["class"]))}}),P7={class:"visually-hidden"},D7=["id","aria-labelledby","role"],E7=le({__name:"BDropdown",props:rt({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:rt(["split-click","hide","hide-prevented","hidden","show","show-prevented","shown","toggle","toggle-prevented"],["update:modelValue"]),setup(t,{expose:e,emit:n}){const r=zt(t,"BDropdown"),i=n,s=_o(()=>r.id,"dropdown"),a=ht(t,"modelValue"),l=Jt(zL,!1),c=Jt($3,!1),u=S(()=>typeof r.offset=="string"||typeof r.offset=="number"?r.offset:NaN),d=Sl(u),f=ft("_floating"),h=ft("_button"),m=ft("_splitButton"),b=S(()=>ny(r.boundary)?r.boundary:void 0),g=S(()=>t4(r.boundary)?r.boundary:void 0),v=S(()=>r.split?h.value:m.value),{showRef:y,renderRef:x,hide:_,show:C,toggle:L,computedNoAnimation:O,transitionProps:$,contentShowing:M,isVisible:D}=Zp(a,r,i,v,s),N=S(()=>[{show:D.value,fade:!O.value}]);gs("Escape",()=>{var Z;_(),(Z=h0(v.value))==null||Z.focus()},{target:v}),gs("Escape",()=>{var Z;_(),(Z=h0(v.value))==null||Z.focus()},{target:f});const k=(Z,oe)=>{var se,re,U,te,ne,ve,me;if((re=f.value)!=null&&re.contains((se=Z.target)==null?void 0:se.closest("form"))||/input|select|option|textarea|form/i.test((U=Z.target)==null?void 0:U.tagName))return;if(Z.preventDefault(),!y.value){C();const W=setInterval(()=>{D.value&&(clearInterval(W),_n(()=>k(Z,oe)))},16);return}const I=(te=f.value)==null?void 0:te.querySelectorAll(".dropdown-item:not(.disabled):not(:disabled)");if(I)if((ne=f.value)!=null&&ne.contains(document.activeElement)){const W=f.value.querySelector(".dropdown-item:focus"),j=Array.prototype.indexOf.call(I,W)+oe;j>=0&&j<(I==null?void 0:I.length)&&((ve=I[j])==null||ve.focus())}else(me=I[oe===-1?I.length-1:0])==null||me.focus()};gs("ArrowUp",Z=>k(Z,-1),{target:v}),gs("ArrowDown",Z=>k(Z,1),{target:v}),gs("ArrowUp",Z=>k(Z,-1),{target:f}),gs("ArrowDown",Z=>k(Z,1),{target:f});const A=Ie({}),B=S(()=>{if(r.floatingMiddleware!==void 0)return r.floatingMiddleware;const Z=typeof r.offset=="string"||typeof r.offset=="number"?d.value:r.offset,oe=[j3(Z)];return r.noFlip===!1&&oe.push(K3({boundary:b.value,rootBoundary:g.value,padding:r.boundaryPadding})),r.noShift===!1&&oe.push(X3({boundary:b.value,rootBoundary:g.value,padding:r.boundaryPadding})),r.noSize===!1&&oe.push(Z3({boundary:b.value,rootBoundary:g.value,padding:r.boundaryPadding,apply({availableWidth:se,availableHeight:re}){var U,te;A.value={maxHeight:re>=(((U=f.value)==null?void 0:U.scrollHeight)??0)?void 0:re?`${Math.max(0,re)}px`:void 0,maxWidth:se>=(((te=f.value)==null?void 0:te.scrollWidth)??0)?void 0:se?`${Math.max(0,se)}px`:void 0}}})),oe}),{update:P,floatingStyles:F}=J3(v,f,{placement:()=>r.placement,middleware:B,strategy:Ft(()=>r.strategy),whileElementsMounted:Y3}),z=c?{class:"btn-group",role:"group"}:void 0,V=S(()=>[z==null?void 0:z.class,r.wrapperClass,{"btn-group":!r.wrapperClass&&r.split,[`drop${x7(r.placement)}`]:!r.wrapperClass,"position-static":r.boundary!=="clippingAncestors"&&!r.isNav}]),G=S(()=>[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}]),ie=()=>{L()},ce=Z=>{if(r.split){i("split-click",Z);return}ie()};L3(f,()=>{y.value&&(r.autoClose===!0||r.autoClose==="outside")&&_()},{ignore:[h,m]});const he=()=>{y.value&&(r.autoClose===!0||r.autoClose==="inside")&&_()};return He(D,()=>{P()}),e({hide:_,show:C,toggle:L}),Gi(k3,{id:s,show:C,hide:_,toggle:L,visible:Ft(()=>y.value),isNav:Ft(()=>r.isNav)}),(Z,oe)=>{var se;return w(),K(nm,{skip:p(l)||p(r).noWrapper,class:Me(V.value),role:(se=p(z))==null?void 0:se.role},{default:Q(()=>[H(Wo,{id:p(s),ref:"_splitButton",variant:p(r).splitVariant||p(r).variant,size:p(r).size,class:Me(G.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:ce},{default:Q(()=>[Se(Z.$slots,"button-content",{},()=>[Ge(xe(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(),K(Wo,{key:0,id:p(s)+"-split",ref:"_button",variant:p(r).variant,size:p(r).size,disabled:p(r).disabled,class:Me([[p(r).toggleClass,{show:p(y)}],"dropdown-toggle-split dropdown-toggle"]),"aria-expanded":p(y),"aria-haspopup":"menu",onClick:ie},{default:Q(()=>[T("span",P7,[Se(Z.$slots,"toggle-text",{},()=>[Ge(xe(p(r).toggleText),1)],!0)])]),_:3},8,["id","variant","size","disabled","class","aria-expanded"])):ae("",!0),H(Kp,{to:p(r).teleportTo,disabled:!p(r).teleportTo||p(r).teleportDisabled},{default:Q(()=>[p(x)||p(M)?(w(),K(_l,Ct({key:0},p($),{appear:a.value||p(r).visible}),{default:Q(()=>[ir(T("ul",{id:p(s)+"-menu",ref:"_floating",style:Ot([p(F),A.value]),class:Me(["dropdown-menu overflow-auto",[p(r).menuClass,N.value]]),"aria-labelledby":p(s),role:p(r).role,onClick:he},[p(M)?Se(Z.$slots,"default",{key:0,hide:p(_),show:p(C),visible:p(y)},void 0,!0):ae("",!0)],14,D7),[[Rc,p(y)]])]),_:3},16,["appear"])):ae("",!0)]),_:3},8,["to","disabled"])]),_:3},8,["skip","class","role"])}}}),sy=Qp(E7,[["__scopeId","data-v-8ac2524d"]]),I7=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=zt(t,"BDropdownItem"),r=e,i=Gp(),s=S(()=>{const{class:g,...v}=i;return{wrapperClass:g,dropdownItemAttrs:v}}),{computedLink:a,computedLinkProps:l}=oy(o),c=$s(S(()=>({textVariant:o.variant}))),u=S(()=>[o.linkClass,c.value,{active:o.active,disabled:o.disabled}]),d=S(()=>a.value?ry:o.href?"a":"button"),f=Jt(_3,null),h=Jt(k3,null),m=Jt(C3,null),b=g=>{var v,y,x;r("click",g),m!==null&&((v=m==null?void 0:m.autoClose)==null?void 0:v.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(g,v)=>(w(),R("li",Ct({role:"presentation",class:s.value.wrapperClass},p(o).wrapperAttrs),[(w(),K(on(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:b}),{default:Q(()=>[Se(g.$slots,"default")]),_:3},16,["class","disabled","aria-disabled","aria-current","href","rel","type","target"]))],16))}}),R7=["disabled"],i4=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=zt(t,"BDropdownItemButton"),r=e,i=Gp(),s=S(()=>{const{class:u,...d}=i;return{wrapperClass:u,buttonAttrs:d}}),a=$s(S(()=>({textVariant:o.variant}))),l=S(()=>[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}),[Se(u.$slots,"default")],16,R7)],16))}}),N7=["value","disabled"],s4=le({__name:"BFormSelectOption",props:{disabled:{type:Boolean,default:!1},value:{default:void 0}},setup(t){const n=zt(t,"BFormSelectOption");return(o,r)=>(w(),R("option",{value:p(n).value,disabled:p(n).disabled},[Se(o.$slots,"default")],8,N7))}}),a4=(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=Du(s,a.valueField),c=Du(s,a.textField),u=Du(s,a.disabledField),d=a.optionsField?Du(s,a.optionsField):void 0;return d!==void 0?{label:Du(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:S(()=>r(bt(t))),isComplex:n}},F7=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=zt(t,"BFormInvalidFeedback"),o=S(()=>n.forceShow===!0||n.state===!1),r=S(()=>({"d-block":o.value,"invalid-feedback":!n.tooltip,"invalid-tooltip":n.tooltip}));return(i,s)=>(w(),K(on(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:Me(r.value)},{default:Q(()=>[Se(i.$slots,"default",{},()=>[Ge(xe(p(n).text),1)])]),_:3},8,["id","role","aria-live","aria-atomic","class"]))}}),V7=le({__name:"BFormRow",props:{tag:{default:"div"}},setup(t){const n=zt(t,"BFormRow");return(o,r)=>(w(),K(on(p(n).tag),{class:"row d-flex flex-wrap"},{default:Q(()=>[Se(o.$slots,"default")]),_:3}))}}),z7=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=zt(t,"BFormText"),o=$s(n),r=S(()=>[o.value,{"form-text":!n.inline}]);return(i,s)=>(w(),K(on(p(n).tag),{id:p(n).id,class:Me(r.value)},{default:Q(()=>[Se(i.$slots,"default",{},()=>[Ge(xe(p(n).text),1)])]),_:3},8,["id","class"]))}}),H7=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=zt(t,"BFormInvalidFeedback"),o=S(()=>n.forceShow===!0||n.state===!0),r=S(()=>({"d-block":o.value,"valid-feedback":!n.tooltip,"valid-tooltip":n.tooltip}));return(i,s)=>(w(),K(on(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:Me(r.value)},{default:Q(()=>[Se(i.$slots,"default",{},()=>[Ge(xe(p(n).text),1)])]),_:3},8,["id","role","aria-live","aria-atomic","class"]))}}),om=(t,e)=>S(()=>{const n=bt(t),o=bt(e);return n===!0?"true":typeof n=="string"?n:o===!1?"true":n===!1?"false":void 0}),rm=t=>S(()=>{const e=bt(t);return e===!0?"is-valid":e===!1?"is-invalid":null}),l4=t=>S(()=>{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}}),c4=t=>{const e=ro(Ft(t)),n=rm(()=>e.value.state??null);return S(()=>[n.value,{"form-check-input":e.value.plain===!1&&e.value.button===!1,"btn-check":e.value.button===!0}])},u4=t=>S(()=>{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"}}),W7=t=>{const e=ro(Ft(t)),n=om(()=>e.value.ariaInvalid,()=>e.value.state);return S(()=>({"aria-invalid":n.value,"aria-required":e.value.required===!0?!0:void 0}))},U7=t=>S(()=>{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}}),G7=["id","disabled","required","name","form","aria-label","aria-labelledby","aria-required","value","true-value","false-value","indeterminate"],q7=["for"],Ts=le({inheritAttrs:!1,__name:"BFormCheckbox",props:rt({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=Gp(),o=S(()=>{const{class:O,...$}=n;return{wrapperClass:O,inputAttrs:$}}),i=zt(t,"BFormCheckbox"),s=ts(),a=ht(t,"modelValue"),l=ht(t,"indeterminate"),c=_o(()=>i.id,"form-check"),u=Jt(NL,null),d=ft("_input"),{focused:f}=Vi(d,{initialValue:i.autofocus}),h=S(()=>!Hc(s.default)),m=S({get:()=>u?u.modelValue.value:a.value,set:O=>{if(O!==void 0){if(l.value=!1,u!==null&&Array.isArray(O)){u.modelValue.value=O;return}a.value=O}}}),b=S(()=>!!(i.name??(u==null?void 0:u.name.value))&&(i.required||(u==null?void 0:u.required.value))),g=S(()=>i.buttonGroup||((u==null?void 0:u.buttons.value)??!1)),v=S(()=>({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=l4(v),x=S(()=>[y.value,o.value.wrapperClass]),_=c4(v),C=S(()=>[_.value,i.inputClass]),L=u4(v);return e({blur:()=>{f.value=!1},element:d,focus:()=>{f.value=!0}}),(O,$)=>(w(),K(nm,Ct({skip:g.value},p(i).wrapperAttrs,{class:x.value}),{default:Q(()=>{var M,D,N;return[ir(T("input",Ct({id:p(c),ref:"_input","onUpdate:modelValue":$[0]||($[0]=k=>m.value=k),class:C.value,type:"checkbox",disabled:p(i).disabled||((M=p(u))==null?void 0:M.disabled.value),required:b.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":b.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,G7),[[f3,m.value]]),h.value||p(i).plain===!1?(w(),R("label",{key:0,for:p(c),class:Me(p(L))},[Se(O.$slots,"default")],10,q7)):ae("",!0)]}),_:3},16,["skip","class"]))}}),Ow=(t,e)=>e+(t?$7(t):""),Y7={key:0,ref:"_content",class:"form-floating"},Mn=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=zt(t,"BFormGroup"),r=ts(),i=mw(),s=mw(),a=Ft(()=>o.state),l=Ie([]);Gi(T3,k=>(l.value=[k],{state:a}));const c=S(()=>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=(k,A)=>u.reduce((B,P)=>{const F=Ow(P==="xs"?"":P,`${A}Cols`);let z=k[F];if(z=z===""?!0:z||!1,typeof z!="boolean"&&z!=="auto"){const V=Number.parseInt(z);z=Number.isNaN(V)?0:V,z=z>0?z:!1}return z&&(P==="xs"?B[typeof z=="boolean"?"col":"cols"]=z:B[P||(typeof z=="boolean"?"col":"cols")]=z),B},{}),f=ft("_content"),h=S(()=>d(o,"content")),m=S(()=>((k,A)=>u.reduce((B,P)=>{const F=Ow(P==="xs"?"":P,`${A}Align`),z=k[F]||null;return z&&(P==="xs"?B.push(`text-${z}`):B.push(`text-${P}-${z}`)),B},[]))(o,"label")),b=S(()=>d(o,"label")),g=S(()=>Object.keys(h.value).length>0||Object.keys(b.value).length>0),v=rm(a),y=om(()=>o.ariaInvalid,a),x=k=>{if(c.value||f.value===null)return;const{target:A}=k,B=A?A.tagName:"";if([...e,"a","button","label"].indexOf(B)!==-1)return;const P=[...f.value.querySelectorAll(e.map(z=>`${z}:not([disabled])`).join())].filter(o4),[F]=P;P.length===1&&F instanceof HTMLElement&&k7(F)},_=_o(()=>o.id),C=_o(void 0,"_BV_label_"),L=S(()=>c.value?"label":"legend"),O=S(()=>[g.value?"col-form-label":"form-label",{"bv-no-focus-ring":!c.value,"col-form-label":g.value||!c.value,"pt-0":!g.value&&!c.value,"d-block":!g.value&&c.value,[`col-form-label-${o.labelSize}`]:!!o.labelSize,"visually-hidden":o.labelVisuallyHidden},m.value,o.labelClass]),$=_o(void 0,"_BV_feedback_invalid_"),M=_o(void 0,"_BV_feedback_valid_"),D=_o(void 0,"_BV_description_"),N=S(()=>!c.value);return(k,A)=>(w(),K(on(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&&g.value?p(C):null,class:Me([[p(v),{"was-validated":p(o).validated}],"b-form-group"])},{default:Q(()=>[H(p(s).define,null,{default:Q(()=>[r["invalid-feedback"]||p(o).invalidFeedback?(w(),K(F7,{key:0,id:p($),"aria-live":p(o).feedbackAriaLive,state:a.value,tooltip:p(o).tooltip},{default:Q(()=>[Se(k.$slots,"invalid-feedback",{},()=>[Ge(xe(p(o).invalidFeedback),1)])]),_:3},8,["id","aria-live","state","tooltip"])):ae("",!0),r["valid-feedback"]||p(o).validFeedback?(w(),K(H7,{key:1,id:p(M),"aria-live":p(o).feedbackAriaLive,state:a.value,tooltip:p(o).tooltip},{default:Q(()=>[Se(k.$slots,"valid-feedback",{},()=>[Ge(xe(p(o).validFeedback),1)])]),_:3},8,["id","aria-live","state","tooltip"])):ae("",!0),r.description||p(o).description?(w(),K(z7,{key:2,id:p(D)},{default:Q(()=>[Se(k.$slots,"description",{},()=>[Ge(xe(p(o).description),1)])]),_:3},8,["id"])):ae("",!0)]),_:3}),H(p(i).define,null,{default:Q(()=>[r.label||p(o).label||g.value?(w(),R(Ne,{key:0},[g.value?(w(),K(Mw,Vn(Ct({key:0},b.value)),{default:Q(()=>[(w(),K(on(L.value),{id:p(C),for:c.value||null,tabindex:N.value?"-1":null,class:Me(O.value),onClick:A[0]||(A[0]=B=>N.value?x:null)},{default:Q(()=>[Se(k.$slots,"label",{},()=>[Ge(xe(p(o).label),1)])]),_:3},8,["id","for","tabindex","class"]))]),_:3},16)):(w(),K(on(L.value),{key:1,id:p(C),for:c.value||null,tabindex:N.value?"-1":null,class:Me(O.value),onClick:A[1]||(A[1]=B=>N.value?x:null)},{default:Q(()=>[Se(k.$slots,"label",{},()=>[Ge(xe(p(o).label),1)])]),_:3},8,["id","for","tabindex","class"]))],64)):ae("",!0)]),_:3}),g.value?(w(),K(V7,{key:0},{default:Q(()=>[H(p(i).reuse),H(Mw,Ct(h.value,{ref:"_content"}),{default:Q(()=>[Se(k.$slots,"default",{id:p(_),ariaDescribedby:null,descriptionId:p(D),labelId:p(C)}),H(p(s).reuse)]),_:3},16)]),_:3})):(w(),R(Ne,{key:1},[p(o).floating&&!g.value?(w(),R("div",Y7,[Se(k.$slots,"default",{id:p(_),ariaDescribedby:null,descriptionId:p(D),labelId:p(C)}),H(p(i).reuse),H(p(s).reuse)],512)):(w(),R(Ne,{key:1},[H(p(i).reuse),Se(k.$slots,"default",{id:p(_),ariaDescribedby:null,descriptionId:p(D),labelId:p(C)}),H(p(s).reuse)],64))],64))]),_:3},8,["id","disabled","role","aria-invalid","aria-labelledby","class"]))}}),d4=(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},f4=(t,e,n,o)=>{var r;const i=Ie(0),s=_o(()=>t.id,"input"),a=Sl(()=>t.debounce??0),l=Sl(()=>t.debounceMaxWait??NaN),c=(r=Jt(T3,null))==null?void 0:r(s),u=S(()=>t.state!==void 0?t.state:(c==null?void 0:c.state.value)??null),d=om(()=>t.ariaInvalid,u),f=rm(u),h=oP(L=>{n.value=L},()=>o.lazy===!0?0:a.value,{maxWait:()=>o.lazy===!0?NaN:l.value}),m=(L,O=!1)=>{o.lazy===!0&&O===!1||h(L)},{focused:b}=Vi(e,{initialValue:t.autofocus}),g=(L,O,$=!1)=>t.formatter!==void 0&&(!t.lazyFormatter||$)?t.formatter(L,O):L;return fn(()=>{var L;e.value&&(e.value.value=((L=n.value)==null?void 0:L.toString())??"")}),zb(()=>{_n(()=>{t.autofocus&&(b.value=!0)})}),{input:e,computedId:s,computedAriaInvalid:d,onInput:L=>{const{value:O}=L.target,$=g(O,L);if(L.defaultPrevented){L.preventDefault();return}m($)},onChange:L=>{const{value:O}=L.target,$=g(O,L);if(L.defaultPrevented){L.preventDefault();return}const M=$;n.value!==M&&m($,!0)},onBlur:L=>{if(!o.lazy&&!t.lazyFormatter&&!o.trim)return;const{value:O}=L.target,$=g(O,L,!0),M=o.trim?$.trim():$,D=M.length!==$.length;n.value!==M&&m($,!0),o.trim&&D&&(i.value=i.value+1)},focus:()=>{t.disabled||(b.value=!0)},blur:()=>{t.disabled||(b.value=!1)},forceUpdateKey:i,stateClass:f}},j7=["id","value","name","form","type","disabled","placeholder","required","autocomplete","readonly","min","max","step","list","aria-required","aria-invalid"],Ws=le({__name:"BFormInput",props:rt({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=zt(t,"BFormInput"),[r,i]=ht(t,"modelValue",{set:v=>d4(v,i)}),s=ft("_input"),{computedId:a,computedAriaInvalid:l,onInput:c,onChange:u,onBlur:d,stateClass:f,focus:h,blur:m,forceUpdateKey:b}=f4(o,s,r,i),g=S(()=>{const v=o.type==="range",y=o.type==="color";return[f.value,{"form-range":v,"form-control":y||!o.plaintext&&!v,"form-control-color":y,"form-control-plaintext":o.plaintext&&!v&&!y,[`form-control-${o.size}`]:!!o.size}]});return e({blur:m,element:s,focus:h}),(v,y)=>(w(),R("input",{id:p(a),ref:"_input",key:p(b),value:p(r),class:Me(g.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,j7))}}),X7=["id","disabled","required","name","form","aria-label","aria-labelledby","value","aria-required"],K7=["for"],Z7=le({inheritAttrs:!1,__name:"BFormRadio",props:rt({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=zt(t,"BFormRadio"),r=ts(),i=ht(t,"modelValue"),s=_o(()=>o.id,"form-check"),a=Jt(w3,null),l=ft("_input"),{focused:c}=Vi(l,{initialValue:o.autofocus}),u=S(()=>!Hc(r.default)),d=S({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=S(()=>!!(o.name??(a==null?void 0:a.name.value))&&(o.required||(a==null?void 0:a.required.value))),h=S(()=>o.buttonGroup||((a==null?void 0:a.buttons.value)??!1)),m=S(()=>({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})),b=l4(m),g=c4(m),v=u4(m);return e({blur:()=>{c.value=!1},element:l,focus:()=>{c.value=!0}}),(y,x)=>(w(),K(nm,{skip:h.value,class:Me(p(b))},{default:Q(()=>{var _,C,L;return[ir(T("input",Ct({id:p(s)},y.$attrs,{ref:"_input","onUpdate:modelValue":x[0]||(x[0]=O=>d.value=O),class:p(g),type:"radio",disabled:p(o).disabled||((_=p(a))==null?void 0:_.disabled.value),required:f.value||void 0,name:p(o).name||((C=p(a))==null?void 0:C.name.value),form:p(o).form||((L=p(a))==null?void 0:L.form.value),"aria-label":p(o).ariaLabel,"aria-labelledby":p(o).ariaLabelledby,value:p(o).value,"aria-required":f.value||void 0}),null,16,X7),[[vL,d.value]]),u.value||p(o).plain===!1?(w(),R("label",{key:0,for:p(s),class:Me(p(v))},[Se(y.$slots,"default")],10,K7)):ae("",!0)]}),_:3},8,["skip","class"]))}}),Q7=["id"],J7=le({__name:"BFormRadioGroup",props:rt({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=zt(t,"BFormRadioGroup"),r=ht(t,"modelValue"),i=_o(()=>o.id,"radio"),s=_o(()=>o.name,"checkbox"),a=ft("_element"),{focused:l}=Vi(a,{initialValue:o.autofocus});Gi(w3,{modelValue:r,buttonVariant:Ft(()=>o.buttonVariant),form:Ft(()=>o.form),name:s,buttons:Ft(()=>o.buttons),state:Ft(()=>o.state),plain:Ft(()=>o.plain),size:Ft(()=>o.size),inline:Ft(()=>!o.stacked),reverse:Ft(()=>o.reverse),required:Ft(()=>o.required),disabled:Ft(()=>o.disabled)});const c=S(()=>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=S(()=>({required:o.required,ariaInvalid:o.ariaInvalid,state:o.state,validated:o.validated,buttons:o.buttons,stacked:o.stacked,size:o.size})),d=W7(u),f=U7(u);return e({blur:()=>{l.value=!1},focus:()=>{l.value=!0}}),(h,m)=>(w(),R("div",Ct(p(d),{id:p(i),ref:"_element",role:"radiogroup",class:[p(f),"bv-no-focus-ring"],tabindex:"-1"}),[Se(h.$slots,"first"),(w(!0),R(Ne,null,gt(c.value,(b,g)=>(w(),K(Z7,Ct({key:g,ref_for:!0},b),{default:Q(()=>[Se(h.$slots,"option",Ct({ref_for:!0},b),()=>[Ge(xe(b.text),1)])]),_:2},1040))),128)),Se(h.$slots,"default")],16,Q7))}}),eD=["label"],tD=le({__name:"BFormSelectOptionGroup",props:{disabledField:{default:"disabled"},label:{default:void 0},options:{default:()=>[]},textField:{default:"text"},valueField:{default:"value"}},setup(t){const n=zt(t,"BFormSelectOptionGroup"),{normalizedOptions:o}=a4(()=>n.options,n),r=S(()=>o.value);return(i,s)=>(w(),R("optgroup",{label:p(n).label},[Se(i.$slots,"first"),(w(!0),R(Ne,null,gt(r.value,(a,l)=>(w(),K(s4,Ct({key:l,disabled:a.disabled,value:a.value,ref_for:!0},i.$attrs),{default:Q(()=>[Se(i.$slots,"option",Ct({ref_for:!0},a),()=>[Ge(xe(a.text),1)])]),_:2},1040,["disabled","value"]))),128)),Se(i.$slots,"default")],8,eD))}}),nD=["id","name","form","multiple","size","disabled","required","aria-required","aria-invalid"],Ra=le({__name:"BFormSelect",props:rt({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=zt(t,"BFormSelect"),r=ht(t,"modelValue"),i=_o(()=>o.id,"input"),s=Sl(()=>o.selectSize),a=rm(()=>o.state),l=ft("_input"),{focused:c}=Vi(l,{initialValue:o.autofocus}),u=S(()=>[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=S(()=>s.value||o.plain?s.value:void 0),f=om(()=>o.ariaInvalid,()=>o.state),{normalizedOptions:h,isComplex:m}=a4(()=>o.options,o),b=S(()=>h.value),g=S({get:()=>r.value,set:v=>{r.value=v}});return e({blur:()=>{c.value=!1},element:l,focus:()=>{c.value=!0}}),(v,y)=>ir((w(),R("select",{id:p(i),ref:"_input","onUpdate:modelValue":y[0]||(y[0]=x=>g.value=x),class:Me(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)},[Se(v.$slots,"first"),(w(!0),R(Ne,null,gt(b.value,(x,_)=>(w(),R(Ne,{key:_},[p(m)(x)?(w(),K(tD,{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(),K(s4,{key:1,value:x.value,disabled:x.disabled},{default:Q(()=>[Se(v.$slots,"option",Ct({ref_for:!0},x),()=>[Ge(xe(x.text),1)])]),_:2},1032,["value","disabled"]))],64))),128)),Se(v.$slots,"default")],10,nD)),[[bL,g.value]])}}),oD=(t,e)=>{const n=Ie(0),o=ro(Ft(e)),r=Sl(()=>o.value.maxRows||NaN,{method:"parseInt",nanToZero:!0}),i=Sl(()=>o.value.rows||NaN,{method:"parseInt",nanToZero:!0}),s=S(()=>Math.max(i.value||2,2)),a=S(()=>Math.max(s.value,r.value||0)),l=S(()=>s.value===a.value?s.value:null),c=async()=>{if(!t.value||!o4(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),m=(Number.parseFloat(d.paddingTop)||0)+(Number.parseFloat(d.paddingBottom)||0),b=h+m,g=f*s.value+b,v=t.value.style.height||d.height;n.value="auto",await _n();const{scrollHeight:y}=t.value;n.value=v,await _n();const x=Math.max((y-m)/f,2),_=Math.min(Math.max(x,s.value),a.value),C=Math.max(Math.ceil(_*f+b),g);if(o.value.noAutoShrink&&(Number.parseFloat(v.toString())||0)>C){n.value=v;return}n.value=`${C}px`};fn(c);const u=S(()=>({resize:"none",height:typeof n.value=="string"?n.value:n.value?`${n.value}px`:void 0}));return{onInput:c,computedStyles:u,computedRows:l}},rD=["id","name","form","value","disabled","placeholder","required","autocomplete","readonly","aria-required","aria-invalid","rows","wrap"],ay=le({__name:"BFormTextarea",props:rt({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=zt(t,"BFormTextarea"),[r,i]=ht(t,"modelValue",{set:C=>d4(C,i)}),s=ft("_input"),{computedId:a,forceUpdateKey:l,computedAriaInvalid:c,onInput:u,stateClass:d,onChange:f,onBlur:h,focus:m,blur:b}=f4(o,s,r,i),g=S(()=>[d.value,o.plaintext?"form-control-plaintext":"form-control",{[`form-control-${o.size}`]:!!o.size}]),{computedStyles:v,onInput:y,computedRows:x}=oD(s,S(()=>({maxRows:o.maxRows,rows:o.rows,noAutoShrink:o.noAutoShrink}))),_=S(()=>({resize:o.noResize?"none":void 0,...o.maxRows||o.noAutoShrink?v.value:void 0}));return e({blur:b,element:s,focus:m}),(C,L)=>(w(),R("textarea",{id:p(a),ref:"_input",key:p(l),class:Me(g.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:Ot(_.value),wrap:p(o).wrap||void 0,onInput:L[0]||(L[0]=O=>{p(u)(O),p(y)()}),onChange:L[1]||(L[1]=(...O)=>p(f)&&p(f)(...O)),onBlur:L[2]||(L[2]=(...O)=>p(h)&&p(h)(...O))},null,46,rD))}});function iD(t){return Rl()?(ya(t),!0):!1}function o1(t){return typeof t=="function"?t():p(t)}typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const sD=t=>t!=null;function aD(t){var e;const n=o1(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])"],b0=h4.join(","),p4=typeof Element>"u",Cl=p4?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,y0=!p4&&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},x0=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},lD=function(e){var n,o=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"contenteditable");return o===""||o==="true"},m4=function(e,n,o){if(x0(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(b0));return n&&Cl.call(e,b0)&&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(!x0(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=Cl.call(s,b0);u&&o.filter(s)&&(n||!e.includes(s))&&r.push(s);var d=s.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(s),f=!x0(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},v4=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},cl=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||lD(e))&&!v4(e)?0:e.tabIndex},cD=function(e,n){var o=cl(e);return o<0&&n&&!v4(e)?0:o},uD=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},b4=function(e){return e.tagName==="INPUT"},dD=function(e){return b4(e)&&e.type==="hidden"},fD=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(o){return o.tagName==="SUMMARY"});return n},hD=function(e,n){for(var o=0;o<e.length;o++)if(e[o].checked&&e[o].form===n)return e[o]},pD=function(e){if(!e.name)return!0;var n=e.form||y0(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=hD(r,e.form);return!i||i===e},mD=function(e){return b4(e)&&e.type==="radio"},gD=function(e){return mD(e)&&!pD(e)},vD=function(e){var n,o=e&&y0(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=y0(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},Bw=function(e){var n=e.getBoundingClientRect(),o=n.width,r=n.height;return o===0&&r===0},bD=function(e,n){var o=n.displayCheck,r=n.getShadowRoot;if(getComputedStyle(e).visibility==="hidden")return!0;var i=Cl.call(e,"details>summary:first-of-type"),s=i?e.parentElement:e;if(Cl.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=y0(e);if(l&&!l.shadowRoot&&r(l)===!0)return Bw(e);e.assignedSlot?e=e.assignedSlot:!l&&c!==e.ownerDocument?e=c.host:e=l}e=a}if(vD(e))return!e.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return Bw(e);return!1},yD=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 Cl.call(n,"fieldset[disabled] *")?!0:!r.contains(e)}return!0}n=n.parentElement}return!1},w0=function(e,n){return!(n.disabled||x0(n)||dD(n)||bD(n,e)||fD(n)||yD(n))},r1=function(e,n){return!(gD(n)||cl(n)<0||!w0(e,n))},xD=function(e){var n=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},wD=function t(e){var n=[],o=[];return e.forEach(function(r,i){var s=!!r.scopeParent,a=s?r.scopeParent:r,l=cD(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(uD).reduce(function(r,i){return i.isScope?r.push.apply(r,i.content):r.push(i.content),r},[]).concat(n)},_D=function(e,n){n=n||{};var o;return n.getShadowRoot?o=g4([e],n.includeContainer,{filter:r1.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:xD}):o=m4(e,n.includeContainer,r1.bind(null,n)),wD(o)},SD=function(e,n){n=n||{};var o;return n.getShadowRoot?o=g4([e],n.includeContainer,{filter:w0.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):o=m4(e,n.includeContainer,w0.bind(null,n)),o},rc=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return Cl.call(e,b0)===!1?!1:r1(n,e)},kD=h4.concat("iframe").join(","),Og=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return Cl.call(e,kD)===!1?!1:w0(n,e)};/*!
|
|
27
|
+
* focus-trap 7.6.2
|
|
28
|
+
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
29
|
+
*/function i1(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 CD(t){if(Array.isArray(t))return i1(t)}function AD(t,e,n){return(e=BD(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $D(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function TD(){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 Lw(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 Pw(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Lw(Object(n),!0).forEach(function(o){AD(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Lw(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function MD(t){return CD(t)||$D(t)||LD(t)||TD()}function OD(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 BD(t){var e=OD(t,"string");return typeof e=="symbol"?e:e+""}function LD(t,e){if(t){if(typeof t=="string")return i1(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)?i1(t,e):void 0}}var Dw={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()}},PD=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},DD=function(e){return(e==null?void 0:e.key)==="Escape"||(e==null?void 0:e.key)==="Esc"||(e==null?void 0:e.keyCode)===27},pd=function(e){return(e==null?void 0:e.key)==="Tab"||(e==null?void 0:e.keyCode)===9},ED=function(e){return pd(e)&&!e.shiftKey},ID=function(e){return pd(e)&&e.shiftKey},Ew=function(e){return setTimeout(e,0)},Eu=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},Yf=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},RD=[],ND=function(e,n){var o=(n==null?void 0:n.document)||document,r=(n==null?void 0:n.trapStack)||RD,i=Pw({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:ED,isKeyBackward:ID},n),s={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},a,l=function(A,B,P){return A&&A[B]!==void 0?A[B]:i[P||B]},c=function(A,B){var P=typeof(B==null?void 0:B.composedPath)=="function"?B.composedPath():void 0;return s.containerGroups.findIndex(function(F){var z=F.container,V=F.tabbableNodes;return z.contains(A)||(P==null?void 0:P.includes(z))||V.find(function(G){return G===A})})},u=function(A){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},P=B.hasFallback,F=P===void 0?!1:P,z=B.params,V=z===void 0?[]:z,G=i[A];if(typeof G=="function"&&(G=G.apply(void 0,MD(V))),G===!0&&(G=void 0),!G){if(G===void 0||G===!1)return G;throw new Error("`".concat(A,"` was specified but was not a node, or did not return a node"))}var ie=G;if(typeof G=="string"){try{ie=o.querySelector(G)}catch(ce){throw new Error("`".concat(A,'` appears to be an invalid selector; error="').concat(ce.message,'"'))}if(!ie&&!F)throw new Error("`".concat(A,"` as selector refers to no known node"))}return ie},d=function(){var A=u("initialFocus",{hasFallback:!0});if(A===!1)return!1;if(A===void 0||A&&!Og(A,i.tabbableOptions))if(c(o.activeElement)>=0)A=o.activeElement;else{var B=s.tabbableGroups[0],P=B&&B.firstTabbableNode;A=P||u("fallbackFocus")}else A===null&&(A=u("fallbackFocus"));if(!A)throw new Error("Your focus-trap needs to have at least one focusable element");return A},f=function(){if(s.containerGroups=s.containers.map(function(A){var B=_D(A,i.tabbableOptions),P=SD(A,i.tabbableOptions),F=B.length>0?B[0]:void 0,z=B.length>0?B[B.length-1]:void 0,V=P.find(function(ce){return rc(ce)}),G=P.slice().reverse().find(function(ce){return rc(ce)}),ie=!!B.find(function(ce){return cl(ce)>0});return{container:A,tabbableNodes:B,focusableNodes:P,posTabIndexesFound:ie,firstTabbableNode:F,lastTabbableNode:z,firstDomTabbableNode:V,lastDomTabbableNode:G,nextTabbableNode:function(he){var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,oe=B.indexOf(he);return oe<0?Z?P.slice(P.indexOf(he)+1).find(function(se){return rc(se)}):P.slice(0,P.indexOf(he)).reverse().find(function(se){return rc(se)}):B[oe+(Z?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(A){return A.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(A){return A.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(A){var B=A.activeElement;if(B)return B.shadowRoot&&B.shadowRoot.activeElement!==null?h(B.shadowRoot):B},m=function(A){if(A!==!1&&A!==h(document)){if(!A||!A.focus){m(d());return}A.focus({preventScroll:!!i.preventScroll}),s.mostRecentlyFocusedNode=A,PD(A)&&A.select()}},b=function(A){var B=u("setReturnFocus",{params:[A]});return B||(B===!1?!1:A)},g=function(A){var B=A.target,P=A.event,F=A.isBackward,z=F===void 0?!1:F;B=B||Yf(P),f();var V=null;if(s.tabbableGroups.length>0){var G=c(B,P),ie=G>=0?s.containerGroups[G]:void 0;if(G<0)z?V=s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:V=s.tabbableGroups[0].firstTabbableNode;else if(z){var ce=s.tabbableGroups.findIndex(function(U){var te=U.firstTabbableNode;return B===te});if(ce<0&&(ie.container===B||Og(B,i.tabbableOptions)&&!rc(B,i.tabbableOptions)&&!ie.nextTabbableNode(B,!1))&&(ce=G),ce>=0){var he=ce===0?s.tabbableGroups.length-1:ce-1,Z=s.tabbableGroups[he];V=cl(B)>=0?Z.lastTabbableNode:Z.lastDomTabbableNode}else pd(P)||(V=ie.nextTabbableNode(B,!1))}else{var oe=s.tabbableGroups.findIndex(function(U){var te=U.lastTabbableNode;return B===te});if(oe<0&&(ie.container===B||Og(B,i.tabbableOptions)&&!rc(B,i.tabbableOptions)&&!ie.nextTabbableNode(B))&&(oe=G),oe>=0){var se=oe===s.tabbableGroups.length-1?0:oe+1,re=s.tabbableGroups[se];V=cl(B)>=0?re.firstTabbableNode:re.firstDomTabbableNode}else pd(P)||(V=ie.nextTabbableNode(B))}}else V=u("fallbackFocus");return V},v=function(A){var B=Yf(A);if(!(c(B,A)>=0)){if(Eu(i.clickOutsideDeactivates,A)){a.deactivate({returnFocus:i.returnFocusOnDeactivate});return}Eu(i.allowOutsideClick,A)||A.preventDefault()}},y=function(A){var B=Yf(A),P=c(B,A)>=0;if(P||B instanceof Document)P&&(s.mostRecentlyFocusedNode=B);else{A.stopImmediatePropagation();var F,z=!0;if(s.mostRecentlyFocusedNode)if(cl(s.mostRecentlyFocusedNode)>0){var V=c(s.mostRecentlyFocusedNode),G=s.containerGroups[V].tabbableNodes;if(G.length>0){var ie=G.findIndex(function(ce){return ce===s.mostRecentlyFocusedNode});ie>=0&&(i.isKeyForward(s.recentNavEvent)?ie+1<G.length&&(F=G[ie+1],z=!1):ie-1>=0&&(F=G[ie-1],z=!1))}}else s.containerGroups.some(function(ce){return ce.tabbableNodes.some(function(he){return cl(he)>0})})||(z=!1);else z=!1;z&&(F=g({target:s.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(s.recentNavEvent)})),m(F||s.mostRecentlyFocusedNode||d())}s.recentNavEvent=void 0},x=function(A){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;s.recentNavEvent=A;var P=g({event:A,isBackward:B});P&&(pd(A)&&A.preventDefault(),m(P))},_=function(A){(i.isKeyForward(A)||i.isKeyBackward(A))&&x(A,i.isKeyBackward(A))},C=function(A){DD(A)&&Eu(i.escapeDeactivates,A)!==!1&&(A.preventDefault(),a.deactivate())},L=function(A){var B=Yf(A);c(B,A)>=0||Eu(i.clickOutsideDeactivates,A)||Eu(i.allowOutsideClick,A)||(A.preventDefault(),A.stopImmediatePropagation())},O=function(){if(s.active)return Dw.activateTrap(r,a),s.delayInitialFocusTimer=i.delayInitialFocus?Ew(function(){m(d())}):m(d()),o.addEventListener("focusin",y,!0),o.addEventListener("mousedown",v,{capture:!0,passive:!1}),o.addEventListener("touchstart",v,{capture:!0,passive:!1}),o.addEventListener("click",L,{capture:!0,passive:!1}),o.addEventListener("keydown",_,{capture:!0,passive:!1}),o.addEventListener("keydown",C),a},$=function(){if(s.active)return o.removeEventListener("focusin",y,!0),o.removeEventListener("mousedown",v,!0),o.removeEventListener("touchstart",v,!0),o.removeEventListener("click",L,!0),o.removeEventListener("keydown",_,!0),o.removeEventListener("keydown",C),a},M=function(A){var B=A.some(function(P){var F=Array.from(P.removedNodes);return F.some(function(z){return z===s.mostRecentlyFocusedNode})});B&&m(d())},D=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(M):void 0,N=function(){D&&(D.disconnect(),s.active&&!s.paused&&s.containers.map(function(A){D.observe(A,{subtree:!0,childList:!0})}))};return a={get active(){return s.active},get paused(){return s.paused},activate:function(A){if(s.active)return this;var B=l(A,"onActivate"),P=l(A,"onPostActivate"),F=l(A,"checkCanFocusTrap");F||f(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=o.activeElement,B==null||B();var z=function(){F&&f(),O(),N(),P==null||P()};return F?(F(s.containers.concat()).then(z,z),this):(z(),this)},deactivate:function(A){if(!s.active)return this;var B=Pw({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},A);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,$(),s.active=!1,s.paused=!1,N(),Dw.deactivateTrap(r,a);var P=l(B,"onDeactivate"),F=l(B,"onPostDeactivate"),z=l(B,"checkCanReturnFocus"),V=l(B,"returnFocus","returnFocusOnDeactivate");P==null||P();var G=function(){Ew(function(){V&&m(b(s.nodeFocusedBeforeActivation)),F==null||F()})};return V&&z?(z(b(s.nodeFocusedBeforeActivation)).then(G,G),this):(G(),this)},pause:function(A){if(s.paused||!s.active)return this;var B=l(A,"onPause"),P=l(A,"onPostPause");return s.paused=!0,B==null||B(),$(),N(),P==null||P(),this},unpause:function(A){if(!s.paused||!s.active)return this;var B=l(A,"onUnpause"),P=l(A,"onPostUnpause");return s.paused=!1,B==null||B(),f(),O(),N(),P==null||P(),this},updateContainerElements:function(A){var B=[].concat(A).filter(Boolean);return s.containers=B.map(function(P){return typeof P=="string"?o.querySelector(P):P}),s.active&&f(),N(),this}},a.updateContainerElements(e),a};function FD(t,e={}){let n;const{immediate:o,...r}=e,i=Ie(!1),s=Ie(!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=S(()=>{const f=o1(t);return(Array.isArray(f)?f:[f]).map(h=>{const m=o1(h);return typeof m=="string"?m:aD(m)}).filter(sD)});return He(d,f=>{f.length&&(n=ND(f,{...r,onActivate(){i.value=!0,e.onActivate&&e.onActivate()},onDeactivate(){i.value=!1,e.onDeactivate&&e.onDeactivate()}}),o&&a())},{flush:"post"}),iD(()=>l()),{hasFocus:i,isPaused:s,activate:a,deactivate:l,pause:c,unpause:u}}const y4=({element:t,isActive:e,noTrap:n,fallbackFocus:o},r={allowOutsideClick:!0,fallbackFocus:o.ref.value??void 0,escapeDeactivates:!1})=>{const i=ro(Ft(e)),s=ro(Ft(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=Ie(a());fn(()=>{aP(t,()=>{l.value=a()},{childList:!0,subtree:!0})});const c=FD(t,r);return He(i,async u=>{await _n(),u&&s.value===!1?c.activate():c.deactivate()}),He(s,u=>{u===!0&&c.deactivate()}),{needsFallback:ro(l)}},VD=M3(gP);let jf="";const Qa=new Map,x4=(t,e)=>{const n=ro(Ft(t)),o=Mk(),r=S(()=>!bt(e)),i=VD(typeof document<"u"?document.body:null,n.value&&r.value);fn(()=>{typeof document>"u"||(Qa.set(o,!1),He([n,r],([s,a])=>{const l=window.innerWidth-document.documentElement.clientWidth,c=Array.from(Qa.values()).some(f=>f===!0),u=s&&a;Qa.set(o,u),u&&!c&&!i.value&&(i.value=!0,l>0&&(jf=document.body.style.paddingRight,document.body.style.paddingRight=`${l+jf}px`));const d=Array.from(Qa.values()).some(f=>f===!0);c&&!d&&(Qa.set(o,!1),i.value=!1,document.body.style.paddingRight=jf)},{immediate:!0}))}),zs(()=>{Qa.delete(o),Array.from(Qa.values()).some(a=>a===!0)||(document.body.style.paddingRight=jf,i.value=!1)})},zD=["id","aria-labelledby","aria-describedby"],HD=["id"],Iw="modal-fallback-focus",Rw=1056,WD=le({inheritAttrs:!1,__name:"BModal",props:rt({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:rt(["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=zt(t,"BModal"),i=n,s=ts(),a=_o(()=>r.id,"modal"),l=ht(t,"modelValue"),c=ft("_element"),u=ft("_fallbackFocusElement"),d=ft("_okButton"),f=ft("_cancelButton"),h=ft("_closeButton"),m=()=>{r.autofocus!==!1&&(r.autofocusButton==="ok"?z.value=!0:r.autofocusButton==="close"?G.value=!0:r.autofocusButton==="cancel"?V.value=!0:F.value=!0)},b=()=>{m()},{showRef:g,renderRef:v,renderBackdropRef:y,hide:x,show:_,toggle:C,computedNoAnimation:L,transitionProps:O,backdropTransitionProps:$,isLeaving:M,isVisible:D,trapActive:N,contentShowing:k,backdropReady:A,backdropVisible:B}=Zp(l,r,i,c,a,{transitionProps:{onAfterEnter:b}}),{needsFallback:P}=y4({element:c,isActive:N,noTrap:()=>r.noTrap,fallbackFocus:{ref:u,classSelector:Iw}});gs("Escape",()=>{x("esc")},{target:c}),x4(g,()=>r.bodyScrolling);const{focused:F}=Vi(c,{initialValue:l.value&&r.autofocusButton===void 0&&r.autofocus===!0}),{focused:z}=Vi(d,{initialValue:l.value&&r.autofocusButton==="ok"&&r.autofocus===!0}),{focused:V}=Vi(f,{initialValue:l.value&&r.autofocusButton==="cancel"&&r.autofocus===!0}),{focused:G}=Vi(h,{initialValue:l.value&&r.autofocusButton==="close"&&r.autofocus===!0}),ie=S(()=>!Hc(s["header-close"])),ce=S(()=>[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}]),he=$s(()=>({bgVariant:r.bodyBgVariant,textVariant:r.bodyTextVariant,variant:r.bodyVariant})),Z=S(()=>[r.bodyClass,he.value]),oe=$s(()=>({bgVariant:r.headerBgVariant,textVariant:r.headerTextVariant,variant:r.headerVariant,borderVariant:r.headerBorderVariant})),se=S(()=>[r.headerClass,oe.value]),re=S(()=>({variant:ie.value?r.headerCloseVariant:void 0,class:r.headerCloseClass})),U=$s(()=>({bgVariant:r.footerBgVariant,textVariant:r.footerTextVariant,variant:r.footerVariant,borderVariant:r.footerBorderVariant})),te=S(()=>[r.footerClass,U.value]),ne=S(()=>[r.titleClass,{"visually-hidden":r.titleVisuallyHidden}]),ve=S(()=>r.cancelDisabled||r.busy),me=S(()=>r.okDisabled||r.busy),{activePosition:I,activeModalCount:W,stackWithoutSelf:j}=bP(g,l.value);He(j,(J,X)=>{J.length>X.length&&g.value===!0&&r.noStacking===!0&&x()});const ue=S(()=>g.value||M.value?Rw-(((W==null?void 0:W.value)??0)*2-((I==null?void 0:I.value)??0)*2):Rw),de=S(()=>({"z-index":ue.value})),fe=S(()=>({"z-index":ue.value-1})),pe=S(()=>({cancel:()=>{x("cancel")},close:()=>{x("close")},hide:x,ok:()=>{x("ok")},active:g.value,visible:g.value}));return e({hide:x,id:a,show:_,toggle:C}),(J,X)=>(w(),K(Kp,{to:p(r).teleportTo,disabled:p(r).teleportDisabled},{default:Q(()=>[p(v)||p(k)?(w(),K(_l,Ct({key:0},p(O),{appear:l.value||p(r).visible,onAfterEnter:b}),{default:Q(()=>[ir(T("div",Ct({id:p(a),ref:"_element",class:["modal",[p(r).modalClass,{fade:!p(L),show:p(D)}]],role:"dialog","aria-labelledby":p(r).noHeader?void 0:`${p(a)}-label`,"aria-describedby":`${p(a)}-body`,tabindex:"-1"},J.$attrs,{style:de.value,onClick:X[4]||(X[4]=vn(ee=>p(x)("backdrop"),["self"]))}),[T("div",{class:Me(["modal-dialog",ce.value])},[p(k)?(w(),R("div",{key:0,class:Me(["modal-content",p(r).contentClass])},[p(r).noHeader?ae("",!0):(w(),R("div",{key:0,class:Me(["modal-header",se.value])},[Se(J.$slots,"header",Vn(Jo(pe.value)),()=>[(w(),K(on(p(r).titleTag),{id:`${p(a)}-label`,class:Me(["modal-title",ne.value])},{default:Q(()=>[Se(J.$slots,"title",Vn(Jo(pe.value)),()=>[Ge(xe(p(r).title),1)],!0)]),_:3},8,["id","class"])),p(r).noHeaderClose?ae("",!0):(w(),R(Ne,{key:0},[ie.value?(w(),K(Wo,Ct({key:0},re.value,{onClick:X[0]||(X[0]=ee=>p(x)("close"))}),{default:Q(()=>[Se(J.$slots,"header-close",{},void 0,!0)]),_:3},16)):(w(),K(n4,Ct({key:1,"aria-label":p(r).headerCloseLabel},re.value,{onClick:X[1]||(X[1]=ee=>p(x)("close"))}),null,16,["aria-label"]))],64))],!0)],2)),T("div",Ct({id:`${p(a)}-body`,class:["modal-body",Z.value]},p(r).bodyAttrs),[Se(J.$slots,"default",Vn(Jo(pe.value)),()=>[Ge(xe(p(r).body),1)],!0)],16,HD),p(r).noFooter?ae("",!0):(w(),R("div",{key:1,class:Me(["modal-footer",te.value])},[Se(J.$slots,"footer",Vn(Jo(pe.value)),()=>[Se(J.$slots,"cancel",Vn(Jo(pe.value)),()=>[p(r).okOnly?ae("",!0):(w(),K(Wo,{key:0,ref:"_cancelButton",disabled:ve.value,size:p(r).buttonSize,variant:p(r).cancelVariant,onClick:X[2]||(X[2]=ee=>p(x)("cancel"))},{default:Q(()=>[Ge(xe(p(r).cancelTitle),1)]),_:1},8,["disabled","size","variant"]))],!0),Se(J.$slots,"ok",Vn(Jo(pe.value)),()=>[H(Wo,{ref:"_okButton",disabled:me.value,size:p(r).buttonSize,variant:p(r).okVariant,onClick:X[3]||(X[3]=ee=>p(x)("ok"))},{default:Q(()=>[Ge(xe(p(r).okTitle),1)]),_:1},8,["disabled","size","variant"])],!0)],!0)],2))],2)):ae("",!0)],2),p(P)?(w(),R("div",{key:0,ref:"_fallbackFocusElement",class:Me(Iw),tabindex:"0",style:{width:"0",height:"0",overflow:"hidden"}},null,512)):ae("",!0)],16,zD),[[Rc,p(g)&&(p(A)&&p(r).backdropFirst||!p(r).backdropFirst)]])]),_:3},16,["appear"])):ae("",!0),p(r).noBackdrop?ae("",!0):Se(J.$slots,"backdrop",Vn(Ct({key:1},pe.value)),()=>[p(y)?(w(),K(_l,Vn(Ct({key:0},p($))),{default:Q(()=>[ir(T("div",{class:Me(["modal-backdrop",{fade:!p(L),show:p(B)||p(L)}]),style:Ot(fe.value),onClick:X[5]||(X[5]=ee=>p(x)("backdrop"))},null,6),[[Rc,p(g)||p(M)&&p(r).backdropFirst&&!p(L)]])]),_:1},16)):ae("",!0)],!0)]),_:3},8,["to","disabled"]))}}),UD=Qp(WD,[["__scopeId","data-v-93972863"]]),GD=["id","aria-labelledby"],qD=["id"],Nw="offcanvas-fallback-focus",YD=le({inheritAttrs:!1,__name:"BOffcanvas",props:rt({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:rt(["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=zt(t,"BOffcanvas"),i=n,s=ts(),a=ht(t,"modelValue"),l=_o(()=>r.id,"offcanvas"),c=ft("_element"),u=ft("_fallbackFocusElement"),d=()=>{_n(()=>{r.noFocus===!1&&!P.value&&(F.value=!0)})},{showRef:f,renderRef:h,renderBackdropRef:m,hide:b,show:g,toggle:v,computedNoAnimation:y,contentShowing:x,transitionProps:_,backdropReady:C,backdropTransitionProps:L,backdropVisible:O,isVisible:$,buildTriggerableEvent:M,localNoAnimation:D,isLeaving:N,trapActive:k}=Zp(a,r,i,c,l,{transitionProps:{onAfterEnter:d,enterToClass:"showing",leaveToClass:"hiding",enterActiveClass:"",leaveActiveClass:"",enterFromClass:"",leaveFromClass:""}}),B=cP(lP).smallerOrEqual(()=>r.responsive??"xs"),P=Ie(r.responsive!==void 0&&!B.value);fn(()=>{r.responsive!==void 0&&i("breakpoint",M("breakpoint"),P.value)}),x4(f,()=>r.bodyScrolling||P.value),gs("Escape",()=>{b("esc")},{target:c});const{focused:F}=Vi(c,{initialValue:a.value&&r.noFocus===!1&&!P.value}),{needsFallback:z}=y4({element:c,isActive:k,noTrap:()=>r.noTrap||P.value,fallbackFocus:{classSelector:Nw,ref:u}}),V=S(()=>(r.responsive===void 0||!P.value)&&r.noBackdrop===!1&&(f.value===!0||N.value&&r.backdropFirst&&!y.value)),G=S(()=>!Hc(s["header-close"])),ie=S(()=>[{"text-reset":!G.value},r.headerCloseClass]),ce=S(()=>({variant:G.value?r.headerCloseVariant:void 0,class:ie.value})),he=S(()=>!Hc(s.footer)),Z=S(()=>[r.responsive===void 0?"offcanvas":`offcanvas-${r.responsive}`,`offcanvas-${r.placement}`,{show:$.value,[`shadow-${r.shadow}`]:!!r.shadow,"no-transition":y.value}]),oe=S(()=>({width:r.width})),se=S(()=>({visible:f.value,placement:r.placement,hide:b}));return He(B,re=>{r.responsive!==void 0&&(re===!0?(D.value=!0,requestAnimationFrame(()=>{P.value=!1}),i("breakpoint",M("breakpoint"),!1),i("hide",M("hide"))):(D.value=!0,requestAnimationFrame(()=>{P.value=!0}),i("breakpoint",M("breakpoint"),!0),i("show",M("show"))))}),e({hide:b,show:g,toggle:v,isOpenByBreakpoint:P}),(re,U)=>(w(),K(Kp,{to:p(r).teleportTo,disabled:p(r).teleportDisabled||P.value},{default:Q(()=>[p(h)||p(x)||P.value?(w(),K(_l,Ct({key:0},p(_),{appear:a.value||p(r).visible}),{default:Q(()=>[ir(T("div",Ct({id:p(l),ref:"_element","aria-modal":"true",role:"dialog",class:Z.value,style:oe.value,tabindex:"-1","aria-labelledby":`${p(l)}-offcanvas-label`,"data-bs-backdrop":"false"},re.$attrs),[p(x)||P.value?(w(),R(Ne,{key:0},[p(r).noHeader?ae("",!0):(w(),R("div",{key:0,class:Me(["offcanvas-header",p(r).headerClass])},[Se(re.$slots,"header",Vn(Jo(se.value)),()=>[T("h5",{id:`${p(l)}-offcanvas-label`,class:"offcanvas-title"},[Se(re.$slots,"title",Vn(Jo(se.value)),()=>[Ge(xe(p(r).title),1)],!0)],8,qD),p(r).noHeaderClose?ae("",!0):(w(),R(Ne,{key:0},[G.value?(w(),K(Wo,Ct({key:0},ce.value,{onClick:U[0]||(U[0]=te=>p(b)("close"))}),{default:Q(()=>[Se(re.$slots,"header-close",{},void 0,!0)]),_:3},16)):(w(),K(n4,Ct({key:1,"aria-label":p(r).headerCloseLabel},ce.value,{onClick:U[1]||(U[1]=te=>p(b)("close"))}),null,16,["aria-label"]))],64))],!0)],2)),T("div",Ct({class:["offcanvas-body",p(r).bodyClass]},p(r).bodyAttrs),[Se(re.$slots,"default",Vn(Jo(se.value)),void 0,!0)],16),he.value?(w(),R("div",{key:1,class:Me(p(r).footerClass)},[Se(re.$slots,"footer",Vn(Jo(se.value)),void 0,!0)],2)):ae("",!0)],64)):ae("",!0),p(z)?(w(),R("div",{key:1,ref:"_fallbackFocusElement",class:Me(Nw),tabindex:"0",style:{width:"0",height:"0",overflow:"hidden"}},null,512)):ae("",!0)],16,GD),[[Rc,p(f)&&(p(C)&&p(r).backdropFirst||!p(r).backdropFirst)||P.value]])]),_:3},16,["appear"])):ae("",!0),p(r).noBackdrop?ae("",!0):Se(re.$slots,"backdrop",Vn(Ct({key:1},se.value)),()=>[p(m)?(w(),K(_l,Vn(Ct({key:0},p(L))),{default:Q(()=>[ir(T("div",{class:Me(["offcanvas-backdrop",{fade:!p(y),show:p(O)||p(y)}]),onClick:U[2]||(U[2]=te=>p(b)("backdrop"))},null,2),[[Rc,V.value]])]),_:1},16)):ae("",!0)],!0)]),_:3},8,["to","disabled"]))}}),jD=Qp(YD,[["__scopeId","data-v-77d852fe"]]),XD="300px",KD=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=zt(t,"BTableSimple"),o=_o(()=>n.id),r=$s(S(()=>({borderVariant:n.borderVariant}))),i=S(()=>[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=S(()=>({id:o.value,class:i.value,...n.tableAttrs})),a=B7(S(()=>(n.stickyHeader===!0?XD:n.stickyHeader)||NaN)),l=S(()=>n.stickyHeader!==!1),c=S(()=>n.responsive!==!1||l.value),u=S(()=>l.value?{maxHeight:a.value}:void 0),d=S(()=>({"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:Me(d.value),style:Ot(u.value)},[T("table",Vn(Jo(s.value)),[Se(f.$slots,"default")],16)],6)):(w(),R("table",Vn(Ct({key:1},s.value)),[Se(f.$slots,"default")],16))}}),Id=le({__name:"BTooltip",props:rt({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=zt(t,"BTooltip"),r=ts(),i=ht(t,"modelValue"),s=S(()=>{const{interactive:l,noninteractive:c,...u}=o;return{noninteractive:c!==void 0?c:!l,...u}}),a=ft("_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(),K(e4,Ct({ref:"_popover"},s.value,{modelValue:i.value,"onUpdate:modelValue":c[0]||(c[0]=u=>i.value=u),tooltip:""}),xr({_:2},[r.default?{name:"default",fn:Q(()=>[Se(l.$slots,"default")]),key:"0"}:void 0,r.target?{name:"target",fn:Q(u=>[Se(l.$slots,"target",Vn(Jo(u)))]),key:"1"}:void 0,r.title?{name:"title",fn:Q(()=>[Se(l.$slots,"title")]),key:"2"}:void 0]),1040,["modelValue"]))}}),ZD=le({__name:"BTbody",props:{variant:{default:null}},setup(t){const n=zt(t,"BTbody"),o=S(()=>({[`thead-${n.variant}`]:n.variant!==null}));return(r,i)=>(w(),R("tbody",{class:Me(o.value)},[Se(r.$slots,"default")],2))}}),QD=["scope","colspan","rowspan","data-label"],JD={key:0},Fw=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=zt(t,"BTd"),o=S(()=>({[`table-${n.variant}`]:n.variant!==null,"b-table-sticky-column":n.stickyColumn,"table-b-table-default":n.stickyColumn&&n.variant===null})),r=S(()=>n.colspan?"colspan":n.rowspan?"rowspan":"col");return(i,s)=>(w(),R("td",{scope:r.value,class:Me(o.value),colspan:p(n).colspan,rowspan:p(n).rowspan,"data-label":p(n).stackedHeading},[p(n).stackedHeading?(w(),R("div",JD,[Se(i.$slots,"default")])):Se(i.$slots,"default",{key:1})],10,QD))}}),eE=["scope","colspan","rowspan","data-label"],tE={key:0},Vw=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=zt(t,"BTh"),o=S(()=>({[`table-${n.variant}`]:n.variant!==null,"b-table-sticky-column":n.stickyColumn,"table-b-table-default":n.stickyColumn&&n.variant===null})),r=S(()=>n.colspan?"colspan":n.rowspan?"rowspan":"col");return(i,s)=>(w(),R("th",{scope:r.value,class:Me(o.value),colspan:p(n).colspan,rowspan:p(n).rowspan,"data-label":p(n).stackedHeading},[p(n).stackedHeading!==void 0?(w(),R("div",tE,[Se(i.$slots,"default")])):Se(i.$slots,"default",{key:1})],10,eE))}}),nE=le({__name:"BThead",props:{variant:{default:null}},setup(t){const n=zt(t,"BThead"),o=S(()=>({[`table-${n.variant}`]:n.variant!==null}));return(r,i)=>(w(),R("thead",{class:Me(o.value)},[Se(r.$slots,"default")],2))}}),zw=le({__name:"BTr",props:{variant:{default:null}},setup(t){const n=zt(t,"BTr"),o=S(()=>({[`table-${n.variant}`]:n.variant!==null}));return(r,i)=>(w(),R("tr",{class:Me(o.value)},[Se(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 w4={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"},oE=Object.freeze(Object.keys(w4)),_4={vBColorMode:"/directives/BColorMode",vBModal:"/directives/BModal",vBPopover:"/directives/BPopover",vBScrollspy:"/directives/BScrollspy",vBToggle:"/directives/BToggle",vBTooltip:"/directives/BTooltip"},rE=Object.freeze(Object.keys(_4)),iE={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(iE));const Hw="bootstrap-vue-next",Ww=(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)},Bg=new Set,Uw=new Set;Object.assign(({aliases:t={},directives:e=!0,components:n=!0}={})=>{const r=Ww(typeof n=="boolean"?{all:n}:n,oE).reduce((l,c)=>(l.set(c,`${Hw}${w4[c]}`),l),new Map),s=Ww(typeof e=="boolean"?{all:e}:e,rE).reduce((l,c)=>{const u=c.toLowerCase().startsWith("v")?c:`v${c}`;return l.set(u,`${Hw}${_4[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 Bg.add(d),{name:d,from:u}}if(c)return Bg.add(l),{name:l,from:c}}},{type:"directive",resolve(l){const c=`v${l}`,u=s.get(c);if(u)return Uw.add(c),{name:c,from:u}}}]},{__usedComponents:Bg,__usedDirectives:Uw});const sE={install(t,e){const n=(e==null?void 0:e.components)??{};t.provide(Rh,Ie(n))}},aE={install(t){const e=Ie([]),n=()=>{e.value.splice(0,e.value.length)};t.provide(VL,{items:e,reset:n})}},lE={install(t){const e=Ie(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=Ft(l.props),[d,f,h]=o((c=u.value)==null?void 0:c.id);return e.value.set(f,{component:l.component?$e(l.component):void 0,props:{...u.value,_isConfirm:!1,_promise:d,_modelValue:h}}),He(u,m=>{const b=e.value.get(f);b&&e.value.set(f,{component:l.component?$e(l.component):void 0,props:{...b.props,...m}})}),d.value},i=(l={})=>{var c;const u=Ft(l.props),[d,f,h]=o((c=u.value)==null?void 0:c.id);return e.value.set(f,{component:l.component?$e(l.component):void 0,props:{...u.value,_isConfirm:!0,_promise:d,_modelValue:h}}),He(u,m=>{const b=e.value.get(f);b&&e.value.set(f,{component:l.component?$e(l.component):void 0,props:{...b.props,...m}})}),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(WL,{modals:e,remove:a,show:r,confirm:i,leave:s})}},cE={install(t){const e=Ie(new Map),n=S(()=>e.value.size),o=S(()=>[...e.value.values()]),r=S(()=>o.value[o.value.length-1]),i=u=>{e.value.set(u.uid,u)},s=u=>{e.value.delete(u.uid)},a=Ie(new Map),l=u=>{a.value.set(u.uid,u)},c=u=>{a.value.delete(u.uid)};t.provide(A3,{countStack:n,lastStack:r,registry:ro(a),stack:o,pushStack:i,removeStack:s,pushRegistry:l,removeRegistry:c})}},uE={install(t){const e=Ie(new Map),n=c=>{var u;const d=Ft(c),f=((u=d.value)==null?void 0:u.id)||Symbol("Popover controller");return He(d,h=>{e.value.set(f,{...h,...typeof h.modelValue<"u"&&Ke(c)?{"onUpdate:modelValue":m=>{var b;(b=h["onUpdate:modelValue"])==null||b.call(h,m),c.value.modelValue=m}}:{}})},{immediate:!0,deep:!0}),ya(()=>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=Ie(new Map),s=c=>{var u;const d=Ft(c),f=((u=d.value)==null?void 0:u.id)||Symbol("Tooltip controller");return He(d,h=>{e.value.set(f,{...h,...typeof h.modelValue<"u"&&Ke(c)?{"onUpdate:modelValue":m=>{var b;(b=h["onUpdate:modelValue"])==null||b.call(h,m),c.value.modelValue=m}}:{}})},{immediate:!0,deep:!0}),ya(()=>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(UL,{popovers:e,tooltips:i,tooltip:s,popover:n,setPopover:o,setTooltip:a,removePopover:r,removeTooltip:l})}},dE={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=Ie(s),c=Ie(a);t.provide(FL,{isRtl:l,locale:c})}},fE="top-end",hE={install(t){const e=Ie([]),n=Ie(!1),o=a=>{n.value=a},r=(a={})=>{var l,c,u,d;const f=Ft(a.props),h=((l=f.value)==null?void 0:l.id)||Symbol("Toast controller"),m={component:a.component?$e(a.component):void 0,props:{...f.value,pos:((c=f.value)==null?void 0:c.pos)||fE,_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(m):e.value.unshift(m),He(f,b=>{const g=e.value.findIndex(v=>v.props._self===h);g!==-1&&e.value.splice(g,1,{component:a.component?$e(a.component):void 0,props:{...e.value[g].props,...b,_modelValue:(b==null?void 0:b.value)||e.value[g].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?$e(e.value[l].component):void 0,props:{...e.value[l].props,_modelValue:!1}})};t.provide(HL,{_setIsAppend:o,toasts:e,show:r,remove:i,leave:s})}},pE={install(t){const e=sr({}),n=({id:o,value:r,toggle:i,show:s,hide:a})=>(e[o]=S(()=>({value:r.value,toggle:i,show:s,hide:a})),{unregister(){delete e[o]}});n.map=ro(e),t.provide(S3,n)}},mE=(t={})=>({install(e){(t.breadcrumb??!0)&&e.use(aE),(t.modalController??!0)&&e.use(lE),(t.modalManager??!0)&&e.use(cE),((t.rtl??!0)||typeof t.rtl=="object")&&e.use(dE,t),(t.toast??!0)&&e.use(hE),(t.popover??!0)&&e.use(uE),e.use(pE),e.use(sE,t)}});/*!
|
|
31
|
+
* vue-router v4.6.4
|
|
32
|
+
* (c) 2025 Eduardo San Martin Morote
|
|
33
|
+
* @license MIT
|
|
34
|
+
*/const fc=typeof document<"u";function S4(t){return typeof t=="object"||"displayName"in t||"props"in t||"__vccOpts"in t}function gE(t){return t.__esModule||t[Symbol.toStringTag]==="Module"||t.default&&S4(t.default)}const jt=Object.assign;function Lg(t,e){const n={};for(const o in e){const r=e[o];n[o]=vi(r)?r.map(t):t(r)}return n}const md=()=>{},vi=Array.isArray;function Gw(t,e){const n={};for(const o in t)n[o]=o in e?e[o]:t[o];return n}const k4=/#/g,vE=/&/g,bE=/\//g,yE=/=/g,xE=/\?/g,C4=/\+/g,wE=/%5B/g,_E=/%5D/g,A4=/%5E/g,SE=/%60/g,$4=/%7B/g,kE=/%7C/g,T4=/%7D/g,CE=/%20/g;function ly(t){return t==null?"":encodeURI(""+t).replace(kE,"|").replace(wE,"[").replace(_E,"]")}function AE(t){return ly(t).replace($4,"{").replace(T4,"}").replace(A4,"^")}function s1(t){return ly(t).replace(C4,"%2B").replace(CE,"+").replace(k4,"%23").replace(vE,"%26").replace(SE,"`").replace($4,"{").replace(T4,"}").replace(A4,"^")}function $E(t){return s1(t).replace(yE,"%3D")}function TE(t){return ly(t).replace(k4,"%23").replace(xE,"%3F")}function ME(t){return TE(t).replace(bE,"%2F")}function Rd(t){if(t==null)return null;try{return decodeURIComponent(""+t)}catch{}return""+t}const OE=/\/$/,BE=t=>t.replace(OE,"");function Pg(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=EE(o??e,n),{fullPath:o+i+s,path:o,query:r,hash:Rd(s)}}function LE(t,e){const n=e.query?t(e.query):"";return e.path+(n&&"?")+n+(e.hash||"")}function qw(t,e){return!e||!t.toLowerCase().startsWith(e.toLowerCase())?t:t.slice(e.length)||"/"}function PE(t,e,n){const o=e.matched.length-1,r=n.matched.length-1;return o>-1&&o===r&&Wc(e.matched[o],n.matched[r])&&M4(e.params,n.params)&&t(e.query)===t(n.query)&&e.hash===n.hash}function Wc(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function M4(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(!DE(t[n],e[n]))return!1;return!0}function DE(t,e){return vi(t)?Yw(t,e):vi(e)?Yw(e,t):(t==null?void 0:t.valueOf())===(e==null?void 0:e.valueOf())}function Yw(t,e){return vi(e)?t.length===e.length&&t.every((n,o)=>n===e[o]):t.length===1&&t[0]===e}function EE(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 Js={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let a1=(function(t){return t.pop="pop",t.push="push",t})({}),Dg=(function(t){return t.back="back",t.forward="forward",t.unknown="",t})({});function IE(t){if(!t)if(fc){const e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^\w+:\/\/[^\/]+/,"")}else t="/";return t[0]!=="/"&&t[0]!=="#"&&(t="/"+t),BE(t)}const RE=/^[^#]+#/;function NE(t,e){return t.replace(RE,"#")+e}function FE(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 im=()=>({left:window.scrollX,top:window.scrollY});function VE(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=FE(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 jw(t,e){return(history.state?history.state.position-e:-1)+t}const l1=new Map;function zE(t,e){l1.set(t,e)}function HE(t){const e=l1.get(t);return l1.delete(t),e}function WE(t){return typeof t=="string"||t&&typeof t=="object"}function O4(t){return typeof t=="string"||typeof t=="symbol"}let xn=(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 B4=Symbol("");xn.MATCHER_NOT_FOUND+"",xn.NAVIGATION_GUARD_REDIRECT+"",xn.NAVIGATION_ABORTED+"",xn.NAVIGATION_CANCELLED+"",xn.NAVIGATION_DUPLICATED+"";function Uc(t,e){return jt(new Error,{type:t,[B4]:!0},e)}function as(t,e){return t instanceof Error&&B4 in t&&(e==null||!!(t.type&e))}const UE=["params","query","hash"];function GE(t){if(typeof t=="string")return t;if(t.path!=null)return t.path;const e={};for(const n of UE)n in t&&(e[n]=t[n]);return JSON.stringify(e,null,2)}function qE(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(C4," "),i=r.indexOf("="),s=Rd(i<0?r:r.slice(0,i)),a=i<0?null:Rd(r.slice(i+1));if(s in e){let l=e[s];vi(l)||(l=e[s]=[l]),l.push(a)}else e[s]=a}return e}function Xw(t){let e="";for(let n in t){const o=t[n];if(n=$E(n),o==null){o!==void 0&&(e+=(e.length?"&":"")+n);continue}(vi(o)?o.map(r=>r&&s1(r)):[o&&s1(o)]).forEach(r=>{r!==void 0&&(e+=(e.length?"&":"")+n,r!=null&&(e+="="+r))})}return e}function YE(t){const e={};for(const n in t){const o=t[n];o!==void 0&&(e[n]=vi(o)?o.map(r=>r==null?null:""+r):o==null?o:""+o)}return e}const L4=Symbol(""),Kw=Symbol(""),sm=Symbol(""),cy=Symbol(""),c1=Symbol("");function Iu(){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 jE(t,e,n){const o=()=>{t[e].delete(n)};zs(o),Bk(o),zb(()=>{t[e].add(n)}),t[e].add(n)}function XE(t){const e=Jt(L4,{}).value;e&&jE(e,"leaveGuards",t)}function sa(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(Uc(xn.NAVIGATION_ABORTED,{from:n,to:e})):f instanceof Error?l(f):WE(f)?l(Uc(xn.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 Eg(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(S4(l)){const c=(l.__vccOpts||l)[e];c&&i.push(sa(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=gE(u)?u.default:u;s.mods[a]=u,s.components[a]=d;const f=(d.__vccOpts||d)[e];return f&&sa(f,n,o,s,a,r)()}))}}return i}function KE(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=>Wc(c,a))?o.push(a):n.push(a));const l=t.matched[s];l&&(e.matched.find(c=>Wc(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 ZE=()=>location.protocol+"//"+location.host;function P4(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),qw(a,"")}return qw(n,t)+o+r}function QE(t,e,n,o){let r=[],i=[],s=null;const a=({state:f})=>{const h=P4(t,location),m=n.value,b=e.value;let g=0;if(f){if(n.value=h,e.value=f,s&&s===m){s=null;return}g=b?f.position-b.position:0}else o(h);r.forEach(v=>{v(n.value,m,{delta:g,type:a1.pop,direction:g?g>0?Dg.forward:Dg.back:Dg.unknown})})};function l(){s=n.value}function c(f){r.push(f);const h=()=>{const m=r.indexOf(f);m>-1&&r.splice(m,1)};return i.push(h),h}function u(){if(document.visibilityState==="hidden"){const{history:f}=window;if(!f.state)return;f.replaceState(jt({},f.state,{scroll:im()}),"")}}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 Zw(t,e,n,o=!1,r=!1){return{back:t,current:e,forward:n,replaced:o,position:window.history.length,scroll:r?im():null}}function JE(t){const{history:e,location:n}=window,o={value:P4(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:ZE()+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,jt({},e.state,Zw(r.value.back,l,r.value.forward,!0),c,{position:r.value.position}),!0),o.value=l}function a(l,c){const u=jt({},r.value,e.state,{forward:l,scroll:im()});i(u.current,u,!0),i(l,jt({},Zw(o.value,l,null),{position:u.position+1},c),!1),o.value=l}return{location:o,state:r,push:a,replace:s}}function eI(t){t=IE(t);const e=JE(t),n=QE(t,e.state,e.location,e.replace);function o(i,s=!0){s||n.pauseListeners(),history.go(i)}const r=jt({location:"",base:t,go:o,createHref:NE.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 tI(t){return t=location.host?t||location.pathname+location.search:"",t.includes("#")||(t+="#"),eI(t)}let dl=(function(t){return t[t.Static=0]="Static",t[t.Param=1]="Param",t[t.Group=2]="Group",t})({});var Fn=(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})(Fn||{});const nI={type:dl.Static,value:""},oI=/[a-zA-Z0-9_]/;function rI(t){if(!t)return[[]];if(t==="/")return[[nI]];if(!t.startsWith("/"))throw new Error(`Invalid path "${t}"`);function e(h){throw new Error(`ERR (${n})/"${c}": ${h}`)}let n=Fn.Static,o=n;const r=[];let i;function s(){i&&r.push(i),i=[]}let a=0,l,c="",u="";function d(){c&&(n===Fn.Static?i.push({type:dl.Static,value:c}):n===Fn.Param||n===Fn.ParamRegExp||n===Fn.ParamRegExpEnd?(i.length>1&&(l==="*"||l==="+")&&e(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),i.push({type:dl.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!==Fn.ParamRegExp){o=n,n=Fn.EscapeNext;continue}switch(n){case Fn.Static:l==="/"?(c&&d(),s()):l===":"?(d(),n=Fn.Param):f();break;case Fn.EscapeNext:f(),n=o;break;case Fn.Param:l==="("?n=Fn.ParamRegExp:oI.test(l)?f():(d(),n=Fn.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case Fn.ParamRegExp:l===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+l:n=Fn.ParamRegExpEnd:u+=l;break;case Fn.ParamRegExpEnd:d(),n=Fn.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,u="";break;default:e("Unknown state");break}}return n===Fn.ParamRegExp&&e(`Unfinished custom RegExp for param "${c}"`),d(),s(),r}const Qw="[^/]+?",iI={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 sI=/[.+*?^${}()[\]/\\]/g;function aI(t,e){const n=jt({},iI,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===dl.Static)d||(r+="/"),r+=f.value.replace(sI,"\\$&"),h+=No.Static;else if(f.type===dl.Param){const{value:m,repeatable:b,optional:g,regexp:v}=f;i.push({name:m,repeatable:b,optional:g});const y=v||Qw;if(y!==Qw){h+=No.BonusCustomRegExp;try{`${y}`}catch(_){throw new Error(`Invalid custom RegExp for param "${m}" (${y}): `+_.message)}}let x=b?`((?:${y})(?:/(?:${y}))*)`:`(${y})`;d||(x=g&&c.length<2?`(?:/${x})`:"/"+x),g&&(x+="?"),r+=x,h+=No.Dynamic,g&&(h+=No.BonusOptional),b&&(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]||"",m=i[f-1];d[m.name]=h&&m.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===dl.Static)u+=h.value;else if(h.type===dl.Param){const{value:m,repeatable:b,optional:g}=h,v=m in c?c[m]:"";if(vi(v)&&!b)throw new Error(`Provided param "${m}" is an array but it is not repeatable (* or + modifiers)`);const y=vi(v)?v.join("/"):v;if(!y)if(g)f.length<2&&(u.endsWith("/")?u=u.slice(0,-1):d=!0);else throw new Error(`Missing required param "${m}"`);u+=y}}return u||"/"}return{re:s,score:o,keys:i,parse:a,stringify:l}}function lI(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 D4(t,e){let n=0;const o=t.score,r=e.score;for(;n<o.length&&n<r.length;){const i=lI(o[n],r[n]);if(i)return i;n++}if(Math.abs(r.length-o.length)===1){if(Jw(o))return 1;if(Jw(r))return-1}return r.length-o.length}function Jw(t){const e=t[t.length-1];return t.length>0&&e[e.length-1]<0}const cI={strict:!1,end:!0,sensitive:!1};function uI(t,e,n){const o=aI(rI(t.path),n),r=jt(o,{record:t,parent:e,children:[],alias:[]});return e&&!r.record.aliasOf==!e.record.aliasOf&&e.children.push(r),r}function dI(t,e){const n=[],o=new Map;e=Gw(cI,e);function r(d){return o.get(d)}function i(d,f,h){const m=!h,b=t_(d);b.aliasOf=h&&h.record;const g=Gw(e,d),v=[b];if("alias"in d){const _=typeof d.alias=="string"?[d.alias]:d.alias;for(const C of _)v.push(t_(jt({},b,{components:h?h.record.components:b.components,path:C,aliasOf:h?h.record:b})))}let y,x;for(const _ of v){const{path:C}=_;if(f&&C[0]!=="/"){const L=f.record.path,O=L[L.length-1]==="/"?"":"/";_.path=f.record.path+(C&&O+C)}if(y=uI(_,f,g),h?h.alias.push(y):(x=x||y,x!==y&&x.alias.push(y),m&&d.name&&!n_(y)&&s(d.name)),E4(y)&&l(y),b.children){const L=b.children;for(let O=0;O<L.length;O++)i(L[O],y,h&&h.children[O])}h=h||y}return x?()=>{s(x)}:md}function s(d){if(O4(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=pI(d,n);n.splice(f,0,d),d.record.name&&!n_(d)&&o.set(d.record.name,d)}function c(d,f){let h,m={},b,g;if("name"in d&&d.name){if(h=o.get(d.name),!h)throw Uc(xn.MATCHER_NOT_FOUND,{location:d});g=h.record.name,m=jt(e_(f.params,h.keys.filter(x=>!x.optional).concat(h.parent?h.parent.keys.filter(x=>x.optional):[]).map(x=>x.name)),d.params&&e_(d.params,h.keys.map(x=>x.name))),b=h.stringify(m)}else if(d.path!=null)b=d.path,h=n.find(x=>x.re.test(b)),h&&(m=h.parse(b),g=h.record.name);else{if(h=f.name?o.get(f.name):n.find(x=>x.re.test(f.path)),!h)throw Uc(xn.MATCHER_NOT_FOUND,{location:d,currentLocation:f});g=h.record.name,m=jt({},f.params,d.params),b=h.stringify(m)}const v=[];let y=h;for(;y;)v.unshift(y.record),y=y.parent;return{name:g,path:b,params:m,matched:v,meta:hI(v)}}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 e_(t,e){const n={};for(const o of e)o in t&&(n[o]=t[o]);return n}function t_(t){const e={path:t.path,redirect:t.redirect,name:t.name,meta:t.meta||{},aliasOf:t.aliasOf,beforeEnter:t.beforeEnter,props:fI(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 fI(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 n_(t){for(;t;){if(t.record.aliasOf)return!0;t=t.parent}return!1}function hI(t){return t.reduce((e,n)=>jt(e,n.meta),{})}function pI(t,e){let n=0,o=e.length;for(;n!==o;){const i=n+o>>1;D4(t,e[i])<0?o=i:n=i+1}const r=mI(t);return r&&(o=e.lastIndexOf(r,o-1)),o}function mI(t){let e=t;for(;e=e.parent;)if(E4(e)&&D4(t,e)===0)return e}function E4({record:t}){return!!(t.name||t.components&&Object.keys(t.components).length||t.redirect)}function o_(t){const e=Jt(sm),n=Jt(cy),o=S(()=>{const l=p(t.to);return e.resolve(l)}),r=S(()=>{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(Wc.bind(null,u));if(f>-1)return f;const h=r_(l[c-2]);return c>1&&r_(u)===h&&d[d.length-1].path!==h?d.findIndex(Wc.bind(null,l[c-2])):f}),i=S(()=>r.value>-1&&xI(n.params,o.value.params)),s=S(()=>r.value>-1&&r.value===n.matched.length-1&&M4(n.params,o.value.params));function a(l={}){if(yI(l)){const c=e[p(t.replace)?"replace":"push"](p(t.to)).catch(md);return t.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:o,href:S(()=>o.value.href),isActive:i,isExactActive:s,navigate:a}}function gI(t){return t.length===1?t[0]:t}const vI=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:o_,setup(t,{slots:e}){const n=sr(o_(t)),{options:o}=Jt(sm),r=S(()=>({[i_(t.activeClass,o.linkActiveClass,"router-link-active")]:n.isActive,[i_(t.exactActiveClass,o.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=e.default&&gI(e.default(n));return t.custom?i:Nt("a",{"aria-current":n.isExactActive?t.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},i)}}}),bI=vI;function yI(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 xI(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(!vi(r)||r.length!==o.length||o.some((i,s)=>i.valueOf()!==r[s].valueOf()))return!1}return!0}function r_(t){return t?t.aliasOf?t.aliasOf.path:t.path:""}const i_=(t,e,n)=>t??e??n,wI=le({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(t,{attrs:e,slots:n}){const o=Jt(c1),r=S(()=>t.route||o.value),i=Jt(Kw,0),s=S(()=>{let c=p(i);const{matched:u}=r.value;let d;for(;(d=u[c])&&!d.components;)c++;return c}),a=S(()=>r.value.matched[s.value]);Gi(Kw,S(()=>s.value+1)),Gi(L4,a),Gi(c1,r);const l=Ie();return He(()=>[l.value,a.value,t.name],([c,u,d],[f,h,m])=>{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||!Wc(u,h)||!f)&&(u.enterCallbacks[d]||[]).forEach(b=>b(c))},{flush:"post"}),()=>{const c=r.value,u=t.name,d=a.value,f=d&&d.components[u];if(!f)return s_(n.default,{Component:f,route:c});const h=d.props[u],m=h?h===!0?c.params:typeof h=="function"?h(c):h:null,g=Nt(f,jt({},m,e,{onVnodeUnmounted:v=>{v.component.isUnmounted&&(d.instances[u]=null)},ref:l}));return s_(n.default,{Component:g,route:c})||g}}});function s_(t,e){if(!t)return null;const n=t(e);return n.length===1?n[0]:n}const _I=wI;function SI(t){const e=dI(t.routes,t),n=t.parseQuery||qE,o=t.stringifyQuery||Xw,r=t.history,i=Iu(),s=Iu(),a=Iu(),l=De(Js);let c=Js;fc&&t.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=Lg.bind(null,U=>""+U),d=Lg.bind(null,ME),f=Lg.bind(null,Rd);function h(U,te){let ne,ve;return O4(U)?(ne=e.getRecordMatcher(U),ve=te):ve=U,e.addRoute(ve,ne)}function m(U){const te=e.getRecordMatcher(U);te&&e.removeRoute(te)}function b(){return e.getRoutes().map(U=>U.record)}function g(U){return!!e.getRecordMatcher(U)}function v(U,te){if(te=jt({},te||l.value),typeof U=="string"){const j=Pg(n,U,te.path),ue=e.resolve({path:j.path},te),de=r.createHref(j.fullPath);return jt(j,ue,{params:f(ue.params),hash:Rd(j.hash),redirectedFrom:void 0,href:de})}let ne;if(U.path!=null)ne=jt({},U,{path:Pg(n,U.path,te.path).path});else{const j=jt({},U.params);for(const ue in j)j[ue]==null&&delete j[ue];ne=jt({},U,{params:d(j)}),te.params=d(te.params)}const ve=e.resolve(ne,te),me=U.hash||"";ve.params=u(f(ve.params));const I=LE(o,jt({},U,{hash:AE(me),path:ve.path})),W=r.createHref(I);return jt({fullPath:I,hash:me,query:o===Xw?YE(U.query):U.query||{}},ve,{redirectedFrom:void 0,href:W})}function y(U){return typeof U=="string"?Pg(n,U,l.value.path):jt({},U)}function x(U,te){if(c!==U)return Uc(xn.NAVIGATION_CANCELLED,{from:te,to:U})}function _(U){return O(U)}function C(U){return _(jt(y(U),{replace:!0}))}function L(U,te){const ne=U.matched[U.matched.length-1];if(ne&&ne.redirect){const{redirect:ve}=ne;let me=typeof ve=="function"?ve(U,te):ve;return typeof me=="string"&&(me=me.includes("?")||me.includes("#")?me=y(me):{path:me},me.params={}),jt({query:U.query,hash:U.hash,params:me.path!=null?{}:U.params},me)}}function O(U,te){const ne=c=v(U),ve=l.value,me=U.state,I=U.force,W=U.replace===!0,j=L(ne,ve);if(j)return O(jt(y(j),{state:typeof j=="object"?jt({},me,j.state):me,force:I,replace:W}),te||ne);const ue=ne;ue.redirectedFrom=te;let de;return!I&&PE(o,ve,ne)&&(de=Uc(xn.NAVIGATION_DUPLICATED,{to:ue,from:ve}),ce(ve,ve,!0,!1)),(de?Promise.resolve(de):D(ue,ve)).catch(fe=>as(fe)?as(fe,xn.NAVIGATION_GUARD_REDIRECT)?fe:ie(fe):V(fe,ue,ve)).then(fe=>{if(fe){if(as(fe,xn.NAVIGATION_GUARD_REDIRECT))return O(jt({replace:W},y(fe.to),{state:typeof fe.to=="object"?jt({},me,fe.to.state):me,force:I}),te||ue)}else fe=k(ue,ve,!0,W,me);return N(ue,ve,fe),fe})}function $(U,te){const ne=x(U,te);return ne?Promise.reject(ne):Promise.resolve()}function M(U){const te=oe.values().next().value;return te&&typeof te.runWithContext=="function"?te.runWithContext(U):U()}function D(U,te){let ne;const[ve,me,I]=KE(U,te);ne=Eg(ve.reverse(),"beforeRouteLeave",U,te);for(const j of ve)j.leaveGuards.forEach(ue=>{ne.push(sa(ue,U,te))});const W=$.bind(null,U,te);return ne.push(W),re(ne).then(()=>{ne=[];for(const j of i.list())ne.push(sa(j,U,te));return ne.push(W),re(ne)}).then(()=>{ne=Eg(me,"beforeRouteUpdate",U,te);for(const j of me)j.updateGuards.forEach(ue=>{ne.push(sa(ue,U,te))});return ne.push(W),re(ne)}).then(()=>{ne=[];for(const j of I)if(j.beforeEnter)if(vi(j.beforeEnter))for(const ue of j.beforeEnter)ne.push(sa(ue,U,te));else ne.push(sa(j.beforeEnter,U,te));return ne.push(W),re(ne)}).then(()=>(U.matched.forEach(j=>j.enterCallbacks={}),ne=Eg(I,"beforeRouteEnter",U,te,M),ne.push(W),re(ne))).then(()=>{ne=[];for(const j of s.list())ne.push(sa(j,U,te));return ne.push(W),re(ne)}).catch(j=>as(j,xn.NAVIGATION_CANCELLED)?j:Promise.reject(j))}function N(U,te,ne){a.list().forEach(ve=>M(()=>ve(U,te,ne)))}function k(U,te,ne,ve,me){const I=x(U,te);if(I)return I;const W=te===Js,j=fc?history.state:{};ne&&(ve||W?r.replace(U.fullPath,jt({scroll:W&&j&&j.scroll},me)):r.push(U.fullPath,me)),l.value=U,ce(U,te,ne,W),ie()}let A;function B(){A||(A=r.listen((U,te,ne)=>{if(!se.listening)return;const ve=v(U),me=L(ve,se.currentRoute.value);if(me){O(jt(me,{replace:!0,force:!0}),ve).catch(md);return}c=ve;const I=l.value;fc&&zE(jw(I.fullPath,ne.delta),im()),D(ve,I).catch(W=>as(W,xn.NAVIGATION_ABORTED|xn.NAVIGATION_CANCELLED)?W:as(W,xn.NAVIGATION_GUARD_REDIRECT)?(O(jt(y(W.to),{force:!0}),ve).then(j=>{as(j,xn.NAVIGATION_ABORTED|xn.NAVIGATION_DUPLICATED)&&!ne.delta&&ne.type===a1.pop&&r.go(-1,!1)}).catch(md),Promise.reject()):(ne.delta&&r.go(-ne.delta,!1),V(W,ve,I))).then(W=>{W=W||k(ve,I,!1),W&&(ne.delta&&!as(W,xn.NAVIGATION_CANCELLED)?r.go(-ne.delta,!1):ne.type===a1.pop&&as(W,xn.NAVIGATION_ABORTED|xn.NAVIGATION_DUPLICATED)&&r.go(-1,!1)),N(ve,I,W)}).catch(md)}))}let P=Iu(),F=Iu(),z;function V(U,te,ne){ie(U);const ve=F.list();return ve.length?ve.forEach(me=>me(U,te,ne)):console.error(U),Promise.reject(U)}function G(){return z&&l.value!==Js?Promise.resolve():new Promise((U,te)=>{P.add([U,te])})}function ie(U){return z||(z=!U,B(),P.list().forEach(([te,ne])=>U?ne(U):te()),P.reset()),U}function ce(U,te,ne,ve){const{scrollBehavior:me}=t;if(!fc||!me)return Promise.resolve();const I=!ne&&HE(jw(U.fullPath,0))||(ve||!ne)&&history.state&&history.state.scroll||null;return _n().then(()=>me(U,te,I)).then(W=>W&&VE(W)).catch(W=>V(W,U,te))}const he=U=>r.go(U);let Z;const oe=new Set,se={currentRoute:l,listening:!0,addRoute:h,removeRoute:m,clearRoutes:e.clearRoutes,hasRoute:g,getRoutes:b,resolve:v,options:t,push:_,replace:C,go:he,back:()=>he(-1),forward:()=>he(1),beforeEach:i.add,beforeResolve:s.add,afterEach:a.add,onError:F.add,isReady:G,install(U){U.component("RouterLink",bI),U.component("RouterView",_I),U.config.globalProperties.$router=se,Object.defineProperty(U.config.globalProperties,"$route",{enumerable:!0,get:()=>p(l)}),fc&&!Z&&l.value===Js&&(Z=!0,_(r.location).catch(ve=>{}));const te={};for(const ve in Js)Object.defineProperty(te,ve,{get:()=>l.value[ve],enumerable:!0});U.provide(sm,se),U.provide(cy,ck(te)),U.provide(c1,l);const ne=U.unmount;oe.add(U),U.unmount=function(){oe.delete(U),oe.size<1&&(c=Js,A&&A(),A=null,l.value=Js,Z=!1,z=!1),ne()}}};function re(U){return U.reduce((te,ne)=>te.then(()=>M(ne)),Promise.resolve())}return se}function uy(){return Jt(sm)}function zl(t){return Jt(cy)}function Nd(t,e){return Rl()?(ya(t,e),!0):!1}const Ig=new WeakMap,kI=(...t)=>{var e;const n=t[0],o=(e=Oo())===null||e===void 0?void 0:e.proxy,r=o??Rl();if(r==null&&!Vb())throw new Error("injectLocal must be called in setup");return r&&Ig.has(r)&&n in Ig.get(r)?Ig.get(r)[n]:Jt(...t)},u1=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const CI=t=>t!=null,AI=Object.prototype.toString,$I=t=>AI.call(t)==="[object Object]",fa=()=>{};function I4(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 TI(t,e={}){let n,o,r=fa;const i=l=>{clearTimeout(l),r(),r=fa};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 MI(...t){let e=0,n,o=!0,r=fa,i,s,a,l,c;!Ke(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=fa)};return f=>{const h=bt(s),m=Date.now()-e,b=()=>i=f();return u(),h<=0?(e=Date.now(),b()):(m>h?(e=Date.now(),(l||!o)&&b()):a&&(i=new Promise((g,v)=>{r=c?v:g,n=setTimeout(()=>{e=Date.now(),o=!0,g(b()),u()},Math.max(0,h-m))})),!l&&!n&&(n=setTimeout(()=>o=!0,h)),o=!1,i)}}function a_(t){return t.endsWith("rem")?Number.parseFloat(t)*16:Number.parseFloat(t)}function gd(t){return Array.isArray(t)?t:[t]}function OI(t){return Oo()}function BI(t,e=200,n={}){return I4(TI(e,n),t)}function R4(t,e=200,n=!1,o=!0,r=!1){return I4(MI(e,n,o,r),t)}function N4(t,e=!0,n){OI()?fn(t,n):e?t():_n(t)}function d1(t,e=1e3,n={}){const{immediate:o=!0,immediateCallback:r=!1}=n;let i=null;const s=De(!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&&u1&&c(),(Ke(e)||typeof e=="function")&&Nd(He(e,()=>{s.value&&u1&&c()})),Nd(l),{isActive:tl(s),pause:l,resume:c}}function LI(t,e,n){return He(t,e,{...n,immediate:!0})}const Hl=u1?window:void 0;function nr(t){var e;const n=bt(t);return(e=n==null?void 0:n.$el)!==null&&e!==void 0?e:n}function Yi(...t){const e=(o,r,i,s)=>(o.addEventListener(r,i,s),()=>o.removeEventListener(r,i,s)),n=S(()=>{const o=gd(bt(t[0])).filter(r=>r!=null);return o.every(r=>typeof r!="string")?o:void 0});return LI(()=>{var o,r;return[(o=(r=n.value)===null||r===void 0?void 0:r.map(i=>nr(i)))!==null&&o!==void 0?o:[Hl].filter(i=>i!=null),gd(bt(n.value?t[1]:t[0])),gd(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=$I(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 PI(t,e,n={}){const{window:o=Hl,ignore:r=[],capture:i=!0,detectIframe:s=!1,controls:a=!1}=n;if(!o)return a?{stop:fa,cancel:fa,trigger:fa}:fa;let l=!0;const c=g=>bt(r).some(v=>{if(typeof v=="string")return Array.from(o.document.querySelectorAll(v)).some(y=>y===g.target||g.composedPath().includes(y));{const y=nr(v);return y&&(g.target===y||g.composedPath().includes(y))}});function u(g){const v=bt(g);return v&&v.$.subTree.shapeFlag===16}function d(g,v){const y=bt(g),x=y.$.subTree&&y.$.subTree.children;return x==null||!Array.isArray(x)?!1:x.some(_=>_.el===v.target||v.composedPath().includes(_.el))}const f=g=>{const v=nr(t);if(g.target!=null&&!(!(v instanceof Element)&&u(t)&&d(t,g))&&!(!v||v===g.target||g.composedPath().includes(v))){if("detail"in g&&g.detail===0&&(l=!c(g)),!l){l=!0;return}e(g)}};let h=!1;const m=[Yi(o,"click",g=>{h||(h=!0,setTimeout(()=>{h=!1},0),f(g))},{passive:!0,capture:i}),Yi(o,"pointerdown",g=>{const v=nr(t);l=!c(g)&&!!(v&&!g.composedPath().includes(v))},{passive:!0}),s&&Yi(o,"blur",g=>{setTimeout(()=>{var v;const y=nr(t);((v=o.document.activeElement)===null||v===void 0?void 0:v.tagName)==="IFRAME"&&!(y!=null&&y.contains(o.document.activeElement))&&e(g)},0)},{passive:!0})].filter(Boolean),b=()=>m.forEach(g=>g());return a?{stop:b,cancel:()=>{l=!1},trigger:g=>{l=!0,f(g),l=!1}}:b}function DI(){const t=De(!1),e=Oo();return e&&fn(()=>{t.value=!0},e),t}function dy(t){const e=DI();return S(()=>(e.value,!!t()))}function EI(t,e,n={}){const{window:o=Hl,...r}=n;let i;const s=dy(()=>o&&"MutationObserver"in o),a=()=>{i&&(i.disconnect(),i=void 0)},l=He(S(()=>{const d=gd(bt(t)).map(nr).filter(CI);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 Nd(u),{isSupported:s,stop:u,takeRecords:c}}function l_(t,e={}){const{immediate:n=!0,fpsLimit:o=null,window:r=Hl,once:i=!1}=e,s=De(!1),a=S(()=>{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 m=h-l;if(a.value&&m<a.value){c=r.requestAnimationFrame(u);return}if(l=h,t({delta:m,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(),Nd(f),{isActive:ro(s),pause:f,resume:d}}const II=Symbol("vueuse-ssr-width");function RI(){const t=Vb()?kI(II,null):null;return typeof t=="number"?t:void 0}function F4(t,e={}){const{window:n=Hl,ssrWidth:o=RI()}=e,r=dy(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function"),i=De(typeof o=="number"),s=De(),a=De(!1),l=c=>{a.value=c.matches};return Fp(()=>{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>=a_(d[1])),f&&h&&(h=o<=a_(f[1])),u?!h:h});return}r.value&&(s.value=n.matchMedia(bt(t)),a.value=s.value.matches)}),Yi(s,"change",l,{passive:!0}),S(()=>a.value)}function zr(t,e,n={}){const{window:o=Hl,...r}=n;let i;const s=dy(()=>o&&"ResizeObserver"in o),a=()=>{i&&(i.disconnect(),i=void 0)},l=He(S(()=>{const u=bt(t);return Array.isArray(u)?u.map(d=>nr(d)):[nr(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 Nd(c),{isSupported:s,stop:c}}function NI(t,e={}){const{reset:n=!0,windowResize:o=!0,windowScroll:r=!0,immediate:i=!0,updateTiming:s="sync"}=e,a=De(0),l=De(0),c=De(0),u=De(0),d=De(0),f=De(0),h=De(0),m=De(0);function b(){const v=nr(t);if(!v){n&&(a.value=0,l.value=0,c.value=0,u.value=0,d.value=0,f.value=0,h.value=0,m.value=0);return}const y=v.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,m.value=y.y}function g(){s==="sync"?b():s==="next-frame"&&requestAnimationFrame(()=>b())}return zr(t,g),He(()=>nr(t),v=>!v&&g()),EI(t,g,{attributeFilter:["style","class"]}),r&&Yi("scroll",g,{capture:!0,passive:!0}),o&&Yi("resize",g,{passive:!0}),N4(()=>{i&&g()}),{height:a,bottom:l,left:c,right:u,top:d,width:f,x:h,y:m,update:g}}function FI(t,e={width:0,height:0},n={}){const{window:o=Hl,box:r="content-box"}=n,i=S(()=>{var d;return(d=nr(t))===null||d===void 0||(d=d.namespaceURI)===null||d===void 0?void 0:d.includes("svg")}),s=De(e.width),a=De(e.height),{stop:l}=zr(t,([d])=>{const f=r==="border-box"?d.borderBoxSize:r==="content-box"?d.contentBoxSize:d.devicePixelContentBoxSize;if(o&&i.value){const h=nr(t);if(h){const m=h.getBoundingClientRect();s.value=m.width,a.value=m.height}}else if(f){const h=gd(f);s.value=h.reduce((m,{inlineSize:b})=>m+b,0),a.value=h.reduce((m,{blockSize:b})=>m+b,0)}else s.value=d.contentRect.width,a.value=d.contentRect.height},n);N4(()=>{const d=nr(t);d&&(s.value="offsetWidth"in d?d.offsetWidth:e.width,a.value="offsetHeight"in d?d.offsetHeight:e.height)});const c=He(()=>nr(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 VI(t){if("interval"in t||"immediate"in t){const{interval:e="requestAnimationFrame",immediate:n=!0}=t;return e==="requestAnimationFrame"?o=>l_(o,{immediate:n}):o=>d1(o,e,t)}return l_}function zI(t={}){const{controls:e=!1,scheduler:n=VI(t)}=t,o=Ie(new Date),i=n(()=>o.value=new Date);return e?{now:o,...i}:o}const HI=[{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"}],WI={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 UI(t){return t.toISOString().slice(0,10)}function GI(t){if("updateInterval"in t){const{updateInterval:e=3e4}=t;return n=>d1(n,e)}return e=>d1(e,3e4)}function qI(t,e={}){const{controls:n=!1,scheduler:o=GI(e)}=e,{now:r,...i}=zI({scheduler:o,controls:!0}),s=S(()=>YI(new Date(bt(t)),e,bt(r)));return n?{timeAgo:s,...i}:s}function YI(t,e={},n=Date.now()){const{max:o,messages:r=WI,fullDateFormatter:i=UI,units:s=HI,showSecond:a=!1,rounding:l="round"}=e,c=typeof l=="number"?g=>+g.toFixed(l):Math[l],u=+n-+t,d=Math.abs(u);function f(g,v){return c(Math.abs(g)/v.value)}function h(g,v){const y=f(g,v),x=g>0,_=m(v.name,y,x);return m(x?"past":"future",_,x)}function m(g,v,y){const x=r[g];return typeof x=="function"?x(v,y):x.replace("{0}",v.toString())}if(d<6e4&&!a)return r.justNow;if(typeof o=="number"&&d>o)return i(new Date(t));if(typeof o=="string"){var b;const g=(b=s.find(v=>v.name===o))===null||b===void 0?void 0:b.max;if(g&&d>g)return i(new Date(t))}for(const[g,v]of s.entries()){if(f(u,v)<=0&&s[g-1])return h(u,s[g-1]);if(d<v.max)return h(u,v)}return r.invalid}var sn=(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))(sn||{});function gf(t){const e=new Map,n=Ie([]);function o(){n.value=Array.from(e.values())}return Gi(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 V4(t,e){const n=Jt(t,null);if(!n)return;const o=Oo();if(!o)return;const r=o.uid;fn(()=>{n.register(r,e())}),He(e,i=>{n.update(r,i)}),Ds(()=>{n.unregister(r)})}const z4=Symbol("ButtonGroupEntries"),H4=Symbol("DropdownEntries"),jI=Symbol("PaletteEntries"),XI=Symbol("IconRailEntries"),KI=Symbol("ToggleEntries"),ZI={sm:576,md:768,lg:992,xl:1200,xxl:1400};function Wl(t="md"){const e=typeof t=="number"?t:ZI[t];return{isNarrow:F4(`(max-width: ${e-1}px)`)}}const QI=le({__name:"ButtonIconCounter",props:{counter:{default:null},variant:{default:"secondary"}},setup(t){return(e,n)=>{const o=iy;return t.counter!=null?(w(),K(o,{key:0,variant:t.variant,class:"button-icon-counter text-nowrap",pill:""},{default:Q(()=>[Se(e.$slots,"default",{},()=>[Ge(xe(t.counter),1)])]),_:3},8,["variant"])):ae("",!0)}}}),JI=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=De(!1);function o(){n.value=e.hover}He(()=>e.hover,o,{immediate:!0});const r=S(()=>{let u="currentColor";return e.variant&&(u=`var(--bs-${e.variant}, currentColor)`),n.value&&e.hoverVariant&&(u=`var(--bs-${e.hoverVariant}, ${u})`),u}),i=S(()=>typeof e.size=="string"&&e.size.endsWith("%")),s=S(()=>!["2xs","xs","sm","md","lg","xl","2xl",void 0].includes(e.size)&&!i.value),a=S(()=>["2xs","xs","sm","md","lg","xl","2xl"].includes(e.size??"")),l=S(()=>({"--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=S(()=>({[`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:Me(["app-icon",p(c)]),style:Ot(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(),K(on(t.name),{key:0})):Se(u.$slots,"default",{key:1},void 0,!0)],38))}}),Le=(t,e)=>{const n=t.__vccOpts||t;for(const[o,r]of e)n[o]=r;return n},vf=Le(JI,[["__scopeId","data-v-ce29e486"]]),eR={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function tR(t,e){return w(),R("svg",eR,[...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 nR=$e({name:"ph-circle-notch",render:tR}),oR={key:1,class:"button-icon__label"},rR=le({__name:"ButtonIcon",props:{id:{},iconLeft:{},iconLeftVariant:{},iconLeftHoverVariant:{},iconLeftSize:{default:"1.25em"},iconRight:{},iconRightVariant:{},iconRightHoverVariant:{},iconRightSize:{default:"1.25em"},iconSpinner:{default:()=>nR},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=Jt("variant","action"),r=Jt("size","md"),i=ft("element"),s=t,a=e;function l(y){a(`click:${y}`)}const c=De(!1),u=S(()=>s.id??`button-icon-${++n}`),d=S(()=>({"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=S(()=>s.loading?s.iconSpinner:s.iconLeft),h=S(()=>s.loading?s.iconSpinner:s.iconRight),m=S(()=>s.loading&&s.loadingText?s.loadingText:s.label),b=S(()=>s.tooltipLabel??s.label),g=S(()=>!!b.value&&!s.hideTooltip&&(s.showTooltipForce||s.hideLabel)),v=S(()=>({pill:s.pill,pressed:s.pressed,size:s.size??r,tag:s.tag,type:s.type,variant:s.variant??o}));return(y,x)=>{const _=vf,C=QI,L=Id,O=Wo;return w(),K(O,Ct(p(v),{id:p(u),ref:"element",class:["button-icon",p(d)],"aria-label":p(b),onMouseenter:x[1]||(x[1]=$=>c.value=!0),onMouseleave:x[2]||(x[2]=$=>c.value=!1)}),{default:Q(()=>[Se(y.$slots,"start",{},void 0,!0),t.iconLeft||!t.iconLeft&&!t.iconRight&&t.loading?(w(),K(_,{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"])):ae("",!0),t.hideLabel?ae("",!0):(w(),R("span",oR,[Se(y.$slots,"default",Vn(Jo({labelOrLoadingText:p(m)})),()=>[Ge(xe(p(m)),1)],!0)])),t.iconRight?(w(),K(_,{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]=$=>l("icon-right"))},null,8,["name","size","spin","spin-duration","variant","hover-variant","hover"])):ae("",!0),t.counter!==null?(w(),K(C,{key:3,counter:t.counter,variant:t.counterVariant,style:Ot(t.counterStyle)},null,8,["counter","variant","style"])):ae("",!0),Se(y.$slots,"end",{},void 0,!0),p(g)?(w(),K(L,{key:4,"teleport-to":"body",delay:t.tooltipDelay,"boundary-padding":20,placement:t.tooltipPlacement,target:p(i),title:p(b)},null,8,["delay","placement","target","title"])):ae("",!0)]),_:3},16,["id","class","aria-label"])}}}),Rn=Le(rR,[["__scopeId","data-v-0205f754"]]),iR={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function sR(t,e){return w(),R("svg",iR,[...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 W4=$e({name:"ph-copy",render:sR}),aR={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function lR(t,e){return w(),R("svg",aR,[...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 fy=$e({name:"ph-check",render:lR}),c_=le({__name:"ActionCopyButton",props:{text:{},label:{default:"Copy"},variant:{default:"outline-secondary"},size:{default:"sm"}},setup(t){const e=t,n=De(!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=Rn;return w(),K(a,{"icon-left":p(n)?p(fy):p(W4),label:p(n)?"Copied!":t.label,variant:p(n)?"success":t.variant,size:t.size,onClick:r},null,8,["icon-left","label","variant","size"])}}}),Zt=le({__name:"FormControlCheckbox",props:rt({label:{}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=ht(t,"modelValue");return(n,o)=>{const r=Ts,i=Mn;return w(),K(i,{class:"form-control-checkbox"},{default:Q(()=>[H(r,{"model-value":e.value,class:"form-control-checkbox__input",switch:"","onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s)},{default:Q(()=>[Se(n.$slots,"default",{},()=>[Ge(xe(t.label),1)])]),_:3},8,["model-value"]),e.value?Se(n.$slots,"section",{key:0}):ae("",!0)]),_:3})}}});function _0(t){"@babel/helpers - typeof";return _0=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},_0(t)}var cR=/^\s+/,uR=/\s+$/;function nt(t,e){if(t=t||"",e=e||{},t instanceof nt)return t;if(!(this instanceof nt))return new nt(t,e);var n=dR(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}nt.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=U4(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=d_(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=d_(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=u_(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=u_(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 f_(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return mR(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(pn(this._r,255)*100)+"%",g:Math.round(pn(this._g,255)*100)+"%",b:Math.round(pn(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(pn(this._r,255)*100)+"%, "+Math.round(pn(this._g,255)*100)+"%, "+Math.round(pn(this._b,255)*100)+"%)":"rgba("+Math.round(pn(this._r,255)*100)+"%, "+Math.round(pn(this._g,255)*100)+"%, "+Math.round(pn(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:$R[f_(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var e="#"+h_(this._r,this._g,this._b,this._a),n=e,o=this._gradientType?"GradientType = 1, ":"";if(t){var r=nt(t);n="#"+h_(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 nt(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(yR,arguments)},brighten:function(){return this._applyModification(xR,arguments)},darken:function(){return this._applyModification(wR,arguments)},desaturate:function(){return this._applyModification(gR,arguments)},saturate:function(){return this._applyModification(vR,arguments)},greyscale:function(){return this._applyModification(bR,arguments)},spin:function(){return this._applyModification(_R,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(CR,arguments)},complement:function(){return this._applyCombination(SR,arguments)},monochromatic:function(){return this._applyCombination(AR,arguments)},splitcomplement:function(){return this._applyCombination(kR,arguments)},triad:function(){return this._applyCombination(p_,[3])},tetrad:function(){return this._applyCombination(p_,[4])}};nt.fromRatio=function(t,e){if(_0(t)=="object"){var n={};for(var o in t)t.hasOwnProperty(o)&&(o==="a"?n[o]=t[o]:n[o]=Xu(t[o]));t=n}return nt(t,e)};function dR(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=BR(t)),_0(t)=="object"&&(ls(t.r)&&ls(t.g)&&ls(t.b)?(e=fR(t.r,t.g,t.b),s=!0,a=String(t.r).substr(-1)==="%"?"prgb":"rgb"):ls(t.h)&&ls(t.s)&&ls(t.v)?(o=Xu(t.s),r=Xu(t.v),e=pR(t.h,o,r),s=!0,a="hsv"):ls(t.h)&&ls(t.s)&&ls(t.l)&&(o=Xu(t.s),i=Xu(t.l),e=hR(t.h,o,i),s=!0,a="hsl"),t.hasOwnProperty("a")&&(n=t.a)),n=U4(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 fR(t,e,n){return{r:pn(t,255)*255,g:pn(e,255)*255,b:pn(n,255)*255}}function u_(t,e,n){t=pn(t,255),e=pn(e,255),n=pn(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 hR(t,e,n){var o,r,i;t=pn(t,360),e=pn(e,100),n=pn(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 d_(t,e,n){t=pn(t,255),e=pn(e,255),n=pn(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 pR(t,e,n){t=pn(t,360)*6,e=pn(e,100),n=pn(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 f_(t,e,n,o){var r=[oi(Math.round(t).toString(16)),oi(Math.round(e).toString(16)),oi(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 mR(t,e,n,o,r){var i=[oi(Math.round(t).toString(16)),oi(Math.round(e).toString(16)),oi(Math.round(n).toString(16)),oi(G4(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 h_(t,e,n,o){var r=[oi(G4(o)),oi(Math.round(t).toString(16)),oi(Math.round(e).toString(16)),oi(Math.round(n).toString(16))];return r.join("")}nt.equals=function(t,e){return!t||!e?!1:nt(t).toRgbString()==nt(e).toRgbString()};nt.random=function(){return nt.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function gR(t,e){e=e===0?0:e||10;var n=nt(t).toHsl();return n.s-=e/100,n.s=am(n.s),nt(n)}function vR(t,e){e=e===0?0:e||10;var n=nt(t).toHsl();return n.s+=e/100,n.s=am(n.s),nt(n)}function bR(t){return nt(t).desaturate(100)}function yR(t,e){e=e===0?0:e||10;var n=nt(t).toHsl();return n.l+=e/100,n.l=am(n.l),nt(n)}function xR(t,e){e=e===0?0:e||10;var n=nt(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)))),nt(n)}function wR(t,e){e=e===0?0:e||10;var n=nt(t).toHsl();return n.l-=e/100,n.l=am(n.l),nt(n)}function _R(t,e){var n=nt(t).toHsl(),o=(n.h+e)%360;return n.h=o<0?360+o:o,nt(n)}function SR(t){var e=nt(t).toHsl();return e.h=(e.h+180)%360,nt(e)}function p_(t,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var n=nt(t).toHsl(),o=[nt(t)],r=360/e,i=1;i<e;i++)o.push(nt({h:(n.h+i*r)%360,s:n.s,l:n.l}));return o}function kR(t){var e=nt(t).toHsl(),n=e.h;return[nt(t),nt({h:(n+72)%360,s:e.s,l:e.l}),nt({h:(n+216)%360,s:e.s,l:e.l})]}function CR(t,e,n){e=e||6,n=n||30;var o=nt(t).toHsl(),r=360/n,i=[nt(t)];for(o.h=(o.h-(r*e>>1)+720)%360;--e;)o.h=(o.h+r)%360,i.push(nt(o));return i}function AR(t,e){e=e||6;for(var n=nt(t).toHsv(),o=n.h,r=n.s,i=n.v,s=[],a=1/e;e--;)s.push(nt({h:o,s:r,v:i})),i=(i+a)%1;return s}nt.mix=function(t,e,n){n=n===0?0:n||50;var o=nt(t).toRgb(),r=nt(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 nt(s)};nt.readability=function(t,e){var n=nt(t),o=nt(e);return(Math.max(n.getLuminance(),o.getLuminance())+.05)/(Math.min(n.getLuminance(),o.getLuminance())+.05)};nt.isReadable=function(t,e,n){var o=nt.readability(t,e),r,i;switch(i=!1,r=LR(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};nt.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=nt.readability(t,e[c]),i>r&&(r=i,o=nt(e[c]));return nt.isReadable(t,o,{level:a,size:l})||!s?o:(n.includeFallbackColors=!1,nt.mostReadable(t,["#fff","#000"],n))};var f1=nt.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"},$R=nt.hexNames=TR(f1);function TR(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}function U4(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function pn(t,e){MR(t)&&(t="100%");var n=OR(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 am(t){return Math.min(1,Math.max(0,t))}function fr(t){return parseInt(t,16)}function MR(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function OR(t){return typeof t=="string"&&t.indexOf("%")!=-1}function oi(t){return t.length==1?"0"+t:""+t}function Xu(t){return t<=1&&(t=t*100+"%"),t}function G4(t){return Math.round(parseFloat(t)*255).toString(16)}function m_(t){return fr(t)/255}var Qr=(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 ls(t){return!!Qr.CSS_UNIT.exec(t)}function BR(t){t=t.replace(cR,"").replace(uR,"").toLowerCase();var e=!1;if(f1[t])t=f1[t],e=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=Qr.rgb.exec(t))?{r:n[1],g:n[2],b:n[3]}:(n=Qr.rgba.exec(t))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Qr.hsl.exec(t))?{h:n[1],s:n[2],l:n[3]}:(n=Qr.hsla.exec(t))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Qr.hsv.exec(t))?{h:n[1],s:n[2],v:n[3]}:(n=Qr.hsva.exec(t))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Qr.hex8.exec(t))?{r:fr(n[1]),g:fr(n[2]),b:fr(n[3]),a:m_(n[4]),format:e?"name":"hex8"}:(n=Qr.hex6.exec(t))?{r:fr(n[1]),g:fr(n[2]),b:fr(n[3]),format:e?"name":"hex"}:(n=Qr.hex4.exec(t))?{r:fr(n[1]+""+n[1]),g:fr(n[2]+""+n[2]),b:fr(n[3]+""+n[3]),a:m_(n[4]+""+n[4]),format:e?"name":"hex8"}:(n=Qr.hex3.exec(t))?{r:fr(n[1]+""+n[1]),g:fr(n[2]+""+n[2]),b:fr(n[3]+""+n[3]),format:e?"name":"hex"}:!1}function LR(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 g_=(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}},Rg=(t,e)=>!!(Object.prototype.hasOwnProperty.call(t,e)&&typeof t[e]<"u"),Xf=t=>typeof t>"u",hy=["update:tinyColor","update:modelValue","input"];function py(t,e,n){let o,r;const i=S({get:()=>{const{modelValue:a,tinyColor:l,value:c}=t,u=l??a??c;return Xf(r)&&(Xf(c)||(r=nt(c).getFormat()),Xf(a)||(r=nt(a).getFormat())),Xf(o)&&(typeof c=="object"&&!(c instanceof nt)&&(o=!0),typeof a=="object"&&(o=!0)),nt(u)},set:a=>{s(a)}}),s=a=>{const l=nt(a);if(Rg(t,"tinyColor")&&e("update:tinyColor",l),Rg(t,"modelValue")){const c=g_(l,r,o);e("update:modelValue",c)}if(Rg(t,"value")){const c=g_(l,r,o);e("input",c)}};return i}const q4=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},PR=()=>{const t=window.scrollX||window.pageXOffset||document.documentElement.scrollLeft||0,e=window.scrollY||window.pageYOffset||document.documentElement.scrollTop||0;return{x:t,y:e}},Y4=t=>{const{x:e,y:n}=PR(),o=t.getBoundingClientRect();return{x:o.left+e,y:o.top+n}},my=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 DR(t){const e=t.toString();return e.indexOf(".")!==-1?e.split(".")[1].length:0}function Ng(t,e,n){return Math.min(Math.max(t,e),n)}const j4=(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)}},ER=["aria-valuetext"],IR=le({__name:"SaturationSlider",props:{hue:{},tinyColor:{},modelValue:{},value:{}},emits:["change"].concat(hy),setup(t,{emit:e}){const n=e,o=t,r=Ie(0),i=py(o,n),s=S(()=>i.value.toHsv()),a=S(()=>o.hue??s.value.h),l=S(()=>`hsl(${a.value}, 100%, 50%)`),c=S(()=>-(s.value.v*100)+1+100+"%"),u=S(()=>s.value.v<=.01?r.value*100+"%":s.value.s*100+"%"),d=Ie(null);function f(x){const _=d.value;if(!_)return;const C=_.clientWidth,L=_.clientHeight,{x:O,y:$}=Y4(_),{x:M,y:D}=q4(x),N=Ng(M-O,0,C),k=Ng(D-$,0,L),A=N/C,B=Ng(1-k/L,0,1);r.value=A;let P=Math.round(A*100),F=Math.round(B*100);P===1&&(P=.01),F===1&&(F=.01),h({h:a.value,s:P,v:F,a:s.value.a})}function h(x){i.value=x}const m=j4(f,20);function b(x){x.preventDefault(),x.type.startsWith("mouse")?(window.addEventListener("mousemove",m),window.addEventListener("mouseup",m),window.addEventListener("mouseup",g)):x.type.startsWith("touch")&&(window.addEventListener("touchmove",m),window.addEventListener("touchend",m),window.addEventListener("touchend",g))}function g(){v()}function v(){window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",m),window.removeEventListener("mouseup",g),window.removeEventListener("touchmove",m),window.removeEventListener("touchend",m),window.removeEventListener("touchend",g)}function y(x){switch(x.preventDefault(),my(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 zs(()=>{v()}),(x,_)=>(w(),R("div",{class:"vc-saturation-slider bg",style:Ot({background:l.value}),ref_key:"containerRef",ref:d,onMousedown:b,onTouchstart:b,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:Ot({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,ER)],36))}}),cu=(t,e)=>{const n=t.__vccOpts||t;for(const[o,r]of e)n[o]=r;return n},RR=cu(IR,[["__scopeId","data-v-4d048d6e"]]),h1=t=>typeof t<"u",NR={class:"vc-base-slider"},FR={key:0,class:"background"},VR=["aria-label","aria-valuemax","aria-valuenow"],zR=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=S(()=>n.modelValue??n.value),i=S(()=>{let m=r.value/n.max;return n.direction==="vertical"&&(m=1-m),100*m+"%"}),s=Ie(null);function a(m){h1(m)&&(o("input",m),o("update:modelValue",m))}function l(m){const{direction:b,max:g}=n,v=s.value;if(!v)return;const y=v.clientWidth,x=v.clientHeight,{x:_,y:C}=Y4(v),{x:L,y:O}=q4(m),$=L-_,M=O-C;let D;b==="vertical"?M<0?D=g:M>x?D=0:D=(1-M/x)*g:$<0?D=0:$>y?D=g:D=$/y*g,a(D)}const c=j4(l);function u(m){l(m),m.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(m){m.preventDefault();const{direction:b,max:g}=n,v=my(m),y=n.step??g/100,x=r.value;let _;switch(v){case"left":{if(b!=="horizontal")return;_=x-y<0?0:x-y;break}case"right":{if(b!=="horizontal")return;_=x+y>g?g:x+y;break}case"down":{if(b!=="vertical")return;_=x-y<0?0:x-y;break}case"up":{if(b!=="vertical")return;_=x+y>g?g:x+y;break}}a(_)}return zs(()=>{f()}),(m,b)=>(w(),R("div",NR,[m.$slots.background?(w(),R("div",FR,[Se(m.$slots,"background",{},void 0,!0)])):ae("",!0),T("div",{class:Me({slider:!0,horizontal:m.direction==="horizontal",vertical:m.direction==="vertical"}),ref_key:"containerRef",ref:s,onMousedown:u,onTouchstart:u,role:"slider","aria-label":m.ariaLabel,"aria-valuemax":m.max,"aria-valuemin":"0","aria-valuenow":r.value.toFixed(1),tabindex:"0",onKeydown:h},[T("div",{class:"picker-wrap",style:Ot({left:m.direction==="horizontal"?i.value:0,top:m.direction==="vertical"?i.value:0}),role:"presentation"},[Se(m.$slots,"picker",{},()=>[b[0]||(b[0]=T("div",{class:"picker"},null,-1))],!0)],4)],42,VR)]))}}),HR=cu(zR,[["__scopeId","data-v-972b0fad"]]),WR=le({__name:"HueSlider",props:{direction:{default:"horizontal"},modelValue:{default:0}},emits:["update:modelValue"],setup(t,{emit:e}){d3(u=>({"2f44f39d":r.value}));const n=t,o=e,r=S(()=>`linear-gradient(to ${n.direction==="horizontal"?"right":"top"}, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%)`),i=S(()=>{const u=Number(n.modelValue);return Number.isNaN(u)?0:u}),s=Ie();He(i,(u,d)=>{u!==0&&u-d>0&&(s.value="right"),u!==0&&u-d<0&&(s.value="left")});const a=S(()=>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(),K(HR,{class:"vc-hue-slider",max:360,step:1,modelValue:a.value,direction:u.direction,"onUpdate:modelValue":l,"aria-label":"Hue"},{background:Q(()=>d[0]||(d[0]=[T("div",{class:"gradient"},null,-1)])),picker:Q(()=>[Se(u.$slots,"default",{},void 0,!0)]),_:3},8,["modelValue","direction"]))}}),X4=cu(WR,[["__scopeId","data-v-5367c985"]]),UR={class:"vc-editable-input"},GR=["value","aria-label"],qR={key:0,class:"vc-input-desc","aria-hidden":"true"},YR=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(h1(h)&&+d>h){o("change",h);return}if(h1(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 m=DR(h),b=my(d);b==="up"&&(s((f+h).toFixed(m)),d.preventDefault()),b==="down"&&(s((f-h).toFixed(m)),d.preventDefault())}}return(d,f)=>(w(),R("div",UR,[T("input",{class:"vc-input-input",value:n.value,onKeydown:c,onInput:a,onBlur:l,"aria-label":p(r),id:i},null,40,GR),T("label",{for:i,class:"vc-input-label","aria-hidden":"true"},xe(n.label),1),d.desc?(w(),R("span",qR,xe(d.desc),1)):ae("",!0)]))}}),ol=cu(YR,[["__scopeId","data-v-9c267b2b"]]),v_=t=>nt(t).isValid(),K4=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=nt(c).toHexString()),u==="hex8"&&(d=nt(c).toHex8String()),n.withHash!==!0&&(d=d.replace("#","")),d},s=Ie(i(n.value,n.type));He(()=>n.value,c=>{nt.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||v_(c)&&o("change",c))},l=()=>{let c=s.value.length;s.value[0]==="#"&&(c=c-1),!(v_(s.value)&&(n.type==="hex"&&c===6||n.type==="hex8"&&c===8))&&(s.value=i(n.value,n.type))};return(c,u)=>(w(),K(ol,{label:n.label,a11y:r,value:s.value,onChange:a,onBlur:l},null,8,["label","value"]))}});function jR(){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";return t.charAt(Math.floor(Math.random()*t.length))+t.charAt(Math.floor(Math.random()*t.length))}const XR=t=>{const e=Ie(0),n=`__from__vc__hue__${jR()}`;return He(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=nt({...t.value.toHsl(),h:o});r[n]=!0,t.value=r,e.value=o}}},KR={class:"title","aria-hidden":"true"},ZR={class:"body"},QR={class:"saturation"},JR={class:"hue"},eN={class:"preview"},tN={class:"preview-label","aria-hidden":"true"},nN={class:"preview-swatches"},oN=["aria-label"],rN=["aria-label"],iN={class:"preview-label","aria-hidden":"true"},sN={key:0,class:"actions"},aN=["aria-label"],lN={class:"fields"},cN=["aria-label"];hy.concat(["ok","cancel","reset"]);const uN={class:"body",role:"listbox",tabindex:"0","aria-label":"Select a color"},dN=["onClick","aria-label","title","aria-selected","onKeydown"],fN=["#FF6900","#FCB900","#7BDCB5","#00D084","#8ED1FC","#0693E3","#ABB8C3","#EB144C","#F78DA7","#9900EF"],hN=le({__name:"TwitterPicker",props:{width:{default:276},presetColors:{default:()=>fN},triangle:{default:"top-left"},tinyColor:{},modelValue:{},value:{}},emits:hy,setup(t,{emit:e}){const n=t,o=py(n,e),r=S(()=>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:Me(["vc-twitter-picker",{tri_hide:n.triangle==="hide",tri_top_left:n.triangle==="top-left",tri_top_right:n.triangle==="top-right"}]),style:Ot({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",uN,[(w(!0),R(Ne,null,gt(l.presetColors,(u,d)=>(w(),R("span",{key:d,class:"swatch",style:Ot({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:tr(f=>s(u),["space"]),tabindex:"0"},null,44,dN))),128)),c[0]||(c[0]=T("div",{class:"hash","aria-hidden":"true"},"#",-1)),H(K4,{value:r.value,onChange:a},null,8,["value"]),c[1]||(c[1]=T("div",{class:"clear"},null,-1))])],6))}}),pN=cu(hN,[["__scopeId","data-v-e74ac697"]]),mN=le({__name:"HueSlider",props:{modelValue:{},value:{}},emits:["input","update:modelValue"],setup(t,{emit:e}){d3(a=>({"46ac36b6":s.value}));const n=e,o=t,r=S(()=>o.modelValue??o.value??0),i=a=>{n("input",a),n("update:modelValue",a)},s=S(()=>`hsl(${r.value}, 100%, 50%)`);return(a,l)=>(w(),K(X4,Ct({class:"vc-hue-wrap"},a.$attrs,{modelValue:r.value,"onUpdate:modelValue":i}),null,16,["modelValue"]))}}),gN=cu(mN,[["__scopeId","data-v-b3ac1ab2"]]),Z4=le({__name:"FormControlColorInputPopover",props:rt({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=ht(t,"modelValue"),n=t,o=ht(t,"open"),r=ft("contentRef");PI(r,()=>{n.manual&&(o.value=!1)},{detectIframe:!0,ignore:()=>[n.target]});const s=S(()=>nt(e.value).toHsv().h);function a(l){const c=nt({h:l,s:1,v:1}).toHexString();e.value=c}return(l,c)=>(w(),K(p(e4),{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:Q(()=>[T("div",{ref_key:"contentRef",ref:r},[H(p(pN),{modelValue:e.value,"onUpdate:modelValue":c[0]||(c[0]=u=>e.value=u),triangle:"hide",class:"mb-3"},null,8,["modelValue"]),H(p(gN),{"model-value":p(s),class:"color-picker-popover__hue","onUpdate:modelValue":a},null,8,["model-value"])],512)]),_:1},8,["modelValue","target","click","manual"]))}}),vN={class:"form-control-color-input__wrapper"},bN=["id","value"],yN=le({__name:"FormControlColorInput",props:rt({label:{},id:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=ht(t,"modelValue"),n=ft("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=Z4,l=Mn;return w(),K(l,{class:"form-control-color-input",label:t.label,"label-for":t.id},{default:Q(()=>[T("div",vN,[T("button",{ref_key:"swatchRef",ref:n,type:"button",class:"form-control-color-input__wrapper__swatch",style:Ot({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,bN)]),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"])}}}),ka=Le(yN,[["__scopeId","data-v-166af452"]]),xN=["data-d","title"],wN=le({__name:"FormControlDirectionPickerHandle",props:{pos:{},label:{},shape:{},active:{type:Boolean}},emits:["select"],setup(t){const e=t,n=S(()=>`direction-picker-handle--${e.shape}`);return(o,r)=>(w(),R("button",{type:"button",class:Me(["direction-picker-handle",[p(n),{"direction-picker-handle--active":t.active}]]),"data-d":t.pos,title:t.label,onClick:r[0]||(r[0]=vn(i=>o.$emit("select"),["stop","prevent"]))},null,10,xN))}}),_N=Le(wN,[["__scopeId","data-v-ef260532"]]),SN={class:"direction-picker-field"},kN=le({__name:"FormControlDirectionPickerField",props:{x:{},y:{}},setup(t){const e=t,n=S(()=>`${e.x*100}%`),o=S(()=>`${e.y*100}%`),r=S(()=>{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",SN,[T("div",{class:"direction-picker-field__crosshair-h",style:Ot({top:p(o)})},null,4),T("div",{class:"direction-picker-field__crosshair-v",style:Ot({left:p(n)})},null,4),T("div",{class:"direction-picker-field__rect",style:Ot(p(r))},null,4)]))}}),CN=Le(kN,[["__scopeId","data-v-2f06dda2"]]),AN=le({__name:"FormControlDirectionPicker",props:rt({label:{},size:{default:"sm"}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=ht(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=S(()=>o.find(s=>s.value===e.value)??o[4]),i=S(()=>`direction-picker__anchor--${n.size}`);return(s,a)=>{const l=CN,c=_N,u=Mn;return w(),K(u,{class:"direction-picker",label:t.label},{default:Q(()=>[T("div",{class:Me(["direction-picker__anchor",p(i)])},[H(l,{x:p(r).x,y:p(r).y},null,8,["x","y"]),(w(),R(Ne,null,gt(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"])}}}),Q4=Le(AN,[["__scopeId","data-v-37d271a9"]]),$N=le({__name:"DisplayColorSwatch",props:{color:{},bordered:{type:Boolean},size:{default:"md"}},setup(t){const e=t,n=S(()=>({"display-color-swatch--sm":e.size==="sm","display-color-swatch--bordered":e.bordered}));return(o,r)=>(w(),R("span",{class:Me(["display-color-swatch",p(n)]),style:Ot({backgroundColor:t.color})},null,6))}}),lm=Le($N,[["__scopeId","data-v-9e199d96"]]),TN={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function MN(t,e){return w(),R("svg",TN,[...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 gy=$e({name:"ph-plus",render:MN}),ON=le({__name:"ButtonAdd",props:{label:{default:"Add"},size:{default:"default"}},emits:["click"],setup(t){return(e,n)=>{const o=Rn;return w(),K(o,{"icon-left":p(gy),label:t.label,variant:"outline-secondary",class:Me(["button-add",{"button-add--sm":t.size==="sm"}]),onClick:n[0]||(n[0]=r=>e.$emit("click"))},{default:Q(()=>[Se(e.$slots,"default",{},void 0,!0)]),_:3},8,["icon-left","label","class"])}}}),vl=Le(ON,[["__scopeId","data-v-fec65d28"]]),BN={class:"d-flex flex-wrap gap-1"},LN=["onClick"],PN={class:"form-control-colors-input__tag__hex"},DN=["aria-label","onClick"],EN=le({__name:"FormControlColorsInput",props:rt({label:{},id:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=ht(t,"modelValue"),n=ft("addBtnRef"),o=De("#4e79a7"),r=De(-1),i=Ie(null),s=De(!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=lm,m=Z4,b=Mn;return w(),K(b,{class:"form-control-colors-input",label:t.label,"label-for":t.id},{default:Q(()=>[T("div",BN,[(w(!0),R(Ne,null,gt(e.value,(g,v)=>(w(),R("span",{key:v,class:"form-control-colors-input__tag"},[T("button",{type:"button",class:"form-control-colors-input__tag__swatch-btn",onClick:y=>a(v,y)},[H(h,{color:g,size:"sm"},null,8,["color"])],8,LN),T("span",PN,xe(g),1),T("button",{type:"button",class:"form-control-colors-input__tag__remove","aria-label":`Remove ${g}`,onClick:y=>c(v)}," × ",8,DN)]))),128)),H(vl,{id:t.id,ref_key:"addBtnRef",ref:n,size:"sm",onClick:l},null,8,["id"])]),H(m,{open:p(s),"onUpdate:open":f[0]||(f[0]=g=>Ke(s)?s.value=g:null),"model-value":p(o),target:p(i),manual:"","onUpdate:modelValue":u},null,8,["open","model-value","target"])]),_:1},8,["label","label-for"])}}}),IN=Le(EN,[["__scopeId","data-v-b39aae3e"]]),RN={class:"form-control-dropdown-item__content"},NN={class:"form-control-dropdown-item__content__text"},FN={key:1,class:"form-control-dropdown-item__content__visual"},VN=["src"],zN=le({__name:"FormControlDropdownItem",props:{label:{},description:{},visual:{},icon:{},active:{type:Boolean},lightLabel:{type:Boolean}},emits:["select"],setup(t){const e=t,n=S(()=>({"form-control-dropdown-item__content__text__label--bold":!e.lightLabel&&e.label&&e.description})),o=S(()=>({"text-white-50":e.active,"text-secondary":!e.active}));return(r,i)=>{const s=i4;return w(),K(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:Q(()=>[T("div",RN,[t.icon?(w(),K(on(t.icon),{key:0,class:"form-control-dropdown-item__content__icon"})):ae("",!0),T("div",NN,[T("span",{class:Me(["form-control-dropdown-item__content__text__label",p(n)])},xe(t.label),3),t.description?(w(),R("small",{key:0,class:Me(["form-control-dropdown-item__content__text__description",p(o)])},xe(t.description),3)):ae("",!0)]),t.visual?(w(),R("div",FN,[typeof t.visual!="string"?(w(),K(on(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,VN))])):ae("",!0)])]),_:1},8,["active"])}}}),HN=Le(zN,[["__scopeId","data-v-b5a1db22"]]),WN={key:0,class:"form-control-dropdown__toggle__content"},UN=le({__name:"FormControlDropdown",props:rt({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=ht(t,"modelValue"),n=t,{entries:o}=gf(H4),r=S(()=>o.value.length>0?o.value:n.options),i=ft("elementRef"),s=NI(i),a=ft("dropdownRef");function l(){var b,g;const{id:h=null}=((g=(b=a.value)==null?void 0:b.$el)==null?void 0:g.querySelector(".dropdown-toggle"))??{};if(!h)return;const m=document.getElementById(`${h}-menu`);m&&(m.style.width=`${Math.max(s.width.value,n.minMenuWidth)}px`)}He(s.width,l);const c=S(()=>({"form-control-dropdown--light-label":n.lightLabel})),u=S(()=>({"form-control-dropdown__toggle--block":n.block})),d=S(()=>r.value.find(h=>h.value===e.value));function f(h){var m;e.value=h,(m=a.value)==null||m.hide()}return(h,m)=>{const b=HN,g=sy,v=Mn;return w(),K(v,{ref_key:"elementRef",ref:i,class:Me(["form-control-dropdown",p(c)]),label:t.label,"label-for":t.id,size:t.size},{default:Q(()=>{var y;return[Se(h.$slots,"default",{},void 0,!0),H(g,{ref_key:"dropdownRef",ref:a,class:Me(["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":Q(()=>[Se(h.$slots,"button-content",{},()=>{var x,_;return[(x=p(d))!=null&&x.icon?(w(),R("span",WN,[(w(),K(on(p(d).icon),{class:"form-control-dropdown__toggle__icon"})),Ge(" "+xe(p(d).label),1)])):(w(),R(Ne,{key:1},[Ge(xe(((_=p(d))==null?void 0:_.label)??t.placeholder??""),1)],64))]},!0)]),default:Q(()=>[Se(h.$slots,"menu",{hide:()=>{var x;return(x=p(a))==null?void 0:x.hide()}},()=>[(w(!0),R(Ne,null,gt(p(r),x=>(w(),K(b,{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"])}}}),Dn=Le(UN,[["__scopeId","data-v-5b435452"]]),GN={class:"form-control-button-group__container__buttons__visual bg-body rounded-1"},qN=["src"],YN=le({__name:"FormControlButtonGroup",props:rt({label:{},options:{default:()=>[]},block:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=ht(t,"modelValue"),n=t,{entries:o}=gf(z4),r=S(()=>o.value.length>0?o.value:n.options),i=ft("containerRef"),s=De(!1),a=S(()=>({"form-control-button-group__container--block":n.block,"form-control-button-group__container--collapsed":s.value})),l=S(()=>({"form-control-button-group__container__buttons--block":n.block})),c=S(()=>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(m=>m.scrollWidth>m.clientWidth+1);s.value=h||d.scrollWidth>d.clientWidth+1}return zr(i,u),(d,f)=>{const h=Dn,m=Rn,b=L7,g=Mn;return w(),K(g,{class:"form-control-button-group",label:t.label},{default:Q(()=>[p(s)?(w(),K(h,{key:0,modelValue:e.value,"onUpdate:modelValue":f[0]||(f[0]=v=>e.value=v),options:p(c),block:"","light-label":"",class:"form-control-button-group__dropdown"},null,8,["modelValue","options"])):ae("",!0),T("div",{ref_key:"containerRef",ref:i,class:Me(["form-control-button-group__container",p(a)])},[H(b,{class:Me(["form-control-button-group__container__buttons",p(l)])},{default:Q(()=>[(w(!0),R(Ne,null,gt(p(r),v=>(w(),K(m,{key:v.value,"icon-left":v.icon??v.iconLeft,label:v.text,"hide-label":!v.icon&&!!v.iconLeft,"hide-tooltip":!v.description,"tooltip-label":v.description,"show-tooltip-force":!!v.description,variant:e.value===v.value?"primary":"outline-primary",tabindex:p(s)?-1:void 0,onClick:y=>e.value=v.value},xr({_:2},[v.visual?{name:"start",fn:Q(()=>[T("div",GN,[typeof v.visual!="string"?(w(),K(on(v.visual),{key:0,class:"form-control-button-group__container__buttons__visual__content"})):(w(),R("img",{key:1,src:v.visual,alt:"",class:"form-control-button-group__container__buttons__visual__content"},null,8,qN))])]),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),Se(d.$slots,"default",{},void 0,!0),Se(d.$slots,`section:${e.value}`,{},void 0,!0)]),_:3},8,["label"])}}}),An=Le(YN,[["__scopeId","data-v-dfd21712"]]),Kf=le({__name:"FormControlButtonGroupEntry",props:{value:{},text:{},iconLeft:{},description:{},visual:{},icon:{}},setup(t){const e=t,n=ts(),o=n["icon-left"]?$e(le({render:()=>n["icon-left"]()})):void 0;return V4(z4,()=>({value:e.value,text:e.text,iconLeft:e.iconLeft??o,description:e.description,visual:e.visual,icon:e.icon})),(r,i)=>Se(r.$slots,"default")}}),jN={class:"form-control-slider-input__row"},XN={key:0,class:"form-control-slider-input__row__suffix"},KN=le({__name:"FormControlSliderInput",props:rt({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=ht(t,"modelValue");return(n,o)=>{const r=Ws,i=Mn;return w(),K(i,{class:"form-control-slider-input",label:t.label,"label-for":t.id},{default:Q(()=>[T("div",jN,[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"]),Se(n.$slots,"suffix",{},()=>[t.suffix?(w(),R("small",XN,xe(t.suffix),1)):ae("",!0)],!0)])]),_:3},8,["label","label-for"])}}}),br=Le(KN,[["__scopeId","data-v-23b8b888"]]),ZN={class:"form-control-units-input__row"},QN={class:"form-control-units-input__row__group"},JN=le({__name:"FormControlUnitsInput",props:rt({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=ht(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=S(()=>o(e.value).num),i=S(()=>o(e.value).unit),s=S(()=>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=Ws,f=I7,h=sy,m=Mn;return w(),K(m,{class:"form-control-units-input",label:t.label,"label-for":t.id},{default:Q(()=>[T("div",ZN,[t.noSlider?ae("",!0):(w(),K(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",QN,[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:Q(()=>[(w(!0),R(Ne,null,gt(t.units,b=>(w(),K(f,{key:b,active:b===p(i),onClick:g=>l(b)},{default:Q(()=>[Ge(xe(b),1)]),_:2},1032,["active","onClick"]))),128))]),_:1},8,["text"])])])]),_:1},8,["label","label-for"])}}}),Nh=Le(JN,[["__scopeId","data-v-21f940c0"]]),ic=le({__name:"FormControlDropdownEntry",props:{value:{},label:{},description:{},visual:{},icon:{}},setup(t){const e=t,n=ts(),o=n.icon?$e(le({render:()=>n.icon()})):void 0;return V4(H4,()=>({value:e.value,label:e.label,description:e.description,visual:e.visual,icon:e.icon??o})),(r,i)=>Se(r.$slots,"default")}}),eF={class:"form-control-text-input__row"},tF={key:0,class:"form-control-text-input__row__suffix"},nF=le({__name:"FormControlTextInput",props:rt({label:{},id:{},placeholder:{default:void 0},suffix:{default:void 0}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=ht(t,"modelValue");return(n,o)=>{const r=Ws,i=Mn;return w(),K(i,{class:"form-control-text-input",label:t.label,"label-for":t.id},{default:Q(()=>[T("div",eF,[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",tF,xe(t.suffix),1)):ae("",!0)])]),_:1},8,["label","label-for"])}}}),cm=Le(nF,[["__scopeId","data-v-f856cd26"]]),oF={class:"display-palette"},rF=le({__name:"DisplayPalette",props:{colors:{},bordered:{type:Boolean}},setup(t){return(e,n)=>{const o=lm;return w(),R("span",oF,[(w(!0),R(Ne,null,gt(t.colors,(r,i)=>(w(),K(o,{key:i,color:r,bordered:t.bordered,size:"sm"},null,8,["color","bordered"]))),128))])}}}),iF=Le(rF,[["__scopeId","data-v-329d58de"]]),sF={class:"form-control-palette__preview pe-1"},aF={class:"form-control-palette__preview__name flex-grow-1"},lF={class:"form-control-palette__item"},cF={class:"flex-grow-1"},uF=le({__name:"FormControlPalette",props:rt({label:{default:void 0},id:{default:void 0},palettes:{default:()=>[]}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=ht(t,"modelValue"),n=t,{entries:o}=gf(jI),r=S(()=>o.value.length>0?o.value:n.palettes),i=ft("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=S(()=>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=iF,f=i4,h=sy,m=Mn;return w(),K(m,{class:"form-control-palette",label:t.label,"label-for":t.id},{default:Q(()=>[Se(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":Q(()=>{var b;return[T("span",sF,[T("span",aF,xe(((b=p(a))==null?void 0:b.label)??""),1),p(a)?(w(),K(d,{key:0,colors:p(a).colors,bordered:""},null,8,["colors"])):ae("",!0)])]}),default:Q(()=>[(w(!0),R(Ne,null,gt(p(r),b=>(w(),K(f,{key:b.value,active:e.value===b.value,onClick:g=>l(b.value)},{default:Q(()=>[T("span",lF,[T("span",cF,xe(b.label),1),H(d,{colors:b.colors,bordered:""},null,8,["colors"])])]),_:2},1032,["active","onClick"]))),128))]),_:1},512)]),_:3},8,["label","label-for"])}}}),dF=Le(uF,[["__scopeId","data-v-98c9538c"]]);function fF(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function S0(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 Gc(t){return t=S0(Math.abs(t)),t?t[1]:NaN}function hF(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 pF(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var mF=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function k0(t){if(!(e=mF.exec(t)))throw new Error("invalid format: "+t);var e;return new vy({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]})}k0.prototype=vy.prototype;function vy(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+""}vy.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 gF(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 C0;function vF(t,e){var n=S0(t,e);if(!n)return C0=void 0,t.toPrecision(e);var o=n[0],r=n[1],i=r-(C0=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")+S0(t,Math.max(0,e+i-1))[0]}function b_(t,e){var n=S0(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 y_={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:fF,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)=>b_(t*100,e),r:b_,s:vF,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function x_(t){return t}var w_=Array.prototype.map,__=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function bF(t){var e=t.grouping===void 0||t.thousands===void 0?x_:hF(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?x_:pF(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=k0(d);var h=d.fill,m=d.align,b=d.sign,g=d.symbol,v=d.zero,y=d.width,x=d.comma,_=d.precision,C=d.trim,L=d.type;L==="n"?(x=!0,L="g"):y_[L]||(_===void 0&&(_=12),C=!0,L="g"),(v||h==="0"&&m==="=")&&(v=!0,h="0",m="=");var O=(f&&f.prefix!==void 0?f.prefix:"")+(g==="$"?n:g==="#"&&/[boxX]/.test(L)?"0"+L.toLowerCase():""),$=(g==="$"?o:/[%p]/.test(L)?s:"")+(f&&f.suffix!==void 0?f.suffix:""),M=y_[L],D=/[defgprs%]/.test(L);_=_===void 0?6:/[gprs]/.test(L)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function N(k){var A=O,B=$,P,F,z;if(L==="c")B=M(k)+B,k="";else{k=+k;var V=k<0||1/k<0;if(k=isNaN(k)?l:M(Math.abs(k),_),C&&(k=gF(k)),V&&+k==0&&b!=="+"&&(V=!1),A=(V?b==="("?b:a:b==="-"||b==="("?"":b)+A,B=(L==="s"&&!isNaN(k)&&C0!==void 0?__[8+C0/3]:"")+B+(V&&b==="("?")":""),D){for(P=-1,F=k.length;++P<F;)if(z=k.charCodeAt(P),48>z||z>57){B=(z===46?r+k.slice(P+1):k.slice(P))+B,k=k.slice(0,P);break}}}x&&!v&&(k=e(k,1/0));var G=A.length+k.length+B.length,ie=G<y?new Array(y-G+1).join(h):"";switch(x&&v&&(k=e(ie+k,ie.length?y-B.length:1/0),ie=""),m){case"<":k=A+k+B+ie;break;case"=":k=A+ie+k+B;break;case"^":k=ie.slice(0,G=ie.length>>1)+A+k+B+ie.slice(G);break;default:k=ie+A+k+B;break}return i(k)}return N.toString=function(){return d+""},N}function u(d,f){var h=Math.max(-8,Math.min(8,Math.floor(Gc(f)/3)))*3,m=Math.pow(10,-h),b=c((d=k0(d),d.type="f",d),{suffix:__[8+h/3]});return function(g){return b(m*g)}}return{format:c,formatPrefix:u}}var Zf,uu,J4;yF({thousands:",",grouping:[3],currency:["$",""]});function yF(t){return Zf=bF(t),uu=Zf.format,J4=Zf.formatPrefix,Zf}function xF(t){return Math.max(0,-Gc(Math.abs(t)))}function wF(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Gc(e)/3)))*3-Gc(Math.abs(t)))}function _F(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Gc(e)-Gc(t))+1}const eC={prefix:"",suffix:"",decimals:"2",scale:"none",negStyle:"minus",thousandsSep:!0};function by(t){let e="";return t.negStyle==="paren"&&(e+="("),t.thousandsSep&&(e+=","),t.decimals==="auto"?e+="~":e+=`.${t.decimals}`,e+=t.scale==="%"?"%":"f",e}function Fg(t){const e=by(t);return t.prefix||t.suffix?`${t.prefix}|${e}|${t.suffix}`:e}function SF(t){const e={...eC};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 kF(t,e){try{const n=by(e),o=uu(n)(Math.abs(t)),r=`${e.prefix}${o}${e.suffix}`;return t<0?e.negStyle==="paren"?`(${r})`:`−${r}`:r}catch{return String(t)}}const CF={class:"form-control-number-format__popover"},AF={class:"form-control-number-format__popover__preview"},$F={class:"form-control-number-format__popover__preview__cell__label"},TF={class:"form-control-number-format__popover__body"},MF={class:"form-control-number-format__popover__body__chips"},OF=["onClick"],BF={class:"form-control-number-format__popover__body__grid-2"},LF={class:"form-control-number-format__popover__body__btn-group"},PF=["onClick"],DF={class:"form-control-number-format__popover__body__btn-group"},EF=["onClick"],IF={class:"form-control-number-format__popover__body__check-row"},RF={class:"form-control-number-format__popover__body__d3-row"},NF={class:"form-control-number-format__popover__body__d3-row__value"},FF=le({__name:"FormControlNumberFormat",props:rt({label:{default:void 0},id:{default:void 0},block:{type:Boolean,default:!0}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=ht(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=sr({...eC}),a=De(null);He(()=>e.value,g=>{g!==Fg(s)&&Object.assign(s,SF(g??""))},{immediate:!0});const l=S(()=>by(s)),c=S(()=>e.value||"auto");function u(){a.value=null,e.value=Fg(s)}function d(g){s.decimals=g,u()}function f(g){s.negStyle=g,u()}function h(g){Object.assign(s,{...g.config}),a.value=g.label,e.value=Fg(s)}function m(g){return kF(g,s)}const b=S(()=>r.map(g=>({...g,formatted:m(g.value)})));return(g,v)=>{const y=Dn;return w(),K(y,{id:t.id,modelValue:e.value,"onUpdate:modelValue":v[4]||(v[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":Q(()=>[T("span",{class:Me(["form-control-number-format__trigger-text",{"text-secondary":!e.value}])},xe(p(c)),3)]),menu:Q(()=>[T("div",CF,[T("div",AF,[(w(!0),R(Ne,null,gt(p(b),(x,_)=>(w(),R("div",{key:_,class:"form-control-number-format__popover__preview__cell"},[T("div",$F,xe(x.label),1),T("div",{class:Me(["form-control-number-format__popover__preview__cell__value",x.cls])},xe(x.formatted),3)]))),128))]),T("div",TF,[T("div",null,[v[5]||(v[5]=T("div",{class:"form-control-number-format__popover__body__section-label"}," Presets ",-1)),T("div",MF,[(w(),R(Ne,null,gt(i,x=>T("button",{key:x.label,class:Me(["form-control-number-format__popover__body__chips__chip",{"form-control-number-format__popover__body__chips__chip--active":p(a)===x.label}]),onClick:_=>h(x)},xe(x.label),11,OF)),64))])]),v[12]||(v[12]=T("hr",{class:"form-control-number-format__popover__body__sep"},null,-1)),T("div",BF,[T("div",null,[v[6]||(v[6]=T("div",{class:"form-control-number-format__popover__body__grid-2__field-label"}," Prefix ",-1)),ir(T("input",{"onUpdate:modelValue":v[0]||(v[0]=x=>p(s).prefix=x),class:"form-control-number-format__popover__body__grid-2__input",placeholder:"e.g. $",onInput:u},null,544),[[f0,p(s).prefix]])]),T("div",null,[v[7]||(v[7]=T("div",{class:"form-control-number-format__popover__body__grid-2__field-label"}," Suffix ",-1)),ir(T("input",{"onUpdate:modelValue":v[1]||(v[1]=x=>p(s).suffix=x),class:"form-control-number-format__popover__body__grid-2__input",placeholder:"e.g. %",onInput:u},null,544),[[f0,p(s).suffix]])])]),T("div",null,[v[8]||(v[8]=T("div",{class:"form-control-number-format__popover__body__section-label"}," Decimal places ",-1)),T("div",LF,[(w(),R(Ne,null,gt(n,x=>T("button",{key:x,class:Me(["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)},xe(x),11,PF)),64))])]),T("div",null,[v[9]||(v[9]=T("div",{class:"form-control-number-format__popover__body__section-label"}," Negatives ",-1)),T("div",DF,[(w(),R(Ne,null,gt(o,x=>T("button",{key:x.id,class:Me(["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)},xe(x.label),11,EF)),64))])]),T("label",IF,[ir(T("input",{"onUpdate:modelValue":v[2]||(v[2]=x=>p(s).thousandsSep=x),type:"checkbox",class:"form-control-number-format__popover__body__check-row__checkbox",onChange:v[3]||(v[3]=x=>u())},null,544),[[f3,p(s).thousandsSep]]),v[10]||(v[10]=T("span",null,"Thousands separator",-1))]),v[13]||(v[13]=T("hr",{class:"form-control-number-format__popover__body__sep"},null,-1)),T("div",RF,[v[11]||(v[11]=T("span",{class:"form-control-number-format__popover__body__d3-row__label"},"d3·fmt",-1)),T("span",NF,xe(p(l)),1)])])])]),_:1},8,["id","modelValue","label","block"])}}}),VF=Le(FF,[["__scopeId","data-v-959c1f3d"]]),Vg=new Date,zg=new Date;function os(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=>os(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)=>(Vg.setTime(+i),zg.setTime(+s),t(Vg),t(zg),Math.floor(n(Vg,zg))),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 zF=1e3,yy=zF*60,HF=yy*60,Fd=HF*24,tC=Fd*7,xy=os(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*yy)/Fd,t=>t.getDate()-1);xy.range;const wy=os(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Fd,t=>t.getUTCDate()-1);wy.range;const WF=os(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Fd,t=>Math.floor(t/Fd));WF.range;function Ul(t){return os(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())*yy)/tC)}const nC=Ul(0),A0=Ul(1),UF=Ul(2),GF=Ul(3),qc=Ul(4),qF=Ul(5),YF=Ul(6);nC.range;A0.range;UF.range;GF.range;qc.range;qF.range;YF.range;function Gl(t){return os(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)/tC)}const oC=Gl(0),$0=Gl(1),jF=Gl(2),XF=Gl(3),Yc=Gl(4),KF=Gl(5),ZF=Gl(6);oC.range;$0.range;jF.range;XF.range;Yc.range;KF.range;ZF.range;const Al=os(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());Al.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:os(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)});Al.range;const $l=os(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());$l.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:os(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)});$l.range;function Fh(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function QF(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function rC(t){let e,n,o;t.length!==2?(e=Fh,n=(a,l)=>Fh(t(a),l),o=(a,l)=>t(a)-l):(e=t===Fh||t===QF?t:JF,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 JF(){return 0}function eV(t){return t===null?NaN:+t}const tV=rC(Fh),nV=tV.right,oV=rC(eV).center;class S_ extends Map{constructor(e,n=sV){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(k_(this,e))}has(e){return super.has(k_(this,e))}set(e,n){return super.set(rV(this,e),n)}delete(e){return super.delete(iV(this,e))}}function k_({_intern:t,_key:e},n){const o=e(n);return t.has(o)?t.get(o):n}function rV({_intern:t,_key:e},n){const o=e(n);return t.has(o)?t.get(o):(t.set(o,n),n)}function iV({_intern:t,_key:e},n){const o=e(n);return t.has(o)&&(n=t.get(o),t.delete(o)),n}function sV(t){return t!==null&&typeof t=="object"?t.valueOf():t}const aV=Math.sqrt(50),lV=Math.sqrt(10),cV=Math.sqrt(2);function T0(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>=aV?10:i>=lV?5:i>=cV?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?T0(t,e,n*2):[a,l,c]}function uV(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?T0(e,t,n):T0(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 p1(t,e,n){return e=+e,t=+t,n=+n,T0(t,e,n)[2]}function dV(t,e,n){e=+e,t=+t,n=+n;const o=e<t,r=o?p1(e,t,n):p1(t,e,n);return(o?-1:1)*(r<0?1/-r:r)}function Vd(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 fV(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 Hg(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 Wg(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 Ru(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function hV(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=Nu(r),u=Fu(r),d=Nu(i),f=Fu(i),h=Nu(s),m=Fu(s),b=Nu(a),g=Fu(a),v=Nu(l),y=Fu(l),x={a:z,A:V,b:G,B:ie,c:null,d:O_,e:O_,f:IV,g:qV,G:jV,H:PV,I:DV,j:EV,L:iC,m:RV,M:NV,p:ce,q:he,Q:P_,s:D_,S:FV,u:VV,U:zV,V:HV,w:WV,W:UV,x:null,X:null,y:GV,Y:YV,Z:XV,"%":L_},_={a:Z,A:oe,b:se,B:re,c:null,d:B_,e:B_,f:JV,g:cz,G:dz,H:KV,I:ZV,j:QV,L:aC,m:ez,M:tz,p:U,q:te,Q:P_,s:D_,S:nz,u:oz,U:rz,V:iz,w:sz,W:az,x:null,X:null,y:lz,Y:uz,Z:fz,"%":L_},C={a:D,A:N,b:k,B:A,c:B,d:T_,e:T_,f:MV,g:$_,G:A_,H:M_,I:M_,j:CV,L:TV,m:kV,M:AV,p:M,q:SV,Q:BV,s:LV,S:$V,u:bV,U:yV,V:xV,w:vV,W:wV,x:P,X:F,y:$_,Y:A_,Z:_V,"%":OV};x.x=L(n,x),x.X=L(o,x),x.c=L(e,x),_.x=L(n,_),_.X=L(o,_),_.c=L(e,_);function L(ne,ve){return function(me){var I=[],W=-1,j=0,ue=ne.length,de,fe,pe;for(me instanceof Date||(me=new Date(+me));++W<ue;)ne.charCodeAt(W)===37&&(I.push(ne.slice(j,W)),(fe=C_[de=ne.charAt(++W)])!=null?de=ne.charAt(++W):fe=de==="e"?" ":"0",(pe=ve[de])&&(de=pe(me,fe)),I.push(de),j=W+1);return I.push(ne.slice(j,W)),I.join("")}}function O(ne,ve){return function(me){var I=Ru(1900,void 0,1),W=$(I,ne,me+="",0),j,ue;if(W!=me.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(ve&&!("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?(j=Wg(Ru(I.y,0,1)),ue=j.getUTCDay(),j=ue>4||ue===0?$0.ceil(j):$0(j),j=wy.offset(j,(I.V-1)*7),I.y=j.getUTCFullYear(),I.m=j.getUTCMonth(),I.d=j.getUTCDate()+(I.w+6)%7):(j=Hg(Ru(I.y,0,1)),ue=j.getDay(),j=ue>4||ue===0?A0.ceil(j):A0(j),j=xy.offset(j,(I.V-1)*7),I.y=j.getFullYear(),I.m=j.getMonth(),I.d=j.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),ue="Z"in I?Wg(Ru(I.y,0,1)).getUTCDay():Hg(Ru(I.y,0,1)).getDay(),I.m=0,I.d="W"in I?(I.w+6)%7+I.W*7-(ue+5)%7:I.w+I.U*7-(ue+6)%7);return"Z"in I?(I.H+=I.Z/100|0,I.M+=I.Z%100,Wg(I)):Hg(I)}}function $(ne,ve,me,I){for(var W=0,j=ve.length,ue=me.length,de,fe;W<j;){if(I>=ue)return-1;if(de=ve.charCodeAt(W++),de===37){if(de=ve.charAt(W++),fe=C[de in C_?ve.charAt(W++):de],!fe||(I=fe(ne,me,I))<0)return-1}else if(de!=me.charCodeAt(I++))return-1}return I}function M(ne,ve,me){var I=c.exec(ve.slice(me));return I?(ne.p=u.get(I[0].toLowerCase()),me+I[0].length):-1}function D(ne,ve,me){var I=h.exec(ve.slice(me));return I?(ne.w=m.get(I[0].toLowerCase()),me+I[0].length):-1}function N(ne,ve,me){var I=d.exec(ve.slice(me));return I?(ne.w=f.get(I[0].toLowerCase()),me+I[0].length):-1}function k(ne,ve,me){var I=v.exec(ve.slice(me));return I?(ne.m=y.get(I[0].toLowerCase()),me+I[0].length):-1}function A(ne,ve,me){var I=b.exec(ve.slice(me));return I?(ne.m=g.get(I[0].toLowerCase()),me+I[0].length):-1}function B(ne,ve,me){return $(ne,e,ve,me)}function P(ne,ve,me){return $(ne,n,ve,me)}function F(ne,ve,me){return $(ne,o,ve,me)}function z(ne){return s[ne.getDay()]}function V(ne){return i[ne.getDay()]}function G(ne){return l[ne.getMonth()]}function ie(ne){return a[ne.getMonth()]}function ce(ne){return r[+(ne.getHours()>=12)]}function he(ne){return 1+~~(ne.getMonth()/3)}function Z(ne){return s[ne.getUTCDay()]}function oe(ne){return i[ne.getUTCDay()]}function se(ne){return l[ne.getUTCMonth()]}function re(ne){return a[ne.getUTCMonth()]}function U(ne){return r[+(ne.getUTCHours()>=12)]}function te(ne){return 1+~~(ne.getUTCMonth()/3)}return{format:function(ne){var ve=L(ne+="",x);return ve.toString=function(){return ne},ve},parse:function(ne){var ve=O(ne+="",!1);return ve.toString=function(){return ne},ve},utcFormat:function(ne){var ve=L(ne+="",_);return ve.toString=function(){return ne},ve},utcParse:function(ne){var ve=O(ne+="",!0);return ve.toString=function(){return ne},ve}}}var C_={"-":"",_:" ",0:"0"},Kn=/^\s*\d+/,pV=/^%/,mV=/[\\^$*+?|[\]().{}]/g;function Gt(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 gV(t){return t.replace(mV,"\\$&")}function Nu(t){return new RegExp("^(?:"+t.map(gV).join("|")+")","i")}function Fu(t){return new Map(t.map((e,n)=>[e.toLowerCase(),n]))}function vV(t,e,n){var o=Kn.exec(e.slice(n,n+1));return o?(t.w=+o[0],n+o[0].length):-1}function bV(t,e,n){var o=Kn.exec(e.slice(n,n+1));return o?(t.u=+o[0],n+o[0].length):-1}function yV(t,e,n){var o=Kn.exec(e.slice(n,n+2));return o?(t.U=+o[0],n+o[0].length):-1}function xV(t,e,n){var o=Kn.exec(e.slice(n,n+2));return o?(t.V=+o[0],n+o[0].length):-1}function wV(t,e,n){var o=Kn.exec(e.slice(n,n+2));return o?(t.W=+o[0],n+o[0].length):-1}function A_(t,e,n){var o=Kn.exec(e.slice(n,n+4));return o?(t.y=+o[0],n+o[0].length):-1}function $_(t,e,n){var o=Kn.exec(e.slice(n,n+2));return o?(t.y=+o[0]+(+o[0]>68?1900:2e3),n+o[0].length):-1}function _V(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 SV(t,e,n){var o=Kn.exec(e.slice(n,n+1));return o?(t.q=o[0]*3-3,n+o[0].length):-1}function kV(t,e,n){var o=Kn.exec(e.slice(n,n+2));return o?(t.m=o[0]-1,n+o[0].length):-1}function T_(t,e,n){var o=Kn.exec(e.slice(n,n+2));return o?(t.d=+o[0],n+o[0].length):-1}function CV(t,e,n){var o=Kn.exec(e.slice(n,n+3));return o?(t.m=0,t.d=+o[0],n+o[0].length):-1}function M_(t,e,n){var o=Kn.exec(e.slice(n,n+2));return o?(t.H=+o[0],n+o[0].length):-1}function AV(t,e,n){var o=Kn.exec(e.slice(n,n+2));return o?(t.M=+o[0],n+o[0].length):-1}function $V(t,e,n){var o=Kn.exec(e.slice(n,n+2));return o?(t.S=+o[0],n+o[0].length):-1}function TV(t,e,n){var o=Kn.exec(e.slice(n,n+3));return o?(t.L=+o[0],n+o[0].length):-1}function MV(t,e,n){var o=Kn.exec(e.slice(n,n+6));return o?(t.L=Math.floor(o[0]/1e3),n+o[0].length):-1}function OV(t,e,n){var o=pV.exec(e.slice(n,n+1));return o?n+o[0].length:-1}function BV(t,e,n){var o=Kn.exec(e.slice(n));return o?(t.Q=+o[0],n+o[0].length):-1}function LV(t,e,n){var o=Kn.exec(e.slice(n));return o?(t.s=+o[0],n+o[0].length):-1}function O_(t,e){return Gt(t.getDate(),e,2)}function PV(t,e){return Gt(t.getHours(),e,2)}function DV(t,e){return Gt(t.getHours()%12||12,e,2)}function EV(t,e){return Gt(1+xy.count(Al(t),t),e,3)}function iC(t,e){return Gt(t.getMilliseconds(),e,3)}function IV(t,e){return iC(t,e)+"000"}function RV(t,e){return Gt(t.getMonth()+1,e,2)}function NV(t,e){return Gt(t.getMinutes(),e,2)}function FV(t,e){return Gt(t.getSeconds(),e,2)}function VV(t){var e=t.getDay();return e===0?7:e}function zV(t,e){return Gt(nC.count(Al(t)-1,t),e,2)}function sC(t){var e=t.getDay();return e>=4||e===0?qc(t):qc.ceil(t)}function HV(t,e){return t=sC(t),Gt(qc.count(Al(t),t)+(Al(t).getDay()===4),e,2)}function WV(t){return t.getDay()}function UV(t,e){return Gt(A0.count(Al(t)-1,t),e,2)}function GV(t,e){return Gt(t.getFullYear()%100,e,2)}function qV(t,e){return t=sC(t),Gt(t.getFullYear()%100,e,2)}function YV(t,e){return Gt(t.getFullYear()%1e4,e,4)}function jV(t,e){var n=t.getDay();return t=n>=4||n===0?qc(t):qc.ceil(t),Gt(t.getFullYear()%1e4,e,4)}function XV(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Gt(e/60|0,"0",2)+Gt(e%60,"0",2)}function B_(t,e){return Gt(t.getUTCDate(),e,2)}function KV(t,e){return Gt(t.getUTCHours(),e,2)}function ZV(t,e){return Gt(t.getUTCHours()%12||12,e,2)}function QV(t,e){return Gt(1+wy.count($l(t),t),e,3)}function aC(t,e){return Gt(t.getUTCMilliseconds(),e,3)}function JV(t,e){return aC(t,e)+"000"}function ez(t,e){return Gt(t.getUTCMonth()+1,e,2)}function tz(t,e){return Gt(t.getUTCMinutes(),e,2)}function nz(t,e){return Gt(t.getUTCSeconds(),e,2)}function oz(t){var e=t.getUTCDay();return e===0?7:e}function rz(t,e){return Gt(oC.count($l(t)-1,t),e,2)}function lC(t){var e=t.getUTCDay();return e>=4||e===0?Yc(t):Yc.ceil(t)}function iz(t,e){return t=lC(t),Gt(Yc.count($l(t),t)+($l(t).getUTCDay()===4),e,2)}function sz(t){return t.getUTCDay()}function az(t,e){return Gt($0.count($l(t)-1,t),e,2)}function lz(t,e){return Gt(t.getUTCFullYear()%100,e,2)}function cz(t,e){return t=lC(t),Gt(t.getUTCFullYear()%100,e,2)}function uz(t,e){return Gt(t.getUTCFullYear()%1e4,e,4)}function dz(t,e){var n=t.getUTCDay();return t=n>=4||n===0?Yc(t):Yc.ceil(t),Gt(t.getUTCFullYear()%1e4,e,4)}function fz(){return"+0000"}function L_(){return"%"}function P_(t){return+t}function D_(t){return Math.floor(+t/1e3)}var sc,zd;hz({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 hz(t){return sc=hV(t),zd=sc.format,sc.parse,sc.utcFormat,sc.utcParse,sc}const bf=[{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)"}],cC=[new Date(2015,0,1),new Date(2016,0,1),new Date(2017,0,1)];function uC(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 E_(t){if(t==="(automatic)")return"auto — adapts to data";if(t==="(custom)")return null;const e=bf.find(n=>n.fmt===t);return e!=null&&e.d3?cC.map(n=>uC(e.d3,n)).join(" · "):null}function pz(t){if(t==="(automatic)")return"";const e=bf.find(n=>n.fmt===t);return(e==null?void 0:e.d3)??""}function mz(t){if(!t)return"";try{return cC.map(e=>uC(t,e)).join(" · ")}catch{return"(invalid format)"}}function gz(t,e,n){if(!t)return"(automatic)";if(e==="(custom)")return n||"(custom)";const o=bf.find(r=>r.d3===t);return(o==null?void 0:o.label)??t}function vz(t){if(!t)return{selectedPreset:"(automatic)",customStr:""};const e=bf.find(n=>n.d3===t);return e?{selectedPreset:e.fmt,customStr:""}:{selectedPreset:"(custom)",customStr:t}}const bz={class:"form-control-date-format__popover"},yz={class:"form-control-date-format__popover__list"},xz=["onClick"],wz={class:"form-control-date-format__popover__list__item__body"},_z={class:"form-control-date-format__popover__list__item__body__label"},Sz={key:0,class:"form-control-date-format__popover__list__item__body__ticks"},kz={key:0,class:"form-control-date-format__popover__list__item__check"},Cz={key:0,class:"form-control-date-format__popover__custom"},Az={class:"form-control-date-format__popover__custom__preview"},$z={class:"form-control-date-format__popover__custom__preview__value"},Tz=le({__name:"FormControlDateFormat",props:rt({label:{default:void 0},id:{default:void 0},block:{type:Boolean,default:!0}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=ht(t,"modelValue"),n=De("(automatic)"),o=De(""),r=S(()=>mz(o.value)),i=S(()=>gz(e.value,n.value,o.value));function s(l,c){n.value=l,l!=="(custom)"&&(e.value=pz(l),c())}function a(){e.value=o.value}return He(()=>e.value,l=>{const c=vz(l);n.value=c.selectedPreset,o.value=c.customStr},{immediate:!0}),(l,c)=>{const u=Dn;return w(),K(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":Q(()=>[T("span",{class:Me(["form-control-date-format__trigger-text",{"text-secondary":!e.value}])},xe(p(i)),3)]),menu:Q(({hide:d})=>[T("div",bz,[T("div",yz,[(w(!0),R(Ne,null,gt(p(bf),f=>(w(),R("div",{key:f.fmt,class:Me(["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",wz,[T("div",_z,xe(f.label),1),p(E_)(f.fmt)?(w(),R("div",Sz,xe(p(E_)(f.fmt)),1)):ae("",!0)]),p(n)===f.fmt?(w(),R("span",kz,"✓")):ae("",!0)],10,xz))),128))]),p(n)==="(custom)"?(w(),R("div",Cz,[c[3]||(c[3]=T("div",{class:"form-control-date-format__popover__custom__section-label"}," Custom d3-time-format string ",-1)),ir(T("input",{"onUpdate:modelValue":c[0]||(c[0]=f=>Ke(o)?o.value=f:null),class:"form-control-date-format__popover__custom__input",placeholder:"e.g. %b %d, %Y",onInput:a},null,544),[[f0,p(o)]]),T("div",Az,[c[2]||(c[2]=Ge(" Preview: ",-1)),T("span",$z,xe(p(o)?p(r):"—"),1)])])):ae("",!0)])]),_:1},8,["id","modelValue","label","block"])}}}),Mz=Le(Tz,[["__scopeId","data-v-710c73d8"]]),Oz={class:"display-date"},Bz=le({__name:"DisplayDate",props:{value:{},format:{default:"short"}},setup(t){const e=t,n=S(()=>{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",Oz,xe(p(n)),1))}}),Lz=Le(Bz,[["__scopeId","data-v-7da39ad7"]]),Pz={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Dz(t,e){return w(),R("svg",Pz,[...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 m1=$e({name:"ph-info",render:Dz}),Ez={class:"display-contrast-badge__ratio"},Iz=le({__name:"DisplayContrastBadge",props:{level:{},ratio:{}},setup(t){const e=t,n=ft("badgeRef"),o=S(()=>({"display-contrast-badge--aaa":e.level==="AAA","display-contrast-badge--aa":e.level==="AA","display-contrast-badge--fail":e.level==="Fail"})),r=S(()=>{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:Me(["display-contrast-badge",p(o)])},[Ge(xe(t.level)+" ",1),T("span",Ez,xe(t.ratio),1),H(p(m1),{class:"display-contrast-badge__info"}),H(p(Id),{"teleport-to":"body",target:p(n),title:p(r),placement:"top"},null,8,["target","title"])],2))}}),I_=Le(Iz,[["__scopeId","data-v-2ff89f6d"]]),Rz={[sn.BarVertical]:"Columns",[sn.BarHorizontal]:"Bars",[sn.BarMulti]:"Grouped Columns",[sn.ColumnStacked]:"Stacked Columns",[sn.BarStacked]:"Stacked Bars",[sn.BarSplit]:"Split Bars",[sn.BarGrouped]:"Grouped Bars",[sn.Line]:"Line",[sn.LineMulti]:"Lines",[sn.Area]:"Area",[sn.AreaStacked]:"Areas",[sn.Donut]:"Donut",[sn.Pie]:"Pie"};function dC(t){return Rz[t]??t}const Nz={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Fz(t,e){return w(),R("svg",Nz,[...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 pc=$e({name:"ph-chart-bar",render:Fz}),Vz={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function zz(t,e){return w(),R("svg",Vz,[...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 Ku=$e({name:"ph-chart-bar-horizontal",render:zz}),Hz={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Wz(t,e){return w(),R("svg",Hz,[...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 Zu=$e({name:"ph-chart-line-up",render:Wz}),Uz={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Gz(t,e){return w(),R("svg",Uz,[...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 fC=$e({name:"ph-chart-pie-slice",render:Gz}),qz={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Yz(t,e){return w(),R("svg",qz,[...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 jz=$e({name:"ph-chart-donut",render:Yz}),Xz=le({__name:"DisplayChartTypeBadge",props:{chartType:{},theme:{default:"light"}},setup(t){const e=t,n=S(()=>dC(e.chartType)),o=S(()=>e.theme==="dark"?"dark":"light"),r={[sn.BarVertical]:pc,[sn.BarHorizontal]:Ku,[sn.BarMulti]:pc,[sn.ColumnStacked]:pc,[sn.BarStacked]:Ku,[sn.BarSplit]:Ku,[sn.BarGrouped]:Ku,[sn.Line]:Zu,[sn.LineMulti]:Zu,[sn.Area]:Zu,[sn.AreaStacked]:Zu,[sn.Donut]:jz,[sn.Pie]:fC},i=S(()=>r[e.chartType]??pc);return(s,a)=>(w(),K(p(iy),{variant:p(o),pill:"",class:"display-chart-type-badge"},{default:Q(()=>[(w(),K(on(p(i)),{class:"display-chart-type-badge__icon"})),Ge(" "+xe(p(n)),1)]),_:1},8,["variant"]))}}),Kz=Le(Xz,[["__scopeId","data-v-cb8f5582"]]),Zz={class:"section-card"},Qz={key:0,class:"section-card__label"},Jz={key:1,class:"section-card__body"},eH=le({__name:"SectionCard",props:{label:{}},setup(t){return(e,n)=>(w(),R("div",Zz,[t.label?(w(),R("div",Qz,xe(t.label),1)):ae("",!0),Se(e.$slots,"header",{},void 0,!0),e.$slots.default?(w(),R("div",Jz,[Se(e.$slots,"default",{},void 0,!0)])):ae("",!0)]))}}),vd=Le(eH,[["__scopeId","data-v-804cd08f"]]),tH={},nH={class:"settings-section-description"};function oH(t,e){return w(),R("p",nH,[Se(t.$slots,"default",{},void 0,!0)])}const rH=Le(tH,[["render",oH],["__scopeId","data-v-9caa49e3"]]),iH={},sH={class:"settings-section-title"};function aH(t,e){return w(),R("h6",sH,[Se(t.$slots,"default",{},void 0,!0)])}const lH=Le(iH,[["render",aH],["__scopeId","data-v-c5961a9d"]]),cH={class:"settings-section-icon"},uH=le({__name:"SettingsSectionIcon",props:{icon:{}},setup(t){return(e,n)=>{const o=vf;return w(),R("div",cH,[H(o,{name:t.icon},null,8,["name"])])}}}),dH=Le(uH,[["__scopeId","data-v-e8122360"]]),fH={class:"settings-section"},hH={class:"settings-section__header"},pH={class:"settings-section__header__text"},mH={key:1,class:"settings-section__body"},gH=le({__name:"SettingsSection",props:{title:{},icon:{default:void 0},description:{default:void 0}},setup(t){return(e,n)=>{const o=dH,r=lH,i=rH;return w(),R("section",fH,[T("div",hH,[t.icon?(w(),K(o,{key:0,icon:t.icon},null,8,["icon"])):ae("",!0),T("div",pH,[H(r,null,{default:Q(()=>[Ge(xe(t.title),1)]),_:1})])]),e.$slots.description||t.description?(w(),K(i,{key:0},{default:Q(()=>[Se(e.$slots,"description",{},()=>[Ge(xe(t.description),1)],!0)]),_:3})):ae("",!0),e.$slots.default?(w(),R("div",mH,[Se(e.$slots,"default",{},void 0,!0)])):ae("",!0)])}}}),Ho=Le(gH,[["__scopeId","data-v-91596f42"]]),vH={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function bH(t,e){return w(),R("svg",vH,[...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 yH=$e({name:"ph-x",render:bH}),xH=le({__name:"ButtonClose",emits:["click"],setup(t){return(e,n)=>{const o=Rn;return w(),K(o,{"icon-left":p(yH),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"])}}}),_y=Le(xH,[["__scopeId","data-v-d6bb5d7b"]]),wH={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function _H(t,e){return w(),R("svg",wH,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M216 48v48a8 8 0 0 1-16 0V67.31l-50.34 50.35a8 8 0 0 1-11.32-11.32L188.69 56H160a8 8 0 0 1 0-16h48a8 8 0 0 1 8 8m-109.66 90.34L56 188.69V160a8 8 0 0 0-16 0v48a8 8 0 0 0 8 8h48a8 8 0 0 0 0-16H67.31l50.35-50.34a8 8 0 0 0-11.32-11.32"},null,-1)])])}const hC=$e({name:"ph-arrows-out-simple",render:_H}),SH=le({__name:"ButtonDetach",emits:["click"],setup(t){return(e,n)=>{const o=Rn;return w(),K(o,{"icon-left":p(hC),label:"Detach","hide-label":"",square:"",variant:"link",size:"sm",class:"button-panel-action",onClick:n[0]||(n[0]=r=>e.$emit("click"))},null,8,["icon-left"])}}}),kH=Le(SH,[["__scopeId","data-v-2bd9fd9f"]]),CH={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function AH(t,e){return w(),R("svg",CH,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M213.66 53.66L163.31 104H192a8 8 0 0 1 0 16h-48a8 8 0 0 1-8-8V64a8 8 0 0 1 16 0v28.69l50.34-50.35a8 8 0 0 1 11.32 11.32M112 136H64a8 8 0 0 0 0 16h28.69l-50.35 50.34a8 8 0 0 0 11.32 11.32L104 163.31V192a8 8 0 0 0 16 0v-48a8 8 0 0 0-8-8"},null,-1)])])}const pC=$e({name:"ph-arrows-in-simple",render:AH}),$H=le({__name:"ButtonDock",emits:["click"],setup(t){return(e,n)=>{const o=Rn;return w(),K(o,{"icon-left":p(pC),label:"Dock","hide-label":"",square:"",variant:"link",size:"sm",class:"button-panel-action",onClick:n[0]||(n[0]=r=>e.$emit("click"))},null,8,["icon-left"])}}}),TH=Le($H,[["__scopeId","data-v-ea521476"]]),MH={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function OH(t,e){return w(),R("svg",MH,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M72 60a12 12 0 1 1-12-12a12 12 0 0 1 12 12m56-12a12 12 0 1 0 12 12a12 12 0 0 0-12-12m68 24a12 12 0 1 0-12-12a12 12 0 0 0 12 12M60 116a12 12 0 1 0 12 12a12 12 0 0 0-12-12m68 0a12 12 0 1 0 12 12a12 12 0 0 0-12-12m68 0a12 12 0 1 0 12 12a12 12 0 0 0-12-12M60 184a12 12 0 1 0 12 12a12 12 0 0 0-12-12m68 0a12 12 0 1 0 12 12a12 12 0 0 0-12-12m68 0a12 12 0 1 0 12 12a12 12 0 0 0-12-12"},null,-1)])])}const BH=$e({name:"ph-dots-nine",render:OH}),LH=le({__name:"ButtonDrag",setup(t){return(e,n)=>{const o=Rn;return w(),K(o,{"icon-left":p(BH),label:"Drag","hide-label":"","hide-tooltip":"",square:"",variant:"link",size:"sm",class:"button-drag"},null,8,["icon-left"])}}}),PH=Le(LH,[["__scopeId","data-v-efc68d0b"]]),DH={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function EH(t,e){return w(),R("svg",DH,[...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 IH=$e({name:"ph-arrow-clockwise",render:EH}),RH=le({__name:"ButtonRedo",props:{disabled:{type:Boolean,default:!1}},emits:["click"],setup(t){return(e,n)=>{const o=Rn;return w(),K(o,{"icon-left":p(IH),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"])}}}),NH={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function FH(t,e){return w(),R("svg",NH,[...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 VH=$e({name:"ph-arrow-counter-clockwise",render:FH}),zH=le({__name:"ButtonUndo",props:{disabled:{type:Boolean,default:!1}},emits:["click"],setup(t){return(e,n)=>{const o=Rn;return w(),K(o,{"icon-left":p(VH),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"])}}}),HH={class:"feedback-empty-state"},WH={class:"feedback-empty-state__message"},UH=le({__name:"FeedbackEmptyState",props:{message:{}},setup(t){return(e,n)=>(w(),R("div",HH,[T("p",WH,[Se(e.$slots,"default",{},()=>[Ge(xe(t.message),1)],!0)])]))}}),GH=Le(UH,[["__scopeId","data-v-dab82b40"]]),qH={key:0,class:"layout-bottom-drawer__header"},YH={class:"layout-bottom-drawer__header__title"},jH={class:"layout-bottom-drawer__body"},XH=80,KH=le({__name:"LayoutBottomDrawer",props:rt({title:{default:void 0},maxHeight:{default:"70vh"}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=ht(t,"modelValue"),n=t,o=De(0),r=De(!1),i=S(()=>({"layout-bottom-drawer--dragging":r.value}));let s=0,a=!1;function l(f){s=f.clientY,o.value=0,a=!1,document.addEventListener("pointermove",c),document.addEventListener("pointerup",u,{once:!0}),document.addEventListener("pointercancel",u,{once:!0})}function c(f){const h=f.clientY-s;!r.value&&Math.abs(h)>4&&(r.value=!0),r.value&&(a=!0,o.value=Math.max(0,h))}function u(){document.removeEventListener("pointermove",c),document.removeEventListener("pointercancel",u),r.value&&o.value>=XH?e.value=!1:a||(e.value=!1),o.value=0,r.value=!1}const d=S(()=>({maxHeight:n.maxHeight,...o.value>0?{transform:`translateY(${o.value}px)`}:{}}));return(f,h)=>(w(),R(Ne,null,[H(_l,{name:"drawer"},{default:Q(()=>[e.value?(w(),R("div",{key:0,class:Me(["layout-bottom-drawer",p(i)]),style:Ot(p(d))},[T("div",{class:"layout-bottom-drawer__handle",onPointerdown:l},[...h[1]||(h[1]=[T("div",{class:"layout-bottom-drawer__handle__bar"},null,-1)])],32),t.title?(w(),R("div",qH,[T("h2",YH,xe(t.title),1)])):ae("",!0),T("div",jH,[Se(f.$slots,"default",{},void 0,!0)])],6)):ae("",!0)]),_:3}),e.value?(w(),R("div",{key:0,class:"layout-bottom-drawer__backdrop",onClick:h[0]||(h[0]=m=>e.value=!1)})):ae("",!0)],64))}}),ZH=Le(KH,[["__scopeId","data-v-ce589155"]]),QH={class:"layout-panel"},JH={class:"layout-panel__header"},eW={class:"layout-panel__header__title"},tW={key:0,class:"layout-panel__header__actions"},nW={key:0,class:"layout-panel__toolbar"},oW={class:"layout-panel__body"},rW={key:1,class:"layout-panel__footer"},iW=le({__name:"LayoutPanel",props:{title:{}},setup(t){return(e,n)=>(w(),R("div",QH,[T("div",JH,[T("h2",eW,xe(t.title),1),e.$slots.actions?(w(),R("div",tW,[Se(e.$slots,"actions",{},void 0,!0)])):ae("",!0)]),e.$slots.toolbar?(w(),R("div",nW,[Se(e.$slots,"toolbar",{},void 0,!0)])):ae("",!0),T("div",oW,[Se(e.$slots,"default",{},void 0,!0)]),e.$slots.footer?(w(),R("div",rW,[Se(e.$slots,"footer",{},void 0,!0)])):ae("",!0)]))}}),sW=Le(iW,[["__scopeId","data-v-4013eff6"]]),aW=["aria-label"],lW=["disabled","aria-current","onClick"],cW={class:"navigation-segmented-control__option__label"},uW=le({__name:"NavigationSegmentedControl",props:{items:{},ariaLabel:{default:void 0},size:{default:"md"}},emits:["select"],setup(t,{emit:e}){const n=t,o=e,r=S(()=>`navigation-segmented-control--${n.size}`);function i(s){s.disabled||o("select",s.key)}return(s,a)=>(w(),R("nav",{class:Me(["navigation-segmented-control",p(r)]),"aria-label":t.ariaLabel},[Se(s.$slots,"default",{},void 0,!0),(w(!0),R(Ne,null,gt(t.items,l=>(w(),R("button",{key:l.key,class:Me(["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(),K(on(l.icon),{key:0,class:"navigation-segmented-control__option__icon"})):ae("",!0),T("span",cW,xe(l.text),1)],10,lW))),128))],10,aW))}}),mC=Le(uW,[["__scopeId","data-v-7aaaef48"]]),dW={class:"navigation-stepper-chevron",role:"tablist","aria-label":"Progress"},fW=["aria-selected","aria-disabled","tabindex","title","onClick"],hW={class:"navigation-stepper-chevron__step__chip"},pW={class:"navigation-stepper-chevron__step__label"},mW={key:0,class:"navigation-stepper-chevron__sep","aria-hidden":"true"},gW=le({__name:"NavigationStepperChevron",props:rt({steps:{},disabledSteps:{default:()=>[]}},{currentStep:{required:!0},currentStepModifiers:{}}),emits:["update:currentStep"],setup(t){const e=ht(t,"currentStep"),n=t;function o(s){return s<e.value?"done":s===e.value?"current":"pending"}function r(s){return{"navigation-stepper-chevron__step":!0,[`navigation-stepper-chevron__step--${o(s)}`]:!0,"navigation-stepper-chevron__step--disabled":n.disabledSteps.includes(s)}}function i(s){n.disabledSteps.includes(s)||(e.value=s)}return(s,a)=>(w(),R("div",dW,[(w(!0),R(Ne,null,gt(t.steps,(l,c)=>(w(),R(Ne,{key:l.key??c},[T("button",{type:"button",role:"tab","aria-selected":c===e.value,"aria-disabled":t.disabledSteps.includes(c)||void 0,tabindex:t.disabledSteps.includes(c)?-1:0,class:Me(r(c)),title:l.label,onClick:u=>i(c)},[T("span",hW,[o(c)==="done"?(w(),K(p(fy),{key:0})):(w(),R(Ne,{key:1},[Ge(xe(c+1),1)],64))]),T("span",pW,xe(l.label),1)],10,fW),c<t.steps.length-1?(w(),R("span",mW,"›")):ae("",!0)],64))),128))]))}}),vW=Le(gW,[["__scopeId","data-v-a47bb378"]]),bW=le({__name:"NavigationToggle",props:rt({options:{default:()=>[]},size:{default:"md"}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=ht(t,"modelValue"),n=t,{entries:o}=gf(KI),r=S(()=>o.value.length>0?o.value:n.options),i=S(()=>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(),K(mC,{items:p(i),size:t.size,onSelect:s},{default:Q(()=>[Se(a.$slots,"default")]),_:3},8,["items","size"]))}}),yW={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function xW(t,e){return w(),R("svg",yW,[...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 Sy=$e({name:"ph-magnifying-glass",render:xW}),wW=["aria-label"],_W={class:"navigation-command-bar__placeholder"},SW={key:0,class:"navigation-command-bar__kbd"},kW=le({__name:"NavigationCommandBar",props:{placeholder:{},shortcutLabel:{}},emits:["click"],setup(t){return(e,n)=>(w(),R("button",{type:"button",class:"navigation-command-bar","aria-label":t.placeholder,onClick:n[0]||(n[0]=o=>e.$emit("click"))},[H(p(Sy),{class:"navigation-command-bar__icon","aria-hidden":"true"}),T("span",_W,xe(t.placeholder),1),t.shortcutLabel?(w(),R("span",SW,xe(t.shortcutLabel),1)):ae("",!0)],8,wW))}}),CW=Le(kW,[["__scopeId","data-v-c46bc4e4"]]),AW={key:0,class:"navigation-icon-rail__footer"},$W=le({__name:"NavigationIconRail",props:rt({items:{default:()=>[]},horizontal:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=ht(t,"modelValue"),n=t,{entries:o}=gf(XI),r=S(()=>o.value.length>0?o.value:n.items),i=S(()=>({"navigation-icon-rail--horizontal":n.horizontal}));function s(a){return{"navigation-icon-rail__button--active":e.value===a}}return(a,l)=>{const c=Rn;return w(),R("nav",{class:Me(["navigation-icon-rail",p(i)])},[Se(a.$slots,"default",{},void 0,!0),(w(!0),R(Ne,null,gt(p(r),u=>(w(),K(c,{key:u.value,"icon-left":u.icon,label:u.tooltip,"tooltip-placement":"left","hide-label":"",square:"",size:"lg",variant:"link",class:Me(["navigation-icon-rail__button",s(u.value)]),"aria-pressed":e.value===u.value,onClick:d=>e.value=u.value},null,8,["icon-left","label","class","aria-pressed","onClick"]))),128)),l[0]||(l[0]=T("div",{class:"navigation-icon-rail__spacer"},null,-1)),a.$slots.footer?(w(),R("div",AW,[Se(a.$slots,"footer",{},void 0,!0)])):ae("",!0)],2)}}}),TW=Le($W,[["__scopeId","data-v-b096813e"]]),MW={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function OW(t,e){return w(),R("svg",MW,[...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 M0=$e({name:"ph-arrow-square-out",render:OW}),BW=["aria-label"],LW={key:0,class:"navigation-sidebar__header"},PW={class:"navigation-sidebar__body"},DW=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",LW,[Se(e.$slots,"header",{},void 0,!0)])):ae("",!0),T("div",PW,[Se(e.$slots,"default",{},void 0,!0)])],8,BW))}}),EW=Le(DW,[["__scopeId","data-v-6e345fdc"]]),IW={class:"navigation-sidebar-group"},RW={key:0,class:"navigation-sidebar-group__eyebrow"},NW={class:"navigation-sidebar-group__items"},FW=le({__name:"NavigationSidebarGroup",props:{eyebrow:{}},setup(t){return(e,n)=>(w(),R("div",IW,[t.eyebrow?(w(),R("div",RW,xe(t.eyebrow),1)):ae("",!0),T("div",NW,[Se(e.$slots,"default",{},void 0,!0)])]))}}),Ug=Le(FW,[["__scopeId","data-v-794922fc"]]),VW=["href"],zW={class:"navigation-sidebar-item__icon"},HW={class:"navigation-sidebar-item__label"},WW={class:"navigation-sidebar-item__external","aria-hidden":"true"},UW=["href","aria-current","onClick"],GW={class:"navigation-sidebar-item__icon"},qW={class:"navigation-sidebar-item__label"},YW={key:0,class:"navigation-sidebar-item__count"},jW=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=S(()=>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=Up("router-link");return p(n)?(w(),R("a",{key:0,href:t.href,class:Me(o(!1)),target:"_blank",rel:"noopener noreferrer"},[T("span",zW,[Se(r.$slots,"icon",{},void 0,!0)]),T("span",HW,xe(t.label),1),T("span",WW,[H(p(M0))])],10,VW)):(w(),K(s,{key:1,to:t.to,custom:""},{default:Q(({navigate:a,href:l,isActive:c})=>[T("a",{href:l,class:Me(o(c)),"aria-current":c||t.active?"page":void 0,onClick:a},[T("span",GW,[Se(r.$slots,"icon",{},void 0,!0)]),T("span",qW,xe(t.label),1),t.count!==void 0?(w(),R("span",YW,xe(t.count),1)):ae("",!0)],10,UW)]),_:3},8,["to"]))}}}),Vu=Le(jW,[["__scopeId","data-v-d6b18bde"]]),XW=["href","aria-label","onClick"],KW=["src","alt"],ZW={key:1,class:"navigation-workspace-switcher__badge","aria-hidden":"true"},QW={key:2,class:"navigation-workspace-switcher__name"},JW=["aria-label"],eU=["src","alt"],tU={key:1,class:"navigation-workspace-switcher__badge","aria-hidden":"true"},nU={key:2,class:"navigation-workspace-switcher__name"},oU=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=S(()=>e.name.trim().charAt(0).toUpperCase());return(o,r)=>{const i=Up("router-link");return t.to?(w(),K(i,{key:0,to:t.to,custom:""},{default:Q(({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,KW)):(w(),R("span",ZW,xe(n.value),1)),t.hideName?ae("",!0):(w(),R("span",QW,xe(t.name),1))],8,XW)]),_: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,eU)):(w(),R("span",tU,xe(n.value),1)),t.hideName?ae("",!0):(w(),R("span",nU,xe(t.name),1))],8,JW))}}}),gC=Le(oU,[["__scopeId","data-v-c9a99b92"]]),rU={class:"list-item-row__label"},iU=le({__name:"ListItemRow",props:{label:{},active:{type:Boolean}},emits:["click"],setup(t){const e=t,n=S(()=>({"list-item-row--active":e.active}));return(o,r)=>(w(),R("div",{class:Me(["list-item-row",p(n)]),onClick:r[0]||(r[0]=i=>o.$emit("click",i))},[Se(o.$slots,"leading",{},void 0,!0),T("span",rU,xe(t.label),1),Se(o.$slots,"actions",{},void 0,!0)],2))}}),vC=Le(iU,[["__scopeId","data-v-51fbb4a2"]]),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:"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 bC=$e({name:"ph-trash",render:aU}),lU={class:"list-item-actions"},cU=le({__name:"ListItemActions",props:{actions:{default:()=>["duplicate","remove"]}},emits:["duplicate","remove"],setup(t){return(e,n)=>{const o=Wo,r=vf;return w(),R("div",lU,[t.actions.includes("duplicate")?(w(),K(o,{key:0,variant:"link",size:"sm",class:"list-item-actions__btn text-body-secondary",title:"Duplicate",onClick:n[0]||(n[0]=vn(i=>e.$emit("duplicate"),["stop"]))},{default:Q(()=>[...n[2]||(n[2]=[T("span",{"aria-hidden":"true"},"⧉",-1)])]),_:1})):ae("",!0),t.actions.includes("remove")?(w(),K(o,{key:1,variant:"link",size:"sm",class:"list-item-actions__btn text-danger",title:"Remove",onClick:n[1]||(n[1]=vn(i=>e.$emit("remove"),["stop"]))},{default:Q(()=>[H(r,{name:p(bC)},null,8,["name"])]),_:1})):ae("",!0)])}}}),uU=Le(cU,[["__scopeId","data-v-29b731f9"]]),dU={class:"border rounded overflow-hidden bg-body-tertiary p-2"},fU={class:"d-flex gap-1 mb-2"},ky=le({__name:"ListSelectPanel",props:rt({items:{},maxHeight:{default:"220px"},onItemClick:{type:Function,default:void 0}},{selected:{required:!0},selectedModifiers:{}}),emits:["update:selected"],setup(t){const e=ht(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=vC;return w(),R("div",dU,[T("div",fU,[H(p(Wo),{variant:"outline-secondary",size:"sm",onClick:i},{default:Q(()=>[...c[0]||(c[0]=[Ge(" All ",-1)])]),_:1}),H(p(Wo),{variant:"outline-secondary",size:"sm",onClick:s},{default:Q(()=>[...c[1]||(c[1]=[Ge(" None ",-1)])]),_:1}),H(p(Wo),{variant:"outline-secondary",size:"sm",onClick:a},{default:Q(()=>[...c[2]||(c[2]=[Ge(" Invert ",-1)])]),_:1})]),T("div",{style:Ot({maxHeight:t.maxHeight,overflowY:"auto"})},[(w(!0),R(Ne,null,gt(t.items,(d,f)=>(w(),K(u,{key:d,label:d,active:e.value.includes(d),onClick:h=>o(d,f,h)},xr({_:2},[l.$slots["item-leading"]?{name:"leading",fn:Q(()=>[Se(l.$slots,"item-leading",{item:d,index:f})]),key:"0"}:void 0,l.$slots["item-actions"]?{name:"actions",fn:Q(()=>[Se(l.$slots,"item-actions",{item:d,index:f})]),key:"1"}:void 0]),1032,["label","active","onClick"]))),128))],4)])}}}),hU=["data-bs-theme"],pU=["src"],mU={class:"gallery-card__meta"},gU={key:0,class:"gallery-card__meta__subtitle"},vU={key:1,class:"gallery-card__meta__footer"},bU=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=S(()=>({"gallery-card--selected":e.selected,"gallery-card--row":e.layout==="row"}));return(o,r)=>(w(),R("div",{class:Me(["gallery-card",p(n)]),role:"button",tabindex:"0",onClick:r[1]||(r[1]=i=>o.$emit("click")),onKeydown:[r[2]||(r[2]=tr(i=>o.$emit("click"),["enter"])),r[3]||(r[3]=tr(vn(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,pU)):ae("",!0),o.$slots.actions?(w(),R("div",{key:1,class:"gallery-card__thumb__actions",onClick:r[0]||(r[0]=vn(()=>{},["stop"]))},[Se(o.$slots,"actions",{},void 0,!0)])):ae("",!0)],8,hU),T("div",mU,[T("div",{class:Me(["gallery-card__meta__title",{"bc-display":t.serifTitle}])},xe(t.title),3),t.subtitle?(w(),R("div",gU,xe(t.subtitle),1)):ae("",!0),o.$slots.footer?(w(),R("div",vU,[Se(o.$slots,"footer",{},void 0,!0)])):ae("",!0)])],34))}}),yU=Le(bU,[["__scopeId","data-v-1915e577"]]),xU=le({__name:"GalleryGrid",props:{layout:{default:"grid"}},setup(t){const e=t,n=S(()=>({"gallery-grid--row":e.layout==="row"}));return(o,r)=>(w(),R("div",{class:Me(["gallery-grid",p(n)])},[Se(o.$slots,"default",{},void 0,!0)],2))}}),wU=Le(xU,[["__scopeId","data-v-7c69b740"]]),_U={class:"scene-timeline-item__label"},SU=["innerHTML"],kU={key:1,class:"scene-timeline-item__name"},CU=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:Me(["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]=vn(o=>e.$emit("remove"),["stop"]))}," × ")):ae("",!0),T("span",_U,"Scene "+xe(t.index+1),1),T("span",{class:"scene-timeline-item__preview",innerHTML:t.thumbnail},null,8,SU),t.name?(w(),R("span",kU,xe(t.name),1)):ae("",!0)],2))}}),AU=Le(CU,[["__scopeId","data-v-e9323b3b"]]),$U={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function TU(t,e){return w(),R("svg",$U,[...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 MU=$e({name:"ph-play-fill",render:TU}),OU={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function BU(t,e){return w(),R("svg",OU,[...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 LU=$e({name:"ph-pause-fill",render:BU}),PU={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function DU(t,e){return w(),R("svg",PU,[...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 yC=$e({name:"ph-caret-left",render:DU}),EU={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function IU(t,e){return w(),R("svg",EU,[...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 xC=$e({name:"ph-caret-right",render:IU}),RU={class:"scene-timeline-controls"},NU=["disabled"],FU=["aria-label","disabled"],VU=["disabled"],zU={key:0,class:"scene-timeline-controls__counter"},HU=le({__name:"SceneTimelineControls",props:rt({total:{},playing:{type:Boolean,default:!1}},{activeIndex:{default:-1},activeIndexModifiers:{}}),emits:rt(["play","pause"],["update:activeIndex"]),setup(t){const e=ht(t,"activeIndex"),n=t,o=S(()=>n.total===0),r=S(()=>e.value<0?1:e.value+1),i=S(()=>n.total===0?0:e.value<=0?n.total-1:e.value-1),s=S(()=>n.total===0||e.value>=n.total-1?0:e.value+1);return(a,l)=>{const c=vf;return w(),R("div",RU,[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(yC),size:"1em"},null,8,["name"])],8,NU),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(LU):p(MU),size:"1em"},null,8,["name"])],8,FU),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(xC),size:"1em"},null,8,["name"])],8,VU),p(o)?ae("",!0):(w(),R("span",zU,xe(p(r))+" / "+xe(t.total),1))])}}}),WU=Le(HU,[["__scopeId","data-v-6415ade6"]]),UU={class:"scene-timeline"},GU={class:"scene-timeline__items"},qU={class:"scene-timeline__items__add"},YU=le({__name:"SceneTimeline",props:rt({scenes:{},playing:{type:Boolean,default:!1}},{activeIndex:{default:-1},activeIndexModifiers:{}}),emits:rt(["add","remove","play","pause"],["update:activeIndex"]),setup(t){const e=ht(t,"activeIndex");return(n,o)=>{const r=WU,i=AU,s=vl;return w(),R("div",UU,[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",GU,[(w(!0),R(Ne,null,gt(t.scenes,a=>(w(),K(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",qU,[H(s,{onClick:o[3]||(o[3]=a=>n.$emit("add"))})])])])}}}),jU=Le(YU,[["__scopeId","data-v-3b2fb4f2"]]),XU={class:"bc-scene-player bc-scene-player--progress-bar","data-scene-player":""},KU=["aria-label"],ZU={key:0,width:"10",height:"10",viewBox:"0 0 12 12",fill:"currentColor"},QU={key:1,width:"10",height:"10",viewBox:"0 0 12 12",fill:"currentColor"},JU={class:"bc-scene-player__segments"},eG=["aria-label","aria-current","onClick"],tG={class:"bc-scene-player__counter"},nG=le({__name:"ScenePlayerProgressBar",props:rt({total:{},playing:{type:Boolean,default:!1},position:{default:"center"}},{current:{required:!0},currentModifiers:{}}),emits:rt(["play","pause"],["update:current"]),setup(t){const e=ht(t,"current");return(n,o)=>(w(),R("div",XU,[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",ZU,[...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",QU,[...o[2]||(o[2]=[T("path",{d:"M2.5 1v10l8-5z"},null,-1)])]))],8,KU),T("div",JU,[(w(!0),R(Ne,null,gt(t.total,r=>(w(),R("button",{key:r,type:"button",class:Me(["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,eG))),128))]),T("span",tG,xe(e.value)+"/"+xe(t.total),1)]))}}),wC=Le(nG,[["__scopeId","data-v-be507f24"]]),oG=["disabled"],rG=["aria-label"],iG={key:0,width:"11",height:"11",viewBox:"0 0 12 12",fill:"currentColor"},sG={key:1,width:"11",height:"11",viewBox:"0 0 12 12",fill:"currentColor"},aG={class:"bc-scene-player__dots"},lG=["aria-label","aria-current","onClick"],cG=["disabled"],uG=le({__name:"ScenePlayerDotStepper",props:rt({total:{},playing:{type:Boolean,default:!1},position:{default:"center"}},{current:{required:!0},currentModifiers:{}}),emits:rt(["play","pause","previous","next"],["update:current"]),setup(t){const e=ht(t,"current");return(n,o)=>(w(),R("div",{class:Me(["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,oG),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",iG,[...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",sG,[...o[5]||(o[5]=[T("path",{d:"M2.5 1v10l8-5z"},null,-1)])]))],8,rG),T("div",aG,[(w(!0),R(Ne,null,gt(t.total,r=>(w(),R("button",{key:r,type:"button",class:Me(["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,lG))),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,cG)],2))}}),_C=Le(uG,[["__scopeId","data-v-3499fe9e"]]),dG={key:0,class:"bc-scene-player__counter"},fG=["disabled"],hG=["aria-label"],pG={key:0,width:"9",height:"9",viewBox:"0 0 12 12",fill:"currentColor"},mG={key:1,width:"9",height:"9",viewBox:"0 0 12 12",fill:"currentColor"},gG=["disabled"],vG={key:1,class:"bc-scene-player__counter bc-scene-player__counter--end"},bG=le({__name:"ScenePlayerMinimalArrows",props:rt({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:rt(["play","pause","previous","next"],["update:current"]),setup(t){const e=ht(t,"current");return(n,o)=>(w(),R("div",{class:Me(["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",dG,xe(e.value)+"/"+xe(t.total),1)):ae("",!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,fG),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",pG,[...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",mG,[...o[5]||(o[5]=[T("path",{d:"M2.5 1v10l8-5z"},null,-1)])]))],8,hG),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,gG),t.showCounter&&t.order==="controls-first"?(w(),R("span",vG,xe(e.value)+"/"+xe(t.total),1)):ae("",!0)],2))}}),SC=Le(bG,[["__scopeId","data-v-74dd9698"]]),yG={class:"bc-scene-player__btn-group"},xG=["disabled"],wG=["disabled"],_G={class:"bc-scene-player__counter"},SG=le({__name:"ScenePlayerButtons",props:rt({total:{},playing:{type:Boolean,default:!1},position:{default:"left"}},{current:{required:!0},currentModifiers:{}}),emits:rt(["play","pause","previous","next"],["update:current"]),setup(t){const e=ht(t,"current");return(n,o)=>(w(),R("div",{class:Me(["bc-scene-player bc-scene-player--buttons",`bc-scene-player--${t.position}`]),"data-scene-player":""},[T("div",yG,[T("button",{type:"button",class:Me(["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]=vn(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),Ge(" Back ",-1)])],10,xG),T("button",{type:"button",class:Me(["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]=vn(r=>n.$emit("next"),["stop"]))},[...o[3]||(o[3]=[Ge(" 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,wG)]),T("span",_G,xe(e.value)+" / "+xe(t.total),1)],2))}}),g1=Le(SG,[["__scopeId","data-v-9b2f8f87"]]);var Be=(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))(Be||{}),ei=(t=>(t.Left="left",t.Right="right",t))(ei||{}),Hd=(t=>(t.Linear="linear",t.Log="log",t))(Hd||{}),Hn=(t=>(t.Solid="solid",t.Dashed="dashed",t.Dotted="dotted",t.None="none",t))(Hn||{}),rn=(t=>(t.Auto="auto",t.Inside="inside",t.Outside="outside",t.Off="off",t))(rn||{}),bd=(t=>(t.Auto="auto",t.Horizontal="horizontal",t.Vertical="vertical",t))(bd||{}),Ln=(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))(Ln||{}),So=(t=>(t.Direct="direct",t.CurveLeft="curve-left",t.CurveRight="curve-right",t.Elbow="elbow",t))(So||{}),O0=(t=>(t.Solid="solid",t.Dotted="dotted",t.Dashed="dashed",t))(O0||{}),Pt=(t=>(t.Point="point",t.Range="range",t.Free="free",t))(Pt||{}),kC=(t=>(t.Start="start",t.Center="center",t.End="end",t))(kC||{}),Yn=(t=>(t.Vertical="vertical",t.Horizontal="horizontal",t))(Yn||{}),hr=(t=>(t.Circle="circle",t.Square="square",t.Diamond="diamond",t.Triangle="triangle",t.TriangleDown="triangleDown",t.Cross="cross",t.Star="star",t))(hr||{}),mr=(t=>(t.All="all",t.First="first",t.Last="last",t.FirstLast="firstLast",t))(mr||{}),Fo=(t=>(t.Filled="filled",t.Hollow="hollow",t))(Fo||{}),Qt=(t=>(t.Ascending="ascending",t.Descending="descending",t.None="none",t))(Qt||{}),mc=(t=>(t.Total="total",t.WithinGroups="within-groups",t.None="none",t))(mc||{}),hc=(t=>(t.Top="top",t.Bottom="bottom",t.Left="left",t.Right="right",t))(hc||{}),Ss=(t=>(t.Start="start",t.Middle="middle",t.End="end",t))(Ss||{}),yt=(t=>(t.Inside="inside",t.Outside="outside",t.Auto="auto",t))(yt||{}),ko=(t=>(t.Both="both",t.Vertical="vertical",t.Horizontal="horizontal",t))(ko||{}),ri=(t=>(t.Solid="solid",t.Dashed="dashed",t.Dotted="dotted",t))(ri||{}),bl=(t=>(t.Normal="normal",t.Percent="percent",t))(bl||{}),Ze=(t=>(t.Colors="colors",t.Boolean="boolean",t.Select="select",t.Text="text",t.NumberFormat="numberFormat",t.DateFormat="dateFormat",t))(Ze||{}),Co=(t=>(t.Off="",t.Auto="auto",t.Outside="outside",t.Inside="inside",t))(Co||{}),Jr=(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))(Jr||{});function kG(t){return t}var Vh=1,zh=2,v1=3,Qu=4,R_=1e-6;function CG(t){return"translate("+t+",0)"}function AG(t){return"translate(0,"+t+")"}function $G(t){return e=>+t(e)}function TG(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function MG(){return!this.__axis}function um(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===Vh||t===Qu?-1:1,u=t===Qu||t===zh?"x":"y",d=t===Vh||t===v1?CG:AG;function f(h){var m=o??(e.ticks?e.ticks.apply(e,n):e.domain()),b=r??(e.tickFormat?e.tickFormat.apply(e,n):kG),g=Math.max(i,0)+a,v=e.range(),y=+v[0]+l,x=+v[v.length-1]+l,_=(e.bandwidth?TG:$G)(e.copy(),l),C=h.selection?h.selection():h,L=C.selectAll(".domain").data([null]),O=C.selectAll(".tick").data(m,e).order(),$=O.exit(),M=O.enter().append("g").attr("class","tick"),D=O.select("line"),N=O.select("text");L=L.merge(L.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),O=O.merge(M),D=D.merge(M.append("line").attr("stroke","currentColor").attr(u+"2",c*i)),N=N.merge(M.append("text").attr("fill","currentColor").attr(u,c*g).attr("dy",t===Vh?"0em":t===v1?"0.71em":"0.32em")),h!==C&&(L=L.transition(h),O=O.transition(h),D=D.transition(h),N=N.transition(h),$=$.transition(h).attr("opacity",R_).attr("transform",function(k){return isFinite(k=_(k))?d(k+l):this.getAttribute("transform")}),M.attr("opacity",R_).attr("transform",function(k){var A=this.parentNode.__axis;return d((A&&isFinite(A=A(k))?A:_(k))+l)})),$.remove(),L.attr("d",t===Qu||t===zh?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),O.attr("opacity",1).attr("transform",function(k){return d(_(k)+l)}),D.attr(u+"2",c*i),N.attr(u,c*g).text(b),C.filter(MG).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===zh?"start":t===Qu?"end":"middle"),C.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 OG(t){return um(Vh,t)}function N_(t){return um(zh,t)}function BG(t){return um(v1,t)}function F_(t){return um(Qu,t)}var LG={value:()=>{}};function Cy(){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 Hh(n)}function Hh(t){this._=t}function PG(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}})}Hh.prototype=Cy.prototype={constructor:Hh,on:function(t,e){var n=this._,o=PG(t+"",n),r,i=-1,s=o.length;if(arguments.length<2){for(;++i<s;)if((r=(t=o[i]).type)&&(r=DG(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]=V_(n[r],t.name,e);else if(e==null)for(r in n)n[r]=V_(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 Hh(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 DG(t,e){for(var n=0,o=t.length,r;n<o;++n)if((r=t[n]).name===e)return r.value}function V_(t,e,n){for(var o=0,r=t.length;o<r;++o)if(t[o].name===e){t[o]=LG,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 z_={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 dm(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),z_.hasOwnProperty(e)?{space:z_[e],local:t}:t}function EG(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 IG(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function CC(t){var e=dm(t);return(e.local?IG:EG)(e)}function RG(){}function Ay(t){return t==null?RG:function(){return this.querySelector(t)}}function NG(t){typeof t!="function"&&(t=Ay(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 kr(o,this._parents)}function FG(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function VG(){return[]}function AC(t){return t==null?VG:function(){return this.querySelectorAll(t)}}function zG(t){return function(){return FG(t.apply(this,arguments))}}function HG(t){typeof t=="function"?t=zG(t):t=AC(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 kr(o,r)}function $C(t){return function(){return this.matches(t)}}function TC(t){return function(e){return e.matches(t)}}var WG=Array.prototype.find;function UG(t){return function(){return WG.call(this.children,t)}}function GG(){return this.firstElementChild}function qG(t){return this.select(t==null?GG:UG(typeof t=="function"?t:TC(t)))}var YG=Array.prototype.filter;function jG(){return Array.from(this.children)}function XG(t){return function(){return YG.call(this.children,t)}}function KG(t){return this.selectAll(t==null?jG:XG(typeof t=="function"?t:TC(t)))}function ZG(t){typeof t!="function"&&(t=$C(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 kr(o,this._parents)}function MC(t){return new Array(t.length)}function QG(){return new kr(this._enter||this._groups.map(MC),this._parents)}function B0(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}B0.prototype={constructor:B0,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 JG(t){return function(){return t}}function eq(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 B0(t,i[s]);for(;s<l;++s)(a=e[s])&&(r[s]=a)}function tq(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 B0(t,i[a]);for(a=0;a<u;++a)(l=e[a])&&c.get(f[a])===l&&(r[a]=l)}function nq(t){return t.__data__}function oq(t,e){if(!arguments.length)return Array.from(this,nq);var n=e?tq:eq,o=this._parents,r=this._groups;typeof t!="function"&&(t=JG(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=rq(t.call(u,u&&u.__data__,c,o)),m=h.length,b=a[c]=new Array(m),g=s[c]=new Array(m),v=l[c]=new Array(f);n(u,d,b,g,v,h,e);for(var y=0,x=0,_,C;y<m;++y)if(_=b[y]){for(y>=x&&(x=y+1);!(C=g[x])&&++x<m;);_._next=C||null}}return s=new kr(s,o),s._enter=a,s._exit=l,s}function rq(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function iq(){return new kr(this._exit||this._groups.map(MC),this._parents)}function sq(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 aq(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,m=0;m<d;++m)(h=c[m]||u[m])&&(f[m]=h);for(;l<r;++l)a[l]=n[l];return new kr(a,this._parents)}function lq(){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 cq(t){t||(t=uq);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 kr(r,this._parents).order()}function uq(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function dq(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function fq(){return Array.from(this)}function hq(){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 pq(){let t=0;for(const e of this)++t;return t}function mq(){return!this.node()}function gq(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 vq(t){return function(){this.removeAttribute(t)}}function bq(t){return function(){this.removeAttributeNS(t.space,t.local)}}function yq(t,e){return function(){this.setAttribute(t,e)}}function xq(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function wq(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function _q(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 Sq(t,e){var n=dm(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?bq:vq:typeof e=="function"?n.local?_q:wq:n.local?xq:yq)(n,e))}function OC(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function kq(t){return function(){this.style.removeProperty(t)}}function Cq(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Aq(t,e,n){return function(){var o=e.apply(this,arguments);o==null?this.style.removeProperty(t):this.style.setProperty(t,o,n)}}function $q(t,e,n){return arguments.length>1?this.each((e==null?kq:typeof e=="function"?Aq:Cq)(t,e,n??"")):jc(this.node(),t)}function jc(t,e){return t.style.getPropertyValue(e)||OC(t).getComputedStyle(t,null).getPropertyValue(e)}function Tq(t){return function(){delete this[t]}}function Mq(t,e){return function(){this[t]=e}}function Oq(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Bq(t,e){return arguments.length>1?this.each((e==null?Tq:typeof e=="function"?Oq:Mq)(t,e)):this.node()[t]}function BC(t){return t.trim().split(/^|\s+/)}function $y(t){return t.classList||new LC(t)}function LC(t){this._node=t,this._names=BC(t.getAttribute("class")||"")}LC.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 PC(t,e){for(var n=$y(t),o=-1,r=e.length;++o<r;)n.add(e[o])}function DC(t,e){for(var n=$y(t),o=-1,r=e.length;++o<r;)n.remove(e[o])}function Lq(t){return function(){PC(this,t)}}function Pq(t){return function(){DC(this,t)}}function Dq(t,e){return function(){(e.apply(this,arguments)?PC:DC)(this,t)}}function Eq(t,e){var n=BC(t+"");if(arguments.length<2){for(var o=$y(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each((typeof e=="function"?Dq:e?Lq:Pq)(n,e))}function Iq(){this.textContent=""}function Rq(t){return function(){this.textContent=t}}function Nq(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Fq(t){return arguments.length?this.each(t==null?Iq:(typeof t=="function"?Nq:Rq)(t)):this.node().textContent}function Vq(){this.innerHTML=""}function zq(t){return function(){this.innerHTML=t}}function Hq(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Wq(t){return arguments.length?this.each(t==null?Vq:(typeof t=="function"?Hq:zq)(t)):this.node().innerHTML}function Uq(){this.nextSibling&&this.parentNode.appendChild(this)}function Gq(){return this.each(Uq)}function qq(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Yq(){return this.each(qq)}function jq(t){var e=typeof t=="function"?t:CC(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Xq(){return null}function Kq(t,e){var n=typeof t=="function"?t:CC(t),o=e==null?Xq:typeof e=="function"?e:Ay(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function Zq(){var t=this.parentNode;t&&t.removeChild(this)}function Qq(){return this.each(Zq)}function Jq(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function eY(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function tY(t){return this.select(t?eY:Jq)}function nY(t){return arguments.length?this.property("__data__",t):this.node().__data__}function oY(t){return function(e){t.call(this,e,this.__data__)}}function rY(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 iY(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 sY(t,e,n){return function(){var o=this.__on,r,i=oY(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 aY(t,e,n){var o=rY(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?sY:iY,r=0;r<i;++r)this.each(a(o[r],e,n));return this}function EC(t,e,n){var o=OC(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 lY(t,e){return function(){return EC(this,t,e)}}function cY(t,e){return function(){return EC(this,t,e.apply(this,arguments))}}function uY(t,e){return this.each((typeof e=="function"?cY:lY)(t,e))}function*dY(){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 IC=[null];function kr(t,e){this._groups=t,this._parents=e}function yf(){return new kr([[document.documentElement]],IC)}function fY(){return this}kr.prototype=yf.prototype={constructor:kr,select:NG,selectAll:HG,selectChild:qG,selectChildren:KG,filter:ZG,data:oq,enter:QG,exit:iq,join:sq,merge:aq,selection:fY,order:lq,sort:cq,call:dq,nodes:fq,node:hq,size:pq,empty:mq,each:gq,attr:Sq,style:$q,property:Bq,classed:Eq,text:Fq,html:Wq,raise:Gq,lower:Yq,append:jq,insert:Kq,remove:Qq,clone:tY,datum:nY,on:aY,dispatch:uY,[Symbol.iterator]:dY};function _e(t){return typeof t=="string"?new kr([[document.querySelector(t)]],[document.documentElement]):new kr([[t]],IC)}function hY(t){let e;for(;e=t.sourceEvent;)t=e;return t}function pY(t,e){if(t=hY(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 Ty(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function RC(t,e){var n=Object.create(t.prototype);for(var o in e)n[o]=e[o];return n}function xf(){}var Wd=.7,L0=1/Wd,Ac="\\s*([+-]?\\d+)\\s*",Ud="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ji="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",mY=/^#([0-9a-f]{3,8})$/,gY=new RegExp(`^rgb\\(${Ac},${Ac},${Ac}\\)$`),vY=new RegExp(`^rgb\\(${ji},${ji},${ji}\\)$`),bY=new RegExp(`^rgba\\(${Ac},${Ac},${Ac},${Ud}\\)$`),yY=new RegExp(`^rgba\\(${ji},${ji},${ji},${Ud}\\)$`),xY=new RegExp(`^hsl\\(${Ud},${ji},${ji}\\)$`),wY=new RegExp(`^hsla\\(${Ud},${ji},${ji},${Ud}\\)$`),H_={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};Ty(xf,Tl,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:W_,formatHex:W_,formatHex8:_Y,formatHsl:SY,formatRgb:U_,toString:U_});function W_(){return this.rgb().formatHex()}function _Y(){return this.rgb().formatHex8()}function SY(){return NC(this).formatHsl()}function U_(){return this.rgb().formatRgb()}function Tl(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=mY.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?G_(e):n===3?new or(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?Qf(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?Qf(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=gY.exec(t))?new or(e[1],e[2],e[3],1):(e=vY.exec(t))?new or(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=bY.exec(t))?Qf(e[1],e[2],e[3],e[4]):(e=yY.exec(t))?Qf(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=xY.exec(t))?j_(e[1],e[2]/100,e[3]/100,1):(e=wY.exec(t))?j_(e[1],e[2]/100,e[3]/100,e[4]):H_.hasOwnProperty(t)?G_(H_[t]):t==="transparent"?new or(NaN,NaN,NaN,0):null}function G_(t){return new or(t>>16&255,t>>8&255,t&255,1)}function Qf(t,e,n,o){return o<=0&&(t=e=n=NaN),new or(t,e,n,o)}function kY(t){return t instanceof xf||(t=Tl(t)),t?(t=t.rgb(),new or(t.r,t.g,t.b,t.opacity)):new or}function y1(t,e,n,o){return arguments.length===1?kY(t):new or(t,e,n,o??1)}function or(t,e,n,o){this.r=+t,this.g=+e,this.b=+n,this.opacity=+o}Ty(or,y1,RC(xf,{brighter(t){return t=t==null?L0:Math.pow(L0,t),new or(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Wd:Math.pow(Wd,t),new or(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new or(yl(this.r),yl(this.g),yl(this.b),P0(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:q_,formatHex:q_,formatHex8:CY,formatRgb:Y_,toString:Y_}));function q_(){return`#${fl(this.r)}${fl(this.g)}${fl(this.b)}`}function CY(){return`#${fl(this.r)}${fl(this.g)}${fl(this.b)}${fl((isNaN(this.opacity)?1:this.opacity)*255)}`}function Y_(){const t=P0(this.opacity);return`${t===1?"rgb(":"rgba("}${yl(this.r)}, ${yl(this.g)}, ${yl(this.b)}${t===1?")":`, ${t})`}`}function P0(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function yl(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function fl(t){return t=yl(t),(t<16?"0":"")+t.toString(16)}function j_(t,e,n,o){return o<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new ti(t,e,n,o)}function NC(t){if(t instanceof ti)return new ti(t.h,t.s,t.l,t.opacity);if(t instanceof xf||(t=Tl(t)),!t)return new ti;if(t instanceof ti)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 ti(s,a,l,t.opacity)}function AY(t,e,n,o){return arguments.length===1?NC(t):new ti(t,e,n,o??1)}function ti(t,e,n,o){this.h=+t,this.s=+e,this.l=+n,this.opacity=+o}Ty(ti,AY,RC(xf,{brighter(t){return t=t==null?L0:Math.pow(L0,t),new ti(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Wd:Math.pow(Wd,t),new ti(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 or(Gg(t>=240?t-240:t+120,r,o),Gg(t,r,o),Gg(t<120?t+240:t-120,r,o),this.opacity)},clamp(){return new ti(X_(this.h),Jf(this.s),Jf(this.l),P0(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=P0(this.opacity);return`${t===1?"hsl(":"hsla("}${X_(this.h)}, ${Jf(this.s)*100}%, ${Jf(this.l)*100}%${t===1?")":`, ${t})`}`}}));function X_(t){return t=(t||0)%360,t<0?t+360:t}function Jf(t){return Math.max(0,Math.min(1,t||0))}function Gg(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 My=t=>()=>t;function $Y(t,e){return function(n){return t+n*e}}function TY(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 MY(t){return(t=+t)==1?FC:function(e,n){return n-e?TY(e,n,t):My(isNaN(e)?n:e)}}function FC(t,e){var n=e-t;return n?$Y(t,n):My(isNaN(t)?e:t)}const D0=(function t(e){var n=MY(e);function o(r,i){var s=n((r=y1(r)).r,(i=y1(i)).r),a=n(r.g,i.g),l=n(r.b,i.b),c=FC(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 OY(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 BY(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function LY(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]=Oy(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 PY(t,e){var n=new Date;return t=+t,e=+e,function(o){return n.setTime(t*(1-o)+e*o),n}}function to(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function yd(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]=Oy(t[r],e[r]):o[r]=e[r];return function(i){for(r in n)o[r]=n[r](i);return o}}var x1=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,qg=new RegExp(x1.source,"g");function DY(t){return function(){return t}}function EY(t){return function(e){return t(e)+""}}function VC(t,e){var n=x1.lastIndex=qg.lastIndex=0,o,r,i,s=-1,a=[],l=[];for(t=t+"",e=e+"";(o=x1.exec(t))&&(r=qg.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:to(o,r)})),n=qg.lastIndex;return n<e.length&&(i=e.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?EY(l[0].x):DY(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 Oy(t,e){var n=typeof e,o;return e==null||n==="boolean"?My(e):(n==="number"?to:n==="string"?(o=Tl(e))?(e=o,D0):VC:e instanceof Tl?D0:e instanceof Date?PY:BY(e)?OY:Array.isArray(e)?LY:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?yd:to)(t,e)}function IY(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var K_=180/Math.PI,w1={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function zC(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)*K_,skewX:Math.atan(l)*K_,scaleX:s,scaleY:a}}var eh;function RY(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?w1:zC(e.a,e.b,e.c,e.d,e.e,e.f)}function NY(t){return t==null||(eh||(eh=document.createElementNS("http://www.w3.org/2000/svg","g")),eh.setAttribute("transform",t),!(t=eh.transform.baseVal.consolidate()))?w1:(t=t.matrix,zC(t.a,t.b,t.c,t.d,t.e,t.f))}function HC(t,e,n,o){function r(c){return c.length?c.pop()+" ":""}function i(c,u,d,f,h,m){if(c!==d||u!==f){var b=h.push("translate(",null,e,null,n);m.push({i:b-4,x:to(c,d)},{i:b-2,x:to(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:to(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:to(c,u)}):u&&d.push(r(d)+"skewX("+u+o)}function l(c,u,d,f,h,m){if(c!==d||u!==f){var b=h.push(r(h)+"scale(",null,",",null,")");m.push({i:b-4,x:to(c,d)},{i:b-2,x:to(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 m=-1,b=f.length,g;++m<b;)d[(g=f[m]).i]=g.x(h);return d.join("")}}}var FY=HC(RY,"px, ","px)","deg)"),VY=HC(NY,", ",")",")"),Xc=0,Ju=0,zu=0,WC=1e3,E0,ed,I0=0,Ml=0,fm=0,Gd=typeof performance=="object"&&performance.now?performance:Date,UC=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function By(){return Ml||(UC(zY),Ml=Gd.now()+fm)}function zY(){Ml=0}function R0(){this._call=this._time=this._next=null}R0.prototype=GC.prototype={constructor:R0,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?By():+n)+(e==null?0:+e),!this._next&&ed!==this&&(ed?ed._next=this:E0=this,ed=this),this._call=t,this._time=n,_1()},stop:function(){this._call&&(this._call=null,this._time=1/0,_1())}};function GC(t,e,n){var o=new R0;return o.restart(t,e,n),o}function HY(){By(),++Xc;for(var t=E0,e;t;)(e=Ml-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Xc}function Z_(){Ml=(I0=Gd.now())+fm,Xc=Ju=0;try{HY()}finally{Xc=0,UY(),Ml=0}}function WY(){var t=Gd.now(),e=t-I0;e>WC&&(fm-=e,I0=t)}function UY(){for(var t,e=E0,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:E0=n);ed=t,_1(o)}function _1(t){if(!Xc){Ju&&(Ju=clearTimeout(Ju));var e=t-Ml;e>24?(t<1/0&&(Ju=setTimeout(Z_,t-Gd.now()-fm)),zu&&(zu=clearInterval(zu))):(zu||(I0=Gd.now(),zu=setInterval(WY,WC)),Xc=1,UC(Z_))}}function Q_(t,e,n){var o=new R0;return e=e==null?0:+e,o.restart(r=>{o.stop(),t(r+e)},e,n),o}var GY=Cy("start","end","cancel","interrupt"),qY=[],qC=0,J_=1,S1=2,Wh=3,e8=4,k1=5,Uh=6;function hm(t,e,n,o,r,i){var s=t.__transition;if(!s)t.__transition={};else if(n in s)return;YY(t,n,{name:e,index:o,group:r,on:GY,tween:qY,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:qC})}function Ly(t,e){var n=Si(t,e);if(n.state>qC)throw new Error("too late; already scheduled");return n}function rs(t,e){var n=Si(t,e);if(n.state>Wh)throw new Error("too late; already running");return n}function Si(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function YY(t,e,n){var o=t.__transition,r;o[e]=n,n.timer=GC(i,0,n.time);function i(c){n.state=J_,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!==J_)return l();for(u in o)if(h=o[u],h.name===n.name){if(h.state===Wh)return Q_(s);h.state===e8?(h.state=Uh,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete o[u]):+u<e&&(h.state=Uh,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete o[u])}if(Q_(function(){n.state===Wh&&(n.state=e8,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=S1,n.on.call("start",t,t.__data__,n.index,n.group),n.state===S1){for(n.state=Wh,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=k1,1),d=-1,f=r.length;++d<f;)r[d].call(t,u);n.state===k1&&(n.on.call("end",t,t.__data__,n.index,n.group),l())}function l(){n.state=Uh,n.timer.stop(),delete o[e];for(var c in o)return;delete t.__transition}}function jY(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>S1&&o.state<k1,o.state=Uh,o.timer.stop(),o.on.call(r?"interrupt":"cancel",t,t.__data__,o.index,o.group),delete n[s]}i&&delete t.__transition}}function XY(t){return this.each(function(){jY(this,t)})}function KY(t,e){var n,o;return function(){var r=rs(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 ZY(t,e,n){var o,r;if(typeof n!="function")throw new Error;return function(){var i=rs(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 QY(t,e){var n=this._id;if(t+="",arguments.length<2){for(var o=Si(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?KY:ZY)(n,t,e))}function Py(t,e,n){var o=t._id;return t.each(function(){var r=rs(this,o);(r.value||(r.value={}))[e]=n.apply(this,arguments)}),function(r){return Si(r,o).value[e]}}function YC(t,e){var n;return(typeof e=="number"?to:e instanceof Tl?D0:(n=Tl(e))?(e=n,D0):VC)(t,e)}function JY(t){return function(){this.removeAttribute(t)}}function ej(t){return function(){this.removeAttributeNS(t.space,t.local)}}function tj(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 nj(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 oj(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 rj(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 ij(t,e){var n=dm(t),o=n==="transform"?VY:YC;return this.attrTween(t,typeof e=="function"?(n.local?rj:oj)(n,o,Py(this,"attr."+t,e)):e==null?(n.local?ej:JY)(n):(n.local?nj:tj)(n,o,e))}function sj(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function aj(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function lj(t,e){var n,o;function r(){var i=e.apply(this,arguments);return i!==o&&(n=(o=i)&&aj(t,i)),n}return r._value=e,r}function cj(t,e){var n,o;function r(){var i=e.apply(this,arguments);return i!==o&&(n=(o=i)&&sj(t,i)),n}return r._value=e,r}function uj(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=dm(t);return this.tween(n,(o.local?lj:cj)(o,e))}function dj(t,e){return function(){Ly(this,t).delay=+e.apply(this,arguments)}}function fj(t,e){return e=+e,function(){Ly(this,t).delay=e}}function hj(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?dj:fj)(e,t)):Si(this.node(),e).delay}function pj(t,e){return function(){rs(this,t).duration=+e.apply(this,arguments)}}function mj(t,e){return e=+e,function(){rs(this,t).duration=e}}function gj(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?pj:mj)(e,t)):Si(this.node(),e).duration}function vj(t,e){if(typeof e!="function")throw new Error;return function(){rs(this,t).ease=e}}function bj(t){var e=this._id;return arguments.length?this.each(vj(e,t)):Si(this.node(),e).ease}function yj(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;rs(this,t).ease=n}}function xj(t){if(typeof t!="function")throw new Error;return this.each(yj(this._id,t))}function wj(t){typeof t!="function"&&(t=$C(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 Es(o,this._parents,this._name,this._id)}function _j(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 Es(s,this._parents,this._name,this._id)}function Sj(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 kj(t,e,n){var o,r,i=Sj(e)?Ly:rs;return function(){var s=i(this,t),a=s.on;a!==o&&(r=(o=a).copy()).on(e,n),s.on=r}}function Cj(t,e){var n=this._id;return arguments.length<2?Si(this.node(),n).on.on(t):this.each(kj(n,t,e))}function Aj(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function $j(){return this.on("end.remove",Aj(this._id))}function Tj(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Ay(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,hm(c[f],e,n,f,c,Si(u,n)));return new Es(i,this._parents,e,n)}function Mj(t){var e=this._name,n=this._id;typeof t!="function"&&(t=AC(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,m=Si(u,n),b=0,g=f.length;b<g;++b)(h=f[b])&&hm(h,e,n,b,f,m);i.push(f),s.push(u)}return new Es(i,s,e,n)}var Oj=yf.prototype.constructor;function Bj(){return new Oj(this._groups,this._parents)}function Lj(t,e){var n,o,r;return function(){var i=jc(this,t),s=(this.style.removeProperty(t),jc(this,t));return i===s?null:i===n&&s===o?r:r=e(n=i,o=s)}}function jC(t){return function(){this.style.removeProperty(t)}}function Pj(t,e,n){var o,r=n+"",i;return function(){var s=jc(this,t);return s===r?null:s===o?i:i=e(o=s,n)}}function Dj(t,e,n){var o,r,i;return function(){var s=jc(this,t),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(t),jc(this,t))),s===l?null:s===o&&l===r?i:(r=l,i=e(o=s,a))}}function Ej(t,e){var n,o,r,i="style."+e,s="end."+i,a;return function(){var l=rs(this,t),c=l.on,u=l.value[i]==null?a||(a=jC(e)):void 0;(c!==n||r!==u)&&(o=(n=c).copy()).on(s,r=u),l.on=o}}function Ij(t,e,n){var o=(t+="")=="transform"?FY:YC;return e==null?this.styleTween(t,Lj(t,o)).on("end.style."+t,jC(t)):typeof e=="function"?this.styleTween(t,Dj(t,o,Py(this,"style."+t,e))).each(Ej(this._id,t)):this.styleTween(t,Pj(t,o,e),n).on("end.style."+t,null)}function Rj(t,e,n){return function(o){this.style.setProperty(t,e.call(this,o),n)}}function Nj(t,e,n){var o,r;function i(){var s=e.apply(this,arguments);return s!==r&&(o=(r=s)&&Rj(t,s,n)),o}return i._value=e,i}function Fj(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,Nj(t,e,n??""))}function Vj(t){return function(){this.textContent=t}}function zj(t){return function(){var e=t(this);this.textContent=e??""}}function Hj(t){return this.tween("text",typeof t=="function"?zj(Py(this,"text",t)):Vj(t==null?"":t+""))}function Wj(t){return function(e){this.textContent=t.call(this,e)}}function Uj(t){var e,n;function o(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&Wj(r)),e}return o._value=t,o}function Gj(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,Uj(t))}function qj(){for(var t=this._name,e=this._id,n=XC(),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=Si(l,e);hm(l,t,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Es(o,this._parents,t,n)}function Yj(){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=rs(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 jj=0;function Es(t,e,n,o){this._groups=t,this._parents=e,this._name=n,this._id=o}function XC(){return++jj}var cs=yf.prototype;Es.prototype={constructor:Es,select:Tj,selectAll:Mj,selectChild:cs.selectChild,selectChildren:cs.selectChildren,filter:wj,merge:_j,selection:Bj,transition:qj,call:cs.call,nodes:cs.nodes,node:cs.node,size:cs.size,empty:cs.empty,each:cs.each,on:Cj,attr:ij,attrTween:uj,style:Ij,styleTween:Fj,text:Hj,textTween:Gj,remove:$j,tween:QY,delay:hj,duration:gj,ease:bj,easeVarying:xj,end:Yj,[Symbol.iterator]:cs[Symbol.iterator]};function th(t){return--t*t*t+1}function C1(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Xj={time:null,delay:0,duration:250,ease:C1};function Kj(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 Zj(t){var e,n;t instanceof Es?(e=t._id,t=t._name):(e=XC(),(n=Xj).time=By(),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])&&hm(l,t,e,c,s,n||Kj(l,e));return new Es(o,this._parents,t,e)}yf.prototype.interrupt=XY;yf.prototype.transition=Zj;const A1=Math.PI,$1=2*A1,rl=1e-6,Qj=$1-rl;function KC(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function Jj(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return KC;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 eX{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?KC:Jj(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>rl)if(!(Math.abs(d*l-c*u)>rl)||!i)this._append`L${this._x1=e},${this._y1=n}`;else{let h=o-s,m=r-a,b=l*l+c*c,g=h*h+m*m,v=Math.sqrt(b),y=Math.sqrt(f),x=i*Math.tan((A1-Math.acos((b+f-g)/(2*v*y)))/2),_=x/y,C=x/v;Math.abs(_-1)>rl&&this._append`L${e+_*u},${n+_*d}`,this._append`A${i},${i},0,0,${+(d*h>u*m)},${this._x1=e+C*l},${this._y1=n+C*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)>rl||Math.abs(this._y1-u)>rl)&&this._append`L${c},${u}`,o&&(f<0&&(f=f%$1+$1),f>Qj?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>rl&&this._append`A${o},${o},0,${+(f>=A1)},${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 pm(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}const t8=Symbol("implicit");function mm(){var t=new S_,e=[],n=[],o=t8;function r(i){let s=t.get(i);if(s===void 0){if(o!==t8)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 S_;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 mm(e,n).unknown(o)},pm.apply(r,arguments),r}function Sn(){var t=mm().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,m=h?r:o,b=h?o:r;i=(b-m)/Math.max(1,f-l+c*2),a&&(i=Math.floor(i)),m+=(b-m-i*(f-l))*u,s=i*(1-l),a&&(m=Math.round(m),s=Math.round(s));var g=fV(f).map(function(v){return m+i*v});return n(h?g.reverse():g)}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 Sn(e(),[o,r]).round(a).paddingInner(l).paddingOuter(c).align(u)},pm.apply(d(),arguments)}function ZC(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return ZC(e())},t}function gm(){return ZC(Sn.apply(null,arguments).paddingInner(1))}function tX(t){return function(){return t}}function nX(t){return+t}var n8=[0,1];function gc(t){return t}function T1(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:tX(isNaN(e)?NaN:.5)}function oX(t,e){var n;return t>e&&(n=t,t=e,e=n),function(o){return Math.max(t,Math.min(e,o))}}function rX(t,e,n){var o=t[0],r=t[1],i=e[0],s=e[1];return r<o?(o=T1(r,o),i=n(s,i)):(o=T1(o,r),i=n(i,s)),function(a){return i(o(a))}}function iX(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]=T1(t[s],t[s+1]),i[s]=n(e[s],e[s+1]);return function(a){var l=nV(t,a,1,o)-1;return i[l](r[l](a))}}function QC(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function JC(){var t=n8,e=n8,n=Oy,o,r,i,s=gc,a,l,c;function u(){var f=Math.min(t.length,e.length);return s!==gc&&(s=oX(t[0],t[f-1])),a=f>2?iX:rX,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),to)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,nX),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=IY,u()},d.clamp=function(f){return arguments.length?(s=f?!0:gc,u()):s!==gc},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 sX(){return JC()(gc,gc)}function aX(t,e,n,o){var r=dV(t,e,n),i;switch(o=k0(o??",f"),o.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return o.precision==null&&!isNaN(i=wF(r,s))&&(o.precision=i),J4(o,s)}case"":case"e":case"g":case"p":case"r":{o.precision==null&&!isNaN(i=_F(r,Math.max(Math.abs(t),Math.abs(e))))&&(o.precision=i-(o.type==="e"));break}case"f":case"%":{o.precision==null&&!isNaN(i=xF(r))&&(o.precision=i-(o.type==="%")*2);break}}return uu(o)}function eA(t){var e=t.domain;return t.ticks=function(n){var o=e();return uV(o[0],o[o.length-1],n??10)},t.tickFormat=function(n,o){var r=e();return aX(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=p1(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 gn(){var t=sX();return t.copy=function(){return QC(t,gn())},pm.apply(t,arguments),eA(t)}function o8(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function r8(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function lX(t){var e=1,n=t(o8(e),r8(e));return n.constant=function(o){return arguments.length?t(o8(e=+o),r8(e)):e},eA(n)}function Na(){var t=lX(JC());return t.copy=function(){return QC(t,Na()).constant(t.constant())},pm.apply(t,arguments)}function kt(t){return function(){return t}}const i8=Math.abs,fo=Math.atan2,ps=Math.cos,cX=Math.max,Yg=Math.min,Zo=Math.sin,Ao=Math.sqrt,ho=1e-12,Ca=Math.PI,N0=Ca/2,ga=2*Ca;function uX(t){return t>1?0:t<-1?Ca:Math.acos(t)}function s8(t){return t>=1?N0:t<=-1?-N0:Math.asin(t)}function vm(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 eX(e)}function dX(t){return t.innerRadius}function fX(t){return t.outerRadius}function hX(t){return t.startAngle}function pX(t){return t.endAngle}function mX(t){return t&&t.padAngle}function gX(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<ho))return f=(u*(e-i)-d*(t-r))/f,[t+f*l,e+f*c]}function nh(t,e,n,o,r,i,s){var a=t-n,l=e-o,c=(s?i:-i)/Ao(a*a+l*l),u=c*l,d=-c*a,f=t+u,h=e+d,m=n+u,b=o+d,g=(f+m)/2,v=(h+b)/2,y=m-f,x=b-h,_=y*y+x*x,C=r-i,L=f*b-m*h,O=(x<0?-1:1)*Ao(cX(0,C*C*_-L*L)),$=(L*x-y*O)/_,M=(-L*y-x*O)/_,D=(L*x+y*O)/_,N=(-L*y+x*O)/_,k=$-g,A=M-v,B=D-g,P=N-v;return k*k+A*A>B*B+P*P&&($=D,M=N),{cx:$,cy:M,x01:-u,y01:-d,x11:$*(r/C-1),y11:M*(r/C-1)}}function tA(){var t=dX,e=fX,n=kt(0),o=null,r=hX,i=pX,s=mX,a=null,l=vm(c);function c(){var u,d,f=+t.apply(this,arguments),h=+e.apply(this,arguments),m=r.apply(this,arguments)-N0,b=i.apply(this,arguments)-N0,g=i8(b-m),v=b>m;if(a||(a=u=l()),h<f&&(d=h,h=f,f=d),!(h>ho))a.moveTo(0,0);else if(g>ga-ho)a.moveTo(h*ps(m),h*Zo(m)),a.arc(0,0,h,m,b,!v),f>ho&&(a.moveTo(f*ps(b),f*Zo(b)),a.arc(0,0,f,b,m,v));else{var y=m,x=b,_=m,C=b,L=g,O=g,$=s.apply(this,arguments)/2,M=$>ho&&(o?+o.apply(this,arguments):Ao(f*f+h*h)),D=Yg(i8(h-f)/2,+n.apply(this,arguments)),N=D,k=D,A,B;if(M>ho){var P=s8(M/f*Zo($)),F=s8(M/h*Zo($));(L-=P*2)>ho?(P*=v?1:-1,_+=P,C-=P):(L=0,_=C=(m+b)/2),(O-=F*2)>ho?(F*=v?1:-1,y+=F,x-=F):(O=0,y=x=(m+b)/2)}var z=h*ps(y),V=h*Zo(y),G=f*ps(C),ie=f*Zo(C);if(D>ho){var ce=h*ps(x),he=h*Zo(x),Z=f*ps(_),oe=f*Zo(_),se;if(g<Ca)if(se=gX(z,V,Z,oe,ce,he,G,ie)){var re=z-se[0],U=V-se[1],te=ce-se[0],ne=he-se[1],ve=1/Zo(uX((re*te+U*ne)/(Ao(re*re+U*U)*Ao(te*te+ne*ne)))/2),me=Ao(se[0]*se[0]+se[1]*se[1]);N=Yg(D,(f-me)/(ve-1)),k=Yg(D,(h-me)/(ve+1))}else N=k=0}O>ho?k>ho?(A=nh(Z,oe,z,V,h,k,v),B=nh(ce,he,G,ie,h,k,v),a.moveTo(A.cx+A.x01,A.cy+A.y01),k<D?a.arc(A.cx,A.cy,k,fo(A.y01,A.x01),fo(B.y01,B.x01),!v):(a.arc(A.cx,A.cy,k,fo(A.y01,A.x01),fo(A.y11,A.x11),!v),a.arc(0,0,h,fo(A.cy+A.y11,A.cx+A.x11),fo(B.cy+B.y11,B.cx+B.x11),!v),a.arc(B.cx,B.cy,k,fo(B.y11,B.x11),fo(B.y01,B.x01),!v))):(a.moveTo(z,V),a.arc(0,0,h,y,x,!v)):a.moveTo(z,V),!(f>ho)||!(L>ho)?a.lineTo(G,ie):N>ho?(A=nh(G,ie,ce,he,f,-N,v),B=nh(z,V,Z,oe,f,-N,v),a.lineTo(A.cx+A.x01,A.cy+A.y01),N<D?a.arc(A.cx,A.cy,N,fo(A.y01,A.x01),fo(B.y01,B.x01),!v):(a.arc(A.cx,A.cy,N,fo(A.y01,A.x01),fo(A.y11,A.x11),!v),a.arc(0,0,f,fo(A.cy+A.y11,A.cx+A.x11),fo(B.cy+B.y11,B.cx+B.x11),v),a.arc(B.cx,B.cy,N,fo(B.y11,B.x11),fo(B.y01,B.x01),!v))):a.arc(0,0,f,C,_,v)}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-Ca/2;return[ps(d)*u,Zo(d)*u]},c.innerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:kt(+u),c):t},c.outerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:kt(+u),c):e},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:kt(+u),c):n},c.padRadius=function(u){return arguments.length?(o=u==null?null:typeof u=="function"?u:kt(+u),c):o},c.startAngle=function(u){return arguments.length?(r=typeof u=="function"?u:kt(+u),c):r},c.endAngle=function(u){return arguments.length?(i=typeof u=="function"?u:kt(+u),c):i},c.padAngle=function(u){return arguments.length?(s=typeof u=="function"?u:kt(+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 nA(t){this._context=t}nA.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 du(t){return new nA(t)}function oA(t){return t[0]}function rA(t){return t[1]}function bi(t,e){var n=kt(!0),o=null,r=du,i=null,s=vm(a);t=typeof t=="function"?t:t===void 0?oA:kt(t),e=typeof e=="function"?e:e===void 0?rA:kt(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:kt(+l),a):t},a.y=function(l){return arguments.length?(e=typeof l=="function"?l:kt(+l),a):e},a.defined=function(l){return arguments.length?(n=typeof l=="function"?l:kt(!!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 Is(t,e,n){var o=null,r=kt(!0),i=null,s=du,a=null,l=vm(c);t=typeof t=="function"?t:t===void 0?oA:kt(+t),e=typeof e=="function"?e:kt(e===void 0?0:+e),n=typeof n=="function"?n:n===void 0?rA:kt(+n);function c(d){var f,h,m,b=(d=bm(d)).length,g,v=!1,y,x=new Array(b),_=new Array(b);for(i==null&&(a=s(y=l())),f=0;f<=b;++f){if(!(f<b&&r(g=d[f],f,d))===v)if(v=!v)h=f,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),m=f-1;m>=h;--m)a.point(x[m],_[m]);a.lineEnd(),a.areaEnd()}v&&(x[f]=+t(g,f,d),_[f]=+e(g,f,d),a.point(o?+o(g,f,d):x[f],n?+n(g,f,d):_[f]))}if(y)return a=null,y+""||null}function u(){return bi().defined(r).curve(s).context(i)}return c.x=function(d){return arguments.length?(t=typeof d=="function"?d:kt(+d),o=null,c):t},c.x0=function(d){return arguments.length?(t=typeof d=="function"?d:kt(+d),c):t},c.x1=function(d){return arguments.length?(o=d==null?null:typeof d=="function"?d:kt(+d),c):o},c.y=function(d){return arguments.length?(e=typeof d=="function"?d:kt(+d),n=null,c):e},c.y0=function(d){return arguments.length?(e=typeof d=="function"?d:kt(+d),c):e},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:kt(+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:kt(!!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 vX(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function bX(t){return t}function yX(){var t=bX,e=vX,n=null,o=kt(0),r=kt(ga),i=kt(0);function s(a){var l,c=(a=bm(a)).length,u,d,f=0,h=new Array(c),m=new Array(c),b=+o.apply(this,arguments),g=Math.min(ga,Math.max(-ga,r.apply(this,arguments)-b)),v,y=Math.min(Math.abs(g)/c,i.apply(this,arguments)),x=y*(g<0?-1:1),_;for(l=0;l<c;++l)(_=m[h[l]=l]=+t(a[l],l,a))>0&&(f+=_);for(e!=null?h.sort(function(C,L){return e(m[C],m[L])}):n!=null&&h.sort(function(C,L){return n(a[C],a[L])}),l=0,d=f?(g-c*x)/f:0;l<c;++l,b=v)u=h[l],_=m[u],v=b+(_>0?_*d:0)+x,m[u]={data:a[u],index:l,value:_,startAngle:b,endAngle:v,padAngle:y};return m}return s.value=function(a){return arguments.length?(t=typeof a=="function"?a:kt(+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:kt(+a),s):o},s.endAngle=function(a){return arguments.length?(r=typeof a=="function"?a:kt(+a),s):r},s.padAngle=function(a){return arguments.length?(i=typeof a=="function"?a:kt(+a),s):i},s}const Dy={draw(t,e){const n=Ao(e/Ca);t.moveTo(n,0),t.arc(0,0,n,0,ga)}},xX={draw(t,e){const n=Ao(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()}},iA=Ao(1/3),wX=iA*2,_X={draw(t,e){const n=Ao(e/wX),o=n*iA;t.moveTo(0,-n),t.lineTo(o,0),t.lineTo(0,n),t.lineTo(-o,0),t.closePath()}},SX={draw(t,e){const n=Ao(e),o=-n/2;t.rect(o,o,n,n)}},kX=.8908130915292852,sA=Zo(Ca/10)/Zo(7*Ca/10),CX=Zo(ga/10)*sA,AX=-ps(ga/10)*sA,$X={draw(t,e){const n=Ao(e*kX),o=CX*n,r=AX*n;t.moveTo(0,-n),t.lineTo(o,r);for(let i=1;i<5;++i){const s=ga*i/5,a=ps(s),l=Zo(s);t.lineTo(l*n,-a*n),t.lineTo(a*o-l*r,l*o+a*r)}t.closePath()}},jg=Ao(3),aA={draw(t,e){const n=-Ao(e/(jg*3));t.moveTo(0,n*2),t.lineTo(-jg*n,-n),t.lineTo(jg*n,-n),t.closePath()}},TX=Ao(3),MX={draw(t,e){const n=Ao(e)*.6824,o=n/2,r=n*TX/2;t.moveTo(0,-n),t.lineTo(r,o),t.lineTo(-r,o),t.closePath()}};function OX(t,e){let n=null,o=vm(r);t=typeof t=="function"?t:kt(t||Dy),e=typeof e=="function"?e:kt(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:kt(i),r):t},r.size=function(i){return arguments.length?(e=typeof i=="function"?i:kt(+i),r):e},r.context=function(i){return arguments.length?(n=i??null,r):n},r}function a8(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 lA(t){this._context=t}lA.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:a8(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:a8(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function BX(t){return new lA(t)}function l8(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 Ey(t,e){this._context=t,this._k=(1-e)/6}Ey.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:l8(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:l8(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 LX=(function t(e){function n(o){return new Ey(o,e)}return n.tension=function(o){return t(+o)},n})(0);function PX(t,e,n){var o=t._x1,r=t._y1,i=t._x2,s=t._y2;if(t._l01_a>ho){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>ho){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 cA(t,e){this._context=t,this._alpha=e}cA.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:PX(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 DX=(function t(e){function n(o){return e?new cA(o,e):new Ey(o,0)}return n.alpha=function(o){return t(+o)},n})(.5);function c8(t){return t<0?-1:1}function u8(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(c8(i)+c8(s))*Math.min(Math.abs(i),Math.abs(s),.5*Math.abs(a))||0}function d8(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Xg(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 F0(t){this._context=t}F0.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:Xg(this,this._t0,d8(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,Xg(this,d8(this,n=u8(this,t,e)),n);break;default:Xg(this,this._t0,n=u8(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};Object.create(F0.prototype).point=function(t,e){F0.prototype.point.call(this,e,t)};function Iy(t){return new F0(t)}function ym(t,e){this._context=t,this._t=e}ym.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 EX(t){return new ym(t,.5)}function IX(t){return new ym(t,0)}function RX(t){return new ym(t,1)}function V0(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 z0(t){for(var e=t.length,n=new Array(e);--e>=0;)n[e]=e;return n}function NX(t,e){return t[e]}function FX(t){const e=[];return e.key=t,e}function uA(){var t=kt([]),e=z0,n=V0,o=NX;function r(i){var s=Array.from(t.apply(this,arguments),FX),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:kt(Array.from(i)),r):t},r.value=function(i){return arguments.length?(o=typeof i=="function"?i:kt(+i),r):o},r.order=function(i){return arguments.length?(e=i==null?z0:typeof i=="function"?i:kt(Array.from(i)),r):e},r.offset=function(i){return arguments.length?(n=i??V0,r):n},r}function td(t,e,n){this.k=t,this.x=e,this.y=n}td.prototype={constructor:td,scale:function(t){return t===1?this:new td(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new td(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+")"}};td.prototype;function M1(t,e){if(!t)throw new Error(`[d3-blueprint] ${e}`)}class VX{constructor(){qn(this,"properties",new Map)}define(e,n){M1(!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 M1(n,`config "${e}" is not defined`),n}}const O1=["update","enter","merge","exit"],dA=new Set([...O1,...O1.map(t=>`${t}:transition`)]);function zX(t){return dA.has(t)}function f8(t){M1(zX(t),`"${t}" is not a valid lifecycle event. Expected one of: ${[...dA].join(", ")}`)}function HX(t,e,n){const o=t.exit(),r={update:t,enter:e,merge:e.merge(t),exit:o};return O1.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 WX(t,e){for(const n of e)n(t)}function UX(t,e){return e.map(n=>{const o=t.transition();return n(o),GX(o)})}function GX(t){return t.end().then(()=>{},()=>{})}class qX{constructor(e,n){qn(this,"base");qn(this,"dataBindFn");qn(this,"insertFn");qn(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){f8(e);const o=this.handlers.get(e)??[];return o.push(n),this.handlers.set(e,o),this}off(e,n){if(f8(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=HX(n,r,this.handlers),s=[];for(const a of i){WX(a.selection,a.handlers);const l=UX(a.selection,a.transitionHandlers);s.push(...l)}return Promise.all(s).then(()=>{})}}function YX(t,e,n,o){if(n&&o){const i=new qX(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 jX(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 XX(t,e){const n=[];for(const o of t.values())n.push(o.draw(e));return n}function KX(t,e){const n=[];for(const o of t.values()){const r=o.draw(e);r&&n.push(r)}return n}const ZX=["preDraw","postDraw","postTransition"];class so{constructor(e){qn(this,"base");qn(this,"layers",new Map);qn(this,"attachments",new Map);qn(this,"configs",new VX);qn(this,"dispatcher");qn(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=Cy(...ZX),this.initialize()}initialize(){}transform(e){return e}preDraw(e){}postDraw(e){}postTransition(e){}layer(e,n,o){return YX(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 jX(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=XX(this.layers,n),r=KX(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 QX extends so{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)},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)},exit:s=>{s.remove()}}})}}function JX(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 eK(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 tK='<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 nK(t){return t.showCredit===!1?[]:[{tag:"span",className:"bc-frame-credit",text:"Blueprint Chart",html:tK+"Blueprint Chart"}]}function Ur(t,e={}){new QX(_e(t)).draw({headerItems:JX(e),footerLeftItems:eK(e),footerRightItems:nK(e)});const o=t.querySelector(".bc-frame"),r=o.querySelector(".bc-frame-header"),i=o.querySelector(".bc-frame-body"),s=o.querySelector(".bc-frame-note"),a=o.querySelector(".bc-frame-footer");if(e.padding&&o.style.setProperty("--bc-frame-padding",e.padding),e.transparentBackground&&o.style.setProperty("--bc-frame-bg","transparent"),e.note?s.textContent=e.note:s.style.display="none",t.isConnected){const l=getComputedStyle(t),c=l.aspectRatio&&l.aspectRatio!=="auto"&&l.aspectRatio!=="",u=l.display==="flex"&&l.flexDirection==="column";if(c||u){const d=r.offsetHeight,f=a.offsetHeight,h=s.style.display!=="none"?s.offsetHeight:0;o.classList.add("bc-frame--constrained");const m=t.__bcHeaderH??0,b=t.__bcFooterH??0,g=Math.max(d,m),v=Math.max(f+h,b);i.dataset.headerH=String(g),i.dataset.footerH=String(v),t.__bcHeaderH=g,requestAnimationFrame(()=>{t.__bcFooterH=Math.max(a.offsetHeight+h,v)})}}return{wrapper:o,header:r,body:i,footer:a}}function h8(t){return t&&(t.startsWith("(")&&t.endsWith(")")?t.slice(0,-1):t)}function oK(t){if(!t)return{prefix:"",d3Spec:"",suffix:""};if(t.includes("|")){const e=t.split("|");return{prefix:e[0]??"",d3Spec:h8(e[1]??""),suffix:e[2]??""}}return{prefix:"",d3Spec:h8(t),suffix:""}}function Aa(t){if(!t)return null;const{prefix:e,d3Spec:n,suffix:o}=oK(t);if(!n)return null;const r=uu(n);return!e&&!o?r:i=>`${e}${r(i)}${o}`}function ki(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 rK={top:12,right:20,bottom:24,left:50},fA=600,hA=400;class iK extends so{initialize(){this.configDefine("totalWidth",{defaultValue:fA}),this.configDefine("totalHeight",{defaultValue:hA}),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 p8=400,H0=2,W0=9;function ql(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"?Na().domain([s,a]).nice():gn().domain([s,a]).nice(),c=l.ticks(),u=n?Aa(n)??l.tickFormat():l.tickFormat(),d=c.map(h=>u(h));if(d.length===0)return 0;try{const m=document.createElement("canvas").getContext("2d");if(m){m.font="10px sans-serif";let b=0;for(const g of d){const v=m.measureText(g).width;v>b&&(b=v)}return Math.ceil(b)+H0+W0}}catch{}return Math.max(...d.map(h=>h.length))*6+H0+W0}function xm(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)+H0+W0}}catch{}return Math.max(...t.map(n=>n.length))*6+H0+W0}function Ci(t,e,n,o,r,i){const s={},a=r??50,l=o??"left",c=e??"auto",u=c==="auto"?t>0&&t<p8?"inside":"outside":c,d=u==="inside",f=u==="off";if(l==="right"?(s.left=0,d||f?s.right=0:s.right=a):(s.right=i!==!1?15:0,d||f?s.left=0:s.left=a),d&&(s.top=35),i===!1)s.bottom=5;else{const h=n??"auto",m=h==="auto"?t>0&&t<p8?"inside":"outside":h;(m==="inside"||m==="off")&&(s.bottom=5)}return s}function ar(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 Gr(t,e){const n={...rK,...e},o=t.closest(".bc-frame--constrained")!=null;if(o){const f=parseFloat(t.dataset.headerH||"0"),h=parseFloat(t.dataset.footerH||"0"),m=n.top;n.top=f+m,n.bottom+=h,n.stableTop=m}const r=ar(t),i=r.width>0?r.width:fA,s=r.height>0?r.height:hA,a=i-n.left-n.right,l=s-n.top-n.bottom,c=new iK(_e(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 Yl(t){return typeof window>"u"||typeof window.matchMedia!="function"?t:window.matchMedia("(prefers-reduced-motion: reduce)").matches?0:t}const fu=500;let pA=0;function qr(t){pA=t?fu:0}function ut(){return Yl(pA)}function jn(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=ut();if(i>0)_e(r).transition().duration(i).attrTween("transform",()=>{const s=to(n,0),a=to(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 Cr(t,e){const n=Yl(fu);n<=0||typeof t.animate!="function"||t.animate([{opacity:0},{opacity:1}],{duration:n,easing:"ease-in-out"})}function Ar(t,e){if(Yl(fu)<=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.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(".bc-frame").forEach(r=>{r.classList.remove("bc-frame"),r.classList.add("bc-frame--fade-snapshot")}),o}function $r(t,e,n){const o=Yl(fu);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 m8=30;class sK extends so{initialize(){this.configDefine("scale",{defaultValue:gn()}),this.configDefine("direction",{defaultValue:ei.Left}),this.configDefine("showAxis",{defaultValue:!0}),this.configDefine("showTicks",{defaultValue:!1}),this.configDefine("gridStyle",{defaultValue:Hn.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:rn.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===ei.Right?N_(o):F_(o);s||u.tickSizeOuter(0);const d=this.config("ticks");if(d)u.tickValues(d);else if(c>0){const b=Math.max(2,Math.floor(c/m8));u.ticks(b)}const f=this.config("tickFormat");if(f)u.tickFormat(f);else{const b=this.config("numberFormat"),g=b?Aa(b):null;g&&u.tickFormat(g)}const h=ut(),m=n.node();if(m){h>0?n.duration(h).call(u):_e(m).call(u),i||_e(m).select(".domain").remove(),s||_e(m).selectAll(".tick line").attr("opacity",0);const g=a===rn.Auto?l>0&&l<400?rn.Inside:rn.Outside:a;if(g===rn.Inside){const v=i?4:0;r===ei.Right?_e(m).selectAll(".tick text").attr("x",-v).attr("dy","-0.4em").attr("text-anchor","end"):_e(m).selectAll(".tick text").attr("x",v).attr("dy","-0.4em").attr("text-anchor","start")}else g===rn.Off&&_e(m).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===ei.Right?N_(o):F_(o);this.config("showTicks")||c.tickSizeOuter(0);const u=this.config("ticks");if(u)c.tickValues(u);else if(a>0){const g=Math.max(2,Math.floor(a/m8));c.ticks(g)}const d=this.config("tickFormat");if(d)c.tickFormat(d);else{const g=this.config("numberFormat"),v=g?Aa(g):null;v&&c.tickFormat(v)}n.call(c);const f=this.config("showAxis"),h=this.config("showTicks");f||n.select(".domain").remove();const b=i===rn.Auto?s>0&&s<400?rn.Inside:rn.Outside:i;if(b===rn.Inside){const g=f?4:0;if(r===ei.Right?n.selectAll(".tick text").attr("x",-g).attr("dy","-0.4em").attr("text-anchor","end"):n.selectAll(".tick text").attr("x",g).attr("dy","-0.4em").attr("text-anchor","start"),h?n.selectAll(".tick line").attr("x2",r===ei.Right?-6:6):n.selectAll(".tick line").remove(),l>0&&f){const v=n.select(".domain");if(!v.empty()){const y=v.attr("d"),x=y.replace(/V[\d.]+/,`V${-l}`);x!==y&&v.attr("d",x)}}}else h||n.selectAll(".tick line").remove(),b===rn.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!==Hn.None&&n>0){const i=o===ei.Right?-n:n;aK(r,e,i)}}}function aK(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";_e(t).selectAll(".tick").each(function(){const c=_e(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===Hn.Dashed?c.attr("stroke-dasharray","4,4"):e===Hn.Dotted&&c.attr("stroke-dasharray","1,3")})}function mA(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Gh={exports:{}},lK=Gh.exports,g8;function cK(){return g8||(g8=1,(function(t,e){(function(n,o){t.exports=o()})(lK,(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",m="date",b="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|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(B){var P=["th","st","nd","rd"],F=B%100;return"["+B+(P[(F-20)%10]||P[F]||P[0])+"]"}},x=function(B,P,F){var z=String(B);return!z||z.length>=P?B:""+Array(P+1-z.length).join(F)+B},_={s:x,z:function(B){var P=-B.utcOffset(),F=Math.abs(P),z=Math.floor(F/60),V=F%60;return(P<=0?"+":"-")+x(z,2,"0")+":"+x(V,2,"0")},m:function B(P,F){if(P.date()<F.date())return-B(F,P);var z=12*(F.year()-P.year())+(F.month()-P.month()),V=P.clone().add(z,d),G=F-V<0,ie=P.clone().add(z+(G?-1:1),d);return+(-(z+(F-V)/(G?V-ie:ie-V))||0)},a:function(B){return B<0?Math.ceil(B)||0:Math.floor(B)},p:function(B){return{M:d,y:h,w:u,d:c,D:m,h:l,m:a,s,ms:i,Q:f}[B]||String(B||"").toLowerCase().replace(/s$/,"")},u:function(B){return B===void 0}},C="en",L={};L[C]=y;var O="$isDayjsObject",$=function(B){return B instanceof k||!(!B||!B[O])},M=function B(P,F,z){var V;if(!P)return C;if(typeof P=="string"){var G=P.toLowerCase();L[G]&&(V=G),F&&(L[G]=F,V=G);var ie=P.split("-");if(!V&&ie.length>1)return B(ie[0])}else{var ce=P.name;L[ce]=P,V=ce}return!z&&V&&(C=V),V||!z&&C},D=function(B,P){if($(B))return B.clone();var F=typeof P=="object"?P:{};return F.date=B,F.args=arguments,new k(F)},N=_;N.l=M,N.i=$,N.w=function(B,P){return D(B,{locale:P.$L,utc:P.$u,x:P.$x,$offset:P.$offset})};var k=(function(){function B(F){this.$L=M(F.locale,null,!0),this.parse(F),this.$x=this.$x||F.x||{},this[O]=!0}var P=B.prototype;return P.parse=function(F){this.$d=(function(z){var V=z.date,G=z.utc;if(V===null)return new Date(NaN);if(N.u(V))return new Date;if(V instanceof Date)return new Date(V);if(typeof V=="string"&&!/Z$/i.test(V)){var ie=V.match(g);if(ie){var ce=ie[2]-1||0,he=(ie[7]||"0").substring(0,3);return G?new Date(Date.UTC(ie[1],ce,ie[3]||1,ie[4]||0,ie[5]||0,ie[6]||0,he)):new Date(ie[1],ce,ie[3]||1,ie[4]||0,ie[5]||0,ie[6]||0,he)}}return new Date(V)})(F),this.init()},P.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()},P.$utils=function(){return N},P.isValid=function(){return this.$d.toString()!==b},P.isSame=function(F,z){var V=D(F);return this.startOf(z)<=V&&V<=this.endOf(z)},P.isAfter=function(F,z){return D(F)<this.startOf(z)},P.isBefore=function(F,z){return this.endOf(z)<D(F)},P.$g=function(F,z,V){return N.u(F)?this[z]:this.set(V,F)},P.unix=function(){return Math.floor(this.valueOf()/1e3)},P.valueOf=function(){return this.$d.getTime()},P.startOf=function(F,z){var V=this,G=!!N.u(z)||z,ie=N.p(F),ce=function(ne,ve){var me=N.w(V.$u?Date.UTC(V.$y,ve,ne):new Date(V.$y,ve,ne),V);return G?me:me.endOf(c)},he=function(ne,ve){return N.w(V.toDate()[ne].apply(V.toDate("s"),(G?[0,0,0,0]:[23,59,59,999]).slice(ve)),V)},Z=this.$W,oe=this.$M,se=this.$D,re="set"+(this.$u?"UTC":"");switch(ie){case h:return G?ce(1,0):ce(31,11);case d:return G?ce(1,oe):ce(0,oe+1);case u:var U=this.$locale().weekStart||0,te=(Z<U?Z+7:Z)-U;return ce(G?se-te:se+(6-te),oe);case c:case m:return he(re+"Hours",0);case l:return he(re+"Minutes",1);case a:return he(re+"Seconds",2);case s:return he(re+"Milliseconds",3);default:return this.clone()}},P.endOf=function(F){return this.startOf(F,!1)},P.$set=function(F,z){var V,G=N.p(F),ie="set"+(this.$u?"UTC":""),ce=(V={},V[c]=ie+"Date",V[m]=ie+"Date",V[d]=ie+"Month",V[h]=ie+"FullYear",V[l]=ie+"Hours",V[a]=ie+"Minutes",V[s]=ie+"Seconds",V[i]=ie+"Milliseconds",V)[G],he=G===c?this.$D+(z-this.$W):z;if(G===d||G===h){var Z=this.clone().set(m,1);Z.$d[ce](he),Z.init(),this.$d=Z.set(m,Math.min(this.$D,Z.daysInMonth())).$d}else ce&&this.$d[ce](he);return this.init(),this},P.set=function(F,z){return this.clone().$set(F,z)},P.get=function(F){return this[N.p(F)]()},P.add=function(F,z){var V,G=this;F=Number(F);var ie=N.p(z),ce=function(oe){var se=D(G);return N.w(se.date(se.date()+Math.round(oe*F)),G)};if(ie===d)return this.set(d,this.$M+F);if(ie===h)return this.set(h,this.$y+F);if(ie===c)return ce(1);if(ie===u)return ce(7);var he=(V={},V[a]=o,V[l]=r,V[s]=n,V)[ie]||1,Z=this.$d.getTime()+F*he;return N.w(Z,this)},P.subtract=function(F,z){return this.add(-1*F,z)},P.format=function(F){var z=this,V=this.$locale();if(!this.isValid())return V.invalidDate||b;var G=F||"YYYY-MM-DDTHH:mm:ssZ",ie=N.z(this),ce=this.$H,he=this.$m,Z=this.$M,oe=V.weekdays,se=V.months,re=V.meridiem,U=function(ve,me,I,W){return ve&&(ve[me]||ve(z,G))||I[me].slice(0,W)},te=function(ve){return N.s(ce%12||12,ve,"0")},ne=re||function(ve,me,I){var W=ve<12?"AM":"PM";return I?W.toLowerCase():W};return G.replace(v,(function(ve,me){return me||(function(I){switch(I){case"YY":return String(z.$y).slice(-2);case"YYYY":return N.s(z.$y,4,"0");case"M":return Z+1;case"MM":return N.s(Z+1,2,"0");case"MMM":return U(V.monthsShort,Z,se,3);case"MMMM":return U(se,Z);case"D":return z.$D;case"DD":return N.s(z.$D,2,"0");case"d":return String(z.$W);case"dd":return U(V.weekdaysMin,z.$W,oe,2);case"ddd":return U(V.weekdaysShort,z.$W,oe,3);case"dddd":return oe[z.$W];case"H":return String(ce);case"HH":return N.s(ce,2,"0");case"h":return te(1);case"hh":return te(2);case"a":return ne(ce,he,!0);case"A":return ne(ce,he,!1);case"m":return String(he);case"mm":return N.s(he,2,"0");case"s":return String(z.$s);case"ss":return N.s(z.$s,2,"0");case"SSS":return N.s(z.$ms,3,"0");case"Z":return ie}return null})(ve)||ie.replace(":","")}))},P.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},P.diff=function(F,z,V){var G,ie=this,ce=N.p(z),he=D(F),Z=(he.utcOffset()-this.utcOffset())*o,oe=this-he,se=function(){return N.m(ie,he)};switch(ce){case h:G=se()/12;break;case d:G=se();break;case f:G=se()/3;break;case u:G=(oe-Z)/6048e5;break;case c:G=(oe-Z)/864e5;break;case l:G=oe/r;break;case a:G=oe/o;break;case s:G=oe/n;break;default:G=oe}return V?G:N.a(G)},P.daysInMonth=function(){return this.endOf(d).$D},P.$locale=function(){return L[this.$L]},P.locale=function(F,z){if(!F)return this.$L;var V=this.clone(),G=M(F,z,!0);return G&&(V.$L=G),V},P.clone=function(){return N.w(this.$d,this)},P.toDate=function(){return new Date(this.valueOf())},P.toJSON=function(){return this.isValid()?this.toISOString():null},P.toISOString=function(){return this.$d.toISOString()},P.toString=function(){return this.$d.toUTCString()},B})(),A=k.prototype;return D.prototype=A,[["$ms",i],["$s",s],["$m",a],["$H",l],["$W",c],["$M",d],["$y",h],["$D",m]].forEach((function(B){A[B[1]]=function(P){return this.$g(P,B[0],B[1])}})),D.extend=function(B,P){return B.$i||(B(P,k,D),B.$i=!0),D},D.locale=M,D.isDayjs=$,D.unix=function(B){return D(1e3*B)},D.en=L[C],D.Ls=L,D.p={},D}))})(Gh)),Gh.exports}var uK=cK();const $c=mA(uK);var qh={exports:{}},dK=qh.exports,v8;function fK(){return v8||(v8=1,(function(t,e){(function(n,o){t.exports=o()})(dK,(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(g){return(g=+g)+(g>68?1900:2e3)},u=function(g){return function(v){this[g]=+v}},d=[/[+-]\d\d:?(\d\d)?|Z/,function(g){(this.zone||(this.zone={})).offset=(function(v){if(!v||v==="Z")return 0;var y=v.match(/([+-]|\d\d)/g),x=60*y[1]+(+y[2]||0);return x===0?0:y[0]==="+"?-x:x})(g)}],f=function(g){var v=l[g];return v&&(v.indexOf?v:v.s.concat(v.f))},h=function(g,v){var y,x=l.meridiem;if(x){for(var _=1;_<=24;_+=1)if(g.indexOf(x(_,0,v))>-1){y=_>12;break}}else y=g===(v?"pm":"PM");return y},m={A:[a,function(g){this.afternoon=h(g,!1)}],a:[a,function(g){this.afternoon=h(g,!0)}],Q:[r,function(g){this.month=3*(g-1)+1}],S:[r,function(g){this.milliseconds=100*+g}],SS:[i,function(g){this.milliseconds=10*+g}],SSS:[/\d{3}/,function(g){this.milliseconds=+g}],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(g){var v=l.ordinal,y=g.match(/\d+/);if(this.day=y[0],v)for(var x=1;x<=31;x+=1)v(x).replace(/\[|\]/g,"")===g&&(this.day=x)}],w:[s,u("week")],ww:[i,u("week")],M:[s,u("month")],MM:[i,u("month")],MMM:[a,function(g){var v=f("months"),y=(f("monthsShort")||v.map((function(x){return x.slice(0,3)}))).indexOf(g)+1;if(y<1)throw new Error;this.month=y%12||y}],MMMM:[a,function(g){var v=f("months").indexOf(g)+1;if(v<1)throw new Error;this.month=v%12||v}],Y:[/[+-]?\d+/,u("year")],YY:[i,function(g){this.year=c(g)}],YYYY:[/\d{4}/,u("year")],Z:d,ZZ:d};function b(g){var v,y;v=g,y=l&&l.formats;for(var x=(g=v.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(D,N,k){var A=k&&k.toUpperCase();return N||y[k]||n[k]||y[A].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(B,P,F){return P||F.slice(1)}))}))).match(o),_=x.length,C=0;C<_;C+=1){var L=x[C],O=m[L],$=O&&O[0],M=O&&O[1];x[C]=M?{regex:$,parser:M}:L.replace(/^\[|\]$/g,"")}return function(D){for(var N={},k=0,A=0;k<_;k+=1){var B=x[k];if(typeof B=="string")A+=B.length;else{var P=B.regex,F=B.parser,z=D.slice(A),V=P.exec(z)[0];F.call(N,V),D=D.replace(V,"")}}return(function(G){var ie=G.afternoon;if(ie!==void 0){var ce=G.hours;ie?ce<12&&(G.hours+=12):ce===12&&(G.hours=0),delete G.afternoon}})(N),N}}return function(g,v,y){y.p.customParseFormat=!0,g&&g.parseTwoDigitYear&&(c=g.parseTwoDigitYear);var x=v.prototype,_=x.parse;x.parse=function(C){var L=C.date,O=C.utc,$=C.args;this.$u=O;var M=$[1];if(typeof M=="string"){var D=$[2]===!0,N=$[3]===!0,k=D||N,A=$[2];N&&(A=$[2]),l=this.$locale(),!D&&A&&(l=y.Ls[A]),this.$d=(function(z,V,G,ie){try{if(["x","X"].indexOf(V)>-1)return new Date((V==="X"?1e3:1)*z);var ce=b(V)(z),he=ce.year,Z=ce.month,oe=ce.day,se=ce.hours,re=ce.minutes,U=ce.seconds,te=ce.milliseconds,ne=ce.zone,ve=ce.week,me=new Date,I=oe||(he||Z?1:me.getDate()),W=he||me.getFullYear(),j=0;he&&!Z||(j=Z>0?Z-1:me.getMonth());var ue,de=se||0,fe=re||0,pe=U||0,J=te||0;return ne?new Date(Date.UTC(W,j,I,de,fe,pe,J+60*ne.offset*1e3)):G?new Date(Date.UTC(W,j,I,de,fe,pe,J)):(ue=new Date(W,j,I,de,fe,pe,J),ve&&(ue=ie(ue).week(ve).toDate()),ue)}catch{return new Date("")}})(L,M,O,y),this.init(),A&&A!==!0&&(this.$L=this.locale(A).$L),k&&L!=this.format(M)&&(this.$d=new Date("")),l={}}else if(M instanceof Array)for(var B=M.length,P=1;P<=B;P+=1){$[1]=M[P-1];var F=y.apply(this,$);if(F.isValid()){this.$d=F.$d,this.$L=F.$L,this.init();break}P===B&&(this.$d=new Date(""))}else _.call(this,C)}}}))})(qh)),qh.exports}var hK=fK();const pK=mA(hK);$c.extend(pK);const gA=["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 mK(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 gK(t){const e=t.trim();if(!e)return null;if(/^\d{4}$/.test(e)){const n=$c(e,"YYYY",!0);return n.isValid()?n.toDate():null}for(const n of gA){if(n==="YYYY")continue;const o=$c(e,n,!0);if(o.isValid())return o.toDate()}return null}function qd(t){const e=t.trim();if(!e)return;const n=gK(e);if(n)return n.getTime();const o=parseFloat(e);if(!isNaN(o))return o}function wm(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 r of t){const i=r.trim();if(!/^\d{4}$/.test(i))return null;const s=$c(i,"YYYY",!0);if(!s.isValid())return null;e.push(s.toDate())}return{dates:e,granularity:"year"}}for(const r of gA){if(r==="YYYY")continue;if($c(o,r,!0).isValid()){n=r;break}}if(!n)return null;for(const r of t){const i=$c(r.trim(),n,!0);if(!i.isValid())return null;e.push(i.toDate())}return{dates:e,granularity:mK(n)}}const vK=60,xd=10,Ry=1.3,bK=12,yK=3,xK=14,wK=10;function _K(t,e,n=yK){if(t==="")return[""];if(t.length*xd<=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*xd>e)return null;const a=i?`${i} ${s}`:s;if(a.length*xd<=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 SK={year:"%Y",month:"%b %Y",day:"%b %-d, %Y",datetime:"%b %-d, %Y %H:%M"};function kK(t){return typeof t.step=="function"}function vA(t,e){const n=wm(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 Aa(t)??uu(t);if(n){const o=zd(SK[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 wf(t,e){let n=0;for(const o of t){const i=(e?e(o):o).length*xd;i>n&&(n=i)}return n}function CK(t,e,n){if(t.length<=1)return t;const o=n?wf(t,n):t.reduce((c,u)=>Math.max(c,u.length),0)*xd,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 AK(t,e,n,o){if(t.length<=1||e<=0||n==="horizontal")return!1;if(n==="vertical")return!0;if(wm(t))return!1;const r=wf(t,o??null),i=e/t.length;return r>i*Ry}function $K(t,e){if(t.length===0)return 0;const n=wf(t,e??null);return Math.ceil(n)+bK}function TK(t){let e=1;for(const n of t)n.length>e&&(e=n.length);return e<=1?0:e*xK+wK}function Ny(t,e,n={},o=24){if(t.length===0||e<=0||n.labelPosition==="off"||n.labelPosition==="inside")return;const r=n.tickFormat?n.tickFormat:vA(n.numberFormat??null,t),i=n.labelRotation??"auto";if(!(i!=="vertical"&&wm(t)!==null)&&t.length>1){const u=e/t.length*Ry,f=wf(t,r)>u;if(i!=="vertical"&&f){const h=bA(t,u,r);if(h){const m=TK(Array.from(h.values()));return m>o?m:void 0}}}if(!AK(t,e,i,r))return;const l=$K(t,r);return l>o?l:void 0}function bA(t,e,n){const o=new Map;let r=!1;for(const i of t){const s=n?n(i):i,a=_K(s,e);if(a===null)return null;o.set(i,a),a.length>1&&(r=!0)}return r?o:null}function MK(t,e){t.selectAll(".tick").each(function(){const n=_e(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 OK extends so{initialize(){this.configDefine("scale",{defaultValue:Sn()}),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"?OG(o):BG(o);this.config("showTicks")||h.tickSizeOuter(0);const m=f||vA(u,d);m&&h.tickFormat(m);const b=kK(r),g=b?r.domain():[],v=b&&l!=="vertical"&&wm(g)!==null;let y=null,x=!1;if(b&&!v&&g.length>1&&c>0){const D=c/g.length*Ry,k=wf(g,m)>D;l==="vertical"?x=!0:k&&(y=bA(g,D,m),!y&&l==="auto"&&(x=!0))}let _=this.config("ticks");if(!_&&c>0)if(b){if(v){const M=CK(g,c,m);M.length<g.length&&(_=M)}}else{const M=Math.max(2,Math.floor(c/vK));h.ticks(M)}_&&h.tickValues(_);const C=i==="above"?0:s,L=e.node();if(n==="merge"){const M=ut();if(!L)return;M>0?(e.attr("transform",`translate(0,${C})`),e.duration(M).call(h)):_e(L).attr("transform",`translate(0,${C})`).call(h)}else e.attr("transform",`translate(0,${C})`),e.call(h);const O=n==="merge"&&L?_e(L):e;if(!this.config("showAxis"))O.select(".domain").remove();else if(n==="enter"){const M=this.config("zeroY");if(M!=null){const D=M-(i==="above"?0:s);O.select(".domain").attr("transform",`translate(0,${D})`)}}this.config("showTicks")||O.selectAll(".tick line").remove();const $=a==="auto"?"outside":a;$==="off"?O.selectAll(".tick text").remove():$==="inside"&&O.selectAll(".tick text").attr("y",0).attr("dy","-0.6em"),x&&$!=="off"?O.selectAll(".tick text").attr("transform","rotate(-90)").attr("text-anchor","end").attr("x",i==="above"?9:-9).attr("y",0).attr("dy","0.32em"):O.selectAll(".tick text").attr("transform",null),y&&$!=="off"&&MK(O,y)}postDraw(){const e=this.config("gridStyle"),n=this.config("height"),o=this.base.select(".bc-axis-horizontal").node();o&&e!=="none"&&n>0&&BK(o,e,n)}}function BK(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";_e(t).selectAll(".tick").each(function(){const c=_e(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 yA=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"],LK=200,b8=.2;class PK extends so{initialize(){this.configDefine("colors",{defaultValue:yA}),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");this.layer("items",e,{dataBind:(n,o)=>n.selectAll(".bc-legend-item").data(o),insert:n=>n.append("g").attr("class","bc-legend-item"),events:{enter:n=>{var d,f;const o=this.config("colors"),r=this.config("layout"),i=this.config("valueSuffixes"),s=((f=(d=this.base.node())==null?void 0:d.ownerSVGElement)==null?void 0:f.parentElement)??document.documentElement,a=getComputedStyle(s).getPropertyValue("--bc-text-color").trim()||"#555",l=this.config("maxWidth");let c=0,u=0;n.each(function(h,m){const b=_e(this),g=i[m],y=16+(g?h.length+1+g.length:h.length)*7+12;r==="horizontal"&&l>0&&c>0&&c+y>l&&(c=0,u+=20),b.attr("transform",`translate(${c},${u})`).attr("data-series",m).style("cursor","default"),b.append("rect").attr("width",12).attr("height",12).attr("fill",o[m%o.length]);const x=b.append("text").attr("x",16).attr("y",10).attr("font-size","12px").attr("fill",a);g?(x.append("tspan").attr("font-weight","bold").text(h),x.append("tspan").text(` ${g}`)):x.text(h),r==="vertical"?u+=20:c+=y})}}})}preDraw(){const e=this.config("yOffset");this.base.select(".bc-legend").attr("transform",`translate(0,${e})`)}}function DK(t){const e=_e(t).selectAll(".bc-legend-item");if(e.empty())return;let n=null,o=null;function r(s){o=s;const a=String(s);e.each(function(){const c=_e(this),u=c.attr("data-series")===a;c.transition().duration(150).style("opacity",u?1:b8)}),_e(t).selectAll("[data-series]").filter(function(){return!this.closest(".bc-legend")}).each(function(){const c=_e(this),u=c.attr("data-series")===a,d=this.classList.contains("bc-direct-label")||this.classList.contains("bc-value-label");c.transition().duration(150).style("opacity",u?1:d?0:b8)})}function i(){o=null,e.transition().duration(150).style("opacity",1),_e(t).selectAll("[data-series]").filter(function(){return!this.closest(".bc-legend")}).transition().duration(150).style("opacity",null)}e.each(function(){const s=this,a=parseInt(_e(s).attr("data-series")??"0",10);s.addEventListener("mouseenter",()=>{n&&clearTimeout(n),n=setTimeout(()=>r(a),Yl(LK))}),s.addEventListener("mouseleave",()=>{n&&(clearTimeout(n),n=null),o!==null&&i()})})}function Fa(t,e,n=yA,o=-10,r="top",i="start",s=0,a=0,l=0,c=[],u={}){const d=r==="left"||r==="right"?"vertical":"horizontal",f=new PK(_e(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 m=0,b=0;const g=e.map((C,L)=>{const O=c[L];return O?C.length+1+O.length:C.length});if(d==="horizontal"){const C=g.map(M=>16+M*7+12);let L=1,O=0,$=0;for(const M of C)s>0&&O>0&&O+M>s?($=Math.max($,O),L++,O=M):O+=M;$=Math.max($,O),m=$,b=L*20}else m=Math.max(...g)*7+16+8,b=e.length*20;const v=u.left??0,y=u.right??0;let x=l,_=o;d==="horizontal"?i==="middle"?x+=-v+(s+v+y-m)/2:i==="end"?x+=s+y-m:x+=-v:i==="middle"?_+=(a-b)/2:i==="end"&&(_+=a-b),h.setAttribute("transform",`translate(${x},${_})`)}return DK(t),h}const xA=[{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"]}],EK=Object.fromEntries(xA.map(t=>[t.name,t.colors]));function wA(t){if(!t)return;const e=EK[t];return e?[...e]:void 0}function _A(){return xA}function _m(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=qd(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 Yd=60;function jl(t){const e=Number.isFinite(t)?Math.max(0,Math.min(100,t)):Yd;return e/(e+100)}function hu(t,e){const n=Math.min(0,...t),o=Math.max(0,...t);let r=(e==null?void 0:e.min)??n,i=(e==null?void 0:e.max)??o;if(r>i&&([r,i]=[i,r]),r===i)if(r===0)i=1;else{const s=Math.abs(r)*.1;r=r-s,i=i+s}return[r,i]}function IK(t){return typeof t.step=="function"}const oh=new WeakMap;class Tr{constructor(e){qn(this,"vGroup",null);qn(this,"hGroup",null);qn(this,"vChart",null);qn(this,"hChart",null);qn(this,"container");qn(this,"initialized",!1);this.container=e}static for(e){let n=oh.get(e);return n||(n=new Tr(e),oh.set(e,n)),n}static clear(e){oh.delete(e)}detach(){var e,n;(e=this.vGroup)!=null&&e.parentNode&&(this.vGroup.querySelectorAll(".bc-grid-line").forEach(o=>o.remove()),this.vGroup.remove()),(n=this.hGroup)!=null&&n.parentNode&&(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 sK(_e(this.vGroup)),this.hChart=new OK(_e(this.hGroup)),this.initialized=!0;else{for(const o of[this.vGroup,this.hGroup])_e(o).selectAll(".tick").interrupt().remove();if(e.appendChild(this.vGroup),e.appendChild(this.hGroup),n&&(n.dx!==0||n.dy!==0)){const{dx:o,dy:r}=n;for(const i of[this.vGroup,this.hGroup]){i.setAttribute("transform",`translate(${o},${r})`);const s=ut();s>0?_e(i).transition().duration(s).attrTween("transform",()=>{const a=to(o,0),l=to(r,0);return c=>`translate(${a(c)},${l(c)})`}):i.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=IK(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,oh.delete(this.container)}}const B1=Math.min,Tc=Math.max,U0=Math.round,Xi=t=>({x:t,y:t}),RK={left:"right",right:"left",bottom:"top",top:"bottom"},NK={start:"end",end:"start"};function y8(t,e,n){return Tc(t,B1(e,n))}function Sm(t,e){return typeof t=="function"?t(e):t}function Ol(t){return t.split("-")[0]}function km(t){return t.split("-")[1]}function SA(t){return t==="x"?"y":"x"}function kA(t){return t==="y"?"height":"width"}const FK=new Set(["top","bottom"]);function ha(t){return FK.has(Ol(t))?"y":"x"}function CA(t){return SA(ha(t))}function VK(t,e,n){n===void 0&&(n=!1);const o=km(t),r=CA(t),i=kA(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=G0(s)),[s,G0(s)]}function zK(t){const e=G0(t);return[L1(t),e,L1(e)]}function L1(t){return t.replace(/start|end/g,e=>NK[e])}const x8=["left","right"],w8=["right","left"],HK=["top","bottom"],WK=["bottom","top"];function UK(t,e,n){switch(t){case"top":case"bottom":return n?e?w8:x8:e?x8:w8;case"left":case"right":return e?HK:WK;default:return[]}}function GK(t,e,n,o){const r=km(t);let i=UK(Ol(t),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),e&&(i=i.concat(i.map(L1)))),i}function G0(t){return t.replace(/left|right|bottom|top/g,e=>RK[e])}function qK(t){return{top:0,right:0,bottom:0,left:0,...t}}function YK(t){return typeof t!="number"?qK(t):{top:t,right:t,bottom:t,left:t}}function q0(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 _8(t,e,n){let{reference:o,floating:r}=t;const i=ha(e),s=CA(e),a=kA(s),l=Ol(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(km(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 jK(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}=Sm(e,t),m=YK(h),g=a[f?d==="floating"?"reference":"floating":d],v=q0(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(g)))==null||n?g:g.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},C=q0(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:x,strategy:l}):y);return{top:(v.top-C.top+m.top)/_.y,bottom:(C.bottom-v.bottom+m.bottom)/_.y,left:(v.left-C.left+m.left)/_.x,right:(C.right-v.right+m.right)/_.x}}const XK=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}=_8(c,o,l),f=o,h={},m=0;for(let g=0;g<a.length;g++){var b;const{name:v,fn:y}=a[g],{x,y:_,data:C,reset:L}=await y({x:u,y:d,initialPlacement:o,placement:f,strategy:r,middlewareData:h,rects:c,platform:{...s,detectOverflow:(b=s.detectOverflow)!=null?b:jK},elements:{reference:t,floating:e}});u=x??u,d=_??d,h={...h,[v]:{...h[v],...C}},L&&m<=50&&(m++,typeof L=="object"&&(L.placement&&(f=L.placement),L.rects&&(c=L.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:r}):L.rects),{x:u,y:d}=_8(c,f,l)),g=-1)}return{x:u,y:d,placement:f,strategy:r,middlewareData:h}},KK=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:m="none",flipAlignment:b=!0,...g}=Sm(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=Ol(r),y=ha(a),x=Ol(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=f||(x||!b?[G0(a)]:zK(a)),L=m!=="none";!f&&L&&C.push(...GK(a,b,m,_));const O=[a,...C],$=await l.detectOverflow(e,g),M=[];let D=((o=i.flip)==null?void 0:o.overflows)||[];if(u&&M.push($[v]),d){const B=VK(r,s,_);M.push($[B[0]],$[B[1]])}if(D=[...D,{placement:r,overflows:M}],!M.every(B=>B<=0)){var N,k;const B=(((N=i.flip)==null?void 0:N.index)||0)+1,P=O[B];if(P&&(!(d==="alignment"?y!==ha(P):!1)||D.every(V=>ha(V.placement)===y?V.overflows[0]>0:!0)))return{data:{index:B,overflows:D},reset:{placement:P}};let F=(k=D.filter(z=>z.overflows[0]<=0).sort((z,V)=>z.overflows[1]-V.overflows[1])[0])==null?void 0:k.placement;if(!F)switch(h){case"bestFit":{var A;const z=(A=D.filter(V=>{if(L){const G=ha(V.placement);return G===y||G==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(G=>G>0).reduce((G,ie)=>G+ie,0)]).sort((V,G)=>V[1]-G[1])[0])==null?void 0:A[0];z&&(F=z);break}case"initialPlacement":F=a;break}if(r!==F)return{reset:{placement:F}}}return{}}}},ZK=new Set(["left","top"]);async function QK(t,e){const{placement:n,platform:o,elements:r}=t,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=Ol(n),a=km(n),l=ha(n)==="y",c=ZK.has(s)?-1:1,u=i&&l?-1:1,d=Sm(e,t);let{mainAxis:f,crossAxis:h,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof m=="number"&&(h=a==="end"?m*-1:m),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}const JK=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 QK(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}}}}},eZ=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:v=>{let{x:y,y:x}=v;return{x:y,y:x}}},...c}=Sm(t,e),u={x:n,y:o},d=await i.detectOverflow(e,c),f=ha(Ol(r)),h=SA(f);let m=u[h],b=u[f];if(s){const v=h==="y"?"top":"left",y=h==="y"?"bottom":"right",x=m+d[v],_=m-d[y];m=y8(x,m,_)}if(a){const v=f==="y"?"top":"left",y=f==="y"?"bottom":"right",x=b+d[v],_=b-d[y];b=y8(x,b,_)}const g=l.fn({...e,[h]:m,[f]:b});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[h]:s,[f]:a}}}}}};function Cm(){return typeof window<"u"}function pu(t){return AA(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=(AA(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function AA(t){return Cm()?t instanceof Node||t instanceof _r(t).Node:!1}function yi(t){return Cm()?t instanceof Element||t instanceof _r(t).Element:!1}function Ji(t){return Cm()?t instanceof HTMLElement||t instanceof _r(t).HTMLElement:!1}function S8(t){return!Cm()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof _r(t).ShadowRoot}const tZ=new Set(["inline","contents"]);function _f(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=xi(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!tZ.has(r)}const nZ=new Set(["table","td","th"]);function oZ(t){return nZ.has(pu(t))}const rZ=[":popover-open",":modal"];function Am(t){return rZ.some(e=>{try{return t.matches(e)}catch{return!1}})}const iZ=["transform","translate","scale","rotate","perspective"],sZ=["transform","translate","scale","rotate","perspective","filter"],aZ=["paint","layout","strict","content"];function Fy(t){const e=Vy(),n=yi(t)?xi(t):t;return iZ.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)||sZ.some(o=>(n.willChange||"").includes(o))||aZ.some(o=>(n.contain||"").includes(o))}function lZ(t){let e=$a(t);for(;Ji(e)&&!Kc(e);){if(Fy(e))return e;if(Am(e))return null;e=$a(e)}return null}function Vy(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const cZ=new Set(["html","body","#document"]);function Kc(t){return cZ.has(pu(t))}function xi(t){return _r(t).getComputedStyle(t)}function $m(t){return yi(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function $a(t){if(pu(t)==="html")return t;const e=t.assignedSlot||t.parentNode||S8(t)&&t.host||Us(t);return S8(e)?e.host:e}function $A(t){const e=$a(t);return Kc(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ji(e)&&_f(e)?e:$A(e)}function TA(t,e,n){var o;e===void 0&&(e=[]);const r=$A(t),i=r===((o=t.ownerDocument)==null?void 0:o.body),s=_r(r);return i?(P1(s),e.concat(s,s.visualViewport||[],_f(r)?r:[],[])):e.concat(r,TA(r,[]))}function P1(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function MA(t){const e=xi(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=Ji(t),i=r?t.offsetWidth:n,s=r?t.offsetHeight:o,a=U0(n)!==i||U0(o)!==s;return a&&(n=i,o=s),{width:n,height:o,$:a}}function OA(t){return yi(t)?t:t.contextElement}function Mc(t){const e=OA(t);if(!Ji(e))return Xi(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:i}=MA(e);let s=(i?U0(n.width):n.width)/o,a=(i?U0(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const uZ=Xi(0);function BA(t){const e=_r(t);return!Vy()||!e.visualViewport?uZ:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function dZ(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==_r(t)?!1:e}function jd(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=OA(t);let s=Xi(1);e&&(o?yi(o)&&(s=Mc(o)):s=Mc(t));const a=dZ(i,n,o)?BA(i):Xi(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&&yi(o)?_r(o):o;let m=f,b=P1(m);for(;b&&o&&h!==m;){const g=Mc(b),v=b.getBoundingClientRect(),y=xi(b),x=v.left+(b.clientLeft+parseFloat(y.paddingLeft))*g.x,_=v.top+(b.clientTop+parseFloat(y.paddingTop))*g.y;l*=g.x,c*=g.y,u*=g.x,d*=g.y,l+=x,c+=_,m=_r(b),b=P1(m)}}return q0({width:u,height:d,x:l,y:c})}function Tm(t,e){const n=$m(t).scrollLeft;return e?e.left+n:jd(Us(t)).left+n}function LA(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-Tm(t,n),r=n.top+e.scrollTop;return{x:o,y:r}}function fZ(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const i=r==="fixed",s=Us(o),a=e?Am(e.floating):!1;if(o===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Xi(1);const u=Xi(0),d=Ji(o);if((d||!d&&!i)&&((pu(o)!=="body"||_f(s))&&(l=$m(o)),Ji(o))){const h=jd(o);c=Mc(o),u.x=h.x+o.clientLeft,u.y=h.y+o.clientTop}const f=s&&!d&&!i?LA(s,l):Xi(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 hZ(t){return Array.from(t.getClientRects())}function pZ(t){const e=Us(t),n=$m(t),o=t.ownerDocument.body,r=Tc(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=Tc(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+Tm(t);const a=-n.scrollTop;return xi(o).direction==="rtl"&&(s+=Tc(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:a}}const k8=25;function mZ(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 u=Vy();(!u||u&&e==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}const c=Tm(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,m=Math.abs(o.clientWidth-d.clientWidth-h);m<=k8&&(i-=m)}else c<=k8&&(i+=c);return{width:i,height:s,x:a,y:l}}const gZ=new Set(["absolute","fixed"]);function vZ(t,e){const n=jd(t,!0,e==="fixed"),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=Ji(t)?Mc(t):Xi(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 C8(t,e,n){let o;if(e==="viewport")o=mZ(t,n);else if(e==="document")o=pZ(Us(t));else if(yi(e))o=vZ(e,n);else{const r=BA(t);o={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return q0(o)}function PA(t,e){const n=$a(t);return n===e||!yi(n)||Kc(n)?!1:xi(n).position==="fixed"||PA(n,e)}function bZ(t,e){const n=e.get(t);if(n)return n;let o=TA(t,[]).filter(a=>yi(a)&&pu(a)!=="body"),r=null;const i=xi(t).position==="fixed";let s=i?$a(t):t;for(;yi(s)&&!Kc(s);){const a=xi(s),l=Fy(s);!l&&a.position==="fixed"&&(r=null),(i?!l&&!r:!l&&a.position==="static"&&!!r&&gZ.has(r.position)||_f(s)&&!l&&PA(t,s))?o=o.filter(u=>u!==s):r=a,s=$a(s)}return e.set(t,o),o}function yZ(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const s=[...n==="clippingAncestors"?Am(e)?[]:bZ(e,this._c):[].concat(n),o],a=s[0],l=s.reduce((c,u)=>{const d=C8(e,u,r);return c.top=Tc(d.top,c.top),c.right=B1(d.right,c.right),c.bottom=B1(d.bottom,c.bottom),c.left=Tc(d.left,c.left),c},C8(e,a,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function xZ(t){const{width:e,height:n}=MA(t);return{width:e,height:n}}function wZ(t,e,n){const o=Ji(e),r=Us(e),i=n==="fixed",s=jd(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const l=Xi(0);function c(){l.x=Tm(r)}if(o||!o&&!i)if((pu(e)!=="body"||_f(r))&&(a=$m(e)),o){const h=jd(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?LA(r,a):Xi(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 Kg(t){return xi(t).position==="static"}function A8(t,e){if(!Ji(t)||xi(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Us(t)===n&&(n=n.ownerDocument.body),n}function DA(t,e){const n=_r(t);if(Am(t))return n;if(!Ji(t)){let r=$a(t);for(;r&&!Kc(r);){if(yi(r)&&!Kg(r))return r;r=$a(r)}return n}let o=A8(t,e);for(;o&&oZ(o)&&Kg(o);)o=A8(o,e);return o&&Kc(o)&&Kg(o)&&!Fy(o)?n:o||lZ(t)||n}const _Z=async function(t){const e=this.getOffsetParent||DA,n=this.getDimensions,o=await n(t.floating);return{reference:wZ(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function SZ(t){return xi(t).direction==="rtl"}const kZ={convertOffsetParentRelativeRectToViewportRelativeRect:fZ,getDocumentElement:Us,getClippingRect:yZ,getOffsetParent:DA,getElementRects:_Z,getClientRects:hZ,getDimensions:xZ,getScale:Mc,isElement:yi,isRTL:SZ},EA=JK,IA=eZ,RA=KK,NA=(t,e,n)=>{const o=new Map,r={platform:kZ,...n},i={...r.platform,_c:o};return XK(t,e,{...r,platform:i})},FA="bc-tooltip";function CZ(){if(document.getElementById("bc-tooltip-styles"))return;const t=document.createElement("style");t.id="bc-tooltip-styles",t.textContent=`
|
|
39
|
+
.${FA} {
|
|
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 AZ(t){const e=t?Aa(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 Va(t){const e=(t==null?void 0:t.format)??AZ(t==null?void 0:t.numberFormat);let n=null;const o=[];return{name:"tooltip",install(){CZ(),n=document.createElement("div"),n.className=FA,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=_e(a).datum();n.textContent=e(u),n.style.display="block",NA(a,n,{placement:"top",middleware:[EA(8),RA(),IA()]}).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 $Z(t){switch(t){case ri.Solid:return"none";case ri.Dotted:return"2,2";case ri.Dashed:default:return"4,3"}}function Xl(t){const e=(t==null?void 0:t.color)??"#999",n=(t==null?void 0:t.dashArray)??$Z(t==null?void 0:t.style),o=(t==null?void 0:t.direction)??ko.Both,r=(t==null?void 0:t.orientation)??Yn.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===ko.Both||o===ko.Vertical,d=o===ko.Both||o===ko.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 b=this,g=()=>{const y=_e(b);let x,_;if(b.tagName==="circle")x=parseFloat(y.attr("cx")),_=parseFloat(y.attr("cy"));else{const C=parseFloat(y.attr("x")),L=parseFloat(y.attr("width")),O=parseFloat(y.attr("y")),$=parseFloat(y.attr("height"));r===Yn.Horizontal?(x=C+L,_=O+$/2):(x=C+L/2,_=O)}f&&f.attr("x1",x).attr("x2",x).style("display",null),h&&h.attr("y1",_).attr("y2",_).style("display",null)},v=()=>{f&&f.style("display","none"),h&&h.style("display","none")};b.addEventListener("mouseenter",g),b.addEventListener("mouseleave",v),i.push(()=>{b.removeEventListener("mouseenter",g),b.removeEventListener("mouseleave",v)})})},destroy(){for(const s of i)s();i.length=0}}}function zy(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 lr(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=zy(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 Ta={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}},$8={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}};Ln.N+"",Ln.W,Ln.NE+"",Ln.NW,Ln.E+"",Ln.N,Ln.SE+"",Ln.NE,Ln.S+"",Ln.E,Ln.SW+"",Ln.SE,Ln.W+"",Ln.S,Ln.NW+"",Ln.SW,Ln.Center+"",Ln.Center;function TZ(t,e){const n=Ta[t]??Ta.NW;return{dx:n.dx*e,dy:n.dy*e}}function Hy(t){return"step"in t&&!("bandwidth"in t)}function VA(t){if("bandwidth"in t||Hy(t))return!1;const e=t.domain();return e.length>0&&e[0]instanceof Date}function zA(t,e){if("bandwidth"in t){const n=t;return(n(e)??0)+n.bandwidth()/2}return Hy(t)?t(e)??0:VA(t)?t(new Date(e)):t(Number(e))}function T8(t,e){const n=(e.left+e.right)/2,o=(e.top+e.bottom)/2,r=$8[t]??$8.N;return{x:n+r.nx*(e.right-e.left)/2,y:o+r.ny*(e.bottom-e.top)/2}}function MZ(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"?T8(o,{left:h,right:f,top:u,bottom:u+d}):T8(o,{left:u,right:u+d,top:f,bottom:h})}const i=zA(e,t.label),s=n(t.value),a=2,l=Ta[o]??Ta.N;return{x:i+l.dx*a,y:s+l.dy*a}}function OZ(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((m,b)=>m.dist-b.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 Wy(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}`)||(_e(t).select("defs").empty()?_e(t).append("defs"):_e(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 BZ(t){switch(t){case O0.Dotted:return"2,3";case O0.Dashed:return"5,4";default:return""}}function LZ(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=BZ(o.style??O0.Solid);i&&r.attr("stroke-dasharray",i)}const M8=1/Math.tan(40*Math.PI/180);function PZ(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)*M8,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)*M8,12);return{x:t.x+o*r,y:t.y}}function DZ(t,e,n){const o=PZ(t,e,n);return`M ${t.x} ${t.y} L ${o.x} ${o.y} L ${e.x} ${e.y}`}function EZ(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=DZ(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=Wy(c,s);a.attr("marker-end",`url(#${u})`)}}function Uy(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)IZ(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 IZ(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 rh(t,e,n=kC.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(Hy(e)){const o=e(String(t))??0,r=e.step()/2;return n==="start"?o-r:n==="end"?o+r:o}return VA(e)?e(new Date(String(t))):e(Number(t))}function ih(t,e){return e(Number(t))}function O8(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 Gy(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 RZ(t){return t<-4?"end":t>4?"start":"middle"}function B8(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:zA(e,t.label),y:n(t.value)}}function HA(t,e,n,o){const r="target"in e?e.target:void 0;if(!r)return;const i=n.data.find(v=>v.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??Ln.N,c=MZ(i,n.scaleX,n.scaleY,l,n.orientation);let u,d;const f=e;if(f.dx!=null||f.dy!=null){const{x:v,y}=B8(i,n.scaleX,n.scaleY);u=v+(Number(f.dx)||40),d=y+(Number(f.dy)||-40)}else if(f.direction!=null&&f.textOffsetX==null){const{x:v,y}=B8(i,n.scaleX,n.scaleY),x=f.direction,_=f.anchorDistance??60,C=TZ(x,_);u=v+C.dx,d=y+C.dy}else u=c.x+(a.textOffsetX??-42),d=c.y+(a.textOffsetY??-42);const h=e.circleColor??"#666",m=e;if(m.showCircle&&LZ(s,c.x,c.y,{size:m.circleSize,style:m.circleStyle,color:h}),e.text){const v=Math.max(4,Math.min(u,n.width-4)),y=RZ(u-c.x);Uy(s,e.text,v,d-4,{textColor:e.textColor,maxWidth:Gy(e.maxWidth,n.width),textAnchor:y,backgroundColor:n.backgroundColor,textOutline:e.textOutline})}if(f.dx!=null||f.dy!=null?a.showLine!==!1:a.showLine===!0){let v={x:u,y:d},y=!1;const x=s.select(".bc-annotation-text").node();if(x)try{const O=x.getBBox();if(O.width>0&&O.height>0){v=OZ(O,c.x,c.y);const $=O.x+O.width/2;y=Math.abs(v.x-$)<1}}catch{}const _=a.showCircle?(a.circleSize??4)+(a.lineTargetDistance??5):a.lineTargetDistance??0;let C=c.x,L=c.y;if(_>0){const O=c.x-v.x,$=c.y-v.y,M=Math.sqrt(O*O+$*$);if(M>0){const D=c.x-O/M*_,N=c.y-$/M*_,k=Ta[l]??Ta.N;C=Math.abs(k.dx)>.01?D:c.x,L=Math.abs(k.dy)>.01?N:c.y}}EZ(s,v,{x:C,y:L},a.lineStyle??So.Direct,{showArrow:a.showArrow,lineWeight:a.lineWeight,color:h,departVertical:y})}}function WA(t,e,n,o,r){if(e.kind!==Pt.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??Yn.Vertical;let a,l,c,u;if(n.orientation===Yn.Horizontal)if(s===Yn.Vertical){const d=rh(e.start,n.scaleX,e.startAnchor),f=rh(e.end,n.scaleX,e.endAnchor);l=Math.min(d,f),u=Math.abs(f-d),a=0,c=n.width}else{const d=ih(e.start,n.scaleY),f=ih(e.end,n.scaleY);a=Math.min(d,f),c=Math.abs(f-d),l=0,u=n.height}else if(s===Yn.Vertical){const d=rh(e.start,n.scaleX,e.startAnchor),f=rh(e.end,n.scaleX,e.endAnchor);a=Math.min(d,f),c=Math.abs(f-d),l=0,u=n.height}else{const d=ih(e.start,n.scaleY),f=ih(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===Yn.Vertical?c:u,f=Gy(e.maxWidth,n.width)??Math.max(d,50),h=e.direction??"center",m=4,b=Ta[h]??Ta.center,g=.5+b.dx*.5,v=.5+b.dy*.5,y=Math.max(m,Math.min(a+c*g,n.width-m));let x="middle";g<.25?x="start":g>.75&&(x="end");const C=l+m+12,L=r?r.append("g").attr("data-annotation-index",String(o)):i;if(Uy(L,e.text,y,C,{textColor:e.textColor,maxWidth:f,textAnchor:x,backgroundColor:n.backgroundColor,textOutline:e.textOutline}),v>.25){const O=L.select(".bc-annotation-text").node();if(O)try{const $=O.getBBox();let M=0;v>.75?M=l+u-m-($.y+$.height):M=l+u/2-($.y+$.height/2),Math.abs(M)>.5&&O.setAttribute("transform",`translate(0, ${M})`)}catch{}}}}function UA(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=O8(e.x,n.width),s=O8(e.y,n.height);if(e.text){Uy(r,e.text,i,s,{textColor:e.textColor,maxWidth:Gy(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 D1(t,e,n,o){const r=n+.45*(t-n);return`M ${t} ${e} L ${r} ${e} L ${n} ${o}`}function NZ(t,e){const n=t.hasAttribute("marker-end"),o=zy(t.parentElement);if(n&&o){const r=_e(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(th).attrTween("d",()=>{const c=yd(l,a);return u=>{const d=c(u);return D1(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,m=d/2,b=m<f?Math.sqrt(f*f-m*m):0,g=(a.x+l.x)/2,v=(a.y+l.y)/2,y=d>0?-u/d:0,x=d>0?c/d:0,_=h===1?1:-1,C=g+_*b*y,L=v+_*b*x,O=Math.atan2(a.y-L,a.x-C);let M=Math.atan2(l.y-L,l.x-C)-O;h===1&&M<=0&&(M+=2*Math.PI),h===0&&M>=0&&(M-=2*Math.PI),r.transition().duration(e).ease(th).attrTween("d",()=>D=>{if(D>=.98)return i;const N=O+D*M,k=C+f*Math.cos(N),A=L+f*Math.sin(N);return`M ${a.x} ${a.y} A ${f} ${f} 0 0 ${h} ${k} ${A}`})}else r.transition().duration(e).ease(th).attrTween("d",()=>{const a=to(o.fromX,o.toX),l=to(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"),_e(t).transition().duration(e).ease(th).attr("stroke-dashoffset","0").on("end",()=>{t.removeAttribute("stroke-dasharray"),t.removeAttribute("stroke-dashoffset")})}function FZ(t,e,n){const o=zy(t.parentElement);if(!o)return;const r=_e(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",D1(i.calloutX,i.calloutY,i.tipX,i.tipY)),r.transition().duration(n).ease(C1).attrTween("d",()=>{const a=yd(i,s);return l=>{const c=a(l);return D1(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(C1).attrTween("d",()=>{const d=yd(i,a),f=yd(s,l);return h=>{if(h>=.98)return c;const m=d(h),b=f(h);if(o.style===So.Direct||e.style===So.Direct)return`M ${m.x} ${m.y} L ${b.x} ${b.y}`;const g=b.x-m.x,v=b.y-m.y,x=Math.sqrt(g*g+v*v)*.8,_=o.style===So.CurveRight?1:0;return`M ${m.x} ${m.y} A ${x} ${x} 0 0 ${_} ${b.x} ${b.y}`}})}}function GA(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&&FZ(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 m of h){const b=m;b.style.transition="none",b.setAttribute("transform",`translate(${d}, ${f})`),b.getBoundingClientRect(),b.style.transition=`transform ${o}ms ease`,b.setAttribute("transform","translate(0, 0)")}}}catch{}}else{const c=s.querySelector(".bc-annotation-line");c&&NZ(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 qA(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)&&_e(t).attr("viewBox",`${c} ${u} ${d-c} ${f-u}`).attr("preserveAspectRatio","xMidYMid meet")}function Mm(t,e,n){const o=t.ownerSVGElement??t;_e(o).style("overflow","visible"),Wy(o);const r=_e(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 lr(l))i.set(u,d);if(c)for(const[u,d]of lr(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??Pt.Point){case Pt.Point:HA(a,c,n,l);break;case Pt.Range:WA(s,c,n,l,a);break;case Pt.Free:UA(a,c,n,l);break}}if(n.transition){const l=Yl(fu);GA(a.node(),s.node(),i??new Map,l)}qA(o)}function mu(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&&_e(r).style("overflow","visible"),Wy(r);const i=o.node(),s=i==null?void 0:i.parentNode,a=s&&s!==r?_e(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"),m=l.querySelector(".bc-annotations-range");if(h||m){if(c=new Map,h)for(const[b,g]of lr(h))c.set(b,g);if(m)for(const[b,g]of lr(m))c.set(b,g)}}}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 m=t[h];switch(m.kind??Pt.Point){case Pt.Point:HA(d,m,e,h);break;case Pt.Range:WA(u,m,e,h,d);break;case Pt.Free:UA(d,m,e,h);break}}if(e.transition){const h=Yl(fu);GA(d.node(),u.node(),c??new Map,h)}qA(r)}}}const{min:VZ,max:zZ}=Math,xl=(t,e=0,n=1)=>VZ(zZ(e,t),n),qy=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]=xl(t[e],0,255)):e===3&&(t[e]=xl(t[e],0,1));return t},YA={};for(let t of["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])YA[`[object ${t}]`]=t.toLowerCase();function Mt(t){return YA[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),gu=t=>{if(t.length<2)return null;const e=t.length-1;return Mt(t[e])=="string"?t[e].toLowerCase():null},{PI:Om,min:jA,max:XA}=Math,Rr=t=>Math.round(t*100)/100,E1=t=>Math.round(t*100)/100,vs=Om*2,Zg=Om/3,HZ=Om/180,WZ=180/Om;function KA(t){return[...t.slice(0,3).reverse(),...t.slice(3)]}const wt={format:{},autodetect:[]};class Ee{constructor(...e){const n=this;if(Mt(e[0])==="object"&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];let o=gu(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=qy(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 UZ="3.2.0",ct=(...t)=>new Ee(...t);ct.version=UZ;const Zc={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"},GZ=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,qZ=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,ZA=t=>{if(t.match(GZ)){(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(qZ)){(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:sh}=Math,QA=(...t)=>{let[e,n,o,r]=St(t,"rgba"),i=gu(t)||"auto";r===void 0&&(r=1),i==="auto"&&(i=r<1?"rgba":"rgb"),e=sh(e),n=sh(n),o=sh(o);let a="000000"+(e<<16|n<<8|o).toString(16);a=a.substr(a.length-6);let l="0"+sh(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}`}};Ee.prototype.name=function(){const t=QA(this._rgb,"rgb");for(let e of Object.keys(Zc))if(Zc[e]===t)return e.toLowerCase();return t};wt.format.named=t=>{if(t=t.toLowerCase(),Zc[t])return ZA(Zc[t]);throw new Error("unknown color name: "+t)};wt.autodetect.push({p:5,test:(t,...e)=>{if(!e.length&&Mt(t)==="string"&&Zc[t.toLowerCase()])return"named"}});Ee.prototype.alpha=function(t,e=!1){return t!==void 0&&Mt(t)==="number"?e?(this._rgb[3]=t,this):new Ee([this._rgb[0],this._rgb[1],this._rgb[2],t],"rgb"):this._rgb[3]};Ee.prototype.clipped=function(){return this._rgb._clipped||!1};const Ki={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}},YZ=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 ks(t){const e=YZ.get(String(t).toLowerCase());if(!e)throw new Error("unknown Lab illuminant "+t);Ki.labWhitePoint=t,Ki.Xn=e[0],Ki.Zn=e[1]}function Xd(){return Ki.labWhitePoint}const Yy=(...t)=>{t=St(t,"lab");const[e,n,o]=t,[r,i,s]=jZ(e,n,o),[a,l,c]=JA(r,i,s);return[a,l,c,t.length>3?t[3]:1]},jZ=(t,e,n)=>{const{kE:o,kK:r,kKE:i,Xn:s,Yn:a,Zn:l}=Ki,c=(t+16)/116,u=.002*e+c,d=c-.005*n,f=u*u*u,h=d*d*d,m=f>o?f:(116*u-16)/r,b=t>i?Math.pow((t+16)/116,3):t/r,g=h>o?h:(116*d-16)/r,v=m*s,y=b*a,x=g*l;return[v,y,x]},Qg=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},JA=(t,e,n)=>{const{MtxAdaptMa:o,MtxAdaptMaI:r,MtxXYZ2RGB:i,RefWhiteRGB:s,Xn:a,Yn:l,Zn:c}=Ki,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,m=s.X*o.m01+s.Y*o.m11+s.Z*o.m21,b=s.X*o.m02+s.Y*o.m12+s.Z*o.m22,g=(t*o.m00+e*o.m10+n*o.m20)*(h/u),v=(t*o.m01+e*o.m11+n*o.m21)*(m/d),y=(t*o.m02+e*o.m12+n*o.m22)*(b/f),x=g*r.m00+v*r.m10+y*r.m20,_=g*r.m01+v*r.m11+y*r.m21,C=g*r.m02+v*r.m12+y*r.m22,L=Qg(x*i.m00+_*i.m10+C*i.m20),O=Qg(x*i.m01+_*i.m11+C*i.m21),$=Qg(x*i.m02+_*i.m12+C*i.m22);return[L*255,O*255,$*255]},jy=(...t)=>{const[e,n,o,...r]=St(t,"rgb"),[i,s,a]=e5(e,n,o),[l,c,u]=XZ(i,s,a);return[l,c,u,...r.length>0&&r[0]<1?[r[0]]:[]]};function XZ(t,e,n){const{Xn:o,Yn:r,Zn:i,kE:s,kK:a}=Ki,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 Jg(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 e5=(t,e,n)=>{t=Jg(t/255),e=Jg(e/255),n=Jg(n/255);const{MtxRGB2XYZ:o,MtxAdaptMa:r,MtxAdaptMaI:i,Xn:s,Yn:a,Zn:l,As:c,Bs:u,Cs:d}=Ki;let f=t*o.m00+e*o.m10+n*o.m20,h=t*o.m01+e*o.m11+n*o.m21,m=t*o.m02+e*o.m12+n*o.m22;const b=s*r.m00+a*r.m10+l*r.m20,g=s*r.m01+a*r.m11+l*r.m21,v=s*r.m02+a*r.m12+l*r.m22;let y=f*r.m00+h*r.m10+m*r.m20,x=f*r.m01+h*r.m11+m*r.m21,_=f*r.m02+h*r.m12+m*r.m22;return y*=b/c,x*=g/u,_*=v/d,f=y*i.m00+x*i.m10+_*i.m20,h=y*i.m01+x*i.m11+_*i.m21,m=y*i.m02+x*i.m12+_*i.m22,[f,h,m]};Ee.prototype.lab=function(){return jy(this._rgb)};const KZ=(...t)=>new Ee(...t,"lab");Object.assign(ct,{lab:KZ,getLabWhitePoint:Xd,setLabWhitePoint:ks});wt.format.lab=Yy;wt.autodetect.push({p:2,test:(...t)=>{if(t=St(t,"lab"),Mt(t)==="array"&&t.length===3)return"lab"}});Ee.prototype.darken=function(t=1){const e=this,n=e.lab();return n[0]-=Ki.Kn*t,new Ee(n,"lab").alpha(e.alpha(),!0)};Ee.prototype.brighten=function(t=1){return this.darken(-t)};Ee.prototype.darker=Ee.prototype.darken;Ee.prototype.brighter=Ee.prototype.brighten;Ee.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:ZZ}=Math,QZ=1e-7,JZ=20;Ee.prototype.luminance=function(t,e="rgb"){if(t!==void 0&&Mt(t)==="number"){if(t===0)return new Ee([0,0,0,this._rgb[3]],"rgb");if(t===1)return new Ee([255,255,255,this._rgb[3]],"rgb");let n=this.luminance(),o=JZ;const r=(s,a)=>{const l=s.interpolate(a,.5,e),c=l.luminance();return Math.abs(t-c)<QZ||!o--?l:c>t?r(s,l):r(l,a)},i=(n>t?r(new Ee([0,0,0]),this):r(this,new Ee([255,255,255]))).rgb();return new Ee([...i,this._rgb[3]])}return eQ(...this._rgb.slice(0,3))};const eQ=(t,e,n)=>(t=ev(t),e=ev(e),n=ev(n),.2126*t+.7152*e+.0722*n),ev=t=>(t/=255,t<=.03928?t/12.92:ZZ((t+.055)/1.055,2.4)),$o={},Qc=(t,e,n=.5,...o)=>{let r=o[0]||"lrgb";if(!$o[r]&&!o.length&&(r=Object.keys($o)[0]),!$o[r])throw new Error(`interpolation mode ${r} is not defined`);return Mt(t)!=="object"&&(t=new Ee(t)),Mt(e)!=="object"&&(e=new Ee(e)),$o[r](t,e,n).alpha(t.alpha()+n*(e.alpha()-t.alpha()))};Ee.prototype.mix=Ee.prototype.interpolate=function(t,e=.5,...n){return Qc(this,t,e,...n)};Ee.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 Ee([e[0]*n,e[1]*n,e[2]*n,n],"rgb")};const{sin:tQ,cos:nQ}=Math,t5=(...t)=>{let[e,n,o]=St(t,"lch");return isNaN(o)&&(o=0),o=o*HZ,[e,nQ(o)*n,tQ(o)*n]},Xy=(...t)=>{t=St(t,"lch");const[e,n,o]=t,[r,i,s]=t5(e,n,o),[a,l,c]=Yy(r,i,s);return[a,l,c,t.length>3?t[3]:1]},oQ=(...t)=>{const e=KA(St(t,"hcl"));return Xy(...e)},{sqrt:rQ,atan2:iQ,round:sQ}=Math,n5=(...t)=>{const[e,n,o]=St(t,"lab"),r=rQ(n*n+o*o);let i=(iQ(o,n)*WZ+360)%360;return sQ(r*1e4)===0&&(i=Number.NaN),[e,r,i]},Ky=(...t)=>{const[e,n,o,...r]=St(t,"rgb"),[i,s,a]=jy(e,n,o),[l,c,u]=n5(i,s,a);return[l,c,u,...r.length>0&&r[0]<1?[r[0]]:[]]};Ee.prototype.lch=function(){return Ky(this._rgb)};Ee.prototype.hcl=function(){return KA(Ky(this._rgb))};const aQ=(...t)=>new Ee(...t,"lch"),lQ=(...t)=>new Ee(...t,"hcl");Object.assign(ct,{lch:aQ,hcl:lQ});wt.format.lch=Xy;wt.format.hcl=oQ;["lch","hcl"].forEach(t=>wt.autodetect.push({p:2,test:(...e)=>{if(e=St(e,t),Mt(e)==="array"&&e.length===3)return t}}));Ee.prototype.saturate=function(t=1){const e=this,n=e.lch();return n[1]+=Ki.Kn*t,n[1]<0&&(n[1]=0),new Ee(n,"lch").alpha(e.alpha(),!0)};Ee.prototype.desaturate=function(t=1){return this.saturate(-t)};Ee.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 Ee(i,o);return n?(this._rgb=a._rgb,this):a}throw new Error(`unknown channel ${r} in mode ${o}`)}else return i};Ee.prototype.tint=function(t=.5,...e){return Qc(this,"white",t,...e)};Ee.prototype.shade=function(t=.5,...e){return Qc(this,"black",t,...e)};const cQ=(t,e,n)=>{const o=t._rgb,r=e._rgb;return new Ee(o[0]+n*(r[0]-o[0]),o[1]+n*(r[1]-o[1]),o[2]+n*(r[2]-o[2]),"rgb")};$o.rgb=cQ;const{sqrt:tv,pow:ac}=Math,uQ=(t,e,n)=>{const[o,r,i]=t._rgb,[s,a,l]=e._rgb;return new Ee(tv(ac(o,2)*(1-n)+ac(s,2)*n),tv(ac(r,2)*(1-n)+ac(a,2)*n),tv(ac(i,2)*(1-n)+ac(l,2)*n),"rgb")};$o.lrgb=uQ;const dQ=(t,e,n)=>{const o=t.lab(),r=e.lab();return new Ee(o[0]+n*(r[0]-o[0]),o[1]+n*(r[1]-o[1]),o[2]+n*(r[2]-o[2]),"lab")};$o.lab=dQ;const vu=(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,m,b;return!isNaN(s)&&!isNaN(a)?(a>s&&a-s>180?b=a-(s+360):a<s&&s-a>180?b=a+360-s:b=a-s,h=s+n*b):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)),m=u+n*(d-u),o==="oklch"?new Ee([m,f,h],o):new Ee([h,f,m],o)},o5=(t,e,n)=>vu(t,e,n,"lch");$o.lch=o5;$o.hcl=o5;const fQ=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)},hQ=(...t)=>{const[e,n,o]=St(t,"rgb");return(e<<16)+(n<<8)+o};Ee.prototype.num=function(){return hQ(this._rgb)};const pQ=(...t)=>new Ee(...t,"num");Object.assign(ct,{num:pQ});wt.format.num=fQ;wt.autodetect.push({p:5,test:(...t)=>{if(t.length===1&&Mt(t[0])==="number"&&t[0]>=0&&t[0]<=16777215)return"num"}});const mQ=(t,e,n)=>{const o=t.num(),r=e.num();return new Ee(o+n*(r-o),"num")};$o.num=mQ;const{floor:gQ}=Math,vQ=(...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=gQ(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]},bQ=(...t)=>{const[e,n,o]=St(t,"rgb"),r=jA(e,n,o),i=XA(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]};Ee.prototype.hcg=function(){return bQ(this._rgb)};const yQ=(...t)=>new Ee(...t,"hcg");ct.hcg=yQ;wt.format.hcg=vQ;wt.autodetect.push({p:1,test:(...t)=>{if(t=St(t,"hcg"),Mt(t)==="array"&&t.length===3)return"hcg"}});const xQ=(t,e,n)=>vu(t,e,n,"hcg");$o.hcg=xQ;const{cos:lc}=Math,wQ=(...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*lc(vs*e)/lc(Zg-vs*e))/3,i=1-(s+r)):e<2/3?(e-=1/3,r=(1-n)/3,i=(1+n*lc(vs*e)/lc(Zg-vs*e))/3,s=1-(r+i)):(e-=2/3,i=(1-n)/3,s=(1+n*lc(vs*e)/lc(Zg-vs*e))/3,r=1-(i+s)),r=xl(o*r*3),i=xl(o*i*3),s=xl(o*s*3),[r*255,i*255,s*255,t.length>3?t[3]:1]},{min:_Q,sqrt:SQ,acos:kQ}=Math,CQ=(...t)=>{let[e,n,o]=St(t,"rgb");e/=255,n/=255,o/=255;let r;const i=_Q(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/=SQ((e-n)*(e-n)+(e-o)*(n-o)),r=kQ(r),o>n&&(r=vs-r),r/=vs),[r*360,a,s]};Ee.prototype.hsi=function(){return CQ(this._rgb)};const AQ=(...t)=>new Ee(...t,"hsi");ct.hsi=AQ;wt.format.hsi=wQ;wt.autodetect.push({p:2,test:(...t)=>{if(t=St(t,"hsi"),Mt(t)==="array"&&t.length===3)return"hsi"}});const $Q=(t,e,n)=>vu(t,e,n,"hsi");$o.hsi=$Q;const I1=(...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]},r5=(...t)=>{t=St(t,"rgba");let[e,n,o]=t;e/=255,n/=255,o/=255;const r=jA(e,n,o),i=XA(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]};Ee.prototype.hsl=function(){return r5(this._rgb)};const TQ=(...t)=>new Ee(...t,"hsl");ct.hsl=TQ;wt.format.hsl=I1;wt.autodetect.push({p:2,test:(...t)=>{if(t=St(t,"hsl"),Mt(t)==="array"&&t.length===3)return"hsl"}});const MQ=(t,e,n)=>vu(t,e,n,"hsl");$o.hsl=MQ;const{floor:OQ}=Math,BQ=(...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=OQ(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:LQ,max:PQ}=Math,DQ=(...t)=>{t=St(t,"rgb");let[e,n,o]=t;const r=LQ(e,n,o),i=PQ(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]};Ee.prototype.hsv=function(){return DQ(this._rgb)};const EQ=(...t)=>new Ee(...t,"hsv");ct.hsv=EQ;wt.format.hsv=BQ;wt.autodetect.push({p:2,test:(...t)=>{if(t=St(t,"hsv"),Mt(t)==="array"&&t.length===3)return"hsv"}});const IQ=(t,e,n)=>vu(t,e,n,"hsv");$o.hsv=IQ;function Y0(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 Zy=(...t)=>{t=St(t,"lab");const[e,n,o,...r]=t,[i,s,a]=RQ([e,n,o]),[l,c,u]=JA(i,s,a);return[l,c,u,...r.length>0&&r[0]<1?[r[0]]:[]]};function RQ(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=Y0(n,t);return Y0(e,o.map(r=>r**3))}const Qy=(...t)=>{const[e,n,o,...r]=St(t,"rgb"),i=e5(e,n,o);return[...NQ(i),...r.length>0&&r[0]<1?[r[0]]:[]]};function NQ(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=Y0(e,t);return Y0(n,o.map(r=>Math.cbrt(r)))}Ee.prototype.oklab=function(){return Qy(this._rgb)};const FQ=(...t)=>new Ee(...t,"oklab");Object.assign(ct,{oklab:FQ});wt.format.oklab=Zy;wt.autodetect.push({p:2,test:(...t)=>{if(t=St(t,"oklab"),Mt(t)==="array"&&t.length===3)return"oklab"}});const VQ=(t,e,n)=>{const o=t.oklab(),r=e.oklab();return new Ee(o[0]+n*(r[0]-o[0]),o[1]+n*(r[1]-o[1]),o[2]+n*(r[2]-o[2]),"oklab")};$o.oklab=VQ;const zQ=(t,e,n)=>vu(t,e,n,"oklch");$o.oklch=zQ;const{pow:nv,sqrt:ov,PI:rv,cos:L8,sin:P8,atan2:HQ}=Math,WQ=(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 Ee(d)),e==="lrgb")return UQ(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*rv;l+=L8(f)*n[0],c+=P8(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 m=0;m<s.length;m++)if(!isNaN(h[m]))if(a[m]+=n[f+1],e.charAt(m)==="h"){const b=h[m]/180*rv;l+=L8(b)*n[f+1],c+=P8(b)*n[f+1]}else s[m]+=h[m]*n[f+1]});for(let d=0;d<s.length;d++)if(e.charAt(d)==="h"){let f=HQ(c/a[d],l/a[d])/rv*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 Ee(s,e).alpha(u>.99999?1:u,!0)},UQ=(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]+=nv(a[0],2)*s,o[1]+=nv(a[1],2)*s,o[2]+=nv(a[2],2)*s,o[3]+=a[3]*s}return o[0]=ov(o[0]),o[1]=ov(o[1]),o[2]=ov(o[2]),o[3]>.9999999&&(o[3]=1),new Ee(qy(o))},{pow:GQ}=Math;function j0(t){let e="rgb",n=ct("#ccc"),o=0,r=[0,1],i=[0,1],s=[],a=[0,0],l=!1,c=[],u=!1,d=0,f=1,h=!1,m={},b=!0,g=1;const v=function($){if($=$||["#fff","#000"],$&&Mt($)==="string"&&ct.brewer&&ct.brewer[$.toLowerCase()]&&($=ct.brewer[$.toLowerCase()]),Mt($)==="array"){$.length===1&&($=[$[0],$[0]]),$=$.slice(0);for(let M=0;M<$.length;M++)$[M]=ct($[M]);s.length=0;for(let M=0;M<$.length;M++)s.push(M/($.length-1))}return L(),c=$},y=function($){if(l!=null){const M=l.length-1;let D=0;for(;D<M&&$>=l[D];)D++;return D-1}return 0};let x=$=>$,_=$=>$;const C=function($,M){let D,N;if(M==null&&(M=!1),isNaN($)||$===null)return n;M?N=$:l&&l.length>2?N=y($)/(l.length-2):f!==d?N=($-d)/(f-d):N=1,N=_(N),M||(N=x(N)),g!==1&&(N=GQ(N,g)),N=a[0]+N*(1-a[0]-a[1]),N=xl(N,0,1);const k=Math.floor(N*1e4);if(b&&m[k])D=m[k];else{if(Mt(c)==="array")for(let A=0;A<s.length;A++){const B=s[A];if(N<=B){D=c[A];break}if(N>=B&&A===s.length-1){D=c[A];break}if(N>B&&N<s[A+1]){N=(N-B)/(s[A+1]-B),D=ct.interpolate(c[A],c[A+1],N,e);break}}else Mt(c)==="function"&&(D=c(N));b&&(m[k]=D)}return D};var L=()=>m={};v(t);const O=function($){const M=ct(C($));return u&&M[u]?M[u]():M};return O.classes=function($){if($!=null){if(Mt($)==="array")l=$,r=[$[0],$[$.length-1]];else{const M=ct.analyze(r);$===0?l=[M.min,M.max]:l=ct.limits(M,"e",$)}return O}return l},O.domain=function($){if(!arguments.length)return i;i=$.slice(0),d=$[0],f=$[$.length-1],s=[];const M=c.length;if($.length===M&&d!==f)for(let D of Array.from($))s.push((D-d)/(f-d));else{for(let D=0;D<M;D++)s.push(D/(M-1));if($.length>2){const D=$.map((k,A)=>A/($.length-1)),N=$.map(k=>(k-d)/(f-d));N.every((k,A)=>D[A]===k)||(_=k=>{if(k<=0||k>=1)return k;let A=0;for(;k>=N[A+1];)A++;const B=(k-N[A])/(N[A+1]-N[A]);return D[A]+B*(D[A+1]-D[A])})}}return r=[d,f],O},O.mode=function($){return arguments.length?(e=$,L(),O):e},O.range=function($,M){return v($),O},O.out=function($){return u=$,O},O.spread=function($){return arguments.length?(o=$,O):o},O.correctLightness=function($){return $==null&&($=!0),h=$,L(),h?x=function(M){const D=C(0,!0).lab()[0],N=C(1,!0).lab()[0],k=D>N;let A=C(M,!0).lab()[0];const B=D+(N-D)*M;let P=A-B,F=0,z=1,V=20;for(;Math.abs(P)>.01&&V-- >0;)(function(){return k&&(P*=-1),P<0?(F=M,M+=(z-M)*.5):(z=M,M+=(F-M)*.5),A=C(M,!0).lab()[0],P=A-B})();return M}:x=M=>M,O},O.padding=function($){return $!=null?(Mt($)==="number"&&($=[$,$]),a=$,O):a},O.colors=function($,M){arguments.length<2&&(M="hex");let D=[];if(arguments.length===0)D=c.slice(0);else if($===1)D=[O(.5)];else if($>1){const N=r[0],k=r[1]-N;D=qQ(0,$).map(A=>O(N+A/($-1)*k))}else{t=[];let N=[];if(l&&l.length>2)for(let k=1,A=l.length,B=1<=A;B?k<A:k>A;B?k++:k--)N.push((l[k-1]+l[k])*.5);else N=r;D=N.map(k=>O(k))}return ct[M]&&(D=D.map(N=>N[M]())),D},O.cache=function($){return $!=null?(b=$,O):b},O.gamma=function($){return $!=null?(g=$,O):g},O.nodata=function($){return $!=null?(n=ct($),O):n},O}function qQ(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 YQ=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},jQ=function(t){let e,n,o,r;if(t=t.map(i=>new Ee(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 Ee(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 Ee(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 Ee(a,"lab")}}else if(t.length>=5){let i,s,a;i=t.map(l=>l.lab()),a=t.length-1,s=YQ(a),e=function(l){const c=1-l,u=[0,1,2].map(d=>i.reduce((f,h,m)=>f+s[m]*c**(a-m)*l**m*h[d],0));return new Ee(u,"lab")}}else throw new RangeError("No point in running bezier with only one color.");return e},XQ=t=>{const e=jQ(t);return e.scale=()=>j0(e),e},{round:i5}=Math;Ee.prototype.rgb=function(t=!0){return t===!1?this._rgb.slice(0,3):this._rgb.slice(0,3).map(i5)};Ee.prototype.rgba=function(t=!0){return this._rgb.slice(0,4).map((e,n)=>n<3?t===!1?e:i5(e):e)};const KQ=(...t)=>new Ee(...t,"rgb");Object.assign(ct,{rgb:KQ});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 wi=(t,e,n)=>{if(!wi[n])throw new Error("unknown blend mode "+n);return wi[n](t,e)},za=t=>(e,n)=>{const o=ct(n).rgb(),r=ct(e).rgb();return ct.rgb(t(o,r))},Ha=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},ZQ=t=>t,QQ=(t,e)=>t*e/255,JQ=(t,e)=>t>e?e:t,eJ=(t,e)=>t>e?t:e,tJ=(t,e)=>255*(1-(1-t/255)*(1-e/255)),nJ=(t,e)=>e<128?2*t*e/255:255*(1-2*(1-t/255)*(1-e/255)),oJ=(t,e)=>255*(1-(1-e/255)/(t/255)),rJ=(t,e)=>t===255?255:(t=255*(e/255)/(1-t/255),t>255?255:t);wi.normal=za(Ha(ZQ));wi.multiply=za(Ha(QQ));wi.screen=za(Ha(tJ));wi.overlay=za(Ha(nJ));wi.darken=za(Ha(JQ));wi.lighten=za(Ha(eJ));wi.dodge=za(Ha(rJ));wi.burn=za(Ha(oJ));const{pow:iJ,sin:sJ,cos:aJ}=Math;function lJ(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=vs*((t+120)/360+e*l),u=iJ(r[0]+s*l,o),f=(i!==0?n[0]+l*i:n)*u*(1-u)/2,h=aJ(c),m=sJ(c),b=u+f*(-.14861*h+1.78277*m),g=u+f*(-.29227*h-.90649*m),v=u+f*(1.97294*h);return ct(qy([b*255,g*255,v*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=()=>ct.scale(a),a.hue(n),a}const cJ="0123456789abcdef",{floor:uJ,random:dJ}=Math,fJ=(t=dJ)=>{let e="#";for(let n=0;n<6;n++)e+=cJ.charAt(uJ(t()*16));return new Ee(e,"hex")},{log:D8,pow:hJ,floor:pJ,abs:mJ}=Math;function s5(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)=>a5(n,o,r),n}function a5(t,e="equal",n=7){Mt(t)=="array"&&(t=s5(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*D8(o),l=Math.LOG10E*D8(r);s.push(o);for(let c=1;c<n;c++)s.push(hJ(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=pJ(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 g=1;g<n;g++)h.push(o+g/n*(r-o));for(h.push(r);d;){for(let v=0;v<n;v++)u[v]=0;for(let v=0;v<l;v++){const y=i[v];let x=Number.MAX_VALUE,_;for(let C=0;C<n;C++){const L=mJ(h[C]-y);L<x&&(x=L,_=C),u[_]++,c[v]=_}}const g=new Array(n);for(let v=0;v<n;v++)g[v]=null;for(let v=0;v<l;v++)a=c[v],g[a]===null?g[a]=i[v]:g[a]+=i[v];for(let v=0;v<n;v++)g[v]*=1/u[v];d=!1;for(let v=0;v<n;v++)if(g[v]!==h[v]){d=!0;break}h=g,f++,f>200&&(d=!1)}const m={};for(let g=0;g<n;g++)m[g]=[];for(let g=0;g<l;g++)a=c[g],m[a].push(i[g]);let b=[];for(let g=0;g<n;g++)b.push(m[g][0]),b.push(m[g][m[g].length-1]);b=b.sort((g,v)=>g-v),s.push(b[0]);for(let g=1;g<b.length;g+=2){const v=b[g];!isNaN(v)&&s.indexOf(v)===-1&&s.push(v)}}return s}const gJ=(t,e)=>{t=new Ee(t),e=new Ee(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 E8=.027,vJ=5e-4,bJ=.1,I8=1.14,ah=.022,R8=1.414,yJ=(t,e)=>{t=new Ee(t),e=new Ee(e),t.alpha()<1&&(t=Qc(e,t,t.alpha(),"rgb"));const n=N8(...t.rgb()),o=N8(...e.rgb()),r=n>=ah?n:n+Math.pow(ah-n,R8),i=o>=ah?o:o+Math.pow(ah-o,R8),s=Math.pow(i,.56)-Math.pow(r,.57),a=Math.pow(i,.65)-Math.pow(r,.62),l=Math.abs(i-r)<vJ?0:r<i?s*I8:a*I8;return(Math.abs(l)<bJ?0:l>0?l-E8:l+E8)*100};function N8(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:us,pow:On,min:xJ,max:wJ,atan2:F8,abs:V8,cos:lh,sin:z8,exp:_J,PI:H8}=Math;function SJ(t,e,n=1,o=1,r=1){var i=function(Z){return 360*Z/(2*H8)},s=function(Z){return 2*H8*Z/360};t=new Ee(t),e=new Ee(e);const[a,l,c]=Array.from(t.lab()),[u,d,f]=Array.from(e.lab()),h=(a+u)/2,m=us(On(l,2)+On(c,2)),b=us(On(d,2)+On(f,2)),g=(m+b)/2,v=.5*(1-us(On(g,7)/(On(g,7)+On(25,7)))),y=l*(1+v),x=d*(1+v),_=us(On(y,2)+On(c,2)),C=us(On(x,2)+On(f,2)),L=(_+C)/2,O=i(F8(c,y)),$=i(F8(f,x)),M=O>=0?O:O+360,D=$>=0?$:$+360,N=V8(M-D)>180?(M+D+360)/2:(M+D)/2,k=1-.17*lh(s(N-30))+.24*lh(s(2*N))+.32*lh(s(3*N+6))-.2*lh(s(4*N-63));let A=D-M;A=V8(A)<=180?A:D<=M?A+360:A-360,A=2*us(_*C)*z8(s(A)/2);const B=u-a,P=C-_,F=1+.015*On(h-50,2)/us(20+On(h-50,2)),z=1+.045*L,V=1+.015*L*k,G=30*_J(-On((N-275)/25,2)),ce=-(2*us(On(L,7)/(On(L,7)+On(25,7))))*z8(2*s(G)),he=us(On(B/(n*F),2)+On(P/(o*z),2)+On(A/(r*V),2)+ce*(P/(o*z))*(A/(r*V)));return wJ(0,xJ(100,he))}function kJ(t,e,n="lab"){t=new Ee(t),e=new Ee(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 CJ=(...t)=>{try{return new Ee(...t),!0}catch{return!1}},AJ={cool(){return j0([ct.hsl(180,1,.9),ct.hsl(250,.7,.4)])},hot(){return j0(["#000","#f00","#ff0","#fff"]).mode("rgb")}},R1={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"]},l5=Object.keys(R1),W8=new Map(l5.map(t=>[t.toLowerCase(),t])),$J=typeof Proxy=="function"?new Proxy(R1,{get(t,e){const n=e.toLowerCase();if(W8.has(n))return t[W8.get(n)]},getOwnPropertyNames(){return Object.getOwnPropertyNames(l5)}}):R1,TJ=(...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:U8}=Math,MJ=(...t)=>{let[e,n,o]=St(t,"rgb");e=e/255,n=n/255,o=o/255;const r=1-U8(e,U8(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]};Ee.prototype.cmyk=function(){return MJ(this._rgb)};const OJ=(...t)=>new Ee(...t,"cmyk");Object.assign(ct,{cmyk:OJ});wt.format.cmyk=TJ;wt.autodetect.push({p:2,test:(...t)=>{if(t=St(t,"cmyk"),Mt(t)==="array"&&t.length===4)return"cmyk"}});const BJ=(...t)=>{const e=St(t,"hsla");let n=gu(t)||"lsa";return e[0]=Rr(e[0]||0)+"deg",e[1]=Rr(e[1]*100)+"%",e[2]=Rr(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(" ")})`},LJ=(...t)=>{const e=St(t,"lab");let n=gu(t)||"lab";return e[0]=Rr(e[0])+"%",e[1]=Rr(e[1]),e[2]=Rr(e[2]),n==="laba"||e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`lab(${e.join(" ")})`},PJ=(...t)=>{const e=St(t,"lch");let n=gu(t)||"lab";return e[0]=Rr(e[0])+"%",e[1]=Rr(e[1]),e[2]=isNaN(e[2])?"none":Rr(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(" ")})`},DJ=(...t)=>{const e=St(t,"lab");return e[0]=Rr(e[0]*100)+"%",e[1]=E1(e[1]),e[2]=E1(e[2]),e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`oklab(${e.join(" ")})`},c5=(...t)=>{const[e,n,o,...r]=St(t,"rgb"),[i,s,a]=Qy(e,n,o),[l,c,u]=n5(i,s,a);return[l,c,u,...r.length>0&&r[0]<1?[r[0]]:[]]},EJ=(...t)=>{const e=St(t,"lch");return e[0]=Rr(e[0]*100)+"%",e[1]=E1(e[1]),e[2]=isNaN(e[2])?"none":Rr(e[2])+"deg",e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`oklch(${e.join(" ")})`},{round:iv}=Math,IJ=(...t)=>{const e=St(t,"rgba");let n=gu(t)||"rgb";if(n.substr(0,3)==="hsl")return BJ(r5(e),n);if(n.substr(0,3)==="lab"){const o=Xd();ks("d50");const r=LJ(jy(e),n);return ks(o),r}if(n.substr(0,3)==="lch"){const o=Xd();ks("d50");const r=PJ(Ky(e),n);return ks(o),r}return n.substr(0,5)==="oklab"?DJ(Qy(e)):n.substr(0,5)==="oklch"?EJ(c5(e)):(e[0]=iv(e[0]),e[1]=iv(e[1]),e[2]=iv(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(" ")})`)},u5=(...t)=>{t=St(t,"lch");const[e,n,o,...r]=t,[i,s,a]=t5(e,n,o),[l,c,u]=Zy(i,s,a);return[l,c,u,...r.length>0&&r[0]<1?[r[0]]:[]]},Ms=/((?:-?\d+)|(?:-?\d+(?:\.\d+)?)%|none)/.source,ui=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%?)|none)/.source,X0=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%)|none)/.source,Hr=/\s*/.source,bu=/\s+/.source,Jy=/\s*,\s*/.source,Bm=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?)|none)/.source,yu=/\s*(?:\/\s*((?:[01]|[01]?\.\d+)|\d+(?:\.\d+)?%))?/.source,d5=new RegExp("^rgba?\\("+Hr+[Ms,Ms,Ms].join(bu)+yu+"\\)$"),f5=new RegExp("^rgb\\("+Hr+[Ms,Ms,Ms].join(Jy)+Hr+"\\)$"),h5=new RegExp("^rgba\\("+Hr+[Ms,Ms,Ms,ui].join(Jy)+Hr+"\\)$"),p5=new RegExp("^hsla?\\("+Hr+[Bm,X0,X0].join(bu)+yu+"\\)$"),m5=new RegExp("^hsl?\\("+Hr+[Bm,X0,X0].join(Jy)+Hr+"\\)$"),g5=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,v5=new RegExp("^lab\\("+Hr+[ui,ui,ui].join(bu)+yu+"\\)$"),b5=new RegExp("^lch\\("+Hr+[ui,ui,Bm].join(bu)+yu+"\\)$"),y5=new RegExp("^oklab\\("+Hr+[ui,ui,ui].join(bu)+yu+"\\)$"),x5=new RegExp("^oklch\\("+Hr+[ui,ui,Bm].join(bu)+yu+"\\)$"),{round:w5}=Math,cc=t=>t.map((e,n)=>n<=2?xl(w5(e),0,255):e),Bn=(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),Eo=(t,e)=>t==="none"?e:t,e2=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(d5))||(e=t.match(f5))){let n=e.slice(1,4);for(let r=0;r<3;r++)n[r]=+Bn(Eo(n[r],0),0,255);n=cc(n);const o=e[4]!==void 0?+Bn(e[4],0,1):1;return n[3]=o,n}if(e=t.match(h5)){const n=e.slice(1,5);for(let o=0;o<4;o++)n[o]=+Bn(n[o],0,255);return n}if((e=t.match(p5))||(e=t.match(m5))){const n=e.slice(1,4);n[0]=+Eo(n[0].replace("deg",""),0),n[1]=+Bn(Eo(n[1],0),0,100)*.01,n[2]=+Bn(Eo(n[2],0),0,100)*.01;const o=cc(I1(n)),r=e[4]!==void 0?+Bn(e[4],0,1):1;return o[3]=r,o}if(e=t.match(g5)){const n=e.slice(1,4);n[1]*=.01,n[2]*=.01;const o=I1(n);for(let r=0;r<3;r++)o[r]=w5(o[r]);return o[3]=+e[4],o}if(e=t.match(v5)){const n=e.slice(1,4);n[0]=Bn(Eo(n[0],0),0,100),n[1]=Bn(Eo(n[1],0),-125,125,!0),n[2]=Bn(Eo(n[2],0),-125,125,!0);const o=Xd();ks("d50");const r=cc(Yy(n));ks(o);const i=e[4]!==void 0?+Bn(e[4],0,1):1;return r[3]=i,r}if(e=t.match(b5)){const n=e.slice(1,4);n[0]=Bn(n[0],0,100),n[1]=Bn(Eo(n[1],0),0,150,!1),n[2]=+Eo(n[2].replace("deg",""),0);const o=Xd();ks("d50");const r=cc(Xy(n));ks(o);const i=e[4]!==void 0?+Bn(e[4],0,1):1;return r[3]=i,r}if(e=t.match(y5)){const n=e.slice(1,4);n[0]=Bn(Eo(n[0],0),0,1),n[1]=Bn(Eo(n[1],0),-.4,.4,!0),n[2]=Bn(Eo(n[2],0),-.4,.4,!0);const o=cc(Zy(n)),r=e[4]!==void 0?+Bn(e[4],0,1):1;return o[3]=r,o}if(e=t.match(x5)){const n=e.slice(1,4);n[0]=Bn(Eo(n[0],0),0,1),n[1]=Bn(Eo(n[1],0),0,.4,!1),n[2]=+Eo(n[2].replace("deg",""),0);const o=cc(u5(n)),r=e[4]!==void 0?+Bn(e[4],0,1):1;return o[3]=r,o}};e2.test=t=>d5.test(t)||p5.test(t)||v5.test(t)||b5.test(t)||y5.test(t)||x5.test(t)||f5.test(t)||h5.test(t)||m5.test(t)||g5.test(t)||t==="transparent";Ee.prototype.css=function(t){return IJ(this._rgb,t)};const RJ=(...t)=>new Ee(...t,"css");ct.css=RJ;wt.format.css=e2;wt.autodetect.push({p:5,test:(t,...e)=>{if(!e.length&&Mt(t)==="string"&&e2.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 NJ=(...t)=>new Ee(...t,"gl");ct.gl=NJ;Ee.prototype.gl=function(){const t=this._rgb;return[t[0]/255,t[1]/255,t[2]/255,t[3]]};Ee.prototype.hex=function(t){return QA(this._rgb,t)};const FJ=(...t)=>new Ee(...t,"hex");ct.hex=FJ;wt.format.hex=ZA;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:ch}=Math,_5=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*ch(o),r=e<20?0:-254.76935184120902+.8274096064007395*(r=e-10)+115.67994401066147*ch(r)):(n=351.97690566805693+.114206453784165*(n=e-55)-40.25366309332127*ch(n),o=325.4494125711974+.07943456536662342*(o=e-50)-28.0852963507957*ch(o),r=255),[n,o,r,1]},{round:VJ}=Math,zJ=(...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=_5(a);l[2]/l[0]>=o/n?i=a:r=a}return VJ(a)};Ee.prototype.temp=Ee.prototype.kelvin=Ee.prototype.temperature=function(){return zJ(this._rgb)};const sv=(...t)=>new Ee(...t,"temp");Object.assign(ct,{temp:sv,kelvin:sv,temperature:sv});wt.format.temp=wt.format.kelvin=wt.format.temperature=_5;Ee.prototype.oklch=function(){return c5(this._rgb)};const HJ=(...t)=>new Ee(...t,"oklch");Object.assign(ct,{oklch:HJ});wt.format.oklch=u5;wt.autodetect.push({p:2,test:(...t)=>{if(t=St(t,"oklch"),Mt(t)==="array"&&t.length===3)return"oklch"}});Object.assign(ct,{analyze:s5,average:WQ,bezier:XQ,blend:wi,brewer:$J,Color:Ee,colors:Zc,contrast:gJ,contrastAPCA:yJ,cubehelix:lJ,deltaE:SJ,distance:kJ,input:wt,interpolate:Qc,limits:a5,mix:Qc,random:fJ,scale:j0,scales:AJ,valid:CJ});function Mo(t){return ct.contrast(t,"#fff")>=ct.contrast(t,"#333")?"#fff":"#333"}function WJ(t,e){return ct.contrast(t,e)}function UJ(t){return t>=7?"AAA":t>=4.5?"AA":"Fail"}const Kd=4.5;function cr(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 S5(t,e="#fff"){let n=ct(t);if(ct.contrast(n,e)>=Kd)return n.hex();const o=ct(e).luminance()>.5;for(let r=0;r<20&&(n=o?n.darken(.3):n.brighten(.3),!(ct.contrast(n,e)>=Kd));r++);return n.hex()}const t2=12,K0=.25,k5=20;function C5(t,e){if(t.length===0)return[];const n=ct(e).luminance()>.5,o=t.map(r=>GJ(ct(r),e,n));for(let r=1;r<o.length;r++)ct.deltaE(o[r],o[r-1])>=t2||(o[r]=qJ(o[r],o[r-1],e,n));return o.map(r=>r.hex())}function GJ(t,e,n){for(let o=0;o<k5;o++){if(ct.contrast(t,e)>=Kd)return t;t=n?t.darken(K0):t.brighten(K0)}return t}function qJ(t,e,n,o){const r=G8(t,e,n,o);if(ct.deltaE(r,e)>=t2)return r;const i=G8(t,e,n,!o);return ct.deltaE(i,e)>ct.deltaE(r,e)&&ct.contrast(i,n)>=Kd?i:r}function G8(t,e,n,o){let r=t,i=ct.deltaE(t,e),s=t;for(let a=0;a<k5;a++){s=o?s.darken(K0):s.brighten(K0);const l=ct.deltaE(s,e);if(l>i&&ct.contrast(s,n)>=Kd&&(r=s,i=l),i>=t2)break}return r}const A5=new WeakMap;function Yr(t){return A5.get(t)}function jr(t,e){A5.set(t,e)}const il=["#4e79a7"],q8=13;class YJ extends so{initialize(){this.configDefine("x",{defaultValue:Sn()}),this.configDefine("y",{defaultValue:gn()}),this.configDefine("width",{defaultValue:0}),this.configDefine("height",{defaultValue:0}),this.configDefine("colors",{defaultValue:il}),this.configDefine("colorOverrides",{defaultValue:new Map}),this.configDefine("highlightTargets",{defaultValue:new Set}),this.configDefine("swapLabelValue",{defaultValue:!1});const e=this.base.append("g");this.layer("bars",e,{dataBind:(n,o)=>n.selectAll(".bc-bar").data(o,r=>r.label),insert:n=>n.append("rect").attr("class","bc-bar"),events:{enter:n=>{const o=this.config("colors"),r=this.config("colorOverrides"),i=this.config("highlightTargets"),s=i.size>0,a=this.config("x"),l=this.config("y");n.attr("x",c=>a(c.label)??0).attr("y",c=>Math.min(l(0),l(c.value))).attr("width",a.bandwidth()).attr("height",c=>Math.abs(l(c.value)-l(0))).attr("fill",c=>r.get(c.label)??o[0]).attr("opacity",c=>s?i.has(c.label)?1:.2:null)},"merge:transition":n=>{const o=this.config("colors"),r=this.config("colorOverrides"),i=this.config("highlightTargets"),s=i.size>0,a=this.config("x"),l=this.config("y");n.duration(ut()).attr("x",c=>a(c.label)??0).attr("y",c=>Math.min(l(0),l(c.value))).attr("width",a.bandwidth()).attr("height",c=>Math.abs(l(c.value)-l(0))).attr("fill",c=>r.get(c.label)??o[0]).attr("opacity",c=>s?i.has(c.label)?1:.2:null)},"exit:transition":n=>{n.duration(ut()).attr("opacity",0).remove()}}})}}function $5(t,e,n={},o=!1){var ve,me,I,W,j,ue,de,fe,pe,J,X,ee,we;qr(o);let r=[],i=[],s=null,a,l;const c=Tr.for(t);if(o){const ge=Yr(t);l=ge==null?void 0:ge.margin,c.detach(),(ge==null?void 0:ge.chartType)==="bar-vertical"?(r=Array.from(t.querySelectorAll(".bc-frame .bc-bar")),i=Array.from(t.querySelectorAll(".bc-frame .bc-value-label"))):ge&&(s=Ar(t)),a=new Map;for(const be of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[ye,Oe]of lr(be))a.set(ye,Oe);t.replaceChildren()}const{body:u}=Ur(t,n.frame),d=ar(u).width,f=n.categoryLabelLine===!0,h=ql(e.values,(ve=n.verticalAxis)==null?void 0:ve.range,(me=n.verticalAxis)==null?void 0:me.numberFormat,(I=n.verticalAxis)==null?void 0:I.scaleType),m=f?rn.Off:(W=n.horizontalAxis)==null?void 0:W.labelPosition,b=Ci(d,(j=n.verticalAxis)==null?void 0:j.labelPosition,m,(ue=n.verticalAxis)==null?void 0:ue.direction,h);if(!f){const ge=Math.max(0,d-(b.left??50)-(b.right??20)),be=Ny(e.labels,ge,n.horizontalAxis);be!==void 0&&(b.bottom=be)}const{chartArea:g,width:v,height:y,margin:x}=Gr(u,b),C=y-(f?q8:0),L=ki(l,x),O=XJ(e,n),$=O.map(ge=>({label:ge,value:e.values[e.labels.indexOf(ge)]})),M=n.swapLabelValue===!0,D=n.waterfall===!0,N=[];if(D){let ge=0;for(const be of $){const ye=ge;ge+=be.value,N.push({label:be.label,value:be.value,y0:ye,y1:ge,isTotal:!1})}n.waterfallTotal&&N.push({label:"Total",value:ge,y0:0,y1:ge,isTotal:!0})}const k=D?N.map(ge=>ge.label):O,A=Sn().domain(k).range([0,v]).padding(jl(n.barGap)),B=((de=n.verticalAxis)==null?void 0:de.scaleType)==="log",P=D?N.flatMap(ge=>[ge.y0,ge.y1]):$.map(ge=>ge.value);let[F,z]=hu(P,(fe=n.verticalAxis)==null?void 0:fe.range);if(n.valueLabels&&F<0&&((J=(pe=n.verticalAxis)==null?void 0:pe.range)==null?void 0:J.min)==null){const ge=z-F;F-=ge*.1}const V=B?Na().domain([F,z]).nice().range([C,0]):gn().domain([F,z]).nice().range([C,0]);c.attach(g,L);const G=M&&n.valueLabels&&!D?(()=>{const ge=new Map($.map(be=>[be.label,be.value]));return{...n.horizontalAxis,width:v,tickFormat:be=>String(ge.get(be)??be)}})():{...n.horizontalAxis,width:v},ie=f?{...G,labelPosition:rn.Off}:G;c.update({vertical:{scale:V,height:y,options:{...n.verticalAxis,gridWidth:v,topPadding:x.top}},horizontal:{scale:A,height:y,options:ie}}),!B&&F<0&&z>0&&_e(g).append("line").attr("class","bc-zero-baseline").attr("x1",0).attr("x2",v).attr("y1",V(0)).attr("y2",V(0)).attr("stroke","#666").attr("stroke-width",1);const ce=new Map((n.colorizes??[]).map(ge=>[ge.target,ge.color])),he=new Set((n.highlights??[]).map(ge=>ge.target)),Z=Math.random().toString(36).slice(2,8),oe=`bc-clip-${Z}`,se=g.ownerSVGElement,re=_e(se).select("defs").empty()?_e(se).append("defs"):_e(se).select("defs");re.append("clipPath").attr("id",oe).append("rect").attr("width",v).attr("height",C);const U=_e(g).append("g").attr("clip-path",`url(#${oe})`);if(n.barBackground){const ge=(n.colors??il)[0],be=D?k:$.map(ye=>ye.label);U.selectAll(".bc-bar-bg").data(be,ye=>ye).enter().append("rect").attr("class","bc-bar-bg").attr("x",ye=>A(ye)??0).attr("y",0).attr("width",A.bandwidth()).attr("height",C).attr("fill",ge).attr("opacity",.18)}const te=D?k:$.map(ge=>ge.label);if(n.barSeparators&&te.length>1){const ge=A.step();for(let be=1;be<te.length;be++){const ye=(A(te[be-1])??0)+A.bandwidth()+(ge-A.bandwidth())/2;U.append("line").attr("class","bc-bar-separator").attr("x1",ye).attr("x2",ye).attr("y1",0).attr("y2",C).attr("stroke","currentColor").attr("opacity",.15)}}if(!D&&n.connectedColumns&&$.length>1){const ge=n.colors??il,be=n.connectionsOpacity??.15;for(let ye=0;ye<$.length-1;ye++){const Oe=$[ye],ke=$[ye+1];if(Oe.value==null||ke.value==null||Number.isNaN(Oe.value)||Number.isNaN(ke.value)||Oe.value===0||ke.value===0)continue;const Ae=(A(Oe.label)??0)+A.bandwidth(),je=A(ke.label)??0,tt=Math.min(V(0),V(Oe.value)),mt=Math.min(V(0),V(ke.value)),$t=V(0),Vt=ce.get(Oe.label)??ge[0],cn=ce.get(ke.label)??ge[0];let Tt;if(Vt===cn)Tt=Vt;else{const Rt=`bc-conn-grad-${Z}-${ye}`,en=re.append("linearGradient").attr("id",Rt).attr("x1","0%").attr("x2","100%").attr("y1","0%").attr("y2","0%");en.append("stop").attr("offset","0%").attr("stop-color",Vt),en.append("stop").attr("offset","100%").attr("stop-color",cn),Tt=`url(#${Rt})`}U.append("polygon").attr("class","bc-bar-connection").attr("points",`${Ae},${tt} ${je},${mt} ${je},${$t} ${Ae},${$t}`).attr("fill",Tt).attr("opacity",be).attr("pointer-events","none")}}const ne=_e(g).append("g");if(D){const ge=n.colors??il,be="#333";if(n.connectedColumns&&N.length>1){const ye=n.colors??il,Oe=n.connectionsOpacity??.15;for(let ke=0;ke<N.length-1;ke++){const Ae=N[ke],je=N[ke+1];if(je.isTotal||Ae.value==null||je.value==null||Number.isNaN(Ae.value)||Number.isNaN(je.value)||Ae.value===0||je.value===0)continue;const tt=(A(Ae.label)??0)+A.bandwidth(),mt=A(je.label)??0,$t=V(Ae.y1),Vt=V(je.y1),cn=V(Ae.y0),Tt=V(je.y0),Rt=ce.get(Ae.label)??ye[0],en=ce.get(je.label)??ye[0];let kn;if(Rt===en)kn=Rt;else{const ao=`bc-conn-grad-${Z}-${ke}`,ze=re.append("linearGradient").attr("id",ao).attr("x1","0%").attr("x2","100%").attr("y1","0%").attr("y2","0%");ze.append("stop").attr("offset","0%").attr("stop-color",Rt),ze.append("stop").attr("offset","100%").attr("stop-color",en),kn=`url(#${ao})`}U.append("polygon").attr("class","bc-bar-connection").attr("points",`${tt},${$t} ${mt},${Vt} ${mt},${Tt} ${tt},${cn}`).attr("fill",kn).attr("opacity",Oe).attr("pointer-events","none")}}for(let ye=0;ye<N.length-1;ye++){const Oe=N[ye],ke=N[ye+1];if(ke.isTotal)break;U.append("line").attr("class","bc-waterfall-connector").attr("x1",(A(Oe.label)??0)+A.bandwidth()).attr("x2",A(ke.label)??0).attr("y1",V(Oe.y1)).attr("y2",V(Oe.y1)).attr("stroke","currentColor").attr("stroke-dasharray","2,2").attr("opacity",.3)}if(U.selectAll(".bc-bar").data(N,ye=>ye.label).enter().append("rect").attr("class","bc-bar").attr("x",ye=>A(ye.label)??0).attr("y",ye=>Math.min(V(ye.y0),V(ye.y1))).attr("width",A.bandwidth()).attr("height",ye=>Math.abs(V(ye.y0)-V(ye.y1))).attr("fill",ye=>ye.isTotal?be:ce.get(ye.label)??ge[0]).attr("opacity",ye=>he.size>0?he.has(ye.label)?1:.2:null),n.valueLabels){const ye=n.valueLabelPosition??yt.Auto,Oe=Aa(((X=n.verticalAxis)==null?void 0:X.numberFormat)??""),ke=Ae=>Oe?Oe(Ae):String(Ae);ne.selectAll(".bc-value-label").data(N,Ae=>Ae.label).enter().append("text").attr("class","bc-value-label").attr("font-size","11px").attr("x",Ae=>(A(Ae.label)??0)+A.bandwidth()/2).attr("y",Ae=>{const je=Math.min(V(Ae.y0),V(Ae.y1)),tt=Math.abs(V(Ae.y0)-V(Ae.y1));return ye===yt.Inside?je+tt/2:je-4}).attr("text-anchor","middle").attr("dominant-baseline",ye===yt.Inside?"central":"auto").attr("fill",Ae=>ye===yt.Inside?Mo(Ae.isTotal?be:ce.get(Ae.label)??ge[0]):"currentColor").text(Ae=>M?Ae.label:ke(Ae.isTotal?Ae.y1:Ae.value))}}else{const ge=new YJ(U);if(ge.config({x:A,y:V,width:v,height:y,colors:n.colors??il,colorOverrides:ce,highlightTargets:he,swapLabelValue:M}),r.length>0){const be=U.node().querySelector("g");jn(be,r,(L==null?void 0:L.dx)??0,(L==null?void 0:L.dy)??0)}n.tooltips&&ge.use(Va({numberFormat:(ee=n.verticalAxis)==null?void 0:ee.numberFormat})),n.crosshair&&ge.use(Xl({width:v,height:C,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor})),(we=n.annotations)!=null&&we.length&&ge.use(mu(n.annotations,{scaleX:A,scaleY:V,data:$,width:v,height:C,backgroundColor:cr(t),transition:o,priorAnnotations:a})),ge.draw($),n.valueLabels&&jJ(ne,$,A,V,{position:n.valueLabelPosition,colorOverrides:ce,colors:n.colors??il,transition:o,priorLabels:i,swapLabelValue:M})}if(f){const ge=_e(g).append("g").attr("class","bc-category-labels");for(const be of k)ge.append("text").attr("class","bc-category-label").attr("x",(A(be)??0)+A.bandwidth()/2).attr("y",C+q8/2).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size","10px").attr("font-weight","600").attr("fill","currentColor").text(be)}jr(t,{chartType:"bar-vertical",margin:x}),s&&(Cr(U.node()),$r(t,s))}function av(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 jJ(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");if(a.empty()&&(a=t.append("g").attr("class","bc-value-label-group")),r.priorLabels.length>0){const d=a.node();r.priorLabels.forEach(f=>d.appendChild(f))}const l=a.selectAll(".bc-value-label").data(e,d=>d.label);l.exit().transition().duration(ut()).attr("opacity",0).remove();const u=l.enter().append("text").attr("class","bc-value-label").attr("font-size","11px").each(function(d){const f=av(d,n,o,i);_e(this).attr("x",f.tx).attr("y",f.ty).attr("text-anchor",f.anchor).attr("dominant-baseline",f.baseline).attr("fill",f.isInside?Mo(r.colorOverrides.get(d.label)??r.colors[0]):"currentColor").text(s(d))}).merge(l);r.transition?u.each(function(d){const f=av(d,n,o,i);_e(this).text(s(d)).transition().duration(ut()).attr("x",f.tx).attr("y",f.ty).attr("text-anchor",f.anchor).attr("dominant-baseline",f.baseline).attr("fill",f.isInside?Mo(r.colorOverrides.get(d.label)??r.colors[0]):"currentColor")}):u.each(function(d){const f=av(d,n,o,i);_e(this).attr("x",f.tx).attr("y",f.ty).attr("text-anchor",f.anchor).attr("dominant-baseline",f.baseline).attr("fill",f.isInside?Mo(r.colorOverrides.get(d.label)??r.colors[0]):"currentColor").text(s(d))})}function XJ(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 sl=["#4e79a7"],Y8=13,KJ="11px sans-serif",lv=4;class ZJ extends so{initialize(){this.configDefine("x",{defaultValue:gn()}),this.configDefine("y",{defaultValue:Sn()}),this.configDefine("width",{defaultValue:0}),this.configDefine("height",{defaultValue:0}),this.configDefine("colors",{defaultValue:sl}),this.configDefine("colorOverrides",{defaultValue:new Map}),this.configDefine("highlightTargets",{defaultValue:new Set}),this.configDefine("swapLabelValue",{defaultValue:!1}),this.configDefine("categoryLabelOffset",{defaultValue:0});const e=this.base.append("g");this.layer("bars",e,{dataBind:(n,o)=>n.selectAll(".bc-bar").data(o,r=>r.label),insert:n=>n.append("rect").attr("class","bc-bar"),events:{enter:n=>{const o=this.config("colors"),r=this.config("colorOverrides"),i=this.config("highlightTargets"),s=i.size>0,a=this.config("x"),l=this.config("y"),c=this.config("categoryLabelOffset");n.attr("x",u=>Math.min(a(0),a(u.value))).attr("y",u=>(l(u.label)??0)+c).attr("width",u=>Math.abs(a(u.value)-a(0))).attr("height",l.bandwidth()-c).attr("fill",u=>r.get(u.label)??o[0]).attr("opacity",u=>s?i.has(u.label)?1:.2:null)},"merge:transition":n=>{const o=this.config("colors"),r=this.config("colorOverrides"),i=this.config("highlightTargets"),s=i.size>0,a=this.config("x"),l=this.config("y"),c=this.config("categoryLabelOffset");n.duration(ut()).attr("x",u=>Math.min(a(0),a(u.value))).attr("y",u=>(l(u.label)??0)+c).attr("width",u=>Math.abs(a(u.value)-a(0))).attr("height",l.bandwidth()-c).attr("fill",u=>r.get(u.label)??o[0]).attr("opacity",u=>s?i.has(u.label)?1:.2:null)},"exit:transition":n=>{n.duration(ut()).attr("opacity",0).remove()}}})}}function cv(t){try{const n=document.createElement("canvas").getContext("2d");if(n)return n.font=KJ,Math.ceil(n.measureText(t).width)}catch{}return t.length*6.5}function T5(t,e,n={},o=!1){var ve,me,I,W,j,ue,de,fe,pe,J;qr(o);let r=[],i=[],s=null,a,l;const c=Tr.for(t);if(o){const X=Yr(t);l=X==null?void 0:X.margin,c.detach(),(X==null?void 0:X.chartType)==="bar-horizontal"?(r=Array.from(t.querySelectorAll(".bc-frame .bc-bar")),i=Array.from(t.querySelectorAll(".bc-frame .bc-value-label"))):X&&(s=Ar(t)),a=new Map;for(const ee of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[we,ge]of lr(ee))a.set(we,ge);t.replaceChildren()}const{body:u}=Ur(t,n.frame),d=ar(u).width,f=d>0&&d<400&&((ve=n.verticalAxis)==null?void 0:ve.labelPosition)!=="outside",h=n.categoryLabelLine===!0||f,m=xm(e.labels),b=h?rn.Off:(me=n.verticalAxis)==null?void 0:me.labelPosition,g=Ci(d,b,(I=n.horizontalAxis)==null?void 0:I.labelPosition,(W=n.verticalAxis)==null?void 0:W.direction,m,(j=n.horizontalAxis)==null?void 0:j.showAxis),v=n.valueLabelPosition??yt.Auto,y=n.swapLabelValue===!0;if(n.valueLabels&&v!==yt.Inside)if(y){const X=e.labels.reduce((we,ge)=>we.length>ge.length?we:ge,""),ee=cv(X)+lv;g.right=Math.max(g.right??15,ee)}else{const X=Math.max(...e.values),ee=Math.min(...e.values),we=X>0?cv(String(X))+lv:0,ge=ee<0?cv(String(ee))+lv:0;g.right=Math.max(g.right??15,we),ge>0&&(g.left=(g.left??50)+ge)}const{chartArea:x,width:_,height:C,margin:L}=Gr(u,g),O=h?Y8:0,$=ki(l,L),M=JJ(e,n),D=M.map(X=>({label:X,value:e.values[e.labels.indexOf(X)]})),N=n.waterfall===!0,k=[];if(N){let X=0;for(const ee of D){const we=X;X+=ee.value,k.push({label:ee.label,value:ee.value,x0:we,x1:X,isTotal:!1})}n.waterfallTotal&&k.push({label:"Total",value:X,x0:0,x1:X,isTotal:!0})}const A=((ue=n.horizontalAxis)==null?void 0:ue.scaleType)==="log",B=N?k.flatMap(X=>[X.x0,X.x1]):D.map(X=>X.value),[P,F]=hu(B,(de=n.horizontalAxis)==null?void 0:de.range),z=A?Na().domain([P,F]).nice().range([0,_]):gn().domain([P,F]).nice().range([0,_]),V=N?k.map(X=>X.label):M,G=Sn().domain(V).range([0,C]).padding(jl(n.barGap)),ie=y&&n.valueLabels&&!N?(()=>{const X=new Map(D.map(ee=>[ee.label,ee.value]));return{...n.verticalAxis,topPadding:L.top,tickFormat:ee=>String(X.get(ee)??ee)}})():{...n.verticalAxis,topPadding:L.top},ce=h?{...ie,labelPosition:rn.Off,...f?{showAxis:!1}:{}}:ie;c.attach(x,$),c.update({horizontal:{scale:z,height:C,options:{...n.horizontalAxis,width:_}},vertical:{scale:G,height:C,options:ce},order:"horizontal-first"}),!A&&P<0&&F>0&&_e(x).append("line").attr("class","bc-zero-baseline").attr("x1",z(0)).attr("x2",z(0)).attr("y1",0).attr("y2",C).attr("stroke","#666").attr("stroke-width",1);const he=new Map((n.colorizes??[]).map(X=>[X.target,X.color])),Z=new Set((n.highlights??[]).map(X=>X.target)),oe=Math.random().toString(36).slice(2,8),se=`bc-clip-${oe}`,re=x.ownerSVGElement,U=_e(re).select("defs").empty()?_e(re).append("defs"):_e(re).select("defs");U.append("clipPath").attr("id",se).append("rect").attr("width",_).attr("height",C);const te=_e(x).append("g").attr("clip-path",`url(#${se})`);if(n.barBackground){const X=(n.colors??sl)[0],ee=N?V:D.map(we=>we.label);te.selectAll(".bc-bar-bg").data(ee,we=>we).enter().append("rect").attr("class","bc-bar-bg").attr("x",0).attr("y",we=>(G(we)??0)+O).attr("width",_).attr("height",G.bandwidth()-O).attr("fill",X).attr("opacity",.18)}const ne=N?V:D.map(X=>X.label);if(n.barSeparators&&ne.length>1){const X=G.step();for(let ee=1;ee<ne.length;ee++){const we=(G(ne[ee-1])??0)+G.bandwidth()+(X-G.bandwidth())/2;te.append("line").attr("class","bc-bar-separator").attr("x1",0).attr("x2",_).attr("y1",we).attr("y2",we).attr("stroke","currentColor").attr("opacity",.15)}}if(!N&&n.connectedColumns&&D.length>1){const X=n.colors??sl,ee=n.connectionsOpacity??.15;for(let we=0;we<D.length-1;we++){const ge=D[we],be=D[we+1];if(ge.value==null||be.value==null||Number.isNaN(ge.value)||Number.isNaN(be.value)||ge.value===0||be.value===0)continue;const ye=(G(ge.label)??0)+G.bandwidth(),Oe=(G(be.label)??0)+O,ke=Math.max(z(0),z(ge.value)),Ae=Math.max(z(0),z(be.value)),je=z(0),tt=he.get(ge.label)??X[0],mt=he.get(be.label)??X[0];let $t;if(tt===mt)$t=tt;else{const Vt=`bc-conn-grad-${oe}-${we}`,cn=U.append("linearGradient").attr("id",Vt).attr("x1","0%").attr("x2","0%").attr("y1","0%").attr("y2","100%");cn.append("stop").attr("offset","0%").attr("stop-color",tt),cn.append("stop").attr("offset","100%").attr("stop-color",mt),$t=`url(#${Vt})`}te.append("polygon").attr("class","bc-bar-connection").attr("points",`${ke},${ye} ${Ae},${Oe} ${je},${Oe} ${je},${ye}`).attr("fill",$t).attr("opacity",ee).attr("pointer-events","none")}}if(N){const X=n.colors??sl,ee="#333";if(n.connectedColumns&&k.length>1){const we=n.colors??sl,ge=n.connectionsOpacity??.15;for(let be=0;be<k.length-1;be++){const ye=k[be],Oe=k[be+1];if(Oe.isTotal||ye.value==null||Oe.value==null||Number.isNaN(ye.value)||Number.isNaN(Oe.value)||ye.value===0||Oe.value===0)continue;const ke=(G(ye.label)??0)+G.bandwidth(),Ae=(G(Oe.label)??0)+O,je=z(ye.x1),tt=z(Oe.x1),mt=z(ye.x0),$t=z(Oe.x0),Vt=he.get(ye.label)??we[0],cn=he.get(Oe.label)??we[0];let Tt;if(Vt===cn)Tt=Vt;else{const Rt=`bc-conn-grad-${oe}-${be}`,en=U.append("linearGradient").attr("id",Rt).attr("x1","0%").attr("x2","0%").attr("y1","0%").attr("y2","100%");en.append("stop").attr("offset","0%").attr("stop-color",Vt),en.append("stop").attr("offset","100%").attr("stop-color",cn),Tt=`url(#${Rt})`}te.append("polygon").attr("class","bc-bar-connection").attr("points",`${je},${ke} ${tt},${Ae} ${$t},${Ae} ${mt},${ke}`).attr("fill",Tt).attr("opacity",ge).attr("pointer-events","none")}}for(let we=0;we<k.length-1;we++){const ge=k[we],be=k[we+1];if(be.isTotal)break;te.append("line").attr("class","bc-waterfall-connector").attr("x1",z(ge.x1)).attr("x2",z(ge.x1)).attr("y1",(G(ge.label)??0)+G.bandwidth()).attr("y2",(G(be.label)??0)+O).attr("stroke","currentColor").attr("stroke-dasharray","2,2").attr("opacity",.3)}if(te.selectAll(".bc-bar").data(k,we=>we.label).enter().append("rect").attr("class","bc-bar").attr("x",we=>Math.min(z(we.x0),z(we.x1))).attr("y",we=>(G(we.label)??0)+O).attr("width",we=>Math.abs(z(we.x1)-z(we.x0))).attr("height",G.bandwidth()-O).attr("fill",we=>we.isTotal?ee:he.get(we.label)??X[0]).attr("opacity",we=>Z.size>0?Z.has(we.label)?1:.2:null),n.valueLabels){const we=v,ge=Aa(((fe=n.horizontalAxis)==null?void 0:fe.numberFormat)??""),be=Oe=>ge?ge(Oe):String(Oe);_e(x).append("g").selectAll(".bc-value-label").data(k,Oe=>Oe.label).enter().append("text").attr("class","bc-value-label").attr("font-size","11px").attr("dominant-baseline","central").attr("y",Oe=>(G(Oe.label)??0)+O+(G.bandwidth()-O)/2).attr("x",Oe=>{const ke=Math.max(z(Oe.x0),z(Oe.x1));return we===yt.Inside?ke-4:ke+4}).attr("text-anchor",we===yt.Inside?"end":"start").attr("fill",Oe=>we===yt.Inside?Mo(Oe.isTotal?ee:he.get(Oe.label)??X[0]):"currentColor").text(Oe=>y?Oe.label:be(Oe.isTotal?Oe.x1:Oe.value))}}else{const X=new ZJ(te);if(X.config({x:z,y:G,width:_,height:C,colors:n.colors??sl,colorOverrides:he,highlightTargets:Z,swapLabelValue:y,categoryLabelOffset:O}),r.length>0){const ee=te.node().querySelector("g");jn(ee,r,($==null?void 0:$.dx)??0,($==null?void 0:$.dy)??0)}if(n.tooltips&&X.use(Va({numberFormat:(pe=n.horizontalAxis)==null?void 0:pe.numberFormat})),n.crosshair&&X.use(Xl({width:_,height:C,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor,orientation:Yn.Horizontal})),(J=n.annotations)!=null&&J.length&&X.use(mu(n.annotations,{scaleX:G,scaleY:z,data:D,width:_,height:C,backgroundColor:cr(t),orientation:Yn.Horizontal,transition:o,priorAnnotations:a})),X.draw(D),n.valueLabels){const ee=_e(x).append("g");QJ(ee,D,z,G,{position:v,colorOverrides:he,colors:n.colors??sl,transition:o,priorLabels:i,swapLabelValue:y,categoryLabelOffset:O})}}if(h){const X=_e(x).append("g").attr("class","bc-category-labels");for(const ee of V){const we=G(ee)??0;X.append("text").attr("class","bc-category-label").attr("x",2).attr("y",we+Y8/2).attr("text-anchor","start").attr("dominant-baseline","central").attr("font-size","10px").attr("font-weight","600").attr("fill","currentColor").text(ee)}}jr(t,{chartType:"bar-horizontal",margin:L}),s&&(Cr(te.node()),$r(t,s))}function uv(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 QJ(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");if(l.empty()&&(l=t.append("g").attr("class","bc-value-label-group")),r.priorLabels.length>0){const f=l.node();r.priorLabels.forEach(h=>f.appendChild(h))}const c=l.selectAll(".bc-value-label").data(e,f=>f.label);c.exit().transition().duration(ut()).attr("opacity",0).remove();const d=c.enter().append("text").attr("class","bc-value-label").attr("font-size","11px").attr("dominant-baseline","central").each(function(f){const h=uv(f,n,o,i,s);_e(this).attr("x",h.tx).attr("y",h.ty).attr("text-anchor",h.anchor).attr("fill",h.isInside?Mo(r.colorOverrides.get(f.label)??r.colors[0]):"currentColor").text(a(f))}).merge(c);r.transition?d.each(function(f){const h=uv(f,n,o,i,s);_e(this).text(a(f)).transition().duration(ut()).attr("x",h.tx).attr("y",h.ty).attr("text-anchor",h.anchor).attr("fill",h.isInside?Mo(r.colorOverrides.get(f.label)??r.colors[0]):"currentColor")}):d.each(function(f){const h=uv(f,n,o,i,s);_e(this).attr("x",h.tx).attr("y",h.ty).attr("text-anchor",h.anchor).attr("fill",h.isInside?Mo(r.colorOverrides.get(f.label)??r.colors[0]):"currentColor").text(a(f))})}function JJ(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 Wa(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 M5(t){return t.length===0?0:Math.max(...t.map(n=>n.length))*7+10}function Gs(t,e){return e==null?void 0:e.find(n=>n.name===t)}function ln(t,e,n,o){const r=Gs(t,o);return(r==null?void 0:r.color)??n[e%n.length]}function eee(t,e){const n=Gs(t,e);return(n==null?void 0:n.dash)??"solid"}function tee(t,e){const n=Gs(t,e);return(n==null?void 0:n.lineWidth)??2}function n2(t,e,n){const o=Gs(t,n);return!(o!=null&&o.interpolation)||o.interpolation==="global"?e:o.interpolation}function Ua(t,e){const n=Gs(t,e);return(n==null?void 0:n.hidden)??!1}function va(t,e,n){const o=Gs(t,n);return!(o!=null&&o.labelMode)||o.labelMode==="global"?e:o.labelMode}function xu(t,e,n){const o=Gs(t,n);return(o==null?void 0:o.valueLabels)!==void 0?o.valueLabels:e}function Sf(t,e){const n=Gs(t,e);return(n==null?void 0:n.opacity)??1}function nee(t,e,n){const o=Gs(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 O5=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"];class oee extends so{initialize(){this.configDefine("x0",{defaultValue:Sn()}),this.configDefine("x1",{defaultValue:Sn()}),this.configDefine("y",{defaultValue:gn()}),this.configDefine("height",{defaultValue:0}),this.configDefine("colors",{defaultValue:O5});const e=this.base.append("g");this.layer("bars",e,{dataBind:(n,o)=>n.selectAll(".bc-bar-multi").data(o,r=>r.label+"\0"+r.seriesName),insert:n=>n.append("rect").attr("class","bc-bar bc-bar-multi"),events:{enter:n=>{const o=this.config("x0"),r=this.config("x1"),i=this.config("y"),s=this.config("colors");n.attr("data-series",a=>a.seriesIndex).attr("x",a=>(o(a.label)??0)+(r(a.series)??0)).attr("y",a=>Math.min(i(0),i(a.value))).attr("width",r.bandwidth()).attr("height",a=>Math.abs(i(a.value)-i(0))).attr("fill",a=>s[a.seriesIndex%s.length])},"merge:transition":n=>{const o=this.config("x0"),r=this.config("x1"),i=this.config("y"),s=this.config("colors");n.duration(ut()).attr("data-series",a=>a.seriesIndex).attr("x",a=>(o(a.label)??0)+(r(a.series)??0)).attr("y",a=>Math.min(i(0),i(a.value))).attr("width",r.bandwidth()).attr("height",a=>Math.abs(i(a.value)-i(0))).attr("fill",a=>s[a.seriesIndex%s.length])},"exit:transition":n=>{n.duration(ut()).attr("opacity",0).remove()}}})}}function ree(t,e,n={},o=!1){var Ae,je,tt,mt,$t,Vt,cn,Tt,Rt,en,kn,ao;qr(o);let r=[],i=null,s,a;const l=Tr.for(t);if(o){const ze=Yr(t);a=ze==null?void 0:ze.margin,l.detach(),(ze==null?void 0:ze.chartType)==="bar-multi"?r=Array.from(t.querySelectorAll(".bc-frame .bc-bar-multi")):ze&&(i=Ar(t)),s=new Map;for(const Pe of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[Fe,Je]of lr(Pe))s.set(Fe,Je);t.replaceChildren()}const{body:c}=Ur(t,n.frame),u=e.series??[],d=u.filter(ze=>!Ua(ze.name,n.seriesOverrides)),f=d.map(ze=>ze.name),h=n.colors??O5,m=n.seriesOverrides,b=n.directLabelling===!0||n.directLabelling==="auto"&&n.legend!==!0||!!n.directLabelling&&n.directLabelling!=="auto",g=b?"direct":n.legend!==!1?"legend":"none",v=n.legend!==!1&&!b,y=ar(c).width,x=350,_=n.legendPosition??"top",C=y>0&&y<x&&(_==="left"||_==="right")?"top":_,L=n.legendAnchor??"start",O=d.flatMap(ze=>ze.values),$=ql(O,(Ae=n.verticalAxis)==null?void 0:Ae.range,(je=n.verticalAxis)==null?void 0:je.numberFormat,(tt=n.verticalAxis)==null?void 0:tt.scaleType),M=Ci(y,(mt=n.verticalAxis)==null?void 0:mt.labelPosition,($t=n.horizontalAxis)==null?void 0:$t.labelPosition,(Vt=n.verticalAxis)==null?void 0:Vt.direction,$),D=Math.max(0,y-(M.left??50)-(M.right??20)),N=Ny(e.labels,D,n.horizontalAxis);N!==void 0&&(M.bottom=N);const k=M.top!=null,A=Math.max(0,y-(M.left??50)-(M.right??20)),B=v?Wa(f,C,A):{width:0,height:0},P=v?B.height+10:0,F={...M};if(v&&C==="top"){const ze=k?15:0;F.top=P+ze}v&&C==="bottom"&&(F.bottom=(F.bottom??24)+P),v&&C==="left"&&(F.left=(F.left??50)+B.width+10),v&&C==="right"&&(F.right=(F.right??20)+B.width+10);const{chartArea:z,width:V,height:G,margin:ie}=Gr(c,F),ce=ki(a,ie);let[he,Z]=hu(O,(cn=n.verticalAxis)==null?void 0:cn.range);if(n.valueLabels&&he<0&&((Rt=(Tt=n.verticalAxis)==null?void 0:Tt.range)==null?void 0:Rt.min)==null){const ze=Z-he;he-=ze*.1}let oe=e.labels;if(n.sortMode==="total"){const ze=e.labels.map((Pe,Fe)=>({label:Pe,index:Fe,total:d.reduce((Je,Qe)=>Je+(Qe.values[Fe]??0),0)}));ze.sort((Pe,Fe)=>Fe.total-Pe.total),oe=ze.map(Pe=>Pe.label)}const se=Sn().domain(oe).range([0,V]).padding(jl(n.barGap)),re=Sn().domain(f).range([0,se.bandwidth()]).padding(.05),U=((en=n.verticalAxis)==null?void 0:en.scaleType)==="log",te=U?Na().domain([he,Z]).nice().range([G,0]):gn().domain([he,Z]).nice().range([G,0]);l.attach(z,ce),l.update({vertical:{scale:te,height:G,options:{...n.verticalAxis,gridWidth:V,topPadding:ie.top}},horizontal:{scale:se,height:G,options:{...n.horizontalAxis,width:V}}}),!U&&he<0&&Z>0&&_e(z).append("line").attr("class","bc-zero-baseline").attr("x1",0).attr("x2",V).attr("y1",te(0)).attr("y2",te(0)).attr("stroke","#666").attr("stroke-width",1);const ne=new Map;n.sortMode==="within-groups"&&e.labels.forEach((ze,Pe)=>{const Fe=d.map(Je=>({name:Je.name,value:Je.values[Pe]}));Fe.sort((Je,Qe)=>Qe.value-Je.value),Fe.forEach((Je,Qe)=>{ne.set(`${ze}\0${Je.name}`,f[Qe])})});const ve=[];e.labels.forEach((ze,Pe)=>{d.forEach(Fe=>{const Je=u.findIndex(Bt=>Bt.name===Fe.name),Qe=n.sortMode==="within-groups"?ne.get(`${ze}\0${Fe.name}`)??Fe.name:Fe.name;ve.push({label:ze,series:Qe,seriesName:Fe.name,value:Fe.values[Pe],seriesIndex:Je})})});const me=n.valueLabels??!1,I=`bc-clip-${Math.random().toString(36).slice(2,8)}`,W=z.ownerSVGElement;(_e(W).select("defs").empty()?_e(W).append("defs"):_e(W).select("defs")).append("clipPath").attr("id",I).append("rect").attr("width",V).attr("height",G);const ue=_e(z).append("g").attr("clip-path",`url(#${I})`),de=new oee(ue);if(de.config({x0:se,x1:re,y:te,height:G,colors:h}),r.length>0){const ze=ue.node().querySelector("g");jn(ze,r,(ce==null?void 0:ce.dx)??0,(ce==null?void 0:ce.dy)??0)}if(n.tooltips&&de.use(Va({numberFormat:(kn=n.verticalAxis)==null?void 0:kn.numberFormat})),n.crosshair&&de.use(Xl({width:V,height:G,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor})),(ao=n.annotations)!=null&&ao.length){const ze=e.labels.map((Pe,Fe)=>({label:Pe,value:Math.max(...d.map(Je=>Je.values[Fe]??0))}));de.use(mu(n.annotations,{scaleX:se,scaleY:te,data:ze,width:V,height:G,backgroundColor:cr(t),transition:o,priorAnnotations:s}))}de.draw(ve),jr(t,{chartType:"bar-multi",margin:ie}),i&&(Cr(ue.node()),$r(t,i)),_e(z).selectAll(".bc-bar-multi").each(function(ze){const Pe=ze,Fe=ln(Pe.seriesName,Pe.seriesIndex,h,m),Je=Sf(Pe.seriesName,m),Qe=o?_e(this).transition().duration(ut()):_e(this);Qe.attr("fill",Fe),Je<1&&Qe.attr("fill-opacity",Je)});const fe=new Set;d.forEach(ze=>{va(ze.name,g,m)==="direct"&&fe.add(ze.name)});const pe=fe.size>0,J=cr(t),X=typeof n.directLabelling=="string"?n.directLabelling:n.directLabelling?Co.Auto:Co.Off,ee=n.directLabelAnchor??"middle",we=n.valueLabelPosition??yt.Auto;function ge(){return we===yt.Inside?yt.Inside:(we===yt.Outside,yt.Outside)}function be(ze){return X===Co.Inside?yt.Inside:X===Co.Outside?yt.Outside:me?ge():yt.Outside}function ye(ze,Pe,Fe){return Fe==="start"?ze+12:Fe==="end"?ze+Pe-4:ze+Pe/2}const Oe=_e(z).append("g").attr("class","bc-value-labels");ve.forEach(ze=>{if(!xu(ze.seriesName,me,m))return;const Pe=(se(ze.label)??0)+(re(ze.series)??0)+re.bandwidth()/2,Fe=Math.min(te(0),te(ze.value)),Je=Math.abs(te(ze.value)-te(0)),Qe=ge(),Bt=pe&&fe.has(ze.seriesName),Zn=ze.value<0,Po=Fe+Je;let Nn,Un,Ti;if(Qe===yt.Inside){const Ks=ln(ze.seriesName,ze.seriesIndex,h,m);Un=Mo(Ks),Ti="central",Bt&&be()===yt.Inside?Nn=ye(Fe,Je,ee)+14:Nn=Fe+Je/2}else Un="currentColor",Zn?(Nn=Bt&&be()===yt.Outside?Po+16:Po+4,Ti="hanging"):(Nn=Bt&&be()===yt.Outside?Fe-16:Fe-4,Ti="auto");Oe.append("text").attr("class","bc-value-label").attr("data-series",ze.seriesIndex).attr("x",Pe).attr("y",Nn).attr("text-anchor","middle").attr("dominant-baseline",Ti).attr("font-size","11px").attr("fill",Un).text(String(ze.value))}),ve.forEach(ze=>{var Nn;if(!fe.has(ze.seriesName))return;const Pe=(se(ze.label)??0)+(re(ze.series)??0)+re.bandwidth()/2,Fe=Math.min(te(0),te(ze.value)),Je=Math.abs(te(ze.value)-te(0)),Qe=((Nn=m==null?void 0:m.find(Un=>Un.name===ze.seriesName))==null?void 0:Nn.labelText)||ze.seriesName,Bt=be(),Zn=ln(ze.seriesName,ze.seriesIndex,h,m),Po=_e(z).append("text").attr("class","bc-direct-label").attr("data-series",ze.seriesIndex).attr("x",Pe).attr("text-anchor","middle").attr("font-size","10px").text(Qe);if(Bt===yt.Inside){const Un=ye(Fe,Je,ee);Po.attr("y",Un).attr("fill",Mo(Zn)),ee==="middle"&&Po.attr("dominant-baseline","central")}else Po.attr("y",Fe-4).attr("fill",S5(Zn,J))});const ke=f.filter(ze=>va(ze,g,m)==="legend");if(v&&ke.length>0){const ze=ke.map(Je=>{const Qe=u.findIndex(Bt=>Bt.name===Je);return ln(Je,Qe,h,m)});let Pe=0,Fe=0;if(C==="top"){const Je=k?15:0;Fe=-(B.height+5+Je)}else C==="bottom"?Fe=G+25:C==="left"?Pe=-(B.width+10):C==="right"&&(Pe=V+10);Fa(z,ke,ze,Fe,C,L,V,G,Pe,[],{left:ie.left,right:ie.right})}}const iee={linear:du,monotoneX:Iy,step:EX,stepBefore:IX,stepAfter:RX,basis:BX,cardinal:LX,catmullRom:DX};function Bl(t){return t&&iee[t]||du}function B5(t){const e=(t==null?void 0:t.position)??yt.Auto,n=(t==null?void 0:t.orientation)??Yn.Vertical,o=t!=null&&t.format?uu(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=_e(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,m,b,g,v;if(n===Yn.Horizontal)if(v=e===yt.Inside,m=c+d/2,g="central",f)v?(h=l+4,b="start"):(h=l-4,b="end");else{const C=l+u;v?(h=C-4,b="end"):(h=C+4,b="start")}else v=e===yt.Inside,h=l+u/2,b="middle",f?v?(m=c+d/2,g="central"):(m=c+d+4,g="hanging"):v?(m=c+d/2,g="central"):(m=c-4,g="auto");const y=a.attr("fill")||"#ccc",x=v?Mo(y):"currentColor";_e(this.parentNode).append("text").attr("class","bc-value-label").attr("x",h).attr("y",m).attr("text-anchor",b).attr("dominant-baseline",g).attr("font-size","11px").attr("fill",x).text(o(s.value))}),i.selectAll(".bc-dot").each(function(s){const a=_e(this),l=parseFloat(a.attr("cx")),c=parseFloat(a.attr("cy"));_e(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 L5="bc-tooltip";function see(){if(document.getElementById("bc-tooltip-styles"))return;const t=document.createElement("style");t.id="bc-tooltip-styles",t.textContent=`
|
|
66
|
+
.${L5} {
|
|
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 aee(t){const e=t?Aa(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 Lm(t,e){const{width:n,height:o,points:r,tooltip:i=!0,crosshair:s=!1,crosshairDirection:a=ko.Both,crosshairStyle:l=ri.Dashed,crosshairColor:c="#999",format:u=aee(e.numberFormat)}=e;if(r.length===0)return()=>{};const d=l===ri.Solid?"none":l===ri.Dotted?"2,2":"4,3",f=[...new Set(r.map(k=>k.cx))].sort((k,A)=>k-A),h=_e(t);let m=null;i&&(see(),m=document.createElement("div"),m.className=L5,document.body.appendChild(m));const b=".bc-annotations",g=!h.select(b).empty(),v=k=>g?h.insert(k,b):h.append(k),y=s&&(a===ko.Both||a===ko.Vertical),x=s&&(a===ko.Both||a===ko.Horizontal);let _=null,C=null;y&&(_=v("line").attr("class","bc-crosshair bc-crosshair-v").attr("y1",0).attr("y2",o).attr("stroke",c).attr("stroke-width",1).style("stroke-dasharray",d).attr("pointer-events","none").style("display","none")),x&&(C=v("line").attr("class","bc-crosshair bc-crosshair-h").attr("x1",0).attr("x2",n).attr("stroke",c).attr("stroke-width",1).style("stroke-dasharray",d).attr("pointer-events","none").style("display","none"));const L=v("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"),O=v("rect").attr("class","bc-proximity-overlay").attr("width",n).attr("height",o).attr("fill","none").attr("pointer-events","all");function $(k,A){if(f.length===0)return null;const B=oV(f,k),P=f[B],F=r.filter(G=>G.cx===P);if(F.length===0)return null;let z=F[0],V=Math.abs(F[0].cy-A);for(let G=1;G<F.length;G++){const ie=Math.abs(F[G].cy-A);ie<V&&(z=F[G],V=ie)}return z}const M=k=>{const[A,B]=pY(k,t),P=$(A,B);P&&(L.attr("cx",P.cx).attr("cy",P.cy).attr("stroke",P.color).style("display",null),m&&(m.textContent=u(P),m.style.display="block",NA(L.node(),m,{placement:"top",middleware:[EA(8),RA(),IA()]}).then(({x:F,y:z})=>{m&&(m.style.left=`${F}px`,m.style.top=`${z}px`)})),_&&_.attr("x1",P.cx).attr("x2",P.cx).style("display",null),C&&C.attr("y1",P.cy).attr("y2",P.cy).style("display",null))},D=()=>{L.style("display","none"),m&&(m.style.display="none"),_&&_.style("display","none"),C&&C.style("display","none")},N=O.node();return N.addEventListener("mousemove",M),N.addEventListener("mouseleave",D),()=>{N.removeEventListener("mousemove",M),N.removeEventListener("mouseleave",D),O.remove(),L.remove(),m&&(m.remove(),m=null),_&&_.remove(),C&&C.remove()}}const lee=MX??aA,cee={circle:Dy,square:SX,diamond:_X,triangle:aA,triangleDown:lee,cross:xX,star:$X};function uee(t,e,n){switch(n){case mr.First:return t===0;case mr.Last:return t===e-1;case mr.FirstLast:return t===0||t===e-1;case mr.All:default:return!0}}function o2(t,e,n,o,r=!1){const i=o.symbol??hr.Circle,s=o.showOn??mr.FirstLast,a=o.style??Fo.Filled,l=o.size??3.5,c=o.opacity??1,u="var(--bs-body-bg, #fff)",d=e.filter(h=>uee(h.index,n,s)),f=r?ut():0;if(i===hr.Circle){const h=t.selectAll(".bc-symbol").data(d).join(b=>b.append("circle").attr("class","bc-symbol").attr("cx",g=>g.cx).attr("cy",g=>g.cy).attr("r",l).attr("fill",g=>a===Fo.Filled?g.color:u).attr("stroke",g=>g.color).attr("stroke-width",a===Fo.Hollow?1.5:0).attr("opacity",c),b=>b,b=>b.remove());(r?h.transition().duration(f):h).attr("cx",b=>b.cx).attr("cy",b=>b.cy).attr("r",l).attr("fill",b=>a===Fo.Filled?b.color:u).attr("stroke",b=>b.color).attr("stroke-width",a===Fo.Hollow?1.5:0).attr("opacity",c)}else{const h=cee[i]??Dy,m=Math.PI*l*l,b=OX().type(h).size(m),g=t.selectAll(".bc-symbol").data(d).join(y=>y.append("path").attr("class","bc-symbol").attr("transform",x=>`translate(${x.cx},${x.cy})`).attr("d",b).attr("fill",x=>a===Fo.Filled?x.color:u).attr("stroke",x=>x.color).attr("stroke-width",a===Fo.Hollow?1.5:0).attr("opacity",c),y=>y,y=>y.remove());(r?g.transition().duration(f):g).attr("transform",y=>`translate(${y.cx},${y.cy})`).attr("d",b).attr("fill",y=>a===Fo.Filled?y.color:u).attr("stroke",y=>y.color).attr("stroke-width",a===Fo.Hollow?1.5:0).attr("opacity",c)}}const P5="#4e79a7";class dee extends so{initialize(){this.configDefine("xPos",{defaultValue:(r,i)=>0}),this.configDefine("y",{defaultValue:gn()}),this.configDefine("color",{defaultValue:P5}),this.configDefine("curve",{defaultValue:du}),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=Is().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=Is().curve(l).x((f,h)=>i(f,h)).y0(c).y1(f=>s(f.value));r.duration(ut()).attr("fill",a).attr("opacity",u).attr("d",d)},"exit:transition":r=>{r.duration(ut()).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=bi().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=bi().curve(l).x((u,d)=>i(u,d)).y(u=>s(u.value));r.duration(ut()).attr("fill","none").attr("stroke",a).attr("stroke-width",2).attr("d",c)},"exit:transition":r=>{r.duration(ut()).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(ut()).attr("cx",(l,c)=>i(l,c)).attr("cy",l=>s(l.value)).attr("r",3).attr("fill",a)},"exit:transition":r=>{r.duration(ut()).attr("opacity",0).remove()}}})}}function fee(t,e,n={},o=!1){var U,te,ne,ve,me,I,W,j,ue,de,fe,pe;qr(o);let r=[],i=[],s=[],a=null,l=null,c,u;const d=Tr.for(t);if(o){const J=Yr(t);u=J==null?void 0:J.margin,d.detach(),(J==null?void 0:J.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")):J&&(l=Ar(t)),c=new Map;for(const X of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[ee,we]of lr(X))c.set(ee,we);t.replaceChildren()}const{body:f}=Ur(t,n.frame),h=ar(f).width,m=ql(e.values,(U=n.verticalAxis)==null?void 0:U.range,(te=n.verticalAxis)==null?void 0:te.numberFormat,(ne=n.verticalAxis)==null?void 0:ne.scaleType),b=Ci(h,(ve=n.verticalAxis)==null?void 0:ve.labelPosition,(me=n.horizontalAxis)==null?void 0:me.labelPosition,(I=n.verticalAxis)==null?void 0:I.direction,m),{chartArea:g,width:v,height:y,margin:x}=Gr(f,b),_=ki(u,x),C=_m(e.labels,(W=n.horizontalAxis)==null?void 0:W.range),L=C.map(J=>e.labels[J]),O=C.map(J=>e.values[J]),$=L.map((J,X)=>({label:J,value:O[X]})),M=gm().domain(L).range([0,v]).padding(n.edgePadding?.6:0),D=M,N=J=>M(J.label)??0,k=((j=n.verticalAxis)==null?void 0:j.scaleType)==="log",[A,B]=hu(O,(ue=n.verticalAxis)==null?void 0:ue.range),P=k?Na().domain([A,B]).nice().range([y,0]):gn().domain([A,B]).nice().range([y,0]),F=P.domain(),z=F[0]<0&&F[1]>0?P(0):void 0;d.attach(g,_),d.update({vertical:{scale:P,height:y,options:{...n.verticalAxis,gridWidth:v,topPadding:x.top}},horizontal:{scale:D,height:y,options:{...n.horizontalAxis,width:v,zeroY:z}}});const V=`bc-clip-${Math.random().toString(36).slice(2,8)}`,G=g.ownerSVGElement;(_e(G).select("defs").empty()?_e(G).append("defs"):_e(G).select("defs")).append("clipPath").attr("id",V).append("rect").attr("width",v).attr("height",y);const ce=_e(g).append("g").attr("clip-path",`url(#${V})`),he=ce.node(),Z=((de=n.colors)==null?void 0:de[0])??P5,oe=Bl(n.interpolation),se=n.lineSymbols,re=new dee(_e(he));if(re.config({xPos:N,y:P,color:Z,curve:oe,areaFill:n.areaFill??!1,areaFillOpacity:n.areaFillOpacity??.2,height:y}),i.length>0||r.length>0||s.length>0){const J=(_==null?void 0:_.dx)??0,X=(_==null?void 0:_.dy)??0,ee=he.querySelectorAll(":scope > g");ee[0]&&jn(ee[0],r,J,X),ee[1]&&jn(ee[1],i,J,X),ee[2]&&jn(ee[2],s,J,X)}if(n.valueLabels&&re.use(B5({position:n.valueLabelPosition,orientation:Yn.Vertical})),re.draw($),(fe=n.annotations)!=null&&fe.length&&Mm(g,n.annotations,{scaleX:D,scaleY:P,data:$,width:v,height:y,backgroundColor:cr(t),transition:o,priorAnnotations:c}),_e(he).selectAll(".bc-dot").attr("fill-opacity",0).attr("stroke-opacity",0).attr("pointer-events","none"),n.tooltips||n.crosshair){const J=$.map(X=>({cx:N(X),cy:P(X.value),label:X.label,value:X.value,color:Z}));Lm(g,{width:v,height:y,points:J,tooltip:n.tooltips,crosshair:n.crosshair,crosshairDirection:n.crosshairDirection,crosshairStyle:n.crosshairStyle,crosshairColor:n.crosshairColor,numberFormat:(pe=n.verticalAxis)==null?void 0:pe.numberFormat})}if(se){const J=$.map((ee,we)=>({cx:N(ee),cy:P(ee.value),color:Z,index:we}));let X;a?(g.appendChild(a),X=_e(a)):X=_e(g).append("g").attr("class","bc-symbols"),o2(X,J,$.length,se,o)}jr(t,{chartType:"line",margin:x}),l&&(Cr(ce.node()),$r(t,l))}const r2=28,D5=18,E5=20;function i2(t,e,n,o=r2){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 I5(t,e,n){const{outerRadius:o,fontSize:r=11,bgColor:i="#fff"}=n,s=o+2,a=s+D5,l=r2/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((_,C)=>_.midAngle-C.midAngle);const m=h?.05:Math.PI+.05,b=h?Math.PI-.05:2*Math.PI-.05,g=f.map(_=>_.midAngle),v=i2(g,m,b,l),y=h?1:-1,x=t.append("g").attr("class","bc-arc-labels");f.forEach((_,C)=>{const L=_.showLabel!==!1,O=_.showValue!==!1;if(!L&&!O)return;const M=v[C]-Math.PI/2,D=Math.cos(M)*s,N=Math.sin(M)*s,k=Math.cos(M)*a,A=Math.sin(M)*a,B=k+y*E5;x.append("polyline").attr("class","bc-arc-label-line").attr("points",`${D},${N} ${k},${A} ${B},${A}`).attr("fill","none").attr("stroke","#999").attr("stroke-width",1);const P=B+y*4,F=x.append("text").attr("class","bc-arc-direct-label").attr("x",P).attr("y",A).attr("text-anchor",h?"start":"end").attr("font-size",`${r}px`);if(L&&F.append("tspan").attr("x",P).attr("dy",O?"-0.1em":"0.35em").attr("font-weight","bold").attr("fill",S5(_.color,i)).text(_.label),O){const z=_.displayAsPercentage&&_.percentage!=null?`${Math.round(_.percentage)}%`:String(_.value);F.append("tspan").attr("x",P).attr("dy",L?"1.2em":"0.35em").attr("fill","#666").text(z)}})}d(u,!0),d(c,!1)}const R5=.3;function N5(t,e,n){const{outerRadius:o,innerRadius:r=0,fontSize:i=11}=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<R5)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,m=Math.sin(f)*s,b=a.append("text").attr("class","bc-arc-inside-label").attr("x",h).attr("y",m).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",`${i}px`),g=Mo(l.color);if(u&&b.append("tspan").attr("x",h).attr("dy",d?"-0.5em":"0em").attr("font-weight","bold").attr("fill",g).text(l.label),d){const v=l.displayAsPercentage&&l.percentage!=null?`${Math.round(l.percentage)}%`:String(l.value);b.append("tspan").attr("x",h).attr("dy",u?"1.2em":"0em").attr("fill",g).attr("opacity",.85).text(v)}}}function hee(t,e,n){const{outerRadius:o,innerRadius:r=0,fontSize:i=11,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>=R5?l.push(u):c.push(u)}l.length>0&&N5(t,l,{outerRadius:o,innerRadius:r,fontSize:i}),c.length>0&&I5(t,c,{outerRadius:o,fontSize:i,bgColor:s})}function pee(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=D5+E5+6+4+n*7+6,i=t.length*r2/2,s=Math.max(10,i-e+20);return{left:o,right:o,top:s,bottom:s}}const F5=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"];class mee extends so{initialize(){this.configDefine("xPos",{defaultValue:r=>0}),this.configDefine("y",{defaultValue:gn()}),this.configDefine("colors",{defaultValue:F5}),this.configDefine("labels",{defaultValue:[]}),this.configDefine("curve",{defaultValue:du}),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=>Is().curve(l).x((h,m)=>i(m)).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(ut()).attr("data-series",d=>d.colorIndex).attr("fill",d=>a[d.colorIndex%a.length]).attr("opacity",u).attr("d",d=>Is().curve(l).x((h,m)=>i(m)).y0(c).y1(h=>s(h))(d.values))},"exit:transition":r=>{r.duration(ut()).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?l.has(u.name)?1:.3:null).attr("d",u=>{const d=this.config("curve");return bi().curve(d).x((h,m)=>i(m)).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(ut()).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?l.has(u.name)?1:.3:null).attr("d",u=>{const d=this.config("curve");return bi().curve(d).x((h,m)=>i(m)).y(h=>s(h))(u.values)})},"exit:transition":r=>{r.duration(ut()).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(ut()).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(ut()).attr("opacity",0).remove()}}})}}function gee(t,e,n={},o=!1){var Fe,Je,Qe,Bt,Zn,Po,Nn,Un,Ti,Ks,Cu,Au;qr(o);let r=e,i=[],s=[],a=[],l=[],c=null,u,d;const f=Tr.for(t);if(o){const We=Yr(t);d=We==null?void 0:We.margin,f.detach(),(We==null?void 0:We.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"))):We&&(c=Ar(t)),u=new Map;for(const it of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[Et,Ht]of lr(it))u.set(Et,Ht);t.replaceChildren()}const{body:h}=Ur(t,n.frame),m=r.series??[];let b=m.filter(We=>!Ua(We.name,n.seriesOverrides));(n.sortMode==="total"||n.sortMode==="within-groups")&&(b=[...b].sort((We,it)=>{const Et=We.values.reduce((Gn,Qn)=>Gn+Qn,0);return it.values.reduce((Gn,Qn)=>Gn+Qn,0)-Et}));const g=n.colors??F5,v=b.map(We=>We.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",C=v.filter(We=>va(We,_,y)==="direct"),L=n.legend!==!1&&!x,O=ar(h).width,$=350,M=n.legendPosition??"top",D=O>0&&O<$&&(M==="left"||M==="right")?"top":M,N=n.legendAnchor??"start",k=_m(r.labels,(Fe=n.horizontalAxis)==null?void 0:Fe.range),A=k.map(We=>r.labels[We]);b=b.map(We=>({...We,values:k.map(it=>We.values[it])})),r={...r,labels:A,series:b};const B=b.flatMap(We=>We.values),P=ql(B,(Je=n.verticalAxis)==null?void 0:Je.range,(Qe=n.verticalAxis)==null?void 0:Qe.numberFormat,(Bt=n.verticalAxis)==null?void 0:Bt.scaleType),F=Ci(O,(Zn=n.verticalAxis)==null?void 0:Zn.labelPosition,(Po=n.horizontalAxis)==null?void 0:Po.labelPosition,(Nn=n.verticalAxis)==null?void 0:Nn.direction,P),z=C.length>0?M5(C):0,V=F.top!=null,G=Math.max(0,O-(F.left??50)-(F.right??20)-z),ie=L?Wa(v,D,G):{width:0,height:0},ce=L?ie.height+10:0,he={...F};if(L&&D==="top"){const We=V?15:0;he.top=ce+We}L&&D==="bottom"&&(he.bottom=(he.bottom??24)+ce),L&&D==="left"&&(he.left=(he.left??50)+ie.width+10),L&&D==="right"&&(he.right=(he.right??20)+ie.width+10),z>0&&(he.right=(he.right??20)+z);const{chartArea:Z,width:oe,height:se,margin:re}=Gr(h,he),U=ki(d,re),[te,ne]=hu(B,(Un=n.verticalAxis)==null?void 0:Un.range),ve=gm().domain(r.labels).range([0,oe]).padding(n.edgePadding?.6:0),me=ve,I=We=>ve(r.labels[We])??0,j=((Ti=n.verticalAxis)==null?void 0:Ti.scaleType)==="log"?Na().domain([te,ne]).nice().range([se,0]):gn().domain([te,ne]).nice().range([se,0]),ue=j.domain(),de=ue[0]<0&&ue[1]>0?j(0):void 0;f.attach(Z,U),f.update({vertical:{scale:j,height:se,options:{...n.verticalAxis,gridWidth:oe,topPadding:re.top}},horizontal:{scale:me,height:se,options:{...n.horizontalAxis,width:oe,zeroY:de}}});const fe=`bc-clip-${Math.random().toString(36).slice(2,8)}`,pe=Z.ownerSVGElement;(_e(pe).select("defs").empty()?_e(pe).append("defs"):_e(pe).select("defs")).append("clipPath").attr("id",fe).append("rect").attr("width",oe).attr("height",se);const X=_e(Z).append("g").attr("clip-path",`url(#${fe})`),ee=X.node(),we=b.map(We=>({name:We.name,values:We.values,colorIndex:m.findIndex(it=>it.name===We.name)})),ge=Bl(n.interpolation);(Ks=n.areaFills)!=null&&Ks.length&&vee(ee,n.areaFills,b,I,r.labels.length,j,ge);const be=[];b.forEach((We,it)=>{r.labels.forEach((Et,Ht)=>{be.push({label:Et,value:We.values[Ht],series:We.name,colorIndex:it})})});const ye=n.lineSymbols,Oe={solid:"",dotted:"2,4",dashed:"8,4","dash-dot":"8,4,2,4"},ke=n.valueLabels??!1,Ae=new Set((n.highlights??[]).map(We=>We.target)),je=Ae.size>0,tt=new mee(_e(ee));tt.config({xPos:I,y:j,colors:g,labels:r.labels,curve:ge,areaFill:n.areaFill??!1,areaFillOpacity:n.areaFillOpacity??.2,height:se,dots:be,highlightTargets:Ae});const mt=new Set(we.map(We=>We.name)),$t=i.filter(We=>{var it;return mt.has(((it=We.__data__)==null?void 0:it.name)??"")}),Vt=s.filter(We=>{var it;return mt.has(((it=We.__data__)==null?void 0:it.name)??"")}),cn=a.filter(We=>{var it;return mt.has(((it=We.__data__)==null?void 0:it.series)??"")});if(Vt.length>0||$t.length>0||cn.length>0){const We=(U==null?void 0:U.dx)??0,it=(U==null?void 0:U.dy)??0,Et=ee.querySelectorAll(":scope > g");Et[0]&&jn(Et[0],$t,We,it),Et[1]&&jn(Et[1],Vt,We,it),Et[2]&&jn(Et[2],cn,We,it)}if(tt.draw(we),(Cu=n.annotations)!=null&&Cu.length){const We=r.labels.map((it,Et)=>{var Ht;return{label:it,value:((Ht=b[0])==null?void 0:Ht.values[Et])??0}});Mm(Z,n.annotations,{scaleX:me,scaleY:j,data:We,width:oe,height:se,backgroundColor:cr(t),transition:o,priorAnnotations:u})}const Tt=_e(ee).append("g").attr("class","bc-value-labels");if(be.forEach(We=>{if(!xu(We.series,ke,y))return;const it=I(r.labels.indexOf(We.label)),Et=j(We.value);Tt.append("text").attr("class","bc-value-label").attr("data-series",We.colorIndex).attr("x",it).attr("y",Et-8).attr("text-anchor","middle").attr("font-size","11px").attr("fill","currentColor").text(String(We.value))}),_e(ee).selectAll(".bc-line").each(function(We){const it=We,Et=ln(it.name,it.colorIndex,g,y),Ht=tee(it.name,y),Gn=eee(it.name,y),Qn=n2(it.name,n.interpolation??"linear",y),Kr=o?_e(this).transition().duration(ut()):_e(this);if(Kr.attr("stroke",Et).attr("stroke-width",Ht),je&&Kr.attr("opacity",Ae.has(it.name)?1:.3),Gn!=="solid"&&_e(this).attr("stroke-dasharray",Oe[Gn]??""),Qn!==(n.interpolation??"linear")){const Ql=Bl(Qn),Jl=bi().curve(Ql).x((Zs,dg)=>I(dg)).y(Zs=>j(Zs));Kr.attr("d",Jl(it.values))}}),_e(ee).selectAll(".bc-area").each(function(We){const it=We,Et=ln(it.name,it.colorIndex,g,y),Ht=o?_e(this).transition().duration(ut()):_e(this);Ht.attr("fill",Et),je&&Ht.attr("opacity",Ae.has(it.name)?n.areaFillOpacity??.2:.1)}),_e(ee).selectAll(".bc-dot").attr("fill-opacity",0).attr("stroke-opacity",0).attr("pointer-events","none"),n.tooltips||n.crosshair){const We=be.map(it=>({cx:I(r.labels.indexOf(it.label)),cy:j(it.value),label:it.label,value:it.value,series:it.series,color:ln(it.series,it.colorIndex,g,y)}));Lm(Z,{width:oe,height:se,points:We,tooltip:n.tooltips,crosshair:n.crosshair,crosshairDirection:n.crosshairDirection,crosshairStyle:n.crosshairStyle,crosshairColor:n.crosshairColor,numberFormat:(Au=n.verticalAxis)==null?void 0:Au.numberFormat})}const Rt=ye?{symbolShape:ye.symbol,symbolShowOn:ye.showOn,symbolStyle:ye.style,symbolSize:ye.size,symbolOpacity:ye.opacity}:void 0,en=r.labels.length;b.forEach((We,it)=>{const Et=nee(We.name,Rt,y);if(!Et)return;const Ht={symbol:Et.symbolShape??(ye==null?void 0:ye.symbol)??hr.Circle,showOn:Et.symbolShowOn??(ye==null?void 0:ye.showOn)??mr.FirstLast,style:Et.symbolStyle??(ye==null?void 0:ye.style)??Fo.Filled,size:Et.symbolSize??(ye==null?void 0:ye.size)??3.5,opacity:Et.symbolOpacity??(ye==null?void 0:ye.opacity)??1},Gn=r.labels.map((Jl,Zs)=>({cx:I(Zs),cy:j(We.values[Zs]),color:ln(We.name,it,g,y),index:Zs})),Qn=l.find(Jl=>Jl.getAttribute("data-series-name")===We.name);let Kr,Ql=!1;Qn?(Z.appendChild(Qn),Kr=_e(Qn),Ql=!0):Kr=_e(Z).append("g").attr("class","bc-symbols").attr("data-series",it).attr("data-series-name",We.name),o2(Kr,Gn,en,Ht,o&&Ql)});const kn=r.labels.length-1,ao=I(kn)+6,ze=[];if(b.forEach((We,it)=>{var Qn;if(va(We.name,_,y)!=="direct")return;const Ht=We.values[kn],Gn=((Qn=y==null?void 0:y.find(Kr=>Kr.name===We.name))==null?void 0:Qn.labelText)||We.name;ze.push({name:We.name,index:it,naturalY:j(Ht),text:Gn})}),ze.length>0){ze.sort((Ht,Gn)=>Ht.naturalY-Gn.naturalY);const We=ze.map(Ht=>Ht.naturalY),Et=i2(We,0,se,14);ze.forEach((Ht,Gn)=>{_e(Z).append("text").attr("class","bc-direct-label").attr("data-series",Ht.index).attr("x",ao).attr("y",Et[Gn]).attr("dy","0.35em").attr("font-size","11px").attr("fill",ln(Ht.name,Ht.index,g,y)).text(Ht.text)})}const Pe=v.filter(We=>va(We,_,y)==="legend");if(L&&Pe.length>0){const We=Pe.map(Ht=>{const Gn=m.findIndex(Qn=>Qn.name===Ht);return ln(Ht,Gn,g,y)});let it=0,Et=0;if(D==="top"){const Ht=V?15:0;Et=-(ie.height+5+Ht)}else D==="bottom"?Et=se+25:D==="left"?it=-(ie.width+10):D==="right"&&(it=oe+10);Fa(Z,Pe,We,Et,D,N,oe,se,it,[],{left:re.left,right:re.right})}jr(t,{chartType:"line-multi",margin:re}),c&&(Cr(X.node()),$r(t,c))}function vee(t,e,n,o,r,i,s){const a=_e(t).append("g").attr("class","bc-area-fills");for(const l of e){const c=n.find(b=>b.name===l.from),u=n.find(b=>b.name===l.to);if(!c||!u)continue;const d=l.interpolation?Bl(l.interpolation):s,f=(l.opacity??30)/100,h=l.color??"#ccc",m=l.negativeColor;if(m)yee(a,c.values,u.values,o,i,d,h,m,f);else{const b=Is().curve(d).x((g,v)=>o(v)).y0((g,v)=>i(u.values[v])).y1(g=>i(g));a.append("path").attr("class","bc-area-fill").attr("d",b(c.values)??"").attr("fill",h).attr("opacity",f)}}}function bee(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 yee(t,e,n,o,r,i,s,a,l){const c=e.length;if(c===0)return;const u=[];for(let m=0;m<c;m++){const b=o(m),g=r(e[m]),v=r(n[m]);if(u.push({x:b,fromY:g,toY:v}),m<c-1){const y=r(e[m+1]),x=r(n[m+1]),_=bee(g,y,v,x);if(_!==null&&_>0&&_<1){const C=b+_*(o(m+1)-b),L=g+_*(y-g),O=v+_*(x-v);u.push({x:C,fromY:L,toY:O})}}}const d=[];let f=[],h=null;for(const m of u){const b=m.fromY-m.toY,g=b<0;h===null?(h=b===0?null:g,f.push(m)):b===0?(f.push(m),f.length>=2&&d.push({points:f,positive:h}),f=[m],h=null):h===g?f.push(m):(f.push(m),f.length>=2&&d.push({points:f,positive:h}),f=[m],h=g)}f.length>=2&&h!==null&&d.push({points:f,positive:h});for(const m of d){const b=m.points;let g=`M${b[0].x},${b[0].fromY}`;for(let v=1;v<b.length;v++)g+=`L${b[v].x},${b[v].fromY}`;for(let v=b.length-1;v>=0;v--)g+=`L${b[v].x},${b[v].toY}`;g+="Z",t.append("path").attr("class",`bc-area-fill ${m.positive?"bc-area-fill-pos":"bc-area-fill-neg"}`).attr("d",g).attr("fill",m.positive?s:a).attr("opacity",l)}}const xee=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"];class wee extends so{initialize(){this.configDefine("arc",{defaultValue:tA()}),this.configDefine("colorScale",{defaultValue:mm()}),this.configDefine("labels",{defaultValue:[]});const e=this.base.append("g");this.layer("arcs",e,{dataBind:(n,o)=>{const r=this.config("labels");return n.selectAll(".bc-arc").data(o,(i,s)=>r[s])},insert:n=>n.append("path").attr("class","bc-arc"),events:{enter:n=>{const o=this.config("arc"),r=this.config("colorScale"),i=this.config("labels");n.attr("d",o).attr("fill",(s,a)=>r(i[a]))},"merge:transition":n=>{const o=this.config("arc"),r=this.config("colorScale"),i=this.config("labels");n.duration(ut()).attr("d",o).attr("fill",(s,a)=>r(i[a]))},"exit:transition":n=>{n.duration(ut()).attr("opacity",0).remove()}}})}}function _ee(t,e,n={},o=!1){V5(t,e,n,.6,o)}function V5(t,e,n,o,r=!1){var se;qr(r);let i=[],s=null,a;if(r){const re=Yr(t),U=o>0?"donut":"pie";(re==null?void 0:re.chartType)===U?i=Array.from(t.querySelectorAll(".bc-frame .bc-arc")):re&&(s=Ar(t)),a=new Map;for(const te of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[ne,ve]of lr(te))a.set(ne,ve);t.replaceChildren()}const{body:l}=Ur(t,n.frame);let c=[...e.labels],u=[...e.values];if(n.sort===Qt.Ascending||n.sort===Qt.Descending){const re=c.map((U,te)=>({label:U,value:u[te]}));re.sort((U,te)=>n.sort===Qt.Ascending?U.value-te.value:te.value-U.value),c=re.map(U=>U.label),u=re.map(U=>U.value)}if(n.sliceMax&&n.sliceMax>0&&c.length>n.sliceMax){const re=n.sliceMax-1,U=c.slice(0,re),te=u.slice(0,re),ne=u.slice(re).reduce((ve,me)=>ve+me,0);U.push(n.sliceGroupLabel??"Others"),te.push(ne),c=U,u=te}const d=u.reduce((re,U)=>re+U,0),f=u.map(re=>d>0?re/d*100:0),h=n.colors??xee,m=typeof n.directLabelling=="string"?n.directLabelling:n.directLabelling?Co.Auto:Co.Off,b=!!m&&!(m===Co.Auto&&n.legend===!0),v=(n.showValues??!0)&&!b?u.map((re,U)=>`(${n.displayAsPercentage?`${Math.round(f[U])}%`:String(re)})`):[],y=n.legend!==!1&&!b,x=ar(l).width,_=350,C=n.legendPosition??"top",L=x>0&&x<_&&(C==="left"||C==="right")?"top":C,O=n.legendAnchor??"start",$=v.length>0?c.map((re,U)=>`${re} ${v[U]}`):c,M=Math.max(0,x-50-20),D=y?Wa($,L,M):{width:0,height:0},N=y?D.height+10:0,k={};if(y&&L==="top"&&(k.top=N),y&&L==="bottom"&&(k.bottom=24+N),y&&L==="left"&&(k.left=50+D.width+10),y&&L==="right"&&(k.right=20+D.width+10),b){const re=ar(l),U=20,te=re.width-2*U,ne=(re.height>0?re.height:400)-2*U,ve=Math.min(te,ne)/2,me=pee(c,ve);k.left=(k.left??U)+me.left,k.right=(k.right??U)+me.right,k.top=(k.top??U)+me.top,k.bottom=(k.bottom??U)+me.bottom}const{chartArea:A,width:B,height:P,margin:F}=Gr(l,k),z=Math.min(B,P)/2,V=z*o,G=mm().domain(c).range(h),ie=yX().sort(null),ce=tA().innerRadius(V).outerRadius(z),he=_e(A).append("g").attr("transform",`translate(${B/2},${P/2})`),Z=ie(u),oe=new wee(he);if(oe.config({arc:ce,colorScale:G,labels:c}),i.length>0){const re=he.node().querySelector("g");i.forEach(U=>re.appendChild(U))}if(n.tooltips&&oe.use(Va()),oe.draw(Z),(se=n.annotations)!=null&&se.length){const re=n.annotations.filter(U=>U.kind==="free");re.length&&mu(re,{scaleX:Sn().domain([]).range([0,B]),scaleY:gn().domain([0,1]).range([P,0]),data:[],width:B,height:P,backgroundColor:cr(t),transition:r,priorAnnotations:a}).postDraw({base:_e(A)},void 0)}if(b){const re=Z.map((ve,me)=>({label:c[me],value:ve.data,startAngle:ve.startAngle,endAngle:ve.endAngle,color:G(c[me]),percentage:f[me],displayAsPercentage:n.displayAsPercentage,showLabel:n.showLabels??!0,showValue:n.showValues??!0})),U=he,te=cr(t),ne={outerRadius:z,innerRadius:V,bgColor:te};m===Co.Inside?N5(U,re,ne):m===Co.Auto?hee(U,re,ne):I5(U,re,ne)}if(n.showTotal&&o>0){const re=n.displayAsPercentage?"100%":String(d);he.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"),he.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(re)}if(y){let re=0,U=0;L==="top"?U=-(D.height+5):L==="bottom"?U=P+25:L==="left"?re=-(D.width+10):L==="right"&&(re=B+10),Fa(A,c,h,U,L,O,B,P,re,v,{left:F.left,right:F.right})}jr(t,{chartType:o>0?"donut":"pie"}),s&&(Cr(he.node()),$r(t,s))}function See(t,e,n={},o=!1){V5(t,e,n,0,o)}const z5="#4e79a7";class kee extends so{initialize(){this.configDefine("xPos",{defaultValue:(r,i)=>0}),this.configDefine("y",{defaultValue:gn()}),this.configDefine("color",{defaultValue:z5}),this.configDefine("curve",{defaultValue:Iy}),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=Is().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=Is().curve(l).x((f,h)=>i(f,h)).y0(c).y1(f=>s(f.value));r.duration(ut()).attr("fill",a).attr("opacity",u).attr("d",d)},"exit:transition":r=>{r.duration(ut()).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=bi().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=bi().curve(l).x((u,d)=>i(u,d)).y(u=>s(u.value));r.duration(ut()).attr("fill","none").attr("stroke",a).attr("stroke-width",2).attr("d",c)},"exit:transition":r=>{r.duration(ut()).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(ut()).attr("cx",(l,c)=>i(l,c)).attr("cy",l=>s(l.value)).attr("r",3).attr("fill",a)},"exit:transition":r=>{r.duration(ut()).attr("opacity",0).remove()}}})}}function Cee(t,e,n={},o=!1){var U,te,ne,ve,me,I,W,j,ue,de,fe,pe;qr(o);let r=[],i=[],s=[],a=null,l=null,c,u;const d=Tr.for(t);if(o){const J=Yr(t);u=J==null?void 0:J.margin,d.detach(),(J==null?void 0:J.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")):J&&(l=Ar(t)),c=new Map;for(const X of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[ee,we]of lr(X))c.set(ee,we);t.replaceChildren()}const{body:f}=Ur(t,n.frame),h=ar(f).width,m=ql(e.values,(U=n.verticalAxis)==null?void 0:U.range,(te=n.verticalAxis)==null?void 0:te.numberFormat,(ne=n.verticalAxis)==null?void 0:ne.scaleType),b=Ci(h,(ve=n.verticalAxis)==null?void 0:ve.labelPosition,(me=n.horizontalAxis)==null?void 0:me.labelPosition,(I=n.verticalAxis)==null?void 0:I.direction,m),{chartArea:g,width:v,height:y,margin:x}=Gr(f,b),_=ki(u,x),C=_m(e.labels,(W=n.horizontalAxis)==null?void 0:W.range),L=C.map(J=>e.labels[J]),O=C.map(J=>e.values[J]),$=L.map((J,X)=>({label:J,value:O[X]})),M=gm().domain(L).range([0,v]).padding(n.edgePadding?.6:0),D=M,N=J=>M(J.label)??0,k=((j=n.verticalAxis)==null?void 0:j.scaleType)==="log",[A,B]=hu(O,(ue=n.verticalAxis)==null?void 0:ue.range),P=k?Na().domain([A,B]).nice().range([y,0]):gn().domain([A,B]).nice().range([y,0]),F=P.domain(),z=F[0]<0&&F[1]>0?P(0):void 0;d.attach(g,_),d.update({vertical:{scale:P,height:y,options:{...n.verticalAxis,gridWidth:v,topPadding:x.top}},horizontal:{scale:D,height:y,options:{...n.horizontalAxis,width:v,zeroY:z}}});const V=`bc-clip-${Math.random().toString(36).slice(2,8)}`,G=g.ownerSVGElement;(_e(G).select("defs").empty()?_e(G).append("defs"):_e(G).select("defs")).append("clipPath").attr("id",V).append("rect").attr("width",v).attr("height",y);const ce=_e(g).append("g").attr("clip-path",`url(#${V})`),he=ce.node(),Z=((de=n.colors)==null?void 0:de[0])??z5,oe=Bl(n.interpolation??"monotoneX"),se=n.lineSymbols,re=new kee(_e(he));if(re.config({xPos:N,y:P,color:Z,curve:oe,areaFillOpacity:n.areaFillOpacity??.25,height:y}),i.length>0||r.length>0||s.length>0){const J=(_==null?void 0:_.dx)??0,X=(_==null?void 0:_.dy)??0,ee=he.querySelectorAll(":scope > g");ee[0]&&jn(ee[0],r,J,X),ee[1]&&jn(ee[1],i,J,X),ee[2]&&jn(ee[2],s,J,X)}if(n.valueLabels&&re.use(B5({position:n.valueLabelPosition,orientation:Yn.Vertical})),re.draw($),(fe=n.annotations)!=null&&fe.length&&Mm(g,n.annotations,{scaleX:D,scaleY:P,data:$,width:v,height:y,backgroundColor:cr(t),transition:o,priorAnnotations:c}),_e(he).selectAll(".bc-dot").attr("fill-opacity",0).attr("stroke-opacity",0).attr("pointer-events","none"),n.tooltips||n.crosshair){const J=$.map(X=>({cx:N(X),cy:P(X.value),label:X.label,value:X.value,color:Z}));Lm(g,{width:v,height:y,points:J,tooltip:n.tooltips,crosshair:n.crosshair,crosshairDirection:n.crosshairDirection,crosshairStyle:n.crosshairStyle,crosshairColor:n.crosshairColor,numberFormat:(pe=n.verticalAxis)==null?void 0:pe.numberFormat})}if(se){const J=$.map((ee,we)=>({cx:N(ee),cy:P(ee.value),color:Z,index:we}));let X;a?(g.appendChild(a),X=_e(a)):X=_e(g).append("g").attr("class","bc-symbols"),o2(X,J,$.length,se,o)}jr(t,{chartType:"area",margin:x}),l&&(Cr(ce.node()),$r(t,l))}function s2(t){const e=t.series??[];if(e.length===0)return[];const n=e.map(i=>i.name),o=t.labels.map((i,s)=>{const a={_index:s};return e.forEach(l=>{a[l.name]=l.values[s]??0}),a});return uA().keys(n).order(z0).offset(V0)(o)}function a2(t){const e=t.series??[];if(e.length===0)return[];const n=e.map(i=>i.name),o=t.labels.map((i,s)=>{const a={_index:s},l=e.reduce((c,u)=>c+Math.abs(u.values[s]??0),0);return e.forEach(c=>{a[c.name]=l>0?(c.values[s]??0)/l*100:0}),a});return uA().keys(n).order(z0).offset(V0)(o)}const H5=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"];class Aee extends so{initialize(){this.configDefine("xPos",{defaultValue:o=>0}),this.configDefine("colors",{defaultValue:H5}),this.configDefine("curve",{defaultValue:Iy}),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?l.has(u.name)?a:.3:a).attr("d",u=>Is().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(ut()).attr("data-series",u=>u.colorIndex).attr("fill",u=>i[u.colorIndex%i.length]).attr("opacity",u=>c?l.has(u.name)?a:.3:a).attr("d",u=>Is().curve(s).x((f,h)=>r(h)).y0(f=>f[0]).y1(f=>f[1])(u.points))},"exit:transition":o=>{o.duration(ut()).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?a.has(c.name)?1:.3:null).attr("d",c=>bi().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(ut()).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?a.has(c.name)?1:.3:null).attr("d",c=>bi().curve(s).x((d,f)=>r(f)).y(d=>d[1])(c.points))},"exit:transition":o=>{o.duration(ut()).attr("opacity",0).remove()}}})}}function $ee(t,e,n={},o=!1){var $t,Vt,cn,Tt,Rt,en,kn,ao,ze;qr(o);let r=e,i=[],s=[],a=null,l,c;const u=Tr.for(t);if(o){const Pe=Yr(t);c=Pe==null?void 0:Pe.margin,u.detach(),(Pe==null?void 0:Pe.chartType)==="area-stacked"?(i=Array.from(t.querySelectorAll(".bc-frame .bc-area")),s=Array.from(t.querySelectorAll(".bc-frame .bc-line"))):Pe&&(a=Ar(t)),l=new Map;for(const Fe of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[Je,Qe]of lr(Fe))l.set(Je,Qe);t.replaceChildren()}const{body:d}=Ur(t,n.frame),f=_m(r.labels,($t=n.horizontalAxis)==null?void 0:$t.range);if(f.length<r.labels.length){const Pe=f.map(Je=>r.labels[Je]),Fe=(r.series??[]).map(Je=>({...Je,values:f.map(Qe=>Je.values[Qe])}));r={labels:Pe,values:f.map(Je=>r.values[Je]),series:Fe}}const h=r.series??[],m=h.filter(Pe=>!Ua(Pe.name,n.seriesOverrides)),b=n.colors??H5,g=m.map(Pe=>Pe.name),v=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",_=g.filter(Pe=>va(Pe,x,v)==="direct"),C=n.legend!==!1&&!y,L=ar(d).width,O=350,$=n.legendPosition??"top",M=L>0&&L<O&&($==="left"||$==="right")?"top":$,D=n.legendAnchor??"start",N=n.stacked!==!1,k=n.stackPercent===!0||n.stackMode===bl.Percent,A=n.areaSortMode??Qt.None,B=n.areaLines!==!1,P=[...m];if(A!==Qt.None){const Pe=new Map(P.map(Fe=>[Fe.name,Fe.values.reduce((Je,Qe)=>Je+Qe,0)]));P.sort((Fe,Je)=>{const Qe=(Pe.get(Fe.name)??0)-(Pe.get(Je.name)??0);return A===Qt.Ascending?Qe:-Qe})}const F={labels:r.labels,values:r.values,series:P},z=k?a2(F):s2(F);let V=0;if(N)for(const Pe of z)for(const Fe of Pe)Fe[1]>V&&(V=Fe[1]);else for(const Pe of P)for(const Fe of Pe.values)Fe>V&&(V=Fe);k&&(V=100);const ie=ql([0,V],(Vt=n.verticalAxis)==null?void 0:Vt.range,(cn=n.verticalAxis)==null?void 0:cn.numberFormat,(Tt=n.verticalAxis)==null?void 0:Tt.scaleType),ce=Ci(L,(Rt=n.verticalAxis)==null?void 0:Rt.labelPosition,(en=n.horizontalAxis)==null?void 0:en.labelPosition,(kn=n.verticalAxis)==null?void 0:kn.direction,ie),he=_.length>0?M5(_):0,Z=ce.top!=null,oe=Math.max(0,L-(ce.left??50)-(ce.right??20)-he),se=C?Wa(g,M,oe):{width:0,height:0},re=C?se.height+10:0,U={...ce};if(C&&M==="top"){const Pe=Z?15:0;U.top=re+Pe}C&&M==="bottom"&&(U.bottom=(U.bottom??24)+re),C&&M==="left"&&(U.left=(U.left??50)+se.width+10),C&&M==="right"&&(U.right=(U.right??20)+se.width+10),he>0&&(U.right=(U.right??20)+he);const{chartArea:te,width:ne,height:ve,margin:me}=Gr(d,U),I=ki(c,me),W=gm().domain(r.labels).range([0,ne]).padding(n.edgePadding?.6:0),j=W,ue=Pe=>W(r.labels[Pe])??0,de=gn().domain([0,V]).nice().range([ve,0]);u.attach(te,I),u.update({vertical:{scale:de,height:ve,options:{...n.verticalAxis,gridWidth:ne,topPadding:me.top}},horizontal:{scale:j,height:ve,options:{...n.horizontalAxis,width:ne}}});const fe=`bc-clip-${Math.random().toString(36).slice(2,8)}`,pe=te.ownerSVGElement;(_e(pe).select("defs").empty()?_e(pe).append("defs"):_e(pe).select("defs")).append("clipPath").attr("id",fe).append("rect").attr("width",ne).attr("height",ve);const X=_e(te).append("g").attr("clip-path",`url(#${fe})`),ee=X.node(),we=Bl(n.interpolation??"monotoneX"),ge=z.map(Pe=>{const Fe=h.findIndex(Qe=>Qe.name===Pe.key);let Je;if(N)Je=Array.from(Pe).map(Qe=>[de(Qe[0]),de(Qe[1])]);else{const Qe=P.find(Bt=>Bt.name===Pe.key);Je=((Qe==null?void 0:Qe.values)??[]).map(Bt=>[de(0),de(Bt)])}return{name:Pe.key,points:Je,colorIndex:Fe>=0?Fe:0}}),be=new Set((n.highlights??[]).map(Pe=>Pe.target)),ye=be.size>0,Oe=n.areaFillOpacity!=null?n.areaFillOpacity:.85,ke=new Aee(_e(ee));if(ke.config({xPos:ue,colors:b,curve:we,areaFillOpacity:Oe,highlightTargets:be}),i.length>0||s.length>0){const Pe=(I==null?void 0:I.dx)??0,Fe=(I==null?void 0:I.dy)??0,Je=ee.querySelectorAll(":scope > g");Je[0]&&jn(Je[0],i,Pe,Fe),Je[1]&&jn(Je[1],s,Pe,Fe)}if(ke.draw(ge),_e(ee).selectAll(".bc-area").each(function(Pe){const Fe=Pe,Je=ln(Fe.name,Fe.colorIndex,b,v),Qe=o?_e(this).transition().duration(ut()):_e(this);Qe.attr("fill",Je),ye&&Qe.attr("opacity",be.has(Fe.name)?Oe:.3)}),B||_e(ee).selectAll(".bc-line").attr("display","none"),_e(ee).selectAll(".bc-line").each(function(Pe){const Fe=Pe,Je=ln(Fe.name,Fe.colorIndex,b,v),Qe=n2(Fe.name,n.interpolation??"monotoneX",v),Bt=o?_e(this).transition().duration(ut()):_e(this);if(Bt.attr("stroke",Je),ye&&Bt.attr("opacity",be.has(Fe.name)?1:.3),Qe!==(n.interpolation??"monotoneX")){const Zn=Bl(Qe),Po=bi().curve(Zn).x((Nn,Un)=>ue(Un)).y(Nn=>Nn[1]);Bt.attr("d",Po(Fe.points))}}),(ao=n.annotations)!=null&&ao.length){const Pe=r.labels.map((Fe,Je)=>{var Qe;return{label:Fe,value:((Qe=m[0])==null?void 0:Qe.values[Je])??0}});Mm(te,n.annotations,{scaleX:j,scaleY:de,data:Pe,width:ne,height:ve,backgroundColor:cr(t),transition:o,priorAnnotations:l})}if(n.tooltips||n.crosshair){const Pe=[];z.forEach(Fe=>{const Je=h.findIndex(Qe=>Qe.name===Fe.key);Array.from(Fe).forEach((Qe,Bt)=>{const Zn=Qe[1]-Qe[0];Pe.push({cx:ue(Bt),cy:de(Qe[1]),label:r.labels[Bt],value:Math.round(Zn*100)/100,series:Fe.key,color:ln(Fe.key,Je,b,v)})})}),Lm(te,{width:ne,height:ve,points:Pe,tooltip:n.tooltips,crosshair:n.crosshair,crosshairDirection:n.crosshairDirection,crosshairStyle:n.crosshairStyle,crosshairColor:n.crosshairColor,numberFormat:(ze=n.verticalAxis)==null?void 0:ze.numberFormat})}const Ae=r.labels.length-1,je=ue(Ae)+6,tt=[];if(m.forEach((Pe,Fe)=>{var Nn;if(va(Pe.name,x,v)!=="direct")return;const Qe=z.find(Un=>Un.key===Pe.name);if(!Qe)return;const Bt=Qe[Ae],Zn=de((Bt[0]+Bt[1])/2),Po=((Nn=v==null?void 0:v.find(Un=>Un.name===Pe.name))==null?void 0:Nn.labelText)||Pe.name;tt.push({name:Pe.name,index:Fe,naturalY:Zn,text:Po})}),tt.length>0){tt.sort((Qe,Bt)=>Qe.naturalY-Bt.naturalY);const Pe=tt.map(Qe=>Qe.naturalY),Je=i2(Pe,0,ve,14);tt.forEach((Qe,Bt)=>{_e(te).append("text").attr("class","bc-direct-label").attr("data-series",Qe.index).attr("x",je).attr("y",Je[Bt]).attr("dy","0.35em").attr("font-size","11px").attr("fill",ln(Qe.name,Qe.index,b,v)).text(Qe.text)})}const mt=g.filter(Pe=>va(Pe,x,v)==="legend");if(C&&mt.length>0){const Pe=mt.map(Qe=>{const Bt=h.findIndex(Zn=>Zn.name===Qe);return ln(Qe,Bt,b,v)});let Fe=0,Je=0;if(M==="top"){const Qe=Z?15:0;Je=-(se.height+5+Qe)}else M==="bottom"?Je=ve+25:M==="left"?Fe=-(se.width+10):M==="right"&&(Fe=ne+10);Fa(te,mt,Pe,Je,M,D,ne,ve,Fe,[],{left:me.left,right:me.right})}jr(t,{chartType:"area-stacked",margin:me}),a&&(Cr(X.node()),$r(t,a))}const W5=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"];class Tee extends so{initialize(){this.configDefine("x",{defaultValue:Sn()}),this.configDefine("y",{defaultValue:gn()}),this.configDefine("colors",{defaultValue:W5});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.seriesIndex).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(ut()).attr("data-series",s=>s.seriesIndex).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(ut()).attr("opacity",0).remove()}}})}}function Mee(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 Oee(t,e,n={},o=!1){var de,fe,pe,J,X,ee,we,ge;qr(o);let r=[],i=null,s,a;const l=Tr.for(t);if(o){const be=Yr(t);a=be==null?void 0:be.margin,l.detach(),(be==null?void 0:be.chartType)==="column-stacked"?r=Array.from(t.querySelectorAll(".bc-frame .bc-bar-stacked")):be&&(i=Ar(t)),s=new Map;for(const ye of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[Oe,ke]of lr(ye))s.set(Oe,ke);t.replaceChildren()}const{body:c}=Ur(t,n.frame),u=e.series??[],d=u.filter(be=>!Ua(be.name,n.seriesOverrides)),f=d.map(be=>be.name),h=n.colors??W5,m=n.seriesOverrides,b=n.legend!==!1,g=ar(c).width,v=350,y=n.legendPosition??"top",x=g>0&&g<v&&(y==="left"||y==="right")?"top":y,_=n.legendAnchor??"start",C={labels:e.labels,values:e.values,series:d},L=n.stackMode===bl.Percent,O=L?a2(C):s2(C),$=Mee(O,e.labels,u),M=L?100:Vd($,be=>be.y1)??0,N=ql([0,M],(de=n.verticalAxis)==null?void 0:de.range,(fe=n.verticalAxis)==null?void 0:fe.numberFormat,(pe=n.verticalAxis)==null?void 0:pe.scaleType),k=Ci(g,(J=n.verticalAxis)==null?void 0:J.labelPosition,(X=n.horizontalAxis)==null?void 0:X.labelPosition,(ee=n.verticalAxis)==null?void 0:ee.direction,N),A=Math.max(0,g-(k.left??50)-(k.right??20)),B=Ny(e.labels,A,n.horizontalAxis);B!==void 0&&(k.bottom=B);const P=k.top!=null,F=Math.max(0,g-(k.left??50)-(k.right??20)),z=b?Wa(f,x,F):{width:0,height:0},V=b?z.height+10:0,G={...k};if(b&&x==="top"){const be=P?15:0;G.top=V+be}b&&x==="bottom"&&(G.bottom=(G.bottom??24)+V),b&&x==="left"&&(G.left=(G.left??50)+z.width+10),b&&x==="right"&&(G.right=(G.right??20)+z.width+10);const{chartArea:ie,width:ce,height:he,margin:Z}=Gr(c,G),oe=ki(a,Z);let se=e.labels;if(n.sortMode==="total"){const be=e.labels.map((ye,Oe)=>({label:ye,index:Oe,total:d.reduce((ke,Ae)=>ke+(Ae.values[Oe]??0),0)}));be.sort((ye,Oe)=>Oe.total-ye.total),se=be.map(ye=>ye.label)}const re=Sn().domain(se).range([0,ce]).padding(jl(n.barGap)),U=gn().domain([0,M]).nice().range([he,0]);l.attach(ie,oe),l.update({vertical:{scale:U,height:he,options:{...n.verticalAxis,gridWidth:ce,topPadding:Z.top}},horizontal:{scale:re,height:he,options:{...n.horizontalAxis,width:ce}}});const te=`bc-clip-${Math.random().toString(36).slice(2,8)}`,ne=ie.ownerSVGElement;(_e(ne).select("defs").empty()?_e(ne).append("defs"):_e(ne).select("defs")).append("clipPath").attr("id",te).append("rect").attr("width",ce).attr("height",he);const me=_e(ie).append("g").attr("clip-path",`url(#${te})`),I=se===e.labels?$:se.flatMap(be=>$.filter(ye=>ye.label===be)),W=new Tee(me);if(W.config({x:re,y:U,colors:h}),r.length>0){const be=me.node().querySelector("g");jn(be,r,(oe==null?void 0:oe.dx)??0,(oe==null?void 0:oe.dy)??0)}if(n.tooltips&&W.use(Va({numberFormat:(we=n.verticalAxis)==null?void 0:we.numberFormat})),n.crosshair&&W.use(Xl({width:ce,height:he,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor})),(ge=n.annotations)!=null&&ge.length){const be=e.labels.map((ye,Oe)=>({label:ye,value:d.reduce((ke,Ae)=>ke+(Ae.values[Oe]??0),0)}));W.use(mu(n.annotations,{scaleX:re,scaleY:U,data:be,width:ce,height:he,backgroundColor:cr(t),transition:o,priorAnnotations:s}))}W.draw(I),jr(t,{chartType:"column-stacked",margin:Z}),i&&(Cr(me.node()),$r(t,i)),_e(ie).selectAll(".bc-bar-stacked").each(function(be){const ye=be,Oe=ln(ye.seriesName,ye.seriesIndex,h,m),ke=Sf(ye.seriesName,m),Ae=o?_e(this).transition().duration(ut()):_e(this);Ae.attr("fill",Oe),ke<1&&Ae.attr("fill-opacity",ke)});const j=n.valueLabels??!1,ue=_e(ie).append("g").attr("class","bc-value-labels");if(I.forEach(be=>{if(!xu(be.seriesName,j,m))return;const ye=(re(be.label)??0)+re.bandwidth()/2,Oe=U(be.y0)-(U(be.y0)-U(be.y1))/2;ue.append("text").attr("class","bc-value-label").attr("data-series",be.seriesIndex).attr("x",ye).attr("y",Oe).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size","11px").attr("fill","currentColor").text(L?`${Math.round(be.value)}%`:String(Math.round(be.value*100)/100))}),b&&f.length>0){const be=f.map(ke=>{const Ae=u.findIndex(je=>je.name===ke);return ln(ke,Ae,h,m)});let ye=0,Oe=0;if(x==="top"){const ke=P?15:0;Oe=-(z.height+5+ke)}else x==="bottom"?Oe=he+25:x==="left"?ye=-(z.width+10):x==="right"&&(ye=ce+10);Fa(ie,f,be,Oe,x,_,ce,he,ye,[],{left:Z.left,right:Z.right})}}const U5=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"],j8=13;class Bee extends so{initialize(){this.configDefine("x",{defaultValue:gn()}),this.configDefine("y",{defaultValue:Sn()}),this.configDefine("colors",{defaultValue:U5}),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.seriesIndex).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(ut()).attr("data-series",a=>a.seriesIndex).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(ut()).attr("opacity",0).remove()}}})}}function Lee(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 Pee(t,e,n={},o=!1){var X,ee,we,ge,be,ye,Oe;qr(o);let r=[],i=null,s,a;const l=Tr.for(t);if(o){const ke=Yr(t);a=ke==null?void 0:ke.margin,l.detach(),(ke==null?void 0:ke.chartType)==="bar-stacked"?r=Array.from(t.querySelectorAll(".bc-frame .bc-bar-stacked")):ke&&(i=Ar(t)),s=new Map;for(const Ae of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[je,tt]of lr(Ae))s.set(je,tt);t.replaceChildren()}const{body:c}=Ur(t,n.frame),u=e.series??[],d=u.filter(ke=>!Ua(ke.name,n.seriesOverrides)),f=d.map(ke=>ke.name),h=n.colors??U5,m=n.seriesOverrides,b=n.legend!==!1,g=ar(c).width,v=350,y=n.legendPosition??"top",x=g>0&&g<v&&(y==="left"||y==="right")?"top":y,_=n.legendAnchor??"start",C={labels:e.labels,values:e.values,series:d},L=n.stackMode===bl.Percent,O=L?a2(C):s2(C),$=Lee(O,e.labels,u),M=L?100:Vd($,ke=>ke.y1)??0,D=n.categoryLabelLine===!0,N=xm(e.labels),k=D?rn.Off:(X=n.verticalAxis)==null?void 0:X.labelPosition,A=Ci(g,k,(ee=n.horizontalAxis)==null?void 0:ee.labelPosition,(we=n.verticalAxis)==null?void 0:we.direction,N,(ge=n.horizontalAxis)==null?void 0:ge.showAxis),B=A.top!=null,P=Math.max(0,g-(A.left??50)-(A.right??20)),F=b?Wa(f,x,P):{width:0,height:0},z=b?F.height+10:0,V={...A};if(b&&x==="top"){const ke=B?15:0;V.top=z+ke}b&&x==="bottom"&&(V.bottom=(V.bottom??24)+z),b&&x==="left"&&(V.left=(V.left??50)+F.width+10),b&&x==="right"&&(V.right=(V.right??20)+F.width+10);const{chartArea:G,width:ie,height:ce,margin:he}=Gr(c,V),Z=ki(a,he);let oe=e.labels;if(n.sortMode==="total"){const ke=e.labels.map((Ae,je)=>({label:Ae,index:je,total:d.reduce((tt,mt)=>tt+(mt.values[je]??0),0)}));ke.sort((Ae,je)=>je.total-Ae.total),oe=ke.map(Ae=>Ae.label)}const se=gn().domain([0,M]).nice().range([0,ie]),re=Sn().domain(oe).range([0,ce]).padding(jl(n.barGap));l.attach(G,Z),l.update({horizontal:{scale:se,height:ce,options:{...n.horizontalAxis,width:ie}},vertical:{scale:re,height:ce,options:{...n.verticalAxis,labelPosition:D?rn.Off:(be=n.verticalAxis)==null?void 0:be.labelPosition,topPadding:he.top}},order:"horizontal-first"});const U=`bc-clip-${Math.random().toString(36).slice(2,8)}`,te=G.ownerSVGElement;(_e(te).select("defs").empty()?_e(te).append("defs"):_e(te).select("defs")).append("clipPath").attr("id",U).append("rect").attr("width",ie).attr("height",ce);const ve=_e(G).append("g").attr("clip-path",`url(#${U})`),me=oe===e.labels?$:oe.flatMap(ke=>$.filter(Ae=>Ae.label===ke)),I=D?j8:0,W=new Bee(ve);if(W.config({x:se,y:re,colors:h,categoryLabelOffset:I}),r.length>0){const ke=ve.node().querySelector("g");jn(ke,r,(Z==null?void 0:Z.dx)??0,(Z==null?void 0:Z.dy)??0)}if(n.tooltips&&W.use(Va({numberFormat:(ye=n.verticalAxis)==null?void 0:ye.numberFormat})),n.crosshair&&W.use(Xl({width:ie,height:ce,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor,orientation:Yn.Horizontal})),(Oe=n.annotations)!=null&&Oe.length){const ke=e.labels.map((Ae,je)=>({label:Ae,value:d.reduce((tt,mt)=>tt+(mt.values[je]??0),0)}));W.use(mu(n.annotations,{scaleX:re,scaleY:se,data:ke,width:ie,height:ce,backgroundColor:cr(t),orientation:Yn.Horizontal,transition:o,priorAnnotations:s}))}if(W.draw(me),jr(t,{chartType:"bar-stacked",margin:he}),i&&(Cr(ve.node()),$r(t,i)),_e(G).selectAll(".bc-bar-stacked").each(function(ke){const Ae=ke,je=ln(Ae.seriesName,Ae.seriesIndex,h,m),tt=Sf(Ae.seriesName,m),mt=o?_e(this).transition().duration(ut()):_e(this);mt.attr("fill",je),tt<1&&mt.attr("fill-opacity",tt)}),D){const ke=_e(G).append("g").attr("class","bc-category-labels");for(const Ae of oe){const je=re(Ae)??0;ke.append("text").attr("class","bc-category-label").attr("x",2).attr("y",je+j8/2).attr("text-anchor","start").attr("dominant-baseline","central").attr("font-size","10px").attr("font-weight","600").attr("fill","currentColor").text(Ae)}}const j=n.valueLabels??!1,ue=n.valueLabelPosition??yt.Auto,de=new Set,fe=new Map;for(const ke of oe){const Ae=me.filter(je=>je.label===ke).sort((je,tt)=>je.y1-tt.y1);if(Ae.length>0){const je=Ae[Ae.length-1];de.add(je.label+"\0"+je.seriesName);for(let tt=0;tt<Ae.length-1;tt++){const mt=Ae[tt].label+"\0"+Ae[tt].seriesName;fe.set(mt,se(Ae[tt+1].y1)-se(Ae[tt].y1))}}}const pe=new Map,J=_e(G).append("g").attr("class","bc-value-labels");if(me.forEach(ke=>{if(!xu(ke.seriesName,j,m))return;const Ae=L?`${Math.round(ke.value)}%`:String(Math.round(ke.value*100)/100),je=se(ke.y1)-se(ke.y0),tt=Ae.length*6.5+8,mt=je>=tt,$t=(re(ke.label)??0)+I+(re.bandwidth()-I)/2,Vt=ln(ke.seriesName,ke.seriesIndex,h,m),cn=de.has(ke.label+"\0"+ke.seriesName),Tt=ue===yt.Outside||ue===yt.Auto&&!mt&&cn,Rt=()=>{const en=se(ke.y0)+je/2;J.append("text").attr("class","bc-value-label").attr("data-series",ke.seriesIndex).attr("opacity",0).attr("x",en).attr("y",$t).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size","11px").attr("fill",Mo(Vt)).text(Ae)};if(Tt)if(ue===yt.Inside)Rt();else{const en=se(ke.y1)+4,kn=pe.get(ke.label)??0,ao=fe.get(ke.label+"\0"+ke.seriesName),ze=en<kn,Pe=ao!==void 0&&tt+4>ao;ze||Pe?Rt():(pe.set(ke.label,en+tt),J.append("text").attr("class","bc-value-label").attr("data-series",ke.seriesIndex).attr("x",en).attr("y",$t).attr("text-anchor","start").attr("dominant-baseline","central").attr("font-size","11px").attr("fill","currentColor").text(Ae))}else if(!mt)Rt();else{const en=se(ke.y0)+je/2;J.append("text").attr("class","bc-value-label").attr("data-series",ke.seriesIndex).attr("x",en).attr("y",$t).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size","11px").attr("fill",Mo(Vt)).text(Ae)}}),b&&f.length>0){const ke=f.map(tt=>{const mt=u.findIndex($t=>$t.name===tt);return ln(tt,mt,h,m)});let Ae=0,je=0;if(x==="top"){const tt=B?15:0;je=-(F.height+5+tt)}else x==="bottom"?je=ce+25:x==="left"?Ae=-(F.width+10):x==="right"&&(Ae=ie+10);Fa(G,f,ke,je,x,_,ie,ce,Ae,[],{left:he.left,right:he.right})}}const G5=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"],X8=16,uh=20,K8=13;class Dee extends so{initialize(){this.configDefine("y",{defaultValue:Sn()}),this.configDefine("colors",{defaultValue:G5}),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.seriesIndex).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(ut()).attr("data-series",s=>s.seriesIndex).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(ut()).attr("opacity",0).remove()}}})}}function Eee(t,e,n,o){const r=t.length;if(r===0)return[];const i=Math.max(0,(n-(r-1)*X8)/r),s=o?Vd(t.flatMap(a=>a.values))??0:0;return t.map((a,l)=>{const c=o?s:Vd(a.values)??0,u=gn().domain([0,c]).nice().range([0,i]);return{seriesName:a.name,seriesIndex:e.findIndex(d=>d.name===a.name),xOffset:l*(i+X8),panelWidth:i,xScale:u}})}function Iee(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 Ree(t,e,n={},o=!1){var I,W,j,ue,de,fe;qr(o);let r=[],i=null,s;const a=Tr.for(t);if(o){const pe=Yr(t);s=pe==null?void 0:pe.margin,a.detach(),(pe==null?void 0:pe.chartType)==="bar-split"?r=Array.from(t.querySelectorAll(".bc-frame .bc-bar-split")):pe&&(i=Ar(t)),t.replaceChildren()}const{body:l}=Ur(t,n.frame),c=e.series??[],u=c.filter(pe=>!Ua(pe.name,n.seriesOverrides)),d=u.map(pe=>pe.name),f=n.colors??G5,h=n.seriesOverrides,m=n.legend!==!1,b=ar(l).width,g=350,v=n.legendPosition??"top",y=b>0&&b<g&&(v==="left"||v==="right")?"top":v,x=n.legendAnchor??"start",_=n.categoryLabelLine===!0,C=xm(e.labels),L=_?rn.Off:(I=n.verticalAxis)==null?void 0:I.labelPosition,O=Ci(b,L,(W=n.horizontalAxis)==null?void 0:W.labelPosition,(j=n.verticalAxis)==null?void 0:j.direction,C,(ue=n.horizontalAxis)==null?void 0:ue.showAxis);O.top=(O.top??12)+uh;const $=Math.max(0,b-(O.left??50)-(O.right??20)),M=m?Wa(d,y,$):{width:0,height:0},D=m?M.height+10:0,N={...O};m&&y==="top"&&(N.top=D+uh),m&&y==="bottom"&&(N.bottom=(N.bottom??24)+D),m&&y==="left"&&(N.left=(N.left??50)+M.width+10),m&&y==="right"&&(N.right=(N.right??20)+M.width+10);const{chartArea:k,width:A,height:B,margin:P}=Gr(l,N),F=ki(s,P);let z=e.labels;if(n.sortMode==="total"){const pe=e.labels.map((J,X)=>({label:J,total:u.reduce((ee,we)=>ee+(we.values[X]??0),0)}));pe.sort((J,X)=>X.total-J.total),z=pe.map(J=>J.label)}const V=Sn().domain(z).range([0,B]).padding(jl(n.barGap)),G=_?K8:0;a.attach(k,F),a.update({vertical:{scale:V,height:B,options:{...n.verticalAxis,labelPosition:_?rn.Off:(de=n.verticalAxis)==null?void 0:de.labelPosition,topPadding:P.top}},order:"horizontal-first"});const ie=n.sharedScale===!0,ce=Eee(u,c,A,ie),he=`bc-clip-${Math.random().toString(36).slice(2,8)}`,Z=k.ownerSVGElement;(_e(Z).select("defs").empty()?_e(Z).append("defs"):_e(Z).select("defs")).append("clipPath").attr("id",he).append("rect").attr("width",A).attr("height",B);const se=_e(k).append("g").attr("clip-path",`url(#${he})`),re=_e(k).append("g").attr("class","bc-split-headers");for(const pe of ce)re.append("text").attr("class","bc-split-header").attr("x",pe.xOffset+pe.panelWidth/2).attr("y",-uh/2).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size","11px").attr("font-weight","600").attr("fill","currentColor").text(pe.seriesName);const U=Iee(ce,z,e.labels,c),te=new Dee(se);if(te.config({y:V,colors:f,categoryLabelOffset:G}),r.length>0){const pe=se.node().querySelector("g");jn(pe,r,(F==null?void 0:F.dx)??0,(F==null?void 0:F.dy)??0)}if(n.tooltips&&te.use(Va({numberFormat:(fe=n.verticalAxis)==null?void 0:fe.numberFormat})),n.crosshair&&te.use(Xl({width:A,height:B,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor,orientation:Yn.Horizontal})),te.draw(U),jr(t,{chartType:"bar-split",margin:P}),i&&(Cr(se.node()),$r(t,i)),_e(k).selectAll(".bc-bar-split").each(function(pe){const J=pe,X=ln(J.seriesName,J.seriesIndex,f,h),ee=Sf(J.seriesName,h),we=o?_e(this).transition().duration(ut()):_e(this);we.attr("fill",X),ee<1&&we.attr("fill-opacity",ee)}),_){const pe=_e(k).append("g").attr("class","bc-category-labels");for(const J of z){const X=V(J)??0;pe.append("text").attr("class","bc-category-label").attr("x",2).attr("y",X+K8/2).attr("text-anchor","start").attr("dominant-baseline","central").attr("font-size","10px").attr("font-weight","600").attr("fill","currentColor").text(J)}}const ne=n.valueLabels??!0,ve=n.valueLabelPosition??yt.Auto,me=_e(k).append("g").attr("class","bc-value-labels");if(U.forEach(pe=>{if(!xu(pe.seriesName,ne,h))return;const J=ce.find(Ae=>Ae.seriesName===pe.seriesName);if(!J)return;const X=ln(pe.seriesName,pe.seriesIndex,f,h),ee=pe.xPos+pe.barWidth,we=Math.max(0,V.bandwidth()-G),ge=(V(pe.label)??0)+G+we/2,be=ve===yt.Inside||ve===yt.Auto&&pe.barWidth>30;let ye,Oe,ke;if(be)ye=ee-4,Oe="end",ke=Mo(X);else{const Ae=ee+4,je=J.xOffset+J.panelWidth;Ae+20>je?(ye=pe.xPos-4,Oe="end"):(ye=Ae,Oe="start"),ke="currentColor"}me.append("text").attr("class","bc-value-label").attr("data-series",pe.seriesIndex).attr("x",ye).attr("y",ge).attr("text-anchor",Oe).attr("dominant-baseline","central").attr("font-size","11px").attr("fill",ke).text(String(pe.value))}),m&&d.length>0){const pe=d.map(ee=>{const we=c.findIndex(ge=>ge.name===ee);return ln(ee,we,f,h)});let J=0,X=0;y==="top"?X=-(M.height+5+uh):y==="bottom"?X=B+25:y==="left"?J=-(M.width+10):y==="right"&&(J=A+10),Fa(k,d,pe,X,y,x,A,B,J,[],{left:P.left,right:P.right})}}const N1=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"],Z8=13;class Nee extends so{initialize(){this.configDefine("x",{defaultValue:gn()}),this.configDefine("y0",{defaultValue:Sn()}),this.configDefine("y1",{defaultValue:Sn()}),this.configDefine("colors",{defaultValue:N1}),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.seriesIndex).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(ut()).attr("data-series",l=>l.seriesIndex).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(ut()).attr("opacity",0).remove()}}})}}function Fee(t,e,n={},o=!1){var W,j,ue,de,fe,pe;qr(o);let r=[],i=null,s;const a=Tr.for(t);if(o){const J=Yr(t);s=J==null?void 0:J.margin,a.detach(),(J==null?void 0:J.chartType)==="bar-grouped"?r=Array.from(t.querySelectorAll(".bc-frame .bc-bar-grouped")):J&&(i=Ar(t)),t.replaceChildren()}const{body:l}=Ur(t,n.frame),c=e.series??[],u=c.filter(J=>!Ua(J.name,n.seriesOverrides)),d=u.map(J=>J.name),f=n.colors??N1,h=n.seriesOverrides,m=n.legend!==!1,b=ar(l).width,g=350,v=n.legendPosition??"top",y=b>0&&b<g&&(v==="left"||v==="right")?"top":v,x=n.legendAnchor??"start",_=n.categoryLabelLine===!0,C=xm(e.labels),L=_?rn.Off:(W=n.verticalAxis)==null?void 0:W.labelPosition,O=Ci(b,L,(j=n.horizontalAxis)==null?void 0:j.labelPosition,(ue=n.verticalAxis)==null?void 0:ue.direction,C,(de=n.horizontalAxis)==null?void 0:de.showAxis),$=Math.max(0,b-(O.left??50)-(O.right??20)),M=m?Wa(d,y,$):{width:0,height:0},D=m?M.height+10:0,N={...O};m&&y==="top"&&(N.top=D),m&&y==="bottom"&&(N.bottom=(N.bottom??24)+D),m&&y==="left"&&(N.left=(N.left??50)+M.width+10),m&&y==="right"&&(N.right=(N.right??20)+M.width+10);const{chartArea:k,width:A,height:B,margin:P}=Gr(l,N),F=ki(s,P);let z=e.labels;if(n.sortMode==="total"){const J=e.labels.map((X,ee)=>({label:X,total:u.reduce((we,ge)=>we+(ge.values[ee]??0),0)}));J.sort((X,ee)=>ee.total-X.total),z=J.map(X=>X.label)}const V=Sn().domain(z).range([0,B]).paddingInner(jl(n.barGap)).paddingOuter(.05),G=_?Z8:0,ie=Math.max(0,V.bandwidth()-G),ce=Sn().domain(d).range([0,ie]).padding(.05),he=Vd(u.flatMap(J=>J.values))??0,Z=gn().domain([0,he]).nice().range([0,A]);a.attach(k,F),a.update({vertical:{scale:V,height:B,options:{...n.verticalAxis,labelPosition:_?rn.Off:(fe=n.verticalAxis)==null?void 0:fe.labelPosition,topPadding:P.top}},horizontal:{scale:Z,height:B,options:{...n.horizontalAxis,width:A}},order:"horizontal-first"});const oe=`bc-clip-${Math.random().toString(36).slice(2,8)}`,se=k.ownerSVGElement;(_e(se).select("defs").empty()?_e(se).append("defs"):_e(se).select("defs")).append("clipPath").attr("id",oe).append("rect").attr("width",A).attr("height",B);const U=_e(k).append("g").attr("clip-path",`url(#${oe})`);if(n.barBackground){const J=(n.colors??N1)[0];U.selectAll(".bc-bar-bg").data(z,X=>X).enter().append("rect").attr("class","bc-bar-bg").attr("x",0).attr("y",X=>(V(X)??0)+G).attr("width",A).attr("height",V.bandwidth()-G).attr("fill",J).attr("opacity",.18)}if(n.barSeparators&&z.length>1){const J=V.step();for(let X=1;X<z.length;X++){const ee=(V(z[X-1])??0)+V.bandwidth()+(J-V.bandwidth())/2;U.append("line").attr("class","bc-bar-separator").attr("x1",0).attr("x2",A).attr("y1",ee).attr("y2",ee).attr("stroke","currentColor").attr("opacity",.15)}}const te=[];for(const J of z){const X=e.labels.indexOf(J);for(const ee of u){const we=c.findIndex(ge=>ge.name===ee.name);te.push({label:J,seriesName:ee.name,seriesIndex:we,value:X>=0?ee.values[X]??0:0})}}const ne=new Nee(U);if(ne.config({x:Z,y0:V,y1:ce,colors:f,categoryLabelOffset:G}),r.length>0){const J=U.node().querySelector("g");jn(J,r,(F==null?void 0:F.dx)??0,(F==null?void 0:F.dy)??0)}if(n.tooltips&&ne.use(Va({numberFormat:(pe=n.verticalAxis)==null?void 0:pe.numberFormat})),n.crosshair&&ne.use(Xl({width:A,height:B,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor,orientation:Yn.Horizontal})),ne.draw(te),jr(t,{chartType:"bar-grouped",margin:P}),i&&(Cr(U.node()),$r(t,i)),_e(k).selectAll(".bc-bar-grouped").each(function(J){const X=J,ee=ln(X.seriesName,X.seriesIndex,f,h),we=Sf(X.seriesName,h),ge=o?_e(this).transition().duration(ut()):_e(this);ge.attr("fill",ee),we<1&&ge.attr("fill-opacity",we)}),_){const J=_e(k).append("g").attr("class","bc-category-labels");for(const X of z){const ee=V(X)??0;J.append("text").attr("class","bc-category-label").attr("x",2).attr("y",ee+Z8/2).attr("text-anchor","start").attr("dominant-baseline","central").attr("font-size","10px").attr("font-weight","600").attr("fill","currentColor").text(X)}}const ve=n.valueLabels??!0,me=n.valueLabelPosition??yt.Auto,I=_e(k).append("g").attr("class","bc-value-labels");if(te.forEach(J=>{if(!xu(J.seriesName,ve,h))return;const X=ln(J.seriesName,J.seriesIndex,f,h),ee=Math.max(0,Z(J.value)-Z(0)),we=Z(0)+ee,ge=(V(J.label)??0)+G+(ce(J.seriesName)??0)+ce.bandwidth()/2,be=me===yt.Inside||me===yt.Auto&&ee>30;let ye,Oe,ke;be?(ye=we-4,Oe="end",ke=Mo(X)):(ye=we+4,Oe="start",ke="currentColor"),I.append("text").attr("class","bc-value-label").attr("data-series",J.seriesIndex).attr("x",ye).attr("y",ge).attr("text-anchor",Oe).attr("dominant-baseline","central").attr("font-size","11px").attr("fill",ke).text(String(J.value))}),m&&d.length>0){const J=d.map(we=>{const ge=c.findIndex(be=>be.name===we);return ln(we,ge,f,h)});let X=0,ee=0;y==="top"?ee=-(M.height+5):y==="bottom"?ee=B+25:y==="left"?X=-(M.width+10):y==="right"&&(X=A+10),Fa(k,d,J,ee,y,x,A,B,X,[],{left:P.left,right:P.right})}}const l2=new Map;function Go(t,e,n){l2.set(t,{renderer:e,options:n})}function c2(t){var e;return(e=l2.get(t))==null?void 0:e.renderer}function Jc(t){var e;return((e=l2.get(t))==null?void 0:e.options)??[]}const Q8=[{value:Hn.Solid,text:"Solid"},{value:Hn.Dashed,text:"Dashed"},{value:Hn.Dotted,text:"Dotted"},{value:Hn.None,text:"None"}],qo={key:"colors",type:Ze.Colors,label:"Colors"},Yo={key:"colorPalette",type:Ze.Select,label:"Color palette",default:"Blueprint",choices:[{value:"",text:"Custom"},..._A().map(t=>({value:t.name,text:t.label}))]},jo={key:"autoContrast",type:Ze.Boolean,label:"Auto-adjust contrast",default:!1},Xo={key:"allowDarkMode",type:Ze.Boolean,label:"Allow dark mode",default:!0},wu={key:"legend",type:Ze.Boolean,label:"Show legend",default:!0},qs={key:"legendPosition",type:Ze.Select,label:"Legend position",default:hc.Top,choices:[{value:hc.Top,text:"Top"},{value:hc.Bottom,text:"Bottom"},{value:hc.Left,text:"Left"},{value:hc.Right,text:"Right"}]},Ys={key:"legendAnchor",type:Ze.Select,label:"Legend anchor",default:Ss.Start,choices:[{value:Ss.Start,text:"Start"},{value:Ss.Middle,text:"Middle"},{value:Ss.End,text:"End"}]},Pm={key:"directLabelling",type:Ze.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"}]},u2={key:"directLabelAnchor",type:Ze.Select,label:"Label anchor",default:Ss.Middle,choices:[{value:Ss.Start,text:"Start"},{value:Ss.Middle,text:"Middle"},{value:Ss.End,text:"End"}]},Dm={key:"valueLabels",type:Ze.Boolean,label:"Value labels",default:!1},Em={key:"valueLabelPosition",type:Ze.Select,label:"Label position",default:yt.Auto,choices:[{value:yt.Auto,text:"Auto"},{value:yt.Outside,text:"Outside"},{value:yt.Inside,text:"Inside"}]},js={key:"tooltips",type:Ze.Boolean,label:"Tooltips",default:!1},q5={key:"crosshair",type:Ze.Boolean,label:"Crosshair",default:!1},Y5={key:"crosshairDirection",type:Ze.Select,label:"Crosshair direction",default:ko.Both,choices:[{value:ko.Both,text:"Both"},{value:ko.Vertical,text:"Vertical"},{value:ko.Horizontal,text:"Horizontal"}]},j5={key:"crosshairStyle",type:Ze.Select,label:"Crosshair style",default:ri.Dashed,choices:[{value:ri.Solid,text:"Solid"},{value:ri.Dashed,text:"Dashed"},{value:ri.Dotted,text:"Dotted"}]},X5={key:"crosshairColor",type:Ze.Text,label:"Crosshair color",default:"#999",placeholder:"#999"},K5={key:"lineSymbols",type:Ze.Boolean,label:"Show line symbols",default:!1},Z5={key:"lineSymbolShape",type:Ze.Select,label:"Symbol",default:hr.Circle,choices:[{value:hr.Circle,text:"Circle"},{value:hr.Square,text:"Square"},{value:hr.Diamond,text:"Diamond"},{value:hr.Triangle,text:"Triangle Up"},{value:hr.TriangleDown,text:"Triangle Down"},{value:hr.Cross,text:"Cross"},{value:hr.Star,text:"Star"}]},Q5={key:"lineSymbolShowOn",type:Ze.Select,label:"Show on",default:mr.FirstLast,choices:[{value:mr.FirstLast,text:"First & Last"},{value:mr.First,text:"First"},{value:mr.Last,text:"Last"},{value:mr.All,text:"All"}]},J5={key:"lineSymbolStyle",type:Ze.Select,label:"Style",default:Fo.Filled,choices:[{value:Fo.Filled,text:"Filled"},{value:Fo.Hollow,text:"Hollow"}]},e$={key:"lineSymbolSize",type:Ze.Text,label:"Size",default:"3.5",placeholder:"3.5"},t$={key:"lineSymbolOpacity",type:Ze.Text,label:"Opacity",default:"1",placeholder:"1"},kf={key:"sortMode",type:Ze.Select,label:"Sort mode",default:mc.None,choices:[{value:mc.None,text:"None"},{value:mc.Total,text:"By total"},{value:mc.WithinGroups,text:"Within groups"}]},Im={key:"edgePadding",type:Ze.Boolean,label:"Edge padding",default:!1},Rm={key:"waterfall",type:Ze.Boolean,label:"Waterfall",default:!1},Nm={key:"waterfallTotal",type:Ze.Boolean,label:"Waterfall total",default:!1},Cf={key:"barBackground",type:Ze.Boolean,label:"Bar background",default:!1},Fm={key:"barGap",type:Ze.Text,label:"Bar gap",default:String(Yd),placeholder:String(Yd)},Af={key:"barSeparators",type:Ze.Boolean,label:"Bar separators",default:!1},Vm={key:"connectedColumns",type:Ze.Boolean,label:"Connected columns",default:!1},zm={key:"connectionsOpacity",type:Ze.Text,label:"Opacity",default:"0.15",placeholder:"0.15"},Hm={key:"swapLabelValue",type:Ze.Boolean,label:"Swap labels and values",default:!1},n$={key:"stackMode",type:Ze.Select,label:"Stack mode",default:bl.Normal,choices:[{value:bl.Normal,text:"Normal"},{value:bl.Percent,text:"Percentage (100%)"}]},Vee={key:"sharedScale",type:Ze.Boolean,label:"Shared scale",default:!1},Kl={key:"categoryLabelLine",type:Ze.Boolean,label:"Labels on separate line",default:!1},o$={key:"displayAsPercentage",type:Ze.Boolean,label:"Display as percentage",default:!1},r$={key:"showTotal",type:Ze.Boolean,label:"Show total",default:!1},i$={key:"showLabels",type:Ze.Boolean,label:"Show labels",default:!0},s$={key:"showValues",type:Ze.Boolean,label:"Show values",default:!0},a$={key:"sliceMax",type:Ze.Text,label:"Max slices",default:"6"},l$={key:"sliceGroupLabel",type:Ze.Text,label:"Group label",default:"Others",placeholder:"Others"},zee={key:"areaFillOpacity",type:Ze.Text,label:"Opacity",default:"0.85",placeholder:"0.85"},Hee={key:"stacked",type:Ze.Boolean,label:"Stack areas",default:!0},Wee={key:"stackPercent",type:Ze.Boolean,label:"Stack to 100%",default:!1},Uee={key:"areaLines",type:Ze.Boolean,label:"Separate areas with lines",default:!0},Gee={key:"areaSortMode",type:Ze.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"}]},qee={key:"interpolation",type:Ze.Select,label:"Line interpolation",default:Jr.Linear,choices:[{value:Jr.Linear,text:"Linear"},{value:Jr.MonotoneX,text:"Monotone"},{value:Jr.Step,text:"Step"},{value:Jr.StepBefore,text:"Step (before)"},{value:Jr.StepAfter,text:"Step (after)"},{value:Jr.Basis,text:"Basis"},{value:Jr.Cardinal,text:"Cardinal"},{value:Jr.CatmullRom,text:"Catmull-Rom"}]},J8=[{value:Hd.Linear,text:"Linear"},{value:Hd.Log,text:"Logarithmic"}],e6=[{value:rn.Auto,text:"Auto"},{value:rn.Inside,text:"Inside"},{value:rn.Outside,text:"Outside"},{value:rn.Off,text:"Off"}],Yee=[{value:bd.Auto,text:"Auto"},{value:bd.Horizontal,text:"Horizontal"},{value:bd.Vertical,text:"Vertical"}];function $f(t){return[{key:"showVerticalAxis",type:Ze.Boolean,label:"Show vertical axis",default:t.showVerticalAxis??!0},{key:"verticalAxisDirection",type:Ze.Select,label:"Vertical axis side",default:ei.Left,choices:[{value:ei.Left,text:"Left"},{value:ei.Right,text:"Right"}]},{key:"showVerticalTicks",type:Ze.Boolean,label:"Show vertical ticks",default:t.showVerticalTicks},{key:"verticalLabelPosition",type:Ze.Select,label:"Vertical labels",default:rn.Auto,choices:e6},{key:"verticalGridStyle",type:Ze.Select,label:"Vertical grid style",default:t.verticalGrid,choices:Q8},{key:"verticalNumberFormat",type:Ze.NumberFormat,label:"Vertical number format"},...t.valueAxis==="vertical"?[{key:"verticalScaleType",type:Ze.Select,label:"Vertical scale",default:Hd.Linear,choices:J8},t.valueAxisZeroBaseline?{key:"verticalRangeMin",type:Ze.Text,label:"Vertical min",default:"0",placeholder:"auto"}:{key:"verticalRangeMin",type:Ze.Text,label:"Vertical min",placeholder:"auto"},{key:"verticalRangeMax",type:Ze.Text,label:"Vertical max",placeholder:"auto"}]:[],{key:"showHorizontalAxis",type:Ze.Boolean,label:"Show horizontal axis",default:!0},{key:"showHorizontalTicks",type:Ze.Boolean,label:"Show horizontal ticks",default:t.showHorizontalTicks},{key:"horizontalLabelPosition",type:Ze.Select,label:"Horizontal labels",default:rn.Auto,choices:e6},{key:"horizontalLabelRotation",type:Ze.Select,label:"Horizontal label rotation",default:bd.Horizontal,choices:Yee},{key:"horizontalGridStyle",type:Ze.Select,label:"Horizontal grid style",default:t.horizontalGrid,choices:Q8},{key:"horizontalNumberFormat",type:Ze.NumberFormat,label:"Horizontal number format"},...t.valueAxis==="horizontal"?[{key:"horizontalScaleType",type:Ze.Select,label:"Horizontal scale",default:Hd.Linear,choices:J8},t.valueAxisZeroBaseline?{key:"horizontalRangeMin",type:Ze.Text,label:"Horizontal min",default:"0",placeholder:"auto"}:{key:"horizontalRangeMin",type:Ze.Text,label:"Horizontal min",placeholder:"auto"},{key:"horizontalRangeMax",type:Ze.Text,label:"Horizontal max",placeholder:"auto"}]:[],...t.horizontalRange?[{key:"horizontalRangeMin",type:Ze.Text,label:"Horizontal min",placeholder:"auto"},{key:"horizontalRangeMax",type:Ze.Text,label:"Horizontal max",placeholder:"auto"}]:[]]}const Wm=$f({verticalGrid:Hn.Dashed,horizontalGrid:Hn.None,showVerticalTicks:!1,showHorizontalTicks:!1,showVerticalAxis:!1,valueAxis:"vertical",valueAxisZeroBaseline:!0}),Tf=$f({verticalGrid:Hn.None,horizontalGrid:Hn.Dashed,showVerticalTicks:!1,showHorizontalTicks:!1,valueAxis:"horizontal",valueAxisZeroBaseline:!0}),c$=$f({verticalGrid:Hn.Dashed,horizontalGrid:Hn.None,showVerticalTicks:!1,showHorizontalTicks:!1,showVerticalAxis:!1,valueAxis:"vertical",horizontalRange:!0}),jee=$f({verticalGrid:Hn.Dashed,horizontalGrid:Hn.None,showVerticalTicks:!1,showHorizontalTicks:!1,showVerticalAxis:!1,valueAxis:"vertical",horizontalRange:!0,valueAxisZeroBaseline:!0}),Um={...qee,default:Jr.MonotoneX},Xee={...Y5,default:ko.Vertical},Kee={...q5,default:!0},Zee={...K5,default:!0},u$={...kf,default:mc.Total},d2={...Dm,default:!0},Qee={...o$,default:!0},Jee={...a$,default:"5"},ete={...r$,default:!0},Gm={...Pm,default:Co.Auto},qm={...wu,default:!1},Ym=[q5,Y5,j5,X5],f2=[Kee,Xee,j5,X5],jm=[Dm,Em,js,...Ym],h2=[d2,Em,js,...Ym],tte=[K5,Z5,Q5,J5,e$,t$],nte=[Zee,Z5,Q5,J5,e$,t$],d$=[Dm,js,...f2,...tte],ote=[Dm,js,...f2,...nte],rte=[Qee,r$,i$,s$,Jee,l$],ite=[o$,ete,i$,s$,a$,l$];Go(Be.BarVertical,$5,[qo,Yo,jo,Xo,Hm,Cf,Af,Fm,Vm,zm,Rm,Nm,Kl,...Wm,...jm]);Go(Be.BarHorizontal,T5,[qo,Yo,jo,Xo,Hm,Cf,Af,Fm,Vm,zm,Rm,Nm,Kl,...Tf,...h2]);Go(Be.BarMulti,ree,[qo,Yo,jo,Xo,u$,qm,Ys,qs,Gm,u2,...Wm,...jm]);Go(Be.Line,fee,[qo,Yo,jo,Xo,Um,Im,...c$,...d$]);Go(Be.LineMulti,gee,[qo,Yo,jo,Xo,Um,Im,kf,qm,Ys,qs,Gm,...c$,...ote]);Go(Be.Donut,_ee,[qo,Yo,jo,Xo,qm,Ys,qs,Gm,js,...ite]);Go(Be.Pie,See,[qo,Yo,jo,Xo,qm,Ys,qs,Gm,js,...rte]);Go(Be.Area,Cee,[qo,Yo,jo,Xo,Um,Im,...jee,...d$]);const ste=$f({verticalGrid:Hn.Dashed,horizontalGrid:Hn.None,showVerticalTicks:!1,showHorizontalTicks:!1,showVerticalAxis:!1,valueAxis:"vertical",horizontalRange:!0,valueAxisZeroBaseline:!0});Go(Be.AreaStacked,$ee,[qo,Yo,jo,Xo,zee,Um,Im,Gee,Hee,Wee,Uee,wu,Ys,qs,Pm,...ste,js,...f2]);Go(Be.ColumnStacked,Oee,[qo,Yo,jo,Xo,n$,kf,wu,Ys,qs,Pm,u2,...Wm,...jm]);Go(Be.BarStacked,Pee,[qo,Yo,jo,Xo,n$,kf,wu,Ys,qs,Pm,u2,Kl,...Tf,...h2]);Go(Be.BarSplit,Ree,[qo,Yo,jo,Xo,Vee,kf,wu,Ys,qs,Kl,...Tf,d2,Em,js,...Ym]);Go(Be.BarGrouped,Fee,[qo,Yo,jo,Xo,u$,wu,Ys,qs,Cf,Af,Kl,...Tf,d2,Em,js,...Ym]);Go(Be.VerticalBar,$5,[qo,Yo,jo,Xo,Hm,Cf,Af,Fm,Vm,zm,Rm,Nm,Kl,...Wm,...jm]);Go(Be.HorizontalBar,T5,[qo,Yo,jo,Xo,Hm,Cf,Af,Fm,Vm,zm,Rm,Nm,Kl,...Tf,...h2]);function Xs(t){var i,s;const e=t.split(`
|
|
80
|
+
`).map(a=>a.trim()).filter(Boolean),n=[],o=[],r=(i=e[0])==null?void 0:i.match(/^_series\s*=\s*(.+)$/);if(r){const a=r[1].trim(),l=a.includes('","')?a.split(",").map(d=>d.trim().replace(/^"|"$/g,"")):a.replace(/^"|"$/g,"").split(",").map(d=>d.trim()),c=l.map(()=>[]);for(let d=1;d<e.length;d++){const f=e[d].match(/^"([^"]+)"\s*=\s*([^"]+)$/),m=e[d].match(/^"([^"]+)"\s*=\s*"([^"]*)"$/)??f;if(m){n.push(m[1]);const b=m[2].split(",");for(let g=0;g<l.length;g++)c[g].push(Number.parseFloat(((s=b[g])==null?void 0:s.trim())??"")||0)}}const u=l.map((d,f)=>({name:d,values:c[f]}));return{labels:n,values:c[0]??[],series:u}}for(const a of e){const l=a.match(/^"([^"]+)"\s*=\s*(.+)$/);l&&(n.push(l[1]),o.push(Number.parseFloat(l[2])||0))}return{labels:n,values:o}}function ate(t,e){const n={},o=wA(t.colorPalette);return o?n.colors=o:t.colors&&t.colors.length>0&&(n.colors=t.colors),t.autoContrast&&e&&n.colors&&(n.colors=C5(n.colors,e)),t.allowDarkMode!==void 0&&(n.allowDarkMode=t.allowDarkMode),n}function lte(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 cte(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=qd(t.verticalRangeMin??""),r=qd(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 ute(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=qd(t.horizontalRangeMin??""),r=qd(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 dte(t){return t.lineSymbols?{lineSymbols:{symbol:t.lineSymbolShape??hr.Circle,showOn:t.lineSymbolShowOn??mr.FirstLast,style:t.lineSymbolStyle??Fo.Filled,size:parseFloat(t.lineSymbolSize??"3.5")||3.5,opacity:parseFloat(t.lineSymbolOpacity??"1")||1}}:{}}function Xm(t,e){const n={...ate(t,e),...lte(t),...cte(t),...ute(t),...dte(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 dv=Object.create(null);function f$(t){if(!dv[t]){const e={};for(const n of Jc(t))n.default!==void 0&&(e[n.key]=n.default);dv[t]=e}return dv[t]}function F1(t,e){var r;const n=f$(t);return((r=e.colors)==null?void 0:r.length)?{...n,colorPalette:void 0,...e}:{...n,...e}}const fte={protanopia:"Protanopia (no red)",deuteranopia:"Deuteranopia (no green)",tritanopia:"Tritanopia (no blue)"},h$={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 p$(t){return`bc-cvd-${t}`}function hte(t){const e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"filter");n.setAttribute("id",p$(t)),n.setAttribute("color-interpolation-filters","linearRGB");const o=document.createElementNS(e,"feColorMatrix");return o.setAttribute("type","matrix"),o.setAttribute("values",h$[t].join(" ")),n.appendChild(o),n}function pte(t){return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function fv(t){return t<=.0031308?12.92*t:1.055*t**(1/2.4)-.055}function mte(t,e){const[n,o,r]=ct(t).rgb().map(u=>pte(u/255)),i=h$[e],s=fv(i[0]*n+i[1]*o+i[2]*r),a=fv(i[5]*n+i[6]*o+i[7]*r),l=fv(i[10]*n+i[11]*o+i[12]*r),c=u=>Math.min(255,Math.max(0,Math.round(u*255)));return ct(c(s),c(a),c(l)).hex()}const gte=10;function vte(t){if(t.length<2)return[];const e=["protanopia","deuteranopia","tritanopia"],n=[];for(const o of e){const r=t.map(s=>mte(s,o)),i=[];for(let s=0;s<r.length;s++)for(let a=s+1;a<r.length;a++){const l=ct.deltaE(r[s],r[a]);l<gte&&i.push({a:t[s],b:t[a],deltaE:l})}i.length>0&&n.push({type:o,label:fte[o],pairs:i})}return n}function bte(t){const e={properties:[],data:null,colorizes:[],highlights:[],areaFills:[],annotations:[],series:[],scenes:[],transforms:[]};for(const n of t)switch(n.type){case"property":e.properties.push(n);break;case"data":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"series":e.series.push(n);break;case"scene":e.scenes.push(n);break;case"transform":e.transforms.push(n);break}return e}function yte(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":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 xte(t,e){function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n}function eu(t,e,n,o){var r=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(r,eu.prototype),r.expected=e,r.found=n,r.location=o,r.name="SyntaxError",r}xte(eu,Error);function hv(t,e,n){return n=n||" ",t.length>e?t:(e-=t.length,n+=n.repeat(e),t+n.slice(0,e))}eu.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=hv("",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+" | "+hv("",r.column-1," ")+hv("",d,"^")}else e+=`
|
|
85
|
+
at `+s}return e};eu.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 wte(t,e){e=e!==void 0?e:{};var n={},o=e.grammarSource,r={Chart:ix},i=ix,s="chart",a="{",l="}",c="data",u="=",d=",",f=" ",h="colorize",m="highlight",b="areafill",g="annotation",v="range",y="note",x="series",_="scene",C="step",L="transform",O="hide_annotation",$="hide_range",M="hide_note",D="show_annotation",N="show_range",k="show_note",A="%",B="-",P=".",F='"',z="\\",V="n",G="t",ie=/^[^\t\n\r{}=]/,ce=/^[a-zA-Z_#]/,he=/^[a-zA-Z0-9_#\-]/,Z=/^[0-9]/,oe=/^[^"\\]/,se=/^[ \t\n\r]/,re=Yt("chart",!1),U=Yt("{",!1),te=Yt("}",!1),ne=Yt("data",!1),ve=Yt("=",!1),me=Yt(",",!1),I=Yt(" ",!1),W=tc([" ",`
|
|
86
|
+
`,"\r","{","}","="],!0,!1),j=Yt("colorize",!1),ue=Yt("highlight",!1),de=Yt("areafill",!1),fe=Yt("annotation",!1),pe=Yt("range",!1),J=Yt("note",!1),X=Yt("series",!1),ee=Yt("scene",!1),we=Yt("step",!1),ge=Yt("transform",!1),be=Yt("hide_annotation",!1),ye=Yt("hide_range",!1),Oe=Yt("hide_note",!1),ke=Yt("show_annotation",!1),Ae=Yt("show_range",!1),je=Yt("show_note",!1),tt=Yt("%",!1),mt=Rf("identifier"),$t=tc([["a","z"],["A","Z"],"_","#"],!1,!1),Vt=tc([["a","z"],["A","Z"],["0","9"],"_","#","-"],!1,!1),cn=Yt("-",!1),Tt=tc([["0","9"]],!1,!1),Rt=Yt(".",!1),en=Rf("string"),kn=Yt('"',!1),ao=Yt("\\",!1),ze=tc(['"',"\\"],!0,!1),Pe=Yt("n",!1),Fe=Yt("t",!1),Je=YO(),Qe=Rf("whitespace"),Bt=tc([" "," ",`
|
|
87
|
+
`,"\r"],!1,!1),Zn=Rf("optional whitespace"),Po=function(E,q){const Ce=bte(q);return{type:"chart",chartType:E,properties:Ce.properties,data:Ce.data,colorizes:Ce.colorizes,highlights:Ce.highlights,areaFills:Ce.areaFills,annotations:Ce.annotations,series:Ce.series,scenes:Ce.scenes,transforms:Ce.transforms}},Nn=function(E){return E},Un=function(E){return{type:"data",entries:E}},Ti=function(E,q,Ce){return Ce},Ks=function(E,q,Ce){const Te=[q,...Ce];return{type:"property",key:E,value:Te[0].value,isPercentage:!1,values:Te.map(qe=>qe.value)}},Cu=function(E){return E},Au=function(E,q){return{type:"property",key:E,value:q.value,isPercentage:q.isPercentage}},We=function(E){return E.trim()},it=function(E,q){return{type:"colorize",target:E,properties:q}},Et=function(E,q){return{type:"colorize",target:E,properties:q}},Ht=function(E){return{type:"highlight",target:E}},Gn=function(E,q,Ce){return{type:"areafill",from:E,to:q,properties:Ce}},Qn=function(E,q){return{type:"annotation",kind:"point",target:E,properties:q}},Kr=function(E){return{type:"annotation",kind:"range",properties:E}},Ql=function(E){return{type:"annotation",kind:"free",properties:E}},Jl=function(E,q){return{type:"series",name:E,properties:q}},Zs=function(E,q){const Ce=yte(q);return{type:"scene",name:E??null,properties:Ce.properties,data:Ce.data,colorizes:Ce.colorizes,highlights:Ce.highlights,areaFills:Ce.areaFills,annotations:Ce.annotations,annotationVisibility:Ce.annotationVisibility,series:Ce.series,transforms:Ce.transforms}},dg=function(E,q){return{type:"transform",transformType:E,properties:q}},AO=function(E){return{type:"annotation-visibility",action:"hide",kind:"point",id:E}},$O=function(E){return{type:"annotation-visibility",action:"hide",kind:"range",id:E}},TO=function(E){return{type:"annotation-visibility",action:"hide",kind:"free",id:E}},MO=function(E){return{type:"annotation-visibility",action:"show",kind:"point",id:E}},OO=function(E){return{type:"annotation-visibility",action:"show",kind:"range",id:E}},BO=function(E){return{type:"annotation-visibility",action:"show",kind:"free",id:E}},LO=function(E){return E},PO=function(E){return E},DO=function(E,q){return{type:"property",key:E,value:q.value,isPercentage:q.isPercentage}},EO=function(E){return{value:E,isPercentage:!0}},IO=function(E){return{value:E,isPercentage:!1}},RO=function(E){return{value:E,isPercentage:!1}},NO=function(E){return{value:E,isPercentage:!1}},FO=function(E){return parseFloat(E)},VO=function(E){return E.join("")},zO=function(E){return E},HO=function(){return'"'},WO=function(){return"\\"},UO=function(){return`
|
|
88
|
+
`},GO=function(){return" "},qO=function(E){return E},Y=e.peg$currPos|0,ec=[{line:1,column:1}],Zr=Y,If=e.peg$maxFailExpected||[],Ve=e.peg$silentFails|0,$u;if(e.startRule){if(!(e.startRule in r))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');i=r[e.startRule]}function Yt(E,q){return{type:"literal",text:E,ignoreCase:q}}function tc(E,q,Ce){return{type:"class",parts:E,inverted:q,ignoreCase:Ce}}function YO(){return{type:"any"}}function jO(){return{type:"end"}}function Rf(E){return{type:"other",description:E}}function ox(E){var q=ec[E],Ce;if(q)return q;if(E>=ec.length)Ce=ec.length-1;else for(Ce=E;!ec[--Ce];);for(q=ec[Ce],q={line:q.line,column:q.column};Ce<E;)t.charCodeAt(Ce)===10?(q.line++,q.column=1):q.column++,Ce++;return ec[E]=q,q}function rx(E,q,Ce){var Te=ox(E),qe=ox(q),Ue={source:o,start:{offset:E,line:Te.line,column:Te.column},end:{offset:q,line:qe.line,column:qe.column}};return Ue}function Xe(E){Y<Zr||(Y>Zr&&(Zr=Y,If=[]),If.push(E))}function XO(E,q,Ce){return new eu(eu.buildMessage(E,q),E,q,Ce)}function ix(){var E,q,Ce,Te,qe,Ue,st,xt;if(E=Y,dt(),t.substr(Y,5)===s?(q=s,Y+=5):(q=n,Ve===0&&Xe(re)),q!==n)if(Ce=uo(),Ce!==n)if(Te=Ff(),Te!==n)if(dt(),t.charCodeAt(Y)===123?(qe=a,Y++):(qe=n,Ve===0&&Xe(U)),qe!==n){for(dt(),Ue=[],st=sx();st!==n;)Ue.push(st),st=sx();st=dt(),t.charCodeAt(Y)===125?(xt=l,Y++):(xt=n,Ve===0&&Xe(te)),xt!==n?(dt(),E=Po(Te,Ue)):(Y=E,E=n)}else Y=E,E=n;else Y=E,E=n;else Y=E,E=n;else Y=E,E=n;return E}function sx(){var E,q;return E=Y,dt(),q=ax(),q===n&&(q=ux(),q===n&&(q=dx(),q===n&&(q=fx(),q===n&&(q=px(),q===n&&(q=mx(),q===n&&(q=hx(),q===n&&(q=gx(),q===n&&(q=ZO(),q===n&&(q=vx(),q===n&&(q=Nf())))))))))),q!==n?(dt(),E=Nn(q)):(Y=E,E=n),E}function ax(){var E,q,Ce,Te,qe,Ue;if(E=Y,t.substr(Y,4)===c?(q=c,Y+=4):(q=n,Ve===0&&Xe(ne)),q!==n)if(dt(),t.charCodeAt(Y)===123?(Ce=a,Y++):(Ce=n,Ve===0&&Xe(U)),Ce!==n){for(dt(),Te=[],qe=cx(),qe===n&&(qe=lx());qe!==n;)Te.push(qe),qe=cx(),qe===n&&(qe=lx());qe=dt(),t.charCodeAt(Y)===125?(Ue=l,Y++):(Ue=n,Ve===0&&Xe(te)),Ue!==n?E=Un(Te):(Y=E,E=n)}else Y=E,E=n;else Y=E,E=n;return E}function lx(){var E,q,Ce,Te,qe,Ue,st,xt;if(E=Y,dt(),q=yx(),q!==n)if(dt(),t.charCodeAt(Y)===61?(Ce=u,Y++):(Ce=n,Ve===0&&Xe(ve)),Ce!==n)if(dt(),Te=Tu(),Te!==n){if(qe=[],Ue=Y,t.charCodeAt(Y)===44?(st=d,Y++):(st=n,Ve===0&&Xe(me)),st!==n?(dt(),xt=Tu(),xt!==n?Ue=Ti(q,Te,xt):(Y=Ue,Ue=n)):(Y=Ue,Ue=n),Ue!==n)for(;Ue!==n;)qe.push(Ue),Ue=Y,t.charCodeAt(Y)===44?(st=d,Y++):(st=n,Ve===0&&Xe(me)),st!==n?(dt(),xt=Tu(),xt!==n?Ue=Ti(q,Te,xt):(Y=Ue,Ue=n)):(Y=Ue,Ue=n);else qe=n;qe!==n?(Ue=dt(),E=Ks(q,Te,qe)):(Y=E,E=n)}else Y=E,E=n;else Y=E,E=n;else Y=E,E=n;return E===n&&(E=Y,dt(),q=Nf(),q!==n?(dt(),E=Cu(q)):(Y=E,E=n)),E}function cx(){var E,q,Ce,Te;return E=Y,dt(),q=KO(),q!==n?(t.charCodeAt(Y)===9?(Ce=f,Y++):(Ce=n,Ve===0&&Xe(I)),Ce!==n?(dt(),Te=Tu(),Te!==n?(dt(),E=Au(q,Te)):(Y=E,E=n)):(Y=E,E=n)):(Y=E,E=n),E}function KO(){var E,q,Ce,Te;if(E=Y,q=Y,Ce=[],Te=t.charAt(Y),ie.test(Te)?Y++:(Te=n,Ve===0&&Xe(W)),Te!==n)for(;Te!==n;)Ce.push(Te),Te=t.charAt(Y),ie.test(Te)?Y++:(Te=n,Ve===0&&Xe(W));else Ce=n;return Ce!==n?q=t.substring(q,Y):q=Ce,q!==n&&(q=We(q)),E=q,E}function ux(){var E,q,Ce,Te,qe,Ue,st,xt;if(E=Y,t.substr(Y,8)===h?(q=h,Y+=8):(q=n,Ve===0&&Xe(j)),q!==n)if(Ce=uo(),Ce!==n)if(Te=co(),Te!==n)if(dt(),t.charCodeAt(Y)===123?(qe=a,Y++):(qe=n,Ve===0&&Xe(U)),qe!==n){for(dt(),Ue=[],st=lo();st!==n;)Ue.push(st),st=lo();st=dt(),t.charCodeAt(Y)===125?(xt=l,Y++):(xt=n,Ve===0&&Xe(te)),xt!==n?E=it(Te,Ue):(Y=E,E=n)}else Y=E,E=n;else Y=E,E=n;else Y=E,E=n;else Y=E,E=n;return E}function dx(){var E,q,Ce,Te,qe,Ue,st,xt;if(E=Y,t.substr(Y,9)===m?(q=m,Y+=9):(q=n,Ve===0&&Xe(ue)),q!==n)if(Ce=uo(),Ce!==n)if(Te=co(),Te!==n)if(dt(),t.charCodeAt(Y)===123?(qe=a,Y++):(qe=n,Ve===0&&Xe(U)),qe!==n){for(dt(),Ue=[],st=lo();st!==n;)Ue.push(st),st=lo();st=dt(),t.charCodeAt(Y)===125?(xt=l,Y++):(xt=n,Ve===0&&Xe(te)),xt!==n?E=Et(Te,Ue):(Y=E,E=n)}else Y=E,E=n;else Y=E,E=n;else Y=E,E=n;else Y=E,E=n;return E===n&&(E=Y,t.substr(Y,9)===m?(q=m,Y+=9):(q=n,Ve===0&&Xe(ue)),q!==n?(Ce=uo(),Ce!==n?(Te=co(),Te!==n?E=Ht(Te):(Y=E,E=n)):(Y=E,E=n)):(Y=E,E=n)),E}function fx(){var E,q,Ce,Te,qe,Ue,st,xt,Do,fg;if(E=Y,t.substr(Y,8)===b?(q=b,Y+=8):(q=n,Ve===0&&Xe(de)),q!==n)if(Ce=uo(),Ce!==n)if(Te=co(),Te!==n)if(qe=uo(),qe!==n)if(Ue=co(),Ue!==n)if(dt(),t.charCodeAt(Y)===123?(st=a,Y++):(st=n,Ve===0&&Xe(U)),st!==n){for(dt(),xt=[],Do=lo();Do!==n;)xt.push(Do),Do=lo();Do=dt(),t.charCodeAt(Y)===125?(fg=l,Y++):(fg=n,Ve===0&&Xe(te)),fg!==n?E=Gn(Te,Ue,xt):(Y=E,E=n)}else Y=E,E=n;else Y=E,E=n;else Y=E,E=n;else Y=E,E=n;else Y=E,E=n;else Y=E,E=n;return E}function hx(){var E,q,Ce,Te,qe,Ue,st,xt;if(E=Y,t.substr(Y,10)===g?(q=g,Y+=10):(q=n,Ve===0&&Xe(fe)),q!==n)if(Ce=uo(),Ce!==n)if(Te=co(),Te!==n)if(dt(),t.charCodeAt(Y)===123?(qe=a,Y++):(qe=n,Ve===0&&Xe(U)),qe!==n){for(dt(),Ue=[],st=lo();st!==n;)Ue.push(st),st=lo();st=dt(),t.charCodeAt(Y)===125?(xt=l,Y++):(xt=n,Ve===0&&Xe(te)),xt!==n?E=Qn(Te,Ue):(Y=E,E=n)}else Y=E,E=n;else Y=E,E=n;else Y=E,E=n;else Y=E,E=n;return E}function px(){var E,q,Ce,Te,qe,Ue;if(E=Y,t.substr(Y,5)===v?(q=v,Y+=5):(q=n,Ve===0&&Xe(pe)),q!==n)if(dt(),t.charCodeAt(Y)===123?(Ce=a,Y++):(Ce=n,Ve===0&&Xe(U)),Ce!==n){for(dt(),Te=[],qe=lo();qe!==n;)Te.push(qe),qe=lo();qe=dt(),t.charCodeAt(Y)===125?(Ue=l,Y++):(Ue=n,Ve===0&&Xe(te)),Ue!==n?E=Kr(Te):(Y=E,E=n)}else Y=E,E=n;else Y=E,E=n;return E}function mx(){var E,q,Ce,Te,qe,Ue;if(E=Y,t.substr(Y,4)===y?(q=y,Y+=4):(q=n,Ve===0&&Xe(J)),q!==n)if(dt(),t.charCodeAt(Y)===123?(Ce=a,Y++):(Ce=n,Ve===0&&Xe(U)),Ce!==n){for(dt(),Te=[],qe=lo();qe!==n;)Te.push(qe),qe=lo();qe=dt(),t.charCodeAt(Y)===125?(Ue=l,Y++):(Ue=n,Ve===0&&Xe(te)),Ue!==n?E=Ql(Te):(Y=E,E=n)}else Y=E,E=n;else Y=E,E=n;return E}function gx(){var E,q,Ce,Te,qe,Ue,st,xt;if(E=Y,t.substr(Y,6)===x?(q=x,Y+=6):(q=n,Ve===0&&Xe(X)),q!==n)if(Ce=uo(),Ce!==n)if(Te=co(),Te!==n)if(dt(),t.charCodeAt(Y)===123?(qe=a,Y++):(qe=n,Ve===0&&Xe(U)),qe!==n){for(dt(),Ue=[],st=lo();st!==n;)Ue.push(st),st=lo();st=dt(),t.charCodeAt(Y)===125?(xt=l,Y++):(xt=n,Ve===0&&Xe(te)),xt!==n?E=Jl(Te,Ue):(Y=E,E=n)}else Y=E,E=n;else Y=E,E=n;else Y=E,E=n;else Y=E,E=n;return E}function ZO(){var E,q,Ce,Te,qe,Ue,st,xt;if(E=Y,t.substr(Y,5)===_?(q=_,Y+=5):(q=n,Ve===0&&Xe(ee)),q===n&&(t.substr(Y,4)===C?(q=C,Y+=4):(q=n,Ve===0&&Xe(we))),q!==n)if(Ce=uo(),Ce!==n)if(Te=co(),Te===n&&(Te=null),dt(),t.charCodeAt(Y)===123?(qe=a,Y++):(qe=n,Ve===0&&Xe(U)),qe!==n){for(dt(),Ue=[],st=bx();st!==n;)Ue.push(st),st=bx();st=dt(),t.charCodeAt(Y)===125?(xt=l,Y++):(xt=n,Ve===0&&Xe(te)),xt!==n?E=Zs(Te,Ue):(Y=E,E=n)}else Y=E,E=n;else Y=E,E=n;else Y=E,E=n;return E}function vx(){var E,q,Ce,Te,qe,Ue,st,xt;if(E=Y,t.substr(Y,9)===L?(q=L,Y+=9):(q=n,Ve===0&&Xe(ge)),q!==n)if(Ce=uo(),Ce!==n)if(Te=Ff(),Te!==n)if(dt(),t.charCodeAt(Y)===123?(qe=a,Y++):(qe=n,Ve===0&&Xe(U)),qe!==n){for(dt(),Ue=[],st=lo();st!==n;)Ue.push(st),st=lo();st=dt(),t.charCodeAt(Y)===125?(xt=l,Y++):(xt=n,Ve===0&&Xe(te)),xt!==n?E=dg(Te,Ue):(Y=E,E=n)}else Y=E,E=n;else Y=E,E=n;else Y=E,E=n;else Y=E,E=n;return E}function QO(){var E,q,Ce,Te;return E=Y,t.substr(Y,15)===O?(q=O,Y+=15):(q=n,Ve===0&&Xe(be)),q!==n?(Ce=uo(),Ce!==n?(Te=co(),Te!==n?E=AO(Te):(Y=E,E=n)):(Y=E,E=n)):(Y=E,E=n),E}function JO(){var E,q,Ce,Te;return E=Y,t.substr(Y,10)===$?(q=$,Y+=10):(q=n,Ve===0&&Xe(ye)),q!==n?(Ce=uo(),Ce!==n?(Te=co(),Te!==n?E=$O(Te):(Y=E,E=n)):(Y=E,E=n)):(Y=E,E=n),E}function eB(){var E,q,Ce,Te;return E=Y,t.substr(Y,9)===M?(q=M,Y+=9):(q=n,Ve===0&&Xe(Oe)),q!==n?(Ce=uo(),Ce!==n?(Te=co(),Te!==n?E=TO(Te):(Y=E,E=n)):(Y=E,E=n)):(Y=E,E=n),E}function tB(){var E,q,Ce,Te;return E=Y,t.substr(Y,15)===D?(q=D,Y+=15):(q=n,Ve===0&&Xe(ke)),q!==n?(Ce=uo(),Ce!==n?(Te=co(),Te!==n?E=MO(Te):(Y=E,E=n)):(Y=E,E=n)):(Y=E,E=n),E}function nB(){var E,q,Ce,Te;return E=Y,t.substr(Y,10)===N?(q=N,Y+=10):(q=n,Ve===0&&Xe(Ae)),q!==n?(Ce=uo(),Ce!==n?(Te=co(),Te!==n?E=OO(Te):(Y=E,E=n)):(Y=E,E=n)):(Y=E,E=n),E}function oB(){var E,q,Ce,Te;return E=Y,t.substr(Y,9)===k?(q=k,Y+=9):(q=n,Ve===0&&Xe(je)),q!==n?(Ce=uo(),Ce!==n?(Te=co(),Te!==n?E=BO(Te):(Y=E,E=n)):(Y=E,E=n)):(Y=E,E=n),E}function bx(){var E,q;return E=Y,dt(),q=ax(),q===n&&(q=ux(),q===n&&(q=dx(),q===n&&(q=fx(),q===n&&(q=px(),q===n&&(q=mx(),q===n&&(q=hx(),q===n&&(q=QO(),q===n&&(q=JO(),q===n&&(q=eB(),q===n&&(q=tB(),q===n&&(q=nB(),q===n&&(q=oB(),q===n&&(q=gx(),q===n&&(q=vx(),q===n&&(q=Nf()))))))))))))))),q!==n?(dt(),E=LO(q)):(Y=E,E=n),E}function lo(){var E,q;return E=Y,dt(),q=Nf(),q!==n?(dt(),E=PO(q)):(Y=E,E=n),E}function Nf(){var E,q,Ce,Te;return E=Y,q=yx(),q!==n?(dt(),t.charCodeAt(Y)===61?(Ce=u,Y++):(Ce=n,Ve===0&&Xe(ve)),Ce!==n?(dt(),Te=Tu(),Te!==n?E=DO(q,Te):(Y=E,E=n)):(Y=E,E=n)):(Y=E,E=n),E}function yx(){var E;return E=co(),E===n&&(E=Ff()),E}function Tu(){var E,q,Ce;return E=Y,q=xx(),q!==n?(t.charCodeAt(Y)===37?(Ce=A,Y++):(Ce=n,Ve===0&&Xe(tt)),Ce!==n?E=EO(q):(Y=E,E=n)):(Y=E,E=n),E===n&&(E=Y,q=xx(),q!==n&&(q=IO(q)),E=q,E===n&&(E=Y,q=co(),q!==n&&(q=RO(q)),E=q,E===n&&(E=Y,q=Ff(),q!==n&&(q=NO(q)),E=q))),E}function Ff(){var E,q,Ce,Te,qe;if(Ve++,E=Y,q=Y,Ce=t.charAt(Y),ce.test(Ce)?Y++:(Ce=n,Ve===0&&Xe($t)),Ce!==n){for(Te=[],qe=t.charAt(Y),he.test(qe)?Y++:(qe=n,Ve===0&&Xe(Vt));qe!==n;)Te.push(qe),qe=t.charAt(Y),he.test(qe)?Y++:(qe=n,Ve===0&&Xe(Vt));Ce=[Ce,Te],q=Ce}else Y=q,q=n;return q!==n?E=t.substring(E,Y):E=q,Ve--,E===n&&(q=n,Ve===0&&Xe(mt)),E}function xx(){var E,q,Ce,Te,qe,Ue,st,xt,Do;if(E=Y,q=Y,Ce=Y,t.charCodeAt(Y)===45?(Te=B,Y++):(Te=n,Ve===0&&Xe(cn)),Te===n&&(Te=null),qe=[],Ue=t.charAt(Y),Z.test(Ue)?Y++:(Ue=n,Ve===0&&Xe(Tt)),Ue!==n)for(;Ue!==n;)qe.push(Ue),Ue=t.charAt(Y),Z.test(Ue)?Y++:(Ue=n,Ve===0&&Xe(Tt));else qe=n;if(qe!==n){if(Ue=Y,t.charCodeAt(Y)===46?(st=P,Y++):(st=n,Ve===0&&Xe(Rt)),st!==n){if(xt=[],Do=t.charAt(Y),Z.test(Do)?Y++:(Do=n,Ve===0&&Xe(Tt)),Do!==n)for(;Do!==n;)xt.push(Do),Do=t.charAt(Y),Z.test(Do)?Y++:(Do=n,Ve===0&&Xe(Tt));else xt=n;xt!==n?(st=[st,xt],Ue=st):(Y=Ue,Ue=n)}else Y=Ue,Ue=n;Ue===n&&(Ue=null),Te=[Te,qe,Ue],Ce=Te}else Y=Ce,Ce=n;return Ce!==n?q=t.substring(q,Y):q=Ce,q!==n&&(q=FO(q)),E=q,E}function co(){var E,q,Ce,Te;if(Ve++,E=Y,t.charCodeAt(Y)===34?(q=F,Y++):(q=n,Ve===0&&Xe(kn)),q!==n){for(Ce=[],Te=wx();Te!==n;)Ce.push(Te),Te=wx();t.charCodeAt(Y)===34?(Te=F,Y++):(Te=n,Ve===0&&Xe(kn)),Te!==n?E=VO(Ce):(Y=E,E=n)}else Y=E,E=n;return Ve--,E===n&&(q=n,Ve===0&&Xe(en)),E}function wx(){var E,q,Ce;return E=Y,t.charCodeAt(Y)===92?(q=z,Y++):(q=n,Ve===0&&Xe(ao)),q!==n?(Ce=rB(),Ce!==n?E=zO(Ce):(Y=E,E=n)):(Y=E,E=n),E===n&&(E=t.charAt(Y),oe.test(E)?Y++:(E=n,Ve===0&&Xe(ze))),E}function rB(){var E,q;return E=Y,t.charCodeAt(Y)===34?(q=F,Y++):(q=n,Ve===0&&Xe(kn)),q!==n&&(q=HO()),E=q,E===n&&(E=Y,t.charCodeAt(Y)===92?(q=z,Y++):(q=n,Ve===0&&Xe(ao)),q!==n&&(q=WO()),E=q,E===n&&(E=Y,t.charCodeAt(Y)===110?(q=V,Y++):(q=n,Ve===0&&Xe(Pe)),q!==n&&(q=UO()),E=q,E===n&&(E=Y,t.charCodeAt(Y)===116?(q=G,Y++):(q=n,Ve===0&&Xe(Fe)),q!==n&&(q=GO()),E=q,E===n&&(E=Y,t.length>Y?(q=t.charAt(Y),Y++):(q=n,Ve===0&&Xe(Je)),q!==n&&(q=qO(q)),E=q)))),E}function uo(){var E,q;if(Ve++,E=[],q=t.charAt(Y),se.test(q)?Y++:(q=n,Ve===0&&Xe(Bt)),q!==n)for(;q!==n;)E.push(q),q=t.charAt(Y),se.test(q)?Y++:(q=n,Ve===0&&Xe(Bt));else E=n;return Ve--,E===n&&(q=n,Ve===0&&Xe(Qe)),E}function dt(){var E,q;for(Ve++,E=[],q=t.charAt(Y),se.test(q)?Y++:(q=n,Ve===0&&Xe(Bt));q!==n;)E.push(q),q=t.charAt(Y),se.test(q)?Y++:(q=n,Ve===0&&Xe(Bt));return Ve--,q=n,Ve===0&&Xe(Zn),E}if($u=i(),e.peg$library)return{peg$result:$u,peg$currPos:Y,peg$FAILED:n,peg$maxFailExpected:If,peg$maxFailPos:Zr};if($u!==n&&Y===t.length)return $u;throw $u!==n&&Y<t.length&&Xe(jO()),XO(If,Zr<t.length?t.charAt(Zr):null,Zr<t.length?rx(Zr,Zr+1):rx(Zr,Zr))}function Mf(t){try{return wte(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 Ma(t){return new Map(t.map(e=>[e.key,e.value]))}function p2(t,e){const n=Ma(e),o=Jc(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===Ze.Colors?i[s.key]=String(a).split(",").map(l=>l.trim()).filter(Boolean):s.type===Ze.Boolean?i[s.key]=a==="true"||a===!0:i[s.key]=String(a))}return i}function _te(t){return!(/^-?\d+(\.\d+)?$/.test(t)||/^-?\d+(\.\d+)?%$/.test(t)||/^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(t))}function Z0(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"&&_te(n)?`"${e.key}" = "${n}"`:`"${e.key}" = ${n}`}).join(`
|
|
89
|
+
`)}function m$(t,e){const n=Ma(t.properties),o=n.get("type"),r=o??e;return{name:t.name,chartType:o,properties:n,data:t.data,chartTypeOptions:p2(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 t6(t,e){const n=t.find(o=>o.key===e);return n?String(n.value):void 0}function n6(t,e){const n=t.find(o=>o.key===e);if(n)return n.isPercentage,n.value}function o6(t){const e=t.find(n=>n.key==="maxWidth");if(e)return e.isPercentage?`${e.value}%`:e.value}const ca=t=>t==="true"||t===!0;function Q0(t){return t.map(e=>({target:e.target,color:t6(e.properties,"color")??"#e15759",label:t6(e.properties,"label")}))}function J0(t){return t.map(e=>({target:e.target}))}function ep(t){return t.map(e=>{const n=Ma(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 tp(t){return t.map(e=>{const n=Ma(e.properties),o=e.kind??Pt.Point;if(o===Pt.Range){const a={kind:Pt.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===Pt.Free){const a={kind:Pt.Free,text:String(n.get("text")??""),x:n6(e.properties,"x")??0,y:n6(e.properties,"y")??0};n.has("id")&&(a.id=String(n.get("id"))),n.has("textColor")&&(a.textColor=String(n.get("textColor")));const l=o6(e.properties);return l!==void 0&&(a.maxWidth=l),n.has("textOutline")&&(a.textOutline=ca(n.get("textOutline"))),a}const r="target"in e?e.target:"",i={kind:Pt.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=o6(e.properties);return s!==void 0&&(i.maxWidth=s),n.has("textOutline")&&(i.textOutline=ca(n.get("textOutline"))),n.has("showLine")&&(i.showLine=ca(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=ca(n.get("showArrow"))),n.has("lineTargetDistance")&&(i.lineTargetDistance=Number(n.get("lineTargetDistance"))),n.has("showCircle")&&(i.showCircle=ca(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 np(t){return t.map(e=>{const n=Ma(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=ca(n.get("valueLabels"))),n.has("lineSymbols")&&(o.lineSymbols=ca(n.get("lineSymbols"))),n.has("hidden")&&(o.hidden=ca(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 Ste=`chart bar-vertical {
|
|
90
|
+
title = "E is the most frequent letter in English"
|
|
91
|
+
description = "How often each letter appears in typical English text"
|
|
92
|
+
byline = "Pierre Romera"
|
|
93
|
+
source = "Lewand, Cryptological Mathematics"
|
|
94
|
+
sourceUrl = "https://en.wikipedia.org/wiki/Letter_frequency"
|
|
95
|
+
note = "Based on analysis of 40,000 words from English prose"
|
|
96
|
+
colorPalette = "London"
|
|
97
|
+
sort = descending
|
|
98
|
+
valueLabels = true
|
|
99
|
+
verticalLabelPosition = off
|
|
100
|
+
verticalGridStyle = none
|
|
101
|
+
|
|
102
|
+
highlight "E"
|
|
103
|
+
|
|
104
|
+
data {
|
|
105
|
+
"E" = 12.70
|
|
106
|
+
"T" = 9.06
|
|
107
|
+
"A" = 8.17
|
|
108
|
+
"O" = 7.51
|
|
109
|
+
"I" = 6.97
|
|
110
|
+
"N" = 6.75
|
|
111
|
+
"S" = 6.33
|
|
112
|
+
"H" = 6.09
|
|
113
|
+
"R" = 5.99
|
|
114
|
+
"D" = 4.25
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
`,kte=`chart bar-vertical {
|
|
118
|
+
title = "China emits more CO₂ than the US and India combined"
|
|
119
|
+
description = "Annual emissions in billion tonnes, 2023"
|
|
120
|
+
source = "Global Carbon Project"
|
|
121
|
+
sourceUrl = "https://globalcarbonproject.org"
|
|
122
|
+
colorPalette = "Blueprint"
|
|
123
|
+
autoContrast = false
|
|
124
|
+
allowDarkMode = true
|
|
125
|
+
showVerticalAxis = false
|
|
126
|
+
verticalAxisDirection = "left"
|
|
127
|
+
showVerticalTicks = false
|
|
128
|
+
verticalLabelPosition = "off"
|
|
129
|
+
verticalGridStyle = "none"
|
|
130
|
+
verticalScaleType = "linear"
|
|
131
|
+
showHorizontalAxis = true
|
|
132
|
+
showHorizontalTicks = false
|
|
133
|
+
horizontalLabelPosition = "auto"
|
|
134
|
+
horizontalGridStyle = "none"
|
|
135
|
+
valueLabels = true
|
|
136
|
+
valueLabelPosition = "auto"
|
|
137
|
+
|
|
138
|
+
data {
|
|
139
|
+
"China" = 11.9
|
|
140
|
+
"United States" = 4.78
|
|
141
|
+
"India" = 2.88
|
|
142
|
+
"Russia" = 1.78
|
|
143
|
+
"Japan" = 1.02
|
|
144
|
+
"Germany" = 0.64
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
highlight "China"
|
|
148
|
+
|
|
149
|
+
annotation "India" {
|
|
150
|
+
text = "Surpassed EU in 2023"
|
|
151
|
+
showLine = true
|
|
152
|
+
anchorDirection = N
|
|
153
|
+
textOffsetX = 66
|
|
154
|
+
textOffsetY = -41
|
|
155
|
+
lineStyle = curve-left
|
|
156
|
+
showArrow = true
|
|
157
|
+
lineTargetDistance = 26
|
|
158
|
+
showCircle = false
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
`,Cte=`chart bar-horizontal {
|
|
162
|
+
title = "Mandarin has nearly twice as many native speakers as Spanish"
|
|
163
|
+
description = "Number of native speakers worldwide, in millions"
|
|
164
|
+
source = "Ethnologue"
|
|
165
|
+
sourceUrl = "https://ethnologue.com"
|
|
166
|
+
byline = "Pierre Romera"
|
|
167
|
+
sort = descending
|
|
168
|
+
colorPalette = "Blueprint"
|
|
169
|
+
horizontalLabelPosition = off
|
|
170
|
+
horizontalGridStyle = none
|
|
171
|
+
|
|
172
|
+
highlight "Mandarin"
|
|
173
|
+
|
|
174
|
+
data {
|
|
175
|
+
"Mandarin" = 920
|
|
176
|
+
"Spanish" = 475
|
|
177
|
+
"English" = 373
|
|
178
|
+
"Hindi" = 344
|
|
179
|
+
"Bengali" = 234
|
|
180
|
+
"Portuguese" = 232
|
|
181
|
+
"Russian" = 154
|
|
182
|
+
"Japanese" = 125
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
`,Ate=`chart bar-multi {
|
|
186
|
+
title = "Software overtakes hardware as the top revenue driver"
|
|
187
|
+
description = "USD billions"
|
|
188
|
+
byline = "Pierre Romera"
|
|
189
|
+
source = "Company filings"
|
|
190
|
+
note = "Figures are illustrative and do not represent actual company data"
|
|
191
|
+
legendPosition = "top"
|
|
192
|
+
tooltips = true
|
|
193
|
+
colorPalette = "Egypt"
|
|
194
|
+
|
|
195
|
+
data {
|
|
196
|
+
_series = "Hardware","Software","Services"
|
|
197
|
+
"Q1 2024" = 14.2,9.8,7.4
|
|
198
|
+
"Q2 2024" = 13.8,11.0,8.1
|
|
199
|
+
"Q3 2024" = 15.5,12.1,8.9
|
|
200
|
+
"Q4 2024" = 18.9,13.4,10.2
|
|
201
|
+
"Q1 2025" = 14.8,14.0,9.5
|
|
202
|
+
"Q2 2025" = 16.2,15.5,10.8
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
`,$te=`chart bar-multi {
|
|
206
|
+
title = "USA tops Paris 2024 with 126 medals across all categories"
|
|
207
|
+
description = "2024 Paris Summer Games — top six nations"
|
|
208
|
+
source = "Olympics.com"
|
|
209
|
+
sourceUrl = "https://olympics.com"
|
|
210
|
+
colors = "#eeca3b, #c0c0c0, #cd7f32"
|
|
211
|
+
legendPosition = "top"
|
|
212
|
+
valueLabels = true
|
|
213
|
+
verticalGridStyle = none
|
|
214
|
+
verticalLabelPosition = off
|
|
215
|
+
sort = descending
|
|
216
|
+
|
|
217
|
+
data {
|
|
218
|
+
_series = "Gold","Silver","Bronze"
|
|
219
|
+
"USA" = 40,44,42
|
|
220
|
+
"China" = 38,32,18
|
|
221
|
+
"Japan" = 27,14,17
|
|
222
|
+
"Great Britain" = 22,21,22
|
|
223
|
+
"Australia" = 17,7,22
|
|
224
|
+
"France" = 16,20,23
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
`,Tte=`chart line {
|
|
228
|
+
title = "2024 was the hottest year on record"
|
|
229
|
+
description = "Deviation from the 1951–1980 average, in °C"
|
|
230
|
+
source = "NASA GISS"
|
|
231
|
+
sourceUrl = "https://data.giss.nasa.gov/gistemp/"
|
|
232
|
+
colorPalette = "Blueprint"
|
|
233
|
+
autoContrast = false
|
|
234
|
+
allowDarkMode = true
|
|
235
|
+
interpolation = "monotoneX"
|
|
236
|
+
showVerticalAxis = false
|
|
237
|
+
verticalAxisDirection = "left"
|
|
238
|
+
showVerticalTicks = false
|
|
239
|
+
verticalLabelPosition = "auto"
|
|
240
|
+
verticalGridStyle = "dashed"
|
|
241
|
+
verticalScaleType = "linear"
|
|
242
|
+
showHorizontalAxis = true
|
|
243
|
+
showHorizontalTicks = false
|
|
244
|
+
horizontalLabelPosition = "auto"
|
|
245
|
+
horizontalGridStyle = "none"
|
|
246
|
+
valueLabels = false
|
|
247
|
+
tooltips = true
|
|
248
|
+
crosshair = false
|
|
249
|
+
crosshairDirection = "vertical"
|
|
250
|
+
crosshairStyle = "dashed"
|
|
251
|
+
crosshairColor = "#999"
|
|
252
|
+
lineSymbols = true
|
|
253
|
+
lineSymbolShape = "circle"
|
|
254
|
+
lineSymbolShowOn = "firstLast"
|
|
255
|
+
lineSymbolStyle = "filled"
|
|
256
|
+
lineSymbolSize = "3.5"
|
|
257
|
+
lineSymbolOpacity = "1"
|
|
258
|
+
|
|
259
|
+
data {
|
|
260
|
+
"1980" = 0.26
|
|
261
|
+
"1985" = 0.12
|
|
262
|
+
"1990" = 0.45
|
|
263
|
+
"1995" = 0.45
|
|
264
|
+
"2000" = 0.42
|
|
265
|
+
"2005" = 0.68
|
|
266
|
+
"2010" = 0.72
|
|
267
|
+
"2015" = 0.9
|
|
268
|
+
"2020" = 1.02
|
|
269
|
+
"2024" = 1.29
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
annotation "2015" {
|
|
273
|
+
id = "2o3cx"
|
|
274
|
+
text = "2015 Paris Agreement to limit global warming to 1.5°C "
|
|
275
|
+
maxWidth = 224
|
|
276
|
+
showLine = true
|
|
277
|
+
lineStyle = curve-right
|
|
278
|
+
showArrow = true
|
|
279
|
+
showCircle = true
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
`,Mte=`chart line-multi {
|
|
283
|
+
title = "Detroit's unemployment hit 16% during the Great Recession"
|
|
284
|
+
description = "Percent of labour force, 2000–2014"
|
|
285
|
+
source = "Bureau of Labor Statistics"
|
|
286
|
+
sourceUrl = "https://bls.gov"
|
|
287
|
+
note = "Not seasonally adjusted. Metro area definitions may vary across years."
|
|
288
|
+
colorPalette = "Maya"
|
|
289
|
+
legend = false
|
|
290
|
+
tooltips = true
|
|
291
|
+
crosshair = true
|
|
292
|
+
crosshairStyle = "dashed"
|
|
293
|
+
|
|
294
|
+
annotation "2009" {
|
|
295
|
+
text = "Great Recession peak"
|
|
296
|
+
dy = -10
|
|
297
|
+
showArrow = true
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
data {
|
|
301
|
+
_series = "New York","Los Angeles","Chicago","Detroit"
|
|
302
|
+
"2000" = 5.0,5.6,4.5,3.8
|
|
303
|
+
"2002" = 7.3,7.5,6.8,7.0
|
|
304
|
+
"2004" = 6.5,6.4,6.5,7.3
|
|
305
|
+
"2006" = 5.0,4.8,5.0,6.8
|
|
306
|
+
"2008" = 6.2,7.5,7.1,9.4
|
|
307
|
+
"2009" = 9.5,12.4,11.2,16.2
|
|
308
|
+
"2010" = 9.4,12.7,10.8,15.8
|
|
309
|
+
"2012" = 8.2,10.6,9.3,10.4
|
|
310
|
+
"2014" = 6.5,8.0,7.1,8.2
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
`,Ote=`chart pie {
|
|
314
|
+
title = "Asia is home to nearly 60% of the world's population"
|
|
315
|
+
description = "Estimated share, 2024"
|
|
316
|
+
source = "United Nations"
|
|
317
|
+
sourceUrl = "https://population.un.org"
|
|
318
|
+
colorPalette = "Klimt"
|
|
319
|
+
legendPosition = "right"
|
|
320
|
+
tooltips = true
|
|
321
|
+
|
|
322
|
+
data {
|
|
323
|
+
"Asia" = 59.4
|
|
324
|
+
"Africa" = 18.3
|
|
325
|
+
"Europe" = 9.3
|
|
326
|
+
"Latin America" = 8.2
|
|
327
|
+
"North America" = 4.8
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
`,Bte=`chart bar-vertical {
|
|
331
|
+
title = "Brazil produces more coffee than the next three countries combined"
|
|
332
|
+
description = "Million 60-kg bags, 2023/24 crop year"
|
|
333
|
+
source = "International Coffee Organization"
|
|
334
|
+
sourceUrl = "https://ico.org"
|
|
335
|
+
colorPalette = "Harvey"
|
|
336
|
+
autoContrast = false
|
|
337
|
+
allowDarkMode = true
|
|
338
|
+
showVerticalAxis = false
|
|
339
|
+
verticalAxisDirection = "left"
|
|
340
|
+
showVerticalTicks = false
|
|
341
|
+
verticalLabelPosition = "off"
|
|
342
|
+
verticalGridStyle = "none"
|
|
343
|
+
verticalScaleType = "linear"
|
|
344
|
+
showHorizontalAxis = true
|
|
345
|
+
showHorizontalTicks = false
|
|
346
|
+
horizontalLabelPosition = "auto"
|
|
347
|
+
horizontalGridStyle = "none"
|
|
348
|
+
valueLabels = true
|
|
349
|
+
valueLabelPosition = "auto"
|
|
350
|
+
tooltips = false
|
|
351
|
+
crosshair = false
|
|
352
|
+
crosshairDirection = "both"
|
|
353
|
+
crosshairStyle = "dashed"
|
|
354
|
+
crosshairColor = "#999"
|
|
355
|
+
|
|
356
|
+
data {
|
|
357
|
+
"Brazil" = 66.4
|
|
358
|
+
"Vietnam" = 29
|
|
359
|
+
"Colombia" = 11.4
|
|
360
|
+
"Indonesia" = 9.9
|
|
361
|
+
"Ethiopia" = 8.7
|
|
362
|
+
"Honduras" = 6.3
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
highlight "Brazil"
|
|
366
|
+
|
|
367
|
+
transform sort {
|
|
368
|
+
column = "value"
|
|
369
|
+
direction = descending
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
`,Lte=`chart donut {
|
|
373
|
+
title = "Chrome dominates with two-thirds of the desktop browser market"
|
|
374
|
+
description = "Worldwide, January 2025"
|
|
375
|
+
source = "StatCounter"
|
|
376
|
+
sourceUrl = "https://gs.statcounter.com"
|
|
377
|
+
colorPalette = "Heep"
|
|
378
|
+
legendPosition = "right"
|
|
379
|
+
tooltips = true
|
|
380
|
+
displayAsPercentage = true
|
|
381
|
+
|
|
382
|
+
data {
|
|
383
|
+
"Chrome" = 65.7
|
|
384
|
+
"Edge" = 13.1
|
|
385
|
+
"Safari" = 8.9
|
|
386
|
+
"Firefox" = 6.3
|
|
387
|
+
"Opera" = 3.1
|
|
388
|
+
"Others" = 2.9
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
`,Pte=`chart area {
|
|
392
|
+
title = "Apple stock climbed 36 % through 2024"
|
|
393
|
+
description = "Monthly closing price in USD"
|
|
394
|
+
source = "Yahoo Finance"
|
|
395
|
+
sourceUrl = "https://finance.yahoo.com"
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
data {
|
|
399
|
+
"Jan" = 183
|
|
400
|
+
"Feb" = 182
|
|
401
|
+
"Mar" = 171
|
|
402
|
+
"Apr" = 170
|
|
403
|
+
"May" = 192
|
|
404
|
+
"Jun" = 210
|
|
405
|
+
"Jul" = 222
|
|
406
|
+
"Aug" = 229
|
|
407
|
+
"Sep" = 233
|
|
408
|
+
"Oct" = 225
|
|
409
|
+
"Nov" = 237
|
|
410
|
+
"Dec" = 249
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
`,Dte=`chart area-stacked {
|
|
414
|
+
title = "Renewables rose from 18 % to 23 % of global energy since 2000"
|
|
415
|
+
description = "Share of primary energy by source, 2000–2023"
|
|
416
|
+
source = "Our World in Data"
|
|
417
|
+
sourceUrl = "https://ourworldindata.org/energy-mix"
|
|
418
|
+
stackPercent = true
|
|
419
|
+
areaSortMode = descending
|
|
420
|
+
areaFillOpacity = 0.85
|
|
421
|
+
|
|
422
|
+
data {
|
|
423
|
+
_series = "Coal","Oil","Gas","Renewables"
|
|
424
|
+
"2000" = 25,36,21,18
|
|
425
|
+
"2005" = 27,35,22,16
|
|
426
|
+
"2010" = 29,33,23,15
|
|
427
|
+
"2015" = 28,32,24,16
|
|
428
|
+
"2020" = 26,30,25,19
|
|
429
|
+
"2023" = 24,29,24,23
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
`,Ete=`chart column-stacked {
|
|
433
|
+
title = "Software revenue grew steadily while hardware spiked in Q4"
|
|
434
|
+
description = "Quarterly revenue in millions, 2024"
|
|
435
|
+
source = "Annual report"
|
|
436
|
+
|
|
437
|
+
data {
|
|
438
|
+
_series = "Hardware","Software","Services"
|
|
439
|
+
"Q1" = 120,85,45
|
|
440
|
+
"Q2" = 135,92,48
|
|
441
|
+
"Q3" = 128,98,52
|
|
442
|
+
"Q4" = 155,105,58
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
`,Ite=`chart bar-stacked {
|
|
446
|
+
title = "India's working-age population now surpasses China's"
|
|
447
|
+
description = "Millions of people, 2023"
|
|
448
|
+
source = "UN Population Division"
|
|
449
|
+
sourceUrl = "https://population.un.org"
|
|
450
|
+
horizontalGridStyle = none
|
|
451
|
+
horizontalLabelPosition = off
|
|
452
|
+
|
|
453
|
+
data {
|
|
454
|
+
_series = "0-14","15-64","65+"
|
|
455
|
+
"China" = 249,987,191
|
|
456
|
+
"India" = 365,948,100
|
|
457
|
+
"USA" = 60,215,58
|
|
458
|
+
"Indonesia" = 66,191,18
|
|
459
|
+
"Brazil" = 42,150,22
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
`,Rte=`chart area-stacked {
|
|
463
|
+
title = "EU subsidies to new members surged after enlargement"
|
|
464
|
+
description = "Agricultural subsidies to post-socialist EU members, million euros"
|
|
465
|
+
source = "Eurostat"
|
|
466
|
+
sourceUrl = "https://ec.europa.eu/eurostat"
|
|
467
|
+
verticalRangeMin = 0
|
|
468
|
+
interpolation = "linear"
|
|
469
|
+
heightMode = "aspect-ratio"
|
|
470
|
+
aspectRatio = "1:1"
|
|
471
|
+
|
|
472
|
+
data {
|
|
473
|
+
_series = "Indirect subsidies","Direct subsidies"
|
|
474
|
+
"2000" = 370,800
|
|
475
|
+
"2001" = 445,896
|
|
476
|
+
"2002" = 567,816
|
|
477
|
+
"2003" = 641,950
|
|
478
|
+
"2004" = 1908,2434
|
|
479
|
+
"2005" = 2234,3509
|
|
480
|
+
"2006" = 2576,4356
|
|
481
|
+
"2007" = 2467,5429
|
|
482
|
+
"2008" = 2672,6655
|
|
483
|
+
"2009" = 2474,7195
|
|
484
|
+
"2010" = 2117,8207
|
|
485
|
+
"2011" = 1863,9230
|
|
486
|
+
"2012" = 1528,9191
|
|
487
|
+
"2013" = 1251,10252
|
|
488
|
+
"2014" = 1132,10987
|
|
489
|
+
"2015" = 1687,10145
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
scene "Indirect subsidies shrank" {
|
|
493
|
+
title = "Indirect subsidies were cut under WTO pressure"
|
|
494
|
+
description = "Subsidies tied to specific crops fell foul of World Trade Organization rules"
|
|
495
|
+
|
|
496
|
+
highlight "Indirect subsidies"
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
scene "Direct subsidies dominate" {
|
|
500
|
+
title = "Direct per-hectare payments now dominate"
|
|
501
|
+
description = "The larger the fields, the more money farmers receive"
|
|
502
|
+
|
|
503
|
+
highlight "Direct subsidies"
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
scene "Bulgaria: subsidies explode" {
|
|
507
|
+
title = "Subsidies to Bulgarian farmers, million euros"
|
|
508
|
+
description = "85% of Bulgarian subsidies are direct payments — the highest share among new members"
|
|
509
|
+
|
|
510
|
+
data {
|
|
511
|
+
_series = "Indirect subsidies","Direct subsidies"
|
|
512
|
+
"2000" = 0,5
|
|
513
|
+
"2001" = 0,33
|
|
514
|
+
"2002" = 0,48
|
|
515
|
+
"2003" = 0,69
|
|
516
|
+
"2004" = 0,67
|
|
517
|
+
"2005" = 0,87
|
|
518
|
+
"2006" = 0,57
|
|
519
|
+
"2007" = 59,250
|
|
520
|
+
"2008" = 75,484
|
|
521
|
+
"2009" = 97,415
|
|
522
|
+
"2010" = 79,466
|
|
523
|
+
"2011" = 94,458
|
|
524
|
+
"2012" = 120,617
|
|
525
|
+
"2013" = 132,852
|
|
526
|
+
"2014" = 143,821
|
|
527
|
+
"2015" = 213,677
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
highlight "Direct subsidies"
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
scene "Bulgarian farms grew" {
|
|
534
|
+
title = "Average farm size in Bulgaria quadrupled"
|
|
535
|
+
description = "Average farm size in hectares"
|
|
536
|
+
type = line
|
|
537
|
+
|
|
538
|
+
data {
|
|
539
|
+
"2005" = 5
|
|
540
|
+
"2007" = 6
|
|
541
|
+
"2010" = 12
|
|
542
|
+
"2013" = 18
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
scene "Production rose" {
|
|
547
|
+
title = "Bulgarian farm production rose from 3 to 4 billion euros"
|
|
548
|
+
description = "Total production of Bulgarian farms, million euros"
|
|
549
|
+
type = area
|
|
550
|
+
|
|
551
|
+
data {
|
|
552
|
+
"2000" = 2933
|
|
553
|
+
"2001" = 3240
|
|
554
|
+
"2002" = 3051
|
|
555
|
+
"2003" = 2816
|
|
556
|
+
"2004" = 3049
|
|
557
|
+
"2005" = 3011
|
|
558
|
+
"2006" = 3111
|
|
559
|
+
"2007" = 3038
|
|
560
|
+
"2008" = 4148
|
|
561
|
+
"2009" = 3437
|
|
562
|
+
"2010" = 3486
|
|
563
|
+
"2011" = 4038
|
|
564
|
+
"2012" = 4161
|
|
565
|
+
"2013" = 4115
|
|
566
|
+
"2014" = 4138
|
|
567
|
+
"2015" = 3915
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
scene "Cash crops replaced vegetables" {
|
|
572
|
+
title = "Cash crops replaced vegetables in Bulgaria"
|
|
573
|
+
description = "Production of Bulgarian farms, million euros"
|
|
574
|
+
type = area-stacked
|
|
575
|
+
|
|
576
|
+
data {
|
|
577
|
+
_series = "Vegetables","Cash crops","Other production"
|
|
578
|
+
"2000" = 464,615,1854
|
|
579
|
+
"2001" = 458,777,2005
|
|
580
|
+
"2002" = 577,850,1624
|
|
581
|
+
"2003" = 539,818,1459
|
|
582
|
+
"2004" = 483,1103,1463
|
|
583
|
+
"2005" = 492,994,1525
|
|
584
|
+
"2006" = 510,1083,1518
|
|
585
|
+
"2007" = 436,936,1666
|
|
586
|
+
"2008" = 541,2045,1563
|
|
587
|
+
"2009" = 243,1553,1641
|
|
588
|
+
"2010" = 184,2173,1128
|
|
589
|
+
"2011" = 120,2853,1065
|
|
590
|
+
"2012" = 117,2900,1144
|
|
591
|
+
"2013" = 139,2802,1174
|
|
592
|
+
"2014" = 143,3082,914
|
|
593
|
+
"2015" = 144,2986,785
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
highlight "Cash crops"
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
scene "Vegetables collapsed" {
|
|
600
|
+
title = "Vegetable production fell by a factor of four"
|
|
601
|
+
description = "A traditional Bulgarian cultivation shrank as subsidies favoured large fields"
|
|
602
|
+
|
|
603
|
+
highlight "Vegetables"
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
scene "Every vegetable declined" {
|
|
607
|
+
title = "Bulgarian vegetable production collapsed across the board"
|
|
608
|
+
description = "Production volume indexed to 2001 = 100"
|
|
609
|
+
type = line-multi
|
|
610
|
+
lineSymbols = false
|
|
611
|
+
|
|
612
|
+
data {
|
|
613
|
+
_series = "Cabbages","Tomatoes","Watermelons","Carrots","Onions","Garlic","Strawberries"
|
|
614
|
+
"2001" = 100,100,100,100,100,100,100
|
|
615
|
+
"2002" = 79,90,124,64,106,95,100
|
|
616
|
+
"2003" = 100,157,177,142,118,98,72
|
|
617
|
+
"2004" = 84,87,83,245,124,138,74
|
|
618
|
+
"2005" = 50,46,62,30,40,93,42
|
|
619
|
+
"2006" = 52,78,113,95,56,80,56
|
|
620
|
+
"2007" = 36,49,64,74,29,30,38
|
|
621
|
+
"2008" = 47,49,66,97,44,29,55
|
|
622
|
+
"2009" = 28,38,74,105,23,39,55
|
|
623
|
+
"2010" = 57,42,51,76,53,57,37
|
|
624
|
+
"2011" = 32,38,56,86,47,43,45
|
|
625
|
+
"2012" = 34,34,46,69,29,43,31
|
|
626
|
+
"2013" = 33,43,53,39,36,40,24
|
|
627
|
+
"2014" = 31,44,28,69,37,8,27
|
|
628
|
+
"2015" = 31,45,50,57,25,18,32
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
scene "Jobs disappeared" {
|
|
633
|
+
title = "Seasonal farm workers vanished while salaried jobs held steady"
|
|
634
|
+
description = "EU agricultural employment, thousands of full-time equivalents"
|
|
635
|
+
type = line-multi
|
|
636
|
+
lineSymbols = false
|
|
637
|
+
|
|
638
|
+
data {
|
|
639
|
+
_series = "Salaried workers","Non-salaried workers"
|
|
640
|
+
"2000" = 2678,12194
|
|
641
|
+
"2001" = 2598,11586
|
|
642
|
+
"2002" = 2658,10795
|
|
643
|
+
"2003" = 2563,10609
|
|
644
|
+
"2004" = 2560,9999
|
|
645
|
+
"2005" = 2501,10047
|
|
646
|
+
"2006" = 2499,9782
|
|
647
|
+
"2007" = 2437,9231
|
|
648
|
+
"2008" = 2416,8971
|
|
649
|
+
"2009" = 2348,8672
|
|
650
|
+
"2010" = 2335,7808
|
|
651
|
+
"2011" = 2322,7551
|
|
652
|
+
"2012" = 2325,7501
|
|
653
|
+
"2013" = 2297,7425
|
|
654
|
+
"2014" = 2366,7183
|
|
655
|
+
"2015" = 2413,6928
|
|
656
|
+
"2016" = 2457,6741
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
highlight "Non-salaried workers"
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
`,Nte=`chart bar-split {
|
|
663
|
+
title = "CDU/CSU led German polls at 29 % ahead of the 2021 election"
|
|
664
|
+
description = "How Germany would vote in the September 2021 federal election, according to polling in the previous June"
|
|
665
|
+
source = "FG Wahlen"
|
|
666
|
+
sourceUrl = "https://www.forschungsgruppe.de"
|
|
667
|
+
note = "Margin of error at 10%: +/- 2 percentage points; at 40%: +/- 3 percentage points"
|
|
668
|
+
valueLabels = true
|
|
669
|
+
|
|
670
|
+
data {
|
|
671
|
+
_series = "Poll","High","Low"
|
|
672
|
+
"CDU/CSU" = 29,32,27
|
|
673
|
+
"Greens" = 22,25,20
|
|
674
|
+
"SPD" = 14,16,12
|
|
675
|
+
"AfD" = 10,12,8
|
|
676
|
+
"FDP" = 10,12,8
|
|
677
|
+
"Left" = 7,9,5
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
`,Fte=`chart bar-grouped {
|
|
681
|
+
title = "Asia Pacific holds more renewable capacity than all other regions combined"
|
|
682
|
+
description = "Installed capacity in gigawatts (GW)"
|
|
683
|
+
source = "IRENA"
|
|
684
|
+
sourceUrl = "https://www.irena.org"
|
|
685
|
+
valueLabels = true
|
|
686
|
+
|
|
687
|
+
data {
|
|
688
|
+
_series = "Solar","Wind","Hydro"
|
|
689
|
+
"Asia Pacific" = 680,540,840
|
|
690
|
+
"Europe" = 250,300,200
|
|
691
|
+
"North America" = 200,180,190
|
|
692
|
+
"Latin America" = 30,50,200
|
|
693
|
+
"Africa" = 15,10,40
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
`;function r6(t,e){const n=t.properties.find(o=>o.key===e);return n?String(n.value):""}function Vte(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(`
|
|
697
|
+
`)}const o=["label","value"].join(" "),r=e.map(i=>[i.key,String(i.value)].join(" "));return[o,...r].join(`
|
|
698
|
+
`)}function zte(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(`
|
|
699
|
+
`)}return e.map(o=>`"${o.key}" = ${String(o.value)}`).join(`
|
|
700
|
+
`)}function Jn(t,e){const n=Mf(e);return{id:t,title:r6(n,"title"),description:r6(n,"description"),chartType:n.chartType,tsvData:Vte(n),serializedData:zte(n),dsl:e}}const i6=[Jn("letter-frequency",Ste),Jn("co2-emissions",kte),Jn("coffee-production",Bte),Jn("spoken-languages",Cte),Jn("quarterly-revenue",Ate),Jn("medal-count",$te),Jn("temperature-anomaly",Tte),Jn("unemployment-rates",Mte),Jn("browser-market",Lte),Jn("world-population",Ote),Jn("stock-price-area",Pte),Jn("energy-mix-stacked-area",Dte),Jn("quarterly-stacked-columns",Ete),Jn("population-stacked-bar",Ite),Jn("election-polls",Nte),Jn("renewable-capacity",Fte),Jn("farm-compass",Rte)],s6="abcdefghijklmnopqrstuvwxyz0123456789";function Hte(){let t="";for(let e=0;e<8;e++)t+=s6[Math.floor(Math.random()*s6.length)];return t}const Wte=Bo("scenes",()=>{const t=Ie([]),e=De(-1),n=De(!1);let o=null;const r=S(()=>e.value<0||e.value>=t.value.length?null:t.value[e.value]);function i(){const v=Hte();return t.value.push({id:v,name:null}),v}function s(v){v<0||v>=t.value.length||(t.value.splice(v,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(v,y){v<0||v>=t.value.length||(t.value[v]={...t.value[v],...y})}function l(v){v!==e.value&&(v===-1||v>=0&&v<t.value.length)&&(e.value=v)}function c(){l(e.value+1)}function u(){l(e.value-1)}function d(v,y){if(v<0||v>=t.value.length||y<0||y>=t.value.length)return;const[x]=t.value.splice(v,1);t.value.splice(y,0,x),e.value===v?e.value=y:v<e.value&&y>=e.value?e.value--:v>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 m(){h(),t.value=[],e.value=-1}function b(){return{scenes:t.value.map(v=>({...v})),activeIndex:e.value}}function g(v){h(),t.value=v.scenes.map(y=>({...y})),e.value=v.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:m,snapshot:b,hydrate:g}});function bn(){const t=Wte(),{scenes:e,activeIndex:n,playing:o,activeScene:r}=At(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 op(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)=>op(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=>op(t[r],e[r]))}return!1}function g$(t){return!(t===void 0||Array.isArray(t)&&t.length===0)}function a6(t,e,n,o){for(let r=o-1;r>=0;r--){const i=n[r];if(i&&e in i&&g$(i[e]))return i[e]}return t}function l6(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 Zd={sizing:"max-width",fixedWidth:600,maxWidth:660,heightMode:"auto",fixedHeight:400,aspectRatio:"16:9",padding:16,transparentBackground:!1,showCredit:!0,playerType:"buttons",playerPosition:"left"},c6={chartType:Be.BarVertical,title:"",description:"",byline:"",source:"",sourceUrl:"",note:"",sort:Qt.None,sortMode:"none",data:"",selectedColumn:"",colorizes:[],highlights:[],areaFills:[],annotations:[],seriesOverrides:[],layout:{...Zd}};function Ja(t,e){return S({get(){const{activeScene:n,activeIndex:o,scenes:r}=bn(),i=n.value;return i&&e in i&&g$(i[e])?i[e]:o.value>=0?a6(t.value,e,r.value,o.value):t.value},set(n){const{activeIndex:o,activeScene:r,update:i,scenes:s}=bn();if(o.value>=0&&r.value){const a=a6(t.value,e,s.value,o.value);if(op(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 ea(t,e){return S({get(){const{activeScene:n,activeIndex:o,scenes:r}=bn(),i=n.value;return i!=null&&i.properties&&e in i.properties?String(i.properties[e]):o.value>=0?l6(t.value,e,r.value,o.value):t.value},set(n){const{activeIndex:o,activeScene:r,update:i,scenes:s}=bn();if(o.value>=0&&r.value){const a=l6(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 Ute=Bo("chartConfig",()=>{const t=sr({...c6}),e=Rp(t),n=Ja(e.chartType,"chartType"),o=Ja(e.data,"data"),r=Ja(e.colorizes,"colorizes"),i=Ja(e.highlights,"highlights"),s=Ja(e.areaFills,"areaFills"),a=Ja(e.annotations,"annotations"),l=Ja(e.seriesOverrides,"seriesOverrides"),c=ea(e.title,"title"),u=ea(e.description,"description"),d=ea(e.byline,"byline"),f=ea(e.source,"source"),h=ea(e.sourceUrl,"sourceUrl"),m=ea(e.note,"note"),b=ea(e.sort,"sort"),g=ea(e.sortMode,"sortMode");function v(){Object.assign(t,{...c6,colorizes:[],highlights:[],areaFills:[],annotations:[],seriesOverrides:[],layout:{...Zd}})}function y(x){Object.assign(t,{...x,layout:{...Zd,...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:m,sort:b,sortMode:g,layout:e.layout,selectedColumn:e.selectedColumn,_base:$e(e),reset:v,hydrate:y}});function hn(){const t=Ute(),e=At(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}}const Gte=Bo("theme",()=>{const t=De("light"),e=F4("(prefers-color-scheme: dark)"),n=S(()=>t.value==="dark"||t.value==="auto"&&e.value?"dark":"light");He(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 _u(){const t=Gte(),{theme:e,resolvedTheme:n}=At(t);return{theme:e,resolvedTheme:n,cycleTheme:t.cycleTheme}}function qte(){return typeof navigator>"u"?!1:/Mac|iPhone|iPod|iPad/i.test(navigator.platform)}function v$(t){const e=t.toUpperCase(),n=qte(),o=n?`⌘ ${e}`:`Ctrl ${e}`,r=n?`Meta+${e}`:`Control+${e}`;function i(s){return s.key.toLowerCase()!==t.toLowerCase()?!1:n?s.metaKey&&!s.ctrlKey:s.ctrlKey&&!s.metaKey}return{keyLabel:o,keys:r,matches:i}}const Yte={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function jte(t,e){return w(),R("svg",Yte,[...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 Xte=$e({name:"ph-sun",render:jte}),Kte={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Zte(t,e){return w(),R("svg",Kte,[...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 Qte=$e({name:"ph-moon",render:Zte}),Jte={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function ene(t,e){return w(),R("svg",Jte,[...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 tne=$e({name:"ph-circle-half",render:ene}),nne={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function one(t,e){return w(),R("svg",nne,[...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 b$=$e({name:"ph-list",render:one}),y$="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",x$="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",rne={class:"layout-navbar"},ine={class:"layout-navbar__lead d-xl-none"},sne={key:0,class:"layout-navbar__crumbs","aria-label":"Breadcrumb"},ane=["aria-current"],lne={key:2,class:"layout-navbar__crumb-sep","aria-hidden":"true"},cne=le({__name:"LayoutNavbar",props:{sidebarOpen:{type:Boolean}},emits:["searchClick","toggleSidebar"],setup(t){const e=zl(),n=hn(),{theme:o,cycleTheme:r,resolvedTheme:i}=_u(),{isNarrow:s}=Wl(),a=v$("k"),l={light:Xte,dark:Qte,auto:tne},c=S(()=>l[o.value]),u=S(()=>s.value?"Search…":"Search or jump to…"),d=S(()=>i.value==="dark"?x$:y$),f=S(()=>{const h=e.path;if(h.startsWith("/edit/")){const m=n._base.title.value||"Untitled";return[{label:"My Charts",to:"/charts"},{label:m}]}return h.startsWith("/charts")?[{label:"My Charts"}]:h==="/new"?[{label:"My Charts",to:"/charts"},{label:"New chart"}]:[]});return(h,m)=>{const b=Up("router-link");return w(),R("header",rne,[T("div",ine,[H(p(Rn),{"icon-left":p(b$),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:m[0]||(m[0]=g=>h.$emit("toggleSidebar"))},null,8,["icon-left","aria-expanded"]),H(p(gC),{name:"Blueprint Chart","logo-src":d.value,"hide-name":"",to:"/"},null,8,["logo-src"])]),f.value.length?(w(),R("nav",sne,[(w(!0),R(Ne,null,gt(f.value,(g,v)=>(w(),R(Ne,{key:v},[g.to?(w(),K(b,{key:0,to:g.to,class:"layout-navbar__crumb"},{default:Q(()=>[Ge(xe(g.label),1)]),_:2},1032,["to"])):(w(),R("span",{key:1,class:"layout-navbar__crumb layout-navbar__crumb--active","aria-current":v===f.value.length-1?"page":void 0},xe(g.label),9,ane)),v<f.value.length-1?(w(),R("span",lne,"/")):ae("",!0)],64))),128))])):ae("",!0),m[2]||(m[2]=T("div",{class:"layout-navbar__spacer"},null,-1)),H(p(CW),{placeholder:u.value,"shortcut-label":p(a).keyLabel,class:"layout-navbar__search",onClick:m[1]||(m[1]=g=>h.$emit("searchClick"))},null,8,["placeholder","shortcut-label"]),H(p(Rn),{"icon-left":c.value,label:"Toggle theme","hide-label":"",square:"",variant:"outline-secondary",size:"sm",onClick:p(r)},null,8,["icon-left","onClick"])])}}}),une=Le(cne,[["__scopeId","data-v-c2b1d749"]]);function dne(t){const e=t.split(`
|
|
701
|
+
`)[0]??"",n=(e.match(/\t/g)??[]).length,o=(e.match(/,/g)??[]).length;return n>=o?" ":","}function dh(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 fne=[/^\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 hne(t){if(!t)return!1;for(const e of fne)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 w$(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 pne(t){if(!t)return!1;const e=w$(t).replace(/[,%$€£¥₹]/g,"").trim();return e.length>0&&!Number.isNaN(Number(e))}function V1(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(hne)?"date":r.every(pne)?"number":"string"})}function _$(t){var s;const e=t.split(`
|
|
702
|
+
`).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*([^"]+)$/),b=e[f].match(/^"([^"]+)"\s*=\s*"([^"]*)"$/)??h;b&&u.push([b[1],...b[2].split(",").map(g=>g.trim())])}const d=V1(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=V1(o,r);return{columns:o,rows:r,columnTypes:i}}function u6(t,e,n=" "){const o=s=>n===" "?s:s.includes(n)||s.includes('"')||s.includes(`
|
|
703
|
+
`)?`"${s.replace(/"/g,'""')}"`:s,r=t.map(o).join(n),i=e.map(s=>s.map(o).join(n));return[r,...i].join(`
|
|
704
|
+
`)}function z1(t,e){const n=e??{},o=n.trimWhitespace!==!1,r=t.split(`
|
|
705
|
+
`).filter(u=>u.trim().length>0);if(r.length===0)return{columns:[],rows:[],columnTypes:[]};const i=n.delimiter&&n.delimiter!=="auto"?n.delimiter:dne(t),s=n.firstRowIsHeader!==!1;let a,l;s?(a=dh(r[0],i),l=r.slice(1).map(u=>dh(u,i))):(a=dh(r[0],i).map((d,f)=>`Column ${f+1}`),l=r.map(d=>dh(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(w$));const c=V1(a,l);return{columns:a,rows:l,columnTypes:c}}var et=(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))(et||{}),go=(t=>(t.Equals="equals",t.NotEquals="not-equals",t.Contains="contains",t.GreaterThan="greater-than",t.LessThan="less-than",t))(go||{}),It=(t=>(t.Type="type",t.String="string",t.Numeric="numeric",t.Date="date",t))(It||{});const Io=["string","number","date"],Yh=[{id:"to-number",label:"To Number",description:"Strip non-numeric characters and convert to number",category:It.Type,accepts:Io,outputType:"number"},{id:"to-string",label:"To String",description:"Keep value as plain text",category:It.Type,accepts:Io,outputType:"string"},{id:"to-date",label:"To Date",description:"Parse text into an ISO date",category:It.Type,accepts:Io,outputType:"date"},{id:"to-boolean",label:"To Boolean",description:"Map yes/no, true/false, 1/0 to boolean",category:It.Type,accepts:Io,outputType:"string"},{id:"parse-json",label:"Parse JSON",description:"Parse JSON string and optionally extract a key",category:It.Type,accepts:["string"],outputType:"string",params:["key"]},{id:"trim",label:"Trim",description:"Remove leading and trailing whitespace",category:It.String,accepts:Io,outputType:"string"},{id:"lowercase",label:"Lowercase",description:"Convert all characters to lowercase",category:It.String,accepts:Io,outputType:"string"},{id:"uppercase",label:"Uppercase",description:"Convert all characters to uppercase",category:It.String,accepts:Io,outputType:"string"},{id:"title-case",label:"Title Case",description:"Capitalize the first letter of each word",category:It.String,accepts:Io,outputType:"string"},{id:"slugify",label:"Slugify",description:"Lowercase and replace non-alphanumeric with hyphens",category:It.String,accepts:Io,outputType:"string"},{id:"regex-replace",label:"Regex Replace",description:"Find and replace using a regular expression",category:It.String,accepts:Io,outputType:"string",params:["pattern","replacement"]},{id:"extract",label:"Extract Substring",description:"Extract a portion of text by character position",category:It.String,accepts:Io,outputType:"string",params:["start","end"]},{id:"pad-start",label:"Pad Start",description:"Pad the beginning to a fixed length",category:It.String,accepts:Io,outputType:"string",params:["length","char"]},{id:"pad-end",label:"Pad End",description:"Pad the end to a fixed length",category:It.String,accepts:Io,outputType:"string",params:["length","char"]},{id:"remove-diacritics",label:"Remove Diacritics",description:"Strip accents and diacritical marks",category:It.String,accepts:Io,outputType:"string"},{id:"split",label:"Split into Columns",description:"Split values by a separator into new columns",category:It.String,accepts:Io,outputType:"string",params:["separator","limit"]},{id:"round",label:"Round",description:"Round to a number of decimal places",category:It.Numeric,accepts:["number"],outputType:"number",params:["decimals"]},{id:"floor",label:"Floor",description:"Round down to the nearest integer",category:It.Numeric,accepts:["number"],outputType:"number"},{id:"ceil",label:"Ceiling",description:"Round up to the nearest integer",category:It.Numeric,accepts:["number"],outputType:"number"},{id:"abs",label:"Absolute Value",description:"Remove the sign (make positive)",category:It.Numeric,accepts:["number"],outputType:"number"},{id:"clamp",label:"Clamp",description:"Constrain values between a min and max",category:It.Numeric,accepts:["number"],outputType:"number",params:["min","max"]},{id:"log",label:"Logarithm",description:"Natural log — compress wide-range values for charting",category:It.Numeric,accepts:["number"],outputType:"number"},{id:"exp",label:"Exponential",description:"Raise e to the power of each value",category:It.Numeric,accepts:["number"],outputType:"number"},{id:"normalize",label:"Normalize (0–1)",description:"Scale values to 0–1 range for cross-series comparison",category:It.Numeric,accepts:["number"],outputType:"number"},{id:"standardize",label:"Standardize (z-score)",description:"Center around mean, scale by std deviation",category:It.Numeric,accepts:["number"],outputType:"number"},{id:"bin",label:"Bin/Bucket",description:"Group values into fixed-size buckets",category:It.Numeric,accepts:["number"],outputType:"number",params:["size"]},{id:"extract-year",label:"Extract Year",description:"Get the four-digit year as a number",category:It.Date,accepts:["date"],outputType:"number"},{id:"extract-month",label:"Extract Month",description:"Get the month (1–12) as a number",category:It.Date,accepts:["date"],outputType:"number"},{id:"extract-day",label:"Extract Day",description:"Get the day of the month as a number",category:It.Date,accepts:["date"],outputType:"number"},{id:"extract-weekday",label:"Extract Weekday",description:"Get the day name (Monday, Tuesday, …)",category:It.Date,accepts:["date"],outputType:"string"},{id:"extract-hour",label:"Extract Hour",description:"Get the hour (0–23) as a number",category:It.Date,accepts:["date"],outputType:"number"},{id:"shift-date",label:"Shift Date",description:"Add or subtract days, months, or years",category:It.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:It.Date,accepts:["date"],outputType:"date",params:["period"]},{id:"date-diff",label:"Duration Since",description:"Days between each date and a reference date",category:It.Date,accepts:["date"],outputType:"number",params:["reference"]}],m2=new Map(Yh.map(t=>[t.id,t]));function S$(t,e){const n=m2.get(t);return n?n.accepts.includes(e):!1}function mne(t){var e;return((e=m2.get(t))==null?void 0:e.outputType)??"string"}function ta(t,e){const n=parseFloat(t);if(Number.isNaN(n))return t;const o=e(n);return Number.isNaN(o)?t:String(o)}function fs(t,e){const n=new Date(t);return Number.isNaN(n.getTime())?t:e(n)}function gne(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 fs(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 vne(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 bne(t,e,n){switch(e){case"round":{const r=10**(Number(n.decimals)||0);return ta(t,i=>Math.round(i*r)/r)}case"floor":return ta(t,Math.floor);case"ceil":return ta(t,Math.ceil);case"abs":return ta(t,Math.abs);case"clamp":{const o=n.min?Number(n.min):-1/0,r=n.max?Number(n.max):1/0;return ta(t,i=>Math.min(Math.max(i,o),r))}case"log":return ta(t,o=>o>0?Math.log(o):NaN);case"exp":return ta(t,Math.exp);case"bin":{const o=Number(n.size)||1;return ta(t,r=>Math.floor(r/o)*o)}default:return t}}function yne(t,e,n){switch(e){case"extract-year":return fs(t,o=>String(o.getFullYear()));case"extract-month":return fs(t,o=>String(o.getMonth()+1));case"extract-day":return fs(t,o=>String(o.getDate()));case"extract-weekday":return fs(t,o=>o.toLocaleDateString("en",{weekday:"long"}));case"extract-hour":return fs(t,o=>String(o.getHours()));case"shift-date":return fs(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 fs(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:fs(t,r=>String(Math.round((r.getTime()-o.getTime())/(1e3*60*60*24))))}default:return t}}function xne(t,e,n){return e.startsWith("to-")||e==="parse-json"?gne(t,e,n):new Set(["round","floor","ceil","abs","clamp","log","exp","bin"]).has(e)?bne(t,e,n):e.startsWith("extract-")||e.startsWith("shift-")||e.startsWith("truncate-")||e==="date-diff"?yne(t,e,n):vne(t,e,n)}const wne="";function _ne(t,e){const n=t.rows.map(o=>{const r=[...o];return r[e]=wne,r});return{columns:[...t.columns],rows:n,columnTypes:[...t.columnTypes]}}function Sne(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],m=[...d],b=[...h,...Array(i-h.length).fill("")];return m.splice(e,1,...b),m});return{columns:a,rows:u,columnTypes:l}}function kne(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 Cne(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(!S$(o,r))return _ne(t,n);if(o==="split")return Sne(t,n,e);if(o==="normalize"||o==="standardize")return kne(t,n,o);const i=t.rows.map(a=>[...a]);for(const a of i)a[n]=xne(a[n],o,e);const s=[...t.columnTypes];return s[n]=mne(o),{columns:[...t.columns],rows:i,columnTypes:s}}function Qd(t){return Number(t.replace(/[,%$€£¥₹]/g,"").trim())||0}function Ane(t,e,n){if(n==="number")return Qd(t)-Qd(e);if(n==="date"){const o=Date.parse(t)||0,r=Date.parse(e)||0;return o-r}return t.localeCompare(e)}function g2(t){return t.columns?t.columns.split(",").map(e=>e.trim()).filter(Boolean):t.column?[t.column]:[]}function $ne(t,e){const n=g2(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(m=>Qd(l[m]??"")),d=o.map(m=>Qd(c[m]??""));let f,h;return i==="avg"?(f=u.reduce((m,b)=>m+b,0)/u.length,h=d.reduce((m,b)=>m+b,0)/d.length):(f=u.reduce((m,b)=>m+b,0),h=d.reduce((m,b)=>m+b,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=Ane(a[c]??"",l[c]??"",u);if(d!==0)return r*d}return 0});return{...t,rows:s}}function Tne(t,e,n){if(!n&&e!==go.Equals&&e!==go.NotEquals)return!0;switch(e){case go.Equals:return t===n;case go.NotEquals:return t!==n;case go.Contains:return t.toLowerCase().includes(n.toLowerCase());case go.GreaterThan:{const o=Number(t.replace(/[,%$€£¥₹]/g,"").trim()),r=Number(n);return!Number.isNaN(o)&&!Number.isNaN(r)&&o>r}case go.LessThan:{const o=Number(t.replace(/[,%$€£¥₹]/g,"").trim()),r=Number(n);return!Number.isNaN(o)&&!Number.isNaN(r)&&o<r}default:return!0}}function Mne(t,e){const n=t.columns.indexOf(e.column);if(n<0||!e.column)return t;const o=t.rows.filter(r=>Tne(r[n]??"",e.condition??go.Equals,e.value??""));return{...t,rows:o}}function One(t,e){const n=g2(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 Bne(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 Lne(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 k$={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 Pne(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"&&!k$[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 Dne(t,e,n){if(t==="count")return String(e.length);const o=e.map(r=>Qd(r[n]??""));return String(k$[t](o))}function Ene(t,e){const n=g2({columns:e.groupColumns}).map(i=>t.columns.indexOf(i)).filter(i=>i>=0);if(n.length===0||!e.aggregates)return t;const o=Pne(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=>Dne(a.fn,s,a.colIndex))])}}const Ine=Bo("dataTransforms",()=>{const t=Ie([]);let e=1;function n(h,m={}){const b=String(e++);return t.value.push({id:b,type:h,config:m}),b}function o(h){const m=t.value.findIndex(b=>b.id===h);m>=0&&t.value.splice(m,1)}function r(h,m){const b=t.value.find(g=>g.id===h);b&&(b.config={...m})}function i(h,m){const b=t.value.findIndex(v=>v.id===h);if(b<0||m<0||m>=t.value.length)return;const[g]=t.value.splice(b,1);t.value.splice(m,0,g)}function s(h,m,b,g){let v={columns:[...m],rows:b.map(y=>[...y]),columnTypes:[...g]};for(const y of h)switch(y.type){case et.Sort:v=$ne(v,y.config);break;case et.Filter:v=Mne(v,y.config);break;case et.HideColumns:v=One(v,y.config);break;case et.Transpose:v=Bne(v);break;case et.Parse:v=Cne(v,y.config);break;case et.Rename:v=Lne(v,y.config);break;case et.GroupBy:v=Ene(v,y.config);break}return v}function a(h,m,b){return s(t.value,h,m,b)}function l(h,m,b,g){const v=t.value.slice(0,h);return s(v,m,b,g)}function c(h,m,b){const{config:g}=h;if(g.column&&!m.includes(g.column))return`Column "${g.column}" not found`;if(h.type===et.Parse&&g.column&&g.operation){const v=m.indexOf(g.column);if(v>=0&&!S$(g.operation,b[v])){const y=m2.get(g.operation);return`${(y==null?void 0:y.label)??g.operation} requires ${y==null?void 0:y.accepts.join(" or ")} column, got ${b[v]}`}}return h.type===et.Rename?g.column?g.newName?null:"New name is required":"No column selected":h.type===et.Filter&&!g.column||h.type===et.Sort&&!g.column&&!g.columns?"No column selected":h.type===et.GroupBy?g.groupColumns?g.aggregates?null:"No aggregates defined":"No group columns selected":null}function u(){t.value=[],e=1}function d(h){t.value=h.map(m=>({...m,config:{...m.config}})),e=h.reduce((m,b)=>Math.max(m,Number(b.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 Mr(){const t=Ine(),{steps:e}=At(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 Oa(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 Rne(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 C$(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===et.Sort)return((n=t.transforms[o].config)==null?void 0:n.direction)??Qt.Ascending}}function d6(t){return/^-?\d+(\.\d+)?%?$/.test(t)?t:`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Km(t,e){if(t.length<=2)return e.map(i=>{const s=i[0]??"",a=i[1]??"";return`"${s}" = ${d6(a)}`}).join(`
|
|
706
|
+
`);const o=`_series = ${t.slice(1).map(i=>`"${i}"`).join(",")}`,r=e.map(i=>{const s=i[0]??"",a=i.slice(1).map(l=>d6(l??"")).join(",");return`"${s}" = ${a}`});return[o,...r].join(`
|
|
707
|
+
`)}const Nne=Bo("dataTable",()=>{const t=sr({columns:[],rows:[],rawInput:"",columnTypes:[]}),e=De("delimited"),n=De(""),o=De(null),{steps:r,applyTransforms:i,applyStepList:s}=Mr(),{activeIndex:a,scenes:l}=bn(),c=S(()=>{var C;if(a.value>=0){const L=Oa(l.value,a.value);if(L!=null&&L.data)return _$(L.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 L=Oa(l.value,a.value);(C=L==null?void 0:L.transforms)!=null&&C.length&&(_=s(L.transforms,_.columns,_.rows,_.columnTypes))}return _}),u=S(()=>c.value.columns),d=S(()=>c.value.rows),f=S(()=>c.value.columnTypes),h=S(()=>r.value.length>0);function m(_,C){t.columns=[..._.columns],t.rows=_.rows.map(L=>[...L]),t.columnTypes=_.columnTypes?[..._.columnTypes]:_.columns.map(()=>"string"),o.value=Date.now(),C!=null&&C.label&&(n.value=C.label)}function b(_,C){_>=0&&_<t.columns.length&&(t.columns[_]=C)}function g(_,C){_>=0&&_<t.columnTypes.length&&(t.columnTypes[_]=C)}function v(){return Km(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{...Rp(t),sourceFormat:e,sourceLabel:n,loadedAt:o,displayColumns:u,displayRows:d,displayColumnTypes:f,hasTransforms:h,loadParsed:m,renameColumn:b,setColumnType:g,serialize:v,reset:y,hydrate:x}});function Ko(){const t=Nne(),{columns:e,rows:n,rawInput:o,columnTypes:r,sourceFormat:i,sourceLabel:s,loadedAt:a,displayColumns:l,displayRows:c,displayColumnTypes:u,hasTransforms:d}=At(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 Fne=Bo("chartTypeOptions",()=>{const t=sr({});function e(d){f$(d),t[d]||(t[d]={})}const{chartType:n,_base:o}=hn(),r=S(()=>{var g,v;const d=t[n.value]??{},f=F1(n.value,d),{activeScene:h,activeIndex:m,scenes:b}=bn();if(m.value>=0){let y={...f};for(let x=0;x<=m.value;x++){const _=(g=b.value[x])==null?void 0:g.chartTypeOptions;_&&(y={...y,..._})}return y}return(v=h.value)!=null&&v.chartTypeOptions?{...f,...h.value.chartTypeOptions}:f}),i=S(()=>{const d=t[o.chartType.value]??{};return F1(o.chartType.value,d)}),s=S(()=>Jc(n.value)),a=S(()=>s.value.map(d=>d.key));function l(d,f){var g;const{activeIndex:h,activeScene:m,scenes:b}=bn();if(h.value>=0&&m.value){let y=(t[n.value]??{})[d];for(let x=h.value-1;x>=0;x--){const _=(g=b.value[x])==null?void 0:g.chartTypeOptions;if(_&&d in _){y=_[d];break}}if(op(f,y)){const x={...m.value.chartTypeOptions};delete x[d];const _=Object.keys(x).length>0?x:void 0,C={...m.value};_?C.chartTypeOptions=_:delete C.chartTypeOptions,b.value[h.value]=C}else{const x=m.value.chartTypeOptions??{};b.value[h.value]={...m.value,chartTypeOptions:{...x,[d]:f}}}return}t[n.value]||(t[n.value]={}),t[n.value][d]=f}He(n,(d,f)=>{var _;e(d);const{activeIndex:h,activeScene:m,scenes:b}=bn(),g=h.value>=0&&m.value!=null;let v;if(g){let C={...t[f]??{}};for(let L=0;L<=h.value;L++){const O=(_=b.value[L])==null?void 0:_.chartTypeOptions;O&&(C={...C,...O})}v=C}else v=t[f]??{};if(Object.keys(v).length===0)return;const y=Jc(d).map(C=>C.key);if(y.length===0)return;const x=t[d]??{};for(const C of y)if(C in v){if(g){const L=m.value.chartTypeOptions??{};if(!(C in L)&&!(C in x)){const O=v[C],$=Array.isArray(O)?[...O]:O;b.value[h.value]={...m.value,chartTypeOptions:{...L,[C]:$}}}}else if(!(C in x)){const L=v[C],O=t[d];Array.isArray(L)?O[C]=[...L]:O[C]=L}}},{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 yn(){const t=Fne(),{currentOptions:e,baseOptions:n,availableOptionKeys:o,optionDefs:r}=At(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 A$=[{value:"blueprint",label:"Blueprint",description:"The default Blueprint Chart theme"},{value:"blueprint-framed",label:"Blueprint Framed",description:"Adds borders and a tinted footer"}],v2=Bo("chartTheme",()=>{const t=De("blueprint");function e(){t.value="blueprint"}return{chartTheme:t,chartThemeOptions:A$,reset:e}});function $$(){const t=v2(),{chartTheme:e}=At(t);return{chartTheme:e,availableThemes:A$,reset:t.reset}}const Vne=new Set([et.Sort,et.Filter,et.HideColumns,et.Transpose,et.Parse,et.GroupBy,et.Computed,"pivot"]);function Oc(){const t=hn(),e=v2(),n=At(e).chartTheme,{store:o,ensureDefaults:r}=yn(),i=Mr(),s=bn();function a(l){var c,u;try{const d=Mf(l);s.setActive(-1),t.chartType.value=d.chartType;const f=Ma(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 m={},b=f.get("sizing");b&&["responsive","fixed","max-width"].includes(String(b))&&(m.sizing=String(b));const v=f.get("fixedWidth");v!==void 0&&(m.fixedWidth=Number(v));const y=f.get("maxWidth");y!==void 0&&(m.maxWidth=Number(y));const x=f.get("heightMode");x&&["auto","fixed","aspect-ratio"].includes(String(x))&&(m.heightMode=String(x));const C=f.get("fixedHeight");C!==void 0&&(m.fixedHeight=Number(C));const L=f.get("aspectRatio");L!==void 0&&(m.aspectRatio=String(L));const O=f.get("padding");O!==void 0&&(m.padding=Number(O));const $=f.get("transparentBackground");$!==void 0&&(m.transparentBackground=$===!0||$==="true");const M=f.get("showCredit");M!==void 0&&(m.showCredit=M!==!1&&M!=="false");const D=f.get("player");D&&["buttons","progress-bar","dot-stepper","minimal-arrows","none"].includes(String(D))&&(m.playerType=String(D));const k=f.get("playerPosition");k&&["left","center","right"].includes(String(k))&&(m.playerPosition=String(k)),t.layout.value={...Zd,...m};const B=f.get("sort");B===Qt.Ascending||B===Qt.Descending?t.sort.value=B:t.sort.value=Qt.None;const P=d.data?Z0(d.data):"";if(t.data.value=P,P){const F=Ko(),z=_$(P);F.loadParsed(z),F.rawInput.value=P,F.sourceFormat.value="bpc"}if(o[d.chartType]=p2(d.chartType,d.properties),r(d.chartType),t.colorizes.value=d.colorizes?Q0(d.colorizes):[],t.highlights.value=d.highlights?J0(d.highlights):[],t.areaFills.value=d.areaFills?ep(d.areaFills):[],t.annotations.value=d.annotations?tp(d.annotations):[],t.seriesOverrides.value=d.series?np(d.series):[],(c=d.transforms)!=null&&c.length){i.reset();for(const F of d.transforms){if(!Vne.has(F.transformType))continue;const z=Ma(F.properties),V={};for(const[G,ie]of z)V[G]=String(ie);if(F.transformType===et.Sort&&z.has("direction")){const G=String(z.get("direction"));(G===Qt.Ascending||G===Qt.Descending)&&(t.sort.value=G)}i.addStep(F.transformType,V)}}else i.reset();if((u=d.scenes)!=null&&u.length){const F=d.scenes.map(z=>{const V=m$(z,d.chartType),G={id:Math.random().toString(36).slice(2,10),name:V.name};V.chartType&&(G.chartType=V.chartType),V.data&&(G.data=Z0(V.data)),Object.keys(V.chartTypeOptions).length>0&&(G.chartTypeOptions=V.chartTypeOptions),V.colorizes.length>0&&(G.colorizes=Q0(V.colorizes)),V.highlights.length>0&&(G.highlights=J0(V.highlights)),V.areaFills.length>0&&(G.areaFills=ep(V.areaFills)),V.annotations.length>0&&(G.annotations=tp(V.annotations)),V.series.length>0&&(G.seriesOverrides=np(V.series)),V.annotationVisibility.length>0&&(G.annotationVisibility=V.annotationVisibility.map(ce=>({action:ce.action,kind:ce.kind,id:ce.id}))),V.transforms.length>0&&(G.transforms=V.transforms.map((ce,he)=>({id:String(he),type:ce.transformType,config:Object.fromEntries(ce.properties.map(Z=>[Z.key,String(Z.value)]))})));const ie=Object.fromEntries([...V.properties.entries()].filter(([ce])=>!["type"].includes(ce)));return Object.keys(ie).length>0&&(G.properties=ie),G});s.hydrate({scenes:F,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 fh(t){if(typeof t=="number")return String(t);const e=String(t);return e.endsWith("%")?String(parseFloat(e)):`"${e}"`}function Hu(t){if(typeof t=="number")return String(t);const e=String(t);return e.endsWith("%")?`"${e}"`:String(parseFloat(e))}function Of(){const e=hn()._base,n=At(v2()).chartTheme,{baseOptions:o}=yn(),{steps:r}=Mr(),{scenes:i}=bn(),s=Ko(),a=De(!1);function l(){let u=`chart ${e.chartType.value} {
|
|
708
|
+
`;e.title.value&&(u+=` title = "${e.title.value}"
|
|
709
|
+
`),e.description.value&&(u+=` description = "${e.description.value}"
|
|
710
|
+
`),e.byline.value&&(u+=` byline = "${e.byline.value}"
|
|
711
|
+
`),e.source.value&&(u+=` source = "${e.source.value}"
|
|
712
|
+
`),e.sourceUrl.value&&(u+=` sourceUrl = "${e.sourceUrl.value}"
|
|
713
|
+
`),n.value&&n.value!=="blueprint"&&(u+=` theme = "${n.value}"
|
|
714
|
+
`);const d=Jc(e.chartType.value),f=d.map(g=>g.key),h=new Map(d.filter(g=>g.default!==void 0).map(g=>[g.key,String(g.default)])),m=o.value;for(const g of f){const v=m[g];v!==void 0&&(a.value&&h.has(g)&&String(v)===h.get(g)||(g==="colors"&&Array.isArray(v)&&v.length>0?u+=` colors = "${v.join(", ")}"
|
|
715
|
+
`:typeof v=="boolean"?u+=` ${g} = ${v}
|
|
716
|
+
`:typeof v=="string"&&v!==""&&(u+=` ${g} = "${v}"
|
|
717
|
+
`)))}const b=Lt(e.layout.value);if(b.sizing!=="max-width"&&(u+=` sizing = "${b.sizing}"
|
|
718
|
+
`),b.sizing==="fixed"&&b.fixedWidth!==600&&(u+=` fixedWidth = ${b.fixedWidth}
|
|
719
|
+
`),b.sizing==="max-width"&&b.maxWidth!==660&&(u+=` maxWidth = ${Hu(b.maxWidth)}
|
|
720
|
+
`),b.heightMode!=="auto"&&(u+=` heightMode = "${b.heightMode}"
|
|
721
|
+
`),b.heightMode==="fixed"&&b.fixedHeight!==400&&(u+=` fixedHeight = ${b.fixedHeight}
|
|
722
|
+
`),b.heightMode==="aspect-ratio"&&b.aspectRatio!=="16:9"&&(u+=` aspectRatio = "${b.aspectRatio}"
|
|
723
|
+
`),b.padding!==16&&(u+=` padding = ${b.padding}
|
|
724
|
+
`),b.transparentBackground&&(u+=` transparentBackground = true
|
|
725
|
+
`),b.showCredit||(u+=` showCredit = false
|
|
726
|
+
`),b.playerType&&b.playerType!=="buttons"&&(u+=` player = "${b.playerType}"
|
|
727
|
+
`),b.playerPosition!=="left"&&(u+=` playerPosition = "${b.playerPosition}"
|
|
728
|
+
`),e.data.value){u+=`
|
|
729
|
+
data {
|
|
730
|
+
`;const g=e.data.value.split(`
|
|
731
|
+
`).map(v=>v.trim()).filter(Boolean);u+=g.map(v=>` ${v}`).join(`
|
|
732
|
+
`),u+=`
|
|
733
|
+
}
|
|
734
|
+
`}for(const g of e.colorizes.value)g.target&&(u+=`
|
|
735
|
+
colorize "${g.target}" {
|
|
736
|
+
`,g.color&&(u+=` color = "${g.color}"
|
|
737
|
+
`),g.label&&(u+=` label = "${g.label}"
|
|
738
|
+
`),u+=` }
|
|
739
|
+
`);for(const g of e.highlights.value)g.target&&(u+=`
|
|
740
|
+
highlight "${g.target}"
|
|
741
|
+
`);for(const g of e.areaFills.value)!g.from||!g.to||(u+=`
|
|
742
|
+
areafill "${g.from}" "${g.to}" {
|
|
743
|
+
`,g.color&&(u+=` color = "${g.color}"
|
|
744
|
+
`),g.negativeColor&&(u+=` negativeColor = "${g.negativeColor}"
|
|
745
|
+
`),g.opacity!==void 0&&(u+=` opacity = ${g.opacity}
|
|
746
|
+
`),g.interpolation&&(u+=` interpolation = "${g.interpolation}"
|
|
747
|
+
`),u+=` }
|
|
748
|
+
`);for(const g of e.annotations.value){const v=g.kind??Pt.Point;if(v===Pt.Point){if(!("target"in g)||!g.target)continue;u+=`
|
|
749
|
+
annotation "${g.target}" {
|
|
750
|
+
`,g.id&&(u+=` id = "${g.id}"
|
|
751
|
+
`),g.text&&(u+=` text = "${g.text}"
|
|
752
|
+
`),g.textColor&&(u+=` textColor = "${g.textColor}"
|
|
753
|
+
`),g.maxWidth!==void 0&&(u+=` maxWidth = ${Hu(g.maxWidth)}
|
|
754
|
+
`),g.textOutline!==void 0&&(u+=` textOutline = ${g.textOutline}
|
|
755
|
+
`),g.showLine!==void 0&&(u+=` showLine = ${g.showLine}
|
|
756
|
+
`),g.anchorDirection&&(u+=` anchorDirection = ${g.anchorDirection}
|
|
757
|
+
`),g.textOffsetX!==void 0&&(u+=` textOffsetX = ${g.textOffsetX}
|
|
758
|
+
`),g.textOffsetY!==void 0&&(u+=` textOffsetY = ${g.textOffsetY}
|
|
759
|
+
`),g.lineStyle&&(u+=` lineStyle = ${g.lineStyle}
|
|
760
|
+
`),g.lineWeight!==void 0&&(u+=` lineWeight = ${g.lineWeight}
|
|
761
|
+
`),g.showArrow!==void 0&&(u+=` showArrow = ${g.showArrow}
|
|
762
|
+
`),g.lineTargetDistance!==void 0&&(u+=` lineTargetDistance = ${g.lineTargetDistance}
|
|
763
|
+
`),g.showCircle!==void 0&&(u+=` showCircle = ${g.showCircle}
|
|
764
|
+
`),g.circleSize!==void 0&&(u+=` circleSize = ${g.circleSize}
|
|
765
|
+
`),g.circleStyle&&(u+=` circleStyle = ${g.circleStyle}
|
|
766
|
+
`),g.circleColor&&(u+=` circleColor = "${g.circleColor}"
|
|
767
|
+
`),u+=` }
|
|
768
|
+
`}else if(v===Pt.Range){const y=g;u+=`
|
|
769
|
+
range {
|
|
770
|
+
`,y.id&&(u+=` id = "${y.id}"
|
|
771
|
+
`),y.start!==void 0&&(u+=` start = ${typeof y.start=="string"?`"${y.start}"`:y.start}
|
|
772
|
+
`),y.end!==void 0&&(u+=` end = ${typeof y.end=="string"?`"${y.end}"`:y.end}
|
|
773
|
+
`),y.orientation&&(u+=` orientation = ${y.orientation}
|
|
774
|
+
`),y.startAnchor&&y.startAnchor!=="center"&&(u+=` startAnchor = ${y.startAnchor}
|
|
775
|
+
`),y.endAnchor&&y.endAnchor!=="center"&&(u+=` endAnchor = ${y.endAnchor}
|
|
776
|
+
`),y.bgColor&&(u+=` bgColor = "${y.bgColor}"
|
|
777
|
+
`),y.bgOpacity!==void 0&&(u+=` bgOpacity = ${y.bgOpacity}
|
|
778
|
+
`),y.direction&&(u+=` direction = ${y.direction}
|
|
779
|
+
`),y.text&&(u+=` text = "${y.text}"
|
|
780
|
+
`),y.textColor&&(u+=` textColor = "${y.textColor}"
|
|
781
|
+
`),u+=` }
|
|
782
|
+
`}else if(v===Pt.Free){const y=g;u+=`
|
|
783
|
+
note {
|
|
784
|
+
`,y.id&&(u+=` id = "${y.id}"
|
|
785
|
+
`),y.text&&(u+=` text = "${y.text}"
|
|
786
|
+
`),y.x!==void 0&&(u+=` x = ${fh(y.x)}
|
|
787
|
+
`),y.y!==void 0&&(u+=` y = ${fh(y.y)}
|
|
788
|
+
`),y.textColor&&(u+=` textColor = "${y.textColor}"
|
|
789
|
+
`),y.maxWidth!==void 0&&(u+=` maxWidth = ${Hu(y.maxWidth)}
|
|
790
|
+
`),y.textOutline!==void 0&&(u+=` textOutline = ${y.textOutline}
|
|
791
|
+
`),u+=` }
|
|
792
|
+
`}}for(const g of r.value){u+=`
|
|
793
|
+
transform ${g.type} {
|
|
794
|
+
`;for(const[v,y]of Object.entries(g.config))y!==void 0&&y!==""&&(u+=` ${v} = "${y}"
|
|
795
|
+
`);u+=` }
|
|
796
|
+
`}if(e.sort.value!==Qt.None){const g=s.displayColumns.value,v=g.length>2?g.slice(1):g.length>1?[g[1]]:[g[0]??""];u+=`
|
|
797
|
+
transform ${et.Sort} {
|
|
798
|
+
`,v.length>1?(u+=` columns = "${v.join(",")}"
|
|
799
|
+
`,u+=` operation = sum
|
|
800
|
+
`):u+=` column = "${v[0]}"
|
|
801
|
+
`,u+=` direction = ${e.sort.value}
|
|
802
|
+
`,u+=` }
|
|
803
|
+
`}for(const g of e.seriesOverrides.value)g.name&&(u+=`
|
|
804
|
+
series "${g.name}" {
|
|
805
|
+
`,g.color&&(u+=` color = "${g.color}"
|
|
806
|
+
`),g.lineWidth!==void 0&&(u+=` lineWidth = ${g.lineWidth}
|
|
807
|
+
`),g.dash&&(u+=` dash = "${g.dash}"
|
|
808
|
+
`),g.interpolation&&(u+=` interpolation = "${g.interpolation}"
|
|
809
|
+
`),g.labelMode&&(u+=` labelMode = "${g.labelMode}"
|
|
810
|
+
`),g.labelText&&(u+=` labelText = "${g.labelText}"
|
|
811
|
+
`),g.valueLabels!==void 0&&(u+=` valueLabels = ${g.valueLabels}
|
|
812
|
+
`),g.lineSymbols!==void 0&&(u+=` lineSymbols = ${g.lineSymbols}
|
|
813
|
+
`),g.hidden!==void 0&&(u+=` hidden = ${g.hidden}
|
|
814
|
+
`),g.symbolShape&&(u+=` symbolShape = "${g.symbolShape}"
|
|
815
|
+
`),g.symbolShowOn&&(u+=` symbolShowOn = "${g.symbolShowOn}"
|
|
816
|
+
`),g.symbolStyle&&(u+=` symbolStyle = "${g.symbolStyle}"
|
|
817
|
+
`),g.symbolSize!==void 0&&(u+=` symbolSize = ${g.symbolSize}
|
|
818
|
+
`),g.symbolOpacity!==void 0&&(u+=` symbolOpacity = ${g.symbolOpacity}
|
|
819
|
+
`),u+=` }
|
|
820
|
+
`);for(const g of Lt(i.value)){if(g.name!==null?u+=`
|
|
821
|
+
scene "${g.name}" {
|
|
822
|
+
`:u+=`
|
|
823
|
+
scene {
|
|
824
|
+
`,g.chartType&&(u+=` type = ${g.chartType}
|
|
825
|
+
`),g.properties)for(const[v,y]of Object.entries(g.properties))typeof y=="string"?u+=` ${v} = "${y}"
|
|
826
|
+
`:u+=` ${v} = ${y}
|
|
827
|
+
`;if(g.chartTypeOptions){const v=g.chartType||e.chartType.value,x=Jc(v).map(_=>_.key);for(const _ of x){const C=g.chartTypeOptions[_];C!==void 0&&(_==="colors"&&Array.isArray(C)&&C.length>0?u+=` colors = "${C.join(", ")}"
|
|
828
|
+
`:typeof C=="boolean"?u+=` ${_} = ${C}
|
|
829
|
+
`:typeof C=="string"&&C!==""&&(u+=` ${_} = "${C}"
|
|
830
|
+
`))}}if(g.data){u+=`
|
|
831
|
+
data {
|
|
832
|
+
`;const v=g.data.split(`
|
|
833
|
+
`).map(y=>y.trim()).filter(Boolean);u+=v.map(y=>` ${y}`).join(`
|
|
834
|
+
`),u+=`
|
|
835
|
+
}
|
|
836
|
+
`}if(g.colorizes)for(const v of g.colorizes)v.target&&(u+=`
|
|
837
|
+
colorize "${v.target}" {
|
|
838
|
+
`,v.color&&(u+=` color = "${v.color}"
|
|
839
|
+
`),v.label&&(u+=` label = "${v.label}"
|
|
840
|
+
`),u+=` }
|
|
841
|
+
`);if(g.highlights)for(const v of g.highlights)v.target&&(u+=`
|
|
842
|
+
highlight "${v.target}"
|
|
843
|
+
`);if(g.areaFills)for(const v of g.areaFills)!v.from||!v.to||(u+=`
|
|
844
|
+
areafill "${v.from}" "${v.to}" {
|
|
845
|
+
`,v.color&&(u+=` color = "${v.color}"
|
|
846
|
+
`),u+=` }
|
|
847
|
+
`);if(g.annotations)for(const v of g.annotations){const y=v.kind??Pt.Point;if(y===Pt.Point){if(!("target"in v)||!v.target)continue;u+=`
|
|
848
|
+
annotation "${v.target}" {
|
|
849
|
+
`,v.id&&(u+=` id = "${v.id}"
|
|
850
|
+
`),v.text&&(u+=` text = "${v.text}"
|
|
851
|
+
`),v.textColor&&(u+=` textColor = "${v.textColor}"
|
|
852
|
+
`),v.maxWidth!==void 0&&(u+=` maxWidth = ${Hu(v.maxWidth)}
|
|
853
|
+
`),v.textOutline!==void 0&&(u+=` textOutline = ${v.textOutline}
|
|
854
|
+
`),v.showLine!==void 0&&(u+=` showLine = ${v.showLine}
|
|
855
|
+
`),v.anchorDirection&&(u+=` anchorDirection = ${v.anchorDirection}
|
|
856
|
+
`),v.textOffsetX!==void 0&&(u+=` textOffsetX = ${v.textOffsetX}
|
|
857
|
+
`),v.textOffsetY!==void 0&&(u+=` textOffsetY = ${v.textOffsetY}
|
|
858
|
+
`),v.lineStyle&&(u+=` lineStyle = ${v.lineStyle}
|
|
859
|
+
`),v.lineWeight!==void 0&&(u+=` lineWeight = ${v.lineWeight}
|
|
860
|
+
`),v.showArrow!==void 0&&(u+=` showArrow = ${v.showArrow}
|
|
861
|
+
`),v.lineTargetDistance!==void 0&&(u+=` lineTargetDistance = ${v.lineTargetDistance}
|
|
862
|
+
`),v.showCircle!==void 0&&(u+=` showCircle = ${v.showCircle}
|
|
863
|
+
`),v.circleSize!==void 0&&(u+=` circleSize = ${v.circleSize}
|
|
864
|
+
`),v.circleStyle&&(u+=` circleStyle = ${v.circleStyle}
|
|
865
|
+
`),v.circleColor&&(u+=` circleColor = "${v.circleColor}"
|
|
866
|
+
`),u+=` }
|
|
867
|
+
`}else if(y===Pt.Range){const x=v;u+=`
|
|
868
|
+
range {
|
|
869
|
+
`,x.id&&(u+=` id = "${x.id}"
|
|
870
|
+
`),x.start!==void 0&&(u+=` start = ${typeof x.start=="string"?`"${x.start}"`:x.start}
|
|
871
|
+
`),x.end!==void 0&&(u+=` end = ${typeof x.end=="string"?`"${x.end}"`:x.end}
|
|
872
|
+
`),x.orientation&&(u+=` orientation = ${x.orientation}
|
|
873
|
+
`),x.startAnchor&&x.startAnchor!=="center"&&(u+=` startAnchor = ${x.startAnchor}
|
|
874
|
+
`),x.endAnchor&&x.endAnchor!=="center"&&(u+=` endAnchor = ${x.endAnchor}
|
|
875
|
+
`),x.bgColor&&(u+=` bgColor = "${x.bgColor}"
|
|
876
|
+
`),x.bgOpacity!==void 0&&(u+=` bgOpacity = ${x.bgOpacity}
|
|
877
|
+
`),x.direction&&(u+=` direction = ${x.direction}
|
|
878
|
+
`),x.text&&(u+=` text = "${x.text}"
|
|
879
|
+
`),x.textColor&&(u+=` textColor = "${x.textColor}"
|
|
880
|
+
`),u+=` }
|
|
881
|
+
`}else if(y===Pt.Free){const x=v;u+=`
|
|
882
|
+
note {
|
|
883
|
+
`,x.id&&(u+=` id = "${x.id}"
|
|
884
|
+
`),x.text&&(u+=` text = "${x.text}"
|
|
885
|
+
`),x.x!==void 0&&(u+=` x = ${fh(x.x)}
|
|
886
|
+
`),x.y!==void 0&&(u+=` y = ${fh(x.y)}
|
|
887
|
+
`),x.textColor&&(u+=` textColor = "${x.textColor}"
|
|
888
|
+
`),x.maxWidth!==void 0&&(u+=` maxWidth = ${Hu(x.maxWidth)}
|
|
889
|
+
`),x.textOutline!==void 0&&(u+=` textOutline = ${x.textOutline}
|
|
890
|
+
`),u+=` }
|
|
891
|
+
`}}if(g.annotationVisibility){const v={[Pt.Point]:"annotation",[Pt.Range]:"range",[Pt.Free]:"note"};for(const y of g.annotationVisibility)u+=` ${y.action}_${v[y.kind]} "${y.id}"
|
|
892
|
+
`}if(g.seriesOverrides)for(const v of g.seriesOverrides)v.name&&(u+=`
|
|
893
|
+
series "${v.name}" {
|
|
894
|
+
`,v.color&&(u+=` color = "${v.color}"
|
|
895
|
+
`),u+=` }
|
|
896
|
+
`);if(g.transforms)for(const v of g.transforms){u+=`
|
|
897
|
+
transform ${v.type} {
|
|
898
|
+
`;for(const[y,x]of Object.entries(v.config))x!==void 0&&x!==""&&(u+=` ${y} = "${x}"
|
|
899
|
+
`);u+=` }
|
|
900
|
+
`}u+=` }
|
|
901
|
+
`}return u+=`}
|
|
902
|
+
`,u}const c=De("");return Fp(()=>{c.value=l()},{flush:"post"}),{dsl:c,compact:a,generateDsl:l}}const zne=150;function Tve(t){return t?Mf(t).scenes.length:0}function b2(t,e,n){var V,G,ie,ce,he;if(n!=null&&n.transition||t.replaceChildren(),!e)return;const o=Mf(e);n!=null&&n.stripColors&&(o.properties=o.properties.filter(Z=>Z.key!=="colors"&&Z.key!=="colorPalette"));const r=Ma(o.properties),i=n!=null&&n.ignoreLayout?void 0:r.get("heightMode"),s=r.get("aspectRatio"),a=r.get("fixedHeight");let l=!1;if(i==="aspect-ratio"&&s){const Z=String(s).split(":").map(Number);Z.length===2&&Z[0]>0&&Z[1]>0&&(t.style.aspectRatio=`${Z[0]} / ${Z[1]}`,t.style.height="auto",l=!0)}else i==="fixed"&&a&&(t.style.height=`${a}px`,l=!0);l&&(t.style.display="flex",t.style.flexDirection="column",t.style.overflow="hidden");const c=n==null?void 0:n.sceneIndex;let u=null;c!=null&&c>=0&&c<o.scenes.length&&(u=m$(o.scenes[c],o.chartType));const d=(u==null?void 0:u.chartType)??o.chartType,f=u!=null&&u.data?Z0(u.data):o.data?Z0(o.data):"",h=Xs(f);if(h.labels.length===0)return;const m=c2(d);if(!m)return;const b=p2(d,o.properties),g=F1(d,b),v=u!=null&&u.chartTypeOptions?{...g,...u.chartTypeOptions}:g,y=cr(t),x=Xm(v,y),_=(V=u==null?void 0:u.colorizes)!=null&&V.length?Q0(u.colorizes):Q0(o.colorizes),C=(G=u==null?void 0:u.highlights)!=null&&G.length?J0(u.highlights):J0(o.highlights),L=(ie=u==null?void 0:u.areaFills)!=null&&ie.length?ep(u.areaFills):ep(o.areaFills),O=(ce=u==null?void 0:u.annotations)!=null&&ce.length?tp(u.annotations):tp(o.annotations),$=(he=u==null?void 0:u.seriesOverrides)!=null&&he.length?np(u.series):np(o.series),M=u==null?void 0:u.properties,D=(M==null?void 0:M.get("sort"))??r.get("sort"),N=D?String(D):void 0,k=N===Qt.Ascending||N===Qt.Descending?N:void 0,A=Z=>String((M==null?void 0:M.get(Z))??r.get(Z)??"")||void 0,B=r.get("transparentBackground"),P=n!=null&&n.thumbnail?void 0:{title:A("title"),description:A("description"),source:A("source"),sourceUrl:A("sourceUrl"),byline:A("byline"),note:A("note"),padding:String(r.get("padding")??"")||(n==null?void 0:n.padding)||"16px",transparentBackground:B===!0||B==="true"||void 0};m(t,h,{frame:P,sort:k,...x,colorizes:_.length>0?_:void 0,highlights:C.length>0?C:void 0,areaFills:L.length>0?L:void 0,annotations:O.length>0?O:void 0,seriesOverrides:$.length>0?$:void 0},!!(n!=null&&n.transition));const F=A("theme"),z=t.querySelector(".bc-frame");F&&z&&z.classList.add(`bc-theme-${F}`),l&&z&&z.classList.add("bc-frame--constrained")}function Mve(t,e,n){const o=Ke(e),r=o?e:Ie(""),i=o?n:e,{theme:s}=_u();function a(){!t.value||!r.value||b2(t.value,r.value,i)}const l=R4(a,zne);He([t,r,s],a,{immediate:!0}),zr(t,l);function c(u){r.value=u}return{applyDsl:c}}function vc(t){return`data:image/svg+xml;base64,${globalThis.btoa(unescape(encodeURIComponent(t)))}`}function T$(){return document.documentElement.getAttribute("data-bs-theme")??"light"}const M$=t=>`blueprint-chart:${t}:thumbnail:${T$()}`,O$=t=>`blueprint-chart:${t}:preview:${T$()}`;function B$(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 L$(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"),B$(e),e.outerHTML}function Hne(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 C=globalThis.getComputedStyle(x);i.push({text:x.textContent??"",x:_.left-o.left,y:_.top-o.top+parseFloat(C.fontSize),fontSize:parseFloat(C.fontSize),fontWeight:C.fontWeight,fontFamily:C.fontFamily,fill:C.color,fontStyle:C.fontStyle!=="normal"?C.fontStyle:void 0})}const a=n.getBoundingClientRect(),l=a.left-o.left,c=a.top-o.top,u=a.width,d=a.height;B$(n);const f=n.cloneNode(!0);f.removeAttribute("width"),f.removeAttribute("height");const m=new XMLSerializer().serializeToString(f),b=Math.ceil(o.width),g=Math.ceil(o.height),v=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="${v(x.fontFamily)}" fill="${x.fill}"${x.fontStyle?` font-style="${x.fontStyle}"`:""}>${v(x.text)}</text>`).join(`
|
|
903
|
+
`);return[`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 ${b} ${g}">`,` <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")}"`:""}>`,m.replace(/^<svg[^>]*>/,"").replace(/<\/svg>$/,"")," </svg>"," </g>","</svg>"].join(`
|
|
904
|
+
`)}function y2(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 Wne(t){const e=t.match(/allowDarkMode\s*=\s*(true|false)/);return e?e[1]==="true":!0}const P$=600,x2=400,D$=[`#__bc_thumb .bc-frame { height:${x2}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(`
|
|
905
|
+
`);function E$(t){return document.documentElement.getAttribute("data-bs-theme")==="dark"&&!Wne(t)}function I$(t){const e=E$(t);return y2("__bc_thumb",P$,x2,D$,n=>(b2(n,t,{thumbnail:!0}),L$(n)),{forceLightTheme:e})}function w2(t,e,n,o,r){const i=c2(t);return!i||e.labels.length===0?null:y2("__bc_thumb",P$,x2,D$,s=>{const a=Xm(n);return i(s,e,{sort:o,...a,colorizes:r==null?void 0:r.colorizes,seriesOverrides:r==null?void 0:r.seriesOverrides}),L$(s)})}const Une=600,Gne=500,qne=["#__bc_preview .bc-frame { display:flex; flex-direction:column; }",`#__bc_preview .bc-frame-body { height:${Gne}px; min-height:0; }`].join(`
|
|
906
|
+
`);function R$(t){const e=E$(t);return y2("__bc_preview",Une,null,qne,n=>(b2(n,t,{padding:"12px"}),Hne(n)),{forceLightTheme:e})}function H1(t){return localStorage.getItem(M$(t))}function W1(t,e){localStorage.setItem(M$(t),e)}function N$(t){localStorage.removeItem(`blueprint-chart:${t}:thumbnail:light`),localStorage.removeItem(`blueprint-chart:${t}:thumbnail:dark`),localStorage.removeItem(`blueprint-chart:${t}:thumbnail`)}function Yne(t){return localStorage.getItem(O$(t))}function F$(t,e){localStorage.setItem(O$(t),e)}function jne(t){localStorage.removeItem(`blueprint-chart:${t}:preview:light`),localStorage.removeItem(`blueprint-chart:${t}:preview:dark`),localStorage.removeItem(`blueprint-chart:${t}:preview`)}function V$(t){return t.trimStart().startsWith("{")}function z$(t){if(!V$(t))return I$(t);const e=JSON.parse(t);if(!e.chartConfig)return null;const{chartConfig:n,chartTypeOptions:o}=e,r=Xs(n.data),i=[Be.BarVertical,Be.BarHorizontal,Be.Line,Be.VerticalBar,Be.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 w2(n.chartType,r,s,n.sort)}function Xne(t){return V$(t)?z$(t):R$(t)}function Kne(){const t=hn(),{currentOptions:e}=yn(),{sessionId:n}=Rs();if(!n.value||!t.data.value)return;const o=Xs(t.data.value),r=[Be.BarVertical,Be.BarHorizontal,Be.Line,Be.VerticalBar,Be.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=w2(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&&W1(n.value,i);const{generateDsl:s}=Of(),a=s();if(a){const l=R$(a);l&&F$(n.value,l)}}const f6="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";function jh(){let t="";for(let e=0;e<11;e++)t+=f6[Math.floor(Math.random()*f6.length)];return t}function pv(t){return`blueprint-chart:${t}`}function hh(t){return`blueprint-chart:${t}:meta`}function h6(t){return t.trimStart().startsWith("{")}const Zne=Bo("chartSession",()=>{const t=De(""),e=De(null),n=hn(),o=Ko(),r=Mr(),i=yn(),s=bn();function a(){if(!t.value)return;const{generateDsl:_}=Of();localStorage.setItem(pv(t.value),_());const C=new Date().toISOString(),L={savedAt:C};o.sourceFormat.value==="delimited"&&o.rawInput.value&&(L.rawInput=o.rawInput.value,L.sourceLabel=o.sourceLabel.value,L.sourceFormat="delimited"),localStorage.setItem(hh(t.value),JSON.stringify(L)),e.value=C}function l(_){const C=localStorage.getItem(pv(_));if(!C)return!1;try{if(h6(C)){const D=JSON.parse(C);if(D.chartConfig)return c(_,D)}const{applyDsl:L}=Oc();if(!L(C).success)return!1;const $=localStorage.getItem(hh(_));let M;return $&&(M=JSON.parse($),M.sourceFormat==="delimited"&&M.rawInput&&(o.rawInput.value=M.rawInput,o.sourceFormat.value="delimited",M.sourceLabel&&(o.sourceLabel.value=M.sourceLabel))),t.value=_,e.value=(M==null?void 0:M.savedAt)??null,!0}catch{return!1}}function c(_,C){try{return n.hydrate(C.chartConfig),C.dataTable&&o.hydrate(C.dataTable),t.value=_,!0}catch{return!1}}function u(){n.reset(),o.reset(),r.reset(),i.reset(),s.reset(),t.value=""}function d(){u(),e.value=null}function f(){return t.value=jh(),a(),v(),t.value}function h(){u(),t.value=jh()}function m(_){o.rawInput.value=_.tsvData;const C=z1(_.tsvData);o.loadParsed(C),n.data.value=o.serialize();const{applyDsl:L}=Oc();L(_.dsl)}function b(_){return l(_)}function g(_){if(!_)return null;try{Mf(_)}catch{return null}u();const{applyDsl:C}=Oc();return C(_).success?(t.value=jh(),a(),v(),t.value):(u(),null)}function v(){He([n.chartType,n.title,n.description,n.byline,n.note,n.source,n.sourceUrl,n.sort,n.data,n.selectedColumn,n.colorizes,n.highlights,n.areaFills,n.annotations,n.seriesOverrides,n.layout,o.columns,o.rows,o.rawInput,o.columnTypes,r.steps,s.scenes,s.activeIndex,()=>i.store],a,{deep:!0,flush:"post"})}function y(){var L;const _=[],C="blueprint-chart:";for(let O=0;O<localStorage.length;O++){const $=localStorage.key(O);if(!$||!$.startsWith(C))continue;const M=$.slice(C.length);if(M.includes(":"))continue;const D=localStorage.getItem($);if(D)try{if(h6(D)){const ie=JSON.parse(D);if(ie.chartConfig){_.push({id:M,title:ie.chartConfig.title||"",description:ie.chartConfig.description||"",chartType:ie.chartConfig.chartType||"",savedAt:ie.savedAt??null,sceneCount:((L=ie.chartConfig.scenes)==null?void 0:L.length)??0,rowCount:ie.chartConfig.data?ie.chartConfig.data.split(`
|
|
907
|
+
`).filter(ce=>ce.trim()).length-1:0,allowDarkMode:ie.chartConfig.allowDarkMode??!0});continue}}const N=D.match(/title\s*=\s*"([^"]*)"/),k=D.match(/description\s*=\s*"([^"]*)"/),A=D.match(/^chart\s+(\S+)/),B=D.match(/\bscene\s+"/g),P=D.match(/data\s*\{([^}]*)\}/),F=P?P[1].split(`
|
|
908
|
+
`).filter(ie=>ie.trim()&&ie.includes("=")).length:0,z=D.match(/allowDarkMode\s*=\s*(true|false)/),V=localStorage.getItem(hh(M)),G=V?JSON.parse(V).savedAt??null:null;_.push({id:M,title:(N==null?void 0:N[1])??"",description:(k==null?void 0:k[1])??"",chartType:(A==null?void 0:A[1])??"",savedAt:G,sceneCount:(B==null?void 0:B.length)??0,rowCount:F,allowDarkMode:z?z[1]==="true":!0})}catch{}}return _.sort((O,$)=>!O.savedAt&&!$.savedAt?0:O.savedAt?$.savedAt?$.savedAt.localeCompare(O.savedAt):-1:1),_}function x(_){localStorage.removeItem(pv(_)),localStorage.removeItem(hh(_)),N$(_)}return{sessionId:t,lastSavedAt:e,save:a,load:l,prepareNew:d,createSession:f,newChart:h,loadSample:m,loadChart:b,createFromDsl:g,startAutoSave:v,listSavedCharts:y,deleteChart:x}});function Rs(){const t=Zne(),{sessionId:e,lastSavedAt:n}=At(t);return{sessionId:e,lastSavedAt:n,save:t.save,load:t.load,prepareNew:t.prepareNew,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 _2=260,H$=660,W$=220,U$=_2+W$;function Qne(){const t=Math.floor(window.innerWidth*.35);return Math.min(H$,Math.max(_2,t))}const Su=Bo("panel",()=>{const t=De("docked"),e=De(Qne()),n=Ie({x:-1,y:16}),o=De({width:340,height:500}),r=De("docked"),i=De(!1),s=De(!1);function a(){t.value="docked",i.value||(r.value="docked")}function l(){t.value="floating",i.value||(r.value="floating")}function c(){t.value="closed",i.value||(r.value="closed")}function u(){if(t.value!=="closed")return;const x=r.value==="closed"?"docked":r.value;t.value=x,i.value||(r.value=x)}function d(){t.value!=="drawer"&&(r.value=t.value),t.value="drawer"}function f(){t.value=r.value}function h(){if(t.value==="docked")l();else if(t.value==="floating")a();else if(t.value==="closed"){const x=r.value==="closed"?"docked":r.value;t.value=x,r.value=x}}function m(x){e.value=Math.min(H$,Math.max(_2,x))}function b(x){i.value=x,x?t.value!=="drawer"&&(t.value="drawer"):t.value==="drawer"&&(t.value=r.value)}function g(x){i.value!==x&&(i.value=x,x?(t.value!=="drawer"&&(r.value=t.value),t.value="drawer"):t.value=r.value)}function v(x){s.value=x,x&&t.value!=="closed"&&t.value!=="drawer"&&(t.value="closed")}function y(x){s.value!==x&&(s.value=x,!i.value&&(x?(t.value!=="closed"&&t.value!=="drawer"&&(r.value=t.value),t.value="closed"):t.value==="closed"&&(t.value=r.value)))}return{mode:t,dockedWidth:e,floatingPosition:n,floatingSize:o,lastDesktopMode:r,narrow:i,cramped:s,dock:a,float:l,close:c,open:u,openDrawer:d,closeDrawer:f,toggleMode:h,setDockedWidth:m,initBreakpoint:b,syncBreakpoint:g,initCramped:v,syncCramped:y}},{persist:{key:"blueprint-chart:panel",pick:["mode","dockedWidth","lastDesktopMode"]}});function Zl(){const t=Su(),{mode:e,dockedWidth:n,floatingPosition:o,floatingSize:r,lastDesktopMode:i,narrow:s,cramped:a}=At(t);return{mode:e,dockedWidth:n,floatingPosition:o,floatingSize:r,lastDesktopMode:i,narrow:s,cramped:a,dock:t.dock,float:t.float,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 Jne=Bo("dashboardPanel",()=>{const t=De(null);function e(o){if(t.value===o){t.value=null;return}t.value=o;const r=Su();r.mode==="closed"&&r.open()}function n(){t.value=null}return{selectedChartId:t,selectChart:e,reset:n}});function G$(){const t=Jne(),{selectedChartId:e}=At(t);return{selectedChartId:e,selectChart:t.selectChart,reset:t.reset}}function q$(){const{listSavedCharts:t,deleteChart:e}=Rs(),{selectedChartId:n}=G$(),{resolvedTheme:o}=_u(),r=Ie([]),i=sr({}),s=sr({}),a=De("date-desc"),l=S(()=>{const b=[...r.value];return a.value==="date-desc"?b.sort((g,v)=>(v.savedAt??"").localeCompare(g.savedAt??"")):a.value==="date-asc"?b.sort((g,v)=>(g.savedAt??"").localeCompare(v.savedAt??"")):a.value==="name-asc"&&b.sort((g,v)=>(g.title||"").localeCompare(v.title||"")),b}),c=S(()=>r.value.find(b=>b.id===n.value)??null);function u(){r.value=t(),d()}function d(){for(const b of r.value){const g=H1(b.id),v=Yne(b.id);if(g&&(i[b.id]=vc(g)),v&&(s[b.id]=vc(v)),g&&v)continue;const y=localStorage.getItem(`blueprint-chart:${b.id}`);if(y)try{if(!g){const x=z$(y);x&&(W1(b.id,x),i[b.id]=vc(x))}if(!v){const x=Xne(y);x&&(F$(b.id,x),s[b.id]=vc(x))}}catch{}}}function f(b){const g=localStorage.getItem(`blueprint-chart:${b}`);if(!g)return null;const v=jh();localStorage.setItem(`blueprint-chart:${v}`,g);const y=localStorage.getItem(`blueprint-chart:${b}:meta`);y&&localStorage.setItem(`blueprint-chart:${v}:meta`,y);const x=H1(b);return x&&W1(v,x),u(),v}function h(b){n.value=null,e(b),delete i[b],delete s[b],u()}function m(){for(const b of r.value)N$(b.id),jne(b.id),delete i[b.id],delete s[b.id];d()}return He(o,()=>{m()}),{charts:r,sortedCharts:l,selectedChart:c,thumbnails:i,previews:s,sortValue:a,refresh:u,duplicateChart:f,removeChart:h}}const eoe={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function toe(t,e){return w(),R("svg",eoe,[...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 noe=$e({name:"ph-house",render:toe}),ooe={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function roe(t,e){return w(),R("svg",ooe,[...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 Y$=$e({name:"ph-squares-four",render:roe}),ioe={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function soe(t,e){return w(),R("svg",ioe,[...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 aoe=$e({name:"ph-github-logo",render:soe}),loe={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function coe(t,e){return w(),R("svg",loe,[...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 uoe=$e({name:"ph-book-open",render:coe}),doe={class:"layout-sidebar__header"},foe=le({__name:"LayoutSidebar",setup(t){const e=zl(),{sortedCharts:n}=q$(),{resolvedTheme:o}=_u(),r=S(()=>n.value.slice(0,5)),i=S(()=>e.path==="/"),s=S(()=>e.path.startsWith("/charts")),a=S(()=>o.value==="dark"?x$:y$);return(l,c)=>(w(),K(p(EW),{"aria-label":"Workspace navigation"},{header:Q(()=>[T("div",doe,[H(p(gC),{name:"Blueprint Chart","logo-src":a.value,to:"/"},null,8,["logo-src"]),Se(l.$slots,"trailing",{},void 0,!0)])]),default:Q(()=>[H(p(Ug),{eyebrow:"Workspace"},{default:Q(()=>[H(p(Vu),{to:"/",label:"Home",active:i.value},{icon:Q(()=>[H(p(noe))]),_:1},8,["active"]),H(p(Vu),{to:"/charts",label:"My Charts",active:s.value,count:p(n).length||void 0},{icon:Q(()=>[H(p(Y$))]),_:1},8,["active","count"])]),_:1}),r.value.length?(w(),K(p(Ug),{key:0,eyebrow:"Recent"},{default:Q(()=>[(w(!0),R(Ne,null,gt(r.value,u=>(w(),K(p(Vu),{key:u.id,to:`/edit/${u.id}`,label:u.title||"Untitled"},null,8,["to","label"]))),128))]),_:1})):ae("",!0),H(p(Ug),{eyebrow:"Resources"},{default:Q(()=>[H(p(Vu),{href:"https://docs.blueprintchart.com",label:"Documentation"},{icon:Q(()=>[H(p(uoe))]),_:1}),H(p(Vu),{href:"https://github.com/blueprint-chart/blueprint-chart",label:"GitHub"},{icon:Q(()=>[H(p(aoe))]),_:1})]),_:1})]),_:3}))}}),p6=Le(foe,[["__scopeId","data-v-34084162"]]),hoe={class:"command-palette-modal"},poe={class:"command-palette-modal__input-row"},moe={key:0,class:"command-palette-modal__results",role:"listbox","aria-label":"Chart results"},goe=["aria-selected","onClick","onMousemove"],voe=["src"],boe={class:"command-palette-modal__meta"},yoe={class:"command-palette-modal__title"},xoe={class:"command-palette-modal__desc"},woe={key:1,class:"command-palette-modal__empty"},_oe=le({__name:"CommandPaletteModal",props:{open:{type:Boolean,required:!0},openModifiers:{}},emits:["update:open"],setup(t){const e=ht(t,"open"),n=uy(),o=zl(),{listSavedCharts:r}=Rs(),i=Ie(""),s=Ie(0),a=ft("inputRef"),l=Ie([]),c=S(()=>{const g=i.value.trim().toLowerCase();return g?l.value.filter(v=>{var y,x;return((y=v.title)==null?void 0:y.toLowerCase().includes(g))||((x=v.description)==null?void 0:x.toLowerCase().includes(g))}):l.value.slice(0,5)}),u=S(()=>{const g={};for(const v of l.value){const y=H1(v.id);y&&(g[v.id]=vc(y))}return g});He(i,()=>{s.value=0}),He(()=>o.path,()=>{e.value&&(e.value=!1)}),He(e,g=>{g?l.value=r():(i.value="",s.value=0)},{immediate:!0});function d(){var g;(g=a.value)==null||g.focus()}function f(g){const v=c.value.length-1;if(v<0)return;let y=s.value+g;y<0&&(y=v),y>v&&(y=0),s.value=y}function h(){const g=c.value[s.value];g&&m(g.id)}function m(g){e.value=!1,n.push(`/edit/${g}`)}function b(g){return{"command-palette-modal__result":!0,"command-palette-modal__result--active":g===s.value}}return(g,v)=>(w(),K(p(UD),{modelValue:e.value,"onUpdate:modelValue":v[4]||(v[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:Q(()=>[T("div",hoe,[T("div",poe,[H(p(Sy),{class:"command-palette-modal__icon"}),H(p(Ws),{ref_key:"inputRef",ref:a,modelValue:p(i),"onUpdate:modelValue":v[0]||(v[0]=y=>Ke(i)?i.value=y:null),"aria-label":"Search charts",placeholder:"Search charts…",autofocus:"",onKeydown:[v[1]||(v[1]=tr(vn(y=>e.value=!1,["prevent"]),["escape"])),v[2]||(v[2]=tr(vn(y=>f(1),["prevent"]),["down"])),v[3]||(v[3]=tr(vn(y=>f(-1),["prevent"]),["up"])),tr(vn(h,["prevent"]),["enter"])]},null,8,["modelValue","onKeydown"])]),p(c).length>0?(w(),R("div",moe,[(w(!0),R(Ne,null,gt(p(c),(y,x)=>(w(),R("div",{key:y.id,class:Me(b(x)),role:"option",tabindex:"-1","aria-selected":x===p(s),onClick:_=>m(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,voe)):ae("",!0),T("div",boe,[T("span",yoe,xe(y.title||"Untitled"),1),T("span",xoe,xe(y.description),1)])],42,goe))),128))])):p(i).trim()?(w(),R("div",woe,' No charts match "'+xe(p(i))+'" ',1)):ae("",!0)])]),_:1},8,["modelValue"]))}}),m6=Le(_oe,[["__scopeId","data-v-09e7b11e"]]);function Soe(){const{isNarrow:t}=Wl(),e=Su();e.initBreakpoint(t.value),He(t,n=>{e.syncBreakpoint(n)})}const koe={key:0,class:"layout-shell layout-shell--landing"},Coe={key:1,class:"layout-shell layout-shell--app"},Aoe={class:"layout-shell__sidebar"},$oe={class:"layout-shell__topbar"},Toe={class:"layout-shell__main"},Moe=le({__name:"LayoutShell",setup(t){Soe();const e=zl(),n=S(()=>e.path==="/"),o=De(!1),r=v$("k"),{isNarrow:i}=Wl("xl"),s=Ie(!1);return He(()=>e.fullPath,()=>{s.value=!1}),He(i,a=>{a||(s.value=!1)}),Yi(document,"keydown",a=>{r.matches(a)&&(a.preventDefault(),o.value=!0)}),(a,l)=>{const c=jD;return n.value?(w(),R("div",koe,[Se(a.$slots,"default",{},void 0,!0),H(m6,{open:o.value,"onUpdate:open":l[0]||(l[0]=u=>o.value=u)},null,8,["open"])])):(w(),R("div",Coe,[T("aside",Aoe,[H(p6)]),T("div",$oe,[H(une,{"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",Toe,[Se(a.$slots,"default",{},void 0,!0)]),p(i)?(w(),K(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:Q(()=>[H(p6,null,{trailing:Q(()=>[H(p(_y),{onClick:l[3]||(l[3]=u=>s.value=!1)})]),_:1})]),_:1},8,["modelValue"])):ae("",!0),H(m6,{open:o.value,"onUpdate:open":l[5]||(l[5]=u=>o.value=u)},null,8,["open"])]))}}}),Ooe=Le(Moe,[["__scopeId","data-v-42f29e84"]]),Boe=le({__name:"App",setup(t){const e=zl();return(n,o)=>{const r=Up("router-view"),i=Ooe;return p(e).meta.bare?(w(),K(r,{key:0})):(w(),K(i,{key:1},{default:Q(()=>[H(r)]),_:1}))}}}),Loe="modulepreload",Poe=function(t){return"/"+t},g6={},v6=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=Poe(c),c in g6)return;g6[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":Loe,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((h,m)=>{f.addEventListener("load",h),f.addEventListener("error",()=>m(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)})};function Doe(t,e,n,o=".panel-floating"){let r=!1,i=0,s=0;function a(u){const d=u.target;if(d.closest("button")&&!d.closest(".button-drag")||!t.value)return;r=!0;const f=t.value.closest(o);if(!f)return;const h=f.getBoundingClientRect();i=u.clientX-h.left,s=u.clientY-h.top,u.preventDefault()}function l(u){var y;if(!r||!e.value)return;const d=e.value.getBoundingClientRect();let f=u.clientX-d.left-i,h=u.clientY-d.top-s;const m=(y=t.value)==null?void 0:y.closest(o),b=(m==null?void 0:m.offsetWidth)??340,g=(m==null?void 0:m.offsetHeight)??400,v=16;f=Math.max(v,Math.min(f,d.width-b-v)),h=Math.max(v,Math.min(h,d.height-g-v)),n.x=f,n.y=h}function c(){r=!1}return Yi(t,"mousedown",a),Yi(document,"mousemove",l),Yi(document,"mouseup",c),{isDragging:r}}const Eoe={class:"panel-floating__header__title"},Ioe={class:"panel-floating__header__actions"},Roe={key:0,class:"panel-floating__toolbar"},Noe={class:"panel-floating__body"},Foe={key:1,class:"panel-floating__footer"},na=16,Voe=le({__name:"PanelFloating",props:{containerRef:{},title:{},position:{},showClose:{type:Boolean,default:!0}},emits:["dock","close"],setup(t){const e=t,n=ft("headerRef"),o=ft("panelRef"),r=S(()=>e.containerRef),i=Ft(e,"position");function s(){var h,m;const l=e.containerRef;if(!l)return;const c=((h=o.value)==null?void 0:h.offsetWidth)||340,u=((m=o.value)==null?void 0:m.offsetHeight)||400,d=Math.max(na,l.clientWidth-c-na),f=Math.max(na,l.clientHeight-u-na);i.value.x=Math.min(Math.max(na,i.value.x),d),i.value.y=Math.min(Math.max(na,i.value.y),f)}fn(()=>{var l;if(i.value.x<0&&e.containerRef){const c=((l=o.value)==null?void 0:l.offsetWidth)||340;i.value.x=e.containerRef.clientWidth-c-na,i.value.y=Math.max(na,i.value.y)}s()}),zr(r,s),Doe(n,r,i.value);const a=S(()=>({left:`${i.value.x}px`,top:`${i.value.y}px`}));return(l,c)=>(w(),R("div",{ref_key:"panelRef",ref:o,class:"panel-floating",style:Ot(p(a))},[T("div",{ref_key:"headerRef",ref:n,class:"panel-floating__header"},[T("div",Eoe,[H(p(PH)),Ge(" "+xe(t.title),1)]),T("div",Ioe,[H(p(TH),{onClick:c[0]||(c[0]=u=>l.$emit("dock"))}),t.showClose?(w(),K(p(_y),{key:0,onClick:c[1]||(c[1]=u=>l.$emit("close"))})):ae("",!0)])],512),Se(l.$slots,"tabs",{},void 0,!0),l.$slots.toolbar?(w(),R("div",Roe,[Se(l.$slots,"toolbar",{},void 0,!0)])):ae("",!0),T("div",Noe,[Se(l.$slots,"default",{},void 0,!0)]),l.$slots.footer?(w(),R("div",Foe,[Se(l.$slots,"footer",{},void 0,!0)])):ae("",!0)],4))}}),zoe=Le(Voe,[["__scopeId","data-v-1b84ef9f"]]),b6=260,y6=660,Hoe=le({__name:"PanelDocked",props:rt({collapsed:{type:Boolean},title:{},initialWidth:{default:330},showClose:{type:Boolean,default:!0},canvasWidth:{default:void 0}},{modelValue:{},modelModifiers:{}}),emits:rt(["float","close"],["update:modelValue"]),setup(t){const e=t,n=ht(t,"modelValue"),o=De(n.value??e.initialWidth);He(n,c=>{c!==void 0&&(o.value=c)});const r=De(!1),i=S(()=>({"panel-docked--collapsed":e.collapsed,"panel-docked--resizing":r.value})),s=S(()=>e.canvasWidth===void 0||e.canvasWidth<=0?y6:Math.min(y6,e.canvasWidth-W$)),a=S(()=>Math.max(b6,Math.min(o.value,s.value)));function l(c){const u=c.clientX,d=o.value,f=c.currentTarget;f.setPointerCapture(c.pointerId),r.value=!0;function h(b){const g=u-b.clientX;o.value=Math.min(s.value,Math.max(b6,d+g)),n.value=o.value}function m(){r.value=!1,f.removeEventListener("pointermove",h),f.removeEventListener("pointerup",m)}f.addEventListener("pointermove",h),f.addEventListener("pointerup",m)}return(c,u)=>(w(),R("div",{class:Me(["panel-docked",p(i)]),style:Ot({width:t.collapsed?void 0:`${p(a)}px`})},[T("div",{class:"panel-docked__resize-handle",onPointerdown:l},null,32),H(p(sW),{title:t.title},xr({actions:Q(()=>[H(p(kH),{onClick:u[0]||(u[0]=d=>c.$emit("float"))}),t.showClose?(w(),K(p(_y),{key:0,onClick:u[1]||(u[1]=d=>c.$emit("close"))})):ae("",!0)]),default:Q(()=>[Se(c.$slots,"default",{},void 0,!0)]),_:2},[c.$slots.toolbar?{name:"toolbar",fn:Q(()=>[Se(c.$slots,"toolbar",{},void 0,!0)]),key:"0"}:void 0,c.$slots.footer?{name:"footer",fn:Q(()=>[Se(c.$slots,"footer",{},void 0,!0)]),key:"1"}:void 0]),1032,["title"])],6))}}),Woe=Le(Hoe,[["__scopeId","data-v-678d2a94"]]),Uoe={class:"panel-drawer__body"},Goe=le({__name:"PanelDrawer",props:rt({title:{}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=ht(t,"modelValue");return(n,o)=>(w(),K(p(ZH),{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=r=>e.value=r),title:t.title},{default:Q(()=>[Se(n.$slots,"header",{},void 0,!0),T("div",Uoe,[Se(n.$slots,"default",{},void 0,!0)])]),_:3},8,["modelValue","title"]))}}),qoe=Le(Goe,[["__scopeId","data-v-46314d76"]]);function Yoe(t){const{width:e}=FI(t),n=Su(),o=S(()=>e.value>0&&e.value<U$);return n.initCramped(o.value),He(o,r=>{n.syncCramped(r)}),{canvasWidth:e}}const Zm=le({__name:"PanelShell",props:rt({title:{},containerRef:{default:null},showClose:{type:Boolean,default:!0}},{drawerOpen:{type:Boolean,default:!1},drawerOpenModifiers:{}}),emits:rt(["close"],["update:drawerOpen"]),setup(t,{emit:e}){const n=t,o=e,r=ht(t,"drawerOpen"),i=Su(),{mode:s,dockedWidth:a,floatingPosition:l}=At(i),{dock:c,float:u,close:d}=i,f=S(()=>{var b;return((b=n.containerRef)==null?void 0:b.parentElement)??null}),{canvasWidth:h}=Yoe(f);He(h,b=>{b>0&&b<U$&&s.value==="floating"&&c()},{flush:"sync"});function m(){d(),o("close")}return(b,g)=>{const v=qoe,y=Woe,x=zoe;return p(s)==="drawer"?(w(),K(v,{key:0,modelValue:r.value,"onUpdate:modelValue":g[0]||(g[0]=_=>r.value=_),title:t.title},xr({default:Q(()=>[Se(b.$slots,"default")]),_:2},[b.$slots.tabs||b.$slots.header?{name:"header",fn:Q(()=>[Se(b.$slots,"tabs"),Se(b.$slots,"header")]),key:"0"}:void 0]),1032,["modelValue","title"])):p(s)==="docked"?(w(),K(y,{key:1,modelValue:p(a),"onUpdate:modelValue":g[1]||(g[1]=_=>Ke(a)?a.value=_:null),collapsed:!1,title:t.title,"show-close":t.showClose,"canvas-width":p(h),onFloat:p(u),onClose:m},xr({default:Q(()=>[Se(b.$slots,"default")]),_:2},[b.$slots.header?{name:"toolbar",fn:Q(()=>[Se(b.$slots,"header")]),key:"0"}:void 0,b.$slots.footer?{name:"footer",fn:Q(()=>[Se(b.$slots,"footer")]),key:"1"}:void 0]),1032,["modelValue","title","show-close","canvas-width","onFloat"])):p(s)==="floating"&&t.containerRef?(w(),K(zp,{key:2,to:t.containerRef},[H(x,{"container-ref":t.containerRef,title:t.title,position:p(l),"show-close":t.showClose,onDock:p(c),onClose:m},xr({default:Q(()=>[Se(b.$slots,"default")]),_:2},[b.$slots.tabs?{name:"tabs",fn:Q(()=>[Se(b.$slots,"tabs")]),key:"0"}:void 0,b.$slots.header?{name:"toolbar",fn:Q(()=>[Se(b.$slots,"header")]),key:"1"}:void 0,b.$slots.footer?{name:"footer",fn:Q(()=>[Se(b.$slots,"footer")]),key:"2"}:void 0]),1032,["container-ref","title","position","show-close","onDock"])],8,["to"])):ae("",!0)}}}),joe={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Xoe(t,e){return w(),R("svg",joe,[...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 j$=$e({name:"ph-cursor-click",render:Xoe}),Koe={class:"dashboard-empty-state"},Zoe=le({__name:"DashboardEmptyState",setup(t){return(e,n)=>(w(),R("div",Koe,[H(p(j$),{class:"dashboard-empty-state__icon"}),n[0]||(n[0]=T("p",{class:"dashboard-empty-state__text"}," Select a chart to see its details ",-1))]))}}),Qoe=Le(Zoe,[["__scopeId","data-v-f6c24334"]]),Joe={class:"dashboard-action-row__label"},ere={key:0,class:"dashboard-action-row__description"},tre=le({__name:"DashboardActionRow",props:{icon:{},label:{},description:{},danger:{type:Boolean}},emits:["click"],setup(t){const e=t,n=S(()=>({"dashboard-action-row--danger":e.danger}));return(o,r)=>(w(),R("button",{class:Me(["dashboard-action-row",p(n)]),onClick:r[0]||(r[0]=i=>o.$emit("click"))},[(w(),K(on(t.icon),{class:"dashboard-action-row__icon"})),T("div",null,[T("div",Joe,xe(t.label),1),t.description?(w(),R("div",ere,xe(t.description),1)):ae("",!0)])],2))}}),nre=Le(tre,[["__scopeId","data-v-0f47d7d3"]]),ore={class:"dashboard-detail-actions"},rre={class:"dashboard-detail-actions__list"},ire=le({__name:"DashboardDetailActions",emits:["duplicate","delete"],setup(t){return(e,n)=>{const o=nre;return w(),R("div",ore,[n[2]||(n[2]=T("div",{class:"dashboard-detail-actions__title"}," Actions ",-1)),T("div",rre,[H(o,{icon:p(W4),label:"Duplicate",description:"Create a copy to edit",onClick:n[0]||(n[0]=r=>e.$emit("duplicate"))},null,8,["icon"]),H(o,{icon:p(bC),label:"Delete chart",description:"This cannot be undone",danger:"",onClick:n[1]||(n[1]=r=>e.$emit("delete"))},null,8,["icon"])])])}}}),sre=Le(ire,[["__scopeId","data-v-de396b53"]]),are={class:"dashboard-meta-chip"},lre={class:"dashboard-meta-chip__label"},cre={class:"dashboard-meta-chip__value"},ure=le({__name:"DashboardMetaChip",props:{label:{},value:{}},setup(t){return(e,n)=>(w(),R("div",are,[T("div",lre,xe(t.label),1),T("div",cre,xe(t.value),1)]))}}),dre=Le(ure,[["__scopeId","data-v-a1903aff"]]),fre={class:"dashboard-detail-meta"},hre={class:"dashboard-detail-meta__grid"},pre=le({__name:"DashboardDetailMeta",props:{chartType:{},savedAt:{},sceneCount:{},rowCount:{}},setup(t){const e=t,n=S(()=>dC(e.chartType)),o=S(()=>{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=dre;return w(),R("div",fre,[i[0]||(i[0]=T("div",{class:"dashboard-detail-meta__title"}," Details ",-1)),T("div",hre,[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"])])])}}}),mre=Le(pre,[["__scopeId","data-v-533a4b72"]]),gre=["data-bs-theme"],vre=["src"],bre=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,vre)],8,gre)):ae("",!0)}}),yre=Le(bre,[["__scopeId","data-v-ddbd95be"]]),xre={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function wre(t,e){return w(),R("svg",xre,[...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 S2=$e({name:"ph-pencil-simple",render:wre}),_re={class:"dashboard-detail-content"},Sre={key:0,class:"dashboard-detail-content__subtitle"},kre=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=yre,r=mre,i=sre;return w(),R("div",_re,[t.subtitle?(w(),R("div",Sre,xe(t.subtitle),1)):ae("",!0),H(p(Rn),{"icon-left":p(S2),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"))})])}}}),Cre=Le(kre,[["__scopeId","data-v-3d8b1e29"]]),Are=le({__name:"DashboardChartCard",props:{chart:{},thumbSrc:{},selected:{type:Boolean},layout:{}},emits:["select","edit"],setup(t){const{resolvedTheme:e}=_u();return(n,o)=>(w(),K(p(yU),{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:Q(()=>[H(p(Rn),{"icon-left":p(S2),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:Q(()=>[H(p(Kz),{"chart-type":t.chart.chartType,theme:p(e)},null,8,["chart-type","theme"]),t.chart.savedAt?(w(),K(p(Lz),{key:0,value:t.chart.savedAt},null,8,["value"])):ae("",!0)]),_:1},8,["title","subtitle","thumb-src","selected","layout","force-light-thumb"]))}}),$re=le({__name:"DashboardNewCard",props:{layout:{default:"grid"}},emits:["click"],setup(t){const e=t,n=S(()=>({"dashboard-new-card--row":e.layout==="row"}));return(o,r)=>(w(),R("div",{class:Me(["dashboard-new-card",p(n)]),role:"button",tabindex:"0",onClick:r[0]||(r[0]=i=>o.$emit("click")),onKeydown:[r[1]||(r[1]=tr(i=>o.$emit("click"),["enter"])),r[2]||(r[2]=tr(vn(i=>o.$emit("click"),["prevent"]),["space"]))]},[H(p(gy),{class:"dashboard-new-card__icon"}),r[3]||(r[3]=T("span",{class:"dashboard-new-card__label"},"New Chart",-1))],34))}}),Tre=Le($re,[["__scopeId","data-v-ef746b42"]]),Mre=le({__name:"DashboardGallery",props:{charts:{},thumbnails:{},selectedId:{},layout:{}},emits:["select","edit","new"],setup(t){return(e,n)=>{const o=Tre,r=Are;return w(),K(p(wU),{layout:t.layout},{default:Q(()=>[H(o,{layout:t.layout,onClick:n[0]||(n[0]=i=>e.$emit("new"))},null,8,["layout"]),(w(!0),R(Ne,null,gt(t.charts,i=>(w(),K(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(),K(p(GH),{key:0,message:"No saved charts yet. Create a new chart to get started."})):ae("",!0)]),_:1},8,["layout"])}}}),Ore={},Bre={class:"layout-page-header"},Lre={class:"layout-page-header__start"},Pre={class:"layout-page-header__center"},Dre={class:"layout-page-header__end"};function Ere(t,e){return w(),R("div",Bre,[T("div",Lre,[Se(t.$slots,"start",{},void 0,!0)]),T("div",Pre,[Se(t.$slots,"center",{},void 0,!0)]),T("div",Dre,[Se(t.$slots,"end",{},void 0,!0)])])}const X$=Le(Ore,[["render",Ere],["__scopeId","data-v-a1256380"]]),Ire={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Rre(t,e){return w(),R("svg",Ire,[...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 Nre=$e({name:"ph-rows",render:Rre}),Fre={class:"dashboard-toolbar__count"},Vre=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=S(()=>[{key:"grid",text:"Grid",icon:Y$,active:e.layout==="grid"},{key:"row",text:"List",icon:Nre,active:e.layout==="row"}]);return(r,i)=>(w(),K(X$,{class:"dashboard-toolbar"},{start:Q(()=>[i[3]||(i[3]=T("h1",{class:"dashboard-toolbar__title bc-display"}," My Charts ",-1)),T("span",Fre,xe(t.chartCount)+" "+xe(t.chartCount===1?"chart":"charts"),1)]),end:Q(()=>[H(p(mC),{items:p(o),"aria-label":"View layout",onSelect:i[0]||(i[0]=s=>r.$emit("update:layout",s))},null,8,["items"]),H(p(Dn),{"model-value":t.sortValue,options:n,"onUpdate:modelValue":i[1]||(i[1]=s=>r.$emit("update:sortValue",s))},null,8,["model-value"]),H(p(Rn),{"icon-left":p(gy),label:"New chart",variant:"primary",onClick:i[2]||(i[2]=s=>r.$emit("new"))},null,8,["icon-left"])]),_:1}))}}),zre=Le(Vre,[["__scopeId","data-v-b18d8e1e"]]),Hre={class:"dashboard-page-wrapper d-flex flex-column flex-grow-1"},Wre=le({__name:"DashboardPage",setup(t){const e=uy(),{isNarrow:n}=Wl(),{selectedChartId:o,selectChart:r}=G$(),{mode:i}=At(Su()),{sortedCharts:s,selectedChart:a,thumbnails:l,previews:c,sortValue:u,refresh:d,duplicateChart:f,removeChart:h}=q$(),m=ft("galleryRef"),b=De("grid"),g=S(()=>({"dashboard-page":!0,"dashboard-page--narrow":n.value})),v=S(()=>a.value?a.value.title||"Untitled":"Chart details");function y(){o.value=null}const x=S({get:()=>o.value!==null,set:$=>{$||(o.value=null)}});function _(){o.value&&e.push(`/edit/${o.value}`)}function C(){if(o.value){const $=f(o.value);$&&e.push(`/edit/${$}`)}}function L(){o.value&&h(o.value)}function O($){$.key==="Escape"&&(o.value=null)}return fn(()=>{d(),document.addEventListener("keydown",O)}),zs(()=>{document.removeEventListener("keydown",O)}),($,M)=>{const D=zre,N=Mre,k=Cre,A=Qoe,B=Zm;return w(),R("div",Hre,[H(D,{"chart-count":p(s).length,"sort-value":p(u),layout:p(b),"onUpdate:sortValue":M[0]||(M[0]=P=>u.value=P),"onUpdate:layout":M[1]||(M[1]=P=>b.value=P),onNew:M[2]||(M[2]=P=>p(e).push("/new"))},null,8,["chart-count","sort-value","layout"]),T("div",{class:Me(p(g))},[T("div",{ref_key:"galleryRef",ref:m,class:"dashboard-page__gallery"},[H(N,{charts:p(s),thumbnails:p(l),"selected-id":p(o),layout:p(b),onSelect:p(r),onEdit:M[3]||(M[3]=P=>p(e).push(`/edit/${P}`)),onNew:M[4]||(M[4]=P=>p(e).push("/new"))},null,8,["charts","thumbnails","selected-id","layout","onSelect"])],512),H(B,{"drawer-open":p(x),"onUpdate:drawerOpen":M[5]||(M[5]=P=>Ke(x)?x.value=P:null),title:p(v),"container-ref":p(m),"show-close":!1,onClose:y},{default:Q(()=>[p(a)?(w(),K(k,{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:C,onDelete:L},null,8,["title","subtitle","preview-src","force-light-theme","chart-type","saved-at","scene-count","row-count"])):p(i)==="docked"?(w(),K(A,{key:1})):ae("",!0)]),_:1},8,["drawer-open","title","container-ref"])],2)])}}}),Ure=Le(Wre,[["__scopeId","data-v-fe7a5a93"]]),Oi=[{label:"Data",key:"data"},{label:"Visualize",key:"edit"},{label:"Export",key:"export"}];function Gre(t){return t.endsWith("/export")?"export":t.endsWith("/visualize")?"edit":(t.endsWith("/data"),"data")}function qre(t,e){return e==="edit"?`/edit/${t}/visualize`:`/edit/${t}/${e}`}const mv=Ie(null);function k2(){const t=zl(),e=uy(),n=S(()=>{const h=Gre((t==null?void 0:t.path)??"/new");return Oi.find(m=>m.key===h)??Oi[0]}),o=S({get:()=>Oi.indexOf(n.value),set:h=>{u(h)}}),r=S(()=>o.value===0),i=S(()=>o.value===Oi.length-1);function s(){var m;const h=(m=t==null?void 0:t.params)==null?void 0:m.id;return h||(mv.value?mv.value():null)}function a(h){const m=s();m&&e&&e.replace(qre(m,h))}function l(){const h=o.value;h<Oi.length-1&&a(Oi[h+1].key)}function c(){const h=o.value;h>0&&a(Oi[h-1].key)}function u(h){h>=0&&h<Oi.length&&a(Oi[h].key)}function d(){}function f(h){mv.value=h}return{currentIndex:o,steps:Oi,currentStep:n,isFirst:r,isLast:i,next:l,back:c,goTo:u,reset:d,registerCreateSession:f}}const Yre={class:"panel-stepper-footer"},jre=le({__name:"PanelStepperFooter",setup(t){const{steps:e,currentIndex:n,isFirst:o,isLast:r,next:i,back:s}=k2(),a=S(()=>{var c;return((c=e[n.value-1])==null?void 0:c.label)??"Previous"}),l=S(()=>{var c;return((c=e[n.value+1])==null?void 0:c.label)??"Next"});return(c,u)=>(w(),R("div",Yre,[p(o)?ae("",!0):(w(),K(p(Rn),{key:0,"icon-left":p(yC),"icon-left-size":"1em",label:p(a),variant:"outline-secondary",size:"sm",onClick:p(s)},null,8,["icon-left","label","onClick"])),p(r)?ae("",!0):(w(),K(p(Rn),{key:1,"icon-right":p(xC),"icon-right-size":"1em",label:p(l),variant:"primary",size:"sm",class:"ms-auto",onClick:p(i)},null,8,["icon-right","label","onClick"]))]))}}),C2=Le(jre,[["__scopeId","data-v-52b4dceb"]]),Xre={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Kre(t,e){return w(),R("svg",Xre,[...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 K$=$e({name:"ph-download-simple",render:Kre}),Zre={class:"format-card__header"},Qre={class:"format-card__header__text"},Jre={class:"format-card__header__text__label"},eie={class:"format-card__header__text__desc"},tie={key:0,class:"format-card__options"},nie=le({__name:"ExportDownloadFormatCard",props:{selected:{type:Boolean},icon:{},label:{},description:{},iconBg:{},iconColor:{}},emits:["select","download"],setup(t){return(e,n)=>(w(),R("div",{class:Me(["format-card",{"format-card--selected":t.selected}]),onClick:n[1]||(n[1]=o=>e.$emit("select"))},[T("div",Zre,[T("span",{class:"format-card__header__icon",style:Ot({background:t.iconBg,color:t.iconColor})},[(w(),K(on(t.icon)))],4),T("div",Qre,[T("div",Jre,xe(t.label),1),T("div",eie,xe(t.description),1)]),H(p(Rn),{"icon-left":p(K$),label:"Download","hide-label":"",variant:"primary",size:"sm",square:"",onClick:n[0]||(n[0]=vn(o=>e.$emit("download"),["stop"]))},null,8,["icon-left"])]),t.selected&&e.$slots.default?(w(),R("div",tie,[Se(e.$slots,"default",{},void 0,!0)])):ae("",!0)],2))}}),oie=Le(nie,[["__scopeId","data-v-3ac1c5b6"]]);function Bf(t,e){const n=URL.createObjectURL(t),o=document.createElement("a");o.href=n,o.download=e,o.click(),URL.revokeObjectURL(n)}function rie(t,e="chart.svg"){const o=new XMLSerializer().serializeToString(t),r=new Blob([o],{type:"image/svg+xml;charset=utf-8"});Bf(r,e)}function iie(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}Bf(h,o),l()},"image/png")},u.onerror=()=>{URL.revokeObjectURL(a),c(new Error("Failed to load SVG image"))},u.src=a})}function Z$(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]&&Z$(r[s],i[s])}function sie(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 aie(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);Z$(t,f),f.querySelectorAll("[data-scene-player]").forEach(C=>C.remove()),f.style.setProperty("pointer-events","auto"),f.style.setProperty("transition","none"),f.style.setProperty("animation","none");const m=new XMLSerializer().serializeToString(f),b=a.left,g=a.top,v=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})">`,v,`<foreignObject x="${b}" y="${g}" width="${i}" height="${s}">`,m,"</foreignObject>","</g>","</svg>"].join(""),x=new Blob([y],{type:"image/svg+xml;charset=utf-8"}),_=URL.createObjectURL(x);return new Promise((C,L)=>{const O=new Image;O.onload=()=>{const $=document.createElement("canvas");$.width=u,$.height=d;const M=$.getContext("2d");if(!M){URL.revokeObjectURL(_),L(new Error("Could not get canvas context"));return}M.drawImage(O,0,0,u,d),$.toBlob(D=>{if(URL.revokeObjectURL(_),!D){L(new Error("Could not create PNG blob"));return}Bf(D,n),C()},"image/png")},O.onerror=()=>{URL.revokeObjectURL(_),L(new Error("Failed to render frame as image"))},O.src=_})}function gv(t){const e=globalThis.getComputedStyle(t);return{fontSize:parseFloat(e.fontSize),fontWeight:e.fontWeight,fontFamily:e.fontFamily,fill:e.color,fontStyle:e.fontStyle}}function Q$(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 lie(t,e="chart.svg"){const n=t.querySelector("svg");if(!n)return;const o=t.getBoundingClientRect(),r=Q$(t),i=new XMLSerializer,s=[],a=t.querySelectorAll(".bc-frame-title, .bc-frame-description");for(const O of a){const $=O.getBoundingClientRect(),M=gv(O);s.push({text:O.textContent??"",x:$.left-o.left,y:$.top-o.top+M.fontSize,...M})}const l=t.querySelector(".bc-frame-note");if(l&&l.textContent&&l.style.display!=="none"){const O=l.getBoundingClientRect(),$=gv(l);s.push({text:l.textContent,x:O.left-o.left,y:O.top-o.top+$.fontSize,...$})}const c=t.querySelectorAll(".bc-frame-byline, .bc-frame-source, .bc-frame-credit");for(const O of c){const $=O.getBoundingClientRect();if($.width===0)continue;const M=gv(O);s.push({text:O.textContent??"",x:$.left-o.left,y:$.top-o.top+M.fontSize,...M})}const u=n.getBoundingClientRect(),d=u.left-o.left,f=u.top-o.top,h=u.width,m=u.height,b=n.cloneNode(!0);b.removeAttribute("width"),b.removeAttribute("height");const g=i.serializeToString(b),v=Math.ceil(o.width),y=Math.ceil(o.height),x=O=>O.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),_=s.map(O=>`<text x="${O.x}" y="${O.y}" font-size="${O.fontSize}px" font-weight="${O.fontWeight}" font-family="${x(O.fontFamily)}" fill="${O.fill}"${O.fontStyle&&O.fontStyle!=="normal"?` font-style="${O.fontStyle}"`:""}>${x(O.text)}</text>`).join(`
|
|
909
|
+
`),C=[`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="${v}" height="${y}" viewBox="0 0 ${v} ${y}">`,` <rect width="100%" height="100%" fill="${r}" />`,` ${_}`,` <g transform="translate(${d},${f})">`,` <svg width="${h}" height="${m}"${b.getAttribute("viewBox")?` viewBox="${b.getAttribute("viewBox")}"`:""}>`,g.replace(/^<svg[^>]*>/,"").replace(/<\/svg>$/,"")," </svg>"," </g>","</svg>"].join(`
|
|
910
|
+
`),L=new Blob([C],{type:"image/svg+xml;charset=utf-8"});Bf(L,e)}const cie=Bo("exportPanel",()=>{const t=De("embed"),e=De("png"),n=De(2),o=De(!1),r=De(!1),i=De(!0),s=De(!1);function a(u){t.value=u}function l(u){e.value=u}function c(){t.value="embed",e.value="png",n.value=2,o.value=!1,r.value=!1,i.value=!0,s.value=!1}return{exportTab:t,selectedFormat:e,pngScale:n,svgInlineFonts:o,svgMinify:r,bpcIncludeData:i,bpcCompact:s,setExportTab:a,setSelectedFormat:l,reset:c}});function A2(){const t=cie(),{exportTab:e,selectedFormat:n,pngScale:o,svgInlineFonts:r,svgMinify:i,bpcIncludeData:s,bpcCompact:a}=At(t);return{exportTab:e,selectedFormat:n,pngScale:o,svgInlineFonts:r,svgMinify:i,bpcIncludeData:s,bpcCompact:a,setExportTab:t.setExportTab,setSelectedFormat:t.setSelectedFormat,reset:t.reset}}const uie={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function die(t,e){return w(),R("svg",uie,[...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 fie=$e({name:"ph-image",render:die}),hie={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function pie(t,e){return w(),R("svg",hie,[...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 mie=$e({name:"ph-file-code",render:pie}),gie={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function vie(t,e){return w(),R("svg",gie,[...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 J$=$e({name:"ph-file-text",render:vie}),bie={class:"export-download-panel"},yie=le({__name:"ExportDownloadPanel",emits:["download-png","download-svg"],setup(t,{emit:e}){const n=A2(),{selectedFormat:o,pngScale:r,svgInlineFonts:i,svgMinify:s,bpcCompact:a}=At(n),{setSelectedFormat:l}=n,{dsl:c}=Of(),u=e;function d(){u("download-png",r.value)}function f(){u("download-svg")}function h(){Bf(new globalThis.Blob([c.value],{type:"text/plain"}),"chart.bpc")}return(m,b)=>{const g=oie,v=Ts;return w(),R("div",bie,[H(g,{selected:p(o)==="png",icon:p(fie),label:"PNG",description:"Raster image, best for presentations","icon-bg":"var(--bs-info-bg-subtle)","icon-color":"var(--bs-info-text-emphasis)",onSelect:b[1]||(b[1]=y=>p(l)("png")),onDownload:d},{default:Q(()=>[H(p(br),{id:"png-scale","model-value":p(r),label:"Scale",min:1,max:4,step:1,"onUpdate:modelValue":b[0]||(b[0]=y=>r.value=y)},null,8,["model-value"])]),_:1},8,["selected","icon"]),H(g,{selected:p(o)==="svg",icon:p(mie),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:b[4]||(b[4]=y=>p(l)("svg")),onDownload:f},{default:Q(()=>[H(v,{modelValue:p(i),"onUpdate:modelValue":b[2]||(b[2]=y=>Ke(i)?i.value=y:null),switch:""},{default:Q(()=>[...b[7]||(b[7]=[Ge(" Inline fonts ",-1)])]),_:1},8,["modelValue"]),H(v,{modelValue:p(s),"onUpdate:modelValue":b[3]||(b[3]=y=>Ke(s)?s.value=y:null),switch:""},{default:Q(()=>[...b[8]||(b[8]=[Ge(" Minify ",-1)])]),_:1},8,["modelValue"])]),_:1},8,["selected","icon"]),H(g,{selected:p(o)==="bpc",icon:p(J$),label:"BPC",description:"Blueprint Chart DSL file","icon-bg":"var(--bs-warning-bg-subtle)","icon-color":"var(--bs-warning-text-emphasis)",onSelect:b[6]||(b[6]=y=>p(l)("bpc")),onDownload:h},{default:Q(()=>[H(v,{modelValue:p(a),"onUpdate:modelValue":b[5]||(b[5]=y=>Ke(a)?a.value=y:null),switch:""},{default:Q(()=>[...b[9]||(b[9]=[Ge(" Compact ",-1)])]),_:1},8,["modelValue"])]),_:1},8,["selected","icon"])])}}}),xie=Le(yie,[["__scopeId","data-v-f6670dcb"]]),wie={class:"export-embed-panel"},_ie={class:"export-embed-panel__code-block"},Sie={class:"export-embed-panel__code-block__header"},kie={class:"export-embed-panel__code-block__pre"},Cie=["href"],Aie=le({__name:"ExportEmbedPanel",setup(t){const{dsl:e,generateDsl:n}=Of(),{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=S(()=>{const a=r(e.value||n());return`${window.location.origin}${window.location.pathname}#/render?bpc64=${encodeURIComponent(a)}`}),s=S(()=>{const a=Lt(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",wie,[T("div",_ie,[T("div",Sie,[l[0]||(l[0]=T("span",{class:"export-embed-panel__code-block__label"},"Embed code",-1)),H(p(c_),{text:p(s),label:"Copy",variant:"outline-secondary",size:"sm"},null,8,["text"])]),T("pre",kie,[T("code",null,xe(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(c_),{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,Cie)]))}}),$ie=Le(Aie,[["__scopeId","data-v-4c78f371"]]),Tie=["onClick"],Mie=le({__name:"PanelTabBar",props:rt({tabs:{},sticky:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=ht(t,"modelValue"),n=ft("tabsRef");let o=null;function r(){_n(()=>{o!=null&&o.scrollIntoView&&n.value&&o.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})})}return He(()=>o,r),(i,s)=>(w(),R("div",{ref_key:"tabsRef",ref:n,class:Me(["panel-tab-bar",{"panel-tab-bar--sticky":t.sticky}])},[(w(!0),R(Ne,null,gt(t.tabs,a=>(w(),R("button",{key:a.key,ref_for:!0,ref:l=>{a.key===e.value&&(Ke(o)?o.value=l:o=l)},class:Me(["panel-tab-bar__tab",{"panel-tab-bar__tab--active":e.value===a.key}]),onClick:l=>e.value=a.key},xe(a.label),11,Tie))),128))],2))}}),$2=Le(Mie,[["__scopeId","data-v-e1554420"]]),Oie=le({__name:"CanvasModePickerOptionSwatch",props:{mode:{}},setup(t){return(e,n)=>(w(),R("span",{class:Me(["canvas-mode-swatch",`canvas-mode-swatch--${t.mode}`])},null,2))}}),eT=Le(Oie,[["__scopeId","data-v-81dabc6c"]]),Bie=Bo("editorPanel",()=>{const t=De("type"),e=De("preview"),n=De("blueprint"),o=De(!0),r=De(null),i=De("upload"),s=De(""),a=De(!1),l=De(-1);function c(_){t.value=_}function u(_){r.value=_,c("annotate")}function d(_){e.value=_}function f(_){n.value=_}function h(_){i.value=_,_==="structure"&&b("column")}function m(_){s.value=_}function b(_){s.value=_,a.value=!0}function g(){a.value=!1,s.value=""}function v(){a.value=!a.value}function y(_){if(l.value===_){l.value=-1;return}l.value=_,b("column")}function x(){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}return{activeTab:t,viewMode:e,canvasMode:n,showDimensions:o,pendingAnnotationIndex:r,dataView:i,dataPanelTab:s,dataPanelOpen:a,selectedColumnIndex:l,selectTab:c,selectAnnotation:u,setViewMode:d,setCanvasMode:f,setDataView:h,setDataPanelTab:m,openDataPanel:b,closeDataPanel:g,toggleDataPanel:v,selectColumn:y,reset:x}});function Or(){const t=Bie(),{activeTab:e,viewMode:n,canvasMode:o,showDimensions:r,pendingAnnotationIndex:i,dataView:s,dataPanelTab:a,dataPanelOpen:l,selectedColumnIndex:c}=At(t);return{activeTab:e,viewMode:n,canvasMode:o,showDimensions:r,pendingAnnotationIndex:i,dataView:s,dataPanelTab:a,dataPanelOpen:l,selectedColumnIndex:c,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,reset:t.reset}}const Lie={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Pie(t,e){return w(),R("svg",Lie,[...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 Die=$e({name:"ph-ruler",render:Pie}),Eie=le({__name:"CanvasDimensionsToggle",setup(t){const{showDimensions:e}=At(Or());return(n,o)=>(w(),R("button",{class:Me(["canvas-dimensions-toggle",{"canvas-dimensions-toggle--active":p(e)}]),title:"Show dimensions",onClick:o[0]||(o[0]=r=>e.value=!p(e))},[H(p(Die))],2))}}),Iie=Le(Eie,[["__scopeId","data-v-0920c699"]]),Rie=["title"],Nie={class:"canvas-mode-picker-option__label"},Fie=le({__name:"CanvasModePickerOption",props:{mode:{},label:{},active:{type:Boolean}},emits:["select"],setup(t){return(e,n)=>{const o=eT;return w(),R("button",{class:Me(["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",Nie,xe(t.label),1)],10,Rie)}}}),Vie=Le(Fie,[["__scopeId","data-v-b7a042b3"]]),zie={class:"canvas-mode-picker__extra"},Hie={key:1,class:"canvas-mode-picker__trigger",title:"Canvas mode"},Wie=le({__name:"CanvasModePicker",setup(t){const e=Or(),{canvasMode:n}=At(e),{setCanvasMode:o}=e,r=De(!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=Vie,u=Iie,d=eT;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(Ne,{key:0},[(w(),R(Ne,null,gt(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",zie,[H(u),l[2]||(l[2]=T("span",{class:"canvas-mode-picker__extra__label"},"Dims",-1))])],64)):(w(),R("button",Hie,[H(d,{mode:p(n)},null,8,["mode"])]))],32)}}}),tT=Le(Wie,[["__scopeId","data-v-beb08053"]]),Uie={transform:"translate(0.5, 0.5)"},Gie={class:"canvas-dimensions__line"},qie=["x1","y1","x2","y2"],Yie=["x1","y1","x2","y2"],jie=["x1","y1","x2","y2"],Xie=["x","y"],Kie={class:"canvas-dimensions__line"},Zie=["x1","y1","x2","y2"],Qie=["x1","y1","x2","y2"],Jie=["x1","y1","x2","y2"],ese=["x","y"],tse={class:"canvas-dimensions__line canvas-dimensions__line--padding"},nse=["x1","y1","x2","y2"],ose=["x1","y1","x2","y2"],rse=["x1","y1","x2","y2"],ise=["x","y"],sse=["x1","y1","x2","y2"],ase=["x1","y1","x2","y2"],lse=["x1","y1","x2","y2"],cse=["x","y"],use={class:"canvas-dimensions__line canvas-dimensions__line--padding"},dse=["x1","y1","x2","y2"],fse=["x1","y1","x2","y2"],hse=["x1","y1","x2","y2"],pse=["x","y"],mse=["x1","y1","x2","y2"],gse=["x1","y1","x2","y2"],vse=["x1","y1","x2","y2"],bse=["x","y"],x6=20,tn=3,ph=4,w6=20,yse=le({__name:"CanvasDimensions",props:{cardRef:{},canvasRef:{},layout:{}},setup(t){const e=t,n=Ie(null);function o(){const v=e.cardRef;if(!v){n.value=null;return}n.value={left:v.offsetLeft,top:v.offsetTop,width:v.offsetWidth,height:v.offsetHeight}}zr(()=>e.canvasRef,o),zr(()=>e.cardRef,o);const r=S(()=>({position:"absolute",inset:"0",width:"100%",height:"100%",pointerEvents:"none",overflow:"visible"})),i=S(()=>{const v=n.value;return{x1:v.left,x2:v.left+v.width,y:v.top+v.height+x6}}),s=S(()=>{const v=n.value;return{x:v.left-x6,y1:v.top,y2:v.top+v.height}}),a=S(()=>{const v=i.value,y=e.layout.padding;return y>0&&!c.value?{x1:v.x1+y+ph,x2:v.x2-y-ph}:{x1:v.x1,x2:v.x2}}),l=S(()=>{const v=s.value,y=e.layout.padding;return y>0&&!u.value?{y1:v.y1+y+ph,y2:v.y2-y-ph}:{y1:v.y1,y2:v.y2}}),c=S(()=>e.layout.sizing!=="responsive"),u=S(()=>e.layout.heightMode!=="auto"),d=S(()=>e.layout.padding>0),f=S(()=>`${e.layout.padding}px`),h=S(()=>i.value.y+w6),m=S(()=>s.value.x-w6),b=S(()=>{const v=e.layout;return v.sizing==="fixed"?`${v.fixedWidth}px`:v.sizing==="max-width"?`max ${v.maxWidth}px`:"auto"}),g=S(()=>{const v=e.layout;return v.heightMode==="fixed"?`${v.fixedHeight}px`:v.heightMode==="aspect-ratio"?v.aspectRatio:"auto"});return(v,y)=>p(n)?(w(),R("svg",{key:0,class:"canvas-dimensions",style:Ot(p(r))},[T("g",Uie,[T("g",Gie,[T("line",{x1:p(a).x1,y1:p(i).y,x2:p(a).x2,y2:p(i).y},null,8,qie),T("line",{x1:p(a).x1,y1:p(i).y-tn,x2:p(a).x1,y2:p(i).y+tn},null,8,Yie),T("line",{x1:p(a).x2,y1:p(i).y-tn,x2:p(a).x2,y2:p(i).y+tn},null,8,jie),T("text",{x:(p(i).x1+p(i).x2)/2,y:p(i).y+tn+12,"text-anchor":"middle"},xe(p(b)),9,Xie)]),T("g",Kie,[T("line",{x1:p(s).x,y1:p(l).y1,x2:p(s).x,y2:p(l).y2},null,8,Zie),T("line",{x1:p(s).x-tn,y1:p(l).y1,x2:p(s).x+tn,y2:p(l).y1},null,8,Qie),T("line",{x1:p(s).x-tn,y1:p(l).y2,x2:p(s).x+tn,y2:p(l).y2},null,8,Jie),T("text",{x:p(s).x-5,y:(p(s).y1+p(s).y2)/2,"text-anchor":"end","dominant-baseline":"central"},xe(p(g)),9,ese)]),p(d)?(w(),R(Ne,{key:0},[T("g",tse,[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,nse),T("line",{x1:p(i).x1,y1:(p(c)?p(h):p(i).y)-tn,x2:p(i).x1,y2:(p(c)?p(h):p(i).y)+tn},null,8,ose),T("line",{x1:p(i).x1+t.layout.padding,y1:(p(c)?p(h):p(i).y)-tn,x2:p(i).x1+t.layout.padding,y2:(p(c)?p(h):p(i).y)+tn},null,8,rse),T("text",{x:p(i).x1+t.layout.padding/2,y:(p(c)?p(h):p(i).y)+tn+12,"text-anchor":"middle"},xe(p(f)),9,ise),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,sse),T("line",{x1:p(i).x2-t.layout.padding,y1:(p(c)?p(h):p(i).y)-tn,x2:p(i).x2-t.layout.padding,y2:(p(c)?p(h):p(i).y)+tn},null,8,ase),T("line",{x1:p(i).x2,y1:(p(c)?p(h):p(i).y)-tn,x2:p(i).x2,y2:(p(c)?p(h):p(i).y)+tn},null,8,lse),T("text",{x:p(i).x2-t.layout.padding/2,y:(p(c)?p(h):p(i).y)+tn+12,"text-anchor":"middle"},xe(p(f)),9,cse)]),T("g",use,[T("line",{x1:p(u)?p(m):p(s).x,y1:p(s).y1,x2:p(u)?p(m):p(s).x,y2:p(s).y1+t.layout.padding},null,8,dse),T("line",{x1:(p(u)?p(m):p(s).x)-tn,y1:p(s).y1,x2:(p(u)?p(m):p(s).x)+tn,y2:p(s).y1},null,8,fse),T("line",{x1:(p(u)?p(m):p(s).x)-tn,y1:p(s).y1+t.layout.padding,x2:(p(u)?p(m):p(s).x)+tn,y2:p(s).y1+t.layout.padding},null,8,hse),T("text",{x:(p(u)?p(m):p(s).x)-tn-4,y:p(s).y1+t.layout.padding/2,"text-anchor":"end","dominant-baseline":"central"},xe(p(f)),9,pse),T("line",{x1:p(u)?p(m):p(s).x,y1:p(s).y2-t.layout.padding,x2:p(u)?p(m):p(s).x,y2:p(s).y2},null,8,mse),T("line",{x1:(p(u)?p(m):p(s).x)-tn,y1:p(s).y2-t.layout.padding,x2:(p(u)?p(m):p(s).x)+tn,y2:p(s).y2-t.layout.padding},null,8,gse),T("line",{x1:(p(u)?p(m):p(s).x)-tn,y1:p(s).y2,x2:(p(u)?p(m):p(s).x)+tn,y2:p(s).y2},null,8,vse),T("text",{x:(p(u)?p(m):p(s).x)-tn-4,y:p(s).y2-t.layout.padding/2,"text-anchor":"end","dominant-baseline":"central"},xe(p(f)),9,bse)])],64)):ae("",!0)])],4)):ae("",!0)}}),nT=Le(yse,[["__scopeId","data-v-394e6d5d"]]),xse={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function wse(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-16M40 56h40v144H40Zm176 144H96V56h120z"},null,-1)])])}const _se=$e({name:"ph-sidebar-simple",render:wse}),T2=le({__name:"PanelIconRail",props:{horizontal:{type:Boolean},activeTab:{},items:{}},emits:["select","toggle-mode"],setup(t,{emit:e}){const n=e,{mode:o,open:r}=Zl();function i(l){o.value==="closed"&&r(),n("select",l)}const s=S(()=>o.value==="closed"?_se:o.value==="floating"?pC:hC),a=S(()=>o.value==="closed"?"Open panel":o.value==="floating"?"Dock panel":"Detach panel");return(l,c)=>(w(),K(p(TW),{"model-value":t.activeTab,items:t.items,horizontal:t.horizontal,"onUpdate:modelValue":i},xr({_:2},[t.horizontal?void 0:{name:"footer",fn:Q(()=>[H(p(Rn),{"icon-left":p(s),label:p(a),"hide-label":"",square:"",variant:"link",size:"sm",onClick:c[0]||(c[0]=u=>l.$emit("toggle-mode"))},null,8,["icon-left","label"])]),key:"0"}]),1032,["model-value","items","horizontal"]))}}),Sse={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function kse(t,e){return w(),R("svg",Sse,[...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 Cse=$e({name:"ph-code",render:kse}),Ase=le({__name:"ExportIconRail",props:{horizontal:{type:Boolean}},setup(t){const{mode:e,toggleMode:n}=Zl(),o=A2(),{exportTab:r}=At(o),{setExportTab:i}=o,s=[{value:"embed",icon:Cse,tooltip:"Embed"},{value:"download",icon:K$,tooltip:"Download"}];function a(l){i(l),e.value==="closed"&&n()}return(l,c)=>{const u=T2;return w(),K(u,{horizontal:t.horizontal,"active-tab":p(r),items:s,onSelect:a,onToggleMode:p(n)},null,8,["horizontal","active-tab","onToggleMode"])}}});function $se(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 M2(t,e){const n=S(()=>t.value.heightMode==="fixed"||t.value.heightMode==="aspect-ratio"),o=S(()=>({[`${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=S(()=>{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=$se(i.aspectRatio);a&&(s.aspectRatio=String(a))}return s});return{cardClass:o,cardStyle:r,hasConstrainedHeight:n}}function _6(t,e){t.replaceChildren();const n=document.createElement("div");n.className="text-center text-muted p-5",n.textContent=e,t.appendChild(n)}const Tse=150;function O2(t){const e=hn(),{currentOptions:n}=yn(),{scenes:o,activeIndex:r,activeScene:i}=bn(),{columns:s,rows:a,columnTypes:l}=Ko(),{applyStepList:c}=Mr(),{theme:u}=_u(),{chartTheme:d}=$$(),f=Symbol("unset");let h=f,m=null,b=!1;function g(){if(!(!t.value||b)){b=!0;try{v()}finally{b=!1}}}function v(){var ve;if(!t.value)return;const C=i.value,L=Oa(o.value,r.value),O=(L==null?void 0:L.chartType)??e.chartType.value,$=h!==f&&C!==h,M=$&&m!==null&&m!==O;let D=null;M?(D=Ar(t.value),t.value.replaceChildren()):$||t.value.replaceChildren();let N;if((L==null?void 0:L.data)!==void 0)N=L.data;else if((ve=L==null?void 0:L.transforms)!=null&&ve.length&&s.value.length>0){const me=c(L.transforms,s.value,a.value,l.value);N=Km(me.columns,me.rows)}else N=e.data.value;const k=Xs(N),A=[Be.BarVertical,Be.BarHorizontal,Be.Line,Be.VerticalBar,Be.HorizontalBar];if(k.series&&k.series.length>0&&A.includes(O)){const me=e.selectedColumn.value,I=k.series.find(W=>W.name===me);I&&(k.values=I.values),delete k.series}if(k.labels.length===0){_6(t.value,"No data to preview");return}const B=c2(O);if(!B){_6(t.value,`Unknown chart type: ${O}`);return}const P=n.value.allowDarkMode??!0,F=t.value.parentElement;F&&(!P&&u.value!=="light"?F.setAttribute("data-bs-theme","light"):F.removeAttribute("data-bs-theme"));const z=cr(t.value),V=L!=null&&L.chartTypeOptions?{...n.value,...L.chartTypeOptions}:n.value,G=Xm(V,z),ie=(L==null?void 0:L.colorizes)??e.colorizes.value,ce=L?L.highlights??[]:e._base.highlights.value,he=(L==null?void 0:L.areaFills)??e.areaFills.value,Z=e._base.annotations.value,oe=(L==null?void 0:L.annotations)??[],se=[...Z,...oe],re=L!=null&&L.hiddenAnnotationIds?se.filter(me=>!me.id||!L.hiddenAnnotationIds.has(me.id)):se,U=(L==null?void 0:L.seriesOverrides)??e.seriesOverrides.value,te=L==null?void 0:L.properties;if(B(t.value,k,{frame:{title:(te==null?void 0:te.title)??(e.title.value||void 0),description:(te==null?void 0:te.description)??(e.description.value||void 0),byline:e.byline.value||void 0,note:e.note.value||void 0,source:(te==null?void 0:te.source)??(e.source.value||void 0),sourceUrl:(te==null?void 0:te.sourceUrl)??(e.sourceUrl.value||void 0),showCredit:e.layout.value.showCredit,padding:`${e.layout.value.padding}px`,transparentBackground:e.layout.value.transparentBackground||void 0},sort:C$(L)??e.sort.value,sortMode:e.sortMode.value!=="none"?e.sortMode.value:void 0,...G,colorizes:ie.length>0?ie:void 0,highlights:ce.length>0?ce:void 0,areaFills:he.length>0?he:void 0,annotations:re.length>0?re:void 0,seriesOverrides:U.length>0?U:void 0},$&&!M),D&&t.value){const me=t.value.querySelector(".bc-frame");me&&Cr(me),$r(t.value,D)}const ne=t.value.querySelector(".bc-frame");if(ne){ne.classList.forEach(I=>{I.startsWith("bc-theme-")&&ne.classList.remove(I)}),ne.classList.add(`bc-theme-${d.value}`);const me=e.layout.value.heightMode;(me==="fixed"||me==="aspect-ratio")&&ne.classList.add("bc-frame--constrained")}h=C,m=O}zr(t,R4(g,Tse));const x=S(()=>JSON.stringify(e.layout.value)),_=S(()=>JSON.stringify(n.value));return He([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,x,_,o,i,u,d],g,{immediate:!0,flush:"post"}),{config:e}}function Mse(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){lie(s);return}const a=n();a&&rie(a)}async function i(s=2){const a=o();if(a){const d=e!=null&&e.value?Q$(e.value):void 0,f=e!=null&&e.value?sie(e.value):void 0;await aie(a,s,"chart.png",d,f);return}const l=n();if(!l)return;const{width:c,height:u}=l.getBoundingClientRect();await iie(l,c*s,u*s)}return{downloadSvg:r,downloadPng:i}}const Ose=le({__name:"ExportPanel",setup(t){const e=Or(),{canvasMode:n,showDimensions:o}=At(e),{setViewMode:r}=e,{mode:i}=Zl();r("preview");const s=A2(),{exportTab:a}=At(s),{setExportTab:l}=s,{isNarrow:c}=Wl(),{layout:u}=hn(),{cardClass:d,cardStyle:f}=M2(u,"export-panel__canvas__card"),h=ft("canvasRef"),m=ft("cardRef"),b=ft("previewRef");O2(b);const{downloadSvg:g,downloadPng:v}=Mse(b,m),y=De(0),x=De(0);let _=0;function C(){globalThis.cancelAnimationFrame(_),_=globalThis.requestAnimationFrame(()=>{const k=m.value;if(k){const A=k.offsetLeft,B=k.offsetTop;(A!==y.value||B!==x.value)&&(y.value=A,x.value=B)}})}zr(h,C),zr(m,C);const L=S(()=>({"--grid-offset-x":`${y.value}px`,"--grid-offset-y":`${x.value}px`})),O=De(!0),$=[{key:"embed",label:"Embed"},{key:"download",label:"Download"}],M={embed:"Embed",download:"Download"},D=S(()=>M[a.value]??"Export"),N=S(()=>({[`export-panel__canvas--${n.value}`]:n.value!=="blueprint"}));return(k,A)=>{const B=Ase,P=nT,F=tT,z=$2,V=$ie,G=xie,ie=C2,ce=Zm;return w(),R("div",{class:Me(["export-panel",{"export-panel--narrow":p(c)}])},[p(c)?(w(),K(B,{key:0,horizontal:""})):ae("",!0),T("div",{ref_key:"canvasRef",ref:h,class:Me(["export-panel__canvas",p(N)]),style:Ot(p(L))},[T("div",{ref_key:"cardRef",ref:m,class:Me(["export-panel__canvas__card",p(d)]),style:Ot(p(f))},[T("div",{ref_key:"previewRef",ref:b,class:"export-panel__canvas__preview w-100 h-100"},null,512)],6),p(o)?(w(),K(P,{key:0,"card-ref":p(m),"canvas-ref":p(h),layout:p(u)},null,8,["card-ref","canvas-ref","layout"])):ae("",!0),H(F)],6),H(ce,{"drawer-open":p(O),"onUpdate:drawerOpen":A[1]||(A[1]=he=>Ke(O)?O.value=he:null),title:p(D),"container-ref":p(h)},xr({default:Q(()=>[p(a)==="embed"?(w(),K(V,{key:0})):p(a)==="download"?(w(),K(G,{key:1,onDownloadPng:p(v),onDownloadSvg:p(g)},null,8,["onDownloadPng","onDownloadSvg"])):ae("",!0)]),_:2},[p(i)!=="docked"?{name:"tabs",fn:Q(()=>[H(z,{tabs:$,"model-value":p(a),sticky:"","onUpdate:modelValue":A[0]||(A[0]=he=>p(l)(he))},null,8,["model-value"])]),key:"0"}:void 0,p(i)!=="drawer"?{name:"footer",fn:Q(()=>[H(ie)]),key:"1"}:void 0]),1032,["drawer-open","title","container-ref"]),p(c)?ae("",!0):(w(),K(B,{key:1}))],2)}}}),Bse=Le(Ose,[["__scopeId","data-v-8e3c21a5"]]),Lse={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Pse(t,e){return w(),R("svg",Lse,[...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 Dse=$e({name:"ph-arrows-out-cardinal",render:Pse}),Ese={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Ise(t,e){return w(),R("svg",Ese,[...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 oT=$e({name:"ph-arrows-vertical",render:Ise}),Rse={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Nse(t,e){return w(),R("svg",Rse,[...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 rT=$e({name:"ph-arrows-horizontal",render:Nse}),Fse={viewBox:"0 0 20 20",width:"1.2em",height:"1.2em"};function Vse(t,e){return w(),R("svg",Fse,[...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 B2=$e({name:"fluent-line-horizontal-1-20-filled",render:Vse}),zse={viewBox:"0 0 20 20",width:"1.2em",height:"1.2em"};function Hse(t,e){return w(),R("svg",zse,[...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 iT=$e({name:"fluent-line-horizontal-1-dashes-20-filled",render:Hse}),Wse={viewBox:"0 0 20 20",width:"1.2em",height:"1.2em"};function Use(t,e){return w(),R("svg",Wse,[...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 sT=$e({name:"fluent-line-horizontal-1-dot-20-filled",render:Use}),Gse={class:"d-flex flex-column gap-3"},qse=le({__name:"EditorInteractionSection",setup(t){const{currentOptions:e,availableOptionKeys:n,setOption:o}=yn(),{layout:r}=hn(),{scenes:i}=bn(),s=S(()=>n.value.includes("tooltips")),a=S(()=>n.value.includes("crosshair")),l=S(()=>i.value.length>=1),c=[{value:"both",text:"Both",icon:Dse},{value:"vertical",text:"Vertical",icon:oT},{value:"horizontal",text:"Horizontal",icon:rT}],u=[{value:"solid",text:"Solid",icon:B2},{value:"dashed",text:"Dashed",icon:iT},{value:"dotted",text:"Dotted",icon:sT}],d=S({get:()=>r.value.playerType,set:b=>{r.value.playerType=b}}),f=S({get:()=>r.value.playerPosition,set:b=>{r.value.playerPosition=b}}),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"}],m=[{value:"left",text:"Left"},{value:"center",text:"Center"},{value:"right",text:"Right"}];return(b,g)=>(w(),R("div",Gse,[p(s)?(w(),K(p(Zt),{key:0,"model-value":p(e).tooltips??!1,label:"Tooltips","onUpdate:modelValue":g[0]||(g[0]=v=>p(o)("tooltips",v))},null,8,["model-value"])):ae("",!0),p(a)?(w(),K(p(Zt),{key:1,"model-value":p(e).crosshair??!1,label:"Crosshair","onUpdate:modelValue":g[1]||(g[1]=v=>p(o)("crosshair",v))},null,8,["model-value"])):ae("",!0),p(a)&&p(e).crosshair?(w(),R(Ne,{key:2},[H(p(An),{label:"Direction","model-value":p(e).crosshairDirection??"both",options:c,block:"","onUpdate:modelValue":g[2]||(g[2]=v=>p(o)("crosshairDirection",v))},null,8,["model-value"]),H(p(An),{label:"Line style","model-value":p(e).crosshairStyle??"dashed",options:u,block:"","onUpdate:modelValue":g[3]||(g[3]=v=>p(o)("crosshairStyle",v))},null,8,["model-value"]),H(p(ka),{id:"opt-crosshair-color",label:"Color","model-value":p(e).crosshairColor??"#999999","onUpdate:modelValue":g[4]||(g[4]=v=>p(o)("crosshairColor",v))},null,8,["model-value"])],64)):ae("",!0),p(l)?(w(),R(Ne,{key:3},[H(p(Dn),{id:"layout-player-type",modelValue:p(d),"onUpdate:modelValue":g[5]||(g[5]=v=>Ke(d)?d.value=v:null),label:"Scene player",options:h,block:""},null,8,["modelValue"]),p(d)==="buttons"||p(d)==="dot-stepper"||p(d)==="minimal-arrows"?(w(),K(p(An),{key:0,modelValue:p(f),"onUpdate:modelValue":g[6]||(g[6]=v=>Ke(f)?f.value=v:null),label:"Player position",options:m,block:""},null,8,["modelValue"])):ae("",!0)],64)):ae("",!0)]))}}),Yse={},jse={class:"d-flex flex-column gap-3"};function Xse(t,e){const n=qse;return w(),R("div",jse,[H(n)])}const Kse=Le(Yse,[["render",Xse]]),Zse={class:"border rounded overflow-hidden bg-body-tertiary"},Qse={class:"d-flex align-items-center justify-content-between px-2 py-1 border-bottom"},Jse={class:"fw-medium"},eae={class:"p-2 d-flex flex-column gap-2"},tae={class:"d-flex align-items-center gap-2"},nae={class:"text-nowrap",style:{width:"3em"}},oae=le({__name:"EditorAreaFillItem",props:rt({id:{},seriesNames:{}},{fill:{required:!0},fillModifiers:{}}),emits:rt(["remove"],["update:fill"]),setup(t){const e=t,n=ht(t,"fill"),o=S(()=>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=Wo,c=Ra,u=Mn,d=Ws,f=Ts;return w(),R("div",Zse,[T("div",Qse,[T("small",Jse,xe(n.value.from)+" – "+xe(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:Q(()=>[...a[8]||(a[8]=[T("span",{"aria-hidden":"true"},"×",-1)])]),_:1})]),T("div",eae,[H(u,{label:"From","label-for":`af-from-${t.id}`},{default:Q(()=>[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:Q(()=>[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:Q(()=>[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:Q(()=>[H(f,{"model-value":!!n.value.negativeColor,switch:"","onUpdate:modelValue":a[4]||(a[4]=h=>i("negativeColor",h?"#f28e2b":void 0))},{default:Q(()=>[...a[9]||(a[9]=[Ge(" Use different color for negative differences ",-1)])]),_:1},8,["model-value"])]),_:1}),n.value.negativeColor?(w(),K(u,{key:0,label:"Negative color","label-for":`af-neg-color-${t.id}`},{default:Q(()=>[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"])):ae("",!0),H(u,{label:"Opacity","label-for":`af-opacity-${t.id}`},{default:Q(()=>[T("div",tae,[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",nae,xe(n.value.opacity??30)+"%",1)])]),_:1},8,["label-for"]),H(u,{label:"Interpolation","label-for":`af-interp-${t.id}`},{default:Q(()=>[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"])])])}}}),rae={class:"d-flex flex-column gap-2"},iae=le({__name:"EditorAreaFills",props:rt({seriesNames:{},seriesOverrides:{},globalInterpolation:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=ht(t,"modelValue"),o=S(()=>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=n2(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=oae;return w(),R(Ne,null,[T("div",rae,[(w(!0),R(Ne,null,gt(p(o),(u,d)=>(w(),K(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(vl),{label:"Add",onClick:i})],64)}}}),sae={class:"d-flex flex-column gap-3"},aae=le({__name:"EditorHighlightSection",setup(t){const{chartType:e,data:n,highlights:o}=hn(),r=S(()=>Xs(n.value)),i=S(()=>[Be.LineMulti,Be.AreaStacked].includes(e.value)),s=S(()=>{var u;return i.value?((u=r.value.series)==null?void 0:u.map(d=>d.name))??[]:r.value.labels}),a=De(o.value.length>0),l=S({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",sae,[H(p(Zt),{"model-value":p(a),label:"Highlight specific items","onUpdate:modelValue":c},null,8,["model-value"]),p(a)?(w(),K(p(ky),{key:0,selected:p(l),"onUpdate:selected":d[0]||(d[0]=f=>Ke(l)?l.value=f:null),items:p(s)},null,8,["selected","items"])):ae("",!0)]))}}),lae=Bo("previewContainer",()=>({containerRef:Ie(null)}));function aT(){const t=lae();return At(t)}const cae={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function uae(t,e){return w(),R("svg",cae,[...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 dae=$e({name:"ph-drop-half",render:uae}),fae={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function hae(t,e){return w(),R("svg",fae,[...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 pae=$e({name:"ph-highlighter-circle",render:hae}),mae={class:"d-flex flex-column gap-2"},gae={class:"d-flex gap-2"},vae=le({__name:"EditorAnnotationFree",props:rt({chartWidth:{},chartHeight:{}},{annotation:{required:!0},annotationModifiers:{}}),emits:["update:annotation"],setup(t){const e=ht(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=Ie(null);return fn(()=>{var a;const s=(a=i.value)==null?void 0:a.$el;s&&(s.focus(),s.select())}),(s,a)=>{const l=ay,c=Mn;return w(),R("div",mae,[H(c,{label:"Text"},{default:Q(()=>[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",gae,[H(p(Nh),{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(Nh),{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(ka),{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(Zt),{"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(Nh),{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"])])}}}),bae={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function yae(t,e){return w(),R("svg",bae,[...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 Jd=$e({name:"ph-align-left",render:yae}),xae={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function wae(t,e){return w(),R("svg",xae,[...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 rp=$e({name:"ph-align-center-horizontal",render:wae}),_ae={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Sae(t,e){return w(),R("svg",_ae,[...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 ef=$e({name:"ph-align-right",render:Sae}),kae={class:"d-flex flex-column gap-2"},Cae={class:"d-flex gap-2"},Aae={key:0,class:"d-flex gap-2"},$ae=le({__name:"EditorAnnotationRange",props:rt({labels:{}},{annotation:{required:!0},annotationModifiers:{}}),emits:["update:annotation"],setup(t){const e=t,n=ht(t,"annotation"),o=[{value:"vertical",text:"Vertical"},{value:"horizontal",text:"Horizontal"}],r=S(()=>(n.value.orientation??"vertical")==="vertical"&&e.labels.length>0),i=S(()=>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=Ie(null);return fn(()=>{var c;const l=(c=a.value)==null?void 0:c.$el;l&&(l.focus(),l.select())}),(l,c)=>{const u=Ws,d=Mn,f=Ra;return w(),R("div",kae,[H(d,{label:"Text"},{default:Q(()=>[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:Q(()=>[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",Cae,[H(d,{label:"Start",class:"flex-fill"},{default:Q(()=>[p(r)?(w(),K(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(),K(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:Q(()=>[p(r)?(w(),K(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(),K(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",Aae,[H(p(Dn),{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:Q(()=>[H(p(ic),{value:"start",label:"Start"},{icon:Q(()=>[H(p(Jd))]),_:1}),H(p(ic),{value:"center",label:"Center"},{icon:Q(()=>[H(p(rp))]),_:1}),H(p(ic),{value:"end",label:"End"},{icon:Q(()=>[H(p(ef))]),_:1})]),_:1},8,["id","model-value"]),H(p(Dn),{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:Q(()=>[H(p(ic),{value:"start",label:"Start"},{icon:Q(()=>[H(p(Jd))]),_:1}),H(p(ic),{value:"center",label:"Center"},{icon:Q(()=>[H(p(rp))]),_:1}),H(p(ic),{value:"end",label:"End"},{icon:Q(()=>[H(p(ef))]),_:1})]),_:1},8,["id","model-value"])])):ae("",!0),H(p(ka),{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(br),{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(Ne,{key:1},[H(p(ka),{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(Q4),{"model-value":n.value.direction??"center",label:"Direction","onUpdate:modelValue":c[11]||(c[11]=h=>s("direction",h))},null,8,["model-value"])],64)):ae("",!0)])}}}),Tae={viewBox:"0 0 20 20",width:"1.2em",height:"1.2em"};function Mae(t,e){return w(),R("svg",Tae,[...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 Oae=$e({name:"fluent-arrow-hook-up-left-20-filled",render:Mae}),Bae={viewBox:"0 0 20 20",width:"1.2em",height:"1.2em"};function Lae(t,e){return w(),R("svg",Bae,[...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 Pae=$e({name:"fluent-arrow-hook-up-right-20-filled",render:Lae}),Dae={viewBox:"0 0 20 20",width:"1.2em",height:"1.2em"};function Eae(t,e){return w(),R("svg",Dae,[...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 Iae=$e({name:"fluent-arrow-turn-right-down-20-filled",render:Eae}),Rae={class:"d-flex flex-column gap-2"},Nae={class:"d-flex flex-column gap-2 mt-2"},Fae={class:"d-flex flex-column gap-2 mt-2"},Vae=le({__name:"EditorAnnotationPoint",props:rt({labels:{},chartWidth:{}},{annotation:{required:!0},annotationModifiers:{}}),emits:["update:annotation"],setup(t){const e=t,n=ht(t,"annotation"),o=S(()=>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=Ie(null);return fn(()=>{var c;const l=(c=a.value)==null?void 0:c.$el;l&&(l.focus(),l.select())}),(l,c)=>{const u=ay,d=Mn,f=Ra,h=Ws,m=Ts;return w(),R("div",Rae,[H(d,{label:"Text"},{default:Q(()=>[H(u,{ref_key:"textRef",ref:a,"model-value":n.value.text,placeholder:"Annotation text",rows:"2","onUpdate:modelValue":c[0]||(c[0]=b=>s("text",b))},null,8,["model-value"])]),_:1}),H(d,{label:"Target"},{default:Q(()=>[H(f,{"model-value":n.value.target,options:p(o),"onUpdate:modelValue":c[1]||(c[1]=b=>s("target",b))},null,8,["model-value","options"])]),_:1}),H(p(ka),{id:"ann-point-text-color","model-value":n.value.textColor??"#000000",label:"Text color","onUpdate:modelValue":c[2]||(c[2]=b=>s("textColor",b))},null,8,["model-value"]),H(p(Zt),{"model-value":n.value.textOutline??!0,label:"Text outline","onUpdate:modelValue":c[3]||(c[3]=b=>s("textOutline",b))},null,8,["model-value"]),H(p(Nh),{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]=b=>s("maxWidth",b))},null,8,["model-value","max"]),H(p(Zt),{"model-value":n.value.showLine??!0,label:"Show line","onUpdate:modelValue":c[10]||(c[10]=b=>s("showLine",b))},xr({_:2},[n.value.showLine?{name:"section",fn:Q(()=>[T("div",Nae,[H(p(An),{"model-value":n.value.lineStyle??"direct",label:"Line style",block:"","onUpdate:modelValue":c[5]||(c[5]=b=>s("lineStyle",b))},{default:Q(()=>[H(p(Kf),{value:"direct",text:"Direct","icon-left":p(B2)},null,8,["icon-left"]),H(p(Kf),{value:"curve-left",text:"Curve left","icon-left":p(Oae)},null,8,["icon-left"]),H(p(Kf),{value:"curve-right",text:"Curve right","icon-left":p(Pae)},null,8,["icon-left"]),H(p(Kf),{value:"elbow",text:"Elbow","icon-left":p(Iae)},null,8,["icon-left"])]),_:1},8,["model-value"]),H(d,{label:"Line weight"},{default:Q(()=>[H(h,{"model-value":String(n.value.lineWeight??1),type:"number",min:"1",max:"10","onUpdate:modelValue":c[6]||(c[6]=b=>s("lineWeight",Number(b)))},null,8,["model-value"])]),_:1}),H(p(Q4),{"model-value":n.value.anchorDirection??"N",label:"Anchor position","onUpdate:modelValue":c[7]||(c[7]=b=>s("anchorDirection",b))},null,8,["model-value"]),H(d,null,{default:Q(()=>[H(m,{"model-value":n.value.showArrow??!0,switch:"","onUpdate:modelValue":c[8]||(c[8]=b=>s("showArrow",b))},{default:Q(()=>[...c[14]||(c[14]=[Ge(" Show arrow ",-1)])]),_:1},8,["model-value"])]),_:1}),H(d,{label:"Line target distance"},{default:Q(()=>[H(h,{"model-value":String(n.value.lineTargetDistance??0),type:"number","onUpdate:modelValue":c[9]||(c[9]=b=>s("lineTargetDistance",Number(b)))},null,8,["model-value"])]),_:1})])]),key:"0"}:void 0]),1032,["model-value"]),H(p(Zt),{"model-value":n.value.showCircle??!1,label:"Show circle","onUpdate:modelValue":c[13]||(c[13]=b=>s("showCircle",b))},xr({_:2},[n.value.showCircle?{name:"section",fn:Q(()=>[T("div",Fae,[H(d,{label:"Circle size"},{default:Q(()=>[H(h,{"model-value":String(n.value.circleSize??4),type:"number",min:"1","onUpdate:modelValue":c[11]||(c[11]=b=>s("circleSize",Number(b)))},null,8,["model-value"])]),_:1}),H(d,{label:"Circle style"},{default:Q(()=>[H(f,{"model-value":n.value.circleStyle??"solid",options:r,"onUpdate:modelValue":c[12]||(c[12]=b=>s("circleStyle",b))},null,8,["model-value"])]),_:1})])]),key:"0"}:void 0]),1032,["model-value"])])}}}),zae={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Hae(t,e){return w(),R("svg",zae,[...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 lT=$e({name:"ph-eye",render:Hae}),Wae={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Uae(t,e){return w(),R("svg",Wae,[...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 tf=$e({name:"ph-eye-slash",render:Uae}),Gae={class:"badge bg-secondary-subtle text-secondary-emphasis"},qae=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(),K(p(vC),{label:t.summary,class:Me({"opacity-50":t.hidden}),onClick:n[3]||(n[3]=o=>e.$emit("toggleCollapse"))},{leading:Q(()=>[T("span",Gae,xe(t.kindLabel),1)]),actions:Q(()=>[t.canToggleVisibility?(w(),K(p(Wo),{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]=vn(o=>e.$emit("toggleVisibility"),["stop"]))},{default:Q(()=>[H(p(vf),{name:t.hidden?p(tf):p(lT)},null,8,["name"])]),_:1},8,["title"])):ae("",!0),H(p(uU),{onDuplicate:n[1]||(n[1]=o=>e.$emit("duplicate")),onRemove:n[2]||(n[2]=o=>e.$emit("remove"))})]),_:1},8,["label","class"]))}}),Yae=Le(qae,[["__scopeId","data-v-acf3aff5"]]),jae={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Xae(t,e){return w(),R("svg",jae,[...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 Kae=$e({name:"ph-map-pin",render:Xae}),Zae={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Qae(t,e){return w(),R("svg",Zae,[...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 Jae=$e({name:"ph-arrows-out-line-horizontal",render:Qae}),ele={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function tle(t,e){return w(),R("svg",ele,[...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 nle=$e({name:"ph-note",render:tle}),ole={class:"d-flex flex-column gap-4"},rle={class:"d-flex flex-column gap-2"},ile={class:"d-flex flex-column gap-2"},sle={class:"d-flex flex-column gap-2"},S6="abcdefghijklmnopqrstuvwxyz0123456789",ale=le({__name:"EditorAnnotations",props:rt({labels:{},chartType:{},chartWidth:{},chartHeight:{},hiddenAnnotationIds:{},canToggleVisibility:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:rt(["toggle-visibility"],["update:modelValue"]),setup(t,{expose:e,emit:n}){const o=t,r=n,i=ht(t,"modelValue"),s=S(()=>i.value);function a(){let $="";for(let M=0;M<5;M++)$+=S6[Math.floor(Math.random()*S6.length)];return $}const l=S(()=>o.chartType===Be.Pie||o.chartType===Be.Donut),c=Ie(null);function u($){c.value=c.value===$?null:$}e({openIndex:c});const d=S(()=>s.value.map(($,M)=>({ann:$,index:M})).filter(({ann:$})=>$.kind===Pt.Point)),f=S(()=>s.value.map(($,M)=>({ann:$,index:M})).filter(({ann:$})=>$.kind===Pt.Range)),h=S(()=>s.value.map(($,M)=>({ann:$,index:M})).filter(({ann:$})=>$.kind===Pt.Free));function m($){var M;return!!$.id&&!!((M=o.hiddenAnnotationIds)!=null&&M.has($.id))}function b($){$.id&&r("toggle-visibility",$.id,$.kind)}function g($){return $.kind===Pt.Point?"Point":$.kind===Pt.Range?"Range":"Note"}function v($){return $.kind===Pt.Point?$.text||$.target||"Empty":$.kind===Pt.Range?$.text||`${$.start} - ${$.end}`:$.text||"Empty"}function y($,M){const D=s.value.map(N=>({...N}));D[$]=M,i.value=D}function x(){const $={kind:Pt.Point,id:a(),target:o.labels[0]??"",text:"Enter an annotation",showLine:!0,showArrow:!0},M=[...s.value,$];i.value=M,c.value=M.length-1}function _(){const $=o.labels.length>0,M={kind:Pt.Range,id:a(),start:$?o.labels[0]:0,end:$?o.labels[o.labels.length-1]:100},D=[...s.value,M];i.value=D,c.value=D.length-1}function C(){const $={kind:Pt.Free,id:a(),text:"Enter an annotation",x:0,y:0},M=[...s.value,$];i.value=M,c.value=M.length-1}function L($){const M=[...s.value];M.splice($+1,0,{...M[$],id:a()}),i.value=M}function O($){const M=[...s.value];M.splice($,1),i.value=M,c.value===$?c.value=null:c.value!==null&&c.value>$&&c.value--}return($,M)=>{const D=Yae,N=Vae,k=$ae,A=vae;return w(),R("div",ole,[p(l)?ae("",!0):(w(),K(p(Ho),{key:0,title:"Points",icon:p(Kae)},{default:Q(()=>[T("div",rle,[(w(!0),R(Ne,null,gt(p(d),({ann:B,index:P})=>(w(),K(p(vd),{key:P},{header:Q(()=>[H(D,{"kind-label":g(B),summary:v(B),collapsed:p(c)!==P,hidden:m(B),"can-toggle-visibility":t.canToggleVisibility,onDuplicate:F=>L(P),onRemove:F=>O(P),onToggleCollapse:F=>u(P),onToggleVisibility:F=>b(B)},null,8,["kind-label","summary","collapsed","hidden","can-toggle-visibility","onDuplicate","onRemove","onToggleCollapse","onToggleVisibility"])]),default:Q(()=>[p(c)===P?(w(),K(N,{key:0,annotation:B,labels:t.labels,"chart-width":t.chartWidth,"onUpdate:annotation":F=>y(P,F)},null,8,["annotation","labels","chart-width","onUpdate:annotation"])):ae("",!0)]),_:2},1024))),128))]),H(p(vl),{label:"Add",onClick:x})]),_:1},8,["icon"])),p(l)?ae("",!0):(w(),K(p(Ho),{key:1,title:"Ranges",icon:p(Jae)},{default:Q(()=>[T("div",ile,[(w(!0),R(Ne,null,gt(p(f),({ann:B,index:P})=>(w(),K(p(vd),{key:P},{header:Q(()=>[H(D,{"kind-label":g(B),summary:v(B),collapsed:p(c)!==P,hidden:m(B),"can-toggle-visibility":t.canToggleVisibility,onDuplicate:F=>L(P),onRemove:F=>O(P),onToggleCollapse:F=>u(P),onToggleVisibility:F=>b(B)},null,8,["kind-label","summary","collapsed","hidden","can-toggle-visibility","onDuplicate","onRemove","onToggleCollapse","onToggleVisibility"])]),default:Q(()=>[p(c)===P?(w(),K(k,{key:0,annotation:B,labels:t.labels,"onUpdate:annotation":F=>y(P,F)},null,8,["annotation","labels","onUpdate:annotation"])):ae("",!0)]),_:2},1024))),128))]),H(p(vl),{label:"Add",onClick:_})]),_:1},8,["icon"])),H(p(Ho),{title:"Notes",icon:p(nle)},{default:Q(()=>[T("div",sle,[(w(!0),R(Ne,null,gt(p(h),({ann:B,index:P})=>(w(),K(p(vd),{key:P},{header:Q(()=>[H(D,{"kind-label":g(B),summary:v(B),collapsed:p(c)!==P,hidden:m(B),"can-toggle-visibility":t.canToggleVisibility,onDuplicate:F=>L(P),onRemove:F=>O(P),onToggleCollapse:F=>u(P),onToggleVisibility:F=>b(B)},null,8,["kind-label","summary","collapsed","hidden","can-toggle-visibility","onDuplicate","onRemove","onToggleCollapse","onToggleVisibility"])]),default:Q(()=>[p(c)===P?(w(),K(A,{key:0,annotation:B,"chart-width":t.chartWidth,"chart-height":t.chartHeight,"onUpdate:annotation":F=>y(P,F)},null,8,["annotation","chart-width","chart-height","onUpdate:annotation"])):ae("",!0)]),_:2},1024))),128))]),H(p(vl),{label:"Add",onClick:C})]),_:1},8,["icon"])])}}});function lle(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 m=h.querySelector(".bc-annotation-text");if(!m)return;const b=h.querySelector(".bc-annotation-circle"),g=h.querySelector(".bc-annotation-line");let v=null,y=null,x=0;if(b&&(v=parseFloat(b.getAttribute("cx")||"0"),y=parseFloat(b.getAttribute("cy")||"0"),x=parseFloat(b.getAttribute("r")||"0")),v===null&&g){const I=(g.getAttribute("d")||"").split(/[MLA]\s*/).filter(Boolean);if(I.length>=2){const W=I[I.length-1].trim().split(/[\s,]+/);W.length>=2&&(v=parseFloat(W[W.length-2]),y=parseFloat(W[W.length-1]))}}const _=v!==null&&y!==null,C=(u&&"lineStyle"in u?u.lineStyle:"direct")||"direct",L=x>0?x+((u&&"lineTargetDistance"in u?u.lineTargetDistance:5)||5):0,O=parseFloat(m.getAttribute("x")||"0"),$=parseFloat(m.getAttribute("y")||"0"),M=m.getBBox(),N=(m.getAttribute("transform")||"").match(/translate\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*\)/),k=N?parseFloat(N[1]):0,A=N?parseFloat(N[2]):0,B={x:M.x+k,y:M.y+A,width:M.width,height:M.height},P=4,F=u?u.maxWidth:void 0;let z=B.width;if(F!=null){const me=parseFloat(d.getAttribute("width")||"0");if(typeof F=="number"&&F>0)z=F;else if(typeof F=="string")if(F.endsWith("%")&&me>0)z=parseFloat(F)/100*me;else{const I=parseFloat(F);I>0&&(z=I)}}const V=m.getAttribute("text-anchor")||"middle";let G;V==="middle"?G=O-z/2:V==="end"?G=O-z:G=O,r=document.createElementNS("http://www.w3.org/2000/svg","rect"),r.setAttribute("x",String(G-P)),r.setAttribute("y",String(B.y-P)),r.setAttribute("width",String(z+P*2)),r.setAttribute("height",String(B.height+P*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 ie=!1,ce=0,he=0,Z=0,oe=0,se=0;function re(){return d.getScreenCTM()}function U(){const me=re();if(!me)return;const I=(oe-ce)/me.a,W=(se-he)/me.d,j=O+I,ue=$+W;m.setAttribute("x",String(j)),m.setAttribute("y",String(ue));const de=m.querySelectorAll("tspan");for(const ee of de)ee.setAttribute("x",String(j));const fe=m.getBBox(),pe={x:fe.x+k,y:fe.y+A,width:fe.width,height:fe.height};let J;const X=m.getAttribute("text-anchor")||"middle";if(X==="middle"?J=j-z/2:X==="end"?J=j-z:J=j,r.setAttribute("x",String(J-P)),r.setAttribute("y",String(pe.y-P)),r.setAttribute("width",String(z+P*2)),r.setAttribute("height",String(pe.height+P*2)),g&&_){const ee=bboxEdgeToward(pe,v,y),we=L>0?shortenToward({x:v,y},ee,L):{x:v,y},ge=pe.x+pe.width/2,be=Math.abs(ee.x-ge)<1;g.setAttribute("d",buildPathD(ee,we,C,be))}Z=0}function te(me){me.preventDefault(),me.stopPropagation(),ie=!0,ce=me.clientX,he=me.clientY,oe=me.clientX,se=me.clientY,r.style.cursor="grabbing",r.setPointerCapture(me.pointerId)}function ne(me){ie&&(me.preventDefault(),oe=me.clientX,se=me.clientY,Z||(Z=requestAnimationFrame(U)))}function ve(me){if(!ie)return;ie=!1,r.style.cursor="grab",Z&&(cancelAnimationFrame(Z),Z=0);const I=re();if(!I)return;const W=(me.clientX-ce)/I.a,j=(me.clientY-he)/I.d;if(Math.abs(W)<1&&Math.abs(j)<1){m.setAttribute("x",String(O)),m.setAttribute("y",String($));const fe=m.querySelectorAll("tspan");for(const pe of fe)pe.setAttribute("x",String(O));return}const ue=e.value[c];if(!ue)return;const de={...ue};if(ue.kind==="free"){const fe=h.closest(".bc-annotations"),pe=parseFloat((fe==null?void 0:fe.getAttribute("data-ctx-width"))||"")||parseFloat(d.getAttribute("width")||"600"),J=parseFloat((fe==null?void 0:fe.getAttribute("data-ctx-height"))||"")||parseFloat(d.getAttribute("height")||"400"),X=ue.x,ee=ue.y;if(typeof X=="number")de.x=+(X+W/pe*100).toFixed(1);else{const we=String(X);we.endsWith("px")?de.x=`${Math.round(parseFloat(we)+W)}px`:de.x=+((parseFloat(we)||0)+W/pe*100).toFixed(1)}if(typeof ee=="number")de.y=+(ee+j/J*100).toFixed(1);else{const we=String(ee);we.endsWith("px")?de.y=`${Math.round(parseFloat(we)+j)}px`:de.y=+((parseFloat(we)||0)+j/J*100).toFixed(1)}}else if(ue.kind==="point"){const fe=de.textOffsetX??-42,pe=de.textOffsetY??-42;de.textOffsetX=Math.round(fe+W),de.textOffsetY=Math.round(pe+j)}o(c,de)}r.addEventListener("pointerdown",te),r.addEventListener("pointermove",ne),r.addEventListener("pointerup",ve),i=()=>{Z&&cancelAnimationFrame(Z),r==null||r.removeEventListener("pointerdown",te),r==null||r.removeEventListener("pointermove",ne),r==null||r.removeEventListener("pointerup",ve)}}He(n,()=>{requestAnimationFrame(a)}),He(e,()=>{n.value!==null&&requestAnimationFrame(a)},{deep:!0}),ya(s)}const cle={class:"d-flex flex-column gap-4"},ule=le({__name:"EditorAnnotateTab",setup(t){const e=hn(),{chartType:n,data:o,areaFills:r,seriesOverrides:i}=e,{currentOptions:s}=yn(),a=S(()=>s.value.interpolation??"linear"),{pendingAnnotationIndex:l}=At(Or()),{scenes:c,activeIndex:u,activeScene:d,update:f}=bn(),h=S(()=>u.value>=0),m=[Be.BarVertical,Be.BarHorizontal,Be.LineMulti,Be.AreaStacked],b=S(()=>m.includes(n.value)),g=S({get(){const P=e._base.annotations.value;if(u.value>=0){const F=Oa(c.value,u.value),z=(F==null?void 0:F.annotations)??[];return[...P,...z]}return P},set(P){if(u.value>=0&&d.value){const F=new Set(e._base.annotations.value.map(G=>G.id).filter(Boolean)),z=P.filter(G=>G.id&&F.has(G.id)),V=P.filter(G=>!G.id||!F.has(G.id));e._base.annotations.value=z,f(u.value,{annotations:V.length>0?V:void 0});return}e._base.annotations.value=P}}),v=S(()=>{if(u.value<0)return;const P=Oa(c.value,u.value);return P==null?void 0:P.hiddenAnnotationIds});function y(P,F){var ie;if(u.value<0)return;const z=d.value;if(!z)return;const V=z.annotationVisibility??[];((ie=v.value)==null?void 0:ie.has(P))?V.find(he=>he.id===P&&he.action==="hide")?f(u.value,{annotationVisibility:V.filter(he=>!(he.id===P&&he.action==="hide"))}):f(u.value,{annotationVisibility:[...V,{action:"show",kind:F,id:P}]}):V.find(he=>he.id===P&&he.action==="show")?f(u.value,{annotationVisibility:V.filter(he=>!(he.id===P&&he.action==="show"))}):f(u.value,{annotationVisibility:[...V,{action:"hide",kind:F,id:P}]})}const x=S(()=>n.value===Be.LineMulti),_=S(()=>Xs(o.value)),C=S(()=>_.value.labels),L=S(()=>{var P;return((P=_.value.series)==null?void 0:P.map(F=>F.name))??[]}),O=Ie(null),$=S(()=>{var P;return((P=O.value)==null?void 0:P.openIndex)??null}),{containerRef:M}=aT(),D=De(600),N=De(400);function k(){var F;const P=(F=M.value)==null?void 0:F.querySelector("svg");P&&(D.value=parseFloat(P.getAttribute("width")||"600")||600,N.value=parseFloat(P.getAttribute("height")||"400")||400)}let A;fn(()=>{k(),A=new ResizeObserver(k),M.value&&A.observe(M.value)}),Ds(()=>A==null?void 0:A.disconnect());function B(P,F){const z=g.value.map(V=>({...V}));z[P]=F,g.value=z}return lle(M,g,$,B),He(l,async P=>{if(P!==null&&(await _n(),O.value)){const F=typeof P=="string"?g.value.findIndex(z=>z.id===P):P;if(F<0){l.value=null;return}O.value.openIndex=O.value.openIndex===F?null:F,l.value=null}},{immediate:!0}),(P,F)=>{const z=aae,V=iae;return w(),R("div",cle,[p(b)?(w(),K(p(Ho),{key:0,title:"Highlight",icon:p(pae)},{default:Q(()=>[H(z)]),_:1},8,["icon"])):ae("",!0),H(ale,{ref_key:"annotationsRef",ref:O,modelValue:p(g),"onUpdate:modelValue":F[0]||(F[0]=G=>Ke(g)?g.value=G:null),labels:p(C),"chart-type":p(n),"chart-width":p(D),"chart-height":p(N),"hidden-annotation-ids":p(v),"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(),K(p(Ho),{key:1,title:"Area Fills",icon:p(dae)},{default:Q(()=>[H(V,{modelValue:p(r),"onUpdate:modelValue":F[1]||(F[1]=G=>Ke(r)?r.value=G:null),"series-names":p(L),"series-overrides":p(i),"global-interpolation":p(a)},null,8,["modelValue","series-names","series-overrides","global-interpolation"])]),_:1},8,["icon"])):ae("",!0)])}}}),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:"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 hle=$e({name:"ph-tag",render:fle}),ple={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function mle(t,e){return w(),R("svg",ple,[...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 U1=$e({name:"ph-magic-wand",render:mle}),gle={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function vle(t,e){return w(),R("svg",gle,[...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 ble=$e({name:"ph-arrow-line-up",render:vle}),yle={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function xle(t,e){return w(),R("svg",yle,[...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 wle=$e({name:"ph-arrow-line-down",render:xle}),_le={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Sle(t,e){return w(),R("svg",_le,[...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 kle=$e({name:"ph-arrow-line-left",render:Sle}),Cle={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Ale(t,e){return w(),R("svg",Cle,[...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 $le=$e({name:"ph-arrow-line-right",render:Ale}),Tle={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Mle(t,e){return w(),R("svg",Tle,[...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 G1=$e({name:"ph-arrow-square-in",render:Mle}),Ole={class:"d-flex flex-column gap-3"},Ble=le({__name:"EditorLegendSection",setup(t){const{currentOptions:e,availableOptionKeys:n,setOption:o}=yn(),r=S(()=>n.value.includes("legend")),i=S(()=>n.value.includes("legendPosition")),s=S(()=>n.value.includes("legendAnchor")),a=S(()=>n.value.includes("directLabelling")),l=S(()=>a.value),c=S(()=>n.value.includes("directLabelAnchor")),u=S(()=>e.value.directLabelling?"direct":e.value.legend===!1?"none":"legend"),d=S(()=>{const v=[{value:"legend",text:"Legend",icon:b$},{value:"none",text:"None",icon:tf}];return a.value&&v.splice(1,0,{value:"direct",text:"Direct labelling",icon:hle}),v});function f(v){v==="legend"?(o("legend",!0),o("directLabelling","")):v==="direct"?(o("legend",!1),o("directLabelling","auto")):(o("legend",!1),o("directLabelling",""))}const h=[{value:"auto",text:"Auto",icon:U1},{value:"outside",text:"Outside",icon:M0},{value:"inside",text:"Inside",icon:G1}],m=[{value:"start",text:"Start",icon:Jd},{value:"middle",text:"Middle",icon:rp},{value:"end",text:"End",icon:ef}],b=[{value:"top",text:"Top",icon:ble},{value:"bottom",text:"Bottom",icon:wle},{value:"left",text:"Left",icon:kle},{value:"right",text:"Right",icon:$le}],g=[{value:"start",text:"Start",icon:Jd},{value:"middle",text:"Middle",icon:rp},{value:"end",text:"End",icon:ef}];return(v,y)=>(w(),R("div",Ole,[p(r)?(w(),K(p(An),{key:0,label:"Labels","model-value":p(u),options:p(d),block:"","onUpdate:modelValue":f},null,8,["model-value","options"])):ae("",!0),p(l)&&p(u)==="direct"?(w(),K(p(An),{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"])):ae("",!0),p(c)&&p(u)==="direct"&&p(e).directLabelling==="inside"?(w(),K(p(An),{key:2,label:"Label anchor","model-value":p(e).directLabelAnchor||"middle",options:m,block:"","onUpdate:modelValue":y[1]||(y[1]=x=>p(o)("directLabelAnchor",x))},null,8,["model-value"])):ae("",!0),p(i)&&p(u)==="legend"?(w(),K(p(An),{key:3,label:"Legend position","model-value":p(e).legendPosition??"top",options:b,block:"","onUpdate:modelValue":y[2]||(y[2]=x=>p(o)("legendPosition",x))},null,8,["model-value"])):ae("",!0),p(s)&&p(u)==="legend"?(w(),K(p(An),{key:4,label:"Legend anchor","model-value":p(e).legendAnchor??"start",options:g,block:"","onUpdate:modelValue":y[3]||(y[3]=x=>p(o)("legendAnchor",x))},null,8,["model-value"])):ae("",!0)]))}}),Lle={class:"d-flex flex-column gap-3"},Ple={class:"pt-2"},Dle={class:"pt-2"},Ele={class:"pt-2"},Ile={class:"pt-2"},Rle=le({__name:"EditorLayoutSection",setup(t){const{layout:e}=hn(),n=S({get:()=>e.value.sizing,set:m=>{e.value.sizing=m}}),o=S({get:()=>e.value.heightMode,set:m=>{e.value.heightMode=m}}),r=S({get:()=>String(e.value.fixedWidth),set:m=>{e.value.fixedWidth=Number(m)||600}}),i=S({get:()=>String(e.value.fixedHeight),set:m=>{e.value.fixedHeight=Number(m)||400}}),s=S({get:()=>String(e.value.padding),set:m=>{e.value.padding=Number(m)||0}}),a=S({get:()=>e.value.aspectRatio,set:m=>{e.value.aspectRatio=m}}),l=S({get:()=>e.value.transparentBackground,set:m=>{e.value.transparentBackground=m}}),c=S({get:()=>e.value.showCredit,set:m=>{e.value.showCredit=m}}),u=S({get:()=>String(e.value.maxWidth),set:m=>{e.value.maxWidth=Number(m)||660}}),d=[{value:"responsive",text:"Responsive"},{value:"max-width",text:"Max width"},{value:"fixed",text:"Fixed"}],f=[{value:"auto",text:"Auto"},{value:"fixed",text:"Fixed"},{value:"aspect-ratio",text:"Aspect ratio"}],h=[{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(m,b)=>(w(),R("div",Lle,[H(p(An),{modelValue:p(n),"onUpdate:modelValue":b[2]||(b[2]=g=>Ke(n)?n.value=g:null),label:"Width",options:d,block:""},{"section:fixed":Q(()=>[T("div",Ple,[H(p(br),{id:"layout-fixed-width",modelValue:p(r),"onUpdate:modelValue":b[0]||(b[0]=g=>Ke(r)?r.value=g:null),label:"",min:"200",max:"1200",suffix:"px"},null,8,["modelValue"])])]),"section:max-width":Q(()=>[T("div",Dle,[H(p(br),{id:"layout-max-width",modelValue:p(u),"onUpdate:modelValue":b[1]||(b[1]=g=>Ke(u)?u.value=g:null),label:"",min:"200",max:"1200",suffix:"px"},null,8,["modelValue"])])]),_:1},8,["modelValue"]),H(p(An),{modelValue:p(o),"onUpdate:modelValue":b[5]||(b[5]=g=>Ke(o)?o.value=g:null),label:"Height",options:f,block:""},{"section:fixed":Q(()=>[T("div",Ele,[H(p(br),{id:"layout-fixed-height",modelValue:p(i),"onUpdate:modelValue":b[3]||(b[3]=g=>Ke(i)?i.value=g:null),label:"",min:"100",max:"800",suffix:"px"},null,8,["modelValue"])])]),"section:aspect-ratio":Q(()=>[T("div",Ile,[H(p(Dn),{id:"layout-aspect-ratio",modelValue:p(a),"onUpdate:modelValue":b[4]||(b[4]=g=>Ke(a)?a.value=g:null),options:h,block:""},null,8,["modelValue"])])]),_:1},8,["modelValue"]),H(p(br),{id:"layout-padding",modelValue:p(s),"onUpdate:modelValue":b[6]||(b[6]=g=>Ke(s)?s.value=g:null),label:"Padding",min:"0",max:"80",suffix:"px"},null,8,["modelValue"]),H(p(Zt),{modelValue:p(l),"onUpdate:modelValue":b[7]||(b[7]=g=>Ke(l)?l.value=g:null),label:"Transparent background"},null,8,["modelValue"]),H(p(Zt),{modelValue:p(c),"onUpdate:modelValue":b[8]||(b[8]=g=>Ke(c)?c.value=g:null),label:"Show credit (recommended)"},null,8,["modelValue"])]))}}),Nle={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Fle(t,e){return w(),R("svg",Nle,[...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 Vle=$e({name:"ph-list-bullets",render:Fle}),zle={class:"d-flex flex-column gap-4"},Hle=le({__name:"EditorLayoutTab",setup(t){const{availableOptionKeys:e}=yn(),n=S(()=>e.value.includes("legend"));return(o,r)=>{const i=Rle,s=Ble;return w(),R("div",zle,[H(i),p(n)?(w(),K(p(Ho),{key:0,title:"Legend",icon:p(Vle)},{default:Q(()=>[H(s)]),_:1},8,["icon"])):ae("",!0)])}}}),Wle={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Ule(t,e){return w(),R("svg",Wle,[...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 Gle=$e({name:"ph-wave-sine",render:Ule}),qle={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Yle(t,e){return w(),R("svg",qle,[...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 cT=$e({name:"ph-text-aa",render:Yle}),jle={key:0,class:"d-flex flex-column gap-4"},Xle={class:"d-flex flex-column gap-2"},Kle={key:1,class:"text-muted small"},Zle=le({__name:"EditorAxisOptions",setup(t){const e=S(()=>l.value.includes("valueLabels")),n=S(()=>l.value.includes("swapLabelValue")),o=[{value:"auto",text:"Auto",icon:U1},{value:"outside",text:"Outside",icon:M0},{value:"inside",text:"Inside",icon:G1}],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}=yn();function u(A,B){c(A,B)}const{displayColumnTypes:d}=Ko(),f=S(()=>d.value[0]??"string"),h=S(()=>d.value[1]??"number"),m=S(()=>a.value.some(A=>A.key==="verticalScaleType"));function b(A){return A.replace(/^(Show\s+)?(vertical|horizontal)\s+/i,(B,P)=>P??"").replace(/^./,B=>B.toUpperCase())}function g(A){return(A?!m.value:m.value)?h.value:f.value}function v(A,B){if(A.type!=="numberFormat")return A;const P=g(B);return P==="date"?{...A,type:"dateFormat",label:A.label.replace(/number\s+format/i,"Date format")}:P==="string"?{...A,type:"__hidden"}:A}const y=S(()=>a.value.filter(A=>r.has(A.key)).map(A=>v({...A,label:b(A.label)},!1)).filter(A=>A.type!=="__hidden")),x=S(()=>a.value.filter(A=>i.has(A.key)).map(A=>v({...A,label:b(A.label)},!0)).filter(A=>A.type!=="__hidden")),_={solid:B2,dashed:iT,dotted:sT,none:tf},C={auto:U1,inside:G1,outside:M0,off:tf},L={left:Jd,right:ef},O={linear:Zu,log:Gle},$={verticalGridStyle:_,horizontalGridStyle:_,verticalLabelPosition:C,horizontalLabelPosition:C,verticalAxisDirection:L,verticalScaleType:O,horizontalScaleType:O},M=(A,{emit:B})=>{const{def:P,value:F}=A;if(P.type==="boolean")return Nt(Zt,{label:P.label,modelValue:F??P.default??!1,"onUpdate:modelValue":z=>B("update",z)});if(P.type==="select"&&P.choices){const z=$[P.key],V=P.choices.map(G=>({value:G.value,text:G.text,...z!=null&&z[G.value]?{icon:z[G.value]}:{}}));return Nt(An,{label:P.label,options:V,block:!0,modelValue:F??P.default??"","onUpdate:modelValue":G=>B("update",G)})}return P.type==="text"?Nt(cm,{label:P.label,id:`opt-${P.key}`,placeholder:P.placeholder??"",modelValue:F??"","onUpdate:modelValue":z=>B("update",z)}):P.type==="numberFormat"?Nt(VF,{label:P.label,id:`opt-${P.key}`,modelValue:F??"","onUpdate:modelValue":z=>B("update",z)}):P.type==="dateFormat"?Nt(Mz,{label:P.label,id:`opt-${P.key}`,modelValue:F??"","onUpdate:modelValue":z=>B("update",z)}):null};M.props=["def","value"],M.emits=["update"];function D(A){return A.endsWith("RangeMin")}function N(A){return A.endsWith("RangeMax")}const k=(A,{emit:B})=>{const P=[],{defs:F,currentOptions:z}=A;let V=0;for(;V<F.length;){const G=F[V];if(D(G.key)&&V+1<F.length&&N(F[V+1].key)){const ie=F[V+1];P.push(Nt("div",{class:"d-flex gap-2",key:G.key},[Nt("div",{class:"flex-fill",style:"min-width:0"},[Nt(M,{def:G,value:z[G.key],onUpdate:ce=>B("update",G.key,ce)})]),Nt("div",{class:"flex-fill",style:"min-width:0"},[Nt(M,{def:ie,value:z[ie.key],onUpdate:ce=>B("update",ie.key,ce)})])])),V+=2}else P.push(Nt(M,{key:G.key,def:G,value:z[G.key],onUpdate:ie=>B("update",G.key,ie)})),V++}return Nt("div",{class:"d-flex flex-column gap-2"},P)};return k.props=["defs","currentOptions"],k.emits=["update"],(A,B)=>p(e)||p(y).length>0||p(x).length>0?(w(),R("div",jle,[p(e)?(w(),K(p(Ho),{key:0,title:"Value Labels",icon:p(cT)},{default:Q(()=>[T("div",Xle,[H(p(Zt),{"model-value":p(s).valueLabels??!1,label:"Show value labels","onUpdate:modelValue":B[0]||(B[0]=P=>u("valueLabels",P))},null,8,["model-value"]),p(s).valueLabels?(w(),K(p(An),{key:0,label:"Position","model-value":p(s).valueLabelPosition??"auto",options:o,block:"","onUpdate:modelValue":B[1]||(B[1]=P=>u("valueLabelPosition",P))},null,8,["model-value"])):ae("",!0),p(s).valueLabels&&p(n)?(w(),K(p(Zt),{key:1,"model-value":p(s).swapLabelValue??!1,label:"Swap labels and values","onUpdate:modelValue":B[2]||(B[2]=P=>u("swapLabelValue",P))},null,8,["model-value"])):ae("",!0)])]),_:1},8,["icon"])):ae("",!0),p(y).length>0?(w(),K(p(Ho),{key:1,title:"Vertical Axis",icon:p(oT)},{default:Q(()=>[H(k,{defs:p(y),"current-options":p(s),onUpdate:u},null,8,["defs","current-options"])]),_:1},8,["icon"])):ae("",!0),p(x).length>0?(w(),K(p(Ho),{key:2,title:"Horizontal Axis",icon:p(rT)},{default:Q(()=>[H(k,{defs:p(x),"current-options":p(s),onUpdate:u},null,8,["defs","current-options"])]),_:1},8,["icon"])):ae("",!0)])):(w(),R("p",Kle," No axis options for this chart type. "))}}),Qle={class:"d-flex flex-column gap-3"},uT=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=Ra,a=Mn;return w(),R("div",Qle,[H(a,{label:"Symbol","label-for":`${t.idPrefix}-shape`},{default:Q(()=>[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(An),{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(An),{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(br),{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(br),{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"])])}}}),Jle={class:"d-flex flex-column gap-3"},ece={class:"d-flex gap-2 justify-content-end"},tce=le({__name:"EditorSeriesOptions",props:{selected:{},overrides:{},colors:{},chartType:{}},emits:["update:overrides"],setup(t,{emit:e}){const n=t,o=e;function r(k){return n.overrides.find(A=>A.name===k)}function i(){return n.selected.length>0?r(n.selected[0]):void 0}const s=S(()=>n.chartType==="bar-multi"),a=S(()=>n.chartType==="line-multi"),l=S(()=>{var k;return((k=i())==null?void 0:k.color)??"#4e79a7"}),c=S(()=>{var k;return String(((k=i())==null?void 0:k.opacity)??1)}),u=S(()=>{var k;return String(((k=i())==null?void 0:k.lineWidth)??2)}),d=S(()=>{var k;return((k=i())==null?void 0:k.dash)??"solid"}),f=S(()=>{var k;return((k=i())==null?void 0:k.interpolation)??"global"}),h=S(()=>{var k;return((k=i())==null?void 0:k.labelMode)??"global"}),m=S(()=>{var k;return((k=i())==null?void 0:k.valueLabels)??!1}),b=S(()=>{var k;return((k=i())==null?void 0:k.lineSymbols)??!1}),g=S(()=>{var k;return((k=i())==null?void 0:k.symbolShape)??"circle"}),v=S(()=>{var k;return((k=i())==null?void 0:k.symbolShowOn)??"firstLast"}),y=S(()=>{var k;return((k=i())==null?void 0:k.symbolStyle)??"filled"}),x=S(()=>{var k;return String(((k=i())==null?void 0:k.symbolSize)??3.5)}),_=S(()=>{var k;return String(((k=i())==null?void 0:k.symbolOpacity)??1)});function C(k,A){const B=n.overrides.map(P=>({...P}));for(const P of n.selected){let F=B.find(z=>z.name===P);F||(F={name:P},B.push(F)),F[k]=A}o("update:overrides",B)}function L(){if(n.selected.length<2)return;const k=r(n.selected[0]);if(!k)return;const A=n.overrides.map(B=>({...B}));for(let B=1;B<n.selected.length;B++){const P=n.selected[B];let F=A.find(z=>z.name===P);F||(F={name:P},A.push(F)),Object.assign(F,{...k,name:P})}o("update:overrides",A)}function O(){const k=new Set(n.selected),A=n.overrides.filter(B=>!k.has(B.name));o("update:overrides",A)}const $=[{value:"1",text:"1"},{value:"2",text:"2"},{value:"3",text:"3"},{value:"4",text:"4"},{value:"5",text:"5"}],M=[{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(k,A)=>{const B=Ra,P=Mn,F=uT,z=Wo;return w(),R("div",Jle,[H(p(ka),{id:"series-color",label:"Color","model-value":p(l),"onUpdate:modelValue":A[0]||(A[0]=V=>C("color",V))},null,8,["model-value"]),H(p(An),{label:"Label mode","model-value":p(h),options:N,block:"","onUpdate:modelValue":A[1]||(A[1]=V=>C("labelMode",V))},null,8,["model-value"]),H(p(Zt),{"model-value":p(m),label:"Value labels","onUpdate:modelValue":A[2]||(A[2]=V=>C("valueLabels",V))},null,8,["model-value"]),p(s)?(w(),K(p(br),{key:0,id:"series-opacity",label:"Opacity","model-value":p(c),min:"0",max:"1",step:"0.1","onUpdate:modelValue":A[3]||(A[3]=V=>C("opacity",Number(V)))},null,8,["model-value"])):ae("",!0),p(a)?(w(),R(Ne,{key:1},[H(p(An),{label:"Line width","model-value":p(u),options:$,"onUpdate:modelValue":A[4]||(A[4]=V=>C("lineWidth",Number(V)))},null,8,["model-value"]),H(p(An),{label:"Dash style","model-value":p(d),options:M,"onUpdate:modelValue":A[5]||(A[5]=V=>C("dash",V))},null,8,["model-value"]),H(P,{label:"Interpolation","label-for":"series-interpolation"},{default:Q(()=>[H(B,{id:"series-interpolation","model-value":p(f),options:D,"onUpdate:modelValue":A[6]||(A[6]=V=>C("interpolation",V))},null,8,["model-value"])]),_:1}),H(p(Zt),{"model-value":p(b),label:"Line symbols","onUpdate:modelValue":A[7]||(A[7]=V=>C("lineSymbols",V))},null,8,["model-value"]),p(b)?(w(),K(F,{key:0,"id-prefix":"series-symbol",shape:p(g),"show-on":p(v),style:Ot(p(y)),size:p(x),opacity:p(_),"onUpdate:shape":A[8]||(A[8]=V=>C("symbolShape",V)),"onUpdate:showOn":A[9]||(A[9]=V=>C("symbolShowOn",V)),"onUpdate:style":A[10]||(A[10]=V=>C("symbolStyle",V)),"onUpdate:size":A[11]||(A[11]=V=>C("symbolSize",Number(V))),"onUpdate:opacity":A[12]||(A[12]=V=>C("symbolOpacity",Number(V)))},null,8,["shape","show-on","style","size","opacity"])):ae("",!0)],64)):ae("",!0),T("div",ece,[t.selected.length>1?(w(),K(z,{key:0,variant:"outline-secondary",size:"sm",onClick:L},{default:Q(()=>[...A[13]||(A[13]=[Ge(" Copy from first ",-1)])]),_:1})):ae("",!0),H(z,{variant:"outline-danger",size:"sm",onClick:O},{default:Q(()=>[...A[14]||(A[14]=[Ge(" Reset to default ",-1)])]),_:1})])])}}}),nce=le({__name:"EditorSeriesList",props:{seriesNames:{},selected:{},colors:{},overrides:{}},emits:["update:selected","toggleVisibility"],setup(t){const e=t;function n(r,i){return ln(r,i,e.colors,e.overrides)}function o(r){return Ua(r,e.overrides)}return(r,i)=>{const s=Ts;return w(),K(p(ky),{items:t.seriesNames,selected:t.selected,"onUpdate:selected":i[1]||(i[1]=a=>r.$emit("update:selected",a))},{"item-leading":Q(({item:a,index:l})=>[H(p(lm),{color:n(a,l)},null,8,["color"])]),"item-actions":Q(({item:a})=>[H(s,{"model-value":!o(a),switch:"",size:"sm",onClick:i[0]||(i[0]=vn(()=>{},["stop"])),"onUpdate:modelValue":l=>r.$emit("toggleVisibility",a,!l)},null,8,["model-value","onUpdate:modelValue"])]),_:1},8,["items","selected"])}}}),oce={class:"d-flex flex-column gap-3"},rce=le({__name:"EditorSeriesPanel",setup(t){const{chartType:e,data:n,seriesOverrides:o}=hn(),{currentOptions:r}=yn(),i=Ie([]),s=S(()=>{var u;return((u=Xs(n.value).series)==null?void 0:u.map(d=>d.name))??[]}),a=S(()=>Xm(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=nce,f=tce;return w(),R("div",oce,[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(),K(p(vd),{key:0,label:"Editing "+p(i).length+" "+(p(i).length===1?"series: "+p(i)[0]:"series")},{default:Q(()=>[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"])):ae("",!0)])}}}),ice={class:"d-flex flex-column gap-3"},sce={class:"bc-area-stack-options"},ace=le({__name:"EditorAreaSection",setup(t){const{currentOptions:e,setOption:n}=yn(),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=Ra,l=Mn,c=J7,u=Ts;return w(),R("div",ice,[H(p(br),{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:Q(()=>[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:Q(()=>[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(Zt),{"model-value":p(e).stacked!==!1,label:"Stack areas","onUpdate:modelValue":s[5]||(s[5]=d=>p(n)("stacked",d))},{section:Q(()=>[T("div",sce,[H(u,{"model-value":p(e).stackPercent??!1,"onUpdate:modelValue":s[3]||(s[3]=d=>p(n)("stackPercent",d))},{default:Q(()=>[...s[6]||(s[6]=[Ge(" 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:Q(()=>[...s[7]||(s[7]=[Ge(" Separate areas with lines ",-1)])]),_:1},8,["model-value"])])]),_:1},8,["model-value"])])}}}),lce=Le(ace,[["__scopeId","data-v-3bf56010"]]),cce={class:"d-flex flex-column gap-3"},uce=le({__name:"EditorSliceSection",setup(t){const{currentOptions:e,availableOptionKeys:n,setOption:o}=yn();function r(i){return n.value.includes(i)}return(i,s)=>{const a=Ws,l=Mn;return w(),R("div",cce,[r("displayAsPercentage")?(w(),K(p(Zt),{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"])):ae("",!0),r("showTotal")?(w(),K(p(Zt),{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"])):ae("",!0),r("showLabels")?(w(),K(p(Zt),{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"])):ae("",!0),r("showValues")?(w(),K(p(Zt),{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"])):ae("",!0),r("sliceMax")?(w(),K(p(br),{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"])):ae("",!0),r("sliceGroupLabel")?(w(),K(l,{key:5,label:"Group label","label-for":"opt-sliceGroupLabel"},{default:Q(()=>[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})):ae("",!0)])}}}),dce={class:"d-flex flex-column gap-3"},k6=.15,fce=le({__name:"EditorBarStyleSection",setup(t){const{currentOptions:e,availableOptionKeys:n,setOption:o}=yn(),r=S(()=>n.value.includes("barBackground")),i=S(()=>n.value.includes("barSeparators")),s=S(()=>n.value.includes("barGap")),a=S(()=>n.value.includes("connectedColumns")),l=S(()=>n.value.includes("waterfall")),c=S(()=>n.value.includes("waterfallTotal")),u=S(()=>n.value.includes("categoryLabelLine"));function d(y){return Math.max(0,Math.min(100,y))}const f=S(()=>{const y=parseFloat(e.value.barGap??""),x=isNaN(y)?Yd:y;return String(d(x))});function h(y){const x=parseFloat(y),_=isNaN(x)?Yd:x;o("barGap",String(d(_)))}function m(y){const x=parseFloat(y??""),_=isNaN(x)?k6:x,C=Math.max(0,Math.min(1,_));return String(Math.round(C*100))}function b(y){const x=parseFloat(y);if(isNaN(x))return String(k6);const _=Math.max(0,Math.min(100,x));return String(_/100)}const g=S(()=>m(e.value.connectionsOpacity));function v(y){o("connectionsOpacity",b(y))}return(y,x)=>(w(),R("div",dce,[p(r)?(w(),K(p(Zt),{key:0,"model-value":p(e).barBackground??!1,label:"Bar background","onUpdate:modelValue":x[0]||(x[0]=_=>p(o)("barBackground",_))},null,8,["model-value"])):ae("",!0),p(i)?(w(),K(p(Zt),{key:1,"model-value":p(e).barSeparators??!1,label:"Bar separators","onUpdate:modelValue":x[1]||(x[1]=_=>p(o)("barSeparators",_))},null,8,["model-value"])):ae("",!0),p(s)?(w(),K(p(br),{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"])):ae("",!0),p(a)?(w(),K(p(Zt),{key:3,"model-value":p(e).connectedColumns??!1,label:"Connected columns","onUpdate:modelValue":x[2]||(x[2]=_=>p(o)("connectedColumns",_))},null,8,["model-value"])):ae("",!0),p(a)&&p(e).connectedColumns?(w(),K(p(br),{key:4,id:"opt-connections-opacity","model-value":p(g),label:"Opacity",min:"0",max:"100",step:"1",suffix:"%","onUpdate:modelValue":v},null,8,["model-value"])):ae("",!0),p(l)?(w(),K(p(Zt),{key:5,"model-value":p(e).waterfall??!1,label:"Waterfall","onUpdate:modelValue":x[3]||(x[3]=_=>p(o)("waterfall",_))},null,8,["model-value"])):ae("",!0),p(c)&&p(e).waterfall?(w(),K(p(Zt),{key:6,"model-value":p(e).waterfallTotal??!1,label:"Waterfall total","onUpdate:modelValue":x[4]||(x[4]=_=>p(o)("waterfallTotal",_))},null,8,["model-value"])):ae("",!0),p(u)?(w(),K(p(Zt),{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"])):ae("",!0)]))}}),hce={class:"d-flex flex-column gap-3"},pce=le({__name:"EditorLineSymbols",setup(t){const{currentOptions:e,setOption:n}=yn();return(o,r)=>{const i=uT;return w(),R("div",hce,[H(p(Zt),{"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(),K(i,{key:0,"id-prefix":"opt-line-symbol",shape:p(e).lineSymbolShape??"circle","show-on":p(e).lineSymbolShowOn??"firstLast",style:Ot(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"])):ae("",!0)])}}}),mce={class:"d-flex flex-column gap-3"},gce=le({__name:"EditorLineSection",setup(t){const{currentOptions:e,availableOptionKeys:n,setOption:o}=yn(),r=S(()=>n.value.includes("interpolation")),i=S(()=>n.value.includes("edgePadding")),s=S(()=>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=Ra,d=Mn,f=pce;return w(),R("div",mce,[p(r)?(w(),K(d,{key:0,label:"Line interpolation","label-for":"opt-interpolation"},{default:Q(()=>[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})):ae("",!0),p(i)?(w(),K(p(Zt),{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"])):ae("",!0),p(s)?(w(),K(f,{key:2})):ae("",!0)])}}}),vce={class:"d-flex flex-column gap-3"},bce=le({__name:"EditorBarAppearance",props:{labels:{},colorizes:{},baseColor:{}},emits:["update:colorizes","update:baseColor"],setup(t,{emit:e}){const n=t,o=e,r=Ie([]),i=De(n.colorizes.length>0),s=S(()=>{const h=new Map;for(const m of n.colorizes)h.set(m.target,m.color);return h});function a(h){return s.value.get(h)??n.baseColor}const l=S(()=>r.value.length===0?n.baseColor:s.value.get(r.value[0])??n.baseColor);function c(h,m,b){b.ctrlKey||b.metaKey?r.value.indexOf(h)>=0?r.value=r.value.filter(v=>v!==h):r.value=[...r.value,h]:r.value.length===1&&r.value[0]===h?r.value=[]:r.value=[h]}function u(h){const m=new Map(n.colorizes.map(b=>[b.target,b]));for(const b of r.value)m.set(b,{target:b,color:h,label:""});o("update:colorizes",[...m.values()])}function d(){o("update:colorizes",[]),r.value=[]}function f(h){i.value=h,h||(o("update:colorizes",[]),r.value=[])}return(h,m)=>(w(),R("div",vce,[H(p(ka),{id:"bar-base-color",label:"Base color","model-value":t.baseColor,"onUpdate:modelValue":m[0]||(m[0]=b=>h.$emit("update:baseColor",b))},null,8,["model-value"]),H(p(Zt),{"model-value":p(i),label:"Customize colors","onUpdate:modelValue":f},null,8,["model-value"]),p(i)?(w(),R(Ne,{key:0},[H(p(ky),{items:t.labels,selected:p(r),"on-item-click":c,"onUpdate:selected":m[1]||(m[1]=b=>r.value=b)},{"item-leading":Q(({item:b})=>[H(p(lm),{color:a(b)},null,8,["color"])]),_:1},8,["items","selected"]),p(r).length>0?(w(),K(p(vd),{key:0,label:"Editing "+p(r).length+" "+(p(r).length===1?"label":"labels")},{default:Q(()=>[H(p(ka),{id:"bar-highlight-color",label:"Color for selected","model-value":p(l),"onUpdate:modelValue":u},null,8,["model-value"]),t.colorizes.length>0?(w(),K(p(Wo),{key:0,variant:"outline-danger",size:"sm",onClick:d},{default:Q(()=>[...m[2]||(m[2]=[Ge(" Reset all changes ",-1)])]),_:1})):ae("",!0)]),_:1},8,["label"])):ae("",!0)],64)):ae("",!0)]))}}),yce=Bo("cvdMode",()=>({cvdMode:De("")}));function dT(){const t=yce(),{cvdMode:e}=At(t);return{cvdMode:e}}const xce="#ffffff",wce="#1a1a1a",_ce={protanopia:"Protan",deuteranopia:"Deutan",tritanopia:"Tritan"};function C6(t,e,n){const r=(n?C5(t,e):t).map(s=>WJ(s,e)),i=Math.min(...r);return{level:UJ(i),ratio:`${i.toFixed(1)}:1`}}function Sce(t,e,n){const o=S(()=>{const s=bt(t);return s.length===0?null:C6(s,xce,bt(e))}),r=S(()=>{const s=bt(t);return s.length===0||!bt(n)?null:C6(s,wce,bt(e))}),i=S(()=>{const s=bt(t);if(s.length===0)return null;const a=s.length>=2?vte(s):[];return a.length===0?{safe:!0,issues:[]}:{safe:!1,issues:a.map(l=>({type:l.type,shortLabel:_ce[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 kce={render(){return Nt("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%"})}},Cce={render(){return Nt("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%"})}},Ace={render(){return Nt("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%"})}},$ce={render(){return Nt("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%"})}},Tce={class:"d-flex flex-column gap-3"},Mce={key:4,class:"d-flex align-items-center gap-2"},Oce={key:5,class:"d-flex align-items-center gap-2"},Bce={key:6,class:"d-flex align-items-center gap-2"},Lce=le({__name:"EditorColorSection",setup(t){const{chartType:e,data:n,colorizes:o}=hn(),{currentOptions:r,availableOptionKeys:i,setOption:s}=yn(),{cvdMode:a}=At(dT()),l=S(()=>[Be.BarVertical,Be.BarHorizontal,Be.VerticalBar,Be.HorizontalBar].includes(e.value)),c=S(()=>i.value.includes("colors")),u=S(()=>i.value.includes("colorPalette")),d=S(()=>Xs(n.value)),f=S(()=>d.value.labels),h=S(()=>{const M=r.value.colorPalette;return M?wA(M)??[]:r.value.colors??[]}),m=S(()=>h.value[0]??"#4e79a7");function b(M){r.value.colorPalette&&s("colorPalette",""),s("colors",[M])}const g=S(()=>{if(l.value){const M=o.value.map(N=>N.color),D=m.value;return M.length>0?[D,...M]:[D]}return h.value}),{lightContrastInfo:v,darkContrastInfo:y,cvdInfo:x}=Sce(g,()=>!!r.value.autoContrast,()=>r.value.allowDarkMode??!0),_=ft("cvdSafeBadgeRef"),C=ft("cvdBadgeRefs");function L(M){var N;const D=((N=x.value)==null?void 0:N.issues.findIndex(k=>k.type===M))??-1;return D>=0?C.value[D]:void 0}const O=[{value:"",text:"None",description:"Normal color vision",visual:$e(kce)},{value:"protanopia",text:"Protanopia",description:"No red cones (1% of males)",visual:$e(Cce)},{value:"deuteranopia",text:"Deuteranopia",description:"No green cones (1% of males)",visual:$e(Ace)},{value:"tritanopia",text:"Tritanopia",description:"No blue cones (very rare)",visual:$e($ce)}],$=[{value:"",label:"Custom",colors:[]},..._A().map(M=>({value:M.name,label:M.label,colors:[...M.colors]}))];return(M,D)=>{const N=bce;return w(),R("div",Tce,[p(l)?(w(),K(N,{key:0,labels:p(f),colorizes:p(o),"base-color":p(m),"onUpdate:colorizes":D[0]||(D[0]=k=>o.value=k),"onUpdate:baseColor":b},null,8,["labels","colorizes","base-color"])):(w(),R(Ne,{key:1},[p(u)?(w(),K(p(dF),{key:0,id:"opt-palette",label:"Color palette","model-value":p(r).colorPalette??"",palettes:$,"onUpdate:modelValue":D[1]||(D[1]=k=>p(s)("colorPalette",k))},null,8,["model-value"])):ae("",!0),p(c)&&!p(r).colorPalette?(w(),K(p(IN),{key:1,id:"opt-colors",label:"Colors","model-value":p(r).colors??[],"onUpdate:modelValue":D[2]||(D[2]=k=>p(s)("colors",k))},null,8,["model-value"])):ae("",!0)],64)),p(u)||p(c)?(w(),K(p(Zt),{key:2,id:"opt-allow-dark-mode",label:"Allow dark mode","model-value":p(r).allowDarkMode??!0,"onUpdate:modelValue":D[3]||(D[3]=k=>p(s)("allowDarkMode",k))},null,8,["model-value"])):ae("",!0),p(u)||p(c)?(w(),K(p(Zt),{key:3,id:"opt-auto-contrast",label:"Auto-adjust contrast","model-value":p(r).autoContrast??!1,"onUpdate:modelValue":D[4]||(D[4]=k=>p(s)("autoContrast",k))},null,8,["model-value"])):ae("",!0),p(v)?(w(),R("div",Mce,[D[6]||(D[6]=T("span",{class:"form-label mb-0"},"Light contrast",-1)),H(p(I_),{level:p(v).level,ratio:p(v).ratio},null,8,["level","ratio"])])):ae("",!0),p(y)?(w(),R("div",Oce,[D[7]||(D[7]=T("span",{class:"form-label mb-0"},"Dark contrast",-1)),H(p(I_),{level:p(y).level,ratio:p(y).ratio},null,8,["level","ratio"])])):ae("",!0),p(x)?(w(),R("div",Bce,[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(fy)),D[8]||(D[8]=Ge(" Safe ",-1)),H(p(m1),{class:"editor-color-section__cvd-badge__info"}),H(p(Id),{"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(Ne,{key:1},gt(p(x).issues,k=>(w(),R("span",{key:k.type,ref_for:!0,ref_key:"cvdBadgeRefs",ref:C,class:"editor-color-section__cvd-badge editor-color-section__cvd-badge--warn"},[H(p(lT)),Ge(" "+xe(k.shortLabel)+" ",1),H(p(m1),{class:"editor-color-section__cvd-badge__info"}),H(p(Id),{"teleport-to":"body",target:()=>L(k.type),title:k.tooltip,placement:"top"},null,8,["target","title"])]))),128))])):ae("",!0),H(p(An),{modelValue:p(a),"onUpdate:modelValue":D[5]||(D[5]=k=>Ke(a)?a.value=k:null),label:"Colorblind simulation",options:O,block:""},null,8,["modelValue"])])}}}),Pce=Le(Lce,[["__scopeId","data-v-bbe9fd0a"]]),Dce=le({__name:"EditorThemeSection",setup(t){const{chartTheme:e,availableThemes:n}=$$();return(o,r)=>(w(),K(p(Dn),{modelValue:p(e),"onUpdate:modelValue":r[0]||(r[0]=i=>Ke(e)?e.value=i:null),label:"Chart Theme",options:p(n),block:""},null,8,["modelValue","options"]))}}),Ece={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Ice(t,e){return w(),R("svg",Ece,[...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 fT=$e({name:"ph-palette",render:Ice}),Rce={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Nce(t,e){return w(),R("svg",Rce,[...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 Fce=$e({name:"ph-line-segments",render:Nce}),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:"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 Hce=$e({name:"ph-paint-brush",render:zce}),Wce={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Uce(t,e){return w(),R("svg",Wce,[...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 Gce=$e({name:"ph-chart-line",render:Uce}),qce={class:"d-flex flex-column gap-4"},Yce=le({__name:"EditorAppearanceTab",setup(t){const{chartType:e}=hn(),{availableOptionKeys:n}=yn(),o=S(()=>e.value.includes("horizontal")||e.value===Be.BarStacked||e.value===Be.BarSplit||e.value===Be.BarGrouped?Ku:pc),r=S(()=>n.value.includes("stacked")),i=S(()=>n.value.includes("interpolation")||n.value.includes("lineSymbols")),s=S(()=>!r.value&&i.value),a=S(()=>n.value.includes("barBackground")||n.value.includes("barSeparators")||n.value.includes("barGap")||n.value.includes("connectedColumns")||n.value.includes("categoryLabelLine")),l=S(()=>n.value.includes("displayAsPercentage"));return(c,u)=>{const d=Dce,f=Pce,h=gce,m=fce,b=uce,g=lce;return w(),R("div",qce,[H(p(Ho),{title:"Theme",icon:p(Hce)},{default:Q(()=>[H(d)]),_:1},8,["icon"]),H(p(Ho),{title:"Colors",icon:p(fT)},{default:Q(()=>[H(f)]),_:1},8,["icon"]),p(s)?(w(),K(p(Ho),{key:0,title:"Line Style",icon:p(Fce)},{default:Q(()=>[H(h)]),_:1},8,["icon"])):ae("",!0),p(a)?(w(),K(p(Ho),{key:1,title:"Bar Style",icon:p(o)},{default:Q(()=>[H(m)]),_:1},8,["icon"])):ae("",!0),p(l)?(w(),K(p(Ho),{key:2,title:"Slices",icon:p(fC)},{default:Q(()=>[H(b)]),_:1},8,["icon"])):ae("",!0),p(r)?(w(),K(p(Ho),{key:3,title:"Areas",icon:p(Gce)},{default:Q(()=>[H(g)]),_:1},8,["icon"])):ae("",!0)])}}}),jce={class:"d-flex flex-column gap-3"},Xce=le({__name:"EditorPropertyForm",setup(t){const{title:e,description:n,byline:o,note:r,source:i,sourceUrl:s}=hn();return(a,l)=>{const c=Ws,u=Mn,d=ay;return w(),R("div",jce,[H(u,{label:"Title","label-for":"prop-title"},{default:Q(()=>[H(c,{id:"prop-title",modelValue:p(e),"onUpdate:modelValue":l[0]||(l[0]=f=>Ke(e)?e.value=f:null),placeholder:"Chart title"},null,8,["modelValue"])]),_:1}),H(u,{label:"Description","label-for":"prop-description"},{default:Q(()=>[H(d,{id:"prop-description",modelValue:p(n),"onUpdate:modelValue":l[1]||(l[1]=f=>Ke(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:Q(()=>[H(c,{id:"prop-byline",modelValue:p(o),"onUpdate:modelValue":l[2]||(l[2]=f=>Ke(o)?o.value=f:null),placeholder:"Author or byline"},null,8,["modelValue"])]),_:1}),H(u,{label:"Note","label-for":"prop-note"},{default:Q(()=>[H(d,{id:"prop-note",modelValue:p(r),"onUpdate:modelValue":l[3]||(l[3]=f=>Ke(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:Q(()=>[H(c,{id:"prop-source",modelValue:p(i),"onUpdate:modelValue":l[4]||(l[4]=f=>Ke(i)?i.value=f:null),placeholder:"Data source"},null,8,["modelValue"])]),_:1}),H(u,{label:"Source URL","label-for":"prop-source-url"},{default:Q(()=>[H(c,{id:"prop-source-url",modelValue:p(s),"onUpdate:modelValue":l[5]||(l[5]=f=>Ke(s)?s.value=f:null),type:"url",placeholder:"https://..."},null,8,["modelValue"])]),_:1})])}}}),hT={render(){return Nt("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%"})}},pT={render(){return Nt("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%"})}},mT={render(){return Nt("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%"})}},gT={render(){return Nt("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%"})}},vT={render(){return Nt("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%"})}},Kce={render(){return Nt("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%"})}},Zce={render(){return Nt("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%"})}},Qce={render(){return Nt("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%"})}},Jce={render(){return Nt("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%"})}},eue={render(){return Nt("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%"})}},tue={render(){return Nt("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%"})}},bT={render(){return Nt("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%"})}},yT={render(){return Nt("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%"})}},nue=le({__name:"EditorChartTypePicker",setup(t){const{chartType:e,selectedColumn:n}=hn(),{currentOptions:o,availableOptionKeys:r,setOption:i}=yn(),s=Ko(),a=S(()=>r.value.includes("stackMode")),l=[{value:"normal",text:"Normal"},{value:"percent",text:"Percentage (100%)"}],c=[{value:Be.BarVertical,label:"Columns",description:"Compare values across categories",visual:$e(hT)},{value:Be.BarHorizontal,label:"Bars",description:"Compare values with long labels",visual:$e(pT)},{value:Be.BarMulti,label:"Grouped Columns",description:"Compare multiple series side by side",visual:$e(mT)},{value:Be.ColumnStacked,label:"Stacked Columns",description:"Compare stacked totals",visual:$e(Qce)},{value:Be.BarStacked,label:"Stacked Bars",description:"Compare stacked totals horizontally",visual:$e(Jce)},{value:Be.BarSplit,label:"Split Bars",description:"Compare multiple metrics in separate bar panels",visual:$e(eue)},{value:Be.BarGrouped,label:"Grouped Bars",description:"Compare multiple series side by side horizontally",visual:$e(tue)},{value:Be.Line,label:"Line",description:"Show trends over time",visual:$e(gT)},{value:Be.LineMulti,label:"Lines",description:"Compare trends across series",visual:$e(vT)},{value:Be.Area,label:"Area",description:"Show magnitude over time",visual:$e(Kce)},{value:Be.AreaStacked,label:"Areas",description:"Compare and stack multiple area series",visual:$e(Zce)},{value:Be.Donut,label:"Donut",description:"Show proportions with a center space",visual:$e(bT)},{value:Be.Pie,label:"Pie",description:"Show parts of a whole",visual:$e(yT)}],u=[Be.BarVertical,Be.BarHorizontal,Be.Line,Be.Area,Be.VerticalBar,Be.HorizontalBar],d=S(()=>u.includes(e.value)&&s.columns.value.length>2),f=S(()=>s.columns.value.slice(1).map(h=>({value:h,text:h})));return He([e,()=>s.columns.value],()=>{d.value&&!n.value&&s.columns.value.length>2&&(n.value=s.columns.value[1])},{immediate:!0}),(h,m)=>{const b=Mn,g=Ra;return w(),R(Ne,null,[H(b,{label:"Chart type","label-for":"chart-type-select"},{default:Q(()=>[H(p(Dn),{id:"chart-type-select",modelValue:p(e),"onUpdate:modelValue":m[0]||(m[0]=v=>Ke(e)?e.value=v:null),block:"",options:c},null,8,["modelValue"])]),_:1}),p(d)?(w(),K(b,{key:0,label:"Data column","label-for":"column-select",class:"mt-3"},{default:Q(()=>[H(g,{id:"column-select",modelValue:p(n),"onUpdate:modelValue":m[1]||(m[1]=v=>Ke(n)?n.value=v:null),options:p(f)},null,8,["modelValue","options"])]),_:1})):ae("",!0),p(a)?(w(),K(b,{key:1,label:"Stack mode","label-for":"opt-stack-mode",class:"mt-3"},{default:Q(()=>[H(g,{id:"opt-stack-mode","model-value":p(o).stackMode??"normal",options:l,"onUpdate:modelValue":m[2]||(m[2]=v=>p(i)("stackMode",v))},null,8,["model-value"])]),_:1})):ae("",!0)],64)}}}),oue=100,rue=Bo("chartHistory",()=>{const t=new Map,e=De(!1),n=De(!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??Zd))},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>oue&&f.undoStack.shift(),f.redoStack.length=0,f.currentState=d,l())}function u(){const d=hn(),{store:f,hydrate:h}=yn(),{sessionId:m}=Rs();function b(){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,Bp(!0).run(()=>{He(m,_=>{if(r=!0,o=_,_){const C=s(_);C.currentState||(C.currentState=b())}l(),_n(()=>{r=!1})},{immediate:!0,flush:"sync"}),He([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(b())},{deep:!0})}));function g(x){r=!0;const _=JSON.parse(x);d.hydrate(_.config),h(_.typeOptions),_n(()=>{r=!1})}function v(){const x=t.get(o);!x||x.undoStack.length===0||(x.redoStack.push(x.currentState),x.currentState=x.undoStack.pop(),l(),g(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(),g(x.currentState))}return{undo:v,redo:y}}return{canUndo:S(()=>e.value),canRedo:S(()=>n.value),init:u}});function iue(){const t=rue(),{canUndo:e,canRedo:n}=At(t),{undo:o,redo:r}=t.init();return{canUndo:e,canRedo:n,undo:o,redo:r}}const sue={class:"chart-edit-toolbar"},aue=le({__name:"ChartEditToolbar",setup(t){const e=Or(),{viewMode:n}=At(e),{setViewMode:o}=e,{canUndo:r,canRedo:i,undo:s,redo:a}=iue(),l=S({get:()=>n.value,set:u=>o(u)}),c=[{value:"preview",text:"Preview"},{value:"dsl",text:"DSL"}];return(u,d)=>(w(),R("div",sue,[H(p(zH),{disabled:!p(r),onClick:p(s)},null,8,["disabled","onClick"]),H(p(RH),{disabled:!p(i),onClick:p(a)},null,8,["disabled","onClick"]),H(p(bW),{modelValue:p(l),"onUpdate:modelValue":d[0]||(d[0]=f=>Ke(l)?l.value=f:null),options:c,size:"sm"},null,8,["modelValue"])]))}}),lue=Le(aue,[["__scopeId","data-v-de044834"]]);let q1=[],xT=[];(()=>{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?xT:q1).push(n=n+t[e])})();function cue(t){if(t<768)return!1;for(let e=0,n=q1.length;;){let o=e+n>>1;if(t<q1[o])n=o;else if(t>=xT[o])e=o+1;else return!0;if(e==n)return!1}}function A6(t){return t>=127462&&t<=127487}const $6=8205;function uue(t,e,n=!0,o=!0){return(n?wT:due)(t,e,o)}function wT(t,e,n){if(e==t.length)return e;e&&_T(t.charCodeAt(e))&&ST(t.charCodeAt(e-1))&&e--;let o=vv(t,e);for(e+=T6(o);e<t.length;){let r=vv(t,e);if(o==$6||r==$6||n&&cue(r))e+=T6(r),o=r;else if(A6(r)){let i=0,s=e-2;for(;s>=0&&A6(vv(t,s));)i++,s-=2;if(i%2==0)break;e+=2}else break}return e}function due(t,e,n){for(;e>0;){let o=wT(t,e-2,n);if(o<e)return o;e--}return 0}function vv(t,e){let n=t.charCodeAt(e);if(!ST(n)||e+1==t.length)return n;let o=t.charCodeAt(e+1);return _T(o)?(n-55296<<10)+(o-56320)+65536:n}function _T(t){return t>=56320&&t<57344}function ST(t){return t>=55296&&t<56320}function T6(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]=tu(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),Ni.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]=tu(this,e,n);let o=[];return this.decompose(e,n,o,0),Ni.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 wd(this),i=new wd(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 wd(this,e)}iterRange(e,n=this.length){return new kT(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 CT(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):Ni.from(Cn.split(e,[]))}}class Cn extends Ut{constructor(e,n=fue(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 hue(r,a,o,s);r=a+1,o++}}decompose(e,n,o,r){let i=e<=0&&n>=this.length?this:new Cn(M6(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(r&1){let s=o.pop(),a=Xh(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]=tu(this,e,n);let r=Xh(this.text,Xh(o.text,M6(this.text,0,e)),n),i=this.length+o.length-(n-e);return r.length<=32?new Cn(r,i):Ni.from(Cn.split(r,[]),i)}sliceString(e,n=this.length,o=`
|
|
911
|
+
`){[e,n]=tu(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 Ni 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]=tu(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 Ni(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=`
|
|
912
|
+
`){[e,n]=tu(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 Ni))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 m of e)m.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 m;if(h.lines>i&&h instanceof Ni)for(let b of h.children)d(b);else h.lines>s&&(l>s||!l)?(f(),a.push(h)):h instanceof Cn&&l&&(m=u[u.length-1])instanceof Cn&&h.lines+m.lines<=32?(l+=h.lines,c+=h.length+1,u[u.length-1]=new Cn(m.text.concat(h.text),m.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]:Ni.from(u,c)),c=-1,l=u.length=0)}for(let h of e)d(h);return f(),a.length==1?a[0]:new Ni(a,n)}}Ut.empty=new Cn([""],0);function fue(t){let e=-1;for(let n of t)e+=n.length+1;return e}function Xh(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 M6(t,e,n){return Xh(t,[""],e,n)}class wd{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=`
|
|
913
|
+
`,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 kT{constructor(e,n,o){this.value="",this.done=!1,this.cursor=new wd(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 CT{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()},wd.prototype[Symbol.iterator]=kT.prototype[Symbol.iterator]=CT.prototype[Symbol.iterator]=function(){return this});class hue{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 tu(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function To(t,e,n=!0,o=!0){return uue(t,e,n,o)}function pue(t){return t>=56320&&t<57344}function mue(t){return t>=55296&&t<56320}function gue(t,e){let n=t.charCodeAt(e);if(!mue(n)||e+1==t.length)return n;let o=t.charCodeAt(e+1);return pue(o)?(n-55296<<10)+(o-56320)+65536:n}function vue(t){return t<65536?1:2}const Y1=/\r\n?|\n/;var gr=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(gr||(gr={}));class Zi{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){j1(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 Zi(e)}composeDesc(e){return this.empty?e:e.empty?this:AT(this,e)}mapDesc(e,n=!1){return e.empty?this:X1(this,e,n)}mapPos(e,n=-1,o=gr.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!=gr.Simple&&c>=e&&(o==gr.TrackDel&&r<e&&c>e||o==gr.TrackBefore&&r<e||o==gr.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 Zi(e)}static create(e){return new Zi(e)}}class zn extends Zi{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 j1(this,(n,o,r,i,s)=>e=e.replace(r,r+(o-n),s),!1),e}mapDesc(e,n=!1){return X1(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 zn(n,o)}compose(e){return this.empty?e:e.empty?this:AT(this,e,!0)}map(e,n=!1){return e.empty?this:X1(this,e,n,!0)}iterChanges(e,n=!1){j1(this,e,n)}get desc(){return Zi.create(this.sections)}filter(e){let n=[],o=[],r=[],i=new nf(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);vo(r,u,-1);let d=i.ins==-1?-1:i.off==0?i.ins:0;vo(n,u,d),d>0&&pa(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);vo(n,u,-1),vo(r,u,i.ins==-1?-1:i.off==0?i.ins:0),i.forward(u),a+=u}}return{changes:new zn(n,o),filtered:Zi.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&&vo(r,n-s,-1);let d=new zn(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 zn){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 m=h?typeof h=="string"?Ut.of(h.split(o||Y1)):h:Ut.empty,b=m.length;if(d==f&&b==0)return;d<s&&l(),d>s&&vo(r,d-s,-1),vo(r,f-d,b),pa(i,r,m),s=f}}return c(e),l(!a),a}static empty(e){return new zn(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 zn(n,o)}static createSet(e,n){return new zn(e,n)}}function vo(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 pa(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 j1(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 X1(t,e,n,o=!1){let r=[],i=o?[]:null,s=new nf(t),a=new nf(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);vo(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(vo(r,a.ins,-1);c;){let u=Math.min(s.len,c);s.ins>=0&&l<s.i&&s.len<=u&&(vo(r,0,s.ins),i&&pa(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;vo(r,c,l<s.i?s.ins:0),i&&l<s.i&&pa(i,r,s.text),l=s.i,s.forward(s.len-u)}else{if(s.done&&a.done)return i?zn.createSet(r,i):Zi.create(r);throw new Error("Mismatched change set lengths")}}}function AT(t,e,n=!1){let o=[],r=n?[]:null,i=new nf(t),s=new nf(e);for(let a=!1;;){if(i.done&&s.done)return r?zn.createSet(o,r):Zi.create(o);if(i.ins==0)vo(o,i.len,0,a),i.next();else if(s.len==0&&!s.done)vo(o,0,s.ins,a),r&&pa(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;vo(o,l,u,a),r&&u&&pa(r,o,s.text)}else s.ins==-1?(vo(o,i.off?0:i.len,l,a),r&&pa(r,o,i.textBit(l))):(vo(o,i.off?0:i.len,s.off?0:s.ins,a),r&&!s.off&&pa(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 nf{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 hl{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 hl(o,r,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return Re.range(e,n);let o=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return Re.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 Re.range(e.anchor,e.head)}static create(e,n,o){return new hl(e,n,o)}}class Re{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:Re.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 Re([this.main],0)}addRange(e,n=!0){return Re.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let o=this.ranges.slice();return o[n]=e,Re.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 Re(e.ranges.map(n=>hl.fromJSON(n)),e.main)}static single(e,n=e){return new Re([Re.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 Re.normalized(e.slice(),n);o=i.to}return new Re(e,n)}static cursor(e,n=0,o,r){return hl.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?hl.create(n,e,48|i):hl.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?Re.range(l,a):Re.range(a,l))}}return new Re(e,n)}}function $T(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let L2=0;class pt{constructor(e,n,o,r,i){this.combine=e,this.compareInput=n,this.compare=o,this.isStatic=r,this.id=L2++,this.default=e([]),this.extensions=typeof i=="function"?i(this):i}get reader(){return this}static define(e={}){return new pt(e.combine||(n=>n),e.compareInput||((n,o)=>n===o),e.compare||(e.combine?(n,o)=>n===o:P2),!!e.static,e.enables)}of(e){return new Kh([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Kh(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Kh(e,this,2,n)}from(e,n){return n||(n=o=>o),this.compute([e],o=>n(o.field(e)))}}function P2(t,e){return t==e||t.length==e.length&&t.every((n,o)=>n===e[o])}class Kh{constructor(e,n,o,r){this.dependencies=e,this.facet=n,this.type=o,this.value=r,this.id=L2++}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)||K1(d,u)){let h=o(d);if(a?!O6(h,d.values[s],r):!r(h,d.values[s]))return d.values[s]=h,1}return 0},reconfigure:(d,f)=>{let h,m=f.config.address[i];if(m!=null){let b=sp(f,m);if(this.dependencies.every(g=>g instanceof pt?f.facet(g)===d.facet(g):g instanceof Ga?f.field(g,!1)==d.field(g,!1):!0)||(a?O6(h=o(d),b,r):r(h=o(d),b)))return d.values[s]=b,0}else h=o(d);return d.values[s]=h,1}}}}function O6(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 K1(t,e){let n=!1;for(let o of e)_d(t,o)&1&&(n=!0);return n}function bue(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=sp(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)_d(l,c);return l.values[s]=a(l),1},update(l,c){if(!K1(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=K1(l,o),d=c.config.facets[e.id],f=c.facet(e);if(d&&!u&&P2(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 mh=pt.define({static:!0});class Ga{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 Ga(L2++,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(mh).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(mh),s=r.facet(mh),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,mh.of({field:this,create:e})]}get extension(){return this}}const ul={lowest:4,low:3,default:2,high:1,highest:0};function Wu(t){return e=>new TT(e,t)}const D2={highest:Wu(ul.highest),high:Wu(ul.high),default:Wu(ul.default),low:Wu(ul.low),lowest:Wu(ul.lowest)};class TT{constructor(e,n){this.inner=e,this.prec=n}}class Qm{of(e){return new Z1(this,e)}reconfigure(e){return Qm.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Z1{constructor(e,n){this.compartment=e,this.inner=n}}class ip{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 yue(e,n,s))f instanceof Ga?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],m=h[0].facet,b=u&&u[f]||[];if(h.every(g=>g.type==0))if(a[m.id]=l.length<<1|1,P2(b,h))l.push(o.facet(m));else{let g=m.combine(h.map(v=>v.value));l.push(o&&m.compare(g,o.facet(m))?o.facet(m):g)}else{for(let g of h)g.type==0?(a[g.id]=l.length<<1|1,l.push(g.value)):(a[g.id]=c.length<<1,c.push(v=>g.dynamicSlot(v)));a[m.id]=c.length<<1,c.push(g=>bue(g,m,h))}}let d=c.map(f=>f(a));return new ip(e,s,d,a,l,i)}}function yue(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 Z1&&n.delete(s.compartment)}if(r.set(s,a),Array.isArray(s))for(let c of s)i(c,a);else if(s instanceof Z1){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 TT)i(s.inner,s.prec);else if(s instanceof Ga)o[a].push(s),s.provides&&i(s.provides,a);else if(s instanceof Kh)o[a].push(s),s.facet.extensions&&i(s.facet.extensions,ul.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,ul.default),o.reduce((s,a)=>s.concat(a))}function _d(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 sp(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const MT=pt.define(),Q1=pt.define({combine:t=>t.some(e=>e),static:!0}),OT=pt.define({combine:t=>t.length?t[0]:void 0,static:!0}),BT=pt.define(),LT=pt.define(),PT=pt.define(),DT=pt.define({combine:t=>t.length?t[0]:!1});class qa{constructor(e,n){this.type=e,this.value=n}static define(){return new xue}}class xue{of(e){return new qa(this,e)}}class wue{constructor(e){this.map=e}of(e){return new $n(this,e)}}class $n{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 $n(this.type,n)}is(e){return this.type==e}static define(e={}){return new wue(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}}$n.reconfigure=$n.define();$n.appendConfig=$n.define();class Wn{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&&$T(o,n.newLength),i.some(a=>a.type==Wn.time)||(this.annotations=i.concat(Wn.time.of(Date.now())))}static create(e,n,o,r,i,s){return new Wn(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(Wn.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}Wn.time=qa.define();Wn.userEvent=qa.define();Wn.addToHistory=qa.define();Wn.remote=qa.define();function _ue(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 ET(t,e,n){var o;let r,i,s;return n?(r=e.changes,i=zn.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:$n.mapEffects(t.effects,r).concat($n.mapEffects(e.effects,i)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function J1(t,e,n){let o=e.selection,r=Bc(e.annotations);return e.userEvent&&(r=r.concat(Wn.userEvent.of(e.userEvent))),{changes:e.changes instanceof zn?e.changes:zn.of(e.changes||[],n,t.facet(OT)),selection:o&&(o instanceof Re?o:Re.single(o.anchor,o.head)),effects:Bc(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function IT(t,e,n){let o=J1(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=ET(o,J1(t,e[i],s?o.changes.newLength:t.doc.length),s)}let r=Wn.create(t,o.changes,o.selection,o.effects,o.annotations,o.scrollIntoView);return kue(n?Sue(r):r)}function Sue(t){let e=t.startState,n=!0;for(let r of e.facet(BT)){let i=r(t);if(i===!1){n=!1;break}Array.isArray(i)&&(n=n===!0?i:_ue(n,i))}if(n!==!0){let r,i;if(n===!1)i=t.changes.invertedDesc,r=zn.empty(e.doc.length);else{let s=t.changes.filter(n);r=s.changes,i=s.filtered.mapDesc(s.changes).invertedDesc}t=Wn.create(e,r,t.selection&&t.selection.map(i),$n.mapEffects(t.effects,i),t.annotations,t.scrollIntoView)}let o=e.facet(LT);for(let r=o.length-1;r>=0;r--){let i=o[r](t);i instanceof Wn?t=i:Array.isArray(i)&&i.length==1&&i[0]instanceof Wn?t=i[0]:t=IT(e,Bc(i),!1)}return t}function kue(t){let e=t.startState,n=e.facet(PT),o=t;for(let r=n.length-1;r>=0;r--){let i=n[r](t);i&&Object.keys(i).length&&(o=ET(o,J1(e,i,t.changes.newLength),!0))}return o==t?t:Wn.create(e,t.changes,t.selection,o.effects,o.annotations,o.scrollIntoView)}const Cue=[];function Bc(t){return t==null?Cue:Array.isArray(t)?t:[t]}var Cs=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(Cs||(Cs={}));const Aue=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let eb;try{eb=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function $ue(t){if(eb)return eb.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||Aue.test(n)))return!0}return!1}function Tue(t){return e=>{if(!/\S/.test(e))return Cs.Space;if($ue(e))return Cs.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return Cs.Word;return Cs.Other}}class Kt{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++)_d(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 _d(this,o),sp(this,o)}update(...e){return IT(this,e,!0)}applyTransaction(e){let n=this.config,{base:o,compartments:r}=n;for(let a of e.effects)a.is(Qm.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($n.reconfigure)?(n=null,o=a.value):a.is($n.appendConfig)&&(n=null,o=Bc(o).concat(a.value));let i;n?i=e.startState.values.slice():(n=ip.resolve(o,r,this),i=new Kt(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(l,c)=>c.reconfigure(l,this),null).values);let s=e.startState.facet(Q1)?e.newSelection:e.newSelection.asSingle();new Kt(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:Re.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=Bc(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=$n.mapEffects(s,u).concat($n.mapEffects(Bc(l.effects),d))}return{changes:r,selection:Re.create(i,n.mainIndex),effects:s}}changes(e=[]){return e instanceof zn?e:zn.of(e,this.doc.length,this.facet(Kt.lineSeparator))}toText(e){return Ut.of(e.split(this.facet(Kt.lineSeparator)||Y1))}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:(_d(this,n),sp(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 Ga&&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 Kt.create({doc:e.doc,selection:Re.fromJSON(e.selection),extensions:n.extensions?r.concat([n.extensions]):r})}static create(e={}){let n=ip.resolve(e.extensions||[],new Map),o=e.doc instanceof Ut?e.doc:Ut.of((e.doc||"").split(n.staticFacet(Kt.lineSeparator)||Y1)),r=e.selection?e.selection instanceof Re?e.selection:Re.single(e.selection.anchor,e.selection.head):Re.single(0);return $T(r,o.length),n.staticFacet(Q1)||(r=r.asSingle()),new Kt(n,o,r,n.dynamicSlots.map(()=>null),(i,s)=>s.create(i),null)}get tabSize(){return this.facet(Kt.tabSize)}get lineBreak(){return this.facet(Kt.lineSeparator)||`
|
|
914
|
+
`}get readOnly(){return this.facet(DT)}phrase(e,...n){for(let o of this.facet(Kt.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(MT))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 Tue(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=To(n,s,!1);if(i(n.slice(l,s))!=Cs.Word)break;s=l}for(;a<r;){let l=To(n,a);if(i(n.slice(a,l))!=Cs.Word)break;a=l}return s==a?null:Re.range(s+o,a+o)}}Kt.allowMultipleSelections=Q1;Kt.tabSize=pt.define({combine:t=>t.length?t[0]:4});Kt.lineSeparator=OT;Kt.readOnly=DT;Kt.phrases=pt.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])}});Kt.languageData=MT;Kt.changeFilter=BT;Kt.transactionFilter=LT;Kt.transactionExtender=PT;Qm.reconfigure=$n.define();function Mue(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 Ll{eq(e){return this==e}range(e,n=e){return tb.create(e,n,this)}}Ll.prototype.startSide=Ll.prototype.endSide=0;Ll.prototype.point=!1;Ll.prototype.mapMode=gr.TrackDel;function E2(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let tb=class RT{constructor(e,n,o){this.from=e,this.to=n,this.value=o}static create(e,n,o){return new RT(e,n,o)}};function nb(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class I2{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 m=n.mapPos(u,c.startSide,c.mapMode);if(m==null||(f=h=m,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 I2(r,i,o,a):null,pos:s}}}class nn{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 nn(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(nb)),this.isEmpty)return n.length?nn.of(n):this;let a=new NT(this,null,-1).goto(0),l=0,c=[],u=new of;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(tb.create(a.from,a.to,a.value))),a.next());return u.finishInner(this.nextLayer.isEmpty&&!c.length?nn.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 nn(o,n,i||nn.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 rf.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return rf.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=B6(s,a,o),c=new Uu(s,l,i),u=new Uu(a,l,i);o.iterGaps((d,f,h)=>L6(c,d,u,f,h,r)),o.empty&&o.length==0&&L6(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=B6(i,s),l=new Uu(i,a,0).goto(o),c=new Uu(s,a,0).goto(o);for(;;){if(l.to!=c.to||!ob(l.active,c.active)||l.point&&(!c.point||!E2(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 Uu(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 of;for(let r of e instanceof tb?[e]:n?Oue(e):e)o.add(r.from,r.to,r.value);return o.finish()}static join(e){if(!e.length)return nn.empty;let n=e[e.length-1];for(let o=e.length-2;o>=0;o--)for(let r=e[o];r!=nn.empty;r=r.nextLayer)n=new nn(r.chunkPos,r.chunk,n,Math.max(r.maxPoint,n.maxPoint));return n}}nn.empty=new nn([],[],null,-1);function Oue(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let o=t[n];if(nb(e,o)>0)return t.slice().sort(nb);e=o}return t}nn.empty.nextLayer=nn.empty;class of{finishChunk(e){this.chunks.push(new I2(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 of)).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(nn.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=nn.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function B6(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 NT{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 rf{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 NT(s,n,o,i));return r.length==1?r[0]:new rf(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 Uu{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=rf.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){gh(this.active,e),gh(this.activeTo,e),gh(this.activeRank,e),this.minActive=P6(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++;vh(this.active,n,o),vh(this.activeTo,n,r),vh(this.activeRank,n,i),e&&vh(e,n,this.cursor.from),this.minActive=P6(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&&gh(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 L6(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,m=Math.min(h,s);if(t.point||n.point?(t.point&&n.point&&E2(t.point,n.point)&&ob(t.activeForPoint(t.to),n.activeForPoint(n.to))||i.comparePoint(a,m,t.point,n.point),u=!1):(u&&i.boundChange(a),m>a&&!ob(t.active,n.active)&&i.compareRange(a,m,t.active,n.active),c&&m<s&&(d||t.openEnd(h)!=n.openEnd(h))&&(u=!0)),h>s)break;a=h,f<=0&&t.next(),f>=0&&n.next()}}function ob(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!E2(t[n],e[n]))return!1;return!0}function gh(t,e){for(let n=e,o=t.length-1;n<o;n++)t[n]=t[n+1];t.pop()}function vh(t,e,n){for(let o=t.length-1;o>=e;o--)t[o+1]=t[o];t[e]=n}function P6(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 Jm(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=To(t,r));return o}function Bue(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=To(t,r)}return t.length}const rb="ͼ",D6=typeof Symbol>"u"?"__"+rb:Symbol.for(rb),ib=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),E6=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Ba{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 m=a[h];if(/&/.test(h))i(h.split(/,\s*/).map(b=>s.map(g=>b.replace(/&/,g))).reduce((b,g)=>b.concat(g)),m,l);else if(m&&typeof m=="object"){if(!d)throw new RangeError("The value of a property ("+h+") should be a primitive value.");i(r(h),m,u,f)}else m!=null&&u.push(h.replace(/_.*/,"").replace(/[A-Z]/g,b=>"-"+b.toLowerCase())+": "+m+";")}(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(`
|
|
915
|
+
`)}static newName(){let e=E6[D6]||1;return E6[D6]=e+1,rb+e.toString(36)}static mount(e,n,o){let r=e[ib],i=o&&o.nonce;r?i&&r.setNonce(i):r=new Lue(e,i),r.mount(Array.isArray(n)?n:[n],e)}}let I6=new Map;class Lue{constructor(e,n){let o=e.ownerDocument||e,r=o.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let i=I6.get(o);if(i)return e[ib]=i;this.sheet=new r.CSSStyleSheet,I6.set(o,this)}else this.styleTag=o.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[ib]=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()+`
|
|
916
|
+
`;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 La={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:"'"},sf={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Pue=typeof navigator<"u"&&/Mac/.test(navigator.platform),Due=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var no=0;no<10;no++)La[48+no]=La[96+no]=String(no);for(var no=1;no<=24;no++)La[no+111]="F"+no;for(var no=65;no<=90;no++)La[no]=String.fromCharCode(no+32),sf[no]=String.fromCharCode(no);for(var yv in La)sf.hasOwnProperty(yv)||(sf[yv]=La[yv]);function Eue(t){var e=Pue&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Due&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?sf:La)[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 Vo=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},sb=typeof document<"u"?document:{documentElement:{style:{}}};const ab=/Edge\/(\d+)/.exec(Vo.userAgent),FT=/MSIE \d/.test(Vo.userAgent),lb=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Vo.userAgent),eg=!!(FT||lb||ab),R6=!eg&&/gecko\/(\d+)/i.test(Vo.userAgent),xv=!eg&&/Chrome\/(\d+)/.exec(Vo.userAgent),Iue="webkitFontSmoothing"in sb.documentElement.style,cb=!eg&&/Apple Computer/.test(Vo.vendor),N6=cb&&(/Mobile\/\w+/.test(Vo.userAgent)||Vo.maxTouchPoints>2);var ot={mac:N6||/Mac/.test(Vo.platform),windows:/Win/.test(Vo.platform),linux:/Linux|X11/.test(Vo.platform),ie:eg,ie_version:FT?sb.documentMode||6:lb?+lb[1]:ab?+ab[1]:0,gecko:R6,gecko_version:R6?+(/Firefox\/(\d+)/.exec(Vo.userAgent)||[0,0])[1]:0,chrome:!!xv,chrome_version:xv?+xv[1]:0,ios:N6,android:/Android\b/.test(Vo.userAgent),webkit_version:Iue?+(/\bAppleWebKit\/(\d+)/.exec(Vo.userAgent)||[0,0])[1]:0,safari:cb,safari_version:cb?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Vo.userAgent)||[0,0])[1]:0,tabSize:sb.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function R2(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 ap=Object.create(null);function N2(t,e,n){if(t==e)return!0;t||(t=ap),e||(e=ap);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 Rue(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 F6(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 Nue(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 tg{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 Nr=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(Nr||(Nr={}));class Xn extends Ll{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 Lf(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 Pl(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}=VT(e,n);o=(i?n?-3e8:-1:5e8)-1,r=(s?n?2e8:1:-6e8)+1}return new Pl(e,o,r,n,e.widget||null,!0)}static line(e){return new Pf(e)}static set(e,n=!1){return nn.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Xn.none=nn.empty;class Lf extends Xn{constructor(e){let{start:n,end:o}=VT(e);super(n?-1:5e8,o?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?R2(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||ap}eq(e){return this==e||e instanceof Lf&&this.tagName==e.tagName&&N2(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)}}Lf.prototype.point=!1;class Pf extends Xn{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Pf&&this.spec.class==e.spec.class&&N2(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)}}Pf.prototype.mapMode=gr.TrackBefore;Pf.prototype.point=!0;class Pl 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?gr.TrackBefore:gr.TrackAfter:gr.TrackDel}get type(){return this.startSide!=this.endSide?Nr.WidgetRange:this.startSide<=0?Nr.WidgetBefore:Nr.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Pl&&Fue(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)}}Pl.prototype.point=!0;function VT(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 Fue(t,e){return t==e||!!(t&&e&&t.compare(e))}function Lc(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 af extends Ll{constructor(e,n){super(),this.tagName=e,this.attributes=n}eq(e){return e==this||e instanceof af&&this.tagName==e.tagName&&N2(this.attributes,e.attributes)}static create(e){return new af(e.tagName,e.attributes||ap)}static set(e,n=!1){return nn.of(e,n)}}af.prototype.startSide=af.prototype.endSide=-1;function lf(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function ub(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function Sd(t,e){if(!e.anchorNode)return!1;try{return ub(t,e.anchorNode)}catch{return!1}}function Zh(t){return t.nodeType==3?cf(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function kd(t,e,n,o){return n?V6(t,e,n,o,-1)||V6(t,e,n,o,1):!1}function Pa(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function lp(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function V6(t,e,n,o,r){for(;;){if(t==n&&e==o)return!0;if(e==(r<0?0:Ns(t))){if(t.nodeName=="DIV")return!1;let i=t.parentNode;if(!i||i.nodeType!=1)return!1;e=Pa(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?Ns(t):0}else return!1}}function Ns(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function cp(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function Vue(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 zT(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 zue(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,m=1,b=1;if(h)f=Vue(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:m,scaleY:b}=zT(u,y)),f={left:y.left,right:y.left+u.clientWidth*m,top:y.top,bottom:y.top+u.clientHeight*b}}let g=0,v=0;if(r=="nearest")e.top<f.top?(v=e.top-(f.top+s),n>0&&e.bottom>f.bottom+v&&(v=e.bottom-f.bottom+s)):e.bottom>f.bottom&&(v=e.bottom-f.bottom+s,n<0&&e.top-v<f.top&&(v=e.top-(f.top+s)));else{let y=e.bottom-e.top,x=f.bottom-f.top;v=(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?(g=e.left-(f.left+i),n>0&&e.right>f.right+g&&(g=e.right-f.right+i)):e.right>f.right&&(g=e.right-f.right+i,n<0&&e.left<f.left+g&&(g=e.left-(f.left+i))):g=(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,g||v)if(h)c.scrollBy(g,v);else{let y=0,x=0;if(v){let _=u.scrollTop;u.scrollTop+=v/b,x=(u.scrollTop-_)*b}if(g){let _=u.scrollLeft;u.scrollLeft+=g/m,y=(u.scrollLeft-_)*m}e={left:e.left-y,top:e.top-x,right:e.right-y,bottom:e.bottom-x},y&&Math.abs(y-g)<1&&(o="nearest"),x&&Math.abs(x-v)<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 Hue(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 Wue{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?Ns(n):0),o,Math.min(e.focusOffset,o?Ns(o):0))}set(e,n,o,r){this.anchorNode=e,this.anchorOffset=n,this.focusNode=o,this.focusOffset=r}}let al=null;ot.safari&&ot.safari_version>=26&&(al=!1);function HT(t){if(t.setActive)return t.setActive();if(al)return t.focus(al);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(al==null?{get preventScroll(){return al={preventScroll:!0},!0}}:void 0),!al){al=!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 z6;function cf(t,e,n=e){let o=z6||(z6=document.createRange());return o.setEnd(t,n),o.setStart(t,e),o}function Pc(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 Uue(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function Gue(t,e){let n=e.focusNode,o=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=o)return!1;for(o=Math.min(o,Ns(n));;)if(o){if(n.nodeType!=1)return!1;let r=n.childNodes[o-1];r.contentEditable=="false"?o--:(n=r,o=Ns(n))}else{if(n==t)return!0;o=Pa(n),n=n.parentNode}}function WT(t){return t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function UT(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=Ns(n)}else if(n.parentNode&&!lp(n))o=Pa(n),n=n.parentNode;else return null}}function GT(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&&!lp(n))o=Pa(n)+1,n=n.parentNode;else return null}}class ii{constructor(e,n,o=!0){this.node=e,this.offset=n,this.precise=o}static before(e,n){return new ii(e.parentNode,Pa(e),n)}static after(e,n){return new ii(e.parentNode,Pa(e)+1,n)}}var Pn=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(Pn||(Pn={}));const Dl=Pn.LTR,F2=Pn.RTL;function qT(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const que=qT("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),Yue=qT("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),db=Object.create(null),Bi=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);db[e]=n,db[n]=-e}function YT(t){return t<=247?que[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?Yue[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const jue=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class zi{get dir(){return this.level%2?F2:Dl}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 jT(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||!jT(o.inner,r.inner))return!1}return!0}const an=[];function Xue(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=YT(t.charCodeAt(c));f==512?f=u:f==8&&d==4&&(f=16),an[c]=f==4?2:f,f&7&&(d=f),u=f}for(let c=s,u=l,d=l;c<a;c++){let f=an[c];if(f==128)c<a-1&&u==an[c+1]&&u&24?f=an[c]=u:an[c]=256;else if(f==64){let h=c+1;for(;h<a&&an[h]==64;)h++;let m=c&&u==8||h<n&&an[h]==8?d==1?1:8:256;for(let b=c;b<h;b++)an[b]=m;c=h-1}else f==8&&d==1&&(an[c]=1);u=f,f&7&&(d=f)}}}function Kue(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,m;d<u;d++)if(h=db[f=t.charCodeAt(d)])if(h<0){for(let b=a-3;b>=0;b-=3)if(Bi[b+1]==-h){let g=Bi[b+2],v=g&2?r:g&4?g&1?i:r:0;v&&(an[d]=an[Bi[b]]=v),a=b;break}}else{if(Bi.length==189)break;Bi[a++]=d,Bi[a++]=f,Bi[a++]=l}else if((m=an[d])==2||m==1){let b=m==r;l=b?0:1;for(let g=a-3;g>=0;g-=3){let v=Bi[g+2];if(v&2)break;if(b)Bi[g+2]|=2;else{if(v&4)break;Bi[g+2]|=4}}}}}function Zue(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=an[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(an[u]==256)u++;else break;let d=i==1,f=(u<e?an[u]:o)==1,h=d==f?d?1:2:o;for(let m=u,b=r,g=b?n[b-1].to:t;m>l;)m==g&&(m=n[--b].from,g=b?n[b-1].to:t),an[--m]=h;l=u}else i=c,l++}}}function fb(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 b=an[l];b!=a&&(u=!1,d=b==16)}let f=!u&&a==1?[]:null,h=u?o:o+1,m=l;e:for(;;)if(c<i.length&&m==i[c].from){if(d)break e;let b=i[c];if(!u)for(let g=b.to,v=c+1;;){if(g==n)break e;if(v<i.length&&i[v].from==g)g=i[v++].to;else{if(an[g]==a)break e;break}}if(c++,f)f.push(b);else{b.from>l&&s.push(new zi(l,b.from,h));let g=b.direction==Dl!=!(h%2);hb(t,g?o+1:o,r,b.inner,b.from,b.to,s),l=b.to}m=b.to}else{if(m==n||(u?an[m]!=a:an[m]==a))break;m++}f?fb(t,l,m,o+1,r,f,s):l<m&&s.push(new zi(l,m,h)),l=m}else for(let l=n,c=i.length;l>e;){let u=!0,d=!1;if(!c||l>i[c-1].to){let b=an[l-1];b!=a&&(u=!1,d=b==16)}let f=!u&&a==1?[]:null,h=u?o:o+1,m=l;e:for(;;)if(c&&m==i[c-1].to){if(d)break e;let b=i[--c];if(!u)for(let g=b.from,v=c;;){if(g==e)break e;if(v&&i[v-1].to==g)g=i[--v].from;else{if(an[g-1]==a)break e;break}}if(f)f.push(b);else{b.to<l&&s.push(new zi(b.to,l,h));let g=b.direction==Dl!=!(h%2);hb(t,g?o+1:o,r,b.inner,b.from,b.to,s),l=b.from}m=b.from}else{if(m==e||(u?an[m-1]!=a:an[m-1]==a))break;m--}f?fb(t,m,l,o+1,r,f,s):m<l&&s.push(new zi(m,l,h)),l=m}}function hb(t,e,n,o,r,i,s){let a=e%2?2:1;Xue(t,r,i,o,a),Kue(t,r,i,o,a),Zue(r,i,o,a),fb(t,r,i,e,n,o,s)}function Que(t,e,n){if(!t)return[new zi(0,0,e==F2?1:0)];if(e==Dl&&!n.length&&!jue.test(t))return XT(t.length);if(n.length)for(;t.length>an.length;)an[an.length]=256;let o=[],r=e==Dl?0:1;return hb(t,r,r,n,0,t.length,o),o}function XT(t){return[new zi(0,t,0)]}let KT="";function Jue(t,e,n,o,r){var i;let s=o.head-t.from,a=zi.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=To(t.text,s,l.forward(r,n));(u<l.from||u>l.to)&&(u=c),KT=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?Re.cursor(d.side(!r,n)+t.from,d.forward(r,n)?1:-1,d.level):Re.cursor(u+t.from,l.forward(r,n)?-1:1,l.level)}function ede(t,e,n){for(let o=e;o<n;o++){let r=YT(t.charCodeAt(o));if(r==1)return Dl;if(r==2||r==4)return F2}return Dl}const ZT=pt.define(),QT=pt.define(),JT=pt.define(),eM=pt.define(),pb=pt.define(),tM=pt.define(),nM=pt.define(),V2=pt.define(),z2=pt.define(),oM=pt.define({combine:t=>t.some(e=>e)}),tde=pt.define({combine:t=>t.some(e=>e)}),rM=pt.define();class Dc{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 Dc(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 Dc(Re.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const bh=$n.define({map:(t,e)=>t.map(e)}),iM=$n.define();function Hi(t,e,n){let o=t.facet(eM);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 _s=pt.define({combine:t=>t.length?t[0]:!0});let nde=0;const bc=pt.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 El{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(bc.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(bc.of({plugin:this,arg:e}))}static define(e,n){const{eventHandlers:o,eventObservers:r,provide:i,decorations:s}=n||{};return new El(nde++,e,o,r,a=>{let l=[];return s&&l.push(ng.of(c=>{let u=c.plugin(a);return u?s(u):Xn.none})),i&&l.push(i(a)),l})}static fromClass(e,n){return El.define((o,r)=>new e(o,r),n)}}class wv{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(Hi(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){Hi(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){Hi(e.state,o,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const sM=pt.define(),H2=pt.define(),ng=pt.define(),aM=pt.define(),W2=pt.define(),Df=pt.define(),lM=pt.define();function H6(t,e){let n=t.state.facet(lM);if(!n.length)return n;let o=n.map(i=>i instanceof Function?i(t):i),r=[];return nn.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,m;if(h==null&&(h=ede(e.text,c,u)),l>0&&d.length&&(m=d[d.length-1]).to==c&&m.direction==h)m.to=u,d=m.inner;else{let b={from:c,to:u,direction:h,inner:[]};d.push(b),d=b.inner}}}}),r}const cM=pt.define();function uM(t){let e=0,n=0,o=0,r=0;for(let i of t.state.facet(cM)){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 nd=pt.define();class Dr{constructor(e,n,o,r){this.fromA=e,this.toA=n,this.fromB=o,this.toB=r}join(e){return new Dr(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 m=r;m<e.length&&e[m].fromB<=d;m++)s=e[m].toA-e[m].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 Dr(u,f,c,d))}return o}}class up{constructor(e,n,o){this.view=e,this.state=n,this.transactions=o,this.flags=0,this.startState=e.state,this.changes=zn.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 Dr(i,s,a,l))),this.changedRanges=r}static create(e,n,o){return new up(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 ode=[];class En{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 ode}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&&Rue(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=Pa(this.dom),r=this.length?e>0:n>0;return new ii(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 rg)return e;return null}static get(e){return e.cmTile}}class og extends En{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=W6(r);else n.insertBefore(a.dom,r);o=a.dom}for(r=o?o.nextSibling:n.firstChild,i&&r&&(i.written=!0);r;)r=W6(r);this.length=s}}function W6(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class rg extends og{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=En.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 Os)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 Os extends og{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 Os(n||document.createElement(e.tagName),e);return n||(o.flags|=4),o}}class nu extends og{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,o){let r=new nu(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 m=u.children[f],b=h+m.length;b>=d&&(m.isComposite()?l(m,d-h):(!s||s.isHidden&&(n>0||o&&ide(s,m)))&&(b>d||m.flags&32)?(s=m,a=d-h):(h<d||m.flags&16&&!m.isHidden)&&(r=m,i=d-h)),h=b}}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):rde(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 ii(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 ii(l.dom,0);l==o.tile&&(a=!0)}}return new ii(this.dom,0)}}function rde(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=Zh(e);return n[n.length-1]||null}function ide(t,e){let n=t.coordsIn(0,1),o=e.coordsIn(0,1);return n&&o&&o.top<n.bottom}class er extends og{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let o=new er(n||document.createElement(e.tagName),e);return n||(o.flags|=4),o}}class pl extends En{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?ot.chrome||ot.gecko||(e?(r--,s=1):i<o&&(i++,s=-1)):n<0?r--:i<o&&i++;let a=cf(this.dom,r,i).getClientRects();if(!a.length)return null;let l=a[(s?s<0:n>=0)?0:a.length-1];return ot.safari&&!s&&l.width==0&&(l=Array.prototype.find.call(a,c=>c.width)||l),s?cp(l,s<0):l||null}static of(e,n){let o=new pl(n||document.createTextNode(e),e);return n||(o.flags|=2),o}}class Il extends En{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 cp(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 cp(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 Il(i,o,e,r)}}class dp extends En{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 sde{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 ade{constructor(e,n,o,r){this.from=e,this.to=n,this.wrapper=o,this.rank=r}}class lde{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 pl(a.dom,a.text+e);l.parent=s}else s.append(r||pl.of(e,(i=this.cache.find(pl))===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)?_v(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 er&&c.mark.eq(l.mark))c.dom!=l.dom&&c.setDOM(_v(l.dom)),r=c;else{if(this.cache.reused.get(l)){let d=En.get(l.dom);d&&d.setDOM(_v(l.dom))}let u=er.of(l.mark,l.dom);r.append(u),r=u}this.cache.reused.set(l,2)}let i=En.get(e.text);i&&this.cache.reused.set(i,2);let s=new pl(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=dM);let r=nu.start(e,n||((o=this.cache.find(nu))===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 er&&a.mark.eq(s))r=a,n--;else{let l=er.of(s,(o=this.cache.find(er,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||!U6(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(ot.ios&&U6(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(Sv,0,32)||new Il(Sv.toDOM(),0,Sv,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 ade(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 Os&&r.wrapper.eq(o.wrapper))n=r;else{let i=Os.of(o.wrapper,(e=this.cache.find(Os,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(dp,void 0,1);return o&&(o.flags=n),o||new dp(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class cde{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 fp=[Il,nu,pl,er,dp,Os,rg];for(let t=0;t<fp.length;t++)fp[t].bucket=t;class ude{constructor(e){this.view=e,this.buckets=fp.map(()=>[]),this.index=fp.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 Il(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 dde{constructor(e,n,o,r,i){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=i,this.openWidget=!1,this.openMarks=0,this.cache=new ude(e),this.text=new cde(e.state.doc),this.builder=new lde(this.cache,new rg(e,e.contentDOM),nn.iter(o)),this.cache.reused.set(n,2),this.old=new sde(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=pde(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?Il.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 dp)this.cache.add(s);else if(s instanceof er)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 er&&r.unshift(s.mark)),this.openWidget=!1},leave:s=>{s.isLine()?r.length&&(r.length=i=0):s instanceof er&&(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=nn.spans(this.decorations,e,n,{point:(a,l,c,u,d,f)=>{if(c instanceof Pl){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?ou.block:ou.inline),m=fde(c),b=this.cache.findWidget(h,l-a,m)||Il.of(h,this.view,l-a,m);c.block?(c.startSide>0&&r.addLineStartIfNotCovered(o),r.addBlockWidget(b)):(r.ensureLine(o),r.addInlineWidget(b,u,d))}o=null}else o=hde(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=En.get(r);if(r==this.view.contentDOM)break;i instanceof er?n.push(i):i!=null&&i.isLine()?o=i:i instanceof Os||(r.nodeName=="DIV"&&!o&&r!=this.view.contentDOM?o=new nu(r,dM):o||n.push(er.of(new Lf({tagName:r.nodeName.toLowerCase(),attributes:Nue(r)}),r)))}return{line:o,marks:n}}}function U6(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 fde(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 dM={class:"cm-line"};function hde(t,e){let n=e.spec.attributes,o=e.spec.class;return!n&&!o||(t||(t={class:"cm-line"}),n&&R2(n,t),o&&(t.class+=" "+o)),t}function pde(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 er&&e.push(o.mark)}return e}function _v(t){let e=En.get(t);return e&&e.setDOM(t.cloneNode()),t}class ou extends tg{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}}ou.inline=new ou("span");ou.block=new ou("div");const Sv=new class extends tg{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class G6{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 rg(e,e.contentDOM),this.updateInner([new Dr(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:!Sde(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let i=r>-1?gde(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:u,to:d}=this.hasComposition;o=new Dr(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,(ot.ie||ot.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=yde(s,this.decorations,e.changes);l.length&&(o=Dr.extendWithRanges(o,l));let c=wde(a,this.blockWrappers,e.changes);return c.length&&(o=Dr.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 dde(this.view,s,this.blockWrappers,this.decorations,this.dynamicDecorationMap);this.tile=a.run(e,n),mb(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=ot.chrome||ot.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 kv&&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(iM)&&(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(_s)||o.tabIndex>-1)&&Sd(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)),ot.gecko&&l.empty&&!this.hasComposition&&mde(c)){let f=document.createTextNode("");this.view.observer.ignore(()=>c.node.insertBefore(f,c.node.childNodes[c.offset]||null)),c=u=new ii(f,0),a=!0}let d=this.view.observer.selectionRange;(a||!d.focusNode||(!kd(c.node,c.offset,d.anchorNode,d.anchorOffset)||!kd(u.node,u.offset,d.focusNode,d.focusOffset))&&!this.suppressWidgetCursorChange(d,l))&&(this.view.observer.ignore(()=>{ot.android&&ot.chrome&&o.contains(d.focusNode)&&_de(d.focusNode,o)&&(o.blur(),o.focus({preventScroll:!0}));let f=lf(this.view.root);if(f)if(l.empty){if(ot.gecko){let h=vde(c.node,c.offset);if(h&&h!=3){let m=(h==1?UT:GT)(c.node,c.offset);m&&(c=new ii(m.node,m.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 ii(d.anchorNode,d.anchorOffset),this.impreciseHead=u.precise?null:new ii(d.focusNode,d.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&kd(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=lf(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=Ns(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&&!En.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 kv?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=To(i.text,s);if(a==s)return null;let l=cf(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==Pn.LTR,c=0,u=(d,f,h)=>{for(let m=0;m<d.children.length&&!(f>r);m++){let b=d.children[m],g=f+b.length,v=b.dom.getBoundingClientRect(),{height:y}=v;if(h&&!m&&(c+=v.top-h.top),b instanceof Os)g>o&&u(b,f,v);else if(f>=o&&(c>0&&n.push(-c),n.push(y+c),c=0,s)){let x=b.dom.lastChild,_=x?Zh(x):[];if(_.length){let C=_[_.length-1],L=l?C.right-v.left:v.right-C.left;L>a&&(a=L,this.minWidth=i,this.minWidthFrom=f,this.minWidthTo=g)}}h&&m==d.children.length-1&&(c+=h.bottom-v.bottom),f=g+b.breakAfter}};return u(this.tile,0,null),n}textDirectionAt(e){let{tile:n}=this.tile.resolveBlock(e,1);return getComputedStyle(n.dom).direction=="rtl"?Pn.RTL:Pn.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=Zh(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=Zh(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 kv(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(ng).map(i=>(this.dynamicDecorationMap[e++]=typeof i=="function")?i(this.view):i),o=!1,r=this.view.state.facet(W2).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(nn.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(aM).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){Hi(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(zue(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==Pn.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(){mb(this.tile)}}function mb(t,e){let n=e==null?void 0:e.get(t);if(n!=1){n==null&&t.destroy();for(let o of t.children)mb(o,e)}}function mde(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 fM(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let o=UT(n.focusNode,n.focusOffset),r=GT(n.focusNode,n.focusOffset),i=o||r;if(r&&o&&r.node!=o.node){let a=En.get(r.node);if(!a||a.isText()&&a.text!=r.node.nodeValue)i=r;else if(t.docView.lastCompositionAfterCursor){let l=En.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 gde(t,e,n){let o=fM(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 Dr(l.mapPos(i),l.mapPos(s),i,s),text:r}}function vde(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 bde=class{constructor(){this.changes=[]}compareRange(e,n){Lc(e,n,this.changes)}comparePoint(e,n){Lc(e,n,this.changes)}boundChange(e){Lc(e,e,this.changes)}};function yde(t,e,n){let o=new bde;return nn.compare(t,e,n,o),o.changes}class xde{constructor(){this.changes=[]}compareRange(e,n){Lc(e,n,this.changes)}comparePoint(){}boundChange(e){Lc(e,e,this.changes)}}function wde(t,e,n){let o=new xde;return nn.compare(t,e,n,o),o.changes}function _de(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 Sde(t,e){let n=!1;return e&&t.iterChangedRanges((o,r)=>{o<e.to&&r>e.from&&(n=!0)}),n}class kv extends tg{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 kde(t,e,n=1){let o=t.charCategorizer(e),r=t.doc.lineAt(e),i=e-r.from;if(r.length==0)return Re.cursor(e);i==0?n=1:i==r.length&&(n=-1);let s=i,a=i;n<0?s=To(r.text,i,!1):a=To(r.text,i);let l=o(r.text.slice(s,a));for(;s>0;){let c=To(r.text,s,!1);if(o(r.text.slice(c,s))!=l)break;s=c}for(;a<r.length;){let c=To(r.text,a);if(o(r.text.slice(a,c))!=l)break;a=c}return Re.range(s+r.from,a+r.from)}function Cde(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+Bue(s,i,t.state.tabSize)}function Ade(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==Nr.Text&&(r.type!=i.type||(n<0?i.from<e:i.to>e)))&&(r=i)}}return r||o}return o}function $de(t,e,n,o){let r=Ade(t,e.head,e.assoc||-1),i=!o||r.type!=Nr.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==Pn.LTR)?s.right-1:s.left+1,y:(i.top+i.bottom)/2});if(l!=null)return Re.cursor(l,n?-1:1)}return Re.cursor(n?r.to:r.from,n?-1:1)}function q6(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=Jue(r,i,s,a,n),u=KT;if(!c){if(r.number==(n?t.state.doc.lines:1))return a;u=`
|
|
917
|
+
`,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 Tde(t,e,n){let o=t.state.charCategorizer(e),r=o(n);return i=>{let s=o(i);return r==Cs.Space&&(r=s),r==s}}function Mde(t,e,n,o){let r=e.head,i=n?1:-1;if(r==(n?t.state.doc.length:0))return Re.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 m=t.viewState.lineBlockAt(r);s==null&&(s=Math.min(l.right-l.left,t.defaultCharacterWidth*(r-m.from))),a=(i<0?m.top:m.bottom)+u}let d=l.left+s,f=o??t.viewState.heightOracle.textHeight>>1,h=gb(t,{x:d,y:a+f*i},!1,i);return Re.cursor(h.pos,h.assoc,void 0,s)}function Cd(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 hM(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=Cd(t,r.from,0);s!=r.from&&(i=Re.cursor(s,-1))}else{let s=Cd(t,r.from,-1),a=Cd(t,r.to,1);(s!=r.from||a!=r.to)&&(i=Re.range(r.from==r.anchor?s:a,r.from==r.head?s:a))}i&&(n||(n=e.ranges.slice()),n[o]=i)}return n?Re.create(n,e.mainIndex):e}function Cv(t,e,n){let o=Cd(t.state.facet(Df).map(r=>r(t)),n.from,e.head>n.from?-1:1);return o==n.from?n:Re.cursor(o,o<n.from?1:-1)}class Fi{constructor(e,n){this.pos=e,this.assoc=n}}function gb(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 Fi(0,1);if(l>t.viewState.docHeight)return new Fi(t.state.doc.length,-1);if(c=t.elementAtHeight(l),o==null)break;if(c.type==Nr.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==Nr.Text){let d=Cde(t,r,c,s,a);return new Fi(d,d==c.from?1:-1)}}if(c.type!=Nr.Text)return l<(c.top+c.bottom)/2?new Fi(c.from,1):new Fi(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 Ode(t,s,a,t.textDirectionAt(c.from)).scanTile(u,c.from)}class Ode{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[zi.find(r,e-o.from,-1,n)].level==this.baseDir}dirAt(e,n){let{line:o,spans:r}=this.bidiSpansAt(e);return r[zi.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,m=o+r>>1;t:if(i.has(m)){let g=o+Math.floor(Math.random()*h);for(let v=0;v<h;v++){if(!i.has(g)){m=g;break t}g++,g==r&&(g=o)}break e}i.add(m);let b=n(m);if(b)for(let g=0;g<b.length;g++){let v=b[g],y=0;if(v.bottom<this.y)(!a||a.bottom<v.bottom)&&(a=v),y=1;else if(v.top>this.y)(!l||l.top>v.top)&&(l=v),y=-1;else{let x=v.left>this.x?this.x-v.left:v.right<this.x?this.x-v.right:0,_=Math.abs(x);_<u&&(c=m,u=_,d=v),x&&(y=x<0==(this.baseDir==Pn.LTR)?-1:1)}y==-1&&(!s||this.baseDirAt(e[m],1))?r=m:y==1&&(!s||this.baseDirAt(e[m+1],-1))&&(o=m+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)==Pn.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=To(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 cf(e.dom,s,a).getClientRects()});return r.after?new Fi(o[r.i+1],-1):new Fi(o[r.i],1)}scanTile(e,n){if(!e.length)return new Fi(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:cf(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 Fi(o[r.i+1],-1):new Fi(s,1)}}const od="";class Bde{constructor(e,n){this.points=e,this.view=n,this.text="",this.lineSeparator=n.state.facet(Kt.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=od}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=En.get(r),a=r.nextSibling;if(a==n){s!=null&&s.breakAfter&&!a&&o!=this.view.contentDOM&&this.lineBreak();break}let l=En.get(a);(s&&l?s.breakAfter:(s?s.breakAfter:lp(r))||lp(a)&&(r.nodeName!="BR"||s!=null&&s.isWidget())&&this.text.length>i)&&!Pde(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=En.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+(Lde(e,o.node,o.offset)?n:0))}}function Lde(t,e,n){for(;;){if(!e||n<Ns(e))return!1;if(e==t)return!0;n=Pa(e)+1,e=e.parentNode}}function Pde(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let o=En.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 Y6{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class Dde{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=pM(e.docView.tile,n,o,0))){let a=i||s?[]:Ide(e),l=new Bde(a,e);l.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=l.text,this.newSel=Rde(a,this.bounds.from)}else{let a=e.observer.selectionRange,l=i&&i.node==a.focusNode&&i.offset==a.focusOffset||!ub(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||!ub(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),u=e.viewport;if((ot.ios||ot.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,m=u.to-f;(h==0||h==1||d==0)&&(m==0||m==-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(Re.range(c,l)):this.newSel=Re.single(c,l)}}}function pM(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 pM(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 mM(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||ot.android&&e.text.length<a-s)&&(l=r.to,c="end");let u=gM(t.state.doc.sliceString(s,a,od),e.text,l-s,c);u&&(ot.chrome&&i==13&&u.toB==u.from+2&&e.text.slice(u.from,u.toB)==od+od&&u.toB--,n={from:s+u.from,to:s+u.toA,insert:Ut.of(e.text.slice(u.from,u.toB).split(od))})}else o&&(!t.hasFocus&&t.state.facet(_s)||hp(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)}:(ot.mac||ot.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=Re.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)}:ot.chrome&&n&&n.from==n.to&&n.from==r.head&&n.insert.toString()==`
|
|
918
|
+
`&&t.lineWrapping&&(o&&(o=Re.single(o.main.anchor-1,o.main.head-1)),n={from:r.from,to:r.to,insert:Ut.of([" "])}),n)return U2(t,n,o,i);if(o&&!hp(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=hM(t.state.facet(Df).map(l=>l(t)),o))),t.dispatch({selection:o,scrollIntoView:s,userEvent:a}),!0}else return!1}function U2(t,e,n,o=-1){if(ot.ios&&t.inputState.flushIOSKey(e))return!0;let r=t.state.selection.main;if(ot.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&&Pc(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)&&Pc(t.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&Pc(t.contentDOM,"Delete",46)))return!0;let i=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let s,a=()=>s||(s=Ede(t,e,n));return t.state.facet(tM).some(l=>l(t,e.from,e.to,i,a))||t.dispatch(a()),!0}function Ede(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=Cd(r.facet(Df).map(d=>d(t)),c,l);e.from==u&&(s=u)}if(s>-1)o={changes:e,selection:Re.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&&fM(t,n.main.head);if(f){let m=e.insert.length-(e.to-e.from);d={from:f.from,to:f.to-m}}else d=t.state.doc.lineAt(i.head);let h=i.to-e.to;o=r.changeByRange(m=>{if(m.from==i.from&&m.to==i.to)return{changes:l,range:c||m.map(l)};let b=m.to-h,g=b-u.length;if(t.state.sliceDoc(g,b)!=u||b>=d.from&&g<=d.to)return{range:m};let v=r.changes({from:g,to:b,insert:e.insert}),y=m.to-i.to;return{changes:v,range:c?Re.range(Math.max(0,c.anchor+y),Math.max(0,c.head+y)):m.map(v)}})}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 gM(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 Ide(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 Y6(n,o)),(r!=n||i!=o)&&e.push(new Y6(r,i))),e}function Rde(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?Re.single(n+e,o+e):null}function hp(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class Nde{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,ot.safari&&e.contentDOM.addEventListener("input",()=>null),ot.gecko&&Jde(e.contentDOM.ownerDocument)}handleEvent(e){!qde(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=Fde(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&&bM.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),ot.android&&ot.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return ot.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((n=vM.find(o=>o.keyCode==e.keyCode))&&!e.ctrlKey||Vde.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,Pc(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:ot.safari&&!ot.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 j6(t,e){return(n,o)=>{try{return e.call(t,o,n)}catch(r){Hi(n.state,r)}}}function Fde(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(j6(o.value,l))}if(s)for(let a in s){let l=s[a];l&&n(a).observers.push(j6(o.value,l))}}for(let o in _i)n(o).handlers.push(_i[o]);for(let o in Wr)n(o).observers.push(Wr[o]);return e}const vM=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Vde="dthko",bM=[16,17,18,20,91,92,224,225],yh=6;function xh(t){return Math.max(0,t)*.7+8}function zde(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class Hde{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=Hue(e.contentDOM),this.atoms=e.state.facet(Df).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(Kt.allowMultipleSelections)&&Wde(e,n),this.dragging=Gde(e,n)&&wM(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&&zde(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+yh?n=-xh(r-e.clientX):e.clientX+l.right>=s-yh&&(n=xh(e.clientX-s)),e.clientY-l.top<=i+yh?o=-xh(i-e.clientY):e.clientY+l.bottom>=a-yh&&(o=xh(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=hM(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 Wde(t,e){let n=t.state.facet(ZT);return n.length?n[0](e):ot.mac?e.metaKey:e.ctrlKey}function Ude(t,e){let n=t.state.facet(QT);return n.length?n[0](e):ot.mac?!e.altKey:!e.ctrlKey}function Gde(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let o=lf(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 qde(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=En.get(n))&&o.isWidget()&&!o.isHidden&&o.widget.ignoreEvent(e))return!1;return!0}const _i=Object.create(null),Wr=Object.create(null),yM=ot.ie&&ot.ie_version<15||ot.ios&&ot.webkit_version<604;function Yde(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(),xM(t,n.value)},50)}function ig(t,e,n){for(let o of t.facet(e))n=o(n,t);return n}function xM(t,e){e=ig(t.state,V2,e);let{state:n}=t,o,r=1,i=n.toText(e),s=i.lines==n.selection.ranges.length;if(vb!=null&&n.selection.ranges.every(l=>l.empty)&&vb==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:Re.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:Re.cursor(l.from+c.length)}}):o=n.replaceSelection(i);t.dispatch(o,{userEvent:"input.paste",scrollIntoView:!0})}Wr.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};_i.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);Wr.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};Wr.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};_i.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(JT))if(n=o(t,e),n)break;if(!n&&e.button==0&&(n=Xde(t,e)),n){let o=!t.hasFocus;t.inputState.startMouseSelection(new Hde(t,e,n,o)),o&&t.observer.ignore(()=>{HT(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 X6(t,e,n,o){if(o==1)return Re.cursor(e,n);if(o==2)return kde(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++,Re.range(s,a)}}const jde=ot.ie&&ot.ie_version<=11;let K6=null,Z6=0,Q6=0;function wM(t){if(!jde)return t.detail;let e=K6,n=Q6;return K6=t,Q6=Date.now(),Z6=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(Z6+1)%3:1}function Xde(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),o=wM(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=X6(t,l.pos,l.assoc,o);if(n.pos!=l.pos&&!s){let d=X6(t,n.pos,n.assoc,o),f=Math.min(d.from,u.from),h=Math.max(d.to,u.to);u=f<u.from?Re.range(f,h):Re.range(h,f)}return s?r.replaceRange(r.main.extend(u.from,u.to)):a&&o==1&&r.ranges.length>1&&(c=Kde(r,l.pos))?c:a?r.addRange(u):Re.create([u])}}}function Kde(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 Re.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}_i.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=Re.range(i,s))}}let{inputState:o}=t;return o.mouseSelection&&(o.mouseSelection.dragging=!0),o.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",ig(t.state,z2,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};_i.dragend=t=>(t.inputState.draggedContent=null,!1);function J6(t,e,n,o){if(n=ig(t.state,V2,n),!n)return;let r=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:i}=t.inputState,s=o&&i&&Ude(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}_i.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&&J6(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 J6(t,e,o,!0),!0}return!1};_i.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=yM?null:e.clipboardData;return n?(xM(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(Yde(t),!1)};function Zde(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 Qde(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:ig(t,z2,e.join(t.lineBreak)),ranges:n,linewise:o}}let vb=null;_i.copy=_i.cut=(t,e)=>{if(!Sd(t.contentDOM,t.observer.selectionRange))return!1;let{text:n,ranges:o,linewise:r}=Qde(t.state);if(!n&&!r)return!1;vb=r?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:o,scrollIntoView:!0,userEvent:"delete.cut"});let i=yM?null:e.clipboardData;return i?(i.clearData(),i.setData("text/plain",n),!0):(Zde(t,n),!1)};const _M=qa.define();function SM(t,e){let n=[];for(let o of t.facet(nM)){let r=o(t,e);r&&n.push(r)}return n.length?t.update({effects:n,annotations:_M.of(!0)}):null}function kM(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=SM(t.state,e);n?t.dispatch(n):t.update([])}},10)}Wr.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),kM(t)};Wr.blur=t=>{t.observer.clearSelectionRange(),kM(t)};Wr.compositionstart=Wr.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};Wr.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,ot.chrome&&ot.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};Wr.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};_i.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 U2(t,{from:l,to:c,insert:t.state.toText(i)},null),!0}}let r;if(ot.chrome&&ot.android&&(r=vM.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 ot.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),ot.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>Wr.compositionend(t,e),20),!1};const eS=new Set;function Jde(t){eS.has(t)||(eS.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const tS=["pre-wrap","normal","pre-line","break-spaces"];let ru=!1;function nS(){ru=!1}class efe{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 tS.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=tS.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 tfe{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class ni{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"?Nr.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 Pl?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 ni(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var dn=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(dn||(dn={}));const Qh=.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)>Qh&&(ru=!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,dn.ByPosNoHeight,o.setDoc(n),0,0),h=f.to>=c?f:i.lineAt(c,dn.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,dn.ByPosNoHeight,o,0,0));u+=f.from-l,l=f.from;let m=G2.build(o.setDoc(s),e,u,d);i=pp(i,i.replace(l,c,m))}return i.updateHeight(o,0)}static empty(){return new pr(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 ofe(Uo.of(e.slice(0,n)),s,Uo.of(e.slice(o)))}}function pp(t,e){return t==e?t:(t.constructor!=e.constructor&&(ru=!0),e)}Uo.prototype.size=1;const nfe=Xn.replace({});class CM extends Uo{constructor(e,n,o){super(e,n),this.deco=o,this.spaceAbove=0}mainBlock(e,n){return new ni(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 ni(r,0,o,this.spaceAbove,nfe):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,dn.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 pr extends CM{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 ni(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 pr||r instanceof eo&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof eo?r=new pr(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 eo 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 ni(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 ni(u,d,o+a*c,a,0)}}lineAt(e,n,o,r,i){if(n==dn.ByHeight)return this.blockAt(e,o,r,i);if(n==dn.ByPosNoHeight){let{from:h,to:m}=o.doc.lineAt(e);return new ni(h,m-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 ni(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 m=f.number-a;d+=l*m+c*(e-i-m)}let h=l+c*f.length;s(new ni(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 eo?o[o.length-1]=new eo(i.length+r):o.push(null,new eo(r-1))}if(e>0){let i=o[0];i instanceof eo?o[0]=new eo(e+i.length):o.unshift(new eo(e-1),null)}return Uo.of(o)}decomposeLeft(e,n){n.push(new eo(e-1),null)}decomposeRight(e,n){n.push(null,new eo(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 eo(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)>=Qh&&(l=-2);let h=new pr(u,d,f);h.outdated=!1,s.push(h),a+=u+1}a<=i&&s.push(null,new eo(i-a).updateHeight(e,a));let c=Uo.of(s);return(l<0||Math.abs(c.height-this.height)>=Qh||Math.abs(l-this.heightMetrics(e,n).perLine)>=Qh)&&(ru=!0),pp(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 ofe 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==dn.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==dn.ByPosNoHeight?dn.ByPosNoHeight:dn.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,dn.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&&oS(i,s-1),n<this.length){let a=i.length;this.decomposeRight(n,i),oS(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=pp(this.left,e),this.right=pp(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 oS(t,e){let n,o;t[e]==null&&(n=t[e-1])instanceof eo&&(o=t[e+1])instanceof eo&&t.splice(e-1,3,new eo(n.length+1+o.length))}const rfe=5;class G2{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 pr?r.length+=o-this.pos:(o>this.pos||!this.isCovered)&&this.nodes.push(new pr(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 CM(s,r,o)):(s||i||r>=rfe)&&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 pr(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let o=new eo(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 pr)return e;let n=new pr(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 pr)&&!this.isCovered?this.nodes.push(new pr(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 pr&&r.updateHeight(this.oracle,o),o+=r?r.length:1;return this.nodes}static build(e,n,o,r){let i=new G2(o,e);return nn.spans(n,o,r,i,0),i.finish(o)}}function ife(t,e,n){let o=new sfe;return nn.compare(t,e,n,o,0),o.changes}class sfe{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,o,r){(e<n||o&&o.heightRelevant||r&&r.heightRelevant)&&Lc(e,n,this.changes,5)}}function afe(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 lfe(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 cfe(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class Av{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 ufe(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class ufe extends tg{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 rS{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=iS,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Pn.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=e.facet(H2).some(o=>typeof o!="function"&&o.class=="cm-lineWrapping");this.heightOracle=new efe(n),this.stateDeco=sS(e),this.heightMap=Uo.empty().applyChanges(this.stateDeco,Ut.empty,this.heightOracle.setDoc(e.doc),[new Dr(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 wh(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?iS:new q2(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(rd(e,this.scaler))})}update(e,n=null){this.state=e.state;let o=this.stateDeco;this.stateDeco=sS(this.state);let r=e.changedRanges,i=Dr.extendWithRanges(r,ife(o,this.stateDeco,e?e.changes:zn.empty(this.state.doc.length))),s=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);nS(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),i),(this.heightMap.height!=s||ru)&&(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(tde)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,o=window.getComputedStyle(n),r=this.heightOracle,i=o.whiteSpace;this.defaultTextDirection=o.direction=="rtl"?Pn.RTL:Pn.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:C}=zT(n,a);(_>.005&&Math.abs(this.scaleX-_)>.005||C>.005&&Math.abs(this.scaleY-C)>.005)&&(this.scaleX=_,this.scaleY=C,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=WT(e.scrollDOM);let m=(this.printing?cfe:afe)(n,this.paddingTop),b=m.top-this.pixelViewport.top,g=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let v=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(v!=this.inView&&(this.inView=v,v&&(l=!0)),!this.inView&&!this.scrollTarget&&!lfe(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:C,charWidth:L,textHeight:O}=e.docView.measureTextSize();s=C>0&&r.refresh(i,C,L,O,Math.max(5,y/L),_),s&&(e.docView.minWidth=0,c|=16)}b>0&&g>0?u=Math.max(b,g):b<0&&g<0&&(u=Math.min(b,g)),nS();for(let C of this.viewports){let L=C.from==this.viewport.from?_:e.docView.measureVisibleLineHeights(C);this.heightMap=(s?Uo.empty().applyChanges(this.stateDeco,Ut.empty,this.heightOracle,[new Dr(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,s,new tfe(C.from,L))}ru&&(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 wh(r.lineAt(s-o*1e3,dn.ByHeight,i,0,0).from,r.lineAt(a+(1-o)*1e3,dn.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,dn.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 wh(r.lineAt(f-1e3/2,dn.ByHeight,i,0,0).from,r.lineAt(f+u+1e3/2,dn.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 wh(this.heightMap.lineAt(o,dn.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,dn.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,dn.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(n,dn.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 Av(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!=Pn.LTR&&!o)return[];let a=[],l=(u,d,f,h)=>{if(d-u<i)return;let m=this.state.selection.main,b=[m.from];m.empty||b.push(m.to);for(let v of b)if(v>u&&v<d){l(u,v-10,f,h),l(v+10,d,f,h);return}let g=ffe(e,v=>v.from>=f.from&&v.to<=f.to&&Math.abs(v.from-u)<i&&Math.abs(v.to-d)<i&&!b.some(y=>v.from<y&&v.to>y));if(!g){if(d<f.to&&n&&o&&n.visibleRanges.some(x=>x.from<=d&&x.to>=d)){let x=n.moveToLineBoundary(Re.cursor(d),!1,!0).head;x>u&&(d=x)}let v=this.gapSize(f,u,d,h),y=o||v<2e6?v:2e6;g=new Av(u,d,v,y)}a.push(g)},c=u=>{if(u.length<s||u.type!=Nr.Text)return;let d=dfe(u.from,u.to,this.stateDeco);if(d.total<s)return;let f=this.scrollTarget?this.scrollTarget.range.head:null,h,m;if(o){let b=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,g,v;if(f!=null){let y=Sh(d,f),x=((this.visibleBottom-this.visibleTop)/2+b)/u.height;g=y-x,v=y+x}else g=(this.visibleTop-u.top-b)/u.height,v=(this.visibleBottom-u.top+b)/u.height;h=_h(d,g),m=_h(d,v)}else{let b=d.total*this.heightOracle.charWidth,g=r*this.heightOracle.charWidth,v=0;if(b>2e6)for(let L of e)L.from>=u.from&&L.from<u.to&&L.size!=L.displaySize&&L.from*this.heightOracle.charWidth+v<this.pixelViewport.left&&(v=L.size-L.displaySize);let y=this.pixelViewport.left+v,x=this.pixelViewport.right+v,_,C;if(f!=null){let L=Sh(d,f),O=((x-y)/2+g)/b;_=L-O,C=L+O}else _=(y-g)/b,C=(x+g)/b;h=_h(d,_),m=_h(d,C)}h>u.from&&l(u.from,h,u,d),m<u.to&&l(m,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=Sh(r,o)-Sh(r,n);return this.heightOracle.lineWrapping?e.height*i:r.total*this.heightOracle.charWidth*i}updateLineGaps(e){Av.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=[];nn.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)||rd(this.heightMap.lineAt(e,dn.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)||rd(this.heightMap.lineAt(this.scaler.fromDOM(e),dn.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 rd(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 wh{constructor(e,n){this.from=e,this.to=n}}function dfe(t,e,n){let o=[],r=t,i=0;return nn.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 _h({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 Sh(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 ffe(t,e){for(let n of t)if(e(n))return n}const iS={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function sS(t){let e=t.facet(ng).filter(o=>typeof o!="function"),n=t.facet(W2).filter(o=>typeof o!="function");return n.length&&e.push(nn.join(n)),e}class q2{constructor(e,n,o){let r=0,i=0,s=0;this.viewports=o.map(({from:a,to:l})=>{let c=n.lineAt(a,dn.ByPos,e,0,0).top,u=n.lineAt(l,dn.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 q2?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 rd(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),o=e.toDOM(t.bottom);return new ni(t.from,t.length,n,o-n,Array.isArray(t._content)?t._content.map(r=>rd(r,e)):t._content)}const kh=pt.define({combine:t=>t.join(" ")}),bb=pt.define({combine:t=>t.indexOf(!0)>-1}),yb=Ba.newName(),AM=Ba.newName(),$M=Ba.newName(),TM={"&light":"."+AM,"&dark":"."+$M};function xb(t,e,n){return new Ba(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 hfe=xb("."+yb,{"&":{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"}},TM),pfe={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},$v=ot.ie&&ot.ie_version<=11;class mfe{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Wue,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);(ot.ie&&ot.ie_version<=11||ot.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&&ot.android&&e.constructor.EDIT_CONTEXT!==!1&&!(ot.chrome&&ot.chrome_version<126)&&(this.editContext=new vfe(e),e.state.facet(_s)&&(e.contentDOM.editContext=this.editContext.editContext)),$v&&(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(_s)?o.root.activeElement!=this.dom:!Sd(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}(ot.ie&&ot.ie_version<=11||ot.android&&ot.chrome)&&!o.state.selection.main.empty&&r.focusNode&&kd(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=lf(e.root);if(!n)return!1;let o=ot.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&gfe(this.view,n)||n;if(!o||this.selectionRange.eq(o))return!1;let r=Sd(this.dom,o);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&Gue(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,pfe),$v&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),$v&&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&&Pc(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&&Sd(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 Dde(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=mM(this.view,n);return this.view.state==o&&(n.domChanged||n.newSel&&!hp(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=aS(n,e.previousSibling||e.target.previousSibling,-1),r=aS(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(_s)!=e.state.facet(_s)&&(e.view.contentDOM.editContext=e.state.facet(_s)?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 aS(t,e,n){for(;e;){let o=En.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 lS(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 kd(s.node,s.offset,r,i)&&([n,o,r,i]=[r,i,n,o]),{anchorNode:n,anchorOffset:o,focusNode:r,focusOffset:i}}function gfe(t,e){if(e.getComposedRanges){let r=e.getComposedRanges(t.root)[0];if(r)return lS(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?lS(t,n):null}class vfe{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=gM(e.state.sliceDoc(a,l),o.text,(c?r.from:r.to)-a,c?"end":null);if(!u){let f=Re.single(this.toEditorPos(o.selectionStart),this.toEditorPos(o.selectionEnd));hp(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(`
|
|
919
|
+
`))};if((ot.mac||ot.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);U2(e,d,Re.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:iM.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=lf(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 _t{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||Uue(e.parent)||document,this.viewState=new rS(e.state||Kt.create(e)),e.scrollTo&&e.scrollTo.is(bh)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(bc).map(r=>new wv(r));for(let r of this.plugins)r.update(this);this.observer=new mfe(this),this.inputState=new Nde(this),this.inputState.ensureHandlers(this.plugins),this.docView=new G6(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 Wn?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(_M))?(this.inputState.notifiedFocused=s,a=1):s!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=s,l=SM(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(Kt.phrases)!=this.state.facet(Kt.phrases))return this.setState(i);r=up.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 Dc(h.empty?h:Re.cursor(h.head,h.head>h.anchor?-1:1))}for(let h of f.effects)h.is(bh)&&(d=h.value.clip(this.state))}this.viewState.update(r,d),this.bidiCache=mp.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),n=this.docView.update(r),this.state.facet(nd)!=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(kh)!=r.state.facet(kh)&&(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(pb))try{f(r)}catch(h){Hi(this.state,h,"update listener")}(l||u)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),u&&!mM(this,u)&&c.force&&Pc(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 rS(e),this.plugins=e.facet(bc).map(o=>new wv(o)),this.pluginMap.clear();for(let o of this.plugins)o.update(this);this.docView.destroy(),this.docView=new G6(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(bc),o=e.state.facet(bc);if(n!=o){let r=[];for(let i of o){let s=n.indexOf(i);if(s<0)r.push(new wv(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){Hi(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(WT(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(m){return Hi(this.state,m),cS}}),d=up.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]!=cS)try{let m=c[h];m.write&&m.write(u[h],this)}catch(m){Hi(this.state,m)}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 m=(i<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(i).top)-s;if(m>1||m<-1){r=r+m,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(pb))a(n)}get themeClasses(){return yb+" "+(this.state.facet(bb)?$M:AM)+" "+this.state.facet(kh)}updateAttrs(){let e=uS(this,sM,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(_s)?"true":"false",class:"cm-content",style:`${ot.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),uS(this,H2,n);let o=this.observer.ignore(()=>{let r=F6(this.contentDOM,this.contentAttrs,n),i=F6(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(_t.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(nd);let e=this.state.facet(_t.cspNonce);Ba.mount(this.root,this.styleModules.concat(hfe).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 Cv(this,e,q6(this,e,n,o))}moveByGroup(e,n){return Cv(this,e,q6(this,e,n,o=>Tde(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 Re.cursor(i.side(n,r)+e.from,i.forward(!n,r)?1:-1)}moveToLineBoundary(e,n,o=!0){return $de(this,e,n,o)}moveVertically(e,n,o){return Cv(this,e,Mde(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=gb(this,e,n);return o&&o.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),gb(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[zi.find(i,e-r.from,-1,n)];return cp(o,s.dir==Pn.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(oM)||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>bfe)return XT(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||jT(i.isolates,o=H6(this,e))))return i.order;o||(o=H6(this,e));let r=Que(e.text,n,o);return this.bidiCache.push(new mp(e.from,e.to,n,o,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||ot.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{HT(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 bh.of(new Dc(typeof e=="number"?Re.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 bh.of(new Dc(Re.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 El.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return El.define(()=>({}),{eventObservers:e})}static theme(e,n){let o=Ba.newName(),r=[kh.of(o),nd.of(xb(`.${o}`,e))];return n&&n.dark&&r.push(bb.of(!0)),r}static baseTheme(e){return D2.lowest(nd.of(xb("."+yb,e,TM)))}static findFromDOM(e){var n;let o=e.querySelector(".cm-content"),r=o&&En.get(o)||En.get(e);return((n=r==null?void 0:r.root)===null||n===void 0?void 0:n.view)||null}}_t.styleModule=nd;_t.inputHandler=tM;_t.clipboardInputFilter=V2;_t.clipboardOutputFilter=z2;_t.scrollHandler=rM;_t.focusChangeEffect=nM;_t.perLineTextDirection=oM;_t.exceptionSink=eM;_t.updateListener=pb;_t.editable=_s;_t.mouseSelectionStyle=JT;_t.dragMovesSelection=QT;_t.clickAddsSelectionRange=ZT;_t.decorations=ng;_t.blockWrappers=aM;_t.outerDecorations=W2;_t.atomicRanges=Df;_t.bidiIsolatedRanges=lM;_t.scrollMargins=cM;_t.darkTheme=bb;_t.cspNonce=pt.define({combine:t=>t.length?t[0]:""});_t.contentAttributes=H2;_t.editorAttributes=sM;_t.lineWrapping=_t.contentAttributes.of({class:"cm-lineWrapping"});_t.announce=$n.define();const bfe=4096,cS={};class mp{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:Pn.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 mp(n.mapPos(s.from,1),n.mapPos(s.to,-1),s.dir,s.isolates,!1,s.order))}return o}}function uS(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&&R2(s,n)}return n}const yfe=ot.mac?"mac":ot.windows?"win":ot.linux?"linux":"key";function xfe(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 Ch(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 wfe=D2.default(_t.domEventHandlers({keydown(t,e){return Cfe(_fe(e.state),t,e,"editor")}})),MM=pt.define({enables:wfe}),dS=new WeakMap;function _fe(t){let e=t.facet(MM),n=dS.get(e);return n||dS.set(e,n=kfe(e.reduce((o,r)=>o.concat(r),[]))),n}let ua=null;const Sfe=4e3;function kfe(t,e=yfe){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)),m=a.split(/ (?!$)/).map(v=>xfe(v,e));for(let v=1;v<m.length;v++){let y=m.slice(0,v).join(" ");r(y,!0),h[y]||(h[y]={preventDefault:!0,stopPropagation:!1,run:[x=>{let _=ua={view:x,prefix:y,scope:s};return setTimeout(()=>{ua==_&&(ua=null)},Sfe),!0}]})}let b=m.join(" ");r(b,!1);let g=h[b]||(h[b]={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&&g.run.push(l),c&&(g.preventDefault=!0),u&&(g.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,wb))}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 wb=null;function Cfe(t,e,n,o){wb=e;let r=Eue(e),i=gue(r,0),s=vue(i)==r.length&&r!=" ",a="",l=!1,c=!1,u=!1;ua&&ua.view==n&&ua.scope==o&&(a=ua.prefix+" ",bM.indexOf(e.keyCode)<0&&(c=!0,ua=null));let d=new Set,f=g=>{if(g){for(let v of g.run)if(!d.has(v)&&(d.add(v),v(n)))return g.stopPropagation&&(u=!0),!0;g.preventDefault&&(g.stopPropagation&&(u=!0),c=!0)}return!1},h=t[o],m,b;return h&&(f(h[a+Ch(r,e,!s)])?l=!0:s&&(e.altKey||e.metaKey||e.ctrlKey)&&!(ot.windows&&e.ctrlKey&&e.altKey)&&!(ot.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(m=La[e.keyCode])&&m!=r?(f(h[a+Ch(m,e,!0)])||e.shiftKey&&(b=sf[e.keyCode])!=r&&b!=m&&f(h[a+Ch(b,e,!1)]))&&(l=!0):s&&e.shiftKey&&f(h[a+Ch(r,e,!0)])&&(l=!0),!l&&f(h._any)&&(l=!0)),c&&(l=!0),l&&u&&e.stopPropagation(),wb=null,l}class iu extends Ll{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}iu.prototype.elementClass="";iu.prototype.toDOM=void 0;iu.prototype.mapMode=gr.TrackBefore;iu.prototype.startSide=iu.prototype.endSide=-1;iu.prototype.point=!0;const OM=1024;let Afe=0;class Tv{constructor(e,n){this.from=e,this.to=n}}class Dt{constructor(e={}){this.id=Afe++,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=ur.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 Ad{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 $fe=Object.create(null);class ur{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):$fe,o=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new ur(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}}}}ur.none=new ur("",Object.create(null),0,8);class Y2{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 ur(o.name,r,o.id,o.flags):o)}return new Y2(n)}}const Ah=new WeakMap,fS=new WeakMap;var wn;(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"})(wn||(wn={}));class Tn{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=Ad.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 Sb(this.topNode,e)}cursorAt(e,n=0,o=0){let r=Ah.get(this)||this.topNode,i=new Sb(r);return i.moveTo(e,n),Ah.set(this,i._tree),i}get topNode(){return new Fr(this,0,0,null)}resolve(e,n=0){let o=uf(Ah.get(this)||this.topNode,e,n,!1);return Ah.set(this,o),o}resolveInner(e,n=0){let o=uf(fS.get(this)||this.topNode,e,n,!0);return fS.set(this,o),o}resolveStack(e,n=0){return Ofe(this,e,n)}iterate(e){let{enter:n,leave:o,from:r=0,to:i=this.length}=e,s=e.mode||0,a=(s&wn.IncludeAnonymous)>0;for(let l=this.cursor(s|wn.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:K2(ur.none,this.children,this.positions,0,this.children.length,0,this.length,(n,o,r)=>new Tn(this.type,n,o,r,this.propValues),e.makeTree||((n,o,r)=>new Tn(ur.none,n,o,r)))}static build(e){return Bfe(e)}}Tn.empty=new Tn(ur.none,[],[],0);class j2{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 j2(this.buffer,this.index)}}class Da{constructor(e,n,o){this.buffer=e,this.length=n,this.set=o}get type(){return ur.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&&!(BM(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 Da(i,s,this.set)}}function BM(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 uf(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 Fr&&t.index<0?null:t.parent;if(!s)return t;t=s}let i=o?0:wn.IgnoreOverlays;if(o)for(let s=t,a=s.parent;a;s=a,a=s.parent)s instanceof Fr&&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 LM{cursor(e=0){return new Sb(this,e)}getChild(e,n=null,o=null){let r=hS(this,e,n,o);return r.length?r[0]:null}getChildren(e,n=null,o=null){return hS(this,e,n,o)}resolve(e,n=0){return uf(this,e,n,!1)}resolveInner(e,n=0){return uf(this,e,n,!0)}matchContext(e){return _b(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 Fr extends LM{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&wn.EnterBracketed&&u instanceof Tn&&(f=Ad.get(u))&&!f.overlay&&f.bracketed&&o>=d&&o<=d+u.length)&&!BM(r,o,d,d+u.length))){if(u instanceof Da){if(i&wn.ExcludeBuffers)continue;let h=u.findChild(0,u.buffer.length,n,o-d,r);if(h>-1)return new ma(new Tfe(s,u,e,d),null,h)}else if(i&wn.IncludeAnonymous||!u.type.isAnonymous||X2(u)){let h;if(!(i&wn.IgnoreMounts)&&(h=Ad.get(u))&&!h.overlay)return new Fr(h.tree,d,e,s);let m=new Fr(u,d,e,s);return i&wn.IncludeAnonymous||!m.type.isAnonymous?m:m.nextChild(n<0?u.children.length-1:0,n,o,r,i)}}}if(i&wn.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&wn.IgnoreOverlays)&&(r=Ad.get(this._tree))&&r.overlay){let i=e-this.from,s=o&wn.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 Fr(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 hS(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 _b(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 Tfe{constructor(e,n,o,r){this.parent=e,this.buffer=n,this.index=o,this.start=r}}class ma extends LM{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 ma(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&wn.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 ma(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 ma(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 ma(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 Tn(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function PM(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 Fr&&n.index<0?null:n.parent,r=t.slice();return o?r[e]=o:r.splice(e,1),new Mfe(r,n)}class Mfe{constructor(e,n){this.heads=e,this.node=n}get next(){return PM(this.heads)}}function Ofe(t,e,n){let o=t.resolveInner(e,n),r=null;for(let i=o instanceof Fr?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=Ad.get(i.tree);if(s&&s.overlay&&s.overlay[0].from<=e&&s.overlay[s.overlay.length-1].to>=e){let a=new Fr(s.tree,s.overlay[0].from+i.from,-1,i);(r||(r=[o])).push(uf(a,e,n,!1))}}return r?PM(r):o}class Sb{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&~wn.EnterBracketed,e instanceof Fr)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 Fr?(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&wn.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,o))}parent(){if(!this.buffer)return this.yieldNode(this.mode&wn.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&wn.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&wn.IncludeAnonymous||a instanceof Da||!a.type.isAnonymous||X2(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 ma(this.buffer,n,this.stack[r]);return this.bufferNode=new ma(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 _b(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 _b(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 X2(t){return t.children.some(e=>e instanceof Da||!e.type.isAnonymous||X2(e))}function Bfe(t){var e;let{buffer:n,nodeSet:o,maxBufferLength:r=OM,reused:i=[],minRepeatType:s=o.types.length}=t,a=Array.isArray(n)?new j2(n,n.length):n,l=o.types,c=0,u=0;function d(C,L,O,$,M,D){let{id:N,start:k,end:A,size:B}=a,P=u,F=c;if(B<0)if(a.next(),B==-1){let ce=i[N];O.push(ce),$.push(k-C);return}else if(B==-3){c=N;return}else if(B==-4){u=N;return}else throw new RangeError(`Unrecognized record size: ${B}`);let z=l[N],V,G,ie=k-C;if(A-k<=r&&(G=g(a.pos-L,M))){let ce=new Uint16Array(G.size-G.skip),he=a.pos-G.size,Z=ce.length;for(;a.pos>he;)Z=v(G.start,ce,Z);V=new Da(ce,A-G.start,o),ie=G.start-C}else{let ce=a.pos-B;a.next();let he=[],Z=[],oe=N>=s?N:-1,se=0,re=A;for(;a.pos>ce;)oe>=0&&a.id==oe&&a.size>=0?(a.end<=re-r&&(m(he,Z,k,se,a.end,re,oe,P,F),se=he.length,re=a.end),a.next()):D>2500?f(k,ce,he,Z):d(k,ce,he,Z,oe,D+1);if(oe>=0&&se>0&&se<he.length&&m(he,Z,k,se,k,re,oe,P,F),he.reverse(),Z.reverse(),oe>-1&&se>0){let U=h(z,F);V=K2(z,he,Z,0,he.length,0,A-k,U,U)}else V=b(z,he,Z,A-k,P-A,F)}O.push(V),$.push(ie)}function f(C,L,O,$){let M=[],D=0,N=-1;for(;a.pos>L;){let{id:k,start:A,end:B,size:P}=a;if(P>4)a.next();else{if(N>-1&&A<N)break;N<0&&(N=B-r),M.push(k,A,B),D++,a.next()}}if(D){let k=new Uint16Array(D*4),A=M[M.length-2];for(let B=M.length-3,P=0;B>=0;B-=3)k[P++]=M[B],k[P++]=M[B+1]-A,k[P++]=M[B+2]-A,k[P++]=P;O.push(new Da(k,M[2]-A,o)),$.push(A-C)}}function h(C,L){return(O,$,M)=>{let D=0,N=O.length-1,k,A;if(N>=0&&(k=O[N])instanceof Tn){if(!N&&k.type==C&&k.length==M)return k;(A=k.prop(Dt.lookAhead))&&(D=$[N]+k.length+A)}return b(C,O,$,M,D,L)}}function m(C,L,O,$,M,D,N,k,A){let B=[],P=[];for(;C.length>$;)B.push(C.pop()),P.push(L.pop()+O-M);C.push(b(o.types[N],B,P,D-M,k-D,A)),L.push(M-O)}function b(C,L,O,$,M,D,N){if(D){let k=[Dt.contextHash,D];N=N?[k].concat(N):[k]}if(M>25){let k=[Dt.lookAhead,M];N=N?[k].concat(N):[k]}return new Tn(C,L,O,$,N)}function g(C,L){let O=a.fork(),$=0,M=0,D=0,N=O.end-r,k={size:0,start:0,skip:0};e:for(let A=O.pos-C;O.pos>A;){let B=O.size;if(O.id==L&&B>=0){k.size=$,k.start=M,k.skip=D,D+=4,$+=4,O.next();continue}let P=O.pos-B;if(B<0||P<A||O.start<N)break;let F=O.id>=s?4:0,z=O.start;for(O.next();O.pos>P;){if(O.size<0)if(O.size==-3||O.size==-4)F+=4;else break e;else O.id>=s&&(F+=4);O.next()}M=z,$+=B,D+=F}return(L<0||$==C)&&(k.size=$,k.start=M,k.skip=D),k.size>4?k:void 0}function v(C,L,O){let{id:$,start:M,end:D,size:N}=a;if(a.next(),N>=0&&$<s){let k=O;if(N>4){let A=a.pos-(N-4);for(;a.pos>A;)O=v(C,L,O)}L[--O]=k,L[--O]=D-C,L[--O]=M-C,L[--O]=$}else N==-3?c=$:N==-4&&(u=$);return O}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 Tn(l[t.topID],y.reverse(),x.reverse(),_)}const pS=new WeakMap;function Jh(t,e){if(!t.isAnonymous||e instanceof Da||e.type!=t)return 1;let n=pS.get(e);if(n==null){n=1;for(let o of e.children){if(o.type!=t||!(o instanceof Tn)){n=1;break}n+=Jh(t,o)}pS.set(e,n)}return n}function K2(t,e,n,o,r,i,s,a,l){let c=0;for(let m=o;m<r;m++)c+=Jh(t,e[m]);let u=Math.ceil(c*1.5/8),d=[],f=[];function h(m,b,g,v,y){for(let x=g;x<v;){let _=x,C=b[x],L=Jh(t,m[x]);for(x++;x<v;x++){let O=Jh(t,m[x]);if(L+O>=u)break;L+=O}if(x==_+1){if(L>u){let O=m[_];h(O.children,O.positions,0,O.children.length,b[_]+y);continue}d.push(m[_])}else{let O=b[x-1]+m[x-1].length-C;d.push(K2(t,m,b,_,x,C,O,null,l))}f.push(C+y-i)}}return h(e,n,o,r,0),(a||l)(d,f,s)}class wl{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 wl(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,m=Math.min(f.to,d)-c;f=h>=m?null:new wl(h,m,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 DM{startParse(e,n,o){return typeof e=="string"&&(e=new Lfe(e)),o=o?o.length?o.map(r=>new Tv(r.from,r.to)):[new Tv(0,0)]:[new Tv(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 Lfe{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 Pfe=0;class Lr{constructor(e,n,o,r){this.name=e,this.set=n,this.base=o,this.modified=r,this.id=Pfe++}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 Lr&&(n=e),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let r=new Lr(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 gp(e);return o=>o.modified.indexOf(n)>-1?o:gp.get(o.base||o,o.modified.concat(n).sort((r,i)=>r.id-i.id))}}let Dfe=0;class gp{constructor(e){this.name=e,this.instances=[],this.id=Dfe++}static get(e,n){if(!n.length)return e;let o=n[0].instances.find(a=>a.base==e&&Efe(n,a.modified));if(o)return o;let r=[],i=new Lr(e.name,r,e,n);for(let a of n)a.instances.push(i);let s=Ife(n);for(let a of e.set)if(!a.modified.length)for(let l of s)r.push(gp.get(a,l));return i}}function Efe(t,e){return t.length==e.length&&t.every((n,o)=>n==e[o])}function Ife(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 EM(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 df(o,s,l>0?i.slice(0,l):null);e[c]=u.sort(e[c])}}return IM.add(e)}const IM=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 df(r.tags,r.mode,r.context);n?n.next=i:o=i,n=i}return o}});class df{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}}df.empty=new df([],2,null);function RM(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 Rfe(t,e){let n=null;for(let o of t){let r=o.style(e);r&&(n=n?n+" "+r:r)}return n}function NM(t,e,n,o=0,r=t.length){let i=new Nfe(o,Array.isArray(e)?e:[e],n);i.highlightRange(t.cursor(),o,r,"",i.highlighters),i.flush(r)}class Nfe{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=Ffe(e)||df.empty,d=Rfe(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),m=this.highlighters.filter(g=>!g.scope||g.scope(f.tree.type)),b=e.firstChild();for(let g=0,v=a;;g++){let y=g<f.overlay.length?f.overlay[g]:null,x=y?y.from+a:l,_=Math.max(n,v),C=Math.min(o,x);if(_<C&&b)for(;e.from<C&&(this.highlightRange(e,_,C,r,i),this.startSpan(Math.min(C,e.to),c),!(e.to>=x||!e.nextSibling())););if(!y||x>o)break;v=y.to+a,v>n&&(this.highlightRange(h.cursor(),Math.max(n,y.from+a),Math.min(o,v),"",m),this.startSpan(Math.min(o,v),c))}b&&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 Ffe(t){let e=t.type.prop(IM);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const Ye=Lr.define,$h=Ye(),aa=Ye(),mS=Ye(aa),gS=Ye(aa),la=Ye(),Th=Ye(la),Mv=Ye(la),Di=Ye(),el=Ye(Di),Li=Ye(),Pi=Ye(),kb=Ye(),Gu=Ye(kb),Mh=Ye(),at={comment:$h,lineComment:Ye($h),blockComment:Ye($h),docComment:Ye($h),name:aa,variableName:Ye(aa),typeName:mS,tagName:Ye(mS),propertyName:gS,attributeName:Ye(gS),className:Ye(aa),labelName:Ye(aa),namespace:Ye(aa),macroName:Ye(aa),literal:la,string:Th,docString:Ye(Th),character:Ye(Th),attributeValue:Ye(Th),number:Mv,integer:Ye(Mv),float:Ye(Mv),bool:Ye(la),regexp:Ye(la),escape:Ye(la),color:Ye(la),url:Ye(la),keyword:Li,self:Ye(Li),null:Ye(Li),atom:Ye(Li),unit:Ye(Li),modifier:Ye(Li),operatorKeyword:Ye(Li),controlKeyword:Ye(Li),definitionKeyword:Ye(Li),moduleKeyword:Ye(Li),operator:Pi,derefOperator:Ye(Pi),arithmeticOperator:Ye(Pi),logicOperator:Ye(Pi),bitwiseOperator:Ye(Pi),compareOperator:Ye(Pi),updateOperator:Ye(Pi),definitionOperator:Ye(Pi),typeOperator:Ye(Pi),controlOperator:Ye(Pi),punctuation:kb,separator:Ye(kb),bracket:Gu,angleBracket:Ye(Gu),squareBracket:Ye(Gu),paren:Ye(Gu),brace:Ye(Gu),content:Di,heading:el,heading1:Ye(el),heading2:Ye(el),heading3:Ye(el),heading4:Ye(el),heading5:Ye(el),heading6:Ye(el),contentSeparator:Ye(Di),list:Ye(Di),quote:Ye(Di),emphasis:Ye(Di),strong:Ye(Di),link:Ye(Di),monospace:Ye(Di),strikethrough:Ye(Di),inserted:Ye(),deleted:Ye(),changed:Ye(),invalid:Ye(),meta:Mh,documentMeta:Ye(Mh),annotation:Ye(Mh),processingInstruction:Ye(Mh),definition:Lr.defineModifier("definition"),constant:Lr.defineModifier("constant"),function:Lr.defineModifier("function"),standard:Lr.defineModifier("standard"),local:Lr.defineModifier("local"),special:Lr.defineModifier("special")};for(let t in at){let e=at[t];e instanceof Lr&&(e.name=t)}const FM=RM([{tag:at.link,class:"tok-link"},{tag:at.heading,class:"tok-heading"},{tag:at.emphasis,class:"tok-emphasis"},{tag:at.strong,class:"tok-strong"},{tag:at.keyword,class:"tok-keyword"},{tag:at.atom,class:"tok-atom"},{tag:at.bool,class:"tok-bool"},{tag:at.url,class:"tok-url"},{tag:at.labelName,class:"tok-labelName"},{tag:at.inserted,class:"tok-inserted"},{tag:at.deleted,class:"tok-deleted"},{tag:at.literal,class:"tok-literal"},{tag:at.string,class:"tok-string"},{tag:at.number,class:"tok-number"},{tag:[at.regexp,at.escape,at.special(at.string)],class:"tok-string2"},{tag:at.variableName,class:"tok-variableName"},{tag:at.local(at.variableName),class:"tok-variableName tok-local"},{tag:at.definition(at.variableName),class:"tok-variableName tok-definition"},{tag:at.special(at.variableName),class:"tok-variableName2"},{tag:at.definition(at.propertyName),class:"tok-propertyName tok-definition"},{tag:at.typeName,class:"tok-typeName"},{tag:at.namespace,class:"tok-namespace"},{tag:at.className,class:"tok-className"},{tag:at.macroName,class:"tok-macroName"},{tag:at.propertyName,class:"tok-propertyName"},{tag:at.operator,class:"tok-operator"},{tag:at.comment,class:"tok-comment"},{tag:at.meta,class:"tok-meta"},{tag:at.invalid,class:"tok-invalid"},{tag:at.punctuation,class:"tok-punctuation"}]);var Ov;const yc=new Dt;function Vfe(t){return pt.define({combine:t?e=>e.concat(t):void 0})}const zfe=new Dt;class si{constructor(e,n,o=[],r=""){this.data=e,this.name=r,Kt.prototype.hasOwnProperty("tree")||Object.defineProperty(Kt.prototype,"tree",{get(){return es(this)}}),this.parser=n,this.extension=[au.of(this),Kt.languageData.of((i,s,a)=>{let l=vS(i,s,a),c=l.type.prop(yc);if(!c)return[];let u=i.facet(c),d=l.type.prop(zfe);if(d){let f=l.resolve(s-l.from,a);for(let h of d)if(h.test(f,i)){let m=i.facet(h.facet);return h.type=="replace"?m:m.concat(u)}}return u})].concat(o)}isActiveAt(e,n,o=-1){return vS(e,n,o).type.prop(yc)==this.data}findRegions(e){let n=e.facet(au);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(yc)==this.data){o.push({from:s,to:s+i.length});return}let a=i.prop(Dt.mounted);if(a){if(a.tree.prop(yc)==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 Tn&&r(c,i.positions[l]+s)}};return r(es(e),0),o}get allowsNesting(){return!0}}si.setState=$n.define();function vS(t,e,n){let o=t.facet(au),r=es(t).topNode;if(!o||o.allowsNesting)for(let i=r;i;i=i.enter(e,n,wn.ExcludeBuffers|wn.EnterBracketed))i.type.isTop&&(r=i);return r}class vp extends si{constructor(e,n,o){super(e,n,[],o),this.parser=n}static define(e){let n=Vfe(e.languageData);return new vp(n,e.parser.configure({props:[yc.add(o=>o.isTop?n:void 0)]}),e.name)}configure(e,n){return new vp(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function es(t){let e=t.field(si.state,!1);return e?e.tree:Tn.empty}class Hfe{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 qu=null;class bp{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 bp(e,n,[],Tn.empty,0,o,[],null)}startParse(){return this.parser.startParse(new Hfe(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Tn.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(wl.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(wl.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=qu;qu=this;try{return e()}finally{qu=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=bS(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=wl.applyChanges(o,l),r=Tn.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 bp(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=bS(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 DM{createParse(n,o,r){let i=r[0].from,s=r[r.length-1].to;return{parsedPos:i,advance(){let l=qu;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 Tn(ur.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 qu}}function bS(t,e,n){return wl.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class su{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 su(n)}static init(e){let n=Math.min(3e3,e.doc.length),o=bp.create(e.facet(au).parser,e,{from:0,to:n});return o.work(20,n)||o.takeTree(),new su(o)}}si.state=Ga.define({create:su.init,update(t,e){for(let n of e.effects)if(n.is(si.setState))return n.value;return e.startState.facet(au)!=e.state.facet(au)?su.init(e.state):t.apply(e)}});let VM=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(VM=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const Bv=typeof navigator<"u"&&(!((Ov=navigator.scheduling)===null||Ov===void 0)&&Ov.isInputPending)?()=>navigator.scheduling.isInputPending():null,Wfe=El.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(si.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(si.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=VM(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(si.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let s=Date.now()+Math.min(this.chunkBudget,100,e&&!Bv?Math.max(25,e.timeRemaining()-5):1e9),a=i.context.treeLen<r&&o.doc.length>r+1e3,l=i.context.work(()=>Bv&&Bv()||Date.now()>s,r+(a?0:1e5));this.chunkBudget-=Date.now()-n,(l||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:si.setState.of(new su(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=>Hi(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()}}}),au=pt.define({combine(t){return t.length?t[0]:null},enables:t=>[si.state,Wfe,_t.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class Ufe{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}const Gfe=pt.define(),Z2=pt.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 yp(t){let e=t.facet(Z2);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function xp(t,e){let n="",o=t.tabSize,r=t.facet(Z2)[0];if(r==" "){for(;e>=o;)n+=" ",e-=o;r=" "}for(let i=0;i<e;i++)n+=r;return n}function zM(t,e){t instanceof Kt&&(t=new sg(t));for(let o of t.state.facet(Gfe)){let r=o(t,e);if(r!==void 0)return r}let n=es(t.state);return n.length>=e?Yfe(t,n,e):null}class sg{constructor(e,n={}){this.state=e,this.options=n,this.unit=yp(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 Jm(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 qfe=new Dt;function Yfe(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 HM(o,t,n)}function HM(t,e,n){for(let o=t;o;o=o.next){let r=Xfe(o.node);if(r)return r(Q2.create(e,n,o))}return 0}function jfe(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function Xfe(t){let e=t.type.prop(qfe);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=>Jfe(s,!0,1,void 0,i&&!jfe(s)?r.from:void 0)}return t.parent==null?Kfe:null}function Kfe(){return 0}class Q2 extends sg{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 Q2(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(Zfe(o,e))break;n=this.state.doc.lineAt(o.from)}return this.lineIndent(n.from)}continue(){return HM(this.context.next,this.base,this.pos)}}function Zfe(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function Qfe(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 Jfe(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=Qfe(t);return l?a?t.column(l.from):t.column(l.to):t.baseIndent+(a?0:t.unit*n)}class J2{constructor(e,n){this.specs=e;let o;function r(a){let l=Ba.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 si?a=>a.prop(yc)==s.data:s?a=>a==s:void 0,this.style=RM(e.map(a=>({tag:a.tag,class:a.class||r(Object.assign({},a,{tag:null}))})),{all:i}).style,this.module=o?new Ba(o):null,this.themeType=n.themeType}static define(e,n){return new J2(e,n||{})}}const Cb=pt.define(),ehe=pt.define({combine(t){return t.length?[t[0]]:null}});function Lv(t){let e=t.facet(Cb);return e.length?e:t.facet(ehe)}function the(t,e){let n=[ohe],o;return t instanceof J2&&(t.module&&n.push(_t.styleModule.of(t.module)),o=t.themeType),o?n.push(Cb.computeN([_t.darkTheme],r=>r.facet(_t.darkTheme)==(o=="dark")?[t]:[])):n.push(Cb.of(t)),n}class nhe{constructor(e){this.markCache=Object.create(null),this.tree=es(e.state),this.decorations=this.buildDeco(e,Lv(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=es(e.state),o=Lv(e.state),r=o!=Lv(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 of;for(let{from:r,to:i}of e.visibleRanges)NM(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 ohe=D2.high(El.fromClass(nhe,{decorations:t=>t.decorations})),rhe=1e4,ihe="()[]{}",she=new Dt;function Ab(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 $b(t){let e=t.type.prop(she);return e?e(t.node):t}function xc(t,e,n,o={}){let r=o.maxScanDistance||rhe,i=o.brackets||ihe,s=es(t),a=s.resolveInner(e,n);for(let l=a;l;l=l.parent){let c=Ab(l.type,n,i);if(c&&l.from<l.to){let u=$b(l);if(u&&(n>0?e>=u.from&&e<u.to:e>u.from&&e<=u.to))return ahe(t,e,n,l,u,c,i)}}return lhe(t,e,n,s,a.type,r,i)}function ahe(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=$b(u);return{start:l,end:d?{from:d.from,to:d.to}:void 0,matched:!0}}else if(Ab(u.type,n,s))c++;else if(Ab(u.type,-n,s)){if(c==0){let d=$b(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 lhe(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 m=e+f*n;for(let b=n>0?0:h.length-1,g=n>0?h.length:-1;b!=g;b+=n){let v=s.indexOf(h[b]);if(!(v<0||o.resolveInner(m+b,1).type!=r))if(v%2==0==n>0)d++;else{if(d==1)return{start:c,end:{from:m+b,to:m+b+1},matched:v>>1==l>>1};d--}}n>0&&(f+=h.length)}return u.done?{start:c,matched:!1}:null}const che=Object.create(null),yS=[ur.none],xS=[],wS=Object.create(null),uhe=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"]])uhe[t]=dhe(che,e);function Pv(t,e){xS.indexOf(t)>-1||(xS.push(t),console.warn(e))}function dhe(t,e){let n=[];for(let a of e.split(" ")){let l=[];for(let c of a.split(".")){let u=t[c]||at[c];u?typeof u=="function"?l.length?l=l.map(u):Pv(c,`Modifier ${c} used at start of tag`):l.length?Pv(c,`Tag ${c} used as modifier`):l=Array.isArray(u)?u:[u]:Pv(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=wS[r];if(i)return i.id;let s=wS[r]=ur.define({id:yS.length,name:o,props:[EM({[o]:n})]});return yS.push(s),s.id}Pn.RTL,Pn.LTR;const fhe=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),o=tx(t.state,n.from);return o.line?hhe(t):o.block?mhe(t):!1};function ex(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 hhe=ex(bhe,0),phe=ex(WM,0),mhe=ex((t,e)=>WM(t,e,vhe(e)),0);function tx(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const Yu=50;function ghe(t,{open:e,close:n},o,r){let i=t.sliceDoc(o-Yu,o),s=t.sliceDoc(r,r+Yu),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*Yu?u=d=t.sliceDoc(o,r):(u=t.sliceDoc(o,o+Yu),d=t.sliceDoc(r-Yu,r));let f=/^\s*/.exec(u)[0].length,h=/\s*$/.exec(d)[0].length,m=d.length-h-n.length;return u.slice(f,f+e.length)==e&&d.slice(m,m+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(m-1))?1:0}}:null}function vhe(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 WM(t,e,n=e.selection.ranges){let o=n.map(i=>tx(e,i.from).block);if(!o.every(i=>i))return null;let r=n.map((i,s)=>ghe(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 bhe(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=tx(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,m=d.text.slice(f,f+c.length)==c?f:-1;f<d.text.length&&f<l&&(l=f),o.push({line:d,comment:m,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 Tb=qa.define(),yhe=qa.define(),xhe=pt.define(),UM=pt.define({combine(t){return Mue(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)})}}),GM=Ga.define({create(){return Wi.empty},update(t,e){let n=e.state.facet(UM),o=e.annotation(Tb);if(o){let l=rr.fromTransaction(e,o.selection),c=o.side,u=c==0?t.undone:t.done;return l?u=wp(u,u.length,n.minDepth,l):u=jM(u,e.startState.selection),new Wi(c==0?o.rest:u,c==0?u:o.rest)}let r=e.annotation(yhe);if((r=="full"||r=="before")&&(t=t.isolate()),e.annotation(Wn.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let i=rr.fromTransaction(e),s=e.annotation(Wn.time),a=e.annotation(Wn.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 Wi(t.done.map(rr.fromJSON),t.undone.map(rr.fromJSON))}});function whe(t={}){return[GM,UM.of(t),_t.domEventHandlers({beforeinput(e,n){let o=e.inputType=="historyUndo"?qM:e.inputType=="historyRedo"?Mb:null;return o?(e.preventDefault(),o(n)):!1}})]}function ag(t,e){return function({state:n,dispatch:o}){if(!e&&n.readOnly)return!1;let r=n.field(GM,!1);if(!r)return!1;let i=r.pop(t,n,e);return i?(o(i),!0):!1}}const qM=ag(0,!1),Mb=ag(1,!1),_he=ag(0,!0),She=ag(1,!0);class rr{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 rr(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 rr(e.changes&&zn.fromJSON(e.changes),[],e.mapped&&Zi.fromJSON(e.mapped),e.startSelection&&Re.fromJSON(e.startSelection),e.selectionsAfter.map(Re.fromJSON))}static fromTransaction(e,n){let o=Er;for(let r of e.startState.facet(xhe)){let i=r(e);i.length&&(o=o.concat(i))}return!o.length&&e.changes.empty?null:new rr(e.changes.invert(e.startState.doc),o,void 0,n||e.startState.selection,Er)}static selection(e){return new rr(void 0,Er,void 0,void 0,e)}}function wp(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 khe(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 Che(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,o)=>n.empty!=e.ranges[o].empty).length===0}function YM(t,e){return t.length?e.length?t.concat(e):t:e}const Er=[],Ahe=200;function jM(t,e){if(t.length){let n=t[t.length-1],o=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Ahe));return o.length&&o[o.length-1].eq(e)?t:(o.push(e),wp(t,t.length-1,1e9,n.setSelAfter(o)))}else return[rr.selection([e])]}function $he(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 Dv(t,e){if(!t.length)return t;let n=t.length,o=Er;for(;n;){let r=The(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?[rr.selection(o)]:Er}function The(t,e,n){let o=YM(t.selectionsAfter.length?t.selectionsAfter.map(a=>a.map(e)):Er,n);if(!t.changes)return rr.selection(o);let r=t.changes.map(e),i=e.mapDesc(t.changes,!0),s=t.mapped?t.mapped.composeDesc(i):i;return new rr(r,$n.mapEffects(t.effects,e),s,t.startSelection.map(i),o)}const Mhe=/^(input\.type|delete)($|\.)/;class Wi{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 Wi(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||Mhe.test(o))&&(!a.selectionsAfter.length&&n-this.prevTime<r.newGroupDelay&&r.joinToEvent(i,khe(a.changes,e.changes))||o=="input.type.compose")?s=wp(s,s.length-1,r.minDepth,new rr(e.changes.compose(a.changes),YM($n.mapEffects(e.effects,a.changes),a.effects),a.mapped,a.startSelection,Er)):s=wp(s,s.length,r.minDepth,e),new Wi(s,Er,n,o)}addSelection(e,n,o,r){let i=this.done.length?this.done[this.done.length-1].selectionsAfter:Er;return i.length>0&&n-this.prevTime<r&&o==this.prevUserEvent&&o&&/^select($|\.)/.test(o)&&Che(i[i.length-1],e)?this:new Wi(jM(this.done,e),this.undone,n,o)}addMapping(e){return new Wi(Dv(this.done,e),Dv(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:Tb.of({side:e,rest:$he(r),selection:s}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(i.changes){let a=r.length==1?Er:r.slice(0,r.length-1);return i.mapped&&(a=Dv(a,i.mapped)),n.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:Tb.of({side:e,rest:a,selection:s}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}Wi.empty=new Wi(Er,Er);const Ohe=[{key:"Mod-z",run:qM,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Mb,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Mb,preventDefault:!0},{key:"Mod-u",run:_he,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:She,preventDefault:!0}];function ku(t,e){return Re.create(t.ranges.map(e),t.mainIndex)}function Ai(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function $i({state:t,dispatch:e},n){let o=ku(t.selection,n);return o.eq(t.selection,!0)?!1:(e(Ai(t,o)),!0)}function lg(t,e){return Re.cursor(e?t.to:t.from)}function XM(t,e){return $i(t,n=>n.empty?t.moveByChar(n,e):lg(n,e))}function Lo(t){return t.textDirectionAt(t.state.selection.main.head)==Pn.LTR}const KM=t=>XM(t,!Lo(t)),ZM=t=>XM(t,Lo(t));function QM(t,e){return $i(t,n=>n.empty?t.moveByGroup(n,e):lg(n,e))}const Bhe=t=>QM(t,!Lo(t)),Lhe=t=>QM(t,Lo(t));function Phe(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 cg(t,e,n){let o=es(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;Phe(t,c,r)?o=c:l=n?c.to:c.from}let i=o.type.prop(r),s,a;return i&&(s=n?xc(t,o.from,1):xc(t,o.to,-1))&&s.matched?a=n?s.end.to:s.end.from:a=n?o.to:o.from,Re.cursor(a,n?-1:1)}const Dhe=t=>$i(t,e=>cg(t.state,e,!Lo(t))),Ehe=t=>$i(t,e=>cg(t.state,e,Lo(t)));function JM(t,e){return $i(t,n=>{if(!n.empty)return lg(n,e);let o=t.moveVertically(n,e);return o.head!=n.head?o:t.moveToLineBoundary(n,e)})}const eO=t=>JM(t,!1),tO=t=>JM(t,!0);function nO(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,o=0,r;if(e){for(let i of t.state.facet(_t.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 oO(t,e){let n=nO(t),{state:o}=t,r=ku(o.selection,s=>s.empty?t.moveVertically(s,e,n.height):lg(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=_t.scrollIntoView(r.main.head,{y:"start",yMargin:s.top-l}))}return t.dispatch(Ai(o,r),{effects:i}),!0}const _S=t=>oO(t,!1),Ob=t=>oO(t,!0);function Ya(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=Re.cursor(o.from+i))}return r}const Ihe=t=>$i(t,e=>Ya(t,e,!0)),Rhe=t=>$i(t,e=>Ya(t,e,!1)),Nhe=t=>$i(t,e=>Ya(t,e,!Lo(t))),Fhe=t=>$i(t,e=>Ya(t,e,Lo(t))),Vhe=t=>$i(t,e=>Re.cursor(t.lineBlockAt(e.head).from,1)),zhe=t=>$i(t,e=>Re.cursor(t.lineBlockAt(e.head).to,-1));function Hhe(t,e,n){let o=!1,r=ku(t.selection,i=>{let s=xc(t,i.head,-1)||xc(t,i.head,1)||i.head>0&&xc(t,i.head-1,1)||i.head<t.doc.length&&xc(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 Re.cursor(a)});return o?(e(Ai(t,r)),!0):!1}const Whe=({state:t,dispatch:e})=>Hhe(t,e);function Xr(t,e){let n=ku(t.state.selection,o=>{let r=e(o);return Re.range(o.anchor,r.head,r.goalColumn,r.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch(Ai(t.state,n)),!0)}function rO(t,e){return Xr(t,n=>t.moveByChar(n,e))}const iO=t=>rO(t,!Lo(t)),sO=t=>rO(t,Lo(t));function aO(t,e){return Xr(t,n=>t.moveByGroup(n,e))}const Uhe=t=>aO(t,!Lo(t)),Ghe=t=>aO(t,Lo(t)),qhe=t=>Xr(t,e=>cg(t.state,e,!Lo(t))),Yhe=t=>Xr(t,e=>cg(t.state,e,Lo(t)));function lO(t,e){return Xr(t,n=>t.moveVertically(n,e))}const cO=t=>lO(t,!1),uO=t=>lO(t,!0);function dO(t,e){return Xr(t,n=>t.moveVertically(n,e,nO(t).height))}const SS=t=>dO(t,!1),kS=t=>dO(t,!0),jhe=t=>Xr(t,e=>Ya(t,e,!0)),Xhe=t=>Xr(t,e=>Ya(t,e,!1)),Khe=t=>Xr(t,e=>Ya(t,e,!Lo(t))),Zhe=t=>Xr(t,e=>Ya(t,e,Lo(t))),Qhe=t=>Xr(t,e=>Re.cursor(t.lineBlockAt(e.head).from)),Jhe=t=>Xr(t,e=>Re.cursor(t.lineBlockAt(e.head).to)),CS=({state:t,dispatch:e})=>(e(Ai(t,{anchor:0})),!0),AS=({state:t,dispatch:e})=>(e(Ai(t,{anchor:t.doc.length})),!0),$S=({state:t,dispatch:e})=>(e(Ai(t,{anchor:t.selection.main.anchor,head:0})),!0),TS=({state:t,dispatch:e})=>(e(Ai(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),e0e=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),t0e=({state:t,dispatch:e})=>{let n=ug(t).map(({from:o,to:r})=>Re.range(o,Math.min(r+1,t.doc.length)));return e(t.update({selection:Re.create(n),userEvent:"select"})),!0},n0e=({state:t,dispatch:e})=>{let n=ku(t.selection,o=>{let r=es(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 Re.range(a.to,a.from)}return o});return n.eq(t.selection)?!1:(e(Ai(t,n)),!0)};function fO(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(Ai(n,Re.create(r,r.length-1))),!0)}const o0e=t=>fO(t,!1),r0e=t=>fO(t,!0),i0e=({state:t,dispatch:e})=>{let n=t.selection,o=null;return n.ranges.length>1?o=Re.create([n.main]):n.main.empty||(o=Re.create([Re.cursor(n.main.head)])),o?(e(Ai(t,o)),!0):!1};function Ef(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=Oh(t,l,!1)):l>s&&(n="delete.forward",l=Oh(t,l,!0)),s=Math.min(s,l),a=Math.max(a,l)}else s=Oh(t,s,!1),a=Oh(t,a,!0);return s==a?{range:i}:{changes:{from:s,to:a},range:Re.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"?_t.announce.of(o.phrase("Selection deleted")):void 0})),!0)}function Oh(t,e,n){if(t instanceof _t)for(let o of t.state.facet(_t.atomicRanges).map(r=>r(t)))o.between(e,e,(r,i)=>{r<e&&i>e&&(e=n?i:r)});return e}const hO=(t,e,n)=>Ef(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=Jm(a,i.tabSize),u=c%yp(i)||yp(i);for(let d=0;d<u&&a[a.length-1-d]==" ";d++)r--;l=r}else l=To(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=To(s.text,l-s.from,!1,!1)+s.from);return l}),Bb=t=>hO(t,!1,!0),pO=t=>hO(t,!0,!1),mO=(t,e)=>Ef(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=To(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}),gO=t=>mO(t,!1),s0e=t=>mO(t,!0),a0e=t=>Ef(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),l0e=t=>Ef(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),c0e=t=>Ef(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),u0e=({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:Re.cursor(o.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},d0e=({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:To(i.text,r-i.from,!1)+i.from,a=r==i.to?r+1:To(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:Re.cursor(a)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function ug(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 vO(t,e,n){if(t.readOnly)return!1;let o=[],r=[];for(let i of ug(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(Re.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(Re.range(l.anchor-a,l.head-a))}}return o.length?(e(t.update({changes:o,scrollIntoView:!0,selection:Re.create(r,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const f0e=({state:t,dispatch:e})=>vO(t,e,!1),h0e=({state:t,dispatch:e})=>vO(t,e,!0);function bO(t,e,n){if(t.readOnly)return!1;let o=[];for(let i of ug(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 p0e=({state:t,dispatch:e})=>bO(t,e,!1),m0e=({state:t,dispatch:e})=>bO(t,e,!0),g0e=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(ug(e).map(({from:r,to:i})=>(r>0?r--:i<e.doc.length&&i++,{from:r,to:i}))),o=ku(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 v0e(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=es(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 MS=yO(!1),b0e=yO(!0);function yO(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&&v0e(e,i);t&&(i=s=(s<=a.to?a:e.doc.lineAt(s)).to);let c=new sg(e,{simulateBreak:i,simulateDoubleBreak:!!l}),u=zM(c,i);for(u==null&&(u=Jm(/^\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=["",xp(e,u)];return l&&d.push(xp(e,c.lineIndent(a.from,-1))),{changes:{from:i,to:s,insert:Ut.of(d)},range:Re.cursor(i+1+d[1].length)}});return n(e.update(o,{scrollIntoView:!0,userEvent:"input"})),!0}}function nx(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:Re.range(i.mapPos(o.anchor,1),i.mapPos(o.head,1))}})}const y0e=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),o=new sg(t,{overrideIndentation:i=>{let s=n[i];return s??-1}}),r=nx(t,(i,s,a)=>{let l=zM(o,i.from);if(l==null)return;/\S/.test(i.text)||(l=0);let c=/^\s*/.exec(i.text)[0],u=xp(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},x0e=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(nx(t,(n,o)=>{o.push({from:n.from,insert:t.facet(Z2)})}),{userEvent:"input.indent"})),!0),w0e=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(nx(t,(n,o)=>{let r=/^\s*/.exec(n.text)[0];if(!r)return;let i=Jm(r,t.tabSize),s=0,a=xp(t,Math.max(0,i-yp(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),_0e=t=>(t.setTabFocusMode(),!0),S0e=[{key:"Ctrl-b",run:KM,shift:iO,preventDefault:!0},{key:"Ctrl-f",run:ZM,shift:sO},{key:"Ctrl-p",run:eO,shift:cO},{key:"Ctrl-n",run:tO,shift:uO},{key:"Ctrl-a",run:Vhe,shift:Qhe},{key:"Ctrl-e",run:zhe,shift:Jhe},{key:"Ctrl-d",run:pO},{key:"Ctrl-h",run:Bb},{key:"Ctrl-k",run:a0e},{key:"Ctrl-Alt-h",run:gO},{key:"Ctrl-o",run:u0e},{key:"Ctrl-t",run:d0e},{key:"Ctrl-v",run:Ob}],k0e=[{key:"ArrowLeft",run:KM,shift:iO,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Bhe,shift:Uhe,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Nhe,shift:Khe,preventDefault:!0},{key:"ArrowRight",run:ZM,shift:sO,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Lhe,shift:Ghe,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Fhe,shift:Zhe,preventDefault:!0},{key:"ArrowUp",run:eO,shift:cO,preventDefault:!0},{mac:"Cmd-ArrowUp",run:CS,shift:$S},{mac:"Ctrl-ArrowUp",run:_S,shift:SS},{key:"ArrowDown",run:tO,shift:uO,preventDefault:!0},{mac:"Cmd-ArrowDown",run:AS,shift:TS},{mac:"Ctrl-ArrowDown",run:Ob,shift:kS},{key:"PageUp",run:_S,shift:SS},{key:"PageDown",run:Ob,shift:kS},{key:"Home",run:Rhe,shift:Xhe,preventDefault:!0},{key:"Mod-Home",run:CS,shift:$S},{key:"End",run:Ihe,shift:jhe,preventDefault:!0},{key:"Mod-End",run:AS,shift:TS},{key:"Enter",run:MS,shift:MS},{key:"Mod-a",run:e0e},{key:"Backspace",run:Bb,shift:Bb,preventDefault:!0},{key:"Delete",run:pO,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:gO,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:s0e,preventDefault:!0},{mac:"Mod-Backspace",run:l0e,preventDefault:!0},{mac:"Mod-Delete",run:c0e,preventDefault:!0}].concat(S0e.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),C0e=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Dhe,shift:qhe},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Ehe,shift:Yhe},{key:"Alt-ArrowUp",run:f0e},{key:"Shift-Alt-ArrowUp",run:p0e},{key:"Alt-ArrowDown",run:h0e},{key:"Shift-Alt-ArrowDown",run:m0e},{key:"Mod-Alt-ArrowUp",run:o0e},{key:"Mod-Alt-ArrowDown",run:r0e},{key:"Escape",run:i0e},{key:"Mod-Enter",run:b0e},{key:"Alt-l",mac:"Ctrl-l",run:t0e},{key:"Mod-i",run:n0e,preventDefault:!0},{key:"Mod-[",run:w0e},{key:"Mod-]",run:x0e},{key:"Mod-Alt-\\",run:y0e},{key:"Shift-Mod-k",run:g0e},{key:"Shift-Mod-\\",run:Whe},{key:"Mod-/",run:fhe},{key:"Alt-A",run:phe},{key:"Ctrl-m",mac:"Shift-Alt-m",run:_0e}].concat(k0e);var OS={};class _p{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 _p(e,[],n,o,o,0,[],0,r?new BS(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 _p(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 A0e(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 BS(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 BS{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class A0e{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 Sp{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 Sp(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 Sp(this.stack,this.pos,this.index)}}function Bh(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 e0{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const LS=new e0;class $0e{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=LS,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=LS,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 Ec{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:o}=n.p;T0e(this.data,e,n,this.id,o.data,o.tokenPrecTable)}}Ec.prototype.contextual=Ec.prototype.fallback=Ec.prototype.extend=!1;Ec.prototype.fallback=Ec.prototype.extend=!1;function T0e(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 m=t[h];if(l.allows(m)&&(e.token.value==-1||e.token.value==m||M0e(m,e.token.value,r,i))){e.acceptToken(m);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,m=c+h+(h<<1),b=t[m],g=t[m+1]||65536;if(u<b)f=h;else if(u>=g)d=h+1;else{s=t[m+2],e.advance();continue e}}break}}function PS(t,e,n){for(let o=e,r;(r=t[o])!=65535;o++)if(r==n)return o-e;return-1}function M0e(t,e,n,o){let r=PS(n,o,e);return r<0||PS(n,o,t)<r}const dr=typeof process<"u"&&OS&&/\bparse\b/.test(OS.LOG);let Ev=null;function DS(t,e,n){let o=t.cursor(wn.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 O0e{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?DS(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?DS(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 Tn){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 B0e{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(o=>new e0)}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 e0,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 e0,{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=bs(a,c+2);else{r==0&&a[c+1]==2&&(r=this.putAction(bs(a,c+2),n,o,r));break}a[c]==n&&(r=this.putAction(bs(a,c+1),n,o,r))}return r}}class L0e{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 $0e(n,r),this.tokens=new B0e(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[_p.start(this,e.top[0],i)],this.fragments=o.length&&this.stream.end-i>e.bufferLength*4?new O0e(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&&D0e(r);if(s)return dr&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw dr&&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 dr&&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=dr?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),dr&&console.log(s+this.stackID(e)+` (via reuse of ${i.getName(d.type.id)})`),!0;if(!(d instanceof Tn)||d.children.length==0||d.positions[0]>0)break;let h=d.children[0];if(h instanceof Tn&&d.positions[0]==0)d=h;else break}}let a=i.stateSlot(e.state,4);if(a>0)return e.reduce(a),dr&&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,m=h?e:e.split(),b=this.tokens.mainToken;if(m.apply(u,d,b?b.start:m.pos,f),dr&&console.log(s+this.stackID(m)+` (via ${(u&65536)==0?"shift":`reduce of ${i.getName(u&65535)}`} for ${i.getName(d)} @ ${r}${m==e?"":", split"})`),h)return!0;m.pos>r?n.push(m):o.push(m)}return!1}advanceFully(e,n){let o=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>o)return ES(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=dr?this.stackID(a)+" -> ":"";if(a.deadEnd&&(i||(i=!0,a.restart(),dr&&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()&&(dr&&console.log(f+this.stackID(d)+" (via force-reduce)"),!this.advanceFully(d,o));h++)dr&&(f=this.stackID(d)+" -> ");for(let h of a.recoverByInsert(l))dr&&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),dr&&console.log(u+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),ES(a,o)):(!r||r.score<d.score)&&(r=d)}return r}stackToTree(e){return e.close(),Tn.build({buffer:Sp.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=(Ev||(Ev=new WeakMap)).get(e);return n||Ev.set(e,n=String.fromCodePoint(this.nextStackID++)),n+e}}function ES(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 P0e{constructor(e,n,o){this.source=e,this.flags=n,this.disabled=o}allows(e){return!this.disabled||this.disabled[e]==0}}class kp extends DM{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 Y2(n.map((a,l)=>ur.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=OM;let s=Bh(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(IS),this.states=Bh(e.states,Uint32Array),this.data=Bh(e.stateData),this.goto=Bh(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(a=>typeof a=="number"?new Ec(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 L0e(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=bs(o,i+2)];else{if(o[i+1]==2)return bs(o,i+2);break}if(s==n||s==0)return bs(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=bs(this.data,i+2);else break;r=n(bs(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=bs(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(kp.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]=IS(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 P0e(e,o,r)}static deserialize(e){return new kp(e)}}function bs(t,e){return t[e]|t[e+1]<<16}function D0e(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 IS(t){if(t.external){let e=t.extend?1:0;return(n,o)=>t.external(n,o)<<1|e}return t.get}const E0e={__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},I0e=kp.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=>E0e[t]||-1}],tokenPrec:447}),xO=I0e.configure({props:[EM({chart:at.keyword,data:at.keyword,colorize:at.keyword,highlight:at.keyword,areafill:at.keyword,annotation:at.keyword,range:at.keyword,note:at.keyword,series:at.keyword,scene:at.keyword,step:at.keyword,transform:at.keyword,Identifier:at.variableName,String:at.string,Number:at.number,Percentage:at.number,Equals:at.operator,LineComment:at.lineComment,"{ }":at.brace})]}),R0e=vp.define({parser:xO,languageData:{commentTokens:{line:"//"}}}),N0e=the(FM);function F0e(){return new Ufe(R0e)}function Iv(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function Lve(t){const e=xO.parse(t);let n=0,o="";return NM(e,FM,(r,i,s)=>{r>n&&(o+=Iv(t.slice(n,r))),o+=`<span class="${s}">${Iv(t.slice(r,i))}</span>`,n=i}),n<t.length&&(o+=Iv(t.slice(n))),o}const V0e={class:"d-flex flex-column h-100"},z0e={key:0,class:"text-danger small mt-1"},H0e=le({__name:"ChartEditDsl",setup(t){const{dsl:e}=Of(),{applyDsl:n}=Oc(),o=ft("editorEl"),r=Ie();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=Kt.create({doc:e.value,extensions:[MM.of([...C0e,...Ohe]),whe(),F0e(),N0e,_t.updateListener.of(a),_t.theme({"&":{height:"100%",backgroundColor:"var(--bs-body-bg)"},".cm-scroller":{overflow:"auto"},".cm-content":{fontFamily:"var(--bs-font-monospace)"},".cm-gutters":{backgroundColor:"var(--bs-body-bg)",color:"var(--bs-secondary-color)",borderRight:"1px solid var(--bs-border-color)"}})]});i=new _t({state:l,parent:o.value})}),He(e,l=>{!i||i.state.doc.toString()===l||(s=!0,i.dispatch({changes:{from:0,to:i.state.doc.length,insert:l}}),s=!1)}),zs(()=>{i==null||i.destroy(),i=void 0}),(l,c)=>(w(),R("div",V0e,[T("div",{ref_key:"editorEl",ref:o,class:"flex-grow-1 overflow-auto"},null,512),p(r)?(w(),R("div",z0e,xe(p(r)),1)):ae("",!0)]))}}),W0e={key:1,class:"position-absolute",width:"0",height:"0","aria-hidden":"true"},U0e=le({__name:"PreviewChart",setup(t){const e=ft("containerRef");O2(e);const{containerRef:n}=aT();He(e,D=>{n.value=D},{immediate:!0});const{selectAnnotation:o}=Or();function r(D){var P;const k=D.target.closest("g[data-annotation-index]");if(!k)return;D.preventDefault(),(P=window.getSelection())==null||P.removeAllRanges();const A=k.getAttribute("data-annotation-id");if(A){o(A);return}const B=parseInt(k.getAttribute("data-annotation-index")||"",10);isNaN(B)||o(B)}fn(()=>{var D;(D=e.value)==null||D.addEventListener("dblclick",r)}),Ds(()=>{var D;(D=e.value)==null||D.removeEventListener("dblclick",r)});const{cvdMode:i}=At(dT()),s=ft("cvdDefsRef");He([i,s],([D,N])=>{if(N){for(;N.firstChild;)N.removeChild(N.firstChild);D&&N.appendChild(hte(D))}},{immediate:!0});const a=S(()=>{if(i.value)return{filter:`url(#${p$(i.value)})`}}),{layout:l}=hn(),{scenes:c,activeIndex:u,playing:d,setActive:f,nextScene:h,previousScene:m,startPlayback:b,stopPlayback:g}=bn(),v=Ie(null),y={buttons:g1,"progress-bar":wC,"dot-stepper":_C,"minimal-arrows":SC},x=S(()=>y[l.value.playerType]),_=S(()=>c.value.length+1),C=S(()=>u.value+2),L=S(()=>c.value.length>=1&&l.value.playerType!=="none");function O(D){f(D-2)}let $=null;function M(){const D=e.value;return D?D.querySelector(".bc-frame-footer"):null}return He(e,D=>{if($&&($.disconnect(),$=null),!D){v.value=null;return}v.value=M(),$=new MutationObserver(()=>{v.value=M()}),$.observe(D,{childList:!0,subtree:!0})},{immediate:!0}),Ds(()=>{$&&($.disconnect(),$=null)}),(D,N)=>(w(),R(Ne,null,[T("div",{ref_key:"containerRef",ref:e,class:"w-100 h-100",style:Ot(p(a))},null,4),p(v)&&p(L)?(w(),K(zp,{key:0,to:p(v)},[(w(),K(on(p(x)),{total:p(_),current:p(C),playing:p(d),position:p(l).playerPosition,"onUpdate:current":O,onPrevious:p(m),onNext:p(h),onPlay:p(b),onPause:p(g)},null,40,["total","current","playing","position","onPrevious","onNext","onPlay","onPause"]))],8,["to"])):ae("",!0),p(i)?(w(),R("svg",W0e,[T("defs",{ref_key:"cvdDefsRef",ref:s},null,512)])):ae("",!0)],64))}}),G0e={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function q0e(t,e){return w(),R("svg",G0e,[...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 Y0e=$e({name:"ph-puzzle-piece",render:q0e}),j0e={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function X0e(t,e){return w(),R("svg",j0e,[...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 K0e=$e({name:"ph-waves",render:X0e}),Z0e={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Q0e(t,e){return w(),R("svg",Z0e,[...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 J0e=$e({name:"ph-vector-two",render:Q0e}),epe={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function tpe(t,e){return w(),R("svg",epe,[...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 npe=$e({name:"ph-push-pin",render:tpe}),ope=le({__name:"ChartEditIconRail",props:{horizontal:{type:Boolean}},setup(t){const e=["showVerticalAxis","verticalAxisDirection","showVerticalTicks","verticalLabelPosition","verticalGridStyle","verticalNumberFormat","verticalScaleType","verticalRangeMin","verticalRangeMax","showHorizontalAxis","showHorizontalTicks","horizontalLabelPosition","horizontalGridStyle","horizontalNumberFormat","horizontalScaleType","horizontalRangeMin","horizontalRangeMax"],n=Or(),{activeTab:o}=At(n),{selectTab:r}=n,{toggleMode:i}=Zl(),{chartType:s}=hn(),{availableOptionKeys:a}=yn(),{scenes:l}=bn(),c=S(()=>a.value.some(f=>e.includes(f))),u=S(()=>a.value.includes("tooltips")||a.value.includes("crosshair")||l.value.length>=1),d=S(()=>{const f=[{value:"type",icon:pc,tooltip:"Chart Type"},{value:"text",icon:cT,tooltip:"Text"},{value:"style",icon:fT,tooltip:"Style"}];return["line-multi","bar-multi","bar-split"].includes(s.value)&&f.push({value:"series",icon:K0e,tooltip:"Series"}),c.value&&f.push({value:"axes",icon:J0e,tooltip:"Axes"}),f.push({value:"layout",icon:Y0e,tooltip:"Layout"}),f.push({value:"annotate",icon:npe,tooltip:"Annotate"}),u.value&&f.push({value:"interactions",icon:j$,tooltip:"Interactions"}),f});return(f,h)=>{const m=T2;return w(),K(m,{horizontal:t.horizontal,"active-tab":p(o),items:p(d),onSelect:p(r),onToggleMode:p(i)},null,8,["horizontal","active-tab","items","onSelect","onToggleMode"])}}}),rpe=le({__name:"ChartEditPanel",setup(t){const e=["showVerticalAxis","verticalAxisDirection","showVerticalTicks","verticalLabelPosition","verticalGridStyle","verticalNumberFormat","verticalScaleType","verticalRangeMin","verticalRangeMax","showHorizontalAxis","showHorizontalTicks","horizontalLabelPosition","horizontalGridStyle","horizontalNumberFormat","horizontalScaleType","horizontalRangeMin","horizontalRangeMax"],n=Or(),{viewMode:o,activeTab:r,canvasMode:i,showDimensions:s}=At(n),{selectTab:a}=n,{mode:l}=Zl(),{isNarrow:c}=Wl(),{chartType:u,layout:d}=hn(),{availableOptionKeys:f}=yn(),{scenes:h}=bn(),{cardClass:m,cardStyle:b}=M2(d,"chart-edit-panel__canvas__card"),g=S(()=>f.value.some(B=>e.includes(B))),v=S({get:()=>!!r.value,set:B=>{B||a("")}});He(l,B=>{B==="drawer"&&r.value&&a("")},{immediate:!0});const y=S(()=>f.value.includes("tooltips")||f.value.includes("crosshair")||h.value.length>=1),x=S(()=>{const B=[{key:"type",label:"Type"},{key:"text",label:"Text"},{key:"style",label:"Style"}];return["line-multi","bar-multi","bar-split"].includes(u.value)&&B.push({key:"series",label:"Series"}),g.value&&B.push({key:"axes",label:"Axes"}),B.push({key:"layout",label:"Layout"}),B.push({key:"annotate",label:"Annotate"}),y.value&&B.push({key:"interactions",label:"Interactions"}),B}),_=S(()=>({"chart-edit-panel--narrow":c.value})),C=S(()=>({[`chart-edit-panel__canvas--${i.value}`]:i.value!=="blueprint","chart-edit-panel__canvas--dsl":o.value!=="preview"})),L={type:"Chart Type",text:"Text",style:"Style",layout:"Layout",series:"Series",axes:"Axes",annotate:"Annotate",interactions:"Interactions"},O=S(()=>L[r.value]??"Panel"),$=ft("canvasRef"),M=ft("cardRef"),D=De(0),N=De(0);function k(){const B=M.value;B&&(D.value=B.offsetLeft,N.value=B.offsetTop)}zr($,k),zr(M,k);const A=S(()=>({"--grid-offset-x":`${D.value}px`,"--grid-offset-y":`${N.value}px`}));return(B,P)=>{const F=ope,z=U0e,V=H0e,G=nT,ie=tT,ce=$2,he=lue,Z=nue,oe=Xce,se=Yce,re=rce,U=Zle,te=Hle,ne=ule,ve=Kse,me=C2,I=Zm;return w(),R("div",{class:Me(["chart-edit-panel",p(_)])},[p(c)?(w(),K(F,{key:0,horizontal:""})):ae("",!0),T("div",{ref_key:"canvasRef",ref:$,class:Me(["chart-edit-panel__canvas",p(C)]),style:Ot(p(A))},[p(o)==="preview"?(w(),R("div",{key:0,ref_key:"cardRef",ref:M,class:Me(["chart-edit-panel__canvas__card",p(m)]),style:Ot(p(b))},[H(z)],6)):(w(),K(V,{key:1,class:"chart-edit-panel__canvas__dsl"})),p(o)==="preview"&&p(s)?(w(),K(G,{key:2,"card-ref":p(M),"canvas-ref":p($),layout:p(d)},null,8,["card-ref","canvas-ref","layout"])):ae("",!0),p(o)==="preview"?(w(),K(ie,{key:3})):ae("",!0)],6),H(I,{"drawer-open":p(v),"onUpdate:drawerOpen":P[0]||(P[0]=W=>Ke(v)?v.value=W:null),title:p(O),"container-ref":p($),onClose:P[1]||(P[1]=W=>p(a)(""))},xr({default:Q(()=>[p(r)==="type"?(w(),K(Z,{key:0})):p(r)==="text"?(w(),K(oe,{key:1})):p(r)==="style"?(w(),K(se,{key:2})):p(r)==="series"?(w(),K(re,{key:3})):p(r)==="axes"?(w(),K(U,{key:4})):p(r)==="layout"?(w(),K(te,{key:5})):p(r)==="annotate"?(w(),K(ne,{key:6})):p(r)==="interactions"?(w(),K(ve,{key:7})):ae("",!0)]),_:2},[p(l)!=="docked"?{name:"tabs",fn:Q(()=>[H(ce,{tabs:p(x),"model-value":p(r),sticky:"","onUpdate:modelValue":p(a)},null,8,["tabs","model-value","onUpdate:modelValue"])]),key:"0"}:void 0,p(l)!=="drawer"?{name:"header",fn:Q(()=>[H(he)]),key:"1"}:void 0,p(l)!=="drawer"?{name:"footer",fn:Q(()=>[H(me)]),key:"2"}:void 0]),1032,["drawer-open","title","container-ref"]),p(c)?ae("",!0):(w(),K(F,{key:1}))],2)}}}),ipe=Le(rpe,[["__scopeId","data-v-ba1e35ff"]]),spe={class:"reco-card__preview"},ape={class:"reco-card__body"},lpe={class:"reco-card__body__title"},cpe={class:"reco-card__body__reason"},upe=le({__name:"DataRecommendationCard",props:{chartType:{},label:{},fitness:{},reason:{}},emits:["select"],setup(t){const e={[Be.BarVertical]:$e(hT),[Be.BarHorizontal]:$e(pT),[Be.BarMulti]:$e(mT),[Be.Line]:$e(gT),[Be.LineMulti]:$e(vT),[Be.Donut]:$e(bT),[Be.Pie]:$e(yT)},n=t,o=S(()=>e[n.chartType]),r=S(()=>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=S(()=>n.fitness==="best"?"Best match":n.fitness==="good"?"Good fit":"Alternative");return(s,a)=>(w(),R("button",{class:Me(["reco-card",{"reco-card--best":t.fitness==="best"}]),onClick:a[0]||(a[0]=l=>s.$emit("select",t.chartType))},[T("div",spe,[p(o)?(w(),K(on(p(o)),{key:0,class:"reco-card__preview__thumb-svg"})):ae("",!0)]),T("div",ape,[T("div",lpe,[Ge(xe(t.label)+" ",1),T("span",{class:Me(["reco-card__body__title__badge",p(r)])},xe(p(i)),3)]),T("div",cpe,xe(t.reason),1)])],2))}}),dpe=Le(upe,[["__scopeId","data-v-0e22d5d1"]]),fpe={[Be.BarVertical]:"Vertical Bar Chart",[Be.BarHorizontal]:"Horizontal Bar Chart",[Be.BarMulti]:"Grouped Bar Chart",[Be.Line]:"Line Chart",[Be.LineMulti]:"Multi-Line Chart",[Be.Pie]:"Pie Chart",[Be.Donut]:"Donut Chart"};function hpe(){const{displayRows:t,displayColumnTypes:e}=Ko(),n=S(()=>{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:S(()=>{const r=e.value;if(r.length===0)return[];const i=r.filter(d=>d==="string").length,s=r.filter(d=>d==="number").length,a=r.filter(d=>d==="date").length,l=t.value.length,c=[];function u(d,f,h){c.push({chartType:d,label:fpe[d]??d,fitness:f,reason:h})}return a===1&&s>=1?s===1?(u(Be.Line,"best","1 date + 1 numeric column — ideal for trend"),u(Be.BarVertical,"alternative","Can also show as bars")):(u(Be.LineMulti,"best",`1 date + ${s} numeric columns — compare trends`),u(Be.BarMulti,"alternative","Can also show as grouped bars")):i===1&&s===1?(u(Be.BarVertical,"best","1 categorical + 1 numeric — classic bar chart"),u(Be.BarHorizontal,"good","Horizontal bars work well for long labels"),l<=8&&(u(Be.Donut,"good",`${l} items — suitable for part-of-whole`),u(Be.Pie,"alternative","Pie chart for part-of-whole"))):i===1&&s>1?(u(Be.BarMulti,"best",`1 categorical + ${s} numeric columns — compare groups`),u(Be.LineMulti,"good","Can also show as multi-line chart")):s>=1&&(i>=1||a>=1)&&u(Be.BarVertical,"good","Default bar chart recommendation"),c}),dataSummary:n}}const ppe={class:"data-recommendations"},mpe={class:"data-recommendations__summary"},gpe={key:0,class:"text-muted text-center py-3"},vpe=le({__name:"DataRecommendations",setup(t){const{recommendations:e,dataSummary:n}=hpe(),o=hn();function r(i){o.chartType.value=i}return(i,s)=>{const a=dpe;return w(),R("div",ppe,[T("p",mpe," Based on your data: "+xe(p(n)),1),p(e).length===0?(w(),R("div",gpe," Load data to see recommendations ")):ae("",!0),(w(!0),R(Ne,null,gt(p(e),l=>(w(),K(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))])}}}),bpe=Le(vpe,[["__scopeId","data-v-47bbaf64"]]),RS={firstRowIsHeader:!0,delimiter:"auto",decimalSeparator:".",treatEmptyAsNull:!0,trimWhitespace:!0},ype=Bo("parseOptions",()=>{const t=sr({...RS});function e(o,r){t[o]=r}function n(){Object.assign(t,{...RS})}return{...Rp(t),setOption:e,reset:n}});function wO(){const t=ype(),{firstRowIsHeader:e,delimiter:n,decimalSeparator:o,treatEmptyAsNull:r,trimWhitespace:i}=At(t);return{firstRowIsHeader:e,delimiter:n,decimalSeparator:o,treatEmptyAsNull:r,trimWhitespace:i,setOption:t.setOption,reset:t.reset}}const xpe={class:"data-parse-settings"},wpe={class:"data-parse-settings__field"},_pe={class:"data-parse-settings__field"},Spe=le({__name:"DataParseSettings",setup(t){const e=wO(),{firstRowIsHeader:n,delimiter:o,decimalSeparator:r,treatEmptyAsNull:i,trimWhitespace:s}=At(e),{setOption:a}=e,{sourceFormat:l}=Ko(),c=S(()=>l.value!=="delimited"),u=S({get:()=>n.value,set:v=>a("firstRowIsHeader",v)}),d=S({get:()=>o.value,set:v=>a("delimiter",v)}),f=S({get:()=>r.value,set:v=>a("decimalSeparator",v)}),h=S({get:()=>i.value,set:v=>a("treatEmptyAsNull",v)}),m=S({get:()=>s.value,set:v=>a("trimWhitespace",v)}),b=[{value:"auto",label:"Auto-detect"},{value:",",label:"Comma (,)"},{value:" ",label:"Tab"},{value:";",label:"Semicolon (;)"},{value:"|",label:"Pipe (|)"}],g=[{value:".",label:"Period (.)"},{value:",",label:"Comma (,)"}];return(v,y)=>(w(),R("div",xpe,[H(p(Ts),{modelValue:p(u),"onUpdate:modelValue":y[0]||(y[0]=x=>Ke(u)?u.value=x:null),switch:""},{default:Q(()=>[...y[5]||(y[5]=[Ge(" First row is header ",-1)])]),_:1},8,["modelValue"]),T("div",wpe,[y[6]||(y[6]=T("div",{class:"data-parse-settings__field__label"}," Delimiter ",-1)),H(p(Dn),{modelValue:p(d),"onUpdate:modelValue":y[1]||(y[1]=x=>Ke(d)?d.value=x:null),label:"",options:b,disabled:p(c),block:""},null,8,["modelValue","disabled"])]),T("div",_pe,[y[7]||(y[7]=T("div",{class:"data-parse-settings__field__label"}," Decimal Separator ",-1)),H(p(Dn),{modelValue:p(f),"onUpdate:modelValue":y[2]||(y[2]=x=>Ke(f)?f.value=x:null),label:"",options:g,block:""},null,8,["modelValue"])]),H(p(Ts),{modelValue:p(h),"onUpdate:modelValue":y[3]||(y[3]=x=>Ke(h)?h.value=x:null),switch:""},{default:Q(()=>[...y[8]||(y[8]=[Ge(" Treat empty as null ",-1)])]),_:1},8,["modelValue"]),H(p(Ts),{modelValue:p(m),"onUpdate:modelValue":y[4]||(y[4]=x=>Ke(m)?m.value=x:null),switch:""},{default:Q(()=>[...y[9]||(y[9]=[Ge(" Trim whitespace ",-1)])]),_:1},8,["modelValue"])]))}}),kpe=Le(Spe,[["__scopeId","data-v-872473d2"]]),Cpe={class:"output-block"},Ape={class:"output-block__meta"},$pe=le({__name:"DataTransformOutputBlock",props:{columns:{},rows:{}},setup(t){return(e,n)=>(w(),R("div",Cpe,[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",Ape,xe(t.columns)+" cols · "+xe(t.rows)+" rows",1)]))}}),Tpe=Le($pe,[["__scopeId","data-v-b1080d62"]]),Mpe={class:"add-wrap"},Ope={key:0,class:"add-wrap__dropdown"},Bpe=["disabled","onClick"],Lpe={class:"add-wrap__dropdown__item__text"},Ppe={class:"add-wrap__dropdown__item__text__name"},Dpe={class:"add-wrap__dropdown__item__text__desc"},Epe=le({__name:"DataTransformAddButton",emits:["add"],setup(t,{emit:e}){const n=e,o=De(!1),r=[{value:et.Sort,label:"Sort",desc:"Reorder rows by column values",disabled:!1},{value:et.Filter,label:"Filter",desc:"Keep or exclude rows by condition",disabled:!1},{value:et.HideColumns,label:"Hide Columns",desc:"Remove columns from output",disabled:!1},{value:et.Transpose,label:"Transpose",desc:"Swap rows and columns",disabled:!1},{value:et.Parse,label:"Parse",desc:"Transform column values",disabled:!1},{value:et.Rename,label:"Rename Column",desc:"Change a column name",disabled:!1},{value:et.GroupBy,label:"Group By",desc:"Aggregate rows by column values",disabled:!1},{value:et.Computed,label:"Computed Column",desc:"Derive new column (coming soon)",disabled:!0}];function i(l){return{[et.Sort]:"add-wrap__dropdown__item__icon--sort",[et.Filter]:"add-wrap__dropdown__item__icon--filter",[et.HideColumns]:"add-wrap__dropdown__item__icon--hide-columns",[et.Transpose]:"add-wrap__dropdown__item__icon--transpose",[et.Parse]:"add-wrap__dropdown__item__icon--parse",[et.Rename]:"add-wrap__dropdown__item__icon--rename",[et.GroupBy]:"add-wrap__dropdown__item__icon--group",[et.Computed]:"add-wrap__dropdown__item__icon--computed"}[l]??""}function s(l){return{[et.Sort]:"S",[et.Filter]:"F",[et.HideColumns]:"H",[et.Transpose]:"T",[et.Parse]:"P",[et.Rename]:"R",[et.GroupBy]:"G",[et.Computed]:"C"}[l]??"?"}function a(l){n("add",l),o.value=!1}return(l,c)=>(w(),R("div",Mpe,[H(p(vl),{label:"Add",onClick:c[0]||(c[0]=u=>o.value=!p(o))}),p(o)?(w(),R("div",Ope,[(w(),R(Ne,null,gt(r,u=>T("button",{key:u.value,class:"add-wrap__dropdown__item",disabled:u.disabled,onClick:d=>a(u.value)},[T("span",{class:Me(["add-wrap__dropdown__item__icon",i(u.value)])},xe(s(u.value)),3),T("div",Lpe,[T("div",Ppe,xe(u.label),1),T("div",Dpe,xe(u.desc),1)])],8,Bpe)),64))])):ae("",!0)]))}}),Ipe=Le(Epe,[["__scopeId","data-v-ac055819"]]),Rpe={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Npe(t,e){return w(),R("svg",Rpe,[...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 Fpe=$e({name:"ph-sort-ascending",render:Npe}),Vpe={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function zpe(t,e){return w(),R("svg",Vpe,[...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 Hpe=$e({name:"ph-funnel",render:zpe}),Wpe={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Upe(t,e){return w(),R("svg",Wpe,[...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 _O=$e({name:"ph-arrows-clockwise",render:Upe}),Gpe={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function qpe(t,e){return w(),R("svg",Gpe,[...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 Ype=$e({name:"ph-wrench",render:qpe}),jpe={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Xpe(t,e){return w(),R("svg",jpe,[...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 Kpe=$e({name:"ph-stack",render:Xpe}),Zpe={[et.Sort]:{iconClass:"step-card__body__icon--sort",iconComponent:Fpe,fallback:"S",label:"Sort"},[et.Filter]:{iconClass:"step-card__body__icon--filter",iconComponent:Hpe,fallback:"F",label:"Filter"},[et.HideColumns]:{iconClass:"step-card__body__icon--hide-columns",iconComponent:tf,fallback:"H",label:"Hide Columns"},[et.Transpose]:{iconClass:"step-card__body__icon--transpose",iconComponent:_O,fallback:"T",label:"Transpose"},[et.Parse]:{iconClass:"step-card__body__icon--parse",iconComponent:Ype,fallback:"P",label:"Parse"},[et.Rename]:{iconClass:"step-card__body__icon--rename",iconComponent:S2,fallback:"R",label:"Rename"},[et.GroupBy]:{iconClass:"step-card__body__icon--group",iconComponent:Kpe,fallback:"G",label:"Group By"},[et.Computed]:{iconClass:"step-card__body__icon--computed",fallback:"C",label:"Computed"}},Qpe={class:"step-card__number"},Jpe={class:"step-card__body"},eme={key:1},tme={class:"step-card__body__text"},nme={class:"step-card__body__text__name"},ome={class:"step-card__actions"},rme=le({__name:"DataTransformStepCard",props:{step:{},index:{},active:{type:Boolean},error:{}},emits:["select","delete"],setup(t){const e=t,n=S(()=>Zpe[e.step.type]),o=S(()=>n.value.iconClass),r=S(()=>n.value.iconComponent??null),i=S(()=>n.value.fallback),s=S(()=>n.value.label),a=S(()=>{const{step:l}=e;if(l.type===et.Sort&&l.config.column)return`${l.config.column} ${l.config.direction??Qt.Ascending}`;if(l.type===et.Filter&&l.config.column)return`${l.config.column} ${l.config.condition??go.Equals} ${l.config.value??""}`;if(l.type===et.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===et.Transpose)return"Swap rows ↔ columns";if(l.type===et.Parse&&l.config.column&&l.config.operation)return`${l.config.column} → ${l.config.operation}`;if(l.type===et.Rename&&l.config.column&&l.config.newName)return`${l.config.column} → ${l.config.newName}`;if(l.type===et.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:Me(["step-card",{"step-card--active":t.active,"step-card--error":t.error}]),onClick:c[2]||(c[2]=u=>l.$emit("select"))},[T("div",Qpe,xe(t.index+1),1),T("div",Jpe,[T("span",{class:Me(["step-card__body__icon",p(o)])},[p(r)?(w(),K(on(p(r)),{key:0})):(w(),R("span",eme,xe(p(i)),1))],2),T("div",tme,[T("div",nme,xe(p(s)),1),T("div",{class:Me(["step-card__body__text__desc",{"step-card__body__text__desc--error":t.error}])},xe(t.error||p(a)),3)])]),T("div",ome,[T("button",{class:"step-card__actions__btn","aria-label":"Remove step",onClick:c[0]||(c[0]=vn(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]=vn(()=>{},["stop"]))},[Se(l.$slots,"default",{},void 0,!0)])):ae("",!0)],2))}}),ime=Le(rme,[["__scopeId","data-v-4ba65e45"]]),sme={class:"group-by-step"},ame={class:"group-by-step__field"},lme={class:"group-by-step__field__columns"},cme=["checked","onChange"],ume={key:0,class:"group-by-step__field"},dme={class:"group-by-step__field__agg-list"},fme={class:"group-by-step__field__agg-list__row"},hme={class:"group-by-step__field__agg-list__row__check"},pme=["checked"],mme={class:"group-by-step__field__agg-list__row__check"},gme=["checked","onChange"],vme=["value","onChange"],bme=le({__name:"DataTransformStepGroupBy",props:{step:{},columns:{},columnTypes:{}},setup(t){const e=t,{updateStep:n}=Mr(),o=S(()=>e.step.config.groupColumns?e.step.config.groupColumns.split(",").map(b=>b.trim()).filter(Boolean):[]),r=S(()=>e.columns.filter(b=>!o.value.includes(b))),i=S(()=>e.step.config.aggregates?e.step.config.aggregates.split(",").map(b=>b.trim()).filter(Boolean).map(b=>{const g=b.lastIndexOf(":");return g<0?null:{col:b.slice(0,g),fn:b.slice(g+1)}}).filter(b=>b!==null):[]),s=S(()=>i.value.some(b=>b.fn==="count"));function a(b){return i.value.some(g=>g.col===b&&g.fn!=="count")}function l(b){const g=i.value.find(v=>v.col===b&&v.fn!=="count");return(g==null?void 0:g.fn)??"sum"}function c(b){return b.map(g=>`${g.col}:${g.fn}`).join(",")}function u(b,g){const v={...e.step.config};b.length>0?v.groupColumns=b.join(","):delete v.groupColumns,g.length>0?v.aggregates=c(g):delete v.aggregates,n(e.step.id,v)}function d(b){const g=[...o.value],v=g.indexOf(b);v>=0?g.splice(v,1):g.push(b);const y=i.value.filter(x=>x.fn==="count"||!g.includes(x.col));u(g,y)}function f(){const b=[...i.value],g=b.findIndex(v=>v.fn==="count");g>=0?b.splice(g,1):b.push({col:"rows",fn:"count"}),u(o.value,b)}function h(b){const g=[...i.value],v=g.findIndex(y=>y.col===b&&y.fn!=="count");v>=0?g.splice(v,1):g.push({col:b,fn:"sum"}),u(o.value,g)}function m(b,g){const v=i.value.map(y=>y.col===b&&y.fn!=="count"?{...y,fn:g}:y);u(o.value,v)}return(b,g)=>(w(),R("div",sme,[T("div",ame,[g[0]||(g[0]=T("label",{class:"group-by-step__field__label"},"Group by",-1)),T("div",lme,[(w(!0),R(Ne,null,gt(t.columns,v=>(w(),R("label",{key:v,class:"group-by-step__field__columns__column"},[T("input",{type:"checkbox",checked:p(o).includes(v),onChange:y=>d(v)},null,40,cme),Ge(" "+xe(v),1)]))),128))])]),p(r).length>0||p(o).length>0?(w(),R("div",ume,[g[4]||(g[4]=T("label",{class:"group-by-step__field__label"},"Aggregates",-1)),T("div",dme,[T("div",fme,[T("label",hme,[T("input",{type:"checkbox",checked:p(s),onChange:f},null,40,pme),g[1]||(g[1]=Ge(" Row count ",-1))]),g[2]||(g[2]=T("span",{class:"group-by-step__field__agg-list__row__fn-label"},"count",-1))]),(w(!0),R(Ne,null,gt(p(r),v=>(w(),R("div",{key:v,class:"group-by-step__field__agg-list__row"},[T("label",mme,[T("input",{type:"checkbox",checked:a(v),onChange:y=>h(v)},null,40,gme),Ge(" "+xe(v),1)]),a(v)?(w(),R("select",{key:0,class:"group-by-step__field__agg-list__row__fn",value:l(v),onChange:y=>m(v,y.target.value)},[...g[3]||(g[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,vme)):ae("",!0)]))),128))])])):ae("",!0)]))}}),yme=Le(bme,[["__scopeId","data-v-c53de076"]]),xme={class:"data-transform-step-rename"},wme=le({__name:"DataTransformStepRename",props:{step:{},columns:{}},setup(t){const e=t,{updateStep:n}=Mr(),o=S(()=>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",xme,[H(p(Dn),{"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(cm),{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"])]))}}),_me=Le(wme,[["__scopeId","data-v-5f4cb34e"]]),Sme={class:"data-transform-step-parse"},kme=le({__name:"DataTransformStepParse",props:{step:{},columns:{}},setup(t){var b;const e=t,{updateStep:n}=Mr(),o=S(()=>e.columns.map(g=>({value:g,label:g}))),r=[{value:"type",label:"Type Conversions"},{value:"string",label:"String"},{value:"numeric",label:"Numeric"},{value:"date",label:"Date/Time"}],i=S(()=>Yh.find(g=>g.id===e.step.config.operation)),s=De(((b=i.value)==null?void 0:b.category)??"type");He(()=>e.step.config.operation,g=>{if(g){const v=Yh.find(y=>y.id===g);v&&(s.value=v.category)}});const a=S(()=>Yh.filter(g=>g.category===s.value).map(g=>({value:g.id,label:g.label,description:g.description}))),l=S(()=>{var g;return((g=i.value)==null?void 0:g.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(g){return c[g]??g}function f(g){return u[g]??""}function h(g){s.value=g;const v={...e.step.config};delete v.operation,n(e.step.id,v)}function m(g,v){n(e.step.id,{...e.step.config,[g]:v})}return(g,v)=>(w(),R("div",Sme,[H(p(Dn),{"model-value":t.step.config.column??"",label:"Column",placeholder:"Select a column",options:p(o),block:"","onUpdate:modelValue":v[0]||(v[0]=y=>m("column",y))},null,8,["model-value","options"]),H(p(Dn),{"model-value":p(s),label:"Category",options:r,block:"","onUpdate:modelValue":h},null,8,["model-value"]),H(p(Dn),{"model-value":t.step.config.operation??"",label:"Operation",placeholder:"Select an operation",options:p(a),block:"","onUpdate:modelValue":v[1]||(v[1]=y=>m("operation",y))},null,8,["model-value","options"]),p(l).length>0?(w(!0),R(Ne,{key:0},gt(p(l),y=>(w(),K(p(cm),{id:`parse-${y}`,key:y,"model-value":t.step.config[y]??"",label:d(y),placeholder:f(y),"onUpdate:modelValue":x=>m(y,x)},null,8,["id","model-value","label","placeholder","onUpdate:modelValue"]))),128)):ae("",!0)]))}}),Cme=Le(kme,[["__scopeId","data-v-37e3f025"]]),Ame={class:"data-transform-step-hide-columns"},$me={class:"data-transform-step-hide-columns__field"},Tme={class:"data-transform-step-hide-columns__field__columns"},Mme=["checked","onChange"],Ome=le({__name:"DataTransformStepHideColumns",props:{step:{},columns:{}},setup(t){const e=t,{updateStep:n}=Mr(),o=S(()=>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",Ame,[T("div",$me,[s[0]||(s[0]=T("label",{class:"data-transform-step-hide-columns__field__label"},"Hide columns",-1)),T("div",Tme,[(w(!0),R(Ne,null,gt(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,Mme),Ge(" "+xe(a),1)]))),128))])])]))}}),Bme=Le(Ome,[["__scopeId","data-v-a74ff0f2"]]),Lme={class:"data-transform-step-filter"},Pme=le({__name:"DataTransformStepFilter",props:{step:{},columns:{}},setup(t){const e=t,{updateStep:n}=Mr(),o=S(()=>e.columns.map(s=>({value:s,label:s}))),r=[{value:go.Equals,label:"Equals"},{value:go.NotEquals,label:"Not equals"},{value:go.Contains,label:"Contains"},{value:go.GreaterThan,label:"Greater than"},{value:go.LessThan,label:"Less than"}];function i(s,a){n(e.step.id,{...e.step.config,[s]:a})}return(s,a)=>(w(),R("div",Lme,[H(p(Dn),{"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(Dn),{"model-value":t.step.config.condition??p(go).Equals,label:"Condition",options:r,block:"","onUpdate:modelValue":a[1]||(a[1]=l=>i("condition",l))},null,8,["model-value"]),H(p(cm),{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"])]))}}),Dme=Le(Pme,[["__scopeId","data-v-65704d71"]]),Eme={class:"data-transform-step-sort"},Ime={class:"data-transform-step-sort__field"},Rme={class:"data-transform-step-sort__field__columns"},Nme=["checked","onChange"],Fme=le({__name:"DataTransformStepSort",props:{step:{},columns:{},columnTypes:{}},setup(t){const e=t,{updateStep:n}=Mr(),o=S(()=>e.step.config.columns?e.step.config.columns.split(",").map(c=>c.trim()).filter(Boolean):e.step.config.column?[e.step.config.column]:[]),r=S(()=>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(m=>{const b=e.columns.indexOf(m);return b>=0&&e.columnTypes[b]==="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",Eme,[T("div",Ime,[u[2]||(u[2]=T("label",{class:"data-transform-step-sort__field__label"},"Sort by",-1)),T("div",Rme,[(w(!0),R(Ne,null,gt(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,Nme),Ge(" "+xe(d),1)]))),128))])]),p(o).length>1&&p(r)?(w(),K(p(An),{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"])):ae("",!0),H(p(An),{"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"])]))}}),Vme=Le(Fme,[["__scopeId","data-v-73ae8834"]]),zme={},Hme={class:"pipeline-connector"};function Wme(t,e){return w(),R("div",Hme)}const Ume=Le(zme,[["render",Wme],["__scopeId","data-v-a3406500"]]),Gme={class:"source-block"},qme={class:"source-block__meta"},Yme=le({__name:"DataTransformSourceBlock",props:{columns:{},rows:{},label:{default:"Raw Data"}},setup(t){return(e,n)=>(w(),R("div",Gme,[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,xe(t.label),1),T("span",qme,xe(t.columns)+" cols · "+xe(t.rows)+" rows",1)]))}}),jme=Le(Yme,[["__scopeId","data-v-6b491dca"]]),Xme={class:"pipeline","data-testid":"transform-pipeline"},Kme={key:6,class:"pipeline__config-info"},Zme={key:7,class:"text-muted text-center py-3"},Qme=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}=Mr(),{activeScene:u,activeIndex:d,scenes:f}=bn(),h=S(()=>{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}`}`}),m=De(""),b=Ie(new Set),g=S(()=>r.value.findIndex(N=>N.id===m.value)),v=S(()=>g.value<0?{columns:[],columnTypes:[]}:l(g.value,e.value,n.value,o.value)),y=S(()=>v.value.columns),x=S(()=>v.value.columnTypes),_=S(()=>{const N={};for(let k=0;k<r.value.length;k++){const A=r.value[k];if(b.value.has(A.id)){N[A.id]=null;continue}const B=l(k,e.value,n.value,o.value);N[A.id]=c(A,B.columns,B.columnTypes)}return N}),C=S(()=>a(e.value,n.value,o.value)),L=S(()=>C.value.columns.length),O=S(()=>C.value.rows.length);function $(N){const k=m.value;k&&k!==N&&b.value.delete(k),m.value=N}function M(N){const k=i(N);b.value.add(k),$(k)}function D(N){b.value.delete(N),s(N),m.value===N&&(m.value=r.value.length>0?r.value[r.value.length-1].id:"")}return(N,k)=>{const A=jme,B=Ume,P=Vme,F=Dme,z=Bme,V=Cme,G=_me,ie=yme,ce=ime,he=Ipe,Z=Tpe;return w(),R("div",Xme,[H(A,{columns:p(e).length,rows:p(n).length,label:p(h)},null,8,["columns","rows","label"]),(w(!0),R(Ne,null,gt(p(r),(oe,se)=>(w(),R(Ne,{key:oe.id},[H(B),H(ce,{step:oe,index:se,active:p(m)===oe.id,error:p(_)[oe.id],onSelect:re=>$(oe.id),onDelete:re=>D(oe.id)},{default:Q(()=>[oe.type===p(et).Sort?(w(),K(P,{key:0,step:oe,columns:p(y),"column-types":p(x)},null,8,["step","columns","column-types"])):oe.type===p(et).Filter?(w(),K(F,{key:1,step:oe,columns:p(y)},null,8,["step","columns"])):oe.type===p(et).HideColumns?(w(),K(z,{key:2,step:oe,columns:p(y)},null,8,["step","columns"])):oe.type===p(et).Parse?(w(),K(V,{key:3,step:oe,columns:p(y)},null,8,["step","columns"])):oe.type===p(et).Rename?(w(),K(G,{key:4,step:oe,columns:p(y)},null,8,["step","columns"])):oe.type===p(et).GroupBy?(w(),K(ie,{key:5,step:oe,columns:p(y),"column-types":p(x)},null,8,["step","columns","column-types"])):oe.type===p(et).Transpose?(w(),R("div",Kme," Transpose swaps rows and columns. The first column values become headers and column headers become the first column. ")):(w(),R("div",Zme," Coming soon "))]),_:2},1032,["step","index","active","error","onSelect","onDelete"])],64))),128)),H(B),H(he,{onAdd:M}),H(B),H(Z,{columns:p(L),rows:p(O)},null,8,["columns","rows"])])}}}),Jme=Le(Qme,[["__scopeId","data-v-b653c7ed"]]),ege=[0,.30103,.17609,.12494,.09691,.07918,.06695,.05799,.05115,.04576],SO=10,tge=.1;function nge(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 oge(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>=SO}function kO(t,e,n){const o=[];let r=!1;for(let i=0;i<t.length;i++){if(!oge(n[i],e,i))continue;const s=new Array(10).fill(0);let a=0;for(const c of e){const u=nge(c[i]);u!==null&&(s[u]++,a++)}if(a<SO)continue;r=!0;let l=!1;for(let c=1;c<=9;c++){const u=s[c]/a;if(Math.abs(u-ege[c])>tge){l=!0;break}}l&&o.push(t[i])}return{pass:o.length===0,suspicious:o,eligible:r}}const rge={class:"data-column-settings"},ige={class:"data-column-settings__field"},sge={class:"data-column-settings__section"},age={class:"data-column-settings__section__detections"},lge={class:"data-column-settings__section__detections__item data-column-settings__section__detections__item--success"},cge={class:"data-column-settings__section__detections__item data-column-settings__section__detections__item--info"},uge={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},dge={key:0,d:"M20 6L9 17l-5-5"},fge={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"},hge={key:1,class:"data-column-settings__picker"},pge=le({__name:"DataColumnSettings",setup(t){const e=Or(),{selectedColumnIndex:n}=At(e),{selectColumn:o}=e,{columns:r,rows:i,columnTypes:s,setColumnType:a}=Ko(),l=De("string"),c=[{value:"string",label:"String"},{value:"number",label:"Number"},{value:"date",label:"Date"}];He(n,v=>{v>=0&&v<r.value.length&&(l.value=s.value[v]??"string")},{immediate:!0});function u(v){a(n.value,v)}const d=S(()=>r.value.map((v,y)=>({value:String(y),label:v})));function f(v){o(parseInt(v,10))}const h=S(()=>{const v=n.value;if(v<0)return{unique:0,total:0};const y=i.value.map(_=>_[v]??"").filter(_=>_.length>0);return{unique:new Set(y).size,total:y.length}}),m=S(()=>{const{unique:v,total:y}=h.value;return v===y?`${v} unique values — no duplicates`:`${y-v} duplicates found`}),b=S(()=>{const v=s.value[n.value];return v==="number"?"Numeric measure detected":v==="date"?"Date axis detected":"Categorical dimension detected"}),g=S(()=>{const v=n.value;if(v<0)return null;const y=r.value[v],x=kO([y],i.value.map(_=>[_[v]]),[s.value[v]]);return x.eligible?{pass:x.pass,label:x.pass?"Follows Benford's law":"Doesn't follow Benford's law"}:null});return(v,y)=>(w(),R("div",rge,[p(n)>=0&&p(n)<p(r).length?(w(),R(Ne,{key:0},[T("div",ige,[y[1]||(y[1]=T("div",{class:"data-column-settings__field__label"}," Type ",-1)),H(p(Dn),{modelValue:p(l),"onUpdate:modelValue":[y[0]||(y[0]=x=>Ke(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",sge,[y[4]||(y[4]=T("div",{class:"data-column-settings__section__title"}," Detections ",-1)),T("div",age,[T("span",lge,[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)),Ge(" "+xe(p(m)),1)]),T("span",cge,[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)),Ge(" "+xe(p(b)),1)]),p(g)?(w(),R("span",{key:0,class:Me(["data-column-settings__section__detections__item",p(g).pass?"data-column-settings__section__detections__item--success":"data-column-settings__section__detections__item--warn"])},[(w(),R("svg",uge,[p(g).pass?(w(),R("path",dge)):(w(),R("path",fge))])),Ge(" "+xe(p(g).label),1)],2)):ae("",!0)])])],64)):(w(),R("div",hge,[y[6]||(y[6]=T("div",{class:"data-column-settings__picker__label"}," Column ",-1)),H(p(Dn),{"model-value":"",label:"",options:p(d),block:"",placeholder:"Select a column…","onUpdate:modelValue":f},null,8,["options"])]))]))}}),mge=Le(pge,[["__scopeId","data-v-fadb97cc"]]),gge={key:0,class:"data-check-empty"},vge={key:1,class:"data-check-table"},bge={class:"data-check-table__col-header__name"},yge={class:"data-check-table__col-header__type"},xge=le({__name:"DataCheckTable",setup(t){const e=Or(),{selectedColumnIndex:n}=At(e),{selectColumn:o}=e,{displayColumns:r,displayRows:i,displayColumnTypes:s}=Ko(),a=S(()=>i.value.length===0);return(l,c)=>p(a)?(w(),R("div",gge,[H(p(Sy),{class:"data-check-empty__icon"}),c[0]||(c[0]=T("p",null,"No rows match your filters",-1))])):(w(),R("div",vge,[H(p(KD),{hover:"",bordered:""},{default:Q(()=>[H(p(nE),null,{default:Q(()=>[H(p(zw),null,{default:Q(()=>[H(p(Vw),{class:"data-check-table__row-num"},{default:Q(()=>[...c[1]||(c[1]=[Ge(" # ",-1)])]),_:1}),(w(!0),R(Ne,null,gt(p(r),(u,d)=>(w(),K(p(Vw),{key:d,class:Me(["data-check-table__col-header",{"data-check-table__col--selected":d===p(n)}]),onClick:f=>p(o)(d)},{default:Q(()=>[T("div",bge,xe(u),1),T("div",yge,xe(p(s)[d]??"string"),1)]),_:2},1032,["class","onClick"]))),128))]),_:1})]),_:1}),H(p(ZD),null,{default:Q(()=>[(w(!0),R(Ne,null,gt(p(i),(u,d)=>(w(),K(p(zw),{key:d},{default:Q(()=>[H(p(Fw),{class:"data-check-table__row-num"},{default:Q(()=>[Ge(xe(d+1),1)]),_:2},1024),(w(!0),R(Ne,null,gt(u,(f,h)=>(w(),K(p(Fw),{key:h,class:Me({"data-check-table__col--selected":h===p(n),"data-check-table__cell--numeric":p(s)[h]==="number"})},{default:Q(()=>[Ge(xe(f),1)]),_:2},1032,["class"]))),128))]),_:2},1024))),128))]),_:1})]),_:1})]))}}),wge=Le(xge,[["__scopeId","data-v-670500db"]]),_ge={class:"data-insight-badges"},Sge={class:"data-insight-badge data-insight-badge--shape"},kge={class:"data-insight-badge__icon"},Cge={class:"data-insight-badge__icon"},Age=le({__name:"DataInsightBadges",props:{columns:{},rows:{},columnTypes:{}},setup(t){const e=t,n=ft("benfordBadgeRef"),o=S(()=>{let d=0;for(const f of e.rows)for(let h=0;h<e.columns.length;h++){const m=f[h];(m==null||m==="")&&d++}return d}),r=S(()=>o.value===0?"✓":"⚠"),i=S(()=>o.value===0?"No missing values":`${o.value} missing value${o.value===1?"":"s"}`),s=S(()=>o.value===0?"data-insight-badge--quality-ok":"data-insight-badge--quality-warn"),a=S(()=>{const d=kO(e.columns,e.rows,e.columnTypes);return d.eligible?d:null}),l=S(()=>{var d;return(d=a.value)!=null&&d.pass?"✓":"⚠"}),c=S(()=>{var d;return(d=a.value)!=null&&d.pass?"data-insight-badge--benford-ok":"data-insight-badge--benford-warn"}),u=S(()=>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",_ge,[T("span",Sge,xe(t.columns.length)+" cols · "+xe(t.rows.length)+" rows ",1),T("span",{class:Me(["data-insight-badge",p(s)])},[T("span",kge,xe(p(r)),1),Ge(" "+xe(p(i)),1)],2),p(a)?(w(),R("span",{key:0,ref_key:"benfordBadgeRef",ref:n,class:Me(["data-insight-badge",p(c)])},[T("span",Cge,xe(p(l)),1),f[0]||(f[0]=Ge(" Benford's law ",-1)),H(p(Id),{"teleport-to":"body",target:p(n),title:p(u),placement:"top"},null,8,["target","title"])],2)):ae("",!0)]))}}),$ge=Le(Age,[["__scopeId","data-v-d0fa5a33"]]),Tge={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Mge(t,e){return w(),R("svg",Tge,[...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 Oge=$e({name:"ph-columns",render:Mge}),Bge={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Lge(t,e){return w(),R("svg",Bge,[...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 Pge=$e({name:"ph-flow-arrow",render:Lge}),Dge={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Ege(t,e){return w(),R("svg",Dge,[...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 Ige=$e({name:"ph-lightbulb",render:Ege}),Rge=le({__name:"DataSideIconRail",props:{horizontal:{type:Boolean},disabledTabs:{default:()=>[]}},setup(t){const e=t,n=Or(),{dataPanelTab:o}=At(n),{openDataPanel:r}=n,{mode:i,toggleMode:s}=Zl(),a=[{value:"column",icon:Oge,tooltip:"Columns"},{value:"transforms",icon:Pge,tooltip:"Transforms"},{value:"parsing",icon:J$,tooltip:"Parsing"},{value:"reco",icon:Ige,tooltip:"Recommendations"}],l=S(()=>a.filter(d=>!e.disabledTabs.includes(d.value)));function c(d){r(d)}function u(){i.value==="closed"&&r(o.value||"column"),s()}return(d,f)=>{const h=T2;return w(),K(h,{horizontal:t.horizontal,"active-tab":p(o),items:p(l),onSelect:c,onToggleMode:u},null,8,["horizontal","active-tab","items"])}}}),Nge={class:"data-structure-panel__main__pills-bar"},Fge={key:0,class:"data-structure-panel__main__scene-banner"},Vge=le({__name:"DataStructurePanel",setup(t){const{columns:e,rows:n,columnTypes:o}=Ko(),r=Or(),{dataPanelOpen:i,dataPanelTab:s}=At(r),{openDataPanel:a,closeDataPanel:l,setDataView:c}=r,{mode:u}=Zl(),{activeScene:d,activeIndex:f,scenes:h}=bn(),m=S(()=>d.value!==null),b=S(()=>Rne(h.value,f.value)),g=S(()=>{const k=b.value;if(k===f.value)return"Custom data on this scene.";if(k>=0){const A=h.value[k];return`Data inherited from ${(A==null?void 0:A.name)||`Scene ${k+1}`}.`}return"Scene override active."}),v=S(()=>{const k=b.value;return k===f.value?"This scene uses its own data, independent of the base dataset.":k>=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 y(){c("upload")}const{isNarrow:x}=Wl(),_=ft("mainRef"),C=[{key:"column",label:"Columns"},{key:"transforms",label:"Transforms"},{key:"parsing",label:"Parsing"},{key:"reco",label:"Recommendations"}],L=S(()=>m.value?["parsing"]:[]),O=S(()=>m.value?C.filter(k=>k.key!=="parsing"):C),$=S({get:()=>!!s.value,set:k=>{k||l()}}),M={column:"Column Settings",transforms:"Transforms",parsing:"Parsing",reco:"Recommendations"},D=S(()=>M[s.value]??"Panel"),N=S(()=>({"data-structure-panel--narrow":x.value}));return(k,A)=>{const B=Rge,P=$ge,F=wge,z=$2,V=mge,G=Jme,ie=kpe,ce=bpe,he=C2,Z=Zm;return w(),R("div",{class:Me(["data-structure-panel",p(N)])},[p(x)?(w(),K(B,{key:0,horizontal:"","disabled-tabs":p(L)},null,8,["disabled-tabs"])):ae("",!0),T("div",{ref_key:"mainRef",ref:_,class:"data-structure-panel__main"},[T("div",Nge,[p(m)?(w(),R("div",Fge,[T("strong",null,xe(p(g)),1),Ge(" "+xe(p(v)),1)])):(w(),K(P,{key:1,columns:p(e),rows:p(n),"column-types":p(o)},null,8,["columns","rows","column-types"])),H(p(Rn),{"icon-left":p(_O),label:"Replace data",variant:"outline-primary",size:"sm",onClick:y},null,8,["icon-left"])]),H(F)],512),p(i)?(w(),K(Z,{key:1,"drawer-open":p($),"onUpdate:drawerOpen":A[1]||(A[1]=oe=>Ke($)?$.value=oe:null),title:p(D),"container-ref":p(_),onClose:p(l)},xr({default:Q(()=>[p(s)==="column"?(w(),K(V,{key:0})):p(s)==="transforms"?(w(),K(G,{key:1})):p(s)==="parsing"?(w(),K(ie,{key:2})):p(s)==="reco"?(w(),K(ce,{key:3})):ae("",!0)]),_:2},[p(u)!=="docked"?{name:"tabs",fn:Q(()=>[H(z,{tabs:p(O),"model-value":p(s),sticky:"","onUpdate:modelValue":A[0]||(A[0]=oe=>p(a)(oe))},null,8,["tabs","model-value"])]),key:"0"}:void 0,p(u)!=="drawer"?{name:"footer",fn:Q(()=>[H(he)]),key:"1"}:void 0]),1032,["drawer-open","title","container-ref","onClose"])):ae("",!0),p(x)?ae("",!0):(w(),K(B,{key:2,"disabled-tabs":p(L)},null,8,["disabled-tabs"]))],2)}}}),zge=Le(Vge,[["__scopeId","data-v-20fccc24"]]),Hge={class:"samples-grid"},Wge=["onClick","onKeydown"],Uge={class:"sample-card__thumb"},Gge=["src","alt"],qge={class:"sample-card__info"},Yge={class:"sample-card__info__name"},jge={class:"sample-card__info__meta"},Xge=le({__name:"DataUploadSamples",emits:["select"],setup(t){const e={[Be.BarVertical]:"Columns",[Be.BarHorizontal]:"Bars",[Be.BarMulti]:"Grouped Columns",[Be.Line]:"Line",[Be.LineMulti]:"Lines",[Be.Donut]:"Donut",[Be.Pie]:"Pie",[Be.Area]:"Area",[Be.AreaStacked]:"Stacked Area",[Be.ColumnStacked]:"Stacked Columns",[Be.BarStacked]:"Stacked Bars",[Be.BarSplit]:"Split Bars",[Be.BarGrouped]:"Grouped Bars"};function n(i){const s=i.split(`
|
|
920
|
+
`).filter(a=>a.trim().length>0);return Math.max(0,s.length-1)}const o=sr(new Map),r=S(()=>i6.map(i=>({...i,typeLabel:e[i.chartType]??i.chartType,rowCount:n(i.tsvData),thumbSrc:o.get(i.id)})));return fn(()=>{for(const i of i6)if(i.dsl){const s=I$(i.dsl);s&&o.set(i.id,vc(s))}}),(i,s)=>(w(),R("div",Hge,[(w(!0),R(Ne,null,gt(p(r),a=>(w(),R("div",{key:a.id,class:"sample-card",role:"button",tabindex:"0",onClick:l=>i.$emit("select",a),onKeydown:tr(l=>i.$emit("select",a),["enter"])},[T("div",Uge,[a.thumbSrc?(w(),R("img",{key:0,class:"sample-card__thumb__img",src:a.thumbSrc,alt:a.title},null,8,Gge)):ae("",!0)]),T("div",qge,[T("div",Yge,xe(a.title),1),T("div",jge,[Ge(xe(a.typeLabel)+" ",1),s[0]||(s[0]=T("span",{class:"sample-card__info__meta__sep"},"·",-1)),Ge(" "+xe(a.rowCount)+" rows ",1)])])],40,Wge))),128))]))}}),Kge=Le(Xge,[["__scopeId","data-v-23920b61"]]),Zge=le({__name:"DataUploadFileDrop",emits:["loaded","bpc","dragState"],setup(t,{emit:e}){const n=e,o=Ie(null),r=De(!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 m;i(!1);const h=(m=f.dataTransfer)==null?void 0:m.files[0];h&&c(h)}function d(f){var b;const h=f.target,m=(b=h.files)==null?void 0:b[0];m&&c(m),h.value=""}return(f,h)=>(w(),R("div",{class:Me(["file-drop",{"file-drop--active":p(r)}]),onDragover:vn(s,["prevent"]),onDragleave:vn(a,["prevent"]),onDrop:vn(u,["prevent"]),onClick:h[1]||(h[1]=m=>{var b;return(b=p(o))==null?void 0:b.click()})},[h[2]||(h[2]=N9('<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]=vn(m=>{var b;return(b=p(o))==null?void 0:b.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))}}),Qge=Le(Zge,[["__scopeId","data-v-f6ebbbc1"]]),Jge={class:"upload-card"},eve={class:"input-card__tabs"},tve=["onClick"],nve={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},ove={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},rve={key:2,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},ive={key:1,class:"upload-card__paste"},sve={class:"upload-card__paste__wrap"},ave={key:0,class:"upload-card__paste__wrap__placeholder"},lve={class:"upload-card__paste__footer"},cve=["disabled"],uve=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}=bn();function c(){if(a.value<0)return!1;const v=Oa(l.value,a.value);return!!(v!=null&&v.data)}function u(){return c()?u6(i.value,s.value):(n==null?void 0:n.value)==="bpc"&&o.value.length>0?u6(o.value,r.value):e.value}const d=De("paste"),f=De(u()),h=ft("pasteArea"),m=De(!1);function b(v){var x;const y=(x=v.clipboardData)==null?void 0:x.getData("text/plain");y&&(v.preventDefault(),f.value=y,_n(()=>{h.value&&h.value.focus()}))}const g=[{value:"file",text:"File"},{value:"paste",text:"Paste"},{value:"samples",text:"Samples"}];return(v,y)=>{const x=Qge,_=Kge;return w(),R("div",Jge,[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]=C=>v.$emit("cancel"))}," ← Back to table ")):ae("",!0),T("div",{class:Me(["input-card",{"input-card--drag-over":p(m)}])},[T("div",eve,[(w(),R(Ne,null,gt(g,C=>T("button",{key:C.value,class:Me(["input-card__tabs__tab",{"input-card__tabs__tab--active":p(d)===C.value}]),onClick:L=>d.value=C.value},[C.value==="file"?(w(),R("svg",nve,[...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)])])):C.value==="paste"?(w(),R("svg",ove,[...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",rve,[...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)])])),Ge(" "+xe(C.text),1)],10,tve)),64))]),p(d)==="file"?(w(),K(x,{key:0,onLoaded:y[1]||(y[1]=(C,L)=>v.$emit("loaded",C,L)),onBpc:y[2]||(y[2]=(C,L)=>v.$emit("bpc",C,L)),onDragState:y[3]||(y[3]=C=>m.value=C)})):p(d)==="paste"?(w(),R("div",ive,[T("div",sve,[p(f)?ae("",!0):(w(),R("div",ave,[...y[10]||(y[10]=[Ge(" category Gold Silver Bronze",-1),T("br",null,null,-1),Ge(" USA 40 44 42",-1),T("br",null,null,-1),Ge(" China 38 32 19 ",-1)])])),ir(T("textarea",{ref_key:"pasteArea",ref:h,"onUpdate:modelValue":y[4]||(y[4]=C=>Ke(f)?f.value=C:null),class:"upload-card__paste__wrap__area",spellcheck:"false",onPaste:b},null,544),[[f0,p(f)]])]),T("div",lve,[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"),Ge(" paste from spreadsheet ")],-1)),T("button",{class:"upload-card__paste__footer__btn",disabled:!p(f).trim(),onClick:y[5]||(y[5]=C=>v.$emit("loaded",p(f),"Pasted"))}," Load data ",8,cve)])])):p(d)==="samples"?(w(),K(_,{key:2,onSelect:y[6]||(y[6]=C=>v.$emit("sample",C))})):ae("",!0)],2)])}}}),dve=Le(uve,[["__scopeId","data-v-b501779f"]]),fve=le({__name:"DataPanel",setup(t){const e=Or(),{dataView:n}=At(e),{setDataView:o}=e,r=Ko(),{applyDsl:i}=Oc(),{loadSample:s}=Rs(),{next:a}=k2(),l=At(wO()),{activeScene:c,activeIndex:u,update:d}=bn(),f=S(()=>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 v=z1(r.rawInput.value,{firstRowIsHeader:l.firstRowIsHeader.value,delimiter:l.delimiter.value,decimalSeparator:l.decimalSeparator.value,trimWhitespace:l.trimWhitespace.value});r.loadParsed(v)}function m(v,y){if(f.value&&u.value>=0){const x=z1(v,{firstRowIsHeader:l.firstRowIsHeader.value,delimiter:l.delimiter.value,decimalSeparator:l.decimalSeparator.value,trimWhitespace:l.trimWhitespace.value}),_=Km(x.columns,x.rows);d(u.value,{data:_}),o("structure");return}r.rawInput.value=v,r.sourceFormat.value="delimited",r.sourceLabel.value=y||"Pasted",h(),o("structure")}function b(v,y){i(v),r.sourceLabel.value=y||"Blueprint file",a()}function g(v){if(f.value&&u.value>=0){d(u.value,{data:v.serializedData}),o("structure");return}s(v),a()}return He([()=>l.firstRowIsHeader.value,()=>l.delimiter.value,()=>l.decimalSeparator.value,()=>l.trimWhitespace.value],()=>{r.rawInput.value&&n.value==="structure"&&h()}),(v,y)=>{const x=dve,_=zge;return w(),R("div",{class:Me(["data-panel",{"data-panel--structure":p(n)==="structure"}])},[p(n)==="upload"?(w(),K(x,{key:0,onLoaded:m,onBpc:b,onSample:g,onCancel:y[0]||(y[0]=C=>p(o)("structure"))})):(w(),K(_,{key:1}))],2)}}}),hve=Le(fve,[["__scopeId","data-v-4fa651c7"]]),pve={class:"layout-scene-timeline"},mve=le({__name:"LayoutSceneTimeline",setup(t){return(e,n)=>(w(),R("div",pve,[Se(e.$slots,"default",{},void 0,!0)]))}}),gve=Le(mve,[["__scopeId","data-v-0ba61bc0"]]),vve={class:"wizard-shell"},bve={class:"wizard-shell__title bc-display"},yve={class:"wizard-shell__main"},xve={class:"wizard-shell__content"},wve=le({__name:"WizardShell",setup(t){const{currentStep:e,currentIndex:n,steps:o,registerCreateSession:r}=k2(),i=Ko(),s=hn(),{sessionId:a,createSession:l,lastSavedAt:c}=Rs(),u=bn(),{scenes:d,activeIndex:f,playing:h,startPlayback:m,stopPlayback:b}=u,{baseOptions:g}=yn(),v=Mr(),y=Ie([]),x=S(()=>s._base.title.value||"Untitled chart"),_=S(()=>c.value?new Date(c.value):""),C=qI(_),L=S(()=>_.value?`saved ${C.value}`:null),O=o.map(Z=>({label:Z.label,key:Z.key})),$=S(()=>i.rows.value.length>0?[]:[1,2]);function M(){u.add(),u.setActive(d.value.length-1)}const D=Ie({}),N=[Be.BarVertical,Be.BarHorizontal,Be.Line,Be.VerticalBar,Be.HorizontalBar];function k(Z){var se,re,U;const oe=Xs(Z.dataStr);if((se=oe.series)!=null&&se.length&&N.includes(Z.chartType)){const te=oe.series.find(ne=>ne.name===s._base.selectedColumn.value);te&&(oe.values=te.values),delete oe.series}return w2(Z.chartType,oe,Z.typeOpts,Z.sort,{colorizes:(re=Z.colorizes)!=null&&re.length?Z.colorizes:void 0,seriesOverrides:(U=Z.seriesOverrides)!=null&&U.length?Z.seriesOverrides:void 0})}function A(Z,oe){var se;if((Z==null?void 0:Z.data)!==void 0)return Z.data;if((se=Z==null?void 0:Z.transforms)!=null&&se.length&&i.columns.value.length>0){const re=v.applyStepList(Z.transforms,i.columns.value,i.rows.value,i.columnTypes.value);return Km(re.columns,re.rows)}return oe}function B(){const Z=s._base,oe={};oe[0]=k({chartType:Z.chartType.value,dataStr:Z.data.value,typeOpts:g.value,sort:Z.sort.value,colorizes:Z.colorizes.value,seriesOverrides:Z.seriesOverrides.value});for(let se=0;se<d.value.length;se++){const re=Oa(d.value,se);oe[se+1]=k({chartType:(re==null?void 0:re.chartType)??Z.chartType.value,dataStr:A(re,Z.data.value),typeOpts:re!=null&&re.chartTypeOptions?{...g.value,...re.chartTypeOptions}:g.value,sort:C$(re)??Z.sort.value,colorizes:(re==null?void 0:re.colorizes)??Z.colorizes.value,seriesOverrides:(re==null?void 0:re.seriesOverrides)??Z.seriesOverrides.value})}D.value=oe}const P=BI(B,300);He([()=>d.value,s._base.chartType,s._base.data,s._base.sort,s._base.colorizes,s._base.seriesOverrides,s._base.selectedColumn,g,e],()=>{e.value.key==="edit"&&P()},{deep:!0});function F(Z){var U;const oe=s._base.title.value;if(Z<0)return oe||" ";const se=Oa(d.value,Z),re=(U=se==null?void 0:se.properties)==null?void 0:U.title;return re!==void 0?re||" ":oe||" "}const z=S(()=>{const Z=[{name:F(-1),index:0,removable:!1,thumbnail:D.value[0]??null}],oe=d.value.map((se,re)=>({name:F(re),index:re+1,removable:!0,thumbnail:D.value[re+1]??null}));return[...Z,...oe]}),V=S(()=>f.value+1);function G(Z){u.setActive(Z-1)}function ie(Z){Z<=0||u.remove(Z-1)}const ce=S(()=>{const Z=e.value.key;return Z==="export"?!1:Z==="edit"?!0:d.value.length>=1});He(f,(Z,oe)=>{var se,re;e.value.key==="data"&&(oe===-1&&Z>=0?(y.value=v.snapshot(),v.hydrate(((se=d.value[Z])==null?void 0:se.transforms)??[])):oe>=0&&Z===-1?(u.update(oe,{transforms:v.snapshot()}),v.hydrate(y.value)):oe>=0&&Z>=0&&(u.update(oe,{transforms:v.snapshot()}),v.hydrate(((re=d.value[Z])==null?void 0:re.transforms)??[])))}),fn(()=>{e.value.key==="edit"&&s._base.data.value&&B()});function he(){f.value>=0&&(u.update(f.value,{transforms:v.snapshot()}),v.hydrate(y.value),u.setActive(-1)),s._base.data.value=i.serialize();const Z=s._base.chartType.value,oe=Z.includes("multi")||Z.includes("stacked")||Z===Be.BarSplit||Z===Be.BarGrouped;if(i.columns.value.length>2&&!oe){const se=i.columnTypes.value[0]==="date";s._base.chartType.value=se?Be.LineMulti:Be.BarMulti}}return r(()=>(he(),l())),He(()=>e.value.key,(Z,oe)=>{oe==="data"&&Z==="edit"&&a.value&&he()}),XE(()=>{Kne()}),(Z,oe)=>{const se=hve,re=ipe,U=Bse;return w(),R("div",vve,[H(X$,{class:"wizard-shell__header"},{start:Q(()=>[T("h1",bve,xe(p(x)),1),p(L)?(w(),K(p(iy),{key:0,variant:"success",pill:"",class:"wizard-shell__saved",role:"status","aria-live":"polite"},{default:Q(()=>[oe[1]||(oe[1]=T("span",{class:"wizard-shell__saved__dot"},null,-1)),Ge(" "+xe(p(L)),1)]),_:1})):ae("",!0)]),center:Q(()=>[H(p(vW),{"current-step":p(n),"onUpdate:currentStep":oe[0]||(oe[0]=te=>Ke(n)?n.value=te:null),steps:p(O),"disabled-steps":p($)},null,8,["current-step","steps","disabled-steps"])]),_:1}),T("div",yve,[T("div",xve,[p(e).key==="data"?(w(),K(se,{key:0})):p(e).key==="edit"?(w(),K(re,{key:1})):p(e).key==="export"?(w(),K(U,{key:2})):ae("",!0)]),p(ce)?(w(),K(gve,{key:0},{default:Q(()=>[H(p(jU),{scenes:p(z),"active-index":p(V),playing:p(h),"onUpdate:activeIndex":G,onAdd:M,onRemove:ie,onPlay:p(m),onPause:p(b)},null,8,["scenes","active-index","playing","onPlay","onPause"])]),_:1})):ae("",!0)])])}}}),Lh=Le(wve,[["__scopeId","data-v-1b1bde9b"]]),_ve={class:"render-page"},Sve=le({__name:"RenderPage",setup(t){const e=zl(),n=ft("containerRef"),{applyDsl:o}=Oc();O2(n);const{layout:r}=hn(),{cardClass:i,cardStyle:s}=M2(r,"render-page__card"),{scenes:a,activeIndex:l,playing:c,setActive:u,nextScene:d,previousScene:f,startPlayback:h,stopPlayback:m}=bn(),b={buttons:g1,"progress-bar":wC,"dot-stepper":_C,"minimal-arrows":SC},g=S(()=>b[r.value.playerType]||g1),v=S(()=>a.value.length+1),y=S(()=>l.value+2),x=S(()=>a.value.length>=1);function _($){u($-2)}const C=Ie(null);function L(){var $;return(($=n.value)==null?void 0:$.querySelector(".bc-frame-footer"))??null}let O=null;return He(n,$=>{if(O&&(O.disconnect(),O=null),!$){C.value=null;return}C.value=L(),O=new MutationObserver(()=>{C.value=L()}),O.observe($,{childList:!0,subtree:!0})},{immediate:!0}),Ds(()=>{O&&(O.disconnect(),O=null)}),fn(()=>{const $=e.query.bpc64;if($)try{const M=globalThis.atob($),D=Uint8Array.from(M,k=>k.charCodeAt(0)),N=new TextDecoder().decode(D);o(N)}catch{}}),($,M)=>(w(),R("div",_ve,[T("div",{ref_key:"containerRef",ref:n,class:Me(["render-page__card",p(i)]),style:Ot(p(s))},null,6),p(C)&&p(x)?(w(),K(zp,{key:0,to:p(C)},[(w(),K(on(p(g)),{total:p(v),current:p(y),playing:p(c),position:p(r).playerPosition,"onUpdate:current":_,onPrevious:p(f),onNext:p(d),onPlay:p(h),onPause:p(m)},null,40,["total","current","playing","position","onPrevious","onNext","onPlay","onPause"]))],8,["to"])):ae("",!0)]))}}),kve=Le(Sve,[["__scopeId","data-v-76a513dd"]]);function Rv(t){const{sessionId:e,loadChart:n,startAutoSave:o}=Rs();if(e.value===t.params.id)return;if(!n(t.params.id))return"/charts";o()}function Cve(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 Ave=SI({history:tI(),scrollBehavior(t,e,n){return n||(t.hash?{el:t.hash,behavior:"smooth"}:{top:0})},routes:[{path:"/",component:()=>v6(()=>import("./LandingPage-BSxJZaea.js"),__vite__mapDeps([0,1]))},{path:"/charts",component:Ure},{path:"/new",component:Lh,beforeEnter:()=>{const{prepareNew:t}=Rs();t()}},{path:"/edit/:id",redirect:t=>`/edit/${t.params.id}/visualize`},{path:"/copy/:base64",component:()=>v6(()=>import("./CopyRedirect-CEpRBvCY.js"),[]),meta:{bare:!0},beforeEnter:t=>{const e=Cve(String(t.params.base64??""));if(!e)return"/";const{createFromDsl:n}=Rs(),o=n(e);if(!o)return"/";t.meta.copyTarget=`/edit/${o}/visualize`}},{path:"/edit/:id/data",component:Lh,beforeEnter:Rv},{path:"/edit/:id/visualize",component:Lh,beforeEnter:Rv},{path:"/edit/:id/export",component:Lh,beforeEnter:Rv},{path:"/render",component:kve,meta:{bare:!0}}]}),CO=$L();CO.use(RL);kL(Boe).use(CO).use(Ave).use(mE()).mount("#app");export{zl as $,vf as A,Rn as B,Me as C,Se as D,ae as E,Ne as F,K as G,wle as H,aoe as I,cT as J,fT as K,Ype as L,S2 as M,_O as N,De as O,Lve as P,Tve as Q,He as R,zr as S,Ds as T,Cse as U,zp as V,g1 as W,Ie as X,b2 as Y,R4 as Z,Le as _,T as a,H as b,R as c,le as d,p as e,Ge as f,gy as g,S as h,uy as i,y$ as j,tne as k,x$ as l,Qte as m,Xte as n,w as o,Mve as p,ft as q,Up as r,i6 as s,Ft as t,_u as u,iy as v,Q as w,gt as x,xe as y,$e as z};
|