@blueprint-chart/editor 0.1.29 → 0.1.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{CopyRedirect-Nr523Dpk.js → CopyRedirect-CZMEmM8M.js} +1 -1
- package/dist/assets/{LandingPage-BtljKIAn.js → LandingPage-mQMQYQqJ.js} +1 -1
- package/dist/assets/index-dPXN_1BF.js +927 -0
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/index-CC_7c2tM.js +0 -859
|
@@ -0,0 +1,927 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LandingPage-mQMQYQqJ.js","assets/LandingPage-DwbySIyi.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
var K9=Object.defineProperty;var X9=(t,e,n)=>e in t?K9(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var xn=(t,e,n)=>X9(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 xy(t){const e=Object.create(null);for(const n of t.split(","))e[n]=1;return n=>n in e}const Gt={},Uc=[],yi=()=>{},jS=()=>!1,om=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),wy=t=>t.startsWith("onUpdate:"),Vn=Object.assign,_y=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},Z9=Object.prototype.hasOwnProperty,Qt=(t,e)=>Z9.call(t,e),ft=Array.isArray,Gc=t=>zf(t)==="[object Map]",Pu=t=>zf(t)==="[object Set]",_w=t=>zf(t)==="[object Date]",wt=t=>typeof t=="function",yn=t=>typeof t=="string",Si=t=>typeof t=="symbol",Xt=t=>t!==null&&typeof t=="object",KS=t=>(Xt(t)||wt(t))&&wt(t.then)&&wt(t.catch),XS=Object.prototype.toString,zf=t=>XS.call(t),Q9=t=>zf(t).slice(8,-1),ZS=t=>zf(t)==="[object Object]",rm=t=>yn(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Pd=xy(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),im=t=>{const e=Object.create(null);return(n=>e[n]||(e[n]=t(n)))},J9=/-\w/g,Or=im(t=>t.replace(J9,e=>e.slice(1).toUpperCase())),eL=/\B([A-Z])/g,aa=im(t=>t.replace(eL,"-$1").toLowerCase()),sm=im(t=>t.charAt(0).toUpperCase()+t.slice(1)),ev=im(t=>t?`on${sm(t)}`:""),rr=(t,e)=>!Object.is(t,e),lp=(t,...e)=>{for(let n=0;n<t.length;n++)t[n](...e)},QS=(t,e,n,o=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:o,value:n})},am=t=>{const e=parseFloat(t);return isNaN(e)?t:e},tL=t=>{const e=yn(t)?Number(t):NaN;return isNaN(e)?t:e};let kw;const lm=()=>kw||(kw=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Lt(t){if(ft(t)){const e={};for(let n=0;n<t.length;n++){const o=t[n],r=yn(o)?iL(o):Lt(o);if(r)for(const i in r)e[i]=r[i]}return e}else if(yn(t)||Xt(t))return t}const nL=/;(?![^(]*\))/g,oL=/:([^]+)/,rL=/\/\*[^]*?\*\//g;function iL(t){const e={};return t.replace(rL,"").split(nL).forEach(n=>{if(n){const o=n.split(oL);o.length>1&&(e[o[0].trim()]=o[1].trim())}}),e}function Te(t){let e="";if(yn(t))e=t;else if(ft(t))for(let n=0;n<t.length;n++){const o=Te(t[n]);o&&(e+=o+" ")}else if(Xt(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}function jn(t){if(!t)return null;let{class:e,style:n}=t;return e&&!yn(e)&&(t.class=Te(e)),n&&(t.style=Lt(n)),t}const sL="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",aL=xy(sL);function JS(t){return!!t||t===""}function lL(t,e){if(t.length!==e.length)return!1;let n=!0;for(let o=0;n&&o<t.length;o++)n=Ra(t[o],e[o]);return n}function Ra(t,e){if(t===e)return!0;let n=_w(t),o=_w(e);if(n||o)return n&&o?t.getTime()===e.getTime():!1;if(n=Si(t),o=Si(e),n||o)return t===e;if(n=ft(t),o=ft(e),n||o)return n&&o?lL(t,e):!1;if(n=Xt(t),o=Xt(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||!Ra(t[s],e[s]))return!1}}return String(t)===String(e)}function ky(t,e){return t.findIndex(n=>Ra(n,e))}const e3=t=>!!(t&&t.__v_isRef===!0),pe=t=>yn(t)?t:t==null?"":ft(t)||Xt(t)&&(t.toString===XS||!wt(t.toString))?e3(t)?pe(t.value):JSON.stringify(t,t3,2):String(t),t3=(t,e)=>e3(e)?t3(t,e.value):Gc(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[o,r],i)=>(n[tv(o,i)+" =>"]=r,n),{})}:Pu(e)?{[`Set(${e.size})`]:[...e.values()].map(n=>tv(n))}:Si(e)?tv(e):Xt(e)&&!ft(e)&&!ZS(e)?String(e):e,tv=(t,e="")=>{var n;return Si(t)?`Symbol(${(n=t.description)!=null?n:e})`:t};function cL(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 xo;class n3{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=xo,!e&&xo&&(this.index=(xo.scopes||(xo.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=xo;try{return xo=this,e()}finally{xo=n}}}on(){++this._on===1&&(this.prevScope=xo,xo=this)}off(){this._on>0&&--this._on===0&&(xo=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 cm(t){return new n3(t)}function sc(){return xo}function Fa(t,e=!1){xo&&xo.cleanups.push(t)}let fn;const nv=new WeakSet;class o3{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,xo&&xo.active&&xo.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,nv.has(this)&&(nv.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||i3(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Sw(this),s3(this);const e=fn,n=xi;fn=this,xi=!0;try{return this.fn()}finally{a3(this),fn=e,xi=n,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Ay(e);this.deps=this.depsTail=void 0,Sw(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?nv.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){k1(this)&&this.run()}get dirty(){return k1(this)}}let r3=0,Dd,Ed;function i3(t,e=!1){if(t.flags|=8,e){t.next=Ed,Ed=t;return}t.next=Dd,Dd=t}function Sy(){r3++}function Cy(){if(--r3>0)return;if(Ed){let e=Ed;for(Ed=void 0;e;){const n=e.next;e.next=void 0,e.flags&=-9,e=n}}let t;for(;Dd;){let e=Dd;for(Dd=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 s3(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function a3(t){let e,n=t.depsTail,o=n;for(;o;){const r=o.prevDep;o.version===-1?(o===n&&(n=r),Ay(o),uL(o)):e=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=r}t.deps=e,t.depsTail=n}function k1(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(l3(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function l3(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===tf)||(t.globalVersion=tf,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!k1(t))))return;t.flags|=2;const e=t.dep,n=fn,o=xi;fn=t,xi=!0;try{s3(t);const r=t.fn(t._value);(e.version===0||rr(r,t._value))&&(t.flags|=128,t._value=r,e.version++)}catch(r){throw e.version++,r}finally{fn=n,xi=o,a3(t),t.flags&=-3}}function Ay(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)Ay(i,!0)}!e&&!--n.sc&&n.map&&n.map.delete(n.key)}function uL(t){const{prevDep:e,nextDep:n}=t;e&&(e.nextDep=n,t.prevDep=void 0),n&&(n.prevDep=e,t.nextDep=void 0)}let xi=!0;const c3=[];function ea(){c3.push(xi),xi=!1}function ta(){const t=c3.pop();xi=t===void 0?!0:t}function Sw(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const n=fn;fn=void 0;try{e()}finally{fn=n}}}let tf=0;class dL{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 um{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(!fn||!xi||fn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==fn)n=this.activeLink=new dL(fn,this),fn.deps?(n.prevDep=fn.depsTail,fn.depsTail.nextDep=n,fn.depsTail=n):fn.deps=fn.depsTail=n,u3(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=fn.depsTail,n.nextDep=void 0,fn.depsTail.nextDep=n,fn.depsTail=n,fn.deps===n&&(fn.deps=o)}return n}trigger(e){this.version++,tf++,this.notify(e)}notify(e){Sy();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Cy()}}}function u3(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)u3(o)}const n=t.dep.subs;n!==t&&(t.prevSub=n,n&&(n.nextSub=t)),t.dep.subs=t}}const Bp=new WeakMap,Il=Symbol(""),S1=Symbol(""),nf=Symbol("");function ko(t,e,n){if(xi&&fn){let o=Bp.get(t);o||Bp.set(t,o=new Map);let r=o.get(n);r||(o.set(n,r=new um),r.map=o,r.key=n),r.track()}}function zs(t,e,n,o,r,i){const s=Bp.get(t);if(!s){tf++;return}const a=l=>{l&&l.trigger()};if(Sy(),e==="clear")s.forEach(a);else{const l=ft(t),c=l&&rm(n);if(l&&n==="length"){const u=Number(o);s.forEach((d,f)=>{(f==="length"||f===nf||!Si(f)&&f>=u)&&a(d)})}else switch((n!==void 0||s.has(void 0))&&a(s.get(n)),c&&a(s.get(nf)),e){case"add":l?c&&a(s.get("length")):(a(s.get(Il)),Gc(t)&&a(s.get(S1)));break;case"delete":l||(a(s.get(Il)),Gc(t)&&a(s.get(S1)));break;case"set":Gc(t)&&a(s.get(Il));break}}Cy()}function fL(t,e){const n=Bp.get(t);return n&&n.get(e)}function Sc(t){const e=Dt(t);return e===t?e:(ko(e,"iterate",nf),Ar(t)?e:e.map(Ci))}function dm(t){return ko(t=Dt(t),"iterate",nf),t}function ka(t,e){return na(t)?au(ss(t)?Ci(e):e):Ci(e)}const hL={__proto__:null,[Symbol.iterator](){return ov(this,Symbol.iterator,t=>ka(this,t))},concat(...t){return Sc(this).concat(...t.map(e=>ft(e)?Sc(e):e))},entries(){return ov(this,"entries",t=>(t[1]=ka(this,t[1]),t))},every(t,e){return $s(this,"every",t,e,void 0,arguments)},filter(t,e){return $s(this,"filter",t,e,n=>n.map(o=>ka(this,o)),arguments)},find(t,e){return $s(this,"find",t,e,n=>ka(this,n),arguments)},findIndex(t,e){return $s(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return $s(this,"findLast",t,e,n=>ka(this,n),arguments)},findLastIndex(t,e){return $s(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return $s(this,"forEach",t,e,void 0,arguments)},includes(...t){return rv(this,"includes",t)},indexOf(...t){return rv(this,"indexOf",t)},join(t){return Sc(this).join(t)},lastIndexOf(...t){return rv(this,"lastIndexOf",t)},map(t,e){return $s(this,"map",t,e,void 0,arguments)},pop(){return td(this,"pop")},push(...t){return td(this,"push",t)},reduce(t,...e){return Cw(this,"reduce",t,e)},reduceRight(t,...e){return Cw(this,"reduceRight",t,e)},shift(){return td(this,"shift")},some(t,e){return $s(this,"some",t,e,void 0,arguments)},splice(...t){return td(this,"splice",t)},toReversed(){return Sc(this).toReversed()},toSorted(t){return Sc(this).toSorted(t)},toSpliced(...t){return Sc(this).toSpliced(...t)},unshift(...t){return td(this,"unshift",t)},values(){return ov(this,"values",t=>ka(this,t))}};function ov(t,e,n){const o=dm(t),r=o[e]();return o!==t&&!Ar(t)&&(r._next=r.next,r.next=()=>{const i=r._next();return i.done||(i.value=n(i.value)),i}),r}const pL=Array.prototype;function $s(t,e,n,o,r,i){const s=dm(t),a=s!==t&&!Ar(t),l=s[e];if(l!==pL[e]){const d=l.apply(t,i);return a?Ci(d):d}let c=n;s!==t&&(a?c=function(d,f){return n.call(this,ka(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 Cw(t,e,n,o){const r=dm(t);let i=n;return r!==t&&(Ar(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,ka(t,a),l,t)}),r[e](i,...o)}function rv(t,e,n){const o=Dt(t);ko(o,"iterate",nf);const r=o[e](...n);return(r===-1||r===!1)&&pm(n[0])?(n[0]=Dt(n[0]),o[e](...n)):r}function td(t,e,n=[]){ea(),Sy();const o=Dt(t)[e].apply(t,n);return Cy(),ta(),o}const mL=xy("__proto__,__v_isRef,__isVue"),d3=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Si));function gL(t){Si(t)||(t=String(t));const e=Dt(this);return ko(e,"has",t),e.hasOwnProperty(t)}class f3{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?b3:v3:i?g3:m3).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(o)?e:void 0;const s=ft(e);if(!r){let l;if(s&&(l=hL[n]))return l;if(n==="hasOwnProperty")return gL}const a=Reflect.get(e,n,Ze(e)?e:o);if((Si(n)?d3.has(n):mL(n))||(r||ko(e,"get",n),i))return a;if(Ze(a)){const l=s&&rm(n)?a:a.value;return r&&Xt(l)?fo(l):l}return Xt(a)?r?fo(a):po(a):a}}class h3 extends f3{constructor(e=!1){super(!1,e)}set(e,n,o,r){let i=e[n];const s=ft(e)&&rm(n);if(!this._isShallow){const c=na(i);if(!Ar(o)&&!na(o)&&(i=Dt(i),o=Dt(o)),!s&&Ze(i)&&!Ze(o))return c||(i.value=o),!0}const a=s?Number(n)<e.length:Qt(e,n),l=Reflect.set(e,n,o,Ze(e)?e:r);return e===Dt(r)&&(a?rr(o,i)&&zs(e,"set",n,o):zs(e,"add",n,o)),l}deleteProperty(e,n){const o=Qt(e,n);e[n];const r=Reflect.deleteProperty(e,n);return r&&o&&zs(e,"delete",n,void 0),r}has(e,n){const o=Reflect.has(e,n);return(!Si(n)||!d3.has(n))&&ko(e,"has",n),o}ownKeys(e){return ko(e,"iterate",ft(e)?"length":Il),Reflect.ownKeys(e)}}class p3 extends f3{constructor(e=!1){super(!0,e)}set(e,n){return!0}deleteProperty(e,n){return!0}}const vL=new h3,bL=new p3,yL=new h3(!0),xL=new p3(!0),C1=t=>t,dh=t=>Reflect.getPrototypeOf(t);function wL(t,e,n){return function(...o){const r=this.__v_raw,i=Dt(r),s=Gc(i),a=t==="entries"||t===Symbol.iterator&&s,l=t==="keys"&&s,c=r[t](...o),u=n?C1:e?au:Ci;return!e&&ko(i,"iterate",l?S1:Il),Vn(Object.create(c),{next(){const{value:d,done:f}=c.next();return f?{value:d,done:f}:{value:a?[u(d[0]),u(d[1])]:u(d),done:f}}})}}function fh(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function _L(t,e){const n={get(r){const i=this.__v_raw,s=Dt(i),a=Dt(r);t||(rr(r,a)&&ko(s,"get",r),ko(s,"get",a));const{has:l}=dh(s),c=e?C1:t?au:Ci;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&&ko(Dt(r),"iterate",Il),r.size},has(r){const i=this.__v_raw,s=Dt(i),a=Dt(r);return t||(rr(r,a)&&ko(s,"has",r),ko(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=Dt(a),c=e?C1:t?au:Ci;return!t&&ko(l,"iterate",Il),a.forEach((u,d)=>r.call(i,c(u),c(d),s))}};return Vn(n,t?{add:fh("add"),set:fh("set"),delete:fh("delete"),clear:fh("clear")}:{add(r){!e&&!Ar(r)&&!na(r)&&(r=Dt(r));const i=Dt(this);return dh(i).has.call(i,r)||(i.add(r),zs(i,"add",r,r)),this},set(r,i){!e&&!Ar(i)&&!na(i)&&(i=Dt(i));const s=Dt(this),{has:a,get:l}=dh(s);let c=a.call(s,r);c||(r=Dt(r),c=a.call(s,r));const u=l.call(s,r);return s.set(r,i),c?rr(i,u)&&zs(s,"set",r,i):zs(s,"add",r,i),this},delete(r){const i=Dt(this),{has:s,get:a}=dh(i);let l=s.call(i,r);l||(r=Dt(r),l=s.call(i,r)),a&&a.call(i,r);const c=i.delete(r);return l&&zs(i,"delete",r,void 0),c},clear(){const r=Dt(this),i=r.size!==0,s=r.clear();return i&&zs(r,"clear",void 0,void 0),s}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=wL(r,t,e)}),n}function fm(t,e){const n=_L(t,e);return(o,r,i)=>r==="__v_isReactive"?!t:r==="__v_isReadonly"?t:r==="__v_raw"?o:Reflect.get(Qt(n,r)&&r in o?n:o,r,i)}const kL={get:fm(!1,!1)},SL={get:fm(!1,!0)},CL={get:fm(!0,!1)},AL={get:fm(!0,!0)},m3=new WeakMap,g3=new WeakMap,v3=new WeakMap,b3=new WeakMap;function $L(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function TL(t){return t.__v_skip||!Object.isExtensible(t)?0:$L(Q9(t))}function po(t){return na(t)?t:hm(t,!1,vL,kL,m3)}function y3(t){return hm(t,!1,yL,SL,g3)}function fo(t){return hm(t,!0,bL,CL,v3)}function kl(t){return hm(t,!0,xL,AL,b3)}function hm(t,e,n,o,r){if(!Xt(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const i=TL(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 ss(t){return na(t)?ss(t.__v_raw):!!(t&&t.__v_isReactive)}function na(t){return!!(t&&t.__v_isReadonly)}function Ar(t){return!!(t&&t.__v_isShallow)}function pm(t){return t?!!t.__v_raw:!1}function Dt(t){const e=t&&t.__v_raw;return e?Dt(e):t}function Oe(t){return!Qt(t,"__v_skip")&&Object.isExtensible(t)&&QS(t,"__v_skip",!0),t}const Ci=t=>Xt(t)?po(t):t,au=t=>Xt(t)?fo(t):t;function Ze(t){return t?t.__v_isRef===!0:!1}function Fe(t){return x3(t,!1)}function Ne(t){return x3(t,!0)}function x3(t,e){return Ze(t)?t:new OL(t,e)}class OL{constructor(e,n){this.dep=new um,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?e:Dt(e),this._value=n?e:Ci(e),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(e){const n=this._rawValue,o=this.__v_isShallow||Ar(e)||na(e);e=o?e:Dt(e),rr(e,n)&&(this._rawValue=e,this._value=o?e:Ci(e),this.dep.trigger())}}function p(t){return Ze(t)?t.value:t}function yt(t){return wt(t)?t():p(t)}const ML={get:(t,e,n)=>e==="__v_raw"?t:p(Reflect.get(t,e,n)),set:(t,e,n,o)=>{const r=t[e];return Ze(r)&&!Ze(n)?(r.value=n,!0):Reflect.set(t,e,n,o)}};function w3(t){return ss(t)?t:new Proxy(t,ML)}class BL{constructor(e){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new um,{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 _3(t){return new BL(t)}function mm(t){const e=ft(t)?new Array(t.length):{};for(const n in t)e[n]=k3(t,n);return e}class LL{constructor(e,n,o){this._object=e,this._key=n,this._defaultValue=o,this.__v_isRef=!0,this._value=void 0,this._raw=Dt(e);let r=!0,i=e;if(!ft(e)||!rm(String(n)))do r=!pm(i)||Ar(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&&Ze(this._raw[this._key])){const n=this._object[this._key];if(Ze(n)){n.value=e;return}}this._object[this._key]=e}get dep(){return fL(this._raw,this._key)}}class PL{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 Ut(t,e,n){return Ze(t)?t:wt(t)?new PL(t):Xt(t)&&arguments.length>1?k3(t,e,n):Fe(t)}function k3(t,e,n){return new LL(t,e,n)}class DL{constructor(e,n,o){this.fn=e,this.setter=n,this._value=void 0,this.dep=new um(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=tf-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=o}notify(){if(this.flags|=16,!(this.flags&8)&&fn!==this)return i3(this,!0),!0}get value(){const e=this.dep.track();return l3(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function EL(t,e,n=!1){let o,r;return wt(t)?o=t:(o=t.get,r=t.set),new DL(o,r,n)}const hh={},Lp=new WeakMap;let Sl;function IL(t,e=!1,n=Sl){if(n){let o=Lp.get(n);o||Lp.set(n,o=[]),o.push(t)}}function NL(t,e,n=Gt){const{immediate:o,deep:r,once:i,scheduler:s,augmentJob:a,call:l}=n,c=_=>r?_:Ar(_)||r===!1||r===0?Hs(_,1):Hs(_);let u,d,f,h,m=!1,b=!1;if(Ze(t)?(d=()=>t.value,m=Ar(t)):ss(t)?(d=()=>c(t),m=!0):ft(t)?(b=!0,m=t.some(_=>ss(_)||Ar(_)),d=()=>t.map(_=>{if(Ze(_))return _.value;if(ss(_))return c(_);if(wt(_))return l?l(_,2):_()})):wt(t)?e?d=l?()=>l(t,2):t:d=()=>{if(f){ea();try{f()}finally{ta()}}const _=Sl;Sl=u;try{return l?l(t,3,[h]):t(h)}finally{Sl=_}}:d=yi,e&&r){const _=d,C=r===!0?1/0:r;d=()=>Hs(_(),C)}const g=sc(),v=()=>{u.stop(),g&&g.active&&_y(g.effects,u)};if(i&&e){const _=e;e=(...C)=>{_(...C),v()}}let y=b?new Array(t.length).fill(hh):hh;const x=_=>{if(!(!(u.flags&1)||!u.dirty&&!_))if(e){const C=u.run();if(r||m||(b?C.some((D,M)=>rr(D,y[M])):rr(C,y))){f&&f();const D=Sl;Sl=u;try{const M=[C,y===hh?void 0:b&&y[0]===hh?[]:y,h];y=C,l?l(e,3,M):e(...M)}finally{Sl=D}}}else u.run()};return a&&a(x),u=new o3(d),u.scheduler=s?()=>s(x,!1):x,h=_=>IL(_,!1,u),f=u.onStop=()=>{const _=Lp.get(u);if(_){if(l)l(_,4);else for(const C of _)C();Lp.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 Hs(t,e=1/0,n){if(e<=0||!Xt(t)||t.__v_skip||(n=n||new Map,(n.get(t)||0)>=e))return t;if(n.set(t,e),e--,Ze(t))Hs(t.value,e,n);else if(ft(t))for(let o=0;o<t.length;o++)Hs(t[o],e,n);else if(Pu(t)||Gc(t))t.forEach(o=>{Hs(o,e,n)});else if(ZS(t)){for(const o in t)Hs(t[o],e,n);for(const o of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,o)&&Hs(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){gm(r,e,n)}}function Ai(t,e,n,o){if(wt(t)){const r=Hf(t,e,n,o);return r&&KS(r)&&r.catch(i=>{gm(i,e,n)}),r}if(ft(t)){const r=[];for(let i=0;i<t.length;i++)r.push(Ai(t[i],e,n,o));return r}}function gm(t,e,n,o=!0){const r=e?e.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:s}=e&&e.appContext.config||Gt;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){ea(),Hf(i,null,10,[t,l,c]),ta();return}}RL(t,n,r,o,s)}function RL(t,e,n,o=!0,r=!1){if(r)throw t;console.error(t)}const Wo=[];let Xi=-1;const qc=[];let Sa=null,Ec=0;const S3=Promise.resolve();let Pp=null;function kn(t){const e=Pp||S3;return t?e.then(this?t.bind(this):t):e}function FL(t){let e=Xi+1,n=Wo.length;for(;e<n;){const o=e+n>>>1,r=Wo[o],i=of(r);i<t||i===t&&r.flags&2?e=o+1:n=o}return e}function $y(t){if(!(t.flags&1)){const e=of(t),n=Wo[Wo.length-1];!n||!(t.flags&2)&&e>=of(n)?Wo.push(t):Wo.splice(FL(e),0,t),t.flags|=1,C3()}}function C3(){Pp||(Pp=S3.then(T3))}function A3(t){ft(t)?qc.push(...t):Sa&&t.id===-1?Sa.splice(Ec+1,0,t):t.flags&1||(qc.push(t),t.flags|=1),C3()}function Aw(t,e,n=Xi+1){for(;n<Wo.length;n++){const o=Wo[n];if(o&&o.flags&2){if(t&&o.id!==t.uid)continue;Wo.splice(n,1),n--,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function $3(t){if(qc.length){const e=[...new Set(qc)].sort((n,o)=>of(n)-of(o));if(qc.length=0,Sa){Sa.push(...e);return}for(Sa=e,Ec=0;Ec<Sa.length;Ec++){const n=Sa[Ec];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Sa=null,Ec=0}}const of=t=>t.id==null?t.flags&2?-1:1/0:t.id;function T3(t){try{for(Xi=0;Xi<Wo.length;Xi++){const e=Wo[Xi];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(;Xi<Wo.length;Xi++){const e=Wo[Xi];e&&(e.flags&=-2)}Xi=-1,Wo.length=0,$3(),Pp=null,(Wo.length||qc.length)&&T3()}}let uo=null,O3=null;function Dp(t){const e=uo;return uo=t,O3=t&&t.type.__scopeId||null,e}function J(t,e=uo,n){if(!e||t._n)return t;const o=(...r)=>{o._d&&Rp(-1);const i=Dp(e);let s;try{s=t(...r)}finally{Dp(i),o._d&&Rp(1)}return s};return o._n=!0,o._c=!0,o._d=!0,o}function Go(t,e){if(uo===null)return t;const n=Sm(uo),o=t.dirs||(t.dirs=[]);for(let r=0;r<e.length;r++){let[i,s,a,l=Gt]=e[r];i&&(wt(i)&&(i={mounted:i,updated:i}),i.deep&&Hs(s),o.push({dir:i,instance:n,value:s,oldValue:void 0,arg:a,modifiers:l}))}return t}function gl(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&&(ea(),Ai(l,n,8,[t.el,a,t,e]),ta())}}function wi(t,e){if(Ao){let n=Ao.provides;const o=Ao.parent&&Ao.parent.provides;o===n&&(n=Ao.provides=Object.create(o)),n[t]=e}}function Kt(t,e,n=!1){const o=Do();if(o||Nl){let r=Nl?Nl._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&&wt(e)?e.call(o&&o.proxy):e}}function Ty(){return!!(Do()||Nl)}const VL=Symbol.for("v-scx"),zL=()=>Kt(VL);function vm(t,e){return bm(t,null,e)}function HL(t,e){return bm(t,null,{flush:"sync"})}function Ke(t,e,n){return bm(t,e,n)}function bm(t,e,n=Gt){const{immediate:o,deep:r,flush:i,once:s}=n,a=Vn({},n),l=e&&o||!e&&i!=="post";let c;if(lf){if(i==="sync"){const h=zL();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!l){const h=()=>{};return h.stop=yi,h.resume=yi,h.pause=yi,h}}const u=Ao;a.call=(h,m,b)=>Ai(h,u,m,b);let d=!1;i==="post"?a.scheduler=h=>{yo(h,u&&u.suspense)}:i!=="sync"&&(d=!0,a.scheduler=(h,m)=>{m?h():$y(h)}),a.augmentJob=h=>{e&&(h.flags|=4),d&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const f=NL(t,e,a);return lf&&(c?c.push(f):l&&f()),f}function WL(t,e,n){const o=this.proxy,r=yn(t)?t.includes(".")?M3(o,t):()=>o[t]:t.bind(o,o);let i;wt(e)?i=e:(i=e.handler,n=e);const s=Wf(this),a=bm(r,i.bind(o),n);return s(),a}function M3(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 B3=Symbol("_vte"),L3=t=>t.__isTeleport,Id=t=>t&&(t.disabled||t.disabled===""),$w=t=>t&&(t.defer||t.defer===""),Tw=t=>typeof SVGElement<"u"&&t instanceof SVGElement,Ow=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,A1=(t,e)=>{const n=t&&t.to;return yn(n)?e?e(n):null:n},P3={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=Id(e.props);let{shapeFlag:y,children:x,dynamicChildren:_}=e;if(t==null){const C=e.el=b(""),D=e.anchor=b("");h(C,n,o),h(D,n,o);const M=(L,E)=>{y&16&&u(x,L,E,r,i,s,a,l)},$=()=>{const L=e.target=A1(e.props,m),E=$1(L,e,b,h);L&&(s!=="svg"&&Tw(L)?s="svg":s!=="mathml"&&Ow(L)&&(s="mathml"),r&&r.isCE&&(r.ce._teleportTargets||(r.ce._teleportTargets=new Set)).add(L),v||(M(L,E),cp(e,!1)))};v&&(M(n,D),cp(e,!0)),$w(e.props)?(e.el.__isMounted=!1,yo(()=>{$(),delete e.el.__isMounted},i)):$()}else{if($w(e.props)&&t.el.__isMounted===!1){yo(()=>{P3.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,D=e.target=t.target,M=e.targetAnchor=t.targetAnchor,$=Id(t.props),L=$?n:D,E=$?C:M;if(s==="svg"||Tw(D)?s="svg":(s==="mathml"||Ow(D))&&(s="mathml"),_?(f(t.dynamicChildren,_,L,r,i,s,a),Py(t,e,!0)):l||d(t,e,L,E,r,i,s,a,!1),v)$?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):ph(e,n,C,c,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const N=e.target=A1(e.props,m);N&&ph(e,N,null,c,0)}else $&&ph(e,D,M,c,1);cp(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||!Id(f);for(let m=0;m<a.length;m++){const b=a[m];o(b,e,n,h,!!b.dynamicChildren)}}},move:ph,hydrate:UL};function ph(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||Id(u))&&l&16)for(let f=0;f<c.length;f++)r(c[f],e,n,2);d&&o(a,e,n)}function UL(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=A1(e.props,l),b=Id(e.props);if(m){const g=m._lpa||m.firstChild;e.shapeFlag&16&&(b?(h(t,e),f(m,g),e.targetAnchor||$1(m,e,u,c,a(t)===m?t:null)):(e.anchor=s(t),f(m,g),e.targetAnchor||$1(m,e,u,c),d(g&&s(g),e,m,n,o,r,i))),cp(e,b)}else b&&e.shapeFlag&16&&(h(t,e),e.targetStart=t,e.targetAnchor=s(t));return e.anchor&&s(e.anchor)}const Oy=P3;function cp(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 $1(t,e,n,o,r=null){const i=e.targetStart=n(""),s=e.targetAnchor=n("");return i[B3]=s,t&&(o(i,t,r),o(s,t,r)),s}const Zi=Symbol("_leaveCb"),nd=Symbol("_enterCb");function GL(){const t={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return vn(()=>{t.isMounted=!0}),oa(()=>{t.isUnmounting=!0}),t}const Vr=[Function,Array],D3={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Vr,onEnter:Vr,onAfterEnter:Vr,onEnterCancelled:Vr,onBeforeLeave:Vr,onLeave:Vr,onAfterLeave:Vr,onLeaveCancelled:Vr,onBeforeAppear:Vr,onAppear:Vr,onAfterAppear:Vr,onAppearCancelled:Vr},E3=t=>{const e=t.subTree;return e.component?E3(e.component):e},qL={name:"BaseTransition",props:D3,setup(t,{slots:e}){const n=Do(),o=GL();return()=>{const r=e.default&&R3(e.default(),!0);if(!r||!r.length)return;const i=I3(r),s=Dt(t),{mode:a}=s;if(o.isLeaving)return iv(i);const l=Mw(i);if(!l)return iv(i);let c=T1(l,s,o,n,d=>c=d);l.type!==Co&&rf(l,c);let u=n.subTree&&Mw(n.subTree);if(u&&u.type!==Co&&!Ol(u,l)&&E3(n).type!==Co){let d=T1(u,s,o,n);if(rf(u,d),a==="out-in"&&l.type!==Co)return o.isLeaving=!0,d.afterLeave=()=>{o.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},iv(i);a==="in-out"&&l.type!==Co?d.delayLeave=(f,h,m)=>{const b=N3(o,u);b[String(u.key)]=u,f[Zi]=()=>{h(),f[Zi]=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 I3(t){let e=t[0];if(t.length>1){for(const n of t)if(n.type!==Co){e=n;break}}return e}const YL=qL;function N3(t,e){const{leavingVNodes:n}=t;let o=n.get(e.type);return o||(o=Object.create(null),n.set(e.type,o)),o}function T1(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=N3(n,t),D=(L,E)=>{L&&Ai(L,o,9,E)},M=(L,E)=>{const N=E[1];D(L,E),ft(L)?L.every(T=>T.length<=1)&&N():L.length<=1&&N()},$={mode:s,persisted:a,beforeEnter(L){let E=l;if(!n.isMounted)if(i)E=g||l;else return;L[Zi]&&L[Zi](!0);const N=C[_];N&&Ol(t,N)&&N.el[Zi]&&N.el[Zi](),D(E,[L])},enter(L){if(C[_]===t)return;let E=c,N=u,T=d;if(!n.isMounted)if(i)E=v||c,N=y||u,T=x||d;else return;let O=!1;L[nd]=B=>{O||(O=!0,B?D(T,[L]):D(N,[L]),$.delayedLeave&&$.delayedLeave(),L[nd]=void 0)};const P=L[nd].bind(null,!1);E?M(E,[L,P]):P()},leave(L,E){const N=String(t.key);if(L[nd]&&L[nd](!0),n.isUnmounting)return E();D(f,[L]);let T=!1;L[Zi]=P=>{T||(T=!0,E(),P?D(b,[L]):D(m,[L]),L[Zi]=void 0,C[N]===t&&delete C[N])};const O=L[Zi].bind(null,!1);C[N]=t,h?M(h,[L,O]):O()},clone(L){const E=T1(L,e,n,o,r);return r&&r(E),E}};return $}function iv(t){if(ym(t))return t=Va(t),t.children=null,t}function Mw(t){if(!ym(t))return L3(t.type)&&t.children?I3(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&&wt(n.default))return n.default()}}function rf(t,e){t.shapeFlag&6&&t.component?(t.transition=e,rf(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 R3(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===Re?(s.patchFlag&128&&r++,o=o.concat(R3(s.children,e,a))):(e||s.type!==Co)&&o.push(a!=null?Va(s,{key:a}):s)}if(r>1)for(let i=0;i<o.length;i++)o[i].patchFlag=-2;return o}function se(t,e){return wt(t)?Vn({name:t.name},e,{setup:t}):t}function F3(){const t=Do();return t?(t.appContext.config.idPrefix||"v")+"-"+t.ids[0]+t.ids[1]++:""}function V3(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}function bt(t){const e=Do(),n=Ne(null);if(e){const r=e.refs===Gt?e.refs={}:e.refs;Object.defineProperty(r,t,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function Bw(t,e){let n;return!!((n=Object.getOwnPropertyDescriptor(t,e))&&!n.configurable)}const Ep=new WeakMap;function Nd(t,e,n,o,r=!1){if(ft(t)){t.forEach((b,g)=>Nd(b,e&&(ft(e)?e[g]:e),n,o,r));return}if(Yc(o)&&!r){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&Nd(t,e,n,o.component.subTree);return}const i=o.shapeFlag&4?Sm(o.component):o.el,s=r?null:i,{i:a,r:l}=t,c=e&&e.r,u=a.refs===Gt?a.refs={}:a.refs,d=a.setupState,f=Dt(d),h=d===Gt?jS:b=>Bw(u,b)?!1:Qt(f,b),m=(b,g)=>!(g&&Bw(u,g));if(c!=null&&c!==l){if(Lw(e),yn(c))u[c]=null,h(c)&&(d[c]=null);else if(Ze(c)){const b=e;m(c,b.k)&&(c.value=null),b.k&&(u[b.k]=null)}}if(wt(l))Hf(l,a,12,[s,u]);else{const b=yn(l),g=Ze(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)ft(y)&&_y(y,i);else if(ft(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(),Ep.delete(t)};y.id=-1,Ep.set(t,y),yo(y,n)}else Lw(t),v()}}}function Lw(t){const e=Ep.get(t);e&&(e.flags|=8,Ep.delete(t))}lm().requestIdleCallback;lm().cancelIdleCallback;const Yc=t=>!!t.type.__asyncLoader,ym=t=>t.type.__isKeepAlive;function My(t,e){H3(t,"a",e)}function z3(t,e){H3(t,"da",e)}function H3(t,e,n=Ao){const o=t.__wdc||(t.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return t()});if(xm(e,o,n),n){let r=n.parent;for(;r&&r.parent;)ym(r.parent.vnode)&&jL(o,e,n,r),r=r.parent}}function jL(t,e,n,o){const r=xm(e,t,o,!0);ca(()=>{_y(o[e],r)},n)}function xm(t,e,n=Ao,o=!1){if(n){const r=n[t]||(n[t]=[]),i=e.__weh||(e.__weh=(...s)=>{ea();const a=Wf(n),l=Ai(e,n,t,s);return a(),ta(),l});return o?r.unshift(i):r.push(i),i}}const la=t=>(e,n=Ao)=>{(!lf||t==="sp")&&xm(t,(...o)=>e(...o),n)},KL=la("bm"),vn=la("m"),W3=la("bu"),XL=la("u"),oa=la("bum"),ca=la("um"),ZL=la("sp"),QL=la("rtg"),JL=la("rtc");function e7(t,e=Ao){xm("ec",t,e)}const U3="components";function wm(t,e){return q3(U3,t,!0,e)||t}const G3=Symbol.for("v-ndc");function Rt(t){return yn(t)?q3(U3,t,!1)||t:t||G3}function q3(t,e,n=!0,o=!1){const r=uo||Ao;if(r){const i=r.type;{const a=E7(i,!1);if(a&&(a===e||a===Or(e)||a===sm(Or(e))))return i}const s=Pw(r[t]||i[t],e)||Pw(r.appContext[t],e);return!s&&o?i:s}}function Pw(t,e){return t&&(t[e]||t[Or(e)]||t[sm(Or(e))])}function vt(t,e,n,o){let r;const i=n,s=ft(t);if(s||yn(t)){const a=s&&ss(t);let l=!1,c=!1;a&&(l=!Ar(t),c=na(t),t=dm(t)),r=new Array(t.length);for(let u=0,d=t.length;u<d;u++)r[u]=e(l?c?au(Ci(t[u])):Ci(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(Xt(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 $i(t,e){for(let n=0;n<e.length;n++){const o=e[n];if(ft(o))for(let r=0;r<o.length;r++)t[o[r].name]=o[r].fn;else o&&(t[o.name]=o.key?(...r)=>{const i=o.fn(...r);return i&&(i.key=o.key),i}:o.fn)}return t}function Ce(t,e,n={},o,r){if(uo.ce||uo.parent&&Yc(uo.parent)&&uo.parent.ce){const c=Object.keys(n).length>0;return e!=="default"&&(n.name=e),w(),Q(Re,null,[H("slot",n,o&&o())],c?-2:64)}let i=t[e];i&&i._c&&(i._d=!1),w();const s=i&&Y3(i(n)),a=n.key||s&&s.key,l=Q(Re,{key:(a&&!Si(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 Y3(t){return t.some(e=>af(e)?!(e.type===Co||e.type===Re&&!Y3(e.children)):!0)?t:null}const O1=t=>t?pC(t)?Sm(t):O1(t.parent):null,Rd=Vn(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>O1(t.parent),$root:t=>O1(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>X3(t),$forceUpdate:t=>t.f||(t.f=()=>{$y(t.update)}),$nextTick:t=>t.n||(t.n=kn.bind(t.proxy)),$watch:t=>WL.bind(t)}),sv=(t,e)=>t!==Gt&&!t.__isScriptSetup&&Qt(t,e),t7={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(sv(o,e))return s[e]=1,o[e];if(r!==Gt&&Qt(r,e))return s[e]=2,r[e];if(Qt(i,e))return s[e]=3,i[e];if(n!==Gt&&Qt(n,e))return s[e]=4,n[e];M1&&(s[e]=0)}}const c=Rd[e];let u,d;if(c)return e==="$attrs"&&ko(t.attrs,"get",""),c(t);if((u=a.__cssModules)&&(u=u[e]))return u;if(n!==Gt&&Qt(n,e))return s[e]=4,n[e];if(d=l.config.globalProperties,Qt(d,e))return d[e]},set({_:t},e,n){const{data:o,setupState:r,ctx:i}=t;return sv(r,e)?(r[e]=n,!0):o!==Gt&&Qt(o,e)?(o[e]=n,!0):Qt(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!==Gt&&a[0]!=="$"&&Qt(t,a)||sv(e,a)||Qt(i,a)||Qt(o,a)||Qt(Rd,a)||Qt(r.config.globalProperties,a)||(l=s.__cssModules)&&l[a])},defineProperty(t,e,n){return n.get!=null?t._.accessCache[e]=0:Qt(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}};function bs(){return j3().slots}function Du(){return j3().attrs}function j3(t){const e=Do();return e.setupContext||(e.setupContext=gC(e))}function Ip(t){return ft(t)?t.reduce((e,n)=>(e[n]=null,e),{}):t}function lt(t,e){return!t||!e?t||e:ft(t)&&ft(e)?t.concat(e):Vn({},Ip(t),Ip(e))}let M1=!0;function n7(t){const e=X3(t),n=t.proxy,o=t.ctx;M1=!1,e.beforeCreate&&Dw(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:D,renderTriggered:M,errorCaptured:$,serverPrefetch:L,expose:E,inheritAttrs:N,components:T,directives:O,filters:P}=e;if(c&&o7(c,o,null),s)for(const z in s){const G=s[z];wt(G)&&(o[z]=G.bind(n))}if(r){const z=r.call(n,n);Xt(z)&&(t.data=po(z))}if(M1=!0,i)for(const z in i){const G=i[z],K=wt(G)?G.bind(n,n):wt(G.get)?G.get.bind(n,n):yi,ne=!wt(G)&&wt(G.set)?G.set.bind(n):yi,ae=S({get:K,set:ne});Object.defineProperty(o,z,{enumerable:!0,configurable:!0,get:()=>ae.value,set:he=>ae.value=he})}if(a)for(const z in a)K3(a[z],o,n,z);if(l){const z=wt(l)?l.call(n):l;Reflect.ownKeys(z).forEach(G=>{wi(G,z[G])})}u&&Dw(u,t,"c");function V(z,G){ft(G)?G.forEach(K=>z(K.bind(n))):G&&z(G.bind(n))}if(V(KL,d),V(vn,f),V(W3,h),V(XL,m),V(My,b),V(z3,g),V(e7,$),V(JL,D),V(QL,M),V(oa,y),V(ca,_),V(ZL,L),ft(E))if(E.length){const z=t.exposed||(t.exposed={});E.forEach(G=>{Object.defineProperty(z,G,{get:()=>n[G],set:K=>n[G]=K,enumerable:!0})})}else t.exposed||(t.exposed={});C&&t.render===yi&&(t.render=C),N!=null&&(t.inheritAttrs=N),T&&(t.components=T),O&&(t.directives=O),L&&V3(t)}function o7(t,e,n=yi){ft(t)&&(t=B1(t));for(const o in t){const r=t[o];let i;Xt(r)?"default"in r?i=Kt(r.from||o,r.default,!0):i=Kt(r.from||o):i=Kt(r),Ze(i)?Object.defineProperty(e,o,{enumerable:!0,configurable:!0,get:()=>i.value,set:s=>i.value=s}):e[o]=i}}function Dw(t,e,n){Ai(ft(t)?t.map(o=>o.bind(e.proxy)):t.bind(e.proxy),e,n)}function K3(t,e,n,o){let r=o.includes(".")?M3(n,o):()=>n[o];if(yn(t)){const i=e[t];wt(i)&&Ke(r,i)}else if(wt(t))Ke(r,t.bind(n));else if(Xt(t))if(ft(t))t.forEach(i=>K3(i,e,n,o));else{const i=wt(t.handler)?t.handler.bind(n):e[t.handler];wt(i)&&Ke(r,i,t)}}function X3(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=>Np(l,c,s,!0)),Np(l,e,s)),Xt(e)&&i.set(e,l),l}function Np(t,e,n,o=!1){const{mixins:r,extends:i}=e;i&&Np(t,i,n,!0),r&&r.forEach(s=>Np(t,s,n,!0));for(const s in e)if(!(o&&s==="expose")){const a=r7[s]||n&&n[s];t[s]=a?a(t[s],e[s]):e[s]}return t}const r7={data:Ew,props:Iw,emits:Iw,methods:xd,computed:xd,beforeCreate:Fo,created:Fo,beforeMount:Fo,mounted:Fo,beforeUpdate:Fo,updated:Fo,beforeDestroy:Fo,beforeUnmount:Fo,destroyed:Fo,unmounted:Fo,activated:Fo,deactivated:Fo,errorCaptured:Fo,serverPrefetch:Fo,components:xd,directives:xd,watch:s7,provide:Ew,inject:i7};function Ew(t,e){return e?t?function(){return Vn(wt(t)?t.call(this,this):t,wt(e)?e.call(this,this):e)}:e:t}function i7(t,e){return xd(B1(t),B1(e))}function B1(t){if(ft(t)){const e={};for(let n=0;n<t.length;n++)e[t[n]]=t[n];return e}return t}function Fo(t,e){return t?[...new Set([].concat(t,e))]:e}function xd(t,e){return t?Vn(Object.create(null),t,e):e}function Iw(t,e){return t?ft(t)&&ft(e)?[...new Set([...t,...e])]:Vn(Object.create(null),Ip(t),Ip(e??{})):e}function s7(t,e){if(!t)return e;if(!e)return t;const n=Vn(Object.create(null),t);for(const o in e)n[o]=Fo(t[o],e[o]);return n}function Z3(){return{app:null,config:{isNativeTag:jS,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 a7=0;function l7(t,e){return function(o,r=null){wt(o)||(o=Vn({},o)),r!=null&&!Xt(r)&&(r=null);const i=Z3(),s=new WeakSet,a=[];let l=!1;const c=i.app={_uid:a7++,_component:o,_props:r,_container:null,_context:i,_instance:null,version:N7,get config(){return i.config},set config(u){},use(u,...d){return s.has(u)||(u&&wt(u.install)?(s.add(u),u.install(c,...d)):wt(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,Sm(h.component)}},onUnmount(u){a.push(u)},unmount(){l&&(Ai(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=Nl;Nl=c;try{return u()}finally{Nl=d}}};return c}}let Nl=null;function mt(t,e,n=Gt){const o=Do(),r=Or(e),i=aa(e),s=Q3(t,r),a=_3((l,c)=>{let u,d=Gt,f;return HL(()=>{const h=t[r];rr(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(!rr(m,u)&&!(d!==Gt&&rr(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),rr(h,m)&&rr(h,d)&&!rr(m,f)&&c(),d=h,f=m}}});return a[Symbol.iterator]=()=>{let l=0;return{next(){return l<2?{value:l++?s||Gt:a,done:!1}:{done:!0}}}},a}const Q3=(t,e)=>e==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${Or(e)}Modifiers`]||t[`${aa(e)}Modifiers`];function c7(t,e,...n){if(t.isUnmounted)return;const o=t.vnode.props||Gt;let r=n;const i=e.startsWith("update:"),s=i&&Q3(o,e.slice(7));s&&(s.trim&&(r=n.map(u=>yn(u)?u.trim():u)),s.number&&(r=n.map(am)));let a,l=o[a=ev(e)]||o[a=ev(Or(e))];!l&&i&&(l=o[a=ev(aa(e))]),l&&Ai(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,Ai(c,t,6,r)}}const u7=new WeakMap;function J3(t,e,n=!1){const o=n?u7:e.emitsCache,r=o.get(t);if(r!==void 0)return r;const i=t.emits;let s={},a=!1;if(!wt(t)){const l=c=>{const u=J3(c,e,!0);u&&(a=!0,Vn(s,u))};!n&&e.mixins.length&&e.mixins.forEach(l),t.extends&&l(t.extends),t.mixins&&t.mixins.forEach(l)}return!i&&!a?(Xt(t)&&o.set(t,null),null):(ft(i)?i.forEach(l=>s[l]=null):Vn(s,i),Xt(t)&&o.set(t,s),s)}function _m(t,e){return!t||!om(e)?!1:(e=e.slice(2).replace(/Once$/,""),Qt(t,e[0].toLowerCase()+e.slice(1))||Qt(t,aa(e))||Qt(t,e))}function Nw(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=Dp(t);let v,y;try{if(n.shapeFlag&4){const _=r||o,C=_;v=Qi(c.call(C,_,u,d,h,f,m)),y=a}else{const _=e;v=Qi(_.length>1?_(d,{attrs:a,slots:s,emit:l}):_(d,null)),y=e.props?a:d7(a)}}catch(_){Vd.length=0,gm(_,t,1),v=H(Co)}let x=v;if(y&&b!==!1){const _=Object.keys(y),{shapeFlag:C}=x;_.length&&C&7&&(i&&_.some(wy)&&(y=f7(y,i)),x=Va(x,y,!1,!0))}return n.dirs&&(x=Va(x,null,!1,!0),x.dirs=x.dirs?x.dirs.concat(n.dirs):n.dirs),n.transition&&rf(x,n.transition),v=x,Dp(g),v}const d7=t=>{let e;for(const n in t)(n==="class"||n==="style"||om(n))&&((e||(e={}))[n]=t[n]);return e},f7=(t,e)=>{const n={};for(const o in t)(!wy(o)||!(o.slice(9)in e))&&(n[o]=t[o]);return n};function h7(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?Rw(o,s,c):!!s;if(l&8){const u=e.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(eC(s,o,f)&&!_m(c,f))return!0}}}else return(r||a)&&(!a||!a.$stable)?!0:o===s?!1:o?s?Rw(o,s,c):!0:!!s;return!1}function Rw(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(eC(e,t,i)&&!_m(n,i))return!0}return!1}function eC(t,e,n){const o=t[n],r=e[n];return n==="style"&&Xt(o)&&Xt(r)?!Ra(o,r):o!==r}function p7({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 tC={},nC=()=>Object.create(tC),oC=t=>Object.getPrototypeOf(t)===tC;function m7(t,e,n,o=!1){const r={},i=nC();t.propsDefaults=Object.create(null),rC(t,e,r,i);for(const s in t.propsOptions[0])s in r||(r[s]=void 0);n?t.props=o?r:y3(r):t.type.props?t.props=r:t.props=i,t.attrs=i}function g7(t,e,n,o){const{props:r,attrs:i,vnode:{patchFlag:s}}=t,a=Dt(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(_m(t.emitsOptions,f))continue;const h=e[f];if(l)if(Qt(i,f))h!==i[f]&&(i[f]=h,c=!0);else{const m=Or(f);r[m]=L1(l,a,m,h,t,!1)}else h!==i[f]&&(i[f]=h,c=!0)}}}else{rC(t,e,r,i)&&(c=!0);let u;for(const d in a)(!e||!Qt(e,d)&&((u=aa(d))===d||!Qt(e,u)))&&(l?n&&(n[d]!==void 0||n[u]!==void 0)&&(r[d]=L1(l,a,d,void 0,t,!0)):delete r[d]);if(i!==a)for(const d in i)(!e||!Qt(e,d))&&(delete i[d],c=!0)}c&&zs(t.attrs,"set","")}function rC(t,e,n,o){const[r,i]=t.propsOptions;let s=!1,a;if(e)for(let l in e){if(Pd(l))continue;const c=e[l];let u;r&&Qt(r,u=Or(l))?!i||!i.includes(u)?n[u]=c:(a||(a={}))[u]=c:_m(t.emitsOptions,l)||(!(l in o)||c!==o[l])&&(o[l]=c,s=!0)}if(i){const l=Dt(n),c=a||Gt;for(let u=0;u<i.length;u++){const d=i[u];n[d]=L1(r,l,d,c[d],t,!Qt(c,d))}}return s}function L1(t,e,n,o,r,i){const s=t[n];if(s!=null){const a=Qt(s,"default");if(a&&o===void 0){const l=s.default;if(s.type!==Function&&!s.skipFactory&&wt(l)){const{propsDefaults:c}=r;if(n in c)o=c[n];else{const u=Wf(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===aa(n))&&(o=!0))}return o}const v7=new WeakMap;function iC(t,e,n=!1){const o=n?v7:e.propsCache,r=o.get(t);if(r)return r;const i=t.props,s={},a=[];let l=!1;if(!wt(t)){const u=d=>{l=!0;const[f,h]=iC(d,e,!0);Vn(s,f),h&&a.push(...h)};!n&&e.mixins.length&&e.mixins.forEach(u),t.extends&&u(t.extends),t.mixins&&t.mixins.forEach(u)}if(!i&&!l)return Xt(t)&&o.set(t,Uc),Uc;if(ft(i))for(let u=0;u<i.length;u++){const d=Or(i[u]);Fw(d)&&(s[d]=Gt)}else if(i)for(const u in i){const d=Or(u);if(Fw(d)){const f=i[u],h=s[d]=ft(f)||wt(f)?{type:f}:Vn({},f),m=h.type;let b=!1,g=!0;if(ft(m))for(let v=0;v<m.length;++v){const y=m[v],x=wt(y)&&y.name;if(x==="Boolean"){b=!0;break}else x==="String"&&(g=!1)}else b=wt(m)&&m.name==="Boolean";h[0]=b,h[1]=g,(b||Qt(h,"default"))&&a.push(d)}}const c=[s,a];return Xt(t)&&o.set(t,c),c}function Fw(t){return t[0]!=="$"&&!Pd(t)}const By=t=>t==="_"||t==="_ctx"||t==="$stable",Ly=t=>ft(t)?t.map(Qi):[Qi(t)],b7=(t,e,n)=>{if(e._n)return e;const o=J((...r)=>Ly(e(...r)),n);return o._c=!1,o},sC=(t,e,n)=>{const o=t._ctx;for(const r in t){if(By(r))continue;const i=t[r];if(wt(i))e[r]=b7(r,i,o);else if(i!=null){const s=Ly(i);e[r]=()=>s}}},aC=(t,e)=>{const n=Ly(e);t.slots.default=()=>n},lC=(t,e,n)=>{for(const o in e)(n||!By(o))&&(t[o]=e[o])},y7=(t,e,n)=>{const o=t.slots=nC();if(t.vnode.shapeFlag&32){const r=e._;r?(lC(o,e,n),n&&QS(o,"_",r,!0)):sC(e,o)}else e&&aC(t,e)},x7=(t,e,n)=>{const{vnode:o,slots:r}=t;let i=!0,s=Gt;if(o.shapeFlag&32){const a=e._;a?n&&a===1?i=!1:lC(r,e,n):(i=!e.$stable,sC(e,r)),s=e}else e&&(aC(t,e),s={default:1});if(i)for(const a in r)!By(a)&&s[a]==null&&delete r[a]},yo=C7;function w7(t){return _7(t)}function _7(t,e){const n=lm();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=yi,insertStaticContent:m}=t,b=(I,U,j,ee=null,ie=null,de=null,ke=void 0,X=null,q=!!U.dynamicChildren)=>{if(I===U)return;I&&!Ol(I,U)&&(ee=Z(I),he(I,ie,de,!0),I=null),U.patchFlag===-2&&(q=!1,U.dynamicChildren=null);const{type:Y,ref:te,shapeFlag:ue}=U;switch(Y){case km:g(I,U,j,ee);break;case Co:v(I,U,j,ee);break;case Fd:I==null&&y(U,j,ee,ke);break;case Re:T(I,U,j,ee,ie,de,ke,X,q);break;default:ue&1?C(I,U,j,ee,ie,de,ke,X,q):ue&6?O(I,U,j,ee,ie,de,ke,X,q):(ue&64||ue&128)&&Y.process(I,U,j,ee,ie,de,ke,X,q,ve)}te!=null&&ie?Nd(te,I&&I.ref,de,U||I,!U):te==null&&I&&I.ref!=null&&Nd(I.ref,null,de,I,!0)},g=(I,U,j,ee)=>{if(I==null)o(U.el=a(U.children),j,ee);else{const ie=U.el=I.el;U.children!==I.children&&c(ie,U.children)}},v=(I,U,j,ee)=>{I==null?o(U.el=l(U.children||""),j,ee):U.el=I.el},y=(I,U,j,ee)=>{[I.el,I.anchor]=m(I.children,U,j,ee,I.el,I.anchor)},x=({el:I,anchor:U},j,ee)=>{let ie;for(;I&&I!==U;)ie=f(I),o(I,j,ee),I=ie;o(U,j,ee)},_=({el:I,anchor:U})=>{let j;for(;I&&I!==U;)j=f(I),r(I),I=j;r(U)},C=(I,U,j,ee,ie,de,ke,X,q)=>{if(U.type==="svg"?ke="svg":U.type==="math"&&(ke="mathml"),I==null)D(U,j,ee,ie,de,ke,X,q);else{const Y=I.el&&I.el._isVueCE?I.el:null;try{Y&&Y._beginPatch(),L(I,U,ie,de,ke,X,q)}finally{Y&&Y._endPatch()}}},D=(I,U,j,ee,ie,de,ke,X)=>{let q,Y;const{props:te,shapeFlag:ue,transition:ye,dirs:_e}=I;if(q=I.el=s(I.type,de,te&&te.is,te),ue&8?u(q,I.children):ue&16&&$(I.children,q,null,ee,ie,av(I,de),ke,X),_e&&gl(I,null,ee,"created"),M(q,I,I.scopeId,ke,ee),te){for(const Ee in te)Ee!=="value"&&!Pd(Ee)&&i(q,Ee,null,te[Ee],de,ee);"value"in te&&i(q,"value",null,te.value,de),(Y=te.onVnodeBeforeMount)&&Ui(Y,ee,I)}_e&&gl(I,null,ee,"beforeMount");const Ae=k7(ie,ye);Ae&&ye.beforeEnter(q),o(q,U,j),((Y=te&&te.onVnodeMounted)||Ae||_e)&&yo(()=>{Y&&Ui(Y,ee,I),Ae&&ye.enter(q),_e&&gl(I,null,ee,"mounted")},ie)},M=(I,U,j,ee,ie)=>{if(j&&h(I,j),ee)for(let de=0;de<ee.length;de++)h(I,ee[de]);if(ie){let de=ie.subTree;if(U===de||dC(de.type)&&(de.ssContent===U||de.ssFallback===U)){const ke=ie.vnode;M(I,ke,ke.scopeId,ke.slotScopeIds,ie.parent)}}},$=(I,U,j,ee,ie,de,ke,X,q=0)=>{for(let Y=q;Y<I.length;Y++){const te=I[Y]=X?Ns(I[Y]):Qi(I[Y]);b(null,te,U,j,ee,ie,de,ke,X)}},L=(I,U,j,ee,ie,de,ke)=>{const X=U.el=I.el;let{patchFlag:q,dynamicChildren:Y,dirs:te}=U;q|=I.patchFlag&16;const ue=I.props||Gt,ye=U.props||Gt;let _e;if(j&&vl(j,!1),(_e=ye.onVnodeBeforeUpdate)&&Ui(_e,j,U,I),te&&gl(U,I,j,"beforeUpdate"),j&&vl(j,!0),(ue.innerHTML&&ye.innerHTML==null||ue.textContent&&ye.textContent==null)&&u(X,""),Y?E(I.dynamicChildren,Y,X,j,ee,av(U,ie),de):ke||G(I,U,X,null,j,ee,av(U,ie),de,!1),q>0){if(q&16)N(X,ue,ye,j,ie);else if(q&2&&ue.class!==ye.class&&i(X,"class",null,ye.class,ie),q&4&&i(X,"style",ue.style,ye.style,ie),q&8){const Ae=U.dynamicProps;for(let Ee=0;Ee<Ae.length;Ee++){const Ue=Ae[Ee],Le=ue[Ue],Ge=ye[Ue];(Ge!==Le||Ue==="value")&&i(X,Ue,Le,Ge,ie,j)}}q&1&&I.children!==U.children&&u(X,U.children)}else!ke&&Y==null&&N(X,ue,ye,j,ie);((_e=ye.onVnodeUpdated)||te)&&yo(()=>{_e&&Ui(_e,j,U,I),te&&gl(U,I,j,"updated")},ee)},E=(I,U,j,ee,ie,de,ke)=>{for(let X=0;X<U.length;X++){const q=I[X],Y=U[X],te=q.el&&(q.type===Re||!Ol(q,Y)||q.shapeFlag&198)?d(q.el):j;b(q,Y,te,null,ee,ie,de,ke,!0)}},N=(I,U,j,ee,ie)=>{if(U!==j){if(U!==Gt)for(const de in U)!Pd(de)&&!(de in j)&&i(I,de,U[de],null,ie,ee);for(const de in j){if(Pd(de))continue;const ke=j[de],X=U[de];ke!==X&&de!=="value"&&i(I,de,X,ke,ie,ee)}"value"in j&&i(I,"value",U.value,j.value,ie)}},T=(I,U,j,ee,ie,de,ke,X,q)=>{const Y=U.el=I?I.el:a(""),te=U.anchor=I?I.anchor:a("");let{patchFlag:ue,dynamicChildren:ye,slotScopeIds:_e}=U;_e&&(X=X?X.concat(_e):_e),I==null?(o(Y,j,ee),o(te,j,ee),$(U.children||[],j,te,ie,de,ke,X,q)):ue>0&&ue&64&&ye&&I.dynamicChildren&&I.dynamicChildren.length===ye.length?(E(I.dynamicChildren,ye,j,ie,de,ke,X),(U.key!=null||ie&&U===ie.subTree)&&Py(I,U,!0)):G(I,U,j,te,ie,de,ke,X,q)},O=(I,U,j,ee,ie,de,ke,X,q)=>{U.slotScopeIds=X,I==null?U.shapeFlag&512?ie.ctx.activate(U,j,ee,ke,q):P(U,j,ee,ie,de,ke,q):B(I,U,q)},P=(I,U,j,ee,ie,de,ke)=>{const X=I.component=B7(I,ee,ie);if(ym(I)&&(X.ctx.renderer=ve),L7(X,!1,ke),X.asyncDep){if(ie&&ie.registerDep(X,V,ke),!I.el){const q=X.subTree=H(Co);v(null,q,U,j),I.placeholder=q.el}}else V(X,I,U,j,ie,de,ke)},B=(I,U,j)=>{const ee=U.component=I.component;if(h7(I,U,j))if(ee.asyncDep&&!ee.asyncResolved){z(ee,U,j);return}else ee.next=U,ee.update();else U.el=I.el,ee.vnode=U},V=(I,U,j,ee,ie,de,ke)=>{const X=()=>{if(I.isMounted){let{next:ue,bu:ye,u:_e,parent:Ae,vnode:Ee}=I;{const ut=cC(I);if(ut){ue&&(ue.el=Ee.el,z(I,ue,ke)),ut.asyncDep.then(()=>{yo(()=>{I.isUnmounted||Y()},ie)});return}}let Ue=ue,Le;vl(I,!1),ue?(ue.el=Ee.el,z(I,ue,ke)):ue=Ee,ye&&lp(ye),(Le=ue.props&&ue.props.onVnodeBeforeUpdate)&&Ui(Le,Ae,ue,Ee),vl(I,!0);const Ge=Nw(I),st=I.subTree;I.subTree=Ge,b(st,Ge,d(st.el),Z(st),I,ie,de),ue.el=Ge.el,Ue===null&&p7(I,Ge.el),_e&&yo(_e,ie),(Le=ue.props&&ue.props.onVnodeUpdated)&&yo(()=>Ui(Le,Ae,ue,Ee),ie)}else{let ue;const{el:ye,props:_e}=U,{bm:Ae,m:Ee,parent:Ue,root:Le,type:Ge}=I,st=Yc(U);vl(I,!1),Ae&&lp(Ae),!st&&(ue=_e&&_e.onVnodeBeforeMount)&&Ui(ue,Ue,U),vl(I,!0);{Le.ce&&Le.ce._hasShadowRoot()&&Le.ce._injectChildStyle(Ge);const ut=I.subTree=Nw(I);b(null,ut,j,ee,I,ie,de),U.el=ut.el}if(Ee&&yo(Ee,ie),!st&&(ue=_e&&_e.onVnodeMounted)){const ut=U;yo(()=>Ui(ue,Ue,ut),ie)}(U.shapeFlag&256||Ue&&Yc(Ue.vnode)&&Ue.vnode.shapeFlag&256)&&I.a&&yo(I.a,ie),I.isMounted=!0,U=j=ee=null}};I.scope.on();const q=I.effect=new o3(X);I.scope.off();const Y=I.update=q.run.bind(q),te=I.job=q.runIfDirty.bind(q);te.i=I,te.id=I.uid,q.scheduler=()=>$y(te),vl(I,!0),Y()},z=(I,U,j)=>{U.component=I;const ee=I.vnode.props;I.vnode=U,I.next=null,g7(I,U.props,ee,j),x7(I,U.children,j),ea(),Aw(I),ta()},G=(I,U,j,ee,ie,de,ke,X,q=!1)=>{const Y=I&&I.children,te=I?I.shapeFlag:0,ue=U.children,{patchFlag:ye,shapeFlag:_e}=U;if(ye>0){if(ye&128){ne(Y,ue,j,ee,ie,de,ke,X,q);return}else if(ye&256){K(Y,ue,j,ee,ie,de,ke,X,q);return}}_e&8?(te&16&&we(Y,ie,de),ue!==Y&&u(j,ue)):te&16?_e&16?ne(Y,ue,j,ee,ie,de,ke,X,q):we(Y,ie,de,!0):(te&8&&u(j,""),_e&16&&$(ue,j,ee,ie,de,ke,X,q))},K=(I,U,j,ee,ie,de,ke,X,q)=>{I=I||Uc,U=U||Uc;const Y=I.length,te=U.length,ue=Math.min(Y,te);let ye;for(ye=0;ye<ue;ye++){const _e=U[ye]=q?Ns(U[ye]):Qi(U[ye]);b(I[ye],_e,j,null,ie,de,ke,X,q)}Y>te?we(I,ie,de,!0,!1,ue):$(U,j,ee,ie,de,ke,X,q,ue)},ne=(I,U,j,ee,ie,de,ke,X,q)=>{let Y=0;const te=U.length;let ue=I.length-1,ye=te-1;for(;Y<=ue&&Y<=ye;){const _e=I[Y],Ae=U[Y]=q?Ns(U[Y]):Qi(U[Y]);if(Ol(_e,Ae))b(_e,Ae,j,null,ie,de,ke,X,q);else break;Y++}for(;Y<=ue&&Y<=ye;){const _e=I[ue],Ae=U[ye]=q?Ns(U[ye]):Qi(U[ye]);if(Ol(_e,Ae))b(_e,Ae,j,null,ie,de,ke,X,q);else break;ue--,ye--}if(Y>ue){if(Y<=ye){const _e=ye+1,Ae=_e<te?U[_e].el:ee;for(;Y<=ye;)b(null,U[Y]=q?Ns(U[Y]):Qi(U[Y]),j,Ae,ie,de,ke,X,q),Y++}}else if(Y>ye)for(;Y<=ue;)he(I[Y],ie,de,!0),Y++;else{const _e=Y,Ae=Y,Ee=new Map;for(Y=Ae;Y<=ye;Y++){const It=U[Y]=q?Ns(U[Y]):Qi(U[Y]);It.key!=null&&Ee.set(It.key,Y)}let Ue,Le=0;const Ge=ye-Ae+1;let st=!1,ut=0;const $t=new Array(Ge);for(Y=0;Y<Ge;Y++)$t[Y]=0;for(Y=_e;Y<=ue;Y++){const It=I[Y];if(Le>=Ge){he(It,ie,de,!0);continue}let jt;if(It.key!=null)jt=Ee.get(It.key);else for(Ue=Ae;Ue<=ye;Ue++)if($t[Ue-Ae]===0&&Ol(It,U[Ue])){jt=Ue;break}jt===void 0?he(It,ie,de,!0):($t[jt-Ae]=Y+1,jt>=ut?ut=jt:st=!0,b(It,U[jt],j,null,ie,de,ke,X,q),Le++)}const rn=st?S7($t):Uc;for(Ue=rn.length-1,Y=Ge-1;Y>=0;Y--){const It=Ae+Y,jt=U[It],Hn=U[It+1],Wn=It+1<te?Hn.el||uC(Hn):ee;$t[Y]===0?b(null,jt,j,Wn,ie,de,ke,X,q):st&&(Ue<0||Y!==rn[Ue]?ae(jt,j,Wn,2):Ue--)}}},ae=(I,U,j,ee,ie=null)=>{const{el:de,type:ke,transition:X,children:q,shapeFlag:Y}=I;if(Y&6){ae(I.component.subTree,U,j,ee);return}if(Y&128){I.suspense.move(U,j,ee);return}if(Y&64){ke.move(I,U,j,ve);return}if(ke===Re){o(de,U,j);for(let ue=0;ue<q.length;ue++)ae(q[ue],U,j,ee);o(I.anchor,U,j);return}if(ke===Fd){x(I,U,j);return}if(ee!==2&&Y&1&&X)if(ee===0)X.beforeEnter(de),o(de,U,j),yo(()=>X.enter(de),ie);else{const{leave:ue,delayLeave:ye,afterLeave:_e}=X,Ae=()=>{I.ctx.isUnmounted?r(de):o(de,U,j)},Ee=()=>{de._isLeaving&&de[Zi](!0),ue(de,()=>{Ae(),_e&&_e()})};ye?ye(de,Ae,Ee):Ee()}else o(de,U,j)},he=(I,U,j,ee=!1,ie=!1)=>{const{type:de,props:ke,ref:X,children:q,dynamicChildren:Y,shapeFlag:te,patchFlag:ue,dirs:ye,cacheIndex:_e}=I;if(ue===-2&&(ie=!1),X!=null&&(ea(),Nd(X,null,j,I,!0),ta()),_e!=null&&(U.renderCache[_e]=void 0),te&256){U.ctx.deactivate(I);return}const Ae=te&1&&ye,Ee=!Yc(I);let Ue;if(Ee&&(Ue=ke&&ke.onVnodeBeforeUnmount)&&Ui(Ue,U,I),te&6)fe(I.component,j,ee);else{if(te&128){I.suspense.unmount(j,ee);return}Ae&&gl(I,null,U,"beforeUnmount"),te&64?I.type.remove(I,U,j,ve,ee):Y&&!Y.hasOnce&&(de!==Re||ue>0&&ue&64)?we(Y,U,j,!1,!0):(de===Re&&ue&384||!ie&&te&16)&&we(q,U,j),ee&&ge(I)}(Ee&&(Ue=ke&&ke.onVnodeUnmounted)||Ae)&&yo(()=>{Ue&&Ui(Ue,U,I),Ae&&gl(I,null,U,"unmounted")},j)},ge=I=>{const{type:U,el:j,anchor:ee,transition:ie}=I;if(U===Re){le(j,ee);return}if(U===Fd){_(I);return}const de=()=>{r(j),ie&&!ie.persisted&&ie.afterLeave&&ie.afterLeave()};if(I.shapeFlag&1&&ie&&!ie.persisted){const{leave:ke,delayLeave:X}=ie,q=()=>ke(j,de);X?X(I.el,de,q):q()}else de()},le=(I,U)=>{let j;for(;I!==U;)j=f(I),r(I),I=j;r(U)},fe=(I,U,j)=>{const{bum:ee,scope:ie,job:de,subTree:ke,um:X,m:q,a:Y}=I;Vw(q),Vw(Y),ee&&lp(ee),ie.stop(),de&&(de.flags|=8,he(ke,I,U,j)),X&&yo(X,U),yo(()=>{I.isUnmounted=!0},U)},we=(I,U,j,ee=!1,ie=!1,de=0)=>{for(let ke=de;ke<I.length;ke++)he(I[ke],U,j,ee,ie)},Z=I=>{if(I.shapeFlag&6)return Z(I.component.subTree);if(I.shapeFlag&128)return I.suspense.next();const U=f(I.anchor||I.el),j=U&&U[B3];return j?f(j):U};let be=!1;const re=(I,U,j)=>{let ee;I==null?U._vnode&&(he(U._vnode,null,null,!0),ee=U._vnode.component):b(U._vnode||null,I,U,null,null,null,j),U._vnode=I,be||(be=!0,Aw(ee),$3(),be=!1)},ve={p:b,um:he,m:ae,r:ge,mt:P,mc:$,pc:G,pbc:E,n:Z,o:t};return{render:re,hydrate:void 0,createApp:l7(re)}}function av({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 vl({effect:t,job:e},n){n?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function k7(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function Py(t,e,n=!1){const o=t.children,r=e.children;if(ft(o)&&ft(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]=Ns(r[i]),a.el=s.el),!n&&a.patchFlag!==-2&&Py(s,a)),a.type===km&&(a.patchFlag===-1&&(a=r[i]=Ns(a)),a.el=s.el),a.type===Co&&!a.el&&(a.el=s.el)}}function S7(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 cC(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:cC(e)}function Vw(t){if(t)for(let e=0;e<t.length;e++)t[e].flags|=8}function uC(t){if(t.placeholder)return t.placeholder;const e=t.component;return e?uC(e.subTree):null}const dC=t=>t.__isSuspense;function C7(t,e){e&&e.pendingBranch?ft(t)?e.effects.push(...t):e.effects.push(t):A3(t)}const Re=Symbol.for("v-fgt"),km=Symbol.for("v-txt"),Co=Symbol.for("v-cmt"),Fd=Symbol.for("v-stc"),Vd=[];let Sr=null;function w(t=!1){Vd.push(Sr=t?null:[])}function A7(){Vd.pop(),Sr=Vd[Vd.length-1]||null}let sf=1;function Rp(t,e=!1){sf+=t,t<0&&Sr&&e&&(Sr.hasOnce=!0)}function fC(t){return t.dynamicChildren=sf>0?Sr||Uc:null,A7(),sf>0&&Sr&&Sr.push(t),t}function R(t,e,n,o,r,i){return fC(A(t,e,n,o,r,i,!0))}function Q(t,e,n,o,r){return fC(H(t,e,n,o,r,!0))}function af(t){return t?t.__v_isVNode===!0:!1}function Ol(t,e){return t.type===e.type&&t.key===e.key}const hC=({key:t})=>t??null,up=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?yn(t)||Ze(t)||wt(t)?{i:uo,r:t,k:e,f:!!n}:t:null);function A(t,e=null,n=null,o=0,r=null,i=t===Re?0:1,s=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&hC(e),ref:e&&up(e),scopeId:O3,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:uo};return a?(Dy(l,n),i&128&&t.normalize(l)):n&&(l.shapeFlag|=yn(n)?8:16),sf>0&&!s&&Sr&&(l.patchFlag>0||i&6)&&l.patchFlag!==32&&Sr.push(l),l}const H=$7;function $7(t,e=null,n=null,o=0,r=null,i=!1){if((!t||t===G3)&&(t=Co),af(t)){const a=Va(t,e,!0);return n&&Dy(a,n),sf>0&&!i&&Sr&&(a.shapeFlag&6?Sr[Sr.indexOf(t)]=a:Sr.push(a)),a.patchFlag=-2,a}if(I7(t)&&(t=t.__vccOpts),e){e=ir(e);let{class:a,style:l}=e;a&&!yn(a)&&(e.class=Te(a)),Xt(l)&&(pm(l)&&!ft(l)&&(l=Vn({},l)),e.style=Lt(l))}const s=yn(t)?1:dC(t)?128:L3(t)?64:Xt(t)?4:wt(t)?2:0;return A(t,e,n,o,r,s,i,!0)}function ir(t){return t?pm(t)||oC(t)?Vn({},t):t:null}function Va(t,e,n=!1,o=!1){const{props:r,ref:i,patchFlag:s,children:a,transition:l}=t,c=e?kt(r||{},e):r,u={__v_isVNode:!0,__v_skip:!0,type:t.type,props:c,key:c&&hC(c),ref:e&&e.ref?n&&i?ft(i)?i.concat(up(e)):[i,up(e)]:up(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!==Re?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&&Va(t.ssContent),ssFallback:t.ssFallback&&Va(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return l&&o&&rf(u,l.clone(u)),u}function He(t=" ",e=0){return H(km,null,t,e)}function T7(t,e){const n=H(Fd,null,t);return n.staticCount=e,n}function oe(t="",e=!1){return e?(w(),Q(Co,null,t)):H(Co,null,t)}function Qi(t){return t==null||typeof t=="boolean"?H(Co):ft(t)?H(Re,null,t.slice()):af(t)?Ns(t):H(km,null,String(t))}function Ns(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Va(t)}function Dy(t,e){let n=0;const{shapeFlag:o}=t;if(e==null)e=null;else if(ft(e))n=16;else if(typeof e=="object")if(o&65){const r=e.default;r&&(r._c&&(r._d=!1),Dy(t,r()),r._c&&(r._d=!0));return}else{n=32;const r=e._;!r&&!oC(e)?e._ctx=uo:r===3&&uo&&(uo.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else wt(e)?(e={default:e,_ctx:uo},n=32):(e=String(e),o&64?(n=16,e=[He(e)]):n=8);t.children=e,t.shapeFlag|=n}function kt(...t){const e={};for(let n=0;n<t.length;n++){const o=t[n];for(const r in o)if(r==="class")e.class!==o.class&&(e.class=Te([e.class,o.class]));else if(r==="style")e.style=Lt([e.style,o.style]);else if(om(r)){const i=e[r],s=o[r];s&&i!==s&&!(ft(i)&&i.includes(s))&&(e[r]=i?[].concat(i,s):s)}else r!==""&&(e[r]=o[r])}return e}function Ui(t,e,n,o=null){Ai(t,e,7,[n,o])}const O7=Z3();let M7=0;function B7(t,e,n){const o=t.type,r=(e?e.appContext:t.appContext)||O7,i={uid:M7++,vnode:t,type:o,parent:e,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new n3(!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:iC(o,r),emitsOptions:J3(o,r),emit:null,emitted:null,propsDefaults:Gt,inheritAttrs:o.inheritAttrs,ctx:Gt,data:Gt,props:Gt,attrs:Gt,slots:Gt,refs:Gt,setupState:Gt,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=c7.bind(null,i),t.ce&&t.ce(i),i}let Ao=null;const Do=()=>Ao||uo;let Fp,P1;{const t=lm(),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)}};Fp=e("__VUE_INSTANCE_SETTERS__",n=>Ao=n),P1=e("__VUE_SSR_SETTERS__",n=>lf=n)}const Wf=t=>{const e=Ao;return Fp(t),t.scope.on(),()=>{t.scope.off(),Fp(e)}},zw=()=>{Ao&&Ao.scope.off(),Fp(null)};function pC(t){return t.vnode.shapeFlag&4}let lf=!1;function L7(t,e=!1,n=!1){e&&P1(e);const{props:o,children:r}=t.vnode,i=pC(t);m7(t,o,i,e),y7(t,r,n||e);const s=i?P7(t,e):void 0;return e&&P1(!1),s}function P7(t,e){const n=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,t7);const{setup:o}=n;if(o){ea();const r=t.setupContext=o.length>1?gC(t):null,i=Wf(t),s=Hf(o,t,0,[t.props,r]),a=KS(s);if(ta(),i(),(a||t.sp)&&!Yc(t)&&V3(t),a){if(s.then(zw,zw),e)return s.then(l=>{Hw(t,l)}).catch(l=>{gm(l,t,0)});t.asyncDep=s}else Hw(t,s)}else mC(t)}function Hw(t,e,n){wt(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:Xt(e)&&(t.setupState=w3(e)),mC(t)}function mC(t,e,n){const o=t.type;t.render||(t.render=o.render||yi);{const r=Wf(t);ea();try{n7(t)}finally{ta(),r()}}}const D7={get(t,e){return ko(t,"get",""),t[e]}};function gC(t){const e=n=>{t.exposed=n||{}};return{attrs:new Proxy(t.attrs,D7),slots:t.slots,emit:t.emit,expose:e}}function Sm(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(w3(Oe(t.exposed)),{get(e,n){if(n in e)return e[n];if(n in Rd)return Rd[n](t)},has(e,n){return n in e||n in Rd}})):t.proxy}function E7(t,e=!0){return wt(t)?t.displayName||t.name:t.name||e&&t.__name}function I7(t){return wt(t)&&"__vccOpts"in t}const S=(t,e)=>EL(t,e,lf);function zt(t,e,n){try{Rp(-1);const o=arguments.length;return o===2?Xt(e)&&!ft(e)?af(e)?H(t,null,[e]):H(t,e):H(t,null,e):(o>3?n=Array.prototype.slice.call(arguments,2):o===3&&af(n)&&(n=[n]),H(t,e,n))}finally{Rp(1)}}const N7="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 D1;const Ww=typeof window<"u"&&window.trustedTypes;if(Ww)try{D1=Ww.createPolicy("vue",{createHTML:t=>t})}catch{}const vC=D1?t=>D1.createHTML(t):t=>t,R7="http://www.w3.org/2000/svg",F7="http://www.w3.org/1998/Math/MathML",Es=typeof document<"u"?document:null,Uw=Es&&Es.createElement("template"),V7={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"?Es.createElementNS(R7,t):e==="mathml"?Es.createElementNS(F7,t):n?Es.createElement(t,{is:n}):Es.createElement(t);return t==="select"&&o&&o.multiple!=null&&r.setAttribute("multiple",o.multiple),r},createText:t=>Es.createTextNode(t),createComment:t=>Es.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Es.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{Uw.innerHTML=vC(o==="svg"?`<svg>${t}</svg>`:o==="mathml"?`<math>${t}</math>`:t);const a=Uw.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]}},ba="transition",od="animation",cf=Symbol("_vtc"),bC={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},z7=Vn({},D3,bC),H7=t=>(t.displayName="Transition",t.props=z7,t),Ul=H7((t,{slots:e})=>zt(YL,W7(t),e)),bl=(t,e=[])=>{ft(t)?t.forEach(n=>n(...e)):t&&t(...e)},Gw=t=>t?ft(t)?t.some(e=>e.length>1):t.length>1:!1;function W7(t){const e={};for(const T in t)T in bC||(e[T]=t[T]);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=U7(r),b=m&&m[0],g=m&&m[1],{onBeforeEnter:v,onEnter:y,onEnterCancelled:x,onLeave:_,onLeaveCancelled:C,onBeforeAppear:D=v,onAppear:M=y,onAppearCancelled:$=x}=e,L=(T,O,P,B)=>{T._enterCancelled=B,yl(T,O?u:a),yl(T,O?c:s),P&&P()},E=(T,O)=>{T._isLeaving=!1,yl(T,d),yl(T,h),yl(T,f),O&&O()},N=T=>(O,P)=>{const B=T?M:y,V=()=>L(O,T,P);bl(B,[O,V]),qw(()=>{yl(O,T?l:i),Ts(O,T?u:a),Gw(B)||Yw(O,o,b,V)})};return Vn(e,{onBeforeEnter(T){bl(v,[T]),Ts(T,i),Ts(T,s)},onBeforeAppear(T){bl(D,[T]),Ts(T,l),Ts(T,c)},onEnter:N(!1),onAppear:N(!0),onLeave(T,O){T._isLeaving=!0;const P=()=>E(T,O);Ts(T,d),T._enterCancelled?(Ts(T,f),Xw(T)):(Xw(T),Ts(T,f)),qw(()=>{T._isLeaving&&(yl(T,d),Ts(T,h),Gw(_)||Yw(T,o,g,P))}),bl(_,[T,P])},onEnterCancelled(T){L(T,!1,void 0,!0),bl(x,[T])},onAppearCancelled(T){L(T,!0,void 0,!0),bl($,[T])},onLeaveCancelled(T){E(T),bl(C,[T])}})}function U7(t){if(t==null)return null;if(Xt(t))return[lv(t.enter),lv(t.leave)];{const e=lv(t);return[e,e]}}function lv(t){return tL(t)}function Ts(t,e){e.split(/\s+/).forEach(n=>n&&t.classList.add(n)),(t[cf]||(t[cf]=new Set)).add(e)}function yl(t,e){e.split(/\s+/).forEach(o=>o&&t.classList.remove(o));const n=t[cf];n&&(n.delete(e),n.size||(t[cf]=void 0))}function qw(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let G7=0;function Yw(t,e,n,o){const r=t._endId=++G7,i=()=>{r===t._endId&&o()};if(n!=null)return setTimeout(i,n);const{type:s,timeout:a,propCount:l}=q7(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 q7(t,e){const n=window.getComputedStyle(t),o=m=>(n[m]||"").split(", "),r=o(`${ba}Delay`),i=o(`${ba}Duration`),s=jw(r,i),a=o(`${od}Delay`),l=o(`${od}Duration`),c=jw(a,l);let u=null,d=0,f=0;e===ba?s>0&&(u=ba,d=s,f=i.length):e===od?c>0&&(u=od,d=c,f=l.length):(d=Math.max(s,c),u=d>0?s>c?ba:od:null,f=u?u===ba?i.length:l.length:0);const h=u===ba&&/\b(?:transform|all)(?:,|$)/.test(o(`${ba}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:h}}function jw(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max(...e.map((n,o)=>Kw(n)+Kw(t[o])))}function Kw(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function Xw(t){return(t?t.ownerDocument:document).body.offsetHeight}function Y7(t,e,n){const o=t[cf];o&&(e=(e?[e,...o]:[...o]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}const Vp=Symbol("_vod"),yC=Symbol("_vsh"),lu={name:"show",beforeMount(t,{value:e},{transition:n}){t[Vp]=t.style.display==="none"?"":t.style.display,n&&e?n.beforeEnter(t):rd(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),rd(t,!0),o.enter(t)):o.leave(t,()=>{rd(t,!1)}):rd(t,e))},beforeUnmount(t,{value:e}){rd(t,e)}};function rd(t,e){t.style.display=e?t[Vp]:"none",t[yC]=!e}const xC=Symbol("");function wC(t){const e=Do();if(!e)return;const n=e.ut=(r=t(e.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${e.uid}"]`)).forEach(i=>zp(i,r))},o=()=>{const r=t(e.proxy);e.ce?zp(e.ce,r):E1(e.subTree,r),n(r)};W3(()=>{A3(o)}),vn(()=>{Ke(o,yi,{flush:"post"});const r=new MutationObserver(o);r.observe(e.subTree.el.parentNode,{childList:!0}),ca(()=>r.disconnect())})}function E1(t,e){if(t.shapeFlag&128){const n=t.suspense;t=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{E1(n.activeBranch,e)})}for(;t.component;)t=t.component.subTree;if(t.shapeFlag&1&&t.el)zp(t.el,e);else if(t.type===Re)t.children.forEach(n=>E1(n,e));else if(t.type===Fd){let{el:n,anchor:o}=t;for(;n&&(zp(n,e),n!==o);)n=n.nextSibling}}function zp(t,e){if(t.nodeType===1){const n=t.style;let o="";for(const r in e){const i=cL(e[r]);n.setProperty(`--${r}`,i),o+=`--${r}: ${i};`}n[xC]=o}}const j7=/(?:^|;)\s*display\s*:/;function K7(t,e,n){const o=t.style,r=yn(n);let i=!1;if(n&&!r){if(e)if(yn(e))for(const s of e.split(";")){const a=s.slice(0,s.indexOf(":")).trim();n[a]==null&&dp(o,a,"")}else for(const s in e)n[s]==null&&dp(o,s,"");for(const s in n)s==="display"&&(i=!0),dp(o,s,n[s])}else if(r){if(e!==n){const s=o[xC];s&&(n+=";"+s),o.cssText=n,i=j7.test(n)}}else e&&t.removeAttribute("style");Vp in t&&(t[Vp]=i?o.display:"",t[yC]&&(o.display="none"))}const Zw=/\s*!important$/;function dp(t,e,n){if(ft(n))n.forEach(o=>dp(t,e,o));else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const o=X7(t,e);Zw.test(n)?t.setProperty(aa(o),n.replace(Zw,""),"important"):t[o]=n}}const Qw=["Webkit","Moz","ms"],cv={};function X7(t,e){const n=cv[e];if(n)return n;let o=Or(e);if(o!=="filter"&&o in t)return cv[e]=o;o=sm(o);for(let r=0;r<Qw.length;r++){const i=Qw[r]+o;if(i in t)return cv[e]=i}return e}const Jw="http://www.w3.org/1999/xlink";function e_(t,e,n,o,r,i=aL(e)){o&&e.startsWith("xlink:")?n==null?t.removeAttributeNS(Jw,e.slice(6,e.length)):t.setAttributeNS(Jw,e,n):n==null||i&&!JS(n)?t.removeAttribute(e):t.setAttribute(e,i?"":Si(n)?String(n):n)}function t_(t,e,n,o,r){if(e==="innerHTML"||e==="textContent"){n!=null&&(t[e]=e==="innerHTML"?vC(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=JS(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 Z7(t,e,n,o){t.removeEventListener(e,n,o)}const n_=Symbol("_vei");function Q7(t,e,n,o,r=null){const i=t[n_]||(t[n_]={}),s=i[e];if(o&&s)s.value=o;else{const[a,l]=J7(e);if(o){const c=i[e]=nP(o,r);Ws(t,a,c,l)}else s&&(Z7(t,a,s,l),i[e]=void 0)}}const o_=/(?:Once|Passive|Capture)$/;function J7(t){let e;if(o_.test(t)){e={};let o;for(;o=t.match(o_);)t=t.slice(0,t.length-o[0].length),e[o[0].toLowerCase()]=!0}return[t[2]===":"?t.slice(3):aa(t.slice(2)),e]}let uv=0;const eP=Promise.resolve(),tP=()=>uv||(eP.then(()=>uv=0),uv=Date.now());function nP(t,e){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;Ai(oP(o,n.value),e,5,[o])};return n.value=t,n.attached=tP(),n}function oP(t,e){if(ft(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 r_=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,rP=(t,e,n,o,r,i)=>{const s=r==="svg";e==="class"?Y7(t,o,s):e==="style"?K7(t,n,o):om(e)?wy(e)||Q7(t,e,n,o,i):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):iP(t,e,o,s))?(t_(t,e,o),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&e_(t,e,o,s,i,e!=="value")):t._isVueCE&&(/[A-Z]/.test(e)||!yn(o))?t_(t,Or(e),o,i,e):(e==="true-value"?t._trueValue=o:e==="false-value"&&(t._falseValue=o),e_(t,e,o,s))};function iP(t,e,n,o){if(o)return!!(e==="innerHTML"||e==="textContent"||e in t&&r_(e)&&wt(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 r_(e)&&yn(n)?!1:e in t}const za=t=>{const e=t.props["onUpdate:modelValue"]||!1;return ft(e)?n=>lp(e,n):e};function sP(t){t.target.composing=!0}function i_(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const qr=Symbol("_assign");function s_(t,e,n){return e&&(t=t.trim()),n&&(t=am(t)),t}const uf={created(t,{modifiers:{lazy:e,trim:n,number:o}},r){t[qr]=za(r);const i=o||r.props&&r.props.type==="number";Ws(t,e?"change":"input",s=>{s.target.composing||t[qr](s_(t.value,n,i))}),(n||i)&&Ws(t,"change",()=>{t.value=s_(t.value,n,i)}),e||(Ws(t,"compositionstart",sP),Ws(t,"compositionend",i_),Ws(t,"change",i_))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,oldValue:n,modifiers:{lazy:o,trim:r,number:i}},s){if(t[qr]=za(s),t.composing)return;const a=(i||t.type==="number")&&!/^0\d/.test(t.value)?am(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))}},_C={deep:!0,created(t,e,n){t[qr]=za(n),Ws(t,"change",()=>{const o=t._modelValue,r=cu(t),i=t.checked,s=t[qr];if(ft(o)){const a=ky(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(Pu(o)){const a=new Set(o);i?a.add(r):a.delete(r),s(a)}else s(kC(t,i))})},mounted:a_,beforeUpdate(t,e,n){t[qr]=za(n),a_(t,e,n)}};function a_(t,{value:e,oldValue:n},o){t._modelValue=e;let r;if(ft(e))r=ky(e,o.props.value)>-1;else if(Pu(e))r=e.has(o.props.value);else{if(e===n)return;r=Ra(e,kC(t,!0))}t.checked!==r&&(t.checked=r)}const aP={created(t,{value:e},n){t.checked=Ra(e,n.props.value),t[qr]=za(n),Ws(t,"change",()=>{t[qr](cu(t))})},beforeUpdate(t,{value:e,oldValue:n},o){t[qr]=za(o),e!==n&&(t.checked=Ra(e,o.props.value))}},lP={deep:!0,created(t,{value:e,modifiers:{number:n}},o){const r=Pu(e);Ws(t,"change",()=>{const i=Array.prototype.filter.call(t.options,s=>s.selected).map(s=>n?am(cu(s)):cu(s));t[qr](t.multiple?r?new Set(i):i:i[0]),t._assigning=!0,kn(()=>{t._assigning=!1})}),t[qr]=za(o)},mounted(t,{value:e}){l_(t,e)},beforeUpdate(t,e,n){t[qr]=za(n)},updated(t,{value:e}){t._assigning||l_(t,e)}};function l_(t,e){const n=t.multiple,o=ft(e);if(!(n&&!o&&!Pu(e))){for(let r=0,i=t.options.length;r<i;r++){const s=t.options[r],a=cu(s);if(n)if(o){const l=typeof a;l==="string"||l==="number"?s.selected=e.some(c=>String(c)===String(a)):s.selected=ky(e,a)>-1}else s.selected=e.has(a);else if(Ra(cu(s),e)){t.selectedIndex!==r&&(t.selectedIndex=r);return}}!n&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function cu(t){return"_value"in t?t._value:t.value}function kC(t,e){const n=e?"_trueValue":"_falseValue";return n in t?t[n]:e}const cP=["ctrl","shift","alt","meta"],uP={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)=>cP.some(n=>t[`${n}Key`]&&!e.includes(n))},pn=(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=uP[e[s]];if(a&&a(r,e))return}return t(r,...i)}))},dP={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},ar=(t,e)=>{const n=t._withKeys||(t._withKeys={}),o=e.join(".");return n[o]||(n[o]=(r=>{if(!("key"in r))return;const i=aa(r.key);if(e.some(s=>s===i||dP[s]===i))return t(r)}))},fP=Vn({patchProp:rP},V7);let c_;function hP(){return c_||(c_=w7(fP))}const pP=((...t)=>{const e=hP().createApp(...t),{mount:n}=e;return e.mount=o=>{const r=gP(o);if(!r)return;const i=e._component;!wt(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const s=n(r,!1,mP(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),s},e});function mP(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function gP(t){return yn(t)?document.querySelector(t):t}/*!
|
|
19
|
+
* pinia v3.0.4
|
|
20
|
+
* (c) 2025 Eduardo San Martin Morote
|
|
21
|
+
* @license MIT
|
|
22
|
+
*/let SC;const Cm=t=>SC=t,CC=Symbol();function I1(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var zd;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(zd||(zd={}));function vP(){const t=cm(!0),e=t.run(()=>Fe({}));let n=[],o=[];const r=Oe({install(i){Cm(r),r._a=i,i.provide(CC,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 AC=()=>{};function u_(t,e,n,o=AC){t.add(e);const r=()=>{t.delete(e)&&o()};return!n&&sc()&&Fa(r),r}function Cc(t,...e){t.forEach(n=>{n(...e)})}const bP=t=>t(),d_=Symbol(),dv=Symbol();function N1(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];I1(r)&&I1(o)&&t.hasOwnProperty(n)&&!Ze(o)&&!ss(o)?t[n]=N1(r,o):t[n]=o}return t}const yP=Symbol();function xP(t){return!I1(t)||!Object.prototype.hasOwnProperty.call(t,yP)}const{assign:_a}=Object;function wP(t){return!!(Ze(t)&&t.effect)}function _P(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=mm(n.state.value[t]);return _a(u,i,Object.keys(s||{}).reduce((d,f)=>(d[f]=Oe(S(()=>{Cm(n);const h=n._s.get(t);return s[f].call(h,h)})),d),{}))}return l=$C(t,c,e,n,o,!0),l}function $C(t,e,n={},o,r,i){let s;const a=_a({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 L;c=u=!1,typeof $=="function"?($(o.state.value[t]),L={type:zd.patchFunction,storeId:t,events:h}):(N1(o.state.value[t],$),L={type:zd.patchObject,payload:$,storeId:t,events:h});const E=b=Symbol();kn().then(()=>{b===E&&(c=!0)}),u=!0,Cc(d,L,o.state.value[t])}const v=i?function(){const{state:L}=n,E=L?L():{};this.$patch(N=>{_a(N,E)})}:AC;function y(){s.stop(),d.clear(),f.clear(),o._s.delete(t)}const x=($,L="")=>{if(d_ in $)return $[dv]=L,$;const E=function(){Cm(o);const N=Array.from(arguments),T=new Set,O=new Set;function P(z){T.add(z)}function B(z){O.add(z)}Cc(f,{args:N,name:E[dv],store:C,after:P,onError:B});let V;try{V=$.apply(this&&this.$id===t?this:C,N)}catch(z){throw Cc(O,z),z}return V instanceof Promise?V.then(z=>(Cc(T,z),z)).catch(z=>(Cc(O,z),Promise.reject(z))):(Cc(T,V),V)};return E[d_]=!0,E[dv]=L,E},_={_p:o,$id:t,$onAction:u_.bind(null,f),$patch:g,$reset:v,$subscribe($,L={}){const E=u_(d,$,L.detached,()=>N()),N=s.run(()=>Ke(()=>o.state.value[t],T=>{(L.flush==="sync"?u:c)&&$({storeId:t,type:zd.direct,events:h},T)},_a({},l,L)));return E},$dispose:y},C=po(_);o._s.set(t,C);const M=(o._a&&o._a.runWithContext||bP)(()=>o._e.run(()=>(s=cm()).run(()=>e({action:x}))));for(const $ in M){const L=M[$];if(Ze(L)&&!wP(L)||ss(L))i||(m&&xP(L)&&(Ze(L)?L.value=m[$]:N1(L,m[$])),o.state.value[t][$]=L);else if(typeof L=="function"){const E=x(L,$);M[$]=E,a.actions[$]=L}}return _a(C,M),_a(Dt(C),M),Object.defineProperty(C,"$state",{get:()=>o.state.value[t],set:$=>{g(L=>{_a(L,$)})}}),o._p.forEach($=>{_a(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 Qn(t,e,n){let o;const r=typeof e=="function";o=r?n:e;function i(s,a){const l=Ty();return s=s||(l?Kt(CC,null):null),s&&Cm(s),s=SC,s._s.has(t)||(r?$C(t,e,o,s):_P(t,o,s)),s._s.get(t)}return i.$id=t,i}function Tt(t){const e=Dt(t),n={};for(const o in e){const r=e[o];r.effect?n[o]=S({get:()=>t[o],set(i){t[o]=i}}):(Ze(r)||ss(r))&&(n[o]=Ut(t,o))}return n}function kP(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 Ey(t,e,n){if(n.length===0)return e;const o=n[0];return n.length>1&&(e=Ey(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 TC(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 Ey(t,TC(t[e[0]],Array.prototype.slice.call(e,1)),[e[0]])}function OC(t,e){return e.map(n=>n.split(".")).map(n=>[n,kP(t,n)]).filter(n=>n[1]!==void 0).reduce((n,o)=>Ey(n,o[1],o[0]),{})}function MC(t,e){return e.map(n=>n.split(".")).reduce((n,o)=>TC(n,o),t)}function f_(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?OC(f,i):f,m=s?MC(h,s):h;t.$patch(m)}u&&(l==null||l(c))}catch(d){r&&console.error("[pinia-plugin-persistedstate]",d)}}function h_(t,{storage:e,serializer:n,key:o,debug:r,pick:i,omit:s}){try{const a=i?OC(t,i):t,l=s?MC(a,s):a,c=n.serialize(l);e.setItem(o,c)}catch(a){r&&console.error("[pinia-plugin-persistedstate]",a)}}function SP(t,e){return typeof t=="function"?t(e):typeof t=="string"?t:e}function CP(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=>{f_(r,l,t,a)})},r.$persist=()=>{s.forEach(a=>{h_(r.$state,a)})},s.forEach(a=>{f_(r,a,t),r.$subscribe((l,c)=>h_(c,a),{detached:!0})})}function AP(t={}){return function(e){CP(e,n=>{const o=SP(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 $P=AP();const Iy=(t,e="")=>{const n=`${e}___`;return`___BVN__ID__${t}__${e?n:""}`},el=t=>Iy(t),tl=t=>Iy(`${t}__plugin`),TP=el("checkboxGroup"),BC=el("radioGroup"),LC=el("collapse"),PC=tl("globalShowHideStorage"),DC=el("dropdown"),EC=el("navbar"),OP=tl("rtl"),MP=tl("breadcrumbPlugin"),IC=tl("modalManager"),fp=tl("defaults"),BP=el("inputGroup"),NC=el("buttonGroup"),LP=tl("toast"),PP=tl("modalController"),DP=tl("popover"),RC=el("formGroupPlugin");function ac(t){return sc()?(Fa(t),!0):!1}function FC(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=cm(!0),n=o.run(()=>t(...i))),ac(r),n)}function EP(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 ho(t){return typeof t=="function"?t():p(t)}const VC=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const IP=t=>t!=null,NP=Object.prototype.toString,RP=t=>NP.call(t)==="[object Object]",Ks=()=>{},R1=FP();function FP(){var t,e;return VC&&((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 zC(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 VP(t,e={}){let n,o,r=Ks;const i=a=>{clearTimeout(a),r(),r=Ks};return a=>{const l=ho(t),c=ho(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 zP(...t){let e=0,n,o=!0,r=Ks,i,s,a,l,c;!Ze(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=Ks)};return f=>{const h=ho(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 HP(t){const e=Object.create(null);return n=>e[n]||(e[n]=t(n))}const WP=/-(\w)/g,UP=HP(t=>t.replace(WP,(e,n)=>n?n.toUpperCase():""));function GP(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 qP(...t){if(t.length!==1)return Ut(...t);const e=t[0];return typeof e=="function"?fo(_3(()=>({get:e,set:Ks}))):Fe(e)}function YP(t,e=200,n={}){return zC(VP(e,n),t)}function p_(t,e=200,n=!1,o=!0,r=!1){return zC(zP(e,n,o,r),t)}function Gl(t,e={}){const{method:n="parseFloat",radix:o,nanToZero:r}=e;return S(()=>{let i=ho(t);return typeof i=="string"&&(i=Number[n](i,o)),r&&Number.isNaN(i)&&(i=0),i})}function m_(t={}){const{inheritAttrs:e=!0}=t,n=Ne(),o=se({setup(i,{slots:s}){return()=>{n.value=s.default}}}),r=se({inheritAttrs:e,setup(i,{attrs:s,slots:a}){return()=>{var l;n.value;const c=(l=n.value)==null?void 0:l.call(n,{...jP(s),$slots:a});return e&&(c==null?void 0:c.length)===1?c[0]:c}}});return EP({define:o,reuse:r},[o,r])}function jP(t){const e={};for(const n in t)e[UP(n)]=t[n];return e}const lc=VC?window:void 0;function Ma(t){var e;const n=ho(t);return(e=n==null?void 0:n.$el)!=null?e:n}function Wr(...t){let e,n,o,r;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,o,r]=t,e=lc):[e,n,o,r]=t,!e)return Ks;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=Ke(()=>[Ma(e),ho(r)],([u,d])=>{if(s(),!u)return;const f=RP(d)?{...d}:d;i.push(...n.flatMap(h=>o.map(m=>a(u,h,m,f))))},{immediate:!0,flush:"post"}),c=()=>{l(),s()};return ac(c),c}let g_=!1;function HC(t,e,n={}){const{window:o=lc,ignore:r=[],capture:i=!0,detectIframe:s=!1}=n;if(!o)return Ks;R1&&!g_&&(g_=!0,Array.from(o.document.body.children).forEach(b=>b.addEventListener("click",Ks)),o.document.documentElement.addEventListener("click",Ks));let a=!0;const l=b=>ho(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=Ma(g);return v&&(b.target===v||b.composedPath().includes(v))}});function c(b){const g=ho(b);return g&&g.$.subTree.shapeFlag===16}function u(b,g){const v=ho(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=Ma(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=[Wr(o,"click",b=>{f||(f=!0,setTimeout(()=>{f=!1},0),d(b))},{passive:!0,capture:i}),Wr(o,"pointerdown",b=>{const g=Ma(t);a=!l(b)&&!!(g&&!b.composedPath().includes(g))},{passive:!0}),s&&Wr(o,"blur",b=>{setTimeout(()=>{var g;const v=Ma(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 KP(t){return typeof t=="function"?t:typeof t=="string"?e=>e.key===t:Array.isArray(t)?e=>t.includes(e.key):()=>!0}function Rs(...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=lc,eventName:i="keydown",passive:s=!1,dedupe:a=!1}=o,l=KP(e);return Wr(r,i,u=>{u.repeat&&ho(a)||l(u)&&n(u)},s)}function XP(){const t=Fe(!1),e=Do();return e&&vn(()=>{t.value=!0},e),t}function WC(t){const e=XP();return S(()=>(e.value,!!t()))}function ZP(t,e,n={}){const{window:o=lc,...r}=n;let i;const s=WC(()=>o&&"MutationObserver"in o),a=()=>{i&&(i.disconnect(),i=void 0)},l=S(()=>{const f=ho(t),h=(Array.isArray(f)?f:[f]).map(Ma).filter(IP);return new Set(h)}),c=Ke(()=>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 ac(d),{isSupported:s,stop:d,takeRecords:u}}function id(t,e={}){const{window:n=lc}=e,o=WC(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function");let r;const i=Fe(!1),s=c=>{i.value=c.matches},a=()=>{r&&("removeEventListener"in r?r.removeEventListener("change",s):r.removeListener(s))},l=vm(()=>{o.value&&(a(),r=n.matchMedia(ho(t)),"addEventListener"in r?r.addEventListener("change",s):r.addListener(s),i.value=r.matches)});return ac(()=>{l(),a(),r=void 0}),i}const QP={xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400};function JP(t,e={}){function n(u,d){let f=ho(t[ho(u)]);return d!=null&&(f=GP(f,d)),typeof f=="number"&&(f=`${f}px`),f}const{window:o=lc,strategy:r="min-width"}=e;function i(u){return o?o.matchMedia(u).matches:!1}const s=u=>id(()=>`(min-width: ${n(u)})`,e),a=u=>id(()=>`(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 id(()=>`(min-width: ${n(u,.1)})`,e)},smaller(u){return id(()=>`(max-width: ${n(u,-.1)})`,e)},between(u,d){return id(()=>`(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 mh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},gh="__vueuse_ssr_handlers__",eD=tD();function tD(){return gh in mh||(mh[gh]=mh[gh]||{}),mh[gh]}function nD(t,e){return eD[t]||e}function ts(t,e={}){const{initialValue:n=!1,focusVisible:o=!1,preventScroll:r=!1}=e,i=Fe(!1),s=S(()=>Ma(t));Wr(s,"focus",l=>{var c,u;(!o||(u=(c=l.target).matches)!=null&&u.call(c,":focus-visible"))&&(i.value=!0)}),Wr(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 Ke(s,()=>{a.value=n},{immediate:!0,flush:"post"}),{focused:a}}function fv(t){return typeof Window<"u"&&t instanceof Window?t.document.documentElement:typeof Document<"u"&&t instanceof Document?t.documentElement:t}const oD={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 rD(t={}){const{type:e="page",touch:n=!0,resetOnTouchEnds:o=!1,initialValue:r={x:0,y:0},window:i=lc,target:s=i,scroll:a=!0,eventFilter:l}=t;let c=null,u=0,d=0;const f=Fe(r.x),h=Fe(r.y),m=Fe(null),b=typeof e=="function"?e:oD[e],g=M=>{const $=b(M);c=M,$&&([f.value,h.value]=$,m.value="mouse"),i&&(u=i.scrollX,d=i.scrollY)},v=M=>{if(M.touches.length>0){const $=b(M.touches[0]);$&&([f.value,h.value]=$,m.value="touch")}},y=()=>{if(!c||!i)return;const M=b(c);c instanceof MouseEvent&&M&&(f.value=M[0]+i.scrollX-u,h.value=M[1]+i.scrollY-d)},x=()=>{f.value=r.x,h.value=r.y},_=l?M=>l(()=>g(M),{}):M=>g(M),C=l?M=>l(()=>v(M),{}):M=>v(M),D=l?()=>l(()=>y(),{}):()=>y();if(s){const M={passive:!0};Wr(s,["mousemove","dragover"],_,M),n&&e!=="movement"&&(Wr(s,["touchstart","touchmove"],C,M),o&&Wr(s,"touchend",x,M)),a&&e==="page"&&Wr(i,"scroll",D,{passive:!0})}return{x:f,y:h,sourceType:m}}function UC(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:UC(n)}}function iD(t){const e=t||window.event,n=e.target;return UC(n)?!1:e.touches.length>1?!0:(e.preventDefault&&e.preventDefault(),!1)}const hv=new WeakMap;function sD(t,e=!1){const n=Fe(e);let o=null,r="";Ke(qP(t),a=>{const l=fv(ho(a));if(l){const c=l;if(hv.get(c)||hv.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=fv(ho(t));!a||n.value||(R1&&(o=Wr(a,"touchmove",l=>{iD(l)},{passive:!1})),a.style.overflow="hidden",n.value=!0)},s=()=>{const a=fv(ho(t));!a||!n.value||(R1&&(o==null||o()),a.style.overflow=r,hv.delete(a),n.value=!1)};return ac(s),S({get(){return n.value},set(a){a?i():s()}})}const pv="modal-open",aD=()=>{const t=Kt(IC),e=o=>{t==null||t.removeStack(o),t==null||t.removeRegistry(o)},n=nD("updateHTMLAttrs",(o,r,i)=>{const s=typeof o=="string"?window==null?void 0:window.document.querySelector(o):Ma(o);s&&(r==="class"?s.classList.toggle(pv,i===pv):s.setAttribute(r,i))});return ac(()=>{n("body","class","")}),Ke(()=>t==null?void 0:t.countStack.value,o=>{o!==void 0&&n("body","class",o>0?pv:"")}),{...t,dispose:e}},lD=(t,e)=>{const{pushRegistry:n,pushStack:o,removeStack:r,stack:i,dispose:s,countStack:a}=aD(),l=Do();if(!l||l.type.__name!=="BModal")throw new Error("useModalManager must only use in BModal component");n==null||n(l),ac(()=>{s(l)});const c=(u,d)=>{u?o==null||o(l):d&&!u&&(r==null||r(l))};return c(e,e),Ke(t,c),{activePosition:S(()=>i==null?void 0:i.value.findIndex(u=>{var d,f;return yt((d=u.exposed)==null?void 0:d.id)===yt((f=l.exposed)==null?void 0:f.id)})),activeModalCount:a,stackWithoutSelf:S(()=>(i==null?void 0:i.value.filter(u=>{var d,f;return yt((d=u.exposed)==null?void 0:d.id)!==yt((f=l.exposed)==null?void 0:f.id)}))??[])}},Hp=t=>{if(t)return typeof t=="string"?typeof document>"u"?void 0:document.getElementById(t)??document.querySelector(t)??void 0:t.$el??t},cD=/^[0-9]*\.?[0-9]+$/;function uD(t,e=GC("injectSelf")){const{provides:n}=e;if(n&&t in n)return n[t]}function GC(t,e){const n=Do();if(!n)throw new Error(`[Bvn] ${t} must be called from inside a setup function`);return n}const dD=(t="")=>t.replace(/[^a-z]/gi,"-").replace(/\B([A-Z])/g,"-$1").toLowerCase(),v_=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);function qC(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(v_(i)&&v_(s)){o[r]=qC(i,s);continue}o[r]=s}return o}const fD=(t,e)=>{var n,o;return typeof((n=t.props)==null?void 0:n[e])<"u"||typeof((o=t.props)==null?void 0:o[dD(e)])<"u"};function hD(t={},e){const n=Kt(fp,Fe({})),o=GC("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"&&!fD(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=Ne();vm(()=>{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=uD(fp,o);wi(fp,S(()=>s.value?qC((l==null?void 0:l.value)??{},s.value):l==null?void 0:l.value))}return{props:i,provideSubDefaults:a}}function Ft(t,e){const{props:n,provideSubDefaults:o}=hD(t,e);return o(),n}const $o=(t,e)=>{const n=F3();return S(()=>yt(t)||Iy(n||"",e))},Am=se({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?zt(Oy,{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 pD=Object.defineProperty,mD=(t,e,n)=>e in t?pD(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ps=(t,e,n)=>mD(t,typeof e!="symbol"?e+"":e,n);class Wp{constructor(e,n={}){if(Ps(this,"cancelable",!0),Ps(this,"componentId",null),Ps(this,"_defaultPrevented",!1),Ps(this,"eventType",""),Ps(this,"nativeEvent",null),Ps(this,"_preventDefault"),Ps(this,"relatedTarget",null),Ps(this,"target",null),!e)throw new TypeError(`Failed to construct '${this.constructor.name}'. 1 argument required, ${arguments.length} given.`);Object.assign(this,Wp.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 gD extends Wp{constructor(e,n={}){super(e,n),Ps(this,"trigger",null),Object.assign(this,Wp.Defaults,n,{eventType:e})}static get Defaults(){return{...super.Defaults,trigger:null}}}const b_={name:"fade",enterActiveClass:"",enterFromClass:"showing",enterToClass:"",leaveActiveClass:"",leaveFromClass:"",leaveToClass:"showing",css:!0},$m=(t,e,n,o,r,i={transitionProps:{},showFn:()=>{},hideFn:()=>{}})=>{var s;let a=!1;const l=!!t.value&&!e.initialAnimation||e.visible||!1,c=Fe(!1),u=Fe(l),d=Fe(l);let f=typeof t.value!="boolean";Ke(t,()=>{if(f=typeof t.value!="boolean",a){a=!1;return}t.value?y():x()});const h=Fe(l),m=Fe(!1),b=S(()=>e.noAnimation||e.noFade||h.value||!1);vn(()=>{var le;if(!e.show&&l){const fe=g("show",{cancelable:!0});if(n("show",fe),fe.defaultPrevented){n("show-prevented",g("show-prevented"));return}h.value=!0,t.value||(a=!0,t.value=!0),u.value=!0,d.value=!0,T.value=!0,ae.value=!0,he.value=!0,c.value=!0,(le=i.showFn)==null||le.call(i)}else(e.show||t.value&&e.initialAnimation)&&y()}),Ke(()=>e.visible,le=>{h.value=!0,kn(()=>{le&&(T.value=!0),le?y():x()})}),Ke(()=>e.show,le=>{le?y():x()}),Wr(o,"bv-toggle",()=>{t.value=!t.value});const g=(le,fe={})=>new gD(le,{cancelable:!1,target:(o==null?void 0:o.value)||null,relatedTarget:null,trigger:null,...fe,componentId:r==null?void 0:r.value});let v;const y=()=>{if(c.value)return;const le=g("show",{cancelable:!0});if(n("show",le),le.defaultPrevented){n("show-prevented",g("show-prevented")),T.value&&(T.value=!1),t.value&&!f&&(a=!0,kn(()=>{t.value=!1}));return}u.value=!0,d.value=!0,requestAnimationFrame(()=>{var fe;v=setTimeout(()=>{var we;c.value=!0,(we=i.showFn)==null||we.call(i),t.value||(a=!0,kn(()=>{t.value=!0}))},h.value?0:typeof e.delay=="number"?e.delay:((fe=e.delay)==null?void 0:fe.show)||0)})},x=le=>{var fe;if(!c.value)return;const we=g("hide",{cancelable:!0,trigger:le}),Z=g(le||"ignore",{cancelable:!0,trigger:le});if(le==="backdrop"&&e.noCloseOnBackdrop||le==="esc"&&e.noCloseOnEsc){n("hide-prevented",g("hide-prevented"));return}if(v&&(clearTimeout(v),v=void 0),le&&n(le,Z),n("hide",we),we.defaultPrevented||Z.defaultPrevented){n("hide-prevented",g("hide-prevented")),t.value||kn(()=>{a=!0,t.value=!0});return}setTimeout(()=>{var be;E.value=!0,c.value=!1,(be=i.hideFn)==null||be.call(i),t.value&&(a=!0,t.value=f?0:!1)},h.value?0:typeof e.delay=="number"?e.delay:((fe=e.delay)==null?void 0:fe.hide)||0)},_=p_(le=>x(le),500),C=p_(()=>y(),500),D=()=>{const le=g("toggle",{cancelable:!0});if(n("toggle",le),le.defaultPrevented){n("toggle-prevented",g("toggle-prevented"));return}c.value?x():y()},M=(s=Kt(PC,void 0))==null?void 0:s({id:r.value,toggle:D,show:y,hide:x,value:fo(c)});oa(()=>{M==null||M.unregister()});const $=Fe(!1),L=()=>{e.lazy===!0&&($.value=!0)},E=Fe(!1),N=Fe(!1),T=Fe(!1),O=le=>{var fe,we,Z,be;(we=(fe=i.transitionProps)==null?void 0:fe.onBeforeEnter)==null||we.call(fe,le),(be=(Z=e.transitionProps)==null?void 0:Z.onBeforeEnter)==null||be.call(Z,le),N.value=!0},P=le=>{var fe,we,Z,be;requestAnimationFrame(()=>{requestAnimationFrame(()=>{T.value=!0})}),(we=(fe=i.transitionProps)==null?void 0:fe.onEnter)==null||we.call(fe,le),(be=(Z=e.transitionProps)==null?void 0:Z.onEnter)==null||be.call(Z,le)},B=le=>{var fe,we,Z,be;n("shown",g("shown")),L(),(we=(fe=i.transitionProps)==null?void 0:fe.onAfterEnter)==null||we.call(fe,le),(be=(Z=e.transitionProps)==null?void 0:Z.onAfterEnter)==null||be.call(Z,le),h.value&&requestAnimationFrame(()=>{h.value=!1}),m.value&&(m.value=!1)},V=le=>{var fe,we,Z,be;E.value||(E.value=!0),(we=(fe=i.transitionProps)==null?void 0:fe.onBeforeLeave)==null||we.call(fe,le),(be=(Z=e.transitionProps)==null?void 0:Z.onBeforeLeave)==null||be.call(Z,le)},z=le=>{var fe,we,Z,be;T.value=!1,(we=(fe=i.transitionProps)==null?void 0:fe.onLeave)==null||we.call(fe,le),(be=(Z=e.transitionProps)==null?void 0:Z.onLeave)==null||be.call(Z,le)},G=le=>{var fe,we,Z,be;n("hidden",g("hidden")),(we=(fe=i.transitionProps)==null?void 0:fe.onAfterLeave)==null||we.call(fe,le),(be=(Z=e.transitionProps)==null?void 0:Z.onAfterLeave)==null||be.call(Z,le),E.value=!1,N.value=!1,h.value&&requestAnimationFrame(()=>{h.value=!1}),requestAnimationFrame(()=>{m.value||(u.value=!1)})},K=S(()=>m.value===!0||N.value===!0||e.lazy===!1||e.lazy===!0&&$.value===!0&&e.unmountLazy===!1),ne=Fe(!1);Ke(T,le=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{setTimeout(()=>{ne.value=le},32)})})})})});const ae=Fe(!1),he=Fe(!1),ge={...i.transitionProps,onBeforeEnter:O,onEnter:P,onAfterEnter:B,onBeforeLeave:V,onLeave:z,onAfterLeave:G};return{showRef:c,renderRef:u,renderBackdropRef:d,isVisible:T,isActive:N,trapActive:ne,show:y,hide:x,toggle:D,throttleHide:_,throttleShow:C,buildTriggerableEvent:g,computedNoAnimation:b,localNoAnimation:h,localTemporaryHide:m,isLeaving:E,transitionProps:{...b_,...e.transitionProps,...ge},lazyLoadCompleted:$,markLazyLoadCompleted:L,contentShowing:K,backdropReady:he,backdropVisible:ae,backdropTransitionProps:{...b_,onBeforeEnter:()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{ae.value=!0})}),he.value=!1},onAfterEnter:()=>{he.value=!0},onBeforeLeave:()=>{ae.value=!1},onAfterLeave:()=>{he.value=!1,requestAnimationFrame(()=>{d.value=!1})}}}},Tm=(t,e)=>{const n=t.__vccOpts||t;for(const[o,r]of e)n[o]=r;return n},YC=["top","right","bottom","left"],y_=["start","end"],x_=YC.reduce((t,e)=>t.concat(e,e+"-"+y_[0],e+"-"+y_[1]),[]),Ti=Math.min,So=Math.max,Up=Math.round,vh=Math.floor,as=t=>({x:t,y:t}),vD={left:"right",right:"left",bottom:"top",top:"bottom"},bD={start:"end",end:"start"};function F1(t,e,n){return So(t,Ti(e,n))}function ua(t,e){return typeof t=="function"?t(e):t}function Qr(t){return t.split("-")[0]}function _i(t){return t.split("-")[1]}function jC(t){return t==="x"?"y":"x"}function Ny(t){return t==="y"?"height":"width"}function Ha(t){return["top","bottom"].includes(Qr(t))?"y":"x"}function Ry(t){return jC(Ha(t))}function KC(t,e,n){n===void 0&&(n=!1);const o=_i(t),r=Ry(t),i=Ny(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=qp(s)),[s,qp(s)]}function yD(t){const e=qp(t);return[Gp(t),e,Gp(e)]}function Gp(t){return t.replace(/start|end/g,e=>bD[e])}function xD(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 wD(t,e,n,o){const r=_i(t);let i=xD(Qr(t),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),e&&(i=i.concat(i.map(Gp)))),i}function qp(t){return t.replace(/left|right|bottom|top/g,e=>vD[e])}function _D(t){return{top:0,right:0,bottom:0,left:0,...t}}function Fy(t){return typeof t!="number"?_D(t):{top:t,right:t,bottom:t,left:t}}function uu(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 w_(t,e,n){let{reference:o,floating:r}=t;const i=Ha(e),s=Ry(e),a=Ny(s),l=Qr(e),c=i==="y",u=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,f=o[a]/2-r[a]/2;let h;switch(l){case"top":h={x:u,y:o.y-r.height};break;case"bottom":h={x:u,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:d};break;case"left":h={x:o.x-r.width,y:d};break;default:h={x:o.x,y:o.y}}switch(_i(e)){case"start":h[s]-=f*(n&&c?-1:1);break;case"end":h[s]+=f*(n&&c?-1:1);break}return h}const kD=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}=w_(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}=w_(c,f,l)),b=-1)}return{x:u,y:d,placement:f,strategy:r,middlewareData:h}};async function du(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}=ua(e,t),m=Fy(h),g=a[f?d==="floating"?"reference":"floating":d],v=uu(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=uu(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 SD=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}=ua(t,e)||{};if(c==null)return{};const d=Fy(u),f={x:n,y:o},h=Ry(r),m=Ny(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],D=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let M=D?D[x]:0;(!M||!await(s.isElement==null?void 0:s.isElement(D)))&&(M=a.floating[x]||i.floating[m]);const $=_/2-C/2,L=M/2-b[m]/2-1,E=Ti(d[v],L),N=Ti(d[y],L),T=E,O=M-b[m]-N,P=M/2-b[m]/2+$,B=F1(T,P,O),V=!l.arrow&&_i(r)!=null&&P!==B&&i.reference[m]/2-(P<T?E:N)-b[m]/2<0,z=V?P<T?P-T:P-O:0;return{[h]:f[h]+z,data:{[h]:B,centerOffset:P-B-z,...V&&{alignmentOffset:z}},reset:V}}});function CD(t,e,n){return(t?[...n.filter(r=>_i(r)===t),...n.filter(r=>_i(r)!==t)]:n.filter(r=>Qr(r)===r)).filter(r=>t?_i(r)===t||(e?Gp(r)!==r:!1):!0)}const AD=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=x_,autoAlignment:h=!0,...m}=ua(t,e),b=d!==void 0||f===x_?CD(d||null,h,f):f,g=await du(e,m),v=((n=s.autoPlacement)==null?void 0:n.index)||0,y=b[v];if(y==null)return{};const x=KC(y,i,await(l.isRTL==null?void 0:l.isRTL(c.floating)));if(a!==y)return{reset:{placement:b[0]}};const _=[g[Qr(y)],g[x[0]],g[x[1]]],C=[...((o=s.autoPlacement)==null?void 0:o.overflows)||[],{placement:y,overflows:_}],D=b[v+1];if(D)return{data:{index:v+1,overflows:C},reset:{placement:D}};const M=C.map(E=>{const N=_i(E.placement);return[E.placement,N&&u?E.overflows.slice(0,2).reduce((T,O)=>T+O,0):E.overflows[0],E.overflows]}).sort((E,N)=>E[1]-N[1]),L=((r=M.filter(E=>E[2].slice(0,_i(E[0])?2:3).every(N=>N<=0))[0])==null?void 0:r[0])||M[0][0];return L!==a?{data:{index:v+1,overflows:C},reset:{placement:L}}:{}}}},$D=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}=ua(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=Qr(r),y=Ha(a),x=Qr(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=f||(x||!b?[qp(a)]:yD(a)),D=m!=="none";!f&&D&&C.push(...wD(a,b,m,_));const M=[a,...C],$=await du(e,g),L=[];let E=((o=i.flip)==null?void 0:o.overflows)||[];if(u&&L.push($[v]),d){const P=KC(r,s,_);L.push($[P[0]],$[P[1]])}if(E=[...E,{placement:r,overflows:L}],!L.every(P=>P<=0)){var N,T;const P=(((N=i.flip)==null?void 0:N.index)||0)+1,B=M[P];if(B)return{data:{index:P,overflows:E},reset:{placement:B}};let V=(T=E.filter(z=>z.overflows[0]<=0).sort((z,G)=>z.overflows[1]-G.overflows[1])[0])==null?void 0:T.placement;if(!V)switch(h){case"bestFit":{var O;const z=(O=E.filter(G=>{if(D){const K=Ha(G.placement);return K===y||K==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(K=>K>0).reduce((K,ne)=>K+ne,0)]).sort((G,K)=>G[1]-K[1])[0])==null?void 0:O[0];z&&(V=z);break}case"initialPlacement":V=a;break}if(r!==V)return{reset:{placement:V}}}return{}}}};function __(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function k_(t){return YC.some(e=>t[e]>=0)}const TD=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...r}=ua(t,e);switch(o){case"referenceHidden":{const i=await du(e,{...r,elementContext:"reference"}),s=__(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:k_(s)}}}case"escaped":{const i=await du(e,{...r,altBoundary:!0}),s=__(i,n.floating);return{data:{escapedOffsets:s,escaped:k_(s)}}}default:return{}}}}};function XC(t){const e=Ti(...t.map(i=>i.left)),n=Ti(...t.map(i=>i.top)),o=So(...t.map(i=>i.right)),r=So(...t.map(i=>i.bottom));return{x:e,y:n,width:o-e,height:r-n}}function OD(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=>uu(XC(r)))}const MD=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}=ua(t,e),u=Array.from(await(i.getClientRects==null?void 0:i.getClientRects(o.reference))||[]),d=OD(u),f=uu(XC(u)),h=Fy(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(Ha(n)==="y"){const E=d[0],N=d[d.length-1],T=Qr(n)==="top",O=E.top,P=N.bottom,B=T?E.left:N.left,V=T?E.right:N.right,z=V-B,G=P-O;return{top:O,bottom:P,left:B,right:V,width:z,height:G,x:B,y:O}}const g=Qr(n)==="left",v=So(...d.map(E=>E.right)),y=Ti(...d.map(E=>E.left)),x=d.filter(E=>g?E.left===y:E.right===v),_=x[0].top,C=x[x.length-1].bottom,D=y,M=v,$=M-D,L=C-_;return{top:_,bottom:C,left:D,right:M,width:$,height:L,x:D,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 BD(t,e){const{placement:n,platform:o,elements:r}=t,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=Qr(n),a=_i(n),l=Ha(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=ua(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 LD=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 BD(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}}}}},PD=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}=ua(t,e),c={x:n,y:o},u=await du(e,l),d=Ha(Qr(r)),f=jC(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=F1(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=F1(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}}}}}},DD=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}=ua(t,e),u=await du(e,c),d=Qr(r),f=_i(r),h=Ha(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,_=Ti(b-u[g],y),C=Ti(m-u[v],x),D=!e.middlewareData.shift;let M=_,$=C;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&($=x),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(M=y),D&&!f){const E=So(u.left,0),N=So(u.right,0),T=So(u.top,0),O=So(u.bottom,0);h?$=m-2*(E!==0||N!==0?E+N:So(u.left,u.right)):M=b-2*(T!==0||O!==0?T+O:So(u.top,u.bottom))}await l({...e,availableWidth:$,availableHeight:M});const L=await s.getDimensions(a.floating);return m!==L.width||b!==L.height?{reset:{rects:!0}}:{}}}};function Om(){return typeof window<"u"}function cc(t){return Vy(t)?(t.nodeName||"").toLowerCase():"#document"}function $r(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ys(t){var e;return(e=(Vy(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Vy(t){return Om()?t instanceof Node||t instanceof $r(t).Node:!1}function Oi(t){return Om()?t instanceof Element||t instanceof $r(t).Element:!1}function hs(t){return Om()?t instanceof HTMLElement||t instanceof $r(t).HTMLElement:!1}function S_(t){return!Om()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof $r(t).ShadowRoot}function Uf(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=Mi(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(r)}function ED(t){return["table","td","th"].includes(cc(t))}function Mm(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function zy(t){const e=Hy(),n=Oi(t)?Mi(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 ID(t){let e=Wa(t);for(;hs(e)&&!fu(e);){if(zy(e))return e;if(Mm(e))return null;e=Wa(e)}return null}function Hy(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function fu(t){return["html","body","#document"].includes(cc(t))}function Mi(t){return $r(t).getComputedStyle(t)}function Bm(t){return Oi(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Wa(t){if(cc(t)==="html")return t;const e=t.assignedSlot||t.parentNode||S_(t)&&t.host||ys(t);return S_(e)?e.host:e}function ZC(t){const e=Wa(t);return fu(e)?t.ownerDocument?t.ownerDocument.body:t.body:hs(e)&&Uf(e)?e:ZC(e)}function df(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=ZC(t),i=r===((o=t.ownerDocument)==null?void 0:o.body),s=$r(r);if(i){const a=V1(s);return e.concat(s,s.visualViewport||[],Uf(r)?r:[],a&&n?df(a):[])}return e.concat(r,df(r,[],n))}function V1(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function QC(t){const e=Mi(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=hs(t),i=r?t.offsetWidth:n,s=r?t.offsetHeight:o,a=Up(n)!==i||Up(o)!==s;return a&&(n=i,o=s),{width:n,height:o,$:a}}function Wy(t){return Oi(t)?t:t.contextElement}function jc(t){const e=Wy(t);if(!hs(e))return as(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:i}=QC(e);let s=(i?Up(n.width):n.width)/o,a=(i?Up(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const ND=as(0);function JC(t){const e=$r(t);return!Hy()||!e.visualViewport?ND:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function RD(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==$r(t)?!1:e}function ql(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=Wy(t);let s=as(1);e&&(o?Oi(o)&&(s=jc(o)):s=jc(t));const a=RD(i,n,o)?JC(i):as(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&&Oi(o)?$r(o):o;let m=f,b=V1(m);for(;b&&o&&h!==m;){const g=jc(b),v=b.getBoundingClientRect(),y=Mi(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=V1(m)}}return uu({width:u,height:d,x:l,y:c})}function Uy(t,e){const n=Bm(t).scrollLeft;return e?e.left+n:ql(ys(t)).left+n}function e4(t,e,n){n===void 0&&(n=!1);const o=t.getBoundingClientRect(),r=o.left+e.scrollLeft-(n?0:Uy(t,o)),i=o.top+e.scrollTop;return{x:r,y:i}}function FD(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const i=r==="fixed",s=ys(o),a=e?Mm(e.floating):!1;if(o===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=as(1);const u=as(0),d=hs(o);if((d||!d&&!i)&&((cc(o)!=="body"||Uf(s))&&(l=Bm(o)),hs(o))){const h=ql(o);c=jc(o),u.x=h.x+o.clientLeft,u.y=h.y+o.clientTop}const f=s&&!d&&!i?e4(s,l,!0):as(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 VD(t){return Array.from(t.getClientRects())}function zD(t){const e=ys(t),n=Bm(t),o=t.ownerDocument.body,r=So(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=So(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+Uy(t);const a=-n.scrollTop;return Mi(o).direction==="rtl"&&(s+=So(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:a}}function HD(t,e){const n=$r(t),o=ys(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=Hy();(!c||c&&e==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}return{width:i,height:s,x:a,y:l}}function WD(t,e){const n=ql(t,!0,e==="fixed"),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=hs(t)?jc(t):as(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 C_(t,e,n){let o;if(e==="viewport")o=HD(t,n);else if(e==="document")o=zD(ys(t));else if(Oi(e))o=WD(e,n);else{const r=JC(t);o={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return uu(o)}function t4(t,e){const n=Wa(t);return n===e||!Oi(n)||fu(n)?!1:Mi(n).position==="fixed"||t4(n,e)}function UD(t,e){const n=e.get(t);if(n)return n;let o=df(t,[],!1).filter(a=>Oi(a)&&cc(a)!=="body"),r=null;const i=Mi(t).position==="fixed";let s=i?Wa(t):t;for(;Oi(s)&&!fu(s);){const a=Mi(s),l=zy(s);!l&&a.position==="fixed"&&(r=null),(i?!l&&!r:!l&&a.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||Uf(s)&&!l&&t4(t,s))?o=o.filter(u=>u!==s):r=a,s=Wa(s)}return e.set(t,o),o}function GD(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const s=[...n==="clippingAncestors"?Mm(e)?[]:UD(e,this._c):[].concat(n),o],a=s[0],l=s.reduce((c,u)=>{const d=C_(e,u,r);return c.top=So(d.top,c.top),c.right=Ti(d.right,c.right),c.bottom=Ti(d.bottom,c.bottom),c.left=So(d.left,c.left),c},C_(e,a,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function qD(t){const{width:e,height:n}=QC(t);return{width:e,height:n}}function YD(t,e,n){const o=hs(e),r=ys(e),i=n==="fixed",s=ql(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const l=as(0);if(o||!o&&!i)if((cc(e)!=="body"||Uf(r))&&(a=Bm(e)),o){const f=ql(e,!0,i,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else r&&(l.x=Uy(r));const c=r&&!o&&!i?e4(r,a):as(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 mv(t){return Mi(t).position==="static"}function A_(t,e){if(!hs(t)||Mi(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return ys(t)===n&&(n=n.ownerDocument.body),n}function n4(t,e){const n=$r(t);if(Mm(t))return n;if(!hs(t)){let r=Wa(t);for(;r&&!fu(r);){if(Oi(r)&&!mv(r))return r;r=Wa(r)}return n}let o=A_(t,e);for(;o&&ED(o)&&mv(o);)o=A_(o,e);return o&&fu(o)&&mv(o)&&!zy(o)?n:o||ID(t)||n}const jD=async function(t){const e=this.getOffsetParent||n4,n=this.getDimensions,o=await n(t.floating);return{reference:YD(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function KD(t){return Mi(t).direction==="rtl"}const XD={convertOffsetParentRelativeRectToViewportRelativeRect:FD,getDocumentElement:ys,getClippingRect:GD,getOffsetParent:n4,getElementRects:jD,getClientRects:VD,getDimensions:qD,getScale:jc,isElement:Oi,isRTL:KD};function ZD(t,e){let n=null,o;const r=ys(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=vh(u),m=vh(r.clientWidth-(c+d)),b=vh(r.clientHeight-(u+f)),g=vh(c),y={rootMargin:-h+"px "+-m+"px "+-b+"px "+-g+"px",threshold:So(0,Ti(1,l))||1};let x=!0;function _(C){const D=C[0].intersectionRatio;if(D!==l){if(!x)return s();D?s(!1,D):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 o4(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=Wy(t),u=r||i?[...c?df(c):[],...df(e)]:[];u.forEach(v=>{r&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=c&&a?ZD(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?ql(t):null;l&&g();function g(){const v=ql(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 r4=LD,QD=AD,i4=PD,s4=$D,a4=DD,JD=TD,eE=SD,tE=MD,nE=(t,e,n)=>{const o=new Map,r={platform:XD,...n},i={...r.platform,_c:o};return kD(t,e,{...r,platform:i})};function oE(t){return t!=null&&typeof t=="object"&&"$el"in t}function z1(t){if(oE(t)){const e=t.$el;return Vy(e)&&cc(e)==="#comment"?null:e}return t}function Ic(t){return typeof t=="function"?t():p(t)}function rE(t){return{name:"arrow",options:t,fn(e){const n=z1(Ic(t.element));return n==null?{}:eE({element:n,padding:t.padding}).fn(e)}}}function l4(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function $_(t,e){const n=l4(t);return Math.round(e*n)/n}function c4(t,e,n){n===void 0&&(n={});const o=n.whileElementsMounted,r=S(()=>{var M;return(M=Ic(n.open))!=null?M:!0}),i=S(()=>Ic(n.middleware)),s=S(()=>{var M;return(M=Ic(n.placement))!=null?M:"bottom"}),a=S(()=>{var M;return(M=Ic(n.strategy))!=null?M:"absolute"}),l=S(()=>{var M;return(M=Ic(n.transform))!=null?M:!0}),c=S(()=>z1(t.value)),u=S(()=>z1(e.value)),d=Fe(0),f=Fe(0),h=Fe(a.value),m=Fe(s.value),b=Ne({}),g=Fe(!1),v=S(()=>{const M={position:h.value,left:"0",top:"0"};if(!u.value)return M;const $=$_(u.value,d.value),L=$_(u.value,f.value);return l.value?{...M,transform:"translate("+$+"px, "+L+"px)",...l4(u.value)>=1.5&&{willChange:"transform"}}:{position:h.value,left:$+"px",top:L+"px"}});let y;function x(){if(c.value==null||u.value==null)return;const M=r.value;nE(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=M!==!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 D(){r.value||(g.value=!1)}return Ke([i,s,a,r],x,{flush:"sync"}),Ke([c,u],C,{flush:"sync"}),Ke(r,D,{flush:"sync"}),sc()&&Fa(_),{x:kl(d),y:kl(f),strategy:kl(h),placement:kl(m),middlewareData:kl(b),isPositioned:kl(g),floatingStyles:v,update:x}}const iE=FC(rD),sE=["id"],aE=["id"],lE=se({inheritAttrs:!1,__name:"BPopover",props:lt({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:lt(["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=Ft(t,"BPopover"),i=n,s=bs(),a=mt(t,"modelValue"),l=$o(()=>r.id,"popover"),c=Fe(!1),u=bt("_element"),d=bt("_content"),f=bt("_arrow"),h=bt("_placeholder"),m=Fe(null),b=Fe(null),g=S(()=>r.placement.startsWith("auto")),v=Gl(()=>r.offset??NaN),y=S(()=>Gy(r.boundary)?r.boundary:void 0),x=S(()=>d4(r.boundary)?r.boundary:void 0),_=Fe({}),C=S(()=>{if(r.floatingMiddleware!==void 0)return r.floatingMiddleware;const U=r.offset!==null?v.value:r.tooltip?6:8,j=[r4(U)];return r.noFlip===!1&&!g.value&&j.push(s4({boundary:y.value,rootBoundary:x.value,padding:r.boundaryPadding})),g.value&&j.push(QD({alignment:r.placement.split("-")[1]||void 0,boundary:y.value,rootBoundary:x.value,padding:r.boundaryPadding})),r.noShift===!1&&j.push(i4({boundary:y.value,rootBoundary:x.value,padding:r.boundaryPadding})),r.noHide===!1&&j.push(JD({boundary:y.value,rootBoundary:x.value,padding:r.boundaryPadding})),r.inline===!0&&j.push(tE()),j.push(rE({element:f,padding:10})),r.noSize===!1&&j.push(a4({boundary:y.value,rootBoundary:x.value,padding:r.boundaryPadding,apply({availableWidth:ee,availableHeight:ie}){var de,ke;_.value={maxHeight:ie>=(((de=d.value)==null?void 0:de.scrollHeight)??0)?void 0:ie?`${Math.max(0,ie)}px`:void 0,maxWidth:ee>=(((ke=d.value)==null?void 0:ke.scrollWidth)??0)?void 0:ee?`${Math.max(0,ee)}px`:void 0}}})),j}),D=S(()=>g.value?void 0:r.placement),{floatingStyles:M,middlewareData:$,placement:L,update:E}=c4(m,u,{placement:D,middleware:C,strategy:Ut(()=>r.strategy)}),N=Fe({position:"absolute"});Ke($,U=>{var j,ee;if(r.noHide===!1&&((j=U.hide)!=null&&j.referenceHidden&&!c.value&&O.value?r.closeOnHide&&!r.noAutoClose&&!r.manual?z("close-on-hide"):(ge.value=!0,c.value=!0):ge.value&&!((ee=U.hide)!=null&&ee.referenceHidden)&&(ge.value=!1,c.value=!1)),U.arrow){const{x:ie,y:de}=U.arrow;N.value={position:"absolute",top:de?`${de}px`:"",left:ie?`${ie}px`:""}}});let T;const{showRef:O,hide:P,show:B,toggle:V,throttleHide:z,computedNoAnimation:G,transitionProps:K,contentShowing:ne,isVisible:ae,renderRef:he,localTemporaryHide:ge}=$m(a,r,i,u,l,{showFn:()=>{E(),kn(()=>{T=o4(m.value,u.value,E,{animationFrame:r.realtime})})},hideFn:()=>{T&&(T(),T=void 0)}}),le=S(()=>{const U=r.tooltip?"tooltip":"popover";return[U,`b-${U}`,{[`b-${U}-${r.variant}`]:r.variant!==null,show:ae.value&&!c.value,fade:!G.value,[`${r.customClass}`]:r.customClass!==void 0,[`bs-${U}-${cE(L.value)}`]:L.value!==void 0}]}),{x:fe,y:we}=iE(),Z=()=>{var U,j;const ee=(U=b.value)==null?void 0:U.getBoundingClientRect(),ie=(j=u.value)==null?void 0:j.getBoundingClientRect(),de=parseInt(r.hideMargin,10)||0,ke=(window==null?void 0:window.scrollX)||0,X=(window==null?void 0:window.scrollY)||0,q=!ee||fe.value<ee.left+ke-de||fe.value>ee.right+ke+de||we.value<ee.top+X-de||we.value>ee.bottom+X+de,Y=!ie||fe.value<ie.left+ke-de||fe.value>ie.right+ke+de||we.value<ie.top+X-de||we.value>ie.bottom+X+de;return{triggerIsOutside:q,isOutside:Y}};let be;const re=U=>{var j,ee,ie;const de=typeof r.delay=="number"?r.delay:((j=r.delay)==null?void 0:j.hide)||0,{triggerIsOutside:ke,isOutside:X}=Z();!r.noninteractive&&X&&ke&&!((ee=u.value)!=null&&ee.contains(document==null?void 0:document.activeElement))&&!((ie=b.value)!=null&&ie.contains(document==null?void 0:document.activeElement))||r.noninteractive&&ke?P(U==null?void 0:U.type):(be&&clearTimeout(be),be=setTimeout(()=>{re(U)},de<50?50:de))};Ke(ae,()=>{E()}),e({hide:P,show:B,toggle:V});const ve=U=>{O.value?P(U.type==="click"?"click":"toggle"):B()},ce=()=>{var U;if(r.target){const j=Hp(yt(r.target));j?b.value=j:console.warn("Target element not found",r.target)}else b.value=(U=h.value)==null?void 0:U.nextElementSibling;if(r.reference){const j=Hp(yt(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",B),b.value.addEventListener("pointerleave",re),b.value.addEventListener("focus",B),b.value.addEventListener("blur",re)}},I=()=>{b.value&&(b.value.removeEventListener("click",ve),b.value.removeEventListener("pointerenter",B),b.value.removeEventListener("pointerleave",re),b.value.removeEventListener("focus",B),b.value.removeEventListener("blur",re))};return HC(u,()=>{O.value&&r.click&&!r.noAutoClose&&!r.manual&&P("click-outside")},{ignore:[b]}),Ke([()=>r.click,()=>r.target,()=>r.reference],()=>{I(),ce()}),vn(()=>{ce(),kn(()=>{E()})}),oa(I),(U,j)=>(w(),R(Re,null,[A("span",{id:p(l)+"_placeholder",ref:"_placeholder",style:{display:"none"}},null,8,sE),Ce(U.$slots,"target",{show:p(B),hide:p(P),toggle:p(V),visible:p(O)},void 0,!0),H(Am,{to:p(r).teleportTo,disabled:!p(r).teleportTo||p(r).teleportDisabled},{default:J(()=>[p(he)||p(ne)?(w(),Q(Ul,kt({key:0},p(K),{appear:a.value||p(r).visible}),{default:J(()=>[Go(A("div",kt({id:p(l)},U.$attrs,{ref:"_element",class:le.value,role:"tooltip",tabindex:"-1",style:p(M)}),[A("div",{ref:"_arrow",class:Te(`${p(r).tooltip?"tooltip":"popover"}-arrow`),style:Lt(N.value),"data-popper-arrow":""},null,6),A("div",{ref:"_content",class:"overflow-auto",style:Lt(_.value)},[p(r).title||s.title?(w(),R("div",{key:0,class:Te(["position-sticky top-0",p(r).tooltip?"tooltip-inner":"popover-header"])},[Ce(U.$slots,"title",{},()=>[He(pe(p(r).title),1)],!0)],2)):oe("",!0),p(r).tooltip&&!s.title&&!p(r).title||!p(r).tooltip?(w(),R("div",{key:1,class:Te(p(r).tooltip?"tooltip-inner":"popover-body")},[Ce(U.$slots,"default",{},()=>[He(pe(p(r).content),1)],!0)],2)):oe("",!0)],4)],16,aE),[[lu,p(O)&&!c.value]])]),_:3},16,["appear"])):oe("",!0)]),_:3},8,["to","disabled"])],64))}}),u4=Tm(lE,[["__scopeId","data-v-9445feff"]]),cE=t=>{const[e]=t.split("-");switch(e){case"left":return"start";case"right":return"end";default:return e}},uE=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}},Gy=t=>t==="clippingAncestors"||t instanceof Element||Array.isArray(t),d4=t=>!Gy(t),dE=(t,e)=>[...e].reduce((n,o)=>(n[o]=t[o],n),{}),sd=(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},fE=["type","disabled","aria-label"],f4=se({__name:"BCloseButton",props:{ariaLabel:{default:"Close"},disabled:{type:Boolean,default:!1},type:{default:"button"}},emits:["click"],setup(t,{emit:e}){const o=Ft(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,fE))}}),hE=(t=[])=>{const{activeElement:e}=document;return e&&!(t!=null&&t.some(n=>n===e))?e:null},pE=(t,e={})=>{const n=o=>o===hE();try{t.focus(e)}catch(o){console.error(o)}return n(t)},hu=t=>((t==null?void 0:t())??[]).length===0,h4=t=>{if(t.getAttribute("display")==="none")return!1;const e=t.getBoundingClientRect();return!!(e&&e.height>0&&e.width>0)},ls=t=>S(()=>{let e=yt(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}}),mE={key:0,class:"visually-hidden"},gE=se({__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=Ft(t,"BSpinner"),o=bs(),r=ls(S(()=>({textVariant:n.variant}))),i=S(()=>[`spinner-${n.type}`,r.value,{[`spinner-${n.type}-sm`]:n.small}]),s=S(()=>!hu(o.label));return(a,l)=>(w(),Q(Rt(p(n).tag),{class:Te(i.value),role:p(n).label||s.value?p(n).role:null,"aria-hidden":p(n).label||s.value?null:!0},{default:J(()=>[p(n).label||s.value?(w(),R("span",mE,[Ce(a.$slots,"label",{},()=>[He(pe(p(n).label),1)])])):oe("",!0)]),_:3},8,["class","role","aria-hidden"]))}}),vE=t=>{const e=t.trim();return e.charAt(0).toUpperCase()+e.slice(1)},bE=t=>t.replace(/-./g,e=>e.charAt(1).toUpperCase()).replace(/\b\w/g,e=>e.toUpperCase()).replace(/\s+/g,""),yE=t=>!!(t.href||t.to),qy=(t,e)=>{const n=fo(Ut(e)),o=fo(Ut(t)),r=S(()=>yE(o.value)),i=S(()=>r.value?dE(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}},xE=t=>{const e=Do(),n=e==null?void 0:e.appContext.app.config.globalProperties.$router,o=e==null?void 0:e.appContext.app.config.globalProperties.$route,r=Rt("RouterLink"),i=typeof r=="string"?null:r.useLink,s=Ut(t),a=Ut(()=>s.value.to||""),l=Ut(()=>s.value.replace),c=S(()=>bE(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 D=C.path||"",M=C.query?`?${Object.keys(C.query).map(L=>{var E;return`${L}=${(E=C.query)==null?void 0:E[L]}`}).join("=")}`:"",$=!C.hash||C.hash.charAt(0)==="#"?C.hash||"":`#${C.hash}`;return`${D}${M}${$}`||_}return _});return{isNonStandardTag:h,tag:u,isRouterLink:d,isNuxtLink:f,computedHref:y,routerName:c,router:n,route:o,link:v,linkProps:b}},p4=t=>S(()=>{const e=yt(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}}),T_="active",Yy=se({__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=Ft(t,"BLink"),r=e,i=Du(),{computedHref:s,tag:a,link:l,isNuxtLink:c,isRouterLink:u,linkProps:d,isNonStandardTag:f}=xE(S(()=>({routerComponentName:o.routerComponentName,disabled:o.disabled,to:o.to,replace:o.replace,href:o.href}))),h=Kt(LC,null),m=Kt(EC,null),b=p4(o),g=S(()=>{var M,$;return[b.value,i.class,v.value,{[T_]:o.active,[o.activeClass]:((M=l.value)==null?void 0:M.isActive.value)||!1,[o.exactActiveClass]:(($=l.value)==null?void 0:$.isExactActive.value)||!1,"stretched-link":o.stretched===!0}]}),v=S(()=>({[T_]:o.active,disabled:o.disabled})),y=M=>{var $,L,E;if(o.disabled){M.preventDefault(),M.stopImmediatePropagation();return}((($=h==null?void 0:h.isNav)==null?void 0:$.value)===!0&&m===null||m!==null&&((L=m.autoClose)==null?void 0:L.value)===!0)&&((E=h==null?void 0:h.hide)==null||E.call(h)),r("click",M)},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})),D=S(()=>({...u.value?d.value:void 0,...c.value||f.value?C.value:void 0}));return(M,$)=>(w(),Q(Rt(p(a)),kt({class:g.value,target:p(o).target,href:p(s),rel:x.value,tabindex:_.value,"aria-disabled":p(o).disabled?!0:null},D.value,{onClick:$[0]||($[0]=L=>{var E;y(L),(E=p(l))==null||E.navigate(L)})}),{default:J(()=>[Ce(M.$slots,"default")]),_:3},16,["class","target","href","rel","tabindex","aria-disabled"]))}}),qo=se({__name:"BButton",props:lt({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:lt(["click"],["update:pressed"]),setup(t,{emit:e}){const o=Ft(t,"BButton"),r=e,i=bt("_element"),s=mt(t,"pressed"),{computedLink:a,computedLinkProps:l}=qy(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=p4(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?Yy:o.href?"a":o.tag),_=C=>{if(o.disabled){C.preventDefault(),C.stopPropagation();return}r("click",C),c.value&&(s.value=!s.value)};return Rs([" ","enter"],C=>{var D;o.href==="#"&&(C.preventDefault(),(D=i.value)==null||D.click())},{target:i}),(C,D)=>(w(),Q(Rt(x.value),kt({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:J(()=>[p(o).loading?Ce(C.$slots,"loading",{key:0},()=>[p(o).loadingFill?oe("",!0):(w(),R(Re,{key:0},[He(pe(p(o).loadingText),1)],64)),Ce(C.$slots,"loading-spinner",{},()=>[H(gE,{small:p(o).size!=="lg",label:p(o).loadingFill?p(o).loadingText:void 0},null,8,["small","label"])])]):Ce(C.$slots,"default",{key:1})]),_:3},16,["class","aria-disabled","aria-pressed","autocomplete","disabled","href","rel","role","target","type","to"]))}}),Lm=se({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,{}):zt(t.tag,{...n},[(r=e.default)==null?void 0:r.call(e,{})])}}}),jy=se({__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=Ft(t,"BBadge"),{computedLink:o,computedLinkProps:r}=qy(n,["active","activeClass","append","disabled","href","rel","replace","routerComponentName","target","to","opacity","opacityHover","underlineVariant","underlineOffset","underlineOffsetHover","underlineOpacity","underlineOpacityHover","icon"]),i=S(()=>o.value?Yy: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=ls(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(),Q(Rt(i.value),kt({class:["badge",l.value]},p(r)),{default:J(()=>[H(Lm,kt({skip:p(n).dotIndicator!==!0,tag:"span"},p(n).dotIndicator?{class:"visually-hidden"}:{}),{default:J(()=>[Ce(c.$slots,"default")]),_:3},16,["skip"])]),_:3},16,["class"]))}}),wE=(t,e="px")=>S(()=>{const n=yt(t),o=yt(e);return cD.test(String(n))?`${Number(n)}${o}`:n}),_E=se({__name:"BButtonGroup",props:{ariaLabel:{default:"Group"},size:{default:"md"},tag:{default:"div"},vertical:{type:Boolean,default:!1}},setup(t){wi(NC,!0);const n=Ft(t,"BButtonGroup"),o=S(()=>({"btn-group":!n.vertical,[`btn-group-${n.size}`]:n.size!=="md","btn-group-vertical":n.vertical}));return(r,i)=>(w(),Q(Rt(p(n).tag),{class:Te(o.value),role:"group","aria-label":p(n).ariaLabel},{default:J(()=>[Ce(r.$slots,"default")]),_:3},8,["class","aria-label"]))}}),gv=(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),[]),O_=se({__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=Ft(t,"BCol"),o=S(()=>[...gv({sm:n.sm,md:n.md,lg:n.lg,xl:n.xl,xxl:n.xxl},["sm","md","lg","xl","xxl"],"col"),...gv({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"),...gv({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(),Q(Rt(p(n).tag),{class:Te(r.value)},{default:J(()=>[Ce(i.$slots,"default")]),_:3},8,["class"]))}}),kE={class:"visually-hidden"},SE=["id","aria-labelledby","role"],CE=se({__name:"BDropdown",props:lt({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:lt(["split-click","hide","hide-prevented","hidden","show","show-prevented","shown","toggle","toggle-prevented"],["update:modelValue"]),setup(t,{expose:e,emit:n}){const r=Ft(t,"BDropdown"),i=n,s=$o(()=>r.id,"dropdown"),a=mt(t,"modelValue"),l=Kt(BP,!1),c=Kt(NC,!1),u=S(()=>typeof r.offset=="string"||typeof r.offset=="number"?r.offset:NaN),d=Gl(u),f=bt("_floating"),h=bt("_button"),m=bt("_splitButton"),b=S(()=>Gy(r.boundary)?r.boundary:void 0),g=S(()=>d4(r.boundary)?r.boundary:void 0),v=S(()=>r.split?h.value:m.value),{showRef:y,renderRef:x,hide:_,show:C,toggle:D,computedNoAnimation:M,transitionProps:$,contentShowing:L,isVisible:E}=$m(a,r,i,v,s),N=S(()=>[{show:E.value,fade:!M.value}]);Rs("Escape",()=>{var ge;_(),(ge=Hp(v.value))==null||ge.focus()},{target:v}),Rs("Escape",()=>{var ge;_(),(ge=Hp(v.value))==null||ge.focus()},{target:f});const T=(ge,le)=>{var fe,we,Z,be,re,ve,ce;if((we=f.value)!=null&&we.contains((fe=ge.target)==null?void 0:fe.closest("form"))||/input|select|option|textarea|form/i.test((Z=ge.target)==null?void 0:Z.tagName))return;if(ge.preventDefault(),!y.value){C();const U=setInterval(()=>{E.value&&(clearInterval(U),kn(()=>T(ge,le)))},16);return}const I=(be=f.value)==null?void 0:be.querySelectorAll(".dropdown-item:not(.disabled):not(:disabled)");if(I)if((re=f.value)!=null&&re.contains(document.activeElement)){const U=f.value.querySelector(".dropdown-item:focus"),j=Array.prototype.indexOf.call(I,U)+le;j>=0&&j<(I==null?void 0:I.length)&&((ve=I[j])==null||ve.focus())}else(ce=I[le===-1?I.length-1:0])==null||ce.focus()};Rs("ArrowUp",ge=>T(ge,-1),{target:v}),Rs("ArrowDown",ge=>T(ge,1),{target:v}),Rs("ArrowUp",ge=>T(ge,-1),{target:f}),Rs("ArrowDown",ge=>T(ge,1),{target:f});const O=Fe({}),P=S(()=>{if(r.floatingMiddleware!==void 0)return r.floatingMiddleware;const ge=typeof r.offset=="string"||typeof r.offset=="number"?d.value:r.offset,le=[r4(ge)];return r.noFlip===!1&&le.push(s4({boundary:b.value,rootBoundary:g.value,padding:r.boundaryPadding})),r.noShift===!1&&le.push(i4({boundary:b.value,rootBoundary:g.value,padding:r.boundaryPadding})),r.noSize===!1&&le.push(a4({boundary:b.value,rootBoundary:g.value,padding:r.boundaryPadding,apply({availableWidth:fe,availableHeight:we}){var Z,be;O.value={maxHeight:we>=(((Z=f.value)==null?void 0:Z.scrollHeight)??0)?void 0:we?`${Math.max(0,we)}px`:void 0,maxWidth:fe>=(((be=f.value)==null?void 0:be.scrollWidth)??0)?void 0:fe?`${Math.max(0,fe)}px`:void 0}}})),le}),{update:B,floatingStyles:V}=c4(v,f,{placement:()=>r.placement,middleware:P,strategy:Ut(()=>r.strategy),whileElementsMounted:o4}),z=c?{class:"btn-group",role:"group"}:void 0,G=S(()=>[z==null?void 0:z.class,r.wrapperClass,{"btn-group":!r.wrapperClass&&r.split,[`drop${uE(r.placement)}`]:!r.wrapperClass,"position-static":r.boundary!=="clippingAncestors"&&!r.isNav}]),K=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}]),ne=()=>{D()},ae=ge=>{if(r.split){i("split-click",ge);return}ne()};HC(f,()=>{y.value&&(r.autoClose===!0||r.autoClose==="outside")&&_()},{ignore:[h,m]});const he=()=>{y.value&&(r.autoClose===!0||r.autoClose==="inside")&&_()};return Ke(E,()=>{B()}),e({hide:_,show:C,toggle:D}),wi(DC,{id:s,show:C,hide:_,toggle:D,visible:Ut(()=>y.value),isNav:Ut(()=>r.isNav)}),(ge,le)=>{var fe;return w(),Q(Lm,{skip:p(l)||p(r).noWrapper,class:Te(G.value),role:(fe=p(z))==null?void 0:fe.role},{default:J(()=>[H(qo,{id:p(s),ref:"_splitButton",variant:p(r).splitVariant||p(r).variant,size:p(r).size,class:Te(K.value),disabled:p(r).splitDisabled||p(r).disabled,type:p(r).splitButtonType,"aria-label":p(r).ariaLabel,"aria-expanded":p(r).split?void 0:p(y),"aria-haspopup":p(r).split?void 0:"menu",href:p(r).split?p(r).splitHref:void 0,to:p(r).split&&p(r).splitTo?p(r).splitTo:void 0,onClick:ae},{default:J(()=>[Ce(ge.$slots,"button-content",{},()=>[He(pe(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(),Q(qo,{key:0,id:p(s)+"-split",ref:"_button",variant:p(r).variant,size:p(r).size,disabled:p(r).disabled,class:Te([[p(r).toggleClass,{show:p(y)}],"dropdown-toggle-split dropdown-toggle"]),"aria-expanded":p(y),"aria-haspopup":"menu",onClick:ne},{default:J(()=>[A("span",kE,[Ce(ge.$slots,"toggle-text",{},()=>[He(pe(p(r).toggleText),1)],!0)])]),_:3},8,["id","variant","size","disabled","class","aria-expanded"])):oe("",!0),H(Am,{to:p(r).teleportTo,disabled:!p(r).teleportTo||p(r).teleportDisabled},{default:J(()=>[p(x)||p(L)?(w(),Q(Ul,kt({key:0},p($),{appear:a.value||p(r).visible}),{default:J(()=>[Go(A("ul",{id:p(s)+"-menu",ref:"_floating",style:Lt([p(V),O.value]),class:Te(["dropdown-menu overflow-auto",[p(r).menuClass,N.value]]),"aria-labelledby":p(s),role:p(r).role,onClick:he},[p(L)?Ce(ge.$slots,"default",{key:0,hide:p(_),show:p(C),visible:p(y)},void 0,!0):oe("",!0)],14,SE),[[lu,p(y)]])]),_:3},16,["appear"])):oe("",!0)]),_:3},8,["to","disabled"])]),_:3},8,["skip","class","role"])}}}),Pm=Tm(CE,[["__scopeId","data-v-8ac2524d"]]),AE=se({inheritAttrs:!1,__name:"BDropdownDivider",props:{dividerClass:{default:void 0},tag:{default:"hr"},variant:{},wrapperAttrs:{default:void 0}},setup(t){const e=Du(),n=S(()=>{const{class:i,...s}=e;return{wrapperClass:i,dividerAttrs:s}}),r=Ft(t,"BDropdownDivider");return(i,s)=>(w(),R("li",kt({role:"presentation",class:n.value.wrapperClass},i.wrapperAttrs),[(w(),Q(Rt(p(r).tag),kt({class:["dropdown-divider",p(r).dividerClass],role:"separator","aria-orientation":"horizontal"},n.value.dividerAttrs),null,16,["class"]))],16))}}),m4=se({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=Ft(t,"BDropdownItem"),r=e,i=Du(),s=S(()=>{const{class:g,...v}=i;return{wrapperClass:g,dropdownItemAttrs:v}}),{computedLink:a,computedLinkProps:l}=qy(o),c=ls(S(()=>({textVariant:o.variant}))),u=S(()=>[o.linkClass,c.value,{active:o.active,disabled:o.disabled}]),d=S(()=>a.value?Yy:o.href?"a":"button"),f=Kt(LC,null),h=Kt(DC,null),m=Kt(EC,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",kt({role:"presentation",class:s.value.wrapperClass},p(o).wrapperAttrs),[(w(),Q(Rt(d.value),kt({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:J(()=>[Ce(g.$slots,"default")]),_:3},16,["class","disabled","aria-disabled","aria-current","href","rel","type","target"]))],16))}}),$E=["disabled"],g4=se({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=Ft(t,"BDropdownItemButton"),r=e,i=Du(),s=S(()=>{const{class:u,...d}=i;return{wrapperClass:u,buttonAttrs:d}}),a=ls(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",kt({role:"presentation",class:s.value.wrapperClass},p(o).wrapperAttrs),[A("button",kt({role:"menu",type:"button",class:["dropdown-item",l.value],disabled:p(o).disabled},s.value.buttonAttrs,{onClick:c}),[Ce(u.$slots,"default")],16,$E)],16))}}),TE=se({inheritAttrs:!1,__name:"BDropdownText",props:{textClass:{default:void 0},tag:{default:"span"},text:{default:void 0},variant:{default:null},wrapperAttrs:{default:void 0}},setup(t){const e=Du(),n=S(()=>{const{class:s,...a}=e;return{wrapperClass:s,textAttrs:a}}),r=Ft(t,"BDropdownText"),i=ls(S(()=>({textVariant:r.variant})));return(s,a)=>(w(),R("li",kt({role:"presentation",class:n.value.wrapperClass},s.wrapperAttrs),[(w(),Q(Rt(p(r).tag),kt({class:["dropdown-item-text",[p(i),p(r).textClass]]},n.value.textAttrs),{default:J(()=>[Ce(s.$slots,"default",{},()=>[He(pe(p(r).text),1)])]),_:3},16,["class"]))],16))}}),OE=["value","disabled"],v4=se({__name:"BFormSelectOption",props:{disabled:{type:Boolean,default:!1},value:{default:void 0}},setup(t){const n=Ft(t,"BFormSelectOption");return(o,r)=>(w(),R("option",{value:p(n).value,disabled:p(n).disabled},[Ce(o.$slots,"default")],8,OE))}}),b4=(t,e)=>{const n=s=>typeof s=="object"&&s!==null&&"label"in s,o=s=>{const a=yt(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=sd(s,a.valueField),c=sd(s,a.textField),u=sd(s,a.disabledField),d=a.optionsField?sd(s,a.optionsField):void 0;return d!==void 0?{label:sd(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(yt(t))),isComplex:n}},ME=se({__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=Ft(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(),Q(Rt(p(n).tag),{id:p(n).id,role:p(n).role,"aria-live":p(n).ariaLive,"aria-atomic":p(n).ariaLive?!0:void 0,class:Te(r.value)},{default:J(()=>[Ce(i.$slots,"default",{},()=>[He(pe(p(n).text),1)])]),_:3},8,["id","role","aria-live","aria-atomic","class"]))}}),BE=se({__name:"BFormRow",props:{tag:{default:"div"}},setup(t){const n=Ft(t,"BFormRow");return(o,r)=>(w(),Q(Rt(p(n).tag),{class:"row d-flex flex-wrap"},{default:J(()=>[Ce(o.$slots,"default")]),_:3}))}}),LE=se({__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=Ft(t,"BFormText"),o=ls(n),r=S(()=>[o.value,{"form-text":!n.inline}]);return(i,s)=>(w(),Q(Rt(p(n).tag),{id:p(n).id,class:Te(r.value)},{default:J(()=>[Ce(i.$slots,"default",{},()=>[He(pe(p(n).text),1)])]),_:3},8,["id","class"]))}}),PE=se({__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=Ft(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(),Q(Rt(p(n).tag),{id:p(n).id,role:p(n).role,"aria-live":p(n).ariaLive,"aria-atomic":p(n).ariaLive?!0:void 0,class:Te(r.value)},{default:J(()=>[Ce(i.$slots,"default",{},()=>[He(pe(p(n).text),1)])]),_:3},8,["id","role","aria-live","aria-atomic","class"]))}}),Dm=(t,e)=>S(()=>{const n=yt(t),o=yt(e);return n===!0?"true":typeof n=="string"?n:o===!1?"true":n===!1?"false":void 0}),Em=t=>S(()=>{const e=yt(t);return e===!0?"is-valid":e===!1?"is-invalid":null}),y4=t=>S(()=>{const e=yt(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}}),x4=t=>{const e=fo(Ut(t)),n=Em(()=>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}])},w4=t=>S(()=>{const e=yt(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"}}),DE=t=>{const e=fo(Ut(t)),n=Dm(()=>e.value.ariaInvalid,()=>e.value.state);return S(()=>({"aria-invalid":n.value,"aria-required":e.value.required===!0?!0:void 0}))},EE=t=>S(()=>{const e=yt(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}}),IE=["id","disabled","required","name","form","aria-label","aria-labelledby","aria-required","value","true-value","false-value","indeterminate"],NE=["for"],Xs=se({inheritAttrs:!1,__name:"BFormCheckbox",props:lt({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=Du(),o=S(()=>{const{class:M,...$}=n;return{wrapperClass:M,inputAttrs:$}}),i=Ft(t,"BFormCheckbox"),s=bs(),a=mt(t,"modelValue"),l=mt(t,"indeterminate"),c=$o(()=>i.id,"form-check"),u=Kt(TP,null),d=bt("_input"),{focused:f}=ts(d,{initialValue:i.autofocus}),h=S(()=>!hu(s.default)),m=S({get:()=>u?u.modelValue.value:a.value,set:M=>{if(M!==void 0){if(l.value=!1,u!==null&&Array.isArray(M)){u.modelValue.value=M;return}a.value=M}}}),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=y4(v),x=S(()=>[y.value,o.value.wrapperClass]),_=x4(v),C=S(()=>[_.value,i.inputClass]),D=w4(v);return e({blur:()=>{f.value=!1},element:d,focus:()=>{f.value=!0}}),(M,$)=>(w(),Q(Lm,kt({skip:g.value},p(i).wrapperAttrs,{class:x.value}),{default:J(()=>{var L,E,N;return[Go(A("input",kt({id:p(c),ref:"_input","onUpdate:modelValue":$[0]||($[0]=T=>m.value=T),class:C.value,type:"checkbox",disabled:p(i).disabled||((L=p(u))==null?void 0:L.disabled.value),required:b.value||void 0,name:p(i).name||((E=p(u))==null?void 0:E.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,IE),[[_C,m.value]]),h.value||p(i).plain===!1?(w(),R("label",{key:0,for:p(c),class:Te(p(D))},[Ce(M.$slots,"default")],10,NE)):oe("",!0)]}),_:3},16,["skip","class"]))}}),M_=(t,e)=>e+(t?vE(t):""),RE={key:0,ref:"_content",class:"form-floating"},Mn=se({__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=Ft(t,"BFormGroup"),r=bs(),i=m_(),s=m_(),a=Ut(()=>o.state),l=Fe([]);wi(RC,T=>(l.value=[T],{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=(T,O)=>u.reduce((P,B)=>{const V=M_(B==="xs"?"":B,`${O}Cols`);let z=T[V];if(z=z===""?!0:z||!1,typeof z!="boolean"&&z!=="auto"){const G=Number.parseInt(z);z=Number.isNaN(G)?0:G,z=z>0?z:!1}return z&&(B==="xs"?P[typeof z=="boolean"?"col":"cols"]=z:P[B||(typeof z=="boolean"?"col":"cols")]=z),P},{}),f=bt("_content"),h=S(()=>d(o,"content")),m=S(()=>((T,O)=>u.reduce((P,B)=>{const V=M_(B==="xs"?"":B,`${O}Align`),z=T[V]||null;return z&&(B==="xs"?P.push(`text-${z}`):P.push(`text-${B}-${z}`)),P},[]))(o,"label")),b=S(()=>d(o,"label")),g=S(()=>Object.keys(h.value).length>0||Object.keys(b.value).length>0),v=Em(a),y=Dm(()=>o.ariaInvalid,a),x=T=>{if(c.value||f.value===null)return;const{target:O}=T,P=O?O.tagName:"";if([...e,"a","button","label"].indexOf(P)!==-1)return;const B=[...f.value.querySelectorAll(e.map(z=>`${z}:not([disabled])`).join())].filter(h4),[V]=B;B.length===1&&V instanceof HTMLElement&&pE(V)},_=$o(()=>o.id),C=$o(void 0,"_BV_label_"),D=S(()=>c.value?"label":"legend"),M=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_"),L=$o(void 0,"_BV_feedback_valid_"),E=$o(void 0,"_BV_description_"),N=S(()=>!c.value);return(T,O)=>(w(),Q(Rt(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:Te([[p(v),{"was-validated":p(o).validated}],"b-form-group"])},{default:J(()=>[H(p(s).define,null,{default:J(()=>[r["invalid-feedback"]||p(o).invalidFeedback?(w(),Q(ME,{key:0,id:p($),"aria-live":p(o).feedbackAriaLive,state:a.value,tooltip:p(o).tooltip},{default:J(()=>[Ce(T.$slots,"invalid-feedback",{},()=>[He(pe(p(o).invalidFeedback),1)])]),_:3},8,["id","aria-live","state","tooltip"])):oe("",!0),r["valid-feedback"]||p(o).validFeedback?(w(),Q(PE,{key:1,id:p(L),"aria-live":p(o).feedbackAriaLive,state:a.value,tooltip:p(o).tooltip},{default:J(()=>[Ce(T.$slots,"valid-feedback",{},()=>[He(pe(p(o).validFeedback),1)])]),_:3},8,["id","aria-live","state","tooltip"])):oe("",!0),r.description||p(o).description?(w(),Q(LE,{key:2,id:p(E)},{default:J(()=>[Ce(T.$slots,"description",{},()=>[He(pe(p(o).description),1)])]),_:3},8,["id"])):oe("",!0)]),_:3}),H(p(i).define,null,{default:J(()=>[r.label||p(o).label||g.value?(w(),R(Re,{key:0},[g.value?(w(),Q(O_,jn(kt({key:0},b.value)),{default:J(()=>[(w(),Q(Rt(D.value),{id:p(C),for:c.value||null,tabindex:N.value?"-1":null,class:Te(M.value),onClick:O[0]||(O[0]=P=>N.value?x:null)},{default:J(()=>[Ce(T.$slots,"label",{},()=>[He(pe(p(o).label),1)])]),_:3},8,["id","for","tabindex","class"]))]),_:3},16)):(w(),Q(Rt(D.value),{key:1,id:p(C),for:c.value||null,tabindex:N.value?"-1":null,class:Te(M.value),onClick:O[1]||(O[1]=P=>N.value?x:null)},{default:J(()=>[Ce(T.$slots,"label",{},()=>[He(pe(p(o).label),1)])]),_:3},8,["id","for","tabindex","class"]))],64)):oe("",!0)]),_:3}),g.value?(w(),Q(BE,{key:0},{default:J(()=>[H(p(i).reuse),H(O_,kt(h.value,{ref:"_content"}),{default:J(()=>[Ce(T.$slots,"default",{id:p(_),ariaDescribedby:null,descriptionId:p(E),labelId:p(C)}),H(p(s).reuse)]),_:3},16)]),_:3})):(w(),R(Re,{key:1},[p(o).floating&&!g.value?(w(),R("div",RE,[Ce(T.$slots,"default",{id:p(_),ariaDescribedby:null,descriptionId:p(E),labelId:p(C)}),H(p(i).reuse),H(p(s).reuse)],512)):(w(),R(Re,{key:1},[H(p(i).reuse),Ce(T.$slots,"default",{id:p(_),ariaDescribedby:null,descriptionId:p(E),labelId:p(C)}),H(p(s).reuse)],64))],64))]),_:3},8,["id","disabled","role","aria-invalid","aria-labelledby","class"]))}}),_4=(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},k4=(t,e,n,o)=>{var r;const i=Fe(0),s=$o(()=>t.id,"input"),a=Gl(()=>t.debounce??0),l=Gl(()=>t.debounceMaxWait??NaN),c=(r=Kt(RC,null))==null?void 0:r(s),u=S(()=>t.state!==void 0?t.state:(c==null?void 0:c.state.value)??null),d=Dm(()=>t.ariaInvalid,u),f=Em(u),h=YP(D=>{n.value=D},()=>o.lazy===!0?0:a.value,{maxWait:()=>o.lazy===!0?NaN:l.value}),m=(D,M=!1)=>{o.lazy===!0&&M===!1||h(D)},{focused:b}=ts(e,{initialValue:t.autofocus}),g=(D,M,$=!1)=>t.formatter!==void 0&&(!t.lazyFormatter||$)?t.formatter(D,M):D;return vn(()=>{var D;e.value&&(e.value.value=((D=n.value)==null?void 0:D.toString())??"")}),My(()=>{kn(()=>{t.autofocus&&(b.value=!0)})}),{input:e,computedId:s,computedAriaInvalid:d,onInput:D=>{const{value:M}=D.target,$=g(M,D);if(D.defaultPrevented){D.preventDefault();return}m($)},onChange:D=>{const{value:M}=D.target,$=g(M,D);if(D.defaultPrevented){D.preventDefault();return}const L=$;n.value!==L&&m($,!0)},onBlur:D=>{if(!o.lazy&&!t.lazyFormatter&&!o.trim)return;const{value:M}=D.target,$=g(M,D,!0),L=o.trim?$.trim():$,E=L.length!==$.length;n.value!==L&&m($,!0),o.trim&&E&&(i.value=i.value+1)},focus:()=>{t.disabled||(b.value=!0)},blur:()=>{t.disabled||(b.value=!1)},forceUpdateKey:i,stateClass:f}},FE=["id","value","name","form","type","disabled","placeholder","required","autocomplete","readonly","min","max","step","list","aria-required","aria-invalid"],da=se({__name:"BFormInput",props:lt({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=Ft(t,"BFormInput"),[r,i]=mt(t,"modelValue",{set:v=>_4(v,i)}),s=bt("_input"),{computedId:a,computedAriaInvalid:l,onInput:c,onChange:u,onBlur:d,stateClass:f,focus:h,blur:m,forceUpdateKey:b}=k4(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:Te(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,FE))}}),VE=["id","disabled","required","name","form","aria-label","aria-labelledby","value","aria-required"],zE=["for"],HE=se({inheritAttrs:!1,__name:"BFormRadio",props:lt({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=Ft(t,"BFormRadio"),r=bs(),i=mt(t,"modelValue"),s=$o(()=>o.id,"form-check"),a=Kt(BC,null),l=bt("_input"),{focused:c}=ts(l,{initialValue:o.autofocus}),u=S(()=>!hu(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=y4(m),g=x4(m),v=w4(m);return e({blur:()=>{c.value=!1},element:l,focus:()=>{c.value=!0}}),(y,x)=>(w(),Q(Lm,{skip:h.value,class:Te(p(b))},{default:J(()=>{var _,C,D;return[Go(A("input",kt({id:p(s)},y.$attrs,{ref:"_input","onUpdate:modelValue":x[0]||(x[0]=M=>d.value=M),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||((D=p(a))==null?void 0:D.form.value),"aria-label":p(o).ariaLabel,"aria-labelledby":p(o).ariaLabelledby,value:p(o).value,"aria-required":f.value||void 0}),null,16,VE),[[aP,d.value]]),u.value||p(o).plain===!1?(w(),R("label",{key:0,for:p(s),class:Te(p(v))},[Ce(y.$slots,"default")],10,zE)):oe("",!0)]}),_:3},8,["skip","class"]))}}),WE=["id"],UE=se({__name:"BFormRadioGroup",props:lt({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=Ft(t,"BFormRadioGroup"),r=mt(t,"modelValue"),i=$o(()=>o.id,"radio"),s=$o(()=>o.name,"checkbox"),a=bt("_element"),{focused:l}=ts(a,{initialValue:o.autofocus});wi(BC,{modelValue:r,buttonVariant:Ut(()=>o.buttonVariant),form:Ut(()=>o.form),name:s,buttons:Ut(()=>o.buttons),state:Ut(()=>o.state),plain:Ut(()=>o.plain),size:Ut(()=>o.size),inline:Ut(()=>!o.stacked),reverse:Ut(()=>o.reverse),required:Ut(()=>o.required),disabled:Ut(()=>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=DE(u),f=EE(u);return e({blur:()=>{l.value=!1},focus:()=>{l.value=!0}}),(h,m)=>(w(),R("div",kt(p(d),{id:p(i),ref:"_element",role:"radiogroup",class:[p(f),"bv-no-focus-ring"],tabindex:"-1"}),[Ce(h.$slots,"first"),(w(!0),R(Re,null,vt(c.value,(b,g)=>(w(),Q(HE,kt({key:g,ref_for:!0},b),{default:J(()=>[Ce(h.$slots,"option",kt({ref_for:!0},b),()=>[He(pe(b.text),1)])]),_:2},1040))),128)),Ce(h.$slots,"default")],16,WE))}}),GE=["label"],qE=se({__name:"BFormSelectOptionGroup",props:{disabledField:{default:"disabled"},label:{default:void 0},options:{default:()=>[]},textField:{default:"text"},valueField:{default:"value"}},setup(t){const n=Ft(t,"BFormSelectOptionGroup"),{normalizedOptions:o}=b4(()=>n.options,n),r=S(()=>o.value);return(i,s)=>(w(),R("optgroup",{label:p(n).label},[Ce(i.$slots,"first"),(w(!0),R(Re,null,vt(r.value,(a,l)=>(w(),Q(v4,kt({key:l,disabled:a.disabled,value:a.value,ref_for:!0},i.$attrs),{default:J(()=>[Ce(i.$slots,"option",kt({ref_for:!0},a),()=>[He(pe(a.text),1)])]),_:2},1040,["disabled","value"]))),128)),Ce(i.$slots,"default")],8,GE))}}),YE=["id","name","form","multiple","size","disabled","required","aria-required","aria-invalid"],nl=se({__name:"BFormSelect",props:lt({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=Ft(t,"BFormSelect"),r=mt(t,"modelValue"),i=$o(()=>o.id,"input"),s=Gl(()=>o.selectSize),a=Em(()=>o.state),l=bt("_input"),{focused:c}=ts(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=Dm(()=>o.ariaInvalid,()=>o.state),{normalizedOptions:h,isComplex:m}=b4(()=>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)=>Go((w(),R("select",{id:p(i),ref:"_input","onUpdate:modelValue":y[0]||(y[0]=x=>g.value=x),class:Te(u.value),name:p(o).name,form:p(o).form||void 0,multiple:p(o).multiple||void 0,size:d.value,disabled:p(o).disabled,required:p(o).required||void 0,"aria-required":p(o).required||void 0,"aria-invalid":p(f)},[Ce(v.$slots,"first"),(w(!0),R(Re,null,vt(b.value,(x,_)=>(w(),R(Re,{key:_},[p(m)(x)?(w(),Q(qE,{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(),Q(v4,{key:1,value:x.value,disabled:x.disabled},{default:J(()=>[Ce(v.$slots,"option",kt({ref_for:!0},x),()=>[He(pe(x.text),1)])]),_:2},1032,["value","disabled"]))],64))),128)),Ce(v.$slots,"default")],10,YE)),[[lP,g.value]])}}),jE=(t,e)=>{const n=Fe(0),o=fo(Ut(e)),r=Gl(()=>o.value.maxRows||NaN,{method:"parseInt",nanToZero:!0}),i=Gl(()=>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||!h4(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 kn();const{scrollHeight:y}=t.value;n.value=v,await kn();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`};vn(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}},KE=["id","name","form","value","disabled","placeholder","required","autocomplete","readonly","aria-required","aria-invalid","rows","wrap"],Ky=se({__name:"BFormTextarea",props:lt({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=Ft(t,"BFormTextarea"),[r,i]=mt(t,"modelValue",{set:C=>_4(C,i)}),s=bt("_input"),{computedId:a,forceUpdateKey:l,computedAriaInvalid:c,onInput:u,stateClass:d,onChange:f,onBlur:h,focus:m,blur:b}=k4(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}=jE(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,D)=>(w(),R("textarea",{id:p(a),ref:"_input",key:p(l),class:Te(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:Lt(_.value),wrap:p(o).wrap||void 0,onInput:D[0]||(D[0]=M=>{p(u)(M),p(y)()}),onChange:D[1]||(D[1]=(...M)=>p(f)&&p(f)(...M)),onBlur:D[2]||(D[2]=(...M)=>p(h)&&p(h)(...M))},null,46,KE))}});function XE(t){return sc()?(Fa(t),!0):!1}function H1(t){return typeof t=="function"?t():p(t)}typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const ZE=t=>t!=null;function QE(t){var e;const n=H1(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 S4=["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])"],Yp=S4.join(","),C4=typeof Element>"u",Yl=C4?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,jp=!C4&&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},Kp=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},JE=function(e){var n,o=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"contenteditable");return o===""||o==="true"},A4=function(e,n,o){if(Kp(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Yp));return n&&Yl.call(e,Yp)&&r.unshift(e),r=r.filter(o),r},$4=function t(e,n,o){for(var r=[],i=Array.from(e);i.length;){var s=i.shift();if(!Kp(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=Yl.call(s,Yp);u&&o.filter(s)&&(n||!e.includes(s))&&r.push(s);var d=s.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(s),f=!Kp(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},T4=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Ml=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||JE(e))&&!T4(e)?0:e.tabIndex},eI=function(e,n){var o=Ml(e);return o<0&&n&&!T4(e)?0:o},tI=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},O4=function(e){return e.tagName==="INPUT"},nI=function(e){return O4(e)&&e.type==="hidden"},oI=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(o){return o.tagName==="SUMMARY"});return n},rI=function(e,n){for(var o=0;o<e.length;o++)if(e[o].checked&&e[o].form===n)return e[o]},iI=function(e){if(!e.name)return!0;var n=e.form||jp(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=rI(r,e.form);return!i||i===e},sI=function(e){return O4(e)&&e.type==="radio"},aI=function(e){return sI(e)&&!iI(e)},lI=function(e){var n,o=e&&jp(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=jp(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},B_=function(e){var n=e.getBoundingClientRect(),o=n.width,r=n.height;return o===0&&r===0},cI=function(e,n){var o=n.displayCheck,r=n.getShadowRoot;if(getComputedStyle(e).visibility==="hidden")return!0;var i=Yl.call(e,"details>summary:first-of-type"),s=i?e.parentElement:e;if(Yl.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=jp(e);if(l&&!l.shadowRoot&&r(l)===!0)return B_(e);e.assignedSlot?e=e.assignedSlot:!l&&c!==e.ownerDocument?e=c.host:e=l}e=a}if(lI(e))return!e.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return B_(e);return!1},uI=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 Yl.call(n,"fieldset[disabled] *")?!0:!r.contains(e)}return!0}n=n.parentElement}return!1},Xp=function(e,n){return!(n.disabled||Kp(n)||nI(n)||cI(n,e)||oI(n)||uI(n))},W1=function(e,n){return!(aI(n)||Ml(n)<0||!Xp(e,n))},dI=function(e){var n=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},fI=function t(e){var n=[],o=[];return e.forEach(function(r,i){var s=!!r.scopeParent,a=s?r.scopeParent:r,l=eI(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(tI).reduce(function(r,i){return i.isScope?r.push.apply(r,i.content):r.push(i.content),r},[]).concat(n)},hI=function(e,n){n=n||{};var o;return n.getShadowRoot?o=$4([e],n.includeContainer,{filter:W1.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:dI}):o=A4(e,n.includeContainer,W1.bind(null,n)),fI(o)},pI=function(e,n){n=n||{};var o;return n.getShadowRoot?o=$4([e],n.includeContainer,{filter:Xp.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):o=A4(e,n.includeContainer,Xp.bind(null,n)),o},Ac=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return Yl.call(e,Yp)===!1?!1:W1(n,e)},mI=S4.concat("iframe").join(","),vv=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return Yl.call(e,mI)===!1?!1:Xp(n,e)};/*!
|
|
27
|
+
* focus-trap 7.6.2
|
|
28
|
+
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
29
|
+
*/function U1(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 gI(t){if(Array.isArray(t))return U1(t)}function vI(t,e,n){return(e=_I(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bI(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function yI(){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 L_(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 P_(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?L_(Object(n),!0).forEach(function(o){vI(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):L_(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function xI(t){return gI(t)||bI(t)||kI(t)||yI()}function wI(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 _I(t){var e=wI(t,"string");return typeof e=="symbol"?e:e+""}function kI(t,e){if(t){if(typeof t=="string")return U1(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)?U1(t,e):void 0}}var D_={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()}},SI=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},CI=function(e){return(e==null?void 0:e.key)==="Escape"||(e==null?void 0:e.key)==="Esc"||(e==null?void 0:e.keyCode)===27},Hd=function(e){return(e==null?void 0:e.key)==="Tab"||(e==null?void 0:e.keyCode)===9},AI=function(e){return Hd(e)&&!e.shiftKey},$I=function(e){return Hd(e)&&e.shiftKey},E_=function(e){return setTimeout(e,0)},ad=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},bh=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},TI=[],OI=function(e,n){var o=(n==null?void 0:n.document)||document,r=(n==null?void 0:n.trapStack)||TI,i=P_({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:AI,isKeyBackward:$I},n),s={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},a,l=function(O,P,B){return O&&O[P]!==void 0?O[P]:i[B||P]},c=function(O,P){var B=typeof(P==null?void 0:P.composedPath)=="function"?P.composedPath():void 0;return s.containerGroups.findIndex(function(V){var z=V.container,G=V.tabbableNodes;return z.contains(O)||(B==null?void 0:B.includes(z))||G.find(function(K){return K===O})})},u=function(O){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},B=P.hasFallback,V=B===void 0?!1:B,z=P.params,G=z===void 0?[]:z,K=i[O];if(typeof K=="function"&&(K=K.apply(void 0,xI(G))),K===!0&&(K=void 0),!K){if(K===void 0||K===!1)return K;throw new Error("`".concat(O,"` was specified but was not a node, or did not return a node"))}var ne=K;if(typeof K=="string"){try{ne=o.querySelector(K)}catch(ae){throw new Error("`".concat(O,'` appears to be an invalid selector; error="').concat(ae.message,'"'))}if(!ne&&!V)throw new Error("`".concat(O,"` as selector refers to no known node"))}return ne},d=function(){var O=u("initialFocus",{hasFallback:!0});if(O===!1)return!1;if(O===void 0||O&&!vv(O,i.tabbableOptions))if(c(o.activeElement)>=0)O=o.activeElement;else{var P=s.tabbableGroups[0],B=P&&P.firstTabbableNode;O=B||u("fallbackFocus")}else O===null&&(O=u("fallbackFocus"));if(!O)throw new Error("Your focus-trap needs to have at least one focusable element");return O},f=function(){if(s.containerGroups=s.containers.map(function(O){var P=hI(O,i.tabbableOptions),B=pI(O,i.tabbableOptions),V=P.length>0?P[0]:void 0,z=P.length>0?P[P.length-1]:void 0,G=B.find(function(ae){return Ac(ae)}),K=B.slice().reverse().find(function(ae){return Ac(ae)}),ne=!!P.find(function(ae){return Ml(ae)>0});return{container:O,tabbableNodes:P,focusableNodes:B,posTabIndexesFound:ne,firstTabbableNode:V,lastTabbableNode:z,firstDomTabbableNode:G,lastDomTabbableNode:K,nextTabbableNode:function(he){var ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,le=P.indexOf(he);return le<0?ge?B.slice(B.indexOf(he)+1).find(function(fe){return Ac(fe)}):B.slice(0,B.indexOf(he)).reverse().find(function(fe){return Ac(fe)}):P[le+(ge?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(O){return O.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(O){return O.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(O){var P=O.activeElement;if(P)return P.shadowRoot&&P.shadowRoot.activeElement!==null?h(P.shadowRoot):P},m=function(O){if(O!==!1&&O!==h(document)){if(!O||!O.focus){m(d());return}O.focus({preventScroll:!!i.preventScroll}),s.mostRecentlyFocusedNode=O,SI(O)&&O.select()}},b=function(O){var P=u("setReturnFocus",{params:[O]});return P||(P===!1?!1:O)},g=function(O){var P=O.target,B=O.event,V=O.isBackward,z=V===void 0?!1:V;P=P||bh(B),f();var G=null;if(s.tabbableGroups.length>0){var K=c(P,B),ne=K>=0?s.containerGroups[K]:void 0;if(K<0)z?G=s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:G=s.tabbableGroups[0].firstTabbableNode;else if(z){var ae=s.tabbableGroups.findIndex(function(Z){var be=Z.firstTabbableNode;return P===be});if(ae<0&&(ne.container===P||vv(P,i.tabbableOptions)&&!Ac(P,i.tabbableOptions)&&!ne.nextTabbableNode(P,!1))&&(ae=K),ae>=0){var he=ae===0?s.tabbableGroups.length-1:ae-1,ge=s.tabbableGroups[he];G=Ml(P)>=0?ge.lastTabbableNode:ge.lastDomTabbableNode}else Hd(B)||(G=ne.nextTabbableNode(P,!1))}else{var le=s.tabbableGroups.findIndex(function(Z){var be=Z.lastTabbableNode;return P===be});if(le<0&&(ne.container===P||vv(P,i.tabbableOptions)&&!Ac(P,i.tabbableOptions)&&!ne.nextTabbableNode(P))&&(le=K),le>=0){var fe=le===s.tabbableGroups.length-1?0:le+1,we=s.tabbableGroups[fe];G=Ml(P)>=0?we.firstTabbableNode:we.firstDomTabbableNode}else Hd(B)||(G=ne.nextTabbableNode(P))}}else G=u("fallbackFocus");return G},v=function(O){var P=bh(O);if(!(c(P,O)>=0)){if(ad(i.clickOutsideDeactivates,O)){a.deactivate({returnFocus:i.returnFocusOnDeactivate});return}ad(i.allowOutsideClick,O)||O.preventDefault()}},y=function(O){var P=bh(O),B=c(P,O)>=0;if(B||P instanceof Document)B&&(s.mostRecentlyFocusedNode=P);else{O.stopImmediatePropagation();var V,z=!0;if(s.mostRecentlyFocusedNode)if(Ml(s.mostRecentlyFocusedNode)>0){var G=c(s.mostRecentlyFocusedNode),K=s.containerGroups[G].tabbableNodes;if(K.length>0){var ne=K.findIndex(function(ae){return ae===s.mostRecentlyFocusedNode});ne>=0&&(i.isKeyForward(s.recentNavEvent)?ne+1<K.length&&(V=K[ne+1],z=!1):ne-1>=0&&(V=K[ne-1],z=!1))}}else s.containerGroups.some(function(ae){return ae.tabbableNodes.some(function(he){return Ml(he)>0})})||(z=!1);else z=!1;z&&(V=g({target:s.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(s.recentNavEvent)})),m(V||s.mostRecentlyFocusedNode||d())}s.recentNavEvent=void 0},x=function(O){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;s.recentNavEvent=O;var B=g({event:O,isBackward:P});B&&(Hd(O)&&O.preventDefault(),m(B))},_=function(O){(i.isKeyForward(O)||i.isKeyBackward(O))&&x(O,i.isKeyBackward(O))},C=function(O){CI(O)&&ad(i.escapeDeactivates,O)!==!1&&(O.preventDefault(),a.deactivate())},D=function(O){var P=bh(O);c(P,O)>=0||ad(i.clickOutsideDeactivates,O)||ad(i.allowOutsideClick,O)||(O.preventDefault(),O.stopImmediatePropagation())},M=function(){if(s.active)return D_.activateTrap(r,a),s.delayInitialFocusTimer=i.delayInitialFocus?E_(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",D,{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",D,!0),o.removeEventListener("keydown",_,!0),o.removeEventListener("keydown",C),a},L=function(O){var P=O.some(function(B){var V=Array.from(B.removedNodes);return V.some(function(z){return z===s.mostRecentlyFocusedNode})});P&&m(d())},E=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(L):void 0,N=function(){E&&(E.disconnect(),s.active&&!s.paused&&s.containers.map(function(O){E.observe(O,{subtree:!0,childList:!0})}))};return a={get active(){return s.active},get paused(){return s.paused},activate:function(O){if(s.active)return this;var P=l(O,"onActivate"),B=l(O,"onPostActivate"),V=l(O,"checkCanFocusTrap");V||f(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=o.activeElement,P==null||P();var z=function(){V&&f(),M(),N(),B==null||B()};return V?(V(s.containers.concat()).then(z,z),this):(z(),this)},deactivate:function(O){if(!s.active)return this;var P=P_({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},O);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,$(),s.active=!1,s.paused=!1,N(),D_.deactivateTrap(r,a);var B=l(P,"onDeactivate"),V=l(P,"onPostDeactivate"),z=l(P,"checkCanReturnFocus"),G=l(P,"returnFocus","returnFocusOnDeactivate");B==null||B();var K=function(){E_(function(){G&&m(b(s.nodeFocusedBeforeActivation)),V==null||V()})};return G&&z?(z(b(s.nodeFocusedBeforeActivation)).then(K,K),this):(K(),this)},pause:function(O){if(s.paused||!s.active)return this;var P=l(O,"onPause"),B=l(O,"onPostPause");return s.paused=!0,P==null||P(),$(),N(),B==null||B(),this},unpause:function(O){if(!s.paused||!s.active)return this;var P=l(O,"onUnpause"),B=l(O,"onPostUnpause");return s.paused=!1,P==null||P(),f(),M(),N(),B==null||B(),this},updateContainerElements:function(O){var P=[].concat(O).filter(Boolean);return s.containers=P.map(function(B){return typeof B=="string"?o.querySelector(B):B}),s.active&&f(),N(),this}},a.updateContainerElements(e),a};function MI(t,e={}){let n;const{immediate:o,...r}=e,i=Fe(!1),s=Fe(!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=H1(t);return(Array.isArray(f)?f:[f]).map(h=>{const m=H1(h);return typeof m=="string"?m:QE(m)}).filter(ZE)});return Ke(d,f=>{f.length&&(n=OI(f,{...r,onActivate(){i.value=!0,e.onActivate&&e.onActivate()},onDeactivate(){i.value=!1,e.onDeactivate&&e.onDeactivate()}}),o&&a())},{flush:"post"}),XE(()=>l()),{hasFocus:i,isPaused:s,activate:a,deactivate:l,pause:c,unpause:u}}const M4=({element:t,isActive:e,noTrap:n,fallbackFocus:o},r={allowOutsideClick:!0,fallbackFocus:o.ref.value??void 0,escapeDeactivates:!1})=>{const i=fo(Ut(e)),s=fo(Ut(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=Fe(a());vn(()=>{ZP(t,()=>{l.value=a()},{childList:!0,subtree:!0})});const c=MI(t,r);return Ke(i,async u=>{await kn(),u&&s.value===!1?c.activate():c.deactivate()}),Ke(s,u=>{u===!0&&c.deactivate()}),{needsFallback:fo(l)}},BI=FC(sD);let yh="";const xl=new Map,B4=(t,e)=>{const n=fo(Ut(t)),o=F3(),r=S(()=>!yt(e)),i=BI(typeof document<"u"?document.body:null,n.value&&r.value);vn(()=>{typeof document>"u"||(xl.set(o,!1),Ke([n,r],([s,a])=>{const l=window.innerWidth-document.documentElement.clientWidth,c=Array.from(xl.values()).some(f=>f===!0),u=s&&a;xl.set(o,u),u&&!c&&!i.value&&(i.value=!0,l>0&&(yh=document.body.style.paddingRight,document.body.style.paddingRight=`${l+yh}px`));const d=Array.from(xl.values()).some(f=>f===!0);c&&!d&&(xl.set(o,!1),i.value=!1,document.body.style.paddingRight=yh)},{immediate:!0}))}),ca(()=>{xl.delete(o),Array.from(xl.values()).some(a=>a===!0)||(document.body.style.paddingRight=yh,i.value=!1)})},LI=["id","aria-labelledby","aria-describedby"],PI=["id"],I_="modal-fallback-focus",N_=1056,DI=se({inheritAttrs:!1,__name:"BModal",props:lt({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:lt(["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=Ft(t,"BModal"),i=n,s=bs(),a=$o(()=>r.id,"modal"),l=mt(t,"modelValue"),c=bt("_element"),u=bt("_fallbackFocusElement"),d=bt("_okButton"),f=bt("_cancelButton"),h=bt("_closeButton"),m=()=>{r.autofocus!==!1&&(r.autofocusButton==="ok"?z.value=!0:r.autofocusButton==="close"?K.value=!0:r.autofocusButton==="cancel"?G.value=!0:V.value=!0)},b=()=>{m()},{showRef:g,renderRef:v,renderBackdropRef:y,hide:x,show:_,toggle:C,computedNoAnimation:D,transitionProps:M,backdropTransitionProps:$,isLeaving:L,isVisible:E,trapActive:N,contentShowing:T,backdropReady:O,backdropVisible:P}=$m(l,r,i,c,a,{transitionProps:{onAfterEnter:b}}),{needsFallback:B}=M4({element:c,isActive:N,noTrap:()=>r.noTrap,fallbackFocus:{ref:u,classSelector:I_}});Rs("Escape",()=>{x("esc")},{target:c}),B4(g,()=>r.bodyScrolling);const{focused:V}=ts(c,{initialValue:l.value&&r.autofocusButton===void 0&&r.autofocus===!0}),{focused:z}=ts(d,{initialValue:l.value&&r.autofocusButton==="ok"&&r.autofocus===!0}),{focused:G}=ts(f,{initialValue:l.value&&r.autofocusButton==="cancel"&&r.autofocus===!0}),{focused:K}=ts(h,{initialValue:l.value&&r.autofocusButton==="close"&&r.autofocus===!0}),ne=S(()=>!hu(s["header-close"])),ae=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=ls(()=>({bgVariant:r.bodyBgVariant,textVariant:r.bodyTextVariant,variant:r.bodyVariant})),ge=S(()=>[r.bodyClass,he.value]),le=ls(()=>({bgVariant:r.headerBgVariant,textVariant:r.headerTextVariant,variant:r.headerVariant,borderVariant:r.headerBorderVariant})),fe=S(()=>[r.headerClass,le.value]),we=S(()=>({variant:ne.value?r.headerCloseVariant:void 0,class:r.headerCloseClass})),Z=ls(()=>({bgVariant:r.footerBgVariant,textVariant:r.footerTextVariant,variant:r.footerVariant,borderVariant:r.footerBorderVariant})),be=S(()=>[r.footerClass,Z.value]),re=S(()=>[r.titleClass,{"visually-hidden":r.titleVisuallyHidden}]),ve=S(()=>r.cancelDisabled||r.busy),ce=S(()=>r.okDisabled||r.busy),{activePosition:I,activeModalCount:U,stackWithoutSelf:j}=lD(g,l.value);Ke(j,(X,q)=>{X.length>q.length&&g.value===!0&&r.noStacking===!0&&x()});const ee=S(()=>g.value||L.value?N_-(((U==null?void 0:U.value)??0)*2-((I==null?void 0:I.value)??0)*2):N_),ie=S(()=>({"z-index":ee.value})),de=S(()=>({"z-index":ee.value-1})),ke=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}),(X,q)=>(w(),Q(Am,{to:p(r).teleportTo,disabled:p(r).teleportDisabled},{default:J(()=>[p(v)||p(T)?(w(),Q(Ul,kt({key:0},p(M),{appear:l.value||p(r).visible,onAfterEnter:b}),{default:J(()=>[Go(A("div",kt({id:p(a),ref:"_element",class:["modal",[p(r).modalClass,{fade:!p(D),show:p(E)}]],role:"dialog","aria-labelledby":p(r).noHeader?void 0:`${p(a)}-label`,"aria-describedby":`${p(a)}-body`,tabindex:"-1"},X.$attrs,{style:ie.value,onClick:q[4]||(q[4]=pn(Y=>p(x)("backdrop"),["self"]))}),[A("div",{class:Te(["modal-dialog",ae.value])},[p(T)?(w(),R("div",{key:0,class:Te(["modal-content",p(r).contentClass])},[p(r).noHeader?oe("",!0):(w(),R("div",{key:0,class:Te(["modal-header",fe.value])},[Ce(X.$slots,"header",jn(ir(ke.value)),()=>[(w(),Q(Rt(p(r).titleTag),{id:`${p(a)}-label`,class:Te(["modal-title",re.value])},{default:J(()=>[Ce(X.$slots,"title",jn(ir(ke.value)),()=>[He(pe(p(r).title),1)],!0)]),_:3},8,["id","class"])),p(r).noHeaderClose?oe("",!0):(w(),R(Re,{key:0},[ne.value?(w(),Q(qo,kt({key:0},we.value,{onClick:q[0]||(q[0]=Y=>p(x)("close"))}),{default:J(()=>[Ce(X.$slots,"header-close",{},void 0,!0)]),_:3},16)):(w(),Q(f4,kt({key:1,"aria-label":p(r).headerCloseLabel},we.value,{onClick:q[1]||(q[1]=Y=>p(x)("close"))}),null,16,["aria-label"]))],64))],!0)],2)),A("div",kt({id:`${p(a)}-body`,class:["modal-body",ge.value]},p(r).bodyAttrs),[Ce(X.$slots,"default",jn(ir(ke.value)),()=>[He(pe(p(r).body),1)],!0)],16,PI),p(r).noFooter?oe("",!0):(w(),R("div",{key:1,class:Te(["modal-footer",be.value])},[Ce(X.$slots,"footer",jn(ir(ke.value)),()=>[Ce(X.$slots,"cancel",jn(ir(ke.value)),()=>[p(r).okOnly?oe("",!0):(w(),Q(qo,{key:0,ref:"_cancelButton",disabled:ve.value,size:p(r).buttonSize,variant:p(r).cancelVariant,onClick:q[2]||(q[2]=Y=>p(x)("cancel"))},{default:J(()=>[He(pe(p(r).cancelTitle),1)]),_:1},8,["disabled","size","variant"]))],!0),Ce(X.$slots,"ok",jn(ir(ke.value)),()=>[H(qo,{ref:"_okButton",disabled:ce.value,size:p(r).buttonSize,variant:p(r).okVariant,onClick:q[3]||(q[3]=Y=>p(x)("ok"))},{default:J(()=>[He(pe(p(r).okTitle),1)]),_:1},8,["disabled","size","variant"])],!0)],!0)],2))],2)):oe("",!0)],2),p(B)?(w(),R("div",{key:0,ref:"_fallbackFocusElement",class:Te(I_),tabindex:"0",style:{width:"0",height:"0",overflow:"hidden"}},null,512)):oe("",!0)],16,LI),[[lu,p(g)&&(p(O)&&p(r).backdropFirst||!p(r).backdropFirst)]])]),_:3},16,["appear"])):oe("",!0),p(r).noBackdrop?oe("",!0):Ce(X.$slots,"backdrop",jn(kt({key:1},ke.value)),()=>[p(y)?(w(),Q(Ul,jn(kt({key:0},p($))),{default:J(()=>[Go(A("div",{class:Te(["modal-backdrop",{fade:!p(D),show:p(P)||p(D)}]),style:Lt(de.value),onClick:q[5]||(q[5]=Y=>p(x)("backdrop"))},null,6),[[lu,p(g)||p(L)&&p(r).backdropFirst&&!p(D)]])]),_:1},16)):oe("",!0)],!0)]),_:3},8,["to","disabled"]))}}),Xy=Tm(DI,[["__scopeId","data-v-93972863"]]),EI=["id","aria-labelledby"],II=["id"],R_="offcanvas-fallback-focus",NI=se({inheritAttrs:!1,__name:"BOffcanvas",props:lt({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:lt(["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=Ft(t,"BOffcanvas"),i=n,s=bs(),a=mt(t,"modelValue"),l=$o(()=>r.id,"offcanvas"),c=bt("_element"),u=bt("_fallbackFocusElement"),d=()=>{kn(()=>{r.noFocus===!1&&!B.value&&(V.value=!0)})},{showRef:f,renderRef:h,renderBackdropRef:m,hide:b,show:g,toggle:v,computedNoAnimation:y,contentShowing:x,transitionProps:_,backdropReady:C,backdropTransitionProps:D,backdropVisible:M,isVisible:$,buildTriggerableEvent:L,localNoAnimation:E,isLeaving:N,trapActive:T}=$m(a,r,i,c,l,{transitionProps:{onAfterEnter:d,enterToClass:"showing",leaveToClass:"hiding",enterActiveClass:"",leaveActiveClass:"",enterFromClass:"",leaveFromClass:""}}),P=JP(QP).smallerOrEqual(()=>r.responsive??"xs"),B=Fe(r.responsive!==void 0&&!P.value);vn(()=>{r.responsive!==void 0&&i("breakpoint",L("breakpoint"),B.value)}),B4(f,()=>r.bodyScrolling||B.value),Rs("Escape",()=>{b("esc")},{target:c});const{focused:V}=ts(c,{initialValue:a.value&&r.noFocus===!1&&!B.value}),{needsFallback:z}=M4({element:c,isActive:T,noTrap:()=>r.noTrap||B.value,fallbackFocus:{classSelector:R_,ref:u}}),G=S(()=>(r.responsive===void 0||!B.value)&&r.noBackdrop===!1&&(f.value===!0||N.value&&r.backdropFirst&&!y.value)),K=S(()=>!hu(s["header-close"])),ne=S(()=>[{"text-reset":!K.value},r.headerCloseClass]),ae=S(()=>({variant:K.value?r.headerCloseVariant:void 0,class:ne.value})),he=S(()=>!hu(s.footer)),ge=S(()=>[r.responsive===void 0?"offcanvas":`offcanvas-${r.responsive}`,`offcanvas-${r.placement}`,{show:$.value,[`shadow-${r.shadow}`]:!!r.shadow,"no-transition":y.value}]),le=S(()=>({width:r.width})),fe=S(()=>({visible:f.value,placement:r.placement,hide:b}));return Ke(P,we=>{r.responsive!==void 0&&(we===!0?(E.value=!0,requestAnimationFrame(()=>{B.value=!1}),i("breakpoint",L("breakpoint"),!1),i("hide",L("hide"))):(E.value=!0,requestAnimationFrame(()=>{B.value=!0}),i("breakpoint",L("breakpoint"),!0),i("show",L("show"))))}),e({hide:b,show:g,toggle:v,isOpenByBreakpoint:B}),(we,Z)=>(w(),Q(Am,{to:p(r).teleportTo,disabled:p(r).teleportDisabled||B.value},{default:J(()=>[p(h)||p(x)||B.value?(w(),Q(Ul,kt({key:0},p(_),{appear:a.value||p(r).visible}),{default:J(()=>[Go(A("div",kt({id:p(l),ref:"_element","aria-modal":"true",role:"dialog",class:ge.value,style:le.value,tabindex:"-1","aria-labelledby":`${p(l)}-offcanvas-label`,"data-bs-backdrop":"false"},we.$attrs),[p(x)||B.value?(w(),R(Re,{key:0},[p(r).noHeader?oe("",!0):(w(),R("div",{key:0,class:Te(["offcanvas-header",p(r).headerClass])},[Ce(we.$slots,"header",jn(ir(fe.value)),()=>[A("h5",{id:`${p(l)}-offcanvas-label`,class:"offcanvas-title"},[Ce(we.$slots,"title",jn(ir(fe.value)),()=>[He(pe(p(r).title),1)],!0)],8,II),p(r).noHeaderClose?oe("",!0):(w(),R(Re,{key:0},[K.value?(w(),Q(qo,kt({key:0},ae.value,{onClick:Z[0]||(Z[0]=be=>p(b)("close"))}),{default:J(()=>[Ce(we.$slots,"header-close",{},void 0,!0)]),_:3},16)):(w(),Q(f4,kt({key:1,"aria-label":p(r).headerCloseLabel},ae.value,{onClick:Z[1]||(Z[1]=be=>p(b)("close"))}),null,16,["aria-label"]))],64))],!0)],2)),A("div",kt({class:["offcanvas-body",p(r).bodyClass]},p(r).bodyAttrs),[Ce(we.$slots,"default",jn(ir(fe.value)),void 0,!0)],16),he.value?(w(),R("div",{key:1,class:Te(p(r).footerClass)},[Ce(we.$slots,"footer",jn(ir(fe.value)),void 0,!0)],2)):oe("",!0)],64)):oe("",!0),p(z)?(w(),R("div",{key:1,ref:"_fallbackFocusElement",class:Te(R_),tabindex:"0",style:{width:"0",height:"0",overflow:"hidden"}},null,512)):oe("",!0)],16,EI),[[lu,p(f)&&(p(C)&&p(r).backdropFirst||!p(r).backdropFirst)||B.value]])]),_:3},16,["appear"])):oe("",!0),p(r).noBackdrop?oe("",!0):Ce(we.$slots,"backdrop",jn(kt({key:1},fe.value)),()=>[p(m)?(w(),Q(Ul,jn(kt({key:0},p(D))),{default:J(()=>[Go(A("div",{class:Te(["offcanvas-backdrop",{fade:!p(y),show:p(M)||p(y)}]),onClick:Z[2]||(Z[2]=be=>p(b)("backdrop"))},null,2),[[lu,G.value]])]),_:1},16)):oe("",!0)],!0)]),_:3},8,["to","disabled"]))}}),RI=Tm(NI,[["__scopeId","data-v-77d852fe"]]),FI="300px",VI=se({__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=Ft(t,"BTableSimple"),o=$o(()=>n.id),r=ls(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=wE(S(()=>(n.stickyHeader===!0?FI: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:Te(d.value),style:Lt(u.value)},[A("table",jn(ir(s.value)),[Ce(f.$slots,"default")],16)],6)):(w(),R("table",jn(kt({key:1},s.value)),[Ce(f.$slots,"default")],16))}}),ff=se({__name:"BTooltip",props:lt({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=Ft(t,"BTooltip"),r=bs(),i=mt(t,"modelValue"),s=S(()=>{const{interactive:l,noninteractive:c,...u}=o;return{noninteractive:c!==void 0?c:!l,...u}}),a=bt("_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(),Q(u4,kt({ref:"_popover"},s.value,{modelValue:i.value,"onUpdate:modelValue":c[0]||(c[0]=u=>i.value=u),tooltip:""}),$i({_:2},[r.default?{name:"default",fn:J(()=>[Ce(l.$slots,"default")]),key:"0"}:void 0,r.target?{name:"target",fn:J(u=>[Ce(l.$slots,"target",jn(ir(u)))]),key:"1"}:void 0,r.title?{name:"title",fn:J(()=>[Ce(l.$slots,"title")]),key:"2"}:void 0]),1040,["modelValue"]))}}),zI=se({__name:"BTbody",props:{variant:{default:null}},setup(t){const n=Ft(t,"BTbody"),o=S(()=>({[`thead-${n.variant}`]:n.variant!==null}));return(r,i)=>(w(),R("tbody",{class:Te(o.value)},[Ce(r.$slots,"default")],2))}}),HI=["scope","colspan","rowspan","data-label"],WI={key:0},F_=se({__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=Ft(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:Te(o.value),colspan:p(n).colspan,rowspan:p(n).rowspan,"data-label":p(n).stackedHeading},[p(n).stackedHeading?(w(),R("div",WI,[Ce(i.$slots,"default")])):Ce(i.$slots,"default",{key:1})],10,HI))}}),UI=["scope","colspan","rowspan","data-label"],GI={key:0},V_=se({__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=Ft(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:Te(o.value),colspan:p(n).colspan,rowspan:p(n).rowspan,"data-label":p(n).stackedHeading},[p(n).stackedHeading!==void 0?(w(),R("div",GI,[Ce(i.$slots,"default")])):Ce(i.$slots,"default",{key:1})],10,UI))}}),qI=se({__name:"BThead",props:{variant:{default:null}},setup(t){const n=Ft(t,"BThead"),o=S(()=>({[`table-${n.variant}`]:n.variant!==null}));return(r,i)=>(w(),R("thead",{class:Te(o.value)},[Ce(r.$slots,"default")],2))}}),z_=se({__name:"BTr",props:{variant:{default:null}},setup(t){const n=Ft(t,"BTr"),o=S(()=>({[`table-${n.variant}`]:n.variant!==null}));return(r,i)=>(w(),R("tr",{class:Te(o.value)},[Ce(r.$slots,"default")],2))}});Object.freeze(Object.keys({bordered:0,borderless:0,borderVariant:0,captionTop:0,dark:0,fixed:0,hover:0,id:0,noBorderCollapse:0,outlined:0,responsive:0,small:0,stacked:0,stickyHeader:0,striped:0,stripedColumns:0,variant:0,tableAttrs:0,tableClass:0}));Object.freeze(Object.keys({align:0,caption:0,detailsTdClass:0,fieldColumnClass:0,fields:0,footClone:0,footRowVariant:0,footVariant:0,headRowVariant:0,headVariant:0,items:0,labelStacked:0,modelValue:0,primaryKey:0,tbodyClass:0,tbodyTrAttrs:0,tbodyTrClass:0,tfootClass:0,tfootTrClass:0,theadClass:0,theadTrClass:0}));const L4={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"},YI=Object.freeze(Object.keys(L4)),P4={vBColorMode:"/directives/BColorMode",vBModal:"/directives/BModal",vBPopover:"/directives/BPopover",vBScrollspy:"/directives/BScrollspy",vBToggle:"/directives/BToggle",vBTooltip:"/directives/BTooltip"},jI=Object.freeze(Object.keys(P4)),KI={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(KI));const H_="bootstrap-vue-next",W_=(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)},bv=new Set,U_=new Set;Object.assign(({aliases:t={},directives:e=!0,components:n=!0}={})=>{const r=W_(typeof n=="boolean"?{all:n}:n,YI).reduce((l,c)=>(l.set(c,`${H_}${L4[c]}`),l),new Map),s=W_(typeof e=="boolean"?{all:e}:e,jI).reduce((l,c)=>{const u=c.toLowerCase().startsWith("v")?c:`v${c}`;return l.set(u,`${H_}${P4[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 bv.add(d),{name:d,from:u}}if(c)return bv.add(l),{name:l,from:c}}},{type:"directive",resolve(l){const c=`v${l}`,u=s.get(c);if(u)return U_.add(c),{name:c,from:u}}}]},{__usedComponents:bv,__usedDirectives:U_});const XI={install(t,e){const n=(e==null?void 0:e.components)??{};t.provide(fp,Fe(n))}},ZI={install(t){const e=Fe([]),n=()=>{e.value.splice(0,e.value.length)};t.provide(MP,{items:e,reset:n})}},QI={install(t){const e=Fe(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=Ut(l.props),[d,f,h]=o((c=u.value)==null?void 0:c.id);return e.value.set(f,{component:l.component?Oe(l.component):void 0,props:{...u.value,_isConfirm:!1,_promise:d,_modelValue:h}}),Ke(u,m=>{const b=e.value.get(f);b&&e.value.set(f,{component:l.component?Oe(l.component):void 0,props:{...b.props,...m}})}),d.value},i=(l={})=>{var c;const u=Ut(l.props),[d,f,h]=o((c=u.value)==null?void 0:c.id);return e.value.set(f,{component:l.component?Oe(l.component):void 0,props:{...u.value,_isConfirm:!0,_promise:d,_modelValue:h}}),Ke(u,m=>{const b=e.value.get(f);b&&e.value.set(f,{component:l.component?Oe(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(PP,{modals:e,remove:a,show:r,confirm:i,leave:s})}},JI={install(t){const e=Fe(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=Fe(new Map),l=u=>{a.value.set(u.uid,u)},c=u=>{a.value.delete(u.uid)};t.provide(IC,{countStack:n,lastStack:r,registry:fo(a),stack:o,pushStack:i,removeStack:s,pushRegistry:l,removeRegistry:c})}},eN={install(t){const e=Fe(new Map),n=c=>{var u;const d=Ut(c),f=((u=d.value)==null?void 0:u.id)||Symbol("Popover controller");return Ke(d,h=>{e.value.set(f,{...h,...typeof h.modelValue<"u"&&Ze(c)?{"onUpdate:modelValue":m=>{var b;(b=h["onUpdate:modelValue"])==null||b.call(h,m),c.value.modelValue=m}}:{}})},{immediate:!0,deep:!0}),Fa(()=>e.value.delete(f),!0),f},o=(c,u)=>{const d=e.value.get(c);d&&e.value.set(c,{...d,...yt(u)})},r=c=>e.value.delete(c),i=Fe(new Map),s=c=>{var u;const d=Ut(c),f=((u=d.value)==null?void 0:u.id)||Symbol("Tooltip controller");return Ke(d,h=>{e.value.set(f,{...h,...typeof h.modelValue<"u"&&Ze(c)?{"onUpdate:modelValue":m=>{var b;(b=h["onUpdate:modelValue"])==null||b.call(h,m),c.value.modelValue=m}}:{}})},{immediate:!0,deep:!0}),Fa(()=>i.value.delete(f),!0),f},a=(c,u)=>{const d=i.value.get(c);d&&i.value.set(c,{...d,...yt(u)})},l=c=>i.value.delete(c);t.provide(DP,{popovers:e,tooltips:i,tooltip:s,popover:n,setPopover:o,setTooltip:a,removePopover:r,removeTooltip:l})}},tN={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=Fe(s),c=Fe(a);t.provide(OP,{isRtl:l,locale:c})}},nN="top-end",oN={install(t){const e=Fe([]),n=Fe(!1),o=a=>{n.value=a},r=(a={})=>{var l,c,u,d;const f=Ut(a.props),h=((l=f.value)==null?void 0:l.id)||Symbol("Toast controller"),m={component:a.component?Oe(a.component):void 0,props:{...f.value,pos:((c=f.value)==null?void 0:c.pos)||nN,_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),Ke(f,b=>{const g=e.value.findIndex(v=>v.props._self===h);g!==-1&&e.value.splice(g,1,{component:a.component?Oe(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?Oe(e.value[l].component):void 0,props:{...e.value[l].props,_modelValue:!1}})};t.provide(LP,{_setIsAppend:o,toasts:e,show:r,remove:i,leave:s})}},rN={install(t){const e=po({}),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=fo(e),t.provide(PC,n)}},iN=(t={})=>({install(e){(t.breadcrumb??!0)&&e.use(ZI),(t.modalController??!0)&&e.use(QI),(t.modalManager??!0)&&e.use(JI),((t.rtl??!0)||typeof t.rtl=="object")&&e.use(tN,t),(t.toast??!0)&&e.use(oN),(t.popover??!0)&&e.use(eN),e.use(rN),e.use(XI,t)}});/*!
|
|
31
|
+
* vue-router v4.6.4
|
|
32
|
+
* (c) 2025 Eduardo San Martin Morote
|
|
33
|
+
* @license MIT
|
|
34
|
+
*/const Nc=typeof document<"u";function D4(t){return typeof t=="object"||"displayName"in t||"props"in t||"__vccOpts"in t}function sN(t){return t.__esModule||t[Symbol.toStringTag]==="Module"||t.default&&D4(t.default)}const Zt=Object.assign;function yv(t,e){const n={};for(const o in e){const r=e[o];n[o]=Bi(r)?r.map(t):t(r)}return n}const Wd=()=>{},Bi=Array.isArray;function G_(t,e){const n={};for(const o in t)n[o]=o in e?e[o]:t[o];return n}const E4=/#/g,aN=/&/g,lN=/\//g,cN=/=/g,uN=/\?/g,I4=/\+/g,dN=/%5B/g,fN=/%5D/g,N4=/%5E/g,hN=/%60/g,R4=/%7B/g,pN=/%7C/g,F4=/%7D/g,mN=/%20/g;function Zy(t){return t==null?"":encodeURI(""+t).replace(pN,"|").replace(dN,"[").replace(fN,"]")}function gN(t){return Zy(t).replace(R4,"{").replace(F4,"}").replace(N4,"^")}function G1(t){return Zy(t).replace(I4,"%2B").replace(mN,"+").replace(E4,"%23").replace(aN,"%26").replace(hN,"`").replace(R4,"{").replace(F4,"}").replace(N4,"^")}function vN(t){return G1(t).replace(cN,"%3D")}function bN(t){return Zy(t).replace(E4,"%23").replace(uN,"%3F")}function yN(t){return bN(t).replace(lN,"%2F")}function hf(t){if(t==null)return null;try{return decodeURIComponent(""+t)}catch{}return""+t}const xN=/\/$/,wN=t=>t.replace(xN,"");function xv(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=CN(o??e,n),{fullPath:o+i+s,path:o,query:r,hash:hf(s)}}function _N(t,e){const n=e.query?t(e.query):"";return e.path+(n&&"?")+n+(e.hash||"")}function q_(t,e){return!e||!t.toLowerCase().startsWith(e.toLowerCase())?t:t.slice(e.length)||"/"}function kN(t,e,n){const o=e.matched.length-1,r=n.matched.length-1;return o>-1&&o===r&&pu(e.matched[o],n.matched[r])&&V4(e.params,n.params)&&t(e.query)===t(n.query)&&e.hash===n.hash}function pu(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function V4(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(!SN(t[n],e[n]))return!1;return!0}function SN(t,e){return Bi(t)?Y_(t,e):Bi(e)?Y_(e,t):(t==null?void 0:t.valueOf())===(e==null?void 0:e.valueOf())}function Y_(t,e){return Bi(e)?t.length===e.length&&t.every((n,o)=>n===e[o]):t.length===1&&t[0]===e}function CN(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 ya={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let q1=(function(t){return t.pop="pop",t.push="push",t})({}),wv=(function(t){return t.back="back",t.forward="forward",t.unknown="",t})({});function AN(t){if(!t)if(Nc){const e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^\w+:\/\/[^\/]+/,"")}else t="/";return t[0]!=="/"&&t[0]!=="#"&&(t="/"+t),wN(t)}const $N=/^[^#]+#/;function TN(t,e){return t.replace($N,"#")+e}function ON(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 MN(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=ON(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 j_(t,e){return(history.state?history.state.position-e:-1)+t}const Y1=new Map;function BN(t,e){Y1.set(t,e)}function LN(t){const e=Y1.get(t);return Y1.delete(t),e}function PN(t){return typeof t=="string"||t&&typeof t=="object"}function z4(t){return typeof t=="string"||typeof t=="symbol"}let wn=(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 H4=Symbol("");wn.MATCHER_NOT_FOUND+"",wn.NAVIGATION_GUARD_REDIRECT+"",wn.NAVIGATION_ABORTED+"",wn.NAVIGATION_CANCELLED+"",wn.NAVIGATION_DUPLICATED+"";function mu(t,e){return Zt(new Error,{type:t,[H4]:!0},e)}function Os(t,e){return t instanceof Error&&H4 in t&&(e==null||!!(t.type&e))}const DN=["params","query","hash"];function EN(t){if(typeof t=="string")return t;if(t.path!=null)return t.path;const e={};for(const n of DN)n in t&&(e[n]=t[n]);return JSON.stringify(e,null,2)}function IN(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(I4," "),i=r.indexOf("="),s=hf(i<0?r:r.slice(0,i)),a=i<0?null:hf(r.slice(i+1));if(s in e){let l=e[s];Bi(l)||(l=e[s]=[l]),l.push(a)}else e[s]=a}return e}function K_(t){let e="";for(let n in t){const o=t[n];if(n=vN(n),o==null){o!==void 0&&(e+=(e.length?"&":"")+n);continue}(Bi(o)?o.map(r=>r&&G1(r)):[o&&G1(o)]).forEach(r=>{r!==void 0&&(e+=(e.length?"&":"")+n,r!=null&&(e+="="+r))})}return e}function NN(t){const e={};for(const n in t){const o=t[n];o!==void 0&&(e[n]=Bi(o)?o.map(r=>r==null?null:""+r):o==null?o:""+o)}return e}const W4=Symbol(""),X_=Symbol(""),Nm=Symbol(""),Qy=Symbol(""),j1=Symbol("");function ld(){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 RN(t,e,n){const o=()=>{t[e].delete(n)};ca(o),z3(o),My(()=>{t[e].add(n)}),t[e].add(n)}function FN(t){const e=Kt(W4,{}).value;e&&RN(e,"leaveGuards",t)}function Ca(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(mu(wn.NAVIGATION_ABORTED,{from:n,to:e})):f instanceof Error?l(f):PN(f)?l(mu(wn.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 _v(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(D4(l)){const c=(l.__vccOpts||l)[e];c&&i.push(Ca(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=sN(u)?u.default:u;s.mods[a]=u,s.components[a]=d;const f=(d.__vccOpts||d)[e];return f&&Ca(f,n,o,s,a,r)()}))}}return i}function VN(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=>pu(c,a))?o.push(a):n.push(a));const l=t.matched[s];l&&(e.matched.find(c=>pu(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 zN=()=>location.protocol+"//"+location.host;function U4(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),q_(a,"")}return q_(n,t)+o+r}function HN(t,e,n,o){let r=[],i=[],s=null;const a=({state:f})=>{const h=U4(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:q1.pop,direction:g?g>0?wv.forward:wv.back:wv.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(Zt({},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 Z_(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 WN(t){const{history:e,location:n}=window,o={value:U4(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:zN()+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,Zt({},e.state,Z_(r.value.back,l,r.value.forward,!0),c,{position:r.value.position}),!0),o.value=l}function a(l,c){const u=Zt({},r.value,e.state,{forward:l,scroll:Im()});i(u.current,u,!0),i(l,Zt({},Z_(o.value,l,null),{position:u.position+1},c),!1),o.value=l}return{location:o,state:r,push:a,replace:s}}function UN(t){t=AN(t);const e=WN(t),n=HN(t,e.state,e.location,e.replace);function o(i,s=!0){s||n.pauseListeners(),history.go(i)}const r=Zt({location:"",base:t,go:o,createHref:TN.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 GN(t){return t=location.host?t||location.pathname+location.search:"",t.includes("#")||(t+="#"),UN(t)}let Ll=(function(t){return t[t.Static=0]="Static",t[t.Param=1]="Param",t[t.Group=2]="Group",t})({});var Yn=(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})(Yn||{});const qN={type:Ll.Static,value:""},YN=/[a-zA-Z0-9_]/;function jN(t){if(!t)return[[]];if(t==="/")return[[qN]];if(!t.startsWith("/"))throw new Error(`Invalid path "${t}"`);function e(h){throw new Error(`ERR (${n})/"${c}": ${h}`)}let n=Yn.Static,o=n;const r=[];let i;function s(){i&&r.push(i),i=[]}let a=0,l,c="",u="";function d(){c&&(n===Yn.Static?i.push({type:Ll.Static,value:c}):n===Yn.Param||n===Yn.ParamRegExp||n===Yn.ParamRegExpEnd?(i.length>1&&(l==="*"||l==="+")&&e(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),i.push({type:Ll.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!==Yn.ParamRegExp){o=n,n=Yn.EscapeNext;continue}switch(n){case Yn.Static:l==="/"?(c&&d(),s()):l===":"?(d(),n=Yn.Param):f();break;case Yn.EscapeNext:f(),n=o;break;case Yn.Param:l==="("?n=Yn.ParamRegExp:YN.test(l)?f():(d(),n=Yn.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case Yn.ParamRegExp:l===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+l:n=Yn.ParamRegExpEnd:u+=l;break;case Yn.ParamRegExpEnd:d(),n=Yn.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,u="";break;default:e("Unknown state");break}}return n===Yn.ParamRegExp&&e(`Unfinished custom RegExp for param "${c}"`),d(),s(),r}const Q_="[^/]+?",KN={sensitive:!1,strict:!1,start:!0,end:!0};var Vo=(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})(Vo||{});const XN=/[.+*?^${}()[\]/\\]/g;function ZN(t,e){const n=Zt({},KN,e),o=[];let r=n.start?"^":"";const i=[];for(const c of t){const u=c.length?[]:[Vo.Root];n.strict&&!c.length&&(r+="/");for(let d=0;d<c.length;d++){const f=c[d];let h=Vo.Segment+(n.sensitive?Vo.BonusCaseSensitive:0);if(f.type===Ll.Static)d||(r+="/"),r+=f.value.replace(XN,"\\$&"),h+=Vo.Static;else if(f.type===Ll.Param){const{value:m,repeatable:b,optional:g,regexp:v}=f;i.push({name:m,repeatable:b,optional:g});const y=v||Q_;if(y!==Q_){h+=Vo.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+=Vo.Dynamic,g&&(h+=Vo.BonusOptional),b&&(h+=Vo.BonusRepeatable),y===".*"&&(h+=Vo.BonusWildcard)}u.push(h)}o.push(u)}if(n.strict&&n.end){const c=o.length-1;o[c][o[c].length-1]+=Vo.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===Ll.Static)u+=h.value;else if(h.type===Ll.Param){const{value:m,repeatable:b,optional:g}=h,v=m in c?c[m]:"";if(Bi(v)&&!b)throw new Error(`Provided param "${m}" is an array but it is not repeatable (* or + modifiers)`);const y=Bi(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 QN(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]===Vo.Static+Vo.Segment?-1:1:t.length>e.length?e.length===1&&e[0]===Vo.Static+Vo.Segment?1:-1:0}function G4(t,e){let n=0;const o=t.score,r=e.score;for(;n<o.length&&n<r.length;){const i=QN(o[n],r[n]);if(i)return i;n++}if(Math.abs(r.length-o.length)===1){if(J_(o))return 1;if(J_(r))return-1}return r.length-o.length}function J_(t){const e=t[t.length-1];return t.length>0&&e[e.length-1]<0}const JN={strict:!1,end:!0,sensitive:!1};function eR(t,e,n){const o=ZN(jN(t.path),n),r=Zt(o,{record:t,parent:e,children:[],alias:[]});return e&&!r.record.aliasOf==!e.record.aliasOf&&e.children.push(r),r}function tR(t,e){const n=[],o=new Map;e=G_(JN,e);function r(d){return o.get(d)}function i(d,f,h){const m=!h,b=t8(d);b.aliasOf=h&&h.record;const g=G_(e,d),v=[b];if("alias"in d){const _=typeof d.alias=="string"?[d.alias]:d.alias;for(const C of _)v.push(t8(Zt({},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 D=f.record.path,M=D[D.length-1]==="/"?"":"/";_.path=f.record.path+(C&&M+C)}if(y=eR(_,f,g),h?h.alias.push(y):(x=x||y,x!==y&&x.alias.push(y),m&&d.name&&!n8(y)&&s(d.name)),q4(y)&&l(y),b.children){const D=b.children;for(let M=0;M<D.length;M++)i(D[M],y,h&&h.children[M])}h=h||y}return x?()=>{s(x)}:Wd}function s(d){if(z4(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=rR(d,n);n.splice(f,0,d),d.record.name&&!n8(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 mu(wn.MATCHER_NOT_FOUND,{location:d});g=h.record.name,m=Zt(e8(f.params,h.keys.filter(x=>!x.optional).concat(h.parent?h.parent.keys.filter(x=>x.optional):[]).map(x=>x.name)),d.params&&e8(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 mu(wn.MATCHER_NOT_FOUND,{location:d,currentLocation:f});g=h.record.name,m=Zt({},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:oR(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 e8(t,e){const n={};for(const o of e)o in t&&(n[o]=t[o]);return n}function t8(t){const e={path:t.path,redirect:t.redirect,name:t.name,meta:t.meta||{},aliasOf:t.aliasOf,beforeEnter:t.beforeEnter,props:nR(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 nR(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 n8(t){for(;t;){if(t.record.aliasOf)return!0;t=t.parent}return!1}function oR(t){return t.reduce((e,n)=>Zt(e,n.meta),{})}function rR(t,e){let n=0,o=e.length;for(;n!==o;){const i=n+o>>1;G4(t,e[i])<0?o=i:n=i+1}const r=iR(t);return r&&(o=e.lastIndexOf(r,o-1)),o}function iR(t){let e=t;for(;e=e.parent;)if(q4(e)&&G4(t,e)===0)return e}function q4({record:t}){return!!(t.name||t.components&&Object.keys(t.components).length||t.redirect)}function o8(t){const e=Kt(Nm),n=Kt(Qy),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(pu.bind(null,u));if(f>-1)return f;const h=r8(l[c-2]);return c>1&&r8(u)===h&&d[d.length-1].path!==h?d.findIndex(pu.bind(null,l[c-2])):f}),i=S(()=>r.value>-1&&uR(n.params,o.value.params)),s=S(()=>r.value>-1&&r.value===n.matched.length-1&&V4(n.params,o.value.params));function a(l={}){if(cR(l)){const c=e[p(t.replace)?"replace":"push"](p(t.to)).catch(Wd);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 sR(t){return t.length===1?t[0]:t}const aR=se({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:o8,setup(t,{slots:e}){const n=po(o8(t)),{options:o}=Kt(Nm),r=S(()=>({[i8(t.activeClass,o.linkActiveClass,"router-link-active")]:n.isActive,[i8(t.exactActiveClass,o.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=e.default&&sR(e.default(n));return t.custom?i:zt("a",{"aria-current":n.isExactActive?t.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},i)}}}),lR=aR;function cR(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 uR(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(!Bi(r)||r.length!==o.length||o.some((i,s)=>i.valueOf()!==r[s].valueOf()))return!1}return!0}function r8(t){return t?t.aliasOf?t.aliasOf.path:t.path:""}const i8=(t,e,n)=>t??e??n,dR=se({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(t,{attrs:e,slots:n}){const o=Kt(j1),r=S(()=>t.route||o.value),i=Kt(X_,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]);wi(X_,S(()=>s.value+1)),wi(W4,a),wi(j1,r);const l=Fe();return Ke(()=>[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||!pu(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 s8(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=zt(f,Zt({},m,e,{onVnodeUnmounted:v=>{v.component.isUnmounted&&(d.instances[u]=null)},ref:l}));return s8(n.default,{Component:g,route:c})||g}}});function s8(t,e){if(!t)return null;const n=t(e);return n.length===1?n[0]:n}const fR=dR;function hR(t){const e=tR(t.routes,t),n=t.parseQuery||IN,o=t.stringifyQuery||K_,r=t.history,i=ld(),s=ld(),a=ld(),l=Ne(ya);let c=ya;Nc&&t.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=yv.bind(null,Z=>""+Z),d=yv.bind(null,yN),f=yv.bind(null,hf);function h(Z,be){let re,ve;return z4(Z)?(re=e.getRecordMatcher(Z),ve=be):ve=Z,e.addRoute(ve,re)}function m(Z){const be=e.getRecordMatcher(Z);be&&e.removeRoute(be)}function b(){return e.getRoutes().map(Z=>Z.record)}function g(Z){return!!e.getRecordMatcher(Z)}function v(Z,be){if(be=Zt({},be||l.value),typeof Z=="string"){const j=xv(n,Z,be.path),ee=e.resolve({path:j.path},be),ie=r.createHref(j.fullPath);return Zt(j,ee,{params:f(ee.params),hash:hf(j.hash),redirectedFrom:void 0,href:ie})}let re;if(Z.path!=null)re=Zt({},Z,{path:xv(n,Z.path,be.path).path});else{const j=Zt({},Z.params);for(const ee in j)j[ee]==null&&delete j[ee];re=Zt({},Z,{params:d(j)}),be.params=d(be.params)}const ve=e.resolve(re,be),ce=Z.hash||"";ve.params=u(f(ve.params));const I=_N(o,Zt({},Z,{hash:gN(ce),path:ve.path})),U=r.createHref(I);return Zt({fullPath:I,hash:ce,query:o===K_?NN(Z.query):Z.query||{}},ve,{redirectedFrom:void 0,href:U})}function y(Z){return typeof Z=="string"?xv(n,Z,l.value.path):Zt({},Z)}function x(Z,be){if(c!==Z)return mu(wn.NAVIGATION_CANCELLED,{from:be,to:Z})}function _(Z){return M(Z)}function C(Z){return _(Zt(y(Z),{replace:!0}))}function D(Z,be){const re=Z.matched[Z.matched.length-1];if(re&&re.redirect){const{redirect:ve}=re;let ce=typeof ve=="function"?ve(Z,be):ve;return typeof ce=="string"&&(ce=ce.includes("?")||ce.includes("#")?ce=y(ce):{path:ce},ce.params={}),Zt({query:Z.query,hash:Z.hash,params:ce.path!=null?{}:Z.params},ce)}}function M(Z,be){const re=c=v(Z),ve=l.value,ce=Z.state,I=Z.force,U=Z.replace===!0,j=D(re,ve);if(j)return M(Zt(y(j),{state:typeof j=="object"?Zt({},ce,j.state):ce,force:I,replace:U}),be||re);const ee=re;ee.redirectedFrom=be;let ie;return!I&&kN(o,ve,re)&&(ie=mu(wn.NAVIGATION_DUPLICATED,{to:ee,from:ve}),ae(ve,ve,!0,!1)),(ie?Promise.resolve(ie):E(ee,ve)).catch(de=>Os(de)?Os(de,wn.NAVIGATION_GUARD_REDIRECT)?de:ne(de):G(de,ee,ve)).then(de=>{if(de){if(Os(de,wn.NAVIGATION_GUARD_REDIRECT))return M(Zt({replace:U},y(de.to),{state:typeof de.to=="object"?Zt({},ce,de.to.state):ce,force:I}),be||ee)}else de=T(ee,ve,!0,U,ce);return N(ee,ve,de),de})}function $(Z,be){const re=x(Z,be);return re?Promise.reject(re):Promise.resolve()}function L(Z){const be=le.values().next().value;return be&&typeof be.runWithContext=="function"?be.runWithContext(Z):Z()}function E(Z,be){let re;const[ve,ce,I]=VN(Z,be);re=_v(ve.reverse(),"beforeRouteLeave",Z,be);for(const j of ve)j.leaveGuards.forEach(ee=>{re.push(Ca(ee,Z,be))});const U=$.bind(null,Z,be);return re.push(U),we(re).then(()=>{re=[];for(const j of i.list())re.push(Ca(j,Z,be));return re.push(U),we(re)}).then(()=>{re=_v(ce,"beforeRouteUpdate",Z,be);for(const j of ce)j.updateGuards.forEach(ee=>{re.push(Ca(ee,Z,be))});return re.push(U),we(re)}).then(()=>{re=[];for(const j of I)if(j.beforeEnter)if(Bi(j.beforeEnter))for(const ee of j.beforeEnter)re.push(Ca(ee,Z,be));else re.push(Ca(j.beforeEnter,Z,be));return re.push(U),we(re)}).then(()=>(Z.matched.forEach(j=>j.enterCallbacks={}),re=_v(I,"beforeRouteEnter",Z,be,L),re.push(U),we(re))).then(()=>{re=[];for(const j of s.list())re.push(Ca(j,Z,be));return re.push(U),we(re)}).catch(j=>Os(j,wn.NAVIGATION_CANCELLED)?j:Promise.reject(j))}function N(Z,be,re){a.list().forEach(ve=>L(()=>ve(Z,be,re)))}function T(Z,be,re,ve,ce){const I=x(Z,be);if(I)return I;const U=be===ya,j=Nc?history.state:{};re&&(ve||U?r.replace(Z.fullPath,Zt({scroll:U&&j&&j.scroll},ce)):r.push(Z.fullPath,ce)),l.value=Z,ae(Z,be,re,U),ne()}let O;function P(){O||(O=r.listen((Z,be,re)=>{if(!fe.listening)return;const ve=v(Z),ce=D(ve,fe.currentRoute.value);if(ce){M(Zt(ce,{replace:!0,force:!0}),ve).catch(Wd);return}c=ve;const I=l.value;Nc&&BN(j_(I.fullPath,re.delta),Im()),E(ve,I).catch(U=>Os(U,wn.NAVIGATION_ABORTED|wn.NAVIGATION_CANCELLED)?U:Os(U,wn.NAVIGATION_GUARD_REDIRECT)?(M(Zt(y(U.to),{force:!0}),ve).then(j=>{Os(j,wn.NAVIGATION_ABORTED|wn.NAVIGATION_DUPLICATED)&&!re.delta&&re.type===q1.pop&&r.go(-1,!1)}).catch(Wd),Promise.reject()):(re.delta&&r.go(-re.delta,!1),G(U,ve,I))).then(U=>{U=U||T(ve,I,!1),U&&(re.delta&&!Os(U,wn.NAVIGATION_CANCELLED)?r.go(-re.delta,!1):re.type===q1.pop&&Os(U,wn.NAVIGATION_ABORTED|wn.NAVIGATION_DUPLICATED)&&r.go(-1,!1)),N(ve,I,U)}).catch(Wd)}))}let B=ld(),V=ld(),z;function G(Z,be,re){ne(Z);const ve=V.list();return ve.length?ve.forEach(ce=>ce(Z,be,re)):console.error(Z),Promise.reject(Z)}function K(){return z&&l.value!==ya?Promise.resolve():new Promise((Z,be)=>{B.add([Z,be])})}function ne(Z){return z||(z=!Z,P(),B.list().forEach(([be,re])=>Z?re(Z):be()),B.reset()),Z}function ae(Z,be,re,ve){const{scrollBehavior:ce}=t;if(!Nc||!ce)return Promise.resolve();const I=!re&&LN(j_(Z.fullPath,0))||(ve||!re)&&history.state&&history.state.scroll||null;return kn().then(()=>ce(Z,be,I)).then(U=>U&&MN(U)).catch(U=>G(U,Z,be))}const he=Z=>r.go(Z);let ge;const le=new Set,fe={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:V.add,isReady:K,install(Z){Z.component("RouterLink",lR),Z.component("RouterView",fR),Z.config.globalProperties.$router=fe,Object.defineProperty(Z.config.globalProperties,"$route",{enumerable:!0,get:()=>p(l)}),Nc&&!ge&&l.value===ya&&(ge=!0,_(r.location).catch(ve=>{}));const be={};for(const ve in ya)Object.defineProperty(be,ve,{get:()=>l.value[ve],enumerable:!0});Z.provide(Nm,fe),Z.provide(Qy,y3(be)),Z.provide(j1,l);const re=Z.unmount;le.add(Z),Z.unmount=function(){le.delete(Z),le.size<1&&(c=ya,O&&O(),O=null,l.value=ya,ge=!1,z=!1),re()}}};function we(Z){return Z.reduce((be,re)=>be.then(()=>L(re)),Promise.resolve())}return fe}function Rm(){return Kt(Nm)}function uc(t){return Kt(Qy)}function pf(t,e){return sc()?(Fa(t,e),!0):!1}const kv=new WeakMap,pR=(...t)=>{var e;const n=t[0],o=(e=Do())===null||e===void 0?void 0:e.proxy,r=o??sc();if(r==null&&!Ty())throw new Error("injectLocal must be called in setup");return r&&kv.has(r)&&n in kv.get(r)?kv.get(r)[n]:Kt(...t)},K1=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const mR=t=>t!=null,gR=Object.prototype.toString,vR=t=>gR.call(t)==="[object Object]",Ba=()=>{};function Y4(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 bR(t,e={}){let n,o,r=Ba;const i=l=>{clearTimeout(l),r(),r=Ba};let s;return l=>{const c=yt(t),u=yt(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 yR(...t){let e=0,n,o=!0,r=Ba,i,s,a,l,c;!Ze(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=Ba)};return f=>{const h=yt(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 a8(t){return t.endsWith("rem")?Number.parseFloat(t)*16:Number.parseFloat(t)}function Ud(t){return Array.isArray(t)?t:[t]}function xR(t){return Do()}function wR(t,e=200,n={}){return Y4(bR(e,n),t)}function _R(t,e=200,n=!1,o=!0,r=!1){return Y4(yR(e,n,o,r),t)}function Jy(t,e=!0,n){xR()?vn(t,n):e?t():kn(t)}function X1(t,e=1e3,n={}){const{immediate:o=!0,immediateCallback:r=!1}=n;let i=null;const s=Ne(!1);function a(){i&&(clearInterval(i),i=null)}function l(){s.value=!1,a()}function c(){const u=yt(e);u<=0||(s.value=!0,r&&t(),a(),s.value&&(i=setInterval(t,u)))}return o&&K1&&c(),(Ze(e)||typeof e=="function")&&pf(Ke(e,()=>{s.value&&K1&&c()})),pf(l),{isActive:kl(s),pause:l,resume:c}}function kR(t,e,n){return Ke(t,e,{...n,immediate:!0})}const ol=K1?window:void 0;function lr(t){var e;const n=yt(t);return(e=n==null?void 0:n.$el)!==null&&e!==void 0?e:n}function Zs(...t){const e=(o,r,i,s)=>(o.addEventListener(r,i,s),()=>o.removeEventListener(r,i,s)),n=S(()=>{const o=Ud(yt(t[0])).filter(r=>r!=null);return o.every(r=>typeof r!="string")?o:void 0});return kR(()=>{var o,r;return[(o=(r=n.value)===null||r===void 0?void 0:r.map(i=>lr(i)))!==null&&o!==void 0?o:[ol].filter(i=>i!=null),Ud(yt(n.value?t[1]:t[0])),Ud(p(n.value?t[2]:t[1])),yt(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=vR(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 SR(t,e,n={}){const{window:o=ol,ignore:r=[],capture:i=!0,detectIframe:s=!1,controls:a=!1}=n;if(!o)return a?{stop:Ba,cancel:Ba,trigger:Ba}:Ba;let l=!0;const c=g=>yt(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=lr(v);return y&&(g.target===y||g.composedPath().includes(y))}});function u(g){const v=yt(g);return v&&v.$.subTree.shapeFlag===16}function d(g,v){const y=yt(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=lr(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=[Zs(o,"click",g=>{h||(h=!0,setTimeout(()=>{h=!1},0),f(g))},{passive:!0,capture:i}),Zs(o,"pointerdown",g=>{const v=lr(t);l=!c(g)&&!!(v&&!g.composedPath().includes(v))},{passive:!0}),s&&Zs(o,"blur",g=>{setTimeout(()=>{var v;const y=lr(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 CR(){const t=Ne(!1),e=Do();return e&&vn(()=>{t.value=!0},e),t}function e2(t){const e=CR();return S(()=>(e.value,!!t()))}function AR(t,e,n={}){const{window:o=ol,...r}=n;let i;const s=e2(()=>o&&"MutationObserver"in o),a=()=>{i&&(i.disconnect(),i=void 0)},l=Ke(S(()=>{const d=Ud(yt(t)).map(lr).filter(mR);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 pf(u),{isSupported:s,stop:u,takeRecords:c}}function l8(t,e={}){const{immediate:n=!0,fpsLimit:o=null,window:r=ol,once:i=!1}=e,s=Ne(!1),a=S(()=>{const h=yt(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(),pf(f),{isActive:fo(s),pause:f,resume:d}}const $R=Symbol("vueuse-ssr-width");function TR(){const t=Ty()?pR($R,null):null;return typeof t=="number"?t:void 0}function t2(t,e={}){const{window:n=ol,ssrWidth:o=TR()}=e,r=e2(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function"),i=Ne(typeof o=="number"),s=Ne(),a=Ne(!1),l=c=>{a.value=c.matches};return vm(()=>{if(i.value){i.value=!r.value,a.value=yt(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>=a8(d[1])),f&&h&&(h=o<=a8(f[1])),u?!h:h});return}r.value&&(s.value=n.matchMedia(yt(t)),a.value=s.value.matches)}),Zs(s,"change",l,{passive:!0}),S(()=>a.value)}function ps(t,e,n={}){const{window:o=ol,...r}=n;let i;const s=e2(()=>o&&"ResizeObserver"in o),a=()=>{i&&(i.disconnect(),i=void 0)},l=Ke(S(()=>{const u=yt(t);return Array.isArray(u)?u.map(d=>lr(d)):[lr(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 pf(c),{isSupported:s,stop:c}}function OR(t,e={}){const{reset:n=!0,windowResize:o=!0,windowScroll:r=!0,immediate:i=!0,updateTiming:s="sync"}=e,a=Ne(0),l=Ne(0),c=Ne(0),u=Ne(0),d=Ne(0),f=Ne(0),h=Ne(0),m=Ne(0);function b(){const v=lr(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 ps(t,g),Ke(()=>lr(t),v=>!v&&g()),AR(t,g,{attributeFilter:["style","class"]}),r&&Zs("scroll",g,{capture:!0,passive:!0}),o&&Zs("resize",g,{passive:!0}),Jy(()=>{i&&g()}),{height:a,bottom:l,left:c,right:u,top:d,width:f,x:h,y:m,update:g}}function MR(t,e={width:0,height:0},n={}){const{window:o=ol,box:r="content-box"}=n,i=S(()=>{var d;return(d=lr(t))===null||d===void 0||(d=d.namespaceURI)===null||d===void 0?void 0:d.includes("svg")}),s=Ne(e.width),a=Ne(e.height),{stop:l}=ps(t,([d])=>{const f=r==="border-box"?d.borderBoxSize:r==="content-box"?d.contentBoxSize:d.devicePixelContentBoxSize;if(o&&i.value){const h=lr(t);if(h){const m=h.getBoundingClientRect();s.value=m.width,a.value=m.height}}else if(f){const h=Ud(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);Jy(()=>{const d=lr(t);d&&(s.value="offsetWidth"in d?d.offsetWidth:e.width,a.value="offsetHeight"in d?d.offsetHeight:e.height)});const c=Ke(()=>lr(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 BR(t){if("interval"in t||"immediate"in t){const{interval:e="requestAnimationFrame",immediate:n=!0}=t;return e==="requestAnimationFrame"?o=>l8(o,{immediate:n}):o=>X1(o,e,t)}return l8}function LR(t={}){const{controls:e=!1,scheduler:n=BR(t)}=t,o=Fe(new Date),i=n(()=>o.value=new Date);return e?{now:o,...i}:o}const PR=[{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"}],DR={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 ER(t){return t.toISOString().slice(0,10)}function IR(t){if("updateInterval"in t){const{updateInterval:e=3e4}=t;return n=>X1(n,e)}return e=>X1(e,3e4)}function NR(t,e={}){const{controls:n=!1,scheduler:o=IR(e)}=e,{now:r,...i}=LR({scheduler:o,controls:!0}),s=S(()=>RR(new Date(yt(t)),e,yt(r)));return n?{timeAgo:s,...i}:s}function RR(t,e={},n=Date.now()){const{max:o,messages:r=DR,fullDateFormatter:i=ER,units:s=PR,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}function FR(t={}){const{window:e=ol,initialWidth:n=Number.POSITIVE_INFINITY,initialHeight:o=Number.POSITIVE_INFINITY,listenOrientation:r=!0,includeScrollbar:i=!0,type:s="inner"}=t,a=Ne(n),l=Ne(o),c=()=>{if(e)if(s==="outer")a.value=e.outerWidth,l.value=e.outerHeight;else if(s==="visual"&&e.visualViewport){const{width:d,height:f,scale:h}=e.visualViewport;a.value=Math.round(d*h),l.value=Math.round(f*h)}else i?(a.value=e.innerWidth,l.value=e.innerHeight):(a.value=e.document.documentElement.clientWidth,l.value=e.document.documentElement.clientHeight)};c(),Jy(c);const u={passive:!0};return Zs("resize",c,u),e&&s==="visual"&&e.visualViewport&&Zs(e.visualViewport,"resize",c,u),r&&Ke(t2("(orientation: portrait)"),()=>c()),{width:a,height:l}}var ln=(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))(ln||{});function Gf(t){const e=new Map,n=Fe([]);function o(){n.value=Array.from(e.values())}return wi(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 j4(t,e){const n=Kt(t,null);if(!n)return;const o=Do();if(!o)return;const r=o.uid;vn(()=>{n.register(r,e())}),Ke(e,i=>{n.update(r,i)}),oa(()=>{n.unregister(r)})}const K4=Symbol("ButtonGroupEntries"),X4=Symbol("DropdownEntries"),VR=Symbol("PaletteEntries"),zR=Symbol("IconRailEntries"),HR=Symbol("ToggleEntries"),WR={sm:576,md:768,lg:992,xl:1200,xxl:1400};function Yr(t="md"){const e=typeof t=="number"?t:WR[t];return{isNarrow:t2(`(max-width: ${e-1}px)`)}}const UR=se({__name:"ButtonIconCounter",props:{counter:{default:null},variant:{default:"secondary"}},setup(t){return(e,n)=>{const o=jy;return t.counter!=null?(w(),Q(o,{key:0,variant:t.variant,class:"button-icon-counter text-nowrap",pill:""},{default:J(()=>[Ce(e.$slots,"default",{},()=>[He(pe(t.counter),1)])]),_:3},8,["variant"])):oe("",!0)}}}),GR=se({__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=Ne(!1);function o(){n.value=e.hover}Ke(()=>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:Te(["app-icon",p(c)]),style:Lt(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(),Q(Rt(t.name),{key:0})):Ce(u.$slots,"default",{key:1},void 0,!0)],38))}}),Be=(t,e)=>{const n=t.__vccOpts||t;for(const[o,r]of e)n[o]=r;return n},wr=Be(GR,[["__scopeId","data-v-eaec91c1"]]),qR={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function YR(t,e){return w(),R("svg",qR,[...e[0]||(e[0]=[A("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 Z4=Oe({name:"ph-circle-notch",render:YR}),jR={key:1,class:"button-icon__label"},KR=se({__name:"ButtonIcon",props:{id:{},iconLeft:{},iconLeftVariant:{},iconLeftHoverVariant:{},iconLeftSize:{default:"1.25em"},iconRight:{},iconRightVariant:{},iconRightHoverVariant:{},iconRightSize:{default:"1.25em"},iconSpinner:{default:()=>Z4},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=Kt("variant","action"),r=Kt("size","md"),i=bt("element"),s=t,a=e;function l(y){a(`click:${y}`)}const c=Ne(!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 _=wr,C=UR,D=ff,M=qo;return w(),Q(M,kt(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:J(()=>[Ce(y.$slots,"start",{},void 0,!0),t.iconLeft||!t.iconLeft&&!t.iconRight&&t.loading?(w(),Q(_,{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"])):oe("",!0),t.hideLabel?oe("",!0):(w(),R("span",jR,[Ce(y.$slots,"default",jn(ir({labelOrLoadingText:p(m)})),()=>[He(pe(p(m)),1)],!0)])),t.iconRight?(w(),Q(_,{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"])):oe("",!0),t.counter!==null?(w(),Q(C,{key:3,counter:t.counter,variant:t.counterVariant,style:Lt(t.counterStyle)},null,8,["counter","variant","style"])):oe("",!0),Ce(y.$slots,"end",{},void 0,!0),p(g)?(w(),Q(D,{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"])):oe("",!0)]),_:3},16,["id","class","aria-label"])}}}),zn=Be(KR,[["__scopeId","data-v-6dc68caf"]]),XR={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function ZR(t,e){return w(),R("svg",XR,[...e[0]||(e[0]=[A("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 Q4=Oe({name:"ph-copy",render:ZR}),QR={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function JR(t,e){return w(),R("svg",QR,[...e[0]||(e[0]=[A("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 n2=Oe({name:"ph-check",render:JR}),c8=se({__name:"ActionCopyButton",props:{text:{},label:{default:"Copy"},variant:{default:"outline-secondary"},size:{default:"sm"}},setup(t){const e=t,n=Ne(!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=zn;return w(),Q(a,{"icon-left":p(n)?p(n2):p(Q4),label:p(n)?"Copied!":t.label,variant:p(n)?"success":t.variant,size:t.size,onClick:r},null,8,["icon-left","label","variant","size"])}}}),on=se({__name:"FormControlCheckbox",props:lt({label:{}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=mt(t,"modelValue");return(n,o)=>{const r=Xs,i=Mn;return w(),Q(i,{class:"form-control-checkbox"},{default:J(()=>[H(r,{"model-value":e.value,class:"form-control-checkbox__input",switch:"","onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s)},{default:J(()=>[Ce(n.$slots,"default",{},()=>[He(pe(t.label),1)])]),_:3},8,["model-value"]),e.value?Ce(n.$slots,"section",{key:0}):oe("",!0)]),_:3})}}});function Zp(t){"@babel/helpers - typeof";return Zp=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},Zp(t)}var eF=/^\s+/,tF=/\s+$/;function ot(t,e){if(t=t||"",e=e||{},t instanceof ot)return t;if(!(this instanceof ot))return new ot(t,e);var n=nF(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}ot.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=J4(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=d8(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=d8(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=u8(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=u8(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 f8(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return sF(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(bn(this._r,255)*100)+"%",g:Math.round(bn(this._g,255)*100)+"%",b:Math.round(bn(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(bn(this._r,255)*100)+"%, "+Math.round(bn(this._g,255)*100)+"%, "+Math.round(bn(this._b,255)*100)+"%)":"rgba("+Math.round(bn(this._r,255)*100)+"%, "+Math.round(bn(this._g,255)*100)+"%, "+Math.round(bn(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:bF[f8(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var e="#"+h8(this._r,this._g,this._b,this._a),n=e,o=this._gradientType?"GradientType = 1, ":"";if(t){var r=ot(t);n="#"+h8(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 ot(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(uF,arguments)},brighten:function(){return this._applyModification(dF,arguments)},darken:function(){return this._applyModification(fF,arguments)},desaturate:function(){return this._applyModification(aF,arguments)},saturate:function(){return this._applyModification(lF,arguments)},greyscale:function(){return this._applyModification(cF,arguments)},spin:function(){return this._applyModification(hF,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(gF,arguments)},complement:function(){return this._applyCombination(pF,arguments)},monochromatic:function(){return this._applyCombination(vF,arguments)},splitcomplement:function(){return this._applyCombination(mF,arguments)},triad:function(){return this._applyCombination(p8,[3])},tetrad:function(){return this._applyCombination(p8,[4])}};ot.fromRatio=function(t,e){if(Zp(t)=="object"){var n={};for(var o in t)t.hasOwnProperty(o)&&(o==="a"?n[o]=t[o]:n[o]=wd(t[o]));t=n}return ot(t,e)};function nF(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=_F(t)),Zp(t)=="object"&&(Ms(t.r)&&Ms(t.g)&&Ms(t.b)?(e=oF(t.r,t.g,t.b),s=!0,a=String(t.r).substr(-1)==="%"?"prgb":"rgb"):Ms(t.h)&&Ms(t.s)&&Ms(t.v)?(o=wd(t.s),r=wd(t.v),e=iF(t.h,o,r),s=!0,a="hsv"):Ms(t.h)&&Ms(t.s)&&Ms(t.l)&&(o=wd(t.s),i=wd(t.l),e=rF(t.h,o,i),s=!0,a="hsl"),t.hasOwnProperty("a")&&(n=t.a)),n=J4(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 oF(t,e,n){return{r:bn(t,255)*255,g:bn(e,255)*255,b:bn(n,255)*255}}function u8(t,e,n){t=bn(t,255),e=bn(e,255),n=bn(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 rF(t,e,n){var o,r,i;t=bn(t,360),e=bn(e,100),n=bn(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 d8(t,e,n){t=bn(t,255),e=bn(e,255),n=bn(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 iF(t,e,n){t=bn(t,360)*6,e=bn(e,100),n=bn(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 f8(t,e,n,o){var r=[pi(Math.round(t).toString(16)),pi(Math.round(e).toString(16)),pi(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 sF(t,e,n,o,r){var i=[pi(Math.round(t).toString(16)),pi(Math.round(e).toString(16)),pi(Math.round(n).toString(16)),pi(eA(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 h8(t,e,n,o){var r=[pi(eA(o)),pi(Math.round(t).toString(16)),pi(Math.round(e).toString(16)),pi(Math.round(n).toString(16))];return r.join("")}ot.equals=function(t,e){return!t||!e?!1:ot(t).toRgbString()==ot(e).toRgbString()};ot.random=function(){return ot.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function aF(t,e){e=e===0?0:e||10;var n=ot(t).toHsl();return n.s-=e/100,n.s=Fm(n.s),ot(n)}function lF(t,e){e=e===0?0:e||10;var n=ot(t).toHsl();return n.s+=e/100,n.s=Fm(n.s),ot(n)}function cF(t){return ot(t).desaturate(100)}function uF(t,e){e=e===0?0:e||10;var n=ot(t).toHsl();return n.l+=e/100,n.l=Fm(n.l),ot(n)}function dF(t,e){e=e===0?0:e||10;var n=ot(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)))),ot(n)}function fF(t,e){e=e===0?0:e||10;var n=ot(t).toHsl();return n.l-=e/100,n.l=Fm(n.l),ot(n)}function hF(t,e){var n=ot(t).toHsl(),o=(n.h+e)%360;return n.h=o<0?360+o:o,ot(n)}function pF(t){var e=ot(t).toHsl();return e.h=(e.h+180)%360,ot(e)}function p8(t,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var n=ot(t).toHsl(),o=[ot(t)],r=360/e,i=1;i<e;i++)o.push(ot({h:(n.h+i*r)%360,s:n.s,l:n.l}));return o}function mF(t){var e=ot(t).toHsl(),n=e.h;return[ot(t),ot({h:(n+72)%360,s:e.s,l:e.l}),ot({h:(n+216)%360,s:e.s,l:e.l})]}function gF(t,e,n){e=e||6,n=n||30;var o=ot(t).toHsl(),r=360/n,i=[ot(t)];for(o.h=(o.h-(r*e>>1)+720)%360;--e;)o.h=(o.h+r)%360,i.push(ot(o));return i}function vF(t,e){e=e||6;for(var n=ot(t).toHsv(),o=n.h,r=n.s,i=n.v,s=[],a=1/e;e--;)s.push(ot({h:o,s:r,v:i})),i=(i+a)%1;return s}ot.mix=function(t,e,n){n=n===0?0:n||50;var o=ot(t).toRgb(),r=ot(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 ot(s)};ot.readability=function(t,e){var n=ot(t),o=ot(e);return(Math.max(n.getLuminance(),o.getLuminance())+.05)/(Math.min(n.getLuminance(),o.getLuminance())+.05)};ot.isReadable=function(t,e,n){var o=ot.readability(t,e),r,i;switch(i=!1,r=kF(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};ot.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=ot.readability(t,e[c]),i>r&&(r=i,o=ot(e[c]));return ot.isReadable(t,o,{level:a,size:l})||!s?o:(n.includeFallbackColors=!1,ot.mostReadable(t,["#fff","#000"],n))};var Z1=ot.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"},bF=ot.hexNames=yF(Z1);function yF(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}function J4(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function bn(t,e){xF(t)&&(t="100%");var n=wF(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 Fm(t){return Math.min(1,Math.max(0,t))}function br(t){return parseInt(t,16)}function xF(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function wF(t){return typeof t=="string"&&t.indexOf("%")!=-1}function pi(t){return t.length==1?"0"+t:""+t}function wd(t){return t<=1&&(t=t*100+"%"),t}function eA(t){return Math.round(parseFloat(t)*255).toString(16)}function m8(t){return br(t)/255}var ci=(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 Ms(t){return!!ci.CSS_UNIT.exec(t)}function _F(t){t=t.replace(eF,"").replace(tF,"").toLowerCase();var e=!1;if(Z1[t])t=Z1[t],e=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=ci.rgb.exec(t))?{r:n[1],g:n[2],b:n[3]}:(n=ci.rgba.exec(t))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=ci.hsl.exec(t))?{h:n[1],s:n[2],l:n[3]}:(n=ci.hsla.exec(t))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=ci.hsv.exec(t))?{h:n[1],s:n[2],v:n[3]}:(n=ci.hsva.exec(t))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=ci.hex8.exec(t))?{r:br(n[1]),g:br(n[2]),b:br(n[3]),a:m8(n[4]),format:e?"name":"hex8"}:(n=ci.hex6.exec(t))?{r:br(n[1]),g:br(n[2]),b:br(n[3]),format:e?"name":"hex"}:(n=ci.hex4.exec(t))?{r:br(n[1]+""+n[1]),g:br(n[2]+""+n[2]),b:br(n[3]+""+n[3]),a:m8(n[4]+""+n[4]),format:e?"name":"hex8"}:(n=ci.hex3.exec(t))?{r:br(n[1]+""+n[1]),g:br(n[2]+""+n[2]),b:br(n[3]+""+n[3]),format:e?"name":"hex"}:!1}function kF(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 g8=(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}},Sv=(t,e)=>!!(Object.prototype.hasOwnProperty.call(t,e)&&typeof t[e]<"u"),xh=t=>typeof t>"u",o2=["update:tinyColor","update:modelValue","input"];function r2(t,e,n){let o,r;const i=S({get:()=>{const{modelValue:a,tinyColor:l,value:c}=t,u=l??a??c;return xh(r)&&(xh(c)||(r=ot(c).getFormat()),xh(a)||(r=ot(a).getFormat())),xh(o)&&(typeof c=="object"&&!(c instanceof ot)&&(o=!0),typeof a=="object"&&(o=!0)),ot(u)},set:a=>{s(a)}}),s=a=>{const l=ot(a);if(Sv(t,"tinyColor")&&e("update:tinyColor",l),Sv(t,"modelValue")){const c=g8(l,r,o);e("update:modelValue",c)}if(Sv(t,"value")){const c=g8(l,r,o);e("input",c)}};return i}const tA=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},SF=()=>{const t=window.scrollX||window.pageXOffset||document.documentElement.scrollLeft||0,e=window.scrollY||window.pageYOffset||document.documentElement.scrollTop||0;return{x:t,y:e}},nA=t=>{const{x:e,y:n}=SF(),o=t.getBoundingClientRect();return{x:o.left+e,y:o.top+n}},i2=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 CF(t){const e=t.toString();return e.indexOf(".")!==-1?e.split(".")[1].length:0}function Cv(t,e,n){return Math.min(Math.max(t,e),n)}const oA=(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)}},AF=["aria-valuetext"],$F=se({__name:"SaturationSlider",props:{hue:{},tinyColor:{},modelValue:{},value:{}},emits:["change"].concat(o2),setup(t,{emit:e}){const n=e,o=t,r=Fe(0),i=r2(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=Fe(null);function f(x){const _=d.value;if(!_)return;const C=_.clientWidth,D=_.clientHeight,{x:M,y:$}=nA(_),{x:L,y:E}=tA(x),N=Cv(L-M,0,C),T=Cv(E-$,0,D),O=N/C,P=Cv(1-T/D,0,1);r.value=O;let B=Math.round(O*100),V=Math.round(P*100);B===1&&(B=.01),V===1&&(V=.01),h({h:a.value,s:B,v:V,a:s.value.a})}function h(x){i.value=x}const m=oA(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(),i2(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 ca(()=>{v()}),(x,_)=>(w(),R("div",{class:"vc-saturation-slider bg",style:Lt({background:l.value}),ref_key:"containerRef",ref:d,onMousedown:b,onTouchstart:b,role:"application","aria-label":"Saturation and brightness picker"},[_[1]||(_[1]=A("div",{class:"bg white"},null,-1)),_[2]||(_[2]=A("div",{class:"bg black"},null,-1)),A("div",{class:"picker-wrap",style:Lt({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]=[A("div",{class:"picker"},null,-1)]),44,AF)],36))}}),Eu=(t,e)=>{const n=t.__vccOpts||t;for(const[o,r]of e)n[o]=r;return n},TF=Eu($F,[["__scopeId","data-v-4d048d6e"]]),Q1=t=>typeof t<"u",OF={class:"vc-base-slider"},MF={key:0,class:"background"},BF=["aria-label","aria-valuemax","aria-valuenow"],LF=se({__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=Fe(null);function a(m){Q1(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}=nA(v),{x:D,y:M}=tA(m),$=D-_,L=M-C;let E;b==="vertical"?L<0?E=g:L>x?E=0:E=(1-L/x)*g:$<0?E=0:$>y?E=g:E=$/y*g,a(E)}const c=oA(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=i2(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 ca(()=>{f()}),(m,b)=>(w(),R("div",OF,[m.$slots.background?(w(),R("div",MF,[Ce(m.$slots,"background",{},void 0,!0)])):oe("",!0),A("div",{class:Te({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},[A("div",{class:"picker-wrap",style:Lt({left:m.direction==="horizontal"?i.value:0,top:m.direction==="vertical"?i.value:0}),role:"presentation"},[Ce(m.$slots,"picker",{},()=>[b[0]||(b[0]=A("div",{class:"picker"},null,-1))],!0)],4)],42,BF)]))}}),PF=Eu(LF,[["__scopeId","data-v-972b0fad"]]),DF=se({__name:"HueSlider",props:{direction:{default:"horizontal"},modelValue:{default:0}},emits:["update:modelValue"],setup(t,{emit:e}){wC(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=Fe();Ke(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(),Q(PF,{class:"vc-hue-slider",max:360,step:1,modelValue:a.value,direction:u.direction,"onUpdate:modelValue":l,"aria-label":"Hue"},{background:J(()=>d[0]||(d[0]=[A("div",{class:"gradient"},null,-1)])),picker:J(()=>[Ce(u.$slots,"default",{},void 0,!0)]),_:3},8,["modelValue","direction"]))}}),rA=Eu(DF,[["__scopeId","data-v-5367c985"]]),EF={class:"vc-editable-input"},IF=["value","aria-label"],NF={key:0,class:"vc-input-desc","aria-hidden":"true"},RF=se({__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(Q1(h)&&+d>h){o("change",h);return}if(Q1(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=CF(h),b=i2(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",EF,[A("input",{class:"vc-input-input",value:n.value,onKeydown:c,onInput:a,onBlur:l,"aria-label":p(r),id:i},null,40,IF),A("label",{for:i,class:"vc-input-label","aria-hidden":"true"},pe(n.label),1),d.desc?(w(),R("span",NF,pe(d.desc),1)):oe("",!0)]))}}),Cl=Eu(RF,[["__scopeId","data-v-9c267b2b"]]),v8=t=>ot(t).isValid(),iA=se({__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=ot(c).toHexString()),u==="hex8"&&(d=ot(c).toHex8String()),n.withHash!==!0&&(d=d.replace("#","")),d},s=Fe(i(n.value,n.type));Ke(()=>n.value,c=>{ot.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||v8(c)&&o("change",c))},l=()=>{let c=s.value.length;s.value[0]==="#"&&(c=c-1),!(v8(s.value)&&(n.type==="hex"&&c===6||n.type==="hex8"&&c===8))&&(s.value=i(n.value,n.type))};return(c,u)=>(w(),Q(Cl,{label:n.label,a11y:r,value:s.value,onChange:a,onBlur:l},null,8,["label","value"]))}});function FF(){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";return t.charAt(Math.floor(Math.random()*t.length))+t.charAt(Math.floor(Math.random()*t.length))}const VF=t=>{const e=Fe(0),n=`__from__vc__hue__${FF()}`;return Ke(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=ot({...t.value.toHsl(),h:o});r[n]=!0,t.value=r,e.value=o}}},zF={class:"title","aria-hidden":"true"},HF={class:"body"},WF={class:"saturation"},UF={class:"hue"},GF={class:"preview"},qF={class:"preview-label","aria-hidden":"true"},YF={class:"preview-swatches"},jF=["aria-label"],KF=["aria-label"],XF={class:"preview-label","aria-hidden":"true"},ZF={key:0,class:"actions"},QF=["aria-label"],JF={class:"fields"},eV=["aria-label"];o2.concat(["ok","cancel","reset"]);const tV={class:"body",role:"listbox",tabindex:"0","aria-label":"Select a color"},nV=["onClick","aria-label","title","aria-selected","onKeydown"],oV=["#FF6900","#FCB900","#7BDCB5","#00D084","#8ED1FC","#0693E3","#ABB8C3","#EB144C","#F78DA7","#9900EF"],rV=se({__name:"TwitterPicker",props:{width:{default:276},presetColors:{default:()=>oV},triangle:{default:"top-left"},tinyColor:{},modelValue:{},value:{}},emits:o2,setup(t,{emit:e}){const n=t,o=r2(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:Te(["vc-twitter-picker",{tri_hide:n.triangle==="hide",tri_top_left:n.triangle==="top-left",tri_top_right:n.triangle==="top-right"}]),style:Lt({width:typeof n.width=="number"?`${n.width}px`:n.width}),role:"application","aria-label":"Twitter color picker"},[c[2]||(c[2]=A("div",{class:"triangle_shadow"},null,-1)),c[3]||(c[3]=A("div",{class:"triangle"},null,-1)),A("div",tV,[(w(!0),R(Re,null,vt(l.presetColors,(u,d)=>(w(),R("span",{key:d,class:"swatch",style:Lt({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:ar(f=>s(u),["space"]),tabindex:"0"},null,44,nV))),128)),c[0]||(c[0]=A("div",{class:"hash","aria-hidden":"true"},"#",-1)),H(iA,{value:r.value,onChange:a},null,8,["value"]),c[1]||(c[1]=A("div",{class:"clear"},null,-1))])],6))}}),iV=Eu(rV,[["__scopeId","data-v-e74ac697"]]),sV=se({__name:"HueSlider",props:{modelValue:{},value:{}},emits:["input","update:modelValue"],setup(t,{emit:e}){wC(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(),Q(rA,kt({class:"vc-hue-wrap"},a.$attrs,{modelValue:r.value,"onUpdate:modelValue":i}),null,16,["modelValue"]))}}),aV=Eu(sV,[["__scopeId","data-v-b3ac1ab2"]]),sA=se({__name:"FormControlColorInputPopover",props:lt({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=mt(t,"modelValue"),n=t,o=mt(t,"open"),r=bt("contentRef");SR(r,()=>{n.manual&&(o.value=!1)},{detectIframe:!0,ignore:()=>[n.target]});const s=S(()=>ot(e.value).toHsv().h);function a(l){const c=ot({h:l,s:1,v:1}).toHexString();e.value=c}return(l,c)=>(w(),Q(p(u4),{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:J(()=>[A("div",{ref_key:"contentRef",ref:r},[H(p(iV),{modelValue:e.value,"onUpdate:modelValue":c[0]||(c[0]=u=>e.value=u),triangle:"hide",class:"mb-3"},null,8,["modelValue"]),H(p(aV),{"model-value":p(s),class:"color-picker-popover__hue","onUpdate:modelValue":a},null,8,["model-value"])],512)]),_:1},8,["modelValue","target","click","manual"]))}}),lV={class:"form-control-color-input__wrapper"},cV=["id","value"],uV=se({__name:"FormControlColorInput",props:lt({label:{},id:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=mt(t,"modelValue"),n=bt("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=sA,l=Mn;return w(),Q(l,{class:"form-control-color-input",label:t.label,"label-for":t.id},{default:J(()=>[A("div",lV,[A("button",{ref_key:"swatchRef",ref:n,type:"button",class:"form-control-color-input__wrapper__swatch",style:Lt({backgroundColor:e.value})},null,4),A("input",{id:t.id,class:"form-control form-control-color-input__wrapper__field",value:e.value,onInput:o,onChange:r},null,40,cV)]),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"])}}}),Ua=Be(uV,[["__scopeId","data-v-166af452"]]),dV=["data-d","title"],fV=se({__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:Te(["direction-picker-handle",[p(n),{"direction-picker-handle--active":t.active}]]),"data-d":t.pos,title:t.label,onClick:r[0]||(r[0]=pn(i=>o.$emit("select"),["stop","prevent"]))},null,10,dV))}}),hV=Be(fV,[["__scopeId","data-v-ef260532"]]),pV={class:"direction-picker-field"},mV=se({__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",pV,[A("div",{class:"direction-picker-field__crosshair-h",style:Lt({top:p(o)})},null,4),A("div",{class:"direction-picker-field__crosshair-v",style:Lt({left:p(n)})},null,4),A("div",{class:"direction-picker-field__rect",style:Lt(p(r))},null,4)]))}}),gV=Be(mV,[["__scopeId","data-v-2f06dda2"]]),vV=se({__name:"FormControlDirectionPicker",props:lt({label:{},size:{default:"sm"}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=mt(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=gV,c=hV,u=Mn;return w(),Q(u,{class:"direction-picker",label:t.label},{default:J(()=>[A("div",{class:Te(["direction-picker__anchor",p(i)])},[H(l,{x:p(r).x,y:p(r).y},null,8,["x","y"]),(w(),R(Re,null,vt(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"])}}}),aA=Be(vV,[["__scopeId","data-v-37d271a9"]]),bV=se({__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:Te(["display-color-swatch",p(n)]),style:Lt({backgroundColor:t.color})},null,6))}}),Vm=Be(bV,[["__scopeId","data-v-9e199d96"]]),yV={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function xV(t,e){return w(),R("svg",yV,[...e[0]||(e[0]=[A("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 s2=Oe({name:"ph-plus",render:xV}),wV=se({__name:"ButtonAdd",props:{label:{default:"Add"},size:{default:"default"}},emits:["click"],setup(t){return(e,n)=>{const o=zn;return w(),Q(o,{"icon-left":p(s2),label:t.label,variant:"outline-secondary",class:Te(["button-add",{"button-add--sm":t.size==="sm"}]),onClick:n[0]||(n[0]=r=>e.$emit("click"))},{default:J(()=>[Ce(e.$slots,"default",{},void 0,!0)]),_:3},8,["icon-left","label","class"])}}}),Rl=Be(wV,[["__scopeId","data-v-fec65d28"]]),_V={class:"d-flex flex-wrap gap-1"},kV=["onClick"],SV={class:"form-control-colors-input__tag__hex"},CV=["aria-label","onClick"],AV=se({__name:"FormControlColorsInput",props:lt({label:{},id:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=mt(t,"modelValue"),n=bt("addBtnRef"),o=Ne("#4e79a7"),r=Ne(-1),i=Fe(null),s=Ne(!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=Vm,m=sA,b=Mn;return w(),Q(b,{class:"form-control-colors-input",label:t.label,"label-for":t.id},{default:J(()=>[A("div",_V,[(w(!0),R(Re,null,vt(e.value,(g,v)=>(w(),R("span",{key:v,class:"form-control-colors-input__tag"},[A("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,kV),A("span",SV,pe(g),1),A("button",{type:"button",class:"form-control-colors-input__tag__remove","aria-label":`Remove ${g}`,onClick:y=>c(v)}," × ",8,CV)]))),128)),H(Rl,{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=>Ze(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"])}}}),$V=Be(AV,[["__scopeId","data-v-b39aae3e"]]),TV={class:"form-control-dropdown-item__content"},OV={class:"form-control-dropdown-item__content__text"},MV={key:1,class:"form-control-dropdown-item__content__visual"},BV=["src"],LV=se({__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=g4;return w(),Q(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:J(()=>[A("div",TV,[t.icon?(w(),Q(Rt(t.icon),{key:0,class:"form-control-dropdown-item__content__icon"})):oe("",!0),A("div",OV,[A("span",{class:Te(["form-control-dropdown-item__content__text__label",p(n)])},pe(t.label),3),t.description?(w(),R("small",{key:0,class:Te(["form-control-dropdown-item__content__text__description",p(o)])},pe(t.description),3)):oe("",!0)]),t.visual?(w(),R("div",MV,[typeof t.visual!="string"?(w(),Q(Rt(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,BV))])):oe("",!0)])]),_:1},8,["active"])}}}),PV=Be(LV,[["__scopeId","data-v-b5a1db22"]]),DV={key:0,class:"form-control-dropdown__toggle__content"},EV=se({__name:"FormControlDropdown",props:lt({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=mt(t,"modelValue"),n=t,{entries:o}=Gf(X4),r=S(()=>o.value.length>0?o.value:n.options),i=bt("elementRef"),s=OR(i),a=bt("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`)}Ke(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=PV,g=Pm,v=Mn;return w(),Q(v,{ref_key:"elementRef",ref:i,class:Te(["form-control-dropdown",p(c)]),label:t.label,"label-for":t.id,size:t.size},{default:J(()=>{var y;return[Ce(h.$slots,"default",{},void 0,!0),H(g,{ref_key:"dropdownRef",ref:a,class:Te(["form-control-dropdown__toggle",p(u)]),size:t.size,"menu-class":t.menuClass??"form-control-dropdown-menu",text:((y=p(d))==null?void 0:y.label)??t.placeholder??"",disabled:t.disabled,"teleport-to":"body",variant:"outline-secondary","auto-close":t.autoClose,onShow:l,onShown:l},{"button-content":J(()=>[Ce(h.$slots,"button-content",{},()=>{var x,_;return[(x=p(d))!=null&&x.icon?(w(),R("span",DV,[(w(),Q(Rt(p(d).icon),{class:"form-control-dropdown__toggle__icon"})),He(" "+pe(p(d).label),1)])):(w(),R(Re,{key:1},[He(pe(((_=p(d))==null?void 0:_.label)??t.placeholder??""),1)],64))]},!0)]),default:J(()=>[Ce(h.$slots,"menu",{hide:()=>{var x;return(x=p(a))==null?void 0:x.hide()}},()=>[(w(!0),R(Re,null,vt(p(r),x=>(w(),Q(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"])}}}),Rn=Be(EV,[["__scopeId","data-v-5b435452"]]),IV={class:"form-control-button-group__container__buttons__visual bg-body rounded-1"},NV=["src"],RV=se({__name:"FormControlButtonGroup",props:lt({label:{},options:{default:()=>[]},block:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=mt(t,"modelValue"),n=t,{entries:o}=Gf(K4),r=S(()=>o.value.length>0?o.value:n.options),i=bt("containerRef"),s=Ne(!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 ps(i,u),(d,f)=>{const h=Rn,m=zn,b=_E,g=Mn;return w(),Q(g,{class:"form-control-button-group",label:t.label},{default:J(()=>[p(s)?(w(),Q(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"])):oe("",!0),A("div",{ref_key:"containerRef",ref:i,class:Te(["form-control-button-group__container",p(a)])},[H(b,{class:Te(["form-control-button-group__container__buttons",p(l)])},{default:J(()=>[(w(!0),R(Re,null,vt(p(r),v=>(w(),Q(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},$i({_:2},[v.visual?{name:"start",fn:J(()=>[A("div",IV,[typeof v.visual!="string"?(w(),Q(Rt(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,NV))])]),key:"0"}:void 0]),1032,["icon-left","label","hide-label","hide-tooltip","tooltip-label","show-tooltip-force","variant","tabindex","onClick"]))),128))]),_:1},8,["class"])],2),Ce(d.$slots,"default",{},void 0,!0),Ce(d.$slots,`section:${e.value}`,{},void 0,!0)]),_:3},8,["label"])}}}),$n=Be(RV,[["__scopeId","data-v-dfd21712"]]),wh=se({__name:"FormControlButtonGroupEntry",props:{value:{},text:{},iconLeft:{},description:{},visual:{},icon:{}},setup(t){const e=t,n=bs(),o=n["icon-left"]?Oe(se({render:()=>n["icon-left"]()})):void 0;return j4(K4,()=>({value:e.value,text:e.text,iconLeft:e.iconLeft??o,description:e.description,visual:e.visual,icon:e.icon})),(r,i)=>Ce(r.$slots,"default")}}),FV={class:"form-control-slider-input__row"},VV={key:0,class:"form-control-slider-input__row__suffix"},zV=se({__name:"FormControlSliderInput",props:lt({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=mt(t,"modelValue");return(n,o)=>{const r=da,i=Mn;return w(),Q(i,{class:"form-control-slider-input",label:t.label,"label-for":t.id},{default:J(()=>[A("div",FV,[H(r,{id:t.id,type:"range","model-value":e.value,min:t.min,max:t.max,step:t.step,class:"form-control-slider-input__row__range","onUpdate:modelValue":o[0]||(o[0]=s=>e.value=String(s))},null,8,["id","model-value","min","max","step"]),H(r,{"model-value":e.value,class:"form-control-slider-input__row__number",size:"sm","onUpdate:modelValue":o[1]||(o[1]=s=>e.value=String(s))},null,8,["model-value"]),Ce(n.$slots,"suffix",{},()=>[t.suffix?(w(),R("small",VV,pe(t.suffix),1)):oe("",!0)],!0)])]),_:3},8,["label","label-for"])}}}),Cr=Be(zV,[["__scopeId","data-v-23b8b888"]]),HV={class:"form-control-units-input__row"},WV={class:"form-control-units-input__row__group"},UV=se({__name:"FormControlUnitsInput",props:lt({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=mt(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=da,f=m4,h=Pm,m=Mn;return w(),Q(m,{class:"form-control-units-input",label:t.label,"label-for":t.id},{default:J(()=>[A("div",HV,[t.noSlider?oe("",!0):(w(),Q(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"])),A("div",WV,[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:J(()=>[(w(!0),R(Re,null,vt(t.units,b=>(w(),Q(f,{key:b,active:b===p(i),onClick:g=>l(b)},{default:J(()=>[He(pe(b),1)]),_:2},1032,["active","onClick"]))),128))]),_:1},8,["text"])])])]),_:1},8,["label","label-for"])}}}),hp=Be(UV,[["__scopeId","data-v-21f940c0"]]),$c=se({__name:"FormControlDropdownEntry",props:{value:{},label:{},description:{},visual:{},icon:{}},setup(t){const e=t,n=bs(),o=n.icon?Oe(se({render:()=>n.icon()})):void 0;return j4(X4,()=>({value:e.value,label:e.label,description:e.description,visual:e.visual,icon:e.icon??o})),(r,i)=>Ce(r.$slots,"default")}}),GV={class:"form-control-text-input__row"},qV={key:0,class:"form-control-text-input__row__suffix"},YV=se({__name:"FormControlTextInput",props:lt({label:{},id:{},placeholder:{default:void 0},suffix:{default:void 0}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=mt(t,"modelValue");return(n,o)=>{const r=da,i=Mn;return w(),Q(i,{class:"form-control-text-input",label:t.label,"label-for":t.id},{default:J(()=>[A("div",GV,[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",qV,pe(t.suffix),1)):oe("",!0)])]),_:1},8,["label","label-for"])}}}),zm=Be(YV,[["__scopeId","data-v-f856cd26"]]),jV={class:"display-palette"},KV=se({__name:"DisplayPalette",props:{colors:{},bordered:{type:Boolean}},setup(t){return(e,n)=>{const o=Vm;return w(),R("span",jV,[(w(!0),R(Re,null,vt(t.colors,(r,i)=>(w(),Q(o,{key:i,color:r,bordered:t.bordered,size:"sm"},null,8,["color","bordered"]))),128))])}}}),XV=Be(KV,[["__scopeId","data-v-329d58de"]]),ZV={class:"form-control-palette__preview pe-1"},QV={class:"form-control-palette__preview__name flex-grow-1"},JV={class:"form-control-palette__item"},ez={class:"flex-grow-1"},tz=se({__name:"FormControlPalette",props:lt({label:{default:void 0},id:{default:void 0},palettes:{default:()=>[]}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=mt(t,"modelValue"),n=t,{entries:o}=Gf(VR),r=S(()=>o.value.length>0?o.value:n.palettes),i=bt("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=XV,f=g4,h=Pm,m=Mn;return w(),Q(m,{class:"form-control-palette",label:t.label,"label-for":t.id},{default:J(()=>[Ce(c.$slots,"default",{},void 0,!0),H(h,{ref_key:"dropdownRef",ref:i,class:"form-control-palette__toggle","toggle-class":"d-flex align-items-center","menu-class":["form-control-dropdown-menu"],variant:"outline-secondary","teleport-to":"body",onShown:s},{"button-content":J(()=>{var b;return[A("span",ZV,[A("span",QV,pe(((b=p(a))==null?void 0:b.label)??""),1),p(a)?(w(),Q(d,{key:0,colors:p(a).colors,bordered:""},null,8,["colors"])):oe("",!0)])]}),default:J(()=>[(w(!0),R(Re,null,vt(p(r),b=>(w(),Q(f,{key:b.value,active:e.value===b.value,onClick:g=>l(b.value)},{default:J(()=>[A("span",JV,[A("span",ez,pe(b.label),1),H(d,{colors:b.colors,bordered:""},null,8,["colors"])])]),_:2},1032,["active","onClick"]))),128))]),_:1},512)]),_:3},8,["label","label-for"])}}}),nz=Be(tz,[["__scopeId","data-v-98c9538c"]]);function oz(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Qp(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 gu(t){return t=Qp(Math.abs(t)),t?t[1]:NaN}function rz(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 iz(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var sz=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Jp(t){if(!(e=sz.exec(t)))throw new Error("invalid format: "+t);var e;return new a2({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]})}Jp.prototype=a2.prototype;function a2(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+""}a2.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 az(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 e0;function lz(t,e){var n=Qp(t,e);if(!n)return e0=void 0,t.toPrecision(e);var o=n[0],r=n[1],i=r-(e0=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")+Qp(t,Math.max(0,e+i-1))[0]}function b8(t,e){var n=Qp(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 y8={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:oz,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)=>b8(t*100,e),r:b8,s:lz,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function x8(t){return t}var w8=Array.prototype.map,_8=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function cz(t){var e=t.grouping===void 0||t.thousands===void 0?x8:rz(w8.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?x8:iz(w8.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=Jp(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,D=d.type;D==="n"?(x=!0,D="g"):y8[D]||(_===void 0&&(_=12),C=!0,D="g"),(v||h==="0"&&m==="=")&&(v=!0,h="0",m="=");var M=(f&&f.prefix!==void 0?f.prefix:"")+(g==="$"?n:g==="#"&&/[boxX]/.test(D)?"0"+D.toLowerCase():""),$=(g==="$"?o:/[%p]/.test(D)?s:"")+(f&&f.suffix!==void 0?f.suffix:""),L=y8[D],E=/[defgprs%]/.test(D);_=_===void 0?6:/[gprs]/.test(D)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function N(T){var O=M,P=$,B,V,z;if(D==="c")P=L(T)+P,T="";else{T=+T;var G=T<0||1/T<0;if(T=isNaN(T)?l:L(Math.abs(T),_),C&&(T=az(T)),G&&+T==0&&b!=="+"&&(G=!1),O=(G?b==="("?b:a:b==="-"||b==="("?"":b)+O,P=(D==="s"&&!isNaN(T)&&e0!==void 0?_8[8+e0/3]:"")+P+(G&&b==="("?")":""),E){for(B=-1,V=T.length;++B<V;)if(z=T.charCodeAt(B),48>z||z>57){P=(z===46?r+T.slice(B+1):T.slice(B))+P,T=T.slice(0,B);break}}}x&&!v&&(T=e(T,1/0));var K=O.length+T.length+P.length,ne=K<y?new Array(y-K+1).join(h):"";switch(x&&v&&(T=e(ne+T,ne.length?y-P.length:1/0),ne=""),m){case"<":T=O+T+P+ne;break;case"=":T=O+ne+T+P;break;case"^":T=ne.slice(0,K=ne.length>>1)+O+T+P+ne.slice(K);break;default:T=ne+O+T+P;break}return i(T)}return N.toString=function(){return d+""},N}function u(d,f){var h=Math.max(-8,Math.min(8,Math.floor(gu(f)/3)))*3,m=Math.pow(10,-h),b=c((d=Jp(d),d.type="f",d),{suffix:_8[8+h/3]});return function(g){return b(m*g)}}return{format:c,formatPrefix:u}}var _h,Iu,lA;uz({thousands:",",grouping:[3],currency:["$",""]});function uz(t){return _h=cz(t),Iu=_h.format,lA=_h.formatPrefix,_h}function dz(t){return Math.max(0,-gu(Math.abs(t)))}function fz(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(gu(e)/3)))*3-gu(Math.abs(t)))}function hz(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,gu(e)-gu(t))+1}const cA={prefix:"",suffix:"",decimals:"2",scale:"none",negStyle:"minus",thousandsSep:!0};function l2(t){let e="";return t.negStyle==="paren"&&(e+="("),t.thousandsSep&&(e+=","),t.decimals==="auto"?e+="~":e+=`.${t.decimals}`,e+=t.scale==="%"?"%":"f",e}function Av(t){const e=l2(t);return t.prefix||t.suffix?`${t.prefix}|${e}|${t.suffix}`:e}function pz(t){const e={...cA};if(!t)return e;let n=t;if(t.includes("|")){const o=t.split("|");e.prefix=o[0]??"",n=o[1]??"",e.suffix=o[2]??""}else e.prefix="",e.suffix="";if(n.startsWith("(")&&(e.negStyle="paren",n=n.slice(1),n.endsWith(")")&&(n=n.slice(0,-1))),e.thousandsSep=n.includes(","),n=n.replace(",",""),n.includes("~"))e.decimals="auto";else{const o=n.match(/\.(\d+)/);o&&(e.decimals=o[1])}return n.endsWith("%")?e.scale="%":e.scale="none",e}function mz(t,e){try{const n=l2(e),o=Iu(n)(Math.abs(t)),r=`${e.prefix}${o}${e.suffix}`;return t<0?e.negStyle==="paren"?`(${r})`:`−${r}`:r}catch{return String(t)}}const gz={class:"form-control-number-format__popover"},vz={class:"form-control-number-format__popover__preview"},bz={class:"form-control-number-format__popover__preview__cell__label"},yz={class:"form-control-number-format__popover__body"},xz={class:"form-control-number-format__popover__body__chips"},wz=["onClick"],_z={class:"form-control-number-format__popover__body__grid-2"},kz={class:"form-control-number-format__popover__body__btn-group"},Sz=["onClick"],Cz={class:"form-control-number-format__popover__body__btn-group"},Az=["onClick"],$z={class:"form-control-number-format__popover__body__check-row"},Tz={class:"form-control-number-format__popover__body__d3-row"},Oz={class:"form-control-number-format__popover__body__d3-row__value"},Mz=se({__name:"FormControlNumberFormat",props:lt({label:{default:void 0},id:{default:void 0},block:{type:Boolean,default:!0}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=mt(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=po({...cA}),a=Ne(null);Ke(()=>e.value,g=>{g!==Av(s)&&Object.assign(s,pz(g??""))},{immediate:!0});const l=S(()=>l2(s)),c=S(()=>e.value||"auto");function u(){a.value=null,e.value=Av(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=Av(s)}function m(g){return mz(g,s)}const b=S(()=>r.map(g=>({...g,formatted:m(g.value)})));return(g,v)=>{const y=Rn;return w(),Q(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":J(()=>[A("span",{class:Te(["form-control-number-format__trigger-text",{"text-secondary":!e.value}])},pe(p(c)),3)]),menu:J(()=>[A("div",gz,[A("div",vz,[(w(!0),R(Re,null,vt(p(b),(x,_)=>(w(),R("div",{key:_,class:"form-control-number-format__popover__preview__cell"},[A("div",bz,pe(x.label),1),A("div",{class:Te(["form-control-number-format__popover__preview__cell__value",x.cls])},pe(x.formatted),3)]))),128))]),A("div",yz,[A("div",null,[v[5]||(v[5]=A("div",{class:"form-control-number-format__popover__body__section-label"}," Presets ",-1)),A("div",xz,[(w(),R(Re,null,vt(i,x=>A("button",{key:x.label,class:Te(["form-control-number-format__popover__body__chips__chip",{"form-control-number-format__popover__body__chips__chip--active":p(a)===x.label}]),onClick:_=>h(x)},pe(x.label),11,wz)),64))])]),v[12]||(v[12]=A("hr",{class:"form-control-number-format__popover__body__sep"},null,-1)),A("div",_z,[A("div",null,[v[6]||(v[6]=A("div",{class:"form-control-number-format__popover__body__grid-2__field-label"}," Prefix ",-1)),Go(A("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),[[uf,p(s).prefix]])]),A("div",null,[v[7]||(v[7]=A("div",{class:"form-control-number-format__popover__body__grid-2__field-label"}," Suffix ",-1)),Go(A("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),[[uf,p(s).suffix]])])]),A("div",null,[v[8]||(v[8]=A("div",{class:"form-control-number-format__popover__body__section-label"}," Decimal places ",-1)),A("div",kz,[(w(),R(Re,null,vt(n,x=>A("button",{key:x,class:Te(["form-control-number-format__popover__body__btn-group__btn",{"form-control-number-format__popover__body__btn-group__btn--active":p(s).decimals===x}]),onClick:_=>d(x)},pe(x),11,Sz)),64))])]),A("div",null,[v[9]||(v[9]=A("div",{class:"form-control-number-format__popover__body__section-label"}," Negatives ",-1)),A("div",Cz,[(w(),R(Re,null,vt(o,x=>A("button",{key:x.id,class:Te(["form-control-number-format__popover__body__btn-group__btn",{"form-control-number-format__popover__body__btn-group__btn--active":p(s).negStyle===x.id}]),onClick:_=>f(x.id)},pe(x.label),11,Az)),64))])]),A("label",$z,[Go(A("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),[[_C,p(s).thousandsSep]]),v[10]||(v[10]=A("span",null,"Thousands separator",-1))]),v[13]||(v[13]=A("hr",{class:"form-control-number-format__popover__body__sep"},null,-1)),A("div",Tz,[v[11]||(v[11]=A("span",{class:"form-control-number-format__popover__body__d3-row__label"},"d3·fmt",-1)),A("span",Oz,pe(p(l)),1)])])])]),_:1},8,["id","modelValue","label","block"])}}}),Bz=Be(Mz,[["__scopeId","data-v-959c1f3d"]]),$v=new Date,Tv=new Date;function xs(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=>xs(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)=>($v.setTime(+i),Tv.setTime(+s),t($v),t(Tv),Math.floor(n($v,Tv))),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 Lz=1e3,c2=Lz*60,Pz=c2*60,mf=Pz*24,uA=mf*7,u2=xs(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*c2)/mf,t=>t.getDate()-1);u2.range;const d2=xs(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/mf,t=>t.getUTCDate()-1);d2.range;const Dz=xs(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/mf,t=>Math.floor(t/mf));Dz.range;function dc(t){return xs(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())*c2)/uA)}const dA=dc(0),t0=dc(1),Ez=dc(2),Iz=dc(3),vu=dc(4),Nz=dc(5),Rz=dc(6);dA.range;t0.range;Ez.range;Iz.range;vu.range;Nz.range;Rz.range;function fc(t){return xs(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)/uA)}const fA=fc(0),n0=fc(1),Fz=fc(2),Vz=fc(3),bu=fc(4),zz=fc(5),Hz=fc(6);fA.range;n0.range;Fz.range;Vz.range;bu.range;zz.range;Hz.range;const jl=xs(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());jl.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:xs(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)});jl.range;const Kl=xs(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());Kl.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:xs(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)});Kl.range;function pp(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Wz(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function hA(t){let e,n,o;t.length!==2?(e=pp,n=(a,l)=>pp(t(a),l),o=(a,l)=>t(a)-l):(e=t===pp||t===Wz?t:Uz,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 Uz(){return 0}function Gz(t){return t===null?NaN:+t}const qz=hA(pp),Yz=qz.right,jz=hA(Gz).center;class J1 extends Map{constructor(e,n=Zz){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(k8(this,e))}has(e){return super.has(k8(this,e))}set(e,n){return super.set(Kz(this,e),n)}delete(e){return super.delete(Xz(this,e))}}function k8({_intern:t,_key:e},n){const o=e(n);return t.has(o)?t.get(o):n}function Kz({_intern:t,_key:e},n){const o=e(n);return t.has(o)?t.get(o):(t.set(o,n),n)}function Xz({_intern:t,_key:e},n){const o=e(n);return t.has(o)&&(n=t.get(o),t.delete(o)),n}function Zz(t){return t!==null&&typeof t=="object"?t.valueOf():t}function Qz(t){return t}function pA(t,e,...n){return Jz(t,Qz,e,n)}function Jz(t,e,n,o){return(function r(i,s){if(s>=o.length)return n(i);const a=new J1,l=o[s++];let c=-1;for(const u of i){const d=l(u,++c,i),f=a.get(d);f?f.push(u):a.set(d,[u])}for(const[u,d]of a)a.set(u,r(d,s));return e(a)})(t,0)}const eH=Math.sqrt(50),tH=Math.sqrt(10),nH=Math.sqrt(2);function o0(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>=eH?10:i>=tH?5:i>=nH?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?o0(t,e,n*2):[a,l,c]}function oH(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?o0(e,t,n):o0(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 eb(t,e,n){return e=+e,t=+t,n=+n,o0(t,e,n)[2]}function rH(t,e,n){e=+e,t=+t,n=+n;const o=e<t,r=o?eb(e,t,n):eb(t,e,n);return(o?-1:1)*(r<0?1/-r:r)}function Xl(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 iH(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 mA(t,e){let n=0;if(e===void 0)for(let o of t)(o=+o)&&(n+=o);else{let o=-1;for(let r of t)(r=+e(r,++o,t))&&(n+=r)}return n}function Ov(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Mv(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 cd(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function sH(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=ud(r),u=dd(r),d=ud(i),f=dd(i),h=ud(s),m=dd(s),b=ud(a),g=dd(a),v=ud(l),y=dd(l),x={a:z,A:G,b:K,B:ne,c:null,d:O8,e:O8,f:OH,g:FH,G:zH,H:AH,I:$H,j:TH,L:gA,m:MH,M:BH,p:ae,q:he,Q:L8,s:P8,S:LH,u:PH,U:DH,V:EH,w:IH,W:NH,x:null,X:null,y:RH,Y:VH,Z:HH,"%":B8},_={a:ge,A:le,b:fe,B:we,c:null,d:M8,e:M8,f:qH,g:nW,G:rW,H:WH,I:UH,j:GH,L:bA,m:YH,M:jH,p:Z,q:be,Q:L8,s:P8,S:KH,u:XH,U:ZH,V:QH,w:JH,W:eW,x:null,X:null,y:tW,Y:oW,Z:iW,"%":B8},C={a:E,A:N,b:T,B:O,c:P,d:$8,e:$8,f:_H,g:A8,G:C8,H:T8,I:T8,j:bH,L:wH,m:vH,M:yH,p:L,q:gH,Q:SH,s:CH,S:xH,u:dH,U:fH,V:hH,w:uH,W:pH,x:B,X:V,y:A8,Y:C8,Z:mH,"%":kH};x.x=D(n,x),x.X=D(o,x),x.c=D(e,x),_.x=D(n,_),_.X=D(o,_),_.c=D(e,_);function D(re,ve){return function(ce){var I=[],U=-1,j=0,ee=re.length,ie,de,ke;for(ce instanceof Date||(ce=new Date(+ce));++U<ee;)re.charCodeAt(U)===37&&(I.push(re.slice(j,U)),(de=S8[ie=re.charAt(++U)])!=null?ie=re.charAt(++U):de=ie==="e"?" ":"0",(ke=ve[ie])&&(ie=ke(ce,de)),I.push(ie),j=U+1);return I.push(re.slice(j,U)),I.join("")}}function M(re,ve){return function(ce){var I=cd(1900,void 0,1),U=$(I,re,ce+="",0),j,ee;if(U!=ce.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=Mv(cd(I.y,0,1)),ee=j.getUTCDay(),j=ee>4||ee===0?n0.ceil(j):n0(j),j=d2.offset(j,(I.V-1)*7),I.y=j.getUTCFullYear(),I.m=j.getUTCMonth(),I.d=j.getUTCDate()+(I.w+6)%7):(j=Ov(cd(I.y,0,1)),ee=j.getDay(),j=ee>4||ee===0?t0.ceil(j):t0(j),j=u2.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),ee="Z"in I?Mv(cd(I.y,0,1)).getUTCDay():Ov(cd(I.y,0,1)).getDay(),I.m=0,I.d="W"in I?(I.w+6)%7+I.W*7-(ee+5)%7:I.w+I.U*7-(ee+6)%7);return"Z"in I?(I.H+=I.Z/100|0,I.M+=I.Z%100,Mv(I)):Ov(I)}}function $(re,ve,ce,I){for(var U=0,j=ve.length,ee=ce.length,ie,de;U<j;){if(I>=ee)return-1;if(ie=ve.charCodeAt(U++),ie===37){if(ie=ve.charAt(U++),de=C[ie in S8?ve.charAt(U++):ie],!de||(I=de(re,ce,I))<0)return-1}else if(ie!=ce.charCodeAt(I++))return-1}return I}function L(re,ve,ce){var I=c.exec(ve.slice(ce));return I?(re.p=u.get(I[0].toLowerCase()),ce+I[0].length):-1}function E(re,ve,ce){var I=h.exec(ve.slice(ce));return I?(re.w=m.get(I[0].toLowerCase()),ce+I[0].length):-1}function N(re,ve,ce){var I=d.exec(ve.slice(ce));return I?(re.w=f.get(I[0].toLowerCase()),ce+I[0].length):-1}function T(re,ve,ce){var I=v.exec(ve.slice(ce));return I?(re.m=y.get(I[0].toLowerCase()),ce+I[0].length):-1}function O(re,ve,ce){var I=b.exec(ve.slice(ce));return I?(re.m=g.get(I[0].toLowerCase()),ce+I[0].length):-1}function P(re,ve,ce){return $(re,e,ve,ce)}function B(re,ve,ce){return $(re,n,ve,ce)}function V(re,ve,ce){return $(re,o,ve,ce)}function z(re){return s[re.getDay()]}function G(re){return i[re.getDay()]}function K(re){return l[re.getMonth()]}function ne(re){return a[re.getMonth()]}function ae(re){return r[+(re.getHours()>=12)]}function he(re){return 1+~~(re.getMonth()/3)}function ge(re){return s[re.getUTCDay()]}function le(re){return i[re.getUTCDay()]}function fe(re){return l[re.getUTCMonth()]}function we(re){return a[re.getUTCMonth()]}function Z(re){return r[+(re.getUTCHours()>=12)]}function be(re){return 1+~~(re.getUTCMonth()/3)}return{format:function(re){var ve=D(re+="",x);return ve.toString=function(){return re},ve},parse:function(re){var ve=M(re+="",!1);return ve.toString=function(){return re},ve},utcFormat:function(re){var ve=D(re+="",_);return ve.toString=function(){return re},ve},utcParse:function(re){var ve=M(re+="",!0);return ve.toString=function(){return re},ve}}}var S8={"-":"",_:" ",0:"0"},ro=/^\s*\d+/,aH=/^%/,lH=/[\\^$*+?|[\]().{}]/g;function Yt(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 cH(t){return t.replace(lH,"\\$&")}function ud(t){return new RegExp("^(?:"+t.map(cH).join("|")+")","i")}function dd(t){return new Map(t.map((e,n)=>[e.toLowerCase(),n]))}function uH(t,e,n){var o=ro.exec(e.slice(n,n+1));return o?(t.w=+o[0],n+o[0].length):-1}function dH(t,e,n){var o=ro.exec(e.slice(n,n+1));return o?(t.u=+o[0],n+o[0].length):-1}function fH(t,e,n){var o=ro.exec(e.slice(n,n+2));return o?(t.U=+o[0],n+o[0].length):-1}function hH(t,e,n){var o=ro.exec(e.slice(n,n+2));return o?(t.V=+o[0],n+o[0].length):-1}function pH(t,e,n){var o=ro.exec(e.slice(n,n+2));return o?(t.W=+o[0],n+o[0].length):-1}function C8(t,e,n){var o=ro.exec(e.slice(n,n+4));return o?(t.y=+o[0],n+o[0].length):-1}function A8(t,e,n){var o=ro.exec(e.slice(n,n+2));return o?(t.y=+o[0]+(+o[0]>68?1900:2e3),n+o[0].length):-1}function mH(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 gH(t,e,n){var o=ro.exec(e.slice(n,n+1));return o?(t.q=o[0]*3-3,n+o[0].length):-1}function vH(t,e,n){var o=ro.exec(e.slice(n,n+2));return o?(t.m=o[0]-1,n+o[0].length):-1}function $8(t,e,n){var o=ro.exec(e.slice(n,n+2));return o?(t.d=+o[0],n+o[0].length):-1}function bH(t,e,n){var o=ro.exec(e.slice(n,n+3));return o?(t.m=0,t.d=+o[0],n+o[0].length):-1}function T8(t,e,n){var o=ro.exec(e.slice(n,n+2));return o?(t.H=+o[0],n+o[0].length):-1}function yH(t,e,n){var o=ro.exec(e.slice(n,n+2));return o?(t.M=+o[0],n+o[0].length):-1}function xH(t,e,n){var o=ro.exec(e.slice(n,n+2));return o?(t.S=+o[0],n+o[0].length):-1}function wH(t,e,n){var o=ro.exec(e.slice(n,n+3));return o?(t.L=+o[0],n+o[0].length):-1}function _H(t,e,n){var o=ro.exec(e.slice(n,n+6));return o?(t.L=Math.floor(o[0]/1e3),n+o[0].length):-1}function kH(t,e,n){var o=aH.exec(e.slice(n,n+1));return o?n+o[0].length:-1}function SH(t,e,n){var o=ro.exec(e.slice(n));return o?(t.Q=+o[0],n+o[0].length):-1}function CH(t,e,n){var o=ro.exec(e.slice(n));return o?(t.s=+o[0],n+o[0].length):-1}function O8(t,e){return Yt(t.getDate(),e,2)}function AH(t,e){return Yt(t.getHours(),e,2)}function $H(t,e){return Yt(t.getHours()%12||12,e,2)}function TH(t,e){return Yt(1+u2.count(jl(t),t),e,3)}function gA(t,e){return Yt(t.getMilliseconds(),e,3)}function OH(t,e){return gA(t,e)+"000"}function MH(t,e){return Yt(t.getMonth()+1,e,2)}function BH(t,e){return Yt(t.getMinutes(),e,2)}function LH(t,e){return Yt(t.getSeconds(),e,2)}function PH(t){var e=t.getDay();return e===0?7:e}function DH(t,e){return Yt(dA.count(jl(t)-1,t),e,2)}function vA(t){var e=t.getDay();return e>=4||e===0?vu(t):vu.ceil(t)}function EH(t,e){return t=vA(t),Yt(vu.count(jl(t),t)+(jl(t).getDay()===4),e,2)}function IH(t){return t.getDay()}function NH(t,e){return Yt(t0.count(jl(t)-1,t),e,2)}function RH(t,e){return Yt(t.getFullYear()%100,e,2)}function FH(t,e){return t=vA(t),Yt(t.getFullYear()%100,e,2)}function VH(t,e){return Yt(t.getFullYear()%1e4,e,4)}function zH(t,e){var n=t.getDay();return t=n>=4||n===0?vu(t):vu.ceil(t),Yt(t.getFullYear()%1e4,e,4)}function HH(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Yt(e/60|0,"0",2)+Yt(e%60,"0",2)}function M8(t,e){return Yt(t.getUTCDate(),e,2)}function WH(t,e){return Yt(t.getUTCHours(),e,2)}function UH(t,e){return Yt(t.getUTCHours()%12||12,e,2)}function GH(t,e){return Yt(1+d2.count(Kl(t),t),e,3)}function bA(t,e){return Yt(t.getUTCMilliseconds(),e,3)}function qH(t,e){return bA(t,e)+"000"}function YH(t,e){return Yt(t.getUTCMonth()+1,e,2)}function jH(t,e){return Yt(t.getUTCMinutes(),e,2)}function KH(t,e){return Yt(t.getUTCSeconds(),e,2)}function XH(t){var e=t.getUTCDay();return e===0?7:e}function ZH(t,e){return Yt(fA.count(Kl(t)-1,t),e,2)}function yA(t){var e=t.getUTCDay();return e>=4||e===0?bu(t):bu.ceil(t)}function QH(t,e){return t=yA(t),Yt(bu.count(Kl(t),t)+(Kl(t).getUTCDay()===4),e,2)}function JH(t){return t.getUTCDay()}function eW(t,e){return Yt(n0.count(Kl(t)-1,t),e,2)}function tW(t,e){return Yt(t.getUTCFullYear()%100,e,2)}function nW(t,e){return t=yA(t),Yt(t.getUTCFullYear()%100,e,2)}function oW(t,e){return Yt(t.getUTCFullYear()%1e4,e,4)}function rW(t,e){var n=t.getUTCDay();return t=n>=4||n===0?bu(t):bu.ceil(t),Yt(t.getUTCFullYear()%1e4,e,4)}function iW(){return"+0000"}function B8(){return"%"}function L8(t){return+t}function P8(t){return Math.floor(+t/1e3)}var Tc,gf;sW({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 sW(t){return Tc=sH(t),gf=Tc.format,Tc.parse,Tc.utcFormat,Tc.utcParse,Tc}const qf=[{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)"}],xA=[new Date(2015,0,1),new Date(2016,0,1),new Date(2017,0,1)];function wA(t,e){if(t.includes("%q")){const n=Math.floor(e.getMonth()/3)+1;return gf(t.replace("%q",String(n)))(e)}return gf(t)(e)}function D8(t){if(t==="(automatic)")return"auto — adapts to data";if(t==="(custom)")return null;const e=qf.find(n=>n.fmt===t);return e!=null&&e.d3?xA.map(n=>wA(e.d3,n)).join(" · "):null}function aW(t){if(t==="(automatic)")return"";const e=qf.find(n=>n.fmt===t);return(e==null?void 0:e.d3)??""}function lW(t){if(!t)return"";try{return xA.map(e=>wA(t,e)).join(" · ")}catch{return"(invalid format)"}}function cW(t,e,n){if(!t)return"(automatic)";if(e==="(custom)")return n||"(custom)";const o=qf.find(r=>r.d3===t);return(o==null?void 0:o.label)??t}function uW(t){if(!t)return{selectedPreset:"(automatic)",customStr:""};const e=qf.find(n=>n.d3===t);return e?{selectedPreset:e.fmt,customStr:""}:{selectedPreset:"(custom)",customStr:t}}const dW={class:"form-control-date-format__popover"},fW={class:"form-control-date-format__popover__list"},hW=["onClick"],pW={class:"form-control-date-format__popover__list__item__body"},mW={class:"form-control-date-format__popover__list__item__body__label"},gW={key:0,class:"form-control-date-format__popover__list__item__body__ticks"},vW={key:0,class:"form-control-date-format__popover__list__item__check"},bW={key:0,class:"form-control-date-format__popover__custom"},yW={class:"form-control-date-format__popover__custom__preview"},xW={class:"form-control-date-format__popover__custom__preview__value"},wW=se({__name:"FormControlDateFormat",props:lt({label:{default:void 0},id:{default:void 0},block:{type:Boolean,default:!0}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=mt(t,"modelValue"),n=Ne("(automatic)"),o=Ne(""),r=S(()=>lW(o.value)),i=S(()=>cW(e.value,n.value,o.value));function s(l,c){n.value=l,l!=="(custom)"&&(e.value=aW(l),c())}function a(){e.value=o.value}return Ke(()=>e.value,l=>{const c=uW(l);n.value=c.selectedPreset,o.value=c.customStr},{immediate:!0}),(l,c)=>{const u=Rn;return w(),Q(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":J(()=>[A("span",{class:Te(["form-control-date-format__trigger-text",{"text-secondary":!e.value}])},pe(p(i)),3)]),menu:J(({hide:d})=>[A("div",dW,[A("div",fW,[(w(!0),R(Re,null,vt(p(qf),f=>(w(),R("div",{key:f.fmt,class:Te(["form-control-date-format__popover__list__item",{"form-control-date-format__popover__list__item--active":p(n)===f.fmt}]),onClick:h=>s(f.fmt,d)},[A("div",pW,[A("div",mW,pe(f.label),1),p(D8)(f.fmt)?(w(),R("div",gW,pe(p(D8)(f.fmt)),1)):oe("",!0)]),p(n)===f.fmt?(w(),R("span",vW,"✓")):oe("",!0)],10,hW))),128))]),p(n)==="(custom)"?(w(),R("div",bW,[c[3]||(c[3]=A("div",{class:"form-control-date-format__popover__custom__section-label"}," Custom d3-time-format string ",-1)),Go(A("input",{"onUpdate:modelValue":c[0]||(c[0]=f=>Ze(o)?o.value=f:null),class:"form-control-date-format__popover__custom__input",placeholder:"e.g. %b %d, %Y",onInput:a},null,544),[[uf,p(o)]]),A("div",yW,[c[2]||(c[2]=He(" Preview: ",-1)),A("span",xW,pe(p(o)?p(r):"—"),1)])])):oe("",!0)])]),_:1},8,["id","modelValue","label","block"])}}}),_W=Be(wW,[["__scopeId","data-v-710c73d8"]]),kW={class:"display-date"},SW=se({__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",kW,pe(p(n)),1))}}),CW=Be(SW,[["__scopeId","data-v-7da39ad7"]]),AW={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function $W(t,e){return w(),R("svg",AW,[...e[0]||(e[0]=[A("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 tb=Oe({name:"ph-info",render:$W}),TW={class:"display-contrast-badge__ratio"},OW=se({__name:"DisplayContrastBadge",props:{level:{},ratio:{}},setup(t){const e=t,n=bt("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:Te(["display-contrast-badge",p(o)])},[He(pe(t.level)+" ",1),A("span",TW,pe(t.ratio),1),H(p(tb),{class:"display-contrast-badge__info"}),H(p(ff),{"teleport-to":"body",target:p(n),title:p(r),placement:"top"},null,8,["target","title"])],2))}}),E8=Be(OW,[["__scopeId","data-v-2ff89f6d"]]),MW={[ln.BarVertical]:"Columns",[ln.BarHorizontal]:"Bars",[ln.BarMulti]:"Grouped Columns",[ln.ColumnStacked]:"Stacked Columns",[ln.BarStacked]:"Stacked Bars",[ln.BarSplit]:"Split Bars",[ln.BarGrouped]:"Grouped Bars",[ln.Line]:"Line",[ln.LineMulti]:"Lines",[ln.Area]:"Area",[ln.AreaStacked]:"Areas",[ln.Donut]:"Donut",[ln.Pie]:"Pie"};function _A(t){return MW[t]??t}const BW={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function LW(t,e){return w(),R("svg",BW,[...e[0]||(e[0]=[A("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 Gs=Oe({name:"ph-chart-bar",render:LW}),PW={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function DW(t,e){return w(),R("svg",PW,[...e[0]||(e[0]=[A("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 _d=Oe({name:"ph-chart-bar-horizontal",render:DW}),EW={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function IW(t,e){return w(),R("svg",EW,[...e[0]||(e[0]=[A("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 kd=Oe({name:"ph-chart-line-up",render:IW}),NW={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function RW(t,e){return w(),R("svg",NW,[...e[0]||(e[0]=[A("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 kA=Oe({name:"ph-chart-pie-slice",render:RW}),FW={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function VW(t,e){return w(),R("svg",FW,[...e[0]||(e[0]=[A("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 zW=Oe({name:"ph-chart-donut",render:VW}),HW=se({__name:"DisplayChartTypeBadge",props:{chartType:{},theme:{default:"light"}},setup(t){const e=t,n=S(()=>_A(e.chartType)),o=S(()=>e.theme==="dark"?"dark":"light"),r={[ln.BarVertical]:Gs,[ln.BarHorizontal]:_d,[ln.BarMulti]:Gs,[ln.ColumnStacked]:Gs,[ln.BarStacked]:_d,[ln.BarSplit]:_d,[ln.BarGrouped]:_d,[ln.Line]:kd,[ln.LineMulti]:kd,[ln.Area]:kd,[ln.AreaStacked]:kd,[ln.Donut]:zW,[ln.Pie]:kA},i=S(()=>r[e.chartType]??Gs);return(s,a)=>(w(),Q(p(jy),{variant:p(o),pill:"",class:"display-chart-type-badge"},{default:J(()=>[(w(),Q(Rt(p(i)),{class:"display-chart-type-badge__icon"})),He(" "+pe(p(n)),1)]),_:1},8,["variant"]))}}),WW=Be(HW,[["__scopeId","data-v-cb8f5582"]]),UW={class:"section-card"},GW={key:0,class:"section-card__label"},qW={key:1,class:"section-card__body"},YW=se({__name:"SectionCard",props:{label:{}},setup(t){return(e,n)=>(w(),R("div",UW,[t.label?(w(),R("div",GW,pe(t.label),1)):oe("",!0),Ce(e.$slots,"header",{},void 0,!0),e.$slots.default?(w(),R("div",qW,[Ce(e.$slots,"default",{},void 0,!0)])):oe("",!0)]))}}),Gd=Be(YW,[["__scopeId","data-v-804cd08f"]]),jW={},KW={class:"settings-section-description"};function XW(t,e){return w(),R("p",KW,[Ce(t.$slots,"default",{},void 0,!0)])}const ZW=Be(jW,[["render",XW],["__scopeId","data-v-9caa49e3"]]),QW={},JW={class:"settings-section-title"};function eU(t,e){return w(),R("h6",JW,[Ce(t.$slots,"default",{},void 0,!0)])}const tU=Be(QW,[["render",eU],["__scopeId","data-v-c5961a9d"]]),nU={class:"settings-section-icon"},oU=se({__name:"SettingsSectionIcon",props:{icon:{}},setup(t){return(e,n)=>{const o=wr;return w(),R("div",nU,[H(o,{name:t.icon},null,8,["name"])])}}}),rU=Be(oU,[["__scopeId","data-v-e8122360"]]),iU={class:"settings-section"},sU={class:"settings-section__header"},aU={class:"settings-section__header__text"},lU={key:1,class:"settings-section__body"},cU=se({__name:"SettingsSection",props:{title:{},icon:{default:void 0},description:{default:void 0}},setup(t){return(e,n)=>{const o=rU,r=tU,i=ZW;return w(),R("section",iU,[A("div",sU,[t.icon?(w(),Q(o,{key:0,icon:t.icon},null,8,["icon"])):oe("",!0),A("div",aU,[H(r,null,{default:J(()=>[He(pe(t.title),1)]),_:1})])]),e.$slots.description||t.description?(w(),Q(i,{key:0},{default:J(()=>[Ce(e.$slots,"description",{},()=>[He(pe(t.description),1)],!0)]),_:3})):oe("",!0),e.$slots.default?(w(),R("div",lU,[Ce(e.$slots,"default",{},void 0,!0)])):oe("",!0)])}}}),Uo=Be(cU,[["__scopeId","data-v-91596f42"]]),uU={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function dU(t,e){return w(),R("svg",uU,[...e[0]||(e[0]=[A("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 f2=Oe({name:"ph-x",render:dU}),fU=se({__name:"ButtonClose",emits:["click"],setup(t){return(e,n)=>{const o=zn;return w(),Q(o,{"icon-left":p(f2),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"])}}}),SA=Be(fU,[["__scopeId","data-v-d6bb5d7b"]]),hU={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function pU(t,e){return w(),R("svg",hU,[...e[0]||(e[0]=[A("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 mU=Oe({name:"ph-arrow-clockwise",render:pU}),gU=se({__name:"ButtonRedo",props:{disabled:{type:Boolean,default:!1}},emits:["click"],setup(t){return(e,n)=>{const o=zn;return w(),Q(o,{"icon-left":p(mU),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"])}}}),vU={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function bU(t,e){return w(),R("svg",vU,[...e[0]||(e[0]=[A("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 yU=Oe({name:"ph-arrow-counter-clockwise",render:bU}),xU=se({__name:"ButtonUndo",props:{disabled:{type:Boolean,default:!1}},emits:["click"],setup(t){return(e,n)=>{const o=zn;return w(),Q(o,{"icon-left":p(yU),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"])}}}),wU={class:"feedback-empty-state"},_U={class:"feedback-empty-state__message"},kU=se({__name:"FeedbackEmptyState",props:{message:{}},setup(t){return(e,n)=>(w(),R("div",wU,[A("p",_U,[Ce(e.$slots,"default",{},()=>[He(pe(t.message),1)],!0)])]))}}),SU=Be(kU,[["__scopeId","data-v-dab82b40"]]),CU=se({__name:"FeedbackSkeleton",props:{width:{default:"100%"},height:{default:"1rem"},radius:{default:"var(--bc-radius-sm)"},circle:{type:Boolean,default:!1},animated:{type:Boolean,default:!0}},setup(t){const e=t,n=S(()=>({width:e.width,height:e.height,borderRadius:e.circle?"50%":e.radius}));return(o,r)=>(w(),R("div",{class:Te(["feedback-skeleton",{"feedback-skeleton--animated":t.animated,"feedback-skeleton--circle":t.circle}]),style:Lt(p(n)),"aria-hidden":"true"},null,6))}}),Sd=Be(CU,[["__scopeId","data-v-89789f8b"]]),AU={key:0,class:"layout-bottom-drawer__header"},$U={class:"layout-bottom-drawer__header__title"},TU={class:"layout-bottom-drawer__body"},OU=80,MU=se({__name:"LayoutBottomDrawer",props:lt({title:{}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=mt(t,"modelValue"),n=Ne(0),o=Ne(!1),r=S(()=>({"layout-bottom-drawer--dragging":o.value}));let i=0,s=!1;function a(d){i=d.clientY,n.value=0,s=!1,document.addEventListener("pointermove",l),document.addEventListener("pointerup",c,{once:!0}),document.addEventListener("pointercancel",c,{once:!0})}function l(d){const f=d.clientY-i;!o.value&&Math.abs(f)>4&&(o.value=!0),o.value&&(s=!0,n.value=Math.max(0,f))}function c(){document.removeEventListener("pointermove",l),document.removeEventListener("pointercancel",c),o.value&&n.value>=OU?e.value=!1:s||(e.value=!1),n.value=0,o.value=!1}const u=S(()=>n.value>0?{transform:`translateY(${n.value}px)`}:{});return(d,f)=>(w(),R(Re,null,[H(Ul,{name:"drawer"},{default:J(()=>[e.value?(w(),R("div",{key:0,class:Te(["layout-bottom-drawer",p(r)]),style:Lt(p(u))},[A("div",{class:"layout-bottom-drawer__handle",onPointerdown:a},[...f[1]||(f[1]=[A("div",{class:"layout-bottom-drawer__handle__bar"},null,-1)])],32),t.title?(w(),R("div",AU,[A("h2",$U,pe(t.title),1)])):oe("",!0),A("div",TU,[Ce(d.$slots,"default",{},void 0,!0)])],6)):oe("",!0)]),_:3}),e.value?(w(),R("div",{key:0,class:"layout-bottom-drawer__backdrop",onClick:f[0]||(f[0]=h=>e.value=!1)})):oe("",!0)],64))}}),CA=Be(MU,[["__scopeId","data-v-6b9a0111"]]),BU={class:"layout-panel"},LU={class:"layout-panel__header"},PU={class:"layout-panel__header__title"},DU={key:0,class:"layout-panel__header__actions"},EU={key:0,class:"layout-panel__toolbar"},IU={class:"layout-panel__body"},NU={key:1,class:"layout-panel__footer"},RU=se({__name:"LayoutPanel",props:{title:{}},setup(t){return(e,n)=>(w(),R("div",BU,[A("div",LU,[A("h2",PU,pe(t.title),1),e.$slots.actions?(w(),R("div",DU,[Ce(e.$slots,"actions",{},void 0,!0)])):oe("",!0)]),e.$slots.toolbar?(w(),R("div",EU,[Ce(e.$slots,"toolbar",{},void 0,!0)])):oe("",!0),A("div",IU,[Ce(e.$slots,"default",{},void 0,!0)]),e.$slots.footer?(w(),R("div",NU,[Ce(e.$slots,"footer",{},void 0,!0)])):oe("",!0)]))}}),FU=Be(RU,[["__scopeId","data-v-5b00db3c"]]),VU=["aria-label"],zU=["disabled","aria-current","onClick"],HU={class:"navigation-segmented-control__option__label"},WU=se({__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:Te(["navigation-segmented-control",p(r)]),"aria-label":t.ariaLabel},[Ce(s.$slots,"default",{},void 0,!0),(w(!0),R(Re,null,vt(t.items,l=>(w(),R("button",{key:l.key,class:Te(["navigation-segmented-control__option",{"navigation-segmented-control__option--active":l.active,"navigation-segmented-control__option--disabled":l.disabled}]),disabled:l.disabled,"aria-current":l.active?"true":void 0,type:"button",onClick:c=>i(l)},[l.icon?(w(),Q(Rt(l.icon),{key:0,class:"navigation-segmented-control__option__icon"})):oe("",!0),A("span",HU,pe(l.text),1)],10,zU))),128))],10,VU))}}),AA=Be(WU,[["__scopeId","data-v-7aaaef48"]]),UU=["aria-selected","aria-disabled","tabindex","title","onClick","onKeydown"],GU={key:0,class:"navigation-stepper-tabs__step__icon","aria-hidden":"true"},qU={class:"navigation-stepper-tabs__step__label"},YU={key:0,class:"navigation-stepper-tabs__sep","aria-hidden":"true"},jU=se({__name:"NavigationStepperTabs",props:lt({steps:{},disabledSteps:{default:()=>[]},layout:{default:"inline"},separator:{type:Boolean,default:!0}},{currentStep:{required:!0},currentStepModifiers:{}}),emits:["update:currentStep"],setup(t){const e=t,n=mt(t,"currentStep");function o(l){return l<n.value?"done":l===n.value?"current":"pending"}function r(l){return e.disabledSteps.includes(l)}function i(l,c){return o(c)==="done"?n2:l.icon}function s(l){r(l)||(n.value=l)}function a(l,c){var b;const u=[];for(let g=0;g<e.steps.length;g++)r(g)||u.push(g);if(u.length===0)return;const d=u.indexOf(c);let f=null;switch(l.key){case"ArrowRight":f=u[(d+1)%u.length];break;case"ArrowLeft":f=u[(d-1+u.length)%u.length];break;case"Home":f=u[0];break;case"End":f=u[u.length-1];break;default:return}if(l.preventDefault(),f===null)return;const h=l.currentTarget.closest('[role="tablist"]');if(!h)return;(b=h.querySelectorAll('[role="tab"]')[f])==null||b.focus()}return(l,c)=>(w(),R("div",{class:Te(["navigation-stepper-tabs",`navigation-stepper-tabs--${t.layout}`]),role:"tablist","aria-label":"Progress"},[(w(!0),R(Re,null,vt(t.steps,(u,d)=>(w(),R(Re,{key:u.key??d},[A("button",{type:"button",role:"tab","aria-selected":d===n.value?"true":"false","aria-disabled":r(d)||void 0,tabindex:r(d)?-1:0,class:Te(["navigation-stepper-tabs__step",`navigation-stepper-tabs__step--${o(d)}`,{"navigation-stepper-tabs__step--disabled":r(d)}]),title:u.label,onClick:f=>s(d),onKeydown:f=>a(f,d)},[i(u,d)?(w(),R("span",GU,[(w(),Q(Rt(i(u,d))))])):oe("",!0),A("span",qU,pe(u.label),1)],42,UU),t.layout==="inline"&&t.separator&&d<t.steps.length-1?(w(),R("span",YU,"›")):oe("",!0)],64))),128))],2))}}),KU=Be(jU,[["__scopeId","data-v-3dbb5c62"]]),XU=se({__name:"NavigationToggle",props:lt({options:{default:()=>[]},size:{default:"md"}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=mt(t,"modelValue"),n=t,{entries:o}=Gf(HR),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(),Q(AA,{items:p(i),size:t.size,onSelect:s},{default:J(()=>[Ce(a.$slots,"default")]),_:3},8,["items","size"]))}}),ZU={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function QU(t,e){return w(),R("svg",ZU,[...e[0]||(e[0]=[A("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 h2=Oe({name:"ph-magnifying-glass",render:QU}),JU=["aria-label"],eG={key:0,class:"navigation-command-bar__placeholder"},tG={key:1,class:"navigation-command-bar__kbd"},nG=se({__name:"NavigationCommandBar",props:{placeholder:{},shortcutLabel:{},collapsed:{type:Boolean,default:!1}},emits:["click"],setup(t){return(e,n)=>(w(),R("button",{type:"button",class:Te(["navigation-command-bar",{"navigation-command-bar--collapsed":t.collapsed}]),"aria-label":t.placeholder,onClick:n[0]||(n[0]=o=>e.$emit("click"))},[H(p(h2),{class:"navigation-command-bar__icon","aria-hidden":"true"}),t.collapsed?oe("",!0):(w(),R("span",eG,pe(t.placeholder),1)),t.shortcutLabel&&!t.collapsed?(w(),R("span",tG,pe(t.shortcutLabel),1)):oe("",!0)],10,JU))}}),oG=Be(nG,[["__scopeId","data-v-7d89ac1b"]]),rG={class:"navigation-icon-rail"},iG={key:0,class:"navigation-icon-rail__footer"},sG=se({__name:"NavigationIconRail",props:lt({items:{default:()=>[]}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=mt(t,"modelValue"),n=t,{entries:o}=Gf(zR),r=S(()=>o.value.length>0?o.value:n.items);function i(s){return{"navigation-icon-rail__button--active":e.value===s}}return(s,a)=>{const l=zn;return w(),R("nav",rG,[Ce(s.$slots,"default",{},void 0,!0),(w(!0),R(Re,null,vt(p(r),c=>(w(),Q(l,{key:c.value,"icon-left":c.icon,label:c.tooltip,"tooltip-placement":"left","hide-label":"",square:"",size:"lg",variant:"link",class:Te(["navigation-icon-rail__button",i(c.value)]),"aria-pressed":e.value===c.value,onClick:u=>e.value=c.value},null,8,["icon-left","label","class","aria-pressed","onClick"]))),128)),a[0]||(a[0]=A("div",{class:"navigation-icon-rail__spacer"},null,-1)),s.$slots.footer?(w(),R("div",iG,[Ce(s.$slots,"footer",{},void 0,!0)])):oe("",!0)])}}}),aG=Be(sG,[["__scopeId","data-v-0286a414"]]),lG={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function cG(t,e){return w(),R("svg",lG,[...e[0]||(e[0]=[A("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 vf=Oe({name:"ph-arrow-square-out",render:cG}),uG=["aria-label"],dG={key:0,class:"navigation-sidebar__header"},fG={class:"navigation-sidebar__body"},hG=se({__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",dG,[Ce(e.$slots,"header",{},void 0,!0)])):oe("",!0),A("div",fG,[Ce(e.$slots,"default",{},void 0,!0)])],8,uG))}}),pG=Be(hG,[["__scopeId","data-v-007c1edf"]]),mG={class:"navigation-sidebar-group"},gG={key:0,class:"navigation-sidebar-group__eyebrow"},vG={class:"navigation-sidebar-group__items"},bG=se({__name:"NavigationSidebarGroup",props:{eyebrow:{}},setup(t){return(e,n)=>(w(),R("div",mG,[t.eyebrow?(w(),R("div",gG,pe(t.eyebrow),1)):oe("",!0),A("div",vG,[Ce(e.$slots,"default",{},void 0,!0)])]))}}),Bv=Be(bG,[["__scopeId","data-v-794922fc"]]),yG=["href"],xG={class:"navigation-sidebar-item__icon"},wG={class:"navigation-sidebar-item__label"},_G={class:"navigation-sidebar-item__external","aria-hidden":"true"},kG=["href","aria-current","onClick"],SG={class:"navigation-sidebar-item__icon"},CG={class:"navigation-sidebar-item__label"},AG={key:0,class:"navigation-sidebar-item__count"},$G=se({__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=wm("router-link");return p(n)?(w(),R("a",{key:0,href:t.href,class:Te(o(!1)),target:"_blank",rel:"noopener noreferrer"},[A("span",xG,[Ce(r.$slots,"icon",{},void 0,!0)]),A("span",wG,pe(t.label),1),A("span",_G,[H(p(vf))])],10,yG)):(w(),Q(s,{key:1,to:t.to,custom:""},{default:J(({navigate:a,href:l,isActive:c})=>[A("a",{href:l,class:Te(o(c)),"aria-current":c||t.active?"page":void 0,onClick:a},[A("span",SG,[Ce(r.$slots,"icon",{},void 0,!0)]),A("span",CG,pe(t.label),1),t.count!==void 0?(w(),R("span",AG,pe(t.count),1)):oe("",!0)],10,kG)]),_:3},8,["to"]))}}}),fd=Be($G,[["__scopeId","data-v-d6b18bde"]]),TG=["href","aria-label","onClick"],OG=["src","alt"],MG={key:1,class:"navigation-workspace-switcher__badge","aria-hidden":"true"},BG={key:2,class:"navigation-workspace-switcher__name"},LG=["aria-label"],PG=["src","alt"],DG={key:1,class:"navigation-workspace-switcher__badge","aria-hidden":"true"},EG={key:2,class:"navigation-workspace-switcher__name"},IG=se({__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=wm("router-link");return t.to?(w(),Q(i,{key:0,to:t.to,custom:""},{default:J(({navigate:s,href:a})=>[A("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,OG)):(w(),R("span",MG,pe(n.value),1)),t.hideName?oe("",!0):(w(),R("span",BG,pe(t.name),1))],8,TG)]),_: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,PG)):(w(),R("span",DG,pe(n.value),1)),t.hideName?oe("",!0):(w(),R("span",EG,pe(t.name),1))],8,LG))}}}),$A=Be(IG,[["__scopeId","data-v-c9a99b92"]]),NG={class:"list-item-row__label"},RG=se({__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:Te(["list-item-row",p(n)]),onClick:r[0]||(r[0]=i=>o.$emit("click",i))},[Ce(o.$slots,"leading",{},void 0,!0),A("span",NG,pe(t.label),1),Ce(o.$slots,"actions",{},void 0,!0)],2))}}),TA=Be(RG,[["__scopeId","data-v-51fbb4a2"]]),FG={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function VG(t,e){return w(),R("svg",FG,[...e[0]||(e[0]=[A("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 OA=Oe({name:"ph-trash",render:VG}),zG={class:"list-item-actions"},HG=se({__name:"ListItemActions",props:{actions:{default:()=>["duplicate","remove"]}},emits:["duplicate","remove"],setup(t){return(e,n)=>{const o=qo,r=wr;return w(),R("div",zG,[t.actions.includes("duplicate")?(w(),Q(o,{key:0,variant:"link",size:"sm",class:"list-item-actions__btn text-body-secondary",title:"Duplicate",onClick:n[0]||(n[0]=pn(i=>e.$emit("duplicate"),["stop"]))},{default:J(()=>[...n[2]||(n[2]=[A("span",{"aria-hidden":"true"},"⧉",-1)])]),_:1})):oe("",!0),t.actions.includes("remove")?(w(),Q(o,{key:1,variant:"link",size:"sm",class:"list-item-actions__btn text-danger",title:"Remove",onClick:n[1]||(n[1]=pn(i=>e.$emit("remove"),["stop"]))},{default:J(()=>[H(r,{name:p(OA)},null,8,["name"])]),_:1})):oe("",!0)])}}}),WG=Be(HG,[["__scopeId","data-v-29b731f9"]]),UG={class:"border rounded overflow-hidden bg-body-tertiary p-2"},GG={class:"d-flex gap-1 mb-2"},p2=se({__name:"ListSelectPanel",props:lt({items:{},maxHeight:{default:"220px"},onItemClick:{type:Function,default:void 0}},{selected:{required:!0},selectedModifiers:{}}),emits:["update:selected"],setup(t){const e=mt(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=TA;return w(),R("div",UG,[A("div",GG,[H(p(qo),{variant:"outline-secondary",size:"sm",onClick:i},{default:J(()=>[...c[0]||(c[0]=[He(" All ",-1)])]),_:1}),H(p(qo),{variant:"outline-secondary",size:"sm",onClick:s},{default:J(()=>[...c[1]||(c[1]=[He(" None ",-1)])]),_:1}),H(p(qo),{variant:"outline-secondary",size:"sm",onClick:a},{default:J(()=>[...c[2]||(c[2]=[He(" Invert ",-1)])]),_:1})]),A("div",{style:Lt({maxHeight:t.maxHeight,overflowY:"auto"})},[(w(!0),R(Re,null,vt(t.items,(d,f)=>(w(),Q(u,{key:d,label:d,active:e.value.includes(d),onClick:h=>o(d,f,h)},$i({_:2},[l.$slots["item-leading"]?{name:"leading",fn:J(()=>[Ce(l.$slots,"item-leading",{item:d,index:f})]),key:"0"}:void 0,l.$slots["item-actions"]?{name:"actions",fn:J(()=>[Ce(l.$slots,"item-actions",{item:d,index:f})]),key:"1"}:void 0]),1032,["label","active","onClick"]))),128))],4)])}}}),qG=["role","tabindex","aria-hidden","onKeydown"],YG=["data-bs-theme"],jG=["src"],KG={class:"gallery-card__meta"},XG={class:"gallery-card__meta__footer"},ZG={key:0,class:"gallery-card__meta__subtitle"},QG={key:1,class:"gallery-card__meta__footer"},JG=se({__name:"GalleryCard",props:{title:{},subtitle:{},thumbSrc:{},selected:{type:Boolean},layout:{},forceLightThumb:{type:Boolean},serifTitle:{type:Boolean},loading:{type:Boolean},thumbLoading:{type:Boolean}},emits:["click"],setup(t,{emit:e}){const n=t,o=e,r=S(()=>({"gallery-card--selected":n.selected,"gallery-card--row":n.layout==="row","gallery-card--loading":n.loading}));function i(){n.loading||o("click")}return(s,a)=>(w(),R("div",{class:Te(["gallery-card",p(r)]),role:t.loading?void 0:"button",tabindex:t.loading?-1:0,"aria-hidden":t.loading?"true":void 0,onClick:i,onKeydown:[ar(i,["enter"]),ar(pn(i,["prevent"]),["space"])]},[A("div",{class:"gallery-card__thumb","data-bs-theme":t.forceLightThumb?"light":void 0},[t.loading||t.thumbLoading&&!t.thumbSrc?(w(),Q(Sd,{key:0,class:"gallery-card__thumb__skeleton",width:"100%",height:"100%",radius:"0"})):t.thumbSrc?(w(),R("img",{key:1,src:t.thumbSrc,alt:"",class:"gallery-card__thumb__img"},null,8,jG)):oe("",!0),s.$slots.status&&!t.loading?(w(),R("div",{key:2,class:"gallery-card__thumb__status",onClick:a[0]||(a[0]=pn(()=>{},["stop"]))},[Ce(s.$slots,"status",{},void 0,!0)])):oe("",!0),s.$slots.actions&&!t.loading?(w(),R("div",{key:3,class:"gallery-card__thumb__actions",onClick:a[1]||(a[1]=pn(()=>{},["stop"]))},[Ce(s.$slots,"actions",{},void 0,!0)])):oe("",!0)],8,YG),A("div",KG,[t.loading?(w(),R(Re,{key:0},[H(Sd,{class:"gallery-card__skeleton-line",width:"70%",height:"0.9rem"}),H(Sd,{class:"gallery-card__skeleton-line",width:"45%",height:"0.7rem"}),A("div",XG,[H(Sd,{width:"30%",height:"0.7rem"})])],64)):(w(),R(Re,{key:1},[A("div",{class:Te(["gallery-card__meta__title",{"bc-display":t.serifTitle}])},pe(t.title),3),t.subtitle?(w(),R("div",ZG,pe(t.subtitle),1)):oe("",!0),s.$slots.footer?(w(),R("div",QG,[Ce(s.$slots,"footer",{},void 0,!0)])):oe("",!0)],64))])],42,qG))}}),MA=Be(JG,[["__scopeId","data-v-305b76ad"]]),eq=se({__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:Te(["gallery-grid",p(n)])},[Ce(o.$slots,"default",{},void 0,!0)],2))}}),tq=Be(eq,[["__scopeId","data-v-7c69b740"]]),nq={class:"scene-timeline-item__label"},oq=["innerHTML"],rq={key:1,class:"scene-timeline-item__name"},iq=se({__name:"SceneTimelineItem",props:{name:{},index:{},active:{type:Boolean,default:!1},thumbnail:{default:null},removable:{type:Boolean,default:!0}},emits:["select","remove"],setup(t){return(e,n)=>(w(),R("button",{class:Te(["scene-timeline-item",{"scene-timeline-item--active":t.active}]),type:"button",onClick:n[1]||(n[1]=o=>e.$emit("select"))},[t.removable?(w(),R("span",{key:0,class:"scene-timeline-item__remove",role:"button","aria-label":"Remove scene",onClick:n[0]||(n[0]=pn(o=>e.$emit("remove"),["stop"]))}," × ")):oe("",!0),A("span",nq,"Scene "+pe(t.index+1),1),A("span",{class:"scene-timeline-item__preview",innerHTML:t.thumbnail},null,8,oq),t.name?(w(),R("span",rq,pe(t.name),1)):oe("",!0)],2))}}),sq=Be(iq,[["__scopeId","data-v-e9323b3b"]]),aq={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function lq(t,e){return w(),R("svg",aq,[...e[0]||(e[0]=[A("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 cq=Oe({name:"ph-play-fill",render:lq}),uq={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function dq(t,e){return w(),R("svg",uq,[...e[0]||(e[0]=[A("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 fq=Oe({name:"ph-pause-fill",render:dq}),hq={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function pq(t,e){return w(),R("svg",hq,[...e[0]||(e[0]=[A("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 BA=Oe({name:"ph-caret-left",render:pq}),mq={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function gq(t,e){return w(),R("svg",mq,[...e[0]||(e[0]=[A("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 LA=Oe({name:"ph-caret-right",render:gq}),vq={class:"scene-timeline-controls"},bq=["disabled"],yq=["aria-label","disabled"],xq=["disabled"],wq={key:0,class:"scene-timeline-controls__counter"},_q=se({__name:"SceneTimelineControls",props:lt({total:{},playing:{type:Boolean,default:!1},hideCounter:{type:Boolean,default:!1}},{activeIndex:{default:-1},activeIndexModifiers:{}}),emits:lt(["play","pause"],["update:activeIndex"]),setup(t){const e=mt(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=wr;return w(),R("div",vq,[A("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(BA),size:"1em"},null,8,["name"])],8,bq),A("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(fq):p(cq),size:"1em"},null,8,["name"])],8,yq),A("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(LA),size:"1em"},null,8,["name"])],8,xq),!p(o)&&!t.hideCounter?(w(),R("span",wq,pe(p(r))+" / "+pe(t.total),1)):oe("",!0)])}}}),m2=Be(_q,[["__scopeId","data-v-469c0735"]]),kq={class:"scene-timeline__items"},Sq={class:"scene-timeline__items__add"},Cq=se({__name:"SceneTimeline",props:lt({scenes:{},playing:{type:Boolean,default:!1},floating:{type:Boolean,default:!1}},{activeIndex:{default:-1},activeIndexModifiers:{}}),emits:lt(["add","remove","play","pause"],["update:activeIndex"]),setup(t){const e=mt(t,"activeIndex");return(n,o)=>{const r=m2,i=sq,s=Rl;return w(),R("div",{class:Te(["scene-timeline",{"scene-timeline--floating":t.floating}])},[H(r,{"active-index":e.value,"onUpdate:activeIndex":o[0]||(o[0]=a=>e.value=a),total:t.scenes.length,playing:t.playing,onPlay:o[1]||(o[1]=a=>n.$emit("play")),onPause:o[2]||(o[2]=a=>n.$emit("pause"))},null,8,["active-index","total","playing"]),A("div",kq,[(w(!0),R(Re,null,vt(t.scenes,a=>(w(),Q(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)),A("div",Sq,[H(s,{onClick:o[3]||(o[3]=a=>n.$emit("add"))})])])],2)}}}),Aq=Be(Cq,[["__scopeId","data-v-a0977ad2"]]),$q={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Tq(t,e){return w(),R("svg",$q,[...e[0]||(e[0]=[A("path",{fill:"currentColor",d:"M213.66 165.66a8 8 0 0 1-11.32 0L128 91.31l-74.34 74.35a8 8 0 0 1-11.32-11.32l80-80a8 8 0 0 1 11.32 0l80 80a8 8 0 0 1 0 11.32"},null,-1)])])}const Oq=Oe({name:"ph-caret-up",render:Tq}),Mq={class:"scene-timeline-compact"},Bq=["title"],Lq={class:"scene-timeline-compact__counter"},Pq=se({__name:"SceneTimelineCompact",props:lt({scenes:{},playing:{type:Boolean,default:!1},expanded:{type:Boolean,default:!1}},{activeIndex:{default:-1},activeIndexModifiers:{}}),emits:lt(["play","pause","expand"],["update:activeIndex"]),setup(t){const e=mt(t,"activeIndex"),n=t,o=S(()=>e.value<0?null:n.scenes.find(a=>a.index===e.value)??null),r=S(()=>{var a;return((a=o.value)==null?void 0:a.name)||" "}),i=S(()=>n.scenes.length),s=S(()=>e.value<0||i.value===0?1:Math.max(1,Math.min(i.value,e.value+1)));return(a,l)=>(w(),R("div",Mq,[H(m2,{"active-index":e.value,"onUpdate:activeIndex":l[0]||(l[0]=c=>e.value=c),total:p(i),playing:t.playing,"hide-counter":"",onPlay:l[1]||(l[1]=c=>a.$emit("play")),onPause:l[2]||(l[2]=c=>a.$emit("pause"))},null,8,["active-index","total","playing"]),A("div",{class:"scene-timeline-compact__name",title:p(r)},pe(p(r)),9,Bq),A("div",Lq,pe(p(s))+" of "+pe(p(i)),1),H(zn,{class:"scene-timeline-compact__expand","icon-left":p(Oq),label:"Show scenes","hide-label":"",square:"",variant:"link",size:"sm","aria-expanded":t.expanded,onClick:l[3]||(l[3]=c=>a.$emit("expand"))},null,8,["icon-left","aria-expanded"])]))}}),Dq=Be(Pq,[["__scopeId","data-v-6874749a"]]),Eq=["aria-current"],Iq=["innerHTML"],Nq={key:1,class:"scene-list-item__thumb scene-list-item__thumb--empty","aria-hidden":"true"},Rq={class:"scene-list-item__body"},Fq={class:"scene-list-item__label"},Vq={key:0,class:"scene-list-item__name"},zq={key:1,class:"scene-list-item__hint"},Hq=se({__name:"SceneListItem",props:{index:{},name:{},thumbnail:{},hint:{},active:{type:Boolean,default:!1},removable:{type:Boolean,default:!0}},emits:["select","remove"],setup(t){return(e,n)=>(w(),R("li",{class:Te(["scene-list-item-row",{"scene-list-item-row--active":t.active}])},[A("button",{type:"button",class:Te(["scene-list-item",{"scene-list-item--active":t.active}]),"aria-current":t.active?"true":void 0,onClick:n[0]||(n[0]=o=>e.$emit("select"))},[t.thumbnail?(w(),R("span",{key:0,class:"scene-list-item__thumb",innerHTML:t.thumbnail},null,8,Iq)):(w(),R("span",Nq)),A("span",Rq,[A("span",Fq,"SCENE "+pe(t.index),1),t.name?(w(),R("span",Vq,pe(t.name),1)):oe("",!0),t.hint?(w(),R("span",zq,pe(t.hint),1)):oe("",!0)])],10,Eq),t.removable?(w(),R("button",{key:0,type:"button",class:"scene-list-item__remove","aria-label":"Remove scene",onClick:n[1]||(n[1]=pn(o=>e.$emit("remove"),["stop"]))},[H(p(f2))])):oe("",!0)],2))}}),Wq=Be(Hq,[["__scopeId","data-v-4d17a115"]]),Uq={class:"scene-list"},Gq={class:"scene-list__items",role:"list"},qq=se({__name:"SceneList",props:lt({scenes:{},playing:{type:Boolean,default:!1}},{activeIndex:{default:-1},activeIndexModifiers:{}}),emits:lt(["add","remove","play","pause"],["update:activeIndex"]),setup(t,{emit:e}){const n=mt(t,"activeIndex"),o=e;function r(s){n.value=s}function i(s){o("remove",s)}return(s,a)=>(w(),R("div",Uq,[H(m2,{"active-index":n.value,"onUpdate:activeIndex":a[0]||(a[0]=l=>n.value=l),total:t.scenes.length,playing:t.playing,onPlay:a[1]||(a[1]=l=>s.$emit("play")),onPause:a[2]||(a[2]=l=>s.$emit("pause"))},null,8,["active-index","total","playing"]),A("ul",Gq,[(w(!0),R(Re,null,vt(t.scenes,l=>(w(),Q(Wq,{key:l.index,index:l.index,name:l.name,thumbnail:l.thumbnail??null,hint:l.hint??null,active:l.index===n.value,removable:l.removable??!0,onSelect:c=>r(l.index),onRemove:c=>i(l.index)},null,8,["index","name","thumbnail","hint","active","removable","onSelect","onRemove"]))),128))]),A("button",{type:"button",class:"scene-list__add",onClick:a[3]||(a[3]=l=>s.$emit("add"))}," + Add scene ")]))}}),Yq=Be(qq,[["__scopeId","data-v-a9466f90"]]),jq={class:"bc-scene-player bc-scene-player--progress-bar","data-scene-player":""},Kq=["aria-label"],Xq={key:0,width:"10",height:"10",viewBox:"0 0 12 12",fill:"currentColor"},Zq={key:1,width:"10",height:"10",viewBox:"0 0 12 12",fill:"currentColor"},Qq={class:"bc-scene-player__segments"},Jq=["aria-label","aria-current","onClick"],eY={class:"bc-scene-player__counter"},tY=se({__name:"ScenePlayerProgressBar",props:lt({total:{},playing:{type:Boolean,default:!1},position:{default:"center"}},{current:{required:!0},currentModifiers:{}}),emits:lt(["play","pause"],["update:current"]),setup(t){const e=mt(t,"current");return(n,o)=>(w(),R("div",jq,[A("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",Xq,[...o[1]||(o[1]=[A("rect",{x:"1.5",y:"1",width:"3",height:"10",rx:"0.8"},null,-1),A("rect",{x:"7.5",y:"1",width:"3",height:"10",rx:"0.8"},null,-1)])])):(w(),R("svg",Zq,[...o[2]||(o[2]=[A("path",{d:"M2.5 1v10l8-5z"},null,-1)])]))],8,Kq),A("div",Qq,[(w(!0),R(Re,null,vt(t.total,r=>(w(),R("button",{key:r,type:"button",class:Te(["bc-scene-player__segments__segment",{"bc-scene-player__segments__segment--active":r===e.value,"bc-scene-player__segments__segment--completed":r<e.value}]),"aria-label":`Scene ${r} of ${t.total}`,"aria-current":r===e.value?"step":void 0,onClick:i=>e.value=r},null,10,Jq))),128))]),A("span",eY,pe(e.value)+"/"+pe(t.total),1)]))}}),PA=Be(tY,[["__scopeId","data-v-be507f24"]]),nY=["disabled"],oY=["aria-label"],rY={key:0,width:"11",height:"11",viewBox:"0 0 12 12",fill:"currentColor"},iY={key:1,width:"11",height:"11",viewBox:"0 0 12 12",fill:"currentColor"},sY={class:"bc-scene-player__dots"},aY=["aria-label","aria-current","onClick"],lY=["disabled"],cY=se({__name:"ScenePlayerDotStepper",props:lt({total:{},playing:{type:Boolean,default:!1},position:{default:"center"}},{current:{required:!0},currentModifiers:{}}),emits:lt(["play","pause","previous","next"],["update:current"]),setup(t){const e=mt(t,"current");return(n,o)=>(w(),R("div",{class:Te(["bc-scene-player bc-scene-player--dot-stepper",`bc-scene-player--${t.position}`]),"data-scene-player":""},[A("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]=[A("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round"},[A("path",{d:"M6.5 2L3.5 5l3 3"})],-1)])],8,nY),A("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",rY,[...o[4]||(o[4]=[A("rect",{x:"1.5",y:"1",width:"3",height:"10",rx:"0.8"},null,-1),A("rect",{x:"7.5",y:"1",width:"3",height:"10",rx:"0.8"},null,-1)])])):(w(),R("svg",iY,[...o[5]||(o[5]=[A("path",{d:"M2.5 1v10l8-5z"},null,-1)])]))],8,oY),A("div",sY,[(w(!0),R(Re,null,vt(t.total,r=>(w(),R("button",{key:r,type:"button",class:Te(["bc-scene-player__dots__dot",{"bc-scene-player__dots__dot--active":r===e.value,"bc-scene-player__dots__dot--completed":r<e.value}]),"aria-label":`Scene ${r} of ${t.total}`,"aria-current":r===e.value?"step":void 0,onClick:i=>e.value=r},null,10,aY))),128))]),A("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]=[A("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round"},[A("path",{d:"M3.5 2L6.5 5l-3 3"})],-1)])],8,lY)],2))}}),DA=Be(cY,[["__scopeId","data-v-3499fe9e"]]),uY={key:0,class:"bc-scene-player__counter"},dY=["disabled"],fY=["aria-label"],hY={key:0,width:"9",height:"9",viewBox:"0 0 12 12",fill:"currentColor"},pY={key:1,width:"9",height:"9",viewBox:"0 0 12 12",fill:"currentColor"},mY=["disabled"],gY={key:1,class:"bc-scene-player__counter bc-scene-player__counter--end"},vY=se({__name:"ScenePlayerMinimalArrows",props:lt({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:lt(["play","pause","previous","next"],["update:current"]),setup(t){const e=mt(t,"current");return(n,o)=>(w(),R("div",{class:Te(["bc-scene-player bc-scene-player--minimal-arrows",`bc-scene-player--${t.position}`]),"data-scene-player":""},[t.showCounter&&t.order==="counter-first"?(w(),R("span",uY,pe(e.value)+"/"+pe(t.total),1)):oe("",!0),A("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]=[A("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round"},[A("path",{d:"M6.5 2L3.5 5l3 3"})],-1)])],8,dY),A("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",hY,[...o[4]||(o[4]=[A("rect",{x:"1.5",y:"1",width:"3",height:"10",rx:"0.8"},null,-1),A("rect",{x:"7.5",y:"1",width:"3",height:"10",rx:"0.8"},null,-1)])])):(w(),R("svg",pY,[...o[5]||(o[5]=[A("path",{d:"M2.5 1v10l8-5z"},null,-1)])]))],8,fY),A("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]=[A("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round"},[A("path",{d:"M3.5 2L6.5 5l-3 3"})],-1)])],8,mY),t.showCounter&&t.order==="controls-first"?(w(),R("span",gY,pe(e.value)+"/"+pe(t.total),1)):oe("",!0)],2))}}),EA=Be(vY,[["__scopeId","data-v-74dd9698"]]),bY={class:"bc-scene-player__btn-group"},yY=["disabled"],xY=["disabled"],wY={class:"bc-scene-player__counter"},_Y=se({__name:"ScenePlayerButtons",props:lt({total:{},playing:{type:Boolean,default:!1},position:{default:"left"}},{current:{required:!0},currentModifiers:{}}),emits:lt(["play","pause","previous","next"],["update:current"]),setup(t){const e=mt(t,"current");return(n,o)=>(w(),R("div",{class:Te(["bc-scene-player bc-scene-player--buttons",`bc-scene-player--${t.position}`]),"data-scene-player":""},[A("div",bY,[A("button",{type:"button",class:Te(["bc-scene-player__btn-group__btn",{"bc-scene-player__btn-group__btn--disabled":e.value<=1}]),disabled:e.value<=1,"aria-label":"Previous scene",onClick:o[0]||(o[0]=pn(r=>n.$emit("previous"),["stop"]))},[...o[2]||(o[2]=[A("svg",{width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},[A("path",{d:"M5.5 1.5L1.5 6l4 4.5"})],-1),He(" Back ",-1)])],10,yY),A("button",{type:"button",class:Te(["bc-scene-player__btn-group__btn bc-scene-player__btn-group__btn--next",{"bc-scene-player__btn-group__btn--disabled":e.value>=t.total}]),disabled:e.value>=t.total,"aria-label":"Next scene",onClick:o[1]||(o[1]=pn(r=>n.$emit("next"),["stop"]))},[...o[3]||(o[3]=[He(" Next ",-1),A("svg",{width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},[A("path",{d:"M2.5 1.5L6.5 6l-4 4.5"})],-1)])],10,xY)]),A("span",wY,pe(e.value)+" / "+pe(t.total),1)],2))}}),nb=Be(_Y,[["__scopeId","data-v-9b2f8f87"]]),kY=Qn("theme",()=>{const t=Ne("light"),e=t2("(prefers-color-scheme: dark)"),n=S(()=>t.value==="dark"||t.value==="auto"&&e.value?"dark":"light");Ke(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 Yf(){const t=kY(),{theme:e,resolvedTheme:n}=Tt(t);return{theme:e,resolvedTheme:n,cycleTheme:t.cycleTheme}}function SY(){return typeof navigator>"u"?!1:/Mac|iPhone|iPod|iPad/i.test(navigator.platform)}function g2(t){const e=t.toUpperCase(),n=SY(),o=n?`⌘ ${e}`:`Ctrl ${e}`,r=n?`Meta+${e}`:`Control+${e}`;function i(a){return a.key.toLowerCase()!==t.toLowerCase()?!1:n?a.metaKey&&!a.ctrlKey:a.ctrlKey&&!a.metaKey}function s(){typeof document>"u"||document.dispatchEvent(new KeyboardEvent("keydown",{key:t,code:`Key${e}`,metaKey:n,ctrlKey:!n,bubbles:!0}))}return{keyLabel:o,keys:r,matches:i,trigger:s}}const CY={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function AY(t,e){return w(),R("svg",CY,[...e[0]||(e[0]=[A("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 $Y=Oe({name:"ph-sun",render:AY}),TY={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function OY(t,e){return w(),R("svg",TY,[...e[0]||(e[0]=[A("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 MY=Oe({name:"ph-moon",render:OY}),BY={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function LY(t,e){return w(),R("svg",BY,[...e[0]||(e[0]=[A("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 PY=Oe({name:"ph-circle-half",render:LY}),DY={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function EY(t,e){return w(),R("svg",DY,[...e[0]||(e[0]=[A("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 IA=Oe({name:"ph-list",render:EY}),NA="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",RA="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",IY={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function NY(t,e){return w(),R("svg",IY,[...e[0]||(e[0]=[A("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 Hm=Oe({name:"ph-squares-four",render:NY}),RY={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function FY(t,e){return w(),R("svg",RY,[...e[0]||(e[0]=[A("path",{fill:"currentColor",d:"M120 216a8 8 0 0 1-8 8H48a8 8 0 0 1-8-8V40a8 8 0 0 1 8-8h64a8 8 0 0 1 0 16H56v160h56a8 8 0 0 1 8 8m109.66-93.66l-40-40a8 8 0 0 0-11.32 11.32L204.69 120H112a8 8 0 0 0 0 16h92.69l-26.35 26.34a8 8 0 0 0 11.32 11.32l40-40a8 8 0 0 0 0-11.32"},null,-1)])])}const VY=Oe({name:"ph-sign-out",render:FY}),zY={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function HY(t,e){return w(),R("svg",zY,[...e[0]||(e[0]=[A("path",{fill:"currentColor",d:"m141.66 133.66l-40 40a8 8 0 0 1-11.32-11.32L116.69 136H24a8 8 0 0 1 0-16h92.69L90.34 93.66a8 8 0 0 1 11.32-11.32l40 40a8 8 0 0 1 0 11.32M200 32h-64a8 8 0 0 0 0 16h56v160h-56a8 8 0 0 0 0 16h64a8 8 0 0 0 8-8V40a8 8 0 0 0-8-8"},null,-1)])])}const WY=Oe({name:"ph-sign-in",render:HY}),UY=se({__name:"AccountAvatar",props:{email:{default:""},size:{default:"md"}},setup(t){const e=t,n=S(()=>e.email.trim().charAt(0).toUpperCase()||"?");return(o,r)=>(w(),R("span",{class:Te(["account-avatar",`account-avatar--${t.size}`]),"aria-hidden":"true"},pe(p(n)),3))}}),I8=Be(UY,[["__scopeId","data-v-4db22cc2"]]),GY={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function qY(t,e){return w(),R("svg",GY,[...e[0]||(e[0]=[A("path",{fill:"currentColor",d:"M178.34 165.66L160 147.31V208a8 8 0 0 1-16 0v-60.69l-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.32M160 40a88.08 88.08 0 0 0-78.71 48.68A64 64 0 1 0 72 216h40a8 8 0 0 0 0-16H72a48 48 0 0 1 0-96c1.1 0 2.2 0 3.29.12A88 88 0 0 0 72 128a8 8 0 0 0 16 0a72 72 0 1 1 100.8 66a8 8 0 0 0 3.2 15.34a7.9 7.9 0 0 0 3.2-.68A88 88 0 0 0 160 40"},null,-1)])])}const Wm=Oe({name:"ph-cloud-arrow-up",render:qY}),YY={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function jY(t,e){return w(),R("svg",YY,[...e[0]||(e[0]=[A("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 88m-8-80V80a8 8 0 0 1 16 0v56a8 8 0 0 1-16 0m20 36a12 12 0 1 1-12-12a12 12 0 0 1 12 12"},null,-1)])])}const KY=Oe({name:"ph-warning-circle",render:jY}),XY="modulepreload",ZY=function(t){return"/"+t},N8={},ob=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=ZY(c),c in N8)return;N8[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":XY,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)})},QY="/config.json".replace(/\/{2,}/g,"/"),JY=2e3;let r0=null,FA=!1;function ej(t,e){return typeof t=="string"&&t.length>0&&typeof e=="string"&&e.length>0?{url:t,anonKey:e}:null}async function tj(){const t=new AbortController,e=setTimeout(()=>t.abort(),JY);try{const n=await fetch(QY,{signal:t.signal,cache:"no-store"});return n.ok?await n.json():null}catch{return null}finally{clearTimeout(e)}}async function nj(t={url:void 0,anonKey:void 0}){let e=t.url,n=t.anonKey;const o=await tj();o&&(o.supabaseUrl!==void 0&&(e=o.supabaseUrl),o.supabaseAnonKey!==void 0&&(n=o.supabaseAnonKey));const r=window.__BC_CONFIG__;return r&&(r.supabaseUrl!==void 0&&(e=r.supabaseUrl),r.supabaseAnonKey!==void 0&&(n=r.supabaseAnonKey)),r0=ej(e,n),FA=!0,r0}function oj(){return r0}function ms(){return FA&&r0!==null}let kh=null;function zr(){return kh||(kh=(async()=>{const t=oj();if(!t)return null;const{createClient:e}=await ob(async()=>{const{createClient:n}=await import("./index-DkGlODiu.js");return{createClient:n}},[]);return e(t.url,t.anonKey,{auth:{flowType:"pkce",persistSession:!0,autoRefreshToken:!0,detectSessionInUrl:!1,storageKey:"blueprint-chart-auth"}})})(),kh)}var Ve=(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))(Ve||{}),di=(t=>(t.Left="left",t.Right="right",t))(di||{}),yu=(t=>(t.Linear="linear",t.Log="log",t))(yu||{}),Xn=(t=>(t.Solid="solid",t.Dashed="dashed",t.Dotted="dotted",t.None="none",t))(Xn||{}),an=(t=>(t.Auto="auto",t.Inside="inside",t.Outside="outside",t.Off="off",t))(an||{}),qd=(t=>(t.Auto="auto",t.Horizontal="horizontal",t.Vertical="vertical",t))(qd||{}),En=(t=>(t.NW="NW",t.N="N",t.NE="NE",t.E="E",t.SE="SE",t.S="S",t.SW="SW",t.W="W",t.Center="center",t))(En||{}),To=(t=>(t.Direct="direct",t.CurveLeft="curve-left",t.CurveRight="curve-right",t.Elbow="elbow",t))(To||{}),i0=(t=>(t.Solid="solid",t.Dotted="dotted",t.Dashed="dashed",t))(i0||{}),Ht=(t=>(t.Point="point",t.Range="range",t.Free="free",t))(Ht||{});const rj={point:"annotation",range:"range",free:"note"};var VA=(t=>(t.Hide="hide",t.Show="show",t))(VA||{}),zA=(t=>(t.Start="start",t.Center="center",t.End="end",t))(zA||{}),to=(t=>(t.Vertical="vertical",t.Horizontal="horizontal",t))(to||{}),yr=(t=>(t.Circle="circle",t.Square="square",t.Diamond="diamond",t.Triangle="triangle",t.TriangleDown="triangleDown",t.Cross="cross",t.Star="star",t))(yr||{}),_r=(t=>(t.All="all",t.First="first",t.Last="last",t.FirstLast="firstLast",t))(_r||{}),zo=(t=>(t.Filled="filled",t.Hollow="hollow",t))(zo||{}),en=(t=>(t.Ascending="ascending",t.Descending="descending",t.None="none",t))(en||{}),mi=(t=>(t.Total="total",t.WithinGroups="within-groups",t.None="none",t))(mi||{}),Rc=(t=>(t.Top="top",t.Bottom="bottom",t.Left="left",t.Right="right",t))(Rc||{}),qs=(t=>(t.Start="start",t.Middle="middle",t.End="end",t))(qs||{}),_t=(t=>(t.Inside="inside",t.Outside="outside",t.Auto="auto",t))(_t||{}),Oo=(t=>(t.Both="both",t.Vertical="vertical",t.Horizontal="horizontal",t))(Oo||{}),gi=(t=>(t.Solid="solid",t.Dashed="dashed",t.Dotted="dotted",t))(gi||{}),Fl=(t=>(t.Normal="normal",t.Percent="percent",t))(Fl||{}),Qe=(t=>(t.Colors="colors",t.Boolean="boolean",t.Select="select",t.Text="text",t.NumberFormat="numberFormat",t.DateFormat="dateFormat",t))(Qe||{}),Mo=(t=>(t.Off="",t.Auto="auto",t.Outside="outside",t.Inside="inside",t))(Mo||{}),ui=(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))(ui||{});function ij(t){return t}var mp=1,gp=2,rb=3,Cd=4,R8=1e-6;function sj(t){return"translate("+t+",0)"}function aj(t){return"translate(0,"+t+")"}function lj(t){return e=>+t(e)}function cj(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function uj(){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===mp||t===Cd?-1:1,u=t===Cd||t===gp?"x":"y",d=t===mp||t===rb?sj:aj;function f(h){var m=o??(e.ticks?e.ticks.apply(e,n):e.domain()),b=r??(e.tickFormat?e.tickFormat.apply(e,n):ij),g=Math.max(i,0)+a,v=e.range(),y=+v[0]+l,x=+v[v.length-1]+l,_=(e.bandwidth?cj:lj)(e.copy(),l),C=h.selection?h.selection():h,D=C.selectAll(".domain").data([null]),M=C.selectAll(".tick").data(m,e).order(),$=M.exit(),L=M.enter().append("g").attr("class","tick"),E=M.select("line"),N=M.select("text");D=D.merge(D.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),M=M.merge(L),E=E.merge(L.append("line").attr("stroke","currentColor").attr(u+"2",c*i)),N=N.merge(L.append("text").attr("fill","currentColor").attr(u,c*g).attr("dy",t===mp?"0em":t===rb?"0.71em":"0.32em")),h!==C&&(D=D.transition(h),M=M.transition(h),E=E.transition(h),N=N.transition(h),$=$.transition(h).attr("opacity",R8).attr("transform",function(T){return isFinite(T=_(T))?d(T+l):this.getAttribute("transform")}),L.attr("opacity",R8).attr("transform",function(T){var O=this.parentNode.__axis;return d((O&&isFinite(O=O(T))?O:_(T))+l)})),$.remove(),D.attr("d",t===Cd||t===gp?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),M.attr("opacity",1).attr("transform",function(T){return d(_(T)+l)}),E.attr(u+"2",c*i),N.attr(u,c*g).text(b),C.filter(uj).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===gp?"start":t===Cd?"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 dj(t){return Um(mp,t)}function F8(t){return Um(gp,t)}function fj(t){return Um(rb,t)}function V8(t){return Um(Cd,t)}var hj={value:()=>{}};function v2(){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 vp(n)}function vp(t){this._=t}function pj(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}})}vp.prototype=v2.prototype={constructor:vp,on:function(t,e){var n=this._,o=pj(t+"",n),r,i=-1,s=o.length;if(arguments.length<2){for(;++i<s;)if((r=(t=o[i]).type)&&(r=mj(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]=z8(n[r],t.name,e);else if(e==null)for(r in n)n[r]=z8(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 vp(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 mj(t,e){for(var n=0,o=t.length,r;n<o;++n)if((r=t[n]).name===e)return r.value}function z8(t,e,n){for(var o=0,r=t.length;o<r;++o)if(t[o].name===e){t[o]=hj,t=t.slice(0,o).concat(t.slice(o+1));break}return n!=null&&t.push({name:e,value:n}),t}var ib="http://www.w3.org/1999/xhtml";const H8={svg:"http://www.w3.org/2000/svg",xhtml:ib,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Gm(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),H8.hasOwnProperty(e)?{space:H8[e],local:t}:t}function gj(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===ib&&e.documentElement.namespaceURI===ib?e.createElement(t):e.createElementNS(n,t)}}function vj(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function HA(t){var e=Gm(t);return(e.local?vj:gj)(e)}function bj(){}function b2(t){return t==null?bj:function(){return this.querySelector(t)}}function yj(t){typeof t!="function"&&(t=b2(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 Mr(o,this._parents)}function xj(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function wj(){return[]}function WA(t){return t==null?wj:function(){return this.querySelectorAll(t)}}function _j(t){return function(){return xj(t.apply(this,arguments))}}function kj(t){typeof t=="function"?t=_j(t):t=WA(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 Mr(o,r)}function UA(t){return function(){return this.matches(t)}}function GA(t){return function(e){return e.matches(t)}}var Sj=Array.prototype.find;function Cj(t){return function(){return Sj.call(this.children,t)}}function Aj(){return this.firstElementChild}function $j(t){return this.select(t==null?Aj:Cj(typeof t=="function"?t:GA(t)))}var Tj=Array.prototype.filter;function Oj(){return Array.from(this.children)}function Mj(t){return function(){return Tj.call(this.children,t)}}function Bj(t){return this.selectAll(t==null?Oj:Mj(typeof t=="function"?t:GA(t)))}function Lj(t){typeof t!="function"&&(t=UA(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 Mr(o,this._parents)}function qA(t){return new Array(t.length)}function Pj(){return new Mr(this._enter||this._groups.map(qA),this._parents)}function s0(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}s0.prototype={constructor:s0,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 Dj(t){return function(){return t}}function Ej(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 s0(t,i[s]);for(;s<l;++s)(a=e[s])&&(r[s]=a)}function Ij(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 s0(t,i[a]);for(a=0;a<u;++a)(l=e[a])&&c.get(f[a])===l&&(r[a]=l)}function Nj(t){return t.__data__}function Rj(t,e){if(!arguments.length)return Array.from(this,Nj);var n=e?Ij:Ej,o=this._parents,r=this._groups;typeof t!="function"&&(t=Dj(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=Fj(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 Mr(s,o),s._enter=a,s._exit=l,s}function Fj(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Vj(){return new Mr(this._exit||this._groups.map(qA),this._parents)}function zj(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 Hj(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 Mr(a,this._parents)}function Wj(){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 Uj(t){t||(t=Gj);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 Mr(r,this._parents).order()}function Gj(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function qj(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Yj(){return Array.from(this)}function jj(){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 Kj(){let t=0;for(const e of this)++t;return t}function Xj(){return!this.node()}function Zj(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 Qj(t){return function(){this.removeAttribute(t)}}function Jj(t){return function(){this.removeAttributeNS(t.space,t.local)}}function eK(t,e){return function(){this.setAttribute(t,e)}}function tK(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function nK(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function oK(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 rK(t,e){var n=Gm(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?Jj:Qj:typeof e=="function"?n.local?oK:nK:n.local?tK:eK)(n,e))}function YA(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function iK(t){return function(){this.style.removeProperty(t)}}function sK(t,e,n){return function(){this.style.setProperty(t,e,n)}}function aK(t,e,n){return function(){var o=e.apply(this,arguments);o==null?this.style.removeProperty(t):this.style.setProperty(t,o,n)}}function lK(t,e,n){return arguments.length>1?this.each((e==null?iK:typeof e=="function"?aK:sK)(t,e,n??"")):xu(this.node(),t)}function xu(t,e){return t.style.getPropertyValue(e)||YA(t).getComputedStyle(t,null).getPropertyValue(e)}function cK(t){return function(){delete this[t]}}function uK(t,e){return function(){this[t]=e}}function dK(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function fK(t,e){return arguments.length>1?this.each((e==null?cK:typeof e=="function"?dK:uK)(t,e)):this.node()[t]}function jA(t){return t.trim().split(/^|\s+/)}function y2(t){return t.classList||new KA(t)}function KA(t){this._node=t,this._names=jA(t.getAttribute("class")||"")}KA.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 XA(t,e){for(var n=y2(t),o=-1,r=e.length;++o<r;)n.add(e[o])}function ZA(t,e){for(var n=y2(t),o=-1,r=e.length;++o<r;)n.remove(e[o])}function hK(t){return function(){XA(this,t)}}function pK(t){return function(){ZA(this,t)}}function mK(t,e){return function(){(e.apply(this,arguments)?XA:ZA)(this,t)}}function gK(t,e){var n=jA(t+"");if(arguments.length<2){for(var o=y2(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each((typeof e=="function"?mK:e?hK:pK)(n,e))}function vK(){this.textContent=""}function bK(t){return function(){this.textContent=t}}function yK(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function xK(t){return arguments.length?this.each(t==null?vK:(typeof t=="function"?yK:bK)(t)):this.node().textContent}function wK(){this.innerHTML=""}function _K(t){return function(){this.innerHTML=t}}function kK(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function SK(t){return arguments.length?this.each(t==null?wK:(typeof t=="function"?kK:_K)(t)):this.node().innerHTML}function CK(){this.nextSibling&&this.parentNode.appendChild(this)}function AK(){return this.each(CK)}function $K(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function TK(){return this.each($K)}function OK(t){var e=typeof t=="function"?t:HA(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function MK(){return null}function BK(t,e){var n=typeof t=="function"?t:HA(t),o=e==null?MK:typeof e=="function"?e:b2(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function LK(){var t=this.parentNode;t&&t.removeChild(this)}function PK(){return this.each(LK)}function DK(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function EK(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function IK(t){return this.select(t?EK:DK)}function NK(t){return arguments.length?this.property("__data__",t):this.node().__data__}function RK(t){return function(e){t.call(this,e,this.__data__)}}function FK(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 VK(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 zK(t,e,n){return function(){var o=this.__on,r,i=RK(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 HK(t,e,n){var o=FK(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?zK:VK,r=0;r<i;++r)this.each(a(o[r],e,n));return this}function QA(t,e,n){var o=YA(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 WK(t,e){return function(){return QA(this,t,e)}}function UK(t,e){return function(){return QA(this,t,e.apply(this,arguments))}}function GK(t,e){return this.each((typeof e=="function"?UK:WK)(t,e))}function*qK(){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 JA=[null];function Mr(t,e){this._groups=t,this._parents=e}function Nu(){return new Mr([[document.documentElement]],JA)}function YK(){return this}Mr.prototype=Nu.prototype={constructor:Mr,select:yj,selectAll:kj,selectChild:$j,selectChildren:Bj,filter:Lj,data:Rj,enter:Pj,exit:Vj,join:zj,merge:Hj,selection:YK,order:Wj,sort:Uj,call:qj,nodes:Yj,node:jj,size:Kj,empty:Xj,each:Zj,attr:rK,style:lK,property:fK,classed:gK,text:xK,html:SK,raise:AK,lower:TK,append:OK,insert:BK,remove:PK,clone:IK,datum:NK,on:HK,dispatch:GK,[Symbol.iterator]:qK};function $e(t){return typeof t=="string"?new Mr([[document.querySelector(t)]],[document.documentElement]):new Mr([[t]],JA)}function jK(t){let e;for(;e=t.sourceEvent;)t=e;return t}function KK(t,e){if(t=jK(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 x2(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function e5(t,e){var n=Object.create(t.prototype);for(var o in e)n[o]=e[o];return n}function jf(){}var bf=.7,a0=1/bf,Kc="\\s*([+-]?\\d+)\\s*",yf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",cs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",XK=/^#([0-9a-f]{3,8})$/,ZK=new RegExp(`^rgb\\(${Kc},${Kc},${Kc}\\)$`),QK=new RegExp(`^rgb\\(${cs},${cs},${cs}\\)$`),JK=new RegExp(`^rgba\\(${Kc},${Kc},${Kc},${yf}\\)$`),eX=new RegExp(`^rgba\\(${cs},${cs},${cs},${yf}\\)$`),tX=new RegExp(`^hsl\\(${yf},${cs},${cs}\\)$`),nX=new RegExp(`^hsla\\(${yf},${cs},${cs},${yf}\\)$`),W8={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};x2(jf,Zl,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:U8,formatHex:U8,formatHex8:oX,formatHsl:rX,formatRgb:G8,toString:G8});function U8(){return this.rgb().formatHex()}function oX(){return this.rgb().formatHex8()}function rX(){return t5(this).formatHsl()}function G8(){return this.rgb().formatRgb()}function Zl(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=XK.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?q8(e):n===3?new cr(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?Sh(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?Sh(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=ZK.exec(t))?new cr(e[1],e[2],e[3],1):(e=QK.exec(t))?new cr(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=JK.exec(t))?Sh(e[1],e[2],e[3],e[4]):(e=eX.exec(t))?Sh(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=tX.exec(t))?K8(e[1],e[2]/100,e[3]/100,1):(e=nX.exec(t))?K8(e[1],e[2]/100,e[3]/100,e[4]):W8.hasOwnProperty(t)?q8(W8[t]):t==="transparent"?new cr(NaN,NaN,NaN,0):null}function q8(t){return new cr(t>>16&255,t>>8&255,t&255,1)}function Sh(t,e,n,o){return o<=0&&(t=e=n=NaN),new cr(t,e,n,o)}function iX(t){return t instanceof jf||(t=Zl(t)),t?(t=t.rgb(),new cr(t.r,t.g,t.b,t.opacity)):new cr}function sb(t,e,n,o){return arguments.length===1?iX(t):new cr(t,e,n,o??1)}function cr(t,e,n,o){this.r=+t,this.g=+e,this.b=+n,this.opacity=+o}x2(cr,sb,e5(jf,{brighter(t){return t=t==null?a0:Math.pow(a0,t),new cr(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?bf:Math.pow(bf,t),new cr(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new cr(Vl(this.r),Vl(this.g),Vl(this.b),l0(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:Y8,formatHex:Y8,formatHex8:sX,formatRgb:j8,toString:j8}));function Y8(){return`#${Pl(this.r)}${Pl(this.g)}${Pl(this.b)}`}function sX(){return`#${Pl(this.r)}${Pl(this.g)}${Pl(this.b)}${Pl((isNaN(this.opacity)?1:this.opacity)*255)}`}function j8(){const t=l0(this.opacity);return`${t===1?"rgb(":"rgba("}${Vl(this.r)}, ${Vl(this.g)}, ${Vl(this.b)}${t===1?")":`, ${t})`}`}function l0(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Vl(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Pl(t){return t=Vl(t),(t<16?"0":"")+t.toString(16)}function K8(t,e,n,o){return o<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new fi(t,e,n,o)}function t5(t){if(t instanceof fi)return new fi(t.h,t.s,t.l,t.opacity);if(t instanceof jf||(t=Zl(t)),!t)return new fi;if(t instanceof fi)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 fi(s,a,l,t.opacity)}function aX(t,e,n,o){return arguments.length===1?t5(t):new fi(t,e,n,o??1)}function fi(t,e,n,o){this.h=+t,this.s=+e,this.l=+n,this.opacity=+o}x2(fi,aX,e5(jf,{brighter(t){return t=t==null?a0:Math.pow(a0,t),new fi(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?bf:Math.pow(bf,t),new fi(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 cr(Lv(t>=240?t-240:t+120,r,o),Lv(t,r,o),Lv(t<120?t+240:t-120,r,o),this.opacity)},clamp(){return new fi(X8(this.h),Ch(this.s),Ch(this.l),l0(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=l0(this.opacity);return`${t===1?"hsl(":"hsla("}${X8(this.h)}, ${Ch(this.s)*100}%, ${Ch(this.l)*100}%${t===1?")":`, ${t})`}`}}));function X8(t){return t=(t||0)%360,t<0?t+360:t}function Ch(t){return Math.max(0,Math.min(1,t||0))}function Lv(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 w2=t=>()=>t;function lX(t,e){return function(n){return t+n*e}}function cX(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 uX(t){return(t=+t)==1?n5:function(e,n){return n-e?cX(e,n,t):w2(isNaN(e)?n:e)}}function n5(t,e){var n=e-t;return n?lX(t,n):w2(isNaN(t)?e:t)}const c0=(function t(e){var n=uX(e);function o(r,i){var s=n((r=sb(r)).r,(i=sb(i)).r),a=n(r.g,i.g),l=n(r.b,i.b),c=n5(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 dX(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 fX(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function hX(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]=_2(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 pX(t,e){var n=new Date;return t=+t,e=+e,function(o){return n.setTime(t*(1-o)+e*o),n}}function lo(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]=_2(t[r],e[r]):o[r]=e[r];return function(i){for(r in n)o[r]=n[r](i);return o}}var ab=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Pv=new RegExp(ab.source,"g");function mX(t){return function(){return t}}function gX(t){return function(e){return t(e)+""}}function o5(t,e){var n=ab.lastIndex=Pv.lastIndex=0,o,r,i,s=-1,a=[],l=[];for(t=t+"",e=e+"";(o=ab.exec(t))&&(r=Pv.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:lo(o,r)})),n=Pv.lastIndex;return n<e.length&&(i=e.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?gX(l[0].x):mX(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 _2(t,e){var n=typeof e,o;return e==null||n==="boolean"?w2(e):(n==="number"?lo:n==="string"?(o=Zl(e))?(e=o,c0):o5:e instanceof Zl?c0:e instanceof Date?pX:fX(e)?dX:Array.isArray(e)?hX:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Yd:lo)(t,e)}function vX(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var Z8=180/Math.PI,lb={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function r5(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)*Z8,skewX:Math.atan(l)*Z8,scaleX:s,scaleY:a}}var Ah;function bX(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?lb:r5(e.a,e.b,e.c,e.d,e.e,e.f)}function yX(t){return t==null||(Ah||(Ah=document.createElementNS("http://www.w3.org/2000/svg","g")),Ah.setAttribute("transform",t),!(t=Ah.transform.baseVal.consolidate()))?lb:(t=t.matrix,r5(t.a,t.b,t.c,t.d,t.e,t.f))}function i5(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:lo(c,d)},{i:b-2,x:lo(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:lo(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:lo(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:lo(c,d)},{i:b-2,x:lo(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 xX=i5(bX,"px, ","px)","deg)"),wX=i5(yX,", ",")",")"),wu=0,Ad=0,hd=0,s5=1e3,u0,$d,d0=0,Ql=0,qm=0,xf=typeof performance=="object"&&performance.now?performance:Date,a5=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function k2(){return Ql||(a5(_X),Ql=xf.now()+qm)}function _X(){Ql=0}function f0(){this._call=this._time=this._next=null}f0.prototype=l5.prototype={constructor:f0,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?k2():+n)+(e==null?0:+e),!this._next&&$d!==this&&($d?$d._next=this:u0=this,$d=this),this._call=t,this._time=n,cb()},stop:function(){this._call&&(this._call=null,this._time=1/0,cb())}};function l5(t,e,n){var o=new f0;return o.restart(t,e,n),o}function kX(){k2(),++wu;for(var t=u0,e;t;)(e=Ql-t._time)>=0&&t._call.call(void 0,e),t=t._next;--wu}function Q8(){Ql=(d0=xf.now())+qm,wu=Ad=0;try{kX()}finally{wu=0,CX(),Ql=0}}function SX(){var t=xf.now(),e=t-d0;e>s5&&(qm-=e,d0=t)}function CX(){for(var t,e=u0,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:u0=n);$d=t,cb(o)}function cb(t){if(!wu){Ad&&(Ad=clearTimeout(Ad));var e=t-Ql;e>24?(t<1/0&&(Ad=setTimeout(Q8,t-xf.now()-qm)),hd&&(hd=clearInterval(hd))):(hd||(d0=xf.now(),hd=setInterval(SX,s5)),wu=1,a5(Q8))}}function J8(t,e,n){var o=new f0;return e=e==null?0:+e,o.restart(r=>{o.stop(),t(r+e)},e,n),o}var AX=v2("start","end","cancel","interrupt"),$X=[],c5=0,e6=1,ub=2,bp=3,t6=4,db=5,yp=6;function Ym(t,e,n,o,r,i){var s=t.__transition;if(!s)t.__transition={};else if(n in s)return;TX(t,n,{name:e,index:o,group:r,on:AX,tween:$X,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:c5})}function S2(t,e){var n=Ni(t,e);if(n.state>c5)throw new Error("too late; already scheduled");return n}function ws(t,e){var n=Ni(t,e);if(n.state>bp)throw new Error("too late; already running");return n}function Ni(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function TX(t,e,n){var o=t.__transition,r;o[e]=n,n.timer=l5(i,0,n.time);function i(c){n.state=e6,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!==e6)return l();for(u in o)if(h=o[u],h.name===n.name){if(h.state===bp)return J8(s);h.state===t6?(h.state=yp,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete o[u]):+u<e&&(h.state=yp,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete o[u])}if(J8(function(){n.state===bp&&(n.state=t6,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=ub,n.on.call("start",t,t.__data__,n.index,n.group),n.state===ub){for(n.state=bp,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=db,1),d=-1,f=r.length;++d<f;)r[d].call(t,u);n.state===db&&(n.on.call("end",t,t.__data__,n.index,n.group),l())}function l(){n.state=yp,n.timer.stop(),delete o[e];for(var c in o)return;delete t.__transition}}function OX(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>ub&&o.state<db,o.state=yp,o.timer.stop(),o.on.call(r?"interrupt":"cancel",t,t.__data__,o.index,o.group),delete n[s]}i&&delete t.__transition}}function MX(t){return this.each(function(){OX(this,t)})}function BX(t,e){var n,o;return function(){var r=ws(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 LX(t,e,n){var o,r;if(typeof n!="function")throw new Error;return function(){var i=ws(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 PX(t,e){var n=this._id;if(t+="",arguments.length<2){for(var o=Ni(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?BX:LX)(n,t,e))}function C2(t,e,n){var o=t._id;return t.each(function(){var r=ws(this,o);(r.value||(r.value={}))[e]=n.apply(this,arguments)}),function(r){return Ni(r,o).value[e]}}function u5(t,e){var n;return(typeof e=="number"?lo:e instanceof Zl?c0:(n=Zl(e))?(e=n,c0):o5)(t,e)}function DX(t){return function(){this.removeAttribute(t)}}function EX(t){return function(){this.removeAttributeNS(t.space,t.local)}}function IX(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 NX(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 RX(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 FX(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 VX(t,e){var n=Gm(t),o=n==="transform"?wX:u5;return this.attrTween(t,typeof e=="function"?(n.local?FX:RX)(n,o,C2(this,"attr."+t,e)):e==null?(n.local?EX:DX)(n):(n.local?NX:IX)(n,o,e))}function zX(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function HX(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function WX(t,e){var n,o;function r(){var i=e.apply(this,arguments);return i!==o&&(n=(o=i)&&HX(t,i)),n}return r._value=e,r}function UX(t,e){var n,o;function r(){var i=e.apply(this,arguments);return i!==o&&(n=(o=i)&&zX(t,i)),n}return r._value=e,r}function GX(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=Gm(t);return this.tween(n,(o.local?WX:UX)(o,e))}function qX(t,e){return function(){S2(this,t).delay=+e.apply(this,arguments)}}function YX(t,e){return e=+e,function(){S2(this,t).delay=e}}function jX(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?qX:YX)(e,t)):Ni(this.node(),e).delay}function KX(t,e){return function(){ws(this,t).duration=+e.apply(this,arguments)}}function XX(t,e){return e=+e,function(){ws(this,t).duration=e}}function ZX(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?KX:XX)(e,t)):Ni(this.node(),e).duration}function QX(t,e){if(typeof e!="function")throw new Error;return function(){ws(this,t).ease=e}}function JX(t){var e=this._id;return arguments.length?this.each(QX(e,t)):Ni(this.node(),e).ease}function eZ(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;ws(this,t).ease=n}}function tZ(t){if(typeof t!="function")throw new Error;return this.each(eZ(this._id,t))}function nZ(t){typeof t!="function"&&(t=UA(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 ra(o,this._parents,this._name,this._id)}function oZ(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 ra(s,this._parents,this._name,this._id)}function rZ(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 iZ(t,e,n){var o,r,i=rZ(e)?S2:ws;return function(){var s=i(this,t),a=s.on;a!==o&&(r=(o=a).copy()).on(e,n),s.on=r}}function sZ(t,e){var n=this._id;return arguments.length<2?Ni(this.node(),n).on.on(t):this.each(iZ(n,t,e))}function aZ(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function lZ(){return this.on("end.remove",aZ(this._id))}function cZ(t){var e=this._name,n=this._id;typeof t!="function"&&(t=b2(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,Ym(c[f],e,n,f,c,Ni(u,n)));return new ra(i,this._parents,e,n)}function uZ(t){var e=this._name,n=this._id;typeof t!="function"&&(t=WA(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=Ni(u,n),b=0,g=f.length;b<g;++b)(h=f[b])&&Ym(h,e,n,b,f,m);i.push(f),s.push(u)}return new ra(i,s,e,n)}var dZ=Nu.prototype.constructor;function fZ(){return new dZ(this._groups,this._parents)}function hZ(t,e){var n,o,r;return function(){var i=xu(this,t),s=(this.style.removeProperty(t),xu(this,t));return i===s?null:i===n&&s===o?r:r=e(n=i,o=s)}}function d5(t){return function(){this.style.removeProperty(t)}}function pZ(t,e,n){var o,r=n+"",i;return function(){var s=xu(this,t);return s===r?null:s===o?i:i=e(o=s,n)}}function mZ(t,e,n){var o,r,i;return function(){var s=xu(this,t),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(t),xu(this,t))),s===l?null:s===o&&l===r?i:(r=l,i=e(o=s,a))}}function gZ(t,e){var n,o,r,i="style."+e,s="end."+i,a;return function(){var l=ws(this,t),c=l.on,u=l.value[i]==null?a||(a=d5(e)):void 0;(c!==n||r!==u)&&(o=(n=c).copy()).on(s,r=u),l.on=o}}function vZ(t,e,n){var o=(t+="")=="transform"?xX:u5;return e==null?this.styleTween(t,hZ(t,o)).on("end.style."+t,d5(t)):typeof e=="function"?this.styleTween(t,mZ(t,o,C2(this,"style."+t,e))).each(gZ(this._id,t)):this.styleTween(t,pZ(t,o,e),n).on("end.style."+t,null)}function bZ(t,e,n){return function(o){this.style.setProperty(t,e.call(this,o),n)}}function yZ(t,e,n){var o,r;function i(){var s=e.apply(this,arguments);return s!==r&&(o=(r=s)&&bZ(t,s,n)),o}return i._value=e,i}function xZ(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,yZ(t,e,n??""))}function wZ(t){return function(){this.textContent=t}}function _Z(t){return function(){var e=t(this);this.textContent=e??""}}function kZ(t){return this.tween("text",typeof t=="function"?_Z(C2(this,"text",t)):wZ(t==null?"":t+""))}function SZ(t){return function(e){this.textContent=t.call(this,e)}}function CZ(t){var e,n;function o(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&SZ(r)),e}return o._value=t,o}function AZ(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,CZ(t))}function $Z(){for(var t=this._name,e=this._id,n=h5(),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=Ni(l,e);Ym(l,t,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new ra(o,this._parents,t,n)}function TZ(){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=ws(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 OZ=0;function ra(t,e,n,o){this._groups=t,this._parents=e,this._name=n,this._id=o}function f5(t){return Nu().transition(t)}function h5(){return++OZ}var Bs=Nu.prototype;ra.prototype=f5.prototype={constructor:ra,select:cZ,selectAll:uZ,selectChild:Bs.selectChild,selectChildren:Bs.selectChildren,filter:nZ,merge:oZ,selection:fZ,transition:$Z,call:Bs.call,nodes:Bs.nodes,node:Bs.node,size:Bs.size,empty:Bs.empty,each:Bs.each,on:sZ,attr:VX,attrTween:GX,style:vZ,styleTween:xZ,text:kZ,textTween:AZ,remove:lZ,tween:PX,delay:jX,duration:ZX,ease:JX,easeVarying:tZ,end:TZ,[Symbol.iterator]:Bs[Symbol.iterator]};function $h(t){return--t*t*t+1}function h0(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var MZ={time:null,delay:0,duration:250,ease:h0};function BZ(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 LZ(t){var e,n;t instanceof ra?(e=t._id,t=t._name):(e=h5(),(n=MZ).time=k2(),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])&&Ym(l,t,e,c,s,n||BZ(l,e));return new ra(o,this._parents,t,e)}Nu.prototype.interrupt=MX;Nu.prototype.transition=LZ;const fb=Math.PI,hb=2*fb,Al=1e-6,PZ=hb-Al;function p5(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function DZ(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return p5;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 EZ{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?p5:DZ(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>Al)if(!(Math.abs(d*l-c*u)>Al)||!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((fb-Math.acos((b+f-g)/(2*v*y)))/2),_=x/y,C=x/v;Math.abs(_-1)>Al&&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)>Al||Math.abs(this._y1-u)>Al)&&this._append`L${c},${u}`,o&&(f<0&&(f=f%hb+hb),f>PZ?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>Al&&this._append`A${o},${o},0,${+(f>=fb)},${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 jm(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}const n6=Symbol("implicit");function A2(){var t=new J1,e=[],n=[],o=n6;function r(i){let s=t.get(i);if(s===void 0){if(o!==n6)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 J1;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 A2(e,n).unknown(o)},jm.apply(r,arguments),r}function oo(){var t=A2().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=iH(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 oo(e(),[o,r]).round(a).paddingInner(l).paddingOuter(c).align(u)},jm.apply(d(),arguments)}function m5(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return m5(e())},t}function Km(){return m5(oo.apply(null,arguments).paddingInner(1))}function IZ(t){return function(){return t}}function NZ(t){return+t}var o6=[0,1];function Fc(t){return t}function pb(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:IZ(isNaN(e)?NaN:.5)}function RZ(t,e){var n;return t>e&&(n=t,t=e,e=n),function(o){return Math.max(t,Math.min(e,o))}}function FZ(t,e,n){var o=t[0],r=t[1],i=e[0],s=e[1];return r<o?(o=pb(r,o),i=n(s,i)):(o=pb(o,r),i=n(i,s)),function(a){return i(o(a))}}function VZ(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]=pb(t[s],t[s+1]),i[s]=n(e[s],e[s+1]);return function(a){var l=Yz(t,a,1,o)-1;return i[l](r[l](a))}}function g5(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function v5(){var t=o6,e=o6,n=_2,o,r,i,s=Fc,a,l,c;function u(){var f=Math.min(t.length,e.length);return s!==Fc&&(s=RZ(t[0],t[f-1])),a=f>2?VZ:FZ,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),lo)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,NZ),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=vX,u()},d.clamp=function(f){return arguments.length?(s=f?!0:Fc,u()):s!==Fc},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 zZ(){return v5()(Fc,Fc)}function HZ(t,e,n,o){var r=rH(t,e,n),i;switch(o=Jp(o??",f"),o.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return o.precision==null&&!isNaN(i=fz(r,s))&&(o.precision=i),lA(o,s)}case"":case"e":case"g":case"p":case"r":{o.precision==null&&!isNaN(i=hz(r,Math.max(Math.abs(t),Math.abs(e))))&&(o.precision=i-(o.type==="e"));break}case"f":case"%":{o.precision==null&&!isNaN(i=dz(r))&&(o.precision=i-(o.type==="%")*2);break}}return Iu(o)}function b5(t){var e=t.domain;return t.ticks=function(n){var o=e();return oH(o[0],o[o.length-1],n??10)},t.tickFormat=function(n,o){var r=e();return HZ(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=eb(s,a,n),c===l)return o[r]=s,o[i]=a,e(o);if(c>0)s=Math.floor(s/c)*c,a=Math.ceil(a/c)*c;else if(c<0)s=Math.ceil(s*c)/c,a=Math.floor(a*c)/c;else break;l=c}return t},t}function Bn(){var t=zZ();return t.copy=function(){return g5(t,Bn())},jm.apply(t,arguments),b5(t)}function r6(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function i6(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function WZ(t){var e=1,n=t(r6(e),i6(e));return n.constant=function(o){return arguments.length?t(r6(e=+o),i6(e)):e},b5(n)}function rl(){var t=WZ(v5());return t.copy=function(){return g5(t,rl()).constant(t.constant())},jm.apply(t,arguments)}function Mt(t){return function(){return t}}const s6=Math.abs,vo=Math.atan2,Is=Math.cos,UZ=Math.max,Dv=Math.min,nr=Math.sin,Bo=Math.sqrt,bo=1e-12,Ga=Math.PI,p0=Ga/2,Ia=2*Ga;function GZ(t){return t>1?0:t<-1?Ga:Math.acos(t)}function a6(t){return t>=1?p0:t<=-1?-p0:Math.asin(t)}function Xm(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 EZ(e)}function qZ(t){return t.innerRadius}function YZ(t){return t.outerRadius}function jZ(t){return t.startAngle}function KZ(t){return t.endAngle}function XZ(t){return t&&t.padAngle}function ZZ(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<bo))return f=(u*(e-i)-d*(t-r))/f,[t+f*l,e+f*c]}function Th(t,e,n,o,r,i,s){var a=t-n,l=e-o,c=(s?i:-i)/Bo(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,D=f*b-m*h,M=(x<0?-1:1)*Bo(UZ(0,C*C*_-D*D)),$=(D*x-y*M)/_,L=(-D*y-x*M)/_,E=(D*x+y*M)/_,N=(-D*y+x*M)/_,T=$-g,O=L-v,P=E-g,B=N-v;return T*T+O*O>P*P+B*B&&($=E,L=N),{cx:$,cy:L,x01:-u,y01:-d,x11:$*(r/C-1),y11:L*(r/C-1)}}function QZ(){var t=qZ,e=YZ,n=Mt(0),o=null,r=jZ,i=KZ,s=XZ,a=null,l=Xm(c);function c(){var u,d,f=+t.apply(this,arguments),h=+e.apply(this,arguments),m=r.apply(this,arguments)-p0,b=i.apply(this,arguments)-p0,g=s6(b-m),v=b>m;if(a||(a=u=l()),h<f&&(d=h,h=f,f=d),!(h>bo))a.moveTo(0,0);else if(g>Ia-bo)a.moveTo(h*Is(m),h*nr(m)),a.arc(0,0,h,m,b,!v),f>bo&&(a.moveTo(f*Is(b),f*nr(b)),a.arc(0,0,f,b,m,v));else{var y=m,x=b,_=m,C=b,D=g,M=g,$=s.apply(this,arguments)/2,L=$>bo&&(o?+o.apply(this,arguments):Bo(f*f+h*h)),E=Dv(s6(h-f)/2,+n.apply(this,arguments)),N=E,T=E,O,P;if(L>bo){var B=a6(L/f*nr($)),V=a6(L/h*nr($));(D-=B*2)>bo?(B*=v?1:-1,_+=B,C-=B):(D=0,_=C=(m+b)/2),(M-=V*2)>bo?(V*=v?1:-1,y+=V,x-=V):(M=0,y=x=(m+b)/2)}var z=h*Is(y),G=h*nr(y),K=f*Is(C),ne=f*nr(C);if(E>bo){var ae=h*Is(x),he=h*nr(x),ge=f*Is(_),le=f*nr(_),fe;if(g<Ga)if(fe=ZZ(z,G,ge,le,ae,he,K,ne)){var we=z-fe[0],Z=G-fe[1],be=ae-fe[0],re=he-fe[1],ve=1/nr(GZ((we*be+Z*re)/(Bo(we*we+Z*Z)*Bo(be*be+re*re)))/2),ce=Bo(fe[0]*fe[0]+fe[1]*fe[1]);N=Dv(E,(f-ce)/(ve-1)),T=Dv(E,(h-ce)/(ve+1))}else N=T=0}M>bo?T>bo?(O=Th(ge,le,z,G,h,T,v),P=Th(ae,he,K,ne,h,T,v),a.moveTo(O.cx+O.x01,O.cy+O.y01),T<E?a.arc(O.cx,O.cy,T,vo(O.y01,O.x01),vo(P.y01,P.x01),!v):(a.arc(O.cx,O.cy,T,vo(O.y01,O.x01),vo(O.y11,O.x11),!v),a.arc(0,0,h,vo(O.cy+O.y11,O.cx+O.x11),vo(P.cy+P.y11,P.cx+P.x11),!v),a.arc(P.cx,P.cy,T,vo(P.y11,P.x11),vo(P.y01,P.x01),!v))):(a.moveTo(z,G),a.arc(0,0,h,y,x,!v)):a.moveTo(z,G),!(f>bo)||!(D>bo)?a.lineTo(K,ne):N>bo?(O=Th(K,ne,ae,he,f,-N,v),P=Th(z,G,ge,le,f,-N,v),a.lineTo(O.cx+O.x01,O.cy+O.y01),N<E?a.arc(O.cx,O.cy,N,vo(O.y01,O.x01),vo(P.y01,P.x01),!v):(a.arc(O.cx,O.cy,N,vo(O.y01,O.x01),vo(O.y11,O.x11),!v),a.arc(0,0,f,vo(O.cy+O.y11,O.cx+O.x11),vo(P.cy+P.y11,P.cx+P.x11),v),a.arc(P.cx,P.cy,N,vo(P.y11,P.x11),vo(P.y01,P.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-Ga/2;return[Is(d)*u,nr(d)*u]},c.innerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:Mt(+u),c):t},c.outerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:Mt(+u),c):e},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:Mt(+u),c):n},c.padRadius=function(u){return arguments.length?(o=u==null?null:typeof u=="function"?u:Mt(+u),c):o},c.startAngle=function(u){return arguments.length?(r=typeof u=="function"?u:Mt(+u),c):r},c.endAngle=function(u){return arguments.length?(i=typeof u=="function"?u:Mt(+u),c):i},c.padAngle=function(u){return arguments.length?(s=typeof u=="function"?u:Mt(+u),c):s},c.context=function(u){return arguments.length?(a=u??null,c):a},c}function Zm(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function y5(t){this._context=t}y5.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 Ru(t){return new y5(t)}function x5(t){return t[0]}function w5(t){return t[1]}function Li(t,e){var n=Mt(!0),o=null,r=Ru,i=null,s=Xm(a);t=typeof t=="function"?t:t===void 0?x5:Mt(t),e=typeof e=="function"?e:e===void 0?w5:Mt(e);function a(l){var c,u=(l=Zm(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:Mt(+l),a):t},a.y=function(l){return arguments.length?(e=typeof l=="function"?l:Mt(+l),a):e},a.defined=function(l){return arguments.length?(n=typeof l=="function"?l:Mt(!!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 ia(t,e,n){var o=null,r=Mt(!0),i=null,s=Ru,a=null,l=Xm(c);t=typeof t=="function"?t:t===void 0?x5:Mt(+t),e=typeof e=="function"?e:Mt(e===void 0?0:+e),n=typeof n=="function"?n:n===void 0?w5:Mt(+n);function c(d){var f,h,m,b=(d=Zm(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 Li().defined(r).curve(s).context(i)}return c.x=function(d){return arguments.length?(t=typeof d=="function"?d:Mt(+d),o=null,c):t},c.x0=function(d){return arguments.length?(t=typeof d=="function"?d:Mt(+d),c):t},c.x1=function(d){return arguments.length?(o=d==null?null:typeof d=="function"?d:Mt(+d),c):o},c.y=function(d){return arguments.length?(e=typeof d=="function"?d:Mt(+d),n=null,c):e},c.y0=function(d){return arguments.length?(e=typeof d=="function"?d:Mt(+d),c):e},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:Mt(+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:Mt(!!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 JZ(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function eQ(t){return t}function tQ(){var t=eQ,e=JZ,n=null,o=Mt(0),r=Mt(Ia),i=Mt(0);function s(a){var l,c=(a=Zm(a)).length,u,d,f=0,h=new Array(c),m=new Array(c),b=+o.apply(this,arguments),g=Math.min(Ia,Math.max(-Ia,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,D){return e(m[C],m[D])}):n!=null&&h.sort(function(C,D){return n(a[C],a[D])}),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:Mt(+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:Mt(+a),s):o},s.endAngle=function(a){return arguments.length?(r=typeof a=="function"?a:Mt(+a),s):r},s.padAngle=function(a){return arguments.length?(i=typeof a=="function"?a:Mt(+a),s):i},s}const $2={draw(t,e){const n=Bo(e/Ga);t.moveTo(n,0),t.arc(0,0,n,0,Ia)}},nQ={draw(t,e){const n=Bo(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()}},_5=Bo(1/3),oQ=_5*2,rQ={draw(t,e){const n=Bo(e/oQ),o=n*_5;t.moveTo(0,-n),t.lineTo(o,0),t.lineTo(0,n),t.lineTo(-o,0),t.closePath()}},iQ={draw(t,e){const n=Bo(e),o=-n/2;t.rect(o,o,n,n)}},sQ=.8908130915292852,k5=nr(Ga/10)/nr(7*Ga/10),aQ=nr(Ia/10)*k5,lQ=-Is(Ia/10)*k5,cQ={draw(t,e){const n=Bo(e*sQ),o=aQ*n,r=lQ*n;t.moveTo(0,-n),t.lineTo(o,r);for(let i=1;i<5;++i){const s=Ia*i/5,a=Is(s),l=nr(s);t.lineTo(l*n,-a*n),t.lineTo(a*o-l*r,l*o+a*r)}t.closePath()}},Ev=Bo(3),S5={draw(t,e){const n=-Bo(e/(Ev*3));t.moveTo(0,n*2),t.lineTo(-Ev*n,-n),t.lineTo(Ev*n,-n),t.closePath()}},uQ=Bo(3),dQ={draw(t,e){const n=Bo(e)*.6824,o=n/2,r=n*uQ/2;t.moveTo(0,-n),t.lineTo(r,o),t.lineTo(-r,o),t.closePath()}};function fQ(t,e){let n=null,o=Xm(r);t=typeof t=="function"?t:Mt(t||$2),e=typeof e=="function"?e:Mt(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:Mt(i),r):t},r.size=function(i){return arguments.length?(e=typeof i=="function"?i:Mt(+i),r):e},r.context=function(i){return arguments.length?(n=i??null,r):n},r}function l6(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 C5(t){this._context=t}C5.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:l6(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:l6(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function hQ(t){return new C5(t)}function c6(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 T2(t,e){this._context=t,this._k=(1-e)/6}T2.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:c6(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:c6(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 pQ=(function t(e){function n(o){return new T2(o,e)}return n.tension=function(o){return t(+o)},n})(0);function mQ(t,e,n){var o=t._x1,r=t._y1,i=t._x2,s=t._y2;if(t._l01_a>bo){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>bo){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 A5(t,e){this._context=t,this._alpha=e}A5.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:mQ(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 gQ=(function t(e){function n(o){return e?new A5(o,e):new T2(o,0)}return n.alpha=function(o){return t(+o)},n})(.5);function u6(t){return t<0?-1:1}function d6(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(u6(i)+u6(s))*Math.min(Math.abs(i),Math.abs(s),.5*Math.abs(a))||0}function f6(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Iv(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 m0(t){this._context=t}m0.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:Iv(this,this._t0,f6(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,Iv(this,f6(this,n=d6(this,t,e)),n);break;default:Iv(this,this._t0,n=d6(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};Object.create(m0.prototype).point=function(t,e){m0.prototype.point.call(this,e,t)};function O2(t){return new m0(t)}function Qm(t,e){this._context=t,this._t=e}Qm.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 vQ(t){return new Qm(t,.5)}function bQ(t){return new Qm(t,0)}function yQ(t){return new Qm(t,1)}function g0(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 v0(t){for(var e=t.length,n=new Array(e);--e>=0;)n[e]=e;return n}function xQ(t,e){return t[e]}function wQ(t){const e=[];return e.key=t,e}function $5(){var t=Mt([]),e=v0,n=g0,o=xQ;function r(i){var s=Array.from(t.apply(this,arguments),wQ),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=Zm(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:Mt(Array.from(i)),r):t},r.value=function(i){return arguments.length?(o=typeof i=="function"?i:Mt(+i),r):o},r.order=function(i){return arguments.length?(e=i==null?v0:typeof i=="function"?i:Mt(Array.from(i)),r):e},r.offset=function(i){return arguments.length?(n=i??g0,r):n},r}function _Q(t,e){if((o=t.length)>0){for(var n,o,r=0,i=t[0].length,s;r<i;++r){for(s=n=0;n<o;++n)s+=t[n][r][1]||0;if(s)for(n=0;n<o;++n)t[n][r][1]/=s}g0(t,e)}}function kQ(t,e){if((l=t.length)>0)for(var n,o=0,r,i,s,a,l,c=t[e[0]].length;o<c;++o)for(s=a=0,n=0;n<l;++n)(i=(r=t[e[n]][o])[1]-r[0])>0?(r[0]=s,r[1]=s+=i):i<0?(r[1]=a,r[0]=a+=i):(r[0]=0,r[1]=i)}function 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 mb(t,e){if(!t)throw new Error(`[d3-blueprint] ${e}`)}class SQ{constructor(){xn(this,"properties",new Map)}define(e,n){mb(!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 mb(n,`config "${e}" is not defined`),n}}const gb=["update","enter","merge","exit"],T5=new Set([...gb,...gb.map(t=>`${t}:transition`)]);function CQ(t){return T5.has(t)}function h6(t){mb(CQ(t),`"${t}" is not a valid lifecycle event. Expected one of: ${[...T5].join(", ")}`)}function AQ(t,e,n){const o=t.exit(),r={update:t,enter:e,merge:e.merge(t),exit:o};return gb.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 $Q(t,e){for(const n of e)n(t)}function TQ(t,e){return e.map(n=>{const o=t.transition();return n(o),OQ(o)})}function OQ(t){return t.end().then(()=>{},()=>{})}class MQ{constructor(e,n){xn(this,"base");xn(this,"dataBindFn");xn(this,"insertFn");xn(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){h6(e);const o=this.handlers.get(e)??[];return o.push(n),this.handlers.set(e,o),this}off(e,n){if(h6(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=AQ(n,r,this.handlers),s=[];for(const a of i){$Q(a.selection,a.handlers);const l=TQ(a.selection,a.transitionHandlers);s.push(...l)}return Promise.all(s).then(()=>{})}}function BQ(t,e,n,o){if(n&&o){const i=new MQ(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 LQ(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 PQ(t,e){const n=[];for(const o of t.values())n.push(o.draw(e));return n}function DQ(t,e){const n=[];for(const o of t.values()){const r=o.draw(e);r&&n.push(r)}return n}const EQ=["preDraw","postDraw","postTransition"];class mo{constructor(e){xn(this,"base");xn(this,"layers",new Map);xn(this,"attachments",new Map);xn(this,"configs",new SQ);xn(this,"dispatcher");xn(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=v2(...EQ),this.initialize()}initialize(){}transform(e){return e}preDraw(e){}postDraw(e){}postTransition(e){}layer(e,n,o){return BQ(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 LQ(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=PQ(this.layers,n),r=DQ(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 IQ extends mo{initialize(){const e=this.base.append("div").attr("class","bc-frame"),n=e.append("div").attr("class","bc-frame-header");e.append("div").attr("class","bc-frame-body"),e.append("p").attr("class","bc-frame-note");const o=e.append("div").attr("class","bc-frame-footer").style("display","flex").style("justify-content","space-between").style("align-items","center").style("flex-wrap","wrap").style("gap","0.25rem 1rem"),r=o.append("div").attr("class","bc-frame-footer-left").style("display","flex").style("flex-wrap","wrap").style("gap","0.25rem 0.75rem"),i=o.append("div").attr("class","bc-frame-footer-right").style("display","flex").style("align-items","center");this.layer("headerItems",n,{dataBind:(s,a)=>s.selectAll(".bc-frame-header-item").data(a.headerItems,l=>l.className),insert:s=>s.append(a=>document.createElement(a.tag)),events:{enter:s=>{s.attr("class",a=>a.className).text(a=>a.text)},merge:s=>{s.attr("class",a=>a.className).text(a=>a.text)},exit:s=>{s.remove()}}}),this.layer("footerLeftItems",r,{dataBind:(s,a)=>s.selectAll(".bc-frame-footer-item").data(a.footerLeftItems,l=>l.className),insert:s=>s.append(a=>document.createElement(a.tag)),events:{enter:s=>{s.attr("class",a=>a.className).each(function(a){if(this.textContent="",a.prefix){const l=document.createElement("span");l.className="bc-frame-source-prefix",l.textContent=a.prefix,this.appendChild(l)}if(a.href){const l=document.createElement("a");l.className="bc-frame-source-link",l.href=a.href,l.textContent=a.text,this.appendChild(l)}else this.appendChild(document.createTextNode(a.text))})},merge:s=>{s.attr("class",a=>a.className).each(function(a){if(this.textContent="",a.prefix){const l=document.createElement("span");l.className="bc-frame-source-prefix",l.textContent=a.prefix,this.appendChild(l)}if(a.href){const l=document.createElement("a");l.className="bc-frame-source-link",l.href=a.href,l.textContent=a.text,this.appendChild(l)}else this.appendChild(document.createTextNode(a.text))})},exit:s=>{s.remove()}}}),this.layer("footerRightItems",i,{dataBind:(s,a)=>s.selectAll(".bc-frame-footer-item").data(a.footerRightItems,l=>l.className),insert:s=>s.append(a=>document.createElement(a.tag)),events:{enter:s=>{s.attr("class",a=>a.className).each(function(a){if(a.html){const c=document.createRange().createContextualFragment(a.html);this.appendChild(c)}else this.textContent=a.text}),s.filter(a=>!!a.href).attr("href",a=>a.href),s.filter(a=>!!a.target).attr("target",a=>a.target),s.filter(a=>!!a.rel).attr("rel",a=>a.rel)},merge:s=>{s.attr("class",a=>a.className).each(function(a){if(this.textContent="",a.html){const c=document.createRange().createContextualFragment(a.html);this.appendChild(c)}else this.textContent=a.text}),s.filter(a=>!!a.href).attr("href",a=>a.href),s.filter(a=>!!a.target).attr("target",a=>a.target),s.filter(a=>!!a.rel).attr("rel",a=>a.rel)},exit:s=>{s.remove()}}})}}function NQ(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 RQ(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 FQ='<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 VQ(){return[{tag:"a",className:"bc-frame-credit",text:"Blueprint Chart",html:FQ+"Blueprint Chart",href:"/",target:"_blank",rel:"noopener noreferrer"}]}function ti(t,e){if(e===null)return{wrapper:t,header:t,body:t,footer:t};const n=e??{};new IQ($e(t)).draw({headerItems:NQ(n),footerLeftItems:RQ(n),footerRightItems:VQ()});const r=t.querySelector(".bc-frame"),i=r.querySelector(".bc-frame-header"),s=r.querySelector(".bc-frame-body"),a=r.querySelector(".bc-frame-note"),l=r.querySelector(".bc-frame-footer");if(n.padding&&r.style.setProperty("--bc-frame-padding",n.padding),n.transparentBackground&&r.style.setProperty("--bc-frame-bg","transparent"),n.note?a.textContent=n.note:a.style.display="none",t.isConnected){const c=getComputedStyle(t),u=c.aspectRatio&&c.aspectRatio!=="auto"&&c.aspectRatio!=="",d=c.display==="flex"&&c.flexDirection==="column";if(u||d){const f=i.offsetHeight,h=l.offsetHeight,m=a.style.display!=="none"?a.offsetHeight:0;r.classList.add("bc-frame--constrained"),s.dataset.headerH=String(f);const b=t;s.dataset.footerH=String(b.__bcFooterH??h+m),requestAnimationFrame(()=>{b.__bcFooterH=l.offsetHeight+(a.style.display!=="none"?a.offsetHeight:0)})}}return{wrapper:r,header:i,body:s,footer:l}}function p6(t){return t&&(t.startsWith("(")&&t.endsWith(")")?t.slice(0,-1):t)}function zQ(t){if(!t)return{prefix:"",d3Spec:"",suffix:""};if(t.includes("|")){const e=t.split("|");return{prefix:e[0]??"",d3Spec:p6(e[1]??""),suffix:e[2]??""}}return{prefix:"",d3Spec:p6(t),suffix:""}}function qa(t){if(!t)return null;const{prefix:e,d3Spec:n,suffix:o}=zQ(t);if(!n)return null;const r=Iu(n);return!e&&!o?r:i=>`${e}${r(i)}${o}`}function Jm(t,e){return!Number.isFinite(e)||e<=0?"0%":`${Math.round(t/e*100)}%`}function Ri(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 HQ={top:12,right:20,bottom:24,left:50},O5=600,M5=400;class WQ extends mo{initialize(){this.configDefine("totalWidth",{defaultValue:O5}),this.configDefine("totalHeight",{defaultValue:M5}),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 UQ=400,m6=2,b0=2,y0=9;function hc(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"?rl().domain([s,a]).nice():Bn().domain([s,a]).nice(),c=l.ticks(),u=n?qa(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)+b0+y0}}catch{}return Math.max(...d.map(h=>h.length))*6+b0+y0}function eg(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)+b0+y0}}catch{}return Math.max(...t.map(n=>n.length))*6+b0+y0}function Fi(t,e,n,o,r,i){const s={},a=r??50,l=o??"left",c=e??"auto",u=c==="auto"?t>0&&t<UQ?"inside":"outside":c,d=u==="inside",f=u==="off";return l==="right"?(s.left=0,d?s.right=m6:f?s.right=0:s.right=a):(s.right=i!==!1?15:0,d?s.left=m6:f?s.left=0:s.left=a),d&&(s.top=35),(i===!1||n==="inside"||n==="off")&&(s.bottom=5),s}function dr(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 ni(t,e){const n={...HQ,...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=dr(t),i=r.width>0?r.width:O5,s=r.height>0?r.height:M5,a=i-n.left-n.right,l=s-n.top-n.bottom,c=new WQ($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 pc(t){return typeof window>"u"||typeof window.matchMedia!="function"?t:window.matchMedia("(prefers-reduced-motion: reduce)").matches?0:t}const Fu=500;let B5=0;function oi(t){B5=t?Fu:0}function Ct(){return pc(B5)}function Yo(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=Ct();if(i>0)$e(r).transition().duration(i).attrTween("transform",()=>{const s=lo(n,0),a=lo(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 Dr(t,e){const n=pc(Fu);n<=0||typeof t.animate!="function"||t.animate([{opacity:0},{opacity:1}],{duration:n,easing:"ease-in-out"})}function Er(t,e){const n=pc(Fu);if(t.querySelectorAll("[data-bc-fade-overlay]").forEach(r=>{typeof r.getAnimations=="function"&&r.getAnimations().forEach(i=>i.cancel()),r.remove()}),n<=0||t.children.length===0)return null;const o=document.createElement("div");return o.style.position="absolute",o.style.inset="0",o.style.pointerEvents="none",o.style.display="flex",o.style.flexDirection="column",o.dataset.bcFadeOverlay="true",Array.from(t.childNodes).forEach(r=>{o.appendChild(r.cloneNode(!0))}),o.querySelectorAll(".bc-axis-vertical, .bc-axis-horizontal").forEach(r=>{r.remove()}),o.querySelectorAll(".bc-frame-footer, .bc-frame-note").forEach(r=>{r.remove()}),o.querySelectorAll("[data-bc-fade-overlay], .bc-frame--fade-snapshot").forEach(r=>{r.remove()}),o.querySelectorAll(".bc-frame").forEach(r=>{r.classList.remove("bc-frame"),r.classList.add("bc-frame--fade-snapshot")}),o}function Ir(t,e,n){const o=pc(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 g6=30;class GQ extends mo{initialize(){this.configDefine("scale",{defaultValue:Bn()}),this.configDefine("direction",{defaultValue:di.Left}),this.configDefine("showAxis",{defaultValue:!0}),this.configDefine("showTicks",{defaultValue:!1}),this.configDefine("gridStyle",{defaultValue:Xn.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:an.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===di.Right?F8(o):V8(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/g6));u.ticks(b)}const f=this.config("tickFormat");if(f)u.tickFormat(f);else{const b=this.config("numberFormat"),g=b?qa(b):null;g&&u.tickFormat(g)}const h=Ct(),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===an.Auto?l>0&&l<400?an.Inside:an.Outside:a;if(g===an.Inside){const v=i?4:0,y=h>0?n.selectAll(".tick text"):$e(m).selectAll(".tick text");r===di.Right?y.attr("x",-v).attr("dy","-0.4em").attr("text-anchor","end"):y.attr("x",v).attr("dy","-0.4em").attr("text-anchor","start")}else g===an.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===di.Right?F8(o):V8(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/g6));c.ticks(g)}const d=this.config("tickFormat");if(d)c.tickFormat(d);else{const g=this.config("numberFormat"),v=g?qa(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===an.Auto?s>0&&s<400?an.Inside:an.Outside:i;if(b===an.Inside){const g=f?4:0;if(r===di.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===di.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===an.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!==Xn.None&&n>0){const i=o===di.Right?-n:n;qQ(r,e,i)}}}function qQ(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===Xn.Dashed?c.attr("stroke-dasharray","4,4"):e===Xn.Dotted&&c.attr("stroke-dasharray","1,3")})}function L5(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var xp={exports:{}},YQ=xp.exports,v6;function jQ(){return v6||(v6=1,(function(t,e){(function(n,o){t.exports=o()})(YQ,(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(P){var B=["th","st","nd","rd"],V=P%100;return"["+P+(B[(V-20)%10]||B[V]||B[0])+"]"}},x=function(P,B,V){var z=String(P);return!z||z.length>=B?P:""+Array(B+1-z.length).join(V)+P},_={s:x,z:function(P){var B=-P.utcOffset(),V=Math.abs(B),z=Math.floor(V/60),G=V%60;return(B<=0?"+":"-")+x(z,2,"0")+":"+x(G,2,"0")},m:function P(B,V){if(B.date()<V.date())return-P(V,B);var z=12*(V.year()-B.year())+(V.month()-B.month()),G=B.clone().add(z,d),K=V-G<0,ne=B.clone().add(z+(K?-1:1),d);return+(-(z+(V-G)/(K?G-ne:ne-G))||0)},a:function(P){return P<0?Math.ceil(P)||0:Math.floor(P)},p:function(P){return{M:d,y:h,w:u,d:c,D:m,h:l,m:a,s,ms:i,Q:f}[P]||String(P||"").toLowerCase().replace(/s$/,"")},u:function(P){return P===void 0}},C="en",D={};D[C]=y;var M="$isDayjsObject",$=function(P){return P instanceof T||!(!P||!P[M])},L=function P(B,V,z){var G;if(!B)return C;if(typeof B=="string"){var K=B.toLowerCase();D[K]&&(G=K),V&&(D[K]=V,G=K);var ne=B.split("-");if(!G&&ne.length>1)return P(ne[0])}else{var ae=B.name;D[ae]=B,G=ae}return!z&&G&&(C=G),G||!z&&C},E=function(P,B){if($(P))return P.clone();var V=typeof B=="object"?B:{};return V.date=P,V.args=arguments,new T(V)},N=_;N.l=L,N.i=$,N.w=function(P,B){return E(P,{locale:B.$L,utc:B.$u,x:B.$x,$offset:B.$offset})};var T=(function(){function P(V){this.$L=L(V.locale,null,!0),this.parse(V),this.$x=this.$x||V.x||{},this[M]=!0}var B=P.prototype;return B.parse=function(V){this.$d=(function(z){var G=z.date,K=z.utc;if(G===null)return new Date(NaN);if(N.u(G))return new Date;if(G instanceof Date)return new Date(G);if(typeof G=="string"&&!/Z$/i.test(G)){var ne=G.match(g);if(ne){var ae=ne[2]-1||0,he=(ne[7]||"0").substring(0,3);return K?new Date(Date.UTC(ne[1],ae,ne[3]||1,ne[4]||0,ne[5]||0,ne[6]||0,he)):new Date(ne[1],ae,ne[3]||1,ne[4]||0,ne[5]||0,ne[6]||0,he)}}return new Date(G)})(V),this.init()},B.init=function(){var V=this.$d;this.$y=V.getFullYear(),this.$M=V.getMonth(),this.$D=V.getDate(),this.$W=V.getDay(),this.$H=V.getHours(),this.$m=V.getMinutes(),this.$s=V.getSeconds(),this.$ms=V.getMilliseconds()},B.$utils=function(){return N},B.isValid=function(){return this.$d.toString()!==b},B.isSame=function(V,z){var G=E(V);return this.startOf(z)<=G&&G<=this.endOf(z)},B.isAfter=function(V,z){return E(V)<this.startOf(z)},B.isBefore=function(V,z){return this.endOf(z)<E(V)},B.$g=function(V,z,G){return N.u(V)?this[z]:this.set(G,V)},B.unix=function(){return Math.floor(this.valueOf()/1e3)},B.valueOf=function(){return this.$d.getTime()},B.startOf=function(V,z){var G=this,K=!!N.u(z)||z,ne=N.p(V),ae=function(re,ve){var ce=N.w(G.$u?Date.UTC(G.$y,ve,re):new Date(G.$y,ve,re),G);return K?ce:ce.endOf(c)},he=function(re,ve){return N.w(G.toDate()[re].apply(G.toDate("s"),(K?[0,0,0,0]:[23,59,59,999]).slice(ve)),G)},ge=this.$W,le=this.$M,fe=this.$D,we="set"+(this.$u?"UTC":"");switch(ne){case h:return K?ae(1,0):ae(31,11);case d:return K?ae(1,le):ae(0,le+1);case u:var Z=this.$locale().weekStart||0,be=(ge<Z?ge+7:ge)-Z;return ae(K?fe-be:fe+(6-be),le);case c:case m:return he(we+"Hours",0);case l:return he(we+"Minutes",1);case a:return he(we+"Seconds",2);case s:return he(we+"Milliseconds",3);default:return this.clone()}},B.endOf=function(V){return this.startOf(V,!1)},B.$set=function(V,z){var G,K=N.p(V),ne="set"+(this.$u?"UTC":""),ae=(G={},G[c]=ne+"Date",G[m]=ne+"Date",G[d]=ne+"Month",G[h]=ne+"FullYear",G[l]=ne+"Hours",G[a]=ne+"Minutes",G[s]=ne+"Seconds",G[i]=ne+"Milliseconds",G)[K],he=K===c?this.$D+(z-this.$W):z;if(K===d||K===h){var ge=this.clone().set(m,1);ge.$d[ae](he),ge.init(),this.$d=ge.set(m,Math.min(this.$D,ge.daysInMonth())).$d}else ae&&this.$d[ae](he);return this.init(),this},B.set=function(V,z){return this.clone().$set(V,z)},B.get=function(V){return this[N.p(V)]()},B.add=function(V,z){var G,K=this;V=Number(V);var ne=N.p(z),ae=function(le){var fe=E(K);return N.w(fe.date(fe.date()+Math.round(le*V)),K)};if(ne===d)return this.set(d,this.$M+V);if(ne===h)return this.set(h,this.$y+V);if(ne===c)return ae(1);if(ne===u)return ae(7);var he=(G={},G[a]=o,G[l]=r,G[s]=n,G)[ne]||1,ge=this.$d.getTime()+V*he;return N.w(ge,this)},B.subtract=function(V,z){return this.add(-1*V,z)},B.format=function(V){var z=this,G=this.$locale();if(!this.isValid())return G.invalidDate||b;var K=V||"YYYY-MM-DDTHH:mm:ssZ",ne=N.z(this),ae=this.$H,he=this.$m,ge=this.$M,le=G.weekdays,fe=G.months,we=G.meridiem,Z=function(ve,ce,I,U){return ve&&(ve[ce]||ve(z,K))||I[ce].slice(0,U)},be=function(ve){return N.s(ae%12||12,ve,"0")},re=we||function(ve,ce,I){var U=ve<12?"AM":"PM";return I?U.toLowerCase():U};return K.replace(v,(function(ve,ce){return ce||(function(I){switch(I){case"YY":return String(z.$y).slice(-2);case"YYYY":return N.s(z.$y,4,"0");case"M":return ge+1;case"MM":return N.s(ge+1,2,"0");case"MMM":return Z(G.monthsShort,ge,fe,3);case"MMMM":return Z(fe,ge);case"D":return z.$D;case"DD":return N.s(z.$D,2,"0");case"d":return String(z.$W);case"dd":return Z(G.weekdaysMin,z.$W,le,2);case"ddd":return Z(G.weekdaysShort,z.$W,le,3);case"dddd":return le[z.$W];case"H":return String(ae);case"HH":return N.s(ae,2,"0");case"h":return be(1);case"hh":return be(2);case"a":return re(ae,he,!0);case"A":return re(ae,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 ne}return null})(ve)||ne.replace(":","")}))},B.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},B.diff=function(V,z,G){var K,ne=this,ae=N.p(z),he=E(V),ge=(he.utcOffset()-this.utcOffset())*o,le=this-he,fe=function(){return N.m(ne,he)};switch(ae){case h:K=fe()/12;break;case d:K=fe();break;case f:K=fe()/3;break;case u:K=(le-ge)/6048e5;break;case c:K=(le-ge)/864e5;break;case l:K=le/r;break;case a:K=le/o;break;case s:K=le/n;break;default:K=le}return G?K:N.a(K)},B.daysInMonth=function(){return this.endOf(d).$D},B.$locale=function(){return D[this.$L]},B.locale=function(V,z){if(!V)return this.$L;var G=this.clone(),K=L(V,z,!0);return K&&(G.$L=K),G},B.clone=function(){return N.w(this.$d,this)},B.toDate=function(){return new Date(this.valueOf())},B.toJSON=function(){return this.isValid()?this.toISOString():null},B.toISOString=function(){return this.$d.toISOString()},B.toString=function(){return this.$d.toUTCString()},P})(),O=T.prototype;return E.prototype=O,[["$ms",i],["$s",s],["$m",a],["$H",l],["$W",c],["$M",d],["$y",h],["$D",m]].forEach((function(P){O[P[1]]=function(B){return this.$g(B,P[0],P[1])}})),E.extend=function(P,B){return P.$i||(P(B,T,E),P.$i=!0),E},E.locale=L,E.isDayjs=$,E.unix=function(P){return E(1e3*P)},E.en=D[C],E.Ls=D,E.p={},E}))})(xp)),xp.exports}var KQ=jQ();const Xc=L5(KQ);var wp={exports:{}},XQ=wp.exports,b6;function ZQ(){return b6||(b6=1,(function(t,e){(function(n,o){t.exports=o()})(XQ,(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(E,N,T){var O=T&&T.toUpperCase();return N||y[T]||n[T]||y[O].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(P,B,V){return B||V.slice(1)}))}))).match(o),_=x.length,C=0;C<_;C+=1){var D=x[C],M=m[D],$=M&&M[0],L=M&&M[1];x[C]=L?{regex:$,parser:L}:D.replace(/^\[|\]$/g,"")}return function(E){for(var N={},T=0,O=0;T<_;T+=1){var P=x[T];if(typeof P=="string")O+=P.length;else{var B=P.regex,V=P.parser,z=E.slice(O),G=B.exec(z)[0];V.call(N,G),E=E.replace(G,"")}}return(function(K){var ne=K.afternoon;if(ne!==void 0){var ae=K.hours;ne?ae<12&&(K.hours+=12):ae===12&&(K.hours=0),delete K.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 D=C.date,M=C.utc,$=C.args;this.$u=M;var L=$[1];if(typeof L=="string"){var E=$[2]===!0,N=$[3]===!0,T=E||N,O=$[2];N&&(O=$[2]),l=this.$locale(),!E&&O&&(l=y.Ls[O]),this.$d=(function(z,G,K,ne){try{if(["x","X"].indexOf(G)>-1)return new Date((G==="X"?1e3:1)*z);var ae=b(G)(z),he=ae.year,ge=ae.month,le=ae.day,fe=ae.hours,we=ae.minutes,Z=ae.seconds,be=ae.milliseconds,re=ae.zone,ve=ae.week,ce=new Date,I=le||(he||ge?1:ce.getDate()),U=he||ce.getFullYear(),j=0;he&&!ge||(j=ge>0?ge-1:ce.getMonth());var ee,ie=fe||0,de=we||0,ke=Z||0,X=be||0;return re?new Date(Date.UTC(U,j,I,ie,de,ke,X+60*re.offset*1e3)):K?new Date(Date.UTC(U,j,I,ie,de,ke,X)):(ee=new Date(U,j,I,ie,de,ke,X),ve&&(ee=ne(ee).week(ve).toDate()),ee)}catch{return new Date("")}})(D,L,M,y),this.init(),O&&O!==!0&&(this.$L=this.locale(O).$L),T&&D!=this.format(L)&&(this.$d=new Date("")),l={}}else if(L instanceof Array)for(var P=L.length,B=1;B<=P;B+=1){$[1]=L[B-1];var V=y.apply(this,$);if(V.isValid()){this.$d=V.$d,this.$L=V.$L,this.init();break}B===P&&(this.$d=new Date(""))}else _.call(this,C)}}}))})(wp)),wp.exports}var QQ=ZQ();const JQ=L5(QQ);Xc.extend(JQ);const P5=["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 eJ(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 x0(t){return new Date(Date.UTC(t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()))}function tJ(t){const e=t.trim();if(!e)return null;if(/^\d{4}$/.test(e)){const n=Xc(e,"YYYY",!0);return n.isValid()?x0(n):null}for(const n of P5){if(n==="YYYY")continue;const o=Xc(e,n,!0);if(o.isValid())return x0(o)}return null}function wf(t){const e=t.trim();if(!e)return;const n=tJ(e);if(n)return n.getTime();const o=parseFloat(e);if(!isNaN(o))return o}function tg(t){if(t.length===0)return null;const e=[];let n=null;const o=t[0].trim();if(!o)return null;if(/^\d{4}$/.test(o)){for(const i of t){const s=i.trim();if(!/^\d{4}$/.test(s))return null;const a=Xc(s,"YYYY",!0);if(!a.isValid())return null;e.push(x0(a))}return{dates:e,granularity:"year"}}const r=[];for(const i of P5)i!=="YYYY"&&Xc(o,i,!0).isValid()&&r.push(i);if(r.length===0)return null;for(const i of r){const s=[];let a=!0;for(const l of t){const c=Xc(l.trim(),i,!0);if(!c.isValid()){a=!1;break}s.push(x0(c))}if(a){n=i,e.push(...s);break}}return n?{dates:e,granularity:eJ(n)}:null}const nJ=60,jd=10,M2=1.3,oJ=12,rJ=3,iJ=14,sJ=10;function aJ(t,e,n=rJ){if(t==="")return[""];if(t.length*jd<=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*jd>e)return null;const a=i?`${i} ${s}`:s;if(a.length*jd<=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 lJ={year:"%Y",month:"%b %Y",day:"%b %-d, %Y",datetime:"%b %-d, %Y %H:%M"};function cJ(t){return typeof t.step=="function"}function D5(t,e){const n=tg(e);if(t&&t.includes("%")){if(n){const o=gf(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 qa(t)??Iu(t);if(n){const o=gf(lJ[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 Kf(t,e){let n=0;for(const o of t){const i=(e?e(o):o).length*jd;i>n&&(n=i)}return n}function uJ(t,e,n){if(t.length<=1)return t;const o=n?Kf(t,n):t.reduce((c,u)=>Math.max(c,u.length),0)*jd,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 dJ(t,e,n,o){if(t.length<=1||e<=0||n==="horizontal")return!1;if(n==="vertical")return!0;if(tg(t))return!1;const r=Kf(t,o??null),i=e/t.length;return r>i*M2}function fJ(t,e){if(t.length===0)return 0;const n=Kf(t,e??null);return Math.ceil(n)+oJ}function hJ(t){let e=1;for(const n of t)n.length>e&&(e=n.length);return e<=1?0:e*iJ+sJ}function B2(t,e,n={},o=24){if(t.length===0||e<=0||n.labelPosition==="off"||n.labelPosition==="inside")return;const r=n.tickFormat?n.tickFormat:D5(n.numberFormat??null,t),i=n.labelRotation??"auto";if(!(i!=="vertical"&&tg(t)!==null)&&t.length>1){const u=e/t.length*M2,f=Kf(t,r)>u;if(i!=="vertical"&&f){const h=E5(t,u,r);if(h){const m=hJ(Array.from(h.values()));return m>o?m:void 0}}}if(!dJ(t,e,i,r))return;const l=fJ(t,r);return l>o?l:void 0}function E5(t,e,n){const o=new Map;let r=!1;for(const i of t){const s=n?n(i):i,a=aJ(s,e);if(a===null)return null;o.set(i,a),a.length>1&&(r=!0)}return r?o:null}function pJ(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 mJ extends mo{initialize(){this.configDefine("scale",{defaultValue:oo()}),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"?dj(o):fj(o);this.config("showTicks")||h.tickSizeOuter(0);const m=f||D5(u,d);m&&h.tickFormat(m);const b=cJ(r),g=b?r.domain():[],v=b&&l!=="vertical"&&tg(g)!==null;let y=null,x=!1;if(b&&!v&&g.length>1&&c>0){const N=c/g.length*M2,O=Kf(g,m)>N;l==="vertical"?x=!0:O&&(y=E5(g,N,m),!y&&l==="auto"&&(x=!0))}let _=this.config("ticks");if(!_&&c>0)if(b){if(v){const E=uJ(g,c,m);E.length<g.length&&(_=E)}}else{const E=Math.max(2,Math.floor(c/nJ));h.ticks(E)}_&&h.tickValues(_);const C=i==="above"?0:s,D=e.node(),M=n==="merge"?Ct():0;if(n==="merge"){if(!D)return;M>0?(e.attr("transform",`translate(0,${C})`),e.duration(M).call(h)):$e(D).attr("transform",`translate(0,${C})`).call(h)}else e.attr("transform",`translate(0,${C})`),e.call(h);const $=M>0?e:D?$e(D):e;if(!this.config("showAxis"))$.select(".domain").remove();else if(n==="enter"){const E=this.config("zeroY");if(E!=null){const N=E-(i==="above"?0:s);$.select(".domain").attr("transform",`translate(0,${N})`)}}this.config("showTicks")||$.selectAll(".tick line").remove();const L=a==="auto"?"outside":a;L==="off"?$.selectAll(".tick text").remove():L==="inside"&&$.selectAll(".tick text").attr("y",0).attr("dy","-0.6em"),x&&L!=="off"?$.selectAll(".tick text").attr("transform","rotate(-90)").attr("text-anchor","end").attr("x",i==="above"?9:-9).attr("y",0).attr("dy","0.32em"):$.selectAll(".tick text").attr("transform",null),y&&L!=="off"&&pJ($,y)}postDraw(){const e=this.config("gridStyle"),n=this.config("height"),o=this.base.select(".bc-axis-horizontal").node();o&&e!=="none"&&n>0&&gJ(o,e,n)}}function gJ(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 I5=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"],vJ=200,y6=.2;class bJ extends mo{initialize(){this.configDefine("colors",{defaultValue:I5}),this.configDefine("yOffset",{defaultValue:-10}),this.configDefine("layout",{defaultValue:"horizontal"}),this.configDefine("valueSuffixes",{defaultValue:[]}),this.configDefine("maxWidth",{defaultValue:0});const e=this.base.append("g").attr("class","bc-legend"),n=o=>{var f,h;const r=this.config("colors"),i=this.config("layout"),s=this.config("valueSuffixes"),a=((h=(f=this.base.node())==null?void 0:f.ownerSVGElement)==null?void 0:h.parentElement)??document.documentElement,l=getComputedStyle(a).getPropertyValue("--bc-text-color").trim()||"#555",c=this.config("maxWidth");let u=0,d=0;o.each(function(m,b){const g=$e(this),v=s[b],x=16+(v?m.length+1+v.length:m.length)*7+12;i==="horizontal"&&c>0&&u>0&&u+x>c&&(u=0,d+=20),g.attr("transform",`translate(${u},${d})`).attr("data-series",m).style("cursor","default");let _=g.select("rect");_.empty()&&(_=g.append("rect").attr("width",12).attr("height",12)),_.attr("fill",r[b%r.length]);let C=g.select("text");C.empty()&&(C=g.append("text").attr("x",16).attr("y",10).attr("font-size","12px")),C.attr("fill",l),C.selectAll("tspan").remove(),v?(C.text(null),C.append("tspan").attr("font-weight","bold").text(m),C.append("tspan").text(` ${v}`)):C.text(m),i==="vertical"?d+=20:u+=x})};this.layer("items",e,{dataBind:(o,r)=>o.selectAll(".bc-legend-item").data(r,i=>i),insert:o=>o.append("g").attr("class","bc-legend-item"),events:{enter:n,update:n}})}preDraw(){const e=this.config("yOffset");this.base.select(".bc-legend").attr("transform",`translate(0,${e})`)}}function yJ(t){const e=$e(t).selectAll(".bc-legend-item");if(e.empty())return;let n=null,o=null;function r(s){o=s,e.each(function(){const l=$e(this),c=l.attr("data-series")===s;l.transition().duration(150).style("opacity",c?1:y6)}),$e(t).selectAll("[data-series]").filter(function(){return!this.closest(".bc-legend")}).each(function(){const l=$e(this),c=l.attr("data-series")===s,u=this.classList.contains("bc-direct-label")||this.classList.contains("bc-value-label");l.transition().duration(150).style("opacity",c?1:u?0:y6)})}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.on("mouseenter.bcHighlight",null).on("mouseleave.bcHighlight",null).on("mouseenter.bcHighlight",function(){const s=$e(this).attr("data-series")??"";n&&clearTimeout(n),n=setTimeout(()=>r(s),pc(vJ))}).on("mouseleave.bcHighlight",()=>{n&&(clearTimeout(n),n=null),o!==null&&i()})}function il(t,e,n=I5,o=-10,r="top",i="start",s=0,a=0,l=0,c=[],u={}){const d=r==="left"||r==="right"?"vertical":"horizontal",f=new bJ($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,D)=>{const M=c[D];return M?C.length+1+M.length:C.length});if(d==="horizontal"){const C=g.map(L=>16+L*7+12);let D=1,M=0,$=0;for(const L of C)s>0&&M>0&&M+L>s?($=Math.max($,M),D++,M=L):M+=L;$=Math.max($,M),m=$,b=D*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 yJ(t),h}const N5=[{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"]}],xJ=Object.fromEntries(N5.map(t=>[t.name,t.colors]));function R5(t){if(!t)return;const e=xJ[t];return e?[...e]:void 0}function F5(){return N5}function ng(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=wf(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 _f=60;function mc(t){const e=Number.isFinite(t)?Math.max(0,Math.min(100,t)):_f;return e/(e+100)}function Vu(t,e,n){let o=0,r=0,i=1/0,s=!0,a=!1;for(const u of t)Number.isFinite(u)&&(a=!0,u<o&&(o=u),u>r&&(r=u),u<=0?s=!1:u<i&&(i=u));n===yu.Log&&a&&s&&(o=i);let l=(e==null?void 0:e.min)??o,c=(e==null?void 0:e.max)??r;if(l>c&&([l,c]=[c,l]),l===c)if(l===0)c=1;else{const u=Math.abs(l)*.1;l=l-u,c=c+u}return[l,c]}function wJ(t){return typeof t.step=="function"}const Oh=new WeakMap;class Nr{constructor(e){xn(this,"vGroup",null);xn(this,"hGroup",null);xn(this,"vChart",null);xn(this,"hChart",null);xn(this,"container");xn(this,"initialized",!1);this.container=e}static for(e){let n=Oh.get(e);return n||(n=new Nr(e),Oh.set(e,n)),n}static clear(e){Oh.delete(e)}detach(){var e,n;(e=this.vGroup)!=null&&e.parentNode&&($e(this.vGroup).interrupt().selectAll("*").interrupt(),this.vGroup.querySelectorAll(".bc-grid-line").forEach(o=>o.remove()),this.vGroup.remove()),(n=this.hGroup)!=null&&n.parentNode&&($e(this.hGroup).interrupt().selectAll("*").interrupt(),this.hGroup.querySelectorAll(".bc-grid-line").forEach(o=>o.remove()),this.hGroup.remove())}attach(e,n){if(!this.initialized)this.vGroup=document.createElementNS("http://www.w3.org/2000/svg","g"),this.vGroup.setAttribute("class","bc-axis-service-v"),this.hGroup=document.createElementNS("http://www.w3.org/2000/svg","g"),this.hGroup.setAttribute("class","bc-axis-service-h"),e.appendChild(this.vGroup),e.appendChild(this.hGroup),this.vChart=new GQ($e(this.vGroup)),this.hChart=new mJ($e(this.hGroup)),this.initialized=!0;else{for(const r of[this.vGroup,this.hGroup])$e(r).selectAll(".tick").interrupt();e.appendChild(this.vGroup),e.appendChild(this.hGroup);const o=1;if(n&&(Math.abs(n.dx)>=o||Math.abs(n.dy)>=o)){const{dx:r,dy:i}=n;for(const s of[this.vGroup,this.hGroup]){s.setAttribute("transform",`translate(${r},${i})`);const a=Ct();a>0?$e(s).transition().duration(a).attrTween("transform",()=>{const l=lo(r,0),c=lo(i,0);return u=>`translate(${l(u)},${c(u)})`}):s.removeAttribute("transform")}}}}update(e){const n=e.order??"vertical-first";n==="horizontal-first"?(this.updateHorizontal(e.horizontal),this.updateVertical(e.vertical)):(this.updateVertical(e.vertical),this.updateHorizontal(e.horizontal)),n==="horizontal-first"?this.hGroup&&this.vGroup&&this.hGroup.parentNode&&this.hGroup.parentNode.insertBefore(this.hGroup,this.vGroup):this.vGroup&&this.hGroup&&this.vGroup.parentNode&&this.vGroup.parentNode.insertBefore(this.vGroup,this.hGroup)}updateVertical(e){if(!this.vChart||!this.vGroup)return;if(!e){this.vGroup.style.display="none";return}this.vGroup.style.display="";const n=e.options;this.vChart.config({scale:e.scale,direction:n.direction??"left",showAxis:n.showAxis??!0,showTicks:n.showTicks??!1,gridStyle:n.gridStyle??"dashed",gridWidth:n.gridWidth??0,height:e.height,ticks:n.ticks??null,numberFormat:n.numberFormat??null,labelPosition:n.labelPosition??"auto",topPadding:n.topPadding??0,tickFormat:n.tickFormat??null}),this.vChart.draw([{placeholder:!0}]);const o=this.vGroup.querySelector(".bc-axis-vertical");o&&(n.direction??"left")==="right"?o.setAttribute("transform",`translate(${n.gridWidth??0},0)`):o&&o.removeAttribute("transform")}updateHorizontal(e){if(!this.hChart||!this.hGroup)return;if(!e){this.hGroup.style.display="none";return}this.hGroup.style.display="";const n=e.options,o=e.scale,r=wJ(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 vb=Math.min,Zc=Math.max,w0=Math.round,us=t=>({x:t,y:t}),_J={left:"right",right:"left",bottom:"top",top:"bottom"},kJ={start:"end",end:"start"};function x6(t,e,n){return Zc(t,vb(e,n))}function og(t,e){return typeof t=="function"?t(e):t}function Jl(t){return t.split("-")[0]}function rg(t){return t.split("-")[1]}function V5(t){return t==="x"?"y":"x"}function z5(t){return t==="y"?"height":"width"}const SJ=new Set(["top","bottom"]);function La(t){return SJ.has(Jl(t))?"y":"x"}function H5(t){return V5(La(t))}function CJ(t,e,n){n===void 0&&(n=!1);const o=rg(t),r=H5(t),i=z5(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=_0(s)),[s,_0(s)]}function AJ(t){const e=_0(t);return[bb(t),e,bb(e)]}function bb(t){return t.replace(/start|end/g,e=>kJ[e])}const w6=["left","right"],_6=["right","left"],$J=["top","bottom"],TJ=["bottom","top"];function OJ(t,e,n){switch(t){case"top":case"bottom":return n?e?_6:w6:e?w6:_6;case"left":case"right":return e?$J:TJ;default:return[]}}function MJ(t,e,n,o){const r=rg(t);let i=OJ(Jl(t),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),e&&(i=i.concat(i.map(bb)))),i}function _0(t){return t.replace(/left|right|bottom|top/g,e=>_J[e])}function BJ(t){return{top:0,right:0,bottom:0,left:0,...t}}function LJ(t){return typeof t!="number"?BJ(t):{top:t,right:t,bottom:t,left:t}}function k0(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 k6(t,e,n){let{reference:o,floating:r}=t;const i=La(e),s=H5(e),a=z5(s),l=Jl(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(rg(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 PJ(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}=og(e,t),m=LJ(h),g=a[f?d==="floating"?"reference":"floating":d],v=k0(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=k0(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 DJ=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}=k6(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:D}=await y({x:u,y:d,initialPlacement:o,placement:f,strategy:r,middlewareData:h,rects:c,platform:{...s,detectOverflow:(b=s.detectOverflow)!=null?b:PJ},elements:{reference:t,floating:e}});u=x??u,d=_??d,h={...h,[v]:{...h[v],...C}},D&&m<=50&&(m++,typeof D=="object"&&(D.placement&&(f=D.placement),D.rects&&(c=D.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:r}):D.rects),{x:u,y:d}=k6(c,f,l)),g=-1)}return{x:u,y:d,placement:f,strategy:r,middlewareData:h}},EJ=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}=og(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=Jl(r),y=La(a),x=Jl(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=f||(x||!b?[_0(a)]:AJ(a)),D=m!=="none";!f&&D&&C.push(...MJ(a,b,m,_));const M=[a,...C],$=await l.detectOverflow(e,g),L=[];let E=((o=i.flip)==null?void 0:o.overflows)||[];if(u&&L.push($[v]),d){const P=CJ(r,s,_);L.push($[P[0]],$[P[1]])}if(E=[...E,{placement:r,overflows:L}],!L.every(P=>P<=0)){var N,T;const P=(((N=i.flip)==null?void 0:N.index)||0)+1,B=M[P];if(B&&(!(d==="alignment"?y!==La(B):!1)||E.every(G=>La(G.placement)===y?G.overflows[0]>0:!0)))return{data:{index:P,overflows:E},reset:{placement:B}};let V=(T=E.filter(z=>z.overflows[0]<=0).sort((z,G)=>z.overflows[1]-G.overflows[1])[0])==null?void 0:T.placement;if(!V)switch(h){case"bestFit":{var O;const z=(O=E.filter(G=>{if(D){const K=La(G.placement);return K===y||K==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(K=>K>0).reduce((K,ne)=>K+ne,0)]).sort((G,K)=>G[1]-K[1])[0])==null?void 0:O[0];z&&(V=z);break}case"initialPlacement":V=a;break}if(r!==V)return{reset:{placement:V}}}return{}}}},IJ=new Set(["left","top"]);async function NJ(t,e){const{placement:n,platform:o,elements:r}=t,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=Jl(n),a=rg(n),l=La(n)==="y",c=IJ.has(s)?-1:1,u=i&&l?-1:1,d=og(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 RJ=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 NJ(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}}}}},FJ=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}=og(t,e),u={x:n,y:o},d=await i.detectOverflow(e,c),f=La(Jl(r)),h=V5(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=x6(x,m,_)}if(a){const v=f==="y"?"top":"left",y=f==="y"?"bottom":"right",x=b+d[v],_=b-d[y];b=x6(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 ig(){return typeof window<"u"}function zu(t){return W5(t)?(t.nodeName||"").toLowerCase():"#document"}function Tr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function fa(t){var e;return(e=(W5(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function W5(t){return ig()?t instanceof Node||t instanceof Tr(t).Node:!1}function Pi(t){return ig()?t instanceof Element||t instanceof Tr(t).Element:!1}function gs(t){return ig()?t instanceof HTMLElement||t instanceof Tr(t).HTMLElement:!1}function S6(t){return!ig()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Tr(t).ShadowRoot}const VJ=new Set(["inline","contents"]);function Xf(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=Di(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!VJ.has(r)}const zJ=new Set(["table","td","th"]);function HJ(t){return zJ.has(zu(t))}const WJ=[":popover-open",":modal"];function sg(t){return WJ.some(e=>{try{return t.matches(e)}catch{return!1}})}const UJ=["transform","translate","scale","rotate","perspective"],GJ=["transform","translate","scale","rotate","perspective","filter"],qJ=["paint","layout","strict","content"];function L2(t){const e=P2(),n=Pi(t)?Di(t):t;return UJ.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)||GJ.some(o=>(n.willChange||"").includes(o))||qJ.some(o=>(n.contain||"").includes(o))}function YJ(t){let e=Ya(t);for(;gs(e)&&!_u(e);){if(L2(e))return e;if(sg(e))return null;e=Ya(e)}return null}function P2(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const jJ=new Set(["html","body","#document"]);function _u(t){return jJ.has(zu(t))}function Di(t){return Tr(t).getComputedStyle(t)}function ag(t){return Pi(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ya(t){if(zu(t)==="html")return t;const e=t.assignedSlot||t.parentNode||S6(t)&&t.host||fa(t);return S6(e)?e.host:e}function U5(t){const e=Ya(t);return _u(e)?t.ownerDocument?t.ownerDocument.body:t.body:gs(e)&&Xf(e)?e:U5(e)}function G5(t,e,n){var o;e===void 0&&(e=[]);const r=U5(t),i=r===((o=t.ownerDocument)==null?void 0:o.body),s=Tr(r);return i?(yb(s),e.concat(s,s.visualViewport||[],Xf(r)?r:[],[])):e.concat(r,G5(r,[]))}function yb(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function q5(t){const e=Di(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=gs(t),i=r?t.offsetWidth:n,s=r?t.offsetHeight:o,a=w0(n)!==i||w0(o)!==s;return a&&(n=i,o=s),{width:n,height:o,$:a}}function Y5(t){return Pi(t)?t:t.contextElement}function Qc(t){const e=Y5(t);if(!gs(e))return us(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:i}=q5(e);let s=(i?w0(n.width):n.width)/o,a=(i?w0(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const KJ=us(0);function j5(t){const e=Tr(t);return!P2()||!e.visualViewport?KJ:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function XJ(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Tr(t)?!1:e}function kf(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=Y5(t);let s=us(1);e&&(o?Pi(o)&&(s=Qc(o)):s=Qc(t));const a=XJ(i,n,o)?j5(i):us(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=Tr(i),h=o&&Pi(o)?Tr(o):o;let m=f,b=yb(m);for(;b&&o&&h!==m;){const g=Qc(b),v=b.getBoundingClientRect(),y=Di(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=Tr(b),b=yb(m)}}return k0({width:u,height:d,x:l,y:c})}function lg(t,e){const n=ag(t).scrollLeft;return e?e.left+n:kf(fa(t)).left+n}function K5(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-lg(t,n),r=n.top+e.scrollTop;return{x:o,y:r}}function ZJ(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const i=r==="fixed",s=fa(o),a=e?sg(e.floating):!1;if(o===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=us(1);const u=us(0),d=gs(o);if((d||!d&&!i)&&((zu(o)!=="body"||Xf(s))&&(l=ag(o)),gs(o))){const h=kf(o);c=Qc(o),u.x=h.x+o.clientLeft,u.y=h.y+o.clientTop}const f=s&&!d&&!i?K5(s,l):us(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 QJ(t){return Array.from(t.getClientRects())}function JJ(t){const e=fa(t),n=ag(t),o=t.ownerDocument.body,r=Zc(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=Zc(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+lg(t);const a=-n.scrollTop;return Di(o).direction==="rtl"&&(s+=Zc(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:a}}const C6=25;function eee(t,e){const n=Tr(t),o=fa(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=P2();(!u||u&&e==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}const c=lg(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<=C6&&(i-=m)}else c<=C6&&(i+=c);return{width:i,height:s,x:a,y:l}}const tee=new Set(["absolute","fixed"]);function nee(t,e){const n=kf(t,!0,e==="fixed"),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=gs(t)?Qc(t):us(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 A6(t,e,n){let o;if(e==="viewport")o=eee(t,n);else if(e==="document")o=JJ(fa(t));else if(Pi(e))o=nee(e,n);else{const r=j5(t);o={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return k0(o)}function X5(t,e){const n=Ya(t);return n===e||!Pi(n)||_u(n)?!1:Di(n).position==="fixed"||X5(n,e)}function oee(t,e){const n=e.get(t);if(n)return n;let o=G5(t,[]).filter(a=>Pi(a)&&zu(a)!=="body"),r=null;const i=Di(t).position==="fixed";let s=i?Ya(t):t;for(;Pi(s)&&!_u(s);){const a=Di(s),l=L2(s);!l&&a.position==="fixed"&&(r=null),(i?!l&&!r:!l&&a.position==="static"&&!!r&&tee.has(r.position)||Xf(s)&&!l&&X5(t,s))?o=o.filter(u=>u!==s):r=a,s=Ya(s)}return e.set(t,o),o}function ree(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const s=[...n==="clippingAncestors"?sg(e)?[]:oee(e,this._c):[].concat(n),o],a=s[0],l=s.reduce((c,u)=>{const d=A6(e,u,r);return c.top=Zc(d.top,c.top),c.right=vb(d.right,c.right),c.bottom=vb(d.bottom,c.bottom),c.left=Zc(d.left,c.left),c},A6(e,a,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function iee(t){const{width:e,height:n}=q5(t);return{width:e,height:n}}function see(t,e,n){const o=gs(e),r=fa(e),i=n==="fixed",s=kf(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const l=us(0);function c(){l.x=lg(r)}if(o||!o&&!i)if((zu(e)!=="body"||Xf(r))&&(a=ag(e)),o){const h=kf(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?K5(r,a):us(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 Nv(t){return Di(t).position==="static"}function $6(t,e){if(!gs(t)||Di(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return fa(t)===n&&(n=n.ownerDocument.body),n}function Z5(t,e){const n=Tr(t);if(sg(t))return n;if(!gs(t)){let r=Ya(t);for(;r&&!_u(r);){if(Pi(r)&&!Nv(r))return r;r=Ya(r)}return n}let o=$6(t,e);for(;o&&HJ(o)&&Nv(o);)o=$6(o,e);return o&&_u(o)&&Nv(o)&&!L2(o)?n:o||YJ(t)||n}const aee=async function(t){const e=this.getOffsetParent||Z5,n=this.getDimensions,o=await n(t.floating);return{reference:see(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function lee(t){return Di(t).direction==="rtl"}const cee={convertOffsetParentRelativeRectToViewportRelativeRect:ZJ,getDocumentElement:fa,getClippingRect:ree,getOffsetParent:Z5,getElementRects:aee,getClientRects:QJ,getDimensions:iee,getScale:Qc,isElement:Pi,isRTL:lee},Q5=RJ,J5=FJ,e$=EJ,t$=(t,e,n)=>{const o=new Map,r={platform:cee,...n},i={...r.platform,_c:o};return DJ(t,e,{...r,platform:i})},n$="bc-tooltip";function uee(){if(document.getElementById("bc-tooltip-styles"))return;const t=document.createElement("style");t.id="bc-tooltip-styles",t.textContent=`
|
|
39
|
+
.${n$} {
|
|
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 dee(t){const e=t?qa(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 sl(t){const e=(t==null?void 0:t.format)??dee(t==null?void 0:t.numberFormat);let n=null;const o=[];return{name:"tooltip",install(){uee(),n=document.createElement("div"),n.className=n$,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",t$(a,n,{placement:"top",middleware:[Q5(8),e$(),J5()]}).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 fee(t){switch(t){case gi.Solid:return"none";case gi.Dotted:return"2,2";case gi.Dashed:default:return"4,3"}}function gc(t){const e=(t==null?void 0:t.color)??"#999",n=(t==null?void 0:t.dashArray)??fee(t==null?void 0:t.style),o=(t==null?void 0:t.direction)??Oo.Both,r=(t==null?void 0:t.orientation)??to.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===Oo.Both||o===Oo.Vertical,d=o===Oo.Both||o===Oo.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")),D=parseFloat(y.attr("width")),M=parseFloat(y.attr("y")),$=parseFloat(y.attr("height"));r===to.Horizontal?(x=C+D,_=M+$/2):(x=C+D/2,_=M)}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 D2(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 fr(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=D2(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 ja={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}},T6={N:{nx:0,ny:-1},NE:{nx:1,ny:-1},E:{nx:1,ny:0},SE:{nx:1,ny:1},S:{nx:0,ny:1},SW:{nx:-1,ny:1},W:{nx:-1,ny:0},NW:{nx:-1,ny:-1},center:{nx:0,ny:0}};En.N+"",En.W,En.NE+"",En.NW,En.E+"",En.N,En.SE+"",En.NE,En.S+"",En.E,En.SW+"",En.SE,En.W+"",En.S,En.NW+"",En.SW,En.Center+"",En.Center;function hee(t,e){const n=ja[t]??ja.NW;return{dx:n.dx*e,dy:n.dy*e}}function E2(t){return"step"in t&&!("bandwidth"in t)}function o$(t){if("bandwidth"in t||E2(t))return!1;const e=t.domain();return e.length>0&&e[0]instanceof Date}function r$(t,e){if("bandwidth"in t){const n=t;return(n(e)??0)+n.bandwidth()/2}return E2(t)?t(e)??0:o$(t)?t(new Date(e)):t(Number(e))}function O6(t,e){const n=(e.left+e.right)/2,o=(e.top+e.bottom)/2,r=T6[t]??T6.N;return{x:n+r.nx*(e.right-e.left)/2,y:o+r.ny*(e.bottom-e.top)/2}}function pee(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"?O6(o,{left:h,right:f,top:u,bottom:u+d}):O6(o,{left:u,right:u+d,top:f,bottom:h})}const i=r$(e,t.label),s=n(t.value),a=2,l=ja[o]??ja.N;return{x:i+l.dx*a,y:s+l.dy*a}}function mee(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 I2(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 gee(t){switch(t){case i0.Dotted:return"2,3";case i0.Dashed:return"5,4";default:return""}}function vee(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=gee(o.style??i0.Solid);i&&r.attr("stroke-dasharray",i)}const M6=1/Math.tan(40*Math.PI/180);function bee(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)*M6,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)*M6,12);return{x:t.x+o*r,y:t.y}}function yee(t,e,n){const o=bee(t,e,n);return`M ${t.x} ${t.y} L ${o.x} ${o.y} L ${e.x} ${e.y}`}function xee(t,e,n,o=To.Direct,r={}){var l;let i;switch(o){case To.CurveLeft:case To.CurveRight:{const c=n.x-e.x,u=n.y-e.y,f=Math.sqrt(c*c+u*u)*.8,h=o===To.CurveRight?1:0;i=`M ${e.x} ${e.y} A ${f} ${f} 0 0 ${h} ${n.x} ${n.y}`;break}case To.Elbow:{i=yee(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=I2(c,s);a.attr("marker-end",`url(#${u})`)}}function N2(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)wee(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 wee(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 Mh(t,e,n=zA.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(E2(e)){const o=e(String(t))??0,r=e.step()/2;return n==="start"?o-r:n==="end"?o+r:o}return o$(e)?e(new Date(String(t))):e(Number(t))}function Bh(t,e){return e(Number(t))}function B6(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 R2(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 _ee(t){return t<-4?"end":t>4?"start":"middle"}function L6(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:r$(e,t.label),y:n(t.value)}}function i$(t,e,n,o){const r="target"in e?e.target:void 0;if(!r)return;const i=n.data.find(x=>x.label===r);if(!i)return;const s=t.append("g").attr("data-annotation-index",String(o));e.id&&s.attr("data-annotation-id",e.id);const a=e,l=a.anchorDirection??En.N,c=pee(i,n.scaleX,n.scaleY,l,n.orientation);let u,d;const f=e;if(f.dx!=null||f.dy!=null){const{x,y:_}=L6(i,n.scaleX,n.scaleY);u=x+(Number(f.dx)||40),d=_+(Number(f.dy)||-40)}else if(f.direction!=null&&f.textOffsetX==null){const{x,y:_}=L6(i,n.scaleX,n.scaleY),C=f.direction,D=f.anchorDistance??60,M=hee(C,D);u=x+M.dx,d=_+M.dy}else u=c.x+(a.textOffsetX??-42),d=c.y+(a.textOffsetY??-42);const h=e.circleColor??"#666",m=e;m.showCircle&&vee(s,c.x,c.y,{size:m.circleSize,style:m.circleStyle,color:h});const b=Math.max(4,Math.min(u,n.width-4)),g=Math.max(4,Math.min(d,n.height-4));if(e.text){const x=_ee(u-c.x);N2(s,e.text,b,g-4,{textColor:e.textColor,maxWidth:R2(e.maxWidth,n.width),textAnchor:x,backgroundColor:n.backgroundColor,textOutline:e.textOutline})}if(f.dx!=null||f.dy!=null?a.showLine!==!1:a.showLine===!0||a.showArrow===!0){let x={x:b,y:g},_=!1;const C=s.select(".bc-annotation-text").node();if(C)try{const L=C.getBBox();if(L.width>0&&L.height>0){x=mee(L,c.x,c.y);const E=L.x+L.width/2;_=Math.abs(x.x-E)<1}}catch{}const D=a.showCircle?(a.circleSize??4)+(a.lineTargetDistance??5):a.lineTargetDistance??0;let M=c.x,$=c.y;if(D>0){const L=c.x-x.x,E=c.y-x.y,N=Math.sqrt(L*L+E*E);if(N>0){const T=c.x-L/N*D,O=c.y-E/N*D,P=ja[l]??ja.N;M=Math.abs(P.dx)>.01?T:c.x,$=Math.abs(P.dy)>.01?O:c.y}}xee(s,x,{x:M,y:$},a.lineStyle??To.Direct,{showArrow:a.showArrow,lineWeight:a.lineWeight,color:h,departVertical:_})}}function s$(t,e,n,o,r){if(e.kind!==Ht.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??to.Vertical;let a,l,c,u;if(n.orientation===to.Horizontal)if(s===to.Vertical){const d=Mh(e.start,n.scaleX,e.startAnchor),f=Mh(e.end,n.scaleX,e.endAnchor);l=Math.min(d,f),u=Math.abs(f-d),a=0,c=n.width}else{const d=Bh(e.start,n.scaleY),f=Bh(e.end,n.scaleY);a=Math.min(d,f),c=Math.abs(f-d),l=0,u=n.height}else if(s===to.Vertical){const d=Mh(e.start,n.scaleX,e.startAnchor),f=Mh(e.end,n.scaleX,e.endAnchor);a=Math.min(d,f),c=Math.abs(f-d),l=0,u=n.height}else{const d=Bh(e.start,n.scaleY),f=Bh(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===to.Vertical?c:u,f=R2(e.maxWidth,n.width)??Math.max(d,50),h=e.direction??"center",m=4,b=ja[h]??ja.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,D=r?r.append("g").attr("data-annotation-index",String(o)):i;if(N2(D,e.text,y,C,{textColor:e.textColor,maxWidth:f,textAnchor:x,backgroundColor:n.backgroundColor,textOutline:e.textOutline}),v>.25){const M=D.select(".bc-annotation-text").node();if(M)try{const $=M.getBBox();let L=0;v>.75?L=l+u-m-($.y+$.height):L=l+u/2-($.y+$.height/2),Math.abs(L)>.5&&M.setAttribute("transform",`translate(0, ${L})`)}catch{}}}}function a$(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=B6(e.x,n.width),s=B6(e.y,n.height);if(e.text){N2(r,e.text,i,s,{textColor:e.textColor,maxWidth:R2(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 xb(t,e,n,o){const r=n+.45*(t-n);return`M ${t} ${e} L ${r} ${e} L ${n} ${o}`}function kee(t,e){const n=t.hasAttribute("marker-end"),o=D2(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===To.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($h).attrTween("d",()=>{const c=Yd(l,a);return u=>{const d=c(u);return xb(d.calloutX,d.calloutY,d.tipX,d.tipY)}})}else if(o.style===To.CurveLeft||o.style===To.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===To.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,D=v+_*b*x,M=Math.atan2(a.y-D,a.x-C);let L=Math.atan2(l.y-D,l.x-C)-M;h===1&&L<=0&&(L+=2*Math.PI),h===0&&L>=0&&(L-=2*Math.PI),r.transition().duration(e).ease($h).attrTween("d",()=>E=>{if(E>=.98)return i;const N=M+E*L,T=C+f*Math.cos(N),O=D+f*Math.sin(N);return`M ${a.x} ${a.y} A ${f} ${f} 0 0 ${h} ${T} ${O}`})}else r.transition().duration(e).ease($h).attrTween("d",()=>{const a=lo(o.fromX,o.toX),l=lo(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($h).attr("stroke-dashoffset","0").on("end",()=>{t.removeAttribute("stroke-dasharray"),t.removeAttribute("stroke-dashoffset")})}const Lh=1;function See(t,e){return t.style!==e.style||t.departVertical!==e.departVertical?!1:Math.abs(t.fromX-e.fromX)<=Lh&&Math.abs(t.fromY-e.fromY)<=Lh&&Math.abs(t.toX-e.toX)<=Lh&&Math.abs(t.toY-e.toY)<=Lh}function Cee(t,e,n){const o=D2(t.parentElement);if(!o||See(e,o))return;const r=$e(t);if(e.style===To.Elbow&&o.style===To.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",xb(i.calloutX,i.calloutY,i.tipX,i.tipY)),r.transition().duration(n).ease(h0).attrTween("d",()=>{const a=Yd(i,s);return l=>{const c=a(l);return xb(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(h0).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===To.Direct||e.style===To.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===To.CurveRight?1:0;return`M ${m.x} ${m.y} A ${x} ${x} 0 0 ${_} ${b.x} ${b.y}`}})}}function l$(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&&Cee(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&&kee(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 c$(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 cg(t,e,n){const o=t.ownerSVGElement??t;$e(o).style("overflow","visible"),I2(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 fr(l))i.set(u,d);if(c)for(const[u,d]of fr(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??Ht.Point){case Ht.Point:i$(a,c,n,l);break;case Ht.Range:s$(s,c,n,l,a);break;case Ht.Free:a$(a,c,n,l);break}}if(n.transition){const l=pc(Fu);l$(a.node(),s.node(),i??new Map,l)}c$(o)}function Hu(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"),I2(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 fr(h))c.set(b,g);if(m)for(const[b,g]of fr(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??Ht.Point){case Ht.Point:i$(d,m,e,h);break;case Ht.Range:s$(u,m,e,h,d);break;case Ht.Free:a$(d,m,e,h);break}}if(e.transition){const h=pc(Fu);l$(d.node(),u.node(),c??new Map,h)}c$(r)}}}const{min:Aee,max:$ee}=Math,zl=(t,e=0,n=1)=>Aee($ee(e,t),n),F2=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]=zl(t[e],0,255)):e===3&&(t[e]=zl(t[e],0,1));return t},u$={};for(let t of["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])u$[`[object ${t}]`]=t.toLowerCase();function Bt(t){return u$[Object.prototype.toString.call(t)]||"object"}const Ot=(t,e=null)=>t.length>=3?Array.prototype.slice.call(t):Bt(t[0])=="object"&&e?e.split("").filter(n=>t[0][n]!==void 0).map(n=>t[0][n]):t[0].slice(0),Wu=t=>{if(t.length<2)return null;const e=t.length-1;return Bt(t[e])=="string"?t[e].toLowerCase():null},{PI:ug,min:d$,max:f$}=Math,jr=t=>Math.round(t*100)/100,wb=t=>Math.round(t*100)/100,Fs=ug*2,Rv=ug/3,Tee=ug/180,Oee=180/ug;function h$(t){return[...t.slice(0,3).reverse(),...t.slice(3)]}const St={format:{},autodetect:[]};class We{constructor(...e){const n=this;if(Bt(e[0])==="object"&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];let o=Wu(e),r=!1;if(!o){r=!0,St.sorted||(St.autodetect=St.autodetect.sort((i,s)=>s.p-i.p),St.sorted=!0);for(let i of St.autodetect)if(o=i.test(...e),o)break}if(St.format[o]){const i=St.format[o].apply(null,r?e:e.slice(0,-1));n._rgb=F2(i)}else throw new Error("unknown format: "+e);n._rgb.length===3&&n._rgb.push(1)}toString(){return Bt(this.hex)=="function"?this.hex():`[${this._rgb.join(",")}]`}}const Mee="3.2.0",rt=(...t)=>new We(...t);rt.version=Mee;const ku={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"},Bee=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,Lee=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,p$=t=>{if(t.match(Bee)){(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(Lee)){(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:Ph}=Math,m$=(...t)=>{let[e,n,o,r]=Ot(t,"rgba"),i=Wu(t)||"auto";r===void 0&&(r=1),i==="auto"&&(i=r<1?"rgba":"rgb"),e=Ph(e),n=Ph(n),o=Ph(o);let a="000000"+(e<<16|n<<8|o).toString(16);a=a.substr(a.length-6);let l="0"+Ph(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}`}};We.prototype.name=function(){const t=m$(this._rgb,"rgb");for(let e of Object.keys(ku))if(ku[e]===t)return e.toLowerCase();return t};St.format.named=t=>{if(t=t.toLowerCase(),ku[t])return p$(ku[t]);throw new Error("unknown color name: "+t)};St.autodetect.push({p:5,test:(t,...e)=>{if(!e.length&&Bt(t)==="string"&&ku[t.toLowerCase()])return"named"}});We.prototype.alpha=function(t,e=!1){return t!==void 0&&Bt(t)==="number"?e?(this._rgb[3]=t,this):new We([this._rgb[0],this._rgb[1],this._rgb[2],t],"rgb"):this._rgb[3]};We.prototype.clipped=function(){return this._rgb._clipped||!1};const ds={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}},Pee=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 Ys(t){const e=Pee.get(String(t).toLowerCase());if(!e)throw new Error("unknown Lab illuminant "+t);ds.labWhitePoint=t,ds.Xn=e[0],ds.Zn=e[1]}function Sf(){return ds.labWhitePoint}const V2=(...t)=>{t=Ot(t,"lab");const[e,n,o]=t,[r,i,s]=Dee(e,n,o),[a,l,c]=g$(r,i,s);return[a,l,c,t.length>3?t[3]:1]},Dee=(t,e,n)=>{const{kE:o,kK:r,kKE:i,Xn:s,Yn:a,Zn:l}=ds,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]},Fv=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},g$=(t,e,n)=>{const{MtxAdaptMa:o,MtxAdaptMaI:r,MtxXYZ2RGB:i,RefWhiteRGB:s,Xn:a,Yn:l,Zn:c}=ds,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,D=Fv(x*i.m00+_*i.m10+C*i.m20),M=Fv(x*i.m01+_*i.m11+C*i.m21),$=Fv(x*i.m02+_*i.m12+C*i.m22);return[D*255,M*255,$*255]},z2=(...t)=>{const[e,n,o,...r]=Ot(t,"rgb"),[i,s,a]=v$(e,n,o),[l,c,u]=Eee(i,s,a);return[l,c,u,...r.length>0&&r[0]<1?[r[0]]:[]]};function Eee(t,e,n){const{Xn:o,Yn:r,Zn:i,kE:s,kK:a}=ds,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 Vv(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 v$=(t,e,n)=>{t=Vv(t/255),e=Vv(e/255),n=Vv(n/255);const{MtxRGB2XYZ:o,MtxAdaptMa:r,MtxAdaptMaI:i,Xn:s,Yn:a,Zn:l,As:c,Bs:u,Cs:d}=ds;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]};We.prototype.lab=function(){return z2(this._rgb)};const Iee=(...t)=>new We(...t,"lab");Object.assign(rt,{lab:Iee,getLabWhitePoint:Sf,setLabWhitePoint:Ys});St.format.lab=V2;St.autodetect.push({p:2,test:(...t)=>{if(t=Ot(t,"lab"),Bt(t)==="array"&&t.length===3)return"lab"}});We.prototype.darken=function(t=1){const e=this,n=e.lab();return n[0]-=ds.Kn*t,new We(n,"lab").alpha(e.alpha(),!0)};We.prototype.brighten=function(t=1){return this.darken(-t)};We.prototype.darker=We.prototype.darken;We.prototype.brighter=We.prototype.brighten;We.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:Nee}=Math,Ree=1e-7,Fee=20;We.prototype.luminance=function(t,e="rgb"){if(t!==void 0&&Bt(t)==="number"){if(t===0)return new We([0,0,0,this._rgb[3]],"rgb");if(t===1)return new We([255,255,255,this._rgb[3]],"rgb");let n=this.luminance(),o=Fee;const r=(s,a)=>{const l=s.interpolate(a,.5,e),c=l.luminance();return Math.abs(t-c)<Ree||!o--?l:c>t?r(s,l):r(l,a)},i=(n>t?r(new We([0,0,0]),this):r(this,new We([255,255,255]))).rgb();return new We([...i,this._rgb[3]])}return Vee(...this._rgb.slice(0,3))};const Vee=(t,e,n)=>(t=zv(t),e=zv(e),n=zv(n),.2126*t+.7152*e+.0722*n),zv=t=>(t/=255,t<=.03928?t/12.92:Nee((t+.055)/1.055,2.4)),Lo={},Su=(t,e,n=.5,...o)=>{let r=o[0]||"lrgb";if(!Lo[r]&&!o.length&&(r=Object.keys(Lo)[0]),!Lo[r])throw new Error(`interpolation mode ${r} is not defined`);return Bt(t)!=="object"&&(t=new We(t)),Bt(e)!=="object"&&(e=new We(e)),Lo[r](t,e,n).alpha(t.alpha()+n*(e.alpha()-t.alpha()))};We.prototype.mix=We.prototype.interpolate=function(t,e=.5,...n){return Su(this,t,e,...n)};We.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 We([e[0]*n,e[1]*n,e[2]*n,n],"rgb")};const{sin:zee,cos:Hee}=Math,b$=(...t)=>{let[e,n,o]=Ot(t,"lch");return isNaN(o)&&(o=0),o=o*Tee,[e,Hee(o)*n,zee(o)*n]},H2=(...t)=>{t=Ot(t,"lch");const[e,n,o]=t,[r,i,s]=b$(e,n,o),[a,l,c]=V2(r,i,s);return[a,l,c,t.length>3?t[3]:1]},Wee=(...t)=>{const e=h$(Ot(t,"hcl"));return H2(...e)},{sqrt:Uee,atan2:Gee,round:qee}=Math,y$=(...t)=>{const[e,n,o]=Ot(t,"lab"),r=Uee(n*n+o*o);let i=(Gee(o,n)*Oee+360)%360;return qee(r*1e4)===0&&(i=Number.NaN),[e,r,i]},W2=(...t)=>{const[e,n,o,...r]=Ot(t,"rgb"),[i,s,a]=z2(e,n,o),[l,c,u]=y$(i,s,a);return[l,c,u,...r.length>0&&r[0]<1?[r[0]]:[]]};We.prototype.lch=function(){return W2(this._rgb)};We.prototype.hcl=function(){return h$(W2(this._rgb))};const Yee=(...t)=>new We(...t,"lch"),jee=(...t)=>new We(...t,"hcl");Object.assign(rt,{lch:Yee,hcl:jee});St.format.lch=H2;St.format.hcl=Wee;["lch","hcl"].forEach(t=>St.autodetect.push({p:2,test:(...e)=>{if(e=Ot(e,t),Bt(e)==="array"&&e.length===3)return t}}));We.prototype.saturate=function(t=1){const e=this,n=e.lch();return n[1]+=ds.Kn*t,n[1]<0&&(n[1]=0),new We(n,"lch").alpha(e.alpha(),!0)};We.prototype.desaturate=function(t=1){return this.saturate(-t)};We.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(Bt(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(Bt(e)==="number")i[s]=e;else throw new Error("unsupported value for Color.set");const a=new We(i,o);return n?(this._rgb=a._rgb,this):a}throw new Error(`unknown channel ${r} in mode ${o}`)}else return i};We.prototype.tint=function(t=.5,...e){return Su(this,"white",t,...e)};We.prototype.shade=function(t=.5,...e){return Su(this,"black",t,...e)};const Kee=(t,e,n)=>{const o=t._rgb,r=e._rgb;return new We(o[0]+n*(r[0]-o[0]),o[1]+n*(r[1]-o[1]),o[2]+n*(r[2]-o[2]),"rgb")};Lo.rgb=Kee;const{sqrt:Hv,pow:Oc}=Math,Xee=(t,e,n)=>{const[o,r,i]=t._rgb,[s,a,l]=e._rgb;return new We(Hv(Oc(o,2)*(1-n)+Oc(s,2)*n),Hv(Oc(r,2)*(1-n)+Oc(a,2)*n),Hv(Oc(i,2)*(1-n)+Oc(l,2)*n),"rgb")};Lo.lrgb=Xee;const Zee=(t,e,n)=>{const o=t.lab(),r=e.lab();return new We(o[0]+n*(r[0]-o[0]),o[1]+n*(r[1]-o[1]),o[2]+n*(r[2]-o[2]),"lab")};Lo.lab=Zee;const Uu=(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 We([m,f,h],o):new We([h,f,m],o)},x$=(t,e,n)=>Uu(t,e,n,"lch");Lo.lch=x$;Lo.hcl=x$;const Qee=t=>{if(Bt(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)},Jee=(...t)=>{const[e,n,o]=Ot(t,"rgb");return(e<<16)+(n<<8)+o};We.prototype.num=function(){return Jee(this._rgb)};const ete=(...t)=>new We(...t,"num");Object.assign(rt,{num:ete});St.format.num=Qee;St.autodetect.push({p:5,test:(...t)=>{if(t.length===1&&Bt(t[0])==="number"&&t[0]>=0&&t[0]<=16777215)return"num"}});const tte=(t,e,n)=>{const o=t.num(),r=e.num();return new We(o+n*(r-o),"num")};Lo.num=tte;const{floor:nte}=Math,ote=(...t)=>{t=Ot(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=nte(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]},rte=(...t)=>{const[e,n,o]=Ot(t,"rgb"),r=d$(e,n,o),i=f$(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]};We.prototype.hcg=function(){return rte(this._rgb)};const ite=(...t)=>new We(...t,"hcg");rt.hcg=ite;St.format.hcg=ote;St.autodetect.push({p:1,test:(...t)=>{if(t=Ot(t,"hcg"),Bt(t)==="array"&&t.length===3)return"hcg"}});const ste=(t,e,n)=>Uu(t,e,n,"hcg");Lo.hcg=ste;const{cos:Mc}=Math,ate=(...t)=>{t=Ot(t,"hsi");let[e,n,o]=t,r,i,s;return isNaN(e)&&(e=0),isNaN(n)&&(n=0),e>360&&(e-=360),e<0&&(e+=360),e/=360,e<1/3?(s=(1-n)/3,r=(1+n*Mc(Fs*e)/Mc(Rv-Fs*e))/3,i=1-(s+r)):e<2/3?(e-=1/3,r=(1-n)/3,i=(1+n*Mc(Fs*e)/Mc(Rv-Fs*e))/3,s=1-(r+i)):(e-=2/3,i=(1-n)/3,s=(1+n*Mc(Fs*e)/Mc(Rv-Fs*e))/3,r=1-(i+s)),r=zl(o*r*3),i=zl(o*i*3),s=zl(o*s*3),[r*255,i*255,s*255,t.length>3?t[3]:1]},{min:lte,sqrt:cte,acos:ute}=Math,dte=(...t)=>{let[e,n,o]=Ot(t,"rgb");e/=255,n/=255,o/=255;let r;const i=lte(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/=cte((e-n)*(e-n)+(e-o)*(n-o)),r=ute(r),o>n&&(r=Fs-r),r/=Fs),[r*360,a,s]};We.prototype.hsi=function(){return dte(this._rgb)};const fte=(...t)=>new We(...t,"hsi");rt.hsi=fte;St.format.hsi=ate;St.autodetect.push({p:2,test:(...t)=>{if(t=Ot(t,"hsi"),Bt(t)==="array"&&t.length===3)return"hsi"}});const hte=(t,e,n)=>Uu(t,e,n,"hsi");Lo.hsi=hte;const _b=(...t)=>{t=Ot(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]},w$=(...t)=>{t=Ot(t,"rgba");let[e,n,o]=t;e/=255,n/=255,o/=255;const r=d$(e,n,o),i=f$(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]};We.prototype.hsl=function(){return w$(this._rgb)};const pte=(...t)=>new We(...t,"hsl");rt.hsl=pte;St.format.hsl=_b;St.autodetect.push({p:2,test:(...t)=>{if(t=Ot(t,"hsl"),Bt(t)==="array"&&t.length===3)return"hsl"}});const mte=(t,e,n)=>Uu(t,e,n,"hsl");Lo.hsl=mte;const{floor:gte}=Math,vte=(...t)=>{t=Ot(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=gte(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:bte,max:yte}=Math,xte=(...t)=>{t=Ot(t,"rgb");let[e,n,o]=t;const r=bte(e,n,o),i=yte(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]};We.prototype.hsv=function(){return xte(this._rgb)};const wte=(...t)=>new We(...t,"hsv");rt.hsv=wte;St.format.hsv=vte;St.autodetect.push({p:2,test:(...t)=>{if(t=Ot(t,"hsv"),Bt(t)==="array"&&t.length===3)return"hsv"}});const _te=(t,e,n)=>Uu(t,e,n,"hsv");Lo.hsv=_te;function S0(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 U2=(...t)=>{t=Ot(t,"lab");const[e,n,o,...r]=t,[i,s,a]=kte([e,n,o]),[l,c,u]=g$(i,s,a);return[l,c,u,...r.length>0&&r[0]<1?[r[0]]:[]]};function kte(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=S0(n,t);return S0(e,o.map(r=>r**3))}const G2=(...t)=>{const[e,n,o,...r]=Ot(t,"rgb"),i=v$(e,n,o);return[...Ste(i),...r.length>0&&r[0]<1?[r[0]]:[]]};function Ste(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=S0(e,t);return S0(n,o.map(r=>Math.cbrt(r)))}We.prototype.oklab=function(){return G2(this._rgb)};const Cte=(...t)=>new We(...t,"oklab");Object.assign(rt,{oklab:Cte});St.format.oklab=U2;St.autodetect.push({p:2,test:(...t)=>{if(t=Ot(t,"oklab"),Bt(t)==="array"&&t.length===3)return"oklab"}});const Ate=(t,e,n)=>{const o=t.oklab(),r=e.oklab();return new We(o[0]+n*(r[0]-o[0]),o[1]+n*(r[1]-o[1]),o[2]+n*(r[2]-o[2]),"oklab")};Lo.oklab=Ate;const $te=(t,e,n)=>Uu(t,e,n,"oklch");Lo.oklch=$te;const{pow:Wv,sqrt:Uv,PI:Gv,cos:P6,sin:D6,atan2:Tte}=Math,Ote=(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 We(d)),e==="lrgb")return Mte(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*Gv;l+=P6(f)*n[0],c+=D6(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*Gv;l+=P6(b)*n[f+1],c+=D6(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=Tte(c/a[d],l/a[d])/Gv*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 We(s,e).alpha(u>.99999?1:u,!0)},Mte=(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]+=Wv(a[0],2)*s,o[1]+=Wv(a[1],2)*s,o[2]+=Wv(a[2],2)*s,o[3]+=a[3]*s}return o[0]=Uv(o[0]),o[1]=Uv(o[1]),o[2]=Uv(o[2]),o[3]>.9999999&&(o[3]=1),new We(F2(o))},{pow:Bte}=Math;function C0(t){let e="rgb",n=rt("#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"],$&&Bt($)==="string"&&rt.brewer&&rt.brewer[$.toLowerCase()]&&($=rt.brewer[$.toLowerCase()]),Bt($)==="array"){$.length===1&&($=[$[0],$[0]]),$=$.slice(0);for(let L=0;L<$.length;L++)$[L]=rt($[L]);s.length=0;for(let L=0;L<$.length;L++)s.push(L/($.length-1))}return D(),c=$},y=function($){if(l!=null){const L=l.length-1;let E=0;for(;E<L&&$>=l[E];)E++;return E-1}return 0};let x=$=>$,_=$=>$;const C=function($,L){let E,N;if(L==null&&(L=!1),isNaN($)||$===null)return n;L?N=$:l&&l.length>2?N=y($)/(l.length-2):f!==d?N=($-d)/(f-d):N=1,N=_(N),L||(N=x(N)),g!==1&&(N=Bte(N,g)),N=a[0]+N*(1-a[0]-a[1]),N=zl(N,0,1);const T=Math.floor(N*1e4);if(b&&m[T])E=m[T];else{if(Bt(c)==="array")for(let O=0;O<s.length;O++){const P=s[O];if(N<=P){E=c[O];break}if(N>=P&&O===s.length-1){E=c[O];break}if(N>P&&N<s[O+1]){N=(N-P)/(s[O+1]-P),E=rt.interpolate(c[O],c[O+1],N,e);break}}else Bt(c)==="function"&&(E=c(N));b&&(m[T]=E)}return E};var D=()=>m={};v(t);const M=function($){const L=rt(C($));return u&&L[u]?L[u]():L};return M.classes=function($){if($!=null){if(Bt($)==="array")l=$,r=[$[0],$[$.length-1]];else{const L=rt.analyze(r);$===0?l=[L.min,L.max]:l=rt.limits(L,"e",$)}return M}return l},M.domain=function($){if(!arguments.length)return i;i=$.slice(0),d=$[0],f=$[$.length-1],s=[];const L=c.length;if($.length===L&&d!==f)for(let E of Array.from($))s.push((E-d)/(f-d));else{for(let E=0;E<L;E++)s.push(E/(L-1));if($.length>2){const E=$.map((T,O)=>O/($.length-1)),N=$.map(T=>(T-d)/(f-d));N.every((T,O)=>E[O]===T)||(_=T=>{if(T<=0||T>=1)return T;let O=0;for(;T>=N[O+1];)O++;const P=(T-N[O])/(N[O+1]-N[O]);return E[O]+P*(E[O+1]-E[O])})}}return r=[d,f],M},M.mode=function($){return arguments.length?(e=$,D(),M):e},M.range=function($,L){return v($),M},M.out=function($){return u=$,M},M.spread=function($){return arguments.length?(o=$,M):o},M.correctLightness=function($){return $==null&&($=!0),h=$,D(),h?x=function(L){const E=C(0,!0).lab()[0],N=C(1,!0).lab()[0],T=E>N;let O=C(L,!0).lab()[0];const P=E+(N-E)*L;let B=O-P,V=0,z=1,G=20;for(;Math.abs(B)>.01&&G-- >0;)(function(){return T&&(B*=-1),B<0?(V=L,L+=(z-L)*.5):(z=L,L+=(V-L)*.5),O=C(L,!0).lab()[0],B=O-P})();return L}:x=L=>L,M},M.padding=function($){return $!=null?(Bt($)==="number"&&($=[$,$]),a=$,M):a},M.colors=function($,L){arguments.length<2&&(L="hex");let E=[];if(arguments.length===0)E=c.slice(0);else if($===1)E=[M(.5)];else if($>1){const N=r[0],T=r[1]-N;E=Lte(0,$).map(O=>M(N+O/($-1)*T))}else{t=[];let N=[];if(l&&l.length>2)for(let T=1,O=l.length,P=1<=O;P?T<O:T>O;P?T++:T--)N.push((l[T-1]+l[T])*.5);else N=r;E=N.map(T=>M(T))}return rt[L]&&(E=E.map(N=>N[L]())),E},M.cache=function($){return $!=null?(b=$,M):b},M.gamma=function($){return $!=null?(g=$,M):g},M.nodata=function($){return $!=null?(n=rt($),M):n},M}function Lte(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 Pte=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},Dte=function(t){let e,n,o,r;if(t=t.map(i=>new We(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 We(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 We(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 We(a,"lab")}}else if(t.length>=5){let i,s,a;i=t.map(l=>l.lab()),a=t.length-1,s=Pte(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 We(u,"lab")}}else throw new RangeError("No point in running bezier with only one color.");return e},Ete=t=>{const e=Dte(t);return e.scale=()=>C0(e),e},{round:_$}=Math;We.prototype.rgb=function(t=!0){return t===!1?this._rgb.slice(0,3):this._rgb.slice(0,3).map(_$)};We.prototype.rgba=function(t=!0){return this._rgb.slice(0,4).map((e,n)=>n<3?t===!1?e:_$(e):e)};const Ite=(...t)=>new We(...t,"rgb");Object.assign(rt,{rgb:Ite});St.format.rgb=(...t)=>{const e=Ot(t,"rgba");return e[3]===void 0&&(e[3]=1),e};St.autodetect.push({p:3,test:(...t)=>{if(t=Ot(t,"rgba"),Bt(t)==="array"&&(t.length===3||t.length===4&&Bt(t[3])=="number"&&t[3]>=0&&t[3]<=1))return"rgb"}});const Ei=(t,e,n)=>{if(!Ei[n])throw new Error("unknown blend mode "+n);return Ei[n](t,e)},al=t=>(e,n)=>{const o=rt(n).rgb(),r=rt(e).rgb();return rt.rgb(t(o,r))},ll=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},Nte=t=>t,Rte=(t,e)=>t*e/255,Fte=(t,e)=>t>e?e:t,Vte=(t,e)=>t>e?t:e,zte=(t,e)=>255*(1-(1-t/255)*(1-e/255)),Hte=(t,e)=>e<128?2*t*e/255:255*(1-2*(1-t/255)*(1-e/255)),Wte=(t,e)=>255*(1-(1-e/255)/(t/255)),Ute=(t,e)=>t===255?255:(t=255*(e/255)/(1-t/255),t>255?255:t);Ei.normal=al(ll(Nte));Ei.multiply=al(ll(Rte));Ei.screen=al(ll(zte));Ei.overlay=al(ll(Hte));Ei.darken=al(ll(Fte));Ei.lighten=al(ll(Vte));Ei.dodge=al(ll(Ute));Ei.burn=al(ll(Wte));const{pow:Gte,sin:qte,cos:Yte}=Math;function jte(t=300,e=-1.5,n=1,o=1,r=[0,1]){let i=0,s;Bt(r)==="array"?s=r[1]-r[0]:(s=0,r=[r,r]);const a=function(l){const c=Fs*((t+120)/360+e*l),u=Gte(r[0]+s*l,o),f=(i!==0?n[0]+l*i:n)*u*(1-u)/2,h=Yte(c),m=qte(c),b=u+f*(-.14861*h+1.78277*m),g=u+f*(-.29227*h-.90649*m),v=u+f*(1.97294*h);return rt(F2([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,Bt(n)==="array"?(i=n[1]-n[0],i===0&&(n=n[1])):i=0,a)},a.lightness=function(l){return l==null?r:(Bt(l)==="array"?(r=l,s=l[1]-l[0]):(r=[l,l],s=0),a)},a.scale=()=>rt.scale(a),a.hue(n),a}const Kte="0123456789abcdef",{floor:Xte,random:Zte}=Math,Qte=(t=Zte)=>{let e="#";for(let n=0;n<6;n++)e+=Kte.charAt(Xte(t()*16));return new We(e,"hex")},{log:E6,pow:Jte,floor:ene,abs:tne}=Math;function k$(t,e=null){const n={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return Bt(t)==="object"&&(t=Object.values(t)),t.forEach(o=>{e&&Bt(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)=>S$(n,o,r),n}function S$(t,e="equal",n=7){Bt(t)=="array"&&(t=k$(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*E6(o),l=Math.LOG10E*E6(r);s.push(o);for(let c=1;c<n;c++)s.push(Jte(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=ene(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 D=tne(h[C]-y);D<x&&(x=D,_=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 nne=(t,e)=>{t=new We(t),e=new We(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 I6=.027,one=5e-4,rne=.1,N6=1.14,Dh=.022,R6=1.414,ine=(t,e)=>{t=new We(t),e=new We(e),t.alpha()<1&&(t=Su(e,t,t.alpha(),"rgb"));const n=F6(...t.rgb()),o=F6(...e.rgb()),r=n>=Dh?n:n+Math.pow(Dh-n,R6),i=o>=Dh?o:o+Math.pow(Dh-o,R6),s=Math.pow(i,.56)-Math.pow(r,.57),a=Math.pow(i,.65)-Math.pow(r,.62),l=Math.abs(i-r)<one?0:r<i?s*N6:a*N6;return(Math.abs(l)<rne?0:l>0?l-I6:l+I6)*100};function F6(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:Ls,pow:Pn,min:sne,max:ane,atan2:V6,abs:z6,cos:Eh,sin:H6,exp:lne,PI:W6}=Math;function cne(t,e,n=1,o=1,r=1){var i=function(ge){return 360*ge/(2*W6)},s=function(ge){return 2*W6*ge/360};t=new We(t),e=new We(e);const[a,l,c]=Array.from(t.lab()),[u,d,f]=Array.from(e.lab()),h=(a+u)/2,m=Ls(Pn(l,2)+Pn(c,2)),b=Ls(Pn(d,2)+Pn(f,2)),g=(m+b)/2,v=.5*(1-Ls(Pn(g,7)/(Pn(g,7)+Pn(25,7)))),y=l*(1+v),x=d*(1+v),_=Ls(Pn(y,2)+Pn(c,2)),C=Ls(Pn(x,2)+Pn(f,2)),D=(_+C)/2,M=i(V6(c,y)),$=i(V6(f,x)),L=M>=0?M:M+360,E=$>=0?$:$+360,N=z6(L-E)>180?(L+E+360)/2:(L+E)/2,T=1-.17*Eh(s(N-30))+.24*Eh(s(2*N))+.32*Eh(s(3*N+6))-.2*Eh(s(4*N-63));let O=E-L;O=z6(O)<=180?O:E<=L?O+360:O-360,O=2*Ls(_*C)*H6(s(O)/2);const P=u-a,B=C-_,V=1+.015*Pn(h-50,2)/Ls(20+Pn(h-50,2)),z=1+.045*D,G=1+.015*D*T,K=30*lne(-Pn((N-275)/25,2)),ae=-(2*Ls(Pn(D,7)/(Pn(D,7)+Pn(25,7))))*H6(2*s(K)),he=Ls(Pn(P/(n*V),2)+Pn(B/(o*z),2)+Pn(O/(r*G),2)+ae*(B/(o*z))*(O/(r*G)));return ane(0,sne(100,he))}function une(t,e,n="lab"){t=new We(t),e=new We(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 dne=(...t)=>{try{return new We(...t),!0}catch{return!1}},fne={cool(){return C0([rt.hsl(180,1,.9),rt.hsl(250,.7,.4)])},hot(){return C0(["#000","#f00","#ff0","#fff"]).mode("rgb")}},kb={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"]},C$=Object.keys(kb),U6=new Map(C$.map(t=>[t.toLowerCase(),t])),hne=typeof Proxy=="function"?new Proxy(kb,{get(t,e){const n=e.toLowerCase();if(U6.has(n))return t[U6.get(n)]},getOwnPropertyNames(){return Object.getOwnPropertyNames(C$)}}):kb,pne=(...t)=>{t=Ot(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:G6}=Math,mne=(...t)=>{let[e,n,o]=Ot(t,"rgb");e=e/255,n=n/255,o=o/255;const r=1-G6(e,G6(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]};We.prototype.cmyk=function(){return mne(this._rgb)};const gne=(...t)=>new We(...t,"cmyk");Object.assign(rt,{cmyk:gne});St.format.cmyk=pne;St.autodetect.push({p:2,test:(...t)=>{if(t=Ot(t,"cmyk"),Bt(t)==="array"&&t.length===4)return"cmyk"}});const vne=(...t)=>{const e=Ot(t,"hsla");let n=Wu(t)||"lsa";return e[0]=jr(e[0]||0)+"deg",e[1]=jr(e[1]*100)+"%",e[2]=jr(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(" ")})`},bne=(...t)=>{const e=Ot(t,"lab");let n=Wu(t)||"lab";return e[0]=jr(e[0])+"%",e[1]=jr(e[1]),e[2]=jr(e[2]),n==="laba"||e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`lab(${e.join(" ")})`},yne=(...t)=>{const e=Ot(t,"lch");let n=Wu(t)||"lab";return e[0]=jr(e[0])+"%",e[1]=jr(e[1]),e[2]=isNaN(e[2])?"none":jr(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(" ")})`},xne=(...t)=>{const e=Ot(t,"lab");return e[0]=jr(e[0]*100)+"%",e[1]=wb(e[1]),e[2]=wb(e[2]),e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`oklab(${e.join(" ")})`},A$=(...t)=>{const[e,n,o,...r]=Ot(t,"rgb"),[i,s,a]=G2(e,n,o),[l,c,u]=y$(i,s,a);return[l,c,u,...r.length>0&&r[0]<1?[r[0]]:[]]},wne=(...t)=>{const e=Ot(t,"lch");return e[0]=jr(e[0]*100)+"%",e[1]=wb(e[1]),e[2]=isNaN(e[2])?"none":jr(e[2])+"deg",e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`oklch(${e.join(" ")})`},{round:qv}=Math,_ne=(...t)=>{const e=Ot(t,"rgba");let n=Wu(t)||"rgb";if(n.substr(0,3)==="hsl")return vne(w$(e),n);if(n.substr(0,3)==="lab"){const o=Sf();Ys("d50");const r=bne(z2(e),n);return Ys(o),r}if(n.substr(0,3)==="lch"){const o=Sf();Ys("d50");const r=yne(W2(e),n);return Ys(o),r}return n.substr(0,5)==="oklab"?xne(G2(e)):n.substr(0,5)==="oklch"?wne(A$(e)):(e[0]=qv(e[0]),e[1]=qv(e[1]),e[2]=qv(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(" ")})`)},$$=(...t)=>{t=Ot(t,"lch");const[e,n,o,...r]=t,[i,s,a]=b$(e,n,o),[l,c,u]=U2(i,s,a);return[l,c,u,...r.length>0&&r[0]<1?[r[0]]:[]]},Qs=/((?:-?\d+)|(?:-?\d+(?:\.\d+)?)%|none)/.source,ki=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%?)|none)/.source,A0=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%)|none)/.source,Jr=/\s*/.source,Gu=/\s+/.source,q2=/\s*,\s*/.source,dg=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?)|none)/.source,qu=/\s*(?:\/\s*((?:[01]|[01]?\.\d+)|\d+(?:\.\d+)?%))?/.source,T$=new RegExp("^rgba?\\("+Jr+[Qs,Qs,Qs].join(Gu)+qu+"\\)$"),O$=new RegExp("^rgb\\("+Jr+[Qs,Qs,Qs].join(q2)+Jr+"\\)$"),M$=new RegExp("^rgba\\("+Jr+[Qs,Qs,Qs,ki].join(q2)+Jr+"\\)$"),B$=new RegExp("^hsla?\\("+Jr+[dg,A0,A0].join(Gu)+qu+"\\)$"),L$=new RegExp("^hsl?\\("+Jr+[dg,A0,A0].join(q2)+Jr+"\\)$"),P$=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,D$=new RegExp("^lab\\("+Jr+[ki,ki,ki].join(Gu)+qu+"\\)$"),E$=new RegExp("^lch\\("+Jr+[ki,ki,dg].join(Gu)+qu+"\\)$"),I$=new RegExp("^oklab\\("+Jr+[ki,ki,ki].join(Gu)+qu+"\\)$"),N$=new RegExp("^oklch\\("+Jr+[ki,ki,dg].join(Gu)+qu+"\\)$"),{round:R$}=Math,Bc=t=>t.map((e,n)=>n<=2?zl(R$(e),0,255):e),Dn=(t,e=0,n=100,o=!1)=>(typeof t=="string"&&t.endsWith("%")&&(t=parseFloat(t.substring(0,t.length-1))/100,o?t=e+(t+1)*.5*(n-e):t=e+t*(n-e)),+t),No=(t,e)=>t==="none"?e:t,Y2=t=>{if(t=t.toLowerCase().trim(),t==="transparent")return[0,0,0,0];let e;if(St.format.named)try{return St.format.named(t)}catch{}if((e=t.match(T$))||(e=t.match(O$))){let n=e.slice(1,4);for(let r=0;r<3;r++)n[r]=+Dn(No(n[r],0),0,255);n=Bc(n);const o=e[4]!==void 0?+Dn(e[4],0,1):1;return n[3]=o,n}if(e=t.match(M$)){const n=e.slice(1,5);for(let o=0;o<4;o++)n[o]=+Dn(n[o],0,255);return n}if((e=t.match(B$))||(e=t.match(L$))){const n=e.slice(1,4);n[0]=+No(n[0].replace("deg",""),0),n[1]=+Dn(No(n[1],0),0,100)*.01,n[2]=+Dn(No(n[2],0),0,100)*.01;const o=Bc(_b(n)),r=e[4]!==void 0?+Dn(e[4],0,1):1;return o[3]=r,o}if(e=t.match(P$)){const n=e.slice(1,4);n[1]*=.01,n[2]*=.01;const o=_b(n);for(let r=0;r<3;r++)o[r]=R$(o[r]);return o[3]=+e[4],o}if(e=t.match(D$)){const n=e.slice(1,4);n[0]=Dn(No(n[0],0),0,100),n[1]=Dn(No(n[1],0),-125,125,!0),n[2]=Dn(No(n[2],0),-125,125,!0);const o=Sf();Ys("d50");const r=Bc(V2(n));Ys(o);const i=e[4]!==void 0?+Dn(e[4],0,1):1;return r[3]=i,r}if(e=t.match(E$)){const n=e.slice(1,4);n[0]=Dn(n[0],0,100),n[1]=Dn(No(n[1],0),0,150,!1),n[2]=+No(n[2].replace("deg",""),0);const o=Sf();Ys("d50");const r=Bc(H2(n));Ys(o);const i=e[4]!==void 0?+Dn(e[4],0,1):1;return r[3]=i,r}if(e=t.match(I$)){const n=e.slice(1,4);n[0]=Dn(No(n[0],0),0,1),n[1]=Dn(No(n[1],0),-.4,.4,!0),n[2]=Dn(No(n[2],0),-.4,.4,!0);const o=Bc(U2(n)),r=e[4]!==void 0?+Dn(e[4],0,1):1;return o[3]=r,o}if(e=t.match(N$)){const n=e.slice(1,4);n[0]=Dn(No(n[0],0),0,1),n[1]=Dn(No(n[1],0),0,.4,!1),n[2]=+No(n[2].replace("deg",""),0);const o=Bc($$(n)),r=e[4]!==void 0?+Dn(e[4],0,1):1;return o[3]=r,o}};Y2.test=t=>T$.test(t)||B$.test(t)||D$.test(t)||E$.test(t)||I$.test(t)||N$.test(t)||O$.test(t)||M$.test(t)||L$.test(t)||P$.test(t)||t==="transparent";We.prototype.css=function(t){return _ne(this._rgb,t)};const kne=(...t)=>new We(...t,"css");rt.css=kne;St.format.css=Y2;St.autodetect.push({p:5,test:(t,...e)=>{if(!e.length&&Bt(t)==="string"&&Y2.test(t))return"css"}});St.format.gl=(...t)=>{const e=Ot(t,"rgba");return e[0]*=255,e[1]*=255,e[2]*=255,e};const Sne=(...t)=>new We(...t,"gl");rt.gl=Sne;We.prototype.gl=function(){const t=this._rgb;return[t[0]/255,t[1]/255,t[2]/255,t[3]]};We.prototype.hex=function(t){return m$(this._rgb,t)};const Cne=(...t)=>new We(...t,"hex");rt.hex=Cne;St.format.hex=p$;St.autodetect.push({p:4,test:(t,...e)=>{if(!e.length&&Bt(t)==="string"&&[3,4,5,6,7,8,9].indexOf(t.length)>=0)return"hex"}});const{log:Ih}=Math,F$=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*Ih(o),r=e<20?0:-254.76935184120902+.8274096064007395*(r=e-10)+115.67994401066147*Ih(r)):(n=351.97690566805693+.114206453784165*(n=e-55)-40.25366309332127*Ih(n),o=325.4494125711974+.07943456536662342*(o=e-50)-28.0852963507957*Ih(o),r=255),[n,o,r,1]},{round:Ane}=Math,$ne=(...t)=>{const e=Ot(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=F$(a);l[2]/l[0]>=o/n?i=a:r=a}return Ane(a)};We.prototype.temp=We.prototype.kelvin=We.prototype.temperature=function(){return $ne(this._rgb)};const Yv=(...t)=>new We(...t,"temp");Object.assign(rt,{temp:Yv,kelvin:Yv,temperature:Yv});St.format.temp=St.format.kelvin=St.format.temperature=F$;We.prototype.oklch=function(){return A$(this._rgb)};const Tne=(...t)=>new We(...t,"oklch");Object.assign(rt,{oklch:Tne});St.format.oklch=$$;St.autodetect.push({p:2,test:(...t)=>{if(t=Ot(t,"oklch"),Bt(t)==="array"&&t.length===3)return"oklch"}});Object.assign(rt,{analyze:k$,average:Ote,bezier:Ete,blend:Ei,brewer:hne,Color:We,colors:ku,contrast:nne,contrastAPCA:ine,cubehelix:jte,deltaE:cne,distance:une,input:St,interpolate:Su,limits:S$,mix:Su,random:Qte,scale:C0,scales:fne,valid:dne});function V$(t,e){if(!rt.valid(t))return e;try{return rt(t)}catch{return e}}function Br(t){return rt.valid(t)&&rt.contrast(t,"#fff")>=rt.contrast(t,"#333")?"#fff":"#333"}function One(t,e){return!rt.valid(t)||!rt.valid(e)?1:rt.contrast(t,e)}function Mne(t){return t>=7?"AAA":t>=4.5?"AA":"Fail"}const Cf=4.5;function Lr(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 z$(t,e="#fff"){if(!rt.valid(t))return rt.valid(e)?Br(e):"#333";let n=rt(t);const o=V$(e,rt("#fff"));if(rt.contrast(n,o)>=Cf)return n.hex();const r=o.luminance()>.5;for(let i=0;i<20&&(n=r?n.darken(.3):n.brighten(.3),!(rt.contrast(n,o)>=Cf));i++);return n.hex()}const j2=12,$0=.25,H$=20;function W$(t,e){if(t.length===0)return[];const n=V$(e,rt("#fff")),o=rt.valid(e)?e:"#fff",r=n.luminance()>.5,i=t.map(s=>rt.valid(s)?Bne(rt(s),o,r):rt("#000"));for(let s=1;s<i.length;s++)rt.deltaE(i[s],i[s-1])>=j2||(i[s]=Lne(i[s],i[s-1],o,r));return i.map(s=>s.hex())}function Bne(t,e,n){for(let o=0;o<H$;o++){if(rt.contrast(t,e)>=Cf)return t;t=n?t.darken($0):t.brighten($0)}return t}function Lne(t,e,n,o){const r=q6(t,e,n,o);if(rt.deltaE(r,e)>=j2)return r;const i=q6(t,e,n,!o);return rt.deltaE(i,e)>rt.deltaE(r,e)&&rt.contrast(i,n)>=Cf?i:r}function q6(t,e,n,o){let r=t,i=rt.deltaE(t,e),s=t;for(let a=0;a<H$;a++){s=o?s.darken($0):s.brighten($0);const l=rt.deltaE(s,e);if(l>i&&rt.contrast(s,n)>=Cf&&(r=s,i=l),i>=j2)break}return r}function _s(t){return new Map((t??[]).map(e=>[e.target,e.color]))}const U$=new WeakMap;function ri(t){return U$.get(t)}function ii(t,e){U$.set(t,e)}let Pne=0;const Y6=new WeakMap;function Vi(t,e,n,o){let r=Y6.get(e);r||(r=new Map,Y6.set(e,r));let i=r.get(n);i||(i=`bc-clip-${++Pne}`,r.set(n,i));const s=$e(t).select("defs").empty()?$e(t).append("defs"):$e(t).select("defs"),a=s.select(`#${i}`);return a.empty()?s.append("clipPath").attr("id",i).append("rect").attr("x",o.x).attr("y",o.y).attr("width",o.width).attr("height",o.height):a.select("rect").attr("x",o.x).attr("y",o.y).attr("width",o.width).attr("height",o.height),i}const _p="bc-scene",Dne=500,j6=new Set,Sb=new WeakMap;function vc(t){let e=Sb.get(t);return e||(e=new Ine(t),Sb.set(t,e)),e}function Ene(t){Sb.delete(t)}class Ine{constructor(e){xn(this,"container");xn(this,"_state","idle");xn(this,"_transition",null);xn(this,"_buffer",[]);this.container=e}register(e){this._buffer.push(e)}get state(){return this._state}get activeTransition(){return this._transition}beginCommit(){(this._state==="committing"||this._state==="animating")&&this.interrupt(),this._state="committing"}commit(e={}){if(this._state!=="committing"){console.warn(`[blueprint-chart] commit() called from state '${this._state}' — call beginCommit() first; ignored.`);return}const n=e.mode??"transform";if(n!=="transform"){j6.has(n)||(j6.add(n),console.warn(`[blueprint-chart] transition mode '${n}' is not yet implemented; falling back to snap.`));const a=this._buffer;this._buffer=[],this._state="animating";for(const l of a)try{l()}catch(c){console.warn("[blueprint-chart] feature flush failed:",c)}this._state="idle";return}const o=e.duration??Dne,r=this.effectiveDuration(o),i=this._buffer;if(this._buffer=[],r<=0){this._state="animating";for(const a of i)try{a()}catch(l){console.warn("[blueprint-chart] feature flush failed:",l)}this._state="idle";return}this._state="animating";const s=f5(_p).duration(r).ease(h0);this._transition=s;for(const a of i)try{a()}catch(l){console.warn("[blueprint-chart] feature flush failed:",l)}s.on("end",()=>{this._transition===s&&(this._transition=null,this._state="idle")}),s.on("interrupt",()=>{this._transition===s&&(this._transition=null,this._state="idle")})}effectiveDuration(e){return e<=0?0:typeof window>"u"||typeof window.matchMedia!="function"?e:window.matchMedia("(prefers-reduced-motion: reduce)").matches?0:e}interrupt(){this._buffer=[],this._transition=null,$e(this.container).interrupt(_p),$e(this.container).selectAll("*").interrupt(_p),this._state="idle"}run(e,n={}){this.beginCommit();try{e()}catch(o){console.warn("[blueprint-chart] scene-transition commit failed:",o),this._state="idle";return}this.commit(n)}destroy(){this.interrupt(),Ene(this.container)}}function Nne(t,e){const n=new Map;return t.querySelectorAll(`[data-bc-role="${e}"]`).forEach(r=>{const i=r.getAttribute("data-bc-key");i!=null&&n.set(i,r)}),n}function Rne(t,e){return t.tagName===e.tagName}function K6(t,e){$e(t).interrupt(_p);const n={};for(const o of e){const r=t.getAttribute(o);r!==null&&(n[o]=r)}return n}const Fne={opacity:0};function Yu(t,e){if(t.state==="idle"||t.state==="animating"){Vne(e);return}t.register(()=>zne(t,e))}function Vne(t){const n=$e(t.parent).selectAll(t.selector).data(t.data,i=>t.key(i));n.exit().remove();const o=t.insert(n.enter());G$(o,t),o.merge(n).each(function(i){Od(this,t.attrs(i))})}function zne(t,e){const n=t.activeTransition,r=$e(e.parent).selectAll(e.selector).data(e.data,c=>e.key(c)),i=Hne(e),s=r.exit();n?s.each(function(){const c=this,u=$e(c).datum(),d=e.exitTo?e.exitTo(u):Fne;Nh(c,d,n).on("end.featureJoin-exit",()=>{var f;return(f=c.parentNode)==null?void 0:f.removeChild(c)})}):s.remove();const a=Nne(t.container,e.role),l=e.insert(r.enter());G$(l,e),l.each(function(c){const u=this,d=e.attrs(c);if(n){const f=a.get(q$(e.key(c)));if(f&&Rne(f,u)){const m=K6(f,i);Od(u,m),Nh(u,d,n);return}const h=e.enterFrom?e.enterFrom(c):d;Od(u,h),Nh(u,d,n)}else Od(u,d)}),r.each(function(c){const u=this,d=e.attrs(c);n?(K6(u,i),Nh(u,d,n)):Od(u,d)})}function G$(t,e){t.attr("data-bc-role",e.role),t.attr("data-bc-key",n=>q$(e.key(n)))}function q$(t){return t.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g,"␟")}function Hne(t){return t.data.length===0?[]:Object.keys(t.attrs(t.data[0]))}function Od(t,e){for(const[n,o]of Object.entries(e))t.setAttribute(n,String(o))}function Nh(t,e,n){const o=$e(t).transition(n);for(const[r,i]of Object.entries(e))o.attr(r,String(i));return o}const Wne=.35;function ju(t){return new Set((t??[]).map(e=>e.target))}function In(t,e,n=1){return t.size===0||t.has(e)?n:Wne}const Lc=["#4e79a7"],X6=13;class Une extends mo{initialize(){}}function Y$(t,e,n={},o=!1){var be,re,ve,ce,I,U,j,ee,ie,de,ke,X,q,Y;oi(o);let r=null,i,s;const a=Nr.for(t);if(o){const te=ri(t);s=te==null?void 0:te.margin,a.detach(),te&&te.chartType!=="bar-vertical"&&(r=Er(t)),i=new Map;for(const ue of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[ye,_e]of fr(ue))i.set(ye,_e);t.replaceChildren()}const{body:l}=ti(t,n.frame),c=dr(l).width,u=n.categoryLabelLine===!0,d=hc(e.values,(be=n.verticalAxis)==null?void 0:be.range,(re=n.verticalAxis)==null?void 0:re.numberFormat,(ve=n.verticalAxis)==null?void 0:ve.scaleType),f=u?an.Off:(ce=n.horizontalAxis)==null?void 0:ce.labelPosition,h=Fi(c,(I=n.verticalAxis)==null?void 0:I.labelPosition,f,(U=n.verticalAxis)==null?void 0:U.direction,d);if(!u){const te=Math.max(0,c-(h.left??50)-(h.right??20)),ue=B2(e.labels,te,n.horizontalAxis);ue!==void 0&&(h.bottom=ue)}const{chartArea:m,width:b,height:g,margin:v}=ni(l,h),x=g-(u?X6:0),_=Ri(s,v),C=Yne(e,n),D=C.map(te=>({label:te,value:e.values[e.labels.indexOf(te)]})),M=n.swapLabelValue===!0,$=n.waterfall===!0,L=[];if($){let te=0;for(const ue of D){const ye=te;te+=ue.value,L.push({label:ue.label,value:ue.value,y0:ye,y1:te,isTotal:!1})}n.waterfallTotal&&L.push({label:"Total",value:te,y0:0,y1:te,isTotal:!0})}const E=$?L.map(te=>te.label):C,N=oo().domain(E).range([0,b]).padding(mc(n.barGap)),T=((j=n.verticalAxis)==null?void 0:j.scaleType)==="log",O=$?L.flatMap(te=>[te.y0,te.y1]):D.map(te=>te.value);let[P,B]=Vu(O,(ee=n.verticalAxis)==null?void 0:ee.range,(ie=n.verticalAxis)==null?void 0:ie.scaleType);if(n.valueLabels&&P<0&&((ke=(de=n.verticalAxis)==null?void 0:de.range)==null?void 0:ke.min)==null){const te=B-P;P-=te*.1}const V=T?rl().domain([P,B]).nice().range([x,0]):Bn().domain([P,B]).nice().range([x,0]);a.attach(m,_);const z=M&&n.valueLabels&&!$?(()=>{const te=new Map(D.map(ue=>[ue.label,ue.value]));return{...n.horizontalAxis,width:b,tickFormat:ue=>String(te.get(ue)??ue)}})():{...n.horizontalAxis,width:b},G=u?{...z,labelPosition:an.Off}:z;a.update({vertical:{scale:V,height:g,options:{...n.verticalAxis,gridWidth:b,topPadding:v.top}},horizontal:{scale:N,height:g,options:G}}),!T&&P<0&&B>0&&$e(m).append("line").attr("class","bc-zero-baseline").attr("x1",0).attr("x2",b).attr("y1",V(0)).attr("y2",V(0)).attr("stroke","#666").attr("stroke-width",1);const K=_s(n.colorizes),ne=new Set((n.highlights??[]).map(te=>te.target)),ae=m.ownerSVGElement,he=Vi(ae,t,"bars",{x:0,y:0,width:b,height:x}),ge=$e(ae).select("defs"),le=he.replace(/^bc-clip-/,""),fe=$e(m).append("g").attr("clip-path",`url(#${he})`);if(n.barBackground){const te=(n.colors??Lc)[0],ue=$?E:D.map(ye=>ye.label);fe.selectAll(".bc-bar-bg").data(ue,ye=>ye).enter().append("rect").attr("class","bc-bar-bg").attr("x",ye=>N(ye)??0).attr("y",0).attr("width",N.bandwidth()).attr("height",x).attr("fill",te).attr("opacity",.18)}const we=$?E:D.map(te=>te.label);if(n.barSeparators&&we.length>1){const te=N.step();for(let ue=1;ue<we.length;ue++){const ye=(N(we[ue-1])??0)+N.bandwidth()+(te-N.bandwidth())/2;fe.append("line").attr("class","bc-bar-separator").attr("x1",ye).attr("x2",ye).attr("y1",0).attr("y2",x).attr("stroke","currentColor").attr("opacity",.15)}}if(!$&&n.connectedColumns&&D.length>1){const te=n.colors??Lc,ue=n.connectionsOpacity??.15;for(let ye=0;ye<D.length-1;ye++){const _e=D[ye],Ae=D[ye+1];if(_e.value==null||Ae.value==null||Number.isNaN(_e.value)||Number.isNaN(Ae.value)||_e.value===0||Ae.value===0)continue;const Ee=(N(_e.label)??0)+N.bandwidth(),Ue=N(Ae.label)??0,Le=Math.min(V(0),V(_e.value)),Ge=Math.min(V(0),V(Ae.value)),st=V(0),ut=K.get(_e.label)??te[0],$t=K.get(Ae.label)??te[0];let rn;if(ut===$t)rn=ut;else{const It=`bc-conn-grad-${le}-${ye}`,jt=ge.append("linearGradient").attr("id",It).attr("x1","0%").attr("x2","100%").attr("y1","0%").attr("y2","0%");jt.append("stop").attr("offset","0%").attr("stop-color",ut),jt.append("stop").attr("offset","100%").attr("stop-color",$t),rn=`url(#${It})`}fe.append("polygon").attr("class","bc-bar-connection").attr("points",`${Ee},${Le} ${Ue},${Ge} ${Ue},${st} ${Ee},${st}`).attr("fill",rn).attr("opacity",ue).attr("pointer-events","none")}}const Z=$e(m).append("g");if($){const te=n.colors??Lc,ue="#333";if(n.connectedColumns&&L.length>1){const ye=n.colors??Lc,_e=n.connectionsOpacity??.15;for(let Ae=0;Ae<L.length-1;Ae++){const Ee=L[Ae],Ue=L[Ae+1];if(Ue.isTotal||Ee.value==null||Ue.value==null||Number.isNaN(Ee.value)||Number.isNaN(Ue.value)||Ee.value===0||Ue.value===0)continue;const Le=(N(Ee.label)??0)+N.bandwidth(),Ge=N(Ue.label)??0,st=V(Ee.y1),ut=V(Ue.y1),$t=V(Ee.y0),rn=V(Ue.y0),It=K.get(Ee.label)??ye[0],jt=K.get(Ue.label)??ye[0];let Hn;if(It===jt)Hn=It;else{const Wn=`bc-conn-grad-${le}-${Ae}`,mn=ge.append("linearGradient").attr("id",Wn).attr("x1","0%").attr("x2","100%").attr("y1","0%").attr("y2","0%");mn.append("stop").attr("offset","0%").attr("stop-color",It),mn.append("stop").attr("offset","100%").attr("stop-color",jt),Hn=`url(#${Wn})`}fe.append("polygon").attr("class","bc-bar-connection").attr("points",`${Le},${st} ${Ge},${ut} ${Ge},${rn} ${Le},${$t}`).attr("fill",Hn).attr("opacity",_e).attr("pointer-events","none")}}for(let ye=0;ye<L.length-1;ye++){const _e=L[ye],Ae=L[ye+1];if(Ae.isTotal)break;fe.append("line").attr("class","bc-waterfall-connector").attr("x1",(N(_e.label)??0)+N.bandwidth()).attr("x2",N(Ae.label)??0).attr("y1",V(_e.y1)).attr("y2",V(_e.y1)).attr("stroke","currentColor").attr("stroke-dasharray","2,2").attr("opacity",.3)}if(fe.selectAll(".bc-bar").data(L,ye=>ye.label).enter().append("rect").attr("class","bc-bar").attr("x",ye=>N(ye.label)??0).attr("y",ye=>Math.min(V(ye.y0),V(ye.y1))).attr("width",N.bandwidth()).attr("height",ye=>Math.abs(V(ye.y0)-V(ye.y1))).attr("fill",ye=>ye.isTotal?ue:K.get(ye.label)??te[0]).attr("opacity",ye=>ne.size>0?In(ne,ye.label):null),n.valueLabels){const ye=n.valueLabelPosition??_t.Auto,_e=qa(((X=n.verticalAxis)==null?void 0:X.numberFormat)??""),Ae=Ee=>_e?_e(Ee):String(Ee);Z.selectAll(".bc-value-label").data(L,Ee=>Ee.label).enter().append("text").attr("class","bc-value-label").attr("font-size","11px").attr("x",Ee=>(N(Ee.label)??0)+N.bandwidth()/2).attr("y",Ee=>{const Ue=Math.min(V(Ee.y0),V(Ee.y1)),Le=Math.abs(V(Ee.y0)-V(Ee.y1));return ye===_t.Inside?Ue+Le/2:Ue-4}).attr("text-anchor","middle").attr("dominant-baseline",ye===_t.Inside?"central":"auto").attr("fill",Ee=>ye===_t.Inside?Br(Ee.isTotal?ue:K.get(Ee.label)??te[0]):"currentColor").text(Ee=>M?Ee.label:Ae(Ee.isTotal?Ee.y1:Ee.value))}}else{const te=vc(t),ue=fe.append("g").node();Yu(te,{role:"mark-per-category",parent:ue,selector:".bc-bar",data:D,key:_e=>_e.label,insert:_e=>_e.append("rect").attr("class","bc-bar"),attrs:_e=>({x:N(_e.label)??0,y:Math.min(V(0),V(_e.value)),width:N.bandwidth(),height:Math.abs(V(_e.value)-V(0)),fill:K.get(_e.label)??(n.colors??Lc)[0],opacity:In(ne,_e.label)})});const ye=new Une(fe);n.tooltips&&ye.use(sl({numberFormat:(q=n.verticalAxis)==null?void 0:q.numberFormat})),n.crosshair&&ye.use(gc({width:b,height:x,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor})),(Y=n.annotations)!=null&&Y.length&&ye.use(Hu(n.annotations,{scaleX:N,scaleY:V,data:D,width:b,height:x,backgroundColor:Lr(t),transition:o,priorAnnotations:i})),ye.draw(D),n.valueLabels&&qne(Z,D,N,V,{position:n.valueLabelPosition,colorOverrides:K,colors:n.colors??Lc,swapLabelValue:M,percent:n.valueLabels==="percent",total:mA(D,_e=>_e.value)})}if(u){const te=$e(m).append("g").attr("class","bc-category-labels");for(const ue of E)te.append("text").attr("class","bc-category-label").attr("x",(N(ue)??0)+N.bandwidth()/2).attr("y",x+X6/2).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size","10px").attr("font-weight","600").attr("fill","currentColor").text(ue)}ii(t,{chartType:"bar-vertical",margin:v}),r&&(Dr(fe.node()),Ir(t,r))}function Gne(t,e,n,o){const r=Math.abs(n(t.value)-n(0)),i=o===_t.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 qne(t,e,n,o,r){const i=r.position??_t.Auto,s=d=>r.swapLabelValue?d.label:r.percent&&r.total!==void 0?Jm(d.value,r.total):String(d.value);let a=t.select(".bc-value-label-group");a.empty()&&(a=t.append("g").attr("class","bc-value-label-group"));const l=t.node().ownerSVGElement,c=l==null?void 0:l.parentElement,u=vc(c);Yu(u,{role:"value-label",parent:a.node(),selector:".bc-value-label",data:e,key:d=>d.label,insert:d=>d.append("text").attr("class","bc-value-label").attr("font-size","11px"),attrs:d=>{const f=Gne(d,n,o,i);return{x:f.tx,y:f.ty,"text-anchor":f.anchor,"dominant-baseline":f.baseline,fill:f.isInside?Br(r.colorOverrides.get(d.label)??r.colors[0]):"currentColor"}}}),a.selectAll(".bc-value-label").data(e,d=>d.label).text(s)}function Yne(t,e){const n=t.labels.map((o,r)=>({label:o,value:t.values[r]}));return e.sort===en.Ascending?n.sort((o,r)=>o.value-r.value):e.sort===en.Descending&&n.sort((o,r)=>r.value-o.value),n.map(o=>o.label)}const Pc=["#4e79a7"],Z6=13,jne="11px sans-serif",jv=4;class Kne extends mo{initialize(){}}function Kv(t){try{const n=document.createElement("canvas").getContext("2d");if(n)return n.font=jne,Math.ceil(n.measureText(t).width)}catch{}return t.length*6.5}function j$(t,e,n={},o=!1){var be,re,ve,ce,I,U,j,ee,ie,de,ke;oi(o);let r=null,i,s;const a=Nr.for(t);if(o){const X=ri(t);s=X==null?void 0:X.margin,a.detach(),X&&X.chartType!=="bar-horizontal"&&(r=Er(t)),i=new Map;for(const q of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[Y,te]of fr(q))i.set(Y,te);t.replaceChildren()}const{body:l}=ti(t,n.frame),c=dr(l).width,u=c>0&&c<400&&((be=n.verticalAxis)==null?void 0:be.labelPosition)!=="outside",d=n.categoryLabelLine===!0||u,f=eg(e.labels),h=d?an.Off:(re=n.verticalAxis)==null?void 0:re.labelPosition,m=Fi(c,h,(ve=n.horizontalAxis)==null?void 0:ve.labelPosition,(ce=n.verticalAxis)==null?void 0:ce.direction,f,(I=n.horizontalAxis)==null?void 0:I.showAxis),b=n.valueLabelPosition??_t.Auto,g=n.swapLabelValue===!0;if(n.valueLabels&&b!==_t.Inside)if(g){const X=e.labels.reduce((Y,te)=>Y.length>te.length?Y:te,""),q=Kv(X)+jv;m.right=Math.max(m.right??15,q)}else{const X=Math.max(...e.values),q=Math.min(...e.values),Y=X>0?Kv(String(X))+jv:0,te=q<0?Kv(String(q))+jv:0;m.right=Math.max(m.right??15,Y),te>0&&(m.left=(m.left??50)+te)}const{chartArea:v,width:y,height:x,margin:_}=ni(l,m),C=d?Z6:0,D=Ri(s,_),M=Qne(e,n),$=M.map(X=>({label:X,value:e.values[e.labels.indexOf(X)]})),L=n.waterfall===!0,E=[];if(L){let X=0;for(const q of $){const Y=X;X+=q.value,E.push({label:q.label,value:q.value,x0:Y,x1:X,isTotal:!1})}n.waterfallTotal&&E.push({label:"Total",value:X,x0:0,x1:X,isTotal:!0})}const N=((U=n.horizontalAxis)==null?void 0:U.scaleType)==="log",T=L?E.flatMap(X=>[X.x0,X.x1]):$.map(X=>X.value),[O,P]=Vu(T,(j=n.horizontalAxis)==null?void 0:j.range,(ee=n.horizontalAxis)==null?void 0:ee.scaleType),B=N?rl().domain([O,P]).nice().range([0,y]):Bn().domain([O,P]).nice().range([0,y]),V=L?E.map(X=>X.label):M,z=oo().domain(V).range([0,x]).padding(mc(n.barGap)),G=g&&n.valueLabels&&!L?(()=>{const X=new Map($.map(q=>[q.label,q.value]));return{...n.verticalAxis,topPadding:_.top,tickFormat:q=>String(X.get(q)??q)}})():{...n.verticalAxis,topPadding:_.top},K=d?{...G,labelPosition:an.Off,...u?{showAxis:!1}:{}}:G;a.attach(v,D),a.update({horizontal:{scale:B,height:x,options:{...n.horizontalAxis,width:y}},vertical:{scale:z,height:x,options:K},order:"horizontal-first"}),!N&&O<0&&P>0&&$e(v).append("line").attr("class","bc-zero-baseline").attr("x1",B(0)).attr("x2",B(0)).attr("y1",0).attr("y2",x).attr("stroke","#666").attr("stroke-width",1);const ne=_s(n.colorizes),ae=new Set((n.highlights??[]).map(X=>X.target)),he=v.ownerSVGElement,ge=Vi(he,t,"bars",{x:0,y:0,width:y,height:x}),le=$e(he).select("defs"),fe=ge.replace(/^bc-clip-/,""),we=$e(v).append("g").attr("clip-path",`url(#${ge})`);if(n.barBackground){const X=(n.colors??Pc)[0],q=L?V:$.map(Y=>Y.label);we.selectAll(".bc-bar-bg").data(q,Y=>Y).enter().append("rect").attr("class","bc-bar-bg").attr("x",0).attr("y",Y=>(z(Y)??0)+C).attr("width",y).attr("height",z.bandwidth()-C).attr("fill",X).attr("opacity",.18)}const Z=L?V:$.map(X=>X.label);if(n.barSeparators&&Z.length>1){const X=z.step();for(let q=1;q<Z.length;q++){const Y=(z(Z[q-1])??0)+z.bandwidth()+(X-z.bandwidth())/2;we.append("line").attr("class","bc-bar-separator").attr("x1",0).attr("x2",y).attr("y1",Y).attr("y2",Y).attr("stroke","currentColor").attr("opacity",.15)}}if(!L&&n.connectedColumns&&$.length>1){const X=n.colors??Pc,q=n.connectionsOpacity??.15;for(let Y=0;Y<$.length-1;Y++){const te=$[Y],ue=$[Y+1];if(te.value==null||ue.value==null||Number.isNaN(te.value)||Number.isNaN(ue.value)||te.value===0||ue.value===0)continue;const ye=(z(te.label)??0)+z.bandwidth(),_e=(z(ue.label)??0)+C,Ae=Math.max(B(0),B(te.value)),Ee=Math.max(B(0),B(ue.value)),Ue=B(0),Le=ne.get(te.label)??X[0],Ge=ne.get(ue.label)??X[0];let st;if(Le===Ge)st=Le;else{const ut=`bc-conn-grad-${fe}-${Y}`,$t=le.append("linearGradient").attr("id",ut).attr("x1","0%").attr("x2","0%").attr("y1","0%").attr("y2","100%");$t.append("stop").attr("offset","0%").attr("stop-color",Le),$t.append("stop").attr("offset","100%").attr("stop-color",Ge),st=`url(#${ut})`}we.append("polygon").attr("class","bc-bar-connection").attr("points",`${Ae},${ye} ${Ee},${_e} ${Ue},${_e} ${Ue},${ye}`).attr("fill",st).attr("opacity",q).attr("pointer-events","none")}}if(L){const X=n.colors??Pc,q="#333";if(n.connectedColumns&&E.length>1){const Y=n.colors??Pc,te=n.connectionsOpacity??.15;for(let ue=0;ue<E.length-1;ue++){const ye=E[ue],_e=E[ue+1];if(_e.isTotal||ye.value==null||_e.value==null||Number.isNaN(ye.value)||Number.isNaN(_e.value)||ye.value===0||_e.value===0)continue;const Ae=(z(ye.label)??0)+z.bandwidth(),Ee=(z(_e.label)??0)+C,Ue=B(ye.x1),Le=B(_e.x1),Ge=B(ye.x0),st=B(_e.x0),ut=ne.get(ye.label)??Y[0],$t=ne.get(_e.label)??Y[0];let rn;if(ut===$t)rn=ut;else{const It=`bc-conn-grad-${fe}-${ue}`,jt=le.append("linearGradient").attr("id",It).attr("x1","0%").attr("x2","0%").attr("y1","0%").attr("y2","100%");jt.append("stop").attr("offset","0%").attr("stop-color",ut),jt.append("stop").attr("offset","100%").attr("stop-color",$t),rn=`url(#${It})`}we.append("polygon").attr("class","bc-bar-connection").attr("points",`${Ue},${Ae} ${Le},${Ee} ${st},${Ee} ${Ge},${Ae}`).attr("fill",rn).attr("opacity",te).attr("pointer-events","none")}}for(let Y=0;Y<E.length-1;Y++){const te=E[Y],ue=E[Y+1];if(ue.isTotal)break;we.append("line").attr("class","bc-waterfall-connector").attr("x1",B(te.x1)).attr("x2",B(te.x1)).attr("y1",(z(te.label)??0)+z.bandwidth()).attr("y2",(z(ue.label)??0)+C).attr("stroke","currentColor").attr("stroke-dasharray","2,2").attr("opacity",.3)}if(we.selectAll(".bc-bar").data(E,Y=>Y.label).enter().append("rect").attr("class","bc-bar").attr("x",Y=>Math.min(B(Y.x0),B(Y.x1))).attr("y",Y=>(z(Y.label)??0)+C).attr("width",Y=>Math.abs(B(Y.x1)-B(Y.x0))).attr("height",z.bandwidth()-C).attr("fill",Y=>Y.isTotal?q:ne.get(Y.label)??X[0]).attr("opacity",Y=>ae.size>0?In(ae,Y.label):null),n.valueLabels){const Y=b,te=qa(((ie=n.horizontalAxis)==null?void 0:ie.numberFormat)??""),ue=_e=>te?te(_e):String(_e);$e(v).append("g").selectAll(".bc-value-label").data(E,_e=>_e.label).enter().append("text").attr("class","bc-value-label").attr("font-size","11px").attr("dominant-baseline","central").attr("y",_e=>(z(_e.label)??0)+C+(z.bandwidth()-C)/2).attr("x",_e=>{const Ae=Math.max(B(_e.x0),B(_e.x1));return Y===_t.Inside?Ae-4:Ae+4}).attr("text-anchor",Y===_t.Inside?"end":"start").attr("fill",_e=>Y===_t.Inside?Br(_e.isTotal?q:ne.get(_e.label)??X[0]):"currentColor").text(_e=>g?_e.label:ue(_e.isTotal?_e.x1:_e.value))}}else{const X=vc(t),q=we.append("g").node();Yu(X,{role:"mark-per-category",parent:q,selector:".bc-bar",data:$,key:te=>te.label,insert:te=>te.append("rect").attr("class","bc-bar"),attrs:te=>({x:Math.min(B(0),B(te.value)),y:(z(te.label)??0)+C,width:Math.abs(B(te.value)-B(0)),height:z.bandwidth()-C,fill:ne.get(te.label)??(n.colors??Pc)[0],opacity:In(ae,te.label)})});const Y=new Kne(we);if(n.tooltips&&Y.use(sl({numberFormat:(de=n.horizontalAxis)==null?void 0:de.numberFormat})),n.crosshair&&Y.use(gc({width:y,height:x,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor,orientation:to.Horizontal})),(ke=n.annotations)!=null&&ke.length&&Y.use(Hu(n.annotations,{scaleX:z,scaleY:B,data:$,width:y,height:x,backgroundColor:Lr(t),orientation:to.Horizontal,transition:o,priorAnnotations:i})),Y.draw($),n.valueLabels){const te=$e(v).append("g");Zne(te,$,B,z,{position:b,colorOverrides:ne,colors:n.colors??Pc,swapLabelValue:g,categoryLabelOffset:C,percent:n.valueLabels==="percent",total:mA($,ue=>ue.value)})}}if(d){const X=$e(v).append("g").attr("class","bc-category-labels");for(const q of V){const Y=z(q)??0;X.append("text").attr("class","bc-category-label").attr("x",2).attr("y",Y+Z6/2).attr("text-anchor","start").attr("dominant-baseline","central").attr("font-size","10px").attr("font-weight","600").attr("fill","currentColor").text(q)}}ii(t,{chartType:"bar-horizontal",margin:_}),r&&(Dr(we.node()),Ir(t,r))}function Xne(t,e,n,o,r=0){const i=o===_t.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 Zne(t,e,n,o,r){const i=r.position??_t.Auto,s=r.categoryLabelOffset??0,a=f=>r.swapLabelValue?f.label:r.percent&&r.total!==void 0?Jm(f.value,r.total):String(f.value);let l=t.select(".bc-value-label-group");l.empty()&&(l=t.append("g").attr("class","bc-value-label-group"));const c=t.node().ownerSVGElement,u=c==null?void 0:c.parentElement,d=vc(u);Yu(d,{role:"value-label",parent:l.node(),selector:".bc-value-label",data:e,key:f=>f.label,insert:f=>f.append("text").attr("class","bc-value-label").attr("font-size","11px").attr("dominant-baseline","central"),attrs:f=>{const h=Xne(f,n,o,i,s);return{x:h.tx,y:h.ty,"text-anchor":h.anchor,fill:h.isInside?Br(r.colorOverrides.get(f.label)??r.colors[0]):"currentColor"}}}),l.selectAll(".bc-value-label").data(e,f=>f.label).text(a)}function Qne(t,e){const n=t.labels.map((o,r)=>({label:o,value:t.values[r]}));return e.sort===en.Ascending?n.sort((o,r)=>o.value-r.value):e.sort===en.Descending&&n.sort((o,r)=>r.value-o.value),n.map(o=>o.label)}function cl(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 K$(t){return t.length===0?0:Math.max(...t.map(n=>n.length))*7+10}function ha(t,e){return e==null?void 0:e.find(n=>n.name===t)}function un(t,e,n,o){const r=ha(t,o);return(r==null?void 0:r.color)??n[e%n.length]}function Jne(t,e){const n=ha(t,e);return(n==null?void 0:n.dash)??"solid"}function eoe(t,e){const n=ha(t,e);return(n==null?void 0:n.lineWidth)??2}function K2(t,e,n){const o=ha(t,n);return!(o!=null&&o.interpolation)||o.interpolation==="global"?e:o.interpolation}function ul(t,e){const n=ha(t,e);return(n==null?void 0:n.hidden)??!1}function Na(t,e,n){const o=ha(t,n);return!(o!=null&&o.labelMode)||o.labelMode==="global"?e:o.labelMode}function Ku(t,e,n){const o=ha(t,n);return(o==null?void 0:o.valueLabels)!==void 0?o.valueLabels:e}function Zf(t,e){const n=ha(t,e);return(n==null?void 0:n.opacity)??1}function toe(t,e,n){const o=ha(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 noe=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"];class ooe extends mo{initialize(){}}function roe(t,e,n={},o=!1){var Ge,st,ut,$t,rn,It,jt,Hn,Wn,mn,tr,mr,nt;oi(o);let r=null,i,s;const a=Nr.for(t);if(o){const Se=ri(t);s=Se==null?void 0:Se.margin,a.detach(),Se&&Se.chartType!=="bar-multi"&&(r=Er(t)),i=new Map;for(const Je of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[ze,ht]of fr(Je))i.set(ze,ht);t.replaceChildren()}const{body:l}=ti(t,n.frame),c=e.series??[],u=c.filter(Se=>!ul(Se.name,n.seriesOverrides)),d=u.map(Se=>Se.name),f=n.colors??noe,h=n.seriesOverrides,m=n.directLabelling===!0||n.directLabelling==="auto"&&n.legend!==!0||!!n.directLabelling&&n.directLabelling!=="auto",b=m?"direct":n.legend!==!1?"legend":"none",g=n.legend!==!1&&!m,v=dr(l).width,y=350,x=n.legendPosition??"top",_=v>0&&v<y&&(x==="left"||x==="right")?"top":x,C=n.legendAnchor??"start",D=u.flatMap(Se=>Se.values),M=hc(D,(Ge=n.verticalAxis)==null?void 0:Ge.range,(st=n.verticalAxis)==null?void 0:st.numberFormat,(ut=n.verticalAxis)==null?void 0:ut.scaleType),$=Fi(v,($t=n.verticalAxis)==null?void 0:$t.labelPosition,(rn=n.horizontalAxis)==null?void 0:rn.labelPosition,(It=n.verticalAxis)==null?void 0:It.direction,M),L=Math.max(0,v-($.left??50)-($.right??20)),E=B2(e.labels,L,n.horizontalAxis);E!==void 0&&($.bottom=E);const N=$.top!=null,T=Math.max(0,v-($.left??50)-($.right??20)),O=g?cl(d,_,T):{width:0,height:0},P=g?O.height+15:0,B={...$};if(g&&_==="top"){const Se=N?15:0;B.top=P+Se}g&&_==="bottom"&&(B.bottom=(B.bottom??24)+P),g&&_==="left"&&(B.left=(B.left??50)+O.width+10),g&&_==="right"&&(B.right=(B.right??20)+O.width+10);const{chartArea:V,width:z,height:G,margin:K}=ni(l,B),ne=Ri(s,K);let[ae,he]=Vu(D,(jt=n.verticalAxis)==null?void 0:jt.range,(Hn=n.verticalAxis)==null?void 0:Hn.scaleType);if(n.valueLabels&&ae<0&&((mn=(Wn=n.verticalAxis)==null?void 0:Wn.range)==null?void 0:mn.min)==null){const Se=he-ae;ae-=Se*.1}let ge=e.labels;if(n.sortMode==="total"){const Se=e.labels.map((Je,ze)=>({label:Je,index:ze,total:u.reduce((ht,sn)=>ht+(sn.values[ze]??0),0)}));Se.sort((Je,ze)=>ze.total-Je.total),ge=Se.map(Je=>Je.label)}const le=oo().domain(ge).range([0,z]).padding(mc(n.barGap)),fe=oo().domain(d).range([0,le.bandwidth()]).padding(.05),we=((tr=n.verticalAxis)==null?void 0:tr.scaleType)==="log",Z=we?rl().domain([ae,he]).nice().range([G,0]):Bn().domain([ae,he]).nice().range([G,0]);a.attach(V,ne),a.update({vertical:{scale:Z,height:G,options:{...n.verticalAxis,gridWidth:z,topPadding:K.top}},horizontal:{scale:le,height:G,options:{...n.horizontalAxis,width:z}}}),!we&&ae<0&&he>0&&$e(V).append("line").attr("class","bc-zero-baseline").attr("x1",0).attr("x2",z).attr("y1",Z(0)).attr("y2",Z(0)).attr("stroke","#666").attr("stroke-width",1);const be=new Map;n.sortMode==="within-groups"&&e.labels.forEach((Se,Je)=>{const ze=u.map(ht=>({name:ht.name,value:ht.values[Je]}));ze.sort((ht,sn)=>sn.value-ht.value),ze.forEach((ht,sn)=>{be.set(`${Se}\0${ht.name}`,d[sn])})});const re=[];e.labels.forEach((Se,Je)=>{u.forEach(ze=>{const ht=c.findIndex(Un=>Un.name===ze.name),sn=n.sortMode==="within-groups"?be.get(`${Se}\0${ze.name}`)??ze.name:ze.name;re.push({label:Se,series:sn,seriesName:ze.name,value:ze.values[Je],seriesIndex:ht})})});const ve=n.valueLabels??!1,ce=V.ownerSVGElement,I=Vi(ce,t,"bars",{x:0,y:0,width:z,height:G}),U=$e(V).append("g").attr("clip-path",`url(#${I})`),j=vc(t),ee=ju(n.highlights),ie=_s(n.colorizes),de=U.append("g").node();Yu(j,{role:"mark-per-cell",parent:de,selector:".bc-bar-multi",data:re,key:Se=>`${Se.label}\0${Se.seriesName}`,insert:Se=>Se.append("rect").attr("class","bc-bar bc-bar-multi"),attrs:Se=>{const Je=un(Se.seriesName,Se.seriesIndex,f,h),ze=Zf(Se.seriesName,h),ht={"data-series":Se.seriesName,x:(le(Se.label)??0)+(fe(Se.series)??0),y:Math.min(Z(0),Z(Se.value)),width:fe.bandwidth(),height:Math.abs(Z(Se.value)-Z(0)),fill:ie.get(Se.seriesName)??Je};return ze<1&&(ht["fill-opacity"]=ze),ee.size>0?{...ht,opacity:In(ee,Se.seriesName)}:ht}});const ke=new ooe(U);if(n.tooltips&&ke.use(sl({numberFormat:(mr=n.verticalAxis)==null?void 0:mr.numberFormat})),n.crosshair&&ke.use(gc({width:z,height:G,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor})),(nt=n.annotations)!=null&&nt.length){const Se=e.labels.map((Je,ze)=>({label:Je,value:Math.max(...u.map(ht=>ht.values[ze]??0))}));ke.use(Hu(n.annotations,{scaleX:le,scaleY:Z,data:Se,width:z,height:G,backgroundColor:Lr(t),transition:o,priorAnnotations:i}))}ke.draw(re),ii(t,{chartType:"bar-multi",margin:K}),r&&(Dr(U.node()),Ir(t,r));const X=new Set;u.forEach(Se=>{Na(Se.name,b,h)==="direct"&&X.add(Se.name)});const q=X.size>0,Y=Lr(t),te=typeof n.directLabelling=="string"?n.directLabelling:n.directLabelling?Mo.Auto:Mo.Off,ue=n.directLabelAnchor??"middle",ye=n.valueLabelPosition??_t.Auto;function _e(){return ye===_t.Inside?_t.Inside:(ye===_t.Outside,_t.Outside)}function Ae(Se){return te===Mo.Inside?_t.Inside:te===Mo.Outside?_t.Outside:ve?_e():_t.Outside}function Ee(Se,Je,ze){return ze==="start"?Se+12:ze==="end"?Se+Je-4:Se+Je/2}const Ue=$e(V).append("g").attr("class","bc-value-labels");re.forEach(Se=>{if(!Ku(Se.seriesName,ve,h))return;const Je=(le(Se.label)??0)+(fe(Se.series)??0)+fe.bandwidth()/2,ze=Math.min(Z(0),Z(Se.value)),ht=Math.abs(Z(Se.value)-Z(0)),sn=_e(),Un=q&&X.has(Se.seriesName),Io=Se.value<0,io=ze+ht;let gr,Fr,Ss;if(sn===_t.Inside){const qe=un(Se.seriesName,Se.seriesIndex,f,h);Fr=Br(qe),Ss="central",Un&&Ae()===_t.Inside?gr=Ee(ze,ht,ue)+14:gr=ze+ht/2}else Fr="currentColor",Io?(gr=Un&&Ae()===_t.Outside?io+16:io+4,Ss="hanging"):(gr=Un&&Ae()===_t.Outside?ze-16:ze-4,Ss="auto");Ue.append("text").attr("class","bc-value-label").attr("data-series",Se.seriesName).attr("x",Je).attr("y",gr).attr("text-anchor","middle").attr("dominant-baseline",Ss).attr("font-size","11px").attr("fill",Fr).text(String(Se.value))}),re.forEach(Se=>{var gr;if(!X.has(Se.seriesName))return;const Je=(le(Se.label)??0)+(fe(Se.series)??0)+fe.bandwidth()/2,ze=Math.min(Z(0),Z(Se.value)),ht=Math.abs(Z(Se.value)-Z(0)),sn=((gr=h==null?void 0:h.find(Fr=>Fr.name===Se.seriesName))==null?void 0:gr.labelText)||Se.seriesName,Un=Ae(),Io=un(Se.seriesName,Se.seriesIndex,f,h),io=$e(V).append("text").attr("class","bc-direct-label").attr("data-series",Se.seriesName).attr("x",Je).attr("text-anchor","middle").attr("font-size","10px").text(sn);if(Un===_t.Inside){const Fr=Ee(ze,ht,ue);io.attr("y",Fr).attr("fill",Br(Io)),ue==="middle"&&io.attr("dominant-baseline","central")}else io.attr("y",ze-4).attr("fill",z$(Io,Y))});const Le=d.filter(Se=>Na(Se,b,h)==="legend");if(g&&Le.length>0){const Se=Le.map(ht=>{const sn=c.findIndex(Un=>Un.name===ht);return un(ht,sn,f,h)});let Je=0,ze=0;if(_==="top"){const ht=N?15:0;ze=-(O.height+10+ht)}else _==="bottom"?ze=G+25:_==="left"?Je=-(O.width+10):_==="right"&&(Je=z+10);il(V,Le,Se,ze,_,C,z,G,Je,[],{left:K.left,right:K.right})}}const ioe={linear:Ru,monotoneX:O2,step:vQ,stepBefore:bQ,stepAfter:yQ,basis:hQ,cardinal:pQ,catmullRom:gQ};function ec(t){return t&&ioe[t]||Ru}function X$(t){const e=(t==null?void 0:t.position)??_t.Auto,n=(t==null?void 0:t.orientation)??to.Vertical,o=t!=null&&t.format?Iu(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===to.Horizontal)if(v=e===_t.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===_t.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?Br(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 Z$="bc-tooltip",Vc=new WeakMap;function fg(t){const e=Vc.get(t);e&&(Vc.delete(t),e())}function soe(){if(document.getElementById("bc-tooltip-styles"))return;const t=document.createElement("style");t.id="bc-tooltip-styles",t.textContent=`
|
|
66
|
+
.${Z$} {
|
|
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 aoe(t){const e=t?qa(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 hg(t,e){const{width:n,height:o,points:r,tooltip:i=!0,crosshair:s=!1,crosshairDirection:a=Oo.Both,crosshairStyle:l=gi.Dashed,crosshairColor:c="#999",format:u=aoe(e.numberFormat),container:d}=e;if(r.length===0){const P=()=>{};return d&&Vc.set(d,P),P}const f=l===gi.Solid?"none":l===gi.Dotted?"2,2":"4,3",h=[...new Set(r.map(P=>P.cx))].sort((P,B)=>P-B),m=$e(t);let b=null;i&&(soe(),b=document.createElement("div"),b.className=Z$,document.body.appendChild(b));const g=".bc-annotations",v=!m.select(g).empty(),y=P=>v?m.insert(P,g):m.append(P),x=s&&(a===Oo.Both||a===Oo.Vertical),_=s&&(a===Oo.Both||a===Oo.Horizontal);let C=null,D=null;x&&(C=y("line").attr("class","bc-crosshair bc-crosshair-v").attr("y1",0).attr("y2",o).attr("stroke",c).attr("stroke-width",1).style("stroke-dasharray",f).attr("pointer-events","none").style("display","none")),_&&(D=y("line").attr("class","bc-crosshair bc-crosshair-h").attr("x1",0).attr("x2",n).attr("stroke",c).attr("stroke-width",1).style("stroke-dasharray",f).attr("pointer-events","none").style("display","none"));const M=y("circle").attr("class","bc-proximity-dot").attr("r",6).attr("fill","none").attr("stroke","#333").attr("stroke-width",1).attr("opacity",.45).attr("pointer-events","none").style("display","none"),$=y("rect").attr("class","bc-proximity-overlay").attr("width",n).attr("height",o).attr("fill","none").attr("pointer-events","all");function L(P,B){if(h.length===0)return null;const V=jz(h,P),z=h[V],G=r.filter(ae=>ae.cx===z);if(G.length===0)return null;let K=G[0],ne=Math.abs(G[0].cy-B);for(let ae=1;ae<G.length;ae++){const he=Math.abs(G[ae].cy-B);he<ne&&(K=G[ae],ne=he)}return K}const E=P=>{const[B,V]=KK(P,t),z=L(B,V);z&&(M.attr("cx",z.cx).attr("cy",z.cy).attr("stroke",z.color).style("display",null),b&&(b.textContent=u(z),b.style.display="block",t$(M.node(),b,{placement:"top",middleware:[Q5(8),e$(),J5()]}).then(({x:G,y:K})=>{b&&(b.style.left=`${G}px`,b.style.top=`${K}px`)})),C&&C.attr("x1",z.cx).attr("x2",z.cx).style("display",null),D&&D.attr("y1",z.cy).attr("y2",z.cy).style("display",null))},N=()=>{M.style("display","none"),b&&(b.style.display="none"),C&&C.style("display","none"),D&&D.style("display","none")},T=$.node();T.addEventListener("mousemove",E),T.addEventListener("mouseleave",N);const O=()=>{T.removeEventListener("mousemove",E),T.removeEventListener("mouseleave",N),$.remove(),M.remove(),b&&(b.remove(),b=null),C&&C.remove(),D&&D.remove(),d&&Vc.get(d)===O&&Vc.delete(d)};return d&&Vc.set(d,O),O}const loe=dQ??S5,coe={circle:$2,square:iQ,diamond:rQ,triangle:S5,triangleDown:loe,cross:nQ,star:cQ};function uoe(t,e,n){switch(n){case _r.First:return t===0;case _r.Last:return t===e-1;case _r.FirstLast:return t===0||t===e-1;case _r.All:default:return!0}}function X2(t,e,n,o,r=!1){const i=o.symbol??yr.Circle,s=o.showOn??_r.FirstLast,a=o.style??zo.Filled,l=o.size??3.5,c=o.opacity??1,u="var(--bs-body-bg, #fff)",d=e.filter(h=>uoe(h.index,n,s)),f=r?Ct():0;if(i===yr.Circle){t.selectAll("path.bc-symbol").remove();const h=t.selectAll("circle.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===zo.Filled?g.color:u).attr("stroke",g=>g.color).attr("stroke-width",a===zo.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===zo.Filled?b.color:u).attr("stroke",b=>b.color).attr("stroke-width",a===zo.Hollow?1.5:0).attr("opacity",c)}else{const h=coe[i]??$2,m=Math.PI*l*l,b=fQ().type(h).size(m);t.selectAll("circle.bc-symbol").remove();const g=t.selectAll("path.bc-symbol").data(d).join(y=>y.append("path").attr("class","bc-symbol").attr("transform",x=>`translate(${x.cx},${x.cy})`).attr("d",b).attr("fill",x=>a===zo.Filled?x.color:u).attr("stroke",x=>x.color).attr("stroke-width",a===zo.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===zo.Filled?y.color:u).attr("stroke",y=>y.color).attr("stroke-width",a===zo.Hollow?1.5:0).attr("opacity",c)}}const Q$="#4e79a7";class doe extends mo{initialize(){this.configDefine("xPos",{defaultValue:(r,i)=>0}),this.configDefine("y",{defaultValue:Bn()}),this.configDefine("color",{defaultValue:Q$}),this.configDefine("curve",{defaultValue:Ru}),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=ia().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=ia().curve(l).x((f,h)=>i(f,h)).y0(c).y1(f=>s(f.value));r.duration(Ct()).attr("fill",a).attr("opacity",u).attr("d",d)},"exit:transition":r=>{r.duration(Ct()).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=Li().curve(l).x((u,d)=>i(u,d)).y(u=>s(u.value));r.attr("fill","none").attr("stroke",a).attr("d",c)},"merge:transition":r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("color"),l=this.config("curve"),c=Li().curve(l).x((u,d)=>i(u,d)).y(u=>s(u.value));r.duration(Ct()).attr("fill","none").attr("stroke",a).attr("d",c)},"exit:transition":r=>{r.duration(Ct()).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(Ct()).attr("cx",(l,c)=>i(l,c)).attr("cy",l=>s(l.value)).attr("r",3).attr("fill",a)},"exit:transition":r=>{r.duration(Ct()).attr("opacity",0).remove()}}})}}function foe(t,e,n={},o=!1){var we,Z,be,re,ve,ce,I,U,j,ee,ie,de,ke;oi(o),fg(t);let r=[],i=[],s=[],a=null,l=null,c,u;const d=Nr.for(t);if(o){const X=ri(t);u=X==null?void 0:X.margin,d.detach(),(X==null?void 0:X.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")):X&&(l=Er(t)),c=new Map;for(const q of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[Y,te]of fr(q))c.set(Y,te);t.replaceChildren()}const{body:f}=ti(t,n.frame),h=dr(f).width,m=hc(e.values,(we=n.verticalAxis)==null?void 0:we.range,(Z=n.verticalAxis)==null?void 0:Z.numberFormat,(be=n.verticalAxis)==null?void 0:be.scaleType),b=Fi(h,(re=n.verticalAxis)==null?void 0:re.labelPosition,(ve=n.horizontalAxis)==null?void 0:ve.labelPosition,(ce=n.verticalAxis)==null?void 0:ce.direction,m),{chartArea:g,width:v,height:y,margin:x}=ni(f,b),_=Ri(u,x),C=ng(e.labels,(I=n.horizontalAxis)==null?void 0:I.range),D=C.map(X=>e.labels[X]),M=C.map(X=>e.values[X]),$=D.map((X,q)=>({label:X,value:M[q]})),L=Km().domain(D).range([0,v]).padding(n.edgePadding?.6:0),E=L,N=X=>L(X.label)??0,T=((U=n.verticalAxis)==null?void 0:U.scaleType)==="log",[O,P]=Vu(M,(j=n.verticalAxis)==null?void 0:j.range,(ee=n.verticalAxis)==null?void 0:ee.scaleType),B=T?rl().domain([O,P]).nice().range([y,0]):Bn().domain([O,P]).nice().range([y,0]),V=B.domain(),z=V[0]<0&&V[1]>0?B(0):void 0;d.attach(g,_),d.update({vertical:{scale:B,height:y,options:{...n.verticalAxis,gridWidth:v,topPadding:x.top}},horizontal:{scale:E,height:y,options:{...n.horizontalAxis,width:v,zeroY:z}}});const G=g.ownerSVGElement,K=Vi(G,t,"plot",{x:-1,y:-1,width:v+2,height:y+2}),ne=$e(g).append("g").attr("clip-path",`url(#${K})`),ae=ne.node(),he=((ie=n.colors)==null?void 0:ie[0])??Q$,ge=ec(n.interpolation),le=n.lineSymbols,fe=new doe($e(ae));if(fe.config({xPos:N,y:B,color:he,curve:ge,areaFill:n.areaFill??!1,areaFillOpacity:n.areaFillOpacity??.2,height:y}),i.length>0||r.length>0||s.length>0){const X=(_==null?void 0:_.dx)??0,q=(_==null?void 0:_.dy)??0,Y=ae.querySelectorAll(":scope > g");Y[0]&&Yo(Y[0],r,X,q),Y[1]&&Yo(Y[1],i,X,q),Y[2]&&Yo(Y[2],s,X,q)}if(n.valueLabels&&fe.use(X$({position:n.valueLabelPosition,orientation:to.Vertical})),fe.draw($),(de=n.annotations)!=null&&de.length&&cg(g,n.annotations,{scaleX:E,scaleY:B,data:$,width:v,height:y,backgroundColor:Lr(t),transition:o,priorAnnotations:c}),$e(ae).selectAll(".bc-dot").attr("fill-opacity",0).attr("stroke-opacity",0).attr("pointer-events","none"),n.tooltips||n.crosshair){const X=$.map(q=>({cx:N(q),cy:B(q.value),label:q.label,value:q.value,color:he}));hg(g,{width:v,height:y,points:X,tooltip:n.tooltips,crosshair:n.crosshair,crosshairDirection:n.crosshairDirection,crosshairStyle:n.crosshairStyle,crosshairColor:n.crosshairColor,numberFormat:(ke=n.verticalAxis)==null?void 0:ke.numberFormat,container:t})}if(le){const X=$.map((Y,te)=>({cx:N(Y),cy:B(Y.value),color:he,index:te}));let q;a?(g.appendChild(a),q=$e(a)):q=$e(g).append("g").attr("class","bc-symbols"),X2(q,X,$.length,le,o)}ii(t,{chartType:"line",margin:x}),l&&(Dr(ne.node()),Ir(t,l))}const Z2=28,J$=18,eT=20;function Q2(t,e,n,o=Z2){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 tT(t,e,n){const{outerRadius:o,fontSize:r=12,bgColor:i="#fff"}=n,s=o+2,a=s+J$,l=Z2/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=Q2(g,m,b,l),y=h?1:-1,x=t.append("g").attr("class","bc-arc-labels");f.forEach((_,C)=>{const D=_.showLabel!==!1,M=_.showValue!==!1;if(!D&&!M)return;const L=v[C]-Math.PI/2,E=Math.cos(L)*s,N=Math.sin(L)*s,T=Math.cos(L)*a,O=Math.sin(L)*a,P=T+y*eT;x.append("polyline").attr("class","bc-arc-label-line").attr("points",`${E},${N} ${T},${O} ${P},${O}`).attr("fill","none").attr("stroke","var(--bc-text-color, #999)").attr("stroke-width",1).attr("opacity",.5);const B=P+y*4,V=x.append("text").attr("class","bc-arc-direct-label").attr("x",B).attr("y",O).attr("text-anchor",h?"start":"end").attr("font-size",`${r}px`);if(D&&V.append("tspan").attr("x",B).attr("dy",M?"-0.1em":"0.35em").attr("font-weight","bold").attr("fill",z$(_.color,i)).text(_.label),M){const z=_.displayAsPercentage&&_.percentage!=null?`${Math.round(_.percentage)}%`:String(_.value);V.append("tspan").attr("x",B).attr("dy",D?"1.2em":"0.35em").attr("fill","var(--bc-text-color, #666)").text(z)}})}d(u,!0),d(c,!1)}const nT=.3;function oT(t,e,n){const{outerRadius:o,innerRadius:r=0,fontSize:i=12}=n,s=(r+o)/2,a=t.append("g").attr("class","bc-arc-labels-inside");for(const l of e){if(l.endAngle-l.startAngle<nT)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=Br(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 hoe(t,e,n){const{outerRadius:o,innerRadius:r=0,fontSize:i=12,bgColor:s}=n,a=(r+o)/2,l=[],c=[];for(const u of e){const d=u.endAngle-u.startAngle,f=d*a,h=u.label.length*7;f>h*1.2&&d>=nT?l.push(u):c.push(u)}l.length>0&&oT(t,l,{outerRadius:o,innerRadius:r,fontSize:i}),c.length>0&&tT(t,c,{outerRadius:o,fontSize:i,bgColor:s})}function poe(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=J$+eT+6+4+n*7+6,i=t.length*Z2/2,s=Math.max(10,i-e+20);return{left:o,right:o,top:s,bottom:s}}const rT=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"];class moe extends mo{initialize(){this.configDefine("xPos",{defaultValue:r=>0}),this.configDefine("y",{defaultValue:Bn()}),this.configDefine("colors",{defaultValue:rT}),this.configDefine("labels",{defaultValue:[]}),this.configDefine("curve",{defaultValue:Ru}),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=>ia().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(Ct()).attr("data-series",d=>d.colorIndex).attr("fill",d=>a[d.colorIndex%a.length]).attr("opacity",u).attr("d",d=>ia().curve(l).x((h,m)=>i(m)).y0(c).y1(h=>s(h))(d.values))},"exit:transition":r=>{r.duration(Ct()).attr("opacity",0).remove()}}}),this.layer("lines",n,{dataBind:(r,i)=>r.selectAll(".bc-line").data(i,s=>s.name),insert:r=>r.append("path").attr("class","bc-line"),events:{enter:r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("colors"),l=this.config("highlightTargets"),c=l.size>0;r.attr("data-series",u=>u.colorIndex).attr("fill","none").attr("stroke",u=>a[u.colorIndex%a.length]).attr("stroke-width",2).attr("opacity",u=>c?In(l,u.name,1):null).attr("d",u=>{const d=this.config("curve");return Li().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(Ct()).attr("data-series",u=>u.colorIndex).attr("fill","none").attr("stroke",u=>a[u.colorIndex%a.length]).attr("stroke-width",2).attr("opacity",u=>c?In(l,u.name,1):null).attr("d",u=>{const d=this.config("curve");return Li().curve(d).x((h,m)=>i(m)).y(h=>s(h))(u.values)})},"exit:transition":r=>{r.duration(Ct()).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(Ct()).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(Ct()).attr("opacity",0).remove()}}})}}function goe(t,e,n={},o=!1){var mr,nt,Se,Je,ze,ht,sn,Un,Io,io,gr,Fr,Ss;oi(o),fg(t);let r=e,i=[],s=[],a=[],l=[],c=null,u,d;const f=Nr.for(t);if(o){const qe=ri(t);d=qe==null?void 0:qe.margin,f.detach(),(qe==null?void 0:qe.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"))):qe&&(c=Er(t)),u=new Map;for(const ct of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[Pt,Wt]of fr(ct))u.set(Pt,Wt);t.replaceChildren()}const{body:h}=ti(t,n.frame),m=r.series??[];let b=m.filter(qe=>!ul(qe.name,n.seriesOverrides));(n.sortMode==="total"||n.sortMode==="within-groups")&&(b=[...b].sort((qe,ct)=>{const Pt=qe.values.reduce((Jn,Gn)=>Jn+Gn,0);return ct.values.reduce((Jn,Gn)=>Jn+Gn,0)-Pt}));const g=n.colors??rT,v=b.map(qe=>qe.name),y=_s(n.colorizes),x=n.seriesOverrides,_=n.directLabelling===!0||n.directLabelling==="auto"&&n.legend!==!0||!!n.directLabelling&&n.directLabelling!=="auto",C=_?"direct":n.legend!==!1?"legend":"none",D=v.filter(qe=>Na(qe,C,x)==="direct"),M=n.legend!==!1&&!_,$=dr(h).width,L=350,E=n.legendPosition??"top",N=$>0&&$<L&&(E==="left"||E==="right")?"top":E,T=n.legendAnchor??"start",O=ng(r.labels,(mr=n.horizontalAxis)==null?void 0:mr.range),P=O.map(qe=>r.labels[qe]);b=b.map(qe=>({...qe,values:O.map(ct=>qe.values[ct])})),r={...r,labels:P,series:b};const B=b.flatMap(qe=>qe.values),V=hc(B,(nt=n.verticalAxis)==null?void 0:nt.range,(Se=n.verticalAxis)==null?void 0:Se.numberFormat,(Je=n.verticalAxis)==null?void 0:Je.scaleType),z=Fi($,(ze=n.verticalAxis)==null?void 0:ze.labelPosition,(ht=n.horizontalAxis)==null?void 0:ht.labelPosition,(sn=n.verticalAxis)==null?void 0:sn.direction,V),G=D.length>0?K$(D):0,K=z.top!=null,ne=Math.max(0,$-(z.left??50)-(z.right??20)-G),ae=M?cl(v,N,ne):{width:0,height:0},he=M?ae.height+15:0,ge={...z};if(M&&N==="top"){const qe=K?15:0;ge.top=he+qe}M&&N==="bottom"&&(ge.bottom=(ge.bottom??24)+he),M&&N==="left"&&(ge.left=(ge.left??50)+ae.width+10),M&&N==="right"&&(ge.right=(ge.right??20)+ae.width+10),G>0&&(ge.right=(ge.right??20)+G);const{chartArea:le,width:fe,height:we,margin:Z}=ni(h,ge),be=Ri(d,Z),[re,ve]=Vu(B,(Un=n.verticalAxis)==null?void 0:Un.range,(Io=n.verticalAxis)==null?void 0:Io.scaleType),ce=Km().domain(r.labels).range([0,fe]).padding(n.edgePadding?.6:0),I=ce,U=qe=>ce(r.labels[qe])??0,ee=((io=n.verticalAxis)==null?void 0:io.scaleType)==="log"?rl().domain([re,ve]).nice().range([we,0]):Bn().domain([re,ve]).nice().range([we,0]),ie=ee.domain(),de=ie[0]<0&&ie[1]>0?ee(0):void 0;f.attach(le,be),f.update({vertical:{scale:ee,height:we,options:{...n.verticalAxis,gridWidth:fe,topPadding:Z.top}},horizontal:{scale:I,height:we,options:{...n.horizontalAxis,width:fe,zeroY:de}}});const ke=le.ownerSVGElement,X=Vi(ke,t,"plot",{x:0,y:0,width:fe,height:we}),q=$e(le).append("g").attr("clip-path",`url(#${X})`),Y=q.node(),te=b.map(qe=>({name:qe.name,values:qe.values,colorIndex:m.findIndex(ct=>ct.name===qe.name)})),ue=ec(n.interpolation);(gr=n.areaFills)!=null&&gr.length&&voe(Y,n.areaFills,b,U,r.labels.length,ee,ue);const ye=[];b.forEach((qe,ct)=>{r.labels.forEach((Pt,Wt)=>{ye.push({label:Pt,value:qe.values[Wt],series:qe.name,colorIndex:ct})})});const _e=n.lineSymbols,Ae={solid:"",dotted:"2,4",dashed:"8,4","dash-dot":"8,4,2,4"},Ee=n.valueLabels??!1,Ue=new Set((n.highlights??[]).map(qe=>qe.target)),Le=new moe($e(Y));Le.config({xPos:U,y:ee,colors:g,labels:r.labels,curve:ue,areaFill:n.areaFill??!1,areaFillOpacity:n.areaFillOpacity??.2,height:we,dots:ye,highlightTargets:Ue});const Ge=new Set(te.map(qe=>qe.name)),st=i.filter(qe=>{var ct;return Ge.has(((ct=qe.__data__)==null?void 0:ct.name)??"")}),ut=s.filter(qe=>{var ct;return Ge.has(((ct=qe.__data__)==null?void 0:ct.name)??"")}),$t=a.filter(qe=>{var ct;return Ge.has(((ct=qe.__data__)==null?void 0:ct.series)??"")});if(ut.length>0||st.length>0||$t.length>0){const qe=(be==null?void 0:be.dx)??0,ct=(be==null?void 0:be.dy)??0,Pt=Y.querySelectorAll(":scope > g");Pt[0]&&Yo(Pt[0],st,qe,ct),Pt[1]&&Yo(Pt[1],ut,qe,ct),Pt[2]&&Yo(Pt[2],$t,qe,ct)}if(Le.draw(te),(Fr=n.annotations)!=null&&Fr.length){const qe=r.labels.map((ct,Pt)=>{var Wt;return{label:ct,value:((Wt=b[0])==null?void 0:Wt.values[Pt])??0}});cg(le,n.annotations,{scaleX:I,scaleY:ee,data:qe,width:fe,height:we,backgroundColor:Lr(t),transition:o,priorAnnotations:u})}const rn=$e(Y).append("g").attr("class","bc-value-labels");if(ye.forEach(qe=>{if(!Ku(qe.series,Ee,x))return;const ct=U(r.labels.indexOf(qe.label)),Pt=ee(qe.value);rn.append("text").attr("class","bc-value-label").attr("data-series",qe.colorIndex).attr("x",ct).attr("y",Pt-8).attr("text-anchor","middle").attr("font-size","11px").attr("fill","currentColor").text(String(qe.value))}),$e(Y).selectAll(".bc-line").each(function(qe){const ct=qe,Pt=un(ct.name,ct.colorIndex,g,x),Wt=eoe(ct.name,x),Jn=Jne(ct.name,x),Gn=K2(ct.name,n.interpolation??"linear",x),ai=o?$e(this).transition().duration(Ct()):$e(this);if(ai.attr("stroke",y.get(ct.name)??Pt).attr("stroke-width",Wt),ai.attr("opacity",In(Ue,ct.name,1)),Jn!=="solid"&&$e(this).attr("stroke-dasharray",Ae[Jn]??""),Gn!==(n.interpolation??"linear")){const Cs=ec(Gn),wc=Li().curve(Cs).x((va,Zg)=>U(Zg)).y(va=>ee(va));ai.attr("d",wc(ct.values))}}),$e(Y).selectAll(".bc-area").each(function(qe){const ct=qe,Pt=un(ct.name,ct.colorIndex,g,x),Wt=o?$e(this).transition().duration(Ct()):$e(this);Wt.attr("fill",y.get(ct.name)??Pt),Wt.attr("opacity",In(Ue,ct.name,n.areaFillOpacity??.2))}),$e(Y).selectAll(".bc-dot").attr("fill-opacity",0).attr("stroke-opacity",0).attr("pointer-events","none"),n.tooltips||n.crosshair){const qe=ye.map(ct=>({cx:U(r.labels.indexOf(ct.label)),cy:ee(ct.value),label:ct.label,value:ct.value,series:ct.series,color:un(ct.series,ct.colorIndex,g,x)}));hg(le,{width:fe,height:we,points:qe,tooltip:n.tooltips,crosshair:n.crosshair,crosshairDirection:n.crosshairDirection,crosshairStyle:n.crosshairStyle,crosshairColor:n.crosshairColor,numberFormat:(Ss=n.verticalAxis)==null?void 0:Ss.numberFormat,container:t})}const It=_e?{symbolShape:_e.symbol,symbolShowOn:_e.showOn,symbolStyle:_e.style,symbolSize:_e.size,symbolOpacity:_e.opacity}:void 0,jt=r.labels.length;b.forEach((qe,ct)=>{const Pt=toe(qe.name,It,x);if(!Pt)return;const Wt={symbol:Pt.symbolShape??(_e==null?void 0:_e.symbol)??yr.Circle,showOn:Pt.symbolShowOn??(_e==null?void 0:_e.showOn)??_r.FirstLast,style:Pt.symbolStyle??(_e==null?void 0:_e.style)??zo.Filled,size:Pt.symbolSize??(_e==null?void 0:_e.size)??3.5,opacity:Pt.symbolOpacity??(_e==null?void 0:_e.opacity)??1},Jn=r.labels.map((wc,va)=>({cx:U(va),cy:ee(qe.values[va]),color:un(qe.name,ct,g,x),index:va})),Gn=l.find(wc=>wc.getAttribute("data-series-name")===qe.name);let ai,Cs=!1;Gn?(le.appendChild(Gn),ai=$e(Gn),Cs=!0):ai=$e(le).append("g").attr("class","bc-symbols").attr("data-series",ct).attr("data-series-name",qe.name),X2(ai,Jn,jt,Wt,o&&Cs)});const Hn=r.labels.length-1,Wn=U(Hn)+6,mn=[];if(b.forEach((qe,ct)=>{var Gn;if(Na(qe.name,C,x)!=="direct")return;const Wt=qe.values[Hn],Jn=((Gn=x==null?void 0:x.find(ai=>ai.name===qe.name))==null?void 0:Gn.labelText)||qe.name;mn.push({name:qe.name,index:ct,naturalY:ee(Wt),text:Jn})}),mn.length>0){mn.sort((Wt,Jn)=>Wt.naturalY-Jn.naturalY);const qe=mn.map(Wt=>Wt.naturalY),Pt=Q2(qe,0,we,14);mn.forEach((Wt,Jn)=>{$e(le).append("text").attr("class","bc-direct-label").attr("data-series",Wt.index).attr("x",Wn).attr("y",Pt[Jn]).attr("dy","0.35em").attr("font-size","11px").attr("fill",un(Wt.name,Wt.index,g,x)).text(Wt.text)})}const tr=v.filter(qe=>Na(qe,C,x)==="legend");if(M&&tr.length>0){const qe=tr.map(Wt=>{const Jn=m.findIndex(Gn=>Gn.name===Wt);return un(Wt,Jn,g,x)});let ct=0,Pt=0;if(N==="top"){const Wt=K?15:0;Pt=-(ae.height+10+Wt)}else N==="bottom"?Pt=we+25:N==="left"?ct=-(ae.width+10):N==="right"&&(ct=fe+10);il(le,tr,qe,Pt,N,T,fe,we,ct,[],{left:Z.left,right:Z.right})}ii(t,{chartType:"line-multi",margin:Z}),c&&(Dr(q.node()),Ir(t,c))}function voe(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?ec(l.interpolation):s,f=(l.opacity??30)/100,h=l.color??"#ccc",m=l.negativeColor;if(m)yoe(a,c.values,u.values,o,i,d,h,m,f);else{const b=ia().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 boe(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 yoe(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]),_=boe(g,y,v,x);if(_!==null&&_>0&&_<1){const C=b+_*(o(m+1)-b),D=g+_*(y-g),M=v+_*(x-v);u.push({x:C,fromY:D,toY:M})}}}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 xoe=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"];class woe extends mo{initialize(){}}function _oe(t,e,n={},o=!1){iT(t,e,n,.6,o)}function iT(t,e,n,o,r=!1){var ve;oi(r);let i=null,s;if(r){const ce=ri(t),I=o>0?"donut":"pie";ce&&ce.chartType!==I&&(i=Er(t)),s=new Map;for(const U of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[j,ee]of fr(U))s.set(j,ee);t.replaceChildren()}const{body:a}=ti(t,n.frame);let l=[...e.labels],c=[...e.values];if(n.sort===en.Ascending||n.sort===en.Descending){const ce=l.map((I,U)=>({label:I,value:c[U]}));ce.sort((I,U)=>n.sort===en.Ascending?I.value-U.value:U.value-I.value),l=ce.map(I=>I.label),c=ce.map(I=>I.value)}if(n.sliceMax&&n.sliceMax>0&&l.length>n.sliceMax){const ce=n.sliceMax-1,I=l.slice(0,ce),U=c.slice(0,ce),j=c.slice(ce).reduce((ee,ie)=>ee+ie,0);I.push(n.sliceGroupLabel??"Others"),U.push(j),l=I,c=U}const u=c.reduce((ce,I)=>ce+I,0),d=c.map(ce=>u>0?ce/u*100:0),f=n.colors??xoe,h=f.length<l.length&&f.length>=2?rt.scale(f).mode("lch").colors(l.length):f,m=typeof n.directLabelling=="string"?n.directLabelling:n.directLabelling?Mo.Auto:Mo.Off,b=!!m&&!(m===Mo.Auto&&n.legend===!0),v=(n.showValues??!0)&&!b?c.map((ce,I)=>`(${n.displayAsPercentage?`${Math.round(d[I])}%`:String(ce)})`):[],y=n.legend!==!1&&!b,x=dr(a).width,_=350,C=n.legendPosition??"top",D=x>0&&x<_&&(C==="left"||C==="right")?"top":C,M=n.legendAnchor??"start",$=v.length>0?l.map((ce,I)=>`${ce} ${v[I]}`):l,L=Math.max(0,x-50-20),E=y?cl($,D,L):{width:0,height:0},N=y?E.height+15:0,T={};if(y&&D==="top"&&(T.top=N),y&&D==="bottom"&&(T.bottom=24+N),y&&D==="left"&&(T.left=50+E.width+10),y&&D==="right"&&(T.right=20+E.width+10),b){const ce=dr(a),I=20,U=ce.width-2*I,j=(ce.height>0?ce.height:400)-2*I,ee=Math.min(U,j)/2,ie=poe(l,ee);T.left=(T.left??I)+ie.left,T.right=(T.right??I)+ie.right,T.top=(T.top??I)+ie.top,T.bottom=(T.bottom??I)+ie.bottom}const{chartArea:O,width:P,height:B,margin:V}=ni(a,T),z=Math.min(P,B)/2,G=z*o,K=A2().domain(l).range(h),ne=tQ().sort(null),ae=QZ().innerRadius(G).outerRadius(z),he=$e(O).append("g").attr("transform",`translate(${P/2},${B/2})`),ge=_s(n.colorizes),le=ne(c),fe=le.map((ce,I)=>({label:l[I],arc:ce,color:ge.get(l[I])??K(l[I])})),we=vc(t),Z=ju(n.highlights),be=he.append("g").node();Yu(we,{role:"mark-per-category",parent:be,selector:".bc-arc",data:fe,key:ce=>ce.label,insert:ce=>ce.append("path").attr("class","bc-arc"),attrs:ce=>{const I={d:ae(ce.arc)??"",fill:ce.color};return Z.size>0?{...I,opacity:In(Z,ce.label)}:I}});const re=new woe(he);if(n.tooltips&&re.use(sl()),re.draw(fe),(ve=n.annotations)!=null&&ve.length){const ce=n.annotations.filter(I=>I.kind==="free");ce.length&&Hu(ce,{scaleX:oo().domain([]).range([0,P]),scaleY:Bn().domain([0,1]).range([B,0]),data:[],width:P,height:B,backgroundColor:Lr(t),transition:r,priorAnnotations:s}).postDraw({base:$e(O)},void 0)}if(b){const ce=le.map((ee,ie)=>({label:l[ie],value:ee.data,startAngle:ee.startAngle,endAngle:ee.endAngle,color:K(l[ie]),percentage:d[ie],displayAsPercentage:n.displayAsPercentage,showLabel:n.showLabels??!0,showValue:n.showValues??!0})),I=he,U=Lr(t),j={outerRadius:z,innerRadius:G,bgColor:U};m===Mo.Inside?oT(I,ce,j):m===Mo.Auto?hoe(I,ce,j):tT(I,ce,j)}if(n.showTotal&&o>0&&!n.displayAsPercentage){const ce=String(u);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(ce)}if(y){let ce=0,I=0;D==="top"?I=-(E.height+10):D==="bottom"?I=B+25:D==="left"?ce=-(E.width+10):D==="right"&&(ce=P+10),il(O,l,h,I,D,M,P,B,ce,v,{left:V.left,right:V.right})}ii(t,{chartType:o>0?"donut":"pie"}),i&&(Dr(he.node()),Ir(t,i))}function koe(t,e,n={},o=!1){iT(t,e,n,0,o)}const sT="#4e79a7";class Soe extends mo{initialize(){this.configDefine("xPos",{defaultValue:(r,i)=>0}),this.configDefine("y",{defaultValue:Bn()}),this.configDefine("color",{defaultValue:sT}),this.configDefine("curve",{defaultValue:O2}),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=ia().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=ia().curve(l).x((f,h)=>i(f,h)).y0(c).y1(f=>s(f.value));r.duration(Ct()).attr("fill",a).attr("opacity",u).attr("d",d)},"exit:transition":r=>{r.duration(Ct()).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=Li().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=Li().curve(l).x((u,d)=>i(u,d)).y(u=>s(u.value));r.duration(Ct()).attr("fill","none").attr("stroke",a).attr("stroke-width",2).attr("d",c)},"exit:transition":r=>{r.duration(Ct()).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(Ct()).attr("cx",(l,c)=>i(l,c)).attr("cy",l=>s(l.value)).attr("r",3).attr("fill",a)},"exit:transition":r=>{r.duration(Ct()).attr("opacity",0).remove()}}})}}function Coe(t,e,n={},o=!1){var we,Z,be,re,ve,ce,I,U,j,ee,ie,de,ke;oi(o),fg(t);let r=[],i=[],s=[],a=null,l=null,c,u;const d=Nr.for(t);if(o){const X=ri(t);u=X==null?void 0:X.margin,d.detach(),(X==null?void 0:X.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")):X&&(l=Er(t)),c=new Map;for(const q of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[Y,te]of fr(q))c.set(Y,te);t.replaceChildren()}const{body:f}=ti(t,n.frame),h=dr(f).width,m=hc(e.values,(we=n.verticalAxis)==null?void 0:we.range,(Z=n.verticalAxis)==null?void 0:Z.numberFormat,(be=n.verticalAxis)==null?void 0:be.scaleType),b=Fi(h,(re=n.verticalAxis)==null?void 0:re.labelPosition,(ve=n.horizontalAxis)==null?void 0:ve.labelPosition,(ce=n.verticalAxis)==null?void 0:ce.direction,m),{chartArea:g,width:v,height:y,margin:x}=ni(f,b),_=Ri(u,x),C=ng(e.labels,(I=n.horizontalAxis)==null?void 0:I.range),D=C.map(X=>e.labels[X]),M=C.map(X=>e.values[X]),$=D.map((X,q)=>({label:X,value:M[q]})),L=Km().domain(D).range([0,v]).padding(n.edgePadding?.6:0),E=L,N=X=>L(X.label)??0,T=((U=n.verticalAxis)==null?void 0:U.scaleType)==="log",[O,P]=Vu(M,(j=n.verticalAxis)==null?void 0:j.range,(ee=n.verticalAxis)==null?void 0:ee.scaleType),B=T?rl().domain([O,P]).nice().range([y,0]):Bn().domain([O,P]).nice().range([y,0]),V=B.domain(),z=V[0]<0&&V[1]>0?B(0):void 0;d.attach(g,_),d.update({vertical:{scale:B,height:y,options:{...n.verticalAxis,gridWidth:v,topPadding:x.top}},horizontal:{scale:E,height:y,options:{...n.horizontalAxis,width:v,zeroY:z}}});const G=g.ownerSVGElement,K=Vi(G,t,"plot",{x:0,y:0,width:v,height:y}),ne=$e(g).append("g").attr("clip-path",`url(#${K})`),ae=ne.node(),he=((ie=n.colors)==null?void 0:ie[0])??sT,ge=ec(n.interpolation??"monotoneX"),le=n.lineSymbols,fe=new Soe($e(ae));if(fe.config({xPos:N,y:B,color:he,curve:ge,areaFillOpacity:n.areaFillOpacity??.25,height:y}),i.length>0||r.length>0||s.length>0){const X=(_==null?void 0:_.dx)??0,q=(_==null?void 0:_.dy)??0,Y=ae.querySelectorAll(":scope > g");Y[0]&&Yo(Y[0],r,X,q),Y[1]&&Yo(Y[1],i,X,q),Y[2]&&Yo(Y[2],s,X,q)}if(n.valueLabels&&fe.use(X$({position:n.valueLabelPosition,orientation:to.Vertical})),fe.draw($),(de=n.annotations)!=null&&de.length&&cg(g,n.annotations,{scaleX:E,scaleY:B,data:$,width:v,height:y,backgroundColor:Lr(t),transition:o,priorAnnotations:c}),$e(ae).selectAll(".bc-dot").attr("fill-opacity",0).attr("stroke-opacity",0).attr("pointer-events","none"),n.tooltips||n.crosshair){const X=$.map(q=>({cx:N(q),cy:B(q.value),label:q.label,value:q.value,color:he}));hg(g,{width:v,height:y,points:X,tooltip:n.tooltips,crosshair:n.crosshair,crosshairDirection:n.crosshairDirection,crosshairStyle:n.crosshairStyle,crosshairColor:n.crosshairColor,numberFormat:(ke=n.verticalAxis)==null?void 0:ke.numberFormat,container:t})}if(le){const X=$.map((Y,te)=>({cx:N(Y),cy:B(Y.value),color:he,index:te}));let q;a?(g.appendChild(a),q=$e(a)):q=$e(g).append("g").attr("class","bc-symbols"),X2(q,X,$.length,le,o)}ii(t,{chartType:"area",margin:x}),l&&(Dr(ne.node()),Ir(t,l))}function J2(t){const e=t.series??[];if(e.length===0)return[];const n=e.map(s=>s.name);let o=!1;const r=t.labels.map((s,a)=>{const l={_index:a};return e.forEach(c=>{const u=c.values[a]??0;u<0&&(o=!0),l[c.name]=u}),l});return $5().keys(n).order(v0).offset(o?kQ:g0)(r)}function ex(t){const e=t.series??[];if(e.length===0)return[];const n=e.map(s=>s.name),o=t.labels.map((s,a)=>{const l={_index:a};return e.forEach(c=>{l[c.name]=c.values[a]??0}),l}),i=$5().keys(n).order(v0).offset(_Q)(o);for(const s of i)for(const a of s)a[0]*=100,a[1]*=100;return i}const aT=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"];class Aoe extends mo{initialize(){this.configDefine("xPos",{defaultValue:o=>0}),this.configDefine("colors",{defaultValue:aT}),this.configDefine("curve",{defaultValue:O2}),this.configDefine("areaFillOpacity",{defaultValue:.85}),this.configDefine("highlightTargets",{defaultValue:new Set});const e=this.base.append("g"),n=this.base.append("g");this.layer("stacked-areas",e,{dataBind:(o,r)=>o.selectAll(".bc-area").data(r,i=>i.name),insert:o=>o.append("path").attr("class","bc-area"),events:{enter:o=>{const r=this.config("xPos"),i=this.config("colors"),s=this.config("curve"),a=this.config("areaFillOpacity"),l=this.config("highlightTargets"),c=l.size>0;o.attr("data-series",u=>u.colorIndex).attr("fill",u=>i[u.colorIndex%i.length]).attr("opacity",u=>c?In(l,u.name,a):a).attr("d",u=>ia().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(Ct()).attr("data-series",u=>u.colorIndex).attr("fill",u=>i[u.colorIndex%i.length]).attr("opacity",u=>c?In(l,u.name,a):a).attr("d",u=>ia().curve(s).x((f,h)=>r(h)).y0(f=>f[0]).y1(f=>f[1])(u.points))},"exit:transition":o=>{o.duration(Ct()).attr("opacity",0).remove()}}}),this.layer("line-edges",n,{dataBind:(o,r)=>o.selectAll(".bc-line").data(r,i=>i.name),insert:o=>o.append("path").attr("class","bc-line"),events:{enter:o=>{const r=this.config("xPos"),i=this.config("colors"),s=this.config("curve"),a=this.config("highlightTargets"),l=a.size>0;o.attr("data-series",c=>c.colorIndex).attr("fill","none").attr("stroke",c=>i[c.colorIndex%i.length]).attr("stroke-width",1).attr("opacity",c=>l?In(a,c.name,1):null).attr("d",c=>Li().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(Ct()).attr("data-series",c=>c.colorIndex).attr("fill","none").attr("stroke",c=>i[c.colorIndex%i.length]).attr("stroke-width",1).attr("opacity",c=>l?In(a,c.name,1):null).attr("d",c=>Li().curve(s).x((d,f)=>r(f)).y(d=>d[1])(c.points))},"exit:transition":o=>{o.duration(Ct()).attr("opacity",0).remove()}}})}}function $oe(t,e,n={},o=!1){var $t,rn,It,jt,Hn,Wn,mn,tr,mr;oi(o),fg(t);let r=e,i=[],s=[],a=null,l,c;const u=Nr.for(t);if(o){const nt=ri(t);c=nt==null?void 0:nt.margin,u.detach(),(nt==null?void 0:nt.chartType)==="area-stacked"?(i=Array.from(t.querySelectorAll(".bc-frame .bc-area")),s=Array.from(t.querySelectorAll(".bc-frame .bc-line"))):nt&&(a=Er(t)),l=new Map;for(const Se of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[Je,ze]of fr(Se))l.set(Je,ze);t.replaceChildren()}const{body:d}=ti(t,n.frame),f=ng(r.labels,($t=n.horizontalAxis)==null?void 0:$t.range);if(f.length<r.labels.length){const nt=f.map(Je=>r.labels[Je]),Se=(r.series??[]).map(Je=>({...Je,values:f.map(ze=>Je.values[ze])}));r={labels:nt,values:f.map(Je=>r.values[Je]),series:Se}}const h=r.series??[],m=h.filter(nt=>!ul(nt.name,n.seriesOverrides)),b=n.colors??aT,g=m.map(nt=>nt.name),v=n.seriesOverrides,y=_s(n.colorizes),x=n.directLabelling===!0||n.directLabelling==="auto"&&n.legend!==!0||!!n.directLabelling&&n.directLabelling!=="auto",_=x?"direct":n.legend!==!1?"legend":"none",C=g.filter(nt=>Na(nt,_,v)==="direct"),D=n.legend!==!1&&!x,M=dr(d).width,$=350,L=n.legendPosition??"top",E=M>0&&M<$&&(L==="left"||L==="right")?"top":L,N=n.legendAnchor??"start",T=n.stacked!==!1,O=n.stackPercent===!0||n.stackMode===Fl.Percent,P=n.areaSortMode??en.None,B=n.areaLines!==!1,V=[...m];if(P!==en.None){const nt=new Map(V.map(Se=>[Se.name,Se.values.reduce((Je,ze)=>Je+ze,0)]));V.sort((Se,Je)=>{const ze=(nt.get(Se.name)??0)-(nt.get(Je.name)??0);return P===en.Ascending?ze:-ze})}const z={labels:r.labels,values:r.values,series:V},G=O?ex(z):J2(z);let K=0;if(T)for(const nt of G)for(const Se of nt)Se[1]>K&&(K=Se[1]);else for(const nt of V)for(const Se of nt.values)Se>K&&(K=Se);O&&(K=100);const ne=[0,K],ae=((rn=n.verticalAxis)==null?void 0:rn.numberFormat)??(O?"|d|%":void 0),he=hc(ne,(It=n.verticalAxis)==null?void 0:It.range,ae,(jt=n.verticalAxis)==null?void 0:jt.scaleType),ge=Fi(M,(Hn=n.verticalAxis)==null?void 0:Hn.labelPosition,(Wn=n.horizontalAxis)==null?void 0:Wn.labelPosition,(mn=n.verticalAxis)==null?void 0:mn.direction,he),le=C.length>0?K$(C):0,fe=ge.top!=null,we=Math.max(0,M-(ge.left??50)-(ge.right??20)-le),Z=D?cl(g,E,we):{width:0,height:0},be=D?Z.height+15:0,re={...ge};if(D&&E==="top"){const nt=fe?15:0;re.top=be+nt}D&&E==="bottom"&&(re.bottom=(re.bottom??24)+be),D&&E==="left"&&(re.left=(re.left??50)+Z.width+10),D&&E==="right"&&(re.right=(re.right??20)+Z.width+10),le>0&&(re.right=(re.right??20)+le);const{chartArea:ve,width:ce,height:I,margin:U}=ni(d,re),j=Ri(c,U),ee=Km().domain(r.labels).range([0,ce]).padding(n.edgePadding?.6:0),ie=ee,de=nt=>ee(r.labels[nt])??0,ke=Bn().domain([0,K]).nice().range([I,0]);u.attach(ve,j),u.update({vertical:{scale:ke,height:I,options:{...n.verticalAxis,numberFormat:ae,gridWidth:ce,topPadding:U.top}},horizontal:{scale:ie,height:I,options:{...n.horizontalAxis,width:ce}}});const X=ve.ownerSVGElement,q=Vi(X,t,"plot",{x:0,y:0,width:ce,height:I}),Y=$e(ve).append("g").attr("clip-path",`url(#${q})`),te=Y.node(),ue=ec(n.interpolation??"monotoneX"),ye=G.map(nt=>{const Se=h.findIndex(ze=>ze.name===nt.key);let Je;if(T)Je=Array.from(nt).map(ze=>[ke(ze[0]),ke(ze[1])]);else{const ze=V.find(ht=>ht.name===nt.key);Je=((ze==null?void 0:ze.values)??[]).map(ht=>[ke(0),ke(ht)])}return{name:nt.key,points:Je,colorIndex:Se>=0?Se:0}}),_e=new Set((n.highlights??[]).map(nt=>nt.target)),Ae=_e.size>0,Ee=n.areaFillOpacity!=null?n.areaFillOpacity:.85,Ue=new Aoe($e(te));if(Ue.config({xPos:de,colors:b,curve:ue,areaFillOpacity:Ee,highlightTargets:_e}),i.length>0||s.length>0){const nt=(j==null?void 0:j.dx)??0,Se=(j==null?void 0:j.dy)??0,Je=te.querySelectorAll(":scope > g");Je[0]&&Yo(Je[0],i,nt,Se),Je[1]&&Yo(Je[1],s,nt,Se)}if(Ue.draw(ye),$e(te).selectAll(".bc-area").each(function(nt){const Se=nt,Je=y.get(Se.name)??un(Se.name,Se.colorIndex,b,v),ze=o?$e(this).transition().duration(Ct()):$e(this);ze.attr("fill",Je),Ae&&ze.attr("opacity",In(_e,Se.name,Ee))}),B||$e(te).selectAll(".bc-line").attr("display","none"),$e(te).selectAll(".bc-line").each(function(nt){const Se=nt,Je=y.get(Se.name)??un(Se.name,Se.colorIndex,b,v),ze=K2(Se.name,n.interpolation??"monotoneX",v),ht=o?$e(this).transition().duration(Ct()):$e(this);if(ht.attr("stroke",Je),Ae&&ht.attr("opacity",In(_e,Se.name,1)),ze!==(n.interpolation??"monotoneX")){const sn=ec(ze),Un=Li().curve(sn).x((Io,io)=>de(io)).y(Io=>Io[1]);ht.attr("d",Un(Se.points))}}),(tr=n.annotations)!=null&&tr.length){const nt=r.labels.map((Se,Je)=>{var ze;return{label:Se,value:((ze=m[0])==null?void 0:ze.values[Je])??0}});cg(ve,n.annotations,{scaleX:ie,scaleY:ke,data:nt,width:ce,height:I,backgroundColor:Lr(t),transition:o,priorAnnotations:l})}if(n.tooltips||n.crosshair){const nt=[];G.forEach(Se=>{const Je=h.findIndex(ze=>ze.name===Se.key);Array.from(Se).forEach((ze,ht)=>{const sn=ze[1]-ze[0];nt.push({cx:de(ht),cy:ke(ze[1]),label:r.labels[ht],value:Math.round(sn*100)/100,series:Se.key,color:un(Se.key,Je,b,v)})})}),hg(ve,{width:ce,height:I,points:nt,tooltip:n.tooltips,crosshair:n.crosshair,crosshairDirection:n.crosshairDirection,crosshairStyle:n.crosshairStyle,crosshairColor:n.crosshairColor,numberFormat:(mr=n.verticalAxis)==null?void 0:mr.numberFormat,container:t})}const Le=r.labels.length-1,Ge=de(Le)+6,st=[];if(m.forEach((nt,Se)=>{var Io;if(Na(nt.name,_,v)!=="direct")return;const ze=G.find(io=>io.key===nt.name);if(!ze)return;const ht=ze[Le],sn=ke((ht[0]+ht[1])/2),Un=((Io=v==null?void 0:v.find(io=>io.name===nt.name))==null?void 0:Io.labelText)||nt.name;st.push({name:nt.name,index:Se,naturalY:sn,text:Un})}),st.length>0){st.sort((ze,ht)=>ze.naturalY-ht.naturalY);const nt=st.map(ze=>ze.naturalY),Je=Q2(nt,0,I,14);st.forEach((ze,ht)=>{$e(ve).append("text").attr("class","bc-direct-label").attr("data-series",ze.index).attr("x",Ge).attr("y",Je[ht]).attr("dy","0.35em").attr("font-size","11px").attr("fill",un(ze.name,ze.index,b,v)).text(ze.text)})}const ut=g.filter(nt=>Na(nt,_,v)==="legend");if(D&&ut.length>0){const nt=ut.map(ze=>{const ht=h.findIndex(sn=>sn.name===ze);return un(ze,ht,b,v)});let Se=0,Je=0;if(E==="top"){const ze=fe?15:0;Je=-(Z.height+10+ze)}else E==="bottom"?Je=I+25:E==="left"?Se=-(Z.width+10):E==="right"&&(Se=ce+10);il(ve,ut,nt,Je,E,N,ce,I,Se,[],{left:U.left,right:U.right})}ii(t,{chartType:"area-stacked",margin:U}),a&&(Dr(Y.node()),Ir(t,a))}const lT=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"];class Toe extends mo{initialize(){this.configDefine("x",{defaultValue:oo()}),this.configDefine("y",{defaultValue:Bn()}),this.configDefine("colors",{defaultValue:lT});const e=this.base.append("g");this.layer("bars",e,{dataBind:(n,o)=>n.selectAll(".bc-bar-stacked").data(o,r=>r.label+"\0"+r.seriesName),insert:n=>n.append("rect").attr("class","bc-bar bc-bar-stacked"),events:{enter:n=>{const o=this.config("x"),r=this.config("y"),i=this.config("colors");n.attr("data-series",s=>s.seriesName).attr("x",s=>o(s.label)??0).attr("y",s=>r(s.y1)).attr("width",o.bandwidth()).attr("height",s=>r(s.y0)-r(s.y1)).attr("fill",s=>i[s.seriesIndex%i.length])},"merge:transition":n=>{const o=this.config("x"),r=this.config("y"),i=this.config("colors");n.duration(Ct()).attr("data-series",s=>s.seriesName).attr("x",s=>o(s.label)??0).attr("y",s=>r(s.y1)).attr("width",o.bandwidth()).attr("height",s=>r(s.y0)-r(s.y1)).attr("fill",s=>i[s.seriesIndex%i.length])},"exit:transition":n=>{n.duration(Ct()).attr("opacity",0).remove()}}})}}function Ooe(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 Moe(t,e,n={},o=!1){var ke,X,q,Y,te,ue,ye,_e;oi(o);let r=[],i=null,s,a;const l=Nr.for(t);if(o){const Ae=ri(t);a=Ae==null?void 0:Ae.margin,l.detach(),(Ae==null?void 0:Ae.chartType)==="column-stacked"?r=Array.from(t.querySelectorAll(".bc-frame .bc-bar-stacked")):Ae&&(i=Er(t)),s=new Map;for(const Ee of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[Ue,Le]of fr(Ee))s.set(Ue,Le);t.replaceChildren()}const{body:c}=ti(t,n.frame),u=e.series??[],d=u.filter(Ae=>!ul(Ae.name,n.seriesOverrides)),f=d.map(Ae=>Ae.name),h=n.colors??lT,m=n.seriesOverrides,b=n.legend!==!1,g=dr(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},D=n.stackMode===Fl.Percent,M=D?ex(C):J2(C),$=Ooe(M,e.labels,u),L=D?100:Xl($,Ae=>Ae.y1)??0,N=hc([0,L],(ke=n.verticalAxis)==null?void 0:ke.range,(X=n.verticalAxis)==null?void 0:X.numberFormat,(q=n.verticalAxis)==null?void 0:q.scaleType),T=Fi(g,(Y=n.verticalAxis)==null?void 0:Y.labelPosition,(te=n.horizontalAxis)==null?void 0:te.labelPosition,(ue=n.verticalAxis)==null?void 0:ue.direction,N),O=Math.max(0,g-(T.left??50)-(T.right??20)),P=B2(e.labels,O,n.horizontalAxis);P!==void 0&&(T.bottom=P);const B=T.top!=null,V=Math.max(0,g-(T.left??50)-(T.right??20)),z=b?cl(f,x,V):{width:0,height:0},G=b?z.height+15:0,K={...T};if(b&&x==="top"){const Ae=B?15:0;K.top=G+Ae}b&&x==="bottom"&&(K.bottom=(K.bottom??24)+G),b&&x==="left"&&(K.left=(K.left??50)+z.width+10),b&&x==="right"&&(K.right=(K.right??20)+z.width+10);const{chartArea:ne,width:ae,height:he,margin:ge}=ni(c,K),le=Ri(a,ge);let fe=e.labels;if(n.sortMode==="total"){const Ae=e.labels.map((Ee,Ue)=>({label:Ee,index:Ue,total:d.reduce((Le,Ge)=>Le+(Ge.values[Ue]??0),0)}));Ae.sort((Ee,Ue)=>Ue.total-Ee.total),fe=Ae.map(Ee=>Ee.label)}const we=oo().domain(fe).range([0,ae]).padding(mc(n.barGap)),Z=Bn().domain([0,L]).nice().range([he,0]);l.attach(ne,le),l.update({vertical:{scale:Z,height:he,options:{...n.verticalAxis,gridWidth:ae,topPadding:ge.top}},horizontal:{scale:we,height:he,options:{...n.horizontalAxis,width:ae}}});const be=ne.ownerSVGElement,re=Vi(be,t,"bars",{x:0,y:0,width:ae,height:he}),ve=$e(ne).append("g").attr("clip-path",`url(#${re})`),ce=fe===e.labels?$:fe.flatMap(Ae=>$.filter(Ee=>Ee.label===Ae)),I=new Toe(ve);if(I.config({x:we,y:Z,colors:h}),r.length>0){const Ae=ve.node().querySelector("g");Yo(Ae,r,(le==null?void 0:le.dx)??0,(le==null?void 0:le.dy)??0)}if(n.tooltips&&I.use(sl({numberFormat:(ye=n.verticalAxis)==null?void 0:ye.numberFormat})),n.crosshair&&I.use(gc({width:ae,height:he,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor})),(_e=n.annotations)!=null&&_e.length){const Ae=e.labels.map((Ee,Ue)=>({label:Ee,value:d.reduce((Le,Ge)=>Le+(Ge.values[Ue]??0),0)}));I.use(Hu(n.annotations,{scaleX:we,scaleY:Z,data:Ae,width:ae,height:he,backgroundColor:Lr(t),transition:o,priorAnnotations:s}))}I.draw(ce),ii(t,{chartType:"column-stacked",margin:ge}),i&&(Dr(ve.node()),Ir(t,i));const U=_s(n.colorizes),j=ju(n.highlights);$e(ne).selectAll(".bc-bar-stacked").each(function(Ae){const Ee=Ae,Ue=U.get(Ee.seriesName)??un(Ee.seriesName,Ee.seriesIndex,h,m),Le=Zf(Ee.seriesName,m),Ge=o?$e(this).transition().duration(Ct()):$e(this);Ge.attr("fill",Ue),Le<1&&Ge.attr("fill-opacity",Le),j.size>0&&Ge.attr("opacity",In(j,Ee.seriesName))});const ee=n.valueLabels??!1,ie=pA(ce,Ae=>Xl(Ae,Ee=>Ee.y1)??0,Ae=>Ae.label),de=$e(ne).append("g").attr("class","bc-value-labels");if(ce.forEach(Ae=>{if(!Ku(Ae.seriesName,ee,m))return;const Ee=(we(Ae.label)??0)+we.bandwidth()/2,Ue=Z(Ae.y0)-(Z(Ae.y0)-Z(Ae.y1))/2;de.append("text").attr("class","bc-value-label").attr("data-series",Ae.seriesName).attr("x",Ee).attr("y",Ue).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size","11px").attr("fill","currentColor").text(D?`${Math.round(Ae.value)}%`:n.valueLabels==="percent"?Jm(Ae.value,ie.get(Ae.label)??0):String(Math.round(Ae.value*100)/100))}),b&&f.length>0){const Ae=f.map(Le=>{const Ge=u.findIndex(st=>st.name===Le);return un(Le,Ge,h,m)});let Ee=0,Ue=0;if(x==="top"){const Le=B?15:0;Ue=-(z.height+10+Le)}else x==="bottom"?Ue=he+25:x==="left"?Ee=-(z.width+10):x==="right"&&(Ee=ae+10);il(ne,f,Ae,Ue,x,_,ae,he,Ee,[],{left:ge.left,right:ge.right})}}const cT=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"],Q6=13;class Boe extends mo{initialize(){this.configDefine("x",{defaultValue:Bn()}),this.configDefine("y",{defaultValue:oo()}),this.configDefine("colors",{defaultValue:cT}),this.configDefine("categoryLabelOffset",{defaultValue:0});const e=this.base.append("g");this.layer("bars",e,{dataBind:(n,o)=>n.selectAll(".bc-bar-stacked").data(o,r=>r.label+"\0"+r.seriesName),insert:n=>n.append("rect").attr("class","bc-bar bc-bar-stacked"),events:{enter:n=>{const o=this.config("x"),r=this.config("y"),i=this.config("colors"),s=this.config("categoryLabelOffset");n.attr("data-series",a=>a.seriesName).attr("x",a=>o(a.y0)).attr("y",a=>(r(a.label)??0)+s).attr("width",a=>o(a.y1)-o(a.y0)).attr("height",Math.max(0,r.bandwidth()-s)).attr("fill",a=>i[a.seriesIndex%i.length])},"merge:transition":n=>{const o=this.config("x"),r=this.config("y"),i=this.config("colors"),s=this.config("categoryLabelOffset");n.duration(Ct()).attr("data-series",a=>a.seriesName).attr("x",a=>o(a.y0)).attr("y",a=>(r(a.label)??0)+s).attr("width",a=>o(a.y1)-o(a.y0)).attr("height",Math.max(0,r.bandwidth()-s)).attr("fill",a=>i[a.seriesIndex%i.length])},"exit:transition":n=>{n.duration(Ct()).attr("opacity",0).remove()}}})}}function Loe(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 Poe(t,e,n={},o=!1){var te,ue,ye,_e,Ae,Ee,Ue;oi(o);let r=[],i=null,s,a;const l=Nr.for(t);if(o){const Le=ri(t);a=Le==null?void 0:Le.margin,l.detach(),(Le==null?void 0:Le.chartType)==="bar-stacked"?r=Array.from(t.querySelectorAll(".bc-frame .bc-bar-stacked")):Le&&(i=Er(t)),s=new Map;for(const Ge of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[st,ut]of fr(Ge))s.set(st,ut);t.replaceChildren()}const{body:c}=ti(t,n.frame),u=e.series??[],d=u.filter(Le=>!ul(Le.name,n.seriesOverrides)),f=d.map(Le=>Le.name),h=n.colors??cT,m=n.seriesOverrides,b=n.legend!==!1,g=dr(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},D=n.stackMode===Fl.Percent,M=D?ex(C):J2(C),$=Loe(M,e.labels,u),L=D?100:Xl($,Le=>Le.y1)??0,E=n.categoryLabelLine===!0,N=eg(e.labels),T=E?an.Off:(te=n.verticalAxis)==null?void 0:te.labelPosition,O=Fi(g,T,(ue=n.horizontalAxis)==null?void 0:ue.labelPosition,(ye=n.verticalAxis)==null?void 0:ye.direction,N,(_e=n.horizontalAxis)==null?void 0:_e.showAxis),P=O.top!=null,B=Math.max(0,g-(O.left??50)-(O.right??20)),V=b?cl(f,x,B):{width:0,height:0},z=b?V.height+15:0,G={...O};if(b&&x==="top"){const Le=P?15:0;G.top=z+Le}b&&x==="bottom"&&(G.bottom=(G.bottom??24)+z),b&&x==="left"&&(G.left=(G.left??50)+V.width+10),b&&x==="right"&&(G.right=(G.right??20)+V.width+10);const{chartArea:K,width:ne,height:ae,margin:he}=ni(c,G),ge=Ri(a,he);let le=e.labels;if(n.sortMode==="total"){const Le=e.labels.map((Ge,st)=>({label:Ge,index:st,total:d.reduce((ut,$t)=>ut+($t.values[st]??0),0)}));Le.sort((Ge,st)=>st.total-Ge.total),le=Le.map(Ge=>Ge.label)}const fe=Bn().domain([0,L]).nice().range([0,ne]),we=oo().domain(le).range([0,ae]).padding(mc(n.barGap));l.attach(K,ge),l.update({horizontal:{scale:fe,height:ae,options:{...n.horizontalAxis,width:ne}},vertical:{scale:we,height:ae,options:{...n.verticalAxis,labelPosition:E?an.Off:(Ae=n.verticalAxis)==null?void 0:Ae.labelPosition,topPadding:he.top}},order:"horizontal-first"});const Z=K.ownerSVGElement,be=Vi(Z,t,"bars",{x:0,y:0,width:ne,height:ae}),re=$e(K).append("g").attr("clip-path",`url(#${be})`),ve=le===e.labels?$:le.flatMap(Le=>$.filter(Ge=>Ge.label===Le)),ce=E?Q6:0,I=new Boe(re);if(I.config({x:fe,y:we,colors:h,categoryLabelOffset:ce}),r.length>0){const Le=re.node().querySelector("g");Yo(Le,r,(ge==null?void 0:ge.dx)??0,(ge==null?void 0:ge.dy)??0)}if(n.tooltips&&I.use(sl({numberFormat:(Ee=n.verticalAxis)==null?void 0:Ee.numberFormat})),n.crosshair&&I.use(gc({width:ne,height:ae,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor,orientation:to.Horizontal})),(Ue=n.annotations)!=null&&Ue.length){const Le=e.labels.map((Ge,st)=>({label:Ge,value:d.reduce((ut,$t)=>ut+($t.values[st]??0),0)}));I.use(Hu(n.annotations,{scaleX:we,scaleY:fe,data:Le,width:ne,height:ae,backgroundColor:Lr(t),orientation:to.Horizontal,transition:o,priorAnnotations:s}))}I.draw(ve),ii(t,{chartType:"bar-stacked",margin:he}),i&&(Dr(re.node()),Ir(t,i));const U=_s(n.colorizes),j=ju(n.highlights);if($e(K).selectAll(".bc-bar-stacked").each(function(Le){const Ge=Le,st=U.get(Ge.seriesName)??un(Ge.seriesName,Ge.seriesIndex,h,m),ut=Zf(Ge.seriesName,m),$t=o?$e(this).transition().duration(Ct()):$e(this);$t.attr("fill",st),ut<1&&$t.attr("fill-opacity",ut),j.size>0&&$t.attr("opacity",In(j,Ge.seriesName))}),E){const Le=$e(K).append("g").attr("class","bc-category-labels");for(const Ge of le){const st=we(Ge)??0;Le.append("text").attr("class","bc-category-label").attr("x",2).attr("y",st+Q6/2).attr("text-anchor","start").attr("dominant-baseline","central").attr("font-size","10px").attr("font-weight","600").attr("fill","currentColor").text(Ge)}}const ee=n.valueLabels??!1,ie=n.valueLabelPosition??_t.Auto,de=new Set,ke=new Map;for(const Le of le){const Ge=ve.filter(st=>st.label===Le).sort((st,ut)=>st.y1-ut.y1);if(Ge.length>0){const st=Ge[Ge.length-1];de.add(st.label+"\0"+st.seriesName);for(let ut=0;ut<Ge.length-1;ut++){const $t=Ge[ut].label+"\0"+Ge[ut].seriesName;ke.set($t,fe(Ge[ut+1].y1)-fe(Ge[ut].y1))}}}const X=new Map,q=pA(ve,Le=>Xl(Le,Ge=>Ge.y1)??0,Le=>Le.label),Y=$e(K).append("g").attr("class","bc-value-labels");if(ve.forEach(Le=>{if(!Ku(Le.seriesName,ee,m))return;const Ge=D?`${Math.round(Le.value)}%`:n.valueLabels==="percent"?Jm(Le.value,q.get(Le.label)??0):String(Math.round(Le.value*100)/100),st=fe(Le.y1)-fe(Le.y0),ut=Ge.length*6.5+8,$t=st>=ut,rn=(we(Le.label)??0)+ce+(we.bandwidth()-ce)/2,It=un(Le.seriesName,Le.seriesIndex,h,m),jt=de.has(Le.label+"\0"+Le.seriesName),Hn=ie===_t.Outside||ie===_t.Auto&&!$t&&jt,Wn=()=>{const mn=fe(Le.y0)+st/2;Y.append("text").attr("class","bc-value-label").attr("data-series",Le.seriesName).attr("opacity",0).attr("x",mn).attr("y",rn).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size","11px").attr("fill",Br(It)).text(Ge)};if(Hn)if(ie===_t.Inside)Wn();else{const mn=fe(Le.y1)+4,tr=X.get(Le.label)??0,mr=ke.get(Le.label+"\0"+Le.seriesName),nt=mn<tr,Se=mr!==void 0&&ut+4>mr,Je=ne+he.right-2,ze=mn+ut>Je;nt||Se||ze?Wn():(X.set(Le.label,mn+ut),Y.append("text").attr("class","bc-value-label").attr("data-series",Le.seriesName).attr("x",mn).attr("y",rn).attr("text-anchor","start").attr("dominant-baseline","central").attr("font-size","11px").attr("fill","currentColor").text(Ge))}else if(!$t)Wn();else{const mn=fe(Le.y0)+st/2;Y.append("text").attr("class","bc-value-label").attr("data-series",Le.seriesName).attr("x",mn).attr("y",rn).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size","11px").attr("fill",Br(It)).text(Ge)}}),b&&f.length>0){const Le=f.map(ut=>{const $t=u.findIndex(rn=>rn.name===ut);return un(ut,$t,h,m)});let Ge=0,st=0;if(x==="top"){const ut=P?15:0;st=-(V.height+10+ut)}else x==="bottom"?st=ae+25:x==="left"?Ge=-(V.width+10):x==="right"&&(Ge=ne+10);il(K,f,Le,st,x,_,ne,ae,Ge,[],{left:he.left,right:he.right})}}const uT=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"],J6=16,Rh=20,ek=13;class Doe extends mo{initialize(){this.configDefine("y",{defaultValue:oo()}),this.configDefine("colors",{defaultValue:uT}),this.configDefine("categoryLabelOffset",{defaultValue:0});const e=this.base.append("g");this.layer("bars",e,{dataBind:(n,o)=>n.selectAll(".bc-bar-split").data(o,r=>r.label+"\0"+r.seriesName),insert:n=>n.append("rect").attr("class","bc-bar bc-bar-split"),events:{enter:n=>{const o=this.config("y"),r=this.config("colors"),i=this.config("categoryLabelOffset");n.attr("data-series",s=>s.seriesName).attr("x",s=>s.xPos).attr("y",s=>(o(s.label)??0)+i).attr("width",s=>s.barWidth).attr("height",Math.max(0,o.bandwidth()-i)).attr("fill",s=>r[s.seriesIndex%r.length])},"merge:transition":n=>{const o=this.config("y"),r=this.config("colors"),i=this.config("categoryLabelOffset");n.duration(Ct()).attr("data-series",s=>s.seriesName).attr("x",s=>s.xPos).attr("y",s=>(o(s.label)??0)+i).attr("width",s=>s.barWidth).attr("height",Math.max(0,o.bandwidth()-i)).attr("fill",s=>r[s.seriesIndex%r.length])},"exit:transition":n=>{n.duration(Ct()).attr("opacity",0).remove()}}})}}function Eoe(t,e,n,o){const r=t.length;if(r===0)return[];const i=Math.max(0,(n-(r-1)*J6)/r),s=o?Xl(t.flatMap(a=>a.values))??0:0;return t.map((a,l)=>{const c=o?s:Xl(a.values)??0,u=Bn().domain([0,c]).nice().range([0,i]);return{seriesName:a.name,seriesIndex:e.findIndex(d=>d.name===a.name),xOffset:l*(i+J6),panelWidth:i,xScale:u}})}function Ioe(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 Noe(t,e,n={},o=!1){var U,j,ee,ie,de,ke;oi(o);let r=[],i=null,s;const a=Nr.for(t);if(o){const X=ri(t);s=X==null?void 0:X.margin,a.detach(),(X==null?void 0:X.chartType)==="bar-split"?r=Array.from(t.querySelectorAll(".bc-frame .bc-bar-split")):X&&(i=Er(t)),t.replaceChildren()}const{body:l}=ti(t,n.frame),c=e.series??[],u=c.filter(X=>!ul(X.name,n.seriesOverrides)),d=u.map(X=>X.name),f=n.colors??uT,h=n.seriesOverrides,m=n.legend!==!1,b=dr(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=eg(e.labels),D=_?an.Off:(U=n.verticalAxis)==null?void 0:U.labelPosition,M=Fi(b,D,(j=n.horizontalAxis)==null?void 0:j.labelPosition,(ee=n.verticalAxis)==null?void 0:ee.direction,C,(ie=n.horizontalAxis)==null?void 0:ie.showAxis);M.top=(M.top??12)+Rh;const $=Math.max(0,b-(M.left??50)-(M.right??20)),L=m?cl(d,y,$):{width:0,height:0},E=m?L.height+15:0,N={...M};m&&y==="top"&&(N.top=E+Rh),m&&y==="bottom"&&(N.bottom=(N.bottom??24)+E),m&&y==="left"&&(N.left=(N.left??50)+L.width+10),m&&y==="right"&&(N.right=(N.right??20)+L.width+10);const{chartArea:T,width:O,height:P,margin:B}=ni(l,N),V=Ri(s,B);let z=e.labels;if(n.sortMode==="total"){const X=e.labels.map((q,Y)=>({label:q,total:u.reduce((te,ue)=>te+(ue.values[Y]??0),0)}));X.sort((q,Y)=>Y.total-q.total),z=X.map(q=>q.label)}const G=oo().domain(z).range([0,P]).padding(mc(n.barGap)),K=_?ek:0;a.attach(T,V),a.update({vertical:{scale:G,height:P,options:{...n.verticalAxis,labelPosition:_?an.Off:(de=n.verticalAxis)==null?void 0:de.labelPosition,topPadding:B.top}},order:"horizontal-first"});const ne=n.sharedScale===!0,ae=Eoe(u,c,O,ne),he=T.ownerSVGElement,ge=Vi(he,t,"bars",{x:0,y:0,width:O,height:P}),le=$e(T).append("g").attr("clip-path",`url(#${ge})`),fe=$e(T).append("g").attr("class","bc-split-headers");for(const X of ae)fe.append("text").attr("class","bc-split-header").attr("x",X.xOffset+X.panelWidth/2).attr("y",-Rh/2).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size","11px").attr("font-weight","600").attr("fill","currentColor").text(X.seriesName);const we=Ioe(ae,z,e.labels,c),Z=new Doe(le);if(Z.config({y:G,colors:f,categoryLabelOffset:K}),r.length>0){const X=le.node().querySelector("g");Yo(X,r,(V==null?void 0:V.dx)??0,(V==null?void 0:V.dy)??0)}n.tooltips&&Z.use(sl({numberFormat:(ke=n.verticalAxis)==null?void 0:ke.numberFormat})),n.crosshair&&Z.use(gc({width:O,height:P,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor,orientation:to.Horizontal})),Z.draw(we);const be=ju(n.highlights);ii(t,{chartType:"bar-split",margin:B}),i&&(Dr(le.node()),Ir(t,i));const re=_s(n.colorizes);if($e(T).selectAll(".bc-bar-split").each(function(X){const q=X,Y=re.get(q.seriesName)??un(q.seriesName,q.seriesIndex,f,h),te=Zf(q.seriesName,h),ue=o?$e(this).transition().duration(Ct()):$e(this);ue.attr("fill",Y),te<1&&ue.attr("fill-opacity",te),be.size>0&&ue.attr("opacity",In(be,q.seriesName))}),_){const X=$e(T).append("g").attr("class","bc-category-labels");for(const q of z){const Y=G(q)??0;X.append("text").attr("class","bc-category-label").attr("x",2).attr("y",Y+ek/2).attr("text-anchor","start").attr("dominant-baseline","central").attr("font-size","10px").attr("font-weight","600").attr("fill","currentColor").text(q)}}const ve=n.valueLabels??!0,ce=n.valueLabelPosition??_t.Auto,I=$e(T).append("g").attr("class","bc-value-labels");if(we.forEach(X=>{if(!Ku(X.seriesName,ve,h))return;const q=ae.find(Le=>Le.seriesName===X.seriesName);if(!q)return;const Y=un(X.seriesName,X.seriesIndex,f,h),te=X.xPos+X.barWidth,ue=Math.max(0,G.bandwidth()-K),ye=(G(X.label)??0)+K+ue/2,_e=ce===_t.Inside||ce===_t.Auto&&X.barWidth>30;let Ae,Ee,Ue;if(_e)Ae=te-4,Ee="end",Ue=Br(Y);else{const Le=te+4,Ge=q.xOffset+q.panelWidth;Le+20>Ge?(Ae=X.xPos-4,Ee="end"):(Ae=Le,Ee="start"),Ue="currentColor"}I.append("text").attr("class","bc-value-label").attr("data-series",X.seriesName).attr("x",Ae).attr("y",ye).attr("text-anchor",Ee).attr("dominant-baseline","central").attr("font-size","11px").attr("fill",Ue).text(String(X.value))}),m&&d.length>0){const X=d.map(te=>{const ue=c.findIndex(ye=>ye.name===te);return un(te,ue,f,h)});let q=0,Y=0;y==="top"?Y=-(L.height+10+Rh):y==="bottom"?Y=P+25:y==="left"?q=-(L.width+10):y==="right"&&(q=O+10),il(T,d,X,Y,y,x,O,P,q,[],{left:B.left,right:B.right})}}const Cb=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"],tk=13;class Roe extends mo{initialize(){this.configDefine("x",{defaultValue:Bn()}),this.configDefine("y0",{defaultValue:oo()}),this.configDefine("y1",{defaultValue:oo()}),this.configDefine("colors",{defaultValue:Cb}),this.configDefine("categoryLabelOffset",{defaultValue:0});const e=this.base.append("g");this.layer("bars",e,{dataBind:(n,o)=>n.selectAll(".bc-bar-grouped").data(o,r=>r.label+"\0"+r.seriesName),insert:n=>n.append("rect").attr("class","bc-bar bc-bar-grouped"),events:{enter:n=>{const o=this.config("x"),r=this.config("y0"),i=this.config("y1"),s=this.config("colors"),a=this.config("categoryLabelOffset");n.attr("data-series",l=>l.seriesName).attr("x",o(0)).attr("y",l=>(r(l.label)??0)+a+(i(l.seriesName)??0)).attr("width",l=>Math.max(0,o(l.value)-o(0))).attr("height",i.bandwidth()).attr("fill",l=>s[l.seriesIndex%s.length])},"merge:transition":n=>{const o=this.config("x"),r=this.config("y0"),i=this.config("y1"),s=this.config("colors"),a=this.config("categoryLabelOffset");n.duration(Ct()).attr("data-series",l=>l.seriesName).attr("x",o(0)).attr("y",l=>(r(l.label)??0)+a+(i(l.seriesName)??0)).attr("width",l=>Math.max(0,o(l.value)-o(0))).attr("height",i.bandwidth()).attr("fill",l=>s[l.seriesIndex%s.length])},"exit:transition":n=>{n.duration(Ct()).attr("opacity",0).remove()}}})}}function Foe(t,e,n={},o=!1){var j,ee,ie,de,ke,X;oi(o);let r=[],i=null,s;const a=Nr.for(t);if(o){const q=ri(t);s=q==null?void 0:q.margin,a.detach(),(q==null?void 0:q.chartType)==="bar-grouped"?r=Array.from(t.querySelectorAll(".bc-frame .bc-bar-grouped")):q&&(i=Er(t)),t.replaceChildren()}const{body:l}=ti(t,n.frame),c=e.series??[],u=c.filter(q=>!ul(q.name,n.seriesOverrides)),d=u.map(q=>q.name),f=n.colors??Cb,h=n.seriesOverrides,m=n.legend!==!1,b=dr(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=eg(e.labels),D=_?an.Off:(j=n.verticalAxis)==null?void 0:j.labelPosition,M=Fi(b,D,(ee=n.horizontalAxis)==null?void 0:ee.labelPosition,(ie=n.verticalAxis)==null?void 0:ie.direction,C,(de=n.horizontalAxis)==null?void 0:de.showAxis),$=Math.max(0,b-(M.left??50)-(M.right??20)),L=m?cl(d,y,$):{width:0,height:0},E=m?L.height+15:0,N={...M};m&&y==="top"&&(N.top=E),m&&y==="bottom"&&(N.bottom=(N.bottom??24)+E),m&&y==="left"&&(N.left=(N.left??50)+L.width+10),m&&y==="right"&&(N.right=(N.right??20)+L.width+10);const{chartArea:T,width:O,height:P,margin:B}=ni(l,N),V=Ri(s,B);let z=e.labels;if(n.sortMode==="total"){const q=e.labels.map((Y,te)=>({label:Y,total:u.reduce((ue,ye)=>ue+(ye.values[te]??0),0)}));q.sort((Y,te)=>te.total-Y.total),z=q.map(Y=>Y.label)}const G=oo().domain(z).range([0,P]).paddingInner(mc(n.barGap)).paddingOuter(.05),K=_?tk:0,ne=Math.max(0,G.bandwidth()-K),ae=oo().domain(d).range([0,ne]).padding(.05),he=Xl(u.flatMap(q=>q.values))??0,ge=Bn().domain([0,he]).nice().range([0,O]);a.attach(T,V),a.update({vertical:{scale:G,height:P,options:{...n.verticalAxis,labelPosition:_?an.Off:(ke=n.verticalAxis)==null?void 0:ke.labelPosition,topPadding:B.top}},horizontal:{scale:ge,height:P,options:{...n.horizontalAxis,width:O}},order:"horizontal-first"});const le=T.ownerSVGElement,fe=Vi(le,t,"bars",{x:0,y:0,width:O,height:P}),we=$e(T).append("g").attr("clip-path",`url(#${fe})`);if(n.barBackground){const q=(n.colors??Cb)[0];we.selectAll(".bc-bar-bg").data(z,Y=>Y).enter().append("rect").attr("class","bc-bar-bg").attr("x",0).attr("y",Y=>(G(Y)??0)+K).attr("width",O).attr("height",G.bandwidth()-K).attr("fill",q).attr("opacity",.18)}if(n.barSeparators&&z.length>1){const q=G.step();for(let Y=1;Y<z.length;Y++){const te=(G(z[Y-1])??0)+G.bandwidth()+(q-G.bandwidth())/2;we.append("line").attr("class","bc-bar-separator").attr("x1",0).attr("x2",O).attr("y1",te).attr("y2",te).attr("stroke","currentColor").attr("opacity",.15)}}const Z=[];for(const q of z){const Y=e.labels.indexOf(q);for(const te of u){const ue=c.findIndex(ye=>ye.name===te.name);Z.push({label:q,seriesName:te.name,seriesIndex:ue,value:Y>=0?te.values[Y]??0:0})}}const be=new Roe(we);be.config({x:ge,y0:G,y1:ae,colors:f,categoryLabelOffset:K});const re=ju(n.highlights);if(r.length>0){const q=we.node().querySelector("g");Yo(q,r,(V==null?void 0:V.dx)??0,(V==null?void 0:V.dy)??0)}n.tooltips&&be.use(sl({numberFormat:(X=n.verticalAxis)==null?void 0:X.numberFormat})),n.crosshair&&be.use(gc({width:O,height:P,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor,orientation:to.Horizontal})),be.draw(Z),ii(t,{chartType:"bar-grouped",margin:B}),i&&(Dr(we.node()),Ir(t,i));const ve=_s(n.colorizes);if($e(T).selectAll(".bc-bar-grouped").each(function(q){const Y=q,te=ve.get(Y.seriesName)??un(Y.seriesName,Y.seriesIndex,f,h),ue=Zf(Y.seriesName,h),ye=o?$e(this).transition().duration(Ct()):$e(this);ye.attr("fill",te),ue<1&&ye.attr("fill-opacity",ue),re.size>0&&ye.attr("opacity",In(re,Y.seriesName))}),_){const q=$e(T).append("g").attr("class","bc-category-labels");for(const Y of z){const te=G(Y)??0;q.append("text").attr("class","bc-category-label").attr("x",2).attr("y",te+tk/2).attr("text-anchor","start").attr("dominant-baseline","central").attr("font-size","10px").attr("font-weight","600").attr("fill","currentColor").text(Y)}}const ce=n.valueLabels??!0,I=n.valueLabelPosition??_t.Auto,U=$e(T).append("g").attr("class","bc-value-labels");if(Z.forEach(q=>{if(!Ku(q.seriesName,ce,h))return;const Y=un(q.seriesName,q.seriesIndex,f,h),te=Math.max(0,ge(q.value)-ge(0)),ue=ge(0)+te,ye=(G(q.label)??0)+K+(ae(q.seriesName)??0)+ae.bandwidth()/2,_e=I===_t.Inside||I===_t.Auto&&te>30;let Ae,Ee,Ue;_e?(Ae=ue-4,Ee="end",Ue=Br(Y)):(Ae=ue+4,Ee="start",Ue="currentColor"),U.append("text").attr("class","bc-value-label").attr("data-series",q.seriesName).attr("x",Ae).attr("y",ye).attr("text-anchor",Ee).attr("dominant-baseline","central").attr("font-size","11px").attr("fill",Ue).text(String(q.value))}),m&&d.length>0){const q=d.map(ue=>{const ye=c.findIndex(_e=>_e.name===ue);return un(ue,ye,f,h)});let Y=0,te=0;y==="top"?te=-(L.height+10):y==="bottom"?te=P+25:y==="left"?Y=-(L.width+10):y==="right"&&(Y=O+10),il(T,d,q,te,y,x,O,P,Y,[],{left:B.left,right:B.right})}}const tx=new Map;function Ko(t,e,n){tx.set(t,{renderer:e,options:n})}function Voe(t){var e;return(e=tx.get(t))==null?void 0:e.renderer}function Cu(t){var e;return((e=tx.get(t))==null?void 0:e.options)??[]}const nk=[{value:Xn.Solid,text:"Solid"},{value:Xn.Dashed,text:"Dashed"},{value:Xn.Dotted,text:"Dotted"},{value:Xn.None,text:"None"}],Xo={key:"colors",type:Qe.Colors,label:"Colors"},Zo={key:"colorPalette",type:Qe.Select,label:"Color palette",default:"Blueprint",choices:[{value:"",text:"Custom"},...F5().map(t=>({value:t.name,text:t.label}))]},Qo={key:"autoContrast",type:Qe.Boolean,label:"Auto-adjust contrast",default:!1},Jo={key:"allowDarkMode",type:Qe.Boolean,label:"Allow dark mode",default:!0},Xu={key:"legend",type:Qe.Boolean,label:"Show legend",default:!0},pa={key:"legendPosition",type:Qe.Select,label:"Legend position",default:Rc.Top,choices:[{value:Rc.Top,text:"Top"},{value:Rc.Bottom,text:"Bottom"},{value:Rc.Left,text:"Left"},{value:Rc.Right,text:"Right"}]},ma={key:"legendAnchor",type:Qe.Select,label:"Legend anchor",default:qs.Start,choices:[{value:qs.Start,text:"Start"},{value:qs.Middle,text:"Middle"},{value:qs.End,text:"End"}]},pg={key:"directLabelling",type:Qe.Select,label:"Direct labelling",default:Mo.Off,choices:[{value:Mo.Off,text:"Off"},{value:Mo.Auto,text:"Auto"},{value:Mo.Outside,text:"Outside"},{value:Mo.Inside,text:"Inside"}]},nx={key:"directLabelAnchor",type:Qe.Select,label:"Label anchor",default:qs.Middle,choices:[{value:qs.Start,text:"Start"},{value:qs.Middle,text:"Middle"},{value:qs.End,text:"End"}]},mg={key:"valueLabels",type:Qe.Boolean,label:"Value labels",default:!1},gg={key:"valueLabelPosition",type:Qe.Select,label:"Label position",default:_t.Auto,choices:[{value:_t.Auto,text:"Auto"},{value:_t.Outside,text:"Outside"},{value:_t.Inside,text:"Inside"}]},ga={key:"tooltips",type:Qe.Boolean,label:"Tooltips",default:!1},dT={key:"crosshair",type:Qe.Boolean,label:"Crosshair",default:!1},fT={key:"crosshairDirection",type:Qe.Select,label:"Crosshair direction",default:Oo.Both,choices:[{value:Oo.Both,text:"Both"},{value:Oo.Vertical,text:"Vertical"},{value:Oo.Horizontal,text:"Horizontal"}]},hT={key:"crosshairStyle",type:Qe.Select,label:"Crosshair style",default:gi.Dashed,choices:[{value:gi.Solid,text:"Solid"},{value:gi.Dashed,text:"Dashed"},{value:gi.Dotted,text:"Dotted"}]},pT={key:"crosshairColor",type:Qe.Text,label:"Crosshair color",default:"#999",placeholder:"#999"},mT={key:"lineSymbols",type:Qe.Boolean,label:"Show line symbols",default:!1},gT={key:"lineSymbolShape",type:Qe.Select,label:"Symbol",default:yr.Circle,choices:[{value:yr.Circle,text:"Circle"},{value:yr.Square,text:"Square"},{value:yr.Diamond,text:"Diamond"},{value:yr.Triangle,text:"Triangle Up"},{value:yr.TriangleDown,text:"Triangle Down"},{value:yr.Cross,text:"Cross"},{value:yr.Star,text:"Star"}]},vT={key:"lineSymbolShowOn",type:Qe.Select,label:"Show on",default:_r.FirstLast,choices:[{value:_r.FirstLast,text:"First & Last"},{value:_r.First,text:"First"},{value:_r.Last,text:"Last"},{value:_r.All,text:"All"}]},bT={key:"lineSymbolStyle",type:Qe.Select,label:"Style",default:zo.Filled,choices:[{value:zo.Filled,text:"Filled"},{value:zo.Hollow,text:"Hollow"}]},yT={key:"lineSymbolSize",type:Qe.Text,label:"Size",default:"3.5",placeholder:"3.5"},xT={key:"lineSymbolOpacity",type:Qe.Text,label:"Opacity",default:"1",placeholder:"1"},Qf={key:"sortMode",type:Qe.Select,label:"Sort mode",default:mi.None,choices:[{value:mi.None,text:"None"},{value:mi.Total,text:"By total"},{value:mi.WithinGroups,text:"Within groups"}]},vg={key:"edgePadding",type:Qe.Boolean,label:"Edge padding",default:!1},bg={key:"waterfall",type:Qe.Boolean,label:"Waterfall",default:!1},yg={key:"waterfallTotal",type:Qe.Boolean,label:"Waterfall total",default:!1},Jf={key:"barBackground",type:Qe.Boolean,label:"Bar background",default:!1},xg={key:"barGap",type:Qe.Text,label:"Bar gap",default:String(_f),placeholder:String(_f)},eh={key:"barSeparators",type:Qe.Boolean,label:"Bar separators",default:!1},wg={key:"connectedColumns",type:Qe.Boolean,label:"Connected columns",default:!1},_g={key:"connectionsOpacity",type:Qe.Text,label:"Opacity",default:"0.15",placeholder:"0.15"},kg={key:"swapLabelValue",type:Qe.Boolean,label:"Swap labels and values",default:!1},wT={key:"stackMode",type:Qe.Select,label:"Stack mode",default:Fl.Normal,choices:[{value:Fl.Normal,text:"Normal"},{value:Fl.Percent,text:"Percentage (100%)"}]},zoe={key:"sharedScale",type:Qe.Boolean,label:"Shared scale",default:!1},bc={key:"categoryLabelLine",type:Qe.Boolean,label:"Labels on separate line",default:!1},_T={key:"displayAsPercentage",type:Qe.Boolean,label:"Display as percentage",default:!1},kT={key:"showTotal",type:Qe.Boolean,label:"Show total",default:!1},ST={key:"showLabels",type:Qe.Boolean,label:"Show labels",default:!0},CT={key:"showValues",type:Qe.Boolean,label:"Show values",default:!0},AT={key:"sliceMax",type:Qe.Text,label:"Max slices",default:"6"},$T={key:"sliceGroupLabel",type:Qe.Text,label:"Group label",default:"Others",placeholder:"Others"},Hoe={key:"areaFillOpacity",type:Qe.Text,label:"Opacity",default:"0.85",placeholder:"0.85"},Woe={key:"stacked",type:Qe.Boolean,label:"Stack areas",default:!0},Uoe={key:"stackPercent",type:Qe.Boolean,label:"Stack to 100%",default:!1},Goe={key:"areaLines",type:Qe.Boolean,label:"Separate areas with lines",default:!0},qoe={key:"areaSortMode",type:Qe.Select,label:"Sort areas",default:en.None,choices:[{value:en.None,text:"Keep order"},{value:en.Ascending,text:"Smallest first"},{value:en.Descending,text:"Largest first"}]},Yoe={key:"interpolation",type:Qe.Select,label:"Line interpolation",default:ui.Linear,choices:[{value:ui.Linear,text:"Linear"},{value:ui.MonotoneX,text:"Monotone"},{value:ui.Step,text:"Step"},{value:ui.StepBefore,text:"Step (before)"},{value:ui.StepAfter,text:"Step (after)"},{value:ui.Basis,text:"Basis"},{value:ui.Cardinal,text:"Cardinal"},{value:ui.CatmullRom,text:"Catmull-Rom"}]},ok=[{value:yu.Linear,text:"Linear"},{value:yu.Log,text:"Logarithmic"}],rk=[{value:an.Auto,text:"Auto"},{value:an.Inside,text:"Inside"},{value:an.Outside,text:"Outside"},{value:an.Off,text:"Off"}],joe=[{value:qd.Auto,text:"Auto"},{value:qd.Horizontal,text:"Horizontal"},{value:qd.Vertical,text:"Vertical"}];function th(t){return[{key:"showVerticalAxis",type:Qe.Boolean,label:"Show vertical axis",default:t.showVerticalAxis??!0},{key:"verticalAxisDirection",type:Qe.Select,label:"Vertical axis side",default:di.Left,choices:[{value:di.Left,text:"Left"},{value:di.Right,text:"Right"}]},{key:"showVerticalTicks",type:Qe.Boolean,label:"Show vertical ticks",default:t.showVerticalTicks},{key:"verticalLabelPosition",type:Qe.Select,label:"Vertical labels",default:an.Auto,choices:rk},{key:"verticalGridStyle",type:Qe.Select,label:"Vertical grid style",default:t.verticalGrid,choices:nk},{key:"verticalNumberFormat",type:Qe.NumberFormat,label:"Vertical number format"},...t.valueAxis==="vertical"?[{key:"verticalScaleType",type:Qe.Select,label:"Vertical scale",default:yu.Linear,choices:ok},t.valueAxisZeroBaseline?{key:"verticalRangeMin",type:Qe.Text,label:"Vertical min",default:"0",placeholder:"auto"}:{key:"verticalRangeMin",type:Qe.Text,label:"Vertical min",placeholder:"auto"},{key:"verticalRangeMax",type:Qe.Text,label:"Vertical max",placeholder:"auto"}]:[],{key:"showHorizontalAxis",type:Qe.Boolean,label:"Show horizontal axis",default:!0},{key:"showHorizontalTicks",type:Qe.Boolean,label:"Show horizontal ticks",default:t.showHorizontalTicks},{key:"horizontalLabelPosition",type:Qe.Select,label:"Horizontal labels",default:an.Auto,choices:rk},{key:"horizontalLabelRotation",type:Qe.Select,label:"Horizontal label rotation",default:qd.Horizontal,choices:joe},{key:"horizontalGridStyle",type:Qe.Select,label:"Horizontal grid style",default:t.horizontalGrid,choices:nk},{key:"horizontalNumberFormat",type:Qe.NumberFormat,label:"Horizontal number format"},...t.valueAxis==="horizontal"?[{key:"horizontalScaleType",type:Qe.Select,label:"Horizontal scale",default:yu.Linear,choices:ok},t.valueAxisZeroBaseline?{key:"horizontalRangeMin",type:Qe.Text,label:"Horizontal min",default:"0",placeholder:"auto"}:{key:"horizontalRangeMin",type:Qe.Text,label:"Horizontal min",placeholder:"auto"},{key:"horizontalRangeMax",type:Qe.Text,label:"Horizontal max",placeholder:"auto"}]:[],...t.horizontalRange?[{key:"horizontalRangeMin",type:Qe.Text,label:"Horizontal min",placeholder:"auto"},{key:"horizontalRangeMax",type:Qe.Text,label:"Horizontal max",placeholder:"auto"}]:[]]}const Sg=th({verticalGrid:Xn.Dashed,horizontalGrid:Xn.None,showVerticalTicks:!1,showHorizontalTicks:!1,showVerticalAxis:!1,valueAxis:"vertical",valueAxisZeroBaseline:!0}),nh=th({verticalGrid:Xn.None,horizontalGrid:Xn.Dashed,showVerticalTicks:!1,showHorizontalTicks:!1,valueAxis:"horizontal",valueAxisZeroBaseline:!0}),TT=th({verticalGrid:Xn.Dashed,horizontalGrid:Xn.None,showVerticalTicks:!1,showHorizontalTicks:!1,showVerticalAxis:!1,valueAxis:"vertical",horizontalRange:!0}),Koe=th({verticalGrid:Xn.Dashed,horizontalGrid:Xn.None,showVerticalTicks:!1,showHorizontalTicks:!1,showVerticalAxis:!1,valueAxis:"vertical",horizontalRange:!0,valueAxisZeroBaseline:!0}),Cg={...Yoe,default:ui.MonotoneX},Xoe={...fT,default:Oo.Vertical},Zoe={...dT,default:!0},Qoe={...mT,default:!0},OT={...Qf,default:mi.Total},ox={...mg,default:!0},Joe={..._T,default:!0},ere={...AT,default:"5"},tre={...kT,default:!0},Ag={...pg,default:Mo.Auto},$g={...Xu,default:!1},Tg=[dT,fT,hT,pT],rx=[Zoe,Xoe,hT,pT],Og=[mg,gg,ga,...Tg],ix=[ox,gg,ga,...Tg],nre=[mT,gT,vT,bT,yT,xT],ore=[Qoe,gT,vT,bT,yT,xT],MT=[mg,ga,...rx,...nre],rre=[mg,ga,...rx,...ore],ire=[Joe,kT,ST,CT,ere,$T],sre=[_T,tre,ST,CT,AT,$T];Ko(Ve.BarVertical,Y$,[Xo,Zo,Qo,Jo,kg,Jf,eh,xg,wg,_g,bg,yg,bc,...Sg,...Og]);Ko(Ve.BarHorizontal,j$,[Xo,Zo,Qo,Jo,kg,Jf,eh,xg,wg,_g,bg,yg,bc,...nh,...ix]);Ko(Ve.BarMulti,roe,[Xo,Zo,Qo,Jo,OT,$g,ma,pa,Ag,nx,...Sg,...Og]);Ko(Ve.Line,foe,[Xo,Zo,Qo,Jo,Cg,vg,...TT,...MT]);Ko(Ve.LineMulti,goe,[Xo,Zo,Qo,Jo,Cg,vg,Qf,$g,ma,pa,Ag,...TT,...rre]);Ko(Ve.Donut,_oe,[Xo,Zo,Qo,Jo,$g,ma,pa,Ag,ga,...sre]);Ko(Ve.Pie,koe,[Xo,Zo,Qo,Jo,$g,ma,pa,Ag,ga,...ire]);Ko(Ve.Area,Coe,[Xo,Zo,Qo,Jo,Cg,vg,...Koe,...MT]);const are=th({verticalGrid:Xn.Dashed,horizontalGrid:Xn.None,showVerticalTicks:!1,showHorizontalTicks:!1,showVerticalAxis:!1,valueAxis:"vertical",horizontalRange:!0,valueAxisZeroBaseline:!0});Ko(Ve.AreaStacked,$oe,[Xo,Zo,Qo,Jo,Hoe,Cg,vg,qoe,Woe,Uoe,Goe,Xu,ma,pa,pg,...are,ga,...rx]);Ko(Ve.ColumnStacked,Moe,[Xo,Zo,Qo,Jo,wT,Qf,Xu,ma,pa,pg,nx,...Sg,...Og]);Ko(Ve.BarStacked,Poe,[Xo,Zo,Qo,Jo,wT,Qf,Xu,ma,pa,pg,nx,bc,...nh,...ix]);Ko(Ve.BarSplit,Noe,[Xo,Zo,Qo,Jo,zoe,Qf,Xu,ma,pa,bc,...nh,ox,gg,ga,...Tg]);Ko(Ve.BarGrouped,Foe,[Xo,Zo,Qo,Jo,OT,Xu,ma,pa,Jf,eh,bc,...nh,ox,gg,ga,...Tg]);Ko(Ve.VerticalBar,Y$,[Xo,Zo,Qo,Jo,kg,Jf,eh,xg,wg,_g,bg,yg,bc,...Sg,...Og]);Ko(Ve.HorizontalBar,j$,[Xo,Zo,Qo,Jo,kg,Jf,eh,xg,wg,_g,bg,yg,bc,...nh,...ix]);function ik(t){const e=t==null?void 0:t.trim();if(!e)return;const n=Number.parseFloat(e);return Number.isFinite(n)?n:void 0}function ks(t){var i;const e=t.split(`
|
|
80
|
+
`).map(s=>s.trim()).filter(Boolean),n=[],o=[],r=(i=e[0])==null?void 0:i.match(/^series\s*=\s*(.+)$/);if(r){const s=r[1].trim(),a=s.includes('","')?s.split(",").map(u=>u.trim().replace(/^"|"$/g,"")):s.replace(/^"|"$/g,"").split(",").map(u=>u.trim()),l=a.map(()=>[]);for(let u=1;u<e.length;u++){const d=e[u].match(/^"([^"]+)"\s*=\s*([^"]+)$/),h=e[u].match(/^"([^"]+)"\s*=\s*"([^"]*)"$/)??d;if(h){n.push(h[1]);const m=h[2].split(",");for(let b=0;b<a.length;b++)l[b].push(ik(m[b]))}}const c=a.map((u,d)=>({name:u,values:l[d]}));return{labels:n,values:l[0]??[],series:c}}for(const s of e){const a=s.match(/^"([^"]+)"\s*=\s*(.+)$/);a&&(n.push(a[1]),o.push(ik(a[2])))}return{labels:n,values:o}}function lre(t,e){const n={},o=R5(t.colorPalette);return o?n.colors=o:t.colors&&t.colors.length>0&&(n.colors=t.colors),t.autoContrast&&e&&n.colors&&(n.colors=W$(n.colors,e)),t.allowDarkMode!==void 0&&(n.allowDarkMode=t.allowDarkMode),n}function cre(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 ure(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=wf(t.verticalRangeMin??""),r=wf(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 dre(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=wf(t.horizontalRangeMin??""),r=wf(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 fre(t){return t.lineSymbols?{lineSymbols:{symbol:t.lineSymbolShape??yr.Circle,showOn:t.lineSymbolShowOn??_r.FirstLast,style:t.lineSymbolStyle??zo.Filled,size:parseFloat(t.lineSymbolSize??"3.5")||3.5,opacity:parseFloat(t.lineSymbolOpacity??"1")||1}}:{}}function BT(t,e){const n={...lre(t,e),...cre(t),...ure(t),...dre(t),...fre(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}function hre(t){return"none"}const gt=(t,e,n)=>({type:t,fitness:e,reason:n}),$l={"1cat+1num":{none:t=>{const e=[gt("bar-vertical","best","1 categorical + 1 numeric — classic bar chart"),gt("bar-horizontal","good","Horizontal bars work well for long labels")];return t<=8&&(e.push(gt("donut","good",`${t} items — suitable for part-of-whole`)),e.push(gt("pie","alternative","Pie chart for part-of-whole"))),e},comparison:t=>$l["1cat+1num"].none(t),ranking:()=>[gt("bar-horizontal","best","Ranked categories read best as horizontal bars"),gt("bar-vertical","good","Vertical bars also work for ranking")],"part-to-whole":t=>t<=5?[gt("pie","best",`${t} slices — pie reads cleanly for very small N`),gt("donut","good","Donut for part-of-whole with a center label"),gt("bar-vertical","alternative","Bars if precise comparison matters")]:t<=8?[gt("donut","best",`${t} slices — donut for part-of-whole`),gt("pie","good","Pie for part-of-whole"),gt("bar-vertical","alternative","Bars if precise comparison matters")]:[gt("bar-vertical","best",`${t} categories — too many for a readable pie`),gt("bar-horizontal","good","Horizontal bars for long labels")],range:()=>[gt("bar-split","best","Diverging bars show a value against a shared baseline"),gt("bar-vertical","alternative","Plain bars if the baseline is zero")]},"1cat+Nnum":{none:()=>[gt("bar-multi","best","1 categorical + multiple numeric columns — compare groups"),gt("line-multi","good","Can also show as a multi-line chart")],comparison:t=>$l["1cat+Nnum"].none(t),ranking:t=>$l["1cat+Nnum"].none(t),trend:()=>[gt("line-multi","best","A trend or crossover story reads best as lines, even over categorical periods"),gt("bar-multi","alternative","Grouped bars if per-period comparison matters more than the trend")],"part-to-whole":()=>[gt("bar-stacked","best","Stacked bars show composition within each category"),gt("column-stacked","good","Stacked columns for the same composition"),gt("bar-multi","alternative","Grouped bars if comparison beats composition")],"composition-over-time":()=>[gt("column-stacked","best","Stacked columns show composition across discrete periods"),gt("bar-stacked","good","Stacked bars for the same composition"),gt("area-stacked","alternative","Stacked area if the periods are continuous time")],range:()=>[gt("bar-split","best","Diverging bars show values around a shared baseline"),gt("bar-multi","alternative","Grouped bars if there is no shared baseline")]},"1date+1num":{none:()=>[gt("line","best","1 date + 1 numeric column — ideal for trend"),gt("bar-vertical","alternative","Can also show as bars")],trend:()=>[gt("line","best","1 date + 1 numeric column — ideal for trend"),gt("area","good","Filled area emphasizes magnitude over time"),gt("bar-vertical","alternative","Can also show as bars")],comparison:()=>[gt("bar-vertical","best","Bars for comparing discrete time points"),gt("line","good","Line if the trend matters more than the comparison")],ranking:()=>[gt("bar-vertical","best","Bars for ranking discrete time points"),gt("line","good","Line for the underlying trend")],"part-to-whole":()=>[gt("area","best","Filled area reads as magnitude/share over time"),gt("line","good","Line for the underlying trend")],"composition-over-time":()=>[gt("area","best","Filled area shows magnitude over time"),gt("line","good","Line for the underlying trend")]},"1date+Nnum":{none:()=>[gt("line-multi","best","1 date + multiple numeric columns — compare trends"),gt("bar-multi","alternative","Can also show as grouped bars")],trend:t=>$l["1date+Nnum"].none(t),comparison:t=>$l["1date+Nnum"].none(t),ranking:t=>$l["1date+Nnum"].none(t),"composition-over-time":()=>[gt("area-stacked","best","Stacked area shows composition over continuous time"),gt("column-stacked","good","Stacked columns for the same composition"),gt("line-multi","alternative","Multi-line if composition is not the point")],"part-to-whole":()=>[gt("area-stacked","best","Stacked area shows share over time"),gt("line-multi","good","Multi-line if absolute trends matter more")]},other:{none:()=>[gt("bar-vertical","good","Default bar chart recommendation")]}};function pre(t,e,n){const o=$l[t],r=o[e]??o.none;return r?r(n):[gt("bar-vertical","good","Default bar chart recommendation")]}function mre(t,e){const n=t.filter(i=>i==="string").length,o=t.filter(i=>i==="number").length,r=t.filter(i=>i==="date").length;return r===1&&n===0&&o>=1?o===1?"1date+1num":"1date+Nnum":n===1&&r===0&&o>=1?o===1?"1cat+1num":"1cat+Nnum":"other"}const gre={"bar-vertical":"Vertical Bar Chart","bar-horizontal":"Horizontal Bar Chart","bar-multi":"Grouped Bar Chart","bar-grouped":"Grouped Bar Chart","bar-stacked":"Stacked Bar Chart","bar-split":"Diverging Bar Chart","column-stacked":"Stacked Column Chart",line:"Line Chart","line-multi":"Multi-Line Chart",area:"Area Chart","area-stacked":"Stacked Area Chart",pie:"Pie Chart",donut:"Donut Chart"};function vre(t,e,n){if(t.length===0)return[];const o=mre(t),r=hre();return pre(o,r,e).map(i=>({chartType:i.type,label:gre[i.type]??i.type,fitness:i.fitness,reason:i.reason}))}const Xv=Object.create(null);function LT(t){if(!Xv[t]){const e={};for(const n of Cu(t))n.default!==void 0&&(e[n.key]=n.default);Xv[t]=e}return Xv[t]}function T0(t,e){var r;const n=LT(t);return((r=e.colors)==null?void 0:r.length)?{...n,colorPalette:void 0,...e}:{...n,...e}}const bre={protanopia:"Protanopia (no red)",deuteranopia:"Deuteranopia (no green)",tritanopia:"Tritanopia (no blue)"},PT={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 DT(t){return`bc-cvd-${t}`}function yre(t){const e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"filter");n.setAttribute("id",DT(t)),n.setAttribute("color-interpolation-filters","linearRGB");const o=document.createElementNS(e,"feColorMatrix");return o.setAttribute("type","matrix"),o.setAttribute("values",PT[t].join(" ")),n.appendChild(o),n}function xre(t){return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function Zv(t){return t<=.0031308?12.92*t:1.055*t**(1/2.4)-.055}function wre(t,e){const[n,o,r]=rt(t).rgb().map(u=>xre(u/255)),i=PT[e],s=Zv(i[0]*n+i[1]*o+i[2]*r),a=Zv(i[5]*n+i[6]*o+i[7]*r),l=Zv(i[10]*n+i[11]*o+i[12]*r),c=u=>Math.min(255,Math.max(0,Math.round(u*255)));return rt(c(s),c(a),c(l)).hex()}const _re=10;function kre(t){if(t.length<2)return[];const e=["protanopia","deuteranopia","tritanopia"],n=[];for(const o of e){const r=t.map(s=>wre(s,o)),i=[];for(let s=0;s<r.length;s++)for(let a=s+1;a<r.length;a++){const l=rt.deltaE(r[s],r[a]);l<_re&&i.push({a:t[s],b:t[a],deltaE:l})}i.length>0&&n.push({type:o,label:bre[o],pairs:i})}return n}function sk(t){let e=0;for(const n of t)n.type==="data"&&e++;return e}function Sre(t){const e={properties:[],data:null,colorizes:[],highlights:[],areaFills:[],annotations:[],annotationVisibility:[],series:[],scenes:[],transforms:[]};for(const n of t)switch(n.type){case"property":e.properties.push(n);break;case"data":e.data=n;break;case"colorize":e.colorizes.push(n);break;case"highlight":e.highlights.push(n);break;case"area-fill":e.areaFills.push(n);break;case"annotation":e.annotations.push(n);break;case"annotation-visibility":e.annotationVisibility.push(n);break;case"series":e.series.push(n);break;case"scene":e.scenes.push(n);break;case"transform":e.transforms.push(n);break}return e}function Cre(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"area-fill":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 Are(t,e){function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n}function Hl(t,e,n,o){var r=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(r,Hl.prototype),r.expected=e,r.found=n,r.location=o,r.name="SyntaxError",r}Are(Hl,Error);function Qv(t,e,n){return n=n||" ",t.length>e?t:(e-=t.length,n+=n.repeat(e),t+n.slice(0,e))}Hl.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=Qv("",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+" | "+Qv("",r.column-1," ")+Qv("",d,"^")}else e+=`
|
|
85
|
+
at `+s}return e};Hl.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 $re(t,e){e=e!==void 0?e:{};var n={},o=e.grammarSource,r={Chart:Jx},i=Jx,s="chart",a="{",l="}",c="data",u="=",d=",",f=" ",h="colorize",m="highlight",b="area-fill",g="annotation",v="range",y="note",x="series",_="scene",C="transform",D="hide-annotation",M="hide-range",$="hide-note",L="show-annotation",E="show-range",N="show-note",T="%",O="-",P=".",B='"',V="\\",z="n",G="r",K="t",ne="u",ae="//",he="/*",ge="*/",le=/^[^\t\n\r{}=]/,fe=/^[a-zA-Z_#]/,we=/^[a-zA-Z0-9_#\-]/,Z=/^[0-9]/,be=/^[eE]/,re=/^[+\-]/,ve=/^[^"\\]/,ce=/^[0-9a-fA-F]/,I=/^[^\n]/,U=/^[ \t\n\r]/,j=Vt("chart",!1),ee=Vt("{",!1),ie=Vt("}",!1),de=Vt("data",!1),ke=Vt("=",!1),X=Vt(",",!1),q=Vt(" ",!1),Y=Wi([" ",`
|
|
86
|
+
`,"\r","{","}","="],!0,!1),te=Vt("colorize",!1),ue=Vt("highlight",!1),ye=Vt("area-fill",!1),_e=Vt("annotation",!1),Ae=Vt("range",!1),Ee=Vt("note",!1),Ue=Vt("series",!1),Le=Vt("scene",!1),Ge=Vt("transform",!1),st=Vt("hide-annotation",!1),ut=Vt("hide-range",!1),$t=Vt("hide-note",!1),rn=Vt("show-annotation",!1),It=Vt("show-range",!1),jt=Vt("show-note",!1),Hn=Vt("%",!1),Wn=ch("identifier"),mn=Wi([["a","z"],["A","Z"],"_","#"],!1,!1),tr=Wi([["a","z"],["A","Z"],["0","9"],"_","#","-"],!1,!1),mr=Vt("-",!1),nt=Vt(".",!1),Se=Wi([["0","9"]],!1,!1),Je=Wi(["e","E"],!1,!1),ze=Wi(["+","-"],!1,!1),ht=ch("string"),sn=Vt('"',!1),Un=Vt("\\",!1),Io=Wi(['"',"\\"],!0,!1),io=Vt("n",!1),gr=Vt("r",!1),Fr=Vt("t",!1),Ss=Vt("u",!1),qe=Wi([["0","9"],["a","f"],["A","F"]],!1,!1),ct=F9(),Pt=Vt("//",!1),Wt=Wi([`
|
|
87
|
+
`],!0,!1),Jn=Vt("/*",!1),Gn=Vt("*/",!1),ai=ch("whitespace"),Cs=Wi([" "," ",`
|
|
88
|
+
`,"\r"],!1,!1),wc=ch("optional whitespace"),va=function(k,W){sk(W)>1&&As("duplicate data block — a chart or scene may define at most one data { } block");const xe=Sre(W);return{type:"chart",chartType:k,properties:xe.properties,data:xe.data,colorizes:xe.colorizes,highlights:xe.highlights,areaFills:xe.areaFills,annotations:xe.annotations,annotationVisibility:xe.annotationVisibility,series:xe.series,scenes:xe.scenes,transforms:xe.transforms}},Zg=function(k){return k},YB=function(k){return{type:"data",entries:k}},Zx=function(k,W,xe){return xe},jB=function(k,W,xe){const me=[W,...xe];return{type:"property",key:k.name,...k.quoted&&k.name==="series"?{quotedKey:!0}:{},value:me[0].value,isPercentage:!1,values:me.map(Pe=>Pe.value)}},KB=function(k,W){return{type:"property",key:k.name,...k.quoted&&k.name==="series"?{quotedKey:!0}:{},value:W.value,isPercentage:W.isPercentage}},XB=function(k){return{name:k,quoted:!0}},ZB=function(k){return{name:k,quoted:!1}},QB=function(k,W){return{type:"property",key:k,...k==="series"?{quotedKey:!0}:{},value:W.value,isPercentage:W.isPercentage}},JB=function(k){return k.trim()},e9=function(k,W){return{type:"colorize",target:k,properties:W}},t9=function(){As('colorize needs a quoted target, e.g. colorize "2021" { ... }')},n9=function(k,W){return{type:"colorize",target:k,properties:W,fromHighlight:!0}},o9=function(k){return{type:"highlight",target:k,properties:[]}},r9=function(){As('highlight needs a quoted target, e.g. highlight "2021" { ... } or highlight "2021"')},i9=function(k,W,xe){return{type:"area-fill",from:k,to:W,properties:xe}},s9=function(){As('area-fill needs two quoted targets, e.g. area-fill "Revenue" "Cost" { ... }')},a9=function(){As('area-fill needs two quoted targets, e.g. area-fill "Revenue" "Cost" { ... }')},l9=function(k,W){return{type:"annotation",kind:"point",target:k,properties:W}},c9=function(){As('annotation needs a quoted target, e.g. annotation "2021" { ... }')},u9=function(k){return{type:"annotation",kind:"range",properties:k}},d9=function(k){return{type:"annotation",kind:"free",properties:k}},f9=function(k,W){return{type:"series",name:k,properties:W}},h9=function(){As('series needs a quoted name, e.g. series "Revenue" { ... }')},p9=function(k,W){sk(W)>1&&As("duplicate data block — a chart or scene may define at most one data { } block");const xe=Cre(W);return{type:"scene",name:k??null,properties:xe.properties,data:xe.data,colorizes:xe.colorizes,highlights:xe.highlights,areaFills:xe.areaFills,annotations:xe.annotations,annotationVisibility:xe.annotationVisibility,series:xe.series,transforms:xe.transforms}},m9=function(k,W){return{type:"transform",transformType:k,properties:W}},g9=function(k){return{type:"annotation-visibility",action:"hide",kind:"point",id:k}},v9=function(k){return{type:"annotation-visibility",action:"hide",kind:"range",id:k}},b9=function(k){return{type:"annotation-visibility",action:"hide",kind:"free",id:k}},y9=function(k){return{type:"annotation-visibility",action:"show",kind:"point",id:k}},x9=function(k){return{type:"annotation-visibility",action:"show",kind:"range",id:k}},w9=function(k){return{type:"annotation-visibility",action:"show",kind:"free",id:k}},_9=function(k){return k},k9=function(k){return k},S9=function(k,W){return{type:"property",key:k,value:W.value,isPercentage:W.isPercentage}},C9=function(k){return{value:k,isPercentage:!0}},A9=function(k){return{value:k,isPercentage:!1}},$9=function(k){return{value:k,isPercentage:!1}},T9=function(k){return{value:k,isPercentage:!1}},O9=function(k){return parseFloat(k)},M9=function(k){return k.join("")},B9=function(k){return k},L9=function(){return'"'},P9=function(){return"\\"},D9=function(){return`
|
|
89
|
+
`},E9=function(){return"\r"},I9=function(){return" "},N9=function(k){return String.fromCharCode(parseInt(k,16))},R9=function(k){As("Unknown escape sequence \\"+k)},F=e.peg$currPos|0,pt=F,_c=[{line:1,column:1}],li=F,lh=e.peg$maxFailExpected||[],Me=e.peg$silentFails|0,Ju;if(e.startRule){if(!(e.startRule in r))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');i=r[e.startRule]}function As(k,W){throw W=W!==void 0?W:Qg(pt,F),z9(k,W)}function Vt(k,W){return{type:"literal",text:k,ignoreCase:W}}function Wi(k,W,xe){return{type:"class",parts:k,inverted:W,ignoreCase:xe}}function F9(){return{type:"any"}}function V9(){return{type:"end"}}function ch(k){return{type:"other",description:k}}function Qx(k){var W=_c[k],xe;if(W)return W;if(k>=_c.length)xe=_c.length-1;else for(xe=k;!_c[--xe];);for(W=_c[xe],W={line:W.line,column:W.column};xe<k;)t.charCodeAt(xe)===10?(W.line++,W.column=1):W.column++,xe++;return _c[k]=W,W}function Qg(k,W,xe){var me=Qx(k),Pe=Qx(W),De={source:o,start:{offset:k,line:me.line,column:me.column},end:{offset:W,line:Pe.line,column:Pe.column}};return De}function Ie(k){F<li||(F>li&&(li=F,lh=[]),lh.push(k))}function z9(k,W){return new Hl(k,null,null,W)}function H9(k,W,xe){return new Hl(Hl.buildMessage(k,W),k,W,xe)}function Jx(){var k,W,xe,me,Pe,De,je,et;if(k=F,dt(),t.substr(F,5)===s?(W=s,F+=5):(W=n,Me===0&&Ie(j)),W!==n)if(xe=so(),xe!==n)if(me=ed(),me!==n)if(dt(),t.charCodeAt(F)===123?(Pe=a,F++):(Pe=n,Me===0&&Ie(ee)),Pe!==n){for(dt(),De=[],je=ew();je!==n;)De.push(je),je=ew();je=dt(),t.charCodeAt(F)===125?(et=l,F++):(et=n,Me===0&&Ie(ie)),et!==n?(dt(),pt=k,k=va(me,De)):(F=k,k=n)}else F=k,k=n;else F=k,k=n;else F=k,k=n;else F=k,k=n;return k}function ew(){var k,W;return k=F,dt(),W=tw(),W===n&&(W=iw(),W===n&&(W=sw(),W===n&&(W=aw(),W===n&&(W=cw(),W===n&&(W=uw(),W===n&&(W=lw(),W===n&&(W=hw(),W===n&&(W=pw(),W===n&&(W=mw(),W===n&&(W=gw(),W===n&&(W=vw(),W===n&&(W=bw(),W===n&&(W=dw(),W===n&&(W=U9(),W===n&&(W=fw(),W===n&&(W=Jg())))))))))))))))),W!==n?(dt(),pt=k,k=Zg(W)):(F=k,k=n),k}function tw(){var k,W,xe,me,Pe,De;if(k=F,t.substr(F,4)===c?(W=c,F+=4):(W=n,Me===0&&Ie(de)),W!==n)if(dt(),t.charCodeAt(F)===123?(xe=a,F++):(xe=n,Me===0&&Ie(ee)),xe!==n){for(dt(),me=[],Pe=rw(),Pe===n&&(Pe=nw());Pe!==n;)me.push(Pe),Pe=rw(),Pe===n&&(Pe=nw());Pe=dt(),t.charCodeAt(F)===125?(De=l,F++):(De=n,Me===0&&Ie(ie)),De!==n?(pt=k,k=YB(me)):(F=k,k=n)}else F=k,k=n;else F=k,k=n;return k}function nw(){var k,W,xe,me,Pe,De,je,et;if(k=F,dt(),W=ow(),W!==n)if(dt(),t.charCodeAt(F)===61?(xe=u,F++):(xe=n,Me===0&&Ie(ke)),xe!==n)if(dt(),me=kc(),me!==n){if(Pe=[],De=F,t.charCodeAt(F)===44?(je=d,F++):(je=n,Me===0&&Ie(X)),je!==n?(dt(),et=kc(),et!==n?(pt=De,De=Zx(W,me,et)):(F=De,De=n)):(F=De,De=n),De!==n)for(;De!==n;)Pe.push(De),De=F,t.charCodeAt(F)===44?(je=d,F++):(je=n,Me===0&&Ie(X)),je!==n?(dt(),et=kc(),et!==n?(pt=De,De=Zx(W,me,et)):(F=De,De=n)):(F=De,De=n);else Pe=n;Pe!==n?(De=dt(),pt=k,k=jB(W,me,Pe)):(F=k,k=n)}else F=k,k=n;else F=k,k=n;else F=k,k=n;return k===n&&(k=F,dt(),W=ow(),W!==n?(dt(),t.charCodeAt(F)===61?(xe=u,F++):(xe=n,Me===0&&Ie(ke)),xe!==n?(dt(),me=kc(),me!==n?(Pe=dt(),pt=k,k=KB(W,me)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)),k}function ow(){var k,W;return k=F,W=eo(),W!==n&&(pt=k,W=XB(W)),k=W,k===n&&(k=F,W=ed(),W!==n&&(pt=k,W=ZB(W)),k=W),k}function rw(){var k,W,xe,me;return k=F,dt(),W=W9(),W!==n?(t.charCodeAt(F)===9?(xe=f,F++):(xe=n,Me===0&&Ie(q)),xe!==n?(dt(),me=kc(),me!==n?(dt(),pt=k,k=QB(W,me)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n),k}function W9(){var k,W,xe,me;if(k=F,W=F,xe=[],me=t.charAt(F),le.test(me)?F++:(me=n,Me===0&&Ie(Y)),me!==n)for(;me!==n;)xe.push(me),me=t.charAt(F),le.test(me)?F++:(me=n,Me===0&&Ie(Y));else xe=n;return xe!==n?W=t.substring(W,F):W=xe,W!==n&&(pt=k,W=JB(W)),k=W,k}function iw(){var k,W,xe,me,Pe,De,je,et;if(k=F,t.substr(F,8)===h?(W=h,F+=8):(W=n,Me===0&&Ie(te)),W!==n)if(xe=so(),xe!==n)if(me=eo(),me!==n)if(dt(),t.charCodeAt(F)===123?(Pe=a,F++):(Pe=n,Me===0&&Ie(ee)),Pe!==n){for(dt(),De=[],je=go();je!==n;)De.push(je),je=go();je=dt(),t.charCodeAt(F)===125?(et=l,F++):(et=n,Me===0&&Ie(ie)),et!==n?(pt=k,k=e9(me,De)):(F=k,k=n)}else F=k,k=n;else F=k,k=n;else F=k,k=n;else F=k,k=n;return k===n&&(k=F,t.substr(F,8)===h?(W=h,F+=8):(W=n,Me===0&&Ie(te)),W!==n?(xe=dt(),t.charCodeAt(F)===123?(me=a,F++):(me=n,Me===0&&Ie(ee)),me!==n?(pt=k,k=t9()):(F=k,k=n)):(F=k,k=n)),k}function sw(){var k,W,xe,me,Pe,De,je,et,Ln,gn;if(k=F,t.substr(F,9)===m?(W=m,F+=9):(W=n,Me===0&&Ie(ue)),W!==n)if(xe=so(),xe!==n)if(me=eo(),me!==n)if(Pe=dt(),t.charCodeAt(F)===123?(De=a,F++):(De=n,Me===0&&Ie(ee)),De!==n){for(je=dt(),et=[],Ln=go();Ln!==n;)et.push(Ln),Ln=go();Ln=dt(),t.charCodeAt(F)===125?(gn=l,F++):(gn=n,Me===0&&Ie(ie)),gn!==n?(pt=k,k=n9(me,et)):(F=k,k=n)}else F=k,k=n;else F=k,k=n;else F=k,k=n;else F=k,k=n;return k===n&&(k=F,t.substr(F,9)===m?(W=m,F+=9):(W=n,Me===0&&Ie(ue)),W!==n?(xe=so(),xe!==n?(me=eo(),me!==n?(Pe=F,Me++,De=F,je=dt(),t.charCodeAt(F)===123?(et=a,F++):(et=n,Me===0&&Ie(ee)),et!==n?(je=[je,et],De=je):(F=De,De=n),Me--,De===n?Pe=void 0:(F=Pe,Pe=n),Pe!==n?(pt=k,k=o9(me)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n),k===n&&(k=F,t.substr(F,9)===m?(W=m,F+=9):(W=n,Me===0&&Ie(ue)),W!==n?(xe=dt(),t.charCodeAt(F)===123?(me=a,F++):(me=n,Me===0&&Ie(ee)),me!==n?(pt=k,k=r9()):(F=k,k=n)):(F=k,k=n))),k}function aw(){var k,W,xe,me,Pe,De,je,et,Ln,gn;if(k=F,t.substr(F,9)===b?(W=b,F+=9):(W=n,Me===0&&Ie(ye)),W!==n)if(xe=so(),xe!==n)if(me=eo(),me!==n)if(Pe=so(),Pe!==n)if(De=eo(),De!==n)if(dt(),t.charCodeAt(F)===123?(je=a,F++):(je=n,Me===0&&Ie(ee)),je!==n){for(dt(),et=[],Ln=go();Ln!==n;)et.push(Ln),Ln=go();Ln=dt(),t.charCodeAt(F)===125?(gn=l,F++):(gn=n,Me===0&&Ie(ie)),gn!==n?(pt=k,k=i9(me,De,et)):(F=k,k=n)}else F=k,k=n;else F=k,k=n;else F=k,k=n;else F=k,k=n;else F=k,k=n;else F=k,k=n;return k===n&&(k=F,t.substr(F,9)===b?(W=b,F+=9):(W=n,Me===0&&Ie(ye)),W!==n?(xe=so(),xe!==n?(me=eo(),me!==n?(Pe=dt(),t.charCodeAt(F)===123?(De=a,F++):(De=n,Me===0&&Ie(ee)),De!==n?(pt=k,k=s9()):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n),k===n&&(k=F,t.substr(F,9)===b?(W=b,F+=9):(W=n,Me===0&&Ie(ye)),W!==n?(xe=dt(),t.charCodeAt(F)===123?(me=a,F++):(me=n,Me===0&&Ie(ee)),me!==n?(pt=k,k=a9()):(F=k,k=n)):(F=k,k=n))),k}function lw(){var k,W,xe,me,Pe,De,je,et;if(k=F,t.substr(F,10)===g?(W=g,F+=10):(W=n,Me===0&&Ie(_e)),W!==n)if(xe=so(),xe!==n)if(me=eo(),me!==n)if(dt(),t.charCodeAt(F)===123?(Pe=a,F++):(Pe=n,Me===0&&Ie(ee)),Pe!==n){for(dt(),De=[],je=go();je!==n;)De.push(je),je=go();je=dt(),t.charCodeAt(F)===125?(et=l,F++):(et=n,Me===0&&Ie(ie)),et!==n?(pt=k,k=l9(me,De)):(F=k,k=n)}else F=k,k=n;else F=k,k=n;else F=k,k=n;else F=k,k=n;return k===n&&(k=F,t.substr(F,10)===g?(W=g,F+=10):(W=n,Me===0&&Ie(_e)),W!==n?(xe=dt(),t.charCodeAt(F)===123?(me=a,F++):(me=n,Me===0&&Ie(ee)),me!==n?(pt=k,k=c9()):(F=k,k=n)):(F=k,k=n)),k}function cw(){var k,W,xe,me,Pe,De;if(k=F,t.substr(F,5)===v?(W=v,F+=5):(W=n,Me===0&&Ie(Ae)),W!==n)if(dt(),t.charCodeAt(F)===123?(xe=a,F++):(xe=n,Me===0&&Ie(ee)),xe!==n){for(dt(),me=[],Pe=go();Pe!==n;)me.push(Pe),Pe=go();Pe=dt(),t.charCodeAt(F)===125?(De=l,F++):(De=n,Me===0&&Ie(ie)),De!==n?(pt=k,k=u9(me)):(F=k,k=n)}else F=k,k=n;else F=k,k=n;return k}function uw(){var k,W,xe,me,Pe,De;if(k=F,t.substr(F,4)===y?(W=y,F+=4):(W=n,Me===0&&Ie(Ee)),W!==n)if(dt(),t.charCodeAt(F)===123?(xe=a,F++):(xe=n,Me===0&&Ie(ee)),xe!==n){for(dt(),me=[],Pe=go();Pe!==n;)me.push(Pe),Pe=go();Pe=dt(),t.charCodeAt(F)===125?(De=l,F++):(De=n,Me===0&&Ie(ie)),De!==n?(pt=k,k=d9(me)):(F=k,k=n)}else F=k,k=n;else F=k,k=n;return k}function dw(){var k,W,xe,me,Pe,De,je,et;if(k=F,t.substr(F,6)===x?(W=x,F+=6):(W=n,Me===0&&Ie(Ue)),W!==n)if(xe=so(),xe!==n)if(me=eo(),me!==n)if(dt(),t.charCodeAt(F)===123?(Pe=a,F++):(Pe=n,Me===0&&Ie(ee)),Pe!==n){for(dt(),De=[],je=go();je!==n;)De.push(je),je=go();je=dt(),t.charCodeAt(F)===125?(et=l,F++):(et=n,Me===0&&Ie(ie)),et!==n?(pt=k,k=f9(me,De)):(F=k,k=n)}else F=k,k=n;else F=k,k=n;else F=k,k=n;else F=k,k=n;return k===n&&(k=F,t.substr(F,6)===x?(W=x,F+=6):(W=n,Me===0&&Ie(Ue)),W!==n?(xe=dt(),t.charCodeAt(F)===123?(me=a,F++):(me=n,Me===0&&Ie(ee)),me!==n?(pt=k,k=h9()):(F=k,k=n)):(F=k,k=n)),k}function U9(){var k,W,xe,me,Pe,De,je,et;if(k=F,t.substr(F,5)===_?(W=_,F+=5):(W=n,Me===0&&Ie(Le)),W!==n)if(xe=so(),xe!==n)if(me=eo(),me===n&&(me=null),dt(),t.charCodeAt(F)===123?(Pe=a,F++):(Pe=n,Me===0&&Ie(ee)),Pe!==n){for(dt(),De=[],je=yw();je!==n;)De.push(je),je=yw();je=dt(),t.charCodeAt(F)===125?(et=l,F++):(et=n,Me===0&&Ie(ie)),et!==n?(pt=k,k=p9(me,De)):(F=k,k=n)}else F=k,k=n;else F=k,k=n;else F=k,k=n;return k}function fw(){var k,W,xe,me,Pe,De,je,et;if(k=F,t.substr(F,9)===C?(W=C,F+=9):(W=n,Me===0&&Ie(Ge)),W!==n)if(xe=so(),xe!==n)if(me=ed(),me!==n)if(dt(),t.charCodeAt(F)===123?(Pe=a,F++):(Pe=n,Me===0&&Ie(ee)),Pe!==n){for(dt(),De=[],je=go();je!==n;)De.push(je),je=go();je=dt(),t.charCodeAt(F)===125?(et=l,F++):(et=n,Me===0&&Ie(ie)),et!==n?(pt=k,k=m9(me,De)):(F=k,k=n)}else F=k,k=n;else F=k,k=n;else F=k,k=n;else F=k,k=n;return k}function hw(){var k,W,xe,me;return k=F,t.substr(F,15)===D?(W=D,F+=15):(W=n,Me===0&&Ie(st)),W!==n?(xe=so(),xe!==n?(me=eo(),me!==n?(pt=k,k=g9(me)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n),k}function pw(){var k,W,xe,me;return k=F,t.substr(F,10)===M?(W=M,F+=10):(W=n,Me===0&&Ie(ut)),W!==n?(xe=so(),xe!==n?(me=eo(),me!==n?(pt=k,k=v9(me)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n),k}function mw(){var k,W,xe,me;return k=F,t.substr(F,9)===$?(W=$,F+=9):(W=n,Me===0&&Ie($t)),W!==n?(xe=so(),xe!==n?(me=eo(),me!==n?(pt=k,k=b9(me)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n),k}function gw(){var k,W,xe,me;return k=F,t.substr(F,15)===L?(W=L,F+=15):(W=n,Me===0&&Ie(rn)),W!==n?(xe=so(),xe!==n?(me=eo(),me!==n?(pt=k,k=y9(me)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n),k}function vw(){var k,W,xe,me;return k=F,t.substr(F,10)===E?(W=E,F+=10):(W=n,Me===0&&Ie(It)),W!==n?(xe=so(),xe!==n?(me=eo(),me!==n?(pt=k,k=x9(me)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n),k}function bw(){var k,W,xe,me;return k=F,t.substr(F,9)===N?(W=N,F+=9):(W=n,Me===0&&Ie(jt)),W!==n?(xe=so(),xe!==n?(me=eo(),me!==n?(pt=k,k=w9(me)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n),k}function yw(){var k,W;return k=F,dt(),W=tw(),W===n&&(W=iw(),W===n&&(W=sw(),W===n&&(W=aw(),W===n&&(W=cw(),W===n&&(W=uw(),W===n&&(W=lw(),W===n&&(W=hw(),W===n&&(W=pw(),W===n&&(W=mw(),W===n&&(W=gw(),W===n&&(W=vw(),W===n&&(W=bw(),W===n&&(W=dw(),W===n&&(W=fw(),W===n&&(W=Jg()))))))))))))))),W!==n?(dt(),pt=k,k=_9(W)):(F=k,k=n),k}function go(){var k,W;return k=F,dt(),W=Jg(),W!==n?(dt(),pt=k,k=k9(W)):(F=k,k=n),k}function Jg(){var k,W,xe,me;return k=F,W=G9(),W!==n?(dt(),t.charCodeAt(F)===61?(xe=u,F++):(xe=n,Me===0&&Ie(ke)),xe!==n?(dt(),me=kc(),me!==n?(pt=k,k=S9(W,me)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n),k}function G9(){var k;return k=eo(),k===n&&(k=ed()),k}function kc(){var k,W,xe;return k=F,W=xw(),W!==n?(t.charCodeAt(F)===37?(xe=T,F++):(xe=n,Me===0&&Ie(Hn)),xe!==n?(pt=k,k=C9(W)):(F=k,k=n)):(F=k,k=n),k===n&&(k=F,W=xw(),W!==n&&(pt=k,W=A9(W)),k=W,k===n&&(k=F,W=eo(),W!==n&&(pt=k,W=$9(W)),k=W,k===n&&(k=F,W=ed(),W!==n&&(pt=k,W=T9(W)),k=W))),k}function ed(){var k,W,xe,me,Pe;if(Me++,k=F,W=F,xe=t.charAt(F),fe.test(xe)?F++:(xe=n,Me===0&&Ie(mn)),xe!==n){for(me=[],Pe=t.charAt(F),we.test(Pe)?F++:(Pe=n,Me===0&&Ie(tr));Pe!==n;)me.push(Pe),Pe=t.charAt(F),we.test(Pe)?F++:(Pe=n,Me===0&&Ie(tr));xe=[xe,me],W=xe}else F=W,W=n;return W!==n?k=t.substring(k,F):k=W,Me--,k===n&&(W=n,Me===0&&Ie(Wn)),k}function xw(){var k,W,xe,me,Pe,De,je,et,Ln,gn;if(k=F,W=F,xe=F,t.charCodeAt(F)===45?(me=O,F++):(me=n,Me===0&&Ie(mr)),me===n&&(me=null),Pe=F,t.charCodeAt(F)===46?(De=P,F++):(De=n,Me===0&&Ie(nt)),De!==n){if(je=[],et=t.charAt(F),Z.test(et)?F++:(et=n,Me===0&&Ie(Se)),et!==n)for(;et!==n;)je.push(et),et=t.charAt(F),Z.test(et)?F++:(et=n,Me===0&&Ie(Se));else je=n;je!==n?(De=[De,je],Pe=De):(F=Pe,Pe=n)}else F=Pe,Pe=n;if(Pe===n){if(Pe=F,De=[],je=t.charAt(F),Z.test(je)?F++:(je=n,Me===0&&Ie(Se)),je!==n)for(;je!==n;)De.push(je),je=t.charAt(F),Z.test(je)?F++:(je=n,Me===0&&Ie(Se));else De=n;if(De!==n){if(je=F,t.charCodeAt(F)===46?(et=P,F++):(et=n,Me===0&&Ie(nt)),et!==n){for(Ln=[],gn=t.charAt(F),Z.test(gn)?F++:(gn=n,Me===0&&Ie(Se));gn!==n;)Ln.push(gn),gn=t.charAt(F),Z.test(gn)?F++:(gn=n,Me===0&&Ie(Se));et=[et,Ln],je=et}else F=je,je=n;je===n&&(je=null),De=[De,je],Pe=De}else F=Pe,Pe=n}if(Pe!==n){if(De=F,je=t.charAt(F),be.test(je)?F++:(je=n,Me===0&&Ie(Je)),je!==n){if(et=t.charAt(F),re.test(et)?F++:(et=n,Me===0&&Ie(ze)),et===n&&(et=null),Ln=[],gn=t.charAt(F),Z.test(gn)?F++:(gn=n,Me===0&&Ie(Se)),gn!==n)for(;gn!==n;)Ln.push(gn),gn=t.charAt(F),Z.test(gn)?F++:(gn=n,Me===0&&Ie(Se));else Ln=n;Ln!==n?(je=[je,et,Ln],De=je):(F=De,De=n)}else F=De,De=n;De===n&&(De=null),me=[me,Pe,De],xe=me}else F=xe,xe=n;return xe!==n?W=t.substring(W,F):W=xe,W!==n&&(pt=k,W=O9(W)),k=W,k}function eo(){var k,W,xe,me;if(Me++,k=F,t.charCodeAt(F)===34?(W=B,F++):(W=n,Me===0&&Ie(sn)),W!==n){for(xe=[],me=ww();me!==n;)xe.push(me),me=ww();t.charCodeAt(F)===34?(me=B,F++):(me=n,Me===0&&Ie(sn)),me!==n?(pt=k,k=M9(xe)):(F=k,k=n)}else F=k,k=n;return Me--,k===n&&(W=n,Me===0&&Ie(ht)),k}function ww(){var k,W,xe;return k=F,t.charCodeAt(F)===92?(W=V,F++):(W=n,Me===0&&Ie(Un)),W!==n?(xe=q9(),xe!==n?(pt=k,k=B9(xe)):(F=k,k=n)):(F=k,k=n),k===n&&(k=t.charAt(F),ve.test(k)?F++:(k=n,Me===0&&Ie(Io))),k}function q9(){var k,W,xe,me,Pe,De,je,et;return k=F,t.charCodeAt(F)===34?(W=B,F++):(W=n,Me===0&&Ie(sn)),W!==n&&(pt=k,W=L9()),k=W,k===n&&(k=F,t.charCodeAt(F)===92?(W=V,F++):(W=n,Me===0&&Ie(Un)),W!==n&&(pt=k,W=P9()),k=W,k===n&&(k=F,t.charCodeAt(F)===110?(W=z,F++):(W=n,Me===0&&Ie(io)),W!==n&&(pt=k,W=D9()),k=W,k===n&&(k=F,t.charCodeAt(F)===114?(W=G,F++):(W=n,Me===0&&Ie(gr)),W!==n&&(pt=k,W=E9()),k=W,k===n&&(k=F,t.charCodeAt(F)===116?(W=K,F++):(W=n,Me===0&&Ie(Fr)),W!==n&&(pt=k,W=I9()),k=W,k===n&&(k=F,t.charCodeAt(F)===117?(W=ne,F++):(W=n,Me===0&&Ie(Ss)),W!==n?(xe=F,me=F,Pe=t.charAt(F),ce.test(Pe)?F++:(Pe=n,Me===0&&Ie(qe)),Pe!==n?(De=t.charAt(F),ce.test(De)?F++:(De=n,Me===0&&Ie(qe)),De!==n?(je=t.charAt(F),ce.test(je)?F++:(je=n,Me===0&&Ie(qe)),je!==n?(et=t.charAt(F),ce.test(et)?F++:(et=n,Me===0&&Ie(qe)),et!==n?(Pe=[Pe,De,je,et],me=Pe):(F=me,me=n)):(F=me,me=n)):(F=me,me=n)):(F=me,me=n),me!==n?xe=t.substring(xe,F):xe=me,xe!==n?(pt=k,k=N9(xe)):(F=k,k=n)):(F=k,k=n),k===n&&(k=F,t.length>F?(W=t.charAt(F),F++):(W=n,Me===0&&Ie(ct)),W!==n&&(pt=k,W=R9(W)),k=W)))))),k}function uh(){var k;return k=Y9(),k===n&&(k=j9()),k}function Y9(){var k,W,xe,me;if(k=F,t.substr(F,2)===ae?(W=ae,F+=2):(W=n,Me===0&&Ie(Pt)),W!==n){for(xe=[],me=t.charAt(F),I.test(me)?F++:(me=n,Me===0&&Ie(Wt));me!==n;)xe.push(me),me=t.charAt(F),I.test(me)?F++:(me=n,Me===0&&Ie(Wt));W=[W,xe],k=W}else F=k,k=n;return k}function j9(){var k,W,xe,me,Pe,De;if(k=F,t.substr(F,2)===he?(W=he,F+=2):(W=n,Me===0&&Ie(Jn)),W!==n){for(xe=[],me=F,Pe=F,Me++,t.substr(F,2)===ge?(De=ge,F+=2):(De=n,Me===0&&Ie(Gn)),Me--,De===n?Pe=void 0:(F=Pe,Pe=n),Pe!==n?(t.length>F?(De=t.charAt(F),F++):(De=n,Me===0&&Ie(ct)),De!==n?(Pe=[Pe,De],me=Pe):(F=me,me=n)):(F=me,me=n);me!==n;)xe.push(me),me=F,Pe=F,Me++,t.substr(F,2)===ge?(De=ge,F+=2):(De=n,Me===0&&Ie(Gn)),Me--,De===n?Pe=void 0:(F=Pe,Pe=n),Pe!==n?(t.length>F?(De=t.charAt(F),F++):(De=n,Me===0&&Ie(ct)),De!==n?(Pe=[Pe,De],me=Pe):(F=me,me=n)):(F=me,me=n);t.substr(F,2)===ge?(me=ge,F+=2):(me=n,Me===0&&Ie(Gn)),me!==n?(W=[W,xe,me],k=W):(F=k,k=n)}else F=k,k=n;return k}function so(){var k,W;if(Me++,k=[],W=t.charAt(F),U.test(W)?F++:(W=n,Me===0&&Ie(Cs)),W===n&&(W=uh()),W!==n)for(;W!==n;)k.push(W),W=t.charAt(F),U.test(W)?F++:(W=n,Me===0&&Ie(Cs)),W===n&&(W=uh());else k=n;return Me--,k===n&&(W=n,Me===0&&Ie(ai)),k}function dt(){var k,W;for(Me++,k=[],W=t.charAt(F),U.test(W)?F++:(W=n,Me===0&&Ie(Cs)),W===n&&(W=uh());W!==n;)k.push(W),W=t.charAt(F),U.test(W)?F++:(W=n,Me===0&&Ie(Cs)),W===n&&(W=uh());return Me--,W=n,Me===0&&Ie(wc),k}if(Ju=i(),e.peg$library)return{peg$result:Ju,peg$currPos:F,peg$FAILED:n,peg$maxFailExpected:lh,peg$maxFailPos:li};if(Ju!==n&&F===t.length)return Ju;throw Ju!==n&&F<t.length&&Ie(V9()),H9(lh,li<t.length?t.charAt(li):null,li<t.length?Qg(li,li+1):Qg(li,li))}function Mg(t){try{return $re(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 Kr(t){return new Map(t.map(e=>[e.key,e.value]))}function Bg(t,e){const n=Kr(e),o=Cu(t),r=new Set(o.map(s=>s.key)),i={};for(const s of o){const a=n.get(s.key);a!==void 0&&r.has(s.key)&&(s.type===Qe.Colors?i[s.key]=String(a).split(",").map(l=>l.trim()).filter(Boolean):s.type===Qe.Boolean?s.key==="valueLabels"&&String(a).toLowerCase()==="percent"?i[s.key]="percent":i[s.key]=a==="true"||a===!0:i[s.key]=String(a))}return i}function Tre(t){return!(/^-?\d+(\.\d+)?$/.test(t)||/^-?\d+(\.\d+)?%$/.test(t)||/^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(t))}function O0(t){return t.entries.map(e=>{if(e.values&&e.values.length>1){if(e.key==="series"&&!e.quotedKey)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"&&!e.quotedKey?`series = "${n}"`:typeof e.value=="string"&&Tre(n)?`"${e.key}" = "${n}"`:`"${e.key}" = ${n}`}).join(`
|
|
90
|
+
`)}function Ore(t,e){const n=Kr(t.properties),o=n.get("type"),r=o??e;return{name:t.name,chartType:o,properties:n,data:t.data,chartTypeOptions:Bg(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 ak(t,e){const n=t.find(o=>o.key===e);return n?String(n.value):void 0}function lk(t,e){const n=t.find(o=>o.key===e);if(n)return n.isPercentage,n.value}function ck(t){const e=t.find(n=>n.key==="maxWidth");if(e)return e.isPercentage?`${e.value}%`:e.value}const Ta=t=>t==="true"||t===!0;function M0(t){return t.map(e=>({target:e.target,color:ak(e.properties,"color")??"#e15759",label:ak(e.properties,"label")}))}function B0(t){return t.map(e=>({target:e.target}))}function L0(t){return t.map(e=>{const n=Kr(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 P0(t){return t.map(e=>{const n=Kr(e.properties),o=e.kind??Ht.Point;if(o===Ht.Range){const a={kind:Ht.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===Ht.Free){const a={kind:Ht.Free,text:String(n.get("text")??""),x:lk(e.properties,"x")??0,y:lk(e.properties,"y")??0};n.has("id")&&(a.id=String(n.get("id"))),n.has("textColor")&&(a.textColor=String(n.get("textColor")));const l=ck(e.properties);return l!==void 0&&(a.maxWidth=l),n.has("textOutline")&&(a.textOutline=Ta(n.get("textOutline"))),a}const r="target"in e?e.target:"",i={kind:Ht.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=ck(e.properties);return s!==void 0&&(i.maxWidth=s),n.has("textOutline")&&(i.textOutline=Ta(n.get("textOutline"))),n.has("showLine")&&(i.showLine=Ta(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=Ta(n.get("showArrow"))),n.has("lineTargetDistance")&&(i.lineTargetDistance=Number(n.get("lineTargetDistance"))),n.has("showCircle")&&(i.showCircle=Ta(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 D0(t){return t.map(e=>{const n=Kr(e.properties),o={name:e.name};if(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")){const r=n.get("valueLabels");o.valueLabels=String(r).toLowerCase()==="percent"?"percent":Ta(r)}return n.has("lineSymbols")&&(o.lineSymbols=Ta(n.get("lineSymbols"))),n.has("hidden")&&(o.hidden=Ta(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 Mre=`chart bar-vertical {
|
|
91
|
+
title = "E is the most frequent letter in English"
|
|
92
|
+
description = "How often each letter appears in typical English text"
|
|
93
|
+
byline = "Pierre Romera"
|
|
94
|
+
source = "Lewand, Cryptological Mathematics"
|
|
95
|
+
sourceUrl = "https://en.wikipedia.org/wiki/Letter_frequency"
|
|
96
|
+
note = "Based on analysis of 40,000 words from English prose"
|
|
97
|
+
colorPalette = "London"
|
|
98
|
+
sort = descending
|
|
99
|
+
valueLabels = true
|
|
100
|
+
verticalLabelPosition = off
|
|
101
|
+
verticalGridStyle = none
|
|
102
|
+
|
|
103
|
+
highlight "E"
|
|
104
|
+
|
|
105
|
+
data {
|
|
106
|
+
"E" = 12.70
|
|
107
|
+
"T" = 9.06
|
|
108
|
+
"A" = 8.17
|
|
109
|
+
"O" = 7.51
|
|
110
|
+
"I" = 6.97
|
|
111
|
+
"N" = 6.75
|
|
112
|
+
"S" = 6.33
|
|
113
|
+
"H" = 6.09
|
|
114
|
+
"R" = 5.99
|
|
115
|
+
"D" = 4.25
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
`,Bre=`chart bar-vertical {
|
|
119
|
+
title = "China emits more CO₂ than the US and India combined"
|
|
120
|
+
description = "Annual emissions in billion tonnes, 2023"
|
|
121
|
+
source = "Global Carbon Project"
|
|
122
|
+
sourceUrl = "https://globalcarbonproject.org"
|
|
123
|
+
verticalLabelPosition = "off"
|
|
124
|
+
verticalGridStyle = "none"
|
|
125
|
+
valueLabels = true
|
|
126
|
+
|
|
127
|
+
data {
|
|
128
|
+
"China" = 11.9
|
|
129
|
+
"United States" = 4.78
|
|
130
|
+
"India" = 2.88
|
|
131
|
+
"Russia" = 1.78
|
|
132
|
+
"Japan" = 1.02
|
|
133
|
+
"Germany" = 0.64
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
highlight "China"
|
|
137
|
+
|
|
138
|
+
annotation "India" {
|
|
139
|
+
text = "Surpassed EU in 2023"
|
|
140
|
+
showLine = true
|
|
141
|
+
anchorDirection = N
|
|
142
|
+
textOffsetX = 66
|
|
143
|
+
textOffsetY = -41
|
|
144
|
+
lineStyle = curve-left
|
|
145
|
+
showArrow = true
|
|
146
|
+
lineTargetDistance = 26
|
|
147
|
+
showCircle = false
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
`,Lre=`chart bar-horizontal {
|
|
151
|
+
title = "Mandarin has nearly twice as many native speakers as Spanish"
|
|
152
|
+
description = "Number of native speakers worldwide, in millions"
|
|
153
|
+
source = "Ethnologue"
|
|
154
|
+
sourceUrl = "https://ethnologue.com"
|
|
155
|
+
byline = "Pierre Romera"
|
|
156
|
+
sort = descending
|
|
157
|
+
horizontalLabelPosition = off
|
|
158
|
+
horizontalGridStyle = none
|
|
159
|
+
|
|
160
|
+
highlight "Mandarin"
|
|
161
|
+
|
|
162
|
+
data {
|
|
163
|
+
"Mandarin" = 920
|
|
164
|
+
"Spanish" = 475
|
|
165
|
+
"English" = 373
|
|
166
|
+
"Hindi" = 344
|
|
167
|
+
"Bengali" = 234
|
|
168
|
+
"Portuguese" = 232
|
|
169
|
+
"Russian" = 154
|
|
170
|
+
"Japanese" = 125
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
`,Pre=`chart line-multi {
|
|
174
|
+
title = "Software overtakes hardware as the top revenue driver"
|
|
175
|
+
description = "USD billions"
|
|
176
|
+
byline = "Pierre Romera"
|
|
177
|
+
source = "Company filings"
|
|
178
|
+
note = "Figures are illustrative and do not represent actual company data"
|
|
179
|
+
tooltips = true
|
|
180
|
+
colorPalette = "Egypt"
|
|
181
|
+
|
|
182
|
+
data {
|
|
183
|
+
series = "Hardware","Software","Services"
|
|
184
|
+
"Q1 2024" = 14.2,9.8,7.4
|
|
185
|
+
"Q2 2024" = 13.8,11.0,8.1
|
|
186
|
+
"Q3 2024" = 15.5,12.1,8.9
|
|
187
|
+
"Q4 2024" = 18.9,13.4,10.2
|
|
188
|
+
"Q1 2025" = 14.8,14.0,9.5
|
|
189
|
+
"Q2 2025" = 16.2,15.5,10.8
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
`,Dre=`chart bar-multi {
|
|
193
|
+
title = "USA tops Paris 2024 with 126 medals across all categories"
|
|
194
|
+
description = "2024 Paris Summer Games — top six nations"
|
|
195
|
+
source = "Olympics.com"
|
|
196
|
+
sourceUrl = "https://olympics.com"
|
|
197
|
+
colors = "#eeca3b, #c0c0c0, #cd7f32"
|
|
198
|
+
valueLabels = true
|
|
199
|
+
verticalGridStyle = none
|
|
200
|
+
verticalLabelPosition = off
|
|
201
|
+
sort = descending
|
|
202
|
+
|
|
203
|
+
data {
|
|
204
|
+
series = "Gold","Silver","Bronze"
|
|
205
|
+
"USA" = 40,44,42
|
|
206
|
+
"China" = 38,32,18
|
|
207
|
+
"Japan" = 27,14,17
|
|
208
|
+
"Great Britain" = 22,21,22
|
|
209
|
+
"Australia" = 17,7,22
|
|
210
|
+
"France" = 16,20,23
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
`,Ere=`chart line {
|
|
214
|
+
title = "2024 was the hottest year on record"
|
|
215
|
+
description = "Deviation from the 1951–1980 average, in °C"
|
|
216
|
+
source = "NASA GISS"
|
|
217
|
+
sourceUrl = "https://data.giss.nasa.gov/gistemp/"
|
|
218
|
+
tooltips = true
|
|
219
|
+
crosshair = false
|
|
220
|
+
lineSymbols = true
|
|
221
|
+
|
|
222
|
+
data {
|
|
223
|
+
"1980" = 0.26
|
|
224
|
+
"1985" = 0.12
|
|
225
|
+
"1990" = 0.45
|
|
226
|
+
"1995" = 0.45
|
|
227
|
+
"2000" = 0.42
|
|
228
|
+
"2005" = 0.68
|
|
229
|
+
"2010" = 0.72
|
|
230
|
+
"2015" = 0.9
|
|
231
|
+
"2020" = 1.02
|
|
232
|
+
"2024" = 1.29
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
annotation "2015" {
|
|
236
|
+
id = "2o3cx"
|
|
237
|
+
text = "2015 Paris Agreement to limit global warming to 1.5°C "
|
|
238
|
+
maxWidth = 224
|
|
239
|
+
showLine = true
|
|
240
|
+
lineStyle = curve-right
|
|
241
|
+
showArrow = true
|
|
242
|
+
showCircle = true
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
`,Ire=`chart line {
|
|
246
|
+
title = "Bitcoin surged past $90,000 in 2024"
|
|
247
|
+
description = "USD, year-end closing price"
|
|
248
|
+
source = "CoinGecko"
|
|
249
|
+
sourceUrl = "https://www.coingecko.com"
|
|
250
|
+
colors = "#f7931a"
|
|
251
|
+
lineSymbols = true
|
|
252
|
+
lineSymbolShowOn = "all"
|
|
253
|
+
lineSymbolShape = "diamond"
|
|
254
|
+
verticalNumberFormat = ",.0f"
|
|
255
|
+
tooltips = true
|
|
256
|
+
|
|
257
|
+
annotation "2021" {
|
|
258
|
+
text = "All-time high cycle"
|
|
259
|
+
textOffsetY = -12
|
|
260
|
+
showArrow = true
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
data {
|
|
264
|
+
"2016" = 963
|
|
265
|
+
"2017" = 13880
|
|
266
|
+
"2018" = 3742
|
|
267
|
+
"2019" = 7194
|
|
268
|
+
"2020" = 28949
|
|
269
|
+
"2021" = 46306
|
|
270
|
+
"2022" = 16547
|
|
271
|
+
"2023" = 42258
|
|
272
|
+
"2024" = 93429
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
`,Nre=`chart line-multi {
|
|
276
|
+
title = "Detroit's unemployment hit 16% during the Great Recession"
|
|
277
|
+
description = "Percent of labour force, 2000–2014"
|
|
278
|
+
source = "Bureau of Labor Statistics"
|
|
279
|
+
sourceUrl = "https://bls.gov"
|
|
280
|
+
note = "Not seasonally adjusted. Metro area definitions may vary across years."
|
|
281
|
+
colorPalette = "Maya"
|
|
282
|
+
tooltips = true
|
|
283
|
+
|
|
284
|
+
annotation "2009" {
|
|
285
|
+
text = "Great Recession peak"
|
|
286
|
+
textOffsetY = -10
|
|
287
|
+
showArrow = true
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
data {
|
|
291
|
+
series = "New York","Los Angeles","Chicago","Detroit"
|
|
292
|
+
"2000" = 5.0,5.6,4.5,3.8
|
|
293
|
+
"2002" = 7.3,7.5,6.8,7.0
|
|
294
|
+
"2004" = 6.5,6.4,6.5,7.3
|
|
295
|
+
"2006" = 5.0,4.8,5.0,6.8
|
|
296
|
+
"2008" = 6.2,7.5,7.1,9.4
|
|
297
|
+
"2009" = 9.5,12.4,11.2,16.2
|
|
298
|
+
"2010" = 9.4,12.7,10.8,15.8
|
|
299
|
+
"2012" = 8.2,10.6,9.3,10.4
|
|
300
|
+
"2014" = 6.5,8.0,7.1,8.2
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
`,Rre=`chart pie {
|
|
304
|
+
title = "Asia is home to nearly 60% of the world's population"
|
|
305
|
+
description = "Estimated share, 2024"
|
|
306
|
+
source = "United Nations"
|
|
307
|
+
sourceUrl = "https://population.un.org"
|
|
308
|
+
colorPalette = "Klimt"
|
|
309
|
+
legendPosition = "right"
|
|
310
|
+
tooltips = true
|
|
311
|
+
|
|
312
|
+
data {
|
|
313
|
+
"Asia" = 59.4
|
|
314
|
+
"Africa" = 18.3
|
|
315
|
+
"Europe" = 9.3
|
|
316
|
+
"Latin America" = 8.2
|
|
317
|
+
"North America" = 4.8
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
`,Fre=`chart bar-vertical {
|
|
321
|
+
title = "Brazil produces more coffee than the next three countries combined"
|
|
322
|
+
description = "Million 60-kg bags, 2023/24 crop year"
|
|
323
|
+
source = "International Coffee Organization"
|
|
324
|
+
sourceUrl = "https://ico.org"
|
|
325
|
+
colorPalette = "Harvey"
|
|
326
|
+
verticalLabelPosition = "off"
|
|
327
|
+
verticalGridStyle = "none"
|
|
328
|
+
valueLabels = true
|
|
329
|
+
|
|
330
|
+
data {
|
|
331
|
+
"Brazil" = 66.4
|
|
332
|
+
"Vietnam" = 29
|
|
333
|
+
"Colombia" = 11.4
|
|
334
|
+
"Indonesia" = 9.9
|
|
335
|
+
"Ethiopia" = 8.7
|
|
336
|
+
"Honduras" = 6.3
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
highlight "Brazil"
|
|
340
|
+
|
|
341
|
+
transform sort {
|
|
342
|
+
column = "value"
|
|
343
|
+
direction = descending
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
`,Vre=`chart donut {
|
|
347
|
+
title = "Chrome dominates with two-thirds of the desktop browser market"
|
|
348
|
+
description = "Worldwide, January 2025"
|
|
349
|
+
source = "StatCounter"
|
|
350
|
+
sourceUrl = "https://gs.statcounter.com"
|
|
351
|
+
colorPalette = "Heep"
|
|
352
|
+
legendPosition = "right"
|
|
353
|
+
tooltips = true
|
|
354
|
+
displayAsPercentage = true
|
|
355
|
+
|
|
356
|
+
data {
|
|
357
|
+
"Chrome" = 65.7
|
|
358
|
+
"Edge" = 13.1
|
|
359
|
+
"Safari" = 8.9
|
|
360
|
+
"Firefox" = 6.3
|
|
361
|
+
"Opera" = 3.1
|
|
362
|
+
"Others" = 2.9
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
`,zre=`chart area {
|
|
366
|
+
title = "Apple stock climbed 36 % through 2024"
|
|
367
|
+
description = "Monthly closing price in USD"
|
|
368
|
+
source = "Yahoo Finance"
|
|
369
|
+
sourceUrl = "https://finance.yahoo.com"
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
data {
|
|
373
|
+
"Jan" = 183
|
|
374
|
+
"Feb" = 182
|
|
375
|
+
"Mar" = 171
|
|
376
|
+
"Apr" = 170
|
|
377
|
+
"May" = 192
|
|
378
|
+
"Jun" = 210
|
|
379
|
+
"Jul" = 222
|
|
380
|
+
"Aug" = 229
|
|
381
|
+
"Sep" = 233
|
|
382
|
+
"Oct" = 225
|
|
383
|
+
"Nov" = 237
|
|
384
|
+
"Dec" = 249
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
`,Hre=`chart area-stacked {
|
|
388
|
+
title = "Renewables rose from 18 % to 23 % of global energy since 2000"
|
|
389
|
+
description = "Share of primary energy by source, 2000–2023"
|
|
390
|
+
source = "Our World in Data"
|
|
391
|
+
sourceUrl = "https://ourworldindata.org/energy-mix"
|
|
392
|
+
stackPercent = true
|
|
393
|
+
areaSortMode = descending
|
|
394
|
+
|
|
395
|
+
data {
|
|
396
|
+
series = "Coal","Oil","Gas","Renewables"
|
|
397
|
+
"2000" = 25,36,21,18
|
|
398
|
+
"2005" = 27,35,22,16
|
|
399
|
+
"2010" = 29,33,23,15
|
|
400
|
+
"2015" = 28,32,24,16
|
|
401
|
+
"2020" = 26,30,25,19
|
|
402
|
+
"2023" = 24,29,24,23
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
`,Wre=`chart column-stacked {
|
|
406
|
+
title = "Revenue climbed every quarter as the product mix held steady"
|
|
407
|
+
description = "Quarterly revenue in millions, 2024"
|
|
408
|
+
source = "Annual report"
|
|
409
|
+
|
|
410
|
+
data {
|
|
411
|
+
series = "Hardware","Software","Services"
|
|
412
|
+
"Q1" = 120,85,45
|
|
413
|
+
"Q2" = 135,92,48
|
|
414
|
+
"Q3" = 128,98,52
|
|
415
|
+
"Q4" = 155,105,58
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
`,Ure=`chart bar-stacked {
|
|
419
|
+
title = "India's working-age population now surpasses China's"
|
|
420
|
+
description = "Millions of people, 2023"
|
|
421
|
+
source = "UN Population Division"
|
|
422
|
+
sourceUrl = "https://population.un.org"
|
|
423
|
+
horizontalGridStyle = none
|
|
424
|
+
horizontalLabelPosition = off
|
|
425
|
+
|
|
426
|
+
data {
|
|
427
|
+
series = "0-14","15-64","65+"
|
|
428
|
+
"China" = 249,987,191
|
|
429
|
+
"India" = 365,948,100
|
|
430
|
+
"USA" = 60,215,58
|
|
431
|
+
"Indonesia" = 66,191,18
|
|
432
|
+
"Brazil" = 42,150,22
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
`,Gre=`chart area-stacked {
|
|
436
|
+
title = "EU subsidies to new members surged after enlargement"
|
|
437
|
+
description = "Agricultural subsidies to post-socialist EU members, million euros"
|
|
438
|
+
source = "Eurostat"
|
|
439
|
+
sourceUrl = "https://ec.europa.eu/eurostat"
|
|
440
|
+
interpolation = "linear"
|
|
441
|
+
heightMode = "aspect-ratio"
|
|
442
|
+
aspectRatio = "1:1"
|
|
443
|
+
|
|
444
|
+
data {
|
|
445
|
+
series = "Indirect subsidies","Direct subsidies"
|
|
446
|
+
"2000" = 370,800
|
|
447
|
+
"2001" = 445,896
|
|
448
|
+
"2002" = 567,816
|
|
449
|
+
"2003" = 641,950
|
|
450
|
+
"2004" = 1908,2434
|
|
451
|
+
"2005" = 2234,3509
|
|
452
|
+
"2006" = 2576,4356
|
|
453
|
+
"2007" = 2467,5429
|
|
454
|
+
"2008" = 2672,6655
|
|
455
|
+
"2009" = 2474,7195
|
|
456
|
+
"2010" = 2117,8207
|
|
457
|
+
"2011" = 1863,9230
|
|
458
|
+
"2012" = 1528,9191
|
|
459
|
+
"2013" = 1251,10252
|
|
460
|
+
"2014" = 1132,10987
|
|
461
|
+
"2015" = 1687,10145
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
scene "Indirect subsidies shrank" {
|
|
465
|
+
title = "Indirect subsidies were cut under WTO pressure"
|
|
466
|
+
description = "Subsidies tied to specific crops fell foul of World Trade Organization rules"
|
|
467
|
+
|
|
468
|
+
highlight "Indirect subsidies"
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
scene "Direct subsidies dominate" {
|
|
472
|
+
title = "Direct per-hectare payments now dominate"
|
|
473
|
+
description = "The larger the fields, the more money farmers receive"
|
|
474
|
+
|
|
475
|
+
highlight "Direct subsidies"
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
scene "Bulgaria: subsidies explode" {
|
|
479
|
+
title = "Subsidies to Bulgarian farmers, million euros"
|
|
480
|
+
description = "85% of Bulgarian subsidies are direct payments — the highest share among new members"
|
|
481
|
+
|
|
482
|
+
data {
|
|
483
|
+
series = "Indirect subsidies","Direct subsidies"
|
|
484
|
+
"2000" = 0,5
|
|
485
|
+
"2001" = 0,33
|
|
486
|
+
"2002" = 0,48
|
|
487
|
+
"2003" = 0,69
|
|
488
|
+
"2004" = 0,67
|
|
489
|
+
"2005" = 0,87
|
|
490
|
+
"2006" = 0,57
|
|
491
|
+
"2007" = 59,250
|
|
492
|
+
"2008" = 75,484
|
|
493
|
+
"2009" = 97,415
|
|
494
|
+
"2010" = 79,466
|
|
495
|
+
"2011" = 94,458
|
|
496
|
+
"2012" = 120,617
|
|
497
|
+
"2013" = 132,852
|
|
498
|
+
"2014" = 143,821
|
|
499
|
+
"2015" = 213,677
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
highlight "Direct subsidies"
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
scene "Bulgarian farms grew" {
|
|
506
|
+
title = "Average farm size in Bulgaria quadrupled"
|
|
507
|
+
description = "Average farm size in hectares"
|
|
508
|
+
type = line
|
|
509
|
+
|
|
510
|
+
data {
|
|
511
|
+
"2005" = 5
|
|
512
|
+
"2007" = 6
|
|
513
|
+
"2010" = 12
|
|
514
|
+
"2013" = 18
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
scene "Production rose" {
|
|
519
|
+
title = "Bulgarian farm production rose from 3 to 4 billion euros"
|
|
520
|
+
description = "Total production of Bulgarian farms, million euros"
|
|
521
|
+
type = area
|
|
522
|
+
|
|
523
|
+
data {
|
|
524
|
+
"2000" = 2933
|
|
525
|
+
"2001" = 3240
|
|
526
|
+
"2002" = 3051
|
|
527
|
+
"2003" = 2816
|
|
528
|
+
"2004" = 3049
|
|
529
|
+
"2005" = 3011
|
|
530
|
+
"2006" = 3111
|
|
531
|
+
"2007" = 3038
|
|
532
|
+
"2008" = 4148
|
|
533
|
+
"2009" = 3437
|
|
534
|
+
"2010" = 3486
|
|
535
|
+
"2011" = 4038
|
|
536
|
+
"2012" = 4161
|
|
537
|
+
"2013" = 4115
|
|
538
|
+
"2014" = 4138
|
|
539
|
+
"2015" = 3915
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
scene "Cash crops replaced vegetables" {
|
|
544
|
+
title = "Cash crops replaced vegetables in Bulgaria"
|
|
545
|
+
description = "Production of Bulgarian farms, million euros"
|
|
546
|
+
type = area-stacked
|
|
547
|
+
|
|
548
|
+
data {
|
|
549
|
+
series = "Vegetables","Cash crops","Other production"
|
|
550
|
+
"2000" = 464,615,1854
|
|
551
|
+
"2001" = 458,777,2005
|
|
552
|
+
"2002" = 577,850,1624
|
|
553
|
+
"2003" = 539,818,1459
|
|
554
|
+
"2004" = 483,1103,1463
|
|
555
|
+
"2005" = 492,994,1525
|
|
556
|
+
"2006" = 510,1083,1518
|
|
557
|
+
"2007" = 436,936,1666
|
|
558
|
+
"2008" = 541,2045,1563
|
|
559
|
+
"2009" = 243,1553,1641
|
|
560
|
+
"2010" = 184,2173,1128
|
|
561
|
+
"2011" = 120,2853,1065
|
|
562
|
+
"2012" = 117,2900,1144
|
|
563
|
+
"2013" = 139,2802,1174
|
|
564
|
+
"2014" = 143,3082,914
|
|
565
|
+
"2015" = 144,2986,785
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
highlight "Cash crops"
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
scene "Vegetables collapsed" {
|
|
572
|
+
title = "Vegetable production fell by a factor of four"
|
|
573
|
+
description = "A traditional Bulgarian cultivation shrank as subsidies favoured large fields"
|
|
574
|
+
|
|
575
|
+
highlight "Vegetables"
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
scene "Every vegetable declined" {
|
|
579
|
+
title = "Bulgarian vegetable production collapsed across the board"
|
|
580
|
+
description = "Production volume indexed to 2001 = 100"
|
|
581
|
+
type = line-multi
|
|
582
|
+
lineSymbols = false
|
|
583
|
+
|
|
584
|
+
data {
|
|
585
|
+
series = "Cabbages","Tomatoes","Watermelons","Carrots","Onions","Garlic","Strawberries"
|
|
586
|
+
"2001" = 100,100,100,100,100,100,100
|
|
587
|
+
"2002" = 79,90,124,64,106,95,100
|
|
588
|
+
"2003" = 100,157,177,142,118,98,72
|
|
589
|
+
"2004" = 84,87,83,245,124,138,74
|
|
590
|
+
"2005" = 50,46,62,30,40,93,42
|
|
591
|
+
"2006" = 52,78,113,95,56,80,56
|
|
592
|
+
"2007" = 36,49,64,74,29,30,38
|
|
593
|
+
"2008" = 47,49,66,97,44,29,55
|
|
594
|
+
"2009" = 28,38,74,105,23,39,55
|
|
595
|
+
"2010" = 57,42,51,76,53,57,37
|
|
596
|
+
"2011" = 32,38,56,86,47,43,45
|
|
597
|
+
"2012" = 34,34,46,69,29,43,31
|
|
598
|
+
"2013" = 33,43,53,39,36,40,24
|
|
599
|
+
"2014" = 31,44,28,69,37,8,27
|
|
600
|
+
"2015" = 31,45,50,57,25,18,32
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
scene "Jobs disappeared" {
|
|
605
|
+
title = "Seasonal farm workers vanished while salaried jobs held steady"
|
|
606
|
+
description = "EU agricultural employment, thousands of full-time equivalents"
|
|
607
|
+
type = line-multi
|
|
608
|
+
lineSymbols = false
|
|
609
|
+
|
|
610
|
+
data {
|
|
611
|
+
series = "Salaried workers","Non-salaried workers"
|
|
612
|
+
"2000" = 2678,12194
|
|
613
|
+
"2001" = 2598,11586
|
|
614
|
+
"2002" = 2658,10795
|
|
615
|
+
"2003" = 2563,10609
|
|
616
|
+
"2004" = 2560,9999
|
|
617
|
+
"2005" = 2501,10047
|
|
618
|
+
"2006" = 2499,9782
|
|
619
|
+
"2007" = 2437,9231
|
|
620
|
+
"2008" = 2416,8971
|
|
621
|
+
"2009" = 2348,8672
|
|
622
|
+
"2010" = 2335,7808
|
|
623
|
+
"2011" = 2322,7551
|
|
624
|
+
"2012" = 2325,7501
|
|
625
|
+
"2013" = 2297,7425
|
|
626
|
+
"2014" = 2366,7183
|
|
627
|
+
"2015" = 2413,6928
|
|
628
|
+
"2016" = 2457,6741
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
highlight "Non-salaried workers"
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
`,qre=`chart bar-horizontal {
|
|
635
|
+
title = "China emits more CO₂ than the US and India combined"
|
|
636
|
+
description = "Annual emissions in billion tonnes, 2023"
|
|
637
|
+
source = "Global Carbon Project"
|
|
638
|
+
sourceUrl = "https://globalcarbonproject.org"
|
|
639
|
+
byline = "Pierre Romera"
|
|
640
|
+
horizontalLabelPosition = off
|
|
641
|
+
horizontalGridStyle = none
|
|
642
|
+
valueLabels = true
|
|
643
|
+
|
|
644
|
+
data {
|
|
645
|
+
"China" = 11.9
|
|
646
|
+
"United States" = 4.78
|
|
647
|
+
"India" = 2.88
|
|
648
|
+
"Russia" = 1.78
|
|
649
|
+
"Japan" = 1.02
|
|
650
|
+
"Germany" = 0.64
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
scene "China spotlight" {
|
|
654
|
+
title = "China emits more than the US and India combined"
|
|
655
|
+
|
|
656
|
+
highlight "China"
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
scene "India rising" {
|
|
660
|
+
title = "India surpassed the EU in 2023"
|
|
661
|
+
|
|
662
|
+
highlight "India"
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
scene "Japan declining" {
|
|
666
|
+
title = "Japan's emissions fell 20% from their peak"
|
|
667
|
+
|
|
668
|
+
highlight "Japan"
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
`,Yre=`chart bar-split {
|
|
672
|
+
title = "CDU/CSU led German polls at 29 % ahead of the 2021 election"
|
|
673
|
+
description = "How Germany would vote in the September 2021 federal election, according to polling in the previous June"
|
|
674
|
+
source = "FG Wahlen"
|
|
675
|
+
sourceUrl = "https://www.forschungsgruppe.de"
|
|
676
|
+
note = "Margin of error at 10%: +/- 2 percentage points; at 40%: +/- 3 percentage points"
|
|
677
|
+
|
|
678
|
+
data {
|
|
679
|
+
series = "Poll","High","Low"
|
|
680
|
+
"CDU/CSU" = 29,32,27
|
|
681
|
+
"Greens" = 22,25,20
|
|
682
|
+
"SPD" = 14,16,12
|
|
683
|
+
"AfD" = 10,12,8
|
|
684
|
+
"FDP" = 10,12,8
|
|
685
|
+
"Left" = 7,9,5
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
`,jre=`chart bar-grouped {
|
|
689
|
+
title = "Asia Pacific holds more renewable capacity than all other regions combined"
|
|
690
|
+
description = "Installed capacity in gigawatts (GW)"
|
|
691
|
+
source = "IRENA"
|
|
692
|
+
sourceUrl = "https://www.irena.org"
|
|
693
|
+
|
|
694
|
+
data {
|
|
695
|
+
series = "Solar","Wind","Hydro"
|
|
696
|
+
"Asia Pacific" = 680,540,840
|
|
697
|
+
"Europe" = 250,300,200
|
|
698
|
+
"North America" = 200,180,190
|
|
699
|
+
"Latin America" = 30,50,200
|
|
700
|
+
"Africa" = 15,10,40
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
`;function uk(t,e){const n=t.properties.find(o=>o.key===e);return n?String(n.value):""}function Kre(t){if(!t.data)return"";const e=t.data.entries,n=e.find(i=>i.key==="series"&&!i.quotedKey);if(n){const s=["category",...String(n.value).split(",")].join(" "),a=e.filter(l=>!(l.key==="series"&&!l.quotedKey)).map(l=>{const c=String(l.value).split(",");return[l.key,...c].join(" ")});return[s,...a].join(`
|
|
704
|
+
`)}const o=["label","value"].join(" "),r=e.map(i=>[i.key,String(i.value)].join(" "));return[o,...r].join(`
|
|
705
|
+
`)}function Xre(t){if(!t.data)return"";const e=t.data.entries,n=e.find(o=>o.key==="series"&&!o.quotedKey);if(n){const o=`series = "${String(n.value)}"`,r=e.filter(i=>!(i.key==="series"&&!i.quotedKey)).map(i=>`"${i.key}" = "${String(i.value)}"`);return[o,...r].join(`
|
|
706
|
+
`)}return e.map(o=>`"${o.key}" = ${String(o.value)}`).join(`
|
|
707
|
+
`)}function qn(t,e){const n=Mg(e);return{id:t,title:uk(n,"title"),description:uk(n,"description"),chartType:n.chartType,tsvData:Kre(n),serializedData:Xre(n),dsl:e}}const dk=[qn("letter-frequency",Mre),qn("co2-emissions",Bre),qn("coffee-production",Fre),qn("spoken-languages",Lre),qn("quarterly-revenue",Pre),qn("medal-count",Dre),qn("temperature-anomaly",Ere),qn("bitcoin-price",Ire),qn("unemployment-rates",Nre),qn("browser-market",Vre),qn("world-population",Rre),qn("stock-price-area",zre),qn("energy-mix-stacked-area",Hre),qn("quarterly-stacked-columns",Wre),qn("population-stacked-bar",Ure),qn("election-polls",Yre),qn("renewable-capacity",jre),qn("farm-compass",Gre),qn("co2-emissions-story",qre)],fk=new Set;function Zre(t,e,n){let o=e;for(const r of t)r.transformType==="sort"?o=mi.Total:fk.has(r.transformType)||(fk.add(r.transformType),console.warn(`[blueprint-chart] Unknown transform "${r.transformType}" in ${n}; ignored.`));return o}function Qre(t){const e=i=>{const s=t.get(i);return s==null?void 0:String(s)||void 0},n=t.get("transparentBackground"),o={title:e("title"),description:e("description"),source:e("source"),sourceUrl:e("sourceUrl"),byline:e("byline"),note:e("note"),padding:e("padding"),transparentBackground:n===!0||n==="true"||void 0};return Object.values(o).some(i=>i!==void 0)?o:void 0}function Jre(t){const e=Kr(t.properties),n=t.data?O0(t.data):"",o=ks(n),r=e.get("sort"),i=r==null?void 0:String(r),s=i===en.Ascending||i===en.Descending?i:void 0,a=e.get("theme"),l=e.get("sortMode");let c;return(l===mi.Total||l===mi.WithinGroups||l===mi.None)&&(c=l),c=Zre(t.transforms,c,"chart"),{chartType:t.chartType,data:o,properties:t.properties,frame:Qre(e),colorizes:M0(t.colorizes),highlights:B0(t.highlights),areaFills:L0(t.areaFills),annotations:P0(t.annotations),seriesOverrides:D0(t.series),scenes:t.scenes,sort:s,sortMode:c,theme:a==null?void 0:String(a)||void 0}}const hk=new Set;function eie(t,e,n){let o=e;for(const r of t)r.transformType==="sort"?o=mi.Total:hk.has(r.transformType)||(hk.add(r.transformType),console.warn(`[blueprint-chart] Unknown transform "${r.transformType}" in ${n}; ignored.`));return o}function tie(){return{properties:new Map,chartTypeOptions:{},colorizes:[],highlights:[],areaFills:[],annotations:[],seriesOverrides:[],hiddenAnnotationIds:new Set,transforms:[]}}function nie(t,e,n){const o=tie();for(let r=0;r<=e;r++){const i=t[r],s=Kr(i.properties),a=s.get("type");a&&(o.chartType=a);const l=o.chartType??n;i.data&&(o.data=i.data);const c=Bg(l,i.properties);if(o.chartTypeOptions={...o.chartTypeOptions,...c},i.colorizes.length>0?o.colorizes=i.colorizes:i.data&&(o.colorizes=[]),r===e&&(o.highlights=i.highlights),i.areaFills.length>0&&(o.areaFills=i.areaFills),i.annotations.length>0){const u=[...o.annotations];for(const d of i.annotations){const f=Kr(d.properties).get("id");if(f!=null){const h=u.findIndex(m=>Kr(m.properties).get("id")===f);if(h>=0){u[h]=d;continue}}u.push(d)}o.annotations=u}for(const u of i.annotationVisibility)u.action===VA.Hide?o.hiddenAnnotationIds.add(u.id):o.hiddenAnnotationIds.delete(u.id);i.series.length>0&&(o.seriesOverrides=i.series),i.transforms.length>0&&(o.transforms=[...o.transforms,...i.transforms]);for(const[u,d]of s)o.properties.set(u,d)}return o}function oie(t,e){const n=t.options??(t.properties?T0(t.chartType,Bg(t.chartType,t.properties)):{}),o={chartType:t.chartType,data:t.data,options:n,frame:t.frame,colorizes:t.colorizes??[],highlights:t.highlights??[],areaFills:t.areaFills??[],annotations:t.annotations??[],seriesOverrides:t.seriesOverrides??[],sort:t.sort,sortMode:t.sortMode,theme:t.theme};if(e==null||!t.scenes||e<0||e>=t.scenes.length)return o;const r=nie(t.scenes,e,t.chartType),i=r.chartType??t.chartType,s=r.data?ks(O0(r.data)):o.data,a=Object.keys(r.chartTypeOptions).length>0?T0(i,{...n,...r.chartTypeOptions}):n,l=r.colorizes.length>0?M0(r.colorizes):r.data?[]:o.colorizes,c=e!=null?B0(r.highlights):o.highlights,u=r.areaFills.length>0?L0(r.areaFills):o.areaFills,d=r.annotations.length>0?P0(r.annotations):[],f=[...o.annotations,...d],h=r.hiddenAnnotationIds.size>0?f.filter(x=>!x.id||!r.hiddenAnnotationIds.has(x.id)):f,m=r.seriesOverrides.length>0?D0(r.seriesOverrides):o.seriesOverrides,b=eie(r.transforms,o.sortMode,`scene ${e}`),g=["title","description","source","sourceUrl","byline","note"],v={};for(const x of g){const _=r.properties.get(x);typeof _=="string"&&(v[x]=_)}const y=Object.keys(v).length>0?{...o.frame,...v}:o.frame;return{...o,chartType:i,data:s,options:a,frame:y,colorizes:l,highlights:c,areaFills:u,annotations:h,seriesOverrides:m,sortMode:b}}const Ab=new WeakMap;function rie(t){const e=Ab.get(t);if(!(!e||e.size===0)){for(const n of e)t.style[n]="";e.clear()}}function Dc(t,e){let n=Ab.get(t);n||(n=new Set,Ab.set(t,n)),n.add(e)}function iie(t,e,n){if(rie(t),n.ignoreLayout||!e)return{constrained:!1};const o=Kr(e),r=o.get("heightMode"),i=o.get("aspectRatio"),s=o.get("fixedHeight");let a=!1;if(r==="aspect-ratio"&&i){const l=String(i).split(":").map(Number);l.length===2&&l[0]>0&&l[1]>0&&(t.style.aspectRatio=`${l[0]} / ${l[1]}`,t.style.height="auto",Dc(t,"aspectRatio"),Dc(t,"height"),a=!0)}else r==="fixed"&&s&&(t.style.height=`${s}px`,Dc(t,"height"),a=!0);return a&&(t.style.display="flex",t.style.flexDirection="column",t.style.overflow="hidden",Dc(t,"display"),Dc(t,"flexDirection"),Dc(t,"overflow")),{constrained:a}}const sx=new WeakMap;function ET(t){t.querySelectorAll("[data-bc-fade-overlay]").forEach(e=>{typeof e.getAnimations=="function"&&e.getAnimations().forEach(n=>n.cancel()),e.remove()})}function sie(t,e,n){if(!n)return null;const o=sx.get(t);return!o||o===e?null:(ET(t),Er(t))}function aie(t,e,n){if(sx.set(t,e),n){const o=t.querySelector(".bc-frame .bc-frame-body");o&&Dr(o),Ir(t,n)}}function pk(t){sx.delete(t),ET(t)}function lie(t,e,n){const o=t.querySelector(".bc-frame");if(!o)return;const r=[];o.classList.forEach(i=>{i.startsWith("bc-theme-")&&r.push(i)});for(const i of r)o.classList.remove(i);e.theme&&o.classList.add(`bc-theme-${e.theme}`),n.constrained&&o.classList.add("bc-frame--constrained")}function ax(t,e,n={}){var h;if(n.transition||(t.replaceChildren(),pk(t)),e.data.labels.length===0){n.transition&&(t.replaceChildren(),pk(t));return}let o=e;if(n.stripColors){const m={...e};if(e.properties&&(m.properties=e.properties.filter(b=>b.key!=="colors"&&b.key!=="colorPalette")),e.options){const{colors:b,colorPalette:g,...v}=e.options;m.options=v}o=m}const r=iie(t,o.properties,n),i=oie(o,n.sceneIndex),s=Voe(i.chartType);if(!s)return;const a=sie(t,i.chartType,!!n.transition);a&&t.replaceChildren();const l=Lr(t),c=BT(i.options,l);let u;if(n.thumbnail)u=null;else{const m=((h=i.frame)==null?void 0:h.padding)??n.padding??"16px";u={...i.frame??{},padding:m}}const d=vc(t);n.transition&&d.beginCommit(),s(t,i.data,{frame:u,sort:i.sort,sortMode:i.sortMode,...c,colorizes:i.colorizes.length>0?i.colorizes:void 0,highlights:i.highlights.length>0?i.highlights:void 0,areaFills:i.areaFills.length>0?i.areaFills:void 0,annotations:i.annotations.length>0?i.annotations:void 0,seriesOverrides:i.seriesOverrides.length>0?i.seriesOverrides:void 0},!!n.transition),n.transition&&d.commit({mode:n.transitionMode});const f=n.theme??i.theme;lie(t,{theme:f},r),aie(t,i.chartType,a)}function mk(t,e,n){const o=document.createElement("div");o.style.cssText="color: #888; font-family: monospace; padding: 0.75rem; white-space: pre-wrap;",o.textContent=`Blueprint Chart: ${e}
|
|
708
|
+
${n}`,t.replaceChildren(o)}function IT(t,e,n){if(!e){n!=null&&n.transition||t.replaceChildren();return}let o;try{o=Mg(e)}catch(r){const i=r instanceof Error?r.message:String(r);mk(t,"could not parse chart",i);return}try{const r=Jre(o);ax(t,r,n)}catch(r){const i=r instanceof Error?r.message:String(r);mk(t,"could not render chart",i)}}const gk="abcdefghijklmnopqrstuvwxyz0123456789";function cie(){let t="";for(let e=0;e<8;e++)t+=gk[Math.floor(Math.random()*gk.length)];return t}const uie=Qn("scenes",()=>{const t=Fe([]),e=Ne(-1),n=Ne(!1);let o=null;const r=S(()=>e.value<0||e.value>=t.value.length?null:t.value[e.value]);function i(){const v=cie();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 Sn(){const t=uie(),{scenes:e,activeIndex:n,playing:o,activeScene:r}=Tt(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 E0(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)=>E0(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=>E0(t[r],e[r]))}return!1}function NT(t){return!(t===void 0||Array.isArray(t)&&t.length===0)}function vk(t,e,n,o){for(let r=o-1;r>=0;r--){const i=n[r];if(i&&e in i&&NT(i[e]))return i[e]}return t}function bk(t,e,n,o){for(let r=o-1;r>=0;r--){const i=n[r];if(i!=null&&i.properties&&e in i.properties)return String(i.properties[e])}return t}const Af={sizing:"max-width",fixedWidth:600,maxWidth:660,heightMode:"auto",fixedHeight:400,aspectRatio:"16:9",padding:16,transparentBackground:!1,playerType:"buttons",playerPosition:"left"},yk={chartType:Ve.BarVertical,title:"",description:"",byline:"",source:"",sourceUrl:"",note:"",sort:en.None,sortMode:"none",data:"",selectedColumn:"",colorizes:[],highlights:[],areaFills:[],annotations:[],seriesOverrides:[],layout:{...Af}};function wl(t,e){return S({get(){const{activeScene:n,activeIndex:o,scenes:r}=Sn(),i=n.value;return i&&e in i&&NT(i[e])?i[e]:o.value>=0?vk(t.value,e,r.value,o.value):t.value},set(n){const{activeIndex:o,activeScene:r,update:i,scenes:s}=Sn();if(o.value>=0&&r.value){const a=vk(t.value,e,s.value,o.value);if(E0(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 xa(t,e){return S({get(){const{activeScene:n,activeIndex:o,scenes:r}=Sn(),i=n.value;return i!=null&&i.properties&&e in i.properties?String(i.properties[e]):o.value>=0?bk(t.value,e,r.value,o.value):t.value},set(n){const{activeIndex:o,activeScene:r,update:i,scenes:s}=Sn();if(o.value>=0&&r.value){const a=bk(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 die=Qn("chartConfig",()=>{const t=po({...yk}),e=mm(t),n=wl(e.chartType,"chartType"),o=wl(e.data,"data"),r=wl(e.colorizes,"colorizes"),i=wl(e.highlights,"highlights"),s=wl(e.areaFills,"areaFills"),a=wl(e.annotations,"annotations"),l=wl(e.seriesOverrides,"seriesOverrides"),c=xa(e.title,"title"),u=xa(e.description,"description"),d=xa(e.byline,"byline"),f=xa(e.source,"source"),h=xa(e.sourceUrl,"sourceUrl"),m=xa(e.note,"note"),b=xa(e.sort,"sort"),g=xa(e.sortMode,"sortMode");function v(){Object.assign(t,{...yk,colorizes:[],highlights:[],areaFills:[],annotations:[],seriesOverrides:[],layout:{...Af}})}function y(x){Object.assign(t,{...x,layout:{...Af,...x.layout}})}return{chartType:n,data:o,colorizes:r,highlights:i,areaFills:s,annotations:a,seriesOverrides:l,title:c,description:u,byline:d,source:f,sourceUrl:h,note:m,sort:b,sortMode:g,layout:e.layout,selectedColumn:e.selectedColumn,_base:Oe(e),reset:v,hydrate:y}});function dn(){const t=die(),e=Tt(t);return{chartType:e.chartType,data:e.data,colorizes:e.colorizes,highlights:e.highlights,areaFills:e.areaFills,annotations:e.annotations,seriesOverrides:e.seriesOverrides,title:e.title,description:e.description,byline:e.byline,source:e.source,sourceUrl:e.sourceUrl,note:e.note,sort:e.sort,sortMode:e.sortMode,layout:e.layout,selectedColumn:e.selectedColumn,_base:t._base,reset:t.reset,hydrate:t.hydrate}}function fie(t){const e=t.split(`
|
|
709
|
+
`)[0]??"",n=(e.match(/\t/g)??[]).length,o=(e.match(/,/g)??[]).length;return n>=o?" ":","}function Fh(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 hie=[/^\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 pie(t){if(!t)return!1;for(const e of hie)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 RT(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 mie(t){if(!t)return!1;const e=RT(t).replace(/[,%$€£¥₹]/g,"").trim();return e.length>0&&!Number.isNaN(Number(e))}function $b(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(pie)?"date":r.every(mie)?"number":"string"})}function FT(t){var s;const e=t.split(`
|
|
710
|
+
`).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=$b(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=$b(o,r);return{columns:o,rows:r,columnTypes:i}}function xk(t,e,n=" "){const o=s=>n===" "?s:s.includes(n)||s.includes('"')||s.includes(`
|
|
711
|
+
`)?`"${s.replace(/"/g,'""')}"`:s,r=t.map(o).join(n),i=e.map(s=>s.map(o).join(n));return[r,...i].join(`
|
|
712
|
+
`)}function Tb(t,e){const n=e??{},o=n.trimWhitespace!==!1,r=t.split(`
|
|
713
|
+
`).filter(u=>u.trim().length>0);if(r.length===0)return{columns:[],rows:[],columnTypes:[]};const i=n.delimiter&&n.delimiter!=="auto"?n.delimiter:fie(t),s=n.firstRowIsHeader!==!1;let a,l;s?(a=Fh(r[0],i),l=r.slice(1).map(u=>Fh(u,i))):(a=Fh(r[0],i).map((d,f)=>`Column ${f+1}`),l=r.map(d=>Fh(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(RT));const c=$b(a,l);return{columns:a,rows:l,columnTypes:c}}var tt=(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))(tt||{}),wo=(t=>(t.Equals="equals",t.NotEquals="not-equals",t.Contains="contains",t.GreaterThan="greater-than",t.LessThan="less-than",t))(wo||{}),Nt=(t=>(t.Type="type",t.String="string",t.Numeric="numeric",t.Date="date",t))(Nt||{});const Ro=["string","number","date"],kp=[{id:"to-number",label:"To Number",description:"Strip non-numeric characters and convert to number",category:Nt.Type,accepts:Ro,outputType:"number"},{id:"to-string",label:"To String",description:"Keep value as plain text",category:Nt.Type,accepts:Ro,outputType:"string"},{id:"to-date",label:"To Date",description:"Parse text into an ISO date",category:Nt.Type,accepts:Ro,outputType:"date"},{id:"to-boolean",label:"To Boolean",description:"Map yes/no, true/false, 1/0 to boolean",category:Nt.Type,accepts:Ro,outputType:"string"},{id:"parse-json",label:"Parse JSON",description:"Parse JSON string and optionally extract a key",category:Nt.Type,accepts:["string"],outputType:"string",params:["key"]},{id:"trim",label:"Trim",description:"Remove leading and trailing whitespace",category:Nt.String,accepts:Ro,outputType:"string"},{id:"lowercase",label:"Lowercase",description:"Convert all characters to lowercase",category:Nt.String,accepts:Ro,outputType:"string"},{id:"uppercase",label:"Uppercase",description:"Convert all characters to uppercase",category:Nt.String,accepts:Ro,outputType:"string"},{id:"title-case",label:"Title Case",description:"Capitalize the first letter of each word",category:Nt.String,accepts:Ro,outputType:"string"},{id:"slugify",label:"Slugify",description:"Lowercase and replace non-alphanumeric with hyphens",category:Nt.String,accepts:Ro,outputType:"string"},{id:"regex-replace",label:"Regex Replace",description:"Find and replace using a regular expression",category:Nt.String,accepts:Ro,outputType:"string",params:["pattern","replacement"]},{id:"extract",label:"Extract Substring",description:"Extract a portion of text by character position",category:Nt.String,accepts:Ro,outputType:"string",params:["start","end"]},{id:"pad-start",label:"Pad Start",description:"Pad the beginning to a fixed length",category:Nt.String,accepts:Ro,outputType:"string",params:["length","char"]},{id:"pad-end",label:"Pad End",description:"Pad the end to a fixed length",category:Nt.String,accepts:Ro,outputType:"string",params:["length","char"]},{id:"remove-diacritics",label:"Remove Diacritics",description:"Strip accents and diacritical marks",category:Nt.String,accepts:Ro,outputType:"string"},{id:"split",label:"Split into Columns",description:"Split values by a separator into new columns",category:Nt.String,accepts:Ro,outputType:"string",params:["separator","limit"]},{id:"round",label:"Round",description:"Round to a number of decimal places",category:Nt.Numeric,accepts:["number"],outputType:"number",params:["decimals"]},{id:"floor",label:"Floor",description:"Round down to the nearest integer",category:Nt.Numeric,accepts:["number"],outputType:"number"},{id:"ceil",label:"Ceiling",description:"Round up to the nearest integer",category:Nt.Numeric,accepts:["number"],outputType:"number"},{id:"abs",label:"Absolute Value",description:"Remove the sign (make positive)",category:Nt.Numeric,accepts:["number"],outputType:"number"},{id:"clamp",label:"Clamp",description:"Constrain values between a min and max",category:Nt.Numeric,accepts:["number"],outputType:"number",params:["min","max"]},{id:"log",label:"Logarithm",description:"Natural log — compress wide-range values for charting",category:Nt.Numeric,accepts:["number"],outputType:"number"},{id:"exp",label:"Exponential",description:"Raise e to the power of each value",category:Nt.Numeric,accepts:["number"],outputType:"number"},{id:"normalize",label:"Normalize (0–1)",description:"Scale values to 0–1 range for cross-series comparison",category:Nt.Numeric,accepts:["number"],outputType:"number"},{id:"standardize",label:"Standardize (z-score)",description:"Center around mean, scale by std deviation",category:Nt.Numeric,accepts:["number"],outputType:"number"},{id:"bin",label:"Bin/Bucket",description:"Group values into fixed-size buckets",category:Nt.Numeric,accepts:["number"],outputType:"number",params:["size"]},{id:"extract-year",label:"Extract Year",description:"Get the four-digit year as a number",category:Nt.Date,accepts:["date"],outputType:"number"},{id:"extract-month",label:"Extract Month",description:"Get the month (1–12) as a number",category:Nt.Date,accepts:["date"],outputType:"number"},{id:"extract-day",label:"Extract Day",description:"Get the day of the month as a number",category:Nt.Date,accepts:["date"],outputType:"number"},{id:"extract-weekday",label:"Extract Weekday",description:"Get the day name (Monday, Tuesday, …)",category:Nt.Date,accepts:["date"],outputType:"string"},{id:"extract-hour",label:"Extract Hour",description:"Get the hour (0–23) as a number",category:Nt.Date,accepts:["date"],outputType:"number"},{id:"shift-date",label:"Shift Date",description:"Add or subtract days, months, or years",category:Nt.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:Nt.Date,accepts:["date"],outputType:"date",params:["period"]},{id:"date-diff",label:"Duration Since",description:"Days between each date and a reference date",category:Nt.Date,accepts:["date"],outputType:"number",params:["reference"]}],lx=new Map(kp.map(t=>[t.id,t]));function VT(t,e){const n=lx.get(t);return n?n.accepts.includes(e):!1}function gie(t){var e;return((e=lx.get(t))==null?void 0:e.outputType)??"string"}function wa(t,e){const n=parseFloat(t);if(Number.isNaN(n))return t;const o=e(n);return Number.isNaN(o)?t:String(o)}function Ds(t,e){const n=new Date(t);return Number.isNaN(n.getTime())?t:e(n)}function vie(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 Ds(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 bie(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 yie(t,e,n){switch(e){case"round":{const r=10**(Number(n.decimals)||0);return wa(t,i=>Math.round(i*r)/r)}case"floor":return wa(t,Math.floor);case"ceil":return wa(t,Math.ceil);case"abs":return wa(t,Math.abs);case"clamp":{const o=n.min?Number(n.min):-1/0,r=n.max?Number(n.max):1/0;return wa(t,i=>Math.min(Math.max(i,o),r))}case"log":return wa(t,o=>o>0?Math.log(o):NaN);case"exp":return wa(t,Math.exp);case"bin":{const o=Number(n.size)||1;return wa(t,r=>Math.floor(r/o)*o)}default:return t}}function xie(t,e,n){switch(e){case"extract-year":return Ds(t,o=>String(o.getFullYear()));case"extract-month":return Ds(t,o=>String(o.getMonth()+1));case"extract-day":return Ds(t,o=>String(o.getDate()));case"extract-weekday":return Ds(t,o=>o.toLocaleDateString("en",{weekday:"long"}));case"extract-hour":return Ds(t,o=>String(o.getHours()));case"shift-date":return Ds(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 Ds(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:Ds(t,r=>String(Math.round((r.getTime()-o.getTime())/(1e3*60*60*24))))}default:return t}}function wie(t,e,n){return e.startsWith("to-")||e==="parse-json"?vie(t,e,n):new Set(["round","floor","ceil","abs","clamp","log","exp","bin"]).has(e)?yie(t,e,n):e.startsWith("extract-")||e.startsWith("shift-")||e.startsWith("truncate-")||e==="date-diff"?xie(t,e,n):bie(t,e,n)}const _ie="";function kie(t,e){const n=t.rows.map(o=>{const r=[...o];return r[e]=_ie,r});return{columns:[...t.columns],rows:n,columnTypes:[...t.columnTypes]}}function Sie(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 Cie(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 Aie(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(!VT(o,r))return kie(t,n);if(o==="split")return Sie(t,n,e);if(o==="normalize"||o==="standardize")return Cie(t,n,o);const i=t.rows.map(a=>[...a]);for(const a of i)a[n]=wie(a[n],o,e);const s=[...t.columnTypes];return s[n]=gie(o),{columns:[...t.columns],rows:i,columnTypes:s}}function $f(t){return Number(t.replace(/[,%$€£¥₹]/g,"").trim())||0}function $ie(t,e,n){if(n==="number")return $f(t)-$f(e);if(n==="date"){const o=Date.parse(t)||0,r=Date.parse(e)||0;return o-r}return t.localeCompare(e)}function cx(t){return t.columns?t.columns.split(",").map(e=>e.trim()).filter(Boolean):t.column?[t.column]:[]}function Tie(t,e){const n=cx(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===en.Descending?-1:1,i=e.operation;if(i&&o.length>1){const a=[...t.rows].sort((l,c)=>{const u=o.map(m=>$f(l[m]??"")),d=o.map(m=>$f(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=$ie(a[c]??"",l[c]??"",u);if(d!==0)return r*d}return 0});return{...t,rows:s}}function Oie(t,e,n){if(!n&&e!==wo.Equals&&e!==wo.NotEquals)return!0;switch(e){case wo.Equals:return t===n;case wo.NotEquals:return t!==n;case wo.Contains:return t.toLowerCase().includes(n.toLowerCase());case wo.GreaterThan:{const o=Number(t.replace(/[,%$€£¥₹]/g,"").trim()),r=Number(n);return!Number.isNaN(o)&&!Number.isNaN(r)&&o>r}case wo.LessThan:{const o=Number(t.replace(/[,%$€£¥₹]/g,"").trim()),r=Number(n);return!Number.isNaN(o)&&!Number.isNaN(r)&&o<r}default:return!0}}function Mie(t,e){const n=t.columns.indexOf(e.column);if(n<0||!e.column)return t;const o=t.rows.filter(r=>Oie(r[n]??"",e.condition??wo.Equals,e.value??""));return{...t,rows:o}}function Bie(t,e){const n=cx(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 Lie(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 Pie(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 zT={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 Die(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"&&!zT[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 Eie(t,e,n){if(t==="count")return String(e.length);const o=e.map(r=>$f(r[n]??""));return String(zT[t](o))}function Iie(t,e){const n=cx({columns:e.groupColumns}).map(i=>t.columns.indexOf(i)).filter(i=>i>=0);if(n.length===0||!e.aggregates)return t;const o=Die(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=>Eie(a.fn,s,a.colIndex))])}}const Nie=Qn("dataTransforms",()=>{const t=Fe([]);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 tt.Sort:v=Tie(v,y.config);break;case tt.Filter:v=Mie(v,y.config);break;case tt.HideColumns:v=Bie(v,y.config);break;case tt.Transpose:v=Lie(v);break;case tt.Parse:v=Aie(v,y.config);break;case tt.Rename:v=Pie(v,y.config);break;case tt.GroupBy:v=Iie(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===tt.Parse&&g.column&&g.operation){const v=m.indexOf(g.column);if(v>=0&&!VT(g.operation,b[v])){const y=lx.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===tt.Rename?g.column?g.newName?null:"New name is required":"No column selected":h.type===tt.Filter&&!g.column||h.type===tt.Sort&&!g.column&&!g.columns?"No column selected":h.type===tt.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 Rr(){const t=Nie(),{steps:e}=Tt(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 Ka(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 HT(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 WT(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===tt.Sort)return((n=t.transforms[o].config)==null?void 0:n.direction)??en.Ascending}}function wk(t){return/^-?\d+(\.\d+)?%?$/.test(t)?t:`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Lg(t,e){if(t.length<=2)return e.map(i=>{const s=i[0]??"",a=i[1]??"";return`"${s}" = ${wk(a)}`}).join(`
|
|
714
|
+
`);const o=`series = ${t.slice(1).map(i=>`"${i}"`).join(",")}`,r=e.map(i=>{const s=i[0]??"",a=i.slice(1).map(l=>wk(l??"")).join(",");return`"${s}" = ${a}`});return[o,...r].join(`
|
|
715
|
+
`)}const Rie=Qn("dataTable",()=>{const t=po({columns:[],rows:[],rawInput:"",columnTypes:[]}),e=Ne("delimited"),n=Ne(""),o=Ne(null),{steps:r,applyTransforms:i,applyStepList:s}=Rr(),{activeIndex:a,scenes:l}=Sn(),c=S(()=>{var C;if(a.value>=0){const D=Ka(l.value,a.value);if(D!=null&&D.data)return FT(D.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 D=Ka(l.value,a.value);(C=D==null?void 0:D.transforms)!=null&&C.length&&(_=s(D.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(D=>[...D]),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 Lg(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{...mm(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 er(){const t=Rie(),{columns:e,rows:n,rawInput:o,columnTypes:r,sourceFormat:i,sourceLabel:s,loadedAt:a,displayColumns:l,displayRows:c,displayColumnTypes:u,hasTransforms:d}=Tt(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 Fie=Qn("chartTypeOptions",()=>{const t=po({});function e(d){LT(d),t[d]||(t[d]={})}const{chartType:n,_base:o}=dn(),r=S(()=>{var g,v;const d=t[n.value]??{},f=T0(n.value,d),{activeScene:h,activeIndex:m,scenes:b}=Sn();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 T0(o.chartType.value,d)}),s=S(()=>Cu(n.value)),a=S(()=>s.value.map(d=>d.key));function l(d,f){var g;const{activeIndex:h,activeScene:m,scenes:b}=Sn();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(E0(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}Ke(n,(d,f)=>{var _;e(d);const{activeIndex:h,activeScene:m,scenes:b}=Sn(),g=h.value>=0&&m.value!=null;let v;if(g){let C={...t[f]??{}};for(let D=0;D<=h.value;D++){const M=(_=b.value[D])==null?void 0:_.chartTypeOptions;M&&(C={...C,...M})}v=C}else v=t[f]??{};if(Object.keys(v).length===0)return;const y=Cu(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 D=m.value.chartTypeOptions??{};if(!(C in D)&&!(C in x)){const M=v[C],$=Array.isArray(M)?[...M]:M;b.value[h.value]={...m.value,chartTypeOptions:{...D,[C]:$}}}}else if(!(C in x)){const D=v[C],M=t[d];Array.isArray(D)?M[C]=[...D]:M[C]=D}}},{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 Cn(){const t=Fie(),{currentOptions:e,baseOptions:n,availableOptionKeys:o,optionDefs:r}=Tt(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 UT=[{value:"blueprint",label:"Blueprint",description:"The default Blueprint Chart theme"},{value:"blueprint-framed",label:"Blueprint Framed",description:"Adds borders and a tinted footer"}],ux=Qn("chartTheme",()=>{const t=Ne("blueprint");function e(){t.value="blueprint"}return{chartTheme:t,chartThemeOptions:UT,reset:e}});function GT(){const t=ux(),{chartTheme:e}=Tt(t);return{chartTheme:e,availableThemes:UT,reset:t.reset}}const Vie=new Set([tt.Sort,tt.Filter,tt.HideColumns,tt.Transpose,tt.Parse,tt.GroupBy,tt.Computed,"pivot"]);function Jc(){const t=dn(),e=ux(),n=Tt(e).chartTheme,{store:o,ensureDefaults:r}=Cn(),i=Rr(),s=Sn();function a(l){var c,u;try{const d=Mg(l);s.setActive(-1),t.chartType.value=d.chartType;const f=Kr(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 D=f.get("aspectRatio");D!==void 0&&(m.aspectRatio=String(D));const M=f.get("padding");M!==void 0&&(m.padding=Number(M));const $=f.get("transparentBackground");$!==void 0&&(m.transparentBackground=$===!0||$==="true");const L=f.get("player");L&&["buttons","progress-bar","dot-stepper","minimal-arrows","none"].includes(String(L))&&(m.playerType=String(L));const N=f.get("playerPosition");N&&["left","center","right"].includes(String(N))&&(m.playerPosition=String(N)),t.layout.value={...Af,...m};const O=f.get("sort");O===en.Ascending||O===en.Descending?t.sort.value=O:t.sort.value=en.None;const P=d.data?O0(d.data):"";if(t.data.value=P,P){const B=er(),V=FT(P);B.loadParsed(V),B.rawInput.value=P,B.sourceFormat.value="bpc"}if(o[d.chartType]=Bg(d.chartType,d.properties),r(d.chartType),t.colorizes.value=d.colorizes?M0(d.colorizes):[],t.highlights.value=d.highlights?B0(d.highlights):[],t.areaFills.value=d.areaFills?L0(d.areaFills):[],t.annotations.value=d.annotations?P0(d.annotations):[],t.seriesOverrides.value=d.series?D0(d.series):[],(c=d.transforms)!=null&&c.length){i.reset();for(const B of d.transforms){if(!Vie.has(B.transformType))continue;const V=Kr(B.properties),z={};for(const[G,K]of V)z[G]=String(K);if(B.transformType===tt.Sort&&V.has("direction")){const G=String(V.get("direction"));(G===en.Ascending||G===en.Descending)&&(t.sort.value=G)}i.addStep(B.transformType,z)}}else i.reset();if((u=d.scenes)!=null&&u.length){const B=d.scenes.map(V=>{const z=Ore(V,d.chartType),G={id:Math.random().toString(36).slice(2,10),name:z.name};z.chartType&&(G.chartType=z.chartType),z.data&&(G.data=O0(z.data)),Object.keys(z.chartTypeOptions).length>0&&(G.chartTypeOptions=z.chartTypeOptions),z.colorizes.length>0&&(G.colorizes=M0(z.colorizes)),z.highlights.length>0&&(G.highlights=B0(z.highlights)),z.areaFills.length>0&&(G.areaFills=L0(z.areaFills)),z.annotations.length>0&&(G.annotations=P0(z.annotations)),z.series.length>0&&(G.seriesOverrides=D0(z.series)),z.annotationVisibility.length>0&&(G.annotationVisibility=z.annotationVisibility.map(ne=>({action:ne.action,kind:ne.kind,id:ne.id}))),z.transforms.length>0&&(G.transforms=z.transforms.map((ne,ae)=>({id:String(ae),type:ne.transformType,config:Object.fromEntries(ne.properties.map(he=>[he.key,String(he.value)]))})));const K=Object.fromEntries([...z.properties.entries()].filter(([ne])=>!["type"].includes(ne)));return Object.keys(K).length>0&&(G.properties=K),G});s.hydrate({scenes:B,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 Vh(t){if(typeof t=="number")return String(t);const e=String(t);return e.endsWith("%")?String(parseFloat(e)):`"${e}"`}function pd(t){if(typeof t=="number")return String(t);const e=String(t);return e.endsWith("%")?`"${e}"`:String(parseFloat(e))}function yc(){const e=dn()._base,n=Tt(ux()).chartTheme,{baseOptions:o}=Cn(),{steps:r}=Rr(),{scenes:i}=Sn(),s=er(),a=Ne(!1);function l(){let u=`chart ${e.chartType.value} {
|
|
716
|
+
`;e.title.value&&(u+=` title = "${e.title.value}"
|
|
717
|
+
`),e.description.value&&(u+=` description = "${e.description.value}"
|
|
718
|
+
`),e.byline.value&&(u+=` byline = "${e.byline.value}"
|
|
719
|
+
`),e.source.value&&(u+=` source = "${e.source.value}"
|
|
720
|
+
`),e.sourceUrl.value&&(u+=` sourceUrl = "${e.sourceUrl.value}"
|
|
721
|
+
`),n.value&&n.value!=="blueprint"&&(u+=` theme = "${n.value}"
|
|
722
|
+
`);const d=Cu(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(", ")}"
|
|
723
|
+
`:typeof v=="boolean"?u+=` ${g} = ${v}
|
|
724
|
+
`:typeof v=="string"&&v!==""&&(u+=` ${g} = "${v}"
|
|
725
|
+
`)))}const b=Dt(e.layout.value);if(b.sizing!=="max-width"&&(u+=` sizing = "${b.sizing}"
|
|
726
|
+
`),b.sizing==="fixed"&&b.fixedWidth!==600&&(u+=` fixedWidth = ${b.fixedWidth}
|
|
727
|
+
`),b.sizing==="max-width"&&b.maxWidth!==660&&(u+=` maxWidth = ${pd(b.maxWidth)}
|
|
728
|
+
`),b.heightMode!=="auto"&&(u+=` heightMode = "${b.heightMode}"
|
|
729
|
+
`),b.heightMode==="fixed"&&b.fixedHeight!==400&&(u+=` fixedHeight = ${b.fixedHeight}
|
|
730
|
+
`),b.heightMode==="aspect-ratio"&&b.aspectRatio!=="16:9"&&(u+=` aspectRatio = "${b.aspectRatio}"
|
|
731
|
+
`),b.padding!==16&&(u+=` padding = ${b.padding}
|
|
732
|
+
`),b.transparentBackground&&(u+=` transparentBackground = true
|
|
733
|
+
`),b.playerType&&b.playerType!=="buttons"&&(u+=` player = "${b.playerType}"
|
|
734
|
+
`),b.playerPosition!=="left"&&(u+=` playerPosition = "${b.playerPosition}"
|
|
735
|
+
`),e.data.value){u+=`
|
|
736
|
+
data {
|
|
737
|
+
`;const g=e.data.value.split(`
|
|
738
|
+
`).map(v=>v.trim()).filter(Boolean);u+=g.map(v=>` ${v}`).join(`
|
|
739
|
+
`),u+=`
|
|
740
|
+
}
|
|
741
|
+
`}for(const g of e.colorizes.value)g.target&&(u+=`
|
|
742
|
+
colorize "${g.target}" {
|
|
743
|
+
`,g.color&&(u+=` color = "${g.color}"
|
|
744
|
+
`),g.label&&(u+=` label = "${g.label}"
|
|
745
|
+
`),u+=` }
|
|
746
|
+
`);for(const g of e.highlights.value)g.target&&(u+=`
|
|
747
|
+
highlight "${g.target}"
|
|
748
|
+
`);for(const g of e.areaFills.value)!g.from||!g.to||(u+=`
|
|
749
|
+
area-fill "${g.from}" "${g.to}" {
|
|
750
|
+
`,g.color&&(u+=` color = "${g.color}"
|
|
751
|
+
`),g.negativeColor&&(u+=` negativeColor = "${g.negativeColor}"
|
|
752
|
+
`),g.opacity!==void 0&&(u+=` opacity = ${g.opacity}
|
|
753
|
+
`),g.interpolation&&(u+=` interpolation = "${g.interpolation}"
|
|
754
|
+
`),u+=` }
|
|
755
|
+
`);for(const g of e.annotations.value){const v=g.kind??Ht.Point;if(v===Ht.Point){if(!("target"in g)||!g.target)continue;u+=`
|
|
756
|
+
annotation "${g.target}" {
|
|
757
|
+
`,g.id&&(u+=` id = "${g.id}"
|
|
758
|
+
`),g.text&&(u+=` text = "${g.text}"
|
|
759
|
+
`),g.textColor&&(u+=` textColor = "${g.textColor}"
|
|
760
|
+
`),g.maxWidth!==void 0&&(u+=` maxWidth = ${pd(g.maxWidth)}
|
|
761
|
+
`),g.textOutline!==void 0&&(u+=` textOutline = ${g.textOutline}
|
|
762
|
+
`),g.showLine!==void 0&&(u+=` showLine = ${g.showLine}
|
|
763
|
+
`),g.anchorDirection&&(u+=` anchorDirection = ${g.anchorDirection}
|
|
764
|
+
`),g.textOffsetX!==void 0&&(u+=` textOffsetX = ${g.textOffsetX}
|
|
765
|
+
`),g.textOffsetY!==void 0&&(u+=` textOffsetY = ${g.textOffsetY}
|
|
766
|
+
`),g.lineStyle&&(u+=` lineStyle = ${g.lineStyle}
|
|
767
|
+
`),g.lineWeight!==void 0&&(u+=` lineWeight = ${g.lineWeight}
|
|
768
|
+
`),g.showArrow!==void 0&&(u+=` showArrow = ${g.showArrow}
|
|
769
|
+
`),g.lineTargetDistance!==void 0&&(u+=` lineTargetDistance = ${g.lineTargetDistance}
|
|
770
|
+
`),g.showCircle!==void 0&&(u+=` showCircle = ${g.showCircle}
|
|
771
|
+
`),g.circleSize!==void 0&&(u+=` circleSize = ${g.circleSize}
|
|
772
|
+
`),g.circleStyle&&(u+=` circleStyle = ${g.circleStyle}
|
|
773
|
+
`),g.circleColor&&(u+=` circleColor = "${g.circleColor}"
|
|
774
|
+
`),u+=` }
|
|
775
|
+
`}else if(v===Ht.Range){const y=g;u+=`
|
|
776
|
+
range {
|
|
777
|
+
`,y.id&&(u+=` id = "${y.id}"
|
|
778
|
+
`),y.start!==void 0&&(u+=` start = ${typeof y.start=="string"?`"${y.start}"`:y.start}
|
|
779
|
+
`),y.end!==void 0&&(u+=` end = ${typeof y.end=="string"?`"${y.end}"`:y.end}
|
|
780
|
+
`),y.orientation&&(u+=` orientation = ${y.orientation}
|
|
781
|
+
`),y.startAnchor&&y.startAnchor!=="center"&&(u+=` startAnchor = ${y.startAnchor}
|
|
782
|
+
`),y.endAnchor&&y.endAnchor!=="center"&&(u+=` endAnchor = ${y.endAnchor}
|
|
783
|
+
`),y.bgColor&&(u+=` bgColor = "${y.bgColor}"
|
|
784
|
+
`),y.bgOpacity!==void 0&&(u+=` bgOpacity = ${y.bgOpacity}
|
|
785
|
+
`),y.direction&&(u+=` direction = ${y.direction}
|
|
786
|
+
`),y.text&&(u+=` text = "${y.text}"
|
|
787
|
+
`),y.textColor&&(u+=` textColor = "${y.textColor}"
|
|
788
|
+
`),u+=` }
|
|
789
|
+
`}else if(v===Ht.Free){const y=g;u+=`
|
|
790
|
+
note {
|
|
791
|
+
`,y.id&&(u+=` id = "${y.id}"
|
|
792
|
+
`),y.text&&(u+=` text = "${y.text}"
|
|
793
|
+
`),y.x!==void 0&&(u+=` x = ${Vh(y.x)}
|
|
794
|
+
`),y.y!==void 0&&(u+=` y = ${Vh(y.y)}
|
|
795
|
+
`),y.textColor&&(u+=` textColor = "${y.textColor}"
|
|
796
|
+
`),y.maxWidth!==void 0&&(u+=` maxWidth = ${pd(y.maxWidth)}
|
|
797
|
+
`),y.textOutline!==void 0&&(u+=` textOutline = ${y.textOutline}
|
|
798
|
+
`),u+=` }
|
|
799
|
+
`}}for(const g of r.value){u+=`
|
|
800
|
+
transform ${g.type} {
|
|
801
|
+
`;for(const[v,y]of Object.entries(g.config))y!==void 0&&y!==""&&(u+=` ${v} = "${y}"
|
|
802
|
+
`);u+=` }
|
|
803
|
+
`}if(e.sort.value!==en.None){const g=s.displayColumns.value,v=g.length>2?g.slice(1):g.length>1?[g[1]]:[g[0]??""];u+=`
|
|
804
|
+
transform ${tt.Sort} {
|
|
805
|
+
`,v.length>1?(u+=` columns = "${v.join(",")}"
|
|
806
|
+
`,u+=` operation = sum
|
|
807
|
+
`):u+=` column = "${v[0]}"
|
|
808
|
+
`,u+=` direction = ${e.sort.value}
|
|
809
|
+
`,u+=` }
|
|
810
|
+
`}for(const g of e.seriesOverrides.value)g.name&&(u+=`
|
|
811
|
+
series "${g.name}" {
|
|
812
|
+
`,g.color&&(u+=` color = "${g.color}"
|
|
813
|
+
`),g.lineWidth!==void 0&&(u+=` lineWidth = ${g.lineWidth}
|
|
814
|
+
`),g.dash&&(u+=` dash = "${g.dash}"
|
|
815
|
+
`),g.interpolation&&(u+=` interpolation = "${g.interpolation}"
|
|
816
|
+
`),g.labelMode&&(u+=` labelMode = "${g.labelMode}"
|
|
817
|
+
`),g.labelText&&(u+=` labelText = "${g.labelText}"
|
|
818
|
+
`),g.valueLabels!==void 0&&(u+=` valueLabels = ${g.valueLabels}
|
|
819
|
+
`),g.lineSymbols!==void 0&&(u+=` lineSymbols = ${g.lineSymbols}
|
|
820
|
+
`),g.hidden!==void 0&&(u+=` hidden = ${g.hidden}
|
|
821
|
+
`),g.symbolShape&&(u+=` symbolShape = "${g.symbolShape}"
|
|
822
|
+
`),g.symbolShowOn&&(u+=` symbolShowOn = "${g.symbolShowOn}"
|
|
823
|
+
`),g.symbolStyle&&(u+=` symbolStyle = "${g.symbolStyle}"
|
|
824
|
+
`),g.symbolSize!==void 0&&(u+=` symbolSize = ${g.symbolSize}
|
|
825
|
+
`),g.symbolOpacity!==void 0&&(u+=` symbolOpacity = ${g.symbolOpacity}
|
|
826
|
+
`),u+=` }
|
|
827
|
+
`);for(const g of Dt(i.value)){if(g.name!==null?u+=`
|
|
828
|
+
scene "${g.name}" {
|
|
829
|
+
`:u+=`
|
|
830
|
+
scene {
|
|
831
|
+
`,g.chartType&&(u+=` type = ${g.chartType}
|
|
832
|
+
`),g.properties)for(const[v,y]of Object.entries(g.properties))typeof y=="string"?u+=` ${v} = "${y}"
|
|
833
|
+
`:u+=` ${v} = ${y}
|
|
834
|
+
`;if(g.chartTypeOptions){const v=g.chartType||e.chartType.value,x=Cu(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(", ")}"
|
|
835
|
+
`:typeof C=="boolean"?u+=` ${_} = ${C}
|
|
836
|
+
`:typeof C=="string"&&C!==""&&(u+=` ${_} = "${C}"
|
|
837
|
+
`))}}if(g.data){u+=`
|
|
838
|
+
data {
|
|
839
|
+
`;const v=g.data.split(`
|
|
840
|
+
`).map(y=>y.trim()).filter(Boolean);u+=v.map(y=>` ${y}`).join(`
|
|
841
|
+
`),u+=`
|
|
842
|
+
}
|
|
843
|
+
`}if(g.colorizes)for(const v of g.colorizes)v.target&&(u+=`
|
|
844
|
+
colorize "${v.target}" {
|
|
845
|
+
`,v.color&&(u+=` color = "${v.color}"
|
|
846
|
+
`),v.label&&(u+=` label = "${v.label}"
|
|
847
|
+
`),u+=` }
|
|
848
|
+
`);if(g.highlights)for(const v of g.highlights)v.target&&(u+=`
|
|
849
|
+
highlight "${v.target}"
|
|
850
|
+
`);if(g.areaFills)for(const v of g.areaFills)!v.from||!v.to||(u+=`
|
|
851
|
+
area-fill "${v.from}" "${v.to}" {
|
|
852
|
+
`,v.color&&(u+=` color = "${v.color}"
|
|
853
|
+
`),u+=` }
|
|
854
|
+
`);if(g.annotations)for(const v of g.annotations){const y=v.kind??Ht.Point;if(y===Ht.Point){if(!("target"in v)||!v.target)continue;u+=`
|
|
855
|
+
annotation "${v.target}" {
|
|
856
|
+
`,v.id&&(u+=` id = "${v.id}"
|
|
857
|
+
`),v.text&&(u+=` text = "${v.text}"
|
|
858
|
+
`),v.textColor&&(u+=` textColor = "${v.textColor}"
|
|
859
|
+
`),v.maxWidth!==void 0&&(u+=` maxWidth = ${pd(v.maxWidth)}
|
|
860
|
+
`),v.textOutline!==void 0&&(u+=` textOutline = ${v.textOutline}
|
|
861
|
+
`),v.showLine!==void 0&&(u+=` showLine = ${v.showLine}
|
|
862
|
+
`),v.anchorDirection&&(u+=` anchorDirection = ${v.anchorDirection}
|
|
863
|
+
`),v.textOffsetX!==void 0&&(u+=` textOffsetX = ${v.textOffsetX}
|
|
864
|
+
`),v.textOffsetY!==void 0&&(u+=` textOffsetY = ${v.textOffsetY}
|
|
865
|
+
`),v.lineStyle&&(u+=` lineStyle = ${v.lineStyle}
|
|
866
|
+
`),v.lineWeight!==void 0&&(u+=` lineWeight = ${v.lineWeight}
|
|
867
|
+
`),v.showArrow!==void 0&&(u+=` showArrow = ${v.showArrow}
|
|
868
|
+
`),v.lineTargetDistance!==void 0&&(u+=` lineTargetDistance = ${v.lineTargetDistance}
|
|
869
|
+
`),v.showCircle!==void 0&&(u+=` showCircle = ${v.showCircle}
|
|
870
|
+
`),v.circleSize!==void 0&&(u+=` circleSize = ${v.circleSize}
|
|
871
|
+
`),v.circleStyle&&(u+=` circleStyle = ${v.circleStyle}
|
|
872
|
+
`),v.circleColor&&(u+=` circleColor = "${v.circleColor}"
|
|
873
|
+
`),u+=` }
|
|
874
|
+
`}else if(y===Ht.Range){const x=v;u+=`
|
|
875
|
+
range {
|
|
876
|
+
`,x.id&&(u+=` id = "${x.id}"
|
|
877
|
+
`),x.start!==void 0&&(u+=` start = ${typeof x.start=="string"?`"${x.start}"`:x.start}
|
|
878
|
+
`),x.end!==void 0&&(u+=` end = ${typeof x.end=="string"?`"${x.end}"`:x.end}
|
|
879
|
+
`),x.orientation&&(u+=` orientation = ${x.orientation}
|
|
880
|
+
`),x.startAnchor&&x.startAnchor!=="center"&&(u+=` startAnchor = ${x.startAnchor}
|
|
881
|
+
`),x.endAnchor&&x.endAnchor!=="center"&&(u+=` endAnchor = ${x.endAnchor}
|
|
882
|
+
`),x.bgColor&&(u+=` bgColor = "${x.bgColor}"
|
|
883
|
+
`),x.bgOpacity!==void 0&&(u+=` bgOpacity = ${x.bgOpacity}
|
|
884
|
+
`),x.direction&&(u+=` direction = ${x.direction}
|
|
885
|
+
`),x.text&&(u+=` text = "${x.text}"
|
|
886
|
+
`),x.textColor&&(u+=` textColor = "${x.textColor}"
|
|
887
|
+
`),u+=` }
|
|
888
|
+
`}else if(y===Ht.Free){const x=v;u+=`
|
|
889
|
+
note {
|
|
890
|
+
`,x.id&&(u+=` id = "${x.id}"
|
|
891
|
+
`),x.text&&(u+=` text = "${x.text}"
|
|
892
|
+
`),x.x!==void 0&&(u+=` x = ${Vh(x.x)}
|
|
893
|
+
`),x.y!==void 0&&(u+=` y = ${Vh(x.y)}
|
|
894
|
+
`),x.textColor&&(u+=` textColor = "${x.textColor}"
|
|
895
|
+
`),x.maxWidth!==void 0&&(u+=` maxWidth = ${pd(x.maxWidth)}
|
|
896
|
+
`),x.textOutline!==void 0&&(u+=` textOutline = ${x.textOutline}
|
|
897
|
+
`),u+=` }
|
|
898
|
+
`}}if(g.annotationVisibility)for(const v of g.annotationVisibility)u+=` ${v.action}-${rj[v.kind]} "${v.id}"
|
|
899
|
+
`;if(g.seriesOverrides)for(const v of g.seriesOverrides)v.name&&(u+=`
|
|
900
|
+
series "${v.name}" {
|
|
901
|
+
`,v.color&&(u+=` color = "${v.color}"
|
|
902
|
+
`),u+=` }
|
|
903
|
+
`);if(g.transforms)for(const v of g.transforms){u+=`
|
|
904
|
+
transform ${v.type} {
|
|
905
|
+
`;for(const[y,x]of Object.entries(v.config))x!==void 0&&x!==""&&(u+=` ${y} = "${x}"
|
|
906
|
+
`);u+=` }
|
|
907
|
+
`}u+=` }
|
|
908
|
+
`}return u+=`}
|
|
909
|
+
`,u}const c=Ne("");return vm(()=>{c.value=l()},{flush:"post"}),{dsl:c,compact:a,generateDsl:l}}function or(t){return`data:image/svg+xml;base64,${globalThis.btoa(unescape(encodeURIComponent(t)))}`}function qT(){return document.documentElement.getAttribute("data-bs-theme")??"light"}const YT=t=>`blueprint-chart:${t}:thumbnail:${qT()}`,jT=t=>`blueprint-chart:${t}:preview:${qT()}`;function KT(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 XT(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"),KT(e),e.outerHTML}function zie(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;KT(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(`
|
|
910
|
+
`);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(`
|
|
911
|
+
`)}function dx(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 Hie(t){const e=t.match(/allowDarkMode\s*=\s*(true|false)/);return e?e[1]==="true":!0}const ZT=600,fx=400,QT=[`#__bc_thumb .bc-frame { height:${fx}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(`
|
|
912
|
+
`);function JT(t){return document.documentElement.getAttribute("data-bs-theme")==="dark"&&!Hie(t)}function hx(t){const e=JT(t);return dx("__bc_thumb",ZT,fx,QT,n=>(IT(n,t,{thumbnail:!0}),XT(n)),{forceLightTheme:e})}function px(t,e,n,o,r){return e.labels.length===0?null:dx("__bc_thumb",ZT,fx,QT,i=>(ax(i,{chartType:t,data:e,options:n,sort:o,colorizes:r==null?void 0:r.colorizes,seriesOverrides:r==null?void 0:r.seriesOverrides},{thumbnail:!0}),XT(i)))}const Wie=600,Uie=500,Gie=["#__bc_preview .bc-frame { display:flex; flex-direction:column; }",`#__bc_preview .bc-frame-body { height:${Uie}px; min-height:0; }`].join(`
|
|
913
|
+
`);function mx(t){const e=JT(t);return dx("__bc_preview",Wie,null,Gie,n=>(IT(n,t,{padding:"12px"}),zie(n)),{forceLightTheme:e})}function eu(t){return localStorage.getItem(YT(t))}function Tf(t,e){localStorage.setItem(YT(t),e)}function eO(t){localStorage.removeItem(`blueprint-chart:${t}:thumbnail:light`),localStorage.removeItem(`blueprint-chart:${t}:thumbnail:dark`),localStorage.removeItem(`blueprint-chart:${t}:thumbnail`)}function Sp(t){return localStorage.getItem(jT(t))}function Pg(t,e){localStorage.setItem(jT(t),e)}function gx(t){localStorage.removeItem(`blueprint-chart:${t}:preview:light`),localStorage.removeItem(`blueprint-chart:${t}:preview:dark`),localStorage.removeItem(`blueprint-chart:${t}:preview`)}function tO(t){return t.trimStart().startsWith("{")}function vx(t){if(!tO(t))return hx(t);const e=JSON.parse(t);if(!e.chartConfig)return null;const{chartConfig:n,chartTypeOptions:o}=e,r=ks(n.data),i=[Ve.BarVertical,Ve.BarHorizontal,Ve.Line,Ve.VerticalBar,Ve.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 px(n.chartType,r,s,n.sort)}function nO(t){return tO(t)?vx(t):mx(t)}function qie(){const t=dn(),{currentOptions:e}=Cn(),{sessionId:n}=Pr();if(!n.value||!t.data.value)return;const o=ks(t.data.value),r=[Ve.BarVertical,Ve.BarHorizontal,Ve.Line,Ve.VerticalBar,Ve.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=px(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&&Tf(n.value,i);const{generateDsl:s}=yc(),a=s();if(a){const l=mx(a);l&&Pg(n.value,l)}}function Yie(t,e){let n=null,o=null;try{n=hx(e)}catch{n=null}try{o=mx(e)}catch{o=null}n&&Tf(t,n),o&&Pg(t,o)}const _k="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";function tu(){let t="";for(let e=0;e<11;e++)t+=_k[Math.floor(Math.random()*_k.length)];return t}function ns(t){return`blueprint-chart:${t}`}const jie=new Set(["cloud-index"]);function Pa(t){return`blueprint-chart:${t}:meta`}function Dg(t){try{return JSON.parse(localStorage.getItem(Pa(t))||"{}")}catch{return{}}}function Ob(t){const e=t.match(/title\s*=\s*"([^"]*)"/),n=t.match(/description\s*=\s*"([^"]*)"/),o=t.match(/^chart\s+(\S+)/),r=t.match(/\bscene\s+"/g),i=t.match(/data\s*\{([^}]*)\}/),s=i?i[1].split(`
|
|
914
|
+
`).filter(l=>l.trim()&&l.includes("=")).length:0,a=t.match(/allowDarkMode\s*=\s*(true|false)/);return{title:(e==null?void 0:e[1])??"",description:(n==null?void 0:n[1])??"",chartType:(o==null?void 0:o[1])??"",sceneCount:(r==null?void 0:r.length)??0,rowCount:s,allowDarkMode:a?a[1]==="true":!0}}function kk(t){return t.trimStart().startsWith("{")}const oO=Qn("chartSession",()=>{const t=Ne(""),e=Ne(null),n=Fe(null),o=Fe(""),r=dn(),i=er(),s=Rr(),a=Cn(),l=Sn();function c(){if(!t.value)return;const{generateDsl:M}=yc();localStorage.setItem(ns(t.value),M());const $=new Date().toISOString(),L={savedAt:$,sheetNumber:n.value,sheetId:o.value};i.sourceFormat.value==="delimited"&&i.rawInput.value&&(L.rawInput=i.rawInput.value,L.sourceLabel=i.sourceLabel.value,L.sourceFormat="delimited"),localStorage.setItem(Pa(t.value),JSON.stringify(L)),e.value=$}function u(M){const $=localStorage.getItem(ns(M));if(!$)return!1;try{if(kk($)){const O=JSON.parse($);if(O.chartConfig)return d(M,O)}const{applyDsl:L}=Jc();if(!L($).success)return!1;const N=localStorage.getItem(Pa(M));let T;return N&&(T=JSON.parse(N),T.sourceFormat==="delimited"&&T.rawInput&&(i.rawInput.value=T.rawInput,i.sourceFormat.value="delimited",T.sourceLabel&&(i.sourceLabel.value=T.sourceLabel))),t.value=M,e.value=(T==null?void 0:T.savedAt)??null,n.value=(T==null?void 0:T.sheetNumber)??null,o.value=(T==null?void 0:T.sheetId)??crypto.randomUUID(),!0}catch{return!1}}function d(M,$){try{return r.hydrate($.chartConfig),$.dataTable&&i.hydrate($.dataTable),t.value=M,n.value=null,o.value=crypto.randomUUID(),!0}catch{return!1}}function f(){r.reset(),i.reset(),s.reset(),a.reset(),l.reset(),t.value=""}function h(){f(),e.value=null,n.value=null,o.value=crypto.randomUUID()}function m(){if(n.value!==null)return;const M=Object.keys(localStorage).filter(L=>L.startsWith("blueprint-chart:")&&L.endsWith(":meta"));let $=0;for(const L of M)try{const E=JSON.parse(localStorage.getItem(L)||"{}");if(E.sheetNumber){const N=parseInt(E.sheetNumber,10);Number.isFinite(N)&&N>$&&($=N)}}catch{}n.value=String($+1).padStart(3,"0"),c()}function b(){return t.value=tu(),c(),_(),t.value}function g(){f(),t.value=tu(),n.value=null,o.value=crypto.randomUUID()}function v(M){i.rawInput.value=M.tsvData;const $=Tb(M.tsvData);i.loadParsed($),r.data.value=i.serialize();const{applyDsl:L}=Jc();L(M.dsl)}function y(M){return u(M)}function x(M){if(!M)return null;try{Mg(M)}catch{return null}f();const{applyDsl:$}=Jc();return $(M).success?(t.value=tu(),n.value=null,o.value=crypto.randomUUID(),c(),_(),t.value):(f(),null)}function _(){Ke([r.chartType,r.title,r.description,r.byline,r.note,r.source,r.sourceUrl,r.sort,r.data,r.selectedColumn,r.colorizes,r.highlights,r.areaFills,r.annotations,r.seriesOverrides,r.layout,i.columns,i.rows,i.rawInput,i.columnTypes,s.steps,l.scenes,l.activeIndex,()=>a.store],c,{deep:!0,flush:"post"})}function C(){var L;const M=[],$="blueprint-chart:";for(let E=0;E<localStorage.length;E++){const N=localStorage.key(E);if(!N||!N.startsWith($))continue;const T=N.slice($.length);if(T.includes(":")||jie.has(T))continue;const O=localStorage.getItem(N);if(O)try{if(kk(O)){const z=JSON.parse(O);if(z.chartConfig){M.push({id:T,title:z.chartConfig.title||"",description:z.chartConfig.description||"",chartType:z.chartConfig.chartType||"",savedAt:z.savedAt??null,sceneCount:((L=z.chartConfig.scenes)==null?void 0:L.length)??0,rowCount:z.chartConfig.data?z.chartConfig.data.split(`
|
|
915
|
+
`).filter(G=>G.trim()).length-1:0,allowDarkMode:z.chartConfig.allowDarkMode??!0,sheetNumber:null,sheetId:""});continue}}const P=Ob(O),B=localStorage.getItem(Pa(T)),V=B?JSON.parse(B):null;M.push({id:T,title:P.title,description:P.description,chartType:P.chartType,savedAt:(V==null?void 0:V.savedAt)??null,sceneCount:P.sceneCount,rowCount:P.rowCount,allowDarkMode:P.allowDarkMode,sheetNumber:(V==null?void 0:V.sheetNumber)??null,sheetId:(V==null?void 0:V.sheetId)??""})}catch{}}return M.sort((E,N)=>!E.savedAt&&!N.savedAt?0:E.savedAt?N.savedAt?N.savedAt.localeCompare(E.savedAt):-1:1),M}function D(M){localStorage.removeItem(ns(M)),localStorage.removeItem(Pa(M)),eO(M)}return{sessionId:t,lastSavedAt:e,sheetNumber:n,sheetId:o,save:c,load:u,prepareNew:h,assignSheetNumber:m,createSession:b,newChart:g,loadSample:v,loadChart:y,createFromDsl:x,startAutoSave:_,listSavedCharts:C,deleteChart:D}});function Pr(){const t=oO(),{sessionId:e,lastSavedAt:n,sheetNumber:o,sheetId:r}=Tt(t);return{sessionId:e,lastSavedAt:n,sheetNumber:o,sheetId:r,save:t.save,load:t.load,prepareNew:t.prepareNew,assignSheetNumber:t.assignSheetNumber,createSession:t.createSession,newChart:t.newChart,loadSample:t.loadSample,loadChart:t.loadChart,createFromDsl:t.createFromDsl,startAutoSave:t.startAutoSave,listSavedCharts:t.listSavedCharts,deleteChart:t.deleteChart}}const rO="blueprint-chart:cloud-index";function zh(){try{const t=localStorage.getItem(rO);return new Set(t?JSON.parse(t):[])}catch{return new Set}}function Jv(t){localStorage.setItem(rO,JSON.stringify([...t]))}const iO=Qn("cloudCharts",()=>{async function t(){const f=await zr();if(!f)return[];const{data:h,error:m}=await f.from("charts").select("id, title, chart_type, published, updated_at").order("updated_at",{ascending:!1});return m||!h?[]:h.map(b=>({id:b.id,title:b.title??"",chartType:b.chart_type??"",published:!!b.published,updatedAt:b.updated_at??null}))}async function e(f){const h=await zr();if(!h)return null;const{data:m,error:b}=await h.from("charts").select("dsl, meta, owner").eq("id",f).single();return b||!m?null:{dsl:m.dsl,meta:m.meta??{},owner:m.owner}}async function n(f){const h=await zr();if(!h)return null;const m=new Date().toISOString();if(f.id){const{error:b}=await h.from("charts").update({dsl:f.dsl,meta:f.meta,title:f.title,chart_type:f.chartType,updated_at:m}).eq("id",f.id);return b?null:f.id}for(let b=0;b<5;b++){const g=tu(),{error:v}=await h.from("charts").insert({id:g,dsl:f.dsl,meta:f.meta,title:f.title,chart_type:f.chartType,updated_at:m});if(!v)return g;if(v.code!=="23505")return null}return null}async function o(f){const h=await zr();if(!h)return!1;const{error:m}=await h.from("charts").delete().eq("id",f);return!m}async function r(f,h){const m=await zr();if(!m)return!1;const{data:b,error:g}=await m.from("charts").update({published:h,updated_at:new Date().toISOString()}).eq("id",f).select("id");return!g&&Array.isArray(b)&&b.length>0}async function i(f){const h=await zr();if(!h)return!1;const{data:m,error:b}=await h.from("charts").select("published").eq("id",f).single();return b||!m?!1:!!m.published}async function s(f){const h=await zr();if(!h)return null;const{data:m,error:b}=await h.from("charts").select("dsl").eq("id",f).eq("published",!0).single();return b||!m?null:m.dsl??null}function a(f){const h=zh();h.add(f),Jv(h)}function l(f){return zh().has(f)}function c(f){const h=zh();h.delete(f),Jv(h)}function u(){const f=oO();for(const h of zh())localStorage.getItem(ns(h))!==null&&(f.deleteChart(h),gx(h));Jv(new Set)}async function d(f){const h=await zr();if(!h||!f.id)return null;const{error:m}=await h.from("charts").upsert({id:f.id,dsl:f.dsl,meta:f.meta,title:f.title,chart_type:f.chartType,updated_at:new Date().toISOString()},{onConflict:"id"});return m?null:f.id}return{listCloud:t,loadCloud:e,pushCloud:n,deleteCloud:o,publish:r,isPublished:i,fetchPublished:s,markCloudBacked:a,isCloudBacked:l,unmarkCloudBacked:c,clearLocalSynced:u,syncCloud:d}});function dl(){const t=iO();return{listCloud:t.listCloud,loadCloud:t.loadCloud,pushCloud:t.pushCloud,deleteCloud:t.deleteCloud,publish:t.publish,isPublished:t.isPublished,fetchPublished:t.fetchPublished,markCloudBacked:t.markCloudBacked,isCloudBacked:t.isCloudBacked,unmarkCloudBacked:t.unmarkCloudBacked,clearLocalSynced:t.clearLocalSynced,syncCloud:t.syncCloud}}function Sk(t){return t?{id:t.id,email:t.email??""}:null}function Kie(){return`${window.location.origin}${window.location.pathname}`}const sO=Qn("account",()=>{const t=Ne(null),e=Ne("idle"),n=Ne(null),o=Ne(!1);let r=null;const i=S(()=>t.value!==null);async function s(){return r||(r=(async()=>{var h;const d=await zr();if(!d)return;const{data:f}=await d.auth.getSession();t.value=Sk((h=f.session)==null?void 0:h.user),d.auth.onAuthStateChange((m,b)=>{t.value=Sk(b==null?void 0:b.user)})})(),r)}async function a(d){const f=await zr();if(!f)return;e.value="sending",n.value=null;const{error:h}=await f.auth.signInWithOtp({email:d,options:{emailRedirectTo:Kie()}});if(h){e.value="error",n.value=h.message;return}e.value="link-sent"}async function l(){const d=await zr();d&&(iO().clearLocalSynced(),await d.auth.signOut(),t.value=null,e.value="idle")}function c(){e.value="idle",n.value=null}function u(){o.value=!0}return{user:t,status:e,errorMessage:n,isSignedIn:i,signInModalOpen:o,init:s,signInWithEmail:a,signOut:l,resetStatus:c,openSignInModal:u}});function fl(){const t=sO(),{user:e,status:n,errorMessage:o,isSignedIn:r,signInModalOpen:i}=Tt(t);return{user:e,status:n,errorMessage:o,isSignedIn:r,signInModalOpen:i,init:t.init,signInWithEmail:t.signInWithEmail,signOut:t.signOut,resetStatus:t.resetStatus,openSignInModal:t.openSignInModal}}const Xie={key:0,class:"account-sign-in__sent"},Zie={class:"mb-0 text-secondary"},Qie={class:"account-sign-in__benefits"},Jie={class:"account-sign-in__benefit-icon"},ese={class:"account-sign-in__benefit-icon"},tse={key:0,class:"account-sign-in__error",role:"alert"},nse=["disabled"],ose=se({__name:"AccountSignInModal",props:{open:{type:Boolean}},emits:["update:open"],setup(t){const e=t,n=sO(),{status:o,errorMessage:r}=fl(),i=Fe("");Ke(()=>e.open,a=>{a&&n.resetStatus()});async function s(){i.value&&await n.signInWithEmail(i.value)}return(a,l)=>{const c=Xy;return w(),Q(c,{"model-value":t.open,"no-header":"","no-footer":"",centered:"","body-class":"account-sign-in__body","onUpdate:modelValue":l[3]||(l[3]=u=>a.$emit("update:open",u))},{default:J(()=>[A("button",{type:"button",class:"account-sign-in__close","aria-label":"Close",onClick:l[0]||(l[0]=u=>a.$emit("update:open",!1))},[H(p(wr),{name:p(f2),size:"sm"},null,8,["name"])]),p(o)==="link-sent"?(w(),R("div",Xie,[l[6]||(l[6]=A("p",{class:"mb-1 fw-semibold"}," Check your inbox ",-1)),A("p",Zie,[l[4]||(l[4]=He(" We sent a link to ",-1)),A("strong",null,pe(p(i)),1),l[5]||(l[5]=He(". Open it on this device to finish. ",-1))]),A("button",{type:"button",class:"account-sign-in__again",onClick:l[1]||(l[1]=u=>p(n).resetStatus())}," Use a different email ")])):(w(),R("form",{key:1,class:"account-sign-in",onSubmit:pn(s,["prevent"])},[l[9]||(l[9]=A("h2",{class:"account-sign-in__title"}," Keep your charts in sync ",-1)),l[10]||(l[10]=A("p",{class:"account-sign-in__sub"}," Your work, safe and ready wherever you sign in. ",-1)),A("ul",Qie,[A("li",null,[A("span",Jie,[H(p(wr),{name:p(Wm),size:"sm"},null,8,["name"])]),l[7]||(l[7]=He(" Charts save to the cloud as you edit ",-1))]),A("li",null,[A("span",ese,[H(p(wr),{name:p(Hm),size:"sm"},null,8,["name"])]),l[8]||(l[8]=He(" Open your full library from any device ",-1))])]),l[11]||(l[11]=A("label",{for:"account-email",class:"form-label"},"Email address",-1)),Go(A("input",{id:"account-email","onUpdate:modelValue":l[2]||(l[2]=u=>Ze(i)?i.value=u:null),type:"email",class:Te(["form-control",{"is-invalid":p(o)==="error"}]),placeholder:"you@example.com",required:"",autocomplete:"email"},null,2),[[uf,p(i)]]),p(o)==="error"?(w(),R("p",tse,[H(p(wr),{name:p(KY),size:"sm"},null,8,["name"]),He(" "+pe(p(r)||"Something went wrong. Try again."),1)])):oe("",!0),A("button",{type:"submit",class:"btn btn-primary w-100 mt-3",disabled:p(o)==="sending"},[p(o)==="sending"?(w(),Q(p(wr),{key:0,name:p(Z4),size:"sm",spin:"","spin-duration":"0.7s"},null,8,["name"])):oe("",!0),He(" "+pe(p(o)==="sending"?"Sending link…":"Email me a magic link"),1)],8,nse),l[12]||(l[12]=A("p",{class:"account-sign-in__fine"}," No password required. The link arrives in seconds. ",-1))],32))]),_:1},8,["model-value"])}}}),rse=Be(ose,[["__scopeId","data-v-7d8ac38d"]]),ise={class:"account-menu"},sse={class:"visually-hidden"},ase={class:"account-menu__header"},lse={class:"account-menu__header__id"},cse={class:"account-menu__header__email"},use={class:"account-menu__item"},dse={class:"account-menu__item"},fse=se({__name:"AccountMenu",setup(t){const e=Rm(),{user:n,isSignedIn:o,signOut:r,init:i,signInModalOpen:s}=fl(),a=S(()=>{var u;return((u=n.value)==null?void 0:u.email)??""});i();function l(){e.push("/charts")}async function c(){await r(),e.push("/charts")}return(u,d)=>{const f=TE,h=AE,m=m4,b=Pm;return w(),R("div",ise,[p(o)?(w(),Q(b,{key:0,variant:"outline-secondary",size:"sm",end:"",offset:6,"teleport-to":"body","menu-class":"account-menu__menu"},{"button-content":J(()=>[H(I8,{email:p(a),size:"sm"},null,8,["email"]),A("span",sse,"Account menu, "+pe(p(a)),1)]),default:J(()=>[H(f,null,{default:J(()=>[A("div",ase,[H(I8,{email:p(a),size:"md"},null,8,["email"]),A("span",lse,[d[2]||(d[2]=A("span",{class:"account-menu__header__label"},"Signed in as",-1)),A("span",cse,pe(p(a)),1)])])]),_:1}),H(h),H(m,{onClick:l},{default:J(()=>[A("span",use,[H(p(wr),{name:p(Hm),size:"sm"},null,8,["name"]),d[3]||(d[3]=He(" My charts ",-1))])]),_:1}),H(h),H(m,{onClick:c},{default:J(()=>[A("span",dse,[H(p(wr),{name:p(VY),size:"sm"},null,8,["name"]),d[4]||(d[4]=He(" Sign out ",-1))])]),_:1})]),_:1})):(w(),Q(p(zn),{key:1,"icon-left":p(WY),label:"Sign in",variant:"primary",size:"sm",onClick:d[0]||(d[0]=g=>s.value=!0)},null,8,["icon-left"])),H(rse,{open:p(s),"onUpdate:open":d[1]||(d[1]=g=>Ze(s)?s.value=g:null)},null,8,["open"])])}}}),hse=Be(fse,[["__scopeId","data-v-27b73b44"]]),pse={class:"layout-navbar"},mse={class:"layout-navbar__lead d-xl-none"},gse=se({__name:"LayoutNavbar",props:{sidebarOpen:{type:Boolean}},emits:["searchClick","toggleSidebar"],setup(t){const{theme:e,cycleTheme:n,resolvedTheme:o}=Yf(),{isNarrow:r}=Yr(),{isNarrow:i}=Yr("sm"),s=g2("k"),a={light:$Y,dark:MY,auto:PY},l=S(()=>a[e.value]),c=S(()=>r.value?"Search…":"Search or jump to…"),u=S(()=>o.value==="dark"?RA:NA),d=ms();return(f,h)=>(w(),R("header",pse,[A("div",mse,[H(p(zn),{"icon-left":p(IA),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:h[0]||(h[0]=m=>f.$emit("toggleSidebar"))},null,8,["icon-left","aria-expanded"]),H(p($A),{name:"Blueprint Chart","logo-src":u.value,"hide-name":p(i),to:"/"},null,8,["logo-src","hide-name"])]),H(p(oG),{placeholder:c.value,"shortcut-label":p(s).keyLabel,collapsed:p(r),class:"layout-navbar__search",onClick:h[1]||(h[1]=m=>f.$emit("searchClick"))},null,8,["placeholder","shortcut-label","collapsed"]),h[2]||(h[2]=A("div",{class:"layout-navbar__spacer"},null,-1)),H(p(zn),{"icon-left":l.value,label:"Toggle theme","hide-label":"",square:"",variant:"outline-secondary",size:"sm",class:"layout-navbar__theme",onClick:p(n)},null,8,["icon-left","onClick"]),p(d)?(w(),Q(hse,{key:0})):oe("",!0)]))}}),vse=Be(gse,[["__scopeId","data-v-fa60ca1c"]]),Mb=260,Ck=660,aO=220,bse=Mb+aO,Bb=.22,Zu=Qn("panel",()=>{const t=Ne("docked"),e=Ne(Bb),n=Ne("docked"),o=Ne(!1),r=Ne(!1);function i(){t.value="docked",o.value||(n.value="docked")}function s(){t.value="closed",o.value||(n.value="closed")}function a(){t.value==="closed"&&(t.value="docked",o.value||(n.value="docked"))}function l(){t.value!=="drawer"&&(n.value=t.value),t.value="drawer"}function c(){t.value=n.value}function u(){t.value==="docked"?s():t.value==="closed"&&(t.value="docked",o.value||(n.value="docked"))}function d(g){if(!Number.isFinite(g)||g<=0){e.value=Bb;return}e.value=Math.min(1,g)}function f(g){o.value=g,g?t.value!=="drawer"&&(t.value="drawer"):t.value==="drawer"&&(t.value=n.value)}function h(g){o.value!==g&&(o.value=g,g?(t.value!=="drawer"&&(n.value=t.value),t.value="drawer"):t.value=n.value)}function m(g){r.value=g,g&&t.value!=="closed"&&t.value!=="drawer"&&(t.value="closed")}function b(g){r.value!==g&&(r.value=g,!o.value&&(g?(t.value!=="closed"&&t.value!=="drawer"&&(n.value=t.value),t.value="closed"):t.value==="closed"&&(t.value=n.value)))}return{mode:t,dockedWidth:e,lastDesktopMode:n,narrow:o,cramped:r,dock:i,close:s,open:a,openDrawer:l,closeDrawer:c,toggleMode:u,setDockedWidth:d,initBreakpoint:f,syncBreakpoint:h,initCramped:m,syncCramped:b}},{persist:{key:"blueprint-chart:panel:v3",pick:["mode","dockedWidth","lastDesktopMode"]}});function xc(){const t=Zu(),{mode:e,dockedWidth:n,lastDesktopMode:o,narrow:r,cramped:i}=Tt(t);return{mode:e,dockedWidth:n,lastDesktopMode:o,narrow:r,cramped:i,dock:t.dock,close:t.close,open:t.open,openDrawer:t.openDrawer,closeDrawer:t.closeDrawer,toggleMode:t.toggleMode,setDockedWidth:t.setDockedWidth,initBreakpoint:t.initBreakpoint,syncBreakpoint:t.syncBreakpoint,initCramped:t.initCramped,syncCramped:t.syncCramped}}const yse=Qn("dashboardPanel",()=>{const t=Ne(null);function e(o){if(t.value===o){t.value=null;return}t.value=o;const r=Zu();r.mode==="closed"&&r.open()}function n(){t.value=null}return{selectedChartId:t,selectChart:e,reset:n}});function lO(){const t=yse(),{selectedChartId:e}=Tt(t);return{selectedChartId:e,selectChart:t.selectChart,reset:t.reset}}function xse(){const{listSavedCharts:t,deleteChart:e}=Pr(),{selectedChartId:n}=lO(),{resolvedTheme:o}=Yf(),r=Fe([]),i=po({}),s=po({}),a=Ne("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=eu(b.id),v=Sp(b.id);if(g&&(i[b.id]=or(g)),v&&(s[b.id]=or(v)),g&&v)continue;const y=localStorage.getItem(`blueprint-chart:${b.id}`);if(y)try{if(!g){const x=vx(y);x&&(Tf(b.id,x),i[b.id]=or(x))}if(!v){const x=nO(y);x&&(Pg(b.id,x),s[b.id]=or(x))}}catch{}}}function f(b){const g=localStorage.getItem(`blueprint-chart:${b}`);if(!g)return null;const v=tu();localStorage.setItem(`blueprint-chart:${v}`,g);const y=localStorage.getItem(`blueprint-chart:${b}:meta`);y&&localStorage.setItem(`blueprint-chart:${v}:meta`,y);const x=eu(b);return x&&Tf(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)eO(b.id),gx(b.id),delete i[b.id],delete s[b.id];d()}return Ke(o,()=>{m()}),{charts:r,sortedCharts:l,selectedChart:c,thumbnails:i,previews:s,sortValue:a,refresh:u,duplicateChart:f,removeChart:h}}const wse={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function _se(t,e){return w(),R("svg",wse,[...e[0]||(e[0]=[A("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 kse=Oe({name:"ph-house",render:_se}),Sse={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Cse(t,e){return w(),R("svg",Sse,[...e[0]||(e[0]=[A("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 Ase=Oe({name:"ph-github-logo",render:Cse}),$se={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Tse(t,e){return w(),R("svg",$se,[...e[0]||(e[0]=[A("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 Ose=Oe({name:"ph-book-open",render:Tse}),Mse={class:"layout-sidebar__header"},Bse=se({__name:"LayoutSidebar",setup(t){const e=uc(),{sortedCharts:n}=xse(),{resolvedTheme:o}=Yf(),r=S(()=>n.value.slice(0,5)),i=S(()=>e.path==="/"),s=S(()=>e.path.startsWith("/charts")),a=S(()=>o.value==="dark"?RA:NA);return(l,c)=>(w(),Q(p(pG),{"aria-label":"Workspace navigation"},{header:J(()=>[A("div",Mse,[H(p($A),{name:"Blueprint Chart","logo-src":a.value,to:"/"},null,8,["logo-src"]),Ce(l.$slots,"trailing",{},void 0,!0)])]),default:J(()=>[H(p(Bv),{eyebrow:"Workspace"},{default:J(()=>[H(p(fd),{to:"/",label:"Home",active:i.value},{icon:J(()=>[H(p(kse))]),_:1},8,["active"]),H(p(fd),{to:"/charts",label:"My Charts",active:s.value,count:p(n).length||void 0},{icon:J(()=>[H(p(Hm))]),_:1},8,["active","count"])]),_:1}),r.value.length?(w(),Q(p(Bv),{key:0,eyebrow:"Recent"},{default:J(()=>[(w(!0),R(Re,null,vt(r.value,u=>(w(),Q(p(fd),{key:u.id,to:`/edit/${u.id}`,label:u.title||"Untitled"},null,8,["to","label"]))),128))]),_:1})):oe("",!0),H(p(Bv),{eyebrow:"Resources"},{default:J(()=>[H(p(fd),{href:"https://docs.blueprintchart.com",label:"Documentation"},{icon:J(()=>[H(p(Ose))]),_:1}),H(p(fd),{href:"https://github.com/blueprint-chart/blueprint-chart",label:"GitHub"},{icon:J(()=>[H(p(Ase))]),_:1})]),_:1})]),_:3}))}}),Ak=Be(Bse,[["__scopeId","data-v-34084162"]]),Lse={class:"command-palette-modal"},Pse={class:"command-palette-modal__input-row"},Dse={key:0,class:"command-palette-modal__results",role:"listbox","aria-label":"Chart results"},Ese=["aria-selected","onClick","onMousemove"],Ise=["src"],Nse={class:"command-palette-modal__meta"},Rse={class:"command-palette-modal__title"},Fse={class:"command-palette-modal__desc"},Vse={key:1,class:"command-palette-modal__empty"},zse=se({__name:"CommandPaletteModal",props:{open:{type:Boolean,required:!0},openModifiers:{}},emits:["update:open"],setup(t){const e=mt(t,"open"),n=Rm(),o=uc(),{listSavedCharts:r}=Pr(),i=Fe(""),s=Fe(0),a=bt("inputRef"),l=Fe([]),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=eu(v.id);y&&(g[v.id]=or(y))}return g});Ke(i,()=>{s.value=0}),Ke(()=>o.path,()=>{e.value&&(e.value=!1)}),Ke(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(),Q(p(Xy),{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:J(()=>[A("div",Lse,[A("div",Pse,[H(p(h2),{class:"command-palette-modal__icon"}),H(p(da),{ref_key:"inputRef",ref:a,modelValue:p(i),"onUpdate:modelValue":v[0]||(v[0]=y=>Ze(i)?i.value=y:null),"aria-label":"Search charts",placeholder:"Search charts…",autofocus:"",onKeydown:[v[1]||(v[1]=ar(pn(y=>e.value=!1,["prevent"]),["escape"])),v[2]||(v[2]=ar(pn(y=>f(1),["prevent"]),["down"])),v[3]||(v[3]=ar(pn(y=>f(-1),["prevent"]),["up"])),ar(pn(h,["prevent"]),["enter"])]},null,8,["modelValue","onKeydown"])]),p(c).length>0?(w(),R("div",Dse,[(w(!0),R(Re,null,vt(p(c),(y,x)=>(w(),R("div",{key:y.id,class:Te(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,Ise)):oe("",!0),A("div",Nse,[A("span",Rse,pe(y.title||"Untitled"),1),A("span",Fse,pe(y.description),1)])],42,Ese))),128))])):p(i).trim()?(w(),R("div",Vse,' No charts match "'+pe(p(i))+'" ',1)):oe("",!0)])]),_:1},8,["modelValue"]))}}),$k=Be(zse,[["__scopeId","data-v-09e7b11e"]]);function Hse(){const{isNarrow:t}=Yr(),e=Zu();e.initBreakpoint(t.value),Ke(t,n=>{e.syncBreakpoint(n)})}const Wse={key:0,class:"layout-shell layout-shell--landing"},Use={key:1,class:"layout-shell layout-shell--app"},Gse={class:"layout-shell__sidebar"},qse={class:"layout-shell__topbar"},Yse={class:"layout-shell__main"},jse=se({__name:"LayoutShell",setup(t){Hse();const e=uc(),n=S(()=>e.path==="/"),o=Ne(!1),r=g2("k"),{isNarrow:i}=Yr("xl"),s=Fe(!1);return Ke(()=>e.fullPath,()=>{s.value=!1}),Ke(i,a=>{a||(s.value=!1)}),Zs(document,"keydown",a=>{r.matches(a)&&(a.preventDefault(),o.value=!0)}),(a,l)=>{const c=RI;return n.value?(w(),R("div",Wse,[Ce(a.$slots,"default",{},void 0,!0),H($k,{open:o.value,"onUpdate:open":l[0]||(l[0]=u=>o.value=u)},null,8,["open"])])):(w(),R("div",Use,[A("aside",Gse,[H(Ak)]),A("div",qse,[H(vse,{"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"])]),A("main",Yse,[Ce(a.$slots,"default",{},void 0,!0)]),p(i)?(w(),Q(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:J(()=>[H(Ak,null,{trailing:J(()=>[H(p(SA),{onClick:l[3]||(l[3]=u=>s.value=!1)})]),_:1})]),_:1},8,["modelValue"])):oe("",!0),H($k,{open:o.value,"onUpdate:open":l[5]||(l[5]=u=>o.value=u)},null,8,["open"])]))}}}),Kse=Be(jse,[["__scopeId","data-v-e550b95e"]]),Xse=se({__name:"App",setup(t){const e=uc();return(n,o)=>{const r=wm("router-view"),i=Kse;return p(e).meta.bare?(w(),Q(r,{key:0})):(w(),Q(i,{key:1},{default:J(()=>[H(r)]),_:1}))}}}),Zse=se({__name:"PanelDocked",props:lt({collapsed:{type:Boolean},title:{},initialWidth:{default:Bb},showClose:{type:Boolean,default:!0},canvasWidth:{default:void 0}},{modelValue:{},modelModifiers:{}}),emits:lt(["close"],["update:modelValue"]),setup(t){const e=t,n=mt(t,"modelValue"),o=Ne(n.value??e.initialWidth);Ke(n,u=>{u!==void 0&&(o.value=u)});const r=Ne(!1),{width:i}=FR(),s=S(()=>({"panel-docked--collapsed":e.collapsed,"panel-docked--resizing":r.value})),a=S(()=>e.canvasWidth===void 0||e.canvasWidth<=0?Ck:Math.min(Ck,e.canvasWidth-aO)),l=S(()=>{const u=o.value*i.value;return Math.max(Mb,Math.min(u,a.value))});function c(u){const d=u.clientX,f=o.value*i.value,h=u.currentTarget;h.setPointerCapture(u.pointerId),r.value=!0;function m(g){const v=d-g.clientX,y=f+v,x=Math.min(a.value,Math.max(Mb,y)),_=i.value||window.innerWidth;o.value=_>0?x/_:o.value,n.value=o.value}function b(){r.value=!1,h.removeEventListener("pointermove",m),h.removeEventListener("pointerup",b)}h.addEventListener("pointermove",m),h.addEventListener("pointerup",b)}return(u,d)=>(w(),R("div",{class:Te(["panel-docked",p(s)]),style:Lt({width:t.collapsed?void 0:`${p(l)}px`})},[A("div",{class:"panel-docked__resize-handle",onPointerdown:c},null,32),H(p(FU),{title:t.title},$i({actions:J(()=>[t.showClose?(w(),Q(p(SA),{key:0,onClick:d[0]||(d[0]=f=>u.$emit("close"))})):oe("",!0)]),default:J(()=>[Ce(u.$slots,"default",{},void 0,!0)]),_:2},[u.$slots.toolbar?{name:"toolbar",fn:J(()=>[Ce(u.$slots,"toolbar",{},void 0,!0)]),key:"0"}:void 0,u.$slots.footer?{name:"footer",fn:J(()=>[Ce(u.$slots,"footer",{},void 0,!0)]),key:"1"}:void 0]),1032,["title"])],6))}}),Qse=Be(Zse,[["__scopeId","data-v-02f78f79"]]),Jse={class:"panel-drawer__body"},eae=se({__name:"PanelDrawer",props:lt({title:{}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=mt(t,"modelValue");return(n,o)=>(w(),Q(p(CA),{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=r=>e.value=r),title:t.title},{default:J(()=>[Ce(n.$slots,"header",{},void 0,!0),A("div",Jse,[Ce(n.$slots,"default",{},void 0,!0)])]),_:3},8,["modelValue","title"]))}}),tae=Be(eae,[["__scopeId","data-v-46314d76"]]);function nae(t){const{width:e}=MR(t),n=Zu(),o=S(()=>e.value>0&&e.value<bse);return n.initCramped(o.value),Ke(o,r=>{n.syncCramped(r)}),{canvasWidth:e}}const Eg=se({__name:"PanelShell",props:lt({title:{},containerRef:{default:null},showClose:{type:Boolean,default:!0}},{drawerOpen:{type:Boolean,default:!1},drawerOpenModifiers:{}}),emits:lt(["close"],["update:drawerOpen"]),setup(t,{emit:e}){const n=t,o=e,r=mt(t,"drawerOpen"),i=Zu(),{mode:s,dockedWidth:a}=Tt(i),{close:l}=i,c=S(()=>{var f;return((f=n.containerRef)==null?void 0:f.parentElement)??null}),{canvasWidth:u}=nae(c);function d(){l(),o("close")}return(f,h)=>{const m=tae,b=Qse;return p(s)==="drawer"?(w(),Q(m,{key:0,modelValue:r.value,"onUpdate:modelValue":h[0]||(h[0]=g=>r.value=g),title:t.title},$i({default:J(()=>[Ce(f.$slots,"default")]),_:2},[f.$slots.tabs||f.$slots.header?{name:"header",fn:J(()=>[Ce(f.$slots,"tabs"),Ce(f.$slots,"header")]),key:"0"}:void 0]),1032,["modelValue","title"])):p(s)==="docked"?(w(),Q(b,{key:1,modelValue:p(a),"onUpdate:modelValue":h[1]||(h[1]=g=>Ze(a)?a.value=g:null),collapsed:!1,title:t.title,"show-close":t.showClose,"canvas-width":p(u),onClose:d},$i({default:J(()=>[Ce(f.$slots,"default")]),_:2},[f.$slots.header?{name:"toolbar",fn:J(()=>[Ce(f.$slots,"header")]),key:"0"}:void 0,f.$slots.footer?{name:"footer",fn:J(()=>[Ce(f.$slots,"footer")]),key:"1"}:void 0]),1032,["modelValue","title","show-close","canvas-width"])):oe("",!0)}}}),oae={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function rae(t,e){return w(),R("svg",oae,[...e[0]||(e[0]=[A("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 cO=Oe({name:"ph-cursor-click",render:rae}),iae={class:"dashboard-empty-state"},sae=se({__name:"DashboardEmptyState",setup(t){return(e,n)=>(w(),R("div",iae,[H(p(cO),{class:"dashboard-empty-state__icon"}),n[0]||(n[0]=A("p",{class:"dashboard-empty-state__text"}," Select a chart to see its details ",-1))]))}}),aae=Be(sae,[["__scopeId","data-v-f6c24334"]]),lae={class:"dashboard-action-row__label"},cae={key:0,class:"dashboard-action-row__description"},uae=se({__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:Te(["dashboard-action-row",p(n)]),onClick:r[0]||(r[0]=i=>o.$emit("click"))},[(w(),Q(Rt(t.icon),{class:"dashboard-action-row__icon"})),A("div",null,[A("div",lae,pe(t.label),1),t.description?(w(),R("div",cae,pe(t.description),1)):oe("",!0)])],2))}}),dae=Be(uae,[["__scopeId","data-v-0f47d7d3"]]),fae={class:"dashboard-detail-actions"},hae={class:"dashboard-detail-actions__list"},pae={class:"dashboard-detail-actions__confirm-text"},mae={class:"dashboard-detail-actions__confirm-buttons"},gae="This cannot be undone",vae=se({__name:"DashboardDetailActions",props:{syncState:{}},emits:["duplicate","delete"],setup(t,{emit:e}){const n=t,o=e,r=Fe(!1),i=S(()=>n.syncState==="local"?"this device":"your account and every device"),s=S(()=>`Delete this chart from ${i.value}? This can't be undone.`);function a(){r.value=!1,o("delete")}return(l,c)=>{const u=dae,d=Xy;return w(),R("div",fae,[c[4]||(c[4]=A("div",{class:"dashboard-detail-actions__title"}," Actions ",-1)),A("div",hae,[H(u,{icon:p(Q4),label:"Duplicate",description:"Create a copy to edit",onClick:c[0]||(c[0]=f=>l.$emit("duplicate"))},null,8,["icon"]),H(u,{icon:p(OA),label:"Delete chart",description:gae,danger:"","data-test":"delete",onClick:c[1]||(c[1]=f=>r.value=!0)},null,8,["icon"])]),H(d,{modelValue:p(r),"onUpdate:modelValue":c[3]||(c[3]=f=>Ze(r)?r.value=f:null),title:"Delete chart?","no-footer":"",centered:""},{default:J(()=>[A("p",pae,pe(p(s)),1),A("div",mae,[A("button",{type:"button",class:"btn btn-link btn-sm","data-test":"cancel-delete",onClick:c[2]||(c[2]=f=>r.value=!1)}," Cancel "),A("button",{type:"button",class:"btn btn-danger btn-sm","data-test":"confirm-delete",onClick:a}," Delete ")])]),_:1},8,["modelValue"])])}}}),bae=Be(vae,[["__scopeId","data-v-5841a28d"]]),yae={class:"dashboard-meta-chip"},xae={class:"dashboard-meta-chip__label"},wae={class:"dashboard-meta-chip__value"},_ae=se({__name:"DashboardMetaChip",props:{label:{},value:{}},setup(t){return(e,n)=>(w(),R("div",yae,[A("div",xae,pe(t.label),1),A("div",wae,pe(t.value),1)]))}}),kae=Be(_ae,[["__scopeId","data-v-a1903aff"]]),Sae={class:"dashboard-detail-meta"},Cae={class:"dashboard-detail-meta__grid"},Aae=se({__name:"DashboardDetailMeta",props:{chartType:{},savedAt:{},sceneCount:{},rowCount:{}},setup(t){const e=t,n=S(()=>_A(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=kae;return w(),R("div",Sae,[i[0]||(i[0]=A("div",{class:"dashboard-detail-meta__title"}," Details ",-1)),A("div",Cae,[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"])])])}}}),$ae=Be(Aae,[["__scopeId","data-v-533a4b72"]]),Tae=["data-bs-theme"],Oae=["src"],Mae={key:1,class:"dashboard-detail-preview"},Bae=se({__name:"DashboardDetailPreview",props:{src:{},forceLightTheme:{type:Boolean},loading:{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},[A("img",{src:t.src,alt:"",class:"dashboard-detail-preview__img"},null,8,Oae)],8,Tae)):t.loading?(w(),R("div",Mae,[H(p(Sd),{width:"100%",height:"100%",radius:"var(--bc-radius-xs)"})])):oe("",!0)}}),Lae=Be(Bae,[["__scopeId","data-v-26bdab9b"]]),Pae={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Dae(t,e){return w(),R("svg",Pae,[...e[0]||(e[0]=[A("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 bx=Oe({name:"ph-pencil-simple",render:Dae}),Eae={class:"dashboard-detail-content"},Iae={key:0,class:"dashboard-detail-content__subtitle"},Nae=se({__name:"DashboardDetailContent",props:{title:{},subtitle:{},previewSrc:{},previewLoading:{type:Boolean},forceLightTheme:{type:Boolean},chartType:{},savedAt:{},sceneCount:{},rowCount:{},syncState:{},showCloud:{type:Boolean}},emits:["edit","duplicate","delete","sync"],setup(t){return(e,n)=>{const o=Lae,r=$ae,i=bae;return w(),R("div",Eae,[t.subtitle?(w(),R("div",Iae,pe(t.subtitle),1)):oe("",!0),H(p(zn),{"icon-left":p(bx),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,loading:t.previewLoading},null,8,["src","force-light-theme","loading"]),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"]),t.showCloud&&t.syncState==="local"?(w(),Q(p(zn),{key:1,"icon-left":p(Wm),label:"Sync to cloud",variant:"secondary",block:"",class:"dashboard-detail-content__sync",onClick:n[1]||(n[1]=s=>e.$emit("sync"))},null,8,["icon-left"])):oe("",!0),H(i,{"sync-state":t.syncState,onDuplicate:n[2]||(n[2]=s=>e.$emit("duplicate")),onDelete:n[3]||(n[3]=s=>e.$emit("delete"))},null,8,["sync-state"])])}}}),Rae=Be(Nae,[["__scopeId","data-v-fabfb583"]]),Fae={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Vae(t,e){return w(),R("svg",Fae,[...e[0]||(e[0]=[A("path",{fill:"currentColor",d:"M160 40a88.09 88.09 0 0 0-78.71 48.67A64 64 0 1 0 72 216h88a88 88 0 0 0 0-176m0 160H72a48 48 0 0 1 0-96c1.1 0 2.2 0 3.29.11A88 88 0 0 0 72 128a8 8 0 0 0 16 0a72 72 0 1 1 72 72m37.66-93.66a8 8 0 0 1 0 11.32l-48 48a8 8 0 0 1-11.32 0l-24-24a8 8 0 0 1 11.32-11.32L144 148.69l42.34-42.35a8 8 0 0 1 11.32 0"},null,-1)])])}const zae=Oe({name:"ph-cloud-check",render:Vae}),Hae=Qn("wait",()=>{const t=po({});function e(o){return!!t[yt(o)]}function n(o,r){return t[yt(o)]=r,r}return{pending:t,get:e,set:n}});function Ig(){const t=Hae();function e(i){return t.get(i)}function n(i){t.set(i,!0)}function o(i){t.set(i,!1)}function r(i,s){const a=typeof i=="function"?i:s,l=typeof i=="string"?i:i.name||"default";if(typeof a!="function")throw new Error("useWait.waitFor: expected a function to run");return async()=>{n(l);try{return await a()}finally{o(l)}}}return{start:n,end:o,waiting:e,waitFor:r}}const Wae=["title","aria-label"],Uae=se({__name:"DashboardChartCard",props:{chart:{},thumbSrc:{default:void 0},selected:{type:Boolean},layout:{},showCloud:{type:Boolean,default:!0}},emits:["select","edit","sync","open"],setup(t,{emit:e}){const{resolvedTheme:n}=Yf(),o=Ig(),r=t,i=S(()=>o.waiting(`chart-media:${r.chart.id}`)),s=e,a=S(()=>r.chart.syncState==="local"?Wm:zae),l=S(()=>r.chart.syncState==="synced"?"Synced to cloud":r.chart.syncState==="cloud"?"In the cloud — open to download":"Local only — sync to cloud");function c(){r.chart.syncState==="local"?s("sync",r.chart.id):r.chart.syncState==="cloud"&&s("open",r.chart.id)}return(u,d)=>(w(),Q(p(MA),{title:t.chart.title||"Untitled",subtitle:t.chart.description,"thumb-src":t.thumbSrc,"thumb-loading":p(i),selected:t.selected,layout:t.layout,"force-light-thumb":!t.chart.allowDarkMode,"serif-title":!0,onClick:d[1]||(d[1]=f=>u.$emit("select",t.chart.id))},{status:J(()=>[t.showCloud?(w(),R("button",{key:0,type:"button",class:Te(["dashboard-chart-card__status",`dashboard-chart-card__status--${t.chart.syncState}`]),title:p(l),"aria-label":p(l),onClick:c},[(w(),Q(Rt(p(a))))],10,Wae)):oe("",!0)]),actions:J(()=>[H(p(zn),{"icon-left":p(bx),label:"Edit","hide-label":"",square:"",variant:"primary",size:"sm",class:"dashboard-chart-card__edit-btn",onClick:d[0]||(d[0]=f=>u.$emit("edit",t.chart.id))},null,8,["icon-left"])]),footer:J(()=>[H(p(WW),{"chart-type":t.chart.chartType,theme:p(n)},null,8,["chart-type","theme"]),t.chart.savedAt?(w(),Q(p(CW),{key:0,value:t.chart.savedAt},null,8,["value"])):oe("",!0)]),_:1},8,["title","subtitle","thumb-src","thumb-loading","selected","layout","force-light-thumb"]))}}),Gae=Be(Uae,[["__scopeId","data-v-9a01f895"]]),qae=se({__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:Te(["dashboard-new-card",p(n)]),role:"button",tabindex:"0",onClick:r[0]||(r[0]=i=>o.$emit("click")),onKeydown:[r[1]||(r[1]=ar(i=>o.$emit("click"),["enter"])),r[2]||(r[2]=ar(pn(i=>o.$emit("click"),["prevent"]),["space"]))]},[H(p(s2),{class:"dashboard-new-card__icon"}),r[3]||(r[3]=A("span",{class:"dashboard-new-card__label"},"New Chart",-1))],34))}}),Yae=Be(qae,[["__scopeId","data-v-ef746b42"]]),jae=6,Kae=se({__name:"DashboardGallery",props:{charts:{},thumbnails:{},selectedId:{},layout:{},showCloud:{type:Boolean}},emits:["select","edit","sync","open","new"],setup(t){const e=Ig(),n=S(()=>e.waiting("dashboard-charts"));return(o,r)=>{const i=Yae,s=Gae;return w(),Q(p(tq),{layout:t.layout,"aria-busy":p(n)||void 0},{default:J(()=>[H(i,{layout:t.layout,onClick:r[0]||(r[0]=a=>o.$emit("new"))},null,8,["layout"]),p(n)&&t.charts.length===0?(w(),R(Re,{key:0},vt(jae,a=>H(p(MA),{key:`skeleton-${a}`,title:"",loading:"",layout:t.layout},null,8,["layout"])),64)):(w(),R(Re,{key:1},[(w(!0),R(Re,null,vt(t.charts,a=>(w(),Q(s,{key:a.id,chart:a,"thumb-src":t.thumbnails[a.id],selected:t.selectedId===a.id,layout:t.layout,"show-cloud":t.showCloud,onSelect:r[1]||(r[1]=l=>o.$emit("select",l)),onEdit:r[2]||(r[2]=l=>o.$emit("edit",l)),onSync:r[3]||(r[3]=l=>o.$emit("sync",l)),onOpen:r[4]||(r[4]=l=>o.$emit("open",l))},null,8,["chart","thumb-src","selected","layout","show-cloud"]))),128)),t.charts.length===0?(w(),Q(p(SU),{key:0,message:"No saved charts yet. Create a new chart to get started."})):oe("",!0)],64))]),_:1},8,["layout","aria-busy"])}}}),Xae={},Zae={class:"layout-page-header"},Qae={class:"layout-page-header__start"},Jae={class:"layout-page-header__center"},ele={class:"layout-page-header__end"};function tle(t,e){return w(),R("div",Zae,[A("div",Qae,[Ce(t.$slots,"start",{},void 0,!0)]),A("div",Jae,[Ce(t.$slots,"center",{},void 0,!0)]),A("div",ele,[Ce(t.$slots,"end",{},void 0,!0)])])}const uO=Be(Xae,[["render",tle],["__scopeId","data-v-c99b9b81"]]),nle={key:0,class:"layout-breadcrumb","aria-label":"Breadcrumb"},ole=["aria-current"],rle={key:2,class:"layout-breadcrumb__crumb-sep","aria-hidden":"true"},ile=se({__name:"LayoutBreadcrumb",setup(t){const e=uc(),n=dn(),o=S(()=>{const r=e.path;if(r.startsWith("/edit/")){const i=n._base.title.value||"Untitled";return[{label:"My Charts",to:"/charts"},{label:i}]}return r.startsWith("/charts")?[{label:"My Charts"}]:r==="/new"?[{label:"My Charts",to:"/charts"},{label:"New chart"}]:[]});return(r,i)=>{const s=wm("router-link");return o.value.length?(w(),R("nav",nle,[(w(!0),R(Re,null,vt(o.value,(a,l)=>(w(),R(Re,{key:l},[a.to?(w(),Q(s,{key:0,to:a.to,class:"layout-breadcrumb__crumb"},{default:J(()=>[He(pe(a.label),1)]),_:2},1032,["to"])):(w(),R("span",{key:1,class:"layout-breadcrumb__crumb layout-breadcrumb__crumb--active","aria-current":l===o.value.length-1?"page":void 0},pe(a.label),9,ole)),l<o.value.length-1?(w(),R("span",rle,"/")):oe("",!0)],64))),128))])):oe("",!0)}}}),dO=Be(ile,[["__scopeId","data-v-4e548a9e"]]),sle={key:0},ale={class:"dashboard-sync-pill__label"},lle=se({__name:"DashboardSyncPill",props:{count:{},syncing:{type:Boolean}},emits:["sync"],setup(t,{emit:e}){const n=e;return(o,r)=>t.count>0?(w(),R("span",{key:0,class:Te(["dashboard-sync-pill",{"dashboard-sync-pill--busy":t.syncing}])},[H(p(Wm),{class:"dashboard-sync-pill__icon","aria-hidden":"true"}),t.syncing?(w(),R("span",sle,"Backing up…")):(w(),R(Re,{key:1},[A("span",ale,pe(t.count)+" on this device",1),A("button",{type:"button",class:"dashboard-sync-pill__btn",onClick:r[0]||(r[0]=i=>n("sync"))},pe(t.count===1?"Back up":"Back up all"),1)],64))],2)):oe("",!0)}}),cle=Be(lle,[["__scopeId","data-v-71688abb"]]),ule={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function dle(t,e){return w(),R("svg",ule,[...e[0]||(e[0]=[A("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 fle=Oe({name:"ph-rows",render:dle}),hle={class:"dashboard-toolbar__count"},ple=se({__name:"DashboardToolbar",props:{chartCount:{},sortValue:{},layout:{},localOnlyCount:{},syncingAll:{type:Boolean}},emits:["update:sortValue","update:layout","new","sync"],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:Hm,active:e.layout==="grid"},{key:"row",text:"List",icon:fle,active:e.layout==="row"}]);return(r,i)=>(w(),Q(uO,{class:"dashboard-toolbar"},{start:J(()=>[H(dO),A("span",hle,pe(t.chartCount)+" "+pe(t.chartCount===1?"chart":"charts"),1),H(cle,{count:t.localOnlyCount,syncing:t.syncingAll,onSync:i[0]||(i[0]=s=>r.$emit("sync"))},null,8,["count","syncing"])]),end:J(()=>[H(p(AA),{items:p(o),"aria-label":"View layout",onSelect:i[1]||(i[1]=s=>r.$emit("update:layout",s))},null,8,["items"]),H(p(Rn),{"model-value":t.sortValue,options:n,"onUpdate:modelValue":i[2]||(i[2]=s=>r.$emit("update:sortValue",s))},null,8,["model-value"]),H(p(zn),{"icon-left":p(s2),label:"New chart",variant:"primary",onClick:i[3]||(i[3]=s=>r.$emit("new"))},null,8,["icon-left"])]),_:1}))}}),mle=Be(ple,[["__scopeId","data-v-7ebcfb33"]]);function gle(t){function e(){return t.listLocalOnly().length}async function n(){let o=0;for(const r of t.listLocalOnly()){const i=localStorage.getItem(ns(r.id));if(!i)continue;const s=await t.syncCloud({id:r.id,dsl:i,meta:Dg(r.id),title:r.title,chartType:r.chartType});s&&(t.markCloudBacked(s),o++)}return o}return{localOnlyCount:e,syncAll:n}}function vle(t){return{id:t.id,title:t.title,description:"",chartType:t.chartType,savedAt:t.updatedAt,sceneCount:0,rowCount:0,allowDarkMode:!0,sheetNumber:null,sheetId:"",syncState:"cloud",published:t.published}}function ble(t,e){const n=new Map(e.map(i=>[i.id,i])),o=t.map(i=>{const s=n.get(i.id);return{...i,syncState:s?"synced":"local",published:(s==null?void 0:s.published)??!1}}),r=new Set(t.map(i=>i.id));for(const i of e)r.has(i.id)||o.push(vle(i));return o}const yle={"date-desc":(t,e)=>(e.savedAt??"").localeCompare(t.savedAt??""),"date-asc":(t,e)=>(t.savedAt??"").localeCompare(e.savedAt??""),"name-asc":(t,e)=>(t.title||"").localeCompare(e.title||"")};function xle(){const t=Pr(),e=dl(),{isSignedIn:n}=fl(),o=Ig(),r=Fe([]),i=po({}),s=po({}),a=Ne("date-desc"),l=S(()=>ms()&&n.value),c=S(()=>{const v=yle[a.value];return v?[...r.value].sort(v):r.value}),u=S(()=>r.value.filter(v=>v.syncState==="local").length);async function d(){const v=t.listSavedCharts();o.start("dashboard-charts");let y=[];try{y=l.value?await e.listCloud():[]}finally{o.end("dashboard-charts")}r.value=ble(v,y),f()}function f(){for(const v of r.value){if(v.syncState==="cloud"){h(v.id);continue}const y=eu(v.id),x=Sp(v.id);if(y&&(i[v.id]=or(y)),x&&(s[v.id]=or(x)),y&&x)continue;const _=localStorage.getItem(ns(v.id));if(_)try{if(!y){const C=vx(_);C&&(Tf(v.id,C),i[v.id]=or(C))}if(!x){const C=nO(_);C&&(Pg(v.id,C),s[v.id]=or(C))}}catch{}}}async function h(v){const y=eu(v),x=Sp(v);if(y&&(i[v]=or(y)),x&&(s[v]=or(x)),!(y&&x)){o.start(`chart-media:${v}`);try{const _=await e.loadCloud(v);if(!_)return;Yie(v,_.dsl);const C=eu(v),D=Sp(v);C&&(i[v]=or(C)),D&&(s[v]=or(D));const M=Ob(_.dsl),$=r.value.findIndex(L=>L.id===v);$!==-1&&(r.value[$]={...r.value[$],description:M.description,sceneCount:M.sceneCount,rowCount:M.rowCount,allowDarkMode:M.allowDarkMode})}finally{o.end(`chart-media:${v}`)}}}async function m(v){const y=localStorage.getItem(ns(v));if(!y)return;const x=Ob(y),_=await e.syncCloud({id:v,dsl:y,meta:Dg(v),title:x.title,chartType:x.chartType});_&&(e.markCloudBacked(_),await d())}async function b(v){const y=r.value.find(_=>_.id===v);(y?y.syncState!=="local":e.isCloudBacked(v))&&(await e.deleteCloud(v),e.unmarkCloudBacked(v)),t.deleteChart(v),gx(v),delete i[v],delete s[v],await d()}async function g(v){let y=localStorage.getItem(ns(v)),x=localStorage.getItem(Pa(v));if(!y){const C=await e.loadCloud(v);if(!C)return null;y=C.dsl,x=Object.keys(C.meta).length>0?JSON.stringify(C.meta):null}const _=tu();return localStorage.setItem(ns(_),y),x&&localStorage.setItem(Pa(_),x),await d(),_}return{charts:r,sortedCharts:c,thumbnails:i,previews:s,sortValue:a,localOnlyCount:u,refresh:d,syncOne:m,remove:b,duplicate:g}}const wle={class:"dashboard-page-wrapper d-flex flex-column flex-grow-1"},_le=se({__name:"DashboardPage",setup(t){const e=Rm(),{isNarrow:n}=Yr(),{selectedChartId:o,selectChart:r}=lO(),{mode:i}=Tt(Zu()),{sortedCharts:s,thumbnails:a,previews:l,sortValue:c,localOnlyCount:u,refresh:d,syncOne:f,remove:h,duplicate:m}=xle(),{isSignedIn:b}=fl(),g=S(()=>ms()&&b.value),v=dl(),y=Ig(),x=S(()=>o.value?y.waiting(`chart-media:${o.value}`)&&!l[o.value]:!1),_=gle({listLocalOnly:()=>s.value.filter(ne=>ne.syncState==="local").map(ne=>({id:ne.id,title:ne.title,chartType:ne.chartType})),syncCloud:v.syncCloud,markCloudBacked:v.markCloudBacked}),C=Fe(!1),D=S(()=>s.value.find(ne=>ne.id===o.value)??null);async function M(){C.value=!0;try{await _.syncAll(),await d()}finally{C.value=!1}}function $(ne){e.push(`/edit/${ne}`)}Ke(g,()=>{d()});const L=bt("galleryRef"),E=Ne("grid"),N=S(()=>({"dashboard-page":!0,"dashboard-page--narrow":n.value})),T=S(()=>D.value?D.value.title||"Untitled":"Chart details");function O(){o.value=null}const P=S({get:()=>o.value!==null,set:ne=>{ne||(o.value=null)}});function B(){o.value&&$(o.value)}async function V(){const ne=o.value;if(!ne)return;const ae=await m(ne);ae&&$(ae)}async function z(){const ne=o.value;ne&&(await h(ne),o.value=null)}async function G(){o.value&&await f(o.value)}function K(ne){ne.key==="Escape"&&(o.value=null)}return vn(()=>{d(),document.addEventListener("keydown",K)}),ca(()=>{document.removeEventListener("keydown",K)}),(ne,ae)=>{const he=mle,ge=Kae,le=Rae,fe=aae,we=Eg;return w(),R("div",wle,[H(he,{"chart-count":p(s).length,"sort-value":p(c),layout:p(E),"local-only-count":p(g)?p(u):0,"syncing-all":p(C),"onUpdate:sortValue":ae[0]||(ae[0]=Z=>c.value=Z),"onUpdate:layout":ae[1]||(ae[1]=Z=>E.value=Z),onNew:ae[2]||(ae[2]=Z=>p(e).push("/new")),onSync:M},null,8,["chart-count","sort-value","layout","local-only-count","syncing-all"]),A("div",{class:Te(p(N))},[A("div",{ref_key:"galleryRef",ref:L,class:"dashboard-page__gallery"},[H(ge,{charts:p(s),thumbnails:p(a),"selected-id":p(o),layout:p(E),"show-cloud":p(g),onSelect:p(r),onEdit:$,onSync:p(f),onOpen:$,onNew:ae[3]||(ae[3]=Z=>p(e).push("/new"))},null,8,["charts","thumbnails","selected-id","layout","show-cloud","onSelect","onSync"])],512),H(we,{"drawer-open":p(P),"onUpdate:drawerOpen":ae[4]||(ae[4]=Z=>Ze(P)?P.value=Z:null),title:p(T),"container-ref":p(L),"show-close":!1,onClose:O},{default:J(()=>[p(D)?(w(),Q(le,{key:0,title:p(D).title||"Untitled",subtitle:p(D).description,"preview-src":p(o)?p(l)[p(o)]:void 0,"preview-loading":p(x),"force-light-theme":p(D)?!p(D).allowDarkMode:!1,"chart-type":p(D).chartType,"saved-at":p(D).savedAt??void 0,"scene-count":p(D).sceneCount,"row-count":p(D).rowCount,"sync-state":p(D).syncState,"show-cloud":p(g),onEdit:B,onDuplicate:V,onDelete:z,onSync:G},null,8,["title","subtitle","preview-src","preview-loading","force-light-theme","chart-type","saved-at","scene-count","row-count","sync-state","show-cloud"])):p(i)==="docked"?(w(),Q(fe,{key:1})):oe("",!0)]),_:1},8,["drawer-open","title","container-ref"])],2)])}}}),kle=Be(_le,[["__scopeId","data-v-5c852eb1"]]),Sle={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Cle(t,e){return w(),R("svg",Sle,[...e[0]||(e[0]=[A("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 fO=Oe({name:"ph-sidebar-simple",render:Cle}),yx=se({__name:"PanelIconRail",props:{activeTab:{},items:{}},emits:["select","toggle-mode"],setup(t,{emit:e}){const n=e,{mode:o,open:r}=xc();function i(a){o.value==="closed"&&r(),n("select",a)}const s=S(()=>o.value==="closed"?"Open panel":"Close panel");return(a,l)=>(w(),Q(p(aG),{"model-value":t.activeTab,items:t.items,"onUpdate:modelValue":i},{footer:J(()=>[H(p(zn),{"icon-left":p(fO),label:p(s),"hide-label":"",square:"",variant:"link",size:"sm",onClick:l[0]||(l[0]=c=>a.$emit("toggle-mode"))},null,8,["icon-left","label"])]),_:1},8,["model-value","items"]))}}),Ale=Qn("exportPanel",()=>{const t=Ne("embed"),e=Ne("png"),n=Ne(2),o=Ne(!1),r=Ne(!1),i=Ne(!0),s=Ne(!1),a=Ne("embed");function l(f){t.value=f}function c(f){e.value=f}function u(f){a.value=f}function d(){t.value="embed",e.value="png",n.value=2,o.value=!1,r.value=!1,i.value=!0,s.value=!1,a.value="embed"}return{exportTab:t,selectedFormat:e,pngScale:n,svgInlineFonts:o,svgMinify:r,bpcIncludeData:i,bpcCompact:s,lastNarrowExportTab:a,setExportTab:l,setSelectedFormat:c,setLastNarrowExportTab:u,reset:d}});function Ng(){const t=Ale(),{exportTab:e,selectedFormat:n,pngScale:o,svgInlineFonts:r,svgMinify:i,bpcIncludeData:s,bpcCompact:a,lastNarrowExportTab:l}=Tt(t);return{exportTab:e,selectedFormat:n,pngScale:o,svgInlineFonts:r,svgMinify:i,bpcIncludeData:s,bpcCompact:a,lastNarrowExportTab:l,setExportTab:t.setExportTab,setSelectedFormat:t.setSelectedFormat,setLastNarrowExportTab:t.setLastNarrowExportTab,reset:t.reset}}const $le={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Tle(t,e){return w(),R("svg",$le,[...e[0]||(e[0]=[A("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 Ole=Oe({name:"ph-code",render:Tle}),Mle={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Ble(t,e){return w(),R("svg",Mle,[...e[0]||(e[0]=[A("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 hO=Oe({name:"ph-download-simple",render:Ble});function pO(){return{sections:[{key:"embed",label:"Embed",icon:Ole},{key:"download",label:"Download",icon:hO}]}}const Lle=se({__name:"ExportIconRail",setup(t){const{mode:e,toggleMode:n}=xc(),o=Ng(),{exportTab:r}=Tt(o),{setExportTab:i}=o,{sections:s}=pO(),a=S(()=>s.map(c=>({value:c.key,icon:c.icon,tooltip:c.tooltip??c.label})));function l(c){i(c),e.value==="closed"&&n()}return(c,u)=>{const d=yx;return w(),Q(d,{"active-tab":p(r),items:p(a),onSelect:l,onToggleMode:p(n)},null,8,["active-tab","items","onToggleMode"])}}}),Gi=[{label:"Data",key:"data"},{label:"Visualize",key:"edit"},{label:"Export",key:"export"}];function Ple(t){return t.endsWith("/export")?"export":t.endsWith("/visualize")?"edit":(t.endsWith("/data"),"data")}function Dle(t,e){return e==="edit"?`/edit/${t}/visualize`:`/edit/${t}/${e}`}const e1=Fe(null);function xx(){const t=uc(),e=Rm(),n=S(()=>{const h=Ple((t==null?void 0:t.path)??"/new");return Gi.find(m=>m.key===h)??Gi[0]}),o=S({get:()=>Gi.indexOf(n.value),set:h=>{u(h)}}),r=S(()=>o.value===0),i=S(()=>o.value===Gi.length-1);function s(){var m;const h=(m=t==null?void 0:t.params)==null?void 0:m.id;return h||(e1.value?e1.value():null)}function a(h){const m=s();m&&e&&e.replace(Dle(m,h))}function l(){const h=o.value;h<Gi.length-1&&a(Gi[h+1].key)}function c(){const h=o.value;h>0&&a(Gi[h-1].key)}function u(h){h>=0&&h<Gi.length&&a(Gi[h].key)}function d(){}function f(h){e1.value=h}return{currentIndex:o,steps:Gi,currentStep:n,isFirst:r,isLast:i,next:l,back:c,goTo:u,reset:d,registerCreateSession:f}}const Ele={class:"panel-stepper-footer"},Ile=se({__name:"PanelStepperFooter",setup(t){const{steps:e,currentIndex:n,isFirst:o,isLast:r,next:i,back:s}=xx(),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",Ele,[p(o)?oe("",!0):(w(),Q(p(zn),{key:0,"icon-left":p(BA),"icon-left-size":"1em",label:p(a),variant:"outline-secondary",size:"sm",onClick:p(s)},null,8,["icon-left","label","onClick"])),p(r)?oe("",!0):(w(),Q(p(zn),{key:1,"icon-right":p(LA),"icon-right-size":"1em",label:p(l),variant:"primary",size:"sm",class:"ms-auto",onClick:p(i)},null,8,["icon-right","label","onClick"]))]))}}),wx=Be(Ile,[["__scopeId","data-v-52b4dceb"]]),Nle={class:"format-card__header"},Rle={class:"format-card__header__text"},Fle={class:"format-card__header__text__label"},Vle={class:"format-card__header__text__desc"},zle={key:0,class:"format-card__options"},Hle=se({__name:"ExportDownloadFormatCard",props:{selected:{type:Boolean},icon:{},label:{},description:{},iconBg:{},iconColor:{}},emits:["select","download"],setup(t){return(e,n)=>(w(),R("div",{class:Te(["format-card",{"format-card--selected":t.selected}]),onClick:n[1]||(n[1]=o=>e.$emit("select"))},[A("div",Nle,[A("span",{class:"format-card__header__icon",style:Lt({background:t.iconBg,color:t.iconColor})},[(w(),Q(Rt(t.icon)))],4),A("div",Rle,[A("div",Fle,pe(t.label),1),A("div",Vle,pe(t.description),1)]),H(p(zn),{"icon-left":p(hO),label:"Download","hide-label":"",variant:"primary",size:"sm",square:"",onClick:n[0]||(n[0]=pn(o=>e.$emit("download"),["stop"]))},null,8,["icon-left"])]),t.selected&&e.$slots.default?(w(),R("div",zle,[Ce(e.$slots,"default",{},void 0,!0)])):oe("",!0)],2))}}),Wle=Be(Hle,[["__scopeId","data-v-f26129ef"]]);function oh(t,e){const n=URL.createObjectURL(t),o=document.createElement("a");o.href=n,o.download=e,o.click(),URL.revokeObjectURL(n)}function Ule(t,e="chart.svg"){const o=new XMLSerializer().serializeToString(t),r=new Blob([o],{type:"image/svg+xml;charset=utf-8"});oh(r,e)}function Gle(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}oh(h,o),l()},"image/png")},u.onerror=()=>{URL.revokeObjectURL(a),c(new Error("Failed to load SVG image"))},u.src=a})}function mO(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]&&mO(r[s],i[s])}function qle(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 Yle(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);mO(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,D)=>{const M=new Image;M.onload=()=>{const $=document.createElement("canvas");$.width=u,$.height=d;const L=$.getContext("2d");if(!L){URL.revokeObjectURL(_),D(new Error("Could not get canvas context"));return}L.drawImage(M,0,0,u,d),$.toBlob(E=>{if(URL.revokeObjectURL(_),!E){D(new Error("Could not create PNG blob"));return}oh(E,n),C()},"image/png")},M.onerror=()=>{URL.revokeObjectURL(_),D(new Error("Failed to render frame as image"))},M.src=_})}function t1(t){const e=globalThis.getComputedStyle(t);return{fontSize:parseFloat(e.fontSize),fontWeight:e.fontWeight,fontFamily:e.fontFamily,fill:e.color,fontStyle:e.fontStyle}}function gO(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 jle(t,e="chart.svg"){const n=t.querySelector("svg");if(!n)return;const o=t.getBoundingClientRect(),r=gO(t),i=new XMLSerializer,s=[],a=t.querySelectorAll(".bc-frame-title, .bc-frame-description");for(const M of a){const $=M.getBoundingClientRect(),L=t1(M);s.push({text:M.textContent??"",x:$.left-o.left,y:$.top-o.top+L.fontSize,...L})}const l=t.querySelector(".bc-frame-note");if(l&&l.textContent&&l.style.display!=="none"){const M=l.getBoundingClientRect(),$=t1(l);s.push({text:l.textContent,x:M.left-o.left,y:M.top-o.top+$.fontSize,...$})}const c=t.querySelectorAll(".bc-frame-byline, .bc-frame-source, .bc-frame-credit");for(const M of c){const $=M.getBoundingClientRect();if($.width===0)continue;const L=t1(M);s.push({text:M.textContent??"",x:$.left-o.left,y:$.top-o.top+L.fontSize,...L})}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=M=>M.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),_=s.map(M=>`<text x="${M.x}" y="${M.y}" font-size="${M.fontSize}px" font-weight="${M.fontWeight}" font-family="${x(M.fontFamily)}" fill="${M.fill}"${M.fontStyle&&M.fontStyle!=="normal"?` font-style="${M.fontStyle}"`:""}>${x(M.text)}</text>`).join(`
|
|
916
|
+
`),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(`
|
|
917
|
+
`),D=new Blob([C],{type:"image/svg+xml;charset=utf-8"});oh(D,e)}const Kle={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Xle(t,e){return w(),R("svg",Kle,[...e[0]||(e[0]=[A("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 Zle=Oe({name:"ph-image",render:Xle}),Qle={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Jle(t,e){return w(),R("svg",Qle,[...e[0]||(e[0]=[A("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 ece=Oe({name:"ph-file-code",render:Jle}),tce={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function nce(t,e){return w(),R("svg",tce,[...e[0]||(e[0]=[A("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 vO=Oe({name:"ph-file-text",render:nce}),oce={class:"export-download-panel"},rce=se({__name:"ExportDownloadPanel",emits:["download-png","download-svg"],setup(t,{emit:e}){const n=Ng(),{selectedFormat:o,pngScale:r,svgInlineFonts:i,svgMinify:s,bpcCompact:a}=Tt(n),{setSelectedFormat:l}=n,{dsl:c}=yc(),u=e;function d(){u("download-png",r.value)}function f(){u("download-svg")}function h(){oh(new globalThis.Blob([c.value],{type:"text/plain"}),"chart.bpc")}return(m,b)=>{const g=Wle,v=Xs;return w(),R("div",oce,[H(g,{selected:p(o)==="png",icon:p(Zle),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:J(()=>[H(p(Cr),{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(ece),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:J(()=>[H(v,{modelValue:p(i),"onUpdate:modelValue":b[2]||(b[2]=y=>Ze(i)?i.value=y:null),switch:""},{default:J(()=>[...b[7]||(b[7]=[He(" Inline fonts ",-1)])]),_:1},8,["modelValue"]),H(v,{modelValue:p(s),"onUpdate:modelValue":b[3]||(b[3]=y=>Ze(s)?s.value=y:null),switch:""},{default:J(()=>[...b[8]||(b[8]=[He(" Minify ",-1)])]),_:1},8,["modelValue"])]),_:1},8,["selected","icon"]),H(g,{selected:p(o)==="bpc",icon:p(vO),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:J(()=>[H(v,{modelValue:p(a),"onUpdate:modelValue":b[5]||(b[5]=y=>Ze(a)?a.value=y:null),switch:""},{default:J(()=>[...b[9]||(b[9]=[He(" Compact ",-1)])]),_:1},8,["modelValue"])]),_:1},8,["selected","icon"])])}}}),ice=Be(rce,[["__scopeId","data-v-f6670dcb"]]),sce={class:"export-embed-block"},ace={class:"export-embed-block__head"},lce={class:"form-label export-embed-block__label"},cce={key:0,class:"export-embed-block__badge"},uce={class:"export-embed-block__note"},dce={class:"export-embed-block__pre"},fce={class:"export-embed-block__actions"},hce=["href"],pce=se({__name:"ExportEmbedBlock",props:{label:{},note:{},snippet:{},permalink:{},copyEmbedLabel:{},recommended:{type:Boolean,default:!1},emphasis:{default:"secondary"}},setup(t){return(e,n)=>(w(),R("div",sce,[A("div",ace,[A("span",lce,pe(t.label),1),t.recommended?(w(),R("span",cce,"Recommended")):oe("",!0),n[0]||(n[0]=A("span",{class:"export-embed-block__spacer"},null,-1)),Ce(e.$slots,"header-action",{},void 0,!0)]),A("p",uce,pe(t.note),1),A("pre",dce,[A("code",null,pe(t.snippet),1)]),H(p(c8),{text:t.snippet,label:t.copyEmbedLabel,variant:t.emphasis==="primary"?"primary":"outline-secondary",size:"sm"},null,8,["text","label","variant"]),A("div",fce,[H(p(c8),{text:t.permalink,label:"Copy permalink",variant:"outline-secondary",size:"sm"},null,8,["text"]),A("a",{href:t.permalink,target:"_blank",rel:"noopener",class:"btn btn-outline-secondary btn-sm export-embed-block__open"},[H(p(wr),{name:p(vf),size:"sm"},null,8,["name"]),n[1]||(n[1]=He(" Open in new tab ",-1))],8,hce)])]))}}),Hh=Be(pce,[["__scopeId","data-v-0944efab"]]);function mce(){const{sessionId:t}=Pr(),{title:e,chartType:n}=dn(),{generateDsl:o}=yc(),{syncCloud:r,markCloudBacked:i}=dl(),s=Ne(!1);async function a(){if(!t.value)return!1;s.value=!0;try{const l=await r({id:t.value,dsl:o(),meta:Dg(t.value),title:e.value,chartType:n.value});return l&&i(l),!!l}finally{s.value=!1}}return{saving:s,saveToCloud:a}}const gce={class:"export-embed-panel"},vce=["disabled"],bce={class:"export-embed-panel__publish"},yce=["disabled"],xce={key:0,class:"export-embed-panel__hint"},wce="Whole chart baked into the URL. Works anywhere, no account needed.",Tk="Whole chart baked into the URL. Works anywhere with no account, but frozen, so later edits will not reach it.",_ce="Hosted at a short id. Edits you make later update this embed everywhere it is pasted.",kce="Publish to host this chart at a short id. The embed then updates everywhere whenever you edit.",Sce=se({__name:"ExportEmbedPanel",setup(t){const{dsl:e,generateDsl:n}=yc(),{layout:o}=dn(),{isSignedIn:r,openSignInModal:i}=fl(),{sessionId:s}=Pr(),{publish:a,isCloudBacked:l,isPublished:c}=dl(),{saving:u,saveToCloud:d}=mce(),f=S(()=>ms()&&r.value),h=Fe(!1),m=Fe(!1),b=Fe(!1),g=S(()=>ms()?r.value?h.value?m.value?"published":"not-published":"not-saved":"signed-out":"no-cloud");Ke([f,s],async([E,N],T,O)=>{let P=!1;O(()=>{P=!0});const B=E&&l(N);if(h.value=B,!B){m.value=!1;return}const V=await c(N);P||(m.value=V)},{immediate:!0});const v=S(()=>`${window.location.origin}${window.location.pathname}`),y=S(()=>{const E=Dt(o.value),N=E.heightMode==="fixed"?E.fixedHeight:400;return E.sizing==="responsive"?`width="100%" height="${N}"`:E.sizing==="max-width"?`style="width:100%;max-width:${E.maxWidth}px" height="${N}"`:`width="${E.fixedWidth}" height="${N}"`});function x(E){const N=new TextEncoder().encode(E);let T="";for(const O of N)T+=String.fromCharCode(O);return globalThis.btoa(T)}const _=S(()=>{const E=x(e.value||n());return`${v.value}#/render?bpc64=${encodeURIComponent(E)}`}),C=S(()=>`<iframe src="${_.value}" ${y.value} frameborder="0"></iframe>`),D=S(()=>`${v.value}#/render?id=${s.value}`),M=S(()=>`<iframe src="${D.value}" ${y.value} frameborder="0"></iframe>`);async function $(){b.value=!0,await a(s.value,!m.value)&&(m.value=!m.value),b.value=!1}async function L(){await d()&&(h.value=!0,m.value=!1)}return(E,N)=>(w(),R("div",gce,[p(g)==="published"?(w(),R(Re,{key:0},[H(Hh,{label:"Live link",recommended:"",emphasis:"primary",note:_ce,snippet:p(M),permalink:p(D),"copy-embed-label":"Copy live embed"},{"header-action":J(()=>[A("button",{type:"button",class:"btn btn-sm export-embed-panel__unpublish",disabled:p(b),onClick:$},pe(p(b)?"…":"Unpublish"),9,vce)]),_:1},8,["snippet","permalink"]),N[1]||(N[1]=A("hr",null,null,-1)),H(Hh,{label:"Or use a self-contained copy",note:Tk,snippet:p(C),permalink:p(_),"copy-embed-label":"Copy self-contained embed"},null,8,["snippet","permalink"])],64)):p(g)==="not-published"?(w(),R(Re,{key:1},[A("div",bce,[N[2]||(N[2]=A("div",{class:"export-embed-panel__publish-head"},[A("span",{class:"form-label export-embed-panel__label"},"Live link"),A("span",{class:"export-embed-panel__badge"},"Recommended")],-1)),A("p",{class:"export-embed-panel__note"},pe(kce)),A("button",{type:"button",class:"btn btn-primary btn-sm",disabled:p(b),onClick:$},pe(p(b)?"…":"Publish live link"),9,yce)]),N[3]||(N[3]=A("hr",null,null,-1)),H(Hh,{label:"Or use a self-contained copy",note:Tk,snippet:p(C),permalink:p(_),"copy-embed-label":"Copy self-contained embed"},null,8,["snippet","permalink"])],64)):(w(),R(Re,{key:2},[H(Hh,{label:"Embed code",emphasis:"primary",note:wce,snippet:p(C),permalink:p(_),"copy-embed-label":"Copy embed code"},null,8,["snippet","permalink"]),p(g)!=="no-cloud"?(w(),R("p",xce,[p(g)==="signed-out"?(w(),R(Re,{key:0},[N[4]||(N[4]=He(" Want an embed that updates when you edit it? ",-1)),A("button",{type:"button",onClick:N[0]||(N[0]=(...T)=>p(i)&&p(i)(...T))}," Sign in "),N[5]||(N[5]=He(" to publish a live link. ",-1))],64)):(w(),R(Re,{key:1},[N[6]||(N[6]=He(" Want an embed that updates when you edit it? ",-1)),A("button",{type:"button",onClick:L},pe(p(u)?"Saving…":"Save this chart"),1),N[7]||(N[7]=He(" to publish a live link. ",-1))],64))])):oe("",!0)],64))]))}}),Cce=Be(Sce,[["__scopeId","data-v-870dff8a"]]),Ace=["onClick"],$ce=se({__name:"PanelTabBar",props:lt({tabs:{},sticky:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=mt(t,"modelValue"),n=bt("tabsRef");let o=null;function r(){kn(()=>{o!=null&&o.scrollIntoView&&n.value&&o.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})})}return Ke(()=>o,r),(i,s)=>(w(),R("div",{ref_key:"tabsRef",ref:n,class:Te(["panel-tab-bar",{"panel-tab-bar--sticky":t.sticky}])},[(w(!0),R(Re,null,vt(t.tabs,a=>(w(),R("button",{key:a.key,ref_for:!0,ref:l=>{a.key===e.value&&(Ze(o)?o.value=l:o=l)},class:Te(["panel-tab-bar__tab",{"panel-tab-bar__tab--active":e.value===a.key}]),onClick:l=>e.value=a.key},[a.icon?(w(),Q(Rt(a.icon),{key:0,class:"panel-tab-bar__tab__icon","aria-hidden":"true"})):oe("",!0),He(" "+pe(a.label),1)],10,Ace))),128))],2))}}),_x=Be($ce,[["__scopeId","data-v-1a1009cc"]]),Tce=se({__name:"CanvasModePickerOptionSwatch",props:{mode:{}},setup(t){return(e,n)=>(w(),R("span",{class:Te(["canvas-mode-swatch",`canvas-mode-swatch--${t.mode}`])},null,2))}}),bO=Be(Tce,[["__scopeId","data-v-81dabc6c"]]),Oce=Qn("editorPanel",()=>{const t=Ne("type"),e=Ne("preview"),n=Ne("blueprint"),o=Ne(!0),r=Ne(null),i=Ne("upload"),s=Ne(""),a=Ne(!1),l=Ne(-1),c=Ne("type"),u=Ne("column");function d($){t.value=$}function f($){r.value=$,d("annotate")}function h($){e.value=$}function m($){n.value=$}function b($){i.value=$,$==="structure"&&v("column")}function g($){s.value=$}function v($){s.value=$,a.value=!0}function y(){a.value=!1,s.value=""}function x(){a.value=!a.value}function _($){if(l.value===$){l.value=-1;return}l.value=$,v("column")}function C($){c.value=$}function D($){u.value=$}function M(){t.value="type",e.value="preview",n.value="blueprint",o.value=!0,r.value=null,i.value="upload",s.value="",a.value=!1,l.value=-1,c.value="type",u.value="column"}return{activeTab:t,viewMode:e,canvasMode:n,showDimensions:o,pendingAnnotationIndex:r,dataView:i,dataPanelTab:s,dataPanelOpen:a,selectedColumnIndex:l,lastNarrowEditTab:c,lastNarrowDataTab:u,selectTab:d,selectAnnotation:f,setViewMode:h,setCanvasMode:m,setDataView:b,setDataPanelTab:g,openDataPanel:v,closeDataPanel:y,toggleDataPanel:x,selectColumn:_,setLastNarrowEditTab:C,setLastNarrowDataTab:D,reset:M}});function pr(){const t=Oce(),{activeTab:e,viewMode:n,canvasMode:o,showDimensions:r,pendingAnnotationIndex:i,dataView:s,dataPanelTab:a,dataPanelOpen:l,selectedColumnIndex:c,lastNarrowEditTab:u,lastNarrowDataTab:d}=Tt(t);return{activeTab:e,viewMode:n,canvasMode:o,showDimensions:r,pendingAnnotationIndex:i,dataView:s,dataPanelTab:a,dataPanelOpen:l,selectedColumnIndex:c,lastNarrowEditTab:u,lastNarrowDataTab:d,selectTab:t.selectTab,selectAnnotation:t.selectAnnotation,setViewMode:t.setViewMode,setCanvasMode:t.setCanvasMode,setDataView:t.setDataView,setDataPanelTab:t.setDataPanelTab,openDataPanel:t.openDataPanel,closeDataPanel:t.closeDataPanel,toggleDataPanel:t.toggleDataPanel,selectColumn:t.selectColumn,setLastNarrowEditTab:t.setLastNarrowEditTab,setLastNarrowDataTab:t.setLastNarrowDataTab,reset:t.reset}}const Mce={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Bce(t,e){return w(),R("svg",Mce,[...e[0]||(e[0]=[A("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 Lce=Oe({name:"ph-ruler",render:Bce}),Pce=se({__name:"CanvasDimensionsToggle",setup(t){const{showDimensions:e}=Tt(pr());return(n,o)=>(w(),R("button",{class:Te(["canvas-dimensions-toggle",{"canvas-dimensions-toggle--active":p(e)}]),title:"Show dimensions",onClick:o[0]||(o[0]=r=>e.value=!p(e))},[H(p(Lce))],2))}}),Dce=Be(Pce,[["__scopeId","data-v-0920c699"]]),Ece=["title"],Ice={class:"canvas-mode-picker-option__label"},Nce=se({__name:"CanvasModePickerOption",props:{mode:{},label:{},active:{type:Boolean}},emits:["select"],setup(t){return(e,n)=>{const o=bO;return w(),R("button",{class:Te(["canvas-mode-picker-option",{"canvas-mode-picker-option--active":t.active}]),title:t.label,onClick:n[0]||(n[0]=r=>e.$emit("select"))},[H(o,{mode:t.mode},null,8,["mode"]),A("span",Ice,pe(t.label),1)],10,Ece)}}}),Rce=Be(Nce,[["__scopeId","data-v-b7a042b3"]]),Fce={class:"canvas-mode-picker__extra"},Vce=se({__name:"CanvasModePicker",setup(t){const e=pr(),{canvasMode:n}=Tt(e),{setCanvasMode:o}=e,r=Ne(!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=Rce,u=Dce,d=bO;return w(),R("div",{class:"canvas-mode-picker",onMouseenter:l[1]||(l[1]=f=>r.value=!0),onMouseleave:l[2]||(l[2]=f=>r.value=!1)},[p(r)?(w(),R(Re,{key:0},[(w(),R(Re,null,vt(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[4]||(l[4]=A("div",{class:"canvas-mode-picker__divider"},null,-1)),A("div",Fce,[H(u),l[3]||(l[3]=A("span",{class:"canvas-mode-picker__extra__label"},"Dims",-1))])],64)):(w(),R("button",{key:1,class:"canvas-mode-picker__trigger",title:"Canvas mode","aria-label":"Canvas mode","aria-haspopup":"true","aria-expanded":"false",onClick:l[0]||(l[0]=f=>r.value=!0)},[H(d,{mode:p(n)},null,8,["mode"])]))],32)}}}),yO=Be(Vce,[["__scopeId","data-v-0f6326fe"]]),zce={transform:"translate(0.5, 0.5)"},Hce={class:"canvas-dimensions__line"},Wce=["x1","y1","x2","y2"],Uce=["x1","y1","x2","y2"],Gce=["x1","y1","x2","y2"],qce=["x","y"],Yce={class:"canvas-dimensions__line"},jce=["x1","y1","x2","y2"],Kce=["x1","y1","x2","y2"],Xce=["x1","y1","x2","y2"],Zce=["x","y"],Qce={class:"canvas-dimensions__line canvas-dimensions__line--padding"},Jce=["x1","y1","x2","y2"],eue=["x1","y1","x2","y2"],tue=["x1","y1","x2","y2"],nue=["x","y"],oue=["x1","y1","x2","y2"],rue=["x1","y1","x2","y2"],iue=["x1","y1","x2","y2"],sue=["x","y"],aue={class:"canvas-dimensions__line canvas-dimensions__line--padding"},lue=["x1","y1","x2","y2"],cue=["x1","y1","x2","y2"],uue=["x1","y1","x2","y2"],due=["x","y"],fue=["x1","y1","x2","y2"],hue=["x1","y1","x2","y2"],pue=["x1","y1","x2","y2"],mue=["x","y"],Ok=20,tn=3,Wh=4,Mk=20,gue=se({__name:"CanvasDimensions",props:{cardRef:{},canvasRef:{},layout:{}},setup(t){const e=t,n=Fe(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}}ps(()=>e.canvasRef,o),ps(()=>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+Ok}}),s=S(()=>{const v=n.value;return{x:v.left-Ok,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+Wh,x2:v.x2-y-Wh}:{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+Wh,y2:v.y2-y-Wh}:{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+Mk),m=S(()=>s.value.x-Mk),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:Lt(p(r))},[A("g",zce,[A("g",Hce,[A("line",{x1:p(a).x1,y1:p(i).y,x2:p(a).x2,y2:p(i).y},null,8,Wce),A("line",{x1:p(a).x1,y1:p(i).y-tn,x2:p(a).x1,y2:p(i).y+tn},null,8,Uce),A("line",{x1:p(a).x2,y1:p(i).y-tn,x2:p(a).x2,y2:p(i).y+tn},null,8,Gce),A("text",{x:(p(i).x1+p(i).x2)/2,y:p(i).y+tn+12,"text-anchor":"middle"},pe(p(b)),9,qce)]),A("g",Yce,[A("line",{x1:p(s).x,y1:p(l).y1,x2:p(s).x,y2:p(l).y2},null,8,jce),A("line",{x1:p(s).x-tn,y1:p(l).y1,x2:p(s).x+tn,y2:p(l).y1},null,8,Kce),A("line",{x1:p(s).x-tn,y1:p(l).y2,x2:p(s).x+tn,y2:p(l).y2},null,8,Xce),A("text",{x:p(s).x-5,y:(p(s).y1+p(s).y2)/2,"text-anchor":"end","dominant-baseline":"central"},pe(p(g)),9,Zce)]),p(d)?(w(),R(Re,{key:0},[A("g",Qce,[A("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,Jce),A("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,eue),A("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,tue),A("text",{x:p(i).x1+t.layout.padding/2,y:(p(c)?p(h):p(i).y)+tn+12,"text-anchor":"middle"},pe(p(f)),9,nue),A("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,oue),A("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,rue),A("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,iue),A("text",{x:p(i).x2-t.layout.padding/2,y:(p(c)?p(h):p(i).y)+tn+12,"text-anchor":"middle"},pe(p(f)),9,sue)]),A("g",aue,[A("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,lue),A("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,cue),A("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,uue),A("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"},pe(p(f)),9,due),A("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,fue),A("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,hue),A("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,pue),A("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"},pe(p(f)),9,mue)])],64)):oe("",!0)])],4)):oe("",!0)}}),xO=Be(gue,[["__scopeId","data-v-394e6d5d"]]);function vue(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 kx(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=vue(i.aspectRatio);a&&(s.aspectRatio=String(a))}return s});return{cardClass:o,cardStyle:r,hasConstrainedHeight:n}}function bue(t,e){t.replaceChildren();const n=document.createElement("div");n.className="text-center text-muted p-5",n.textContent=e,t.appendChild(n)}const yue=150;function Sx(t){const e=dn(),{currentOptions:n}=Cn(),{scenes:o,activeIndex:r,activeScene:i}=Sn(),{columns:s,rows:a,columnTypes:l}=er(),{applyStepList:c}=Rr(),{theme:u}=Yf(),{chartTheme:d}=GT(),f=Symbol("unset");let h=f,m=!1;function b(){if(!(!t.value||m)){m=!0;try{g()}finally{m=!1}}}function g(){var le;if(!t.value)return;const _=i.value,C=Ka(o.value,r.value),D=(C==null?void 0:C.chartType)??e.chartType.value;let M;if((C==null?void 0:C.data)!==void 0)M=C.data;else if((le=C==null?void 0:C.transforms)!=null&&le.length&&s.value.length>0){const fe=c(C.transforms,s.value,a.value,l.value);M=Lg(fe.columns,fe.rows)}else M=e.data.value;const $=ks(M),L=[Ve.BarVertical,Ve.BarHorizontal,Ve.Line,Ve.VerticalBar,Ve.HorizontalBar];if($.series&&$.series.length>0&&L.includes(D)){const fe=$.series.find(we=>we.name===e.selectedColumn.value);fe&&($.values=fe.values),delete $.series}if($.labels.length===0){bue(t.value,"No data to preview");return}const E=n.value.allowDarkMode??!0,N=t.value.parentElement;N&&(!E&&u.value!=="light"?N.setAttribute("data-bs-theme","light"):N.removeAttribute("data-bs-theme"));const T=h!==f&&_!==h,O=C!=null&&C.chartTypeOptions?{...n.value,...C.chartTypeOptions}:n.value,P=(C==null?void 0:C.colorizes)??e.colorizes.value,B=C?C.highlights??[]:e._base.highlights.value,V=(C==null?void 0:C.areaFills)??e.areaFills.value,z=e._base.annotations.value,G=(C==null?void 0:C.annotations)??[],K=[...z,...G],ne=C!=null&&C.hiddenAnnotationIds?K.filter(fe=>!fe.id||!C.hiddenAnnotationIds.has(fe.id)):K,ae=(C==null?void 0:C.seriesOverrides)??e.seriesOverrides.value,he=C==null?void 0:C.properties,ge={title:(he==null?void 0:he.title)??(e.title.value||void 0),description:(he==null?void 0:he.description)??(e.description.value||void 0),byline:e.byline.value||void 0,note:e.note.value||void 0,source:(he==null?void 0:he.source)??(e.source.value||void 0),sourceUrl:(he==null?void 0:he.sourceUrl)??(e.sourceUrl.value||void 0),padding:`${e.layout.value.padding}px`,transparentBackground:e.layout.value.transparentBackground||void 0};ax(t.value,{chartType:D,data:$,options:O,frame:ge,colorizes:P,highlights:B,areaFills:V,annotations:ne,seriesOverrides:ae,sort:WT(C)??e.sort.value,sortMode:e.sortMode.value!=="none"?e.sortMode.value:void 0,theme:d.value},{transition:T,ignoreLayout:!0}),h=_}ps(t,_R(b,yue));const y=S(()=>JSON.stringify(e.layout.value)),x=S(()=>JSON.stringify(n.value));return Ke([t,e.chartType,e.title,e.data,e.sort,e.sortMode,e.description,e.byline,e.note,e.source,e.sourceUrl,e.selectedColumn,e.colorizes,e.highlights,e.areaFills,e.annotations,e.seriesOverrides,y,x,o,i,u,d],b,{immediate:!0,flush:"post"}),{config:e}}function xue(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){jle(s);return}const a=n();a&&Ule(a)}async function i(s=2){const a=o();if(a){const d=e!=null&&e.value?gO(e.value):void 0,f=e!=null&&e.value?qle(e.value):void 0;await Yle(a,s,"chart.png",d,f);return}const l=n();if(!l)return;const{width:c,height:u}=l.getBoundingClientRect();await Gle(l,c*s,u*s)}return{downloadSvg:r,downloadPng:i}}const wue=se({__name:"ExportPanel",setup(t){const e=pr(),{canvasMode:n,showDimensions:o}=Tt(e),{setViewMode:r}=e,{mode:i}=xc();r("preview");const s=Ng(),{exportTab:a}=Tt(s),{setExportTab:l,setLastNarrowExportTab:c}=s,{isNarrow:u}=Yr();Ke(i,B=>{B==="drawer"&&a.value&&(c(a.value),l(""))},{immediate:!0});const{layout:d}=dn(),{cardClass:f,cardStyle:h}=kx(d,"export-panel__canvas__card"),m=bt("canvasRef"),b=bt("cardRef"),g=bt("previewRef");Sx(g);const{downloadSvg:v,downloadPng:y}=xue(g,b),x=Ne(0),_=Ne(0);let C=0;function D(){globalThis.cancelAnimationFrame(C),C=globalThis.requestAnimationFrame(()=>{const B=b.value;if(B){const V=B.offsetLeft,z=B.offsetTop;(V!==x.value||z!==_.value)&&(x.value=V,_.value=z)}})}ps(m,D),ps(b,D);const M=S(()=>({"--grid-offset-x":`${x.value}px`,"--grid-offset-y":`${_.value}px`})),{lastNarrowExportTab:$}=Tt(s),L=S({get:()=>!!a.value,set:B=>{l(B?$.value:"")}});function E(B){c(B),l(B)}const{sections:N}=pO(),T={embed:"Embed",download:"Download"},O=S(()=>T[a.value]??"Export"),P=S(()=>({[`export-panel__canvas--${n.value}`]:n.value!=="blueprint"}));return(B,V)=>{const z=xO,G=yO,K=_x,ne=Cce,ae=ice,he=wx,ge=Eg,le=Lle;return w(),R("div",{class:Te(["export-panel",{"export-panel--narrow":p(u)}])},[A("div",{ref_key:"canvasRef",ref:m,class:Te(["export-panel__canvas",p(P)]),style:Lt(p(M))},[A("div",{ref_key:"cardRef",ref:b,class:Te(["export-panel__canvas__card",p(f)]),style:Lt(p(h))},[A("div",{ref_key:"previewRef",ref:g,class:"export-panel__canvas__preview w-100 h-100"},null,512)],6),p(o)?(w(),Q(z,{key:0,"card-ref":p(b),"canvas-ref":p(m),layout:p(d)},null,8,["card-ref","canvas-ref","layout"])):oe("",!0),H(G)],6),H(ge,{"drawer-open":p(L),"onUpdate:drawerOpen":V[0]||(V[0]=fe=>Ze(L)?L.value=fe:null),title:p(O),"container-ref":p(m)},$i({default:J(()=>[p(a)==="embed"?(w(),Q(ne,{key:0})):p(a)==="download"?(w(),Q(ae,{key:1,onDownloadPng:p(y),onDownloadSvg:p(v)},null,8,["onDownloadPng","onDownloadSvg"])):oe("",!0)]),_:2},[p(i)==="drawer"?{name:"tabs",fn:J(()=>[H(K,{tabs:p(N),"model-value":p(a),sticky:"","onUpdate:modelValue":E},null,8,["tabs","model-value"])]),key:"0"}:void 0,p(i)!=="drawer"?{name:"footer",fn:J(()=>[H(he)]),key:"1"}:void 0]),1032,["drawer-open","title","container-ref"]),p(u)?oe("",!0):(w(),Q(le,{key:0}))],2)}}}),_ue=Be(wue,[["__scopeId","data-v-6f293e9b"]]),kue={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Sue(t,e){return w(),R("svg",kue,[...e[0]||(e[0]=[A("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 wO=Oe({name:"ph-text-aa",render:Sue}),Cue={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Aue(t,e){return w(),R("svg",Cue,[...e[0]||(e[0]=[A("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 _O=Oe({name:"ph-palette",render:Aue}),$ue={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Tue(t,e){return w(),R("svg",$ue,[...e[0]||(e[0]=[A("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 Oue=Oe({name:"ph-puzzle-piece",render:Tue}),Mue={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Bue(t,e){return w(),R("svg",Mue,[...e[0]||(e[0]=[A("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 Lue=Oe({name:"ph-waves",render:Bue}),Pue={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Due(t,e){return w(),R("svg",Pue,[...e[0]||(e[0]=[A("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 Eue=Oe({name:"ph-vector-two",render:Due}),Iue={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Nue(t,e){return w(),R("svg",Iue,[...e[0]||(e[0]=[A("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 Rue=Oe({name:"ph-push-pin",render:Nue}),Fue=["showVerticalAxis","verticalAxisDirection","showVerticalTicks","verticalLabelPosition","verticalGridStyle","verticalNumberFormat","verticalScaleType","verticalRangeMin","verticalRangeMax","showHorizontalAxis","showHorizontalTicks","horizontalLabelPosition","horizontalGridStyle","horizontalNumberFormat","horizontalScaleType","horizontalRangeMin","horizontalRangeMax"];function kO(){const{chartType:t}=dn(),{availableOptionKeys:e}=Cn(),{scenes:n}=Sn(),o=S(()=>e.value.some(s=>Fue.includes(s))),r=S(()=>e.value.includes("tooltips")||e.value.includes("crosshair")||n.value.length>=1);return{sections:S(()=>{const s=[{key:"type",label:"Type",icon:Gs,tooltip:"Chart Type"},{key:"text",label:"Text",icon:wO},{key:"style",label:"Style",icon:_O}];return["line-multi","bar-multi","bar-split"].includes(t.value)&&s.push({key:"series",label:"Series",icon:Lue}),o.value&&s.push({key:"axes",label:"Axes",icon:Eue}),s.push({key:"layout",label:"Layout",icon:Oue}),s.push({key:"annotate",label:"Annotate",icon:Rue}),r.value&&s.push({key:"interactions",label:"Interactions",icon:cO}),s})}}const Vue=se({__name:"ChartEditIconRail",setup(t){const e=pr(),{activeTab:n}=Tt(e),{selectTab:o}=e,{toggleMode:r}=xc(),{sections:i}=kO(),s=S(()=>i.value.map(a=>({value:a.key,icon:a.icon,tooltip:a.tooltip??a.label})));return(a,l)=>{const c=yx;return w(),Q(c,{"active-tab":p(n),items:p(s),onSelect:p(o),onToggleMode:p(r)},null,8,["active-tab","items","onSelect","onToggleMode"])}}}),zue={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Hue(t,e){return w(),R("svg",zue,[...e[0]||(e[0]=[A("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 Wue=Oe({name:"ph-arrows-out-cardinal",render:Hue}),Uue={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Gue(t,e){return w(),R("svg",Uue,[...e[0]||(e[0]=[A("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 SO=Oe({name:"ph-arrows-vertical",render:Gue}),que={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Yue(t,e){return w(),R("svg",que,[...e[0]||(e[0]=[A("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 CO=Oe({name:"ph-arrows-horizontal",render:Yue}),jue={viewBox:"0 0 20 20",width:"1.2em",height:"1.2em"};function Kue(t,e){return w(),R("svg",jue,[...e[0]||(e[0]=[A("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 Cx=Oe({name:"fluent-line-horizontal-1-20-filled",render:Kue}),Xue={viewBox:"0 0 20 20",width:"1.2em",height:"1.2em"};function Zue(t,e){return w(),R("svg",Xue,[...e[0]||(e[0]=[A("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 AO=Oe({name:"fluent-line-horizontal-1-dashes-20-filled",render:Zue}),Que={viewBox:"0 0 20 20",width:"1.2em",height:"1.2em"};function Jue(t,e){return w(),R("svg",Que,[...e[0]||(e[0]=[A("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 $O=Oe({name:"fluent-line-horizontal-1-dot-20-filled",render:Jue}),ede={class:"d-flex flex-column gap-3"},tde=se({__name:"EditorInteractionSection",setup(t){const{currentOptions:e,availableOptionKeys:n,setOption:o}=Cn(),{layout:r}=dn(),{scenes:i}=Sn(),s=S(()=>n.value.includes("tooltips")),a=S(()=>n.value.includes("crosshair")),l=S(()=>i.value.length>=1),c=[{value:"both",text:"Both",icon:Wue},{value:"vertical",text:"Vertical",icon:SO},{value:"horizontal",text:"Horizontal",icon:CO}],u=[{value:"solid",text:"Solid",icon:Cx},{value:"dashed",text:"Dashed",icon:AO},{value:"dotted",text:"Dotted",icon:$O}],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",ede,[p(s)?(w(),Q(p(on),{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"])):oe("",!0),p(a)?(w(),Q(p(on),{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"])):oe("",!0),p(a)&&p(e).crosshair?(w(),R(Re,{key:2},[H(p($n),{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($n),{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(Ua),{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)):oe("",!0),p(l)?(w(),R(Re,{key:3},[H(p(Rn),{id:"layout-player-type",modelValue:p(d),"onUpdate:modelValue":g[5]||(g[5]=v=>Ze(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(),Q(p($n),{key:0,modelValue:p(f),"onUpdate:modelValue":g[6]||(g[6]=v=>Ze(f)?f.value=v:null),label:"Player position",options:m,block:""},null,8,["modelValue"])):oe("",!0)],64)):oe("",!0)]))}}),nde={},ode={class:"d-flex flex-column gap-3"};function rde(t,e){const n=tde;return w(),R("div",ode,[H(n)])}const ide=Be(nde,[["render",rde]]),sde={class:"border rounded overflow-hidden bg-body-tertiary"},ade={class:"d-flex align-items-center justify-content-between px-2 py-1 border-bottom"},lde={class:"fw-medium"},cde={class:"p-2 d-flex flex-column gap-2"},ude={class:"d-flex align-items-center gap-2"},dde={class:"text-nowrap",style:{width:"3em"}},fde=se({__name:"EditorAreaFillItem",props:lt({id:{},seriesNames:{}},{fill:{required:!0},fillModifiers:{}}),emits:lt(["remove"],["update:fill"]),setup(t){const e=t,n=mt(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=qo,c=nl,u=Mn,d=da,f=Xs;return w(),R("div",sde,[A("div",ade,[A("small",lde,pe(n.value.from)+" – "+pe(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:J(()=>[...a[8]||(a[8]=[A("span",{"aria-hidden":"true"},"×",-1)])]),_:1})]),A("div",cde,[H(u,{label:"From","label-for":`af-from-${t.id}`},{default:J(()=>[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:J(()=>[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:J(()=>[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:J(()=>[H(f,{"model-value":!!n.value.negativeColor,switch:"","onUpdate:modelValue":a[4]||(a[4]=h=>i("negativeColor",h?"#f28e2b":void 0))},{default:J(()=>[...a[9]||(a[9]=[He(" Use different color for negative differences ",-1)])]),_:1},8,["model-value"])]),_:1}),n.value.negativeColor?(w(),Q(u,{key:0,label:"Negative color","label-for":`af-neg-color-${t.id}`},{default:J(()=>[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"])):oe("",!0),H(u,{label:"Opacity","label-for":`af-opacity-${t.id}`},{default:J(()=>[A("div",ude,[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"]),A("small",dde,pe(n.value.opacity??30)+"%",1)])]),_:1},8,["label-for"]),H(u,{label:"Interpolation","label-for":`af-interp-${t.id}`},{default:J(()=>[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"])])])}}}),hde={class:"d-flex flex-column gap-2"},pde=se({__name:"EditorAreaFills",props:lt({seriesNames:{},seriesOverrides:{},globalInterpolation:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=mt(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=K2(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=fde;return w(),R(Re,null,[A("div",hde,[(w(!0),R(Re,null,vt(p(o),(u,d)=>(w(),Q(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(Rl),{label:"Add",onClick:i})],64)}}}),mde={class:"d-flex flex-column gap-3"},gde=se({__name:"EditorHighlightSection",setup(t){const{chartType:e,data:n,highlights:o}=dn(),r=S(()=>ks(n.value)),i=S(()=>[Ve.LineMulti,Ve.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=Ne(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",mde,[H(p(on),{"model-value":p(a),label:"Highlight specific items","onUpdate:modelValue":c},null,8,["model-value"]),p(a)?(w(),Q(p(p2),{key:0,selected:p(l),"onUpdate:selected":d[0]||(d[0]=f=>Ze(l)?l.value=f:null),items:p(s)},null,8,["selected","items"])):oe("",!0)]))}}),vde=Qn("previewContainer",()=>({containerRef:Fe(null)}));function TO(){const t=vde();return Tt(t)}const bde={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function yde(t,e){return w(),R("svg",bde,[...e[0]||(e[0]=[A("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 xde=Oe({name:"ph-drop-half",render:yde}),wde={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function _de(t,e){return w(),R("svg",wde,[...e[0]||(e[0]=[A("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 kde=Oe({name:"ph-highlighter-circle",render:_de}),Sde={class:"d-flex flex-column gap-2"},Cde={class:"d-flex gap-2"},Ade=se({__name:"EditorAnnotationFree",props:lt({chartWidth:{},chartHeight:{}},{annotation:{required:!0},annotationModifiers:{}}),emits:["update:annotation"],setup(t){const e=mt(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=Fe(null);return vn(()=>{var a;const s=(a=i.value)==null?void 0:a.$el;s&&(s.focus(),s.select())}),(s,a)=>{const l=Ky,c=Mn;return w(),R("div",Sde,[H(c,{label:"Text"},{default:J(()=>[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}),A("div",Cde,[H(p(hp),{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(hp),{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(Ua),{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(on),{"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(hp),{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"])])}}}),$de={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Tde(t,e){return w(),R("svg",$de,[...e[0]||(e[0]=[A("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 Of=Oe({name:"ph-align-left",render:Tde}),Ode={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Mde(t,e){return w(),R("svg",Ode,[...e[0]||(e[0]=[A("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 I0=Oe({name:"ph-align-center-horizontal",render:Mde}),Bde={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Lde(t,e){return w(),R("svg",Bde,[...e[0]||(e[0]=[A("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 Mf=Oe({name:"ph-align-right",render:Lde}),Pde={class:"d-flex flex-column gap-2"},Dde={class:"d-flex gap-2"},Ede={key:0,class:"d-flex gap-2"},Ide=se({__name:"EditorAnnotationRange",props:lt({labels:{}},{annotation:{required:!0},annotationModifiers:{}}),emits:["update:annotation"],setup(t){const e=t,n=mt(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=Fe(null);return vn(()=>{var c;const l=(c=a.value)==null?void 0:c.$el;l&&(l.focus(),l.select())}),(l,c)=>{const u=da,d=Mn,f=nl;return w(),R("div",Pde,[H(d,{label:"Text"},{default:J(()=>[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:J(()=>[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}),A("div",Dde,[H(d,{label:"Start",class:"flex-fill"},{default:J(()=>[p(r)?(w(),Q(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(),Q(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:J(()=>[p(r)?(w(),Q(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(),Q(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",Ede,[H(p(Rn),{id:`ann-range-start-anchor-${l.$.uid}`,"model-value":n.value.startAnchor??"center",label:"Start anchor","light-label":"",block:"",class:"flex-fill","onUpdate:modelValue":c[6]||(c[6]=h=>s("startAnchor",h))},{default:J(()=>[H(p($c),{value:"start",label:"Start"},{icon:J(()=>[H(p(Of))]),_:1}),H(p($c),{value:"center",label:"Center"},{icon:J(()=>[H(p(I0))]),_:1}),H(p($c),{value:"end",label:"End"},{icon:J(()=>[H(p(Mf))]),_:1})]),_:1},8,["id","model-value"]),H(p(Rn),{id:`ann-range-end-anchor-${l.$.uid}`,"model-value":n.value.endAnchor??"center",label:"End anchor","light-label":"",block:"",class:"flex-fill","onUpdate:modelValue":c[7]||(c[7]=h=>s("endAnchor",h))},{default:J(()=>[H(p($c),{value:"start",label:"Start"},{icon:J(()=>[H(p(Of))]),_:1}),H(p($c),{value:"center",label:"Center"},{icon:J(()=>[H(p(I0))]),_:1}),H(p($c),{value:"end",label:"End"},{icon:J(()=>[H(p(Mf))]),_:1})]),_:1},8,["id","model-value"])])):oe("",!0),H(p(Ua),{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(Cr),{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(Re,{key:1},[H(p(Ua),{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(aA),{"model-value":n.value.direction??"center",label:"Direction","onUpdate:modelValue":c[11]||(c[11]=h=>s("direction",h))},null,8,["model-value"])],64)):oe("",!0)])}}}),Nde={viewBox:"0 0 20 20",width:"1.2em",height:"1.2em"};function Rde(t,e){return w(),R("svg",Nde,[...e[0]||(e[0]=[A("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 Fde=Oe({name:"fluent-arrow-hook-up-left-20-filled",render:Rde}),Vde={viewBox:"0 0 20 20",width:"1.2em",height:"1.2em"};function zde(t,e){return w(),R("svg",Vde,[...e[0]||(e[0]=[A("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 Hde=Oe({name:"fluent-arrow-hook-up-right-20-filled",render:zde}),Wde={viewBox:"0 0 20 20",width:"1.2em",height:"1.2em"};function Ude(t,e){return w(),R("svg",Wde,[...e[0]||(e[0]=[A("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 Gde=Oe({name:"fluent-arrow-turn-right-down-20-filled",render:Ude}),qde={class:"d-flex flex-column gap-2"},Yde={class:"d-flex flex-column gap-2 mt-2"},jde={class:"d-flex flex-column gap-2 mt-2"},Kde=se({__name:"EditorAnnotationPoint",props:lt({labels:{},chartWidth:{}},{annotation:{required:!0},annotationModifiers:{}}),emits:["update:annotation"],setup(t){const e=t,n=mt(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=Fe(null);return vn(()=>{var c;const l=(c=a.value)==null?void 0:c.$el;l&&(l.focus(),l.select())}),(l,c)=>{const u=Ky,d=Mn,f=nl,h=da,m=Xs;return w(),R("div",qde,[H(d,{label:"Text"},{default:J(()=>[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:J(()=>[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(Ua),{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(on),{"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(hp),{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(on),{"model-value":n.value.showLine??!0,label:"Show line","onUpdate:modelValue":c[10]||(c[10]=b=>s("showLine",b))},$i({_:2},[n.value.showLine?{name:"section",fn:J(()=>[A("div",Yde,[H(p($n),{"model-value":n.value.lineStyle??"direct",label:"Line style",block:"","onUpdate:modelValue":c[5]||(c[5]=b=>s("lineStyle",b))},{default:J(()=>[H(p(wh),{value:"direct",text:"Direct","icon-left":p(Cx)},null,8,["icon-left"]),H(p(wh),{value:"curve-left",text:"Curve left","icon-left":p(Fde)},null,8,["icon-left"]),H(p(wh),{value:"curve-right",text:"Curve right","icon-left":p(Hde)},null,8,["icon-left"]),H(p(wh),{value:"elbow",text:"Elbow","icon-left":p(Gde)},null,8,["icon-left"])]),_:1},8,["model-value"]),H(d,{label:"Line weight"},{default:J(()=>[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(aA),{"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:J(()=>[H(m,{"model-value":n.value.showArrow??!0,switch:"","onUpdate:modelValue":c[8]||(c[8]=b=>s("showArrow",b))},{default:J(()=>[...c[14]||(c[14]=[He(" Show arrow ",-1)])]),_:1},8,["model-value"])]),_:1}),H(d,{label:"Line target distance"},{default:J(()=>[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(on),{"model-value":n.value.showCircle??!1,label:"Show circle","onUpdate:modelValue":c[13]||(c[13]=b=>s("showCircle",b))},$i({_:2},[n.value.showCircle?{name:"section",fn:J(()=>[A("div",jde,[H(d,{label:"Circle size"},{default:J(()=>[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:J(()=>[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"])])}}}),Xde={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Zde(t,e){return w(),R("svg",Xde,[...e[0]||(e[0]=[A("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 OO=Oe({name:"ph-eye",render:Zde}),Qde={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Jde(t,e){return w(),R("svg",Qde,[...e[0]||(e[0]=[A("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 Bf=Oe({name:"ph-eye-slash",render:Jde}),efe={class:"badge bg-secondary-subtle text-secondary-emphasis"},tfe=se({__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(),Q(p(TA),{label:t.summary,class:Te({"opacity-50":t.hidden}),onClick:n[3]||(n[3]=o=>e.$emit("toggleCollapse"))},{leading:J(()=>[A("span",efe,pe(t.kindLabel),1)]),actions:J(()=>[t.canToggleVisibility?(w(),Q(p(qo),{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]=pn(o=>e.$emit("toggleVisibility"),["stop"]))},{default:J(()=>[H(p(wr),{name:t.hidden?p(Bf):p(OO)},null,8,["name"])]),_:1},8,["title"])):oe("",!0),H(p(WG),{onDuplicate:n[1]||(n[1]=o=>e.$emit("duplicate")),onRemove:n[2]||(n[2]=o=>e.$emit("remove"))})]),_:1},8,["label","class"]))}}),nfe=Be(tfe,[["__scopeId","data-v-acf3aff5"]]),ofe={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function rfe(t,e){return w(),R("svg",ofe,[...e[0]||(e[0]=[A("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 ife=Oe({name:"ph-map-pin",render:rfe}),sfe={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function afe(t,e){return w(),R("svg",sfe,[...e[0]||(e[0]=[A("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 lfe=Oe({name:"ph-arrows-out-line-horizontal",render:afe}),cfe={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function ufe(t,e){return w(),R("svg",cfe,[...e[0]||(e[0]=[A("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 dfe=Oe({name:"ph-note",render:ufe}),ffe={class:"d-flex flex-column gap-4"},hfe={class:"d-flex flex-column gap-2"},pfe={class:"d-flex flex-column gap-2"},mfe={class:"d-flex flex-column gap-2"},Bk="abcdefghijklmnopqrstuvwxyz0123456789",gfe=se({__name:"EditorAnnotations",props:lt({labels:{},chartType:{},chartWidth:{},chartHeight:{},hiddenAnnotationIds:{},canToggleVisibility:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:lt(["toggle-visibility"],["update:modelValue"]),setup(t,{expose:e,emit:n}){const o=t,r=n,i=mt(t,"modelValue"),s=S(()=>i.value);function a(){let $="";for(let L=0;L<5;L++)$+=Bk[Math.floor(Math.random()*Bk.length)];return $}const l=S(()=>o.chartType===Ve.Pie||o.chartType===Ve.Donut),c=Fe(null);function u($){c.value=c.value===$?null:$}e({openIndex:c});const d=S(()=>s.value.map(($,L)=>({ann:$,index:L})).filter(({ann:$})=>$.kind===Ht.Point)),f=S(()=>s.value.map(($,L)=>({ann:$,index:L})).filter(({ann:$})=>$.kind===Ht.Range)),h=S(()=>s.value.map(($,L)=>({ann:$,index:L})).filter(({ann:$})=>$.kind===Ht.Free));function m($){var L;return!!$.id&&!!((L=o.hiddenAnnotationIds)!=null&&L.has($.id))}function b($){$.id&&r("toggle-visibility",$.id,$.kind)}function g($){return $.kind===Ht.Point?"Point":$.kind===Ht.Range?"Range":"Note"}function v($){return $.kind===Ht.Point?$.text||$.target||"Empty":$.kind===Ht.Range?$.text||`${$.start} - ${$.end}`:$.text||"Empty"}function y($,L){const E=s.value.map(N=>({...N}));E[$]=L,i.value=E}function x(){const $={kind:Ht.Point,id:a(),target:o.labels[0]??"",text:"Enter an annotation",showLine:!0,showArrow:!0},L=[...s.value,$];i.value=L,c.value=L.length-1}function _(){const $=o.labels.length>0,L={kind:Ht.Range,id:a(),start:$?o.labels[0]:0,end:$?o.labels[o.labels.length-1]:100},E=[...s.value,L];i.value=E,c.value=E.length-1}function C(){const $={kind:Ht.Free,id:a(),text:"Enter an annotation",x:0,y:0},L=[...s.value,$];i.value=L,c.value=L.length-1}function D($){const L=[...s.value];L.splice($+1,0,{...L[$],id:a()}),i.value=L}function M($){const L=[...s.value];L.splice($,1),i.value=L,c.value===$?c.value=null:c.value!==null&&c.value>$&&c.value--}return($,L)=>{const E=nfe,N=Kde,T=Ide,O=Ade;return w(),R("div",ffe,[p(l)?oe("",!0):(w(),Q(p(Uo),{key:0,title:"Points",icon:p(ife)},{default:J(()=>[A("div",hfe,[(w(!0),R(Re,null,vt(p(d),({ann:P,index:B})=>(w(),Q(p(Gd),{key:B},{header:J(()=>[H(E,{"kind-label":g(P),summary:v(P),collapsed:p(c)!==B,hidden:m(P),"can-toggle-visibility":t.canToggleVisibility,onDuplicate:V=>D(B),onRemove:V=>M(B),onToggleCollapse:V=>u(B),onToggleVisibility:V=>b(P)},null,8,["kind-label","summary","collapsed","hidden","can-toggle-visibility","onDuplicate","onRemove","onToggleCollapse","onToggleVisibility"])]),default:J(()=>[p(c)===B?(w(),Q(N,{key:0,annotation:P,labels:t.labels,"chart-width":t.chartWidth,"onUpdate:annotation":V=>y(B,V)},null,8,["annotation","labels","chart-width","onUpdate:annotation"])):oe("",!0)]),_:2},1024))),128))]),H(p(Rl),{label:"Add",onClick:x})]),_:1},8,["icon"])),p(l)?oe("",!0):(w(),Q(p(Uo),{key:1,title:"Ranges",icon:p(lfe)},{default:J(()=>[A("div",pfe,[(w(!0),R(Re,null,vt(p(f),({ann:P,index:B})=>(w(),Q(p(Gd),{key:B},{header:J(()=>[H(E,{"kind-label":g(P),summary:v(P),collapsed:p(c)!==B,hidden:m(P),"can-toggle-visibility":t.canToggleVisibility,onDuplicate:V=>D(B),onRemove:V=>M(B),onToggleCollapse:V=>u(B),onToggleVisibility:V=>b(P)},null,8,["kind-label","summary","collapsed","hidden","can-toggle-visibility","onDuplicate","onRemove","onToggleCollapse","onToggleVisibility"])]),default:J(()=>[p(c)===B?(w(),Q(T,{key:0,annotation:P,labels:t.labels,"onUpdate:annotation":V=>y(B,V)},null,8,["annotation","labels","onUpdate:annotation"])):oe("",!0)]),_:2},1024))),128))]),H(p(Rl),{label:"Add",onClick:_})]),_:1},8,["icon"])),H(p(Uo),{title:"Notes",icon:p(dfe)},{default:J(()=>[A("div",mfe,[(w(!0),R(Re,null,vt(p(h),({ann:P,index:B})=>(w(),Q(p(Gd),{key:B},{header:J(()=>[H(E,{"kind-label":g(P),summary:v(P),collapsed:p(c)!==B,hidden:m(P),"can-toggle-visibility":t.canToggleVisibility,onDuplicate:V=>D(B),onRemove:V=>M(B),onToggleCollapse:V=>u(B),onToggleVisibility:V=>b(P)},null,8,["kind-label","summary","collapsed","hidden","can-toggle-visibility","onDuplicate","onRemove","onToggleCollapse","onToggleVisibility"])]),default:J(()=>[p(c)===B?(w(),Q(O,{key:0,annotation:P,"chart-width":t.chartWidth,"chart-height":t.chartHeight,"onUpdate:annotation":V=>y(B,V)},null,8,["annotation","chart-width","chart-height","onUpdate:annotation"])):oe("",!0)]),_:2},1024))),128))]),H(p(Rl),{label:"Add",onClick:C})]),_:1},8,["icon"])])}}});function vfe(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 U=I[I.length-1].trim().split(/[\s,]+/);U.length>=2&&(v=parseFloat(U[U.length-2]),y=parseFloat(U[U.length-1]))}}const _=v!==null&&y!==null,C=(u&&"lineStyle"in u?u.lineStyle:"direct")||"direct",D=x>0?x+((u&&"lineTargetDistance"in u?u.lineTargetDistance:5)||5):0,M=parseFloat(m.getAttribute("x")||"0"),$=parseFloat(m.getAttribute("y")||"0"),L=m.getBBox(),N=(m.getAttribute("transform")||"").match(/translate\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*\)/),T=N?parseFloat(N[1]):0,O=N?parseFloat(N[2]):0,P={x:L.x+T,y:L.y+O,width:L.width,height:L.height},B=4,V=u?u.maxWidth:void 0;let z=P.width;if(V!=null){const ce=parseFloat(d.getAttribute("width")||"0");if(typeof V=="number"&&V>0)z=V;else if(typeof V=="string")if(V.endsWith("%")&&ce>0)z=parseFloat(V)/100*ce;else{const I=parseFloat(V);I>0&&(z=I)}}const G=m.getAttribute("text-anchor")||"middle";let K;G==="middle"?K=M-z/2:G==="end"?K=M-z:K=M,r=document.createElementNS("http://www.w3.org/2000/svg","rect"),r.setAttribute("x",String(K-B)),r.setAttribute("y",String(P.y-B)),r.setAttribute("width",String(z+B*2)),r.setAttribute("height",String(P.height+B*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 ne=!1,ae=0,he=0,ge=0,le=0,fe=0;function we(){return d.getScreenCTM()}function Z(){const ce=we();if(!ce)return;const I=(le-ae)/ce.a,U=(fe-he)/ce.d,j=M+I,ee=$+U;m.setAttribute("x",String(j)),m.setAttribute("y",String(ee));const ie=m.querySelectorAll("tspan");for(const Y of ie)Y.setAttribute("x",String(j));const de=m.getBBox(),ke={x:de.x+T,y:de.y+O,width:de.width,height:de.height};let X;const q=m.getAttribute("text-anchor")||"middle";if(q==="middle"?X=j-z/2:q==="end"?X=j-z:X=j,r.setAttribute("x",String(X-B)),r.setAttribute("y",String(ke.y-B)),r.setAttribute("width",String(z+B*2)),r.setAttribute("height",String(ke.height+B*2)),g&&_){const Y=bboxEdgeToward(ke,v,y),te=D>0?shortenToward({x:v,y},Y,D):{x:v,y},ue=ke.x+ke.width/2,ye=Math.abs(Y.x-ue)<1;g.setAttribute("d",buildPathD(Y,te,C,ye))}ge=0}function be(ce){ce.preventDefault(),ce.stopPropagation(),ne=!0,ae=ce.clientX,he=ce.clientY,le=ce.clientX,fe=ce.clientY,r.style.cursor="grabbing",r.setPointerCapture(ce.pointerId)}function re(ce){ne&&(ce.preventDefault(),le=ce.clientX,fe=ce.clientY,ge||(ge=requestAnimationFrame(Z)))}function ve(ce){if(!ne)return;ne=!1,r.style.cursor="grab",ge&&(cancelAnimationFrame(ge),ge=0);const I=we();if(!I)return;const U=(ce.clientX-ae)/I.a,j=(ce.clientY-he)/I.d;if(Math.abs(U)<1&&Math.abs(j)<1){m.setAttribute("x",String(M)),m.setAttribute("y",String($));const de=m.querySelectorAll("tspan");for(const ke of de)ke.setAttribute("x",String(M));return}const ee=e.value[c];if(!ee)return;const ie={...ee};if(ee.kind==="free"){const de=h.closest(".bc-annotations"),ke=parseFloat((de==null?void 0:de.getAttribute("data-ctx-width"))||"")||parseFloat(d.getAttribute("width")||"600"),X=parseFloat((de==null?void 0:de.getAttribute("data-ctx-height"))||"")||parseFloat(d.getAttribute("height")||"400"),q=ee.x,Y=ee.y;if(typeof q=="number")ie.x=+(q+U/ke*100).toFixed(1);else{const te=String(q);te.endsWith("px")?ie.x=`${Math.round(parseFloat(te)+U)}px`:ie.x=+((parseFloat(te)||0)+U/ke*100).toFixed(1)}if(typeof Y=="number")ie.y=+(Y+j/X*100).toFixed(1);else{const te=String(Y);te.endsWith("px")?ie.y=`${Math.round(parseFloat(te)+j)}px`:ie.y=+((parseFloat(te)||0)+j/X*100).toFixed(1)}}else if(ee.kind==="point"){const de=ie.textOffsetX??-42,ke=ie.textOffsetY??-42;ie.textOffsetX=Math.round(de+U),ie.textOffsetY=Math.round(ke+j)}o(c,ie)}r.addEventListener("pointerdown",be),r.addEventListener("pointermove",re),r.addEventListener("pointerup",ve),i=()=>{ge&&cancelAnimationFrame(ge),r==null||r.removeEventListener("pointerdown",be),r==null||r.removeEventListener("pointermove",re),r==null||r.removeEventListener("pointerup",ve)}}Ke(n,()=>{requestAnimationFrame(a)}),Ke(e,()=>{n.value!==null&&requestAnimationFrame(a)},{deep:!0}),Fa(s)}const bfe={class:"d-flex flex-column gap-4"},yfe=se({__name:"EditorAnnotateTab",setup(t){const e=dn(),{chartType:n,data:o,areaFills:r,seriesOverrides:i}=e,{currentOptions:s}=Cn(),a=S(()=>s.value.interpolation??"linear"),{pendingAnnotationIndex:l}=Tt(pr()),{scenes:c,activeIndex:u,activeScene:d,update:f}=Sn(),h=S(()=>u.value>=0),m=[Ve.BarVertical,Ve.BarHorizontal,Ve.LineMulti,Ve.AreaStacked],b=S(()=>m.includes(n.value)),g=S({get(){const B=e._base.annotations.value;if(u.value>=0){const V=Ka(c.value,u.value),z=(V==null?void 0:V.annotations)??[];return[...B,...z]}return B},set(B){if(u.value>=0&&d.value){const V=new Set(e._base.annotations.value.map(K=>K.id).filter(Boolean)),z=B.filter(K=>K.id&&V.has(K.id)),G=B.filter(K=>!K.id||!V.has(K.id));e._base.annotations.value=z,f(u.value,{annotations:G.length>0?G:void 0});return}e._base.annotations.value=B}}),v=S(()=>{if(u.value<0)return;const B=Ka(c.value,u.value);return B==null?void 0:B.hiddenAnnotationIds});function y(B,V){var ne;if(u.value<0)return;const z=d.value;if(!z)return;const G=z.annotationVisibility??[];((ne=v.value)==null?void 0:ne.has(B))?G.find(he=>he.id===B&&he.action==="hide")?f(u.value,{annotationVisibility:G.filter(he=>!(he.id===B&&he.action==="hide"))}):f(u.value,{annotationVisibility:[...G,{action:"show",kind:V,id:B}]}):G.find(he=>he.id===B&&he.action==="show")?f(u.value,{annotationVisibility:G.filter(he=>!(he.id===B&&he.action==="show"))}):f(u.value,{annotationVisibility:[...G,{action:"hide",kind:V,id:B}]})}const x=S(()=>n.value===Ve.LineMulti),_=S(()=>ks(o.value)),C=S(()=>_.value.labels),D=S(()=>{var B;return((B=_.value.series)==null?void 0:B.map(V=>V.name))??[]}),M=Fe(null),$=S(()=>{var B;return((B=M.value)==null?void 0:B.openIndex)??null}),{containerRef:L}=TO(),E=Ne(600),N=Ne(400);function T(){var V;const B=(V=L.value)==null?void 0:V.querySelector("svg");B&&(E.value=parseFloat(B.getAttribute("width")||"600")||600,N.value=parseFloat(B.getAttribute("height")||"400")||400)}let O;vn(()=>{T(),O=new ResizeObserver(T),L.value&&O.observe(L.value)}),oa(()=>O==null?void 0:O.disconnect());function P(B,V){const z=g.value.map(G=>({...G}));z[B]=V,g.value=z}return vfe(L,g,$,P),Ke(l,async B=>{if(B!==null&&(await kn(),M.value)){const V=typeof B=="string"?g.value.findIndex(z=>z.id===B):B;if(V<0){l.value=null;return}M.value.openIndex=M.value.openIndex===V?null:V,l.value=null}},{immediate:!0}),(B,V)=>{const z=gde,G=pde;return w(),R("div",bfe,[p(b)?(w(),Q(p(Uo),{key:0,title:"Highlight",icon:p(kde)},{default:J(()=>[H(z)]),_:1},8,["icon"])):oe("",!0),H(gfe,{ref_key:"annotationsRef",ref:M,modelValue:p(g),"onUpdate:modelValue":V[0]||(V[0]=K=>Ze(g)?g.value=K:null),labels:p(C),"chart-type":p(n),"chart-width":p(E),"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(),Q(p(Uo),{key:1,title:"Area Fills",icon:p(xde)},{default:J(()=>[H(G,{modelValue:p(r),"onUpdate:modelValue":V[1]||(V[1]=K=>Ze(r)?r.value=K:null),"series-names":p(D),"series-overrides":p(i),"global-interpolation":p(a)},null,8,["modelValue","series-names","series-overrides","global-interpolation"])]),_:1},8,["icon"])):oe("",!0)])}}}),xfe={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function wfe(t,e){return w(),R("svg",xfe,[...e[0]||(e[0]=[A("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 _fe=Oe({name:"ph-tag",render:wfe}),kfe={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Sfe(t,e){return w(),R("svg",kfe,[...e[0]||(e[0]=[A("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 Lb=Oe({name:"ph-magic-wand",render:Sfe}),Cfe={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Afe(t,e){return w(),R("svg",Cfe,[...e[0]||(e[0]=[A("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 $fe=Oe({name:"ph-arrow-line-up",render:Afe}),Tfe={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Ofe(t,e){return w(),R("svg",Tfe,[...e[0]||(e[0]=[A("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 Mfe=Oe({name:"ph-arrow-line-down",render:Ofe}),Bfe={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Lfe(t,e){return w(),R("svg",Bfe,[...e[0]||(e[0]=[A("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 Pfe=Oe({name:"ph-arrow-line-left",render:Lfe}),Dfe={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Efe(t,e){return w(),R("svg",Dfe,[...e[0]||(e[0]=[A("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 Ife=Oe({name:"ph-arrow-line-right",render:Efe}),Nfe={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Rfe(t,e){return w(),R("svg",Nfe,[...e[0]||(e[0]=[A("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 Pb=Oe({name:"ph-arrow-square-in",render:Rfe}),Ffe={class:"d-flex flex-column gap-3"},Vfe=se({__name:"EditorLegendSection",setup(t){const{currentOptions:e,availableOptionKeys:n,setOption:o}=Cn(),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:IA},{value:"none",text:"None",icon:Bf}];return a.value&&v.splice(1,0,{value:"direct",text:"Direct labelling",icon:_fe}),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:Lb},{value:"outside",text:"Outside",icon:vf},{value:"inside",text:"Inside",icon:Pb}],m=[{value:"start",text:"Start",icon:Of},{value:"middle",text:"Middle",icon:I0},{value:"end",text:"End",icon:Mf}],b=[{value:"top",text:"Top",icon:$fe},{value:"bottom",text:"Bottom",icon:Mfe},{value:"left",text:"Left",icon:Pfe},{value:"right",text:"Right",icon:Ife}],g=[{value:"start",text:"Start",icon:Of},{value:"middle",text:"Middle",icon:I0},{value:"end",text:"End",icon:Mf}];return(v,y)=>(w(),R("div",Ffe,[p(r)?(w(),Q(p($n),{key:0,label:"Labels","model-value":p(u),options:p(d),block:"","onUpdate:modelValue":f},null,8,["model-value","options"])):oe("",!0),p(l)&&p(u)==="direct"?(w(),Q(p($n),{key:1,label:"Direct label style","model-value":p(e).directLabelling||"auto",options:h,block:"","onUpdate:modelValue":y[0]||(y[0]=x=>p(o)("directLabelling",x))},null,8,["model-value"])):oe("",!0),p(c)&&p(u)==="direct"&&p(e).directLabelling==="inside"?(w(),Q(p($n),{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"])):oe("",!0),p(i)&&p(u)==="legend"?(w(),Q(p($n),{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"])):oe("",!0),p(s)&&p(u)==="legend"?(w(),Q(p($n),{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"])):oe("",!0)]))}}),zfe={class:"d-flex flex-column gap-3"},Hfe={class:"pt-2"},Wfe={class:"pt-2"},Ufe={class:"pt-2"},Gfe={class:"pt-2"},qfe=se({__name:"EditorLayoutSection",setup(t){const{layout:e}=dn(),n=S({get:()=>e.value.sizing,set:h=>{e.value.sizing=h}}),o=S({get:()=>e.value.heightMode,set:h=>{e.value.heightMode=h}}),r=S({get:()=>String(e.value.fixedWidth),set:h=>{e.value.fixedWidth=Number(h)||600}}),i=S({get:()=>String(e.value.fixedHeight),set:h=>{e.value.fixedHeight=Number(h)||400}}),s=S({get:()=>String(e.value.padding),set:h=>{e.value.padding=Number(h)||0}}),a=S({get:()=>e.value.aspectRatio,set:h=>{e.value.aspectRatio=h}}),l=S({get:()=>e.value.transparentBackground,set:h=>{e.value.transparentBackground=h}}),c=S({get:()=>String(e.value.maxWidth),set:h=>{e.value.maxWidth=Number(h)||660}}),u=[{value:"responsive",text:"Responsive"},{value:"max-width",text:"Max width"},{value:"fixed",text:"Fixed"}],d=[{value:"auto",text:"Auto"},{value:"fixed",text:"Fixed"},{value:"aspect-ratio",text:"Aspect ratio"}],f=[{value:"16:9",label:"16:9"},{value:"4:3",label:"4:3"},{value:"3:2",label:"3:2"},{value:"1:1",label:"1:1"},{value:"2:3",label:"2:3"},{value:"9:16",label:"9:16"}];return(h,m)=>(w(),R("div",zfe,[H(p($n),{modelValue:p(n),"onUpdate:modelValue":m[2]||(m[2]=b=>Ze(n)?n.value=b:null),label:"Width",options:u,block:""},{"section:fixed":J(()=>[A("div",Hfe,[H(p(Cr),{id:"layout-fixed-width",modelValue:p(r),"onUpdate:modelValue":m[0]||(m[0]=b=>Ze(r)?r.value=b:null),label:"",min:"200",max:"1200",suffix:"px"},null,8,["modelValue"])])]),"section:max-width":J(()=>[A("div",Wfe,[H(p(Cr),{id:"layout-max-width",modelValue:p(c),"onUpdate:modelValue":m[1]||(m[1]=b=>Ze(c)?c.value=b:null),label:"",min:"200",max:"1200",suffix:"px"},null,8,["modelValue"])])]),_:1},8,["modelValue"]),H(p($n),{modelValue:p(o),"onUpdate:modelValue":m[5]||(m[5]=b=>Ze(o)?o.value=b:null),label:"Height",options:d,block:""},{"section:fixed":J(()=>[A("div",Ufe,[H(p(Cr),{id:"layout-fixed-height",modelValue:p(i),"onUpdate:modelValue":m[3]||(m[3]=b=>Ze(i)?i.value=b:null),label:"",min:"100",max:"800",suffix:"px"},null,8,["modelValue"])])]),"section:aspect-ratio":J(()=>[A("div",Gfe,[H(p(Rn),{id:"layout-aspect-ratio",modelValue:p(a),"onUpdate:modelValue":m[4]||(m[4]=b=>Ze(a)?a.value=b:null),options:f,block:""},null,8,["modelValue"])])]),_:1},8,["modelValue"]),H(p(Cr),{id:"layout-padding",modelValue:p(s),"onUpdate:modelValue":m[6]||(m[6]=b=>Ze(s)?s.value=b:null),label:"Padding",min:"0",max:"80",suffix:"px"},null,8,["modelValue"]),H(p(on),{modelValue:p(l),"onUpdate:modelValue":m[7]||(m[7]=b=>Ze(l)?l.value=b:null),label:"Transparent background"},null,8,["modelValue"])]))}}),Yfe={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function jfe(t,e){return w(),R("svg",Yfe,[...e[0]||(e[0]=[A("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 Kfe=Oe({name:"ph-list-bullets",render:jfe}),Xfe={class:"d-flex flex-column gap-4"},Zfe=se({__name:"EditorLayoutTab",setup(t){const{availableOptionKeys:e}=Cn(),n=S(()=>e.value.includes("legend"));return(o,r)=>{const i=qfe,s=Vfe;return w(),R("div",Xfe,[H(i),p(n)?(w(),Q(p(Uo),{key:0,title:"Legend",icon:p(Kfe)},{default:J(()=>[H(s)]),_:1},8,["icon"])):oe("",!0)])}}}),Qfe={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Jfe(t,e){return w(),R("svg",Qfe,[...e[0]||(e[0]=[A("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 ehe=Oe({name:"ph-wave-sine",render:Jfe}),the={key:0,class:"d-flex flex-column gap-4"},nhe={class:"d-flex flex-column gap-2"},ohe={key:1,class:"text-muted small"},rhe=se({__name:"EditorAxisOptions",setup(t){const e=S(()=>l.value.includes("valueLabels")),n=S(()=>l.value.includes("swapLabelValue")),o=[{value:"auto",text:"Auto",icon:Lb},{value:"outside",text:"Outside",icon:vf},{value:"inside",text:"Inside",icon:Pb}],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}=Cn();function u(O,P){c(O,P)}const{displayColumnTypes:d}=er(),f=S(()=>d.value[0]??"string"),h=S(()=>d.value[1]??"number"),m=S(()=>a.value.some(O=>O.key==="verticalScaleType"));function b(O){return O.replace(/^(Show\s+)?(vertical|horizontal)\s+/i,(P,B)=>B??"").replace(/^./,P=>P.toUpperCase())}function g(O){return(O?!m.value:m.value)?h.value:f.value}function v(O,P){if(O.type!=="numberFormat")return O;const B=g(P);return B==="date"?{...O,type:"dateFormat",label:O.label.replace(/number\s+format/i,"Date format")}:B==="string"?{...O,type:"__hidden"}:O}const y=S(()=>a.value.filter(O=>r.has(O.key)).map(O=>v({...O,label:b(O.label)},!1)).filter(O=>O.type!=="__hidden")),x=S(()=>a.value.filter(O=>i.has(O.key)).map(O=>v({...O,label:b(O.label)},!0)).filter(O=>O.type!=="__hidden")),_={solid:Cx,dashed:AO,dotted:$O,none:Bf},C={auto:Lb,inside:Pb,outside:vf,off:Bf},D={left:Of,right:Mf},M={linear:kd,log:ehe},$={verticalGridStyle:_,horizontalGridStyle:_,verticalLabelPosition:C,horizontalLabelPosition:C,verticalAxisDirection:D,verticalScaleType:M,horizontalScaleType:M},L=(O,{emit:P})=>{const{def:B,value:V}=O;if(B.type==="boolean")return zt(on,{label:B.label,modelValue:V??B.default??!1,"onUpdate:modelValue":z=>P("update",z)});if(B.type==="select"&&B.choices){const z=$[B.key],G=B.choices.map(K=>({value:K.value,text:K.text,...z!=null&&z[K.value]?{icon:z[K.value]}:{}}));return zt($n,{label:B.label,options:G,block:!0,modelValue:V??B.default??"","onUpdate:modelValue":K=>P("update",K)})}return B.type==="text"?zt(zm,{label:B.label,id:`opt-${B.key}`,placeholder:B.placeholder??"",modelValue:V??"","onUpdate:modelValue":z=>P("update",z)}):B.type==="numberFormat"?zt(Bz,{label:B.label,id:`opt-${B.key}`,modelValue:V??"","onUpdate:modelValue":z=>P("update",z)}):B.type==="dateFormat"?zt(_W,{label:B.label,id:`opt-${B.key}`,modelValue:V??"","onUpdate:modelValue":z=>P("update",z)}):null};L.props=["def","value"],L.emits=["update"];function E(O){return O.endsWith("RangeMin")}function N(O){return O.endsWith("RangeMax")}const T=(O,{emit:P})=>{const B=[],{defs:V,currentOptions:z}=O;let G=0;for(;G<V.length;){const K=V[G];if(E(K.key)&&G+1<V.length&&N(V[G+1].key)){const ne=V[G+1];B.push(zt("div",{class:"d-flex gap-2",key:K.key},[zt("div",{class:"flex-fill",style:"min-width:0"},[zt(L,{def:K,value:z[K.key],onUpdate:ae=>P("update",K.key,ae)})]),zt("div",{class:"flex-fill",style:"min-width:0"},[zt(L,{def:ne,value:z[ne.key],onUpdate:ae=>P("update",ne.key,ae)})])])),G+=2}else B.push(zt(L,{key:K.key,def:K,value:z[K.key],onUpdate:ne=>P("update",K.key,ne)})),G++}return zt("div",{class:"d-flex flex-column gap-2"},B)};return T.props=["defs","currentOptions"],T.emits=["update"],(O,P)=>p(e)||p(y).length>0||p(x).length>0?(w(),R("div",the,[p(e)?(w(),Q(p(Uo),{key:0,title:"Value Labels",icon:p(wO)},{default:J(()=>[A("div",nhe,[H(p(on),{"model-value":p(s).valueLabels??!1,label:"Show value labels","onUpdate:modelValue":P[0]||(P[0]=B=>u("valueLabels",B))},null,8,["model-value"]),p(s).valueLabels?(w(),Q(p($n),{key:0,label:"Position","model-value":p(s).valueLabelPosition??"auto",options:o,block:"","onUpdate:modelValue":P[1]||(P[1]=B=>u("valueLabelPosition",B))},null,8,["model-value"])):oe("",!0),p(s).valueLabels&&p(n)?(w(),Q(p(on),{key:1,"model-value":p(s).swapLabelValue??!1,label:"Swap labels and values","onUpdate:modelValue":P[2]||(P[2]=B=>u("swapLabelValue",B))},null,8,["model-value"])):oe("",!0)])]),_:1},8,["icon"])):oe("",!0),p(y).length>0?(w(),Q(p(Uo),{key:1,title:"Vertical Axis",icon:p(SO)},{default:J(()=>[H(T,{defs:p(y),"current-options":p(s),onUpdate:u},null,8,["defs","current-options"])]),_:1},8,["icon"])):oe("",!0),p(x).length>0?(w(),Q(p(Uo),{key:2,title:"Horizontal Axis",icon:p(CO)},{default:J(()=>[H(T,{defs:p(x),"current-options":p(s),onUpdate:u},null,8,["defs","current-options"])]),_:1},8,["icon"])):oe("",!0)])):(w(),R("p",ohe," No axis options for this chart type. "))}}),ihe={class:"d-flex flex-column gap-3"},MO=se({__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=nl,a=Mn;return w(),R("div",ihe,[H(a,{label:"Symbol","label-for":`${t.idPrefix}-shape`},{default:J(()=>[H(s,{id:`${t.idPrefix}-shape`,"model-value":t.shape,options:e,"onUpdate:modelValue":i[0]||(i[0]=l=>r.$emit("update:shape",l))},null,8,["id","model-value"])]),_:1},8,["label-for"]),H(p($n),{label:"Show on","model-value":t.showOn,options:n,"onUpdate:modelValue":i[1]||(i[1]=l=>r.$emit("update:showOn",l))},null,8,["model-value"]),H(p($n),{label:"Style","model-value":t.style,options:o,"onUpdate:modelValue":i[2]||(i[2]=l=>r.$emit("update:style",l))},null,8,["model-value"]),H(p(Cr),{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(Cr),{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"])])}}}),she={class:"d-flex flex-column gap-3"},ahe={class:"d-flex gap-2 justify-content-end"},lhe=se({__name:"EditorSeriesOptions",props:{selected:{},overrides:{},colors:{},chartType:{}},emits:["update:overrides"],setup(t,{emit:e}){const n=t,o=e;function r(T){return n.overrides.find(O=>O.name===T)}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 T;return((T=i())==null?void 0:T.color)??"#4e79a7"}),c=S(()=>{var T;return String(((T=i())==null?void 0:T.opacity)??1)}),u=S(()=>{var T;return String(((T=i())==null?void 0:T.lineWidth)??2)}),d=S(()=>{var T;return((T=i())==null?void 0:T.dash)??"solid"}),f=S(()=>{var T;return((T=i())==null?void 0:T.interpolation)??"global"}),h=S(()=>{var T;return((T=i())==null?void 0:T.labelMode)??"global"}),m=S(()=>{var T;return((T=i())==null?void 0:T.valueLabels)??!1}),b=S(()=>{var T;return((T=i())==null?void 0:T.lineSymbols)??!1}),g=S(()=>{var T;return((T=i())==null?void 0:T.symbolShape)??"circle"}),v=S(()=>{var T;return((T=i())==null?void 0:T.symbolShowOn)??"firstLast"}),y=S(()=>{var T;return((T=i())==null?void 0:T.symbolStyle)??"filled"}),x=S(()=>{var T;return String(((T=i())==null?void 0:T.symbolSize)??3.5)}),_=S(()=>{var T;return String(((T=i())==null?void 0:T.symbolOpacity)??1)});function C(T,O){const P=n.overrides.map(B=>({...B}));for(const B of n.selected){let V=P.find(z=>z.name===B);V||(V={name:B},P.push(V)),V[T]=O}o("update:overrides",P)}function D(){if(n.selected.length<2)return;const T=r(n.selected[0]);if(!T)return;const O=n.overrides.map(P=>({...P}));for(let P=1;P<n.selected.length;P++){const B=n.selected[P];let V=O.find(z=>z.name===B);V||(V={name:B},O.push(V)),Object.assign(V,{...T,name:B})}o("update:overrides",O)}function M(){const T=new Set(n.selected),O=n.overrides.filter(P=>!T.has(P.name));o("update:overrides",O)}const $=[{value:"1",text:"1"},{value:"2",text:"2"},{value:"3",text:"3"},{value:"4",text:"4"},{value:"5",text:"5"}],L=[{value:"solid",text:"Solid"},{value:"dotted",text:"Dotted"},{value:"dashed",text:"Dashed"},{value:"dash-dot",text:"Dash-dot"}],E=[{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(T,O)=>{const P=nl,B=Mn,V=MO,z=qo;return w(),R("div",she,[H(p(Ua),{id:"series-color",label:"Color","model-value":p(l),"onUpdate:modelValue":O[0]||(O[0]=G=>C("color",G))},null,8,["model-value"]),H(p($n),{label:"Label mode","model-value":p(h),options:N,block:"","onUpdate:modelValue":O[1]||(O[1]=G=>C("labelMode",G))},null,8,["model-value"]),H(p(on),{"model-value":p(m),label:"Value labels","onUpdate:modelValue":O[2]||(O[2]=G=>C("valueLabels",G))},null,8,["model-value"]),p(s)?(w(),Q(p(Cr),{key:0,id:"series-opacity",label:"Opacity","model-value":p(c),min:"0",max:"1",step:"0.1","onUpdate:modelValue":O[3]||(O[3]=G=>C("opacity",Number(G)))},null,8,["model-value"])):oe("",!0),p(a)?(w(),R(Re,{key:1},[H(p($n),{label:"Line width","model-value":p(u),options:$,"onUpdate:modelValue":O[4]||(O[4]=G=>C("lineWidth",Number(G)))},null,8,["model-value"]),H(p($n),{label:"Dash style","model-value":p(d),options:L,"onUpdate:modelValue":O[5]||(O[5]=G=>C("dash",G))},null,8,["model-value"]),H(B,{label:"Interpolation","label-for":"series-interpolation"},{default:J(()=>[H(P,{id:"series-interpolation","model-value":p(f),options:E,"onUpdate:modelValue":O[6]||(O[6]=G=>C("interpolation",G))},null,8,["model-value"])]),_:1}),H(p(on),{"model-value":p(b),label:"Line symbols","onUpdate:modelValue":O[7]||(O[7]=G=>C("lineSymbols",G))},null,8,["model-value"]),p(b)?(w(),Q(V,{key:0,"id-prefix":"series-symbol",shape:p(g),"show-on":p(v),style:Lt(p(y)),size:p(x),opacity:p(_),"onUpdate:shape":O[8]||(O[8]=G=>C("symbolShape",G)),"onUpdate:showOn":O[9]||(O[9]=G=>C("symbolShowOn",G)),"onUpdate:style":O[10]||(O[10]=G=>C("symbolStyle",G)),"onUpdate:size":O[11]||(O[11]=G=>C("symbolSize",Number(G))),"onUpdate:opacity":O[12]||(O[12]=G=>C("symbolOpacity",Number(G)))},null,8,["shape","show-on","style","size","opacity"])):oe("",!0)],64)):oe("",!0),A("div",ahe,[t.selected.length>1?(w(),Q(z,{key:0,variant:"outline-secondary",size:"sm",onClick:D},{default:J(()=>[...O[13]||(O[13]=[He(" Copy from first ",-1)])]),_:1})):oe("",!0),H(z,{variant:"outline-danger",size:"sm",onClick:M},{default:J(()=>[...O[14]||(O[14]=[He(" Reset to default ",-1)])]),_:1})])])}}}),che=se({__name:"EditorSeriesList",props:{seriesNames:{},selected:{},colors:{},overrides:{}},emits:["update:selected","toggleVisibility"],setup(t){const e=t;function n(r,i){return un(r,i,e.colors,e.overrides)}function o(r){return ul(r,e.overrides)}return(r,i)=>{const s=Xs;return w(),Q(p(p2),{items:t.seriesNames,selected:t.selected,"onUpdate:selected":i[1]||(i[1]=a=>r.$emit("update:selected",a))},{"item-leading":J(({item:a,index:l})=>[H(p(Vm),{color:n(a,l)},null,8,["color"])]),"item-actions":J(({item:a})=>[H(s,{"model-value":!o(a),switch:"",size:"sm",onClick:i[0]||(i[0]=pn(()=>{},["stop"])),"onUpdate:modelValue":l=>r.$emit("toggleVisibility",a,!l)},null,8,["model-value","onUpdate:modelValue"])]),_:1},8,["items","selected"])}}}),uhe={class:"d-flex flex-column gap-3"},dhe=se({__name:"EditorSeriesPanel",setup(t){const{chartType:e,data:n,seriesOverrides:o}=dn(),{currentOptions:r}=Cn(),i=Fe([]),s=S(()=>{var u;return((u=ks(n.value).series)==null?void 0:u.map(d=>d.name))??[]}),a=S(()=>BT(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=che,f=lhe;return w(),R("div",uhe,[u[2]||(u[2]=A("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(),Q(p(Gd),{key:0,label:"Editing "+p(i).length+" "+(p(i).length===1?"series: "+p(i)[0]:"series")},{default:J(()=>[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"])):oe("",!0)])}}}),fhe={class:"d-flex flex-column gap-3"},hhe={class:"bc-area-stack-options"},phe=se({__name:"EditorAreaSection",setup(t){const{currentOptions:e,setOption:n}=Cn(),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=nl,l=Mn,c=UE,u=Xs;return w(),R("div",fhe,[H(p(Cr),{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:J(()=>[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:J(()=>[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(on),{"model-value":p(e).stacked!==!1,label:"Stack areas","onUpdate:modelValue":s[5]||(s[5]=d=>p(n)("stacked",d))},{section:J(()=>[A("div",hhe,[H(u,{"model-value":p(e).stackPercent??!1,"onUpdate:modelValue":s[3]||(s[3]=d=>p(n)("stackPercent",d))},{default:J(()=>[...s[6]||(s[6]=[He(" 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:J(()=>[...s[7]||(s[7]=[He(" Separate areas with lines ",-1)])]),_:1},8,["model-value"])])]),_:1},8,["model-value"])])}}}),mhe=Be(phe,[["__scopeId","data-v-3bf56010"]]),ghe={class:"d-flex flex-column gap-3"},vhe=se({__name:"EditorSliceSection",setup(t){const{currentOptions:e,availableOptionKeys:n,setOption:o}=Cn();function r(i){return n.value.includes(i)}return(i,s)=>{const a=da,l=Mn;return w(),R("div",ghe,[r("displayAsPercentage")?(w(),Q(p(on),{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"])):oe("",!0),r("showTotal")?(w(),Q(p(on),{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"])):oe("",!0),r("showLabels")?(w(),Q(p(on),{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"])):oe("",!0),r("showValues")?(w(),Q(p(on),{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"])):oe("",!0),r("sliceMax")?(w(),Q(p(Cr),{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"])):oe("",!0),r("sliceGroupLabel")?(w(),Q(l,{key:5,label:"Group label","label-for":"opt-sliceGroupLabel"},{default:J(()=>[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})):oe("",!0)])}}}),bhe={class:"d-flex flex-column gap-3"},Lk=.15,yhe=se({__name:"EditorBarStyleSection",setup(t){const{currentOptions:e,availableOptionKeys:n,setOption:o}=Cn(),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)?_f:y;return String(d(x))});function h(y){const x=parseFloat(y),_=isNaN(x)?_f:x;o("barGap",String(d(_)))}function m(y){const x=parseFloat(y??""),_=isNaN(x)?Lk: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(Lk);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",bhe,[p(r)?(w(),Q(p(on),{key:0,"model-value":p(e).barBackground??!1,label:"Bar background","onUpdate:modelValue":x[0]||(x[0]=_=>p(o)("barBackground",_))},null,8,["model-value"])):oe("",!0),p(i)?(w(),Q(p(on),{key:1,"model-value":p(e).barSeparators??!1,label:"Bar separators","onUpdate:modelValue":x[1]||(x[1]=_=>p(o)("barSeparators",_))},null,8,["model-value"])):oe("",!0),p(s)?(w(),Q(p(Cr),{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"])):oe("",!0),p(a)?(w(),Q(p(on),{key:3,"model-value":p(e).connectedColumns??!1,label:"Connected columns","onUpdate:modelValue":x[2]||(x[2]=_=>p(o)("connectedColumns",_))},null,8,["model-value"])):oe("",!0),p(a)&&p(e).connectedColumns?(w(),Q(p(Cr),{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"])):oe("",!0),p(l)?(w(),Q(p(on),{key:5,"model-value":p(e).waterfall??!1,label:"Waterfall","onUpdate:modelValue":x[3]||(x[3]=_=>p(o)("waterfall",_))},null,8,["model-value"])):oe("",!0),p(c)&&p(e).waterfall?(w(),Q(p(on),{key:6,"model-value":p(e).waterfallTotal??!1,label:"Waterfall total","onUpdate:modelValue":x[4]||(x[4]=_=>p(o)("waterfallTotal",_))},null,8,["model-value"])):oe("",!0),p(u)?(w(),Q(p(on),{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"])):oe("",!0)]))}}),xhe={class:"d-flex flex-column gap-3"},whe=se({__name:"EditorLineSymbols",setup(t){const{currentOptions:e,setOption:n}=Cn();return(o,r)=>{const i=MO;return w(),R("div",xhe,[H(p(on),{"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(),Q(i,{key:0,"id-prefix":"opt-line-symbol",shape:p(e).lineSymbolShape??"circle","show-on":p(e).lineSymbolShowOn??"firstLast",style:Lt(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"])):oe("",!0)])}}}),_he={class:"d-flex flex-column gap-3"},khe=se({__name:"EditorLineSection",setup(t){const{currentOptions:e,availableOptionKeys:n,setOption:o}=Cn(),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=nl,d=Mn,f=whe;return w(),R("div",_he,[p(r)?(w(),Q(d,{key:0,label:"Line interpolation","label-for":"opt-interpolation"},{default:J(()=>[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})):oe("",!0),p(i)?(w(),Q(p(on),{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"])):oe("",!0),p(s)?(w(),Q(f,{key:2})):oe("",!0)])}}}),She={class:"d-flex flex-column gap-3"},Che=se({__name:"EditorBarAppearance",props:{labels:{},colorizes:{},baseColor:{}},emits:["update:colorizes","update:baseColor"],setup(t,{emit:e}){const n=t,o=e,r=Fe([]),i=Ne(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",She,[H(p(Ua),{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(on),{"model-value":p(i),label:"Customize colors","onUpdate:modelValue":f},null,8,["model-value"]),p(i)?(w(),R(Re,{key:0},[H(p(p2),{items:t.labels,selected:p(r),"on-item-click":c,"onUpdate:selected":m[1]||(m[1]=b=>r.value=b)},{"item-leading":J(({item:b})=>[H(p(Vm),{color:a(b)},null,8,["color"])]),_:1},8,["items","selected"]),p(r).length>0?(w(),Q(p(Gd),{key:0,label:"Editing "+p(r).length+" "+(p(r).length===1?"label":"labels")},{default:J(()=>[H(p(Ua),{id:"bar-highlight-color",label:"Color for selected","model-value":p(l),"onUpdate:modelValue":u},null,8,["model-value"]),t.colorizes.length>0?(w(),Q(p(qo),{key:0,variant:"outline-danger",size:"sm",onClick:d},{default:J(()=>[...m[2]||(m[2]=[He(" Reset all changes ",-1)])]),_:1})):oe("",!0)]),_:1},8,["label"])):oe("",!0)],64)):oe("",!0)]))}}),Ahe=Qn("cvdMode",()=>({cvdMode:Ne("")}));function BO(){const t=Ahe(),{cvdMode:e}=Tt(t);return{cvdMode:e}}const $he="#ffffff",The="#1a1a1a",Ohe={protanopia:"Protan",deuteranopia:"Deutan",tritanopia:"Tritan"};function Pk(t,e,n){const r=(n?W$(t,e):t).map(s=>One(s,e)),i=Math.min(...r);return{level:Mne(i),ratio:`${i.toFixed(1)}:1`}}function Mhe(t,e,n){const o=S(()=>{const s=yt(t);return s.length===0?null:Pk(s,$he,yt(e))}),r=S(()=>{const s=yt(t);return s.length===0||!yt(n)?null:Pk(s,The,yt(e))}),i=S(()=>{const s=yt(t);if(s.length===0)return null;const a=s.length>=2?kre(s):[];return a.length===0?{safe:!0,issues:[]}:{safe:!1,issues:a.map(l=>({type:l.type,shortLabel:Ohe[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 Bhe={render(){return zt("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%"})}},Lhe={render(){return zt("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%"})}},Phe={render(){return zt("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%"})}},Dhe={render(){return zt("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%"})}},Ehe={class:"d-flex flex-column gap-3"},Ihe={key:4,class:"d-flex align-items-center gap-2"},Nhe={key:5,class:"d-flex align-items-center gap-2"},Rhe={key:6,class:"d-flex align-items-center gap-2"},Fhe=se({__name:"EditorColorSection",setup(t){const{chartType:e,data:n,colorizes:o}=dn(),{currentOptions:r,availableOptionKeys:i,setOption:s}=Cn(),{cvdMode:a}=Tt(BO()),l=S(()=>[Ve.BarVertical,Ve.BarHorizontal,Ve.VerticalBar,Ve.HorizontalBar].includes(e.value)),c=S(()=>i.value.includes("colors")),u=S(()=>i.value.includes("colorPalette")),d=S(()=>ks(n.value)),f=S(()=>d.value.labels),h=S(()=>{const L=r.value.colorPalette;return L?R5(L)??[]:r.value.colors??[]}),m=S(()=>h.value[0]??"#4e79a7");function b(L){r.value.colorPalette&&s("colorPalette",""),s("colors",[L])}const g=S(()=>{if(l.value){const L=o.value.map(N=>N.color),E=m.value;return L.length>0?[E,...L]:[E]}return h.value}),{lightContrastInfo:v,darkContrastInfo:y,cvdInfo:x}=Mhe(g,()=>!!r.value.autoContrast,()=>r.value.allowDarkMode??!0),_=bt("cvdSafeBadgeRef"),C=bt("cvdBadgeRefs");function D(L){var N;const E=((N=x.value)==null?void 0:N.issues.findIndex(T=>T.type===L))??-1;return E>=0?C.value[E]:void 0}const M=[{value:"",text:"None",description:"Normal color vision",visual:Oe(Bhe)},{value:"protanopia",text:"Protanopia",description:"No red cones (1% of males)",visual:Oe(Lhe)},{value:"deuteranopia",text:"Deuteranopia",description:"No green cones (1% of males)",visual:Oe(Phe)},{value:"tritanopia",text:"Tritanopia",description:"No blue cones (very rare)",visual:Oe(Dhe)}],$=[{value:"",label:"Custom",colors:[]},...F5().map(L=>({value:L.name,label:L.label,colors:[...L.colors]}))];return(L,E)=>{const N=Che;return w(),R("div",Ehe,[p(l)?(w(),Q(N,{key:0,labels:p(f),colorizes:p(o),"base-color":p(m),"onUpdate:colorizes":E[0]||(E[0]=T=>o.value=T),"onUpdate:baseColor":b},null,8,["labels","colorizes","base-color"])):(w(),R(Re,{key:1},[p(u)?(w(),Q(p(nz),{key:0,id:"opt-palette",label:"Color palette","model-value":p(r).colorPalette??"",palettes:$,"onUpdate:modelValue":E[1]||(E[1]=T=>p(s)("colorPalette",T))},null,8,["model-value"])):oe("",!0),p(c)&&!p(r).colorPalette?(w(),Q(p($V),{key:1,id:"opt-colors",label:"Colors","model-value":p(r).colors??[],"onUpdate:modelValue":E[2]||(E[2]=T=>p(s)("colors",T))},null,8,["model-value"])):oe("",!0)],64)),p(u)||p(c)?(w(),Q(p(on),{key:2,id:"opt-allow-dark-mode",label:"Allow dark mode","model-value":p(r).allowDarkMode??!0,"onUpdate:modelValue":E[3]||(E[3]=T=>p(s)("allowDarkMode",T))},null,8,["model-value"])):oe("",!0),p(u)||p(c)?(w(),Q(p(on),{key:3,id:"opt-auto-contrast",label:"Auto-adjust contrast","model-value":p(r).autoContrast??!1,"onUpdate:modelValue":E[4]||(E[4]=T=>p(s)("autoContrast",T))},null,8,["model-value"])):oe("",!0),p(v)?(w(),R("div",Ihe,[E[6]||(E[6]=A("span",{class:"form-label mb-0"},"Light contrast",-1)),H(p(E8),{level:p(v).level,ratio:p(v).ratio},null,8,["level","ratio"])])):oe("",!0),p(y)?(w(),R("div",Nhe,[E[7]||(E[7]=A("span",{class:"form-label mb-0"},"Dark contrast",-1)),H(p(E8),{level:p(y).level,ratio:p(y).ratio},null,8,["level","ratio"])])):oe("",!0),p(x)?(w(),R("div",Rhe,[E[9]||(E[9]=A("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(n2)),E[8]||(E[8]=He(" Safe ",-1)),H(p(tb),{class:"editor-color-section__cvd-badge__info"}),H(p(ff),{"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(Re,{key:1},vt(p(x).issues,T=>(w(),R("span",{key:T.type,ref_for:!0,ref_key:"cvdBadgeRefs",ref:C,class:"editor-color-section__cvd-badge editor-color-section__cvd-badge--warn"},[H(p(OO)),He(" "+pe(T.shortLabel)+" ",1),H(p(tb),{class:"editor-color-section__cvd-badge__info"}),H(p(ff),{"teleport-to":"body",target:()=>D(T.type),title:T.tooltip,placement:"top"},null,8,["target","title"])]))),128))])):oe("",!0),H(p($n),{modelValue:p(a),"onUpdate:modelValue":E[5]||(E[5]=T=>Ze(a)?a.value=T:null),label:"Colorblind simulation",options:M,block:""},null,8,["modelValue"])])}}}),Vhe=Be(Fhe,[["__scopeId","data-v-bbe9fd0a"]]),zhe=se({__name:"EditorThemeSection",setup(t){const{chartTheme:e,availableThemes:n}=GT();return(o,r)=>(w(),Q(p(Rn),{modelValue:p(e),"onUpdate:modelValue":r[0]||(r[0]=i=>Ze(e)?e.value=i:null),label:"Chart Theme",options:p(n),block:""},null,8,["modelValue","options"]))}}),Hhe={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Whe(t,e){return w(),R("svg",Hhe,[...e[0]||(e[0]=[A("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 Uhe=Oe({name:"ph-line-segments",render:Whe}),Ghe={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function qhe(t,e){return w(),R("svg",Ghe,[...e[0]||(e[0]=[A("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 Yhe=Oe({name:"ph-paint-brush",render:qhe}),jhe={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Khe(t,e){return w(),R("svg",jhe,[...e[0]||(e[0]=[A("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 Xhe=Oe({name:"ph-chart-line",render:Khe}),Zhe={class:"d-flex flex-column gap-4"},Qhe=se({__name:"EditorAppearanceTab",setup(t){const{chartType:e}=dn(),{availableOptionKeys:n}=Cn(),o=S(()=>e.value.includes("horizontal")||e.value===Ve.BarStacked||e.value===Ve.BarSplit||e.value===Ve.BarGrouped?_d:Gs),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=zhe,f=Vhe,h=khe,m=yhe,b=vhe,g=mhe;return w(),R("div",Zhe,[H(p(Uo),{title:"Theme",icon:p(Yhe)},{default:J(()=>[H(d)]),_:1},8,["icon"]),H(p(Uo),{title:"Colors",icon:p(_O)},{default:J(()=>[H(f)]),_:1},8,["icon"]),p(s)?(w(),Q(p(Uo),{key:0,title:"Line Style",icon:p(Uhe)},{default:J(()=>[H(h)]),_:1},8,["icon"])):oe("",!0),p(a)?(w(),Q(p(Uo),{key:1,title:"Bar Style",icon:p(o)},{default:J(()=>[H(m)]),_:1},8,["icon"])):oe("",!0),p(l)?(w(),Q(p(Uo),{key:2,title:"Slices",icon:p(kA)},{default:J(()=>[H(b)]),_:1},8,["icon"])):oe("",!0),p(r)?(w(),Q(p(Uo),{key:3,title:"Areas",icon:p(Xhe)},{default:J(()=>[H(g)]),_:1},8,["icon"])):oe("",!0)])}}}),Jhe={class:"d-flex flex-column gap-3"},epe=se({__name:"EditorPropertyForm",setup(t){const{title:e,description:n,byline:o,note:r,source:i,sourceUrl:s}=dn();return(a,l)=>{const c=da,u=Mn,d=Ky;return w(),R("div",Jhe,[H(u,{label:"Title","label-for":"prop-title"},{default:J(()=>[H(c,{id:"prop-title",modelValue:p(e),"onUpdate:modelValue":l[0]||(l[0]=f=>Ze(e)?e.value=f:null),placeholder:"Chart title"},null,8,["modelValue"])]),_:1}),H(u,{label:"Description","label-for":"prop-description"},{default:J(()=>[H(d,{id:"prop-description",modelValue:p(n),"onUpdate:modelValue":l[1]||(l[1]=f=>Ze(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:J(()=>[H(c,{id:"prop-byline",modelValue:p(o),"onUpdate:modelValue":l[2]||(l[2]=f=>Ze(o)?o.value=f:null),placeholder:"Author or byline"},null,8,["modelValue"])]),_:1}),H(u,{label:"Note","label-for":"prop-note"},{default:J(()=>[H(d,{id:"prop-note",modelValue:p(r),"onUpdate:modelValue":l[3]||(l[3]=f=>Ze(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:J(()=>[H(c,{id:"prop-source",modelValue:p(i),"onUpdate:modelValue":l[4]||(l[4]=f=>Ze(i)?i.value=f:null),placeholder:"Data source"},null,8,["modelValue"])]),_:1}),H(u,{label:"Source URL","label-for":"prop-source-url"},{default:J(()=>[H(c,{id:"prop-source-url",modelValue:p(s),"onUpdate:modelValue":l[5]||(l[5]=f=>Ze(s)?s.value=f:null),type:"url",placeholder:"https://..."},null,8,["modelValue"])]),_:1})])}}}),LO={render(){return zt("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%"})}},PO={render(){return zt("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%"})}},DO={render(){return zt("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%"})}},EO={render(){return zt("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%"})}},IO={render(){return zt("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%"})}},tpe={render(){return zt("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%"})}},npe={render(){return zt("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%"})}},ope={render(){return zt("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%"})}},rpe={render(){return zt("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%"})}},ipe={render(){return zt("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%"})}},spe={render(){return zt("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%"})}},NO={render(){return zt("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%"})}},RO={render(){return zt("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%"})}},ape=se({__name:"EditorChartTypePicker",setup(t){const{chartType:e,selectedColumn:n}=dn(),{currentOptions:o,availableOptionKeys:r,setOption:i}=Cn(),s=er(),a=S(()=>r.value.includes("stackMode")),l=[{value:"normal",text:"Normal"},{value:"percent",text:"Percentage (100%)"}],c=[{value:Ve.BarVertical,label:"Columns",description:"Compare values across categories",visual:Oe(LO)},{value:Ve.BarHorizontal,label:"Bars",description:"Compare values with long labels",visual:Oe(PO)},{value:Ve.BarMulti,label:"Grouped Columns",description:"Compare multiple series side by side",visual:Oe(DO)},{value:Ve.ColumnStacked,label:"Stacked Columns",description:"Compare stacked totals",visual:Oe(ope)},{value:Ve.BarStacked,label:"Stacked Bars",description:"Compare stacked totals horizontally",visual:Oe(rpe)},{value:Ve.BarSplit,label:"Split Bars",description:"Compare multiple metrics in separate bar panels",visual:Oe(ipe)},{value:Ve.BarGrouped,label:"Grouped Bars",description:"Compare multiple series side by side horizontally",visual:Oe(spe)},{value:Ve.Line,label:"Line",description:"Show trends over time",visual:Oe(EO)},{value:Ve.LineMulti,label:"Lines",description:"Compare trends across series",visual:Oe(IO)},{value:Ve.Area,label:"Area",description:"Show magnitude over time",visual:Oe(tpe)},{value:Ve.AreaStacked,label:"Areas",description:"Compare and stack multiple area series",visual:Oe(npe)},{value:Ve.Donut,label:"Donut",description:"Show proportions with a center space",visual:Oe(NO)},{value:Ve.Pie,label:"Pie",description:"Show parts of a whole",visual:Oe(RO)}],u=[Ve.BarVertical,Ve.BarHorizontal,Ve.Line,Ve.Area,Ve.VerticalBar,Ve.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 Ke([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=nl;return w(),R(Re,null,[H(b,{label:"Chart type","label-for":"chart-type-select"},{default:J(()=>[H(p(Rn),{id:"chart-type-select",modelValue:p(e),"onUpdate:modelValue":m[0]||(m[0]=v=>Ze(e)?e.value=v:null),block:"",options:c},null,8,["modelValue"])]),_:1}),p(d)?(w(),Q(b,{key:0,label:"Data column","label-for":"column-select",class:"mt-3"},{default:J(()=>[H(g,{id:"column-select",modelValue:p(n),"onUpdate:modelValue":m[1]||(m[1]=v=>Ze(n)?n.value=v:null),options:p(f)},null,8,["modelValue","options"])]),_:1})):oe("",!0),p(a)?(w(),Q(b,{key:1,label:"Stack mode","label-for":"opt-stack-mode",class:"mt-3"},{default:J(()=>[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})):oe("",!0)],64)}}}),lpe=100,cpe=Qn("chartHistory",()=>{const t=new Map,e=Ne(!1),n=Ne(!1);let o="",r=!1,i=!1;function s(d){let f=t.get(d);return f||(f={undoStack:[],redoStack:[],currentState:""},t.set(d,f)),f}function a(d,f){const h={config:{chartType:d.chartType,title:d.title,description:d.description,byline:d.byline,note:d.note,source:d.source,sourceUrl:d.sourceUrl,sort:d.sort,data:d.data,selectedColumn:d.selectedColumn,colorizes:JSON.parse(JSON.stringify(d.colorizes)),highlights:JSON.parse(JSON.stringify(d.highlights)),areaFills:JSON.parse(JSON.stringify(d.areaFills)),annotations:JSON.parse(JSON.stringify(d.annotations)),seriesOverrides:JSON.parse(JSON.stringify(d.seriesOverrides??[])),layout:JSON.parse(JSON.stringify(d.layout??Af))},typeOptions:JSON.parse(JSON.stringify(f))};return JSON.stringify(h)}function l(){const d=t.get(o);e.value=d?d.undoStack.length>0:!1,n.value=d?d.redoStack.length>0:!1}function c(d){const f=s(o);d!==f.currentState&&(f.undoStack.push(f.currentState),f.undoStack.length>lpe&&f.undoStack.shift(),f.redoStack.length=0,f.currentState=d,l())}function u(){const d=dn(),{store:f,hydrate:h}=Cn(),{sessionId:m}=Pr();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,cm(!0).run(()=>{Ke(m,_=>{if(r=!0,o=_,_){const C=s(_);C.currentState||(C.currentState=b())}l(),kn(()=>{r=!1})},{immediate:!0,flush:"sync"}),Ke([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),kn(()=>{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 upe(){const t=cpe(),{canUndo:e,canRedo:n}=Tt(t),{undo:o,redo:r}=t.init();return{canUndo:e,canRedo:n,undo:o,redo:r}}const dpe={class:"chart-edit-toolbar"},fpe=se({__name:"ChartEditToolbar",setup(t){const e=pr(),{viewMode:n}=Tt(e),{setViewMode:o}=e,{canUndo:r,canRedo:i,undo:s,redo:a}=upe(),l=S({get:()=>n.value,set:u=>o(u)}),c=[{value:"preview",text:"Preview"},{value:"dsl",text:"DSL"}];return(u,d)=>(w(),R("div",dpe,[H(p(xU),{disabled:!p(r),onClick:p(s)},null,8,["disabled","onClick"]),H(p(gU),{disabled:!p(i),onClick:p(a)},null,8,["disabled","onClick"]),H(p(XU),{modelValue:p(l),"onUpdate:modelValue":d[0]||(d[0]=f=>Ze(l)?l.value=f:null),options:c,size:"sm"},null,8,["modelValue"])]))}}),hpe=Be(fpe,[["__scopeId","data-v-de044834"]]);let Db=[],FO=[];(()=>{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?FO:Db).push(n=n+t[e])})();function ppe(t){if(t<768)return!1;for(let e=0,n=Db.length;;){let o=e+n>>1;if(t<Db[o])n=o;else if(t>=FO[o])e=o+1;else return!0;if(e==n)return!1}}function Dk(t){return t>=127462&&t<=127487}const Ek=8205;function mpe(t,e,n=!0,o=!0){return(n?VO:gpe)(t,e,o)}function VO(t,e,n){if(e==t.length)return e;e&&zO(t.charCodeAt(e))&&HO(t.charCodeAt(e-1))&&e--;let o=n1(t,e);for(e+=Ik(o);e<t.length;){let r=n1(t,e);if(o==Ek||r==Ek||n&&ppe(r))e+=Ik(r),o=r;else if(Dk(r)){let i=0,s=e-2;for(;s>=0&&Dk(n1(t,s));)i++,s-=2;if(i%2==0)break;e+=2}else break}return e}function gpe(t,e,n){for(;e>0;){let o=VO(t,e-2,n);if(o<e)return o;e--}return 0}function n1(t,e){let n=t.charCodeAt(e);if(!HO(n)||e+1==t.length)return n;let o=t.charCodeAt(e+1);return zO(o)?(n-55296<<10)+(o-56320)+65536:n}function zO(t){return t>=56320&&t<57344}function HO(t){return t>=55296&&t<56320}function Ik(t){return t<65536?1:2}class qt{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]=Au(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),Ji.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]=Au(this,e,n);let o=[];return this.decompose(e,n,o,0),Ji.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 Kd(this),i=new Kd(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 Kd(this,e)}iterRange(e,n=this.length){return new WO(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 UO(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]?qt.empty:e.length<=32?new An(e):Ji.from(An.split(e,[]))}}class An extends qt{constructor(e,n=vpe(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 bpe(r,a,o,s);r=a+1,o++}}decompose(e,n,o,r){let i=e<=0&&n>=this.length?this:new An(Nk(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(r&1){let s=o.pop(),a=Cp(i.text,s.text.slice(),0,i.length);if(a.length<=32)o.push(new An(a,s.length+i.length));else{let l=a.length>>1;o.push(new An(a.slice(0,l)),new An(a.slice(l)))}}else o.push(i)}replace(e,n,o){if(!(o instanceof An))return super.replace(e,n,o);[e,n]=Au(this,e,n);let r=Cp(this.text,Cp(o.text,Nk(this.text,0,e)),n),i=this.length+o.length-(n-e);return r.length<=32?new An(r,i):Ji.from(An.split(r,[]),i)}sliceString(e,n=this.length,o=`
|
|
918
|
+
`){[e,n]=Au(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 An(o,r)),o=[],r=-1);return r>-1&&n.push(new An(o,r)),n}}class Ji extends qt{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]=Au(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 Ji(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=`
|
|
919
|
+
`){[e,n]=Au(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 Ji))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 An(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 Ji)for(let b of h.children)d(b);else h.lines>s&&(l>s||!l)?(f(),a.push(h)):h instanceof An&&l&&(m=u[u.length-1])instanceof An&&h.lines+m.lines<=32?(l+=h.lines,c+=h.length+1,u[u.length-1]=new An(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]:Ji.from(u,c)),c=-1,l=u.length=0)}for(let h of e)d(h);return f(),a.length==1?a[0]:new Ji(a,n)}}qt.empty=new An([""],0);function vpe(t){let e=-1;for(let n of t)e+=n.length+1;return e}function Cp(t,e,n=0,o=1e9){for(let r=0,i=0,s=!0;i<t.length&&r<=o;i++){let a=t[i],l=r+a.length;l>=n&&(l>o&&(a=a.slice(0,o-r)),r<n&&(a=a.slice(n-r)),s?(e[e.length-1]+=a,s=!1):e.push(a)),r=l+1}return e}function Nk(t,e,n){return Cp(t,[""],e,n)}class Kd{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 An?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 An?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=`
|
|
920
|
+
`,this;e--}else if(r instanceof An){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 An?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 WO{constructor(e,n,o){this.value="",this.done=!1,this.cursor=new Kd(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 UO{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"&&(qt.prototype[Symbol.iterator]=function(){return this.iter()},Kd.prototype[Symbol.iterator]=WO.prototype[Symbol.iterator]=UO.prototype[Symbol.iterator]=function(){return this});class bpe{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 Au(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function Po(t,e,n=!0,o=!0){return mpe(t,e,n,o)}function ype(t){return t>=56320&&t<57344}function xpe(t){return t>=55296&&t<56320}function wpe(t,e){let n=t.charCodeAt(e);if(!xpe(n)||e+1==t.length)return n;let o=t.charCodeAt(e+1);return ype(o)?(n-55296<<10)+(o-56320)+65536:n}function _pe(t){return t<65536?1:2}const Eb=/\r\n?|\n/;var kr=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(kr||(kr={}));class fs{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){Ib(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 fs(e)}composeDesc(e){return this.empty?e:e.empty?this:GO(this,e)}mapDesc(e,n=!1){return e.empty?this:Nb(this,e,n)}mapPos(e,n=-1,o=kr.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!=kr.Simple&&c>=e&&(o==kr.TrackDel&&r<e&&c>e||o==kr.TrackBefore&&r<e||o==kr.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 fs(e)}static create(e){return new fs(e)}}class Kn extends fs{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 Ib(this,(n,o,r,i,s)=>e=e.replace(r,r+(o-n),s),!1),e}mapDesc(e,n=!1){return Nb(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(qt.empty);o.push(s?e.slice(i,i+s):qt.empty)}i+=s}return new Kn(n,o)}compose(e){return this.empty?e:e.empty?this:GO(this,e,!0)}map(e,n=!1){return e.empty?this:Nb(this,e,n,!0)}iterChanges(e,n=!1){Ib(this,e,n)}get desc(){return fs.create(this.sections)}filter(e){let n=[],o=[],r=[],i=new Lf(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);_o(r,u,-1);let d=i.ins==-1?-1:i.off==0?i.ins:0;_o(n,u,d),d>0&&Da(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);_o(n,u,-1),_o(r,u,i.ins==-1?-1:i.off==0?i.ins:0),i.forward(u),a+=u}}return{changes:new Kn(n,o),filtered:fs.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&&_o(r,n-s,-1);let d=new Kn(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 Kn){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"?qt.of(h.split(o||Eb)):h:qt.empty,b=m.length;if(d==f&&b==0)return;d<s&&l(),d>s&&_o(r,d-s,-1),_o(r,f-d,b),Da(i,r,m),s=f}}return c(e),l(!a),a}static empty(e){return new Kn(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(qt.empty);o[r]=qt.of(i.slice(1)),n.push(i[0],o[r].length)}}}return new Kn(n,o)}static createSet(e,n){return new Kn(e,n)}}function _o(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 Da(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(qt.empty);t.push(n)}}function Ib(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=qt.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 Nb(t,e,n,o=!1){let r=[],i=o?[]:null,s=new Lf(t),a=new Lf(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);_o(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(_o(r,a.ins,-1);c;){let u=Math.min(s.len,c);s.ins>=0&&l<s.i&&s.len<=u&&(_o(r,0,s.ins),i&&Da(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;_o(r,c,l<s.i?s.ins:0),i&&l<s.i&&Da(i,r,s.text),l=s.i,s.forward(s.len-u)}else{if(s.done&&a.done)return i?Kn.createSet(r,i):fs.create(r);throw new Error("Mismatched change set lengths")}}}function GO(t,e,n=!1){let o=[],r=n?[]:null,i=new Lf(t),s=new Lf(e);for(let a=!1;;){if(i.done&&s.done)return r?Kn.createSet(o,r):fs.create(o);if(i.ins==0)_o(o,i.len,0,a),i.next();else if(s.len==0&&!s.done)_o(o,0,s.ins,a),r&&Da(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;_o(o,l,u,a),r&&u&&Da(r,o,s.text)}else s.ins==-1?(_o(o,i.off?0:i.len,l,a),r&&Da(r,o,i.textBit(l))):(_o(o,i.off?0:i.len,s.off?0:s.ins,a),r&&!s.off&&Da(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 Lf{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?qt.empty:e[n]}textBit(e){let{inserted:n}=this.set,o=this.i-2>>1;return o>=n.length&&!e?qt.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 Dl{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 Dl(o,r,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return Ye.range(e,n);let o=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return Ye.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 Ye.range(e.anchor,e.head)}static create(e,n,o){return new Dl(e,n,o)}}class Ye{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:Ye.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 Ye([this.main],0)}addRange(e,n=!0){return Ye.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let o=this.ranges.slice();return o[n]=e,Ye.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 Ye(e.ranges.map(n=>Dl.fromJSON(n)),e.main)}static single(e,n=e){return new Ye([Ye.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 Ye.normalized(e.slice(),n);o=i.to}return new Ye(e,n)}static cursor(e,n=0,o,r){return Dl.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?Dl.create(n,e,48|i):Dl.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?Ye.range(l,a):Ye.range(a,l))}}return new Ye(e,n)}}function qO(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let Ax=0;class xt{constructor(e,n,o,r,i){this.combine=e,this.compareInput=n,this.compare=o,this.isStatic=r,this.id=Ax++,this.default=e([]),this.extensions=typeof i=="function"?i(this):i}get reader(){return this}static define(e={}){return new xt(e.combine||(n=>n),e.compareInput||((n,o)=>n===o),e.compare||(e.combine?(n,o)=>n===o:$x),!!e.static,e.enables)}of(e){return new Ap([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ap(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ap(e,this,2,n)}from(e,n){return n||(n=o=>o),this.compute([e],o=>n(o.field(e)))}}function $x(t,e){return t==e||t.length==e.length&&t.every((n,o)=>n===e[o])}class Ap{constructor(e,n,o,r){this.dependencies=e,this.facet=n,this.type=o,this.value=r,this.id=Ax++}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)||Rb(d,u)){let h=o(d);if(a?!Rk(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=R0(f,m);if(this.dependencies.every(g=>g instanceof xt?f.facet(g)===d.facet(g):g instanceof hl?f.field(g,!1)==d.field(g,!1):!0)||(a?Rk(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 Rk(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 Rb(t,e){let n=!1;for(let o of e)Xd(t,o)&1&&(n=!0);return n}function kpe(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=R0(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)Xd(l,c);return l.values[s]=a(l),1},update(l,c){if(!Rb(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=Rb(l,o),d=c.config.facets[e.id],f=c.facet(e);if(d&&!u&&$x(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 Uh=xt.define({static:!0});class hl{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 hl(Ax++,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(Uh).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(Uh),s=r.facet(Uh),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,Uh.of({field:this,create:e})]}get extension(){return this}}const Bl={lowest:4,low:3,default:2,high:1,highest:0};function md(t){return e=>new YO(e,t)}const Tx={highest:md(Bl.highest),high:md(Bl.high),default:md(Bl.default),low:md(Bl.low),lowest:md(Bl.lowest)};class YO{constructor(e,n){this.inner=e,this.prec=n}}class Rg{of(e){return new Fb(this,e)}reconfigure(e){return Rg.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Fb{constructor(e,n){this.compartment=e,this.inner=n}}class N0{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 Spe(e,n,s))f instanceof hl?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,$x(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=>kpe(g,m,h))}}let d=c.map(f=>f(a));return new N0(e,s,d,a,l,i)}}function Spe(t,e,n){let o=[[],[],[],[],[]],r=new Map;function i(s,a){let l=r.get(s);if(l!=null){if(l<=a)return;let c=o[l].indexOf(s);c>-1&&o[l].splice(c,1),s instanceof Fb&&n.delete(s.compartment)}if(r.set(s,a),Array.isArray(s))for(let c of s)i(c,a);else if(s instanceof Fb){if(n.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(s.compartment)||s.inner;n.set(s.compartment,c),i(c,a)}else if(s instanceof YO)i(s.inner,s.prec);else if(s instanceof hl)o[a].push(s),s.provides&&i(s.provides,a);else if(s instanceof Ap)o[a].push(s),s.facet.extensions&&i(s.facet.extensions,Bl.default);else{let c=s.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);i(c,a)}}return i(t,Bl.default),o.reduce((s,a)=>s.concat(a))}function Xd(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 R0(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const jO=xt.define(),Vb=xt.define({combine:t=>t.some(e=>e),static:!0}),KO=xt.define({combine:t=>t.length?t[0]:void 0,static:!0}),XO=xt.define(),ZO=xt.define(),QO=xt.define(),JO=xt.define({combine:t=>t.length?t[0]:!1});class pl{constructor(e,n){this.type=e,this.value=n}static define(){return new Cpe}}class Cpe{of(e){return new pl(this,e)}}class Ape{constructor(e){this.map=e}of(e){return new Tn(this,e)}}class Tn{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new Tn(this.type,n)}is(e){return this.type==e}static define(e={}){return new Ape(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let o=[];for(let r of e){let i=r.map(n);i&&o.push(i)}return o}}Tn.reconfigure=Tn.define();Tn.appendConfig=Tn.define();class Zn{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&&qO(o,n.newLength),i.some(a=>a.type==Zn.time)||(this.annotations=i.concat(Zn.time.of(Date.now())))}static create(e,n,o,r,i,s){return new Zn(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(Zn.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}Zn.time=pl.define();Zn.userEvent=pl.define();Zn.addToHistory=pl.define();Zn.remote=pl.define();function $pe(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 eM(t,e,n){var o;let r,i,s;return n?(r=e.changes,i=Kn.empty(e.changes.length),s=t.changes.compose(e.changes)):(r=e.changes.map(t.changes),i=t.changes.mapDesc(e.changes,!0),s=t.changes.compose(r)),{changes:s,selection:e.selection?e.selection.map(i):(o=t.selection)===null||o===void 0?void 0:o.map(r),effects:Tn.mapEffects(t.effects,r).concat(Tn.mapEffects(e.effects,i)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function zb(t,e,n){let o=e.selection,r=nu(e.annotations);return e.userEvent&&(r=r.concat(Zn.userEvent.of(e.userEvent))),{changes:e.changes instanceof Kn?e.changes:Kn.of(e.changes||[],n,t.facet(KO)),selection:o&&(o instanceof Ye?o:Ye.single(o.anchor,o.head)),effects:nu(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function tM(t,e,n){let o=zb(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=eM(o,zb(t,e[i],s?o.changes.newLength:t.doc.length),s)}let r=Zn.create(t,o.changes,o.selection,o.effects,o.annotations,o.scrollIntoView);return Ope(n?Tpe(r):r)}function Tpe(t){let e=t.startState,n=!0;for(let r of e.facet(XO)){let i=r(t);if(i===!1){n=!1;break}Array.isArray(i)&&(n=n===!0?i:$pe(n,i))}if(n!==!0){let r,i;if(n===!1)i=t.changes.invertedDesc,r=Kn.empty(e.doc.length);else{let s=t.changes.filter(n);r=s.changes,i=s.filtered.mapDesc(s.changes).invertedDesc}t=Zn.create(e,r,t.selection&&t.selection.map(i),Tn.mapEffects(t.effects,i),t.annotations,t.scrollIntoView)}let o=e.facet(ZO);for(let r=o.length-1;r>=0;r--){let i=o[r](t);i instanceof Zn?t=i:Array.isArray(i)&&i.length==1&&i[0]instanceof Zn?t=i[0]:t=tM(e,nu(i),!1)}return t}function Ope(t){let e=t.startState,n=e.facet(QO),o=t;for(let r=n.length-1;r>=0;r--){let i=n[r](t);i&&Object.keys(i).length&&(o=eM(o,zb(e,i,t.changes.newLength),!0))}return o==t?t:Zn.create(e,t.changes,t.selection,o.effects,o.annotations,o.scrollIntoView)}const Mpe=[];function nu(t){return t==null?Mpe:Array.isArray(t)?t:[t]}var js=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(js||(js={}));const Bpe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Hb;try{Hb=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Lpe(t){if(Hb)return Hb.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||Bpe.test(n)))return!0}return!1}function Ppe(t){return e=>{if(!/\S/.test(e))return js.Space;if(Lpe(e))return js.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return js.Word;return js.Other}}class Jt{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++)Xd(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 Xd(this,o),R0(this,o)}update(...e){return tM(this,e,!0)}applyTransaction(e){let n=this.config,{base:o,compartments:r}=n;for(let a of e.effects)a.is(Rg.reconfigure)?(n&&(r=new Map,n.compartments.forEach((l,c)=>r.set(c,l)),n=null),r.set(a.value.compartment,a.value.extension)):a.is(Tn.reconfigure)?(n=null,o=a.value):a.is(Tn.appendConfig)&&(n=null,o=nu(o).concat(a.value));let i;n?i=e.startState.values.slice():(n=N0.resolve(o,r,this),i=new Jt(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(l,c)=>c.reconfigure(l,this),null).values);let s=e.startState.facet(Vb)?e.newSelection:e.newSelection.asSingle();new Jt(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:Ye.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=nu(o.effects);for(let a=1;a<n.ranges.length;a++){let l=e(n.ranges[a]),c=this.changes(l.changes),u=c.map(r);for(let f=0;f<a;f++)i[f]=i[f].map(u);let d=r.mapDesc(c,!0);i.push(l.range.map(d)),r=r.compose(u),s=Tn.mapEffects(s,u).concat(Tn.mapEffects(nu(l.effects),d))}return{changes:r,selection:Ye.create(i,n.mainIndex),effects:s}}changes(e=[]){return e instanceof Kn?e:Kn.of(e,this.doc.length,this.facet(Jt.lineSeparator))}toText(e){return qt.of(e.split(this.facet(Jt.lineSeparator)||Eb))}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:(Xd(this,n),R0(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 hl&&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 Jt.create({doc:e.doc,selection:Ye.fromJSON(e.selection),extensions:n.extensions?r.concat([n.extensions]):r})}static create(e={}){let n=N0.resolve(e.extensions||[],new Map),o=e.doc instanceof qt?e.doc:qt.of((e.doc||"").split(n.staticFacet(Jt.lineSeparator)||Eb)),r=e.selection?e.selection instanceof Ye?e.selection:Ye.single(e.selection.anchor,e.selection.head):Ye.single(0);return qO(r,o.length),n.staticFacet(Vb)||(r=r.asSingle()),new Jt(n,o,r,n.dynamicSlots.map(()=>null),(i,s)=>s.create(i),null)}get tabSize(){return this.facet(Jt.tabSize)}get lineBreak(){return this.facet(Jt.lineSeparator)||`
|
|
921
|
+
`}get readOnly(){return this.facet(JO)}phrase(e,...n){for(let o of this.facet(Jt.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(jO))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 Ppe(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=Po(n,s,!1);if(i(n.slice(l,s))!=js.Word)break;s=l}for(;a<r;){let l=Po(n,a);if(i(n.slice(a,l))!=js.Word)break;a=l}return s==a?null:Ye.range(s+o,a+o)}}Jt.allowMultipleSelections=Vb;Jt.tabSize=xt.define({combine:t=>t.length?t[0]:4});Jt.lineSeparator=KO;Jt.readOnly=JO;Jt.phrases=xt.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])}});Jt.languageData=jO;Jt.changeFilter=XO;Jt.transactionFilter=ZO;Jt.transactionExtender=QO;Rg.reconfigure=Tn.define();function Dpe(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 tc{eq(e){return this==e}range(e,n=e){return Wb.create(e,n,this)}}tc.prototype.startSide=tc.prototype.endSide=0;tc.prototype.point=!1;tc.prototype.mapMode=kr.TrackDel;function Ox(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let Wb=class nM{constructor(e,n,o){this.from=e,this.to=n,this.value=o}static create(e,n,o){return new nM(e,n,o)}};function Ub(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class Mx{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 Mx(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(Ub)),this.isEmpty)return n.length?nn.of(n):this;let a=new oM(this,null,-1).goto(0),l=0,c=[],u=new Pf;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(Wb.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 Df.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return Df.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=Fk(s,a,o),c=new gd(s,l,i),u=new gd(a,l,i);o.iterGaps((d,f,h)=>Vk(c,d,u,f,h,r)),o.empty&&o.length==0&&Vk(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=Fk(i,s),l=new gd(i,a,0).goto(o),c=new gd(s,a,0).goto(o);for(;;){if(l.to!=c.to||!Gb(l.active,c.active)||l.point&&(!c.point||!Ox(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 gd(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 Pf;for(let r of e instanceof Wb?[e]:n?Epe(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 Epe(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let o=t[n];if(Ub(e,o)>0)return t.slice().sort(Ub);e=o}return t}nn.empty.nextLayer=nn.empty;class Pf{finishChunk(e){this.chunks.push(new Mx(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 Pf)).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 Fk(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 oM{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 Df{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 oM(s,n,o,i));return r.length==1?r[0]:new Df(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--)o1(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--)o1(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(),o1(this.heap,0)}}}function o1(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 gd{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=Df.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=zk(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++;qh(this.active,n,o),qh(this.activeTo,n,r),qh(this.activeRank,n,i),e&&qh(e,n,this.cursor.from),this.minActive=zk(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 Vk(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&&Ox(t.point,n.point)&&Gb(t.activeForPoint(t.to),n.activeForPoint(n.to))||i.comparePoint(a,m,t.point,n.point),u=!1):(u&&i.boundChange(a),m>a&&!Gb(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 Gb(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!Ox(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 qh(t,e,n){for(let o=t.length-1;o>=e;o--)t[o+1]=t[o];t[e]=n}function zk(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 Fg(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=Po(t,r));return o}function Ipe(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=Po(t,r)}return t.length}const qb="ͼ",Hk=typeof Symbol>"u"?"__"+qb:Symbol.for(qb),Yb=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Wk=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Xa{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(`
|
|
922
|
+
`)}static newName(){let e=Wk[Hk]||1;return Wk[Hk]=e+1,qb+e.toString(36)}static mount(e,n,o){let r=e[Yb],i=o&&o.nonce;r?i&&r.setNonce(i):r=new Npe(e,i),r.mount(Array.isArray(n)?n:[n],e)}}let Uk=new Map;class Npe{constructor(e,n){let o=e.ownerDocument||e,r=o.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let i=Uk.get(o);if(i)return e[Yb]=i;this.sheet=new r.CSSStyleSheet,Uk.set(o,this)}else this.styleTag=o.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[Yb]=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()+`
|
|
923
|
+
`;this.styleTag.textContent=s;let a=n.head||n;this.styleTag.parentNode!=a&&a.insertBefore(this.styleTag,a.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var Za={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Ef={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Rpe=typeof navigator<"u"&&/Mac/.test(navigator.platform),Fpe=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var co=0;co<10;co++)Za[48+co]=Za[96+co]=String(co);for(var co=1;co<=24;co++)Za[co+111]="F"+co;for(var co=65;co<=90;co++)Za[co]=String.fromCharCode(co+32),Ef[co]=String.fromCharCode(co);for(var r1 in Za)Ef.hasOwnProperty(r1)||(Ef[r1]=Za[r1]);function Vpe(t){var e=Rpe&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Fpe&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Ef:Za)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}let Ho=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},jb=typeof document<"u"?document:{documentElement:{style:{}}};const Kb=/Edge\/(\d+)/.exec(Ho.userAgent),rM=/MSIE \d/.test(Ho.userAgent),Xb=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ho.userAgent),Vg=!!(rM||Xb||Kb),Gk=!Vg&&/gecko\/(\d+)/i.test(Ho.userAgent),i1=!Vg&&/Chrome\/(\d+)/.exec(Ho.userAgent),zpe="webkitFontSmoothing"in jb.documentElement.style,Zb=!Vg&&/Apple Computer/.test(Ho.vendor),qk=Zb&&(/Mobile\/\w+/.test(Ho.userAgent)||Ho.maxTouchPoints>2);var it={mac:qk||/Mac/.test(Ho.platform),windows:/Win/.test(Ho.platform),linux:/Linux|X11/.test(Ho.platform),ie:Vg,ie_version:rM?jb.documentMode||6:Xb?+Xb[1]:Kb?+Kb[1]:0,gecko:Gk,gecko_version:Gk?+(/Firefox\/(\d+)/.exec(Ho.userAgent)||[0,0])[1]:0,chrome:!!i1,chrome_version:i1?+i1[1]:0,ios:qk,android:/Android\b/.test(Ho.userAgent),webkit_version:zpe?+(/\bAppleWebKit\/(\d+)/.exec(Ho.userAgent)||[0,0])[1]:0,safari:Zb,safari_version:Zb?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Ho.userAgent)||[0,0])[1]:0,tabSize:jb.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function Bx(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 F0=Object.create(null);function Lx(t,e,n){if(t==e)return!0;t||(t=F0),e||(e=F0);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 Hpe(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 Yk(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 Wpe(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 zg{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 Xr=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(Xr||(Xr={}));class no extends tc{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 rh(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 nc(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}=iM(e,n);o=(i?n?-3e8:-1:5e8)-1,r=(s?n?2e8:1:-6e8)+1}return new nc(e,o,r,n,e.widget||null,!0)}static line(e){return new ih(e)}static set(e,n=!1){return nn.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}no.none=nn.empty;class rh extends no{constructor(e){let{start:n,end:o}=iM(e);super(n?-1:5e8,o?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?Bx(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||F0}eq(e){return this==e||e instanceof rh&&this.tagName==e.tagName&&Lx(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)}}rh.prototype.point=!1;class ih extends no{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof ih&&this.spec.class==e.spec.class&&Lx(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)}}ih.prototype.mapMode=kr.TrackBefore;ih.prototype.point=!0;class nc extends no{constructor(e,n,o,r,i,s){super(n,o,i,e),this.block=r,this.isReplace=s,this.mapMode=r?n<=0?kr.TrackBefore:kr.TrackAfter:kr.TrackDel}get type(){return this.startSide!=this.endSide?Xr.WidgetRange:this.startSide<=0?Xr.WidgetBefore:Xr.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof nc&&Upe(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)}}nc.prototype.point=!0;function iM(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 Upe(t,e){return t==e||!!(t&&e&&t.compare(e))}function ou(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 If extends tc{constructor(e,n){super(),this.tagName=e,this.attributes=n}eq(e){return e==this||e instanceof If&&this.tagName==e.tagName&&Lx(this.attributes,e.attributes)}static create(e){return new If(e.tagName,e.attributes||F0)}static set(e,n=!1){return nn.of(e,n)}}If.prototype.startSide=If.prototype.endSide=-1;function Nf(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function Qb(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function Zd(t,e){if(!e.anchorNode)return!1;try{return Qb(t,e.anchorNode)}catch{return!1}}function $p(t){return t.nodeType==3?Rf(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function Qd(t,e,n,o){return n?jk(t,e,n,o,-1)||jk(t,e,n,o,1):!1}function Qa(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function V0(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function jk(t,e,n,o,r){for(;;){if(t==n&&e==o)return!0;if(e==(r<0?0:sa(t))){if(t.nodeName=="DIV")return!1;let i=t.parentNode;if(!i||i.nodeType!=1)return!1;e=Qa(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?sa(t):0}else return!1}}function sa(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function z0(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function Gpe(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 sM(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 qpe(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=Gpe(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}=sM(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 Ype(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 jpe{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?sa(n):0),o,Math.min(e.focusOffset,o?sa(o):0))}set(e,n,o,r){this.anchorNode=e,this.anchorOffset=n,this.focusNode=o,this.focusOffset=r}}let Tl=null;it.safari&&it.safari_version>=26&&(Tl=!1);function aM(t){if(t.setActive)return t.setActive();if(Tl)return t.focus(Tl);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(Tl==null?{get preventScroll(){return Tl={preventScroll:!0},!0}}:void 0),!Tl){Tl=!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 Kk;function Rf(t,e,n=e){let o=Kk||(Kk=document.createRange());return o.setEnd(t,n),o.setStart(t,e),o}function ru(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 Kpe(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function Xpe(t,e){let n=e.focusNode,o=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=o)return!1;for(o=Math.min(o,sa(n));;)if(o){if(n.nodeType!=1)return!1;let r=n.childNodes[o-1];r.contentEditable=="false"?o--:(n=r,o=sa(n))}else{if(n==t)return!0;o=Qa(n),n=n.parentNode}}function lM(t){return t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function cM(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=sa(n)}else if(n.parentNode&&!V0(n))o=Qa(n),n=n.parentNode;else return null}}function uM(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&&!V0(n))o=Qa(n)+1,n=n.parentNode;else return null}}class vi{constructor(e,n,o=!0){this.node=e,this.offset=n,this.precise=o}static before(e,n){return new vi(e.parentNode,Qa(e),n)}static after(e,n){return new vi(e.parentNode,Qa(e)+1,n)}}var Nn=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(Nn||(Nn={}));const oc=Nn.LTR,Px=Nn.RTL;function dM(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const Zpe=dM("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),Qpe=dM("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Jb=Object.create(null),qi=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);Jb[e]=n,Jb[n]=-e}function fM(t){return t<=247?Zpe[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?Qpe[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const Jpe=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class os{get dir(){return this.level%2?Px:oc}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 hM(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||!hM(o.inner,r.inner))return!1}return!0}const cn=[];function e0e(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=fM(t.charCodeAt(c));f==512?f=u:f==8&&d==4&&(f=16),cn[c]=f==4?2:f,f&7&&(d=f),u=f}for(let c=s,u=l,d=l;c<a;c++){let f=cn[c];if(f==128)c<a-1&&u==cn[c+1]&&u&24?f=cn[c]=u:cn[c]=256;else if(f==64){let h=c+1;for(;h<a&&cn[h]==64;)h++;let m=c&&u==8||h<n&&cn[h]==8?d==1?1:8:256;for(let b=c;b<h;b++)cn[b]=m;c=h-1}else f==8&&d==1&&(cn[c]=1);u=f,f&7&&(d=f)}}}function t0e(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=Jb[f=t.charCodeAt(d)])if(h<0){for(let b=a-3;b>=0;b-=3)if(qi[b+1]==-h){let g=qi[b+2],v=g&2?r:g&4?g&1?i:r:0;v&&(cn[d]=cn[qi[b]]=v),a=b;break}}else{if(qi.length==189)break;qi[a++]=d,qi[a++]=f,qi[a++]=l}else if((m=cn[d])==2||m==1){let b=m==r;l=b?0:1;for(let g=a-3;g>=0;g-=3){let v=qi[g+2];if(v&2)break;if(b)qi[g+2]|=2;else{if(v&4)break;qi[g+2]|=4}}}}}function n0e(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=cn[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(cn[u]==256)u++;else break;let d=i==1,f=(u<e?cn[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),cn[--m]=h;l=u}else i=c,l++}}}function ey(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=cn[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(cn[g]==a)break e;break}}if(c++,f)f.push(b);else{b.from>l&&s.push(new os(l,b.from,h));let g=b.direction==oc!=!(h%2);ty(t,g?o+1:o,r,b.inner,b.from,b.to,s),l=b.to}m=b.to}else{if(m==n||(u?cn[m]!=a:cn[m]==a))break;m++}f?ey(t,l,m,o+1,r,f,s):l<m&&s.push(new os(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=cn[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(cn[g-1]==a)break e;break}}if(f)f.push(b);else{b.to<l&&s.push(new os(b.to,l,h));let g=b.direction==oc!=!(h%2);ty(t,g?o+1:o,r,b.inner,b.from,b.to,s),l=b.from}m=b.from}else{if(m==e||(u?cn[m-1]!=a:cn[m-1]==a))break;m--}f?ey(t,m,l,o+1,r,f,s):m<l&&s.push(new os(m,l,h)),l=m}}function ty(t,e,n,o,r,i,s){let a=e%2?2:1;e0e(t,r,i,o,a),t0e(t,r,i,o,a),n0e(r,i,o,a),ey(t,r,i,e,n,o,s)}function o0e(t,e,n){if(!t)return[new os(0,0,e==Px?1:0)];if(e==oc&&!n.length&&!Jpe.test(t))return pM(t.length);if(n.length)for(;t.length>cn.length;)cn[cn.length]=256;let o=[],r=e==oc?0:1;return ty(t,r,r,n,0,t.length,o),o}function pM(t){return[new os(0,t,0)]}let mM="";function r0e(t,e,n,o,r){var i;let s=o.head-t.from,a=os.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=Po(t.text,s,l.forward(r,n));(u<l.from||u>l.to)&&(u=c),mM=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?Ye.cursor(d.side(!r,n)+t.from,d.forward(r,n)?1:-1,d.level):Ye.cursor(u+t.from,l.forward(r,n)?-1:1,l.level)}function i0e(t,e,n){for(let o=e;o<n;o++){let r=fM(t.charCodeAt(o));if(r==1)return oc;if(r==2||r==4)return Px}return oc}const gM=xt.define(),vM=xt.define(),bM=xt.define(),yM=xt.define(),ny=xt.define(),xM=xt.define(),wM=xt.define(),Dx=xt.define(),Ex=xt.define(),_M=xt.define({combine:t=>t.some(e=>e)}),s0e=xt.define({combine:t=>t.some(e=>e)}),kM=xt.define();class iu{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 iu(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 iu(Ye.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Yh=Tn.define({map:(t,e)=>t.map(e)}),SM=Tn.define();function rs(t,e,n){let o=t.facet(yM);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 Us=xt.define({combine:t=>t.length?t[0]:!0});let a0e=0;const zc=xt.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 rc{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(zc.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(zc.of({plugin:this,arg:e}))}static define(e,n){const{eventHandlers:o,eventObservers:r,provide:i,decorations:s}=n||{};return new rc(a0e++,e,o,r,a=>{let l=[];return s&&l.push(Hg.of(c=>{let u=c.plugin(a);return u?s(u):no.none})),i&&l.push(i(a)),l})}static fromClass(e,n){return rc.define((o,r)=>new e(o,r),n)}}class s1{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(rs(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){rs(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){rs(e.state,o,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const CM=xt.define(),Ix=xt.define(),Hg=xt.define(),AM=xt.define(),Nx=xt.define(),sh=xt.define(),$M=xt.define();function Xk(t,e){let n=t.state.facet($M);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=i0e(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 TM=xt.define();function OM(t){let e=0,n=0,o=0,r=0;for(let i of t.state.facet(TM)){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 Md=xt.define();class Ur{constructor(e,n,o,r){this.fromA=e,this.toA=n,this.fromB=o,this.toB=r}join(e){return new Ur(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 Ur(u,f,c,d))}return o}}class H0{constructor(e,n,o){this.view=e,this.state=n,this.transactions=o,this.flags=0,this.startState=e.state,this.changes=Kn.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 Ur(i,s,a,l))),this.changedRanges=r}static create(e,n,o){return new H0(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 l0e=[];class Fn{constructor(e,n,o=0){this.dom=e,this.length=n,this.flags=o,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return l0e}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&&Hpe(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=Qa(this.dom),r=this.length?e>0:n>0;return new vi(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 Ug)return e;return null}static get(e){return e.cmTile}}class Wg extends Fn{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let n=this.dom,o=null,r,i=(e==null?void 0:e.node)==n?e:null,s=0;for(let a of this.children){if(a.sync(e),s+=a.length+a.breakAfter,r=o?o.nextSibling:n.firstChild,i&&r!=a.dom&&(i.written=!0),a.dom.parentNode==n)for(;r&&r!=a.dom;)r=Zk(r);else n.insertBefore(a.dom,r);o=a.dom}for(r=o?o.nextSibling:n.firstChild,i&&r&&(i.written=!0);r;)r=Zk(r);this.length=s}}function Zk(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Ug extends Wg{constructor(e,n){super(n),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let n=Fn.get(e);if(n&&this.owns(n))return n;e=e.parentNode}}blockTiles(e){for(let n=[],o=this,r=0,i=0;;)if(r==o.children.length){if(!n.length)return;o=o.parent,o.breakAfter&&i++,r=n.pop()}else{let s=o.children[r++];if(s instanceof Js)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 Js extends Wg{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 Js(n||document.createElement(e.tagName),e);return n||(o.flags|=4),o}}class $u extends Wg{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,o){let r=new $u(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&&u0e(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):c0e(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 vi(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 vi(l.dom,0);l==o.tile&&(a=!0)}}return new vi(this.dom,0)}}function c0e(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=$p(e);return n[n.length-1]||null}function u0e(t,e){let n=t.coordsIn(0,1),o=e.coordsIn(0,1);return n&&o&&o.top<n.bottom}class sr extends Wg{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let o=new sr(n||document.createElement(e.tagName),e);return n||(o.flags|=4),o}}class El extends Fn{constructor(e,n){super(e,n.length),this.text=n}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,n){let o=this.dom.nodeValue.length;e>o&&(e=o);let r=e,i=e,s=0;e==0&&n<0||e==o&&n>=0?it.chrome||it.gecko||(e?(r--,s=1):i<o&&(i++,s=-1)):n<0?r--:i<o&&i++;let a=Rf(this.dom,r,i).getClientRects();if(!a.length)return null;let l=a[(s?s<0:n>=0)?0:a.length-1];return it.safari&&!s&&l.width==0&&(l=Array.prototype.find.call(a,c=>c.width)||l),s?z0(l,s<0):l||null}static of(e,n){let o=new El(n||document.createTextNode(e),e);return n||(o.flags|=2),o}}class ic extends Fn{constructor(e,n,o,r){super(e,n,r),this.widget=o}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,n){return this.coordsInWidget(e,n,!1)}coordsInWidget(e,n,o){let r=this.widget.coordsAt(this.dom,e,n);if(r)return r;if(o)return z0(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 z0(s,!a)}}get overrideDOMText(){if(!this.length)return qt.empty;let{root:e}=this;if(!e)return qt.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 ic(i,o,e,r)}}class W0 extends Fn{constructor(e){let n=document.createElement("img");n.className="cm-widgetBuffer",n.setAttribute("aria-hidden","true"),super(n,0,e)}get isHidden(){return!0}get overrideDOMText(){return qt.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class d0e{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 f0e{constructor(e,n,o,r){this.from=e,this.to=n,this.wrapper=o,this.rank=r}}class h0e{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 El(a.dom,a.text+e);l.parent=s}else s.append(r||El.of(e,(i=this.cache.find(El))===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)?a1(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 sr&&c.mark.eq(l.mark))c.dom!=l.dom&&c.setDOM(a1(l.dom)),r=c;else{if(this.cache.reused.get(l)){let d=Fn.get(l.dom);d&&d.setDOM(a1(l.dom))}let u=sr.of(l.mark,l.dom);r.append(u),r=u}this.cache.reused.set(l,2)}let i=Fn.get(e.text);i&&this.cache.reused.set(i,2);let s=new El(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=MM);let r=$u.start(e,n||((o=this.cache.find($u))===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 sr&&a.mark.eq(s))r=a,n--;else{let l=sr.of(s,(o=this.cache.find(sr,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||!Qk(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(it.ios&&Qk(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(l1,0,32)||new ic(l1.toDOM(),0,l1,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 f0e(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 Js&&r.wrapper.eq(o.wrapper))n=r;else{let i=Js.of(o.wrapper,(e=this.cache.find(Js,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(W0,void 0,1);return o&&(o.flags=n),o||new W0(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class p0e{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 U0=[ic,$u,El,sr,W0,Js,Ug];for(let t=0;t<U0.length;t++)U0[t].bucket=t;class m0e{constructor(e){this.view=e,this.buckets=U0.map(()=>[]),this.index=U0.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 ic(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 g0e{constructor(e,n,o,r,i){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=i,this.openWidget=!1,this.openMarks=0,this.cache=new m0e(e),this.text=new p0e(e.state.doc),this.builder=new h0e(this.cache,new Ug(e,e.contentDOM),nn.iter(o)),this.cache.reused.set(n,2),this.old=new d0e(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=y0e(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?ic.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 W0)this.cache.add(s);else if(s instanceof sr)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 sr&&r.unshift(s.mark)),this.openWidget=!1},leave:s=>{s.isLine()?r.length&&(r.length=i=0):s instanceof sr&&(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 nc){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?Tu.block:Tu.inline),m=v0e(c),b=this.cache.findWidget(h,l-a,m)||ic.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=b0e(o,c);l>a&&this.text.skip(l-a)},span:(a,l,c,u)=>{for(let d=a;d<l;){let f=this.text.next(Math.min(512,l-d));f==null?(r.addLineStartIfNotCovered(o),r.addBreak(),d++):(r.ensureLine(o),r.addText(f,c,d==a?u:c.length),d+=f.length),o=null}}});r.addLineStartIfNotCovered(o),this.openWidget=s>i,this.openMarks=s}forward(e,n,o=1){n-e<=10?this.old.advance(n-e,o,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-e-10,-1),this.old.advance(5,o,this.reuseWalker))}getCompositionContext(e){let n=[],o=null;for(let r=e.parentNode;;r=r.parentNode){let i=Fn.get(r);if(r==this.view.contentDOM)break;i instanceof sr?n.push(i):i!=null&&i.isLine()?o=i:i instanceof Js||(r.nodeName=="DIV"&&!o&&r!=this.view.contentDOM?o=new $u(r,MM):o||n.push(sr.of(new rh({tagName:r.nodeName.toLowerCase(),attributes:Wpe(r)}),r)))}return{line:o,marks:n}}}function Qk(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 v0e(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 MM={class:"cm-line"};function b0e(t,e){let n=e.spec.attributes,o=e.spec.class;return!n&&!o||(t||(t={class:"cm-line"}),n&&Bx(n,t),o&&(t.class+=" "+o)),t}function y0e(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 sr&&e.push(o.mark)}return e}function a1(t){let e=Fn.get(t);return e&&e.setDOM(t.cloneNode()),t}class Tu extends zg{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}}Tu.inline=new Tu("span");Tu.block=new Tu("div");const l1=new class extends zg{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class Jk{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=no.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 Ug(e,e.contentDOM),this.updateInner([new Ur(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:!T0e(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let i=r>-1?w0e(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:u,to:d}=this.hasComposition;o=new Ur(u,d,e.changes.mapPos(u,-1),e.changes.mapPos(d,1)).addToSet(o.slice())}this.hasComposition=i?{from:i.range.fromB,to:i.range.toB}:null,(it.ie||it.chrome)&&!i&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let s=this.decorations,a=this.blockWrappers;this.updateDeco();let l=S0e(s,this.decorations,e.changes);l.length&&(o=Ur.extendWithRanges(o,l));let c=A0e(a,this.blockWrappers,e.changes);return c.length&&(o=Ur.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 g0e(this.view,s,this.blockWrappers,this.decorations,this.dynamicDecorationMap);this.tile=a.run(e,n),oy(s,a.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let i=it.chrome||it.ios?{node:o.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(i),i&&(i.written||o.selectionRange.focusNode!=i.node||!this.tile.dom.contains(i.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let i of this.tile.children)i.isWidget()&&i.widget instanceof c1&&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(SM)&&(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(Us)||o.tabIndex>-1)&&Zd(o,this.view.observer.selectionRange)&&!(r&&o.contains(r));if(!(i||n||s))return;let a=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,c,u;if(l.empty?u=c=this.inlineDOMNearPos(l.anchor,l.assoc||1):(u=this.inlineDOMNearPos(l.head,l.head==l.from?1:-1),c=this.inlineDOMNearPos(l.anchor,l.anchor==l.from?1:-1)),it.gecko&&l.empty&&!this.hasComposition&&x0e(c)){let f=document.createTextNode("");this.view.observer.ignore(()=>c.node.insertBefore(f,c.node.childNodes[c.offset]||null)),c=u=new vi(f,0),a=!0}let d=this.view.observer.selectionRange;(a||!d.focusNode||(!Qd(c.node,c.offset,d.anchorNode,d.anchorOffset)||!Qd(u.node,u.offset,d.focusNode,d.focusOffset))&&!this.suppressWidgetCursorChange(d,l))&&(this.view.observer.ignore(()=>{it.android&&it.chrome&&o.contains(d.focusNode)&&$0e(d.focusNode,o)&&(o.blur(),o.focus({preventScroll:!0}));let f=Nf(this.view.root);if(f)if(l.empty){if(it.gecko){let h=_0e(c.node,c.offset);if(h&&h!=3){let m=(h==1?cM:uM)(c.node,c.offset);m&&(c=new vi(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 vi(d.anchorNode,d.anchorOffset),this.impreciseHead=u.precise?null:new vi(d.focusNode,d.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&Qd(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=Nf(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=sa(e)==0?0:n==0?-1:1;for(;;){let a=e.parentNode;if(a==o.dom)break;s==0&&a.firstChild!=a.lastChild&&(e==a.firstChild?s=-1:s=1),e=a}s<0?i=e:i=e.nextSibling}if(i==o.dom.firstChild)return r;for(;i&&!Fn.get(i);)i=i.nextSibling;if(!i)return r+o.length;for(let s=0,a=r;;s++){let l=o.children[s];if(l.dom==i)return a;a+=l.length+l.breakAfter}}else return o.isText()?e==o.dom?r+n:r+(n?o.length:0):r}domAtPos(e,n){let{tile:o,offset:r}=this.tile.resolveBlock(e,n);return o.isWidget()?o.domPosFor(e,n):o.domIn(r,n)}inlineDOMNearPos(e,n){let o,r=-1,i=!1,s,a=-1,l=!1;return this.tile.blockTiles((c,u)=>{if(c.isWidget()){if(c.flags&32&&u>=e)return!0;c.flags&16&&(i=!0)}else{let d=u+c.length;if(u<=e&&(o=c,r=e-u,i=d<e),d>=e&&!s&&(s=c,a=e-u,l=u>e),u>e&&s)return!0}}),!o&&!s?this.domAtPos(e,n):(i&&s?o=null:l&&o&&(s=null),o&&n<0||!s?o.domIn(r,n):s.domIn(a,n))}coordsAt(e,n){let{tile:o,offset:r}=this.tile.resolveBlock(e,n);return o.isWidget()?o.widget instanceof c1?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=Po(i.text,s);if(a==s)return null;let l=Rf(i.dom,s,a).getClientRects();for(let c=0;c<l.length;c++){let u=l[c];if(c==l.length-1||u.top<u.bottom&&u.left<u.right)return u}}return null}return r(n,o)}measureVisibleLineHeights(e){let n=[],{from:o,to:r}=e,i=this.view.contentDOM.clientWidth,s=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==Nn.LTR,c=0,u=(d,f,h)=>{for(let 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 Js)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?$p(x):[];if(_.length){let C=_[_.length-1],D=l?C.right-v.left:v.right-C.left;D>a&&(a=D,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"?Nn.RTL:Nn.LTR}measureTextSize(){let e=this.tile.blockTiles(s=>{if(s.isLine()&&s.children.length&&s.length<=20){let a=0,l;for(let c of s.children){if(!c.isText()||/[^ -~]/.test(c.text))return;let u=$p(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=$p(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(no.replace({widget:new c1(a),block:!0,inclusive:!0,isBlockGap:!0}).range(o,s))}if(!i)break;o=i.to+1}return no.set(e)}updateDeco(){let e=1,n=this.view.state.facet(Hg).map(i=>(this.dynamicDecorationMap[e++]=typeof i=="function")?i(this.view):i),o=!1,r=this.view.state.facet(Nx).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(kM))try{if(c(this.view,e.range,e))return!0}catch(u){rs(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=OM(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(qpe(this.view.scrollDOM,s,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,a),-a),Math.max(Math.min(e.yMargin,l),-l),this.view.textDirection==Nn.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(o.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||o.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let c=this.view.docView.lineAt(n.head,1);c&&c.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let n=o=>o.isWidget()||o.children.some(n);return n(this.tile.resolveBlock(e,1).tile)}destroy(){oy(this.tile)}}function oy(t,e){let n=e==null?void 0:e.get(t);if(n!=1){n==null&&t.destroy();for(let o of t.children)oy(o,e)}}function x0e(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 BM(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let o=cM(n.focusNode,n.focusOffset),r=uM(n.focusNode,n.focusOffset),i=o||r;if(r&&o&&r.node!=o.node){let a=Fn.get(r.node);if(!a||a.isText()&&a.text!=r.node.nodeValue)i=r;else if(t.docView.lastCompositionAfterCursor){let l=Fn.get(o.node);!l||l.isText()&&l.text!=o.node.nodeValue||(i=r)}}if(t.docView.lastCompositionAfterCursor=i!=o,!i)return null;let s=e-i.offset;return{from:s,to:s+i.node.nodeValue.length,node:i.node}}function w0e(t,e,n){let o=BM(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 Ur(l.mapPos(i),l.mapPos(s),i,s),text:r}}function _0e(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 k0e=class{constructor(){this.changes=[]}compareRange(e,n){ou(e,n,this.changes)}comparePoint(e,n){ou(e,n,this.changes)}boundChange(e){ou(e,e,this.changes)}};function S0e(t,e,n){let o=new k0e;return nn.compare(t,e,n,o),o.changes}class C0e{constructor(){this.changes=[]}compareRange(e,n){ou(e,n,this.changes)}comparePoint(){}boundChange(e){ou(e,e,this.changes)}}function A0e(t,e,n){let o=new C0e;return nn.compare(t,e,n,o),o.changes}function $0e(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 T0e(t,e){let n=!1;return e&&t.iterChangedRanges((o,r)=>{o<e.to&&r>e.from&&(n=!0)}),n}class c1 extends zg{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 O0e(t,e,n=1){let o=t.charCategorizer(e),r=t.doc.lineAt(e),i=e-r.from;if(r.length==0)return Ye.cursor(e);i==0?n=1:i==r.length&&(n=-1);let s=i,a=i;n<0?s=Po(r.text,i,!1):a=Po(r.text,i);let l=o(r.text.slice(s,a));for(;s>0;){let c=Po(r.text,s,!1);if(o(r.text.slice(c,s))!=l)break;s=c}for(;a<r.length;){let c=Po(r.text,a);if(o(r.text.slice(a,c))!=l)break;a=c}return Ye.range(s+r.from,a+r.from)}function M0e(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+Ipe(s,i,t.state.tabSize)}function B0e(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==Xr.Text&&(r.type!=i.type||(n<0?i.from<e:i.to>e)))&&(r=i)}}return r||o}return o}function L0e(t,e,n,o){let r=B0e(t,e.head,e.assoc||-1),i=!o||r.type!=Xr.Text||!(t.lineWrapping||r.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(i){let s=t.dom.getBoundingClientRect(),a=t.textDirectionAt(r.from),l=t.posAtCoords({x:n==(a==Nn.LTR)?s.right-1:s.left+1,y:(i.top+i.bottom)/2});if(l!=null)return Ye.cursor(l,n?-1:1)}return Ye.cursor(n?r.to:r.from,n?-1:1)}function eS(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=r0e(r,i,s,a,n),u=mM;if(!c){if(r.number==(n?t.state.doc.lines:1))return a;u=`
|
|
924
|
+
`,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 P0e(t,e,n){let o=t.state.charCategorizer(e),r=o(n);return i=>{let s=o(i);return r==js.Space&&(r=s),r==s}}function D0e(t,e,n,o){let r=e.head,i=n?1:-1;if(r==(n?t.state.doc.length:0))return Ye.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=ry(t,{x:d,y:a+f*i},!1,i);return Ye.cursor(h.pos,h.assoc,void 0,s)}function Jd(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 LM(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=Jd(t,r.from,0);s!=r.from&&(i=Ye.cursor(s,-1))}else{let s=Jd(t,r.from,-1),a=Jd(t,r.to,1);(s!=r.from||a!=r.to)&&(i=Ye.range(r.from==r.anchor?s:a,r.from==r.head?s:a))}i&&(n||(n=e.ranges.slice()),n[o]=i)}return n?Ye.create(n,e.mainIndex):e}function u1(t,e,n){let o=Jd(t.state.facet(sh).map(r=>r(t)),n.from,e.head>n.from?-1:1);return o==n.from?n:Ye.cursor(o,o<n.from?1:-1)}class es{constructor(e,n){this.pos=e,this.assoc=n}}function ry(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 es(0,1);if(l>t.viewState.docHeight)return new es(t.state.doc.length,-1);if(c=t.elementAtHeight(l),o==null)break;if(c.type==Xr.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==Xr.Text){let d=M0e(t,r,c,s,a);return new es(d,d==c.from?1:-1)}}if(c.type!=Xr.Text)return l<(c.top+c.bottom)/2?new es(c.from,1):new es(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 E0e(t,s,a,t.textDirectionAt(c.from)).scanTile(u,c.from)}class E0e{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[os.find(r,e-o.from,-1,n)].level==this.baseDir}dirAt(e,n){let{line:o,spans:r}=this.bidiSpansAt(e);return r[os.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==Nn.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)==Nn.LTR;return{i:c,after:this.x>(d.left+d.right)/2==f}}scanText(e,n){let o=[];for(let i=0;i<e.length;i=Po(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 Rf(e.dom,s,a).getClientRects()});return r.after?new es(o[r.i+1],-1):new es(o[r.i],1)}scanTile(e,n){if(!e.length)return new es(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:Rf(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 es(o[r.i+1],-1):new es(s,1)}}const Bd="";class I0e{constructor(e,n){this.points=e,this.view=n,this.text="",this.lineSeparator=n.state.facet(Jt.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Bd}readRange(e,n){if(!e)return this;let o=e.parentNode;for(let r=e;;){this.findPointBefore(o,r);let i=this.text.length;this.readNode(r);let s=Fn.get(r),a=r.nextSibling;if(a==n){s!=null&&s.breakAfter&&!a&&o!=this.view.contentDOM&&this.lineBreak();break}let l=Fn.get(a);(s&&l?s.breakAfter:(s?s.breakAfter:V0(r))||V0(a)&&(r.nodeName!="BR"||s!=null&&s.isWidget())&&this.text.length>i)&&!R0e(a,n)&&this.lineBreak(),r=a}return this.findPointBefore(o,n),this}readTextNode(e){let n=e.nodeValue;for(let o of this.points)o.node==e&&(o.pos=this.text.length+Math.min(o.offset,n.length));for(let o=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,s=1,a;if(this.lineSeparator?(i=n.indexOf(this.lineSeparator,o),s=this.lineSeparator.length):(a=r.exec(n))&&(i=a.index,s=a[0].length),this.append(n.slice(o,i<0?n.length:i)),i<0)break;if(this.lineBreak(),s>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=s-1);o=i+s}}readNode(e){let n=Fn.get(e),o=n&&n.overrideDOMText;if(o!=null){this.findPointInside(e,o.length);for(let r=o.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let o of this.points)o.node==e&&e.childNodes[o.offset]==n&&(o.pos=this.text.length)}findPointInside(e,n){for(let o of this.points)(e.nodeType==3?o.node==e:e.contains(o.node))&&(o.pos=this.text.length+(N0e(e,o.node,o.offset)?n:0))}}function N0e(t,e,n){for(;;){if(!e||n<sa(e))return!1;if(e==t)return!0;n=Qa(e)+1,e=e.parentNode}}function R0e(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let o=Fn.get(t);if(!(o!=null&&o.isWidget()))return!1;o&&(n||(n=[])).push(o)}if(n)for(let o of n){let r=o.overrideDOMText;if(r!=null&&r.length)return!1}return!0}class tS{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class F0e{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?[]:z0e(e),l=new I0e(a,e);l.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=l.text,this.newSel=H0e(a,this.bounds.from)}else{let a=e.observer.selectionRange,l=i&&i.node==a.focusNode&&i.offset==a.focusOffset||!Qb(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||!Qb(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),u=e.viewport;if((it.ios||it.chrome)&&e.state.selection.main.empty&&l!=c&&(u.from>0||u.to<e.state.doc.length)){let d=Math.min(l,c),f=Math.max(l,c),h=u.from-d,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(Ye.range(c,l)):this.newSel=Ye.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 DM(t,e){let n,{newSel:o}=e,r=t.state.selection.main,i=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:s,to:a}=e.bounds,l=r.from,c=null;(i===8||it.android&&e.text.length<a-s)&&(l=r.to,c="end");let u=EM(t.state.doc.sliceString(s,a,Bd),e.text,l-s,c);u&&(it.chrome&&i==13&&u.toB==u.from+2&&e.text.slice(u.from,u.toB)==Bd+Bd&&u.toB--,n={from:s+u.from,to:s+u.toA,insert:qt.of(e.text.slice(u.from,u.toB).split(Bd))})}else o&&(!t.hasFocus&&t.state.facet(Us)||G0(o,r))&&(o=null);if(!n&&!o)return!1;if(!n&&e.typeOver&&!r.empty&&o&&o.main.empty?n={from:r.from,to:r.to,insert:t.state.doc.slice(r.from,r.to)}:(it.mac||it.android)&&n&&n.from==n.to&&n.from==r.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(o&&n.insert.length==2&&(o=Ye.single(o.main.anchor-1,o.main.head-1)),n={from:n.from,to:n.to,insert:qt.of([n.insert.toString().replace("."," ")])}):n&&n.from>=r.from&&n.to<=r.to&&(n.from!=r.from||n.to!=r.to)&&r.to-r.from-(n.to-n.from)<=4?n={from:r.from,to:r.to,insert:t.state.doc.slice(r.from,n.from).append(n.insert).append(t.state.doc.slice(n.to,r.to))}:t.state.doc.lineAt(r.from).to<r.to&&t.docView.lineHasWidget(r.to)&&t.inputState.insertingTextAt>Date.now()-50?n={from:r.from,to:r.to,insert:t.state.toText(t.inputState.insertingText)}:it.chrome&&n&&n.from==n.to&&n.from==r.head&&n.insert.toString()==`
|
|
925
|
+
`&&t.lineWrapping&&(o&&(o=Ye.single(o.main.anchor-1,o.main.head-1)),n={from:r.from,to:r.to,insert:qt.of([" "])}),n)return Rx(t,n,o,i);if(o&&!G0(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=LM(t.state.facet(sh).map(l=>l(t)),o))),t.dispatch({selection:o,scrollIntoView:s,userEvent:a}),!0}else return!1}function Rx(t,e,n,o=-1){if(it.ios&&t.inputState.flushIOSKey(e))return!0;let r=t.state.selection.main;if(it.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&t.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&ru(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)&&ru(t.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&ru(t.contentDOM,"Delete",46)))return!0;let i=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let s,a=()=>s||(s=V0e(t,e,n));return t.state.facet(xM).some(l=>l(t,e.from,e.to,i,a))||t.dispatch(a()),!0}function V0e(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=Jd(r.facet(sh).map(d=>d(t)),c,l);e.from==u&&(s=u)}if(s>-1)o={changes:e,selection:Ye.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&&BM(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?Ye.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 EM(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 z0e(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 tS(n,o)),(r!=n||i!=o)&&e.push(new tS(r,i))),e}function H0e(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?Ye.single(n+e,o+e):null}function G0(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class W0e{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,it.safari&&e.contentDOM.addEventListener("input",()=>null),it.gecko&&rme(e.contentDOM.ownerDocument)}handleEvent(e){!Z0e(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=U0e(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&&NM.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),it.android&&it.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return it.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((n=IM.find(o=>o.keyCode==e.keyCode))&&!e.ctrlKey||G0e.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,ru(this.view.contentDOM,n.key,n.keyCode,n instanceof KeyboardEvent?n:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:it.safari&&!it.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function nS(t,e){return(n,o)=>{try{return e.call(t,o,n)}catch(r){rs(n.state,r)}}}function U0e(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(nS(o.value,l))}if(s)for(let a in s){let l=s[a];l&&n(a).observers.push(nS(o.value,l))}}for(let o in Ii)n(o).handlers.push(Ii[o]);for(let o in ei)n(o).observers.push(ei[o]);return e}const IM=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],G0e="dthko",NM=[16,17,18,20,91,92,224,225],jh=6;function Kh(t){return Math.max(0,t)*.7+8}function q0e(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class Y0e{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=Ype(e.contentDOM),this.atoms=e.state.facet(sh).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(Jt.allowMultipleSelections)&&j0e(e,n),this.dragging=X0e(e,n)&&VM(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&&q0e(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=OM(this.view);e.clientX-l.left<=r+jh?n=-Kh(r-e.clientX):e.clientX+l.right>=s-jh&&(n=Kh(e.clientX-s)),e.clientY-l.top<=i+jh?o=-Kh(i-e.clientY):e.clientY+l.bottom>=a-jh&&(o=Kh(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=LM(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 j0e(t,e){let n=t.state.facet(gM);return n.length?n[0](e):it.mac?e.metaKey:e.ctrlKey}function K0e(t,e){let n=t.state.facet(vM);return n.length?n[0](e):it.mac?!e.altKey:!e.ctrlKey}function X0e(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let o=Nf(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 Z0e(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,o;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(o=Fn.get(n))&&o.isWidget()&&!o.isHidden&&o.widget.ignoreEvent(e))return!1;return!0}const Ii=Object.create(null),ei=Object.create(null),RM=it.ie&&it.ie_version<15||it.ios&&it.webkit_version<604;function Q0e(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(),FM(t,n.value)},50)}function Gg(t,e,n){for(let o of t.facet(e))n=o(n,t);return n}function FM(t,e){e=Gg(t.state,Dx,e);let{state:n}=t,o,r=1,i=n.toText(e),s=i.lines==n.selection.ranges.length;if(iy!=null&&n.selection.ranges.every(l=>l.empty)&&iy==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:Ye.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:Ye.cursor(l.from+c.length)}}):o=n.replaceSelection(i);t.dispatch(o,{userEvent:"input.paste",scrollIntoView:!0})}ei.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};Ii.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);ei.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};ei.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Ii.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(bM))if(n=o(t,e),n)break;if(!n&&e.button==0&&(n=eme(t,e)),n){let o=!t.hasFocus;t.inputState.startMouseSelection(new Y0e(t,e,n,o)),o&&t.observer.ignore(()=>{aM(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 oS(t,e,n,o){if(o==1)return Ye.cursor(e,n);if(o==2)return O0e(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++,Ye.range(s,a)}}const J0e=it.ie&&it.ie_version<=11;let rS=null,iS=0,sS=0;function VM(t){if(!J0e)return t.detail;let e=rS,n=sS;return rS=t,sS=Date.now(),iS=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(iS+1)%3:1}function eme(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),o=VM(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=oS(t,l.pos,l.assoc,o);if(n.pos!=l.pos&&!s){let d=oS(t,n.pos,n.assoc,o),f=Math.min(d.from,u.from),h=Math.max(d.to,u.to);u=f<u.from?Ye.range(f,h):Ye.range(h,f)}return s?r.replaceRange(r.main.extend(u.from,u.to)):a&&o==1&&r.ranges.length>1&&(c=tme(r,l.pos))?c:a?r.addRange(u):Ye.create([u])}}}function tme(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 Ye.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}Ii.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=Ye.range(i,s))}}let{inputState:o}=t;return o.mouseSelection&&(o.mouseSelection.dragging=!0),o.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",Gg(t.state,Ex,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Ii.dragend=t=>(t.inputState.draggedContent=null,!1);function aS(t,e,n,o){if(n=Gg(t.state,Dx,n),!n)return;let r=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:i}=t.inputState,s=o&&i&&K0e(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}Ii.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&&aS(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 aS(t,e,o,!0),!0}return!1};Ii.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=RM?null:e.clipboardData;return n?(FM(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(Q0e(t),!1)};function nme(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 ome(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:Gg(t,Ex,e.join(t.lineBreak)),ranges:n,linewise:o}}let iy=null;Ii.copy=Ii.cut=(t,e)=>{if(!Zd(t.contentDOM,t.observer.selectionRange))return!1;let{text:n,ranges:o,linewise:r}=ome(t.state);if(!n&&!r)return!1;iy=r?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:o,scrollIntoView:!0,userEvent:"delete.cut"});let i=RM?null:e.clipboardData;return i?(i.clearData(),i.setData("text/plain",n),!0):(nme(t,n),!1)};const zM=pl.define();function HM(t,e){let n=[];for(let o of t.facet(wM)){let r=o(t,e);r&&n.push(r)}return n.length?t.update({effects:n,annotations:zM.of(!0)}):null}function WM(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=HM(t.state,e);n?t.dispatch(n):t.update([])}},10)}ei.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),WM(t)};ei.blur=t=>{t.observer.clearSelectionRange(),WM(t)};ei.compositionstart=ei.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};ei.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,it.chrome&&it.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};ei.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};Ii.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 Rx(t,{from:l,to:c,insert:t.state.toText(i)},null),!0}}let r;if(it.chrome&&it.android&&(r=IM.find(i=>i.inputType==e.inputType))&&(t.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let i=((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0;setTimeout(()=>{var s;(((s=window.visualViewport)===null||s===void 0?void 0:s.height)||0)>i+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return it.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),it.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>ei.compositionend(t,e),20),!1};const lS=new Set;function rme(t){lS.has(t)||(lS.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const cS=["pre-wrap","normal","pre-line","break-spaces"];let Ou=!1;function uS(){Ou=!1}class ime{constructor(e){this.lineWrapping=e,this.doc=qt.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 cS.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=cS.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 sme{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class hi{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"?Xr.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 nc?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 hi(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var hn=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(hn||(hn={}));const Tp=.001;class jo{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)>Tp&&(Ou=!0),this.height=e)}replace(e,n,o){return jo.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,hn.ByPosNoHeight,o.setDoc(n),0,0),h=f.to>=c?f:i.lineAt(c,hn.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,hn.ByPosNoHeight,o,0,0));u+=f.from-l,l=f.from;let m=Fx.build(o.setDoc(s),e,u,d);i=q0(i,i.replace(l,c,m))}return i.updateHeight(o,0)}static empty(){return new xr(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 lme(jo.of(e.slice(0,n)),s,jo.of(e.slice(o)))}}function q0(t,e){return t==e?t:(t.constructor!=e.constructor&&(Ou=!0),e)}jo.prototype.size=1;const ame=no.replace({});class UM extends jo{constructor(e,n,o){super(e,n),this.deco=o,this.spaceAbove=0}mainBlock(e,n){return new hi(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 hi(r,0,o,this.spaceAbove,ame):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,hn.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 xr extends UM{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 hi(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 xr||r instanceof ao&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof ao?r=new xr(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):jo.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 ao extends jo{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 hi(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 hi(u,d,o+a*c,a,0)}}lineAt(e,n,o,r,i){if(n==hn.ByHeight)return this.blockAt(e,o,r,i);if(n==hn.ByPosNoHeight){let{from:h,to:m}=o.doc.lineAt(e);return new hi(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 hi(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 hi(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 ao?o[o.length-1]=new ao(i.length+r):o.push(null,new ao(r-1))}if(e>0){let i=o[0];i instanceof ao?o[0]=new ao(e+i.length):o.unshift(new ao(e-1),null)}return jo.of(o)}decomposeLeft(e,n){n.push(new ao(e-1),null)}decomposeRight(e,n){n.push(null,new ao(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 ao(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)>=Tp&&(l=-2);let h=new xr(u,d,f);h.outdated=!1,s.push(h),a+=u+1}a<=i&&s.push(null,new ao(i-a).updateHeight(e,a));let c=jo.of(s);return(l<0||Math.abs(c.height-this.height)>=Tp||Math.abs(l-this.heightMetrics(e,n).perLine)>=Tp)&&(Ou=!0),q0(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 lme extends jo{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==hn.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==hn.ByPosNoHeight?hn.ByPosNoHeight:hn.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,hn.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&&dS(i,s-1),n<this.length){let a=i.length;this.decomposeRight(n,i),dS(i,a)}return jo.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?jo.of(this.break?[e,null,n]:[e,n]):(this.left=q0(this.left,e),this.right=q0(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 dS(t,e){let n,o;t[e]==null&&(n=t[e-1])instanceof ao&&(o=t[e+1])instanceof ao&&t.splice(e-1,3,new ao(n.length+1+o.length))}const cme=5;class Fx{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 xr?r.length+=o-this.pos:(o>this.pos||!this.isCovered)&&this.nodes.push(new xr(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 UM(s,r,o)):(s||i||r>=cme)&&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 xr(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let o=new ao(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 xr)return e;let n=new xr(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 xr)&&!this.isCovered?this.nodes.push(new xr(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 xr&&r.updateHeight(this.oracle,o),o+=r?r.length:1;return this.nodes}static build(e,n,o,r){let i=new Fx(o,e);return nn.spans(n,o,r,i,0),i.finish(o)}}function ume(t,e,n){let o=new dme;return nn.compare(t,e,n,o,0),o.changes}class dme{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,o,r){(e<n||o&&o.heightRelevant||r&&r.heightRelevant)&&ou(e,n,this.changes,5)}}function fme(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 hme(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 pme(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class d1{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 no.replace({widget:new mme(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class mme extends zg{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 fS{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=hS,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Nn.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=e.facet(Ix).some(o=>typeof o!="function"&&o.class=="cm-lineWrapping");this.heightOracle=new ime(n),this.stateDeco=pS(e),this.heightMap=jo.empty().applyChanges(this.stateDeco,qt.empty,this.heightOracle.setDoc(e.doc),[new Ur(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=no.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 Xh(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?hS:new Vx(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(Ld(e,this.scaler))})}update(e,n=null){this.state=e.state;let o=this.stateDeco;this.stateDeco=pS(this.state);let r=e.changedRanges,i=Ur.extendWithRanges(r,ume(o,this.stateDeco,e?e.changes:Kn.empty(this.state.doc.length))),s=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);uS(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),i),(this.heightMap.height!=s||Ou)&&(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(s0e)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,o=window.getComputedStyle(n),r=this.heightOracle,i=o.whiteSpace;this.defaultTextDirection=o.direction=="rtl"?Nn.RTL:Nn.LTR;let s=this.heightOracle.mustRefreshForWrapping(i)||this.mustMeasureContent==="refresh",a=n.getBoundingClientRect(),l=s||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let c=0,u=0;if(a.width&&a.height){let{scaleX:_,scaleY:C}=sM(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=lM(e.scrollDOM);let m=(this.printing?pme:fme)(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&&!hme(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:D,textHeight:M}=e.docView.measureTextSize();s=C>0&&r.refresh(i,C,D,M,Math.max(5,y/D),_),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)),uS();for(let C of this.viewports){let D=C.from==this.viewport.from?_:e.docView.measureVisibleLineHeights(C);this.heightMap=(s?jo.empty().applyChanges(this.stateDeco,qt.empty,this.heightOracle,[new Ur(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,s,new sme(C.from,D))}Ou&&(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 Xh(r.lineAt(s-o*1e3,hn.ByHeight,i,0,0).from,r.lineAt(a+(1-o)*1e3,hn.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,hn.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 Xh(r.lineAt(f-1e3/2,hn.ByHeight,i,0,0).from,r.lineAt(f+u+1e3/2,hn.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 Xh(this.heightMap.lineAt(o,hn.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,hn.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,hn.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(n,hn.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 d1(n.mapPos(r.from),n.mapPos(r.to),r.size,r.displaySize));return o}ensureLineGaps(e,n){let o=this.heightOracle.lineWrapping,r=o?1e4:2e3,i=r>>1,s=r<<1;if(this.defaultTextDirection!=Nn.LTR&&!o)return[];let a=[],l=(u,d,f,h)=>{if(d-u<i)return;let 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=vme(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(Ye.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 d1(u,d,v,y)}a.push(g)},c=u=>{if(u.length<s||u.type!=Xr.Text)return;let d=gme(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=Qh(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=Zh(d,g),m=Zh(d,v)}else{let b=d.total*this.heightOracle.charWidth,g=r*this.heightOracle.charWidth,v=0;if(b>2e6)for(let D of e)D.from>=u.from&&D.from<u.to&&D.size!=D.displaySize&&D.from*this.heightOracle.charWidth+v<this.pixelViewport.left&&(v=D.size-D.displaySize);let y=this.pixelViewport.left+v,x=this.pixelViewport.right+v,_,C;if(f!=null){let D=Qh(d,f),M=((x-y)/2+g)/b;_=D-M,C=D+M}else _=(y-g)/b,C=(x+g)/b;h=Zh(d,_),m=Zh(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=Qh(r,o)-Qh(r,n);return this.heightOracle.lineWrapping?e.height*i:r.total*this.heightOracle.charWidth*i}updateLineGaps(e){d1.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=no.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)||Ld(this.heightMap.lineAt(e,hn.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)||Ld(this.heightMap.lineAt(this.scaler.fromDOM(e),hn.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 Ld(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 Xh{constructor(e,n){this.from=e,this.to=n}}function gme(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 Zh({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 Qh(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 vme(t,e){for(let n of t)if(e(n))return n}const hS={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function pS(t){let e=t.facet(Hg).filter(o=>typeof o!="function"),n=t.facet(Nx).filter(o=>typeof o!="function");return n.length&&e.push(nn.join(n)),e}class Vx{constructor(e,n,o){let r=0,i=0,s=0;this.viewports=o.map(({from:a,to:l})=>{let c=n.lineAt(a,hn.ByPos,e,0,0).top,u=n.lineAt(l,hn.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 Vx?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 Ld(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),o=e.toDOM(t.bottom);return new hi(t.from,t.length,n,o-n,Array.isArray(t._content)?t._content.map(r=>Ld(r,e)):t._content)}const Jh=xt.define({combine:t=>t.join(" ")}),sy=xt.define({combine:t=>t.indexOf(!0)>-1}),ay=Xa.newName(),GM=Xa.newName(),qM=Xa.newName(),YM={"&light":"."+GM,"&dark":"."+qM};function ly(t,e,n){return new Xa(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 bme=ly("."+ay,{"&":{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"}},YM),yme={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},f1=it.ie&&it.ie_version<=11;class xme{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new jpe,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let o of n)this.queue.push(o);(it.ie&&it.ie_version<=11||it.ios&&e.composing)&&n.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&it.android&&e.constructor.EDIT_CONTEXT!==!1&&!(it.chrome&&it.chrome_version<126)&&(this.editContext=new _me(e),e.state.facet(Us)&&(e.contentDOM.editContext=this.editContext.editContext)),f1&&(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(Us)?o.root.activeElement!=this.dom:!Zd(this.dom,r))return;let i=r.anchorNode&&o.docView.tile.nearest(r.anchorNode);if(i&&i.isWidget()&&i.widget.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(it.ie&&it.ie_version<=11||it.android&&it.chrome)&&!o.state.selection.main.empty&&r.focusNode&&Qd(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=Nf(e.root);if(!n)return!1;let o=it.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&wme(this.view,n)||n;if(!o||this.selectionRange.eq(o))return!1;let r=Zd(this.dom,o);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&Xpe(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,yme),f1&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),f1&&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&&ru(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&&Zd(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 F0e(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=DM(this.view,n);return this.view.state==o&&(n.domChanged||n.newSel&&!G0(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=mS(n,e.previousSibling||e.target.previousSibling,-1),r=mS(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(Us)!=e.state.facet(Us)&&(e.view.contentDOM.editContext=e.state.facet(Us)?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 mS(t,e,n){for(;e;){let o=Fn.get(e);if(o&&o.parent==t)return o;let r=e.parentNode;e=r!=t.dom?r:n>0?e.nextSibling:e.previousSibling}return null}function gS(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 Qd(s.node,s.offset,r,i)&&([n,o,r,i]=[r,i,n,o]),{anchorNode:n,anchorOffset:o,focusNode:r,focusOffset:i}}function wme(t,e){if(e.getComposedRanges){let r=e.getComposedRanges(t.root)[0];if(r)return gS(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?gS(t,n):null}class _me{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=EM(e.state.sliceDoc(a,l),o.text,(c?r.from:r.to)-a,c?"end":null);if(!u){let f=Ye.single(this.toEditorPos(o.selectionStart),this.toEditorPos(o.selectionEnd));G0(f,r)||e.dispatch({selection:f,userEvent:"select"});return}let d={from:u.from+a,to:u.toA+a,insert:qt.of(o.text.slice(u.from,u.toB).split(`
|
|
926
|
+
`))};if((it.mac||it.android)&&d.from==s-1&&/^\. ?$/.test(o.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(d={from:a,to:l,insert:qt.of([o.text.replace("."," ")])}),this.pendingContextChange=d,!e.state.readOnly){let f=this.to-this.from+(d.to-d.from+d.insert.length);Rx(e,d,Ye.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(no.mark({attributes:{style:u}}).range(l,c))}}}e.dispatch({effects:SM.of(no.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=Nf(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 At{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||Kpe(e.parent)||document,this.viewState=new fS(e.state||Jt.create(e)),e.scrollTo&&e.scrollTo.is(Yh)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(zc).map(r=>new s1(r));for(let r of this.plugins)r.update(this);this.observer=new xme(this),this.inputState=new W0e(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Jk(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 Zn?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(zM))?(this.inputState.notifiedFocused=s,a=1):s!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=s,l=HM(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(Jt.phrases)!=this.state.facet(Jt.phrases))return this.setState(i);r=H0.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 iu(h.empty?h:Ye.cursor(h.head,h.head>h.anchor?-1:1))}for(let h of f.effects)h.is(Yh)&&(d=h.value.clip(this.state))}this.viewState.update(r,d),this.bidiCache=Y0.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),n=this.docView.update(r),this.state.facet(Md)!=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(Jh)!=r.state.facet(Jh)&&(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(ny))try{f(r)}catch(h){rs(this.state,h,"update listener")}(l||u)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),u&&!DM(this,u)&&c.force&&ru(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 fS(e),this.plugins=e.facet(zc).map(o=>new s1(o)),this.pluginMap.clear();for(let o of this.plugins)o.update(this);this.docView.destroy(),this.docView=new Jk(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(zc),o=e.state.facet(zc);if(n!=o){let r=[];for(let i of o){let s=n.indexOf(i);if(s<0)r.push(new s1(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){rs(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(lM(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 rs(this.state,m),vS}}),d=H0.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]!=vS)try{let m=c[h];m.write&&m.write(u[h],this)}catch(m){rs(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(ny))a(n)}get themeClasses(){return ay+" "+(this.state.facet(sy)?qM:GM)+" "+this.state.facet(Jh)}updateAttrs(){let e=bS(this,CM,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Us)?"true":"false",class:"cm-content",style:`${it.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),bS(this,Ix,n);let o=this.observer.ignore(()=>{let r=Yk(this.contentDOM,this.contentAttrs,n),i=Yk(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(At.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(Md);let e=this.state.facet(At.cspNonce);Xa.mount(this.root,this.styleModules.concat(bme).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 u1(this,e,eS(this,e,n,o))}moveByGroup(e,n){return u1(this,e,eS(this,e,n,o=>P0e(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 Ye.cursor(i.side(n,r)+e.from,i.forward(!n,r)?1:-1)}moveToLineBoundary(e,n,o=!0){return L0e(this,e,n,o)}moveVertically(e,n,o){return u1(this,e,D0e(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=ry(this,e,n);return o&&o.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),ry(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[os.find(i,e-r.from,-1,n)];return z0(o,s.dir==Nn.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(_M)||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>kme)return pM(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||hM(i.isolates,o=Xk(this,e))))return i.order;o||(o=Xk(this,e));let r=o0e(e.text,n,o);return this.bidiCache.push(new Y0(e.from,e.to,n,o,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||it.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{aM(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 Yh.of(new iu(typeof e=="number"?Ye.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 Yh.of(new iu(Ye.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 rc.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return rc.define(()=>({}),{eventObservers:e})}static theme(e,n){let o=Xa.newName(),r=[Jh.of(o),Md.of(ly(`.${o}`,e))];return n&&n.dark&&r.push(sy.of(!0)),r}static baseTheme(e){return Tx.lowest(Md.of(ly("."+ay,e,YM)))}static findFromDOM(e){var n;let o=e.querySelector(".cm-content"),r=o&&Fn.get(o)||Fn.get(e);return((n=r==null?void 0:r.root)===null||n===void 0?void 0:n.view)||null}}At.styleModule=Md;At.inputHandler=xM;At.clipboardInputFilter=Dx;At.clipboardOutputFilter=Ex;At.scrollHandler=kM;At.focusChangeEffect=wM;At.perLineTextDirection=_M;At.exceptionSink=yM;At.updateListener=ny;At.editable=Us;At.mouseSelectionStyle=bM;At.dragMovesSelection=vM;At.clickAddsSelectionRange=gM;At.decorations=Hg;At.blockWrappers=AM;At.outerDecorations=Nx;At.atomicRanges=sh;At.bidiIsolatedRanges=$M;At.scrollMargins=TM;At.darkTheme=sy;At.cspNonce=xt.define({combine:t=>t.length?t[0]:""});At.contentAttributes=Ix;At.editorAttributes=CM;At.lineWrapping=At.contentAttributes.of({class:"cm-lineWrapping"});At.announce=Tn.define();const kme=4096,vS={};class Y0{constructor(e,n,o,r,i,s){this.from=e,this.to=n,this.dir=o,this.isolates=r,this.fresh=i,this.order=s}static update(e,n){if(n.empty&&!e.some(i=>i.fresh))return e;let o=[],r=e.length?e[e.length-1].dir:Nn.LTR;for(let i=Math.max(0,e.length-10);i<e.length;i++){let s=e[i];s.dir==r&&!n.touchesRange(s.from,s.to)&&o.push(new Y0(n.mapPos(s.from,1),n.mapPos(s.to,-1),s.dir,s.isolates,!1,s.order))}return o}}function bS(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&&Bx(s,n)}return n}const Sme=it.mac?"mac":it.windows?"win":it.linux?"linux":"key";function Cme(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 ep(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 Ame=Tx.default(At.domEventHandlers({keydown(t,e){return Mme($me(e.state),t,e,"editor")}})),jM=xt.define({enables:Ame}),yS=new WeakMap;function $me(t){let e=t.facet(jM),n=yS.get(e);return n||yS.set(e,n=Ome(e.reduce((o,r)=>o.concat(r),[]))),n}let Oa=null;const Tme=4e3;function Ome(t,e=Sme){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=>Cme(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 _=Oa={view:x,prefix:y,scope:s};return setTimeout(()=>{Oa==_&&(Oa=null)},Tme),!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,cy))}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 cy=null;function Mme(t,e,n,o){cy=e;let r=Vpe(e),i=wpe(r,0),s=_pe(i)==r.length&&r!=" ",a="",l=!1,c=!1,u=!1;Oa&&Oa.view==n&&Oa.scope==o&&(a=Oa.prefix+" ",NM.indexOf(e.keyCode)<0&&(c=!0,Oa=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+ep(r,e,!s)])?l=!0:s&&(e.altKey||e.metaKey||e.ctrlKey)&&!(it.windows&&e.ctrlKey&&e.altKey)&&!(it.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(m=Za[e.keyCode])&&m!=r?(f(h[a+ep(m,e,!0)])||e.shiftKey&&(b=Ef[e.keyCode])!=r&&b!=m&&f(h[a+ep(b,e,!1)]))&&(l=!0):s&&e.shiftKey&&f(h[a+ep(r,e,!0)])&&(l=!0),!l&&f(h._any)&&(l=!0)),c&&(l=!0),l&&u&&e.stopPropagation(),cy=null,l}class Mu extends tc{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Mu.prototype.elementClass="";Mu.prototype.toDOM=void 0;Mu.prototype.mapMode=kr.TrackBefore;Mu.prototype.startSide=Mu.prototype.endSide=-1;Mu.prototype.point=!0;const KM=1024;let Bme=0;class h1{constructor(e,n){this.from=e,this.to=n}}class Et{constructor(e={}){this.id=Bme++,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=hr.match(e)),n=>{let o=e(n);return o===void 0?null:[this,o]}}}Et.closedBy=new Et({deserialize:t=>t.split(" ")});Et.openedBy=new Et({deserialize:t=>t.split(" ")});Et.group=new Et({deserialize:t=>t.split(" ")});Et.isolate=new Et({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Et.contextHash=new Et({perNode:!0});Et.lookAhead=new Et({perNode:!0});Et.mounted=new Et({perNode:!0});class ef{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[Et.mounted.id]}}const Lme=Object.create(null);class hr{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):Lme,o=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new hr(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(Et.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(Et.group),i=-1;i<(r?r.length:0);i++){let s=n[i<0?o.name:r[i]];if(s)return s}}}}hr.none=new hr("",Object.create(null),0,8);class zx{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 hr(o.name,r,o.id,o.flags):o)}return new zx(n)}}const tp=new WeakMap,xS=new WeakMap;var _n;(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"})(_n||(_n={}));class On{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=ef.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 dy(this.topNode,e)}cursorAt(e,n=0,o=0){let r=tp.get(this)||this.topNode,i=new dy(r);return i.moveTo(e,n),tp.set(this,i._tree),i}get topNode(){return new Zr(this,0,0,null)}resolve(e,n=0){let o=Ff(tp.get(this)||this.topNode,e,n,!1);return tp.set(this,o),o}resolveInner(e,n=0){let o=Ff(xS.get(this)||this.topNode,e,n,!0);return xS.set(this,o),o}resolveStack(e,n=0){return Eme(this,e,n)}iterate(e){let{enter:n,leave:o,from:r=0,to:i=this.length}=e,s=e.mode||0,a=(s&_n.IncludeAnonymous)>0;for(let l=this.cursor(s|_n.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:Ux(hr.none,this.children,this.positions,0,this.children.length,0,this.length,(n,o,r)=>new On(this.type,n,o,r,this.propValues),e.makeTree||((n,o,r)=>new On(hr.none,n,o,r)))}static build(e){return Ime(e)}}On.empty=new On(hr.none,[],[],0);class Hx{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 Hx(this.buffer,this.index)}}class Ja{constructor(e,n,o){this.buffer=e,this.length=n,this.set=o}get type(){return hr.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&&!(XM(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 Ja(i,s,this.set)}}function XM(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 Ff(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 Zr&&t.index<0?null:t.parent;if(!s)return t;t=s}let i=o?0:_n.IgnoreOverlays;if(o)for(let s=t,a=s.parent;a;s=a,a=s.parent)s instanceof Zr&&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 ZM{cursor(e=0){return new dy(this,e)}getChild(e,n=null,o=null){let r=wS(this,e,n,o);return r.length?r[0]:null}getChildren(e,n=null,o=null){return wS(this,e,n,o)}resolve(e,n=0){return Ff(this,e,n,!1)}resolveInner(e,n=0){return Ff(this,e,n,!0)}matchContext(e){return uy(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 Zr extends ZM{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&_n.EnterBracketed&&u instanceof On&&(f=ef.get(u))&&!f.overlay&&f.bracketed&&o>=d&&o<=d+u.length)&&!XM(r,o,d,d+u.length))){if(u instanceof Ja){if(i&_n.ExcludeBuffers)continue;let h=u.findChild(0,u.buffer.length,n,o-d,r);if(h>-1)return new Ea(new Pme(s,u,e,d),null,h)}else if(i&_n.IncludeAnonymous||!u.type.isAnonymous||Wx(u)){let h;if(!(i&_n.IgnoreMounts)&&(h=ef.get(u))&&!h.overlay)return new Zr(h.tree,d,e,s);let m=new Zr(u,d,e,s);return i&_n.IncludeAnonymous||!m.type.isAnonymous?m:m.nextChild(n<0?u.children.length-1:0,n,o,r,i)}}}if(i&_n.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&_n.IgnoreOverlays)&&(r=ef.get(this._tree))&&r.overlay){let i=e-this.from,s=o&_n.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 Zr(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 wS(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 uy(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 Pme{constructor(e,n,o,r){this.parent=e,this.buffer=n,this.index=o,this.start=r}}class Ea extends ZM{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 Ea(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&_n.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 Ea(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 Ea(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 Ea(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 On(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function QM(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 Zr&&n.index<0?null:n.parent,r=t.slice();return o?r[e]=o:r.splice(e,1),new Dme(r,n)}class Dme{constructor(e,n){this.heads=e,this.node=n}get next(){return QM(this.heads)}}function Eme(t,e,n){let o=t.resolveInner(e,n),r=null;for(let i=o instanceof Zr?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=ef.get(i.tree);if(s&&s.overlay&&s.overlay[0].from<=e&&s.overlay[s.overlay.length-1].to>=e){let a=new Zr(s.tree,s.overlay[0].from+i.from,-1,i);(r||(r=[o])).push(Ff(a,e,n,!1))}}return r?QM(r):o}class dy{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&~_n.EnterBracketed,e instanceof Zr)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 Zr?(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&_n.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,o))}parent(){if(!this.buffer)return this.yieldNode(this.mode&_n.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&_n.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&_n.IncludeAnonymous||a instanceof Ja||!a.type.isAnonymous||Wx(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 Ea(this.buffer,n,this.stack[r]);return this.bufferNode=new Ea(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 uy(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 uy(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 Wx(t){return t.children.some(e=>e instanceof Ja||!e.type.isAnonymous||Wx(e))}function Ime(t){var e;let{buffer:n,nodeSet:o,maxBufferLength:r=KM,reused:i=[],minRepeatType:s=o.types.length}=t,a=Array.isArray(n)?new Hx(n,n.length):n,l=o.types,c=0,u=0;function d(C,D,M,$,L,E){let{id:N,start:T,end:O,size:P}=a,B=u,V=c;if(P<0)if(a.next(),P==-1){let ae=i[N];M.push(ae),$.push(T-C);return}else if(P==-3){c=N;return}else if(P==-4){u=N;return}else throw new RangeError(`Unrecognized record size: ${P}`);let z=l[N],G,K,ne=T-C;if(O-T<=r&&(K=g(a.pos-D,L))){let ae=new Uint16Array(K.size-K.skip),he=a.pos-K.size,ge=ae.length;for(;a.pos>he;)ge=v(K.start,ae,ge);G=new Ja(ae,O-K.start,o),ne=K.start-C}else{let ae=a.pos-P;a.next();let he=[],ge=[],le=N>=s?N:-1,fe=0,we=O;for(;a.pos>ae;)le>=0&&a.id==le&&a.size>=0?(a.end<=we-r&&(m(he,ge,T,fe,a.end,we,le,B,V),fe=he.length,we=a.end),a.next()):E>2500?f(T,ae,he,ge):d(T,ae,he,ge,le,E+1);if(le>=0&&fe>0&&fe<he.length&&m(he,ge,T,fe,T,we,le,B,V),he.reverse(),ge.reverse(),le>-1&&fe>0){let Z=h(z,V);G=Ux(z,he,ge,0,he.length,0,O-T,Z,Z)}else G=b(z,he,ge,O-T,B-O,V)}M.push(G),$.push(ne)}function f(C,D,M,$){let L=[],E=0,N=-1;for(;a.pos>D;){let{id:T,start:O,end:P,size:B}=a;if(B>4)a.next();else{if(N>-1&&O<N)break;N<0&&(N=P-r),L.push(T,O,P),E++,a.next()}}if(E){let T=new Uint16Array(E*4),O=L[L.length-2];for(let P=L.length-3,B=0;P>=0;P-=3)T[B++]=L[P],T[B++]=L[P+1]-O,T[B++]=L[P+2]-O,T[B++]=B;M.push(new Ja(T,L[2]-O,o)),$.push(O-C)}}function h(C,D){return(M,$,L)=>{let E=0,N=M.length-1,T,O;if(N>=0&&(T=M[N])instanceof On){if(!N&&T.type==C&&T.length==L)return T;(O=T.prop(Et.lookAhead))&&(E=$[N]+T.length+O)}return b(C,M,$,L,E,D)}}function m(C,D,M,$,L,E,N,T,O){let P=[],B=[];for(;C.length>$;)P.push(C.pop()),B.push(D.pop()+M-L);C.push(b(o.types[N],P,B,E-L,T-E,O)),D.push(L-M)}function b(C,D,M,$,L,E,N){if(E){let T=[Et.contextHash,E];N=N?[T].concat(N):[T]}if(L>25){let T=[Et.lookAhead,L];N=N?[T].concat(N):[T]}return new On(C,D,M,$,N)}function g(C,D){let M=a.fork(),$=0,L=0,E=0,N=M.end-r,T={size:0,start:0,skip:0};e:for(let O=M.pos-C;M.pos>O;){let P=M.size;if(M.id==D&&P>=0){T.size=$,T.start=L,T.skip=E,E+=4,$+=4,M.next();continue}let B=M.pos-P;if(P<0||B<O||M.start<N)break;let V=M.id>=s?4:0,z=M.start;for(M.next();M.pos>B;){if(M.size<0)if(M.size==-3||M.size==-4)V+=4;else break e;else M.id>=s&&(V+=4);M.next()}L=z,$+=P,E+=V}return(D<0||$==C)&&(T.size=$,T.start=L,T.skip=E),T.size>4?T:void 0}function v(C,D,M){let{id:$,start:L,end:E,size:N}=a;if(a.next(),N>=0&&$<s){let T=M;if(N>4){let O=a.pos-(N-4);for(;a.pos>O;)M=v(C,D,M)}D[--M]=T,D[--M]=E-C,D[--M]=L-C,D[--M]=$}else N==-3?c=$:N==-4&&(u=$);return M}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 On(l[t.topID],y.reverse(),x.reverse(),_)}const _S=new WeakMap;function Op(t,e){if(!t.isAnonymous||e instanceof Ja||e.type!=t)return 1;let n=_S.get(e);if(n==null){n=1;for(let o of e.children){if(o.type!=t||!(o instanceof On)){n=1;break}n+=Op(t,o)}_S.set(e,n)}return n}function Ux(t,e,n,o,r,i,s,a,l){let c=0;for(let m=o;m<r;m++)c+=Op(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],D=Op(t,m[x]);for(x++;x<v;x++){let M=Op(t,m[x]);if(D+M>=u)break;D+=M}if(x==_+1){if(D>u){let M=m[_];h(M.children,M.positions,0,M.children.length,b[_]+y);continue}d.push(m[_])}else{let M=b[x-1]+m[x-1].length-C;d.push(Ux(t,m,b,_,x,C,M,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 JM{startParse(e,n,o){return typeof e=="string"&&(e=new Nme(e)),o=o?o.length?o.map(r=>new h1(r.from,r.to)):[new h1(0,0)]:[new h1(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 Nme{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 Et({perNode:!0});let Rme=0;class Hr{constructor(e,n,o,r){this.name=e,this.set=n,this.base=o,this.modified=r,this.id=Rme++}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 Hr&&(n=e),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let r=new Hr(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 j0(e);return o=>o.modified.indexOf(n)>-1?o:j0.get(o.base||o,o.modified.concat(n).sort((r,i)=>r.id-i.id))}}let Fme=0;class j0{constructor(e){this.name=e,this.instances=[],this.id=Fme++}static get(e,n){if(!n.length)return e;let o=n[0].instances.find(a=>a.base==e&&Vme(n,a.modified));if(o)return o;let r=[],i=new Hr(e.name,r,e,n);for(let a of n)a.instances.push(i);let s=zme(n);for(let a of e.set)if(!a.modified.length)for(let l of s)r.push(j0.get(a,l));return i}}function Vme(t,e){return t.length==e.length&&t.every((n,o)=>n==e[o])}function zme(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 eB(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 Vf(o,s,l>0?i.slice(0,l):null);e[c]=u.sort(e[c])}}return tB.add(e)}const tB=new Et({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 Vf(r.tags,r.mode,r.context);n?n.next=i:o=i,n=i}return o}});class Vf{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}}Vf.empty=new Vf([],2,null);function nB(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 Hme(t,e){let n=null;for(let o of t){let r=o.style(e);r&&(n=n?n+" "+r:r)}return n}function oB(t,e,n,o=0,r=t.length){let i=new Wme(o,Array.isArray(e)?e:[e],n);i.highlightRange(t.cursor(),o,r,"",i.highlighters),i.flush(r)}class Wme{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=Ume(e)||Vf.empty,d=Hme(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(Et.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 Ume(t){let e=t.type.prop(tB);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const Xe=Hr.define,np=Xe(),Aa=Xe(),kS=Xe(Aa),SS=Xe(Aa),$a=Xe(),op=Xe($a),p1=Xe($a),Ki=Xe(),_l=Xe(Ki),Yi=Xe(),ji=Xe(),fy=Xe(),vd=Xe(fy),rp=Xe(),at={comment:np,lineComment:Xe(np),blockComment:Xe(np),docComment:Xe(np),name:Aa,variableName:Xe(Aa),typeName:kS,tagName:Xe(kS),propertyName:SS,attributeName:Xe(SS),className:Xe(Aa),labelName:Xe(Aa),namespace:Xe(Aa),macroName:Xe(Aa),literal:$a,string:op,docString:Xe(op),character:Xe(op),attributeValue:Xe(op),number:p1,integer:Xe(p1),float:Xe(p1),bool:Xe($a),regexp:Xe($a),escape:Xe($a),color:Xe($a),url:Xe($a),keyword:Yi,self:Xe(Yi),null:Xe(Yi),atom:Xe(Yi),unit:Xe(Yi),modifier:Xe(Yi),operatorKeyword:Xe(Yi),controlKeyword:Xe(Yi),definitionKeyword:Xe(Yi),moduleKeyword:Xe(Yi),operator:ji,derefOperator:Xe(ji),arithmeticOperator:Xe(ji),logicOperator:Xe(ji),bitwiseOperator:Xe(ji),compareOperator:Xe(ji),updateOperator:Xe(ji),definitionOperator:Xe(ji),typeOperator:Xe(ji),controlOperator:Xe(ji),punctuation:fy,separator:Xe(fy),bracket:vd,angleBracket:Xe(vd),squareBracket:Xe(vd),paren:Xe(vd),brace:Xe(vd),content:Ki,heading:_l,heading1:Xe(_l),heading2:Xe(_l),heading3:Xe(_l),heading4:Xe(_l),heading5:Xe(_l),heading6:Xe(_l),contentSeparator:Xe(Ki),list:Xe(Ki),quote:Xe(Ki),emphasis:Xe(Ki),strong:Xe(Ki),link:Xe(Ki),monospace:Xe(Ki),strikethrough:Xe(Ki),inserted:Xe(),deleted:Xe(),changed:Xe(),invalid:Xe(),meta:rp,documentMeta:Xe(rp),annotation:Xe(rp),processingInstruction:Xe(rp),definition:Hr.defineModifier("definition"),constant:Hr.defineModifier("constant"),function:Hr.defineModifier("function"),standard:Hr.defineModifier("standard"),local:Hr.defineModifier("local"),special:Hr.defineModifier("special")};for(let t in at){let e=at[t];e instanceof Hr&&(e.name=t)}const rB=nB([{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 m1;const Hc=new Et;function Gme(t){return xt.define({combine:t?e=>e.concat(t):void 0})}const qme=new Et;class bi{constructor(e,n,o=[],r=""){this.data=e,this.name=r,Jt.prototype.hasOwnProperty("tree")||Object.defineProperty(Jt.prototype,"tree",{get(){return vs(this)}}),this.parser=n,this.extension=[Lu.of(this),Jt.languageData.of((i,s,a)=>{let l=CS(i,s,a),c=l.type.prop(Hc);if(!c)return[];let u=i.facet(c),d=l.type.prop(qme);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 CS(e,n,o).type.prop(Hc)==this.data}findRegions(e){let n=e.facet(Lu);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(Hc)==this.data){o.push({from:s,to:s+i.length});return}let a=i.prop(Et.mounted);if(a){if(a.tree.prop(Hc)==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 On&&r(c,i.positions[l]+s)}};return r(vs(e),0),o}get allowsNesting(){return!0}}bi.setState=Tn.define();function CS(t,e,n){let o=t.facet(Lu),r=vs(t).topNode;if(!o||o.allowsNesting)for(let i=r;i;i=i.enter(e,n,_n.ExcludeBuffers|_n.EnterBracketed))i.type.isTop&&(r=i);return r}class K0 extends bi{constructor(e,n,o){super(e,n,[],o),this.parser=n}static define(e){let n=Gme(e.languageData);return new K0(n,e.parser.configure({props:[Hc.add(o=>o.isTop?n:void 0)]}),e.name)}configure(e,n){return new K0(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function vs(t){let e=t.field(bi.state,!1);return e?e.tree:On.empty}class Yme{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 bd=null;class X0{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 X0(e,n,[],On.empty,0,o,[],null)}startParse(){return this.parser.startParse(new Yme(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=On.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=bd;bd=this;try{return e()}finally{bd=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=AS(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=On.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 X0(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=AS(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 JM{createParse(n,o,r){let i=r[0].from,s=r[r.length-1].to;return{parsedPos:i,advance(){let l=bd;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 On(hr.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 bd}}function AS(t,e,n){return Wl.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class Bu{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 Bu(n)}static init(e){let n=Math.min(3e3,e.doc.length),o=X0.create(e.facet(Lu).parser,e,{from:0,to:n});return o.work(20,n)||o.takeTree(),new Bu(o)}}bi.state=hl.define({create:Bu.init,update(t,e){for(let n of e.effects)if(n.is(bi.setState))return n.value;return e.startState.facet(Lu)!=e.state.facet(Lu)?Bu.init(e.state):t.apply(e)}});let iB=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(iB=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const g1=typeof navigator<"u"&&(!((m1=navigator.scheduling)===null||m1===void 0)&&m1.isInputPending)?()=>navigator.scheduling.isInputPending():null,jme=rc.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(bi.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(bi.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=iB(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(bi.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let s=Date.now()+Math.min(this.chunkBudget,100,e&&!g1?Math.max(25,e.timeRemaining()-5):1e9),a=i.context.treeLen<r&&o.doc.length>r+1e3,l=i.context.work(()=>g1&&g1()||Date.now()>s,r+(a?0:1e5));this.chunkBudget-=Date.now()-n,(l||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:bi.setState.of(new Bu(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=>rs(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()}}}),Lu=xt.define({combine(t){return t.length?t[0]:null},enables:t=>[bi.state,jme,At.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class Kme{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}const Xme=xt.define(),Gx=xt.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 Z0(t){let e=t.facet(Gx);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function Q0(t,e){let n="",o=t.tabSize,r=t.facet(Gx)[0];if(r==" "){for(;e>=o;)n+=" ",e-=o;r=" "}for(let i=0;i<e;i++)n+=r;return n}function sB(t,e){t instanceof Jt&&(t=new qg(t));for(let o of t.state.facet(Xme)){let r=o(t,e);if(r!==void 0)return r}let n=vs(t.state);return n.length>=e?Qme(t,n,e):null}class qg{constructor(e,n={}){this.state=e,this.options=n,this.unit=Z0(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 Fg(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 Zme=new Et;function Qme(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 aB(o,t,n)}function aB(t,e,n){for(let o=t;o;o=o.next){let r=ege(o.node);if(r)return r(qx.create(e,n,o))}return 0}function Jme(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function ege(t){let e=t.type.prop(Zme);if(e)return e;let n=t.firstChild,o;if(n&&(o=n.type.prop(Et.closedBy))){let r=t.lastChild,i=r&&o.indexOf(r.name)>-1;return s=>rge(s,!0,1,void 0,i&&!Jme(s)?r.from:void 0)}return t.parent==null?tge:null}function tge(){return 0}class qx extends qg{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 qx(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(nge(o,e))break;n=this.state.doc.lineAt(o.from)}return this.lineIndent(n.from)}continue(){return aB(this.context.next,this.base,this.pos)}}function nge(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function oge(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 rge(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=oge(t);return l?a?t.column(l.from):t.column(l.to):t.baseIndent+(a?0:t.unit*n)}class Yx{constructor(e,n){this.specs=e;let o;function r(a){let l=Xa.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 bi?a=>a.prop(Hc)==s.data:s?a=>a==s:void 0,this.style=nB(e.map(a=>({tag:a.tag,class:a.class||r(Object.assign({},a,{tag:null}))})),{all:i}).style,this.module=o?new Xa(o):null,this.themeType=n.themeType}static define(e,n){return new Yx(e,n||{})}}const hy=xt.define(),ige=xt.define({combine(t){return t.length?[t[0]]:null}});function v1(t){let e=t.facet(hy);return e.length?e:t.facet(ige)}function sge(t,e){let n=[lge],o;return t instanceof Yx&&(t.module&&n.push(At.styleModule.of(t.module)),o=t.themeType),o?n.push(hy.computeN([At.darkTheme],r=>r.facet(At.darkTheme)==(o=="dark")?[t]:[])):n.push(hy.of(t)),n}class age{constructor(e){this.markCache=Object.create(null),this.tree=vs(e.state),this.decorations=this.buildDeco(e,v1(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=vs(e.state),o=v1(e.state),r=o!=v1(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 no.none;let o=new Pf;for(let{from:r,to:i}of e.visibleRanges)oB(this.tree,n,(s,a,l)=>{o.add(s,a,this.markCache[l]||(this.markCache[l]=no.mark({class:l})))},r,i);return o.finish()}}const lge=Tx.high(rc.fromClass(age,{decorations:t=>t.decorations})),cge=1e4,uge="()[]{}",dge=new Et;function py(t,e,n){let o=t.prop(e<0?Et.openedBy:Et.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 my(t){let e=t.type.prop(dge);return e?e(t.node):t}function Wc(t,e,n,o={}){let r=o.maxScanDistance||cge,i=o.brackets||uge,s=vs(t),a=s.resolveInner(e,n);for(let l=a;l;l=l.parent){let c=py(l.type,n,i);if(c&&l.from<l.to){let u=my(l);if(u&&(n>0?e>=u.from&&e<u.to:e>u.from&&e<=u.to))return fge(t,e,n,l,u,c,i)}}return hge(t,e,n,s,a.type,r,i)}function fge(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=my(u);return{start:l,end:d?{from:d.from,to:d.to}:void 0,matched:!0}}else if(py(u.type,n,s))c++;else if(py(u.type,-n,s)){if(c==0){let d=my(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 hge(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 pge=Object.create(null),$S=[hr.none],TS=[],OS=Object.create(null),mge=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"]])mge[t]=gge(pge,e);function b1(t,e){TS.indexOf(t)>-1||(TS.push(t),console.warn(e))}function gge(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):b1(c,`Modifier ${c} used at start of tag`):l.length?b1(c,`Tag ${c} used as modifier`):l=Array.isArray(u)?u:[u]:b1(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=OS[r];if(i)return i.id;let s=OS[r]=hr.define({id:$S.length,name:o,props:[eB({[o]:n})]});return $S.push(s),s.id}Nn.RTL,Nn.LTR;const vge=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),o=Kx(t.state,n.from);return o.line?bge(t):o.block?xge(t):!1};function jx(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 bge=jx(kge,0),yge=jx(lB,0),xge=jx((t,e)=>lB(t,e,_ge(e)),0);function Kx(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const yd=50;function wge(t,{open:e,close:n},o,r){let i=t.sliceDoc(o-yd,o),s=t.sliceDoc(r,r+yd),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*yd?u=d=t.sliceDoc(o,r):(u=t.sliceDoc(o,o+yd),d=t.sliceDoc(r-yd,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 _ge(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 lB(t,e,n=e.selection.ranges){let o=n.map(i=>Kx(e,i.from).block);if(!o.every(i=>i))return null;let r=n.map((i,s)=>wge(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 kge(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=Kx(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 gy=pl.define(),Sge=pl.define(),Cge=xt.define(),cB=xt.define({combine(t){return Dpe(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)})}}),uB=hl.define({create(){return is.empty},update(t,e){let n=e.state.facet(cB),o=e.annotation(gy);if(o){let l=ur.fromTransaction(e,o.selection),c=o.side,u=c==0?t.undone:t.done;return l?u=J0(u,u.length,n.minDepth,l):u=hB(u,e.startState.selection),new is(c==0?o.rest:u,c==0?u:o.rest)}let r=e.annotation(Sge);if((r=="full"||r=="before")&&(t=t.isolate()),e.annotation(Zn.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let i=ur.fromTransaction(e),s=e.annotation(Zn.time),a=e.annotation(Zn.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 is(t.done.map(ur.fromJSON),t.undone.map(ur.fromJSON))}});function Age(t={}){return[uB,cB.of(t),At.domEventHandlers({beforeinput(e,n){let o=e.inputType=="historyUndo"?dB:e.inputType=="historyRedo"?vy:null;return o?(e.preventDefault(),o(n)):!1}})]}function Yg(t,e){return function({state:n,dispatch:o}){if(!e&&n.readOnly)return!1;let r=n.field(uB,!1);if(!r)return!1;let i=r.pop(t,n,e);return i?(o(i),!0):!1}}const dB=Yg(0,!1),vy=Yg(1,!1),$ge=Yg(0,!0),Tge=Yg(1,!0);class ur{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 ur(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 ur(e.changes&&Kn.fromJSON(e.changes),[],e.mapped&&fs.fromJSON(e.mapped),e.startSelection&&Ye.fromJSON(e.startSelection),e.selectionsAfter.map(Ye.fromJSON))}static fromTransaction(e,n){let o=Gr;for(let r of e.startState.facet(Cge)){let i=r(e);i.length&&(o=o.concat(i))}return!o.length&&e.changes.empty?null:new ur(e.changes.invert(e.startState.doc),o,void 0,n||e.startState.selection,Gr)}static selection(e){return new ur(void 0,Gr,void 0,void 0,e)}}function J0(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 Oge(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 Mge(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,o)=>n.empty!=e.ranges[o].empty).length===0}function fB(t,e){return t.length?e.length?t.concat(e):t:e}const Gr=[],Bge=200;function hB(t,e){if(t.length){let n=t[t.length-1],o=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Bge));return o.length&&o[o.length-1].eq(e)?t:(o.push(e),J0(t,t.length-1,1e9,n.setSelAfter(o)))}else return[ur.selection([e])]}function Lge(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 y1(t,e){if(!t.length)return t;let n=t.length,o=Gr;for(;n;){let r=Pge(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?[ur.selection(o)]:Gr}function Pge(t,e,n){let o=fB(t.selectionsAfter.length?t.selectionsAfter.map(a=>a.map(e)):Gr,n);if(!t.changes)return ur.selection(o);let r=t.changes.map(e),i=e.mapDesc(t.changes,!0),s=t.mapped?t.mapped.composeDesc(i):i;return new ur(r,Tn.mapEffects(t.effects,e),s,t.startSelection.map(i),o)}const Dge=/^(input\.type|delete)($|\.)/;class is{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 is(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||Dge.test(o))&&(!a.selectionsAfter.length&&n-this.prevTime<r.newGroupDelay&&r.joinToEvent(i,Oge(a.changes,e.changes))||o=="input.type.compose")?s=J0(s,s.length-1,r.minDepth,new ur(e.changes.compose(a.changes),fB(Tn.mapEffects(e.effects,a.changes),a.effects),a.mapped,a.startSelection,Gr)):s=J0(s,s.length,r.minDepth,e),new is(s,Gr,n,o)}addSelection(e,n,o,r){let i=this.done.length?this.done[this.done.length-1].selectionsAfter:Gr;return i.length>0&&n-this.prevTime<r&&o==this.prevUserEvent&&o&&/^select($|\.)/.test(o)&&Mge(i[i.length-1],e)?this:new is(hB(this.done,e),this.undone,n,o)}addMapping(e){return new is(y1(this.done,e),y1(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:gy.of({side:e,rest:Lge(r),selection:s}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(i.changes){let a=r.length==1?Gr:r.slice(0,r.length-1);return i.mapped&&(a=y1(a,i.mapped)),n.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:gy.of({side:e,rest:a,selection:s}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}is.empty=new is(Gr,Gr);const Ege=[{key:"Mod-z",run:dB,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:vy,preventDefault:!0},{linux:"Ctrl-Shift-z",run:vy,preventDefault:!0},{key:"Mod-u",run:$ge,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Tge,preventDefault:!0}];function Qu(t,e){return Ye.create(t.ranges.map(e),t.mainIndex)}function zi(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Hi({state:t,dispatch:e},n){let o=Qu(t.selection,n);return o.eq(t.selection,!0)?!1:(e(zi(t,o)),!0)}function jg(t,e){return Ye.cursor(e?t.to:t.from)}function pB(t,e){return Hi(t,n=>n.empty?t.moveByChar(n,e):jg(n,e))}function Eo(t){return t.textDirectionAt(t.state.selection.main.head)==Nn.LTR}const mB=t=>pB(t,!Eo(t)),gB=t=>pB(t,Eo(t));function vB(t,e){return Hi(t,n=>n.empty?t.moveByGroup(n,e):jg(n,e))}const Ige=t=>vB(t,!Eo(t)),Nge=t=>vB(t,Eo(t));function Rge(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 Kg(t,e,n){let o=vs(t).resolveInner(e.head),r=n?Et.closedBy:Et.openedBy;for(let l=e.head;;){let c=n?o.childAfter(l):o.childBefore(l);if(!c)break;Rge(t,c,r)?o=c:l=n?c.to:c.from}let i=o.type.prop(r),s,a;return i&&(s=n?Wc(t,o.from,1):Wc(t,o.to,-1))&&s.matched?a=n?s.end.to:s.end.from:a=n?o.to:o.from,Ye.cursor(a,n?-1:1)}const Fge=t=>Hi(t,e=>Kg(t.state,e,!Eo(t))),Vge=t=>Hi(t,e=>Kg(t.state,e,Eo(t)));function bB(t,e){return Hi(t,n=>{if(!n.empty)return jg(n,e);let o=t.moveVertically(n,e);return o.head!=n.head?o:t.moveToLineBoundary(n,e)})}const yB=t=>bB(t,!1),xB=t=>bB(t,!0);function wB(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,o=0,r;if(e){for(let i of t.state.facet(At.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 _B(t,e){let n=wB(t),{state:o}=t,r=Qu(o.selection,s=>s.empty?t.moveVertically(s,e,n.height):jg(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=At.scrollIntoView(r.main.head,{y:"start",yMargin:s.top-l}))}return t.dispatch(zi(o,r),{effects:i}),!0}const MS=t=>_B(t,!1),by=t=>_B(t,!0);function ml(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=Ye.cursor(o.from+i))}return r}const zge=t=>Hi(t,e=>ml(t,e,!0)),Hge=t=>Hi(t,e=>ml(t,e,!1)),Wge=t=>Hi(t,e=>ml(t,e,!Eo(t))),Uge=t=>Hi(t,e=>ml(t,e,Eo(t))),Gge=t=>Hi(t,e=>Ye.cursor(t.lineBlockAt(e.head).from,1)),qge=t=>Hi(t,e=>Ye.cursor(t.lineBlockAt(e.head).to,-1));function Yge(t,e,n){let o=!1,r=Qu(t.selection,i=>{let s=Wc(t,i.head,-1)||Wc(t,i.head,1)||i.head>0&&Wc(t,i.head-1,1)||i.head<t.doc.length&&Wc(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 Ye.cursor(a)});return o?(e(zi(t,r)),!0):!1}const jge=({state:t,dispatch:e})=>Yge(t,e);function si(t,e){let n=Qu(t.state.selection,o=>{let r=e(o);return Ye.range(o.anchor,r.head,r.goalColumn,r.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch(zi(t.state,n)),!0)}function kB(t,e){return si(t,n=>t.moveByChar(n,e))}const SB=t=>kB(t,!Eo(t)),CB=t=>kB(t,Eo(t));function AB(t,e){return si(t,n=>t.moveByGroup(n,e))}const Kge=t=>AB(t,!Eo(t)),Xge=t=>AB(t,Eo(t)),Zge=t=>si(t,e=>Kg(t.state,e,!Eo(t))),Qge=t=>si(t,e=>Kg(t.state,e,Eo(t)));function $B(t,e){return si(t,n=>t.moveVertically(n,e))}const TB=t=>$B(t,!1),OB=t=>$B(t,!0);function MB(t,e){return si(t,n=>t.moveVertically(n,e,wB(t).height))}const BS=t=>MB(t,!1),LS=t=>MB(t,!0),Jge=t=>si(t,e=>ml(t,e,!0)),eve=t=>si(t,e=>ml(t,e,!1)),tve=t=>si(t,e=>ml(t,e,!Eo(t))),nve=t=>si(t,e=>ml(t,e,Eo(t))),ove=t=>si(t,e=>Ye.cursor(t.lineBlockAt(e.head).from)),rve=t=>si(t,e=>Ye.cursor(t.lineBlockAt(e.head).to)),PS=({state:t,dispatch:e})=>(e(zi(t,{anchor:0})),!0),DS=({state:t,dispatch:e})=>(e(zi(t,{anchor:t.doc.length})),!0),ES=({state:t,dispatch:e})=>(e(zi(t,{anchor:t.selection.main.anchor,head:0})),!0),IS=({state:t,dispatch:e})=>(e(zi(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),ive=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),sve=({state:t,dispatch:e})=>{let n=Xg(t).map(({from:o,to:r})=>Ye.range(o,Math.min(r+1,t.doc.length)));return e(t.update({selection:Ye.create(n),userEvent:"select"})),!0},ave=({state:t,dispatch:e})=>{let n=Qu(t.selection,o=>{let r=vs(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 Ye.range(a.to,a.from)}return o});return n.eq(t.selection)?!1:(e(zi(t,n)),!0)};function BB(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(zi(n,Ye.create(r,r.length-1))),!0)}const lve=t=>BB(t,!1),cve=t=>BB(t,!0),uve=({state:t,dispatch:e})=>{let n=t.selection,o=null;return n.ranges.length>1?o=Ye.create([n.main]):n.main.empty||(o=Ye.create([Ye.cursor(n.main.head)])),o?(e(zi(t,o)),!0):!1};function ah(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=ip(t,l,!1)):l>s&&(n="delete.forward",l=ip(t,l,!0)),s=Math.min(s,l),a=Math.max(a,l)}else s=ip(t,s,!1),a=ip(t,a,!0);return s==a?{range:i}:{changes:{from:s,to:a},range:Ye.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"?At.announce.of(o.phrase("Selection deleted")):void 0})),!0)}function ip(t,e,n){if(t instanceof At)for(let o of t.state.facet(At.atomicRanges).map(r=>r(t)))o.between(e,e,(r,i)=>{r<e&&i>e&&(e=n?i:r)});return e}const LB=(t,e,n)=>ah(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=Fg(a,i.tabSize),u=c%Z0(i)||Z0(i);for(let d=0;d<u&&a[a.length-1-d]==" ";d++)r--;l=r}else l=Po(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=Po(s.text,l-s.from,!1,!1)+s.from);return l}),yy=t=>LB(t,!1,!0),PB=t=>LB(t,!0,!1),DB=(t,e)=>ah(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=Po(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}),EB=t=>DB(t,!1),dve=t=>DB(t,!0),fve=t=>ah(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),hve=t=>ah(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),pve=t=>ah(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),mve=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(o=>({changes:{from:o.from,to:o.to,insert:qt.of(["",""])},range:Ye.cursor(o.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},gve=({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:Po(i.text,r-i.from,!1)+i.from,a=r==i.to?r+1:Po(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:Ye.cursor(a)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Xg(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 IB(t,e,n){if(t.readOnly)return!1;let o=[],r=[];for(let i of Xg(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(Ye.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(Ye.range(l.anchor-a,l.head-a))}}return o.length?(e(t.update({changes:o,scrollIntoView:!0,selection:Ye.create(r,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const vve=({state:t,dispatch:e})=>IB(t,e,!1),bve=({state:t,dispatch:e})=>IB(t,e,!0);function NB(t,e,n){if(t.readOnly)return!1;let o=[];for(let i of Xg(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 yve=({state:t,dispatch:e})=>NB(t,e,!1),xve=({state:t,dispatch:e})=>NB(t,e,!0),wve=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(Xg(e).map(({from:r,to:i})=>(r>0?r--:i<e.doc.length&&i++,{from:r,to:i}))),o=Qu(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 _ve(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=vs(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(Et.closedBy))&&i.indexOf(r.name)>-1&&t.doc.lineAt(o.to).from==t.doc.lineAt(r.from).from&&!/\S/.test(t.sliceDoc(o.to,r.from))?{from:o.to,to:r.from}:null}const NS=RB(!1),kve=RB(!0);function RB(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&&_ve(e,i);t&&(i=s=(s<=a.to?a:e.doc.lineAt(s)).to);let c=new qg(e,{simulateBreak:i,simulateDoubleBreak:!!l}),u=sB(c,i);for(u==null&&(u=Fg(/^\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=["",Q0(e,u)];return l&&d.push(Q0(e,c.lineIndent(a.from,-1))),{changes:{from:i,to:s,insert:qt.of(d)},range:Ye.cursor(i+1+d[1].length)}});return n(e.update(o,{scrollIntoView:!0,userEvent:"input"})),!0}}function Xx(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:Ye.range(i.mapPos(o.anchor,1),i.mapPos(o.head,1))}})}const Sve=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),o=new qg(t,{overrideIndentation:i=>{let s=n[i];return s??-1}}),r=Xx(t,(i,s,a)=>{let l=sB(o,i.from);if(l==null)return;/\S/.test(i.text)||(l=0);let c=/^\s*/.exec(i.text)[0],u=Q0(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},Cve=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Xx(t,(n,o)=>{o.push({from:n.from,insert:t.facet(Gx)})}),{userEvent:"input.indent"})),!0),Ave=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Xx(t,(n,o)=>{let r=/^\s*/.exec(n.text)[0];if(!r)return;let i=Fg(r,t.tabSize),s=0,a=Q0(t,Math.max(0,i-Z0(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),$ve=t=>(t.setTabFocusMode(),!0),Tve=[{key:"Ctrl-b",run:mB,shift:SB,preventDefault:!0},{key:"Ctrl-f",run:gB,shift:CB},{key:"Ctrl-p",run:yB,shift:TB},{key:"Ctrl-n",run:xB,shift:OB},{key:"Ctrl-a",run:Gge,shift:ove},{key:"Ctrl-e",run:qge,shift:rve},{key:"Ctrl-d",run:PB},{key:"Ctrl-h",run:yy},{key:"Ctrl-k",run:fve},{key:"Ctrl-Alt-h",run:EB},{key:"Ctrl-o",run:mve},{key:"Ctrl-t",run:gve},{key:"Ctrl-v",run:by}],Ove=[{key:"ArrowLeft",run:mB,shift:SB,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Ige,shift:Kge,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Wge,shift:tve,preventDefault:!0},{key:"ArrowRight",run:gB,shift:CB,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Nge,shift:Xge,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Uge,shift:nve,preventDefault:!0},{key:"ArrowUp",run:yB,shift:TB,preventDefault:!0},{mac:"Cmd-ArrowUp",run:PS,shift:ES},{mac:"Ctrl-ArrowUp",run:MS,shift:BS},{key:"ArrowDown",run:xB,shift:OB,preventDefault:!0},{mac:"Cmd-ArrowDown",run:DS,shift:IS},{mac:"Ctrl-ArrowDown",run:by,shift:LS},{key:"PageUp",run:MS,shift:BS},{key:"PageDown",run:by,shift:LS},{key:"Home",run:Hge,shift:eve,preventDefault:!0},{key:"Mod-Home",run:PS,shift:ES},{key:"End",run:zge,shift:Jge,preventDefault:!0},{key:"Mod-End",run:DS,shift:IS},{key:"Enter",run:NS,shift:NS},{key:"Mod-a",run:ive},{key:"Backspace",run:yy,shift:yy,preventDefault:!0},{key:"Delete",run:PB,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:EB,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:dve,preventDefault:!0},{mac:"Mod-Backspace",run:hve,preventDefault:!0},{mac:"Mod-Delete",run:pve,preventDefault:!0}].concat(Tve.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),Mve=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Fge,shift:Zge},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Vge,shift:Qge},{key:"Alt-ArrowUp",run:vve},{key:"Shift-Alt-ArrowUp",run:yve},{key:"Alt-ArrowDown",run:bve},{key:"Shift-Alt-ArrowDown",run:xve},{key:"Mod-Alt-ArrowUp",run:lve},{key:"Mod-Alt-ArrowDown",run:cve},{key:"Escape",run:uve},{key:"Mod-Enter",run:kve},{key:"Alt-l",mac:"Ctrl-l",run:sve},{key:"Mod-i",run:ave,preventDefault:!0},{key:"Mod-[",run:Ave},{key:"Mod-]",run:Cve},{key:"Mod-Alt-\\",run:Sve},{key:"Shift-Mod-k",run:wve},{key:"Shift-Mod-\\",run:jge},{key:"Mod-/",run:vge},{key:"Alt-A",run:yge},{key:"Ctrl-m",mac:"Shift-Alt-m",run:$ve}].concat(Ove);var RS={};class em{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 em(e,[],n,o,o,0,[],0,r?new FS(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 em(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 Bve(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 FS(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 FS{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class Bve{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 tm{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 tm(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 tm(this.stack,this.pos,this.index)}}function sp(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 Mp{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const VS=new Mp;class Lve{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=VS,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=VS,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 su{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:o}=n.p;Pve(this.data,e,n,this.id,o.data,o.tokenPrecTable)}}su.prototype.contextual=su.prototype.fallback=su.prototype.extend=!1;su.prototype.fallback=su.prototype.extend=!1;function Pve(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||Dve(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 zS(t,e,n){for(let o=e,r;(r=t[o])!=65535;o++)if(r==n)return o-e;return-1}function Dve(t,e,n,o){let r=zS(n,o,e);return r<0||zS(n,o,t)<r}const vr=typeof process<"u"&&RS&&/\bparse\b/.test(RS.LOG);let x1=null;function HS(t,e,n){let o=t.cursor(_n.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 Eve{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?HS(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?HS(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 On){if(s==e){if(s<this.safeFrom)return null;let a=s+i.length;if(a<=this.safeTo){let l=i.prop(Et.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 Ive{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(o=>new Mp)}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 Mp,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 Mp,{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=Vs(a,c+2);else{r==0&&a[c+1]==2&&(r=this.putAction(Vs(a,c+2),n,o,r));break}a[c]==n&&(r=this.putAction(Vs(a,c+1),n,o,r))}return r}}class Nve{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 Lve(n,r),this.tokens=new Ive(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[em.start(this,e.top[0],i)],this.fragments=o.length&&this.stream.end-i>e.bufferLength*4?new Eve(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&&Fve(r);if(s)return vr&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw vr&&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 vr&&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=vr?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(Et.contextHash)||0)==u))return e.useNode(d,f),vr&&console.log(s+this.stackID(e)+` (via reuse of ${i.getName(d.type.id)})`),!0;if(!(d instanceof On)||d.children.length==0||d.positions[0]>0)break;let h=d.children[0];if(h instanceof On&&d.positions[0]==0)d=h;else break}}let a=i.stateSlot(e.state,4);if(a>0)return e.reduce(a),vr&&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),vr&&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 WS(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=vr?this.stackID(a)+" -> ":"";if(a.deadEnd&&(i||(i=!0,a.restart(),vr&&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()&&(vr&&console.log(f+this.stackID(d)+" (via force-reduce)"),!this.advanceFully(d,o));h++)vr&&(f=this.stackID(d)+" -> ");for(let h of a.recoverByInsert(l))vr&&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),vr&&console.log(u+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),WS(a,o)):(!r||r.score<d.score)&&(r=d)}return r}stackToTree(e){return e.close(),On.build({buffer:tm.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=(x1||(x1=new WeakMap)).get(e);return n||x1.set(e,n=String.fromCodePoint(this.nextStackID++)),n+e}}function WS(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 Rve{constructor(e,n,o){this.source=e,this.flags=n,this.disabled=o}allows(e){return!this.disabled||this.disabled[e]==0}}class nm extends JM{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=Et[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 zx(n.map((a,l)=>hr.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=KM;let s=sp(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(US),this.states=sp(e.states,Uint32Array),this.data=sp(e.stateData),this.goto=sp(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(a=>typeof a=="number"?new su(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 Nve(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=Vs(o,i+2)];else{if(o[i+1]==2)return Vs(o,i+2);break}if(s==n||s==0)return Vs(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=Vs(this.data,i+2);else break;r=n(Vs(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=Vs(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(nm.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]=US(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 Rve(e,o,r)}static deserialize(e){return new nm(e)}}function Vs(t,e){return t[e]|t[e+1]<<16}function Fve(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 US(t){if(t.external){let e=t.extend?1:0;return(n,o)=>t.external(n,o)<<1|e}return t.get}const Vve={__proto__:null,chart:12,data:18,colorize:40,highlight:42,"area-fill":46,range:50,note:55,annotation:58,"hide-annotation":62,"show-annotation":64,"hide-range":66,"show-range":68,"hide-note":70,"show-note":72,series:77,scene:80,transform:86},zve=nm.deserialize({version:14,states:",lO]QPOOQOQPOOObQPO'#C`OgQPO,58zO!vQPO1G.fOOQO'#Cg'#CgO!}QPO'#CnOOQO'#Cc'#CcOOQO'#DY'#DYO#SQPO7+$QO#ZQPO'#CdO#`QPO'#CoO#eQPO'#CrO#jQPO'#CtO#oQPO'#CvO#tQPO'#CxO#yQPO'#CzO$OQPO'#DRO$TQPO'#DWO$YQPO'#DTOOQO7+$Q7+$QO$bQPO,59YOOQO-E7W-E7WOOQO<<Gl<<GlO$pQPO,59OO${QPO,59ZO&]QPO,59^O&bQPO,59`O&mQPO,59bO&xQPO,59dOOQO,59f,59fO&}QPO,59mO'SQPO,59rO(`QPO,59oO(gQPO,59oOOQO'#Ck'#CkOOQO1G.t1G.tO(lQPO'#CnOOQO'#Cf'#CfOOQO'#DZ'#DZO(qQPO1G.jOOQO1G.j1G.jO(|QPO1G.uO)XQPO1G.xOOQO'#D]'#D]O)^QPO1G.zOOQO1G.z1G.zO)iQPO1G.|OOQO1G.|1G.|O)tQPO1G/OO*PQPO1G/XO*[QPO1G/^OOQO'#DV'#DVOOQO'#D^'#D^O*gQPO1G/ZOOQO1G/Z1G/ZO*gQPO1G/ZO$bQPO,59YOOQO-E7X-E7XOOQO7+$U7+$UO*nQPO7+$aOOQO7+$a7+$aO*yQPO7+$dOOQO-E7Z-E7ZOOQO7+$f7+$fOOQO7+$h7+$hO+UQPO7+$jOOQO7+$j7+$jO+aQPO7+$sOOQO7+$s7+$sO+lQPO7+$xOOQO7+$x7+$xOOQO-E7[-E7[OOQO7+$u7+$uO+wQPO7+$uO,OQPO1G.tOOQO1G.l1G.lOOQO<<G{<<G{O,^QPO<<HOOOQO<<HO<<HOOOQO<<HU<<HUOOQO<<H_<<H_OOQO<<Hd<<HdOOQO<<Ha<<HaO$bQPO'#D[O,iQPO,59UOOQOAN=jAN=jOOQO,59v,59vOOQO-E7Y-E7Y",stateData:"-O~O!TOSPOSQOS~OUQO~OTRO~O!USO~OTTOXYO[TOdZOeZOg[Oi]Ok^Om_Oo`Op`Oq`Or`Os`Ot`OvaOxcO{bO~O!WdO~PlO]eO~O!WgO~PlO!UhO~O[iO~O[jO~O!UkO~O!UlO~O[mO~O[nO~O[oO~OTpO~O[rO!UqO~OTsO[sO`sOasO~OTTO[TO!WyO~O!UzOTcaXca[cadcaecagcaicakcamcaocapcaqcarcascatcavcaxca{ca!Wca~O[{O~OTTO[TO!W!OO~OTTO[TO!W!QO~O!U!RO~O!U!SO~O!U!TO~OTTOXYO[TOdZOeZOg[Oi]Ok^Om_Oo`Op`Oq`Or`Os`Ot`OvaO{bO~O!W!XO~P'XO!U!YO~O]!ZO~OTTO[TO!W!]O~OTTO[TO!W!_O~O!U!`O~OTTO[TO!W!bO~OTTO[TO!W!cO~OTTO[TO!W!eO~OTTO[TO!W!gO~OTTO[TO!W!iO~O!W!kO~P'XOTTO[TO!W!oO~OTTO[TO!W!qO~OTTO[TO!W!rO~OTTO[TO!W!sO~OTTO[TO!W!tO~O!W!uO~P'XO!V!vOTbi[bi!Wbi~OTTO[TO!W!xO~O!V!vOT^a[^a!W^a~O`aQPTQ~",goto:"%g!RPPPP!SPP!V!ZP!e!iPP#T#WPP#a!ZPP!ZP!ZP!ZP!ZP!ZPPPPPP!ZP$PP$T!ZP$Z$a$g$m%]RPOTWSXSVSXX!Uq!W!Y!lTwhxxUSXklqz}!P!R!S!T!W!Y!^!`!d!f!h!l!pTuhxR!n!ZQteQ!m!ZR!y!vSVSXSvhxl|klz}!P!R!S!T!^!`!d!f!h!pX!Uq!W!Y!lTVSXX!Vq!W!Y!lQXSRfXQxhR![xQ!w!mR!z!wQ}kQ!PlQ!^z^!a}!P!^!d!f!h!pQ!d!RQ!f!SQ!h!TR!p!`Q!WqS!j!W!lR!l!Y",nodeNames:"⚠ LineComment BlockComment Chart ChartDecl Identifier chart ChartMember DataBlock data DataEntry PropertyKey String Equals ValueList PropertyValue Percentage Number Property Colorize colorize highlight AreaFill area-fill RangeAnnotation range NoteAnnotation note Annotation annotation VisibilityDirective hide-annotation show-annotation hide-range show-range hide-note show-note Series series Scene scene SceneMember Transform transform",maxTerm:54,skippedNodes:[0,1,2],repeatNodeCount:5,tokenData:"*f~RgX^!jpq!jrs#_st$x|}%a}!O%f!O!P%o!P!Q'`!Q![&z!_!`*V!c!}$x#R#S$x#T#o$x#o#p*[#q#r*a#y#z!j$f$g!j#BY#BZ!j$IS$I_!j$I|$JO!j$JT$JU!j$KV$KW!j&FU&FV!j~!oY!T~X^!jpq!j#y#z!j$f$g!j#BY#BZ!j$IS$I_!j$I|$JO!j$JT$JU!j$KV$KW!j&FU&FV!j~#bVOr#_rs#ws#O#_#O#P#|#P;'S#_;'S;=`$r<%lO#_~#|O[~~$PZOr#_rs#_s#O#_#O#P#_#P#b#_#b#c#_#c#h#_#h#i#_#i;'S#_;'S;=`$r<%lO#_~$uP;=`<%l#_~$}UT~st$x}!O$x!Q![$x!c!}$x#R#S$x#T#o$x~%fO!V~~%iQ!O!P%o!Q![&z~%rP!Q![%u~%zSa~uv&W!Q![%u!g!h&]#X#Y&]~&]O`~~&`R{|&i}!O&i!Q![&o~&lP!Q![&o~&tQa~uv&W!Q![&o~'PTa~uv&W!O!P%u!Q![&z!g!h&]#X#Y&]~'cQz{'i!P!Q)n~'lTOz'iz{'{{;'S'i;'S;=`)c<%lO'i~(OVOz'iz{(e{!P'i!P!Q)i!Q;'S'i;'S;=`)c<%lO'i~(hVOz'iz{'{{!P'i!P!Q(}!Q;'S'i;'S;=`)c<%lO'i~)STQ~Oz'iz{'{{;'S'i;'S;=`)c<%lO'i~)fP;=`<%l'i~)nOQ~~)sSP~OY)nZ;'S)n;'S;=`*P<%lO)n~*SP;=`<%l)n~*[O]~~*aO!U~~*fO!W~",tokenizers:[0],topRules:{Chart:[0,3]},specialized:[{term:5,get:t=>Vve[t]||-1}],tokenPrec:545}),FB=zve.configure({props:[eB({chart:at.keyword,data:at.keyword,colorize:at.keyword,highlight:at.keyword,"area-fill":at.keyword,annotation:at.keyword,range:at.keyword,note:at.keyword,"hide-annotation":at.keyword,"show-annotation":at.keyword,"hide-range":at.keyword,"show-range":at.keyword,"hide-note":at.keyword,"show-note":at.keyword,series:at.keyword,scene:at.keyword,transform:at.keyword,Identifier:at.variableName,String:at.string,Number:at.number,Percentage:at.number,Equals:at.operator,LineComment:at.lineComment,BlockComment:at.blockComment,"{ }":at.brace})]}),Hve=K0.define({parser:FB,languageData:{commentTokens:{line:"//"}}}),Wve=sge(rB);function Uve(){return new Kme(Hve)}function w1(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function V2e(t){const e=FB.parse(t);let n=0,o="";return oB(e,rB,(r,i,s)=>{r>n&&(o+=w1(t.slice(n,r))),o+=`<span class="${s}">${w1(t.slice(r,i))}</span>`,n=i}),n<t.length&&(o+=w1(t.slice(n))),o}const Gve={class:"d-flex flex-column h-100"},qve={key:0,class:"text-danger small mt-1"},Yve=se({__name:"ChartEditDsl",setup(t){const{dsl:e}=yc(),{applyDsl:n}=Jc(),o=bt("editorEl"),r=Fe();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 vn(()=>{const l=Jt.create({doc:e.value,extensions:[jM.of([...Mve,...Ege]),Age(),Uve(),Wve,At.updateListener.of(a),At.theme({"&":{height:"100%",backgroundColor:"var(--bc-tile-bg-elevated)"},".cm-scroller":{overflow:"auto"},".cm-content":{fontFamily:"var(--bs-font-monospace)",paddingBottom:"var(--fst-clearance, 9rem)"},".cm-gutters":{backgroundColor:"var(--bc-tile-bg-elevated)",color:"var(--bs-secondary-color)",borderRight:"1px solid var(--bs-border-color)"}})]});i=new At({state:l,parent:o.value})}),Ke(e,l=>{!i||i.state.doc.toString()===l||(s=!0,i.dispatch({changes:{from:0,to:i.state.doc.length,insert:l}}),s=!1)}),ca(()=>{i==null||i.destroy(),i=void 0}),(l,c)=>(w(),R("div",Gve,[A("div",{ref_key:"editorEl",ref:o,class:"flex-grow-1 overflow-auto"},null,512),p(r)?(w(),R("div",qve,pe(p(r)),1)):oe("",!0)]))}}),jve={key:1,class:"position-absolute",width:"0",height:"0","aria-hidden":"true"},Kve=se({__name:"PreviewChart",setup(t){const e=bt("containerRef");Sx(e);const{containerRef:n}=TO();Ke(e,E=>{n.value=E},{immediate:!0});const{selectAnnotation:o}=pr();function r(E){var B;const T=E.target.closest("g[data-annotation-index]");if(!T)return;E.preventDefault(),(B=window.getSelection())==null||B.removeAllRanges();const O=T.getAttribute("data-annotation-id");if(O){o(O);return}const P=parseInt(T.getAttribute("data-annotation-index")||"",10);isNaN(P)||o(P)}vn(()=>{var E;(E=e.value)==null||E.addEventListener("dblclick",r)}),oa(()=>{var E;(E=e.value)==null||E.removeEventListener("dblclick",r)});const{cvdMode:i}=Tt(BO()),s=bt("cvdDefsRef");Ke([i,s],([E,N])=>{if(N){for(;N.firstChild;)N.removeChild(N.firstChild);E&&N.appendChild(yre(E))}},{immediate:!0});const a=S(()=>{if(i.value)return{filter:`url(#${DT(i.value)})`}}),{layout:l}=dn(),{scenes:c,activeIndex:u,playing:d,setActive:f,nextScene:h,previousScene:m,startPlayback:b,stopPlayback:g}=Sn(),v=Fe(null),y={buttons:nb,"progress-bar":PA,"dot-stepper":DA,"minimal-arrows":EA},x=S(()=>y[l.value.playerType]),_=S(()=>c.value.length+1),C=S(()=>u.value+2),D=S(()=>c.value.length>=1&&l.value.playerType!=="none");function M(E){f(E-2)}let $=null;function L(){const E=e.value;return E?E.querySelector(".bc-frame-footer"):null}return Ke(e,E=>{if($&&($.disconnect(),$=null),!E){v.value=null;return}v.value=L(),$=new MutationObserver(()=>{v.value=L()}),$.observe(E,{childList:!0,subtree:!0})},{immediate:!0}),oa(()=>{$&&($.disconnect(),$=null)}),(E,N)=>(w(),R(Re,null,[A("div",{ref_key:"containerRef",ref:e,class:"w-100 h-100",style:Lt(p(a))},null,4),p(v)&&p(D)?(w(),Q(Oy,{key:0,to:p(v)},[(w(),Q(Rt(p(x)),{total:p(_),current:p(C),playing:p(d),position:p(l).playerPosition,"onUpdate:current":M,onPrevious:p(m),onNext:p(h),onPlay:p(b),onPause:p(g)},null,40,["total","current","playing","position","onPrevious","onNext","onPlay","onPause"]))],8,["to"])):oe("",!0),p(i)?(w(),R("svg",jve,[A("defs",{ref_key:"cvdDefsRef",ref:s},null,512)])):oe("",!0)],64))}}),VB=Symbol("sceneTimeline"),Xve={key:0,class:"floating-scene-timeline"},Zve=se({__name:"FloatingSceneTimeline",setup(t){const e=Kt(VB,null),{isNarrow:n}=Yr();return(o,r)=>p(e)&&!p(n)&&p(e).showTimeline.value?(w(),R("div",Xve,[H(p(Aq),{scenes:p(e).scenes.value,"active-index":p(e).activeIndex.value,playing:p(e).playing.value,floating:"","onUpdate:activeIndex":p(e).onSelect,onAdd:p(e).onAdd,onRemove:p(e).onRemove,onPlay:p(e).onPlay,onPause:p(e).onPause},null,8,["scenes","active-index","playing","onUpdate:activeIndex","onAdd","onRemove","onPlay","onPause"])])):oe("",!0)}}),zB=Be(Zve,[["__scopeId","data-v-05a62bbc"]]),Qve={class:"chart-edit-panel__canvas-frame"},Jve=se({__name:"ChartEditPanel",setup(t){const e=pr(),{viewMode:n,activeTab:o,canvasMode:r,showDimensions:i}=Tt(e),{selectTab:s,setLastNarrowEditTab:a}=e,{mode:l}=xc(),{isNarrow:c}=Yr(),{layout:u}=dn(),{cardClass:d,cardStyle:f}=kx(u,"chart-edit-panel__canvas__card"),{sections:h}=kO(),m=S({get:()=>!!o.value,set:N=>{N||s("")}});Ke(l,N=>{N==="drawer"&&o.value&&(a(o.value),s(""))},{immediate:!0});function b(N){a(N),s(N)}const g=S(()=>h.value.map(N=>({key:N.key,label:N.label,icon:N.icon}))),v=S(()=>({"chart-edit-panel--narrow":c.value})),y=S(()=>({[`chart-edit-panel__canvas--${r.value}`]:r.value!=="blueprint","chart-edit-panel__canvas--dsl":n.value!=="preview","chart-edit-panel__canvas--dimensions":n.value==="preview"&&i.value})),x={type:"Chart Type",text:"Text",style:"Style",layout:"Layout",series:"Series",axes:"Axes",annotate:"Annotate",interactions:"Interactions"},_=S(()=>x[o.value]??"Panel"),C=bt("canvasRef"),D=bt("cardRef"),M=Ne(0),$=Ne(0);function L(){const N=D.value;N&&(M.value=N.offsetLeft,$.value=N.offsetTop)}ps(C,L),ps(D,L);const E=S(()=>({"--grid-offset-x":`${M.value}px`,"--grid-offset-y":`${$.value}px`}));return(N,T)=>{const O=Kve,P=Yve,B=xO,V=yO,z=_x,G=hpe,K=ape,ne=epe,ae=Qhe,he=dhe,ge=rhe,le=Zfe,fe=yfe,we=ide,Z=wx,be=Eg,re=Vue;return w(),R("div",{class:Te(["chart-edit-panel",p(v)])},[A("div",Qve,[A("div",{ref_key:"canvasRef",ref:C,class:Te(["chart-edit-panel__canvas",p(y)]),style:Lt(p(E))},[p(n)==="preview"?(w(),R("div",{key:0,ref_key:"cardRef",ref:D,class:Te(["chart-edit-panel__canvas__card",p(d)]),style:Lt(p(f))},[H(O)],6)):(w(),Q(P,{key:1,class:"chart-edit-panel__canvas__dsl"})),p(n)==="preview"&&p(i)?(w(),Q(B,{key:2,"card-ref":p(D),"canvas-ref":p(C),layout:p(u)},null,8,["card-ref","canvas-ref","layout"])):oe("",!0),H(zB)],6),p(n)==="preview"?(w(),Q(V,{key:0})):oe("",!0)]),H(be,{"drawer-open":p(m),"onUpdate:drawerOpen":T[0]||(T[0]=ve=>Ze(m)?m.value=ve:null),title:p(_),"container-ref":p(C),onClose:T[1]||(T[1]=ve=>p(s)(""))},$i({default:J(()=>[p(o)==="type"?(w(),Q(K,{key:0})):p(o)==="text"?(w(),Q(ne,{key:1})):p(o)==="style"?(w(),Q(ae,{key:2})):p(o)==="series"?(w(),Q(he,{key:3})):p(o)==="axes"?(w(),Q(ge,{key:4})):p(o)==="layout"?(w(),Q(le,{key:5})):p(o)==="annotate"?(w(),Q(fe,{key:6})):p(o)==="interactions"?(w(),Q(we,{key:7})):oe("",!0)]),_:2},[p(l)==="drawer"?{name:"tabs",fn:J(()=>[H(z,{tabs:p(g),"model-value":p(o),sticky:"","onUpdate:modelValue":b},null,8,["tabs","model-value"])]),key:"0"}:void 0,p(l)!=="drawer"?{name:"header",fn:J(()=>[H(G)]),key:"1"}:void 0,p(l)!=="drawer"?{name:"footer",fn:J(()=>[H(Z)]),key:"2"}:void 0]),1032,["drawer-open","title","container-ref"]),p(c)?oe("",!0):(w(),Q(re,{key:0}))],2)}}}),e1e=Be(Jve,[["__scopeId","data-v-5e9f4c38"]]),t1e={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function n1e(t,e){return w(),R("svg",t1e,[...e[0]||(e[0]=[A("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 o1e=Oe({name:"ph-columns",render:n1e}),r1e={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function i1e(t,e){return w(),R("svg",r1e,[...e[0]||(e[0]=[A("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 s1e=Oe({name:"ph-flow-arrow",render:i1e}),a1e={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function l1e(t,e){return w(),R("svg",a1e,[...e[0]||(e[0]=[A("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 c1e=Oe({name:"ph-lightbulb",render:l1e});function HB(){return{sections:[{key:"column",label:"Columns",icon:o1e},{key:"transforms",label:"Transforms",icon:s1e},{key:"parsing",label:"Parsing",icon:vO},{key:"reco",label:"Recommendations",icon:c1e}]}}const u1e=se({__name:"DataSideIconRail",props:{disabledTabs:{default:()=>[]}},setup(t){const e=t,n=pr(),{dataPanelTab:o}=Tt(n),{openDataPanel:r}=n,{mode:i,toggleMode:s}=xc(),{sections:a}=HB(),l=S(()=>a.filter(d=>!e.disabledTabs.includes(d.key)).map(d=>({value:d.key,icon:d.icon,tooltip:d.tooltip??d.label})));function c(d){r(d)}function u(){i.value==="closed"&&r(o.value||"column"),s()}return(d,f)=>{const h=yx;return w(),Q(h,{"active-tab":p(o),items:p(l),onSelect:c,onToggleMode:u},null,8,["active-tab","items"])}}}),d1e={class:"reco-card__preview"},f1e={class:"reco-card__body"},h1e={class:"reco-card__body__title"},p1e={class:"reco-card__body__reason"},m1e=se({__name:"DataRecommendationCard",props:{chartType:{},label:{},fitness:{},reason:{}},emits:["select"],setup(t){const e={[Ve.BarVertical]:Oe(LO),[Ve.BarHorizontal]:Oe(PO),[Ve.BarMulti]:Oe(DO),[Ve.Line]:Oe(EO),[Ve.LineMulti]:Oe(IO),[Ve.Donut]:Oe(NO),[Ve.Pie]:Oe(RO)},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:Te(["reco-card",{"reco-card--best":t.fitness==="best"}]),onClick:a[0]||(a[0]=l=>s.$emit("select",t.chartType))},[A("div",d1e,[p(o)?(w(),Q(Rt(p(o)),{key:0,class:"reco-card__preview__thumb-svg"})):oe("",!0)]),A("div",f1e,[A("div",h1e,[He(pe(t.label)+" ",1),A("span",{class:Te(["reco-card__body__title__badge",p(r)])},pe(p(i)),3)]),A("div",p1e,pe(t.reason),1)])],2))}}),g1e=Be(m1e,[["__scopeId","data-v-0e22d5d1"]]);function v1e(){const{displayRows:t,displayColumnTypes:e}=er(),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(()=>vre(e.value,t.value.length)),dataSummary:n}}const b1e={class:"data-recommendations"},y1e={class:"data-recommendations__summary"},x1e={key:0,class:"text-muted text-center py-3"},w1e=se({__name:"DataRecommendations",setup(t){const{recommendations:e,dataSummary:n}=v1e(),o=dn();function r(i){o.chartType.value=i}return(i,s)=>{const a=g1e;return w(),R("div",b1e,[A("p",y1e," Based on your data: "+pe(p(n)),1),p(e).length===0?(w(),R("div",x1e," Load data to see recommendations ")):oe("",!0),(w(!0),R(Re,null,vt(p(e),l=>(w(),Q(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))])}}}),_1e=Be(w1e,[["__scopeId","data-v-47bbaf64"]]),GS={firstRowIsHeader:!0,delimiter:"auto",decimalSeparator:".",treatEmptyAsNull:!0,trimWhitespace:!0},k1e=Qn("parseOptions",()=>{const t=po({...GS});function e(o,r){t[o]=r}function n(){Object.assign(t,{...GS})}return{...mm(t),setOption:e,reset:n}});function WB(){const t=k1e(),{firstRowIsHeader:e,delimiter:n,decimalSeparator:o,treatEmptyAsNull:r,trimWhitespace:i}=Tt(t);return{firstRowIsHeader:e,delimiter:n,decimalSeparator:o,treatEmptyAsNull:r,trimWhitespace:i,setOption:t.setOption,reset:t.reset}}const S1e={class:"data-parse-settings"},C1e={class:"data-parse-settings__field"},A1e={class:"data-parse-settings__field"},$1e=se({__name:"DataParseSettings",setup(t){const e=WB(),{firstRowIsHeader:n,delimiter:o,decimalSeparator:r,treatEmptyAsNull:i,trimWhitespace:s}=Tt(e),{setOption:a}=e,{sourceFormat:l}=er(),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",S1e,[H(p(Xs),{modelValue:p(u),"onUpdate:modelValue":y[0]||(y[0]=x=>Ze(u)?u.value=x:null),switch:""},{default:J(()=>[...y[5]||(y[5]=[He(" First row is header ",-1)])]),_:1},8,["modelValue"]),A("div",C1e,[y[6]||(y[6]=A("div",{class:"data-parse-settings__field__label"}," Delimiter ",-1)),H(p(Rn),{modelValue:p(d),"onUpdate:modelValue":y[1]||(y[1]=x=>Ze(d)?d.value=x:null),label:"",options:b,disabled:p(c),block:""},null,8,["modelValue","disabled"])]),A("div",A1e,[y[7]||(y[7]=A("div",{class:"data-parse-settings__field__label"}," Decimal Separator ",-1)),H(p(Rn),{modelValue:p(f),"onUpdate:modelValue":y[2]||(y[2]=x=>Ze(f)?f.value=x:null),label:"",options:g,block:""},null,8,["modelValue"])]),H(p(Xs),{modelValue:p(h),"onUpdate:modelValue":y[3]||(y[3]=x=>Ze(h)?h.value=x:null),switch:""},{default:J(()=>[...y[8]||(y[8]=[He(" Treat empty as null ",-1)])]),_:1},8,["modelValue"]),H(p(Xs),{modelValue:p(m),"onUpdate:modelValue":y[4]||(y[4]=x=>Ze(m)?m.value=x:null),switch:""},{default:J(()=>[...y[9]||(y[9]=[He(" Trim whitespace ",-1)])]),_:1},8,["modelValue"])]))}}),T1e=Be($1e,[["__scopeId","data-v-872473d2"]]),O1e={class:"output-block"},M1e={class:"output-block__meta"},B1e=se({__name:"DataTransformOutputBlock",props:{columns:{},rows:{}},setup(t){return(e,n)=>(w(),R("div",O1e,[n[0]||(n[0]=A("span",{class:"output-block__icon"},[A("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",width:"14",height:"14"},[A("path",{d:"M20 6L9 17l-5-5"})])],-1)),n[1]||(n[1]=A("span",null,"Output",-1)),A("span",M1e,pe(t.columns)+" cols · "+pe(t.rows)+" rows",1)]))}}),L1e=Be(B1e,[["__scopeId","data-v-b1080d62"]]),P1e={class:"add-wrap"},D1e={key:0,class:"add-wrap__dropdown"},E1e=["disabled","onClick"],I1e={class:"add-wrap__dropdown__item__text"},N1e={class:"add-wrap__dropdown__item__text__name"},R1e={class:"add-wrap__dropdown__item__text__desc"},F1e=se({__name:"DataTransformAddButton",emits:["add"],setup(t,{emit:e}){const n=e,o=Ne(!1),r=[{value:tt.Sort,label:"Sort",desc:"Reorder rows by column values",disabled:!1},{value:tt.Filter,label:"Filter",desc:"Keep or exclude rows by condition",disabled:!1},{value:tt.HideColumns,label:"Hide Columns",desc:"Remove columns from output",disabled:!1},{value:tt.Transpose,label:"Transpose",desc:"Swap rows and columns",disabled:!1},{value:tt.Parse,label:"Parse",desc:"Transform column values",disabled:!1},{value:tt.Rename,label:"Rename Column",desc:"Change a column name",disabled:!1},{value:tt.GroupBy,label:"Group By",desc:"Aggregate rows by column values",disabled:!1},{value:tt.Computed,label:"Computed Column",desc:"Derive new column (coming soon)",disabled:!0}];function i(l){return{[tt.Sort]:"add-wrap__dropdown__item__icon--sort",[tt.Filter]:"add-wrap__dropdown__item__icon--filter",[tt.HideColumns]:"add-wrap__dropdown__item__icon--hide-columns",[tt.Transpose]:"add-wrap__dropdown__item__icon--transpose",[tt.Parse]:"add-wrap__dropdown__item__icon--parse",[tt.Rename]:"add-wrap__dropdown__item__icon--rename",[tt.GroupBy]:"add-wrap__dropdown__item__icon--group",[tt.Computed]:"add-wrap__dropdown__item__icon--computed"}[l]??""}function s(l){return{[tt.Sort]:"S",[tt.Filter]:"F",[tt.HideColumns]:"H",[tt.Transpose]:"T",[tt.Parse]:"P",[tt.Rename]:"R",[tt.GroupBy]:"G",[tt.Computed]:"C"}[l]??"?"}function a(l){n("add",l),o.value=!1}return(l,c)=>(w(),R("div",P1e,[H(p(Rl),{label:"Add",onClick:c[0]||(c[0]=u=>o.value=!p(o))}),p(o)?(w(),R("div",D1e,[(w(),R(Re,null,vt(r,u=>A("button",{key:u.value,class:"add-wrap__dropdown__item",disabled:u.disabled,onClick:d=>a(u.value)},[A("span",{class:Te(["add-wrap__dropdown__item__icon",i(u.value)])},pe(s(u.value)),3),A("div",I1e,[A("div",N1e,pe(u.label),1),A("div",R1e,pe(u.desc),1)])],8,E1e)),64))])):oe("",!0)]))}}),V1e=Be(F1e,[["__scopeId","data-v-ac055819"]]),z1e={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function H1e(t,e){return w(),R("svg",z1e,[...e[0]||(e[0]=[A("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 W1e=Oe({name:"ph-sort-ascending",render:H1e}),U1e={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function G1e(t,e){return w(),R("svg",U1e,[...e[0]||(e[0]=[A("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 q1e=Oe({name:"ph-funnel",render:G1e}),Y1e={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function j1e(t,e){return w(),R("svg",Y1e,[...e[0]||(e[0]=[A("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 UB=Oe({name:"ph-arrows-clockwise",render:j1e}),K1e={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function X1e(t,e){return w(),R("svg",K1e,[...e[0]||(e[0]=[A("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 Z1e=Oe({name:"ph-wrench",render:X1e}),Q1e={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function J1e(t,e){return w(),R("svg",Q1e,[...e[0]||(e[0]=[A("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 ebe=Oe({name:"ph-stack",render:J1e}),tbe={[tt.Sort]:{iconClass:"step-card__body__icon--sort",iconComponent:W1e,fallback:"S",label:"Sort"},[tt.Filter]:{iconClass:"step-card__body__icon--filter",iconComponent:q1e,fallback:"F",label:"Filter"},[tt.HideColumns]:{iconClass:"step-card__body__icon--hide-columns",iconComponent:Bf,fallback:"H",label:"Hide Columns"},[tt.Transpose]:{iconClass:"step-card__body__icon--transpose",iconComponent:UB,fallback:"T",label:"Transpose"},[tt.Parse]:{iconClass:"step-card__body__icon--parse",iconComponent:Z1e,fallback:"P",label:"Parse"},[tt.Rename]:{iconClass:"step-card__body__icon--rename",iconComponent:bx,fallback:"R",label:"Rename"},[tt.GroupBy]:{iconClass:"step-card__body__icon--group",iconComponent:ebe,fallback:"G",label:"Group By"},[tt.Computed]:{iconClass:"step-card__body__icon--computed",fallback:"C",label:"Computed"}},nbe={class:"step-card__number"},obe={class:"step-card__body"},rbe={key:1},ibe={class:"step-card__body__text"},sbe={class:"step-card__body__text__name"},abe={class:"step-card__actions"},lbe=se({__name:"DataTransformStepCard",props:{step:{},index:{},active:{type:Boolean},error:{}},emits:["select","delete"],setup(t){const e=t,n=S(()=>tbe[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===tt.Sort&&l.config.column)return`${l.config.column} ${l.config.direction??en.Ascending}`;if(l.type===tt.Filter&&l.config.column)return`${l.config.column} ${l.config.condition??wo.Equals} ${l.config.value??""}`;if(l.type===tt.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===tt.Transpose)return"Swap rows ↔ columns";if(l.type===tt.Parse&&l.config.column&&l.config.operation)return`${l.config.column} → ${l.config.operation}`;if(l.type===tt.Rename&&l.config.column&&l.config.newName)return`${l.config.column} → ${l.config.newName}`;if(l.type===tt.GroupBy&&l.config.groupColumns&&l.config.aggregates){const c=l.config.groupColumns.split(",").map(d=>d.trim()).filter(Boolean).join(", "),u=l.config.aggregates.split(",").map(d=>{const f=d.lastIndexOf(":");return f<0?d.trim():`${d.slice(f+1).trim()}(${d.slice(0,f).trim()})`}).join(", ");return`Group by ${c} — ${u}`}return"Configure..."});return(l,c)=>(w(),R("div",{class:Te(["step-card",{"step-card--active":t.active,"step-card--error":t.error}]),onClick:c[2]||(c[2]=u=>l.$emit("select"))},[A("div",nbe,pe(t.index+1),1),A("div",obe,[A("span",{class:Te(["step-card__body__icon",p(o)])},[p(r)?(w(),Q(Rt(p(r)),{key:0})):(w(),R("span",rbe,pe(p(i)),1))],2),A("div",ibe,[A("div",sbe,pe(p(s)),1),A("div",{class:Te(["step-card__body__text__desc",{"step-card__body__text__desc--error":t.error}])},pe(t.error||p(a)),3)])]),A("div",abe,[A("button",{class:"step-card__actions__btn","aria-label":"Remove step",onClick:c[0]||(c[0]=pn(u=>l.$emit("delete"),["stop"]))},[...c[3]||(c[3]=[A("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[A("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]=pn(()=>{},["stop"]))},[Ce(l.$slots,"default",{},void 0,!0)])):oe("",!0)],2))}}),cbe=Be(lbe,[["__scopeId","data-v-4ba65e45"]]),ube={class:"group-by-step"},dbe={class:"group-by-step__field"},fbe={class:"group-by-step__field__columns"},hbe=["checked","onChange"],pbe={key:0,class:"group-by-step__field"},mbe={class:"group-by-step__field__agg-list"},gbe={class:"group-by-step__field__agg-list__row"},vbe={class:"group-by-step__field__agg-list__row__check"},bbe=["checked"],ybe={class:"group-by-step__field__agg-list__row__check"},xbe=["checked","onChange"],wbe=["value","onChange"],_be=se({__name:"DataTransformStepGroupBy",props:{step:{},columns:{},columnTypes:{}},setup(t){const e=t,{updateStep:n}=Rr(),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",ube,[A("div",dbe,[g[0]||(g[0]=A("label",{class:"group-by-step__field__label"},"Group by",-1)),A("div",fbe,[(w(!0),R(Re,null,vt(t.columns,v=>(w(),R("label",{key:v,class:"group-by-step__field__columns__column"},[A("input",{type:"checkbox",checked:p(o).includes(v),onChange:y=>d(v)},null,40,hbe),He(" "+pe(v),1)]))),128))])]),p(r).length>0||p(o).length>0?(w(),R("div",pbe,[g[4]||(g[4]=A("label",{class:"group-by-step__field__label"},"Aggregates",-1)),A("div",mbe,[A("div",gbe,[A("label",vbe,[A("input",{type:"checkbox",checked:p(s),onChange:f},null,40,bbe),g[1]||(g[1]=He(" Row count ",-1))]),g[2]||(g[2]=A("span",{class:"group-by-step__field__agg-list__row__fn-label"},"count",-1))]),(w(!0),R(Re,null,vt(p(r),v=>(w(),R("div",{key:v,class:"group-by-step__field__agg-list__row"},[A("label",ybe,[A("input",{type:"checkbox",checked:a(v),onChange:y=>h(v)},null,40,xbe),He(" "+pe(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]=[A("option",{value:"sum"}," Sum ",-1),A("option",{value:"avg"}," Average ",-1),A("option",{value:"min"}," Min ",-1),A("option",{value:"max"}," Max ",-1)])],40,wbe)):oe("",!0)]))),128))])])):oe("",!0)]))}}),kbe=Be(_be,[["__scopeId","data-v-c53de076"]]),Sbe={class:"data-transform-step-rename"},Cbe=se({__name:"DataTransformStepRename",props:{step:{},columns:{}},setup(t){const e=t,{updateStep:n}=Rr(),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",Sbe,[H(p(Rn),{"model-value":t.step.config.column??"",label:"Column",placeholder:"Select a column",options:p(o),block:"","onUpdate:modelValue":s[0]||(s[0]=a=>r("column",a))},null,8,["model-value","options"]),H(p(zm),{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"])]))}}),Abe=Be(Cbe,[["__scopeId","data-v-5f4cb34e"]]),$be={class:"data-transform-step-parse"},Tbe=se({__name:"DataTransformStepParse",props:{step:{},columns:{}},setup(t){var b;const e=t,{updateStep:n}=Rr(),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(()=>kp.find(g=>g.id===e.step.config.operation)),s=Ne(((b=i.value)==null?void 0:b.category)??"type");Ke(()=>e.step.config.operation,g=>{if(g){const v=kp.find(y=>y.id===g);v&&(s.value=v.category)}});const a=S(()=>kp.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",$be,[H(p(Rn),{"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(Rn),{"model-value":p(s),label:"Category",options:r,block:"","onUpdate:modelValue":h},null,8,["model-value"]),H(p(Rn),{"model-value":t.step.config.operation??"",label:"Operation",placeholder:"Select an operation",options:p(a),block:"","onUpdate:modelValue":v[1]||(v[1]=y=>m("operation",y))},null,8,["model-value","options"]),p(l).length>0?(w(!0),R(Re,{key:0},vt(p(l),y=>(w(),Q(p(zm),{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)):oe("",!0)]))}}),Obe=Be(Tbe,[["__scopeId","data-v-37e3f025"]]),Mbe={class:"data-transform-step-hide-columns"},Bbe={class:"data-transform-step-hide-columns__field"},Lbe={class:"data-transform-step-hide-columns__field__columns"},Pbe=["checked","onChange"],Dbe=se({__name:"DataTransformStepHideColumns",props:{step:{},columns:{}},setup(t){const e=t,{updateStep:n}=Rr(),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",Mbe,[A("div",Bbe,[s[0]||(s[0]=A("label",{class:"data-transform-step-hide-columns__field__label"},"Hide columns",-1)),A("div",Lbe,[(w(!0),R(Re,null,vt(t.columns,a=>(w(),R("label",{key:a,class:"data-transform-step-hide-columns__field__columns__column"},[A("input",{type:"checkbox",checked:p(o).includes(a),onChange:l=>r(a)},null,40,Pbe),He(" "+pe(a),1)]))),128))])])]))}}),Ebe=Be(Dbe,[["__scopeId","data-v-a74ff0f2"]]),Ibe={class:"data-transform-step-filter"},Nbe=se({__name:"DataTransformStepFilter",props:{step:{},columns:{}},setup(t){const e=t,{updateStep:n}=Rr(),o=S(()=>e.columns.map(s=>({value:s,label:s}))),r=[{value:wo.Equals,label:"Equals"},{value:wo.NotEquals,label:"Not equals"},{value:wo.Contains,label:"Contains"},{value:wo.GreaterThan,label:"Greater than"},{value:wo.LessThan,label:"Less than"}];function i(s,a){n(e.step.id,{...e.step.config,[s]:a})}return(s,a)=>(w(),R("div",Ibe,[H(p(Rn),{"model-value":t.step.config.column??"",label:"Column",placeholder:"Select a column",options:p(o),block:"","onUpdate:modelValue":a[0]||(a[0]=l=>i("column",l))},null,8,["model-value","options"]),H(p(Rn),{"model-value":t.step.config.condition??p(wo).Equals,label:"Condition",options:r,block:"","onUpdate:modelValue":a[1]||(a[1]=l=>i("condition",l))},null,8,["model-value"]),H(p(zm),{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"])]))}}),Rbe=Be(Nbe,[["__scopeId","data-v-65704d71"]]),Fbe={class:"data-transform-step-sort"},Vbe={class:"data-transform-step-sort__field"},zbe={class:"data-transform-step-sort__field__columns"},Hbe=["checked","onChange"],Wbe=se({__name:"DataTransformStepSort",props:{step:{},columns:{},columnTypes:{}},setup(t){const e=t,{updateStep:n}=Rr(),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:en.Ascending,text:"Ascending"},{value:en.Descending,text:"Descending"}];function l(c,u){n(e.step.id,{...e.step.config,[c]:u})}return(c,u)=>(w(),R("div",Fbe,[A("div",Vbe,[u[2]||(u[2]=A("label",{class:"data-transform-step-sort__field__label"},"Sort by",-1)),A("div",zbe,[(w(!0),R(Re,null,vt(t.columns,d=>(w(),R("label",{key:d,class:"data-transform-step-sort__field__columns__column"},[A("input",{type:"checkbox",checked:p(o).includes(d),onChange:f=>i(d)},null,40,Hbe),He(" "+pe(d),1)]))),128))])]),p(o).length>1&&p(r)?(w(),Q(p($n),{key:0,"model-value":t.step.config.operation??"",label:"Operation",options:s,block:"","onUpdate:modelValue":u[0]||(u[0]=d=>l("operation",d))},null,8,["model-value"])):oe("",!0),H(p($n),{"model-value":t.step.config.direction??p(en).Ascending,label:"Direction",options:a,block:"","onUpdate:modelValue":u[1]||(u[1]=d=>l("direction",d))},null,8,["model-value"])]))}}),Ube=Be(Wbe,[["__scopeId","data-v-73ae8834"]]),Gbe={},qbe={class:"pipeline-connector"};function Ybe(t,e){return w(),R("div",qbe)}const jbe=Be(Gbe,[["render",Ybe],["__scopeId","data-v-a3406500"]]),Kbe={class:"source-block"},Xbe={class:"source-block__meta"},Zbe=se({__name:"DataTransformSourceBlock",props:{columns:{},rows:{},label:{default:"Raw Data"}},setup(t){return(e,n)=>(w(),R("div",Kbe,[n[0]||(n[0]=A("span",{class:"source-block__icon"},[A("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",width:"14",height:"14"},[A("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),A("path",{d:"M3 9h18M9 21V9"})])],-1)),A("span",null,pe(t.label),1),A("span",Xbe,pe(t.columns)+" cols · "+pe(t.rows)+" rows",1)]))}}),Qbe=Be(Zbe,[["__scopeId","data-v-6b491dca"]]),Jbe={class:"pipeline","data-testid":"transform-pipeline"},eye={key:6,class:"pipeline__config-info"},tye={key:7,class:"text-muted text-center py-3"},nye=se({__name:"DataTransformPipeline",setup(t){const{columns:e,rows:n,columnTypes:o}=er(),{steps:r,addStep:i,removeStep:s,applyTransforms:a,getColumnsAtStep:l,validateStep:c}=Rr(),{activeScene:u,activeIndex:d,scenes:f}=Sn(),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=Ne(""),b=Fe(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 T=0;T<r.value.length;T++){const O=r.value[T];if(b.value.has(O.id)){N[O.id]=null;continue}const P=l(T,e.value,n.value,o.value);N[O.id]=c(O,P.columns,P.columnTypes)}return N}),C=S(()=>a(e.value,n.value,o.value)),D=S(()=>C.value.columns.length),M=S(()=>C.value.rows.length);function $(N){const T=m.value;T&&T!==N&&b.value.delete(T),m.value=N}function L(N){const T=i(N);b.value.add(T),$(T)}function E(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,T)=>{const O=Qbe,P=jbe,B=Ube,V=Rbe,z=Ebe,G=Obe,K=Abe,ne=kbe,ae=cbe,he=V1e,ge=L1e;return w(),R("div",Jbe,[H(O,{columns:p(e).length,rows:p(n).length,label:p(h)},null,8,["columns","rows","label"]),(w(!0),R(Re,null,vt(p(r),(le,fe)=>(w(),R(Re,{key:le.id},[H(P),H(ae,{step:le,index:fe,active:p(m)===le.id,error:p(_)[le.id],onSelect:we=>$(le.id),onDelete:we=>E(le.id)},{default:J(()=>[le.type===p(tt).Sort?(w(),Q(B,{key:0,step:le,columns:p(y),"column-types":p(x)},null,8,["step","columns","column-types"])):le.type===p(tt).Filter?(w(),Q(V,{key:1,step:le,columns:p(y)},null,8,["step","columns"])):le.type===p(tt).HideColumns?(w(),Q(z,{key:2,step:le,columns:p(y)},null,8,["step","columns"])):le.type===p(tt).Parse?(w(),Q(G,{key:3,step:le,columns:p(y)},null,8,["step","columns"])):le.type===p(tt).Rename?(w(),Q(K,{key:4,step:le,columns:p(y)},null,8,["step","columns"])):le.type===p(tt).GroupBy?(w(),Q(ne,{key:5,step:le,columns:p(y),"column-types":p(x)},null,8,["step","columns","column-types"])):le.type===p(tt).Transpose?(w(),R("div",eye," Transpose swaps rows and columns. The first column values become headers and column headers become the first column. ")):(w(),R("div",tye," Coming soon "))]),_:2},1032,["step","index","active","error","onSelect","onDelete"])],64))),128)),H(P),H(he,{onAdd:L}),H(P),H(ge,{columns:p(D),rows:p(M)},null,8,["columns","rows"])])}}}),oye=Be(nye,[["__scopeId","data-v-b653c7ed"]]),rye=[0,.30103,.17609,.12494,.09691,.07918,.06695,.05799,.05115,.04576],GB=10,iye=.1;function sye(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 aye(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>=GB}function qB(t,e,n){const o=[];let r=!1;for(let i=0;i<t.length;i++){if(!aye(n[i],e,i))continue;const s=new Array(10).fill(0);let a=0;for(const c of e){const u=sye(c[i]);u!==null&&(s[u]++,a++)}if(a<GB)continue;r=!0;let l=!1;for(let c=1;c<=9;c++){const u=s[c]/a;if(Math.abs(u-rye[c])>iye){l=!0;break}}l&&o.push(t[i])}return{pass:o.length===0,suspicious:o,eligible:r}}const lye={class:"data-column-settings"},cye={class:"data-column-settings__field"},uye={class:"data-column-settings__section"},dye={class:"data-column-settings__section__detections"},fye={class:"data-column-settings__section__detections__item data-column-settings__section__detections__item--success"},hye={class:"data-column-settings__section__detections__item data-column-settings__section__detections__item--info"},pye={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},mye={key:0,d:"M20 6L9 17l-5-5"},gye={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"},vye={key:1,class:"data-column-settings__picker"},bye=se({__name:"DataColumnSettings",setup(t){const e=pr(),{selectedColumnIndex:n}=Tt(e),{selectColumn:o}=e,{columns:r,rows:i,columnTypes:s,setColumnType:a}=er(),l=Ne("string"),c=[{value:"string",label:"String"},{value:"number",label:"Number"},{value:"date",label:"Date"}];Ke(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=qB([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",lye,[p(n)>=0&&p(n)<p(r).length?(w(),R(Re,{key:0},[A("div",cye,[y[1]||(y[1]=A("div",{class:"data-column-settings__field__label"}," Type ",-1)),H(p(Rn),{modelValue:p(l),"onUpdate:modelValue":[y[0]||(y[0]=x=>Ze(l)?l.value=x:null),u],label:"",options:c,block:""},null,8,["modelValue"])]),y[5]||(y[5]=A("hr",{class:"data-column-settings__divider"},null,-1)),A("div",uye,[y[4]||(y[4]=A("div",{class:"data-column-settings__section__title"}," Detections ",-1)),A("div",dye,[A("span",fye,[y[2]||(y[2]=A("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[A("path",{d:"M20 6L9 17l-5-5"})],-1)),He(" "+pe(p(m)),1)]),A("span",hye,[y[3]||(y[3]=A("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[A("circle",{cx:"12",cy:"12",r:"10"}),A("path",{d:"M12 16v-4M12 8h.01"})],-1)),He(" "+pe(p(b)),1)]),p(g)?(w(),R("span",{key:0,class:Te(["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",pye,[p(g).pass?(w(),R("path",mye)):(w(),R("path",gye))])),He(" "+pe(p(g).label),1)],2)):oe("",!0)])])],64)):(w(),R("div",vye,[y[6]||(y[6]=A("div",{class:"data-column-settings__picker__label"}," Column ",-1)),H(p(Rn),{"model-value":"",label:"",options:p(d),block:"",placeholder:"Select a column…","onUpdate:modelValue":f},null,8,["options"])]))]))}}),yye=Be(bye,[["__scopeId","data-v-fadb97cc"]]),xye={key:0,class:"data-check-empty"},wye={key:1,class:"data-check-table"},_ye={class:"data-check-table__col-header__name"},kye={class:"data-check-table__col-header__type"},Sye=se({__name:"DataCheckTable",setup(t){const e=pr(),{selectedColumnIndex:n}=Tt(e),{selectColumn:o}=e,{displayColumns:r,displayRows:i,displayColumnTypes:s}=er(),a=S(()=>i.value.length===0);return(l,c)=>p(a)?(w(),R("div",xye,[H(p(h2),{class:"data-check-empty__icon"}),c[0]||(c[0]=A("p",null,"No rows match your filters",-1))])):(w(),R("div",wye,[H(p(VI),{hover:"",bordered:""},{default:J(()=>[H(p(qI),null,{default:J(()=>[H(p(z_),null,{default:J(()=>[H(p(V_),{class:"data-check-table__row-num"},{default:J(()=>[...c[1]||(c[1]=[He(" # ",-1)])]),_:1}),(w(!0),R(Re,null,vt(p(r),(u,d)=>(w(),Q(p(V_),{key:d,class:Te(["data-check-table__col-header",{"data-check-table__col--selected":d===p(n)}]),onClick:f=>p(o)(d)},{default:J(()=>[A("div",_ye,pe(u),1),A("div",kye,pe(p(s)[d]??"string"),1)]),_:2},1032,["class","onClick"]))),128))]),_:1})]),_:1}),H(p(zI),null,{default:J(()=>[(w(!0),R(Re,null,vt(p(i),(u,d)=>(w(),Q(p(z_),{key:d},{default:J(()=>[H(p(F_),{class:"data-check-table__row-num"},{default:J(()=>[He(pe(d+1),1)]),_:2},1024),(w(!0),R(Re,null,vt(u,(f,h)=>(w(),Q(p(F_),{key:h,class:Te({"data-check-table__col--selected":h===p(n),"data-check-table__cell--numeric":p(s)[h]==="number"})},{default:J(()=>[He(pe(f),1)]),_:2},1032,["class"]))),128))]),_:2},1024))),128))]),_:1})]),_:1})]))}}),Cye=Be(Sye,[["__scopeId","data-v-670500db"]]),Aye={class:"data-insight-badges"},$ye={class:"data-insight-badge data-insight-badge--shape"},Tye={class:"data-insight-badge__icon"},Oye={class:"data-insight-badge__icon"},Mye=se({__name:"DataInsightBadges",props:{columns:{},rows:{},columnTypes:{}},setup(t){const e=t,n=bt("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=qB(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",Aye,[A("span",$ye,pe(t.columns.length)+" cols · "+pe(t.rows.length)+" rows ",1),A("span",{class:Te(["data-insight-badge",p(s)])},[A("span",Tye,pe(p(r)),1),He(" "+pe(p(i)),1)],2),p(a)?(w(),R("span",{key:0,ref_key:"benfordBadgeRef",ref:n,class:Te(["data-insight-badge",p(c)])},[A("span",Oye,pe(p(l)),1),f[0]||(f[0]=He(" Benford's law ",-1)),H(p(ff),{"teleport-to":"body",target:p(n),title:p(u),placement:"top"},null,8,["target","title"])],2)):oe("",!0)]))}}),Bye=Be(Mye,[["__scopeId","data-v-d0fa5a33"]]),Lye={class:"data-structure-panel__main__pills-bar"},Pye={key:0,class:"data-structure-panel__main__scene-banner"},Dye=se({__name:"DataStructurePanel",setup(t){const{columns:e,rows:n,columnTypes:o}=er(),r=pr(),{dataPanelOpen:i,dataPanelTab:s}=Tt(r),{openDataPanel:a,closeDataPanel:l,setDataView:c,setLastNarrowDataTab:u}=r,{mode:d}=xc(),{activeScene:f,activeIndex:h,scenes:m}=Sn(),b=S(()=>f.value!==null);Ke(d,P=>{P==="drawer"&&s.value&&(u(s.value),l())},{immediate:!0});const g=S(()=>HT(m.value,h.value)),v=S(()=>{const P=g.value;if(P===h.value)return"Custom data on this scene.";if(P>=0){const B=m.value[P];return`Data inherited from ${(B==null?void 0:B.name)||`Scene ${P+1}`}.`}return"Scene override active."}),y=S(()=>{const P=g.value;return P===h.value?"This scene uses its own data, independent of the base dataset.":P>=0?"Replace data to set different data for this scene.":"The table below shows the base data. Replace data to set custom data for this scene."});function x(){c("upload")}function _(P){u(P),a(P)}const{isNarrow:C}=Yr(),D=bt("mainRef"),{sections:M}=HB(),$=S(()=>b.value?["parsing"]:[]),L=S(()=>b.value?M.filter(P=>P.key!=="parsing"):M),E=S({get:()=>!!s.value,set:P=>{P||l()}}),N={column:"Column Settings",transforms:"Transforms",parsing:"Parsing",reco:"Recommendations"},T=S(()=>N[s.value]??"Panel"),O=S(()=>({"data-structure-panel--narrow":C.value}));return(P,B)=>{const V=Bye,z=Cye,G=_x,K=yye,ne=oye,ae=T1e,he=_1e,ge=wx,le=Eg,fe=u1e;return w(),R("div",{class:Te(["data-structure-panel",p(O)])},[A("div",{ref_key:"mainRef",ref:D,class:"data-structure-panel__main"},[A("div",Lye,[p(b)?(w(),R("div",Pye,[A("strong",null,pe(p(v)),1),He(" "+pe(p(y)),1)])):(w(),Q(V,{key:1,columns:p(e),rows:p(n),"column-types":p(o)},null,8,["columns","rows","column-types"])),H(p(zn),{"icon-left":p(UB),label:"Replace data",variant:"outline-primary",size:"sm",onClick:x},null,8,["icon-left"])]),H(z),H(zB)],512),p(i)?(w(),Q(le,{key:0,"drawer-open":p(E),"onUpdate:drawerOpen":B[0]||(B[0]=we=>Ze(E)?E.value=we:null),title:p(T),"container-ref":p(D),onClose:p(l)},$i({default:J(()=>[p(s)==="column"?(w(),Q(K,{key:0})):p(s)==="transforms"?(w(),Q(ne,{key:1})):p(s)==="parsing"?(w(),Q(ae,{key:2})):p(s)==="reco"?(w(),Q(he,{key:3})):oe("",!0)]),_:2},[p(d)==="drawer"?{name:"tabs",fn:J(()=>[H(G,{tabs:p(L),"model-value":p(s),sticky:"","onUpdate:modelValue":_},null,8,["tabs","model-value"])]),key:"0"}:void 0,p(d)!=="drawer"?{name:"footer",fn:J(()=>[H(ge)]),key:"1"}:void 0]),1032,["drawer-open","title","container-ref","onClose"])):oe("",!0),p(C)?oe("",!0):(w(),Q(fe,{key:1,"disabled-tabs":p($)},null,8,["disabled-tabs"]))],2)}}}),Eye=Be(Dye,[["__scopeId","data-v-3f93b45b"]]),Iye={class:"samples-grid"},Nye=["onClick","onKeydown"],Rye={class:"sample-card__thumb"},Fye=["src","alt"],Vye={class:"sample-card__info"},zye={class:"sample-card__info__name"},Hye={class:"sample-card__info__meta"},Wye=se({__name:"DataUploadSamples",emits:["select"],setup(t){const e={[Ve.BarVertical]:"Columns",[Ve.BarHorizontal]:"Bars",[Ve.BarMulti]:"Grouped Columns",[Ve.Line]:"Line",[Ve.LineMulti]:"Lines",[Ve.Donut]:"Donut",[Ve.Pie]:"Pie",[Ve.Area]:"Area",[Ve.AreaStacked]:"Stacked Area",[Ve.ColumnStacked]:"Stacked Columns",[Ve.BarStacked]:"Stacked Bars",[Ve.BarSplit]:"Split Bars",[Ve.BarGrouped]:"Grouped Bars"};function n(i){const s=i.split(`
|
|
927
|
+
`).filter(a=>a.trim().length>0);return Math.max(0,s.length-1)}const o=po(new Map),r=S(()=>dk.map(i=>({...i,typeLabel:e[i.chartType]??i.chartType,rowCount:n(i.tsvData),thumbSrc:o.get(i.id)})));return vn(()=>{for(const i of dk)if(i.dsl){const s=hx(i.dsl);s&&o.set(i.id,or(s))}}),(i,s)=>(w(),R("div",Iye,[(w(!0),R(Re,null,vt(p(r),a=>(w(),R("div",{key:a.id,class:"sample-card",role:"button",tabindex:"0",onClick:l=>i.$emit("select",a),onKeydown:ar(l=>i.$emit("select",a),["enter"])},[A("div",Rye,[a.thumbSrc?(w(),R("img",{key:0,class:"sample-card__thumb__img",src:a.thumbSrc,alt:a.title},null,8,Fye)):oe("",!0)]),A("div",Vye,[A("div",zye,pe(a.title),1),A("div",Hye,[He(pe(a.typeLabel)+" ",1),s[0]||(s[0]=A("span",{class:"sample-card__info__meta__sep"},"·",-1)),He(" "+pe(a.rowCount)+" rows ",1)])])],40,Nye))),128))]))}}),Uye=Be(Wye,[["__scopeId","data-v-23920b61"]]),Gye=se({__name:"DataUploadFileDrop",emits:["loaded","bpc","dragState"],setup(t,{emit:e}){const n=e,o=Fe(null),r=Ne(!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:Te(["file-drop",{"file-drop--active":p(r)}]),onDragover:pn(s,["prevent"]),onDragleave:pn(a,["prevent"]),onDrop:pn(u,["prevent"]),onClick:h[1]||(h[1]=m=>{var b;return(b=p(o))==null?void 0:b.click()})},[h[2]||(h[2]=T7('<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)),A("button",{class:"file-drop__btn",onClick:h[0]||(h[0]=pn(m=>{var b;return(b=p(o))==null?void 0:b.click()},["stop"]))}," Browse files "),h[3]||(h[3]=A("div",{class:"file-drop__formats"},[A("span",{class:"file-drop__formats__tag"},".csv"),A("span",{class:"file-drop__formats__tag"},".tsv"),A("span",{class:"file-drop__formats__tag"},".bpc")],-1)),A("input",{ref_key:"fileInput",ref:o,type:"file",accept:".csv,.tsv,.txt,.bpc",class:"file-drop__input",onChange:d},null,544)],34))}}),qye=Be(Gye,[["__scopeId","data-v-f6ebbbc1"]]),Yye={class:"upload-card"},jye={class:"input-card__tabs"},Kye=["onClick"],Xye={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Zye={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Qye={key:2,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Jye={key:1,class:"upload-card__paste"},e2e={class:"upload-card__paste__wrap"},t2e={key:0,class:"upload-card__paste__wrap__placeholder"},n2e={class:"upload-card__paste__footer"},o2e={class:"upload-card__paste__footer__hint"},r2e=["disabled"],i2e=se({__name:"DataUploadCard",emits:["loaded","bpc","sample","cancel"],setup(t){const e=g2("v").keyLabel.split(" "),{rawInput:n,sourceFormat:o,columns:r,rows:i,displayColumns:s,displayRows:a}=er(),{activeIndex:l,scenes:c}=Sn();function u(){if(l.value<0)return!1;const y=Ka(c.value,l.value);return!!(y!=null&&y.data)}function d(){return u()?xk(s.value,a.value):(o==null?void 0:o.value)==="bpc"&&r.value.length>0?xk(r.value,i.value):n.value}const f=Ne("paste"),h=Ne(d()),m=bt("pasteArea"),b=Ne(!1);function g(y){var _;const x=(_=y.clipboardData)==null?void 0:_.getData("text/plain");x&&(y.preventDefault(),h.value=x,kn(()=>{m.value&&m.value.focus()}))}const v=[{value:"file",text:"File"},{value:"paste",text:"Paste"},{value:"samples",text:"Samples"}];return(y,x)=>{const _=qye,C=Uye;return w(),R("div",Yye,[x[12]||(x[12]=A("h1",{class:"upload-card__title"}," Add your data ",-1)),x[13]||(x[13]=A("p",{class:"upload-card__subtitle"}," Drop a file, paste from a spreadsheet, or pick a sample dataset ",-1)),p(r).length>0?(w(),R("button",{key:0,class:"upload-card__back",onClick:x[0]||(x[0]=D=>y.$emit("cancel"))}," ← Back to table ")):oe("",!0),A("div",{class:Te(["input-card",{"input-card--drag-over":p(b)}])},[A("div",jye,[(w(),R(Re,null,vt(v,D=>A("button",{key:D.value,class:Te(["input-card__tabs__tab",{"input-card__tabs__tab--active":p(f)===D.value}]),onClick:M=>f.value=D.value},[D.value==="file"?(w(),R("svg",Xye,[...x[7]||(x[7]=[A("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)])])):D.value==="paste"?(w(),R("svg",Zye,[...x[8]||(x[8]=[A("rect",{x:"8",y:"2",width:"8",height:"4",rx:"1"},null,-1),A("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",Qye,[...x[9]||(x[9]=[A("path",{d:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20"},null,-1),A("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)])])),He(" "+pe(D.text),1)],10,Kye)),64))]),p(f)==="file"?(w(),Q(_,{key:0,onLoaded:x[1]||(x[1]=(D,M)=>y.$emit("loaded",D,M)),onBpc:x[2]||(x[2]=(D,M)=>y.$emit("bpc",D,M)),onDragState:x[3]||(x[3]=D=>b.value=D)})):p(f)==="paste"?(w(),R("div",Jye,[A("div",e2e,[p(h)?oe("",!0):(w(),R("div",t2e,[...x[10]||(x[10]=[He(" category Gold Silver Bronze",-1),A("br",null,null,-1),He(" USA 40 44 42",-1),A("br",null,null,-1),He(" China 38 32 19 ",-1)])])),Go(A("textarea",{ref_key:"pasteArea",ref:m,"onUpdate:modelValue":x[4]||(x[4]=D=>Ze(h)?h.value=D:null),class:"upload-card__paste__wrap__area",spellcheck:"false",onPaste:g},null,544),[[uf,p(h)]])]),A("div",n2e,[A("div",o2e,[(w(!0),R(Re,null,vt(p(e),D=>(w(),R("span",{key:D,class:"upload-card__paste__footer__hint__kbd"},pe(D),1))),128)),x[11]||(x[11]=He(" paste from spreadsheet ",-1))]),A("button",{class:"upload-card__paste__footer__btn",disabled:!p(h).trim(),onClick:x[5]||(x[5]=D=>y.$emit("loaded",p(h),"Pasted"))}," Load data ",8,r2e)])])):p(f)==="samples"?(w(),Q(C,{key:2,onSelect:x[6]||(x[6]=D=>y.$emit("sample",D))})):oe("",!0)],2)])}}}),s2e=Be(i2e,[["__scopeId","data-v-8d518e50"]]),a2e=se({__name:"DataPanel",setup(t){const e=pr(),{dataView:n}=Tt(e),{setDataView:o}=e,r=er(),{applyDsl:i}=Jc(),{loadSample:s}=Pr(),{next:a}=xx(),l=Tt(WB()),{activeScene:c,activeIndex:u,update:d}=Sn(),f=S(()=>c.value!==null);vn(()=>{r.columns.value.length>0?o("structure"):o("upload")});function h(){if(!r.rawInput.value||r.sourceFormat.value!=="delimited")return;const v=Tb(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=Tb(v,{firstRowIsHeader:l.firstRowIsHeader.value,delimiter:l.delimiter.value,decimalSeparator:l.decimalSeparator.value,trimWhitespace:l.trimWhitespace.value}),_=Lg(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 Ke([()=>l.firstRowIsHeader.value,()=>l.delimiter.value,()=>l.decimalSeparator.value,()=>l.trimWhitespace.value],()=>{r.rawInput.value&&n.value==="structure"&&h()}),(v,y)=>{const x=s2e,_=Eye;return w(),R("div",{class:Te(["data-panel",{"data-panel--structure":p(n)==="structure"}])},[p(n)==="upload"?(w(),Q(x,{key:0,onLoaded:m,onBpc:b,onSample:g,onCancel:y[0]||(y[0]=C=>p(o)("structure"))})):(w(),Q(_,{key:1}))],2)}}}),l2e=Be(a2e,[["__scopeId","data-v-4fa651c7"]]),c2e=["aria-label","aria-disabled","disabled"],u2e={class:"panel-open-button__label"},d2e=se({__name:"PanelOpenButton",props:{label:{},icon:{default:()=>fO},disabled:{type:Boolean,default:!1}},emits:["open"],setup(t,{emit:e}){const n=e;function o(){n("open")}return(r,i)=>(w(),R("button",{class:"panel-open-button",type:"button","aria-label":t.label,"aria-disabled":t.disabled?"true":void 0,disabled:t.disabled,onClick:o},[(w(),Q(Rt(t.icon),{class:"panel-open-button__icon","aria-hidden":"true"})),A("span",u2e,pe(t.label),1)],8,c2e))}}),f2e=Be(d2e,[["__scopeId","data-v-218f5209"]]),h2e={class:"layout-narrow-dock",role:"toolbar","aria-label":"Wizard controls"},p2e={class:"layout-narrow-dock__timeline"},m2e={class:"layout-narrow-dock__action"},g2e=se({__name:"LayoutNarrowDock",props:{showTimeline:{type:Boolean},scenes:{},activeIndex:{},playing:{type:Boolean},panelLabel:{},panelIcon:{default:void 0},panelDisabled:{type:Boolean,default:!1},scenesSheetOpen:{type:Boolean,default:!1}},emits:["update:activeIndex","play","pause","expand-timeline","open-panel"],setup(t,{emit:e}){const n=e;function o(r){n("update:activeIndex",r)}return(r,i)=>(w(),R("div",h2e,[A("div",p2e,[t.showTimeline?(w(),Q(p(Dq),{key:0,scenes:t.scenes,"active-index":t.activeIndex,playing:t.playing,expanded:t.scenesSheetOpen,"onUpdate:activeIndex":o,onPlay:i[0]||(i[0]=s=>n("play")),onPause:i[1]||(i[1]=s=>n("pause")),onExpand:i[2]||(i[2]=s=>n("expand-timeline"))},null,8,["scenes","active-index","playing","expanded"])):oe("",!0)]),A("div",m2e,[H(f2e,{label:t.panelLabel,icon:t.panelIcon,disabled:t.panelDisabled,onOpen:i[3]||(i[3]=s=>n("open-panel"))},null,8,["label","icon","disabled"])])]))}}),v2e=Be(g2e,[["__scopeId","data-v-cc656101"]]),b2e={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function y2e(t,e){return w(),R("svg",b2e,[...e[0]||(e[0]=[A("path",{fill:"currentColor",d:"M224 48H32a8 8 0 0 0-8 8v136a16 16 0 0 0 16 16h176a16 16 0 0 0 16-16V56a8 8 0 0 0-8-8M40 112h40v32H40Zm56 0h120v32H96Zm120-48v32H40V64ZM40 160h40v32H40Zm176 32H96v-32h120z"},null,-1)])])}const qS=Oe({name:"ph-table",render:y2e}),x2e={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function w2e(t,e){return w(),R("svg",x2e,[...e[0]||(e[0]=[A("path",{fill:"currentColor",d:"M216 112v96a16 16 0 0 1-16 16H56a16 16 0 0 1-16-16v-96a16 16 0 0 1 16-16h24a8 8 0 0 1 0 16H56v96h144v-96h-24a8 8 0 0 1 0-16h24a16 16 0 0 1 16 16M93.66 69.66L120 43.31V136a8 8 0 0 0 16 0V43.31l26.34 26.35a8 8 0 0 0 11.32-11.32l-40-40a8 8 0 0 0-11.32 0l-40 40a8 8 0 0 0 11.32 11.32"},null,-1)])])}const YS=Oe({name:"ph-export",render:w2e}),_2e=1500;function k2e(t){const e=Ne("idle");let n=null;async function o(){if(!t.isSignedIn()||!t.isCloudChart())return;e.value="saving";const i=await t.pushCloud(t.snapshot());e.value=i?"saved":"offline"}function r(){!t.isSignedIn()||!t.isCloudChart()||(n&&clearTimeout(n),n=setTimeout(()=>{n=null,o()},_2e))}return{status:e,requestSync:r,flush:o}}function S2e(){const{isSignedIn:t}=fl(),{isCloudBacked:e,syncCloud:n}=dl(),{sessionId:o,lastSavedAt:r}=Pr(),{title:i,chartType:s}=dn(),{generateDsl:a}=yc(),l=k2e({isSignedIn:()=>t.value,isCloudChart:()=>!!o.value&&e(o.value),pushCloud:n,snapshot:()=>({id:o.value,dsl:a(),meta:Dg(o.value),title:i.value,chartType:s.value})});return Ke(r,()=>{l.requestSync()}),l}const C2e={class:"wizard-shell"},A2e=["title","aria-label"],$2e={class:"wizard-shell__main"},T2e={class:"wizard-shell__content"},O2e=se({__name:"WizardShell",setup(t){const{currentStep:e,currentIndex:n,steps:o,registerCreateSession:r}=xx(),i=er(),s=dn(),{sessionId:a,createSession:l,lastSavedAt:c}=Pr();ms()&&S2e();const{markCloudBacked:u}=dl(),{isSignedIn:d}=fl(),f=Sn(),{scenes:h,activeIndex:m,activeScene:b,playing:g,startPlayback:v,stopPlayback:y}=f,x=S(()=>b.value!==null),{baseOptions:_}=Cn(),C=Rr(),D=Fe([]),M=S(()=>c.value?new Date(c.value):""),$=NR(M),L=S(()=>M.value?`saved ${$.value}`:null),{isNarrow:E}=Yr("lg"),{isNarrow:N}=Yr("md"),{isNarrow:T}=Yr(),O=pr(),{dataView:P}=Tt(O),B=Ng(),V=Fe(!1),z=S(()=>{switch(e.value.key){case"data":return"Data panel";case"edit":return"Edit panel";case"export":return"Export panel";default:return"Open panel"}}),G=S(()=>{switch(e.value.key){case"data":return qS;case"edit":return Gs;case"export":return YS;default:return Gs}}),K=S(()=>e.value.key==="data"&&i.rows.value.length===0);function ne(){if(!K.value)if(e.value.key==="data"){let q=O.lastNarrowDataTab.value;x.value&&q==="parsing"&&(q="column"),O.openDataPanel(q)}else e.value.key==="edit"?O.selectTab(O.lastNarrowEditTab.value):e.value.key==="export"&&B.setExportTab(B.lastNarrowExportTab.value)}function ae(){V.value=!0}function he(q){ie(q),V.value=!1}const ge={data:qS,edit:Gs,export:YS},le=o.map(q=>({label:q.label,key:q.key,icon:ge[q.key]})),fe=S(()=>i.rows.value.length>0?[]:[1,2]);function we(){f.add(),f.setActive(h.value.length-1)}const Z=Fe({}),be=[Ve.BarVertical,Ve.BarHorizontal,Ve.Line,Ve.VerticalBar,Ve.HorizontalBar];function re(q){var te,ue,ye;const Y=ks(q.dataStr);if((te=Y.series)!=null&&te.length&&be.includes(q.chartType)){const _e=Y.series.find(Ae=>Ae.name===s._base.selectedColumn.value);_e&&(Y.values=_e.values),delete Y.series}return px(q.chartType,Y,q.typeOpts,q.sort,{colorizes:(ue=q.colorizes)!=null&&ue.length?q.colorizes:void 0,seriesOverrides:(ye=q.seriesOverrides)!=null&&ye.length?q.seriesOverrides:void 0})}function ve(q,Y){var te;if((q==null?void 0:q.data)!==void 0)return q.data;if((te=q==null?void 0:q.transforms)!=null&&te.length&&i.columns.value.length>0){const ue=C.applyStepList(q.transforms,i.columns.value,i.rows.value,i.columnTypes.value);return Lg(ue.columns,ue.rows)}return Y}function ce(){const q=s._base,Y={};Y[0]=re({chartType:q.chartType.value,dataStr:q.data.value,typeOpts:_.value,sort:q.sort.value,colorizes:q.colorizes.value,seriesOverrides:q.seriesOverrides.value});for(let te=0;te<h.value.length;te++){const ue=Ka(h.value,te);Y[te+1]=re({chartType:(ue==null?void 0:ue.chartType)??q.chartType.value,dataStr:ve(ue,q.data.value),typeOpts:ue!=null&&ue.chartTypeOptions?{..._.value,...ue.chartTypeOptions}:_.value,sort:WT(ue)??q.sort.value,colorizes:(ue==null?void 0:ue.colorizes)??q.colorizes.value,seriesOverrides:(ue==null?void 0:ue.seriesOverrides)??q.seriesOverrides.value})}Z.value=Y}const I=wR(ce,300);Ke([()=>h.value,s._base.chartType,s._base.data,s._base.sort,s._base.colorizes,s._base.seriesOverrides,s._base.selectedColumn,_,e],()=>{e.value.key==="edit"&&I()},{deep:!0});function U(q){var ye;const Y=s._base.title.value;if(q<0)return Y||" ";const te=Ka(h.value,q),ue=(ye=te==null?void 0:te.properties)==null?void 0:ye.title;return ue!==void 0?ue||" ":Y||" "}const j=S(()=>{const q={name:U(-1),index:0,removable:!1,thumbnail:Z.value[0]??null,hint:"base scene"},Y=h.value.map((te,ue)=>{const ye=ue+1,_e=HT(h.value,ue);let Ae;return _e===ue?Ae="custom data":_e<0?Ae="inherits base":Ae=`inherits ${U(_e)||`Scene ${_e+1}`}`,{name:U(ue),index:ye,removable:!0,thumbnail:Z.value[ye]??null,hint:Ae}});return[q,...Y]}),ee=S(()=>m.value+1);function ie(q){f.setActive(q-1)}function de(q){q<=0||f.remove(q-1)}const ke=S(()=>{const q=e.value.key;return q==="export"||q==="data"&&P.value==="upload"?!1:q==="edit"?!0:h.value.length>=1});wi(VB,{scenes:j,activeIndex:ee,playing:g,showTimeline:ke,onSelect:ie,onAdd:we,onRemove:de,onPlay:v,onPause:y}),Ke(m,(q,Y)=>{var te,ue;e.value.key==="data"&&(Y===-1&&q>=0?(D.value=C.snapshot(),C.hydrate(((te=h.value[q])==null?void 0:te.transforms)??[])):Y>=0&&q===-1?(f.update(Y,{transforms:C.snapshot()}),C.hydrate(D.value)):Y>=0&&q>=0&&(f.update(Y,{transforms:C.snapshot()}),C.hydrate(((ue=h.value[q])==null?void 0:ue.transforms)??[])))}),vn(()=>{e.value.key==="edit"&&s._base.data.value&&ce()});function X(){m.value>=0&&(f.update(m.value,{transforms:C.snapshot()}),C.hydrate(D.value),f.setActive(-1)),s._base.data.value=i.serialize();const q=s._base.chartType.value,Y=q.includes("multi")||q.includes("stacked")||q===Ve.BarSplit||q===Ve.BarGrouped;if(i.columns.value.length>2&&!Y){const te=i.columnTypes.value[0]==="date";s._base.chartType.value=te?Ve.LineMulti:Ve.BarMulti}}return r(()=>{X();const q=l();return ms()&&d.value&&u(q),q}),Ke(()=>e.value.key,(q,Y)=>{Y==="data"&&q==="edit"&&a.value&&X()}),FN(()=>{qie()}),(q,Y)=>{const te=l2e,ue=e1e,ye=_ue;return w(),R("div",C2e,[H(uO,{class:"wizard-shell__header"},{start:J(()=>[H(dO),p(L)&&p(E)?(w(),R("span",{key:0,class:"wizard-shell__saved-dot",role:"status","aria-live":"polite",title:p(L),"aria-label":p(L)},null,8,A2e)):oe("",!0)]),center:J(()=>[H(p(KU),{"current-step":p(n),"onUpdate:currentStep":Y[0]||(Y[0]=_e=>Ze(n)?n.value=_e:null),steps:p(le),"disabled-steps":p(fe),layout:p(N)?"stacked":"inline"},null,8,["current-step","steps","disabled-steps","layout"])]),end:J(()=>[p(L)&&!p(E)?(w(),Q(p(jy),{key:0,variant:"success",pill:"",class:"wizard-shell__saved",role:"status","aria-live":"polite"},{default:J(()=>[Y[2]||(Y[2]=A("span",{class:"wizard-shell__saved__dot"},null,-1)),He(" "+pe(p(L)),1)]),_:1})):oe("",!0)]),_:1}),A("div",$2e,[A("div",T2e,[p(e).key==="data"?(w(),Q(te,{key:0})):p(e).key==="edit"?(w(),Q(ue,{key:1})):p(e).key==="export"?(w(),Q(ye,{key:2})):oe("",!0)]),p(T)?(w(),Q(v2e,{key:0,"show-timeline":p(ke),scenes:p(j),"active-index":p(ee),playing:p(g),"panel-label":p(z),"panel-icon":p(G),"panel-disabled":p(K),"scenes-sheet-open":p(V),"onUpdate:activeIndex":ie,onPlay:p(v),onPause:p(y),onExpandTimeline:ae,onOpenPanel:ne},null,8,["show-timeline","scenes","active-index","playing","panel-label","panel-icon","panel-disabled","scenes-sheet-open","onPlay","onPause"])):oe("",!0),p(T)?(w(),Q(p(CA),{key:1,modelValue:p(V),"onUpdate:modelValue":Y[1]||(Y[1]=_e=>Ze(V)?V.value=_e:null),title:"Scenes"},{default:J(()=>[H(p(Yq),{scenes:p(j),"active-index":p(ee),playing:p(g),"onUpdate:activeIndex":he,onAdd:we,onRemove:de,onPlay:p(v),onPause:p(y)},null,8,["scenes","active-index","playing","onPlay","onPause"])]),_:1},8,["modelValue"])):oe("",!0)])])}}}),ap=Be(O2e,[["__scopeId","data-v-c364e526"]]),M2e={class:"render-page"},B2e=se({__name:"RenderPage",setup(t){const e=uc(),n=bt("containerRef"),{applyDsl:o}=Jc();Sx(n);const{layout:r}=dn(),{cardClass:i,cardStyle:s}=kx(r,"render-page__card"),{scenes:a,activeIndex:l,playing:c,setActive:u,nextScene:d,previousScene:f,startPlayback:h,stopPlayback:m}=Sn(),b={buttons:nb,"progress-bar":PA,"dot-stepper":DA,"minimal-arrows":EA},g=S(()=>b[r.value.playerType]||nb),v=S(()=>a.value.length+1),y=S(()=>l.value+2),x=S(()=>a.value.length>=1);function _(L){u(L-2)}const C=Fe(null);function D(){var L;return((L=n.value)==null?void 0:L.querySelector(".bc-frame-footer"))??null}let M=null;Ke(n,L=>{if(M&&(M.disconnect(),M=null),!L){C.value=null;return}C.value=D(),M=new MutationObserver(()=>{C.value=D()}),M.observe(L,{childList:!0,subtree:!0})},{immediate:!0}),oa(()=>{M&&(M.disconnect(),M=null)});function $(L){try{const E=globalThis.atob(L),N=Uint8Array.from(E,O=>O.charCodeAt(0)),T=new TextDecoder().decode(N);o(T)}catch{}}return vn(async()=>{const L=e.query.id;if(L&&ms()){const{fetchPublished:N}=dl(),T=await N(L);T&&o(T);return}const E=e.query.bpc64;E&&$(E)}),(L,E)=>(w(),R("div",M2e,[A("div",{ref_key:"containerRef",ref:n,class:Te(["render-page__card",p(i)]),style:Lt(p(s))},null,6),p(C)&&p(x)?(w(),Q(Oy,{key:0,to:p(C)},[(w(),Q(Rt(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"])):oe("",!0)]))}}),L2e=Be(B2e,[["__scopeId","data-v-f1797748"]]);async function _1(t){var i;const{sessionId:e,loadChart:n,startAutoSave:o}=Pr(),r=t.params.id;if(e.value!==r){if(n(r)){o();return}if(ms()){const s=fl();await s.init();const a=(i=s.user.value)==null?void 0:i.id;if(a){const l=dl(),c=await l.loadCloud(r);if(c&&c.owner===a&&(localStorage.setItem(ns(r),c.dsl),c.meta&&Object.keys(c.meta).length>0&&localStorage.setItem(Pa(r),JSON.stringify(c.meta)),l.markCloudBacked(r),n(r))){o();return}}return`/render?id=${r}`}return"/charts"}}function P2e(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 D2e=hR({history:GN(),scrollBehavior(t,e,n){return n||(t.hash?{el:t.hash,behavior:"smooth"}:{top:0})},routes:[{path:"/",component:()=>ob(()=>import("./LandingPage-mQMQYQqJ.js"),__vite__mapDeps([0,1]))},{path:"/charts",component:kle},{path:"/new",component:ap,beforeEnter:()=>{const{prepareNew:t}=Pr();t()}},{path:"/edit/:id",redirect:t=>`/edit/${t.params.id}/visualize`},{path:"/copy",component:()=>ob(()=>import("./CopyRedirect-CZMEmM8M.js"),[]),meta:{bare:!0},beforeEnter:t=>{const e=t.query.bpc64,n=P2e(typeof e=="string"?e:"");if(!n)return"/";const{createFromDsl:o}=Pr(),r=o(n);if(!r)return"/";t.meta.copyTarget=`/edit/${r}/visualize`}},{path:"/edit/:id/data",component:ap,beforeEnter:_1},{path:"/edit/:id/visualize",component:ap,beforeEnter:_1},{path:"/edit/:id/export",component:ap,beforeEnter:_1},{path:"/render",component:L2e,meta:{bare:!0}}]});async function E2e(){const e=new URLSearchParams(window.location.search).get("code");if(!e)return;const n=await zr();if(n)try{await n.auth.exchangeCodeForSession(e)}catch{}const o=`${window.location.origin}${window.location.pathname}${window.location.hash||"#/charts"}`;window.history.replaceState({},"",o)}async function I2e(){await nj(),ms()&&await E2e();const t=vP();t.use($P),pP(Xse).use(t).use(D2e).use(iN()).mount("#app")}I2e();export{oa as $,hse as A,zn as B,_R as C,IT as D,bt as E,Ut as F,dk as G,jy as H,PY as I,s2 as J,Re as K,vt as L,pe as M,oG as N,Ase as O,wr as P,Oe as Q,Te as R,V2e as S,Mfe as T,wO as U,_O as V,Z1e as W,bx as X,UB as Y,Ne as Z,Be as _,A as a,Ole as a0,Oy as a1,nb as a2,uc as a3,Rm as a4,oe as b,R as c,se as d,t2 as e,Q as f,p as g,g2 as h,H as i,He as j,S as k,ms as l,wm as m,RA as n,w as o,NA as p,MY as q,Ce as r,$Y as s,Ke as t,Yf as u,ps as v,J as w,Mg as x,Fe as y,Ze as z};
|